From a3802c1755357bc54e8ddabf9c380be078e858e9 Mon Sep 17 00:00:00 2001 From: jacky6024 Date: Thu, 16 Nov 2017 16:26:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8A=A5=E8=A1=A8=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=9C=A8=E4=B8=8E=E6=9C=8D=E5=8A=A1=E7=AB=AF?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E5=87=BA=E7=8E=B0=E5=BC=82=E5=B8=B8=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E5=BC=82=E5=B8=B8=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ureport/console/BaseServletAction.java | 8 ++++- .../bstek/ureport/console/UReportServlet.java | 19 ++++++++++ .../html/HtmlPreviewServletAction.java | 10 +----- .../ureport-asserts/js/designer.bundle.js | 36 +++++++++---------- .../ureport-asserts/js/preview.bundle.js | 2 +- .../dialog/BuildinDatasourceSelectDialog.js | 8 +++-- ureport2-js/src/dialog/DatasourceDialog.js | 8 ++--- ureport2-js/src/dialog/MethodSelectDialog.js | 8 +++-- ureport2-js/src/dialog/OpenDialog.js | 16 ++++++--- ureport2-js/src/dialog/SaveDialog.js | 24 +++++++++---- ureport2-js/src/dialog/SqlDatasetDialog.js | 24 +++++++++---- ureport2-js/src/preview.js | 24 +++++++++---- ureport2-js/src/table/ReportTable.js | 8 +++-- ureport2-js/src/tools/SaveTool.js | 8 +++-- ureport2-js/src/tree/BuildinTree.js | 8 +++-- ureport2-js/src/tree/DatabaseTree.js | 8 +++-- ureport2-js/src/tree/SpringTree.js | 10 ++++-- 17 files changed, 159 insertions(+), 70 deletions(-) diff --git a/ureport2-console/src/main/java/com/bstek/ureport/console/BaseServletAction.java b/ureport2-console/src/main/java/com/bstek/ureport/console/BaseServletAction.java index a40e78a..21e7f5d 100644 --- a/ureport2-console/src/main/java/com/bstek/ureport/console/BaseServletAction.java +++ b/ureport2-console/src/main/java/com/bstek/ureport/console/BaseServletAction.java @@ -33,7 +33,13 @@ import com.bstek.ureport.exception.ReportComputeException; * @since 2016年6月3日 */ public abstract class BaseServletAction implements ServletAction { - + protected Throwable buildRootException(Throwable throwable){ + if(throwable.getCause()==null){ + return throwable; + } + return buildRootException(throwable.getCause()); + } + protected String decode(String value){ if(value==null){ return value; diff --git a/ureport2-console/src/main/java/com/bstek/ureport/console/UReportServlet.java b/ureport2-console/src/main/java/com/bstek/ureport/console/UReportServlet.java index 9778829..090136d 100644 --- a/ureport2-console/src/main/java/com/bstek/ureport/console/UReportServlet.java +++ b/ureport2-console/src/main/java/com/bstek/ureport/console/UReportServlet.java @@ -27,6 +27,7 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang.StringUtils; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; @@ -74,10 +75,28 @@ public class UReportServlet extends HttpServlet { RequestHolder.setRequest(req); try{ targetHandler.execute(req, resp); + }catch(Exception ex){ + resp.setCharacterEncoding("UTF-8"); + PrintWriter pw=resp.getWriter(); + Throwable e=buildRootException(ex); + resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + String errorMsg = e.getMessage(); + if(StringUtils.isBlank(errorMsg)){ + errorMsg=e.getClass().getName(); + } + pw.write(errorMsg); + pw.close(); + throw new ServletException(ex); }finally{ RequestHolder.clean(); } } + private Throwable buildRootException(Throwable throwable){ + if(throwable.getCause()==null){ + return throwable; + } + return buildRootException(throwable.getCause()); + } private void outContent(HttpServletResponse resp, String msg) throws IOException { resp.setContentType("text/html"); diff --git a/ureport2-console/src/main/java/com/bstek/ureport/console/html/HtmlPreviewServletAction.java b/ureport2-console/src/main/java/com/bstek/ureport/console/html/HtmlPreviewServletAction.java index d252257..6c13606 100644 --- a/ureport2-console/src/main/java/com/bstek/ureport/console/html/HtmlPreviewServletAction.java +++ b/ureport2-console/src/main/java/com/bstek/ureport/console/html/HtmlPreviewServletAction.java @@ -330,20 +330,12 @@ public class HtmlPreviewServletAction extends RenderPageServletAction { StringWriter sw=new StringWriter(); PrintWriter pw=new PrintWriter(sw); root.printStackTrace(pw); - StringBuffer sb=sw.getBuffer(); - String trace=sb.toString(); + String trace=sw.getBuffer().toString(); trace=trace.replaceAll("\n", "
"); pw.close(); return trace; } - private Throwable buildRootException(Throwable throwable){ - if(throwable.getCause()==null){ - return throwable; - } - return buildRootException(throwable.getCause()); - } - public void setExportManager(ExportManager exportManager) { this.exportManager = exportManager; } diff --git a/ureport2-console/src/main/resources/ureport-asserts/js/designer.bundle.js b/ureport2-console/src/main/resources/ureport-asserts/js/designer.bundle.js index 49752ee..0a6cc7b 100644 --- a/ureport2-console/src/main/resources/ureport-asserts/js/designer.bundle.js +++ b/ureport2-console/src/main/resources/ureport-asserts/js/designer.bundle.js @@ -12,7 +12,7 @@ o.marker.collapsed&&!o.marker.widgetNode&&o.from==n.to&&(null==o.to||o.to!=n.fro return o.lineGutter.style.width="",o.lineNumInnerWidth=Math.max(a,o.lineGutter.offsetWidth-s)+1,o.lineNumWidth=o.lineNumInnerWidth+s,o.lineNumChars=o.lineNumInnerWidth?n.length:-1,o.lineGutter.style.width=o.lineNumWidth+"px",Ei(e),!0}return!1}function Qn(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i.001||l<-.001)&&(I(o.line,r),Yn(o.line),o.rest))for(var d=0;d=a&&(r=_(t,fe(x(t,l))-e.wrapper.clientHeight),a=l)}return{from:r,to:Math.max(a,r+1)}}function Un(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,$r||Ci(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),$r&&Ci(e),Mi(e,100))}function Hn(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Bn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function On(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 zn(e){var t=On(e);return t.x*=es,t.y*=es,t}function Fn(e,t){var n=On(t),i=n.x,o=n.y,r=e.display,a=r.scroller,s=a.scrollWidth>a.clientWidth,l=a.scrollHeight>a.clientHeight;if(i&&s||o&&l){if(o&&Aa&&oa)e:for(var d=t.target,u=r.view;d!=a;d=d.parentNode)for(var c=0;c(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!ua){var a=i("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Ht(e.display))+"px;\n height: "+(t.bottom-t.top+Ft(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(r),e.display.lineSpace.removeChild(a)}}}function Xn(e,t,n,i){null==i&&(i=0);for(var o,r=0;r<5;r++){var a=!1;o=hn(e,t);var s=n&&n!=t?hn(e,n):o,l=Kn(e,Math.min(o.left,s.left),Math.min(o.top,s.top)-i,Math.max(o.left,s.left),Math.max(o.bottom,s.bottom)+i),d=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=l.scrollTop&&(Un(e,l.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(a=!0)),null!=l.scrollLeft&&(Hn(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(a=!0)),!a)break}return o}function Zn(e,t,n,i,o){var r=Kn(e,t,n,i,o);null!=r.scrollTop&&Un(e,r.scrollTop),null!=r.scrollLeft&&Hn(e,r.scrollLeft)}function Kn(e,t,n,i,o){var r=e.display,a=mn(e.display);n<0&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,l=Vt(e),d={};o-n>l&&(o=n+l);var u=e.doc.height+Ot(r),c=nu-a;if(ns+l){var A=Math.min(n,(h?u:o)-l);A!=s&&(d.scrollTop=A)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,p=Pt(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),g=i-t>p;return g&&(i=t+p),t<10?d.scrollLeft=0:tp+f-3&&(d.scrollLeft=i+(g?0:10)-p),d}function qn(e,t,n){null==t&&null==n||ei(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function $n(e){ei(e);var t=e.getCursor(),n=t,i=t;e.options.lineWrapping||(n=t.ch?k(t.line,t.ch-1):t,i=k(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:i,margin:e.options.cursorScrollMargin,isCursor:!0}}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=An(e,t.from),i=An(e,t.to),o=Kn(e,Math.min(n.left,i.left),Math.min(n.top,i.top)-t.margin,Math.max(n.right,i.right),Math.max(n.bottom,i.bottom)+t.margin);e.scrollTo(o.scrollLeft,o.scrollTop)}}function ti(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++os},vt(e.curOp)}function ni(e){var t=e.curOp;Tt(t,function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new rs(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ri(e){e.updatedDisplay=e.mustUpdate&&bi(e.cm,e.update)}function ai(e){var t=e.cm,n=t.display;e.updatedDisplay&&Qn(t),e.barMeasure=Pn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Xt(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+Ft(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Pt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function si(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)ka&&ue(e.doc,t)o.viewFrom?pi(e):(o.viewFrom+=i,o.viewTo+=i);else if(t<=o.viewFrom&&n>=o.viewTo)pi(e);else if(t<=o.viewFrom){var r=gi(e,n,n+i,1);r?(o.view=o.view.slice(r.index),o.viewFrom=r.lineN,o.viewTo+=i):pi(e)}else if(n>=o.viewTo){var a=gi(e,t,t,-1);a?(o.view=o.view.slice(0,a.index),o.viewTo=a.lineN):pi(e)}else{var s=gi(e,t,t,-1),l=gi(e,n,n+i,1);s&&l?(o.view=o.view.slice(0,s.index).concat(wt(e,s.lineN,l.lineN)).concat(o.view.slice(l.index)),o.viewTo+=i):pi(e)}var d=o.externalMeasured;d&&(n=o.lineN&&t=i.viewTo)){var r=i.view[Cn(e,t)];if(null!=r.node){var a=r.changes||(r.changes=[]);h(a,n)==-1&&a.push(n)}}}function pi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function gi(e,t,n,i){var o,r=Cn(e,t),a=e.display.view;if(!ka||n==e.doc.first+e.doc.size)return{index:r,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(r==a.length-1)return null;o=s+a[r].size-t,r++}else o=s-t;t+=o,n+=o}for(;ue(e.doc,n)!=n;){if(r==(i<0?0:a.length-1))return null;n+=i*a[r-(i<0?1:0)].size,r+=i}return{index:r,lineN:n}}function mi(e,t,n){var i=e.display,o=i.view;0==o.length||t>=i.viewTo||n<=i.viewFrom?(i.view=wt(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=wt(e,t,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,Cn(e,n)))),i.viewTo=n}function yi(e){for(var t=e.display.view,n=0,i=0;i=e.display.viewTo)){var n=+new Date+e.options.workTime,i=Xe(t.mode,et(e,t.frontier)),o=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(r){if(t.frontier>=e.display.viewFrom){var a=r.styles,s=r.text.length>e.options.maxHighlightLength,l=qe(e,r,s?Xe(t.mode,i):i,!0);r.styles=l.styles;var d=r.styleClasses,u=l.classes;u?r.styleClasses=u:d&&(r.styleClasses=null);for(var c=!a||a.length!=r.styles.length||d!=u&&(!d||!u||d.bgClass!=u.bgClass||d.textClass!=u.textClass),h=0;!c&&hn)return Mi(e,e.options.workDelay),!0}),o.length&&di(e,function(){for(var t=0;t=i.viewFrom&&n.visible.to<=i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&0==yi(e))return!1;jn(e)&&(pi(e),n.dims=Mn(e));var a=o.first+o.size,s=Math.max(n.visible.from-e.options.viewportMargin,o.first),l=Math.min(a,n.visible.to+e.options.viewportMargin);i.viewFroml&&i.viewTo-l<20&&(l=Math.min(a,i.viewTo)),ka&&(s=ue(e.doc,s),l=ce(e.doc,l));var d=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=n.wrapperHeight||i.lastWrapWidth!=n.wrapperWidth;mi(e,s,l),i.viewOffset=fe(x(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var u=yi(e);if(!d&&0==u&&!n.force&&i.renderedView==i.view&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo))return!1;var c=r();return u>4&&(i.lineDiv.style.display="none"),xi(e,i.updateLineNumbers,n.dims),u>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,c&&r()!=c&&c.offsetHeight&&c.focus(),t(i.cursorDiv),t(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,d&&(i.lastWrapHeight=n.wrapperHeight,i.lastWrapWidth=n.wrapperWidth,Mi(e,400)),i.updateLineNumbers=null,!0}function Ti(e,t){for(var n=t.viewport,i=!0;(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Pt(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Ot(e.display)-Vt(e),n.top)}),t.visible=Rn(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&bi(e,t);i=!1){Qn(e);var o=Pn(e);xn(e),Vn(e,o),Di(e,o)}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 Ci(e,t){var n=new rs(e,t);if(bi(e,n)){Qn(e),Ti(e,n);var i=Pn(e);xn(e),Vn(e,i),Di(e,i),n.finish()}}function xi(e,n,i){function o(t){var n=t.nextSibling;return oa&&Aa&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var r=e.display,a=e.options.lineNumbers,s=r.lineDiv,l=s.firstChild,d=r.view,u=r.viewFrom,c=0;c-1&&(f=!1),Et(e,A,u,i)),f&&(t(A.lineNumber),A.lineNumber.appendChild(document.createTextNode(S(e.options,u)))),l=A.node.nextSibling}else{var p=Bt(e,A,u,i);s.insertBefore(p,l)}u+=A.size}for(;l;)l=o(l)}function Ei(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Di(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+Ft(e)+"px"}function Ii(e){var n=e.display.gutters,o=e.options.gutters;t(n);for(var r=0;r-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function _i(e,t){this.ranges=e,this.primIndex=t}function Ni(e,t){this.anchor=e,this.head=t}function Si(e,t){var n=e[t];e.sort(function(e,t){return B(e.from(),t.from())}),t=h(e,n);for(var i=1;i=0){var a=Y(r.from(),o.from()),s=Q(r.to(),o.to()),l=r.empty()?o.from()==o.head:r.from()==r.head;i<=t&&--t,e.splice(--i,2,new Ni(l?s:a,l?a:s))}}return new _i(e,t)}function ki(e,t){return new _i([new Ni(e,t||e)],0)}function Bi(e){return e.text?k(e.from.line+e.text.length-1,p(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function ji(e,t){if(B(e,t.from)<0)return e;if(B(e,t.to)<=0)return Bi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Bi(t).ch-t.to.ch),k(n,i)}function Qi(e,t){for(var n=[],i=0;i1&&e.remove(s.line+1,f-1),e.insert(s.line+1,y)}Ct(e,"change",e,t)}function Fi(e,t,n){function i(e,o,r){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),p(e.done)):void 0}function Xi(e,t,n,i){var o=e.history;o.undone.length=0;var r,a,s=+new Date;if((o.lastOp==i||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&o.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(r=Ji(o,o.lastOp==i)))a=p(r.changes),0==B(t.from,t.to)&&0==B(t.from,a.to)?a.to=Bi(t):r.changes.push(Wi(e,t));else{var l=p(o.done);for(l&&l.ranges||qi(e.sel,o.done),r={changes:[Wi(e,t)],generation:o.generation},o.done.push(r);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=i,o.lastOrigin=o.lastSelOrigin=t.origin,a||_e(e,"historyAdded")}function Zi(e,t,n,i){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ki(e,t,n,i){var o=e.history,r=i&&i.origin;n==o.lastSelOp||r&&o.lastSelOrigin==r&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==r||Zi(e,r,p(o.done),t))?o.done[o.done.length-1]=t:qi(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=r,o.lastSelOp=n,i&&i.clearRedo!==!1&&Gi(o.undone)}function qi(e,t){var n=p(t);n&&n.ranges&&n.equals(e)||t.push(e)}function $i(e,t,n,i){var o=t["spans_"+e.id],r=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[r]=n.markedSpans),++r})}function eo(e){if(!e)return null;for(var t,n=0;n-1&&(p(s)[c]=d[c],delete d[c])}}}return i}function oo(e,t,n,i){if(e.cm&&e.cm.display.shift||e.extend){var o=t.anchor;if(i){var r=B(n,o)<0;r!=B(i,o)<0?(o=n,n=i):r!=B(n,i)<0&&(n=i)}return new Ni(o,n)}return new Ni(i||n,n)}function ro(e,t,n,i){ho(e,new _i([oo(e,e.sel.primary(),t,n)],0),i)}function ao(e,t,n){for(var i=[],o=0;o=t.ch:s.to>t.ch))){if(o&&(_e(l,"beforeCursorEnter"),l.explicitlyCleared)){if(r.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(i<0?1:-1),u=void 0;if((i<0?l.inclusiveRight:l.inclusiveLeft)&&(d=Mo(e,d,-i,d&&d.line==t.line?r:null)),d&&d.line==t.line&&(u=B(d,n))&&(i<0?u<0:u>0))return mo(e,d,t,i,o)}var c=l.find(i<0?-1:1);return(i<0?l.inclusiveLeft:l.inclusiveRight)&&(c=Mo(e,c,i,c.line==t.line?r:null)),c?mo(e,c,t,i,o):null}}return t}function yo(e,t,n,i,o){var r=i||1,a=mo(e,t,n,r,o)||!o&&mo(e,t,n,r,!0)||mo(e,t,n,-r,o)||!o&&mo(e,t,n,-r,!0);return a?a:(e.cantEdit=!0,k(e.first,0))}function Mo(e,t,n,i){return n<0&&0==t.ch?t.line>e.first?U(e,k(t.line-1)):null:n>0&&t.ch==(i||x(e,t.line)).text.length?t.line=0;--o)To(e,{from:i[o].from,to:i[o].to,text:o?[""]:t.text});else To(e,t)}}function To(e,t){if(1!=t.text.length||""!=t.text[0]||0!=B(t.from,t.to)){var n=Qi(e,t);Xi(e,t,n,e.cm?e.cm.curOp.id:NaN),Eo(e,t,n,Z(e,t));var i=[];Fi(e,function(e,n){n||h(i,e.history)!=-1||(No(e.history,t),i.push(e.history)),Eo(e,t,null,Z(e,t))})}}function Co(e,t,n){if(!e.cm||!e.cm.state.suppressEdits||n){for(var i,o=e.history,r=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,l=0;l=0;--A){var f=c(A);if(f)return f.v}}}}function xo(e,t){if(0!=t&&(e.first+=t,e.sel=new _i(g(e.sel.ranges,function(e){return new Ni(k(e.anchor.line+t,e.anchor.ch),k(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Ai(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;ie.lastLine())){if(t.from.liner&&(t={from:t.from,to:k(r,x(e,r).text.length),text:[t.text[0]],origin:t.origin}),t.removed=E(e,t.from,t.to),n||(n=Qi(e,t)),e.cm?Do(e.cm,t,i):zi(e,t,i),Ao(e,n,Ea)}}function Do(e,t,n){var i=e.doc,o=e.display,r=t.from,a=t.to,s=!1,l=r.line;e.options.lineWrapping||(l=L(le(x(i,r.line))),i.iter(l,a.line+1,function(e){if(e==o.maxLine)return s=!0,!0})),i.sel.contains(t.from,t.to)>-1&&Se(e),zi(i,t,n,vn(e)),e.options.lineWrapping||(i.iter(l,r.line+t.text.length,function(e){var t=pe(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),i.frontier=Math.min(i.frontier,r.line),Mi(e,400);var d=t.text.length-(a.line-r.line)-1;t.full?Ai(e):r.line!=a.line||1!=t.text.length||Oi(e.doc,t)?Ai(e,r.line,a.line+1,d):fi(e,r.line,"text");var u=ke(e,"changes"),c=ke(e,"change");if(c||u){var h={from:r,to:a,text:t.text,removed:t.removed,origin:t.origin};c&&Ct(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Io(e,t,n,i,o){if(i||(i=n),B(i,n)<0){var r=i;i=n,n=r}"string"==typeof t&&(t=e.splitLines(t)),bo(e,{from:n,to:i,text:t,origin:o})}function Lo(e,t,n,i){n0||0==s&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=i("span",[a.replacedWith],"CodeMirror-widget"),a.widgetNode.setAttribute("role","presentation"),o.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),o.insertLeft&&(a.widgetNode.insertLeft=!0)), a.collapsed){if(se(e,t.line,t,n,a)||t.line!=n.line&&se(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");F()}a.addToHistory&&Xi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,u=t.line,c=e.cm;if(e.iter(u,n.line+1,function(e){c&&a.collapsed&&!c.options.lineWrapping&&le(e)==c.display.maxLine&&(l=!0),a.collapsed&&u!=t.line&&I(e,0),G(e,new P(a,u==t.line?t.ch:null,u==n.line?n.ch:null)),++u}),a.collapsed&&e.iter(t.line,n.line+1,function(t){he(e,t)&&I(t,0)}),a.clearOnEnter&&Ya(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(z(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++as,a.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),a.collapsed)Ai(c,t.line,n.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var h=t.line;h<=n.line;h++)fi(c,h,"text");a.atomic&&po(c.doc),Ct(c,"markerAdded",c,a)}return a}function Ho(e,t){var n=this;this.markers=e,this.primary=t;for(var i=0;i-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var d=e.dataTransfer.getData("Text");if(d){var u;if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),Ao(t.doc,ki(n,n)),u)for(var c=0;c=0;t--)Io(e.doc,"",i[t].from,i[t].to,"+delete");$n(e)})}function ar(e,t){var n=x(e.doc,t),i=le(n);i!=n&&(t=L(i));var o=De(i),r=o?o[0].level%2?ve(i):we(i):0;return k(t,r)}function sr(e,t){for(var n,i=x(e.doc,t);n=ae(i);)i=n.find(1,!0).line,t=null;var o=De(i),r=o?o[0].level%2?we(i):ve(i):i.text.length;return k(null==t?L(i):t,r)}function lr(e,t){var n=ar(e,t.line),i=x(e.doc,n.line),o=De(i);if(!o||0==o[0].level){var r=Math.max(0,i.text.search(/\S/)),a=t.line==n.line&&t.ch<=r&&t.ch;return k(n.line,a?0:r)}return n}function dr(e,t,n){if("string"==typeof t&&(t=ys[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),o=t(e)!=xa}finally{e.display.shift=i,e.state.suppressEdits=!1}return o}function ur(e,t,n){for(var i=0;io-400&&0==B(ms.pos,n)?i="triple":gs&&gs.time>o-400&&0==B(gs.pos,n)?(i="double",ms={time:o,pos:n}):(i="single",gs={time:o,pos:n});var a,s=e.doc.sel,d=Aa?t.metaKey:t.ctrlKey;e.options.dragDrop&&Ra&&!e.isReadOnly()&&"single"==i&&(a=s.contains(n))>-1&&(B((a=s.ranges[a]).from(),n)<0||n.xRel>0)&&(B(a.to(),n)>0||n.xRel<0)?wr(e,t,n,d):vr(e,t,n,i,d)}function wr(e,t,n,i){var o=e.display,r=+new Date,a=ui(e,function(s){oa&&(o.scroller.draggable=!1),e.state.draggingText=!1,Le(document,"mouseup",a),Le(o.scroller,"drop",a),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(je(s),!i&&+new Date-200w&&o.push(new Ni(k(g,w),k(g,A(y,d,r))))}o.length||o.push(new Ni(n,n)),ho(c,Si(p.ranges.slice(0,f).concat(o),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var v=h,b=v.anchor,T=t;if("single"!=i){var C;C="double"==i?e.findWordAt(t):new Ni(k(t.line,0),U(c,k(t.line+1,0))),B(C.anchor,b)>0?(T=C.head,b=Y(v.from(),C.anchor)):(T=C.anchor,b=Q(v.to(),C.head))}var E=p.ranges.slice(0);E[f]=new Ni(U(c,b),T),ho(c,Si(E,f),Da)}}function s(t){var n=++v,o=Tn(e,t,!0,"rect"==i);if(o)if(0!=B(o,M)){e.curOp.focus=r(),a(o);var l=Rn(d,c);(o.line>=l.to||o.linew.bottom?20:0;u&&setTimeout(ui(e,function(){v==n&&(d.scroller.scrollTop+=u,s(t))}),50)}}function l(t){e.state.selectingText=!1,v=1/0,je(t),d.input.focus(),Le(document,"mousemove",b),Le(document,"mouseup",T),c.history.lastSelOrigin=null}var d=e.display,c=e.doc;je(t);var h,f,p=c.sel,g=p.ranges;if(o&&!t.shiftKey?(f=c.sel.contains(n),h=f>-1?g[f]:new Ni(n,n)):(h=c.sel.primary(),f=c.sel.primIndex),fa?t.shiftKey&&t.metaKey:t.altKey)i="rect",o||(h=new Ni(n,n)),n=Tn(e,t,!0,!0),f=-1;else if("double"==i){var m=e.findWordAt(n);h=e.display.shift||c.extend?oo(c,h,m.anchor,m.head):m}else if("triple"==i){var y=new Ni(k(n.line,0),U(c,k(n.line+1,0)));h=e.display.shift||c.extend?oo(c,h,y.anchor,y.head):y}else h=oo(c,h,n);o?f==-1?(f=g.length,ho(c,Si(g.concat([h]),f),{scroll:!1,origin:"*mouse"})):g.length>1&&g[f].empty()&&"single"==i&&!t.shiftKey?(ho(c,Si(g.slice(0,f).concat(g.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=c.sel):so(c,f,h,Da):(f=0,ho(c,new _i([h],0),Da),p=c.sel);var M=n,w=d.wrapper.getBoundingClientRect(),v=0,b=ui(e,function(e){He(e)?s(e):l(e)}),T=ui(e,l);e.state.selectingText=T,Ya(document,"mousemove",b),Ya(document,"mouseup",T)}function br(e,t,n,i){var o,r;try{o=t.clientX,r=t.clientY}catch(e){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&je(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(r>s.bottom||!ke(e,n))return Ye(t);r-=s.top-a.viewOffset;for(var l=0;l=o){var u=_(e.doc,r),c=e.options.gutters[l];return _e(e,n,e,u,c,t),Ye(t)}}}function Tr(e,t){return br(e,t,"gutterClick",!0)}function Cr(e,t){Ut(e.display,t)||xr(e,t)||Ne(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function xr(e,t){return!!ke(e,"gutterContextMenu")&&br(e,t,"gutterContextMenu",!1)}function Er(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),an(e)}function Dr(e){function t(t,i,o,r){e.defaults[t]=i,o&&(n[t]=r?function(e,t,n){n!=vs&&o(e,t,n)}:o)}var n=e.optionHandlers;e.defineOption=t,e.Init=vs,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Ui(e)},!0),t("indentUnit",2,Ui,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Hi(e),an(e),Ai(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],i=e.doc.first;e.doc.iter(function(e){for(var o=0;;){var r=e.text.indexOf(t,o);if(r==-1)break;o=r+t.length,n.push(k(i,r))}i++});for(var o=n.length-1;o>=0;o--)Io(e.doc,t,n[o],k(n[o].line,n[o].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=vs&&e.refresh()}),t("specialCharPlaceholder",At,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",ha?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!pa),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){Er(e),Ir(e)},!0),t("keyMap","default",function(e,t,n){var i=or(t),o=n!=vs&&or(n);o&&o.detach&&o.detach(e,i),i.attach&&i.attach(e,o||null)}),t("extraKeys",null),t("lineWrapping",!1,_r,!0),t("gutters",[],function(e){Li(e.options),Ir(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?wn(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return Vn(e)},!0),t("scrollbarStyle","native",function(e){Gn(e),Vn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){Li(e.options),Ir(e)},!0),t("firstLineNumber",1,Ir,!0),t("lineNumberFormatter",function(e){return e},Ir,!0),t("showCursorWhenSelecting",!1,xn,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(kn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Lr),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,xn,!0),t("singleCursorHeightPerLine",!0,xn,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Hi,!0),t("addModeClass",!1,Hi,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Hi,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null)}function Ir(e){Ii(e),Ai(e),Bn(e)}function Lr(e,t,n){var i=n&&n!=vs;if(!t!=!i){var o=e.display.dragFunctions,r=t?Ya:Le;r(e.display.scroller,"dragstart",o.start),r(e.display.scroller,"dragenter",o.enter),r(e.display.scroller,"dragover",o.over),r(e.display.scroller,"dragleave",o.leave),r(e.display.scroller,"drop",o.drop)}}function _r(e){e.options.lineWrapping?(a(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(wa(e.display.wrapper,"CodeMirror-wrap"),ge(e)),bn(e),Ai(e),an(e),setTimeout(function(){return Vn(e)},100)}function Nr(e,t){var n=this;if(!(this instanceof Nr))return new Nr(e,t);this.options=t=t?d(t):{},d(bs,t,!1),Li(t);var i=t.value;"string"==typeof i&&(i=new ls(i,t.mode,null,t.lineSeparator)),this.doc=i;var o=new Nr.inputStyles[t.inputStyle](this),r=this.display=new C(e,i,o);r.wrapper.CodeMirror=this,Ii(this),Er(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gn(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 c,keySeq:null,specialChars:null},t.autofocus&&!ha&&r.input.focus(),na&&ia<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Sr(this),Zo(),ti(this),this.curOp.forceUpdate=!0,Pi(this,i),t.autofocus&&!ha||this.hasFocus()?setTimeout(l(Sn,this),20):kn(this);for(var a in Ts)Ts.hasOwnProperty(a)&&Ts[a](n,t[a],vs);jn(this),t.finishInit&&t.finishInit(this);for(var s=0;s400}var o=e.display;Ya(o.scroller,"mousedown",ui(e,yr)),na&&ia<11?Ya(o.scroller,"dblclick",ui(e,function(t){if(!Ne(e,t)){var n=Tn(e,t);if(n&&!Tr(e,t)&&!Ut(e.display,t)){je(t);var i=e.findWordAt(n);ro(e.doc,i.anchor,i.head)}}})):Ya(o.scroller,"dblclick",function(t){return Ne(e,t)||je(t)}),Ma||Ya(o.scroller,"contextmenu",function(t){return Cr(e,t)});var r,a={end:0};Ya(o.scroller,"touchstart",function(t){if(!Ne(e,t)&&!n(t)){o.input.ensurePolled(),clearTimeout(r);var i=+new Date;o.activeTouch={start:i,moved:!1,prev:i-a.end<=300?a:null},1==t.touches.length&&(o.activeTouch.left=t.touches[0].pageX,o.activeTouch.top=t.touches[0].pageY)}}),Ya(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),Ya(o.scroller,"touchend",function(n){var r=o.activeTouch;if(r&&!Ut(o,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(o.activeTouch,"page");a=!r.prev||i(r,r.prev)?new Ni(s,s):!r.prev.prev||i(r,r.prev.prev)?e.findWordAt(s):new Ni(k(s.line,0),U(e.doc,k(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),je(n)}t()}),Ya(o.scroller,"touchcancel",t),Ya(o.scroller,"scroll",function(){o.scroller.clientHeight&&(Un(e,o.scroller.scrollTop),Hn(e,o.scroller.scrollLeft,!0),_e(e,"scroll",e))}),Ya(o.scroller,"mousewheel",function(t){return Fn(e,t)}),Ya(o.scroller,"DOMMouseScroll",function(t){return Fn(e,t)}),Ya(o.wrapper,"scroll",function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(t){Ne(e,t)||Re(t)},over:function(t){Ne(e,t)||(Go(e,t),Re(t))},start:function(t){return Wo(e,t)},drop:ui(e,Vo),leave:function(t){Ne(e,t)||Jo(e)}};var s=o.input.getField();Ya(s,"keyup",function(t){return gr.call(e,t)}),Ya(s,"keydown",ui(e,fr)),Ya(s,"keypress",ui(e,mr)),Ya(s,"focus",function(t){return Sn(e,t)}),Ya(s,"blur",function(t){return kn(e,t)})}function kr(e,t,n,i){var o,r=e.doc;null==n&&(n="add"),"smart"==n&&(r.mode.indent?o=et(e,t):n="prev");var a=e.options.tabSize,s=x(r,t),l=u(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var d,c=s.text.match(/^\s*/)[0];if(i||/\S/.test(s.text)){if("smart"==n&&(d=r.mode.indent(o,s.text.slice(c.length),s.text),d==xa||d>150)){if(!i)return;n="prev"}}else d=0,n="not";"prev"==n?d=t>r.first?u(x(r,t-1).text,null,a):0:"add"==n?d=l+e.options.indentUnit:"subtract"==n?d=l-e.options.indentUnit:"number"==typeof n&&(d=l+n),d=Math.max(0,d);var h="",A=0;if(e.options.indentWithTabs)for(var p=Math.floor(d/a);p;--p)A+=a,h+="\t";if(A1)if(xs&&xs.text.join("\n")==t){if(i.ranges.length%xs.text.length==0){l=[];for(var d=0;d=0;c--){var h=i.ranges[c],A=h.from(),f=h.to();h.empty()&&(n&&n>0?A=k(A.line,A.ch-n):e.state.overwrite&&!a?f=k(f.line,Math.min(x(r,f.line).text.length,f.ch+p(s).length)):xs&&xs.lineWise&&xs.text.join("\n")==t&&(A=f=k(A.line,0))),u=e.curOp.updateInput;var m={from:A,to:f,text:l?l[c%l.length]:s,origin:o||(a?"paste":e.state.cutIncoming?"cut":"+input")};bo(e.doc,m),Ct(e,"inputRead",e,m)}t&&!a&&Yr(e,t),$n(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Qr(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||di(t,function(){return jr(t,n,0,null,"paste")}),!0}function Yr(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var o=n.ranges[i];if(!(o.head.ch>100||i&&n.ranges[i-1].head.line==o.head.line)){var r=e.getModeAt(o.head),a=!1;if(r.electricChars){for(var s=0;s-1){a=kr(e,o.head.line,"smart");break}}else r.electricInput&&r.electricInput.test(x(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=kr(e,o.head.line,"smart"));a&&Ct(e,"electricInput",e,o.head.line)}}}function Rr(e){for(var t=[],n=[],i=0;ii&&(kr(t,r.head.line,e,!0),i=r.head.line,o==t.doc.sel.primIndex&&$n(t));else{var a=r.from(),s=r.to(),l=Math.max(i,a.line);i=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var d=l;d0&&so(t.doc,o,new Ni(a,u[o].to()),Ea)}}}),getTokenAt:function(e,t){return ot(this,e,t)},getLineTokens:function(e,t){return ot(this,k(e),t,!0)},getTokenTypeAt:function(e){e=U(this.doc,e);var t,n=$e(this,x(this.doc,e.line)),i=0,o=(n.length-1)/2,r=e.ch;if(0==r)t=n[2];else for(;;){var a=i+o>>1;if((a?n[2*a-1]:0)>=r)o=a;else{if(!(n[2*a+1]r&&(e=r,o=!0),i=x(this.doc,e)}else i=e;return dn(this,i,{top:0,left:0},t||"page",n).top+(o?this.doc.height-fe(i):0)},defaultTextHeight:function(){return mn(this.display)},defaultCharWidth:function(){return yn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,o){var r=this.display;e=hn(this,U(this.doc,e));var a=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),r.sizer.appendChild(t),"over"==i)a=e.top;else if("above"==i||"near"==i){var l=Math.max(r.wrapper.clientHeight,this.doc.height),d=Math.max(r.sizer.clientWidth,r.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>d&&(s=d-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==o?(s=r.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?s=0:"middle"==o&&(s=(r.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&Zn(this,s,a,s+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:ci(fr),triggerOnKeyPress:ci(mr),triggerOnKeyUp:gr,execCommand:function(e){if(ys.hasOwnProperty(e))return ys[e].call(null,this)},triggerElectric:ci(function(e){Yr(this,e)}),findPosH:function(e,t,n,i){var o=this,r=1;t<0&&(r=-1,t=-t);for(var a=U(this.doc,e),s=0;s0&&s(n.charAt(i-1));)--i;for(;o.5)&&bn(this),_e(this,"refresh",this)}),swapDoc:ci(function(e){var t=this.doc;return t.cm=null,Pi(this,e),an(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ct(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Be(e),e.registerHelper=function(t,i,o){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][i]=o},e.registerGlobalHelper=function(t,i,o,r){e.registerHelper(t,i,r),n[t]._global.push({pred:o,val:r })}}function zr(e,t,n,i,o){function r(){var t=s+n;return!(t=e.first+e.size)&&(s=t,u=x(e,t))}function a(e){var t=(o?xe:Ee)(u,l,n,!0);if(null==t){if(e||!r())return!1;l=o?(n<0?ve:we)(u):n<0?u.text.length:0}else l=t;return!0}var s=t.line,l=t.ch,d=n,u=x(e,s);if("char"==i)a();else if("column"==i)a(!0);else if("word"==i||"group"==i)for(var c=null,h="group"==i,A=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||a(!f);f=!1){var p=u.text.charAt(l)||"\n",g=v(p,A)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||g||(g="s"),c&&c!=g){n<0&&(n=1,a());break}if(g&&(c=g),n>0&&!a(!f))break}var m=yo(e,k(s,l),t,d,!0);return B(t,m)||(m.hitSide=!0),m}function Fr(e,t,n,i){var o,r=e.doc,a=t.left;if("page"==i){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(s-.5*mn(e.display),3);o=(n>0?t.bottom:t.top)+n*l}else"line"==i&&(o=n>0?t.bottom+3:t.top-3);for(var d;d=pn(e,a,o),d.outside;){if(n<0?o<=0:o>=r.height){d.hitSide=!0;break}o+=5*n}return d}function Pr(e,t){var n=Zt(e,t.line);if(!n||n.hidden)return null;var i=x(e.doc,t.line),o=Gt(n,i,t.line),r=De(i),a="left";if(r){var s=Te(r,t.ch);a=s%2?"right":"left"}var l=$t(o.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Vr(e,t){return t&&(e.bad=!0),e}function Wr(e,t,n,i,o){function r(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return void(s+=""==n?t.textContent.replace(/\u200b/g,""):n);var u,c=t.getAttribute("cm-marker");if(c){var h=e.findMarks(k(i,0),k(o+1,0),r(+c));return void(h.length&&(u=h[0].find())&&(s+=E(e.doc,u.from,u.to).join(d)))}if("false"==t.getAttribute("contenteditable"))return;for(var A=0;A=15&&(sa=!1,oa=!0);var ma,ya=Aa&&(ra||sa&&(null==ga||ga<12.11)),Ma=$r||na&&ia>=9,wa=function(t,n){var i=t.className,o=e(n).exec(i);if(o){var r=i.slice(o.index+o[0].length);t.className=i.slice(0,o.index)+(r?o[1]+r:"")}};ma=document.createRange?function(e,t,n,i){var o=document.createRange();return o.setEnd(i||e,n),o.setStart(e,t),o}:function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};var va=function(e){e.select()};ca?va=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:na&&(va=function(e){try{e.select()}catch(e){}}),c.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var ba,Ta,Ca=30,xa={toString:function(){return"CodeMirror.Pass"}},Ea={scroll:!1},Da={origin:"*mouse"},Ia={origin:"+move"},La=[""],_a=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Na=/[\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]/,Sa=!1,ka=!1,Ba=null,ja=function(){function e(e){return e<=247?n.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?i.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",i="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/,d="L";return function(n){if(!o.test(n))return!1;for(var i=n.length,u=[],c=0;c=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.post},eatSpace:function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}var o=function(e){return n?e.toLowerCase():e},r=this.string.substr(this.pos,e.length);if(o(r)==o(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}},Be(lt),lt.prototype.lineNo=function(){return L(this)};var Ga,Ja={},Xa={},Za=null,Ka=null,qa={left:0,right:0,top:0,bottom:0},$a=0,es=null;na?es=-.53:$r?es=15:aa?es=-.7:la&&(es=-1/3);var ts=function(e,t,n){this.cm=n;var o=this.vert=i("div",[i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=i("div",[i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(o),e(r),Ya(o,"scroll",function(){o.clientHeight&&t(o.scrollTop,"vertical")}),Ya(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,na&&ia<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ts.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var o=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var r=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+r+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},ts.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},ts.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},ts.prototype.zeroWidthHack=function(){var e=Aa&&!da?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new c,this.disableVert=new c},ts.prototype.enableZeroWidthBar=function(e,t){function n(){var i=e.getBoundingClientRect(),o=document.elementFromPoint(i.left+1,i.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},ts.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ns=function(){};ns.prototype.update=function(){return{bottom:0,right:0}},ns.prototype.setScrollLeft=function(){},ns.prototype.setScrollTop=function(){},ns.prototype.clear=function(){};var is={native:ts,null:ns},os=0,rs=function(e,t,n){var i=e.display;this.viewport=t,this.visible=Rn(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Pt(e),this.force=n,this.dims=Mn(e),this.events=[]};rs.prototype.signal=function(e,t){ke(e,t)&&this.events.push(arguments)},rs.prototype.finish=function(){for(var e=this,t=0;t=0&&B(e,o.to())<=0)return i}return-1}},Ni.prototype={from:function(){return Y(this.anchor,this.head)},to:function(){return Q(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}},ko.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=this,i=e,o=e+t;i1||!(this.children[0]instanceof ko))){var l=[];this.collapse(l),this.children=[new ko(l)],this.children[0].parent=this}},collapse:function(e){for(var t=this,n=0;n50){for(var s=r.lines.length%25+25,l=s;l10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=this,o=0;ot.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=o&&t&&this.collapsed&&Ai(t,o,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&po(t.doc)),t&&Ct(t,"markerCleared",t,this),n&&ni(t),this.parent&&this.parent.clear()}},Ro.prototype.find=function(e,t){var n=this;null==e&&"bookmark"==this.type&&(e=1);for(var i,o,r=0;r=0;d--)bo(i,o[d]);l?co(this,l):this.cm&&$n(this.cm)}),undo:hi(function(){Co(this,"undo")}),redo:hi(function(){Co(this,"redo")}),undoSelection:hi(function(){Co(this,"undo",!0)}),redoSelection:hi(function(){Co(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,i=0;i=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=U(this,e),t=U(this,t);var i=[],o=e.line;return this.iter(e.line,t.line+1,function(r){var a=r.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&o!=e.line||null!=l.from&&o==t.line&&l.from>=t.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++o}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var i=0;ie?(t=e,!0):(e-=r,void++n)}),U(this,k(n,t))},indexFromPos:function(e){e=U(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to0)o=new k(o.line,o.ch+1),e.replaceRange(r.charAt(o.ch-1)+r.charAt(o.ch-2),k(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=x(e.doc,o.line-1).text;a&&(o=new k(o.line,1),e.replaceRange(r.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),k(o.line-1,a.length-1),o,"+transpose"))}n.push(new Ni(o,o))}e.setSelections(n)})},newlineAndIndent:function(e){return di(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 i=0;ie.firstLine()&&(i=k(i.line-1,x(e.doc,i.line-1).length)),o.ch==x(e.doc,o.line).text.length&&o.linet.viewTo-1)return!1;var r,a,s;i.line==t.viewFrom||0==(r=Cn(e,i.line))?(a=L(t.view[0].line),s=t.view[0].node):(a=L(t.view[r].line),s=t.view[r-1].node.nextSibling);var l,d,u=Cn(e,o.line);if(u==t.view.length-1?(l=t.viewTo-1,d=t.lineDiv.lastChild):(l=L(t.view[u+1].line)-1,d=t.view[u+1].node.previousSibling),!s)return!1;for(var c=e.doc.splitLines(Wr(e,s,d,a,l)),h=E(e.doc,k(a,0),k(l,x(e.doc,l).text.length));c.length>1&&h.length>1;)if(p(c)==p(h))c.pop(),h.pop(),l--;else{if(c[0]!=h[0])break;c.shift(),h.shift(),a++}for(var A=0,f=0,g=c[0],m=h[0],y=Math.min(g.length,m.length);A1||c[0]||B(b,T)?(Io(e.doc,c,b,T,"+input"),!0):void 0},Es.prototype.ensurePolled=function(){this.forceCompositionEnd()},Es.prototype.reset=function(){this.forceCompositionEnd()},Es.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.pollContent()||Ai(this.cm),this.div.blur(),this.div.focus())},Es.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.cm.isReadOnly()&&e.pollContent()||di(e.cm,function(){return Ai(e.cm)})},80))},Es.prototype.setUneditable=function(e){e.contentEditable="false"},Es.prototype.onKeyPress=function(e){e.preventDefault(),this.cm.isReadOnly()||ui(this.cm,jr)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},Es.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Es.prototype.onContextMenu=function(){},Es.prototype.resetPosition=function(){},Es.prototype.needsContentAttribute=!0;var Ds=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new c,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};Ds.prototype.init=function(e){function t(e){if(!Ne(o,e)){if(o.somethingSelected())Br({lineWise:!1,text:o.getSelections()}),i.inaccurateSelection&&(i.prevInput="",i.inaccurateSelection=!1,a.value=xs.text.join("\n"),va(a));else{if(!o.options.lineWiseCopyCut)return;var t=Rr(o);Br({lineWise:!0,text:t.text}),"cut"==e.type?o.setSelections(t.ranges,null,Ea):(i.prevInput="",a.value=t.text.join("\n"),va(a))}"cut"==e.type&&(o.state.cutIncoming=!0)}}var n=this,i=this,o=this.cm,r=this.wrapper=Hr(),a=this.textarea=r.firstChild;e.wrapper.insertBefore(r,e.wrapper.firstChild),ca&&(a.style.width="0px"),Ya(a,"input",function(){na&&ia>=9&&n.hasSelection&&(n.hasSelection=null),i.poll()}),Ya(a,"paste",function(e){Ne(o,e)||Qr(e,o)||(o.state.pasteIncoming=!0,i.fastPoll())}),Ya(a,"cut",t),Ya(a,"copy",t),Ya(e.scroller,"paste",function(t){Ut(e,t)||Ne(o,t)||(o.state.pasteIncoming=!0,i.focus())}),Ya(e.lineSpace,"selectstart",function(t){Ut(e,t)||je(t)}),Ya(a,"compositionstart",function(){var e=o.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:e,range:o.markText(e,o.getCursor("to"),{className:"CodeMirror-composing"})}}),Ya(a,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Ds.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=En(e);if(e.options.moveInputWithCursor){var o=hn(e,n.sel.primary().head,"div"),r=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-r.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-r.left))}return i},Ds.prototype.showSelection=function(e){var t=this.cm,i=t.display;n(i.cursorDiv,e.cursors),n(i.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ds.prototype.reset=function(e){if(!this.contextMenuPending){var t,n,i=this.cm,o=i.doc;if(i.somethingSelected()){this.prevInput="";var r=o.sel.primary();t=Oa&&(r.to().line-r.from().line>100||(n=i.getSelection()).length>1e3);var a=t?"-":n||i.getSelection();this.textarea.value=a,i.state.focused&&va(this.textarea),na&&ia>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",na&&ia>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},Ds.prototype.getField=function(){return this.textarea},Ds.prototype.supportsTouch=function(){return!1},Ds.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!ha||r()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ds.prototype.blur=function(){this.textarea.blur()},Ds.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ds.prototype.receivedFocus=function(){this.slowPoll()},Ds.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ds.prototype.fastPoll=function(){function e(){var i=n.poll();i||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},Ds.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ha(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==i&&!t.somethingSelected())return!1;if(na&&ia>=9&&this.hasSelection===o||Aa&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var r=o.charCodeAt(0);if(8203!=r||i||(i="​"),8666==r)return this.reset(),this.cm.execCommand("undo")}for(var a=0,s=Math.min(i.length,o.length);a1e3||o.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ds.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ds.prototype.onKeyPress=function(){na&&ia>=9&&(this.hasSelection=null),this.fastPoll()},Ds.prototype.onContextMenu=function(e){function t(){if(null!=a.selectionStart){var e=o.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,i.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,r.selForContextMenu=o.doc.sel}}function n(){if(i.contextMenuPending=!1,i.wrapper.style.cssText=c,a.style.cssText=u,na&&ia<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),null!=a.selectionStart){(!na||na&&ia<9)&&t();var e=0,n=function(){r.selForContextMenu==o.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==i.prevInput?ui(o,wo)(o):e++<10?r.detectingSelectAll=setTimeout(n,500):r.input.reset()};r.detectingSelectAll=setTimeout(n,200)}}var i=this,o=i.cm,r=o.display,a=i.textarea,s=Tn(o,e),l=r.scroller.scrollTop;if(s&&!sa){var d=o.options.resetSelectionOnContextMenu;d&&o.doc.sel.contains(s)==-1&&ui(o,ho)(o.doc,ki(s),Ea);var u=a.style.cssText,c=i.wrapper.style.cssText;i.wrapper.style.cssText="position: absolute";var h=i.wrapper.getBoundingClientRect();a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(na?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var A;if(oa&&(A=window.scrollY),r.input.focus(),oa&&window.scrollTo(null,A),r.input.reset(),o.somethingSelected()||(a.value=i.prevInput=" "),i.contextMenuPending=!0,r.selForContextMenu=o.doc.sel,clearTimeout(r.detectingSelectAll),na&&ia>=9&&t(),Ma){Re(e);var f=function(){Le(window,"mouseup",f),setTimeout(n,20)};Ya(window,"mouseup",f)}else setTimeout(n,50)}},Ds.prototype.readOnlyChanged=function(e){e||this.reset()},Ds.prototype.setUneditable=function(){},Ds.prototype.needsContentAttribute=!1,Dr(Nr),Or(Nr);var Is="iter insert remove copy getEditor constructor".split(" ");for(var Ls in ls.prototype)ls.prototype.hasOwnProperty(Ls)&&h(Is,Ls)<0&&(Nr.prototype[Ls]=function(e){return function(){return e.apply(this.doc,arguments)}}(ls.prototype[Ls]));return Be(ls),Nr.inputStyles={textarea:Ds,contenteditable:Es},Nr.defineMode=function(e){Nr.defaults.mode||"null"==e||(Nr.defaults.mode=e),Pe.apply(this,arguments)},Nr.defineMIME=Ve,Nr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Nr.defineMIME("text/plain","null"),Nr.defineExtension=function(e,t){Nr.prototype[e]=t},Nr.defineDocExtension=function(e,t){ls.prototype[e]=t},Nr.fromTextArea=Xr,Zr(Nr),Nr.version="5.23.0",Nr})},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n");this.container.append(r);var a=new ce.default;new d.default(r.get(0),function(){i.context=new s.default(this),i.context.fileInfo=a,i.buildTools(i.context),i.datasourcePanel=new oe.default(i.context),i.propertyPanel=new ae.default(i.context),i.buildPropertyPanel(),this.bindSelectionEvent(function(e,t,n,o){i.propertyPanel.refresh(e,t,n,o);var r=!0,a=!1,s=void 0;try{for(var l,d=i.tools[Symbol.iterator]();!(r=(l=d.next()).done);r=!0){var u=l.value;u.refresh&&u.refresh(e,t,n,o)}}catch(e){a=!0,s=e}finally{try{!r&&d.return&&d.return()}finally{if(a)throw s}}}),i.printLine=new de.default(i.context);var e=i.context.reportDef.rows,t=!0,n=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(t=(r=l.next()).done);t=!0){var d=r.value,u=d.band;u&&i.context.addRowHeader(d.rowNumber-1,u)}}catch(e){n=!0,o=e}finally{try{!t&&l.return&&l.return()}finally{if(n)throw o}}(0,he.renderRowHeader)(i.context.hot,i.context)})}return r(e,[{key:"buildPropertyPanel",value:function(){var e="_prop_container",t="_datasource_container",n=$('
');this.container.prepend(n);var i=$('"),o=$('\n \n \n ');i.append(o),n.append(i),i.mousedown(function(e){e.preventDefault()});var r=$('
'),a=$('
'),s=$('
');r.append(a),r.append(s),a.append(this.propertyPanel.buildPanel()),s.append(this.datasourcePanel.buildPanel()),n.append(r),n.draggable(),o.click(function(){r.toggle();var e=r.css("display");e&&"none"!==e?(o.removeClass("glyphicon-circle-arrow-left"),o.addClass("glyphicon-circle-arrow-down")):(o.removeClass("glyphicon-circle-arrow-down"),o.addClass("glyphicon-circle-arrow-left"))})}},{key:"buildTools",value:function(e){var t=$('
');this.container.prepend(t),this.tools=[],this.tools.push(new V.default(e)),this.tools.push(new c.default(e)),this.tools.push(new A.default(e)),this.tools.push(new F.default(e)),this.tools.push(new M.default(e)),this.tools.push(new v.default(e)),this.tools.push(new O.default(e)),this.tools.push(new p.default(e)),this.tools.push(new m.default(e)),this.tools.push(new T.default(e)),this.tools.push(new G.default(e)),this.tools.push(new X.default(e)),this.tools.push(new x.default(e)),this.tools.push(new D.default(e)),this.tools.push(new L.default(e)),this.tools.push(new N.default(e)),this.tools.push(new k.default(e)),this.tools.push(new U.default(e)),this.tools.push(new j.default(e)),this.tools.push(new K.default(e)),this.tools.push(new Y.default(e)),this.tools.push(new ee.default(e)),this.tools.push(new ne.default(e));var n=!0,i=!1,o=void 0;try{for(var r,a=this.tools[Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var s=r.value;t.append(s.buildButton())}}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}}}]),e}();t.default=Ae},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n=e&&(a.rowNumber+=1)}}catch(e){n=!0,i=e}finally{try{!t&&r.return&&r.return()}finally{if(n)throw i}}}},{key:"adjustDelRowHeaders",value:function(e){var t=null,n=!0,i=!1,o=void 0;try{for(var r,a=this.rowHeaders[Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var s=r.value;s.rowNumber>e?s.rowNumber-=1:s.rowNumber===e&&(t=s)}}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}if(t){var l=this.rowHeaders.indexOf(t);this.rowHeaders.splice(l,1)}}},{key:"addRowHeader",value:function(e,t){var n=null,i=!0,o=!1,r=void 0;try{for(var a,s=this.rowHeaders[Symbol.iterator]();!(i=(a=s.next()).done);i=!0){var l=a.value;if(l.rowNumber===e){n=l;break}}}catch(e){o=!0,r=e}finally{try{!i&&s.return&&s.return()}finally{if(o)throw r}}if(n)n.band=t;else{var d={band:t,rowNumber:e};this.rowHeaders.push(d)}}},{key:"getCellName",value:function(e,t){return null!=e?this.LETTERS[t]+(e+1):this.LETTERS[t]}},{key:"getCell",value:function(e,t){var n=e+1+","+(t+1);return this.cellsMap.get(n)}},{key:"addCell",value:function(e){var t=e.rowNumber+","+e.columnNumber;this.cellsMap.set(t,e)}},{key:"removeCell",value:function(e){var t=e.rowNumber+","+e.columnNumber;this.cellsMap.delete(t)}},{key:"deleteCell",value:function(e,t){var n=e+","+t;this.cellsMap.delete(n)}},{key:"getSelectedCells",value:function(){var e=this.hot.getSelected();if(!e)return null;for(var t=e[0],n=e[1],i=e[2],o=e[3],r=[],a=t;a<=i;a++)for(var s=n;s<=o;s++){var l=this.hot.getCell(a,s,!0),d=r.indexOf(l);d===-1&&r.push(l)}return r}}]),e}());t.default=r},function(e,t){"use strict";function n(e){var t=a("消息提示",e);t.modal("show")}function i(e,t){var n=a("确认提示",e,[{name:"确认",click:function(){t.call(this)}}]);n.modal("show")}function o(e,t,n){var i=a(e,t,[{name:"确认",click:function(){n.call(this)}}]);i.modal("show")}function r(e,t,n,i,o){var r=a(e,t,n,o);if(r.modal("show"),i){var s=!0,l=!1,d=void 0;try{for(var u,c=i[Symbol.iterator]();!(s=(u=c.next()).done);s=!0){var h=u.value;r.on(h.name,h.callback)}}catch(e){l=!0,d=e}finally{try{!s&&c.return&&c.return()}finally{if(l)throw d}}}}function a(e,t,n,i){var o=this,r="modal-dialog"+(i?" modal-lg":""),a=$(''),l=$('
');a.append(l);var d=$('");this.container.append(r);var a=new ce.default;new d.default(r.get(0),function(){i.context=new s.default(this),i.context.fileInfo=a,i.buildTools(i.context),i.datasourcePanel=new oe.default(i.context),i.propertyPanel=new ae.default(i.context),i.buildPropertyPanel(),this.bindSelectionEvent(function(e,t,n,o){i.propertyPanel.refresh(e,t,n,o);var r=!0,a=!1,s=void 0;try{for(var l,d=i.tools[Symbol.iterator]();!(r=(l=d.next()).done);r=!0){var u=l.value;u.refresh&&u.refresh(e,t,n,o)}}catch(e){a=!0,s=e}finally{try{!r&&d.return&&d.return()}finally{if(a)throw s}}}),i.printLine=new de.default(i.context);var e=i.context.reportDef.rows,t=!0,n=!1,o=void 0;try{for(var r,l=e[Symbol.iterator]();!(t=(r=l.next()).done);t=!0){var d=r.value,u=d.band;u&&i.context.addRowHeader(d.rowNumber-1,u)}}catch(e){n=!0,o=e}finally{try{!t&&l.return&&l.return()}finally{if(n)throw o}}(0,he.renderRowHeader)(i.context.hot,i.context)})}return r(e,[{key:"buildPropertyPanel",value:function(){var e="_prop_container",t="_datasource_container",n=$('
');this.container.prepend(n);var i=$('"),o=$('\n \n \n ');i.append(o),n.append(i),i.mousedown(function(e){e.preventDefault()});var r=$('
'),a=$('
'),s=$('
');r.append(a),r.append(s),a.append(this.propertyPanel.buildPanel()),s.append(this.datasourcePanel.buildPanel()),n.append(r),n.draggable(),o.click(function(){r.toggle();var e=r.css("display");e&&"none"!==e?(o.removeClass("glyphicon-circle-arrow-left"),o.addClass("glyphicon-circle-arrow-down")):(o.removeClass("glyphicon-circle-arrow-down"),o.addClass("glyphicon-circle-arrow-left"))})}},{key:"buildTools",value:function(e){var t=$('
');this.container.prepend(t),this.tools=[],this.tools.push(new V.default(e)),this.tools.push(new c.default(e)),this.tools.push(new A.default(e)),this.tools.push(new F.default(e)),this.tools.push(new M.default(e)),this.tools.push(new v.default(e)),this.tools.push(new O.default(e)),this.tools.push(new p.default(e)),this.tools.push(new m.default(e)),this.tools.push(new T.default(e)),this.tools.push(new G.default(e)),this.tools.push(new X.default(e)),this.tools.push(new x.default(e)),this.tools.push(new D.default(e)),this.tools.push(new L.default(e)),this.tools.push(new N.default(e)),this.tools.push(new k.default(e)),this.tools.push(new U.default(e)),this.tools.push(new j.default(e)),this.tools.push(new K.default(e)),this.tools.push(new Y.default(e)),this.tools.push(new ee.default(e)),this.tools.push(new ne.default(e));var n=!0,i=!1,o=void 0;try{for(var r,a=this.tools[Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var s=r.value;t.append(s.buildButton())}}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}}}]),e}();t.default=Ae},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n=e&&(a.rowNumber+=1)}}catch(e){n=!0,i=e}finally{try{!t&&r.return&&r.return()}finally{if(n)throw i}}}},{key:"adjustDelRowHeaders",value:function(e){var t=null,n=!0,i=!1,o=void 0;try{for(var r,a=this.rowHeaders[Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var s=r.value;s.rowNumber>e?s.rowNumber-=1:s.rowNumber===e&&(t=s)}}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}if(t){var l=this.rowHeaders.indexOf(t);this.rowHeaders.splice(l,1)}}},{key:"addRowHeader",value:function(e,t){var n=null,i=!0,o=!1,r=void 0;try{for(var a,s=this.rowHeaders[Symbol.iterator]();!(i=(a=s.next()).done);i=!0){var l=a.value;if(l.rowNumber===e){n=l;break}}}catch(e){o=!0,r=e}finally{try{!i&&s.return&&s.return()}finally{if(o)throw r}}if(n)n.band=t;else{var d={band:t,rowNumber:e};this.rowHeaders.push(d)}}},{key:"getCellName",value:function(e,t){return null!=e?this.LETTERS[t]+(e+1):this.LETTERS[t]}},{key:"getCell",value:function(e,t){var n=e+1+","+(t+1);return this.cellsMap.get(n)}},{key:"addCell",value:function(e){var t=e.rowNumber+","+e.columnNumber;this.cellsMap.set(t,e)}},{key:"removeCell",value:function(e){var t=e.rowNumber+","+e.columnNumber;this.cellsMap.delete(t)}},{key:"deleteCell",value:function(e,t){var n=e+","+t;this.cellsMap.delete(n)}},{key:"getSelectedCells",value:function(){var e=this.hot.getSelected();if(!e)return null;for(var t=e[0],n=e[1],i=e[2],o=e[3],r=[],a=t;a<=i;a++)for(var s=n;s<=o;s++){var l=this.hot.getCell(a,s,!0),d=r.indexOf(l);d===-1&&r.push(l)}return r}}]),e}());t.default=r},function(e,t){"use strict";function n(e){var t=a("消息提示",e);t.modal("show")}function i(e,t){var n=a("确认提示",e,[{name:"确认",click:function(){t.call(this)}}]);n.modal("show")}function o(e,t,n){var i=a(e,t,[{name:"确认",click:function(){n.call(this)}}]);i.modal("show")}function r(e,t,n,i,o){var r=a(e,t,n,o);if(r.modal("show"),i){var s=!0,l=!1,d=void 0;try{for(var u,c=i[Symbol.iterator]();!(s=(u=c.next()).done);s=!0){var h=u.value;r.on(h.name,h.callback)}}catch(e){l=!0,d=e}finally{try{!s&&c.return&&c.return()}finally{if(l)throw d}}}}function a(e,t,n,i){var o=this,r="modal-dialog"+(i?" modal-lg":""),a=$(''),l=$('
');a.append(l);var d=$('";if(this.el.innerHTML=s,t.bound&&"hidden"!==t.field.type&&o(function(){t.trigger.focus()},1),"function"==typeof this._o.onDraw){var d=this;o(function(){d._o.onDraw.call(d)},0)}}},adjustPosition:function(){var e,t,n,o,r,a,s,l,d,u;if(!this._o.container){if(this.el.style.position="absolute",e=this._o.trigger,t=e,n=this.el.offsetWidth,o=this.el.offsetHeight,r=window.innerWidth||i.documentElement.clientWidth,a=window.innerHeight||i.documentElement.clientHeight,s=window.pageYOffset||i.body.scrollTop||i.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)u=e.getBoundingClientRect(),l=u.left+window.pageXOffset,d=u.bottom+window.pageYOffset;else for(l=t.offsetLeft,d=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,d+=t.offsetTop;(this._o.reposition&&l+n>r||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&d+o>a+s||this._o.position.indexOf("top")>-1&&d-o-e.offsetHeight>0)&&(d=d-o-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=d+"px"}},render:function(e,t){var n=this._o,i=new Date,o=g(e,t),r=new Date(e,t,1).getDay(),a=[],s=[];m(i),n.firstDay>0&&(r-=n.firstDay,r<0&&(r+=7));for(var l=o+r,d=l;d>7;)d-=7;l+=7-d;for(var u=0,c=0;u=o+r,v=n.startRange&&y(n.startRange,h),b=n.endRange&&y(n.endRange,h),E=n.startRange&&n.endRange&&n.startRangen.maxDate||n.disableWeekends&&f(h)||n.disableDayFn&&n.disableDayFn(h),I={day:1+(u-r),month:t,year:e,isSelected:p,isToday:M,isDisabled:D,isEmpty:w,isStartRange:v,isEndRange:b,isInRange:E};s.push(T(I)),7===++c&&(n.showWeekNumber&&s.unshift(C(u-r,t,e)),a.push(x(s,n.isRTL)),s=[],c=0)}return L(n,a)},isVisible:function(){return this._v},show:function(){this._v||(c(this.el,"is-hidden"),this._v=!0,this.draw(),this._o.bound&&(r(i,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e=this._v;e!==!1&&(this._o.bound&&a(i,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",u(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),a(this.el,"mousedown",this._onMouseDown,!0),a(this.el,"touchend",this._onMouseDown,!0),a(this.el,"change",this._onChange),this._o.field&&(a(this._o.field,"change",this._onInputChange),this._o.bound&&(a(this._o.trigger,"click",this._onInputClick),a(this._o.trigger,"focus",this._onInputFocus),a(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},_})},function(e,t,n){var i;!function(o,r){"use strict";var a,s,l,d=o,u=d.document,c=d.navigator,h=d.setTimeout,A=d.clearTimeout,f=d.setInterval,p=d.clearInterval,g=d.getComputedStyle,m=d.encodeURIComponent,y=d.ActiveXObject,M=d.Error,w=d.Number.parseInt||d.parseInt,v=d.Number.parseFloat||d.parseFloat,b=d.Number.isNaN||d.isNaN,T=d.Date.now,C=d.Object.keys,x=d.Object.prototype.hasOwnProperty,E=d.Array.prototype.slice,D=function(){var e=function(e){return e};if("function"==typeof d.wrap&&"function"==typeof d.unwrap)try{var t=u.createElement("div"),n=d.unwrap(t);1===t.nodeType&&n&&1===n.nodeType&&(e=d.unwrap)}catch(e){}return e}(),I=function(e){return E.call(e,0)},L=function(){var e,t,n,i,o,a,s=I(arguments),l=s[0]||{};for(e=1,t=s.length;e=0&&(X=h(function(){"boolean"!=typeof P.deactivated&&(P.deactivated=!0),P.deactivated===!0&&nt.emit({type:"error",name:"flash-deactivated"})},e)),P.overdue=!1,je())))):(P.ready=!1,void nt.emit({type:"error",name:"browser-unsupported"}))},Ae=function(){nt.clearData(),nt.blur(),nt.emit("destroy"),Qe(),nt.off()},fe=function(e,t){var n;if("object"==typeof e&&e&&"undefined"==typeof t)n=e,nt.clearData();else{if("string"!=typeof e||!e)return;n={},n[e]=t}for(var i in n)"string"==typeof i&&i&&x.call(n,i)&&"string"==typeof n[i]&&n[i]&&(G[i]=$e(n[i]))},pe=function(e){"undefined"==typeof e?(k(G),J=null):"string"==typeof e&&x.call(G,e)&&delete G[e]},ge=function(e){return"undefined"==typeof e?_(G):"string"==typeof e&&x.call(G,e)?G[e]:void 0},me=function(e){if(e&&1===e.nodeType){s&&(Ve(s,ne.activeClass),s!==e&&Ve(s,ne.hoverClass)),s=e,Pe(e,ne.hoverClass);var t=e.getAttribute("title")||ne.title;if("string"==typeof t&&t){var n=ke(P.bridge);n&&n.setAttribute("title",t)}var i=ne.forceHandCursor===!0||"pointer"===We(e,"cursor");Ke(i),Ze()}},ye=function(){var e=ke(P.bridge);e&&(e.removeAttribute("title"),e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px"),s&&(Ve(s,ne.hoverClass),Ve(s,ne.activeClass),s=null)},Me=function(){return s||null},we=function(e){return"string"==typeof e&&e&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(e)},ve=function(e){var t;if("string"==typeof e&&e?(t=e,e={}):"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(t=e.type),t){t=t.toLowerCase(),!e.target&&(/^(copy|aftercopy|_click)$/.test(t)||"error"===t&&"clipboard-error"===e.name)&&(e.target=l),L(e,{type:t,target:e.target||s||null,relatedTarget:e.relatedTarget||null,currentTarget:P&&P.bridge||null,timeStamp:e.timeStamp||T()||null});var n=K[e.type];return"error"===e.type&&e.name&&n&&(n=n[e.name]),n&&(e.message=n),"ready"===e.type&&L(e,{target:null,version:P.version}),"error"===e.type&&(ee.test(e.name)&&L(e,{target:null,minimumVersion:V}),te.test(e.name)&&L(e,{version:P.version}),"flash-insecure"===e.name&&L(e,{pageProtocol:d.location.protocol,swfProtocol:ce()})),"copy"===e.type&&(e.clipboardData={setData:nt.setData,clearData:nt.clearData}),"aftercopy"===e.type&&(e=Re(e,J)),e.target&&!e.relatedTarget&&(e.relatedTarget=be(e.target)),Te(e)}},be=function(e){var t=e&&e.getAttribute&&e.getAttribute("data-clipboard-target");return t?u.getElementById(t):null},Te=function(e){if(e&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)){var t=e.target,n="_mouseover"===e.type&&e.relatedTarget?e.relatedTarget:r,i="_mouseout"===e.type&&e.relatedTarget?e.relatedTarget:r,o=Ge(t),a=d.screenLeft||d.screenX||0,s=d.screenTop||d.screenY||0,l=u.body.scrollLeft+u.documentElement.scrollLeft,c=u.body.scrollTop+u.documentElement.scrollTop,h=o.left+("number"==typeof e._stageX?e._stageX:0),A=o.top+("number"==typeof e._stageY?e._stageY:0),f=h-l,p=A-c,g=a+f,m=s+p,y="number"==typeof e.movementX?e.movementX:0,M="number"==typeof e.movementY?e.movementY:0;delete e._stageX,delete e._stageY,L(e,{srcElement:t,fromElement:n,toElement:i,screenX:g,screenY:m,pageX:h,pageY:A,clientX:f,clientY:p,x:f,y:p,movementX:y,movementY:M,offsetX:0,offsetY:0,layerX:0,layerY:0})}return e},Ce=function(e){var t=e&&"string"==typeof e.type&&e.type||"";return!/^(?:(?:before)?copy|destroy)$/.test(t)},xe=function(e,t,n,i){i?h(function(){e.apply(t,n)},0):e.apply(t,n)},Ee=function(e){if("object"==typeof e&&e&&e.type){var t=Ce(e),n=W["*"]||[],i=W[e.type]||[],o=n.concat(i);if(o&&o.length){var r,a,s,l,u,c=this;for(r=0,a=o.length;r0){var t=_(e);L(t,{type:"error",name:"clipboard-error"}),delete t.success,h(function(){nt.emit(t)},0)}},_e=function(e){if(e&&"string"==typeof e.type&&e){var t,n=e.target||null,i=n&&n.ownerDocument||u,o={view:i.defaultView||d,canBubble:!0,cancelable:!0,detail:"click"===e.type?1:0,button:"number"==typeof e.which?e.which-1:"number"==typeof e.button?e.button:i.createEvent?0:1},r=L(o,e);n&&i.createEvent&&n.dispatchEvent&&(r=[r.type,r.canBubble,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget],t=i.createEvent("MouseEvents"),t.initMouseEvent&&(t.initMouseEvent.apply(t,r),t._source="js",n.dispatchEvent(t)))}},Ne=function(){var e=ne.flashLoadTimeout;if("number"==typeof e&&e>=0){var t=Math.min(1e3,e/10),n=ne.swfObjectId+"_fallbackContent";Z=f(function(){var e=u.getElementById(n);Je(e)&&(Xe(),P.deactivated=null,nt.emit({type:"error",name:"swf-not-found"}))},t)}},Se=function(){var e=u.createElement("div");return e.id=ne.containerId,e.className=ne.containerClass,e.style.position="absolute",e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px",e.style.zIndex=""+qe(ne.zIndex),e},ke=function(e){for(var t=e&&e.parentNode;t&&"OBJECT"===t.nodeName&&t.parentNode;)t=t.parentNode;return t||null},Be=function(e){return"string"==typeof e&&e?e.replace(/["&'<>]/g,function(e){switch(e){case'"':return""";case"&":return"&";case"'":return"'";case"<":return"<";case">":return">";default:return e}}):e},je=function(){var e,t=P.bridge,n=ke(t);if(!t){var i=ze(d.location.host,ne),o="never"===i?"none":"all",r=He(L({jsVersion:nt.version},ne)),a=ne.swfPath+Ue(ne.swfPath,ne);F&&(a=Be(a)),n=Se();var s=u.createElement("div");n.appendChild(s),u.body.appendChild(n);var l=u.createElement("div"),c="activex"===P.pluginType;l.innerHTML='"+(c?'':"")+'
 
',t=l.firstChild,l=null,D(t).ZeroClipboard=nt,n.replaceChild(t,s),Ne()}return t||(t=u[ne.swfObjectId],t&&(e=t.length)&&(t=t[e-1]),!t&&n&&(t=n.firstChild)),P.bridge=t||null,t},Qe=function(){var e=P.bridge;if(e){var t=ke(e);t&&("activex"===P.pluginType&&"readyState"in e?(e.style.display="none",function n(){if(4===e.readyState){for(var i in e)"function"==typeof e[i]&&(e[i]=null);e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t)}else h(n,10)}()):(e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t))),Xe(),P.ready=null,P.bridge=null,P.deactivated=null,P.insecure=null,a=r}},Ye=function(e){var t={},n={};if("object"==typeof e&&e){for(var i in e)if(i&&x.call(e,i)&&"string"==typeof e[i]&&e[i])switch(i.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":t.text=e[i],n.text=i;break;case"text/html":case"html":case"air:html":case"flash:html":t.html=e[i],n.html=i;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":t.rtf=e[i],n.rtf=i}return{data:t,formatMap:n}}},Re=function(e,t){if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;var n={};for(var i in e)if(x.call(e,i))if("errors"===i){n[i]=e[i]?e[i].slice():[];for(var o=0,r=n[i].length;o0){if(1===r&&"*"===o[0])return"always";if(o.indexOf(t)!==-1)return 1===r&&t===i?"sameDomain":"always"}return"never"}}(),Fe=function(){try{return u.activeElement}catch(e){return null}},Pe=function(e,t){var n,i,o,r=[];if("string"==typeof t&&t&&(r=t.split(/\s+/)),e&&1===e.nodeType&&r.length>0){for(o=(" "+(e.className||"")+" ").replace(/[\t\r\n\f]/g," "),n=0,i=r.length;n0&&e.className){for(o=(" "+e.className+" ").replace(/[\t\r\n\f]/g," "),n=0,i=r.length;n0,i=v(t.width)>0,o=v(t.top)>=0,r=v(t.left)>=0,a=n&&i&&o&&r,s=a?null:Ge(e),l="none"!==t.display&&"collapse"!==t.visibility&&(a||!!s&&(n||s.height>0)&&(i||s.width>0)&&(o||s.top>=0)&&(r||s.left>=0));return l},Xe=function(){A(X),X=0,p(Z),Z=0},Ze=function(){var e;if(s&&(e=ke(P.bridge))){var t=Ge(s);L(e.style,{width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:""+qe(ne.zIndex)})}},Ke=function(e){P.ready===!0&&(P.bridge&&"function"==typeof P.bridge.setHandCursor?P.bridge.setHandCursor(e):P.ready=!1)},qe=function(e){if(/^(?:auto|inherit)$/.test(e))return e;var t;return"number"!=typeof e||b(e)?"string"==typeof e&&(t=qe(w(e,10))):t=e,"number"==typeof t?t:"auto"},$e=function(e){var t=/(\r\n|\r|\n)/g;return"string"==typeof e&&ne.fixLineEndings===!0&&(O()?/((^|[^\r])\n|\r([^\n]|$))/.test(e)&&(e=e.replace(t,"\r\n")):/\r/.test(e)&&(e=e.replace(t,"\n"))),e},et=function(e){var t,n,i,r=P.sandboxed,a=null;if(e=e===!0,z===!1)a=!1;else{try{n=o.frameElement||null}catch(e){i={name:e.name,message:e.message}}if(n&&1===n.nodeType&&"IFRAME"===n.nodeName)try{a=n.hasAttribute("sandbox")}catch(e){a=null}else{try{t=document.domain||null}catch(e){t=null}(null===t||i&&"SecurityError"===i.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(i.message.toLowerCase()))&&(a=!0)}}return P.sandboxed=a,r===a||e||tt(y),a},tt=function(e){function t(e){var t=e.match(/[\d]+/g);return t.length=3,t.join(".")}function n(e){return!!e&&(e=e.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(e)||"chrome.plugin"===e.slice(-13))}function i(e){e&&(s=!0,e.version&&(u=t(e.version)),!u&&e.description&&(u=t(e.description)),e.filename&&(d=n(e.filename)))}var o,r,a,s=!1,l=!1,d=!1,u="";if(c.plugins&&c.plugins.length)o=c.plugins["Shockwave Flash"],i(o),c.plugins["Shockwave Flash 2.0"]&&(s=!0,u="2.0.0.11");else if(c.mimeTypes&&c.mimeTypes.length)a=c.mimeTypes["application/x-shockwave-flash"],o=a&&a.enabledPlugin,i(o);else if("undefined"!=typeof e){l=!0;try{r=new e("ShockwaveFlash.ShockwaveFlash.7"),s=!0,u=t(r.GetVariable("$version"))}catch(n){try{r=new e("ShockwaveFlash.ShockwaveFlash.6"),s=!0,u="6.0.21"}catch(n){try{r=new e("ShockwaveFlash.ShockwaveFlash"),s=!0,u=t(r.GetVariable("$version"))}catch(e){l=!1}}}}P.disabled=s!==!0,P.outdated=u&&v(u)0,o=!e.target||i&&n.indexOf(e.target)!==-1,r=e.relatedTarget&&i&&n.indexOf(e.relatedTarget)!==-1,a=e.client&&e.client===this;return!(!t||!(o||r||a))},yt=function(e){var t=ot[this.id];if("object"==typeof e&&e&&e.type&&t){var n=Ce(e),i=t&&t.handlers["*"]||[],o=t&&t.handlers[e.type]||[],r=i.concat(o);if(r&&r.length){var a,s,l,u,c,h=this;for(a=0,s=r.length;a
'),t=$(''),n=$(''),i=$('
  • \n \n '+window.i18n.tools.save.save+"\n \n
  • ");n.append(i);var o=new c.default,r=this;i.click(function(){var e=(0,A.tableToXml)(r.context);window._reportFile?$.ajax({url:window._server+"/designer/saveReportFile",data:{content:e,file:window._reportFile},type:"POST",success:function(){(0,h.alert)(""+window.i18n.tools.save.successSave),(0,A.resetDirty)()},error:function(){(0,h.alert)(""+window.i18n.tools.save.failSave)}}):o.show(e,r.context)});var a=$('
  • \n \n '+window.i18n.tools.save.saveAs+"\n \n
  • ");return n.append(a),a.click(function(){var e=(0,A.tableToXml)(r.context);o.show(e,r.context)}),e.append(t),e.append(n),e}},{key:"getTitle",value:function(){return""+window.i18n.tools.save.save}},{key:"getIcon",value:function(){return''}}]),t}(d.default);t.default=f},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n\n '+this.getIcon()+"\n "),t=this;return e.click(function(){t.execute()}),e}},{key:"checkSelection",value:function(){var e=this.context.hot.getSelected();return!(!e||0===e.length)||((0,r.alert)(""+window.i18n.selectTargetCellFirst),!1)}}]),e}();t.default=a},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n
    ');var t=this.dialog.find(".modal-body"),n=this.dialog.find(".modal-footer");this.initBody(t),this.initFooter(n)}return o(e,[{key:"initBody",value:function(e){var t=$('
    ");this.fileEditor=$(''),t.append(this.fileEditor),e.append(t);var n=$('
    ");this.providerSelect=$(''),t.append(this.providerSelect),e.append(t);var n=$('
    ');e.append(n);var i=$('\n \n \n \n
    '+window.i18n.dialog.open.fileName+''+window.i18n.dialog.open.modDate+''+window.i18n.dialog.open.open+''+window.i18n.dialog.open.del+"
    ");this.fileTableBody=$(""),i.append(this.fileTableBody),n.append(i);var o=this;this.providerSelect.change(function(){var e=$(this).val();if(e&&""!==e){o.fileTableBody.empty();var t=o.reportFilesData[e];if(t){var n=!0,i=!1,s=void 0;try{for(var l,d=function(){var n=l.value,i=$('');o.fileTableBody.append(i),i.append(''+n.name+""),i.append(''+(0,r.formatDate)(n.updateDate)+"");var s=$('');i.append(s);var d=$('');s.append(d),d.click(function(){(0,a.confirm)(window.i18n.dialog.open.openConfirm+"["+n.name+"]?",function(){var t=e+encodeURI(encodeURI(n.name)),i=window._server+"/designer?_u="+t;window.open(i,"_self")})});var u=$('');i.append(u);var c=$('');u.append(c),c.click(function(){(0,a.confirm)(""+window.i18n.dialog.open.delConfirm+n.name,function(){var o=e+n.name;$.ajax({type:"POST",data:{file:o},url:window._server+"/designer/deleteReportFile",success:function(){i.remove();var e=t.indexOf(n);t.splice(e,1)},error:function(){(0,a.alert)(""+window.i18n.dialog.open.delFail)}})})})},u=t[Symbol.iterator]();!(n=(l=u.next()).done);n=!0)d()}catch(e){i=!0,s=e}finally{try{!n&&u.return&&u.return()}finally{if(i)throw s}}o.currentProviderPrefix=e,o.currentReportFiles=t}}})}},{key:"show",value:function(){this.providerSelect.empty(),this.fileTableBody.empty(),this.reportFilesData={};var e=this;$.ajax({url:window._server+"/designer/loadReportProviders",success:function(t){var n=!0,i=!1,o=void 0;try{for(var r,a=t[Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var s=r.value,l=s.reportFiles,d=s.name,u=s.prefix;e.reportFilesData[u]=l,e.providerSelect.append('")}}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}e.providerSelect.trigger("change")},error:function(){(0,a.alert)(""+window.i18n.dialog.open.loadFail)}}),this.dialog.modal("show")}}]),e}();t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n
    '),n=$('');t.append(n);var i=$('"),o=$(''),r=$('
  • \n \n '+window.i18n.tools.alignLeft.leftAlign+"\n \n
  • ");o.append(r),n.click(function(){var t=e.context.hot.getSelected();if(!t||0===t.length)return void(0,c.alert)(""+window.i18n.selectTargetCellFirst);var n=e.align,i=e._buildCellAlign(e.context,e.align);u.undoManager.add({undo:function(){i=e._buildCellAlign(e.context,null,i),(0,u.setDirty)()},redo:function(){i=e._buildCellAlign(e.context,n),(0,u.setDirty)()}}),(0,u.setDirty)()}),r.click(function(){var t=e.context.hot.getSelected();if(!t||0===t.length)return void(0,c.alert)(""+window.i18n.selectTargetCellFirst);var n=e._buildCellAlign(e.context,"left");u.undoManager.add({undo:function(){n=e._buildCellAlign(e.context,null,n),(0,u.setDirty)()},redo:function(){n=e._buildCellAlign(e.context,"left"),(0,u.setDirty)()}}),(0,u.setDirty)()});var a=$('
  • \n \n '+window.i18n.tools.alignLeft.centerAlign+"\n \n
  • ");a.click(function(){var t=e.context.hot.getSelected();if(!t||0===t.length)return void(0,c.alert)(""+window.i18n.selectTargetCellFirst);var n=e._buildCellAlign(e.context,"center");u.undoManager.add({undo:function(){n=e._buildCellAlign(e.context,null,n),(0,u.setDirty)()},redo:function(){n=e._buildCellAlign(e.context,"center"),(0,u.setDirty)()}}),(0,u.setDirty)()}),o.append(a);var s=$('
  • \n \n '+window.i18n.tools.alignLeft.rightAlign+"\n \n
  • ");return s.click(function(){var t=e.context.hot.getSelected();if(!t||0===t.length)return void(0,c.alert)(""+window.i18n.selectTargetCellFirst);var n=e._buildCellAlign(e.context,"right");u.undoManager.add({undo:function(){n=e._buildCellAlign(e.context,null,n),(0,u.setDirty)()},redo:function(){n=e._buildCellAlign(e.context,"right"),(0,u.setDirty)()}}),(0,u.setDirty)()}),o.append(s),t.append(i),t.append(o),t}},{key:"refresh",value:function(e,t,n,i){var o=n;e>n&&(n=e,e=o),o=i,t>i&&(i=t,t=o);for(var r=e;r<=n;r++){for(var a=t;a<=i;a++){var s=this.context.getCell(r,a);if(s){var l=s.cellStyle,d=l.align||"left";$("#align_button").removeClass().addClass("ureport ureport-align"+d),this.align=d;break}}break}}},{key:"_buildCellAlign",value:function(e,t,n){var i={},o=e.hot.getSelected(),r=o[0],a=o[1],s=o[2],l=o[3],d=s;r>s&&(s=r,r=d),d=l,a>l&&(l=a,a=d);for(var u=r;u<=s;u++)for(var c=a;c<=l;c++){var h=e.getCell(u,c),A=e.hot.getCell(u,c);if(h){var f=h.cellStyle;i[u+","+c]=f.align||"",n&&(t=n[u+","+c]),$(A).css("text-align",t),f.align=t,$("#align_button").removeClass().addClass("ureport ureport-align"+t),this.align=t}}return i}},{key:"getTitle",value:function(){return""+window.i18n.tools.alignLeft.leftRightAlign}},{key:"getIcon",value:function(){return''}}]),t}(d.default);t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n
    '),n=$('');t.append(n);var i=$('");n.click(function(){var t=e.context.hot.getSelected();if(!t||0===t.length)return void(0,c.alert)(""+window.i18n.selectTargetCellFirst);var n=e.align,i=e._buildCellAlign(e.context,e.align);u.undoManager.add({undo:function(){i=e._buildCellAlign(e.context,null,i),(0,u.setDirty)()},redo:function(){i=e._buildCellAlign(e.context,n),(0,u.setDirty)()}}),(0,u.setDirty)()});var o=$(''),r=$('
  • \n \n '+window.i18n.tools.alignTop.topAlign+"\n \n
  • ");r.click(function(){var t=e.context.hot.getSelected();if(!t||0===t.length)return void(0,c.alert)(""+window.i18n.selectTargetCellFirst);var n=e._buildCellAlign(e.context,"top");u.undoManager.add({undo:function(){n=e._buildCellAlign(e.context,null,n),(0,u.setDirty)()},redo:function(){n=e._buildCellAlign(e.context,"top"),(0,u.setDirty)()}}),(0,u.setDirty)()}),o.append(r);var a=$('
  • \n \n '+window.i18n.tools.alignTop.middleAlign+"\n \n
  • ");a.click(function(){var t=e.context.hot.getSelected();if(!t||0===t.length)return void(0,c.alert)(""+window.i18n.selectTargetCellFirst);var n=e._buildCellAlign(e.context,"middle");u.undoManager.add({undo:function(){n=e._buildCellAlign(e.context,null,n),(0,u.setDirty)()},redo:function(){n=e._buildCellAlign(e.context,"middle"),(0,u.setDirty)()}}),(0,u.setDirty)()}),o.append(a);var s=$('
  • \n \n '+window.i18n.tools.alignTop.bottomAlign+"\n \n
  • ");return s.click(function(){var t=e.context.hot.getSelected();if(!t||0===t.length)return void(0,c.alert)(""+window.i18n.selectTargetCellFirst);var n=e._buildCellAlign(e.context,"bottom");u.undoManager.add({undo:function(){n=e._buildCellAlign(e.context,null,n),(0,u.setDirty)()},redo:function(){n=e._buildCellAlign(e.context,"bottom"),(0,u.setDirty)()}}),(0,u.setDirty)()}),o.append(s),t.append(i),t.append(o),t}},{key:"refresh",value:function(e,t,n,i){var o=n;e>n&&(n=e,e=o),o=i,t>i&&(i=t,t=o);for(var r=e;r<=n;r++){for(var a=t;a<=i;a++){var s=this.context.getCell(r,a);if(s){var l=s.cellStyle,d=l.valign||"top";$("#valign_button").removeClass().addClass("ureport ureport-align"+d),this.align=d;break}}break}}},{key:"_buildCellAlign",value:function(e,t,n){var i={},o=e.hot.getSelected(),r=o[0],a=o[1],s=o[2],l=o[3],d=s;r>s&&(s=r,r=d),d=l,a>l&&(l=a,a=d);for(var u=r;u<=s;u++)for(var c=a;c<=l;c++){var h=e.getCell(u,c),A=e.hot.getCell(u,c);if(h){var f=h.cellStyle;i[u+","+c]=f.valign||"",n&&(t=n[u+","+c]),$(A).css("vertical-align",t),f.valign=t,$("#valign_button").removeClass().addClass("ureport ureport-align"+t),this.align=t}}return i}},{key:"getTitle",value:function(){return""+window.i18n.tools.alignTop.topAlign}},{key:"getIcon",value:function(){return''}}]),t}(d.default);t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n'}}]),t}(d.default);t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n'}}]),t}(d.default);t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t,n,i,o,r){if(!t){t=$("
    ");var a=$("");t.append(a);var s=$("
  • "+window.i18n.tools.border.up+"
  • ");a.append(s);var d=$("
  • "+window.i18n.tools.border.down+"
  • ");a.append(d);var h=$("
  • "+window.i18n.tools.border.left+"
  • ");a.append(h);var A=$("
  • "+window.i18n.tools.border.right+"
  • ");a.append(A);var f=$("
    "),p=$('
    ');f.append(p),u(p,n);var y=$('
    ');f.append(y),u(y,i);var M=$('
    ');f.append(M),u(M,o);var w=$('
    ');f.append(w),u(w,r),t.append(f)}return(0,m.dialog)(""+window.i18n.tools.border.customBorderLine,t,function(){var t=e.hot.getSelected(),a=t[0],s=t[1],d=t[2],u=t[3],h=l(e,a,s,d,u,o,r,n,i);g.undoManager.add({redo:function(){h=l(e,a,s,d,u,o,r,n,i)},undo:function(){c(e,a,s,d,u,h)}}),(0,g.setDirty)()}),t.parents(".modal-content").css({width:"280px"}),t}function l(e,t,n,i,o,r,a,s,l){var u=e.hot,c=r,h=a,A=s,f=l;"none"===r.style&&(c=""),"none"===a.style&&(h=""),"none"===s.style&&(A=""),"none"===l.style&&(f="");for(var p={},g=t;g<=i;g++)for(var m=n;m<=o;m++){var y=(u.getCell(g,m),e.getCell(g,m));if(y){var M=y.cellStyle;p[g+","+m]={leftBorder:M.leftBorder,rightBorder:M.rightBorder,topBorder:M.topBorder,bottomBorder:M.bottomBorder},M.leftBorder=d(c),M.rightBorder=d(h),M.topBorder=d(A),M.bottomBorder=d(f)}}return u.render(),p}function d(e){if(e&&""!==e){var t=JSON.stringify(e),n=JSON.parse(t);return n}return e}function u(e,t){var n=$('
    '+window.i18n.tools.border.lineStyle+":
    ");e.append(n);var i=$('\n \n ");n.append(i),i.change(function(){var e=$(this).val();t.style=e});var o=$('
    '+window.i18n.tools.border.size+":
    ");e.append(o);for(var r=$('\n \n '),a=1;a<=10;a++)t.width===a?r.append('"):r.append('");o.append(r),r.change(function(){t.width=$(this).val()});var s=$("
    ");e.append(s);var l=$("
    "+window.i18n.tools.border.color+":
    ");s.append(l),l.colorpicker({color:t.color,container:!0,inline:!0,colorSelectors:{black:"#000000",red:"#FF0000",default:"#777777",primary:"#337ab7",success:"#5cb85c",info:"#5bc0de",warning:"#f0ad4e",danger:"#d9534f"}}),l.colorpicker().on("changeColor",function(e){var n=e.color.toRGB(),i=n.r+","+n.g+","+n.b;t.color=i})}function c(e,t,n,i,o,r){for(var a=e.hot,s=t;s<=i;s++)for(var l=n;l<=o;l++){var d=(a.getCell(s,l),e.getCell(s,l));if(d){var u=r[s+","+l],c=d.cellStyle;c.leftBorder=u.leftBorder||"",c.rightBorder=u.rightBorder||"",c.topBorder=u.topBorder||"",c.bottomBorder=u.bottomBorder||""}}a.render()}function h(e,t,n,i,o,r,a){for(var s={},l=e.hot,d=t;d<=i;d++)for(var u=n;u<=o;u++){var c=(l.getCell(d,u),e.getCell(d,u));if(c){var h=c.cellStyle;s[d+","+u]={leftBorder:h.leftBorder,rightBorder:h.rightBorder,topBorder:h.topBorder,bottomBorder:h.bottomBorder},a?"left"===a?(h.leftBorder=r,h.rightBorder="",h.topBorder="",h.bottomBorder=""):"right"===a?(h.rightBorder=r,h.leftBorder="",h.topBorder="",h.bottomBorder=""):"top"===a?(h.topBorder=r,h.leftBorder="",h.rightBorder="",h.bottomBorder=""):"bottom"===a&&(h.bottomBorder=r,h.leftBorder="",h.rightBorder="",h.topBorder=""):(h.leftBorder=r,h.rightBorder=r,h.topBorder=r,h.bottomBorder=r)}}return s}Object.defineProperty(t,"__esModule",{value:!0});var A=function(){function e(e,t){for(var n=0;n'),n=$(''),i=$(''),o=$('
  • \n \n '+window.i18n.tools.border.allLine+"\n \n
  • ");o.click(function(){if(e.checkSelection()){var t=e.context.hot,n=t.getSelected(),i=n[0],o=n[1],r=n[2],a=n[3],s=r;i>r&&(r=i,i=s),s=a,o>a&&(a=o,o=s);var l={width:1,color:"0,0,0",style:"solid"},d=h(e.context,i,o,r,a,l);t.render(),g.undoManager.add({redo:function(){d=h(e.context,i,o,r,a,l),t.render(),(0,g.setDirty)()},undo:function(){c(e.context,i,o,r,a,d),(0,g.setDirty)()}}),(0,g.setDirty)()}}),i.append(o);var r=$('
  • \n \n '+window.i18n.tools.border.noBorder+"\n \n
  • ");r.click(function(){if(e.checkSelection()){var t=e.context.hot,n=t.getSelected(),i=n[0],o=n[1],r=n[2],a=n[3],s=r;i>r&&(r=i,i=s),s=a,o>a&&(a=o,o=s);var l="",d=h(e.context,i,o,r,a,l);t.render(),g.undoManager.add({redo:function(){d=h(e.context,i,o,r,a,l),t.render(),(0,g.setDirty)()},undo:function(){c(e.context,i,o,r,a,d),(0,g.setDirty)()}}),(0,g.setDirty)()}}),i.append(r);var a=$('
  • \n \n '+window.i18n.tools.border.leftBorder+"\n \n
  • ");a.click(function(){if(e.checkSelection()){var t=e.context.hot,n=t.getSelected(),i=n[0],o=n[1],r=n[2],a=n[3],s=r;i>r&&(r=i,i=s),s=a,o>a&&(a=o,o=s);var l={width:1,color:"0,0,0",style:"solid"},d=h(e.context,i,o,r,a,l,"left");t.render(),g.undoManager.add({redo:function(){d=h(e.context,i,o,r,a,l,"left"),t.render(),(0,g.setDirty)()},undo:function(){c(e.context,i,o,r,a,d),(0,g.setDirty)()}}),(0,g.setDirty)()}}),i.append(a);var l=$('
  • \n \n '+window.i18n.tools.border.rightBorder+"\n \n
  • ");l.click(function(){if(e.checkSelection()){var t=e.context.hot,n=t.getSelected(),i=n[0],o=n[1],r=n[2],a=n[3],s=r;i>r&&(r=i,i=s),s=a,o>a&&(a=o,o=s);var l={width:1,color:"0,0,0",style:"solid"},d=h(e.context,i,o,r,a,l,"right");t.render(),g.undoManager.add({redo:function(){d=h(e.context,i,o,r,a,l,"right"),t.render(),(0,g.setDirty)()},undo:function(){c(e.context,i,o,r,a,d),(0,g.setDirty)()}}),(0,g.setDirty)()}}),i.append(l);var d=$('
  • \n \n '+window.i18n.tools.border.topBorder+"\n \n
  • ");d.click(function(){if(e.checkSelection()){var t=e.context.hot,n=t.getSelected(),i=n[0],o=n[1],r=n[2],a=n[3],s=r;i>r&&(r=i,i=s),s=a,o>a&&(a=o,o=s);var l={width:1,color:"0,0,0",style:"solid"},d=h(e.context,i,o,r,a,l,"top");t.render(),g.undoManager.add({redo:function(){d=h(e.context,i,o,r,a,l,"top"),t.render(),(0,g.setDirty)()},undo:function(){c(e.context,i,o,r,a,d),(0,g.setDirty)()}}),(0,g.setDirty)()}}),i.append(d);var u=$('
  • \n \n '+window.i18n.tools.border.bottomBorder+"\n \n
  • ");u.click(function(){if(e.checkSelection()){var t=e.context.hot,n=t.getSelected(),i=n[0],o=n[1],r=n[2],a=n[3],s=r;i>r&&(r=i,i=s),s=a,o>a&&(a=o,o=s);var l={width:1,color:"0,0,0",style:"solid"},d=h(e.context,i,o,r,a,l,"bottom");t.render(),g.undoManager.add({redo:function(){d=h(e.context,i,o,r,a,l,"bottom"),t.render(),(0,g.setDirty)()},undo:function(){c(e.context,i,o,r,a,d),(0,g.setDirty)()}}),(0,g.setDirty)()}}),i.append(u),i.append('
  • ');var A=$('
  • \n \n '+window.i18n.tools.border.customBorder+"\n \n
  • "),f=null,p={width:1,style:"solid",color:"0,0,0"},m={width:1,style:"solid",color:"0,0,0"},y={width:1,style:"solid",color:"0,0,0"},M={width:1,style:"solid",color:"0,0,0"};return A.click(function(){e.checkSelection()&&(f=s(e.context,f,p,m,y,M))}),i.append(A),t.append(n),t.append(i),t}}]),t}(p.default);t.default=y},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t,n,i,o){for(var r=e.hot,a={},s=t;s<=i;s++)for(var l=n;l<=o;l++){var d=e.getCell(s,l);if(d){var u=d.cellStyle;a[s+","+l]=u.bold,u.bold?u.bold=!1:u.bold=!0}}return r.render(),a}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;nr&&(r=i,i=l),l=a,o>a&&(a=o,o=l);var d=s(e.context,i,o,r,a);c.undoManager.add({redo:function(){d=s(e.context,i,o,r,a),(0,c.setDirty)()},undo:function(){for(var n=i;n<=r;n++)for(var s=o;s<=a;s++){var l=e.context.getCell(n,s);if(l){var u=l.cellStyle,h=d[n+","+s];u.bold=h}}t.render(),(0,c.setDirty)()}}),(0,c.setDirty)()}}},{key:"getTitle",value:function(){return""+window.i18n.tools.bold.bold}},{key:"getIcon",value:function(){return''}}]),t}(u.default);t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t,n,i,o){for(var r=e.hot,a={},s=t;s<=i;s++)for(var l=n;l<=o;l++){var d=e.getCell(s,l);if(d){var u=d.cellStyle;a[s+","+l]=u.italic,u.italic?u.italic=!1:u.italic=!0}}return r.render(),a}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;nr&&(r=i,i=l),l=a,o>a&&(a=o,o=l);var d=s(e.context,i,o,r,a);c.undoManager.add({redo:function(){d=s(e.context,i,o,r,a),(0,c.setDirty)()},undo:function(){for(var n=i;n<=r;n++)for(var s=o;s<=a;s++){var l=e.context.getCell(n,s);if(l){var u=l.cellStyle,h=d[n+","+s];u.italic=h}}t.render(),(0,c.setDirty)()}}),(0,c.setDirty)()}}},{key:"getTitle",value:function(){return""+window.i18n.italic}},{key:"getIcon",value:function(){return''}}]),t}(u.default);t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t,n,i,o,r){for(var a={},s=e.hot,l=t;l<=i;l++)for(var d=n;d<=o;d++){var u=(s.getCell(l,d),e.getCell(l,d));if(u){var c="underline";r&&(c=r[l+","+d]);var h=u.cellStyle;a[l+","+d]=h.underline,h.underline?h.underline=!1:h.underline=!0}}return s.render(),a}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;nr&&(r=i,i=l),l=a,o>a&&(a=o,o=l);var d=s(this.context,i,o,r,a);c.undoManager.add({redo:function(){d=s(e.context,i,o,r,a),(0,c.setDirty)()},undo:function(){d=s(e.context,i,o,r,a,d),(0,c.setDirty)()}}),(0,c.setDirty)()}}},{key:"getTitle",value:function(){return""+window.i18n.underline}},{key:"getIcon",value:function(){return''}}]),t}(u.default);t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t,n,i,o,r,a){for(var s=e.hot,l={},d=t;d<=i;d++)for(var u=n;u<=o;u++){var c=(s.getCell(d,u),e.getCell(d,u));if(c){var h=c.cellStyle;l[d+","+u]=h.bgcolor,h.bgcolor=r,$(".ud-select-bgcolor").css("background-color","rgb("+r+")"),a.bgcolor=r}}return s.render(),l}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n');this.nameButton=$(''),e.append(this.nameButton);var t=$('"),n=$(''),i=$("
  • ");n.append(i),i.colorpicker({color:"#000",container:!0,inline:!0,colorSelectors:{black:"#000000",white:"#FFFFFF",gray1:"#efefef",gray:"#CCCCCC",red:"#FF0000",default:"#777777",primary:"#337ab7",success:"#5cb85c",info:"#5bc0de",warning:"#f0ad4e",danger:"#d9534f"}});var o=this;return i.colorpicker().on("changeColor",function(e){if(o.checkSelection()){var t=e.color.toRGB(),n=t.r+","+t.g+","+t.b,i=o.context.hot,r=i.getSelected(),a=r[0],l=r[1],d=r[2],u=r[3],h=d;a>d&&(d=a,a=h),h=u,l>u&&(u=l,l=h);var A=s(o.context,a,l,d,u,n,o);c.undoManager.add({redo:function(){A=s(o.context,a,l,d,u,n,o),(0,c.setDirty)()},undo:function(){for(var e=a;e<=d;e++)for(var t=l;t<=u;t++){var n=o.context.getCell(e,t);if(n){var r=n.cellStyle,s=A[e+","+t];r.bgcolor=s,$(".ud-select-bgcolor").css("background-color","rgb("+s+")"),o.bgcolor=s}}i.render(),(0,c.setDirty)()}}),(0,c.setDirty)()}}),this.nameButton.click(function(){if(o.checkSelection()){var e=o.context.hot,t=e.getSelected(),n=t[0],i=t[1],r=t[2],a=t[3],l=r;n>r&&(r=n,n=l),l=a,i>a&&(a=i,i=l),s(o.context,n,i,r,a,o.bgcolor,o)}}),e.append(t),e.append(n),e}},{key:"refresh",value:function(e,t,n,i){var o=n;e>n&&(n=e,e=o),o=i,t>i&&(i=t,t=o);for(var r=e;r<=n;r++){for(var a=t;a<=i;a++){var s=this.context.getCell(r,a);if(s){var l=s.cellStyle,d=l.bgcolor||"255,255,255";$(".ud-select-bgcolor").css("background-color","rgb("+d+")"),this.bgcolor=d;break}}break}}}]),t}(u.default);t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t,n,i,o,r,a){for(var s=e.hot,l={},d=t;d<=i;d++)for(var u=n;u<=o;u++){var c=e.getCell(d,u);if(c){var h=c.cellStyle;l[d+","+u]=h.forecolor,h.forecolor=r,$(".ud-select-color").css("background-color","rgb("+r+")"),a.forecolor=r}}return s.render(),l}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n');this.nameButton=$(''),e.append(this.nameButton);var t=$('"),n=$(''),i=$("
  • ");n.append(i),i.colorpicker({color:"#000",container:!0,inline:!0,colorSelectors:{black:"#000000",white:"#FFFFFF",gray1:"#efefef",gray:"#CCCCCC",red:"#FF0000",default:"#777777",primary:"#337ab7",success:"#5cb85c",info:"#5bc0de",warning:"#f0ad4e",danger:"#d9534f"}});var o=this;return i.colorpicker().on("changeColor",function(e){if(o.checkSelection()){var t=e.color.toRGB(),n=t.r+","+t.g+","+t.b,i=o.context.hot,r=i.getSelected(),a=r[0],l=r[1],d=r[2],u=r[3],h=d;a>d&&(d=a,a=h),h=u,l>u&&(u=l,l=h);var A=s(o.context,a,l,d,u,n,o);c.undoManager.add({redo:function(){A=s(o.context,a,l,d,u,n,o),(0,c.setDirty)()},undo:function(){for(var e=a;e<=d;e++)for(var t=l;t<=u;t++){var n=o.context.getCell(e,t);if(n){var r=n.cellStyle,s=A[e+","+t];r.forecolor=s,$(".ud-select-color").css("background-color","rgb("+s+")"),o.forecolor=s}}i.render(),(0,c.setDirty)()}}),(0,c.setDirty)()}}),this.nameButton.click(function(){if(o.checkSelection()){var e=o.context.hot,t=e.getSelected(),n=t[0],i=t[1],r=t[2],a=t[3],l=r;n>r&&(r=n,n=l),l=a,i>a&&(a=i,i=l),s(o.context,n,i,r,a,o.forecolor,o)}}),e.append(t),e.append(n),e}},{key:"refresh",value:function(e,t,n,i){var o=n;e>n&&(n=e,e=o),o=i,t>i&&(i=t,t=o);for(var r=e;r<=n;r++){for(var a=t;a<=i;a++){var s=this.context.getCell(r,a);if(s){var l=s.cellStyle,d=l.forecolor||"0,0,0";$(".ud-select-color").css("background-color","rgb("+d+")"),this.forecolor=d;break}}break}}}]),t}(u.default);t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;no&&(o=n,n=a),a=r,i>r&&(r=i,i=a);var s=this.context.getCell(n,i),l=e.getDataAtCell(n,i),d=(0,u.buildNewCellDef)(n+1,i+1);d.value={type:"image",source:"text",value:""},this.context.addCell(d);var c=window._server+"/res/ureport-asserts/icons/image.svg",A=$(''),f=$(e.getCell(n,i));f.empty(),f.append(A),(0,u.setDirty)(),h.default.hooks.run(e,"afterSelectionEnd",n,i,o,r);var p=this;u.undoManager.add({redo:function(){s=p.context.getCell(n,i),l=e.getDataAtCell(n,i),d=(0,u.buildNewCellDef)(n+1,i+1),d.value={type:"image",source:"text",value:""},p.context.addCell(d),e.setDataAtCell(n,i,""),e.render(),(0,u.setDirty)(),h.default.hooks.run(e,"afterSelectionEnd",n,i,o,r)},undo:function(){p.context.addCell(s),e.setDataAtCell(n,i,l),e.render(),(0,u.setDirty)(),h.default.hooks.run(e,"afterSelectionEnd",n,i,o,r)}})}}},{key:"getTitle",value:function(){return""+window.i18n.image}},{key:"getIcon",value:function(){return''}}]),t}(d.default);t.default=A},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n'),n=$(''),i=$(''),o=$('
  • \n \n '+window.i18n.tools.chart.pie+"\n \n
  • ");i.append(o),o.click(function(){e._doClick("pie")});var r=$('
  • \n \n '+window.i18n.tools.chart.doughnut+"\n \n
  • ");i.append(r),r.click(function(){e._doClick("doughnut")});var a=$('
  • \n \n '+window.i18n.tools.chart.line+"\n \n
  • ");i.append(a),a.click(function(){e._doClick("line")});var s=$('
  • \n \n '+window.i18n.tools.chart.bar+"\n \n
  • ");i.append(s),s.click(function(){e._doClick("bar")});var l=$('
  • \n \n '+window.i18n.tools.chart.horizontalBar+"\n \n
  • ");i.append(l),l.click(function(){e._doClick("horizontalBar")});var d=$('
  • \n \n '+window.i18n.tools.chart.area+"\n \n
  • ");i.append(d),d.click(function(){e._doClick("area")});var u=$('
  • \n \n '+window.i18n.tools.chart.radar+"\n \n
  • ");i.append(u),u.click(function(){e._doClick("radar")});var c=$('
  • \n \n '+window.i18n.tools.chart.polar+"\n \n
  • ");i.append(c),c.click(function(){e._doClick("polar")});var h=$('
  • \n \n '+window.i18n.tools.chart.scatter+"\n \n
  • ");i.append(h),h.click(function(){e._doClick("scatter")});var A=$('
  • \n \n '+window.i18n.tools.chart.bubble+"\n \n
  • ");return i.append(A),A.click(function(){e._doClick("bubble")}),t.append(n),t.append(i),t}},{key:"_doClick",value:function(e){if(this.checkSelection()){var t=this,n=t.context.hot,i=n.getSelected(),o=i[0],r=i[1],a=i[2],s=i[3],d=t.context.getCell(o,r),u=d.value,c=n.getDataAtCell(o,r);n.setDataAtCell(o,r,""),d.value={type:"chart",chart:this._newChart(e)},n.render(),(0,l.setDirty)(),h.default.hooks.run(n,"afterSelectionEnd",o,r,a,s),l.undoManager.add({redo:function(){d=t.context.getCell(o,r),u=d.value,c=n.getDataAtCell(o,r),n.setDataAtCell(o,r,""),d.value={type:"chart",chart:t._newChart(e)},n.render(),(0,l.setDirty)(),h.default.hooks.run(n,"afterSelectionEnd",o,r,a,s)},undo:function(){d=t.context.getCell(o,r),d.value=u,n.setDataAtCell(o,r,c),n.render(),(0,l.setDirty)(),h.default.hooks.run(n,"afterSelectionEnd",o,r,a,s)}})}}},{key:"_newChart",value:function(e){return{dataset:{type:e}}}}]),t}(u.default);t.default=A},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n'}}]),t}(d.default);t.default=m},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n