UNPKG

@git-temporal/git-temporal-react

Version:

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

1 lines 102 kB
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=4)}([function(e,t,n){"use strict";(function(e,r){var i;n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s})),function(){var t=Object.create(null);t["WinJS/Core/_WinJS"]={};var n=function(e,n,r){var i={},o=!1,s=n.map((function(e){return"exports"===e?(o=!0,i):t[e]})),u=r.apply({},s);t[e]=o?i:u};n("WinJS/Core/_Global",[],(function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==e?e:{}})),n("WinJS/Core/_BaseCoreUtils",["WinJS/Core/_Global"],(function(e){var t=!!e.Windows;var n=null;return{hasWinRT:t,markSupportedForProcessing:function(e){return e.supportedForProcessing=!0,e},_setImmediate:function(t){null===n&&(n=e.setImmediate?e.setImmediate.bind(e):void 0!==r&&"function"==typeof r.nextTick?r.nextTick.bind(r):e.setTimeout.bind(e)),n(t)}}})),n("WinJS/Core/_WriteProfilerMark",["WinJS/Core/_Global"],(function(e){return e.msWriteProfilerMark||function(){}})),n("WinJS/Core/_Base",["WinJS/Core/_WinJS","WinJS/Core/_Global","WinJS/Core/_BaseCoreUtils","WinJS/Core/_WriteProfilerMark"],(function(e,t,n,r){function i(e,t,n){var r,i,o,s=Object.keys(t),u=Array.isArray(e);for(i=0,o=s.length;i<o;i++){var a=s[i],l=95!==a.charCodeAt(0),c=t[a];!c||"object"!=typeof c||void 0===c.value&&"function"!=typeof c.get&&"function"!=typeof c.set?l?u?e.forEach((function(e){e[a]=c})):e[a]=c:(r=r||{})[a]={value:c,enumerable:l,configurable:!0,writable:!0}:(void 0===c.enumerable&&(c.enumerable=l),n&&c.setName&&"function"==typeof c.setName&&c.setName(n+"."+a),(r=r||{})[a]=c)}r&&(u?e.forEach((function(e){Object.defineProperties(e,r)})):Object.defineProperties(e,r))}return function(){var n=e;function o(n,r){var i=n||{};if(r){var o=r.split(".");i===t&&"WinJS"===o[0]&&(i=e,o.splice(0,1));for(var s=0,u=o.length;s<u;s++){var a=o[s];i[a]||Object.defineProperty(i,a,{value:{},writable:!1,enumerable:!0,configurable:!0}),i=i[a]}}return i}function s(e,t,n){var r=o(e,t);return n&&i(r,n,t||"<ANONYMOUS>"),r}n.Namespace||(n.Namespace=Object.create(Object.prototype));var u=1,a=2,l=3;Object.defineProperties(n.Namespace,{defineWithParent:{value:s,writable:!0,enumerable:!0,configurable:!0},define:{value:function(e,n){return s(t,e,n)},writable:!0,enumerable:!0,configurable:!0},_lazy:{value:function(e){var t,n,i=u;return{setName:function(e){t=e},get:function(){switch(i){case l:return n;case u:i=a;try{r("WinJS.Namespace._lazy:"+t+",StartTM"),n=e()}finally{r("WinJS.Namespace._lazy:"+t+",StopTM"),i=u}return e=null,i=l,n;case a:throw"Illegal: reentrancy on initialization";default:throw"Illegal"}},set:function(e){switch(i){case a:throw"Illegal: reentrancy on initialization";default:i=l,n=e}},enumerable:!0,configurable:!0}},writable:!0,enumerable:!0,configurable:!0},_moduleDefine:{value:function(e,n,r){var s=[e],u=null;return n&&(u=o(t,n),s.push(u)),i(s,r,n||"<ANONYMOUS>"),u},writable:!0,enumerable:!0,configurable:!0}})}(),function(){function t(e,t,r){return e=e||function(){},n.markSupportedForProcessing(e),t&&i(e.prototype,t),r&&i(e,r),e}e.Namespace.define("WinJS.Class",{define:t,derive:function(e,r,o,s){if(e){r=r||function(){};var u=e.prototype;return r.prototype=Object.create(u),n.markSupportedForProcessing(r),Object.defineProperty(r.prototype,"constructor",{value:r,writable:!0,configurable:!0,enumerable:!0}),o&&i(r.prototype,o),s&&i(r,s),r}return t(r,o,s)},mix:function(e){var t,n;for(e=e||function(){},t=1,n=arguments.length;t<n;t++)i(e.prototype,arguments[t]);return e}})}(),{Namespace:e.Namespace,Class:e.Class}})),n("WinJS/Core/_ErrorFromName",["WinJS/Core/_Base"],(function(e){var t=e.Class.derive(Error,(function(e,t){this.name=e,this.message=t||e}),{},{supportedForProcessing:!1});return e.Namespace.define("WinJS",{ErrorFromName:t}),t})),n("WinJS/Core/_Events",["exports","WinJS/Core/_Base"],(function(e,t){function n(e){var t="_on"+e+"state";return{get:function(){var e=this[t];return e&&e.userHandler},set:function(n){var r=this[t];n?(r||(r={wrapper:function(e){return r.userHandler(e)},userHandler:n},Object.defineProperty(this,t,{value:r,enumerable:!1,writable:!0,configurable:!0}),this.addEventListener(e,r.wrapper,!1)),r.userHandler=n):r&&(this.removeEventListener(e,r.wrapper,!1),this[t]=null)},enumerable:!0}}var r=t.Class.define((function(e,t,n){this.detail=t,this.target=n,this.timeStamp=Date.now(),this.type=e}),{bubbles:{value:!1,writable:!1},cancelable:{value:!1,writable:!1},currentTarget:{get:function(){return this.target}},defaultPrevented:{get:function(){return this._preventDefaultCalled}},trusted:{value:!1,writable:!1},eventPhase:{value:0,writable:!1},target:null,timeStamp:null,type:null,preventDefault:function(){this._preventDefaultCalled=!0},stopImmediatePropagation:function(){this._stopImmediatePropagationCalled=!0},stopPropagation:function(){}},{supportedForProcessing:!1}),i={_listeners:null,addEventListener:function(e,t,n){n=n||!1,this._listeners=this._listeners||{};for(var r=this._listeners[e]=this._listeners[e]||[],i=0,o=r.length;i<o;i++){var s=r[i];if(s.useCapture===n&&s.listener===t)return}r.push({listener:t,useCapture:n})},dispatchEvent:function(e,t){var n=this._listeners&&this._listeners[e];if(n){for(var i=new r(e,t,this),o=0,s=(n=n.slice(0,n.length)).length;o<s&&!i._stopImmediatePropagationCalled;o++)n[o].listener(i);return i.defaultPrevented||!1}return!1},removeEventListener:function(e,t,n){n=n||!1;var r=this._listeners&&this._listeners[e];if(r)for(var i=0,o=r.length;i<o;i++){var s=r[i];if(s.listener===t&&s.useCapture===n){r.splice(i,1),0===r.length&&delete this._listeners[e];break}}}};t.Namespace._moduleDefine(e,"WinJS.Utilities",{_createEventProperty:n,createEventProperties:function(){for(var e={},t=0,r=arguments.length;t<r;t++){var i=arguments[t];e["on"+i]=n(i)}return e},eventMixin:i})})),n("WinJS/Core/_Trace",["WinJS/Core/_Global"],(function(e){function t(e){return e}return{_traceAsyncOperationStarting:e.Debug&&e.Debug.msTraceAsyncOperationStarting&&e.Debug.msTraceAsyncOperationStarting.bind(e.Debug)||t,_traceAsyncOperationCompleted:e.Debug&&e.Debug.msTraceAsyncOperationCompleted&&e.Debug.msTraceAsyncOperationCompleted.bind(e.Debug)||t,_traceAsyncCallbackStarting:e.Debug&&e.Debug.msTraceAsyncCallbackStarting&&e.Debug.msTraceAsyncCallbackStarting.bind(e.Debug)||t,_traceAsyncCallbackCompleted:e.Debug&&e.Debug.msTraceAsyncCallbackCompleted&&e.Debug.msTraceAsyncCallbackCompleted.bind(e.Debug)||t}})),n("WinJS/Promise/_StateMachine",["WinJS/Core/_Global","WinJS/Core/_BaseCoreUtils","WinJS/Core/_Base","WinJS/Core/_ErrorFromName","WinJS/Core/_Events","WinJS/Core/_Trace"],(function(e,t,n,r,i,o){e.Debug&&(e.Debug.setNonUserCodeExceptions=!0);var s=new(n.Class.mix(n.Class.define(null,{},{supportedForProcessing:!1}),i.eventMixin));s._listeners={};var u=!1,a={promise:1,thenPromise:2,errorPromise:4,exceptionPromise:8,completePromise:16};a.all=a.promise|a.thenPromise|a.errorPromise|a.exceptionPromise|a.completePromise;var l,c,h,f,d,m,p,_,g,v,y=1;function C(){}l={name:"created",enter:function(e){e._setState(c)},cancel:C,done:C,then:C,_completed:C,_error:C,_notify:C,_progress:C,_setCompleteValue:C,_setErrorValue:C},c={name:"working",enter:C,cancel:function(e){e._setState(d)},done:P,then:F,_completed:S,_error:O,_notify:C,_progress:k,_setCompleteValue:D,_setErrorValue:U},h={name:"waiting",enter:function(e){var t=e._value;if(t instanceof V&&t._state!==v&&t._state!==_)I(t,{promise:e});else{var n=function(r){t._errorId?e._chainedError(r,t):(M(e,r,N,t,n),e._error(r))};n.handlesOnError=!0,t.then(e._completed.bind(e),n,e._progress.bind(e))}},cancel:function(e){e._setState(f)},done:P,then:F,_completed:S,_error:O,_notify:C,_progress:k,_setCompleteValue:D,_setErrorValue:U},f={name:"waiting_canceled",enter:function(e){e._setState(m);var t=e._value;t.cancel&&t.cancel()},cancel:C,done:P,then:F,_completed:S,_error:O,_notify:C,_progress:k,_setCompleteValue:D,_setErrorValue:U},d={name:"canceled",enter:function(e){e._setState(m),e._cancelAction()},cancel:C,done:P,then:F,_completed:S,_error:O,_notify:C,_progress:k,_setCompleteValue:D,_setErrorValue:U},m={name:"canceling",enter:function(e){var t=new Error("Canceled");t.name=t.message,e._value=t,e._setState(g)},cancel:C,done:C,then:C,_completed:C,_error:C,_notify:C,_progress:C,_setCompleteValue:C,_setErrorValue:C},p={name:"complete_notify",enter:function(e){if(e.done=j.prototype.done,e.then=j.prototype.then,e._listeners)for(var t,n=[e];n.length;)(t=n.shift())._state._notify(t,n);e._setState(_)},cancel:C,done:null,then:null,_completed:C,_error:C,_notify:T,_progress:C,_setCompleteValue:C,_setErrorValue:C},_={name:"success",enter:function(e){e.done=j.prototype.done,e.then=j.prototype.then,e._cleanupAction()},cancel:C,done:null,then:null,_completed:C,_error:C,_notify:T,_progress:C,_setCompleteValue:C,_setErrorValue:C},g={name:"error_notify",enter:function(e){if(e.done=W.prototype.done,e.then=W.prototype.then,e._listeners)for(var t,n=[e];n.length;)(t=n.shift())._state._notify(t,n);e._setState(v)},cancel:C,done:null,then:null,_completed:C,_error:C,_notify:x,_progress:C,_setCompleteValue:C,_setErrorValue:C},v={name:"error",enter:function(e){e.done=W.prototype.done,e.then=W.prototype.then,e._cleanupAction()},cancel:C,done:null,then:null,_completed:C,_error:C,_notify:x,_progress:C,_setCompleteValue:C,_setErrorValue:C};var b=n.Class.define(null,{_listeners:null,_nextState:null,_state:null,_value:null,cancel:function(){this._state.cancel(this),this._run()},done:function(e,t,n){this._state.done(this,e,t,n)},then:function e(t,n,r){if(this.then===e)return this._state.then(this,t,n,r);this.then(t,n,r)},_chainedError:function(e,t){var n=this._state._error(this,e,L,t);return this._run(),n},_completed:function(e){var t=this._state._completed(this,e);return this._run(),t},_error:function(e){var t=this._state._error(this,e,A);return this._run(),t},_progress:function(e){this._state._progress(this,e)},_setState:function(e){this._nextState=e},_setCompleteValue:function(e){this._state._setCompleteValue(this,e),this._run()},_setChainedErrorValue:function(e,t){var n=this._state._setErrorValue(this,e,L,t);return this._run(),n},_setExceptionValue:function(e){var t=this._state._setErrorValue(this,e,w);return this._run(),t},_run:function(){for(;this._nextState;)this._state=this._nextState,this._nextState=null,this._state.enter(this)}},{supportedForProcessing:!1});function S(e,t){var n;n=t&&"object"==typeof t&&"function"==typeof t.then?h:p,e._value=t,e._setState(n)}function E(e,t,n,r,i,o){return{exception:e,error:t,promise:n,handler:o,id:r,parent:i}}function N(e,t,n,r){var i=n._isException;return E(i?t:null,i?null:t,e,n._errorId,n,r)}function L(e,t,n){var r=n._isException,i=n._errorId;return R(e,i,r),E(r?t:null,r?null:t,e,i,n)}function A(e,t){var n=++y;return R(e,n),E(null,t,e,n)}function w(e,t){var n=++y;return R(e,n,!0),E(t,null,e,n)}function P(e,t,n,r){I(e,{c:t,e:n,p:r,asyncOpID:o._traceAsyncOperationStarting("WinJS.Promise.done")})}function O(e,t,n,r){e._value=t,M(e,t,n,r),e._setState(g)}function T(t,n){var r,i,s=t._value,u=t._listeners;if(u)for(t._listeners=null,r=0,i=Array.isArray(u)?u.length:1;r<i;r++){var a=1===i?u:u[r],l=a.c,c=a.promise;if(o._traceAsyncOperationCompleted(a.asyncOpID,e.Debug&&e.Debug.MS_ASYNC_OP_STATUS_SUCCESS),c){o._traceAsyncCallbackStarting(a.asyncOpID);try{c._setCompleteValue(l?l(s):s)}catch(e){c._setExceptionValue(e)}finally{o._traceAsyncCallbackCompleted()}c._state!==h&&c._listeners&&n.push(c)}else j.prototype.done.call(t,l)}}function x(t,n){var r,i,s=t._value,u=t._listeners;if(u)for(t._listeners=null,r=0,i=Array.isArray(u)?u.length:1;r<i;r++){var a=1===i?u:u[r],l=a.e,c=a.promise,f=e.Debug&&(s&&"Canceled"===s.name?e.Debug.MS_ASYNC_OP_STATUS_CANCELED:e.Debug.MS_ASYNC_OP_STATUS_ERROR);if(o._traceAsyncOperationCompleted(a.asyncOpID,f),c){var d=!1;try{l?(o._traceAsyncCallbackStarting(a.asyncOpID),d=!0,l.handlesOnError||M(c,s,N,t,l),c._setCompleteValue(l(s))):c._setChainedErrorValue(s,t)}catch(e){c._setExceptionValue(e)}finally{d&&o._traceAsyncCallbackCompleted()}c._state!==h&&c._listeners&&n.push(c)}else W.prototype.done.call(t,null,l)}}function M(e,t,n,r,i){if(s._listeners.error){if(t instanceof Error&&"Canceled"===t.message)return;s.dispatchEvent("error",n(e,t,r,i))}}function k(e,t){var n,r,i=e._listeners;if(i)for(n=0,r=Array.isArray(i)?i.length:1;n<r;n++){var o=1===r?i:i[n],s=o.p;if(s)try{s(t)}catch(e){}o.c||o.e||!o.promise||o.promise._progress(t)}}function I(e,t){var n=e._listeners;n?(n=Array.isArray(n)?n:[n]).push(t):n=t,e._listeners=n}function R(e,t,n){e._isException=n||!1,e._errorId=t}function U(e,t,n,r){e._value=t,M(e,t,n,r),e._setState(v)}function D(e,t){var n;n=t&&"object"==typeof t&&"function"==typeof t.then?h:_,e._value=t,e._setState(n)}function F(e,t,n,r){var i=new V(e);return I(e,{promise:i,c:t,e:n,p:r,asyncOpID:o._traceAsyncOperationStarting("WinJS.Promise.then")}),i}var K,V=n.Class.derive(b,(function(e){u&&(!0===u||u&a.thenPromise)&&(this._stack=B._getStack()),this._creator=e,this._setState(l),this._run()}),{_creator:null,_cancelAction:function(){this._creator&&this._creator.cancel()},_cleanupAction:function(){this._creator=null}},{supportedForProcessing:!1}),W=n.Class.define((function(e){u&&(!0===u||u&a.errorPromise)&&(this._stack=B._getStack()),this._value=e,M(this,e,A)}),{cancel:function(){},done:function(e,t){var n=this._value;if(t)try{t.handlesOnError||M(null,n,N,this,t);var r=t(n);return void(r&&"object"==typeof r&&"function"==typeof r.done&&r.done())}catch(e){n=e}n instanceof Error&&"Canceled"===n.message||B._doneHandler(n)},then:function(e,t){if(!t)return this;var n,r=this._value;try{t.handlesOnError||M(null,r,N,this,t),n=new j(t(r))}catch(e){n=e===r?this:new q(e)}return n}},{supportedForProcessing:!1}),q=n.Class.derive(W,(function(e){u&&(!0===u||u&a.exceptionPromise)&&(this._stack=B._getStack()),this._value=e,M(this,e,w)}),{},{supportedForProcessing:!1}),j=n.Class.define((function(e){if(u&&(!0===u||u&a.completePromise)&&(this._stack=B._getStack()),e&&"object"==typeof e&&"function"==typeof e.then){var t=new V(null);return t._setCompleteValue(e),t}this._value=e}),{cancel:function(){},done:function(e){if(e)try{var t=e(this._value);t&&"object"==typeof t&&"function"==typeof t.done&&t.done()}catch(e){B._doneHandler(e)}},then:function(e){try{var t=e?e(this._value):this._value;return t===this._value?this:new j(t)}catch(e){return new q(e)}}},{supportedForProcessing:!1});var B=n.Class.derive(b,(function(e,t){u&&(!0===u||u&a.promise)&&(this._stack=B._getStack()),this._oncancel=t,this._setState(l),this._run();try{e(this._completed.bind(this),this._error.bind(this),this._progress.bind(this))}catch(e){this._setExceptionValue(e)}}),{_oncancel:null,_cancelAction:function(){try{if(!this._oncancel)throw new Error("Promise did not implement oncancel");this._oncancel()}catch(e){e.message,e.stack;s.dispatchEvent("error",e)}},_cleanupAction:function(){this._oncancel=null}},{addEventListener:function(e,t,n){s.addEventListener(e,t,n)},any:function(e){return new B((function(t,n){var r=Object.keys(e);0===r.length&&t();var i=0;r.forEach((function(o){B.as(e[o]).then((function(){t({key:o,value:e[o]})}),(function(s){s instanceof Error&&"Canceled"===s.name?++i===r.length&&t(B.cancel):n({key:o,value:e[o]})}))}))}),(function(){Object.keys(e).forEach((function(t){var n=B.as(e[t]);"function"==typeof n.cancel&&n.cancel()}))}))},as:function(e){return e&&"object"==typeof e&&"function"==typeof e.then?e:new j(e)},cancel:{get:function(){return K=K||new W(new r("Canceled"))}},dispatchEvent:function(e,t){return s.dispatchEvent(e,t)},is:function(e){return e&&"object"==typeof e&&"function"==typeof e.then},join:function(e){return new B((function(t,n,r){var i=Object.keys(e),o=Array.isArray(e)?[]:{},s=Array.isArray(e)?[]:{},u=0,a=i.length,l=function(e){if(0==--a){var u=Object.keys(o).length;if(0===u)t(s);else{var l=0;i.forEach((function(e){var t=o[e];t instanceof Error&&"Canceled"===t.name&&l++})),l===u?t(B.cancel):n(o)}}else r({Key:e,Done:!0})};i.forEach((function(t){var n=e[t];void 0===n?u++:B.then(n,(function(e){s[t]=e,l(t)}),(function(e){o[t]=e,l(t)}))})),0!==(a-=u)||t(s)}),(function(){Object.keys(e).forEach((function(t){var n=B.as(e[t]);"function"==typeof n.cancel&&n.cancel()}))}))},removeEventListener:function(e,t,n){s.removeEventListener(e,t,n)},supportedForProcessing:!1,then:function(e,t,n,r){return B.as(e).then(t,n,r)},thenEach:function(e,t,n,r){var i=Array.isArray(e)?[]:{};return Object.keys(e).forEach((function(o){i[o]=B.as(e[o]).then(t,n,r)})),B.join(i)},timeout:function(n,r){var i,o,s=(i=n,new B((function(n){i?o=e.setTimeout(n,i):t._setImmediate(n)}),(function(){o&&e.clearTimeout(o)})));return r?function(e,t){var n=function(){e.cancel()};return e.then((function(){t.cancel()})),t.then(n,n),t}(s,r):s},wrap:function(e){return new j(e)},wrapError:function(e){return new W(e)},_veryExpensiveTagWithStack:{get:function(){return u},set:function(e){u=e}},_veryExpensiveTagWithStack_tag:a,_getStack:function(){if(e.Debug&&e.Debug.debuggerEnabled)try{throw new Error}catch(e){return e.stack}},_cancelBlocker:function(e,t){if(!B.is(e))return B.wrap(e);var n,r,i=new B((function(e,t){n=e,r=t}),(function(){n=null,r=null,t&&t()}));return e.then((function(e){n&&n(e)}),(function(e){r&&r(e)})),i}});return Object.defineProperties(B,i.createEventProperties("error")),B._doneHandler=function(e){t._setImmediate((function(){throw e}))},{PromiseStateMachine:b,Promise:B,state_created:l}})),n("WinJS/Promise",["WinJS/Core/_Base","WinJS/Promise/_StateMachine"],(function(e,t){return e.Namespace.define("WinJS",{Promise:t.Promise}),t.Promise})),(i=t["WinJS/Core/_WinJS"]).TPromise=i.Promise,i.PPromise=i.Promise}();var o=i.Promise,s=i.TPromise;i.PPromise}).call(this,n(2),n(3))},function(e,t,n){"use strict";(function(e,r){n.d(t,"c",(function(){return m})),n.d(t,"b",(function(){return p})),n.d(t,"a",(function(){return _})),n.d(t,"d",(function(){return v}));var i=!1,o=!1,s=!1,u=!1,a=!1,l=void 0!==e&&void 0!==e.versions&&void 0!==e.versions.electron&&"renderer"===e.type;if("object"!=typeof navigator||l){if("object"==typeof e){i="win32"===e.platform,o="darwin"===e.platform,s="linux"===e.platform,"en","en";var c=e.env.VSCODE_NLS_CONFIG;if(c)try{var h=JSON.parse(c),f=h.availableLanguages["*"];h.locale,f||"en",h._translationsConfigFile}catch(e){}u=!0}}else{var d=navigator.userAgent;i=d.indexOf("Windows")>=0,o=d.indexOf("Macintosh")>=0,s=d.indexOf("Linux")>=0,a=!0,navigator.language}var m=i,p=a,_="object"==typeof self?self:"object"==typeof r?r:{},g=null;function v(t){return null===g&&(g=_.setImmediate?_.setImmediate.bind(_):void 0!==e&&"function"==typeof e.nextTick?e.nextTick.bind(e):_.setTimeout.bind(_)),g(t)}}).call(this,n(3),n(2))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var a,l=[],c=!1,h=-1;function f(){c&&a&&(c=!1,a.length?l=a.concat(l):h=-1,l.length&&d())}function d(){if(!c){var e=u(f);c=!0;for(var t=l.length;t;){for(a=l,l=[];++h<t;)a&&a[h].run();h=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new m(e,t)),1!==l.length||c||u(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";n.r(t);var r=n(0),i={};r.b.addEventListener("error",(function(e){var t=e.detail,n=t.id;t.parent?t.handler&&i&&delete i[n]:(i[n]=t,1===Object.keys(i).length&&setTimeout((function(){var e=i;i={},Object.keys(e).forEach((function(t){var n=e[t];n.exception?s(n.exception):n.error&&s(n.error),console.log("WARNING: Promise with no error callback:"+n.id),console.log(n),n.exception&&console.log(n.exception.stack)}))}),0))}));var o=new(function(){function e(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((function(){if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e}),0)}}return e.prototype.emit=function(e){this.listeners.forEach((function(t){t(e)}))},e.prototype.onUnexpectedError=function(e){this.unexpectedErrorHandler(e),this.emit(e)},e.prototype.onUnexpectedExternalError=function(e){this.unexpectedErrorHandler(e)},e}());function s(e){a(e)||o.onUnexpectedError(e)}function u(e){return e instanceof Error?{$isError:!0,name:e.name,message:e.message,stack:e.stacktrace||e.stack}:e}function a(e){return e instanceof Error&&"Canceled"===e.name&&"Canceled"===e.message}function l(){var e=new Error("Canceled");return e.name=e.message,e}function c(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Array.isArray(e)?(e.forEach((function(e){return e&&e.dispose()})),[]):0===t.length?e?(e.dispose(),e):void 0:(c(e),c(t),[])}var h=function(){function e(){this._toDispose=[]}return e.prototype.dispose=function(){this._toDispose=c(this._toDispose)},e.prototype._register=function(e){return this._toDispose.push(e),e},e.None=Object.freeze({dispose:function(){}}),e}(),f=(function(){function e(e){this.object=e}e.prototype.dispose=function(){}}(),n(1));var d,m,p=(d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),_={done:!0,value:void 0};!function(e){var t={next:function(){return _}};function n(e,t){for(var n=e.next();!n.done;n=e.next())t(n.value)}e.empty=function(){return t},e.fromArray=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=e.length),{next:function(){return t>=n?_:{done:!1,value:e[t++]}}}},e.from=function(t){return t?Array.isArray(t)?e.fromArray(t):t:e.empty()},e.map=function(e,t){return{next:function(){var n=e.next();return n.done?_:{done:!1,value:t(n.value)}}}},e.filter=function(e,t){return{next:function(){for(;;){var n=e.next();if(n.done)return _;if(t(n.value))return{done:!1,value:n.value}}}}},e.forEach=n,e.collect=function(e){var t=[];return n(e,(function(e){return t.push(e)})),t}}(m||(m={}));(function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===r&&(r=t.length),void 0===i&&(i=n-1),e.call(this,t,n,r,i)||this}p(t,e),t.prototype.current=function(){return e.prototype.current.call(this)},t.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},t.prototype.first=function(){return this.index=this.start,this.current()},t.prototype.last=function(){return this.index=this.end-1,this.current()},t.prototype.parent=function(){return null}})(function(){function e(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=e.length),void 0===r&&(r=t-1),this.items=e,this.start=t,this.end=n,this.index=r}return e.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},e.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},e}()),function(){function e(e,t){this.iterator=e,this.fn=t}e.prototype.next=function(){return this.fn(this.iterator.next())}}();var g,v=function(e){this.element=e},y=function(){function e(){}return e.prototype.isEmpty=function(){return!this._first},e.prototype.unshift=function(e){return this.insert(e,!1)},e.prototype.push=function(e){return this.insert(e,!0)},e.prototype.insert=function(e,t){var n=this,r=new v(e);if(this._first)if(t){var i=this._last;this._last=r,r.prev=i,i.next=r}else{var o=this._first;this._first=r,r.next=o,o.prev=r}else this._first=r,this._last=r;return function(){for(var e=n._first;e instanceof v;){if(e===r){if(e.prev&&e.next){var t=e.prev;t.next=e.next,e.next.prev=t}else e.prev||e.next?e.next?e.prev||(n._first=n._first.next,n._first.prev=void 0):(n._last=n._last.prev,n._last.next=void 0):(n._first=void 0,n._last=void 0);break}e=e.next}}},e.prototype.iterator=function(){var e,t=this._first;return{next:function(){return t?(e?e.value=t.element:e={done:!1,value:t.element},t=t.next,e):_}}},e}();!function(e){var t={dispose:function(){}};e.None=function(){return t}}(g||(g={}));var C=function(){function e(e){void 0===e&&(e=null),this._options=e,this._event=null,this._disposed=!1,this._deliveryQueue=null,this._listeners=null}return Object.defineProperty(e.prototype,"event",{get:function(){var t=this;return this._event||(this._event=function(n,r,i){t._listeners||(t._listeners=new y);var o=t._listeners.isEmpty();o&&t._options&&t._options.onFirstListenerAdd&&t._options.onFirstListenerAdd(t);var s,u=t._listeners.push(r?[n,r]:n);return o&&t._options&&t._options.onFirstListenerDidAdd&&t._options.onFirstListenerDidAdd(t),t._options&&t._options.onListenerDidAdd&&t._options.onListenerDidAdd(t,n,r),s={dispose:function(){(s.dispose=e._noop,t._disposed)||(u(),t._options&&t._options.onLastListenerRemove&&(t._listeners&&!t._listeners.isEmpty()||t._options.onLastListenerRemove(t)))}},Array.isArray(i)&&i.push(s),s}),this._event},enumerable:!0,configurable:!0}),e.prototype.fire=function(e){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=[]);for(var t=this._listeners.iterator(),n=t.next();!n.done;n=t.next())this._deliveryQueue.push([n.value,e]);for(;this._deliveryQueue.length>0;){var r=this._deliveryQueue.shift(),i=r[0],o=r[1];try{"function"==typeof i?i.call(void 0,o):i[0].call(i[1],o)}catch(n){s(n)}}}},e.prototype.dispose=function(){this._listeners&&(this._listeners=null),this._deliveryQueue&&(this._deliveryQueue.length=0),this._disposed=!0},e._noop=function(){},e}();!function(){function e(){var e=this;this.hasListeners=!1,this.events=[],this.emitter=new C({onFirstListenerAdd:function(){return e.onFirstListenerAdd()},onLastListenerRemove:function(){return e.onLastListenerRemove()}})}Object.defineProperty(e.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this,n={event:e,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);return function(e){return{dispose:function(){e()}}}(function(e){var t,n=this,r=!1;return function(){return r?t:(r=!0,t=e.apply(n,arguments))}}((function(){t.hasListeners&&t.unhook(n);var e=t.events.indexOf(n);t.events.splice(e,1)})))},e.prototype.onFirstListenerAdd=function(){var e=this;this.hasListeners=!0,this.events.forEach((function(t){return e.hook(t)}))},e.prototype.onLastListenerRemove=function(){var e=this;this.hasListeners=!1,this.events.forEach((function(t){return e.unhook(t)}))},e.prototype.hook=function(e){var t=this;e.listener=e.event((function(e){return t.emitter.fire(e)}))},e.prototype.unhook=function(e){e.listener&&e.listener.dispose(),e.listener=null},e.prototype.dispose=function(){this.emitter.dispose()}}();!function(){function e(){this.buffers=[]}e.prototype.wrapEvent=function(e){var t=this;return function(n,r,i){return e((function(e){var i=t.buffers[t.buffers.length-1];i?i.push((function(){return n.call(r,e)})):n.call(r,e)}),void 0,i)}},e.prototype.bufferEvents=function(e){var t=[];this.buffers.push(t);var n=e();return this.buffers.pop(),t.forEach((function(e){return e()})),n}}();!function(){function e(e){this._event=e}Object.defineProperty(e.prototype,"event",{get:function(){return this._event},enumerable:!0,configurable:!0}),e.prototype.map=function(t){return new e((n=this._event,r=t,function(e,t,i){return void 0===t&&(t=null),n((function(n){return e.call(t,r(n))}),null,i)}));var n,r},e.prototype.filter=function(t){return new e((n=this._event,r=t,function(e,t,i){return void 0===t&&(t=null),n((function(n){return r(n)&&e.call(t,n)}),null,i)}));var n,r},e.prototype.on=function(e,t,n){return this._event(e,t,n)}}();!function(){function e(){var e=this;this.listening=!1,this.inputEvent=g.None,this.inputEventListener=h.None,this.emitter=new C({onFirstListenerDidAdd:function(){e.listening=!0,e.inputEventListener=e.inputEvent(e.emitter.fire,e.emitter)},onLastListenerRemove:function(){e.listening=!1,e.inputEventListener.dispose()}}),this.event=this.emitter.event}Object.defineProperty(e.prototype,"input",{set:function(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()}}();var b,S,E=Object.freeze((function(e,t){var n=setTimeout(e.bind(t),0);return{dispose:function(){clearTimeout(n)}}}));(S=b||(b={})).isCancellationToken=function(e){return e===S.None||e===S.Cancelled||e instanceof N||!(!e||"object"!=typeof e)&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},S.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:g.None}),S.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:E});var N=function(){function e(){this._isCancelled=!1,this._emitter=null}return e.prototype.cancel=function(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))},Object.defineProperty(e.prototype,"isCancellationRequested",{get:function(){return this._isCancelled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onCancellationRequested",{get:function(){return this._isCancelled?E:(this._emitter||(this._emitter=new C),this._emitter.event)},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._emitter&&(this._emitter.dispose(),this._emitter=null)},e}(),L=function(){function e(){}return Object.defineProperty(e.prototype,"token",{get:function(){return this._token||(this._token=new N),this._token},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this._token?this._token instanceof N&&this._token.cancel():this._token=b.Cancelled},e.prototype.dispose=function(){this._token?this._token instanceof N&&this._token.dispose():this._token=b.None},e}(),A=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(){function e(e){this.defaultDelay=e,this.timeout=null,this.completionPromise=null,this.doResolve=null,this.task=null}e.prototype.trigger=function(e,t){var n=this;return void 0===t&&(t=this.defaultDelay),this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new r.b((function(e,t){n.doResolve=e,n.doReject=t})).then((function(){n.completionPromise=null,n.doResolve=null;var e=n.task;return n.task=null,e()}))),this.timeout=setTimeout((function(){n.timeout=null,n.doResolve(null)}),t),this.completionPromise},e.prototype.cancel=function(){this.cancelTimeout(),this.completionPromise&&(this.doReject(l()),this.completionPromise=null)},e.prototype.cancelTimeout=function(){null!==this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},e.prototype.dispose=function(){this.cancelTimeout()}}();var w;(function(e){function t(t,n){var r=e.call(this)||this;return r._token=-1,"function"==typeof t&&"number"==typeof n&&r.setIfNotSet(t,n),r}A(t,e),t.prototype.dispose=function(){this.cancel(),e.prototype.dispose.call(this)},t.prototype.cancel=function(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)},t.prototype.cancelAndSet=function(e,t){var n=this;this.cancel(),this._token=setTimeout((function(){n._token=-1,e()}),t)},t.prototype.setIfNotSet=function(e,t){var n=this;-1===this._token&&(this._token=setTimeout((function(){n._token=-1,e()}),t))}})(h),function(e){function t(){var t=e.call(this)||this;return t._token=-1,t}A(t,e),t.prototype.dispose=function(){this.cancel(),e.prototype.dispose.call(this)},t.prototype.cancel=function(){-1!==this._token&&(clearInterval(this._token),this._token=-1)},t.prototype.cancelAndSet=function(e,t){this.cancel(),this._token=setInterval((function(){e()}),t)}}(h),function(){function e(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}e.prototype.dispose=function(){this.cancel(),this.runner=null},e.prototype.cancel=function(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)},e.prototype.schedule=function(e){void 0===e&&(e=this.timeout),this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)},e.prototype.isScheduled=function(){return-1!==this.timeoutToken},e.prototype.onTimeout=function(){this.timeoutToken=-1,this.runner&&this.doRun()},e.prototype.doRun=function(){this.runner&&this.runner()}}();!function(){if("function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback){var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});w=function(t,n){void 0===n&&(n=0);var r=setTimeout((function(){return t(e)}),n),i=!1;return{dispose:function(){i||(i=!0,clearTimeout(r))}}}}else w=function(e,t){var n=requestIdleCallback(e,"number"==typeof t?{timeout:t}:void 0),r=!1;return{dispose:function(){r||(r=!0,cancelIdleCallback(n))}}}}();!function(){function e(e){var t=this;this._executor=function(){try{t._value=e()}catch(e){t._error=e}finally{t._didRun=!0}},this._handle=w((function(){return t._executor()}))}e.prototype.dispose=function(){this._handle.dispose()},e.prototype.getValue=function(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}}();var P=function(){function e(e){var t,n;(n=t=e)&&"function"==typeof n.then&&"function"==typeof t.done?this._winjsPromise=e:this._winjsPromise=new r.a((function(t,n){var r=!0;e((function(e){r?f.d((function(){return t(e)})):t(e)}),(function(e){r?f.d((function(){return n(e)})):n(e)})),r=!1}))}return e.all=function(t){return new e(r.a.join(t).then(null,(function(e){for(var t in e)if(e.hasOwnProperty(t))return e[t]})))},e.race=function(t){return new e(r.a.any(t).then((function(e){return e.value}),(function(e){return e.value})))},e.resolve=function(t){return new e(r.a.wrap(t))},e.reject=function(t){return new e(r.a.wrapError(t))},e.prototype.then=function(t,n){var i=!0,o=new e(this._winjsPromise.then(t&&function(e){return i?new r.a((function(n,r){f.d((function(){var i;try{i=t(e)}catch(e){return void r(e)}n(i)}))})):t(e)},n&&function(e){return i?new r.a((function(t,r){f.d((function(){var i;try{i=n(e)}catch(e){return void r(e)}t(i)}))})):n(e)}));return i=!1,o},e.prototype.catch=function(e){return this.then(null,e)},e}(),O=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T=self;void 0===T.Promise&&(T.Promise=P);var x=function(){function e(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null)}return e.prototype.setWorkerId=function(e){this._workerId=e},e.prototype.sendMessage=function(e,t){var n=this,r=String(++this._lastSentReq);return new Promise((function(i,o){n._pendingReplies[r]={resolve:i,reject:o},n._send({vsWorker:n._workerId,req:r,method:e,args:t})}))},e.prototype.handleMessage=function(e){var t;try{t=JSON.parse(e)}catch(e){return}t&&t.vsWorker&&(-1!==this._workerId&&t.vsWorker!==this._workerId||this._handleMessage(t))},e.prototype._handleMessage=function(e){var t=this;if(e.seq){var n=e;if(!this._pendingReplies[n.seq])return void console.warn("Got reply to unknown seq");var r=this._pendingReplies[n.seq];if(delete this._pendingReplies[n.seq],n.err){var i=n.err;return n.err.$isError&&((i=new Error).name=n.err.name,i.message=n.err.message,i.stack=n.err.stack),void r.reject(i)}r.resolve(n.res)}else{var o=e,s=o.req;this._handler.handleMessage(o.method,o.args).then((function(e){t._send({vsWorker:t._workerId,seq:s,res:e,err:void 0})}),(function(e){e.detail instanceof Error&&(e.detail=u(e.detail)),t._send({vsWorker:t._workerId,seq:s,res:void 0,err:u(e)})}))}},e.prototype._send=function(e){var t=JSON.stringify(e);this._handler.sendMessage(t)},e}(),M=(function(e){function t(t,n){var r=e.call(this)||this,i=null;r._worker=r._register(t.create("vs/base/common/worker/simpleWorker",(function(e){r._protocol.handleMessage(e)}),(function(e){i&&i(e)}))),r._protocol=new x({sendMessage:function(e){r._worker.postMessage(e)},handleMessage:function(e,t){return Promise.resolve(null)}}),r._protocol.setWorkerId(r._worker.getId());var o=null;void 0!==self.require&&"function"==typeof self.require.getConfig?o=self.require.getConfig():void 0!==self.requirejs&&(o=self.requirejs.s.contexts._.config),r._onModuleLoaded=r._protocol.sendMessage("$initialize",[r._worker.getId(),n,o]),r._lazyProxy=new Promise((function(e,t){i=t,r._onModuleLoaded.then((function(t){for(var n={},r=0;r<t.length;r++)n[t[r]]=u(t[r],s);e(n)}),(function(e){t(e),r._onError("Worker failed to load "+n,e)}))}));var s=function(e,t){return r._request(e,t)},u=function(e,t){return function(){var n=Array.prototype.slice.call(arguments,0);return t(e,n)}};return r}O(t,e),t.prototype.getProxyObject=function(){return this._lazyProxy},t.prototype._request=function(e,t){var n=this;return new Promise((function(r,i){n._onModuleLoaded.then((function(){n._protocol.sendMessage(e,t).then(r,i)}),i)}))},t.prototype._onError=function(e,t){console.error(e),console.info(t)}}(h),function(){function e(e,t){var n=this;this._requestHandler=t,this._protocol=new x({sendMessage:function(t){e(t)},handleMessage:function(e,t){return n._handleMessage(e,t)}})}return e.prototype.onmessage=function(e){this._protocol.handleMessage(e)},e.prototype._handleMessage=function(e,t){if("$initialize"===e)return this.initialize(t[0],t[1],t[2]);if(!this._requestHandler||"function"!=typeof this._requestHandler[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._requestHandler[e].apply(this._requestHandler,t))}catch(e){return Promise.reject(e)}},e.prototype.initialize=function(e,t,n){var r=this;if(this._protocol.setWorkerId(e),this._requestHandler){var i=[];for(var o in this._requestHandler)"function"==typeof this._requestHandler[o]&&i.push(o);return Promise.resolve(i)}return n&&(void 0!==n.baseUrl&&delete n.baseUrl,void 0!==n.paths&&void 0!==n.paths.vs&&delete n.paths.vs,n.catchError=!0,self.require.config(n)),new Promise((function(e,n){self.require([t],(function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var o=t[0];if(r._requestHandler=o.create(),r._requestHandler){var s=[];for(var u in r._requestHandler)"function"==typeof r._requestHandler[u]&&s.push(u);e(s)}else n(new Error("No RequestHandler!"))}),n)}))},e}());function k(e,t){return function e(t,n,r,i,o){if(i<=r)return;var s=r+(i-r)/2|0;if(e(t,n,r,s,o),e(t,n,s+1,i,o),n(t[s],t[s+1])<=0)return;!function(e,t,n,r,i,o){for(var s=n,u=r+1,a=n;a<=i;a++)o[a]=e[a];for(a=n;a<=i;a++)s>r?e[a]=o[u++]:u>i?e[a]=o[s++]:t(o[u],o[s])<0?e[a]=o[u++]:e[a]=o[s++]}(t,n,r,s,i,o)}(e,t,0,e.length-1,[]),e}var I=function(){function e(e,t,n,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}return e.prototype.getOriginalEnd=function(){return this.originalStart+this.originalLength},e.prototype.getModifiedEnd=function(){return this.modifiedStart+this.modifiedLength},e}();function R(e){return{getLength:function(){return e.length},getElementAtIndex:function(t){return e.charCodeAt(t)}}}function U(e,t,n){return new W(R(e),R(t)).ComputeDiff(n)}var D,F=function(){function e(){}return e.Assert=function(e,t){if(!e)throw new Error(t)},e}(),K=function(){function e(){}return e.Copy=function(e,t,n,r,i){for(var o=0;o<i;o++)n[r+o]=e[t+o]},e}(),V=function(){function e(){this.m_changes=[],this.m_originalStart=Number.MAX_VALUE,this.m_modifiedStart=Number.MAX_VALUE,this.m_originalCount=0,this.m_modifiedCount=0}return e.prototype.MarkNextChange=function(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new I(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=Number.MAX_VALUE,this.m_modifiedStart=Number.MAX_VALUE},e.prototype.AddOriginalElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++},e.prototype.AddModifiedElement=function(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++},e.prototype.getChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes},e.prototype.getReverseChanges=function(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes},e}(),W=function(){function e(e,t,n){void 0===n&&(n=null),this.OriginalSequence=e,this.ModifiedSequence=t,this.ContinueProcessingPredicate=n,this.m_forwardHistory=[],this.m_reverseHistory=[]}return e.prototype.ElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.OriginalElementsAreEqual=function(e,t){return this.OriginalSequence.getElementAtIndex(e)===this.OriginalSequence.getElementAtIndex(t)},e.prototype.ModifiedElementsAreEqual=function(e,t){return this.ModifiedSequence.getElementAtIndex(e)===this.ModifiedSequence.getElementAtIndex(t)},e.prototype.ComputeDiff=function(e){return this._ComputeDiff(0,this.OriginalSequence.getLength()-1,0,this.ModifiedSequence.getLength()-1,e)},e.prototype._ComputeDiff=function(e,t,n,r,i){var o=this.ComputeDiffRecursive(e,t,n,r,[!1]);return i?this.PrettifyChanges(o):o},e.prototype.ComputeDiffRecursive=function(e,t,n,r,i){for(i[0]=!1;e<=t&&n<=r&&this.ElementsAreEqual(e,n);)e++,n++;for(;t>=e&&r>=n&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||n>r){var o=void 0;return n<=r?(F.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new I(e,0,n,r-n+1)]):e<=t?(F.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[new I(e,t-e+1,n,0)]):(F.Assert(e===t+1,"originalStart should only be one more than originalEnd"),F.Assert(n===r+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}var s=[0],u=[0],a=this.ComputeRecursionPoint(e,t,n,r,s,u,i),l=s[0],c=u[0];if(null!==a)return a;if(!i[0]){var h=this.ComputeDiffRecursive(e,l,n,c,i),f=[];return f=i[0]?[new I(l+1,t-(l+1)+1,c+1,r-(c+1)+1)]:this.ComputeDiffRecursive(l+1,t,c+1,r,i),this.ConcatenateChanges(h,f)}return[new I(e,t-e+1,n,r-n+1)]},e.prototype.WALKTRACE=function(e,t,n,r,i,o,s,u,a,l,c,h,f,d,m,p,_,g){var v,y,C=null,b=new V,S=t,E=n,N=f[0]-p[0]-r,L=Number.MIN_VALUE,A=this.m_forwardHistory.length-1;do{(y=N+e)===S||y<E&&a[y-1]<a[y+1]?(d=(c=a[y+1])-N-r,c<L&&b.MarkNextChange(),L=c,b.AddModifiedElement(c+1,d),N=y+1-e):(d=(c=a[y-1]+1)-N-r,c<L&&b.MarkNextChange(),L=c-1,b.AddOriginalElement(c,d+1),N=y-1-e),A>=0&&(e=(a=this.m_forwardHistory[A])[0],S=1,E=a.length-1)}while(--A>=-1);if(v=b.getReverseChanges(),g[0]){var w=f[0]+1,P=p[0]+1;if(null!==v&&v.length>0){var O=v[v.length-1];w=Math.max(w,O.getOriginalEnd()),P=Math.max(P,O.getModifiedEnd())}C=[new I(w,h-w+1,P,m-P+1)]}else{b=new V,S=o,E=s,N=f[0]-p[0]-u,L=Number.MAX_VALUE,A=_?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{(y=N+i)===S||y<E&&l[y-1]>=l[y+1]?(d=(c=l[y+1]-1)-N-u,c>L&&b.MarkNextChange(),L=c+1,b.AddOriginalElement(c+1,d+1),N=y+1-i):(d=(c=l[y-1])-N-u,c>L&&b.MarkNextChange(),L=c,b.AddModifiedElement(c+1,d+1),N=y-1-i),A>=0&&(i=(l=this.m_reverseHistory[A])[0],S=1,E=l.length-1)}while(--A>=-1);C=b.getChanges()}return this.ConcatenateChanges(v,C)},e.prototype.ComputeRecursionPoint=function(e,t,n,r,i,o,s){var u,a=0,l=0,c=0,h=0,f=0,d=0;e--,n--,i[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];var m,p,_=t-e+(r-n),g=_+1,v=new Array(g),y=new Array(g),C=r-n,b=t-e,S=e-n,E=t-r,N=(b-C)%2==0;for(v[C]=e,y[b]=t,s[0]=!1,u=1;u<=_/2+1;u++){var L=0,A=0;for(c=this.ClipDiagonalBound(C-u,u,C,g),h=this.ClipDiagonalBound(C+u,u,C,g),m=c;m<=h;m+=2){for(l=(a=m===c||m<h&&v[m-1]<v[m+1]?v[m+1]:v[m-1]+1)-(m-C)-S,p=a;a<t&&l<r&&this.ElementsAreEqual(a+1,l+1);)a++,l++;if(v[m]=a,a+l>L+A&&(L=a,A=l),!N&&Math.abs(m-b)<=u-1&&a>=y[m])return i[0]=a,o[0]=l,p<=y[m]&&u<=1448?this.WALKTRACE(C,c,h,S,b,f,d,E,v,y,a,t,i,l,r,o,N,s):null}var w=(L-e+(A-n)-u)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(L,this.OriginalSequence,w))return s[0]=!0,i[0]=L,o[0]=A,w>0&&u<=1448?this.WALKTRACE(C,c,h,S,b,f,d,E,v,y,a,t,i,l,r,o,N,s):(e++,n++,[new I(e,t-e+1,n,r-n+1)]);for(f=this.ClipDiagonalBound(b-u,u,b,g),d=this.ClipDiagonalBound(b+u,u,b,g),m=f;m<=d;m+=2){for(l=(a=m===f||m<d&&y[m-1]>=y[m+1]?y[m+1]-1:y[m-1])-(m-b)-E,p=a;a>e&&l>n&&this.ElementsAreEqual(a,l);)a--,l--;if(y[m]=a,N&&Math.abs(m-C)<=u&&a<=v[m])return i[0]=a,o[0]=l,p>=v[m]&&u<=1448?this.WALKTRACE(C,c,h,S,b,f,d,E,v,y,a,t,i,l,r,o,N,s):null}if(u<=1447){var P=new Array(h-c+2);P[0]=C-c+1,K.Copy(v,c,P,1,h-c+1),this.m_forwardHistory.push(P),(P=new Array(d-f+2))[0]=b-f+1,K.Copy(y,f,P,1,d-f+1),this.m_reverseHistory.push(P)}}return this.WALKTRACE(C,c,h,S,b,f,d,E,v,y,a,t,i,l,r,o,N,s)},e.prototype.PrettifyChanges=function(e){for(var t=0;t<e.length;t++){for(var n=e[t],r=t<e.length-1?e[t+1].originalStart:this.OriginalSequence.getLength(),i=t<e.length-1?e[t+1].modifiedStart:this.ModifiedSequence.getLength(),o=n.originalLength>0,s=n.modifiedLength>0;n.originalStart+n.originalLength<r&&n.modifiedStart+n.modifiedLength<i&&(!o||this.OriginalElementsAreEqual(n.originalStart,n.originalStart+n.originalLength))&&(!s||this.ModifiedElementsAreEqual(n.modifiedStart,n.modifiedStart+n.modifiedLength));)n.originalStart++,n.modifiedStart++;var u=[null];t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],u)&&(e[t]=u[0],e.splice(t+1,1),t--)}for(t=e.length-1;t>=0;t--){n=e[t],r=0,i=0;if(t>0){var a=e[t-1];a.originalLength>0&&(r=a.originalStart+a.originalLength),a.modifiedLength>0&&(i=a.modifiedStart+a.modifiedLength)}o=n.originalLength>0,s=n.modifiedLength>0;for(var l=0,c=this._boundaryScore(n.originalStart,n.originalLength,n.modifiedStart,n.modifiedLength),h=1;;h++){var f=n.originalStart-h,d=n.modifiedStart-h;if(f<r||d<i)break;if(o&&!this.OriginalElementsAreEqual(f,f+n.originalLength))break;if(s&&!this.ModifiedElementsAreEqual(d,d+n.modifiedLength))break;var m=this._boundaryScore(f,n.originalLength,d,n.modifiedLength);m>c&&(c=m,l=h)}n.originalStart-=l,n.modifiedStart-=l}return e},e.prototype._OriginalIsBoundary=function(e){if(e<=0||e>=this.OriginalSequence.getLength()-1)return!0;var t=this.OriginalSequence.getElementAtIndex(e);return"string"==typeof t&&/^\s*$/.test(t)},e.prototype._OriginalRegionIsBoundary=function(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._OriginalIsBoundary(n-1)||this._OriginalIsBoundary(n))return!0}return!1},e.prototype._ModifiedIsBoundary=function(e){if(e<=0||e>=this.ModifiedSequence.getLength()-1)return!0;var t=this.ModifiedSequence.getElementAtIndex(e);return"string"==typeof t&&/^\s*$/.test(t)},e.prototype._ModifiedRegionIsBoundary=function(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){var n=e+t;if(this._ModifiedIsBoundary(n-1)||this._ModifiedIsBoundary(n))return!0}return!1},e.prototype._boundaryScore=function(e,t,n,r){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(n,r)?1:0)},e.prototype.ConcatenateChanges=function(e,t){var n=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],n)){var r=new Array(e.length+t.length-1);return K.Copy(e,0,r,0,e.length-1),r[e.length-1]=n[0],K.Copy(t,1,r,e.length,t.length-1),r}r=new Array(e.length+t.length);return K.Copy(e,0,r,0,e.length),K.Copy(t,0,r,e.length,t.length),r},e.prototype.ChangesOverlap=function(e,t,n){if(F.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),F.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.m