this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[r]=s,s},a}(E.BaseRenderLayer);R.TextRenderLayer=h},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.GridCache=void 0;var L=function(){function M(){this.cache=[]}return M.prototype.resize=function(p,E){for(var b=0;b>>24,W=F.rgba>>>16&255,j=F.rgba>>>8&255,A=0;A=this.capacity)b=this._head,this._unlinkNode(b),delete this._map[b.key],b.key=p,b.value=E,this._map[p]=b;else{var i=this._nodePool;i.length>0?((b=i.pop()).key=p,b.value=E):b={prev:null,next:null,key:p,value:E},this._map[p]=b,this.size++}this._appendNode(b)},M}();R.LRUMap=L},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(E,b){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,c){i.__proto__=c}||function(i,c){for(var o in c)c.hasOwnProperty(o)&&(i[o]=c[o])})(E,b)},function(E,b){function i(){this.constructor=E}L(E,b),E.prototype=b===null?Object.create(b):(i.prototype=b.prototype,new i)});Object.defineProperty(R,"__esModule",{value:!0}),R.SelectionRenderLayer=void 0;var p=function(E){function b(i,c,o,h,n,a){var t=E.call(this,i,"selection",c,!0,o,h,n,a)||this;return t._clearState(),t}return M(b,E),b.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},b.prototype.resize=function(i){E.prototype.resize.call(this,i),this._clearState()},b.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},b.prototype.onSelectionChanged=function(i,c,o){if(this._didStateChange(i,c,o,this._bufferService.buffer.ydisp))if(this._clearAll(),i&&c){var h=i[1]-this._bufferService.buffer.ydisp,n=c[1]-this._bufferService.buffer.ydisp,a=Math.max(h,0),t=Math.min(n,this._bufferService.rows-1);if(!(a>=this._bufferService.rows||t<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,o){var r=i[0],s=c[0]-r,u=t-a+1;this._fillCells(r,a,s,u)}else{r=h===a?i[0]:0;var f=a===t?c[0]:this._bufferService.cols;this._fillCells(r,a,f-r,1);var d=Math.max(t-a-1,0);if(this._fillCells(0,a+1,this._bufferService.cols,d),a!==t){var v=n===t?c[0]:this._bufferService.cols;this._fillCells(0,t,v,1)}}this._state.start=[i[0],i[1]],this._state.end=[c[0],c[1]],this._state.columnSelectMode=o,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},b.prototype._didStateChange=function(i,c,o,h){return!this._areCoordinatesEqual(i,this._state.start)||!this._areCoordinatesEqual(c,this._state.end)||o!==this._state.columnSelectMode||h!==this._state.ydisp},b.prototype._areCoordinatesEqual=function(i,c){return!(!i||!c)&&i[0]===c[0]&&i[1]===c[1]},b}(I(13).BaseRenderLayer);R.SelectionRenderLayer=p},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(c,o){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,n){h.__proto__=n}||function(h,n){for(var a in n)n.hasOwnProperty(a)&&(h[a]=n[a])})(c,o)},function(c,o){function h(){this.constructor=c}L(c,o),c.prototype=o===null?Object.create(o):(h.prototype=o.prototype,new h)});Object.defineProperty(R,"__esModule",{value:!0}),R.CursorRenderLayer=void 0;var p=I(13),E=I(4),b=function(c){function o(h,n,a,t,r,s,u,f,d){var v=c.call(this,h,"cursor",n,!0,a,t,s,u)||this;return v._onRequestRedraw=r,v._coreService=f,v._coreBrowserService=d,v._cell=new E.CellData,v._state={x:0,y:0,isFocused:!1,style:"",width:0},v._cursorRenderers={bar:v._renderBarCursor.bind(v),block:v._renderBlockCursor.bind(v),underline:v._renderUnderlineCursor.bind(v)},v}return M(o,c),o.prototype.resize=function(h){c.prototype.resize.call(this,h),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},o.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},o.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onOptionsChanged=function(){var h,n=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new i(this._coreBrowserService.isFocused,function(){n._render(!0)})):((h=this._cursorBlinkStateManager)===null||h===void 0||h.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},o.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},o.prototype.onGridChanged=function(h,n){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},o.prototype._render=function(h){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var n=this._bufferService.buffer.ybase+this._bufferService.buffer.y,a=n-this._bufferService.buffer.ydisp;if(a<0||a>=this._bufferService.rows)this._clearCursor();else{var t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(n).loadCell(t,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var r=this._optionsService.options.cursorStyle;return r&&r!=="block"?this._cursorRenderers[r](t,a,this._cell):this._renderBlurCursor(t,a,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=a,this._state.isFocused=!1,this._state.style=r,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t&&this._state.y===a&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](t,a,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=a,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},o.prototype._clearCursor=function(){this._state&&(this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},o.prototype._renderBarCursor=function(h,n,a){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(h,n,this._optionsService.options.cursorWidth),this._ctx.restore()},o.prototype._renderBlockCursor=function(h,n,a){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(h,n,a.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(a,h,n),this._ctx.restore()},o.prototype._renderUnderlineCursor=function(h,n,a){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(h,n),this._ctx.restore()},o.prototype._renderBlurCursor=function(h,n,a){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(h,n,a.getWidth(),1),this._ctx.restore()},o}(p.BaseRenderLayer);R.CursorRenderLayer=b;var i=function(){function c(o,h){this._renderCallback=h,this.isCursorVisible=!0,o&&this._restartInterval()}return Object.defineProperty(c.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),c.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},c.prototype.restartBlinkAnimation=function(){var o=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){o._renderCallback(),o._animationFrame=void 0})))},c.prototype._restartInterval=function(o){var h=this;o===void 0&&(o=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(h._animationTimeRestarted){var n=600-(Date.now()-h._animationTimeRestarted);if(h._animationTimeRestarted=void 0,n>0)return void h._restartInterval(n)}h.isCursorVisible=!1,h._animationFrame=window.requestAnimationFrame(function(){h._renderCallback(),h._animationFrame=void 0}),h._blinkInterval=window.setInterval(function(){if(h._animationTimeRestarted){var a=600-(Date.now()-h._animationTimeRestarted);return h._animationTimeRestarted=void 0,void h._restartInterval(a)}h.isCursorVisible=!h.isCursorVisible,h._animationFrame=window.requestAnimationFrame(function(){h._renderCallback(),h._animationFrame=void 0})},600)},o)},c.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},c.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},c}()},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(c,o){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,n){h.__proto__=n}||function(h,n){for(var a in n)n.hasOwnProperty(a)&&(h[a]=n[a])})(c,o)},function(c,o){function h(){this.constructor=c}L(c,o),c.prototype=o===null?Object.create(o):(h.prototype=o.prototype,new h)});Object.defineProperty(R,"__esModule",{value:!0}),R.LinkRenderLayer=void 0;var p=I(13),E=I(9),b=I(26),i=function(c){function o(h,n,a,t,r,s,u,f){var d=c.call(this,h,"link",n,!0,a,t,u,f)||this;return r.onShowLinkUnderline(function(v){return d._onShowLinkUnderline(v)}),r.onHideLinkUnderline(function(v){return d._onHideLinkUnderline(v)}),s.onShowLinkUnderline(function(v){return d._onShowLinkUnderline(v)}),s.onHideLinkUnderline(function(v){return d._onHideLinkUnderline(v)}),d}return M(o,c),o.prototype.resize=function(h){c.prototype.resize.call(this,h),this._state=void 0},o.prototype.reset=function(){this._clearCurrentLink()},o.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var h=this._state.y2-this._state.y1-1;h>0&&this._clearCells(0,this._state.y1+1,this._state.cols,h),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},o.prototype._onShowLinkUnderline=function(h){if(h.fg===E.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:h.fg&&b.is256Color(h.fg)?this._ctx.fillStyle=this._colors.ansi[h.fg].css:this._ctx.fillStyle=this._colors.foreground.css,h.y1===h.y2)this._fillBottomLineAtCells(h.x1,h.y1,h.x2-h.x1);else{this._fillBottomLineAtCells(h.x1,h.y1,h.cols-h.x1);for(var n=h.y1+1;n=0;s--)(a=c[s])&&(r=(t<3?a(r):t>3?a(o,h,r):a(o,h))||r);return t>3&&r&&Object.defineProperty(o,h,r),r},M=this&&this.__param||function(c,o){return function(h,n){o(h,n,c)}};Object.defineProperty(R,"__esModule",{value:!0}),R.MouseZone=R.Linkifier=void 0;var p=I(0),E=I(1),b=function(){function c(o,h,n){this._bufferService=o,this._logService=h,this._unicodeService=n,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new p.EventEmitter,this._onHideLinkUnderline=new p.EventEmitter,this._onLinkTooltip=new p.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(c.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),c.prototype.attachToDom=function(o,h){this._element=o,this._mouseZoneManager=h},c.prototype.linkifyRows=function(o,h){var n=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=o,this._rowsToLinkify.end=h):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,o),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,h)),this._mouseZoneManager.clearAll(o,h),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return n._linkifyRows()},c._timeBeforeLatency))},c.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var o=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var h=o.ydisp+this._rowsToLinkify.start;if(!(h>=o.lines.length)){for(var n=o.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,a=Math.ceil(2e3/this._bufferService.cols),t=this._bufferService.buffer.iterator(!1,h,n,a,a);t.hasNext();)for(var r=t.next(),s=0;s=0;h--)if(o.priority<=this._linkMatchers[h].priority)return void this._linkMatchers.splice(h+1,0,o);this._linkMatchers.splice(0,0,o)}else this._linkMatchers.push(o)},c.prototype.deregisterLinkMatcher=function(o){for(var h=0;h>9&511:void 0;n.validationCallback?n.validationCallback(d,function(_){t._rowsTimeoutId||_&&t._addLink(v[1],v[0]-t._bufferService.buffer.ydisp,d,n,C)}):f._addLink(v[1],v[0]-f._bufferService.buffer.ydisp,d,n,C)},f=this;(a=r.exec(h))!==null&&!(u()==="break"););},c.prototype._addLink=function(o,h,n,a,t){var r=this;if(this._mouseZoneManager&&this._element){var s=this._unicodeService.getStringCellWidth(n),u=o%this._bufferService.cols,f=h+Math.floor(o/this._bufferService.cols),d=(u+s)%this._bufferService.cols,v=f+Math.floor((u+s)/this._bufferService.cols);d===0&&(d=this._bufferService.cols,v--),this._mouseZoneManager.add(new i(u+1,f+1,d+1,v+1,function(m){if(a.handler)return a.handler(m,n);var S=window.open();S?(S.opener=null,S.location.href=n):console.warn("Opening link blocked as opener could not be cleared")},function(){r._onShowLinkUnderline.fire(r._createLinkHoverEvent(u,f,d,v,t)),r._element.classList.add("xterm-cursor-pointer")},function(m){r._onLinkTooltip.fire(r._createLinkHoverEvent(u,f,d,v,t)),a.hoverTooltipCallback&&a.hoverTooltipCallback(m,n,{start:{x:u,y:f},end:{x:d,y:v}})},function(){r._onHideLinkUnderline.fire(r._createLinkHoverEvent(u,f,d,v,t)),r._element.classList.remove("xterm-cursor-pointer"),a.hoverLeaveCallback&&a.hoverLeaveCallback()},function(m){return!a.willLinkActivate||a.willLinkActivate(m,n)}))}},c.prototype._createLinkHoverEvent=function(o,h,n,a,t){return{x1:o,y1:h,x2:n,y2:a,cols:this._bufferService.cols,fg:t}},c._timeBeforeLatency=200,c=L([M(0,E.IBufferService),M(1,E.ILogService),M(2,E.IUnicodeService)],c)}();R.Linkifier=b;var i=function(c,o,h,n,a,t,r,s,u){this.x1=c,this.y1=o,this.x2=h,this.y2=n,this.clickCallback=a,this.hoverCallback=t,this.tooltipCallback=r,this.leaveCallback=s,this.willLinkActivate=u};R.MouseZone=i},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(d,v){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,S){m.__proto__=S}||function(m,S){for(var C in S)S.hasOwnProperty(C)&&(m[C]=S[C])})(d,v)},function(d,v){function m(){this.constructor=d}L(d,v),d.prototype=v===null?Object.create(v):(m.prototype=v.prototype,new m)}),p=this&&this.__decorate||function(d,v,m,S){var C,_=arguments.length,y=_<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(d,v,m,S);else for(var T=d.length-1;T>=0;T--)(C=d[T])&&(y=(_<3?C(y):_>3?C(v,m,y):C(v,m))||y);return _>3&&y&&Object.defineProperty(v,m,y),y},E=this&&this.__param||function(d,v){return function(m,S){v(m,S,d)}};Object.defineProperty(R,"__esModule",{value:!0}),R.SelectionService=void 0;var b=I(11),i=I(52),c=I(4),o=I(0),h=I(5),n=I(1),a=I(30),t=I(53),r=I(2),s=String.fromCharCode(160),u=new RegExp(s,"g"),f=function(d){function v(m,S,C,_,y,T,k){var g=d.call(this)||this;return g._element=m,g._screenElement=S,g._bufferService=C,g._coreService=_,g._mouseService=y,g._optionsService=T,g._renderService=k,g._dragScrollAmount=0,g._enabled=!0,g._workCell=new c.CellData,g._mouseDownTimeStamp=0,g._onLinuxMouseSelection=g.register(new o.EventEmitter),g._onRedrawRequest=g.register(new o.EventEmitter),g._onSelectionChange=g.register(new o.EventEmitter),g._onRequestScrollLines=g.register(new o.EventEmitter),g._mouseMoveListener=function(F){return g._onMouseMove(F)},g._mouseUpListener=function(F){return g._onMouseUp(F)},g._coreService.onUserInput(function(){g.hasSelection&&g.clearSelection()}),g._trimListener=g._bufferService.buffer.lines.onTrim(function(F){return g._onTrim(F)}),g.register(g._bufferService.buffers.onBufferActivate(function(F){return g._onBufferActivate(F)})),g.enable(),g._model=new i.SelectionModel(g._bufferService),g._activeSelectionMode=0,g}return M(v,d),Object.defineProperty(v.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){this._removeMouseDownListeners()},v.prototype.reset=function(){this.clearSelection()},v.prototype.disable=function(){this.clearSelection(),this._enabled=!1},v.prototype.enable=function(){this._enabled=!0},Object.defineProperty(v.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"hasSelection",{get:function(){var m=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!m||!S)&&(m[0]!==S[0]||m[1]!==S[1])},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"selectionText",{get:function(){var m=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!m||!S)return"";var C=this._bufferService.buffer,_=[];if(this._activeSelectionMode===3){if(m[0]===S[0])return"";for(var y=m[1];y<=S[1];y++){var T=C.translateBufferLineToString(y,!0,m[0],S[0]);_.push(T)}}else{var k=m[1]===S[1]?S[0]:void 0;for(_.push(C.translateBufferLineToString(m[1],!0,m[0],k)),y=m[1]+1;y<=S[1]-1;y++){var g=C.lines.get(y);T=C.translateBufferLineToString(y,!0),g&&g.isWrapped?_[_.length-1]+=T:_.push(T)}m[1]!==S[1]&&(g=C.lines.get(S[1]),T=C.translateBufferLineToString(S[1],!0,0,S[0]),g&&g.isWrapped?_[_.length-1]+=T:_.push(T))}return _.map(function(F){return F.replace(u," ")}).join(b.isWindows?`\r
`:`
`)},enumerable:!1,configurable:!0}),v.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},v.prototype.refresh=function(m){var S=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return S._refresh()})),b.isLinux&&m)&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},v.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},v.prototype.isClickInSelection=function(m){var S=this._getMouseBufferCoords(m),C=this._model.finalSelectionStart,_=this._model.finalSelectionEnd;return!!(C&&_&&S)&&this._areCoordsInSelection(S,C,_)},v.prototype._areCoordsInSelection=function(m,S,C){return m[1]>S[1]&&m[1]=S[0]&&m[0]=S[0]},v.prototype.selectWordAtCursor=function(m){var S=this._getMouseBufferCoords(m);S&&(this._selectWordAt(S,!1),this._model.selectionEnd=void 0,this.refresh(!0))},v.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},v.prototype.selectLines=function(m,S){this._model.clearSelection(),m=Math.max(m,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()},v.prototype._onTrim=function(m){this._model.onTrim(m)&&this.refresh()},v.prototype._getMouseBufferCoords=function(m){var S=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S},v.prototype._getMouseEventScrollAmount=function(m){var S=a.getCoordsRelativeToElement(m,this._screenElement)[1],C=this._renderService.dimensions.canvasHeight;return S>=0&&S<=C?0:(S>C&&(S-=C),S=Math.min(Math.max(S,-50),50),(S/=50)/Math.abs(S)+Math.round(14*S))},v.prototype.shouldForceSelection=function(m){return b.isMac?m.altKey&&this._optionsService.options.macOptionClickForcesSelection:m.shiftKey},v.prototype.onMouseDown=function(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._onIncrementalClick(m):m.detail===1?this._onSingleClick(m):m.detail===2?this._onDoubleClick(m):m.detail===3&&this._onTripleClick(m),this._addMouseDownListeners(),this.refresh(!0)}},v.prototype._addMouseDownListeners=function(){var m=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return m._dragScroll()},50)},v.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},v.prototype._onIncrementalClick=function(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))},v.prototype._onSingleClick=function(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),this._model.selectionStart){this._model.selectionEnd=void 0;var S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},v.prototype._onDoubleClick=function(m){var S=this._getMouseBufferCoords(m);S&&(this._activeSelectionMode=1,this._selectWordAt(S,!0))},v.prototype._onTripleClick=function(m){var S=this._getMouseBufferCoords(m);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))},v.prototype.shouldColumnSelect=function(m){return m.altKey&&!(b.isMac&&this._optionsService.options.macOptionClickForcesSelection)},v.prototype._onMouseMove=function(m){if(m.stopImmediatePropagation(),this._model.selectionStart){var S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),this._model.selectionEnd){this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var C=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}},v.prototype._onMouseUp=function(m){var S=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&m.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var C=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){var _=t.moveToCellSequence(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(_,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},v.prototype._onBufferActivate=function(m){var S=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim(function(C){return S._onTrim(C)})},v.prototype._convertViewportColToCharacterIndex=function(m,S){for(var C=S[0],_=0;S[0]>=_;_++){var y=m.loadCell(_,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:y>1&&S[0]!==_&&(C+=y-1)}return C},v.prototype.setSelection=function(m,S,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,S],this._model.selectionStartLength=C,this.refresh()},v.prototype._getWordAt=function(m,S,C,_){if(C===void 0&&(C=!0),_===void 0&&(_=!0),!(m[0]>=this._bufferService.cols)){var y=this._bufferService.buffer,T=y.lines.get(m[1]);if(T){var k=y.translateBufferLineToString(m[1],!1),g=this._convertViewportColToCharacterIndex(T,m),F=g,P=m[0]-g,N=0,W=0,j=0,A=0;if(k.charAt(g)===" "){for(;g>0&&k.charAt(g-1)===" ";)g--;for(;F1&&(A+=O-1,F+=O-1);K>0&&g>0&&!this._isCharWordSeparator(T.loadCell(K-1,this._workCell));){T.loadCell(K-1,this._workCell);var z=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,K--):z>1&&(j+=z-1,g-=z-1),g--,K--}for(;U1&&(A+=te-1,F+=te-1),F++,U++}}F++;var he=g+P-N+j,be=Math.min(this._bufferService.cols,F-g+N+W-j-A);if(S||k.slice(g,F).trim()!==""){if(C&&he===0&&T.getCodePoint(0)!==32){var ze=y.lines.get(m[1]-1);if(ze&&T.isWrapped&&ze.getCodePoint(this._bufferService.cols-1)!==32){var Pe=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(Pe){var Oe=this._bufferService.cols-Pe.start;he-=Oe,be+=Oe}}}if(_&&he+be===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){var Ke=y.lines.get(m[1]+1);if(Ke&&Ke.isWrapped&&Ke.getCodePoint(0)!==32){var je=this._getWordAt([0,m[1]+1],!1,!1,!0);je&&(be+=je.length)}}return{start:he,length:be}}}}},v.prototype._selectWordAt=function(m,S){var C=this._getWordAt(m,S);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[C.start,m[1]],this._model.selectionStartLength=C.length}},v.prototype._selectToWordAt=function(m){var S=this._getWordAt(m,!0);if(S){for(var C=m[1];S.start<0;)S.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,C]}},v.prototype._isCharWordSeparator=function(m){return m.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(m.getChars())>=0},v.prototype._selectLineAt=function(m){var S=this._bufferService.buffer.getWrappedRangeForLine(m);this._model.selectionStart=[0,S.first],this._model.selectionEnd=[this._bufferService.cols,S.last],this._model.selectionStartLength=0},v=p([E(2,n.IBufferService),E(3,n.ICoreService),E(4,h.IMouseService),E(5,n.IOptionsService),E(6,h.IRenderService)],v)}(r.Disposable);R.SelectionService=f},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.SelectionModel=void 0;var L=function(){function M(p){this._bufferService=p,this.isSelectAllActive=!1,this.selectionStartLength=0}return M.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(M.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var p=this.selectionStart[0]+this.selectionStartLength;return p>this._bufferService.cols?[p%this._bufferService.cols,this.selectionStart[1]+Math.floor(p/this._bufferService.cols)]:[p,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),M.prototype.areSelectionValuesReversed=function(){var p=this.selectionStart,E=this.selectionEnd;return!(!p||!E)&&(p[1]>E[1]||p[1]===E[1]&&p[0]>E[0])},M.prototype.onTrim=function(p){return this.selectionStart&&(this.selectionStart[1]-=p),this.selectionEnd&&(this.selectionEnd[1]-=p),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},M}();R.SelectionModel=L},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.moveToCellSequence=void 0;var L=I(12);function M(o,h,n,a){var t=o-p(n,o),r=h-p(n,h);return c(Math.abs(t-r)-function(s,u,f){for(var d=0,v=s-p(f,s),m=u-p(f,u),S=0;S=0&&hh?"A":"B"}function b(o,h,n,a,t,r){for(var s=o,u=h,f="";s!==n||u!==a;)s+=t?1:-1,t&&s>r.cols-1?(f+=r.buffer.translateBufferLineToString(u,!1,o,s),s=0,o=0,u++):!t&&s<0&&(f+=r.buffer.translateBufferLineToString(u,!1,0,o+1),o=s=r.cols-1,u--);return f+r.buffer.translateBufferLineToString(u,!1,o,s)}function i(o,h){var n=h?"O":"[";return L.C0.ESC+n+o}function c(o,h){o=Math.floor(o);for(var n="",a=0;a0?m-p(S,m):d;var y=m,T=function(k,g,F,P,N,W){var j;return j=M(F,P,N,W).length>0?P-p(N,P):g,k=F&&jo?"D":"C",c(Math.abs(r-o),i(t,a));t=s>h?"D":"C";var u=Math.abs(s-h);return c(function(f,d){return d.cols-f}(s>h?o:r,n)+(u-1)*n.cols+1+((s>h?r:o)-1),i(t,a))}},function(G,R,I){"use strict";var L=this&&this.__decorate||function(b,i,c,o){var h,n=arguments.length,a=n<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(b,i,c,o);else for(var t=b.length-1;t>=0;t--)(h=b[t])&&(a=(n<3?h(a):n>3?h(i,c,a):h(i,c))||a);return n>3&&a&&Object.defineProperty(i,c,a),a},M=this&&this.__param||function(b,i){return function(c,o){i(c,o,b)}};Object.defineProperty(R,"__esModule",{value:!0}),R.SoundService=void 0;var p=I(1),E=function(){function b(i){this._optionsService=i}return Object.defineProperty(b,"audioContext",{get:function(){if(!b._audioContext){var i=window.AudioContext||window.webkitAudioContext;if(!i)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;b._audioContext=new i}return b._audioContext},enumerable:!1,configurable:!0}),b.prototype.playBellSound=function(){var i=b.audioContext;if(i){var c=i.createBufferSource();i.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(o){c.buffer=o,c.connect(i.destination),c.start(0)})}},b.prototype._base64ToArrayBuffer=function(i){for(var c=window.atob(i),o=c.length,h=new Uint8Array(o),n=0;n=0;d--)(s=n[d])&&(f=(u<3?s(f):u>3?s(a,t,f):s(a,t))||f);return u>3&&f&&Object.defineProperty(a,t,f),f},E=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(R,"__esModule",{value:!0}),R.MouseZoneManager=void 0;var b=I(2),i=I(7),c=I(5),o=I(1),h=function(n){function a(t,r,s,u,f,d){var v=n.call(this)||this;return v._element=t,v._screenElement=r,v._bufferService=s,v._mouseService=u,v._selectionService=f,v._optionsService=d,v._zones=[],v._areZonesActive=!1,v._lastHoverCoords=[void 0,void 0],v._initialSelectionLength=0,v.register(i.addDisposableDomListener(v._element,"mousedown",function(m){return v._onMouseDown(m)})),v._mouseMoveListener=function(m){return v._onMouseMove(m)},v._mouseLeaveListener=function(m){return v._onMouseLeave(m)},v._clickListener=function(m){return v._onClick(m)},v}return M(a,n),a.prototype.dispose=function(){n.prototype.dispose.call(this),this._deactivate()},a.prototype.add=function(t){this._zones.push(t),this._zones.length===1&&this._activate()},a.prototype.clearAll=function(t,r){if(this._zones.length!==0){t&&r||(t=0,r=this._bufferService.rows-1);for(var s=0;st&&u.y1<=r+1||u.y2>t&&u.y2<=r+1||u.y1r+1)&&(this._currentZone&&this._currentZone===u&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(s--,1))}this._zones.length===0&&this._deactivate()}},a.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},a.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},a.prototype._onMouseMove=function(t){this._lastHoverCoords[0]===t.pageX&&this._lastHoverCoords[1]===t.pageY||(this._onHover(t),this._lastHoverCoords=[t.pageX,t.pageY])},a.prototype._onHover=function(t){var r=this,s=this._findZoneEventAt(t);s!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),s&&(this._currentZone=s,s.hoverCallback&&s.hoverCallback(t),this._tooltipTimeout=window.setTimeout(function(){return r._onTooltip(t)},this._optionsService.options.linkTooltipHoverDuration)))},a.prototype._onTooltip=function(t){this._tooltipTimeout=void 0;var r=this._findZoneEventAt(t);r&&r.tooltipCallback&&r.tooltipCallback(t)},a.prototype._onMouseDown=function(t){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var r=this._findZoneEventAt(t);(r==null?void 0:r.willLinkActivate(t))&&(t.preventDefault(),t.stopImmediatePropagation())}},a.prototype._onMouseLeave=function(t){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},a.prototype._onClick=function(t){var r=this._findZoneEventAt(t),s=this._getSelectionLength();r&&s===this._initialSelectionLength&&(r.clickCallback(t),t.preventDefault(),t.stopImmediatePropagation())},a.prototype._getSelectionLength=function(){var t=this._selectionService.selectionText;return t?t.length:0},a.prototype._findZoneEventAt=function(t){var r=this._mouseService.getCoords(t,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(r)for(var s=r[0],u=r[1],f=0;f=d.x1&&s=d.x1||u===d.y2&&sd.y1&&ur;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var r=document.createElement("div");return r.setAttribute("role","listitem"),r.tabIndex=-1,this._refreshRowDimensions(r),r},t.prototype._onTab=function(r){for(var s=0;s0?this._charsToConsume.shift()!==r&&(this._charsToAnnounce+=r):this._charsToAnnounce+=r,r===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)),E.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){s._accessibilityTreeRoot.appendChild(s._liveRegion)},0))},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,E.isMac&&h.removeElementFromParent(this._liveRegion)},t.prototype._onKey=function(r){this._clearLiveRegion(),this._charsToConsume.push(r)},t.prototype._refreshRows=function(r,s){this._renderRowsDebouncer.refresh(r,s,this._terminal.rows)},t.prototype._renderRows=function(r,s){for(var u=this._terminal.buffer,f=u.lines.length.toString(),d=r;d<=s;d++){var v=u.translateBufferLineToString(u.ydisp+d,!0),m=(u.ydisp+d+1).toString(),S=this._rowElements[d];S&&(v.length===0?S.innerHTML=" ":S.textContent=v,S.setAttribute("aria-posinset",m),S.setAttribute("aria-setsize",f))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var r=0;r=0;_--)(m=u[_])&&(C=(S<3?m(C):S>3?m(f,d,C):m(f,d))||C);return S>3&&C&&Object.defineProperty(f,d,C),C},E=this&&this.__param||function(u,f){return function(d,v){f(d,v,u)}};Object.defineProperty(R,"__esModule",{value:!0}),R.DomRenderer=void 0;var b=I(58),i=I(9),c=I(2),o=I(5),h=I(1),n=I(0),a=I(10),t=I(17),r=1,s=function(u){function f(d,v,m,S,C,_,y,T,k){var g=u.call(this)||this;return g._colors=d,g._element=v,g._screenElement=m,g._viewportElement=S,g._linkifier=C,g._linkifier2=_,g._charSizeService=y,g._optionsService=T,g._bufferService=k,g._terminalClass=r++,g._rowElements=[],g._rowContainer=document.createElement("div"),g._rowContainer.classList.add("xterm-rows"),g._rowContainer.style.lineHeight="normal",g._rowContainer.setAttribute("aria-hidden","true"),g._refreshRowElements(g._bufferService.cols,g._bufferService.rows),g._selectionContainer=document.createElement("div"),g._selectionContainer.classList.add("xterm-selection"),g._selectionContainer.setAttribute("aria-hidden","true"),g.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},g._updateDimensions(),g._injectCss(),g._rowFactory=new b.DomRendererRowFactory(document,g._optionsService,g._colors),g._element.classList.add("xterm-dom-renderer-owner-"+g._terminalClass),g._screenElement.appendChild(g._rowContainer),g._screenElement.appendChild(g._selectionContainer),g._linkifier.onShowLinkUnderline(function(F){return g._onLinkHover(F)}),g._linkifier.onHideLinkUnderline(function(F){return g._onLinkLeave(F)}),g._linkifier2.onShowLinkUnderline(function(F){return g._onLinkHover(F)}),g._linkifier2.onHideLinkUnderline(function(F){return g._onLinkLeave(F)}),g}return M(f,u),Object.defineProperty(f.prototype,"onRequestRedraw",{get:function(){return new n.EventEmitter().event},enumerable:!1,configurable:!0}),f.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),t.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),u.prototype.dispose.call(this)},f.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var d=0,v=this._rowElements;dv;)this._rowContainer.removeChild(this._rowElements.pop())},f.prototype.onResize=function(d,v){this._refreshRowElements(d,v),this._updateDimensions()},f.prototype.onCharSizeChanged=function(){this._updateDimensions()},f.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},f.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},f.prototype.onSelectionChanged=function(d,v,m){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(d&&v){var S=d[1]-this._bufferService.buffer.ydisp,C=v[1]-this._bufferService.buffer.ydisp,_=Math.max(S,0),y=Math.min(C,this._bufferService.rows-1);if(!(_>=this._bufferService.rows||y<0)){var T=document.createDocumentFragment();if(m)T.appendChild(this._createSelectionElement(_,d[0],v[0],y-_+1));else{var k=S===_?d[0]:0,g=_===y?v[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(_,k,g));var F=y-_-1;if(T.appendChild(this._createSelectionElement(_+1,0,this._bufferService.cols,F)),_!==y){var P=C===y?v[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(y,0,P))}}this._selectionContainer.appendChild(T)}}},f.prototype._createSelectionElement=function(d,v,m,S){S===void 0&&(S=1);var C=document.createElement("div");return C.style.height=S*this.dimensions.actualCellHeight+"px",C.style.top=d*this.dimensions.actualCellHeight+"px",C.style.left=v*this.dimensions.actualCellWidth+"px",C.style.width=this.dimensions.actualCellWidth*(m-v)+"px",C},f.prototype.onCursorMove=function(){},f.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},f.prototype.clear=function(){for(var d=0,v=this._rowElements;d=C&&(d=0,m++)}},f=p([E(6,o.ICharSizeService),E(7,h.IOptionsService),E(8,h.IBufferService)],f)}(c.Disposable);R.DomRenderer=s},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.DomRendererRowFactory=R.CURSOR_STYLE_UNDERLINE_CLASS=R.CURSOR_STYLE_BAR_CLASS=R.CURSOR_STYLE_BLOCK_CLASS=R.CURSOR_BLINK_CLASS=R.CURSOR_CLASS=R.UNDERLINE_CLASS=R.ITALIC_CLASS=R.DIM_CLASS=R.BOLD_CLASS=void 0;var L=I(9),M=I(3),p=I(4),E=I(10);R.BOLD_CLASS="xterm-bold",R.DIM_CLASS="xterm-dim",R.ITALIC_CLASS="xterm-italic",R.UNDERLINE_CLASS="xterm-underline",R.CURSOR_CLASS="xterm-cursor",R.CURSOR_BLINK_CLASS="xterm-cursor-blink",R.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",R.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",R.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var b=function(){function c(o,h,n){this._document=o,this._optionsService=h,this._colors=n,this._workCell=new p.CellData}return c.prototype.setColors=function(o){this._colors=o},c.prototype.createRow=function(o,h,n,a,t,r,s){for(var u=this._document.createDocumentFragment(),f=0,d=Math.min(o.length,s)-1;d>=0;d--)if(o.loadCell(d,this._workCell).getCode()!==M.NULL_CELL_CODE||h&&d===a){f=d+1;break}for(d=0;d1&&(m.style.width=r*v+"px"),h&&d===a)switch(m.classList.add(R.CURSOR_CLASS),t&&m.classList.add(R.CURSOR_BLINK_CLASS),n){case"bar":m.classList.add(R.CURSOR_STYLE_BAR_CLASS);break;case"underline":m.classList.add(R.CURSOR_STYLE_UNDERLINE_CLASS);break;default:m.classList.add(R.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&m.classList.add(R.BOLD_CLASS),this._workCell.isItalic()&&m.classList.add(R.ITALIC_CLASS),this._workCell.isDim()&&m.classList.add(R.DIM_CLASS),this._workCell.isUnderline()&&m.classList.add(R.UNDERLINE_CLASS),this._workCell.isInvisible()?m.textContent=M.WHITESPACE_CELL_CHAR:m.textContent=this._workCell.getChars()||M.WHITESPACE_CELL_CHAR;var S=this._workCell.getFgColor(),C=this._workCell.getFgColorMode(),_=this._workCell.getBgColor(),y=this._workCell.getBgColorMode(),T=!!this._workCell.isInverse();if(T){var k=S;S=_,_=k;var g=C;C=y,y=g}switch(C){case 16777216:case 33554432:this._workCell.isBold()&&S<8&&this._optionsService.options.drawBoldTextInBrightColors&&(S+=8),this._applyMinimumContrast(m,this._colors.background,this._colors.ansi[S])||m.classList.add("xterm-fg-"+S);break;case 50331648:var F=E.rgba.toColor(S>>16&255,S>>8&255,255&S);this._applyMinimumContrast(m,this._colors.background,F)||this._addStyle(m,"color:#"+i(S.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(m,this._colors.background,this._colors.foreground)||T&&m.classList.add("xterm-fg-"+L.INVERTED_DEFAULT_COLOR)}switch(y){case 16777216:case 33554432:m.classList.add("xterm-bg-"+_);break;case 50331648:this._addStyle(m,"background-color:#"+i(_.toString(16),"0",6));break;case 0:default:T&&m.classList.add("xterm-bg-"+L.INVERTED_DEFAULT_COLOR)}u.appendChild(m)}}return u},c.prototype._applyMinimumContrast=function(o,h,n){if(this._optionsService.options.minimumContrastRatio===1)return!1;var a=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return a===void 0&&(a=E.color.ensureContrastRatio(h,n,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,a!=null?a:null)),!!a&&(this._addStyle(o,"color:"+a.css),!0)},c.prototype._addStyle=function(o,h){o.setAttribute("style",""+(o.getAttribute("style")||"")+h+";")},c}();function i(c,o,h){for(;c.length"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};R.evaluateKeyboardEvent=function(p,E,b,i){var c={type:0,cancel:!1,key:void 0},o=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?c.key=E?L.C0.ESC+"OA":L.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?c.key=E?L.C0.ESC+"OD":L.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?c.key=E?L.C0.ESC+"OC":L.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(c.key=E?L.C0.ESC+"OB":L.C0.ESC+"[B");break;case 8:if(p.shiftKey){c.key=L.C0.BS;break}if(p.altKey){c.key=L.C0.ESC+L.C0.DEL;break}c.key=L.C0.DEL;break;case 9:if(p.shiftKey){c.key=L.C0.ESC+"[Z";break}c.key=L.C0.HT,c.cancel=!0;break;case 13:c.key=p.altKey?L.C0.ESC+L.C0.CR:L.C0.CR,c.cancel=!0;break;case 27:c.key=L.C0.ESC,p.altKey&&(c.key=L.C0.ESC+L.C0.ESC),c.cancel=!0;break;case 37:if(p.metaKey)break;o?(c.key=L.C0.ESC+"[1;"+(o+1)+"D",c.key===L.C0.ESC+"[1;3D"&&(c.key=L.C0.ESC+(b?"b":"[1;5D"))):c.key=E?L.C0.ESC+"OD":L.C0.ESC+"[D";break;case 39:if(p.metaKey)break;o?(c.key=L.C0.ESC+"[1;"+(o+1)+"C",c.key===L.C0.ESC+"[1;3C"&&(c.key=L.C0.ESC+(b?"f":"[1;5C"))):c.key=E?L.C0.ESC+"OC":L.C0.ESC+"[C";break;case 38:if(p.metaKey)break;o?(c.key=L.C0.ESC+"[1;"+(o+1)+"A",b||c.key!==L.C0.ESC+"[1;3A"||(c.key=L.C0.ESC+"[1;5A")):c.key=E?L.C0.ESC+"OA":L.C0.ESC+"[A";break;case 40:if(p.metaKey)break;o?(c.key=L.C0.ESC+"[1;"+(o+1)+"B",b||c.key!==L.C0.ESC+"[1;3B"||(c.key=L.C0.ESC+"[1;5B")):c.key=E?L.C0.ESC+"OB":L.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(c.key=L.C0.ESC+"[2~");break;case 46:c.key=o?L.C0.ESC+"[3;"+(o+1)+"~":L.C0.ESC+"[3~";break;case 36:c.key=o?L.C0.ESC+"[1;"+(o+1)+"H":E?L.C0.ESC+"OH":L.C0.ESC+"[H";break;case 35:c.key=o?L.C0.ESC+"[1;"+(o+1)+"F":E?L.C0.ESC+"OF":L.C0.ESC+"[F";break;case 33:p.shiftKey?c.type=2:c.key=L.C0.ESC+"[5~";break;case 34:p.shiftKey?c.type=3:c.key=L.C0.ESC+"[6~";break;case 112:c.key=o?L.C0.ESC+"[1;"+(o+1)+"P":L.C0.ESC+"OP";break;case 113:c.key=o?L.C0.ESC+"[1;"+(o+1)+"Q":L.C0.ESC+"OQ";break;case 114:c.key=o?L.C0.ESC+"[1;"+(o+1)+"R":L.C0.ESC+"OR";break;case 115:c.key=o?L.C0.ESC+"[1;"+(o+1)+"S":L.C0.ESC+"OS";break;case 116:c.key=o?L.C0.ESC+"[15;"+(o+1)+"~":L.C0.ESC+"[15~";break;case 117:c.key=o?L.C0.ESC+"[17;"+(o+1)+"~":L.C0.ESC+"[17~";break;case 118:c.key=o?L.C0.ESC+"[18;"+(o+1)+"~":L.C0.ESC+"[18~";break;case 119:c.key=o?L.C0.ESC+"[19;"+(o+1)+"~":L.C0.ESC+"[19~";break;case 120:c.key=o?L.C0.ESC+"[20;"+(o+1)+"~":L.C0.ESC+"[20~";break;case 121:c.key=o?L.C0.ESC+"[21;"+(o+1)+"~":L.C0.ESC+"[21~";break;case 122:c.key=o?L.C0.ESC+"[23;"+(o+1)+"~":L.C0.ESC+"[23~";break;case 123:c.key=o?L.C0.ESC+"[24;"+(o+1)+"~":L.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(b&&!i||!p.altKey||p.metaKey)b&&!p.altKey&&!p.ctrlKey&&p.metaKey?p.keyCode===65&&(c.type=1):p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?c.key=p.key:p.key&&p.ctrlKey&&p.key==="_"&&(c.key=L.C0.US);else{var h=M[p.keyCode],n=h&&h[p.shiftKey?1:0];if(n)c.key=L.C0.ESC+n;else if(p.keyCode>=65&&p.keyCode<=90){var a=p.ctrlKey?p.keyCode-64:p.keyCode+32;c.key=L.C0.ESC+String.fromCharCode(a)}}else p.keyCode>=65&&p.keyCode<=90?c.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?c.key=L.C0.NUL:p.keyCode>=51&&p.keyCode<=55?c.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?c.key=L.C0.DEL:p.keyCode===219?c.key=L.C0.ESC:p.keyCode===220?c.key=L.C0.FS:p.keyCode===221&&(c.key=L.C0.GS)}return c}},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(r,s){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var d in f)f.hasOwnProperty(d)&&(u[d]=f[d])})(r,s)},function(r,s){function u(){this.constructor=r}L(r,s),r.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}),p=this&&this.__decorate||function(r,s,u,f){var d,v=arguments.length,m=v<3?s:f===null?f=Object.getOwnPropertyDescriptor(s,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(r,s,u,f);else for(var S=r.length-1;S>=0;S--)(d=r[S])&&(m=(v<3?d(m):v>3?d(s,u,m):d(s,u))||m);return v>3&&m&&Object.defineProperty(s,u,m),m},E=this&&this.__param||function(r,s){return function(u,f){s(u,f,r)}};Object.defineProperty(R,"__esModule",{value:!0}),R.RenderService=void 0;var b=I(31),i=I(0),c=I(2),o=I(32),h=I(7),n=I(1),a=I(5),t=function(r){function s(u,f,d,v,m,S){var C=r.call(this)||this;if(C._renderer=u,C._rowCount=f,C._isPaused=!1,C._needsFullRefresh=!1,C._isNextRenderRedrawOnly=!0,C._needsSelectionRefresh=!1,C._canvasWidth=0,C._canvasHeight=0,C._selectionState={start:void 0,end:void 0,columnSelectMode:!1},C._onDimensionsChange=new i.EventEmitter,C._onRender=new i.EventEmitter,C._onRefreshRequest=new i.EventEmitter,C.register({dispose:function(){return C._renderer.dispose()}}),C._renderDebouncer=new b.RenderDebouncer(function(y,T){return C._renderRows(y,T)}),C.register(C._renderDebouncer),C._screenDprMonitor=new o.ScreenDprMonitor,C._screenDprMonitor.setListener(function(){return C.onDevicePixelRatioChange()}),C.register(C._screenDprMonitor),C.register(S.onResize(function(y){return C._fullRefresh()})),C.register(v.onOptionChange(function(){return C._renderer.onOptionsChanged()})),C.register(m.onCharSizeChange(function(){return C.onCharSizeChanged()})),C._renderer.onRequestRedraw(function(y){return C.refreshRows(y.start,y.end,!0)}),C.register(h.addDisposableDomListener(window,"resize",function(){return C.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var _=new IntersectionObserver(function(y){return C._onIntersectionChange(y[y.length-1])},{threshold:0});_.observe(d),C.register({dispose:function(){return _.disconnect()}})}return C}return M(s,r),Object.defineProperty(s.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),s.prototype._onIntersectionChange=function(u){this._isPaused=u.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},s.prototype.refreshRows=function(u,f,d){d===void 0&&(d=!1),this._isPaused?this._needsFullRefresh=!0:(d||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(u,f,this._rowCount))},s.prototype._renderRows=function(u,f){this._renderer.renderRows(u,f),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:u,end:f}),this._isNextRenderRedrawOnly=!0},s.prototype.resize=function(u,f){this._rowCount=f,this._fireOnCanvasResize()},s.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},s.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},s.prototype.dispose=function(){r.prototype.dispose.call(this)},s.prototype.setRenderer=function(u){var f=this;this._renderer.dispose(),this._renderer=u,this._renderer.onRequestRedraw(function(d){return f.refreshRows(d.start,d.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},s.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},s.prototype.setColors=function(u){this._renderer.setColors(u),this._fullRefresh()},s.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},s.prototype.onResize=function(u,f){this._renderer.onResize(u,f),this._fullRefresh()},s.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},s.prototype.onBlur=function(){this._renderer.onBlur()},s.prototype.onFocus=function(){this._renderer.onFocus()},s.prototype.onSelectionChanged=function(u,f,d){this._selectionState.start=u,this._selectionState.end=f,this._selectionState.columnSelectMode=d,this._renderer.onSelectionChanged(u,f,d)},s.prototype.onCursorMove=function(){this._renderer.onCursorMove()},s.prototype.clear=function(){this._renderer.clear()},s.prototype.registerCharacterJoiner=function(u){return this._renderer.registerCharacterJoiner(u)},s.prototype.deregisterCharacterJoiner=function(u){return this._renderer.deregisterCharacterJoiner(u)},s=p([E(3,n.IOptionsService),E(4,a.ICharSizeService),E(5,n.IBufferService)],s)}(c.Disposable);R.RenderService=t},function(G,R,I){"use strict";var L=this&&this.__decorate||function(c,o,h,n){var a,t=arguments.length,r=t<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,h):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(c,o,h,n);else for(var s=c.length-1;s>=0;s--)(a=c[s])&&(r=(t<3?a(r):t>3?a(o,h,r):a(o,h))||r);return t>3&&r&&Object.defineProperty(o,h,r),r},M=this&&this.__param||function(c,o){return function(h,n){o(h,n,c)}};Object.defineProperty(R,"__esModule",{value:!0}),R.CharSizeService=void 0;var p=I(1),E=I(0),b=function(){function c(o,h,n){this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=new E.EventEmitter,this._measureStrategy=new i(o,h,this._optionsService)}return Object.defineProperty(c.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),c.prototype.measure=function(){var o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())},c=L([M(2,p.IOptionsService)],c)}();R.CharSizeService=b;var i=function(){function c(o,h,n){this._document=o,this._parentElement=h,this._optionsService=n,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return c.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var o=this._measureElement.getBoundingClientRect();return o.width!==0&&o.height!==0&&(this._result.width=o.width,this._result.height=Math.ceil(o.height)),this._result},c}()},function(G,R,I){"use strict";var L=this&&this.__decorate||function(i,c,o,h){var n,a=arguments.length,t=a<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,o):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(i,c,o,h);else for(var r=i.length-1;r>=0;r--)(n=i[r])&&(t=(a<3?n(t):a>3?n(c,o,t):n(c,o))||t);return a>3&&t&&Object.defineProperty(c,o,t),t},M=this&&this.__param||function(i,c){return function(o,h){c(o,h,i)}};Object.defineProperty(R,"__esModule",{value:!0}),R.MouseService=void 0;var p=I(5),E=I(30),b=function(){function i(c,o){this._renderService=c,this._charSizeService=o}return i.prototype.getCoords=function(c,o,h,n,a){return E.getCoords(c,o,h,n,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,a)},i.prototype.getRawByteCoords=function(c,o,h,n){var a=this.getCoords(c,o,h,n);return E.getRawByteCoords(a)},i=L([M(0,p.IRenderService),M(1,p.ICharSizeService)],i)}();R.MouseService=b},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(n,a){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)r.hasOwnProperty(s)&&(t[s]=r[s])})(n,a)},function(n,a){function t(){this.constructor=n}L(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)}),p=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,f=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(n,a,t,r);else for(var d=n.length-1;d>=0;d--)(s=n[d])&&(f=(u<3?s(f):u>3?s(a,t,f):s(a,t))||f);return u>3&&f&&Object.defineProperty(a,t,f),f},E=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(R,"__esModule",{value:!0}),R.Linkifier2=void 0;var b=I(1),i=I(0),c=I(2),o=I(7),h=function(n){function a(t){var r=n.call(this)||this;return r._bufferService=t,r._linkProviders=[],r._linkCacheDisposables=[],r._isMouseOut=!0,r._activeLine=-1,r._onShowLinkUnderline=r.register(new i.EventEmitter),r._onHideLinkUnderline=r.register(new i.EventEmitter),r.register(c.getDisposeArrayDisposable(r._linkCacheDisposables)),r}return M(a,n),Object.defineProperty(a.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),a.prototype.registerLinkProvider=function(t){var r=this;return this._linkProviders.push(t),{dispose:function(){var s=r._linkProviders.indexOf(t);s!==-1&&r._linkProviders.splice(s,1)}}},a.prototype.attachToDom=function(t,r,s){var u=this;this._element=t,this._mouseService=r,this._renderService=s,this.register(o.addDisposableDomListener(this._element,"mouseleave",function(){u._isMouseOut=!0,u._clearCurrentLink()})),this.register(o.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(o.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},a.prototype._onMouseMove=function(t){if(this._lastMouseEvent=t,this._element&&this._mouseService){var r=this._positionFromMouseEvent(t,this._element,this._mouseService);if(r){this._isMouseOut=!1;for(var s=t.composedPath(),u=0;ut?this._bufferService.cols:v.link.range.end.x,C=m;C<=S;C++){if(s.has(C)){f.splice(d--,1);break}s.add(C)}}},a.prototype._checkLinkProviderResult=function(t,r,s){var u,f=this;if(!this._activeProviderReplies)return s;for(var d=this._activeProviderReplies.get(t),v=!1,m=0;m=t&&this._currentLink.link.range.end.y<=r)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,c.disposeArray(this._linkCacheDisposables))},a.prototype._handleNewLink=function(t){var r=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(t.link,s)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0||t.link.decorations.underline,pointerCursor:t.link.decorations===void 0||t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:function(){var u,f;return(f=(u=r._currentLink)===null||u===void 0?void 0:u.state)===null||f===void 0?void 0:f.decorations.pointerCursor},set:function(u){var f,d;((f=r._currentLink)===null||f===void 0?void 0:f.state)&&r._currentLink.state.decorations.pointerCursor!==u&&(r._currentLink.state.decorations.pointerCursor=u,r._currentLink.state.isHovered&&((d=r._element)===null||d===void 0||d.classList.toggle("xterm-cursor-pointer",u)))}},underline:{get:function(){var u,f;return(f=(u=r._currentLink)===null||u===void 0?void 0:u.state)===null||f===void 0?void 0:f.decorations.underline},set:function(u){var f,d,v;((f=r._currentLink)===null||f===void 0?void 0:f.state)&&((v=(d=r._currentLink)===null||d===void 0?void 0:d.state)===null||v===void 0?void 0:v.decorations.underline)!==u&&(r._currentLink.state.decorations.underline=u,r._currentLink.state.isHovered&&r._fireUnderlineEvent(t.link,u))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(u){var f=u.start===0?0:u.start+1+r._bufferService.buffer.ydisp;r._clearCurrentLink(f,u.end+1+r._bufferService.buffer.ydisp)})))}},a.prototype._linkHover=function(t,r,s){var u;((u=this._currentLink)===null||u===void 0?void 0:u.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),r.hover&&r.hover(s,r.text)},a.prototype._fireUnderlineEvent=function(t,r){var s=t.range,u=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-u-1,s.end.x,s.end.y-u-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)},a.prototype._linkLeave=function(t,r,s){var u;((u=this._currentLink)===null||u===void 0?void 0:u.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),r.leave&&r.leave(s,r.text)},a.prototype._linkAtPosition=function(t,r){var s=t.range.start.y===t.range.end.y,u=t.range.start.yr.y;return(s&&t.range.start.x<=r.x&&t.range.end.x>=r.x||u&&t.range.end.x>=r.x||f&&t.range.start.x<=r.x||u&&f)&&t.range.start.y<=r.y&&t.range.end.y>=r.y},a.prototype._positionFromMouseEvent=function(t,r,s){var u=s.getCoords(t,r,this._bufferService.cols,this._bufferService.rows);if(u)return{x:u[0],y:u[1]+this._bufferService.buffer.ydisp}},a.prototype._createLinkUnderlineEvent=function(t,r,s,u,f){return{x1:t,y1:r,x2:s,y2:u,cols:this._bufferService.cols,fg:f}},a=p([E(0,b.IBufferService)],a)}(c.Disposable);R.Linkifier2=h},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.CoreBrowserService=void 0;var L=function(){function M(p){this._textarea=p}return Object.defineProperty(M.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),M}();R.CoreBrowserService=L},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(m,S){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,_){C.__proto__=_}||function(C,_){for(var y in _)_.hasOwnProperty(y)&&(C[y]=_[y])})(m,S)},function(m,S){function C(){this.constructor=m}L(m,S),m.prototype=S===null?Object.create(S):(C.prototype=S.prototype,new C)});Object.defineProperty(R,"__esModule",{value:!0}),R.CoreTerminal=void 0;var p=I(2),E=I(1),b=I(66),i=I(67),c=I(68),o=I(74),h=I(75),n=I(0),a=I(76),t=I(77),r=I(78),s=I(80),u=I(81),f=I(19),d=I(82),v=function(m){function S(C){var _=m.call(this)||this;return _._onBinary=new n.EventEmitter,_._onData=new n.EventEmitter,_._onLineFeed=new n.EventEmitter,_._onResize=new n.EventEmitter,_._onScroll=new n.EventEmitter,_._instantiationService=new b.InstantiationService,_.optionsService=new o.OptionsService(C),_._instantiationService.setService(E.IOptionsService,_.optionsService),_._bufferService=_.register(_._instantiationService.createInstance(c.BufferService)),_._instantiationService.setService(E.IBufferService,_._bufferService),_._logService=_._instantiationService.createInstance(i.LogService),_._instantiationService.setService(E.ILogService,_._logService),_._coreService=_.register(_._instantiationService.createInstance(h.CoreService,function(){return _.scrollToBottom()})),_._instantiationService.setService(E.ICoreService,_._coreService),_._coreMouseService=_._instantiationService.createInstance(a.CoreMouseService),_._instantiationService.setService(E.ICoreMouseService,_._coreMouseService),_._dirtyRowService=_._instantiationService.createInstance(t.DirtyRowService),_._instantiationService.setService(E.IDirtyRowService,_._dirtyRowService),_.unicodeService=_._instantiationService.createInstance(r.UnicodeService),_._instantiationService.setService(E.IUnicodeService,_.unicodeService),_._charsetService=_._instantiationService.createInstance(s.CharsetService),_._instantiationService.setService(E.ICharsetService,_._charsetService),_._inputHandler=new f.InputHandler(_._bufferService,_._charsetService,_._coreService,_._dirtyRowService,_._logService,_.optionsService,_._coreMouseService,_.unicodeService),_.register(n.forwardEvent(_._inputHandler.onLineFeed,_._onLineFeed)),_.register(_._inputHandler),_.register(n.forwardEvent(_._bufferService.onResize,_._onResize)),_.register(n.forwardEvent(_._coreService.onData,_._onData)),_.register(n.forwardEvent(_._coreService.onBinary,_._onBinary)),_.register(_.optionsService.onOptionChange(function(y){return _._updateOptions(y)})),_._writeBuffer=new d.WriteBuffer(function(y){return _._inputHandler.parse(y)}),_}return M(S,m),Object.defineProperty(S.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),S.prototype.dispose=function(){var C;this._isDisposed||(m.prototype.dispose.call(this),(C=this._windowsMode)===null||C===void 0||C.dispose(),this._windowsMode=void 0)},S.prototype.write=function(C,_){this._writeBuffer.write(C,_)},S.prototype.writeSync=function(C){this._writeBuffer.writeSync(C)},S.prototype.resize=function(C,_){isNaN(C)||isNaN(_)||(C=Math.max(C,c.MINIMUM_COLS),_=Math.max(_,c.MINIMUM_ROWS),this._bufferService.resize(C,_))},S.prototype.scroll=function(C,_){_===void 0&&(_=!1);var y,T=this._bufferService.buffer;(y=this._cachedBlankLine)&&y.length===this.cols&&y.getFg(0)===C.fg&&y.getBg(0)===C.bg||(y=T.getBlankLine(C,_),this._cachedBlankLine=y),y.isWrapped=_;var k=T.ybase+T.scrollTop,g=T.ybase+T.scrollBottom;if(T.scrollTop===0){var F=T.lines.isFull;g===T.lines.length-1?F?T.lines.recycle().copyFrom(y):T.lines.push(y.clone()):T.lines.splice(g+1,0,y.clone()),F?this._bufferService.isUserScrolling&&(T.ydisp=Math.max(T.ydisp-1,0)):(T.ybase++,this._bufferService.isUserScrolling||T.ydisp++)}else{var P=g-k+1;T.lines.shiftElements(k+1,P-1,-1),T.lines.set(g,y.clone())}this._bufferService.isUserScrolling||(T.ydisp=T.ybase),this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom),this._onScroll.fire(T.ydisp)},S.prototype.scrollLines=function(C,_){var y=this._bufferService.buffer;if(C<0){if(y.ydisp===0)return;this._bufferService.isUserScrolling=!0}else C+y.ydisp>=y.ybase&&(this._bufferService.isUserScrolling=!1);var T=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+C,y.ybase),0),T!==y.ydisp&&(_||this._onScroll.fire(y.ydisp))},S.prototype.scrollPages=function(C){this.scrollLines(C*(this.rows-1))},S.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},S.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},S.prototype.scrollToLine=function(C){var _=C-this._bufferService.buffer.ydisp;_!==0&&this.scrollLines(_)},S.prototype.addEscHandler=function(C,_){return this._inputHandler.addEscHandler(C,_)},S.prototype.addDcsHandler=function(C,_){return this._inputHandler.addDcsHandler(C,_)},S.prototype.addCsiHandler=function(C,_){return this._inputHandler.addCsiHandler(C,_)},S.prototype.addOscHandler=function(C,_){return this._inputHandler.addOscHandler(C,_)},S.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},S.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},S.prototype._updateOptions=function(C){var _;switch(C){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((_=this._windowsMode)===null||_===void 0||_.dispose(),this._windowsMode=void 0)}},S.prototype._enableWindowsMode=function(){var C=this;if(!this._windowsMode){var _=[];_.push(this.onLineFeed(u.updateWindowsModeWrappedState.bind(null,this._bufferService))),_.push(this.addCsiHandler({final:"H"},function(){return u.updateWindowsModeWrappedState(C._bufferService),!1})),this._windowsMode={dispose:function(){for(var y=0,T=_;y0?n[0].index:o.length;if(o.length!==f)throw new Error("[createInstance] First service dependency of "+c.name+" at position "+(f+1)+" conflicts with "+o.length+" static arguments");return new(c.bind.apply(c,L([void 0],L(o,a))))},i}();R.InstantiationService=b},function(G,R,I){"use strict";var L=this&&this.__decorate||function(o,h,n,a){var t,r=arguments.length,s=r<3?h:a===null?a=Object.getOwnPropertyDescriptor(h,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,h,n,a);else for(var u=o.length-1;u>=0;u--)(t=o[u])&&(s=(r<3?t(s):r>3?t(h,n,s):t(h,n))||s);return r>3&&s&&Object.defineProperty(h,n,s),s},M=this&&this.__param||function(o,h){return function(n,a){h(n,a,o)}},p=this&&this.__spreadArrays||function(){for(var o=0,h=0,n=arguments.length;h=0;d--)(s=n[d])&&(f=(u<3?s(f):u>3?s(a,t,f):s(a,t))||f);return u>3&&f&&Object.defineProperty(a,t,f),f},E=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(R,"__esModule",{value:!0}),R.BufferService=R.MINIMUM_ROWS=R.MINIMUM_COLS=void 0;var b=I(1),i=I(69),c=I(0),o=I(2);R.MINIMUM_COLS=2,R.MINIMUM_ROWS=1;var h=function(n){function a(t){var r=n.call(this)||this;return r._optionsService=t,r.isUserScrolling=!1,r._onResize=new c.EventEmitter,r.cols=Math.max(t.options.cols,R.MINIMUM_COLS),r.rows=Math.max(t.options.rows,R.MINIMUM_ROWS),r.buffers=new i.BufferSet(t,r),r}return M(a,n),Object.defineProperty(a.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),a.prototype.dispose=function(){n.prototype.dispose.call(this),this.buffers.dispose()},a.prototype.resize=function(t,r){this.cols=t,this.rows=r,this.buffers.resize(t,r),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:t,rows:r})},a.prototype.reset=function(){this.buffers.dispose(),this.buffers=new i.BufferSet(this._optionsService,this),this.isUserScrolling=!1},a=p([E(0,b.IOptionsService)],a)}(o.Disposable);R.BufferService=h},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(i,c){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,h){o.__proto__=h}||function(o,h){for(var n in h)h.hasOwnProperty(n)&&(o[n]=h[n])})(i,c)},function(i,c){function o(){this.constructor=i}L(i,c),i.prototype=c===null?Object.create(c):(o.prototype=c.prototype,new o)});Object.defineProperty(R,"__esModule",{value:!0}),R.BufferSet=void 0;var p=I(70),E=I(0),b=function(i){function c(o,h){var n=i.call(this)||this;return n._onBufferActivate=n.register(new E.EventEmitter),n._normal=new p.Buffer(!0,o,h),n._normal.fillViewportRows(),n._alt=new p.Buffer(!1,o,h),n._activeBuffer=n._normal,n.setupTabStops(),n}return M(c,i),Object.defineProperty(c.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),c.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},c.prototype.activateAltBuffer=function(o){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(o),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},c.prototype.resize=function(o,h){this._normal.resize(o,h),this._alt.resize(o,h)},c.prototype.setupTabStops=function(o){this._normal.setupTabStops(o),this._alt.setupTabStops(o)},c}(I(2).Disposable);R.BufferSet=b},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.BufferStringIterator=R.Buffer=R.MAX_BUFFER_SIZE=void 0;var L=I(71),M=I(16),p=I(4),E=I(3),b=I(72),i=I(73),c=I(20),o=I(6);R.MAX_BUFFER_SIZE=4294967295;var h=function(){function a(t,r,s){this._hasScrollback=t,this._optionsService=r,this._bufferService=s,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=M.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=p.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=p.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new L.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return a.prototype.getNullCell=function(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell},a.prototype.getWhitespaceCell=function(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell},a.prototype.getBlankLine=function(t,r){return new M.BufferLine(this._bufferService.cols,this.getNullCell(t),r)},Object.defineProperty(a.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"isCursorInViewport",{get:function(){var t=this.ybase+this.y-this.ydisp;return t>=0&&tR.MAX_BUFFER_SIZE?R.MAX_BUFFER_SIZE:r},a.prototype.fillViewportRows=function(t){if(this.lines.length===0){t===void 0&&(t=M.DEFAULT_ATTR_DATA);for(var r=this._rows;r--;)this.lines.push(this.getBlankLine(t))}},a.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new L.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},a.prototype.resize=function(t,r){var s=this.getNullCell(M.DEFAULT_ATTR_DATA),u=this._getCorrectBufferLength(r);if(u>this.lines.maxLength&&(this.lines.maxLength=u),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+d+1?(this.ybase--,d++,this.ydisp>0&&this.ydisp--):this.lines.push(new M.BufferLine(t,s)));else for(v=this._rows;v>r;v--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(u0&&(this.lines.trimStart(m),this.ybase=Math.max(this.ybase-m,0),this.ydisp=Math.max(this.ydisp-m,0),this.savedY=Math.max(this.savedY-m,0)),this.lines.maxLength=u}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,r-1),d&&(this.y+=d),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(t,r),this._cols>t))for(f=0;fthis._cols?this._reflowLarger(t,r):this._reflowSmaller(t,r))},a.prototype._reflowLarger=function(t,r){var s=b.reflowLargerGetLinesToRemove(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(M.DEFAULT_ATTR_DATA));if(s.length>0){var u=b.reflowLargerCreateNewLayout(this.lines,s);b.reflowLargerApplyNewLayout(this.lines,u.layout),this._reflowLargerAdjustViewport(t,r,u.countRemoved)}},a.prototype._reflowLargerAdjustViewport=function(t,r,s){for(var u=this.getNullCell(M.DEFAULT_ATTR_DATA),f=s;f-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;d--){var v=this.lines.get(d);if(!(!v||!v.isWrapped&&v.getTrimmedLength()<=t)){for(var m=[v];v.isWrapped&&d>0;)v=this.lines.get(--d),m.unshift(v);var S=this.ybase+this.y;if(!(S>=d&&S0&&(u.push({start:d+m.length+f,newLines:k}),f+=k.length),m.push.apply(m,k);var P=_.length-1,N=_[P];N===0&&(N=_[--P]);for(var W=m.length-y-1,j=C;W>=0;){var A=Math.min(j,N);if(m[P].copyCellsFrom(m[W],j-A,N-A,A,!0),(N-=A)===0&&(N=_[--P]),(j-=A)===0){W--;var K=Math.max(W,0);j=b.getWrappedLineTrimmedLength(m,K,this._cols)}}for(g=0;g0;)this.ybase===0?this.y0){var O=[],z=[];for(g=0;g=0;g--)if(ze&&ze.start>he+Pe){for(var Oe=ze.newLines.length-1;Oe>=0;Oe--)this.lines.set(g--,ze.newLines[Oe]);g++,O.push({index:he+1,amount:ze.newLines.length}),Pe+=ze.newLines.length,ze=u[++be]}else this.lines.set(g,z[he--]);var Ke=0;for(g=O.length-1;g>=0;g--)O[g].index+=Ke,this.lines.onInsertEmitter.fire(O[g]),Ke+=O[g].amount;var je=Math.max(0,te+f-this.lines.maxLength);je>0&&this.lines.onTrimEmitter.fire(je)}},a.prototype.stringIndexToBufferIndex=function(t,r,s){for(s===void 0&&(s=!1);r;){var u=this.lines.get(t);if(!u)return[-1,-1];for(var f=s?u.getTrimmedLength():u.length,d=0;d0&&this.lines.get(r).isWrapped;)r--;for(;s+10;);return t>=this._cols?this._cols-1:t<0?0:t},a.prototype.nextStop=function(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t=this._cols?this._cols-1:t<0?0:t},a.prototype.addMarker=function(t){var r=this,s=new i.Marker(t);return this.markers.push(s),s.register(this.lines.onTrim(function(u){s.line-=u,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(function(u){s.line>=u.index&&(s.line+=u.amount)})),s.register(this.lines.onDelete(function(u){s.line>=u.index&&s.lineu.index&&(s.line-=u.amount)})),s.register(s.onDispose(function(){return r._removeMarker(s)})),s},a.prototype._removeMarker=function(t){this.markers.splice(this.markers.indexOf(t),1)},a.prototype.iterator=function(t,r,s,u,f){return new n(this,t,r,s,u,f)},a}();R.Buffer=h;var n=function(){function a(t,r,s,u,f,d){s===void 0&&(s=0),u===void 0&&(u=t.lines.length),f===void 0&&(f=0),d===void 0&&(d=0),this._buffer=t,this._trimRight=r,this._startIndex=s,this._endIndex=u,this._startOverscan=f,this._endOverscan=d,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return a.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);for(var r="",s=t.first;s<=t.last;++s)r+=this._buffer.translateBufferLineToString(s,this._trimRight);return this._current=t.last+1,{range:t,content:r}},a}();R.BufferStringIterator=n},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.CircularList=void 0;var L=I(0),M=function(){function p(E){this._maxLength=E,this.onDeleteEmitter=new L.EventEmitter,this.onInsertEmitter=new L.EventEmitter,this.onTrimEmitter=new L.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(p.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"maxLength",{get:function(){return this._maxLength},set:function(E){if(this._maxLength!==E){for(var b=new Array(E),i=0;ithis._length)for(var b=this._length;b=E;o--)this._array[this._getCyclicIndex(o+i.length)]=this._array[this._getCyclicIndex(o)];for(o=0;othis._maxLength){var h=this._length+i.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=i.length},p.prototype.trimStart=function(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)},p.prototype.shiftElements=function(E,b,i){if(!(b<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(var c=b-1;c>=0;c--)this.set(E+c+i,this.get(E+c));var o=E+b+i-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(c=0;c=o&&b0&&(C>t||a[C].getTrimmedLength()===0);C--)S++;S>0&&(c.push(o+a.length-S),c.push(S)),o+=a.length-1}}}return c},R.reflowLargerCreateNewLayout=function(M,p){for(var E=[],b=0,i=p[b],c=0,o=0;on&&(c-=n,o++);var a=M[o].getWidth(c-1)===2;a&&c--;var t=a?E-1:E;b.push(t),h+=t}return b},R.getWrappedLineTrimmedLength=L},function(G,R,I){"use strict";var L,M=this&&this.__extends||(L=function(b,i){return(L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,o){c.__proto__=o}||function(c,o){for(var h in o)o.hasOwnProperty(h)&&(c[h]=o[h])})(b,i)},function(b,i){function c(){this.constructor=b}L(b,i),b.prototype=i===null?Object.create(i):(c.prototype=i.prototype,new c)});Object.defineProperty(R,"__esModule",{value:!0}),R.Marker=void 0;var p=I(0),E=function(b){function i(c){var o=b.call(this)||this;return o.line=c,o._id=i._nextId++,o.isDisposed=!1,o._onDispose=new p.EventEmitter,o}return M(i,b),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),i.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},i._nextId=1,i}(I(2).Disposable);R.Marker=E},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.OptionsService=R.DEFAULT_OPTIONS=R.DEFAULT_BELL_SOUND=void 0;var L=I(0),M=I(11),p=I(33);R.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",R.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:R.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:M.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var E=["cols","rows"],b=function(){function i(c){this._onOptionChange=new L.EventEmitter,this.options=p.clone(R.DEFAULT_OPTIONS);for(var o=0,h=Object.keys(c);o=0;m--)(f=t[m])&&(v=(d<3?f(v):d>3?f(r,s,v):f(r,s))||v);return d>3&&v&&Object.defineProperty(r,s,v),v},E=this&&this.__param||function(t,r){return function(s,u){r(s,u,t)}};Object.defineProperty(R,"__esModule",{value:!0}),R.CoreService=void 0;var b=I(1),i=I(0),c=I(33),o=I(2),h=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),a=function(t){function r(s,u,f,d){var v=t.call(this)||this;return v._bufferService=u,v._logService=f,v._optionsService=d,v.isCursorInitialized=!1,v.isCursorHidden=!1,v._onData=v.register(new i.EventEmitter),v._onUserInput=v.register(new i.EventEmitter),v._onBinary=v.register(new i.EventEmitter),v._scrollToBottom=s,v.register({dispose:function(){return v._scrollToBottom=void 0}}),v.modes=c.clone(h),v.decPrivateModes=c.clone(n),v}return M(r,t),Object.defineProperty(r.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this.modes=c.clone(h),this.decPrivateModes=c.clone(n)},r.prototype.triggerDataEvent=function(s,u){if(u===void 0&&(u=!1),!this._optionsService.options.disableStdin){var f=this._bufferService.buffer;f.ybase!==f.ydisp&&this._scrollToBottom(),u&&this._onUserInput.fire(),this._logService.debug('sending data "'+s+'"',function(){return s.split("").map(function(d){return d.charCodeAt(0)})}),this._onData.fire(s)}},r.prototype.triggerBinaryEvent=function(s){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+s+'"',function(){return s.split("").map(function(u){return u.charCodeAt(0)})}),this._onBinary.fire(s))},r=p([E(1,b.IBufferService),E(2,b.ILogService),E(3,b.IOptionsService)],r)}(o.Disposable);R.CoreService=a},function(G,R,I){"use strict";var L=this&&this.__decorate||function(n,a,t,r){var s,u=arguments.length,f=u<3?a:r===null?r=Object.getOwnPropertyDescriptor(a,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(n,a,t,r);else for(var d=n.length-1;d>=0;d--)(s=n[d])&&(f=(u<3?s(f):u>3?s(a,t,f):s(a,t))||f);return u>3&&f&&Object.defineProperty(a,t,f),f},M=this&&this.__param||function(n,a){return function(t,r){a(t,r,n)}};Object.defineProperty(R,"__esModule",{value:!0}),R.CoreMouseService=void 0;var p=I(1),E=I(0),b={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(n){return n.button!==4&&n.action===1&&(n.ctrl=!1,n.alt=!1,n.shift=!1,!0)}},VT200:{events:19,restrict:function(n){return n.action!==32}},DRAG:{events:23,restrict:function(n){return n.action!==32||n.button!==3}},ANY:{events:31,restrict:function(n){return!0}}};function i(n,a){var t=(n.ctrl?16:0)|(n.shift?4:0)|(n.alt?8:0);return n.button===4?(t|=64,t|=n.action):(t|=3&n.button,4&n.button&&(t|=64),8&n.button&&(t|=128),n.action===32?t|=32:n.action!==0||a||(t|=3)),t}var c=String.fromCharCode,o={DEFAULT:function(n){var a=[i(n,!1)+32,n.col+32,n.row+32];return a[0]>255||a[1]>255||a[2]>255?"":"[M"+c(a[0])+c(a[1])+c(a[2])},SGR:function(n){var a=n.action===0&&n.button!==4?"m":"M";return"[<"+i(n,!0)+";"+n.col+";"+n.row+a}},h=function(){function n(a,t){this._bufferService=a,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new E.EventEmitter,this._lastEvent=null;for(var r=0,s=Object.keys(b);r=this._bufferService.cols||a.row<0||a.row>=this._bufferService.rows)return!1;if(a.button===4&&a.action===32)return!1;if(a.button===3&&a.action!==32)return!1;if(a.button!==4&&(a.action===2||a.action===3))return!1;if(a.col++,a.row++,a.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,a))return!1;if(!this._protocols[this._activeProtocol].restrict(a))return!1;var t=this._encodings[this._activeEncoding](a);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=a,!0},n.prototype.explainEvents=function(a){return{down:!!(1&a),up:!!(2&a),drag:!!(4&a),move:!!(8&a),wheel:!!(16&a)}},n.prototype._compareEvents=function(a,t){return a.col===t.col&&(a.row===t.row&&(a.button===t.button&&(a.action===t.action&&(a.ctrl===t.ctrl&&a.alt===t.alt))))&&a.shift===t.shift},n=L([M(0,p.IBufferService),M(1,p.ICoreService)],n)}();R.CoreMouseService=h},function(G,R,I){"use strict";var L=this&&this.__decorate||function(b,i,c,o){var h,n=arguments.length,a=n<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(b,i,c,o);else for(var t=b.length-1;t>=0;t--)(h=b[t])&&(a=(n<3?h(a):n>3?h(i,c,a):h(i,c))||a);return n>3&&a&&Object.defineProperty(i,c,a),a},M=this&&this.__param||function(b,i){return function(c,o){i(c,o,b)}};Object.defineProperty(R,"__esModule",{value:!0}),R.DirtyRowService=void 0;var p=I(1),E=function(){function b(i){this._bufferService=i,this.clearRange()}return Object.defineProperty(b.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),b.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},b.prototype.markDirty=function(i){ithis._end&&(this._end=i)},b.prototype.markRangeDirty=function(i,c){if(i>c){var o=i;i=c,c=o}ithis._end&&(this._end=c)},b.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},b=L([M(0,p.IBufferService)],b)}();R.DirtyRowService=E},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.UnicodeService=void 0;var L=I(0),M=I(79),p=function(){function E(){this._providers=Object.create(null),this._active="",this._onChange=new L.EventEmitter;var b=new M.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}return Object.defineProperty(E.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"activeVersion",{get:function(){return this._active},set:function(b){if(!this._providers[b])throw new Error('unknown Unicode version "'+b+'"');this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)},enumerable:!1,configurable:!0}),E.prototype.register=function(b){this._providers[b.version]=b},E.prototype.wcwidth=function(b){return this._activeProvider.wcwidth(b)},E.prototype.getStringCellWidth=function(b){for(var i=0,c=b.length,o=0;o=c)return i+this.wcwidth(h);var n=b.charCodeAt(o);56320<=n&&n<=57343?h=1024*(h-55296)+n-56320+65536:i+=this.wcwidth(n)}i+=this.wcwidth(h)}return i},E}();R.UnicodeService=p},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.UnicodeV6=void 0;var L,M=I(15),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],E=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],b=function(){function i(){if(this.version="6",!L){L=new Uint8Array(65536),M.fill(L,1),L[0]=0,M.fill(L,0,1,32),M.fill(L,0,127,160),M.fill(L,2,4352,4448),L[9001]=2,L[9002]=2,M.fill(L,2,11904,42192),L[12351]=1,M.fill(L,2,44032,55204),M.fill(L,2,63744,64256),M.fill(L,2,65040,65050),M.fill(L,2,65072,65136),M.fill(L,2,65280,65377),M.fill(L,2,65504,65511);for(var c=0;ch[t][1])return!1;for(;t>=a;)if(o>h[n=a+t>>1][1])a=n+1;else{if(!(o=131072&&c<=196605||c>=196608&&c<=262141?2:1},i}();R.UnicodeV6=b},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.CharsetService=void 0;var L=function(){function M(){this.glevel=0,this._charsets=[]}return M.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},M.prototype.setgLevel=function(p){this.glevel=p,this.charset=this._charsets[p]},M.prototype.setgCharset=function(p,E){this._charsets[p]=E,this.glevel===p&&(this.charset=E)},M}();R.CharsetService=L},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.updateWindowsModeWrappedState=void 0;var L=I(3);R.updateWindowsModeWrappedState=function(M){var p=M.buffer.lines.get(M.buffer.ybase+M.buffer.y-1),E=p==null?void 0:p.get(M.cols-1),b=M.buffer.lines.get(M.buffer.ybase+M.buffer.y);b&&E&&(b.isWrapped=E[L.CHAR_DATA_CODE_INDEX]!==L.NULL_CELL_CODE&&E[L.CHAR_DATA_CODE_INDEX]!==L.WHITESPACE_CELL_CODE)}},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.WriteBuffer=void 0;var L=function(){function M(p){this._action=p,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return M.prototype.writeSync=function(p){if(this._writeBuffer.length){for(var E=this._bufferOffset;E5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return b._innerWrite()})),this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(E)},M.prototype._innerWrite=function(){for(var p=this,E=Date.now();this._writeBuffer.length>this._bufferOffset;){var b=this._writeBuffer[this._bufferOffset],i=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(b),this._pendingData-=b.length,i&&i(),Date.now()-E>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return p._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},M}();R.WriteBuffer=L},function(G,R,I){"use strict";Object.defineProperty(R,"__esModule",{value:!0}),R.AddonManager=void 0;var L=function(){function M(){this._addons=[]}return M.prototype.dispose=function(){for(var p=this._addons.length-1;p>=0;p--)this._addons[p].instance.dispose()},M.prototype.loadAddon=function(p,E){var b=this,i={instance:E,dispose:E.dispose,isDisposed:!1};this._addons.push(i),E.dispose=function(){return b._wrappedAddonDispose(i)},E.activate(p)},M.prototype._wrappedAddonDispose=function(p){if(!p.isDisposed){for(var E=-1,b=0;b{throw h.stack?new Error(h.message+`
`+h.stack):h},0)}}emit(h){this.listeners.forEach(n=>{n(h)})}onUnexpectedError(h){this.unexpectedErrorHandler(h),this.emit(h)}onUnexpectedExternalError(h){this.unexpectedErrorHandler(h)}}const R=new G;function I(h){E(h)||R.onUnexpectedError(h);return}function L(h){E(h)||R.onUnexpectedExternalError(h);return}function M(h){if(h instanceof Error){let{name:n,message:a}=h;const t=h.stacktrace||h.stack;return{$isError:!0,name:n,message:a,stack:t}}return h}const p="Canceled";function E(h){return h instanceof Error&&h.name===p&&h.message===p}function b(){const h=new Error(p);return h.name=h.message,h}function i(h){return h?new Error(`Illegal argument: ${h}`):new Error("Illegal argument")}function c(h){return h?new Error(`Illegal state: ${h}`):new Error("Illegal state")}class o extends Error{constructor(h){super("NotSupported");h&&(this.message=h)}}},"07cG":function(it,re,Q){it.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(it,re,Q){(function(G){G(Q("VrN/"))})(function(G){G.defineOption("placeholder","",function(b,i,c){var o=c&&c!=G.Init;if(i&&!o)b.on("blur",M),b.on("change",p),b.on("swapDoc",p),G.on(b.getInputField(),"compositionupdate",b.state.placeholderCompose=function(){L(b)}),p(b);else if(!i&&o){b.off("blur",M),b.off("change",p),b.off("swapDoc",p),G.off(b.getInputField(),"compositionupdate",b.state.placeholderCompose),R(b);var h=b.getWrapperElement();h.className=h.className.replace(" CodeMirror-empty","")}i&&!b.hasFocus()&&M(b)});function R(b){b.state.placeholder&&(b.state.placeholder.parentNode.removeChild(b.state.placeholder),b.state.placeholder=null)}function I(b){R(b);var i=b.state.placeholder=document.createElement("pre");i.style.cssText="height: 0; overflow: visible",i.style.direction=b.getOption("direction"),i.className="CodeMirror-placeholder CodeMirror-line-like";var c=b.getOption("placeholder");typeof c=="string"&&(c=document.createTextNode(c)),i.appendChild(c),b.display.lineSpace.insertBefore(i,b.display.lineSpace.firstChild)}function L(b){setTimeout(function(){var i=!1,c=b.getInputField();c.nodeName=="TEXTAREA"?i=!c.value:b.lineCount()==1&&(i=!/[^\u200b]/.test(c.querySelector(".CodeMirror-line").textContent)),i?I(b):R(b)},20)}function M(b){E(b)&&I(b)}function p(b){var i=b.getWrapperElement(),c=E(b);i.className=i.className.replace(" CodeMirror-empty","")+(c?" CodeMirror-empty":""),c?I(b):R(b)}function E(b){return b.lineCount()===1&&b.getLine(0)===""}})},"1dTM":function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G=Q("GQ8N"),R=T(Q("Lo0S")),I=Q("VSMT"),L=Q("GdRQ"),M=Q("SZEN"),p=Q("vewr"),E=_(Q("YJ9k")),b=_(Q("MZdM")),i=_(Q("ItS6")),c=_(Q("whVF")),o=_(Q("Fv0C")),h=_(Q("LCi9")),n=_(Q("rwxt")),a=_(Q("Mmt2")),t=_(Q("iUHT")),r=_(Q("mHUz")),s=_(Q("P2ho")),u=Q("NBmB");Q("mdZa");var f=_(Q("34/K")),d=_(Q("hXwI")),v=_(Q("SgaC")),m=_(Q("3690")),S=_(Q("8K/p")),C=_(Q("xO64"));function _(ve){return ve&&ve.__esModule?ve:{default:ve}}function y(){if(typeof WeakMap!="function")return null;var ve=new WeakMap;return y=function(){return ve},ve}function T(ve){if(ve&&ve.__esModule)return ve;if(ve===null||k(ve)!=="object"&&typeof ve!="function")return{default:ve};var xe=y();if(xe&&xe.has(ve))return xe.get(ve);var Se={},Le=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ne in ve)if(Object.prototype.hasOwnProperty.call(ve,ne)){var ye=Le?Object.getOwnPropertyDescriptor(ve,ne):null;ye&&(ye.get||ye.set)?Object.defineProperty(Se,ne,ye):Se[ne]=ve[ne]}return Se.default=ve,xe&&xe.set(ve,Se),Se}function k(ve){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(Se){return typeof Se}:k=function(Se){return Se&&typeof Symbol=="function"&&Se.constructor===Symbol&&Se!==Symbol.prototype?"symbol":typeof Se},k(ve)}function g(ve,xe){if(!(ve instanceof xe))throw new TypeError("Cannot call a class as a function")}function F(ve,xe){for(var Se=0;Se> RFB.constructor"),se._screen=document.createElement("div"),se._screen.style.display="flex",se._screen.style.width="100%",se._screen.style.height="100%",se._screen.style.overflow="auto",se._screen.style.background=te,se._canvas=document.createElement("canvas"),se._canvas.style.margin="auto",se._canvas.style.outline="none",se._canvas.style.flexShrink="0",se._canvas.width=0,se._canvas.height=0,se._canvas.tabIndex=-1,se._screen.appendChild(se._canvas),se._cursor=new n.default,se._cursorImage=Se.cursors.none,se._decoders[u.encodings.encodingRaw]=new f.default,se._decoders[u.encodings.encodingCopyRect]=new d.default,se._decoders[u.encodings.encodingRRE]=new v.default,se._decoders[u.encodings.encodingHextile]=new m.default,se._decoders[u.encodings.encodingTight]=new S.default,se._decoders[u.encodings.encodingTightPNG]=new C.default;try{se._display=new b.default(se._canvas)}catch(Ne){throw R.Error("Display exception: "+Ne),Ne}return se._display.onflush=se._onFlush.bind(K(se)),se._keyboard=new o.default(se._canvas),se._keyboard.onkeyevent=se._handleKeyEvent.bind(K(se)),se._gestures=new h.default,se._sock=new a.default,se._sock.on("message",function(){se._handleMessage()}),se._sock.on("open",function(){se._rfbConnectionState==="connecting"&&se._rfbInitState===""?(se._rfbInitState="ProtocolVersion",R.Debug("Starting VNC handshake")):se._fail("Unexpected server connection while "+se._rfbConnectionState)}),se._sock.on("close",function(Ne){R.Debug("WebSocket on-close event");var Qe="";Ne.code&&(Qe="(code: "+Ne.code,Ne.reason&&(Qe+=", reason: "+Ne.reason),Qe+=")");switch(se._rfbConnectionState){case"connecting":se._fail("Connection closed "+Qe);break;case"connected":se._updateConnectionState("disconnecting"),se._updateConnectionState("disconnected");break;case"disconnecting":se._updateConnectionState("disconnected");break;case"disconnected":se._fail("Unexpected server disconnect when already disconnected "+Qe);break;default:se._fail("Unexpected server disconnect before connecting "+Qe);break}se._sock.off("close")}),se._sock.on("error",function(Ne){return R.Warn("WebSocket on-error event")}),setTimeout(se._updateConnectionState.bind(K(se),"connecting")),R.Debug("<< RFB.constructor"),se.dragViewport=!1,se.focusOnClick=!0,se._viewOnly=!1,se._clipViewport=!1,se._scaleViewport=!1,se._resizeSession=!1,se._showDotCursor=!1,ye.showDotCursor!==void 0&&(R.Warn("Specifying showDotCursor as a RFB constructor argument is deprecated"),se._showDotCursor=ye.showDotCursor),se._qualityLevel=6,se._compressionLevel=2,se}return P(Se,[{key:"disconnect",value:function(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}},{key:"sendCredentials",value:function(ne){this._rfbCredentials=ne,setTimeout(this._initMsg.bind(this),0)}},{key:"sendCtrlAltDel",value:function(){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;R.Info("Sending Ctrl-Alt-Del"),this.sendKey(r.default.XK_Control_L,"ControlLeft",!0),this.sendKey(r.default.XK_Alt_L,"AltLeft",!0),this.sendKey(r.default.XK_Delete,"Delete",!0),this.sendKey(r.default.XK_Delete,"Delete",!1),this.sendKey(r.default.XK_Alt_L,"AltLeft",!1),this.sendKey(r.default.XK_Control_L,"ControlLeft",!1)}},{key:"machineShutdown",value:function(){this._xvpOp(1,2)}},{key:"machineReboot",value:function(){this._xvpOp(1,3)}},{key:"machineReset",value:function(){this._xvpOp(1,4)}},{key:"sendKey",value:function(ne,ye,se){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(se===void 0){this.sendKey(ne,ye,!0),this.sendKey(ne,ye,!1);return}var Ne=s.default[ye];if(this._qemuExtKeyEventSupported&&Ne)ne=ne||0,R.Info("Sending key ("+(se?"down":"up")+"): keysym "+ne+", scancode "+Ne),Se.messages.QEMUExtendedKeyEvent(this._sock,ne,se,Ne);else{if(!ne)return;R.Info("Sending keysym ("+(se?"down":"up")+"): "+ne),Se.messages.keyEvent(this._sock,ne,se?1:0)}}},{key:"focus",value:function(){this._canvas.focus()}},{key:"blur",value:function(){this._canvas.blur()}},{key:"clipboardPasteFrom",value:function(ne){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(this._clipboardServerCapabilitiesFormats[Ae]&&this._clipboardServerCapabilitiesActions[qe])this._clipboardText=ne,Se.messages.extendedClipboardNotify(this._sock,[Ae]);else{for(var ye=new Uint8Array(ne.length),se=0;se> RFB.connect"),R.Info("connecting to "+this._url);try{this._sock.open(this._url,this._wsProtocols)}catch(ne){ne.name==="SyntaxError"?this._fail("Invalid host or port ("+ne+")"):this._fail("Error when opening socket ("+ne+")")}this._target.appendChild(this._screen),this._gestures.attach(this._canvas),this._cursor.attach(this._canvas),this._refreshCursor(),window.addEventListener("resize",this._eventHandlers.windowResize),this._canvas.addEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.addEventListener("touchstart",this._eventHandlers.focusCanvas),this._canvas.addEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.addEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.addEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.addEventListener("click",this._eventHandlers.handleMouse),this._canvas.addEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.addEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.addEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.addEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.addEventListener("gestureend",this._eventHandlers.handleGesture),R.Debug("<< RFB.connect")}},{key:"_disconnect",value:function(){R.Debug(">> RFB.disconnect"),this._cursor.detach(),this._canvas.removeEventListener("gesturestart",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gesturemove",this._eventHandlers.handleGesture),this._canvas.removeEventListener("gestureend",this._eventHandlers.handleGesture),this._canvas.removeEventListener("wheel",this._eventHandlers.handleWheel),this._canvas.removeEventListener("mousedown",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mouseup",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousemove",this._eventHandlers.handleMouse),this._canvas.removeEventListener("click",this._eventHandlers.handleMouse),this._canvas.removeEventListener("contextmenu",this._eventHandlers.handleMouse),this._canvas.removeEventListener("mousedown",this._eventHandlers.focusCanvas),this._canvas.removeEventListener("touchstart",this._eventHandlers.focusCanvas),window.removeEventListener("resize",this._eventHandlers.windowResize),this._keyboard.ungrab(),this._gestures.detach(),this._sock.close();try{this._target.removeChild(this._screen)}catch(ne){if(!(ne.name==="NotFoundError"))throw ne}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),R.Debug("<< RFB.disconnect")}},{key:"_focusCanvas",value:function(ne){if(!this.focusOnClick)return;this.focus()}},{key:"_setDesktopName",value:function(ne){this._fbName=ne,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}},{key:"_windowResize",value:function(ne){var ye=this;window.requestAnimationFrame(function(){ye._updateClip(),ye._updateScale()}),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}},{key:"_updateClip",value:function(){var ne=this._display.clipViewport,ye=this._clipViewport;if(this._scaleViewport&&(ye=!1),ne!==ye&&(this._display.clipViewport=ye),ye){var se=this._screenSize();this._display.viewportChangeSize(se.w,se.h),this._fixScrollbars()}}},{key:"_updateScale",value:function(){if(!this._scaleViewport)this._display.scale=1;else{var ne=this._screenSize();this._display.autoscale(ne.w,ne.h)}this._fixScrollbars()}},{key:"_requestRemoteResize",value:function(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,!this._resizeSession||this._viewOnly||!this._supportsSetDesktopSize)return;var ne=this._screenSize();Se.messages.setDesktopSize(this._sock,Math.floor(ne.w),Math.floor(ne.h),this._screenID,this._screenFlags),R.Debug("Requested new desktop size: "+ne.w+"x"+ne.h)}},{key:"_screenSize",value:function(){var ne=this._screen.getBoundingClientRect();return{w:ne.width,h:ne.height}}},{key:"_fixScrollbars",value:function(){var ne=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=ne}},{key:"_updateConnectionState",value:function(ne){var ye=this,se=this._rfbConnectionState;if(ne===se){R.Debug("Already in state '"+ne+"', ignoring");return}if(se==="disconnected"){R.Error("Tried changing state of a disconnected RFB object");return}switch(ne){case"connected":if(se!=="connecting"){R.Error("Bad transition to connected state, previous connection state: "+se);return}break;case"disconnected":if(se!=="disconnecting"){R.Error("Bad transition to disconnected state, previous connection state: "+se);return}break;case"connecting":if(se!==""){R.Error("Bad transition to connecting state, previous connection state: "+se);return}break;case"disconnecting":if(se!=="connected"&&se!=="connecting"){R.Error("Bad transition to disconnecting state, previous connection state: "+se);return}break;default:R.Error("Unknown connection state: "+ne);return}this._rfbConnectionState=ne,R.Debug("New state '"+ne+"', was '"+se+"'."),this._disconnTimer&&ne!=="disconnecting"&&(R.Debug("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close"));switch(ne){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout(function(){R.Error("Disconnection timed out."),ye._updateConnectionState("disconnected")},z*1e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}));break}}},{key:"_fail",value:function(ne){switch(this._rfbConnectionState){case"disconnecting":R.Error("Failed when disconnecting: "+ne);break;case"connected":R.Error("Failed while connected: "+ne);break;case"connecting":R.Error("Failed when connecting: "+ne);break;default:R.Error("RFB failure: "+ne);break}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}},{key:"_setCapability",value:function(ne,ye){this._capabilities[ne]=ye,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}},{key:"_handleMessage",value:function(){if(this._sock.rQlen===0){R.Warn("handleMessage called on an empty receive queue");return}switch(this._rfbConnectionState){case"disconnected":R.Error("Got data while disconnected");break;case"connected":for(;!this._flushing;){if(!this._normalMsg())break;if(this._sock.rQlen===0)break}break;default:this._initMsg();break}}},{key:"_handleKeyEvent",value:function(ne,ye,se){this.sendKey(ne,ye,se)}},{key:"_handleMouse",value:function(ne){if(ne.type==="click"&&ne.target!==this._canvas)return;if(ne.stopPropagation(),ne.preventDefault(),ne.type==="click"||ne.type==="contextmenu")return;var ye=(0,M.clientToElement)(ne.clientX,ne.clientY,this._canvas);switch(ne.type){case"mousedown":(0,p.setCapture)(this._canvas),this._handleMouseButton(ye.x,ye.y,!0,1<L.dragThreshold||Math.abs(Qe)>L.dragThreshold)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:ne,y:ye},this._display.viewportChangePos(Ne,Qe));return}if(this._mousePos={x:ne,y:ye},this._mouseMoveTimer==null){var Je=Date.now()-this._mouseLastMoveTime;Je>he?(this._sendMouse(ne,ye,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout(function(){se._handleDelayedMouseMove()},he-Je)}}},{key:"_handleDelayedMouseMove",value:function(){this._mouseMoveTimer=null,this._sendMouse(this._mousePos.x,this._mousePos.y,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()}},{key:"_sendMouse",value:function(ne,ye,se){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;Se.messages.pointerEvent(this._sock,this._display.absX(ne),this._display.absY(ye),se)}},{key:"_handleWheel",value:function(ne){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;ne.stopPropagation(),ne.preventDefault();var ye=(0,M.clientToElement)(ne.clientX,ne.clientY,this._canvas),se=ne.deltaX,Ne=ne.deltaY;ne.deltaMode!==0&&(se*=ze,Ne*=ze),this._accumulatedWheelDeltaX+=se,this._accumulatedWheelDeltaY+=Ne,Math.abs(this._accumulatedWheelDeltaX)>=be&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(ye.x,ye.y,!0,1<<5),this._handleMouseButton(ye.x,ye.y,!1,1<<5)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(ye.x,ye.y,!0,1<<6),this._handleMouseButton(ye.x,ye.y,!1,1<<6)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=be&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(ye.x,ye.y,!0,1<<3),this._handleMouseButton(ye.x,ye.y,!1,1<<3)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(ye.x,ye.y,!0,1<<4),this._handleMouseButton(ye.x,ye.y,!1,1<<4)),this._accumulatedWheelDeltaY=0)}},{key:"_fakeMouseMove",value:function(ne,ye,se){this._handleMouseMove(ye,se),this._cursor.move(ne.detail.clientX,ne.detail.clientY)}},{key:"_handleTapEvent",value:function(ne,ye){var se=(0,M.clientToElement)(ne.detail.clientX,ne.detail.clientY,this._canvas);if(this._gestureLastTapTime!==null&&Date.now()-this._gestureLastTapTimeOe;)this._handleMouseButton(se.x,se.y,!0,8),this._handleMouseButton(se.x,se.y,!1,8),this._gestureLastMagnitudeY+=Oe;for(;ne.detail.magnitudeY-this._gestureLastMagnitudeY<-Oe;)this._handleMouseButton(se.x,se.y,!0,16),this._handleMouseButton(se.x,se.y,!1,16),this._gestureLastMagnitudeY-=Oe;for(;ne.detail.magnitudeX-this._gestureLastMagnitudeX>Oe;)this._handleMouseButton(se.x,se.y,!0,32),this._handleMouseButton(se.x,se.y,!1,32),this._gestureLastMagnitudeX+=Oe;for(;ne.detail.magnitudeX-this._gestureLastMagnitudeX<-Oe;)this._handleMouseButton(se.x,se.y,!0,64),this._handleMouseButton(se.x,se.y,!1,64),this._gestureLastMagnitudeX-=Oe;break;case"pinch":if(this._fakeMouseMove(ne,se.x,se.y),ye=Math.hypot(ne.detail.magnitudeX,ne.detail.magnitudeY),Math.abs(ye-this._gestureLastMagnitudeX)>Pe){for(this._handleKeyEvent(r.default.XK_Control_L,"ControlLeft",!0);ye-this._gestureLastMagnitudeX>Pe;)this._handleMouseButton(se.x,se.y,!0,8),this._handleMouseButton(se.x,se.y,!1,8),this._gestureLastMagnitudeX+=Pe;for(;ye-this._gestureLastMagnitudeX<-Pe;)this._handleMouseButton(se.x,se.y,!0,16),this._handleMouseButton(se.x,se.y,!1,16),this._gestureLastMagnitudeX-=Pe}this._handleKeyEvent(r.default.XK_Control_L,"ControlLeft",!1);break}break;case"gestureend":switch(ne.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(ne,se.x,se.y),this._handleMouseButton(se.x,se.y,!1,1);break;case"longpress":this._fakeMouseMove(ne,se.x,se.y),this._handleMouseButton(se.x,se.y,!1,4);break}break}}},{key:"_negotiateProtocolVersion",value:function(){if(this._sock.rQwait("version",12))return!1;var ne=this._sock.rQshiftStr(12).substr(4,7);R.Info("Server ProtocolVersion: "+ne);var ye=0;switch(ne){case"000.000":ye=1;break;case"003.003":case"003.006":case"003.889":this._rfbVersion=3.3;break;case"003.007":this._rfbVersion=3.7;break;case"003.008":case"004.000":case"004.001":case"005.000":this._rfbVersion=3.8;break;default:return this._fail("Invalid server version "+ne)}if(ye){for(var se="ID:"+this._repeaterID;se.length<250;)se+="\0";return this._sock.sendString(se),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);var Ne="00"+parseInt(this._rfbVersion,10)+".00"+this._rfbVersion*10%10;this._sock.sendString("RFB "+Ne+`
`),R.Debug("Sent ProtocolVersion: "+Ne),this._rfbInitState="Security"}},{key:"_negotiateSecurity",value:function(){function ne(Ne,Qe){for(var Je=0;Je=3.7){var ye=this._sock.rQshift8();if(this._sock.rQwait("security type",ye,1))return!1;if(ye===0)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();var se=this._sock.rQshiftBytes(ye);if(R.Debug("Server security types: "+se),ne(1,se))this._rfbAuthScheme=1;else if(ne(22,se))this._rfbAuthScheme=22;else if(ne(16,se))this._rfbAuthScheme=16;else if(ne(2,se))this._rfbAuthScheme=2;else if(ne(19,se))this._rfbAuthScheme=19;else return this._fail("Unsupported security types (types: "+se+")");this._sock.send([this._rfbAuthScheme])}else{if(this._sock.rQwait("security scheme",4))return!1;if(this._rfbAuthScheme=this._sock.rQshift32(),this._rfbAuthScheme==0)return this._rfbInitState="SecurityReason",this._securityContext="authentication scheme",this._securityStatus=1,this._initMsg()}return this._rfbInitState="Authentication",R.Debug("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}},{key:"_handleSecurityReason",value:function(){if(this._sock.rQwait("reason length",4))return!1;var ne=this._sock.rQshift32(),ye="";if(ne>0){if(this._sock.rQwait("reason",ne,4))return!1;ye=this._sock.rQshiftStr(ne)}return ye!==""?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:ye}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+ye+")")):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus}})),this._fail("Security negotiation failed on "+this._securityContext))}},{key:"_negotiateXvpAuth",value:function(){if(this._rfbCredentials.username===void 0||this._rfbCredentials.password===void 0||this._rfbCredentials.target===void 0)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password","target"]}})),!1;var ne=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(ne),this._rfbAuthScheme=2,this._negotiateAuthentication()}},{key:"_negotiateVeNCryptAuth",value:function(){if(this._rfbVeNCryptState==0){if(this._sock.rQwait("vencrypt version",2))return!1;var ne=this._sock.rQshift8(),ye=this._sock.rQshift8();if(!(ne==0&&ye==2))return this._fail("Unsupported VeNCrypt version "+ne+"."+ye);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(this._rfbVeNCryptState==1){if(this._sock.rQwait("vencrypt ack",1))return!1;var se=this._sock.rQshift8();if(se!=0)return this._fail("VeNCrypt failure "+se);this._rfbVeNCryptState=2}if(this._rfbVeNCryptState==2){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;var Ne=this._sock.rQshift8();if(Ne<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=Ne,this._rfbVeNCryptState=3}if(this._rfbVeNCryptState==3){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;for(var Qe=[],Je=0;Je0&&this._sock.rQwait("tunnel capabilities",16*ne,4))return!1;if(this._rfbTightVNC=!0,ne>0)return this._negotiateTightTunnels(ne),!1}if(this._sock.rQwait("sub auth count",4))return!1;var ye=this._sock.rQshift32();if(ye===0)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*ye,4))return!1;for(var se={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},Ne=[],Qe=0;Qe=3.8?(this._rfbInitState="SecurityResult",!0):(this._rfbInitState="ClientInitialisation",this._initMsg());case 22:return this._negotiateXvpAuth();case 2:return this._negotiateStdVNCAuth();case 16:return this._negotiateTightAuth();case 19:return this._negotiateVeNCryptAuth();case 129:return this._negotiateTightUnixAuth();default:return this._fail("Unsupported auth scheme (scheme: "+this._rfbAuthScheme+")")}}},{key:"_handleSecurityResult",value:function(){if(this._sock.rQwait("VNC auth response ",4))return!1;var ne=this._sock.rQshift32();return ne===0?(this._rfbInitState="ClientInitialisation",R.Debug("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=ne,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:ne}})),this._fail("Security handshake failed"))}},{key:"_negotiateServerInit",value:function(){if(this._sock.rQwait("server initialization",24))return!1;var ne=this._sock.rQshift16(),ye=this._sock.rQshift16(),se=this._sock.rQshift8(),Ne=this._sock.rQshift8(),Qe=this._sock.rQshift8(),Je=this._sock.rQshift8(),Ge=this._sock.rQshift16(),ht=this._sock.rQshift16(),de=this._sock.rQshift16(),Me=this._sock.rQshift8(),Fe=this._sock.rQshift8(),Re=this._sock.rQshift8();this._sock.rQskipBytes(3);var _e=this._sock.rQshift32();if(this._sock.rQwait("server init name",_e,24))return!1;var Ee=this._sock.rQshiftStr(_e);if(Ee=(0,I.decodeUTF8)(Ee,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+_e))return!1;var ee=this._sock.rQshift16(),oe=this._sock.rQshift16(),q=this._sock.rQshift16();this._sock.rQskipBytes(2);var ge=(ee+oe+q)*16;if(this._sock.rQwait("TightVNC extended server init header",ge,32+_e))return!1;this._sock.rQskipBytes(16*ee),this._sock.rQskipBytes(16*oe),this._sock.rQskipBytes(16*q)}return R.Info("Screen: "+ne+"x"+ye+", bpp: "+se+", depth: "+Ne+", bigEndian: "+Qe+", trueColor: "+Je+", redMax: "+Ge+", greenMax: "+ht+", blueMax: "+de+", redShift: "+Me+", greenShift: "+Fe+", blueShift: "+Re),this._setDesktopName(Ee),this._resize(ne,ye),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,this._fbName==="Intel(r) AMT KVM"&&(R.Warn("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),Se.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),Se.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}},{key:"_sendEncodings",value:function(){var ne=[];ne.push(u.encodings.encodingCopyRect),this._fbDepth==24&&(ne.push(u.encodings.encodingTight),ne.push(u.encodings.encodingTightPNG),ne.push(u.encodings.encodingHextile),ne.push(u.encodings.encodingRRE)),ne.push(u.encodings.encodingRaw),ne.push(u.encodings.pseudoEncodingQualityLevel0+this._qualityLevel),ne.push(u.encodings.pseudoEncodingCompressLevel0+this._compressionLevel),ne.push(u.encodings.pseudoEncodingDesktopSize),ne.push(u.encodings.pseudoEncodingLastRect),ne.push(u.encodings.pseudoEncodingQEMUExtendedKeyEvent),ne.push(u.encodings.pseudoEncodingExtendedDesktopSize),ne.push(u.encodings.pseudoEncodingXvp),ne.push(u.encodings.pseudoEncodingFence),ne.push(u.encodings.pseudoEncodingContinuousUpdates),ne.push(u.encodings.pseudoEncodingDesktopName),ne.push(u.encodings.pseudoEncodingExtendedClipboard),this._fbDepth==24&&(ne.push(u.encodings.pseudoEncodingVMwareCursor),ne.push(u.encodings.pseudoEncodingCursor)),Se.messages.clientEncodings(this._sock,ne)}},{key:"_initMsg",value:function(){switch(this._rfbInitState){case"ProtocolVersion":return this._negotiateProtocolVersion();case"Security":return this._negotiateSecurity();case"Authentication":return this._negotiateAuthentication();case"SecurityResult":return this._handleSecurityResult();case"SecurityReason":return this._handleSecurityReason();case"ClientInitialisation":return this._sock.send([this._shared?1:0]),this._rfbInitState="ServerInitialisation",!0;case"ServerInitialisation":return this._negotiateServerInit();default:return this._fail("Unknown init state (state: "+this._rfbInitState+")")}}},{key:"_handleSetColourMapMsg",value:function(){return R.Debug("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}},{key:"_handleServerCutText",value:function(){if(R.Debug("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);var ne=this._sock.rQshift32();if(ne=(0,G.toSigned32bit)(ne),this._sock.rQwait("ServerCutText content",Math.abs(ne),8))return!1;if(ne>=0){var ye=this._sock.rQshiftStr(ne);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:ye}}))}else{ne=Math.abs(ne);var se=this._sock.rQshift32(),Ne=se&65535,Qe=se&4278190080,Je=!!(Qe&Xe);if(Je){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(var Ge=0;Ge<=15;Ge++){var ht=1<0&&Ee.charAt(Ee.length-1)==="\0"&&(Ee=Ee.slice(0,-1)),Ee=Ee.replace(`\r
`,`
`),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:Ee}}))}}else return this._fail("Unexpected action in extended clipboard message: "+Qe)}return!0}},{key:"_handleServerFenceMsg",value:function(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);var ne=this._sock.rQshift32(),ye=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",ye,9))return!1;ye>64&&(R.Warn("Bad payload length ("+ye+") in fence response"),ye=64);var se=this._sock.rQshiftStr(ye);return this._supportsFence=!0,ne&1<<31?(ne&=1<<0|1<<1,Se.messages.clientFence(this._sock,ne,se),!0):this._fail("Unexpected fence response")}},{key:"_handleXvpMsg",value:function(){if(this._sock.rQwait("XVP version and message",3,1))return!1;this._sock.rQskipBytes(1);var ne=this._sock.rQshift8(),ye=this._sock.rQshift8();switch(ye){case 0:R.Error("XVP Operation Failed");break;case 1:this._rfbXvpVer=ne,R.Info("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+ye+")");break}return!0}},{key:"_normalMsg",value:function(){var ne;this._FBU.rects>0?ne=0:ne=this._sock.rQshift8();var ye,se;switch(ne){case 0:return se=this._framebufferUpdate(),se&&!this._enabledContinuousUpdates&&Se.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),se;case 1:return this._handleSetColourMapMsg();case 2:return R.Debug("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return ye=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,ye&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),R.Info("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+ne+")"),R.Debug("sock.rQslice(0, 30): "+this._sock.rQslice(0,30)),!0}}},{key:"_onFlush",value:function(){this._flushing=!1,this._sock.rQlen>0&&this._handleMessage()}},{key:"_framebufferUpdate",value:function(){if(this._FBU.rects===0){if(this._sock.rQwait("FBU header",3,1))return!1;if(this._sock.rQskipBytes(1),this._FBU.rects=this._sock.rQshift16(),this._display.pending())return this._flushing=!0,this._display.flush(),!1}for(;this._FBU.rects>0;){if(this._FBU.encoding===null){if(this._sock.rQwait("rect header",12))return!1;var ne=this._sock.rQshiftBytes(12);this._FBU.x=(ne[0]<<8)+ne[1],this._FBU.y=(ne[2]<<8)+ne[3],this._FBU.width=(ne[4]<<8)+ne[5],this._FBU.height=(ne[6]<<8)+ne[7],this._FBU.encoding=parseInt((ne[8]<<24)+(ne[9]<<16)+(ne[10]<<8)+ne[11],10)}if(!this._handleRect())return!1;this._FBU.rects--,this._FBU.encoding=null}return this._display.flip(),!0}},{key:"_handleRect",value:function(){switch(this._FBU.encoding){case u.encodings.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case u.encodings.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case u.encodings.pseudoEncodingCursor:return this._handleCursor();case u.encodings.pseudoEncodingQEMUExtendedKeyEvent:try{var ne=document.createEvent("keyboardEvent");ne.code!==void 0&&(this._qemuExtKeyEventSupported=!0)}catch(ye){}return!0;case u.encodings.pseudoEncodingDesktopName:return this._handleDesktopName();case u.encodings.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case u.encodings.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}},{key:"_handleVMwareCursor",value:function(){var ne=this._FBU.x,ye=this._FBU.y,se=this._FBU.width,Ne=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;var Qe=this._sock.rQshift8();this._sock.rQshift8();var Je,Ge=4;if(Qe==0){var ht=4294967040|0;if(Je=new Array(se*Ne*Ge),this._sock.rQwait("VMware cursor classic encoding",se*Ne*Ge*2,2))return!1;for(var de=new Array(se*Ne),Me=0;Me>8&255,oe=Ee>>16&255,q=Ee>>24&255;Je[_e*Ge]=ee,Je[_e*Ge+1]=oe,Je[_e*Ge+2]=q,Je[_e*Ge+3]=255}else(de[_e]&ht)==ht?Fe[_e]==0?(Je[_e*Ge]=0,Je[_e*Ge+1]=0,Je[_e*Ge+2]=0,Je[_e*Ge+3]=0):((Fe[_e]&ht)==ht,Je[_e*Ge]=0,Je[_e*Ge+1]=0,Je[_e*Ge+2]=0,Je[_e*Ge+3]=255):(Je[_e*Ge]=0,Je[_e*Ge+1]=0,Je[_e*Ge+2]=0,Je[_e*Ge+3]=255)}else if(Qe==1){if(this._sock.rQwait("VMware cursor alpha encoding",se*Ne*4,2))return!1;Je=new Array(se*Ne*Ge);for(var ge=0;ge>24&255,Je[ge*4+1]=Ie>>16&255,Je[ge*4+2]=Ie>>8&255,Je[ge*4+3]=Ie&255}}else return R.Warn("The given cursor type is not supported: "+Qe+" given."),!1;return this._updateCursor(Je,ne,ye,se,Ne),!0}},{key:"_handleCursor",value:function(){var ne=this._FBU.x,ye=this._FBU.y,se=this._FBU.width,Ne=this._FBU.height,Qe=se*Ne*4,Je=Math.ceil(se/8)*Ne,Ge=Qe+Je;if(this._sock.rQwait("cursor encoding",Ge))return!1;for(var ht=this._sock.rQshiftBytes(Qe),de=this._sock.rQshiftBytes(Je),Me=new Uint8Array(se*Ne*4),Fe=0,Re=0;Re9){R.Error("qualityLevel must be an integer between 0 and 9");return}if(this._qualityLevel===ne)return;this._qualityLevel=ne,this._rfbConnectionState==="connected"&&this._sendEncodings()}},{key:"compressionLevel",get:function(){return this._compressionLevel},set:function(ne){if(!Number.isInteger(ne)||ne<0||ne>9){R.Error("compressionLevel must be an integer between 0 and 9");return}if(this._compressionLevel===ne)return;this._compressionLevel=ne,this._rfbConnectionState==="connected"&&this._sendEncodings()}}],[{key:"genDES",value:function(ne,ye){var se=ne.split("").map(function(Ne){return Ne.charCodeAt(0)});return new t.default(se).encrypt(ye)}}]),Se}(E.default);re.default=pe,pe.messages={keyEvent:function(xe,Se,Le){var ne=xe._sQ,ye=xe._sQlen;ne[ye]=4,ne[ye+1]=Le,ne[ye+2]=0,ne[ye+3]=0,ne[ye+4]=Se>>24,ne[ye+5]=Se>>16,ne[ye+6]=Se>>8,ne[ye+7]=Se,xe._sQlen+=8,xe.flush()},QEMUExtendedKeyEvent:function(xe,Se,Le,ne){function ye(Je){var Ge=ne>>8,ht=ne&255;return Ge===224&&ht<127?ht|128:Je}var se=xe._sQ,Ne=xe._sQlen;se[Ne]=255,se[Ne+1]=0,se[Ne+2]=Le>>8,se[Ne+3]=Le,se[Ne+4]=Se>>24,se[Ne+5]=Se>>16,se[Ne+6]=Se>>8,se[Ne+7]=Se;var Qe=ye(ne);se[Ne+8]=Qe>>24,se[Ne+9]=Qe>>16,se[Ne+10]=Qe>>8,se[Ne+11]=Qe,xe._sQlen+=12,xe.flush()},pointerEvent:function(xe,Se,Le,ne){var ye=xe._sQ,se=xe._sQlen;ye[se]=5,ye[se+1]=ne,ye[se+2]=Se>>8,ye[se+3]=Se,ye[se+4]=Le>>8,ye[se+5]=Le,xe._sQlen+=6,xe.flush()},_buildExtendedClipboardFlags:function(xe,Se){for(var Le=new Uint8Array(4),ne=0,ye=0,se=0;se>24,Le[1]=0,Le[2]=0,Le[3]=ne,Le},extendedClipboardProvide:function(xe,Se,Le){for(var ne=new c.default,ye=[],se=0;se>24&255,Ne.length>>16&255,Ne.length>>8&255,Ne.length&255);for(var Qe=0;Qe>24,ye[se+1]=Le[ne[Ne]]>>16,ye[se+2]=Le[ne[Ne]]>>8,ye[se+3]=Le[ne[Ne]]>>0,se+=4,ye[3]|=1<2&&arguments[2]!==void 0?arguments[2]:!1,ne=xe._sQ,ye=xe._sQlen;ne[ye]=6,ne[ye+1]=0,ne[ye+2]=0,ne[ye+3]=0;var se;Le?se=(0,G.toUnsigned32bit)(-Se.length):se=Se.length,ne[ye+4]=se>>24,ne[ye+5]=se>>16,ne[ye+6]=se>>8,ne[ye+7]=se,xe._sQlen+=8;for(var Ne=0,Qe=Se.length;Qe>0;){for(var Je=Math.min(Qe,xe._sQbufferSize-xe._sQlen),Ge=0;Ge>8,se[Ne+3]=Se,se[Ne+4]=Le>>8,se[Ne+5]=Le,se[Ne+6]=1,se[Ne+7]=0,se[Ne+8]=ne>>24,se[Ne+9]=ne>>16,se[Ne+10]=ne>>8,se[Ne+11]=ne,se[Ne+12]=0,se[Ne+13]=0,se[Ne+14]=0,se[Ne+15]=0,se[Ne+16]=Se>>8,se[Ne+17]=Se,se[Ne+18]=Le>>8,se[Ne+19]=Le,se[Ne+20]=ye>>24,se[Ne+21]=ye>>16,se[Ne+22]=ye>>8,se[Ne+23]=ye,xe._sQlen+=24,xe.flush()},clientFence:function(xe,Se,Le){var ne=xe._sQ,ye=xe._sQlen;ne[ye]=248,ne[ye+1]=0,ne[ye+2]=0,ne[ye+3]=0,ne[ye+4]=Se>>24,ne[ye+5]=Se>>16,ne[ye+6]=Se>>8,ne[ye+7]=Se;var se=Le.length;ne[ye+8]=se;for(var Ne=0;Ne>8,Ne[Qe+3]=Le,Ne[Qe+4]=ne>>8,Ne[Qe+5]=ne,Ne[Qe+6]=ye>>8,Ne[Qe+7]=ye,Ne[Qe+8]=se>>8,Ne[Qe+9]=se,xe._sQlen+=10,xe.flush()},pixelFormat:function(xe,Se,Le){var ne=xe._sQ,ye=xe._sQlen,se;Se>16?se=32:Se>8?se=16:se=8;var Ne=Math.floor(Se/3);ne[ye]=0,ne[ye+1]=0,ne[ye+2]=0,ne[ye+3]=0,ne[ye+4]=se,ne[ye+5]=Se,ne[ye+6]=0,ne[ye+7]=Le?1:0,ne[ye+8]=0,ne[ye+9]=(1<>8,Le[ne+3]=Se.length;for(var ye=ne+4,se=0;se>24,Le[ye+1]=Ne>>16,Le[ye+2]=Ne>>8,Le[ye+3]=Ne,ye+=4}xe._sQlen+=ye-ne,xe.flush()},fbUpdateRequest:function(xe,Se,Le,ne,ye,se){var Ne=xe._sQ,Qe=xe._sQlen;typeof Le=="undefined"&&(Le=0),typeof ne=="undefined"&&(ne=0),Ne[Qe]=3,Ne[Qe+1]=Se?1:0,Ne[Qe+2]=Le>>8&255,Ne[Qe+3]=Le&255,Ne[Qe+4]=ne>>8&255,Ne[Qe+5]=ne&255,Ne[Qe+6]=ye>>8&255,Ne[Qe+7]=ye&255,Ne[Qe+8]=se>>8&255,Ne[Qe+9]=se&255,xe._sQlen+=10,xe.flush()},xvpOp:function(xe,Se,Le){var ne=xe._sQ,ye=xe._sQlen;ne[ye]=250,ne[ye+1]=0,ne[ye+2]=Se,ne[ye+3]=Le,xe._sQlen+=4,xe.flush()}},pe.cursors={none:{rgbaPixels:new Uint8Array,w:0,h:0,hotx:0,hoty:0},dot:{rgbaPixels:new Uint8Array([255,255,255,255,0,0,0,255,255,255,255,255,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,255,255,255,255,255]),w:3,h:3,hotx:1,hoty:1}}},"1eCo":function(it,re,Q){(function(G){G(Q("VrN/"))})(function(G){"use strict";var R={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},I={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};G.defineMode("xml",function(L,M){var p=L.indentUnit,E={},b=M.htmlMode?R:I;for(var i in b)E[i]=b[i];for(var i in M)E[i]=M[i];var c,o;function h(g,F){function P(j){return F.tokenize=j,j(g,F)}var N=g.next();if(N=="<")return g.eat("!")?g.eat("[")?g.match("CDATA[")?P(t("atom","]]>")):null:g.match("--")?P(t("comment","-->")):g.match("DOCTYPE",!0,!0)?(g.eatWhile(/[\w\._\-]/),P(r(1))):null:g.eat("?")?(g.eatWhile(/[\w\._\-]/),F.tokenize=t("meta","?>"),"meta"):(c=g.eat("/")?"closeTag":"openTag",F.tokenize=n,"tag bracket");if(N=="&"){var W;return g.eat("#")?g.eat("x")?W=g.eatWhile(/[a-fA-F\d]/)&&g.eat(";"):W=g.eatWhile(/[\d]/)&&g.eat(";"):W=g.eatWhile(/[\w\.\-:]/)&&g.eat(";"),W?"atom":"error"}else return g.eatWhile(/[^&<]/),null}h.isInText=!0;function n(g,F){var P=g.next();if(P==">"||P=="/"&&g.eat(">"))return F.tokenize=h,c=P==">"?"endTag":"selfcloseTag","tag bracket";if(P=="=")return c="equals",null;if(P=="<"){F.tokenize=h,F.state=d,F.tagName=F.tagStart=null;var N=F.tokenize(g,F);return N?N+" tag error":"tag error"}else return/[\'\"]/.test(P)?(F.tokenize=a(P),F.stringStartCol=g.column(),F.tokenize(g,F)):(g.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(g){var F=function(P,N){for(;!P.eol();)if(P.next()==g){N.tokenize=n;break}return"string"};return F.isInAttribute=!0,F}function t(g,F){return function(P,N){for(;!P.eol();){if(P.match(F)){N.tokenize=h;break}P.next()}return g}}function r(g){return function(F,P){for(var N;(N=F.next())!=null;){if(N=="<")return P.tokenize=r(g+1),P.tokenize(F,P);if(N==">")if(g==1){P.tokenize=h;break}else return P.tokenize=r(g-1),P.tokenize(F,P)}return"meta"}}function s(g,F,P){this.prev=g.context,this.tagName=F,this.indent=g.indented,this.startOfLine=P,(E.doNotIndent.hasOwnProperty(F)||g.context&&g.context.noIndent)&&(this.noIndent=!0)}function u(g){g.context&&(g.context=g.context.prev)}function f(g,F){for(var P;;){if(!g.context)return;if(P=g.context.tagName,!E.contextGrabbers.hasOwnProperty(P)||!E.contextGrabbers[P].hasOwnProperty(F))return;u(g)}}function d(g,F,P){return g=="openTag"?(P.tagStart=F.column(),v):g=="closeTag"?m:d}function v(g,F,P){return g=="word"?(P.tagName=F.current(),o="tag",_):E.allowMissingTagName&&g=="endTag"?(o="tag bracket",_(g,F,P)):(o="error",v)}function m(g,F,P){if(g=="word"){var N=F.current();return P.context&&P.context.tagName!=N&&E.implicitlyClosed.hasOwnProperty(P.context.tagName)&&u(P),P.context&&P.context.tagName==N||E.matchClosing===!1?(o="tag",S):(o="tag error",C)}else return E.allowMissingTagName&&g=="endTag"?(o="tag bracket",S(g,F,P)):(o="error",C)}function S(g,F,P){return g!="endTag"?(o="error",S):(u(P),d)}function C(g,F,P){return o="error",S(g,F,P)}function _(g,F,P){if(g=="word")return o="attribute",y;if(g=="endTag"||g=="selfcloseTag"){var N=P.tagName,W=P.tagStart;return P.tagName=P.tagStart=null,g=="selfcloseTag"||E.autoSelfClosers.hasOwnProperty(N)?f(P,N):(f(P,N),P.context=new s(P,N,W==P.indented)),d}return o="error",_}function y(g,F,P){return g=="equals"?T:(E.allowMissing||(o="error"),_(g,F,P))}function T(g,F,P){return g=="string"?k:g=="word"&&E.allowUnquoted?(o="string",_):(o="error",_(g,F,P))}function k(g,F,P){return g=="string"?k:_(g,F,P)}return{startState:function(g){var F={tokenize:h,state:d,indented:g||0,tagName:null,tagStart:null,context:null};return g!=null&&(F.baseIndent=g),F},token:function(g,F){if(!F.tagName&&g.sol()&&(F.indented=g.indentation()),g.eatSpace())return null;c=null;var P=F.tokenize(g,F);return(P||c)&&P!="comment"&&(o=null,F.state=F.state(c||P,g,F),o&&(P=o=="error"?P+" error":o)),P},indent:function(g,F,P){var N=g.context;if(g.tokenize.isInAttribute)return g.tagStart==g.indented?g.stringStartCol+1:g.indented+p;if(N&&N.noIndent)return G.Pass;if(g.tokenize!=n&&g.tokenize!=h)return P?P.match(/^(\s*)/)[0].length:0;if(g.tagName)return E.multilineTagIndentPastTag!==!1?g.tagStart+g.tagName.length+2:g.tagStart+p*(E.multilineTagIndentFactor||1);if(E.alignCDATA&&/$/,blockCommentStart:"",configuration:E.htmlMode?"html":"xml",helperType:E.htmlMode?"html":"xml",skipAttribute:function(g){g.state==T&&(g.state=_)},xmlCurrentTag:function(g){return g.tagName?{name:g.tagName,close:g.type=="closeTag"}:null},xmlCurrentContext:function(g){for(var F=[],P=g.context;P;P=P.prev)P.tagName&&F.push(P.tagName);return F.reverse()}}}),G.defineMIME("text/xml","xml"),G.defineMIME("application/xml","xml"),G.mimeModes.hasOwnProperty("text/html")||G.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1q3G":function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=G;function G(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},"24hK":function(it,re,Q){"use strict";Q.d(re,"a",function(){return R});class G{constructor(I){this.element=I,this.next=G.Undefined,this.prev=G.Undefined}}G.Undefined=new G(void 0);class R{constructor(){this._first=G.Undefined,this._last=G.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===G.Undefined}clear(){let I=this._first;for(;I!==G.Undefined;){const L=I.next;I.prev=G.Undefined,I.next=G.Undefined,I=L}this._first=G.Undefined,this._last=G.Undefined,this._size=0}unshift(I){return this._insert(I,!1)}push(I){return this._insert(I,!0)}_insert(I,L){const M=new G(I);if(this._first===G.Undefined)this._first=M,this._last=M;else if(L){const E=this._last;this._last=M,M.prev=E,E.next=M}else{const E=this._first;this._first=M,M.next=E,E.prev=M}this._size+=1;let p=!1;return()=>{p||(p=!0,this._remove(M))}}shift(){if(this._first===G.Undefined)return;{const I=this._first.element;return this._remove(this._first),I}}pop(){if(this._last===G.Undefined)return;{const I=this._last.element;return this._remove(this._last),I}}_remove(I){if(I.prev!==G.Undefined&&I.next!==G.Undefined){const L=I.prev;L.next=I.next,I.next.prev=L}else I.prev===G.Undefined&&I.next===G.Undefined?(this._first=G.Undefined,this._last=G.Undefined):I.next===G.Undefined?(this._last=this._last.prev,this._last.next=G.Undefined):I.prev===G.Undefined&&(this._first=this._first.next,this._first.prev=G.Undefined);this._size-=1}*[Symbol.iterator](){let I=this._first;for(;I!==G.Undefined;)yield I.element,I=I.next}}},"3/fG":function(it,re,Q){"use strict";Q.d(re,"a",function(){return R});function G(I,L){let M;return L.length===0?M=I:M=I.replace(/\{(\d+)\}/g,function(p,E){const b=E[0];return typeof L[b]!="undefined"?L[b]:p}),M}function R(I,L,...M){return G(L,M)}},"34/K":function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;function G(M,p){if(!(M instanceof p))throw new TypeError("Cannot call a class as a function")}function R(M,p){for(var E=0;E>0&3)*255/3,v[m*4+1]=(u[f+m]>>2&3)*255/3,v[m*4+2]=(u[f+m]>>4&3)*255/3,v[m*4+4]=0;u=v,f=0}return h.blitImage(E,r,i,s,u,f),o.rQskipBytes(s*t),this._lines-=s,!(this._lines>0)}}]),M}();re.default=L},"3690":function(it,re,Q){"use strict";function G(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(o){return typeof o}:G=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},G(i)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var R=L(Q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var i=new WeakMap;return I=function(){return i},i}function L(i){if(i&&i.__esModule)return i;if(i===null||G(i)!=="object"&&typeof i!="function")return{default:i};var c=I();if(c&&c.has(i))return c.get(i);var o={},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var a=h?Object.getOwnPropertyDescriptor(i,n):null;a&&(a.get||a.set)?Object.defineProperty(o,n,a):o[n]=i[n]}return o.default=i,c&&c.set(i,o),o}function M(i,c){if(!(i instanceof c))throw new TypeError("Cannot call a class as a function")}function p(i,c){for(var o=0;o0;){var u=1;if(t.rQwait("HEXTILE",u))return!1;var f=t.rQ,d=t.rQi,v=f[d];if(v>30)throw new Error("Illegal hextile subencoding (subencoding: "+v+")");var m=this._totalTiles-this._tiles,S=m%this._tilesX,C=Math.floor(m/this._tilesX),_=o+S*16,y=h+C*16,T=Math.min(16,o+n-_),k=Math.min(16,h+a-y);if(v&1)u+=T*k*4;else if(v&2&&(u+=4),v&4&&(u+=4),v&8){if(u++,t.rQwait("HEXTILE",u))return!1;var g=f[d+u-1];v&16?u+=g*(4+2):u+=g*2}if(t.rQwait("HEXTILE",u))return!1;if(d++,v===0)this._lastsubencoding&1?R.Debug(" Ignoring blank after RAW"):r.fillRect(_,y,T,k,this._background);else if(v&1)r.blitImage(_,y,T,k,f,d),d+=u-1;else{if(v&2&&(this._background=[f[d],f[d+1],f[d+2],f[d+3]],d+=4),v&4&&(this._foreground=[f[d],f[d+1],f[d+2],f[d+3]],d+=4),r.startTile(_,y,T,k,this._background),v&8){var F=f[d];d++;for(var P=0;P>4,A=W&15,K=f[d];d++;var U=(K>>4)+1,O=(K&15)+1;r.subTile(j,A,U,O,N)}}r.finishTile()}t.rQi=d,this._lastsubencoding=v,this._tiles--}return!0}}]),i}();re.default=b},"5VLF":function(it,re,Q){"use strict";var G,R;function I(L,M,p){var E=function(b,i){return L.js_beautify(b,i)};return E.js=L.js_beautify,E.css=M.css_beautify,E.html=p.html_beautify,E.js_beautify=L.js_beautify,E.css_beautify=M.css_beautify,E.html_beautify=p.html_beautify,E}!(G=[Q("6UM0"),Q("TXwP"),Q("psGv")],R=function(L,M,p){return I(L,M,p)}.apply(re,G),R!==void 0&&(it.exports=R))},"5Y4S":function(it,re,Q){"use strict";Q.d(re,"a",function(){return I});var G=Q("MNsG");const R=G.b.performance&&typeof G.b.performance.now=="function";class I{constructor(L){this._highResolution=R&&L,this._startTime=this._now(),this._stopTime=-1}static create(L=!0){return new I(L)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?G.b.performance.now():Date.now()}}},"6BzB":function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.shrinkBuf=G,re.arraySet=R,re.flattenChunks=I,re.Buf32=re.Buf16=re.Buf8=void 0;function G(E,b){return E.length===b?E:E.subarray?E.subarray(0,b):(E.length=b,E)}function R(E,b,i,c,o){if(b.subarray&&E.subarray){E.set(b.subarray(i,i+c),o);return}for(var h=0;hte&&(te=O.line_indent_level));var he={mode:z,parent:O,last_token:O?O.last_token:new n(f.START_BLOCK,""),last_word:O?O.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:te,alignment:0,line_indent_level:O?O.line_indent_level:te,start_line_index:this._output.get_line_number(),ternary_depth:0};return he},K.prototype._reset=function(O){var z=O.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new h(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(g.BlockStatement);var te=new r(O,this._options);return this._tokens=te.tokenize(),O},K.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,z=this._reset(this._source_text),te=this._options.eol;this._options.eol==="auto"&&(te=`
`,z&&a.lineBreak.test(z||"")&&(te=z.match(a.lineBreak)[0]));for(var he=this._tokens.next();he;)this.handle_token(he),this._last_last_text=this._flags.last_token.text,this._flags.last_token=he,he=this._tokens.next();return O=this._output.get_code(te),O},K.prototype.handle_token=function(O,z){O.type===f.START_EXPR?this.handle_start_expr(O):O.type===f.END_EXPR?this.handle_end_expr(O):O.type===f.START_BLOCK?this.handle_start_block(O):O.type===f.END_BLOCK?this.handle_end_block(O):O.type===f.WORD?this.handle_word(O):O.type===f.RESERVED?this.handle_word(O):O.type===f.SEMICOLON?this.handle_semicolon(O):O.type===f.STRING?this.handle_string(O):O.type===f.EQUALS?this.handle_equals(O):O.type===f.OPERATOR?this.handle_operator(O):O.type===f.COMMA?this.handle_comma(O):O.type===f.BLOCK_COMMENT?this.handle_block_comment(O,z):O.type===f.COMMENT?this.handle_comment(O,z):O.type===f.DOT?this.handle_dot(O):O.type===f.EOF?this.handle_eof(O):O.type===f.UNKNOWN?this.handle_unknown(O,z):this.handle_unknown(O,z)},K.prototype.handle_whitespace_and_comments=function(O,z){var te=O.newlines,he=this._options.keep_array_indentation&&N(this._flags.mode);if(O.comments_before)for(var be=O.comments_before.next();be;)this.handle_whitespace_and_comments(be,z),this.handle_token(be,z),be=O.comments_before.next();if(he)for(var ze=0;ze0,z);else if(this._options.max_preserve_newlines&&te>this._options.max_preserve_newlines&&(te=this._options.max_preserve_newlines),this._options.preserve_newlines&&te>1){this.print_newline(!1,z);for(var Pe=1;Pe0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},K.prototype.set_mode=function(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},K.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===g.Statement&&F(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},K.prototype.start_of_object_property=function(){return this._flags.parent.mode===g.ObjectLiteral&&this._flags.mode===g.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"]))},K.prototype.start_of_statement=function(O){var z=!1;return z=z||C(this._flags.last_token,["var","let","const"])&&O.type===f.WORD,z=z||S(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===g.ObjectLiteral&&this._flags.mode===g.Statement)&&C(this._flags.last_token,U)&&!O.newlines,z=z||S(this._flags.last_token,"else")&&!(S(O,"if")&&!O.comments_before),z=z||this._flags.last_token.type===f.END_EXPR&&(this._previous_flags.mode===g.ForInitializer||this._previous_flags.mode===g.Conditional),z=z||this._flags.last_token.type===f.WORD&&this._flags.mode===g.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==f.WORD&&O.type!==f.RESERVED,z=z||this._flags.mode===g.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||C(this._flags.last_token,["get","set"])),z?(this.set_mode(g.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,C(O,["do","for","if","while"])),!0):!1},K.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var z=g.Expression;if(O.text==="["){if(this._flags.last_token.type===f.WORD||this._flags.last_token.text===")"){C(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=g.ArrayLiteral,N(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),d(this._flags.last_token.type,[f.START_EXPR,f.END_EXPR,f.WORD,f.OPERATOR,f.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===f.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=g.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=g.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.whitespace_before===""?this._output.space_before_token=!1:(d(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===f.EQUALS||this._flags.last_token.type===f.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O);else if(this._flags.last_token.type===f.WORD){this._output.space_before_token=!1;var te=this._tokens.peek(-3);if(this._options.space_after_named_function&&te){var he=this._tokens.peek(-4);C(te,["async","function"])||te.text==="*"&&C(he,["async","function"])?this._output.space_before_token=!0:this._flags.mode===g.ObjectLiteral?(te.text==="{"||te.text===","||te.text==="*"&&(he.text==="{"||he.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(O);(this._flags.last_token.type===f.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===g.ObjectLiteral&&d(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===f.START_BLOCK?this.print_newline():(this._flags.last_token.type===f.END_EXPR||this._flags.last_token.type===f.START_EXPR||this._flags.last_token.type===f.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===f.COMMA)&&this.allow_wrap_or_preserved_newline(O,O.newlines),this.print_token(O),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},K.prototype.handle_end_expr=function(O){for(;this._flags.mode===g.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&N(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===f.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(O),this.restore_mode(),F(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===g.Conditional&&(this._previous_flags.mode=g.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},K.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var z=this._tokens.peek(),te=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===f.END_EXPR?(this.set_mode(g.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(g.BlockStatement):te&&(d(te.text,[":",","])&&d(z.type,[f.STRING,f.WORD,f.RESERVED])||d(z.text,["get","set","..."])&&d(te.type,[f.WORD,f.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d(te.text,[":",","])?this.set_mode(g.BlockStatement):this.set_mode(g.ObjectLiteral):this._flags.last_token.type===f.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(g.BlockStatement):d(this._flags.last_token.type,[f.EQUALS,f.START_EXPR,f.COMMA,f.OPERATOR])||C(this._flags.last_token,["return","throw","import","default"])?this.set_mode(g.ObjectLiteral):this.set_mode(g.BlockStatement),this._flags.last_token&&(C(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var he=!z.comments_before&&z.text==="}",be=he&&this._flags.last_word==="function"&&this._flags.last_token.type===f.END_EXPR;if(this._options.brace_preserve_inline){var ze=0,Pe=null;this._flags.inline_frame=!0;do if(ze+=1,Pe=this._tokens.peek(ze-1),Pe.newlines){this._flags.inline_frame=!1;break}while(Pe.type!==f.EOF&&!(Pe.type===f.END_BLOCK&&Pe.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==f.OPERATOR&&(be||this._flags.last_token.type===f.EQUALS||C(this._flags.last_token,_)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(N(this._previous_flags.mode)&&(this._flags.last_token.type===f.START_EXPR||this._flags.last_token.type===f.COMMA)&&((this._flags.last_token.type===f.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===f.COMMA||this._flags.last_token.type===f.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(O),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==f.OPERATOR&&this._flags.last_token.type!==f.START_EXPR&&(this._flags.last_token.type===f.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(O),this.indent(),!he&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},K.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===g.Statement;)this.restore_mode();var z=this._flags.last_token.type===f.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(N(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(O)},K.prototype.handle_word=function(O){if(O.type===f.RESERVED){if(d(O.text,["set","get"])&&this._flags.mode!==g.ObjectLiteral)O.type=f.WORD;else if(O.text==="import"&&d(this._tokens.peek().text,["(","."]))O.type=f.WORD;else if(d(O.text,["as","from"])&&!this._flags.import_block)O.type=f.WORD;else if(this._flags.mode===g.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(O.type=f.WORD)}}if(this.start_of_statement(O)?C(this._flags.last_token,["var","let","const"])&&O.type===f.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!W(this._flags.mode)&&(this._flags.last_token.type!==f.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==f.EQUALS&&(this._options.preserve_newlines||!C(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(S(O,"while")){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&S(O,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===g.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&C(O,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(O),this._flags.in_case=!0;return}if((this._flags.last_token.type===f.COMMA||this._flags.last_token.type===f.START_EXPR||this._flags.last_token.type===f.EQUALS||this._flags.last_token.type===f.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O)),S(O,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===f.OPERATOR))&&(!this._output.just_added_blankline()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===f.RESERVED||this._flags.last_token.type===f.WORD?C(this._flags.last_token,["get","set","new","export"])||C(this._flags.last_token,U)?this._output.space_before_token=!0:S(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===f.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(W(this._flags.mode)||N(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var te="NONE";if(this._flags.last_token.type===f.END_BLOCK?this._previous_flags.inline_frame?te="SPACE":C(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?te="NEWLINE":(te="SPACE",this._output.space_before_token=!0):te="NEWLINE":this._flags.last_token.type===f.SEMICOLON&&this._flags.mode===g.BlockStatement?te="NEWLINE":this._flags.last_token.type===f.SEMICOLON&&W(this._flags.mode)?te="SPACE":this._flags.last_token.type===f.STRING?te="NEWLINE":this._flags.last_token.type===f.RESERVED||this._flags.last_token.type===f.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===g.ObjectLiteral&&d(this._last_last_text,["{",","]))?te="SPACE":this._flags.last_token.type===f.START_BLOCK?this._flags.inline_frame?te="SPACE":te="NEWLINE":this._flags.last_token.type===f.END_EXPR&&(this._output.space_before_token=!0,te="NEWLINE"),C(O,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?te="SPACE":te="NEWLINE"),C(O,["else","catch","finally"]))if((!(this._flags.last_token.type===f.END_BLOCK&&this._previous_flags.mode===g.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var he=this._output.current_line;he.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else te==="NEWLINE"?C(this._flags.last_token,_)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&C(O,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==f.END_EXPR?(this._flags.last_token.type!==f.START_EXPR||!C(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(O,"if")&&S(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):C(O,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&N(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():te==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===f.WORD||O.previous.type===f.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===f.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(O,"from")&&(this._flags.import_block=!1))},K.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var z=this._tokens.peek();this._flags.mode===g.Statement&&!(this._flags.if_block&&S(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(O)},K.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===f.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),this._flags.last_token.type===f.RESERVED||this._flags.last_token.type===f.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===f.COMMA||this._flags.last_token.type===f.START_EXPR||this._flags.last_token.type===f.EQUALS||this._flags.last_token.type===f.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O):O.text.startsWith("`")&&this._flags.last_token.type===f.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},K.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},K.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),this._output.space_before_token=!0,this._flags.declaration_statement?(W(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)):this._flags.mode===g.ObjectLiteral||this._flags.mode===g.Statement&&this._flags.parent.mode===g.ObjectLiteral?(this._flags.mode===g.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)},K.prototype.handle_operator=function(O){var z=O.text==="*"&&(C(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[f.START_BLOCK,f.COMMA,f.END_BLOCK,f.SEMICOLON])),te=d(O.text,["-","+"])&&(d(this._flags.last_token.type,[f.START_BLOCK,f.START_EXPR,f.EQUALS,f.OPERATOR])||d(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var he=!z;this.handle_whitespace_and_comments(O,he)}if(O.text==="*"&&this._flags.last_token.type===f.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(this._flags.last_token.type===f.OPERATOR&&d(this._options.operator_position,k)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==f.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var be=!0,ze=!0,Pe=!1;if(O.text===":"?this._flags.ternary_depth===0?be=!1:(this._flags.ternary_depth-=1,Pe=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!te&&!z&&this._options.preserve_newlines&&d(O.text,u)){var Oe=O.text===":",Ke=Oe&&Pe,je=Oe&&!Pe;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!je,this.print_token(O),(!Oe||Ke)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!Oe||Ke?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case T.preserve_newline:je||this.allow_wrap_or_preserved_newline(O),be=!(this._output.just_added_newline()||je),this._output.space_before_token=be,this.print_token(O),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(O),be=!1;var Ae=this._tokens.peek();ze=Ae&&d(Ae.type,[f.WORD,f.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),be=this._flags.last_token.type===f.START_BLOCK,ze=!1;else if(d(O.text,["--","++","!","~"])||te){if((this._flags.last_token.type===f.COMMA||this._flags.last_token.type===f.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),be=!1,ze=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var we=C(this._flags.last_token,_)&&O.newlines;we&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(we,!0)}this._flags.last_token.text===";"&&W(this._flags.mode)&&(be=!0),this._flags.last_token.type===f.RESERVED?be=!0:this._flags.last_token.type===f.END_EXPR?be=!(this._flags.last_token.text==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===f.OPERATOR&&(be=d(O.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(O.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(ze=!0)),(this._flags.mode===g.BlockStatement&&!this._flags.inline_frame||this._flags.mode===g.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||be,this.print_token(O),this._output.space_before_token=ze},K.prototype.handle_block_comment=function(O,z){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,z),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,z)},K.prototype.print_block_commment=function(O,z){var te=P(O.text),he,be=!1,ze=!1,Pe=O.whitespace_before,Oe=Pe.length;if(this.print_newline(!1,z),this.print_token_line_indentation(O),this._output.add_token(te[0]),this.print_newline(!1,z),te.length>1){for(te=te.slice(1),be=j(te,"*"),ze=A(te,Pe),be&&(this._flags.alignment=1),he=0;he=0;a--)if(this.__items[a].match(n))return!0;return!1},c.prototype.set_indent=function(n,a){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},c.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},c.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},c.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__character_count-=1),!0}return!1},c.prototype.is_empty=function(){return this.__items.length===0},c.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},c.prototype.push=function(n){this.__items.push(n);var a=n.lastIndexOf(`
`);a!==-1?this.__character_count=n.length-a:this.__character_count+=n.length},c.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},c.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},c.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},c.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},c.prototype.toString=function(){var n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function o(n,a){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),a=a||"",n.indent_level>0&&(a=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}o.prototype.get_indent_size=function(n,a){var t=this.__base_string_length;return a=a||0,n<0&&(t=0),t+=n*this.__indent_size,t+=a,t},o.prototype.get_indent_string=function(n,a){var t=this.__base_string;return a=a||0,n<0&&(n=0,t=""),a+=n*this.__indent_size,this.__ensure_cache(a),t+=this.__cache[a],t},o.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var n=this.__cache.length,a=0,t="";this.__indent_size&&n>=this.__indent_size&&(a=Math.floor(n/this.__indent_size),n-=a*this.__indent_size,t=new Array(a+1).join(this.__indent_string)),n&&(t+=new Array(n+1).join(" ")),this.__cache.push(t)};function h(n,a){this.__indent_cache=new o(n,a),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new c(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(n,a){return this.__indent_cache.get_indent_string(n,a)},h.prototype.get_indent_size=function(n,a){return this.__indent_cache.get_indent_size(n,a)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(n){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var t=this.__lines.join(`
`);return n!==`
`&&(t=t.replace(/[\n]/g,n)),t},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(n,a){return n=n||0,a=a||0,this.next_line.set_indent(n,a),this.__lines.length>1?(this.current_line.set_indent(n,a),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(n){for(var a=0;a1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(n,a){for(var t=this.__lines.length-2;t>=0;){var r=this.__lines[t];if(r.is_empty())break;if(r.item(0).indexOf(n)!==0&&r.item(-1)!==a){this.__lines.splice(t+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},i.exports.Output=h},function(i){function c(o,h,n,a){this.type=o,this.text=h,this.comments_before=null,this.newlines=n||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}i.exports.Token=c},function(i,c){var o="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",n="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",a="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",t="(?:\\\\u[0-9a-fA-F]{4}|["+o+n+"])",r="(?:\\\\u[0-9a-fA-F]{4}|["+h+n+a+"])*";c.identifier=new RegExp(t+r,"g"),c.identifierStart=new RegExp(t),c.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+h+n+a+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;c.newline=/[\n\r\u2028\u2029]/,c.lineBreak=new RegExp(`\r
|`+c.newline.source),c.allLineBreaks=new RegExp(c.lineBreak.source,"g")},function(i,c,o){var h=o(6).Options,n=["before-newline","after-newline","preserve-newline"];function a(t){h.call(this,t,"js");var r=this.raw_options.brace_style||null;r==="expand-strict"?this.raw_options.brace_style="expand":r==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),y=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";y=y.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),y="\\?\\.(?!\\d) "+y,y=y.replace(/ /g,"|");var T=new RegExp(y),k="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),g=k.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),F=new RegExp("^(?:"+g.join("|")+")$"),P,N=function(j,A){n.call(this,j,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var K=new s(this._input),U=new u(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(r.identifier).matching(r.identifierMatch),number:K.matching(m),punct:K.matching(T),comment:K.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:K.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:K.matching(//),include:K.starting_with(/#include/).until_after(r.lineBreak),shebang:K.starting_with(/#!/).until_after(r.lineBreak),xml:K.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};N.prototype=new n,N.prototype._is_comment=function(j){return j.type===d.COMMENT||j.type===d.BLOCK_COMMENT||j.type===d.UNKNOWN},N.prototype._is_opening=function(j){return j.type===d.START_BLOCK||j.type===d.START_EXPR},N.prototype._is_closing=function(j,A){return(j.type===d.END_BLOCK||j.type===d.END_EXPR)&&A&&(j.text==="]"&&A.text==="["||j.text===")"&&A.text==="("||j.text==="}"&&A.text==="{")},N.prototype._reset=function(){P=!1},N.prototype._get_next_token=function(j,A){var K=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(d.EOF,""):(K=K||this._read_non_javascript(U),K=K||this._read_string(U),K=K||this._read_word(j),K=K||this._read_singles(U),K=K||this._read_comment(U),K=K||this._read_regexp(U,j),K=K||this._read_xml(U,j),K=K||this._read_punctuation(),K=K||this._create_token(d.UNKNOWN,this._input.next()),K)},N.prototype._read_word=function(j){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(r.allLineBreaks,`
`),!(j.type===d.DOT||j.type===d.RESERVED&&(j.text==="set"||j.text==="get"))&&F.test(A)?(A==="in"||A==="of")&&(j.type===d.WORD||j.type===d.STRING)?this._create_token(d.OPERATOR,A):this._create_token(d.RESERVED,A):this._create_token(d.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(d.WORD,A)},N.prototype._read_singles=function(j){var A=null;return j==="("||j==="["?A=this._create_token(d.START_EXPR,j):j===")"||j==="]"?A=this._create_token(d.END_EXPR,j):j==="{"?A=this._create_token(d.START_BLOCK,j):j==="}"?A=this._create_token(d.END_BLOCK,j):j===";"?A=this._create_token(d.SEMICOLON,j):j==="."&&C.test(this._input.peek(1))?A=this._create_token(d.DOT,j):j===","&&(A=this._create_token(d.COMMA,j)),A&&this._input.next(),A},N.prototype._read_punctuation=function(){var j=this.__patterns.punct.read();if(j!=="")return j==="="?this._create_token(d.EQUALS,j):j==="?."?this._create_token(d.DOT,j):this._create_token(d.OPERATOR,j)},N.prototype._read_non_javascript=function(j){var A="";if(j==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(d.UNKNOWN,A.trim()+`
`);if(A=this.__patterns.include.read(),A)return this._create_token(d.UNKNOWN,A.trim()+`
`);j=this._input.next();var K="#";if(this._input.hasNext()&&this._input.testChar(S)){do j=this._input.next(),K+=j;while(this._input.hasNext()&&j!=="#"&&j!=="=");return j==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(K+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(K+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,K)}this._input.back()}else if(j==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(r.newline);)A+=this._input.next();return P=!0,this._create_token(d.COMMENT,A)}}else if(P&&j==="-"&&(A=this.__patterns.html_comment_end.read(),A))return P=!1,this._create_token(d.COMMENT,A);return null},N.prototype._read_comment=function(j){var A=null;if(j==="/"){var K="";if(this._input.peek(1)==="*"){K=this.__patterns.block_comment.read();var U=v.get_directives(K);U&&U.ignore==="start"&&(K+=v.readIgnored(this._input)),K=K.replace(r.allLineBreaks,`
`),A=this._create_token(d.BLOCK_COMMENT,K),A.directives=U}else this._input.peek(1)==="/"&&(K=this.__patterns.comment.read(),A=this._create_token(d.COMMENT,K))}return A},N.prototype._read_string=function(j){if(j==="`"||j==="'"||j==='"'){var A=this._input.next();return this.has_char_escapes=!1,j==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(j),this.has_char_escapes&&this._options.unescape_strings&&(A=W(A)),this._input.peek()===j&&(A+=this._input.next()),A=A.replace(r.allLineBreaks,`
`),this._create_token(d.STRING,A)}return null},N.prototype._allow_regexp_or_xml=function(j){return j.type===d.RESERVED&&f(j.text,["return","case","throw","else","do","typeof","yield"])||j.type===d.END_EXPR&&j.text===")"&&j.opened.previous.type===d.RESERVED&&f(j.opened.previous.text,["if","while","for"])||f(j.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},N.prototype._read_regexp=function(j,A){if(j==="/"&&this._allow_regexp_or_xml(A)){for(var K=this._input.next(),U=!1,O=!1;this._input.hasNext()&&(U||O||this._input.peek()!==j)&&!this._input.testChar(r.newline);)K+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===j&&(K+=this._input.next(),K+=this._input.read(r.identifier)),this._create_token(d.STRING,K)}return null},N.prototype._read_xml=function(j,A){if(this._options.e4x&&j==="<"&&this._allow_regexp_or_xml(A)){var K="",U=this.__patterns.xml.read_match();if(U){for(var O=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=O.indexOf("{")===0,te=0;U;){var he=!!U[1],be=U[2],ze=!!U[U.length-1]||be.slice(0,8)==="![CDATA[";if(!ze&&(be===O||z&&be.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(he?--te:++te),K+=U[0],te<=0)break;U=this.__patterns.xml.read_match()}return U||(K+=this._input.match(/[\s\S]*/g)[0]),K=K.replace(r.allLineBreaks,`
`),this._create_token(d.STRING,K)}}return null};function W(j){for(var A="",K=0,U=new h(j),O=null;U.hasNext();)if(O=U.match(/([\s]|[^\\]|\\\\)+/g),O&&(A+=O[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")O=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")O=U.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",U.hasNext()&&(A+=U.next());continue}if(!O)return j;if(K=parseInt(O[1],16),K>126&&K<=255&&O[0].indexOf("x")===0)return j;if(K>=0&&K<32){A+="\\"+O[0];continue}else K===34||K===39||K===92?A+="\\"+String.fromCharCode(K):A+=String.fromCharCode(K)}return A}N.prototype._read_string_recursive=function(j,A,K){var U,O;j==="'"?O=this.__patterns.single_quote:j==='"'?O=this.__patterns.double_quote:j==="`"?O=this.__patterns.template_text:j==="}"&&(O=this.__patterns.template_expression);for(var z=O.read(),te="";this._input.hasNext();){if(te=this._input.next(),te===j||!A&&r.newline.test(te)){this._input.back();break}else te==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
`&&this._input.next(),te+=this._input.next()):K&&(K==="${"&&te==="$"&&this._input.peek()==="{"&&(te+=this._input.next()),K===te&&(j==="`"?te+=this._read_string_recursive("}",A,"`"):te+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(te+=this._input.next())));te+=O.read(),z+=te}return z},i.exports.Tokenizer=N,i.exports.TOKEN=d,i.exports.positionable_operators=_.slice(),i.exports.line_starters=k.slice()},function(i){var c=RegExp.prototype.hasOwnProperty("sticky");function o(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}o.prototype.restart=function(){this.__position=0},o.prototype.back=function(){this.__position>0&&(this.__position-=1)},o.prototype.hasNext=function(){return this.__position=0&&h=0&&n=h.length&&this.__input.substring(n-h.length,n).toLowerCase()===h},i.exports.InputScanner=o},function(i,c,o){var h=o(8).InputScanner,n=o(3).Token,a=o(10).TokenStream,t=o(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(u,f){this._input=new h(u),this._options=f||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new t(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var u,f=new n(r.START,""),d=null,v=[],m=new a;f.type!==r.EOF;){for(u=this._get_next_token(f,d);this._is_comment(u);)m.add(u),u=this._get_next_token(f,d);m.isEmpty()||(u.comments_before=m,m=new a),u.parent=d,this._is_opening(u)?(v.push(d),d=u):d&&this._is_closing(u,d)&&(u.opened=d,d.closed=u,d=v.pop(),u.parent=d),u.previous=f,f.next=u,this.__tokens.add(u),f=u}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(u,f){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(r.RAW,d):this._create_token(r.EOF,"")},s.prototype._is_comment=function(u){return!1},s.prototype._is_opening=function(u){return!1},s.prototype._is_closing=function(u,f){return!1},s.prototype._create_token=function(u,f){var d=new n(u,f,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},i.exports.Tokenizer=s,i.exports.TOKEN=r},function(i){function c(o){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=o}c.prototype.restart=function(){this.__position=0},c.prototype.isEmpty=function(){return this.__tokens_length===0},c.prototype.hasNext=function(){return this.__position=0&&o/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new h,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(t){var r=this._create();return r._disabled[t]=!0,r._update(),r},a.prototype.read_options=function(t){var r=this._create();for(var s in n)r._disabled[s]=t.templating.indexOf(s)===-1;return r._update(),r},a.prototype.exclude=function(t){var r=this._create();return r._excluded[t]=!0,r._update(),r},a.prototype.read=function(){var t="";this._match_pattern?t=this._input.read(this._starting_pattern):t=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),t+=r,r=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},a.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},a.prototype._read_template=function(){var t="",r=this._input.peek();if(r==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(t=t||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(t=t||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t},i.exports.TemplatablePattern=a}],p={};function E(i){var c=p[i];if(c!==void 0)return c.exports;var o=p[i]={exports:{}};return M[i](o,o.exports,E),o.exports}var b=E(0);I=b})();var L=I;!(G=[],R=function(){return{js_beautify:L}}.apply(re,G),R!==void 0&&(it.exports=R))})()},"746U":function(it,re,Q){"use strict";Q.d(re,"f",function(){return G}),Q.d(re,"l",function(){return R}),Q.d(re,"k",function(){return I}),Q.d(re,"j",function(){return L}),Q.d(re,"g",function(){return M}),Q.d(re,"m",function(){return p}),Q.d(re,"h",function(){return E}),Q.d(re,"n",function(){return b}),Q.d(re,"c",function(){return i}),Q.d(re,"a",function(){return c}),Q.d(re,"i",function(){return o}),Q.d(re,"o",function(){return h}),Q.d(re,"e",function(){return t}),Q.d(re,"d",function(){return r}),Q.d(re,"p",function(){return s}),Q.d(re,"b",function(){return u});function G(f){return Array.isArray(f)}function R(f){return typeof f=="string"}function I(f){return typeof f=="object"&&f!==null&&!Array.isArray(f)&&!(f instanceof RegExp)&&!(f instanceof Date)}function L(f){return typeof f=="number"&&!isNaN(f)}function M(f){return f===!0||f===!1}function p(f){return typeof f=="undefined"}function E(f){return!b(f)}function b(f){return p(f)||f===null}function i(f,d){if(!f)throw new Error(d?`Unexpected type, expected '${d}'`:"Unexpected type")}function c(f){if(b(f))throw new Error("Assertion Failed: argument is undefined or null");return f}function o(f){return typeof f=="function"}function h(f,d){const v=Math.min(f.length,d.length);for(let m=0;mfunction(){const C=Array.prototype.slice.call(arguments,0);return d(S,C)};let m={};for(const S of f)m[S]=v(S);return m}function s(f){return f===null?void 0:f}function u(f,d="Unreachable"){throw new Error(d)}},"7Cbv":function(it,re,Q){"use strict";var G=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),R=new Uint8Array(16);function I(){if(!G)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return G(R)}var L=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function M(n){return typeof n=="string"&&L.test(n)}for(var p=M,E=[],b=0;b<256;++b)E.push((b+256).toString(16).substr(1));function i(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(E[n[a+0]]+E[n[a+1]]+E[n[a+2]]+E[n[a+3]]+"-"+E[n[a+4]]+E[n[a+5]]+"-"+E[n[a+6]]+E[n[a+7]]+"-"+E[n[a+8]]+E[n[a+9]]+"-"+E[n[a+10]]+E[n[a+11]]+E[n[a+12]]+E[n[a+13]]+E[n[a+14]]+E[n[a+15]]).toLowerCase();if(!p(t))throw TypeError("Stringified UUID is invalid");return t}var c=i;function o(n,a,t){n=n||{};var r=n.random||(n.rng||I)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,a){t=t||0;for(var s=0;s<16;++s)a[t+s]=r[s];return a}return c(r)}var h=re.a=o},"7ahc":function(it,re,Q){"use strict";Q.d(re,"a",function(){return v});var G=Q("k1fw"),R=Q("0Owb"),I=Q("+L6B"),L=Q("2/Rp"),M=Q("y8nQ"),p=Q("Vl3Y"),E=Q("tJVT"),b=Q("OaEy"),i=Q("2fM7"),c=Q("q1tI"),o=Q.n(c),h=Q("VrN/"),n=Q.n(h),a=Q("p77/"),t=Q.n(a),r=Q("c5Ni"),s=Q.n(r),u=i.a.Option,f={labelCol:{span:4},wrapperCol:{span:20}},d={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};re.b=function(m){var S=m.callback,C=m.onCancel,_=Object(c.useState)("python"),y=Object(E.a)(_,2),T=y[0],k=y[1];function g(P){k(d[P][1])}function F(P){S(P)}return o.a.createElement(p.a,Object(R.a)({},f,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:F}),o.a.createElement(p.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},o.a.createElement(i.a,{onChange:g},Object.keys(d).map(function(P){return o.a.createElement(u,{key:P,value:P},d[P][0])}))),o.a.createElement(p.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},o.a.createElement(v,{mode:T})),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(L.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(L.a,{type:"ghost",onClick:C},"\u53D6\u6D88")))};function v(m){var S=m.value,C=m.onChange,_=m.mode,y=m.options,T=y===void 0?{}:y,k=Object(c.useRef)(),g=Object(c.useState)(),F=Object(E.a)(g,2),P=F[0],N=F[1];return Object(c.useEffect)(function(){if(P){function W(j){var A=j.getValue();C&&C(A)}return P.on("change",W),function(){P.off("change",W)}}},[P,C]),Object(c.useEffect)(function(){P&&P.setOption("mode",_)},[P,_]),Object(c.useEffect)(function(){P&&((S!==P.getValue()||S==="")&&setTimeout(function(){P.setValue(S||" ")},300))},[P,S]),Object(c.useEffect)(function(){if(k.current&&!P){var W=n.a.fromTextArea(k.current,Object(G.a)({mode:_,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},T));N(W)}},[k.current,P]),o.a.createElement("div",{className:"my-codemirror-container"},o.a.createElement("textarea",{ref:k}))}},"7ixt":function(it,re,Q){"use strict";Q.d(re,"a",function(){return I});var G={adjustX:1,adjustY:1},R=[0,0],I={left:{points:["cr","cl"],overflow:G,offset:[-4,0],targetOffset:R},right:{points:["cl","cr"],overflow:G,offset:[4,0],targetOffset:R},top:{points:["bc","tc"],overflow:G,offset:[0,-4],targetOffset:R},bottom:{points:["tc","bc"],overflow:G,offset:[0,4],targetOffset:R},topLeft:{points:["bl","tl"],overflow:G,offset:[0,-4],targetOffset:R},leftTop:{points:["tr","tl"],overflow:G,offset:[-4,0],targetOffset:R},topRight:{points:["br","tr"],overflow:G,offset:[0,-4],targetOffset:R},rightTop:{points:["tl","tr"],overflow:G,offset:[4,0],targetOffset:R},bottomRight:{points:["tr","br"],overflow:G,offset:[0,4],targetOffset:R},rightBottom:{points:["bl","br"],overflow:G,offset:[4,0],targetOffset:R},bottomLeft:{points:["tl","bl"],overflow:G,offset:[0,4],targetOffset:R},leftBottom:{points:["br","bl"],overflow:G,offset:[-4,0],targetOffset:R}},L=I},"8+yF":function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G={256:960,257:992,258:451,259:483,260:417,261:433,262:454,263:486,264:710,265:742,266:709,267:741,268:456,269:488,270:463,271:495,272:464,273:496,274:938,275:954,278:972,279:1004,280:458,281:490,282:460,283:492,284:728,285:760,286:683,287:699,288:725,289:757,290:939,291:955,292:678,293:694,294:673,295:689,296:933,297:949,298:975,299:1007,302:967,303:999,304:681,305:697,308:684,309:700,310:979,311:1011,312:930,313:453,314:485,315:934,316:950,317:421,318:437,321:419,322:435,323:465,324:497,325:977,326:1009,327:466,328:498,330:957,331:959,332:978,333:1010,336:469,337:501,338:5052,339:5053,340:448,341:480,342:931,343:947,344:472,345:504,346:422,347:438,348:734,349:766,350:426,351:442,352:425,353:441,354:478,355:510,356:427,357:443,358:940,359:956,360:989,361:1021,362:990,363:1022,364:733,365:765,366:473,367:505,368:475,369:507,370:985,371:1017,376:5054,377:428,378:444,379:431,380:447,381:430,382:446,402:2294,466:16777681,711:439,728:418,729:511,731:434,733:445,901:1966,902:1953,904:1954,905:1955,906:1956,908:1959,910:1960,911:1963,912:1974,913:1985,914:1986,915:1987,916:1988,917:1989,918:1990,919:1991,920:1992,921:1993,922:1994,923:1995,924:1996,925:1997,926:1998,927:1999,928:2e3,929:2001,931:2002,932:2004,933:2005,934:2006,935:2007,936:2008,937:2009,938:1957,939:1961,940:1969,941:1970,942:1971,943:1972,944:1978,945:2017,946:2018,947:2019,948:2020,949:2021,950:2022,951:2023,952:2024,953:2025,954:2026,955:2027,956:2028,957:2029,958:2030,959:2031,960:2032,961:2033,962:2035,963:2034,964:2036,965:2037,966:2038,967:2039,968:2040,969:2041,970:1973,971:1977,972:1975,973:1976,974:1979,1025:1715,1026:1713,1027:1714,1028:1716,1029:1717,1030:1718,1031:1719,1032:1720,1033:1721,1034:1722,1035:1723,1036:1724,1038:1726,1039:1727,1040:1761,1041:1762,1042:1783,1043:1767,1044:1764,1045:1765,1046:1782,1047:1786,1048:1769,1049:1770,1050:1771,1051:1772,1052:1773,1053:1774,1054:1775,1055:1776,1056:1778,1057:1779,1058:1780,1059:1781,1060:1766,1061:1768,1062:1763,1063:1790,1064:1787,1065:1789,1066:1791,1067:1785,1068:1784,1069:1788,1070:1760,1071:1777,1072:1729,1073:1730,1074:1751,1075:1735,1076:1732,1077:1733,1078:1750,1079:1754,1080:1737,1081:1738,1082:1739,1083:1740,1084:1741,1085:1742,1086:1743,1087:1744,1088:1746,1089:1747,1090:1748,1091:1749,1092:1734,1093:1736,1094:1731,1095:1758,1096:1755,1097:1757,1098:1759,1099:1753,1100:1752,1101:1756,1102:1728,1103:1745,1105:1699,1106:1697,1107:1698,1108:1700,1109:1701,1110:1702,1111:1703,1112:1704,1113:1705,1114:1706,1115:1707,1116:1708,1118:1710,1119:1711,1168:1725,1169:1709,1488:3296,1489:3297,1490:3298,1491:3299,1492:3300,1493:3301,1494:3302,1495:3303,1496:3304,1497:3305,1498:3306,1499:3307,1500:3308,1501:3309,1502:3310,1503:3311,1504:3312,1505:3313,1506:3314,1507:3315,1508:3316,1509:3317,1510:3318,1511:3319,1512:3320,1513:3321,1514:3322,1548:1452,1563:1467,1567:1471,1569:1473,1570:1474,1571:1475,1572:1476,1573:1477,1574:1478,1575:1479,1576:1480,1577:1481,1578:1482,1579:1483,1580:1484,1581:1485,1582:1486,1583:1487,1584:1488,1585:1489,1586:1490,1587:1491,1588:1492,1589:1493,1590:1494,1591:1495,1592:1496,1593:1497,1594:1498,1600:1504,1601:1505,1602:1506,1603:1507,1604:1508,1605:1509,1606:1510,1607:1511,1608:1512,1609:1513,1610:1514,1611:1515,1612:1516,1613:1517,1614:1518,1615:1519,1616:1520,1617:1521,1618:1522,3585:3489,3586:3490,3587:3491,3588:3492,3589:3493,3590:3494,3591:3495,3592:3496,3593:3497,3594:3498,3595:3499,3596:3500,3597:3501,3598:3502,3599:3503,3600:3504,3601:3505,3602:3506,3603:3507,3604:3508,3605:3509,3606:3510,3607:3511,3608:3512,3609:3513,3610:3514,3611:3515,3612:3516,3613:3517,3614:3518,3615:3519,3616:3520,3617:3521,3618:3522,3619:3523,3620:3524,3621:3525,3622:3526,3623:3527,3624:3528,3625:3529,3626:3530,3627:3531,3628:3532,3629:3533,3630:3534,3631:3535,3632:3536,3633:3537,3634:3538,3635:3539,3636:3540,3637:3541,3638:3542,3639:3543,3640:3544,3641:3545,3642:3546,3647:3551,3648:3552,3649:3553,3650:3554,3651:3555,3652:3556,3653:3557,3654:3558,3655:3559,3656:3560,3657:3561,3658:3562,3659:3563,3660:3564,3661:3565,3664:3568,3665:3569,3666:3570,3667:3571,3668:3572,3669:3573,3670:3574,3671:3575,3672:3576,3673:3577,8194:2722,8195:2721,8196:2723,8197:2724,8199:2725,8200:2726,8201:2727,8202:2728,8210:2747,8211:2730,8212:2729,8213:1967,8215:3295,8216:2768,8217:2769,8218:2813,8220:2770,8221:2771,8222:2814,8224:2801,8225:2802,8226:2790,8229:2735,8230:2734,8240:2773,8242:2774,8243:2775,8248:2812,8254:1150,8361:3839,8364:8364,8453:2744,8470:1712,8471:2811,8478:2772,8482:2761,8531:2736,8532:2737,8533:2738,8534:2739,8535:2740,8536:2741,8537:2742,8538:2743,8539:2755,8540:2756,8541:2757,8542:2758,8592:2299,8593:2300,8594:2301,8595:2302,8658:2254,8660:2253,8706:2287,8711:2245,8728:3018,8730:2262,8733:2241,8734:2242,8743:2270,8744:2271,8745:2268,8746:2269,8747:2239,8756:2240,8764:2248,8771:2249,8773:16785992,8800:2237,8801:2255,8804:2236,8805:2238,8834:2266,8835:2267,8866:3068,8867:3036,8868:3010,8869:3022,8968:3027,8970:3012,8981:2810,8992:2212,8993:2213,9109:3020,9115:2219,9117:2220,9118:2221,9120:2222,9121:2215,9123:2216,9124:2217,9126:2218,9128:2223,9132:2224,9143:2209,9146:2543,9147:2544,9148:2546,9149:2547,9225:2530,9226:2533,9227:2537,9228:2531,9229:2532,9251:2732,9252:2536,9472:2211,9474:2214,9484:2210,9488:2539,9492:2541,9496:2538,9500:2548,9508:2549,9516:2551,9524:2550,9532:2542,9618:2529,9642:2791,9643:2785,9644:2779,9645:2786,9646:2783,9647:2767,9650:2792,9651:2787,9654:2781,9655:2765,9660:2793,9661:2788,9664:2780,9665:2764,9670:2528,9675:2766,9679:2782,9702:2784,9734:2789,9742:2809,9747:2762,9756:2794,9758:2795,9792:2808,9794:2807,9827:2796,9829:2798,9830:2797,9837:2806,9839:2805,10003:2803,10007:2804,10013:2777,10016:2800,10216:2748,10217:2750,12289:1188,12290:1185,12300:1186,12301:1187,12443:1246,12444:1247,12449:1191,12450:1201,12451:1192,12452:1202,12453:1193,12454:1203,12455:1194,12456:1204,12457:1195,12458:1205,12459:1206,12461:1207,12463:1208,12465:1209,12467:1210,12469:1211,12471:1212,12473:1213,12475:1214,12477:1215,12479:1216,12481:1217,12483:1199,12484:1218,12486:1219,12488:1220,12490:1221,12491:1222,12492:1223,12493:1224,12494:1225,12495:1226,12498:1227,12501:1228,12504:1229,12507:1230,12510:1231,12511:1232,12512:1233,12513:1234,12514:1235,12515:1196,12516:1236,12517:1197,12518:1237,12519:1198,12520:1238,12521:1239,12522:1240,12523:1241,12524:1242,12525:1243,12527:1244,12530:1190,12531:1245,12539:1189,12540:1200},R={lookup:function(L){if(L>=32&&L<=255)return L;var M=G[L];return M!==void 0?M:16777216|L}};re.default=R},"8CQX":function(it,re,Q){"use strict";function G(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(r){return typeof r}:G=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},G(a)}Object.defineProperty(re,"__esModule",{value:!0}),re.getKeycode=o,re.getKey=h,re.getKeysym=n;var R=c(Q("mHUz")),I=c(Q("8+yF")),L=c(Q("6Qwc")),M=c(Q("gIYZ")),p=c(Q("mTgk")),E=i(Q("GdRQ"));function b(){if(typeof WeakMap!="function")return null;var a=new WeakMap;return b=function(){return a},a}function i(a){if(a&&a.__esModule)return a;if(a===null||G(a)!=="object"&&typeof a!="function")return{default:a};var t=b();if(t&&t.has(a))return t.get(a);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in a)if(Object.prototype.hasOwnProperty.call(a,u)){var f=s?Object.getOwnPropertyDescriptor(a,u):null;f&&(f.get||f.set)?Object.defineProperty(r,u,f):r[u]=a[u]}return r.default=a,t&&t.set(a,r),r}function c(a){return a&&a.__esModule?a:{default:a}}function o(a){if(a.code){switch(a.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return a.code}if(a.type!=="keypress"&&a.keyCode in L.default){var t=L.default[a.keyCode];if(E.isMac()&&t==="ContextMenu"&&(t="MetaRight"),a.location===2)switch(t){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(a.location===3)switch(t){case"Delete":return"NumpadDecimal";case"Insert":return"Numpad0";case"End":return"Numpad1";case"ArrowDown":return"Numpad2";case"PageDown":return"Numpad3";case"ArrowLeft":return"Numpad4";case"ArrowRight":return"Numpad6";case"Home":return"Numpad7";case"ArrowUp":return"Numpad8";case"PageUp":return"Numpad9";case"Enter":return"NumpadEnter"}return t}return"Unidentified"}function h(a){if(a.key!==void 0){switch(a.key){case"Spacebar":return" ";case"Esc":return"Escape";case"Scroll":return"ScrollLock";case"Win":return"Meta";case"Apps":return"ContextMenu";case"Up":return"ArrowUp";case"Left":return"ArrowLeft";case"Right":return"ArrowRight";case"Down":return"ArrowDown";case"Del":return"Delete";case"Divide":return"/";case"Multiply":return"*";case"Subtract":return"-";case"Add":return"+";case"Decimal":return a.char}switch(a.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(a.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}if(a.key==="\0"&&a.code==="NumpadDecimal")return"Delete";if(!E.isIE()&&!E.isEdge())return a.key;if(a.key.length!==1&&a.key!=="Unidentified")return a.key}var t=o(a);return t in M.default?M.default[t]:a.charCode?String.fromCharCode(a.charCode):"Unidentified"}function n(a){var t=h(a);if(t==="Unidentified")return null;if(t in p.default){var r=a.location;if(t==="Meta"&&r===0&&(r=2),t==="Clear"&&r===3){var s=o(a);s==="NumLock"&&(r=0)}if((r===void 0||r>3)&&(r=0),t==="Meta"){var u=o(a);if(u==="AltLeft")return R.default.XK_Meta_L;if(u==="AltRight")return R.default.XK_Meta_R}if(t==="Clear"){var f=o(a);if(f==="NumLock")return R.default.XK_Num_Lock}return p.default[t][r]}if(t.length!==1)return null;var d=t.charCodeAt();return d?I.default.lookup(d):null}},"8EBN":function(it,re,Q){(function(G){G(Q("VrN/"))})(function(G){"use strict";G.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var R=0;R-1&&L.substring(E+1,L.length);if(b)return G.findModeByExtension(b)},G.findModeByName=function(L){L=L.toLowerCase();for(var M=0;M>d&1&&(this._zlibs[d].reset(),R.Info("Reset zlib stream "+d));this._ctl=this._ctl>>4}var v;if(this._ctl===8)v=this._fillRect(n,a,t,r,s,u,f);else if(this._ctl===9)v=this._jpegRect(n,a,t,r,s,u,f);else if(this._ctl===10)v=this._pngRect(n,a,t,r,s,u,f);else if((this._ctl&128)==0)v=this._basicRect(this._ctl,n,a,t,r,s,u,f);else throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");return v&&(this._ctl=null),v}},{key:"_fillRect",value:function(n,a,t,r,s,u,f){if(s.rQwait("TIGHT",3))return!1;var d=s.rQi,v=s.rQ;return u.fillRect(n,a,t,r,[v[d+2],v[d+1],v[d]],!1),s.rQskipBytes(3),!0}},{key:"_jpegRect",value:function(n,a,t,r,s,u,f){var d=this._readData(s);return d===null?!1:(u.imageRect(n,a,t,r,"image/jpeg",d),!0)}},{key:"_pngRect",value:function(n,a,t,r,s,u,f){throw new Error("PNG received in standard Tight rect")}},{key:"_basicRect",value:function(n,a,t,r,s,u,f,d){if(this._filter===null)if(n&4){if(u.rQwait("TIGHT",1))return!1;this._filter=u.rQshift8()}else this._filter=0;var v=n&3,m;switch(this._filter){case 0:m=this._copyFilter(v,a,t,r,s,u,f,d);break;case 1:m=this._paletteFilter(v,a,t,r,s,u,f,d);break;case 2:m=this._gradientFilter(v,a,t,r,s,u,f,d);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return m&&(this._filter=null),m}},{key:"_copyFilter",value:function(n,a,t,r,s,u,f,d){var v=r*s*3,m;if(v<12){if(u.rQwait("TIGHT",v))return!1;m=u.rQshiftBytes(v)}else{if(m=this._readData(u),m===null)return!1;this._zlibs[n].setInput(m),m=this._zlibs[n].inflate(v),this._zlibs[n].setInput(null)}return f.blitRgbImage(a,t,r,s,m,0,!1),!0}},{key:"_paletteFilter",value:function(n,a,t,r,s,u,f,d){if(this._numColors===0){if(u.rQwait("TIGHT palette",1))return!1;var v=u.rQpeek8()+1,m=v*3;if(u.rQwait("TIGHT palette",1+m))return!1;this._numColors=v,u.rQskipBytes(1),u.rQshiftTo(this._palette,m)}var S=this._numColors<=2?1:8,C=Math.floor((r*S+7)/8),_=C*s,y;if(_<12){if(u.rQwait("TIGHT",_))return!1;y=u.rQshiftBytes(_)}else{if(y=this._readData(u),y===null)return!1;this._zlibs[n].setInput(y),y=this._zlibs[n].inflate(_),this._zlibs[n].setInput(null)}return this._numColors==2?this._monoRect(a,t,r,s,y,this._palette,f):this._paletteRect(a,t,r,s,y,this._palette,f),this._numColors=0,!0}},{key:"_monoRect",value:function(n,a,t,r,s,u,f){for(var d=this._getScratchBuffer(t*r*4),v=Math.floor((t+7)/8),m=Math.floor(t/8),S=0;S=0;T--)C=(S*t+y*8+7-T)*4,_=(s[S*v+y]>>T&1)*3,d[C]=u[_],d[C+1]=u[_+1],d[C+2]=u[_+2],d[C+3]=255;for(var k=7;k>=8-t%8;k--)C=(S*t+y*8+7-k)*4,_=(s[S*v+y]>>k&1)*3,d[C]=u[_],d[C+1]=u[_+1],d[C+2]=u[_+2],d[C+3]=255}f.blitRgbxImage(n,a,t,r,d,0,!1)}},{key:"_paletteRect",value:function(n,a,t,r,s,u,f){for(var d=this._getScratchBuffer(t*r*4),v=t*r*4,m=0,S=0;m=Y.length?le.slice(Y.length):le}).join(`
`)}var s=[],u=[""],f=new a.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){s.length=0,u=[""]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(J,B,H,Y){if(B>=J.length||J[B].level<=H)return B;var le=J[B];Y.push("- "+le.text+""),B++;var $=[];return B=S(J,B,le.level,$),$.length>0&&(Y.push("
"),$.forEach(function(Be){Y.push(Be)}),Y.push("
")),Y.push(" "),B=S(J,B,H,Y),B}function C(){return S(s,0,0,u),u.push("
"),u.join("")}var _={heading:function(B){var H=d.exec(B);if(H)return{type:"heading",raw:H[0],depth:H[1].length,text:H[2]}},fences:function(B){var H=this.rules.block.fences.exec(B);if(H){var Y=H[0],le=r(Y,H[3]||""),$=H[2]?H[2].trim():H[2];if(["latex","katex","math"].indexOf($)>=0){var Be=k(),at=le;le=Be,g[Be]={type:"block",expression:at}}return{type:"code",raw:Y,lang:$,text:le}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,k=function(){return"__special_katext_id_".concat(T++,"__")},g={};function F(){return g}function P(){T=0,g={}}function N(J){return J=J.replace(y,function(B,H){var Y=k();return g[Y]={type:"inline",expression:H},Y}),J}var W=f.listitem;f.listitem=function(J){return W(N(J))};var j=f.paragraph;f.paragraph=function(J){return j(N(J))};var A=f.tablecell;f.tablecell=function(J,B){return A(N(J),B)},f.code=function(J,B,H){var Y=(B||"").match(/\S*/)[0];return Y?["latex","katex","math"].indexOf(Y)>=0?"".concat(J,"
"):'
').concat(H?J:Object(t.escape)(J,!0),`
`):''+(H?J:Object(t.escape)(J,!0))+"
"},f.heading=function(J,B,H){var Y=this.options.headerPrefix+H.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:Y,level:B,text:J}),"'+J+""},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:_,renderer:f});var K=a.a,U=Q("SJMd"),O=Q("ulZh"),z=Q.n(O),te=Q("m3rI"),he=Q("Oy/b"),be=Q("p5ED"),ze=Q("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Pe=function(J,B){return(Pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Y){H.__proto__=Y}||function(H,Y){for(var le in Y)Object.prototype.hasOwnProperty.call(Y,le)&&(H[le]=Y[le])})(J,B)};function Oe(J,B){function H(){this.constructor=J}Pe(J,B),J.prototype=B===null?Object.create(B):(H.prototype=B.prototype,new H)}function Ke(J,B,H,Y){return new(H||(H=Promise))(function(le,$){function Be(St){try{pt(Y.next(St))}catch(st){$(st)}}function at(St){try{pt(Y.throw(St))}catch(st){$(st)}}function pt(St){var st;St.done?le(St.value):(st=St.value,st instanceof H?st:new H(function(Rt){Rt(st)})).then(Be,at)}pt((Y=Y.apply(J,B||[])).next())})}function je(J,B){var H,Y,le,$,Be={label:0,sent:function(){if(1&le[0])throw le[1];return le[1]},trys:[],ops:[]};return $={next:at(0),throw:at(1),return:at(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function at(pt){return function(St){return function(st){if(H)throw new TypeError("Generator is already executing.");for(;Be;)try{if(H=1,Y&&(le=2&st[0]?Y.return:st[0]?Y.throw||((le=Y.return)&&le.call(Y),0):Y.next)&&!(le=le.call(Y,st[1])).done)return le;switch(Y=0,le&&(st=[2&st[0],le.value]),st[0]){case 0:case 1:le=st;break;case 4:return Be.label++,{value:st[1],done:!1};case 5:Be.label++,Y=st[1],st=[0];continue;case 7:st=Be.ops.pop(),Be.trys.pop();continue;default:if(!(le=Be.trys,(le=le.length>0&&le[le.length-1])||st[0]!==6&&st[0]!==2)){Be=0;continue}if(st[0]===3&&(!le||st[1]>le[0]&&st[1]',"select"),this.addActionButton(Y,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(Y,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(Y,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(Y,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(Y,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(Y,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(Y,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function($){var Be=document.createElement("div");Be.className=""+H.toolbarButtonStyleClass.name,Be.setAttribute("data-type-name",$.typeName),Be.innerHTML=$.icon,Be.addEventListener("click",function(){H.markerToolbarButtonClicked(Be,$)}),H.buttons.push(Be),H.markerButtons.push(Be)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var le=document.createElement("div");le.className=this.toolbarBlockStyleClass.name,le.style.whiteSpace="nowrap",le.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(le),this.addActionButton(le,'',"render"),this.addActionButton(le,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},J.prototype.addButtonClickListener=function(B){this.buttonClickListeners.push(B)},J.prototype.removeButtonClickListener=function(B){this.buttonClickListeners.indexOf(B)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(B),1)},J.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},J.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var B=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var H=0;H0&&this.buttonClickListeners.forEach(function(Y){return Y("marker",H)}),this.markerButtonOverflowBlock.style.display="none"},J.prototype.actionToolbarButtonClicked=function(B,H){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Y){return Y("action",H)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},J.prototype.setActiveButton=function(B){this.resetButtonStyles(),B.className=B.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),B.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},J.prototype.setActiveMarkerButton=function(B){var H=this.markerButtons.find(function(Y){return Y.getAttribute("data-type-name")===B});H&&this.setActiveButton(H)},J.prototype.setCurrentMarker=function(B){var H=this;this.currentMarker=B,this.buttons.filter(function(Y){return/delete|notes/.test(Y.getAttribute("data-action"))}).forEach(function(Y){H.currentMarker===void 0?(Y.style.fillOpacity="0.4",Y.style.pointerEvents="none"):(Y.style.fillOpacity="1",Y.style.pointerEvents="all")})},J}(),et=function(){function J(B,H,Y,le){this.panels=[],this.panelButtons=[],this.markerjsContainer=B,this.displayMode=H,this.uiStyleSettings=Y,this.styles=le,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return J.prototype.addStyles=function(){var B;this.toolboxStyleClass=this.styles.addClass(new We("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new We("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var H=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new We("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new We("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new We("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new We("toolbox-panel-row_colors",`
background-color: `+((B=this.uiStyleSettings.toolboxBackgroundColor)!==null&&B!==void 0?B:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new We("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*H)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*H)+`px;
padding: `+H+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new We("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new We("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ze("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ze("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},J.prototype.show=function(B){var H;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=B,this.uiContainer.className=this.toolboxStyleClass.name+" "+((H=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},J.prototype.setPanelButtons=function(B){var H,Y,le=this;this.panels=B,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((H=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&H!==void 0?H:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Y=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Y!==void 0?Y:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function($){var Be;$.uiStyleSettings=le.uiStyleSettings;var at=document.createElement("div");at.className=le.toolboxButtonStyleClass.name+" "+((Be=le.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Be!==void 0?Be:le.toolboxButtonStyleColorsClass.name),at.innerHTML=$.icon,at.title=$.title,at.addEventListener("click",function(){le.panelButtonClick($)}),le.panelButtons.push(at),le.buttonRow.appendChild(at)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},J.prototype.panelButtonClick=function(B){var H=this,Y=-1;if(B!==this.activePanel){Y=this.panels.indexOf(B),this.panelRow.innerHTML="";var le=B.getUi();le.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(le),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=B}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){H.displayMode==="inline"?H.panelRow.style.display="none":H.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function($,Be){var at,pt;$.className=H.toolboxButtonStyleClass.name+" "+(Be===Y?""+((at=H.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&at!==void 0?at:H.toolboxActiveButtonStyleColorsClass.name):""+((pt=H.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&pt!==void 0?pt:H.toolboxButtonStyleColorsClass.name))})},J}(),pe=function(J,B){this.title=J,this.icon=B},ve=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'')||this;return Be.colors=[],Be.addTransparent=!1,Be.colorBoxes=[],Be.colors=Y,Be.currentColor=le,Be.setCurrentColor=Be.setCurrentColor.bind(Be),Be.getColorBox=Be.getColorBox.bind(Be),Be}return Oe(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.whiteSpace="nowrap",this.colors.forEach(function(le){var $=H.getColorBox(le);Y.appendChild($),H.colorBoxes.push($)}),Y},B.prototype.getColorBox=function(H){var Y=this,le=this.uiStyleSettings.toolbarHeight/4,$=this.uiStyleSettings.toolbarHeight-le,Be=document.createElement("div");Be.style.display="inline-block",Be.style.boxSizing="content-box",Be.style.width=$-2+"px",Be.style.height=$-2+"px",Be.style.padding="1px",Be.style.marginRight="2px",Be.style.marginBottom="2px",Be.style.borderWidth="2px",Be.style.borderStyle="solid",Be.style.borderRadius=($+2)/2+"px",Be.style.borderColor=H===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Be.addEventListener("click",function(){Y.setCurrentColor(H,Be)});var at=document.createElement("div");return at.style.display="inline-block",at.style.width=$-2+"px",at.style.height=$-2+"px",at.style.backgroundColor=H,at.style.borderRadius=$/2+"px",H==="transparent"&&(at.style.fill=this.uiStyleSettings.toolboxAccentColor,at.innerHTML=``),Be.appendChild(at),Be},B.prototype.setCurrentColor=function(H,Y){var le=this;this.currentColor=H,this.colorBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(H)},B}(pe),xe=function(){function J(B,H,Y){this._state="new",this._isSelected=!1,this._container=B,this._overlayContainer=H,this.globalSettings=Y,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(J.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),J.prototype.ownsTarget=function(B){return!1},Object.defineProperty(J.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),J.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},J.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},J.prototype.pointerDown=function(B,H){},J.prototype.dblClick=function(B,H){},J.prototype.manipulate=function(B){},J.prototype.pointerUp=function(B){this.stateChanged()},J.prototype.dispose=function(){},J.prototype.addMarkerVisualToContainer=function(B){this.container.childNodes.length>0?this.container.insertBefore(B,this.container.childNodes[0]):this.container.appendChild(B)},J.prototype.getState=function(){return{typeName:J.typeName,state:this.state,notes:this.notes}},J.prototype.restoreState=function(B){this._state=B.state,this.notes=B.notes},J.prototype.scale=function(B,H){},J.prototype.colorChanged=function(B){this.onColorChanged&&this.onColorChanged(B),this.stateChanged()},J.prototype.fillColorChanged=function(B){this.onFillColorChanged&&this.onFillColorChanged(B),this.stateChanged()},J.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var B=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),B.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(B)&&this.onStateChanged(this)}},J.typeName="MarkerBase",J}(),Se=function(){function J(){this.findGripByVisual=this.findGripByVisual.bind(this)}return J.prototype.findGripByVisual=function(B){return this.topLeft.ownsTarget(B)?this.topLeft:this.topCenter.ownsTarget(B)?this.topCenter:this.topRight.ownsTarget(B)?this.topRight:this.centerLeft.ownsTarget(B)?this.centerLeft:this.centerRight.ownsTarget(B)?this.centerRight:this.bottomLeft.ownsTarget(B)?this.bottomLeft:this.bottomCenter.ownsTarget(B)?this.bottomCenter:this.bottomRight.ownsTarget(B)?this.bottomRight:void 0},J}(),Le=function(){function J(){this.GRIP_SIZE=10,this.visual=we.createGroup(),this.visual.appendChild(we.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(we.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(B){return B===this.visual||B===this.visual.childNodes[0]||B===this.visual.childNodes[1]},J}(),ne=function(){function J(){}return J.toITransformMatrix=function(B){return{a:B.a,b:B.b,c:B.c,d:B.d,e:B.e,f:B.f}},J.toSVGMatrix=function(B,H){return B.a=H.a,B.b=H.b,B.c=H.c,B.d=H.d,B.e=H.e,B.f=H.f,B},J}(),ye=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.left=0,$.top=0,$.width=0,$.height=0,$.defaultSize={x:50,y:20},$.offsetX=0,$.offsetY=0,$.rotationAngle=0,$.CB_DISTANCE=10,$._suppressMarkerCreateEvent=!1,$.container.transform.baseVal.appendItem(we.createTransform()),$.setupControlBox(),$}return Oe(B,J),Object.defineProperty(B.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"visual",{get:function(){return this._visual},set:function(H){this._visual=H;var Y=we.createTransform();this._visual.transform.baseVal.appendItem(Y)},enumerable:!1,configurable:!0}),B.prototype.ownsTarget=function(H){return!!J.prototype.ownsTarget.call(this,H)||!!(this.controlGrips.findGripByVisual(H)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(H))},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.left=H.x,this.top=H.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var le=this.unrotatePoint(H);if(this.manipulationStartX=le.x,this.manipulationStartY=le.y,this.offsetX=le.x-this.left,this.offsetY=le.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Y),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Y)){this.activeGrip=this.rotatorGrip;var $=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=$.x-this.width/2,this.top=$.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Be=this.container.transform.baseVal.getItem(0);Be.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Be,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},B.prototype.pointerUp=function(H){var Y=this.state;J.prototype.pointerUp.call(this,H),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(H),this._state="select",Y==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},B.prototype.moveVisual=function(H){this.visual.style.transform="translate("+H.x+"px, "+H.y+"px)"},B.prototype.manipulate=function(H){var Y=this.unrotatePoint(H);this.state==="creating"?this.resize(H):this.state==="move"?(this.left=this.manipulationStartLeft+(Y.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Y.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Y):this.state==="rotate"&&this.rotate(H)},B.prototype.resize=function(H){var Y=this.manipulationStartLeft,le=this.manipulationStartWidth,$=this.manipulationStartTop,Be=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Y=this.manipulationStartLeft+H.x-this.manipulationStartX,le=this.manipulationStartWidth+this.manipulationStartLeft-Y;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:le=this.manipulationStartWidth+H.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:$=this.manipulationStartTop+H.y-this.manipulationStartY,Be=this.manipulationStartHeight+this.manipulationStartTop-$;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Be=this.manipulationStartHeight+H.y-this.manipulationStartY}le>=0?(this.left=Y,this.width=le):(this.left=Y+le,this.width=-le),Be>=0?(this.top=$,this.height=Be):(this.top=$+Be,this.height=-Be),this.setSize()},B.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},B.prototype.rotate=function(H){if(Math.abs(H.x-this.centerX)>.1){var Y=Math.sign(H.x-this.centerX);this.rotationAngle=180*Math.atan((H.y-this.centerY)/(H.x-this.centerX))/Math.PI+90*Y,this.applyRotation()}},B.prototype.applyRotation=function(){var H=this.container.transform.baseVal.getItem(0);H.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(H,0)},B.prototype.rotatePoint=function(H){if(this.rotationAngle===0)return H;var Y=this.container.getCTM(),le=we.createPoint(H.x,H.y);return{x:(le=le.matrixTransform(Y)).x,y:le.y}},B.prototype.unrotatePoint=function(H){if(this.rotationAngle===0)return H;var Y=this.container.getCTM();Y=Y.inverse();var le=we.createPoint(H.x,H.y);return{x:(le=le.matrixTransform(Y)).x,y:le.y}},B.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},B.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},B.prototype.setupControlBox=function(){this.controlBox=we.createGroup();var H=we.createTransform();H.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(H),this.container.appendChild(this.controlBox),this.controlRect=we.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=we.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Se,this.addControlGrips(),this.controlBox.style.display="none"},B.prototype.adjustControlBox=function(){var H=this.controlBox.transform.baseVal.getItem(0);H.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(H,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},B.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},B.prototype.createGrip=function(){var H=new Le;return H.visual.transform.baseVal.appendItem(we.createTransform()),this.controlBox.appendChild(H.visual),H},B.prototype.positionGrips=function(){var H=this.controlGrips.topLeft.GRIP_SIZE,Y=-H/2,le=Y,$=(this.width+this.CB_DISTANCE)/2-H/2,Be=(this.height+this.CB_DISTANCE)/2-H/2,at=this.height+this.CB_DISTANCE-H/2,pt=this.width+this.CB_DISTANCE-H/2;this.positionGrip(this.controlGrips.topLeft.visual,Y,le),this.positionGrip(this.controlGrips.topCenter.visual,$,le),this.positionGrip(this.controlGrips.topRight.visual,pt,le),this.positionGrip(this.controlGrips.centerLeft.visual,Y,Be),this.positionGrip(this.controlGrips.centerRight.visual,pt,Be),this.positionGrip(this.controlGrips.bottomLeft.visual,Y,at),this.positionGrip(this.controlGrips.bottomCenter.visual,$,at),this.positionGrip(this.controlGrips.bottomRight.visual,pt,at),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,$,le-3*this.CB_DISTANCE)},B.prototype.positionGrip=function(H,Y,le){var $=H.transform.baseVal.getItem(0);$.setTranslate(Y,le),H.transform.baseVal.replaceItem($,0)},B.prototype.hideControlBox=function(){this.controlBox.style.display="none"},B.prototype.showControlBox=function(){this.controlBox.style.display=""},B.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ne.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ne.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},J.prototype.getState.call(this))},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.left=Y.left,this.top=Y.top,this.width=Y.width,this.height=Y.height,this.rotationAngle=Y.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ne.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Y.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ne.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Y.containerTransformMatrix))},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y);var le=this.rotatePoint({x:this.left,y:this.top}),$=this.unrotatePoint({x:le.x*H,y:le.y*Y});this.left=$.x,this.top=$.y,this.width=this.width*H,this.height=this.height*Y,this.adjustControlBox()},B}(xe),se=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.createVisual=$.createVisual.bind($),$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual)},B.prototype.createVisual=function(){this.visual=we.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},B.prototype.manipulate=function(H){J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),this.setSize()},B.prototype.setSize=function(){J.prototype.setSize.call(this),we.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},B.prototype.pointerUp=function(H){J.prototype.pointerUp.call(this,H),this.setSize()},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.visual&&we.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(H),this.stateChanged()},B.prototype.setFillColor=function(H){this.fillColor=H,this.visual&&we.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.visual&&we.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.visual&&we.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},B.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this))},B.prototype.restoreState=function(H){var Y=H;this.fillColor=Y.fillColor,this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.opacity=Y.opacity,this.createVisual(),J.prototype.restoreState.call(this,H),this.setSize()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setSize()},B.title="Rectangle marker",B}(ye),Ne=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'')||this;return Be.widths=[],Be.widthBoxes=[],Be.widths=Y,Be.currentWidth=le,Be.setCurrentWidth=Be.setCurrentWidth.bind(Be),Be}return Oe(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",this.widths.forEach(function(le){var $=document.createElement("div");$.style.display="flex",$.style.flexGrow="2",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=le===H.currentWidth?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentWidth(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.innerText=le.toString(),Be.style.marginRight="5px",$.appendChild(Be);var at=document.createElement("div");at.style.minHeight="20px",at.style.flexGrow="2",at.style.display="flex",at.style.alignItems="center";var pt=document.createElement("hr");pt.style.minWidth="20px",pt.style.border="0px",pt.style.borderTop=le+"px solid "+H.uiStyleSettings.toolboxColor,pt.style.flexGrow="2",at.appendChild(pt),$.appendChild(at),H.widthBoxes.push($)}),Y},B.prototype.setCurrentWidth=function(H,Y){var le=this;this.currentWidth=H,this.widthBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},B}(pe),Qe=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'')||this;return Be.styles=[],Be.styleBoxes=[],Be.styles=Y,Be.currentStyle=le,Be.setCurrentStyle=Be.setCurrentStyle.bind(Be),Be}return Oe(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",this.styles.forEach(function(le){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/H.styles.length-5+"%",$.style.borderColor=le===H.currentStyle?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentStyle(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.style.minHeight="20px",Be.style.flexGrow="2",Be.style.overflow="hidden";var at=``;Be.innerHTML=at,$.appendChild(Be),H.styleBoxes.push($)}),Y},B.prototype.setCurrentStyle=function(H,Y){var le=this;this.currentStyle=H,this.styleBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},B}(pe),Je=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.strokePanel=new ve("Line color",le.defaultColorSet,le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new Ne("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Qe("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Oe(B,J),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="FrameMarker",B.title="Frame marker",B.icon='',B}(se),Ge=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},ht=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.x1=0,$.y1=0,$.x2=0,$.y2=0,$.defaultLength=50,$.manipulationStartX=0,$.manipulationStartY=0,$.manipulationStartX1=0,$.manipulationStartY1=0,$.manipulationStartX2=0,$.manipulationStartY2=0,$.setupControlBox(),$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!!J.prototype.ownsTarget.call(this,H)||!(!this.grip1.ownsTarget(H)&&!this.grip2.ownsTarget(H))},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.manipulationStartX=H.x,this.manipulationStartY=H.y,this.state==="new"&&(this.x1=H.x,this.y1=H.y,this.x2=H.x,this.y2=H.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(Y)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Y)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},B.prototype.pointerUp=function(H){var Y=this.state;J.prototype.pointerUp.call(this,H),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(H),this._state="select",Y==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},B.prototype.adjustVisual=function(){},B.prototype.manipulate=function(H){this.state==="creating"?this.resize(H):this.state==="move"?(this.x1=this.manipulationStartX1+H.x-this.manipulationStartX,this.y1=this.manipulationStartY1+H.y-this.manipulationStartY,this.x2=this.manipulationStartX2+H.x-this.manipulationStartX,this.y2=this.manipulationStartY2+H.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(H)},B.prototype.resize=function(H){switch(this.activeGrip){case this.grip1:this.x1=H.x,this.y1=H.y;break;case this.grip2:case void 0:this.x2=H.x,this.y2=H.y}this.adjustVisual(),this.adjustControlBox()},B.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},B.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},B.prototype.setupControlBox=function(){this.controlBox=we.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},B.prototype.adjustControlBox=function(){this.positionGrips()},B.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},B.prototype.createGrip=function(){var H=new Le;return H.visual.transform.baseVal.appendItem(we.createTransform()),this.controlBox.appendChild(H.visual),H},B.prototype.positionGrips=function(){var H=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-H/2,this.y1-H/2),this.positionGrip(this.grip2.visual,this.x2-H/2,this.y2-H/2)},B.prototype.positionGrip=function(H,Y,le){var $=H.transform.baseVal.getItem(0);$.setTranslate(Y,le),H.transform.baseVal.replaceItem($,0)},B.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},J.prototype.getState.call(this))},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.x1=Y.x1,this.y1=Y.y1,this.x2=Y.x2,this.y2=Y.y2},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.x1=this.x1*H,this.y1=this.y1*Y,this.x2=this.x2*H,this.y2=this.y2*Y,this.adjustVisual(),this.adjustControlBox()},B}(xe),de=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.strokePanel=new ve("Line color",le.defaultColorSet,le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new Ne("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Qe("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorLine&&H!==this.visibleLine)},B.prototype.createVisual=function(){this.visual=we.createGroup(),this.selectorLine=we.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=we.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},B.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),we.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),we.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),we.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.createVisual(),this.adjustVisual()},B.typeName="LineMarker",B.title="Line marker",B.icon='',B}(ht),Me=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'')||this;return Be.fonts=[],Be.fontBoxes=[],Be.fonts=Y,Be.currentFont=le,Be.setCurrentFont=Be.setCurrentFont.bind(Be),Be}return Oe(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.overflow="hidden",Y.style.flexGrow="2",this.fonts.forEach(function(le){var $=document.createElement("div");$.style.display="inline-block",$.style.alignItems="center",$.style.justifyContent="space-between",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.overflow="hidden",$.style.maxWidth=100/H.fonts.length-5+"%",$.style.borderColor=le===H.currentFont?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentFont(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.style.display="flex",Be.style.minHeight="20px",Be.style.flexGrow="2",Be.style.fontFamily=le,Be.style.overflow="hidden";var at=document.createElement("div");at.style.whiteSpace="nowrap",at.style.overflow="hidden",at.style.textOverflow="ellipsis",at.innerHTML="The quick brown fox jumps over the lazy dog",Be.appendChild(at),$.appendChild(Be),H.fontBoxes.push($)}),Y},B.prototype.setCurrentFont=function(H,Y){var le=this;this.currentFont=H,this.fontBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},B}(pe),Fe=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.color="transparent",$.padding=5,$.DEFAULT_TEXT="your text here",$.text=$.DEFAULT_TEXT,$.isMoved=!1,$.color=le.defaultColor,$.fontFamily=le.defaultFontFamily,$.defaultSize={x:100,y:30},$.setColor=$.setColor.bind($),$.setFont=$.setFont.bind($),$.renderText=$.renderText.bind($),$.sizeText=$.sizeText.bind($),$.textEditDivClicked=$.textEditDivClicked.bind($),$.showTextEditor=$.showTextEditor.bind($),$.setSize=$.setSize.bind($),$.positionTextEditor=$.positionTextEditor.bind($),$.colorPanel=new ve("Color",le.defaultColorSet,le.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.fontFamilyPanel=new Me("Font",le.defaultFontFamilies,le.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$}return Oe(B,J),B.prototype.ownsTarget=function(H){if(J.prototype.ownsTarget.call(this,H)||H===this.visual||H===this.textElement||H===this.bgRectangle)return!0;var Y=!1;return this.textElement.childNodes.forEach(function(le){le===H&&(Y=!0)}),Y},B.prototype.createVisual=function(){this.visual=we.createGroup(),this.bgRectangle=we.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=we.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(we.createTransform()),this.textElement.transform.baseVal.appendItem(we.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.isMoved=!1,this.pointerDownPoint=H,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},B.prototype.renderText=function(){var H=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(Y){H.textElement.appendChild(we.createTSpan(Y.trim()===""?" ":Y.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},B.prototype.getTextScale=function(){var H=this.textElement.getBBox(),Y=1;if(H.width>0&&H.height>0){var le=(1*this.width-this.width*this.padding*2/100)/H.width,$=(1*this.height-this.height*this.padding*2/100)/H.height;Y=Math.min(le,$)}return Y},B.prototype.getTextPosition=function(H){var Y=this.textElement.getBBox(),le=0,$=0;return Y.width>0&&Y.height>0&&(le=(this.width-Y.width*H)/2,$=this.height/2-Y.height*H/2),{x:le,y:$}},B.prototype.sizeText=function(){var H=this.textElement.getBBox(),Y=this.getTextScale(),le=this.getTextPosition(Y);le.y-=H.y*Y,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+le.x+"px, "+le.y+"px) scale("+Y+", "+Y+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(le.x,le.y),this.textElement.transform.baseVal.getItem(1).setScale(Y,Y))},B.prototype.manipulate=function(H){J.prototype.manipulate.call(this,H),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(H.x-this.pointerDownPoint.x)>5||Math.abs(H.y-this.pointerDownPoint.y)>5)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),this.isMoved=!0,this.setSize(),this.sizeText()},B.prototype.setSize=function(){J.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(we.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),we.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},B.prototype.pointerUp=function(H){var Y=this.state;Y==="creating"&&(this._suppressMarkerCreateEvent=!0),J.prototype.pointerUp.call(this,H),this.setSize(),(Y==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},B.prototype.showTextEditor=function(){var H=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(Y){Y.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Y=Number.parseFloat(H.textEditor.style.fontSize);H.textEditor.clientWidth>=Number.parseInt(H.textEditor.style.maxWidth)&&Y>.9;)Y-=.1,H.textEditor.style.fontSize=Math.max(Y,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Y){Y.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Y){if(Y.clipboardData){var le=Y.clipboardData.getData("text"),$=window.getSelection();if(!$.rangeCount)return!1;$.deleteFromDocument(),$.getRangeAt(0).insertNode(document.createTextNode(le)),Y.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){H.textEditDivClicked(H.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},B.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var H=this.getTextScale(),Y=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),le=this.textElement.getBBox(),$={x:le.width*H,y:le.height*H};Y.x-=$.x/2,Y.y-=$.y/2,this.textEditor.style.top=Y.y+"px",this.textEditor.style.left=Y.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Y.x+"px",this.textEditor.style.fontSize=Math.max(16*H,12)+"px",this.textElement.style.display="none"}},B.prototype.textEditDivClicked=function(H){this.text=H.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},B.prototype.select=function(){J.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},B.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),J.prototype.deselect.call(this)},B.prototype.dblClick=function(H,Y){J.prototype.dblClick.call(this,H,Y),this.showTextEditor()},B.prototype.setColor=function(H){this.textElement&&we.setAttributes(this.textElement,[["fill",H]]),this.color=H,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(H)},B.prototype.setFont=function(H){this.textElement&&we.setAttributes(this.textElement,[["font-family",H]]),this.fontFamily=H,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},B.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},B.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){var Y=H;this.color=Y.color,this.fontFamily=Y.fontFamily,this.padding=Y.padding,this.text=Y.text,this.createVisual(),J.prototype.restoreState.call(this,H),this.setSize()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setSize(),this.sizeText(),this.positionTextEditor()},B.typeName="TextMarker",B.title="Text marker",B.icon='',B}(ye),Re=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.color="transparent",$.lineWidth=3,$.drawing=!1,$.pixelRatio=1,$.color=le.defaultColor,$.lineWidth=le.defaultStrokeWidth,$.pixelRatio=le.freehandPixelRatio,$.setColor=$.setColor.bind($),$.addCanvas=$.addCanvas.bind($),$.finishCreation=$.finishCreation.bind($),$.setLineWidth=$.setLineWidth.bind($),$.colorPanel=new ve("Color",le.defaultColorSet,le.defaultColor),$.colorPanel.onColorChanged=$.setColor,$.lineWidthPanel=new Ne("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.lineWidthPanel.onWidthChanged=$.setLineWidth,$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.drawingImage)},B.prototype.createVisual=function(){this.visual=we.createGroup(),this.drawingImage=we.createImage(),this.visual.appendChild(this.drawingImage);var H=we.createTransform();this.visual.transform.baseVal.appendItem(H),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(H,Y){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(H.x,H.y),this.drawing=!0):J.prototype.pointerDown.call(this,H,Y)},B.prototype.manipulate=function(H){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(H.x,H.y),this.canvasContext.stroke()):J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),we.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),we.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},B.prototype.pointerUp=function(H){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):J.prototype.pointerUp.call(this,H)},B.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},B.prototype.select=function(){this.state==="creating"&&this.finishCreation(),J.prototype.select.call(this)},B.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),J.prototype.deselect.call(this)},B.prototype.finishCreation=function(){for(var H=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Y=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],le=Y[0],$=Y[1],Be=Y[2],at=Y[3],pt=!1,St=0;St0&&(pt=!0,St<$&&($=St),stat&&(at=St),st>Be&&(Be=st));if(pt){this.left=le/this.pixelRatio,this.top=$/this.pixelRatio,this.width=(Be-le)/this.pixelRatio,this.height=(at-$)/this.pixelRatio;var Rt=document.createElement("canvas");Rt.width=Be-le,Rt.height=at-$,Rt.getContext("2d").putImageData(this.canvasContext.getImageData(le,$,Be-le,at-$),0,0),this.drawingImgUrl=Rt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},B.prototype.setDrawingImage=function(){we.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),we.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},B.prototype.setColor=function(H){this.color=H,this.colorChanged(H)},B.prototype.setLineWidth=function(H){this.lineWidth=H},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({drawingImgUrl:this.drawingImgUrl},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){this.createVisual(),J.prototype.restoreState.call(this,H),this.drawingImgUrl=H.drawingImgUrl,this.setDrawingImage()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setDrawingImage()},B.typeName="FreehandMarker",B.title="Freehand marker",B.icon='',B}(ye),_e=function(J){function B(H,Y,le){var $=J.call(this,H,le||'')||this;return $.typeBoxes=[],$.currentType=Y,$.setCurrentType=$.setCurrentType.bind($),$}return Oe(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2";for(var le=function(at){var pt="both";switch(at){case 0:pt="both";break;case 1:pt="start";break;case 2:pt="end";break;case 3:pt="none"}var St=document.createElement("div");if(St.style.display="flex",St.style.flexGrow="2",St.style.alignItems="center",St.style.justifyContent="space-between",St.style.padding="5px",St.style.borderWidth="2px",St.style.borderStyle="solid",St.style.borderColor=pt===$.currentType?$.uiStyleSettings.toolboxAccentColor:"transparent",St.addEventListener("click",function(){H.setCurrentType(pt,St)}),Y.appendChild(St),pt==="both"||pt==="start"){var st=document.createElement("div");st.style.display="flex",st.style.alignItems="center",st.style.minHeight="20px",st.innerHTML=``,st.style.marginLeft="5px",St.appendChild(st)}var Rt=document.createElement("div");Rt.style.display="flex",Rt.style.alignItems="center",Rt.style.minHeight="20px",Rt.style.flexGrow="2";var zt=document.createElement("hr");if(zt.style.minWidth="20px",zt.style.border="0px",zt.style.borderTop="3px solid "+($.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxColor:"#eeeeee"),zt.style.flexGrow="2",Rt.appendChild(zt),St.appendChild(Rt),pt==="both"||pt==="end"){var ii=document.createElement("div");ii.style.display="flex",ii.style.alignItems="center",ii.style.minHeight="20px",ii.innerHTML=``,ii.style.marginRight="5px",St.appendChild(ii)}$.typeBoxes.push(St)},$=this,Be=0;Be<4;Be++)le(Be);return Y},B.prototype.setCurrentType=function(H,Y){var le=this;this.currentType=H,this.typeBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},B}(pe),Ee=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.arrowType="end",$.arrowBaseHeight=10,$.arrowBaseWidth=10,$.getArrowPoints=$.getArrowPoints.bind($),$.setArrowType=$.setArrowType.bind($),$.arrowTypePanel=new _e("Arrow type","end"),$.arrowTypePanel.onArrowTypeChanged=$.setArrowType,$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.arrow1&&H!==this.arrow2)},B.prototype.getArrowPoints=function(H,Y){var le=this.arrowBaseWidth+2*this.strokeWidth,$=this.arrowBaseHeight+2*this.strokeWidth;return H-le/2+","+(Y+$/2)+" "+H+","+(Y-$/2)+" "+(H+le/2)+","+(Y+$/2)},B.prototype.createTips=function(){this.arrow1=we.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(we.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=we.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(we.createTransform()),this.visual.appendChild(this.arrow2)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="creating"&&this.createTips()},B.prototype.adjustVisual=function(){if(J.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",we.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),we.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var H=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Y=this.arrow1.transform.baseVal.getItem(0);Y.setRotate(H,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Y,0);var le=this.arrow2.transform.baseVal.getItem(0);le.setRotate(H+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(le,0)}},B.prototype.setArrowType=function(H){this.arrowType=H,this.adjustVisual(),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({arrowType:this.arrowType},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.arrowType=Y.arrowType,this.createTips(),this.adjustVisual()},B.typeName="ArrowMarker",B.title="Arrow marker",B.icon='',B}(de),ee=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.fillColor=le.defaultFillColor,$.strokeWidth=0,$.fillPanel=new ve("Color",le.defaultColorSet,le.defaultFillColor),$.fillPanel.onColorChanged=$.setFillColor,$}return Oe(B,J),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="CoverMarker",B.title="Cover marker",B.icon='',B}(se),oe=function(J){function B(H,Y,le,$){var Be=J.call(this,H,$||'')||this;return Be.opacities=[],Be.opacityBoxes=[],Be.opacities=Y,Be.currentOpacity=le,Be.setCurrentOpacity=Be.setCurrentOpacity.bind(Be),Be}return Oe(B,J),B.prototype.getUi=function(){var H=this,Y=document.createElement("div");return Y.style.display="flex",Y.style.overflow="hidden",Y.style.flexGrow="2",Y.style.justifyContent="space-between",this.opacities.forEach(function(le){var $=document.createElement("div");$.style.display="flex",$.style.alignItems="center",$.style.justifyContent="center",$.style.padding="5px",$.style.borderWidth="2px",$.style.borderStyle="solid",$.style.borderColor=le===H.currentOpacity?H.uiStyleSettings.toolboxAccentColor:"transparent",$.addEventListener("click",function(){H.setCurrentOpacity(le,$)}),Y.appendChild($);var Be=document.createElement("div");Be.innerText=100*le+"%",$.appendChild(Be),H.opacityBoxes.push($)}),Y},B.prototype.setCurrentOpacity=function(H,Y){var le=this;this.currentOpacity=H,this.opacityBoxes.forEach(function($){$.style.borderColor=$===Y?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},B}(pe),q=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.setOpacity=$.setOpacity.bind($),$.fillColor=le.defaultHighlightColor,$.strokeWidth=0,$.opacity=le.defaultHighlightOpacity,$.fillPanel=new ve("Color",le.defaultColorSet,$.fillColor),$.fillPanel.onColorChanged=$.setFillColor,$.opacityPanel=new oe("Opacity",le.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return Oe(B,J),B.prototype.setOpacity=function(H){this.opacity=H,this.visual&&we.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="HighlightMarker",B.title="Highlight marker",B.icon='',B}(ee),ge='',Ie=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.bgColor="transparent",$.tipPosition={x:0,y:0},$.tipBase1Position={x:0,y:0},$.tipBase2Position={x:0,y:0},$.tipMoving=!1,$.color=le.defaultStrokeColor,$.bgColor=le.defaultFillColor,$.fontFamily=le.defaultFontFamily,$.defaultSize={x:100,y:30},$.setBgColor=$.setBgColor.bind($),$.getTipPoints=$.getTipPoints.bind($),$.positionTip=$.positionTip.bind($),$.setTipPoints=$.setTipPoints.bind($),$.colorPanel=new ve("Text color",le.defaultColorSet,$.color,''),$.colorPanel.onColorChanged=$.setColor,$.bgColorPanel=new ve("Fill color",le.defaultColorSet,$.bgColor,ge),$.bgColorPanel.onColorChanged=$.setBgColor,$.fontFamilyPanel=new Me("Font",le.defaultFontFamilies,le.defaultFontFamily),$.fontFamilyPanel.onFontChanged=$.setFont,$.tipGrip=new Le,$.tipGrip.visual.transform.baseVal.appendItem(we.createTransform()),$.controlBox.appendChild($.tipGrip.visual),$}return Oe(B,J),B.prototype.ownsTarget=function(H){return J.prototype.ownsTarget.call(this,H)||this.tipGrip.ownsTarget(H)||this.tip===H},B.prototype.createTip=function(){we.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=we.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},B.prototype.pointerDown=function(H,Y){this.state==="new"&&J.prototype.pointerDown.call(this,H,Y),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Y)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):J.prototype.pointerDown.call(this,H,Y)},B.prototype.pointerUp=function(H){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,J.prototype.pointerUp.call(this,H);else{var Y=this.state==="creating";J.prototype.pointerUp.call(this,H),this.setTipPoints(Y),this.positionTip()}},B.prototype.manipulate=function(H){if(this.tipMoving){var Y=this.unrotatePoint(H);this.tipPosition={x:Y.x-this.manipulationStartLeft,y:Y.y-this.manipulationStartTop},this.positionTip()}else J.prototype.manipulate.call(this,H)},B.prototype.setBgColor=function(H){this.bgRectangle&&this.tip&&(we.setAttributes(this.bgRectangle,[["fill",H]]),we.setAttributes(this.tip,[["fill",H]])),this.bgColor=H,this.fillColorChanged(H)},B.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},B.prototype.setTipPoints=function(H){H===void 0&&(H=!1);var Y=Math.min(this.height/2,15),le=this.height/5;H&&(this.tipPosition={x:Y+le/2,y:this.height+20});var $=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?$',B}(Fe),V=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.fillColor="transparent",$.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.opacity=1,$.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.fillColor=le.defaultFillColor,$.setStrokeColor=$.setStrokeColor.bind($),$.setFillColor=$.setFillColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.setOpacity=$.setOpacity.bind($),$.createVisual=$.createVisual.bind($),$.strokePanel=new ve("Line color",Ae(le.defaultColorSet,["transparent"]),le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.fillPanel=new ve("Fill color",Ae(le.defaultColorSet,["transparent"]),$.fillColor,ge),$.fillPanel.onColorChanged=$.setFillColor,$.strokeWidthPanel=new Ne("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Qe("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$.opacityPanel=new oe("Opacity",le.defaultOpacitySteps,$.opacity),$.opacityPanel.onOpacityChanged=$.setOpacity,$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual)},B.prototype.createVisual=function(){this.visual=we.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="new"&&(this.createVisual(),this.moveVisual(H),this._state="creating")},B.prototype.manipulate=function(H){J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){J.prototype.resize.call(this,H),this.setSize()},B.prototype.setSize=function(){J.prototype.setSize.call(this),we.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},B.prototype.pointerUp=function(H){J.prototype.pointerUp.call(this,H),this.setSize()},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.visual&&we.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(H),this.stateChanged()},B.prototype.setFillColor=function(H){this.fillColor=H,this.visual&&we.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(H),this.stateChanged()},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.visual&&we.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.visual&&we.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},B.prototype.setOpacity=function(H){this.opacity=H,this.visual&&we.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){var Y=H;this.fillColor=Y.fillColor,this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.opacity=Y.opacity,this.createVisual(),J.prototype.restoreState.call(this,H),this.setSize()},B.prototype.scale=function(H,Y){J.prototype.scale.call(this,H,Y),this.setSize()},B.typeName="EllipseMarker",B.title="Ellipse marker",B.icon='',B}(ye),Ce=function(J){function B(H,Y,le){return J.call(this,H,Y,le)||this}return Oe(B,J),Object.defineProperty(B.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.tip1&&H!==this.tip2)},B.prototype.createTips=function(){this.tip1=we.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(we.createTransform()),this.visual.appendChild(this.tip1),this.tip2=we.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(we.createTransform()),this.visual.appendChild(this.tip2)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.state==="creating"&&this.createTips()},B.prototype.adjustVisual=function(){if(J.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(we.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),we.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var H=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Y=this.tip1.transform.baseVal.getItem(0);Y.setRotate(H,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Y,0);var le=this.tip2.transform.baseVal.getItem(0);le.setRotate(H+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(le,0)}},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H),this.createTips(),this.adjustVisual()},B.typeName="MeasurementMarker",B.title="Measurement marker",B.icon='',B}(de),He=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokePanel.colors=le.defaultColorSet,$.fillColor="transparent",$}return Oe(B,J),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=J.prototype.getState.call(this);return H.typeName=B.typeName,H},B.typeName="EllipseFrameMarker",B.title="Ellipse frame marker",B.icon='',B}(V),fe=function(){function J(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),J.prototype.addUndoStep=function(B){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(B)||(this.undoStack.push(B),JSON.stringify(this.lastRedoStep)!==JSON.stringify(B)&&this.redoStack.splice(0,this.redoStack.length))},J.prototype.replaceLastUndoStep=function(B){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=B)},J.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},J.prototype.undo=function(){if(this.undoStack.length>1){var B=this.undoStack.pop();return B!==void 0&&this.redoStack.push(B),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},J.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},J}(),ke=function(J){function B(H,Y,le){var $=J.call(this,H,Y,le)||this;return $.strokeColor="transparent",$.strokeWidth=0,$.strokeDasharray="",$.curveX=0,$.curveY=0,$.manipulationStartCurveX=0,$.manipulationStartCurveY=0,$.setStrokeColor=$.setStrokeColor.bind($),$.setStrokeWidth=$.setStrokeWidth.bind($),$.setStrokeDasharray=$.setStrokeDasharray.bind($),$.positionGrips=$.positionGrips.bind($),$.addControlGrips=$.addControlGrips.bind($),$.adjustVisual=$.adjustVisual.bind($),$.setupControlBox=$.setupControlBox.bind($),$.resize=$.resize.bind($),$.strokeColor=le.defaultColor,$.strokeWidth=le.defaultStrokeWidth,$.strokeDasharray=le.defaultStrokeDasharray,$.strokePanel=new ve("Line color",le.defaultColorSet,le.defaultColor),$.strokePanel.onColorChanged=$.setStrokeColor,$.strokeWidthPanel=new Ne("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),$.strokeWidthPanel.onWidthChanged=$.setStrokeWidth,$.strokeStylePanel=new Qe("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),$.strokeStylePanel.onStyleChanged=$.setStrokeDasharray,$}return Oe(B,J),B.prototype.ownsTarget=function(H){return!(!J.prototype.ownsTarget.call(this,H)&&H!==this.visual&&H!==this.selectorCurve&&H!==this.visibleCurve&&!this.curveGrip.ownsTarget(H))},B.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},B.prototype.createVisual=function(){this.visual=we.createGroup(),this.selectorCurve=we.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=we.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(H,Y){J.prototype.pointerDown.call(this,H,Y),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=H.x,this.curveY=H.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Y)&&(this.activeGrip=this.curveGrip,this._state="resize")},B.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),we.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),we.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),we.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},B.prototype.setupControlBox=function(){J.prototype.setupControlBox.call(this),this.curveControlLine1=we.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=we.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},B.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,J.prototype.addControlGrips.call(this)},B.prototype.positionGrips=function(){J.prototype.positionGrips.call(this);var H=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-H/2,this.curveY-H/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},B.prototype.manipulate=function(H){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+H.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+H.y-this.manipulationStartY),J.prototype.manipulate.call(this,H)},B.prototype.resize=function(H){this.activeGrip===this.curveGrip&&(this.curveX=H.x,this.curveY=H.y),J.prototype.resize.call(this,H),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},B.prototype.setStrokeColor=function(H){this.strokeColor=H,this.adjustVisual(),this.colorChanged(H)},B.prototype.setStrokeWidth=function(H){this.strokeWidth=H,this.adjustVisual()},B.prototype.setStrokeDasharray=function(H){this.strokeDasharray=H,this.adjustVisual()},B.prototype.scale=function(H,Y){this.curveX=this.curveX*H,this.curveY=this.curveY*Y,J.prototype.scale.call(this,H,Y)},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var H=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},J.prototype.getState.call(this));return H.typeName=B.typeName,H},B.prototype.restoreState=function(H){J.prototype.restoreState.call(this,H);var Y=H;this.strokeColor=Y.strokeColor,this.strokeWidth=Y.strokeWidth,this.strokeDasharray=Y.strokeDasharray,this.curveX=Y.curveX,this.curveY=Y.curveY,this.createVisual(),this.adjustVisual()},B.typeName="CurveMarker",B.title="Curve marker",B.icon='',B}(ht),Ve=function(){function J(B,H){H===void 0&&(H=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=B,this.cancelable=H}return Object.defineProperty(J.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),J.prototype.preventDefault=function(){this._defaultPrevented=!0},J}(),nt=function(J){function B(H,Y,le){var $=J.call(this,H,!1)||this;return $.dataUrl=Y,$.state=le,$}return Oe(B,J),B}(Ve),tt=function(J){function B(H,Y,le){le===void 0&&(le=!1);var $=J.call(this,H,le)||this;return $.marker=Y,$}return Oe(B,J),B}(Ve),ut=function(){function J(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return J.prototype.addEventListener=function(B,H){this[B].push(H)},J.prototype.removeEventListener=function(B,H){var Y=this[B].indexOf(H);Y>-1&&this[B].splice(Y,1)},J}(),ft=function(){function J(B){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ge,this._isOpen=!1,this.undoRedoManager=new fe,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new ut,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=J.instanceCounter++,this.styles=new Xe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=B,this.targetRoot=document.body,this.width=B.clientWidth,this.height=B.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(J.prototype,"ALL_MARKER_TYPES",{get:function(){return[Je,Re,Ee,Fe,He,V,q,Ie,Ce,ee,de,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Je,Re,Ee,Fe,V,q,Ie]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Je,Re,Ee,Fe,q]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(B){var H=this;this._availableMarkerTypes.splice(0),B.forEach(function(Y){if(typeof Y=="string"){var le=H.ALL_MARKER_TYPES.find(function($){return $.typeName===Y});le!==void 0&&H._availableMarkerTypes.push(le)}else H._availableMarkerTypes.push(Y)})},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(B){this._zoomLevel=B,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),J.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ce.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},J.prototype.show=function(){var B=this;this.styles.styleSheetRoot===void 0&&me.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=me.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(H){return H(new Ve(B))})},J.prototype.render=function(){return Ke(this,void 0,void 0,function(){var B;return je(this,function(H){switch(H.label){case 0:return this.setCurrentMarker(),(B=new Te).naturalSize=this.renderAtNaturalSize,B.imageType=this.renderImageType,B.imageQuality=this.renderImageQuality,B.markersOnly=this.renderMarkersOnly,B.width=this.renderWidth,B.height=this.renderHeight,[4,B.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return H.sent(),[4,B.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,H.sent()]}})})},J.prototype.close=function(B){var H=this;if(B===void 0&&(B=!1),this.isOpen){var Y=!1;B||this.eventListeners.beforeclose.forEach(function(le){var $=new Ve(H,!0);le($),$.defaultPrevented&&(Y=!0)}),Y||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(le){return le(new Ve(H))}),this.detachEvents(),this._isOpen=!1)}},J.prototype.addMarkersToToolbar=function(){for(var B,H=[],Y=0;Ythis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*B:this.editorCanvas.clientWidth,Y=H',B.title="Powered by marker.js",B.style.display="grid",B.style.alignItems="center",B.style.justifyItems="center",B.style.padding="3px",B.style.width="20px",B.style.height="20px",this.logoUI.appendChild(B),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},J.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},J.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var B=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=B+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new qe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(B),1),B.dispose()},J.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},J.prototype.toolbarButtonClicked=function(B,H){if(B==="marker"&&H!==void 0)this.createNewMarker(H);else if(B==="action")switch(H){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},J.prototype.deleteSelectedMarker=function(){var B=this;if(this._currentMarker!==void 0){var H=!1;if(this.eventListeners.markerbeforedelete.forEach(function(le){var $=new tt(B,B._currentMarker,!0);le($),$.defaultPrevented&&(H=!0)}),!H){var Y=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(le){return le(new tt(B,Y))})}}},J.prototype.clear=function(){var B=this,H=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Be){var at=new tt(B,void 0,!0);Be(at),at.defaultPrevented&&(H=!0)}),!H)){this.setCurrentMarker();for(var Y=function(Be){var at=le.markers[Be];le.setCurrentMarker(le.markers[Be]),le._currentMarker.dispose(),le.markerImage.removeChild(le._currentMarker.container),le.markers.splice(le.markers.indexOf(le._currentMarker),1),le.eventListeners.markerdelete.forEach(function(pt){return pt(new tt(B,at))})},le=this,$=this.markers.length-1;$>=0;$--)Y($);this.addUndoStep()}},Object.defineProperty(J.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),J.prototype.showNotesEditor=function(){var B;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(B=this._currentMarker.notes)!==null&&B!==void 0?B:"",this.overlayContainer.appendChild(this.notesArea))},J.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},J.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},J.prototype.addUndoStep=function(){var B=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var H=this.getState(),Y=this.undoRedoManager.getLastUndoStep();if(!Y||Y.width===H.width&&Y.height===H.height){var le=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(H),le1&&this.panTo({x:B.clientX,y:B.clientY}))},J.prototype.onPointerUp=function(B){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(B.clientX,B.clientY)),this.isDragging=!1,this.addUndoStep()},J.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},J.prototype.onKeyUp=function(B){this._currentMarker===void 0||this.notesArea!==void 0||B.key!=="Delete"&&B.key!=="Backspace"||this.deleteSelectedMarker()},J.prototype.clientToLocalCoordinates=function(B,H){var Y=this.markerImage.getBoundingClientRect();return{x:(B-Y.left)/this.zoomLevel,y:(H-Y.top)/this.zoomLevel}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var B=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=B+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},J.prototype.addLicenseKey=function(B){ce.addKey(B)},J.prototype.addEventListener=function(B,H){this.eventListeners.addEventListener(B,H)},J.prototype.removeEventListener=function(B,H){this.eventListeners.removeEventListener(B,H)},J.prototype.renderState=function(B){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(B),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(J.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),J.prototype.focus=function(){var B=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(H){return H(new Ve(B))}))},J.prototype.blur=function(){var B=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(H){return H(new Ve(B))}))},J.instanceCounter=0,J}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ft=function(J,B){return(Ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Y){H.__proto__=Y}||function(H,Y){for(var le in Y)Object.prototype.hasOwnProperty.call(Y,le)&&(H[le]=Y[le])})(J,B)};function xt(J,B){if(typeof B!="function"&&B!==null)throw new TypeError("Class extends value "+String(B)+" is not a constructor or null");function H(){this.constructor=J}Ft(J,B),J.prototype=B===null?Object.create(B):(H.prototype=B.prototype,new H)}function ct(J,B,H,Y){return new(H||(H=Promise))(function(le,$){function Be(St){try{pt(Y.next(St))}catch(st){$(st)}}function at(St){try{pt(Y.throw(St))}catch(st){$(st)}}function pt(St){var st;St.done?le(St.value):(st=St.value,st instanceof H?st:new H(function(Rt){Rt(st)})).then(Be,at)}pt((Y=Y.apply(J,B||[])).next())})}function At(J,B){var H,Y,le,$,Be={label:0,sent:function(){if(1&le[0])throw le[1];return le[1]},trys:[],ops:[]};return $={next:at(0),throw:at(1),return:at(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function at(pt){return function(St){return function(st){if(H)throw new TypeError("Generator is already executing.");for(;Be;)try{if(H=1,Y&&(le=2&st[0]?Y.return:st[0]?Y.throw||((le=Y.return)&&le.call(Y),0):Y.next)&&!(le=le.call(Y,st[1])).done)return le;switch(Y=0,le&&(st=[2&st[0],le.value]),st[0]){case 0:case 1:le=st;break;case 4:return Be.label++,{value:st[1],done:!1};case 5:Be.label++,Y=st[1],st=[0];continue;case 7:st=Be.ops.pop(),Be.trys.pop();continue;default:if(!(le=Be.trys,(le=le.length>0&&le[le.length-1])||st[0]!==6&&st[0]!==2)){Be=0;continue}if(st[0]===3&&(!le||st[1]>le[0]&&st[1]0&&H>0){var Y=new Ki(B,H),le=Y.ratio>=1?20:Y.getHorizontalLength(20),$=Y.ratio<1?20:Y.getVerticalLength(20),Be=document.createElementNS("http://www.w3.org/2000/svg","svg");Be.setAttribute("xmlns","http://www.w3.org/2000/svg"),Be.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Be);var at=mt.createDefs();Be.appendChild(at);var pt=mt.createElement("clipPath",[["id","text-bg-clip"]]);at.appendChild(pt);var St=mt.createPath(mt.getHollowRectanglePath((24-le)/2,(24-$)/2,le,$,(24-le)/2+2,(24-$)/2+2,le-4,$-4));Be.appendChild(St);var st=mt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);st.appendChild(mt.createTSpan(B+":"+H)),Be.appendChild(st);var Rt=st.getBBox();mt.setAttributes(st,[["x",((24-Rt.width)/2).toString()],["y",((24-Rt.height)/2-Rt.y).toString()]]);var zt=mt.createPath(mt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Rt.width))/2,(24-Math.ceil(Rt.height))/2,Math.ceil(Rt.width),Math.ceil(Rt.height)));return pt.appendChild(zt),mt.setAttributes(St,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Be),Be.outerHTML}return''},J}(),ri=function(J){function B(H,Y,le){var $=J.call(this,H,Y)||this;return $.isDropdownOpen=!1,$.onClick=$.dropdownButtonClicked,$.dropdownButtons=le,$}return xt(B,J),B.prototype.setupDropdown=function(){var H=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(Y){Y.className=H.className,Y.colorsClassName=H.colorsClassName,H.dropdownBlock.appendChild(Y.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},B.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},B.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},B.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},B.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},B.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},B}(Mt),Ut=function(){function J(B,H){this.GRIP_SIZE=10,this.color=B,this.fillColor=H,this.visual=mt.createGroup(),this.visual.appendChild(mt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(mt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(B){return B===this.visual||B===this.visual.childNodes[0]||B===this.visual.childNodes[1]},J.prototype.setCenter=function(B,H){this.visual.childNodes.forEach(function(Y){return mt.setAttributes(Y,[["cx",B.toString()],["cy",H.toString()]])})},J}(),di=function(){function J(B,H,Y,le){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=B,this.canvasHeight=H,this.margin=Y,this.container=le,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(J.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(B){this._aspectRatio=B,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(B){this._isGridVisible=B,this.gridContainer&&mt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(B){this._zoomFactor=B,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),J.prototype.open=function(){var B=this;this.cropShadeElement=mt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=mt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var H=0;Hthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-H.height/2),mt.setAttributes(this.cropRectElement,[["x",H.x.toString()],["y",H.y.toString()],["width",H.width.toString()],["height",H.height.toString()]]);var Y=H.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function($,Be){var at=H.y+Y*(Be+1);mt.setAttributes($,[["x1",""+H.x],["y1",""+at],["x2",""+(H.x+H.width)],["y2",""+at]])});var le=H.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function($,Be){var at=H.x+le*(Be+1);mt.setAttributes($,[["x1",""+at],["y1",""+H.y],["x2",""+at],["y2",""+(H.y+H.height)]])}),mt.setAttributes(this.cropShadeElement,[["d",mt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,H.x,H.y,H.width,H.height)]]),this.topLeftGrip.setCenter(H.x,H.y),this.topRightGrip.setCenter(H.x+H.width,H.y),this.bottomLeftGrip.setCenter(H.x,H.y+H.height),this.bottomRightGrip.setCenter(H.x+H.width,H.y+H.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},J.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},J.prototype.clientToLocalCoordinates=function(B,H){var Y=this.container.getBoundingClientRect();return{x:B-Y.left+this.margin,y:H-Y.top+this.margin}},J.prototype.onPointerDown=function(B){this.container.setPointerCapture(B.pointerId),this.previousPoint=this.clientToLocalCoordinates(B.clientX,B.clientY),this.cropRectElement===B.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(B.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(B.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(B.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(B.target)&&(this.activeGrip=this.bottomRightGrip)},J.prototype.onPointerMove=function(B){if(this.isMoving)this.move(this.clientToLocalCoordinates(B.clientX,B.clientY));else if(this.activeGrip){var H=this.clientToLocalCoordinates(B.clientX,B.clientY);this.resize(H)}B.preventDefault()},J.prototype.onPointerUp=function(B){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(B.pointerId)},J.prototype.move=function(B){var H=B.x-this.previousPoint.x,Y=B.y-this.previousPoint.y;this.zoomFactor!==1&&(H=-H/this.zoomFactor,Y=-Y/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+H),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+Y),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=B},J.prototype.resize=function(B){var H=Object.assign({},this.cropRect),Y=B.x-this.previousPoint.x,le=B.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:H.x+Ythis.canvasWidth*this.zoomFactor&&(Y=this.canvasWidth*this.zoomFactor-H.width),H.width+=Y}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(H.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(Y),H.height=this.aspectRatio.getVerticalLength(H.width)):(H.y+=le,H.height=this.cropRect.y+this.cropRect.height-H.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?H.height=this.aspectRatio.getVerticalLength(H.width):H.height+=le}H.width<10&&(H.x=this.cropRect.x,H.width=10),H.height<10&&(H.y=this.cropRect.y,H.height=10),this.previousPoint=B,H.x>=this.margin&&H.y>=this.margin&&H.x-this.margin+H.width<=this.canvasWidth&&H.y-this.margin+H.height<=this.canvasHeight&&(this.cropRect=H,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},J.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var B=this.cropRect.x+this.cropRect.width/2,H=this.cropRect.y+this.cropRect.height/2,Y=this.aspectRatio.getHorizontalLength(this.cropRect.height),le=this.aspectRatio.getVerticalLength(this.cropRect.width);Y/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=B-this.cropRect.width/2,this.cropRect.y=H-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},J.prototype.getRescaledRect=function(B,H,Y,le,$,Be){var at=Y/B,pt=le/H;return{x:($.x-Be)*at+Be,y:($.y-Be)*pt+Be,width:$.width*at,height:$.height*pt}},J.prototype.scaleCanvas=function(B,H){var Y=this.getRescaledRect(this.canvasWidth,this.canvasHeight,B,H,this.cropRect,this.margin);this.canvasWidth=B,this.canvasHeight=H,this.onCropChange&&this.onCropChange(Y),this.setCropRectangle(Y)},J}(),Ii=function(){function J(B){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=B,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(J.prototype,"angle",{get:function(){return this._angle},set:function(B){this._angle=B,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),J.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},J.prototype.onPointerDown=function(B){this.controlContainer.setPointerCapture(B.pointerId),this.isDragging=!0,this.previousPoint={x:B.clientX,y:B.clientY}},J.prototype.onPointerMove=function(B){this.isDragging&&(this.onAngleChange&&this.onAngleChange((B.clientX-this.previousPoint.x)/5),this.previousPoint.x=B.clientX)},J.prototype.onPointerUp=function(B){this.isDragging&&this.onAngleChange&&this.onAngleChange((B.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(B.pointerId)},J.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var B=this.angleLabelText.getBBox();mt.setAttributes(this.angleLabelElement,[["x",((this.width-B.width)/2).toString()],["y",(this.height/2).toString()]])}},J.prototype.positionScaleShape=function(){if(this.scaleShape){var B=this.scaleShape.transform.baseVal.getItem(0);B.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(B,0)}},J.prototype.getVisual=function(){var B=document.createElementNS("http://www.w3.org/2000/svg","svg");B.setAttribute("xmlns","http://www.w3.org/2000/svg"),B.setAttribute("width",this.width+"px"),B.setAttribute("height",this.height+"px"),B.setAttribute("viewBox","0 0 "+this.width+" "+this.height),B.style.flexShrink="0",document.body.appendChild(B);for(var H="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,Y=1;Y<=this.width/5+10;Y++){var le=Y%5==0?this.height/3:this.height/6;H+="h4v"+-le+"h1v"+le}H+="v1H0Z",this.scaleShape=mt.createPath(H);var $=mt.createTransform();this.scaleShape.transform.baseVal.appendItem($),B.appendChild(this.scaleShape),this.angleLabelElement=mt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=mt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Be=mt.createTSpan("");return Be.innerHTML="°",this.angleLabelElement.appendChild(Be),B.appendChild(this.angleLabelElement),document.body.removeChild(B),B},J}(),Yi=function(){function J(){this.naturalSize=!1,this.imageType="image/png"}return J.prototype.rasterize=function(B,H,Y,le,$,Be,at){var pt=this;return new Promise(function(St){var st=document.createElement("canvas");st.width=B.width.baseVal.value-2*le,st.height=B.height.baseVal.value-2*le;var Rt=1,zt=1;pt.naturalSize===!0?(Rt=H.naturalWidth/(B.width.baseVal.value-2*le)/Be,zt=H.naturalHeight/(B.height.baseVal.value-2*le)/at,st.width=H.naturalWidth/Be,st.height=H.naturalHeight/at):pt.width!==void 0&&pt.height!==void 0&&(Rt=pt.width/Y.width,zt=pt.height/Y.height,st.width*=Rt,st.height*=zt);var ii=st.getContext("2d");ii.translate(st.width/2,st.height/2),ii.rotate($*Math.PI/180),ii.scale(Be,at),ii.translate(-st.width/2,-st.height/2),ii.drawImage(H,0,0,st.width,st.height);var Hi=document.createElement("canvas");Hi.width=Y.width*Rt,Hi.height=Y.height*zt,Hi.getContext("2d").putImageData(ii.getImageData((Y.x-le)*Rt,(Y.y-le)*zt,Y.width*Rt,Y.height*zt),0,0),St(Hi.toDataURL(pt.imageType,pt.imageQuality))})},J}(),lt=function(){function J(B){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=J.instanceCounter++,this.styles=new Vt(this.instanceNo),this.target=B,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(B){this._zoomToCropEnabled=B,B?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(B){this._isGridVisible=B,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"gridLines",{get:function(){return this._gridLines},set:function(B){this._gridLines=B,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(B){this._rotationAngle=B,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"aspectRatio",{get:function(){var B;return(B=this._aspectRatio)!==null&&B!==void 0?B:this.aspectRatios[0]},set:function(B){this._aspectRatio=B},enumerable:!1,configurable:!0}),J.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},J.prototype.show=function(){this.showUI(),this.open()},J.prototype.close=function(B){B===void 0&&(B=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),B||this.closeEventListeners.forEach(function(H){return H()}),this._isOpen=!1)},J.prototype.addRenderEventListener=function(B){this.renderEventListeners.push(B)},J.prototype.removeRenderEventListener=function(B){this.renderEventListeners.indexOf(B)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(B),1)},J.prototype.addCloseEventListener=function(B){this.closeEventListeners.push(B)},J.prototype.removeCloseEventListener=function(B){this.closeEventListeners.indexOf(B)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(B),1)},J.prototype.setupResizeObserver=function(){var B=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){B.resize(B.target.clientWidth,B.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},J.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var B=1*this.target.clientWidth/this.target.clientHeight,H=this.contentDiv.clientWidth/B>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*B:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,Y=H+2*this.CANVAS_MARGINB+this.CANVAS_MARGIN?this.target.offsetTop-(B+this.CANVAS_MARGIN):0;this.coverDiv.style.top=H+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},J.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},J.prototype.addTopToolbar=function(){var B=this;this.topToolbar=new kt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var H=new Yt;H.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(H);var Y=[];this.aspectRatios.forEach(function(zt){var ii=new Mt(Jt.getIcon(zt.horizontal,zt.vertical),zt.horizontal===0&&zt.vertical===0?"FREE":zt.horizontal+":"+zt.vertical);ii.onClick=function(){return B.ratioButtonClicked(zt)},Y.push(ii)}),this.aspectRatioButton=new ri(Jt.getIcon(0,0),"Aspect ratio",Y),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,H.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var le=new Mt('',"Toggle grid");le.isActive=this.isGridVisible,le.onClick=function(){B.isGridVisible=!B.isGridVisible,le.isActive=B.isGridVisible},H.addButton(le);var $=new Mt('',"Zoom to selection");if($.isActive=this.zoomToCropEnabled,$.onClick=function(){B.zoomToCropEnabled=!B.zoomToCropEnabled,$.isActive=B.zoomToCropEnabled},H.addButton($),!Nt.isLicensed){var Be=new yt;this.topToolbar.addElementBlock(Be);var at=document.createElement("div");at.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var pt=document.createElement("a");pt.style.color="currentColor",pt.href="https://markerjs.com/products/cropro",pt.target="_blank",pt.innerHTML='',at.appendChild(pt),Be.addElement(at)}var St=new Yt;St.minWidth=3*this.toolbarHeight+"px",St.contentAlign="end",this.topToolbar.addButtonBlock(St);var st=new Mt('',"OK");st.onClick=this.startRenderAndClose,St.addButton(st),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(st.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Rt=new Mt('',"Close");Rt.onClick=this.close,St.addButton(Rt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Rt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},J.prototype.addBottomToolbar=function(){var B=this;this.bottomToolbar=new kt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var H=new Yt;H.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(H);var Y=new Mt('',"Rotate left");Y.onClick=this.rotateLeftButtonClicked,H.addButton(Y);var le=new Mt('',"Rotate right");le.onClick=this.rotateRightButtonClicked,H.addButton(le);var $=new yt;$.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock($),this.straightener=new Ii("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(St){B.rotateBy(St),B.straightener.angle=B.rotationAngle},$.addElement(this.straightener.getUI());var Be=new Yt;Be.minWidth=2*this.toolbarHeight+"px",Be.contentAlign="end",this.bottomToolbar.addButtonBlock(Be);var at=new Mt('',"Flip horizontal");at.onClick=this.flipHorizontallyButtonClicked,Be.addButton(at);var pt=new Mt('',"Flip vertical");pt.onClick=this.flipVerticallyButtonClicked,Be.addButton(pt)},J.prototype.ratioButtonClicked=function(B){this.aspectRatio=B,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},J.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Jt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},J.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ki(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},J.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},J.prototype.restoreState=function(B){if(B){var H=this.cropLayer.getRescaledRect(B.width,B.height,this.imageWidth,this.imageHeight,B.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(H),this.cropRectChanged(H),this.flippedHorizontally=B.flippedHorizontally,this.flippedVertically=B.flippedVertically,this.applyFlip(),this.rotationAngle=B.rotationAngle,this.applyRotation()}},J.prototype.clientToLocalCoordinates=function(B,H){var Y=this.cropImage.getBoundingClientRect();return{x:B-Y.left,y:H-Y.top}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var B=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=B+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},J.prototype.rotateLeftButtonClicked=function(){var B=this.rotationAngle-90;this.rotationAngle%90!=0&&(B+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(B)},J.prototype.rotateRightButtonClicked=function(){var B=this.rotationAngle+90;this.rotationAngle%90!=0&&(B-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(B)},J.prototype.rotateTo=function(B){B=(B=B>180?B-360:B)<=-180?B+360:B,this.rotationAngle=B,this.applyRotation()},J.prototype.rotateBy=function(B){this.rotateTo((this.rotationAngle+B)%360)},J.prototype.applyRotation=function(){var B=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var H=this.editingTargetRotationContainer.transform.baseVal.getItem(0);H.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(H,0);var Y=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/Y.width,this.imageHeight/Y.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=B},J.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},J.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},J.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},J.prototype.startRenderAndClose=function(){return ct(this,void 0,void 0,function(){var B,H;return At(this,function(Y){switch(Y.label){case 0:return[4,this.render()];case 1:return B=Y.sent(),H=this.getState(),this.renderEventListeners.forEach(function(le){return le(B,H)}),this.close(!0),[2]}})})},J.prototype.render=function(){return ct(this,void 0,void 0,function(){var B;return At(this,function(H){switch(H.label){case 0:return(B=new Yi).naturalSize=this.renderAtNaturalSize,B.imageType=this.renderImageType,B.imageQuality=this.renderImageQuality,B.width=this.renderWidth,B.height=this.renderHeight,this.unzoomFromCrop(),mt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,B.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return H.sent(),[4,B.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,H.sent()]}})})},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new _t("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new _t("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new _t("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var B=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new _t("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*B)+`px;
height: `+(this.toolbarHeight-2*B)+`px;
padding: `+B+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new _t("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new _t("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Et("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Et("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new _t("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new _t("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new _t("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new _t("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*B)+`px;
padding: `+B+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new _t("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},J.instanceCounter=0,J}(),It=Q("8hTe"),pr=Q.n(It),mr=/]*>/g;function gr(J){var B=document.createElement("div");return B.innerHTML=J,B.childNodes.length===0?"":B.childNodes[0].nodeValue}var vr=re.a=function(J){var B=J.value,H=B===void 0?"":B,Y=J.edit,le=Y===void 0?!1:Y,$=J.className,Be=J.showTextOnly,at=J.showLines,pt=J.replaces,St=J.zoomImg,st=J.hasMask,Rt=J.style,zt=Rt===void 0?{}:Rt,ii=J.stylesPrev,Hi=ii===void 0?{}:ii,Si=String(H),Ti=Object(c.useRef)(),qi=Object(c.useRef)(),kr=Object(c.useState)(""),mi=Object(E.a)(kr,2),zi=mi[0],lr=mi[1],ur=Object(c.useState)("office"),ji=Object(E.a)(ur,2),Ir=ji[0],_r=ji[1],Xr=function(){var Gt=new lt(qi.current);Gt.displayMode="popup",Gt.addRenderEventListener(function(){var xi=Object(p.a)(i.a.mark(function Ht(ui){var qt;return i.a.wrap(function(gi){for(;;)switch(gi.prev=gi.next){case 0:return Ti.current.style.display="none",gi.next=3,Object(ze.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ui}});case 3:qt=gi.sent,qt!=null&&qt.id&&pt(qi.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(qt==null?void 0:qt.id,"?type=").concat(qt.content_type));case 5:case"end":return gi.stop()}},Ht)}));return function(Ht){return xi.apply(this,arguments)}}()),Gt.show()},zr=function(){var Gt=new ft(qi.current);Gt.settings.displayMode="popup",Gt.addEventListener("render",function(){var xi=Object(p.a)(i.a.mark(function Ht(ui){var qt;return i.a.wrap(function(gi){for(;;)switch(gi.prev=gi.next){case 0:if(Ti.current.style.display="none",!qi.current){gi.next=6;break}return gi.next=4,Object(ze.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ui.dataUrl}});case 4:qt=gi.sent,qt!=null&&qt.id&&pt(qi.current.getAttribute("src").replace(te.a.API_SERVER,""),"/api/attachments/".concat(qt==null?void 0:qt.id,"?type=").concat(qt.content_type));case 6:case"end":return gi.stop()}},Ht)}));return function(Ht){return xi.apply(this,arguments)}}()),Gt.show(),window.markerArea=Gt},$i=Object(c.useMemo)(function(){Ti.current&&(Ti.current.style.zIndex=-1);try{var oi=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Gt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Si=Si.replace(oi,"("+te.a.API_SERVER+"/api/attachments/").replace(Gt,'"'+te.a.API_SERVER+"/api/attachments/").replace(xi,'"'+te.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(rr){}var Ht=K(Si),ui=F();if(Si.match(/\[TOC\]/)&&(Ht=Ht.replace("[TOC]
",C()),v()),Ht=Ht.replace(/(__special_katext_id_\d+__)/g,function(rr,gi){var Li=ui[gi],Gr=Li.type,xr=Li.expression;return Object(he.renderToString)(gr(xr)||"",{displayMode:Gr==="block",throwOnError:!1,output:"html"})}),Ht=Ht.replace(/▁/g,"\u2581\u2581\u2581"),P(),Be){var qt=document.createElement("div");return qt.innerHTML=Ht,qt.innerText}return setTimeout(function(){return cn()},500),Ht},[Si]),Qi=Object(c.useRef)();m.WebkitLineClamp=at,at&&(zt=Object(M.a)(Object(M.a)({},zt),m));function yr(oi){var Gt=oi.target;if(Gt.tagName.toUpperCase()==="IMG"){if(St){var xi=Gt.getAttribute("src");lr(xi),_r("image")}}else if(Gt.tagName.toUpperCase()==="A"){var Ht=Gt.getAttribute("href");if(Ht.indexOf("office")>-1)oi.preventDefault(),lr(Ht),_r("office");else if(Ht.indexOf("application/pdf")>-1)oi.preventDefault(),lr(Ht),_r("pdf");else if(Ht.indexOf("text/html")>-1)oi.preventDefault(),lr(Ht),_r("html");else if(Ht.startsWith("#")){oi.preventDefault();var ui=document.getElementById(Ht.replace("#",""));ui&&ui.scrollIntoView(!0)}}}var cn=function(){var Gt,xi=(Gt=Qi.current)===null||Gt===void 0?void 0:Gt.querySelectorAll("video");xi==null||xi.forEach(function(Ht){if(Ht.oncontextmenu=function(){return!1},Ht.src.indexOf(".m3u8")>-1&&!Ht.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var ui=new z.a;ui.loadSource(Ht.src),ui.attachMedia(Ht)}}})};Object(c.useEffect)(function(){if(Qi.current&&$i&&($i.match(mr)&&window.PR.prettyPrint()),Qi.current)return Qi.current.addEventListener("click",yr),function(){Qi.current.removeEventListener("click",yr),P(),v()}},[$i,Qi.current,yr]);var br=function(Gt){if(!le)return;Gt.target.nodeName==="IMG"?(Ti.current.style.zIndex=1,Ti.current.style.display="flex",Ti.current.style.width=Gt.target.clientWidth+"px",Ti.current.style.height=Gt.target.clientHeight+"px",Ti.current.style.top=Gt.target.offsetTop+"px",Ti.current.style.left=Gt.target.offsetLeft+"px",qi.current.src=Gt.target.getAttribute("src")):Ti.current.style.display="none"};return o.a.createElement("div",{style:{position:"relative"}},o.a.createElement("div",{ref:Qi,style:Object(M.a)({},zt),className:"".concat($||""," markdown-body ").concat(pr.a.mdBody),onMouseOver:br,dangerouslySetInnerHTML:{__html:$i}}),o.a.createElement("div",{ref:Ti,className:pr.a.button},o.a.createElement(R.a,null,o.a.createElement(L.a,{onClick:function(){return Xr()}},"\u88C1\u526A"),o.a.createElement(L.a,{onClick:function(){return zr()}},"\u7F16\u8F91"))),o.a.createElement("img",{ref:qi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),o.a.createElement(be.a,{close:!0,data:zi,type:zi!=null&&zi.length?Ir:"",style:Object(M.a)({},Hi),onClose:function(){return lr("")}}))}},"9VGf":function(it,re,Q){"use strict";Q.d(re,"a",function(){return I});var G=Q("q1tI"),R=Q.n(G);function I(L,M){var p=Object(G.useRef)();Object(G.useEffect)(function(){p.current=L}),Object(G.useEffect)(function(){function E(){p.current()}if(M!==null){var b=setInterval(E,M);return function(){return clearInterval(b)}}},[M])}},BU3w:function(it,re,Q){"use strict";Q.d(re,"a",function(){return p});var G=Q("MNnm"),R="rc-util-key";function I(E){if(E.attachTo)return E.attachTo;var b=document.querySelector("head");return b||document.body}function L(E){var b,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(G.a)())return null;var c=document.createElement("style");if((b=i.csp)===null||b===void 0?void 0:b.nonce){var o;c.nonce=(o=i.csp)===null||o===void 0?void 0:o.nonce}c.innerHTML=E;var h=I(i),n=h.firstChild;return i.prepend&&h.prepend?h.prepend(c):i.prepend&&n?h.insertBefore(c,n):h.appendChild(c),c}var M=new Map;function p(E,b){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=I(i);if(!M.has(c)){var o=L("",i),h=o.parentNode;M.set(c,h),h.removeChild(o)}var n=Array.from(M.get(c).children).find(function(u){return u.tagName==="STYLE"&&u[R]===b});if(n){var a,t;if(((a=i.csp)===null||a===void 0?void 0:a.nonce)&&n.nonce!==((t=i.csp)===null||t===void 0?void 0:t.nonce)){var r;n.nonce=(r=i.csp)===null||r===void 0?void 0:r.nonce}return n.innerHTML!==E&&(n.innerHTML=E),n}var s=L(E,i);return s[R]=b,s}},Bd2K:function(it,re,Q){(function(G){G(Q("VrN/"),Q("osHv"))})(function(G){G.defineOption("autoCloseTags",!1,function(i,c,o){if(o!=G.Init&&o&&i.removeKeyMap("autoCloseTags"),!c)return;var h={name:"autoCloseTags"};(typeof c!="object"||c.whenClosing!==!1)&&(h["'/'"]=function(n){return p(n)}),(typeof c!="object"||c.whenOpening!==!1)&&(h["'>'"]=function(n){return L(n)}),i.addKeyMap(h)});var R=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],I=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function L(i){if(i.getOption("disableInput"))return G.Pass;for(var c=i.listSelections(),o=[],h=i.getOption("autoCloseTags"),n=0;na.ch&&(f=f.slice(0,f.length-t.end+a.ch));var S=f.toLowerCase();if(!f||t.type=="string"&&(t.end!=a.ch||!/[\"\']/.test(t.string.charAt(t.string.length-1))||t.string.length==1)||t.type=="tag"&&u.close||t.string.indexOf("/")==a.ch-t.start-1||v&&E(v,S)>-1||b(i,r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(s)||[],f,a,!0))return G.Pass;var C=typeof h=="object"&&h.emptyTags;if(C&&E(C,f)>-1){o[n]={text:"/>",newPos:G.Pos(a.line,a.ch+2)};continue}var _=m&&E(m,S)>-1;o[n]={indent:_,text:">"+(_?`
`:"")+""+f+">",newPos:_?G.Pos(a.line+1,0):G.Pos(a.line,a.ch+1)}}for(var y=typeof h=="object"&&h.dontIndentOnAutoClose,n=c.length-1;n>=0;n--){var T=o[n];i.replaceRange(T.text,c[n].head,c[n].anchor,"+insert");var k=i.listSelections().slice(0);k[n]={head:T.newPos,anchor:T.newPos},i.setSelections(k),!y&&T.indent&&(i.indentLine(T.newPos.line,null,!0),i.indentLine(T.newPos.line+1,null,!0))}}function M(i,c){for(var o=i.listSelections(),h=[],n=c?"/":"",a=i.getOption("autoCloseTags"),t=typeof a=="object"&&a.dontIndentOnSlash,r=0;r"&&(v+=">"),h[r]=v}if(i.replaceSelections(h),o=i.listSelections(),!t)for(var r=0;r=0&&c[s]==o;s--)++r;h=t.to;for(var s=1;s0){for(var c=0;c1&&arguments[1]!==void 0?arguments[1]:"",c=[],o=0;op,G.serviceIds.set(p,E),E}function M(p){return function(E,b,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");I(p,E,i,!0)}}},DlQD:function(it,re,Q){(function(G,R){it.exports=R()})(this,function(){"use strict";function G(Re,_e){for(var Ee=0;Ee<_e.length;Ee++){var ee=_e[Ee];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(Re,ee.key,ee)}}function R(Re,_e,Ee){return _e&&G(Re.prototype,_e),Ee&&G(Re,Ee),Re}function I(Re,_e){if(!Re)return;if(typeof Re=="string")return L(Re,_e);var Ee=Object.prototype.toString.call(Re).slice(8,-1);if(Ee==="Object"&&Re.constructor&&(Ee=Re.constructor.name),Ee==="Map"||Ee==="Set")return Array.from(Re);if(Ee==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ee))return L(Re,_e)}function L(Re,_e){(_e==null||_e>Re.length)&&(_e=Re.length);for(var Ee=0,ee=new Array(_e);Ee<_e;Ee++)ee[Ee]=Re[Ee];return ee}function M(Re,_e){var Ee;if(typeof Symbol=="undefined"||Re[Symbol.iterator]==null){if(Array.isArray(Re)||(Ee=I(Re))||_e&&Re&&typeof Re.length=="number"){Ee&&(Re=Ee);var ee=0;return function(){return ee>=Re.length?{done:!0}:{done:!1,value:Re[ee++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Ee=Re[Symbol.iterator](),Ee.next.bind(Ee)}function p(Re,_e){return _e={exports:{}},Re(_e,_e.exports),_e.exports}var E=p(function(Re){function _e(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Ee(ee){Re.exports.defaults=ee}Re.exports={defaults:_e(),getDefaults:_e,changeDefaults:Ee}}),b=E.defaults,i=E.getDefaults,c=E.changeDefaults,o=/[&<>"']/,h=/[&<>"']/g,n=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,t={"&":"&","<":"<",">":">",'"':""","'":"'"},r=function(_e){return t[_e]};function s(Re,_e){if(_e){if(o.test(Re))return Re.replace(h,r)}else if(n.test(Re))return Re.replace(a,r);return Re}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function f(Re){return Re.replace(u,function(_e,Ee){return Ee=Ee.toLowerCase(),Ee==="colon"?":":Ee.charAt(0)==="#"?Ee.charAt(1)==="x"?String.fromCharCode(parseInt(Ee.substring(2),16)):String.fromCharCode(+Ee.substring(1)):""})}var d=/(^|[^\[])\^/g;function v(Re,_e){Re=Re.source||Re,_e=_e||"";var Ee={replace:function(oe,q){return q=q.source||q,q=q.replace(d,"$1"),Re=Re.replace(oe,q),Ee},getRegex:function(){return new RegExp(Re,_e)}};return Ee}var m=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function C(Re,_e,Ee){if(Re){var ee;try{ee=decodeURIComponent(f(Ee)).replace(m,"").toLowerCase()}catch(oe){return null}if(ee.indexOf("javascript:")===0||ee.indexOf("vbscript:")===0||ee.indexOf("data:")===0)return null}_e&&!S.test(Ee)&&(Ee=g(_e,Ee));try{Ee=encodeURI(Ee).replace(/%25/g,"%")}catch(oe){return null}return Ee}var _={},y=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,k=/^([^:]+:\/*[^/]*)[\s\S]*$/;function g(Re,_e){_[" "+Re]||(y.test(Re)?_[" "+Re]=Re+"/":_[" "+Re]=W(Re,"/",!0)),Re=_[" "+Re];var Ee=Re.indexOf(":")===-1;return _e.substring(0,2)==="//"?Ee?_e:Re.replace(T,"$1")+_e:_e.charAt(0)==="/"?Ee?_e:Re.replace(k,"$1")+_e:Re+_e}var F={exec:function(){}};function P(Re){for(var _e=1,Ee,ee;_e=0&&Ie[Ce]==="\\";)V=!V;return V?"|":" |"}),ee=Ee.split(/ \|/),oe=0;if(ee.length>_e)ee.splice(_e);else for(;ee.length<_e;)ee.push("");for(;oe=ee.length?oe.slice(ee.length):oe}).join(`
`)}var Pe=function(){function Re(Ee){this.options=Ee||U}var _e=Re.prototype;return _e.space=function(ee){var oe=this.rules.block.newline.exec(ee);if(oe)return oe[0].length>1?{type:"space",raw:oe[0]}:{raw:`
`}},_e.code=function(ee,oe){var q=this.rules.block.code.exec(ee);if(q){var ge=oe[oe.length-1];if(ge&&ge.type==="paragraph")return{raw:q[0],text:q[0].trimRight()};var Ie=q[0].replace(/^ {4}/gm,"");return{type:"code",raw:q[0],codeBlockStyle:"indented",text:this.options.pedantic?Ie:O(Ie,`
`)}}},_e.fences=function(ee){var oe=this.rules.block.fences.exec(ee);if(oe){var q=oe[0],ge=ze(q,oe[3]||"");return{type:"code",raw:q,lang:oe[2]?oe[2].trim():oe[2],text:ge}}},_e.heading=function(ee){var oe=this.rules.block.heading.exec(ee);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},_e.nptable=function(ee){var oe=this.rules.block.nptable.exec(ee);if(oe){var q={type:"table",header:z(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[],raw:oe[0]};if(q.header.length===q.align.length){var ge=q.align.length,Ie;for(Ie=0;Ie ?/gm,"");return{type:"blockquote",raw:oe[0],text:q}}},_e.list=function(ee){var oe=this.rules.block.list.exec(ee);if(oe){for(var q=oe[0],ge=oe[2],Ie=ge.length>1,V=ge[ge.length-1]===")",Ce={type:"list",raw:q,ordered:Ie,start:Ie?+ge.slice(0,-1):"",loose:!1,items:[]},He=oe[0].match(this.rules.block.item),fe=!1,ke,Ve,nt,tt,ut,ft,Ft,xt=He.length,ct=0;ct1||this.options.smartLists&&nt!==ge)&&(tt=He.slice(ct+1).join(`
`),Ce.raw=Ce.raw.substring(0,Ce.raw.length-tt.length),ct=xt-1)),ut=fe||/\n\n(?!\s*$)/.test(ke),ct!==xt-1&&(fe=ke.charAt(ke.length-1)===`
`,ut||(ut=fe)),ut&&(Ce.loose=!0),ft=/^\[[ xX]\] /.test(ke),Ft=void 0,ft&&(Ft=ke[1]!==" ",ke=ke.replace(/^\[[ xX]\] +/,"")),Ce.items.push({type:"list_item",raw:q,task:ft,checked:Ft,loose:ut,text:ke});return Ce}},_e.html=function(ee){var oe=this.rules.block.html.exec(ee);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):te(oe[0]):oe[0]}},_e.def=function(ee){var oe=this.rules.block.def.exec(ee);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var q=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:q,raw:oe[0],href:oe[2],title:oe[3]}}},_e.table=function(ee){var oe=this.rules.block.table.exec(ee);if(oe){var q={type:"table",header:z(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[]};if(q.header.length===q.align.length){q.raw=oe[0];var ge=q.align.length,Ie;for(Ie=0;Ie/i.test(ge[0])&&(oe=!1),!q&&/^<(pre|code|kbd|script)(\s|>)/i.test(ge[0])?q=!0:q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ge[0])&&(q=!1),{type:this.options.sanitize?"text":"html",raw:ge[0],inLink:oe,inRawBlock:q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):te(ge[0]):ge[0]}},_e.link=function(ee){var oe=this.rules.inline.link.exec(ee);if(oe){var q=he(oe[2],"()");if(q>-1){var ge=oe[0].indexOf("!")===0?5:4,Ie=ge+oe[1].length+q;oe[2]=oe[2].substring(0,q),oe[0]=oe[0].substring(0,Ie).trim(),oe[3]=""}var V=oe[2],Ce="";if(this.options.pedantic){var He=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(V);He?(V=He[1],Ce=He[3]):Ce=""}else Ce=oe[3]?oe[3].slice(1,-1):"";V=V.trim().replace(/^<([\s\S]*)>$/,"$1");var fe=be(oe,{href:V&&V.replace(this.rules.inline._escapes,"$1"),title:Ce&&Ce.replace(this.rules.inline._escapes,"$1")},oe[0]);return fe}},_e.reflink=function(ee,oe){var q;if((q=this.rules.inline.reflink.exec(ee))||(q=this.rules.inline.nolink.exec(ee))){var ge=(q[2]||q[1]).replace(/\s+/g," ");if(ge=oe[ge.toLowerCase()],!ge||!ge.href){var Ie=q[0].charAt(0);return{type:"text",raw:Ie,text:Ie}}var V=be(q,ge,q[0]);return V}},_e.strong=function(ee,oe,q){q===void 0&&(q="");var ge=this.rules.inline.strong.start.exec(ee);if(ge&&(!ge[1]||ge[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){oe=oe.slice(-1*ee.length);var Ie=ge[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ie.lastIndex=0;for(var V;(ge=Ie.exec(oe))!=null;)if(V=this.rules.inline.strong.middle.exec(oe.slice(0,ge.index+3)),V)return{type:"strong",raw:ee.slice(0,V[0].length),text:ee.slice(2,V[0].length-2)}}},_e.em=function(ee,oe,q){q===void 0&&(q="");var ge=this.rules.inline.em.start.exec(ee);if(ge&&(!ge[1]||ge[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){oe=oe.slice(-1*ee.length);var Ie=ge[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ie.lastIndex=0;for(var V;(ge=Ie.exec(oe))!=null;)if(V=this.rules.inline.em.middle.exec(oe.slice(0,ge.index+2)),V)return{type:"em",raw:ee.slice(0,V[0].length),text:ee.slice(1,V[0].length-1)}}},_e.codespan=function(ee){var oe=this.rules.inline.code.exec(ee);if(oe){var q=oe[2].replace(/\n/g," "),ge=/[^ ]/.test(q),Ie=q.startsWith(" ")&&q.endsWith(" ");return ge&&Ie&&(q=q.substring(1,q.length-1)),q=te(q,!0),{type:"codespan",raw:oe[0],text:q}}},_e.br=function(ee){var oe=this.rules.inline.br.exec(ee);if(oe)return{type:"br",raw:oe[0]}},_e.del=function(ee){var oe=this.rules.inline.del.exec(ee);if(oe)return{type:"del",raw:oe[0],text:oe[1]}},_e.autolink=function(ee,oe){var q=this.rules.inline.autolink.exec(ee);if(q){var ge,Ie;return q[2]==="@"?(ge=te(this.options.mangle?oe(q[1]):q[1]),Ie="mailto:"+ge):(ge=te(q[1]),Ie=ge),{type:"link",raw:q[0],text:ge,href:Ie,tokens:[{type:"text",raw:ge,text:ge}]}}},_e.url=function(ee,oe){var q;if(q=this.rules.inline.url.exec(ee)){var ge,Ie;if(q[2]==="@")ge=te(this.options.mangle?oe(q[0]):q[0]),Ie="mailto:"+ge;else{var V;do V=q[0],q[0]=this.rules.inline._backpedal.exec(q[0])[0];while(V!==q[0]);ge=te(q[0]),q[1]==="www."?Ie="http://"+ge:Ie=ge}return{type:"link",raw:q[0],text:ge,href:Ie,tokens:[{type:"text",raw:ge,text:ge}]}}},_e.inlineText=function(ee,oe,q){var ge=this.rules.inline.text.exec(ee);if(ge){var Ie;return oe?Ie=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):te(ge[0]):ge[0]:Ie=te(this.options.smartypants?q(ge[0]):ge[0]),{type:"text",raw:ge[0],text:Ie}}},Re}(),Oe=K.noopTest,Ke=K.edit,je=K.merge,Ae={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Oe,table:Oe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Ae._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ae.def=Ke(Ae.def).replace("label",Ae._label).replace("title",Ae._title).getRegex(),Ae.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ae.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Ae.item=Ke(Ae.item,"gm").replace(/bull/g,Ae.bullet).getRegex(),Ae.list=Ke(Ae.list).replace(/bull/g,Ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ae.def.source+")").getRegex(),Ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ae._comment=//,Ae.html=Ke(Ae.html,"i").replace("comment",Ae._comment).replace("tag",Ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ae.paragraph=Ke(Ae._paragraph).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ae._tag).getRegex(),Ae.blockquote=Ke(Ae.blockquote).replace("paragraph",Ae.paragraph).getRegex(),Ae.normal=je({},Ae),Ae.gfm=je({},Ae.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Ae.gfm.nptable=Ke(Ae.gfm.nptable).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ae._tag).getRegex(),Ae.gfm.table=Ke(Ae.gfm.table).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ae._tag).getRegex(),Ae.pedantic=je({},Ae.normal,{html:Ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Oe,paragraph:Ke(Ae.normal._paragraph).replace("hr",Ae.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var we={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Oe,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Oe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",we.punctuation=Ke(we.punctuation).replace(/punctuation/g,we._punctuation).getRegex(),we._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",we._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",we.em.start=Ke(we.em.start).replace(/punctuation/g,we._punctuation).getRegex(),we.em.middle=Ke(we.em.middle).replace(/punctuation/g,we._punctuation).replace(/overlapSkip/g,we._overlapSkip).getRegex(),we.em.endAst=Ke(we.em.endAst,"g").replace(/punctuation/g,we._punctuation).getRegex(),we.em.endUnd=Ke(we.em.endUnd,"g").replace(/punctuation/g,we._punctuation).getRegex(),we.strong.start=Ke(we.strong.start).replace(/punctuation/g,we._punctuation).getRegex(),we.strong.middle=Ke(we.strong.middle).replace(/punctuation/g,we._punctuation).replace(/blockSkip/g,we._blockSkip).getRegex(),we.strong.endAst=Ke(we.strong.endAst,"g").replace(/punctuation/g,we._punctuation).getRegex(),we.strong.endUnd=Ke(we.strong.endUnd,"g").replace(/punctuation/g,we._punctuation).getRegex(),we.blockSkip=Ke(we._blockSkip,"g").getRegex(),we.overlapSkip=Ke(we._overlapSkip,"g").getRegex(),we._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,we._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,we._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,we.autolink=Ke(we.autolink).replace("scheme",we._scheme).replace("email",we._email).getRegex(),we._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,we.tag=Ke(we.tag).replace("comment",Ae._comment).replace("attribute",we._attribute).getRegex(),we._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,we._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,we._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,we.link=Ke(we.link).replace("label",we._label).replace("href",we._href).replace("title",we._title).getRegex(),we.reflink=Ke(we.reflink).replace("label",we._label).getRegex(),we.reflinkSearch=Ke(we.reflinkSearch,"g").replace("reflink",we.reflink).replace("nolink",we.nolink).getRegex(),we.normal=je({},we),we.pedantic=je({},we.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ke(/^!?\[(label)\]\((.*?)\)/).replace("label",we._label).getRegex(),reflink:Ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",we._label).getRegex()}),we.gfm=je({},we.normal,{escape:Ke(we.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(ee="x"+ee.toString(16)),_e+=""+ee+";";return _e}var qe=function(){function Re(Ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ee||Te,this.options.tokenizer=this.options.tokenizer||new Pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ee={block:me.normal,inline:Xe.normal};this.options.pedantic?(ee.block=me.pedantic,ee.inline=Xe.pedantic):this.options.gfm&&(ee.block=me.gfm,this.options.breaks?ee.inline=Xe.breaks:ee.inline=Xe.gfm),this.tokenizer.rules=ee}Re.lex=function(ee,oe){var q=new Re(oe);return q.lex(ee)};var _e=Re.prototype;return _e.lex=function(ee){return ee=ee.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ee,this.tokens,!0),this.inline(this.tokens),this.tokens},_e.blockTokens=function(ee,oe,q){oe===void 0&&(oe=[]),q===void 0&&(q=!0),ee=ee.replace(/^ +$/gm,"");for(var ge,Ie,V,Ce;ee;){if(ge=this.tokenizer.space(ee)){ee=ee.substring(ge.raw.length),ge.type&&oe.push(ge);continue}if(ge=this.tokenizer.code(ee,oe)){ee=ee.substring(ge.raw.length),ge.type?oe.push(ge):(Ce=oe[oe.length-1],Ce.raw+=`
`+ge.raw,Ce.text+=`
`+ge.text);continue}if(ge=this.tokenizer.fences(ee)){ee=ee.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.heading(ee)){ee=ee.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.nptable(ee)){ee=ee.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.hr(ee)){ee=ee.substring(ge.raw.length),oe.push(ge);continue}if(ge=this.tokenizer.blockquote(ee)){ee=ee.substring(ge.raw.length),ge.tokens=this.blockTokens(ge.text,[],q),oe.push(ge);continue}if(ge=this.tokenizer.list(ee)){for(ee=ee.substring(ge.raw.length),V=ge.items.length,Ie=0;Ie0)for(;(He=this.tokenizer.rules.inline.reflinkSearch.exec(Ce))!=null;)fe.includes(He[0].slice(He[0].lastIndexOf("[")+1,-1))&&(Ce=Ce.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(He=this.tokenizer.rules.inline.blockSkip.exec(Ce))!=null;)Ce=Ce.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ee;){if(V=this.tokenizer.escape(ee)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.tag(ee,q,ge)){ee=ee.substring(V.raw.length),q=V.inLink,ge=V.inRawBlock,oe.push(V);continue}if(V=this.tokenizer.link(ee)){ee=ee.substring(V.raw.length),V.type==="link"&&(V.tokens=this.inlineTokens(V.text,[],!0,ge)),oe.push(V);continue}if(V=this.tokenizer.reflink(ee,this.tokens.links)){ee=ee.substring(V.raw.length),V.type==="link"&&(V.tokens=this.inlineTokens(V.text,[],!0,ge)),oe.push(V);continue}if(V=this.tokenizer.strong(ee,Ce,Ie)){ee=ee.substring(V.raw.length),V.tokens=this.inlineTokens(V.text,[],q,ge),oe.push(V);continue}if(V=this.tokenizer.em(ee,Ce,Ie)){ee=ee.substring(V.raw.length),V.tokens=this.inlineTokens(V.text,[],q,ge),oe.push(V);continue}if(V=this.tokenizer.codespan(ee)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.br(ee)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.del(ee)){ee=ee.substring(V.raw.length),V.tokens=this.inlineTokens(V.text,[],q,ge),oe.push(V);continue}if(V=this.tokenizer.autolink(ee,We)){ee=ee.substring(V.raw.length),oe.push(V);continue}if(!q&&(V=this.tokenizer.url(ee,We))){ee=ee.substring(V.raw.length),oe.push(V);continue}if(V=this.tokenizer.inlineText(ee,ge,Ze)){ee=ee.substring(V.raw.length),Ie=V.raw.slice(-1),oe.push(V);continue}if(ee){var ke="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(ke);break}else throw new Error(ke)}}return oe},R(Re,null,[{key:"rules",get:function(){return{block:me,inline:Xe}}}]),Re}(),et=E.defaults,pe=K.cleanUrl,ve=K.escape,xe=function(){function Re(Ee){this.options=Ee||et}var _e=Re.prototype;return _e.code=function(ee,oe,q){var ge=(oe||"").match(/\S*/)[0];if(this.options.highlight){var Ie=this.options.highlight(ee,ge);Ie!=null&&Ie!==ee&&(q=!0,ee=Ie)}return ge?''+(q?ee:ve(ee,!0))+`
`:""+(q?ee:ve(ee,!0))+`
`},_e.blockquote=function(ee){return`
`+ee+`
`},_e.html=function(ee){return ee},_e.heading=function(ee,oe,q,ge){return this.options.headerIds?"
`:""+ee+"
`},_e.hr=function(){return this.options.xhtml?`
`:`
`},_e.list=function(ee,oe,q){var ge=oe?"ol":"ul",Ie=oe&&q!==1?' start="'+q+'"':"";return"<"+ge+Ie+`>
`+ee+""+ge+`>
`},_e.listitem=function(ee){return""+ee+`
`},_e.checkbox=function(ee){return" "},_e.paragraph=function(ee){return""+ee+`
`},_e.table=function(ee,oe){return oe&&(oe=""+oe+""),`
`},_e.tablerow=function(ee){return`
`+ee+`
`},_e.tablecell=function(ee,oe){var q=oe.header?"th":"td",ge=oe.align?"<"+q+' align="'+oe.align+'">':"<"+q+">";return ge+ee+""+q+`>
`},_e.strong=function(ee){return""+ee+""},_e.em=function(ee){return""+ee+""},_e.codespan=function(ee){return""+ee+""},_e.br=function(){return this.options.xhtml?"
":"
"},_e.del=function(ee){return""+ee+""},_e.link=function(ee,oe,q){if(ee=pe(this.options.sanitize,this.options.baseUrl,ee),ee===null)return q;var ge='"+q+"",ge},_e.image=function(ee,oe,q){if(ee=pe(this.options.sanitize,this.options.baseUrl,ee),ee===null)return q;var ge='
":">",ge},_e.text=function(ee){return ee},Re}(),Se=function(){function Re(){}var _e=Re.prototype;return _e.strong=function(ee){return ee},_e.em=function(ee){return ee},_e.codespan=function(ee){return ee},_e.del=function(ee){return ee},_e.html=function(ee){return ee},_e.text=function(ee){return ee},_e.link=function(ee,oe,q){return""+q},_e.image=function(ee,oe,q){return""+q},_e.br=function(){return""},Re}(),Le=function(){function Re(){this.seen={}}var _e=Re.prototype;return _e.slug=function(ee){var oe=ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var q=oe;do this.seen[q]++,oe=q+"-"+this.seen[q];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},Re}(),ne=E.defaults,ye=K.unescape,se=function(){function Re(Ee){this.options=Ee||ne,this.options.renderer=this.options.renderer||new xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Le}Re.parse=function(ee,oe){var q=new Re(oe);return q.parse(ee)};var _e=Re.prototype;return _e.parse=function(ee,oe){oe===void 0&&(oe=!0);var q="",ge,Ie,V,Ce,He,fe,ke,Ve,nt,tt,ut,ft,Ft,xt,ct,At,Nt,mt,Vt=ee.length;for(ge=0;ge0&&ct.tokens[0].type==="text"?(ct.tokens[0].text=mt+" "+ct.tokens[0].text,ct.tokens[0].tokens&&ct.tokens[0].tokens.length>0&&ct.tokens[0].tokens[0].type==="text"&&(ct.tokens[0].tokens[0].text=mt+" "+ct.tokens[0].tokens[0].text)):ct.tokens.unshift({type:"text",text:mt}):xt+=mt),xt+=this.parse(ct.tokens,Ft),nt+=this.renderer.listitem(xt,Nt,At);q+=this.renderer.list(nt,ut,ft);continue}case"html":{q+=this.renderer.html(tt.text);continue}case"paragraph":{q+=this.renderer.paragraph(this.parseInline(tt.tokens));continue}case"text":{for(nt=tt.tokens?this.parseInline(tt.tokens):tt.text;ge+1An error occurred:
"+Je(V.message+"",!0)+"
";throw V}}Me.options=Me.setOptions=function(Re){return Ne(Me.defaults,Re),ht(Me.defaults),Me},Me.getDefaults=Ge,Me.defaults=de,Me.use=function(Re){var _e=Ne({},Re);if(Re.renderer&&function(){var ee=Me.defaults.renderer||new xe,oe=function(Ie){var V=ee[Ie];ee[Ie]=function(){for(var Ce=arguments.length,He=new Array(Ce),fe=0;fe0||_.target.offsetWidth>0){var y=r(_.target.offsetWidth,_.target.offsetHeight,f),T=Object(R.a)(y,2),k=T[0],g=T[1];console.log("cols, rows",k,g),a.a.publish("ssh-xterm-resize",{columns:k,rows:g,width:_.target.offsetWidth,height:_.target.offsetHeight}),f.resize(k,g);var F=p.Base64.decode("IA=="),P=p.Base64.decode("CBtbSw==");f.write(F),f.write(P)}}}catch(N){S.e(N)}finally{S.f()}});return v.observe(d),v}var u=3e4;re.a=function(f){var d=f.sshConfigData,v=f.sid,m=Object(L.useState)(null),S=Object(R.a)(m,2),C=S[0],_=S[1],y=d.link_url,T=d.password,k=d.port,g=Object(L.useRef)(),F=Object(L.useRef)(),P=Object(L.useRef)(!1);return Object(L.useEffect)(function(){if(g.current&&y){var N=new b.Terminal({fontSize:16,rendererType:"dom"});N.open(g.current),N.onData(function(j){F.current&&(F.current.readyState===1&&(F.current.send(JSON.stringify({tp:"client",data:j})),a.a.publish("on-operating-ssh")))}),N.write("Connecting..."),_(N);var W=s(N,g.current);return function(){N.dispose(),W.unobserve(g.current)}}},[y,g.current]),Object(L.useEffect)(function(){if(C&&y){function N(){var O=new WebSocket(y);F.current=O,O.onopen=function(){var z=C.element.parentElement;if(z){var te=z.offsetWidth,he=z.offsetHeight;console.log("init",{tp:"init",data:Object(G.a)(Object(G.a)({},d),{},{secret:T,width:te,height:he,rows:C.rows,columns:C.cols})}),O.send(JSON.stringify({tp:"init",data:Object(G.a)(Object(G.a)({},d),{},{secret:T,width:te,height:he,rows:C.rows,columns:C.cols})}))}C.focus()},O.onerror=function(z){console.log("------in socket error----",z,O,y)},O.onmessage=function(z){P.current||(C.write("\r"),setTimeout(function(){},1e3)),P.current=!0,console.log("event:",z);var te=p.Base64.decode(z.data.toString()),he=C._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",te,he,C),C.write(te)},O.onclose=function(z){W&&clearInterval(W),C.write(`\r
connection closed`)}}var W=setInterval(function(){F.current&&F.current.send(JSON.stringify({tp:"h"}))},u),j=a.a.subscribe("create-socket",function(O){v==O&&(F.current&&F.current.readyState===1?C.focus():N(),C.focus())}),A=a.a.subscribe("close-socket",function(O){v===O&&(F.current&&(F.current.close(),P.current=!1,C.clear()),F.current=null)}),K=a.a.subscribe("ssh-xterm-resize",function(O){F.current&&F.current.readyState===1&&F.current.send(JSON.stringify({tp:"resize",data:Object(G.a)({},O)}))}),U=a.a.subscribe("ssh-add-connect-time",function(){F.current&&F.current.readyState===1&&F.current.send(JSON.stringify({tp:"overtime"}))});return function(){A(),j(),K(),U(),F.current&&(F.current.close(),P.current=!1)}}},[C,y,k]),M.a.createElement("div",{ref:g,className:n.a["xterm-panel"]},y?null:M.a.createElement("p",{style:{color:"#fff"}},"\u6B63\u5728\u8FDE\u63A5\u547D\u4EE4\u884C\u670D\u52A1..."))}},ELLl:function(it,re,Q){(function(G){G(Q("VrN/"))})(function(G){var R={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},I=G.Pos;G.defineOption("autoCloseBrackets",!1,function(t,r,s){s&&s!=G.Init&&(t.removeKeyMap(M),t.state.closeBrackets=null),r&&(p(L(r,"pairs")),t.state.closeBrackets=r,t.addKeyMap(M))});function L(t,r){return r=="pairs"&&typeof t=="string"?t:typeof t=="object"&&t[r]!=null?t[r]:R[r]}var M={Backspace:i,Enter:c};function p(t){for(var r=0;r=0;f--){var v=u[f].head;t.replaceRange("",I(v.line,v.ch-1),I(v.line,v.ch+1),"+delete")}}function c(t){var r=b(t),s=r&&L(r,"explode");if(!s||t.getOption("disableInput"))return G.Pass;for(var u=t.listSelections(),f=0;f0;return{anchor:new I(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new I(t.head.line,t.head.ch+(r?1:-1))}}function h(t,r){var s=b(t);if(!s||t.getOption("disableInput"))return G.Pass;var u=L(s,"pairs"),f=u.indexOf(r);if(f==-1)return G.Pass;for(var d=L(s,"closeBefore"),v=L(s,"triples"),m=u.charAt(f+1)==r,S=t.listSelections(),C=f%2==0,_,y=0;y=0&&t.getRange(k,I(k.line,k.ch+3))==r+r+r?g="skipThree":g="skip";else if(m&&k.ch>1&&v.indexOf(r)>=0&&t.getRange(I(k.line,k.ch-2),k)==r+r){if(k.ch>2&&/\bstring/.test(t.getTokenTypeAt(I(k.line,k.ch-2))))return G.Pass;g="addFour"}else if(m){var P=k.ch==0?" ":t.getRange(I(k.line,k.ch-1),k);if(!G.isWordChar(F)&&P!=r&&!G.isWordChar(P))g="both";else return G.Pass}else if(C&&(F.length===0||/\s/.test(F)||d.indexOf(F)>-1))g="both";else return G.Pass;if(!_)_=g;else if(_!=g)return G.Pass}var N=f%2?u.charAt(f-1):r,W=f%2?r:u.charAt(f+1);t.operation(function(){if(_=="skip")t.execCommand("goCharRight");else if(_=="skipThree")for(var j=0;j<3;j++)t.execCommand("goCharRight");else if(_=="surround"){for(var A=t.getSelections(),j=0;j=48&&r.keyCode<=57)s=r.keyCode;else if(r.keyCode>=65&&r.keyCode<=90){var f=String.fromCharCode(r.keyCode);r.shiftKey?f=f.toUpperCase():f=f.toLowerCase(),s=f.charCodeAt()}else s=0;this._sendKeyEvent(s,u,!0)}},{key:"_handleKeyUp",value:function(r){(0,I.stopEvent)(r);var s=this._getKeyCode(r);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)),(p.isMac()||p.isIOS())&&s==="CapsLock"){this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(M.default.XK_Caps_Lock,"CapsLock",!1);return}this._sendKeyEvent(this._keyDownList[s],s,!1),p.isWindows()&&(s==="ShiftLeft"||s==="ShiftRight")&&("ShiftRight"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftRight,"ShiftRight",!1),"ShiftLeft"in this._keyDownList&&this._sendKeyEvent(this._keyDownList.ShiftLeft,"ShiftLeft",!1))}},{key:"_handleAltGrTimeout",value:function(){this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(M.default.XK_Control_L,"ControlLeft",!0)}},{key:"_allKeysUp",value:function(){R.Debug(">> Keyboard.allKeysUp");for(var r in this._keyDownList)this._sendKeyEvent(this._keyDownList[r],r,!1);R.Debug("<< Keyboard.allKeysUp")}},{key:"_checkAlt",value:function(r){if(r.skipCheckAlt)return;if(r.altKey)return;var s=this._target,u=this._keyDownList;["AltLeft","AltRight"].forEach(function(f){if(!(f in u))return;var d=new KeyboardEvent("keyup",{key:u[f],code:f});d.skipCheckAlt=!0,s.dispatchEvent(d)})}},{key:"grab",value:function(){if(this._target.addEventListener("keydown",this._eventHandlers.keydown),this._target.addEventListener("keyup",this._eventHandlers.keyup),this._target.addEventListener("keypress",this._eventHandlers.keypress),window.addEventListener("blur",this._eventHandlers.blur),p.isWindows()&&p.isFirefox()){var r=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(s){return document.addEventListener(s,r,{capture:!0,passive:!0})})}}},{key:"ungrab",value:function(){if(p.isWindows()&&p.isFirefox()){var r=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(s){return document.removeEventListener(s,r)})}this._target.removeEventListener("keydown",this._eventHandlers.keydown),this._target.removeEventListener("keyup",this._eventHandlers.keyup),this._target.removeEventListener("keypress",this._eventHandlers.keypress),window.removeEventListener("blur",this._eventHandlers.blur),this._allKeysUp()}}]),a}();re.default=n},GQ8N:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.toUnsigned32bit=G,re.toSigned32bit=R;function G(I){return I>>>0}function R(I){return I|0}},GdRQ:function(it,re,Q){"use strict";function G(C){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(y){return typeof y}:G=function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},G(C)}Object.defineProperty(re,"__esModule",{value:!0}),re.isMac=s,re.isWindows=u,re.isIOS=f,re.isSafari=d,re.isIE=v,re.isEdge=m,re.isFirefox=S,re.hasScrollbarGutter=re.supportsImageMetadata=re.supportsCursorURIs=re.dragThreshold=re.isTouchDevice=void 0;var R=L(Q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return I=function(){return C},C}function L(C){if(C&&C.__esModule)return C;if(C===null||G(C)!=="object"&&typeof C!="function")return{default:C};var _=I();if(_&&_.has(C))return _.get(C);var y={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in C)if(Object.prototype.hasOwnProperty.call(C,k)){var g=T?Object.getOwnPropertyDescriptor(C,k):null;g&&(g.get||g.set)?Object.defineProperty(y,k,g):y[k]=C[k]}return y.default=C,_&&_.set(C,y),y}var M="ontouchstart"in document.documentElement||document.ontouchstart!==void 0||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;re.isTouchDevice=M,window.addEventListener("touchstart",function C(){re.isTouchDevice=M=!0,window.removeEventListener("touchstart",C,!1)},!1);var p=10*(window.devicePixelRatio||1);re.dragThreshold=p;var E=!1;try{var b=document.createElement("canvas");b.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',b.style.cursor.indexOf("url")===0?(R.Info("Data URI scheme cursor supported"),E=!0):R.Warn("Data URI scheme cursor not supported")}catch(C){R.Error("Data URI scheme cursor test exception: "+C)}var i=E;re.supportsCursorURIs=i;var c=!1;try{new ImageData(new Uint8ClampedArray(4),1,1),c=!0}catch(C){}var o=c;re.supportsImageMetadata=o;var h=!0;try{var n=document.createElement("div");n.style.visibility="hidden",n.style.overflow="scroll",document.body.appendChild(n);var a=document.createElement("div");n.appendChild(a);var t=n.offsetWidth-a.offsetWidth;n.parentNode.removeChild(n),h=t!=0}catch(C){R.Error("Scrollbar test exception: "+C)}var r=h;re.hasScrollbarGutter=r;function s(){return navigator&&!!/mac/i.exec(navigator.platform)}function u(){return navigator&&!!/win/i.exec(navigator.platform)}function f(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))}function d(){return navigator&&navigator.userAgent.indexOf("Safari")!==-1&&navigator.userAgent.indexOf("Chrome")===-1}function v(){return navigator&&!!/trident/i.exec(navigator.userAgent)}function m(){return navigator&&!!/edge/i.exec(navigator.userAgent)}function S(){return navigator&&!!/firefox/i.exec(navigator.userAgent)}},Gytx:function(it,re){it.exports=function(G,R,I,L){var M=I?I.call(L,G,R):void 0;if(M!==void 0)return!!M;if(G===R)return!0;if(typeof G!="object"||!G||typeof R!="object"||!R)return!1;var p=Object.keys(G),E=Object.keys(R);if(p.length!==E.length)return!1;for(var b=Object.prototype.hasOwnProperty.bind(R),i=0;ithis.chunkSize&&(this.chunkSize=c,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=c;var o=(0,G.inflate)(this.strm,0);if(o<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=c)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}},{key:"reset",value:function(){(0,G.inflateReset)(this.strm)}}]),b}();re.default=E},IxHN:function(it,re,Q){"use strict";var G=Q("q1tI"),R=Q.n(G),I=Q("07cG"),L=Q.n(I);re.a=function(M){var p=M.message,E=M.className,b=M.children,i=M.style,c=i===void 0?{}:i;return R.a.createElement("div",{className:"".concat(L.a.idsRingWrapper," ").concat(E)},R.a.createElement("div",{className:L.a.ldsRing},R.a.createElement("div",null),R.a.createElement("div",null),R.a.createElement("div",null),R.a.createElement("div",null)),p?R.a.createElement("p",{style:c},p):null,b)}},J66h:function(it,re,Q){(function(G){var R,I;(function(L,M){it.exports=M(L)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof G!="undefined"?G:this,function(L){"use strict";L=L||{};var M=L.Base64,p="2.6.4",E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b=function(N){for(var W={},j=0,A=N.length;j>>6)+i(128|W&63):i(224|W>>>12&15)+i(128|W>>>6&63)+i(128|W&63)}else{var W=65536+(N.charCodeAt(0)-55296)*1024+(N.charCodeAt(1)-56320);return i(240|W>>>18&7)+i(128|W>>>12&63)+i(128|W>>>6&63)+i(128|W&63)}},o=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=function(N){return N.replace(o,c)},n=function(N){var W=[0,2,1][N.length%3],j=N.charCodeAt(0)<<16|(N.length>1?N.charCodeAt(1):0)<<8|(N.length>2?N.charCodeAt(2):0),A=[E.charAt(j>>>18),E.charAt(j>>>12&63),W>=2?"=":E.charAt(j>>>6&63),W>=1?"=":E.charAt(j&63)];return A.join("")},a=L.btoa&&typeof L.btoa=="function"?function(N){return L.btoa(N)}:function(N){if(N.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return N.replace(/[\s\S]{1,3}/g,n)},t=function(N){return a(h(String(N)))},r=function(N){return N.replace(/[+\/]/g,function(W){return W=="+"?"-":"_"}).replace(/=/g,"")},s=function(N,W){return W?r(t(N)):t(N)},u=function(N){return s(N,!0)},f;L.Uint8Array&&(f=function(N,W){for(var j="",A=0,K=N.length;A>>18)+E.charAt(te>>>12&63)+(typeof O!="undefined"?E.charAt(te>>>6&63):"=")+(typeof z!="undefined"?E.charAt(te&63):"=")}return W?r(j):j});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(N){switch(N.length){case 4:var W=(7&N.charCodeAt(0))<<18|(63&N.charCodeAt(1))<<12|(63&N.charCodeAt(2))<<6|63&N.charCodeAt(3),j=W-65536;return i((j>>>10)+55296)+i((j&1023)+56320);case 3:return i((15&N.charCodeAt(0))<<12|(63&N.charCodeAt(1))<<6|63&N.charCodeAt(2));default:return i((31&N.charCodeAt(0))<<6|63&N.charCodeAt(1))}},m=function(N){return N.replace(d,v)},S=function(N){var W=N.length,j=W%4,A=(W>0?b[N.charAt(0)]<<18:0)|(W>1?b[N.charAt(1)]<<12:0)|(W>2?b[N.charAt(2)]<<6:0)|(W>3?b[N.charAt(3)]:0),K=[i(A>>>16),i(A>>>8&255),i(A&255)];return K.length-=[0,0,2,1][j],K.join("")},C=L.atob&&typeof L.atob=="function"?function(N){return L.atob(N)}:function(N){return N.replace(/\S{1,4}/g,S)},_=function(N){return C(String(N).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(N){return m(C(N))},T=function(N){return String(N).replace(/[-_]/g,function(W){return W=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},k=function(N){return y(T(N))},g;L.Uint8Array&&(g=function(N){return Uint8Array.from(_(T(N)),function(W){return W.charCodeAt(0)})});var F=function(){var N=L.Base64;return L.Base64=M,N};if(L.Base64={VERSION:p,atob:_,btoa:a,fromBase64:k,toBase64:s,utob:h,encode:s,encodeURI:u,btou:m,decode:k,noConflict:F,fromUint8Array:f,toUint8Array:g},typeof Object.defineProperty=="function"){var P=function(N){return{value:N,enumerable:!1,writable:!0,configurable:!0}};L.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",P(function(){return k(this)})),Object.defineProperty(String.prototype,"toBase64",P(function(N){return s(this,N)})),Object.defineProperty(String.prototype,"toBase64URI",P(function(){return s(this,!0)}))}}return L.Meteor&&(Base64=L.Base64),it.exports?it.exports.Base64=L.Base64:!(R=[],I=function(){return L.Base64}.apply(re,R),I!==void 0&&(it.exports=I)),{Base64:L.Base64}})}).call(this,Q("IyRk"))},JSwD:function(it,re,Q){"use strict";function G(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(u){return typeof u}:G=function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},G(r)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=t;var R=L(Q("6BzB"));function I(){if(typeof WeakMap!="function")return null;var r=new WeakMap;return I=function(){return r},r}function L(r){if(r&&r.__esModule)return r;if(r===null||G(r)!=="object"&&typeof r!="function")return{default:r};var s=I();if(s&&s.has(r))return s.get(r);var u={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in r)if(Object.prototype.hasOwnProperty.call(r,d)){var v=f?Object.getOwnPropertyDescriptor(r,d):null;v&&(v.get||v.set)?Object.defineProperty(u,d,v):u[d]=r[d]}return u.default=r,s&&s.set(r,u),u}var M=15,p=852,E=592,b=0,i=1,c=2,o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],h=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],n=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function t(r,s,u,f,d,v,m,S){var C=S.bits,_=0,y=0,T=0,k=0,g=0,F=0,P=0,N=0,W=0,j=0,A,K,U,O,z,te=null,he=0,be,ze=new R.Buf16(M+1),Pe=new R.Buf16(M+1),Oe=null,Ke=0,je,Ae,we;for(_=0;_<=M;_++)ze[_]=0;for(y=0;y=1&&!(ze[k]!==0);k--);if(g>k&&(g=k),k===0)return d[v++]=1<<24|64<<16|0,d[v++]=1<<24|64<<16|0,S.bits=1,0;for(T=1;T0&&(r===b||k!==1))return-1;for(Pe[1]=0,_=1;_p||r===c&&W>E)return 1;for(;;){je=_-P,m[y]be?(Ae=Oe[Ke+m[y]],we=te[he+m[y]]):(Ae=32+64,we=0),A=1<<_-P,K=1<>P)+K]=je<<24|Ae<<16|we|0;while(K!==0);for(A=1<<_-1;j&A;)A>>=1;if(A!==0?(j&=A-1,j+=A):j=0,y++,--ze[_]===0){if(_===k)break;_=s[u+m[y]]}if(_>g&&(j&O)!==U){for(P===0&&(P=g),z+=T,F=_-P,N=1<p||r===c&&W>E)return 1;U=j&O,d[U]=g<<24|F<<16|z-v|0}}return j!==0&&(d[z+j]=_-P<<24|64<<16|0),S.bits=g,0}},JYp7:function(it,re,Q){"use strict";Q.d(re,"a",function(){return G});var G;(function(R){function I(d){return d&&typeof d=="object"&&typeof d[Symbol.iterator]=="function"}R.is=I;const L=Object.freeze([]);function M(){return L}R.empty=M;function*p(d){yield d}R.single=p;function E(d){return d||L}R.from=E;function b(d){return!d||d[Symbol.iterator]().next().done===!0}R.isEmpty=b;function i(d){return d[Symbol.iterator]().next().value}R.first=i;function c(d,v){for(const m of d)if(v(m))return!0;return!1}R.some=c;function o(d,v){for(const m of d)if(v(m))return m;return}R.find=o;function*h(d,v){for(const m of d)v(m)&&(yield m)}R.filter=h;function*n(d,v){let m=0;for(const S of d)yield v(S,m++)}R.map=n;function*a(...d){for(const v of d)for(const m of v)yield m}R.concat=a;function*t(d){for(const v of d)for(const m of v)yield m}R.concatNested=t;function r(d,v,m){let S=m;for(const C of d)S=v(S,C);return S}R.reduce=r;function*s(d,v,m=d.length){for(v<0&&(v+=d.length),m<0?m+=d.length:m>d.length&&(m=d.length);vS===C){const S=d[Symbol.iterator](),C=v[Symbol.iterator]();for(;;){const _=S.next(),y=C.next();if(_.done!==y.done)return!1;if(_.done)return!0;if(!m(_.value,y.value))return!1}}R.equals=f})(G||(G={}))},LCi9:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;function G(d,v){if(!(d instanceof v))throw new TypeError("Cannot call a class as a function")}function R(d,v){for(var m=0;m0&&Date.now()-this._tracked[0].started>t){this._state=L,this._ignored.push(m);return}if(this._waitingRelease){this._state=L,this._ignored.push(m);return}this._tracked.push({id:m,started:Date.now(),active:!0,firstX:S,firstY:C,lastX:S,lastY:C,angle:0});switch(this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=~(M|b|i),this._stopLongpressTimeout();break;case 3:this._state&=~(p|c|o);break;default:this._state=L}}},{key:"_touchMove",value:function(m,S,C){var _=this._tracked.find(function(P){return P.id===m});if(_===void 0)return;_.lastX=S,_.lastY=C;var y=S-_.firstX,T=C-_.firstY;if((_.firstX!==_.lastX||_.firstY!==_.lastY)&&(_.angle=Math.atan2(T,y)*180/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(y,T)n){var F=Math.abs(_.angle-k.angle);F=Math.abs((F+180)%360-180),F>a?this._state&=~c:this._state&=~o,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}},{key:"_touchEnd",value:function(m,S,C){if(this._ignored.indexOf(m)!==-1){this._ignored.splice(this._ignored.indexOf(m),1),this._ignored.length===0&&this._tracked.length===0&&(this._state=h,this._waitingRelease=!1);return}if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=L),!this._hasDetectedGesture()&&(this._state&=~(b|c|o),this._state&=~i,this._stopLongpressTimeout(),!this._waitingRelease)){this._releaseStart=Date.now(),this._waitingRelease=!0;switch(this._tracked.length){case 1:this._state&=~(p|E);break;case 2:this._state&=~(M|E);break}}if(this._waitingRelease){Date.now()-this._releaseStart>t&&(this._state=L),this._tracked.some(function(T){return Date.now()-T.started>r})&&(this._state=L);var _=this._tracked.find(function(T){return T.id===m});if(_.active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(this._state!==L)return}this._hasDetectedGesture()&&this._pushEvent("gestureend");for(var y=0;y1&&arguments[1]!==void 0?arguments[1]:1,Ee=Se.length,ee=0;ee1&&arguments[1]!==void 0?arguments[1]:!1;return Object(C.a)(O).map(function(te,he){if(!M.isValidElement(te)||!te.type)return null;var be=te.type.isSelectOptGroup,ze=te.key,Pe=te.props,Oe=Pe.children,Ke=Object(E.a)(Pe,["children"]);return z||!be?_(te):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(ze===null?he:ze,"__"),label:ze},Ke),{},{options:y(Oe)})}).filter(function(te){return te})}var T=Q("2Qr1"),k=Q("qNPg"),g=Q("U8pU"),F=Q("Kwbf"),P=Q("WKfj");function N(O){var z=O.mode,te=O.options,he=O.children,be=O.backfill,ze=O.allowClear,Pe=O.placeholder,Oe=O.getInputElement,Ke=O.showSearch,je=O.onSearch,Ae=O.defaultOpen,we=O.autoFocus,ce=O.labelInValue,Te=O.value,me=O.inputValue,Xe=O.optionLabelProp,Ze=z==="multiple"||z==="tags",We=Ke!==void 0?Ke:Ze||z==="combobox",qe=te||y(he);if(Object(F.a)(z!=="tags"||qe.every(function(xe){return!xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var et=qe.some(function(xe){return xe.options?xe.options.some(function(Se){return typeof("value"in Se?Se.value:Se.key)=="number"}):typeof("value"in xe?xe.value:xe.key)=="number"});Object(F.a)(!et,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(F.a)(z!=="combobox"||!Xe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(F.a)(z==="combobox"||!be,"`backfill` only works with `combobox` mode."),Object(F.a)(z==="combobox"||!Oe,"`getInputElement` only work with `combobox` mode."),Object(F.b)(z!=="combobox"||!Oe||!ze||!Pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),je&&!We&&z!=="combobox"&&z!=="tags"&&Object(F.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(F.b)(!Ae||we,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Te!=null){var pe=Object(P.d)(Te);Object(F.a)(!ce||pe.every(function(xe){return Object(g.a)(xe)==="object"&&("key"in xe||"value"in xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(F.a)(!Ze||Array.isArray(Te),"`value` should be array when `mode` is `multiple` or `tags`")}if(he){var ve=null;Object(C.a)(he).some(function(xe){if(!M.isValidElement(xe)||!xe.type)return!1;var Se=xe.type;if(Se.isSelectOption)return!1;if(Se.isSelectOptGroup){var Le=Object(C.a)(xe.props.children).every(function(ne){return!M.isValidElement(ne)||!xe.type||ne.type.isSelectOption?!0:(ve=ne.type,!1)});return!Le}return ve=Se,!0}),ve&&Object(F.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ve.displayName||ve.name||ve,"`.")),Object(F.a)(me===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var W=N,j=Object(k.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:y,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:W,fillOptionsWithMissingValue:T.a}),A=function(O){Object(I.a)(te,O);var z=Object(L.a)(te);function te(){var he;return Object(G.a)(this,te),he=z.apply(this,arguments),he.selectRef=M.createRef(),he.focus=function(){he.selectRef.current.focus()},he.blur=function(){he.selectRef.current.blur()},he}return Object(R.a)(te,[{key:"render",value:function(){return M.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),te}(M.Component);A.Option=d,A.OptGroup=m;var K=A,U=re.c=K},Lmeb:function(it,re,Q){},Lo0S:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.initLogging=p,re.getLogging=E,re.Error=re.Warn=re.Info=re.Debug=void 0;var G="warn",R=function(){};re.Debug=R;var I=function(){};re.Info=I;var L=function(){};re.Warn=L;var M=function(){};re.Error=M;function p(b){if(typeof b=="undefined"?b=G:G=b,re.Debug=R=re.Info=I=re.Warn=L=re.Error=M=function(){},typeof window.console!="undefined")switch(b){case"debug":re.Debug=R=console.debug.bind(window.console);case"info":re.Info=I=console.info.bind(window.console);case"warn":re.Warn=L=console.warn.bind(window.console);case"error":re.Error=M=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+b+"'")}}function E(){return G}p()},M8RZ:function(it,re,Q){"use strict";Q.d(re,"a",function(){return i});var G=Q("fWQN"),R=Q("mtLc"),I=Q("yKVA"),L=Q("879j"),M=Q("q1tI"),p=Q.n(M),E=Q("i8i4"),b=Q.n(E),i=function(c){Object(I.a)(h,c);var o=Object(L.a)(h);function h(n){var a;Object(G.a)(this,h),a=o.call(this,n);var t=window.document;return a.node=t.createElement("div"),t.body.appendChild(a.node),a}return Object(R.a)(h,[{key:"render",value:function(){var a=this.props.children;return Object(E.createPortal)(a,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),h}(p.a.Component)},MI8n:function(it,re,Q){"use strict";Q.d(re,"c",function(){return M}),Q.d(re,"b",function(){return i}),Q.d(re,"e",function(){return c}),Q.d(re,"a",function(){return o}),Q.d(re,"d",function(){return h}),Q.d(re,"f",function(){return n});var G=Q("/cxE"),R=Q("pmY6"),I=Q("24hK"),L=Q("5Y4S"),M;(function(a){a.None=()=>R.a.None;function t(N){return(W,j=null,A)=>{let K=!1,U;return U=N(O=>K?void 0:(U?U.dispose():K=!0,W.call(j,O)),null,A),K&&U.dispose(),U}}a.once=t;function r(N,W){return m((j,A=null,K)=>N(U=>j.call(A,W(U)),null,K))}a.map=r;function s(N,W){return m((j,A=null,K)=>N(U=>{W(U),j.call(A,U)},null,K))}a.forEach=s;function u(N,W){return m((j,A=null,K)=>N(U=>W(U)&&j.call(A,U),null,K))}a.filter=u;function f(N){return N}a.signal=f;function d(...N){return(W,j=null,A)=>Object(R.e)(...N.map(K=>K(U=>W.call(j,U),null,A)))}a.any=d;function v(N,W,j){let A=j;return r(N,K=>(A=W(A,K),A))}a.reduce=v;function m(N){let W;const j=new i({onFirstListenerAdd(){W=N(j.fire,j)},onLastListenerRemove(){W.dispose()}});return j.event}function S(N,W,j=100,A=!1,K){let U,O,z,te=0;const he=new i({leakWarningThreshold:K,onFirstListenerAdd(){U=N(be=>{te++,O=W(O,be),A&&!z&&(he.fire(O),O=void 0),clearTimeout(z),z=setTimeout(()=>{const ze=O;O=void 0,z=void 0,(!A||te>1)&&he.fire(ze),te=0},j)})},onLastListenerRemove(){U.dispose()}});return he.event}a.debounce=S;function C(N,W=(j,A)=>j===A){let j=!0,A;return u(N,K=>{const U=j||!W(K,A);return j=!1,A=K,U})}a.latch=C;function _(N,W){return[a.filter(N,W),a.filter(N,j=>!W(j))]}a.split=_;function y(N,W=!1,j=[]){let A=j.slice(),K=N(z=>{A?A.push(z):O.fire(z)});const U=()=>{A&&A.forEach(z=>O.fire(z)),A=null},O=new i({onFirstListenerAdd(){K||(K=N(z=>O.fire(z)))},onFirstListenerDidAdd(){A&&(W?setTimeout(U):U())},onLastListenerRemove(){K&&K.dispose(),K=null}});return O.event}a.buffer=y;class T{constructor(N){this.event=N}map(N){return new T(r(this.event,N))}forEach(N){return new T(s(this.event,N))}filter(N){return new T(u(this.event,N))}reduce(N,W){return new T(v(this.event,N,W))}latch(){return new T(C(this.event))}debounce(N,W=100,j=!1,A){return new T(S(this.event,N,W,j,A))}on(N,W,j){return this.event(N,W,j)}once(N,W,j){return t(this.event)(N,W,j)}}function k(N){return new T(N)}a.chain=k;function g(N,W,j=A=>A){const A=(...z)=>O.fire(j(...z)),K=()=>N.on(W,A),U=()=>N.removeListener(W,A),O=new i({onFirstListenerAdd:K,onLastListenerRemove:U});return O.event}a.fromNodeEventEmitter=g;function F(N,W,j=A=>A){const A=(...z)=>O.fire(j(...z)),K=()=>N.addEventListener(W,A),U=()=>N.removeEventListener(W,A),O=new i({onFirstListenerAdd:K,onLastListenerRemove:U});return O.event}a.fromDOMEventEmitter=F;function P(N){return new Promise(W=>t(N)(W))}a.toPromise=P})(M||(M={}));class p{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${p._idPool++}`}start(a){this._stopWatch=new L.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}p._idPool=0;let E=-1;class b{constructor(a,t=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=t,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let t=E;if(typeof this.customThreshold=="number"&&(t=this.customThreshold),t<=0||a{const u=this._stacks.get(r)||0;this._stacks.set(r,u-1)}}}class i{constructor(a){var t;this._disposed=!1,this._options=a,this._leakageMon=E>0?new b(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((t=this._options)===null||t===void 0?void 0:t._profName)?new p(this._options._profName):void 0}get event(){return this._event||(this._event=(a,t,r)=>{var s;this._listeners||(this._listeners=new I.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const f=this._listeners.push(t?[a,t]:a);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,t);const d=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),v=Object(R.i)(()=>{if(d&&d(),!this._disposed&&(f(),this._options&&this._options.onLastListenerRemove)){const m=this._listeners&&!this._listeners.isEmpty();m||this._options.onLastListenerRemove(this)}});return r instanceof R.b?r.add(v):Array.isArray(r)&&r.push(v),v}),this._event}fire(a){var t,r;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new I.a);for(let s of this._listeners)this._deliveryQueue.push([s,a]);for((t=this._perfMon)===null||t===void 0||t.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,u]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,u):s[0].call(s[1],u)}catch(f){Object(G.f)(f)}}(r=this._perfMon)===null||r===void 0||r.stop()}}dispose(){var a,t,r,s,u;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(t=this._deliveryQueue)===null||t===void 0||t.clear(),(s=(r=this._options)===null||r===void 0?void 0:r.onLastListenerRemove)===null||s===void 0||s.call(r),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class c extends i{constructor(a){super(a);this._isPaused=0,this._eventQueue=new I.a,this._mergeFn=a==null?void 0:a.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const a=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(a))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(a){this._listeners&&(this._isPaused!==0?this._eventQueue.push(a):super.fire(a))}}class o extends c{constructor(a){var t;super(a);this._delay=(t=a.delay)!==null&&t!==void 0?t:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class h{constructor(){this.buffers=[]}wrapEvent(a){return(t,r,s)=>a(u=>{const f=this.buffers[this.buffers.length-1];f?f.push(()=>t.call(r,u)):t.call(r,u)},void 0,s)}bufferEvents(a){const t=[];this.buffers.push(t);const r=a();return this.buffers.pop(),t.forEach(s=>s()),r}}class n{constructor(){this.listening=!1,this.inputEvent=M.None,this.inputEventListener=R.a.None,this.emitter=new i({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(a){this.inputEvent=a,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=a(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(it,re,Q){"use strict";(function(G,R){Q.d(re,"b",function(){return r}),Q.d(re,"i",function(){return d}),Q.d(re,"f",function(){return v}),Q.d(re,"d",function(){return m}),Q.d(re,"g",function(){return S}),Q.d(re,"h",function(){return C}),Q.d(re,"c",function(){return _}),Q.d(re,"k",function(){return y}),Q.d(re,"j",function(){return T}),Q.d(re,"a",function(){return k}),Q.d(re,"e",function(){return P});var I;const L="en";let M=!1,p=!1,E=!1,b=!1,i=!1,c=!1,o=!1,h,n=L,a,t;const r=typeof self=="object"?self:typeof G=="object"?G:{};let s;typeof r.vscode!="undefined"&&typeof r.vscode.process!="undefined"?s=r.vscode.process:typeof R!="undefined"&&(s=R);const u=typeof((I=s==null?void 0:s.versions)===null||I===void 0?void 0:I.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!u)t=navigator.userAgent,M=t.indexOf("Windows")>=0,p=t.indexOf("Macintosh")>=0,o=(t.indexOf("Macintosh")>=0||t.indexOf("iPad")>=0||t.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,E=t.indexOf("Linux")>=0,c=!0,h=navigator.language,n=h;else if(typeof s=="object"){M=s.platform==="win32",p=s.platform==="darwin",E=s.platform==="linux",b=E&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,h=L,n=L;const N=s.env.VSCODE_NLS_CONFIG;if(N)try{const W=JSON.parse(N),j=W.availableLanguages["*"];h=W.locale,n=j||L,a=W._translationsConfigFile}catch(W){}i=!0}else console.error("Unable to resolve platform.");let f=0;p?f=1:M?f=3:E&&(f=2);const d=M,v=p,m=E,S=i,C=c,_=o,y=t,T=function(){if(r.setImmediate)return r.setImmediate.bind(r);if(typeof r.postMessage=="function"&&!r.importScripts){let j=[];r.addEventListener("message",K=>{if(K.data&&K.data.vscodeSetImmediateId)for(let U=0,O=j.length;U{const U=++A;j.push({id:U,callback:K}),r.postMessage({vscodeSetImmediateId:U},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const W=Promise.resolve();return j=>W.then(j)}(),k=p||o?2:M?1:3;let g=!0,F=!1;function P(){if(!F){F=!0;const N=new Uint8Array(2);N[0]=1,N[1]=2;const W=new Uint16Array(N.buffer);g=W[0]===(2<<8)+1}return g}}).call(this,Q("IyRk"),Q("Q2Ig"))},MZdM:function(it,re,Q){"use strict";function G(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(t){return typeof t}:G=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(n)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var R=b(Q("Lo0S")),I=p(Q("N/zr")),L=Q("GdRQ"),M=Q("GQ8N");function p(n){return n&&n.__esModule?n:{default:n}}function E(){if(typeof WeakMap!="function")return null;var n=new WeakMap;return E=function(){return n},n}function b(n){if(n&&n.__esModule)return n;if(n===null||G(n)!=="object"&&typeof n!="function")return{default:n};var a=E();if(a&&a.has(n))return a.get(n);var t={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s)){var u=r?Object.getOwnPropertyDescriptor(n,s):null;u&&(u.get||u.set)?Object.defineProperty(t,s,u):t[s]=n[s]}return t.default=n,a&&a.set(n,t),t}function i(n,a){if(!(n instanceof a))throw new TypeError("Cannot call a class as a function")}function c(n,a){for(var t=0;t> Display.constructor"),this._target=a,!this._target)throw new Error("Target must be set");if(typeof this._target=="string")throw new Error("target must be a DOM element");if(!this._target.getContext)throw new Error("no getContext method");if(this._targetCtx=this._target.getContext("2d"),this._viewportLoc={x:0,y:0,w:this._target.width,h:this._target.height},this._backbuffer=document.createElement("canvas"),this._drawCtx=this._backbuffer.getContext("2d"),this._damageBounds={left:0,top:0,right:this._backbuffer.width,bottom:this._backbuffer.height},R.Debug("User Agent: "+navigator.userAgent),!("createImageData"in this._drawCtx))throw new Error("Canvas does not support createImageData");this._tile16x16=this._drawCtx.createImageData(16,16),R.Debug("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=function(){}}return o(n,[{key:"viewportChangePos",value:function(t,r){var s=this._viewportLoc;t=Math.floor(t),r=Math.floor(r),this._clipViewport||(t=-s.w,r=-s.h);var u=s.x+s.w-1,f=s.y+s.h-1;if(t<0&&s.x+t<0&&(t=-s.x),u+t>=this._fbWidth&&(t-=u+t-this._fbWidth+1),s.y+r<0&&(r=-s.y),f+r>=this._fbHeight&&(r-=f+r-this._fbHeight+1),t===0&&r===0)return;R.Debug("viewportChange deltaX: "+t+", deltaY: "+r),s.x+=t,s.y+=r,this._damage(s.x,s.y,s.w,s.h),this.flip()}},{key:"viewportChangeSize",value:function(t,r){(!this._clipViewport||typeof t=="undefined"||typeof r=="undefined")&&(R.Debug("Setting viewport to full display region"),t=this._fbWidth,r=this._fbHeight),t=Math.floor(t),r=Math.floor(r),t>this._fbWidth&&(t=this._fbWidth),r>this._fbHeight&&(r=this._fbHeight);var s=this._viewportLoc;if(s.w!==t||s.h!==r){s.w=t,s.h=r;var u=this._target;u.width=t,u.height=r,this.viewportChangePos(0,0),this._damage(s.x,s.y,s.w,s.h),this.flip(),this._rescale(this._scale)}}},{key:"absX",value:function(t){return this._scale===0?0:(0,M.toSigned32bit)(t/this._scale+this._viewportLoc.x)}},{key:"absY",value:function(t){return this._scale===0?0:(0,M.toSigned32bit)(t/this._scale+this._viewportLoc.y)}},{key:"resize",value:function(t,r){this._prevDrawStyle="",this._fbWidth=t,this._fbHeight=r;var s=this._backbuffer;if(s.width!==t||s.height!==r){var u=null;s.width>0&&s.height>0&&(u=this._drawCtx.getImageData(0,0,s.width,s.height)),s.width!==t&&(s.width=t),s.height!==r&&(s.height=r),u&&this._drawCtx.putImageData(u,0,0)}var f=this._viewportLoc;this.viewportChangeSize(f.w,f.h),this.viewportChangePos(0,0)}},{key:"_damage",value:function(t,r,s,u){tthis._damageBounds.right&&(this._damageBounds.right=t+s),r+u>this._damageBounds.bottom&&(this._damageBounds.bottom=r+u)}},{key:"flip",value:function(t){if(this._renderQ.length!==0&&!t)this._renderQPush({type:"flip"});else{var r=this._damageBounds.left,s=this._damageBounds.top,u=this._damageBounds.right-r,f=this._damageBounds.bottom-s,d=r-this._viewportLoc.x,v=s-this._viewportLoc.y;d<0&&(u+=d,r-=d,d=0),v<0&&(f+=v,s-=v,v=0),d+u>this._viewportLoc.w&&(u=this._viewportLoc.w-d),v+f>this._viewportLoc.h&&(f=this._viewportLoc.h-v),u>0&&f>0&&this._targetCtx.drawImage(this._backbuffer,r,s,u,f,d,v,u,f),this._damageBounds.left=this._damageBounds.top=65535,this._damageBounds.right=this._damageBounds.bottom=0}}},{key:"pending",value:function(){return this._renderQ.length>0}},{key:"flush",value:function(){this._renderQ.length===0?this.onflush():this._flushing=!0}},{key:"fillRect",value:function(t,r,s,u,f,d){this._renderQ.length!==0&&!d?this._renderQPush({type:"fill",x:t,y:r,width:s,height:u,color:f}):(this._setFillColor(f),this._drawCtx.fillRect(t,r,s,u),this._damage(t,r,s,u))}},{key:"copyImage",value:function(t,r,s,u,f,d,v){this._renderQ.length!==0&&!v?this._renderQPush({type:"copy",oldX:t,oldY:r,x:s,y:u,width:f,height:d}):(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,t,r,f,d,s,u,f,d),this._damage(s,u,f,d))}},{key:"imageRect",value:function(t,r,s,u,f,d){if(s===0||u===0)return;var v=new Image;v.src="data: "+f+";base64,"+I.default.encode(d),this._renderQPush({type:"img",img:v,x:t,y:r,width:s,height:u})}},{key:"startTile",value:function(t,r,s,u,f){this._tileX=t,this._tileY=r,s===16&&u===16?this._tile=this._tile16x16:this._tile=this._drawCtx.createImageData(s,u);for(var d=f[2],v=f[1],m=f[0],S=this._tile.data,C=0;C=f?s=t/u.w:s=r/u.h}this._rescale(s)}},{key:"_rescale",value:function(t){this._scale=t;var r=this._viewportLoc,s=t*r.w+"px",u=t*r.h+"px";(this._target.style.width!==s||this._target.style.height!==u)&&(this._target.style.width=s,this._target.style.height=u)}},{key:"_setFillColor",value:function(t){var r="rgb("+t[2]+","+t[1]+","+t[0]+")";r!==this._prevDrawStyle&&(this._drawCtx.fillStyle=r,this._prevDrawStyle=r)}},{key:"_rgbImageData",value:function(t,r,s,u,f,d){for(var v=this._drawCtx.createImageData(s,u),m=v.data,S=0,C=d;S0;){var r=this._renderQ[0];switch(r.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(r.oldX,r.oldY,r.x,r.y,r.width,r.height,!0);break;case"fill":this.fillRect(r.x,r.y,r.width,r.height,r.color,!0);break;case"blit":this.blitImage(r.x,r.y,r.width,r.height,r.data,0,!0);break;case"blitRgb":this.blitRgbImage(r.x,r.y,r.width,r.height,r.data,0,!0);break;case"blitRgbx":this.blitRgbxImage(r.x,r.y,r.width,r.height,r.data,0,!0);break;case"img":if(r.img.complete&&r.img.width!==0&&r.img.height!==0){if(r.img.width!==r.width||r.img.height!==r.height){R.Error("Decoded image has incorrect dimensions. Got "+r.img.width+"x"+r.img.height+". Expected "+r.width+"x"+r.height+".");return}this.drawImage(r.img,r.x,r.y)}else r.img._noVNCDisplay=this,r.img.addEventListener("load",this._resumeRenderQ),t=!1;break}t&&this._renderQ.shift()}this._renderQ.length===0&&this._flushing&&(this._flushing=!1,this.onflush())}},{key:"scale",get:function(){return this._scale},set:function(t){this._rescale(t)}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(t){this._clipViewport=t;var r=this._viewportLoc;this.viewportChangeSize(r.w,r.h),this.viewportChangePos(0,0)}},{key:"width",get:function(){return this._fbWidth}},{key:"height",get:function(){return this._fbHeight}}]),n}();re.default=h},Mmt2:function(it,re,Q){"use strict";function G(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(n){return typeof n}:G=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},G(o)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var R=L(Q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var o=new WeakMap;return I=function(){return o},o}function L(o){if(o&&o.__esModule)return o;if(o===null||G(o)!=="object"&&typeof o!="function")return{default:o};var h=I();if(h&&h.has(o))return h.get(o);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var t in o)if(Object.prototype.hasOwnProperty.call(o,t)){var r=a?Object.getOwnPropertyDescriptor(o,t):null;r&&(r.get||r.set)?Object.defineProperty(n,t,r):n[t]=o[t]}return n.default=o,h&&h.set(o,n),n}function M(o,h){if(!(o instanceof h))throw new TypeError("Cannot call a class as a function")}function p(o,h){for(var n=0;n=0;t--)a+=this._rQ[this._rQi++]<1&&arguments[1]!==void 0?arguments[1]:this.rQlen;return new Uint8Array(this._rQ.buffer,this._rQi+n,a-n)}},{key:"rQwait",value:function(n,a,t){if(this.rQlen0&&this._websocket.readyState===WebSocket.OPEN&&(this._websocket.send(this._encodeMessage()),this._sQlen=0)}},{key:"send",value:function(n){this._sQ.set(n,this._sQlen),this._sQlen+=n.length,this.flush()}},{key:"sendString",value:function(n){this.send(n.split("").map(function(a){return a.charCodeAt(0)}))}},{key:"off",value:function(n){this._eventHandlers[n]=function(){}}},{key:"on",value:function(n,a){this._eventHandlers[n]=a}},{key:"_allocateBuffers",value:function(){this._rQ=new Uint8Array(this._rQbufferSize),this._sQ=new Uint8Array(this._sQbufferSize)}},{key:"init",value:function(){this._allocateBuffers(),this._rQi=0,this._websocket=null}},{key:"open",value:function(n,a){var t=this;this.init(),this._websocket=new WebSocket(n,a),this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=function(){R.Debug(">> WebSock.onopen"),t._websocket.protocol&&R.Info("Server choose sub-protocol: "+t._websocket.protocol),t._eventHandlers.open(),R.Debug("<< WebSock.onopen")},this._websocket.onclose=function(r){R.Debug(">> WebSock.onclose"),t._eventHandlers.close(r),R.Debug("<< WebSock.onclose")},this._websocket.onerror=function(r){R.Debug(">> WebSock.onerror: "+r),t._eventHandlers.error(r),R.Debug("<< WebSock.onerror: "+r)}}},{key:"close",value:function(){this._websocket&&((this._websocket.readyState===WebSocket.OPEN||this._websocket.readyState===WebSocket.CONNECTING)&&(R.Info("Closing WebSocket connection"),this._websocket.close()),this._websocket.onmessage=function(){})}},{key:"_encodeMessage",value:function(){return new Uint8Array(this._sQ.buffer,0,this._sQlen)}},{key:"_expandCompactRQ",value:function(n){var a=(this._rQlen-this._rQi+n)*8,t=this._rQbufferSizei&&(this._rQbufferSize=i,this._rQbufferSize-this.rQlenthis._rQbufferSize-this._rQlen&&this._expandCompactRQ(a.length),this._rQ.set(a,this._rQlen),this._rQlen+=a.length}},{key:"_recvMessage",value:function(n){this._DecodeMessage(n.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):R.Debug("Ignoring empty message")}},{key:"sQ",get:function(){return this._sQ}},{key:"rQ",get:function(){return this._rQ}},{key:"rQi",get:function(){return this._rQi},set:function(n){this._rQi=n}},{key:"rQlen",get:function(){return this._rQlen-this._rQi}}]),o}();re.default=c},"N/zr":function(it,re,Q){"use strict";function G(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?G=function(b){return typeof b}:G=function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},G(p)}Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var R=L(Q("Lo0S"));function I(){if(typeof WeakMap!="function")return null;var p=new WeakMap;return I=function(){return p},p}function L(p){if(p&&p.__esModule)return p;if(p===null||G(p)!=="object"&&typeof p!="function")return{default:p};var E=I();if(E&&E.has(p))return E.get(p);var b={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in p)if(Object.prototype.hasOwnProperty.call(p,c)){var o=i?Object.getOwnPropertyDescriptor(p,c):null;o&&(o.get||o.set)?Object.defineProperty(b,c,o):b[c]=p[c]}return b.default=p,E&&E.set(p,b),b}var M={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode:function(E){"use strict";for(var b="",i=E.length,c=i%3,o=0;o>2],b+=this.toBase64Table[((E[o]&3)<<4)+(E[o+1]>>4)],b+=this.toBase64Table[((E[o+1]&15)<<2)+(E[o+2]>>6)],b+=this.toBase64Table[E[o+2]&63];var h=i-c;return c===2?(b+=this.toBase64Table[E[h]>>2],b+=this.toBase64Table[((E[h]&3)<<4)+(E[h+1]>>4)],b+=this.toBase64Table[(E[h+1]&15)<<2],b+=this.toBase64Table[64]):c===1&&(b+=this.toBase64Table[E[h]>>2],b+=this.toBase64Table[(E[h]&3)<<4],b+=this.toBase64Table[64],b+=this.toBase64Table[64]),b},toBinaryTable:[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],decode:function(E){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=E.indexOf("=")-b;i<0&&(i=E.length-b);for(var c=(i>>2)*3+Math.floor(i%4/1.5),o=new Array(c),h=0,n=0,a=0,t=b;t=8&&(h-=8,s||(o[a++]=n>>h&255),n&=(1<=ve.length?xe:ve[Le]})}function L(pe){return pe.replace(/[<>&]/g,function(ve){switch(ve){case"<":return"<";case">":return">";case"&":return"&";default:return ve}})}function M(pe){return pe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function p(pe,ve=" "){const xe=E(pe,ve);return b(xe,ve)}function E(pe,ve){if(!pe||!ve)return pe;const xe=ve.length;if(xe===0||pe.length===0)return pe;let Se=0;for(;pe.indexOf(ve,Se)===Se;)Se=Se+xe;return pe.substring(Se)}function b(pe,ve){if(!pe||!ve)return pe;const xe=ve.length,Se=pe.length;if(xe===0||Se===0)return pe;let Le=Se,ne=-1;for(;!(ne=pe.lastIndexOf(ve,Le-1),ne===-1||ne+xe!==Le);){if(ne===0)return"";Le=ne}return pe.substring(0,Le)}function i(pe){return pe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function c(pe){return pe.replace(/\*/g,"")}function o(pe,ve,xe={}){if(!pe)throw new Error("Cannot create regex from empty string");ve||(pe=M(pe)),xe.wholeWord&&(/\B/.test(pe.charAt(0))||(pe="\\b"+pe),/\B/.test(pe.charAt(pe.length-1))||(pe=pe+"\\b"));let Se="";return xe.global&&(Se+="g"),xe.matchCase||(Se+="i"),xe.multiline&&(Se+="m"),xe.unicode&&(Se+="u"),new RegExp(pe,Se)}function h(pe){if(pe.source==="^"||pe.source==="^$"||pe.source==="$"||pe.source==="^\\s*$")return!1;const ve=pe.exec("");return!!(ve&&pe.lastIndex===0)}function n(pe){return(pe.global?"g":"")+(pe.ignoreCase?"i":"")+(pe.multiline?"m":"")+(pe.unicode?"u":"")}function a(pe){return pe.split(/\r\n|\r|\n/)}function t(pe){for(let ve=0,xe=pe.length;ve=0;xe--){const Se=pe.charCodeAt(xe);if(Se!==32&&Se!==9)return xe}return-1}function u(pe,ve){return peve?1:0}function f(pe,ve,xe=0,Se=pe.length,Le=0,ne=ve.length){for(;xeQe)return 1}const ye=Se-xe,se=ne-Le;return yese?1:0}function d(pe,ve){return v(pe,ve,0,pe.length,0,ve.length)}function v(pe,ve,xe=0,Se=pe.length,Le=0,ne=ve.length){for(;xe=128||Qe>=128)return f(pe.toLowerCase(),ve.toLowerCase(),xe,Se,Le,ne);m(Ne)&&(Ne-=32),m(Qe)&&(Qe-=32);const Je=Ne-Qe;if(Je===0)continue;return Je}const ye=Se-xe,se=ne-Le;return yese?1:0}function m(pe){return pe>=97&&pe<=122}function S(pe){return pe>=65&&pe<=90}function C(pe,ve){return pe.length===ve.length&&v(pe,ve)===0}function _(pe,ve){const xe=ve.length;return ve.length>pe.length?!1:v(pe,ve,0,xe)===0}function y(pe,ve){let xe,Se=Math.min(pe.length,ve.length);for(xe=0;xe1){const Se=pe.charCodeAt(ve-2);if(k(Se))return F(Se,xe)}return xe}function W(pe,ve){const xe=me.getInstance(),Se=ve,Le=pe.length,ne=P(pe,Le,ve);ve+=ne>=65536?2:1;let ye=xe.getGraphemeBreakType(ne);for(;ve=65536?2:1,ye=Ne}return ve-Se}function j(pe,ve){const xe=me.getInstance(),Se=ve,Le=N(pe,ve);ve-=Le>=65536?2:1;let ne=xe.getGraphemeBreakType(Le);for(;ve>0;){const ye=N(pe,ve),se=xe.getGraphemeBreakType(ye);if(Te(se,ne))break;ve-=ye>=65536?2:1,ne=se}return Se-ve}const A=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function K(pe){return A.test(pe)}const U=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function O(pe){return U.test(pe)}const z=/^[\t\n\r\x20-\x7E]*$/;function te(pe){return z.test(pe)}const he=/[\u2028\u2029]/;function be(pe){return he.test(pe)}function ze(pe){for(let ve=0,xe=pe.length;ve=11904&&pe<=55215||pe>=63744&&pe<=64255||pe>=65281&&pe<=65374}function Oe(pe){return pe>=127462&&pe<=127487||pe===8986||pe===8987||pe===9200||pe===9203||pe>=9728&&pe<=10175||pe===11088||pe===11093||pe>=127744&&pe<=128591||pe>=128640&&pe<=128764||pe>=128992&&pe<=129003||pe>=129280&&pe<=129535||pe>=129648&&pe<=129750}const Ke=String.fromCharCode(65279);function je(pe){return!!(pe&&pe.length>0&&pe.charCodeAt(0)===65279)}function Ae(pe,ve=!1){return pe?(ve&&(pe=pe.replace(/\\./g,"")),pe.toLowerCase()!==pe):!1}function we(pe){const ve=90-65+1;return pe=pe%(2*ve),peve[3*Se+1])Se=2*Se+1;else return ve[3*Se+2];return 0}}me._INSTANCE=null;function Xe(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ze(pe,ve){if(pe===0)return 0;const xe=We(pe,ve);if(xe!==void 0)return xe;const Se=N(ve,pe);return pe-=qe(Se),pe}function We(pe,ve){let xe=N(ve,pe);for(pe-=qe(xe);et(xe)||xe===65039||xe===8419;){if(pe===0)return;xe=N(ve,pe),pe-=qe(xe)}if(!Oe(xe))return;if(pe>=0){const Se=N(ve,pe);Se===8205&&(pe-=qe(Se))}return pe}function qe(pe){return pe>=65536?2:1}function et(pe){return 127995<=pe&&pe<=127999}},NBmB:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.encodingName=R,re.encodings=void 0;var G={encodingRaw:0,encodingCopyRect:1,encodingRRE:2,encodingHextile:5,encodingTight:7,encodingTightPNG:-260,pseudoEncodingQualityLevel9:-23,pseudoEncodingQualityLevel0:-32,pseudoEncodingDesktopSize:-223,pseudoEncodingLastRect:-224,pseudoEncodingCursor:-239,pseudoEncodingQEMUExtendedKeyEvent:-258,pseudoEncodingDesktopName:-307,pseudoEncodingExtendedDesktopSize:-308,pseudoEncodingXvp:-309,pseudoEncodingFence:-312,pseudoEncodingContinuousUpdates:-313,pseudoEncodingCompressLevel9:-247,pseudoEncodingCompressLevel0:-256,pseudoEncodingVMwareCursor:1464686180,pseudoEncodingExtendedClipboard:3231835598};re.encodings=G;function R(I){switch(I){case G.encodingRaw:return"Raw";case G.encodingCopyRect:return"CopyRect";case G.encodingRRE:return"RRE";case G.encodingHextile:return"Hextile";case G.encodingTight:return"Tight";case G.encodingTightPNG:return"TightPNG";default:return"[unknown encoding "+I+"]"}}},OLES:function(it,re,Q){"use strict";var G=Q("U8pU"),R=Q("VTBJ"),I=Q("Ff2n"),L=Q("q1tI"),M=Q("uciX"),p=Q("7ixt"),E=function(n){var a=n.overlay,t=n.prefixCls,r=n.id,s=n.overlayInnerStyle;return L.createElement("div",{className:"".concat(t,"-inner"),id:r,role:"tooltip",style:s},typeof a=="function"?a():a)},b=E,i=function(n,a){var t=n.overlayClassName,r=n.trigger,s=r===void 0?["hover"]:r,u=n.mouseEnterDelay,f=u===void 0?0:u,d=n.mouseLeaveDelay,v=d===void 0?.1:d,m=n.overlayStyle,S=n.prefixCls,C=S===void 0?"rc-tooltip":S,_=n.children,y=n.onVisibleChange,T=n.afterVisibleChange,k=n.transitionName,g=n.animation,F=n.placement,P=F===void 0?"right":F,N=n.align,W=N===void 0?{}:N,j=n.destroyTooltipOnHide,A=j===void 0?!1:j,K=n.defaultVisible,U=n.getTooltipContainer,O=n.overlayInnerStyle,z=Object(I.a)(n,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),te=Object(L.useRef)(null);Object(L.useImperativeHandle)(a,function(){return te.current});var he=Object(R.a)({},z);"visible"in n&&(he.popupVisible=n.visible);var be=function(){var je=n.arrowContent,Ae=je===void 0?null:je,we=n.overlay,ce=n.id;return[L.createElement("div",{className:"".concat(C,"-arrow"),key:"arrow"},Ae),L.createElement(b,{key:"content",prefixCls:C,id:ce,overlay:we,overlayInnerStyle:O})]},ze=!1,Pe=!1;if(typeof A=="boolean")ze=A;else if(A&&Object(G.a)(A)==="object"){var Oe=A.keepParent;ze=Oe===!0,Pe=Oe===!1}return L.createElement(M.a,Object.assign({popupClassName:t,prefixCls:C,popup:be,action:s,builtinPlacements:p.a,popupPlacement:P,ref:te,popupAlign:W,getPopupContainer:U,onPopupVisibleChange:y,afterPopupVisibleChange:T,popupTransitionName:k,popupAnimation:g,defaultPopupVisible:K,destroyPopupOnHide:ze,autoDestroy:Pe,mouseLeaveDelay:v,popupStyle:m,mouseEnterDelay:f},he),_)},c=Object(L.forwardRef)(i),o=re.a=c},Ot1p:function(it,re,Q){"use strict";var G=Q("2qtc"),R=Q("kLXV"),I=Q("rAM+"),L=Q("miYZ"),M=Q("tsqr"),p=Q("9og8"),E=Q("tJVT"),b=Q("jrin"),i=Q("WmNS"),c=Q.n(i),o=Q("q1tI"),h=Q.n(o),n=Q("VrN/"),a=Q.n(n),t=Q("bdgK"),r=Q("p77/"),s=Q("Bd2K"),u=Q("ELLl"),f=Q("19Vz"),d=Q("lZu9"),v=Q("+NIl"),m=Q("kSUc"),S=Q("9Bee"),C=function(Ie){var V=Ie.value,Ce=V===void 0?"":V,He=Ie.className,fe=Ie.showTextOnly,ke=Ie.showLines,Ve=Ie.style,nt=Ve===void 0?{}:Ve,tt=Object(o.useMemo)(function(){return""},[Ce]);return h.a.createElement(h.a.Fragment,null,h.a.createElement("div",{dangerouslySetInnerHTML:{__html:tt}}))},_=Q("0Owb"),y=Q("dejd"),T=Q("C+DQ"),k=Q("1vsH"),g=Q("m3rI"),F=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function P(Ie){var V=Ie.onActionCallback,Ce=Ie.title,He=Ie.icon,fe=Ie.actionName,ke=Ie.className,Ve=ke===void 0?"":ke,nt=Ie.children;function tt(){V(fe)}return h.a.createElement("a",{title:Ce,className:Ve,onClick:tt},h.a.createElement("i",{className:"md-iconfont ".concat(He)}),nt)}var N=function(Ie){var V=Ie.watch,Ce=Ie.showNullButton,He=Ie.onActionCallback,fe=Ie.fullScreen,ke=Ie.insertTemp,Ve=Ie.hidetoolBar,nt=Ie.uuid,tt=Ie.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(k.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(k.F)("_educoder_session"),"&key=").concat(nt,"&api=").concat(encodeURIComponent(g.a.PROXY_SERVER)));var ut=[].concat(F,[{title:"".concat(V?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(V?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return h.a.createElement("ul",{className:"markdown-toolbar-container"},!Ve&&ut.map(function(ft,Ft){return h.a.createElement("li",{key:Ft},ft.actionName?h.a.createElement(P,Object(_.a)({},ft,{onActionCallback:He})):h.a.createElement("span",{className:"v-line"}))}),Ce?h.a.createElement("li",null,h.a.createElement(P,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:He},h.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ke&&h.a.createElement("li",null,h.a.createElement(P,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ke),onActionCallback:He},h.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),h.a.createElement("li",{className:"btn-full-screen"},h.a.createElement(P,{icon:"".concat(fe?"icon-shrink":"icon-enlarge"),title:fe?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:He})))},W=Q("M8RZ"),j=Q("+L6B"),A=Q("2/Rp"),K=Q("y8nQ"),U=Q("Vl3Y"),O=Q("5NDa"),z=Q("5rEg"),te={labelCol:{span:4},wrapperCol:{span:20}},he=function(Ie){var V=Ie.callback,Ce=Ie.onCancel;function He(fe){V(fe)}return h.a.createElement(U.a,Object(_.a)({},te,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:He}),h.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},h.a.createElement(z.a,null)),h.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},h.a.createElement(z.a,null)),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(A.a,{type:"ghost",onClick:Ce},"\u53D6\u6D88")))},be=Q("7ahc"),ze=Q("HmJG"),Pe=Q("BjJ7"),Oe=U.a.useForm,Ke={width:280,marginRight:10},je={labelCol:{span:5},wrapperCol:{span:19}},Ae=function(Ie){var V=Ie.callback,Ce=Ie.onCancel,He=Oe(),fe=Object(E.a)(He,1),ke=fe[0];function Ve(ut){V(ut)}function nt(ut,ft){if(ut.status===-1){M.b.error(ut.message);return}ke.setFieldsValue({src:"/api/attachments/".concat(ut.id),type:ft.type})}function tt(ut){var ft=ut.target.files[0];ce(ft,nt)}return h.a.createElement(U.a,Object(_.a)({form:ke},je,{className:"upload-image-panel",onFinish:Ve}),h.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},h.a.createElement("div",{className:"flex-container"},h.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},h.a.createElement(z.a,{style:Ke})),h.a.createElement(we,{onFileChange:tt}))),h.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},h.a.createElement(z.a,{style:{width:264}})),h.a.createElement(U.a.Item,{style:{textAlign:"right"}},h.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(A.a,{type:"ghost",onClick:Ce},"\u53D6\u6D88")))};function we(Ie){var V=Ie.onFileChange;return h.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",h.a.createElement("input",{type:"file",onChange:V}))}function ce(Ie,V){if(!Ie)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ce=new FormData;Ce.append("editormd-image-file",Ie),Ce.append("file_param_name","editormd-image-file"),Ce.append("byxhr","true");var He=new window.XMLHttpRequest;He.withCredentials=!0,He.addEventListener("load",function(fe){V(JSON.parse(fe.target.responseText),Ie)},!1),He.addEventListener("error",function(fe){console.error(fe)},!1),He.open("POST","".concat(Pe.a,"/api/attachments.json")),He.send(Ce)}var Te=Q("giR+"),me=Q("fyUT"),Xe=Q("7Kak"),Ze=Q("9yH6"),We=Ze.a.Group,qe={margin:"0 8px"},et=function(Ie){var V=Ie.callback,Ce=Ie.onCancel;function He(fe){V(fe)}return h.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:He},h.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},h.a.createElement("span",{style:qe},"\u5355\u5143\u683C\u6570\uFF1A"),h.a.createElement("span",{style:qe},"\u884C\u6570"),h.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},h.a.createElement(me.a,null)),h.a.createElement("span",{style:qe},"\u5217\u6570"),h.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},h.a.createElement(me.a,null))),h.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},h.a.createElement("span",{style:qe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),h.a.createElement(U.a.Item,{name:"align"},h.a.createElement(We,null,h.a.createElement(Ze.a,{value:"default"},h.a.createElement("i",{className:"fa fa-align-justify"})),h.a.createElement(Ze.a,{value:"left"},h.a.createElement("i",{className:"fa fa-align-left"})),h.a.createElement(Ze.a,{value:"center"},h.a.createElement("i",{className:"fa fa-align-center"})),h.a.createElement(Ze.a,{value:"right"},h.a.createElement("i",{className:"fa fa-align-right"}))))),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(A.a,{type:"ghost",onClick:Ce},"\u53D6\u6D88")))},pe=Q("ErOA"),ve=Q("7Cbv"),xe="link",Se="upload-image",Le="code-block",ne="add-table",ye="------------",se={default:ye,left:":".concat(ye),center:":".concat(ye,":"),right:"".concat(ye,":")},Ne=Q("9VGf"),Qe,Je;function Ge(){}var ht=0,de=1e4,Me="\u2581",Fe=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Re(Ie){return/^\d+$/.test(Ie)?"".concat(Ie,"px"):Ie}var _e=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ee=_e?"Cmd":"Ctrl",ee=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],oe=(Qe={},Object(b.a)(Qe,Ee+"-B","bold"),Object(b.a)(Qe,Ee+"-I","italic"),Qe),q=(Je={},Object(b.a)(Je,xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(b.a)(Je,Le,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(b.a)(Je,Se,"\u6DFB\u52A0\u6587\u4EF6"),Object(b.a)(Je,ne,"\u6DFB\u52A0\u8868\u683C"),Je),ge=re.a=function(Ie){var V=Ie.defaultValue,Ce=V===void 0?"":V,He=Ie.onChange,fe=Ie.width,ke=fe===void 0?"100%":fe,Ve=Ie.height,nt=Ve===void 0?400:Ve,tt=Ie.miniToolbar,ut=tt===void 0?!1:tt,ft=Ie.isFocus,Ft=ft===void 0?!1:ft,xt=Ie.watch,ct=Ie.insertTemp,At=Ie.mode,Nt=At===void 0?"markdown":At,mt=Ie.id,Vt=mt===void 0?"markdown-editor-id":mt,Et=Ie.showResizeBar,_t=Et===void 0?!1:Et,kt=Ie.noStorage,Dt=kt===void 0?!1:kt,Yt=Ie.showNullButton,Mt=Yt===void 0?!1:Yt,yt=Ie.hidetoolBar,Ki=yt===void 0?!1:yt,Jt=Ie.fullScreen,ri=Jt===void 0?!1:Jt,Ut=Ie.onBlur,di=Ie.onCMBeforeChange,Ii=Ie.onFullScreen,Yi=Ie.className,lt=Yi===void 0?"":Yi,It=Ie.disablePaste,pr=It===void 0?!1:It,mr=Ie.placeholder,gr=mr===void 0?"":mr,vr=Ie.values,J=vr===void 0?"":vr,B=Object(o.useState)(null),H=Object(E.a)(B,2),Y=H[0],le=H[1],$=Object(o.useState)(Ce),Be=Object(E.a)($,2),at=Be[0],pt=Be[1],St=Object(o.useState)(xt),st=Object(E.a)(St,2),Rt=st[0],zt=st[1],ii=Object(o.useState)(ri),Hi=Object(E.a)(ii,2),Si=Hi[0],Ti=Hi[1],qi=Object(o.useState)(""),kr=Object(E.a)(qi,2),mi=kr[0],zi=kr[1],lr=Object(o.useState)(0),ur=Object(E.a)(lr,2),ji=ur[0],Ir=ur[1],_r=Object(o.useState)(nt),Xr=Object(E.a)(_r,2),zr=Xr[0],$i=Xr[1],Qi=Object(o.useState)(!1),yr=Object(E.a)(Qi,2),cn=yr[0],br=yr[1],oi=Object(o.useRef)(Object(ve.a)()),Gt=Object(o.useRef)(!1),xi=Object(o.useRef)(),Ht=Object(o.useRef)(),ui=Object(o.useRef)(),qt=Object(o.useRef)(),rr=Object(o.useRef)(),gi=function(){var Tt=Object(p.a)(c.a.mark(function Pt(){var Lt,Kt;return c.a.wrap(function(ei){for(;;)switch(ei.prev=ei.next){case 0:return ei.next=2,Object(pe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:oi.current}});case 2:Kt=ei.sent,Kt!=null&&(Lt=Kt.attachments)!==null&&Lt!==void 0&&Lt.length&&(console.log("cm:",Y,Ht),Kt.attachments.map(function(Wt){Wt.content_type.indexOf("image")>-1?Y.replaceSelection(".concat(Wt.content_type,")")):Wt.content_type.indexOf("video")>-1?Y.replaceSelection('')):Wt.content_type.indexOf("pdf")>-1?Y.replaceSelection('').concat(Wt.name,"")):Y.replaceSelection("[".concat(Wt.name,"](").concat(g.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}));case 4:case"end":return ei.stop()}},Pt)}));return function(){return Tt.apply(this,arguments)}}();Object(o.useEffect)(function(){pt(J),Y==null||Y.setValue(J)},[J]),Object(o.useEffect)(function(){Ii==null||Ii(Si)},[Si]),Object(o.useEffect)(function(){if(Ht.current){var Tt=a.a.fromTextArea(Ht.current,{mode:Nt,lineNumbers:!ut,lineWrapping:!0,value:Ce,autoCloseTags:!0,autoCloseBrackets:!0});Ft&&Tt.focus();function Pt(Lt,Kt){if(pr){Kt.preventDefault();return}var Xt=Kt.clipboardData;if(Xt){var ei=Xt.types.toString(),Wt=Xt.items;if(ei==="Files"||Xt.types.indexOf("Files")>-1){if(Kt.preventDefault(),Nt=="stex")return;try{var fi,Di=Wt[1];((fi=Wt[0])===null||fi===void 0?void 0:fi.kind)==="file"&&(Di=Wt[0]);var jt=Di.getAsFile(),hr=jt.name.split(".").pop();ce(jt,function(Qt){if(Qt.id){var Mi,Ci,Zi;(jt==null||((Mi=jt.type)===null||Mi===void 0)?void 0:Mi.indexOf("image"))>-1?Tt.replaceSelection(".concat(Qt.content_type,")")):(jt==null||((Ci=jt.type)===null||Ci===void 0)?void 0:Ci.indexOf("video"))>-1?Tt.replaceSelection('')):(jt==null||((Zi=jt.type)===null||Zi===void 0)?void 0:Zi.indexOf("pdf"))>-1?Tt.replaceSelection('').concat(jt.name,"")):ee.includes(hr)?Tt.replaceSelection('').concat(jt.name,"")):Tt.replaceSelection("[".concat(jt.name,"](").concat(g.a.API_SERVER,"/api/attachments/").concat(Qt.id,"?type=").concat(Qt.content_type,")"))}else(Qt==null?void 0:Qt.status)===401&&(document.location.href="/user/login")})}catch(Qt){M.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Tt.on("paste",Pt),Tt.on("dragleave",function(Lt,Kt){ui.current.classList.remove("mouse-hover-md")}),Tt.on("dragover",function(Lt,Kt){ui.current.classList.add("mouse-hover-md")}),Tt.on("drop",function(Lt,Kt){ui.current.classList.add("mouse-hover-md");var Xt;if(Xt=Kt.dataTransfer.files,Xt.length>0){Kt.preventDefault(),Kt.stopPropagation();for(var ei=function(Di){var jt=Xt[Di],hr=jt.name.split(".").pop();ce(jt,function(Qt){if(Qt.id){var Mi,Ci,Zi;(jt==null||((Mi=jt.type)===null||Mi===void 0)?void 0:Mi.indexOf("image"))>-1?Tt.replaceSelection(".concat(Qt.content_type,")")):(jt==null||((Ci=jt.type)===null||Ci===void 0)?void 0:Ci.indexOf("video"))>-1?Tt.replaceSelection('')):(jt==null||((Zi=jt.type)===null||Zi===void 0)?void 0:Zi.indexOf("pdf"))>-1?Tt.replaceSelection('').concat(jt.name,"")):ee.includes(hr)?Tt.replaceSelection('').concat(jt.name,"")):Tt.replaceSelection("[".concat(jt.name,"](").concat(g.a.API_SERVER,"/api/attachments/").concat(Qt.id,"?type=").concat(Qt.content_type,")"))}else(Qt==null?void 0:Qt.status)===401&&(document.location.href="/user/login")})},Wt=0;Wt0||Wt.target.offsetWidth>0)&&(Li(),Y.setSize("100%","100%"),Y.refresh())}}catch(fi){Xt.e(fi)}finally{Xt.f()}});return Lt.observe(Ht.current.parentElement),Lt}if(Y){var Pt=Tt();return function(){Pt.unobserve(Ht.current.parentElement)}}},[Y,Li]),Object(o.useEffect)(function(){if(Y){for(var Tt=[],Pt=function(){var Wt=Kt[Lt];Xt=Object(E.a)(Wt,2);var fi=Xt[0],Di=Xt[1],jt=Object(b.a)({},fi,function(){Gr(Di)});Tt.push(jt),Y.addKeyMap(jt)},Lt=0,Kt=Object.entries(oe);Lt0){var Tt=new Date().getTime(),Pt=window.sessionStorage.getItem(Vt);Tt>=ji+de&&(!Pt||Pt!==at)&&(window.sessionStorage.setItem(Vt,at),br(!0))}},de),Object(o.useEffect)(function(){zt(xt)},[Y,xt]),Object(o.useEffect)(function(){Y&&(Ft&&Y.focus())},[Y,Ft]),Object(o.useEffect)(function(){if(Rt&&Y){var Tt=Y.getScrollerElement();function Pt(Lt){var Kt=Lt.target;if(rr.current){var Xt=Kt.scrollTop/Kt.scrollHeight;rr.current.scrollTop=rr.current.scrollHeight*Xt}}return Tt.addEventListener("scroll",Pt),function(){Tt.removeEventListener("scroll",Pt)}}},[Y,Rt]),Object(o.useEffect)(function(){if(Y&&di){function Tt(Pt,Lt){di(Pt,Lt)}return Y.on("beforeChange",Tt),function(){Y.off("beforeChange",Tt)}}},[Y,di]),Object(o.useEffect)(function(){if(Y&&Ut){function Tt(){Ut(Y.getValue())}return Y.on("blur",Tt),function(){Y.off("blur",Tt)}}},[Y,Ut]),Object(o.useEffect)(function(){if(Y){function Tt(Pt){var Lt=Pt.getValue();pt(Lt),Ir(new Date().getTime()),Pt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),He&&He(Lt)}return Y.on("change",Tt),function(){Y.off("change",Tt)}}},[Y,He]),Object(o.useEffect)(function(){Y&&(Ce==null?(Y.setValue(""),pt("")):Ce!==Y.getValue()&&(Y.setValue(Ce),pt(Ce),Y.setCursor(Y.lineCount(),0)))},[Y,Ce]);var Gr=Object(o.useCallback)(function(Tt){var Pt=Y.getCursor(),Lt=Y.getSelection(),Kt=Lt.split(`
`);switch(Tt){case"bold":return Y.replaceSelection("**"+Lt+"**"),Lt===""&&Y.setCursor(Pt.line,Pt.ch+2),Y.focus();case"italic":return Y.replaceSelection("*"+Lt+"*"),Lt===""&&Y.setCursor(Pt.line,Pt.ch+1),Y.focus();case"code":return Y.replaceSelection("`"+Lt+"`"),Lt===""&&Y.setCursor(Pt.line,Pt.ch+1),Y.focus();case"inline-latex":return Y.replaceSelection("`$$"+Lt+"$$`"),Lt===""&&Y.setCursor(Pt.line,Pt.ch+3),Y.focus();case"latex":return Y.replaceSelection("```latex\n"+Lt+"\n```"),Y.setCursor(Pt.line+1,Lt.length+1),Y.focus();case"line-break":return Y.replaceSelection(`
`),Y.focus();case"list-ul":return Lt===""?Y.replaceSelection("- "+Lt):Y.replaceSelection(Kt.map(function(Xt){return Xt===""?"":"- ".concat(Xt)}).join(`
`)),Y.focus();case"list-ol":return Lt===""?Y.replaceSelection("1. "+Lt):Y.replaceSelection(Kt.map(function(Xt,ei){return Xt===""?"":"".concat(ei+1,". ").concat(Xt)}).join(`
`)),Y.focus();case"add-null-ch":return Lt===""&&Y.setCursor(Pt.line,Pt.ch+1),Y.replaceSelection(Me),Y.focus();case"inster-template-1":return Lt===""&&Y.setCursor(Pt.line,Pt.ch),Y.replaceSelection(Fe),Y.focus();case"eraser":return Y.setValue(""),Y.focus();case"trigger-watch":return zt(!Rt),Y.focus();case"trigger-full-screen":return Ti(!Si),Y.focus();case xe:zi(xe);return;case Le:zi(Le);return;case Se:zi(Se);return;case ne:zi(ne);return;default:throw new Error}},[Y,Rt,Si]),xr=Object(o.useCallback)(function(Tt){zi("");switch(mi){case xe:var Pt=Tt.title,Lt=Tt.link;return Y.replaceSelection("[".concat(Pt,"](").concat(Lt,")")),Y.focus();case Le:var Kt=Tt.language,Xt=Tt.content;return Y.replaceSelection(["```"+Kt,Xt,"```"].join(`
`)),Y.focus();case Se:var ei=Tt.src,Wt=Tt.alt;return Wt?Y.replaceSelection(".concat(ei,' "').concat(Wt,'" )')):Y.replaceSelection("")),Y.focus();case ne:for(var fi=Tt.row,Di=Tt.col,jt=Tt.align,hr=`
`,Qt=0;Qt300&&(fi=300);var Di=nt+fi+"px";$i(Di)}}return Tt.addEventListener("mousedown",Kt),document.addEventListener("mousemove",ei),document.addEventListener("mouseup",Xt),function(){Tt.removeEventListener("mousedown",Kt),document.removeEventListener("mousemove",ei),document.removeEventListener("mouseup",Xt)}}},[Y,qt]),Object(o.useEffect)(function(){$i(nt)},[nt]);var nr=Re(ke),fn=Re(zr),Ji={width:nr,height:fn},pn=Object(o.useMemo)(function(){if(ji){var Tt=new Date(ji),Pt=Tt.getHours(),Lt=Tt.getMinutes(),Kt=Tt.getSeconds();return Pt=Pt<10?"0"+Pt:Pt,Lt=Lt<10?"0"+Lt:Lt,Kt=Kt<10?"0"+Kt:Kt,"".concat(Pt,":").concat(Lt,":").concat(Kt)}return 0},[ji]);function Kn(){window.sessionStorage.removeItem(Vt),br(!1),Ir(0)}function Dr(){br(!1),Ir(0),Y.setValue(window.sessionStorage.getItem(Vt))}function ua(Tt,Pt){var Lt=Y.getValue();Lt=Lt.replace(Tt,Pt),pt(Lt),Y==null||Y.setValue(Lt)}return h.a.createElement(o.Fragment,null,h.a.createElement("div",{className:"markdown-editor-wrapper",ref:ui},h.a.createElement("div",{className:"markdown-editor-container ".concat(lt," ").concat(Rt?"on-preview":""," ").concat(ut?"mini":""," ").concat(Si?"full-screen":""),style:Ji},h.a.createElement(N,{insertTemp:ct,watch:Rt,fullScreen:Si,showNullButton:Mt,onActionCallback:Gr,hidetoolBar:Ki,uuid:oi.current,setOpenPhones:function(){Gt.current=!0}}),h.a.createElement("div",{className:"markdown-editor-body"},h.a.createElement("div",{className:"codemirror-container"},h.a.createElement("textarea",{ref:Ht,placeholder:gr})),Rt?h.a.createElement("div",{ref:rr,className:"preview-container"},Nt==="stex"&&h.a.createElement(C,{value:at}),Nt!=="stex"&&h.a.createElement(S.a,{edit:!0,value:at,replaces:ua})):null))),_t?h.a.createElement("a",{ref:qt,className:"editor-resize"}):null,h.a.createElement(W.a,null,q[mi]?h.a.createElement(R.a,{centered:!0,title:q[mi],visible:!0,onCancel:Er,footer:null,className:"markdown-popup-form"},dn):null))}},P2ho:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var G={Again:57349,AltLeft:56,AltRight:57400,ArrowDown:57424,ArrowLeft:57419,ArrowRight:57421,ArrowUp:57416,AudioVolumeDown:57390,AudioVolumeMute:57376,AudioVolumeUp:57392,Backquote:41,Backslash:43,Backspace:14,BracketLeft:26,BracketRight:27,BrowserBack:57450,BrowserFavorites:57446,BrowserForward:57449,BrowserHome:57394,BrowserRefresh:57447,BrowserSearch:57445,BrowserStop:57448,CapsLock:58,Comma:51,ContextMenu:57437,ControlLeft:29,ControlRight:57373,Convert:121,Copy:57464,Cut:57404,Delete:57427,Digit0:11,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Eject:57469,End:57423,Enter:28,Equal:13,Escape:1,F1:59,F10:68,F11:87,F12:88,F13:93,F14:94,F15:95,F16:85,F17:57347,F18:57463,F19:57348,F2:60,F20:90,F21:116,F22:57465,F23:109,F24:111,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,Find:57409,Help:57461,Hiragana:119,Home:57415,Insert:57426,IntlBackslash:86,IntlRo:115,IntlYen:125,KanaMode:112,Katakana:120,KeyA:30,KeyB:48,KeyC:46,KeyD:32,KeyE:18,KeyF:33,KeyG:34,KeyH:35,KeyI:23,KeyJ:36,KeyK:37,KeyL:38,KeyM:50,KeyN:49,KeyO:24,KeyP:25,KeyQ:16,KeyR:19,KeyS:31,KeyT:20,KeyU:22,KeyV:47,KeyW:17,KeyX:45,KeyY:21,KeyZ:44,Lang3:120,Lang4:119,Lang5:118,LaunchApp1:57451,LaunchApp2:57377,LaunchMail:57452,MediaPlayPause:57378,MediaSelect:57453,MediaStop:57380,MediaTrackNext:57369,MediaTrackPrevious:57360,MetaLeft:57435,MetaRight:57436,Minus:12,NonConvert:123,NumLock:69,Numpad0:82,Numpad1:79,Numpad2:80,Numpad3:81,Numpad4:75,Numpad5:76,Numpad6:77,Numpad7:71,Numpad8:72,Numpad9:73,NumpadAdd:78,NumpadComma:126,NumpadDecimal:83,NumpadDivide:57397,NumpadEnter:57372,NumpadEqual:89,NumpadMultiply:55,NumpadParenLeft:57462,NumpadParenRight:57467,NumpadSubtract:74,Open:100,PageDown:57425,PageUp:57417,Paste:101,Pause:57414,Period:52,Power:57438,PrintScreen:84,Props:57350,Quote:40,ScrollLock:70,Semicolon:39,ShiftLeft:42,ShiftRight:54,Slash:53,Sleep:57439,Space:57,Suspend:57381,Tab:15,Undo:57351,WakeUp:57443};re.default=G},QV2g:function(it,re,Q){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=G;function G(){for(var L,M=[],p=0;p<256;p++){L=p;for(var E=0;E<8;E++)L=L&1?3988292384^L>>>1:L>>>1;M[p]=L}return M}var R=G();function I(L,M,p,E){var b=R,i=E+p;L^=-1;for(var c=E;c>>8^b[(L^M[c])&255];return L^-1}},SJMd:function(it,re){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var Q,G,R,I=!1,L,M;window.PR_SHOULD_USE_CONTINUATION=!0;var p,E;(function(){var b=window,i=["break,continue,do,else,for,if,return,while"],c=[i,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],o=[c,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],h=[o,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],n=[o,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[o,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],t="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",r=[o,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",u=[i,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],f=[i,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],d=[i,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[h,a,n,r,s,u,f,d],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",C="kwd",_="com",y="typ",T="lit",k="pun",g="pln",F="tag",P="dec",N="src",W="atn",j="atv",A="nocode",K="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(We){for(var qe=0,et=!1,pe=!1,ve=0,xe=We.length;ve122||(ee<65||Ee>90||ht.push([Math.max(65,Ee)|32,Math.min(ee,90)|32]),ee<97||Ee>122||ht.push([Math.max(97,Ee)&~32,Math.min(ee,122)&~32]))}}ht.sort(function(Ie,V){return Ie[0]-V[0]||V[1]-Ie[1]});for(var oe=[],q=[],Fe=0;Fege[0]&&(ge[1]+1>ge[0]&&Me.push("-"),Me.push(ye(ge[1])))}return Me.push("]"),Me.join("")}function Ne(Je){for(var Ge=Je.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ht=Ge.length,de=[],Me=0,Fe=0;Me=2&&Ee==="["?Ge[Me]=se(Re):Ee!=="\\"&&(Ge[Me]=Re.replace(/[a-zA-Z]/g,function(q){var ge=q.charCodeAt(0);return"["+String.fromCharCode(ge&~32,ge|32)+"]"}))}return Ge.join("")}for(var Qe=[],ve=0,xe=We.length;ve=0;)et[Qe.charAt(Je)]=Ne;var Ge=Ne[1],ht=""+Ge;ne.hasOwnProperty(ht)||(Le.push(Ge),ne[ht]=null)}Le.push(/[\0-\uffff]/),pe=U(Le)})();var ve=qe.length,xe=function(Se){for(var Le=Se.sourceCode,ne=Se.basePos,ye=Se.sourceNode,se=[ne,g],Ne=0,Qe=Le.match(pe)||[],Je={},Ge=0,ht=Qe.length;Ge=5&&Me.substring(0,5)==="lang-",Re&&!(Fe&&typeof Fe[1]=="string")&&(Re=!1,Me=N),Re||(Je[de]=Me)}var ee=Ne;if(Ne+=de.length,!Re)se.push(ne+ee,Me);else{var oe=Fe[1],q=de.indexOf(oe),ge=q+oe.length;Fe[2]&&(ge=de.length-Fe[2].length,q=ge-oe.length);var Ie=Me.substring(5);z(ye,ne+ee,de.substring(0,q),xe,se),z(ye,ne+ee+q,oe,we(Ie,oe),se),z(ye,ne+ee+ge,de.substring(ge),xe,se)}}Se.decorations=se};return xe}function ze(We){var qe=[],et=[];We.tripleQuotedStrings?qe.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):We.multiLineStrings?qe.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):qe.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),We.verbatimStrings&&et.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var pe=We.hashComments;pe&&(We.cStyleComments?(pe>1?qe.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):qe.push([_,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),et.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):qe.push([_,/^#[^\r\n]*/,null,"#"])),We.cStyleComments&&(et.push([_,/^\/\/[^\r\n]*/,null]),et.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ve=We.regexLiterals;if(ve){var xe=ve>1?"":`
\r`,Se=xe?".":"[\\S\\s]",Le="/(?=[^/*"+xe+"])(?:[^/\\x5B\\x5C"+xe+"]|\\x5C"+Se+"|\\x5B(?:[^\\x5C\\x5D"+xe+"]|\\x5C"+Se+")*(?:\\x5D|$))+/";et.push(["lang-regex",RegExp("^"+K+"("+Le+")")])}var ne=We.types;ne&&et.push([y,ne]);var ye=(""+We.keywords).replace(/^ | $/g,"");ye.length&&et.push([C,new RegExp("^(?:"+ye.replace(/[\s,]+/g,"|")+")\\b"),null]),qe.push([g,/^\s+/,null,` \r
\xA0`]);var se="^.[^\\s\\w.$@'\"`/\\\\]*";return We.regexLiterals&&(se+="(?!s*/)"),et.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[g,/^[a-z_$][a-z_$@0-9]*/i,null],[T,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[g,/^\\[\s\S]?/,null],[k,new RegExp(se),null]),be(qe,et)}var Pe=ze({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Oe(We,qe,et){for(var pe=/(?:^|\s)nocode(?:\s|$)/,ve=/\r\n?|\n/,xe=We.ownerDocument,Se=xe.createElement("li");We.firstChild;)Se.appendChild(We.firstChild);var Le=[Se];function ne(Ge){var ht=Ge.nodeType;if(ht==1&&!pe.test(Ge.className))if(Ge.nodeName==="br")ye(Ge),Ge.parentNode&&Ge.parentNode.removeChild(Ge);else for(var de=Ge.firstChild;de;de=de.nextSibling)ne(de);else if((ht==3||ht==4)&&et){var Me=Ge.nodeValue,Fe=Me.match(ve);if(Fe){var Re=Me.substring(0,Fe.index);Ge.nodeValue=Re;var _e=Me.substring(Fe.index+Fe[0].length);if(_e){var Ee=Ge.parentNode;Ee.insertBefore(xe.createTextNode(_e),Ge.nextSibling)}ye(Ge),Re||Ge.parentNode.removeChild(Ge)}}}function ye(Ge){for(;!Ge.nextSibling;)if(Ge=Ge.parentNode,!Ge)return;function ht(Fe,Re){var _e=Re?Fe.cloneNode(!1):Fe,Ee=Fe.parentNode;if(Ee){var ee=ht(Ee,1),oe=Fe.nextSibling;ee.appendChild(_e);for(var q=oe;q;q=oe)oe=q.nextSibling,ee.appendChild(q)}return _e}for(var de=ht(Ge.nextSibling,0),Me;(Me=de.parentNode)&&Me.nodeType===1;)de=Me;Le.push(de)}for(var se=0;se=Ee&&(ne+=2),xe>=ee&&(Ne+=2)}}finally{Me&&(Me.style.display=Fe)}}var je={};function Ae(We,qe){for(var et=qe.length;--et>=0;){var pe=qe[et];je.hasOwnProperty(pe)?b.console&&console.warn("cannot override language handler %s",pe):je[pe]=We}}function we(We,qe){return We&&je.hasOwnProperty(We)||(We=/^\s*]*(?:>|$)/],[_,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[k,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^