(window.webpackJsonp=window.webpackJsonp||[]).push([[204,5,7],{"55Ip":function(nt,We,J){"use strict";J.d(We,"a",function(){return s}),J.d(We,"b",function(){return c});var fe=J("Ty5D"),U=J("dI71"),C=J("q1tI"),B=J.n(C),O=J("YS25"),L=J("17x9"),_=J.n(L),M=J("wx14"),A=J("zLVn"),w=J("9R94"),g=function(r){Object(U.a)(t,r);function t(){for(var m,v=arguments.length,T=new Array(v),k=0;k0&&arguments[0]!==void 0?arguments[0]:[],y=new Map;function h(e){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(e||[]).forEach(function(o){var f=o.key,u=o.children;Object(O.a)(f!=null,"Tree node must have a certain key: [".concat(s).concat(f,"]"));var l=String(f);Object(O.a)(!y.has(l)||f===null||f===void 0,"Same 'key' exist in the Tree: ".concat(l)),y.set(l,!0),h(u,"".concat(s).concat(l," > "))})}h(b)}function A(b){function y(h){var e=Object(B.a)(h);return e.map(function(s){if(!Object(L.i)(s))return Object(O.a)(!s,"Tree/TreeNode can only accept TreeNode as children."),null;var o=s.key,f=s.props,u=f.children,l=Object(C.a)(f,["children"]),p=Object(U.a)({key:o},l),c=y(u);return c.length&&(p.children=c),p}).filter(function(s){return s})}return y(b)}function w(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],h=new Set(y===!0?[]:y),e=[];function s(o){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return o.map(function(u,l){var p=Object(L.h)(f?f.pos:"0",l),c=_(u.key,p),i=Object(U.a)(Object(U.a)({},u),{},{parent:f,pos:p,children:null,data:u,isStart:[].concat(Object(fe.a)(f?f.isStart:[]),[l===0]),isEnd:[].concat(Object(fe.a)(f?f.isEnd:[]),[l===o.length-1])});return e.push(i),y===!0||h.has(c)?i.children=s(u.children||[],i):i.children=[],i})}return s(b),e}function g(b,y,h){var e;h?typeof h=="string"?e=function(f){return f[h]}:typeof h=="function"&&(e=function(f){return h(f)}):e=function(f,u){return _(f.key,u)};function s(o,f,u){var l=o?o.children:b,p=o?Object(L.h)(u.pos,f):"0";if(o){var c=e(o,p),i={node:o,index:f,pos:p,key:c,parentPos:u.node?u.pos:null,level:u.level+1};y(i)}l&&l.forEach(function(r,t){s(r,t,{node:o,pos:p,level:u?u.level+1:-1})})}s(null)}function x(b){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=y.initWrapper,e=y.processEntity,s=y.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,f={},u={},l={posEntities:f,keyEntities:u};return h&&(l=h(l)||l),g(b,function(p){var c=p.node,i=p.index,r=p.pos,t=p.key,a=p.parentPos,m=p.level,v={node:c,index:i,key:t,pos:r,level:m},T=_(t,r);f[r]=v,u[T]=v,v.parent=f[a],v.parent&&(v.parent.children=v.parent.children||[],v.parent.children.push(v)),e&&e(v,l)},o),s&&s(l),l}function S(b,y){var h=y.expandedKeys,e=y.selectedKeys,s=y.loadedKeys,o=y.loadingKeys,f=y.checkedKeys,u=y.halfCheckedKeys,l=y.dragOverNodeKey,p=y.dropPosition,c=y.keyEntities,i=c[b],r={eventKey:b,expanded:h.indexOf(b)!==-1,selected:e.indexOf(b)!==-1,loaded:s.indexOf(b)!==-1,loading:o.indexOf(b)!==-1,checked:f.indexOf(b)!==-1,halfChecked:u.indexOf(b)!==-1,pos:String(i?i.pos:""),dragOver:l===b&&p===0,dragOverGapTop:l===b&&p===-1,dragOverGapBottom:l===b&&p===1};return r}function E(b){var y=b.data,h=b.expanded,e=b.selected,s=b.checked,o=b.loaded,f=b.loading,u=b.halfChecked,l=b.dragOver,p=b.dragOverGapTop,c=b.dragOverGapBottom,i=b.pos,r=b.active,t=Object(U.a)(Object(U.a)({},y),{},{expanded:h,selected:e,checked:s,loaded:o,loading:f,halfChecked:u,dragOver:l,dragOverGapTop:p,dragOverGapBottom:c,pos:i,active:r});return"props"in t||Object.defineProperty(t,"props",{get:function(){return Object(O.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),b}}),t}},"8Jsi":function(nt,We,J){"use strict";J.d(We,"d",function(){return a}),J.d(We,"a",function(){return Oe}),J.d(We,"b",function(){return Ae}),J.d(We,"c",function(){return we});var fe=J("1OyB"),U=J("vuIU"),C=J("Ji7U"),B=J("LK+K"),O=J("KQm4"),L=J("U8pU"),_=J("ODXe"),M=J("VTBJ"),A=J("q1tI"),w=J("qNPg"),g=J("2Qr1"),x=J("815F"),S=J("NvD2"),E=J("wPlo"),b=J("6cGi"),y=J("Kwbf"),h=J("4IlW"),e=J("YrtM"),s=J("fAei"),o=A.createContext(null);function f(ae,ue){if(!ae)return!0;var be=ae.data,Te=be.disabled,Ce=be.disableCheckbox;switch(ue){case"select":return Te;case"checkbox":return Te||Ce}return!1}function u(ae,ue){var be=A.useCallback(function(Ce){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",ye=arguments.length>2?arguments[2]:void 0,Ie=ae.get(Ce);return!ye&&f(Ie,Se)?null:Ie},[ae]),Te=A.useCallback(function(Ce){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",ye=arguments.length>2?arguments[2]:void 0,Ie=ue.get(Ce);return!ye&&f(Ie,Se)?null:Ie},[ue]);return[be,Te]}function l(ae){return A.useMemo(function(){var ue=new Map,be=new Map;return ae.forEach(function(Te){ue.set(Te.key,Te),be.set(Te.data.value,Te)}),[ue,be]},[ae])}var p={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},c=function(ue,be){var Te=ue.prefixCls,Ce=ue.height,Se=ue.itemHeight,ye=ue.virtual,Ie=ue.options,Be=ue.flattenOptions,ve=ue.multiple,Me=ue.searchValue,re=ue.onSelect,q=ue.onToggleOpen,te=ue.open,j=ue.notFoundContent,W=ue.onMouseEnter,G=A.useContext(o),X=G.checkable,oe=G.checkedKeys,ce=G.halfCheckedKeys,ke=G.treeExpandedKeys,He=G.treeDefaultExpandAll,$e=G.treeDefaultExpandedKeys,ze=G.onTreeExpand,Ze=G.treeIcon,et=G.showTreeIcon,Xe=G.switcherIcon,mt=G.treeLine,rt=G.treeNodeFilterProp,vt=G.loadData,ct=G.treeLoadedKeys,qe=G.treeMotion,yt=G.onTreeLoad,bt=A.useRef(),Ve=Object(e.a)(function(){return Ie},[te,Ie],function(je,Le){return Le[0]&&je[1]!==Le[1]}),wt=l(Be),at=Object(_.a)(wt,2),ut=at[0],At=at[1],St=u(ut,At),Rt=Object(_.a)(St,2),it=Rt[0],Qe=Rt[1],Ye=A.useMemo(function(){return oe.map(function(je){var Le=Qe(je);return Le?Le.key:null})},[oe]),ot=A.useMemo(function(){return X?{checked:Ye,halfChecked:ce}:null},[Ye,ce,X]);A.useEffect(function(){if(te&&!ve&&Ye.length){var je;(je=bt.current)===null||je===void 0||je.scrollTo({key:Ye[0]})}},[te]);var dt=String(Me).toLowerCase(),tt=function(Le){return dt?String(Le[rt]).toLowerCase().includes(dt):!1},st=A.useState($e),ft=Object(_.a)(st,2),Ot=ft[0],Ft=ft[1],_t=A.useState(null),Wt=Object(_.a)(_t,2),jt=Wt[0],Vt=Wt[1],Ht=A.useMemo(function(){return ke?Object(O.a)(ke):Me?jt:Ot},[Ot,jt,dt,ke]);A.useEffect(function(){Me&&Vt(Be.map(function(je){return je.key}))},[Me]);var P=function(Le){Ft(Le),Vt(Le),ze&&ze(Le)},n=function(Le){Le.preventDefault()},d=function(Le,Ge){var Ke=Ge.node.key,Je=it(Ke,X?"checkbox":"select");Je!==null&&re(Je.data.value,{selected:!oe.includes(Je.data.value)}),ve||q(!1)},D=A.useState(null),N=Object(_.a)(D,2),R=N[0],ee=N[1],Re=it(R);if(A.useImperativeHandle(be,function(){return{onKeyDown:function(Le){var Ge,Ke=Le.which;switch(Ke){case h.a.UP:case h.a.DOWN:case h.a.LEFT:case h.a.RIGHT:(Ge=bt.current)===null||Ge===void 0||Ge.onKeyDown(Le);break;case h.a.ENTER:{Re!==null&&d(null,{node:{key:R},selected:!oe.includes(Re.data.value)});break}case h.a.ESC:q(!1)}},onKeyUp:function(){}}}),Ve.length===0)return A.createElement("div",{role:"listbox",className:"".concat(Te,"-empty"),onMouseDown:n},j);var Ue={};return ct&&(Ue.loadedKeys=ct),Ht&&(Ue.expandedKeys=Ht),A.createElement("div",{onMouseDown:n,onMouseEnter:W},Re&&te&&A.createElement("span",{style:p,"aria-live":"assertive"},Re.data.value),A.createElement(s.b,Object.assign({ref:bt,focusable:!1,prefixCls:"".concat(Te,"-tree"),treeData:Ve,height:Ce,itemHeight:Se,virtual:ye,multiple:ve,icon:Ze,showIcon:et,switcherIcon:Xe,showLine:mt,loadData:Me?null:vt,motion:qe,checkable:X,checkStrictly:!0,checkedKeys:ot,selectedKeys:X?[]:Ye,defaultExpandAll:He},Ue,{onActiveChange:ee,onSelect:d,onCheck:d,onExpand:P,onLoad:yt,filterTreeNode:tt})))},i=A.forwardRef(c);i.displayName="OptionList";var r=i,t=function(){return null},a=t,m=J("Ff2n"),v=J("Zm9Q");function T(ae){return Object(v.a)(ae).map(function(ue){if(!A.isValidElement(ue)||!ue.type)return null;var be=ue.key,Te=ue.props,Ce=Te.children,Se=Te.value,ye=Object(m.a)(Te,["children","value"]),Ie=Object(M.a)({key:be,value:Se},ye),Be=T(Ce);return Be.length&&(Ie.children=Be),Ie}).filter(function(ue){return ue})}function k(ae){if(!ae)return ae;var ue=Object(M.a)({},ae);return"props"in ue||Object.defineProperty(ue,"props",{get:function(){return Object(y.a)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),ue}}),ue}function I(ae,ue,be,Te,Ce){var Se=null,ye=null;function Ie(){function Be(ve){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return ve.map(function(q,te){var j="".concat(Me,"-").concat(te),W=be.includes(q.value),G=Be(q.children||[],j,W),X=A.createElement(a,Object.assign({},q),G.map(function(ce){return ce.node}));if(ue===q.value&&(Se=X),W){var oe={pos:j,node:X,children:G};return re||ye.push(oe),oe}return null}).filter(function(q){return q})}ye||(ye=[],Be(Te),ye.sort(function(ve,Me){var re=ve.node.props.value,q=Me.node.props.value,te=be.indexOf(re),j=be.indexOf(q);return te-j}))}Object.defineProperty(ae,"triggerNode",{get:function(){return Object(y.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),Ie(),Se}}),Object.defineProperty(ae,"allCheckedNodes",{get:function(){return Object(y.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),Ie(),Ce?ye:ye.map(function(ve){var Me=ve.node;return Me})}})}function F(ae){return Array.isArray(ae)?ae:ae!==void 0?[ae]:[]}function K(ae,ue){var be=new Map;return ue.forEach(function(Te){var Ce=Te.data;be.set(Ce.value,Ce)}),ae.map(function(Te){return k(be.get(Te))})}function V(ae,ue){var be=K([ae],ue)[0];return be?be.disabled:!1}function Q(ae){return ae.disabled||ae.disableCheckbox||ae.checkable===!1}function Z(ae){for(var ue=ae.parent,be=0,Te=ue;Te;)Te=Te.parent,be+=1;return be}function ie(ae){function ue(Te){return(Te||[]).map(function(Ce){var Se=Ce.value,ye=Ce.key,Ie=Ce.children,Be=Object(M.a)(Object(M.a)({},Ce),{},{key:"key"in Ce?ye:Se});return Ie&&(Be.children=ue(Ie)),Be})}var be=Object(x.d)(ue(ae),!0);return be.map(function(Te){return{key:Te.data.key,data:Te.data,level:Z(Te)}})}function ge(ae){return function(ue,be){var Te=be[ae];return String(Te).toLowerCase().includes(String(ue).toLowerCase())}}function se(ae,ue,be){var Te=be.optionFilterProp,Ce=be.filterOption;if(Ce===!1)return ue;var Se;typeof Ce=="function"?Se=Ce:Se=ge(Te);function ye(Ie){var Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ie.map(function(ve){var Me=ve.children,re=Be||Se(ae,k(ve)),q=ye(Me||[],re);return re||q.length?Object(M.a)(Object(M.a)({},ve),{},{children:q}):null}).filter(function(ve){return ve})}return ye(ue)}function he(ae,ue,be,Te){var Ce=new Map;return F(ue).forEach(function(Se){Se&&Object(L.a)(Se)==="object"&&"value"in Se&&Ce.set(Se.value,Se)}),ae.map(function(Se){var ye={value:Se},Ie=be(Se,"select",!0),Be=Ie?Te(Ie.data):Se;if(Ce.has(Se)){var ve=Ce.get(Se);ye.label="label"in ve?ve.label:Be,"halfChecked"in ve&&(ye.halfChecked=ve.halfChecked)}else ye.label=Be;return ye})}function le(ae,ue){var be=new Set(ae);return be.add(ue),Array.from(be)}function $(ae,ue){var be=new Set(ae);return be.delete(ue),Array.from(be)}function Y(ae){var ue=ae.searchPlaceholder,be=ae.treeCheckStrictly,Te=ae.treeCheckable,Ce=ae.labelInValue,Se=ae.value,ye=ae.multiple;Object(y.a)(!ue,"`searchPlaceholder` has been removed."),be&&Ce===!1&&Object(y.a)(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(Ce||be)&&Object(y.a)(F(Se).every(function(Ie){return Ie&&Object(L.a)(Ie)==="object"&&"value"in Ie}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),be||ye||Te?Object(y.a)(!Se||Array.isArray(Se),"`value` should be an array when `TreeSelect` is checkable or multiple."):Object(y.a)(!Array.isArray(Se),"`value` should not be array when `TreeSelect` is single mode.")}var ne=Y,z=10;function H(ae,ue){var be=ue.id,Te=ue.pId,Ce=ue.rootPId,Se={},ye=[],Ie=ae.map(function(Be){var ve=Object(M.a)({},Be),Me=ve[be];return Se[Me]=ve,ve.key=ve.key||Me,ve});return Ie.forEach(function(Be){var ve=Be[Te],Me=Se[ve];Me&&(Me.children=Me.children||[],Me.children.push(Be)),(ve===Ce||!Me&&Ce===null)&&ye.push(Be)}),ye}function me(ae,ue){var be=0,Te=new Set;function Ce(Se){return(Se||[]).map(function(ye){var Ie=ye.key,Be=ye.value,ve=ye.children,Me=Object(m.a)(ye,["key","value","children"]),re="value"in ye?Be:Ie,q=Object(M.a)(Object(M.a)({},Me),{},{key:Ie!=null?Ie:re,value:re,title:ue(ye)});return"children"in ye&&(q.children=Ce(ve)),q})}return Ce(ae)}function De(ae,ue,be){var Te=be.getLabelProp,Ce=be.simpleMode,Se=A.useRef({});return ae?(Se.current.formatTreeData=Se.current.treeData===ae?Se.current.formatTreeData:me(Ce?H(ae,Object(M.a)({id:"id",pId:"pId",rootPId:null},Ce!==!0?Ce:{})):ae,Te),Se.current.treeData=ae):Se.current.formatTreeData=Se.current.children===ue?Se.current.formatTreeData:me(T(ue),Te),Se.current.formatTreeData}var Oe="SHOW_ALL",we="SHOW_PARENT",Ae="SHOW_CHILD";function de(ae,ue,be){var Te=new Set(ae);return ue===Ae?ae.filter(function(Ce){var Se=be[Ce];return!(Se&&Se.children&&Se.children.every(function(ye){var Ie=ye.node;return Q(Ie)||Te.has(Ie.key)}))}):ue===we?ae.filter(function(Ce){var Se=be[Ce],ye=Se?Se.parent:null;return!(ye&&!Q(ye.node)&&Te.has(ye.node.key))}):ae}function pe(ae,ue){var be=ue.value,Te=ue.getEntityByValue,Ce=ue.getEntityByKey,Se=ue.treeConduction,ye=ue.showCheckedStrategy,Ie=ue.conductKeyEntities,Be=ue.getLabelProp;return A.useMemo(function(){var ve=ae;if(Se){var Me=de(ae.map(function(re){var q=Te(re);return q?q.key:re}),ye,Ie);ve=Me.map(function(re){var q=Ce(re);return q?q.data.value:re})}return he(ve,be,Te,Be)},[ae,be,Se,ye,Te])}var Ee=["expandedKeys","treeData","treeCheckable","showCheckedStrategy","searchPlaceholder","treeLine","treeIcon","showTreeIcon","switcherIcon","treeNodeFilterProp","filterTreeNode","dropdownPopupAlign","treeDefaultExpandAll","treeCheckStrictly","treeExpandedKeys","treeLoadedKeys","treeMotion","onTreeExpand","onTreeLoad","loadData","treeDataSimpleMode","treeNodeLabelProp","treeDefaultExpandedKeys"],xe=Object(w.a)({prefixCls:"rc-tree-select",components:{optionList:r},convertChildrenToData:function(){return null},flattenOptions:ie,getLabeledValue:g.e,filterOptions:se,isValueDisabled:V,findValueOption:K,omitDOMProps:function(ue){var be=Object(M.a)({},ue);return Ee.forEach(function(Te){delete be[Te]}),be}});xe.displayName="Select";var _e=A.forwardRef(function(ae,ue){var be=ae.multiple,Te=ae.treeCheckable,Ce=ae.treeCheckStrictly,Se=ae.showCheckedStrategy,ye=Se===void 0?"SHOW_CHILD":Se,Ie=ae.labelInValue,Be=ae.loadData,ve=ae.treeLoadedKeys,Me=ae.treeNodeFilterProp,re=Me===void 0?"value":Me,q=ae.treeNodeLabelProp,te=ae.treeDataSimpleMode,j=ae.treeData,W=ae.treeExpandedKeys,G=ae.treeDefaultExpandedKeys,X=ae.treeDefaultExpandAll,oe=ae.children,ce=ae.treeIcon,ke=ae.showTreeIcon,He=ae.switcherIcon,$e=ae.treeLine,ze=ae.treeMotion,Ze=ae.filterTreeNode,et=ae.dropdownPopupAlign,Xe=ae.onChange,mt=ae.onTreeExpand,rt=ae.onTreeLoad,vt=ae.onDropdownVisibleChange,ct=ae.onSelect,qe=ae.onDeselect,yt=Te||Ce,bt=be||yt,Ve=Te&&!Ce,wt=Ce||Ie,at=A.useRef(null);A.useImperativeHandle(ue,function(){return{focus:at.current.focus,blur:at.current.blur}});var ut=function(Ke){return j&&Ke.label||Ke.title},At=function(Ke){return q?Ke[q]:ut(Ke)},St=De(j,oe,{getLabelProp:ut,simpleMode:te}),Rt=Object(A.useMemo)(function(){return ie(St)},[St]),it=l(Rt),Qe=Object(_.a)(it,2),Ye=Qe[0],ot=Qe[1],dt=u(Ye,ot),tt=Object(_.a)(dt,2),st=tt[0],ft=tt[1],Ot=Object(A.useMemo)(function(){return Ve?Object(x.a)(St):{keyEntities:null}},[St,Te,Ce]),Ft=Ot.keyEntities,_t=Object(b.a)(ae.defaultValue,{value:ae.value}),Wt=Object(_.a)(_t,2),jt=Wt[0],Vt=Wt[1],Ht=function(Ke){var Je=[],xt=[];return Ke.forEach(function(gt){ft(gt)?xt.push(gt):Je.push(gt)}),{missingRawValues:Je,existRawValues:xt}},P=Object(A.useMemo)(function(){var Ge=[],Ke=[];if(F(jt).forEach(function(pt){if(pt&&Object(L.a)(pt)==="object"&&"value"in pt)if(pt.halfChecked&&Ce){var Lt=ft(pt.value);Ge.push(Lt?Lt.key:pt.value)}else Ke.push(pt.value);else Ke.push(pt)}),Ve){var Je=Ht(Ke),xt=Je.missingRawValues,gt=Je.existRawValues,Et=gt.map(function(pt){return ft(pt).key}),Ct=Object(S.a)(Et,!0,Ft),Kt=Ct.checkedKeys,Nt=Ct.halfCheckedKeys;return[[].concat(Object(O.a)(xt),Object(O.a)(Kt.map(function(pt){return st(pt).data.value}))),Nt]}return[Ke,Ge]},[jt,bt,wt,Te,Ce]),n=Object(_.a)(P,2),d=n[0],D=n[1],N=pe(d,{treeConduction:Ve,value:jt,showCheckedStrategy:ye,conductKeyEntities:Ft,getEntityByValue:ft,getEntityByKey:st,getLabelProp:At}),R=function(Ke,Je,xt){if(Vt(bt?Ke:Ke[0]),Xe){var gt=Ke;if(Ve&&ye!=="SHOW_ALL"){var Et=Ke.map(function(Dt){var It=ft(Dt);return It?It.key:Dt}),Ct=de(Et,ye,Ft);gt=Ct.map(function(Dt){var It=st(Dt);return It?It.data.value:Dt})}var Kt=Je||{triggerValue:void 0,selected:void 0},Nt=Kt.triggerValue,pt=Kt.selected,Lt=wt?he(gt,jt,ft,At):gt;if(Ce){var Gt=D.map(function(Dt){var It=st(Dt);return It?It.data.value:Dt}).filter(function(Dt){return!gt.includes(Dt)});Lt=[].concat(Object(O.a)(Lt),Object(O.a)(he(Gt,jt,ft,At)))}var Pt={preValue:N,triggerValue:Nt},Xt=!0;(Ce||xt==="selection"&&!pt)&&(Xt=!1),I(Pt,Nt,Ke,St,Xt),yt?Pt.checked=pt:Pt.selected=pt,Xe(bt?Lt:Lt[0],wt?null:gt.map(function(Dt){var It=ft(Dt);return It?At(It.data):null}),Pt)}},ee=function(Ke,Je,xt){var gt=Ke;if(!bt)R([Ke],{selected:!0,triggerValue:Ke},xt);else{var Et=le(d,Ke);if(Ve){var Ct=Ht(Et),Kt=Ct.missingRawValues,Nt=Ct.existRawValues,pt=Nt.map(function(Pt){return ft(Pt).key}),Lt=Object(S.a)(pt,!0,Ft),Gt=Lt.checkedKeys;Et=[].concat(Object(O.a)(Kt),Object(O.a)(Gt.map(function(Pt){return st(Pt).data.value})))}R(Et,{selected:!0,triggerValue:Ke},xt)}ct&&ct(gt,Je)},Re=function(Ke,Je,xt){var gt=Ke,Et=$(d,Ke);if(Ve){var Ct=Ht(Et),Kt=Ct.missingRawValues,Nt=Ct.existRawValues,pt=Nt.map(function(Pt){return ft(Pt).key}),Lt=Object(S.a)(pt,{checked:!1,halfCheckedKeys:D},Ft),Gt=Lt.checkedKeys;Et=[].concat(Object(O.a)(Kt),Object(O.a)(Gt.map(function(Pt){return st(Pt).data.value})))}R(Et,{selected:!1,triggerValue:Ke},xt),qe&&qe(gt,Je)},Ue=function(){R([],null,"clear")},je=A.useCallback(function(Ge){if(vt){var Ke={};Object.defineProperty(Ke,"documentClickClose",{get:function(){return Object(y.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),vt(Ge,Ke)}},[vt]),Le={optionLabelProp:null,optionFilterProp:re,dropdownAlign:et,internalProps:{mark:E.a,onClear:Ue,skipTriggerChange:!0,skipTriggerSelect:!0,onRawSelect:ee,onRawDeselect:Re}};return"filterTreeNode"in ae&&(Le.filterOption=Ze),A.createElement(o.Provider,{value:{checkable:yt,loadData:Be,treeLoadedKeys:ve,onTreeLoad:rt,checkedKeys:d,halfCheckedKeys:D,treeDefaultExpandAll:X,treeExpandedKeys:W,treeDefaultExpandedKeys:G,onTreeExpand:mt,treeIcon:ce,treeMotion:ze,showTreeIcon:ke,switcherIcon:He,treeLine:$e,treeNodeFilterProp:re}},A.createElement(xe,Object.assign({ref:at,mode:bt?"multiple":null},ae,Le,{value:N,labelInValue:!0,options:St,onChange:null,onSelect:null,onDeselect:null,onDropdownVisibleChange:je})))}),Pe=function(ae){Object(C.a)(be,ae);var ue=Object(B.a)(be);function be(){var Te;return Object(fe.a)(this,be),Te=ue.apply(this,arguments),Te.selectRef=A.createRef(),Te.focus=function(){Te.selectRef.current.focus()},Te.blur=function(){Te.selectRef.current.blur()},Te}return Object(U.a)(be,[{key:"render",value:function(){return A.createElement(_e,Object.assign({ref:this.selectRef},this.props))}}]),be}(A.Component);Pe.TreeNode=a,Pe.SHOW_ALL=Oe,Pe.SHOW_PARENT=we,Pe.SHOW_CHILD=Ae;var Ne=Pe,Fe=We.e=Ne},"8hTe":function(nt,We,J){nt.exports={button:"button___1wy9m"}},"9Bee":function(nt,We,J){"use strict";var fe=J("DYRE"),U=J("zeV3"),C=J("+L6B"),B=J("2/Rp"),O=J("k1fw"),L=J("9og8"),_=J("tJVT"),M=J("WmNS"),A=J.n(M),w=J("q1tI"),g=J.n(w),x=J("vg9a"),S=J("DlQD"),E=J.n(S),b=J("rUJ1");function y(P,n){var d=P.match(/^(\s+)(?:```)/);if(d===null)return n;var D=d[1];return n.split(`
`).map(function(N){var R=N.match(/^\s+/);if(R===null)return N;var ee=Object(_.a)(R,1),Re=ee[0];return Re.length>=D.length?N.slice(D.length):N}).join(`
`)}var h=[],e=[""],s=new E.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function f(){h.length=0,e=[""]}var u={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function l(P,n,d,D){if(n>=P.length||P[n].level<=d)return n;var N=P[n];D.push("- "+N.text+""),n++;var R=[];return n=l(P,n,N.level,R),R.length>0&&(D.push("
"),R.forEach(function(ee){D.push(ee)}),D.push("
")),D.push(" "),n=l(P,n,d,D),n}function p(){return l(h,0,0,e),e.push("
"),e.join("")}var c={heading:function(n){var d=o.exec(n);if(d)return{type:"heading",raw:d[0],depth:d[1].length,text:d[2]}},fences:function(n){var d=this.rules.block.fences.exec(n);if(d){var D=d[0],N=y(D,d[3]||""),R=d[2]?d[2].trim():d[2];if(["latex","katex","math"].indexOf(R)>=0){var ee=t(),Re=N;N=ee,a[ee]={type:"block",expression:Re}}return{type:"code",raw:D,lang:R,text:N}}}},i=/(?:\${2})([^\n`]+?)(?:\${2})/gi,r=0,t=function(){return"__special_katext_id_".concat(r++,"__")},a={};function m(){return a}function v(){r=0,a={}}function T(P){return P=P.replace(i,function(n,d){var D=t();return a[D]={type:"inline",expression:d},D}),P}var k=s.listitem;s.listitem=function(P){return k(T(P))};var I=s.paragraph;s.paragraph=function(P){return I(T(P))};var F=s.tablecell;s.tablecell=function(P,n){return F(T(P),n)},s.code=function(P,n,d){var D=(n||"").match(/\S*/)[0];return D?["latex","katex","math"].indexOf(D)>=0?"".concat(P,"
"):'
').concat(d?P:Object(b.escape)(P,!0),`
`):''+(d?P:Object(b.escape)(P,!0))+"
"},s.heading=function(P,n,d){var D=this.options.headerPrefix+d.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:D,level:n,text:P}),"'+P+""},E.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),E.a.use({tokenizer:c,renderer:s});var K=E.a,V=J("SJMd"),Q=J("ulZh"),Z=J.n(Q),ie=J("m3rI"),ge=J("Oy/b"),se=J("p5ED"),he=J("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 le=function(P,n){return(le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,D){d.__proto__=D}||function(d,D){for(var N in D)Object.prototype.hasOwnProperty.call(D,N)&&(d[N]=D[N])})(P,n)};function $(P,n){function d(){this.constructor=P}le(P,n),P.prototype=n===null?Object.create(n):(d.prototype=n.prototype,new d)}function Y(P,n,d,D){return new(d||(d=Promise))(function(N,R){function ee(je){try{Ue(D.next(je))}catch(Le){R(Le)}}function Re(je){try{Ue(D.throw(je))}catch(Le){R(Le)}}function Ue(je){var Le;je.done?N(je.value):(Le=je.value,Le instanceof d?Le:new d(function(Ge){Ge(Le)})).then(ee,Re)}Ue((D=D.apply(P,n||[])).next())})}function ne(P,n){var d,D,N,R,ee={label:0,sent:function(){if(1&N[0])throw N[1];return N[1]},trys:[],ops:[]};return R={next:Re(0),throw:Re(1),return:Re(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function Re(Ue){return function(je){return function(Le){if(d)throw new TypeError("Generator is already executing.");for(;ee;)try{if(d=1,D&&(N=2&Le[0]?D.return:Le[0]?D.throw||((N=D.return)&&N.call(D),0):D.next)&&!(N=N.call(D,Le[1])).done)return N;switch(D=0,N&&(Le=[2&Le[0],N.value]),Le[0]){case 0:case 1:N=Le;break;case 4:return ee.label++,{value:Le[1],done:!1};case 5:ee.label++,D=Le[1],Le=[0];continue;case 7:Le=ee.ops.pop(),ee.trys.pop();continue;default:if(!(N=ee.trys,(N=N.length>0&&N[N.length-1])||Le[0]!==6&&Le[0]!==2)){ee=0;continue}if(Le[0]===3&&(!N||Le[1]>N[0]&&Le[1]',"select"),this.addActionButton(D,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(D,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(D,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(D,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(D,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(D,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(D,'',"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(R){var ee=document.createElement("div");ee.className=""+d.toolbarButtonStyleClass.name,ee.setAttribute("data-type-name",R.typeName),ee.innerHTML=R.icon,ee.addEventListener("click",function(){d.markerToolbarButtonClicked(ee,R)}),d.buttons.push(ee),d.markerButtons.push(ee)}),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 N=document.createElement("div");N.className=this.toolbarBlockStyleClass.name,N.style.whiteSpace="nowrap",N.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(N),this.addActionButton(N,'',"render"),this.addActionButton(N,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},P.prototype.addButtonClickListener=function(n){this.buttonClickListeners.push(n)},P.prototype.removeButtonClickListener=function(n){this.buttonClickListeners.indexOf(n)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(n),1)},P.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},P.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var n=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var d=0;d0&&this.buttonClickListeners.forEach(function(D){return D("marker",d)}),this.markerButtonOverflowBlock.style.display="none"},P.prototype.actionToolbarButtonClicked=function(n,d){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(D){return D("action",d)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},P.prototype.setActiveButton=function(n){this.resetButtonStyles(),n.className=n.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),n.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},P.prototype.setActiveMarkerButton=function(n){var d=this.markerButtons.find(function(D){return D.getAttribute("data-type-name")===n});d&&this.setActiveButton(d)},P.prototype.setCurrentMarker=function(n){var d=this;this.currentMarker=n,this.buttons.filter(function(D){return/delete|notes/.test(D.getAttribute("data-action"))}).forEach(function(D){d.currentMarker===void 0?(D.style.fillOpacity="0.4",D.style.pointerEvents="none"):(D.style.fillOpacity="1",D.style.pointerEvents="all")})},P}(),Ee=function(){function P(n,d,D,N){this.panels=[],this.panelButtons=[],this.markerjsContainer=n,this.displayMode=d,this.uiStyleSettings=D,this.styles=N,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return P.prototype.addStyles=function(){var n;this.toolboxStyleClass=this.styles.addClass(new de("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 de("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var d=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new de("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new de("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new de("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 de("toolbox-panel-row_colors",`
background-color: `+((n=this.uiStyleSettings.toolboxBackgroundColor)!==null&&n!==void 0?n:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new de("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*d)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*d)+`px;
padding: `+d+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new de("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new de("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ae("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ae("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},P.prototype.show=function(n){var d;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=n,this.uiContainer.className=this.toolboxStyleClass.name+" "+((d=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&d!==void 0?d:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},P.prototype.setPanelButtons=function(n){var d,D,N=this;this.panels=n,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((d=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&d!==void 0?d:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((D=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(R){var ee;R.uiStyleSettings=N.uiStyleSettings;var Re=document.createElement("div");Re.className=N.toolboxButtonStyleClass.name+" "+((ee=N.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ee!==void 0?ee:N.toolboxButtonStyleColorsClass.name),Re.innerHTML=R.icon,Re.title=R.title,Re.addEventListener("click",function(){N.panelButtonClick(R)}),N.panelButtons.push(Re),N.buttonRow.appendChild(Re)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},P.prototype.panelButtonClick=function(n){var d=this,D=-1;if(n!==this.activePanel){D=this.panels.indexOf(n),this.panelRow.innerHTML="";var N=n.getUi();N.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(N),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=n}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){d.displayMode==="inline"?d.panelRow.style.display="none":d.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(R,ee){var Re,Ue;R.className=d.toolboxButtonStyleClass.name+" "+(ee===D?""+((Re=d.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Re!==void 0?Re:d.toolboxActiveButtonStyleColorsClass.name):""+((Ue=d.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ue!==void 0?Ue:d.toolboxButtonStyleColorsClass.name))})},P}(),xe=function(P,n){this.title=P,this.icon=n},_e=function(P){function n(d,D,N,R){var ee=P.call(this,d,R||'')||this;return ee.colors=[],ee.addTransparent=!1,ee.colorBoxes=[],ee.colors=D,ee.currentColor=N,ee.setCurrentColor=ee.setCurrentColor.bind(ee),ee.getColorBox=ee.getColorBox.bind(ee),ee}return $(n,P),n.prototype.getUi=function(){var d=this,D=document.createElement("div");return D.style.overflow="hidden",D.style.whiteSpace="nowrap",this.colors.forEach(function(N){var R=d.getColorBox(N);D.appendChild(R),d.colorBoxes.push(R)}),D},n.prototype.getColorBox=function(d){var D=this,N=this.uiStyleSettings.toolbarHeight/4,R=this.uiStyleSettings.toolbarHeight-N,ee=document.createElement("div");ee.style.display="inline-block",ee.style.boxSizing="content-box",ee.style.width=R-2+"px",ee.style.height=R-2+"px",ee.style.padding="1px",ee.style.marginRight="2px",ee.style.marginBottom="2px",ee.style.borderWidth="2px",ee.style.borderStyle="solid",ee.style.borderRadius=(R+2)/2+"px",ee.style.borderColor=d===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ee.addEventListener("click",function(){D.setCurrentColor(d,ee)});var Re=document.createElement("div");return Re.style.display="inline-block",Re.style.width=R-2+"px",Re.style.height=R-2+"px",Re.style.backgroundColor=d,Re.style.borderRadius=R/2+"px",d==="transparent"&&(Re.style.fill=this.uiStyleSettings.toolboxAccentColor,Re.innerHTML=``),ee.appendChild(Re),ee},n.prototype.setCurrentColor=function(d,D){var N=this;this.currentColor=d,this.colorBoxes.forEach(function(R){R.style.borderColor=R===D?N.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(d)},n}(xe),Pe=function(){function P(n,d,D){this._state="new",this._isSelected=!1,this._container=n,this._overlayContainer=d,this.globalSettings=D,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(P.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),P.prototype.ownsTarget=function(n){return!1},Object.defineProperty(P.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),P.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},P.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},P.prototype.pointerDown=function(n,d){},P.prototype.dblClick=function(n,d){},P.prototype.manipulate=function(n){},P.prototype.pointerUp=function(n){this.stateChanged()},P.prototype.dispose=function(){},P.prototype.addMarkerVisualToContainer=function(n){this.container.childNodes.length>0?this.container.insertBefore(n,this.container.childNodes[0]):this.container.appendChild(n)},P.prototype.getState=function(){return{typeName:P.typeName,state:this.state,notes:this.notes}},P.prototype.restoreState=function(n){this._state=n.state,this.notes=n.notes},P.prototype.scale=function(n,d){},P.prototype.colorChanged=function(n){this.onColorChanged&&this.onColorChanged(n),this.stateChanged()},P.prototype.fillColorChanged=function(n){this.onFillColorChanged&&this.onFillColorChanged(n),this.stateChanged()},P.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var n=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),n.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(n)&&this.onStateChanged(this)}},P.typeName="MarkerBase",P}(),Ne=function(){function P(){this.findGripByVisual=this.findGripByVisual.bind(this)}return P.prototype.findGripByVisual=function(n){return this.topLeft.ownsTarget(n)?this.topLeft:this.topCenter.ownsTarget(n)?this.topCenter:this.topRight.ownsTarget(n)?this.topRight:this.centerLeft.ownsTarget(n)?this.centerLeft:this.centerRight.ownsTarget(n)?this.centerRight:this.bottomLeft.ownsTarget(n)?this.bottomLeft:this.bottomCenter.ownsTarget(n)?this.bottomCenter:this.bottomRight.ownsTarget(n)?this.bottomRight:void 0},P}(),Fe=function(){function P(){this.GRIP_SIZE=10,this.visual=H.createGroup(),this.visual.appendChild(H.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(H.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return P.prototype.ownsTarget=function(n){return n===this.visual||n===this.visual.childNodes[0]||n===this.visual.childNodes[1]},P}(),ae=function(){function P(){}return P.toITransformMatrix=function(n){return{a:n.a,b:n.b,c:n.c,d:n.d,e:n.e,f:n.f}},P.toSVGMatrix=function(n,d){return n.a=d.a,n.b=d.b,n.c=d.c,n.d=d.d,n.e=d.e,n.f=d.f,n},P}(),ue=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.left=0,R.top=0,R.width=0,R.height=0,R.defaultSize={x:50,y:20},R.offsetX=0,R.offsetY=0,R.rotationAngle=0,R.CB_DISTANCE=10,R._suppressMarkerCreateEvent=!1,R.container.transform.baseVal.appendItem(H.createTransform()),R.setupControlBox(),R}return $(n,P),Object.defineProperty(n.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"visual",{get:function(){return this._visual},set:function(d){this._visual=d;var D=H.createTransform();this._visual.transform.baseVal.appendItem(D)},enumerable:!1,configurable:!0}),n.prototype.ownsTarget=function(d){return!!P.prototype.ownsTarget.call(this,d)||!!(this.controlGrips.findGripByVisual(d)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(d))},n.prototype.pointerDown=function(d,D){P.prototype.pointerDown.call(this,d,D),this.state==="new"&&(this.left=d.x,this.top=d.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var N=this.unrotatePoint(d);if(this.manipulationStartX=N.x,this.manipulationStartY=N.y,this.offsetX=N.x-this.left,this.offsetY=N.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(D),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(D)){this.activeGrip=this.rotatorGrip;var R=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=R.x-this.width/2,this.top=R.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ee=this.container.transform.baseVal.getItem(0);ee.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ee,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},n.prototype.pointerUp=function(d){var D=this.state;P.prototype.pointerUp.call(this,d),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(d),this._state="select",D==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},n.prototype.moveVisual=function(d){this.visual.style.transform="translate("+d.x+"px, "+d.y+"px)"},n.prototype.manipulate=function(d){var D=this.unrotatePoint(d);this.state==="creating"?this.resize(d):this.state==="move"?(this.left=this.manipulationStartLeft+(D.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(D.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(D):this.state==="rotate"&&this.rotate(d)},n.prototype.resize=function(d){var D=this.manipulationStartLeft,N=this.manipulationStartWidth,R=this.manipulationStartTop,ee=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:D=this.manipulationStartLeft+d.x-this.manipulationStartX,N=this.manipulationStartWidth+this.manipulationStartLeft-D;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:N=this.manipulationStartWidth+d.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:R=this.manipulationStartTop+d.y-this.manipulationStartY,ee=this.manipulationStartHeight+this.manipulationStartTop-R;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ee=this.manipulationStartHeight+d.y-this.manipulationStartY}N>=0?(this.left=D,this.width=N):(this.left=D+N,this.width=-N),ee>=0?(this.top=R,this.height=ee):(this.top=R+ee,this.height=-ee),this.setSize()},n.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},n.prototype.rotate=function(d){if(Math.abs(d.x-this.centerX)>.1){var D=Math.sign(d.x-this.centerX);this.rotationAngle=180*Math.atan((d.y-this.centerY)/(d.x-this.centerX))/Math.PI+90*D,this.applyRotation()}},n.prototype.applyRotation=function(){var d=this.container.transform.baseVal.getItem(0);d.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(d,0)},n.prototype.rotatePoint=function(d){if(this.rotationAngle===0)return d;var D=this.container.getCTM(),N=H.createPoint(d.x,d.y);return{x:(N=N.matrixTransform(D)).x,y:N.y}},n.prototype.unrotatePoint=function(d){if(this.rotationAngle===0)return d;var D=this.container.getCTM();D=D.inverse();var N=H.createPoint(d.x,d.y);return{x:(N=N.matrixTransform(D)).x,y:N.y}},n.prototype.select=function(){P.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},n.prototype.deselect=function(){P.prototype.deselect.call(this),this.controlBox.style.display="none"},n.prototype.setupControlBox=function(){this.controlBox=H.createGroup();var d=H.createTransform();d.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(d),this.container.appendChild(this.controlBox),this.controlRect=H.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=H.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 Ne,this.addControlGrips(),this.controlBox.style.display="none"},n.prototype.adjustControlBox=function(){var d=this.controlBox.transform.baseVal.getItem(0);d.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(d,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()},n.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()},n.prototype.createGrip=function(){var d=new Fe;return d.visual.transform.baseVal.appendItem(H.createTransform()),this.controlBox.appendChild(d.visual),d},n.prototype.positionGrips=function(){var d=this.controlGrips.topLeft.GRIP_SIZE,D=-d/2,N=D,R=(this.width+this.CB_DISTANCE)/2-d/2,ee=(this.height+this.CB_DISTANCE)/2-d/2,Re=this.height+this.CB_DISTANCE-d/2,Ue=this.width+this.CB_DISTANCE-d/2;this.positionGrip(this.controlGrips.topLeft.visual,D,N),this.positionGrip(this.controlGrips.topCenter.visual,R,N),this.positionGrip(this.controlGrips.topRight.visual,Ue,N),this.positionGrip(this.controlGrips.centerLeft.visual,D,ee),this.positionGrip(this.controlGrips.centerRight.visual,Ue,ee),this.positionGrip(this.controlGrips.bottomLeft.visual,D,Re),this.positionGrip(this.controlGrips.bottomCenter.visual,R,Re),this.positionGrip(this.controlGrips.bottomRight.visual,Ue,Re),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,R,N-3*this.CB_DISTANCE)},n.prototype.positionGrip=function(d,D,N){var R=d.transform.baseVal.getItem(0);R.setTranslate(D,N),d.transform.baseVal.replaceItem(R,0)},n.prototype.hideControlBox=function(){this.controlBox.style.display="none"},n.prototype.showControlBox=function(){this.controlBox.style.display=""},n.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ae.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ae.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},P.prototype.getState.call(this))},n.prototype.restoreState=function(d){P.prototype.restoreState.call(this,d);var D=d;this.left=D.left,this.top=D.top,this.width=D.width,this.height=D.height,this.rotationAngle=D.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ae.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,D.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ae.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,D.containerTransformMatrix))},n.prototype.scale=function(d,D){P.prototype.scale.call(this,d,D);var N=this.rotatePoint({x:this.left,y:this.top}),R=this.unrotatePoint({x:N.x*d,y:N.y*D});this.left=R.x,this.top=R.y,this.width=this.width*d,this.height=this.height*D,this.adjustControlBox()},n}(Pe),be=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.fillColor="transparent",R.strokeColor="transparent",R.strokeWidth=0,R.strokeDasharray="",R.opacity=1,R.setStrokeColor=R.setStrokeColor.bind(R),R.setFillColor=R.setFillColor.bind(R),R.setStrokeWidth=R.setStrokeWidth.bind(R),R.setStrokeDasharray=R.setStrokeDasharray.bind(R),R.createVisual=R.createVisual.bind(R),R}return $(n,P),n.prototype.ownsTarget=function(d){return!(!P.prototype.ownsTarget.call(this,d)&&d!==this.visual)},n.prototype.createVisual=function(){this.visual=H.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)},n.prototype.pointerDown=function(d,D){P.prototype.pointerDown.call(this,d,D),this.state==="new"&&(this.createVisual(),this.moveVisual(d),this._state="creating")},n.prototype.manipulate=function(d){P.prototype.manipulate.call(this,d)},n.prototype.resize=function(d){P.prototype.resize.call(this,d),this.setSize()},n.prototype.setSize=function(){P.prototype.setSize.call(this),H.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},n.prototype.pointerUp=function(d){P.prototype.pointerUp.call(this,d),this.setSize()},n.prototype.setStrokeColor=function(d){this.strokeColor=d,this.visual&&H.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(d),this.stateChanged()},n.prototype.setFillColor=function(d){this.fillColor=d,this.visual&&H.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},n.prototype.setStrokeWidth=function(d){this.strokeWidth=d,this.visual&&H.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},n.prototype.setStrokeDasharray=function(d){this.strokeDasharray=d,this.visual&&H.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},n.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},P.prototype.getState.call(this))},n.prototype.restoreState=function(d){var D=d;this.fillColor=D.fillColor,this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.opacity=D.opacity,this.createVisual(),P.prototype.restoreState.call(this,d),this.setSize()},n.prototype.scale=function(d,D){P.prototype.scale.call(this,d,D),this.setSize()},n.title="Rectangle marker",n}(ue),Te=function(P){function n(d,D,N,R){var ee=P.call(this,d,R||'')||this;return ee.widths=[],ee.widthBoxes=[],ee.widths=D,ee.currentWidth=N,ee.setCurrentWidth=ee.setCurrentWidth.bind(ee),ee}return $(n,P),n.prototype.getUi=function(){var d=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",this.widths.forEach(function(N){var R=document.createElement("div");R.style.display="flex",R.style.flexGrow="2",R.style.alignItems="center",R.style.justifyContent="space-between",R.style.padding="5px",R.style.borderWidth="2px",R.style.borderStyle="solid",R.style.borderColor=N===d.currentWidth?d.uiStyleSettings.toolboxAccentColor:"transparent",R.addEventListener("click",function(){d.setCurrentWidth(N,R)}),D.appendChild(R);var ee=document.createElement("div");ee.innerText=N.toString(),ee.style.marginRight="5px",R.appendChild(ee);var Re=document.createElement("div");Re.style.minHeight="20px",Re.style.flexGrow="2",Re.style.display="flex",Re.style.alignItems="center";var Ue=document.createElement("hr");Ue.style.minWidth="20px",Ue.style.border="0px",Ue.style.borderTop=N+"px solid "+d.uiStyleSettings.toolboxColor,Ue.style.flexGrow="2",Re.appendChild(Ue),R.appendChild(Re),d.widthBoxes.push(R)}),D},n.prototype.setCurrentWidth=function(d,D){var N=this;this.currentWidth=d,this.widthBoxes.forEach(function(R){R.style.borderColor=R===D?N.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},n}(xe),Ce=function(P){function n(d,D,N,R){var ee=P.call(this,d,R||'')||this;return ee.styles=[],ee.styleBoxes=[],ee.styles=D,ee.currentStyle=N,ee.setCurrentStyle=ee.setCurrentStyle.bind(ee),ee}return $(n,P),n.prototype.getUi=function(){var d=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",this.styles.forEach(function(N){var R=document.createElement("div");R.style.display="flex",R.style.alignItems="center",R.style.justifyContent="space-between",R.style.padding="5px",R.style.borderWidth="2px",R.style.borderStyle="solid",R.style.overflow="hidden",R.style.maxWidth=100/d.styles.length-5+"%",R.style.borderColor=N===d.currentStyle?d.uiStyleSettings.toolboxAccentColor:"transparent",R.addEventListener("click",function(){d.setCurrentStyle(N,R)}),D.appendChild(R);var ee=document.createElement("div");ee.style.minHeight="20px",ee.style.flexGrow="2",ee.style.overflow="hidden";var Re=``;ee.innerHTML=Re,R.appendChild(ee),d.styleBoxes.push(R)}),D},n.prototype.setCurrentStyle=function(d,D){var N=this;this.currentStyle=d,this.styleBoxes.forEach(function(R){R.style.borderColor=R===D?N.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},n}(xe),Se=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.strokeColor=N.defaultColor,R.strokeWidth=N.defaultStrokeWidth,R.strokeDasharray=N.defaultStrokeDasharray,R.strokePanel=new _e("Line color",N.defaultColorSet,N.defaultColor),R.strokePanel.onColorChanged=R.setStrokeColor,R.strokeWidthPanel=new Te("Line width",N.defaultStrokeWidths,N.defaultStrokeWidth),R.strokeWidthPanel.onWidthChanged=R.setStrokeWidth,R.strokeStylePanel=new Ce("Line style",N.defaultStrokeDasharrays,N.defaultStrokeDasharray),R.strokeStylePanel.onStyleChanged=R.setStrokeDasharray,R}return $(n,P),Object.defineProperty(n.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),n.prototype.getState=function(){var d=P.prototype.getState.call(this);return d.typeName=n.typeName,d},n.typeName="FrameMarker",n.title="Frame marker",n.icon='',n}(be),ye=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},Ie=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.x1=0,R.y1=0,R.x2=0,R.y2=0,R.defaultLength=50,R.manipulationStartX=0,R.manipulationStartY=0,R.manipulationStartX1=0,R.manipulationStartY1=0,R.manipulationStartX2=0,R.manipulationStartY2=0,R.setupControlBox(),R}return $(n,P),n.prototype.ownsTarget=function(d){return!!P.prototype.ownsTarget.call(this,d)||!(!this.grip1.ownsTarget(d)&&!this.grip2.ownsTarget(d))},n.prototype.pointerDown=function(d,D){P.prototype.pointerDown.call(this,d,D),this.manipulationStartX=d.x,this.manipulationStartY=d.y,this.state==="new"&&(this.x1=d.x,this.y1=d.y,this.x2=d.x,this.y2=d.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(D)?this.activeGrip=this.grip1:this.grip2.ownsTarget(D)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},n.prototype.pointerUp=function(d){var D=this.state;P.prototype.pointerUp.call(this,d),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(d),this._state="select",D==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},n.prototype.adjustVisual=function(){},n.prototype.manipulate=function(d){this.state==="creating"?this.resize(d):this.state==="move"?(this.x1=this.manipulationStartX1+d.x-this.manipulationStartX,this.y1=this.manipulationStartY1+d.y-this.manipulationStartY,this.x2=this.manipulationStartX2+d.x-this.manipulationStartX,this.y2=this.manipulationStartY2+d.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(d)},n.prototype.resize=function(d){switch(this.activeGrip){case this.grip1:this.x1=d.x,this.y1=d.y;break;case this.grip2:case void 0:this.x2=d.x,this.y2=d.y}this.adjustVisual(),this.adjustControlBox()},n.prototype.select=function(){P.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},n.prototype.deselect=function(){P.prototype.deselect.call(this),this.controlBox.style.display="none"},n.prototype.setupControlBox=function(){this.controlBox=H.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},n.prototype.adjustControlBox=function(){this.positionGrips()},n.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},n.prototype.createGrip=function(){var d=new Fe;return d.visual.transform.baseVal.appendItem(H.createTransform()),this.controlBox.appendChild(d.visual),d},n.prototype.positionGrips=function(){var d=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-d/2,this.y1-d/2),this.positionGrip(this.grip2.visual,this.x2-d/2,this.y2-d/2)},n.prototype.positionGrip=function(d,D,N){var R=d.transform.baseVal.getItem(0);R.setTranslate(D,N),d.transform.baseVal.replaceItem(R,0)},n.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},P.prototype.getState.call(this))},n.prototype.restoreState=function(d){P.prototype.restoreState.call(this,d);var D=d;this.x1=D.x1,this.y1=D.y1,this.x2=D.x2,this.y2=D.y2},n.prototype.scale=function(d,D){P.prototype.scale.call(this,d,D),this.x1=this.x1*d,this.y1=this.y1*D,this.x2=this.x2*d,this.y2=this.y2*D,this.adjustVisual(),this.adjustControlBox()},n}(Pe),Be=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.strokeColor="transparent",R.strokeWidth=0,R.strokeDasharray="",R.setStrokeColor=R.setStrokeColor.bind(R),R.setStrokeWidth=R.setStrokeWidth.bind(R),R.setStrokeDasharray=R.setStrokeDasharray.bind(R),R.strokeColor=N.defaultColor,R.strokeWidth=N.defaultStrokeWidth,R.strokeDasharray=N.defaultStrokeDasharray,R.strokePanel=new _e("Line color",N.defaultColorSet,N.defaultColor),R.strokePanel.onColorChanged=R.setStrokeColor,R.strokeWidthPanel=new Te("Line width",N.defaultStrokeWidths,N.defaultStrokeWidth),R.strokeWidthPanel.onWidthChanged=R.setStrokeWidth,R.strokeStylePanel=new Ce("Line style",N.defaultStrokeDasharrays,N.defaultStrokeDasharray),R.strokeStylePanel.onStyleChanged=R.setStrokeDasharray,R}return $(n,P),n.prototype.ownsTarget=function(d){return!(!P.prototype.ownsTarget.call(this,d)&&d!==this.visual&&d!==this.selectorLine&&d!==this.visibleLine)},n.prototype.createVisual=function(){this.visual=H.createGroup(),this.selectorLine=H.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=H.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)},n.prototype.pointerDown=function(d,D){P.prototype.pointerDown.call(this,d,D),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},n.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()),H.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),H.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),H.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},n.prototype.setStrokeColor=function(d){this.strokeColor=d,this.adjustVisual(),this.colorChanged(d)},n.prototype.setStrokeWidth=function(d){this.strokeWidth=d,this.adjustVisual()},n.prototype.setStrokeDasharray=function(d){this.strokeDasharray=d,this.adjustVisual(),this.stateChanged()},Object.defineProperty(n.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),n.prototype.getState=function(){var d=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},P.prototype.getState.call(this));return d.typeName=n.typeName,d},n.prototype.restoreState=function(d){P.prototype.restoreState.call(this,d);var D=d;this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.createVisual(),this.adjustVisual()},n.typeName="LineMarker",n.title="Line marker",n.icon='',n}(Ie),ve=function(P){function n(d,D,N,R){var ee=P.call(this,d,R||'')||this;return ee.fonts=[],ee.fontBoxes=[],ee.fonts=D,ee.currentFont=N,ee.setCurrentFont=ee.setCurrentFont.bind(ee),ee}return $(n,P),n.prototype.getUi=function(){var d=this,D=document.createElement("div");return D.style.overflow="hidden",D.style.flexGrow="2",this.fonts.forEach(function(N){var R=document.createElement("div");R.style.display="inline-block",R.style.alignItems="center",R.style.justifyContent="space-between",R.style.padding="5px",R.style.borderWidth="2px",R.style.borderStyle="solid",R.style.overflow="hidden",R.style.maxWidth=100/d.fonts.length-5+"%",R.style.borderColor=N===d.currentFont?d.uiStyleSettings.toolboxAccentColor:"transparent",R.addEventListener("click",function(){d.setCurrentFont(N,R)}),D.appendChild(R);var ee=document.createElement("div");ee.style.display="flex",ee.style.minHeight="20px",ee.style.flexGrow="2",ee.style.fontFamily=N,ee.style.overflow="hidden";var Re=document.createElement("div");Re.style.whiteSpace="nowrap",Re.style.overflow="hidden",Re.style.textOverflow="ellipsis",Re.innerHTML="The quick brown fox jumps over the lazy dog",ee.appendChild(Re),R.appendChild(ee),d.fontBoxes.push(R)}),D},n.prototype.setCurrentFont=function(d,D){var N=this;this.currentFont=d,this.fontBoxes.forEach(function(R){R.style.borderColor=R===D?N.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},n}(xe),Me=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.color="transparent",R.padding=5,R.DEFAULT_TEXT="your text here",R.text=R.DEFAULT_TEXT,R.isMoved=!1,R.color=N.defaultColor,R.fontFamily=N.defaultFontFamily,R.defaultSize={x:100,y:30},R.setColor=R.setColor.bind(R),R.setFont=R.setFont.bind(R),R.renderText=R.renderText.bind(R),R.sizeText=R.sizeText.bind(R),R.textEditDivClicked=R.textEditDivClicked.bind(R),R.showTextEditor=R.showTextEditor.bind(R),R.setSize=R.setSize.bind(R),R.positionTextEditor=R.positionTextEditor.bind(R),R.colorPanel=new _e("Color",N.defaultColorSet,N.defaultColor),R.colorPanel.onColorChanged=R.setColor,R.fontFamilyPanel=new ve("Font",N.defaultFontFamilies,N.defaultFontFamily),R.fontFamilyPanel.onFontChanged=R.setFont,R}return $(n,P),n.prototype.ownsTarget=function(d){if(P.prototype.ownsTarget.call(this,d)||d===this.visual||d===this.textElement||d===this.bgRectangle)return!0;var D=!1;return this.textElement.childNodes.forEach(function(N){N===d&&(D=!0)}),D},n.prototype.createVisual=function(){this.visual=H.createGroup(),this.bgRectangle=H.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=H.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(H.createTransform()),this.textElement.transform.baseVal.appendItem(H.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},n.prototype.pointerDown=function(d,D){P.prototype.pointerDown.call(this,d,D),this.isMoved=!1,this.pointerDownPoint=d,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(d),this._state="creating")},n.prototype.renderText=function(){var d=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(D){d.textElement.appendChild(H.createTSpan(D.trim()===""?" ":D.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},n.prototype.getTextScale=function(){var d=this.textElement.getBBox(),D=1;if(d.width>0&&d.height>0){var N=(1*this.width-this.width*this.padding*2/100)/d.width,R=(1*this.height-this.height*this.padding*2/100)/d.height;D=Math.min(N,R)}return D},n.prototype.getTextPosition=function(d){var D=this.textElement.getBBox(),N=0,R=0;return D.width>0&&D.height>0&&(N=(this.width-D.width*d)/2,R=this.height/2-D.height*d/2),{x:N,y:R}},n.prototype.sizeText=function(){var d=this.textElement.getBBox(),D=this.getTextScale(),N=this.getTextPosition(D);N.y-=d.y*D,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+N.x+"px, "+N.y+"px) scale("+D+", "+D+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(N.x,N.y),this.textElement.transform.baseVal.getItem(1).setScale(D,D))},n.prototype.manipulate=function(d){P.prototype.manipulate.call(this,d),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(d.x-this.pointerDownPoint.x)>5||Math.abs(d.y-this.pointerDownPoint.y)>5)},n.prototype.resize=function(d){P.prototype.resize.call(this,d),this.isMoved=!0,this.setSize(),this.sizeText()},n.prototype.setSize=function(){P.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(H.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),H.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},n.prototype.pointerUp=function(d){var D=this.state;D==="creating"&&(this._suppressMarkerCreateEvent=!0),P.prototype.pointerUp.call(this,d),this.setSize(),(D==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},n.prototype.showTextEditor=function(){var d=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(D){D.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var D=Number.parseFloat(d.textEditor.style.fontSize);d.textEditor.clientWidth>=Number.parseInt(d.textEditor.style.maxWidth)&&D>.9;)D-=.1,d.textEditor.style.fontSize=Math.max(D,.9)+"em"}),this.textEditor.addEventListener("keyup",function(D){D.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(D){if(D.clipboardData){var N=D.clipboardData.getData("text"),R=window.getSelection();if(!R.rangeCount)return!1;R.deleteFromDocument(),R.getRangeAt(0).insertNode(document.createTextNode(N)),D.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){d.textEditDivClicked(d.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},n.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var d=this.getTextScale(),D=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),N=this.textElement.getBBox(),R={x:N.width*d,y:N.height*d};D.x-=R.x/2,D.y-=R.y/2,this.textEditor.style.top=D.y+"px",this.textEditor.style.left=D.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-D.x+"px",this.textEditor.style.fontSize=Math.max(16*d,12)+"px",this.textElement.style.display="none"}},n.prototype.textEditDivClicked=function(d){this.text=d.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},n.prototype.select=function(){P.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},n.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),P.prototype.deselect.call(this)},n.prototype.dblClick=function(d,D){P.prototype.dblClick.call(this,d,D),this.showTextEditor()},n.prototype.setColor=function(d){this.textElement&&H.setAttributes(this.textElement,[["fill",d]]),this.color=d,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(d)},n.prototype.setFont=function(d){this.textElement&&H.setAttributes(this.textElement,[["font-family",d]]),this.fontFamily=d,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},n.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},n.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(n.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),n.prototype.getState=function(){var d=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},P.prototype.getState.call(this));return d.typeName=n.typeName,d},n.prototype.restoreState=function(d){var D=d;this.color=D.color,this.fontFamily=D.fontFamily,this.padding=D.padding,this.text=D.text,this.createVisual(),P.prototype.restoreState.call(this,d),this.setSize()},n.prototype.scale=function(d,D){P.prototype.scale.call(this,d,D),this.setSize(),this.sizeText(),this.positionTextEditor()},n.typeName="TextMarker",n.title="Text marker",n.icon='',n}(ue),re=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.color="transparent",R.lineWidth=3,R.drawing=!1,R.pixelRatio=1,R.color=N.defaultColor,R.lineWidth=N.defaultStrokeWidth,R.pixelRatio=N.freehandPixelRatio,R.setColor=R.setColor.bind(R),R.addCanvas=R.addCanvas.bind(R),R.finishCreation=R.finishCreation.bind(R),R.setLineWidth=R.setLineWidth.bind(R),R.colorPanel=new _e("Color",N.defaultColorSet,N.defaultColor),R.colorPanel.onColorChanged=R.setColor,R.lineWidthPanel=new Te("Line width",N.defaultStrokeWidths,N.defaultStrokeWidth),R.lineWidthPanel.onWidthChanged=R.setLineWidth,R}return $(n,P),n.prototype.ownsTarget=function(d){return!(!P.prototype.ownsTarget.call(this,d)&&d!==this.visual&&d!==this.drawingImage)},n.prototype.createVisual=function(){this.visual=H.createGroup(),this.drawingImage=H.createImage(),this.visual.appendChild(this.drawingImage);var d=H.createTransform();this.visual.transform.baseVal.appendItem(d),this.addMarkerVisualToContainer(this.visual)},n.prototype.pointerDown=function(d,D){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(d.x,d.y),this.drawing=!0):P.prototype.pointerDown.call(this,d,D)},n.prototype.manipulate=function(d){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(d.x,d.y),this.canvasContext.stroke()):P.prototype.manipulate.call(this,d)},n.prototype.resize=function(d){P.prototype.resize.call(this,d),H.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),H.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},n.prototype.pointerUp=function(d){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):P.prototype.pointerUp.call(this,d)},n.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)},n.prototype.select=function(){this.state==="creating"&&this.finishCreation(),P.prototype.select.call(this)},n.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),P.prototype.deselect.call(this)},n.prototype.finishCreation=function(){for(var d=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),D=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],N=D[0],R=D[1],ee=D[2],Re=D[3],Ue=!1,je=0;je0&&(Ue=!0,jeRe&&(Re=je),Le>ee&&(ee=Le));if(Ue){this.left=N/this.pixelRatio,this.top=R/this.pixelRatio,this.width=(ee-N)/this.pixelRatio,this.height=(Re-R)/this.pixelRatio;var Ge=document.createElement("canvas");Ge.width=ee-N,Ge.height=Re-R,Ge.getContext("2d").putImageData(this.canvasContext.getImageData(N,R,ee-N,Re-R),0,0),this.drawingImgUrl=Ge.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},n.prototype.setDrawingImage=function(){H.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),H.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},n.prototype.setColor=function(d){this.color=d,this.colorChanged(d)},n.prototype.setLineWidth=function(d){this.lineWidth=d},Object.defineProperty(n.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),n.prototype.getState=function(){var d=Object.assign({drawingImgUrl:this.drawingImgUrl},P.prototype.getState.call(this));return d.typeName=n.typeName,d},n.prototype.restoreState=function(d){this.createVisual(),P.prototype.restoreState.call(this,d),this.drawingImgUrl=d.drawingImgUrl,this.setDrawingImage()},n.prototype.scale=function(d,D){P.prototype.scale.call(this,d,D),this.setDrawingImage()},n.typeName="FreehandMarker",n.title="Freehand marker",n.icon='',n}(ue),q=function(P){function n(d,D,N){var R=P.call(this,d,N||'')||this;return R.typeBoxes=[],R.currentType=D,R.setCurrentType=R.setCurrentType.bind(R),R}return $(n,P),n.prototype.getUi=function(){var d=this,D=document.createElement("div");D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2";for(var N=function(Re){var Ue="both";switch(Re){case 0:Ue="both";break;case 1:Ue="start";break;case 2:Ue="end";break;case 3:Ue="none"}var je=document.createElement("div");if(je.style.display="flex",je.style.flexGrow="2",je.style.alignItems="center",je.style.justifyContent="space-between",je.style.padding="5px",je.style.borderWidth="2px",je.style.borderStyle="solid",je.style.borderColor=Ue===R.currentType?R.uiStyleSettings.toolboxAccentColor:"transparent",je.addEventListener("click",function(){d.setCurrentType(Ue,je)}),D.appendChild(je),Ue==="both"||Ue==="start"){var Le=document.createElement("div");Le.style.display="flex",Le.style.alignItems="center",Le.style.minHeight="20px",Le.innerHTML=``,Le.style.marginLeft="5px",je.appendChild(Le)}var Ge=document.createElement("div");Ge.style.display="flex",Ge.style.alignItems="center",Ge.style.minHeight="20px",Ge.style.flexGrow="2";var Ke=document.createElement("hr");if(Ke.style.minWidth="20px",Ke.style.border="0px",Ke.style.borderTop="3px solid "+(R.uiStyleSettings!==void 0?R.uiStyleSettings.toolboxColor:"#eeeeee"),Ke.style.flexGrow="2",Ge.appendChild(Ke),je.appendChild(Ge),Ue==="both"||Ue==="end"){var Je=document.createElement("div");Je.style.display="flex",Je.style.alignItems="center",Je.style.minHeight="20px",Je.innerHTML=``,Je.style.marginRight="5px",je.appendChild(Je)}R.typeBoxes.push(je)},R=this,ee=0;ee<4;ee++)N(ee);return D},n.prototype.setCurrentType=function(d,D){var N=this;this.currentType=d,this.typeBoxes.forEach(function(R){R.style.borderColor=R===D?N.uiStyleSettings!==void 0?N.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},n}(xe),te=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.arrowType="end",R.arrowBaseHeight=10,R.arrowBaseWidth=10,R.getArrowPoints=R.getArrowPoints.bind(R),R.setArrowType=R.setArrowType.bind(R),R.arrowTypePanel=new q("Arrow type","end"),R.arrowTypePanel.onArrowTypeChanged=R.setArrowType,R}return $(n,P),n.prototype.ownsTarget=function(d){return!(!P.prototype.ownsTarget.call(this,d)&&d!==this.arrow1&&d!==this.arrow2)},n.prototype.getArrowPoints=function(d,D){var N=this.arrowBaseWidth+2*this.strokeWidth,R=this.arrowBaseHeight+2*this.strokeWidth;return d-N/2+","+(D+R/2)+" "+d+","+(D-R/2)+" "+(d+N/2)+","+(D+R/2)},n.prototype.createTips=function(){this.arrow1=H.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(H.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=H.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(H.createTransform()),this.visual.appendChild(this.arrow2)},n.prototype.pointerDown=function(d,D){P.prototype.pointerDown.call(this,d,D),this.state==="creating"&&this.createTips()},n.prototype.adjustVisual=function(){if(P.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",H.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),H.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var d=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),D=this.arrow1.transform.baseVal.getItem(0);D.setRotate(d,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(D,0);var N=this.arrow2.transform.baseVal.getItem(0);N.setRotate(d+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(N,0)}},n.prototype.setArrowType=function(d){this.arrowType=d,this.adjustVisual(),this.stateChanged()},Object.defineProperty(n.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),n.prototype.getState=function(){var d=Object.assign({arrowType:this.arrowType},P.prototype.getState.call(this));return d.typeName=n.typeName,d},n.prototype.restoreState=function(d){P.prototype.restoreState.call(this,d);var D=d;this.arrowType=D.arrowType,this.createTips(),this.adjustVisual()},n.typeName="ArrowMarker",n.title="Arrow marker",n.icon='',n}(Be),j=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.fillColor=N.defaultFillColor,R.strokeWidth=0,R.fillPanel=new _e("Color",N.defaultColorSet,N.defaultFillColor),R.fillPanel.onColorChanged=R.setFillColor,R}return $(n,P),Object.defineProperty(n.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),n.prototype.getState=function(){var d=P.prototype.getState.call(this);return d.typeName=n.typeName,d},n.typeName="CoverMarker",n.title="Cover marker",n.icon='',n}(be),W=function(P){function n(d,D,N,R){var ee=P.call(this,d,R||'')||this;return ee.opacities=[],ee.opacityBoxes=[],ee.opacities=D,ee.currentOpacity=N,ee.setCurrentOpacity=ee.setCurrentOpacity.bind(ee),ee}return $(n,P),n.prototype.getUi=function(){var d=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",D.style.justifyContent="space-between",this.opacities.forEach(function(N){var R=document.createElement("div");R.style.display="flex",R.style.alignItems="center",R.style.justifyContent="center",R.style.padding="5px",R.style.borderWidth="2px",R.style.borderStyle="solid",R.style.borderColor=N===d.currentOpacity?d.uiStyleSettings.toolboxAccentColor:"transparent",R.addEventListener("click",function(){d.setCurrentOpacity(N,R)}),D.appendChild(R);var ee=document.createElement("div");ee.innerText=100*N+"%",R.appendChild(ee),d.opacityBoxes.push(R)}),D},n.prototype.setCurrentOpacity=function(d,D){var N=this;this.currentOpacity=d,this.opacityBoxes.forEach(function(R){R.style.borderColor=R===D?N.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},n}(xe),G=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.setOpacity=R.setOpacity.bind(R),R.fillColor=N.defaultHighlightColor,R.strokeWidth=0,R.opacity=N.defaultHighlightOpacity,R.fillPanel=new _e("Color",N.defaultColorSet,R.fillColor),R.fillPanel.onColorChanged=R.setFillColor,R.opacityPanel=new W("Opacity",N.defaultOpacitySteps,R.opacity),R.opacityPanel.onOpacityChanged=R.setOpacity,R}return $(n,P),n.prototype.setOpacity=function(d){this.opacity=d,this.visual&&H.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(n.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),n.prototype.getState=function(){var d=P.prototype.getState.call(this);return d.typeName=n.typeName,d},n.typeName="HighlightMarker",n.title="Highlight marker",n.icon='',n}(j),X='',oe=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.bgColor="transparent",R.tipPosition={x:0,y:0},R.tipBase1Position={x:0,y:0},R.tipBase2Position={x:0,y:0},R.tipMoving=!1,R.color=N.defaultStrokeColor,R.bgColor=N.defaultFillColor,R.fontFamily=N.defaultFontFamily,R.defaultSize={x:100,y:30},R.setBgColor=R.setBgColor.bind(R),R.getTipPoints=R.getTipPoints.bind(R),R.positionTip=R.positionTip.bind(R),R.setTipPoints=R.setTipPoints.bind(R),R.colorPanel=new _e("Text color",N.defaultColorSet,R.color,''),R.colorPanel.onColorChanged=R.setColor,R.bgColorPanel=new _e("Fill color",N.defaultColorSet,R.bgColor,X),R.bgColorPanel.onColorChanged=R.setBgColor,R.fontFamilyPanel=new ve("Font",N.defaultFontFamilies,N.defaultFontFamily),R.fontFamilyPanel.onFontChanged=R.setFont,R.tipGrip=new Fe,R.tipGrip.visual.transform.baseVal.appendItem(H.createTransform()),R.controlBox.appendChild(R.tipGrip.visual),R}return $(n,P),n.prototype.ownsTarget=function(d){return P.prototype.ownsTarget.call(this,d)||this.tipGrip.ownsTarget(d)||this.tip===d},n.prototype.createTip=function(){H.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=H.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},n.prototype.pointerDown=function(d,D){this.state==="new"&&P.prototype.pointerDown.call(this,d,D),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(D)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):P.prototype.pointerDown.call(this,d,D)},n.prototype.pointerUp=function(d){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,P.prototype.pointerUp.call(this,d);else{var D=this.state==="creating";P.prototype.pointerUp.call(this,d),this.setTipPoints(D),this.positionTip()}},n.prototype.manipulate=function(d){if(this.tipMoving){var D=this.unrotatePoint(d);this.tipPosition={x:D.x-this.manipulationStartLeft,y:D.y-this.manipulationStartTop},this.positionTip()}else P.prototype.manipulate.call(this,d)},n.prototype.setBgColor=function(d){this.bgRectangle&&this.tip&&(H.setAttributes(this.bgRectangle,[["fill",d]]),H.setAttributes(this.tip,[["fill",d]])),this.bgColor=d,this.fillColorChanged(d)},n.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},n.prototype.setTipPoints=function(d){d===void 0&&(d=!1);var D=Math.min(this.height/2,15),N=this.height/5;d&&(this.tipPosition={x:D+N/2,y:this.height+20});var R=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?R',n}(Me),ce=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.fillColor="transparent",R.strokeColor="transparent",R.strokeWidth=0,R.strokeDasharray="",R.opacity=1,R.strokeColor=N.defaultColor,R.strokeWidth=N.defaultStrokeWidth,R.strokeDasharray=N.defaultStrokeDasharray,R.fillColor=N.defaultFillColor,R.setStrokeColor=R.setStrokeColor.bind(R),R.setFillColor=R.setFillColor.bind(R),R.setStrokeWidth=R.setStrokeWidth.bind(R),R.setStrokeDasharray=R.setStrokeDasharray.bind(R),R.setOpacity=R.setOpacity.bind(R),R.createVisual=R.createVisual.bind(R),R.strokePanel=new _e("Line color",z(N.defaultColorSet,["transparent"]),N.defaultColor),R.strokePanel.onColorChanged=R.setStrokeColor,R.fillPanel=new _e("Fill color",z(N.defaultColorSet,["transparent"]),R.fillColor,X),R.fillPanel.onColorChanged=R.setFillColor,R.strokeWidthPanel=new Te("Line width",N.defaultStrokeWidths,N.defaultStrokeWidth),R.strokeWidthPanel.onWidthChanged=R.setStrokeWidth,R.strokeStylePanel=new Ce("Line style",N.defaultStrokeDasharrays,N.defaultStrokeDasharray),R.strokeStylePanel.onStyleChanged=R.setStrokeDasharray,R.opacityPanel=new W("Opacity",N.defaultOpacitySteps,R.opacity),R.opacityPanel.onOpacityChanged=R.setOpacity,R}return $(n,P),n.prototype.ownsTarget=function(d){return!(!P.prototype.ownsTarget.call(this,d)&&d!==this.visual)},n.prototype.createVisual=function(){this.visual=H.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)},n.prototype.pointerDown=function(d,D){P.prototype.pointerDown.call(this,d,D),this.state==="new"&&(this.createVisual(),this.moveVisual(d),this._state="creating")},n.prototype.manipulate=function(d){P.prototype.manipulate.call(this,d)},n.prototype.resize=function(d){P.prototype.resize.call(this,d),this.setSize()},n.prototype.setSize=function(){P.prototype.setSize.call(this),H.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},n.prototype.pointerUp=function(d){P.prototype.pointerUp.call(this,d),this.setSize()},n.prototype.setStrokeColor=function(d){this.strokeColor=d,this.visual&&H.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(d),this.stateChanged()},n.prototype.setFillColor=function(d){this.fillColor=d,this.visual&&H.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(d),this.stateChanged()},n.prototype.setStrokeWidth=function(d){this.strokeWidth=d,this.visual&&H.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},n.prototype.setStrokeDasharray=function(d){this.strokeDasharray=d,this.visual&&H.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},n.prototype.setOpacity=function(d){this.opacity=d,this.visual&&H.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(n.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),n.prototype.getState=function(){var d=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},P.prototype.getState.call(this));return d.typeName=n.typeName,d},n.prototype.restoreState=function(d){var D=d;this.fillColor=D.fillColor,this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.opacity=D.opacity,this.createVisual(),P.prototype.restoreState.call(this,d),this.setSize()},n.prototype.scale=function(d,D){P.prototype.scale.call(this,d,D),this.setSize()},n.typeName="EllipseMarker",n.title="Ellipse marker",n.icon='',n}(ue),ke=function(P){function n(d,D,N){return P.call(this,d,D,N)||this}return $(n,P),Object.defineProperty(n.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),n.prototype.ownsTarget=function(d){return!(!P.prototype.ownsTarget.call(this,d)&&d!==this.tip1&&d!==this.tip2)},n.prototype.createTips=function(){this.tip1=H.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(H.createTransform()),this.visual.appendChild(this.tip1),this.tip2=H.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(H.createTransform()),this.visual.appendChild(this.tip2)},n.prototype.pointerDown=function(d,D){P.prototype.pointerDown.call(this,d,D),this.state==="creating"&&this.createTips()},n.prototype.adjustVisual=function(){if(P.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(H.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()]]),H.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 d=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),D=this.tip1.transform.baseVal.getItem(0);D.setRotate(d,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(D,0);var N=this.tip2.transform.baseVal.getItem(0);N.setRotate(d+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(N,0)}},Object.defineProperty(n.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),n.prototype.getState=function(){var d=P.prototype.getState.call(this);return d.typeName=n.typeName,d},n.prototype.restoreState=function(d){P.prototype.restoreState.call(this,d),this.createTips(),this.adjustVisual()},n.typeName="MeasurementMarker",n.title="Measurement marker",n.icon='',n}(Be),He=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.strokePanel.colors=N.defaultColorSet,R.fillColor="transparent",R}return $(n,P),Object.defineProperty(n.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),n.prototype.getState=function(){var d=P.prototype.getState.call(this);return d.typeName=n.typeName,d},n.typeName="EllipseFrameMarker",n.title="Ellipse frame marker",n.icon='',n}(ce),$e=function(){function P(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(P.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),P.prototype.addUndoStep=function(n){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(n)||(this.undoStack.push(n),JSON.stringify(this.lastRedoStep)!==JSON.stringify(n)&&this.redoStack.splice(0,this.redoStack.length))},P.prototype.replaceLastUndoStep=function(n){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=n)},P.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},P.prototype.undo=function(){if(this.undoStack.length>1){var n=this.undoStack.pop();return n!==void 0&&this.redoStack.push(n),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},P.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},P}(),ze=function(P){function n(d,D,N){var R=P.call(this,d,D,N)||this;return R.strokeColor="transparent",R.strokeWidth=0,R.strokeDasharray="",R.curveX=0,R.curveY=0,R.manipulationStartCurveX=0,R.manipulationStartCurveY=0,R.setStrokeColor=R.setStrokeColor.bind(R),R.setStrokeWidth=R.setStrokeWidth.bind(R),R.setStrokeDasharray=R.setStrokeDasharray.bind(R),R.positionGrips=R.positionGrips.bind(R),R.addControlGrips=R.addControlGrips.bind(R),R.adjustVisual=R.adjustVisual.bind(R),R.setupControlBox=R.setupControlBox.bind(R),R.resize=R.resize.bind(R),R.strokeColor=N.defaultColor,R.strokeWidth=N.defaultStrokeWidth,R.strokeDasharray=N.defaultStrokeDasharray,R.strokePanel=new _e("Line color",N.defaultColorSet,N.defaultColor),R.strokePanel.onColorChanged=R.setStrokeColor,R.strokeWidthPanel=new Te("Line width",N.defaultStrokeWidths,N.defaultStrokeWidth),R.strokeWidthPanel.onWidthChanged=R.setStrokeWidth,R.strokeStylePanel=new Ce("Line style",N.defaultStrokeDasharrays,N.defaultStrokeDasharray),R.strokeStylePanel.onStyleChanged=R.setStrokeDasharray,R}return $(n,P),n.prototype.ownsTarget=function(d){return!(!P.prototype.ownsTarget.call(this,d)&&d!==this.visual&&d!==this.selectorCurve&&d!==this.visibleCurve&&!this.curveGrip.ownsTarget(d))},n.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},n.prototype.createVisual=function(){this.visual=H.createGroup(),this.selectorCurve=H.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=H.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)},n.prototype.pointerDown=function(d,D){P.prototype.pointerDown.call(this,d,D),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=d.x,this.curveY=d.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(D)&&(this.activeGrip=this.curveGrip,this._state="resize")},n.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),H.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),H.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),H.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},n.prototype.setupControlBox=function(){P.prototype.setupControlBox.call(this),this.curveControlLine1=H.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=H.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)},n.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,P.prototype.addControlGrips.call(this)},n.prototype.positionGrips=function(){P.prototype.positionGrips.call(this);var d=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-d/2,this.curveY-d/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()))},n.prototype.manipulate=function(d){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+d.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+d.y-this.manipulationStartY),P.prototype.manipulate.call(this,d)},n.prototype.resize=function(d){this.activeGrip===this.curveGrip&&(this.curveX=d.x,this.curveY=d.y),P.prototype.resize.call(this,d),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},n.prototype.setStrokeColor=function(d){this.strokeColor=d,this.adjustVisual(),this.colorChanged(d)},n.prototype.setStrokeWidth=function(d){this.strokeWidth=d,this.adjustVisual()},n.prototype.setStrokeDasharray=function(d){this.strokeDasharray=d,this.adjustVisual()},n.prototype.scale=function(d,D){this.curveX=this.curveX*d,this.curveY=this.curveY*D,P.prototype.scale.call(this,d,D)},Object.defineProperty(n.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),n.prototype.getState=function(){var d=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},P.prototype.getState.call(this));return d.typeName=n.typeName,d},n.prototype.restoreState=function(d){P.prototype.restoreState.call(this,d);var D=d;this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.curveX=D.curveX,this.curveY=D.curveY,this.createVisual(),this.adjustVisual()},n.typeName="CurveMarker",n.title="Curve marker",n.icon='',n}(Ie),Ze=function(){function P(n,d){d===void 0&&(d=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=n,this.cancelable=d}return Object.defineProperty(P.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),P.prototype.preventDefault=function(){this._defaultPrevented=!0},P}(),et=function(P){function n(d,D,N){var R=P.call(this,d,!1)||this;return R.dataUrl=D,R.state=N,R}return $(n,P),n}(Ze),Xe=function(P){function n(d,D,N){N===void 0&&(N=!1);var R=P.call(this,d,N)||this;return R.marker=D,R}return $(n,P),n}(Ze),mt=function(){function P(){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 P.prototype.addEventListener=function(n,d){this[n].push(d)},P.prototype.removeEventListener=function(n,d){var D=this[n].indexOf(d);D>-1&&this[n].splice(D,1)},P}(),rt=function(){function P(n){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ye,this._isOpen=!1,this.undoRedoManager=new $e,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 mt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=P.instanceCounter++,this.styles=new we(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=n,this.targetRoot=document.body,this.width=n.clientWidth,this.height=n.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(P.prototype,"ALL_MARKER_TYPES",{get:function(){return[Se,re,te,Me,He,ce,G,oe,ke,j,Be,ze]},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Se,re,te,Me,ce,G,oe]},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Se,re,te,Me,G]},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(n){var d=this;this._availableMarkerTypes.splice(0),n.forEach(function(D){if(typeof D=="string"){var N=d.ALL_MARKER_TYPES.find(function(R){return R.typeName===D});N!==void 0&&d._availableMarkerTypes.push(N)}else d._availableMarkerTypes.push(D)})},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(n){this._zoomLevel=n,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(P.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),P.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),me.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},P.prototype.show=function(){var n=this;this.styles.styleSheetRoot===void 0&&Oe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Oe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(d){return d(new Ze(n))})},P.prototype.render=function(){return Y(this,void 0,void 0,function(){var n;return ne(this,function(d){switch(d.label){case 0:return this.setCurrentMarker(),(n=new De).naturalSize=this.renderAtNaturalSize,n.imageType=this.renderImageType,n.imageQuality=this.renderImageQuality,n.markersOnly=this.renderMarkersOnly,n.width=this.renderWidth,n.height=this.renderHeight,[4,n.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return d.sent(),[4,n.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,d.sent()]}})})},P.prototype.close=function(n){var d=this;if(n===void 0&&(n=!1),this.isOpen){var D=!1;n||this.eventListeners.beforeclose.forEach(function(N){var R=new Ze(d,!0);N(R),R.defaultPrevented&&(D=!0)}),D||(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(N){return N(new Ze(d))}),this.detachEvents(),this._isOpen=!1)}},P.prototype.addMarkersToToolbar=function(){for(var n,d=[],D=0;Dthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*n:this.editorCanvas.clientWidth,D=d',n.title="Powered by marker.js",n.style.display="grid",n.style.alignItems="center",n.style.justifyItems="center",n.style.padding="3px",n.style.width="20px",n.style.height="20px",this.logoUI.appendChild(n),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},P.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")},P.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"},P.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},P.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 n=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=n+"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 pe(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(n),1),n.dispose()},P.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())},P.prototype.toolbarButtonClicked=function(n,d){if(n==="marker"&&d!==void 0)this.createNewMarker(d);else if(n==="action")switch(d){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()}},P.prototype.deleteSelectedMarker=function(){var n=this;if(this._currentMarker!==void 0){var d=!1;if(this.eventListeners.markerbeforedelete.forEach(function(N){var R=new Xe(n,n._currentMarker,!0);N(R),R.defaultPrevented&&(d=!0)}),!d){var D=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(N){return N(new Xe(n,D))})}}},P.prototype.clear=function(){var n=this,d=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ee){var Re=new Xe(n,void 0,!0);ee(Re),Re.defaultPrevented&&(d=!0)}),!d)){this.setCurrentMarker();for(var D=function(ee){var Re=N.markers[ee];N.setCurrentMarker(N.markers[ee]),N._currentMarker.dispose(),N.markerImage.removeChild(N._currentMarker.container),N.markers.splice(N.markers.indexOf(N._currentMarker),1),N.eventListeners.markerdelete.forEach(function(Ue){return Ue(new Xe(n,Re))})},N=this,R=this.markers.length-1;R>=0;R--)D(R);this.addUndoStep()}},Object.defineProperty(P.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),P.prototype.showNotesEditor=function(){var n;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=(n=this._currentMarker.notes)!==null&&n!==void 0?n:"",this.overlayContainer.appendChild(this.notesArea))},P.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)},P.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},P.prototype.addUndoStep=function(){var n=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var d=this.getState(),D=this.undoRedoManager.getLastUndoStep();if(!D||D.width===d.width&&D.height===d.height){var N=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(d),N1&&this.panTo({x:n.clientX,y:n.clientY}))},P.prototype.onPointerUp=function(n){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(n.clientX,n.clientY)),this.isDragging=!1,this.addUndoStep()},P.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},P.prototype.onKeyUp=function(n){this._currentMarker===void 0||this.notesArea!==void 0||n.key!=="Delete"&&n.key!=="Backspace"||this.deleteSelectedMarker()},P.prototype.clientToLocalCoordinates=function(n,d){var D=this.markerImage.getBoundingClientRect();return{x:(n-D.left)/this.zoomLevel,y:(d-D.top)/this.zoomLevel}},P.prototype.onWindowResize=function(){this.positionUI()},P.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var n=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=n+"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()},P.prototype.addLicenseKey=function(n){me.addKey(n)},P.prototype.addEventListener=function(n,d){this.eventListeners.addEventListener(n,d)},P.prototype.removeEventListener=function(n,d){this.eventListeners.removeEventListener(n,d)},P.prototype.renderState=function(n){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(n),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(P.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),P.prototype.focus=function(){var n=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(d){return d(new Ze(n))}))},P.prototype.blur=function(){var n=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(d){return d(new Ze(n))}))},P.instanceCounter=0,P}();/* **********************************
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 vt=function(P,n){return(vt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,D){d.__proto__=D}||function(d,D){for(var N in D)Object.prototype.hasOwnProperty.call(D,N)&&(d[N]=D[N])})(P,n)};function ct(P,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function d(){this.constructor=P}vt(P,n),P.prototype=n===null?Object.create(n):(d.prototype=n.prototype,new d)}function qe(P,n,d,D){return new(d||(d=Promise))(function(N,R){function ee(je){try{Ue(D.next(je))}catch(Le){R(Le)}}function Re(je){try{Ue(D.throw(je))}catch(Le){R(Le)}}function Ue(je){var Le;je.done?N(je.value):(Le=je.value,Le instanceof d?Le:new d(function(Ge){Ge(Le)})).then(ee,Re)}Ue((D=D.apply(P,n||[])).next())})}function yt(P,n){var d,D,N,R,ee={label:0,sent:function(){if(1&N[0])throw N[1];return N[1]},trys:[],ops:[]};return R={next:Re(0),throw:Re(1),return:Re(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function Re(Ue){return function(je){return function(Le){if(d)throw new TypeError("Generator is already executing.");for(;ee;)try{if(d=1,D&&(N=2&Le[0]?D.return:Le[0]?D.throw||((N=D.return)&&N.call(D),0):D.next)&&!(N=N.call(D,Le[1])).done)return N;switch(D=0,N&&(Le=[2&Le[0],N.value]),Le[0]){case 0:case 1:N=Le;break;case 4:return ee.label++,{value:Le[1],done:!1};case 5:ee.label++,D=Le[1],Le=[0];continue;case 7:Le=ee.ops.pop(),ee.trys.pop();continue;default:if(!(N=ee.trys,(N=N.length>0&&N[N.length-1])||Le[0]!==6&&Le[0]!==2)){ee=0;continue}if(Le[0]===3&&(!N||Le[1]>N[0]&&Le[1]0&&d>0){var D=new Ye(n,d),N=D.ratio>=1?20:D.getHorizontalLength(20),R=D.ratio<1?20:D.getVerticalLength(20),ee=document.createElementNS("http://www.w3.org/2000/svg","svg");ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),ee.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ee);var Re=Ve.createDefs();ee.appendChild(Re);var Ue=Ve.createElement("clipPath",[["id","text-bg-clip"]]);Re.appendChild(Ue);var je=Ve.createPath(Ve.getHollowRectanglePath((24-N)/2,(24-R)/2,N,R,(24-N)/2+2,(24-R)/2+2,N-4,R-4));ee.appendChild(je);var Le=Ve.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Le.appendChild(Ve.createTSpan(n+":"+d)),ee.appendChild(Le);var Ge=Le.getBBox();Ve.setAttributes(Le,[["x",((24-Ge.width)/2).toString()],["y",((24-Ge.height)/2-Ge.y).toString()]]);var Ke=Ve.createPath(Ve.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ge.width))/2,(24-Math.ceil(Ge.height))/2,Math.ceil(Ge.width),Math.ceil(Ge.height)));return Ue.appendChild(Ke),Ve.setAttributes(je,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ee),ee.outerHTML}return''},P}(),dt=function(P){function n(d,D,N){var R=P.call(this,d,D)||this;return R.isDropdownOpen=!1,R.onClick=R.dropdownButtonClicked,R.dropdownButtons=N,R}return ct(n,P),n.prototype.setupDropdown=function(){var d=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(D){D.className=d.className,D.colorsClassName=d.colorsClassName,d.dropdownBlock.appendChild(D.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},n.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},n.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},n.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},n.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},n.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},n}(it),tt=function(){function P(n,d){this.GRIP_SIZE=10,this.color=n,this.fillColor=d,this.visual=Ve.createGroup(),this.visual.appendChild(Ve.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ve.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return P.prototype.ownsTarget=function(n){return n===this.visual||n===this.visual.childNodes[0]||n===this.visual.childNodes[1]},P.prototype.setCenter=function(n,d){this.visual.childNodes.forEach(function(D){return Ve.setAttributes(D,[["cx",n.toString()],["cy",d.toString()]])})},P}(),st=function(){function P(n,d,D,N){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=n,this.canvasHeight=d,this.margin=D,this.container=N,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(P.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(n){this._aspectRatio=n,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(n){this._isGridVisible=n,this.gridContainer&&Ve.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(n){this._zoomFactor=n,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),P.prototype.open=function(){var n=this;this.cropShadeElement=Ve.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ve.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var d=0;dthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-d.height/2),Ve.setAttributes(this.cropRectElement,[["x",d.x.toString()],["y",d.y.toString()],["width",d.width.toString()],["height",d.height.toString()]]);var D=d.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(R,ee){var Re=d.y+D*(ee+1);Ve.setAttributes(R,[["x1",""+d.x],["y1",""+Re],["x2",""+(d.x+d.width)],["y2",""+Re]])});var N=d.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(R,ee){var Re=d.x+N*(ee+1);Ve.setAttributes(R,[["x1",""+Re],["y1",""+d.y],["x2",""+Re],["y2",""+(d.y+d.height)]])}),Ve.setAttributes(this.cropShadeElement,[["d",Ve.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,d.x,d.y,d.width,d.height)]]),this.topLeftGrip.setCenter(d.x,d.y),this.topRightGrip.setCenter(d.x+d.width,d.y),this.bottomLeftGrip.setCenter(d.x,d.y+d.height),this.bottomRightGrip.setCenter(d.x+d.width,d.y+d.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},P.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)},P.prototype.clientToLocalCoordinates=function(n,d){var D=this.container.getBoundingClientRect();return{x:n-D.left+this.margin,y:d-D.top+this.margin}},P.prototype.onPointerDown=function(n){this.container.setPointerCapture(n.pointerId),this.previousPoint=this.clientToLocalCoordinates(n.clientX,n.clientY),this.cropRectElement===n.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(n.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(n.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(n.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(n.target)&&(this.activeGrip=this.bottomRightGrip)},P.prototype.onPointerMove=function(n){if(this.isMoving)this.move(this.clientToLocalCoordinates(n.clientX,n.clientY));else if(this.activeGrip){var d=this.clientToLocalCoordinates(n.clientX,n.clientY);this.resize(d)}n.preventDefault()},P.prototype.onPointerUp=function(n){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(n.pointerId)},P.prototype.move=function(n){var d=n.x-this.previousPoint.x,D=n.y-this.previousPoint.y;this.zoomFactor!==1&&(d=-d/this.zoomFactor,D=-D/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+d),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+D),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=n},P.prototype.resize=function(n){var d=Object.assign({},this.cropRect),D=n.x-this.previousPoint.x,N=n.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:d.x+Dthis.canvasWidth*this.zoomFactor&&(D=this.canvasWidth*this.zoomFactor-d.width),d.width+=D}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(d.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(D),d.height=this.aspectRatio.getVerticalLength(d.width)):(d.y+=N,d.height=this.cropRect.y+this.cropRect.height-d.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?d.height=this.aspectRatio.getVerticalLength(d.width):d.height+=N}d.width<10&&(d.x=this.cropRect.x,d.width=10),d.height<10&&(d.y=this.cropRect.y,d.height=10),this.previousPoint=n,d.x>=this.margin&&d.y>=this.margin&&d.x-this.margin+d.width<=this.canvasWidth&&d.y-this.margin+d.height<=this.canvasHeight&&(this.cropRect=d,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},P.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var n=this.cropRect.x+this.cropRect.width/2,d=this.cropRect.y+this.cropRect.height/2,D=this.aspectRatio.getHorizontalLength(this.cropRect.height),N=this.aspectRatio.getVerticalLength(this.cropRect.width);D/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=n-this.cropRect.width/2,this.cropRect.y=d-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)}},P.prototype.getRescaledRect=function(n,d,D,N,R,ee){var Re=D/n,Ue=N/d;return{x:(R.x-ee)*Re+ee,y:(R.y-ee)*Ue+ee,width:R.width*Re,height:R.height*Ue}},P.prototype.scaleCanvas=function(n,d){var D=this.getRescaledRect(this.canvasWidth,this.canvasHeight,n,d,this.cropRect,this.margin);this.canvasWidth=n,this.canvasHeight=d,this.onCropChange&&this.onCropChange(D),this.setCropRectangle(D)},P}(),ft=function(){function P(n){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=n,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(P.prototype,"angle",{get:function(){return this._angle},set:function(n){this._angle=n,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),P.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},P.prototype.onPointerDown=function(n){this.controlContainer.setPointerCapture(n.pointerId),this.isDragging=!0,this.previousPoint={x:n.clientX,y:n.clientY}},P.prototype.onPointerMove=function(n){this.isDragging&&(this.onAngleChange&&this.onAngleChange((n.clientX-this.previousPoint.x)/5),this.previousPoint.x=n.clientX)},P.prototype.onPointerUp=function(n){this.isDragging&&this.onAngleChange&&this.onAngleChange((n.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(n.pointerId)},P.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var n=this.angleLabelText.getBBox();Ve.setAttributes(this.angleLabelElement,[["x",((this.width-n.width)/2).toString()],["y",(this.height/2).toString()]])}},P.prototype.positionScaleShape=function(){if(this.scaleShape){var n=this.scaleShape.transform.baseVal.getItem(0);n.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(n,0)}},P.prototype.getVisual=function(){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("width",this.width+"px"),n.setAttribute("height",this.height+"px"),n.setAttribute("viewBox","0 0 "+this.width+" "+this.height),n.style.flexShrink="0",document.body.appendChild(n);for(var d="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,D=1;D<=this.width/5+10;D++){var N=D%5==0?this.height/3:this.height/6;d+="h4v"+-N+"h1v"+N}d+="v1H0Z",this.scaleShape=Ve.createPath(d);var R=Ve.createTransform();this.scaleShape.transform.baseVal.appendItem(R),n.appendChild(this.scaleShape),this.angleLabelElement=Ve.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ve.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ee=Ve.createTSpan("");return ee.innerHTML="°",this.angleLabelElement.appendChild(ee),n.appendChild(this.angleLabelElement),document.body.removeChild(n),n},P}(),Ot=function(){function P(){this.naturalSize=!1,this.imageType="image/png"}return P.prototype.rasterize=function(n,d,D,N,R,ee,Re){var Ue=this;return new Promise(function(je){var Le=document.createElement("canvas");Le.width=n.width.baseVal.value-2*N,Le.height=n.height.baseVal.value-2*N;var Ge=1,Ke=1;Ue.naturalSize===!0?(Ge=d.naturalWidth/(n.width.baseVal.value-2*N)/ee,Ke=d.naturalHeight/(n.height.baseVal.value-2*N)/Re,Le.width=d.naturalWidth/ee,Le.height=d.naturalHeight/Re):Ue.width!==void 0&&Ue.height!==void 0&&(Ge=Ue.width/D.width,Ke=Ue.height/D.height,Le.width*=Ge,Le.height*=Ke);var Je=Le.getContext("2d");Je.translate(Le.width/2,Le.height/2),Je.rotate(R*Math.PI/180),Je.scale(ee,Re),Je.translate(-Le.width/2,-Le.height/2),Je.drawImage(d,0,0,Le.width,Le.height);var xt=document.createElement("canvas");xt.width=D.width*Ge,xt.height=D.height*Ke,xt.getContext("2d").putImageData(Je.getImageData((D.x-N)*Ge,(D.y-N)*Ke,D.width*Ge,D.height*Ke),0,0),je(xt.toDataURL(Ue.imageType,Ue.imageQuality))})},P}(),Ft=function(){function P(n){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=P.instanceCounter++,this.styles=new wt(this.instanceNo),this.target=n,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(P.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(n){this._zoomToCropEnabled=n,n?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(n){this._isGridVisible=n,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"gridLines",{get:function(){return this._gridLines},set:function(n){this._gridLines=n,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(n){this._rotationAngle=n,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"aspectRatio",{get:function(){var n;return(n=this._aspectRatio)!==null&&n!==void 0?n:this.aspectRatios[0]},set:function(n){this._aspectRatio=n},enumerable:!1,configurable:!0}),P.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},P.prototype.show=function(){this.showUI(),this.open()},P.prototype.close=function(n){n===void 0&&(n=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),n||this.closeEventListeners.forEach(function(d){return d()}),this._isOpen=!1)},P.prototype.addRenderEventListener=function(n){this.renderEventListeners.push(n)},P.prototype.removeRenderEventListener=function(n){this.renderEventListeners.indexOf(n)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(n),1)},P.prototype.addCloseEventListener=function(n){this.closeEventListeners.push(n)},P.prototype.removeCloseEventListener=function(n){this.closeEventListeners.indexOf(n)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(n),1)},P.prototype.setupResizeObserver=function(){var n=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){n.resize(n.target.clientWidth,n.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))},P.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var n=1*this.target.clientWidth/this.target.clientHeight,d=this.contentDiv.clientWidth/n>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*n:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,D=d+2*this.CANVAS_MARGINn+this.CANVAS_MARGIN?this.target.offsetTop-(n+this.CANVAS_MARGIN):0;this.coverDiv.style.top=d+"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},P.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},P.prototype.addTopToolbar=function(){var n=this;this.topToolbar=new At,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 d=new Rt;d.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(d);var D=[];this.aspectRatios.forEach(function(Ke){var Je=new it(ot.getIcon(Ke.horizontal,Ke.vertical),Ke.horizontal===0&&Ke.vertical===0?"FREE":Ke.horizontal+":"+Ke.vertical);Je.onClick=function(){return n.ratioButtonClicked(Ke)},D.push(Je)}),this.aspectRatioButton=new dt(ot.getIcon(0,0),"Aspect ratio",D),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,d.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var N=new it('',"Toggle grid");N.isActive=this.isGridVisible,N.onClick=function(){n.isGridVisible=!n.isGridVisible,N.isActive=n.isGridVisible},d.addButton(N);var R=new it('',"Zoom to selection");if(R.isActive=this.zoomToCropEnabled,R.onClick=function(){n.zoomToCropEnabled=!n.zoomToCropEnabled,R.isActive=n.zoomToCropEnabled},d.addButton(R),!bt.isLicensed){var ee=new Qe;this.topToolbar.addElementBlock(ee);var Re=document.createElement("div");Re.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ue=document.createElement("a");Ue.style.color="currentColor",Ue.href="https://markerjs.com/products/cropro",Ue.target="_blank",Ue.innerHTML='',Re.appendChild(Ue),ee.addElement(Re)}var je=new Rt;je.minWidth=3*this.toolbarHeight+"px",je.contentAlign="end",this.topToolbar.addButtonBlock(je);var Le=new it('',"OK");Le.onClick=this.startRenderAndClose,je.addButton(Le),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Le.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ge=new it('',"Close");Ge.onClick=this.close,je.addButton(Ge),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ge.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},P.prototype.addBottomToolbar=function(){var n=this;this.bottomToolbar=new At,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 d=new Rt;d.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(d);var D=new it('',"Rotate left");D.onClick=this.rotateLeftButtonClicked,d.addButton(D);var N=new it('',"Rotate right");N.onClick=this.rotateRightButtonClicked,d.addButton(N);var R=new Qe;R.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(R),this.straightener=new ft("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(je){n.rotateBy(je),n.straightener.angle=n.rotationAngle},R.addElement(this.straightener.getUI());var ee=new Rt;ee.minWidth=2*this.toolbarHeight+"px",ee.contentAlign="end",this.bottomToolbar.addButtonBlock(ee);var Re=new it('',"Flip horizontal");Re.onClick=this.flipHorizontallyButtonClicked,ee.addButton(Re);var Ue=new it('',"Flip vertical");Ue.onClick=this.flipVerticallyButtonClicked,ee.addButton(Ue)},P.prototype.ratioButtonClicked=function(n){this.aspectRatio=n,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},P.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ot.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},P.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ye(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},P.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},P.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},P.prototype.restoreState=function(n){if(n){var d=this.cropLayer.getRescaledRect(n.width,n.height,this.imageWidth,this.imageHeight,n.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(d),this.cropRectChanged(d),this.flippedHorizontally=n.flippedHorizontally,this.flippedVertically=n.flippedVertically,this.applyFlip(),this.rotationAngle=n.rotationAngle,this.applyRotation()}},P.prototype.clientToLocalCoordinates=function(n,d){var D=this.cropImage.getBoundingClientRect();return{x:n-D.left,y:d-D.top}},P.prototype.onWindowResize=function(){this.positionUI()},P.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var n=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=n+"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()},P.prototype.rotateLeftButtonClicked=function(){var n=this.rotationAngle-90;this.rotationAngle%90!=0&&(n+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(n)},P.prototype.rotateRightButtonClicked=function(){var n=this.rotationAngle+90;this.rotationAngle%90!=0&&(n-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(n)},P.prototype.rotateTo=function(n){n=(n=n>180?n-360:n)<=-180?n+360:n,this.rotationAngle=n,this.applyRotation()},P.prototype.rotateBy=function(n){this.rotateTo((this.rotationAngle+n)%360)},P.prototype.applyRotation=function(){var n=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var d=this.editingTargetRotationContainer.transform.baseVal.getItem(0);d.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(d,0);var D=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/D.width,this.imageHeight/D.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=n},P.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},P.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},P.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},P.prototype.startRenderAndClose=function(){return qe(this,void 0,void 0,function(){var n,d;return yt(this,function(D){switch(D.label){case 0:return[4,this.render()];case 1:return n=D.sent(),d=this.getState(),this.renderEventListeners.forEach(function(N){return N(n,d)}),this.close(!0),[2]}})})},P.prototype.render=function(){return qe(this,void 0,void 0,function(){var n;return yt(this,function(d){switch(d.label){case 0:return(n=new Ot).naturalSize=this.renderAtNaturalSize,n.imageType=this.renderImageType,n.imageQuality=this.renderImageQuality,n.width=this.renderWidth,n.height=this.renderHeight,this.unzoomFromCrop(),Ve.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,n.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 d.sent(),[4,n.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,d.sent()]}})})},P.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ut("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 ut("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ut("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var n=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ut("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*n)+`px;
height: `+(this.toolbarHeight-2*n)+`px;
padding: `+n+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ut("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ut("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new at("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new at("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ut("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 ut("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ut("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 ut("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*n)+`px;
padding: `+n+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ut("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},P.instanceCounter=0,P}(),_t=J("8hTe"),Wt=J.n(_t),jt=/]*>/g;function Vt(P){var n=document.createElement("div");return n.innerHTML=P,n.childNodes.length===0?"":n.childNodes[0].nodeValue}var Ht=We.a=function(P){var n=P.value,d=n===void 0?"":n,D=P.edit,N=D===void 0?!1:D,R=P.className,ee=P.showTextOnly,Re=P.showLines,Ue=P.replaces,je=P.zoomImg,Le=P.hasMask,Ge=P.style,Ke=Ge===void 0?{}:Ge,Je=P.stylesPrev,xt=Je===void 0?{}:Je,gt=String(d),Et=Object(w.useRef)(),Ct=Object(w.useRef)(),Kt=Object(w.useState)(""),Nt=Object(_.a)(Kt,2),pt=Nt[0],Lt=Nt[1],Gt=Object(w.useState)("office"),Pt=Object(_.a)(Gt,2),Xt=Pt[0],Dt=Pt[1],It=function(){var ht=new Ft(Ct.current);ht.displayMode="popup",ht.addRenderEventListener(function(){var Bt=Object(L.a)(A.a.mark(function lt(Ut){var Tt;return A.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Et.current.style.display="none",Mt.next=3,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ut}});case 3:Tt=Mt.sent,Tt!=null&&Tt.id&&Ue(Ct.current.getAttribute("src").replace(ie.a.API_SERVER,""),"/api/attachments/".concat(Tt==null?void 0:Tt.id,"?type=").concat(Tt.content_type));case 5:case"end":return Mt.stop()}},lt)}));return function(lt){return Bt.apply(this,arguments)}}()),ht.show()},Jt=function(){var ht=new rt(Ct.current);ht.settings.displayMode="popup",ht.addEventListener("render",function(){var Bt=Object(L.a)(A.a.mark(function lt(Ut){var Tt;return A.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:if(Et.current.style.display="none",!Ct.current){Mt.next=6;break}return Mt.next=4,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ut.dataUrl}});case 4:Tt=Mt.sent,Tt!=null&&Tt.id&&Ue(Ct.current.getAttribute("src").replace(ie.a.API_SERVER,""),"/api/attachments/".concat(Tt==null?void 0:Tt.id,"?type=").concat(Tt.content_type));case 6:case"end":return Mt.stop()}},lt)}));return function(lt){return Bt.apply(this,arguments)}}()),ht.show(),window.markerArea=ht},$t=Object(w.useMemo)(function(){try{var kt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Bt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;gt=gt.replace(kt,"("+ie.a.API_SERVER+"/api/attachments/").replace(ht,'"'+ie.a.API_SERVER+"/api/attachments/").replace(Bt,'"'+ie.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,`
`),gt=gt.replace(new RegExp("(?[TOC]
",p()),f()),lt=lt.replace(/(__special_katext_id_\d+__)/g,function(Zt,Mt){var Qt=Ut[Mt],tr=Qt.type,rr=Qt.expression;return Object(ge.renderToString)(Vt(rr)||"",{displayMode:tr==="block",throwOnError:!1,output:"html"})}),lt=lt.replace(/▁/g,"\u2581\u2581\u2581"),v(),ee){var Tt=document.createElement("div");return Tt.innerHTML=lt,Tt.innerText}return setTimeout(function(){return qt()},500),lt},[gt]),zt=Object(w.useRef)();u.WebkitLineClamp=Re,Re&&(Ke=Object(O.a)(Object(O.a)({},Ke),u));function Yt(kt){var ht=kt.target;if(ht.tagName.toUpperCase()==="IMG"){if(je){var Bt=ht.getAttribute("src");Lt(Bt),Dt("image")}}else if(ht.tagName.toUpperCase()==="A"){var lt=ht.getAttribute("href");if(lt.indexOf("office")>-1)kt.preventDefault(),Lt(lt),Dt("office");else if(lt.indexOf("application/pdf")>-1)kt.preventDefault(),Lt(lt),Dt("pdf");else if(lt.indexOf("type=text")>-1)kt.preventDefault(),Lt(lt),Dt("html");else if(lt.startsWith("#")){kt.preventDefault();var Ut=document.getElementById(lt.replace("#",""));Ut&&Ut.scrollIntoView(!0)}}}var qt=function(){var ht,Bt=(ht=zt.current)===null||ht===void 0?void 0:ht.querySelectorAll("video");Bt==null||Bt.forEach(function(lt){if(lt.oncontextmenu=function(){return!1},lt.src.indexOf(".m3u8")>-1&&!lt.canPlayType("application/vnd.apple.mpegurl")){if(Z.a.isSupported()){var Ut=new Z.a;Ut.loadSource(lt.src),Ut.attachMedia(lt)}}})};Object(w.useEffect)(function(){if(zt.current&&$t&&($t.match(jt)&&window.PR.prettyPrint()),zt.current)return zt.current.addEventListener("click",Yt),function(){zt.current.removeEventListener("click",Yt),v(),f()}},[$t,zt.current,Yt]);var er=function(ht){if(!N)return;ht.target.nodeName==="IMG"?(Et.current.style.display="flex",Et.current.style.width=ht.target.clientWidth+"px",Et.current.style.height=ht.target.clientHeight+"px",Et.current.style.top=ht.target.offsetTop+"px",Et.current.style.left=ht.target.offsetLeft+"px",Ct.current.src=ht.target.getAttribute("src")):Et.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:zt,style:Object(O.a)({},Ke),className:"".concat(R||""," markdown-body ").concat(Wt.a.mdBody),onMouseOver:er,dangerouslySetInnerHTML:{__html:$t}}),g.a.createElement("div",{ref:Et,className:Wt.a.button},g.a.createElement(U.a,null,g.a.createElement(B.a,{onClick:function(){return It()}},"\u88C1\u526A"),g.a.createElement(B.a,{onClick:function(){return Jt()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Ct,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(se.a,{close:!0,data:pt,hasMask:Le,type:pt!=null&&pt.length?Xt:"",style:Object(O.a)({},xt),onClose:function(){return Lt("")}}))}},BU3w:function(nt,We,J){"use strict";J.d(We,"a",function(){return L});var fe=J("MNnm"),U="rc-util-key";function C(_){if(_.attachTo)return _.attachTo;var M=document.querySelector("head");return M||document.body}function B(_){var M,A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(fe.a)())return null;var w=document.createElement("style");if((M=A.csp)===null||M===void 0?void 0:M.nonce){var g;w.nonce=(g=A.csp)===null||g===void 0?void 0:g.nonce}w.innerHTML=_;var x=C(A),S=x.firstChild;return A.prepend&&x.prepend?x.prepend(w):A.prepend&&S?x.insertBefore(w,S):x.appendChild(w),w}var O=new Map;function L(_,M){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=C(A);if(!O.has(w)){var g=B("",A),x=g.parentNode;O.set(w,x),x.removeChild(g)}var S=Array.from(O.get(w).children).find(function(e){return e.tagName==="STYLE"&&e[U]===M});if(S){var E,b;if(((E=A.csp)===null||E===void 0?void 0:E.nonce)&&S.nonce!==((b=A.csp)===null||b===void 0?void 0:b.nonce)){var y;S.nonce=(y=A.csp)===null||y===void 0?void 0:y.nonce}return S.innerHTML!==_&&(S.innerHTML=_),S}var h=B(_,A);return h[U]=M,h}},DlQD:function(nt,We,J){(function(fe,U){nt.exports=U()})(this,function(){"use strict";function fe(re,q){for(var te=0;tere.length)&&(q=re.length);for(var te=0,j=new Array(q);te=re.length?{done:!0}:{done:!1,value:re[j++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return te=re[Symbol.iterator](),te.next.bind(te)}function L(re,q){return q={exports:{}},re(q,q.exports),q.exports}var _=L(function(re){function q(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function te(j){re.exports.defaults=j}re.exports={defaults:q(),getDefaults:q,changeDefaults:te}}),M=_.defaults,A=_.getDefaults,w=_.changeDefaults,g=/[&<>"']/,x=/[&<>"']/g,S=/[<>"']|&(?!#?\w+;)/,E=/[<>"']|&(?!#?\w+;)/g,b={"&":"&","<":"<",">":">",'"':""","'":"'"},y=function(q){return b[q]};function h(re,q){if(q){if(g.test(re))return re.replace(x,y)}else if(S.test(re))return re.replace(E,y);return re}var e=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(re){return re.replace(e,function(q,te){return te=te.toLowerCase(),te==="colon"?":":te.charAt(0)==="#"?te.charAt(1)==="x"?String.fromCharCode(parseInt(te.substring(2),16)):String.fromCharCode(+te.substring(1)):""})}var o=/(^|[^\[])\^/g;function f(re,q){re=re.source||re,q=q||"";var te={replace:function(W,G){return G=G.source||G,G=G.replace(o,"$1"),re=re.replace(W,G),te},getRegex:function(){return new RegExp(re,q)}};return te}var u=/[^\w:]/g,l=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(re,q,te){if(re){var j;try{j=decodeURIComponent(s(te)).replace(u,"").toLowerCase()}catch(W){return null}if(j.indexOf("javascript:")===0||j.indexOf("vbscript:")===0||j.indexOf("data:")===0)return null}q&&!l.test(te)&&(te=a(q,te));try{te=encodeURI(te).replace(/%25/g,"%")}catch(W){return null}return te}var c={},i=/^[^:]+:\/*[^/]*$/,r=/^([^:]+:)[\s\S]*$/,t=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(re,q){c[" "+re]||(i.test(re)?c[" "+re]=re+"/":c[" "+re]=k(re,"/",!0)),re=c[" "+re];var te=re.indexOf(":")===-1;return q.substring(0,2)==="//"?te?q:re.replace(r,"$1")+q:q.charAt(0)==="/"?te?q:re.replace(t,"$1")+q:re+q}var m={exec:function(){}};function v(re){for(var q=1,te,j;q=0&&oe[ke]==="\\";)ce=!ce;return ce?"|":" |"}),j=te.split(/ \|/),W=0;if(j.length>q)j.splice(q);else for(;j.length=j.length?W.slice(j.length):W}).join(`
`)}var le=function(){function re(te){this.options=te||V}var q=re.prototype;return q.space=function(j){var W=this.rules.block.newline.exec(j);if(W)return W[0].length>1?{type:"space",raw:W[0]}:{raw:`
`}},q.code=function(j,W){var G=this.rules.block.code.exec(j);if(G){var X=W[W.length-1];if(X&&X.type==="paragraph")return{raw:G[0],text:G[0].trimRight()};var oe=G[0].replace(/^ {4}/gm,"");return{type:"code",raw:G[0],codeBlockStyle:"indented",text:this.options.pedantic?oe:Q(oe,`
`)}}},q.fences=function(j){var W=this.rules.block.fences.exec(j);if(W){var G=W[0],X=he(G,W[3]||"");return{type:"code",raw:G,lang:W[2]?W[2].trim():W[2],text:X}}},q.heading=function(j){var W=this.rules.block.heading.exec(j);if(W)return{type:"heading",raw:W[0],depth:W[1].length,text:W[2]}},q.nptable=function(j){var W=this.rules.block.nptable.exec(j);if(W){var G={type:"table",header:Z(W[1].replace(/^ *| *\| *$/g,"")),align:W[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:W[3]?W[3].replace(/\n$/,"").split(`
`):[],raw:W[0]};if(G.header.length===G.align.length){var X=G.align.length,oe;for(oe=0;oe ?/gm,"");return{type:"blockquote",raw:W[0],text:G}}},q.list=function(j){var W=this.rules.block.list.exec(j);if(W){for(var G=W[0],X=W[2],oe=X.length>1,ce=X[X.length-1]===")",ke={type:"list",raw:G,ordered:oe,start:oe?+X.slice(0,-1):"",loose:!1,items:[]},He=W[0].match(this.rules.block.item),$e=!1,ze,Ze,et,Xe,mt,rt,vt,ct=He.length,qe=0;qe1||this.options.smartLists&&et!==X)&&(Xe=He.slice(qe+1).join(`
`),ke.raw=ke.raw.substring(0,ke.raw.length-Xe.length),qe=ct-1)),mt=$e||/\n\n(?!\s*$)/.test(ze),qe!==ct-1&&($e=ze.charAt(ze.length-1)===`
`,mt||(mt=$e)),mt&&(ke.loose=!0),rt=/^\[[ xX]\] /.test(ze),vt=void 0,rt&&(vt=ze[1]!==" ",ze=ze.replace(/^\[[ xX]\] +/,"")),ke.items.push({type:"list_item",raw:G,task:rt,checked:vt,loose:mt,text:ze});return ke}},q.html=function(j){var W=this.rules.block.html.exec(j);if(W)return{type:this.options.sanitize?"paragraph":"html",raw:W[0],pre:!this.options.sanitizer&&(W[1]==="pre"||W[1]==="script"||W[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(W[0]):ie(W[0]):W[0]}},q.def=function(j){var W=this.rules.block.def.exec(j);if(W){W[3]&&(W[3]=W[3].substring(1,W[3].length-1));var G=W[1].toLowerCase().replace(/\s+/g," ");return{tag:G,raw:W[0],href:W[2],title:W[3]}}},q.table=function(j){var W=this.rules.block.table.exec(j);if(W){var G={type:"table",header:Z(W[1].replace(/^ *| *\| *$/g,"")),align:W[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:W[3]?W[3].replace(/\n$/,"").split(`
`):[]};if(G.header.length===G.align.length){G.raw=W[0];var X=G.align.length,oe;for(oe=0;oe/i.test(X[0])&&(W=!1),!G&&/^<(pre|code|kbd|script)(\s|>)/i.test(X[0])?G=!0:G&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(X[0])&&(G=!1),{type:this.options.sanitize?"text":"html",raw:X[0],inLink:W,inRawBlock:G,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(X[0]):ie(X[0]):X[0]}},q.link=function(j){var W=this.rules.inline.link.exec(j);if(W){var G=ge(W[2],"()");if(G>-1){var X=W[0].indexOf("!")===0?5:4,oe=X+W[1].length+G;W[2]=W[2].substring(0,G),W[0]=W[0].substring(0,oe).trim(),W[3]=""}var ce=W[2],ke="";if(this.options.pedantic){var He=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ce);He?(ce=He[1],ke=He[3]):ke=""}else ke=W[3]?W[3].slice(1,-1):"";ce=ce.trim().replace(/^<([\s\S]*)>$/,"$1");var $e=se(W,{href:ce&&ce.replace(this.rules.inline._escapes,"$1"),title:ke&&ke.replace(this.rules.inline._escapes,"$1")},W[0]);return $e}},q.reflink=function(j,W){var G;if((G=this.rules.inline.reflink.exec(j))||(G=this.rules.inline.nolink.exec(j))){var X=(G[2]||G[1]).replace(/\s+/g," ");if(X=W[X.toLowerCase()],!X||!X.href){var oe=G[0].charAt(0);return{type:"text",raw:oe,text:oe}}var ce=se(G,X,G[0]);return ce}},q.strong=function(j,W,G){G===void 0&&(G="");var X=this.rules.inline.strong.start.exec(j);if(X&&(!X[1]||X[1]&&(G===""||this.rules.inline.punctuation.exec(G)))){W=W.slice(-1*j.length);var oe=X[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;oe.lastIndex=0;for(var ce;(X=oe.exec(W))!=null;)if(ce=this.rules.inline.strong.middle.exec(W.slice(0,X.index+3)),ce)return{type:"strong",raw:j.slice(0,ce[0].length),text:j.slice(2,ce[0].length-2)}}},q.em=function(j,W,G){G===void 0&&(G="");var X=this.rules.inline.em.start.exec(j);if(X&&(!X[1]||X[1]&&(G===""||this.rules.inline.punctuation.exec(G)))){W=W.slice(-1*j.length);var oe=X[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;oe.lastIndex=0;for(var ce;(X=oe.exec(W))!=null;)if(ce=this.rules.inline.em.middle.exec(W.slice(0,X.index+2)),ce)return{type:"em",raw:j.slice(0,ce[0].length),text:j.slice(1,ce[0].length-1)}}},q.codespan=function(j){var W=this.rules.inline.code.exec(j);if(W){var G=W[2].replace(/\n/g," "),X=/[^ ]/.test(G),oe=G.startsWith(" ")&&G.endsWith(" ");return X&&oe&&(G=G.substring(1,G.length-1)),G=ie(G,!0),{type:"codespan",raw:W[0],text:G}}},q.br=function(j){var W=this.rules.inline.br.exec(j);if(W)return{type:"br",raw:W[0]}},q.del=function(j){var W=this.rules.inline.del.exec(j);if(W)return{type:"del",raw:W[0],text:W[1]}},q.autolink=function(j,W){var G=this.rules.inline.autolink.exec(j);if(G){var X,oe;return G[2]==="@"?(X=ie(this.options.mangle?W(G[1]):G[1]),oe="mailto:"+X):(X=ie(G[1]),oe=X),{type:"link",raw:G[0],text:X,href:oe,tokens:[{type:"text",raw:X,text:X}]}}},q.url=function(j,W){var G;if(G=this.rules.inline.url.exec(j)){var X,oe;if(G[2]==="@")X=ie(this.options.mangle?W(G[0]):G[0]),oe="mailto:"+X;else{var ce;do ce=G[0],G[0]=this.rules.inline._backpedal.exec(G[0])[0];while(ce!==G[0]);X=ie(G[0]),G[1]==="www."?oe="http://"+X:oe=X}return{type:"link",raw:G[0],text:X,href:oe,tokens:[{type:"text",raw:X,text:X}]}}},q.inlineText=function(j,W,G){var X=this.rules.inline.text.exec(j);if(X){var oe;return W?oe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(X[0]):ie(X[0]):X[0]:oe=ie(this.options.smartypants?G(X[0]):X[0]),{type:"text",raw:X[0],text:oe}}},re}(),$=K.noopTest,Y=K.edit,ne=K.merge,z={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:$,table:$,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};z._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,z._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,z.def=Y(z.def).replace("label",z._label).replace("title",z._title).getRegex(),z.bullet=/(?:[*+-]|\d{1,9}[.)])/,z.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,z.item=Y(z.item,"gm").replace(/bull/g,z.bullet).getRegex(),z.list=Y(z.list).replace(/bull/g,z.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+z.def.source+")").getRegex(),z._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",z._comment=//,z.html=Y(z.html,"i").replace("comment",z._comment).replace("tag",z._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),z.paragraph=Y(z._paragraph).replace("hr",z.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",z._tag).getRegex(),z.blockquote=Y(z.blockquote).replace("paragraph",z.paragraph).getRegex(),z.normal=ne({},z),z.gfm=ne({},z.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),z.gfm.nptable=Y(z.gfm.nptable).replace("hr",z.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",z._tag).getRegex(),z.gfm.table=Y(z.gfm.table).replace("hr",z.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",z._tag).getRegex(),z.pedantic=ne({},z.normal,{html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",z._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:$,paragraph:Y(z.normal._paragraph).replace("hr",z.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",z.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var H={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:$,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:$,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",H.punctuation=Y(H.punctuation).replace(/punctuation/g,H._punctuation).getRegex(),H._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",H._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",H.em.start=Y(H.em.start).replace(/punctuation/g,H._punctuation).getRegex(),H.em.middle=Y(H.em.middle).replace(/punctuation/g,H._punctuation).replace(/overlapSkip/g,H._overlapSkip).getRegex(),H.em.endAst=Y(H.em.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.em.endUnd=Y(H.em.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.start=Y(H.strong.start).replace(/punctuation/g,H._punctuation).getRegex(),H.strong.middle=Y(H.strong.middle).replace(/punctuation/g,H._punctuation).replace(/blockSkip/g,H._blockSkip).getRegex(),H.strong.endAst=Y(H.strong.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.endUnd=Y(H.strong.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.blockSkip=Y(H._blockSkip,"g").getRegex(),H.overlapSkip=Y(H._overlapSkip,"g").getRegex(),H._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,H._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,H._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,H.autolink=Y(H.autolink).replace("scheme",H._scheme).replace("email",H._email).getRegex(),H._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,H.tag=Y(H.tag).replace("comment",z._comment).replace("attribute",H._attribute).getRegex(),H._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,H._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,H._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,H.link=Y(H.link).replace("label",H._label).replace("href",H._href).replace("title",H._title).getRegex(),H.reflink=Y(H.reflink).replace("label",H._label).getRegex(),H.reflinkSearch=Y(H.reflinkSearch,"g").replace("reflink",H.reflink).replace("nolink",H.nolink).getRegex(),H.normal=ne({},H),H.pedantic=ne({},H.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Y(/^!?\[(label)\]\((.*?)\)/).replace("label",H._label).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",H._label).getRegex()}),H.gfm=ne({},H.normal,{escape:Y(H.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(j="x"+j.toString(16)),q+=""+j+";";return q}var pe=function(){function re(te){this.tokens=[],this.tokens.links=Object.create(null),this.options=te||De,this.options.tokenizer=this.options.tokenizer||new le,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var j={block:Oe.normal,inline:we.normal};this.options.pedantic?(j.block=Oe.pedantic,j.inline=we.pedantic):this.options.gfm&&(j.block=Oe.gfm,this.options.breaks?j.inline=we.breaks:j.inline=we.gfm),this.tokenizer.rules=j}re.lex=function(j,W){var G=new re(W);return G.lex(j)};var q=re.prototype;return q.lex=function(j){return j=j.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(j,this.tokens,!0),this.inline(this.tokens),this.tokens},q.blockTokens=function(j,W,G){W===void 0&&(W=[]),G===void 0&&(G=!0),j=j.replace(/^ +$/gm,"");for(var X,oe,ce,ke;j;){if(X=this.tokenizer.space(j)){j=j.substring(X.raw.length),X.type&&W.push(X);continue}if(X=this.tokenizer.code(j,W)){j=j.substring(X.raw.length),X.type?W.push(X):(ke=W[W.length-1],ke.raw+=`
`+X.raw,ke.text+=`
`+X.text);continue}if(X=this.tokenizer.fences(j)){j=j.substring(X.raw.length),W.push(X);continue}if(X=this.tokenizer.heading(j)){j=j.substring(X.raw.length),W.push(X);continue}if(X=this.tokenizer.nptable(j)){j=j.substring(X.raw.length),W.push(X);continue}if(X=this.tokenizer.hr(j)){j=j.substring(X.raw.length),W.push(X);continue}if(X=this.tokenizer.blockquote(j)){j=j.substring(X.raw.length),X.tokens=this.blockTokens(X.text,[],G),W.push(X);continue}if(X=this.tokenizer.list(j)){for(j=j.substring(X.raw.length),ce=X.items.length,oe=0;oe0)for(;(He=this.tokenizer.rules.inline.reflinkSearch.exec(ke))!=null;)$e.includes(He[0].slice(He[0].lastIndexOf("[")+1,-1))&&(ke=ke.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(He=this.tokenizer.rules.inline.blockSkip.exec(ke))!=null;)ke=ke.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;j;){if(ce=this.tokenizer.escape(j)){j=j.substring(ce.raw.length),W.push(ce);continue}if(ce=this.tokenizer.tag(j,G,X)){j=j.substring(ce.raw.length),G=ce.inLink,X=ce.inRawBlock,W.push(ce);continue}if(ce=this.tokenizer.link(j)){j=j.substring(ce.raw.length),ce.type==="link"&&(ce.tokens=this.inlineTokens(ce.text,[],!0,X)),W.push(ce);continue}if(ce=this.tokenizer.reflink(j,this.tokens.links)){j=j.substring(ce.raw.length),ce.type==="link"&&(ce.tokens=this.inlineTokens(ce.text,[],!0,X)),W.push(ce);continue}if(ce=this.tokenizer.strong(j,ke,oe)){j=j.substring(ce.raw.length),ce.tokens=this.inlineTokens(ce.text,[],G,X),W.push(ce);continue}if(ce=this.tokenizer.em(j,ke,oe)){j=j.substring(ce.raw.length),ce.tokens=this.inlineTokens(ce.text,[],G,X),W.push(ce);continue}if(ce=this.tokenizer.codespan(j)){j=j.substring(ce.raw.length),W.push(ce);continue}if(ce=this.tokenizer.br(j)){j=j.substring(ce.raw.length),W.push(ce);continue}if(ce=this.tokenizer.del(j)){j=j.substring(ce.raw.length),ce.tokens=this.inlineTokens(ce.text,[],G,X),W.push(ce);continue}if(ce=this.tokenizer.autolink(j,de)){j=j.substring(ce.raw.length),W.push(ce);continue}if(!G&&(ce=this.tokenizer.url(j,de))){j=j.substring(ce.raw.length),W.push(ce);continue}if(ce=this.tokenizer.inlineText(j,X,Ae)){j=j.substring(ce.raw.length),oe=ce.raw.slice(-1),W.push(ce);continue}if(j){var ze="Infinite loop on byte: "+j.charCodeAt(0);if(this.options.silent){console.error(ze);break}else throw new Error(ze)}}return W},U(re,null,[{key:"rules",get:function(){return{block:Oe,inline:we}}}]),re}(),Ee=_.defaults,xe=K.cleanUrl,_e=K.escape,Pe=function(){function re(te){this.options=te||Ee}var q=re.prototype;return q.code=function(j,W,G){var X=(W||"").match(/\S*/)[0];if(this.options.highlight){var oe=this.options.highlight(j,X);oe!=null&&oe!==j&&(G=!0,j=oe)}return X?''+(G?j:_e(j,!0))+`
`:""+(G?j:_e(j,!0))+`
`},q.blockquote=function(j){return`
`+j+`
`},q.html=function(j){return j},q.heading=function(j,W,G,X){return this.options.headerIds?"
`:""+j+"
`},q.hr=function(){return this.options.xhtml?`
`:`
`},q.list=function(j,W,G){var X=W?"ol":"ul",oe=W&&G!==1?' start="'+G+'"':"";return"<"+X+oe+`>
`+j+""+X+`>
`},q.listitem=function(j){return""+j+`
`},q.checkbox=function(j){return" "},q.paragraph=function(j){return""+j+`
`},q.table=function(j,W){return W&&(W=""+W+""),`
`},q.tablerow=function(j){return`
`+j+`
`},q.tablecell=function(j,W){var G=W.header?"th":"td",X=W.align?"<"+G+' align="'+W.align+'">':"<"+G+">";return X+j+""+G+`>
`},q.strong=function(j){return""+j+""},q.em=function(j){return""+j+""},q.codespan=function(j){return""+j+""},q.br=function(){return this.options.xhtml?"
":"
"},q.del=function(j){return""+j+""},q.link=function(j,W,G){if(j=xe(this.options.sanitize,this.options.baseUrl,j),j===null)return G;var X='"+G+"",X},q.image=function(j,W,G){if(j=xe(this.options.sanitize,this.options.baseUrl,j),j===null)return G;var X='
":">",X},q.text=function(j){return j},re}(),Ne=function(){function re(){}var q=re.prototype;return q.strong=function(j){return j},q.em=function(j){return j},q.codespan=function(j){return j},q.del=function(j){return j},q.html=function(j){return j},q.text=function(j){return j},q.link=function(j,W,G){return""+G},q.image=function(j,W,G){return""+G},q.br=function(){return""},re}(),Fe=function(){function re(){this.seen={}}var q=re.prototype;return q.slug=function(j){var W=j.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(W)){var G=W;do this.seen[G]++,W=G+"-"+this.seen[G];while(this.seen.hasOwnProperty(W))}return this.seen[W]=0,W},re}(),ae=_.defaults,ue=K.unescape,be=function(){function re(te){this.options=te||ae,this.options.renderer=this.options.renderer||new Pe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ne,this.slugger=new Fe}re.parse=function(j,W){var G=new re(W);return G.parse(j)};var q=re.prototype;return q.parse=function(j,W){W===void 0&&(W=!0);var G="",X,oe,ce,ke,He,$e,ze,Ze,et,Xe,mt,rt,vt,ct,qe,yt,bt,Ve,wt=j.length;for(X=0;X0&&qe.tokens[0].type==="text"?(qe.tokens[0].text=Ve+" "+qe.tokens[0].text,qe.tokens[0].tokens&&qe.tokens[0].tokens.length>0&&qe.tokens[0].tokens[0].type==="text"&&(qe.tokens[0].tokens[0].text=Ve+" "+qe.tokens[0].tokens[0].text)):qe.tokens.unshift({type:"text",text:Ve}):ct+=Ve),ct+=this.parse(qe.tokens,vt),et+=this.renderer.listitem(ct,bt,yt);G+=this.renderer.list(et,mt,rt);continue}case"html":{G+=this.renderer.html(Xe.text);continue}case"paragraph":{G+=this.renderer.paragraph(this.parseInline(Xe.tokens));continue}case"text":{for(et=Xe.tokens?this.parseInline(Xe.tokens):Xe.text;X+1An error occurred:"+Se(ce.message+"",!0)+"
";throw ce}}ve.options=ve.setOptions=function(re){return Te(ve.defaults,re),Ie(ve.defaults),ve},ve.getDefaults=ye,ve.defaults=Be,ve.use=function(re){var q=Te({},re);if(re.renderer&&function(){var j=ve.defaults.renderer||new Pe,W=function(oe){var ce=j[oe];j[oe]=function(){for(var ke=arguments.length,He=new Array(ke),$e=0;$e3:Ye.key!=4}))},At=function it(Qe){return Qe.map(function(Ye){var ot=Ye.title.indexOf(j),dt=Ye.title.substr(0,ot),tt=Ye.title.substr(ot+j.length),st=e.a.createElement("span",null,dt,e.a.createElement("span",{className:"c-blue"},j),tt,Object(u.o)()&&e.a.createElement(i.a,{placement:"right",title:j,content:function(){return ut(Ye)},trigger:"hover"},e.a.createElement("span",{className:"iconfont icon-sandian ".concat(H.a.actions)})));if(j!==""){var ft;if(ot===-1&&!((ft=Ye.children)!==null&&ft!==void 0&&ft.length))return null}return Ye.children&&Ye.file_type===1?Object(A.a)(Object(A.a)({},Ye),{},{title:st,key:Ye.key,children:it(Ye.children)}):Object(A.a)(Object(A.a)({},Ye),{},{title:st,key:Ye.key,isLeaf:!0})}).filter(function(Ye){return!!Ye})},St=function it(Qe,Ye){for(var ot,dt=0;dt-1}))!==null&&tt!==void 0&&tt.length?dt.id:null}return null});W(Ye),ct(!0),console.log("expandedKeys:",ot),$e(ot)};return console.log("loop(treeData):",At(bt)),e.a.createElement("div",{className:H.a.tree},e.a.createElement(me,{style:{marginBottom:8},placeholder:"\u8F93\u5165\u5173\u952E\u5B57\u68C0\u7D22",onChange:Rt}),e.a.createElement(De,{multiple:!0,defaultExpandAll:!0,onSelect:wt,onExpand:at,expandedKeys:He,selectedKeys:et,autoExpandParent:vt,treeData:At(bt)}),e.a.createElement(he,null),e.a.createElement(Y,null))},we=Object(o.a)(function(pe){var Ee=pe.user,xe=pe.loading,_e=pe.globalSetting,Pe=pe.restful;return{user:Ee,globalSetting:_e,restful:Pe,loading:xe.models.index}})(Oe),Ae=function(Ee){var xe,_e,Pe=Ee.user,Ne=Ee.globalSetting,Fe=Ee.loading,ae=Ee.dispatch,ue=Ee.restful,be=Object(E.a)(Ee,["user","globalSetting","loading","dispatch","restful"]),Te=Object(h.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),Ce=Object(S.a)(Te,2),Se=Ce[0],ye=Ce[1],Ie=Object(h.useState)(!0),Be=Object(S.a)(Ie,2),ve=Be[0],Me=Be[1],re=x.a.useForm(),q=Object(S.a)(re,1),te=q[0],j=be.match.params,W=function(){var oe=Object(w.a)(y.a.mark(function ce(){return y.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:ae({type:"restful/getRestful"}),j.id&&ae({type:"restful/getRestfulDetail",payload:Object(A.a)({},j)});case 2:case"end":return He.stop()}},ce)}));return function(){return oe.apply(this,arguments)}}();Object(h.useEffect)(function(){Me(!0),W()},[j.id]);var G=function(){ae({type:"restful/setActionTabs",payload:{key:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"}})},X=function(){var ce;if((ce=ue.restful)!==null&&ce!==void 0&&ce.data){var ke,He,$e=0;return(ke=ue.restful)===null||ke===void 0||((He=ke.data)===null||He===void 0)||He.map(function(ze){var Ze;ze==null||((Ze=ze.children)===null||Ze===void 0)||Ze.map(function(et){et.id==be.match.params.id&&($e=ze.id)}),!ze.children&&!$e&&($e=ze.id)}),$e}return 0};return e.a.createElement("section",null,e.a.createElement("aside",{className:"edu-container mt20"},e.a.createElement(M.a,null,e.a.createElement(M.a.Item,null,e.a.createElement(s.a,{to:"/"},"\u9996\u9875")),e.a.createElement(M.a.Item,null,e.a.createElement(s.a,{to:"/ch/rest"},"API\u6587\u6863"))),e.a.createElement("div",{className:"mt20"},e.a.createElement(B.a,{gutter:[20,20]},e.a.createElement(L.a,{flex:"300px"},e.a.createElement(we,be)),e.a.createElement(L.a,{flex:"1"},e.a.createElement("div",{className:p.a.info},e.a.createElement("h1",{style:{fontSize:28,paddingBottom:15,borderBottom:"1px solid #eaeaea",textAlign:"center"}},(xe=ue.restfulDetail)===null||xe===void 0?void 0:xe.name),e.a.createElement(f.a,{value:(_e=ue.restfulDetail)===null||_e===void 0?void 0:_e.description}))))),Object(u.o)()&&e.a.createElement("div",{className:p.a.bar},e.a.createElement(B.a,null,!!X()&&e.a.createElement(L.a,null,e.a.createElement(U.a,{title:"\u7F16\u8F91\u6587\u4EF6"},e.a.createElement(s.a,{to:"/ch/rest/edit/".concat(X(),"/").concat(be.match.params.id),className:"icon-zhongmingming current"}))),e.a.createElement(L.a,null,e.a.createElement(U.a,{title:"\u6DFB\u52A0\u6587\u4EF6"},e.a.createElement(s.a,{to:"/ch/rest/edit/".concat(X(),"/0"),className:"icon-tianjiatimu current"}))),e.a.createElement(L.a,null,e.a.createElement(U.a,{title:"\u65B0\u5EFA\u6587\u4EF6\u5939"},e.a.createElement("span",{className:"icon-wenjianjia1 current",onClick:G})))))))},de=We.default=Object(o.a)(function(pe){var Ee=pe.user,xe=pe.loading,_e=pe.globalSetting,Pe=pe.restful;return{user:Ee,globalSetting:_e,restful:Pe,loading:xe.models.index}})(Ae)},NvD2:function(nt,We,J){"use strict";J.d(We,"a",function(){return L});var fe=J("Kwbf");function U(_,M){var A=new Set;return _.forEach(function(w){M.has(w)||A.add(w)}),A}function C(_){var M=_||{},A=M.disabled,w=M.disableCheckbox,g=M.checkable;return!!(A||w)||g===!1}function B(_,M,A,w){for(var g=new Set(_),x=new Set,S=0;S<=A;S+=1){var E=M.get(S)||new Set;E.forEach(function(e){var s=e.key,o=e.node,f=e.children,u=f===void 0?[]:f;g.has(s)&&!w(o)&&u.filter(function(l){return!w(l.node)}).forEach(function(l){g.add(l.key)})})}for(var b=new Set,y=A;y>=0;y-=1){var h=M.get(y)||new Set;h.forEach(function(e){var s=e.parent,o=e.node;if(w(o)||!e.parent||b.has(e.parent.key))return;if(w(e.parent.node)){b.add(s.key);return}var f=!0,u=!1;(s.children||[]).filter(function(l){return!w(l.node)}).forEach(function(l){var p=l.key,c=g.has(p);f&&!c&&(f=!1),!u&&(c||x.has(p))&&(u=!0)}),f&&g.add(s.key),u&&x.add(s.key),b.add(s.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(U(x,g))}}function O(_,M,A,w,g){for(var x=new Set(_),S=new Set(M),E=0;E<=w;E+=1){var b=A.get(E)||new Set;b.forEach(function(s){var o=s.key,f=s.node,u=s.children,l=u===void 0?[]:u;!x.has(o)&&!S.has(o)&&!g(f)&&l.filter(function(p){return!g(p.node)}).forEach(function(p){x.delete(p.key)})})}S=new Set;for(var y=new Set,h=w;h>=0;h-=1){var e=A.get(h)||new Set;e.forEach(function(s){var o=s.parent,f=s.node;if(g(f)||!s.parent||y.has(s.parent.key))return;if(g(s.parent.node)){y.add(o.key);return}var u=!0,l=!1;(o.children||[]).filter(function(p){return!g(p.node)}).forEach(function(p){var c=p.key,i=x.has(c);u&&!i&&(u=!1),!l&&(i||S.has(c))&&(l=!0)}),u||x.delete(o.key),l&&S.add(o.key),y.add(o.key)})}return{checkedKeys:Array.from(x),halfCheckedKeys:Array.from(U(S,x))}}function L(_,M,A,w){var g=[],x;w?x=w:x=C;var S=new Set(_.filter(function(h){var e=!!A[h];return e||g.push(h),e})),E=new Map,b=0;Object.keys(A).forEach(function(h){var e=A[h],s=e.level,o=E.get(s);o||(o=new Set,E.set(s,o)),o.add(e),b=Math.max(b,s)}),Object(fe.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(h){return"'".concat(h,"'")}).join(", ")));var y;return M===!0?y=B(S,E,b,x):y=O(S,M.halfCheckedKeys,E,b,x),y}},OZM5:function(nt,We,J){"use strict";J.d(We,"b",function(){return w}),J.d(We,"a",function(){return g}),J.d(We,"k",function(){return x}),J.d(We,"h",function(){return S}),J.d(We,"i",function(){return E}),J.d(We,"g",function(){return b}),J.d(We,"c",function(){return y}),J.d(We,"d",function(){return h}),J.d(We,"j",function(){return o}),J.d(We,"e",function(){return f}),J.d(We,"f",function(){return u});var fe=J("KQm4"),U=J("U8pU"),C=J("Ff2n"),B=J("q1tI"),O=J.n(B),L=J("Kwbf"),_=J("WaYH"),M=.25,A=2;function w(l,p){var c=l.slice(),i=c.indexOf(p);return i>=0&&c.splice(i,1),c}function g(l,p){var c=l.slice();return c.indexOf(p)===-1&&c.push(p),c}function x(l){return l.split("-")}function S(l,p){return"".concat(l,"-").concat(p)}function E(l){return l&&l.type&&l.type.isTreeNode}function b(l,p){var c=[l],i=p[l];function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];t.forEach(function(a){var m=a.key,v=a.children;c.push(m),r(v)})}return r(i.children),c}function y(l,p){var c=l.clientY,i=p.selectHandle.getBoundingClientRect(),r=i.top,t=i.bottom,a=i.height,m=Math.max(a*M,A);return c<=r+m?-1:c>=t-m?1:0}function h(l,p){if(!l)return;var c=p.multiple;return c?l.slice():l.length?[l[0]]:l}var e=function(p){return p};function s(l,p){if(!l)return[];var c=p||{},i=c.processProps,r=i===void 0?e:i,t=Array.isArray(l)?l:[l];return t.map(function(a){var m=a.children,v=Object(C.a)(a,["children"]),T=s(m,p);return O.a.createElement(_.a,Object.assign({},r(v)),T)})}function o(l){if(!l)return null;var p;if(Array.isArray(l))p={checkedKeys:l,halfCheckedKeys:void 0};else if(Object(U.a)(l)==="object")p={checkedKeys:l.checked||void 0,halfCheckedKeys:l.halfChecked||void 0};else return Object(L.a)(!1,"`checkedKeys` is not an array or an object"),null;return p}function f(l,p){var c=new Set;function i(r){if(c.has(r))return;var t=p[r];if(!t)return;c.add(r);var a=t.parent,m=t.node;if(m.disabled)return;a&&i(a.key)}return(l||[]).forEach(function(r){i(r)}),Object(fe.a)(c)}function u(l){var p={};return Object.keys(l).forEach(function(c){(c.startsWith("data-")||c.startsWith("aria-"))&&(p[c]=l[c])}),p}},P48q:function(nt,We,J){nt.exports={flex_box_center:"flex_box_center___BHtvi",flex_space_between:"flex_space_between___1noDr",flex_box_vertical_center:"flex_box_vertical_center___2UDAc",flex_box_center_end:"flex_box_center_end___2j8--",flex_box_column:"flex_box_column___3X60k",tree:"tree___2kCYs",actions:"actions___10Q_6"}},SJMd:function(nt,We){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var J,fe,U,C=!1,B,O;window.PR_SHOULD_USE_CONTINUATION=!0;var L,_;(function(){var M=window,A=["break,continue,do,else,for,if,return,while"],w=[A,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[w,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],x=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],S=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],E=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],b="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",e=[A,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[A,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],o=[A,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],f=[x,E,S,y,h,e,s,o],u=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,l="str",p="kwd",c="com",i="typ",r="lit",t="pun",a="pln",m="tag",v="dec",T="src",k="atn",I="atv",F="nocode",K="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function V(de){for(var pe=0,Ee=!1,xe=!1,_e=0,Pe=de.length;_e122||(j<65||te>90||Ie.push([Math.max(65,te)|32,Math.min(j,90)|32]),j<97||te>122||Ie.push([Math.max(97,te)&~32,Math.min(j,122)&~32]))}}Ie.sort(function(oe,ce){return oe[0]-ce[0]||ce[1]-oe[1]});for(var W=[],G=[],Me=0;MeX[0]&&(X[1]+1>X[0]&&ve.push("-"),ve.push(ue(X[1])))}return ve.push("]"),ve.join("")}function Te(Se){for(var ye=Se.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ie=ye.length,Be=[],ve=0,Me=0;ve=2&&te==="["?ye[ve]=be(re):te!=="\\"&&(ye[ve]=re.replace(/[a-zA-Z]/g,function(G){var X=G.charCodeAt(0);return"["+String.fromCharCode(X&~32,X|32)+"]"}))}return ye.join("")}for(var Ce=[],_e=0,Pe=de.length;_e=0;)Ee[Ce.charAt(Se)]=Te;var ye=Te[1],Ie=""+ye;ae.hasOwnProperty(Ie)||(Fe.push(ye),ae[Ie]=null)}Fe.push(/[\0-\uffff]/),xe=V(Fe)})();var _e=pe.length,Pe=function(Ne){for(var Fe=Ne.sourceCode,ae=Ne.basePos,ue=Ne.sourceNode,be=[ae,a],Te=0,Ce=Fe.match(xe)||[],Se={},ye=0,Ie=Ce.length;ye=5&&ve.substring(0,5)==="lang-",re&&!(Me&&typeof Me[1]=="string")&&(re=!1,ve=T),re||(Se[Be]=ve)}var j=Te;if(Te+=Be.length,!re)be.push(ae+j,ve);else{var W=Me[1],G=Be.indexOf(W),X=G+W.length;Me[2]&&(X=Be.length-Me[2].length,G=X-W.length);var oe=ve.substring(5);Z(ue,ae+j,Be.substring(0,G),Pe,be),Z(ue,ae+j+G,W,H(oe,W),be),Z(ue,ae+j+X,Be.substring(X),Pe,be)}}Ne.decorations=be};return Pe}function he(de){var pe=[],Ee=[];de.tripleQuotedStrings?pe.push([l,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):de.multiLineStrings?pe.push([l,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):pe.push([l,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),de.verbatimStrings&&Ee.push([l,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var xe=de.hashComments;xe&&(de.cStyleComments?(xe>1?pe.push([c,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):pe.push([c,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ee.push([l,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):pe.push([c,/^#[^\r\n]*/,null,"#"])),de.cStyleComments&&(Ee.push([c,/^\/\/[^\r\n]*/,null]),Ee.push([c,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var _e=de.regexLiterals;if(_e){var Pe=_e>1?"":`
\r`,Ne=Pe?".":"[\\S\\s]",Fe="/(?=[^/*"+Pe+"])(?:[^/\\x5B\\x5C"+Pe+"]|\\x5C"+Ne+"|\\x5B(?:[^\\x5C\\x5D"+Pe+"]|\\x5C"+Ne+")*(?:\\x5D|$))+/";Ee.push(["lang-regex",RegExp("^"+K+"("+Fe+")")])}var ae=de.types;ae&&Ee.push([i,ae]);var ue=(""+de.keywords).replace(/^ | $/g,"");ue.length&&Ee.push([p,new RegExp("^(?:"+ue.replace(/[\s,]+/g,"|")+")\\b"),null]),pe.push([a,/^\s+/,null,` \r
\xA0`]);var be="^.[^\\s\\w.$@'\"`/\\\\]*";return de.regexLiterals&&(be+="(?!s*/)"),Ee.push([r,/^@[a-z_$][a-z_$@0-9]*/i,null],[i,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[r,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[t,new RegExp(be),null]),se(pe,Ee)}var le=he({keywords:f,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function $(de,pe,Ee){for(var xe=/(?:^|\s)nocode(?:\s|$)/,_e=/\r\n?|\n/,Pe=de.ownerDocument,Ne=Pe.createElement("li");de.firstChild;)Ne.appendChild(de.firstChild);var Fe=[Ne];function ae(ye){var Ie=ye.nodeType;if(Ie==1&&!xe.test(ye.className))if(ye.nodeName==="br")ue(ye),ye.parentNode&&ye.parentNode.removeChild(ye);else for(var Be=ye.firstChild;Be;Be=Be.nextSibling)ae(Be);else if((Ie==3||Ie==4)&&Ee){var ve=ye.nodeValue,Me=ve.match(_e);if(Me){var re=ve.substring(0,Me.index);ye.nodeValue=re;var q=ve.substring(Me.index+Me[0].length);if(q){var te=ye.parentNode;te.insertBefore(Pe.createTextNode(q),ye.nextSibling)}ue(ye),re||ye.parentNode.removeChild(ye)}}}function ue(ye){for(;!ye.nextSibling;)if(ye=ye.parentNode,!ye)return;function Ie(Me,re){var q=re?Me.cloneNode(!1):Me,te=Me.parentNode;if(te){var j=Ie(te,1),W=Me.nextSibling;j.appendChild(q);for(var G=W;G;G=W)W=G.nextSibling,j.appendChild(G)}return q}for(var Be=Ie(ye.nextSibling,0),ve;(ve=Be.parentNode)&&ve.nodeType===1;)Be=ve;Fe.push(Be)}for(var be=0;be=te&&(ae+=2),Pe>=j&&(Te+=2)}}finally{ve&&(ve.style.display=Me)}}var ne={};function z(de,pe){for(var Ee=pe.length;--Ee>=0;){var xe=pe[Ee];ne.hasOwnProperty(xe)?M.console&&console.warn("cannot override language handler %s",xe):ne[xe]=de}}function H(de,pe){return de&&ne.hasOwnProperty(de)||(de=/^\s*]*(?:>|$)/],[c,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[t,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^