var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.owns=function(E,J){return Object.prototype.hasOwnProperty.call(E,J)};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(E,J,L){if(E==Array.prototype||E==Object.prototype)return E;E[J]=L.value;return E};$jscomp.getGlobal=function(E){E=["object"==typeof globalThis&&globalThis,E,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var J=0;J<E.length;++J){var L=E[J];if(L&&L.Math==Math)return L}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(E,J){var L=$jscomp.propertyToPolyfillSymbol[J];if(null==L)return E[J];L=E[L];return void 0!==L?L:E[J]};
$jscomp.polyfill=function(E,J,L,Q){J&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(E,J,L,Q):$jscomp.polyfillUnisolated(E,J,L,Q))};$jscomp.polyfillUnisolated=function(E,J,L,Q){L=$jscomp.global;E=E.split(".");for(Q=0;Q<E.length-1;Q++){var R=E[Q];if(!(R in L))return;L=L[R]}E=E[E.length-1];Q=L[E];J=J(Q);J!=Q&&null!=J&&$jscomp.defineProperty(L,E,{configurable:!0,writable:!0,value:J})};
$jscomp.polyfillIsolated=function(E,J,L,Q){var R=E.split(".");E=1===R.length;Q=R[0];Q=!E&&Q in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var ha=0;ha<R.length-1;ha++){var Aa=R[ha];if(!(Aa in Q))return;Q=Q[Aa]}R=R[R.length-1];L=$jscomp.IS_SYMBOL_NATIVE&&"es6"===L?Q[R]:null;J=J(L);null!=J&&(E?$jscomp.defineProperty($jscomp.polyfills,R,{configurable:!0,writable:!0,value:J}):J!==L&&(void 0===$jscomp.propertyToPolyfillSymbol[R]&&(L=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[R]=
$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(R):$jscomp.POLYFILL_PREFIX+L+"$"+R),$jscomp.defineProperty(Q,$jscomp.propertyToPolyfillSymbol[R],{configurable:!0,writable:!0,value:J})))};$jscomp.polyfill("Object.values",function(E){return E?E:function(J){var L=[],Q;for(Q in J)$jscomp.owns(J,Q)&&L.push(J[Q]);return L}},"es8","es3");$jscomp.findInternal=function(E,J,L){E instanceof String&&(E=String(E));for(var Q=E.length,R=0;R<Q;R++){var ha=E[R];if(J.call(L,ha,R,E))return{i:R,v:ha}}return{i:-1,v:void 0}};
$jscomp.polyfill("Array.prototype.find",function(E){return E?E:function(J,L){return $jscomp.findInternal(this,J,L).v}},"es6","es3");
(function(){function E(c,f){var h=this,b,k=230,n=300,w=new Qa,p;this.setSelected=function(d){throw Error("Implement");};this.getSelected=function(){throw Error("Implement");};this.formatDateText=function(d){return d};this.protectedGetDateValueForNow=function(){throw Error("Implement");};this.fixDateValue=function(d){throw Error("Implement");};this.getPanelCreator=function(){return a};var a=function(d,e,r,l,m){l=$("<div>");b=new c;var q=b.getJqUi(),t=q.find(".sa-ctrl-list-owner .sa-ctrl-list-item");
t&&t.css("padding-left","4px");h.setSelected(e);b.scrollSelectedToVisible&&setTimeout(function(){b.scrollSelectedToVisible()},0);F.layoutCtrlWithLRTB(q,0,0,null,0,32,null);e=$("<div>");e.css({"background-color":"#fff","border-top":"1px solid #ddd"});F.layoutCtrlWithLRTB(e,0,0,null,null,0,32);t=new ta(I.get("clear","\u6e05\u7a7a"));t.addActionListener(function(N){r&&r(null)});t=t.getJqUi();F.layoutCtrlWithLRTB(t,6,null,40,null,5,22);if(f){var B=new ta(f);B.addActionListener(function(N){r&&r(h.protectedGetDateValueForNow())});
B=B.getJqUi();F.layoutCtrlCenterAlign(B,40);F.layoutCtrlMiddleAlign(B,22)}var y=new ta(I.get("ok","\u786e\u8ba4"));y.addActionListener(function(N){r&&r(h.getSelected())});y=y.getJqUi();F.layoutCtrlWithLRTB(y,null,6,40,null,5,22);e.append(t);B&&e.append(B);e.append(y);l.append(q);l.append(e);d.append(l);p&&m(function(){p(d)});return[k,n]};this.protectedMethod={setHeight:function(d){n=d},setWidth:function(d){k=d},formatDate:function(d,e){if(!d)return"";w.setFormatString(e);return w.format(d)},getCalender:function(){return b},
setAfterOpenDropdown:function(d){p=d}}}function J(){E.call(this,L,I.get("today","\u4eca\u5929"));var c=this.protectedMethod,f=Z.DATETIME;(function(){c.setWidth(400);c.setAfterOpenDropdown(function(h){var b=h.position().left-10;h.css("left",b+"px")})})();this.setSelected=function(h){var b=c.getCalender();h=h?new Date(h):new Date;b.setSelected(h.getFullYear(),h.getMonth()+1,h.getDate(),h.getHours(),h.getMinutes(),h.getSeconds())};this.getSelected=function(){var h,b=c.getCalender().getSelectedDate();
b&&(h=c.formatDate(b,f));return h};this.protectedGetDateValueForNow=function(){return c.formatDate(new Date,f)};this.fixDateValue=function(h){var b="";h=h?new Date(h):null;h instanceof Date&&!isNaN(h.getTime())&&(b=c.formatDate(h,f));return b}}function L(){var c=new Fa,f=new Ga,h;this.getJqUi=function(){if(!h){h=$("<div>");var b=c.getJqUi();F.layoutCtrl(b,0,0,"57%","100%");var k=f.getJqUi();k.css("border-left","1px solid #ddd");F.layoutCtrl(k,"57%",0,"43%","100%");h.append(b);h.append(k)}return h};
this.setSelected=function(b,k,n,w,p,a){c.setSelected(b,k,n);f.setSelected(w,p,a)};this.getSelectedDate=function(){var b=new Date(c.getSelectedYear(),c.getSelectedMonth()-1,c.getSelectedDay(),f.getHour(),f.getMinute(),f.getSecond());return b instanceof Date&&!isNaN(b.getTime())?b:null};this.scrollSelectedToVisible=function(){var b=f.getHour(),k=f.getMinute(),n=f.getSecond();f.setSelected(b,k,n)}}function Q(){E.call(this,Fa,I.get("today","\u4eca\u5929"));var c=this.protectedMethod,f=Z.YEAR_MONTH_DAY;
this.setSelected=function(h){var b=c.getCalender();h=h?new Date(h):new Date;b.setSelected(h.getFullYear(),h.getMonth()+1,h.getDate())};this.getSelected=function(){var h=c.getCalender();h=new Date(h.getSelectedYear(),h.getSelectedMonth()-1,h.getSelectedDay());return c.formatDate(h,f)};this.protectedGetDateValueForNow=function(){return c.formatDate(new Date,f)};this.fixDateValue=function(h){var b="";h=h?new Date(h):null;h instanceof Date&&!isNaN(h.getTime())&&(b=c.formatDate(h,f));return b}}function R(){E.call(this,
Ra,I.get("currentMonth","\u672c\u6708"));var c=this.protectedMethod,f=Z.YEAR_MONTH,h=Z.YEAR_MONTH_DAY;this.setSelected=function(b){var k=c.getCalender();b=b?new Date(b):new Date;k.setSelectedYear(b.getFullYear());k.setSelectedMonth(b.getMonth()+1)};this.getSelected=function(){var b=c.getCalender();b=new Date(b.getSelectedYear(),b.getSelectedMonth(),0);return c.formatDate(b,h)};this.formatDateText=function(b){var k="";b&&(k=c.formatDate(new Date(b),f));return k};this.protectedGetDateValueForNow=function(){var b=
new Date;b.setFullYear(b.getFullYear(),b.getMonth()+1,0);return c.formatDate(b,h)};this.fixDateValue=function(b){var k="";b=b?new Date(b):null;b instanceof Date&&!isNaN(b.getTime())&&(k=new Date(b.getFullYear(),b.getMonth()+1,0),k=c.formatDate(k,h));return k}}function ha(){E.call(this,ua,I.get("currentQuarter","\u672c\u5b63"));var c=this.protectedMethod,f=Z.YEAR_SEASON,h=Z.YEAR_MONTH_DAY;this.setSelected=function(b){var k=c.getCalender();b=b?new Date(b):new Date;k.setSelectedYear(b.getFullYear());
b=Math.floor(b.getMonth()/3);k.setSelectedQuarter(b)};this.getSelected=function(){var b=c.getCalender();b=ua.toDateRange(b.getSelectedYear(),b.getSelectedQuarter());return c.formatDate(new Date(b[1]),h)};this.formatDateText=function(b){var k="";b&&(k=c.formatDate(new Date(b),f));return k};this.protectedGetDateValueForNow=function(){var b=new Date,k=Math.floor(b.getMonth()/3);b=ua.toDateRange(b.getFullYear(),k);return c.formatDate(new Date(b[1]),h)};this.fixDateValue=function(b){var k="";b=b?new Date(b):
null;b instanceof Date&&!isNaN(b.getTime())&&(k=Math.floor(b.getMonth()/3),k=ua.toDateRange(b.getFullYear(),k),k=c.formatDate(new Date(k[1]),h));return k}}function Aa(){E.call(this,db,I.get("thisYear","\u672c\u5e74"));var c=this.protectedMethod,f=Z.YEAR,h=Z.YEAR_MONTH_DAY;this.setSelected=function(b){c.getCalender().setSelectedYear((b?new Date(b):new Date).getFullYear())};this.getSelected=function(){var b=c.getCalender();b=new Date(b.getSelectedYear(),12,0);return c.formatDate(b,h)};this.formatDateText=
function(b){var k="";b&&(k=c.formatDate(new Date(b),f));return k};this.protectedGetDateValueForNow=function(){var b=new Date;b.setFullYear(b.getFullYear(),12,0);return c.formatDate(b,h)};this.fixDateValue=function(b){var k="";b=b?new Date(b):null;b instanceof Date&&!isNaN(b.getTime())&&(k=new Date(b.getFullYear(),12,0),k=c.formatDate(k,h));return k}}function db(){var c=this,f,h=new Ha;this.getJqUi=function(){f||(f=$("<div>"),f.addClass("sa-ctrl-common-background_enabled"),c.setYearScope(1900,2199),
b(h),h.getJqUi().appendTo(f));return f};this.scrollSelectedToVisible=function(){h.scrollSelectedToVisible()};this.setYearScope=function(k,n){for(var w=[];k<=n;k++)w.push(k);h.setItemModels(w)};this.getSelectedYear=function(){var k=h.getSelecteds();return 0<k.length?k[0]:null};this.setSelectedYear=function(k){h.setSelecteds([k])};var b=function(k,n){k.setScrollerShy(!0);k.setToggleSelectingEnabled(!1);k.setBorderVisible(!1);k.setCustomItemPainter(function(w,p){w.css({height:"26px","line-height":"26px"});
w.text(n?n[p]:p)})}}function eb(){E.call(this,fb,null);var c=this.protectedMethod,f=Z.TIME;this.setSelected=function(h){var b=c.getCalender();Z.isTimeString(h)?(h=h.split(":"),b.setSelected(parseInt(h[0]),parseInt(h[1]),parseInt(h[2]))):(h=new Date,b.setSelected(h.getHours(),h.getMinutes(),h.getSeconds()))};this.getSelected=function(){var h,b=new Date,k=c.getCalender();b.setHours(k.getHour());b.setMinutes(k.getMinute());b.setSeconds(k.getSecond());b&&(h=c.formatDate(b,f));return h};this.protectedGetDateValueForNow=
function(){return c.formatDate(new Date,f)};this.fixDateValue=function(h){return Z.isTimeString(h)?h:""}}function fb(){Ga.call(this);var c=this;this.scrollSelectedToVisible=function(){var f=c.getHour(),h=c.getMinute(),b=c.getSecond();c.setSelected(f,h,b)}}function gb(){var c,f,h,b,k,n=new Sa,w=[],p,a,d,e,r,l,m=-1,q,t=-1,B=new Ia;this.getFormula=function(){return n.getText()?n.getText().trim():""};this.getSyntaxState=function(){return t};this.setSyntaxValidator=function(C){r=C};var y=function(C,A,
G,M){h||N();f.show();C?(m=t=-1,Ja.background(h,"verified-right"),b.setText(M),k.attr("title","")):(t=1,m=A,Ja.background(h,"verified-wrong"),b.setText(G),k.attr("title",I.get("cursorPositioningTips","\u5b9a\u4f4d\u5149\u6807\u5230\u51fa\u9519\u4f4d\u7f6e")))},N=function(){h=$("<div>");b=new ja;k=b.getJqUi();k.on("click",function(){-1<m&&(n.setSelectingScope(m,m),n.requestFocus())});F.layoutCtrl(h,null,null,16,16);F.layoutCtrl(k,20,-2,null,null);f.append(h);f.append(k)},v=function(){var C=n.getText()?
n.getText().trim():"";t=0;clearTimeout(l);l=setTimeout(function(){C?r(C,y):(f.hide(),t=-1)},1E3)};this.setFormula=function(C){C&&(C=C.trim());n.setText(C);v()};this.setFunction=function(C){w=C};this.getJqUi=function(){if(!c){c=$("<div>");var C=$("<div>"),A=I.get("expression","\u8868\u8fbe\u5f0f"),G=(new ja(A)).getJqUi();f=$("<div>");n.addEditedListener(v);var M=n.getJqUi();B.setFontSize(12,"Microsoft YaHei");A=B.measureWidth(A);F.layoutCtrl(G,null,null,A,20);F.layoutCtrl(f,A+5,3,null,null);F.layoutCtrl(M,
null,25,"100%","calc(100% - 30px)");C.append(G);C.append(f);C.append(M);G=$("<div>");M=(new ja(I.get("functionDeclaration","\u51fd\u6570\u8bf4\u660e"))).getJqUi();A=$("<div>");A.css({border:"1px solid #dbdbdb",overflow:"scroll"});e=$("<div>");e.css({padding:"10px",color:"#666","white-space":"pre-wrap"});A.append(e);F.layoutCtrl(M,null,null,null,20);F.layoutCtrl(A,null,25,"calc(100% - 2px)","calc(100% - 27px)");G.append(M);G.append(A);M=$("<div>");A=(new ja(I.get("function","\u51fd\u6570"))).getJqUi();
var S=$("<div>");D(S);S.css("border","1px solid #dbdbdb");F.layoutCtrl(A,null,null,null,20);F.layoutCtrl(S,null,25,"100%","calc(100% - 27px)");M.append(A);M.append(S);F.layoutCtrl(C,null,null,"100%","40%");F.layoutCtrl(M,null,"40%","40%","60%");F.layoutCtrl(G,"calc(40% + 10px)","40%","calc(60% - 10px)","60%");c.append(C);c.append(M);c.append(G)}return c};var D=function(C){C.empty();if(w&&!(0>=w.length)){a=new Ha;a.setBorderVisible(!1);a.setMultiSelectable(!1);a.setCustomItemPainter(function(G,M){G.text(M.getFuncName())});
a.addDBLClickListener(function(G){var M=G.getSelecteds()[0],S=n.getSelectingScope();G=S[0];var V=S[1];S=M.getData();var ca=n.getText();ca=ca.substring(0,G)+S+ca.substring(V);n.setText(ca.trim());G+=S.length;M.getHasParam()&&(M=S.indexOf("("),-1<M&&(G-=S.length-M-1));n.setSelectingScope(G,G);n.requestFocus();v()});a.addSelectedChangedListener(function(G,M,S){e.text(S[0].getExample())});a.setItemModels(w);a.setSelecteds([w[0]]);d=$("<div>");d.append(a.getJqUi());p=new Ta;p.setPlaceholder(I.get("search",
"\u641c\u7d22"));p.addSearchListener(K);var A=p.getJqUi();F.layoutCtrl(A,null,null,"100%",23);F.layoutCtrl(d,null,24,"100%","calc(100% - 24px)");C.append(A);C.append(d)}},K=function(C){var A=[];if(C=$.trim(C.getText())){C=C.toUpperCase();for(var G=0;G<w.length;G++)0<=w[G].getFuncName().indexOf(C)&&A.push(w[G])}else A=w;a.setItemModels(A);A&&0<A.length?(q&&q.hide(),a.setSelecteds([A[0]])):(q||(A=new ja(I.get("nothingSearched","\u627e\u4e0d\u5230\u7b26\u5408\u7684\u7ed3\u679c")),A.setEnabled(!1),A.setAlign(ja.ALIGN_CENTER),
q=A.getJqUi(),F.layoutCtrl(q,null,null,"100%","100%"),d.append(q)),q.show())}}function oa(){var c=this,f=[];this.clone=function(){for(var a=new oa,d=0;d<f.length;d++){var e=f[d].clone();a.addParagraph(e)}return a};this.getParagraphCount=function(){return f.length};this.getParagraph=function(a){return f[a]};this.addParagraph=function(a){f.push(a)};this.insertParagraph=function(a){var d=new Ba;f.splice(a,0,d);return d};this.getAllText=function(a,d){var e="";n(d,function(r,l,m,q){l=q.getText();d&&(r==
d.getToParagraphIndex()&&m==d.getToContentIndex()&&(l=l.substring(0,d.getToOffset())),r==d.getFromParagraphIndex()&&m==d.getFromContentIndex()&&(l=l.substring(d.getFromOffset())));e+=l},function(){a&&(e+=a)});return e};this.getChapterHtml=function(){var a=$("<div>"),d=[];n(null,function(e,r,l,m){!d||d.length<=e?(e=$("<p>"),e.css("margin-top","0"),e.css("white-space","pre"),r=r.getAlign(),e.attr("align",r),a.append(e),d.push(e)):e=d[e];var q=m.getText();r=m.isBold();l=m.isItalic();var t=m.isUnderLine();
m=m.getColor();q=$(document.createTextNode(q));r&&(q.wrap("<b></b>"),q=q.parent());l&&(q.wrap("<i></i>"),q=q.parent());t&&(q.wrap("<u></u>"),q=q.parent());m&&(q.wrap("<font></font>"),q=q.parent(),q.attr("color",m));e.append(q)});return a.prop("outerHTML")};this.initFromHtml=function(a,d){f=[];a=$(a);var e=a.text()?a.text():"";a=a.children("p");if(0!=e.length&&0<a.length)for(e=0;e<a.length;e++){var r=new Ba,l=$(a[e]),m=l.attr("align");m&&r.setAlign(m);if((l=l.contents())&&0!=l.length)for(m=0;m<l.length;m++)w($(l[m]),
r,d,!1,!1,!1,null);else l=new aa,r.addContent(l),d&&d(r,l);c.addParagraph(r)}0==f.length&&(r=c.insertParagraph(0),r.insertContent(0,new aa))};this.getAllTextLength=function(a){var d=0;n(a,function(e,r,l,m){d+=m.getTextLength();a&&(e==a.getFromParagraphIndex()&&l==a.getFromContentIndex()&&(d-=a.getFromOffset()),e==a.getToParagraphIndex()&&l==a.getToContentIndex()&&(d-=m.getTextLength()-a.getToOffset()))});return d};this.getScope=function(a){var d=[0,0];if(a){var e=0,r=0;n(null,function(l,m,q,t){l==
a.getFromParagraphIndex()&&q==a.getFromContentIndex()&&(d[0]=e+a.getFromOffset(),r++);l==a.getToParagraphIndex()&&q==a.getToContentIndex()&&(d[1]=e+a.getToOffset(),r++);e+=t.getTextLength();return 2<=r})}return d};this.inputText=function(a,d,e){!a.isCollapse()&&b(a);var r=a.getFromParagraphIndex(),l=a.getFromParagraphIndex(),m=a.getFromContentIndex(),q=a.getFromOffset();a=f[l];var t=a.getContent(m),B=t.getText();t.setText(B.substring(0,q));var y=new aa;y.setText(B.substring(q));y.brushStyleBy(t);
a.insertContent(m+1,y);m++;q=0;B=d.length;for(y=0;y<B;y++){var N=d[y];Ua.cleanInvalidChar(N,function(v){N=v});q=new aa;q.setText(N);q.brushStyleBy(t);e&&e.applyTo(q);a=f[l];a.insertContent(m,q);q=N.length;a=new va(new da(l,m,q));y<B-1&&(h(a),l++,q=m=0)}a=new va(new da(l,m,q));k(r,l,a);return a};this.inputCommand=function(a,d){var e=!a.isCollapse(),r=a.getFromParagraphIndex(),l=r,m=r;switch(d){case 13:h(a);e&&b(a);var q=new da(r+1,0,0);m=r+1;break;case 8:if(e)b(a);else{q=a;l=q.getFromParagraphIndex();
m=q.getFromContentIndex();q=q.getFromOffset();d=f[l];if(0==q)if(0==m){if(0!=l){var t=f[l-1];f.splice(l,1);l--;m=t.getContentCount()-1;q=t.getContent(m).getTextLength();for(var B=0;B<d.getContentCount();B++)e=d.getContent(B),t.addContent(e)}}else q=d.getContent(m-1),t=q.getText(),q.setText(t.substring(0,t.length-1)),m--,q=q.getTextLength();else e=d.getContent(m),t=e.getText(),e.setText(t.substring(0,q-1)+t.substring(q)),q--,0==q&&0<m&&(m--,q=d.getContent(m).getTextLength());q=new da(l,m,q);m=l=q.getParagraphIndex()}break;
case 46:if(e)b(a);else{e=a;d=e.getFromParagraphIndex();t=e.getFromContentIndex();B=e.getFromOffset();e=f[d];var y=e.getContent(t);if(B==y.getTextLength())if(t==e.getContentCount()-1){if(d!=f.length-1){t=f[d+1];for(B=0;B<t.getContentCount();B++)e.addContent(t.getContent(B));f.splice(d+1,1)}}else d=e.getContent(t+1),1<d.getTextLength()?d.setText(d.getText().substring(1)):e.removeContent(t+1);else d=y.getText(),y.setText(d.substring(0,B)+d.substring(B+1))}}q||(q=new da(r,a.getFromContentIndex(),a.getFromOffset()));
a=new va(q);k(l,m,a);return a};this.changeParagraphStyle=function(a,d){for(var e=a.getFromParagraphIndex();e<=a.getToParagraphIndex();e++)d(f[e])};this.changeContentStyle=function(a,d){for(var e=a.getFromParagraphIndex(),r=a.getFromContentIndex(),l=a.getFromOffset(),m=a.getToParagraphIndex(),q=a.getToContentIndex(),t=a.getToOffset(),B=m;B>=e;B--){var y=f[B],N=y.getContentCount()-1;if(B==m){var v=y.getContent(q),D=v.getText();v.setText(D.substring(0,t));var K=new aa;K.setText(D.substring(t));K.brushStyleBy(v);
y.insertContent(q+1,K);N=q}D=0;B==e&&(v=y.getContent(r),D=v.getText(),v.setText(D.substring(l)),K=new aa,K.setText(D.substring(0,l)),K.brushStyleBy(v),y.insertContent(r,K),N++,D=r+1,a.updateStartPosition(r+1,0),e==m&&a.updateEndPosition(N,y.getContent(N).getTextLength()));for(;N>=D;N--)v=y.getContent(N),d(v)}k(e,m,a)};var h=function(a){var d=a.getToParagraphIndex(),e=f[d];d=c.insertParagraph(d+1);d.brushStyleBy(e);for(var r=e.getContentCount()-1;r>a.getToContentIndex();r--){var l=e.removeContent(r);
d.insertContent(0,l)}l=e.getContent(a.getToContentIndex());e=l.getText().substring(a.getToOffset());l.setText(l.getText().substring(0,a.getToOffset()));a=new aa;a.setText(e);a.brushStyleBy(l);d.insertContent(0,a)},b=function(a){if(a.isInsideOneParagraph()){var d=f[a.getFromParagraphIndex()];if(a.isInsideOneContent()){var e=d.getContent(a.getFromContentIndex());d=e.getText();e.setText(d.substring(0,a.getFromOffset())+d.substring(a.getToOffset()))}else for(e=d.getContent(a.getFromContentIndex()),e.setText(e.getText().substring(0,
a.getFromOffset())),e=d.getContent(a.getToContentIndex()),e.setText(e.getText().substring(a.getToOffset())),e=a.getToContentIndex()-1;e>a.getFromContentIndex();e--)d.removeContent(e)}else{d=f[a.getFromParagraphIndex()];e=d.getContent(a.getFromContentIndex());e.setText(e.getText().substring(0,a.getFromOffset()));for(e=d.getContentCount()-1;e>a.getFromContentIndex();e--)d.removeContent(e);var r=f[a.getToParagraphIndex()];e=r.getContent(a.getToContentIndex());e.setText(e.getText().substring(a.getToOffset()));
for(e=a.getToContentIndex()-1;0<=e;e--)r.removeContent(e);f.splice(a.getFromParagraphIndex()+1,a.getToParagraphIndex()-a.getFromParagraphIndex());for(e=0;e<r.getContentCount();e++)d.addContent(r.getContent(e))}},k=function(a,d,e){for(;d>=a;d--)for(var r=f[d],l=null,m=r.getContentCount()-1;0<=m;m--){var q=r.getContent(m);if(q.isTextEmpty()&&1<r.getContentCount()){r.removeContent(m);if(d==e.getFromParagraphIndex())if(m<e.getFromContentIndex())e.updateStartPosition(e.getFromContentIndex()-1);else if(m==
e.getFromContentIndex()){q=0==m?0:m-1;var t=0==m?0:r.getContent(m-1).getTextLength();e.updateStartPosition(q,t)}d==e.getToParagraphIndex()&&(m<e.getToContentIndex()?e.updateEndPosition(e.getToContentIndex()-1):m==e.getToContentIndex()&&(q=0==m?0:m-1,t=0==m?0:r.getContent(m-1).getTextLength(),e.updateEndPosition(q,t)))}else l&&q.isStyleDuplicated(l)&&(t=q.getTextLength(),q.setText(q.getText()+l.getText()),l=m+1,r.removeContent(l),d==e.getFromParagraphIndex()&&(l<e.getFromContentIndex()?e.updateStartPosition(e.getFromContentIndex()-
1):l==e.getFromContentIndex()&&e.updateStartPosition(e.getFromContentIndex()-1,t+e.getFromOffset())),d==e.getToParagraphIndex()&&(l<e.getToContentIndex()?e.updateEndPosition(e.getToContentIndex()-1):l==e.getToContentIndex()&&e.updateEndPosition(e.getToContentIndex()-1,t+e.getToOffset()))),l=q}},n=function(a,d,e){for(var r=a?a.getFromParagraphIndex():0,l=a?a.getToParagraphIndex():f.length-1,m=r;m<=l;m++){m>r&&e&&e();for(var q=f[m],t=a&&m==r?a.getFromContentIndex():0,B=a&&m==l?a.getToContentIndex():
q.getContentCount()-1;t<=B;t++){var y=q.getContent(t);if(d(m,q,t,y))return}}},w=function(a,d,e,r,l,m,q){var t=a?a.prop("tagName"):"";r=r||"B"==t;l=l||"I"==t;m=m||"U"==t;"FONT"==t&&(q=a.attr("color"));if("B"==t||"I"==t||"U"==t||"FONT"==t)if((a=a.contents())&&0!=a.length)for(t=0;t<a.length;t++)w($(a[t]),d,e,r,l,m,q);else r=p(r,l,m,q,""),d.addContent(r),e&&e(d,r);else a=a?a.text():"",a=a.replace(/[\r\n]/g,""),r=p(r,l,m,q,a),d.addContent(r),e&&e(d,r)},p=function(a,d,e,r,l){var m=new aa;m.setText(l);m.setBold(a);
m.setItalic(d);m.setUnderLine(e);r&&m.setColor(r);return m}}function Ba(){var c=this,f=[],h="left",b=1.5,k=0,n=0,w=0;this.getContentCount=function(){return f.length};this.getContent=function(p){return f[p]};this.removeContent=function(p){return f.splice(p,1)[0]};this.addContent=function(p){f.push(p)};this.insertContent=function(p,a){f.splice(p,0,a)};this.isTextEmpty=function(){for(var p=0;p<f.length;p++)if(!f[p].isTextEmpty())return!1;return!0};this.clone=function(){var p=new Ba;p.brushStyleBy(c);
for(var a=0;a<f.length;a++){var d=f[a].clone();p.addContent(d)}return p};this.brushStyleBy=function(p){h=p.getAlign();b=p.getLineHeight();k=p.getMarginBefore();n=p.getMarginAfter();w=p.getIndent()};this.getMaxFontSize=function(){for(var p=0,a=0;a<f.length;a++)p=Math.max(p,f[a].getFontSize());return p};this.getAlign=function(){return h};this.setAlign=function(p){h=p};this.getLineHeight=function(){return b};this.setLineHeight=function(p){b=p};this.getMarginBefore=function(){return k};this.setMarginBefore=
function(p){k=p};this.getMarginAfter=function(){return n};this.setMarginAfter=function(p){n=p};this.getIndent=function(){return w};this.setIndent=function(p){w=p}}function aa(){var c=this,f="",h,b=12,k=!1,n=!1,w=!1,p,a;this.getText=function(){return f};this.setText=function(d){f=d};this.getTextLength=function(){return f.length};this.isTextEmpty=function(){return f?!1:!0};this.clone=function(){var d=new aa;d.setText(f);d.brushStyleBy(c);return d};this.brushStyleBy=function(d){h=d.getFontName();b=d.getFontSize();
k=d.isBold();n=d.isItalic();p=d.getColor();w=d.isUnderLine()};this.isStyleDuplicated=function(d){return h==d.getFontName()&&b==d.getFontSize()&&k==d.isBold()&&n==d.isItalic()&&p==d.getColor()&&w==d.isUnderLine()};this.getFontName=function(){return h};this.setFontName=function(d){h=d};this.getFontSize=function(){return b};this.setFontSize=function(d){b=d};this.isBold=function(){return k};this.setBold=function(d){k=d};this.isItalic=function(){return n};this.setItalic=function(d){n=d};this.isUnderLine=
function(){return w};this.setUnderLine=function(d){w=d};this.getColor=function(){return p};this.setColor=function(d){p=d};this.hookUiCustomDecorator=function(d){a=d};this.uiCustomDecorating=function(d){a&&a(d)}}function Ka(){aa.call(this);var c=this;this.applyTo=function(f){void 0!==c.getFontName()&&f.setFontName(c.getFontName());void 0!==c.getFontSize()&&f.setFontSize(c.getFontSize());void 0!==c.isBold()&&f.setBold(c.isBold());void 0!==c.isItalic()&&f.setItalic(c.isItalic());void 0!==c.getColor()&&
f.setColor(c.getColor())}}function da(c,f,h){var b=f,k=h;this.getParagraphIndex=function(){return c};this.getContentIndex=function(){return b};this.getOffset=function(){return k};this.update=function(n,w){b=n;"number"==typeof w&&(k=w)};this.toString=function(){return c+","+b+","+k}}function va(c,f){var h=this,b=f?f:new da(c.getParagraphIndex(),c.getContentIndex(),c.getOffset());this.isInsideOneParagraph=function(){return c.getParagraphIndex()==b.getParagraphIndex()};this.isInsideOneContent=function(){return h.isInsideOneParagraph()&&
c.getContentIndex()==b.getContentIndex()};this.isCollapse=function(){return h.isInsideOneContent()&&c.getOffset()==b.getOffset()};this.getFromParagraphIndex=function(){return c.getParagraphIndex()};this.getToParagraphIndex=function(){return b.getParagraphIndex()};this.getFromContentIndex=function(){return c.getContentIndex()};this.getToContentIndex=function(){return b.getContentIndex()};this.getFromOffset=function(){return c.getOffset()};this.getToOffset=function(){return b.getOffset()};this.updateStartPosition=
function(k,n){c.update(k,n)};this.updateEndPosition=function(k,n){b.update(k,n)};this.toString=function(){return c.toString()+"~"+b.toString()}}function hb(){var c=RegExp("\u21b5","gm"),f=this,h,b,k="#333333",n="transparent";this.getJqUi=function(){b||(b=$("<div>"),b.css("padding","4px 6px"),b.css("overflow-x","hidden"),b.css("overflow-y","auto"),b.css("white-space","pre-wrap"),h&&w());return b};this.setModel=function(p){h=p;b&&w()};this.setDefaultColor=function(p){k=p;f.refresh()};this.getDefaultColor=
function(){return k};this.setOccupierColor=function(p){n=p;b&&b.find(".occupier").css("color",n)};this.refresh=function(){h&&b&&w()};this.searchJqUiOfParagraphs=function(){return f.getJqUi().children(".paragraph")};this.searchJqUiOfContents=function(p){return p?p.children(".content"):f.getJqUi().find(".content")};this.searchJqUiOfContent=function(p,a){p=".paragraph:eq(#1) .content:eq(#2)".replace("#1",p).replace("#2",a);return f.getJqUi().find(p)};this.searchHtmlUiOfText=function(p){p=p[0];var a=
p.childNodes;return a&&0<a.length?(p=a[0],[p,p.length]):[p,0]};this.searchText=function(){var p=f.getJqUi().text();return p=p.replace(c,"")};this.upwardSearchOccupier=function(p){for(p=$(p);!p.hasClass("occupier");)if(p=p.parent(),0==p.length||p[0]==b[0]||p[0]==document.body)return null;return p};this.searchOccupierInstead=function(p){return f.searchJqUiOfContents($(p).parent())[0]};var w=function(){for(var p=$(document.createDocumentFragment()),a=0;a<h.getParagraphCount();a++){var d=h.getParagraph(a),
e=0<a?h.getParagraph(a-1):null,r=$("<div>");r.addClass("paragraph");r.appendTo(p);var l=r,m=d;e=e?e.getMarginAfter():0;l.css("text-align",m.getAlign());l.css("line-height",m.getLineHeight()+"em");l.css("margin-top",e+m.getMarginBefore()+"px");l.css("margin-bottom",m.getMarginAfter()+"px");l.css("text-indent",m.getIndent()+"em");l.css("font-size",m.getMaxFontSize()+"px");for(l=0;l<d.getContentCount();l++){m=d.getContent(l);e=$("<span>");e.addClass("content");e.text(m.getText());e.appendTo(r);var q=
e,t=m;q.css("font-family",t.getFontName()?t.getFontName():"");q.css("font-size",t.getFontSize()+"px");t.isBold()&&q.css("font-weight","bold");t.isItalic()&&q.css("font-style","italic");t.getColor()&&q.css("color",t.getColor());t.isUnderLine()&&q.css("text-decoration","underline");m.uiCustomDecorating(e)}d.isTextEmpty()&&(d=$("<span>"),d.addClass("occupier"),d.text("\u21b5"),d.css("font-size","8px"),d.css("color",n),d.appendTo(r))}b.empty();b.append(p);b.css("color",k)}}function ib(){var c,f,h,b,k,
n,w,p,a,d,e,r;this.hookDefaultColorGetter=function(v){c=v};this.getJqUi=function(){if(!k){n=q("rich-bold",I.get("bold","\u52a0\u7c97"));w=t("rich-italic",I.get("italic","\u659c\u4f53"));r=N("rich-underline",I.get("underline","\u4e0b\u5212\u7ebf"));p=y("rich-color",I.get("color","\u5b57\u4f53\u989c\u8272"));a=B("left","rich-left",I.get("alignLeft","\u5de6\u5bf9\u9f50"));d=B("center","rich-center",I.get("alignCenter","\u5c45\u4e2d"));e=B("right","rich-right",I.get("alignRight","\u53f3\u5bf9\u9f50"));
k=$("<div>");var v=l(n,4,20);v=l(w,v,20);v=l(r,v,20);v=l(p,v,32);v=l(a,v,20);v=l(d,v,20);l(e,v,20);v=new ta(I.get("clear","\u6e05\u7a7a"));v.addActionListener(b);v=v.getJqUi();F.layoutCtrlWithLRTB(v,null,4,40,2,null,24);k.append(v)}return k};this.updateState=function(v,D){n.setSelected(D.isBold());w.setSelected(D.isItalic());p.setSelectedModel(D.getColor());r.setSelected(D.isUnderLine());a.setSelected("left"==v.getAlign());d.setSelected("center"==v.getAlign());e.setSelected("right"==v.getAlign())};
this.setStyleModifyListener=function(v,D){f=v;h=D};this.setClearTextListener=function(v){b=v};var l=function(v,D,K){k.append(v.getJqUi());F.layoutCtrl(v.getJqUi(),D,4,K,20);return D+K+8},m=function(v,D){var K=new La,C=K.getJqUi();C.attr("title",D);D=$("<div>");Va.background(D,v);D.appendTo(C);F.layoutCtrlCenterAlign(D,16);F.layoutCtrlMiddleAlign(D,16);return K},q=function(v,D){v=m(v,D);v.addActionListener(function(K){var C=K.isSelected();h(function(A){A.setBold(C)})});return v},t=function(v,D){v=
m(v,D);v.addActionListener(function(K){var C=K.isSelected();h(function(A){A.setItalic(C)})});return v},B=function(v,D,K){D=m(D,K);D.addActionListener(function(C){C.isSelected()?(a.setSelected(!1),d.setSelected(!1),e.setSelected(!1),C.setSelected(!0),f(function(A){A.setAlign(v)})):(C.setSelected(!0),f(null))});return D},y=function(v,D){var K=new Ma;K.setCustomPainter(function(C,A){var G=A.data("myColorUi");G||(A.css("left",0),A.css("right",12),A.next().css("right",0),A.css("overflow","visible"),G=
$("<div>"),Va.background(G,v),G.appendTo(A),F.layoutCtrl(G,2,0,16,16),G=$("<div>"),G.css("border","1px solid #f0f0f0"),G.appendTo(A),F.layoutCtrl(G,2,11,14,4),A.data("myColorUi",G));G.css("background-color",C?C:c())});K.setDropdownCreator(function(C,A,G,M){M=new jb;M.setColorConfirmedListener(function(S){G(S)});A=M.createJqUi(A,I.get("systemDefault","\u7cfb\u7edf\u9ed8\u8ba4"));A.appendTo(C);return[A.outerWidth(),A.outerHeight()]});K.addSelectionListener(function(C,A){A&&h(function(G){var M=C.getSelectedModel();
G.setColor(M)})});K.getJqUi().attr("title",D);return K},N=function(v,D){v=m(v,D);v.addActionListener(function(K){var C=K.isSelected();h(function(A){A.setUnderLine(C)})});return v}}function jb(){var c=["#ffffff #000000 #1f497d #c0504d #9bbb59 #8064a2 #4bacc6 #f79646".split(" "),"#f2f2f2 #7f7f7f #c6d9f0 #f2dcdb #ebf1dd #e5e0ec #dbeef3 #fdeada".split(" "),"#d8d8d8 #595959 #8db3e2 #e5b9b7 #d7e3bc #ccc1d9 #b7dde8 #fbd5b5".split(" "),"#bfbfbf #3f3f3f #548dd4 #d99694 #c3d69b #b2a2c7 #92cddc #fac08f".split(" "),
"#a5a5a5 #262626 #17365d #953734 #76923c #5f497a #31859b #e36c09".split(" "),"#7f7f7f #0c0c0c #0f243e #632423 #4f6128 #3f3151 #205867 #974806".split(" "),"#c00000 #ff0000 #ffc000 #ffff00 #92d050 #00b050 #00b0f0 #7030a0".split(" ")],f;this.setColorConfirmedListener=function(h){f=h};this.createJqUi=function(h,b){var k=new La;k.setText(b);k.addActionListener(function(n){n.setSelected(!0);f(null)});b=k.getJqUi();b.css("line-height","18px");h?b.css("border","1px solid #dbdbdb"):(k.setSelected(!0),h="#808080");
k=new Wa;k.setColorPool(c);k.getModel().decodeFrom(h);k.addSelectedListener(function(n){n=n.encodeToHexRgb();f(n)});h=k.createJqUi();k=$("<div>");k.append(b);k.append(h);F.layoutCtrlWithLRTB(b,6,6,null,8,null,20);F.layoutCtrlWithLRTB(h,0,0,null,28,0,null);k.css("background-color","#fff");k.css("width",h.outerWidth());k.css("height",h.outerHeight()+28);return k}}function kb(){var c,f=$("<div>"),h=$("<div>");this.getJqUi=function(){c||(f.css({color:"#bbb"}),h.css({color:"#bbb","text-align":"right"}),
c=$("<div>"),c.append(f),c.append(h),F.layoutCtrlWithLRTB(f,4,"50%",null,0,0,null),F.layoutCtrlWithLRTB(h,"50%",4,null,0,0,null));return c};this.setCursorPosition=function(k,n){var w="";if(n){var p=I.get("statusCursor","\u6bb5\u843d#1, \u5b57\u7b26#2"),a=n.getFromParagraphIndex(),d=b(k,a,n.getFromContentIndex(),n.getFromOffset());w=p.replace("#1",a+1).replace("#2",d+1);n.isCollapse()||(a=n.getToParagraphIndex(),d=b(k,a,n.getToContentIndex(),n.getToOffset()),w=w+"~"+p.replace("#1",a+1).replace("#2",
d+1))}f.text(w)};this.setInputableCharacterCount=function(k){var n=I.get("statusRemainChar","\u8fd8\u53ef\u4ee5\u8f93\u5165#1\u5b57");n=n.replace("#1",k);h.text(n)};this.warningMaxCharacters=function(k){var n=$("<div>");n.css("background-color","#fff");var w=$("<div>");w.text(I.get("statusWarningMaxChar","\u5b57\u6570\u8d85\u8fc7#1\u5b57\u4e0a\u9650").replace("#1",k));w.css("color","#930");F.layoutCtrlWithLRTB(n,0,0,null,0,0,null);F.layoutCtrlWithLRTB(w,0,0,null,0,0,null);n.append(w);c.append(n);
k=new Xa;k.setDuration(850,150);k.setAction(function(){n.remove()});k.blink(w)};var b=function(k,n,w,p){k=k.getParagraph(n);for(n=0;n<w;n++)p+=k.getContent(n).getTextLength();return p}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.extreport&&(com.kingdee.bos.extreport={});"undefined"==typeof com.kingdee.bos.extreport.common&&(com.kingdee.bos.extreport.common={});var ba=
com.kingdee.bos.extreport.common;ba.RichEditor=function(){var c=String.fromCharCode(13),f=String.fromCharCode(10),h=c+f,b=new RegExp(c,"gm"),k=new RegExp(h,"gm"),n,w,p,a,d,e=1E3,r,l,m,q;this.setChapterModifyListener=function(g){q=g};this.setMaxCharacters=function(g){e=g};this.setStyleInitializer=function(g){};this.setModel=function(g){n=g;y().setModel(g);Ca()};this.setDefaultColor=function(g){y().setDefaultColor(g)};this.setBackgroundColor=function(g){!g&&(g="#fff");var u=Na.decodeStringToRgbaArray(g),
x=Na.rgbToHsl(u[0],u[1],u[2]);u=x[0];x=x[2];30<u&&190>u?(u=40<x?"#000":"#fff",x=40<x?"#333":"#ccc"):(u=70<x?"#000":"#fff",x=70<x?"#333":"#ccc");y().setOccupierColor(x);y().getJqUi().css({"background-color":g,"caret-color":u})};this.getJqUi=function(){if(!w){var g=t().getJqUi();t().updateState(n.getParagraph(0),n.getParagraph(0).getContent(0));g.css("border","1px solid #ccc");var u=y().getJqUi();u.css("border","1px solid #ccc");u.css("outline","none");var x=B().getJqUi();0>Math.max(0,e-r.length)+0-
0&&B().warningMaxCharacters(e);w=$("<div>");w.append(g);w.append(u);w.append(x);F.layoutCtrlWithLRTB(g,0,0,null,0,null,30);F.layoutCtrlWithLRTB(u,0,0,null,30,24,null);F.layoutCtrlWithLRTB(x,0,0,null,null,0,24)}return w};this.requestFocus=function(){y().getJqUi().focus();if(l)ka(l);else{var g=n.getParagraphCount()-1,u=n.getParagraph(g),x=u.getContentCount()-1;u=u.getContent(x).getTextLength();g=new da(g,x,u);ka(new va(g));D()}};this.getSelectingScope=function(){return n.getScope(l)};var t=function(){a||
(a=new ib,a.hookDefaultColorGetter(y().getDefaultColor),a.setStyleModifyListener(function(g){if(l){var u=g?!0:!1;u&&n.changeParagraphStyle(l,g);wa(u)}},function(g){if(l){var u=g?!0:!1;if(u)if(l.isCollapse()){var x=n.getParagraph(l.getFromParagraphIndex()).getContent(l.getFromContentIndex());x.isTextEmpty()?g(x):(!m&&(m=Ka.create()),g(m))}else n.changeContentStyle(l,g);wa(u)}}),a.setClearTextListener(M));return a},B=function(){d||(d=new kb);return d},y=function(){if(!p){p=new hb;var g=p.getJqUi();
g.attr("contenteditable",!0);g.on("compositionstart",ca);g.on("compositionend",T);g.on("keydown",G);g.on("keyup",S);g.on("mousedown",N);g.on("paste",K);g.on("cut",C);g.on("copy",A)}return p},N=function(g){g.shiftKey||window.getSelection().removeAllRanges();g=$(document.body);g.on("mouseup",v);g.on("mouseleave",v)},v=function(g){g=$(document.body);g.off("mouseup",v);g.off("mouseleave",v);D()},D=function(){m=null;var g=window.getSelection(),u=g.anchorNode,x=g.anchorOffset,H=g.focusNode,P=g.focusOffset;
if(u&&H){g=u==H;var X=!1,W=y().upwardSearchOccupier(u);if(W){X=!0;var ea=W.siblings();u=0==ea.length?W.parent()[0]:ea[0];x=0;g&&(H=u,P=0)}!g&&(W=y().upwardSearchOccupier(H))&&(X=!0,ea=W.siblings(),H=0==ea.length?W.parent()[0]:ea[0],P=0);g&&X&&la(u,x,H,P);P=[u,x,H,P];u=P[0];x=P[1];H=P[2];P=P[3];X=y().searchJqUiOfParagraphs();for(W=0;W<X.length;W++){ea=X.eq(W);ea=y().searchJqUiOfContents(ea);for(var xa=0;xa<ea.length;xa++){var pa=ea.eq(xa),qa=y().searchHtmlUiOfText(pa)[0];pa=Da(qa,u);qa=g?pa:Da(qa,
H);if(!O&&(pa||qa)){var Oa=g?Math.min(x,P):pa?x:P;var O=new da(W,xa,Oa);if(!g)continue}if(O&&!fa&&(pa||qa)){Oa=g?Math.max(x,P):qa?P:x;var fa=new da(W,xa,Oa);break}}}!O&&(O=ra());!fa&&(fa=ra());O=new va(O,fa)}else O=null;O&&(O.isCollapse()?0==O.getFromOffset()&&0<O.getFromContentIndex()&&(fa=O.getFromContentIndex()-1,g=n.getParagraph(O.getFromParagraphIndex()),H=g.getContent(fa),g=H.getTextLength(),O.updateStartPosition(fa,g),O.updateEndPosition(fa,g)):(g=n.getParagraph(O.getFromParagraphIndex()),
H=g.getContent(O.getFromContentIndex()),O.getFromOffset()==H.getTextLength()&&O.getFromContentIndex()<g.getContentCount()-1&&O.updateStartPosition(O.getFromContentIndex()+1,0),0==O.getToOffset()&&0<O.getToContentIndex()&&(g=n.getParagraph(O.getToParagraphIndex()),H=g.getContent(O.getToContentIndex()-1),O.updateEndPosition(O.getToContentIndex()-1,H.getTextLength()))),l=O,O=n.getParagraph(l.getFromParagraphIndex()),fa=O.getContent(l.getFromContentIndex()),t().updateState(O,fa),B().setCursorPosition(n,
l))},K=function(g){g.preventDefault();g=(g.originalEvent.clipboardData||window.clipboardData).getData("Text");g=g.replace(k,f);g=g.replace(b,f);g=g.split(f);ya(g)},C=function(g){g.preventDefault();l.isCollapse()||(z(g),ya([""]))},A=function(g){g.preventDefault();l.isCollapse()||z(g)},G=function(g){13==g.keyCode||8==g.keyCode||46==g.keyCode?(g.preventDefault(),g=n.inputCommand(l,g.keyCode),za(g),D()):g.ctrlKey&&65==g.keyCode&&(g.preventDefault(),sa(),D())},M=function(){sa();D();var g=n.inputCommand(l,
46);za(g);D()},S=function(g){V||(33<=g.keyCode&&40>=g.keyCode?D():ma())},V=!1,ca=function(g){V=!0},T=function(g){V=!1;ma()},ma=function(){var g=y().searchText();if(g!==r){for(var u=Math.min(r.length,g.length),x=u,H=0;H<u;H++)if(r[H]!==g[H]){x=H;break}H=g.length-(u-x);for(var P=u;P>x;P--){var X=u-P;if(r[r.length-1-X]!==g[g.length-1-X]){H=g.length-X;break}}g=g.substring(x,H);ya([g])}},ya=function(g){var u=g.join("").length,x=l.isCollapse()?0:n.getAllTextLength(l);0>Math.max(0,e-r.length)+x-u?(y().refresh(),
ka(l),B().warningMaxCharacters(e)):(g=n.inputText(l,g,m),za(g),D())},za=function(g){y().refresh();Ca();ka(g);q&&q(n)},wa=function(g){g&&y().refresh();ka(l);q&&q(n)},Ca=function(){r=y().searchText();B().setInputableCharacterCount(Math.max(0,e-r.length))},ra=function(){var g=n.getParagraphCount()-1,u=n.getParagraph(g),x=u.getContentCount()-1;u=u.getContent(x).getTextLength();return new da(g,x,u)},Da=function(g,u){for(var x=y().getJqUi()[0];g!=u;)if(g=g.parentNode,g==x||g==document.body)return!1;return!0},
ka=function(g){var u=g.getFromParagraphIndex(),x=g.getFromContentIndex(),H=g.getFromOffset();u=y().searchJqUiOfContent(u,x);u=y().searchHtmlUiOfText(u)[0];x=g.getToParagraphIndex();var P=g.getToContentIndex();g=g.getToOffset();P=y().searchJqUiOfContent(x,P);var X=y().searchHtmlUiOfText(P),W=X[1];la(u,H,X[0],g);H=Math.max(n.getParagraph(x).getMaxFontSize(),P.prop("offsetHeight"));u=0==W?1:g/W;H=P.prop("offsetTop")+parseInt(H*u);u=y().getJqUi();x=u.prop("scrollTop");g=x+u.prop("clientHeight");if(H<
x||H>g)g=x+parseInt(.5*u.prop("clientHeight")),u.prop("scrollTop",x+(H-g))},sa=function(){var g=y().searchJqUiOfContents(),u=y().searchHtmlUiOfText(g.eq(0));g=y().searchHtmlUiOfText(g.eq(g.length-1));la(u[0],0,g[0],g[1])},la=function(g,u,x,H){var P=document.createRange();P.setStart(g,u);P.setEnd(x,H);g=window.getSelection();g.removeAllRanges();g.addRange(P)},z=function(g){(g.originalEvent.clipboardData||window.clipboardData).setData("Text",n.getAllText(h,l))}};ba.Chapter=oa;ba.FormulaEditorDialog=
function(){Ya.call(this);var c=this,f=this.protectedMethod,h=new gb,b;(function(){c.setSize(762,594);f.setTitle(I.get("expressionDefinition","\u8868\u8fbe\u5f0f\u5b9a\u4e49"));f.setSelectable(!0);f.setContentPaneCreator(function(){return h.getJqUi()});f.setClosingChecker2(function(k){k=h.getSyntaxState();if(1===k)return k=I.get("hasSyntaxError","\u8868\u8fbe\u5f0f\u5b58\u5728\u8bed\u6cd5\u9519\u8bef\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002"),f.getMessageCurtain().showPrompt(k),!1;if(0===k)return k=
I.get("executingExp","\u6b63\u5728\u6267\u884c\u51fd\u6570\u8868\u8fbe\u5f0f\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5\u3002"),f.getMessageCurtain().showPrompt(k),!1;b&&b(h.getFormula());return!0},function(k){f.destroy();return!0});f.setClosingAction(function(k){})})();this.setTitle=function(k){f.setTitle(k)};this.setFunction=function(k){h.setFunction(k)};this.setFunClosingAction=function(k){b=k};this.setFormula=function(k){h.setFormula(k)};this.setSyntaxValidator=function(k){h.setSyntaxValidator(k)}};
ba.Function=function(){var c,f,h,b,k,n;this.getTypeName=function(){return c};this.getFuncName=function(){return f};this.getData=function(){return h};this.getTip=function(){return b};this.getExample=function(){return k};this.getHasParam=function(){return n};this.fromJsonObject=function(w){c=w.typeName;f=w.funcName;h=w.data;b=w.tip;k=w.example;n=w.isMethodWithParam}};ba.RelativeDateSelector=function(){var c,f,h=[U.DAY,U.WEEK,U.MONTH,U.SEASON,U.YEAR],b=!0,k=!0,n=!0,w=!1,p=!1,a,d=na.FRONT,e=0,r=U.DAY,
l=ia.FIRST_DAY,m="getSystemTime()",q,t,B,y,N,v,D,K,C,A,G,M,S,V,ca=new Ia,T=30,ma=10;this.getTimeSettingForSys=function(){return"getSystemTime()"};this.getCtrlHeight=function(){return T};this.setCtrlHeight=function(z){T=z};this.getCtrlGap=function(){return ma};this.setCtrlGap=function(z){ma=z};this.getHeight=function(){var z=0;f&&(z+=T);n&&(z+=2*T+ma);return z};this.setSupportUnitType=function(z){h=z;b&&B&&(B.setItemModels(h),-1==h.indexOf(r)&&(r=h[h.length-1],B.setSelected(r)))};this.setSupportUnitTypeSetting=
function(z){b=z;wa()};this.setSupportDaySetting=function(z){k=z;ra()};this.setShowTimeSetting=function(z){n=z;sa()};this.setDirection=function(z){d=z;f&&f.setSelected(d)};this.setOffset=function(z){e=z;q&&q.setValue(e)};this.setUnit=function(z){r=z;b&&B&&B.setSelected(r)};this.setDay=function(z){l=z;k&&N&&N.setSelected(l)};this.setTime=function(z){m=z;sa()};this.getSettingValue=function(){return[d,e,r,k?l:null,n?m:null]};this.setChangedListener=function(z){a=z};this.getJqUi=function(){if(!c){c=$("<div>");
var z=0;ya();c.append(M);F.layoutCtrl(M,z,null,70,T);z+=75;za();c.append(S);F.layoutCtrl(S,z,null,70,T);z+=75;A=$("<div>");wa();F.layoutCtrl(A,z,null,70,T);c.append(A);z+=75;y=$("<div>");ra();F.layoutCtrl(y,z,null,null,T);c.append(y);G=$("<div>");sa();c.append(G);F.layoutCtrl(G,null,ma+T,null,T)}return c};var ya=function(){M=$("<div>");f=new Ea;f.setItemModels([na.FRONT,na.BEHIND]);f.setCustomPainter(function(g,u,x){g=na.getTypeText(x);u.text(g)});f.addSelectedChangedListener(function(g,u,x){u!=x&&
(d=x,a&&a(d,e,r,l,m))});var z=f.getJqUi();F.layoutCtrl(z,null,null,70,T);M.append(z);f.setSelected(d)},za=function(){S=$("<div>");q=new Za;q.setValue(e);q.setConstraint(0,100,1);q.addValueChangedListener(function(g,u,x,H){u!=x&&(e=x,a&&a(d,e,r,l,m))});var z=q.getJqUi();S.append(z);F.layoutCtrl(z,null,null,70,T)},wa=function(){A&&(b?(V&&V.hide(),!t&&Ca(),t.show()):(t&&t.hide(),V||(V=$("<div>"),V.text(U.getTypeText(U.YEAR)),V.css({"line-height":"30px",color:"rgb(102, 102, 102)"}),F.layoutCtrl(V,null,
null,12,T),A.append(V)),V.show()))},Ca=function(){B=new Ea;B.setItemModels(h);B.setCustomPainter(function(z,g,u){g.text(U.getTypeText(u))});B.addSelectedChangedListener(function(z,g,u){g!=u&&(r=u,ra(),a&&a(d,e,r,l,m))});t=B.getJqUi();F.layoutCtrl(t,null,null,70,T);A.append(t);B.setSelected(r)},ra=function(){y&&(k&&r!=U.DAY?(!w&&Da(),y.show(),l||N.setSelected(ia.FIRST_DAY)):y.hide())},Da=function(){N=new Ea;N.setItemModels([ia.FIRST_DAY,ia.LAST_DAY]);N.setCustomPainter(function(g,u,x){g=ia.getTypeText(x);
u.text(g)});N.addSelectedChangedListener(function(g,u,x){u!=x&&(l=x,a&&a(d,e,r,l,m))});var z=N.getJqUi();F.layoutCtrl(z,null,null,80,T);y.append(z);N.setSelected(l);w=!0},ka=function(){var z=new $a;K=new Pa;z.addElement(K);var g=I.get("relativeTime","\u670d\u52a1\u7aef\u5f53\u524d\u65f6\u95f4");K.setText(g);K.addCheckedListener(function(H,P){H.isChecked()&&(m="getSystemTime()",a&&a(d,e,r,l,m))});ca.setFontSize(12,"Microsoft YaHei");var u=ca.measureWidth(g);g=K.getJqUi();F.layoutCtrl(g,null,null,u+
20,T);u=$("<div>");C=new ab;C.addSelectionListener(function(H){m=la(H.getHour())+":"+la(H.getMinute())+":"+la(H.getSecond());a&&a(d,e,r,l,m)});v=C.getJqUi();D=new Pa;var x=I.get("fixedTime","\u56fa\u5b9a\u65f6\u95f4");D.setText(x);z.addElement(D);D.addCheckedListener(function(H,P){H.isChecked()?v.show():v.hide()});z=D.getJqUi();u.append(z);u.append(v);x=ca.measureWidth(x)+20;F.layoutCtrl(z,null,null,x,T);F.layoutCtrl(v,x,null,100,T);F.layoutCtrl(u,null,T,null,T);G.append(g);G.append(u);p=!0},sa=function(){if(G&&
n)if(!p&&ka(),"getSystemTime()"==m)K.setChecked(!0),v.hide();else{var z=m.split(":"),g=parseInt(z[0]),u=parseInt(z[1]);z=parseInt(z[2]);C.setSelected(g,u,z);D.setChecked(!0)}},la=function(z){return(10>z?"0":"")+z}};ba.DateDropdownSelector=function(){var c,f,h,b,k=Y.YEAR_MONTH_DAY,n;this.getJqUi=function(){c||w();return c};var w=function(){c=$("<div>");f=new Ma;h=bb.getDropDownPanel(k);f.setIconName(Y.getIconName(k));f.setCustomPainter(function(a,d){a=h.formatDateText(a);d.text(a)});f.setDropdownCreator(h.getPanelCreator());
f.addSelectionListener(function(a,d){b=a.getSelectedModel();n&&n(b,d)});p();b&&f.setSelectedModel(b);c=f.getJqUi()};this.setDateChangedListener=function(a){n=a};this.setDateValue=function(a){b=a;p();f&&f.setSelectedModel(b)};this.setPatternType=function(a){Y.isValidType(a)&&(k=a)};this.changePatternType=function(a){if(Y.isValidType(a)){var d=k!=a;k=a;if(c&&d){if(a=bb.getDropDownPanel(k))d=a.fixDateValue(b),d!=b&&(b=d,n&&n(b,!1));h=a;f.setDropdownCreator(h.getPanelCreator());p();b&&f.setSelectedModel(b)}}};
var p=function(){if(h){var a=h.fixDateValue(b);a!=b&&(b=a,n&&n(b,!1))}}};var I,Ua,F,Na,cb,Ya,La,Ma,ta,Wa,Xa,Sa,Ta,Ha,ja,Ja,Ea,Za,$a,Pa,ab,Qa,Ia,Fa,Ga,Ra,ua;(function(){var c=com.kingdee.bos.qing.framework.common;I=c.MultilanguageManager.createPackageAccessor(ba);cb=c.AbstractIcons;c=com.kingdee.bos.qing.ui.component;La=c.ToggleButton;Ma=c.DropdownSelector;ta=c.WorkButton;Wa=c.ColorChooser;Ya=c.AbstractModalDialog;Sa=c.TextArea;Ta=c.SearchBox;Ha=c.List;ja=c.Label;Ja=c.Icons;Ea=c.ComboBox;Za=c.Spinner;
$a=c.RadioButtonGroup;Pa=c.RadioButton;ab=c.TimeSelector;Fa=c.Calendar;Ga=c.TimeList;Ra=c.DateOfYearMonthPanel;ua=c.DateOfYearQuarterPanel;c=com.kingdee.bos.qing.common;Ua=c.Util;F=c.DomUtil;Na=c.ColorUtil;Qa=c.DateFormater;Ia=c.TextMeasurer;c=com.kingdee.bos.qing.common.ui;Xa=c.BlinkHelper})();var Z={DATETIME:"yyyy-MM-dd HH:mm:ss",YEAR:"yyyy",YEAR_SEASON:"yyyy-'Q'q",YEAR_MONTH:"yyyy-MM",YEAR_MONTH_DAY:"yyyy-MM-dd",TIME:"HH:mm:ss",isTimeString:function(c){c=c?c.split(":"):[];if(3!=c.length)return!1;
var f=isNaN(c[0])?-1:parseInt(c[0]);if(0>f||23<f)return!1;f=isNaN(c[1])?-1:parseInt(c[1]);if(0>f||59<f)return!1;c=isNaN(c[2])?-1:parseInt(c[2]);return 0>c||59<c?!1:!0}};ba.DatePattern=Z;var Y={DATETIME:"DATETIME",YEAR:"YEAR",YEAR_SEASON:"YEAR_SEASON",YEAR_MONTH:"YEAR_MONTH",YEAR_MONTH_DAY:"YEAR_MONTH_DAY",TIME:"TIME",isValidType:function(c){return-1!=Object.values(Y).indexOf(c)},getIconName:function(c){return c==Y.TIME?"time":"calendar"}};ba.DatePatternType=Y;var bb=new function(){var c={},f=(c[Y.DATETIME]=
J,c[Y.YEAR_MONTH_DAY]=Q,c[Y.YEAR_MONTH]=R,c[Y.YEAR_SEASON]=ha,c[Y.YEAR]=Aa,c[Y.TIME]=eb,c);this.getDropDownPanel=function(h){var b;(h=f[h])&&(b=new h);return b}},ia={FIRST_DAY:"FIRST_DAY",LAST_DAY:"LAST_DAY",getTypeText:function(c){switch(c){case ia.FIRST_DAY:return I.get("firstDay","\u7b2c\u4e00\u5929");case ia.LAST_DAY:return I.get("lastDay","\u6700\u540e\u4e00\u5929");default:return""}}};ba.DateOffsetDayType=ia;var na={FRONT:"FRONT",BEHIND:"BEHIND",getTypeText:function(c){switch(c){case na.FRONT:return I.get("front",
"\u524d");case na.BEHIND:return I.get("behind","\u540e");default:return""}}};ba.DateDirectionType=na;var U={YEAR:"YEAR",SEASON:"SEASON",MONTH:"MONTH",WEEK:"WEEK",DAY:"DAY",getTypeText:function(c){switch(c){case U.YEAR:return I.get("year","\u5e74");case U.SEASON:return I.get("season","\u5b63");case U.MONTH:return I.get("month","\u6708");case U.WEEK:return I.get("week","\u5468");case U.DAY:return I.get("day","\u65e5");default:return""}}};ba.DateUnitType=U;var Va=new function(){cb.call(this);var c=this.protectedMethod;
this.protectedInit=function(h,b){com.kingdee.bos.qing.common.ComboIcon.define(b,"rich");f(0,0,"rich-bold");f(0,1,"rich-italic");f(0,2,"rich-underline");f(0,3,"rich-strikethrough");f(0,4,"rich-color");f(1,0,"rich-left");f(1,1,"rich-center");f(1,2,"rich-right");f(1,3,"rich-justify");f(1,4,"rich-lineheight");f(1,5,"rich-marginbefore");f(1,6,"rich-marginafter");f(1,7,"rich-indent")};var f=function(h,b,k){c.registIcon(h,b,k)}};oa.create=function(c){var f=new oa,h=f.insertParagraph(0),b=new aa;h.insertContent(0,
b);c&&c(h,b);return f};oa.createParagraph=function(){return new Ba};oa.createContent=function(){return new aa};Ka.create=function(){var c=new Ka;c.setFontName(void 0);c.setFontSize(void 0);c.setBold(void 0);c.setItalic(void 0);c.setColor(void 0);return c}})();
//qingVersionTag: 20250415