=0||T.relatedTarget.className.indexOf("".concat(H,"-next"))>=0))return;l.setState({goInputText:""}),k(l.getValidValue())},l.go=function(T){var D=l.state.goInputText;if(D==="")return;(T.keyCode===u.ENTER||T.type==="click")&&(l.setState({goInputText:""}),l.props.quickGo(l.getValidValue()))},l}return Object(E.a)(A,[{key:"getValidValue",value:function(){var i=this.state,x=i.goInputText,O=i.current;return!x||isNaN(x)?O:Number(x)}},{key:"getPageSizeOptions",value:function(){var i=this.props,x=i.pageSize,O=i.pageSizeOptions;return O.some(function(T){return T.toString()===x.toString()})?O:O.concat([x.toString()]).sort(function(T,D){var R=isNaN(Number(T))?0:Number(T),k=isNaN(Number(D))?0:Number(D);return R-k})}},{key:"render",value:function(){var i=this,x=this.props,O=x.pageSize,T=x.locale,D=x.rootPrefixCls,R=x.changeSize,k=x.quickGo,H=x.goButton,J=x.selectComponentClass,U=x.buildOptionText,K=x.selectPrefixCls,G=x.disabled,N=this.state.goInputText,Q="".concat(D,"-options"),X=J,te=null,oe=null,me=null;if(!R&&!k)return null;var se=this.getPageSizeOptions();if(R&&X){var _e=se.map(function(Ae,Ee){return c.a.createElement(X.Option,{key:Ee,value:Ae.toString()},(U||i.buildOptionText)(Ae))});te=c.a.createElement(X,{disabled:G,prefixCls:K,showSearch:!1,className:"".concat(Q,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(O||se[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Ee){return Ee.parentNode}},_e)}return k&&(H&&(me=typeof H=="boolean"?c.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:G,className:"".concat(Q,"-quick-jumper-button")},T.jump_to_confirm):c.a.createElement("span",{onClick:this.go,onKeyUp:this.go},H)),oe=c.a.createElement("div",{className:"".concat(Q,"-quick-jumper")},T.jump_to,c.a.createElement("input",{disabled:G,type:"text",value:N,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),T.page,me)),c.a.createElement("li",{className:"".concat(Q)},te,oe)}}]),A}(c.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var f=o,d=M("N2Kk");function a(){}function h(B){return typeof B=="number"&&isFinite(B)&&Math.floor(B)===B}function g(B,b,A){return A}function p(B,b,A){var l=typeof B=="undefined"?b.pageSize:B;return Math.floor((A.total-1)/l)+1}var S=function(B){Object(_.a)(A,B);var b=Object(C.a)(A);function A(l){var i;Object(y.a)(this,A),i=b.call(this,l),i.getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(p(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(R,k){var H=i.props.prefixCls,J=R||c.a.createElement("button",{type:"button","aria-label":k,className:"".concat(H,"-item-link")});return typeof R=="function"&&(J=c.a.createElement(R,Object(P.a)({},i.props))),J},i.savePaginationNode=function(R){i.paginationNode=R},i.isValid=function(R){return h(R)&&R!==i.state.current},i.shouldDisplayQuickJumper=function(){var R=i.props,k=R.showQuickJumper,H=R.pageSize,J=R.total;return J<=H?!1:k},i.handleKeyDown=function(R){(R.keyCode===u.ARROW_UP||R.keyCode===u.ARROW_DOWN)&&R.preventDefault()},i.handleKeyUp=function(R){var k=i.getValidValue(R),H=i.state.currentInputValue;k!==H&&i.setState({currentInputValue:k}),R.keyCode===u.ENTER?i.handleChange(k):R.keyCode===u.ARROW_UP?i.handleChange(k-1):R.keyCode===u.ARROW_DOWN&&i.handleChange(k+1)},i.changePageSize=function(R){var k=i.state.current,H=p(R,i.state,i.props);k=k>H?H:k,H===0&&(k=i.state.current),typeof R=="number"&&("pageSize"in i.props||i.setState({pageSize:R}),"current"in i.props||i.setState({current:k,currentInputValue:k})),i.props.onShowSizeChange(k,R),"onChange"in i.props&&i.props.onChange&&i.props.onChange(k,R)},i.handleChange=function(R){var k=i.props.disabled,H=R;if(i.isValid(H)&&!k){var J=p(void 0,i.state,i.props);H>J?H=J:H<1&&(H=1),"current"in i.props||i.setState({current:H,currentInputValue:H});var U=i.state.pageSize;return i.props.onChange(H,U),H}return i.state.current},i.prev=function(){i.hasPrev()&&i.handleChange(i.state.current-1)},i.next=function(){i.hasNext()&&i.handleChange(i.state.current+1)},i.jumpPrev=function(){i.handleChange(i.getJumpPrevPage())},i.jumpNext=function(){i.handleChange(i.getJumpNextPage())},i.hasPrev=function(){return i.state.current>1},i.hasNext=function(){return i.state.current2?H-2:0),U=2;U=O?D=O:D=Number(x),D}},{key:"getShowSizeChanger",value:function(){var i=this.props,x=i.showSizeChanger,O=i.total,T=i.totalBoundaryShowSizeChanger;return typeof x!="undefined"?x:O>T}},{key:"renderPrev",value:function(i){var x=this.props,O=x.prevIcon,T=x.itemRender,D=T(i,"prev",this.getItemIcon(O,"prev page")),R=!this.hasPrev();return Object(m.isValidElement)(D)?Object(m.cloneElement)(D,{disabled:R}):D}},{key:"renderNext",value:function(i){var x=this.props,O=x.nextIcon,T=x.itemRender,D=T(i,"next",this.getItemIcon(O,"next page")),R=!this.hasNext();return Object(m.isValidElement)(D)?Object(m.cloneElement)(D,{disabled:R}):D}},{key:"render",value:function(){var i=this,x=this.props,O=x.prefixCls,T=x.className,D=x.style,R=x.disabled,k=x.hideOnSinglePage,H=x.total,J=x.locale,U=x.showQuickJumper,K=x.showLessItems,G=x.showTitle,N=x.showTotal,Q=x.simple,X=x.itemRender,te=x.showPrevNextJumpers,oe=x.jumpPrevIcon,me=x.jumpNextIcon,se=x.selectComponentClass,_e=x.selectPrefixCls,Ae=x.pageSizeOptions,Ee=this.state,pe=Ee.current,he=Ee.pageSize,ie=Ee.currentInputValue;if(k===!0&&H<=he)return null;var fe=p(void 0,this.state,this.props),ge=[],ce=null,Ie=null,Fe=null,ke=null,re=null,F=U&&U.goButton,W=K?1:2,de=pe-1>0?pe-1:0,ne=pe+1=W*2&&pe!==1+2&&(ge[0]=Object(m.cloneElement)(ge[0],{className:"".concat(O,"-item-after-jump-prev")}),ge.unshift(ce)),fe-pe>=W*2&&pe!==fe-2&&(ge[ge.length-1]=Object(m.cloneElement)(ge[ge.length-1],{className:"".concat(O,"-item-before-jump-next")}),ge.push(Ie)),yt!==1&&ge.unshift(Fe),Et!==fe&&ge.push(ke)}var rt=null;N&&(rt=c.a.createElement("li",{className:"".concat(O,"-total-text")},N(H,[H===0?0:(pe-1)*he+1,pe*he>H?H:pe*he])));var qe=!this.hasPrev()||!fe,$e=!this.hasNext()||!fe;return c.a.createElement("ul",Object(ue.a)({className:n()(O,T,Object(Y.a)({},"".concat(O,"-disabled"),R)),style:D,unselectable:"unselectable",ref:this.savePaginationNode},le),rt,c.a.createElement("li",{title:G?J.prev_page:null,onClick:this.prev,tabIndex:qe?null:0,onKeyPress:this.runIfEnterPrev,className:n()("".concat(O,"-prev"),Object(Y.a)({},"".concat(O,"-disabled"),qe)),"aria-disabled":qe},this.renderPrev(de)),ge,c.a.createElement("li",{title:G?J.next_page:null,onClick:this.next,tabIndex:$e?null:0,onKeyPress:this.runIfEnterNext,className:n()("".concat(O,"-next"),Object(Y.a)({},"".concat(O,"-disabled"),$e)),"aria-disabled":$e},this.renderNext(ne)),c.a.createElement(f,{disabled:R,locale:J,rootPrefixCls:O,selectComponentClass:se,selectPrefixCls:_e,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:pe,pageSize:he,pageSizeOptions:Ae,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:F}))}}],[{key:"getDerivedStateFromProps",value:function(i,x){var O={};if("current"in i&&(O.current=i.current,i.current!==x.current&&(O.currentInputValue=O.current)),"pageSize"in i&&i.pageSize!==x.pageSize){var T=x.current,D=p(i.pageSize,x,i);T=T>D?D:T,"current"in i||(O.current=T,O.currentInputValue=T),O.pageSize=i.pageSize}return O}}]),A}(c.a.Component);S.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:d.a,style:{},itemRender:g,totalBoundaryShowSizeChanger:50};var w=S},"6GrX":function(Ze,we,M){var ue=M("mFDi"),Y=M("Xnb7"),P=M("bYtY"),y=P.getContext,E=P.extend,_=P.retrieve2,C=P.retrieve3,m=P.trim,c={},r=0,n=5e3,e=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,s="12px sans-serif",u={};function o(k,H){u[k]=H}function f(k,H){H=H||s;var J=k+":"+H;if(c[J])return c[J];for(var U=(k+"").split(`
`),K=0,G=0,N=U.length;Gn&&(r=0,c={}),r++,c[J]=K,K}function d(k,H,J,U,K,G,N,Q){return N?h(k,H,J,U,K,G,N,Q):a(k,H,J,U,K,G,Q)}function a(k,H,J,U,K,G,N){var Q=O(k,H,K,G,N),X=f(k,H);K&&(X+=K[1]+K[3]);var te=Q.outerHeight,oe=g(0,X,J),me=p(0,te,U),se=new ue(oe,me,X,te);return se.lineHeight=Q.lineHeight,se}function h(k,H,J,U,K,G,N,Q){var X=T(k,{rich:N,truncate:Q,font:H,textAlign:J,textPadding:K,textLineHeight:G}),te=X.outerWidth,oe=X.outerHeight,me=g(0,te,J),se=p(0,oe,U);return new ue(me,se,te,oe)}function g(k,H,J){return J==="right"?k-=H:J==="center"&&(k-=H/2),k}function p(k,H,J){return J==="middle"?k-=H/2:J==="bottom"&&(k-=H),k}function S(k,H,J){var U=H.textPosition,K=H.textDistance,G=J.x,N=J.y;K=K||0;var Q=J.height,X=J.width,te=Q/2,oe="left",me="top";switch(U){case"left":G-=K,N+=te,oe="right",me="middle";break;case"right":G+=K+X,N+=te,me="middle";break;case"top":G+=X/2,N-=K,oe="center",me="bottom";break;case"bottom":G+=X/2,N+=Q+K,oe="center";break;case"inside":G+=X/2,N+=te,oe="center",me="middle";break;case"insideLeft":G+=K,N+=te,me="middle";break;case"insideRight":G+=X-K,N+=te,oe="right",me="middle";break;case"insideTop":G+=X/2,N+=K,oe="center";break;case"insideBottom":G+=X/2,N+=Q-K,oe="center",me="bottom";break;case"insideTopLeft":G+=K,N+=K;break;case"insideTopRight":G+=X-K,N+=K,oe="right";break;case"insideBottomLeft":G+=K,N+=Q-K,me="bottom";break;case"insideBottomRight":G+=X-K,N+=Q-K,oe="right",me="bottom";break}return k=k||{},k.x=G,k.y=N,k.textAlign=oe,k.textVerticalAlign=me,k}function w(k,H,J){var U={textPosition:k,textDistance:J};return S({},U,H)}function B(k,H,J,U,K){if(!H)return"";var G=(k+"").split(`
`);K=b(H,J,U,K);for(var N=0,Q=G.length;N=G;Q++)N-=G;var X=f(J,H);return X>N&&(J="",X=0),N=k-X,U.ellipsis=J,U.ellipsisWidth=X,U.contentWidth=N,U.containerWidth=k,U}function A(k,H){var J=H.containerWidth,U=H.font,K=H.contentWidth;if(!J)return"";var G=f(k,U);if(G<=J)return k;for(var N=0;;N++){if(G<=K||N>=H.maxIterations){k+=H.ellipsis;break}var Q=N===0?l(k,K,H.ascCharWidth,H.cnCharWidth):G>0?Math.floor(k.length*K/G):0;k=k.substr(0,Q),G=f(k,U)}return k===""&&(k=H.placeholder),k}function l(k,H,J,U){for(var K=0,G=0,N=k.length;Goe)k="",N=[];else if(me!=null)for(var se=b(me-(J?J[1]+J[3]:0),H,K.ellipsis,{minChar:K.minChar,placeholder:K.placeholder}),_e=0,Ae=N.length;_eU&&D(J,k.substring(U,G)),D(J,K[2],K[1]),U=e.lastIndex}U_e)return{lines:[],width:0,height:0};fe.textWidth=f(fe.text,Ie);var ke=ge.textWidth,re=ke==null||ke==="auto";if(typeof ke=="string"&&ke.charAt(ke.length-1)==="%")fe.percentWidth=ke,te.push(fe),ke=0;else{if(re){ke=fe.textWidth;var F=ge.textBackgroundColor,W=F&&F.image;W&&(W=Y.findExistImage(W),Y.isImageReady(W)&&(ke=Math.max(ke,W.width*Fe/W.height)))}var de=ce?ce[1]+ce[3]:0;ke+=de;var ne=se!=null?se-he:null;ne!=null&&ne1&&arguments[1]!==void 0?arguments[1]:0,o=(C[s[u+0]]+C[s[u+1]]+C[s[u+2]]+C[s[u+3]]+"-"+C[s[u+4]]+C[s[u+5]]+"-"+C[s[u+6]]+C[s[u+7]]+"-"+C[s[u+8]]+C[s[u+9]]+"-"+C[s[u+10]]+C[s[u+11]]+C[s[u+12]]+C[s[u+13]]+C[s[u+14]]+C[s[u+15]]).toLowerCase();if(!_(o))throw TypeError("Stringified UUID is invalid");return o}var r=c;function n(s,u,o){s=s||{};var f=s.random||(s.rng||P)();if(f[6]=f[6]&15|64,f[8]=f[8]&63|128,u){o=o||0;for(var d=0;d<16;++d)u[o+d]=f[d];return u}return r(f)}var e=we.a=n},"7SHv":function(Ze,we,M){var ue=M("LPTA"),Y=ue.devicePixelRatio,P=M("bYtY"),y=M("SUKs"),E=M("mFDi"),_=M("BPZU"),C=M("Xmg4"),m=M("mLcG"),c=M("Dagg"),r=M("ItGF"),n=1e5,e=314159,s=.01,u=.001;function o(b){return parseInt(b,10)}function f(b){return b?b.__builtin__?!0:!(typeof b.resize!="function"||typeof b.refresh!="function"):!1}var d=new E(0,0,0,0),a=new E(0,0,0,0);function h(b,A,l){return d.copy(b.getBoundingRect()),b.transform&&d.applyTransform(b.transform),a.width=A,a.height=l,!d.intersect(a)}function g(b,A){if(b===A)return!1;if(!b||!A||b.length!==A.length)return!0;for(var l=0;l=0&&l.splice(i,1),b.__hoverMir=null},clearHover:function(b){for(var A=this._hoverElements,l=0;l15)break}}O.__drawIndex=N,O.__drawIndex0&&b>i[0]){for(T=0;Tb);T++);O=l[i[T]]}if(i.splice(T+1,0,b),l[b]=A,!A.virtual)if(O){var R=O.dom;R.nextSibling?D.insertBefore(A.dom,R.nextSibling):D.appendChild(A.dom)}else D.firstChild?D.insertBefore(A.dom,D.firstChild):D.appendChild(A.dom)},eachLayer:function(b,A){var l=this._zlevelList,i,x;for(x=0;x0?s:0),this._needsManuallyCompositing),R.__builtin__||y("ZLevel "+D+" has been used by unkown layer "+R.id),R!==x&&(R.__used=!0,R.__startIndex!==l&&(R.__dirty=!0),R.__startIndex=l,R.incremental?R.__drawIndex=-1:R.__drawIndex=l,A(l),x=R),i.__dirty&&(R.__dirty=!0,R.incremental&&R.__drawIndex<0&&(R.__drawIndex=l))}A(l),this.eachBuiltinLayer(function(k,H){!k.__used&&k.getElementCount()>0&&(k.__dirty=!0,k.__startIndex=k.__endIndex=k.__drawIndex=0),k.__dirty&&k.__drawIndex<0&&(k.__drawIndex=k.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(b){b.clear()},setBackgroundColor:function(b){this._backgroundColor=b},configLayer:function(b,A){if(A){var l=this._layerConfig;l[b]?P.merge(l[b],A,!0):l[b]=A;for(var i=0;i0&&arguments[0]!==void 0?arguments[0]:[],f=new Map;function d(a){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(g){var p=g.key,S=g.children;Object(E.a)(p!=null,"Tree node must have a certain key: [".concat(h).concat(p,"]"));var w=String(p);Object(E.a)(!f.has(w)||p===null||p===void 0,"Same 'key' exist in the Tree: ".concat(w)),f.set(w,!0),d(S,"".concat(h).concat(w," > "))})}d(o)}function c(o){function f(d){var a=Object(y.a)(d);return a.map(function(h){if(!Object(_.i)(h))return Object(E.a)(!h,"Tree/TreeNode can only accept TreeNode as children."),null;var g=h.key,p=h.props,S=p.children,w=Object(P.a)(p,["children"]),B=Object(Y.a)({key:g},w),b=f(S);return b.length&&(B.children=b),B}).filter(function(h){return h})}return f(o)}function r(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],d=new Set(f===!0?[]:f),a=[];function h(g){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return g.map(function(S,w){var B=Object(_.h)(p?p.pos:"0",w),b=C(S.key,B),A=Object(Y.a)(Object(Y.a)({},S),{},{parent:p,pos:B,children:null,data:S,isStart:[].concat(Object(ue.a)(p?p.isStart:[]),[w===0]),isEnd:[].concat(Object(ue.a)(p?p.isEnd:[]),[w===g.length-1])});return a.push(A),f===!0||d.has(b)?A.children=h(S.children||[],A):A.children=[],A})}return h(o),a}function n(o,f,d){var a;d?typeof d=="string"?a=function(p){return p[d]}:typeof d=="function"&&(a=function(p){return d(p)}):a=function(p,S){return C(p.key,S)};function h(g,p,S){var w=g?g.children:o,B=g?Object(_.h)(S.pos,p):"0";if(g){var b=a(g,B),A={node:g,index:p,pos:B,key:b,parentPos:S.node?S.pos:null,level:S.level+1};f(A)}w&&w.forEach(function(l,i){h(l,i,{node:g,pos:B,level:S?S.level+1:-1})})}h(null)}function e(o){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=f.initWrapper,a=f.processEntity,h=f.onProcessFinished,g=arguments.length>2?arguments[2]:void 0,p={},S={},w={posEntities:p,keyEntities:S};return d&&(w=d(w)||w),n(o,function(B){var b=B.node,A=B.index,l=B.pos,i=B.key,x=B.parentPos,O=B.level,T={node:b,index:A,key:i,pos:l,level:O},D=C(i,l);p[l]=T,S[D]=T,T.parent=p[x],T.parent&&(T.parent.children=T.parent.children||[],T.parent.children.push(T)),a&&a(T,w)},g),h&&h(w),w}function s(o,f){var d=f.expandedKeys,a=f.selectedKeys,h=f.loadedKeys,g=f.loadingKeys,p=f.checkedKeys,S=f.halfCheckedKeys,w=f.dragOverNodeKey,B=f.dropPosition,b=f.keyEntities,A=b[o],l={eventKey:o,expanded:d.indexOf(o)!==-1,selected:a.indexOf(o)!==-1,loaded:h.indexOf(o)!==-1,loading:g.indexOf(o)!==-1,checked:p.indexOf(o)!==-1,halfChecked:S.indexOf(o)!==-1,pos:String(A?A.pos:""),dragOver:w===o&&B===0,dragOverGapTop:w===o&&B===-1,dragOverGapBottom:w===o&&B===1};return l}function u(o){var f=o.data,d=o.expanded,a=o.selected,h=o.checked,g=o.loaded,p=o.loading,S=o.halfChecked,w=o.dragOver,B=o.dragOverGapTop,b=o.dragOverGapBottom,A=o.pos,l=o.active,i=Object(Y.a)(Object(Y.a)({},f),{},{expanded:d,selected:a,checked:h,loaded:g,loading:p,halfChecked:S,dragOver:w,dragOverGapTop:B,dragOverGapBottom:b,pos:A,active:l});return"props"in i||Object.defineProperty(i,"props",{get:function(){return Object(E.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),i}},"8Bcu":function(Ze,we,M){Ze.exports={flex_box_center:"flex_box_center___3isCS",flex_space_between:"flex_space_between___1zEgQ",flex_box_vertical_center:"flex_box_vertical_center___2IyXM",flex_box_center_end:"flex_box_center_end___1r0jY",flex_box_column:"flex_box_column___2SHBj",rightWrap:"rightWrap___2XCk6",qrCode:"qrCode___3q9Z0",cardTop:"cardTop___2h9UR",cardTop2:"cardTop2___3KQ3O",card:"card___1aOV1",flexRow:"flexRow___DeBf7",flexRowAbout:"flexRowAbout___3sD2f",skillWrap:"skillWrap___pwM-3",skillTopWrap:"skillTopWrap___2oSn4",skillContentWrap:"skillContentWrap___239Us",skillContentWrapMin:"skillContentWrapMin___2KWd4",skillContentWrapMax:"skillContentWrapMax___NVKFP",skillContentIcon:"skillContentIcon___5mU6F",skillContentIconNoStatus:"skillContentIconNoStatus___1_V1l",skillExpandAllWrap:"skillExpandAllWrap___1HSf6",skillExpandAllContent:"skillExpandAllContent___3kY9W",memberItem:"memberItem___3cgRI",radius:"radius___2fxUa",memberItemContent:"memberItemContent___19hpK",directionItemWrap:"directionItemWrap___3Zm3f",groupActionWrap:"groupActionWrap___N0Epv",divabout:"divabout___psa-7",classButton:"classButton___30JJg",bg28e:"bg28e___2DyZD",bgGray:"bgGray___2PZB0",price:"price___2sFWj",li1:"li1___2y74c",discounts:"discounts___2JS39",realPrice:"realPrice___2kTeg",lineationPrice:"lineationPrice___2LeZ4",li2:"li2___2rpKJ"}},"8EBN":function(Ze,we,M){(function(ue){ue(M("VrN/"))})(function(ue){"use strict";ue.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Y=0;Y-1&&y.substring(C+1,y.length);if(m)return ue.findModeByExtension(m)},ue.findModeByName=function(y){y=y.toLowerCase();for(var E=0;E=U&&kG?"true":"false","aria-posinset":G+1,"aria-setsize":N,tabIndex:H?-1:0},m.a.createElement("div",{className:"".concat(J,"-first")},X),m.a.createElement("div",{className:"".concat(J,"-second")},X)));return K&&(te=K(te,this.props)),te}}]),x}(m.a.Component);function h(l,i){var x=Object.keys(l);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(l);i&&(O=O.filter(function(T){return Object.getOwnPropertyDescriptor(l,T).enumerable})),x.push.apply(x,O)}return x}function g(l){for(var i=1;i0&&!N||k===e.a.RIGHT&&Q>0&&N?(U?Q-=.5:Q-=1,T.changeValue(Q),R.preventDefault()):k===e.a.LEFT&&QN/2||!J&&D-G=ye.length?Ce.slice(ye.length):Ce}).join(`
`)}var d=[],a=[""],h=new u.a.Renderer,g=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function p(){d.length=0,a=[""]}var S={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function w(ve,z,Z,ye){if(z>=ve.length||ve[z].level<=Z)return z;var Ce=ve[z];ye.push("- "+Ce.text+""),z++;var be=[];return z=w(ve,z,Ce.level,be),be.length>0&&(ye.push("
"),be.forEach(function(ht){ye.push(ht)}),ye.push("
")),ye.push(" "),z=w(ve,z,Z,ye),z}function B(){return w(d,0,0,a),a.push("
"),a.join("")}var b={heading:function(z){var Z=g.exec(z);if(Z)return{type:"heading",raw:Z[0],depth:Z[1].length,text:Z[2]}},fences:function(z){var Z=this.rules.block.fences.exec(z);if(Z){var ye=Z[0],Ce=f(ye,Z[3]||""),be=Z[2]?Z[2].trim():Z[2];if(["latex","katex","math"].indexOf(be)>=0){var ht=i(),Nt=Ce;Ce=ht,x[ht]={type:"block",expression:Nt}}return{type:"code",raw:ye,lang:be,text:Ce}}}},A=/(?:\${2})([^\n`]+?)(?:\${2})/gi,l=0,i=function(){return"__special_katext_id_".concat(l++,"__")},x={};function O(){return x}function T(){l=0,x={}}function D(ve){return ve=ve.replace(A,function(z,Z){var ye=i();return x[ye]={type:"inline",expression:Z},ye}),ve}var R=h.listitem;h.listitem=function(ve){return R(D(ve))};var k=h.paragraph;h.paragraph=function(ve){return k(D(ve))};var H=h.tablecell;h.tablecell=function(ve,z){return H(D(ve),z)},h.code=function(ve,z,Z){var ye=(z||"").match(/\S*/)[0];return ye?["latex","katex","math"].indexOf(ye)>=0?"".concat(ve,"
"):'
').concat(Z?ve:Object(o.escape)(ve,!0),`
`):''+(Z?ve:Object(o.escape)(ve,!0))+"
"},h.heading=function(ve,z,Z){var ye=this.options.headerPrefix+Z.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return d.push({anchor:ye,level:z,text:ve}),"'+ve+""},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:b,renderer:h});var J=u.a,U=M("SJMd"),K=M("ulZh"),G=M.n(K),N=M("m3rI"),Q=M("Oy/b"),X=M("p5ED"),te=M("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var oe=function(ve,z){return(oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,ye){Z.__proto__=ye}||function(Z,ye){for(var Ce in ye)Object.prototype.hasOwnProperty.call(ye,Ce)&&(Z[Ce]=ye[Ce])})(ve,z)};function me(ve,z){function Z(){this.constructor=ve}oe(ve,z),ve.prototype=z===null?Object.create(z):(Z.prototype=z.prototype,new Z)}function se(ve,z,Z,ye){return new(Z||(Z=Promise))(function(Ce,be){function ht(pn){try{sn(ye.next(pn))}catch(zt){be(zt)}}function Nt(pn){try{sn(ye.throw(pn))}catch(zt){be(zt)}}function sn(pn){var zt;pn.done?Ce(pn.value):(zt=pn.value,zt instanceof Z?zt:new Z(function(qn){qn(zt)})).then(ht,Nt)}sn((ye=ye.apply(ve,z||[])).next())})}function _e(ve,z){var Z,ye,Ce,be,ht={label:0,sent:function(){if(1&Ce[0])throw Ce[1];return Ce[1]},trys:[],ops:[]};return be={next:Nt(0),throw:Nt(1),return:Nt(2)},typeof Symbol=="function"&&(be[Symbol.iterator]=function(){return this}),be;function Nt(sn){return function(pn){return function(zt){if(Z)throw new TypeError("Generator is already executing.");for(;ht;)try{if(Z=1,ye&&(Ce=2&zt[0]?ye.return:zt[0]?ye.throw||((Ce=ye.return)&&Ce.call(ye),0):ye.next)&&!(Ce=Ce.call(ye,zt[1])).done)return Ce;switch(ye=0,Ce&&(zt=[2&zt[0],Ce.value]),zt[0]){case 0:case 1:Ce=zt;break;case 4:return ht.label++,{value:zt[1],done:!1};case 5:ht.label++,ye=zt[1],zt=[0];continue;case 7:zt=ht.ops.pop(),ht.trys.pop();continue;default:if(!(Ce=ht.trys,(Ce=Ce.length>0&&Ce[Ce.length-1])||zt[0]!==6&&zt[0]!==2)){ht=0;continue}if(zt[0]===3&&(!Ce||zt[1]>Ce[0]&&zt[1]',"select"),this.addActionButton(ye,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ye,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ye,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ye,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ye,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ye,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ye,'',"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(be){var ht=document.createElement("div");ht.className=""+Z.toolbarButtonStyleClass.name,ht.setAttribute("data-type-name",be.typeName),ht.innerHTML=be.icon,ht.addEventListener("click",function(){Z.markerToolbarButtonClicked(ht,be)}),Z.buttons.push(ht),Z.markerButtons.push(ht)}),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 Ce=document.createElement("div");Ce.className=this.toolbarBlockStyleClass.name,Ce.style.whiteSpace="nowrap",Ce.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Ce),this.addActionButton(Ce,'',"render"),this.addActionButton(Ce,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ve.prototype.addButtonClickListener=function(z){this.buttonClickListeners.push(z)},ve.prototype.removeButtonClickListener=function(z){this.buttonClickListeners.indexOf(z)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(z),1)},ve.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ve.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var z=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var Z=0;Z0&&this.buttonClickListeners.forEach(function(ye){return ye("marker",Z)}),this.markerButtonOverflowBlock.style.display="none"},ve.prototype.actionToolbarButtonClicked=function(z,Z){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ye){return ye("action",Z)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ve.prototype.setActiveButton=function(z){this.resetButtonStyles(),z.className=z.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),z.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ve.prototype.setActiveMarkerButton=function(z){var Z=this.markerButtons.find(function(ye){return ye.getAttribute("data-type-name")===z});Z&&this.setActiveButton(Z)},ve.prototype.setCurrentMarker=function(z){var Z=this;this.currentMarker=z,this.buttons.filter(function(ye){return/delete|notes/.test(ye.getAttribute("data-action"))}).forEach(function(ye){Z.currentMarker===void 0?(ye.style.fillOpacity="0.4",ye.style.pointerEvents="none"):(ye.style.fillOpacity="1",ye.style.pointerEvents="all")})},ve}(),Fe=function(){function ve(z,Z,ye,Ce){this.panels=[],this.panelButtons=[],this.markerjsContainer=z,this.displayMode=Z,this.uiStyleSettings=ye,this.styles=Ce,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ve.prototype.addStyles=function(){var z;this.toolboxStyleClass=this.styles.addClass(new ce("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new ce("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var Z=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ce("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ce("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ce("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new ce("toolbox-panel-row_colors",`
background-color: `+((z=this.uiStyleSettings.toolboxBackgroundColor)!==null&&z!==void 0?z:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ce("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Z)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Z)+`px;
padding: `+Z+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ce("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ce("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ge("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ge("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ve.prototype.show=function(z){var Z;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=z,this.uiContainer.className=this.toolboxStyleClass.name+" "+((Z=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&Z!==void 0?Z:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ve.prototype.setPanelButtons=function(z){var Z,ye,Ce=this;this.panels=z,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((Z=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&Z!==void 0?Z:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ye=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ye!==void 0?ye:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(be){var ht;be.uiStyleSettings=Ce.uiStyleSettings;var Nt=document.createElement("div");Nt.className=Ce.toolboxButtonStyleClass.name+" "+((ht=Ce.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ht!==void 0?ht:Ce.toolboxButtonStyleColorsClass.name),Nt.innerHTML=be.icon,Nt.title=be.title,Nt.addEventListener("click",function(){Ce.panelButtonClick(be)}),Ce.panelButtons.push(Nt),Ce.buttonRow.appendChild(Nt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ve.prototype.panelButtonClick=function(z){var Z=this,ye=-1;if(z!==this.activePanel){ye=this.panels.indexOf(z),this.panelRow.innerHTML="";var Ce=z.getUi();Ce.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Ce),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=z}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){Z.displayMode==="inline"?Z.panelRow.style.display="none":Z.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(be,ht){var Nt,sn;be.className=Z.toolboxButtonStyleClass.name+" "+(ht===ye?""+((Nt=Z.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Nt!==void 0?Nt:Z.toolboxActiveButtonStyleColorsClass.name):""+((sn=Z.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&sn!==void 0?sn:Z.toolboxButtonStyleColorsClass.name))})},ve}(),ke=function(ve,z){this.title=ve,this.icon=z},re=function(ve){function z(Z,ye,Ce,be){var ht=ve.call(this,Z,be||'')||this;return ht.colors=[],ht.addTransparent=!1,ht.colorBoxes=[],ht.colors=ye,ht.currentColor=Ce,ht.setCurrentColor=ht.setCurrentColor.bind(ht),ht.getColorBox=ht.getColorBox.bind(ht),ht}return me(z,ve),z.prototype.getUi=function(){var Z=this,ye=document.createElement("div");return ye.style.overflow="hidden",ye.style.whiteSpace="nowrap",this.colors.forEach(function(Ce){var be=Z.getColorBox(Ce);ye.appendChild(be),Z.colorBoxes.push(be)}),ye},z.prototype.getColorBox=function(Z){var ye=this,Ce=this.uiStyleSettings.toolbarHeight/4,be=this.uiStyleSettings.toolbarHeight-Ce,ht=document.createElement("div");ht.style.display="inline-block",ht.style.boxSizing="content-box",ht.style.width=be-2+"px",ht.style.height=be-2+"px",ht.style.padding="1px",ht.style.marginRight="2px",ht.style.marginBottom="2px",ht.style.borderWidth="2px",ht.style.borderStyle="solid",ht.style.borderRadius=(be+2)/2+"px",ht.style.borderColor=Z===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ht.addEventListener("click",function(){ye.setCurrentColor(Z,ht)});var Nt=document.createElement("div");return Nt.style.display="inline-block",Nt.style.width=be-2+"px",Nt.style.height=be-2+"px",Nt.style.backgroundColor=Z,Nt.style.borderRadius=be/2+"px",Z==="transparent"&&(Nt.style.fill=this.uiStyleSettings.toolboxAccentColor,Nt.innerHTML=``),ht.appendChild(Nt),ht},z.prototype.setCurrentColor=function(Z,ye){var Ce=this;this.currentColor=Z,this.colorBoxes.forEach(function(be){be.style.borderColor=be===ye?Ce.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Z)},z}(ke),F=function(){function ve(z,Z,ye){this._state="new",this._isSelected=!1,this._container=z,this._overlayContainer=Z,this.globalSettings=ye,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ve.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ve.prototype.ownsTarget=function(z){return!1},Object.defineProperty(ve.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ve.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ve.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ve.prototype.pointerDown=function(z,Z){},ve.prototype.dblClick=function(z,Z){},ve.prototype.manipulate=function(z){},ve.prototype.pointerUp=function(z){this.stateChanged()},ve.prototype.dispose=function(){},ve.prototype.addMarkerVisualToContainer=function(z){this.container.childNodes.length>0?this.container.insertBefore(z,this.container.childNodes[0]):this.container.appendChild(z)},ve.prototype.getState=function(){return{typeName:ve.typeName,state:this.state,notes:this.notes}},ve.prototype.restoreState=function(z){this._state=z.state,this.notes=z.notes},ve.prototype.scale=function(z,Z){},ve.prototype.colorChanged=function(z){this.onColorChanged&&this.onColorChanged(z),this.stateChanged()},ve.prototype.fillColorChanged=function(z){this.onFillColorChanged&&this.onFillColorChanged(z),this.stateChanged()},ve.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var z=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),z.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(z)&&this.onStateChanged(this)}},ve.typeName="MarkerBase",ve}(),W=function(){function ve(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ve.prototype.findGripByVisual=function(z){return this.topLeft.ownsTarget(z)?this.topLeft:this.topCenter.ownsTarget(z)?this.topCenter:this.topRight.ownsTarget(z)?this.topRight:this.centerLeft.ownsTarget(z)?this.centerLeft:this.centerRight.ownsTarget(z)?this.centerRight:this.bottomLeft.ownsTarget(z)?this.bottomLeft:this.bottomCenter.ownsTarget(z)?this.bottomCenter:this.bottomRight.ownsTarget(z)?this.bottomRight:void 0},ve}(),de=function(){function ve(){this.GRIP_SIZE=10,this.visual=Ee.createGroup(),this.visual.appendChild(Ee.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ee.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ve.prototype.ownsTarget=function(z){return z===this.visual||z===this.visual.childNodes[0]||z===this.visual.childNodes[1]},ve}(),ne=function(){function ve(){}return ve.toITransformMatrix=function(z){return{a:z.a,b:z.b,c:z.c,d:z.d,e:z.e,f:z.f}},ve.toSVGMatrix=function(z,Z){return z.a=Z.a,z.b=Z.b,z.c=Z.c,z.d=Z.d,z.e=Z.e,z.f=Z.f,z},ve}(),le=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.left=0,be.top=0,be.width=0,be.height=0,be.defaultSize={x:50,y:20},be.offsetX=0,be.offsetY=0,be.rotationAngle=0,be.CB_DISTANCE=10,be._suppressMarkerCreateEvent=!1,be.container.transform.baseVal.appendItem(Ee.createTransform()),be.setupControlBox(),be}return me(z,ve),Object.defineProperty(z.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"visual",{get:function(){return this._visual},set:function(Z){this._visual=Z;var ye=Ee.createTransform();this._visual.transform.baseVal.appendItem(ye)},enumerable:!1,configurable:!0}),z.prototype.ownsTarget=function(Z){return!!ve.prototype.ownsTarget.call(this,Z)||!!(this.controlGrips.findGripByVisual(Z)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Z))},z.prototype.pointerDown=function(Z,ye){ve.prototype.pointerDown.call(this,Z,ye),this.state==="new"&&(this.left=Z.x,this.top=Z.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Ce=this.unrotatePoint(Z);if(this.manipulationStartX=Ce.x,this.manipulationStartY=Ce.y,this.offsetX=Ce.x-this.left,this.offsetY=Ce.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ye),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ye)){this.activeGrip=this.rotatorGrip;var be=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=be.x-this.width/2,this.top=be.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ht=this.container.transform.baseVal.getItem(0);ht.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ht,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},z.prototype.pointerUp=function(Z){var ye=this.state;ve.prototype.pointerUp.call(this,Z),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(Z),this._state="select",ye==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},z.prototype.moveVisual=function(Z){this.visual.style.transform="translate("+Z.x+"px, "+Z.y+"px)"},z.prototype.manipulate=function(Z){var ye=this.unrotatePoint(Z);this.state==="creating"?this.resize(Z):this.state==="move"?(this.left=this.manipulationStartLeft+(ye.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ye.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ye):this.state==="rotate"&&this.rotate(Z)},z.prototype.resize=function(Z){var ye=this.manipulationStartLeft,Ce=this.manipulationStartWidth,be=this.manipulationStartTop,ht=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ye=this.manipulationStartLeft+Z.x-this.manipulationStartX,Ce=this.manipulationStartWidth+this.manipulationStartLeft-ye;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Ce=this.manipulationStartWidth+Z.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:be=this.manipulationStartTop+Z.y-this.manipulationStartY,ht=this.manipulationStartHeight+this.manipulationStartTop-be;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ht=this.manipulationStartHeight+Z.y-this.manipulationStartY}Ce>=0?(this.left=ye,this.width=Ce):(this.left=ye+Ce,this.width=-Ce),ht>=0?(this.top=be,this.height=ht):(this.top=be+ht,this.height=-ht),this.setSize()},z.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},z.prototype.rotate=function(Z){if(Math.abs(Z.x-this.centerX)>.1){var ye=Math.sign(Z.x-this.centerX);this.rotationAngle=180*Math.atan((Z.y-this.centerY)/(Z.x-this.centerX))/Math.PI+90*ye,this.applyRotation()}},z.prototype.applyRotation=function(){var Z=this.container.transform.baseVal.getItem(0);Z.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Z,0)},z.prototype.rotatePoint=function(Z){if(this.rotationAngle===0)return Z;var ye=this.container.getCTM(),Ce=Ee.createPoint(Z.x,Z.y);return{x:(Ce=Ce.matrixTransform(ye)).x,y:Ce.y}},z.prototype.unrotatePoint=function(Z){if(this.rotationAngle===0)return Z;var ye=this.container.getCTM();ye=ye.inverse();var Ce=Ee.createPoint(Z.x,Z.y);return{x:(Ce=Ce.matrixTransform(ye)).x,y:Ce.y}},z.prototype.select=function(){ve.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},z.prototype.deselect=function(){ve.prototype.deselect.call(this),this.controlBox.style.display="none"},z.prototype.setupControlBox=function(){this.controlBox=Ee.createGroup();var Z=Ee.createTransform();Z.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(Z),this.container.appendChild(this.controlBox),this.controlRect=Ee.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=Ee.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 W,this.addControlGrips(),this.controlBox.style.display="none"},z.prototype.adjustControlBox=function(){var Z=this.controlBox.transform.baseVal.getItem(0);Z.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(Z,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},z.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},z.prototype.createGrip=function(){var Z=new de;return Z.visual.transform.baseVal.appendItem(Ee.createTransform()),this.controlBox.appendChild(Z.visual),Z},z.prototype.positionGrips=function(){var Z=this.controlGrips.topLeft.GRIP_SIZE,ye=-Z/2,Ce=ye,be=(this.width+this.CB_DISTANCE)/2-Z/2,ht=(this.height+this.CB_DISTANCE)/2-Z/2,Nt=this.height+this.CB_DISTANCE-Z/2,sn=this.width+this.CB_DISTANCE-Z/2;this.positionGrip(this.controlGrips.topLeft.visual,ye,Ce),this.positionGrip(this.controlGrips.topCenter.visual,be,Ce),this.positionGrip(this.controlGrips.topRight.visual,sn,Ce),this.positionGrip(this.controlGrips.centerLeft.visual,ye,ht),this.positionGrip(this.controlGrips.centerRight.visual,sn,ht),this.positionGrip(this.controlGrips.bottomLeft.visual,ye,Nt),this.positionGrip(this.controlGrips.bottomCenter.visual,be,Nt),this.positionGrip(this.controlGrips.bottomRight.visual,sn,Nt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,be,Ce-3*this.CB_DISTANCE)},z.prototype.positionGrip=function(Z,ye,Ce){var be=Z.transform.baseVal.getItem(0);be.setTranslate(ye,Ce),Z.transform.baseVal.replaceItem(be,0)},z.prototype.hideControlBox=function(){this.controlBox.style.display="none"},z.prototype.showControlBox=function(){this.controlBox.style.display=""},z.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ne.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ne.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ve.prototype.getState.call(this))},z.prototype.restoreState=function(Z){ve.prototype.restoreState.call(this,Z);var ye=Z;this.left=ye.left,this.top=ye.top,this.width=ye.width,this.height=ye.height,this.rotationAngle=ye.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ne.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ye.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ne.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ye.containerTransformMatrix))},z.prototype.scale=function(Z,ye){ve.prototype.scale.call(this,Z,ye);var Ce=this.rotatePoint({x:this.left,y:this.top}),be=this.unrotatePoint({x:Ce.x*Z,y:Ce.y*ye});this.left=be.x,this.top=be.y,this.width=this.width*Z,this.height=this.height*ye,this.adjustControlBox()},z}(F),De=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.fillColor="transparent",be.strokeColor="transparent",be.strokeWidth=0,be.strokeDasharray="",be.opacity=1,be.setStrokeColor=be.setStrokeColor.bind(be),be.setFillColor=be.setFillColor.bind(be),be.setStrokeWidth=be.setStrokeWidth.bind(be),be.setStrokeDasharray=be.setStrokeDasharray.bind(be),be.createVisual=be.createVisual.bind(be),be}return me(z,ve),z.prototype.ownsTarget=function(Z){return!(!ve.prototype.ownsTarget.call(this,Z)&&Z!==this.visual)},z.prototype.createVisual=function(){this.visual=Ee.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)},z.prototype.pointerDown=function(Z,ye){ve.prototype.pointerDown.call(this,Z,ye),this.state==="new"&&(this.createVisual(),this.moveVisual(Z),this._state="creating")},z.prototype.manipulate=function(Z){ve.prototype.manipulate.call(this,Z)},z.prototype.resize=function(Z){ve.prototype.resize.call(this,Z),this.setSize()},z.prototype.setSize=function(){ve.prototype.setSize.call(this),Ee.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},z.prototype.pointerUp=function(Z){ve.prototype.pointerUp.call(this,Z),this.setSize()},z.prototype.setStrokeColor=function(Z){this.strokeColor=Z,this.visual&&Ee.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Z),this.stateChanged()},z.prototype.setFillColor=function(Z){this.fillColor=Z,this.visual&&Ee.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},z.prototype.setStrokeWidth=function(Z){this.strokeWidth=Z,this.visual&&Ee.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},z.prototype.setStrokeDasharray=function(Z){this.strokeDasharray=Z,this.visual&&Ee.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},z.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ve.prototype.getState.call(this))},z.prototype.restoreState=function(Z){var ye=Z;this.fillColor=ye.fillColor,this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.opacity=ye.opacity,this.createVisual(),ve.prototype.restoreState.call(this,Z),this.setSize()},z.prototype.scale=function(Z,ye){ve.prototype.scale.call(this,Z,ye),this.setSize()},z.title="Rectangle marker",z}(le),Xe=function(ve){function z(Z,ye,Ce,be){var ht=ve.call(this,Z,be||'')||this;return ht.widths=[],ht.widthBoxes=[],ht.widths=ye,ht.currentWidth=Ce,ht.setCurrentWidth=ht.setCurrentWidth.bind(ht),ht}return me(z,ve),z.prototype.getUi=function(){var Z=this,ye=document.createElement("div");return ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2",this.widths.forEach(function(Ce){var be=document.createElement("div");be.style.display="flex",be.style.flexGrow="2",be.style.alignItems="center",be.style.justifyContent="space-between",be.style.padding="5px",be.style.borderWidth="2px",be.style.borderStyle="solid",be.style.borderColor=Ce===Z.currentWidth?Z.uiStyleSettings.toolboxAccentColor:"transparent",be.addEventListener("click",function(){Z.setCurrentWidth(Ce,be)}),ye.appendChild(be);var ht=document.createElement("div");ht.innerText=Ce.toString(),ht.style.marginRight="5px",be.appendChild(ht);var Nt=document.createElement("div");Nt.style.minHeight="20px",Nt.style.flexGrow="2",Nt.style.display="flex",Nt.style.alignItems="center";var sn=document.createElement("hr");sn.style.minWidth="20px",sn.style.border="0px",sn.style.borderTop=Ce+"px solid "+Z.uiStyleSettings.toolboxColor,sn.style.flexGrow="2",Nt.appendChild(sn),be.appendChild(Nt),Z.widthBoxes.push(be)}),ye},z.prototype.setCurrentWidth=function(Z,ye){var Ce=this;this.currentWidth=Z,this.widthBoxes.forEach(function(be){be.style.borderColor=be===ye?Ce.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},z}(ke),xt=function(ve){function z(Z,ye,Ce,be){var ht=ve.call(this,Z,be||'')||this;return ht.styles=[],ht.styleBoxes=[],ht.styles=ye,ht.currentStyle=Ce,ht.setCurrentStyle=ht.setCurrentStyle.bind(ht),ht}return me(z,ve),z.prototype.getUi=function(){var Z=this,ye=document.createElement("div");return ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2",this.styles.forEach(function(Ce){var be=document.createElement("div");be.style.display="flex",be.style.alignItems="center",be.style.justifyContent="space-between",be.style.padding="5px",be.style.borderWidth="2px",be.style.borderStyle="solid",be.style.overflow="hidden",be.style.maxWidth=100/Z.styles.length-5+"%",be.style.borderColor=Ce===Z.currentStyle?Z.uiStyleSettings.toolboxAccentColor:"transparent",be.addEventListener("click",function(){Z.setCurrentStyle(Ce,be)}),ye.appendChild(be);var ht=document.createElement("div");ht.style.minHeight="20px",ht.style.flexGrow="2",ht.style.overflow="hidden";var Nt=``;ht.innerHTML=Nt,be.appendChild(ht),Z.styleBoxes.push(be)}),ye},z.prototype.setCurrentStyle=function(Z,ye){var Ce=this;this.currentStyle=Z,this.styleBoxes.forEach(function(be){be.style.borderColor=be===ye?Ce.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},z}(ke),Ke=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.strokeColor=Ce.defaultColor,be.strokeWidth=Ce.defaultStrokeWidth,be.strokeDasharray=Ce.defaultStrokeDasharray,be.strokePanel=new re("Line color",Ce.defaultColorSet,Ce.defaultColor),be.strokePanel.onColorChanged=be.setStrokeColor,be.strokeWidthPanel=new Xe("Line width",Ce.defaultStrokeWidths,Ce.defaultStrokeWidth),be.strokeWidthPanel.onWidthChanged=be.setStrokeWidth,be.strokeStylePanel=new xt("Line style",Ce.defaultStrokeDasharrays,Ce.defaultStrokeDasharray),be.strokeStylePanel.onStyleChanged=be.setStrokeDasharray,be}return me(z,ve),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var Z=ve.prototype.getState.call(this);return Z.typeName=z.typeName,Z},z.typeName="FrameMarker",z.title="Frame marker",z.icon='',z}(De),ze=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},yt=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.x1=0,be.y1=0,be.x2=0,be.y2=0,be.defaultLength=50,be.manipulationStartX=0,be.manipulationStartY=0,be.manipulationStartX1=0,be.manipulationStartY1=0,be.manipulationStartX2=0,be.manipulationStartY2=0,be.setupControlBox(),be}return me(z,ve),z.prototype.ownsTarget=function(Z){return!!ve.prototype.ownsTarget.call(this,Z)||!(!this.grip1.ownsTarget(Z)&&!this.grip2.ownsTarget(Z))},z.prototype.pointerDown=function(Z,ye){ve.prototype.pointerDown.call(this,Z,ye),this.manipulationStartX=Z.x,this.manipulationStartY=Z.y,this.state==="new"&&(this.x1=Z.x,this.y1=Z.y,this.x2=Z.x,this.y2=Z.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(ye)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ye)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},z.prototype.pointerUp=function(Z){var ye=this.state;ve.prototype.pointerUp.call(this,Z),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(Z),this._state="select",ye==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},z.prototype.adjustVisual=function(){},z.prototype.manipulate=function(Z){this.state==="creating"?this.resize(Z):this.state==="move"?(this.x1=this.manipulationStartX1+Z.x-this.manipulationStartX,this.y1=this.manipulationStartY1+Z.y-this.manipulationStartY,this.x2=this.manipulationStartX2+Z.x-this.manipulationStartX,this.y2=this.manipulationStartY2+Z.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(Z)},z.prototype.resize=function(Z){switch(this.activeGrip){case this.grip1:this.x1=Z.x,this.y1=Z.y;break;case this.grip2:case void 0:this.x2=Z.x,this.y2=Z.y}this.adjustVisual(),this.adjustControlBox()},z.prototype.select=function(){ve.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},z.prototype.deselect=function(){ve.prototype.deselect.call(this),this.controlBox.style.display="none"},z.prototype.setupControlBox=function(){this.controlBox=Ee.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},z.prototype.adjustControlBox=function(){this.positionGrips()},z.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},z.prototype.createGrip=function(){var Z=new de;return Z.visual.transform.baseVal.appendItem(Ee.createTransform()),this.controlBox.appendChild(Z.visual),Z},z.prototype.positionGrips=function(){var Z=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-Z/2,this.y1-Z/2),this.positionGrip(this.grip2.visual,this.x2-Z/2,this.y2-Z/2)},z.prototype.positionGrip=function(Z,ye,Ce){var be=Z.transform.baseVal.getItem(0);be.setTranslate(ye,Ce),Z.transform.baseVal.replaceItem(be,0)},z.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ve.prototype.getState.call(this))},z.prototype.restoreState=function(Z){ve.prototype.restoreState.call(this,Z);var ye=Z;this.x1=ye.x1,this.y1=ye.y1,this.x2=ye.x2,this.y2=ye.y2},z.prototype.scale=function(Z,ye){ve.prototype.scale.call(this,Z,ye),this.x1=this.x1*Z,this.y1=this.y1*ye,this.x2=this.x2*Z,this.y2=this.y2*ye,this.adjustVisual(),this.adjustControlBox()},z}(F),Et=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.strokeColor="transparent",be.strokeWidth=0,be.strokeDasharray="",be.setStrokeColor=be.setStrokeColor.bind(be),be.setStrokeWidth=be.setStrokeWidth.bind(be),be.setStrokeDasharray=be.setStrokeDasharray.bind(be),be.strokeColor=Ce.defaultColor,be.strokeWidth=Ce.defaultStrokeWidth,be.strokeDasharray=Ce.defaultStrokeDasharray,be.strokePanel=new re("Line color",Ce.defaultColorSet,Ce.defaultColor),be.strokePanel.onColorChanged=be.setStrokeColor,be.strokeWidthPanel=new Xe("Line width",Ce.defaultStrokeWidths,Ce.defaultStrokeWidth),be.strokeWidthPanel.onWidthChanged=be.setStrokeWidth,be.strokeStylePanel=new xt("Line style",Ce.defaultStrokeDasharrays,Ce.defaultStrokeDasharray),be.strokeStylePanel.onStyleChanged=be.setStrokeDasharray,be}return me(z,ve),z.prototype.ownsTarget=function(Z){return!(!ve.prototype.ownsTarget.call(this,Z)&&Z!==this.visual&&Z!==this.selectorLine&&Z!==this.visibleLine)},z.prototype.createVisual=function(){this.visual=Ee.createGroup(),this.selectorLine=Ee.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Ee.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)},z.prototype.pointerDown=function(Z,ye){ve.prototype.pointerDown.call(this,Z,ye),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},z.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()),Ee.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Ee.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Ee.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},z.prototype.setStrokeColor=function(Z){this.strokeColor=Z,this.adjustVisual(),this.colorChanged(Z)},z.prototype.setStrokeWidth=function(Z){this.strokeWidth=Z,this.adjustVisual()},z.prototype.setStrokeDasharray=function(Z){this.strokeDasharray=Z,this.adjustVisual(),this.stateChanged()},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var Z=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ve.prototype.getState.call(this));return Z.typeName=z.typeName,Z},z.prototype.restoreState=function(Z){ve.prototype.restoreState.call(this,Z);var ye=Z;this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.createVisual(),this.adjustVisual()},z.typeName="LineMarker",z.title="Line marker",z.icon='',z}(yt),ct=function(ve){function z(Z,ye,Ce,be){var ht=ve.call(this,Z,be||'')||this;return ht.fonts=[],ht.fontBoxes=[],ht.fonts=ye,ht.currentFont=Ce,ht.setCurrentFont=ht.setCurrentFont.bind(ht),ht}return me(z,ve),z.prototype.getUi=function(){var Z=this,ye=document.createElement("div");return ye.style.overflow="hidden",ye.style.flexGrow="2",this.fonts.forEach(function(Ce){var be=document.createElement("div");be.style.display="inline-block",be.style.alignItems="center",be.style.justifyContent="space-between",be.style.padding="5px",be.style.borderWidth="2px",be.style.borderStyle="solid",be.style.overflow="hidden",be.style.maxWidth=100/Z.fonts.length-5+"%",be.style.borderColor=Ce===Z.currentFont?Z.uiStyleSettings.toolboxAccentColor:"transparent",be.addEventListener("click",function(){Z.setCurrentFont(Ce,be)}),ye.appendChild(be);var ht=document.createElement("div");ht.style.display="flex",ht.style.minHeight="20px",ht.style.flexGrow="2",ht.style.fontFamily=Ce,ht.style.overflow="hidden";var Nt=document.createElement("div");Nt.style.whiteSpace="nowrap",Nt.style.overflow="hidden",Nt.style.textOverflow="ellipsis",Nt.innerHTML="The quick brown fox jumps over the lazy dog",ht.appendChild(Nt),be.appendChild(ht),Z.fontBoxes.push(be)}),ye},z.prototype.setCurrentFont=function(Z,ye){var Ce=this;this.currentFont=Z,this.fontBoxes.forEach(function(be){be.style.borderColor=be===ye?Ce.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},z}(ke),lt=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.color="transparent",be.padding=5,be.DEFAULT_TEXT="your text here",be.text=be.DEFAULT_TEXT,be.isMoved=!1,be.color=Ce.defaultColor,be.fontFamily=Ce.defaultFontFamily,be.defaultSize={x:100,y:30},be.setColor=be.setColor.bind(be),be.setFont=be.setFont.bind(be),be.renderText=be.renderText.bind(be),be.sizeText=be.sizeText.bind(be),be.textEditDivClicked=be.textEditDivClicked.bind(be),be.showTextEditor=be.showTextEditor.bind(be),be.setSize=be.setSize.bind(be),be.positionTextEditor=be.positionTextEditor.bind(be),be.colorPanel=new re("Color",Ce.defaultColorSet,Ce.defaultColor),be.colorPanel.onColorChanged=be.setColor,be.fontFamilyPanel=new ct("Font",Ce.defaultFontFamilies,Ce.defaultFontFamily),be.fontFamilyPanel.onFontChanged=be.setFont,be}return me(z,ve),z.prototype.ownsTarget=function(Z){if(ve.prototype.ownsTarget.call(this,Z)||Z===this.visual||Z===this.textElement||Z===this.bgRectangle)return!0;var ye=!1;return this.textElement.childNodes.forEach(function(Ce){Ce===Z&&(ye=!0)}),ye},z.prototype.createVisual=function(){this.visual=Ee.createGroup(),this.bgRectangle=Ee.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Ee.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Ee.createTransform()),this.textElement.transform.baseVal.appendItem(Ee.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},z.prototype.pointerDown=function(Z,ye){ve.prototype.pointerDown.call(this,Z,ye),this.isMoved=!1,this.pointerDownPoint=Z,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Z),this._state="creating")},z.prototype.renderText=function(){var Z=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(ye){Z.textElement.appendChild(Ee.createTSpan(ye.trim()===""?" ":ye.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},z.prototype.getTextScale=function(){var Z=this.textElement.getBBox(),ye=1;if(Z.width>0&&Z.height>0){var Ce=(1*this.width-this.width*this.padding*2/100)/Z.width,be=(1*this.height-this.height*this.padding*2/100)/Z.height;ye=Math.min(Ce,be)}return ye},z.prototype.getTextPosition=function(Z){var ye=this.textElement.getBBox(),Ce=0,be=0;return ye.width>0&&ye.height>0&&(Ce=(this.width-ye.width*Z)/2,be=this.height/2-ye.height*Z/2),{x:Ce,y:be}},z.prototype.sizeText=function(){var Z=this.textElement.getBBox(),ye=this.getTextScale(),Ce=this.getTextPosition(ye);Ce.y-=Z.y*ye,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Ce.x+"px, "+Ce.y+"px) scale("+ye+", "+ye+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Ce.x,Ce.y),this.textElement.transform.baseVal.getItem(1).setScale(ye,ye))},z.prototype.manipulate=function(Z){ve.prototype.manipulate.call(this,Z),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Z.x-this.pointerDownPoint.x)>5||Math.abs(Z.y-this.pointerDownPoint.y)>5)},z.prototype.resize=function(Z){ve.prototype.resize.call(this,Z),this.isMoved=!0,this.setSize(),this.sizeText()},z.prototype.setSize=function(){ve.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Ee.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Ee.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},z.prototype.pointerUp=function(Z){var ye=this.state;ye==="creating"&&(this._suppressMarkerCreateEvent=!0),ve.prototype.pointerUp.call(this,Z),this.setSize(),(ye==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},z.prototype.showTextEditor=function(){var Z=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(ye){ye.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ye=Number.parseFloat(Z.textEditor.style.fontSize);Z.textEditor.clientWidth>=Number.parseInt(Z.textEditor.style.maxWidth)&&ye>.9;)ye-=.1,Z.textEditor.style.fontSize=Math.max(ye,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ye){ye.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ye){if(ye.clipboardData){var Ce=ye.clipboardData.getData("text"),be=window.getSelection();if(!be.rangeCount)return!1;be.deleteFromDocument(),be.getRangeAt(0).insertNode(document.createTextNode(Ce)),ye.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){Z.textEditDivClicked(Z.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},z.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var Z=this.getTextScale(),ye=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Ce=this.textElement.getBBox(),be={x:Ce.width*Z,y:Ce.height*Z};ye.x-=be.x/2,ye.y-=be.y/2,this.textEditor.style.top=ye.y+"px",this.textEditor.style.left=ye.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ye.x+"px",this.textEditor.style.fontSize=Math.max(16*Z,12)+"px",this.textElement.style.display="none"}},z.prototype.textEditDivClicked=function(Z){this.text=Z.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},z.prototype.select=function(){ve.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},z.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ve.prototype.deselect.call(this)},z.prototype.dblClick=function(Z,ye){ve.prototype.dblClick.call(this,Z,ye),this.showTextEditor()},z.prototype.setColor=function(Z){this.textElement&&Ee.setAttributes(this.textElement,[["fill",Z]]),this.color=Z,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(Z)},z.prototype.setFont=function(Z){this.textElement&&Ee.setAttributes(this.textElement,[["font-family",Z]]),this.fontFamily=Z,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},z.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},z.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var Z=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ve.prototype.getState.call(this));return Z.typeName=z.typeName,Z},z.prototype.restoreState=function(Z){var ye=Z;this.color=ye.color,this.fontFamily=ye.fontFamily,this.padding=ye.padding,this.text=ye.text,this.createVisual(),ve.prototype.restoreState.call(this,Z),this.setSize()},z.prototype.scale=function(Z,ye){ve.prototype.scale.call(this,Z,ye),this.setSize(),this.sizeText(),this.positionTextEditor()},z.typeName="TextMarker",z.title="Text marker",z.icon='',z}(le),rt=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.color="transparent",be.lineWidth=3,be.drawing=!1,be.pixelRatio=1,be.color=Ce.defaultColor,be.lineWidth=Ce.defaultStrokeWidth,be.pixelRatio=Ce.freehandPixelRatio,be.setColor=be.setColor.bind(be),be.addCanvas=be.addCanvas.bind(be),be.finishCreation=be.finishCreation.bind(be),be.setLineWidth=be.setLineWidth.bind(be),be.colorPanel=new re("Color",Ce.defaultColorSet,Ce.defaultColor),be.colorPanel.onColorChanged=be.setColor,be.lineWidthPanel=new Xe("Line width",Ce.defaultStrokeWidths,Ce.defaultStrokeWidth),be.lineWidthPanel.onWidthChanged=be.setLineWidth,be}return me(z,ve),z.prototype.ownsTarget=function(Z){return!(!ve.prototype.ownsTarget.call(this,Z)&&Z!==this.visual&&Z!==this.drawingImage)},z.prototype.createVisual=function(){this.visual=Ee.createGroup(),this.drawingImage=Ee.createImage(),this.visual.appendChild(this.drawingImage);var Z=Ee.createTransform();this.visual.transform.baseVal.appendItem(Z),this.addMarkerVisualToContainer(this.visual)},z.prototype.pointerDown=function(Z,ye){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(Z.x,Z.y),this.drawing=!0):ve.prototype.pointerDown.call(this,Z,ye)},z.prototype.manipulate=function(Z){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Z.x,Z.y),this.canvasContext.stroke()):ve.prototype.manipulate.call(this,Z)},z.prototype.resize=function(Z){ve.prototype.resize.call(this,Z),Ee.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Ee.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},z.prototype.pointerUp=function(Z){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ve.prototype.pointerUp.call(this,Z)},z.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)},z.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ve.prototype.select.call(this)},z.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ve.prototype.deselect.call(this)},z.prototype.finishCreation=function(){for(var Z=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ye=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Ce=ye[0],be=ye[1],ht=ye[2],Nt=ye[3],sn=!1,pn=0;pn0&&(sn=!0,pnNt&&(Nt=pn),zt>ht&&(ht=zt));if(sn){this.left=Ce/this.pixelRatio,this.top=be/this.pixelRatio,this.width=(ht-Ce)/this.pixelRatio,this.height=(Nt-be)/this.pixelRatio;var qn=document.createElement("canvas");qn.width=ht-Ce,qn.height=Nt-be,qn.getContext("2d").putImageData(this.canvasContext.getImageData(Ce,be,ht-Ce,Nt-be),0,0),this.drawingImgUrl=qn.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},z.prototype.setDrawingImage=function(){Ee.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Ee.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},z.prototype.setColor=function(Z){this.color=Z,this.colorChanged(Z)},z.prototype.setLineWidth=function(Z){this.lineWidth=Z},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var Z=Object.assign({drawingImgUrl:this.drawingImgUrl},ve.prototype.getState.call(this));return Z.typeName=z.typeName,Z},z.prototype.restoreState=function(Z){this.createVisual(),ve.prototype.restoreState.call(this,Z),this.drawingImgUrl=Z.drawingImgUrl,this.setDrawingImage()},z.prototype.scale=function(Z,ye){ve.prototype.scale.call(this,Z,ye),this.setDrawingImage()},z.typeName="FreehandMarker",z.title="Freehand marker",z.icon='',z}(le),qe=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,Ce||'')||this;return be.typeBoxes=[],be.currentType=ye,be.setCurrentType=be.setCurrentType.bind(be),be}return me(z,ve),z.prototype.getUi=function(){var Z=this,ye=document.createElement("div");ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2";for(var Ce=function(Nt){var sn="both";switch(Nt){case 0:sn="both";break;case 1:sn="start";break;case 2:sn="end";break;case 3:sn="none"}var pn=document.createElement("div");if(pn.style.display="flex",pn.style.flexGrow="2",pn.style.alignItems="center",pn.style.justifyContent="space-between",pn.style.padding="5px",pn.style.borderWidth="2px",pn.style.borderStyle="solid",pn.style.borderColor=sn===be.currentType?be.uiStyleSettings.toolboxAccentColor:"transparent",pn.addEventListener("click",function(){Z.setCurrentType(sn,pn)}),ye.appendChild(pn),sn==="both"||sn==="start"){var zt=document.createElement("div");zt.style.display="flex",zt.style.alignItems="center",zt.style.minHeight="20px",zt.innerHTML=``,zt.style.marginLeft="5px",pn.appendChild(zt)}var qn=document.createElement("div");qn.style.display="flex",qn.style.alignItems="center",qn.style.minHeight="20px",qn.style.flexGrow="2";var Un=document.createElement("hr");if(Un.style.minWidth="20px",Un.style.border="0px",Un.style.borderTop="3px solid "+(be.uiStyleSettings!==void 0?be.uiStyleSettings.toolboxColor:"#eeeeee"),Un.style.flexGrow="2",qn.appendChild(Un),pn.appendChild(qn),sn==="both"||sn==="end"){var rr=document.createElement("div");rr.style.display="flex",rr.style.alignItems="center",rr.style.minHeight="20px",rr.innerHTML=``,rr.style.marginRight="5px",pn.appendChild(rr)}be.typeBoxes.push(pn)},be=this,ht=0;ht<4;ht++)Ce(ht);return ye},z.prototype.setCurrentType=function(Z,ye){var Ce=this;this.currentType=Z,this.typeBoxes.forEach(function(be){be.style.borderColor=be===ye?Ce.uiStyleSettings!==void 0?Ce.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},z}(ke),$e=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.arrowType="end",be.arrowBaseHeight=10,be.arrowBaseWidth=10,be.getArrowPoints=be.getArrowPoints.bind(be),be.setArrowType=be.setArrowType.bind(be),be.arrowTypePanel=new qe("Arrow type","end"),be.arrowTypePanel.onArrowTypeChanged=be.setArrowType,be}return me(z,ve),z.prototype.ownsTarget=function(Z){return!(!ve.prototype.ownsTarget.call(this,Z)&&Z!==this.arrow1&&Z!==this.arrow2)},z.prototype.getArrowPoints=function(Z,ye){var Ce=this.arrowBaseWidth+2*this.strokeWidth,be=this.arrowBaseHeight+2*this.strokeWidth;return Z-Ce/2+","+(ye+be/2)+" "+Z+","+(ye-be/2)+" "+(Z+Ce/2)+","+(ye+be/2)},z.prototype.createTips=function(){this.arrow1=Ee.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Ee.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Ee.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Ee.createTransform()),this.visual.appendChild(this.arrow2)},z.prototype.pointerDown=function(Z,ye){ve.prototype.pointerDown.call(this,Z,ye),this.state==="creating"&&this.createTips()},z.prototype.adjustVisual=function(){if(ve.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",Ee.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Ee.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var Z=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ye=this.arrow1.transform.baseVal.getItem(0);ye.setRotate(Z,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ye,0);var Ce=this.arrow2.transform.baseVal.getItem(0);Ce.setRotate(Z+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Ce,0)}},z.prototype.setArrowType=function(Z){this.arrowType=Z,this.adjustVisual(),this.stateChanged()},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var Z=Object.assign({arrowType:this.arrowType},ve.prototype.getState.call(this));return Z.typeName=z.typeName,Z},z.prototype.restoreState=function(Z){ve.prototype.restoreState.call(this,Z);var ye=Z;this.arrowType=ye.arrowType,this.createTips(),this.adjustVisual()},z.typeName="ArrowMarker",z.title="Arrow marker",z.icon='',z}(Et),Pe=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.fillColor=Ce.defaultFillColor,be.strokeWidth=0,be.fillPanel=new re("Color",Ce.defaultColorSet,Ce.defaultFillColor),be.fillPanel.onColorChanged=be.setFillColor,be}return me(z,ve),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var Z=ve.prototype.getState.call(this);return Z.typeName=z.typeName,Z},z.typeName="CoverMarker",z.title="Cover marker",z.icon='',z}(De),je=function(ve){function z(Z,ye,Ce,be){var ht=ve.call(this,Z,be||'')||this;return ht.opacities=[],ht.opacityBoxes=[],ht.opacities=ye,ht.currentOpacity=Ce,ht.setCurrentOpacity=ht.setCurrentOpacity.bind(ht),ht}return me(z,ve),z.prototype.getUi=function(){var Z=this,ye=document.createElement("div");return ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2",ye.style.justifyContent="space-between",this.opacities.forEach(function(Ce){var be=document.createElement("div");be.style.display="flex",be.style.alignItems="center",be.style.justifyContent="center",be.style.padding="5px",be.style.borderWidth="2px",be.style.borderStyle="solid",be.style.borderColor=Ce===Z.currentOpacity?Z.uiStyleSettings.toolboxAccentColor:"transparent",be.addEventListener("click",function(){Z.setCurrentOpacity(Ce,be)}),ye.appendChild(be);var ht=document.createElement("div");ht.innerText=100*Ce+"%",be.appendChild(ht),Z.opacityBoxes.push(be)}),ye},z.prototype.setCurrentOpacity=function(Z,ye){var Ce=this;this.currentOpacity=Z,this.opacityBoxes.forEach(function(be){be.style.borderColor=be===ye?Ce.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},z}(ke),Ne=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.setOpacity=be.setOpacity.bind(be),be.fillColor=Ce.defaultHighlightColor,be.strokeWidth=0,be.opacity=Ce.defaultHighlightOpacity,be.fillPanel=new re("Color",Ce.defaultColorSet,be.fillColor),be.fillPanel.onColorChanged=be.setFillColor,be.opacityPanel=new je("Opacity",Ce.defaultOpacitySteps,be.opacity),be.opacityPanel.onOpacityChanged=be.setOpacity,be}return me(z,ve),z.prototype.setOpacity=function(Z){this.opacity=Z,this.visual&&Ee.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var Z=ve.prototype.getState.call(this);return Z.typeName=z.typeName,Z},z.typeName="HighlightMarker",z.title="Highlight marker",z.icon='',z}(Pe),et='',mt=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.bgColor="transparent",be.tipPosition={x:0,y:0},be.tipBase1Position={x:0,y:0},be.tipBase2Position={x:0,y:0},be.tipMoving=!1,be.color=Ce.defaultStrokeColor,be.bgColor=Ce.defaultFillColor,be.fontFamily=Ce.defaultFontFamily,be.defaultSize={x:100,y:30},be.setBgColor=be.setBgColor.bind(be),be.getTipPoints=be.getTipPoints.bind(be),be.positionTip=be.positionTip.bind(be),be.setTipPoints=be.setTipPoints.bind(be),be.colorPanel=new re("Text color",Ce.defaultColorSet,be.color,''),be.colorPanel.onColorChanged=be.setColor,be.bgColorPanel=new re("Fill color",Ce.defaultColorSet,be.bgColor,et),be.bgColorPanel.onColorChanged=be.setBgColor,be.fontFamilyPanel=new ct("Font",Ce.defaultFontFamilies,Ce.defaultFontFamily),be.fontFamilyPanel.onFontChanged=be.setFont,be.tipGrip=new de,be.tipGrip.visual.transform.baseVal.appendItem(Ee.createTransform()),be.controlBox.appendChild(be.tipGrip.visual),be}return me(z,ve),z.prototype.ownsTarget=function(Z){return ve.prototype.ownsTarget.call(this,Z)||this.tipGrip.ownsTarget(Z)||this.tip===Z},z.prototype.createTip=function(){Ee.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Ee.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},z.prototype.pointerDown=function(Z,ye){this.state==="new"&&ve.prototype.pointerDown.call(this,Z,ye),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ye)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ve.prototype.pointerDown.call(this,Z,ye)},z.prototype.pointerUp=function(Z){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ve.prototype.pointerUp.call(this,Z);else{var ye=this.state==="creating";ve.prototype.pointerUp.call(this,Z),this.setTipPoints(ye),this.positionTip()}},z.prototype.manipulate=function(Z){if(this.tipMoving){var ye=this.unrotatePoint(Z);this.tipPosition={x:ye.x-this.manipulationStartLeft,y:ye.y-this.manipulationStartTop},this.positionTip()}else ve.prototype.manipulate.call(this,Z)},z.prototype.setBgColor=function(Z){this.bgRectangle&&this.tip&&(Ee.setAttributes(this.bgRectangle,[["fill",Z]]),Ee.setAttributes(this.tip,[["fill",Z]])),this.bgColor=Z,this.fillColorChanged(Z)},z.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},z.prototype.setTipPoints=function(Z){Z===void 0&&(Z=!1);var ye=Math.min(this.height/2,15),Ce=this.height/5;Z&&(this.tipPosition={x:ye+Ce/2,y:this.height+20});var be=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?be',z}(lt),At=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.fillColor="transparent",be.strokeColor="transparent",be.strokeWidth=0,be.strokeDasharray="",be.opacity=1,be.strokeColor=Ce.defaultColor,be.strokeWidth=Ce.defaultStrokeWidth,be.strokeDasharray=Ce.defaultStrokeDasharray,be.fillColor=Ce.defaultFillColor,be.setStrokeColor=be.setStrokeColor.bind(be),be.setFillColor=be.setFillColor.bind(be),be.setStrokeWidth=be.setStrokeWidth.bind(be),be.setStrokeDasharray=be.setStrokeDasharray.bind(be),be.setOpacity=be.setOpacity.bind(be),be.createVisual=be.createVisual.bind(be),be.strokePanel=new re("Line color",Ae(Ce.defaultColorSet,["transparent"]),Ce.defaultColor),be.strokePanel.onColorChanged=be.setStrokeColor,be.fillPanel=new re("Fill color",Ae(Ce.defaultColorSet,["transparent"]),be.fillColor,et),be.fillPanel.onColorChanged=be.setFillColor,be.strokeWidthPanel=new Xe("Line width",Ce.defaultStrokeWidths,Ce.defaultStrokeWidth),be.strokeWidthPanel.onWidthChanged=be.setStrokeWidth,be.strokeStylePanel=new xt("Line style",Ce.defaultStrokeDasharrays,Ce.defaultStrokeDasharray),be.strokeStylePanel.onStyleChanged=be.setStrokeDasharray,be.opacityPanel=new je("Opacity",Ce.defaultOpacitySteps,be.opacity),be.opacityPanel.onOpacityChanged=be.setOpacity,be}return me(z,ve),z.prototype.ownsTarget=function(Z){return!(!ve.prototype.ownsTarget.call(this,Z)&&Z!==this.visual)},z.prototype.createVisual=function(){this.visual=Ee.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)},z.prototype.pointerDown=function(Z,ye){ve.prototype.pointerDown.call(this,Z,ye),this.state==="new"&&(this.createVisual(),this.moveVisual(Z),this._state="creating")},z.prototype.manipulate=function(Z){ve.prototype.manipulate.call(this,Z)},z.prototype.resize=function(Z){ve.prototype.resize.call(this,Z),this.setSize()},z.prototype.setSize=function(){ve.prototype.setSize.call(this),Ee.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},z.prototype.pointerUp=function(Z){ve.prototype.pointerUp.call(this,Z),this.setSize()},z.prototype.setStrokeColor=function(Z){this.strokeColor=Z,this.visual&&Ee.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Z),this.stateChanged()},z.prototype.setFillColor=function(Z){this.fillColor=Z,this.visual&&Ee.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(Z),this.stateChanged()},z.prototype.setStrokeWidth=function(Z){this.strokeWidth=Z,this.visual&&Ee.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},z.prototype.setStrokeDasharray=function(Z){this.strokeDasharray=Z,this.visual&&Ee.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},z.prototype.setOpacity=function(Z){this.opacity=Z,this.visual&&Ee.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var Z=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ve.prototype.getState.call(this));return Z.typeName=z.typeName,Z},z.prototype.restoreState=function(Z){var ye=Z;this.fillColor=ye.fillColor,this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.opacity=ye.opacity,this.createVisual(),ve.prototype.restoreState.call(this,Z),this.setSize()},z.prototype.scale=function(Z,ye){ve.prototype.scale.call(this,Z,ye),this.setSize()},z.typeName="EllipseMarker",z.title="Ellipse marker",z.icon='',z}(le),Ut=function(ve){function z(Z,ye,Ce){return ve.call(this,Z,ye,Ce)||this}return me(z,ve),Object.defineProperty(z.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),z.prototype.ownsTarget=function(Z){return!(!ve.prototype.ownsTarget.call(this,Z)&&Z!==this.tip1&&Z!==this.tip2)},z.prototype.createTips=function(){this.tip1=Ee.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(Ee.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Ee.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(Ee.createTransform()),this.visual.appendChild(this.tip2)},z.prototype.pointerDown=function(Z,ye){ve.prototype.pointerDown.call(this,Z,ye),this.state==="creating"&&this.createTips()},z.prototype.adjustVisual=function(){if(ve.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Ee.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()]]),Ee.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 Z=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ye=this.tip1.transform.baseVal.getItem(0);ye.setRotate(Z,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ye,0);var Ce=this.tip2.transform.baseVal.getItem(0);Ce.setRotate(Z+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Ce,0)}},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var Z=ve.prototype.getState.call(this);return Z.typeName=z.typeName,Z},z.prototype.restoreState=function(Z){ve.prototype.restoreState.call(this,Z),this.createTips(),this.adjustVisual()},z.typeName="MeasurementMarker",z.title="Measurement marker",z.icon='',z}(Et),Xt=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.strokePanel.colors=Ce.defaultColorSet,be.fillColor="transparent",be}return me(z,ve),Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var Z=ve.prototype.getState.call(this);return Z.typeName=z.typeName,Z},z.typeName="EllipseFrameMarker",z.title="Ellipse frame marker",z.icon='',z}(At),un=function(){function ve(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ve.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ve.prototype.addUndoStep=function(z){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(z)||(this.undoStack.push(z),JSON.stringify(this.lastRedoStep)!==JSON.stringify(z)&&this.redoStack.splice(0,this.redoStack.length))},ve.prototype.replaceLastUndoStep=function(z){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=z)},ve.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ve.prototype.undo=function(){if(this.undoStack.length>1){var z=this.undoStack.pop();return z!==void 0&&this.redoStack.push(z),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ve.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ve}(),jt=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye,Ce)||this;return be.strokeColor="transparent",be.strokeWidth=0,be.strokeDasharray="",be.curveX=0,be.curveY=0,be.manipulationStartCurveX=0,be.manipulationStartCurveY=0,be.setStrokeColor=be.setStrokeColor.bind(be),be.setStrokeWidth=be.setStrokeWidth.bind(be),be.setStrokeDasharray=be.setStrokeDasharray.bind(be),be.positionGrips=be.positionGrips.bind(be),be.addControlGrips=be.addControlGrips.bind(be),be.adjustVisual=be.adjustVisual.bind(be),be.setupControlBox=be.setupControlBox.bind(be),be.resize=be.resize.bind(be),be.strokeColor=Ce.defaultColor,be.strokeWidth=Ce.defaultStrokeWidth,be.strokeDasharray=Ce.defaultStrokeDasharray,be.strokePanel=new re("Line color",Ce.defaultColorSet,Ce.defaultColor),be.strokePanel.onColorChanged=be.setStrokeColor,be.strokeWidthPanel=new Xe("Line width",Ce.defaultStrokeWidths,Ce.defaultStrokeWidth),be.strokeWidthPanel.onWidthChanged=be.setStrokeWidth,be.strokeStylePanel=new xt("Line style",Ce.defaultStrokeDasharrays,Ce.defaultStrokeDasharray),be.strokeStylePanel.onStyleChanged=be.setStrokeDasharray,be}return me(z,ve),z.prototype.ownsTarget=function(Z){return!(!ve.prototype.ownsTarget.call(this,Z)&&Z!==this.visual&&Z!==this.selectorCurve&&Z!==this.visibleCurve&&!this.curveGrip.ownsTarget(Z))},z.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},z.prototype.createVisual=function(){this.visual=Ee.createGroup(),this.selectorCurve=Ee.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Ee.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)},z.prototype.pointerDown=function(Z,ye){ve.prototype.pointerDown.call(this,Z,ye),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=Z.x,this.curveY=Z.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ye)&&(this.activeGrip=this.curveGrip,this._state="resize")},z.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Ee.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Ee.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Ee.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},z.prototype.setupControlBox=function(){ve.prototype.setupControlBox.call(this),this.curveControlLine1=Ee.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Ee.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)},z.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ve.prototype.addControlGrips.call(this)},z.prototype.positionGrips=function(){ve.prototype.positionGrips.call(this);var Z=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-Z/2,this.curveY-Z/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()))},z.prototype.manipulate=function(Z){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+Z.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+Z.y-this.manipulationStartY),ve.prototype.manipulate.call(this,Z)},z.prototype.resize=function(Z){this.activeGrip===this.curveGrip&&(this.curveX=Z.x,this.curveY=Z.y),ve.prototype.resize.call(this,Z),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},z.prototype.setStrokeColor=function(Z){this.strokeColor=Z,this.adjustVisual(),this.colorChanged(Z)},z.prototype.setStrokeWidth=function(Z){this.strokeWidth=Z,this.adjustVisual()},z.prototype.setStrokeDasharray=function(Z){this.strokeDasharray=Z,this.adjustVisual()},z.prototype.scale=function(Z,ye){this.curveX=this.curveX*Z,this.curveY=this.curveY*ye,ve.prototype.scale.call(this,Z,ye)},Object.defineProperty(z.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),z.prototype.getState=function(){var Z=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ve.prototype.getState.call(this));return Z.typeName=z.typeName,Z},z.prototype.restoreState=function(Z){ve.prototype.restoreState.call(this,Z);var ye=Z;this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.curveX=ye.curveX,this.curveY=ye.curveY,this.createVisual(),this.adjustVisual()},z.typeName="CurveMarker",z.title="Curve marker",z.icon='',z}(yt),Zt=function(){function ve(z,Z){Z===void 0&&(Z=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=z,this.cancelable=Z}return Object.defineProperty(ve.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ve.prototype.preventDefault=function(){this._defaultPrevented=!0},ve}(),Mt=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,!1)||this;return be.dataUrl=ye,be.state=Ce,be}return me(z,ve),z}(Zt),Tt=function(ve){function z(Z,ye,Ce){Ce===void 0&&(Ce=!1);var be=ve.call(this,Z,Ce)||this;return be.marker=ye,be}return me(z,ve),z}(Zt),Ct=function(){function ve(){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 ve.prototype.addEventListener=function(z,Z){this[z].push(Z)},ve.prototype.removeEventListener=function(z,Z){var ye=this[z].indexOf(Z);ye>-1&&this[z].splice(ye,1)},ve}(),Re=function(){function ve(z){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ze,this._isOpen=!1,this.undoRedoManager=new un,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 Ct,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ve.instanceCounter++,this.styles=new fe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=z,this.targetRoot=document.body,this.width=z.clientWidth,this.height=z.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(ve.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ke,rt,$e,lt,Xt,At,Ne,mt,Ut,Pe,Et,jt]},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ke,rt,$e,lt,At,Ne,mt]},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ke,rt,$e,lt,Ne]},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(z){var Z=this;this._availableMarkerTypes.splice(0),z.forEach(function(ye){if(typeof ye=="string"){var Ce=Z.ALL_MARKER_TYPES.find(function(be){return be.typeName===ye});Ce!==void 0&&Z._availableMarkerTypes.push(Ce)}else Z._availableMarkerTypes.push(ye)})},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(z){this._zoomLevel=z,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(ve.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ve.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),pe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ve.prototype.show=function(){var z=this;this.styles.styleSheetRoot===void 0&&ie.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ie.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Z){return Z(new Zt(z))})},ve.prototype.render=function(){return se(this,void 0,void 0,function(){var z;return _e(this,function(Z){switch(Z.label){case 0:return this.setCurrentMarker(),(z=new he).naturalSize=this.renderAtNaturalSize,z.imageType=this.renderImageType,z.imageQuality=this.renderImageQuality,z.markersOnly=this.renderMarkersOnly,z.width=this.renderWidth,z.height=this.renderHeight,[4,z.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return Z.sent(),[4,z.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Z.sent()]}})})},ve.prototype.close=function(z){var Z=this;if(z===void 0&&(z=!1),this.isOpen){var ye=!1;z||this.eventListeners.beforeclose.forEach(function(Ce){var be=new Zt(Z,!0);Ce(be),be.defaultPrevented&&(ye=!0)}),ye||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(Ce){return Ce(new Zt(Z))}),this.detachEvents(),this._isOpen=!1)}},ve.prototype.addMarkersToToolbar=function(){for(var z,Z=[],ye=0;yethis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*z:this.editorCanvas.clientWidth,ye=Z',z.title="Powered by marker.js",z.style.display="grid",z.style.alignItems="center",z.style.justifyItems="center",z.style.padding="3px",z.style.width="20px",z.style.height="20px",this.logoUI.appendChild(z),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ve.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},ve.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"},ve.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ve.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var z=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=z+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Ie(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(z),1),z.dispose()},ve.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},ve.prototype.toolbarButtonClicked=function(z,Z){if(z==="marker"&&Z!==void 0)this.createNewMarker(Z);else if(z==="action")switch(Z){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},ve.prototype.deleteSelectedMarker=function(){var z=this;if(this._currentMarker!==void 0){var Z=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Ce){var be=new Tt(z,z._currentMarker,!0);Ce(be),be.defaultPrevented&&(Z=!0)}),!Z){var ye=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(Ce){return Ce(new Tt(z,ye))})}}},ve.prototype.clear=function(){var z=this,Z=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ht){var Nt=new Tt(z,void 0,!0);ht(Nt),Nt.defaultPrevented&&(Z=!0)}),!Z)){this.setCurrentMarker();for(var ye=function(ht){var Nt=Ce.markers[ht];Ce.setCurrentMarker(Ce.markers[ht]),Ce._currentMarker.dispose(),Ce.markerImage.removeChild(Ce._currentMarker.container),Ce.markers.splice(Ce.markers.indexOf(Ce._currentMarker),1),Ce.eventListeners.markerdelete.forEach(function(sn){return sn(new Tt(z,Nt))})},Ce=this,be=this.markers.length-1;be>=0;be--)ye(be);this.addUndoStep()}},Object.defineProperty(ve.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ve.prototype.showNotesEditor=function(){var z;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(z=this._currentMarker.notes)!==null&&z!==void 0?z:"",this.overlayContainer.appendChild(this.notesArea))},ve.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},ve.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ve.prototype.addUndoStep=function(){var z=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Z=this.getState(),ye=this.undoRedoManager.getLastUndoStep();if(!ye||ye.width===Z.width&&ye.height===Z.height){var Ce=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Z),Ce1&&this.panTo({x:z.clientX,y:z.clientY}))},ve.prototype.onPointerUp=function(z){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(z.clientX,z.clientY)),this.isDragging=!1,this.addUndoStep()},ve.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ve.prototype.onKeyUp=function(z){this._currentMarker===void 0||this.notesArea!==void 0||z.key!=="Delete"&&z.key!=="Backspace"||this.deleteSelectedMarker()},ve.prototype.clientToLocalCoordinates=function(z,Z){var ye=this.markerImage.getBoundingClientRect();return{x:(z-ye.left)/this.zoomLevel,y:(Z-ye.top)/this.zoomLevel}},ve.prototype.onWindowResize=function(){this.positionUI()},ve.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var z=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=z+"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()},ve.prototype.addLicenseKey=function(z){pe.addKey(z)},ve.prototype.addEventListener=function(z,Z){this.eventListeners.addEventListener(z,Z)},ve.prototype.removeEventListener=function(z,Z){this.eventListeners.removeEventListener(z,Z)},ve.prototype.renderState=function(z){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(z),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ve.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ve.prototype.focus=function(){var z=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(Z){return Z(new Zt(z))}))},ve.prototype.blur=function(){var z=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Z){return Z(new Zt(z))}))},ve.instanceCounter=0,ve}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var We=function(ve,z){return(We=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,ye){Z.__proto__=ye}||function(Z,ye){for(var Ce in ye)Object.prototype.hasOwnProperty.call(ye,Ce)&&(Z[Ce]=ye[Ce])})(ve,z)};function St(ve,z){if(typeof z!="function"&&z!==null)throw new TypeError("Class extends value "+String(z)+" is not a constructor or null");function Z(){this.constructor=ve}We(ve,z),ve.prototype=z===null?Object.create(z):(Z.prototype=z.prototype,new Z)}function ft(ve,z,Z,ye){return new(Z||(Z=Promise))(function(Ce,be){function ht(pn){try{sn(ye.next(pn))}catch(zt){be(zt)}}function Nt(pn){try{sn(ye.throw(pn))}catch(zt){be(zt)}}function sn(pn){var zt;pn.done?Ce(pn.value):(zt=pn.value,zt instanceof Z?zt:new Z(function(qn){qn(zt)})).then(ht,Nt)}sn((ye=ye.apply(ve,z||[])).next())})}function It(ve,z){var Z,ye,Ce,be,ht={label:0,sent:function(){if(1&Ce[0])throw Ce[1];return Ce[1]},trys:[],ops:[]};return be={next:Nt(0),throw:Nt(1),return:Nt(2)},typeof Symbol=="function"&&(be[Symbol.iterator]=function(){return this}),be;function Nt(sn){return function(pn){return function(zt){if(Z)throw new TypeError("Generator is already executing.");for(;ht;)try{if(Z=1,ye&&(Ce=2&zt[0]?ye.return:zt[0]?ye.throw||((Ce=ye.return)&&Ce.call(ye),0):ye.next)&&!(Ce=Ce.call(ye,zt[1])).done)return Ce;switch(ye=0,Ce&&(zt=[2&zt[0],Ce.value]),zt[0]){case 0:case 1:Ce=zt;break;case 4:return ht.label++,{value:zt[1],done:!1};case 5:ht.label++,ye=zt[1],zt=[0];continue;case 7:zt=ht.ops.pop(),ht.trys.pop();continue;default:if(!(Ce=ht.trys,(Ce=Ce.length>0&&Ce[Ce.length-1])||zt[0]!==6&&zt[0]!==2)){ht=0;continue}if(zt[0]===3&&(!Ce||zt[1]>Ce[0]&&zt[1]0&&Z>0){var ye=new Qr(z,Z),Ce=ye.ratio>=1?20:ye.getHorizontalLength(20),be=ye.ratio<1?20:ye.getVerticalLength(20),ht=document.createElementNS("http://www.w3.org/2000/svg","svg");ht.setAttribute("xmlns","http://www.w3.org/2000/svg"),ht.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ht);var Nt=bt.createDefs();ht.appendChild(Nt);var sn=bt.createElement("clipPath",[["id","text-bg-clip"]]);Nt.appendChild(sn);var pn=bt.createPath(bt.getHollowRectanglePath((24-Ce)/2,(24-be)/2,Ce,be,(24-Ce)/2+2,(24-be)/2+2,Ce-4,be-4));ht.appendChild(pn);var zt=bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);zt.appendChild(bt.createTSpan(z+":"+Z)),ht.appendChild(zt);var qn=zt.getBBox();bt.setAttributes(zt,[["x",((24-qn.width)/2).toString()],["y",((24-qn.height)/2-qn.y).toString()]]);var Un=bt.createPath(bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(qn.width))/2,(24-Math.ceil(qn.height))/2,Math.ceil(qn.width),Math.ceil(qn.height)));return sn.appendChild(Un),bt.setAttributes(pn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ht),ht.outerHTML}return''},ve}(),Xr=function(ve){function z(Z,ye,Ce){var be=ve.call(this,Z,ye)||this;return be.isDropdownOpen=!1,be.onClick=be.dropdownButtonClicked,be.dropdownButtons=Ce,be}return St(z,ve),z.prototype.setupDropdown=function(){var Z=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ye){ye.className=Z.className,ye.colorsClassName=Z.colorsClassName,Z.dropdownBlock.appendChild(ye.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},z.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},z.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},z.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},z.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},z.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},z}(Kn),Nr=function(){function ve(z,Z){this.GRIP_SIZE=10,this.color=z,this.fillColor=Z,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 ve.prototype.ownsTarget=function(z){return z===this.visual||z===this.visual.childNodes[0]||z===this.visual.childNodes[1]},ve.prototype.setCenter=function(z,Z){this.visual.childNodes.forEach(function(ye){return bt.setAttributes(ye,[["cx",z.toString()],["cy",Z.toString()]])})},ve}(),ba=function(){function ve(z,Z,ye,Ce){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=z,this.canvasHeight=Z,this.margin=ye,this.container=Ce,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(ve.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(z){this._aspectRatio=z,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(z){this._isGridVisible=z,this.gridContainer&&bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(z){this._zoomFactor=z,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ve.prototype.open=function(){var z=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 Z=0;Zthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-Z.height/2),bt.setAttributes(this.cropRectElement,[["x",Z.x.toString()],["y",Z.y.toString()],["width",Z.width.toString()],["height",Z.height.toString()]]);var ye=Z.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(be,ht){var Nt=Z.y+ye*(ht+1);bt.setAttributes(be,[["x1",""+Z.x],["y1",""+Nt],["x2",""+(Z.x+Z.width)],["y2",""+Nt]])});var Ce=Z.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(be,ht){var Nt=Z.x+Ce*(ht+1);bt.setAttributes(be,[["x1",""+Nt],["y1",""+Z.y],["x2",""+Nt],["y2",""+(Z.y+Z.height)]])}),bt.setAttributes(this.cropShadeElement,[["d",bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,Z.x,Z.y,Z.width,Z.height)]]),this.topLeftGrip.setCenter(Z.x,Z.y),this.topRightGrip.setCenter(Z.x+Z.width,Z.y),this.bottomLeftGrip.setCenter(Z.x,Z.y+Z.height),this.bottomRightGrip.setCenter(Z.x+Z.width,Z.y+Z.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ve.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)},ve.prototype.clientToLocalCoordinates=function(z,Z){var ye=this.container.getBoundingClientRect();return{x:z-ye.left+this.margin,y:Z-ye.top+this.margin}},ve.prototype.onPointerDown=function(z){this.container.setPointerCapture(z.pointerId),this.previousPoint=this.clientToLocalCoordinates(z.clientX,z.clientY),this.cropRectElement===z.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(z.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(z.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(z.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(z.target)&&(this.activeGrip=this.bottomRightGrip)},ve.prototype.onPointerMove=function(z){if(this.isMoving)this.move(this.clientToLocalCoordinates(z.clientX,z.clientY));else if(this.activeGrip){var Z=this.clientToLocalCoordinates(z.clientX,z.clientY);this.resize(Z)}z.preventDefault()},ve.prototype.onPointerUp=function(z){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(z.pointerId)},ve.prototype.move=function(z){var Z=z.x-this.previousPoint.x,ye=z.y-this.previousPoint.y;this.zoomFactor!==1&&(Z=-Z/this.zoomFactor,ye=-ye/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+Z),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ye),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=z},ve.prototype.resize=function(z){var Z=Object.assign({},this.cropRect),ye=z.x-this.previousPoint.x,Ce=z.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:Z.x+yethis.canvasWidth*this.zoomFactor&&(ye=this.canvasWidth*this.zoomFactor-Z.width),Z.width+=ye}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(Z.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ye),Z.height=this.aspectRatio.getVerticalLength(Z.width)):(Z.y+=Ce,Z.height=this.cropRect.y+this.cropRect.height-Z.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?Z.height=this.aspectRatio.getVerticalLength(Z.width):Z.height+=Ce}Z.width<10&&(Z.x=this.cropRect.x,Z.width=10),Z.height<10&&(Z.y=this.cropRect.y,Z.height=10),this.previousPoint=z,Z.x>=this.margin&&Z.y>=this.margin&&Z.x-this.margin+Z.width<=this.canvasWidth&&Z.y-this.margin+Z.height<=this.canvasHeight&&(this.cropRect=Z,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ve.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var z=this.cropRect.x+this.cropRect.width/2,Z=this.cropRect.y+this.cropRect.height/2,ye=this.aspectRatio.getHorizontalLength(this.cropRect.height),Ce=this.aspectRatio.getVerticalLength(this.cropRect.width);ye/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=z-this.cropRect.width/2,this.cropRect.y=Z-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)}},ve.prototype.getRescaledRect=function(z,Z,ye,Ce,be,ht){var Nt=ye/z,sn=Ce/Z;return{x:(be.x-ht)*Nt+ht,y:(be.y-ht)*sn+ht,width:be.width*Nt,height:be.height*sn}},ve.prototype.scaleCanvas=function(z,Z){var ye=this.getRescaledRect(this.canvasWidth,this.canvasHeight,z,Z,this.cropRect,this.margin);this.canvasWidth=z,this.canvasHeight=Z,this.onCropChange&&this.onCropChange(ye),this.setCropRectangle(ye)},ve}(),ja=function(){function ve(z){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=z,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(ve.prototype,"angle",{get:function(){return this._angle},set:function(z){this._angle=z,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ve.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},ve.prototype.onPointerDown=function(z){this.controlContainer.setPointerCapture(z.pointerId),this.isDragging=!0,this.previousPoint={x:z.clientX,y:z.clientY}},ve.prototype.onPointerMove=function(z){this.isDragging&&(this.onAngleChange&&this.onAngleChange((z.clientX-this.previousPoint.x)/5),this.previousPoint.x=z.clientX)},ve.prototype.onPointerUp=function(z){this.isDragging&&this.onAngleChange&&this.onAngleChange((z.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(z.pointerId)},ve.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var z=this.angleLabelText.getBBox();bt.setAttributes(this.angleLabelElement,[["x",((this.width-z.width)/2).toString()],["y",(this.height/2).toString()]])}},ve.prototype.positionScaleShape=function(){if(this.scaleShape){var z=this.scaleShape.transform.baseVal.getItem(0);z.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(z,0)}},ve.prototype.getVisual=function(){var z=document.createElementNS("http://www.w3.org/2000/svg","svg");z.setAttribute("xmlns","http://www.w3.org/2000/svg"),z.setAttribute("width",this.width+"px"),z.setAttribute("height",this.height+"px"),z.setAttribute("viewBox","0 0 "+this.width+" "+this.height),z.style.flexShrink="0",document.body.appendChild(z);for(var Z="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ye=1;ye<=this.width/5+10;ye++){var Ce=ye%5==0?this.height/3:this.height/6;Z+="h4v"+-Ce+"h1v"+Ce}Z+="v1H0Z",this.scaleShape=bt.createPath(Z);var be=bt.createTransform();this.scaleShape.transform.baseVal.appendItem(be),z.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 ht=bt.createTSpan("");return ht.innerHTML="°",this.angleLabelElement.appendChild(ht),z.appendChild(this.angleLabelElement),document.body.removeChild(z),z},ve}(),oi=function(){function ve(){this.naturalSize=!1,this.imageType="image/png"}return ve.prototype.rasterize=function(z,Z,ye,Ce,be,ht,Nt){var sn=this;return new Promise(function(pn){var zt=document.createElement("canvas");zt.width=z.width.baseVal.value-2*Ce,zt.height=z.height.baseVal.value-2*Ce;var qn=1,Un=1;sn.naturalSize===!0?(qn=Z.naturalWidth/(z.width.baseVal.value-2*Ce)/ht,Un=Z.naturalHeight/(z.height.baseVal.value-2*Ce)/Nt,zt.width=Z.naturalWidth/ht,zt.height=Z.naturalHeight/Nt):sn.width!==void 0&&sn.height!==void 0&&(qn=sn.width/ye.width,Un=sn.height/ye.height,zt.width*=qn,zt.height*=Un);var rr=zt.getContext("2d");rr.translate(zt.width/2,zt.height/2),rr.rotate(be*Math.PI/180),rr.scale(ht,Nt),rr.translate(-zt.width/2,-zt.height/2),rr.drawImage(Z,0,0,zt.width,zt.height);var Sr=document.createElement("canvas");Sr.width=ye.width*qn,Sr.height=ye.height*Un,Sr.getContext("2d").putImageData(rr.getImageData((ye.x-Ce)*qn,(ye.y-Ce)*Un,ye.width*qn,ye.height*Un),0,0),pn(Sr.toDataURL(sn.imageType,sn.imageQuality))})},ve}(),Le=function(){function ve(z){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=ve.instanceCounter++,this.styles=new Ht(this.instanceNo),this.target=z,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(ve.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(z){this._zoomToCropEnabled=z,z?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(z){this._isGridVisible=z,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"gridLines",{get:function(){return this._gridLines},set:function(z){this._gridLines=z,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(z){this._rotationAngle=z,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"aspectRatio",{get:function(){var z;return(z=this._aspectRatio)!==null&&z!==void 0?z:this.aspectRatios[0]},set:function(z){this._aspectRatio=z},enumerable:!1,configurable:!0}),ve.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},ve.prototype.show=function(){this.showUI(),this.open()},ve.prototype.close=function(z){z===void 0&&(z=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),z||this.closeEventListeners.forEach(function(Z){return Z()}),this._isOpen=!1)},ve.prototype.addRenderEventListener=function(z){this.renderEventListeners.push(z)},ve.prototype.removeRenderEventListener=function(z){this.renderEventListeners.indexOf(z)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(z),1)},ve.prototype.addCloseEventListener=function(z){this.closeEventListeners.push(z)},ve.prototype.removeCloseEventListener=function(z){this.closeEventListeners.indexOf(z)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(z),1)},ve.prototype.setupResizeObserver=function(){var z=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){z.resize(z.target.clientWidth,z.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},ve.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var z=1*this.target.clientWidth/this.target.clientHeight,Z=this.contentDiv.clientWidth/z>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*z:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ye=Z+2*this.CANVAS_MARGINz+this.CANVAS_MARGIN?this.target.offsetTop-(z+this.CANVAS_MARGIN):0;this.coverDiv.style.top=Z+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},ve.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ve.prototype.addTopToolbar=function(){var z=this;this.topToolbar=new vn,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 Z=new xr;Z.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(Z);var ye=[];this.aspectRatios.forEach(function(Un){var rr=new Kn(sa.getIcon(Un.horizontal,Un.vertical),Un.horizontal===0&&Un.vertical===0?"FREE":Un.horizontal+":"+Un.vertical);rr.onClick=function(){return z.ratioButtonClicked(Un)},ye.push(rr)}),this.aspectRatioButton=new Xr(sa.getIcon(0,0),"Aspect ratio",ye),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,Z.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Ce=new Kn('',"Toggle grid");Ce.isActive=this.isGridVisible,Ce.onClick=function(){z.isGridVisible=!z.isGridVisible,Ce.isActive=z.isGridVisible},Z.addButton(Ce);var be=new Kn('',"Zoom to selection");if(be.isActive=this.zoomToCropEnabled,be.onClick=function(){z.zoomToCropEnabled=!z.zoomToCropEnabled,be.isActive=z.zoomToCropEnabled},Z.addButton(be),!Ot.isLicensed){var ht=new En;this.topToolbar.addElementBlock(ht);var Nt=document.createElement("div");Nt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var sn=document.createElement("a");sn.style.color="currentColor",sn.href="https://markerjs.com/products/cropro",sn.target="_blank",sn.innerHTML='',Nt.appendChild(sn),ht.addElement(Nt)}var pn=new xr;pn.minWidth=3*this.toolbarHeight+"px",pn.contentAlign="end",this.topToolbar.addButtonBlock(pn);var zt=new Kn('',"OK");zt.onClick=this.startRenderAndClose,pn.addButton(zt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(zt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var qn=new Kn('',"Close");qn.onClick=this.close,pn.addButton(qn),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(qn.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ve.prototype.addBottomToolbar=function(){var z=this;this.bottomToolbar=new vn,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 Z=new xr;Z.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(Z);var ye=new Kn('',"Rotate left");ye.onClick=this.rotateLeftButtonClicked,Z.addButton(ye);var Ce=new Kn('',"Rotate right");Ce.onClick=this.rotateRightButtonClicked,Z.addButton(Ce);var be=new En;be.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(be),this.straightener=new ja("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(pn){z.rotateBy(pn),z.straightener.angle=z.rotationAngle},be.addElement(this.straightener.getUI());var ht=new xr;ht.minWidth=2*this.toolbarHeight+"px",ht.contentAlign="end",this.bottomToolbar.addButtonBlock(ht);var Nt=new Kn('',"Flip horizontal");Nt.onClick=this.flipHorizontallyButtonClicked,ht.addButton(Nt);var sn=new Kn('',"Flip vertical");sn.onClick=this.flipVerticallyButtonClicked,ht.addButton(sn)},ve.prototype.ratioButtonClicked=function(z){this.aspectRatio=z,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ve.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=sa.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ve.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Qr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ve.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ve.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ve.prototype.restoreState=function(z){if(z){var Z=this.cropLayer.getRescaledRect(z.width,z.height,this.imageWidth,this.imageHeight,z.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(Z),this.cropRectChanged(Z),this.flippedHorizontally=z.flippedHorizontally,this.flippedVertically=z.flippedVertically,this.applyFlip(),this.rotationAngle=z.rotationAngle,this.applyRotation()}},ve.prototype.clientToLocalCoordinates=function(z,Z){var ye=this.cropImage.getBoundingClientRect();return{x:z-ye.left,y:Z-ye.top}},ve.prototype.onWindowResize=function(){this.positionUI()},ve.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var z=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=z+"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()},ve.prototype.rotateLeftButtonClicked=function(){var z=this.rotationAngle-90;this.rotationAngle%90!=0&&(z+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(z)},ve.prototype.rotateRightButtonClicked=function(){var z=this.rotationAngle+90;this.rotationAngle%90!=0&&(z-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(z)},ve.prototype.rotateTo=function(z){z=(z=z>180?z-360:z)<=-180?z+360:z,this.rotationAngle=z,this.applyRotation()},ve.prototype.rotateBy=function(z){this.rotateTo((this.rotationAngle+z)%360)},ve.prototype.applyRotation=function(){var z=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var Z=this.editingTargetRotationContainer.transform.baseVal.getItem(0);Z.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(Z,0);var ye=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ye.width,this.imageHeight/ye.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=z},ve.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ve.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ve.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ve.prototype.startRenderAndClose=function(){return ft(this,void 0,void 0,function(){var z,Z;return It(this,function(ye){switch(ye.label){case 0:return[4,this.render()];case 1:return z=ye.sent(),Z=this.getState(),this.renderEventListeners.forEach(function(Ce){return Ce(z,Z)}),this.close(!0),[2]}})})},ve.prototype.render=function(){return ft(this,void 0,void 0,function(){var z;return It(this,function(Z){switch(Z.label){case 0:return(z=new oi).naturalSize=this.renderAtNaturalSize,z.imageType=this.renderImageType,z.imageQuality=this.renderImageQuality,z.width=this.renderWidth,z.height=this.renderHeight,this.unzoomFromCrop(),bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,z.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 Z.sent(),[4,z.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,Z.sent()]}})})},ve.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new xn("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new xn("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new xn("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var z=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new xn("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*z)+`px;
height: `+(this.toolbarHeight-2*z)+`px;
padding: `+z+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new xn("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new xn("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Gt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Gt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new xn("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new xn("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new xn("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new xn("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*z)+`px;
padding: `+z+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new xn("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},ve.instanceCounter=0,ve}(),Qe=M("8hTe"),ot=M.n(Qe),_t=/]*>/g;function Kt(ve){var z=document.createElement("div");return z.innerHTML=ve,z.childNodes.length===0?"":z.childNodes[0].nodeValue}var nn=we.a=function(ve){var z=ve.value,Z=z===void 0?"":z,ye=ve.edit,Ce=ye===void 0?!1:ye,be=ve.className,ht=ve.showTextOnly,Nt=ve.showLines,sn=ve.replaces,pn=ve.zoomImg,zt=ve.hasMask,qn=ve.style,Un=qn===void 0?{}:qn,rr=ve.stylesPrev,Sr=rr===void 0?{}:rr,ia=String(Z),Dr=Object(r.useRef)(),na=Object(r.useRef)(),Tr=Object(r.useState)(""),ma=Object(C.a)(Tr,2),ha=ma[0],Oa=ma[1],xa=Object(r.useState)("office"),ka=Object(C.a)(xa,2),Ha=ka[0],Ia=ka[1],Yr=function(){var Ar=new Le(na.current);Ar.displayMode="popup",Ar.addRenderEventListener(function(){var Gr=Object(_.a)(c.a.mark(function qr(_a){var Jr;return c.a.wrap(function(Fa){for(;;)switch(Fa.prev=Fa.next){case 0:return Dr.current.style.display="none",Fa.next=3,Object(te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:_a}});case 3:Jr=Fa.sent,Jr!=null&&Jr.id&&sn(na.current.getAttribute("src").replace(N.a.API_SERVER,""),"/api/attachments/".concat(Jr==null?void 0:Jr.id,"?type=").concat(Jr.content_type));case 5:case"end":return Fa.stop()}},qr)}));return function(qr){return Gr.apply(this,arguments)}}()),Ar.show()},za=function(){var Ar=new Re(na.current);Ar.settings.displayMode="popup",Ar.addEventListener("render",function(){var Gr=Object(_.a)(c.a.mark(function qr(_a){var Jr;return c.a.wrap(function(Fa){for(;;)switch(Fa.prev=Fa.next){case 0:if(Dr.current.style.display="none",!na.current){Fa.next=6;break}return Fa.next=4,Object(te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:_a.dataUrl}});case 4:Jr=Fa.sent,Jr!=null&&Jr.id&&sn(na.current.getAttribute("src").replace(N.a.API_SERVER,""),"/api/attachments/".concat(Jr==null?void 0:Jr.id,"?type=").concat(Jr.content_type));case 6:case"end":return Fa.stop()}},qr)}));return function(qr){return Gr.apply(this,arguments)}}()),Ar.show(),window.markerArea=Ar},Ga=Object(r.useMemo)(function(){try{var zr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ar=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Gr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;ia=ia.replace(zr,"("+N.a.API_SERVER+"/api/attachments/").replace(Ar,'"'+N.a.API_SERVER+"/api/attachments/").replace(Gr,'"'+N.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,`
`),ia=ia.replace(new RegExp("(?[TOC]
",B()),p()),qr=qr.replace(/(__special_katext_id_\d+__)/g,function(ji,Fa){var vi=_a[Fa],vo=vi.type,Wo=vi.expression;return Object(Q.renderToString)(Kt(Wo)||"",{displayMode:vo==="block",throwOnError:!1,output:"html"})}),qr=qr.replace(/▁/g,"\u2581\u2581\u2581"),T(),ht){var Jr=document.createElement("div");return Jr.innerHTML=qr,Jr.innerText}return setTimeout(function(){return di()},500),qr},[ia]),Da=Object(r.useRef)();S.WebkitLineClamp=Nt,Nt&&(Un=Object(E.a)(Object(E.a)({},Un),S));function si(zr){var Ar=zr.target;if(Ar.tagName.toUpperCase()==="IMG"){if(pn){var Gr=Ar.getAttribute("src");Oa(Gr),Ia("image")}}else if(Ar.tagName.toUpperCase()==="A"){var qr=Ar.getAttribute("href");if(qr.indexOf("office")>-1)zr.preventDefault(),Oa(qr),Ia("office");else if(qr.indexOf("application/pdf")>-1)zr.preventDefault(),Oa(qr),Ia("pdf");else if(qr.indexOf("type=text")>-1)zr.preventDefault(),Oa(qr),Ia("html");else if(qr.startsWith("#")){zr.preventDefault();var _a=document.getElementById(qr.replace("#",""));_a&&_a.scrollIntoView(!0)}}}var di=function(){var Ar,Gr=(Ar=Da.current)===null||Ar===void 0?void 0:Ar.querySelectorAll("video");Gr==null||Gr.forEach(function(qr){if(qr.oncontextmenu=function(){return!1},qr.src.indexOf(".m3u8")>-1&&!qr.canPlayType("application/vnd.apple.mpegurl")){if(G.a.isSupported()){var _a=new G.a;_a.loadSource(qr.src),_a.attachMedia(qr)}}})};Object(r.useEffect)(function(){if(Da.current&&Ga&&(Ga.match(_t)&&window.PR.prettyPrint()),Da.current)return Da.current.addEventListener("click",si),function(){Da.current.removeEventListener("click",si),T(),p()}},[Ga,Da.current,si]);var Ma=function(Ar){if(!Ce)return;Ar.target.nodeName==="IMG"?(Dr.current.style.display="flex",Dr.current.style.width=Ar.target.clientWidth+"px",Dr.current.style.height=Ar.target.clientHeight+"px",Dr.current.style.top=Ar.target.offsetTop+"px",Dr.current.style.left=Ar.target.offsetLeft+"px",na.current.src=Ar.target.getAttribute("src")):Dr.current.style.display="none"};return n.a.createElement("div",{style:{position:"relative"}},n.a.createElement("div",{ref:Da,style:Object(E.a)({},Un),className:"".concat(be||""," markdown-body ").concat(ot.a.mdBody),onMouseOver:Ma,dangerouslySetInnerHTML:{__html:Ga}}),n.a.createElement("div",{ref:Dr,className:ot.a.button},n.a.createElement(Y.a,null,n.a.createElement(y.a,{onClick:function(){return Yr()}},"\u88C1\u526A"),n.a.createElement(y.a,{onClick:function(){return za()}},"\u7F16\u8F91"))),n.a.createElement("img",{ref:na,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),n.a.createElement(X.a,{close:!0,data:ha,hasMask:zt,type:ha!=null&&ha.length?Ha:"",style:Object(E.a)({},Sr),onClose:function(){return Oa("")}}))}},"9VGf":function(Ze,we,M){"use strict";M.d(we,"a",function(){return P});var ue=M("q1tI"),Y=M.n(ue);function P(y,E){var _=Object(ue.useRef)();Object(ue.useEffect)(function(){_.current=y}),Object(ue.useEffect)(function(){function C(){_.current()}if(E!==null){var m=setInterval(C,E);return function(){return clearInterval(m)}}},[E])}},"9nDM":function(Ze,we,M){},"A/g1":function(Ze,we){Ze.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjEtMDctMDJUMTk6Mzg6MjMrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmVkYzRhODM0LTVjNWQtNDQ1My04MDYzLWNkNzcwODQyODg5ZSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjQ4MTE0OTVlLTVkMDctZTk0YS1iNWEwLWYxOWJmZmM0NGUyNyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOmMwNjQyYzA1LTg5MzQtNDdlYy04MTFiLTlkYjdhZGNkYjFiMCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6YzA2NDJjMDUtODkzNC00N2VjLTgxMWItOWRiN2FkY2RiMWIwIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjM4OjIzKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZWRjNGE4MzQtNWM1ZC00NDUzLTgwNjMtY2Q3NzA4NDI4ODllIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5fJkpyAAAGoElEQVRogc2abWxbVxnH/8+59/rdTpx2GW3UNWJJV7Ylaxp3LUFsWgJDiI5R8bK2GppAmsgQLKQthS8IEJ9okibrREf3gX2Y1K2bxAoDtog60RBSVxKnWUO7kpSppXJZK2ja2HFi33vPw4cmpbN9r++1k8Lv2znnf577f+zje95Mhw4dQqUkwljpF7kuv0EdHkm1HklRr6TQq2tn5xcklwhIMnMSQJIJxykTiSce+1am0mer5XacqM7uDJjiqbAuWlvSygrBnmKyxcoIA+tBBAAgAAikjNZ47zCIh8E8mOjYO1aOD3L7DYzXZJurs8qhuzLqFsH22hcbUs6CMudAol8Ic2Dkkb0fuvEj3IinwvobjTOeRP1safOuIPIA/AMpxbsb4z3fc9PVUQLvRY37L/vMDxtT2peCBpU97BywlkD9sXjvbzcfG7jTSYeSCZyK6l9tTCkn75xXHAVcChh4zCDzLy1DfQ+U0tomcDaSO9A8rb0WWN5P3QK+SzCPx471bLdTWSYwFdZfXz/j+e7SG3MHE73SGu+19FE0gTNV+o8aU9pXls+Waw7E4r2fL9ZQkMB4jd5xd1r96fJ7cgeDX944vL8hv74ggdUZccRrLsw4/1fQCpLyYH7tRxKYCutv1M4rK26fKdd8Nn+euJnAySp9w+o5dettt+QSItHV+nb/qsXyzddj1KAXlnmSsuIMgV8v1sCgHxdWcj002QXgh8BCAqdq9B33T2tbltOlBWcEia+NtO86nd/QOtR3EGyxXmHZHXun78jow7tPCgAI6NixpGsbZ1ibj/d2gvkZy55EHpbcDiz8BkK62LRsNotjaX5TvK8NzH0lI5j0aQAQ4z69pjarfGwZTFphab55sCdogntAFCgZhfgLn3xtv19oPnTexuFjaR4ANJV6CWhzGEvNrpQPiYBOt+vVaWu+Nd7bCaDTTUCS9LDwSNQuiT17bM3fGPd4zn1YWSc8kqJO5e9H9P6LAeNvLp9ia755sCcoiftAKLqptoOI6oRXUsiJ+FxIf/MTM9quNRl1/XhN7p7zQWPUQTdb88CNcQ9GWXMQA3XCb5JWSngxYJxtSGtfXCxvuOqZrJ9VN53wpcMfhIxhs8jSb0aT2VLmyxn3edQ52hOnNf5dsfrN86H0x9Nqu8KgqbBxdF5hCdwwfyFkPmFnflO8rw3AL8qy/V9YzCmsl1I1pNTdp6N6t52mMaVu85mkTEb0ly6EzCeaprXfWGmbB3uCTHgOLk9FCqGkmhWcBlBjJ9MkUX1K3TcRzV5qmvYesdOum9G+Weqxmop+Zo65dFsAEydFTvC0E3HQIHVNWnvpvRVGRYu+G+Oenq4kxiIk+ZLIKbjitEO1Lvyr0/SHieD8qtLqQhbG/Qvl9C2OSIqMWvwHasUdWSW6Umojbh/VPNgTlOCCLWElsOB3hO7BL6XLHfCqOaXuYsA466aPR6XnAZQ8qHKB4fWJP4kNV7SrV3ymqwNVAFiTUe85HzLedaKNxfd/h4FvuPdoA9Hvj7ftmhMAkFbZyaxaQH1a3XwurL9tp4kN7fsUQz5fTnxbGH8GFt7DcwpecTuMFmlIaZ+bjOgvF2u7d/gnIWZR+Q1KPowcIIaAhQSarqmH/xE0TpQbb92M9uT7kdz+/HqfDB0EcF/ZRi1ggYFER/cYcMtMOO3jzlmVjXKDrkt5uv9are9ZLJ8L6UcJ+HplVotygVRlYLFwM4GWf2njl/ymq1fqrSgM3J1Sfz5Rnd15ulp/tiGtPV6h0aIwaCDxUPc/F8sfOQdqTKnbrvjMf9fOK7ZLCyv8Jom1s9qvsHANttQw4dhY++6BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},A2z3:function(Ze,we,M){Ze.exports=M.p+"static/Certificate.80413b23.png"},AZ8Y:function(Ze,we,M){"use strict";M.r(we);var ue=M("T2oS"),Y=M("W9HT"),P=M("k1fw"),y=M("9og8"),E=M("tJVT"),_=M("PpiC"),C=M("Znn+"),m=M("ZTPi"),c=M("WmNS"),r=M.n(c),n=M("q1tI"),e=M.n(n),s=M("Ty5D"),u=M("9kvl"),o=M("oBTY"),f=M("pC0b"),d=M("GzdX"),a=M("+L6B"),h=M("2/Rp"),g=M("+BJd"),p=M("mr32"),S=M("qVdP"),w=M("jsC+"),B=M("lUTK"),b=M("BvKs"),A=M("5Dmo"),l=M("3S7+"),i=M("7Kak"),x=M("9yH6"),O=M("2qtc"),T=M("kLXV"),D=M("miYZ"),R=M("tsqr"),k=M("0NbB"),H=M("JTSX"),J=M.n(H),U=M("xKgJ"),K=M("Mgx3"),G=M("ozfa"),N=M("MJZm"),Q=M("sRBo"),X=M("kaz8"),te=M("14J3"),oe=M("BMrR"),me=M("jCWc"),se=M("kPKH"),_e=M("OaEy"),Ae=M("2fM7"),Ee=M("wd/R"),pe=M.n(Ee),he=M("kNP/"),ie=M.n(he),fe=M("1vsH"),ge=Ae.a.Option,ce=function(Ye){var Je=Ye.pathsDetail,Te=Ye.globalSetting,Ve=Ye.loading,Be=Ye.dispatch,at=Object(_.a)(Ye,["pathsDetail","globalSetting","loading","dispatch"]),nt=Object(s.i)(),st=Object(n.useState)(),it=Object(E.a)(st,2),dt=it[0],Dt=it[1],Qt=Object(n.useState)([]),Bt=Object(E.a)(Qt,2),$t=Bt[0],ln=Bt[1],On=Object(n.useState)([]),Wt=Object(E.a)(On,2),qt=Wt[0],yn=Wt[1],Rn=Object(n.useState)([]),tn=Object(E.a)(Rn,2),bn=tn[0],Ln=tn[1],Xn=Object(n.useState)(),rn=Object(E.a)(Xn,2),hn=rn[0],An=rn[1],_n=Object(n.useState)(),tr=Object(E.a)(_n,2),cn=tr[0],Fn=tr[1],Ir=Object(n.useState)(!0),hr=Object(E.a)(Ir,2),Br=hr[0],ur=hr[1];Object(n.useEffect)(function(){Je.actionTabs.key==="PathsDetail-SendToClass"&&Qn()},[Je.actionTabs.key]);var Fr=function(on){switch(on.item_type){case"Shixun":return e.a.createElement("span",null,e.a.createElement("span",{className:"mr5 c-light-primary"},"\u5B9E\u8BAD"),on.name);case"Attachment":return e.a.createElement("span",null,e.a.createElement("span",{className:"mr5 c-cyan-blue"},"\u8BFE\u4EF6"),on.name);case"VideoItem":return e.a.createElement("span",null,e.a.createElement("span",{className:"mr5 c-purple-8C1"},"\u89C6\u9891"),on.name);case"StageCatalog":return e.a.createElement("span",null,on.name);default:return""}},Qn=function(){var fn=Object(y.a)(r.a.mark(function on(){var Gn,Jn,Sn;return r.a.wrap(function(Kr){for(;;)switch(Kr.prev=Kr.next){case 0:return Kr.next=2,Object(K.G)({id:nt.pathId});case 2:Gn=Kr.sent,Gn&&(ln((Gn==null?void 0:Gn.courses)||[]),Sn=(Jn=Gn.stages)===null||Jn===void 0?void 0:Jn.map(function(Va,Ra){var aa;return{title:Va.state_name||"",key:Ra,children:(aa=Va.items)===null||aa===void 0?void 0:aa.map(function(gi,ti){var Ka;return Object(P.a)(Object(P.a)({},gi),{},{disabled:gi.is_jupyter,title:Fr(gi),key:"".concat(Ra,"-").concat(ti),children:(Ka=gi.children)===null||Ka===void 0?void 0:Ka.map(function(no,ro){return Object(P.a)(Object(P.a)({},no),{},{disabled:no.is_jupyter,title:Fr(no),key:"".concat(Ra,"-").concat(ti,"-").concat(ro)})})})})}}),yn(Sn||[]));case 4:case"end":return Kr.stop()}},on)}));return function(){return fn.apply(this,arguments)}}(),kr=function(on,Gn){Ln(on)},ta=function(on){var Gn=on.target.checked,Jn=[];qt==null||qt.map(function(Sn,mr){var Kr;Jn.push(mr),Sn==null||((Kr=Sn.children)===null||Kr===void 0)||Kr.map(function(Va,Ra){var aa;Jn.push("".concat(mr,"-").concat(Ra)),Va==null||((aa=Va.children)===null||aa===void 0)||aa.map(function(gi,ti){Jn.push("".concat(mr,"-").concat(Ra,"-").concat(ti))})})}),Ln(Gn?Jn:[])},Wr=function(){var on=bn.filter(function(Kr){return typeof Kr=="string"}),Gn=[],Jn=[],Sn=[],mr=[];return qt==null||qt.map(function(Kr,Va){var Ra;Kr==null||((Ra=Kr.children)===null||Ra===void 0)||Ra.map(function(aa,gi){var ti;on.includes("".concat(Va,"-").concat(gi))&&(Sn.push(aa.stage_item_id),aa.item_type==="Shixun"?Gn.push(aa.id):aa.item_type==="Attachment"?mr.push(aa.id):aa.item_type==="VideoItem"&&Jn.push(aa.id)),aa==null||((ti=aa.children)===null||ti===void 0)||ti.map(function(Ka,no){on.includes("".concat(Va,"-").concat(gi,"-").concat(no))&&(Sn.push(Ka.stage_item_id),Ka.item_type==="Shixun"?Gn.push(Ka.id):Ka.item_type==="Attachment"?mr.push(Ka.id):Ka.item_type==="VideoItem"&&Jn.push(Ka.id))})})}),{shixunIds:Gn,videoItemIds:Jn,stageItemIds:Sn,coursewareIds:mr}},yr=function(){var fn=Object(y.a)(r.a.mark(function on(){var Gn,Jn,Sn;return r.a.wrap(function(Kr){for(;;)switch(Kr.prev=Kr.next){case 0:if(Gn=Wr(),Jn=Gn.stageItemIds,console.log(Jn,"stageItemIds"),dt){Kr.next=5;break}return R.b.info("\u60A8\u8FD8\u672A\u9009\u62E9\u53D1\u9001\u7684\u8BFE\u5802"),Kr.abrupt("return");case 5:if(!(!jn.length&&!ir.length&&!zn.length)){Kr.next=8;break}return R.b.info("\u60A8\u8FD8\u672A\u9009\u62E9\u5B9E\u8BAD\u6216\u8005\u89C6\u9891"),Kr.abrupt("return");case 8:return Fn(!0),Kr.next=11,Object(K.P)({id:nt.pathId,course_id:dt,stage_item_id:Jn,sync_catelog:Br?1:0}).catch(function(Va){return Fn(!1)});case 11:Sn=Kr.sent,Fn(!1),Dn(),(Sn==null?void 0:Sn.status)===1&&T.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:e.a.createElement("div",{className:"tc"},Sn.message),onOk:function(){var Ra,aa=Sn==null||((Ra=Sn.url.split("/"))===null||Ra===void 0)?void 0:Ra[2];Object(fe.Q)("/classrooms/".concat(aa,"/shixun_homework"))}});case 15:case"end":return Kr.stop()}},on)}));return function(){return fn.apply(this,arguments)}}(),Dn=function(){Be({type:"pathsDetail/setActionTabs",payload:{}}),Dt(null),Ln([]),An(null)},ar=Wr(),Pr=ar.shixunIds,jn=Pr===void 0?[]:Pr,$n=ar.videoItemIds,ir=$n===void 0?[]:$n,Zn=ar.coursewareIds,zn=Zn===void 0?[]:Zn;return e.a.createElement(T.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Je.actionTabs.key==="PathsDetail-SendToClass",title:"\u53D1\u9001\u81F3\u8BFE\u5802",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:cn,width:600,onOk:yr,onCancel:Dn},e.a.createElement("div",{className:ie.a.wrap},e.a.createElement("div",{className:"mb10"},e.a.createElement(Ae.a,{placeholder:"\u8BF7\u9009\u62E9\u60A8\u8981\u53D1\u9001\u7684\u8BFE\u5802",defaultOpen:!1,value:dt,style:{width:"100%"},onSelect:function(on){return Dt(on)},optionLabelProp:"lable"},$t==null?void 0:$t.map(function(fn,on){return e.a.createElement(ge,{key:fn.course_id,value:fn.course_id,lable:fn.course_name},e.a.createElement(oe.a,{justify:"space-between"},e.a.createElement(se.a,null,fn.course_name),e.a.createElement(se.a,null,pe()(fn.created_at).format("YYYY-MM-DD HH:mm"),"\xA0")))}))),e.a.createElement("div",{className:ie.a.title},"\u6E29\u99A8\u63D0\u793A\uFF1A",e.a.createElement("br",null),"1.\u8BF7\u5728\u672C\u8BFE\u7A0B\u4E2D\u9009\u62E9\u6240\u9700\u9879\u76EE\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802\uFF1B",e.a.createElement("br",null),"2.\u672A\u53D1\u5E03\u7684\u5B9E\u8BAD\u4E0D\u80FD\u53D1\u9001\u81F3\u8BFE\u5802\uFF0C\u4E5F\u4E0D\u4F1A\u8FDB\u5165\u672C\u5F39\u7A97\u5907\u9009\u3002"),e.a.createElement("div",{className:ie.a.radioWrap},e.a.createElement("div",null,e.a.createElement(X.a,{value:hn,onChange:ta,className:"font14 ml20"},"\u5168\u9009")),!!(qt!=null&&qt.length)&&e.a.createElement(N.a,{className:ie.a.tree,checkable:!0,defaultExpandAll:!0,treeData:qt,checkedKeys:bn,onCheck:function(on,Gn){return kr(on,Gn)}})),e.a.createElement("div",{className:ie.a.createMkdir},e.a.createElement(X.a,{checked:Br,onChange:function(on){return ur(on.target.checked)},className:"font14"},"\u9009\u4E2D\u7AE0\u8282\u5728\u8BFE\u5802\u4E2D\u540C\u6B65\u751F\u6210\u76EE\u5F55"),!!(jn.length+ir.length)&&e.a.createElement("span",null,e.a.createElement("span",null,"\u5DF2\u9009\u4E2D\uFF1A"),!!jn.length&&e.a.createElement(e.a.Fragment,null,e.a.createElement("span",{className:"c-light-primary"},jn.length," "),e.a.createElement("span",null,"\u4E2A\u5B9E\u8BAD")),!!ir.length&&e.a.createElement(e.a.Fragment,null,e.a.createElement("span",{className:"c-purple-8C1 ml5"},ir.length," "),e.a.createElement("span",null,"\u4E2A\u89C6\u9891")),!!zn.length&&e.a.createElement(e.a.Fragment,null,e.a.createElement("span",{className:"c-cyan-blue ml5"},zn.length," "),e.a.createElement("span",null,"\u4E2A\u8BFE\u4EF6"))))))},Ie=Object(u.a)(function(Ge){var Ye=Ge.pathsDetail,Je=Ge.loading,Te=Ge.globalSetting;return{pathsDetail:Ye,globalSetting:Te,loading:Je.effects}})(ce),Fe=M("NLgs"),ke=M("5NDa"),re=M("5rEg"),F=M("6UJt"),W=M("DFOY"),de=M("y8nQ"),ne=M("Vl3Y"),le=M("ErOA"),De=M("OC45"),Xe=M.n(De),xt=function(Ye){var Je=Ye.type,Te=Ye.onCancel,Ve=Ye.onOk,Be=ne.a.useForm(),at=Object(E.a)(Be,1),nt=at[0],st=Object(n.useState)(!0),it=Object(E.a)(st,2),dt=it[0],Dt=it[1],Qt=Object(n.useState)(!1),Bt=Object(E.a)(Qt,2),$t=Bt[0],ln=Bt[1],On=Object(n.useState)([]),Wt=Object(E.a)(On,2),qt=Wt[0],yn=Wt[1];Object(n.useEffect)(function(){Rn()},[]);var Rn=function(){var bn=Object(y.a)(r.a.mark(function Ln(){var Xn;return r.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:if(!Je){hn.next=7;break}return ln(!0),hn.next=4,Object(le.a)("/api/disciplines.json",{method:"get",params:{source:Je}});case 4:Xn=hn.sent,yn(Xn.disciplines||[]),ln(!1);case 7:case"end":return hn.stop()}},Ln)}));return function(){return bn.apply(this,arguments)}}(),tn=function(){var Ln=nt.getFieldsValue(),Xn=Ln.sub_discipline_id,rn=Ln.discipline_name,hn=Ln.sub_discipline_name;if((!Xn||Xn&&Xn.length===0)&&(!rn||!hn))return R.b.warn("\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B"),!1;Ve({user_customize:Xn&&Xn.length===0||!Xn,sub_discipline_id:Xn,discipline_name:rn,sub_discipline_name:hn})};return e.a.createElement(T.a,{width:600,className:Xe.a.applyPublicContainer,title:"\u6DFB\u52A0\u65B9\u5411&\u8BFE\u7A0B\u5F39\u7A97",okText:"\u7533\u8BF7\u516C\u5F00",visible:!0,onCancel:Te,onOk:tn},e.a.createElement("div",{className:Xe.a.applyPublicContent},e.a.createElement("div",{className:Xe.a.tips},"\u9700\u586B\u5199\u5B9E\u8DF5\u9879\u76EE\u7684\u65B9\u5411&\u8BFE\u7A0B\u540E\uFF0C\u624D\u80FD\u7533\u8BF7\u516C\u5F00"),e.a.createElement(ne.a,{labelCol:{span:4},labelAlign:"right",form:nt},e.a.createElement(ne.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"sub_discipline_id"},e.a.createElement(W.a,{expandTrigger:"hover",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:qt,fieldNames:{label:"name",value:"id",children:"sub_disciplines"},onChange:function(Ln,Xn){return nt.setFieldsValue({sub_discipline_id:Ln})}}),e.a.createElement("div",{className:Xe.a.action,onClick:function(){return Dt(!dt)}},e.a.createElement("div",null,"\u81EA\u5B9A\u4E49\u65B9\u5411&\u8BFE\u7A0B"),e.a.createElement("div",null,e.a.createElement("span",null,dt?"\u5C55\u5F00":"\u6536\u8D77"),e.a.createElement("span",null,e.a.createElement("i",{className:"iconfont ".concat(dt?"icon-zhankai2":"icon-shouqi1")}))))),!dt&&e.a.createElement(e.a.Fragment,null,e.a.createElement(ne.a.Item,{label:"\u65B9\u5411",name:"discipline_name"},e.a.createElement(re.a,{placeholder:"\u8BF7\u8F93\u5165\u65B9\u5411",autoComplete:"off"})),e.a.createElement(ne.a.Item,{label:"\u8BFE\u7A0B",name:"sub_discipline_name"},e.a.createElement(re.a,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B",autoComplete:"off"})))),$t&&e.a.createElement("div",{className:Xe.a.spin},e.a.createElement(Y.a,null))))},Ke=xt,ze=M("9Bee"),yt=M("m3rI"),Et=M("OljG"),ct=M.n(Et),lt=M("MKdu"),rt=M.n(lt),qe=M("m/50"),$e=M.n(qe),Pe=M("Nddv"),je=M.n(Pe),Ne=M("vUf6"),et=M.n(Ne),mt=function(Ye){var Je,Te,Ve,Be,at,nt,st,it,dt,Dt,Qt,Bt,$t,ln,On,Wt,qt,yn,Rn,tn,bn,Ln,Xn,rn,hn,An,_n,tr,cn,Fn,Ir,hr,Br,ur,Fr,Qn,kr,ta,Wr,yr,Dn,ar,Pr,jn,$n,ir,Zn,zn,fn,on,Gn,Jn,Sn,mr,Kr,Va,Ra,aa,gi,ti,Ka,no,ro,Di,Io,Mo,ao,Ii,ki,So,co,ho,Qi,Mi,Vi,Ki,go,Fi,yo,Xa,io,Lo,Wi,Ti,Ao,qo,$o,Go,Xi,es,yi,Ua,li,Na,Yi,bo,Li,Vo,Po,Xo,Bi,In,Ji,vs,ts,ca,Ur,ui,wa,To,Zi,Eo,oo,dn=Ye.pathsDetail,Uo=Ye.user,Ss=Ye.globalSetting,gs=Ye.loading,Za=Ye.dispatch,Tn=Object(_.a)(Ye,["pathsDetail","user","globalSetting","loading","dispatch"]),Lt=Object(s.i)(),Yt=Object(n.useState)({}),Cn=Object(E.a)(Yt,2),Vt=Cn[0],er=Cn[1],lr=Object(n.useRef)(1),fr=Object(n.useState)(),$r=Object(E.a)(fr,2),mn=$r[0],ni=$r[1],Pi=Object(n.useState)(!1),La=Object(E.a)(Pi,2),da=La[0],Oi=La[1],qi=Object(n.useState)(!1),qa=Object(E.a)(qi,2),Ya=qa[0],fi=qa[1],ko=Object(n.useState)({status:!1}),Fo=Object(E.a)(ko,2),No=Fo[0],jo=Fo[1],Ts=((Je=dn.detail)===null||Je===void 0?void 0:Je.is_free)||((Te=dn.detail)===null||Te===void 0?void 0:Te.can_learning);Object(n.useEffect)(function(){jo({status:!1})},[]),Object(n.useEffect)(function(){function Zr(){return Rr.apply(this,arguments)}function Rr(){return Rr=Object(y.a)(r.a.mark(function Ta(){var Or,Wn,Pn,wn,nr,Bn,_r;return r.a.wrap(function(jr){for(;;)switch(jr.prev=jr.next){case 0:return jr.next=2,Za({type:"pathsDetail/getPathsDetail",payload:{id:Lt.pathId}});case 2:Or=jr.sent,Or!=null&&Or.toast&&(Or!=null&&(Wn=Or.toast)!==null&&Wn!==void 0&&Wn.is_open&&((Pn=Or.toast)===null||Pn===void 0?void 0:Pn.open_num)===-1?fi(!0):Or!=null&&(wn=Or.toast)!==null&&wn!==void 0&&wn.is_open&&(Or==null||((nr=Or.toast)===null||nr===void 0)?void 0:nr.open_num)===1?(_r=JSON.parse(localStorage.getItem("pathsshow"))||[],((Bn=_r.filter(function(Pa){return Pa===(Lt==null?void 0:Lt.pathId)}))===null||Bn===void 0?void 0:Bn.length)>0?fi(!1):(fi(!0),_r.push(Lt==null?void 0:Lt.pathId),localStorage.setItem("pathsshow",JSON.stringify(_r)))):fi(!1));case 4:case"end":return jr.stop()}},Ta)})),Rr.apply(this,arguments)}Zr()},[]),Object(n.useEffect)(function(){var Zr,Rr,Ta,Or,Wn=(Zr=dn.detail)===null||Zr===void 0||((Rr=Zr.courses)===null||Rr===void 0)?void 0:Rr.length;if(!Wn)return;var Pn;if((Ta=dn.detail)!==null&&Ta!==void 0&&Ta.has_start){var wn,nr,Bn=(wn=dn.detail)===null||wn===void 0||((nr=wn.courses)===null||nr===void 0)?void 0:nr.findIndex(function(pi){var Ei;return((Ei=pi.course_status)===null||Ei===void 0?void 0:Ei.status)===1});Pn=Bn>-1?Bn:0}else{var _r,Mr,jr,Pa,Ja,bi=(_r=dn.detail)===null||_r===void 0||((Mr=_r.courses)===null||Mr===void 0||((jr=Mr.map(function(pi){var Ei;return(Ei=pi.course_status)===null||Ei===void 0?void 0:Ei.status}))===null||jr===void 0))?void 0:jr.lastIndexOf(2);Pn=bi>-1?bi:0,bi=(Pa=dn.detail)===null||Pa===void 0||((Ja=Pa.courses)===null||Ja===void 0)?void 0:Ja.findIndex(function(pi){var Ei;return((Ei=pi.course_status)===null||Ei===void 0?void 0:Ei.status)===0}),Pn=bi>-1?bi:Pn}er(((Or=dn.detail)===null||Or===void 0?void 0:Or.courses[Pn])||{})},[dn.detail]);var hl=function(Rr){var Ta,Or,Wn=(Ta=dn.detail)===null||Ta===void 0||((Or=Ta.courses)===null||Or===void 0)?void 0:Or.find(function(Pn){return Pn.course_id===Rr});er(Wn||{}),Za({type:"classroomList/setActionTabs",payload:{key:"\u4FEE\u6539\u5F00\u8BFE\u65F6\u95F4",name:Rr}})},Al=function(){var Zr=Object(y.a)(r.a.mark(function Rr(){var Ta;return r.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:return Wn.next=2,Object(K.k)({container_id:Lt.pathId,container_type:"Subject"});case 2:Ta=Wn.sent,Ta.status===0&&(ds(),R.b.success(Ta.message));case 4:case"end":return Wn.stop()}},Rr)}));return function(){return Zr.apply(this,arguments)}}(),Qs=function(){var Zr=Object(y.a)(r.a.mark(function Rr(){var Ta;return r.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:return Wn.next=2,Object(K.n)({container_id:Lt.pathId,container_type:"Subject"});case 2:Ta=Wn.sent,Ta.status===0&&(ds(),R.b.success(Ta.message));case 4:case"end":return Wn.stop()}},Rr)}));return function(){return Zr.apply(this,arguments)}}(),cr=function(){var Zr=Object(y.a)(r.a.mark(function Rr(){return r.a.wrap(function(Or){for(;;)switch(Or.prev=Or.next){case 0:T.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:e.a.createElement("div",{className:"tc"},"\u662F\u5426\u5220\u9664\u5B9E\u8DF5\u8BFE\u7A0B?"),onOk:function(){var Wn=Object(y.a)(r.a.mark(function wn(){var nr;return r.a.wrap(function(_r){for(;;)switch(_r.prev=_r.next){case 0:return _r.next=2,Object(K.q)({id:Lt.pathId});case 2:nr=_r.sent,nr.status===1&&u.d.push("/paths");case 4:case"end":return _r.stop()}},wn)}));function Pn(){return Wn.apply(this,arguments)}return Pn}()});case 1:case"end":return Or.stop()}},Rr)}));return function(){return Zr.apply(this,arguments)}}(),ys=function(){var Zr=Object(y.a)(r.a.mark(function Rr(){return r.a.wrap(function(Or){for(;;)switch(Or.prev=Or.next){case 0:T.a.info({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u77E5\u9053\u5566",content:e.a.createElement("div",{className:"tc"},"\u8BFE\u7A0B\u53D1\u5E03\u540E\u5373\u53EF\u53D1\u9001\u8BFE\u5802\u4F7F\u7528"),onOk:function(){var Wn=Object(y.a)(r.a.mark(function wn(){var nr;return r.a.wrap(function(_r){for(;;)switch(_r.prev=_r.next){case 0:return _r.next=2,Object(K.h)({id:Lt.pathId});case 2:nr=_r.sent,(nr==null?void 0:nr.status)===0&&(ds(),R.b.success(nr.message));case 4:case"end":return _r.stop()}},wn)}));function Pn(){return Wn.apply(this,arguments)}return Pn}()});case 1:case"end":return Or.stop()}},Rr)}));return function(){return Zr.apply(this,arguments)}}(),Ks=function(){var Zr=Object(y.a)(r.a.mark(function Rr(){return r.a.wrap(function(Or){for(;;)switch(Or.prev=Or.next){case 0:T.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:e.a.createElement("div",{className:"tc"},"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okButtonProps:{loading:da},onOk:function(){var Wn=Object(y.a)(r.a.mark(function wn(){var nr;return r.a.wrap(function(_r){for(;;)switch(_r.prev=_r.next){case 0:return Oi(!0),_r.next=3,Object(K.m)({id:Lt.pathId});case 3:nr=_r.sent,(nr==null?void 0:nr.status)===1&&(ds(),R.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F")),Oi(!1);case 6:case"end":return _r.stop()}},wn)}));function Pn(){return Wn.apply(this,arguments)}return Pn}()});case 1:case"end":return Or.stop()}},Rr)}));return function(){return Zr.apply(this,arguments)}}(),Bs=function(){dn.detail&&dn.detail.has_sub_discipline?bs({user_customize:!1}):fo(!0)},fo=function(Rr){jo({status:Rr})},bs=function(Rr){T.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A\u7533\u8BF7",cancelText:"\u53D6\u6D88\u7533\u8BF7",content:e.a.createElement("div",{className:"tc"},"\u516C\u5F00\u8BFE\u7A0B\u9700\u7ECF\u8FC7\u5E73\u53F0\u6807\u51C6\u5316\u5BA1\u6838\uFF0C\u5BA1\u6838\u5468\u671F\u4E3A1-2\u5929\uFF0C\u516C\u5F00",e.a.createElement("br",null),"\u7684\u8BFE\u7A0B\u5C06\u5BF9\u5E73\u53F0\u6240\u6709\u4EBA\u53EF\u89C1\u3002\u82E5\u4EC5\u672C\u4EBA\u6559\u5B66\u4F7F\u7528\u5219\u65E0\u9700",e.a.createElement("br",null),"\u7533\u8BF7\u516C\u5F00\uFF0C\u76F4\u63A5\u53D1\u9001\u5230\u8BFE\u5802\u5373\u53EF",e.a.createElement("br",null)),onOk:function(){var Ta=Object(y.a)(r.a.mark(function Wn(){var Pn,wn;return r.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Pn={user_customize:Rr.user_customize},Rr.user_customize?Pn=Object(P.a)(Object(P.a)({},Pn),{},{discipline_name:Rr.discipline_name,sub_discipline_name:Rr.sub_discipline_name}):Rr.sub_discipline_id&&(Pn=Object(P.a)(Object(P.a)({},Pn),{},{sub_discipline_id:Rr.sub_discipline_id})),Bn.next=4,Object(K.g)(Object(P.a)({id:Lt.pathId},Pn));case 4:wn=Bn.sent,((wn==null?void 0:wn.status)===0||(wn==null?void 0:wn.status)===1)&&(ds(),R.b.success("\u516C\u5F00\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u7BA1\u7406\u5458\u7684\u5BA1\u6838"));case 6:case"end":return Bn.stop()}},Wn)}));function Or(){return Ta.apply(this,arguments)}return Or}()})},Ws=function(){var Zr=Object(y.a)(r.a.mark(function Rr(){return r.a.wrap(function(Or){for(;;)switch(Or.prev=Or.next){case 0:T.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:e.a.createElement("div",{className:"tc"},"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u7533\u8BF7\u516C\u5F00\uFF1F"),onOk:function(){var Wn=Object(y.a)(r.a.mark(function wn(){var nr;return r.a.wrap(function(_r){for(;;)switch(_r.prev=_r.next){case 0:return _r.next=2,Object(K.l)({id:Lt.pathId});case 2:nr=_r.sent,(nr==null?void 0:nr.status)===0&&(ds(),R.b.success("\u64A4\u9500\u7533\u8BF7\u516C\u5F00\u6210\u529F"));case 4:case"end":return _r.stop()}},wn)}));function Pn(){return Wn.apply(this,arguments)}return Pn}()});case 1:case"end":return Or.stop()}},Rr)}));return function(){return Zr.apply(this,arguments)}}(),Ms=function(){var Zr=Object(y.a)(r.a.mark(function Rr(){return r.a.wrap(function(Or){for(;;)switch(Or.prev=Or.next){case 0:T.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:e.a.createElement("div",{className:"ml20"},e.a.createElement(x.a.Group,{defaultValue:1,onChange:function(Pn){return lr.current=Pn.target.value}},e.a.createElement(x.a,{value:1,className:"mt10"},"\u5F00\u653E\u8BFE\u5802\uFF1A",e.a.createElement("span",null,"\u6240\u6709\u7528\u6237\u53EF\u4EE5\u968F\u65F6\u8BBF\u95EE")),e.a.createElement(x.a,{value:0,className:"mt10"},"\u79C1\u6709\u8BFE\u5802\uFF1A",e.a.createElement("span",null,"\u4EC5\u62A5\u540D\u53C2\u4E0E\u7684\u8BFE\u5802\u6210\u5458\u53EF\u4EE5\u8BBF\u95EE")))),onOk:function(){var Wn=Object(y.a)(r.a.mark(function wn(){return r.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:Object(fe.Q)("/classrooms/news/".concat(Lt.pathId,"/newgold/").concat(lr.current));case 1:case"end":return Bn.stop()}},wn)}));function Pn(){return Wn.apply(this,arguments)}return Pn}()});case 1:case"end":return Or.stop()}},Rr)}));return function(){return Zr.apply(this,arguments)}}(),Es=function(){T.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:e.a.createElement("div",{className:"tc"},"\u662F\u5426\u786E\u8BA4\u7ACB\u5373\u9884\u7EA6\uFF1F"),onOk:function(){var Rr=Object(y.a)(r.a.mark(function Or(){var Wn;return r.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:return wn.next=2,Object(K.i)({id:Lt.pathId});case 2:Wn=wn.sent,Wn.status===0&&(ni(!0),R.b.success(Wn.message));case 4:case"end":return wn.stop()}},Or)}));function Ta(){return Rr.apply(this,arguments)}return Ta}()})},Ni=function(){if(!Object(Fe.e)(Za))return;T.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:e.a.createElement("div",{className:"tc"},"\u662F\u5426\u786E\u5B9A\u52A0\u5165\u8BE5\u8BFE\u5802"),onOk:function(){var Rr=Object(y.a)(r.a.mark(function Or(){var Wn,Pn;return r.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:return nr.next=2,Object(K.L)({id:Vt==null?void 0:Vt.course_id});case 2:Wn=nr.sent,Wn.status===0&&(R.b.success(Wn.message),Za({type:"pathsDetail/getPathsDetail",payload:{id:Lt.pathId}}),((Pn=Vt.course_status)===null||Pn===void 0?void 0:Pn.status)===1&&Object(fe.Q)("/classrooms/".concat(Vt==null?void 0:Vt.course_id,"/shixun_homework")));case 4:case"end":return nr.stop()}},Or)}));function Ta(){return Rr.apply(this,arguments)}return Ta}()})},zs=function(){var Rr;if((Rr=dn.detail)!==null&&Rr!==void 0&&Rr.need_authorize){Object(Fe.a)(!1,"\u8BE5\u8BFE\u7A0B\u4E2D\u5305\u542B\u5B9E\u8BAD\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002");return}if(!Object(Fe.e)(Za))return;Za({type:"pathsDetail/setActionTabs",payload:{key:"PathsDetail-SendToClass"}})},ds=function(){Za({type:"pathsDetail/getPathsDetail",payload:{id:Lt.pathId}}),Za({type:"pathsDetail/getRightData",payload:{id:Lt.pathId}})},Ho=!!((Ve=dn.detail)!==null&&Ve!==void 0&&Ve.participant_count)&&!((Be=dn.detail)!==null&&Be!==void 0&&Be.allow_statistics),Ls=((at=dn.detail)===null||at===void 0||((nt=at.courses)===null||nt===void 0)?void 0:nt.findIndex(function(Zr){return(Zr==null?void 0:Zr.course_id)===(Vt==null?void 0:Vt.course_id)}))+1,Qo=Ls===((st=dn.detail)===null||st===void 0||((it=st.courses)===null||it===void 0)?void 0:it.length);return e.a.createElement("section",null,e.a.createElement("aside",{className:J.a.banner,style:{backgroundImage:dn!=null&&(dt=dn.detail)!==null&&dt!==void 0&&(Dt=dt.attachments)!==null&&Dt!==void 0&&(Qt=Dt[0])!==null&&Qt!==void 0&&Qt.url?"url(".concat(yt.a.API_SERVER+(dn==null||((Bt=dn.detail)===null||Bt===void 0||(($t=Bt.attachments)===null||$t===void 0||((ln=$t[0])===null||ln===void 0)))?void 0:ln.url),")"):"url(".concat(ct.a,")"),marginBottom:(On=dn.detail)!==null&&On!==void 0&&(Wt=On.courses)!==null&&Wt!==void 0&&Wt.length?70:20}},e.a.createElement("aside",{className:J.a.wrp},e.a.createElement("div",{className:J.a.operationWrap},!!((qt=dn.detail)!==null&&qt!==void 0&&qt.is_free)&&((yn=dn.detail)===null||yn===void 0?void 0:yn.publish_status)!==0&&(((Rn=dn.detail)===null||Rn===void 0?void 0:Rn.allow_add_member)||!Object(U.m)())&&e.a.createElement(l.a,{placement:"bottom",title:"\u4EE5\u5B9E\u8BAD\u4F5C\u4E1A\u7684\u5F62\u5F0F\u53D1\u9001\u5230\u6211\u7684\u8BFE\u5802"},e.a.createElement("span",{onClick:zs,style:{fontSize:"12px",color:"#fff",lineHeight:"24px",cursor:"pointer",marginLeft:"26px"}},e.a.createElement("img",{src:rt.a,style:{marginRight:"10px"}}),"\u53D1\u9001\u81F3")),((tn=dn.detail)===null||tn===void 0?void 0:tn.allow_statistics)&&((bn=dn.detail)===null||bn===void 0?void 0:bn.public_status)===2&&e.a.createElement("span",{onClick:function(){return u.d.push("/paths/".concat(Lt.pathId,"/statistics"))},style:{fontSize:"12px",color:"#fff",lineHeight:"24px",cursor:"pointer",marginLeft:"26px"}},e.a.createElement("img",{src:et.a,style:{marginRight:"10px"}}),"\u5B66\u4E60\u7EDF\u8BA1"),((Ln=dn.detail)===null||Ln===void 0?void 0:Ln.allow_add_member)&&e.a.createElement(w.a,{overlay:e.a.createElement(b.a,null,((Xn=dn.detail)===null||Xn===void 0?void 0:Xn.courses)&&(((rn=dn.detail)===null||rn===void 0?void 0:rn.is_creator)&&!!((hn=Uo.userInfo)!==null&&hn!==void 0&&hn.professional_certification)||Object(U.o)())&&e.a.createElement(b.a.Item,{style:{textAlign:"center"},onClick:Ms},"\u5F00\u8BFE"),((An=dn.detail)===null||An===void 0?void 0:An.allow_statistics)&&e.a.createElement(b.a.Item,{style:{textAlign:"center"},onClick:function(){return u.d.push("/paths/".concat(Lt.pathId,"/edit"))}},"\u7F16\u8F91\u8BFE\u7A0B"),((_n=dn.detail)===null||_n===void 0?void 0:_n.allow_add_member)&&((tr=dn.detail)===null||tr===void 0?void 0:tr.publish_status)===0&&e.a.createElement(b.a.Item,{style:{textAlign:"center"},onClick:ys},"\u53D1\u5E03\u8BFE\u7A0B"),((cn=dn.detail)===null||cn===void 0?void 0:cn.allow_statistics)&&((Fn=dn.detail)===null||Fn===void 0?void 0:Fn.publish_status)===2&&((Ir=dn.detail)===null||Ir===void 0?void 0:Ir.public_status)===0&&e.a.createElement(b.a.Item,{style:{textAlign:"center"},onClick:Ks},"\u64A4\u9500\u53D1\u5E03"),((hr=dn.detail)===null||hr===void 0?void 0:hr.allow_statistics)&&((Br=dn.detail)===null||Br===void 0?void 0:Br.publish_status)===2&&((ur=dn.detail)===null||ur===void 0?void 0:ur.public_status)===0&&e.a.createElement(b.a.Item,{style:{textAlign:"center"},onClick:Bs},"\u516C\u5F00\u8BFE\u7A0B"),((Fr=dn.detail)===null||Fr===void 0?void 0:Fr.allow_statistics)&&((Qn=dn.detail)===null||Qn===void 0?void 0:Qn.public_status)===1&&e.a.createElement(b.a.Item,{style:{textAlign:"center"},onClick:Ws},"\u64A4\u9500\u7533\u8BF7\u516C\u5F00"),Object(U.c)()&&((kr=dn.detail)===null||kr===void 0?void 0:kr.allow_statistics)&&((ta=dn.detail)===null||ta===void 0?void 0:ta.public_status)===2&&e.a.createElement(b.a.Item,{style:{textAlign:"center"},onClick:Ws},"\u64A4\u9500\u516C\u5F00"),((Wr=dn.detail)===null||Wr===void 0?void 0:Wr.allow_delete)&&e.a.createElement(b.a.Item,{style:{textAlign:"center"},onClick:cr},"\u5220\u9664\u8BFE\u7A0B"))},e.a.createElement("span",{style:{fontSize:"12px",color:"#fff",lineHeight:"24px",cursor:"pointer",marginLeft:"26px"}},e.a.createElement("img",{src:je.a,style:{marginRight:"10px"}}),"\u8BBE\u7F6E"))),e.a.createElement("p",{className:[J.a.titleWrap,((yr=dn.detail)===null||yr===void 0||((Dn=yr.name)===null||Dn===void 0)?void 0:Dn.indexOf(`
`))&&J.a.titleFlexEnd].join(" ")},e.a.createElement("span",{className:J.a.title},e.a.createElement("strong",null,(ar=dn.detail)===null||ar===void 0||((Pr=ar.name)===null||Pr===void 0)?void 0:Pr.split(`
`)[0]),e.a.createElement("span",{className:"font24"},e.a.createElement("br",null),(jn=dn.detail)===null||jn===void 0||(($n=jn.name)===null||$n===void 0)?void 0:$n.split(`
`).filter(function(Zr,Rr){return Rr!==0}).join(""))),e.a.createElement("div",null,((ir=dn.detail)===null||ir===void 0?void 0:ir.excellent)&&e.a.createElement(p.a,{className:"".concat(J.a.openCourseTag," font14"),style:{background:"#44D7B6",border:"1px solid #44D7B6"}},"\u5F00\u653E\u8BFE\u7A0B"),((Zn=dn.detail)===null||Zn===void 0?void 0:Zn.featured)>0&&e.a.createElement("div",null,((zn=dn.detail)===null||zn===void 0?void 0:zn.featured)===1&&e.a.createElement(p.a,{className:"".concat(J.a.openCourseTag," font14"),style:{background:"#FF8C29",border:"1px solid #FF8C29"}},"\u56FD\u5BB6\u4E00\u6D41"),((fn=dn.detail)===null||fn===void 0?void 0:fn.featured)===2&&e.a.createElement(p.a,{className:"".concat(J.a.openCourseTag," font14"),style:{background:"#4361F2",border:"1px solid #4361F2"}},"\u519B\u961F\u4E00\u6D41"),((on=dn.detail)===null||on===void 0?void 0:on.featured)===3&&e.a.createElement(p.a,{className:"".concat(J.a.openCourseTag," font14"),style:{background:"#B38D24",border:"1px solid #B38D24"}},"\u7701\u7EA7\u4E00\u6D41")),((Gn=Uo.userInfo)===null||Gn===void 0?void 0:Gn.login)&&((Jn=dn.detail)===null||Jn===void 0?void 0:Jn.is_collect)&&e.a.createElement(h.a,{className:"".concat(J.a.button," ").concat(J.a.buttonTransparent," mr15"),onClick:Al},"\u53D6\u6D88\u6536\u85CF"),((Sn=Uo.userInfo)===null||Sn===void 0?void 0:Sn.login)&&!((mr=dn.detail)!==null&&mr!==void 0&&mr.is_collect)&&e.a.createElement("span",{style:{fontSize:"12px",color:"#fff",lineHeight:"24px",cursor:"pointer",marginLeft:"20px",display:"flex"},onClick:Qs},e.a.createElement("img",{src:$e.a,style:{marginRight:"10px"}}),e.a.createElement("span",{style:{height:"24px"}},"\u6536\u85CF")),!Object(U.p)()&&e.a.createElement("span",{style:{fontSize:"12px",color:"#fff",lineHeight:"24px",cursor:"pointer",marginLeft:"20px",display:"flex"},className:"mr15",onClick:function(){if(!Object(Fe.e)(Za))return}},e.a.createElement("img",{src:$e.a,style:{marginRight:"10px"}}),e.a.createElement("span",{style:{height:"24px"}},"\u6536\u85CF")))),e.a.createElement("div",{className:J.a.contentWrap},e.a.createElement("div",{className:J.a.contentLeftWrap},!!((Kr=dn.detail)!==null&&Kr!==void 0&&Kr.stages_count)&&e.a.createElement("div",{className:"mr30"},e.a.createElement("span",null,"\u7AE0\u8282"),e.a.createElement("p",{className:"mt3"},(Va=dn.detail)===null||Va===void 0?void 0:Va.stages_count)),!!((Ra=dn.detail)!==null&&Ra!==void 0&&Ra.shixuns_count)&&e.a.createElement("div",{className:"mr30"},e.a.createElement("span",null,"\u5355\u5143"),e.a.createElement("p",{className:"mt3"},(aa=dn.detail)===null||aa===void 0?void 0:aa.shixuns_count)),!!((gi=dn.detail)!==null&&gi!==void 0&&gi.challenge_choose_count)&&e.a.createElement("div",{className:"mr30"},e.a.createElement("span",null,"\u9009\u62E9\u9898\u5173\u5361"),e.a.createElement("p",{className:"mt3"},(ti=dn.detail)===null||ti===void 0?void 0:ti.challenge_choose_count)),!!((Ka=dn.detail)!==null&&Ka!==void 0&&Ka.challenges_count)&&e.a.createElement("div",{className:"mr30"},e.a.createElement("span",null,"\u5B9E\u8DF5\u5173\u5361"),e.a.createElement("p",{className:"mt3"},(no=dn.detail)===null||no===void 0?void 0:no.challenges_count)),!!((ro=dn.detail)!==null&&ro!==void 0&&ro.videos_count)&&e.a.createElement("div",{className:"mr30"},e.a.createElement("span",null,"\u89C6\u9891"),e.a.createElement("p",{className:"mt3"},(Di=dn.detail)===null||Di===void 0?void 0:Di.videos_count)),!!((Io=dn.detail)!==null&&Io!==void 0&&Io.attachment_count)&&e.a.createElement("div",{className:"mr30"},e.a.createElement("span",null,"\u8BFE\u4EF6"),e.a.createElement("p",{className:"mt3"},(Mo=dn.detail)===null||Mo===void 0?void 0:Mo.attachment_count)),((ao=dn.detail)===null||ao===void 0?void 0:ao.publish_status)!==0&&!!((Ii=dn.detail)!==null&&Ii!==void 0&&Ii.subject_score)&&e.a.createElement("div",{className:"mr30"},e.a.createElement("span",null,"\u7ECF\u9A8C\u503C"),e.a.createElement("p",{className:"mt3"},(ki=dn.detail)===null||ki===void 0?void 0:ki.subject_score)),((So=dn.detail)===null||So===void 0?void 0:So.publish_status)!==0&&!!((co=dn.detail)!==null&&co!==void 0&&co.member_count)&&e.a.createElement("div",{className:"mr30"},e.a.createElement("span",null,(ho=dn.detail)!==null&&ho!==void 0&&ho.excellent?"\u53C2\u4E0E\u4EBA\u6570":"\u5B66\u4E60\u4EBA\u6570"),e.a.createElement("p",{className:"mt3"},(Qi=dn.detail)===null||Qi===void 0?void 0:Qi.member_count)),((Mi=dn.detail)===null||Mi===void 0?void 0:Mi.subject_score)>=0&&e.a.createElement("span",{className:"font14 c-white"},e.a.createElement("span",null,"\u8BC4\u5206"),e.a.createElement("br",null),e.a.createElement(d.a,{allowHalf:!0,value:Object(fe.B)((Vi=dn.detail)===null||Vi===void 0?void 0:Vi.averge_star),disabled:!0,className:J.a.rating})))),!!((Ki=dn.detail)!==null&&Ki!==void 0&&(go=Ki.courses)!==null&&go!==void 0&&go.length)&&e.a.createElement("aside",{className:J.a.nav},e.a.createElement("div",{className:J.a.navLeft},Vt.course_identity<4&&e.a.createElement(l.a,{placement:"bottom",title:"\u7F16\u8F91\u8BFE\u5802"},e.a.createElement("a",{href:"/classrooms/".concat(Vt==null?void 0:Vt.course_id,"/newgolds/settings"),target:"_blank"},e.a.createElement("i",{className:"iconfont icon-bianji1 ".concat(J.a.navLeftIcon)}))),e.a.createElement(w.a,{overlay:e.a.createElement(b.a,null,(Fi=Object(o.a)((Xa=dn.detail)===null||Xa===void 0?void 0:Xa.courses))===null||Fi===void 0||((yo=Fi.reverse())===null||yo===void 0)?void 0:yo.map(function(Zr,Rr){var Ta,Or;return e.a.createElement(b.a.Item,{key:Zr.course_id,onClick:function(){return hl(Zr.course_id)}},e.a.createElement("span",{className:"font14"},"\u7B2C",((Ta=dn.detail)===null||Ta===void 0||((Or=Ta.courses)===null||Or===void 0)?void 0:Or.length)-Rr,"\u671F"))}))},e.a.createElement("div",null,e.a.createElement("span",{className:"font14 current"},"\u7B2C",e.a.createElement("span",{className:J.a.colorOrange},Ls),"\u671F"),e.a.createElement(k.a,null))),e.a.createElement("div",{className:J.a.navContent},e.a.createElement("div",{className:J.a.contentItem},e.a.createElement("div",{className:J.a.contentItemTitle},"\u5F00\u8BFE\u65F6\u95F4\uFF1A"),e.a.createElement("div",{className:J.a.contentItemText},Vt==null?void 0:Vt.start_date)),e.a.createElement("div",{className:J.a.verticalLine}),e.a.createElement("div",{className:J.a.contentItem},e.a.createElement("div",{className:J.a.contentItemTitle},"\u7ED3\u8BFE\u65F6\u95F4\uFF1A"),e.a.createElement("div",{className:J.a.contentItemText},Vt==null?void 0:Vt.end_date)),e.a.createElement("div",{className:J.a.verticalLine}),e.a.createElement("div",{className:J.a.contentItem},e.a.createElement("div",{className:J.a.contentItemTitle},(io=dn.detail)!==null&&io!==void 0&&io.excellent?"\u53C2\u4E0E\u4EBA\u6570\uFF1A":"\u62A5\u540D\u4EBA\u6570\uFF1A"),e.a.createElement("div",{className:J.a.contentItemText},Vt==null?void 0:Vt.student_count," \u4EBA")))),e.a.createElement("div",{className:J.a.navRight,style:{display:"none"}},e.a.createElement("div",{className:J.a.flexRow},(Vt==null||((Lo=Vt.course_status)===null||Lo===void 0)?void 0:Lo.status)===1&&e.a.createElement("div",{className:"mr20 c-red-ee4"},Vt==null||((Wi=Vt.course_status)===null||Wi===void 0)?void 0:Wi.time),(Vt==null||((Ti=Vt.course_status)===null||Ti===void 0)?void 0:Ti.status)===2&&Vt.course_identity<6&&e.a.createElement("div",{className:"current mr20 c-grey-9b9 font14"},"\u5DF2\u7ED3\u675F"),((Ao=Vt.course_status)===null||Ao===void 0?void 0:Ao.status)===2&&(Vt.course_identity<6?e.a.createElement("a",{className:J.a.classButton,href:"/classrooms/".concat(Vt==null||((qo=Vt.first_category_url)===null||qo===void 0||(($o=qo.split("/"))===null||$o===void 0))?void 0:$o[2],"/announcement"),target:"_blank"},"\u8FDB\u5165\u8BFE\u5802"):e.a.createElement("div",{className:"current mr20 c-grey-9b9 font14"},"\u5DF2\u7ED3\u675F")),((Go=Vt.course_status)===null||Go===void 0?void 0:Go.status)===1&&Vt.course_identity>5&&e.a.createElement("div",{className:J.a.classButton,onClick:Ni},"\u7ACB\u5373\u52A0\u5165"),((Xi=Vt.course_status)===null||Xi===void 0?void 0:Xi.status)===1&&Vt.course_identity===5&&e.a.createElement("a",{className:J.a.classButton,href:"/classrooms/".concat(Vt==null||((es=Vt.first_category_url)===null||es===void 0||((yi=es.split("/"))===null||yi===void 0))?void 0:yi[2],"/announcement"),target:"_blank"},"\u7ACB\u5373\u5B66\u4E60"),((Ua=Vt.course_status)===null||Ua===void 0?void 0:Ua.status)===0&&Vt.course_identity>5&&e.a.createElement("div",{className:J.a.classButton,onClick:Ni},"\u7ACB\u5373\u62A5\u540D"),((li=Vt.course_status)===null||li===void 0?void 0:li.status)===0&&Vt.course_identity===5&&e.a.createElement("div",{className:J.a.classButton},"\u62A5\u540D\u6210\u529F"),((Vt==null||((Na=Vt.course_status)===null||Na===void 0)?void 0:Na.status)===0||(Vt==null||((Yi=Vt.course_status)===null||Yi===void 0)?void 0:Yi.status)===1)&&Vt.course_identity<5&&e.a.createElement("a",{className:J.a.classButton,href:"/classrooms/".concat(Vt==null||((bo=Vt.first_category_url)===null||bo===void 0||((Li=bo.split("/"))===null||Li===void 0))?void 0:Li[2],"/announcement"),target:"_blank"},"\u8FDB\u5165\u8BFE\u5802"),Ho&&Qo&&((Vo=dn.detail)===null||Vo===void 0?void 0:Vo.has_participate)&&e.a.createElement("span",{className:"".concat(J.a.classButton," ").concat(J.a.bgGray)},"\u9884\u7EA6\u62A5\u540D\u6210\u529F"),Ho&&Qo&&!((Po=dn.detail)!==null&&Po!==void 0&&Po.has_participate)&&(mn?e.a.createElement("span",{className:"".concat(J.a.classButton," ").concat(J.a.bgGray)},"\u9884\u7EA6\u62A5\u540D\u6210\u529F"):e.a.createElement("span",{className:"".concat(J.a.classButton," ").concat(J.a.bg28e),onClick:Es},"\u671F\u5F85\u5F00\u8BFE\u5E76\u9884\u7EA6\u62A5\u540D"))),e.a.createElement("div",{className:J.a.flexRow},Ho&&!!((Xo=dn.detail)!==null&&Xo!==void 0&&(Bi=Xo.courses)!==null&&Bi!==void 0&&Bi.length)&&Qo&&e.a.createElement("span",{className:"mt20"},e.a.createElement("span",{className:"mr10"},"\u5F53\u9884\u7EA6\u62A5\u540D\u4EBA\u6570\u8FBE\u5230 ",(In=dn.detail)===null||In===void 0?void 0:In.student_count," ","\u4EBA\u65F6\u5373\u5C06\u5F00\u8BFE"),e.a.createElement("span",{className:""},"\u5F53\u524D\u9884\u7EA6\u62A5\u540D\u4EBA\u6570\uFF1A",e.a.createElement("span",{className:"mr5 c-red-ee4"},mn===!0?((Ji=dn.detail)===null||Ji===void 0?void 0:Ji.participant_count)+1:(vs=dn.detail)===null||vs===void 0?void 0:vs.participant_count),"\u4EBA")),Ho&&!((ts=dn.detail)!==null&&ts!==void 0&&(ca=ts.courses)!==null&&ca!==void 0&&ca.length)&&Qo&&e.a.createElement("span",null,!((Ur=dn.detail)!==null&&Ur!==void 0&&Ur.has_participate)&&(mn===!0?e.a.createElement("span",{className:"".concat(J.a.classButton," ").concat(J.a.bgGray)},"\u9884\u7EA6\u62A5\u540D\u6210\u529F"):e.a.createElement("a",{className:"".concat(J.a.classButton," ").concat(J.a.bg28e),onClick:Es},"\u671F\u5F85\u5F00\u8BFE\u5E76\u9884\u7EA6\u62A5\u540D")),((ui=dn.detail)===null||ui===void 0?void 0:ui.has_participate)&&e.a.createElement("span",{className:"".concat(J.a.classButton," ").concat(J.a.bgGray)},"\u9884\u7EA6\u62A5\u540D\u6210\u529F"),e.a.createElement("span",{className:"mr10"},"\u5F53\u9884\u7EA6\u62A5\u540D\u4EBA\u6570\u8FBE\u5230 ",(wa=dn.detail)===null||wa===void 0?void 0:wa.student_count," ","\u4EBA\u65F6\u5373\u5C06\u5F00\u8BFE"),e.a.createElement("span",{className:""},"\u5F53\u524D\u9884\u7EA6\u62A5\u540D\u4EBA\u6570\uFF1A",e.a.createElement("span",{className:"mr5 c-red-ee4"},mn===!0?((To=dn.detail)===null||To===void 0?void 0:To.participant_count)+1:(Zi=dn.detail)===null||Zi===void 0?void 0:Zi.participant_count),"\u4EBA"))))))),e.a.createElement(Ie,null),No.status&&e.a.createElement(Ke,{type:"subject",onCancel:function(){return fo(!1)},onOk:function(Rr){fo(!1),bs(Rr)}}),e.a.createElement(T.a,{visible:Ya,title:"\u8BFE\u7A0B\u63D0\u793A",width:593,maskClosable:!1,onCancel:function(){fi(!1)},centered:!0,footer:e.a.createElement("div",null,e.a.createElement(h.a,{type:"primary",onClick:function(){fi(!1)}},"\u6211\u77E5\u9053\u4E86"))},e.a.createElement(ze.a,{style:{maxHeight:378,overflow:"auto"},value:dn==null||((Eo=dn.detail)===null||Eo===void 0||((oo=Eo.toast)===null||oo===void 0))?void 0:oo.content})))},At=Object(u.a)(function(Ge){var Ye=Ge.pathsDetail,Je=Ge.user,Te=Ge.loading,Ve=Ge.globalSetting;return{pathsDetail:Ye,user:Je,globalSetting:Ve,loading:Te.models.index}})(mt),Ut=M("MXD1"),Xt=M("CFYs"),un=M("8Bcu"),jt=M.n(un),Zt=M("g9YV"),Mt=M("wCAj"),Tt=M("O3gP"),Ct=M("lrIw"),Re=M("RotF"),We=M.n(Re),St=M("oUNq"),ft=M("lzim"),It=M("55Ip"),Ot=function(Ye){var Je=Ye.pathsDetail,Te=Ye.loading,Ve=Ye.dispatch,Be=Ye.onReloadData,at=Be===void 0?function(){}:Be,nt=Object(s.i)(),st=Object(n.useState)([]),it=Object(E.a)(st,2),dt=it[0],Dt=it[1],Qt=Object(n.useState)(!0),Bt=Object(E.a)(Qt,2),$t=Bt[0],ln=Bt[1],On=Object(n.useState)(!1),Wt=Object(E.a)(On,2),qt=Wt[0],yn=Wt[1],Rn=ne.a.useForm(),tn=Object(E.a)(Rn,1),bn=tn[0],Ln=Object(n.useState)([]),Xn=Object(E.a)(Ln,2),rn=Xn[0],hn=Xn[1],An=Object(n.useState)(1),_n=Object(E.a)(An,2),tr=_n[0],cn=_n[1],Fn=Object(n.useState)([]),Ir=Object(E.a)(Fn,2),hr=Ir[0],Br=Ir[1],ur=Object(n.useState)(!0),Fr=Object(E.a)(ur,2),Qn=Fr[0],kr=Fr[1],ta=Object(n.useState)(!1),Wr=Object(E.a)(ta,2),yr=Wr[0],Dn=Wr[1];Object(n.useEffect)(function(){Je.actionTabs.key==="Collaborators-AddCollaborator"&&(kr(!0),ln(!0),ar())},[Je.actionTabs.key]);var ar=function(){var fn=Object(y.a)(r.a.mark(function on(){var Gn;return r.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Ve({type:"classroomList/getSchoolList",payload:{}});case 2:Gn=Sn.sent,Dt(Gn.map(function(mr){return{value:mr}}));case 4:case"end":return Sn.stop()}},on)}));return function(){return fn.apply(this,arguments)}}(),Pr=function(){var on,Gn;if(!((on=bn.getFieldValue())!==null&&on!==void 0&&(Gn=on.keyword)!==null&&Gn!==void 0&&Gn.trim())){R.b.warn("\u8BF7\u8F93\u5165\u59D3\u540D"),hn([]);return}kr(!1),ln(!0),yn(!1),cn(1),Br([]),$n(!0)},jn=function(on){on=String(on);var Gn=hr.indexOf(on);Gn<0?hr.push(on):hr.splice(Gn,1),Br(Object(o.a)(hr))},$n=function(){var fn=Object(y.a)(r.a.mark(function on(){var Gn,Jn,Sn,mr,Kr,Va=arguments;return r.a.wrap(function(aa){for(;;)switch(aa.prev=aa.next){case 0:if(Gn=Va.length>0&&Va[0]!==void 0?Va[0]:!1,!($t&&!qt||Gn)){aa.next=11;break}return mr=bn.getFieldValue(),yn(!0),cn(Gn?1:tr+1),aa.next=7,Object(St.wb)({page:Gn?1:tr+1,container_id:nt.pathId,container_type:3,school_name:(mr==null?void 0:mr.school_name)||null,keyword:(mr==null||((Jn=mr.keyword)===null||Jn===void 0)?void 0:Jn.trim())||null});case 7:Kr=aa.sent,hn(Gn?Object(o.a)(Kr.users):[].concat(Object(o.a)(rn),Object(o.a)(Kr.users))),yn(!1),((Sn=Kr.users)===null||Sn===void 0?void 0:Sn.length)<10&&ln(!1);case 11:case"end":return aa.stop()}},on)}));return function(){return fn.apply(this,arguments)}}(),ir=function(){var fn=Object(y.a)(r.a.mark(function on(){var Gn;return r.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:if(hr!=null&&hr.length){Sn.next=4;break}R.b.warn("\u8BF7\u5148\u5728\u4E0B\u9762\u5217\u8868\u4E2D\u9009\u62E9\u8981\u6DFB\u52A0\u6210\u5458"),Sn.next=10;break;case 4:return Dn(!0),Sn.next=7,Object(K.e)({id:nt.pathId,user_ids:hr});case 7:Gn=Sn.sent,Dn(!1),Gn&&(R.b.success("\u6DFB\u52A0\u6210\u529F"),Zn(),at&&at());case 10:case"end":return Sn.stop()}},on)}));return function(){return fn.apply(this,arguments)}}(),Zn=function(){bn.setFieldsValue({keyword:""}),Ve({type:"pathsDetail/setActionTabs",payload:{}})},zn=[{title:"",dataIndex:"added",width:40,ellipsis:!0,render:function(on,Gn){return e.a.createElement(X.a,{value:Gn.numid,checked:hr.includes(String(Gn.numid)),disabled:!!on})}},{title:"\u59D3\u540D",width:100,ellipsis:!0,dataIndex:"username",render:function(on,Gn){return e.a.createElement(l.a,{placement:"bottom",title:on},e.a.createElement(It.a,{className:"bold c-black",to:"/users/".concat(Gn.login),target:"_blank"},on||"--"))}},{title:"\u624B\u673A\u53F7",width:100,dataIndex:"phone",ellipsis:!0,render:function(on){return e.a.createElement(l.a,{placement:"bottom",title:on},e.a.createElement("span",null,on||"--"))}},{title:"\u90AE\u7BB1",dataIndex:"email",width:100,ellipsis:!0,render:function(on){return e.a.createElement(l.a,{placement:"bottom",title:on},e.a.createElement("span",null,on||"--"))}},{title:"\u5B66\u53F7/\u5DE5\u53F7",width:100,dataIndex:"student_number",ellipsis:!0,render:function(on){return e.a.createElement(l.a,{placement:"bottom",title:on},e.a.createElement("span",null,on||"--"))}},{title:"\u5B66\u6821/\u5355\u4F4D",width:150,dataIndex:"school_name",ellipsis:!0,render:function(on){return e.a.createElement(l.a,{placement:"bottom",title:on},e.a.createElement("span",null,on||"--"))}},{title:"\u9662\u7CFB/\u90E8\u95E8",dataIndex:"depart_name",width:130,ellipsis:!0,render:function(on){return e.a.createElement(l.a,{placement:"bottom",title:on},e.a.createElement("span",null,on||"--"))}},{title:"\u5B9E\u540D\u8BA4\u8BC1",dataIndex:"auth",width:100,render:function(on){return on?"\u662F":"\u5426"}},{title:"\u6700\u540E\u767B\u5F55\u65F6\u95F4",dataIndex:"last_login_on",width:140,ellipsis:!0,render:function(on){return e.a.createElement(l.a,{placement:"bottom",title:on&&pe()(on).format("YYYY-MM-DD HH:mm")},e.a.createElement("span",null,on&&pe()(on).format("YYYY-MM-DD HH:mm")))}},{title:"\u72B6\u6001",dataIndex:"added",width:80,render:function(on){if(on===1)return e.a.createElement("span",{className:"c-green"},"\u5DF2\u6DFB\u52A0")}}];return e.a.createElement(T.a,{title:"\u6DFB\u52A0\u5408\u4F5C\u8005",visible:Je.actionTabs.key==="Collaborators-AddCollaborator",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",width:1100,centered:!0,keyboard:!1,maskClosable:!1,bodyStyle:{minHeight:200},confirmLoading:yr,onOk:ir,onCancel:Zn},e.a.createElement(ne.a,{layout:"inline",form:bn,initialValues:{school_name:"",keyword:""},className:"mt10",onFinish:Pr},e.a.createElement(ne.a.Item,{name:"keyword",label:"\u59D3\u540D\uFF1A"},e.a.createElement(re.a,{allowClear:!0,style:{width:370},size:"large",placeholder:"\u8BF7\u8F93\u5165\u771F\u5B9E\u59D3\u540D"})),e.a.createElement(ne.a.Item,{name:"school_name",label:"\u5355\u4F4D\uFF1A"},e.a.createElement(Ct.a,{allowClear:!0,defaultOpen:!1,options:dt,style:{width:400},size:"large",placeholder:"\u8BF7\u8F93\u5165\u5355\u4F4D\u540D\u79F0",filterOption:function(on,Gn){return Gn.value.toUpperCase().indexOf(on.toUpperCase())!==-1}})),e.a.createElement(ne.a.Item,null,e.a.createElement(h.a,{htmlType:"submit",type:"primary",size:"large"},"\u641C\u7D22"))),Qn&&e.a.createElement("div",{className:"tc font16 c-light-black mt40"},e.a.createElement("img",{src:ft.A,width:"100",alt:""}),e.a.createElement("br",null),"\u8BF7\u641C\u7D22\u8981\u6DFB\u52A0\u7684\u4EBA\u5458"),!Qn&&e.a.createElement("section",null,e.a.createElement("div",{className:"flexd-table-header mt20"},e.a.createElement(Mt.a,{pagination:!1,dataSource:[],columns:zn})),e.a.createElement("div",{style:{maxHeight:260,overflow:"auto"}},e.a.createElement(We.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(on){$n()},hasMore:$t,useWindow:!1},e.a.createElement(Mt.a,{loading:qt,showHeader:!1,pagination:!1,dataSource:rn,columns:zn,onRow:function(on){return{onClick:function(Jn){Jn.currentTarget.querySelector("input").disabled||jn(Jn.currentTarget.querySelector("input").value)}}}})))))},bt=Object(u.a)(function(Ge){var Ye=Ge.pathsDetail,Je=Ge.loading;return{pathsDetail:Ye,loading:Je}})(Ot),Ht=function(Ye){var Je=Ye.pathsDetail,Te=Ye.loading,Ve=Ye.dispatch,Be=Ye.data,at=Ye.onReloadData,nt=at===void 0?function(){}:at,st=Object(s.i)(),it=Object(n.useState)(!0),dt=Object(E.a)(it,2),Dt=dt[0],Qt=dt[1],Bt=Object(n.useState)(!1),$t=Object(E.a)(Bt,2),ln=$t[0],On=$t[1],Wt=ne.a.useForm(),qt=Object(E.a)(Wt,1),yn=qt[0],Rn=Object(n.useState)([]),tn=Object(E.a)(Rn,2),bn=tn[0],Ln=tn[1],Xn=Object(n.useState)(1),rn=Object(E.a)(Xn,2),hn=rn[0],An=rn[1],_n=Object(n.useState)([]),tr=Object(E.a)(_n,2),cn=tr[0],Fn=tr[1],Ir=Object(n.useState)(!0),hr=Object(E.a)(Ir,2),Br=hr[0],ur=hr[1],Fr=Object(n.useState)(!1),Qn=Object(E.a)(Fr,2),kr=Qn[0],ta=Qn[1];Object(n.useEffect)(function(){Je.actionTabs.key==="Collaborators-AddCourses"&&(ur(!0),Qt(!0),Wr())},[Je.actionTabs.key]);var Wr=function(){var ir=Object(y.a)(r.a.mark(function Zn(){var zn;return r.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,Ve({type:"classroomList/getSchoolList",payload:{}});case 2:zn=on.sent;case 3:case"end":return on.stop()}},Zn)}));return function(){return ir.apply(this,arguments)}}(),yr=function(){ur(!1),Qt(!0),On(!1),An(1),Fn([]),ar(!0)},Dn=function(Zn){Zn=String(Zn);var zn=cn.indexOf(Zn);zn<0?cn.push(Zn):cn.splice(zn,1),Fn(Object(o.a)(cn))},ar=function(){var ir=Object(y.a)(r.a.mark(function Zn(){var zn,fn,on,Gn,Jn,Sn=arguments;return r.a.wrap(function(Kr){for(;;)switch(Kr.prev=Kr.next){case 0:if(zn=Sn.length>0&&Sn[0]!==void 0?Sn[0]:!1,!(Dt&&!ln||zn)){Kr.next=11;break}return Gn=yn.getFieldValue(),On(!0),An(zn?1:hn+1),Kr.next=7,Object(St.vb)({page:zn?1:hn+1,container_id:st.pathId,container_type:3,manager_name:(Gn==null?void 0:Gn.manager_name)||null,course_name:(Gn==null||((fn=Gn.course_name)===null||fn===void 0)?void 0:fn.trim())||null});case 7:Jn=Kr.sent,Ln(zn?Object(o.a)(Jn.courses):[].concat(Object(o.a)(bn),Object(o.a)(Jn.courses))),On(!1),((on=Jn.courses)===null||on===void 0?void 0:on.length)<10&&Qt(!1);case 11:case"end":return Kr.stop()}},Zn)}));return function(){return ir.apply(this,arguments)}}(),Pr=function(){var ir=Object(y.a)(r.a.mark(function Zn(){var zn,fn,on,Gn;return r.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:if(cn!=null&&cn.length){Sn.next=4;break}R.b.warn("\u8BF7\u5148\u5728\u4E0B\u9762\u5217\u8868\u4E2D\u9009\u62E9\u8981\u6DFB\u52A0\u8BFE\u5802"),Sn.next=19;break;case 4:if(!(Je.actionTabs.type!=1)){Sn.next=10;break}if(!((Je==null||((zn=Je.Courses)===null||zn===void 0||((fn=zn.spoc_courses)===null||fn===void 0))?void 0:fn.length)+(cn==null?void 0:cn.length)>3)){Sn.next=8;break}return R.b.warn("\u4E00\u4E2A\u5B9E\u8DF5\u8BFE\u7A0B\u53EA\u80FD\u52A0\u51653\u4E2Aspoc\u8BFE\u5802"),Sn.abrupt("return");case 8:Sn.next=13;break;case 10:if(!((Be==null||((on=Be.spoc_courses)===null||on===void 0)?void 0:on.length)+(cn==null?void 0:cn.length)>3)){Sn.next=13;break}return R.b.warn("\u4E00\u4E2A\u5B9E\u8DF5\u8BFE\u7A0B\u53EA\u80FD\u52A0\u51653\u4E2A\u5386\u53F2\u8BFE\u5802"),Sn.abrupt("return");case 13:return ta(!0),Sn.next=16,Object(K.b)({id:st.pathId,course_ids:cn,course_type:Je.actionTabs.type});case 16:Gn=Sn.sent,ta(!1),Gn&&(R.b.success("\u6DFB\u52A0\u6210\u529F"),jn(),nt&&nt());case 19:case"end":return Sn.stop()}},Zn)}));return function(){return ir.apply(this,arguments)}}(),jn=function(){yn.setFieldsValue({course_name:"",manager_name:""}),Fn([]),Ve({type:"pathsDetail/setActionTabs",payload:{}})},$n=[{title:"",dataIndex:"added",width:40,ellipsis:!0,render:function(Zn,zn){return e.a.createElement(X.a,{value:zn.id,checked:cn.includes(String(zn.id)),disabled:!!Zn})}},{title:"\u8BFE\u5802\u540D\u79F0",dataIndex:"name",width:100,ellipsis:!0,render:function(Zn){return e.a.createElement(l.a,{placement:"bottom",title:Zn},e.a.createElement("span",null,Zn||"--"))}},{title:"\u7BA1\u7406\u8005",width:100,dataIndex:"managers",ellipsis:!0,render:function(Zn){return e.a.createElement(l.a,{placement:"bottom",title:Zn},e.a.createElement("span",null,Zn||"--"))}},{title:"\u8BFE\u5802\u6240\u5728\u5B66\u6821",width:150,dataIndex:"school_name",ellipsis:!0,render:function(Zn){return e.a.createElement(l.a,{placement:"bottom",title:Zn},e.a.createElement("span",null,Zn||"--"))}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"created_at",width:140,ellipsis:!0,render:function(Zn){return e.a.createElement(l.a,{placement:"bottom",title:Zn},e.a.createElement("span",null,Zn))}},{title:"\u6210\u5458\u6570\u91CF",dataIndex:"course_members_count",width:80,render:function(Zn){return e.a.createElement(l.a,{placement:"bottom",title:Zn},e.a.createElement("span",null,Zn||"--"))}}];return e.a.createElement(T.a,{title:"\u6DFB\u52A0\u8BFE\u5802",visible:Je.actionTabs.key==="Collaborators-AddCourses",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",width:1100,centered:!0,keyboard:!1,maskClosable:!1,bodyStyle:{minHeight:200},confirmLoading:kr,onOk:Pr,onCancel:jn},e.a.createElement(ne.a,{layout:"inline",form:yn,initialValues:{course_name:"",manager_name:""},className:"mt10",onFinish:yr},e.a.createElement(ne.a.Item,{name:"course_name",label:"\u8BFE\u5802\u540D\u79F0"},e.a.createElement(re.a,{allowClear:!0,style:{width:370},size:"large",placeholder:"\u8BF7\u8F93\u5165\u8BFE\u5802\u540D\u79F0"})),e.a.createElement(ne.a.Item,{name:"manager_name",label:"\u8BFE\u5802\u7BA1\u7406\u8005"},e.a.createElement(re.a,{allowClear:!0,style:{width:370},size:"large",placeholder:"\u8BF7\u8F93\u5165\u8BFE\u5802\u7BA1\u7406\u8005\u540D\u79F0"})),e.a.createElement(ne.a.Item,null,e.a.createElement(h.a,{htmlType:"submit",type:"primary",size:"large"},"\u641C\u7D22"))),Br&&e.a.createElement("div",{className:"tc font16 c-light-black mt40"},e.a.createElement("img",{src:ft.A,width:"100",alt:""}),e.a.createElement("br",null),"\u8BF7\u641C\u7D22\u8981\u6DFB\u52A0\u7684\u4EBA\u5458"),!Br&&e.a.createElement("section",null,e.a.createElement("div",{className:"flexd-table-header mt20"},e.a.createElement(Mt.a,{pagination:!1,dataSource:[],columns:$n})),e.a.createElement("div",{style:{maxHeight:260,overflow:"auto"}},e.a.createElement(We.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(Zn){ar()},hasMore:Dt,useWindow:!1},e.a.createElement(Mt.a,{loading:ln,showHeader:!1,pagination:!1,dataSource:bn,columns:$n,onRow:function(Zn){return{onClick:function(fn){fn.currentTarget.querySelector("input").disabled||Dn(fn.currentTarget.querySelector("input").value)}}}})))))},Gt=Object(u.a)(function(Ge){var Ye=Ge.pathsDetail,Je=Ge.loading;return{pathsDetail:Ye,loading:Je}})(Ht),xn=M("2BaD"),vn=M("1n7x"),sr=M.n(vn),xr=M("y1J/"),Kn=M.n(xr),En=M("A2z3"),Qr=M.n(En),sa=M("Ye+n"),Xr=M.n(sa),Nr=function(Ye){var Je=Ye.visible,Te=Ye.onOk,Ve=Te===void 0?function(){}:Te,Be=Ye.onCancel,at=Be===void 0?function(){}:Be,nt=Ye.data,st=nt===void 0?{}:nt,it=Object(n.useRef)();Object(n.useEffect)(function(){return Je?document.body.setAttribute("class",Xr.a.bodyHeight):document.body.removeAttribute("class"),function(){document.body.removeAttribute("class")}},[Je]);var dt={"1":"January","2":"February","3":"March","4":"April","5":"May","6":"June","7":"July","8":"August","9":"September","10":"October","11":"November","12":"December"},Dt=function(){var Qt=Object(y.a)(r.a.mark(function Bt(){var $t,ln,On;return r.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return document.body.scrollIntoView(),$t={margin:[0,0,0,0],filename:"11.pdf",enableLinks:!1,html2canvas:{scale:5,allowTaint:!1,useCORS:!0},jsPDF:{format:[1412,1e3],orientation:"landscape",unit:"px"},image:{type:"jpeg",quality:1}},ln=sr()().set($t).from(it.current).toPdf(),qt.next=5,ln.get("pdf");case 5:return ln=qt.sent,qt.next=8,ln.output("bloburl");case 8:On=qt.sent,Object(fe.v)("".concat(st.school_name,"-").concat(st.user_name,".pdf"),On);case 10:case"end":return qt.stop()}},Bt)}));return function(){return Qt.apply(this,arguments)}}();return e.a.createElement(T.a,{visible:Je,title:null,footer:e.a.createElement("div",null,e.a.createElement(h.a,{type:"primary",onClick:Dt},"\u4E0B\u8F7D\u8BC1\u4E66")),style:{background:"transparen",height:"740px"},centered:!0,width:1052,className:Xr.a.advertisementModal,maskClosable:!1,closeIcon:e.a.createElement(xn.a,{onClick:at,style:{fontSize:"25px",color:"#fff",marginLeft:"100px"}})},e.a.createElement("div",{ref:it},e.a.createElement("div",{style:{backgroundImage:"url(".concat(Qr.a,")"),height:"740px",width:"1052px",padding:"1px 100px"}},e.a.createElement("div",{style:{color:"#EB5E00",fontSize:"36px",marginTop:"239px",width:"100%",textAlign:"center"}},st==null?void 0:st.school_name," ",st==null?void 0:st.user_name),e.a.createElement("div",{style:{color:"#0D3580",fontSize:"24px",marginTop:"30px",width:"100%",textAlign:"center"}},"\u4E8E",pe()(st==null?void 0:st.created_at).format("YYYY\u5E74MM\u6708DD\u65E5"),"\u5B8C\u6210\u4E86EduCoder\u5E73\u53F0\u300A",st==null?void 0:st.subject_name,"\u300B\u8BFE\u7A0B\u5B66\u4E60\u3002"),e.a.createElement("div",{style:{color:"#0D3580",fontSize:"30px",marginTop:"50px",width:"100%",textAlign:"center",fontWeight:900}},"\u7279\u6B64\u8BC1\u660E"),e.a.createElement("div",{style:{color:"#0D3580",fontSize:"14px",marginTop:"30px",width:"100%",textAlign:"center"}},"On ",dt[pe()(st==null?void 0:st.created_at).format("M")]," ",pe()(st==null?void 0:st.created_at).format("DD"),"\uFF0C",pe()(st==null?void 0:st.created_at).format("YYYY"),"\uFF0C completed the \u300A",st==null?void 0:st.subject_name_en,"\u300B course on EduCoder."),e.a.createElement("img",{src:Kn.a,style:{position:"absolute",left:"820px",bottom:"130px"}}),e.a.createElement("div",{style:{color:"#0D3580",fontSize:"12px",width:"100%",display:"flex",paddingRight:"200px",position:"absolute",bottom:"150px"}},e.a.createElement("span",null,"\u8BC1\u4E66\u7F16\u53F7\uFF1A",st==null?void 0:st.code),e.a.createElement("span",{style:{marginLeft:"560px"}},"\u5728\u7EBF\u7F16\u7A0B\u5B66\u9662")))))},ba=Nr,ja=M("YJCA"),oi=M("wYyv"),Le=M.n(oi),Qe=M("WPnJ"),ot=M.n(Qe),_t=Object(ja.b)(function(Ge){var Ye,Je,Te,Ve,Be,at,nt,st,it,dt=Ge.item,Dt=Ge.toIndex,Qt=Ge.params,Bt=Ge.isShow,$t=Ge.setShow,ln=Ge.dispatch,On=Ge.classroomList,Wt=Ge.handleDeleteMember,qt=Ge.pathsDetail;return e.a.createElement("span",{style:{display:"inline-block",width:"33%",padding:"5px",background:"#fff",marginTop:"10px"}},e.a.createElement("div",{className:ot.a.directionItemWrap},e.a.createElement(l.a,{color:"#ffffff",placement:"bottom",title:e.a.createElement("div",{className:ot.a.teamHeight},e.a.createElement("span",{title:dt==null?void 0:dt.name,style:{fontSize:"14px",color:"#333333",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"80px",overflow:"hidden"}},(dt==null||((Ye=dt.name)===null||Ye===void 0)?void 0:Ye.length)>6?(dt==null||((Je=dt.name)===null||Je===void 0)?void 0:Je.substr(0,6))+"...":(dt==null?void 0:dt.name)||"--"),e.a.createElement("span",{style:{marginLeft:"10px",color:"#999999",fontSize:"12px"}},(dt==null||((Te=dt.school)===null||Te===void 0)?void 0:Te.length)>9?(dt==null||((Ve=dt.school)===null||Ve===void 0)?void 0:Ve.substr(0,9))+"...":dt==null?void 0:dt.school),e.a.createElement("div",{style:{height:"1px",width:"100%",border:"1px solid #f5f5f5",marginTop:"3px",marginBottom:"3px"}}),!(dt!=null&&dt.brief_introduction)&&e.a.createElement("div",{style:{textAlign:"center",marginTop:"20px"}},"\u6682\u65E0\u7B80\u4ECB"),(dt==null?void 0:dt.brief_introduction)&&e.a.createElement("div",{className:ot.a.divHeight},dt==null?void 0:dt.brief_introduction))},e.a.createElement("img",{draggable:!1,className:ot.a.imgradius,onClick:function(){Object(U.p)()?u.d.push("".concat(dt.user_url)):ln({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}})},src:yt.a.API_SERVER+"/images/"+(dt==null?void 0:dt.image_url)}),e.a.createElement("div",null,(dt==null||((Be=dt.name)===null||Be===void 0)?void 0:Be.length)>6?(dt==null||((at=dt.name)===null||at===void 0)?void 0:at.substr(0,6))+"...":(dt==null?void 0:dt.name)||"--",e.a.createElement("br",null),e.a.createElement("span",{style:{color:"#999999"}},(dt==null||((nt=dt.school)===null||nt===void 0)?void 0:nt.length)>6?(dt==null||((st=dt.school)===null||st===void 0)?void 0:st.substr(0,6))+"...":(dt==null?void 0:dt.school)||"--"))),e.a.createElement("br",null),e.a.createElement("span",{className:ot.a.groupActionWrap},e.a.createElement("i",{style:{display:!((it=qt.detail)!==null&&it!==void 0&&it.allow_add_member)&&"none"},className:"iconfont icon-shanchu5 mr1 c-red font15 current",onClick:function(Rn){Rn.stopPropagation(),Wt(dt.id)}}))))}),Kt=Object(ja.a)(function(Ge){var Ye=Ge.isShow,Je=Ge.setShow,Te=Ge.pathsDetail,Ve=Ge.items,Be=Ge.params,at=Ge.dispatch,nt=Ge.classroomList,st=Ge.handleDeleteMember;return e.a.createElement("div",{className:"task-list-container"},Ve==null?void 0:Ve.map(function(it,dt){return e.a.createElement(_t,{key:"".concat(it.id),isShow:Ye,setShow:Je,dispatch:at,pathsDetail:Te,handleDeleteMember:st,classroomList:nt,toIndex:dt+1,params:Be,index:dt,item:it})}))}),nn=function(Ye){var Je=Ye.data,Te=Ye.classroomList,Ve=Ye.pathsDetail,Be=Ye.operation,at=Ye.callback,nt=Ye.handleDeleteMember,st=Ye.onCancel,it=Ye.dispatch,dt=Ye.visible,Dt=dt===void 0?!1:dt,Qt=Object(n.useState)(Je),Bt=Object(E.a)(Qt,2),$t=Bt[0],ln=Bt[1],On=Object(s.i)(),Wt=Object(n.useState)(),qt=Object(E.a)(Wt,2),yn=qt[0],Rn=qt[1],tn=Object(n.useState)(!0),bn=Object(E.a)(tn,2),Ln=bn[0],Xn=bn[1];function rn(_n){var tr=_n.newIndex,cn=_n.oldIndex;if(!Be)return;hn(Le()($t,cn,tr).map(function(Fn){return Fn==null?void 0:Fn.id})),ln(Le()($t,cn,tr))}Object(n.useEffect)(function(){ln(Je)},[JSON.stringify(Je)]);function hn(_n){return An.apply(this,arguments)}function An(){return An=Object(y.a)(r.a.mark(function _n(tr){var cn;return r.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return Ir.next=2,Object(le.a)("/api/paths/".concat(On==null?void 0:On.pathId,"/move_subject_members.json"),{method:"post",body:{user_ids:tr}});case 2:cn=Ir.sent;case 3:case"end":return Ir.stop()}},_n)})),An.apply(this,arguments)}return e.a.createElement("div",{style:{zIndex:9999,width:"100%"},className:"sort-list-panel"},e.a.createElement(Kt,{axis:"xy",helperClass:"dragging-li",isShow:Ln,setShow:Xn,distance:2,dispatch:it,pathsDetail:Ve,handleDeleteMember:nt,classroomList:Te,params:On,items:$t,onSortEnd:rn}))},ve=Object(u.a)(function(Ge){var Ye=Ge.classroomList,Je=Ge.pathsDetail;return{classroomList:Ye,pathsDetail:Je}})(nn),z=M("lseA"),Z=M.n(z),ye=[2,5,8,11,14],Ce=Object(ja.b)(function(Ge){var Ye,Je,Te,Ve,Be=Ge.item,at=Ge.toIndex,nt=Ge.params,st=Ge.dispatch,it=Ge.classroomList,dt=Ge.handleDeleteMember,Dt=Ge.pathsDetail;return e.a.createElement("span",{onClick:function(){window.open(Be==null?void 0:Be.first_category_url)},style:{display:"inline-block",padding:"10px 20px",width:"100%",background:"#fff",marginTop:"5px"}},e.a.createElement("div",{className:Z.a.directionItemWrap},e.a.createElement("img",{className:Z.a.imgradius,src:yt.a.API_SERVER+(Be==null?void 0:Be.default_image)}),e.a.createElement("span",{className:Z.a.groupActionWrap},e.a.createElement(l.a,{title:Be.name},e.a.createElement("span",{style:{fontSize:"18px",color:"#ffffff"}},((Ye=Be.name)===null||Ye===void 0?void 0:Ye.length)>7?e.a.createElement("span",null,(Je=Be.name)===null||Je===void 0?void 0:Je.substring(0,7),e.a.createElement("br",null)," ",(Te=Be.name)===null||Te===void 0?void 0:Te.substring(7,14),(Be==null?void 0:Be.name.length)>14&&"..."):Be.name)))),e.a.createElement("div",{className:Z.a.bottomdiv},e.a.createElement(l.a,{title:"\u8BBF\u95EE\u6570\uFF1A".concat(Be==null?void 0:Be.visits),placement:"bottom"},e.a.createElement("span",null,e.a.createElement("i",{style:{marginRight:"3px",color:"#bbbbbb"},className:"iconfont icon-chakan ml3 font15 current"}),e.a.createElement("span",{style:{color:"rgba(0, 0, 0, 0.45)"}},Be==null?void 0:Be.visits))),e.a.createElement(l.a,{title:"\u8BFE\u5802\u6210\u5458\u6570\uFF1A".concat(Be==null?void 0:Be.course_members_count),placement:"bottom"},e.a.createElement("span",null,e.a.createElement("i",{style:{marginRight:"3px",color:"#bbbbbb"},className:"iconfont icon-ren ml3 font15 current"}),e.a.createElement("span",{style:{color:"rgba(0, 0, 0, 0.45)"}}," ",Be==null?void 0:Be.course_members_count))),e.a.createElement(l.a,{overlayStyle:{maxWidth:380},title:e.a.createElement("div",{style:{whiteSpace:"nowrap"}},"\u8BFE\u5802\u7684\u4EFB\u52A1\u6570(\u4F5C\u4E1A\u6570\uFF0B\u8BD5\u5377\u6570\uFF0B\u95EE\u5377\u6570)\uFF1A",Be==null?void 0:Be.tasks_count),placement:"bottom"},e.a.createElement("span",null,e.a.createElement("i",{style:{marginRight:"3px",color:"#bbbbbb"},className:"iconfont icon-wenjian2 ml3 font15 current"}),e.a.createElement("span",{style:{color:"rgba(0, 0, 0, 0.45)"}}," ",Be==null?void 0:Be.tasks_count))),e.a.createElement(l.a,{title:"\u5220\u9664",placement:"bottom"},e.a.createElement("span",null,e.a.createElement("i",{style:{color:"#bbbbbb",display:!(Dt!=null&&(Ve=Dt.detail)!==null&&Ve!==void 0&&Ve.allow_add_member)&&"none"},className:"iconfont icon-lajitong1 mr3 font15 current",onClick:function(Bt){Bt.stopPropagation(),dt(Be.id)}})))))}),be=Object(ja.a)(function(Ge){var Ye=Ge.items,Je=Ge.params,Te=Ge.dispatch,Ve=Ge.classroomList,Be=Ge.handleDeleteMember,at=Ge.pathsDetail;return e.a.createElement("div",{className:"task-list-container"},Ye==null?void 0:Ye.map(function(nt,st){return e.a.createElement(Ce,{key:"".concat(nt.id),dispatch:Te,pathsDetail:at,handleDeleteMember:Be,classroomList:Ve,toIndex:st+1,params:Je,index:st,item:nt})}))}),ht=function(Ye){var Je=Ye.data,Te=Ye.classroomList,Ve=Ye.pathsDetail,Be=Ye.callback,at=Ye.handleDeleteMember,nt=Ye.onCancel,st=Ye.dispatch,it=Ye.visible,dt=it===void 0?!1:it,Dt=Object(n.useState)(Je),Qt=Object(E.a)(Dt,2),Bt=Qt[0],$t=Qt[1],ln=Object(s.i)(),On=Object(n.useState)(),Wt=Object(E.a)(On,2),qt=Wt[0],yn=Wt[1];function Rn(Ln){var Xn=Ln.newIndex,rn=Ln.oldIndex;tn(Le()(Bt,rn,Xn).map(function(hn){return hn==null?void 0:hn.id})),$t(Le()(Bt,rn,Xn))}Object(n.useEffect)(function(){$t(Je)},[JSON.stringify(Je)]);function tn(Ln){return bn.apply(this,arguments)}function bn(){return bn=Object(y.a)(r.a.mark(function Ln(Xn){var rn;return r.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:return An.next=2,Object(le.a)("/api/paths/".concat(ln==null?void 0:ln.pathId,"/spoc_courses/move_position.json"),{method:"post",body:{ids:Xn}});case 2:rn=An.sent;case 3:case"end":return An.stop()}},Ln)})),bn.apply(this,arguments)}return e.a.createElement("div",{style:{zIndex:9999,width:"100%"},className:"sort-list-panel"},e.a.createElement(be,{axis:"y",helperClass:"dragging-li",pathsDetail:Ve,distance:2,dispatch:st,handleDeleteMember:at,classroomList:Te,params:ln,items:Bt,onSortEnd:Rn}))},Nt=Object(u.a)(function(Ge){var Ye=Ge.classroomList,Je=Ge.pathsDetail;return{classroomList:Ye,pathsDetail:Je}})(ht),sn=M("V0Rq"),pn=M("HBuW"),zt=M("W6us"),qn=M.n(zt),Un=M("CnIC"),rr=M.n(Un),Sr=M("LZjx"),ia=M.n(Sr),Dr=M("dhSg"),na=M("cVA7"),Tr=M.n(na),ma=M("h6EL");function ha(Ge){var Ye=function(at,nt){if(at.localName===nt)return at;for(var st=0,it=at;it=it.parentNode;st++){if(it.localName===nt)return it;if(it==document.documentElement)return!1}},Je=Ge.target,Te=Ye(Je,"a");if(console.log([Te],Te==null?void 0:Te.href,44),Te!=null&&Te.href)return;if(Je.tagName.toUpperCase()==="IMG"){var Ve=Je.src||Je.getAttribute("src");Ve&&Ve.indexOf("/images/avatars/User")===-1&&(Ge.stopPropagation(),Ge.preventDefault(),Dr.a.publish("preview-image",Ve))}}var Oa=function(Ye){var Je,Te,Ve,Be,at,nt,st,it,dt,Dt,Qt,Bt,$t,ln,On,Wt,qt,yn,Rn,tn,bn,Ln,Xn,rn,hn,An,_n,tr,cn,Fn,Ir,hr,Br,ur,Fr,Qn,kr,ta,Wr,yr,Dn,ar,Pr,jn,$n,ir,Zn,zn,fn,on,Gn,Jn,Sn,mr,Kr,Va,Ra,aa,gi,ti,Ka,no,ro,Di,Io,Mo,ao,Ii,ki,So,co,ho,Qi,Mi,Vi,Ki,go,Fi,yo,Xa,io,Lo,Wi,Ti,Ao,qo,$o,Go,Xi,es,yi,Ua,li,Na,Yi,bo,Li,Vo,Po,Xo,Bi,In=Ye.pathsDetail,Ji=Ye.user,vs=Ye.globalSetting,ts=Ye.loading,ca=Ye.classroomList,Ur=Ye.dispatch,ui=Object(_.a)(Ye,["pathsDetail","user","globalSetting","loading","classroomList","dispatch"]),wa=Object(s.i)(),To=Object(n.useState)(!0),Zi=Object(E.a)(To,2),Eo=Zi[0],oo=Zi[1],dn=Object(n.useState)(!1),Uo=Object(E.a)(dn,2),Ss=Uo[0],gs=Uo[1],Za=Object(n.useState)(),Tn=Object(E.a)(Za,2),Lt=Tn[0],Yt=Tn[1],Cn=Object(n.useState)(),Vt=Object(E.a)(Cn,2),er=Vt[0],lr=Vt[1],fr=Object(n.useState)({}),$r=Object(E.a)(fr,2),mn=$r[0],ni=$r[1],Pi=Object(n.useState)(),La=Object(E.a)(Pi,2),da=La[0],Oi=La[1],qi=Object(n.useRef)(),qa=Object(n.useState)(!1),Ya=Object(E.a)(qa,2),fi=Ya[0],ko=Ya[1],Fo=Object(n.useState)({}),No=Object(E.a)(Fo,2),jo=No[0],Ts=No[1];Object(n.useEffect)(function(){if(qi.current)return qi.current.addEventListener("mousedown",ha),function(){qi.current.removeEventListener("mousedown",ha)}},[qi.current]);var hl=function(){var Wn=Object(y.a)(r.a.mark(function Pn(){var wn;return r.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:if(er!=null&&er.trim()){Bn.next=3;break}return R.b.warn("\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Bn.abrupt("return");case 3:return Bn.next=5,Object(K.V)({id:wa.pathId,team_title:er.trim()});case 5:wn=Bn.sent,Yt(!Lt),(wn==null?void 0:wn.status)===0&&(lr(null),R.b.success(wn.message),Ur({type:"pathsDetail/getRightData",payload:{id:wa.pathId}}));case 8:case"end":return Bn.stop()}},Pn)}));return function(){return Wn.apply(this,arguments)}}();Object(n.useEffect)(function(){Ur({type:"pathsDetail/getCoureses",payload:{id:wa.pathId}}),Al()},[]);function Al(){return Qs.apply(this,arguments)}function Qs(){return Qs=Object(y.a)(r.a.mark(function Wn(){return r.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:return wn.t0=Ts,wn.next=3,Object(K.w)({id:wa.pathId,course_type:1});case 3:wn.t1=wn.sent,(0,wn.t0)(wn.t1);case 5:case"end":return wn.stop()}},Wn)})),Qs.apply(this,arguments)}Object(n.useEffect)(function(){var Wn;if(((Wn=ca.actionTabs)===null||Wn===void 0?void 0:Wn.key)==="\u4FEE\u6539\u5F00\u8BFE\u65F6\u95F4"){var Pn,wn,nr=(Pn=In.detail)===null||Pn===void 0||((wn=Pn.courses)===null||wn===void 0)?void 0:wn.find(function(Bn){var _r;return Bn.course_id===((_r=ca.actionTabs)===null||_r===void 0?void 0:_r.name)});ni(nr||{})}},[ca.actionTabs]),Object(n.useEffect)(function(){var Wn,Pn,wn;if((Wn=In.detail)!==null&&Wn!==void 0&&Wn.has_start){var nr,Bn,_r=(nr=In.detail)===null||nr===void 0||((Bn=nr.courses)===null||Bn===void 0)?void 0:Bn.findIndex(function(Ko){var po;return parseInt((po=Ko.course_status)===null||po===void 0?void 0:po.status)===1});wn=_r>-1?_r:0}else{var Mr,jr,Pa,Ja,bi,pi=(Mr=In.detail)===null||Mr===void 0||((jr=Mr.courses)===null||jr===void 0||((Pa=jr.map(function(Ko){var po;return parseInt((po=Ko.course_status)===null||po===void 0?void 0:po.status)}))===null||Pa===void 0))?void 0:Pa.lastIndexOf(2);wn=pi>-1?pi:0,pi=(Ja=In.detail)===null||Ja===void 0||((bi=Ja.courses)===null||bi===void 0)?void 0:bi.findIndex(function(Ko){var po;return parseInt((po=Ko.course_status)===null||po===void 0?void 0:po.status)===0}),wn=pi>-1?pi:wn}if((Pn=In.detail)!==null&&Pn!==void 0&&Pn.courses){var Ei;ni(((Ei=In.detail)===null||Ei===void 0?void 0:Ei.courses[wn])||{})}},[In.detail]);var cr=function(){var Wn=Object(y.a)(r.a.mark(function Pn(wn){return r.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:T.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:e.a.createElement("div",{className:"tc"},"\u4F60\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6210\u5458\u5417\uFF1F"),onOk:function(){var _r=Object(y.a)(r.a.mark(function jr(){var Pa,Ja;return r.a.wrap(function(pi){for(;;)switch(pi.prev=pi.next){case 0:return pi.next=2,Object(K.p)({id:wa.pathId,user_id:wn});case 2:Pa=pi.sent,(Pa==null?void 0:Pa.status)===1&&(((Ja=Ji.userInfo)===null||Ja===void 0?void 0:Ja.user_id)===wn&&(window.location.href=window.location.href),R.b.info(Pa==null?void 0:Pa.message),bs());case 4:case"end":return pi.stop()}},jr)}));function Mr(){return _r.apply(this,arguments)}return Mr}()});case 1:case"end":return Bn.stop()}},Pn)}));return function(wn){return Wn.apply(this,arguments)}}(),ys=function(){var Wn=Object(y.a)(r.a.mark(function Pn(wn){return r.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:T.a.confirm({title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:e.a.createElement("div",{className:"tc"},"\u4F60\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u8BFE\u5802\u5417\uFF1F"),onOk:function(){var _r=Object(y.a)(r.a.mark(function jr(){var Pa;return r.a.wrap(function(bi){for(;;)switch(bi.prev=bi.next){case 0:return bi.next=2,Object(K.o)({id:wa.pathId,courseid:wn});case 2:Pa=bi.sent,(Pa==null?void 0:Pa.status)===0&&(R.b.info("\u5220\u9664\u6210\u529F"),bs());case 4:case"end":return bi.stop()}},jr)}));function Mr(){return _r.apply(this,arguments)}return Mr}()});case 1:case"end":return Bn.stop()}},Pn)}));return function(wn){return Wn.apply(this,arguments)}}(),Ks=function(){T.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:e.a.createElement("div",{className:"tc"},"\u662F\u5426\u786E\u8BA4\u7ACB\u5373\u9884\u7EA6\uFF1F"),onOk:function(){var Pn=Object(y.a)(r.a.mark(function nr(){var Bn;return r.a.wrap(function(Mr){for(;;)switch(Mr.prev=Mr.next){case 0:return Mr.next=2,Object(K.i)({id:wa.pathId});case 2:Bn=Mr.sent,Bn.status===0&&(Oi(!0),R.b.success(Bn.message));case 4:case"end":return Mr.stop()}},nr)}));function wn(){return Pn.apply(this,arguments)}return wn}()})},Bs=function(){Ur({type:"pathsDetail/setActionTabs",payload:{key:"Collaborators-AddCollaborator"}})},fo=function(Pn){Ur({type:"pathsDetail/setActionTabs",payload:{key:"Collaborators-AddCourses",type:Pn}})},bs=function(){Ur({type:"pathsDetail/getPathsDetail",payload:{id:wa.pathId}}),Ur({type:"pathsDetail/getRightData",payload:{id:wa.pathId}}),Ur({type:"pathsDetail/getCoureses",payload:{id:wa.pathId}}),Al()},Ws=function(){var Pn;return Lt?e.a.createElement("div",{className:jt.a.flexRow},e.a.createElement(re.a,{placeholder:"\u4F8B\u5982\uFF1A\u6559\u5B66\u56E2\u961F",value:er,onChange:function(nr){return lr(nr.target.value)}}),e.a.createElement(h.a,{className:"ml5",onClick:function(){return Yt(!Lt)}},"\u53D6\u6D88"),e.a.createElement(h.a,{className:"ml5",type:"primary",onClick:hl},"\u786E\u5B9A")):e.a.createElement("div",{className:jt.a.directionItemWrap},e.a.createElement("span",{style:{fontSize:"16px",display:"flex",alignItems:"center"}}," ",e.a.createElement("img",{style:{marginRight:"10px"},src:rr.a})," ",(Pn=In.rightData)===null||Pn===void 0?void 0:Pn.team_title),e.a.createElement("span",{className:jt.a.groupActionWrap},e.a.createElement("i",{className:"iconfont icon-xiugai mr1 c-light-primary font15 current",onClick:function(){return Yt(!Lt)}})))},Ms=function(){var Pn,wn,nr=new Image;nr.src=ft.q;var Bn=((Pn=In.rightData)===null||Pn===void 0||((wn=Pn.tags)===null||wn===void 0)?void 0:wn.map(function(Mr,jr){return{name:Mr.tag_name,value:jr}}))||[],_r={backgroundColor:"#fff",tooltip:{pointFormat:"{series.name}