You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Shixuns__Detail__Reposit...

1 line
286 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(self.webpackChunk=self.webpackChunk||[]).push([[7046],{65030:function(e,t,n){"use strict";n.d(t,{Z:function(){return X}});var r=n(33885),i=n(42978),o=n(75931),l=n(43403),a=n(92310),s=n.n(a),u=n(29301),c=n(76846),f=n(96452),d=n(6089),h=n(80402),p=n(34280),v=n(49658),m=n(59301),g=n(54476),y=n(77900),b=n(8654);function w(e){var t=e.prefixCls,n=e.align,r=e.arrow,i=e.arrowPos,o=r||{},l=o.className,a=o.content,u=i.x,c=void 0===u?0:u,f=i.y,d=void 0===f?0:f,h=m.useRef();if(!n||!n.points)return null;var p={position:"absolute"};if(!1!==n.autoArrow){var v=n.points[0],g=n.points[1],y=v[0],b=v[1],w=g[0],x=g[1];y!==w&&["t","b"].includes(y)?"t"===y?p.top=0:p.bottom=0:p.top=d,b!==x&&["l","r"].includes(b)?"l"===b?p.left=0:p.right=0:p.left=c}return m.createElement("div",{ref:h,className:s()("".concat(t,"-arrow"),l),style:p},a)}function x(e){var t=e.prefixCls,n=e.open,r=e.zIndex,i=e.mask,o=e.motion;return i?m.createElement(y.default,(0,g.Z)({},o,{motionAppear:!0,visible:n,removeOnLeave:!0}),(function(e){var n=e.className;return m.createElement("div",{style:{zIndex:r},className:s()("".concat(t,"-mask"),n)})})):null}var C=m.memo((function(e){return e.children}),(function(e,t){return t.cache}));var S=m.forwardRef((function(e,t){var n=e.popup,o=e.className,l=e.prefixCls,a=e.style,c=e.target,f=e.onVisibleChanged,d=e.open,h=e.keepDom,v=e.fresh,S=e.onClick,M=e.mask,k=e.arrow,L=e.arrowPos,E=e.align,T=e.motion,N=e.maskMotion,Z=e.forceRender,O=e.getPopupContainer,R=e.autoDestroy,A=e.portal,D=e.zIndex,P=e.onMouseEnter,W=e.onMouseLeave,I=e.onPointerEnter,H=e.onPointerDownCapture,F=e.ready,z=e.offsetX,_=e.offsetY,B=e.offsetR,V=e.offsetB,j=e.onAlign,K=e.onPrepare,G=e.stretch,X=e.targetWidth,Y=e.targetHeight,U="function"==typeof n?n():n,q=d||h,$=(null==O?void 0:O.length)>0,J=m.useState(!O||!$),Q=(0,i.Z)(J,2),ee=Q[0],te=Q[1];if((0,p.Z)((function(){!ee&&$&&c&&te(!0)}),[ee,$,c]),!ee)return null;var ne="auto",re={left:"-1000vw",top:"-1000vh",right:ne,bottom:ne};if(F||!d){var ie,oe=E.points,le=E.dynamicInset||(null===(ie=E._experimental)||void 0===ie?void 0:ie.dynamicInset),ae=le&&"r"===oe[0][1],se=le&&"b"===oe[0][0];ae?(re.right=B,re.left=ne):(re.left=z,re.right=ne),se?(re.bottom=V,re.top=ne):(re.top=_,re.bottom=ne)}var ue={};return G&&(G.includes("height")&&Y?ue.height=Y:G.includes("minHeight")&&Y&&(ue.minHeight=Y),G.includes("width")&&X?ue.width=X:G.includes("minWidth")&&X&&(ue.minWidth=X)),d||(ue.pointerEvents="none"),m.createElement(A,{open:Z||q,getContainer:O&&function(){return O(c)},autoDestroy:R},m.createElement(x,{prefixCls:l,open:d,zIndex:D,mask:M,motion:N}),m.createElement(u.Z,{onResize:j,disabled:!d},(function(e){return m.createElement(y.default,(0,g.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Z,leavedClassName:"".concat(l,"-hidden")},T,{onAppearPrepare:K,onEnterPrepare:K,visible:d,onVisibleChanged:function(e){var t;null==T||null===(t=T.onVisibleChanged)||void 0===t||t.call(T,e),f(e)}}),(function(n,i){var u=n.className,c=n.style,f=s()(l,u,o);return m.createElement("div",{ref:(0,b.sQ)(e,t,i),className:f,style:(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({"--arrow-x":"".concat(L.x||0,"px"),"--arrow-y":"".concat(L.y||0,"px")},re),ue),c),{},{boxSizing:"border-box",zIndex:D},a),onMouseEnter:P,onMouseLeave:W,onPointerEnter:I,onClick:S,onPointerDownCapture:H},k&&m.createElement(w,{prefixCls:l,arrow:k,arrowPos:L,align:E}),m.createElement(C,{cache:!d&&!v},U))}))})))}));var M=m.forwardRef((function(e,t){var n=e.children,r=e.getTriggerDOMNode,i=(0,b.Yr)(n),o=m.useCallback((function(e){(0,b.mH)(t,r?r(e):e)}),[r]),l=(0,b.x1)(o,(0,b.C4)(n));return i?m.cloneElement(n,{ref:l}):n})),k=m.createContext(null);function L(e){return e?Array.isArray(e)?e:[e]:[]}function E(e,t,n,r){return m.useMemo((function(){var i=L(null!=n?n:t),o=L(null!=r?r:t),l=new Set(i),a=new Set(o);return e&&(l.has("hover")&&(l.delete("hover"),l.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[l,a]}),[e,t,n,r])}var T=n(29194);function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function Z(e,t,n,r){for(var i=n.points,o=Object.keys(e),l=0;l<o.length;l+=1){var a,s=o[l];if(N(null===(a=e[s])||void 0===a?void 0:a.points,i,r))return"".concat(t,"-placement-").concat(s)}return""}function O(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function R(e){return e.ownerDocument.defaultView}function A(e){for(var t=[],n=null==e?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var i=R(n).getComputedStyle(n);[i.overflowX,i.overflowY,i.overflow].some((function(e){return r.includes(e)}))&&t.push(n),n=n.parentElement}return t}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isNaN(e)?t:e}function P(e){return D(parseFloat(e),0)}function W(e,t){var n=(0,r.Z)({},e);return(t||[]).forEach((function(e){if(!(e instanceof HTMLBodyElement||e instanceof HTMLHtmlElement)){var t=R(e).getComputedStyle(e),r=t.overflow,i=t.overflowClipMargin,o=t.borderTopWidth,l=t.borderBottomWidth,a=t.borderLeftWidth,s=t.borderRightWidth,u=e.getBoundingClientRect(),c=e.offsetHeight,f=e.clientHeight,d=e.offsetWidth,h=e.clientWidth,p=P(o),v=P(l),m=P(a),g=P(s),y=D(Math.round(u.width/d*1e3)/1e3),b=D(Math.round(u.height/c*1e3)/1e3),w=(d-h-m-g)*y,x=(c-f-p-v)*b,C=p*b,S=v*b,M=m*y,k=g*y,L=0,E=0;if("clip"===r){var T=P(i);L=T*y,E=T*b}var N=u.x+M-L,Z=u.y+C-E,O=N+u.width+2*L-M-k-w,A=Z+u.height+2*E-C-S-x;n.left=Math.max(n.left,N),n.top=Math.max(n.top,Z),n.right=Math.min(n.right,O),n.bottom=Math.min(n.bottom,A)}})),n}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n="".concat(t),r=n.match(/^(.*)\%$/);return r?e*(parseFloat(r[1])/100):parseFloat(n)}function H(e,t){var n=t||[],r=(0,i.Z)(n,2),o=r[0],l=r[1];return[I(e.width,o),I(e.height,l)]}function F(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[e[0],e[1]]}function z(e,t){var n,r=t[0],i=t[1];return n="t"===r?e.y:"b"===r?e.y+e.height:e.y+e.height/2,{x:"l"===i?e.x:"r"===i?e.x+e.width:e.x+e.width/2,y:n}}function _(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map((function(e,r){return r===t?n[e]||"c":e})).join("")}function B(e,t,n,o,l,a,s){var u=m.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:l[o]||{}}),f=(0,i.Z)(u,2),h=f[0],v=f[1],g=m.useRef(0),y=m.useMemo((function(){return t?A(t):[]}),[t]),b=m.useRef({});e||(b.current={});var w=(0,d.Z)((function(){if(t&&n&&e){var u,f,d,h,p,m=t,g=m.ownerDocument,w=R(m),x=w.getComputedStyle(m).position,C=m.style.left,S=m.style.top,M=m.style.right,k=m.style.bottom,L=m.style.overflow,E=(0,r.Z)((0,r.Z)({},l[o]),a),N=g.createElement("div");if(null===(u=m.parentElement)||void 0===u||u.appendChild(N),N.style.left="".concat(m.offsetLeft,"px"),N.style.top="".concat(m.offsetTop,"px"),N.style.position=x,N.style.height="".concat(m.offsetHeight,"px"),N.style.width="".concat(m.offsetWidth,"px"),m.style.left="0",m.style.top="0",m.style.right="auto",m.style.bottom="auto",m.style.overflow="hidden",Array.isArray(n))p={x:n[0],y:n[1],width:0,height:0};else{var Z,O,A=n.getBoundingClientRect();A.x=null!==(Z=A.x)&&void 0!==Z?Z:A.left,A.y=null!==(O=A.y)&&void 0!==O?O:A.top,p={x:A.x,y:A.y,width:A.width,height:A.height}}var P=m.getBoundingClientRect(),I=w.getComputedStyle(m),B=I.height,V=I.width;P.x=null!==(f=P.x)&&void 0!==f?f:P.left,P.y=null!==(d=P.y)&&void 0!==d?d:P.top;var j=g.documentElement,K=j.clientWidth,G=j.clientHeight,X=j.scrollWidth,Y=j.scrollHeight,U=j.scrollTop,q=j.scrollLeft,$=P.height,J=P.width,Q=p.height,ee=p.width,te={left:0,top:0,right:K,bottom:G},ne={left:-q,top:-U,right:X-q,bottom:Y-U},re=E.htmlRegion,ie="visible",oe="visibleFirst";"scroll"!==re&&re!==oe&&(re=ie);var le=re===oe,ae=W(ne,y),se=W(te,y),ue=re===ie?se:ae,ce=le?se:ue;m.style.left="auto",m.style.top="auto",m.style.right="0",m.style.bottom="0";var fe=m.getBoundingClientRect();m.style.left=C,m.style.top=S,m.style.right=M,m.style.bottom=k,m.style.overflow=L,null===(h=m.parentElement)||void 0===h||h.removeChild(N);var de=D(Math.round(J/parseFloat(V)*1e3)/1e3),he=D(Math.round($/parseFloat(B)*1e3)/1e3);if(0===de||0===he||(0,c.Sh)(n)&&!(0,T.Z)(n))return;var pe=E.offset,ve=E.targetOffset,me=H(P,pe),ge=(0,i.Z)(me,2),ye=ge[0],be=ge[1],we=H(p,ve),xe=(0,i.Z)(we,2),Ce=xe[0],Se=xe[1];p.x-=Ce,p.y-=Se;var Me=E.points||[],ke=(0,i.Z)(Me,2),Le=ke[0],Ee=F(ke[1]),Te=F(Le),Ne=z(p,Ee),Ze=z(P,Te),Oe=(0,r.Z)({},E),Re=Ne.x-Ze.x+ye,Ae=Ne.y-Ze.y+be;function Lt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ue,r=P.x+e,i=P.y+t,o=r+J,l=i+$,a=Math.max(r,n.left),s=Math.max(i,n.top),u=Math.min(o,n.right),c=Math.min(l,n.bottom);return Math.max(0,(u-a)*(c-s))}var De,Pe,We,Ie,He=Lt(Re,Ae),Fe=Lt(Re,Ae,se),ze=z(p,["t","l"]),_e=z(P,["t","l"]),Be=z(p,["b","r"]),Ve=z(P,["b","r"]),je=E.overflow||{},Ke=je.adjustX,Ge=je.adjustY,Xe=je.shiftX,Ye=je.shiftY,Ue=function(e){return"boolean"==typeof e?e:e>=0};function Et(){De=P.y+Ae,Pe=De+$,We=P.x+Re,Ie=We+J}Et();var qe=Ue(Ge),$e=Te[0]===Ee[0];if(qe&&"t"===Te[0]&&(Pe>ce.bottom||b.current.bt)){var Je=Ae;$e?Je-=$-Q:Je=ze.y-Ve.y-be;var Qe=Lt(Re,Je),et=Lt(Re,Je,se);Qe>He||Qe===He&&(!le||et>=Fe)?(b.current.bt=!0,Ae=Je,be=-be,Oe.points=[_(Te,0),_(Ee,0)]):b.current.bt=!1}if(qe&&"b"===Te[0]&&(De<ce.top||b.current.tb)){var tt=Ae;$e?tt+=$-Q:tt=Be.y-_e.y-be;var nt=Lt(Re,tt),rt=Lt(Re,tt,se);nt>He||nt===He&&(!le||rt>=Fe)?(b.current.tb=!0,Ae=tt,be=-be,Oe.points=[_(Te,0),_(Ee,0)]):b.current.tb=!1}var it=Ue(Ke),ot=Te[1]===Ee[1];if(it&&"l"===Te[1]&&(Ie>ce.right||b.current.rl)){var lt=Re;ot?lt-=J-ee:lt=ze.x-Ve.x-ye;var at=Lt(lt,Ae),st=Lt(lt,Ae,se);at>He||at===He&&(!le||st>=Fe)?(b.current.rl=!0,Re=lt,ye=-ye,Oe.points=[_(Te,1),_(Ee,1)]):b.current.rl=!1}if(it&&"r"===Te[1]&&(We<ce.left||b.current.lr)){var ut=Re;ot?ut+=J-ee:ut=Be.x-_e.x-ye;var ct=Lt(ut,Ae),ft=Lt(ut,Ae,se);ct>He||ct===He&&(!le||ft>=Fe)?(b.current.lr=!0,Re=ut,ye=-ye,Oe.points=[_(Te,1),_(Ee,1)]):b.current.lr=!1}Et();var dt=!0===Xe?0:Xe;"number"==typeof dt&&(We<se.left&&(Re-=We-se.left-ye,p.x+ee<se.left+dt&&(Re+=p.x-se.left+ee-dt)),Ie>se.right&&(Re-=Ie-se.right-ye,p.x>se.right-dt&&(Re+=p.x-se.right+dt)));var ht=!0===Ye?0:Ye;"number"==typeof ht&&(De<se.top&&(Ae-=De-se.top-be,p.y+Q<se.top+ht&&(Ae+=p.y-se.top+Q-ht)),Pe>se.bottom&&(Ae-=Pe-se.bottom-be,p.y>se.bottom-ht&&(Ae+=p.y-se.bottom+ht)));var pt=P.x+Re,vt=pt+J,mt=P.y+Ae,gt=mt+$,yt=p.x,bt=yt+ee,wt=p.y,xt=wt+Q,Ct=(Math.max(pt,yt)+Math.min(vt,bt))/2-pt,St=(Math.max(mt,wt)+Math.min(gt,xt))/2-mt;null==s||s(t,Oe);var Mt=fe.right-P.x-(Re+P.width),kt=fe.bottom-P.y-(Ae+P.height);1===de&&(Re=Math.round(Re),Mt=Math.round(Mt)),1===he&&(Ae=Math.round(Ae),kt=Math.round(kt)),v({ready:!0,offsetX:Re/de,offsetY:Ae/he,offsetR:Mt/de,offsetB:kt/he,arrowX:Ct/de,arrowY:St/he,scaleX:de,scaleY:he,align:Oe})}})),x=function(){v((function(e){return(0,r.Z)((0,r.Z)({},e),{},{ready:!1})}))};return(0,p.Z)(x,[o]),(0,p.Z)((function(){e||x()}),[e]),[h.ready,h.offsetX,h.offsetY,h.offsetR,h.offsetB,h.arrowX,h.arrowY,h.scaleX,h.scaleY,h.align,function(){g.current+=1;var e=g.current;Promise.resolve().then((function(){g.current===e&&w()}))}]}var V=n(94480);function j(e,t,n,r,i){(0,p.Z)((function(){if(e&&t&&n){var o=n,l=A(t),a=A(o),s=R(o),u=new Set([s].concat((0,V.Z)(l),(0,V.Z)(a)));function c(){r(),i()}return u.forEach((function(e){e.addEventListener("scroll",c,{passive:!0})})),s.addEventListener("resize",c,{passive:!0}),r(),function(){u.forEach((function(e){e.removeEventListener("scroll",c),s.removeEventListener("resize",c)}))}}}),[e,t,n])}n(48736);function K(e,t,n,r,i,o,l,a){var s=m.useRef(e);s.current=e;var u=m.useRef(!1);return m.useEffect((function(){if(t&&r&&(!i||o)){var e=function(){u.current=!1},c=function(e){var t;!s.current||l((null===(t=e.composedPath)||void 0===t||null===(t=t.call(e))||void 0===t?void 0:t[0])||e.target)||u.current||a(!1)},d=R(r);d.addEventListener("pointerdown",e,!0),d.addEventListener("mousedown",c,!0),d.addEventListener("contextmenu",c,!0);var h=(0,f.A)(n);return h&&(h.addEventListener("mousedown",c,!0),h.addEventListener("contextmenu",c,!0)),function(){d.removeEventListener("pointerdown",e,!0),d.removeEventListener("mousedown",c,!0),d.removeEventListener("contextmenu",c,!0),h&&(h.removeEventListener("mousedown",c,!0),h.removeEventListener("contextmenu",c,!0))}}}),[t,n,r,i,o]),function(){u.current=!0}}var G=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];var X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.Z,t=m.forwardRef((function(t,n){var l=t.prefixCls,a=void 0===l?"rc-trigger-popup":l,g=t.children,y=t.action,b=void 0===y?"hover":y,w=t.showAction,x=t.hideAction,C=t.popupVisible,L=t.defaultPopupVisible,T=t.onPopupVisibleChange,N=t.afterPopupVisibleChange,R=t.mouseEnterDelay,A=t.mouseLeaveDelay,D=void 0===A?.1:A,P=t.focusDelay,W=t.blurDelay,I=t.mask,H=t.maskClosable,F=void 0===H||H,z=t.getPopupContainer,_=t.forceRender,V=t.autoDestroy,X=t.destroyPopupOnHide,Y=t.popup,U=t.popupClassName,q=t.popupStyle,$=t.popupPlacement,J=t.builtinPlacements,Q=void 0===J?{}:J,ee=t.popupAlign,te=t.zIndex,ne=t.stretch,re=t.getPopupClassNameFromAlign,ie=t.fresh,oe=t.alignPoint,le=t.onPopupClick,ae=t.onPopupAlign,se=t.arrow,ue=t.popupMotion,ce=t.maskMotion,fe=t.popupTransitionName,de=t.popupAnimation,he=t.maskTransitionName,pe=t.maskAnimation,ve=t.className,me=t.getTriggerDOMNode,ge=(0,o.Z)(t,G),ye=V||X||!1,be=m.useState(!1),we=(0,i.Z)(be,2),xe=we[0],Ce=we[1];(0,p.Z)((function(){Ce((0,v.Z)())}),[]);var Se=m.useRef({}),Me=m.useContext(k),ke=m.useMemo((function(){return{registerSubPopup:function(e,t){Se.current[e]=t,null==Me||Me.registerSubPopup(e,t)}}}),[Me]),Le=(0,h.Z)(),Ee=m.useState(null),Te=(0,i.Z)(Ee,2),Ne=Te[0],Ze=Te[1],Oe=m.useRef(null),Re=(0,d.Z)((function(e){Oe.current=e,(0,c.Sh)(e)&&Ne!==e&&Ze(e),null==Me||Me.registerSubPopup(Le,e)})),Ae=m.useState(null),De=(0,i.Z)(Ae,2),Pe=De[0],We=De[1],Ie=m.useRef(null),He=(0,d.Z)((function(e){(0,c.Sh)(e)&&Pe!==e&&(We(e),Ie.current=e)})),Fe=m.Children.only(g),ze=(null==Fe?void 0:Fe.props)||{},_e={},Be=(0,d.Z)((function(e){var t,n,r=Pe;return(null==r?void 0:r.contains(e))||(null===(t=(0,f.A)(r))||void 0===t?void 0:t.host)===e||e===r||(null==Ne?void 0:Ne.contains(e))||(null===(n=(0,f.A)(Ne))||void 0===n?void 0:n.host)===e||e===Ne||Object.values(Se.current).some((function(t){return(null==t?void 0:t.contains(e))||e===t}))})),Ve=O(a,ue,de,fe),je=O(a,ce,pe,he),Ke=m.useState(L||!1),Ge=(0,i.Z)(Ke,2),Xe=Ge[0],Ye=Ge[1],Ue=null!=C?C:Xe,qe=(0,d.Z)((function(e){void 0===C&&Ye(e)}));(0,p.Z)((function(){Ye(C||!1)}),[C]);var $e=m.useRef(Ue);$e.current=Ue;var Je=m.useRef([]);Je.current=[];var Qe=(0,d.Z)((function(e){var t;qe(e),(null!==(t=Je.current[Je.current.length-1])&&void 0!==t?t:Ue)!==e&&(Je.current.push(e),null==T||T(e))})),et=m.useRef(),tt=function(){clearTimeout(et.current)},nt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;tt(),0===t?Qe(e):et.current=setTimeout((function(){Qe(e)}),1e3*t)};m.useEffect((function(){return tt}),[]);var rt=m.useState(!1),it=(0,i.Z)(rt,2),ot=it[0],lt=it[1];(0,p.Z)((function(e){e&&!Ue||lt(!0)}),[Ue]);var at=m.useState(null),st=(0,i.Z)(at,2),ut=st[0],ct=st[1],ft=m.useState(null),dt=(0,i.Z)(ft,2),ht=dt[0],pt=dt[1],vt=function(e){pt([e.clientX,e.clientY])},mt=B(Ue,Ne,oe&&null!==ht?ht:Pe,$,Q,ee,ae),gt=(0,i.Z)(mt,11),yt=gt[0],bt=gt[1],wt=gt[2],xt=gt[3],Ct=gt[4],St=gt[5],Mt=gt[6],kt=gt[7],Lt=gt[8],Et=gt[9],Tt=gt[10],Nt=E(xe,b,w,x),Zt=(0,i.Z)(Nt,2),Ot=Zt[0],Rt=Zt[1],At=Ot.has("click"),Dt=Rt.has("click")||Rt.has("contextMenu"),Pt=(0,d.Z)((function(){ot||Tt()}));j(Ue,Pe,Ne,Pt,(function(){$e.current&&oe&&Dt&&nt(!1)})),(0,p.Z)((function(){Pt()}),[ht,$]),(0,p.Z)((function(){!Ue||null!=Q&&Q[$]||Pt()}),[JSON.stringify(ee)]);var Wt=m.useMemo((function(){var e=Z(Q,a,Et,oe);return s()(e,null==re?void 0:re(Et))}),[Et,re,Q,a,oe]);m.useImperativeHandle(n,(function(){return{nativeElement:Ie.current,popupElement:Oe.current,forceAlign:Pt}}));var It=m.useState(0),Ht=(0,i.Z)(It,2),Ft=Ht[0],zt=Ht[1],_t=m.useState(0),Bt=(0,i.Z)(_t,2),Vt=Bt[0],jt=Bt[1],Kt=function(){if(ne&&Pe){var e=Pe.getBoundingClientRect();zt(e.width),jt(e.height)}};function Gt(e,t,n,r){_e[e]=function(i){var o;null==r||r(i),nt(t,n);for(var l=arguments.length,a=new Array(l>1?l-1:0),s=1;s<l;s++)a[s-1]=arguments[s];null===(o=ze[e])||void 0===o||o.call.apply(o,[ze,i].concat(a))}}(0,p.Z)((function(){ut&&(Tt(),ut(),ct(null))}),[ut]),(At||Dt)&&(_e.onClick=function(e){var t;$e.current&&Dt?nt(!1):!$e.current&&At&&(vt(e),nt(!0));for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];null===(t=ze.onClick)||void 0===t||t.call.apply(t,[ze,e].concat(r))});var Xt,Yt,Ut=K(Ue,Dt,Pe,Ne,I,F,Be,nt),qt=Ot.has("hover"),$t=Rt.has("hover");qt&&(Gt("onMouseEnter",!0,R,(function(e){vt(e)})),Gt("onPointerEnter",!0,R,(function(e){vt(e)})),Xt=function(e){(Ue||ot)&&null!=Ne&&Ne.contains(e.target)&&nt(!0,R)},oe&&(_e.onMouseMove=function(e){var t;null===(t=ze.onMouseMove)||void 0===t||t.call(ze,e)})),$t&&(Gt("onMouseLeave",!1,D),Gt("onPointerLeave",!1,D),Yt=function(){nt(!1,D)}),Ot.has("focus")&&Gt("onFocus",!0,P),Rt.has("focus")&&Gt("onBlur",!1,W),Ot.has("contextMenu")&&(_e.onContextMenu=function(e){var t;$e.current&&Rt.has("contextMenu")?nt(!1):(vt(e),nt(!0)),e.preventDefault();for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];null===(t=ze.onContextMenu)||void 0===t||t.call.apply(t,[ze,e].concat(r))}),ve&&(_e.className=s()(ze.className,ve));var Jt=m.useRef(!1);Jt.current||(Jt.current=_||Ue||ot);var Qt=(0,r.Z)((0,r.Z)({},ze),_e),en={};["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"].forEach((function(e){ge[e]&&(en[e]=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];null===(t=Qt[e])||void 0===t||t.call.apply(t,[Qt].concat(r)),ge[e].apply(ge,r)})}));var tn=m.cloneElement(Fe,(0,r.Z)((0,r.Z)({},Qt),en)),nn={x:St,y:Mt},rn=se?(0,r.Z)({},!0!==se?se:{}):null;return m.createElement(m.Fragment,null,m.createElement(u.Z,{disabled:!Ue,ref:He,onResize:function(){Kt(),Pt()}},m.createElement(M,{getTriggerDOMNode:me},tn)),Jt.current&&m.createElement(k.Provider,{value:ke},m.createElement(S,{portal:e,ref:Re,prefixCls:a,popup:Y,className:s()(U,Wt),style:q,target:Pe,onMouseEnter:Xt,onMouseLeave:Yt,onPointerEnter:Xt,zIndex:te,open:Ue,keepDom:ot,fresh:ie,onClick:le,onPointerDownCapture:Ut,mask:I,motion:Ve,maskMotion:je,onVisibleChanged:function(e){lt(!1),Tt(),null==N||N(e)},onPrepare:function(){return new Promise((function(e){Kt(),ct((function(){return e}))}))},forceRender:_,autoDestroy:ye,getPopupContainer:z,align:Et,arrow:rn,arrowPos:nn,ready:yt,offsetX:bt,offsetY:wt,offsetR:xt,offsetB:Ct,onAlign:Pt,stretch:ne,targetWidth:Ft/kt,targetHeight:Vt/Lt})))}));return t}(l.Z)},6233:function(e,t,n){"use strict";n.d(t,{t:function(){return d}});var r=n(82242),i=n.n(r),o=(n(59301),n(99571)),l="buttonFixed___vyq30",a="button___hxmYv",s="buttonWrap___uK8dl",u=n(92310),c=n.n(u),f=n(37712),d=function(e){var t=e.cancelText,n=void 0===t?"取消":t,r=e.okText,u=void 0===r?"确定":r,d=e.loading,h=void 0!==d&&d,p=e.hasOkBtn,v=void 0===p||p,m=e.hasCancelBtn,g=void 0===m||m,y=e.okButtonProps,b=void 0===y?{}:y,w=e.onCancel,x=void 0===w?function(){}:w,C=e.onOk,S=void 0===C?function(){}:C,M=e.className,k=void 0===M?"":M;return(0,f.jsx)("div",{className:c()(l,k),children:(0,f.jsxs)("div",{className:s,children:[g&&(0,f.jsx)(o.ZP,{size:"middle",className:"".concat(a," mr20"),onClick:x,children:n}),v&&(0,f.jsx)(o.ZP,i()(i()({size:"middle",type:"primary",className:"".concat(a," mr20"),loading:h,onClick:S},b),{},{children:u}))]})})}},2747:function(e,t,n){"use strict";n.d(t,{h:function(){return g}});var r=n(82242),i=n.n(r),o=n(79800),l=n.n(o),a=n(59301),s=n(82326),u=n(28284),c=n(99571),f=n(89780),d=n.n(f),h=(n(78318),n(44084),n(37712)),p=s.default.Option,v={labelCol:{span:4},wrapperCol:{span:20}},m={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function g(e){var t=e.value,n=e.onChange,r=e.mode,o=e.options,s=void 0===o?{}:o,u=(0,a.useRef)(),c=(0,a.useState)(),f=l()(c,2),p=f[0],v=f[1];return(0,a.useEffect)((function(){if(p){var e=function(e){var t=e.getValue();n&&n(t)};return p.on("change",e),function(){p.off("change",e)}}}),[p,n]),(0,a.useEffect)((function(){p&&p.setOption("mode",r)}),[p,r]),(0,a.useEffect)((function(){p&&(t===p.getValue()&&""!==t||setTimeout((function(){p.setValue(t||"")}),300))}),[p,t]),(0,a.useEffect)((function(){if(u.current&&!p){var e=d().fromTextArea(u.current,i()({mode:r,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},s));v(e)}}),[u.current,p]),(0,h.jsx)("div",{className:"my-codemirror-container",children:(0,h.jsx)("textarea",{ref:u})})}t.Z=function(e){var t=e.callback,n=e.onCancel,r=(0,a.useState)("python"),o=l()(r,2),f=o[0],d=o[1];return(0,h.jsxs)(u.Z,i()(i()({},v),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)},style:{width:500},children:[(0,h.jsx)(u.Z.Item,{label:"代码语言",name:"language",children:(0,h.jsx)(s.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){d(m[e][1])},children:Object.keys(m).map((function(e){return(0,h.jsx)(p,{value:e,children:m[e][0]},e)}))})}),(0,h.jsx)(u.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,h.jsx)(g,{mode:f})}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(c.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(c.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))}},17997:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return k}});var r=n(82242),i=n.n(r),o=n(7557),l=n.n(o),a=n(41498),s=n.n(a),u=n(79800),c=n.n(u),f=n(39647),d=n.n(f),h=n(59301),p=n(5030),v=n(28284),m=n(37568),g=n(2747),y=n(6233),b="bg___YV4bB",w="wrap___kzW1f",x="title___qum64",C="width240___QOLSj",S=n(37712),M=["shixunsDetail","globalSetting","loading","user","dispatch"],k=(0,p.connect)((function(e){var t=e.shixunsDetail,n=e.loading;return{shixunsDetail:t,globalSetting:e.globalSetting,user:e.user,loading:n.models.index}}))((function(e){e.shixunsDetail,e.globalSetting,e.loading,e.user;var t=e.dispatch,n=(d()(e,M),(0,p.useLocation)()),r=(0,h.useState)({}),o=c()(r,2),a=(o[0],o[1]),u=(0,h.useRef)(),f=(0,h.useRef)(),k=v.Z.useForm(),L=c()(k,1)[0],E=(0,h.useState)(""),T=c()(E,2),N=T[0],Z=T[1];(0,h.useEffect)((function(){return t({type:"globalSetting/footerToggle",payload:!1}),function(){t({type:"globalSetting/footerToggle",payload:!0})}}),[]),(0,h.useEffect)((function(){var e=sessionStorage.getItem("pathArray");if(e){var t=e.split(",").join("/"),n=0===t.indexOf("/")?t.substr(1):t;Z(n)}}),[]),(0,h.useEffect)((function(){var e,t;f.current=null===(e=n.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[2],u.current="repository"===(null===(t=n.pathname)||void 0===t||null===(t=t.split("/"))||void 0===t?void 0:t[3])}),[]);var O=function(){var e=s()(l()().mark((function e(){var n,r,i=arguments;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>0&&void 0!==i[0]?i[0]:{},e.next=3,t({type:"shixunsDetail/addRepositoryFile",payload:{id:f.current,message:n.commitMessage,content:n.codeMirror,path:"".concat(N?"".concat(N,"/"):"").concat(n.path||""),secret_repository:!u.current||void 0}});case 3:e.sent&&(r=u.current?"/shixuns/".concat(f.current,"/repository").concat(N?"/master/shixun_show/".concat(N):""):"/shixuns/".concat(f.current,"/secret_repository"),p.history.replace(r));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,S.jsx)("section",{className:b,children:(0,S.jsxs)("div",{className:w,children:[(0,S.jsx)("div",{className:x,children:"新建文件"}),(0,S.jsxs)(v.Z,{className:"mt10",form:L,scrollToFirstError:!0,layout:"vertical",onFinish:O,onValuesChange:function(){return a(i()({},L.getFieldsValue()))},children:[(0,S.jsxs)(v.Z.Item,{label:"文件名称或文件路径:",children:[(0,S.jsx)(v.Z.Item,{name:"path",rules:[{required:!0,message:"请输入文件名称或文件路径"},{whitespace:!0,message:"请勿输入空格"}],noStyle:!0,children:(0,S.jsxs)("span",{children:[(0,S.jsx)("span",{className:"mr5",children:N?"".concat(N,"/"):""}),(0,S.jsx)(m.Z,{className:C,placeholder:"请输入文件名称或文件路径"})]})}),(0,S.jsx)("span",{className:"ml5",children:"提示1.输入文件名可以创建一个新文件2.输入新文件夹名/新文件名可以创建新文件夹和新文件。step1/HelloWorld.java"})]}),(0,S.jsx)(v.Z.Item,{label:"提交信息:",name:"commitMessage",rules:[{required:!0,message:"请输入提交信息"},{whitespace:!0,message:"请勿输入空格"}],children:(0,S.jsx)(m.Z,{placeholder:"请输入本次提交的主要信息,合理的描述信息有利于代码历史记录的管理"})}),(0,S.jsx)("div",{className:"mt10 mb20",children:(0,S.jsx)(v.Z.Item,{name:"codeMirror",rules:[{required:!0,message:"请输入文件内容"}],children:(0,S.jsx)(g.h,{options:{modal:"javascript",lineNumbers:!0,theme:"railscasts",indentUnit:4,matchBrackets:!0,autoRefresh:!0,smartIndent:!0,extraKeys:{"Alt-/":"autocomplete"},autofocus:!0,styleActiveLine:!0,lint:!0,linkurl:"",gutters:["CodeMirror-linenumbers","breakpoints","CodeMirror-lint-markers"]}})})}),(0,S.jsx)(v.Z.Item,{noStyle:!0,children:(0,S.jsx)(y.t,{okButtonProps:{htmlType:"submit"},onCancel:function(){var e;p.history.push("/shixuns/".concat(f.current,"/").concat(null===(e=n.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[3]).concat(N?"/master/shixun_show/".concat(N):""))}})})]})]})})}))},78318:function(){},44084:function(){},89780:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=r||i||o,a=l&&(r?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),v=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),m=/Android/.test(e),g=v||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=v||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=f&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,s=!0);var C=y&&(u||f&&(null==x||x<12.11)),S=n||l&&a>=9;function M(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,L=function(e,t){var n=e.className,r=M(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return E(e).appendChild(t)}function N(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Z(e,t,n,r){var i=N(e,t,n,r);return i.setAttribute("role","presentation"),i}function O(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function R(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function A(e,t){var n=e.className;M(t).test(n)||(e.className+=(n?" ":"")+t)}function D(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!M(n[r]).test(t)&&(t+=" "+n[r]);return t}k=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var P=function(e){e.select()};function W(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function H(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,l=i||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}v?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(P=function(e){try{e.select()}catch(e){}});var F=function(){this.id=null,this.f=null,this.time=0,this.handler=W(this.onTimeout,this)};function z(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}F.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},F.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var _=50,B={toString:function(){return"CodeMirror.Pass"}},V={scroll:!1},j={origin:"*mouse"},K={origin:"+move"};function G(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var X=[""];function Y(e){for(;X.length<=e;)X.push(U(X)+" ");return X[e]}function U(e){return e[e.length-1]}function q(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function $(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function J(){}function Q(e,t){var n;return Object.create?n=Object.create(e):(J.prototype=e,n=new J),t&&I(t,n),n}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function te(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function le(e,t,n){for(;(n<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=n;return t}function ae(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function se(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var ue=null;function ce(e,t,n){var r;ue=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ue=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ue=i)}return null!=r?r:ue}var fe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,f=[],d=0;d<c;++d)f.push(n(e.charCodeAt(d)));for(var h=0,p=u;h<c;++h){var v=f[h];"m"==v?f[h]=p:p=v}for(var m=0,g=u;m<c;++m){var y=f[m];"1"==y&&"r"==g?f[m]="n":o.test(y)&&(g=y,"r"==y&&(f[m]="R"))}for(var b=1,w=f[0];b<c-1;++b){var x=f[b];"+"==x&&"1"==w&&"1"==f[b+1]?f[b]="1":","!=x||w!=f[b+1]||"1"!=w&&"n"!=w||(f[b]=w),w=x}for(var C=0;C<c;++C){var S=f[C];if(","==S)f[C]="N";else if("%"==S){var M=void 0;for(M=C+1;M<c&&"%"==f[M];++M);for(var k=C&&"!"==f[C-1]||M<c&&"1"==f[M]?"1":"N",L=C;L<M;++L)f[L]=k;C=M-1}}for(var E=0,T=u;E<c;++E){var N=f[E];"L"==T&&"1"==N?f[E]="L":o.test(N)&&(T=N)}for(var Z=0;Z<c;++Z)if(i.test(f[Z])){var O=void 0;for(O=Z+1;O<c&&i.test(f[O]);++O);for(var R="L"==(Z?f[Z-1]:u),A=R==("L"==(O<c?f[O]:u))?R?"L":"R":u,D=Z;D<O;++D)f[D]=A;Z=O-1}for(var P,W=[],I=0;I<c;)if(l.test(f[I])){var H=I;for(++I;I<c&&l.test(f[I]);++I);W.push(new s(0,H,I))}else{var F=I,z=W.length,_="rtl"==t?1:0;for(++I;I<c&&"L"!=f[I];++I);for(var B=F;B<I;)if(a.test(f[B])){F<B&&(W.splice(z,0,new s(1,F,B)),z+=_);var V=B;for(++B;B<I&&a.test(f[B]);++B);W.splice(z,0,new s(2,V,B)),z+=_,F=B}else++B;F<I&&W.splice(z,0,new s(1,F,I))}return"ltr"==t&&(1==W[0].level&&(P=e.match(/^\s+/))&&(W[0].from=P[0].length,W.unshift(new s(0,0,P[0].length))),1==U(W).level&&(P=e.match(/\s+$/))&&(U(W).to-=P[0].length,W.push(new s(0,c-P[0].length,c)))),"rtl"==t?W.reverse():W}}();function de(e,t){var n=e.order;return null==n&&(n=e.order=fe(e.text,t)),n}var he=[],pe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||he).concat(n)}};function ve(e,t){return e._handlers&&e._handlers[t]||he}function me(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=z(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ge(e,t){var n=ve(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function ye(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ge(e,n||t.type,e,t),Me(t)||t.codemirrorIgnore}function be(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==z(n,t[r])&&n.push(t[r])}function we(e,t){return ve(e,t).length>0}function xe(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){me(this,e,t)}}function Ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Me(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ke(e){Ce(e),Se(e)}function Le(e){return e.target||e.srcElement}function Ee(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Te,Ne,Ze=function(){if(l&&a<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function Oe(e){if(null==Te){var t=N("span","");T(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Te=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&a<8))}var n=Te?N("span",""):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Re(e){if(null!=Ne)return Ne;var t=T(e,document.createTextNode("AخA")),n=k(t,0,1).getBoundingClientRect(),r=k(t,1,2).getBoundingClientRect();return E(e),!(!n||n.left==n.right)&&(Ne=r.right-n.right<3)}var Ae,De=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Pe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},We="oncopy"in(Ae=N("div"))||(Ae.setAttribute("oncopy","return;"),"function"==typeof Ae.oncopy),Ie=null;function He(e){if(null!=Ie)return Ie;var t=T(e,N("span","x")),n=t.getBoundingClientRect(),r=k(t,0,1).getBoundingClientRect();return Ie=Math.abs(n.left-r.left)>1}var Fe={},ze={};function _e(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Fe[e]=t}function Be(e,t){ze[e]=t}function Ve(e){if("string"==typeof e&&ze.hasOwnProperty(e))e=ze[e];else if(e&&"string"==typeof e.name&&ze.hasOwnProperty(e.name)){var t=ze[e.name];"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function je(e,t){t=Ve(t);var n=Fe[t.name];if(!n)return je(e,"text/plain");var r=n(e,t);if(Ke.hasOwnProperty(t.name)){var i=Ke[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var Ke={};function Ge(e,t){I(t,Ke.hasOwnProperty(e)?Ke[e]:Ke[e]={})}function Xe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ye(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ue(e,t,n){return!e.startState||e.startState(t,n)}var qe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function $e(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Je(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function Qe(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function et(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function tt(e){if(null==e.parent)return null;for(var t=e.parent,n=z(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function nt(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l].height;if(t<a)break;t-=a}return n+l}function rt(e,t){return t>=e.first&&t<e.first+e.size}function it(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ot(e,t,n){if(void 0===n&&(n=null),!(this instanceof ot))return new ot(e,t,n);this.line=e,this.ch=t,this.sticky=n}function lt(e,t){return e.line-t.line||e.ch-t.ch}function at(e,t){return e.sticky==t.sticky&&0==lt(e,t)}function st(e){return ot(e.line,e.ch)}function ut(e,t){return lt(e,t)<0?t:e}function ct(e,t){return lt(e,t)<0?e:t}function ft(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function dt(e,t){if(t.line<e.first)return ot(e.first,0);var n=e.first+e.size-1;return t.line>n?ot(n,$e(e,n).text.length):ht(t,$e(e,t.line).text.length)}function ht(e,t){var n=e.ch;return null==n||n>t?ot(e.line,t):n<0?ot(e.line,0):e}function pt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=dt(e,t[r]);return n}qe.prototype.eol=function(){return this.pos>=this.string.length},qe.prototype.sol=function(){return this.pos==this.lineStart},qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},qe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},qe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},qe.prototype.skipToEnd=function(){this.pos=this.string.length},qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},qe.prototype.backUp=function(e){this.pos-=e},qe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},qe.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},qe.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var vt=function(e,t){this.state=e,this.lookAhead=t},mt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function gt(e,t,n,r){var i=[e.state.modeGen],o={};Lt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var l=n.state,a=function(r){n.baseTokens=i;var a=e.state.overlays[r],s=1,u=0;n.state=!0,Lt(e,t.text,a.mode,n,(function(e,t){for(var n=s;u<e;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,u=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=l,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function yt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=bt(e,tt(t)),i=t.text.length>e.options.maxHighlightLength&&Xe(e.doc.mode,r.state),o=gt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function bt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new mt(r,!0,t);var o=Et(e,t,n),l=o>r.first&&$e(r,o-1).stateAfter,a=l?mt.fromSaved(r,l,o):new mt(r,Ue(r.mode),o);return r.iter(o,t,(function(n){wt(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?a.save():null,a.nextLine()})),n&&(r.modeFrontier=a.line),a}function wt(e,t,n,r){var i=e.doc.mode,o=new qe(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&xt(i,n.state);!o.eol();)Ct(i,o,n.state),o.start=o.pos}function xt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ye(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Ct(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ye(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}mt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},mt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},mt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},mt.fromSaved=function(e,t,n){return t instanceof vt?new mt(e,Xe(e.mode,t.state),n,t.lookAhead):new mt(e,Xe(e.mode,t),n)},mt.prototype.save=function(e){var t=!1!==e?Xe(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new vt(t,this.maxLookAhead):t};var St=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Mt(e,t,n,r){var i,o,l=e.doc,a=l.mode,s=$e(l,(t=dt(l,t)).line),u=bt(e,t.line,n),c=new qe(s.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=Ct(a,c,u.state),r&&o.push(new St(c,i,Xe(l.mode,u.state)));return r?o:new St(c,i,u.state)}function kt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Lt(e,t,n,r,i,o,l){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var s,u=0,c=null,f=new qe(t,e.options.tabSize,r),d=e.options.addModeClass&&[null];for(""==t&&kt(xt(n,r.state),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(a=!1,l&&wt(e,t,r,f.pos),f.pos=t.length,s=null):s=kt(Ct(n,f,r.state,d),o),d){var h=d[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!a||c!=s){for(;u<f.start;)i(u=Math.min(f.start,u+5e3),c);c=s}f.start=f.pos}for(;u<f.pos;){var p=Math.min(f.pos,u+5e3);i(p,c),u=p}}function Et(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=$e(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof vt?u.lookAhead:0)<=o.modeFrontier))return a;var c=H(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=a-1,r=c)}return i}function Tt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=$e(e,r).stateAfter;if(i&&(!(i instanceof vt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Nt=!1,Zt=!1;function Ot(){Nt=!0}function Rt(){Zt=!0}function At(e,t,n){this.marker=e,this.from=t,this.to=n}function Dt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Pt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Wt(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function It(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==l.type&&(!n||!o.marker.insertLeft)){var a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new At(l,o.from,a?null:o.to))}}return r}function Ht(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.to||(l.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new At(l,a?null:o.from-t,null==o.to?null:o.to-t))}}return r}function Ft(e,t){if(t.full)return null;var n=rt(e,t.from.line)&&$e(e,t.from.line).markedSpans,r=rt(e,t.to.line)&&$e(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=0==lt(t.from,t.to),a=It(n,i,l),s=Ht(r,o,l),u=1==t.text.length,c=U(t.text).length+(u?i:0);if(a)for(var f=0;f<a.length;++f){var d=a[f];if(null==d.to){var h=Dt(s,d.marker);h?u&&(d.to=null==h.to?null:h.to+c):d.to=i}}if(s)for(var p=0;p<s.length;++p){var v=s[p];null!=v.to&&(v.to+=c),null==v.from?Dt(a,v.marker)||(v.from=c,u&&(a||(a=[])).push(v)):(v.from+=c,u&&(a||(a=[])).push(v))}a&&(a=zt(a)),s&&s!=a&&(s=zt(s));var m=[a];if(!u){var g,y=t.text.length-2;if(y>0&&a)for(var b=0;b<a.length;++b)null==a[b].to&&(g||(g=[])).push(new At(a[b].marker,null,null));for(var w=0;w<y;++w)m.push(g);m.push(s)}return m}function zt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function _t(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=z(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(lt(u.to,a.from)<0||lt(u.from,a.to)>0)){var c=[s,1],f=lt(u.from,a.from),d=lt(u.to,a.to);(f<0||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:a.from}),(d>0||!l.inclusiveRight&&!d)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}function Bt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Vt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function jt(e){return e.inclusiveLeft?-1:0}function Kt(e){return e.inclusiveRight?1:0}function Gt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=lt(r.from,i.from)||jt(e)-jt(t);if(o)return-o;var l=lt(r.to,i.to)||Kt(e)-Kt(t);return l||t.id-e.id}function Xt(e,t){var n,r=Zt&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Gt(n,i.marker)<0)&&(n=i.marker);return n}function Yt(e){return Xt(e,!0)}function Ut(e){return Xt(e,!1)}function qt(e,t){var n,r=Zt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Gt(n,o.marker)<0)&&(n=o.marker)}return n}function $t(e,t,n,r,i){var o=$e(e,t),l=Zt&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var u=s.marker.find(0),c=lt(u.from,n)||jt(s.marker)-jt(i),f=lt(u.to,r)||Kt(s.marker)-Kt(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?lt(u.to,n)>=0:lt(u.to,n)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?lt(u.from,r)<=0:lt(u.from,r)<0)))return!0}}}function Jt(e){for(var t;t=Yt(e);)e=t.find(-1,!0).line;return e}function Qt(e){for(var t;t=Ut(e);)e=t.find(1,!0).line;return e}function en(e){for(var t,n;t=Ut(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function tn(e,t){var n=$e(e,t),r=Jt(n);return n==r?t:tt(r)}function nn(e,t){if(t>e.lastLine())return t;var n,r=$e(e,t);if(!rn(e,r))return t;for(;n=Ut(r);)r=n.find(1,!0).line;return tt(r)+1}function rn(e,t){var n=Zt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&on(e,t,r))return!0}}function on(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return on(e,r.line,Dt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&on(e,t,i))return!0}function ln(e){for(var t=0,n=(e=Jt(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==n)break;t+=a.height}return t}function an(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Yt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=Ut(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function sn(e){var t=e.display,n=e.doc;t.maxLine=$e(n,n.first),t.maxLineLength=an(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=an(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var un=function(e,t,n){this.text=e,Vt(this,t),this.height=n?n(this):1};function cn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Bt(e),Vt(e,n);var i=r?r(e):1;i!=e.height&&et(e,i)}function fn(e){e.parent=null,Bt(e)}un.prototype.lineNo=function(){return tt(this)},xe(un);var dn={},hn={};function pn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?hn:dn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function vn(e,t){var n=Z("span",null,null,s?"padding-right: .1px":null),r={pre:Z("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=gn,Re(e.display.measure)&&(l=de(o,e.doc.direction))&&(r.addToken=bn(r.addToken,l)),r.map=[],xn(o,r,yt(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=D(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=D(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Oe(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var a=r.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ge(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=D(r.pre.className,r.textClass||"")),r}function mn(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gn(e,t,n,r,i,o,s){if(t){var u,c=e.splitSpaces?yn(t,e.trailingSpace):t,f=e.cm.state.specialChars,d=!1;if(f.test(t)){u=document.createDocumentFragment();for(var h=0;;){f.lastIndex=h;var p=f.exec(t),v=p?p.index-h:t.length-h;if(v){var m=document.createTextNode(c.slice(h,h+v));l&&a<9?u.appendChild(N("span",[m])):u.appendChild(m),e.map.push(e.pos,e.pos+v,m),e.col+=v,e.pos+=v}if(!p)break;h+=v+1;var g=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(g=u.appendChild(N("span",Y(b),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((g=u.appendChild(N("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),l&&a<9?u.appendChild(N("span",[g])):u.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),l&&a<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||d||o||s){var w=n||"";r&&(w+=r),i&&(w+=i);var x=N("span",[u],w,o);if(s)for(var C in s)s.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,s[C]);return e.content.appendChild(x)}e.content.appendChild(u)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}function bn(e,t){return function(n,r,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var f=void 0,d=0;d<t.length&&!((f=t[d]).to>u&&f.from<=u);d++);if(f.to>=c)return e(n,r,i,o,l,a,s);e(n,r.slice(0,f.to-u),i,o,null,a,s),o=null,r=r.slice(f.to-u),u=f.to}}}function wn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function xn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var l,a,s,u,c,f,d,h=i.length,p=0,v=1,m="",g=0;;){if(g==p){s=u=c=a="",d=null,f=null,g=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==p&&C.widgetNode)y.push(C);else if(x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&g>x.to&&(g=x.to,u=""),C.className&&(s+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==g&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var S in C.attributes)(d||(d={}))[S]=C.attributes[S];C.collapsed&&(!f||Gt(f.marker,C)<0)&&(f=x)}else x.from>p&&g>x.from&&(g=x.from)}if(b)for(var M=0;M<b.length;M+=2)b[M+1]==g&&(u+=" "+b[M]);if(!f||f.from==p)for(var k=0;k<y.length;++k)wn(t,0,y[k]);if(f&&(f.from||0)==p){if(wn(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=h)break;for(var L=Math.min(h,g);;){if(m){var E=p+m.length;if(!f){var T=E>L?m.slice(0,L-p):m;t.addToken(t,T,l?l+s:s,c,p+T.length==g?u:"",a,d)}if(E>=L){m=m.slice(L-p),p=L;break}p=E,c=""}m=i.slice(o,o=n[v++]),l=pn(n[v++],t.cm.options)}}else for(var N=1;N<n.length;N+=2)t.addToken(t,i.slice(o,o=n[N]),pn(n[N+1],t.cm.options))}function Cn(e,t,n){this.line=t,this.rest=en(t),this.size=this.rest?tt(U(this.rest))-n+1:1,this.node=this.text=null,this.hidden=rn(e,t)}function Sn(e,t,n){for(var r,i=[],o=t;o<n;o=r){var l=new Cn(e.doc,$e(e.doc,o),o);r=o+l.size,i.push(l)}return i}var Mn=null;function kn(e){Mn?Mn.ops.push(e):e.ownsGroup=Mn={ops:[e],delayedCallbacks:[]}}function Ln(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function En(e,t){var n=e.ownsGroup;if(n)try{Ln(n)}finally{Mn=null,t(n)}}var Tn=null;function Nn(e,t){var n=ve(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);Mn?r=Mn.delayedCallbacks:Tn?r=Tn:(r=Tn=[],setTimeout(Zn,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},l=0;l<n.length;++l)o(l)}}function Zn(){var e=Tn;Tn=null;for(var t=0;t<e.length;++t)e[t]()}function On(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Pn(e,t):"gutter"==o?In(e,t,n,r):"class"==o?Wn(e,t):"widget"==o&&Hn(e,t,r)}t.changes=null}function Rn(e){return e.node==e.text&&(e.node=N("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),l&&a<8&&(e.node.style.zIndex=2)),e.node}function An(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Rn(t);t.background=r.insertBefore(N("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Dn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):vn(e,t)}function Pn(e,t){var n=t.text.className,r=Dn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Wn(e,t)):n&&(t.text.className=n)}function Wn(e,t){An(e,t),t.line.wrapClass?Rn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function In(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Rn(t);t.gutterBackground=N("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=Rn(t),a=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(N("div",it(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,c=o.hasOwnProperty(u)&&o[u];c&&a.appendChild(N("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Hn(e,t,n){t.alignable&&(t.alignable=null);for(var r=M("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);zn(e,t,n)}function Fn(e,t,n,r){var i=Dn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Wn(e,t),In(e,t,n,r),zn(e,t,r),t.node}function zn(e,t,n){if(_n(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)_n(e,t.rest[r],t,n,!1)}function _n(e,t,n,r,i){if(t.widgets)for(var o=Rn(n),l=0,a=t.widgets;l<a.length;++l){var s=a[l],u=N("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Bn(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),Nn(s,"redraw")}}function Bn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Vn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!O(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),T(t.display.measure,N("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function jn(e,t){for(var n=Le(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Kn(e){return e.lineSpace.offsetTop}function Gn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Xn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,N("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Yn(e){return _-e.display.nativeBarWidth}function Un(e){return e.display.scroller.clientWidth-Yn(e)-e.display.barWidth}function qn(e){return e.display.scroller.clientHeight-Yn(e)-e.display.barHeight}function $n(e,t,n){var r=e.options.lineWrapping,i=r&&Un(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],u=l[a+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(tt(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Qn(e,t){var n=tt(t=Jt(t)),r=e.display.externalMeasured=new Cn(e.doc,t,n);r.lineN=n;var i=r.built=vn(e,r);return r.text=i.pre,T(e.display.lineMeasure,i.pre),r}function er(e,t,n,r){return rr(e,nr(e,t),n,r)}function tr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Wr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function nr(e,t){var n=tt(t),r=tr(e,n);r&&!r.text?r=null:r&&r.changes&&(On(e,r,n,Or(e)),e.curOp.forceUpdate=!0),r||(r=Qn(e,t));var i=Jn(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function rr(e,t,n,r,i){t.before&&(n=-1);var o,l=n+(r||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||($n(e,t.view,t.rect),t.hasHeights=!0),(o=sr(e,t,n,r)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var ir,or={left:0,right:0,top:0,bottom:0};function lr(e,t,n){for(var r,i,o,l,a,s,u=0;u<e.length;u+=3)if(a=e[u],s=e[u+1],t<a?(i=0,o=1,l="left"):t<s?o=1+(i=t-a):(u==e.length-3||t==s&&e[u+3]>t)&&(i=(o=s-a)-1,t>=s&&(l="right")),null!=i){if(r=e[u+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],l="left";if("right"==n&&i==s-a)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],l="right";break}return{node:r,start:i,end:o,collapse:l,coverStart:a,coverEnd:s}}function ar(e,t){var n=or;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function sr(e,t,n,r){var i,o=lr(t.map,n,r),s=o.node,u=o.start,c=o.end,f=o.collapse;if(3==s.nodeType){for(var d=0;d<4;d++){for(;u&&oe(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&oe(t.line.text.charAt(o.coverStart+c));)++c;if((i=l&&a<9&&0==u&&c==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():ar(k(s,u,c).getClientRects(),r)).left||i.right||0==u)break;c=u,u-=1,f="right"}l&&a<11&&(i=ur(e.display.measure,i))}else{var h;u>0&&(f=r="right"),i=e.options.lineWrapping&&(h=s.getClientRects()).length>1?h["right"==r?h.length-1:0]:s.getBoundingClientRect()}if(l&&a<9&&!u&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Zr(e.display),top:p.top,bottom:p.bottom}:or}for(var v=i.top-t.rect.top,m=i.bottom-t.rect.top,g=(v+m)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(g<y[b]);b++);var w=b?y[b-1]:0,x=y[b],C={left:("right"==f?i.right:i.left)-t.rect.left,right:("left"==f?i.left:i.right)-t.rect.left,top:w,bottom:x};return i.left||i.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=v,C.rbottom=m),C}function ur(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!He(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function cr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function fr(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)cr(e.display.view[t])}function dr(e){fr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function hr(){return c&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function pr(){return c&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function vr(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Vn(e.widgets[n]));return t}function mr(e,t,n,r,i){if(!i){var o=vr(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var l=ln(t);if("local"==r?l+=Kn(e.display):l-=e.display.viewOffset,"page"==r||"window"==r){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+("window"==r?0:pr());var s=a.left+("window"==r?0:hr());n.left+=s,n.right+=s}return n.top+=l,n.bottom+=l,n}function gr(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=hr(),i-=pr();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:i-l.top}}function yr(e,t,n,r,i){return r||(r=$e(e.doc,t.line)),mr(e,r,er(e,r,t.ch,i),n)}function br(e,t,n,r,i,o){function l(t,l){var a=rr(e,i,t,l?"right":"left",o);return l?a.left=a.right:a.right=a.left,mr(e,r,a,n)}r=r||$e(e.doc,t.line),i||(i=nr(e,r));var a=de(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l("before"==u?s-1:s,"before"==u);function c(e,t,n){return l(n?e-1:e,1==a[t].level!=n)}var f=ce(a,s,u),d=ue,h=c(s,f,"before"==u);return null!=d&&(h.other=c(s,d,"before"!=u)),h}function wr(e,t){var n=0;t=dt(e.doc,t),e.options.lineWrapping||(n=Zr(e.display)*t.ch);var r=$e(e.doc,t.line),i=ln(r)+Kn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function xr(e,t,n,r,i){var o=ot(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Cr(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return xr(r.first,0,null,-1,-1);var i=nt(r,n),o=r.first+r.size-1;if(i>o)return xr(r.first+r.size-1,$e(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=$e(r,i);;){var a=Lr(e,l,i,t,n),s=qt(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=$e(r,i=u.line)}}function Sr(e,t,n,r){r-=vr(t);var i=t.text.length,o=ae((function(t){return rr(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=ae((function(t){return rr(e,n,t).top>r}),o,i)}}function Mr(e,t,n,r){return n||(n=nr(e,t)),Sr(e,t,n,mr(e,t,rr(e,n,r),"line").top)}function kr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Lr(e,t,n,r,i){i-=ln(t);var o=nr(e,t),l=vr(t),a=0,s=t.text.length,u=!0,c=de(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?Tr:Er)(e,t,n,o,c,r,i);a=(u=1!=f.level)?f.from:f.to-1,s=u?f.to:f.from-1}var d,h,p=null,v=null,m=ae((function(t){var n=rr(e,o,t);return n.top+=l,n.bottom+=l,!!kr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,v=n),!0)}),a,s),g=!1;if(v){var y=r-v.left<v.right-r,b=y==u;m=p+(b?0:1),h=b?"after":"before",d=y?v.left:v.right}else{u||m!=s&&m!=a||m++,h=0==m?"after":m==t.text.length?"before":rr(e,o,m-(u?1:0)).bottom+l<=i==u?"after":"before";var w=br(e,ot(n,m,h),"line",t,o);d=w.left,g=i<w.top?-1:i>=w.bottom?1:0}return xr(n,m=le(t.text,m,1),h,g,r-d)}function Er(e,t,n,r,i,o,l){var a=ae((function(a){var s=i[a],u=1!=s.level;return kr(br(e,ot(n,u?s.to:s.from,u?"before":"after"),"line",t,r),o,l,!0)}),0,i.length-1),s=i[a];if(a>0){var u=1!=s.level,c=br(e,ot(n,u?s.from:s.to,u?"after":"before"),"line",t,r);kr(c,o,l,!0)&&c.top>l&&(s=i[a-1])}return s}function Tr(e,t,n,r,i,o,l){var a=Sr(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,f=null,d=0;d<i.length;d++){var h=i[d];if(!(h.from>=u||h.to<=s)){var p=rr(e,r,1!=h.level?Math.min(u,h.to)-1:Math.max(s,h.from)).right,v=p<o?o-p+1e9:p-o;(!c||f>v)&&(c=h,f=v)}}return c||(c=i[i.length-1]),c.from<s&&(c={from:s,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function Nr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ir){ir=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ir.appendChild(document.createTextNode("x")),ir.appendChild(N("br"));ir.appendChild(document.createTextNode("x"))}T(e.measure,ir);var n=ir.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),E(e.measure),n||1}function Zr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),n=N("pre",[t],"CodeMirror-line-like");T(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Or(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Rr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Rr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ar(e){var t=Nr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Zr(e.display)-3);return function(i){if(rn(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Dr(e){var t=e.doc,n=Ar(e);t.iter((function(e){var t=n(e);t!=e.height&&et(e,t)}))}function Pr(e,t,n,r){var i=e.display;if(!n&&"true"==Le(t).getAttribute("cm-not-content"))return null;var o,l,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,l=t.clientY-a.top}catch(e){return null}var s,u=Cr(e,o,l);if(r&&u.xRel>0&&(s=$e(e.doc,u.line).text).length==u.ch){var c=H(s,s.length,e.options.tabSize)-s.length;u=ot(u.line,Math.max(0,Math.round((o-Xn(e.display).left)/Zr(e.display))-c))}return u}function Wr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function Ir(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Zt&&tn(e.doc,t)<i.viewTo&&Fr(e);else if(n<=i.viewFrom)Zt&&nn(e.doc,n+r)>i.viewFrom?Fr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Fr(e);else if(t<=i.viewFrom){var o=zr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Fr(e)}else if(n>=i.viewTo){var l=zr(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):Fr(e)}else{var a=zr(e,t,t,-1),s=zr(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(Sn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):Fr(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function Hr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Wr(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==z(l,n)&&l.push(n)}}}function Fr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zr(e,t,n,r){var i,o=Wr(e,t),l=e.display.view;if(!Zt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,s=0;s<o;s++)a+=l[s].size;if(a!=t){if(r>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,n+=i}for(;tn(e.doc,n)!=n;){if(o==(r<0?0:l.length-1))return null;n+=r*l[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function _r(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Sn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Sn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Wr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Sn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Wr(e,n)))),r.viewTo=n}function Br(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function Vr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function jr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),l=0;l<n.sel.ranges.length;l++)if(t||l!=n.sel.primIndex){var a=n.sel.ranges[l];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var s=a.empty();(s||e.options.showCursorWhenSelecting)&&Kr(e,a.head,i),s||Xr(e,a,o)}}return r}function Kr(e,t,n){var r=br(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(N("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Gr(e,t){return e.top-t.top||e.left-t.left}function Xr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=Xn(e.display),a=l.left,s=Math.max(r.sizerWidth,Un(e)-r.sizer.offsetLeft)-l.right,u="ltr"==i.direction;function c(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?s-e:n)+"px;\n height: "+(r-t)+"px"))}function f(t,n,r){var o,l,f=$e(i,t),d=f.text.length;function h(n,r){return yr(e,ot(t,n),"div",f,r)}function p(t,n,r){var i=Mr(e,f,null,t),o="ltr"==n==("after"==r)?"left":"right";return h("after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var v=de(f,i.direction);return se(v,n||0,null==r?d:r,(function(e,t,i,f){var m="ltr"==i,g=h(e,m?"left":"right"),y=h(t-1,m?"right":"left"),b=null==n&&0==e,w=null==r&&t==d,x=0==f,C=!v||f==v.length-1;if(y.top-g.top<=3){var S=(u?w:b)&&C,M=(u?b:w)&&x?a:(m?g:y).left,k=S?s:(m?y:g).right;c(M,g.top,k-M,g.bottom)}else{var L,E,T,N;m?(L=u&&b&&x?a:g.left,E=u?s:p(e,i,"before"),T=u?a:p(t,i,"after"),N=u&&w&&C?s:y.right):(L=u?p(e,i,"before"):a,E=!u&&b&&x?s:g.right,T=!u&&w&&C?a:y.left,N=u?p(t,i,"after"):s),c(L,g.top,E-L,g.bottom),g.bottom<y.top&&c(a,g.bottom,null,y.top),c(T,y.top,N-T,y.bottom)}(!o||Gr(g,o)<0)&&(o=g),Gr(y,o)<0&&(o=y),(!l||Gr(g,l)<0)&&(l=g),Gr(y,l)<0&&(l=y)})),{start:o,end:l}}var d=t.from(),h=t.to();if(d.line==h.line)f(d.line,d.ch,h.ch);else{var p=$e(i,d.line),v=$e(i,h.line),m=Jt(p)==Jt(v),g=f(d.line,d.ch,m?p.text.length+1:null).end,y=f(h.line,m?0:null,h.ch).start;m&&(g.top<y.top-2?(c(g.right,g.top,null,g.bottom),c(a,y.top,y.left,y.bottom)):c(g.right,g.top,y.left-g.right,g.bottom)),g.bottom<y.top&&c(a,g.bottom,null,y.top)}n.appendChild(o)}function Yr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ur(e){e.state.focused||(e.display.input.focus(),$r(e))}function qr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Jr(e))}),100)}function $r(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ge(e,"focus",e,t),e.state.focused=!0,A(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Yr(e))}function Jr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ge(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Qr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,s=void 0,u=0;if(!i.hidden){if(l&&a<8){var c=i.node.offsetTop+i.node.offsetHeight;s=c-n,n=c}else{var f=i.node.getBoundingClientRect();s=f.bottom-f.top,!o&&i.text.firstChild&&(u=i.text.firstChild.getBoundingClientRect().right-f.left-1)}var d=i.line.height-s;if((d>.005||d<-.005)&&(et(i.line,s),ei(i.line),i.rest))for(var h=0;h<i.rest.length;h++)ei(i.rest[h]);if(u>e.display.sizerWidth){var p=Math.ceil(u/Zr(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function ei(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function ti(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Kn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=nt(t,r),l=nt(t,i);if(n&&n.ensure){var a=n.ensure.from.line,s=n.ensure.to.line;a<o?(o=a,l=nt(t,ln($e(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=nt(t,ln($e(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function ni(e,t){if(!ye(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=N("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Kn(e.display))+"px;\n height: "+(t.bottom-t.top+Yn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ri(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,a=br(e,t),s=n&&n!=t?br(e,n):a,u=oi(e,i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r}),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=u.scrollTop&&(di(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(pi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(l=!0)),!l)break}return i}function ii(e,t){var n=oi(e,t);null!=n.scrollTop&&di(e,n.scrollTop),null!=n.scrollLeft&&pi(e,n.scrollLeft)}function oi(e,t){var n=e.display,r=Nr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=qn(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Gn(n),s=t.top<r,u=t.bottom>a-r;if(t.top<i)l.scrollTop=s?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?a:t.bottom)-o);c!=i&&(l.scrollTop=c)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-f,h=Un(e)-n.gutters.offsetWidth,p=t.right-t.left>h;return p&&(t.right=t.left+h),t.left<10?l.scrollLeft=0:t.left<d?l.scrollLeft=Math.max(0,t.left+f-(p?0:10)):t.right>h+d-3&&(l.scrollLeft=t.right+(p?0:10)-h),l}function li(e,t){null!=t&&(ci(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function ai(e){ci(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function si(e,t,n){null==t&&null==n||ci(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ui(e,t){ci(e),e.curOp.scrollToPos=t}function ci(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,fi(e,wr(e,t.from),wr(e,t.to),t.margin))}function fi(e,t,n,r){var i=oi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});si(e,i.scrollLeft,i.scrollTop)}function di(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Vi(e,{top:t}),hi(e,t,!0),n&&Vi(e),Pi(e,100))}function hi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function pi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Xi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function vi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Gn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Yn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var mi=function(e,t,n){this.cm=n;var r=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),pe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),pe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},mi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var e=y&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new F,this.disableVert=new F},mi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},mi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gi=function(){};function yi(e,t){t||(t=vi(e));var n=e.display.barWidth,r=e.display.barHeight;bi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Qr(e),bi(e,vi(e)),n=e.display.barWidth,r=e.display.barHeight}function bi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}gi.prototype.update=function(){return{bottom:0,right:0}},gi.prototype.setScrollLeft=function(){},gi.prototype.setScrollTop=function(){},gi.prototype.clear=function(){};var wi={native:mi,null:gi};function xi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&L(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?pi(e,t):di(e,t)}),e),e.display.scrollbars.addClass&&A(e.display.wrapper,e.display.scrollbars.addClass)}var Ci=0;function Si(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ci},kn(e.curOp)}function Mi(e){var t=e.curOp;t&&En(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;ki(e)}))}function ki(e){for(var t=e.ops,n=0;n<t.length;n++)Li(t[n]);for(var r=0;r<t.length;r++)Ei(t[r]);for(var i=0;i<t.length;i++)Ti(t[i]);for(var o=0;o<t.length;o++)Ni(t[o]);for(var l=0;l<t.length;l++)Zi(t[l])}function Li(e){var t=e.cm,n=t.display;Hi(t),e.updateMaxLine&&sn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ei(e){e.updatedDisplay=e.mustUpdate&&_i(e.cm,e.update)}function Ti(e){var t=e.cm,n=t.display;e.updatedDisplay&&Qr(t),e.barMeasure=vi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=er(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Yn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Un(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ni(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&pi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==R();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&yi(t,e.barMeasure),e.updatedDisplay&&Gi(t,e.barMeasure),e.selectionChanged&&Yr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Ur(e.cm)}function Zi(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&Bi(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&hi(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&pi(t,e.scrollLeft,!0,!0),e.scrollToPos&&ni(t,ri(t,dt(r,e.scrollToPos.from),dt(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;l<i.length;++l)i[l].lines.length||ge(i[l],"hide");if(o)for(var a=0;a<o.length;++a)o[a].lines.length&&ge(o[a],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ge(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Oi(e,t){if(e.curOp)return t();Si(e);try{return t()}finally{Mi(e)}}function Ri(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Si(e);try{return t.apply(e,arguments)}finally{Mi(e)}}}function Ai(e){return function(){if(this.curOp)return e.apply(this,arguments);Si(this);try{return e.apply(this,arguments)}finally{Mi(this)}}}function Di(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Si(t);try{return e.apply(this,arguments)}finally{Mi(t)}}}function Pi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,W(Wi,e))}function Wi(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=bt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Xe(t.mode,r.state):null,s=gt(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!f&&d<l.length;++d)f=l[d]!=o.styles[d];f&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&wt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Pi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Oi(e,(function(){for(var t=0;t<i.length;t++)Hr(e,i[t],"text")}))}}var Ii=function(e,t,n){var r=e.display;this.viewport=t,this.visible=ti(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Un(e),this.force=n,this.dims=Or(e),this.events=[]};function Hi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Yn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Yn(e)+"px",t.scrollbarsClipped=!0)}function Fi(e){if(e.hasFocus())return null;var t=R();if(!t||!O(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&O(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function zi(e){if(e&&e.activeElt&&e.activeElt!=R()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function _i(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Fr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Br(e))return!1;Yi(e)&&(Fr(e),t.dims=Or(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),Zt&&(o=tn(e.doc,o),l=nn(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;_r(e,o,l),n.viewOffset=ln($e(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=Br(e);if(!a&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=Fi(e);return s>4&&(n.lineDiv.style.display="none"),ji(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,zi(u),E(n.cursorDiv),E(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Pi(e,400)),n.updateLineNumbers=null,!0}function Bi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Un(e))r&&(t.visible=ti(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Gn(e.display)-qn(e),n.top)}),t.visible=ti(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!_i(e,t))break;Qr(e);var i=vi(e);Vr(e),yi(e,i),Gi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Vi(e,t){var n=new Ii(e,t);if(_i(e,n)){Qr(e),Bi(e,n);var r=vi(e);Vr(e),yi(e,r),Gi(e,r),n.finish()}}function ji(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(t){var n=t.nextSibling;return s&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,f=0;f<u.length;f++){var d=u[f];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;l!=d.node;)l=a(l);var h=i&&null!=t&&t<=c&&d.lineNumber;d.changes&&(z(d.changes,"gutter")>-1&&(h=!1),On(e,d,c,n)),h&&(E(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(it(e.options,c)))),l=d.node.nextSibling}else{var p=Fn(e,d,c,n);o.insertBefore(p,l)}c+=d.size}for(;l;)l=a(l)}function Ki(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Gi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Yn(e)+"px"}function Xi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Rr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=o),n[l].gutterBackground&&(n[l].gutterBackground.style.left=o));var a=n[l].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Yi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=it(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(N("div",[N("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-l)+1,r.lineNumWidth=r.lineNumInnerWidth+l,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ki(e.display),!0}return!1}function Ui(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],l=null;if("string"!=typeof o&&(l=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:l})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function qi(e){var t=e.gutters,n=e.gutterSpecs;E(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,l=i.style,a=t.appendChild(N("div",null,"CodeMirror-gutter "+o));l&&(a.style.cssText=l),"CodeMirror-linenumbers"==o&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Ki(e)}function $i(e){qi(e.display),Ir(e),Xi(e)}function Ji(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=N("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=Z("div",null,"CodeMirror-code"),o.selectionDiv=N("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=N("div",null,"CodeMirror-cursors"),o.measure=N("div",null,"CodeMirror-measure"),o.lineMeasure=N("div",null,"CodeMirror-measure"),o.lineSpace=Z("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=Z("div",[o.lineSpace],"CodeMirror-lines");o.mover=N("div",[u],null,"position: relative"),o.sizer=N("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=N("div",null,null,"position: absolute; height: "+_+"px; width: 1px;"),o.gutters=N("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=N("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=N("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),l&&a<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),s||n&&g||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Ui(i.gutters,i.lineNumbers),qi(o),r.init(o)}Ii.prototype.signal=function(e,t){we(e,t)&&this.events.push(arguments)},Ii.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ge.apply(null,this.events[e])};var Qi=0,eo=null;function to(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function no(e){var t=to(e);return t.x*=eo,t.y*=eo,t}function ro(e,t){var r=to(t),i=r.x,o=r.y,l=e.display,a=l.scroller,u=a.scrollWidth>a.clientWidth,c=a.scrollHeight>a.clientHeight;if(i&&u||o&&c){if(o&&y&&s)e:for(var d=t.target,h=l.view;d!=a;d=d.parentNode)for(var p=0;p<h.length;p++)if(h[p].node==d){e.display.currentWheelTarget=d;break e}if(i&&!n&&!f&&null!=eo)return o&&c&&di(e,Math.max(0,a.scrollTop+o*eo)),pi(e,Math.max(0,a.scrollLeft+i*eo)),(!o||o&&c)&&Ce(t),void(l.wheelStartX=null);if(o&&null!=eo){var v=o*eo,m=e.doc.scrollTop,g=m+l.wrapper.clientHeight;v<0?m=Math.max(0,m+v-50):g=Math.min(e.doc.height,g+v+50),Vi(e,{top:m,bottom:g})}Qi<20&&(null==l.wheelStartX?(l.wheelStartX=a.scrollLeft,l.wheelStartY=a.scrollTop,l.wheelDX=i,l.wheelDY=o,setTimeout((function(){if(null!=l.wheelStartX){var e=a.scrollLeft-l.wheelStartX,t=a.scrollTop-l.wheelStartY,n=t&&l.wheelDY&&t/l.wheelDY||e&&l.wheelDX&&e/l.wheelDX;l.wheelStartX=l.wheelStartY=null,n&&(eo=(eo*Qi+n)/(Qi+1),++Qi)}}),200)):(l.wheelDX+=i,l.wheelDY+=o))}}l?eo=-.53:n?eo=15:c?eo=-.7:d&&(eo=-1/3);var io=function(e,t){this.ranges=e,this.primIndex=t};io.prototype.primary=function(){return this.ranges[this.primIndex]},io.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!at(n.anchor,r.anchor)||!at(n.head,r.head))return!1}return!0},io.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new oo(st(this.ranges[t].anchor),st(this.ranges[t].head));return new io(e,this.primIndex)},io.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},io.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(lt(t,r.from())>=0&&lt(e,r.to())<=0)return n}return-1};var oo=function(e,t){this.anchor=e,this.head=t};function lo(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return lt(e.from(),t.from())})),n=z(t,i);for(var o=1;o<t.length;o++){var l=t[o],a=t[o-1],s=lt(a.to(),l.from());if(r&&!l.empty()?s>0:s>=0){var u=ct(a.from(),l.from()),c=ut(a.to(),l.to()),f=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new oo(f?c:u,f?u:c))}}return new io(t,n)}function ao(e,t){return new io([new oo(e,t||e)],0)}function so(e){return e.text?ot(e.from.line+e.text.length-1,U(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function uo(e,t){if(lt(e,t.from)<0)return e;if(lt(e,t.to)<=0)return so(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=so(t).ch-t.to.ch),ot(n,r)}function co(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new oo(uo(i.anchor,t),uo(i.head,t)))}return lo(e.cm,n,e.sel.primIndex)}function fo(e,t,n){return e.line==t.line?ot(n.line,e.ch-t.ch+n.ch):ot(n.line+(e.line-t.line),e.ch)}function ho(e,t,n){for(var r=[],i=ot(e.first,0),o=i,l=0;l<t.length;l++){var a=t[l],s=fo(a.from,i,o),u=fo(so(a),i,o);if(i=a.to,o=u,"around"==n){var c=e.sel.ranges[l],f=lt(c.head,c.anchor)<0;r[l]=new oo(f?u:s,f?s:u)}else r[l]=new oo(s,s)}return new io(r,e.sel.primIndex)}function po(e){e.doc.mode=je(e.options,e.doc.modeOption),vo(e)}function vo(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Pi(e,100),e.state.modeGen++,e.curOp&&Ir(e)}function mo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==U(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function go(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){cn(e,n,i,r),Nn(e,"change",e,t)}function l(e,t){for(var n=[],o=e;o<t;++o)n.push(new un(u[o],i(o),r));return n}var a=t.from,s=t.to,u=t.text,c=$e(e,a.line),f=$e(e,s.line),d=U(u),h=i(u.length-1),p=s.line-a.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(mo(e,t)){var v=l(0,u.length-1);o(f,f.text,h),p&&e.remove(a.line,p),v.length&&e.insert(a.line,v)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,a.ch)+d+c.text.slice(s.ch),h);else{var m=l(1,u.length-1);m.push(new un(d+c.text.slice(s.ch),h,r)),o(c,c.text.slice(0,a.ch)+u[0],i(0)),e.insert(a.line+1,m)}else if(1==u.length)o(c,c.text.slice(0,a.ch)+u[0]+f.text.slice(s.ch),i(0)),e.remove(a.line+1,p);else{o(c,c.text.slice(0,a.ch)+u[0],i(0)),o(f,d+f.text.slice(s.ch),h);var g=l(1,u.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,g)}Nn(e,"change",e,t)}function yo(e,t,n){function r(e,i,o){if(e.linked)for(var l=0;l<e.linked.length;++l){var a=e.linked[l];if(a.doc!=i){var s=o&&a.sharedHist;n&&!s||(t(a.doc,s),r(a.doc,e,s))}}}r(e,null,!0)}function bo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Dr(e),po(e),wo(e),e.options.lineWrapping||sn(e),e.options.mode=t.modeOption,Ir(e)}function wo(e){("rtl"==e.doc.direction?A:L)(e.display.lineDiv,"CodeMirror-rtl")}function xo(e){Oi(e,(function(){wo(e),Ir(e)}))}function Co(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function So(e,t){var n={from:st(t.from),to:so(t),text:Je(e,t.from,t.to)};return Zo(e,n,t.from.line,t.to.line+1),yo(e,(function(e){return Zo(e,n,t.from.line,t.to.line+1)}),!0),n}function Mo(e){for(;e.length&&U(e).ranges;)e.pop()}function ko(e,t){return t?(Mo(e.done),U(e.done)):e.done.length&&!U(e.done).ranges?U(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),U(e.done)):void 0}function Lo(e,t,n,r){var i=e.history;i.undone.length=0;var o,l,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=ko(i,i.lastOp==r)))l=U(o.changes),0==lt(t.from,t.to)&&0==lt(t.from,l.to)?l.to=so(t):o.changes.push(So(e,t));else{var s=U(i.done);for(s&&s.ranges||No(e.sel,i.done),o={changes:[So(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||ge(e,"historyAdded")}function Eo(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function To(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Eo(e,o,U(i.done),t))?i.done[i.done.length-1]=t:No(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Mo(i.undone)}function No(e,t){var n=U(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Zo(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Oo(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Ro(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Oo(n[i]));return r}function Ao(e,t){var n=Ro(e,t),r=Ft(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],l=r[i];if(o&&l)e:for(var a=0;a<l.length;++a){for(var s=l[a],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else l&&(n[i]=l)}return n}function Do(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?io.prototype.deepCopy.call(o):o);else{var l=o.changes,a=[];r.push({changes:a});for(var s=0;s<l.length;++s){var u=l[s],c=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&z(t,Number(c[1]))>-1&&(U(a)[f]=u[f],delete u[f])}}}return r}function Po(e,t,n,r){if(r){var i=e.anchor;if(n){var o=lt(t,i)<0;o!=lt(n,i)<0?(i=t,t=n):o!=lt(t,n)<0&&(t=n)}return new oo(i,t)}return new oo(n||t,t)}function Wo(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Bo(e,new io([Po(e.sel.primary(),t,n,i)],0),r)}function Io(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Po(e.sel.ranges[o],t[o],null,i);Bo(e,lo(e.cm,r,e.sel.primIndex),n)}function Ho(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Bo(e,lo(e.cm,i,e.sel.primIndex),r)}function Fo(e,t,n,r){Bo(e,ao(t,n),r)}function zo(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new oo(dt(e,t[n].anchor),dt(e,t[n].head))},origin:n&&n.origin};return ge(e,"beforeSelectionChange",e,r),e.cm&&ge(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?lo(e.cm,r.ranges,r.ranges.length-1):t}function _o(e,t,n){var r=e.history.done,i=U(r);i&&i.ranges?(r[r.length-1]=t,Vo(e,t,n)):Bo(e,t,n)}function Bo(e,t,n){Vo(e,t,n),To(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Vo(e,t,n){(we(e,"beforeSelectionChange")||e.cm&&we(e.cm,"beforeSelectionChange"))&&(t=zo(e,t,n));var r=n&&n.bias||(lt(t.primary().head,e.sel.primary().head)<0?-1:1);jo(e,Go(e,t,r,!0)),n&&!1===n.scroll||!e.cm||ai(e.cm)}function jo(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),Nn(e,"cursorActivity",e))}function Ko(e){jo(e,Go(e,e.sel,null,!1))}function Go(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Yo(e,l.anchor,a&&a.anchor,n,r),u=Yo(e,l.head,a&&a.head,n,r);(i||s!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new oo(s,u))}return i?lo(e.cm,i,t.primIndex):t}function Xo(e,t,n,r,i){var o=$e(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var a=o.markedSpans[l],s=a.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,c="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==a.from||(u?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(c?a.to>=t.ch:a.to>t.ch))){if(i&&(ge(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!s.atomic)continue;if(n){var f=s.find(r<0?1:-1),d=void 0;if((r<0?c:u)&&(f=Uo(e,f,-r,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(d=lt(f,n))&&(r<0?d<0:d>0))return Xo(e,f,t,r,i)}var h=s.find(r<0?-1:1);return(r<0?u:c)&&(h=Uo(e,h,r,h.line==t.line?o:null)),h?Xo(e,h,t,r,i):null}}return t}function Yo(e,t,n,r,i){var o=r||1,l=Xo(e,t,n,o,i)||!i&&Xo(e,t,n,o,!0)||Xo(e,t,n,-o,i)||!i&&Xo(e,t,n,-o,!0);return l||(e.cantEdit=!0,ot(e.first,0))}function Uo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?dt(e,ot(t.line-1)):null:n>0&&t.ch==(r||$e(e,t.line)).text.length?t.line<e.first+e.size-1?ot(t.line+1,0):null:new ot(t.line,t.ch+n)}function qo(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),V)}function $o(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=dt(e,t)),n&&(r.to=dt(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),ge(e,"beforeChange",e,r),e.cm&&ge(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Jo(e,t,n){if(e.cm){if(!e.cm.curOp)return Ri(e.cm,Jo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(we(e,"beforeChange")||e.cm&&we(e.cm,"beforeChange"))||(t=$o(e,t,!0))){var r=Nt&&!n&&_t(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Qo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Qo(e,t)}}function Qo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=lt(t.from,t.to)){var n=co(e,t);Lo(e,t,n,e.cm?e.cm.curOp.id:NaN),nl(e,t,n,Ft(e,t));var r=[];yo(e,(function(e,n){n||-1!=z(r,e.history)||(al(e.history,t),r.push(e.history)),nl(e,t,null,Ft(e,t))}))}}function el(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,l=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,u=0;u<a.length&&(i=a[u],n?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=a.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=a.pop()).ranges){if(r)return void a.push(i);break}if(No(i,s),n&&!i.equals(e.sel))return void Bo(e,i,{clearRedo:!1});l=i}var c=[];No(l,s),s.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=we(e,"beforeChange")||e.cm&&we(e.cm,"beforeChange"),d=function(n){var r=i.changes[n];if(r.origin=t,f&&!$o(e,r,!1))return a.length=0,{};c.push(So(e,r));var o=n?co(e,r):U(a);nl(e,r,o,Ao(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:so(r)});var l=[];yo(e,(function(e,t){t||-1!=z(l,e.history)||(al(e.history,r),l.push(e.history)),nl(e,r,null,Ao(e,r))}))},h=i.changes.length-1;h>=0;--h){var p=d(h);if(p)return p.v}}}}function tl(e,t){if(0!=t&&(e.first+=t,e.sel=new io(q(e.sel.ranges,(function(e){return new oo(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Ir(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Hr(e.cm,r,"gutter")}}function nl(e,t,n,r){if(e.cm&&!e.cm.curOp)return Ri(e.cm,nl)(e,t,n,r);if(t.to.line<e.first)tl(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);tl(e,i),t={from:ot(e.first,0),to:ot(t.to.line+i,t.to.ch),text:[U(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ot(o,$e(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=co(e,t)),e.cm?rl(e.cm,t,r):go(e,t,r),Vo(e,n,V),e.cantEdit&&Yo(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function rl(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=tt(Jt($e(r,o.line))),r.iter(s,l.line+1,(function(e){if(e==i.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&be(e),go(r,t,n,Ar(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,(function(e){var t=an(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),Tt(r,o.line),Pi(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?Ir(e):o.line!=l.line||1!=t.text.length||mo(e.doc,t)?Ir(e,o.line,l.line+1,u):Hr(e,o.line,"text");var c=we(e,"changes"),f=we(e,"change");if(f||c){var d={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};f&&Nn(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function il(e,t,n,r,i){var o;r||(r=n),lt(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Jo(e,{from:n,to:r,text:t,origin:i})}function ol(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function ll(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var a=0;a<o.ranges.length;a++)ol(o.ranges[a].anchor,t,n,r),ol(o.ranges[a].head,t,n,r)}else{for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(n<u.from.line)u.from=ot(u.from.line+r,u.from.ch),u.to=ot(u.to.line+r,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function al(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;ll(e.done,n,r,i),ll(e.undone,n,r,i)}function sl(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=$e(e,ft(e,t)):i=tt(t),null==i?null:(r(o,i)&&e.cm&&Hr(e.cm,i,n),o)}function ul(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function cl(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}oo.prototype.from=function(){return ct(this.anchor,this.head)},oo.prototype.to=function(){return ut(this.anchor,this.head)},oo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ul.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,fn(i),Nn(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},cl.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),l=r.height;if(r.removeInner(e,o),this.height-=l-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ul))){var a=[];this.collapse(a),this.children=[new ul(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,a=l;a<i.lines.length;){var s=new ul(i.lines.slice(a,a+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new cl(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=z(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new cl(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,n))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var fl=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function dl(e,t,n){ln(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&li(e,n)}function hl(e,t,n,r){var i=new fl(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),sl(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!rn(e,t)){var r=ln(t)<e.scrollTop;et(t,t.height+Vn(i)),r&&li(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&Nn(o,"lineWidgetAdded",o,i,"number"==typeof t?t:tt(t)),i}fl.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=tt(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Vn(this);et(n,Math.max(0,n.height-o)),e&&(Oi(e,(function(){dl(e,n,-o),Hr(e,r,"widget")})),Nn(e,"lineWidgetCleared",e,this,r))}},fl.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Vn(this)-t;i&&(rn(this.doc,r)||et(r,r.height+i),n&&Oi(n,(function(){n.curOp.forceUpdate=!0,dl(n,r,i),Nn(n,"lineWidgetChanged",n,e,tt(r))})))},xe(fl);var pl=0,vl=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++pl};function ml(e,t,n,r,i){if(r&&r.shared)return yl(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Ri(e.cm,ml)(e,t,n,r,i);var o=new vl(e,i),l=lt(t,n);if(r&&I(r,o,!1),l>0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Z("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if($t(e,t.line,t,n,o)||t.line!=n.line&&$t(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Rt()}o.addToHistory&&Lo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,s=t.line,u=e.cm;if(e.iter(s,n.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Jt(e)==u.display.maxLine&&(a=!0),o.collapsed&&s!=t.line&&et(e,0),Wt(e,new At(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){rn(e,t)&&et(t,0)})),o.clearOnEnter&&pe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ot(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++pl,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)Ir(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Hr(u,c,"text");o.atomic&&Ko(u.doc),Nn(u,"markerAdded",u,o)}return o}vl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Si(e),we(this,"clear")){var n=this.find();n&&Nn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],a=Dt(l.markedSpans,this);e&&!this.collapsed?Hr(e,tt(l),"text"):e&&(null!=a.to&&(i=tt(l)),null!=a.from&&(r=tt(l))),l.markedSpans=Pt(l.markedSpans,a),null==a.from&&this.collapsed&&!rn(this.doc,l)&&e&&et(l,Nr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=Jt(this.lines[s]),c=an(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Ir(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ko(e.doc)),e&&Nn(e,"markerCleared",e,this,r,i),t&&Mi(e),this.parent&&this.parent.clear()}},vl.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],l=Dt(o.markedSpans,this);if(null!=l.from&&(n=ot(t?o:tt(o),l.from),-1==e))return n;if(null!=l.to&&(r=ot(t?o:tt(o),l.to),1==e))return r}return n&&{from:n,to:r}},vl.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Oi(r,(function(){var i=t.line,o=tt(t.line),l=tr(r,o);if(l&&(cr(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!rn(n.doc,i)&&null!=n.height){var a=n.height;n.height=null;var s=Vn(n)-a;s&&et(i,i.height+s)}Nn(r,"markerChanged",r,e)}))},vl.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=z(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},vl.prototype.detachLine=function(e){if(this.lines.splice(z(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xe(vl);var gl=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function yl(e,t,n,r,i){(r=I(r)).shared=!1;var o=[ml(e,t,n,r,i)],l=o[0],a=r.widgetNode;return yo(e,(function(e){a&&(r.widgetNode=a.cloneNode(!0)),o.push(ml(e,dt(e,t),dt(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;l=U(o)})),new gl(o,l)}function bl(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),(function(e){return e.parent}))}function wl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(lt(o,l)){var a=ml(e,o,l,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function xl(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];yo(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==z(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}gl.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Nn(this,"clear")}},gl.prototype.find=function(e,t){return this.primary.find(e,t)},xe(gl);var Cl=0,Sl=function(e,t,n,r,i){if(!(this instanceof Sl))return new Sl(e,t,n,r,i);null==n&&(n=0),cl.call(this,[new ul([new un("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ot(n,0);this.sel=ao(o),this.history=new Co(null),this.id=++Cl,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),go(this,{from:o,to:o,text:e}),Bo(this,ao(o),V)};Sl.prototype=Q(cl.prototype,{constructor:Sl,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Qe(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Di((function(e){var t=ot(this.first,0),n=this.first+this.size-1;Jo(this,{from:t,to:ot(n,$e(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&si(this.cm,0,0),Bo(this,ao(t),V)})),replaceRange:function(e,t,n,r){il(this,e,t=dt(this,t),n=n?dt(this,n):t,r)},getRange:function(e,t,n){var r=Je(this,dt(this,e),dt(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(rt(this,e))return $e(this,e)},getLineNumber:function(e){return tt(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=$e(this,e)),Jt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return dt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Di((function(e,t,n){Fo(this,dt(this,"number"==typeof e?ot(e,t||0):e),null,n)})),setSelection:Di((function(e,t,n){Fo(this,dt(this,e),dt(this,t||e),n)})),extendSelection:Di((function(e,t,n){Wo(this,dt(this,e),t&&dt(this,t),n)})),extendSelections:Di((function(e,t){Io(this,pt(this,e),t)})),extendSelectionsBy:Di((function(e,t){Io(this,pt(this,q(this.sel.ranges,e)),t)})),setSelections:Di((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new oo(dt(this,e[i].anchor),dt(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Bo(this,lo(this.cm,r,t),n)}})),addSelection:Di((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new oo(dt(this,e),dt(this,t||e))),Bo(this,lo(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Je(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Je(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Di((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];r[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:n}}for(var a=t&&"end"!=t&&ho(this,r,t),s=r.length-1;s>=0;s--)Jo(this,r[s]);a?_o(this,a):this.cm&&ai(this.cm)})),undo:Di((function(){el(this,"undo")})),redo:Di((function(){el(this,"redo")})),undoSelection:Di((function(){el(this,"undo",!0)})),redoSelection:Di((function(){el(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Co(this.history.maxGeneration),yo(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Do(this.history.done),undone:Do(this.history.undone)}},setHistory:function(e){var t=this.history=new Co(this.history.maxGeneration);t.done=Do(e.done.slice(0),null,!0),t.undone=Do(e.undone.slice(0),null,!0)},setGutterMarker:Di((function(e,t,n){return sl(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&re(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:Di((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&sl(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,re(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!rt(this,e))return null;if(t=e,!(e=$e(this,e)))return null}else if(null==(t=tt(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Di((function(e,t,n){return sl(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(M(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:Di((function(e,t,n){return sl(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(M(n));if(!o)return!1;var l=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0}))})),addLineWidget:Di((function(e,t,n){return hl(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return ml(this,dt(this,e),dt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return ml(this,e=dt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=$e(this,(e=dt(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=dt(this,e),t=dt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var l=o.markedSpans;if(l)for(var a=0;a<l.length;a++){var s=l[a];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),dt(this,ot(n,t))},indexFromPos:function(e){var t=(e=dt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Sl(Qe(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Sl(Qe(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(r,bl(this)),r},unlinkDoc:function(e){if(e instanceof Ia&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),xl(bl(this));break}if(e.history==this.history){var n=[e.id];yo(e,(function(e){return n.push(e.id)}),!0),e.history=new Co(null),e.history.done=Do(this.history.done,n),e.history.undone=Do(this.history.undone,n)}},iterLinkedDocs:function(e){yo(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):De(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Di((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&xo(this.cm))}))}),Sl.prototype.eachLine=Sl.prototype.iter;var Ml=0;function kl(e){var t=this;if(Tl(t),!ye(t,e)&&!jn(t.display,e)){Ce(e),l&&(Ml=+new Date);var n=Pr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(){++a==i&&Ri(t,(function(){var e={from:n=dt(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};Jo(t.doc,e),_o(t.doc,ao(dt(t.doc,n),dt(t.doc,so(e))))}))()},u=function(e,n){if(t.options.allowDropFileTypes&&-1==z(t.options.allowDropFileTypes,e.type))s();else{var r=new FileReader;r.onerror=function(){return s()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),s()},r.readAsText(e)}},c=0;c<r.length;c++)u(r[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Vo(t.doc,ao(n,n)),d)for(var h=0;h<d.length;++h)il(t.doc,"",d[h].anchor,d[h].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ll(e,t){if(l&&(!e.state.draggingText||+new Date-Ml<100))ke(t);else if(!ye(e,t)&&!jn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=N("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}function El(e,t){var n=Pr(e,t);if(n){var r=document.createDocumentFragment();Kr(e,n,r),e.display.dragCursor||(e.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,r)}}function Tl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Nl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Zl=!1;function Ol(){Zl||(Rl(),Zl=!0)}function Rl(){var e;pe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Nl(Al)}),100))})),pe(window,"blur",(function(){return Nl(Jr)}))}function Al(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Dl={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Pl=0;Pl<10;Pl++)Dl[Pl+48]=Dl[Pl+96]=String(Pl);for(var Wl=65;Wl<=90;Wl++)Dl[Wl]=String.fromCharCode(Wl);for(var Il=1;Il<=12;Il++)Dl[Il+111]=Dl[Il+63235]="F"+Il;var Hl={};function Fl(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var l=0;l<o.length-1;l++){var a=o[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function zl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=q(n.split(" "),Fl),o=0;o<i.length;o++){var l=void 0,a=void 0;o==i.length-1?(a=i.join(" "),l=r):(a=i.slice(0,o+1).join(" "),l="...");var s=t[a];if(s){if(s!=l)throw new Error("Inconsistent bindings for "+a)}else t[a]=l}delete e[n]}for(var u in t)e[u]=t[u];return e}function _l(e,t,n,r){var i=(t=Kl(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return _l(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var l=_l(e,t.fallthrough[o],n,r);if(l)return l}}}function Bl(e){var t="string"==typeof e?e:Dl[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Vl(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function jl(e,t){if(f&&34==e.keyCode&&e.char)return!1;var n=Dl[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Vl(n,e,t))}function Kl(e){return"string"==typeof e?Hl[e]:e}function Gl(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&lt(o.from,U(r).to)<=0;){var l=r.pop();if(lt(l.from,o.from)<0){o.from=l.from;break}}r.push(o)}Oi(e,(function(){for(var t=r.length-1;t>=0;t--)il(e.doc,"",r[t].from,r[t].to,"+delete");ai(e)}))}function Xl(e,t,n){var r=le(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Yl(e,t,n){var r=Xl(e,t.ch,n);return null==r?null:new ot(t.line,r,n<0?"after":"before")}function Ul(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=de(n,t.doc.direction);if(o){var l,a=i<0?U(o):o[0],s=i<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=nr(t,n);l=i<0?n.text.length-1:0;var c=rr(t,u,l).top;l=ae((function(e){return rr(t,u,e).top==c}),i<0==(1==a.level)?a.from:a.to-1,l),"before"==s&&(l=Xl(n,l,1))}else l=i<0?a.to:a.from;return new ot(r,l,s)}}return new ot(r,i<0?n.text.length:0,i<0?"before":"after")}function ql(e,t,n,r){var i=de(t,e.doc.direction);if(!i)return Yl(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ce(i,n.ch,n.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(r>0?l.to>n.ch:l.from<n.ch))return Yl(t,n,r);var a,s=function(e,n){return Xl(t,e instanceof ot?e.ch:e,n)},u=function(n){return e.options.lineWrapping?(a=a||nr(e,t),Mr(e,t,a,n)):{begin:0,end:t.text.length}},c=u("before"==n.sticky?s(n,-1):n.ch);if("rtl"==e.doc.direction||1==l.level){var f=1==l.level==r<0,d=s(n,f?1:-1);if(null!=d&&(f?d<=l.to&&d<=c.end:d>=l.from&&d>=c.begin)){var h=f?"before":"after";return new ot(n.line,d,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new ot(n.line,s(e,1),"before"):new ot(n.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],a=t>0==(1!=l.level),u=a?r.begin:s(r.end,-1);if(l.from<=u&&u<l.to)return o(u,a);if(u=a?l.from:s(l.to,-1),r.begin<=u&&u<r.end)return o(u,a)}},v=p(o+r,r,c);if(v)return v;var m=r>0?c.end:s(c.begin,-1);return null==m||r>0&&m==t.text.length||!(v=p(r>0?0:i.length-1,r,u(m)))?null:v}Hl.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Hl.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Hl.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Hl.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Hl.default=y?Hl.macDefault:Hl.pcDefault;var $l={selectAll:qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),V)},killLine:function(e){return Gl(e,(function(t){if(t.empty()){var n=$e(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ot(t.head.line+1,0)}:{from:t.head,to:ot(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Gl(e,(function(t){return{from:ot(t.from().line,0),to:dt(e.doc,ot(t.to().line+1,0))}}))},delLineLeft:function(e){return Gl(e,(function(e){return{from:ot(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Gl(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Gl(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return Jl(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ea(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return Ql(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),K)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),K)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ea(e,t.head):r}),K)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),l=H(e.getLine(o.line),o.ch,r);t.push(Y(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Oi(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=$e(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ot(i.line,i.ch-1)),i.ch>0)i=new ot(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ot(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=$e(e.doc,i.line-1).text;l&&(i=new ot(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),ot(i.line-1,l.length-1),i,"+transpose"))}n.push(new oo(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Oi(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);ai(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Jl(e,t){var n=$e(e.doc,t),r=Jt(n);return r!=n&&(t=tt(r)),Ul(!0,e,r,t,1)}function Ql(e,t){var n=$e(e.doc,t),r=Qt(n);return r!=n&&(t=tt(r)),Ul(!0,e,n,t,-1)}function ea(e,t){var n=Jl(e,t.line),r=$e(e.doc,n.line),i=de(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=o&&t.ch;return ot(n.line,l?0:o,n.sticky)}return n}function ta(e,t,n){if("string"==typeof t&&!(t=$l[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=B}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function na(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=_l(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&_l(t,e.options.extraKeys,n,e)||_l(t,e.options.keyMap,n,e)}var ra=new F;function ia(e,t,n,r){var i=e.state.keySeq;if(i){if(Bl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ra.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),oa(e,i+" "+t,n,r))return!0}return oa(e,t,n,r)}function oa(e,t,n,r){var i=na(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&Nn(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(Ce(n),Yr(e)),!!i}function la(e,t){var n=jl(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ia(e,"Shift-"+n,t,(function(t){return ta(e,t,!0)}))||ia(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ta(e,t)})):ia(e,n,t,(function(t){return ta(e,t)})))}function aa(e,t,n){return ia(e,"'"+n+"'",t,(function(t){return ta(e,t,!0)}))}var sa=null;function ua(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=R(),ye(t,e)))){l&&a<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=la(t,e);f&&(sa=i?r:null,i||88!=r||We||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||ca(t)}}function ca(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(L(t,"CodeMirror-crosshair"),me(document,"keyup",n),me(document,"mouseover",n))}A(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n)}function fa(e){16==e.keyCode&&(this.doc.sel.shift=!1),ye(this,e)}function da(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||jn(t.display,e)||ye(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==sa)return sa=null,void Ce(e);if(!f||e.which&&!(e.which<10)||!la(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(aa(t,e,i)||t.display.input.onKeyPress(e))}}}var ha,pa,va=400,ma=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ga(e,t){var n=+new Date;return pa&&pa.compare(n,e,t)?(ha=pa=null,"triple"):ha&&ha.compare(n,e,t)?(pa=new ma(n,e,t),ha=null,"double"):(ha=new ma(n,e,t),pa=null,"single")}function ya(e){var t=this,n=t.display;if(!(ye(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,jn(n,e))s||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Ea(t,e)){var r=Pr(t,e),i=Ee(e),o=r?ga(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&ba(t,i,r,o,e)||(1==i?r?xa(t,r,o,e):Le(e)==n.scroller&&Ce(e):2==i?(r&&Wo(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):qr(t)))}}function ba(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),ia(e,Vl(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=$l[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=B}finally{e.state.suppressEdits=!1}return r}))}function wa(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey)),i}function xa(e,t,n,r){l?setTimeout(W(Ur,e),0):e.curOp.focus=R();var i,o=wa(e,n,r),a=e.doc.sel;e.options.dragDrop&&Ze&&!e.isReadOnly()&&"single"==n&&(i=a.contains(t))>-1&&(lt((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(lt(i.to(),t)>0||t.xRel<0)?Ca(e,r,t,o):Ma(e,r,t,o)}function Ca(e,t,n,r){var i=e.display,o=!1,u=Ri(e,(function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,me(i.wrapper.ownerDocument,"mouseup",u),me(i.wrapper.ownerDocument,"mousemove",c),me(i.scroller,"dragstart",f),me(i.scroller,"drop",u),o||(Ce(t),r.addNew||Wo(e.doc,n,null,null,r.extend),s&&!d||l&&9==a?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return o=!0};s&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),pe(i.wrapper.ownerDocument,"mouseup",u),pe(i.wrapper.ownerDocument,"mousemove",c),pe(i.scroller,"dragstart",f),pe(i.scroller,"drop",u),qr(e),setTimeout((function(){return i.input.focus()}),20)}function Sa(e,t,n){if("char"==n)return new oo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new oo(ot(t.line,0),dt(e.doc,ot(t.line+1,0)));var r=n(e,t);return new oo(r.from,r.to)}function Ma(e,t,n,r){var i=e.display,o=e.doc;Ce(t);var l,a,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),l=a>-1?u[a]:new oo(n,n)):(l=o.sel.primary(),a=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(l=new oo(n,n)),n=Pr(e,t,!0,!0),a=-1;else{var c=Sa(e,n,r.unit);l=r.extend?Po(l,c.anchor,c.head,r.extend):c}r.addNew?-1==a?(a=u.length,Bo(o,lo(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&"char"==r.unit&&!r.extend?(Bo(o,lo(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):Ho(o,a,l,j):(a=0,Bo(o,new io([l],0),j),s=o.sel);var f=n;function d(t){if(0!=lt(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],u=e.options.tabSize,c=H($e(o,n.line).text,n.ch,u),d=H($e(o,t.line).text,t.ch,u),h=Math.min(c,d),p=Math.max(c,d),v=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));v<=m;v++){var g=$e(o,v).text,y=G(g,h,u);h==p?i.push(new oo(ot(v,y),ot(v,y))):g.length>y&&i.push(new oo(ot(v,y),ot(v,G(g,p,u))))}i.length||i.push(new oo(n,n)),Bo(o,lo(e,s.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=l,x=Sa(e,t,r.unit),C=w.anchor;lt(x.anchor,C)>0?(b=x.head,C=ct(w.from(),x.anchor)):(b=x.anchor,C=ut(w.to(),x.head));var S=s.ranges.slice(0);S[a]=ka(e,new oo(dt(o,C),b)),Bo(o,lo(e,S,a),j)}}var h=i.wrapper.getBoundingClientRect(),p=0;function v(t){var n=++p,l=Pr(e,t,!0,"rectangle"==r.unit);if(l)if(0!=lt(l,f)){e.curOp.focus=R(),d(l);var a=ti(i,o);(l.line>=a.to||l.line<a.from)&&setTimeout(Ri(e,(function(){p==n&&v(t)})),150)}else{var s=t.clientY<h.top?-20:t.clientY>h.bottom?20:0;s&&setTimeout(Ri(e,(function(){p==n&&(i.scroller.scrollTop+=s,v(t))})),50)}}function m(t){e.state.selectingText=!1,p=1/0,t&&(Ce(t),i.input.focus()),me(i.wrapper.ownerDocument,"mousemove",g),me(i.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var g=Ri(e,(function(e){0!==e.buttons&&Ee(e)?v(e):m(e)})),y=Ri(e,m);e.state.selectingText=y,pe(i.wrapper.ownerDocument,"mousemove",g),pe(i.wrapper.ownerDocument,"mouseup",y)}function ka(e,t){var n=t.anchor,r=t.head,i=$e(e.doc,n.line);if(0==lt(n,r)&&n.sticky==r.sticky)return t;var o=de(i);if(!o)return t;var l=ce(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s,u=l+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ce(o,r.ch,r.sticky),f=c-l||(r.ch-n.ch)*(1==a.level?-1:1);s=c==u-1||c==u?f<0:f>0}var d=o[u+(s?-1:0)],h=s==(1==d.level),p=h?d.from:d.to,v=h?"after":"before";return n.ch==p&&n.sticky==v?t:new oo(new ot(n.line,p,v),r)}function La(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ce(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!we(e,n))return Me(t);o-=a.top-l.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=l.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i)return ge(e,n,e,nt(e.doc,o),e.display.gutterSpecs[s].className,t),Me(t)}}function Ea(e,t){return La(e,t,"gutterClick",!0)}function Ta(e,t){jn(e.display,t)||Na(e,t)||ye(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function Na(e,t){return!!we(e,"gutterContextMenu")&&La(e,t,"gutterContextMenu",!1)}function Za(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),dr(e)}ma.prototype.compare=function(e,t,n){return this.time+va>e&&0==lt(t,this.pos)&&n==this.button};var Oa={toString:function(){return"CodeMirror.Init"}},Ra={},Aa={};function Da(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Oa&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Oa,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,po(e)}),!0),n("indentUnit",2,po,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){vo(e),dr(e),Ir(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(ot(r,o))}r++}));for(var i=n.length-1;i>=0;i--)il(e.doc,t,n[i],ot(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Oa&&e.refresh()})),n("specialCharPlaceholder",mn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Za(e),$i(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Kl(t),i=n!=Oa&&Kl(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Wa,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Ui(t,e.options.lineNumbers),$i(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Rr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yi(e)}),!0),n("scrollbarStyle","native",(function(e){xi(e),yi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Ui(e.options.gutters,t),$i(e)}),!0),n("firstLineNumber",1,$i,!0),n("lineNumberFormatter",(function(e){return e}),$i,!0),n("showCursorWhenSelecting",!1,Vr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Jr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Pa),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Vr,!0),n("singleCursorHeightPerLine",!0,Vr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,vo,!0),n("addModeClass",!1,vo,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,vo,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Pa(e,t,n){if(!t!=!(n&&n!=Oa)){var r=e.display.dragFunctions,i=t?pe:me;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Wa(e){e.options.lineWrapping?(A(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),sn(e)),Dr(e),Ir(e),dr(e),setTimeout((function(){return yi(e)}),100)}function Ia(e,t){var n=this;if(!(this instanceof Ia))return new Ia(e,t);this.options=t=t?I(t):{},I(Ra,t,!1);var r=t.value;"string"==typeof r?r=new Sl(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ia.inputStyles[t.inputStyle](this),o=this.display=new Ji(e,r,i,t);for(var u in o.wrapper.CodeMirror=this,Za(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new F,keySeq:null,specialChars:null},t.autofocus&&!g&&o.input.focus(),l&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Ha(this),Ol(),Si(this),this.curOp.forceUpdate=!0,bo(this,r),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&$r(n)}),20):Jr(this),Aa)Aa.hasOwnProperty(u)&&Aa[u](this,t[u],Oa);Yi(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Fa.length;++c)Fa[c](this);Mi(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Ha(e){var t=e.display;pe(t.scroller,"mousedown",Ri(e,ya)),pe(t.scroller,"dblclick",l&&a<11?Ri(e,(function(t){if(!ye(e,t)){var n=Pr(e,t);if(n&&!Ea(e,t)&&!jn(e.display,t)){Ce(t);var r=e.findWordAt(n);Wo(e.doc,r.anchor,r.head)}}})):function(t){return ye(e,t)||Ce(t)}),pe(t.scroller,"contextmenu",(function(t){return Ta(e,t)})),pe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Ta(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function s(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}pe(t.scroller,"touchstart",(function(i){if(!ye(e,i)&&!o(i)&&!Ea(e,i)){t.input.ensurePolled(),clearTimeout(n);var l=+new Date;t.activeTouch={start:l,moved:!1,prev:l-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!jn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,l=e.coordsChar(t.activeTouch,"page");o=!r.prev||s(r,r.prev)?new oo(l,l):!r.prev.prev||s(r,r.prev.prev)?e.findWordAt(l):new oo(ot(l.line,0),dt(e.doc,ot(l.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Ce(n)}i()})),pe(t.scroller,"touchcancel",i),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(di(e,t.scroller.scrollTop),pi(e,t.scroller.scrollLeft,!0),ge(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return ro(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return ro(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||ke(t)},over:function(t){ye(e,t)||(El(e,t),ke(t))},start:function(t){return Ll(e,t)},drop:Ri(e,kl),leave:function(t){ye(e,t)||Tl(e)}};var u=t.input.getField();pe(u,"keyup",(function(t){return fa.call(e,t)})),pe(u,"keydown",Ri(e,ua)),pe(u,"keypress",Ri(e,da)),pe(u,"focus",(function(t){return $r(e,t)})),pe(u,"blur",(function(t){return Jr(e,t)}))}Ia.defaults=Ra,Ia.optionHandlers=Aa;var Fa=[];function za(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=bt(e,t).state:n="prev");var l=e.options.tabSize,a=$e(o,t),s=H(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&((u=o.mode.indent(i,a.text.slice(c.length),a.text))==B||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?H($e(o,t-1).text,null,l):0:"add"==n?u=s+e.options.indentUnit:"subtract"==n?u=s-e.options.indentUnit:"number"==typeof n&&(u=s+n),u=Math.max(0,u);var f="",d=0;if(e.options.indentWithTabs)for(var h=Math.floor(u/l);h;--h)d+=l,f+="\t";if(d<u&&(f+=Y(u-d)),f!=c)return il(o,f,ot(t,0),ot(t,c.length),"+input"),a.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var v=o.sel.ranges[p];if(v.head.line==t&&v.head.ch<c.length){var m=ot(t,c.length);Ho(o,p,new oo(m,m));break}}}Ia.defineInitHook=function(e){return Fa.push(e)};var _a=null;function Ba(e){_a=e}function Va(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var l=+new Date-200,a="paste"==i||e.state.pasteIncoming>l,s=De(t),u=null;if(a&&r.ranges.length>1)if(_a&&_a.text.join("\n")==t){if(r.ranges.length%_a.text.length==0){u=[];for(var c=0;c<_a.text.length;c++)u.push(o.splitLines(_a.text[c]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=q(s,(function(e){return[e]})));for(var f=e.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var h=r.ranges[d],p=h.from(),v=h.to();h.empty()&&(n&&n>0?p=ot(p.line,p.ch-n):e.state.overwrite&&!a?v=ot(v.line,Math.min($e(o,v.line).text.length,v.ch+U(s).length)):a&&_a&&_a.lineWise&&_a.text.join("\n")==s.join("\n")&&(p=v=ot(p.line,0)));var m={from:p,to:v,text:u?u[d%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Jo(e.doc,m),Nn(e,"inputRead",e,m)}t&&!a&&Ka(e,t),ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ja(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Oi(t,(function(){return Va(t,n,0,null,"paste")})),!0}function Ka(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=za(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test($e(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=za(e,i.head.line,"smart"));l&&Nn(e,"electricInput",e,i.head.line)}}}function Ga(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:ot(i,0),head:ot(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Xa(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ya(){var e=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=N("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),v&&(e.style.border="1px solid black"),Xa(e),t}function Ua(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Ri(this,t[e])(this,n,i),ge(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Kl(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Ai((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");$(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,Ir(this)})),removeOverlay:Ai((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Ir(this)}})),indentLine:Ai((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),rt(this.doc,e)&&za(this,e,t,n)})),indentSelection:Ai((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(za(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&ai(this));else{var o=i.from(),l=i.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var s=a;s<n;++s)za(this,s,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[r].from().ch>0&&Ho(this.doc,r,new oo(o,u[r].to()),V)}}})),getTokenAt:function(e,t){return Mt(this,e,t)},getLineTokens:function(e,t){return Mt(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=dt(this.doc,e);var t,n=yt(this,$e(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var l=r+i>>1;if((l?n[2*l-1]:0)>=o)i=l;else{if(!(n[2*l+1]<o)){t=n[2*l+2];break}r=l+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var l=0;l<o[t].length;l++){var a=i[o[t][l]];a&&r.push(a)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var s=0;s<i._global.length;s++){var u=i._global[s];u.pred(o,this)&&-1==z(r,u.val)&&r.push(u.val)}return r},getStateAfter:function(e,t){var n=this.doc;return bt(this,(e=ft(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return br(this,null==e?n.head:"object"==typeof e?dt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return yr(this,dt(this.doc,e),t||"page")},coordsChar:function(e,t){return Cr(this,(e=gr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=gr(this,{top:e,left:0},t||"page").top,nt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=$e(this.doc,e)}else r=e;return mr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-ln(r):0)},defaultTextHeight:function(){return Nr(this.display)},defaultCharWidth:function(){return Zr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,l=(e=br(this,dt(this.doc,e))).bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(l=e.bottom),a+t.offsetWidth>u&&(a=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),n&&ii(this,{left:a,top:l,right:a+t.offsetWidth,bottom:l+t.offsetHeight})},triggerOnKeyDown:Ai(ua),triggerOnKeyPress:Ai(da),triggerOnKeyUp:fa,triggerOnMouseDown:Ai(ya),execCommand:function(e){if($l.hasOwnProperty(e))return $l[e].call(null,this)},triggerElectric:Ai((function(e){Ka(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=dt(this.doc,e),l=0;l<t&&!(o=qa(this.doc,o,i,n,r)).hitSide;++l);return o},moveH:Ai((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?qa(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),K)})),deleteH:Ai((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Gl(this,(function(n){var i=qa(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var l=dt(this.doc,e),a=0;a<t;++a){var s=br(this,l,"div");if(null==o?o=s.left:s.left=o,(l=$a(this,s,i,n)).hitSide)break}return l},moveV:Ai((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(l){if(o)return e<0?l.from():l.to();var a=br(n,l.head,"div");null!=l.goalColumn&&(a.left=l.goalColumn),i.push(a.left);var s=$a(n,a,e,t);return"page"==t&&l==r.sel.primary()&&li(n,yr(n,s,"div").top-a.top),s}),K),i.length)for(var l=0;l<r.sel.ranges.length;l++)r.sel.ranges[l].goalColumn=i[l]})),findWordAt:function(e){var t=$e(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),l=ne(o,i)?function(e){return ne(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ne(e)};n>0&&l(t.charAt(n-1));)--n;for(;r<t.length&&l(t.charAt(r));)++r}return new oo(ot(e.line,n),ot(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?A(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),ge(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==R()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Ai((function(e,t){si(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Yn(this)-this.display.barHeight,width:e.scrollWidth-Yn(this)-this.display.barWidth,clientHeight:qn(this),clientWidth:Un(this)}},scrollIntoView:Ai((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ot(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?ui(this,e):fi(this,e.from,e.to,e.margin)})),setSize:Ai((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&fr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Hr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,ge(this,"refresh",this)})),operation:function(e){return Oi(this,e)},startOperation:function(){return Si(this)},endOperation:function(){return Mi(this)},refresh:Ai((function(){var e=this.display.cachedTextHeight;Ir(this),this.curOp.forceUpdate=!0,dr(this),si(this,this.doc.scrollLeft,this.doc.scrollTop),Ki(this.display),(null==e||Math.abs(e-Nr(this.display))>.5||this.options.lineWrapping)&&Dr(this),ge(this,"refresh",this)})),swapDoc:Ai((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,e),dr(this),this.display.input.reset(),si(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Nn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xe(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function qa(e,t,n,r,i){var o=t,l=n,a=$e(e,t.line),s=i&&"rtl"==e.direction?-n:n;function u(){var n=t.line+s;return!(n<e.first||n>=e.first+e.size)&&(t=new ot(n,t.ch,t.sticky),a=$e(e,n))}function c(o){var l;if("codepoint"==r){var c=a.text.charCodeAt(t.ch+(r>0?0:-1));l=isNaN(c)?null:new ot(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(c>=55296&&c<56320?2:1))),-n)}else l=i?ql(e.cm,a,t,n):Yl(a,t,n);if(null==l){if(o||!u())return!1;t=Ul(i,e.cm,a,t.line,s)}else t=l;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var f=null,d="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var v=a.text.charAt(t.ch)||"\n",m=ne(v,h)?"w":d&&"\n"==v?"n":!d||/\s/.test(v)?null:"p";if(!d||p||m||(m="s"),f&&f!=m){n<0&&(n=1,c(),t.sticky="after");break}if(m&&(f=m),n>0&&!c(!p))break}var g=Yo(e,t,o,l,!0);return at(o,g)&&(g.hitSide=!0),g}function $a(e,t,n,r){var i,o,l=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(s-.5*Nr(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Cr(e,a,i)).outside;){if(n<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*n}return o}var Ja=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new F,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Qa(e,t){var n=tr(e,t.line);if(!n||n.hidden)return null;var r=$e(e.doc,t.line),i=Jn(n,r,t.line),o=de(r,e.doc.direction),l="left";o&&(l=ce(o,t.ch)%2?"right":"left");var a=lr(i.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function es(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ts(e,t){return t&&(e.bad=!0),e}function ns(e,t,n,r,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(e){return function(t){return t.id==e}}function c(){l&&(o+=a,s&&(o+=a),l=s=!1)}function f(e){e&&(c(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void f(n);var o,h=t.getAttribute("cm-marker");if(h){var p=e.findMarks(ot(r,0),ot(i+1,0),u(+h));return void(p.length&&(o=p[0].find(0))&&f(Je(e.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var v=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;v&&c();for(var m=0;m<t.childNodes.length;m++)d(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),v&&(l=!0)}else 3==t.nodeType&&f(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;d(t),t!=n;)t=t.nextSibling,s=!1;return o}function rs(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return ts(e.clipPos(ot(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return is(o,t,n)}}function is(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!O(r,t))return ts(ot(tt(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?U(e.rest):e.line;return ts(ot(tt(o),o.text.length),i)}var l=3==t.nodeType?t:null,a=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var s=e.measure,u=s.maps;function c(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?s.map:u[i],l=0;l<o.length;l+=3){var a=o[l+2];if(a==t||a==n){var c=tt(i<0?e.line:e.rest[i]),f=o[l]+r;return(r<0||a!=t)&&(f=o[l+(r?1:0)]),ot(c,f)}}}var f=c(l,a,n);if(f)return ts(f,i);for(var d=a.nextSibling,h=l?l.nodeValue.length-n:0;d;d=d.nextSibling){if(f=c(d,d.firstChild,0))return ts(ot(f.line,f.ch-h),i);h+=d.textContent.length}for(var p=a.previousSibling,v=n;p;p=p.previousSibling){if(f=c(p,p.firstChild,-1))return ts(ot(f.line,f.ch+v),i);v+=p.textContent.length}}Ja.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function l(e){if(o(e)&&!ye(r,e)){if(r.somethingSelected())Ba({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Ga(r);Ba({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,V),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var l=_a.text.join("\n");if(e.clipboardData.setData("Text",l),e.clipboardData.getData("Text")==l)return void e.preventDefault()}var a=Ya(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=_a.text.join("\n");var u=document.activeElement;P(s),setTimeout((function(){r.display.lineSpace.removeChild(a),u.focus(),u==i&&n.showPrimarySelection()}),50)}}Xa(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),pe(i,"paste",(function(e){!o(e)||ye(r,e)||ja(e,r)||a<=11&&setTimeout(Ri(r,(function(){return t.updateFromDOM()})),20)})),pe(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),pe(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),pe(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),pe(i,"touchstart",(function(){return n.forceCompositionEnd()})),pe(i,"input",(function(){t.composing||t.readFromDOMSoon()})),pe(i,"copy",l),pe(i,"cut",l)},Ja.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ja.prototype.prepareSelection=function(){var e=jr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ja.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ja.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ja.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var l=rs(t,e.anchorNode,e.anchorOffset),a=rs(t,e.focusNode,e.focusOffset);if(!l||l.bad||!a||a.bad||0!=lt(ct(l,a),i)||0!=lt(ut(l,a),o)){var s=t.display.view,u=i.line>=t.display.viewFrom&&Qa(t,i)||{node:s[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Qa(t,o);if(!c){var f=s[s.length-1].measure,d=f.maps?f.maps[f.maps.length-1]:f.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(u&&c){var h,p=e.rangeCount&&e.getRangeAt(0);try{h=k(u.node,u.offset,c.offset,c.node)}catch(e){}h&&(!n&&t.state.focused?(e.collapse(u.node,u.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ja.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Ja.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},Ja.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ja.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},Ja.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ja.prototype.blur=function(){this.div.blur()},Ja.prototype.getField=function(){return this.div},Ja.prototype.supportsTouch=function(){return!0},Ja.prototype.receivedFocus=function(){var e=this;function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.selectionInEditor()?this.pollSelection():Oi(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,t)},Ja.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ja.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(m&&c&&this.cm.display.gutterSpecs.length&&es(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=rs(t,e.anchorNode,e.anchorOffset),r=rs(t,e.focusNode,e.focusOffset);n&&r&&Oi(t,(function(){Bo(t.doc,ao(n,r),V),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Ja.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),l=o.from(),a=o.to();if(0==l.ch&&l.line>r.firstLine()&&(l=ot(l.line-1,$e(r.doc,l.line-1).length)),a.ch==$e(r.doc,a.line).text.length&&a.line<r.lastLine()&&(a=ot(a.line+1,0)),l.line<i.viewFrom||a.line>i.viewTo-1)return!1;l.line==i.viewFrom||0==(e=Wr(r,l.line))?(t=tt(i.view[0].line),n=i.view[0].node):(t=tt(i.view[e].line),n=i.view[e-1].node.nextSibling);var s,u,c=Wr(r,a.line);if(c==i.view.length-1?(s=i.viewTo-1,u=i.lineDiv.lastChild):(s=tt(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(ns(r,n,u,t,s)),d=Je(r.doc,ot(t,0),ot(s,$e(r.doc,s).text.length));f.length>1&&d.length>1;)if(U(f)==U(d))f.pop(),d.pop(),s--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var h=0,p=0,v=f[0],m=d[0],g=Math.min(v.length,m.length);h<g&&v.charCodeAt(h)==m.charCodeAt(h);)++h;for(var y=U(f),b=U(d),w=Math.min(y.length-(1==f.length?h:0),b.length-(1==d.length?h:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==f.length&&1==d.length&&t==l.line)for(;h&&h>l.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(h).replace(/\u200b+$/,"");var x=ot(t,h),C=ot(s,d.length?U(d).length-p:0);return f.length>1||f[0]||lt(x,C)?(il(r.doc,f,x,C,"+input"),!0):void 0},Ja.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ja.prototype.reset=function(){this.forceCompositionEnd()},Ja.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ja.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ja.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Oi(this.cm,(function(){return Ir(e.cm)}))},Ja.prototype.setUneditable=function(e){e.contentEditable="false"},Ja.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ri(this.cm,Va)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ja.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ja.prototype.onContextMenu=function(){},Ja.prototype.resetPosition=function(){},Ja.prototype.needsContentAttribute=!0;var os=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new F,this.hasSelection=!1,this.composing=null};function ls(e,t){if((t=t?I(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=R();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(pe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(me(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var a=Ia((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a}function as(e){e.off=me,e.on=pe,e.wheelEventPixels=no,e.Doc=Sl,e.splitLines=De,e.countColumn=H,e.findColumn=G,e.isWordChar=te,e.Pass=B,e.signal=ge,e.Line=un,e.changeEnd=so,e.scrollbarModel=wi,e.Pos=ot,e.cmpPos=lt,e.modes=Fe,e.mimeModes=ze,e.resolveMode=Ve,e.getMode=je,e.modeExtensions=Ke,e.extendMode=Ge,e.copyState=Xe,e.startState=Ue,e.innerMode=Ye,e.commands=$l,e.keyMap=Hl,e.keyName=jl,e.isModifierKey=Bl,e.lookupKey=_l,e.normalizeKeyMap=zl,e.StringStream=qe,e.SharedTextMarker=gl,e.TextMarker=vl,e.LineWidget=fl,e.e_preventDefault=Ce,e.e_stopPropagation=Se,e.e_stop=ke,e.addClass=A,e.contains=O,e.rmClass=L,e.keyNames=Dl}os.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ye(r,e)){if(r.somethingSelected())Ba({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Ga(r);Ba({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,V):(n.prevInput="",i.value=t.text.join("\n"),P(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(i.style.width="0px"),pe(i,"input",(function(){l&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),pe(i,"paste",(function(e){ye(r,e)||ja(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pe(i,"cut",o),pe(i,"copy",o),pe(e.scroller,"paste",(function(t){if(!jn(e,t)&&!ye(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),pe(e.lineSpace,"selectstart",(function(t){jn(e,t)||Ce(t)})),pe(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),pe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},os.prototype.createField=function(e){this.wrapper=Ya(),this.textarea=this.wrapper.firstChild},os.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},os.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=jr(e);if(e.options.moveInputWithCursor){var i=br(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},os.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},os.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),l&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",l&&a>=9&&(this.hasSelection=null))}},os.prototype.getField=function(){return this.textarea},os.prototype.supportsTouch=function(){return!1},os.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||R()!=this.textarea))try{this.textarea.focus()}catch(e){}},os.prototype.blur=function(){this.textarea.blur()},os.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},os.prototype.receivedFocus=function(){this.slowPoll()},os.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},os.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},os.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Pe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(l&&a>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,u=Math.min(r.length,i.length);s<u&&r.charCodeAt(s)==i.charCodeAt(s);)++s;return Oi(t,(function(){Va(t,i.slice(s),r.length-s,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},os.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},os.prototype.onKeyPress=function(){l&&a>=9&&(this.hasSelection=null),this.fastPoll()},os.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Pr(n,e),u=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Ri(n,Bo)(n.doc,ao(o),V);var c,d=i.style.cssText,h=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(c=window.scrollY),r.input.focus(),s&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),l&&a>=9&&m(),S){ke(e);var v=function(){me(window,"mouseup",v),setTimeout(g,20)};pe(window,"mouseup",v)}else setTimeout(g,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=d,l&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!l||l&&a<9)&&m();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?Ri(n,qo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},os.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},os.prototype.setUneditable=function(){},os.prototype.needsContentAttribute=!1,Da(Ia),Ua(Ia);var ss="iter insert remove copy getEditor constructor".split(" ");for(var us in Sl.prototype)Sl.prototype.hasOwnProperty(us)&&z(ss,us)<0&&(Ia.prototype[us]=function(e){return function(){return e.apply(this.doc,arguments)}}(Sl.prototype[us]));return xe(Sl),Ia.inputStyles={textarea:os,contenteditable:Ja},Ia.defineMode=function(e){Ia.defaults.mode||"null"==e||(Ia.defaults.mode=e),_e.apply(this,arguments)},Ia.defineMIME=Be,Ia.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ia.defineMIME("text/plain","null"),Ia.defineExtension=function(e,t){Ia.prototype[e]=t},Ia.defineDocExtension=function(e,t){Sl.prototype[e]=t},Ia.fromTextArea=ls,as(Ia),Ia.version="5.58.2",Ia}()},66003:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(75931),i=n(33885),o=n(76190),l=n(59301),a=["show"];function s(e,t){return l.useMemo((function(){var n={};t&&(n.show="object"===(0,o.Z)(t)&&t.formatter?t.formatter:!!t);var l=n=(0,i.Z)((0,i.Z)({},n),e),s=l.show,u=(0,r.Z)(l,a);return(0,i.Z)((0,i.Z)({},u),{},{show:!!s,showFormatter:"function"==typeof s?s:void 0,strategy:u.strategy||function(e){return e.length}})}),[e,t])}},36901:function(e,t,n){"use strict";n.r(t),n.d(t,{BaseInput:function(){return f},default:function(){return b}});var r=n(33885),i=n(54476),o=n(20068),l=n(76190),a=n(92310),s=n.n(a),u=n(59301),c=n(30292),f=u.forwardRef((function(e,t){var n,a,f,d=e.inputElement,h=e.children,p=e.prefixCls,v=e.prefix,m=e.suffix,g=e.addonBefore,y=e.addonAfter,b=e.className,w=e.style,x=e.disabled,C=e.readOnly,S=e.focused,M=e.triggerFocus,k=e.allowClear,L=e.value,E=e.handleReset,T=e.hidden,N=e.classes,Z=e.classNames,O=e.dataAttrs,R=e.styles,A=e.components,D=e.onClear,P=null!=h?h:d,W=(null==A?void 0:A.affixWrapper)||"span",I=(null==A?void 0:A.groupWrapper)||"span",H=(null==A?void 0:A.wrapper)||"span",F=(null==A?void 0:A.groupAddon)||"span",z=(0,u.useRef)(null),_=(0,c.X3)(e),B=(0,u.cloneElement)(P,{value:L,className:s()(null===(n=P.props)||void 0===n?void 0:n.className,!_&&(null==Z?void 0:Z.variant))||null}),V=(0,u.useRef)(null);if(u.useImperativeHandle(t,(function(){return{nativeElement:V.current||z.current}})),_){var j=null;if(k){var K=!x&&!C&&L,G="".concat(p,"-clear-icon"),X="object"===(0,l.Z)(k)&&null!=k&&k.clearIcon?k.clearIcon:"✖";j=u.createElement("button",{type:"button",tabIndex:-1,onClick:function(e){null==E||E(e),null==D||D()},onMouseDown:function(e){return e.preventDefault()},className:s()(G,(0,o.Z)((0,o.Z)({},"".concat(G,"-hidden"),!K),"".concat(G,"-has-suffix"),!!m))},X)}var Y="".concat(p,"-affix-wrapper"),U=s()(Y,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(p,"-disabled"),x),"".concat(Y,"-disabled"),x),"".concat(Y,"-focused"),S),"".concat(Y,"-readonly"),C),"".concat(Y,"-input-with-clear-btn"),m&&k&&L),null==N?void 0:N.affixWrapper,null==Z?void 0:Z.affixWrapper,null==Z?void 0:Z.variant),q=(m||k)&&u.createElement("span",{className:s()("".concat(p,"-suffix"),null==Z?void 0:Z.suffix),style:null==R?void 0:R.suffix},j,m);B=u.createElement(W,(0,i.Z)({className:U,style:null==R?void 0:R.affixWrapper,onClick:function(e){var t;null!==(t=z.current)&&void 0!==t&&t.contains(e.target)&&(null==M||M())}},null==O?void 0:O.affixWrapper,{ref:z}),v&&u.createElement("span",{className:s()("".concat(p,"-prefix"),null==Z?void 0:Z.prefix),style:null==R?void 0:R.prefix},v),B,q)}if((0,c.He)(e)){var $="".concat(p,"-group"),J="".concat($,"-addon"),Q="".concat($,"-wrapper"),ee=s()("".concat(p,"-wrapper"),$,null==N?void 0:N.wrapper,null==Z?void 0:Z.wrapper),te=s()(Q,(0,o.Z)({},"".concat(Q,"-disabled"),x),null==N?void 0:N.group,null==Z?void 0:Z.groupWrapper);B=u.createElement(I,{className:te,ref:V},u.createElement(H,{className:ee},g&&u.createElement(F,{className:J},g),B,y&&u.createElement(F,{className:J},y)))}return u.cloneElement(B,{className:s()(null===(a=B.props)||void 0===a?void 0:a.className,b)||null,style:(0,r.Z)((0,r.Z)({},null===(f=B.props)||void 0===f?void 0:f.style),w),hidden:T})})),d=n(94480),h=n(42978),p=n(75931),v=n(18929),m=n(2738),g=n(66003),y=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],b=(0,u.forwardRef)((function(e,t){var n=e.autoComplete,l=e.onChange,a=e.onFocus,b=e.onBlur,w=e.onPressEnter,x=e.onKeyDown,C=e.onKeyUp,S=e.prefixCls,M=void 0===S?"rc-input":S,k=e.disabled,L=e.htmlSize,E=e.className,T=e.maxLength,N=e.suffix,Z=e.showCount,O=e.count,R=e.type,A=void 0===R?"text":R,D=e.classes,P=e.classNames,W=e.styles,I=e.onCompositionStart,H=e.onCompositionEnd,F=(0,p.Z)(e,y),z=(0,u.useState)(!1),_=(0,h.Z)(z,2),B=_[0],V=_[1],j=(0,u.useRef)(!1),K=(0,u.useRef)(!1),G=(0,u.useRef)(null),X=(0,u.useRef)(null),Y=function(e){G.current&&(0,c.nH)(G.current,e)},U=(0,v.Z)(e.defaultValue,{value:e.value}),q=(0,h.Z)(U,2),$=q[0],J=q[1],Q=null==$?"":String($),ee=(0,u.useState)(null),te=(0,h.Z)(ee,2),ne=te[0],re=te[1],ie=(0,g.Z)(O,Z),oe=ie.max||T,le=ie.strategy(Q),ae=!!oe&&le>oe;(0,u.useImperativeHandle)(t,(function(){var e;return{focus:Y,blur:function(){var e;null===(e=G.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=G.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=G.current)||void 0===e||e.select()},input:G.current,nativeElement:(null===(e=X.current)||void 0===e?void 0:e.nativeElement)||G.current}})),(0,u.useEffect)((function(){K.current&&(K.current=!1),V((function(e){return(!e||!k)&&e}))}),[k]);var se=function(e,t,n){var r,i,o=t;if(!j.current&&ie.exceedFormatter&&ie.max&&ie.strategy(t)>ie.max)t!==(o=ie.exceedFormatter(t,{max:ie.max}))&&re([(null===(r=G.current)||void 0===r?void 0:r.selectionStart)||0,(null===(i=G.current)||void 0===i?void 0:i.selectionEnd)||0]);else if("compositionEnd"===n.source)return;J(o),G.current&&(0,c.rJ)(G.current,e,l,o)};(0,u.useEffect)((function(){var e;ne&&(null===(e=G.current)||void 0===e||e.setSelectionRange.apply(e,(0,d.Z)(ne)))}),[ne]);var ue,ce=function(e){se(e,e.target.value,{source:"change"})},fe=function(e){j.current=!1,se(e,e.currentTarget.value,{source:"compositionEnd"}),null==H||H(e)},de=function(e){w&&"Enter"===e.key&&!K.current&&(K.current=!0,w(e)),null==x||x(e)},he=function(e){"Enter"===e.key&&(K.current=!1),null==C||C(e)},pe=function(e){V(!0),null==a||a(e)},ve=function(e){K.current&&(K.current=!1),V(!1),null==b||b(e)},me=ae&&"".concat(M,"-out-of-range");return u.createElement(f,(0,i.Z)({},F,{prefixCls:M,className:s()(E,me),handleReset:function(e){J(""),Y(),G.current&&(0,c.rJ)(G.current,e,l)},value:Q,focused:B,triggerFocus:Y,suffix:function(){var e=Number(oe)>0;if(N||ie.show){var t=ie.showFormatter?ie.showFormatter({value:Q,count:le,maxLength:oe}):"".concat(le).concat(e?" / ".concat(oe):"");return u.createElement(u.Fragment,null,ie.show&&u.createElement("span",{className:s()("".concat(M,"-show-count-suffix"),(0,o.Z)({},"".concat(M,"-show-count-has-suffix"),!!N),null==P?void 0:P.count),style:(0,r.Z)({},null==W?void 0:W.count)},t),N)}return null}(),disabled:k,classes:D,classNames:P,styles:W}),(ue=(0,m.Z)(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]),u.createElement("input",(0,i.Z)({autoComplete:n},ue,{onChange:ce,onFocus:pe,onBlur:ve,onKeyDown:de,onKeyUp:he,className:s()(M,(0,o.Z)({},"".concat(M,"-disabled"),k),null==P?void 0:P.input),style:null==W?void 0:W.input,ref:G,size:L,type:A,onCompositionStart:function(e){j.current=!0,null==I||I(e)},onCompositionEnd:fe}))))}))},30292:function(e,t,n){"use strict";function r(e){return!(!e.addonBefore&&!e.addonAfter)}function i(e){return!!(e.prefix||e.suffix||e.allowClear)}function o(e,t,n){var r=t.cloneNode(!0),i=Object.create(e,{target:{value:r},currentTarget:{value:r}});return r.value=n,"number"==typeof t.selectionStart&&"number"==typeof t.selectionEnd&&(r.selectionStart=t.selectionStart,r.selectionEnd=t.selectionEnd),r.setSelectionRange=function(){t.setSelectionRange.apply(t,arguments)},i}function l(e,t,n,r){if(n){var i=t;"click"!==t.type?"file"===e.type||void 0===r?n(i):n(i=o(t,e,r)):n(i=o(t,e,""))}}function a(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}n.d(t,{He:function(){return r},X3:function(){return i},nH:function(){return a},rJ:function(){return l}})},11780:function(e,t,n){"use strict";n.d(t,{Z:function(){return P}});var r=n(54476),i=n(33885),o=n(42978),l=n(75931),a=n(59301),s=n(92310),u=n.n(s),c=n(29301),f=n(34280),d=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],h=void 0;function p(e,t){var n=e.prefixCls,o=e.invalidate,s=e.item,f=e.renderItem,p=e.responsive,v=e.responsiveDisabled,m=e.registerSize,g=e.itemKey,y=e.className,b=e.style,w=e.children,x=e.display,C=e.order,S=e.component,M=void 0===S?"div":S,k=(0,l.Z)(e,d),L=p&&!x;function E(e){m(g,e)}a.useEffect((function(){return function(){E(null)}}),[]);var T,N=f&&s!==h?f(s,{index:C}):w;o||(T={opacity:L?0:1,height:L?0:h,overflowY:L?"hidden":h,order:p?C:h,pointerEvents:L?"none":h,position:L?"absolute":h});var Z={};L&&(Z["aria-hidden"]=!0);var O=a.createElement(M,(0,r.Z)({className:u()(!o&&n,y),style:(0,i.Z)((0,i.Z)({},T),b)},Z,k,{ref:t}),N);return p&&(O=a.createElement(c.Z,{onResize:function(e){E(e.offsetWidth)},disabled:v},O)),O}var v=a.forwardRef(p);v.displayName="Item";var m=v,g=n(6089),y=n(4676),b=n(16089);function w(){var e=a.useRef(null);return function(t){e.current||(e.current=[],function(e){if("undefined"==typeof MessageChannel)(0,b.Z)(e);else{var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(void 0)}}((function(){(0,y.unstable_batchedUpdates)((function(){e.current.forEach((function(e){e()})),e.current=null}))}))),e.current.push(t)}}function x(e,t){var n=a.useState(t),r=(0,o.Z)(n,2),i=r[0],l=r[1];return[i,(0,g.Z)((function(t){e((function(){l(t)}))}))]}var C=a.createContext(null),S=["component"],M=["className"],k=["className"],L=function(e,t){var n=a.useContext(C);if(!n){var i=e.component,o=void 0===i?"div":i,s=(0,l.Z)(e,S);return a.createElement(o,(0,r.Z)({},s,{ref:t}))}var c=n.className,f=(0,l.Z)(n,M),d=e.className,h=(0,l.Z)(e,k);return a.createElement(C.Provider,{value:null},a.createElement(m,(0,r.Z)({ref:t,className:u()(c,d)},f,h)))},E=a.forwardRef(L);E.displayName="RawItem";var T=E,N=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Z="responsive",O="invalidate";function R(e){return"+ ".concat(e.length," ...")}function A(e,t){var n=e.prefixCls,s=void 0===n?"rc-overflow":n,d=e.data,h=void 0===d?[]:d,p=e.renderItem,v=e.renderRawItem,g=e.itemKey,y=e.itemWidth,b=void 0===y?10:y,S=e.ssr,M=e.style,k=e.className,L=e.maxCount,E=e.renderRest,T=e.renderRawRest,A=e.suffix,D=e.component,P=void 0===D?"div":D,W=e.itemComponent,I=e.onVisibleChange,H=(0,l.Z)(e,N),F="full"===S,z=w(),_=x(z,null),B=(0,o.Z)(_,2),V=B[0],j=B[1],K=V||0,G=x(z,new Map),X=(0,o.Z)(G,2),Y=X[0],U=X[1],q=x(z,0),$=(0,o.Z)(q,2),J=$[0],Q=$[1],ee=x(z,0),te=(0,o.Z)(ee,2),ne=te[0],re=te[1],ie=x(z,0),oe=(0,o.Z)(ie,2),le=oe[0],ae=oe[1],se=(0,a.useState)(null),ue=(0,o.Z)(se,2),ce=ue[0],fe=ue[1],de=(0,a.useState)(null),he=(0,o.Z)(de,2),pe=he[0],ve=he[1],me=a.useMemo((function(){return null===pe&&F?Number.MAX_SAFE_INTEGER:pe||0}),[pe,V]),ge=(0,a.useState)(!1),ye=(0,o.Z)(ge,2),be=ye[0],we=ye[1],xe="".concat(s,"-item"),Ce=Math.max(J,ne),Se=L===Z,Me=h.length&&Se,ke=L===O,Le=Me||"number"==typeof L&&h.length>L,Ee=(0,a.useMemo)((function(){var e=h;return Me?e=null===V&&F?h:h.slice(0,Math.min(h.length,K/b)):"number"==typeof L&&(e=h.slice(0,L)),e}),[h,b,V,L,Me]),Te=(0,a.useMemo)((function(){return Me?h.slice(me+1):h.slice(Ee.length)}),[h,Ee,Me,me]),Ne=(0,a.useCallback)((function(e,t){var n;return"function"==typeof g?g(e):null!==(n=g&&(null==e?void 0:e[g]))&&void 0!==n?n:t}),[g]),Ze=(0,a.useCallback)(p||function(e){return e},[p]);function Oe(e,t,n){(pe!==e||void 0!==t&&t!==ce)&&(ve(e),n||(we(e<h.length-1),null==I||I(e)),void 0!==t&&fe(t))}function Re(e,t){U((function(n){var r=new Map(n);return null===t?r.delete(e):r.set(e,t),r}))}function Ae(e){return Y.get(Ne(Ee[e],e))}(0,f.Z)((function(){if(K&&"number"==typeof Ce&&Ee){var e=le,t=Ee.length,n=t-1;if(!t)return void Oe(0,null);for(var r=0;r<t;r+=1){var i=Ae(r);if(F&&(i=i||0),void 0===i){Oe(r-1,void 0,!0);break}if(e+=i,0===n&&e<=K||r===n-1&&e+Ae(n)<=K){Oe(n,null);break}if(e+Ce>K){Oe(r-1,e-i-le+ne);break}}A&&Ae(0)+le>K&&fe(null)}}),[K,Y,ne,le,Ne,Ee]);var De=be&&!!Te.length,Pe={};null!==ce&&Me&&(Pe={position:"absolute",left:ce,top:0});var We={prefixCls:xe,responsive:Me,component:W,invalidate:ke},Ie=v?function(e,t){var n=Ne(e,t);return a.createElement(C.Provider,{key:n,value:(0,i.Z)((0,i.Z)({},We),{},{order:t,item:e,itemKey:n,registerSize:Re,display:t<=me})},v(e,t))}:function(e,t){var n=Ne(e,t);return a.createElement(m,(0,r.Z)({},We,{order:t,key:n,item:e,renderItem:Ze,itemKey:n,registerSize:Re,display:t<=me}))},He={order:De?me:Number.MAX_SAFE_INTEGER,className:"".concat(xe,"-rest"),registerSize:function(e,t){re(t),Q(ne)},display:De},Fe=E||R,ze=T?a.createElement(C.Provider,{value:(0,i.Z)((0,i.Z)({},We),He)},T(Te)):a.createElement(m,(0,r.Z)({},We,He),"function"==typeof Fe?Fe(Te):Fe),_e=a.createElement(P,(0,r.Z)({className:u()(!ke&&s,k),style:M,ref:t},H),Ee.map(Ie),Le?ze:null,A&&a.createElement(m,(0,r.Z)({},We,{responsive:Se,responsiveDisabled:!Me,order:me,className:"".concat(xe,"-suffix"),registerSize:function(e,t){ae(t)},display:!0,style:Pe}),A));return Se?a.createElement(c.Z,{onResize:function(e,t){j(t.clientWidth)},disabled:!Me},_e):_e}var D=a.forwardRef(A);D.displayName="Overflow",D.Item=T,D.RESPONSIVE=Z,D.INVALIDATE=O;var P=D},29301:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var r=n(54476),i=n(59301),o=n(11592),l=(n(48736),n(33885)),a=n(76190),s=n(76846),u=n(8654),c=i.createContext(null);var f=n(76374),d=new Map;var h=new f.Z((function(e){e.forEach((function(e){var t,n=e.target;null===(t=d.get(n))||void 0===t||t.forEach((function(e){return e(n)}))}))}));var p=n(67732),v=n(83652),m=n(42403),g=n(158),y=function(e){(0,m.Z)(n,e);var t=(0,g.Z)(n);function n(){return(0,p.Z)(this,n),t.apply(this,arguments)}return(0,v.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(i.Component);function b(e,t){var n=e.children,r=e.disabled,o=i.useRef(null),f=i.useRef(null),p=i.useContext(c),v="function"==typeof n,m=v?n(o):n,g=i.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),b=!v&&i.isValidElement(m)&&(0,u.Yr)(m),w=b?(0,u.C4)(m):null,x=(0,u.x1)(w,o),C=function(){var e;return(0,s.ZP)(o.current)||(o.current&&"object"===(0,a.Z)(o.current)?(0,s.ZP)(null===(e=o.current)||void 0===e?void 0:e.nativeElement):null)||(0,s.ZP)(f.current)};i.useImperativeHandle(t,(function(){return C()}));var S=i.useRef(e);S.current=e;var M=i.useCallback((function(e){var t=S.current,n=t.onResize,r=t.data,i=e.getBoundingClientRect(),o=i.width,a=i.height,s=e.offsetWidth,u=e.offsetHeight,c=Math.floor(o),f=Math.floor(a);if(g.current.width!==c||g.current.height!==f||g.current.offsetWidth!==s||g.current.offsetHeight!==u){var d={width:c,height:f,offsetWidth:s,offsetHeight:u};g.current=d;var h=s===Math.round(o)?o:s,v=u===Math.round(a)?a:u,m=(0,l.Z)((0,l.Z)({},d),{},{offsetWidth:h,offsetHeight:v});null==p||p(m,e,r),n&&Promise.resolve().then((function(){n(m,e)}))}}),[]);return i.useEffect((function(){var e,t,n=C();return n&&!r&&(e=n,t=M,d.has(e)||(d.set(e,new Set),h.observe(e)),d.get(e).add(t)),function(){return function(e,t){d.has(e)&&(d.get(e).delete(t),d.get(e).size||(h.unobserve(e),d.delete(e)))}(n,M)}}),[o.current,r]),i.createElement(y,{ref:f},b?i.cloneElement(m,{ref:x}):m)}var w=i.forwardRef(b);function x(e,t){var n=e.children;return("function"==typeof n?[n]:(0,o.Z)(n)).map((function(n,o){var l=(null==n?void 0:n.key)||"".concat("rc-observer-key","-").concat(o);return i.createElement(w,(0,r.Z)({},e,{key:l,ref:0===o?t:void 0}),n)}))}var C=i.forwardRef(x);C.Collection=function(e){var t=e.children,n=e.onBatchResize,r=i.useRef(0),o=i.useRef([]),l=i.useContext(c),a=i.useCallback((function(e,t,i){r.current+=1;var a=r.current;o.current.push({size:e,element:t,data:i}),Promise.resolve().then((function(){a===r.current&&(null==n||n(o.current),o.current=[])})),null==l||l(e,t,i)}),[n,l]);return i.createElement(c.Provider,{value:a},t)};var S=C},6551:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s}});var r=n(42978),i=n(59301),o=n(47273),l=0,a=(0,o.Z)();function s(e){var t=i.useState(),n=(0,r.Z)(t,2),o=n[0],s=n[1];return i.useEffect((function(){var e;s("rc_select_".concat((a?(e=l,l+=1):e="TEST_OR_SSR",e)))}),[]),e||o}},37463:function(e,t,n){"use strict";n.d(t,{Ac:function(){return ee},Xo:function(){return ne},Wx:function(){return ie},ZP:function(){return ke},lk:function(){return w}});var r=n(54476),i=n(94480),o=n(20068),l=n(33885),a=n(42978),s=n(75931),u=n(76190),c=n(18929),f=n(48736),d=n(59301),h=n(92310),p=n.n(h),v=n(34280),m=n(49658),g=n(8654),y=function(e){var t=e.className,n=e.customizeIcon,r=e.customizeIconProps,i=e.children,o=e.onMouseDown,l=e.onClick,a="function"==typeof n?n(r):n;return d.createElement("span",{className:t,onMouseDown:function(e){e.preventDefault(),null==o||o(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:l,"aria-hidden":!0},void 0!==a?a:d.createElement("span",{className:p()(t.split(/\s+/).map((function(e){return"".concat(e,"-icon")})))},i))},b=d.createContext(null);function w(){return d.useContext(b)}function x(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=d.useRef(null),n=d.useRef(null);function r(r){(r||null===t.current)&&(t.current=r),window.clearTimeout(n.current),n.current=window.setTimeout((function(){t.current=null}),e)}return d.useEffect((function(){return function(){window.clearTimeout(n.current)}}),[]),[function(){return t.current},r]}var C=n(10228);var S=n(26112),M=n(11780);var k=function(e,t,n){var r=(0,l.Z)((0,l.Z)({},e),n?t:{});return Object.keys(t).forEach((function(n){var i=t[n];"function"==typeof i&&(r[n]=function(){for(var t,r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return i.apply(void 0,o),null===(t=e[n])||void 0===t?void 0:t.call.apply(t,[e].concat(o))})})),r},L=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],E=function(e,t){var n=e.prefixCls,r=e.id,i=e.inputElement,o=e.autoFocus,a=e.autoComplete,u=e.editable,c=e.activeDescendantId,h=e.value,v=e.open,m=e.attrs,y=(0,s.Z)(e,L),b=i||d.createElement("input",null),w=b,x=w.ref,C=w.props;return(0,f.Kp)(!("maxLength"in b.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),b=d.cloneElement(b,(0,l.Z)((0,l.Z)((0,l.Z)({type:"search"},k(y,C,!0)),{},{id:r,ref:(0,g.sQ)(t,x),autoComplete:a||"off",autoFocus:o,className:p()("".concat(n,"-selection-search-input"),null==C?void 0:C.className),role:"combobox","aria-expanded":v||!1,"aria-haspopup":"listbox","aria-owns":"".concat(r,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(r,"_list"),"aria-activedescendant":v?c:void 0},m),{},{value:u?h:"",readOnly:!u,unselectable:u?null:"on",style:(0,l.Z)((0,l.Z)({},C.style),{},{opacity:u?null:0})}))};var T=d.forwardRef(E);function N(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}var Z="undefined"!=typeof window&&window.document&&window.document.documentElement;function O(e){return["string","number"].includes((0,u.Z)(e))}function R(e){var t=void 0;return e&&(O(e.title)?t=e.title.toString():O(e.label)&&(t=e.label.toString())),t}function A(e){var t;return null!==(t=e.key)&&void 0!==t?t:e.value}var D=function(e){e.preventDefault(),e.stopPropagation()},P=function(e){var t,n,r=e.id,i=e.prefixCls,l=e.values,s=e.open,u=e.searchValue,c=e.autoClearSearchValue,f=e.inputRef,h=e.placeholder,v=e.disabled,m=e.mode,g=e.showSearch,b=e.autoFocus,w=e.autoComplete,x=e.activeDescendantId,C=e.tabIndex,k=e.removeIcon,L=e.maxTagCount,E=e.maxTagTextLength,N=e.maxTagPlaceholder,O=void 0===N?function(e){return"+ ".concat(e.length," ...")}:N,P=e.tagRender,W=e.onToggleOpen,I=e.onRemove,H=e.onInputChange,F=e.onInputPaste,z=e.onInputKeyDown,_=e.onInputMouseDown,B=e.onInputCompositionStart,V=e.onInputCompositionEnd,j=e.onInputBlur,K=d.useRef(null),G=(0,d.useState)(0),X=(0,a.Z)(G,2),Y=X[0],U=X[1],q=(0,d.useState)(!1),$=(0,a.Z)(q,2),J=$[0],Q=$[1],ee="".concat(i,"-selection"),te=s||"multiple"===m&&!1===c||"tags"===m?u:"",ne="tags"===m||"multiple"===m&&!1===c||g&&(s||J);t=function(){U(K.current.scrollWidth)},n=[te],Z?d.useLayoutEffect(t,n):d.useEffect(t,n);var re=function(e,t,n,r,i){return d.createElement("span",{title:R(e),className:p()("".concat(ee,"-item"),(0,o.Z)({},"".concat(ee,"-item-disabled"),n))},d.createElement("span",{className:"".concat(ee,"-item-content")},t),r&&d.createElement(y,{className:"".concat(ee,"-item-remove"),onMouseDown:D,onClick:i,customizeIcon:k},"×"))},ie=function(e,t,n,r,i,o){return d.createElement("span",{onMouseDown:function(e){D(e),W(!s)}},P({label:t,value:e,disabled:n,closable:r,onClose:i,isMaxTag:!!o}))},oe=d.createElement("div",{className:"".concat(ee,"-search"),style:{width:Y},onFocus:function(){Q(!0)},onBlur:function(){Q(!1)}},d.createElement(T,{ref:f,open:s,prefixCls:i,id:r,inputElement:null,disabled:v,autoFocus:b,autoComplete:w,editable:ne,activeDescendantId:x,value:te,onKeyDown:z,onMouseDown:_,onChange:H,onPaste:F,onCompositionStart:B,onCompositionEnd:V,onBlur:j,tabIndex:C,attrs:(0,S.Z)(e,!0)}),d.createElement("span",{ref:K,className:"".concat(ee,"-search-mirror"),"aria-hidden":!0},te," ")),le=d.createElement(M.Z,{prefixCls:"".concat(ee,"-overflow"),data:l,renderItem:function(e){var t=e.disabled,n=e.label,r=e.value,i=!v&&!t,o=n;if("number"==typeof E&&("string"==typeof n||"number"==typeof n)){var l=String(o);l.length>E&&(o="".concat(l.slice(0,E),"..."))}var a=function(t){t&&t.stopPropagation(),I(e)};return"function"==typeof P?ie(r,o,t,i,a):re(e,o,t,i,a)},renderRest:function(e){if(!l.length)return null;var t="function"==typeof O?O(e):O;return"function"==typeof P?ie(void 0,t,!1,!1,void 0,!0):re({title:t},t,!1)},suffix:oe,itemKey:A,maxCount:L});return d.createElement("span",{className:"".concat(ee,"-wrap")},le,!l.length&&!te&&d.createElement("span",{className:"".concat(ee,"-placeholder")},h))},W=function(e){var t=e.inputElement,n=e.prefixCls,r=e.id,i=e.inputRef,o=e.disabled,l=e.autoFocus,s=e.autoComplete,u=e.activeDescendantId,c=e.mode,f=e.open,h=e.values,p=e.placeholder,v=e.tabIndex,m=e.showSearch,g=e.searchValue,y=e.activeValue,b=e.maxLength,w=e.onInputKeyDown,x=e.onInputMouseDown,C=e.onInputChange,M=e.onInputPaste,k=e.onInputCompositionStart,L=e.onInputCompositionEnd,E=e.onInputBlur,N=e.title,Z=d.useState(!1),O=(0,a.Z)(Z,2),A=O[0],D=O[1],P="combobox"===c,W=P||m,I=h[0],H=g||"";P&&y&&!A&&(H=y),d.useEffect((function(){P&&D(!1)}),[P,y]);var F=!("combobox"!==c&&!f&&!m)&&!!H,z=void 0===N?R(I):N,_=d.useMemo((function(){return I?null:d.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:F?{visibility:"hidden"}:void 0},p)}),[I,F,p,n]);return d.createElement("span",{className:"".concat(n,"-selection-wrap")},d.createElement("span",{className:"".concat(n,"-selection-search")},d.createElement(T,{ref:i,prefixCls:n,id:r,open:f,inputElement:t,disabled:o,autoFocus:l,autoComplete:s,editable:W,activeDescendantId:u,value:H,onKeyDown:w,onMouseDown:x,onChange:function(e){D(!0),C(e)},onPaste:M,onCompositionStart:k,onCompositionEnd:L,onBlur:E,tabIndex:v,attrs:(0,S.Z)(e,!0),maxLength:P?b:void 0})),!P&&I?d.createElement("span",{className:"".concat(n,"-selection-item"),title:z,style:F?{visibility:"hidden"}:void 0},I.label):null,_)},I=function(e,t){var n=(0,d.useRef)(null),i=(0,d.useRef)(!1),o=e.prefixCls,l=e.open,s=e.mode,u=e.showSearch,c=e.tokenWithEnter,f=e.disabled,h=e.prefix,p=e.autoClearSearchValue,v=e.onSearch,m=e.onSearchSubmit,g=e.onToggleOpen,y=e.onInputKeyDown,b=e.onInputBlur,w=e.domRef;d.useImperativeHandle(t,(function(){return{focus:function(e){n.current.focus(e)},blur:function(){n.current.blur()}}}));var S=x(0),M=(0,a.Z)(S,2),k=M[0],L=M[1],E=(0,d.useRef)(null),T=function(e){!1!==v(e,!0,i.current)&&g(!0)},N={inputRef:n,onInputKeyDown:function(e){var t,r=e.which,o=n.current instanceof HTMLTextAreaElement;(o||!l||r!==C.Z.UP&&r!==C.Z.DOWN||e.preventDefault(),y&&y(e),r!==C.Z.ENTER||"tags"!==s||i.current||l||null==m||m(e.target.value),o&&!l&&~[C.Z.UP,C.Z.DOWN,C.Z.LEFT,C.Z.RIGHT].indexOf(r))||(t=r)&&![C.Z.ESC,C.Z.SHIFT,C.Z.BACKSPACE,C.Z.TAB,C.Z.WIN_KEY,C.Z.ALT,C.Z.META,C.Z.WIN_KEY_RIGHT,C.Z.CTRL,C.Z.SEMICOLON,C.Z.EQUALS,C.Z.CAPS_LOCK,C.Z.CONTEXT_MENU,C.Z.F1,C.Z.F2,C.Z.F3,C.Z.F4,C.Z.F5,C.Z.F6,C.Z.F7,C.Z.F8,C.Z.F9,C.Z.F10,C.Z.F11,C.Z.F12].includes(t)&&g(!0)},onInputMouseDown:function(){L(!0)},onInputChange:function(e){var t=e.target.value;if(c&&E.current&&/[\r\n]/.test(E.current)){var n=E.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,E.current)}E.current=null,T(t)},onInputPaste:function(e){var t=e.clipboardData,n=null==t?void 0:t.getData("text");E.current=n||""},onInputCompositionStart:function(){i.current=!0},onInputCompositionEnd:function(e){i.current=!1,"combobox"!==s&&T(e.target.value)},onInputBlur:b},Z="multiple"===s||"tags"===s?d.createElement(P,(0,r.Z)({},e,N)):d.createElement(W,(0,r.Z)({},e,N));return d.createElement("div",{ref:w,className:"".concat(o,"-selector"),onClick:function(e){e.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){n.current.focus()})):n.current.focus())},onMouseDown:function(e){var t=k();e.target===n.current||t||"combobox"===s&&f||e.preventDefault(),("combobox"===s||u&&t)&&l||(l&&!1!==p&&v("",!0,!1),g())}},h&&d.createElement("div",{className:"".concat(o,"-prefix")},h),Z)};var H=d.forwardRef(I),F=n(65030),z=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],_=function(e,t){var n=e.prefixCls,i=(e.disabled,e.visible),a=e.children,u=e.popupElement,c=e.animation,f=e.transitionName,h=e.dropdownStyle,v=e.dropdownClassName,m=e.direction,g=void 0===m?"ltr":m,y=e.placement,b=e.builtinPlacements,w=e.dropdownMatchSelectWidth,x=e.dropdownRender,C=e.dropdownAlign,S=e.getPopupContainer,M=e.empty,k=e.getTriggerDOMNode,L=e.onPopupVisibleChange,E=e.onPopupMouseEnter,T=(0,s.Z)(e,z),N="".concat(n,"-dropdown"),Z=u;x&&(Z=x(u));var O=d.useMemo((function(){return b||function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"}}}(w)}),[b,w]),R=c?"".concat(N,"-").concat(c):f,A="number"==typeof w,D=d.useMemo((function(){return A?null:!1===w?"minWidth":"width"}),[w,A]),P=h;A&&(P=(0,l.Z)((0,l.Z)({},P),{},{width:w}));var W=d.useRef(null);return d.useImperativeHandle(t,(function(){return{getPopupElement:function(){var e;return null===(e=W.current)||void 0===e?void 0:e.popupElement}}})),d.createElement(F.Z,(0,r.Z)({},T,{showAction:L?["click"]:[],hideAction:L?["click"]:[],popupPlacement:y||("rtl"===g?"bottomRight":"bottomLeft"),builtinPlacements:O,prefixCls:N,popupTransitionName:R,popup:d.createElement("div",{onMouseEnter:E},Z),ref:W,stretch:D,popupAlign:C,popupVisible:i,getPopupContainer:S,popupClassName:p()(v,(0,o.Z)({},"".concat(N,"-empty"),M)),popupStyle:P,getTriggerDOMNode:k,onPopupVisibleChange:L}),a)};var B=d.forwardRef(_),V=n(66712);function j(e,t){var n,r=e.key;return"value"in e&&(n=e.value),null!=r?r:void 0!==n?n:"rc-index-key-".concat(t)}function K(e){return void 0!==e&&!Number.isNaN(e)}function G(e,t){var n=e||{},r=n.label||(t?"children":"label");return{label:r,value:n.value||"value",options:n.options||"options",groupLabel:n.groupLabel||r}}function X(e){var t=(0,l.Z)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return(0,f.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var Y=d.createContext(null);function U(e){var t=e.visible,n=e.values;if(!t)return null;return d.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,50).map((function(e){var t=e.label,n=e.value;return["number","string"].includes((0,u.Z)(t))?t:n})).join(", ")),n.length>50?", ...":null)}var q=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],$=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],J=function(e){return"tags"===e||"multiple"===e},Q=d.forwardRef((function(e,t){var n,f=e.id,h=e.prefixCls,w=e.className,C=e.showSearch,S=e.tagRender,M=e.direction,k=e.omitDomProps,L=e.displayValues,E=e.onDisplayValuesChange,T=e.emptyOptions,N=e.notFoundContent,Z=void 0===N?"Not Found":N,O=e.onClear,R=e.mode,A=e.disabled,D=e.loading,P=e.getInputElement,W=e.getRawInputElement,I=e.open,F=e.defaultOpen,z=e.onDropdownVisibleChange,_=e.activeValue,j=e.onActiveValueChange,G=e.activeDescendantId,X=e.searchValue,Q=e.autoClearSearchValue,ee=e.onSearch,te=e.onSearchSplit,ne=e.tokenSeparators,re=e.allowClear,ie=e.prefix,oe=e.suffixIcon,le=e.clearIcon,ae=e.OptionList,se=e.animation,ue=e.transitionName,ce=e.dropdownStyle,fe=e.dropdownClassName,de=e.dropdownMatchSelectWidth,he=e.dropdownRender,pe=e.dropdownAlign,ve=e.placement,me=e.builtinPlacements,ge=e.getPopupContainer,ye=e.showAction,be=void 0===ye?[]:ye,we=e.onFocus,xe=e.onBlur,Ce=e.onKeyUp,Se=e.onKeyDown,Me=e.onMouseDown,ke=(0,s.Z)(e,q),Le=J(R),Ee=(void 0!==C?C:Le)||"combobox"===R,Te=(0,l.Z)({},ke);$.forEach((function(e){delete Te[e]})),null==k||k.forEach((function(e){delete Te[e]}));var Ne=d.useState(!1),Ze=(0,a.Z)(Ne,2),Oe=Ze[0],Re=Ze[1];d.useEffect((function(){Re((0,m.Z)())}),[]);var Ae=d.useRef(null),De=d.useRef(null),Pe=d.useRef(null),We=d.useRef(null),Ie=d.useRef(null),He=d.useRef(!1),Fe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=d.useState(!1),n=(0,a.Z)(t,2),r=n[0],i=n[1],o=d.useRef(null),l=function(){window.clearTimeout(o.current)};return d.useEffect((function(){return l}),[]),[r,function(t,n){l(),o.current=window.setTimeout((function(){i(t),n&&n()}),e)},l]}(),ze=(0,a.Z)(Fe,3),_e=ze[0],Be=ze[1],Ve=ze[2];d.useImperativeHandle(t,(function(){var e,t;return{focus:null===(e=We.current)||void 0===e?void 0:e.focus,blur:null===(t=We.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=Ie.current)||void 0===t?void 0:t.scrollTo(e)},nativeElement:Ae.current||De.current}}));var je=d.useMemo((function(){var e;if("combobox"!==R)return X;var t=null===(e=L[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""}),[X,R,L]),Ke="combobox"===R&&"function"==typeof P&&P()||null,Ge="function"==typeof W&&W(),Xe=(0,g.x1)(De,null==Ge||null===(n=Ge.props)||void 0===n?void 0:n.ref),Ye=d.useState(!1),Ue=(0,a.Z)(Ye,2),qe=Ue[0],$e=Ue[1];(0,v.Z)((function(){$e(!0)}),[]);var Je=(0,c.Z)(!1,{defaultValue:F,value:I}),Qe=(0,a.Z)(Je,2),et=Qe[0],tt=Qe[1],nt=!!qe&&et,rt=!Z&&T;(A||rt&&nt&&"combobox"===R)&&(nt=!1);var it=!rt&&nt,ot=d.useCallback((function(e){var t=void 0!==e?e:!nt;A||(tt(t),nt!==t&&(null==z||z(t)))}),[A,nt,tt,z]),lt=d.useMemo((function(){return(ne||[]).some((function(e){return["\n","\r\n"].includes(e)}))}),[ne]),at=d.useContext(Y)||{},st=at.maxCount,ut=at.rawValues,ct=function(e,t,n){if(!(Le&&K(st)&&(null==ut?void 0:ut.size)>=st)){var r=!0,o=e;null==j||j(null);var l=function(e,t,n){if(!t||!t.length)return null;var r=!1,o=function e(t,n){var o=(0,V.Z)(n),l=o[0],a=o.slice(1);if(!l)return[t];var s=t.split(l);return r=r||s.length>1,s.reduce((function(t,n){return[].concat((0,i.Z)(t),(0,i.Z)(e(n,a)))}),[]).filter(Boolean)}(e,t);return r?void 0!==n?o.slice(0,n):o:null}(e,ne,K(st)?st-ut.size:void 0),a=n?null:l;return"combobox"!==R&&a&&(o="",null==te||te(a),ot(!1),r=!1),ee&&je!==o&&ee(o,{source:t?"typing":"effect"}),r}};d.useEffect((function(){nt||Le||"combobox"===R||ct("",!1,!1)}),[nt]),d.useEffect((function(){et&&A&&tt(!1),A&&!He.current&&Be(!1)}),[A]);var ft=x(),dt=(0,a.Z)(ft,2),ht=dt[0],pt=dt[1],vt=d.useRef(!1),mt=d.useRef(!1),gt=[];d.useEffect((function(){return function(){gt.forEach((function(e){return clearTimeout(e)})),gt.splice(0,gt.length)}}),[]);var yt,bt=d.useState({}),wt=(0,a.Z)(bt,2)[1];Ge&&(yt=function(e){ot(e)}),function(e,t,n,r){var i=d.useRef(null);i.current={open:t,triggerOpen:n,customizedTrigger:r},d.useEffect((function(){function t(t){var n;if(null===(n=i.current)||void 0===n||!n.customizedTrigger){var r=t.target;r.shadowRoot&&t.composed&&(r=t.composedPath()[0]||r),i.current.open&&e().filter((function(e){return e})).every((function(e){return!e.contains(r)&&e!==r}))&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",t),function(){return window.removeEventListener("mousedown",t)}}),[])}((function(){var e;return[Ae.current,null===(e=Pe.current)||void 0===e?void 0:e.getPopupElement()]}),it,ot,!!Ge);var xt,Ct=d.useMemo((function(){return(0,l.Z)((0,l.Z)({},e),{},{notFoundContent:Z,open:nt,triggerOpen:it,id:f,showSearch:Ee,multiple:Le,toggleOpen:ot})}),[e,Z,it,nt,f,Ee,Le,ot]),St=!!oe||D;St&&(xt=d.createElement(y,{className:p()("".concat(h,"-arrow"),(0,o.Z)({},"".concat(h,"-arrow-loading"),D)),customizeIcon:oe,customizeIconProps:{loading:D,searchValue:je,open:nt,focused:_e,showSearch:Ee}}));var Mt,kt=function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6?arguments[6]:void 0,a=arguments.length>7?arguments[7]:void 0,s=d.useMemo((function(){return"object"===(0,u.Z)(r)?r.clearIcon:i||void 0}),[r,i]),c=d.useMemo((function(){return!(o||!r||!n.length&&!l||"combobox"===a&&""===l)}),[r,o,n.length,l,a]);return{allowClear:c,clearIcon:d.createElement(y,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:s},"×")}}(h,(function(){var e;null==O||O(),null===(e=We.current)||void 0===e||e.focus(),E([],{type:"clear",values:L}),ct("",!1,!1)}),L,re,le,A,je,R),Lt=kt.allowClear,Et=kt.clearIcon,Tt=d.createElement(ae,{ref:Ie}),Nt=p()(h,w,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(h,"-focused"),_e),"".concat(h,"-multiple"),Le),"".concat(h,"-single"),!Le),"".concat(h,"-allow-clear"),re),"".concat(h,"-show-arrow"),St),"".concat(h,"-disabled"),A),"".concat(h,"-loading"),D),"".concat(h,"-open"),nt),"".concat(h,"-customize-input"),Ke),"".concat(h,"-show-search"),Ee)),Zt=d.createElement(B,{ref:Pe,disabled:A,prefixCls:h,visible:it,popupElement:Tt,animation:se,transitionName:ue,dropdownStyle:ce,dropdownClassName:fe,direction:M,dropdownMatchSelectWidth:de,dropdownRender:he,dropdownAlign:pe,placement:ve,builtinPlacements:me,getPopupContainer:ge,empty:T,getTriggerDOMNode:function(e){return De.current||e},onPopupVisibleChange:yt,onPopupMouseEnter:function(){wt({})}},Ge?d.cloneElement(Ge,{ref:Xe}):d.createElement(H,(0,r.Z)({},e,{domRef:De,prefixCls:h,inputElement:Ke,ref:We,id:f,prefix:ie,showSearch:Ee,autoClearSearchValue:Q,mode:R,activeDescendantId:G,tagRender:S,values:L,open:nt,onToggleOpen:ot,activeValue:_,searchValue:je,onSearch:ct,onSearchSubmit:function(e){e&&e.trim()&&ee(e,{source:"submit"})},onRemove:function(e){var t=L.filter((function(t){return t!==e}));E(t,{type:"remove",values:[e]})},tokenWithEnter:lt,onInputBlur:function(){vt.current=!1}})));return Mt=Ge?Zt:d.createElement("div",(0,r.Z)({className:Nt},Te,{ref:Ae,onMouseDown:function(e){var t,n=e.target,r=null===(t=Pe.current)||void 0===t?void 0:t.getPopupElement();if(r&&r.contains(n)){var i=setTimeout((function(){var e,t=gt.indexOf(i);-1!==t&&gt.splice(t,1),Ve(),Oe||r.contains(document.activeElement)||null===(e=We.current)||void 0===e||e.focus()}));gt.push(i)}for(var o=arguments.length,l=new Array(o>1?o-1:0),a=1;a<o;a++)l[a-1]=arguments[a];null==Me||Me.apply(void 0,[e].concat(l))},onKeyDown:function(e){var t,n=ht(),r=e.key,o="Enter"===r;if(o&&("combobox"!==R&&e.preventDefault(),nt||ot(!0)),pt(!!je),"Backspace"===r&&!n&&Le&&!je&&L.length){for(var l=(0,i.Z)(L),a=null,s=l.length-1;s>=0;s-=1){var u=l[s];if(!u.disabled){l.splice(s,1),a=u;break}}a&&E(l,{type:"remove",values:[a]})}for(var c=arguments.length,f=new Array(c>1?c-1:0),d=1;d<c;d++)f[d-1]=arguments[d];!nt||o&&vt.current||(o&&(vt.current=!0),null===(t=Ie.current)||void 0===t||t.onKeyDown.apply(t,[e].concat(f))),null==Se||Se.apply(void 0,[e].concat(f))},onKeyUp:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i;nt&&(null===(i=Ie.current)||void 0===i||i.onKeyUp.apply(i,[e].concat(n))),"Enter"===e.key&&(vt.current=!1),null==Ce||Ce.apply(void 0,[e].concat(n))},onFocus:function(){Be(!0),A||(we&&!mt.current&&we.apply(void 0,arguments),be.includes("focus")&&ot(!0)),mt.current=!0},onBlur:function(){He.current=!0,Be(!1,(function(){mt.current=!1,He.current=!1,ot(!1)})),A||(je&&("tags"===R?ee(je,{source:"submit"}):"multiple"===R&&ee("",{source:"blur"})),xe&&xe.apply(void 0,arguments))}}),d.createElement(U,{visible:_e&&!nt,values:L}),Zt,xt,Lt&&Et),d.createElement(b.Provider,{value:Ct},Mt)}));var ee=Q,te=function(){return null};te.isSelectOptGroup=!0;var ne=te,re=function(){return null};re.isSelectOption=!0;var ie=re,oe=n(80547),le=n(2738),ae=n(48911);var se=["disabled","title","children","style","className"];function ue(e){return"string"==typeof e||"number"==typeof e}var ce=function(e,t){var n=w(),l=n.prefixCls,u=n.id,c=n.open,f=n.multiple,h=n.mode,v=n.searchValue,m=n.toggleOpen,g=n.notFoundContent,b=n.onPopupScroll,x=d.useContext(Y),M=x.maxCount,k=x.flattenOptions,L=x.onActiveValue,E=x.defaultActiveFirstOption,T=x.onSelect,N=x.menuItemSelectedIcon,Z=x.rawValues,O=x.fieldNames,R=x.virtual,A=x.direction,D=x.listHeight,P=x.listItemHeight,W=x.optionRender,I="".concat(l,"-item"),H=(0,oe.Z)((function(){return k}),[c,k],(function(e,t){return t[0]&&e[1]!==t[1]})),F=d.useRef(null),z=d.useMemo((function(){return f&&K(M)&&(null==Z?void 0:Z.size)>=M}),[f,M,null==Z?void 0:Z.size]),_=function(e){e.preventDefault()},B=function(e){var t;null===(t=F.current)||void 0===t||t.scrollTo("number"==typeof e?{index:e}:e)},V=d.useCallback((function(e){return"combobox"!==h&&Z.has(e)}),[h,(0,i.Z)(Z).toString(),Z.size]),j=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=H.length,r=0;r<n;r+=1){var i=(e+r*t+n)%n,o=H[i]||{},l=o.group,a=o.data;if(!l&&(null==a||!a.disabled)&&(V(a.value)||!z))return i}return-1},G=d.useState((function(){return j(0)})),X=(0,a.Z)(G,2),U=X[0],q=X[1],$=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];q(e);var n={source:t?"keyboard":"mouse"},r=H[e];r?L(r.value,e,n):L(null,-1,n)};(0,d.useEffect)((function(){$(!1!==E?j(0):-1)}),[H.length,v]);var J=d.useCallback((function(e){return"combobox"===h?String(e).toLowerCase()===v.toLowerCase():Z.has(e)}),[h,v,(0,i.Z)(Z).toString(),Z.size]);(0,d.useEffect)((function(){var e,t=setTimeout((function(){if(!f&&c&&1===Z.size){var e=Array.from(Z)[0],t=H.findIndex((function(t){var n=t.data;return v?String(n.value).startsWith(v):n.value===e}));-1!==t&&($(t),B(t))}}));c&&(null===(e=F.current)||void 0===e||e.scrollTo(void 0));return function(){return clearTimeout(t)}}),[c,v]);var Q=function(e){void 0!==e&&T(e,{selected:!Z.has(e)}),f||m(!1)};if(d.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case C.Z.N:case C.Z.P:case C.Z.UP:case C.Z.DOWN:var r=0;if(t===C.Z.UP?r=-1:t===C.Z.DOWN?r=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===C.Z.N?r=1:t===C.Z.P&&(r=-1)),0!==r){var i=j(U+r,r);B(i),$(i,!0)}break;case C.Z.TAB:case C.Z.ENTER:var o,l=H[U];!l||null!=l&&null!==(o=l.data)&&void 0!==o&&o.disabled||z?Q(void 0):Q(l.value),c&&e.preventDefault();break;case C.Z.ESC:m(!1),c&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){B(e)}}})),0===H.length)return d.createElement("div",{role:"listbox",id:"".concat(u,"_list"),className:"".concat(I,"-empty"),onMouseDown:_},g);var ee=Object.keys(O).map((function(e){return O[e]})),te=function(e){return e.label};function ne(e,t){return{role:e.group?"presentation":"option",id:"".concat(u,"_list_").concat(t)}}var re=function(e){var t=H[e];if(!t)return null;var n=t.data||{},i=n.value,o=t.group,l=(0,S.Z)(n,!0),a=te(t);return t?d.createElement("div",(0,r.Z)({"aria-label":"string"!=typeof a||o?null:a},l,{key:e},ne(t,e),{"aria-selected":J(i)}),i):null},ie={role:"listbox",id:"".concat(u,"_list")};return d.createElement(d.Fragment,null,R&&d.createElement("div",(0,r.Z)({},ie,{style:{height:0,width:0,overflow:"hidden"}}),re(U-1),re(U),re(U+1)),d.createElement(ae.Z,{itemKey:"key",ref:F,data:H,height:D,itemHeight:P,fullHeight:!1,onMouseDown:_,onScroll:b,virtual:R,direction:A,innerProps:R?null:ie},(function(e,t){var n=e.group,i=e.groupOption,l=e.data,a=e.label,u=e.value,c=l.key;if(n){var f,h=null!==(f=l.title)&&void 0!==f?f:ue(a)?a.toString():void 0;return d.createElement("div",{className:p()(I,"".concat(I,"-group"),l.className),title:h},void 0!==a?a:c)}var v=l.disabled,m=l.title,g=(l.children,l.style),b=l.className,w=(0,s.Z)(l,se),x=(0,le.Z)(w,ee),C=V(u),M=v||!C&&z,k="".concat(I,"-option"),L=p()(I,k,b,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(k,"-grouped"),i),"".concat(k,"-active"),U===t&&!M),"".concat(k,"-disabled"),M),"".concat(k,"-selected"),C)),E=te(e),T=!N||"function"==typeof N||C,Z="number"==typeof E?E:E||u,O=ue(Z)?Z.toString():void 0;return void 0!==m&&(O=m),d.createElement("div",(0,r.Z)({},(0,S.Z)(x),R?{}:ne(e,t),{"aria-selected":J(u),className:L,title:O,onMouseMove:function(){U===t||M||$(t)},onClick:function(){M||Q(u)},style:g}),d.createElement("div",{className:"".concat(k,"-content")},"function"==typeof W?W(e,{index:t}):Z),d.isValidElement(N)||C,T&&d.createElement(y,{className:"".concat(I,"-option-state"),customizeIcon:N,customizeIconProps:{value:u,disabled:M,isSelected:C}},C?"✓":null))})))};var fe=d.forwardRef(ce);function de(e,t){return N(e).join("").toUpperCase().includes(t)}var he=n(6551),pe=n(11592),ve=["children","value"],me=["children"];function ge(e){var t=e,n=t.key,r=t.props,i=r.children,o=r.value,a=(0,s.Z)(r,ve);return(0,l.Z)({key:n,value:void 0!==o?o:n,children:i},a)}function ye(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,pe.Z)(e).map((function(e,n){if(!d.isValidElement(e)||!e.type)return null;var r=e,i=r.type.isSelectOptGroup,o=r.key,a=r.props,u=a.children,c=(0,s.Z)(a,me);return t||!i?ge(e):(0,l.Z)((0,l.Z)({key:"__RC_SELECT_GRP__".concat(null===o?n:o,"__"),label:o},c),{},{options:ye(u)})})).filter((function(e){return e}))}var be=function(e,t,n,r,i){return d.useMemo((function(){var o=e;!e&&(o=ye(t));var l=new Map,a=new Map,s=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(t){for(var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],u=0;u<t.length;u+=1){var c=t[u];!c[n.options]||o?(l.set(c[n.value],c),s(a,c,n.label),s(a,c,r),s(a,c,i)):e(c[n.options],!0)}}(o),{options:o,valueOptions:l,labelOptions:a}}),[e,t,n,r,i])};function we(e){var t=d.useRef();t.current=e;var n=d.useCallback((function(){return t.current.apply(t,arguments)}),[]);return n}var xe=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],Ce=["inputValue"];var Se=d.forwardRef((function(e,t){var n=e.id,f=e.mode,h=e.prefixCls,p=void 0===h?"rc-select":h,v=e.backfill,m=e.fieldNames,g=e.inputValue,y=e.searchValue,b=e.onSearch,w=e.autoClearSearchValue,x=void 0===w||w,C=e.onSelect,S=e.onDeselect,M=e.dropdownMatchSelectWidth,k=void 0===M||M,L=e.filterOption,E=e.filterSort,T=e.optionFilterProp,Z=e.optionLabelProp,O=e.options,R=e.optionRender,A=e.children,D=e.defaultActiveFirstOption,P=e.menuItemSelectedIcon,W=e.virtual,I=e.direction,H=e.listHeight,F=void 0===H?200:H,z=e.listItemHeight,_=void 0===z?20:z,B=e.labelRender,V=e.value,K=e.defaultValue,U=e.labelInValue,q=e.onChange,$=e.maxCount,Q=(0,s.Z)(e,xe),te=(0,he.ZP)(n),ne=J(f),re=!(O||!A),ie=d.useMemo((function(){return(void 0!==L||"combobox"!==f)&&L}),[L,f]),oe=d.useMemo((function(){return G(m,re)}),[JSON.stringify(m),re]),le=(0,c.Z)("",{value:void 0!==y?y:g,postState:function(e){return e||""}}),ae=(0,a.Z)(le,2),se=ae[0],ue=ae[1],ce=be(O,A,oe,T,Z),pe=ce.valueOptions,ve=ce.labelOptions,me=ce.options,ge=d.useCallback((function(e){return N(e).map((function(e){var t,n,r,i,o,l;(function(e){return!e||"object"!==(0,u.Z)(e)})(e)?t=e:(r=e.key,n=e.label,t=null!==(l=e.value)&&void 0!==l?l:r);var a,s=pe.get(t);s&&(void 0===n&&(n=null==s?void 0:s[Z||oe.label]),void 0===r&&(r=null!==(a=null==s?void 0:s.key)&&void 0!==a?a:t),i=null==s?void 0:s.disabled,o=null==s?void 0:s.title);return{label:n,value:t,key:r,disabled:i,title:o}}))}),[oe,Z,pe]),ye=(0,c.Z)(K,{value:V}),Se=(0,a.Z)(ye,2),Me=Se[0],ke=Se[1],Le=d.useMemo((function(){var e,t=ge(ne&&null===Me?[]:Me);return"combobox"===f&&function(e){return!e&&0!==e}(null===(e=t[0])||void 0===e?void 0:e.value)?[]:t}),[Me,ge,f,ne]),Ee=function(e,t){var n=d.useRef({values:new Map,options:new Map});return[d.useMemo((function(){var r=n.current,i=r.values,o=r.options,a=e.map((function(e){var t;return void 0===e.label?(0,l.Z)((0,l.Z)({},e),{},{label:null===(t=i.get(e.value))||void 0===t?void 0:t.label}):e})),s=new Map,u=new Map;return a.forEach((function(e){s.set(e.value,e),u.set(e.value,t.get(e.value)||o.get(e.value))})),n.current.values=s,n.current.options=u,a}),[e,t]),d.useCallback((function(e){return t.get(e)||n.current.options.get(e)}),[t])]}(Le,pe),Te=(0,a.Z)(Ee,2),Ne=Te[0],Ze=Te[1],Oe=d.useMemo((function(){if(!f&&1===Ne.length){var e=Ne[0];if(null===e.value&&(null===e.label||void 0===e.label))return[]}return Ne.map((function(e){var t;return(0,l.Z)((0,l.Z)({},e),{},{label:null!==(t="function"==typeof B?B(e):e.label)&&void 0!==t?t:e.value})}))}),[f,Ne,B]),Re=d.useMemo((function(){return new Set(Ne.map((function(e){return e.value})))}),[Ne]);d.useEffect((function(){if("combobox"===f){var e,t=null===(e=Ne[0])||void 0===e?void 0:e.value;ue(function(e){return null!=e}(t)?String(t):"")}}),[Ne]);var Ae=we((function(e,t){var n=null!=t?t:e;return(0,o.Z)((0,o.Z)({},oe.value,e),oe.label,n)})),De=function(e,t,n,r,i){return d.useMemo((function(){if(!n||!1===r)return e;var a=t.options,s=t.label,u=t.value,c=[],f="function"==typeof r,d=n.toUpperCase(),h=f?r:function(e,t){return i?de(t[i],d):t[a]?de(t["children"!==s?s:"label"],d):de(t[u],d)},p=f?function(e){return X(e)}:function(e){return e};return e.forEach((function(e){if(e[a])if(h(n,p(e)))c.push(e);else{var t=e[a].filter((function(e){return h(n,p(e))}));t.length&&c.push((0,l.Z)((0,l.Z)({},e),{},(0,o.Z)({},a,t)))}else h(n,p(e))&&c.push(e)})),c}),[e,r,i,n,t])}(d.useMemo((function(){if("tags"!==f)return me;var e=(0,i.Z)(me);return(0,i.Z)(Ne).sort((function(e,t){return e.value<t.value?-1:1})).forEach((function(t){var n=t.value;(function(e){return pe.has(e)})(n)||e.push(Ae(n,t.label))})),e}),[Ae,me,pe,Ne,f]),oe,se,ie,T),Pe=d.useMemo((function(){return"tags"!==f||!se||De.some((function(e){return e[T||"value"]===se}))||De.some((function(e){return e[oe.value]===se}))?De:[Ae(se)].concat((0,i.Z)(De))}),[Ae,T,f,De,se,oe]),We=function e(t){return(0,i.Z)(t).sort((function(e,t){return E(e,t,{searchValue:se})})).map((function(t){return Array.isArray(t.options)?(0,l.Z)((0,l.Z)({},t),{},{options:t.options.length>0?e(t.options):t.options}):t}))},Ie=d.useMemo((function(){return E?We(Pe):Pe}),[Pe,E,se]),He=d.useMemo((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,i=[],o=G(n,!1),l=o.label,a=o.value,s=o.options,u=o.groupLabel;function c(e,t){Array.isArray(e)&&e.forEach((function(e){if(t||!(s in e)){var n=e[a];i.push({key:j(e,i.length),groupOption:t,data:e,label:e[l],value:n})}else{var o=e[u];void 0===o&&r&&(o=e.label),i.push({key:j(e,i.length),group:!0,data:e,label:o}),c(e[s],!0)}}))}return c(e,!1),i}(Ie,{fieldNames:oe,childrenAsData:re})}),[Ie,oe,re]),Fe=function(e){var t=ge(e);if(ke(t),q&&(t.length!==Ne.length||t.some((function(e,t){var n;return(null===(n=Ne[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)})))){var n=U?t:t.map((function(e){return e.value})),r=t.map((function(e){return X(Ze(e.value))}));q(ne?n:n[0],ne?r:r[0])}},ze=d.useState(null),_e=(0,a.Z)(ze,2),Be=_e[0],Ve=_e[1],je=d.useState(0),Ke=(0,a.Z)(je,2),Ge=Ke[0],Xe=Ke[1],Ye=void 0!==D?D:"combobox"!==f,Ue=d.useCallback((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.source,i=void 0===r?"keyboard":r;Xe(t),v&&"combobox"===f&&null!==e&&"keyboard"===i&&Ve(String(e))}),[v,f]),qe=function(e,t,n){var r=function(){var t,n=Ze(e);return[U?{label:null==n?void 0:n[oe.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,X(n)]};if(t&&C){var i=r(),o=(0,a.Z)(i,2),l=o[0],s=o[1];C(l,s)}else if(!t&&S&&"clear"!==n){var u=r(),c=(0,a.Z)(u,2),f=c[0],d=c[1];S(f,d)}},$e=we((function(e,t){var n,r=!ne||t.selected;n=r?ne?[].concat((0,i.Z)(Ne),[e]):[e]:Ne.filter((function(t){return t.value!==e})),Fe(n),qe(e,r),"combobox"===f?Ve(""):J&&!x||(ue(""),Ve(""))})),Je=d.useMemo((function(){var e=!1!==W&&!1!==k;return(0,l.Z)((0,l.Z)({},ce),{},{flattenOptions:He,onActiveValue:Ue,defaultActiveFirstOption:Ye,onSelect:$e,menuItemSelectedIcon:P,rawValues:Re,fieldNames:oe,virtual:e,direction:I,listHeight:F,listItemHeight:_,childrenAsData:re,maxCount:$,optionRender:R})}),[$,ce,He,Ue,Ye,$e,P,Re,oe,W,k,I,F,_,re,R]);return d.createElement(Y.Provider,{value:Je},d.createElement(ee,(0,r.Z)({},Q,{id:te,prefixCls:p,ref:t,omitDomProps:Ce,mode:f,displayValues:Oe,onDisplayValuesChange:function(e,t){Fe(e);var n=t.type,r=t.values;"remove"!==n&&"clear"!==n||r.forEach((function(e){qe(e.value,!1,n)}))},direction:I,searchValue:se,onSearch:function(e,t){if(ue(e),Ve(null),"submit"!==t.source)"blur"!==t.source&&("combobox"===f&&Fe(e),null==b||b(e));else{var n=(e||"").trim();if(n){var r=Array.from(new Set([].concat((0,i.Z)(Re),[n])));Fe(r),qe(n,!0),ue("")}}},autoClearSearchValue:x,onSearchSplit:function(e){var t=e;"tags"!==f&&(t=e.map((function(e){var t=ve.get(e);return null==t?void 0:t.value})).filter((function(e){return void 0!==e})));var n=Array.from(new Set([].concat((0,i.Z)(Re),(0,i.Z)(t))));Fe(n),n.forEach((function(e){qe(e,!0)}))},dropdownMatchSelectWidth:k,OptionList:fe,emptyOptions:!He.length,activeValue:Be,activeDescendantId:"".concat(te,"_list_").concat(Ge)})))}));var Me=Se;Me.Option=ie,Me.OptGroup=ne;var ke=Me},22711:function(e,t,n){"use strict";n.r(t),n.d(t,{ResizableTextArea:function(){return E},default:function(){return N}});var r,i=n(54476),o=n(20068),l=n(33885),a=n(94480),s=n(42978),u=n(75931),c=n(92310),f=n.n(c),d=n(36901),h=n(66003),p=n(30292),v=n(18929),m=n(59301),g=n(76190),y=n(29301),b=n(34280),w=n(16089),x="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n",C=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],S={};function M(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&S[n])return S[n];var r=window.getComputedStyle(e),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),o=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),l=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),a=C.map((function(e){return"".concat(e,":").concat(r.getPropertyValue(e))})).join(";"),s={sizingStyle:a,paddingSize:o,borderSize:l,boxSizing:i};return t&&n&&(S[n]=s),s}var k=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],L=m.forwardRef((function(e,t){var n=e,a=n.prefixCls,c=n.defaultValue,d=n.value,h=n.autoSize,p=n.onResize,C=n.className,S=n.style,L=n.disabled,E=n.onChange,T=(n.onInternalAutoSize,(0,u.Z)(n,k)),N=(0,v.Z)(c,{value:d,postState:function(e){return null!=e?e:""}}),Z=(0,s.Z)(N,2),O=Z[0],R=Z[1],A=m.useRef();m.useImperativeHandle(t,(function(){return{textArea:A.current}}));var D=m.useMemo((function(){return h&&"object"===(0,g.Z)(h)?[h.minRows,h.maxRows]:[]}),[h]),P=(0,s.Z)(D,2),W=P[0],I=P[1],H=!!h,F=m.useState(2),z=(0,s.Z)(F,2),_=z[0],B=z[1],V=m.useState(),j=(0,s.Z)(V,2),K=j[0],G=j[1],X=function(){B(0)};(0,b.Z)((function(){H&&X()}),[d,W,I,H]),(0,b.Z)((function(){if(0===_)B(1);else if(1===_){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;r||((r=document.createElement("textarea")).setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),r.setAttribute("name","hiddenTextarea"),document.body.appendChild(r)),e.getAttribute("wrap")?r.setAttribute("wrap",e.getAttribute("wrap")):r.removeAttribute("wrap");var o=M(e,t),l=o.paddingSize,a=o.borderSize,s=o.boxSizing,u=o.sizingStyle;r.setAttribute("style","".concat(u,";").concat(x)),r.value=e.value||e.placeholder||"";var c,f=void 0,d=void 0,h=r.scrollHeight;if("border-box"===s?h+=a:"content-box"===s&&(h-=l),null!==n||null!==i){r.value=" ";var p=r.scrollHeight-l;null!==n&&(f=p*n,"border-box"===s&&(f=f+l+a),h=Math.max(f,h)),null!==i&&(d=p*i,"border-box"===s&&(d=d+l+a),c=h>d?"":"hidden",h=Math.min(d,h))}var v={height:h,overflowY:c,resize:"none"};return f&&(v.minHeight=f),d&&(v.maxHeight=d),v}(A.current,!1,W,I);B(2),G(e)}else!function(){try{if(document.activeElement===A.current){var e=A.current,t=e.selectionStart,n=e.selectionEnd,r=e.scrollTop;A.current.setSelectionRange(t,n),A.current.scrollTop=r}}catch(e){}}()}),[_]);var Y=m.useRef(),U=function(){w.Z.cancel(Y.current)};m.useEffect((function(){return U}),[]);var q=H?K:null,$=(0,l.Z)((0,l.Z)({},S),q);return 0!==_&&1!==_||($.overflowY="hidden",$.overflowX="hidden"),m.createElement(y.Z,{onResize:function(e){2===_&&(null==p||p(e),h&&(U(),Y.current=(0,w.Z)((function(){X()}))))},disabled:!(h||p)},m.createElement("textarea",(0,i.Z)({},T,{ref:A,style:$,className:f()(a,C,(0,o.Z)({},"".concat(a,"-disabled"),L)),disabled:L,value:O,onChange:function(e){R(e.target.value),null==E||E(e)}})))})),E=L,T=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],N=m.forwardRef((function(e,t){var n,r=e.defaultValue,c=e.value,g=e.onFocus,y=e.onBlur,b=e.onChange,w=e.allowClear,x=e.maxLength,C=e.onCompositionStart,S=e.onCompositionEnd,M=e.suffix,k=e.prefixCls,L=void 0===k?"rc-textarea":k,N=e.showCount,Z=e.count,O=e.className,R=e.style,A=e.disabled,D=e.hidden,P=e.classNames,W=e.styles,I=e.onResize,H=e.onClear,F=e.onPressEnter,z=e.readOnly,_=e.autoSize,B=e.onKeyDown,V=(0,u.Z)(e,T),j=(0,v.Z)(r,{value:c,defaultValue:r}),K=(0,s.Z)(j,2),G=K[0],X=K[1],Y=null==G?"":String(G),U=m.useState(!1),q=(0,s.Z)(U,2),$=q[0],J=q[1],Q=m.useRef(!1),ee=m.useState(null),te=(0,s.Z)(ee,2),ne=te[0],re=te[1],ie=(0,m.useRef)(null),oe=(0,m.useRef)(null),le=function(){var e;return null===(e=oe.current)||void 0===e?void 0:e.textArea},ae=function(){le().focus()};(0,m.useImperativeHandle)(t,(function(){var e;return{resizableTextArea:oe.current,focus:ae,blur:function(){le().blur()},nativeElement:(null===(e=ie.current)||void 0===e?void 0:e.nativeElement)||le()}})),(0,m.useEffect)((function(){J((function(e){return!A&&e}))}),[A]);var se=m.useState(null),ue=(0,s.Z)(se,2),ce=ue[0],fe=ue[1];m.useEffect((function(){var e;ce&&(e=le()).setSelectionRange.apply(e,(0,a.Z)(ce))}),[ce]);var de,he=(0,h.Z)(Z,N),pe=null!==(n=he.max)&&void 0!==n?n:x,ve=Number(pe)>0,me=he.strategy(Y),ge=!!pe&&me>pe,ye=function(e,t){var n=t;!Q.current&&he.exceedFormatter&&he.max&&he.strategy(t)>he.max&&t!==(n=he.exceedFormatter(t,{max:he.max}))&&fe([le().selectionStart||0,le().selectionEnd||0]),X(n),(0,p.rJ)(e.currentTarget,e,b,n)},be=M;he.show&&(de=he.showFormatter?he.showFormatter({value:Y,count:me,maxLength:pe}):"".concat(me).concat(ve?" / ".concat(pe):""),be=m.createElement(m.Fragment,null,be,m.createElement("span",{className:f()("".concat(L,"-data-count"),null==P?void 0:P.count),style:null==W?void 0:W.count},de)));var we=!_&&!N&&!w;return m.createElement(d.BaseInput,{ref:ie,value:Y,allowClear:w,handleReset:function(e){X(""),ae(),(0,p.rJ)(le(),e,b)},suffix:be,prefixCls:L,classNames:(0,l.Z)((0,l.Z)({},P),{},{affixWrapper:f()(null==P?void 0:P.affixWrapper,(0,o.Z)((0,o.Z)({},"".concat(L,"-show-count"),N),"".concat(L,"-textarea-allow-clear"),w))}),disabled:A,focused:$,className:f()(O,ge&&"".concat(L,"-out-of-range")),style:(0,l.Z)((0,l.Z)({},R),ne&&!we?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof de?de:void 0}},hidden:D,readOnly:z,onClear:H},m.createElement(E,(0,i.Z)({},V,{autoSize:_,maxLength:x,onKeyDown:function(e){"Enter"===e.key&&F&&F(e),null==B||B(e)},onChange:function(e){ye(e,e.target.value)},onFocus:function(e){J(!0),null==g||g(e)},onBlur:function(e){J(!1),null==y||y(e)},onCompositionStart:function(e){Q.current=!0,null==C||C(e)},onCompositionEnd:function(e){Q.current=!1,ye(e,e.currentTarget.value),null==S||S(e)},className:f()(null==P?void 0:P.textarea),style:(0,l.Z)((0,l.Z)({},null==W?void 0:W.textarea),{},{resize:null==R?void 0:R.resize}),disabled:A,prefixCls:L,onResize:function(e){var t;null==I||I(e),null!==(t=le())&&void 0!==t&&t.style.height&&re(!0)},ref:oe,readOnly:z})))}))},29125:function(e,t,n){"use strict";n.d(t,{G:function(){return l},Z:function(){return y}});var r=n(92310),i=n.n(r),o=n(59301);function l(e){var t=e.children,n=e.prefixCls,r=e.id,l=e.overlayInnerStyle,a=e.bodyClassName,s=e.className,u=e.style;return o.createElement("div",{className:i()("".concat(n,"-content"),s),style:u},o.createElement("div",{className:i()("".concat(n,"-inner"),a),id:r,role:"tooltip",style:l},"function"==typeof t?t():t))}var a=n(54476),s=n(33885),u=n(75931),c=n(65030),f={shiftX:64,adjustY:1},d={adjustX:1,shiftY:!0},h=[0,0],p={left:{points:["cr","cl"],overflow:d,offset:[-4,0],targetOffset:h},right:{points:["cl","cr"],overflow:d,offset:[4,0],targetOffset:h},top:{points:["bc","tc"],overflow:f,offset:[0,-4],targetOffset:h},bottom:{points:["tc","bc"],overflow:f,offset:[0,4],targetOffset:h},topLeft:{points:["bl","tl"],overflow:f,offset:[0,-4],targetOffset:h},leftTop:{points:["tr","tl"],overflow:d,offset:[-4,0],targetOffset:h},topRight:{points:["br","tr"],overflow:f,offset:[0,-4],targetOffset:h},rightTop:{points:["tl","tr"],overflow:d,offset:[4,0],targetOffset:h},bottomRight:{points:["tr","br"],overflow:f,offset:[0,4],targetOffset:h},rightBottom:{points:["bl","br"],overflow:d,offset:[4,0],targetOffset:h},bottomLeft:{points:["tl","bl"],overflow:f,offset:[0,4],targetOffset:h},leftBottom:{points:["br","bl"],overflow:d,offset:[-4,0],targetOffset:h}},v=n(80402),m=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],g=function(e,t){var n=e.overlayClassName,r=e.trigger,f=void 0===r?["hover"]:r,d=e.mouseEnterDelay,h=void 0===d?0:d,g=e.mouseLeaveDelay,y=void 0===g?.1:g,b=e.overlayStyle,w=e.prefixCls,x=void 0===w?"rc-tooltip":w,C=e.children,S=e.onVisibleChange,M=e.afterVisibleChange,k=e.transitionName,L=e.animation,E=e.motion,T=e.placement,N=void 0===T?"right":T,Z=e.align,O=void 0===Z?{}:Z,R=e.destroyTooltipOnHide,A=void 0!==R&&R,D=e.defaultVisible,P=e.getTooltipContainer,W=e.overlayInnerStyle,I=(e.arrowContent,e.overlay),H=e.id,F=e.showArrow,z=void 0===F||F,_=e.classNames,B=e.styles,V=(0,u.Z)(e,m),j=(0,v.Z)(H),K=(0,o.useRef)(null);(0,o.useImperativeHandle)(t,(function(){return K.current}));var G=(0,s.Z)({},V);"visible"in e&&(G.popupVisible=e.visible);var X,Y,U;return o.createElement(c.Z,(0,a.Z)({popupClassName:i()(n,null==_?void 0:_.root),prefixCls:x,popup:function(){return o.createElement(l,{key:"content",prefixCls:x,id:j,bodyClassName:null==_?void 0:_.body,overlayInnerStyle:(0,s.Z)((0,s.Z)({},W),null==B?void 0:B.body)},I)},action:f,builtinPlacements:p,popupPlacement:N,ref:K,popupAlign:O,getPopupContainer:P,onPopupVisibleChange:S,afterPopupVisibleChange:M,popupTransitionName:k,popupAnimation:L,popupMotion:E,defaultPopupVisible:D,autoDestroy:A,mouseLeaveDelay:y,popupStyle:(0,s.Z)((0,s.Z)({},b),null==B?void 0:B.root),mouseEnterDelay:h,arrow:z},G),(X=o.Children.only(C),Y=(null==X?void 0:X.props)||{},U=(0,s.Z)((0,s.Z)({},Y),{},{"aria-describedby":I?j:null}),o.cloneElement(C,U)))},y=(0,o.forwardRef)(g)},49658:function(e,t){"use strict";t.Z=function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}},48911:function(e,t,n){"use strict";n.d(t,{Z:function(){return H}});var r=n(54476),i=n(76190),o=n(33885),l=n(20068),a=n(42978),s=n(75931),u=n(92310),c=n.n(u),f=n(29301),d=n(70425),h=n(34280),p=n(59301),v=n(4676),m=p.forwardRef((function(e,t){var n=e.height,i=e.offsetY,a=e.offsetX,s=e.children,u=e.prefixCls,d=e.onInnerResize,h=e.innerProps,v=e.rtl,m=e.extra,g={},y={display:"flex",flexDirection:"column"};return void 0!==i&&(g={height:n,position:"relative",overflow:"hidden"},y=(0,o.Z)((0,o.Z)({},y),{},(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({transform:"translateY(".concat(i,"px)")},v?"marginRight":"marginLeft",-a),"position","absolute"),"left",0),"right",0),"top",0))),p.createElement("div",{style:g},p.createElement(f.Z,{onResize:function(e){e.offsetHeight&&d&&d()}},p.createElement("div",(0,r.Z)({style:y,className:c()((0,l.Z)({},"".concat(u,"-holder-inner"),u)),ref:t},h),s,m)))}));m.displayName="Filler";var g=m;function y(e){var t=e.children,n=e.setRef,r=p.useCallback((function(e){n(e)}),[]);return p.cloneElement(t,{ref:r})}function b(e,t,n){var r=p.useState(e),i=(0,a.Z)(r,2),o=i[0],l=i[1],s=p.useState(null),u=(0,a.Z)(s,2),c=u[0],f=u[1];return p.useEffect((function(){var r=function(e,t,n){var r,i,o=e.length,l=t.length;if(0===o&&0===l)return null;o<l?(r=e,i=t):(r=t,i=e);var a={__EMPTY_ITEM__:!0};function s(e){return void 0!==e?n(e):a}for(var u=null,c=1!==Math.abs(o-l),f=0;f<i.length;f+=1){var d=s(r[f]);if(d!==s(i[f])){u=f,c=c||d!==s(i[f+1]);break}}return null===u?null:{index:u,multiple:c}}(o||[],e||[],t);void 0!==(null==r?void 0:r.index)&&(null==n||n(r.index),f(e[r.index])),l(e)}),[e]),[c]}var w=n(16089),x="object"===("undefined"==typeof navigator?"undefined":(0,i.Z)(navigator))&&/Firefox/i.test(navigator.userAgent),C=function(e,t,n,r){var i=(0,p.useRef)(!1),o=(0,p.useRef)(null);function l(){clearTimeout(o.current),i.current=!0,o.current=setTimeout((function(){i.current=!1}),50)}var a=(0,p.useRef)({top:e,bottom:t,left:n,right:r});return a.current.top=e,a.current.bottom=t,a.current.left=n,a.current.right=r,function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e?t<0&&a.current.left||t>0&&a.current.right:t<0&&a.current.top||t>0&&a.current.bottom;return n&&r?(clearTimeout(o.current),i.current=!1):r&&!i.current||l(),!i.current&&r}};function S(e,t,n,r,i,o,l){var a=(0,p.useRef)(0),s=(0,p.useRef)(null),u=(0,p.useRef)(null),c=(0,p.useRef)(!1),f=C(t,n,r,i);var d=(0,p.useRef)(null),h=(0,p.useRef)(null);return[function(t){if(e){w.Z.cancel(h.current),h.current=(0,w.Z)((function(){d.current=null}),2);var n=t.deltaX,r=t.deltaY,i=t.shiftKey,p=n,v=r;("sx"===d.current||!d.current&&i&&r&&!n)&&(p=r,v=0,d.current="sx");var m=Math.abs(p),g=Math.abs(v);null===d.current&&(d.current=o&&m>g?"x":"y"),"y"===d.current?function(e,t){if(w.Z.cancel(s.current),!f(!1,t)){var n=e;n._virtualHandled||(n._virtualHandled=!0,a.current+=t,u.current=t,x||n.preventDefault(),s.current=(0,w.Z)((function(){var e=c.current?10:1;l(a.current*e,!1),a.current=0})))}}(t,v):function(e,t){l(t,!0),x||e.preventDefault()}(t,p)}},function(t){e&&(c.current=t.detail===u.current)}]}var M=n(67732),k=n(83652),L=function(){function e(){(0,M.Z)(this,e),(0,l.Z)(this,"maps",void 0),(0,l.Z)(this,"id",0),(0,l.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,k.Z)(e,[{key:"set",value:function(e,t){this.diffRecords.set(e,this.maps[e]),this.maps[e]=t,this.id+=1}},{key:"get",value:function(e){return this.maps[e]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e}();function E(e){var t=parseFloat(e);return isNaN(t)?0:t}var T=14/15;function N(e){return Math.floor(Math.pow(e,.5))}function Z(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}var O=p.forwardRef((function(e,t){var n=e.prefixCls,r=e.rtl,i=e.scrollOffset,s=e.scrollRange,u=e.onStartMove,f=e.onStopMove,d=e.onScroll,h=e.horizontal,v=e.spinSize,m=e.containerSize,g=e.style,y=e.thumbStyle,b=e.showScrollBar,x=p.useState(!1),C=(0,a.Z)(x,2),S=C[0],M=C[1],k=p.useState(null),L=(0,a.Z)(k,2),E=L[0],T=L[1],N=p.useState(null),O=(0,a.Z)(N,2),R=O[0],A=O[1],D=!r,P=p.useRef(),W=p.useRef(),I=p.useState(b),H=(0,a.Z)(I,2),F=H[0],z=H[1],_=p.useRef(),B=function(){!0!==b&&!1!==b&&(clearTimeout(_.current),z(!0),_.current=setTimeout((function(){z(!1)}),3e3))},V=s-m||0,j=m-v||0,K=p.useMemo((function(){return 0===i||0===V?0:i/V*j}),[i,V,j]),G=p.useRef({top:K,dragging:S,pageY:E,startTop:R});G.current={top:K,dragging:S,pageY:E,startTop:R};var X=function(e){M(!0),T(Z(e,h)),A(G.current.top),u(),e.stopPropagation(),e.preventDefault()};p.useEffect((function(){var e=function(e){e.preventDefault()},t=P.current,n=W.current;return t.addEventListener("touchstart",e,{passive:!1}),n.addEventListener("touchstart",X,{passive:!1}),function(){t.removeEventListener("touchstart",e),n.removeEventListener("touchstart",X)}}),[]);var Y=p.useRef();Y.current=V;var U=p.useRef();U.current=j,p.useEffect((function(){if(S){var e,t=function(t){var n=G.current,r=n.dragging,i=n.pageY,o=n.startTop;w.Z.cancel(e);var l=P.current.getBoundingClientRect(),a=m/(h?l.width:l.height);if(r){var s=(Z(t,h)-i)*a,u=o;!D&&h?u-=s:u+=s;var c=Y.current,f=U.current,p=f?u/f:0,v=Math.ceil(p*c);v=Math.max(v,0),v=Math.min(v,c),e=(0,w.Z)((function(){d(v,h)}))}},n=function(){M(!1),f()};return window.addEventListener("mousemove",t,{passive:!0}),window.addEventListener("touchmove",t,{passive:!0}),window.addEventListener("mouseup",n,{passive:!0}),window.addEventListener("touchend",n,{passive:!0}),function(){window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n),w.Z.cancel(e)}}}),[S]),p.useEffect((function(){return B(),function(){clearTimeout(_.current)}}),[i]),p.useImperativeHandle(t,(function(){return{delayHidden:B}}));var q="".concat(n,"-scrollbar"),$={position:"absolute",visibility:F?null:"hidden"},J={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return h?(Object.assign($,{height:8,left:0,right:0,bottom:0}),Object.assign(J,(0,l.Z)({height:"100%",width:v},D?"left":"right",K))):(Object.assign($,(0,l.Z)({width:8,top:0,bottom:0},D?"right":"left",0)),Object.assign(J,{width:"100%",height:v,top:K})),p.createElement("div",{ref:P,className:c()(q,(0,l.Z)((0,l.Z)((0,l.Z)({},"".concat(q,"-horizontal"),h),"".concat(q,"-vertical"),!h),"".concat(q,"-visible"),F)),style:(0,o.Z)((0,o.Z)({},$),g),onMouseDown:function(e){e.stopPropagation(),e.preventDefault()},onMouseMove:B},p.createElement("div",{ref:W,className:c()("".concat(q,"-thumb"),(0,l.Z)({},"".concat(q,"-thumb-moving"),S)),style:(0,o.Z)((0,o.Z)({},J),y),onMouseDown:X}))}));function R(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e/t*e;return isNaN(n)&&(n=0),n=Math.max(n,20),Math.floor(n)}var A=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],D=[],P={overflowY:"auto",overflowAnchor:"none"};function W(e,t){var n=e.prefixCls,u=void 0===n?"rc-virtual-list":n,m=e.className,x=e.height,M=e.itemHeight,k=e.fullHeight,W=void 0===k||k,I=e.style,H=e.data,F=e.children,z=e.itemKey,_=e.virtual,B=e.direction,V=e.scrollWidth,j=e.component,K=void 0===j?"div":j,G=e.onScroll,X=e.onVirtualScroll,Y=e.onVisibleChange,U=e.innerProps,q=e.extraRender,$=e.styles,J=e.showScrollBar,Q=void 0===J?"optional":J,ee=(0,s.Z)(e,A),te=p.useCallback((function(e){return"function"==typeof z?z(e):null==e?void 0:e[z]}),[z]),ne=function(e,t,n){var r=p.useState(0),i=(0,a.Z)(r,2),o=i[0],l=i[1],s=(0,p.useRef)(new Map),u=(0,p.useRef)(new L),c=(0,p.useRef)(0);function f(){c.current+=1}function d(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];f();var t=function(){var e=!1;s.current.forEach((function(t,n){if(t&&t.offsetParent){var r=t.offsetHeight,i=getComputedStyle(t),o=i.marginTop,l=i.marginBottom,a=r+E(o)+E(l);u.current.get(n)!==a&&(u.current.set(n,a),e=!0)}})),e&&l((function(e){return e+1}))};if(e)t();else{c.current+=1;var n=c.current;Promise.resolve().then((function(){n===c.current&&t()}))}}return(0,p.useEffect)((function(){return f}),[]),[function(r,i){var o=e(r),l=s.current.get(o);i?(s.current.set(o,i),d()):s.current.delete(o),!l!=!i&&(i?null==t||t(r):null==n||n(r))},d,u.current,o]}(te,null,null),re=(0,a.Z)(ne,4),ie=re[0],oe=re[1],le=re[2],ae=re[3],se=!(!1===_||!x||!M),ue=p.useMemo((function(){return Object.values(le.maps).reduce((function(e,t){return e+t}),0)}),[le.id,le.maps]),ce=se&&H&&(Math.max(M*H.length,ue)>x||!!V),fe="rtl"===B,de=c()(u,(0,l.Z)({},"".concat(u,"-rtl"),fe),m),he=H||D,pe=(0,p.useRef)(),ve=(0,p.useRef)(),me=(0,p.useRef)(),ge=(0,p.useState)(0),ye=(0,a.Z)(ge,2),be=ye[0],we=ye[1],xe=(0,p.useState)(0),Ce=(0,a.Z)(xe,2),Se=Ce[0],Me=Ce[1],ke=(0,p.useState)(!1),Le=(0,a.Z)(ke,2),Ee=Le[0],Te=Le[1],Ne=function(){Te(!0)},Ze=function(){Te(!1)},Oe={getKey:te};function Re(e){we((function(t){var n=function(e){var t=e;Number.isNaN($e.current)||(t=Math.min(t,$e.current));return t=Math.max(t,0),t}("function"==typeof e?e(t):e);return pe.current.scrollTop=n,n}))}var Ae=(0,p.useRef)({start:0,end:he.length}),De=(0,p.useRef)(),Pe=b(he,te),We=(0,a.Z)(Pe,1)[0];De.current=We;var Ie=p.useMemo((function(){if(!se)return{scrollHeight:void 0,start:0,end:he.length-1,offset:void 0};var e;if(!ce)return{scrollHeight:(null===(e=ve.current)||void 0===e?void 0:e.offsetHeight)||0,start:0,end:he.length-1,offset:void 0};for(var t,n,r,i=0,o=he.length,l=0;l<o;l+=1){var a=he[l],s=te(a),u=le.get(s),c=i+(void 0===u?M:u);c>=be&&void 0===t&&(t=l,n=i),c>be+x&&void 0===r&&(r=l),i=c}return void 0===t&&(t=0,n=0,r=Math.ceil(x/M)),void 0===r&&(r=he.length-1),{scrollHeight:i,start:t,end:r=Math.min(r+1,he.length-1),offset:n}}),[ce,se,be,he,ae,x]),He=Ie.scrollHeight,Fe=Ie.start,ze=Ie.end,_e=Ie.offset;Ae.current.start=Fe,Ae.current.end=ze,p.useLayoutEffect((function(){var e=le.getRecord();if(1===e.size){var t=Array.from(e.keys())[0],n=e.get(t),r=he[Fe];if(r&&void 0===n)if(te(r)===t){var i=le.get(t)-M;Re((function(e){return e+i}))}}le.resetRecord()}),[He]);var Be=p.useState({width:0,height:x}),Ve=(0,a.Z)(Be,2),je=Ve[0],Ke=Ve[1],Ge=(0,p.useRef)(),Xe=(0,p.useRef)(),Ye=p.useMemo((function(){return R(je.width,V)}),[je.width,V]),Ue=p.useMemo((function(){return R(je.height,He)}),[je.height,He]),qe=He-x,$e=(0,p.useRef)(qe);$e.current=qe;var Je=be<=0,Qe=be>=qe,et=Se<=0,tt=Se>=V,nt=C(Je,Qe,et,tt),rt=function(){return{x:fe?-Se:Se,y:be}},it=(0,p.useRef)(rt()),ot=(0,d.zX)((function(e){if(X){var t=(0,o.Z)((0,o.Z)({},rt()),e);it.current.x===t.x&&it.current.y===t.y||(X(t),it.current=t)}}));function lt(e,t){var n=e;t?((0,v.flushSync)((function(){Me(n)})),ot()):Re(n)}var at=function(e){var t=e,n=V?V-je.width:0;return t=Math.max(t,0),t=Math.min(t,n)},st=(0,d.zX)((function(e,t){t?((0,v.flushSync)((function(){Me((function(t){return at(t+(fe?-e:e))}))})),ot()):Re((function(t){return t+e}))})),ut=S(se,Je,Qe,et,tt,!!V,st),ct=(0,a.Z)(ut,2),ft=ct[0],dt=ct[1];!function(e,t,n){var r,i=(0,p.useRef)(!1),o=(0,p.useRef)(0),l=(0,p.useRef)(0),a=(0,p.useRef)(null),s=(0,p.useRef)(null),u=function(e){if(i.current){var t=Math.ceil(e.touches[0].pageX),r=Math.ceil(e.touches[0].pageY),a=o.current-t,u=l.current-r,c=Math.abs(a)>Math.abs(u);c?o.current=t:l.current=r;var f=n(c,c?a:u,!1,e);f&&e.preventDefault(),clearInterval(s.current),f&&(s.current=setInterval((function(){c?a*=T:u*=T;var e=Math.floor(c?a:u);(!n(c,e,!0)||Math.abs(e)<=.1)&&clearInterval(s.current)}),16))}},c=function(){i.current=!1,r()},f=function(e){r(),1!==e.touches.length||i.current||(i.current=!0,o.current=Math.ceil(e.touches[0].pageX),l.current=Math.ceil(e.touches[0].pageY),a.current=e.target,a.current.addEventListener("touchmove",u,{passive:!1}),a.current.addEventListener("touchend",c,{passive:!0}))};r=function(){a.current&&(a.current.removeEventListener("touchmove",u),a.current.removeEventListener("touchend",c))},(0,h.Z)((function(){return e&&t.current.addEventListener("touchstart",f,{passive:!0}),function(){var e;null===(e=t.current)||void 0===e||e.removeEventListener("touchstart",f),r(),clearInterval(s.current)}}),[e])}(se,pe,(function(e,t,n,r){var i=r;return!nt(e,t,n)&&((!i||!i._virtualHandled)&&(i&&(i._virtualHandled=!0),ft({preventDefault:function(){},deltaX:e?t:0,deltaY:e?0:t}),!0))})),function(e,t,n){p.useEffect((function(){var r=t.current;if(e&&r){var i,o,l=!1,a=function(){w.Z.cancel(i)},s=function e(){a(),i=(0,w.Z)((function(){n(o),e()}))},u=function(){l=!1,a()},c=function(e){if(!e.target.draggable&&0===e.button){var t=e;t._virtualHandled||(t._virtualHandled=!0,l=!0)}},f=function(e){if(l){var t=Z(e,!1),n=r.getBoundingClientRect(),i=n.top,u=n.bottom;t<=i?(o=-N(i-t),s()):t>=u?(o=N(t-u),s()):a()}};return r.addEventListener("mousedown",c),r.ownerDocument.addEventListener("mouseup",u),r.ownerDocument.addEventListener("mousemove",f),r.ownerDocument.addEventListener("dragend",u),function(){r.removeEventListener("mousedown",c),r.ownerDocument.removeEventListener("mouseup",u),r.ownerDocument.removeEventListener("mousemove",f),r.ownerDocument.removeEventListener("dragend",u),a()}}}),[e])}(ce,pe,(function(e){Re((function(t){return t+e}))})),(0,h.Z)((function(){function e(e){var t=Je&&e.detail<0,n=Qe&&e.detail>0;!se||t||n||e.preventDefault()}var t=pe.current;return t.addEventListener("wheel",ft,{passive:!1}),t.addEventListener("DOMMouseScroll",dt,{passive:!0}),t.addEventListener("MozMousePixelScroll",e,{passive:!1}),function(){t.removeEventListener("wheel",ft),t.removeEventListener("DOMMouseScroll",dt),t.removeEventListener("MozMousePixelScroll",e)}}),[se,Je,Qe]),(0,h.Z)((function(){if(V){var e=at(Se);Me(e),ot({x:e})}}),[je.width,V]);var ht=function(){var e,t;null===(e=Ge.current)||void 0===e||e.delayHidden(),null===(t=Xe.current)||void 0===t||t.delayHidden()},pt=function(e,t,n,r,l,s,u,c){var f=p.useRef(),d=p.useState(null),v=(0,a.Z)(d,2),m=v[0],g=v[1];return(0,h.Z)((function(){if(m&&m.times<10){if(!e.current)return void g((function(e){return(0,o.Z)({},e)}));s();var i=m.targetAlign,a=m.originAlign,c=m.index,f=m.offset,d=e.current.clientHeight,h=!1,p=i,v=null;if(d){for(var y=i||a,b=0,w=0,x=0,C=Math.min(t.length-1,c),S=0;S<=C;S+=1){var M=l(t[S]);w=b;var k=n.get(M);b=x=w+(void 0===k?r:k)}for(var L="top"===y?f:d-f,E=C;E>=0;E-=1){var T=l(t[E]),N=n.get(T);if(void 0===N){h=!0;break}if((L-=N)<=0)break}switch(y){case"top":v=w-f;break;case"bottom":v=x-d+f;break;default:var Z=e.current.scrollTop;w<Z?p="top":x>Z+d&&(p="bottom")}null!==v&&u(v),v!==m.lastTop&&(h=!0)}h&&g((0,o.Z)((0,o.Z)({},m),{},{times:m.times+1,targetAlign:p,lastTop:v}))}}),[m,e.current]),function(e){if(null!=e){if(w.Z.cancel(f.current),"number"==typeof e)u(e);else if(e&&"object"===(0,i.Z)(e)){var n,r=e.align;n="index"in e?e.index:t.findIndex((function(t){return l(t)===e.key}));var o=e.offset;g({times:0,index:n,offset:void 0===o?0:o,originAlign:r})}}else c()}}(pe,he,le,M,te,(function(){return oe(!0)}),Re,ht);p.useImperativeHandle(t,(function(){return{nativeElement:me.current,getScrollInfo:rt,scrollTo:function(e){var t;(t=e)&&"object"===(0,i.Z)(t)&&("left"in t||"top"in t)?(void 0!==e.left&&Me(at(e.left)),pt(e.top)):pt(e)}}})),(0,h.Z)((function(){if(Y){var e=he.slice(Fe,ze+1);Y(e,he)}}),[Fe,ze,he]);var vt=function(e,t,n,r){var i=p.useMemo((function(){return[new Map,[]]}),[e,n.id,r]),o=(0,a.Z)(i,2),l=o[0],s=o[1];return function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,a=l.get(i),u=l.get(o);if(void 0===a||void 0===u)for(var c=e.length,f=s.length;f<c;f+=1){var d,h=e[f],p=t(h);l.set(p,f);var v=null!==(d=n.get(p))&&void 0!==d?d:r;if(s[f]=(s[f-1]||0)+v,p===i&&(a=f),p===o&&(u=f),void 0!==a&&void 0!==u)break}return{top:s[a-1]||0,bottom:s[u]}}}(he,te,le,M),mt=null==q?void 0:q({start:Fe,end:ze,virtual:ce,offsetX:Se,offsetY:_e,rtl:fe,getSize:vt}),gt=function(e,t,n,r,i,o,l,a){var s=a.getKey;return e.slice(t,n+1).map((function(e,n){var a=l(e,t+n,{style:{width:r},offsetX:i}),u=s(e);return p.createElement(y,{key:u,setRef:function(t){return o(e,t)}},a)}))}(he,Fe,ze,V,Se,ie,F,Oe),yt=null;x&&(yt=(0,o.Z)((0,l.Z)({},W?"height":"maxHeight",x),P),se&&(yt.overflowY="hidden",V&&(yt.overflowX="hidden"),Ee&&(yt.pointerEvents="none")));var bt={};return fe&&(bt.dir="rtl"),p.createElement("div",(0,r.Z)({ref:me,style:(0,o.Z)((0,o.Z)({},I),{},{position:"relative"}),className:de},bt,ee),p.createElement(f.Z,{onResize:function(e){Ke({width:e.offsetWidth,height:e.offsetHeight})}},p.createElement(K,{className:"".concat(u,"-holder"),style:yt,ref:pe,onScroll:function(e){var t=e.currentTarget.scrollTop;t!==be&&Re(t),null==G||G(e),ot()},onMouseEnter:ht},p.createElement(g,{prefixCls:u,height:He,offsetX:Se,offsetY:_e,scrollWidth:V,onInnerResize:oe,ref:ve,innerProps:U,rtl:fe,extra:mt},gt))),ce&&He>x&&p.createElement(O,{ref:Ge,prefixCls:u,scrollOffset:be,scrollRange:He,rtl:fe,onScroll:lt,onStartMove:Ne,onStopMove:Ze,spinSize:Ue,containerSize:je.height,style:null==$?void 0:$.verticalScrollBar,thumbStyle:null==$?void 0:$.verticalScrollBarThumb,showScrollBar:Q}),ce&&V>je.width&&p.createElement(O,{ref:Xe,prefixCls:u,scrollOffset:Se,scrollRange:V,rtl:fe,onScroll:lt,onStartMove:Ne,onStopMove:Ze,spinSize:Ye,containerSize:je.width,horizontal:!0,style:null==$?void 0:$.horizontalScrollBar,thumbStyle:null==$?void 0:$.horizontalScrollBarThumb,showScrollBar:Q}))}var I=p.forwardRef(W);I.displayName="List";var H=I},76374:function(e,t,n){"use strict";var r=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];e.call(t,i[1],i[0])}},t}()}(),i="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,o=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),l="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(o):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var a=["top","right","bottom","left","width","height","size","weight"],s="undefined"!=typeof MutationObserver,u=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&s()}function a(){l(o)}function s(){var e=Date.now();if(n){if(e-i<2)return;r=!0}else n=!0,r=!1,setTimeout(a,t);i=e}return s}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){i&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;a.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),c=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},f=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||o},d=y(0,0,0,0);function h(e){return parseFloat(e)||0}function p(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+h(e["border-"+n+"-width"])}),0)}function v(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return d;var r=f(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=e["padding-"+i];t[i]=h(o)}return t}(r),o=i.left+i.right,l=i.top+i.bottom,a=h(r.width),s=h(r.height);if("border-box"===r.boxSizing&&(Math.round(a+o)!==t&&(a-=p(r,"left","right")+o),Math.round(s+l)!==n&&(s-=p(r,"top","bottom")+l)),!function(e){return e===f(e).document.documentElement}(e)){var u=Math.round(a+o)-t,c=Math.round(s+l)-n;1!==Math.abs(u)&&(a-=u),1!==Math.abs(c)&&(s-=c)}return y(i.left,i.top,a,s)}var m="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof f(e).SVGGraphicsElement}:function(e){return e instanceof f(e).SVGElement&&"function"==typeof e.getBBox};function g(e){return i?m(e)?function(e){var t=e.getBBox();return y(0,0,t.width,t.height)}(e):v(e):d}function y(e,t,n,r){return{x:e,y:t,width:n,height:r}}var b=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=y(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=g(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),w=function(e,t){var n,r,i,o,l,a,s,u=(r=(n=t).x,i=n.y,o=n.width,l=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(a.prototype),c(s,{x:r,y:i,width:o,height:l,top:i,right:r+o,bottom:l+i,left:r}),s);c(this,{target:e,contentRect:u})},x=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new r,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof f(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new b(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof f(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new w(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),C="undefined"!=typeof WeakMap?new WeakMap:new r,S=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=u.getInstance(),r=new x(t,n,this);C.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){S.prototype[e]=function(){var t;return(t=C.get(this))[e].apply(t,arguments)}}));var M=void 0!==o.ResizeObserver?o.ResizeObserver:S;t.Z=M},16722:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});const r=e=>"object"==typeof e&&null!=e&&1===e.nodeType,i=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,o=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return i(n.overflowY,t)||i(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},l=(e,t,n,r,i,o,l,a)=>o<e&&l>t||o>e&&l<t?0:o<=e&&a<=n||l>=t&&a>=n?o-e-r:l>t&&a<n||o<e&&a>n?l-t+i:0,a=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},s=(e,t)=>{var n,i,s,u;if("undefined"==typeof document)return[];const{scrollMode:c,block:f,inline:d,boundary:h,skipOverflowHiddenElements:p}=t,v="function"==typeof h?h:e=>e!==h;if(!r(e))throw new TypeError("Invalid target");const m=document.scrollingElement||document.documentElement,g=[];let y=e;for(;r(y)&&v(y);){if(y=a(y),y===m){g.push(y);break}null!=y&&y===document.body&&o(y)&&!o(document.documentElement)||null!=y&&o(y,p)&&g.push(y)}const b=null!=(i=null==(n=window.visualViewport)?void 0:n.width)?i:innerWidth,w=null!=(u=null==(s=window.visualViewport)?void 0:s.height)?u:innerHeight,{scrollX:x,scrollY:C}=window,{height:S,width:M,top:k,right:L,bottom:E,left:T}=e.getBoundingClientRect(),{top:N,right:Z,bottom:O,left:R}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let A="start"===f||"nearest"===f?k-N:"end"===f?E+O:k+S/2-N+O,D="center"===d?T+M/2-R+Z:"end"===d?L+Z:T-R;const P=[];for(let e=0;e<g.length;e++){const t=g[e],{height:n,width:r,top:i,right:a,bottom:s,left:u}=t.getBoundingClientRect();if("if-needed"===c&&k>=0&&T>=0&&E<=w&&L<=b&&(t===m&&!o(t)||k>=i&&E<=s&&T>=u&&L<=a))return P;const h=getComputedStyle(t),p=parseInt(h.borderLeftWidth,10),v=parseInt(h.borderTopWidth,10),y=parseInt(h.borderRightWidth,10),N=parseInt(h.borderBottomWidth,10);let Z=0,O=0;const R="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-y:0,W="offsetHeight"in t?t.offsetHeight-t.clientHeight-v-N:0,I="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,H="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(m===t)Z="start"===f?A:"end"===f?A-w:"nearest"===f?l(C,C+w,w,v,N,C+A,C+A+S,S):A-w/2,O="start"===d?D:"center"===d?D-b/2:"end"===d?D-b:l(x,x+b,b,p,y,x+D,x+D+M,M),Z=Math.max(0,Z+C),O=Math.max(0,O+x);else{Z="start"===f?A-i-v:"end"===f?A-s+N+W:"nearest"===f?l(i,s,n,v,N+W,A,A+S,S):A-(i+n/2)+W/2,O="start"===d?D-u-p:"center"===d?D-(u+r/2)+R/2:"end"===d?D-a+y+R:l(u,a,r,p,y+R,D,D+M,M);const{scrollLeft:e,scrollTop:o}=t;Z=0===H?0:Math.max(0,Math.min(o+Z/H,t.scrollHeight-n/H+W)),O=0===I?0:Math.max(0,Math.min(e+O/I,t.scrollWidth-r/I+R)),A+=o-Z,D+=e-O}P.push({el:t,top:Z,left:O})}return P};function u(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(s(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:i,top:o,left:l}of s(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=o-n.top+n.bottom,t=l-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}}}]);