(window.webpackJsonp=window.webpackJsonp||[]).push([[201,5,7,8,10],{"+92d":
/*!*******************************************!*\
!*** ./src/assets/images/question/b1.svg ***!
\*******************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){t.exports=i.p+"static/b1.8d46544a.svg"},"+RDj":
/*!********************************************!*\
!*** ./src/assets/images/question/dau.svg ***!
\********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){t.exports=i.p+"static/dau.0c862b4c.svg"},"3SPk":
/*!******************************************!*\
!*** ./src/assets/images/question/c.svg ***!
\******************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){t.exports=i.p+"static/c.893027ce.svg"},"5A5F":
/*!*****************************************************!*\
!*** ./src/pages/Question/Index/index.less?modules ***!
\*****************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){t.exports={flex_box_center:"flex_box_center___3fvo9",flex_space_between:"flex_space_between___2dIWe",flex_box_vertical_center:"flex_box_vertical_center___213Et",flex_box_center_end:"flex_box_center_end___1GXlY",flex_box_column:"flex_box_column___2XTWO",wrap:"wrap___1JbzU",bg:"bg___Dxa5l",btnWrap:"btnWrap___1CEeA",text:"text___ufYpy",btn:"btn___33IXa",content:"content___2Crhb",left:"left___12ObT",filterPoint:"filterPoint___1wSyY",btnWarp:"btnWarp___XLUgV",btnActive:"btnActive___2vIUq",action:"action___m_eZE",btnMask:"btnMask___epWeB",filterOrigin:"filterOrigin___OKol4",line:"line___psQHn",control:"control___1SAJX",table:"table___1Q9AI",tabWarp:"tabWarp___3884f",tabWarp2:"tabWarp2___1f1Zo",customTable:"customTable___6Ubut","btn-style-1":"btn-style-1___m4kGi","btn-style-2":"btn-style-2___2uJ8s","btn-style-3":"btn-style-3___3kuYl",right:"right___Ie2u1",title:"title___1uK2v",sort:"sort___1hyjY",titles:"titles___1i-V6",li:"li___3lR-W",titleWarp:"titleWarp___t0Zdh",hov:"hov___30B5q",hovBtn:"hovBtn___3ciGX",tag:"tag___hllWE",problemsclose:"problemsclose___1X9HB",imgsrc:"imgsrc___3koep"}},"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,i){"use strict";i.d(e,"a",(function(){return w}));var r=i("wx14"),n=i("rePB"),s=i("VTBJ"),a=i("1OyB"),o=i("vuIU"),l=i("Ji7U"),c=i("LK+K"),u=i("q1tI"),h=i.n(u),d=i("TSYQ"),f=i.n(d),p=function(t){var e,i="".concat(t.rootPrefixCls,"-item"),r=f()(i,"".concat(i,"-").concat(t.page),(e={},Object(n.a)(e,"".concat(i,"-active"),t.active),Object(n.a)(e,t.className,!!t.className),Object(n.a)(e,"".concat(i,"-disabled"),!t.page),e));return h.a.createElement("li",{title:t.showTitle?t.page:null,className:r,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)))},g=13,v=38,m=40,y=function(t){Object(l.a)(i,t);var e=Object(c.a)(i);function i(){var t;Object(a.a)(this,i);for(var r=arguments.length,n=new Array(r),s=0;s=0||e.relatedTarget.className.indexOf("".concat(s,"-next"))>=0)||(t.setState({goInputText:""}),n(t.getValidValue()))},t.go=function(e){""!==t.state.goInputText&&(e.keyCode!==g&&"click"!==e.type||(t.setState({goInputText:""}),t.props.quickGo(t.getValidValue())))},t}return Object(o.a)(i,[{key:"getValidValue",value:function(){var t=this.state,e=t.goInputText,i=t.current;return!e||isNaN(e)?i:Number(e)}},{key:"getPageSizeOptions",value:function(){var t=this.props,e=t.pageSize,i=t.pageSizeOptions;return i.some((function(t){return t.toString()===e.toString()}))?i:i.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,i=e.pageSize,r=e.locale,n=e.rootPrefixCls,s=e.changeSize,a=e.quickGo,o=e.goButton,l=e.selectComponentClass,c=e.buildOptionText,u=e.selectPrefixCls,d=e.disabled,f=this.state.goInputText,p="".concat(n,"-options"),g=l,v=null,m=null,y=null;if(!s&&!a)return null;var b=this.getPageSizeOptions();if(s&&g){var E=b.map((function(e,i){return h.a.createElement(g.Option,{key:i,value:e.toString()},(c||t.buildOptionText)(e))}));v=h.a.createElement(g,{disabled:d,prefixCls:u,showSearch:!1,className:"".concat(p,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(i||b[0]).toString(),onChange:this.changeSize,getPopupContainer:function(t){return t.parentNode}},E)}return a&&(o&&(y="boolean"==typeof o?h.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:d,className:"".concat(p,"-quick-jumper-button")},r.jump_to_confirm):h.a.createElement("span",{onClick:this.go,onKeyUp:this.go},o)),m=h.a.createElement("div",{className:"".concat(p,"-quick-jumper")},r.jump_to,h.a.createElement("input",{disabled:d,type:"text",value:f,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),r.page,y)),h.a.createElement("li",{className:"".concat(p)},v,m)}}]),i}(h.a.Component);y.defaultProps={pageSizeOptions:["10","20","50","100"]};var b=y,E=i("N2Kk");function S(){}function C(t,e,i){var r=void 0===t?e.pageSize:t;return Math.floor((i.total-1)/r)+1}var k=function(t){Object(l.a)(i,t);var e=Object(c.a)(i);function i(t){var r;Object(a.a)(this,i),(r=e.call(this,t)).getJumpPrevPage=function(){return Math.max(1,r.state.current-(r.props.showLessItems?3:5))},r.getJumpNextPage=function(){return Math.min(C(void 0,r.state,r.props),r.state.current+(r.props.showLessItems?3:5))},r.getItemIcon=function(t,e){var i=r.props.prefixCls,n=t||h.a.createElement("button",{type:"button","aria-label":e,className:"".concat(i,"-item-link")});return"function"==typeof t&&(n=h.a.createElement(t,Object(s.a)({},r.props))),n},r.savePaginationNode=function(t){r.paginationNode=t},r.isValid=function(t){return"number"==typeof(e=t)&&isFinite(e)&&Math.floor(e)===e&&t!==r.state.current;var e},r.shouldDisplayQuickJumper=function(){var t=r.props,e=t.showQuickJumper,i=t.pageSize;return!(t.total<=i)&&e},r.handleKeyDown=function(t){t.keyCode!==v&&t.keyCode!==m||t.preventDefault()},r.handleKeyUp=function(t){var e=r.getValidValue(t);e!==r.state.currentInputValue&&r.setState({currentInputValue:e}),t.keyCode===g?r.handleChange(e):t.keyCode===v?r.handleChange(e-1):t.keyCode===m&&r.handleChange(e+1)},r.changePageSize=function(t){var e=r.state.current,i=C(t,r.state,r.props);e=e>i?i:e,0===i&&(e=r.state.current),"number"==typeof t&&("pageSize"in r.props||r.setState({pageSize:t}),"current"in r.props||r.setState({current:e,currentInputValue:e})),r.props.onShowSizeChange(e,t),"onChange"in r.props&&r.props.onChange&&r.props.onChange(e,t)},r.handleChange=function(t){var e=r.props.disabled,i=t;if(r.isValid(i)&&!e){var n=C(void 0,r.state,r.props);i>n?i=n:i<1&&(i=1),"current"in r.props||r.setState({current:i,currentInputValue:i});var s=r.state.pageSize;return r.props.onChange(i,s),i}return r.state.current},r.prev=function(){r.hasPrev()&&r.handleChange(r.state.current-1)},r.next=function(){r.hasNext()&&r.handleChange(r.state.current+1)},r.jumpPrev=function(){r.handleChange(r.getJumpPrevPage())},r.jumpNext=function(){r.handleChange(r.getJumpNextPage())},r.hasPrev=function(){return r.state.current>1},r.hasNext=function(){return r.state.current2?i-2:0),n=2;n=i?i:Number(e)}},{key:"getShowSizeChanger",value:function(){var t=this.props,e=t.showSizeChanger,i=t.total,r=t.totalBoundaryShowSizeChanger;return void 0!==e?e:i>r}},{key:"renderPrev",value:function(t){var e=this.props,i=e.prevIcon,r=(0,e.itemRender)(t,"prev",this.getItemIcon(i,"prev page")),n=!this.hasPrev();return Object(u.isValidElement)(r)?Object(u.cloneElement)(r,{disabled:n}):r}},{key:"renderNext",value:function(t){var e=this.props,i=e.nextIcon,r=(0,e.itemRender)(t,"next",this.getItemIcon(i,"next page")),n=!this.hasNext();return Object(u.isValidElement)(r)?Object(u.cloneElement)(r,{disabled:n}):r}},{key:"render",value:function(){var t=this,e=this.props,i=e.prefixCls,s=e.className,a=e.style,o=e.disabled,l=e.hideOnSinglePage,c=e.total,d=e.locale,g=e.showQuickJumper,v=e.showLessItems,m=e.showTitle,y=e.showTotal,E=e.simple,S=e.itemRender,k=e.showPrevNextJumpers,w=e.jumpPrevIcon,x=e.jumpNextIcon,T=e.selectComponentClass,O=e.selectPrefixCls,A=e.pageSizeOptions,L=this.state,R=L.current,_=L.pageSize,D=L.currentInputValue;if(!0===l&&c<=_)return null;var I=C(void 0,this.state,this.props),M=[],P=null,N=null,j=null,B=null,F=null,U=g&&g.goButton,G=v?1:2,H=R-1>0?R-1:0,z=R+1=2*G&&3!==R&&(M[0]=Object(u.cloneElement)(M[0],{className:"".concat(i,"-item-after-jump-prev")}),M.unshift(P)),I-R>=2*G&&R!==I-2&&(M[M.length-1]=Object(u.cloneElement)(M[M.length-1],{className:"".concat(i,"-item-before-jump-next")}),M.push(N)),1!==$&&M.unshift(j),J!==I&&M.push(B)}var tt=null;y&&(tt=h.a.createElement("li",{className:"".concat(i,"-total-text")},y(c,[0===c?0:(R-1)*_+1,R*_>c?c:R*_])));var et=!this.hasPrev()||!I,it=!this.hasNext()||!I;return h.a.createElement("ul",Object(r.a)({className:f()(i,s,Object(n.a)({},"".concat(i,"-disabled"),o)),style:a,unselectable:"unselectable",ref:this.savePaginationNode},V),tt,h.a.createElement("li",{title:m?d.prev_page:null,onClick:this.prev,tabIndex:et?null:0,onKeyPress:this.runIfEnterPrev,className:f()("".concat(i,"-prev"),Object(n.a)({},"".concat(i,"-disabled"),et)),"aria-disabled":et},this.renderPrev(H)),M,h.a.createElement("li",{title:m?d.next_page:null,onClick:this.next,tabIndex:it?null:0,onKeyPress:this.runIfEnterNext,className:f()("".concat(i,"-next"),Object(n.a)({},"".concat(i,"-disabled"),it)),"aria-disabled":it},this.renderNext(z)),h.a.createElement(b,{disabled:o,locale:d,rootPrefixCls:i,selectComponentClass:T,selectPrefixCls:O,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:R,pageSize:_,pageSizeOptions:A,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:U}))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var i={};if("current"in t&&(i.current=t.current,t.current!==e.current&&(i.currentInputValue=i.current)),"pageSize"in t&&t.pageSize!==e.pageSize){var r=e.current,n=C(t.pageSize,e,t);r=r>n?n:r,"current"in t||(i.current=r,i.currentInputValue=r),i.pageSize=t.pageSize}return i}}]),i}(h.a.Component);k.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:S,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:S,locale:E.a,style:{},itemRender:function(t,e,i){return i},totalBoundaryShowSizeChanger:50};var w=k},"6RRn":
/*!*******************************************!*\
!*** ./node_modules/rc-table/es/index.js ***!
\*******************************************/
/*! exports provided: Summary, Column, ColumnGroup, INTERNAL_COL_DEFINE, default */
/*! exports used: INTERNAL_COL_DEFINE, Summary, default */function(t,e,i){"use strict";var r=i(/*! ./Table */"wCXF"),n=i(/*! ./Footer */"n6Qo");i.d(e,"b",(function(){return n.a}));i(/*! ./sugar/Column */"IBYe"),i(/*! ./sugar/ColumnGroup */"6eGT");var s=i(/*! ./utils/legacyUtil */"hW8S");i.d(e,"a",(function(){return s.a})),e.c=r.b},"6eGT":
/*!*******************************************************!*\
!*** ./node_modules/rc-table/es/sugar/ColumnGroup.js ***!
\*******************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,i){"use strict";e.a=function(t){return null}},"815F":
/*!***************************************************!*\
!*** ./node_modules/rc-tree/es/utils/treeUtil.js ***!
\***************************************************/
/*! exports provided: getKey, warningWithoutKey, convertTreeToData, flattenTreeData, traverseDataNodes, convertDataToEntities, getTreeNodeProps, convertNodePropsToEventData */
/*! exports used: convertDataToEntities, convertNodePropsToEventData, convertTreeToData, flattenTreeData, getKey, getTreeNodeProps */function(t,e,i){"use strict";i.d(e,"e",(function(){return c})),i.d(e,"c",(function(){return u})),i.d(e,"d",(function(){return h})),i.d(e,"a",(function(){return f})),i.d(e,"f",(function(){return p})),i.d(e,"b",(function(){return g}));var r=i(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),n=i(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),s=i(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),a=i(/*! rc-util/es/Children/toArray */"Zm9Q"),o=i(/*! rc-util/es/warning */"Kwbf"),l=i(/*! ../util */"OZM5");function c(t,e){return null!=t?t:e}function u(t){return function t(e){return Object(a.a)(e).map((function(e){if(!Object(l.i)(e))return Object(o.a)(!e,"Tree/TreeNode can only accept TreeNode as children."),null;var i=e.key,r=e.props,a=r.children,c=Object(s.a)(r,["children"]),u=Object(n.a)({key:i},c),h=t(a);return h.length&&(u.children=h),u})).filter((function(t){return t}))}(t)}function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=new Set(!0===e?[]:e),s=[];function a(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.map((function(u,h){var d=Object(l.h)(o?o.pos:"0",h),f=c(u.key,d),p=Object(n.a)(Object(n.a)({},u),{},{parent:o,pos:d,children:null,data:u,isStart:[].concat(Object(r.a)(o?o.isStart:[]),[0===h]),isEnd:[].concat(Object(r.a)(o?o.isEnd:[]),[h===t.length-1])});return s.push(p),!0===e||i.has(f)?p.children=a(u.children||[],p):p.children=[],p}))}return a(t),s}function d(t,e,i){var r;i?"string"==typeof i?r=function(t){return t[i]}:"function"==typeof i&&(r=function(t){return i(t)}):r=function(t,e){return c(t.key,e)},function i(n,s,a){var o=n?n.children:t,c=n?Object(l.h)(a.pos,s):"0";if(n){var u=r(n,c),h={node:n,index:s,pos:c,key:u,parentPos:a.node?a.pos:null,level:a.level+1};e(h)}o&&o.forEach((function(t,e){i(t,e,{node:n,pos:c,level:a?a.level+1:-1})}))}(null)}function f(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.initWrapper,r=e.processEntity,n=e.onProcessFinished,s=arguments.length>2?arguments[2]:void 0,a={},o={},l={posEntities:a,keyEntities:o};return i&&(l=i(l)||l),d(t,(function(t){var e=t.node,i=t.index,n=t.pos,s=t.key,u=t.parentPos,h={node:e,index:i,key:s,pos:n,level:t.level},d=c(s,n);a[n]=h,o[d]=h,h.parent=a[u],h.parent&&(h.parent.children=h.parent.children||[],h.parent.children.push(h)),r&&r(h,l)}),s),n&&n(l),l}function p(t,e){var i=e.expandedKeys,r=e.selectedKeys,n=e.loadedKeys,s=e.loadingKeys,a=e.checkedKeys,o=e.halfCheckedKeys,l=e.dragOverNodeKey,c=e.dropPosition,u=e.keyEntities[t];return{eventKey:t,expanded:-1!==i.indexOf(t),selected:-1!==r.indexOf(t),loaded:-1!==n.indexOf(t),loading:-1!==s.indexOf(t),checked:-1!==a.indexOf(t),halfChecked:-1!==o.indexOf(t),pos:String(u?u.pos:""),dragOver:l===t&&0===c,dragOverGapTop:l===t&&-1===c,dragOverGapBottom:l===t&&1===c}}function g(t){var e=t.data,i=t.expanded,r=t.selected,s=t.checked,a=t.loaded,l=t.loading,c=t.halfChecked,u=t.dragOver,h=t.dragOverGapTop,d=t.dragOverGapBottom,f=t.pos,p=t.active,g=Object(n.a)(Object(n.a)({},e),{},{expanded:i,selected:r,checked:s,loaded:a,loading:l,halfChecked:c,dragOver:u,dragOverGapTop:h,dragOverGapBottom:d,pos:f,active:p});return"props"in g||Object.defineProperty(g,"props",{get:function(){return Object(o.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),t}}),g}},"8hTe":
/*!******************************************************!*\
!*** ./src/components/RenderHtml/index.less?modules ***!
\******************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){t.exports={button:"button___1wy9m"}},"9Bee":
/*!*********************************************************!*\
!*** ./src/components/RenderHtml/index.tsx + 3 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/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.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/PreviewAll/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
/*! 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/space/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/space/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/hls.js/dist/hls.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/katex/dist/katex.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/lib/marked.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/src/helpers.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,i){"use strict";i("DYRE");var r=i("zeV3"),n=(i("+L6B"),i("2/Rp")),s=i("k1fw"),a=i("9og8"),o=i("tJVT"),l=i("WmNS"),c=i.n(l),u=i("q1tI"),h=i.n(u),d=(i("vg9a"),i("DlQD")),f=i.n(d),p=i("rUJ1");var g=[],v=[""],m=new f.a.Renderer,y=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function b(){g.length=0,v=[""]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(){return function t(e,i,r,n){if(i>=e.length||e[i].level<=r)return i;var s=e[i];n.push("- "+s.text+"");var a=[];return i=t(e,++i,s.level,a),a.length>0&&(n.push("
"),a.forEach((function(t){n.push(t)})),n.push("
")),n.push(" "),i=t(e,i,r,n)}(g,0,0,v),v.push("
"),v.join("")}var C={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 i=e[0],r=function(t,e){var i=t.match(/^(\s+)(?:```)/);if(null===i)return e;var r=i[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:Object(o.a)(e,1)[0].length>=r.length?t.slice(r.length):t})).join("\n")}(i,e[3]||""),n=e[2]?e[2].trim():e[2];if(["latex","katex","math"].indexOf(n)>=0){var s=x(),a=r;r=s,T[s]={type:"block",expression:a}}return{type:"code",raw:i,lang:n,text:r}}}},k=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,x=function(){return"__special_katext_id_".concat(w++,"__")},T={};function O(){w=0,T={}}function A(t){return t=t.replace(k,(function(t,e){var i=x();return T[i]={type:"inline",expression:e},i}))}var L=m.listitem;m.listitem=function(t){return L(A(t))};var R=m.paragraph;m.paragraph=function(t){return R(A(t))};var _=m.tablecell;m.tablecell=function(t,e){return _(A(t),e)},m.code=function(t,e,i){var r=(e||"").match(/\S*/)[0];return r?["latex","katex","math"].indexOf(r)>=0?"".concat(t,"
"):'
').concat(i?t:Object(p.escape)(t,!0),"
\n"):''+(i?t:Object(p.escape)(t,!0))+"
"},m.heading=function(t,e,i){var r=this.options.headerPrefix+i.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return g.push({anchor:r,level:e,text:t}),"'+t+""},f.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),f.a.use({tokenizer:C,renderer:m});var D=f.a,I=(i("SJMd"),i("ulZh")),M=i.n(I),P=i("m3rI"),N=i("Oy/b"),j=i("p5ED"),B=i("ErOA"),F=function(t,e){return(F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function U(t,e){function i(){this.constructor=t}F(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function G(t,e,i,r){return new(i||(i=Promise))((function(n,s){function a(t){try{l(r.next(t))}catch(t){s(t)}}function o(t){try{l(r.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((r=r.apply(t,e||[])).next())}))}function H(t,e){var i,r,n,s,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]',"select"),this.addActionButton(i,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(i,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(i,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(i,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(i,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(i,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(i,'',"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 i=document.createElement("div");i.className=""+e.toolbarButtonStyleClass.name,i.setAttribute("data-type-name",t.typeName),i.innerHTML=t.icon,i.addEventListener("click",(function(){e.markerToolbarButtonClicked(i,t)})),e.buttons.push(i),e.markerButtons.push(i)})),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 r=document.createElement("div");r.className=this.toolbarBlockStyleClass.name,r.style.whiteSpace="nowrap",r.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(r),this.addActionButton(r,'',"render"),this.addActionButton(r,'',"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}(),Q=function(){function t(t,e,i,r){this.panels=[],this.panelButtons=[],this.markerjsContainer=t,this.displayMode=e,this.uiStyleSettings=i,this.styles=r,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return t.prototype.addStyles=function(){var t;this.toolboxStyleClass=this.styles.addClass(new $("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 $("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new $("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new $("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new $("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 $("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 $("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 $("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new $("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new q("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new q("."+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,i,r=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!==(i=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==i?i:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach((function(t){var e;t.uiStyleSettings=r.uiStyleSettings;var i=document.createElement("div");i.className=r.toolboxButtonStyleClass.name+" "+(null!==(e=r.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==e?e:r.toolboxButtonStyleColorsClass.name),i.innerHTML=t.icon,i.title=t.title,i.addEventListener("click",(function(){r.panelButtonClick(t)})),r.panelButtons.push(i),r.buttonRow.appendChild(i)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},t.prototype.panelButtonClick=function(t){var e=this,i=-1;if(t!==this.activePanel){i=this.panels.indexOf(t),this.panelRow.innerHTML="";var r=t.getUi();r.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(r),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,r){var n,s;t.className=e.toolboxButtonStyleClass.name+" "+(r===i?""+(null!==(n=e.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==n?n:e.toolboxActiveButtonStyleColorsClass.name):""+(null!==(s=e.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==s?s:e.toolboxButtonStyleColorsClass.name))}))},t}(),Z=function(t,e){this.title=t,this.icon=e},tt=function(t){function e(e,i,r,n){var s=t.call(this,e,n||'')||this;return s.colors=[],s.addTransparent=!1,s.colorBoxes=[],s.colors=i,s.currentColor=r,s.setCurrentColor=s.setCurrentColor.bind(s),s.getColorBox=s.getColorBox.bind(s),s}return U(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(i){var r=t.getColorBox(i);e.appendChild(r),t.colorBoxes.push(r)})),e},e.prototype.getColorBox=function(t){var e=this,i=this.uiStyleSettings.toolbarHeight/4,r=this.uiStyleSettings.toolbarHeight-i,n=document.createElement("div");n.style.display="inline-block",n.style.boxSizing="content-box",n.style.width=r-2+"px",n.style.height=r-2+"px",n.style.padding="1px",n.style.marginRight="2px",n.style.marginBottom="2px",n.style.borderWidth="2px",n.style.borderStyle="solid",n.style.borderRadius=(r+2)/2+"px",n.style.borderColor=t===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",n.addEventListener("click",(function(){e.setCurrentColor(t,n)}));var s=document.createElement("div");return s.style.display="inline-block",s.style.width=r-2+"px",s.style.height=r-2+"px",s.style.backgroundColor=t,s.style.borderRadius=r/2+"px","transparent"===t&&(s.style.fill=this.uiStyleSettings.toolboxAccentColor,s.innerHTML=''),n.appendChild(s),n},e.prototype.setCurrentColor=function(t,e){var i=this;this.currentColor=t,this.colorBoxes.forEach((function(t){t.style.borderColor=t===e?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(t)},e}(Z),et=function(){function t(t,e,i){this._state="new",this._isSelected=!1,this._container=t,this._overlayContainer=e,this.globalSettings=i,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}(),it=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}(),rt=function(){function t(){this.GRIP_SIZE=10,this.visual=V.createGroup(),this.visual.appendChild(V.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(V.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}(),nt=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}(),st=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.left=0,n.top=0,n.width=0,n.height=0,n.defaultSize={x:50,y:20},n.offsetX=0,n.offsetY=0,n.rotationAngle=0,n.CB_DISTANCE=10,n._suppressMarkerCreateEvent=!1,n.container.transform.baseVal.appendItem(V.createTransform()),n.setupControlBox(),n}return U(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=V.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,i){t.prototype.pointerDown.call(this,e,i),"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 r=this.unrotatePoint(e);if(this.manipulationStartX=r.x,this.manipulationStartY=r.y,this.offsetX=r.x-this.left,this.offsetY=r.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(i),void 0!==this.activeGrip)this._state="resize";else if(void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(i)){this.activeGrip=this.rotatorGrip;var n=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=n.x-this.width/2,this.top=n.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var s=this.container.transform.baseVal.getItem(0);s.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(s,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},e.prototype.pointerUp=function(e){var i=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"===i&&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,i=this.manipulationStartWidth,r=this.manipulationStartTop,n=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:e=this.manipulationStartLeft+t.x-this.manipulationStartX,i=this.manipulationStartWidth+this.manipulationStartLeft-e;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:i=this.manipulationStartWidth+t.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:r=this.manipulationStartTop+t.y-this.manipulationStartY,n=this.manipulationStartHeight+this.manipulationStartTop-r;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:n=this.manipulationStartHeight+t.y-this.manipulationStartY}i>=0?(this.left=e,this.width=i):(this.left=e+i,this.width=-i),n>=0?(this.top=r,this.height=n):(this.top=r+n,this.height=-n),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(),i=V.createPoint(t.x,t.y);return{x:(i=i.matrixTransform(e)).x,y:i.y}},e.prototype.unrotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM();e=e.inverse();var i=V.createPoint(t.x,t.y);return{x:(i=i.matrixTransform(e)).x,y:i.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=V.createGroup();var t=V.createTransform();t.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(t),this.container.appendChild(this.controlBox),this.controlRect=V.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=V.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 it,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 rt;return t.visual.transform.baseVal.appendItem(V.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.controlGrips.topLeft.GRIP_SIZE,e=-t/2,i=e,r=(this.width+this.CB_DISTANCE)/2-t/2,n=(this.height+this.CB_DISTANCE)/2-t/2,s=this.height+this.CB_DISTANCE-t/2,a=this.width+this.CB_DISTANCE-t/2;this.positionGrip(this.controlGrips.topLeft.visual,e,i),this.positionGrip(this.controlGrips.topCenter.visual,r,i),this.positionGrip(this.controlGrips.topRight.visual,a,i),this.positionGrip(this.controlGrips.centerLeft.visual,e,n),this.positionGrip(this.controlGrips.centerRight.visual,a,n),this.positionGrip(this.controlGrips.bottomLeft.visual,e,s),this.positionGrip(this.controlGrips.bottomCenter.visual,r,s),this.positionGrip(this.controlGrips.bottomRight.visual,a,s),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,r,i-3*this.CB_DISTANCE)},e.prototype.positionGrip=function(t,e,i){var r=t.transform.baseVal.getItem(0);r.setTranslate(e,i),t.transform.baseVal.replaceItem(r,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:nt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:nt.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 i=e;this.left=i.left,this.top=i.top,this.width=i.width,this.height=i.height,this.rotationAngle=i.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(nt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,i.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(nt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,i.containerTransformMatrix))},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i);var r=this.rotatePoint({x:this.left,y:this.top}),n=this.unrotatePoint({x:r.x*e,y:r.y*i});this.left=n.x,this.top=n.y,this.width=this.width*e,this.height=this.height*i,this.adjustControlBox()},e}(et),at=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.fillColor="transparent",n.strokeColor="transparent",n.strokeWidth=0,n.strokeDasharray="",n.opacity=1,n.setStrokeColor=n.setStrokeColor.bind(n),n.setFillColor=n.setFillColor.bind(n),n.setStrokeWidth=n.setStrokeWidth.bind(n),n.setStrokeDasharray=n.setStrokeDasharray.bind(n),n.createVisual=n.createVisual.bind(n),n}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=V.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,i){t.prototype.pointerDown.call(this,e,i),"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),V.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&&V.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&V.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&V.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&V.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 i=e;this.fillColor=i.fillColor,this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.opacity=i.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setSize()},e.title="Rectangle marker",e}(st),ot=function(t){function e(e,i,r,n){var s=t.call(this,e,n||'')||this;return s.widths=[],s.widthBoxes=[],s.widths=i,s.currentWidth=r,s.setCurrentWidth=s.setCurrentWidth.bind(s),s}return U(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(i){var r=document.createElement("div");r.style.display="flex",r.style.flexGrow="2",r.style.alignItems="center",r.style.justifyContent="space-between",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderColor=i===t.currentWidth?t.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentWidth(i,r)})),e.appendChild(r);var n=document.createElement("div");n.innerText=i.toString(),n.style.marginRight="5px",r.appendChild(n);var s=document.createElement("div");s.style.minHeight="20px",s.style.flexGrow="2",s.style.display="flex",s.style.alignItems="center";var a=document.createElement("hr");a.style.minWidth="20px",a.style.border="0px",a.style.borderTop=i+"px solid "+t.uiStyleSettings.toolboxColor,a.style.flexGrow="2",s.appendChild(a),r.appendChild(s),t.widthBoxes.push(r)})),e},e.prototype.setCurrentWidth=function(t,e){var i=this;this.currentWidth=t,this.widthBoxes.forEach((function(t){t.style.borderColor=t===e?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},e}(Z),lt=function(t){function e(e,i,r,n){var s=t.call(this,e,n||'')||this;return s.styles=[],s.styleBoxes=[],s.styles=i,s.currentStyle=r,s.setCurrentStyle=s.setCurrentStyle.bind(s),s}return U(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(i){var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="space-between",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.overflow="hidden",r.style.maxWidth=100/t.styles.length-5+"%",r.style.borderColor=i===t.currentStyle?t.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentStyle(i,r)})),e.appendChild(r);var n=document.createElement("div");n.style.minHeight="20px",n.style.flexGrow="2",n.style.overflow="hidden";var s='";n.innerHTML=s,r.appendChild(n),t.styleBoxes.push(r)})),e},e.prototype.setCurrentStyle=function(t,e){var i=this;this.currentStyle=t,this.styleBoxes.forEach((function(t){t.style.borderColor=t===e?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},e}(Z),ct=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.strokeColor=r.defaultColor,n.strokeWidth=r.defaultStrokeWidth,n.strokeDasharray=r.defaultStrokeDasharray,n.strokePanel=new tt("Line color",r.defaultColorSet,r.defaultColor),n.strokePanel.onColorChanged=n.setStrokeColor,n.strokeWidthPanel=new ot("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),n.strokeWidthPanel.onWidthChanged=n.setStrokeWidth,n.strokeStylePanel=new lt("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),n.strokeStylePanel.onStyleChanged=n.setStrokeDasharray,n}return U(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 i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},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,i,r){var n=t.call(this,e,i,r)||this;return n.x1=0,n.y1=0,n.x2=0,n.y2=0,n.defaultLength=50,n.manipulationStartX=0,n.manipulationStartY=0,n.manipulationStartX1=0,n.manipulationStartY1=0,n.manipulationStartX2=0,n.manipulationStartY2=0,n.setupControlBox(),n}return U(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,i){t.prototype.pointerDown.call(this,e,i),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(i)?this.activeGrip=this.grip1:this.grip2.ownsTarget(i)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},e.prototype.pointerUp=function(e){var i=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"===i&&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=V.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 rt;return t.visual.transform.baseVal.appendItem(V.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,i){var r=t.transform.baseVal.getItem(0);r.setTranslate(e,i),t.transform.baseVal.replaceItem(r,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 i=e;this.x1=i.x1,this.y1=i.y1,this.x2=i.x2,this.y2=i.y2},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.x1=this.x1*e,this.y1=this.y1*i,this.x2=this.x2*e,this.y2=this.y2*i,this.adjustVisual(),this.adjustControlBox()},e}(et),dt=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.strokeColor="transparent",n.strokeWidth=0,n.strokeDasharray="",n.setStrokeColor=n.setStrokeColor.bind(n),n.setStrokeWidth=n.setStrokeWidth.bind(n),n.setStrokeDasharray=n.setStrokeDasharray.bind(n),n.strokeColor=r.defaultColor,n.strokeWidth=r.defaultStrokeWidth,n.strokeDasharray=r.defaultStrokeDasharray,n.strokePanel=new tt("Line color",r.defaultColorSet,r.defaultColor),n.strokePanel.onColorChanged=n.setStrokeColor,n.strokeWidthPanel=new ot("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),n.strokeWidthPanel.onWidthChanged=n.setStrokeWidth,n.strokeStylePanel=new lt("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),n.strokeStylePanel.onStyleChanged=n.setStrokeDasharray,n}return U(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=V.createGroup(),this.selectorLine=V.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=V.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,i){t.prototype.pointerDown.call(this,e,i),"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()),V.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),V.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),V.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 i=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.createVisual(),this.adjustVisual()},e.typeName="LineMarker",e.title="Line marker",e.icon='',e}(ht),ft=function(t){function e(e,i,r,n){var s=t.call(this,e,n||'')||this;return s.fonts=[],s.fontBoxes=[],s.fonts=i,s.currentFont=r,s.setCurrentFont=s.setCurrentFont.bind(s),s}return U(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(i){var r=document.createElement("div");r.style.display="inline-block",r.style.alignItems="center",r.style.justifyContent="space-between",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.overflow="hidden",r.style.maxWidth=100/t.fonts.length-5+"%",r.style.borderColor=i===t.currentFont?t.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentFont(i,r)})),e.appendChild(r);var n=document.createElement("div");n.style.display="flex",n.style.minHeight="20px",n.style.flexGrow="2",n.style.fontFamily=i,n.style.overflow="hidden";var s=document.createElement("div");s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",s.innerHTML="The quick brown fox jumps over the lazy dog",n.appendChild(s),r.appendChild(n),t.fontBoxes.push(r)})),e},e.prototype.setCurrentFont=function(t,e){var i=this;this.currentFont=t,this.fontBoxes.forEach((function(t){t.style.borderColor=t===e?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},e}(Z),pt=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.color="transparent",n.padding=5,n.DEFAULT_TEXT="your text here",n.text=n.DEFAULT_TEXT,n.isMoved=!1,n.color=r.defaultColor,n.fontFamily=r.defaultFontFamily,n.defaultSize={x:100,y:30},n.setColor=n.setColor.bind(n),n.setFont=n.setFont.bind(n),n.renderText=n.renderText.bind(n),n.sizeText=n.sizeText.bind(n),n.textEditDivClicked=n.textEditDivClicked.bind(n),n.showTextEditor=n.showTextEditor.bind(n),n.setSize=n.setSize.bind(n),n.positionTextEditor=n.positionTextEditor.bind(n),n.colorPanel=new tt("Color",r.defaultColorSet,r.defaultColor),n.colorPanel.onColorChanged=n.setColor,n.fontFamilyPanel=new ft("Font",r.defaultFontFamilies,r.defaultFontFamily),n.fontFamilyPanel.onFontChanged=n.setFont,n}return U(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 i=!1;return this.textElement.childNodes.forEach((function(t){t===e&&(i=!0)})),i},e.prototype.createVisual=function(){this.visual=V.createGroup(),this.bgRectangle=V.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=V.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(V.createTransform()),this.textElement.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),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(V.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 i=(1*this.width-this.width*this.padding*2/100)/t.width,r=(1*this.height-this.height*this.padding*2/100)/t.height;e=Math.min(i,r)}return e},e.prototype.getTextPosition=function(t){var e=this.textElement.getBBox(),i=0,r=0;return e.width>0&&e.height>0&&(i=(this.width-e.width*t)/2,r=this.height/2-e.height*t/2),{x:i,y:r}},e.prototype.sizeText=function(){var t=this.textElement.getBBox(),e=this.getTextScale(),i=this.getTextPosition(e);i.y-=t.y*e,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+i.x+"px, "+i.y+"px) scale("+e+", "+e+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(i.x,i.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&&(V.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),V.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},e.prototype.pointerUp=function(e){var i=this.state;"creating"===i&&(this._suppressMarkerCreateEvent=!0),t.prototype.pointerUp.call(this,e),this.setSize(),("creating"===i||!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"),i=window.getSelection();if(!i.rangeCount)return!1;i.deleteFromDocument(),i.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}),i=this.textElement.getBBox(),r={x:i.width*t,y:i.height*t};e.x-=r.x/2,e.y-=r.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,i){t.prototype.dblClick.call(this,e,i),this.showTextEditor()},e.prototype.setColor=function(t){this.textElement&&V.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&&V.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 i=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){var i=e;this.color=i.color,this.fontFamily=i.fontFamily,this.padding=i.padding,this.text=i.text,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setSize(),this.sizeText(),this.positionTextEditor()},e.typeName="TextMarker",e.title="Text marker",e.icon='',e}(st),gt=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.color="transparent",n.lineWidth=3,n.drawing=!1,n.pixelRatio=1,n.color=r.defaultColor,n.lineWidth=r.defaultStrokeWidth,n.pixelRatio=r.freehandPixelRatio,n.setColor=n.setColor.bind(n),n.addCanvas=n.addCanvas.bind(n),n.finishCreation=n.finishCreation.bind(n),n.setLineWidth=n.setLineWidth.bind(n),n.colorPanel=new tt("Color",r.defaultColorSet,r.defaultColor),n.colorPanel.onColorChanged=n.setColor,n.lineWidthPanel=new ot("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),n.lineWidthPanel.onWidthChanged=n.setLineWidth,n}return U(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=V.createGroup(),this.drawingImage=V.createImage(),this.visual.appendChild(this.drawingImage);var t=V.createTransform();this.visual.transform.baseVal.appendItem(t),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){"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,i)},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),V.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),V.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],i=e[0],r=e[1],n=e[2],s=e[3],a=!1,o=0;o0&&(a=!0,os&&(s=o),l>n&&(n=l));if(a){this.left=i/this.pixelRatio,this.top=r/this.pixelRatio,this.width=(n-i)/this.pixelRatio,this.height=(s-r)/this.pixelRatio;var c=document.createElement("canvas");c.width=n-i,c.height=s-r,c.getContext("2d").putImageData(this.canvasContext.getImageData(i,r,n-i,s-r),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(){V.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),V.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 i=Object.assign({drawingImgUrl:this.drawingImgUrl},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){this.createVisual(),t.prototype.restoreState.call(this,e),this.drawingImgUrl=e.drawingImgUrl,this.setDrawingImage()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setDrawingImage()},e.typeName="FreehandMarker",e.title="Freehand marker",e.icon='',e}(st),vt=function(t){function e(e,i,r){var n=t.call(this,e,r||'')||this;return n.typeBoxes=[],n.currentType=i,n.setCurrentType=n.setCurrentType.bind(n),n}return U(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 i=function(i){var n="both";switch(i){case 0:n="both";break;case 1:n="start";break;case 2:n="end";break;case 3:n="none"}var s=document.createElement("div");if(s.style.display="flex",s.style.flexGrow="2",s.style.alignItems="center",s.style.justifyContent="space-between",s.style.padding="5px",s.style.borderWidth="2px",s.style.borderStyle="solid",s.style.borderColor=n===r.currentType?r.uiStyleSettings.toolboxAccentColor:"transparent",s.addEventListener("click",(function(){t.setCurrentType(n,s)})),e.appendChild(s),"both"===n||"start"===n){var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.innerHTML='',a.style.marginLeft="5px",s.appendChild(a)}var o=document.createElement("div");o.style.display="flex",o.style.alignItems="center",o.style.minHeight="20px",o.style.flexGrow="2";var l=document.createElement("hr");if(l.style.minWidth="20px",l.style.border="0px",l.style.borderTop="3px solid "+(void 0!==r.uiStyleSettings?r.uiStyleSettings.toolboxColor:"#eeeeee"),l.style.flexGrow="2",o.appendChild(l),s.appendChild(o),"both"===n||"end"===n){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.minHeight="20px",c.innerHTML='',c.style.marginRight="5px",s.appendChild(c)}r.typeBoxes.push(s)},r=this,n=0;n<4;n++)i(n);return e},e.prototype.setCurrentType=function(t,e){var i=this;this.currentType=t,this.typeBoxes.forEach((function(t){t.style.borderColor=t===e?void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},e}(Z),mt=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.arrowType="end",n.arrowBaseHeight=10,n.arrowBaseWidth=10,n.getArrowPoints=n.getArrowPoints.bind(n),n.setArrowType=n.setArrowType.bind(n),n.arrowTypePanel=new vt("Arrow type","end"),n.arrowTypePanel.onArrowTypeChanged=n.setArrowType,n}return U(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 i=this.arrowBaseWidth+2*this.strokeWidth,r=this.arrowBaseHeight+2*this.strokeWidth;return t-i/2+","+(e+r/2)+" "+t+","+(e-r/2)+" "+(t+i/2)+","+(e+r/2)},e.prototype.createTips=function(){this.arrow1=V.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=V.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.arrow2)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"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",V.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),V.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),i=this.arrow1.transform.baseVal.getItem(0);i.setRotate(e,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(i,0);var r=this.arrow2.transform.baseVal.getItem(0);r.setRotate(e+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(r,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 i=Object.assign({arrowType:this.arrowType},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.arrowType=i.arrowType,this.createTips(),this.adjustVisual()},e.typeName="ArrowMarker",e.title="Arrow marker",e.icon='',e}(dt),yt=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.fillColor=r.defaultFillColor,n.strokeWidth=0,n.fillPanel=new tt("Color",r.defaultColorSet,r.defaultFillColor),n.fillPanel.onColorChanged=n.setFillColor,n}return U(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.typeName="CoverMarker",e.title="Cover marker",e.icon='',e}(at),bt=function(t){function e(e,i,r,n){var s=t.call(this,e,n||'')||this;return s.opacities=[],s.opacityBoxes=[],s.opacities=i,s.currentOpacity=r,s.setCurrentOpacity=s.setCurrentOpacity.bind(s),s}return U(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(i){var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderColor=i===t.currentOpacity?t.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentOpacity(i,r)})),e.appendChild(r);var n=document.createElement("div");n.innerText=100*i+"%",r.appendChild(n),t.opacityBoxes.push(r)})),e},e.prototype.setCurrentOpacity=function(t,e){var i=this;this.currentOpacity=t,this.opacityBoxes.forEach((function(t){t.style.borderColor=t===e?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},e}(Z),Et=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.setOpacity=n.setOpacity.bind(n),n.fillColor=r.defaultHighlightColor,n.strokeWidth=0,n.opacity=r.defaultHighlightOpacity,n.fillPanel=new tt("Color",r.defaultColorSet,n.fillColor),n.fillPanel.onColorChanged=n.setFillColor,n.opacityPanel=new bt("Opacity",r.defaultOpacitySteps,n.opacity),n.opacityPanel.onOpacityChanged=n.setOpacity,n}return U(e,t),e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&V.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 i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.typeName="HighlightMarker",e.title="Highlight marker",e.icon='',e}(yt),St='',Ct=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.bgColor="transparent",n.tipPosition={x:0,y:0},n.tipBase1Position={x:0,y:0},n.tipBase2Position={x:0,y:0},n.tipMoving=!1,n.color=r.defaultStrokeColor,n.bgColor=r.defaultFillColor,n.fontFamily=r.defaultFontFamily,n.defaultSize={x:100,y:30},n.setBgColor=n.setBgColor.bind(n),n.getTipPoints=n.getTipPoints.bind(n),n.positionTip=n.positionTip.bind(n),n.setTipPoints=n.setTipPoints.bind(n),n.colorPanel=new tt("Text color",r.defaultColorSet,n.color,''),n.colorPanel.onColorChanged=n.setColor,n.bgColorPanel=new tt("Fill color",r.defaultColorSet,n.bgColor,St),n.bgColorPanel.onColorChanged=n.setBgColor,n.fontFamilyPanel=new ft("Font",r.defaultFontFamilies,r.defaultFontFamily),n.fontFamilyPanel.onFontChanged=n.setFont,n.tipGrip=new rt,n.tipGrip.visual.transform.baseVal.appendItem(V.createTransform()),n.controlBox.appendChild(n.tipGrip.visual),n}return U(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(){V.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=V.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},e.prototype.pointerDown=function(e,i){"new"===this.state&&t.prototype.pointerDown.call(this,e,i),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(i)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):t.prototype.pointerDown.call(this,e,i)},e.prototype.pointerUp=function(e){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,t.prototype.pointerUp.call(this,e);else{var i="creating"===this.state;t.prototype.pointerUp.call(this,e),this.setTipPoints(i),this.positionTip()}},e.prototype.manipulate=function(e){if(this.tipMoving){var i=this.unrotatePoint(e);this.tipPosition={x:i.x-this.manipulationStartLeft,y:i.y-this.manipulationStartTop},this.positionTip()}else t.prototype.manipulate.call(this,e)},e.prototype.setBgColor=function(t){this.bgRectangle&&this.tip&&(V.setAttributes(this.bgRectangle,[["fill",t]]),V.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),i=this.height/5;t&&(this.tipPosition={x:e+i/2,y:this.height+20});var r=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?r',e}(pt),kt=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.fillColor="transparent",n.strokeColor="transparent",n.strokeWidth=0,n.strokeDasharray="",n.opacity=1,n.strokeColor=r.defaultColor,n.strokeWidth=r.defaultStrokeWidth,n.strokeDasharray=r.defaultStrokeDasharray,n.fillColor=r.defaultFillColor,n.setStrokeColor=n.setStrokeColor.bind(n),n.setFillColor=n.setFillColor.bind(n),n.setStrokeWidth=n.setStrokeWidth.bind(n),n.setStrokeDasharray=n.setStrokeDasharray.bind(n),n.setOpacity=n.setOpacity.bind(n),n.createVisual=n.createVisual.bind(n),n.strokePanel=new tt("Line color",z(r.defaultColorSet,["transparent"]),r.defaultColor),n.strokePanel.onColorChanged=n.setStrokeColor,n.fillPanel=new tt("Fill color",z(r.defaultColorSet,["transparent"]),n.fillColor,St),n.fillPanel.onColorChanged=n.setFillColor,n.strokeWidthPanel=new ot("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),n.strokeWidthPanel.onWidthChanged=n.setStrokeWidth,n.strokeStylePanel=new lt("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),n.strokeStylePanel.onStyleChanged=n.setStrokeDasharray,n.opacityPanel=new bt("Opacity",r.defaultOpacitySteps,n.opacity),n.opacityPanel.onOpacityChanged=n.setOpacity,n}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=V.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"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),V.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&V.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&V.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(t),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&V.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&V.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&V.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){var i=e;this.fillColor=i.fillColor,this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.opacity=i.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setSize()},e.typeName="EllipseMarker",e.title="Ellipse marker",e.icon='',e}(st),wt=function(t){function e(e,i,r){return t.call(this,e,i,r)||this}return U(e,t),Object.defineProperty(e.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.tip1&&e!==this.tip2)},e.prototype.createTips=function(){this.tip1=V.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.tip1),this.tip2=V.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.tip2)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(V.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),V.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),i=this.tip1.transform.baseVal.getItem(0);i.setRotate(e,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(i,0);var r=this.tip2.transform.baseVal.getItem(0);r.setRotate(e+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(r,0)}},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},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),xt=function(t){function e(e,i,r){var n=t.call(this,e,i,r)||this;return n.strokePanel.colors=r.defaultColorSet,n.fillColor="transparent",n}return U(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 i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},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,i,r){var n=t.call(this,e,i,r)||this;return n.strokeColor="transparent",n.strokeWidth=0,n.strokeDasharray="",n.curveX=0,n.curveY=0,n.manipulationStartCurveX=0,n.manipulationStartCurveY=0,n.setStrokeColor=n.setStrokeColor.bind(n),n.setStrokeWidth=n.setStrokeWidth.bind(n),n.setStrokeDasharray=n.setStrokeDasharray.bind(n),n.positionGrips=n.positionGrips.bind(n),n.addControlGrips=n.addControlGrips.bind(n),n.adjustVisual=n.adjustVisual.bind(n),n.setupControlBox=n.setupControlBox.bind(n),n.resize=n.resize.bind(n),n.strokeColor=r.defaultColor,n.strokeWidth=r.defaultStrokeWidth,n.strokeDasharray=r.defaultStrokeDasharray,n.strokePanel=new tt("Line color",r.defaultColorSet,r.defaultColor),n.strokePanel.onColorChanged=n.setStrokeColor,n.strokeWidthPanel=new ot("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),n.strokeWidthPanel.onWidthChanged=n.setStrokeWidth,n.strokeStylePanel=new lt("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),n.strokeStylePanel.onStyleChanged=n.setStrokeDasharray,n}return U(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=V.createGroup(),this.selectorCurve=V.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=V.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,i){t.prototype.pointerDown.call(this,e,i),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(i)&&(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()),V.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),V.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),V.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setupControlBox=function(){t.prototype.setupControlBox.call(this),this.curveControlLine1=V.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=V.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,i){this.curveX=this.curveX*e,this.curveY=this.curveY*i,t.prototype.scale.call(this,e,i)},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.curveX=i.curveX,this.curveY=i.curveY,this.createVisual(),this.adjustVisual()},e.typeName="CurveMarker",e.title="Curve marker",e.icon='',e}(ht),At=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,i,r){var n=t.call(this,e,!1)||this;return n.dataUrl=i,n.state=r,n}return U(e,t),e}(At),Rt=function(t){function e(e,i,r){void 0===r&&(r=!1);var n=t.call(this,e,r)||this;return n.marker=i,n}return U(e,t),e}(At),_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 i=this[t].indexOf(e);i>-1&&this[t].splice(i,1)},t}(),Dt=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 X(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,gt,mt,pt,xt,kt,Et,Ct,wt,yt,dt,Ot]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ct,gt,mt,pt,kt,Et,Ct]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ct,gt,mt,pt,Et]},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 i=e.ALL_MARKER_TYPES.find((function(e){return e.typeName===t}));void 0!==i&&e._availableMarkerTypes.push(i)}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(),K.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},t.prototype.show=function(){var t=this;void 0===this.styles.styleSheetRoot&&void 0!==Y.styleSheetRoot&&(this.styles.styleSheetRoot=Y.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach((function(e){return e(new At(t))}))},t.prototype.render=function(){return G(this,void 0,void 0,(function(){var t;return H(this,(function(e){switch(e.label){case 0:return this.setCurrentMarker(),(t=new W).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 i=!1;t||this.eventListeners.beforeclose.forEach((function(t){var r=new At(e,!0);t(r),r.defaultPrevented&&(i=!0)})),i||(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 At(e))})),this.detachEvents(),this._isOpen=!1)}},t.prototype.addMarkersToToolbar=function(){for(var t,e=[],i=0;ithis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*t:this.editorCanvas.clientWidth,i=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(i){var r=new Rt(t,t._currentMarker,!0);i(r),r.defaultPrevented&&(e=!0)})),!e){var i=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 Rt(t,i))}))}}},t.prototype.clear=function(){var t=this,e=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(i){var r=new Rt(t,void 0,!0);i(r),r.defaultPrevented&&(e=!0)})),!e)){this.setCurrentMarker();for(var i=function(e){var i=r.markers[e];r.setCurrentMarker(r.markers[e]),r._currentMarker.dispose(),r.markerImage.removeChild(r._currentMarker.container),r.markers.splice(r.markers.indexOf(r._currentMarker),1),r.eventListeners.markerdelete.forEach((function(e){return e(new Rt(t,i))}))},r=this,n=this.markers.length-1;n>=0;n--)i(n);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(),i=this.undoRedoManager.getLastUndoStep();if(!i||i.width===e.width&&i.height===e.height){var r=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(e),r1&&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 i=this.markerImage.getBoundingClientRect();return{x:(t-i.left)/this.zoomLevel,y:(e-i.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){K.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 At(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 At(t))})))},t.instanceCounter=0,t}(),It=function(t,e){return(It=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(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 Mt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}It(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function Pt(t,e,i,r){return new(i||(i=Promise))((function(n,s){function a(t){try{l(r.next(t))}catch(t){s(t)}}function o(t){try{l(r.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((r=r.apply(t,e||[])).next())}))}function Nt(t,e){var i,r,n,s,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]0&&e>0){var i=new Yt(t,e),r=i.ratio>=1?20:i.getHorizontalLength(20),n=i.ratio<1?20:i.getVerticalLength(20),s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(s);var a=Bt.createDefs();s.appendChild(a);var o=Bt.createElement("clipPath",[["id","text-bg-clip"]]);a.appendChild(o);var l=Bt.createPath(Bt.getHollowRectanglePath((24-r)/2,(24-n)/2,r,n,(24-r)/2+2,(24-n)/2+2,r-4,n-4));s.appendChild(l);var c=Bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);c.appendChild(Bt.createTSpan(t+":"+e)),s.appendChild(c);var u=c.getBBox();Bt.setAttributes(c,[["x",((24-u.width)/2).toString()],["y",((24-u.height)/2-u.y).toString()]]);var h=Bt.createPath(Bt.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 o.appendChild(h),Bt.setAttributes(l,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(s),s.outerHTML}return''},t}(),qt=function(t){function e(e,i,r){var n=t.call(this,e,i)||this;return n.isDropdownOpen=!1,n.onClick=n.dropdownButtonClicked,n.dropdownButtons=r,n}return Mt(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}(Kt),$t=function(){function t(t,e){this.GRIP_SIZE=10,this.color=t,this.fillColor=e,this.visual=Bt.createGroup(),this.visual.appendChild(Bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Bt.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(i){return Bt.setAttributes(i,[["cx",t.toString()],["cy",e.toString()]])}))},t}(),Jt=function(){function t(t,e,i,r){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=i,this.container=r,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&&Bt.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=Bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Bt.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),Bt.setAttributes(this.cropRectElement,[["x",e.x.toString()],["y",e.y.toString()],["width",e.width.toString()],["height",e.height.toString()]]);var i=e.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach((function(t,r){var n=e.y+i*(r+1);Bt.setAttributes(t,[["x1",""+e.x],["y1",""+n],["x2",""+(e.x+e.width)],["y2",""+n]])}));var r=e.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach((function(t,i){var n=e.x+r*(i+1);Bt.setAttributes(t,[["x1",""+n],["y1",""+e.y],["x2",""+n],["y2",""+(e.y+e.height)]])})),Bt.setAttributes(this.cropShadeElement,[["d",Bt.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 i=this.container.getBoundingClientRect();return{x:t-i.left+this.margin,y:e-i.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,i=t.y-this.previousPoint.y;1!==this.zoomFactor&&(e=-e/this.zoomFactor,i=-i/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+i),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),i=t.x-this.previousPoint.x,r=t.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:e.x+ithis.canvasWidth*this.zoomFactor&&(i=this.canvasWidth*this.zoomFactor-e.width),e.width+=i}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(i),e.height=this.aspectRatio.getVerticalLength(e.width)):(e.y+=r,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+=r}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,i=this.aspectRatio.getHorizontalLength(this.cropRect.height),r=this.aspectRatio.getVerticalLength(this.cropRect.width);i/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,i,r,n,s){var a=i/t,o=r/e;return{x:(n.x-s)*a+s,y:(n.y-s)*o+s,width:n.width*a,height:n.height*o}},t.prototype.scaleCanvas=function(t,e){var i=this.getRescaledRect(this.canvasWidth,this.canvasHeight,t,e,this.cropRect,this.margin);this.canvasWidth=t,this.canvasHeight=e,this.onCropChange&&this.onCropChange(i),this.setCropRectangle(i)},t}(),Qt=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();Bt.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,i=1;i<=this.width/5+10;i++){var r=i%5==0?this.height/3:this.height/6;e+="h4v"+-r+"h1v"+r}e+="v1H0Z",this.scaleShape=Bt.createPath(e);var n=Bt.createTransform();this.scaleShape.transform.baseVal.appendItem(n),t.appendChild(this.scaleShape),this.angleLabelElement=Bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var s=Bt.createTSpan("");return s.innerHTML="°",this.angleLabelElement.appendChild(s),t.appendChild(this.angleLabelElement),document.body.removeChild(t),t},t}(),Zt=function(){function t(){this.naturalSize=!1,this.imageType="image/png"}return t.prototype.rasterize=function(t,e,i,r,n,s,a){var o=this;return new Promise((function(l){var c=document.createElement("canvas");c.width=t.width.baseVal.value-2*r,c.height=t.height.baseVal.value-2*r;var u=1,h=1;!0===o.naturalSize?(u=e.naturalWidth/(t.width.baseVal.value-2*r)/s,h=e.naturalHeight/(t.height.baseVal.value-2*r)/a,c.width=e.naturalWidth/s,c.height=e.naturalHeight/a):void 0!==o.width&&void 0!==o.height&&(u=o.width/i.width,h=o.height/i.height,c.width*=u,c.height*=h);var d=c.getContext("2d");d.translate(c.width/2,c.height/2),d.rotate(n*Math.PI/180),d.scale(s,a),d.translate(-c.width/2,-c.height/2),d.drawImage(e,0,0,c.width,c.height);var f=document.createElement("canvas");f.width=i.width*u,f.height=i.height*h,f.getContext("2d").putImageData(d.getImageData((i.x-r)*u,(i.y-r)*h,i.width*u,i.height*h),0,0),l(f.toDataURL(o.imageType,o.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 Ft(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,i=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 Ht,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 Vt;e.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(e);var i=[];this.aspectRatios.forEach((function(e){var r=new Kt(Xt.getIcon(e.horizontal,e.vertical),0===e.horizontal&&0===e.vertical?"FREE":e.horizontal+":"+e.vertical);r.onClick=function(){return t.ratioButtonClicked(e)},i.push(r)})),this.aspectRatioButton=new qt(Xt.getIcon(0,0),"Aspect ratio",i),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 r=new Kt('',"Toggle grid");r.isActive=this.isGridVisible,r.onClick=function(){t.isGridVisible=!t.isGridVisible,r.isActive=t.isGridVisible},e.addButton(r);var n=new Kt('',"Zoom to selection");if(n.isActive=this.zoomToCropEnabled,n.onClick=function(){t.zoomToCropEnabled=!t.zoomToCropEnabled,n.isActive=t.zoomToCropEnabled},e.addButton(n),!jt.isLicensed){var s=new Wt;this.topToolbar.addElementBlock(s);var a=document.createElement("div");a.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var o=document.createElement("a");o.style.color="currentColor",o.href="https://markerjs.com/products/cropro",o.target="_blank",o.innerHTML='',a.appendChild(o),s.addElement(a)}var l=new Vt;l.minWidth=3*this.toolbarHeight+"px",l.contentAlign="end",this.topToolbar.addButtonBlock(l);var c=new Kt('',"OK");c.onClick=this.startRenderAndClose,l.addButton(c),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(c.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var u=new Kt('',"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 Ht,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 Vt;e.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(e);var i=new Kt('',"Rotate left");i.onClick=this.rotateLeftButtonClicked,e.addButton(i);var r=new Kt('',"Rotate right");r.onClick=this.rotateRightButtonClicked,e.addButton(r);var n=new Wt;n.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(n),this.straightener=new Qt("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},n.addElement(this.straightener.getUI());var s=new Vt;s.minWidth=2*this.toolbarHeight+"px",s.contentAlign="end",this.bottomToolbar.addButtonBlock(s);var a=new Kt('',"Flip horizontal");a.onClick=this.flipHorizontallyButtonClicked,s.addButton(a);var o=new Kt('',"Flip vertical");o.onClick=this.flipVerticallyButtonClicked,s.addButton(o)},t.prototype.ratioButtonClicked=function(t){this.aspectRatio=t,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},t.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Xt.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 Yt(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 i=this.cropImage.getBoundingClientRect();return{x:t-i.left,y:e-i.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 i=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/i.width,this.imageHeight/i.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 Pt(this,void 0,void 0,(function(){var t,e;return Nt(this,(function(i){switch(i.label){case 0:return[4,this.render()];case 1:return t=i.sent(),e=this.getState(),this.renderEventListeners.forEach((function(i){return i(t,e)})),this.close(!0),[2]}}))}))},t.prototype.render=function(){return Pt(this,void 0,void 0,(function(){var t;return Nt(this,(function(e){switch(e.label){case 0:return(t=new Zt).naturalSize=this.renderAtNaturalSize,t.imageType=this.renderImageType,t.imageQuality=this.renderImageQuality,t.width=this.renderWidth,t.height=this.renderHeight,this.unzoomFromCrop(),Bt.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 Gt("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 Gt("toolbar_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new Gt("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 Gt("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 Gt("toolbar_button_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Gt("toolbar_active_button","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n background-color: "+this.styles.settings.toolbarBackgroundActiveColor+"\n ")),this.styles.addRule(new Ut("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.toolbarHeight/2+"px;\n ")),this.styles.addRule(new Ut("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.styles.settings.toolbarBackgroundHoverColor+"\n ")),this.toolbarDropdownStyleClass=this.styles.addClass(new Gt("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 Gt("toolbar_dropdown_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Gt("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 Gt("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 Gt("toolbar_straightener_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n "))},t.instanceCounter=0,t}(),ee=i("8hTe"),ie=i.n(ee),re=/]*>/g;e.a=function(t){var e=t.value,i=void 0===e?"":e,l=t.edit,d=void 0!==l&&l,f=t.className,p=t.showTextOnly,g=t.showLines,v=t.replaces,m=t.zoomImg,y=t.hasMask,C=t.style,k=void 0===C?{}:C,w=t.stylesPrev,x=void 0===w?{}:w,A=String(i),L=Object(u.useRef)(),R=Object(u.useRef)(),_=Object(u.useState)(""),I=Object(o.a)(_,2),F=I[0],U=I[1],G=Object(u.useState)("office"),H=Object(o.a)(G,2),z=H[0],V=H[1],K=Object(u.useMemo)((function(){try{A=(A=A.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+P.a.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+P.a.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+P.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]
",S()),b()),t=(t=t.replace(/(__special_katext_id_\d+__)/g,(function(t,i){var r=e[i],n=r.type,s=r.expression;return Object(N.renderToString)(function(t){var e=document.createElement("div");return e.innerHTML=t,0===e.childNodes.length?"":e.childNodes[0].nodeValue}(s)||"",{displayMode:"block"===n,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),O(),p){var i=document.createElement("div");return i.innerHTML=t,i.innerText}return setTimeout((function(){return X()}),500),t}),[A]),W=Object(u.useRef)();function Y(t){var e=t.target;if("IMG"===e.tagName.toUpperCase()){if(m){var i=e.getAttribute("src");U(i),V("image")}}else if("A"===e.tagName.toUpperCase()){var r=e.getAttribute("href");if(r.indexOf("office")>-1)t.preventDefault(),U(r),V("office");else if(r.indexOf("application/pdf")>-1)t.preventDefault(),U(r),V("pdf");else if(r.indexOf("type=text")>-1)t.preventDefault(),U(r),V("html");else if(r.startsWith("#")){t.preventDefault();var n=document.getElementById(r.replace("#",""));n&&n.scrollIntoView(!0)}}}E.WebkitLineClamp=g,g&&(k=Object(s.a)(Object(s.a)({},k),E));var X=function(){var t,e=null===(t=W.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(M.a.isSupported()){var e=new M.a;e.loadSource(t.src),e.attachMedia(t)}}))};Object(u.useEffect)((function(){if(W.current&&K&&K.match(re)&&window.PR.prettyPrint(),W.current)return W.current.addEventListener("click",Y),function(){W.current.removeEventListener("click",Y),O(),b()}}),[K,W.current,Y]);return h.a.createElement("div",{style:{position:"relative"}},h.a.createElement("div",{ref:W,style:Object(s.a)({},k),className:"".concat(f||""," markdown-body ").concat(ie.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",R.current.src=t.target.getAttribute("src")):L.current.style.display="none")},dangerouslySetInnerHTML:{__html:K}}),h.a.createElement("div",{ref:L,className:ie.a.button},h.a.createElement(r.a,null,h.a.createElement(n.a,{onClick:function(){return(t=new te(R.current)).displayMode="popup",t.addRenderEventListener(function(){var t=Object(a.a)(c.a.mark((function t(e){var i;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L.current.style.display="none",t.next=3,Object(B.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:e}});case 3:null!=(i=t.sent)&&i.id&&v(R.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(null==i?void 0:i.id,"?type=").concat(i.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(n.a,{onClick:function(){return(t=new Dt(R.current)).settings.displayMode="popup",t.addEventListener("render",function(){var t=Object(a.a)(c.a.mark((function t(e){var i;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(L.current.style.display="none",!R.current){t.next=6;break}return t.next=4,Object(B.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:e.dataUrl}});case 4:null!=(i=t.sent)&&i.id&&v(R.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(null==i?void 0:i.id,"?type=").concat(i.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:R,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(j.a,{close:!0,data:F,hasMask:y,type:null!=F&&F.length?z:"",style:Object(s.a)({},x),onClose:function(){return U("")}}))}},BJfS:
/*!*****************************************************!*\
!*** ./node_modules/string-convert/camel2hyphen.js ***!
\*****************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){t.exports=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()})).toLowerCase()}},BU3w:
/*!***************************************************!*\
!*** ./node_modules/rc-util/es/Dom/dynamicCSS.js ***!
\***************************************************/
/*! exports provided: injectCSS, updateCSS */
/*! exports used: updateCSS */function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var r=i(/*! ./canUseDom */"MNnm");function n(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function s(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(r.a)())return null;var s,a=document.createElement("style");(null===(e=i.csp)||void 0===e?void 0:e.nonce)&&(a.nonce=null===(s=i.csp)||void 0===s?void 0:s.nonce);a.innerHTML=t;var o=n(i),l=o.firstChild;return i.prepend&&o.prepend?o.prepend(a):i.prepend&&l?o.insertBefore(a,l):o.appendChild(a),a}var a=new Map;function o(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n(i);if(!a.has(r)){var o=s("",i),l=o.parentNode;a.set(r,l),l.removeChild(o)}var c=Array.from(a.get(r).children).find((function(t){return"STYLE"===t.tagName&&t["rc-util-key"]===e}));if(c){var u,h,d;if((null===(u=i.csp)||void 0===u?void 0:u.nonce)&&c.nonce!==(null===(h=i.csp)||void 0===h?void 0:h.nonce))c.nonce=null===(d=i.csp)||void 0===d?void 0:d.nonce;return c.innerHTML!==t&&(c.innerHTML=t),c}var f=s(t,i);return f["rc-util-key"]=e,f}},DlQD:
/*!*******************************************!*\
!*** ./node_modules/marked/lib/marked.js ***!
\*******************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){t.exports=function(){"use strict";function t(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,r=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}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(r=t[Symbol.iterator]()).next.bind(r)}var r=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}}})),n=(r.defaults,r.getDefaults,r.changeDefaults,/[&<>"']/),s=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\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,f=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,g={},v=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(t,e){g[" "+t]||(v.test(t)?g[" "+t]=t+"/":g[" "+t]=E(t,"/",!0));var i=-1===(t=g[" "+t]).indexOf(":");return"//"===e.substring(0,2)?i?e:t.replace(m,"$1")+e:"/"===e.charAt(0)?i?e:t.replace(y,"$1")+e:t+e}function E(t,e,i){var r=t.length;if(0===r)return"";for(var n=0;n=0&&"\\"===i[n];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(i.length>e)i.splice(e);else for(;i.length1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t,e){var i=this.rules.block.code.exec(t);if(i){var r=e[e.length-1];if(r&&"paragraph"===r.type)return{raw:i[0],text:i[0].trimRight()};var n=i[0].replace(/^ {4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?n:D(n,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var i=e[0],r=function(t,e){var i=t.match(/^(\s+)(?:```)/);if(null===i)return e;var r=i[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=r.length?t.slice(r.length):t})).join("\n")}(i,e[3]||"");return{type:"code",raw:i,lang:e[2]?e[2].trim():e[2],text:r}}},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 i={type:"table",header:I(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(i.header.length===i.align.length){var r,n=i.align.length;for(r=0;r ?/gm,"");return{type:"blockquote",raw:e[0],text:i}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){for(var i,r,n,s,a,o,l,c=e[0],u=e[2],h=u.length>1,d=")"===u[u.length-1],f={type:"list",raw:c,ordered:h,start:h?+u.slice(0,-1):"",loose:!1,items:[]},p=e[0].match(this.rules.block.item),g=!1,v=p.length,m=0;m1||this.options.smartLists&&n!==u)&&(s=p.slice(m+1).join("\n"),f.raw=f.raw.substring(0,f.raw.length-s.length),m=v-1)),a=g||/\n\n(?!\s*$)/.test(i),m!==v-1&&(g="\n"===i.charAt(i.length-1),a||(a=g)),a&&(f.loose=!0),l=void 0,(o=/^\[[ xX]\] /.test(i))&&(l=" "!==i[1],i=i.replace(/^\[[ xX]\] +/,"")),f.items.push({type:"list_item",raw:c,task:o,checked:l,loose:a,text:i});return f}},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]):M(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 i={type:"table",header:I(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=e[0];var r,n=i.align.length;for(r=0;r/i.test(r[0])&&(e=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:e,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):M(r[0]):r[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var i=P(e[2],"()");if(i>-1){var r=(0===e[0].indexOf("!")?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,r).trim(),e[3]=""}var n=e[2],s="";if(this.options.pedantic){var a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);a?(n=a[1],s=a[3]):s=""}else s=e[3]?e[3].slice(1,-1):"";return N(e,{href:(n=n.trim().replace(/^<([\s\S]*)>$/,"$1"))?n.replace(this.rules.inline._escapes,"$1"):n,title:s?s.replace(this.rules.inline._escapes,"$1"):s},e[0])}},e.reflink=function(t,e){var i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){var r=(i[2]||i[1]).replace(/\s+/g," ");if(!(r=e[r.toLowerCase()])||!r.href){var n=i[0].charAt(0);return{type:"text",raw:n,text:n}}return N(i,r,i[0])}},e.strong=function(t,e,i){void 0===i&&(i="");var r=this.rules.inline.strong.start.exec(t);if(r&&(!r[1]||r[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){e=e.slice(-1*t.length);var n,s="**"===r[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(s.lastIndex=0;null!=(r=s.exec(e));)if(n=this.rules.inline.strong.middle.exec(e.slice(0,r.index+3)))return{type:"strong",raw:t.slice(0,n[0].length),text:t.slice(2,n[0].length-2)}}},e.em=function(t,e,i){void 0===i&&(i="");var r=this.rules.inline.em.start.exec(t);if(r&&(!r[1]||r[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){e=e.slice(-1*t.length);var n,s="*"===r[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(s.lastIndex=0;null!=(r=s.exec(e));)if(n=this.rules.inline.em.middle.exec(e.slice(0,r.index+2)))return{type:"em",raw:t.slice(0,n[0].length),text:t.slice(1,n[0].length-1)}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var i=e[2].replace(/\n/g," "),r=/[^ ]/.test(i),n=i.startsWith(" ")&&i.endsWith(" ");return r&&n&&(i=i.substring(1,i.length-1)),i=M(i,!0),{type:"codespan",raw:e[0],text:i}}},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 i,r,n=this.rules.inline.autolink.exec(t);if(n)return r="@"===n[2]?"mailto:"+(i=M(this.options.mangle?e(n[1]):n[1])):i=M(n[1]),{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}},e.url=function(t,e){var i;if(i=this.rules.inline.url.exec(t)){var r,n;if("@"===i[2])n="mailto:"+(r=M(this.options.mangle?e(i[0]):i[0]));else{var s;do{s=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(s!==i[0]);r=M(i[0]),n="www."===i[1]?"http://"+r:r}return{type:"link",raw:i[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}},e.inlineText=function(t,e,i){var r,n=this.rules.inline.text.exec(t);if(n)return r=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):M(n[0]):n[0]:M(this.options.smartypants?i(n[0]):n[0]),{type:"text",raw:n[0],text:r}},t}(),B=x,F=k,U=T,G={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:B,table:B,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?'|\([^()]*\))/};G.def=F(G.def).replace("label",G._label).replace("title",G._title).getRegex(),G.bullet=/(?:[*+-]|\d{1,9}[.)])/,G.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,G.item=F(G.item,"gm").replace(/bull/g,G.bullet).getRegex(),G.list=F(G.list).replace(/bull/g,G.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+G.def.source+")").getRegex(),G._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",G._comment=//,G.html=F(G.html,"i").replace("comment",G._comment).replace("tag",G._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),G.paragraph=F(G._paragraph).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",G._tag).getRegex(),G.blockquote=F(G.blockquote).replace("paragraph",G.paragraph).getRegex(),G.normal=U({},G),G.gfm=U({},G.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*|$)"}),G.gfm.nptable=F(G.gfm.nptable).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",G._tag).getRegex(),G.gfm.table=F(G.gfm.table).replace("hr",G.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",G._tag).getRegex(),G.pedantic=U({},G.normal,{html:F("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",G._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:B,paragraph:F(G.normal._paragraph).replace("hr",G.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",G.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var H={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:B,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:B,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};H.punctuation=F(H.punctuation).replace(/punctuation/g,H._punctuation).getRegex(),H._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",H._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",H.em.start=F(H.em.start).replace(/punctuation/g,H._punctuation).getRegex(),H.em.middle=F(H.em.middle).replace(/punctuation/g,H._punctuation).replace(/overlapSkip/g,H._overlapSkip).getRegex(),H.em.endAst=F(H.em.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.em.endUnd=F(H.em.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.start=F(H.strong.start).replace(/punctuation/g,H._punctuation).getRegex(),H.strong.middle=F(H.strong.middle).replace(/punctuation/g,H._punctuation).replace(/blockSkip/g,H._blockSkip).getRegex(),H.strong.endAst=F(H.strong.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.endUnd=F(H.strong.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.blockSkip=F(H._blockSkip,"g").getRegex(),H.overlapSkip=F(H._overlapSkip,"g").getRegex(),H._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,H._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,H._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])?)+(?![-_])/,H.autolink=F(H.autolink).replace("scheme",H._scheme).replace("email",H._email).getRegex(),H._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,H.tag=F(H.tag).replace("comment",G._comment).replace("attribute",H._attribute).getRegex(),H._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,H._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,H._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,H.link=F(H.link).replace("label",H._label).replace("href",H._href).replace("title",H._title).getRegex(),H.reflink=F(H.reflink).replace("label",H._label).getRegex(),H.reflinkSearch=F(H.reflinkSearch,"g").replace("reflink",H.reflink).replace("nolink",H.nolink).getRegex(),H.normal=U({},H),H.pedantic=U({},H.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:F(/^!?\[(label)\]\((.*?)\)/).replace("label",H._label).getRegex(),reflink:F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",H._label).getRegex()}),H.gfm=U({},H.normal,{escape:F(H.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&&(i="x"+i.toString(16)),r+=""+i+";";return r}var q=function(){function e(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||V,this.options.tokenizer=this.options.tokenizer||new j,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:K.normal,inline:W.normal};this.options.pedantic?(e.block=K.pedantic,e.inline=W.pedantic):this.options.gfm&&(e.block=K.gfm,this.options.breaks?e.inline=W.breaks:e.inline=W.gfm),this.tokenizer.rules=e}e.lex=function(t,i){return new e(i).lex(t)};var i,r,n,s=e.prototype;return s.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},s.blockTokens=function(t,e,i){var r,n,s,a;for(void 0===e&&(e=[]),void 0===i&&(i=!0),t=t.replace(/^ +$/gm,"");t;)if(r=this.tokenizer.space(t))t=t.substring(r.raw.length),r.type&&e.push(r);else if(r=this.tokenizer.code(t,e))t=t.substring(r.raw.length),r.type?e.push(r):((a=e[e.length-1]).raw+="\n"+r.raw,a.text+="\n"+r.text);else if(r=this.tokenizer.fences(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.heading(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.nptable(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.hr(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.blockquote(t))t=t.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],i),e.push(r);else if(r=this.tokenizer.list(t)){for(t=t.substring(r.raw.length),s=r.items.length,n=0;n0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(o));)l.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(o));)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;t;)if(s=this.tokenizer.escape(t))t=t.substring(s.raw.length),e.push(s);else if(s=this.tokenizer.tag(t,i,r))t=t.substring(s.raw.length),i=s.inLink,r=s.inRawBlock,e.push(s);else if(s=this.tokenizer.link(t))t=t.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,r)),e.push(s);else if(s=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,r)),e.push(s);else if(s=this.tokenizer.strong(t,o,n))t=t.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],i,r),e.push(s);else if(s=this.tokenizer.em(t,o,n))t=t.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],i,r),e.push(s);else if(s=this.tokenizer.codespan(t))t=t.substring(s.raw.length),e.push(s);else if(s=this.tokenizer.br(t))t=t.substring(s.raw.length),e.push(s);else if(s=this.tokenizer.del(t))t=t.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],i,r),e.push(s);else if(s=this.tokenizer.autolink(t,X))t=t.substring(s.raw.length),e.push(s);else if(i||!(s=this.tokenizer.url(t,X))){if(s=this.tokenizer.inlineText(t,r,Y))t=t.substring(s.raw.length),n=s.raw.slice(-1),e.push(s);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(s.raw.length),e.push(s);return e},i=e,n=[{key:"rules",get:function(){return{block:K,inline:W}}}],(r=null)&&t(i.prototype,r),n&&t(i,n),e}(),$=r.defaults,J=w,Q=S,Z=function(){function t(t){this.options=t||$}var e=t.prototype;return e.code=function(t,e,i){var r=(e||"").match(/\S*/)[0];if(this.options.highlight){var n=this.options.highlight(t,r);null!=n&&n!==t&&(i=!0,t=n)}return r?''+(i?t:Q(t,!0))+"
\n":""+(i?t:Q(t,!0))+"
\n"},e.blockquote=function(t){return"\n"+t+"
\n"},e.html=function(t){return t},e.heading=function(t,e,i,r){return this.options.headerIds?"\n":""+t+"\n"},e.hr=function(){return this.options.xhtml?"
\n":"
\n"},e.list=function(t,e,i){var r=e?"ol":"ul";return"<"+r+(e&&1!==i?' start="'+i+'"':"")+">\n"+t+""+r+">\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"},e.tablerow=function(t){return"\n"+t+"
\n"},e.tablecell=function(t,e){var i=e.header?"th":"td";return(e.align?"<"+i+' align="'+e.align+'">':"<"+i+">")+t+""+i+">\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,i){if(null===(t=J(this.options.sanitize,this.options.baseUrl,t)))return i;var r='"+i+""},e.image=function(t,e,i){if(null===(t=J(this.options.sanitize,this.options.baseUrl,t)))return i;var r='
":">"},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,i){return""+i},e.image=function(t,e,i){return""+i},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 i=e;do{this.seen[i]++,e=i+"-"+this.seen[i]}while(this.seen.hasOwnProperty(e))}return this.seen[e]=0,e},t}(),it=r.defaults,rt=C,nt=function(){function t(t){this.options=t||it,this.options.renderer=this.options.renderer||new Z,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new tt,this.slugger=new et}t.parse=function(e,i){return new t(i).parse(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var i,r,n,s,a,o,l,c,u,h,d,f,p,g,v,m,y,b,E="",S=t.length;for(i=0;i0&&"text"===v.tokens[0].type?(v.tokens[0].text=b+" "+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&"text"===v.tokens[0].tokens[0].type&&(v.tokens[0].tokens[0].text=b+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:b}):g+=b),g+=this.parse(v.tokens,p),u+=this.renderer.listitem(g,y,m);E+=this.renderer.list(u,d,f);continue;case"html":E+=this.renderer.html(h.text);continue;case"paragraph":E+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;i+1An error occurred:"+ot(t.message+"",!0)+"
";throw t}}return ht.options=ht.setOptions=function(t){return st(ht.defaults,t),ct(ht.defaults),ht},ht.getDefaults=lt,ht.defaults=ut,ht.use=function(t){var e=st({},t);if(t.renderer&&function(){var i=ht.defaults.renderer||new Z,r=function(e){var r=i[e];i[e]=function(){for(var n=arguments.length,s=new Array(n),a=0;a1&&void 0!==arguments[1]?arguments[1]:1,i=D.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];return Object(x.a)(t).map((function(t,i){if(!o.isValidElement(t)||!t.type)return null;var r=t.type.isSelectOptGroup,n=t.key,s=t.props,a=s.children,l=Object(c.a)(s,["children"]);return e||!r?T(t):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(null===n?i:n,"__"),label:n},l),{},{options:O(a)})})).filter((function(t){return t}))}var A=i("2Qr1"),L=i("qNPg"),R=i("U8pU"),_=i("Kwbf"),D=i("WKfj");var I=function(t){var e=t.mode,i=t.options,r=t.children,n=t.backfill,s=t.allowClear,a=t.placeholder,l=t.getInputElement,c=t.showSearch,u=t.onSearch,h=t.defaultOpen,d=t.autoFocus,f=t.labelInValue,p=t.value,g=t.inputValue,v=t.optionLabelProp,m="multiple"===e||"tags"===e,y=void 0!==c?c:m||"combobox"===e,b=i||O(r);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 E=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)(!E,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)("combobox"!==e||!v,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)("combobox"===e||!n,"`backfill` only works with `combobox` mode."),Object(_.a)("combobox"===e||!l,"`getInputElement` only work with `combobox` mode."),Object(_.b)("combobox"!==e||!l||!s||!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!=p){var S=Object(D.d)(p);Object(_.a)(!f||S.every((function(t){return"object"===Object(R.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)(!m||Array.isArray(p),"`value` should be array when `mode` is `multiple` or `tags`")}if(r){var C=null;Object(x.a)(r).some((function(t){if(!o.isValidElement(t)||!t.type)return!1;var e=t.type;return!e.isSelectOption&&(e.isSelectOptGroup?!Object(x.a)(t.props.children).every((function(e){return!(o.isValidElement(e)&&t.type&&!e.type.isSelectOption)||(C=e.type,!1)})):(C=e,!0))})),C&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(C.displayName||C.name||C,"`.")),Object(_.a)(void 0===g,"`inputValue` is deprecated, please use `searchValue` instead.")}},M=Object(L.a)({prefixCls:"rc-select",components:{optionList:b},convertChildrenToData:O,flattenOptions:A.d,getLabeledValue:A.e,filterOptions:A.b,isValueDisabled:A.g,findValueOption:A.c,warningProps:I,fillOptionsWithMissingValue:A.a}),P=function(t){Object(s.a)(i,t);var e=Object(a.a)(i);function i(){var t;return Object(r.a)(this,i),(t=e.apply(this,arguments)).selectRef=o.createRef(),t.focus=function(){t.selectRef.current.focus()},t.blur=function(){t.selectRef.current.blur()},t}return Object(n.a)(i,[{key:"render",value:function(){return o.createElement(M,Object.assign({ref:this.selectRef},this.props))}}]),i}(o.Component);P.Option=S,P.OptGroup=k;var N=P;e.c=N},NvD2:
/*!******************************************************!*\
!*** ./node_modules/rc-tree/es/utils/conductUtil.js ***!
\******************************************************/
/*! exports provided: isCheckDisabled, conductCheck */
/*! exports used: conductCheck */function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var r=i(/*! rc-util/es/warning */"Kwbf");function n(t,e){var i=new Set;return t.forEach((function(t){e.has(t)||i.add(t)})),i}function s(t){var e=t||{},i=e.disabled,r=e.disableCheckbox,n=e.checkable;return!(!i&&!r)||!1===n}function a(t,e,i,a){var o,l=[];o=a||s;var c=new Set(t.filter((function(t){var e=!!i[t];return e||l.push(t),e}))),u=new Map,h=0;return Object.keys(i).forEach((function(t){var e=i[t],r=e.level,n=u.get(r);n||(n=new Set,u.set(r,n)),n.add(e),h=Math.max(h,r)})),Object(r.a)(!l.length,"Tree missing follow keys: ".concat(l.slice(0,100).map((function(t){return"'".concat(t,"'")})).join(", "))),!0===e?function(t,e,i,r){for(var s=new Set(t),a=new Set,o=0;o<=i;o+=1){(e.get(o)||new Set).forEach((function(t){var e=t.key,i=t.node,n=t.children,a=void 0===n?[]:n;s.has(e)&&!r(i)&&a.filter((function(t){return!r(t.node)})).forEach((function(t){s.add(t.key)}))}))}for(var l=new Set,c=i;c>=0;c-=1){(e.get(c)||new Set).forEach((function(t){var e=t.parent,i=t.node;if(!r(i)&&t.parent&&!l.has(t.parent.key))if(r(t.parent.node))l.add(e.key);else{var n=!0,o=!1;(e.children||[]).filter((function(t){return!r(t.node)})).forEach((function(t){var e=t.key,i=s.has(e);n&&!i&&(n=!1),o||!i&&!a.has(e)||(o=!0)})),n&&s.add(e.key),o&&a.add(e.key),l.add(e.key)}}))}return{checkedKeys:Array.from(s),halfCheckedKeys:Array.from(n(a,s))}}(c,u,h,o):function(t,e,i,r,s){for(var a=new Set(t),o=new Set(e),l=0;l<=r;l+=1){(i.get(l)||new Set).forEach((function(t){var e=t.key,i=t.node,r=t.children,n=void 0===r?[]:r;a.has(e)||o.has(e)||s(i)||n.filter((function(t){return!s(t.node)})).forEach((function(t){a.delete(t.key)}))}))}o=new Set;for(var c=new Set,u=r;u>=0;u-=1){(i.get(u)||new Set).forEach((function(t){var e=t.parent,i=t.node;if(!s(i)&&t.parent&&!c.has(t.parent.key))if(s(t.parent.node))c.add(e.key);else{var r=!0,n=!1;(e.children||[]).filter((function(t){return!s(t.node)})).forEach((function(t){var e=t.key,i=a.has(e);r&&!i&&(r=!1),n||!i&&!o.has(e)||(n=!0)})),r||a.delete(e.key),n&&o.add(e.key),c.add(e.key)}}))}return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(n(o,a))}}(c,e.halfCheckedKeys,u,h,o)}},OZM5:
/*!*****************************************!*\
!*** ./node_modules/rc-tree/es/util.js ***!
\*****************************************/
/*! exports provided: arrDel, arrAdd, posToArr, getPosition, isTreeNode, getDragNodesKeys, calcDropPosition, calcSelectedKeys, convertDataToTree, parseCheckedKeys, conductExpandParent, getDataAndAria */
/*! exports used: arrAdd, arrDel, calcDropPosition, calcSelectedKeys, conductExpandParent, getDataAndAria, getDragNodesKeys, getPosition, isTreeNode, parseCheckedKeys, posToArr */function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"a",(function(){return o})),i.d(e,"k",(function(){return l})),i.d(e,"h",(function(){return c})),i.d(e,"i",(function(){return u})),i.d(e,"g",(function(){return h})),i.d(e,"c",(function(){return d})),i.d(e,"d",(function(){return f})),i.d(e,"j",(function(){return p})),i.d(e,"e",(function(){return g})),i.d(e,"f",(function(){return v}));var r=i(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),n=i(/*! @babel/runtime/helpers/esm/typeof */"U8pU"),s=(i(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),i(/*! react */"q1tI"),i(/*! rc-util/es/warning */"Kwbf"));i(/*! ./TreeNode */"WaYH");function a(t,e){var i=t.slice(),r=i.indexOf(e);return r>=0&&i.splice(r,1),i}function o(t,e){var i=t.slice();return-1===i.indexOf(e)&&i.push(e),i}function l(t){return t.split("-")}function c(t,e){return"".concat(t,"-").concat(e)}function u(t){return t&&t.type&&t.type.isTreeNode}function h(t,e){var i=[t];return function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){var r=e.key,n=e.children;i.push(r),t(n)}))}(e[t].children),i}function d(t,e){var i=t.clientY,r=e.selectHandle.getBoundingClientRect(),n=r.top,s=r.bottom,a=r.height,o=Math.max(.25*a,2);return i<=n+o?-1:i>=s-o?1:0}function f(t,e){if(t)return e.multiple?t.slice():t.length?[t[0]]:t}function p(t){if(!t)return null;var e;if(Array.isArray(t))e={checkedKeys:t,halfCheckedKeys:void 0};else{if("object"!==Object(n.a)(t))return Object(s.a)(!1,"`checkedKeys` is not an array or an object"),null;e={checkedKeys:t.checked||void 0,halfCheckedKeys:t.halfChecked||void 0}}return e}function g(t,e){var i=new Set;return(t||[]).forEach((function(t){!function t(r){if(!i.has(r)){var n=e[r];if(n){i.add(r);var s=n.parent;n.node.disabled||s&&t(s.key)}}}(t)})),Object(r.a)(i)}function v(t){var e={};return Object.keys(t).forEach((function(i){(i.startsWith("data-")||i.startsWith("aria-"))&&(e[i]=t[i])})),e}},"SA+Z":
/*!********************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/toArray.js ***!
\********************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){var r=i(/*! ./arrayWithHoles.js */"wTVA"),n=i(/*! ./iterableToArray.js */"EbDI"),s=i(/*! ./unsupportedIterableToArray.js */"ZhPi"),a=i(/*! ./nonIterableRest.js */"wkBT");t.exports=function(t){return r(t)||n(t)||s(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},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"],i=[[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"],r=[i,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],n=[i,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],s=[i,"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=[i,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="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,i,r,n){if(i){var s={sourceNode:t,pre:1,langExtension:null,numberLines:null,sourceCode:i,spans:null,basePos:e,decorations:null};r(s),n.push.apply(n,s.decorations)}}var f=/\S/;function p(t){for(var e=void 0,i=t.firstChild;i;i=i.nextSibling){var r=i.nodeType;e=1===r?e?t:i:3===r&&f.test(i.nodeValue)?t:e}return e===t?void 0:e}function g(t,e){var i,r={};!function(){for(var n=t.concat(e),s=[],a={},o=0,l=n.length;o=0;)r[u.charAt(h)]=c;var d=c[1],f=""+d;a.hasOwnProperty(f)||(s.push(d),a[f]=null)}s.push(/[\0-\uffff]/),i=function(t){for(var e=0,i=!1,r=!1,n=0,s=t.length;n122||(u<65||h>90||i.push([32|Math.max(65,h),32|Math.min(u,90)]),u<97||h>122||i.push([-33&Math.max(97,h),-33&Math.min(u,122)]))}}i.sort((function(t,e){return t[0]-e[0]||e[1]-t[1]}));var d=[],f=[];for(s=0;sp[0]&&(p[1]+1>p[0]&&n.push("-"),n.push(l(p[1])))}return n.push("]"),n.join("")}function u(t){for(var r=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")),n=r.length,s=[],a=0,o=0;a=2&&"["===d?r[a]=c(h):"\\"!==d&&(r[a]=h.replace(/[a-zA-Z]/g,(function(t){var e=t.charCodeAt(0);return"["+String.fromCharCode(-33&e,32|e)+"]"})))}return r.join("")}var h=[];for(n=0,s=t.length;n=5&&"lang-"===y.substring(0,5))||b&&"string"==typeof b[1]||(v=!1,y="src"),v||(f[m]=y)}var k=u;if(u+=m.length,v){var w=b[1],x=m.indexOf(w),T=x+w.length;b[2]&&(x=(T=m.length-b[2].length)-w.length);var O=y.substring(5);d(l,o+k,m.substring(0,x),s,c),d(l,o+k+x,w,S(O,w),c),d(l,o+k+T,m.substring(T),s,c)}else c.push(o+k,y)}t.decorations=c};return s}function v(t){var e=[],i=[];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&&i.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var r=t.hashComments;r&&(t.cStyleComments?(r>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,"#"]),i.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):e.push(["com",/^#[^\r\n]*/,null,"#"])),t.cStyleComments&&(i.push(["com",/^\/\/[^\r\n]*/,null]),i.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var n=t.regexLiterals;if(n){var s=n>1?"":"\n\r",a=s?".":"[\\S\\s]",o="/(?=[^/*"+s+"])(?:[^/\\x5B\\x5C"+s+"]|\\x5C"+a+"|\\x5B(?:[^\\x5C\\x5D"+s+"]|\\x5C"+a+")*(?:\\x5D|$))+/";i.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+o+")")])}var l=t.types;l&&i.push(["typ",l]);var c=(""+t.keywords).replace(/^ | $/g,"");c.length&&i.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*/)"),i.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]),g(e,i)}var m=v({keywords:[r,s,n,a,o,l,c,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function y(t,e,i){for(var r=/(?:^|\s)nocode(?:\s|$)/,n=/\r\n?|\n/,s=t.ownerDocument,a=s.createElement("li");t.firstChild;)a.appendChild(t.firstChild);var o=[a];function l(t){var e=t.nodeType;if(1!=e||r.test(t.className)){if((3==e||4==e)&&i){var a=t.nodeValue,o=a.match(n);if(o){var u=a.substring(0,o.index);t.nodeValue=u;var h=a.substring(o.index+o[0].length);if(h)t.parentNode.insertBefore(s.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,i=function t(e,i){var r=i?e.cloneNode(!1):e,n=e.parentNode;if(n){var s=t(n,1),a=e.nextSibling;s.appendChild(r);for(var o=a;o;o=a)a=o.nextSibling,s.appendChild(o)}return r}(t.nextSibling,0);(e=i.parentNode)&&1===e.nodeType;)i=e;o.push(i)}for(var u=0;u=0;){var n=i[r];b.hasOwnProperty(n)?t.console&&console.warn("cannot override language handler %s",n):b[n]=e}}function S(t,e){return t&&b.hasOwnProperty(t)||(t=/^\s*=E&&(u+=2),o>=S&&(f+=2)}}finally{m&&(m.style.display=y)}}(e)}catch(e){t.console&&console.log(e&&e.stack||e)}}function k(t,e,i){var r=i||!1,n=e||null,s=document.createElement("div");return s.innerHTML=""+t+"
",s=s.firstChild,r&&y(s,r,!0),C({langExtension:n,numberLines:r,sourceNode:s,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),s.innerHTML}function w(e,i){var r=i||document.body,n=r.ownerDocument||document;function s(t){return r.getElementsByTagName(t)}for(var a=[s("pre"),s("code"),s("xmp")],o=[],l=0;l]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^