(window.webpackJsonp=window.webpackJsonp||[]).push([[184,7,8,17],{"+NIl": /*!***************************************************!*\ !*** ./node_modules/codemirror/mode/stex/stex.js ***! \***************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){"use strict";t.defineMode("stex",(function(t,e){function n(t,e){t.cmdState.push(e)}function i(t){return t.cmdState.length>0?t.cmdState[t.cmdState.length-1]:null}function r(t,e,n){return function(){this.name=t,this.bracketNo=0,this.style=e,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var o={};function a(t,e){t.f=e}function s(t,e){var r;if(t.match(/^\\[a-zA-Z@]+/)){var s=t.current().slice(1);return n(e,r=new(r=o.hasOwnProperty(s)?o[s]:o.DEFAULT)),a(e,c),r.style}if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/\\]/))return"tag";if(t.match("\\["))return a(e,(function(t,e){return l(t,e,"\\]")})),"keyword";if(t.match("\\("))return a(e,(function(t,e){return l(t,e,"\\)")})),"keyword";if(t.match("$$"))return a(e,(function(t,e){return l(t,e,"$$")})),"keyword";if(t.match("$"))return a(e,(function(t,e){return l(t,e,"$")})),"keyword";var u=t.next();return"%"==u?(t.skipToEnd(),"comment"):"}"==u||"]"==u?(r=i(e))?(r.closeBracket(u),a(e,c),"bracket"):"error":"{"==u||"["==u?(n(e,r=new(r=o.DEFAULT)),"bracket"):/\d/.test(u)?(t.eatWhile(/[\w.%]/),"atom"):(t.eatWhile(/[\w\-_]/),"begin"==(r=function(t){for(var e=t.cmdState,n=e.length-1;n>=0;n--){var i=e[n];if("DEFAULT"!=i.name)return i}return{styleIdentifier:function(){return null}}}(e)).name&&(r.argument=t.current()),r.styleIdentifier())}function l(t,e,n){if(t.eatSpace())return null;if(n&&t.match(n))return a(e,s),"keyword";if(t.match(/^\\[a-zA-Z@]+/))return"tag";if(t.match(/^[a-zA-Z]+/))return"variable-2";if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/]/))return"tag";if(t.match(/^[\^_&]/))return"tag";if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=t.next();return"{"==i||"}"==i||"["==i||"]"==i||"("==i||")"==i?"bracket":"%"==i?(t.skipToEnd(),"comment"):"error"}function c(t,e){var n=t.peek();return"{"==n||"["==n?(i(e).openBracket(n),t.eat(n),a(e,s),"bracket"):/[ \t\r]/.test(n)?(t.eat(n),null):(a(e,s),function(t){var e=t.cmdState.pop();e&&e.closeBracket()}(e),s(t,e))}return o.importmodule=r("importmodule","tag",["string","builtin"]),o.documentclass=r("documentclass","tag",["","atom"]),o.usepackage=r("usepackage","tag",["atom"]),o.begin=r("begin","tag",["atom"]),o.end=r("end","tag",["atom"]),o.label=r("label","tag",["atom"]),o.ref=r("ref","tag",["atom"]),o.eqref=r("eqref","tag",["atom"]),o.cite=r("cite","tag",["atom"]),o.bibitem=r("bibitem","tag",["atom"]),o.Bibitem=r("Bibitem","tag",["atom"]),o.RBibitem=r("RBibitem","tag",["atom"]),o.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:e.inMathMode?function(t,e){return l(t,e)}:s}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=s,t.cmdState.length=0},lineComment:"%"}})),t.defineMIME("text/x-stex","stex"),t.defineMIME("text/x-latex","stex")}(n(/*! ../../lib/codemirror */"VrN/"))},"+yhJ": /*!******************************************!*\ !*** ./src/assets/images/paper/xixi.svg ***! \******************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/xixi.d492fb65.svg"},"0eGx": /*!*******************************************!*\ !*** ./src/assets/images/paper/zhong.svg ***! \*******************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/zhong.c1924b73.svg"},"19Vz": /*!**************************************************************!*\ !*** ./node_modules/codemirror/addon/display/placeholder.js ***! \**************************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){function e(t){t.state.placeholder&&(t.state.placeholder.parentNode.removeChild(t.state.placeholder),t.state.placeholder=null)}function n(t){e(t);var n=t.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=t.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var i=t.getOption("placeholder");"string"==typeof i&&(i=document.createTextNode(i)),n.appendChild(i),t.display.lineSpace.insertBefore(n,t.display.lineSpace.firstChild)}function i(t){o(t)&&n(t)}function r(t){var i=t.getWrapperElement(),r=o(t);i.className=i.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?n(t):e(t)}function o(t){return 1===t.lineCount()&&""===t.getLine(0)}t.defineOption("placeholder","",(function(o,a,s){var l=s&&s!=t.Init;if(a&&!l)o.on("blur",i),o.on("change",r),o.on("swapDoc",r),t.on(o.getInputField(),"compositionupdate",o.state.placeholderCompose=function(){!function(t){setTimeout((function(){var i=!1,r=t.getInputField();"TEXTAREA"==r.nodeName?i=!r.value:1==t.lineCount()&&(i=!/[^\u200b]/.test(r.querySelector(".CodeMirror-line").textContent)),i?n(t):e(t)}),20)}(o)}),r(o);else if(!a&&l){o.off("blur",i),o.off("change",r),o.off("swapDoc",r),t.off(o.getInputField(),"compositionupdate",o.state.placeholderCompose),e(o);var c=o.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}a&&!o.hasFocus()&&i(o)}))}(n(/*! ../../lib/codemirror */"VrN/"))},"1eCo": /*!*************************************************!*\ !*** ./node_modules/codemirror/mode/xml/xml.js ***! \*************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){"use strict";var e={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},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};t.defineMode("xml",(function(i,r){var o,a,s=i.indentUnit,l={},c=r.htmlMode?e:n;for(var u in c)l[u]=c[u];for(var u in r)l[u]=r[u];function h(t,e){function n(n){return e.tokenize=n,n(t,e)}var i=t.next();return"<"==i?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(p("atom","]]>")):null:t.match("--")?n(p("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(function t(e){return function(n,i){for(var r;null!=(r=n.next());){if("<"==r)return i.tokenize=t(e+1),i.tokenize(n,i);if(">"==r){if(1==e){i.tokenize=h;break}return i.tokenize=t(e-1),i.tokenize(n,i)}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=p("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=d,"tag bracket"):"&"==i?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function d(t,e){var n,i,r=t.next();if(">"==r||"/"==r&&t.eat(">"))return e.tokenize=h,o=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return o="equals",null;if("<"==r){e.tokenize=h,e.state=v,e.tagName=e.tagStart=null;var a=e.tokenize(t,e);return a?a+" tag error":"tag error"}return/[\'\"]/.test(r)?(e.tokenize=(n=r,(i=function(t,e){for(;!t.eol();)if(t.next()==n){e.tokenize=d;break}return"string"}).isInAttribute=!0,i),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(t,e){return function(n,i){for(;!n.eol();){if(n.match(e)){i.tokenize=h;break}n.next()}return t}}function f(t,e,n){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function m(t){t.context&&(t.context=t.context.prev)}function g(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(e))return;m(t)}}function v(t,e,n){return"openTag"==t?(n.tagStart=e.column(),y):"closeTag"==t?b:v}function y(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",w):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",w(t,0,n)):(a="error",y)}function b(t,e,n){if("word"==t){var i=e.current();return n.context&&n.context.tagName!=i&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&m(n),n.context&&n.context.tagName==i||!1===l.matchClosing?(a="tag",x):(a="tag error",C)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",x(t,0,n)):(a="error",C)}function x(t,e,n){return"endTag"!=t?(a="error",x):(m(n),v)}function C(t,e,n){return a="error",x(t,0,n)}function w(t,e,n){if("word"==t)return a="attribute",k;if("endTag"==t||"selfcloseTag"==t){var i=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(i)?g(n,i):(g(n,i),n.context=new f(n,i,r==n.indented)),v}return a="error",w}function k(t,e,n){return"equals"==t?S:(l.allowMissing||(a="error"),w(t,0,n))}function S(t,e,n){return"string"==t?E:"word"==t&&l.allowUnquoted?(a="string",w):(a="error",w(t,0,n))}function E(t,e,n){return"string"==t?E:w(t,0,n)}return h.isInText=!0,{startState:function(t){var e={tokenize:h,state:v,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;o=null;var n=e.tokenize(t,e);return(n||o)&&"comment"!=n&&(a=null,e.state=e.state(o||n,t,e),a&&(n="error"==a?n+" error":a)),n},indent:function(e,n,i){var r=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(r&&r.noIndent)return t.Pass;if(e.tokenize!=d&&e.tokenize!=h)return i?i.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==S&&(t.state=w)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)n.tagName&&e.push(n.tagName);return e.reverse()}}})),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(/*! ../../lib/codemirror */"VrN/"))},"6+eU": /*!************************************************************!*\ !*** ./node_modules/rc-pagination/es/index.js + 4 modules ***! \************************************************************/ /*! exports provided: default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-pagination/es/locale/zh_CN.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var i=n("wx14"),r=n("rePB"),o=n("VTBJ"),a=n("1OyB"),s=n("vuIU"),l=n("Ji7U"),c=n("LK+K"),u=n("q1tI"),h=n.n(u),d=n("TSYQ"),p=n.n(d),f=function(t){var e,n="".concat(t.rootPrefixCls,"-item"),i=p()(n,"".concat(n,"-").concat(t.page),(e={},Object(r.a)(e,"".concat(n,"-active"),t.active),Object(r.a)(e,t.className,!!t.className),Object(r.a)(e,"".concat(n,"-disabled"),!t.page),e));return h.a.createElement("li",{title:t.showTitle?t.page:null,className:i,onClick:function(){t.onClick(t.page)},onKeyPress:function(e){t.onKeyPress(e,t.onClick,t.page)},tabIndex:"0"},t.itemRender(t.page,"page",h.a.createElement("a",{rel:"nofollow"},t.page)))},m=13,g=38,v=40,y=function(t){Object(l.a)(n,t);var e=Object(c.a)(n);function n(){var t;Object(a.a)(this,n);for(var i=arguments.length,r=new Array(i),o=0;o=0||e.relatedTarget.className.indexOf("".concat(o,"-next"))>=0)||(t.setState({goInputText:""}),r(t.getValidValue()))},t.go=function(e){""!==t.state.goInputText&&(e.keyCode!==m&&"click"!==e.type||(t.setState({goInputText:""}),t.props.quickGo(t.getValidValue())))},t}return Object(s.a)(n,[{key:"getValidValue",value:function(){var t=this.state,e=t.goInputText,n=t.current;return!e||isNaN(e)?n:Number(e)}},{key:"getPageSizeOptions",value:function(){var t=this.props,e=t.pageSize,n=t.pageSizeOptions;return n.some((function(t){return t.toString()===e.toString()}))?n:n.concat([e.toString()]).sort((function(t,e){return(isNaN(Number(t))?0:Number(t))-(isNaN(Number(e))?0:Number(e))}))}},{key:"render",value:function(){var t=this,e=this.props,n=e.pageSize,i=e.locale,r=e.rootPrefixCls,o=e.changeSize,a=e.quickGo,s=e.goButton,l=e.selectComponentClass,c=e.buildOptionText,u=e.selectPrefixCls,d=e.disabled,p=this.state.goInputText,f="".concat(r,"-options"),m=l,g=null,v=null,y=null;if(!o&&!a)return null;var b=this.getPageSizeOptions();if(o&&m){var x=b.map((function(e,n){return h.a.createElement(m.Option,{key:n,value:e.toString()},(c||t.buildOptionText)(e))}));g=h.a.createElement(m,{disabled:d,prefixCls:u,showSearch:!1,className:"".concat(f,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(n||b[0]).toString(),onChange:this.changeSize,getPopupContainer:function(t){return t.parentNode}},x)}return a&&(s&&(y="boolean"==typeof s?h.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:d,className:"".concat(f,"-quick-jumper-button")},i.jump_to_confirm):h.a.createElement("span",{onClick:this.go,onKeyUp:this.go},s)),v=h.a.createElement("div",{className:"".concat(f,"-quick-jumper")},i.jump_to,h.a.createElement("input",{disabled:d,type:"text",value:p,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),i.page,y)),h.a.createElement("li",{className:"".concat(f)},g,v)}}]),n}(h.a.Component);y.defaultProps={pageSizeOptions:["10","20","50","100"]};var b=y,x=n("N2Kk");function C(){}function w(t,e,n){var i=void 0===t?e.pageSize:t;return Math.floor((n.total-1)/i)+1}var k=function(t){Object(l.a)(n,t);var e=Object(c.a)(n);function n(t){var i;Object(a.a)(this,n),(i=e.call(this,t)).getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(w(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(t,e){var n=i.props.prefixCls,r=t||h.a.createElement("button",{type:"button","aria-label":e,className:"".concat(n,"-item-link")});return"function"==typeof t&&(r=h.a.createElement(t,Object(o.a)({},i.props))),r},i.savePaginationNode=function(t){i.paginationNode=t},i.isValid=function(t){return"number"==typeof(e=t)&&isFinite(e)&&Math.floor(e)===e&&t!==i.state.current;var e},i.shouldDisplayQuickJumper=function(){var t=i.props,e=t.showQuickJumper,n=t.pageSize;return!(t.total<=n)&&e},i.handleKeyDown=function(t){t.keyCode!==g&&t.keyCode!==v||t.preventDefault()},i.handleKeyUp=function(t){var e=i.getValidValue(t);e!==i.state.currentInputValue&&i.setState({currentInputValue:e}),t.keyCode===m?i.handleChange(e):t.keyCode===g?i.handleChange(e-1):t.keyCode===v&&i.handleChange(e+1)},i.changePageSize=function(t){var e=i.state.current,n=w(t,i.state,i.props);e=e>n?n:e,0===n&&(e=i.state.current),"number"==typeof t&&("pageSize"in i.props||i.setState({pageSize:t}),"current"in i.props||i.setState({current:e,currentInputValue:e})),i.props.onShowSizeChange(e,t),"onChange"in i.props&&i.props.onChange&&i.props.onChange(e,t)},i.handleChange=function(t){var e=i.props.disabled,n=t;if(i.isValid(n)&&!e){var r=w(void 0,i.state,i.props);n>r?n=r:n<1&&(n=1),"current"in i.props||i.setState({current:n,currentInputValue:n});var o=i.state.pageSize;return i.props.onChange(n,o),n}return i.state.current},i.prev=function(){i.hasPrev()&&i.handleChange(i.state.current-1)},i.next=function(){i.hasNext()&&i.handleChange(i.state.current+1)},i.jumpPrev=function(){i.handleChange(i.getJumpPrevPage())},i.jumpNext=function(){i.handleChange(i.getJumpNextPage())},i.hasPrev=function(){return i.state.current>1},i.hasNext=function(){return i.state.current2?n-2:0),r=2;r=n?n:Number(e)}},{key:"getShowSizeChanger",value:function(){var t=this.props,e=t.showSizeChanger,n=t.total,i=t.totalBoundaryShowSizeChanger;return void 0!==e?e:n>i}},{key:"renderPrev",value:function(t){var e=this.props,n=e.prevIcon,i=(0,e.itemRender)(t,"prev",this.getItemIcon(n,"prev page")),r=!this.hasPrev();return Object(u.isValidElement)(i)?Object(u.cloneElement)(i,{disabled:r}):i}},{key:"renderNext",value:function(t){var e=this.props,n=e.nextIcon,i=(0,e.itemRender)(t,"next",this.getItemIcon(n,"next page")),r=!this.hasNext();return Object(u.isValidElement)(i)?Object(u.cloneElement)(i,{disabled:r}):i}},{key:"render",value:function(){var t=this,e=this.props,n=e.prefixCls,o=e.className,a=e.style,s=e.disabled,l=e.hideOnSinglePage,c=e.total,d=e.locale,m=e.showQuickJumper,g=e.showLessItems,v=e.showTitle,y=e.showTotal,x=e.simple,C=e.itemRender,k=e.showPrevNextJumpers,S=e.jumpPrevIcon,E=e.jumpNextIcon,T=e.selectComponentClass,O=e.selectPrefixCls,N=e.pageSizeOptions,L=this.state,A=L.current,_=L.pageSize,M=L.currentInputValue;if(!0===l&&c<=_)return null;var P=w(void 0,this.state,this.props),D=[],I=null,R=null,B=null,j=null,z=null,F=m&&m.goButton,H=g?1:2,W=A-1>0?A-1:0,V=A+1=2*H&&3!==A&&(D[0]=Object(u.cloneElement)(D[0],{className:"".concat(n,"-item-after-jump-prev")}),D.unshift(I)),P-A>=2*H&&A!==P-2&&(D[D.length-1]=Object(u.cloneElement)(D[D.length-1],{className:"".concat(n,"-item-before-jump-next")}),D.push(R)),1!==Y&&D.unshift(B),J!==P&&D.push(j)}var tt=null;y&&(tt=h.a.createElement("li",{className:"".concat(n,"-total-text")},y(c,[0===c?0:(A-1)*_+1,A*_>c?c:A*_])));var et=!this.hasPrev()||!P,nt=!this.hasNext()||!P;return h.a.createElement("ul",Object(i.a)({className:p()(n,o,Object(r.a)({},"".concat(n,"-disabled"),s)),style:a,unselectable:"unselectable",ref:this.savePaginationNode},G),tt,h.a.createElement("li",{title:v?d.prev_page:null,onClick:this.prev,tabIndex:et?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(n,"-prev"),Object(r.a)({},"".concat(n,"-disabled"),et)),"aria-disabled":et},this.renderPrev(W)),D,h.a.createElement("li",{title:v?d.next_page:null,onClick:this.next,tabIndex:nt?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(n,"-next"),Object(r.a)({},"".concat(n,"-disabled"),nt)),"aria-disabled":nt},this.renderNext(V)),h.a.createElement(b,{disabled:s,locale:d,rootPrefixCls:n,selectComponentClass:T,selectPrefixCls:O,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:A,pageSize:_,pageSizeOptions:N,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:F}))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n={};if("current"in t&&(n.current=t.current,t.current!==e.current&&(n.currentInputValue=n.current)),"pageSize"in t&&t.pageSize!==e.pageSize){var i=e.current,r=w(t.pageSize,e,t);i=i>r?r:i,"current"in t||(n.current=i,n.currentInputValue=i),n.pageSize=t.pageSize}return n}}]),n}(h.a.Component);k.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:C,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:C,locale:x.a,style:{},itemRender:function(t,e,n){return n},totalBoundaryShowSizeChanger:50};var S=k},"6K3P": /*!********************************************!*\ !*** ./src/assets/images/paper/jinshi.svg ***! \********************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/jinshi.9b74f304.svg"},"7Cbv": /*!**************************************************************!*\ !*** ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules ***! \**************************************************************/ /*! exports provided: default */ /*! exports used: default */function(t,e,n){"use strict";var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),r=new Uint8Array(16);function o(){if(!i)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(r)}var a=/^(?:[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;for(var s=function(t){return"string"==typeof t&&a.test(t)},l=[],c=0;c<256;++c)l.push((c+256).toString(16).substr(1));var u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n};e.a=function(t,e,n){var i=(t=t||{}).random||(t.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(var r=0;r<16;++r)e[n+r]=i[r];return e}return u(i)}},"7ahc": /*!*************************************************************!*\ !*** ./src/components/markdown-editor/code-block/index.tsx ***! \*************************************************************/ /*! exports provided: default, MyCodeMirror */ /*! exports used: MyCodeMirror, default */function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),o=(n(/*! antd/es/button/style */"+L6B"),n(/*! antd/es/button */"2/Rp")),a=(n(/*! antd/es/form/style */"y8nQ"),n(/*! antd/es/form */"Vl3Y")),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=(n(/*! antd/es/select/style */"OaEy"),n(/*! antd/es/select */"2fM7")),c=n(/*! react */"q1tI"),u=n.n(c),h=n(/*! codemirror */"VrN/"),d=n.n(h),p=(n(/*! codemirror/lib/codemirror.css */"p77/"),n(/*! codemirror/theme/blackboard.css */"c5Ni"),l.a.Option),f={labelCol:{span:4},wrapperCol:{span:20}},m={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"]};function g(t){var e=t.value,n=t.onChange,r=t.mode,o=t.options,a=void 0===o?{}:o,l=Object(c.useRef)(),h=Object(c.useState)(),p=Object(s.a)(h,2),f=p[0],m=p[1];return Object(c.useEffect)((function(){if(f){function t(t){var e=t.getValue();n&&n(e)}return f.on("change",t),function(){f.off("change",t)}}}),[f,n]),Object(c.useEffect)((function(){f&&f.setOption("mode",r)}),[f,r]),Object(c.useEffect)((function(){f&&(e===f.getValue()&&""!==e||setTimeout((function(){f.setValue(e||" ")}),300))}),[f,e]),Object(c.useEffect)((function(){if(l.current&&!f){var t=d.a.fromTextArea(l.current,Object(i.a)({mode:r,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},a));m(t)}}),[l.current,f]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:l}))}e.b=function(t){var e=t.callback,n=t.onCancel,i=Object(c.useState)("python"),h=Object(s.a)(i,2),d=h[0],v=h[1];return u.a.createElement(a.a,Object(r.a)({},f,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(t){e(t)}}),u.a.createElement(a.a.Item,{label:"代码语言",name:"language"},u.a.createElement(l.a,{onChange:function(t){v(m[t][1])}},Object.keys(m).map((function(t){return u.a.createElement(p,{key:t,value:t},m[t][0])})))),u.a.createElement(a.a.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}]},u.a.createElement(g,{mode:d})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(o.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),u.a.createElement(o.a,{type:"ghost",onClick:n},"取消")))}},"7ixt": /*!**************************************************!*\ !*** ./node_modules/rc-tooltip/es/placements.js ***! \**************************************************/ /*! exports provided: placements, default */ /*! exports used: placements */function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i={adjustX:1,adjustY:1},r=[0,0],o={left:{points:["cr","cl"],overflow:i,offset:[-4,0],targetOffset:r},right:{points:["cl","cr"],overflow:i,offset:[4,0],targetOffset:r},top:{points:["bc","tc"],overflow:i,offset:[0,-4],targetOffset:r},bottom:{points:["tc","bc"],overflow:i,offset:[0,4],targetOffset:r},topLeft:{points:["bl","tl"],overflow:i,offset:[0,-4],targetOffset:r},leftTop:{points:["tr","tl"],overflow:i,offset:[-4,0],targetOffset:r},topRight:{points:["br","tr"],overflow:i,offset:[0,-4],targetOffset:r},rightTop:{points:["tl","tr"],overflow:i,offset:[4,0],targetOffset:r},bottomRight:{points:["tr","br"],overflow:i,offset:[0,4],targetOffset:r},rightBottom:{points:["bl","br"],overflow:i,offset:[4,0],targetOffset:r},bottomLeft:{points:["tl","bl"],overflow:i,offset:[0,4],targetOffset:r},leftBottom:{points:["br","bl"],overflow:i,offset:[-4,0],targetOffset:r}}},"7qnI": /*!********************************************************!*\ !*** ./src/components/Editor/NullChildEditor/index.js ***! \********************************************************/ /*! exports provided: default */ /*! exports used: default */function(t,e,n){"use strict";n(/*! antd/es/tooltip/style */"5Dmo");var i=n(/*! antd/es/tooltip */"3S7+"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),l=(n(/*! antd/es/input/style */"5NDa"),n(/*! antd/es/input */"5rEg")),c=n(/*! react */"q1tI"),u=n.n(c),h=n(/*! ./index.less?modules */"O2Wb"),d=n.n(h),p=l.a.TextArea,f=function(t){Object(a.a)(n,t);var e=Object(s.a)(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"render",value:function(){var t=this,e=this.props,n=e.index,r=e.onAnswerChange,o=e.addChildAnswer,a=e.exerciseIsPublish,s=e.answers,l=e.activeOptionErrorIndex,c=e.flex,h=void 0===c?"0 0 1000px":c;return u.a.createElement("div",{className:d.a.flex},u.a.createElement("div",{className:"".concat(d.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"答案(填空",n+1,"):"),u.a.createElement("div",{className:"".concat(d.a.flex," ").concat(d.a.flex1),style:{flexDirection:"column"}},s.map((function(e,c){var f="".concat(n,"-").concat(c);return u.a.createElement("div",{className:"".concat(d.a.flex," ").concat(d.a.flex1),key:c},u.a.createElement("div",{className:d.a.flex1,style:{flex:h}},u.a.createElement("div",null,u.a.createElement(p,{className:f===l?d.a.error:"",spellCheck:!1,rows:4,value:e||"",defaultValue:"请输入参考答案".concat(0==c?"":"(可选)"),onChange:function(t){return r(n,c,t.target.value)},style:{minHeight:95}}))),!a&&u.a.createElement(u.a.Fragment,null,0!=c&&u.a.createElement(i.a,{title:"删除"},u.a.createElement("i",{className:"".concat(d.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return t.props.deleteChildAnswer(n,c)},style:{float:"right"}})),0===c&&u.a.createElement(i.a,{title:"删除"},u.a.createElement("i",{className:"".concat(d.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return t.props.deleteChildAnswermain(n,c)},style:{float:"right"}})),u.a.createElement(i.a,{title:"新增参考答案"},u.a.createElement("i",{className:"".concat(d.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return o(n)},style:{float:"right",visibility:c==s.length-1?"":"hidden"}}))))}))))}}]),n}(c.Component);e.a=f},"8EBN": /*!**********************************************!*\ !*** ./node_modules/codemirror/mode/meta.js ***! \**********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){"use strict";t.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 e=0;e-1&&e.substring(r+1,e.length);if(o)return t.findModeByExtension(o)},t.findModeByName=function(e){e=e.toLowerCase();for(var n=0;n"],v=new p.a.Renderer,y=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function b(){m.length=0,g=["
    "]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(){return function t(e,n,i,r){if(n>=e.length||e[n].level<=i)return n;var o=e[n];r.push("
  • "+o.text+"");var a=[];return n=t(e,++n,o.level,a),a.length>0&&(r.push("
      "),a.forEach((function(t){r.push(t)})),r.push("
    ")),r.push("
  • "),n=t(e,n,i,r)}(m,0,0,g),g.push("
"),g.join("")}var w={heading:function(t){var e=y.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[1].length,text:e[2]}},fences:function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:Object(s.a)(e,1)[0].length>=i.length?t.slice(i.length):t})).join("\n")}(n,e[3]||""),r=e[2]?e[2].trim():e[2];if(["latex","katex","math"].indexOf(r)>=0){var o=E(),a=i;i=o,T[o]={type:"block",expression:a}}return{type:"code",raw:n,lang:r,text:i}}}},k=/(?:\${2})([^\n`]+?)(?:\${2})/gi,S=0,E=function(){return"__special_katext_id_".concat(S++,"__")},T={};function O(){S=0,T={}}function N(t){return t=t.replace(k,(function(t,e){var n=E();return T[n]={type:"inline",expression:e},n}))}var L=v.listitem;v.listitem=function(t){return L(N(t))};var A=v.paragraph;v.paragraph=function(t){return A(N(t))};var _=v.tablecell;v.tablecell=function(t,e){return _(N(t),e)},v.code=function(t,e,n){var i=(e||"").match(/\S*/)[0];return i?["latex","katex","math"].indexOf(i)>=0?"

".concat(t,"

"):'
').concat(n?t:Object(f.escape)(t,!0),"
\n"):'
'+(n?t:Object(f.escape)(t,!0))+"
"},v.heading=function(t,e,n){var i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return m.push({anchor:i,level:e,text:t}),"'+t+""},p.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),p.a.use({tokenizer:w,renderer:v});var M=p.a,P=(n("SJMd"),n("ulZh")),D=n.n(P),I=n("m3rI"),R=n("Oy/b"),B=n("p5ED"),j=n("ErOA"),z=function(t,e){return(z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function F(t,e){function n(){this.constructor=t}z(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function H(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))}function W(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]',"select"),this.addActionButton(n,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(n,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(n,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(n,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(n,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(n,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(n,'',"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(t){var n=document.createElement("div");n.className=""+e.toolbarButtonStyleClass.name,n.setAttribute("data-type-name",t.typeName),n.innerHTML=t.icon,n.addEventListener("click",(function(){e.markerToolbarButtonClicked(n,t)})),e.buttons.push(n),e.markerButtons.push(n)})),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 i=document.createElement("div");i.className=this.toolbarBlockStyleClass.name,i.style.whiteSpace="nowrap",i.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(i),this.addActionButton(i,'',"render"),this.addActionButton(i,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},t.prototype.addButtonClickListener=function(t){this.buttonClickListeners.push(t)},t.prototype.removeButtonClickListener=function(t){this.buttonClickListeners.indexOf(t)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(t),1)},t.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},t.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var t=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var e=0;e0&&this.buttonClickListeners.forEach((function(t){return t("marker",e)})),this.markerButtonOverflowBlock.style.display="none"},t.prototype.actionToolbarButtonClicked=function(t,e){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(t){return t("action",e)})),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},t.prototype.setActiveButton=function(t){this.resetButtonStyles(),t.className=t.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),t.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},t.prototype.setActiveMarkerButton=function(t){var e=this.markerButtons.find((function(e){return e.getAttribute("data-type-name")===t}));e&&this.setActiveButton(e)},t.prototype.setCurrentMarker=function(t){var e=this;this.currentMarker=t,this.buttons.filter((function(t){return/delete|notes/.test(t.getAttribute("data-action"))})).forEach((function(t){void 0===e.currentMarker?(t.style.fillOpacity="0.4",t.style.pointerEvents="none"):(t.style.fillOpacity="1",t.style.pointerEvents="all")}))},t}(),Z=function(){function t(t,e,n,i){this.panels=[],this.panelButtons=[],this.markerjsContainer=t,this.displayMode=e,this.uiStyleSettings=n,this.styles=i,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return t.prototype.addStyles=function(){var t;this.toolboxStyleClass=this.styles.addClass(new Y("toolbox","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n "+("popup"===this.displayMode?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+"\n box-sizing: content-box;\n "+("popup"===this.displayMode?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+"\n "+("inline"===this.displayMode?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolboxStyleColorsClass=this.styles.addClass(new Y("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Y("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Y("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new Y("toolbox-panel-row","\n display: flex;\n "+("inline"===this.displayMode?"position: absolute;":"")+"\n "+("inline"===this.displayMode?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+"\n cursor: default;\n height: "+1.5*this.uiStyleSettings.toolbarHeight+"px;\n "+("inline"===this.displayMode?"width: 100%;":"")+"\n box-sizing: content-box;\n ")),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Y("toolbox-panel-row_colors","\n background-color: "+(null!==(t=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==t?t:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n ")),this.toolboxButtonStyleClass=this.styles.addClass(new Y("toolbox_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n box-sizing: content-box;\n ")),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Y("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Y("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new X("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new X("."+this.toolboxButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n "))},t.prototype.show=function(t){var e;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=t,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==e?e:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},t.prototype.setPanelButtons=function(t){var e,n,i=this;this.panels=t,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==e?e:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(null!==(n=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==n?n:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach((function(t){var e;t.uiStyleSettings=i.uiStyleSettings;var n=document.createElement("div");n.className=i.toolboxButtonStyleClass.name+" "+(null!==(e=i.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==e?e:i.toolboxButtonStyleColorsClass.name),n.innerHTML=t.icon,n.title=t.title,n.addEventListener("click",(function(){i.panelButtonClick(t)})),i.panelButtons.push(n),i.buttonRow.appendChild(n)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},t.prototype.panelButtonClick=function(t){var e=this,n=-1;if(t!==this.activePanel){n=this.panels.indexOf(t),this.panelRow.innerHTML="";var i=t.getUi();i.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(i),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=t}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout((function(){"inline"===e.displayMode?e.panelRow.style.display="none":e.panelRow.style.visibility="hidden"}),200);this.panelButtons.forEach((function(t,i){var r,o;t.className=e.toolboxButtonStyleClass.name+" "+(i===n?""+(null!==(r=e.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==r?r:e.toolboxActiveButtonStyleColorsClass.name):""+(null!==(o=e.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==o?o:e.toolboxButtonStyleColorsClass.name))}))},t}(),Q=function(t,e){this.title=t,this.icon=e},tt=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'')||this;return o.colors=[],o.addTransparent=!1,o.colorBoxes=[],o.colors=n,o.currentColor=i,o.setCurrentColor=o.setCurrentColor.bind(o),o.getColorBox=o.getColorBox.bind(o),o}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.whiteSpace="nowrap",this.colors.forEach((function(n){var i=t.getColorBox(n);e.appendChild(i),t.colorBoxes.push(i)})),e},e.prototype.getColorBox=function(t){var e=this,n=this.uiStyleSettings.toolbarHeight/4,i=this.uiStyleSettings.toolbarHeight-n,r=document.createElement("div");r.style.display="inline-block",r.style.boxSizing="content-box",r.style.width=i-2+"px",r.style.height=i-2+"px",r.style.padding="1px",r.style.marginRight="2px",r.style.marginBottom="2px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderRadius=(i+2)/2+"px",r.style.borderColor=t===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentColor(t,r)}));var o=document.createElement("div");return o.style.display="inline-block",o.style.width=i-2+"px",o.style.height=i-2+"px",o.style.backgroundColor=t,o.style.borderRadius=i/2+"px","transparent"===t&&(o.style.fill=this.uiStyleSettings.toolboxAccentColor,o.innerHTML='\n \n '),r.appendChild(o),r},e.prototype.setCurrentColor=function(t,e){var n=this;this.currentColor=t,this.colorBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(t)},e}(Q),et=function(){function t(t,e,n){this._state="new",this._isSelected=!1,this._container=t,this._overlayContainer=e,this.globalSettings=n,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(t.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!1},Object.defineProperty(t.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),t.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},t.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},t.prototype.pointerDown=function(t,e){},t.prototype.dblClick=function(t,e){},t.prototype.manipulate=function(t){},t.prototype.pointerUp=function(t){this.stateChanged()},t.prototype.dispose=function(){},t.prototype.addMarkerVisualToContainer=function(t){this.container.childNodes.length>0?this.container.insertBefore(t,this.container.childNodes[0]):this.container.appendChild(t)},t.prototype.getState=function(){return{typeName:t.typeName,state:this.state,notes:this.notes}},t.prototype.restoreState=function(t){this._state=t.state,this.notes=t.notes},t.prototype.scale=function(t,e){},t.prototype.colorChanged=function(t){this.onColorChanged&&this.onColorChanged(t),this.stateChanged()},t.prototype.fillColorChanged=function(t){this.onFillColorChanged&&this.onFillColorChanged(t),this.stateChanged()},t.prototype.stateChanged=function(){if(this.onStateChanged&&"creating"!==this.state&&"new"!==this.state){var t=this.getState();void 0!==this.manipulationStartState&&(this.manipulationStartState.state="select"),t.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(t)&&this.onStateChanged(this)}},t.typeName="MarkerBase",t}(),nt=function(){function t(){this.findGripByVisual=this.findGripByVisual.bind(this)}return t.prototype.findGripByVisual=function(t){return this.topLeft.ownsTarget(t)?this.topLeft:this.topCenter.ownsTarget(t)?this.topCenter:this.topRight.ownsTarget(t)?this.topRight:this.centerLeft.ownsTarget(t)?this.centerLeft:this.centerRight.ownsTarget(t)?this.centerRight:this.bottomLeft.ownsTarget(t)?this.bottomLeft:this.bottomCenter.ownsTarget(t)?this.bottomCenter:this.bottomRight.ownsTarget(t)?this.bottomRight:void 0},t}(),it=function(){function t(){this.GRIP_SIZE=10,this.visual=G.createGroup(),this.visual.appendChild(G.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(G.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return t.prototype.ownsTarget=function(t){return t===this.visual||t===this.visual.childNodes[0]||t===this.visual.childNodes[1]},t}(),rt=function(){function t(){}return t.toITransformMatrix=function(t){return{a:t.a,b:t.b,c:t.c,d:t.d,e:t.e,f:t.f}},t.toSVGMatrix=function(t,e){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f,t},t}(),ot=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.left=0,r.top=0,r.width=0,r.height=0,r.defaultSize={x:50,y:20},r.offsetX=0,r.offsetY=0,r.rotationAngle=0,r.CB_DISTANCE=10,r._suppressMarkerCreateEvent=!1,r.container.transform.baseVal.appendItem(G.createTransform()),r.setupControlBox(),r}return F(e,t),Object.defineProperty(e.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"visual",{get:function(){return this._visual},set:function(t){this._visual=t;var e=G.createTransform();this._visual.transform.baseVal.appendItem(e)},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!!(void 0!==this.controlGrips.findGripByVisual(e)||void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(e))},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.left=e.x,this.top=e.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var i=this.unrotatePoint(e);if(this.manipulationStartX=i.x,this.manipulationStartY=i.y,this.offsetX=i.x-this.left,this.offsetY=i.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(n),void 0!==this.activeGrip)this._state="resize";else if(void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(n)){this.activeGrip=this.rotatorGrip;var r=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=r.x-this.width/2,this.top=r.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var o=this.container.transform.baseVal.getItem(0);o.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(o,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},e.prototype.pointerUp=function(e){var n=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(e),this._state="select","creating"===n&&this.onMarkerCreated&&!1===this._suppressMarkerCreateEvent&&this.onMarkerCreated(this)},e.prototype.moveVisual=function(t){this.visual.style.transform="translate("+t.x+"px, "+t.y+"px)"},e.prototype.manipulate=function(t){var e=this.unrotatePoint(t);"creating"===this.state?this.resize(t):"move"===this.state?(this.left=this.manipulationStartLeft+(e.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(e.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(e):"rotate"===this.state&&this.rotate(t)},e.prototype.resize=function(t){var e=this.manipulationStartLeft,n=this.manipulationStartWidth,i=this.manipulationStartTop,r=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:e=this.manipulationStartLeft+t.x-this.manipulationStartX,n=this.manipulationStartWidth+this.manipulationStartLeft-e;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:n=this.manipulationStartWidth+t.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:i=this.manipulationStartTop+t.y-this.manipulationStartY,r=this.manipulationStartHeight+this.manipulationStartTop-i;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:r=this.manipulationStartHeight+t.y-this.manipulationStartY}n>=0?(this.left=e,this.width=n):(this.left=e+n,this.width=-n),r>=0?(this.top=i,this.height=r):(this.top=i+r,this.height=-r),this.setSize()},e.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},e.prototype.rotate=function(t){if(Math.abs(t.x-this.centerX)>.1){var e=Math.sign(t.x-this.centerX);this.rotationAngle=180*Math.atan((t.y-this.centerY)/(t.x-this.centerX))/Math.PI+90*e,this.applyRotation()}},e.prototype.applyRotation=function(){var t=this.container.transform.baseVal.getItem(0);t.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(t,0)},e.prototype.rotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM(),n=G.createPoint(t.x,t.y);return{x:(n=n.matrixTransform(e)).x,y:n.y}},e.prototype.unrotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM();e=e.inverse();var n=G.createPoint(t.x,t.y);return{x:(n=n.matrixTransform(e)).x,y:n.y}},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=G.createGroup();var t=G.createTransform();t.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(t),this.container.appendChild(this.controlBox),this.controlRect=G.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),!0!==this.globalSettings.disableRotation&&(this.rotatorGripLine=G.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 nt,this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){var t=this.controlBox.transform.baseVal.getItem(0);t.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(t,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),void 0!==this.rotatorGripLine&&(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()},e.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(),!0!==this.globalSettings.disableRotation&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},e.prototype.createGrip=function(){var t=new it;return t.visual.transform.baseVal.appendItem(G.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.controlGrips.topLeft.GRIP_SIZE,e=-t/2,n=e,i=(this.width+this.CB_DISTANCE)/2-t/2,r=(this.height+this.CB_DISTANCE)/2-t/2,o=this.height+this.CB_DISTANCE-t/2,a=this.width+this.CB_DISTANCE-t/2;this.positionGrip(this.controlGrips.topLeft.visual,e,n),this.positionGrip(this.controlGrips.topCenter.visual,i,n),this.positionGrip(this.controlGrips.topRight.visual,a,n),this.positionGrip(this.controlGrips.centerLeft.visual,e,r),this.positionGrip(this.controlGrips.centerRight.visual,a,r),this.positionGrip(this.controlGrips.bottomLeft.visual,e,o),this.positionGrip(this.controlGrips.bottomCenter.visual,i,o),this.positionGrip(this.controlGrips.bottomRight.visual,a,o),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,i,n-3*this.CB_DISTANCE)},e.prototype.positionGrip=function(t,e,n){var i=t.transform.baseVal.getItem(0);i.setTranslate(e,n),t.transform.baseVal.replaceItem(i,0)},e.prototype.hideControlBox=function(){this.controlBox.style.display="none"},e.prototype.showControlBox=function(){this.controlBox.style.display=""},e.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:rt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:rt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.left=n.left,this.top=n.top,this.width=n.width,this.height=n.height,this.rotationAngle=n.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,n.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,n.containerTransformMatrix))},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n);var i=this.rotatePoint({x:this.left,y:this.top}),r=this.unrotatePoint({x:i.x*e,y:i.y*n});this.left=r.x,this.top=r.y,this.width=this.width*e,this.height=this.height*n,this.adjustControlBox()},e}(et),at=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.createVisual=r.createVisual.bind(r),r}return F(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=G.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.setSize=function(){t.prototype.setSize.call(this),G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&G.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&G.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&G.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&G.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},e.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){var n=e;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize()},e.title="Rectangle marker",e}(ot),st=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'')||this;return o.widths=[],o.widthBoxes=[],o.widths=n,o.currentWidth=i,o.setCurrentWidth=o.setCurrentWidth.bind(o),o}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.widths.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.flexGrow="2",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===t.currentWidth?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentWidth(n,i)})),e.appendChild(i);var r=document.createElement("div");r.innerText=n.toString(),r.style.marginRight="5px",i.appendChild(r);var o=document.createElement("div");o.style.minHeight="20px",o.style.flexGrow="2",o.style.display="flex",o.style.alignItems="center";var a=document.createElement("hr");a.style.minWidth="20px",a.style.border="0px",a.style.borderTop=n+"px solid "+t.uiStyleSettings.toolboxColor,a.style.flexGrow="2",o.appendChild(a),i.appendChild(o),t.widthBoxes.push(i)})),e},e.prototype.setCurrentWidth=function(t,e){var n=this;this.currentWidth=t,this.widthBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},e}(Q),lt=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'')||this;return o.styles=[],o.styleBoxes=[],o.styles=n,o.currentStyle=i,o.setCurrentStyle=o.setCurrentStyle.bind(o),o}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.styles.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/t.styles.length-5+"%",i.style.borderColor=n===t.currentStyle?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentStyle(n,i)})),e.appendChild(i);var r=document.createElement("div");r.style.minHeight="20px",r.style.flexGrow="2",r.style.overflow="hidden";var o='\n \n ";r.innerHTML=o,i.appendChild(r),t.styleBoxes.push(i)})),e},e.prototype.setCurrentStyle=function(t,e){var n=this;this.currentStyle=t,this.styleBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},e}(Q),ct=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new tt("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new st("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new lt("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="FrameMarker",e.title="Frame marker",e.icon='',e}(at),ut=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(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.x1=0,r.y1=0,r.x2=0,r.y2=0,r.defaultLength=50,r.manipulationStartX=0,r.manipulationStartY=0,r.manipulationStartX1=0,r.manipulationStartY1=0,r.manipulationStartX2=0,r.manipulationStartY2=0,r.setupControlBox(),r}return F(e,t),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!(!this.grip1.ownsTarget(e)&&!this.grip2.ownsTarget(e))},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.manipulationStartX=e.x,this.manipulationStartY=e.y,"new"===this.state&&(this.x1=e.x,this.y1=e.y,this.x2=e.x,this.y2=e.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"new"!==this.state&&(this.select(),this.grip1.ownsTarget(n)?this.activeGrip=this.grip1:this.grip2.ownsTarget(n)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},e.prototype.pointerUp=function(e){var n=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&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(e),this._state="select","creating"===n&&this.onMarkerCreated&&this.onMarkerCreated(this)},e.prototype.adjustVisual=function(){},e.prototype.manipulate=function(t){"creating"===this.state?this.resize(t):"move"===this.state?(this.x1=this.manipulationStartX1+t.x-this.manipulationStartX,this.y1=this.manipulationStartY1+t.y-this.manipulationStartY,this.x2=this.manipulationStartX2+t.x-this.manipulationStartX,this.y2=this.manipulationStartY2+t.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(t)},e.prototype.resize=function(t){switch(this.activeGrip){case this.grip1:this.x1=t.x,this.y1=t.y;break;case this.grip2:case void 0:this.x2=t.x,this.y2=t.y}this.adjustVisual(),this.adjustControlBox()},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=G.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){this.positionGrips()},e.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},e.prototype.createGrip=function(){var t=new it;return t.visual.transform.baseVal.appendItem(G.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-t/2,this.y1-t/2),this.positionGrip(this.grip2.visual,this.x2-t/2,this.y2-t/2)},e.prototype.positionGrip=function(t,e,n){var i=t.transform.baseVal.getItem(0);i.setTranslate(e,n),t.transform.baseVal.replaceItem(i,0)},e.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.x1=n.x1,this.y1=n.y1,this.x2=n.x2,this.y2=n.y2},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.x1=this.x1*e,this.y1=this.y1*n,this.x2=this.x2*e,this.y2=this.y2*n,this.adjustVisual(),this.adjustControlBox()},e}(et),dt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new tt("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new st("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new lt("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorLine&&e!==this.visibleLine)},e.prototype.createVisual=function(){this.visual=G.createGroup(),this.selectorLine=G.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=G.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},e.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()),G.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),G.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),G.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual(),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.createVisual(),this.adjustVisual()},e.typeName="LineMarker",e.title="Line marker",e.icon='',e}(ht),pt=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'')||this;return o.fonts=[],o.fontBoxes=[],o.fonts=n,o.currentFont=i,o.setCurrentFont=o.setCurrentFont.bind(o),o}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.flexGrow="2",this.fonts.forEach((function(n){var i=document.createElement("div");i.style.display="inline-block",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/t.fonts.length-5+"%",i.style.borderColor=n===t.currentFont?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentFont(n,i)})),e.appendChild(i);var r=document.createElement("div");r.style.display="flex",r.style.minHeight="20px",r.style.flexGrow="2",r.style.fontFamily=n,r.style.overflow="hidden";var o=document.createElement("div");o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.innerHTML="The quick brown fox jumps over the lazy dog",r.appendChild(o),i.appendChild(r),t.fontBoxes.push(i)})),e},e.prototype.setCurrentFont=function(t,e){var n=this;this.currentFont=t,this.fontBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},e}(Q),ft=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.color="transparent",r.padding=5,r.DEFAULT_TEXT="your text here",r.text=r.DEFAULT_TEXT,r.isMoved=!1,r.color=i.defaultColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setColor=r.setColor.bind(r),r.setFont=r.setFont.bind(r),r.renderText=r.renderText.bind(r),r.sizeText=r.sizeText.bind(r),r.textEditDivClicked=r.textEditDivClicked.bind(r),r.showTextEditor=r.showTextEditor.bind(r),r.setSize=r.setSize.bind(r),r.positionTextEditor=r.positionTextEditor.bind(r),r.colorPanel=new tt("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.fontFamilyPanel=new pt("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r}return F(e,t),e.prototype.ownsTarget=function(e){if(t.prototype.ownsTarget.call(this,e)||e===this.visual||e===this.textElement||e===this.bgRectangle)return!0;var n=!1;return this.textElement.childNodes.forEach((function(t){t===e&&(n=!0)})),n},e.prototype.createVisual=function(){this.visual=G.createGroup(),this.bgRectangle=G.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=G.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(G.createTransform()),this.textElement.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.isMoved=!1,this.pointerDownPoint=e,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.renderText=function(){var t=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(e){t.textElement.appendChild(G.createTSpan(""===e.trim()?" ":e.trim(),[["x","0"],["dy","1.2em"]]))})),setTimeout(this.sizeText,10)}},e.prototype.getTextScale=function(){var t=this.textElement.getBBox(),e=1;if(t.width>0&&t.height>0){var n=(1*this.width-this.width*this.padding*2/100)/t.width,i=(1*this.height-this.height*this.padding*2/100)/t.height;e=Math.min(n,i)}return e},e.prototype.getTextPosition=function(t){var e=this.textElement.getBBox(),n=0,i=0;return e.width>0&&e.height>0&&(n=(this.width-e.width*t)/2,i=this.height/2-e.height*t/2),{x:n,y:i}},e.prototype.sizeText=function(){var t=this.textElement.getBBox(),e=this.getTextScale(),n=this.getTextPosition(e);n.y-=t.y*e,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+n.x+"px, "+n.y+"px) scale("+e+", "+e+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(n.x,n.y),this.textElement.transform.baseVal.getItem(1).setScale(e,e))},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(e.x-this.pointerDownPoint.x)>5||Math.abs(e.y-this.pointerDownPoint.y)>5)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.isMoved=!0,this.setSize(),this.sizeText()},e.prototype.setSize=function(){t.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},e.prototype.pointerUp=function(e){var n=this.state;"creating"===n&&(this._suppressMarkerCreateEvent=!0),t.prototype.pointerUp.call(this,e),this.setSize(),("creating"===n||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},e.prototype.showTextEditor=function(){var t=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(t){t.stopPropagation()})),this.textEditor.addEventListener("input",(function(){for(var e=Number.parseFloat(t.textEditor.style.fontSize);t.textEditor.clientWidth>=Number.parseInt(t.textEditor.style.maxWidth)&&e>.9;)e-=.1,t.textEditor.style.fontSize=Math.max(e,.9)+"em"})),this.textEditor.addEventListener("keyup",(function(t){t.cancelBubble=!0})),this.textEditor.addEventListener("paste",(function(t){if(t.clipboardData){var e=t.clipboardData.getData("text"),n=window.getSelection();if(!n.rangeCount)return!1;n.deleteFromDocument(),n.getRangeAt(0).insertNode(document.createTextNode(e)),t.preventDefault()}})),this.textEditDiv.addEventListener("pointerup",(function(){t.textEditDivClicked(t.textEditor.innerText)})),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},e.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var t=this.getTextScale(),e=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),n=this.textElement.getBBox(),i={x:n.width*t,y:n.height*t};e.x-=i.x/2,e.y-=i.y/2,this.textEditor.style.top=e.y+"px",this.textEditor.style.left=e.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-e.x+"px",this.textEditor.style.fontSize=Math.max(16*t,12)+"px",this.textElement.style.display="none"}},e.prototype.textEditDivClicked=function(t){this.text=t.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},e.prototype.select=function(){t.prototype.select.call(this),"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText)},e.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),t.prototype.deselect.call(this)},e.prototype.dblClick=function(e,n){t.prototype.dblClick.call(this,e,n),this.showTextEditor()},e.prototype.setColor=function(t){this.textElement&&G.setAttributes(this.textElement,[["fill",t]]),this.color=t,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(t)},e.prototype.setFont=function(t){this.textElement&&G.setAttributes(this.textElement,[["font-family",t]]),this.fontFamily=t,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},e.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},e.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){var n=e;this.color=n.color,this.fontFamily=n.fontFamily,this.padding=n.padding,this.text=n.text,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize(),this.sizeText(),this.positionTextEditor()},e.typeName="TextMarker",e.title="Text marker",e.icon='',e}(ot),mt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.color="transparent",r.lineWidth=3,r.drawing=!1,r.pixelRatio=1,r.color=i.defaultColor,r.lineWidth=i.defaultStrokeWidth,r.pixelRatio=i.freehandPixelRatio,r.setColor=r.setColor.bind(r),r.addCanvas=r.addCanvas.bind(r),r.finishCreation=r.finishCreation.bind(r),r.setLineWidth=r.setLineWidth.bind(r),r.colorPanel=new tt("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.lineWidthPanel=new st("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.lineWidthPanel.onWidthChanged=r.setLineWidth,r}return F(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.drawingImage)},e.prototype.createVisual=function(){this.visual=G.createGroup(),this.drawingImage=G.createImage(),this.visual.appendChild(this.drawingImage);var t=G.createTransform();this.visual.transform.baseVal.appendItem(t),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,n){"new"===this.state&&(this.addCanvas(),this.createVisual(),this._state="creating"),"creating"===this.state?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(e.x,e.y),this.drawing=!0):t.prototype.pointerDown.call(this,e,n)},e.prototype.manipulate=function(e){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(e.x,e.y),this.canvasContext.stroke()):t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):t.prototype.pointerUp.call(this,e)},e.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)},e.prototype.select=function(){"creating"===this.state&&this.finishCreation(),t.prototype.select.call(this)},e.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),t.prototype.deselect.call(this)},e.prototype.finishCreation=function(){for(var t=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),e=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],n=e[0],i=e[1],r=e[2],o=e[3],a=!1,s=0;s0&&(a=!0,so&&(o=s),l>r&&(r=l));if(a){this.left=n/this.pixelRatio,this.top=i/this.pixelRatio,this.width=(r-n)/this.pixelRatio,this.height=(o-i)/this.pixelRatio;var c=document.createElement("canvas");c.width=r-n,c.height=o-i,c.getContext("2d").putImageData(this.canvasContext.getImageData(n,i,r-n,o-i),0,0),this.drawingImgUrl=c.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},e.prototype.setDrawingImage=function(){G.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},e.prototype.setColor=function(t){this.color=t,this.colorChanged(t)},e.prototype.setLineWidth=function(t){this.lineWidth=t},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({drawingImgUrl:this.drawingImgUrl},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){this.createVisual(),t.prototype.restoreState.call(this,e),this.drawingImgUrl=e.drawingImgUrl,this.setDrawingImage()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setDrawingImage()},e.typeName="FreehandMarker",e.title="Freehand marker",e.icon='',e}(ot),gt=function(t){function e(e,n,i){var r=t.call(this,e,i||'')||this;return r.typeBoxes=[],r.currentType=n,r.setCurrentType=r.setCurrentType.bind(r),r}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2";for(var n=function(n){var r="both";switch(n){case 0:r="both";break;case 1:r="start";break;case 2:r="end";break;case 3:r="none"}var o=document.createElement("div");if(o.style.display="flex",o.style.flexGrow="2",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.borderColor=r===i.currentType?i.uiStyleSettings.toolboxAccentColor:"transparent",o.addEventListener("click",(function(){t.setCurrentType(r,o)})),e.appendChild(o),"both"===r||"start"===r){var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.innerHTML='\n \n ',a.style.marginLeft="5px",o.appendChild(a)}var s=document.createElement("div");s.style.display="flex",s.style.alignItems="center",s.style.minHeight="20px",s.style.flexGrow="2";var l=document.createElement("hr");if(l.style.minWidth="20px",l.style.border="0px",l.style.borderTop="3px solid "+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee"),l.style.flexGrow="2",s.appendChild(l),o.appendChild(s),"both"===r||"end"===r){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.minHeight="20px",c.innerHTML='\n \n ',c.style.marginRight="5px",o.appendChild(c)}i.typeBoxes.push(o)},i=this,r=0;r<4;r++)n(r);return e},e.prototype.setCurrentType=function(t,e){var n=this;this.currentType=t,this.typeBoxes.forEach((function(t){t.style.borderColor=t===e?void 0!==n.uiStyleSettings?n.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},e}(Q),vt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.arrowType="end",r.arrowBaseHeight=10,r.arrowBaseWidth=10,r.getArrowPoints=r.getArrowPoints.bind(r),r.setArrowType=r.setArrowType.bind(r),r.arrowTypePanel=new gt("Arrow type","end"),r.arrowTypePanel.onArrowTypeChanged=r.setArrowType,r}return F(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.arrow1&&e!==this.arrow2)},e.prototype.getArrowPoints=function(t,e){var n=this.arrowBaseWidth+2*this.strokeWidth,i=this.arrowBaseHeight+2*this.strokeWidth;return t-n/2+","+(e+i/2)+" "+t+","+(e-i/2)+" "+(t+n/2)+","+(e+i/2)},e.prototype.createTips=function(){this.arrow1=G.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=G.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.arrow2)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display="both"===this.arrowType||"start"===this.arrowType?"":"none",this.arrow2.style.display="both"===this.arrowType||"end"===this.arrowType?"":"none",G.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),G.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.arrow1.transform.baseVal.getItem(0);n.setRotate(e,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(n,0);var i=this.arrow2.transform.baseVal.getItem(0);i.setRotate(e+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(i,0)}},e.prototype.setArrowType=function(t){this.arrowType=t,this.adjustVisual(),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({arrowType:this.arrowType},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.arrowType=n.arrowType,this.createTips(),this.adjustVisual()},e.typeName="ArrowMarker",e.title="Arrow marker",e.icon='',e}(dt),yt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.fillColor=i.defaultFillColor,r.strokeWidth=0,r.fillPanel=new tt("Color",i.defaultColorSet,i.defaultFillColor),r.fillPanel.onColorChanged=r.setFillColor,r}return F(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="CoverMarker",e.title="Cover marker",e.icon='',e}(at),bt=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'')||this;return o.opacities=[],o.opacityBoxes=[],o.opacities=n,o.currentOpacity=i,o.setCurrentOpacity=o.setCurrentOpacity.bind(o),o}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",e.style.justifyContent="space-between",this.opacities.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===t.currentOpacity?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentOpacity(n,i)})),e.appendChild(i);var r=document.createElement("div");r.innerText=100*n+"%",i.appendChild(r),t.opacityBoxes.push(i)})),e},e.prototype.setCurrentOpacity=function(t,e){var n=this;this.currentOpacity=t,this.opacityBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},e}(Q),xt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.setOpacity=r.setOpacity.bind(r),r.fillColor=i.defaultHighlightColor,r.strokeWidth=0,r.opacity=i.defaultHighlightOpacity,r.fillPanel=new tt("Color",i.defaultColorSet,r.fillColor),r.fillPanel.onColorChanged=r.setFillColor,r.opacityPanel=new bt("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return F(e,t),e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&G.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="HighlightMarker",e.title="Highlight marker",e.icon='',e}(yt),Ct='',wt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.bgColor="transparent",r.tipPosition={x:0,y:0},r.tipBase1Position={x:0,y:0},r.tipBase2Position={x:0,y:0},r.tipMoving=!1,r.color=i.defaultStrokeColor,r.bgColor=i.defaultFillColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setBgColor=r.setBgColor.bind(r),r.getTipPoints=r.getTipPoints.bind(r),r.positionTip=r.positionTip.bind(r),r.setTipPoints=r.setTipPoints.bind(r),r.colorPanel=new tt("Text color",i.defaultColorSet,r.color,''),r.colorPanel.onColorChanged=r.setColor,r.bgColorPanel=new tt("Fill color",i.defaultColorSet,r.bgColor,Ct),r.bgColorPanel.onColorChanged=r.setBgColor,r.fontFamilyPanel=new pt("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.tipGrip=new it,r.tipGrip.visual.transform.baseVal.appendItem(G.createTransform()),r.controlBox.appendChild(r.tipGrip.visual),r}return F(e,t),e.prototype.ownsTarget=function(e){return t.prototype.ownsTarget.call(this,e)||this.tipGrip.ownsTarget(e)||this.tip===e},e.prototype.createTip=function(){G.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=G.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},e.prototype.pointerDown=function(e,n){"new"===this.state&&t.prototype.pointerDown.call(this,e,n),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(n)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):t.prototype.pointerDown.call(this,e,n)},e.prototype.pointerUp=function(e){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,t.prototype.pointerUp.call(this,e);else{var n="creating"===this.state;t.prototype.pointerUp.call(this,e),this.setTipPoints(n),this.positionTip()}},e.prototype.manipulate=function(e){if(this.tipMoving){var n=this.unrotatePoint(e);this.tipPosition={x:n.x-this.manipulationStartLeft,y:n.y-this.manipulationStartTop},this.positionTip()}else t.prototype.manipulate.call(this,e)},e.prototype.setBgColor=function(t){this.bgRectangle&&this.tip&&(G.setAttributes(this.bgRectangle,[["fill",t]]),G.setAttributes(this.tip,[["fill",t]])),this.bgColor=t,this.fillColorChanged(t)},e.prototype.getTipPoints=function(){return this.setTipPoints("creating"===this.state),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},e.prototype.setTipPoints=function(t){void 0===t&&(t=!1);var e=Math.min(this.height/2,15),n=this.height/5;t&&(this.tipPosition={x:e+n/2,y:this.height+20});var i=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?i.1)){var e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.tip1.transform.baseVal.getItem(0);n.setRotate(e,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(n,0);var i=this.tip2.transform.baseVal.getItem(0);i.setRotate(e+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(i,0)}},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e),this.createTips(),this.adjustVisual()},e.typeName="MeasurementMarker",e.title="Measurement marker",e.icon='',e}(dt),Et=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokePanel.colors=i.defaultColorSet,r.fillColor="transparent",r}return F(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="EllipseFrameMarker",e.title="Ellipse frame marker",e.icon='',e}(kt),Tt=function(){function t(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(t.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),t.prototype.addUndoStep=function(t){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(t)||(this.undoStack.push(t),JSON.stringify(this.lastRedoStep)!==JSON.stringify(t)&&this.redoStack.splice(0,this.redoStack.length))},t.prototype.replaceLastUndoStep=function(t){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=t)},t.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},t.prototype.undo=function(){if(this.undoStack.length>1){var t=this.undoStack.pop();return void 0!==t&&this.redoStack.push(t),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},t.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},t}(),Ot=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.curveX=0,r.curveY=0,r.manipulationStartCurveX=0,r.manipulationStartCurveY=0,r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.positionGrips=r.positionGrips.bind(r),r.addControlGrips=r.addControlGrips.bind(r),r.adjustVisual=r.adjustVisual.bind(r),r.setupControlBox=r.setupControlBox.bind(r),r.resize=r.resize.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new tt("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new st("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new lt("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorCurve&&e!==this.visibleCurve&&!this.curveGrip.ownsTarget(e))},e.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},e.prototype.createVisual=function(){this.visual=G.createGroup(),this.selectorCurve=G.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=G.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=e.x,this.curveY=e.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(n)&&(this.activeGrip=this.curveGrip,this._state="resize")},e.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),G.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),G.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),G.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setupControlBox=function(){t.prototype.setupControlBox.call(this),this.curveControlLine1=G.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=G.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)},e.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,t.prototype.addControlGrips.call(this)},e.prototype.positionGrips=function(){t.prototype.positionGrips.call(this);var e=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-e/2,this.curveY-e/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()))},e.prototype.manipulate=function(e){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+e.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+e.y-this.manipulationStartY),t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){this.activeGrip===this.curveGrip&&(this.curveX=e.x,this.curveY=e.y),t.prototype.resize.call(this,e),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual()},e.prototype.scale=function(e,n){this.curveX=this.curveX*e,this.curveY=this.curveY*n,t.prototype.scale.call(this,e,n)},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.curveX=n.curveX,this.curveY=n.curveY,this.createVisual(),this.adjustVisual()},e.typeName="CurveMarker",e.title="Curve marker",e.icon='',e}(ht),Nt=function(){function t(t,e){void 0===e&&(e=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=t,this.cancelable=e}return Object.defineProperty(t.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this._defaultPrevented=!0},t}(),Lt=function(t){function e(e,n,i){var r=t.call(this,e,!1)||this;return r.dataUrl=n,r.state=i,r}return F(e,t),e}(Nt),At=function(t){function e(e,n,i){void 0===i&&(i=!1);var r=t.call(this,e,i)||this;return r.marker=n,r}return F(e,t),e}(Nt),_t=function(){function t(){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 t.prototype.addEventListener=function(t,e){this[t].push(e)},t.prototype.removeEventListener=function(t,e){var n=this[t].indexOf(e);n>-1&&this[t].splice(n,1)},t}(),Mt=function(){function t(e){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ut,this._isOpen=!1,this.undoRedoManager=new Tt,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 _t,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=t.instanceCounter++,this.styles=new $(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=e,this.targetRoot=document.body,this.width=e.clientWidth,this.height=e.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(t.prototype,"ALL_MARKER_TYPES",{get:function(){return[ct,mt,vt,ft,Et,kt,xt,wt,St,yt,dt,Ot]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ct,mt,vt,ft,kt,xt,wt]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ct,mt,vt,ft,xt]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(t){var e=this;this._availableMarkerTypes.splice(0),t.forEach((function(t){if("string"==typeof t){var n=e.ALL_MARKER_TYPES.find((function(e){return e.typeName===t}));void 0!==n&&e._availableMarkerTypes.push(n)}else e._availableMarkerTypes.push(t)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(t){this._zoomLevel=t,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(t.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),t.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),U.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},t.prototype.show=function(){var t=this;void 0===this.styles.styleSheetRoot&&void 0!==K.styleSheetRoot&&(this.styles.styleSheetRoot=K.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach((function(e){return e(new Nt(t))}))},t.prototype.render=function(){return H(this,void 0,void 0,(function(){var t;return W(this,(function(e){switch(e.label){case 0:return this.setCurrentMarker(),(t=new q).naturalSize=this.renderAtNaturalSize,t.imageType=this.renderImageType,t.imageQuality=this.renderImageQuality,t.markersOnly=this.renderMarkersOnly,t.width=this.renderWidth,t.height=this.renderHeight,[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return e.sent(),[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,e.sent()]}}))}))},t.prototype.close=function(t){var e=this;if(void 0===t&&(t=!1),this.isOpen){var n=!1;t||this.eventListeners.beforeclose.forEach((function(t){var i=new Nt(e,!0);t(i),i.defaultPrevented&&(n=!0)})),n||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.settings.displayMode&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach((function(t){return t(new Nt(e))})),this.detachEvents(),this._isOpen=!1)}},t.prototype.addMarkersToToolbar=function(){for(var t,e=[],n=0;nthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*t:this.editorCanvas.clientWidth,n=e',t.title="Powered by marker.js",t.style.display="grid",t.style.alignItems="center",t.style.justifyItems="center",t.style.padding="3px",t.style.width="20px",t.style.height="20px",this.logoUI.appendChild(t),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},t.prototype.positionLogo=function(){this.logoUI&&("right"!==this.uiStyleSettings.logoPosition?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")},t.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"},t.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},t.prototype.showUI=function(){switch("popup"===this.settings.displayMode&&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 t=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=t+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?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=void 0!==this.uiStyleSettings.zIndex?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="popup"===this.settings.displayMode?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new J(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","popup"===this.settings.displayMode&&(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","popup"===this.settings.displayMode&&(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(t),1),t.dispose()},t.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),void 0!==this._currentMarker&&("new"!==this._currentMarker.state?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},t.prototype.toolbarButtonClicked=function(t,e){if("marker"===t&&void 0!==e)this.createNewMarker(e);else if("action"===t)switch(e){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":void 0===this.notesArea?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},t.prototype.deleteSelectedMarker=function(){var t=this;if(void 0!==this._currentMarker){var e=!1;if(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new At(t,t._currentMarker,!0);n(i),i.defaultPrevented&&(e=!0)})),!e){var n=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(e){return e(new At(t,n))}))}}},t.prototype.clear=function(){var t=this,e=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new At(t,void 0,!0);n(i),i.defaultPrevented&&(e=!0)})),!e)){this.setCurrentMarker();for(var n=function(e){var n=i.markers[e];i.setCurrentMarker(i.markers[e]),i._currentMarker.dispose(),i.markerImage.removeChild(i._currentMarker.container),i.markers.splice(i.markers.indexOf(i._currentMarker),1),i.eventListeners.markerdelete.forEach((function(e){return e(new At(t,n))}))},i=this,r=this.markers.length-1;r>=0;r--)n(r);this.addUndoStep()}},Object.defineProperty(t.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),t.prototype.showNotesEditor=function(){var t;void 0!==this._currentMarker&&(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=null!==(t=this._currentMarker.notes)&&void 0!==t?t:"",this.overlayContainer.appendChild(this.notesArea))},t.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(void 0!==this._currentMarker&&(this._currentMarker.notes=""!==this.notesArea.value.trim()?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},t.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},t.prototype.addUndoStep=function(){var t=this;if(void 0===this._currentMarker||"edit"!==this._currentMarker.state){var e=this.getState(),n=this.undoRedoManager.getLastUndoStep();if(!n||n.width===e.width&&n.height===e.height){var i=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(e),i1&&this.panTo({x:t.clientX,y:t.clientY}))},t.prototype.onPointerUp=function(t){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this._currentMarker&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(t.clientX,t.clientY)),this.isDragging=!1,this.addUndoStep()},t.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},t.prototype.onKeyUp=function(t){void 0===this._currentMarker||void 0!==this.notesArea||"Delete"!==t.key&&"Backspace"!==t.key||this.deleteSelectedMarker()},t.prototype.clientToLocalCoordinates=function(t,e){var n=this.markerImage.getBoundingClientRect();return{x:(t-n.left)/this.zoomLevel,y:(e-n.top)/this.zoomLevel}},t.prototype.onWindowResize=function(){this.positionUI()},t.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var t=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=t+"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()},t.prototype.addLicenseKey=function(t){U.addKey(t)},t.prototype.addEventListener=function(t,e){this.eventListeners.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.eventListeners.removeEventListener(t,e)},t.prototype.renderState=function(t){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(t),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(t.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),t.prototype.focus=function(){var t=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach((function(e){return e(new Nt(t))})))},t.prototype.blur=function(){var t=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach((function(e){return e(new Nt(t))})))},t.instanceCounter=0,t}(),Pt=function(t,e){return(Pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)}; /* ********************************** 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. ***************************************************************************** */function Dt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Pt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function It(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))}function Rt(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&e>0){var n=new Kt(t,e),i=n.ratio>=1?20:n.getHorizontalLength(20),r=n.ratio<1?20:n.getVerticalLength(20),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(o);var a=jt.createDefs();o.appendChild(a);var s=jt.createElement("clipPath",[["id","text-bg-clip"]]);a.appendChild(s);var l=jt.createPath(jt.getHollowRectanglePath((24-i)/2,(24-r)/2,i,r,(24-i)/2+2,(24-r)/2+2,i-4,r-4));o.appendChild(l);var c=jt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);c.appendChild(jt.createTSpan(t+":"+e)),o.appendChild(c);var u=c.getBBox();jt.setAttributes(c,[["x",((24-u.width)/2).toString()],["y",((24-u.height)/2-u.y).toString()]]);var h=jt.createPath(jt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(u.width))/2,(24-Math.ceil(u.height))/2,Math.ceil(u.width),Math.ceil(u.height)));return s.appendChild(h),jt.setAttributes(l,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(o),o.outerHTML}return''},t}(),Xt=function(t){function e(e,n,i){var r=t.call(this,e,n)||this;return r.isDropdownOpen=!1,r.onClick=r.dropdownButtonClicked,r.dropdownButtons=i,r}return Dt(e,t),e.prototype.setupDropdown=function(){var t=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach((function(e){e.className=t.className,e.colorsClassName=t.colorsClassName,t.dropdownBlock.appendChild(e.getUI())})),this.uiContainer.appendChild(this.dropdownBlock)},e.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},e.prototype.dropdownButtonClicked=function(){void 0===this.dropdownBlock&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},e.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},e.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},e.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},e}(Ut),Yt=function(){function t(t,e){this.GRIP_SIZE=10,this.color=t,this.fillColor=e,this.visual=jt.createGroup(),this.visual.appendChild(jt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(jt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return t.prototype.ownsTarget=function(t){return t===this.visual||t===this.visual.childNodes[0]||t===this.visual.childNodes[1]},t.prototype.setCenter=function(t,e){this.visual.childNodes.forEach((function(n){return jt.setAttributes(n,[["cx",t.toString()],["cy",e.toString()]])}))},t}(),Jt=function(){function t(t,e,n,i){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=t,this.canvasHeight=e,this.margin=n,this.container=i,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(t.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(t){this._aspectRatio=t,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(t){this._isGridVisible=t,this.gridContainer&&jt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(t){this._zoomFactor=t,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),t.prototype.open=function(){var t=this;this.cropShadeElement=jt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=jt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var e=0;ethis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-e.height/2),jt.setAttributes(this.cropRectElement,[["x",e.x.toString()],["y",e.y.toString()],["width",e.width.toString()],["height",e.height.toString()]]);var n=e.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach((function(t,i){var r=e.y+n*(i+1);jt.setAttributes(t,[["x1",""+e.x],["y1",""+r],["x2",""+(e.x+e.width)],["y2",""+r]])}));var i=e.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach((function(t,n){var r=e.x+i*(n+1);jt.setAttributes(t,[["x1",""+r],["y1",""+e.y],["x2",""+r],["y2",""+(e.y+e.height)]])})),jt.setAttributes(this.cropShadeElement,[["d",jt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,e.x,e.y,e.width,e.height)]]),this.topLeftGrip.setCenter(e.x,e.y),this.topRightGrip.setCenter(e.x+e.width,e.y),this.bottomLeftGrip.setCenter(e.x,e.y+e.height),this.bottomRightGrip.setCenter(e.x+e.width,e.y+e.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},t.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)},t.prototype.clientToLocalCoordinates=function(t,e){var n=this.container.getBoundingClientRect();return{x:t-n.left+this.margin,y:e-n.top+this.margin}},t.prototype.onPointerDown=function(t){this.container.setPointerCapture(t.pointerId),this.previousPoint=this.clientToLocalCoordinates(t.clientX,t.clientY),this.cropRectElement===t.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(t.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(t.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(t.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(t.target)&&(this.activeGrip=this.bottomRightGrip)},t.prototype.onPointerMove=function(t){if(this.isMoving)this.move(this.clientToLocalCoordinates(t.clientX,t.clientY));else if(this.activeGrip){var e=this.clientToLocalCoordinates(t.clientX,t.clientY);this.resize(e)}t.preventDefault()},t.prototype.onPointerUp=function(t){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(t.pointerId)},t.prototype.move=function(t){var e=t.x-this.previousPoint.x,n=t.y-this.previousPoint.y;1!==this.zoomFactor&&(e=-e/this.zoomFactor,n=-n/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+e),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+n),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=t},t.prototype.resize=function(t){var e=Object.assign({},this.cropRect),n=t.x-this.previousPoint.x,i=t.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:e.x+nthis.canvasWidth*this.zoomFactor&&(n=this.canvasWidth*this.zoomFactor-e.width),e.width+=n}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(e.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(n),e.height=this.aspectRatio.getVerticalLength(e.width)):(e.y+=i,e.height=this.cropRect.y+this.cropRect.height-e.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?e.height=this.aspectRatio.getVerticalLength(e.width):e.height+=i}e.width<10&&(e.x=this.cropRect.x,e.width=10),e.height<10&&(e.y=this.cropRect.y,e.height=10),this.previousPoint=t,e.x>=this.margin&&e.y>=this.margin&&e.x-this.margin+e.width<=this.canvasWidth&&e.y-this.margin+e.height<=this.canvasHeight&&(this.cropRect=e,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},t.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var t=this.cropRect.x+this.cropRect.width/2,e=this.cropRect.y+this.cropRect.height/2,n=this.aspectRatio.getHorizontalLength(this.cropRect.height),i=this.aspectRatio.getVerticalLength(this.cropRect.width);n/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=t-this.cropRect.width/2,this.cropRect.y=e-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)}},t.prototype.getRescaledRect=function(t,e,n,i,r,o){var a=n/t,s=i/e;return{x:(r.x-o)*a+o,y:(r.y-o)*s+o,width:r.width*a,height:r.height*s}},t.prototype.scaleCanvas=function(t,e){var n=this.getRescaledRect(this.canvasWidth,this.canvasHeight,t,e,this.cropRect,this.margin);this.canvasWidth=t,this.canvasHeight=e,this.onCropChange&&this.onCropChange(n),this.setCropRectangle(n)},t}(),Zt=function(){function t(t){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=t,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(t.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),t.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},t.prototype.onPointerDown=function(t){this.controlContainer.setPointerCapture(t.pointerId),this.isDragging=!0,this.previousPoint={x:t.clientX,y:t.clientY}},t.prototype.onPointerMove=function(t){this.isDragging&&(this.onAngleChange&&this.onAngleChange((t.clientX-this.previousPoint.x)/5),this.previousPoint.x=t.clientX)},t.prototype.onPointerUp=function(t){this.isDragging&&this.onAngleChange&&this.onAngleChange((t.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(t.pointerId)},t.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var t=this.angleLabelText.getBBox();jt.setAttributes(this.angleLabelElement,[["x",((this.width-t.width)/2).toString()],["y",(this.height/2).toString()]])}},t.prototype.positionScaleShape=function(){if(this.scaleShape){var t=this.scaleShape.transform.baseVal.getItem(0);t.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(t,0)}},t.prototype.getVisual=function(){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("width",this.width+"px"),t.setAttribute("height",this.height+"px"),t.setAttribute("viewBox","0 0 "+this.width+" "+this.height),t.style.flexShrink="0",document.body.appendChild(t);for(var e="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,n=1;n<=this.width/5+10;n++){var i=n%5==0?this.height/3:this.height/6;e+="h4v"+-i+"h1v"+i}e+="v1H0Z",this.scaleShape=jt.createPath(e);var r=jt.createTransform();this.scaleShape.transform.baseVal.appendItem(r),t.appendChild(this.scaleShape),this.angleLabelElement=jt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=jt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var o=jt.createTSpan("");return o.innerHTML="°",this.angleLabelElement.appendChild(o),t.appendChild(this.angleLabelElement),document.body.removeChild(t),t},t}(),Qt=function(){function t(){this.naturalSize=!1,this.imageType="image/png"}return t.prototype.rasterize=function(t,e,n,i,r,o,a){var s=this;return new Promise((function(l){var c=document.createElement("canvas");c.width=t.width.baseVal.value-2*i,c.height=t.height.baseVal.value-2*i;var u=1,h=1;!0===s.naturalSize?(u=e.naturalWidth/(t.width.baseVal.value-2*i)/o,h=e.naturalHeight/(t.height.baseVal.value-2*i)/a,c.width=e.naturalWidth/o,c.height=e.naturalHeight/a):void 0!==s.width&&void 0!==s.height&&(u=s.width/n.width,h=s.height/n.height,c.width*=u,c.height*=h);var d=c.getContext("2d");d.translate(c.width/2,c.height/2),d.rotate(r*Math.PI/180),d.scale(o,a),d.translate(-c.width/2,-c.height/2),d.drawImage(e,0,0,c.width,c.height);var p=document.createElement("canvas");p.width=n.width*u,p.height=n.height*h,p.getContext("2d").putImageData(d.getImageData((n.x-i)*u,(n.y-i)*h,n.width*u,n.height*h),0,0),l(p.toDataURL(s.imageType,s.imageQuality))}))},t}(),te=function(){function t(e){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=t.instanceCounter++,this.styles=new zt(this.instanceNo),this.target=e,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(t.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(t){this._zoomToCropEnabled=t,t?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(t){this._isGridVisible=t,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gridLines",{get:function(){return this._gridLines},set:function(t){this._gridLines=t,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(t){this._rotationAngle=t,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aspectRatio",{get:function(){var t;return null!==(t=this._aspectRatio)&&void 0!==t?t:this.aspectRatios[0]},set:function(t){this._aspectRatio=t},enumerable:!1,configurable:!0}),t.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(),"popup"===this.displayMode&&this.onPopupResize(),this._isOpen=!0},t.prototype.show=function(){this.showUI(),this.open()},t.prototype.close=function(t){void 0===t&&(t=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.displayMode&&window.removeEventListener("resize",this.setWindowHeight),t||this.closeEventListeners.forEach((function(t){return t()})),this._isOpen=!1)},t.prototype.addRenderEventListener=function(t){this.renderEventListeners.push(t)},t.prototype.removeRenderEventListener=function(t){this.renderEventListeners.indexOf(t)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(t),1)},t.prototype.addCloseEventListener=function(t){this.closeEventListeners.push(t)},t.prototype.removeCloseEventListener=function(t){this.closeEventListeners.indexOf(t)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(t),1)},t.prototype.setupResizeObserver=function(){var t=this;"inline"===this.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){t.resize(t.target.clientWidth,t.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},t.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var t=1*this.target.clientWidth/this.target.clientHeight,e=this.contentDiv.clientWidth/t>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*t:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,n=e+2*this.CANVAS_MARGINt+this.CANVAS_MARGIN?this.target.offsetTop-(t+this.CANVAS_MARGIN):0;this.coverDiv.style.top=e+"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=void 0!==this.styles.settings.zIndex?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=void 0!==this.styles.settings.zIndex?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="popup"===this.displayMode?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,"popup"===this.displayMode&&(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","popup"===this.displayMode&&(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},t.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},t.prototype.addTopToolbar=function(){var t=this;this.topToolbar=new Wt,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 e=new Gt;e.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(e);var n=[];this.aspectRatios.forEach((function(e){var i=new Ut($t.getIcon(e.horizontal,e.vertical),0===e.horizontal&&0===e.vertical?"FREE":e.horizontal+":"+e.vertical);i.onClick=function(){return t.ratioButtonClicked(e)},n.push(i)})),this.aspectRatioButton=new Xt($t.getIcon(0,0),"Aspect ratio",n),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,e.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var i=new Ut('',"Toggle grid");i.isActive=this.isGridVisible,i.onClick=function(){t.isGridVisible=!t.isGridVisible,i.isActive=t.isGridVisible},e.addButton(i);var r=new Ut('',"Zoom to selection");if(r.isActive=this.zoomToCropEnabled,r.onClick=function(){t.zoomToCropEnabled=!t.zoomToCropEnabled,r.isActive=t.zoomToCropEnabled},e.addButton(r),!Bt.isLicensed){var o=new qt;this.topToolbar.addElementBlock(o);var a=document.createElement("div");a.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var s=document.createElement("a");s.style.color="currentColor",s.href="https://markerjs.com/products/cropro",s.target="_blank",s.innerHTML='',a.appendChild(s),o.addElement(a)}var l=new Gt;l.minWidth=3*this.toolbarHeight+"px",l.contentAlign="end",this.topToolbar.addButtonBlock(l);var c=new Ut('',"OK");c.onClick=this.startRenderAndClose,l.addButton(c),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(c.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var u=new Ut('',"Close");u.onClick=this.close,l.addButton(u),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(u.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},t.prototype.addBottomToolbar=function(){var t=this;this.bottomToolbar=new Wt,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 e=new Gt;e.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(e);var n=new Ut('',"Rotate left");n.onClick=this.rotateLeftButtonClicked,e.addButton(n);var i=new Ut('',"Rotate right");i.onClick=this.rotateRightButtonClicked,e.addButton(i);var r=new qt;r.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(r),this.straightener=new Zt("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(e){t.rotateBy(e),t.straightener.angle=t.rotationAngle},r.addElement(this.straightener.getUI());var o=new Gt;o.minWidth=2*this.toolbarHeight+"px",o.contentAlign="end",this.bottomToolbar.addButtonBlock(o);var a=new Ut('',"Flip horizontal");a.onClick=this.flipHorizontallyButtonClicked,o.addButton(a);var s=new Ut('',"Flip vertical");s.onClick=this.flipVerticallyButtonClicked,o.addButton(s)},t.prototype.ratioButtonClicked=function(t){this.aspectRatio=t,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},t.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=$t.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},t.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&0!==this.aspectRatio.horizontal&&0!==this.aspectRatio.vertical?this.cropLayer.aspectRatio=new Kt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},t.prototype.closeUI=function(){"popup"===this.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},t.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},t.prototype.restoreState=function(t){if(t){var e=this.cropLayer.getRescaledRect(t.width,t.height,this.imageWidth,this.imageHeight,t.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(e),this.cropRectChanged(e),this.flippedHorizontally=t.flippedHorizontally,this.flippedVertically=t.flippedVertically,this.applyFlip(),this.rotationAngle=t.rotationAngle,this.applyRotation()}},t.prototype.clientToLocalCoordinates=function(t,e){var n=this.cropImage.getBoundingClientRect();return{x:t-n.left,y:e-n.top}},t.prototype.onWindowResize=function(){this.positionUI()},t.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var t=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=t+"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()},t.prototype.rotateLeftButtonClicked=function(){var t=this.rotationAngle-90;this.rotationAngle%90!=0&&(t+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(t)},t.prototype.rotateRightButtonClicked=function(){var t=this.rotationAngle+90;this.rotationAngle%90!=0&&(t-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(t)},t.prototype.rotateTo=function(t){t=(t=t>180?t-360:t)<=-180?t+360:t,this.rotationAngle=t,this.applyRotation()},t.prototype.rotateBy=function(t){this.rotateTo((this.rotationAngle+t)%360)},t.prototype.applyRotation=function(){var t=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var e=this.editingTargetRotationContainer.transform.baseVal.getItem(0);e.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(e,0);var n=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/n.width,this.imageHeight/n.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=t},t.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},t.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},t.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},t.prototype.startRenderAndClose=function(){return It(this,void 0,void 0,(function(){var t,e;return Rt(this,(function(n){switch(n.label){case 0:return[4,this.render()];case 1:return t=n.sent(),e=this.getState(),this.renderEventListeners.forEach((function(n){return n(t,e)})),this.close(!0),[2]}}))}))},t.prototype.render=function(){return It(this,void 0,void 0,(function(){var t;return Rt(this,(function(e){switch(e.label){case 0:return(t=new Qt).naturalSize=this.renderAtNaturalSize,t.imageType=this.renderImageType,t.imageQuality=this.renderImageQuality,t.width=this.renderWidth,t.height=this.renderHeight,this.unzoomFromCrop(),jt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,t.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 e.sent(),[4,t.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,e.sent()]}}))}))},t.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ht("toolbar","\n width: "+("inline"===this.displayMode?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+";\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.toolbarHeight+"px;\n box-sizing: content-box;\n overflow: hidden;\n line-height: 0px;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new Ht("toolbar_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new Ht("toolbar-block","\n display: flex;\n align-items: center;\n box-sizing: content-box;\n "));var t=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ht("toolbar_button","\n display: inline-block;\n width: "+(this.toolbarHeight-2*t)+"px;\n height: "+(this.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ht("toolbar_button_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ht("toolbar_active_button","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n background-color: "+this.styles.settings.toolbarBackgroundActiveColor+"\n ")),this.styles.addRule(new Ft("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.toolbarHeight/2+"px;\n ")),this.styles.addRule(new Ft("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.styles.settings.toolbarBackgroundHoverColor+"\n ")),this.toolbarDropdownStyleClass=this.styles.addClass(new Ht("toolbar_dropdown","\n position: absolute;\n max-width: "+4*this.toolbarHeight+"px;\n z-index: 20;\n white-space: normal;\n box-sizing: content-box;\n box-shadow: 3px 3px rgba(33, 33, 33, 0.1);\n margin: "+("inline"===this.displayMode?"0":this.popupMargin)+"px;\n line-height: 0px;\n ")),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Ht("toolbar_dropdown_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ht("toolbar_straightener_block","\n display: flex;\n overflow: hidden;\n justify-content: center;\n -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%);\n ")),this.toolbarStraightenerStyleClass=this.styles.addClass(new Ht("toolbar_straightener","\n display: flex;\n overflow: hidden;\n justify-content: center;\n height: "+(this.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ht("toolbar_straightener_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n "))},t.instanceCounter=0,t}(),ee=n("8hTe"),ne=n.n(ee),ie=/]*>/g;e.a=function(t){var e=t.value,n=void 0===e?"":e,l=t.edit,d=void 0!==l&&l,p=t.className,f=t.showTextOnly,m=t.showLines,g=t.replaces,v=t.zoomImg,y=t.hasMask,w=t.style,k=void 0===w?{}:w,S=t.stylesPrev,E=void 0===S?{}:S,N=String(n),L=Object(u.useRef)(),A=Object(u.useRef)(),_=Object(u.useState)(""),P=Object(s.a)(_,2),z=P[0],F=P[1],H=Object(u.useState)("office"),W=Object(s.a)(H,2),V=W[0],G=W[1],U=Object(u.useMemo)((function(){try{N=(N=N.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+I.a.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+I.a.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+I.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,"\n")).replace(new RegExp("(?[TOC]

",C()),b()),t=(t=t.replace(/(__special_katext_id_\d+__)/g,(function(t,n){var i=e[n],r=i.type,o=i.expression;return Object(R.renderToString)(function(t){var e=document.createElement("div");return e.innerHTML=t,0===e.childNodes.length?"":e.childNodes[0].nodeValue}(o)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),O(),f){var n=document.createElement("div");return n.innerHTML=t,n.innerText}return setTimeout((function(){return $()}),500),t}),[N]),q=Object(u.useRef)();function K(t){var e=t.target;if("IMG"===e.tagName.toUpperCase()){if(v){var n=e.getAttribute("src");F(n),G("image")}}else if("A"===e.tagName.toUpperCase()){var i=e.getAttribute("href");if(i.indexOf("office")>-1)t.preventDefault(),F(i),G("office");else if(i.indexOf("application/pdf")>-1)t.preventDefault(),F(i),G("pdf");else if(i.indexOf("type=text")>-1)t.preventDefault(),F(i),G("html");else if(i.startsWith("#")){t.preventDefault();var r=document.getElementById(i.replace("#",""));r&&r.scrollIntoView(!0)}}}x.WebkitLineClamp=m,m&&(k=Object(o.a)(Object(o.a)({},k),x));var $=function(){var t,e=null===(t=q.current)||void 0===t?void 0:t.querySelectorAll("video");null==e||e.forEach((function(t){if(t.oncontextmenu=function(){return!1},t.src.indexOf(".m3u8")>-1)if(t.canPlayType("application/vnd.apple.mpegurl"));else if(D.a.isSupported()){var e=new D.a;e.loadSource(t.src),e.attachMedia(t)}}))};Object(u.useEffect)((function(){if(q.current&&U&&U.match(ie)&&window.PR.prettyPrint(),q.current)return q.current.addEventListener("click",K),function(){q.current.removeEventListener("click",K),O(),b()}}),[U,q.current,K]);return h.a.createElement("div",{style:{position:"relative"}},h.a.createElement("div",{ref:q,style:Object(o.a)({},k),className:"".concat(p||""," markdown-body ").concat(ne.a.mdBody),onMouseOver:function(t){d&&("IMG"===t.target.nodeName?(L.current.style.display="flex",L.current.style.width=t.target.clientWidth+"px",L.current.style.height=t.target.clientHeight+"px",L.current.style.top=t.target.offsetTop+"px",L.current.style.left=t.target.offsetLeft+"px",A.current.src=t.target.getAttribute("src")):L.current.style.display="none")},dangerouslySetInnerHTML:{__html:U}}),h.a.createElement("div",{ref:L,className:ne.a.button},h.a.createElement(i.a,null,h.a.createElement(r.a,{onClick:function(){return(t=new te(A.current)).displayMode="popup",t.addRenderEventListener(function(){var t=Object(a.a)(c.a.mark((function t(e){var n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L.current.style.display="none",t.next=3,Object(j.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:e}});case 3:null!=(n=t.sent)&&n.id&&g(A.current.getAttribute("src").replace(I.a.API_SERVER,""),"/api/attachments/".concat(null==n?void 0:n.id,"?type=").concat(n.content_type));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),void t.show();var t}},"裁剪"),h.a.createElement(r.a,{onClick:function(){return(t=new Mt(A.current)).settings.displayMode="popup",t.addEventListener("render",function(){var t=Object(a.a)(c.a.mark((function t(e){var n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(L.current.style.display="none",!A.current){t.next=6;break}return t.next=4,Object(j.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:e.dataUrl}});case 4:null!=(n=t.sent)&&n.id&&g(A.current.getAttribute("src").replace(I.a.API_SERVER,""),"/api/attachments/".concat(null==n?void 0:n.id,"?type=").concat(n.content_type));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.show(),void(window.markerArea=t);var t}},"编辑"))),h.a.createElement("img",{ref:A,src:"https://ali-cdn.educoder.net/images/avatars/PortalImage/170?t=1659681136",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),h.a.createElement(B.a,{close:!0,data:z,hasMask:y,type:null!=z&&z.length?V:"",style:Object(o.a)({},E),onClose:function(){return F("")}}))}},"9VGf": /*!****************************************!*\ !*** ./src/components/useInterval.tsx ***! \****************************************/ /*! exports provided: default */ /*! exports used: default */function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(/*! react */"q1tI");function r(t,e){var n=Object(i.useRef)();Object(i.useEffect)((function(){n.current=t})),Object(i.useEffect)((function(){if(null!==e){var t=setInterval((function(){n.current()}),e);return function(){return clearInterval(t)}}}),[e])}},Bd2K: /*!********************************************************!*\ !*** ./node_modules/codemirror/addon/edit/closetag.js ***! \********************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){t.defineOption("autoCloseTags",!1,(function(a,s,l){if(l!=t.Init&&l&&a.removeKeyMap("autoCloseTags"),s){var c={name:"autoCloseTags"};"object"==typeof s&&!1===s.whenClosing||(c["'/'"]=function(e){return function(e){return e.getOption("disableInput")?t.Pass:i(e,!0)}(e)}),"object"==typeof s&&!1===s.whenOpening||(c["'>'"]=function(i){return function(i){if(i.getOption("disableInput"))return t.Pass;for(var a=i.listSelections(),s=[],l=i.getOption("autoCloseTags"),c=0;cu.ch&&(m=m.slice(0,m.length-h.end+u.ch));var b=m.toLowerCase();if(!m||"string"==h.type&&(h.end!=u.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||1==h.string.length)||"tag"==h.type&&f.close||h.string.indexOf("/")==u.ch-h.start-1||v&&r(v,b)>-1||o(i,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(p)||[],m,u,!0))return t.Pass;var x="object"==typeof l&&l.emptyTags;if(x&&r(x,m)>-1)s[c]={text:"/>",newPos:t.Pos(u.line,u.ch+2)};else{var C=y&&r(y,b)>-1;s[c]={indent:C,text:">"+(C?"\n\n":"")+"",newPos:C?t.Pos(u.line+1,0):t.Pos(u.line,u.ch+1)}}}var w="object"==typeof l&&l.dontIndentOnAutoClose;for(c=a.length-1;c>=0;c--){var k=s[c];i.replaceRange(k.text,a[c].head,a[c].anchor,"+insert");var S=i.listSelections().slice(0);S[c]={head:k.newPos,anchor:k.newPos},i.setSelections(S),!w&&k.indent&&(i.indentLine(k.newPos.line,null,!0),i.indentLine(k.newPos.line+1,null,!0))}}(i)}),a.addKeyMap(c)}}));var e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["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 i(e,n){for(var i=e.listSelections(),r=[],a=n?"/":""!=e.getLine(u.line).charAt(h.end)&&(f+=">"),r[c]=f}if(e.replaceSelections(r),i=e.listSelections(),!l)for(c=0;c=0&&n[c]==i;c--)++l;for(r=s.to,c=1;c0){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=0;i=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n>6),e+=String.fromCharCode(128|63&i)):i<55296||i>=57344?(e+=String.fromCharCode(224|i>>12),e+=String.fromCharCode(128|i>>6&63),e+=String.fromCharCode(128|63&i)):(n++,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),e+=String.fromCharCode(240|i>>18),e+=String.fromCharCode(128|i>>12&63),e+=String.fromCharCode(128|i>>6&63),e+=String.fromCharCode(128|63&i))}return e}var C={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1};function w(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];return t.forEach((function(t,i){var r=null;t.forEach((function(o,a){if(!o&&null!==r)return n.push("M".concat(r+e," ").concat(i+e,"h").concat(a-r,"v1H").concat(r+e,"z")),void(r=null);if(a!==t.length-1)o&&null===r&&(r=a);else{if(!o)return;null===r?n.push("M".concat(a+e,",").concat(i+e," h1v1H").concat(a+e,"z")):n.push("M".concat(r+e,",").concat(i+e," h").concat(a+1-r,"v1H").concat(r+e,"z"))}}))})),n.join("")}function k(t,e){return t.slice().map((function(t,n){return n=e.y+e.h?t:t.map((function(t,n){return(n=e.x+e.w)&&t}))}))}function S(t,e){var n=t.imageSettings,i=t.size,r=t.includeMargin;if(null==n)return null;var o=r?4:0,a=e.length+2*o,s=Math.floor(.1*i),l=a/i,c=(n.width||s)*l,u=(n.height||s)*l,h=null==n.x?e.length/2-c/2:n.x*l,d=null==n.y?e.length/2-u/2:n.y*l,p=null;if(n.excavate){var f=Math.floor(h),m=Math.floor(d);p={x:f,y:m,w:Math.ceil(c+h-f),h:Math.ceil(u+d-m)}}return{x:h,y:d,h:u,w:c,excavation:p}}var E=function(){try{(new Path2D).addPath(new Path2D)}catch(t){return!1}return!0}(),T=function(t){function e(){var t,n;l(this,e);for(var i=arguments.length,r=new Array(i),o=0;ot.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(i=t[Symbol.iterator]()).next.bind(i)}var i=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){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}}t.exports={defaults:{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},getDefaults:e,changeDefaults:function(e){t.exports.defaults=e}}})),r=(i.defaults,i.getDefaults,i.changeDefaults,/[&<>"']/),o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(t){return l[t]},u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function h(t){return t.replace(u,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}var d=/(^|[^\[])\^/g,p=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,m={},g=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(t,e){m[" "+t]||(g.test(t)?m[" "+t]=t+"/":m[" "+t]=x(t,"/",!0));var n=-1===(t=m[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(v,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(y,"$1")+e:t+e}function x(t,e,n){var i=t.length;if(0===i)return"";for(var r=0;r=0&&"\\"===n[r];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(n.length>e)n.splice(e);else for(;n.length1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t,e){var n=this.rules.block.code.exec(t);if(n){var i=e[e.length-1];if(i&&"paragraph"===i.type)return{raw:n[0],text:n[0].trimRight()};var r=n[0].replace(/^ {4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:M(r,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=i.length?t.slice(i.length):t})).join("\n")}(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:i}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[1].length,text:e[2]}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var n={type:"table",header:P(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i ?/gm,"");return{type:"blockquote",raw:e[0],text:n}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){for(var n,i,r,o,a,s,l,c=e[0],u=e[2],h=u.length>1,d=")"===u[u.length-1],p={type:"list",raw:c,ordered:h,start:h?+u.slice(0,-1):"",loose:!1,items:[]},f=e[0].match(this.rules.block.item),m=!1,g=f.length,v=0;v1||this.options.smartLists&&r!==u)&&(o=f.slice(v+1).join("\n"),p.raw=p.raw.substring(0,p.raw.length-o.length),v=g-1)),a=m||/\n\n(?!\s*$)/.test(n),v!==g-1&&(m="\n"===n.charAt(n.length-1),a||(a=m)),a&&(p.loose=!0),l=void 0,(s=/^\[[ xX]\] /.test(n))&&(l=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,"")),p.items.push({type:"list_item",raw:c,task:s,checked:l,loose:a,text:n});return p}},e.html=function(t){var e=this.rules.block.html.exec(t);if(e)return{type:this.options.sanitize?"paragraph":"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):D(e[0]):e[0]}},e.def=function(t){var e=this.rules.block.def.exec(t);if(e)return e[3]&&(e[3]=e[3].substring(1,e[3].length-1)),{tag:e[1].toLowerCase().replace(/\s+/g," "),raw:e[0],href:e[2],title:e[3]}},e.table=function(t){var e=this.rules.block.table.exec(t);if(e){var n={type:"table",header:P(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=e[0];var i,r=n.align.length;for(i=0;i/i.test(i[0])&&(e=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:e,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):D(i[0]):i[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var n=I(e[2],"()");if(n>-1){var i=(0===e[0].indexOf("!")?5:4)+e[1].length+n;e[2]=e[2].substring(0,n),e[0]=e[0].substring(0,i).trim(),e[3]=""}var r=e[2],o="";if(this.options.pedantic){var a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);a?(r=a[1],o=a[3]):o=""}else o=e[3]?e[3].slice(1,-1):"";return R(e,{href:(r=r.trim().replace(/^<([\s\S]*)>$/,"$1"))?r.replace(this.rules.inline._escapes,"$1"):r,title:o?o.replace(this.rules.inline._escapes,"$1"):o},e[0])}},e.reflink=function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=e[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return R(n,i,n[0])}},e.strong=function(t,e,n){void 0===n&&(n="");var i=this.rules.inline.strong.start.exec(t);if(i&&(!i[1]||i[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){e=e.slice(-1*t.length);var r,o="**"===i[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(i=o.exec(e));)if(r=this.rules.inline.strong.middle.exec(e.slice(0,i.index+3)))return{type:"strong",raw:t.slice(0,r[0].length),text:t.slice(2,r[0].length-2)}}},e.em=function(t,e,n){void 0===n&&(n="");var i=this.rules.inline.em.start.exec(t);if(i&&(!i[1]||i[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){e=e.slice(-1*t.length);var r,o="*"===i[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(i=o.exec(e));)if(r=this.rules.inline.em.middle.exec(e.slice(0,i.index+2)))return{type:"em",raw:t.slice(0,r[0].length),text:t.slice(1,r[0].length-1)}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=n.startsWith(" ")&&n.endsWith(" ");return i&&r&&(n=n.substring(1,n.length-1)),n=D(n,!0),{type:"codespan",raw:e[0],text:n}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[1]}},e.autolink=function(t,e){var n,i,r=this.rules.inline.autolink.exec(t);if(r)return i="@"===r[2]?"mailto:"+(n=D(this.options.mangle?e(r[1]):r[1])):n=D(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},e.url=function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var i,r;if("@"===n[2])r="mailto:"+(i=D(this.options.mangle?e(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);i=D(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},e.inlineText=function(t,e,n){var i,r=this.rules.inline.text.exec(t);if(r)return i=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):D(r[0]):r[0]:D(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},t}(),j=E,z=k,F=T,H={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:j,table:j,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};H.def=z(H.def).replace("label",H._label).replace("title",H._title).getRegex(),H.bullet=/(?:[*+-]|\d{1,9}[.)])/,H.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,H.item=z(H.item,"gm").replace(/bull/g,H.bullet).getRegex(),H.list=z(H.list).replace(/bull/g,H.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+H.def.source+")").getRegex(),H._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",H._comment=//,H.html=z(H.html,"i").replace("comment",H._comment).replace("tag",H._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),H.paragraph=z(H._paragraph).replace("hr",H.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",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.blockquote=z(H.blockquote).replace("paragraph",H.paragraph).getRegex(),H.normal=F({},H),H.gfm=F({},H.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*|$)"}),H.gfm.nptable=z(H.gfm.nptable).replace("hr",H.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",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.gfm.table=z(H.gfm.table).replace("hr",H.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",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.pedantic=F({},H.normal,{html:z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",H._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:j,paragraph:z(H.normal._paragraph).replace("hr",H.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",H.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var W={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:j,tag:"^comment|^|^<[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:j,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};W.punctuation=z(W.punctuation).replace(/punctuation/g,W._punctuation).getRegex(),W._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",W._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",W.em.start=z(W.em.start).replace(/punctuation/g,W._punctuation).getRegex(),W.em.middle=z(W.em.middle).replace(/punctuation/g,W._punctuation).replace(/overlapSkip/g,W._overlapSkip).getRegex(),W.em.endAst=z(W.em.endAst,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.em.endUnd=z(W.em.endUnd,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.strong.start=z(W.strong.start).replace(/punctuation/g,W._punctuation).getRegex(),W.strong.middle=z(W.strong.middle).replace(/punctuation/g,W._punctuation).replace(/blockSkip/g,W._blockSkip).getRegex(),W.strong.endAst=z(W.strong.endAst,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.strong.endUnd=z(W.strong.endUnd,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.blockSkip=z(W._blockSkip,"g").getRegex(),W.overlapSkip=z(W._overlapSkip,"g").getRegex(),W._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,W._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,W._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])?)+(?![-_])/,W.autolink=z(W.autolink).replace("scheme",W._scheme).replace("email",W._email).getRegex(),W._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,W.tag=z(W.tag).replace("comment",H._comment).replace("attribute",W._attribute).getRegex(),W._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,W._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,W._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,W.link=z(W.link).replace("label",W._label).replace("href",W._href).replace("title",W._title).getRegex(),W.reflink=z(W.reflink).replace("label",W._label).getRegex(),W.reflinkSearch=z(W.reflinkSearch,"g").replace("reflink",W.reflink).replace("nolink",W.nolink).getRegex(),W.normal=F({},W),W.pedantic=F({},W.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:z(/^!?\[(label)\]\((.*?)\)/).replace("label",W._label).getRegex(),reflink:z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W._label).getRegex()}),W.gfm=F({},W.normal,{escape:z(W.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&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var X=function(){function e(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||G,this.options.tokenizer=this.options.tokenizer||new B,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:U.normal,inline:q.normal};this.options.pedantic?(e.block=U.pedantic,e.inline=q.pedantic):this.options.gfm&&(e.block=U.gfm,this.options.breaks?e.inline=q.breaks:e.inline=q.gfm),this.tokenizer.rules=e}e.lex=function(t,n){return new e(n).lex(t)};var n,i,r,o=e.prototype;return o.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},o.blockTokens=function(t,e,n){var i,r,o,a;for(void 0===e&&(e=[]),void 0===n&&(n=!0),t=t.replace(/^ +$/gm,"");t;)if(i=this.tokenizer.space(t))t=t.substring(i.raw.length),i.type&&e.push(i);else if(i=this.tokenizer.code(t,e))t=t.substring(i.raw.length),i.type?e.push(i):((a=e[e.length-1]).raw+="\n"+i.raw,a.text+="\n"+i.text);else if(i=this.tokenizer.fences(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.heading(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.nptable(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.hr(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.blockquote(t))t=t.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),e.push(i);else if(i=this.tokenizer.list(t)){for(t=t.substring(i.raw.length),o=i.items.length,r=0;r0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(s));)l.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;t;)if(o=this.tokenizer.escape(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.tag(t,n,i))t=t.substring(o.raw.length),n=o.inLink,i=o.inRawBlock,e.push(o);else if(o=this.tokenizer.link(t))t=t.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,i)),e.push(o);else if(o=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,i)),e.push(o);else if(o=this.tokenizer.strong(t,s,r))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),e.push(o);else if(o=this.tokenizer.em(t,s,r))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),e.push(o);else if(o=this.tokenizer.codespan(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.br(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.del(t))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),e.push(o);else if(o=this.tokenizer.autolink(t,$))t=t.substring(o.raw.length),e.push(o);else if(n||!(o=this.tokenizer.url(t,$))){if(o=this.tokenizer.inlineText(t,i,K))t=t.substring(o.raw.length),r=o.raw.slice(-1),e.push(o);else if(t){var c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else t=t.substring(o.raw.length),e.push(o);return e},n=e,r=[{key:"rules",get:function(){return{block:U,inline:q}}}],(i=null)&&t(n.prototype,i),r&&t(n,r),e}(),Y=i.defaults,J=S,Z=C,Q=function(){function t(t){this.options=t||Y}var e=t.prototype;return e.code=function(t,e,n){var i=(e||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(t,i);null!=r&&r!==t&&(n=!0,t=r)}return i?'
'+(n?t:Z(t,!0))+"
\n":"
"+(n?t:Z(t,!0))+"
\n"},e.blockquote=function(t){return"
\n"+t+"
\n"},e.html=function(t){return t},e.heading=function(t,e,n,i){return this.options.headerIds?"'+t+"\n":""+t+"\n"},e.hr=function(){return this.options.xhtml?"
\n":"
\n"},e.list=function(t,e,n){var i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"\n"},e.listitem=function(t){return"
  • "+t+"
  • \n"},e.checkbox=function(t){return" "},e.paragraph=function(t){return"

    "+t+"

    \n"},e.table=function(t,e){return e&&(e=""+e+""),"\n\n"+t+"\n"+e+"
    \n"},e.tablerow=function(t){return"\n"+t+"\n"},e.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"\n"},e.strong=function(t){return""+t+""},e.em=function(t){return""+t+""},e.codespan=function(t){return""+t+""},e.br=function(){return this.options.xhtml?"
    ":"
    "},e.del=function(t){return""+t+""},e.link=function(t,e,n){if(null===(t=J(this.options.sanitize,this.options.baseUrl,t)))return n;var i='"},e.image=function(t,e,n){if(null===(t=J(this.options.sanitize,this.options.baseUrl,t)))return n;var i=''+n+'":">"},e.text=function(t){return t},t}(),tt=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,n){return""+n},e.image=function(t,e,n){return""+n},e.br=function(){return""},t}(),et=function(){function t(){this.seen={}}return t.prototype.slug=function(t){var e=t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(e)){var n=e;do{this.seen[n]++,e=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(e))}return this.seen[e]=0,e},t}(),nt=i.defaults,it=w,rt=function(){function t(t){this.options=t||nt,this.options.renderer=this.options.renderer||new Q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new tt,this.slugger=new et}t.parse=function(e,n){return new t(n).parse(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var n,i,r,o,a,s,l,c,u,h,d,p,f,m,g,v,y,b,x="",C=t.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):m+=b),m+=this.parse(g.tokens,f),u+=this.renderer.listitem(m,y,v);x+=this.renderer.list(u,d,p);continue;case"html":x+=this.renderer.html(h.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1An error occurred:

    "+st(t.message+"",!0)+"
    ";throw t}}return ht.options=ht.setOptions=function(t){return ot(ht.defaults,t),ct(ht.defaults),ht},ht.getDefaults=lt,ht.defaults=ut,ht.use=function(t){var e=ot({},t);if(t.renderer&&function(){var n=ht.defaults.renderer||new Q,i=function(e){var i=n[e];n[e]=function(){for(var r=arguments.length,o=new Array(r),a=0;a",triples:"",explode:"[]{}"},n=t.Pos;function i(t,n){return"pairs"==n&&"string"==typeof t?t:"object"==typeof t&&null!=t[n]?t[n]:e[n]}t.defineOption("autoCloseBrackets",!1,(function(e,n,a){a&&a!=t.Init&&(e.removeKeyMap(r),e.state.closeBrackets=null),n&&(o(i(n,"pairs")),e.state.closeBrackets=n,e.addKeyMap(r))}));var r={Backspace:function(e){var r=s(e);if(!r||e.getOption("disableInput"))return t.Pass;for(var o=i(r,"pairs"),a=e.listSelections(),c=0;c=0;c--){var h=a[c].head;e.replaceRange("",n(h.line,h.ch-1),n(h.line,h.ch+1),"+delete")}},Enter:function(e){var n=s(e),r=n&&i(n,"explode");if(!r||e.getOption("disableInput"))return t.Pass;for(var o=e.listSelections(),a=0;a1&&d.indexOf(r)>=0&&e.getRange(n(b.line,b.ch-2),b)==r+r){if(b.ch>2&&/\bstring/.test(e.getTokenTypeAt(n(b.line,b.ch-2))))return t.Pass;v="addFour"}else if(p){var C=0==b.ch?" ":e.getRange(n(b.line,b.ch-1),b);if(t.isWordChar(x)||C==r||t.isWordChar(C))return t.Pass;v="both"}else{if(!m||!(0===x.length||/\s/.test(x)||h.indexOf(x)>-1))return t.Pass;v="both"}else v=p&&c(e,b)?"both":d.indexOf(r)>=0&&e.getRange(b,n(b.line,b.ch+3))==r+r+r?"skipThree":"skip";if(u){if(u!=v)return t.Pass}else u=v}var w=l%2?a.charAt(l-1):r,k=l%2?r:a.charAt(l+1);e.operation((function(){if("skip"==u)e.execCommand("goCharRight");else if("skipThree"==u)for(var i=0;i<3;i++)e.execCommand("goCharRight");else if("surround"==u){var r=e.getSelections();for(i=0;i0,{anchor:new n(o.anchor.line,o.anchor.ch+(a?-1:1)),head:new n(o.head.line,o.head.ch+(a?1:-1))});e.setSelections(r)}else"both"==u?(e.replaceSelection(w+k,null),e.triggerElectric(w+k),e.execCommand("goCharLeft")):"addFour"==u&&(e.replaceSelection(w+w+w+w,"before"),e.execCommand("goCharRight"));var o,a}))}(r,e)}}function s(t){var e=t.state.closeBrackets;return!e||e.override?e:t.getModeAt(t.getCursor()).closeBrackets||e}function l(t,e){var i=t.getRange(n(e.line,e.ch-1),n(e.line,e.ch+1));return 2==i.length?i:null}function c(t,e){var i=t.getTokenAt(n(e.line,e.ch+1));return/\bstring/.test(i.type)&&i.start==e.ch&&(0==e.ch||!/\bstring/.test(t.getTokenTypeAt(e)))}o(e.pairs+"`")}(n(/*! ../../lib/codemirror */"VrN/"))},FIWC: /*!**********************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/PreviewEdit/index.less?modules ***! \**********************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={flex_box_center:"flex_box_center___gdHkq",flex_space_between:"flex_space_between___lk_Gv",flex_box_vertical_center:"flex_box_vertical_center___2WNVo",flex_box_center_end:"flex_box_center_end___13O11",flex_box_column:"flex_box_column___kMb8L",wrap:"wrap___1y6rg",crumbs:"crumbs___1vKDo"}},Gytx: /*!********************************************!*\ !*** ./node_modules/shallowequal/index.js ***! \********************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){t.exports=function(t,e,n,i){var r=n?n.call(i,t,e):void 0;if(void 0!==r)return!!r;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),l=0;l=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=l.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},c.setupPositionProbePattern=function(t,e){for(var n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(var i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(this.modules[t+n][e+i]=0<=n&&n<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=i&&i<=4)},c.getBestMaskPattern=function(){for(var t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var i=a.getLostPoint(this);(0==n||t>i)&&(t=i,e=n)}return e},c.createMovieClip=function(t,e,n){var i=t.createEmptyMovieClip(e,n);this.make();for(var r=0;r>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(n=0;n<18;n++){i=!t&&1==(e>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}},c.setupTypeInfo=function(t,e){for(var n=this.errorCorrectLevel<<3|e,i=a.getBCHTypeInfo(n),r=0;r<15;r++){var o=!t&&1==(i>>r&1);r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(r=0;r<15;r++){o=!t&&1==(i>>r&1);r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!t},c.mapData=function(t,e){for(var n=-1,i=this.moduleCount-1,r=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var l=0;l<2;l++)if(null==this.modules[i][s-l]){var c=!1;o>>r&1)),a.getMask(e,i,s-l)&&(c=!c),this.modules[i][s-l]=c,-1==--r&&(o++,r=7)}if((i+=n)<0||this.moduleCount<=i){i-=n,n=-n;break}}},l.PAD0=236,l.PAD1=17,l.createData=function(t,e,n){for(var i=r.getRSBlocks(t,e),s=new o,c=0;c8*h)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*h+")");for(s.getLengthInBits()+4<=8*h&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=8*h||(s.put(l.PAD0,8),s.getLengthInBits()>=8*h));)s.put(l.PAD1,8);return l.createBytes(s,i)},l.createBytes=function(t,e){for(var n=0,i=0,r=0,o=new Array(e.length),l=new Array(e.length),c=0;c=0?f.get(m):0}}var g=0;for(d=0;d=0;)e^=f.G15<=0;)e^=f.G18<>>=1;return e},getPatternPosition:function(t){return f.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case a:return(e+n)%2==0;case s:return e%2==0;case l:return n%3==0;case c:return(e+n)%3==0;case u:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case h:return e*n%2+e*n%3==0;case d:return(e*n%2+e*n%3)%2==0;case p:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new r([1],0),n=0;n5&&(n+=3+o-5)}for(i=0;i1&&void 0!==arguments[1]?arguments[1]:1,n=M.length,i=0;i1&&void 0!==arguments[1]&&arguments[1];return Object(E.a)(t).map((function(t,n){if(!s.isValidElement(t)||!t.type)return null;var i=t.type.isSelectOptGroup,r=t.key,o=t.props,a=o.children,l=Object(c.a)(o,["children"]);return e||!i?T(t):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(null===r?n:r,"__"),label:r},l),{},{options:O(a)})})).filter((function(t){return t}))}var N=n("2Qr1"),L=n("qNPg"),A=n("U8pU"),_=n("Kwbf"),M=n("WKfj");var P=function(t){var e=t.mode,n=t.options,i=t.children,r=t.backfill,o=t.allowClear,a=t.placeholder,l=t.getInputElement,c=t.showSearch,u=t.onSearch,h=t.defaultOpen,d=t.autoFocus,p=t.labelInValue,f=t.value,m=t.inputValue,g=t.optionLabelProp,v="multiple"===e||"tags"===e,y=void 0!==c?c:v||"combobox"===e,b=n||O(i);if(Object(_.a)("tags"!==e||b.every((function(t){return!t.disabled})),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),"tags"===e||"combobox"===e){var x=b.some((function(t){return t.options?t.options.some((function(t){return"number"==typeof("value"in t?t.value:t.key)})):"number"==typeof("value"in t?t.value:t.key)}));Object(_.a)(!x,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)("combobox"!==e||!g,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)("combobox"===e||!r,"`backfill` only works with `combobox` mode."),Object(_.a)("combobox"===e||!l,"`getInputElement` only work with `combobox` mode."),Object(_.b)("combobox"!==e||!l||!o||!a,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),u&&!y&&"combobox"!==e&&"tags"!==e&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!h||d,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),null!=f){var C=Object(M.d)(f);Object(_.a)(!p||C.every((function(t){return"object"===Object(A.a)(t)&&("key"in t||"value"in t)})),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!v||Array.isArray(f),"`value` should be array when `mode` is `multiple` or `tags`")}if(i){var w=null;Object(E.a)(i).some((function(t){if(!s.isValidElement(t)||!t.type)return!1;var e=t.type;return!e.isSelectOption&&(e.isSelectOptGroup?!Object(E.a)(t.props.children).every((function(e){return!(s.isValidElement(e)&&t.type&&!e.type.isSelectOption)||(w=e.type,!1)})):(w=e,!0))})),w&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(w.displayName||w.name||w,"`.")),Object(_.a)(void 0===m,"`inputValue` is deprecated, please use `searchValue` instead.")}},D=Object(L.a)({prefixCls:"rc-select",components:{optionList:b},convertChildrenToData:O,flattenOptions:N.d,getLabeledValue:N.e,filterOptions:N.b,isValueDisabled:N.g,findValueOption:N.c,warningProps:P,fillOptionsWithMissingValue:N.a}),I=function(t){Object(o.a)(n,t);var e=Object(a.a)(n);function n(){var t;return Object(i.a)(this,n),(t=e.apply(this,arguments)).selectRef=s.createRef(),t.focus=function(){t.selectRef.current.focus()},t.blur=function(){t.selectRef.current.blur()},t}return Object(r.a)(n,[{key:"render",value:function(){return s.createElement(D,Object.assign({ref:this.selectRef},this.props))}}]),n}(s.Component);I.Option=C,I.OptGroup=k;var R=I;e.c=R},M8RZ: /*!**********************************!*\ !*** ./src/components/modal.tsx ***! \**********************************/ /*! exports provided: default */ /*! exports used: default */function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! react-dom */"i8i4"),u=function(t){Object(o.a)(n,t);var e=Object(a.a)(n);function n(t){var r;Object(i.a)(this,n),r=e.call(this,t);var o=window.document;return r.node=o.createElement("div"),o.body.appendChild(r.node),r}return Object(r.a)(n,[{key:"render",value:function(){var t=this.props.children;return Object(c.createPortal)(t,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),n}(l.a.Component)},O2Wb: /*!******************************************************************!*\ !*** ./src/components/Editor/NullChildEditor/index.less?modules ***! \******************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES: /*!*********************************************************!*\ !*** ./node_modules/rc-tooltip/es/index.js + 2 modules ***! \*********************************************************/ /*! exports provided: default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tooltip/es/placements.js because of ./node_modules/antd/es/tooltip/placements.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-trigger/es/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";var i=n("U8pU"),r=n("VTBJ"),o=n("Ff2n"),a=n("q1tI"),s=n("uciX"),l=n("7ixt"),c=function(t){var e=t.overlay,n=t.prefixCls,i=t.id,r=t.overlayInnerStyle;return a.createElement("div",{className:"".concat(n,"-inner"),id:i,role:"tooltip",style:r},"function"==typeof e?e():e)},u=Object(a.forwardRef)((function(t,e){var n=t.overlayClassName,u=t.trigger,h=void 0===u?["hover"]:u,d=t.mouseEnterDelay,p=void 0===d?0:d,f=t.mouseLeaveDelay,m=void 0===f?.1:f,g=t.overlayStyle,v=t.prefixCls,y=void 0===v?"rc-tooltip":v,b=t.children,x=t.onVisibleChange,C=t.afterVisibleChange,w=t.transitionName,k=t.animation,S=t.placement,E=void 0===S?"right":S,T=t.align,O=void 0===T?{}:T,N=t.destroyTooltipOnHide,L=void 0!==N&&N,A=t.defaultVisible,_=t.getTooltipContainer,M=t.overlayInnerStyle,P=Object(o.a)(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),D=Object(a.useRef)(null);Object(a.useImperativeHandle)(e,(function(){return D.current}));var I=Object(r.a)({},P);"visible"in t&&(I.popupVisible=t.visible);var R=!1,B=!1;if("boolean"==typeof L)R=L;else if(L&&"object"===Object(i.a)(L)){var j=L.keepParent;R=!0===j,B=!1===j}return a.createElement(s.a,Object.assign({popupClassName:n,prefixCls:y,popup:function(){var e=t.arrowContent,n=void 0===e?null:e,i=t.overlay,r=t.id;return[a.createElement("div",{className:"".concat(y,"-arrow"),key:"arrow"},n),a.createElement(c,{key:"content",prefixCls:y,id:r,overlay:i,overlayInnerStyle:M})]},action:h,builtinPlacements:l.a,popupPlacement:E,ref:D,popupAlign:O,getPopupContainer:_,onPopupVisibleChange:x,afterPopupVisibleChange:C,popupTransitionName:w,popupAnimation:k,defaultPopupVisible:A,destroyPopupOnHide:R,autoDestroy:B,mouseLeaveDelay:m,popupStyle:g,mouseEnterDelay:p},I),b)}));e.a=u},Ot1p: /*!**************************************************************!*\ !*** ./src/components/markdown-editor/index.tsx + 6 modules ***! \**************************************************************/ /*! exports provided: default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/defineProperty.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/code-block/index.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/modal.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/useInterval.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/util.js because of ./src/pages/tasks/index.jsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/utils/util.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/codemirror/lib/codemirror.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/qrcode.react/lib/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/uuid/dist/esm-browser/v4.js */function(t,e,n){"use strict";n("2qtc");var i=n("kLXV"),r=n("rAM+"),o=(n("miYZ"),n("tsqr")),a=n("9og8"),s=n("tJVT"),l=n("jrin"),c=n("WmNS"),u=n.n(c),h=n("q1tI"),d=n.n(h),p=n("VrN/"),f=n.n(p),m=n("bdgK"),g=(n("p77/"),n("Bd2K"),n("ELLl"),n("19Vz"),n("lZu9"),n("+NIl"),n("kSUc"),n("9Bee")),v=function(t){var e=t.value,n=void 0===e?"":e,i=(t.className,t.showTextOnly,t.showLines,t.style,Object(h.useMemo)((function(){return""}),[n]));return d.a.createElement(d.a.Fragment,null,d.a.createElement("div",{dangerouslySetInnerHTML:{__html:i}}))},y=(n("Q9mQ"),n("diRs")),b=n("0Owb"),x=(n("dejd"),n("C+DQ"),n("D1Df")),C=n.n(x),w=n("1vsH"),k=n("m3rI"),S=[{title:"粗体",icon:"icon-bold",actionName:"bold"},{title:"斜体",icon:"icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"icon-file-code",actionName:"code-block"},{title:"链接",icon:"icon-link",actionName:"link"},"|",{title:"行内公式",icon:"icon-sum",actionName:"inline-latex"},{title:"多行公式",icon:"icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"icon-picture",actionName:"upload-image"},{title:"表格",icon:"icon-table",actionName:"add-table"},"|",{title:"换行",icon:"icon-minus",actionName:"line-break"},{title:"清空",icon:"icon-eraser",actionName:"eraser"}];function E(t){var e=t.onActionCallback,n=t.title,i=t.icon,r=t.actionName,o=t.className,a=void 0===o?"":o,s=t.children;return d.a.createElement("a",{title:n,className:a,onClick:function(){e(r)}},d.a.createElement("i",{className:"md-iconfont ".concat(i)}),s)}var T=function(t){var e=t.watch,n=t.showNullButton,i=t.onActionCallback,r=t.fullScreen,o=t.insertTemp,a=t.hidetoolBar,s=t.uuid,l=t.setOpenPhones,c=Object(w.E)("_educoder_session_login"),u=Object(w.E)("_educoder_session"),h=[].concat(S,[{title:"".concat(e?"关闭实时预览":"开启实时预览"),icon:"".concat(e?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},!a&&h.map((function(t,e){return d.a.createElement("li",{key:e},t.actionName?d.a.createElement(E,Object(b.a)({},t,{onActionCallback:i})):d.a.createElement("span",{className:"v-line"}))})),n?d.a.createElement("li",null,d.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:i},d.a.createElement("span",{className:"fill-tip"},"点击插入\b填空项"))):null,o&&d.a.createElement("li",null,d.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(o),onActionCallback:i},d.a.createElement("span",{className:"fill-tip"},"插入模板"))),d.a.createElement("li",null,d.a.createElement(y.a,{title:"打开手机扫一扫",content:d.a.createElement("div",null,d.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+c+"&_educoder_session="+u+"&key="+s+"&api="+encodeURIComponent(k.a.API_SERVER)),d.a.createElement(C.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+c+"&_educoder_session="+u+"&key="+s+"&api="+encodeURIComponent(k.a.API_SERVER)}))},d.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return l(!0)}},"手机上传文件"))),d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(E,{icon:"".concat(r?"icon-shrink":"icon-enlarge"),title:r?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:i})))},O=n("M8RZ"),N=(n("+L6B"),n("2/Rp")),L=(n("y8nQ"),n("Vl3Y")),A=(n("5NDa"),n("5rEg")),_={labelCol:{span:4},wrapperCol:{span:20}},M=function(t){var e=t.callback,n=t.onCancel;return d.a.createElement(L.a,Object(b.a)({},_,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(t){e(t)}}),d.a.createElement(L.a.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}]},d.a.createElement(A.a,null)),d.a.createElement(L.a.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}]},d.a.createElement(A.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(N.a,{type:"ghost",onClick:n},"取消")))},P=n("7ahc"),D=n("k1fw"),I=(n("HmJG"),n("BjJ7")),R=L.a.useForm,B={width:280,marginRight:10},j={labelCol:{span:5},wrapperCol:{span:19}},z=function(t){var e=t.callback,n=t.onCancel,i=R(),r=Object(s.a)(i,1)[0],o=Object(h.useRef)();function a(t,e){r.setFieldsValue({src:"/api/attachments/".concat(t.id,"?type=").concat(t.content_type),type:e.type})}return d.a.createElement(L.a,Object(b.a)({form:r},j,{className:"upload-image-panel",onFinish:function(t){e(Object(D.a)(Object(D.a)({},t),{},{name:o.current}))}}),d.a.createElement(L.a.Item,{label:"文件地址",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(L.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入文件地址"}]},d.a.createElement(A.a,{style:B})),d.a.createElement(F,{onFileChange:function(t){var e=t.target.files[0];o.current=e.name,H(e,a)}}))),d.a.createElement(L.a.Item,{label:"文件描述",name:"alt"},d.a.createElement(A.a,{style:{width:264}})),d.a.createElement(L.a.Item,{style:{textAlign:"right"}},d.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(N.a,{type:"ghost",onClick:n},"取消")))};function F(t){var e=t.onFileChange;return d.a.createElement("a",{className:"upload-button"},"本地上传",d.a.createElement("input",{type:"file",onChange:e}))}function H(t,e){if(!t)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",t),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){e(JSON.parse(n.target.responseText),t)}),!1),i.addEventListener("error",(function(t){console.error(t)}),!1),i.open("POST","".concat(I.a,"/api/attachments.json")),i.send(n)}n("giR+");var W,V,G=n("fyUT"),U=(n("7Kak"),n("9yH6")),q=U.a.Group,K={margin:"0 8px"},$=function(t){var e=t.callback,n=t.onCancel;return d.a.createElement(L.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(t){e(t)}},d.a.createElement("div",{className:"flex-container"},d.a.createElement("span",{style:K},"单元格数:"),d.a.createElement("span",{style:K},"行数"),d.a.createElement(L.a.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}]},d.a.createElement(G.a,null)),d.a.createElement("span",{style:K},"列数"),d.a.createElement(L.a.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}]},d.a.createElement(G.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12}},d.a.createElement("span",{style:K},"对齐方式:"),d.a.createElement(L.a.Item,{name:"align"},d.a.createElement(q,null,d.a.createElement(U.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(U.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(U.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(U.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(N.a,{type:"ghost",onClick:n},"取消")))},X=n("ErOA"),Y=n("7Cbv"),J="------------",Z={default:J,left:":".concat(J),center:":".concat(J,":"),right:"".concat(J,":")},Q=n("9VGf");function tt(t){return/^\d+$/.test(t)?"".concat(t,"px"):t}var et=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",nt=["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"],it=(W={},Object(l.a)(W,et+"-B","bold"),Object(l.a)(W,et+"-I","italic"),W),rt=(V={},Object(l.a)(V,"link","添加链接"),Object(l.a)(V,"code-block","添加代码块"),Object(l.a)(V,"upload-image","添加文件"),Object(l.a)(V,"add-table","添加表格"),V);e.a=function(t){var e=t.defaultValue,n=void 0===e?"":e,c=t.onChange,p=t.width,y=void 0===p?"100%":p,b=t.height,x=void 0===b?400:b,C=t.miniToolbar,w=void 0!==C&&C,S=t.isFocus,E=void 0!==S&&S,N=t.watch,L=t.insertTemp,A=t.mode,_=void 0===A?"markdown":A,D=t.id,I=void 0===D?"markdown-editor-id":D,R=t.showResizeBar,B=void 0!==R&&R,j=t.noStorage,F=void 0!==j&&j,W=t.showNullButton,V=void 0!==W&&W,G=t.hidetoolBar,U=void 0!==G&&G,q=t.fullScreen,K=void 0!==q&&q,J=t.onBlur,et=t.onCMBeforeChange,ot=t.onFullScreen,at=t.className,st=void 0===at?"":at,lt=t.disablePaste,ct=void 0!==lt&<,ut=t.placeholder,ht=void 0===ut?"":ut,dt=t.values,pt=void 0===dt?"":dt,ft=Object(h.useState)(null),mt=Object(s.a)(ft,2),gt=mt[0],vt=mt[1],yt=Object(h.useState)(n),bt=Object(s.a)(yt,2),xt=bt[0],Ct=bt[1],wt=Object(h.useState)(N),kt=Object(s.a)(wt,2),St=kt[0],Et=kt[1],Tt=Object(h.useState)(K),Ot=Object(s.a)(Tt,2),Nt=Ot[0],Lt=Ot[1],At=Object(h.useState)(""),_t=Object(s.a)(At,2),Mt=_t[0],Pt=_t[1],Dt=Object(h.useState)(0),It=Object(s.a)(Dt,2),Rt=It[0],Bt=It[1],jt=Object(h.useState)(x),zt=Object(s.a)(jt,2),Ft=zt[0],Ht=zt[1],Wt=Object(h.useState)(!1),Vt=Object(s.a)(Wt,2),Gt=(Vt[0],Vt[1]),Ut=Object(h.useRef)(Object(Y.a)()),qt=Object(h.useRef)(!1),Kt=Object(h.useRef)(),$t=Object(h.useRef)(),Xt=Object(h.useRef)(),Yt=Object(h.useRef)(),Jt=Object(h.useRef)(),Zt=function(){var t=Object(a.a)(u.a.mark((function t(){var e,n;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(X.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Ut.current}});case 2:null!=(n=t.sent)&&null!==(e=n.attachments)&&void 0!==e&&e.length&&(console.log("cm:",gt,$t),n.attachments.map((function(t){t.content_type.indexOf("image")>-1?gt.replaceSelection("![,](/api/attachments/".concat(t.id,"?type=").concat(t.content_type,")")):t.content_type.indexOf("video")>-1?gt.replaceSelection('')):t.content_type.indexOf("pdf")>-1?gt.replaceSelection('
    ').concat(t.name,"")):gt.replaceSelection("[".concat(t.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")"))})));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();Object(h.useEffect)((function(){Ct(pt),null==gt||gt.setValue(pt)}),[pt]),Object(h.useEffect)((function(){null==ot||ot(Nt)}),[Nt]),Object(h.useEffect)((function(){if($t.current){var t=f.a.fromTextArea($t.current,{mode:_,lineNumbers:!w,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});function e(e,n){if(!ct){var i=n.clipboardData;if(i){var r=i.types.toString(),a=i.items;if("Files"===r||i.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==_)return;try{var s,l=a[1];"file"===(null===(s=a[0])||void 0===s?void 0:s.kind)&&(l=a[0]);var c=l.getAsFile(),u=c.name.split(".").pop();H(c,(function(e){var n,i,r;e.id?(null==c||null===(n=c.type)||void 0===n?void 0:n.indexOf("image"))>-1?t.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==c||null===(i=c.type)||void 0===i?void 0:i.indexOf("video"))>-1?t.replaceSelection('')):(null==c||null===(r=c.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?t.replaceSelection('').concat(c.name,"")):nt.includes(u)?t.replaceSelection('').concat(c.name,"")):t.replaceSelection("[".concat(c.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(n){o.b.warn("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()}return E&&t.focus(),t.on("paste",e),t.on("dragleave",(function(t,e){Xt.current.classList.remove("mouse-hover-md")})),t.on("dragover",(function(t,e){Xt.current.classList.add("mouse-hover-md")})),t.on("drop",(function(e,n){var i;if(Xt.current.classList.add("mouse-hover-md"),(i=n.dataTransfer.files).length>0){n.preventDefault(),n.stopPropagation();for(var r=function(e){var n=i[e],r=n.name.split(".").pop();H(n,(function(e){var i,o,a;e.id?(null==n||null===(i=n.type)||void 0===i?void 0:i.indexOf("image"))>-1?t.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==n||null===(o=n.type)||void 0===o?void 0:o.indexOf("video"))>-1?t.replaceSelection('')):(null==n||null===(a=n.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?t.replaceSelection('').concat(n.name,"")):nt.includes(r)?t.replaceSelection('').concat(n.name,"")):t.replaceSelection("[".concat(n.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))},o=0;o0||i.target.offsetWidth>0)&&(Qt(),gt.setSize("100%","100%"),gt.refresh())}}catch(t){n.e(t)}finally{n.f()}}));return t.observe($t.current.parentElement),t}();return function(){t.unobserve($t.current.parentElement)}}}),[gt,Qt]),Object(h.useEffect)((function(){if(gt){for(var t=[],e=function(){var e=i[n],r=(o=Object(s.a)(e,2))[0],a=o[1],c=Object(l.a)({},r,(function(){te(a)}));t.push(c),gt.addKeyMap(c)},n=0,i=Object.entries(it);n0){var t=(new Date).getTime(),e=window.sessionStorage.getItem(I);t>=Rt+1e4&&(!e||e!==xt)&&(window.sessionStorage.setItem(I,xt),Gt(!0))}}),1e4),Object(h.useEffect)((function(){Et(N)}),[gt,N]),Object(h.useEffect)((function(){gt&&E&>.focus()}),[gt,E]),Object(h.useEffect)((function(){if(St&>){var t=gt.getScrollerElement();function e(t){var e=t.target;if(Jt.current){var n=e.scrollTop/e.scrollHeight;Jt.current.scrollTop=Jt.current.scrollHeight*n}}return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[gt,St]),Object(h.useEffect)((function(){if(gt&&et){function t(t,e){et(t,e)}return gt.on("beforeChange",t),function(){gt.off("beforeChange",t)}}}),[gt,et]),Object(h.useEffect)((function(){if(gt&&J){function t(){J(gt.getValue())}return gt.on("blur",t),function(){gt.off("blur",t)}}}),[gt,J]),Object(h.useEffect)((function(){if(gt){function t(t){var e=t.getValue();Ct(e),Bt((new Date).getTime()),t.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),c&&c(e)}return gt.on("change",t),function(){gt.off("change",t)}}}),[gt,c]),Object(h.useEffect)((function(){gt&&(null==n?(gt.setValue(""),Ct("")):n!==gt.getValue()&&(gt.setValue(n),Ct(n),gt.setCursor(gt.lineCount(),0)))}),[gt,n]);var te=Object(h.useCallback)((function(t){var e=gt.getCursor(),n=gt.getSelection(),i=n.split("\n");switch(t){case"bold":return gt.replaceSelection("**"+n+"**"),""===n&>.setCursor(e.line,e.ch+2),gt.focus();case"italic":return gt.replaceSelection("*"+n+"*"),""===n&>.setCursor(e.line,e.ch+1),gt.focus();case"code":return gt.replaceSelection("`"+n+"`"),""===n&>.setCursor(e.line,e.ch+1),gt.focus();case"inline-latex":return gt.replaceSelection("`$$"+n+"$$`"),""===n&>.setCursor(e.line,e.ch+3),gt.focus();case"latex":return gt.replaceSelection("```latex\n"+n+"\n```"),gt.setCursor(e.line+1,n.length+1),gt.focus();case"line-break":return gt.replaceSelection("
    \n"),gt.focus();case"list-ul":return""===n?gt.replaceSelection("- "+n):gt.replaceSelection(i.map((function(t){return""===t?"":"- ".concat(t)})).join("\n")),gt.focus();case"list-ol":return""===n?gt.replaceSelection("1. "+n):gt.replaceSelection(i.map((function(t,e){return""===t?"":"".concat(e+1,". ").concat(t)})).join("\n")),gt.focus();case"add-null-ch":return""===n&>.setCursor(e.line,e.ch+1),gt.replaceSelection("▁"),gt.focus();case"inster-template-1":return""===n&>.setCursor(e.line,e.ch),gt.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),gt.focus();case"eraser":return gt.setValue(""),gt.focus();case"trigger-watch":return Et(!St),gt.focus();case"trigger-full-screen":return Lt(!Nt),gt.focus();case"link":return void Pt("link");case"code-block":return void Pt("code-block");case"upload-image":return void Pt("upload-image");case"add-table":return void Pt("add-table");default:throw new Error}}),[gt,St,Nt]),ee=Object(h.useCallback)((function(t){switch(Pt(""),Mt){case"link":var e=t.title,n=t.link;return gt.replaceSelection("[".concat(e,"](").concat(n,")")),gt.focus();case"code-block":var i=t.language,r=t.content;return gt.replaceSelection(["```"+i,r,"```"].join("\n")),gt.focus();case"upload-image":var o=t.src,a=t.alt,s=t.name;return o.indexOf("type=image")>-1?gt.replaceSelection("![ ".concat(a||""," ]( ").concat(o,' "').concat(a||"",'" )')):o.indexOf("type=application/pdf")>-1?gt.replaceSelection('').concat(s,"")):gt.replaceSelection('').concat(s,"")),gt.focus();case"add-table":for(var l=t.row,c=t.col,u=t.align,h="\n",d=0;d300&&(i=300),Ht(x+i+"px")}}return t.addEventListener("mousedown",i),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),function(){t.removeEventListener("mousedown",i),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)}}}),[gt,Yt]),Object(h.useEffect)((function(){Ht(x)}),[x]);var re={width:tt(y),height:tt(Ft)};Object(h.useMemo)((function(){if(Rt){var t=new Date(Rt),e=t.getHours(),n=t.getMinutes(),i=t.getSeconds();return n=n<10?"0"+n:n,i=i<10?"0"+i:i,"".concat(e=e<10?"0"+e:e,":").concat(n,":").concat(i)}return 0}),[Rt]);return d.a.createElement(h.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:Xt},d.a.createElement("div",{className:"markdown-editor-container ".concat(st," ").concat(St?"on-preview":""," ").concat(w?"mini":""," ").concat(Nt?"full-screen":""),style:re},d.a.createElement(T,{insertTemp:L,watch:St,fullScreen:Nt,showNullButton:V,onActionCallback:te,hidetoolBar:U,uuid:Ut.current,setOpenPhones:function(){qt.current=!0}}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:$t,placeholder:ht})),St?d.a.createElement("div",{ref:Jt,className:"preview-container"},"stex"===_&&d.a.createElement(v,{value:xt}),"stex"!==_&&d.a.createElement(g.a,{edit:!0,value:xt,replaces:function(t,e){var n=gt.getValue();n=n.replace(t,e),Ct(n),null==gt||gt.setValue(n)}})):null))),B?d.a.createElement("a",{ref:Yt,className:"editor-resize"}):null,d.a.createElement(O.a,null,rt[Mt]?d.a.createElement(i.a,{centered:!0,title:rt[Mt],visible:!0,onCancel:ie,footer:null},ne):null))}},PGNT: /*!********************************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/editor.less?modules ***! \********************************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={wrap:"wrap___orWmH",modal:"modal___142IN",titleWrap:"titleWrap___2UWGN",required:"required___lXOtq",title:"title___2wqMf",colorGray:"colorGray___3FkLm",choiceWrap:"choiceWrap___3pbic",answer:"answer___30LSv",activeAnswer:"activeAnswer___3ayAN",deleteIcon:"deleteIcon___2HHly",addIcon:"addIcon___29vcx",editorWrap:"editorWrap___ANVP6",htmlWrap:"htmlWrap___38sLf",radio:"radio___15wok",color333:"color333___sNPjh",color999:"color999___1ofkl",fold:"fold___6rnoE",head:"head___2muph"}},PsQE: /*!********************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.less?modules ***! \********************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={flex_box_center:"flex_box_center___2PkN_",flex_space_between:"flex_space_between___36cDA",flex_box_vertical_center:"flex_box_vertical_center___2c88u",flex_box_center_end:"flex_box_center_end___14cXO",flex_box_column:"flex_box_column___3nalt",wrap:"wrap___3xZrs",left:"left___19hOK",title:"title___3Ti2k",total:"total___3MRC5",list:"list___3pdfL",name:"name___2IcTs",b:"b___2W0Sn",r:"r___2Tpj8",l:"l___1rMKQ",tag:"tag___jj2X5",right:"right___16831",examName:"examName___2TmgX",t:"t___1CJZd",num:"num___1qX6C",topWarp:"topWarp___3WuSr",head:"head___3z9Hq",so:"so___m2B6Z",btn:"btn___20VL7",content:"content___2tTuo",titleWrap:"titleWrap___1cYdQ",single:"single___1BKtz",analysis:"analysis___1qm4Y",text:"text___1JQUf",btnsElse:"btnsElse___2IzAs",btnsWrap:"btnsWrap___3ib37",btns:"btns___2DbBT",modalColumn:"modalColumn___1zs36",modalRow:"modalRow___14b2N",sup:"sup___1CIjI",popover:"popover___Mmcvb"}},"RZ/O": /*!****************************************!*\ !*** ./src/assets/images/paper/bi.svg ***! \****************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/bi.9c9b0364.svg"},SJMd: /*!****************************************************!*\ !*** ./node_modules/code-prettify/src/prettify.js ***! \****************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){window.PR_SHOULD_USE_CONTINUATION=!0,function(){var t=window,e=["break,continue,do,else,for,if,return,while"],n=[[e,"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"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],i=[n,"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"],r=[n,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],o=[n,"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"],a=[n,"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",l=[e,"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"],c=[e,"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"],u=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],h=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;function d(t,e,n,i,r){if(n){var o={sourceNode:t,pre:1,langExtension:null,numberLines:null,sourceCode:n,spans:null,basePos:e,decorations:null};i(o),r.push.apply(r,o.decorations)}}var p=/\S/;function f(t){for(var e=void 0,n=t.firstChild;n;n=n.nextSibling){var i=n.nodeType;e=1===i?e?t:n:3===i&&p.test(n.nodeValue)?t:e}return e===t?void 0:e}function m(t,e){var n,i={};!function(){for(var r=t.concat(e),o=[],a={},s=0,l=r.length;s=0;)i[u.charAt(h)]=c;var d=c[1],p=""+d;a.hasOwnProperty(p)||(o.push(d),a[p]=null)}o.push(/[\0-\uffff]/),n=function(t){for(var e=0,n=!1,i=!1,r=0,o=t.length;r122||(u<65||h>90||n.push([32|Math.max(65,h),32|Math.min(u,90)]),u<97||h>122||n.push([-33&Math.max(97,h),-33&Math.min(u,122)]))}}n.sort((function(t,e){return t[0]-e[0]||e[1]-t[1]}));var d=[],p=[];for(o=0;of[0]&&(f[1]+1>f[0]&&r.push("-"),r.push(l(f[1])))}return r.push("]"),r.join("")}function u(t){for(var i=t.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")),r=i.length,o=[],a=0,s=0;a=2&&"["===d?i[a]=c(h):"\\"!==d&&(i[a]=h.replace(/[a-zA-Z]/g,(function(t){var e=t.charCodeAt(0);return"["+String.fromCharCode(-33&e,32|e)+"]"})))}return i.join("")}var h=[];for(r=0,o=t.length;r=5&&"lang-"===y.substring(0,5))||b&&"string"==typeof b[1]||(g=!1,y="src"),g||(p[v]=y)}var k=u;if(u+=v.length,g){var S=b[1],E=v.indexOf(S),T=E+S.length;b[2]&&(E=(T=v.length-b[2].length)-S.length);var O=y.substring(5);d(l,s+k,v.substring(0,E),o,c),d(l,s+k+E,S,C(O,S),c),d(l,s+k+T,v.substring(T),o,c)}else c.push(s+k,y)}t.decorations=c};return o}function g(t){var e=[],n=[];t.tripleQuotedStrings?e.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):t.multiLineStrings?e.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):e.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),t.verbatimStrings&&n.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var i=t.hashComments;i&&(t.cStyleComments?(i>1?e.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):e.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),n.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):e.push(["com",/^#[^\r\n]*/,null,"#"])),t.cStyleComments&&(n.push(["com",/^\/\/[^\r\n]*/,null]),n.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var r=t.regexLiterals;if(r){var o=r>1?"":"\n\r",a=o?".":"[\\S\\s]",s="/(?=[^/*"+o+"])(?:[^/\\x5B\\x5C"+o+"]|\\x5C"+a+"|\\x5B(?:[^\\x5C\\x5D"+o+"]|\\x5C"+a+")*(?:\\x5D|$))+/";n.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+s+")")])}var l=t.types;l&&n.push(["typ",l]);var c=(""+t.keywords).replace(/^ | $/g,"");c.length&&n.push(["kwd",new RegExp("^(?:"+c.replace(/[\s,]+/g,"|")+")\\b"),null]),e.push(["pln",/^\s+/,null," \r\n\t "]);var u="^.[^\\s\\w.$@'\"`/\\\\]*";return t.regexLiterals&&(u+="(?!s*/)"),n.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i,null],["lit",new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(u),null]),m(e,n)}var v=g({keywords:[i,o,r,a,s,l,c,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function y(t,e,n){for(var i=/(?:^|\s)nocode(?:\s|$)/,r=/\r\n?|\n/,o=t.ownerDocument,a=o.createElement("li");t.firstChild;)a.appendChild(t.firstChild);var s=[a];function l(t){var e=t.nodeType;if(1!=e||i.test(t.className)){if((3==e||4==e)&&n){var a=t.nodeValue,s=a.match(r);if(s){var u=a.substring(0,s.index);t.nodeValue=u;var h=a.substring(s.index+s[0].length);if(h)t.parentNode.insertBefore(o.createTextNode(h),t.nextSibling);c(t),u||t.parentNode.removeChild(t)}}}else if("br"===t.nodeName)c(t),t.parentNode&&t.parentNode.removeChild(t);else for(var d=t.firstChild;d;d=d.nextSibling)l(d)}function c(t){for(;!t.nextSibling;)if(!(t=t.parentNode))return;for(var e,n=function t(e,n){var i=n?e.cloneNode(!1):e,r=e.parentNode;if(r){var o=t(r,1),a=e.nextSibling;o.appendChild(i);for(var s=a;s;s=a)a=s.nextSibling,o.appendChild(s)}return i}(t.nextSibling,0);(e=n.parentNode)&&1===e.nodeType;)n=e;s.push(n)}for(var u=0;u=0;){var r=n[i];b.hasOwnProperty(r)?t.console&&console.warn("cannot override language handler %s",r):b[r]=e}}function C(t,e){return t&&b.hasOwnProperty(t)||(t=/^\s*=x&&(u+=2),s>=C&&(p+=2)}}finally{v&&(v.style.display=y)}}(e)}catch(e){t.console&&console.log(e&&e.stack||e)}}function k(t,e,n){var i=n||!1,r=e||null,o=document.createElement("div");return o.innerHTML="
    "+t+"
    ",o=o.firstChild,i&&y(o,i,!0),w({langExtension:r,numberLines:i,sourceNode:o,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),o.innerHTML}function S(e,n){var i=n||document.body,r=i.ownerDocument||document;function o(t){return i.getElementsByTagName(t)}for(var a=[o("pre"),o("code"),o("xmp")],s=[],l=0;l]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),x(m([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],["pun",/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),x(m([],[["atv",/^[\s\S]+/]]),["uq.val"]),x(g({keywords:i,hashComments:!0,cStyleComments:!0,types:h}),["c","cc","cpp","cxx","cyc","m"]),x(g({keywords:"null,true,false"}),["json"]),x(g({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:h}),["cs"]),x(g({keywords:r,cStyleComments:!0}),["java"]),x(g({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),x(g({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),x(g({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),x(g({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),x(g({keywords:a,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),x(g({keywords:"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",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),x(m([],[["str",/^[\s\S]+/]]),["regex"]);var E=t.PR={createSimpleLexer:m,registerLangHandler:x,sourceDecorator:g,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:k,prettyPrint:S},T=t.define;"function"==typeof T&&T.amd&&T("google-code-prettify",[],(function(){return E}))}()},"VrN/": /*!***************************************************!*\ !*** ./node_modules/codemirror/lib/codemirror.js ***! \***************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=function(){"use strict";var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),i=/MSIE \d/.test(t),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=i||r||o,s=a&&(i?document.documentMode||6:+(o||r)[1]),l=!o&&/WebKit\//.test(t),c=l&&/Qt\/\d+\.\d+/.test(t),u=!o&&/Chrome\//.test(t),h=/Opera\//.test(t),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),f=/PhantomJS/.test(t),m=!o&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),g=/Android/.test(t),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=m||/Mac/.test(e),b=/\bCrOS\b/.test(t),x=/win/i.test(e),C=h&&t.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(h=!1,l=!0);var w=y&&(c||h&&(null==C||C<12.11)),k=n||a&&s>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var E,T=function(t,e){var n=t.className,i=S(e).exec(n);if(i){var r=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function O(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function N(t,e){return O(t).appendChild(e)}function L(t,e,n,i){var r=document.createElement(t);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}m?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(I=function(t){try{t.select()}catch(t){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function F(t,e){for(var n=0;n=e)return i+Math.min(a,e-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=e)return i}}var q=[""];function K(t){for(;q.length<=t;)q.push($(q)+" ");return q[t]}function $(t){return t[t.length-1]}function X(t,e){for(var n=[],i=0;i"€"&&(t.toUpperCase()!=t.toLowerCase()||Z.test(t))}function tt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&Q(t))||e.test(t):Q(t)}function et(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var nt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function it(t){return t.charCodeAt(0)>=768&&nt.test(t)}function rt(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var r=(e+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+i}}var at=null;function st(t,e,n){var i;at=null;for(var r=0;re)return r;o.to==e&&(o.from!=o.to&&"before"==n?i=r:at=r),o.from==e&&(o.from!=o.to&&"before"!=n?i=r:at=r)}return null!=i?i:at}var lt=function(){var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,n=/[LRr]/,i=/[Lb1n]/,r=/[1n]/;function o(t,e,n){this.level=t,this.from=e,this.to=n}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!t.test(a))return!1;for(var c,u=a.length,h=[],d=0;d-1&&(i[e]=r.slice(0,o).concat(r.slice(o+1)))}}}function ft(t,e){var n=dt(t,e);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r0}function yt(t){t.prototype.on=function(t,e){ht(this,t,e)},t.prototype.off=function(t,e){pt(this,t,e)}}function bt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function xt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Ct(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function wt(t){bt(t),xt(t)}function kt(t){return t.target||t.srcElement}function St(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var Et,Tt,Ot=function(){if(a&&s<9)return!1;var t=L("div");return"draggable"in t||"dragDrop"in t}();function Nt(t){if(null==Et){var e=L("span","​");N(t,L("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Et=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=Et?L("span","​"):L("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Lt(t){if(null!=Tt)return Tt;var e=N(t,document.createTextNode("AخA")),n=E(e,0,1).getBoundingClientRect(),i=E(e,1,2).getBoundingClientRect();return O(t),!(!n||n.left==n.right)&&(Tt=i.right-n.right<3)}var At,_t=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],i=t.length;e<=i;){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var o=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),e+=a+1):(n.push(o),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Mt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Pt="oncopy"in(At=L("div"))||(At.setAttribute("oncopy","return;"),"function"==typeof At.oncopy),Dt=null,It={},Rt={};function Bt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),It[t]=e}function jt(t){if("string"==typeof t&&Rt.hasOwnProperty(t))t=Rt[t];else if(t&&"string"==typeof t.name&&Rt.hasOwnProperty(t.name)){var e=Rt[t.name];"string"==typeof e&&(e={name:e}),(t=J(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return jt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return jt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function zt(t,e){e=jt(e);var n=It[e.name];if(!n)return zt(t,"text/plain");var i=n(t,e);if(Ft.hasOwnProperty(e.name)){var r=Ft[e.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=e.name,e.helperType&&(i.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)i[a]=e.modeProps[a];return i}var Ft={};function Ht(t,e){B(e,Ft.hasOwnProperty(t)?Ft[t]:Ft[t]={})}function Wt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var i in e){var r=e[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Vt(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Gt(t,e,n){return!t.startState||t.startState(e,n)}var Ut=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function qt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(e=t.first&&en?te(n,qt(t,n).text.length):function(t,e){var n=t.ch;return null==n||n>e?te(t.line,e):n<0?te(t.line,0):t}(e,qt(t,e.line).text.length)}function le(t,e){for(var n=[],i=0;i=this.string.length},Ut.prototype.sol=function(){return this.pos==this.lineStart},Ut.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ut.prototype.next=function(){if(this.pose},Ut.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Ut.prototype.skipToEnd=function(){this.pos=this.string.length},Ut.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Ut.prototype.backUp=function(t){this.pos-=t},Ut.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t};if(r(this.string.substr(this.pos,t.length))==r(t))return!1!==e&&(this.pos+=t.length),!0},Ut.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ut.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Ut.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Ut.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ce=function(t,e){this.state=t,this.lookAhead=e},ue=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function he(t,e,n,i){var r=[t.state.modeGen],o={};xe(t,e.text,t.doc.mode,n,(function(t,e){return r.push(t,e)}),o,i);for(var a=n.state,s=function(i){n.baseTokens=r;var s=t.state.overlays[i],l=1,c=0;n.state=!0,xe(t,e.text,s.mode,n,(function(t,e){for(var n=l;ct&&r.splice(l,1,t,r[l+1],i),l+=2,c=Math.min(t,i)}if(e)if(s.opaque)r.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&Wt(t.doc.mode,i.state),o=he(t,e,i);r&&(i.state=r),e.stateAfter=i.save(!r),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function pe(t,e,n){var i=t.doc,r=t.display;if(!i.mode.startState)return new ue(i,!0,e);var o=function(t,e,n){for(var i,r,o=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=o.first)return o.first;var l=qt(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ce?c.lookAhead:0)<=o.modeFrontier))return s;var u=j(l.text,null,t.options.tabSize);(null==r||i>u)&&(r=s-1,i=u)}return r}(t,e,n),a=o>i.first&&qt(i,o-1).stateAfter,s=a?ue.fromSaved(i,a,o):new ue(i,Gt(i.mode),o);return i.iter(o,e,(function(n){fe(t,n.text,s);var i=s.line;n.stateAfter=i==e-1||i%5==0||i>=r.viewFrom&&ie.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}ue.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},ue.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},ue.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ue.fromSaved=function(t,e,n){return e instanceof ce?new ue(t,Wt(t.mode,e.state),n,e.lookAhead):new ue(t,Wt(t.mode,e),n)},ue.prototype.save=function(t){var e=!1!==t?Wt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ce(e,this.maxLookAhead):e};var ve=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function ye(t,e,n,i){var r,o,a=t.doc,s=a.mode,l=qt(a,(e=se(a,e)).line),c=pe(t,e.line,n),u=new Ut(l.text,t.options.tabSize,c);for(i&&(o=[]);(i||u.post.options.maxHighlightLength?(s=!1,a&&fe(t,e,i,h.pos),h.pos=e.length,l=null):l=be(ge(n,h,i.state,d),o),d){var p=d[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;c=e:o.to>e);(i||(i=[])).push(new ke(a,o.from,s?null:o.to))}}return i}(n,r,a),l=function(t,e,n){var i;if(t)for(var r=0;r=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from0&&s)for(var b=0;be)&&(!n||Me(n,o.marker)<0)&&(n=o.marker)}return n}function Be(t,e,n,i,r){var o=qt(t,e),a=we&&o.markedSpans;if(a)for(var s=0;s=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ee(c.to,n)>=0:ee(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ee(c.from,i)<=0:ee(c.from,i)<0)))return!0}}}function je(t){for(var e;e=De(t);)t=e.find(-1,!0).line;return t}function ze(t,e){var n=qt(t,e),i=je(n);return n==i?e:Yt(i)}function Fe(t,e){if(e>t.lastLine())return e;var n,i=qt(t,e);if(!He(t,i))return e;for(;n=Ie(i);)i=n.find(1,!0).line;return Yt(i)+1}function He(t,e){var n=we&&e.markedSpans;if(n)for(var i=void 0,r=0;re.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var qe=function(t,e,n){this.text=t,Le(this,e),this.height=n?n(this):1};function Ke(t){t.parent=null,Ne(t)}qe.prototype.lineNo=function(){return Yt(this)},yt(qe);var $e={},Xe={};function Ye(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?Xe:$e;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function Je(t,e){var n=A("span",null,null,l?"padding-right: .1px":null),i={pre:A("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var r=0;r<=(e.rest?e.rest.length:0);r++){var o=r?e.rest[r-1]:e.line,a=void 0;i.pos=0,i.addToken=Qe,Lt(t.display.measure)&&(a=ct(o,t.doc.direction))&&(i.addToken=tn(i.addToken,a)),i.map=[],nn(o,i,de(t,o,e!=t.display.externalMeasured&&Yt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=D(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=D(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Nt(t.display.measure))),0==r?(e.measure.map=i.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(i.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=i.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return ft(t,"renderLine",t,e.line,i.pre),i.pre.className&&(i.textClass=D(i.pre.className,i.textClass||"")),i}function Ze(t){var e=L("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function Qe(t,e,n,i,r,o,l){if(e){var c,u=t.splitSpaces?function(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,i="",r=0;rc&&h.from<=c);d++);if(h.to>=u)return t(n,i,r,o,a,s,l);t(n,i.slice(0,h.to-c),r,o,null,s,l),o=null,i=i.slice(h.to-c),c=h.to}}}function en(t,e,n,i){var r=!i&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!i&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function nn(t,e,n){var i=t.markedSpans,r=t.text,o=0;if(i)for(var a,s,l,c,u,h,d,p=r.length,f=0,m=1,g="",v=0;;){if(v==f){l=c=u=s="",d=null,h=null,v=1/0;for(var y=[],b=void 0,x=0;xf||w.collapsed&&C.to==f&&C.from==f)){if(null!=C.to&&C.to!=f&&v>C.to&&(v=C.to,c=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&C.from==f&&(u+=" "+w.startStyle),w.endStyle&&C.to==v&&(b||(b=[])).push(w.endStyle,C.to),w.title&&((d||(d={})).title=w.title),w.attributes)for(var k in w.attributes)(d||(d={}))[k]=w.attributes[k];w.collapsed&&(!h||Me(h.marker,w)<0)&&(h=C)}else C.from>f&&v>C.from&&(v=C.from)}if(b)for(var S=0;S=p)break;for(var T=Math.min(p,v);;){if(g){var O=f+g.length;if(!h){var N=O>T?g.slice(0,T-f):g;e.addToken(e,N,a?a+l:l,u,f+N.length==v?c:"",s,d)}if(O>=T){g=g.slice(T-f),f=T;break}f=O,u=""}g=r.slice(o,o=n[m++]),a=Ye(n[m++],e.cm.options)}}else for(var L=1;Ln)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function An(t,e,n,i){return Pn(t,Mn(t,e),n,i)}function _n(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&e2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(t,e.view,e.rect),e.hasHeights=!0),(o=function(t,e,n,i){var r,o=Rn(e.map,n,i),l=o.node,c=o.start,u=o.end,h=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&it(e.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u1}(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*i,bottom:e.bottom*i}}(t.display.measure,r))}else{var p;c>0&&(h=i="right"),r=t.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==i?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!r||!r.left&&!r.right)){var f=l.parentNode.getClientRects()[0];r=f?{left:f.left,right:f.left+ri(t.display),top:f.top,bottom:f.bottom}:In}for(var m=r.top-e.rect.top,g=r.bottom-e.rect.top,v=(m+g)/2,y=e.view.measure.heights,b=0;be)&&(r=(o=l-s)-1,e>=l&&(a="right")),null!=r){if(i=t[c+2],s==l&&n==(i.insertLeft?"left":"right")&&(a=n),"left"==n&&0==r)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)i=t[2+(c-=3)],a="left";if("right"==n&&r==l-s)for(;c=0&&(n=t[r]).left==n.right;r--);return n}function jn(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var e=0;e=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var h=st(s,l,c),d=at,p=u(l,h,"before"==c);return null!=d&&(p.other=u(l,d,"before"!=c)),p}function $n(t,e){var n=0;e=se(t.doc,e),t.options.lineWrapping||(n=ri(t.display)*e.ch);var i=qt(t.doc,e.line),r=Ve(i)+kn(t.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Xn(t,e,n,i,r){var o=te(t,e,n);return o.xRel=r,i&&(o.outside=i),o}function Yn(t,e,n){var i=t.doc;if((n+=t.display.viewOffset)<0)return Xn(i.first,0,null,-1,-1);var r=Jt(i,n),o=i.first+i.size-1;if(r>o)return Xn(i.first+i.size-1,qt(i,o).text.length,null,1,1);e<0&&(e=0);for(var a=qt(i,r);;){var s=ti(t,a,r,e,n),l=Re(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==r)return c;a=qt(i,r=c.line)}}function Jn(t,e,n,i){i-=Vn(e);var r=e.text.length,o=ot((function(e){return Pn(t,n,e-1).bottom<=i}),r,0);return{begin:o,end:r=ot((function(e){return Pn(t,n,e).top>i}),o,r)}}function Zn(t,e,n,i){return n||(n=Mn(t,e)),Jn(t,e,n,Gn(t,e,Pn(t,n,i),"line").top)}function Qn(t,e,n,i){return!(t.bottom<=n)&&(t.top>n||(i?t.left:t.right)>e)}function ti(t,e,n,i,r){r-=Ve(e);var o=Mn(t,e),a=Vn(e),s=0,l=e.text.length,c=!0,u=ct(e,t.doc.direction);if(u){var h=(t.options.lineWrapping?ni:ei)(t,e,n,o,u,i,r);s=(c=1!=h.level)?h.from:h.to-1,l=c?h.to:h.from-1}var d,p,f=null,m=null,g=ot((function(e){var n=Pn(t,o,e);return n.top+=a,n.bottom+=a,!!Qn(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(f=e,m=n),!0)}),s,l),v=!1;if(m){var y=i-m.left=x.bottom?1:0}return Xn(n,g=rt(e.text,g,1),p,v,i-d)}function ei(t,e,n,i,r,o,a){var s=ot((function(s){var l=r[s],c=1!=l.level;return Qn(Kn(t,te(n,c?l.to:l.from,c?"before":"after"),"line",e,i),o,a,!0)}),0,r.length-1),l=r[s];if(s>0){var c=1!=l.level,u=Kn(t,te(n,c?l.from:l.to,c?"after":"before"),"line",e,i);Qn(u,o,a,!0)&&u.top>a&&(l=r[s-1])}return l}function ni(t,e,n,i,r,o,a){var s=Jn(t,e,i,a),l=s.begin,c=s.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d=c||p.to<=l)){var f=Pn(t,i,1!=p.level?Math.min(c,p.to)-1:Math.max(l,p.from)).right,m=fm)&&(u=p,h=m)}}return u||(u=r[r.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function ii(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==Dn){Dn=L("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)Dn.appendChild(document.createTextNode("x")),Dn.appendChild(L("br"));Dn.appendChild(document.createTextNode("x"))}N(t.measure,Dn);var n=Dn.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),O(t.measure),n||1}function ri(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=L("span","xxxxxxxxxx"),n=L("pre",[e],"CodeMirror-line-like");N(t.measure,n);var i=e.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function oi(t){for(var e=t.display,n={},i={},r=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+r,i[s]=o.clientWidth}return{fixedPos:ai(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:e.wrapper.clientWidth}}function ai(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function si(t){var e=ii(t.display),n=t.options.lineWrapping,i=n&&Math.max(5,t.display.scroller.clientWidth/ri(t.display)-3);return function(r){if(He(t.doc,r))return 0;var o=0;if(r.widgets)for(var a=0;a0&&(l=qt(t.doc,c.line).text).length==c.ch){var u=j(l,l.length,t.options.tabSize)-l.length;c=te(c.line,Math.max(0,Math.round((o-En(t.display).left)/ri(t.display))-u))}return c}function ui(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,i=0;ie)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)we&&ze(t.doc,e)r.viewFrom?pi(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)pi(t);else if(e<=r.viewFrom){var o=fi(t,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):pi(t)}else if(n>=r.viewTo){var a=fi(t,e,e,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):pi(t)}else{var s=fi(t,e,e,-1),l=fi(t,n,n+i,1);s&&l?(r.view=r.view.slice(0,s.index).concat(on(t,s.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):pi(t)}var c=r.externalMeasured;c&&(n=r.lineN&&e=i.viewTo)){var o=i.view[ui(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==F(a,n)&&a.push(n)}}}function pi(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function fi(t,e,n,i){var r,o=ui(t,e),a=t.display.view;if(!we||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,l=0;l0){if(o==a.length-1)return null;r=s+a[o].size-e,o++}else r=s-e;e+=r,n+=r}for(;ze(t.doc,n)!=n;){if(o==(i<0?0:a.length-1))return null;n+=i*a[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function mi(t){for(var e=t.display.view,n=0,i=0;i=t.display.viewTo||s.to().linee||e==n&&a.to==e)&&(i(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),r=!0)}r||i(e,n,"ltr")}(m,n||0,null==i?d:i,(function(t,e,r,h){var g="ltr"==r,v=p(t,g?"left":"right"),y=p(e-1,g?"right":"left"),b=null==n&&0==t,x=null==i&&e==d,C=0==h,w=!m||h==m.length-1;if(y.top-v.top<=3){var k=(c?x:b)&&w,S=(c?b:x)&&C?s:(g?v:y).left,E=k?l:(g?y:v).right;u(S,v.top,E-S,v.bottom)}else{var T,O,N,L;g?(T=c&&b&&C?s:v.left,O=c?l:f(t,r,"before"),N=c?s:f(e,r,"after"),L=c&&x&&w?l:y.right):(T=c?f(t,r,"before"):s,O=!c&&b&&C?l:v.right,N=!c&&x&&w?s:y.left,L=c?f(e,r,"after"):l),u(T,v.top,O-T,v.bottom),v.bottom0?e.blinker=setInterval((function(){t.hasFocus()||Ei(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function wi(t){t.state.focused||(t.display.input.focus(),Si(t))}function ki(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,Ei(t))}),100)}function Si(t,e){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(ft(t,"focus",t,e),t.state.focused=!0,P(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),Ci(t))}function Ei(t,e){t.state.delayingBlurEvent||(t.state.focused&&(ft(t,"blur",t,e),t.state.focused=!1,T(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Ti(t){for(var e=t.display,n=e.lineDiv.offsetTop,i=0;i.005||d<-.005)&&(Xt(r.line,l),Oi(r.line),r.rest))for(var p=0;pt.display.sizerWidth){var f=Math.ceil(c/ri(t.display));f>t.display.maxLineLength&&(t.display.maxLineLength=f,t.display.maxLine=r.line,t.display.maxLineChanged=!0)}}}}function Oi(t){if(t.widgets)for(var e=0;e=a&&(o=Jt(e,Ve(qt(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Li(t,e){var n=t.display,i=ii(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Nn(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+Sn(n),l=e.tops-i;if(e.topr+o){var u=Math.min(e.top,(c?s:e.bottom)-o);u!=r&&(a.scrollTop=u)}var h=t.options.fixedGutter?0:n.gutters.offsetWidth,d=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-h,p=On(t)-n.gutters.offsetWidth,f=e.right-e.left>p;return f&&(e.right=e.left+p),e.left<10?a.scrollLeft=0:e.leftp+d-3&&(a.scrollLeft=e.right+(f?0:10)-p),a}function Ai(t,e){null!=e&&(Pi(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function _i(t){Pi(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function Mi(t,e,n){null==e&&null==n||Pi(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function Pi(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,Di(t,$n(t,e.from),$n(t,e.to),e.margin))}function Di(t,e,n,i){var r=Li(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-i,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+i});Mi(t,r.scrollLeft,r.scrollTop)}function Ii(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||lr(t,{top:e}),Ri(t,e,!0),n&&lr(t),ir(t,100))}function Ri(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function Bi(t,e,n,i){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!i||(t.doc.scrollLeft=e,hr(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function ji(t){var e=t.display,n=e.gutters.offsetWidth,i=Math.round(t.doc.height+Sn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Tn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var zi=function(t,e,n){this.cm=n;var i=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,t(i),t(r),ht(i,"scroll",(function(){i.clientHeight&&e(i.scrollTop,"vertical")})),ht(r,"scroll",(function(){r.clientWidth&&e(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zi.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},zi.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zi.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zi.prototype.zeroWidthHack=function(){var t=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},zi.prototype.enableZeroWidthBar=function(t,e,n){t.style.pointerEvents="auto",e.set(1e3,(function i(){var r=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,i)}))},zi.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var Fi=function(){};function Hi(t,e){e||(e=ji(t));var n=t.display.barWidth,i=t.display.barHeight;Wi(t,e);for(var r=0;r<4&&n!=t.display.barWidth||i!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&Ti(t),Wi(t,ji(t)),n=t.display.barWidth,i=t.display.barHeight}function Wi(t,e){var n=t.display,i=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}Fi.prototype.update=function(){return{bottom:0,right:0}},Fi.prototype.setScrollLeft=function(){},Fi.prototype.setScrollTop=function(){},Fi.prototype.clear=function(){};var Vi={native:zi,null:Fi};function Gi(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&T(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Vi[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ht(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?Bi(t,e):Ii(t,e)}),t),t.display.scrollbars.addClass&&P(t.display.wrapper,t.display.scrollbars.addClass)}var Ui=0;function qi(t){var e;t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ui},e=t.curOp,an?an.ops.push(e):e.ownsGroup=an={ops:[e],delayedCallbacks:[]}}function Ki(t){var e=t.curOp;e&&function(t,e){var n=t.ownsGroup;if(n)try{!function(t){var e=t.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new or(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Xi(t){t.updatedDisplay=t.mustUpdate&&ar(t.cm,t.update)}function Yi(t){var e=t.cm,n=e.display;t.updatedDisplay&&Ti(e),t.barMeasure=ji(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=An(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Tn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-On(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Ji(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!f){var o=L("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-kn(t.display))+"px;\n height: "+(e.bottom-e.top+Tn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(r),t.display.lineSpace.removeChild(o)}}}(e,function(t,e,n,i){var r;null==i&&(i=0),t.options.lineWrapping||e!=n||(n="before"==(e=e.ch?te(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?te(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var a=!1,s=Kn(t,e),l=n&&n!=e?Kn(t,n):s,c=Li(t,r={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-i,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+i}),u=t.doc.scrollTop,h=t.doc.scrollLeft;if(null!=c.scrollTop&&(Ii(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Bi(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return r}(e,se(i,t.scrollToPos.from),se(i,t.scrollToPos.to),t.scrollToPos.margin));var r=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers;if(r)for(var a=0;a=t.display.viewTo)){var n=+new Date+t.options.workTime,i=pe(t,e.highlightFrontier),r=[];e.iter(i.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(i.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?Wt(e.mode,i.state):null,l=he(t,o,i,!0);s&&(i.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&dn)return ir(t,t.options.workDelay),!0})),e.highlightFrontier=i.line,e.modeFrontier=Math.max(e.modeFrontier,i.line),r.length&&Qi(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mi(t))return!1;dr(t)&&(pi(t),e.dims=oi(t));var r=i.first+i.size,o=Math.max(e.visible.from-t.options.viewportMargin,i.first),a=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(r,n.viewTo)),we&&(o=ze(t.doc,o),a=Fe(t.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;!function(t,e,n){var i=t.display;0==i.view.length||e>=i.viewTo||n<=i.viewFrom?(i.view=on(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=on(t,e,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,ui(t,n)))),i.viewTo=n}(t,o,a),n.viewOffset=Ve(qt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var c=mi(t);if(!s&&0==c&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(t){if(t.hasFocus())return null;var e=M();if(!e||!_(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&_(t.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}(t);return c>4&&(n.lineDiv.style.display="none"),function(t,e,n){var i=t.display,r=t.options.lineNumbers,o=i.lineDiv,a=o.firstChild;function s(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=i.view,u=i.viewFrom,h=0;h-1&&(p=!1),un(t,d,u,n)),p&&(O(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Qt(t.options,u)))),a=d.node.nextSibling}else{var f=vn(t,d,u,n);o.insertBefore(f,a)}u+=d.size}for(;a;)a=s(a)}(t,n.updateLineNumbers,e.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(t){if(t&&t.activeElt&&t.activeElt!=M()&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&_(document.body,t.anchorNode)&&_(document.body,t.focusNode))){var e=window.getSelection(),n=document.createRange();n.setEnd(t.anchorNode,t.anchorOffset),n.collapse(!1),e.removeAllRanges(),e.addRange(n),e.extend(t.focusNode,t.focusOffset)}}(u),O(n.cursorDiv),O(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,ir(t,400)),n.updateLineNumbers=null,!0}function sr(t,e){for(var n=e.viewport,i=!0;;i=!1){if(i&&t.options.lineWrapping&&e.oldDisplayWidth!=On(t))i&&(e.visible=Ni(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Sn(t.display)-Nn(t),n.top)}),e.visible=Ni(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!ar(t,e))break;Ti(t);var r=ji(t);gi(t),Hi(t,r),ur(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function lr(t,e){var n=new or(t,e);if(ar(t,n)){Ti(t),sr(t,n);var i=ji(t);gi(t),Hi(t,i),ur(t,i),n.finish()}}function cr(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function ur(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Tn(t)+"px"}function hr(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var i=ai(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,o=i+"px",a=0;as.clientWidth,u=s.scrollHeight>s.clientHeight;if(r&&c||o&&u){if(o&&y&&l)t:for(var d=e.target,p=a.view;d!=s;d=d.parentNode)for(var f=0;f=0&&ee(t,i.to())<=0)return n}return-1};var kr=function(t,e){this.anchor=t,this.head=e};function Sr(t,e,n){var i=t&&t.options.selectionsMayTouch,r=e[n];e.sort((function(t,e){return ee(t.from(),e.from())})),n=F(e,r);for(var o=1;o0:l>=0){var c=oe(s.from(),a.from()),u=re(s.to(),a.to()),h=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new kr(h?u:c,h?c:u))}}return new wr(e,n)}function Er(t,e){return new wr([new kr(t,e||t)],0)}function Tr(t){return t.text?te(t.from.line+t.text.length-1,$(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function Or(t,e){if(ee(t,e.from)<0)return t;if(ee(t,e.to)<=0)return Tr(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=Tr(e).ch-e.to.ch),te(n,i)}function Nr(t,e){for(var n=[],i=0;i1&&t.remove(s.line+1,f-1),t.insert(s.line+1,v)}ln(t,"change",t,e)}function Dr(t,e,n){!function t(i,r,o){if(i.linked)for(var a=0;as-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=function(t,e){return e?(zr(t.done),$(t.done)):t.done.length&&!$(t.done).ranges?$(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),$(t.done)):void 0}(r,r.lastOp==i)))a=$(o.changes),0==ee(e.from,e.to)&&0==ee(e.from,a.to)?a.to=Tr(e):o.changes.push(jr(t,e));else{var l=$(r.done);for(l&&l.ranges||Wr(t.sel,r.done),o={changes:[jr(t,e)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,a||ft(t,"historyAdded")}function Hr(t,e,n,i){var r=t.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||function(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}(t,o,$(r.done),e))?r.done[r.done.length-1]=e:Wr(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&zr(r.undone)}function Wr(t,e){var n=$(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Vr(t,e,n,i){var r=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),(function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function Gr(t){if(!t)return null;for(var e,n=0;n-1&&($(s)[h]=c[h],delete c[h])}}}return i}function Kr(t,e,n,i){if(i){var r=t.anchor;if(n){var o=ee(e,r)<0;o!=ee(n,r)<0?(r=e,e=n):o!=ee(e,n)<0&&(e=n)}return new kr(r,e)}return new kr(n||e,e)}function $r(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),Qr(t,new wr([Kr(t.sel.primary(),e,n,r)],0),i)}function Xr(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:s.to>e.ch))){if(r&&(ft(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var h=l.find(i<0?1:-1),d=void 0;if((i<0?u:c)&&(h=ao(t,h,-i,h&&h.line==e.line?o:null)),h&&h.line==e.line&&(d=ee(h,n))&&(i<0?d<0:d>0))return ro(t,h,e,i,r)}var p=l.find(i<0?-1:1);return(i<0?c:u)&&(p=ao(t,p,i,p.line==e.line?o:null)),p?ro(t,p,e,i,r):null}}return e}function oo(t,e,n,i,r){var o=i||1,a=ro(t,e,n,o,r)||!r&&ro(t,e,n,o,!0)||ro(t,e,n,-o,r)||!r&&ro(t,e,n,-o,!0);return a||(t.cantEdit=!0,te(t.first,0))}function ao(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?se(t,te(e.line-1)):null:n>0&&e.ch==(i||qt(t,e.line)).text.length?e.line0)){var u=[l,1],h=ee(c.from,s.from),d=ee(c.to,s.to);(h<0||!a.inclusiveLeft&&!h)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}(t,e.from,e.to);if(i)for(var r=i.length-1;r>=0;--r)uo(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text,origin:e.origin});else uo(t,e)}}function uo(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ee(e.from,e.to)){var n=Nr(t,e);Fr(t,e,n,t.cm?t.cm.curOp.id:NaN),fo(t,e,n,Te(t,e));var i=[];Dr(t,(function(t,n){n||-1!=F(i,t.history)||(yo(t.history,e),i.push(t.history)),fo(t,e,null,Te(t,e))}))}}function ho(t,e,n){var i=t.cm&&t.cm.state.suppressEdits;if(!i||n){for(var r,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,c=0;c=0;--p){var f=d(p);if(f)return f.v}}}}function po(t,e){if(0!=e&&(t.first+=e,t.sel=new wr(X(t.sel.ranges,(function(t){return new kr(te(t.anchor.line+e,t.anchor.ch),te(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){hi(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;it.lastLine())){if(e.from.lineo&&(e={from:e.from,to:te(o,qt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Kt(t,e.from,e.to),n||(n=Nr(t,e)),t.cm?function(t,e,n){var i=t.doc,r=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=Yt(je(qt(i,o.line))),i.iter(l,a.line+1,(function(t){if(t==r.maxLine)return s=!0,!0}))),i.sel.contains(e.from,e.to)>-1&>(t),Pr(i,e,n,si(t)),t.options.lineWrapping||(i.iter(l,o.line+e.text.length,(function(t){var e=Ge(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),function(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;i--){var r=qt(t,i).stateAfter;if(r&&(!(r instanceof ce)||i+r.lookAhead1||!(this.children[0]instanceof xo))){var s=[];this.collapse(s),this.children=[new xo(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var a=r.lines.length%25+25,s=a;s10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=0;i0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Be(t,e.line,e,n,o)||e.line!=n.line&&Be(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");we=!0}o.addToHistory&&Fr(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(t){c&&o.collapsed&&!c.options.lineWrapping&&je(t)==c.display.maxLine&&(s=!0),o.collapsed&&l!=e.line&&Xt(t,0),function(t,e){t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t)}(t,new ke(o,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){He(t,e)&&Xt(e,0)})),o.clearOnEnter&&ht(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ce=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)hi(c,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=e.line;u<=n.line;u++)di(c,u,"text");o.atomic&&no(c.doc),ln(c,"markerAdded",c,o)}return o}Eo.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&qi(t),vt(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;ot.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&hi(t,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&no(t.doc)),t&&ln(t,"markerCleared",t,this,i,r),e&&Ki(t),this.parent&&this.parent.clear()}},Eo.prototype.find=function(t,e){var n,i;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r=0;l--)co(this,i[l]);s?Zr(this,s):this.cm&&_i(this.cm)})),undo:nr((function(){ho(this,"undo")})),redo:nr((function(){ho(this,"redo")})),undoSelection:nr((function(){ho(this,"undo",!0)})),redoSelection:nr((function(){ho(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,i=0;i=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=se(this,t),e=se(this,e);var i=[],r=t.line;return this.iter(t.line,e.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var i=0;it)return e=t,!0;t-=o,++n})),se(this,te(n,e))},indexFromPos:function(t){var e=(t=se(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var h=t.dataTransfer.getData("Text");if(h){var d;if(e.state.draggingText&&!e.state.draggingText.copy&&(d=e.listSelections()),to(e.doc,Er(n,n)),d)for(var p=0;p=0;e--)mo(t.doc,"",i[e].from,i[e].to,"+delete");_i(t)}))}function Zo(t,e,n){var i=rt(t.text,e+n,n);return i<0||i>t.text.length?null:i}function Qo(t,e,n){var i=Zo(t,e.ch,n);return null==i?null:new te(e.line,i,n<0?"after":"before")}function ta(t,e,n,i,r){if(t){"rtl"==e.doc.direction&&(r=-r);var o=ct(n,e.doc.direction);if(o){var a,s=r<0?$(o):o[0],l=r<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=Mn(e,n);a=r<0?n.text.length-1:0;var u=Pn(e,c,a).top;a=ot((function(t){return Pn(e,c,t).top==u}),r<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Zo(n,a,1))}else a=r<0?s.to:s.from;return new te(i,a,l)}}return new te(i,r<0?n.text.length:0,r<0?"before":"after")}Vo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Vo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Vo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Vo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Vo.default=y?Vo.macDefault:Vo.pcDefault;var ea={selectAll:so,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),W)},killLine:function(t){return Jo(t,(function(e){if(e.empty()){var n=qt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)r=new te(r.line,r.ch+1),t.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),te(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var a=qt(t.doc,r.line-1).text;a&&(r=new te(r.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),te(r.line-1,a.length-1),r,"+transpose"))}n.push(new kr(r,r))}t.setSelections(n)}))},newlineAndIndent:function(t){return Qi(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var i=0;i-1&&(ee((r=c.ranges[r]).from(),e)<0||e.xRel>0)&&(ee(r.to(),e)>0||e.xRel<0)?function(t,e,n,i){var r=t.display,o=!1,c=tr(t,(function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,pt(r.wrapper.ownerDocument,"mouseup",c),pt(r.wrapper.ownerDocument,"mousemove",u),pt(r.scroller,"dragstart",h),pt(r.scroller,"drop",c),o||(bt(e),i.addNew||$r(t.doc,n,null,null,i.extend),l&&!d||a&&9==s?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},h=function(){return o=!0};l&&(r.scroller.draggable=!0),t.state.draggingText=c,c.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),ht(r.wrapper.ownerDocument,"mouseup",c),ht(r.wrapper.ownerDocument,"mousemove",u),ht(r.scroller,"dragstart",h),ht(r.scroller,"drop",c),ki(t),setTimeout((function(){return r.input.focus()}),20)}(t,i,e,o):function(t,e,n,i){var r=t.display,o=t.doc;bt(e);var a,s,l=o.sel,c=l.ranges;if(i.addNew&&!i.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new kr(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new kr(n,n)),n=ci(t,e,!0,!0),s=-1;else{var u=va(t,n,i.unit);a=i.extend?Kr(a,u.anchor,u.head,i.extend):u}i.addNew?-1==s?(s=c.length,Qr(o,Sr(t,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==i.unit&&!i.extend?(Qr(o,Sr(t,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Yr(o,s,a,V):(s=0,Qr(o,new wr([a],0),V),l=o.sel);var h=n;function d(e){if(0!=ee(h,e))if(h=e,"rectangle"==i.unit){for(var r=[],c=t.options.tabSize,u=j(qt(o,n.line).text,n.ch,c),d=j(qt(o,e.line).text,e.ch,c),p=Math.min(u,d),f=Math.max(u,d),m=Math.min(n.line,e.line),g=Math.min(t.lastLine(),Math.max(n.line,e.line));m<=g;m++){var v=qt(o,m).text,y=U(v,p,c);p==f?r.push(new kr(te(m,y),te(m,y))):v.length>y&&r.push(new kr(te(m,y),te(m,U(v,f,c))))}r.length||r.push(new kr(n,n)),Qr(o,Sr(t,l.ranges.slice(0,s).concat(r),s),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,x=a,C=va(t,e,i.unit),w=x.anchor;ee(C.anchor,w)>0?(b=C.head,w=oe(x.from(),C.anchor)):(b=C.anchor,w=re(x.to(),C.head));var k=l.ranges.slice(0);k[s]=function(t,e){var n=e.anchor,i=e.head,r=qt(t.doc,n.line);if(0==ee(n,i)&&n.sticky==i.sticky)return e;var o=ct(r);if(!o)return e;var a=st(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return e;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=st(o,i.ch,i.sticky),h=u-a||(i.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?h<0:h>0}var d=o[c+(l?-1:0)],p=l==(1==d.level),f=p?d.from:d.to,m=p?"after":"before";return n.ch==f&&n.sticky==m?e:new kr(new te(n.line,f,m),i)}(t,new kr(se(o,w),b)),Qr(o,Sr(t,k,s),V)}}var p=r.wrapper.getBoundingClientRect(),f=0;function m(e){t.state.selectingText=!1,f=1/0,e&&(bt(e),r.input.focus()),pt(r.wrapper.ownerDocument,"mousemove",g),pt(r.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var g=tr(t,(function(e){0!==e.buttons&&St(e)?function e(n){var a=++f,s=ci(t,n,!0,"rectangle"==i.unit);if(s)if(0!=ee(s,h)){t.curOp.focus=M(),d(s);var l=Ni(r,o);(s.line>=l.to||s.linep.bottom?20:0;c&&setTimeout(tr(t,(function(){f==a&&(r.scroller.scrollTop+=c,e(n))})),50)}}(e):m(e)})),v=tr(t,m);t.state.selectingText=v,ht(r.wrapper.ownerDocument,"mousemove",g),ht(r.wrapper.ownerDocument,"mouseup",v)}(t,i,e,o)}(e,i,o,t):kt(t)==n.scroller&&bt(t):2==r?(i&&$r(e.doc,i),setTimeout((function(){return n.input.focus()}),20)):3==r&&(k?e.display.input.onContextMenu(t):ki(e)))}}function va(t,e,n){if("char"==n)return new kr(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new kr(te(e.line,0),se(t.doc,te(e.line+1,0)));var i=n(t,e);return new kr(i.from,i.to)}function ya(t,e,n,i){var r,o;if(e.touches)r=e.touches[0].clientX,o=e.touches[0].clientY;else try{r=e.clientX,o=e.clientY}catch(t){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&bt(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!vt(t,n))return Ct(e);o-=s.top-a.viewOffset;for(var l=0;l=r)return ft(t,n,t,Jt(t.doc,o),t.display.gutterSpecs[l].className,e),Ct(e)}}function ba(t,e){return ya(t,e,"gutterClick",!0)}function xa(t,e){wn(t.display,e)||function(t,e){return!!vt(t,"gutterContextMenu")&&ya(t,e,"gutterContextMenu",!1)}(t,e)||mt(t,e,"contextmenu")||k||t.display.input.onContextMenu(e)}function Ca(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fn(t)}ma.prototype.compare=function(t,e,n){return this.time+400>t&&0==ee(e,this.pos)&&n==this.button};var wa={toString:function(){return"CodeMirror.Init"}},ka={},Sa={};function Ea(t,e,n){if(!e!=!(n&&n!=wa)){var i=t.display.dragFunctions,r=e?ht:pt;r(t.display.scroller,"dragstart",i.start),r(t.display.scroller,"dragenter",i.enter),r(t.display.scroller,"dragover",i.over),r(t.display.scroller,"dragleave",i.leave),r(t.display.scroller,"drop",i.drop)}}function Ta(t){t.options.lineWrapping?(P(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(T(t.display.wrapper,"CodeMirror-wrap"),Ue(t)),li(t),hi(t),Fn(t),setTimeout((function(){return Hi(t)}),100)}function Oa(t,e){var n=this;if(!(this instanceof Oa))return new Oa(t,e);this.options=e=e?B(e):{},B(ka,e,!1);var i=e.value;"string"==typeof i?i=new _o(i,e.mode,null,e.lineSeparator,e.direction):e.mode&&(i.modeOption=e.mode),this.doc=i;var r=new Oa.inputStyles[e.inputStyle](this),o=this.display=new gr(t,i,r,e);for(var c in o.wrapper.CodeMirror=this,Ca(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new z,keySeq:null,specialChars:null},e.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(t){var e=t.display;ht(e.scroller,"mousedown",tr(t,ga)),ht(e.scroller,"dblclick",a&&s<11?tr(t,(function(e){if(!mt(t,e)){var n=ci(t,e);if(n&&!ba(t,e)&&!wn(t.display,e)){bt(e);var i=t.findWordAt(n);$r(t.doc,i.anchor,i.head)}}})):function(e){return mt(t,e)||bt(e)}),ht(e.scroller,"contextmenu",(function(e){return xa(t,e)})),ht(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||xa(t,n)}));var n,i={end:0};function r(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),(i=e.activeTouch).end=+new Date)}function o(t,e){if(null==e.left)return!0;var n=e.left-t.left,i=e.top-t.top;return n*n+i*i>400}ht(e.scroller,"touchstart",(function(r){if(!mt(t,r)&&!function(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}(r)&&!ba(t,r)){e.input.ensurePolled(),clearTimeout(n);var o=+new Date;e.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}})),ht(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ht(e.scroller,"touchend",(function(n){var i=e.activeTouch;if(i&&!wn(e,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var a,s=t.coordsChar(e.activeTouch,"page");a=!i.prev||o(i,i.prev)?new kr(s,s):!i.prev.prev||o(i,i.prev.prev)?t.findWordAt(s):new kr(te(s.line,0),se(t.doc,te(s.line+1,0))),t.setSelection(a.anchor,a.head),t.focus(),bt(n)}r()})),ht(e.scroller,"touchcancel",r),ht(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Ii(t,e.scroller.scrollTop),Bi(t,e.scroller.scrollLeft,!0),ft(t,"scroll",t))})),ht(e.scroller,"mousewheel",(function(e){return Cr(t,e)})),ht(e.scroller,"DOMMouseScroll",(function(e){return Cr(t,e)})),ht(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){mt(t,e)||wt(e)},over:function(e){mt(t,e)||(function(t,e){var n=ci(t,e);if(n){var i=document.createDocumentFragment();yi(t,n,i),t.display.dragCursor||(t.display.dragCursor=L("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),N(t.display.dragCursor,i)}}(t,e),wt(e))},start:function(e){return function(t,e){if(a&&(!t.state.draggingText||+new Date-Mo<100))wt(e);else if(!mt(t,e)&&!wn(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!d)){var n=L("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(t,e)},drop:tr(t,Po),leave:function(e){mt(t,e)||Do(t)}};var l=e.input.getField();ht(l,"keyup",(function(e){return ha.call(t,e)})),ht(l,"keydown",tr(t,ua)),ht(l,"keypress",tr(t,da)),ht(l,"focus",(function(e){return Si(t,e)})),ht(l,"blur",(function(e){return Ei(t,e)}))}(this),Bo(),qi(this),this.curOp.forceUpdate=!0,Ir(this,i),e.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Si(n)}),20):Ei(this),Sa)Sa.hasOwnProperty(c)&&Sa[c](this,e[c],wa);dr(this),e.finishInit&&e.finishInit(this);for(var u=0;u150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?j(qt(o,e-1).text,null,a):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",d=0;if(t.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,h+="\t";if(da,l=_t(e),c=null;if(s&&i.ranges.length>1)if(Aa&&Aa.text.join("\n")==e){if(i.ranges.length%Aa.text.length==0){c=[];for(var u=0;u=0;d--){var p=i.ranges[d],f=p.from(),m=p.to();p.empty()&&(n&&n>0?f=te(f.line,f.ch-n):t.state.overwrite&&!s?m=te(m.line,Math.min(qt(o,m.line).text.length,m.ch+$(l).length)):s&&Aa&&Aa.lineWise&&Aa.text.join("\n")==l.join("\n")&&(f=m=te(f.line,0)));var g={from:f,to:m,text:c?c[d%c.length]:l,origin:r||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};co(t.doc,g),ln(t,"inputRead",t,g)}e&&!s&&Da(t,e),_i(t),t.curOp.updateInput<2&&(t.curOp.updateInput=h),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Pa(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Qi(e,(function(){return Ma(e,n,0,null,"paste")})),!0}function Da(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=t.getModeAt(r.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=La(t,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(qt(t.doc,r.head.line).text.slice(0,r.head.ch))&&(a=La(t,r.head.line,"smart"));a&&ln(t,"electricInput",t,r.head.line)}}}function Ia(t){for(var e=[],n=[],i=0;i0?0:-1));a=isNaN(u)?null:new te(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(u>=55296&&u<56320?2:1))),-n)}else a=r?function(t,e,n,i){var r=ct(e,t.doc.direction);if(!r)return Qo(e,n,i);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=st(r,n.ch,n.sticky),a=r[o];if("ltr"==t.doc.direction&&a.level%2==0&&(i>0?a.to>n.ch:a.from=a.from&&d>=u.begin)){var p=h?"before":"after";return new te(n.line,d,p)}}var f=function(t,e,i){for(var o=function(t,e){return e?new te(n.line,l(t,1),"before"):new te(n.line,t,"after")};t>=0&&t0==(1!=a.level),c=s?i.begin:l(i.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==g||i>0&&g==e.text.length||!(m=f(i>0?0:r.length-1,i,c(g)))?null:m}(t.cm,s,e,n):Qo(s,e,n);if(null==a){if(o||(c=e.line+l)=t.first+t.size||(e=new te(c,e.ch,e.sticky),!(s=qt(t,c))))return!1;e=ta(r,t.cm,s,e.line,l)}else e=a;return!0}if("char"==i||"codepoint"==i)c();else if("column"==i)c(!0);else if("word"==i||"group"==i)for(var u=null,h="group"==i,d=t.cm&&t.cm.getHelper(e,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var f=s.text.charAt(e.ch)||"\n",m=tt(f,d)?"w":h&&"\n"==f?"n":!h||/\s/.test(f)?null:"p";if(!h||p||m||(m="s"),u&&u!=m){n<0&&(n=1,c(),e.sticky="after");break}if(m&&(u=m),n>0&&!c(!p))break}var g=oo(t,e,o,a,!0);return ne(o,g)&&(g.hitSide=!0),g}function za(t,e,n,i){var r,o,a=t.doc,s=e.left;if("page"==i){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*ii(t.display),3);r=(n>0?e.bottom:e.top)+n*c}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(;(o=Yn(t,s,r)).outside;){if(n<0?r<=0:r>=a.height){o.hitSide=!0;break}r+=5*n}return o}var Fa=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ha(t,e){var n=_n(t,e.line);if(!n||n.hidden)return null;var i=qt(t.doc,e.line),r=Ln(n,i,e.line),o=ct(i,t.doc.direction),a="left";o&&(a=st(o,e.ch)%2?"right":"left");var s=Rn(r.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Wa(t,e){return e&&(t.bad=!0),t}function Va(t,e,n){var i;if(e==t.display.lineDiv){if(!(i=t.display.lineDiv.childNodes[n]))return Wa(t.clipPos(te(t.display.viewTo-1)),!0);e=null,n=0}else for(i=e;;i=i.parentNode){if(!i||i==t.display.lineDiv)return null;if(i.parentNode&&i.parentNode==t.display.lineDiv)break}for(var r=0;r=e.display.viewTo||o.line=e.display.viewFrom&&Ha(e,r)||{node:l[0].measure.map[2],offset:0},u=o.linei.firstLine()&&(a=te(a.line-1,qt(i.doc,a.line-1).length)),s.ch==qt(i.doc,s.line).text.length&&s.liner.viewTo-1)return!1;a.line==r.viewFrom||0==(t=ui(i,a.line))?(e=Yt(r.view[0].line),n=r.view[0].node):(e=Yt(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,c,u=ui(i,s.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=Yt(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var h=i.doc.splitLines(function(t,e,n,i,r){var o="",a=!1,s=t.doc.lineSeparator(),l=!1;function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function u(t){t&&(c(),o+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void u(n);var o,d=e.getAttribute("cm-marker");if(d){var p=t.findMarks(te(i,0),te(r+1,0),(g=+d,function(t){return t.id==g}));return void(p.length&&(o=p[0].find(0))&&u(Kt(t.doc,o.from,o.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;f&&c();for(var m=0;m1&&d.length>1;)if($(h)==$(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),e++}for(var p=0,f=0,m=h[0],g=d[0],v=Math.min(m.length,g.length);pa.ch&&y.charCodeAt(y.length-f-1)==b.charCodeAt(b.length-f-1);)p--,f++;h[h.length-1]=y.slice(0,y.length-f).replace(/^\u200b+/,""),h[0]=h[0].slice(p).replace(/\u200b+$/,"");var C=te(e,p),w=te(l,d.length?$(d).length-f:0);return h.length>1||h[0]||ee(C,w)?(mo(i.doc,h,C,w,"+input"),!0):void 0},Fa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fa.prototype.reset=function(){this.forceCompositionEnd()},Fa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fa.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Fa.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Qi(this.cm,(function(){return hi(t.cm)}))},Fa.prototype.setUneditable=function(t){t.contentEditable="false"},Fa.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||tr(this.cm,Ma)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Fa.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Fa.prototype.onContextMenu=function(){},Fa.prototype.resetPosition=function(){},Fa.prototype.needsContentAttribute=!0;var Ua=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};Ua.prototype.init=function(t){var e=this,n=this,i=this.cm;this.createField(t);var r=this.textarea;function o(t){if(!mt(i,t)){if(i.somethingSelected())_a({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var e=Ia(i);_a({lineWise:!0,text:e.text}),"cut"==t.type?i.setSelections(e.ranges,null,W):(n.prevInput="",r.value=e.text.join("\n"),I(r))}"cut"==t.type&&(i.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),m&&(r.style.width="0px"),ht(r,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),ht(r,"paste",(function(t){mt(i,t)||Pa(t,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),ht(r,"cut",o),ht(r,"copy",o),ht(t.scroller,"paste",(function(e){if(!wn(t,e)&&!mt(i,e)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,r.dispatchEvent(o)}})),ht(t.lineSpace,"selectstart",(function(e){wn(t,e)||bt(e)})),ht(r,"compositionstart",(function(){var t=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:i.markText(t,i.getCursor("to"),{className:"CodeMirror-composing"})}})),ht(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Ua.prototype.createField=function(t){this.wrapper=Ba(),this.textarea=this.wrapper.firstChild},Ua.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},Ua.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=vi(t);if(t.options.moveInputWithCursor){var r=Kn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+a.top-o.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+a.left-o.left))}return i},Ua.prototype.showSelection=function(t){var e=this.cm.display;N(e.cursorDiv,t.cursors),N(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},Ua.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ua.prototype.getField=function(){return this.textarea},Ua.prototype.supportsTouch=function(){return!1},Ua.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||M()!=this.textarea))try{this.textarea.focus()}catch(t){}},Ua.prototype.blur=function(){this.textarea.blur()},Ua.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ua.prototype.receivedFocus=function(){this.slowPoll()},Ua.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},Ua.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0,e.polling.set(20,(function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}))},Ua.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||Mt(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(i.length,r.length);l1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Ua.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ua.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ua.prototype.onContextMenu=function(t){var e=this,n=e.cm,i=n.display,r=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=ci(n,t),c=i.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&tr(n,Qr)(n.doc,Er(o),W);var u,d=r.style.cssText,p=e.wrapper.style.cssText,f=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-f.top-5)+"px; left: "+(t.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),i.input.focus(),l&&window.scrollTo(null,u),i.input.reset(),n.somethingSelected()||(r.value=e.prevInput=" "),e.contextMenuPending=v,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),a&&s>=9&&g(),k){wt(t);var m=function(){pt(window,"mouseup",m),setTimeout(v,20)};ht(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=r.selectionStart){var t=n.somethingSelected(),o="​"+(t?r.value:"");r.value="⇚",r.value=o,e.prevInput=t?"":"​",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function v(){if(e.contextMenuPending==v&&(e.contextMenuPending=!1,e.wrapper.style.cssText=p,r.style.cssText=d,a&&s<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart)){(!a||a&&s<9)&&g();var t=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&"​"==e.prevInput?tr(n,so)(n):t++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},Ua.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},Ua.prototype.setUneditable=function(){},Ua.prototype.needsContentAttribute=!1,function(t){var e=t.optionHandlers;function n(n,i,r,o){t.defaults[n]=i,r&&(e[n]=o?function(t,e,n){n!=wa&&r(t,e,n)}:r)}t.defineOption=n,t.Init=wa,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,Ar(t)}),!0),n("indentUnit",2,Ar,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){_r(t),Fn(t),hi(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],i=t.doc.first;t.doc.iter((function(t){for(var r=0;;){var o=t.text.indexOf(e,r);if(-1==o)break;r=o+e.length,n.push(te(i,o))}i++}));for(var r=n.length-1;r>=0;r--)mo(t.doc,e,n[r],te(n[r].line,n[r].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=wa&&t.refresh()})),n("specialCharPlaceholder",Ze,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Ca(t),mr(t)}),!0),n("keyMap","default",(function(t,e,n){var i=Yo(e),r=n!=wa&&Yo(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ta,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=pr(e,t.options.lineNumbers),mr(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?ai(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return Hi(t)}),!0),n("scrollbarStyle","native",(function(t){Gi(t),Hi(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=pr(t.options.gutters,e),mr(t)}),!0),n("firstLineNumber",1,mr,!0),n("lineNumberFormatter",(function(t){return t}),mr,!0),n("showCursorWhenSelecting",!1,gi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Ei(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Ea),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gi,!0),n("singleCursorHeightPerLine",!0,gi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,_r,!0),n("addModeClass",!1,_r,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,_r,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}(Oa),function(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){window.focus(),this.display.input.focus()},setOption:function(t,n){var i=this.options,r=i[t];i[t]==n&&"mode"!=t||(i[t]=n,e.hasOwnProperty(t)&&tr(this,e[t])(this,n,r),ft(this,"optionChange",this,t))},getOption:function(t){return this.options[t]},getDoc:function(){return this.doc},addKeyMap:function(t,e){this.state.keyMaps[e?"push":"unshift"](Yo(t))},removeKeyMap:function(t){for(var e=this.state.keyMaps,n=0;nn&&(La(this,r.head.line,t,!0),n=r.head.line,i==this.doc.sel.primIndex&&_i(this));else{var o=r.from(),a=r.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Yr(this.doc,i,new kr(o,c[i].to()),W)}}})),getTokenAt:function(t,e){return ye(this,t,e)},getLineTokens:function(t,e){return ye(this,te(t),e,!0)},getTokenTypeAt:function(t){t=se(this.doc,t);var e,n=de(this,qt(this.doc,t.line)),i=0,r=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=i+r>>1;if((a?n[2*a-1]:0)>=o)r=a;else{if(!(n[2*a+1]o&&(t=o,r=!0),i=qt(this.doc,t)}else i=t;return Gn(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-Ve(i):0)},defaultTextHeight:function(){return ii(this.display)},defaultCharWidth:function(){return ri(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var o,a,s,l=this.display,c=(t=Kn(this,se(this.doc,t))).bottom,u=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),l.sizer.appendChild(e),"over"==i)c=t.top;else if("above"==i||"near"==i){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>h)&&t.top>e.offsetHeight?c=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=h&&(c=t.bottom),u+e.offsetWidth>d&&(u=d-e.offsetWidth)}e.style.top=c+"px",e.style.left=e.style.right="","right"==r?(u=l.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?u=0:"middle"==r&&(u=(l.sizer.clientWidth-e.offsetWidth)/2),e.style.left=u+"px"),n&&(o=this,a={left:u,top:c,right:u+e.offsetWidth,bottom:c+e.offsetHeight},null!=(s=Li(o,a)).scrollTop&&Ii(o,s.scrollTop),null!=s.scrollLeft&&Bi(o,s.scrollLeft))},triggerOnKeyDown:er(ua),triggerOnKeyPress:er(da),triggerOnKeyUp:ha,triggerOnMouseDown:er(ga),execCommand:function(t){if(ea.hasOwnProperty(t))return ea[t].call(null,this)},triggerElectric:er((function(t){Da(this,t)})),findPosH:function(t,e,n,i){var r=1;e<0&&(r=-1,e=-e);for(var o=se(this.doc,t),a=0;a0&&a(e.charAt(n-1));)--n;for(;i.5||this.options.lineWrapping)&&li(this),ft(this,"refresh",this)})),swapDoc:er((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),Ir(this,t),Fn(this),this.display.input.reset(),Mi(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},yt(t),t.registerHelper=function(e,i,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][i]=r},t.registerGlobalHelper=function(e,i,r,o){t.registerHelper(e,i,o),n[e]._global.push({pred:r,val:o})}}(Oa);var qa="iter insert remove copy getEditor constructor".split(" ");for(var Ka in _o.prototype)_o.prototype.hasOwnProperty(Ka)&&F(qa,Ka)<0&&(Oa.prototype[Ka]=function(t){return function(){return t.apply(this.doc,arguments)}}(_o.prototype[Ka]));return yt(_o),Oa.inputStyles={textarea:Ua,contenteditable:Fa},Oa.defineMode=function(t){Oa.defaults.mode||"null"==t||(Oa.defaults.mode=t),Bt.apply(this,arguments)},Oa.defineMIME=function(t,e){Rt[t]=e},Oa.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Oa.defineMIME("text/plain","null"),Oa.defineExtension=function(t,e){Oa.prototype[t]=e},Oa.defineDocExtension=function(t,e){_o.prototype[t]=e},Oa.fromTextArea=function(t,e){if((e=e?B(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=M();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function i(){t.value=s.getValue()}var r;if(t.form&&(ht(t.form,"submit",i),!e.leaveSubmitMethodAlone)){var o=t.form;r=o.submit;try{var a=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=a}}catch(t){}}e.finishInit=function(n){n.save=i,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,i(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(pt(t.form,"submit",i),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=r))}},t.style.display="none";var s=Oa((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s},function(t){t.off=pt,t.on=ht,t.wheelEventPixels=xr,t.Doc=_o,t.splitLines=_t,t.countColumn=j,t.findColumn=U,t.isWordChar=Q,t.Pass=H,t.signal=ft,t.Line=qe,t.changeEnd=Tr,t.scrollbarModel=Vi,t.Pos=te,t.cmpPos=ee,t.modes=It,t.mimeModes=Rt,t.resolveMode=jt,t.getMode=zt,t.modeExtensions=Ft,t.extendMode=Ht,t.copyState=Wt,t.startState=Gt,t.innerMode=Vt,t.commands=ea,t.keyMap=Vo,t.keyName=Xo,t.isModifierKey=Ko,t.lookupKey=qo,t.normalizeKeyMap=Uo,t.StringStream=Ut,t.SharedTextMarker=Oo,t.TextMarker=Eo,t.LineWidget=wo,t.e_preventDefault=bt,t.e_stopPropagation=xt,t.e_stop=wt,t.addClass=P,t.contains=_,t.rmClass=T,t.keyNames=zo}(Oa),Oa.version="5.58.2",Oa}()},Y1PL: /*!**********************************************************!*\ !*** ./node_modules/rc-textarea/es/index.js + 7 modules ***! \**********************************************************/ /*! exports provided: ResizableTextArea, default */ /*! all exports used */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.r(e),n.d(e,"ResizableTextArea",(function(){return P}));var i=n("wx14"),r=n("1OyB"),o=n("vuIU"),a=n("Ji7U"),s=n("LK+K"),l=n("q1tI"),c=n("VTBJ"),u=n("rePB"),h=n("Zm9Q"),d=(n("Kwbf"),n("c+Xe")),p=n("m+aA"),f=n("bdgK"),m=new Map;var g=new f.default((function(t){t.forEach((function(t){var e,n=t.target;null===(e=m.get(n))||void 0===e||e.forEach((function(t){return t(n)}))}))}));var v=function(t){Object(a.a)(n,t);var e=Object(s.a)(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(l.Component),y=l.createContext(null);function b(t){var e=t.children,n=t.disabled,i=l.useRef(null),r=l.useRef(null),o=l.useContext(y),a=l.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),s=l.isValidElement(e)&&Object(d.c)(e),u=s?e.ref:null,h=l.useMemo((function(){return Object(d.a)(u,i)}),[u,i]),f=l.useRef(t);f.current=t;var b=l.useCallback((function(t){var e=f.current,n=e.onResize,i=e.data,r=t.getBoundingClientRect(),s=r.width,l=r.height,u=t.offsetWidth,h=t.offsetHeight,d=Math.floor(s),p=Math.floor(l);if(a.current.width!==d||a.current.height!==p||a.current.offsetWidth!==u||a.current.offsetHeight!==h){var m={width:d,height:p,offsetWidth:u,offsetHeight:h};a.current=m;var g=u===Math.round(s)?s:u,v=h===Math.round(l)?l:h,y=Object(c.a)(Object(c.a)({},m),{},{offsetWidth:g,offsetHeight:v});null==o||o(y,t,i),n&&Promise.resolve().then((function(){n(y,t)}))}}),[]);return l.useEffect((function(){var t,e,o=Object(p.a)(i.current)||Object(p.a)(r.current);return o&&!n&&(t=o,e=b,m.has(t)||(m.set(t,new Set),g.observe(t)),m.get(t).add(e)),function(){return function(t,e){m.has(t)&&(m.get(t).delete(e),m.get(t).size||(g.unobserve(t),m.delete(t)))}(o,b)}}),[i.current,n]),l.createElement(v,{ref:r},s?l.cloneElement(e,{ref:h}):e)}function x(t){var e=t.children;return Object(h.a)(e).map((function(e,n){var r=(null==e?void 0:e.key)||"".concat("rc-observer-key","-").concat(n);return l.createElement(b,Object(i.a)({},t,{key:r}),e)}))}x.Collection=function(t){var e=t.children,n=t.onBatchResize,i=l.useRef(0),r=l.useRef([]),o=l.useContext(y),a=l.useCallback((function(t,e,a){i.current+=1;var s=i.current;r.current.push({size:t,element:e,data:a}),Promise.resolve().then((function(){s===i.current&&(null==n||n(r.current),r.current=[])})),null==o||o(t,e,a)}),[n,o]);return l.createElement(y.Provider,{value:a},e)};var C,w=x,k=n("bT9E"),S=n("TSYQ"),E=n.n(S),T="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",O=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={};function L(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.getAttribute("id")||t.getAttribute("data-reactid")||t.getAttribute("name");if(e&&N[n])return N[n];var i=window.getComputedStyle(t),r=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),o=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),a=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),s=O.map((function(t){return"".concat(t,":").concat(i.getPropertyValue(t))})).join(";"),l={sizingStyle:s,paddingSize:o,borderSize:a,boxSizing:r};return e&&n&&(N[n]=l),l}var A,_=n("Gytx"),M=n.n(_);!function(t){t[t.NONE=0]="NONE",t[t.RESIZING=1]="RESIZING",t[t.RESIZED=2]="RESIZED"}(A||(A={}));var P=function(t){Object(a.a)(n,t);var e=Object(s.a)(n);function n(t){var o;return Object(r.a)(this,n),(o=e.call(this,t)).nextFrameActionId=void 0,o.resizeFrameId=void 0,o.textArea=void 0,o.saveTextArea=function(t){o.textArea=t},o.handleResize=function(t){var e=o.state.resizeStatus,n=o.props,i=n.autoSize,r=n.onResize;e===A.NONE&&("function"==typeof r&&r(t),i&&o.resizeOnNextFrame())},o.resizeOnNextFrame=function(){cancelAnimationFrame(o.nextFrameActionId),o.nextFrameActionId=requestAnimationFrame(o.resizeTextarea)},o.resizeTextarea=function(){var t=o.props.autoSize;if(t&&o.textArea){var e=t.minRows,n=t.maxRows,i=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;C||((C=document.createElement("textarea")).setAttribute("tab-index","-1"),C.setAttribute("aria-hidden","true"),document.body.appendChild(C)),t.getAttribute("wrap")?C.setAttribute("wrap",t.getAttribute("wrap")):C.removeAttribute("wrap");var r=L(t,e),o=r.paddingSize,a=r.borderSize,s=r.boxSizing,l=r.sizingStyle;C.setAttribute("style","".concat(l,";").concat(T)),C.value=t.value||t.placeholder||"";var c,u=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER,d=C.scrollHeight;if("border-box"===s?d+=a:"content-box"===s&&(d-=o),null!==n||null!==i){C.value=" ";var p=C.scrollHeight-o;null!==n&&(u=p*n,"border-box"===s&&(u=u+o+a),d=Math.max(u,d)),null!==i&&(h=p*i,"border-box"===s&&(h=h+o+a),c=d>h?"":"hidden",d=Math.min(h,d))}return{height:d,minHeight:u,maxHeight:h,overflowY:c,resize:"none"}}(o.textArea,!1,e,n);o.setState({textareaStyles:i,resizeStatus:A.RESIZING},(function(){cancelAnimationFrame(o.resizeFrameId),o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:A.RESIZED},(function(){o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:A.NONE}),o.fixFirefoxAutoScroll()}))}))}))}))}},o.renderTextArea=function(){var t=o.props,e=t.prefixCls,n=void 0===e?"rc-textarea":e,r=t.autoSize,a=t.onResize,s=t.className,h=t.disabled,d=o.state,p=d.textareaStyles,f=d.resizeStatus,m=Object(k.a)(o.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),g=E()(n,s,Object(u.a)({},"".concat(n,"-disabled"),h));"value"in m&&(m.value=m.value||"");var v=Object(c.a)(Object(c.a)(Object(c.a)({},o.props.style),p),f===A.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return l.createElement(w,{onResize:o.handleResize,disabled:!(r||a)},l.createElement("textarea",Object(i.a)({},m,{className:g,style:v,ref:o.saveTextArea})))},o.state={textareaStyles:{},resizeStatus:A.NONE},o}return Object(o.a)(n,[{key:"componentDidUpdate",value:function(t){t.value===this.props.value&&M()(t.autoSize,this.props.autoSize)||this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var t=this.textArea.selectionStart,e=this.textArea.selectionEnd;this.textArea.setSelectionRange(t,e)}}catch(t){}}},{key:"render",value:function(){return this.renderTextArea()}}]),n}(l.Component),D=function(t){Object(a.a)(n,t);var e=Object(s.a)(n);function n(t){var i;Object(r.a)(this,n),(i=e.call(this,t)).resizableTextArea=void 0,i.focus=function(){i.resizableTextArea.textArea.focus()},i.saveTextArea=function(t){i.resizableTextArea=t},i.handleChange=function(t){var e=i.props.onChange;i.setValue(t.target.value,(function(){i.resizableTextArea.resizeTextarea()})),e&&e(t)},i.handleKeyDown=function(t){var e=i.props,n=e.onPressEnter,r=e.onKeyDown;13===t.keyCode&&n&&n(t),r&&r(t)};var o=void 0===t.value||null===t.value?t.defaultValue:t.value;return i.state={value:o},i}return Object(o.a)(n,[{key:"setValue",value:function(t,e){"value"in this.props||this.setState({value:t},e)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return l.createElement(P,Object(i.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(t){return"value"in t?{value:t.value}:null}}]),n}(l.Component);e.default=D},ZW9T: /*!************************************************************!*\ !*** ./src/components/monaco-editor/index.jsx + 1 modules ***! \************************************************************/ /*! exports provided: getLanguageByMirrorName, default, DiffEditor */ /*! exports used: DiffEditor, default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var i=n("k1fw"),r=(n("miYZ"),n("tsqr")),o=n("rAM+"),a=n("tJVT"),s=n("PpiC"),l=n("q1tI"),c=n.n(l),u=n("bdgK");function h(t,e,n,r,o){var a=e.getWordUntilPosition(n),s={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:a.startColumn,endColumn:a.endColumn},l=r.map((function(e){return{label:e,kind:t.languages.CompletionItemKind.Keyword,insertText:e,insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}}));return o.map((function(t){l.push(Object(i.a)(Object(i.a)({},t),{},{range:s}))})),l}n("LvDl");function d(t){return/^\d+$/.test(t)?"".concat(t,"px"):t}function p(){}var f={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t;if(Array.isArray(t)){for(var n=0;n0||i.target.offsetWidth>0)&&U.current.instance.layout()}}catch(t){n.e(t)}finally{n.f()}}))).observe(G.current),t}();return Z(!0),function(){var t=U.current.instance;t.dispose();var e=t.getModel();e&&e.dispose(),U.current.subscription&&U.current.subscription.dispose(),I&&window.removeEventListener("paste",tt),n.unobserve(G.current)}}catch(t){}}))}),[]),Object(l.useEffect)((function(){if(U.current.instance&&J)return document.addEventListener("keydown",et,!1),function(){document.removeEventListener("keydown",et)}}),[_,J]),Object(l.useEffect)((function(){var t=U.current.instance;if(t&&J){var e=m(C);g.editor.setModelLanguage(t.getModel(),e),console.log("language:",C,t.getModel(),e)}}),[C,J]),Object(l.useEffect)((function(){U.current.instance&&J&&g.editor.setTheme(L)}),[L,J]),Object(l.useEffect)((function(){var t=U.current.instance;t&&J&&(t.updateOptions(Object(i.a)({},E)),setTimeout((function(){t.getModel().updateOptions(Object(i.a)({},E))}),200))}),[JSON.stringify(E),J]),Object(l.useEffect)((function(){var t=U.current.instance;t&&J&&t.layout()}),[f,y,J]);var rt=Object(l.useState)(d(f)),ot=Object(a.a)(rt,2),at=ot[0],st=(ot[1],Object(l.useState)(d(y))),lt=Object(a.a)(st,2),ct=lt[0],ut=lt[1],ht=Object(i.a)(Object(i.a)({},k),{},{width:at,height:ct});return c.a.createElement("div",{className:"my-monaco-editor",ref:G,style:ht})};function v(t){var e=t.width,r=void 0===e?"100%":e,s=t.height,h=void 0===s?"100%":s,p=t.original,f=t.modified,m=t.language,v=t.options,y=void 0===v?{}:v,b=Object(l.useRef)(),x=Object(l.useState)(null),C=Object(a.a)(x,2),w=C[0],k=C[1];Object(l.useEffect)((function(){b.current&&n.e(/*! import() | monaco-editor */27).then(n.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(t){var e=(g=t).editor.createDiffEditor(b.current,Object(i.a)(Object(i.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},y),{},{wordWrap:!0}));k(e);var n=function(t){var e;return b.current&&(e=new u.default((function(e){var n,i=Object(o.a)(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&t.layout()}}catch(t){i.e(t)}finally{i.f()}}))).observe(b.current),e}(e);return function(){e.dispose();var t=e.getModel();t&&t.dispose(),n.unobserve(b.current)}}))}),[]),Object(l.useEffect)((function(){w&&w.setModel({original:g.editor.createModel(p,m),modified:g.editor.createModel(f,m)})}),[p,f,m,w]);var S={width:d(r),height:d(h)};return c.a.createElement("div",{className:"my-diff-editor",ref:b,style:S})}},ZpRC: /*!*************************************************************************!*\ !*** ./node_modules/scroll-into-view-if-needed/es/index.js + 1 modules ***! \*************************************************************************/ /*! exports provided: default */ /*! exports used: default */function(t,e,n){"use strict";function i(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function r(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function o(t,e){if(t.clientHeighte||o>t&&a=e&&s>=n?o-t-i:a>e&&sn?a-e+r:0}var s=function(t,e){var n=window,r=e.scrollMode,s=e.block,l=e.inline,c=e.boundary,u=e.skipOverflowHiddenElements,h="function"==typeof c?c:function(t){return t!==c};if(!i(t))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,p=[],f=t;i(f)&&h(f);){if((f=f.parentElement)===d){p.push(f);break}null!=f&&f===document.body&&o(f)&&!o(document.documentElement)||null!=f&&o(f,u)&&p.push(f)}for(var m=n.visualViewport?n.visualViewport.width:innerWidth,g=n.visualViewport?n.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,b=t.getBoundingClientRect(),x=b.height,C=b.width,w=b.top,k=b.right,S=b.bottom,E=b.left,T="start"===s||"nearest"===s?w:"end"===s?S:w+x/2,O="center"===l?E+C/2:"end"===l?k:E,N=[],L=0;L=0&&E>=0&&S<=g&&k<=m&&w>=D&&S<=R&&E>=B&&k<=I)return N;var j=getComputedStyle(A),z=parseInt(j.borderLeftWidth,10),F=parseInt(j.borderTopWidth,10),H=parseInt(j.borderRightWidth,10),W=parseInt(j.borderBottomWidth,10),V=0,G=0,U="offsetWidth"in A?A.offsetWidth-A.clientWidth-z-H:0,q="offsetHeight"in A?A.offsetHeight-A.clientHeight-F-W:0;if(d===A)V="start"===s?T:"end"===s?T-g:"nearest"===s?a(y,y+g,g,F,W,y+T,y+T+x,x):T-g/2,G="start"===l?O:"center"===l?O-m/2:"end"===l?O-m:a(v,v+m,m,z,H,v+O,v+O+C,C),V=Math.max(0,V+y),G=Math.max(0,G+v);else{V="start"===s?T-D-F:"end"===s?T-R+W+q:"nearest"===s?a(D,R,M,F,W+q,T,T+x,x):T-(D+M/2)+q/2,G="start"===l?O-B-z:"center"===l?O-(B+P/2)+U/2:"end"===l?O-I+H+U:a(B,I,P,z,H+U,O,O+C,C);var K=A.scrollLeft,$=A.scrollTop;T+=$-(V=Math.max(0,Math.min($+V,A.scrollHeight-M+q))),O+=K-(G=Math.max(0,Math.min(K+G,A.scrollWidth-P+U)))}N.push({el:A,top:V,left:G})}return N};function l(t){return t===Object(t)&&0!==Object.keys(t).length}e.a=function(t,e){var n=!t.ownerDocument.documentElement.contains(t);if(l(e)&&"function"==typeof e.behavior)return e.behavior(n?[]:s(t,e));if(!n){var i=function(t){return!1===t?{block:"end",inline:"nearest"}:l(t)?t:{block:"start",inline:"nearest"}}(e);return function(t,e){void 0===e&&(e="auto");var n="scrollBehavior"in document.body.style;t.forEach((function(t){var i=t.el,r=t.top,o=t.left;i.scroll&&n?i.scroll({top:r,left:o,behavior:e}):(i.scrollTop=r,i.scrollLeft=o)}))}(s(t,i),i.behavior)}}},aRTE: /*!*****************************************************!*\ !*** ./node_modules/qr.js/lib/ErrorCorrectLevel.js ***! \*****************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){t.exports={L:1,M:0,Q:3,H:2}},bT9E: /*!*****************************************!*\ !*** ./node_modules/rc-util/es/omit.js ***! \*****************************************/ /*! exports provided: default */ /*! exports used: default */function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ");function r(t,e){var n=Object(i.a)({},t);return Array.isArray(e)&&e.forEach((function(t){delete n[t]})),n}},c5Ni: /*!******************************************************!*\ !*** ./node_modules/codemirror/theme/blackboard.css ***! \******************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},dQei: /*!****************************************!*\ !*** ./node_modules/qr.js/lib/math.js ***! \****************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){for(var n={glog:function(t){if(t<1)throw new Error("glog("+t+")");return n.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return n.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},i=0;i<8;i++)n.EXP_TABLE[i]=1<1?s-1:0),c=1;c1?n-1:0),o=1;o=0)return parseInt(e.slice(e.indexOf("e-")+2),10);var n=0;return e.indexOf(".")>=0&&(n=e.length-e.indexOf(".")-1),n},i.getInputDisplayValue=function(t){var e,n=t||i.state,r=n.focused,o=n.inputValue,a=n.value;null==(e=r?o:i.toPrecisionAsStep(a))&&(e="");var s=i.formatWrapper(e);return C(i.props.decimalSeparator)&&(s=s.toString().replace(".",i.props.decimalSeparator)),s},i.recordCursorPosition=function(){try{i.cursorStart=i.input.selectionStart,i.cursorEnd=i.input.selectionEnd,i.currentValue=i.input.value,i.cursorBefore=i.input.value.substring(0,i.cursorStart),i.cursorAfter=i.input.value.substring(i.cursorEnd)}catch(t){}},i.restoreByAfter=function(t){if(void 0===t)return!1;var e=i.input.value,n=e.lastIndexOf(t);if(-1===n)return!1;var r=i.cursorBefore.length;return i.lastKeyCode===f.a.DELETE&&i.cursorBefore.charAt(r-1)===t[0]?(i.fixCaret(r,r),!0):n+t.length===e.length&&(i.fixCaret(n,n),!0)},i.partRestoreByAfter=function(t){return void 0!==t&&Array.prototype.some.call(t,(function(e,n){var r=t.substring(n);return i.restoreByAfter(r)}))},i.isNotCompleteNumber=function(t){return isNaN(t)||""===t||null===t||t&&t.toString().indexOf(".")===t.toString().length-1},i.stop=function(){i.autoStepTimer&&clearTimeout(i.autoStepTimer)},i.down=function(t,e,n){i.pressingUpOrDown=!0,i.step("down",t,e,n)},i.up=function(t,e,n){i.pressingUpOrDown=!0,i.step("up",t,e,n)},i.saveInput=function(t){i.input=t};var r=t.value;void 0===r&&(r=t.defaultValue),i.state={focused:t.autoFocus};var a=i.getValidValue(i.toNumber(r));return i.state=g(g({},i.state),{},{inputValue:i.toPrecisionAsStep(a),value:a}),i}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.value,i=e.onChange,r=e.max,o=e.min,a=this.state.focused;if(t){if(!w(t.value,n)||!w(t.max,r)||!w(t.min,o)){var s,l=a?n:this.getValidValue(n);s=this.pressingUpOrDown?l:this.inputting?this.rawInput:this.toPrecisionAsStep(l),this.setState({value:l,inputValue:s})}var c="value"in this.props?n:this.state.value;"max"in this.props&&t.max!==r&&"number"==typeof c&&c>r&&i&&i(r),"min"in this.props&&t.min!==o&&"number"==typeof c&&c1&&void 0!==arguments[1]?arguments[1]:this.props.min,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props.max,i=parseFloat(t);return isNaN(i)?t:(in&&(i=n),i)}},{key:"setValue",value:function(t,e){var n=this.props.precision,i=this.isNotCompleteNumber(parseFloat(t))?null:parseFloat(t),r=this.state.value,o=void 0===r?null:r,a=this.state.inputValue,s=void 0===a?null:a,l="number"==typeof i?i.toFixed(n):"".concat(i),c=i!==o||l!=="".concat(s);return"value"in this.props?(s=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:s},e)):this.setState({value:i,inputValue:this.toPrecisionAsStep(t)},e),c&&this.props.onChange(i),i}},{key:"getMaxPrecision",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.props,i=n.precision,r=n.step;if(C(i))return i;var o=this.getPrecision(e),a=this.getPrecision(r),s=this.getPrecision(t);return t?Math.max(s,o+a):o+a}},{key:"getPrecisionFactor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.getMaxPrecision(t,e);return Math.pow(10,n)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(t){return this.props.formatter?this.props.formatter(t):t}},{key:"toPrecisionAsStep",value:function(t){if(this.isNotCompleteNumber(t)||""===t)return t;var e=Math.abs(this.getMaxPrecision(t));return isNaN(e)?t.toString():Number(t).toFixed(e)}},{key:"toNumber",value:function(t){var e=this.props.precision,n=this.state.focused,i=t&&t.length>16&&n;return this.isNotCompleteNumber(t)||i?t:C(e)?Math.round(t*Math.pow(10,e))/Math.pow(10,e):Number(t)}},{key:"upStep",value:function(t,e){var n=this.props.step,i=this.getPrecisionFactor(t,e),r=Math.abs(this.getMaxPrecision(t,e)),o=((i*t+i*n*e)/i).toFixed(r);return this.toNumber(o)}},{key:"downStep",value:function(t,e){var n=this.props.step,i=this.getPrecisionFactor(t,e),r=Math.abs(this.getMaxPrecision(t,e)),o=((i*t-i*n*e)/i).toFixed(r);return this.toNumber(o)}},{key:"step",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;this.stop(),e&&(e.persist(),e.preventDefault());var o=this.props;if(!o.disabled){var a=this.getCurrentValidValue(this.state.inputValue)||0;if(!this.isNotCompleteNumber(a)){var s=this["".concat(t,"Step")](a,i),l=s>o.max||so.max?s=o.max:s=f)||o||a,K=(F||0===F)&&(isNaN(F)||Number(F)<=m)||o||a,$=p()("".concat(n,"-handler"),"".concat(n,"-handler-up"),Object(r.a)({},"".concat(n,"-handler-up-disabled"),q)),X=p()("".concat(n,"-handler"),"".concat(n,"-handler-down"),Object(r.a)({},"".concat(n,"-handler-down-disabled"),K)),Y=s?{onTouchStart:q?y:this.up,onTouchEnd:this.stop}:{onMouseDown:q?y:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},J=s?{onTouchStart:K?y:this.down,onTouchEnd:this.stop}:{onMouseDown:K?y:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return h.a.createElement("div",{className:W,style:g,title:v,onMouseEnter:x,onMouseLeave:C,onMouseOver:w,onMouseOut:k,onFocus:function(){return null},onBlur:function(){return null}},h.a.createElement("div",{className:"".concat(n,"-handler-wrap")},h.a.createElement("span",Object.assign({unselectable:"on"},Y,{role:"button","aria-label":"Increase Value","aria-disabled":q,className:$}),c||h.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-up-inner"),onClick:b})),h.a.createElement("span",Object.assign({unselectable:"on"},J,{role:"button","aria-label":"Decrease Value","aria-disabled":K,className:X}),u||h.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-down-inner"),onClick:b}))),h.a.createElement("div",{className:"".concat(n,"-input-wrap")},h.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":m,"aria-valuemax":f,"aria-valuenow":F,required:S,type:O,placeholder:N,onPaste:R,onClick:E,onMouseUp:this.onMouseUp,className:"".concat(n,"-input"),tabIndex:T,autoComplete:l,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:G?this.onKeyDown:y,onKeyUp:G?this.onKeyUp:y,autoFocus:D,maxLength:P,readOnly:a,disabled:o,max:f,min:m,step:M,name:I,title:v,id:L,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(U),pattern:_,inputMode:A,onInput:B},V))))}}]),n}(h.a.Component);k.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:y,onKeyDown:y,onPressEnter:y,onFocus:y,onBlur:y,parser:function(t){return t.replace(/[^\w.-]+/g,"")},required:!1,autoComplete:"off"};var S=k;e.a=S},f4xo: /*!********************************************!*\ !*** ./node_modules/qr.js/lib/8BitByte.js ***! \********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var i=n(/*! ./mode */"nVVt");function r(t){this.mode=i.MODE_8BIT_BYTE,this.data=t}r.prototype={getLength:function(t){return this.data.length},write:function(t){for(var e=0;e` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function g(t,e,n){return e.f=e.inline=n,n(t,e)}function v(t,e,n){return e.f=e.block=n,n(t,e)}function y(e){if(e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==x){var n=r;if(!n){var o=t.innerMode(i,e.htmlState);n="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}n&&(e.f=S,e.block=b,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function b(i,r){var a,d=i.column()===r.indentation,m=!(a=r.prevLine.stream)||!/\S/.test(a.string),v=r.indentedCode,y=r.prevLine.hr,b=!1!==r.list,x=(r.listStack[r.listStack.length-1]||0)+3;r.indentedCode=!1;var k=r.indentation;if(null===r.indentationDiff&&(r.indentationDiff=r.indentation,b)){for(r.list=null;k=4&&(v||r.prevLine.fencedCodeEnd||r.prevLine.header||m))return i.skipToEnd(),r.indentedCode=!0,o.code;if(i.eatSpace())return null;if(d&&r.indentation<=x&&(T=i.match(u))&&T[1].length<=6)return r.quote=0,r.header=T[1].length,r.thisLine.header=!0,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,w(r);if(r.indentation<=x&&i.eat(">"))return r.quote=d?1:r.quote+1,n.highlightFormatting&&(r.formatting="quote"),i.eatSpace(),w(r);if(!E&&!r.setext&&d&&r.indentation<=x&&(T=i.match(l))){var O=T[1]?"ol":"ul";return r.indentation=k+i.current().length,r.list=!0,r.quote=0,r.listStack.push(r.indentation),r.em=!1,r.strong=!1,r.code=!1,r.strikethrough=!1,n.taskLists&&i.match(c,!1)&&(r.taskList=!0),r.f=r.inline,n.highlightFormatting&&(r.formatting=["list","list-"+O]),w(r)}return d&&r.indentation<=x&&(T=i.match(p,!0))?(r.quote=0,r.fencedEndRE=new RegExp(T[1]+"+ *$"),r.localMode=n.fencedCodeBlockHighlighting&&function(n){if(t.findModeByName){var i=t.findModeByName(n);i&&(n=i.mime||i.mimes[0])}var r=t.getMode(e,n);return"null"==r.name?null:r}(T[2]||n.fencedCodeBlockDefaultMode),r.localMode&&(r.localState=t.startState(r.localMode)),r.f=r.block=C,n.highlightFormatting&&(r.formatting="code-block"),r.code=-1,w(r)):r.setext||!(S&&b||r.quote||!1!==r.list||r.code||E||f.test(i.string))&&(T=i.lookAhead(1))&&(T=T.match(h))?(r.setext?(r.header=r.setext,r.setext=0,i.skipToEnd(),n.highlightFormatting&&(r.formatting="header")):(r.header="="==T[0].charAt(0)?1:2,r.setext=r.header),r.thisLine.header=!0,r.f=r.inline,w(r)):E?(i.skipToEnd(),r.hr=!0,r.thisLine.hr=!0,o.hr):"["===i.peek()?g(i,r,N):g(i,r,r.inline)}function x(e,n){var o=i.token(e,n.htmlState);if(!r){var a=t.innerMode(i,n.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||n.md_inside&&e.current().indexOf(">")>-1)&&(n.f=S,n.block=b,n.htmlState=null)}return o}function C(t,e){var i,r=e.listStack[e.listStack.length-1]||0,a=e.indentation=t.quote?e.push(o.formatting+"-"+t.formatting[i]+"-"+t.quote):e.push("error"))}if(t.taskOpen)return e.push("meta"),e.length?e.join(" "):null;if(t.taskClosed)return e.push("property"),e.length?e.join(" "):null;if(t.linkHref?e.push(o.linkHref,"url"):(t.strong&&e.push(o.strong),t.em&&e.push(o.em),t.strikethrough&&e.push(o.strikethrough),t.emoji&&e.push(o.emoji),t.linkText&&e.push(o.linkText),t.code&&e.push(o.code),t.image&&e.push(o.image),t.imageAltText&&e.push(o.imageAltText,"link"),t.imageMarker&&e.push(o.imageMarker)),t.header&&e.push(o.header,o.header+"-"+t.header),t.quote&&(e.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=t.quote?e.push(o.quote+"-"+t.quote):e.push(o.quote+"-"+n.maxBlockquoteDepth)),!1!==t.list){var r=(t.listStack.length-1)%3;r?1===r?e.push(o.list2):e.push(o.list3):e.push(o.list1)}return t.trailingSpaceNewLine?e.push("trailing-space-new-line"):t.trailingSpace&&e.push("trailing-space-"+(t.trailingSpace%2?"a":"b")),e.length?e.join(" "):null}function k(t,e){if(t.match(d,!0))return w(e)}function S(e,r){var a=r.text(e,r);if(void 0!==a)return a;if(r.list)return r.list=null,w(r);if(r.taskList)return" "===e.match(c,!0)[1]?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,w(r);if(r.taskOpen=!1,r.taskClosed=!1,r.header&&e.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),w(r);var s=e.next();if(r.linkTitle){r.linkTitle=!1;var l=s;"("===s&&(l=")");var u="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(e.match(new RegExp(u),!0))return o.linkHref}if("`"===s){var h=r.formatting;n.highlightFormatting&&(r.formatting="code"),e.eatWhile("`");var d=e.current().length;if(0!=r.code||r.quote&&1!=d){if(d==r.code){var p=w(r);return r.code=0,p}return r.formatting=h,w(r)}return r.code=d,w(r)}if(r.code)return w(r);if("\\"===s&&(e.next(),n.highlightFormatting)){var f=w(r),g=o.formatting+"-escape";return f?f+" "+g:g}if("!"===s&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),w(r);if("["===s&&r.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),w(r);if("]"===s&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");var f=w(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=T,f}if("["===s&&!r.image)return r.linkText&&e.match(/^.*?\]/)||(r.linkText=!0,n.highlightFormatting&&(r.formatting="link")),w(r);if("]"===s&&r.linkText){n.highlightFormatting&&(r.formatting="link");var f=w(r);return r.linkText=!1,r.inline=r.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?T:S,f}if("<"===s&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=E,n.highlightFormatting&&(r.formatting="link"),(f=w(r))?f+=" ":f="",f+o.linkInline;if("<"===s&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=E,n.highlightFormatting&&(r.formatting="link"),(f=w(r))?f+=" ":f="",f+o.linkEmail;if(n.xml&&"<"===s&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var y=e.string.indexOf(">",e.pos);if(-1!=y){var b=e.string.substring(e.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(r.md_inside=!0)}return e.backUp(1),r.htmlState=t.startState(i),v(e,r,x)}if(n.xml&&"<"===s&&e.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===s||"_"===s){for(var C=1,k=1==e.pos?" ":e.string.charAt(e.pos-2);C<3&&e.eat(s);)C++;var O=e.peek()||" ",N=!/\s/.test(O)&&(!m.test(O)||/\s/.test(k)||m.test(k)),L=!/\s/.test(k)&&(!m.test(k)||/\s/.test(O)||m.test(O)),A=null,_=null;if(C%2&&(r.em||!N||"*"!==s&&L&&!m.test(k)?r.em!=s||!L||"*"!==s&&N&&!m.test(O)||(A=!1):A=!0),C>1&&(r.strong||!N||"*"!==s&&L&&!m.test(k)?r.strong!=s||!L||"*"!==s&&N&&!m.test(O)||(_=!1):_=!0),null!=_||null!=A)return n.highlightFormatting&&(r.formatting=null==A?"strong":null==_?"em":"strong em"),!0===A&&(r.em=s),!0===_&&(r.strong=s),p=w(r),!1===A&&(r.em=!1),!1===_&&(r.strong=!1),p}else if(" "===s&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return w(r);e.backUp(1)}if(n.strikethrough)if("~"===s&&e.eatWhile(s)){if(r.strikethrough)return n.highlightFormatting&&(r.formatting="strikethrough"),p=w(r),r.strikethrough=!1,p;if(e.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),w(r)}else if(" "===s&&e.match(/^~~/,!0)){if(" "===e.peek())return w(r);e.backUp(2)}if(n.emoji&&":"===s&&e.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){r.emoji=!0,n.highlightFormatting&&(r.formatting="emoji");var M=w(r);return r.emoji=!1,M}return" "===s&&(e.match(/^ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),w(r)}function E(t,e){if(">"===t.next()){e.f=e.inline=S,n.highlightFormatting&&(e.formatting="link");var i=w(e);return i?i+=" ":i="",i+o.linkInline}return t.match(/^[^>]+/,!0),o.linkInline}function T(t,e){if(t.eatSpace())return null;var i,r=t.next();return"("===r||"["===r?(e.f=e.inline=(i="("===r?")":"]",function(t,e){if(t.next()===i){e.f=e.inline=S,n.highlightFormatting&&(e.formatting="link-string");var r=w(e);return e.linkHref=!1,r}return t.match(O[i]),e.linkHref=!0,w(e)}),n.highlightFormatting&&(e.formatting="link-string"),e.linkHref=!0,w(e)):"error"}var O={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function N(t,e){return t.match(/^([^\]\\]|\\.)*\]:/,!1)?(e.f=L,t.next(),n.highlightFormatting&&(e.formatting="link"),e.linkText=!0,w(e)):g(t,e,S)}function L(t,e){if(t.match(/^\]:/,!0)){e.f=e.inline=A,n.highlightFormatting&&(e.formatting="link");var i=w(e);return e.linkText=!1,i}return t.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function A(t,e){return t.eatSpace()?null:(t.match(/^[^\s]+/,!0),void 0===t.peek()?e.linkTitle=!0:t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),e.f=e.inline=S,o.linkHref+" url")}var _={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:S,text:k,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&t.copyState(i,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?t.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,linkHref:e.linkHref,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(t,e){if(e.formatting=!1,t!=e.thisLine.stream){if(e.header=0,e.hr=!1,t.match(/^\s*$/,!0))return y(e),null;if(e.prevLine=e.thisLine,e.thisLine={stream:t},e.taskList=!1,e.trailingSpace=0,e.trailingSpaceNewLine=!1,!e.localState&&(e.f=e.block,e.f!=x)){var n=t.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(e.indentation=n,e.indentationDiff=null,n>0)return null}}return e.f(t,e)},innerMode:function(t){return t.block==x?{state:t.htmlState,mode:i}:t.localState?{state:t.localState,mode:t.localMode}:{state:t,mode:_}},indent:function(e,n,r){return e.block==x&&i.indent?i.indent(e.htmlState,n,r):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,n,r):t.Pass},blankLine:y,getType:w,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return _}),"xml"),t.defineMIME("text/markdown","markdown"),t.defineMIME("text/x-markdown","markdown")}(n(/*! ../../lib/codemirror */"VrN/"),n(/*! ../xml/xml */"1eCo"),n(/*! ../meta */"8EBN"))},nVVt: /*!****************************************!*\ !*** ./node_modules/qr.js/lib/mode.js ***! \****************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){t.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}},osHv: /*!********************************************************!*\ !*** ./node_modules/codemirror/addon/fold/xml-fold.js ***! \********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){!function(t){"use strict";var e=t.Pos;function n(t,e){return t.line-e.line||t.ch-e.ch}var i="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r=new RegExp("<(/?)(["+i+"]["+i+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(t,e,n,i){this.line=e,this.ch=n,this.cm=t,this.text=t.getLine(e),this.min=i?Math.max(i.from,t.firstLine()):t.firstLine(),this.max=i?Math.min(i.to-1,t.lastLine()):t.lastLine()}function a(t,n){var i=t.cm.getTokenTypeAt(e(t.line,n));return i&&/\btag\b/.test(i)}function s(t){if(!(t.line>=t.max))return t.ch=0,t.text=t.cm.getLine(++t.line),!0}function l(t){if(!(t.line<=t.min))return t.text=t.cm.getLine(--t.line),t.ch=t.text.length,!0}function c(t){for(;;){var e=t.text.indexOf(">",t.ch);if(-1==e){if(s(t))continue;return}if(a(t,e+1)){var n=t.text.lastIndexOf("/",e),i=n>-1&&!/\S/.test(t.text.slice(n+1,e));return t.ch=e+1,i?"selfClose":"regular"}t.ch=e+1}}function u(t){for(;;){var e=t.ch?t.text.lastIndexOf("<",t.ch-1):-1;if(-1==e){if(l(t))continue;return}if(a(t,e+1)){r.lastIndex=e,t.ch=e;var n=r.exec(t.text);if(n&&n.index==e)return n}else t.ch=e}}function h(t){for(;;){r.lastIndex=t.ch;var e=r.exec(t.text);if(!e){if(s(t))continue;return}if(a(t,e.index+1))return t.ch=e.index+e[0].length,e;t.ch=e.index+1}}function d(t){for(;;){var e=t.ch?t.text.lastIndexOf(">",t.ch-1):-1;if(-1==e){if(l(t))continue;return}if(a(t,e+1)){var n=t.text.lastIndexOf("/",e),i=n>-1&&!/\S/.test(t.text.slice(n+1,e));return t.ch=e+1,i?"selfClose":"regular"}t.ch=e}}function p(t,n){for(var i=[];;){var r,o=h(t),a=t.line,s=t.ch-(o?o[0].length:0);if(!o||!(r=c(t)))return;if("selfClose"!=r)if(o[1]){for(var l=i.length-1;l>=0;--l)if(i[l]==o[2]){i.length=l;break}if(l<0&&(!n||n==o[2]))return{tag:o[2],from:e(a,s),to:e(t.line,t.ch)}}else i.push(o[2])}}function f(t,n){for(var i=[];;){var r=d(t);if(!r)return;if("selfClose"!=r){var o=t.line,a=t.ch,s=u(t);if(!s)return;if(s[1])i.push(s[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==s[2]){i.length=l;break}if(l<0&&(!n||n==s[2]))return{tag:s[2],from:e(t.line,t.ch),to:e(o,a)}}}else u(t)}}t.registerHelper("fold","xml",(function(t,i){for(var r=new o(t,i.line,0);;){var a=h(r);if(!a||r.line!=i.line)return;var s=c(r);if(!s)return;if(!a[1]&&"selfClose"!=s){var l=e(r.line,r.ch),u=p(r,a[2]);return u&&n(u.from,l)>0?{from:l,to:u.from}:null}}})),t.findMatchingTag=function(t,i,r){var a=new o(t,i.line,i.ch,r);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var s=c(a),l=s&&e(a.line,a.ch),h=s&&u(a);if(s&&h&&!(n(a,i)>0)){var d={from:e(a.line,a.ch),to:l,tag:h[2]};return"selfClose"==s?{open:d,close:null,at:"open"}:h[1]?{open:f(a,h[2]),close:d,at:"close"}:{open:d,close:p(a=new o(t,l.line,l.ch,r),h[2]),at:"open"}}}},t.findEnclosingTag=function(t,e,n,i){for(var r=new o(t,e.line,e.ch,n);;){var a=f(r,i);if(!a)break;var s=p(new o(t,e.line,e.ch,n),a.tag);if(s)return{open:a,close:s}}},t.scanForClosingTag=function(t,e,n,i){return p(new o(t,e.line,e.ch,i?{from:0,to:i}:null),n)}}(n(/*! ../../lib/codemirror */"VrN/"))},p5ED: /*!*********************************************!*\ !*** ./src/components/PreviewAll/index.tsx ***! \*********************************************/ /*! exports provided: default */ /*! exports used: default */function(t,e,n){"use strict";n(/*! antd/es/button/style */"+L6B");var i=n(/*! antd/es/button */"2/Rp"),r=(n(/*! antd/es/tooltip/style */"5Dmo"),n(/*! antd/es/tooltip */"3S7+")),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! ./index.less?modules */"vHTk"),u=n.n(c),h=n(/*! @ant-design/icons */"yEEn"),d=n(/*! @/components/monaco-editor */"ZW9T"),p=n(/*! @/utils/util */"1vsH");e.a=function(t){var e=t.name,n=t.data,c=(t.theme,t.type),f=t.filename,m=t.monacoEditor,g=t.className,v=t.style,y=t.close,b=t.onClose,x=t.hasMask,C=Object(s.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),w=Object(a.a)(C,2),k=(w[0],w[1],Object(s.useState)("")),S=Object(a.a)(k,2),E=(S[0],S[1]),T=Object(s.useRef)();f&&(m.filename=f),Object(s.useEffect)((function(){var t,e,n=null===(t=document.cookie)||void 0===t||null===(e=t.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==n||n.map((function(t){var e=t.split("=");"_educoder_session"===e[0]&&E(e[1])}))}),[]);var O=function(){n.startsWith("http")||n.startsWith("/")?N():Object(p.x)(f||"educoder",n,f)},N=function(){Object(p.v)(f||e,n)};return console.log("data:",n,"fileanme:",f," name:",e),l.a.createElement("div",{style:Object(o.a)({},v||{}),className:"".concat(x&&u.a.bgBlack," ").concat(c?u.a.wrp:"hide")},y&&l.a.createElement("div",{className:u.a.close,ref:T},l.a.createElement(r.a,{title:"点击下载此文件",getPopupContainer:function(){return T.current}},l.a.createElement("span",{onClick:N},l.a.createElement("i",{className:"icon-quxiaozhiding"}))),l.a.createElement(r.a,{title:"关闭",getPopupContainer:function(){return T.current}},l.a.createElement("span",{className:"",onClick:b},l.a.createElement("i",{className:"icon-guanbi1"})))),l.a.createElement("div",{className:"".concat(u.a[g]," ").concat(g," ").concat(u.a.monaco," ").concat("txt"===c?"show":"hide")},"txt"===c&&l.a.createElement(d.b,m)),"audio"===c&&l.a.createElement("audio",{src:"".concat(null!=n&&n.startsWith("/")||(null==n?void 0:n.indexOf("https://"))>-1?n:"data:audio/mp3;base64,").concat(n),autoPlay:!0}),"video"===c&&l.a.createElement(l.a.Fragment,null,null!=n&&n.startsWith("/")?l.a.createElement("video",{controls:!0,src:"".concat(n),autoPlay:!0}):l.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(n),autoPlay:!0})),"html"===c&&l.a.createElement("iframe",{src:n+"&disposition=inline"}),"pdf"===c&&l.a.createElement("embed",{className:u.a.embed,src:n}),"pdfeditor"===c&&l.a.createElement("div",null,l.a.createElement("iframe",{src:"https://a1office.co/solutions/editor/pdf-editor/查重文档1-8839d79b81e8bda0d298ca058913ab88.pdf"}),l.a.createElement("div",{style:{position:"absolute",left:"1px",top:"1px",width:180,height:60,background:"#f9f9f9"}})),"image"===c&&l.a.createElement(l.a.Fragment,null,l.a.createElement("img",{src:"".concat(null!=n&&n.startsWith("/")||(null==n?void 0:n.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(n)})),"other"===c&&l.a.createElement("div",null,l.a.createElement(i.a,{type:"primary",size:"large",onClick:O},l.a.createElement(h.a,null),"点击下载")),("download"===c||"office"===c)&&l.a.createElement(i.a,{type:"primary",size:"large",onClick:O},l.a.createElement(h.a,null),"点击下载"))}},"p77/": /*!****************************************************!*\ !*** ./node_modules/codemirror/lib/codemirror.css ***! \****************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},"rAM+": /*!*******************************************************************************************************************!*\ !*** ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js ***! \*******************************************************************************************************************/ /*! exports provided: default */ /*! exports used: default */function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(/*! @babel/runtime/helpers/esm/unsupportedIterableToArray */"Qw5x");function r(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=Object(i.a)(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}},rUJ1: /*!********************************************!*\ !*** ./node_modules/marked/src/helpers.js ***! \********************************************/ /*! no static exports found */ /*! exports used: escape */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){const n=/[&<>"']/,i=/[&<>"']/g,r=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},s=t=>a[t];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(t){return t.replace(l,(t,e)=>"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):"")}const u=/(^|[^\[])\^/g;const h=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const p={},f=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(t,e){p[" "+t]||(f.test(t)?p[" "+t]=t+"/":p[" "+t]=y(t,"/",!0));const n=-1===(t=p[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(m,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(g,"$1")+e:t+e}function y(t,e,n){const i=t.length;if(0===i)return"";let r=0;for(;r(i=(i=i.source||i).replace(u,"$1"),t=t.replace(e,i),n),getRegex:()=>new RegExp(t,e)};return n},cleanUrl:function(t,e,n){if(t){let t;try{t=decodeURIComponent(c(n)).replace(h,"").toLowerCase()}catch(t){return null}if(0===t.indexOf("javascript:")||0===t.indexOf("vbscript:")||0===t.indexOf("data:"))return null}e&&!d.test(n)&&(n=v(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n},resolveUrl:v,noopTest:{exec:function(){}},merge:function(t){let e,n,i=1;for(;i{let i=!1,r=e;for(;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"}).split(/ \|/);let i=0;if(n.length>e)n.splice(e);else for(;n.length0&&void 0!==i[0]?i[0]:0,console.log(B),t.next=4,Object(g.a)("/api/exercises/".concat(B.categoryId,"/preview_random_exercise.json"),{method:"get",params:{num:e}});case 4:n=t.sent,N(!1),R(F(n));case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),F=function(t){var e={1:"一",2:"二",3:"三",4:"四",5:"五",6:"六",7:"七"};if(t){var n=t||{},i=n.exam,o=n.single_questions,a=n.multiple_questions,s=n.judgement_questions,l=n.program_questions,c=n.completion_questions,u=n.subjective_questions,h=n.practical_questions,d=n.combination_questions,p=n.fileupload_questions,f=n.photograph_questions,m=[Object(r.a)({type:"SINGLE",name:"单选题"},o),Object(r.a)({type:"MULTIPLE",name:"多选题"},a),Object(r.a)({type:"COMPLETION",name:"填空题"},c),Object(r.a)({type:"JUDGMENT",name:"判断题"},s),Object(r.a)({type:"SUBJECTIVE",name:"简答题"},u),Object(r.a)({type:"PROGRAM",name:"编程题"},l),Object(r.a)({type:"SUBJECTIVE",name:"文件上传题"},p),Object(r.a)({type:"SUBJECTIVE",name:"拍照上传题"},f),Object(r.a)({type:"PRACTICAL",name:"实训题"},h),Object(r.a)({type:"COMBINATION",name:"接龙题"},d)],g=[],v=0,y=0,b=m.filter((function(t){return t.questions_count>0})).map((function(t,n){var i;return null===(i=t.questions)||void 0===i||i.forEach((function(t){g.push(t.id),v+=t.score,y+=1})),Object(r.a)(Object(r.a)({},t),{number:e[n+1]})}));return{all_questions_count:y,all_score:v,questionList:b,ids:g,exam:i}}},H=function(){var t=Object(o.a)(l.a.mark((function t(e,n){var i,o,a;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(g.a)("/api/exercises/".concat(B.categoryId,"/toggle_random_question.json"),{method:"post",body:{question_id:null==e?void 0:e.single_question_id,type:null==e?void 0:e.type}});case 2:null!=(i=t.sent)&&i.question&&((a=Object(v.cloneDeep)(I)).questionList=null==a||null===(o=a.questionList)||void 0===o?void 0:o.map((function(t){if(t.type===n.type){var e=Object(v.cloneDeep)(null==t?void 0:t.questions);return e.splice(n.index,1,null==i?void 0:i.question),Object(r.a)(Object(r.a)({},t),{},{questions:e})}return t})),R(a));case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),W=function(){var t=Object(o.a)(l.a.mark((function t(e){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:document.body.scrollIntoView(),z(e),M(e);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return console.log(Object(h.h)(),"location333"),u.a.createElement("section",{className:f.a.wrap},u.a.createElement(i.a,{loading:O,active:!0,paragraph:{rows:5}},(null===(n=Object(h.h)())||void 0===n||null===(s=n.pathname)||void 0===s?void 0:s.includes("preview"))&&u.a.createElement("div",{className:f.a.crumbs},u.a.createElement("b",null),u.a.createElement("span",{className:"current",onClick:function(){return d.d.push("/classrooms/".concat(B.coursesId,"/exercise"))}},"".concat(null==j||null===(p=j.course)||void 0===p?void 0:p.course_name,">")),u.a.createElement("span",{className:"current",onClick:function(){return d.d.push("/classrooms/".concat(B.coursesId,"/exercise"))}},"试卷列表>"),u.a.createElement("span",{style:{color:"#bebebe"}},"预览")),u.a.createElement(m.a,{loading:S,submit:function(){alert("保存")},goBack:function(){d.d.push("/classrooms/".concat(B.coursesId,"/exercise"))},data:I,selectValue:_,editPreview:!0,onExchange:H,onSkipExamination:W})))}))},sbIO: /*!***********************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.tsx + 6 modules ***! \***********************************************************************************************/ /*! exports provided: default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/editor.less?modules (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.less?modules (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./src/.umi-production/core/umiExports.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/Editor/NullChildEditor/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/Editor/NullMDEditor.js */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/index.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/utils/util.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/bi.svg (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/jinshi.svg (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/xixi.svg (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/paper/zhong.svg (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/checkbox/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/checkbox/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/divider/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/divider/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/pagination/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/pagination/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/tooltip/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/tooltip/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/lodash/lodash.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-router/esm/react-router.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n("DjyN");var i=n("NUBc"),r=(n("5Dmo"),n("3S7+")),o=(n("/zsF"),n("PArb")),a=(n("Q9mQ"),n("diRs")),s=(n("+L6B"),n("2/Rp")),l=(n("7Kak"),n("9yH6")),c=(n("5NDa"),n("5rEg")),u=(n("miYZ"),n("tsqr")),h=n("9og8"),d=(n("giR+"),n("fyUT")),p=(n("2qtc"),n("kLXV")),f=n("tJVT"),m=n("WmNS"),g=n.n(m),v=n("q1tI"),y=n.n(v),b=n("PsQE"),x=n.n(b),C=n("0eGx"),w=n.n(C),k=n("9Bee"),S=n("Ty5D"),E=n("9kvl"),T=n("ErOA"),O=n("+yhJ"),N=n.n(O),L=n("RZ/O"),A=n.n(L),_=n("LvDl"),M=n("6K3P"),P=n.n(M),D=(n("sRBo"),n("kaz8")),I=n("oBTY"),R=n("PpiC"),B=n("Ot1p"),j=n("kqOp"),z=n("7qnI"),F=n("1vsH"),H=n("PGNT"),W=n.n(H),V=function(t,e){t.globalSetting,t.loading,t.dispatch;var n=t.isEdit,i=t.editData,r=(Object(R.a)(t,["globalSetting","loading","dispatch","isEdit","editData"]),Object(v.useState)("")),o=Object(f.a)(r,2),a=o[0],s=o[1],l=Object(v.useState)(""),c=Object(f.a)(l,2),h=c[0],d=c[1],m=Object(v.useState)([]),g=Object(f.a)(m,2),b=g[0],x=g[1],C=Object(v.useState)(""),w=Object(f.a)(C,2),k=w[0],S=w[1],E=Object(v.useState)(),T=Object(f.a)(E,2),O=T[0],N=T[1],L=Object(v.useState)(!1),A=Object(f.a)(L,2),_=A[0],M=A[1];Object(v.useEffect)((function(){i&&n&&(s(null==i?void 0:i.name),d(null==i?void 0:i.analysis),N(null==i?void 0:i.is_ordered),M(!0))}),[i]),Object(v.useEffect)((function(){if(_){var t=null==i?void 0:i.standard_answer.map((function(t){return t.answer_text}));x(t),M(!1)}}),[_]),Object(v.useImperativeHandle)(e,(function(){return{onSave:P,Clear:H}}));var P=function(){var t=[],e=!1;return a?(b.forEach((function(n,i){t.push({position:i+1,answer_text:[]}),n.forEach((function(n,r){t[i].answer_text.push(n),n&&Object(F.bb)(n,1e4)||(S("".concat(i,"-").concat(r)),u.b.info(n?"答案不能超过10000字符":"答案:不能为空"),e=!0)}))})),!e&&((null==t?void 0:t.length)>20?(u.b.warn("填空题标准答案不能为空/不能超过20个!"),!1):{name:a,analysis:h,standard_answers:t,is_ordered:O})):(u.b.info("请您输入题干"),!1)},H=function(){s(""),d(""),x([]),N(!1)},V=function(t,e,n){S("");var i=b.slice();i[t][e]=n,x(i)},G=function(t){var e=b.slice();e[t]=[].concat(Object(I.a)(e[t]),[""]),x(e)},U=function(t,e){var n=b.slice();if(!n[t][e])return n[t]=n[t].filter((function(t,n){return n!==e})),void x(n);p.a.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:W.a.modal,onOk:function(){n[t]=n[t].filter((function(t,n){return n!==e})),x(n)}})},q=function(t){p.a.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:W.a.modal,onOk:function(){var e=b.slice();e=b.filter((function(e,n){return t!==n})),x(e)}})};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement("div",null,y.a.createElement(j.a,{id:"completion-question-tittle",placeholder:"请您输入题目",height:155,defaultValue:a,onChange:function(t){return s(t)},showNullButton:!0,onPlaceholderChange:function(t,e,n){var i=b.slice();if(e&&i.splice(t,e),n)for(var r=0;r1&&y.a.createElement("span",null,y.a.createElement(D.a,{checked:O,onChange:function(t){return N(t.target.checked)},className:"".concat(W.a.color333," font14")},"多个填空的答案有顺序要求"),y.a.createElement("span",{className:"".concat(W.a.color999," font12")},"(选中,每个填空的答案顺序必须与参考答案一致)"))),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:h,onChange:function(t){return d(t)}}))},G=Object(E.a)((function(t){var e=t.loading;return{globalSetting:t.globalSetting,loading:e.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(V)),U=function(t,e){t.globalSetting,t.loading;var n=t.editData,i=(t.dispatch,t.onRef,t.isEdit),r=(Object(R.a)(t,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),Object(v.useState)()),o=Object(f.a)(r,2),a=o[0],s=o[1],c=Object(v.useState)(""),h=Object(f.a)(c,2),d=h[0],p=h[1],m=Object(v.useState)(""),g=Object(f.a)(m,2),b=g[0],x=g[1];Object(v.useEffect)((function(){if(n&&i){p(null==n?void 0:n.name),x(null==n?void 0:n.analysis);var t=null==n?void 0:n.choices.find((function(t){return t.is_answer}));s("正确"===t.choice_text?"0":"1")}}),[n]),Object(v.useImperativeHandle)(e,(function(){return{onSave:C,Clear:w}}));var C=function(){return d?a?{name:d,choices:[{choice_text:"正确",is_answer:"0"===a?1:0},{choice_text:"错误",is_answer:"1"===a?1:0}],analysis:b}:(u.b.info("请先点击选择本选择题的正确选项"),!1):(u.b.info("请您输入题干"),!1)},w=function(){p(""),x(""),s("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(B.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:d,onChange:function(t){return p(t)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),y.a.createElement(l.a.Group,{buttonStyle:"solid",value:a,onChange:function(t){return s(t.target.value)}},y.a.createElement(l.a.Button,{value:"0",className:"".concat(W.a.radio," mr40")},"正确"),y.a.createElement(l.a.Button,{value:"1",className:W.a.radio},"错误")),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:b,onChange:function(t){return x(t)}}))},q=Object(E.a)((function(t){var e=t.loading;return{globalSetting:t.globalSetting,loading:e.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(U)),K=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],$=function(t,e){var n=t.editData,i=(t.globalSetting,t.loading,t.dispatch,t.onRef,t.isEdit),o=(Object(R.a)(t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(v.useState)([])),a=Object(f.a)(o,2),s=a[0],l=a[1],c=Object(v.useState)(),h=Object(f.a)(c,2),d=h[0],p=h[1],m=Object(v.useState)([]),g=Object(f.a)(m,2),b=g[0],x=g[1],C=Object(v.useState)(""),w=Object(f.a)(C,2),S=w[0],E=w[1],T=Object(v.useState)(""),O=Object(f.a)(T,2),N=O[0],L=O[1];Object(v.useEffect)((function(){l(["","","",""])}),[]),Object(v.useEffect)((function(){if(n&&i){E(null==n?void 0:n.name),L(null==n?void 0:n.analysis),l(null==n?void 0:n.choices.map((function(t){return t.choice_text})));var t=[];null==n||n.choices.map((function(e,n){e.is_answer&&t.push(n)})),x(t)}}),[n]),Object(v.useImperativeHandle)(e,(function(){return{onSave:A,Clear:_}}));var A=function(){if(!S)return u.b.info("请您输入题干"),!1;var t=s.findIndex((function(t){return!t}));if(t>-1)return u.b.info("请先输入 ".concat(K[t]," 选项的内容")),!1;if(!b.length)return u.b.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),!1;if(b.length<2)return u.b.info("多选题最小正确选项为2个"),!1;var e=s.map((function(t,e){return{choice_text:t,is_answer:b.includes(e)?1:0}}));return{name:S,choices:e,analysis:N}},_=function(){l(["","","",""]),E(""),L(""),x("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(B.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:S,onChange:function(t){return E(t)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),s.map((function(t,e){return y.a.createElement("div",{className:W.a.choiceWrap,key:e},y.a.createElement(r.a,{title:"点击设置为标准答案",placement:"left"},y.a.createElement("div",{className:"".concat(W.a.answer," ").concat(b.includes(e)?W.a.activeAnswer:""),onClick:function(){b.includes(e)?x(b.filter((function(t){return t!==e}))):x([].concat(Object(I.a)(b),[e]))}},K[e])),y.a.createElement("div",{className:W.a.editorWrap},d===e?y.a.createElement(B.a,{id:"single-question-option-".concat(e),watch:!0,height:155,placeholder:"请您输入选项",defaultValue:t,onChange:function(t){s[e]=t,l(s)}}):y.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return p(e)}},y.a.createElement(k.a,{value:t}))),e>1&&y.a.createElement(r.a,{title:"删除"},y.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){l(s.filter((function(t,n){return n!==e}))),b.includes(e)?x(b.filter((function(t){return t!==e}))):x([].concat(Object(I.a)(b),[e]))}})),e<7&&e===s.length-1&&y.a.createElement(r.a,{title:"新增参考答案"},y.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return l([].concat(Object(I.a)(s),[""]))}})))})),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:N,onChange:function(t){return L(t)}}))},X=Object(E.a)((function(t){var e=t.loading;return{globalSetting:t.globalSetting,loading:e.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)($)),Y=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],J=function(t,e){var n=t.editData,i=(t.globalSetting,t.loading,t.dispatch,t.onRef,t.isEdit),o=(Object(R.a)(t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(v.useState)([])),a=Object(f.a)(o,2),s=a[0],l=a[1],c=Object(v.useState)(),h=Object(f.a)(c,2),d=h[0],p=h[1],m=Object(v.useState)(),g=Object(f.a)(m,2),b=g[0],x=g[1],C=Object(v.useState)(""),w=Object(f.a)(C,2),S=w[0],E=w[1],T=Object(v.useState)(""),O=Object(f.a)(T,2),N=O[0],L=O[1];Object(v.useEffect)((function(){l(["","","",""])}),[]),Object(v.useEffect)((function(){n&&i&&(E(null==n?void 0:n.name),L(null==n?void 0:n.analysis),l(null==n?void 0:n.choices.map((function(t){return t.choice_text}))),x(null==n?void 0:n.choices.findIndex((function(t){return t.is_answer}))))}),[n]),Object(v.useImperativeHandle)(e,(function(){return{onSave:A,Clear:_}}));var A=function(){if(!S)return u.b.info("请您输入题干"),!1;var t=s.findIndex((function(t){return!t}));if(t>-1)return u.b.info("请先输入 ".concat(Y[t]," 选项的内容")),!1;if(console.log("activeAnswer: ",b),"number"!=typeof b)return u.b.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),!1;var e=s.map((function(t,e){return{choice_text:t,is_answer:b===e?1:0}}));return{name:S,choices:e,analysis:N}},_=function(){l(["","","",""]),E(""),L(""),x("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(B.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:S,onChange:function(t){return E(t)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),s.map((function(t,e){return y.a.createElement("div",{className:W.a.choiceWrap,key:e},y.a.createElement(r.a,{title:"点击设置为标准答案",placement:"left"},y.a.createElement("div",{className:"".concat(W.a.answer," ").concat(b===e?W.a.activeAnswer:""),onClick:function(){return x(e)}},Y[e])),y.a.createElement("div",{className:W.a.editorWrap},d===e?y.a.createElement(B.a,{id:"single-question-option-".concat(e),watch:!0,height:155,isFocus:!0,placeholder:"请您输入选项",defaultValue:t,onChange:function(t){s[e]=t,l(s)}}):y.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return p(e)}},y.a.createElement(k.a,{value:t}))),e>1&&y.a.createElement(r.a,{title:"删除"},y.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){l(s.filter((function(t,n){return n!==e}))),e===b&&x(null)}})),e<7&&e===s.length-1&&y.a.createElement(r.a,{title:"新增参考答案"},y.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return l([].concat(Object(I.a)(s),[""]))}})))})),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:N,onChange:function(t){return L(t)}}))},Z=Object(E.a)((function(t){var e=t.loading;return{globalSetting:t.globalSetting,loading:e.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(J)),Q=function(t,e){var n=t.editData,i=(t.globalSetting,t.loading,t.dispatch,t.onRef,t.isEdit),r=(Object(R.a)(t,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(v.useState)("")),o=Object(f.a)(r,2),a=o[0],s=o[1],l=Object(v.useState)(""),c=Object(f.a)(l,2),h=c[0],d=c[1],p=Object(v.useState)(""),m=Object(f.a)(p,2),g=m[0],b=m[1];Object(v.useEffect)((function(){var t;n&&i&&(s(null==n?void 0:n.name),d(null==n?void 0:n.analysis),b(null==n||null===(t=n.answer_texts)||void 0===t?void 0:t[0]))}),[n]),Object(v.useImperativeHandle)(e,(function(){return{onSave:x,Clear:C}}));var x=function(){return a?g?{name:a,answer_texts:[g],analysis:h}:(u.b.info("请您输入参考答案"),!1):(u.b.info("请您输入题干"),!1)},C=function(){s(""),d(""),b("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(B.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:a,onChange:function(t){return s(t)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"参考答案:")),y.a.createElement(B.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"请您输入参考答案",defaultValue:g,onChange:function(t){return b(t)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:h,onChange:function(t){return d(t)}}))},tt=Object(E.a)((function(t){var e=t.loading;return{globalSetting:t.globalSetting,loading:e.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(Q)),et=n("k1fw"),nt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],it=function(t,e){t.globalSetting,t.loading,t.dispatch;var n=t.editData,i=(t.onRef,t.isEdit),o=(Object(R.a)(t,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),Object(v.useState)("")),a=Object(f.a)(o,2),s=a[0],l=a[1],c=Object(v.useState)([]),h=Object(f.a)(c,2),d=h[0],p=h[1];console.log(d),Object(v.useEffect)((function(){var t;if(n&&i){l(null==n?void 0:n.name);var e=null==n||null===(t=n.sub_item_banks)||void 0===t?void 0:t.map((function(t){var e,n,i;return Object(et.a)(Object(et.a)({},t),{},{id:t.id,open:!1,qusList:null==t||null===(e=t.choices)||void 0===e?void 0:e.map((function(t){return t.choice_text})),activeQusEditor:null,qusAnswer:null===(n=[null==t||null===(i=t.choices)||void 0===i?void 0:i.findIndex((function(t){return t.is_answer}))])||void 0===n?void 0:n.filter((function(t){return-1!==t}))})}));p(e)}}),[n]),Object(v.useImperativeHandle)(e,(function(){return{onSave:m,Clear:g}}));var m=function(){if(!s)return u.b.info("请您输入题干"),!1;if(0===d.length)return u.b.info("请您添加小题"),!1;for(var t=0;t-1)return u.b.info("请先输入第".concat(t+1,"小题").concat(nt[i],"选项的内容")),!1;if(null==n||!n.qusAnswer.length)return u.b.info("请设置第".concat(t+1,"小题的正确答案,点击选项A/B...即可完成设置")),!1}var r=d.map((function(t){return{id:t.id>1?t.id:null,name:t.name,item_type:t.item_type,analysis:t.analysis,choices:t.qusList.map((function(e,n){return{choice_text:e,is_answer:t.qusAnswer[0]===n?1:0}}))}}));return{name:s,sub_item_banks:r}},g=function(){l(""),p([])},b=function(t,e,n){var i,r=Object(_.cloneDeep)(d);("open"===t&&(r[e].open=!r[e].open),"delete"===t&&r.splice(e,1),"value"===t&&(r[e].name=n),"answer"===t&&(r[e].qusAnswer=[n]),"edit"===t&&(r[e].activeQusEditor=n),"details"===t&&(r[e].qusList[r[e].activeQusEditor]=n),"addQus"===t&&(r[e].qusList=r[e].qusList.concat("")),"deleteQus"===t)&&(r[e].qusList=r[e].qusList.filter((function(t,e){return e!==n})),r[e].qusAnswer=null===(i=r[e].qusAnswer)||void 0===i?void 0:i.filter((function(t){return t!==n})));"analysis"===t&&(r[e].analysis=n),p(r)};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(B.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:s,onChange:function(t){return l(t)}}),null==d?void 0:d.map((function(t,e){var n;return y.a.createElement("div",{className:W.a.fold,key:t.id},y.a.createElement("div",{onClick:function(){return b("open",e)},className:W.a.head},y.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:t.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),y.a.createElement("span",null,"第",e+1,"小题(单选题)"),y.a.createElement("b",{style:{visibility:"hidden"},onClick:function(t){t.stopPropagation(),b("delete",e)},className:"iconfont icon-shanchu8"})),y.a.createElement("div",{className:"mb10",style:{display:t.open?"block":"none"}},y.a.createElement(B.a,{watch:!0,height:155,placeholder:"请您输入题干",defaultValue:null==t?void 0:t.name,onChange:function(t){return b("value",e,t)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),null==t||null===(n=t.qusList)||void 0===n?void 0:n.map((function(n,i){var o,a;return y.a.createElement("div",{className:W.a.choiceWrap,key:i},y.a.createElement(r.a,{title:"点击设置为标准答案",placement:"left"},y.a.createElement("div",{className:"".concat(W.a.answer," ").concat(null!=t&&null!==(o=t.qusAnswer)&&void 0!==o&&o.includes(i)?W.a.activeAnswer:""),onClick:function(){return b("answer",e,i)}},nt[i])),y.a.createElement("div",{className:W.a.editorWrap},(null==t?void 0:t.activeQusEditor)===i?y.a.createElement(B.a,{id:"single-question-option-".concat(i),watch:!0,height:155,isFocus:!0,placeholder:"请您输入选项",defaultValue:n,onChange:function(t){return b("details",e,t)}}):y.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return b("edit",e,i)}},y.a.createElement(k.a,{value:n}))),i>1&&y.a.createElement(r.a,{title:"删除"},y.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return b("deleteQus",e,i)}})),i<7&&i===(null==t||null===(a=t.qusList)||void 0===a?void 0:a.length)-1&&y.a.createElement(r.a,{title:"新增参考答案"},y.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return b("addQus",e)}})))})),y.a.createElement("p",{className:"mb10 mt10"},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(B.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:t.analysis,onChange:function(t){return b("analysis",e,t)}})))})))},rt=Object(E.a)((function(t){var e=t.loading;return{globalSetting:t.globalSetting,loading:e.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(it));e.a=function(t){var e,n,m,b,C,O,L,M,D=t.data,I=t.submit,R=t.goBack,B=t.loading,j=t.onTypeScore,z=t.editPreview,F=void 0!==z&&z,H=t.onSkipExamination,W=t.selectValue,V=t.onExchange,U=Object(v.useRef)(),K=Object(v.useRef)(Object(_.debounce)((function(){return lt()}),100,{leading:!0,trailing:!0})),$=Object(v.useState)(null),Y=Object(f.a)($,2),J=Y[0],Q=Y[1],et=Object(v.useState)(!1),nt=Object(f.a)(et,2),it=nt[0],ot=nt[1],at=Object(S.i)();Object(v.useEffect)((function(){return window.addEventListener("scroll",null==K?void 0:K.current),function(){window.removeEventListener("scroll",null==K?void 0:K.current)}}),[]),Object(v.useEffect)((function(){ot(!0)}),[]),Object(v.useEffect)((function(){var t,e,n,i,r=null===(t=document.getElementById("examName"))||void 0===t||null===(e=t.getElementsByClassName("ant-pagination-options-quick-jumper"))||void 0===e||null===(n=e[0])||void 0===n||null===(i=n.childNodes)||void 0===i?void 0:i[2];r&&(r.nodeValue="份")}),[D]);var st=function(t){var e=parseInt(t);return isNaN(e)?"":e};var lt=function(){var t,e,n,i,r=document.getElementById("preview_btns"),o=document.getElementById("preview_btns_else");n=0,i=0,document.body&&(n=document.body.scrollTop),document.documentElement&&(i=document.documentElement.scrollTop),(n-i>0?n:i)+("CSS1Compat"==document.compatMode?document.documentElement.clientHeight:document.body.clientHeight)>=(t=0,e=0,document.body&&(t=document.body.scrollHeight),document.documentElement&&(e=document.documentElement.scrollHeight),(t-e>0?t:e)-68)?(r.style.visibility="hidden",o.style.visibility="visible"):(r.style.visibility="visible",o.style.visibility="hidden")},ct=["容易","简单","适中","困难"],ut=function(t){var e;return y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",null==t||null===(e=t.answer_texts)||void 0===e?void 0:e[0]),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:t.analysis?t.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==t?void 0:t.discipline_name,"/").concat(null==t?void 0:t.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==t?void 0:t.tag_discipline_name)))},ht=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],dt=function(t){console.log(t,"key"),H(t-1)},pt=function(){return y.a.createElement(y.a.Fragment,null,y.a.createElement(a.a,{color:"#55575D",overlayClassName:x.a.popover,visible:it,getPopupContainer:function(t){return null==t?void 0:t.parentNode},content:"如您对此份试题满意,可将此份试题保存为固定试卷"},y.a.createElement(s.a,{onMouseEnter:function(){return ot(!0)},onMouseLeave:function(){return ot(!1)},onClick:function(){var t,e;e="",p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"保存试卷",content:y.a.createElement("div",{className:x.a.modalColumn},y.a.createElement("div",{style:{color:"#676A6C",display:"flex"},className:"font14 mt20"},y.a.createElement("img",{style:{marginRight:5},src:P.a}),"保存后单独生成一份人工组卷类型的固定试卷。"),y.a.createElement("div",{className:x.a.modalRow,style:{marginTop:20}},y.a.createElement("sup",{className:x.a.sup},"*"),y.a.createElement("span",{style:{flexShrink:0}},"试卷名称:"),y.a.createElement(c.a,{placeholder:"请输入试卷名称",min:0,maxLength:60,defaultValue:e,onChange:function(t){e=t.target.value}}))),okText:"确认",cancelText:"取消",onOk:(t=Object(h.a)(g.a.mark((function t(){var n,i,r,o,a;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=3;break}return u.b.warn("试卷名称不能为空"),t.abrupt("return",Promise.reject());case 3:return i=[],r=[],o=[],null==D||null===(n=D.questionList)||void 0===n||n.forEach((function(t){var e;null===(e=t.questions)||void 0===e||e.forEach((function(e){i.push(e.id),r.push(t.questions_score/t.questions_count),"COMBINATION"===t.type&&o.push({id:e.id,sub_item_bank_ids:e.sub_item_banks.map((function(t){return t.id}))})}))})),console.log("-----",o),a={item_bank_ids:i,item_bank_scores:r,name:e,combination_item_banks:o},t.next=11,I(a);case 11:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)})})}},"保存")),y.a.createElement(s.a,{onClick:function(){document.body.scrollIntoView(),R()}},"返回"),y.a.createElement(s.a,{loading:B,onClick:function(){return I()},type:"primary"},"提交"))},ft=function(){var t;return y.a.createElement(y.a.Fragment,null,y.a.createElement(s.a,{onClick:R},"返回"),W>0&&y.a.createElement(s.a,{onClick:function(){return dt(W)},type:"primary"},"上一份"),W<(null==D||null===(t=D.exam)||void 0===t?void 0:t.total_num)-1&&y.a.createElement(s.a,{onClick:function(){return dt(W+2)}},"下一份"))},mt=function(){var t=Object(h.a)(g.a.mark((function t(e,n){var i,r,o,a,s,l,c,h,d,p;return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,null===(i=U.current)||void 0===i?void 0:i.onSave();case 2:if(r=t.sent){t.next=5;break}return t.abrupt("return");case 5:return o={question_score:n.score,analysis:r.analysis},console.log(r,"editorData"),"SINGLE"!==e&&"MULTIPLE"!==e&&"JUDGMENT"!==e||(s=[],l=[],o.question_type="JUDGMENT"===e?2:1,o.question_title=null==r?void 0:r.name,null==r||null===(a=r.choices)||void 0===a||a.forEach((function(t,e){s.push(t.choice_text),null!=t&&t.is_answer&&l.push(e+1)})),o.question_choices=s,o.standard_answers=l),"COMPLETION"===e&&(o.is_ordered=r.is_ordered,o.question_title=null==r?void 0:r.name,o.question_type=3,h=[],null==r||null===(c=r.standard_answers)||void 0===c||c.forEach((function(t,e){h.push({choice_id:t.position,answer_text:t.answer_text})})),o.standard_answers=h),"SUBJECTIVE"===e&&(o.question_title=null==r?void 0:r.name,o.question_type=3,o.standard_answers=null==r?void 0:r.answer_texts),"COMBINATION"===e&&(o.question_title=null==r?void 0:r.name,o.question_type=7,o.sub_questions=null==r||null===(d=r.sub_item_banks)||void 0===d?void 0:d.map((function(t,e){return{id:t.id,question_title:t.name,question_type:1,question_choices:t.choices.map((function(t){return t.choice_text})),standard_answers:[t.choices.findIndex((function(t){return t.is_answer}))+1],analysis:t.analysis}})),delete o.analysis),t.next=13,Object(T.a)("/api/exercise_questions/".concat(n.id,".json"),{method:"put",body:o});case 13:0===(null==(p=t.sent)?void 0:p.status)&&(u.b.success("编辑成功"),dt(W+1)),Q(null);case 16:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}();console.log(function(){for(var t=[],e=0;e<(null==D||null===(n=D.exam)||void 0===n?void 0:n.total_num);e++){var n;t.push({})}return t}(),"data");var gt=null==D||null===(e=D.questionList)||void 0===e?void 0:e.reduce((function(t,e){return t+e.questions_score}),0),vt=F&&1!==(null==D||null===(n=D.exam)||void 0===n?void 0:n.exercise_status);return y.a.createElement("section",{className:x.a.wrap},y.a.createElement("div",{id:"id_left_preview",className:x.a.left,onMouseEnter:function(t){document.getElementById("id_left_preview").style.overflowY="auto"},onMouseLeave:function(t){document.getElementById("id_left_preview").style.overflowY="hidden"}},y.a.createElement("div",{className:x.a.title},y.a.createElement("div",null,y.a.createElement("b",null),y.a.createElement("span",null,"答题卡"))),y.a.createElement("div",{className:x.a.total},y.a.createElement("div",null,y.a.createElement("img",{src:N.a}),y.a.createElement("span",null,"题数(道)"),y.a.createElement("aside",null,null==D?void 0:D.all_questions_count)),y.a.createElement("div",{className:"mr30 ml30"},y.a.createElement("img",{src:A.a}),y.a.createElement("span",null,"总分(分)"),y.a.createElement("aside",null,gt)),y.a.createElement("div",null,y.a.createElement("img",{src:w.a}),y.a.createElement("span",null,"时长(分)"),y.a.createElement("aside",null,null==D||null===(m=D.exam)||void 0===m?void 0:m.time))),null==D||null===(b=D.questionList)||void 0===b?void 0:b.map((function(t,e){var n;return y.a.createElement("div",{className:x.a.list,key:e},y.a.createElement("div",{className:x.a.name},y.a.createElement("b",null),y.a.createElement("span",null,t.name)),y.a.createElement("aside",null,y.a.createElement("div",null,"共",y.a.createElement("span",{className:x.a.b},t.questions_count),"题 ",y.a.createElement("span",{className:x.a.l},"|"),"共",y.a.createElement("span",{className:x.a.r},t.questions_score),"分"),y.a.createElement("div",{className:x.a.answerSheet},null==t||null===(n=t.questions)||void 0===n?void 0:n.map((function(t,e){return y.a.createElement("div",{onClick:function(){var e="Anchor_".concat(t.id),n=document.getElementById(e);n&&setTimeout((function(){return n.scrollIntoView({block:"center",behavior:"smooth"})}))},key:t.id,className:x.a.tag},e+1)})))))}))),y.a.createElement("div",{className:x.a.right},y.a.createElement("div",{className:x.a.examName,id:"examName"},y.a.createElement("div",{className:x.a.name},y.a.createElement(r.a,{title:null==D||null===(C=D.exam)||void 0===C?void 0:C.name,getPopupContainer:function(t){return t.parentNode}},y.a.createElement("span",{className:x.a.t},null==D||null===(O=D.exam)||void 0===O?void 0:O.name))),F?y.a.createElement(i.a,{showTotal:function(t){return y.a.createElement("span",{style:{color:"#656F87",fontSize:14}},"共计",y.a.createElement("span",{className:"c-light-primary"},t),"份试卷")},total:null==D||null===(L=D.exam)||void 0===L?void 0:L.total_num,pageSize:1,current:W+1,showSizeChanger:!1,onChange:dt,showQuickJumper:!0,hideOnSinglePage:!1}):y.a.createElement(s.a,{onClick:function(){var t,e=p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:"确认更换预览中的所有试题吗?",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(t=Object(h.a)(g.a.mark((function t(){return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.update({cancelButtonProps:{disabled:!0}}),t.next=3,V();case 3:e.update({cancelButtonProps:{disabled:!1}}),u.b.success("已重新随机生成整张试题");case 5:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)})})},type:"primary"},"随机更换")),y.a.createElement("div",{className:x.a.topWarp},null==D||null===(M=D.questionList)||void 0===M?void 0:M.map((function(t,e){var n,i;return y.a.createElement(y.a.Fragment,{key:e},y.a.createElement("div",{className:x.a.head,style:0===e?{border:0,marginTop:-16}:{}},y.a.createElement("div",{className:x.a.name},y.a.createElement("b",null),y.a.createElement("span",null,t.name)),y.a.createElement("div",{className:x.a.so},"共",y.a.createElement("span",{className:x.a.b},t.questions_count," "),"题 ","COMBINATION"===t.type&&"(包含".concat(null==t||null===(n=t.questions)||void 0===n?void 0:n.map((function(t){var e;return null==t||null===(e=t.sub_item_banks)||void 0===e?void 0:e.length})).reduce((function(t,e){return t+e})),"小题)"),y.a.createElement("span",{className:x.a.l},"|"),"共",y.a.createElement("span",{className:x.a.r},t.questions_score),"分"),!F&&y.a.createElement("div",{className:x.a.btn},y.a.createElement(s.a,{onClick:function(){!function(t){console.log("---",t);var e=[];t.questions.map((function(t){return null==t?void 0:t.sub_item_banks.map((function(t){e.push(t)}))}));var n,i=0;i="COMBINATION"===t.type?t.questions_score/e.length:t.questions_score/t.questions_count,p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"分数设置",content:y.a.createElement("div",{className:x.a.modalColumn},y.a.createElement("div",{className:x.a.modalRow,style:{justifyContent:"flex-start"}},y.a.createElement("sup",{className:x.a.sup},"*"),y.a.createElement("span",null,null==t?void 0:t.name,"COMBINATION"===(null==t?void 0:t.type)&&"中的每小题",":"),y.a.createElement(d.a,{min:1,parser:st,defaultValue:i,onChange:function(t){i=t}}),y.a.createElement("span",{className:"ml5"},"分/题"))),okText:"确认",cancelText:"取消",onOk:(n=Object(h.a)(g.a.mark((function n(){var r,o;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i){n.next=3;break}return u.b.warn("分数不能为空或为0"),n.abrupt("return",Promise.reject());case 3:"COMBINATION"===t.type?(r={type:null==t?void 0:t.type,score:i,scoreTotal:i*(null==e?void 0:e.length)},j(r)):(o={type:null==t?void 0:t.type,score:i,scoreTotal:i*t.questions_count},j(o));case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})}(t)},type:"primary",ghost:!0,className:"mr20"},"设置得分"),y.a.createElement(s.a,{onClick:function(){return r=null===(n=(e=t).questions)||void 0===n?void 0:n.map((function(t){return t.id})),o=e.name,void(a=p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:"确认更换".concat(o,"中的所有试题吗?"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(i=Object(h.a)(g.a.mark((function t(){return g.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a.update({cancelButtonProps:{disabled:!0}}),t.next=3,V({seleted_item_bank_ids:r},{type:e.type});case 3:a.update({cancelButtonProps:{disabled:!1}}),u.b.success("已重新随机生成".concat(o,"试题"));case 5:case"end":return t.stop()}}),t)}))),function(){return i.apply(this,arguments)})}));var e,n,i,r,o,a},type:"primary",ghost:!0},"随机更换"))),null==t||null===(i=t.questions)||void 0===i?void 0:i.map((function(e,n){return J===e.id?y.a.createElement("div",{id:"Anchor_".concat(e.id),className:x.a.content,style:{padding:0,marginTop:10},key:e.id},y.a.createElement("div",{style:{float:"right",marginTop:-6}},y.a.createElement(s.a,{onClick:function(){return Q(null)},className:"mr20",type:"primary",ghost:!0},"取消"),y.a.createElement(s.a,{onClick:function(){return mt(null==t?void 0:t.type,e)},type:"primary"},"保存")),function(t,e){if(console.log(t,222),"SINGLE"===e)return y.a.createElement(y.a.Fragment,null,y.a.createElement(Z,{ref:U,editData:t,isEdit:!0}),y.a.createElement(o.a,null));if("MULTIPLE"===e)return y.a.createElement(y.a.Fragment,null,y.a.createElement(X,{ref:U,editData:t,isEdit:!0}),y.a.createElement(o.a,null));if("JUDGMENT"===e)return y.a.createElement(y.a.Fragment,null,y.a.createElement(q,{ref:U,editData:t,isEdit:!0}),y.a.createElement(o.a,null));if("COMPLETION"===e)return y.a.createElement(y.a.Fragment,null,y.a.createElement(G,{ref:U,editData:t,isEdit:!0}),y.a.createElement(o.a,null));if("SUBJECTIVE"===e)return y.a.createElement(y.a.Fragment,null,y.a.createElement(tt,{ref:U,editData:t,isEdit:!0}),y.a.createElement(o.a,null));if("COMBINATION"===e)return y.a.createElement(y.a.Fragment,null,y.a.createElement(rt,{ref:U,editData:t,isEdit:!0}),y.a.createElement(o.a,null));var n;"PROGRAM"===e&&E.d.push("/problems/".concat(null==t||null===(n=t.program_attr)||void 0===n?void 0:n.identifier,"/edit?type=exercises&express_id=").concat(at.categoryId,"&question_id=").concat(null==t?void 0:t.id,"&score=").concat(null==t?void 0:t.score,"&callback_url=").concat(location.pathname,"&select=").concat(W,"&exercise=true"))}(e,t.type)):y.a.createElement("div",{id:"Anchor_".concat(e.id),className:x.a.content,key:e.id},y.a.createElement("div",{className:x.a.titleWrap},y.a.createElement(k.a,{style:{paddingRight:10},className:x.a.titleHtml,value:n+1+"、"+"".concat("combination"===(null==e?void 0:e.item_type)?"(题干)":"")+e.name}),F&&y.a.createElement(s.a,{disabled:vt,onClick:function(){J?u.b.warn("先保存或取消当前正在编辑的试题"):Q(e.id)},type:"primary",className:"mr20",style:{marginLeft:"auto"},ghost:!0},"编辑"),y.a.createElement(s.a,{disabled:vt,onClick:function(){return function(t,e,n,i){var r,o,a=null===(r=i.questions)||void 0===r?void 0:r.map((function(t){return t.id})),s="default",c=p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:y.a.createElement("div",null,y.a.createElement("p",null,"系统按以下规则为您更换该试题"),y.a.createElement("div",null,y.a.createElement("span",null,"使用频度:"),y.a.createElement(l.a.Group,{defaultValue:s,onChange:function(t){s=t.target.value}},y.a.createElement(l.a,{value:"default"},"不设定"),y.a.createElement(l.a,{value:"high"},"使用次数高"),y.a.createElement(l.a,{value:"low"},"使用次数低")))),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(o=Object(h.a)(g.a.mark((function i(){return g.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return c.update({cancelButtonProps:{disabled:!0}}),i.next=3,V({single_question_id:t,seleted_item_bank_ids:a,type:s},{type:e,index:n});case 3:c.update({cancelButtonProps:{disabled:!1}}),u.b.success("已重新随机生成试题");case 5:case"end":return i.stop()}}),i)}))),function(){return o.apply(this,arguments)})})}(e.id,t.type,n,t)},type:"primary",ghost:!0},"换一题")),("SINGLE"===t.type||"JUDGMENT"===t.type||"MULTIPLE"===t.type)&&(c=e,f=[],y.a.createElement(y.a.Fragment,null,y.a.createElement("aside",{className:x.a.single},null==c||null===(d=c.choices)||void 0===d?void 0:d.map((function(t,e){return t.is_answer&&f.push(ht[e]),y.a.createElement("ul",{key:e},y.a.createElement("li",null,ht[e],"、"),y.a.createElement("li",null,y.a.createElement(k.a,{value:t.choice_text})))}))),y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",f.join(""),y.a.createElement("span",{className:"ml30"},"难度:",ct[c.difficulty])),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:c.analysis?c.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==c?void 0:c.discipline_name,"/").concat(null==c?void 0:c.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==c?void 0:c.tag_discipline_name))))),"COMPLETION"===t.type&&function(t){var e,n=null==t||null===(e=t.standard_answer)||void 0===e?void 0:e.map((function(t){var e;return"答案(填空".concat(t.position,"):").concat(null==t||null===(e=t.answer_text)||void 0===e?void 0:e.join("、"))}));return y.a.createElement(y.a.Fragment,null,y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",n),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:t.analysis?t.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==t?void 0:t.discipline_name,"/").concat(null==t?void 0:t.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==t?void 0:t.tag_discipline_name))))}(e),"SUBJECTIVE"===t.type&&ut(e),"FILEUPLOAD"===t.type&&ut(e),"PHOTOGRAPH"===t.type&&ut(e),"PROGRAM"===t.type&&function(t){var e;return y.a.createElement("div",{className:x.a.analysis},y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"预期输出:"),y.a.createElement(k.a,{value:null==t||null===(e=t.program_attr)||void 0===e?void 0:e.description})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==t?void 0:t.discipline_name,"/").concat(null==t?void 0:t.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==t?void 0:t.tag_discipline_name)))}(e),"COMBINATION"===t.type&&(i=e,r=n,y.a.createElement("div",null,null==i||null===(a=i.sub_item_banks)||void 0===a?void 0:a.map((function(t,e){var n,o=[];return y.a.createElement(y.a.Fragment,null,y.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},r+1+"."+(e+1),"(单选题)",t.name),y.a.createElement("aside",{className:x.a.single},null==t||null===(n=t.choices)||void 0===n?void 0:n.map((function(t,e){return t.is_answer&&o.push(ht[e]),y.a.createElement("ul",{key:e},y.a.createElement("li",null,ht[e],"、"),y.a.createElement("li",null,y.a.createElement(k.a,{value:t.choice_text})))}))),y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",o.join(""),y.a.createElement("span",{className:"ml30"},"难度:",ct[t.difficulty])),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:t.analysis?t.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==i?void 0:i.discipline_name,"/").concat(null==i?void 0:i.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==i?void 0:i.tag_discipline_name))))})))),y.a.createElement("div",null));var i,r,a,c,d,f})))}))),y.a.createElement("div",{className:x.a.btnsElse,id:"preview_btns_else"},F?ft():pt()),y.a.createElement("div",{className:x.a.btnsWrap,id:"preview_btns"},y.a.createElement("div",{className:x.a.btns},F?ft():pt()))))}},vHTk: /*!******************************************************!*\ !*** ./src/components/PreviewAll/index.less?modules ***! \******************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J: /*!*********************************************!*\ !*** ./node_modules/qr.js/lib/BitBuffer.js ***! \*********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){function n(){this.buffer=new Array,this.length=0}n.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var n=0;n>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=n}}]);