|
|
this.THCEmrViewLib=function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=130)}([function(t,e,i){var n=i(2),o=i(18),r=i(11),s=i(12),a=i(19),l=function(t,e,i){var h,c,u,f,d=t&l.F,m=t&l.G,y=t&l.S,p=t&l.P,S=t&l.B,v=m?n:y?n[e]||(n[e]={}):(n[e]||{}).prototype,F=m?o:o[e]||(o[e]={}),I=F.prototype||(F.prototype={});for(h in m&&(i=e),i)u=((c=!d&&v&&void 0!==v[h])?v:i)[h],f=S&&c?a(u,n):p&&"function"==typeof u?a(Function.call,u):u,v&&s(v,h,u,t&l.U),F[h]!=u&&r(F,h,f),p&&I[h]!=u&&(I[h]=u)};n.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e,i){var n=i(4);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){var n=i(47)("wks"),o=i(33),r=i(2).Symbol,s="function"==typeof r;(t.exports=function(t){return n[t]||(n[t]=s&&r[t]||(s?r:o)("Symbol."+t))}).store=n},function(t,e,i){var n=i(21),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e,i){t.exports=!i(3)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,i){var n=i(1),o=i(94),r=i(23),s=Object.defineProperty;e.f=i(7)?Object.defineProperty:function(t,e,i){if(n(t),e=r(e,!0),n(i),o)try{return s(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var n=i(24);t.exports=function(t){return Object(n(t))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var n=i(8),o=i(32);t.exports=i(7)?function(t,e,i){return n.f(t,e,o(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var n=i(2),o=i(11),r=i(14),s=i(33)("src"),a=i(134),l=(""+a).split("toString");i(18).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,i,a){var h="function"==typeof i;h&&(r(i,"name")||o(i,"name",e)),t[e]!==i&&(h&&(r(i,s)||o(i,s,t[e]?""+t[e]:l.join(String(e)))),t===n?t[e]=i:a?t[e]?t[e]=i:o(t,e,i):(delete t[e],o(t,e,i)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[s]||a.call(this)}))},function(t,e,i){var n=i(0),o=i(3),r=i(24),s=/"/g,a=function(t,e,i,n){var o=String(r(t)),a="<"+e;return""!==i&&(a+=" "+i+'="'+String(n).replace(s,""")+'"'),a+">"+o+"</"+e+">"};t.exports=function(t,e){var i={};i[t]=e(a),n(n.P+n.F*o((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",i)}},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var n=i(48),o=i(24);t.exports=function(t){return n(o(t))}},function(t,e,i){var n=i(49),o=i(32),r=i(15),s=i(23),a=i(14),l=i(94),h=Object.getOwnPropertyDescriptor;e.f=i(7)?h:function(t,e){if(t=r(t),e=s(e,!0),l)try{return h(t,e)}catch(t){}if(a(t,e))return o(!n.f.call(t,e),t[e])}},function(t,e,i){var n=i(14),o=i(9),r=i(68)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),n(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e){var i=t.exports={version:"2.6.11"};"number"==typeof __e&&(__e=i)},function(t,e,i){var n=i(10);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,o){return t.call(e,i,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e){var i=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:i)(t)}},function(t,e,i){"use strict";var n=i(3);t.exports=function(t,e){return!!t&&n((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,i){var n=i(4);t.exports=function(t,e){if(!n(t))return t;var i,o;if(e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;if("function"==typeof(i=t.valueOf)&&!n(o=i.call(t)))return o;if(!e&&"function"==typeof(i=t.toString)&&!n(o=i.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var n=i(0),o=i(18),r=i(3);t.exports=function(t,e){var i=(o.Object||{})[t]||Object[t],s={};s[t]=e(i),n(n.S+n.F*r((function(){i(1)})),"Object",s)}},function(t,e,i){var n=i(19),o=i(48),r=i(9),s=i(6),a=i(84);t.exports=function(t,e){var i=1==t,l=2==t,h=3==t,c=4==t,u=6==t,f=5==t||u,d=e||a;return function(e,a,m){for(var y,p,S=r(e),v=o(S),F=n(a,m,3),I=s(v.length),g=0,w=i?d(e,I):l?d(e,0):void 0;I>g;g++)if((f||g in v)&&(p=F(y=v[g],g,S),t))if(i)w[g]=p;else if(p)switch(t){case 3:return!0;case 5:return y;case 6:return g;case 2:w.push(y)}else if(c)return!1;return u?-1:h||c?c:w}}},function(t,e,i){"use strict";if(i(7)){var n=i(29),o=i(2),r=i(3),s=i(0),a=i(62),l=i(92),h=i(19),c=i(39),u=i(32),f=i(11),d=i(41),m=i(21),y=i(6),p=i(122),S=i(35),v=i(23),F=i(14),I=i(44),g=i(4),w=i(9),C=i(81),k=i(36),P=i(17),D=i(37).f,b=i(83),R=i(33),_=i(5),x=i(26),A=i(52),T=i(51),O=i(86),N=i(46),B=i(57),E=i(38),M=i(85),L=i(111),G=i(8),H=i(16),U=G.f,V=H.f,W=o.RangeError,z=o.TypeError,j=o.Uint8Array,X=Array.prototype,K=l.ArrayBuffer,Y=l.DataView,J=x(0),Z=x(2),q=x(3),Q=x(4),$=x(5),tt=x(6),et=A(!0),it=A(!1),nt=O.values,ot=O.keys,rt=O.entries,st=X.lastIndexOf,at=X.reduce,lt=X.reduceRight,ht=X.join,ct=X.sort,ut=X.slice,ft=X.toString,dt=X.toLocaleString,mt=_("iterator"),yt=_("toStringTag"),pt=R("typed_constructor"),St=R("def_constructor"),vt=a.CONSTR,Ft=a.TYPED,It=a.VIEW,gt=x(1,(function(t,e){return Dt(T(t,t[St]),e)})),wt=r((function(){return 1===new j(new Uint16Array([1]).buffer)[0]})),Ct=!!j&&!!j.prototype.set&&r((function(){new j(1).set({})})),kt=function(t,e){var i=m(t);if(i<0||i%e)throw W("Wrong offset!");return i},Pt=function(t){if(g(t)&&Ft in t)return t;throw z(t+" is not a typed array!")},Dt=function(t,e){if(!g(t)||!(pt in t))throw z("It is not a typed array constructor!");return new t(e)},bt=function(t,e){return Rt(T(t,t[St]),e)},Rt=function(t,e){for(var i=0,n=e.length,o=Dt(t,n);n>i;)o[i]=e[i++];return o},_t=function(t,e,i){U(t,e,{get:function(){return this._d[i]}})},xt=function(t){var e,i,n,o,r,s,a=w(t),l=arguments.length,c=l>1?arguments[1]:void 0,u=void 0!==c,f=b(a);if(null!=f&&!C(f)){for(s=f.call(a),n=[],e=0;!(r=s.next()).done;e++)n.push(r.value);a=n}for(u&&l>2&&(c=h(c,arguments[2],2)),e=0,i=y(a.length),o=Dt(this,i);i>e;e++)o[e]=u?c(a[e],e):a[e];return o},At=function(){for(var t=0,e=arguments.length,i=Dt(this,e);e>t;)i[t]=arguments[t++];return i},Tt=!!j&&r((function(){dt.call(new j(1))})),Ot=function(){return dt.apply(Tt?ut.call(Pt(this)):Pt(this),arguments)},Nt={copyWithin:function(t,e){return L.call(Pt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return Q(Pt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return M.apply(Pt(this),arguments)},filter:function(t){return bt(this,Z(Pt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return $(Pt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return tt(Pt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){J(Pt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return it(Pt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return et(Pt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ht.apply(Pt(this),arguments)},lastIndexOf:function(t){return st.apply(Pt(this),arguments)},map:function(t){return gt(Pt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return at.apply(Pt(this),arguments)},reduceRight:function(t){return lt.apply(Pt(this),arguments)},reverse:function(){for(var t,e=Pt(this).length,i=Math.floor(e/2),n=0;n<i;)t=this[n],this[n++]=this[--e],this[e]=t;return this},some:function(t){return q(Pt(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return ct.call(Pt(this),t)},subarray:function(t,e){var i=Pt(this),n=i.length,o=S(t,n);return new(T(i,i[St]))(i.buffer,i.byteOffset+o*i.BYTES_PER_ELEMENT,y((void 0===e?n:S(e,n))-o))}},Bt=function(t,e){return bt(this,ut.call(Pt(this),t,e))},Et=function(t){Pt(this);var e=kt(arguments[1],1),i=this.length,n=w(t),o=y(n.length),r=0;if(o+e>i)throw W("Wrong length!");for(;r<o;)this[e+r]=n[r++]},Mt={entries:function(){return rt.call(Pt(this))},keys:function(){return ot.call(Pt(this))},values:function(){return nt.call(Pt(this))}},Lt=function(t,e){return g(t)&&t[Ft]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Gt=function(t,e){return Lt(t,e=v(e,!0))?u(2,t[e]):V(t,e)},Ht=function(t,e,i){return!(Lt(t,e=v(e,!0))&&g(i)&&F(i,"value"))||F(i,"get")||F(i,"set")||i.configurable||F(i,"writable")&&!i.writable||F(i,"enumerable")&&!i.enumerable?U(t,e,i):(t[e]=i.value,t)};vt||(H.f=Gt,G.f=Ht),s(s.S+s.F*!vt,"Object",{getOwnPropertyDescriptor:Gt,defineProperty:Ht}),r((function(){ft.call({})}))&&(ft=dt=function(){return ht.call(this)});var Ut=d({},Nt);d(Ut,Mt),f(Ut,mt,Mt.values),d(Ut,{slice:Bt,set:Et,constructor:function(){},toString:ft,toLocaleString:Ot}),_t(Ut,"buffer","b"),_t(Ut,"byteOffset","o"),_t(Ut,"byteLength","l"),_t(Ut,"length","e"),U(Ut,yt,{get:function(){return this[Ft]}}),t.exports=function(t,e,i,l){var h=t+((l=!!l)?"Clamped":"")+"Array",u="get"+t,d="set"+t,m=o[h],S=m||{},v=m&&P(m),F=!m||!a.ABV,w={},C=m&&m.prototype,b=function(t,i){U(t,i,{get:function(){return function(t,i){var n=t._d;return n.v[u](i*e+n.o,wt)}(this,i)},set:function(t){return function(t,i,n){var o=t._d;l&&(n=(n=Math.round(n))<0?0:n>255?255:255&n),o.v[d](i*e+o.o,n,wt)}(this,i,t)},enumerable:!0})};F?(m=i((function(t,i,n,o){c(t,m,h,"_d");var r,s,a,l,u=0,d=0;if(g(i)){if(!(i instanceof K||"ArrayBuffer"==(l=I(i))||"SharedArrayBuffer"==l))return Ft in i?Rt(m,i):xt.call(m,i);r=i,d=kt(n,e);var S=i.byteLength;if(void 0===o){if(S%e)throw W("Wrong length!");if((s=S-d)<0)throw W("Wrong length!")}else if((s=y(o)*e)+d>S)throw W("Wrong length!");a=s/e}else a=p(i),r=new K(s=a*e);for(f(t,"_d",{b:r,o:d,l:s,e:a,v:new Y(r)});u<a;)b(t,u++)})),C=m.prototype=k(Ut),f(C,"constructor",m)):r((function(){m(1)}))&&r((function(){new m(-1)}))&&B((function(t){new m,new m(null),new m(1.5),new m(t)}),!0)||(m=i((function(t,i,n,o){var r;return c(t,m,h),g(i)?i instanceof K||"ArrayBuffer"==(r=I(i))||"SharedArrayBuffer"==r?void 0!==o?new S(i,kt(n,e),o):void 0!==n?new S(i,kt(n,e)):new S(i):Ft in i?Rt(m,i):xt.call(m,i):new S(p(i))})),J(v!==Function.prototype?D(S).concat(D(v)):D(S),(function(t){t in m||f(m,t,S[t])})),m.prototype=C,n||(C.constructor=m));var R=C[mt],_=!!R&&("values"==R.name||null==R.name),x=Mt.values;f(m,pt,!0),f(C,Ft,h),f(C,It,!0),f(C,St,m),(l?new m(1)[yt]==h:yt in C)||U(C,yt,{get:function(){return h}}),w[h]=m,s(s.G+s.W+s.F*(m!=S),w),s(s.S,h,{BYTES_PER_ELEMENT:e}),s(s.S+s.F*r((function(){S.of.call(m,1)})),h,{from:xt,of:At}),"BYTES_PER_ELEMENT"in C||f(C,"BYTES_PER_ELEMENT",e),s(s.P,h,Nt),E(h),s(s.P+s.F*Ct,h,{set:Et}),s(s.P+s.F*!_,h,Mt),n||C.toString==ft||(C.toString=ft),s(s.P+s.F*r((function(){new m(1).slice()})),h,{slice:Bt}),s(s.P+s.F*(r((function(){return[1,2].toLocaleString()!=new m([1,2]).toLocaleString()}))||!r((function(){C.toLocaleString.call([1,2])}))),h,{toLocaleString:Ot}),N[h]=_?R:x,n||_||f(C,mt,x)}}else t.exports=function(){}},function(t,e,i){var n=i(117),o=i(0),r=i(47)("metadata"),s=r.store||(r.store=new(i(120))),a=function(t,e,i){var o=s.get(t);if(!o){if(!i)return;s.set(t,o=new n)}var r=o.get(e);if(!r){if(!i)return;o.set(e,r=new n)}return r};t.exports={store:s,map:a,has:function(t,e,i){var n=a(e,i,!1);return void 0!==n&&n.has(t)},get:function(t,e,i){var n=a(e,i,!1);return void 0===n?void 0:n.get(t)},set:function(t,e,i,n){a(i,n,!0).set(t,e)},keys:function(t,e){var i=a(t,e,!1),n=[];return i&&i.forEach((function(t,e){n.push(e)})),n},key:function(t){return void 0===t||"symbol"==typeof t?t:String(t)},exp:function(t){o(o.S,"Reflect",t)}}},function(t,e){t.exports=!1},function(t,e,i){var n=i(33)("meta"),o=i(4),r=i(14),s=i(8).f,a=0,l=Object.isExtensible||function(){return!0},h=!i(3)((function(){return l(Object.preventExtensions({}))})),c=function(t){s(t,n,{value:{i:"O"+ ++a,w:{}}})},u=t.exports={KEY:n,NEED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!r(t,n)){if(!l(t))return"F";if(!e)return"E";c(t)}return t[n].i},getWeak:function(t,e){if(!r(t,n)){if(!l(t))return!0;if(!e)return!1;c(t)}return t[n].w},onFreeze:function(t){return h&&u.NEED&&l(t)&&!r(t,n)&&c(t),t}}},function(t,e,i){var n=i(5)("unscopables"),o=Array.prototype;null==o[n]&&i(11)(o,n,{}),t.exports=function(t){o[n][t]=!0}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var i=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+n).toString(36))}},function(t,e,i){var n=i(96),o=i(69);t.exports=Object.keys||function(t){return n(t,o)}},function(t,e,i){var n=i(21),o=Math.max,r=Math.min;t.exports=function(t,e){return(t=n(t))<0?o(t+e,0):r(t,e)}},function(t,e,i){var n=i(1),o=i(97),r=i(69),s=i(68)("IE_PROTO"),a=function(){},l=function(){var t,e=i(66)("iframe"),n=r.length;for(e.style.display="none",i(70).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;n--;)delete l.prototype[r[n]];return l()};t.exports=Object.create||function(t,e){var i;return null!==t?(a.prototype=n(t),i=new a,a.prototype=null,i[s]=t):i=l(),void 0===e?i:o(i,e)}},function(t,e,i){var n=i(96),o=i(69).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},function(t,e,i){"use strict";var n=i(2),o=i(8),r=i(7),s=i(5)("species");t.exports=function(t){var e=n[t];r&&e&&!e[s]&&o.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,i,n){if(!(t instanceof e)||void 0!==n&&n in t)throw TypeError(i+": incorrect invocation!");return t}},function(t,e,i){var n=i(19),o=i(109),r=i(81),s=i(1),a=i(6),l=i(83),h={},c={};(e=t.exports=function(t,e,i,u,f){var d,m,y,p,S=f?function(){return t}:l(t),v=n(i,u,e?2:1),F=0;if("function"!=typeof S)throw TypeError(t+" is not iterable!");if(r(S)){for(d=a(t.length);d>F;F++)if((p=e?v(s(m=t[F])[0],m[1]):v(t[F]))===h||p===c)return p}else for(y=S.call(t);!(m=y.next()).done;)if((p=o(y,v,m.value,e))===h||p===c)return p}).BREAK=h,e.RETURN=c},function(t,e,i){var n=i(12);t.exports=function(t,e,i){for(var o in e)n(t,o,e[o],i);return t}},function(t,e,i){var n=i(4);t.exports=function(t,e){if(!n(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,i){var n=i(8).f,o=i(14),r=i(5)("toStringTag");t.exports=function(t,e,i){t&&!o(t=i?t:t.prototype,r)&&n(t,r,{configurable:!0,value:e})}},function(t,e,i){var n=i(20),o=i(5)("toStringTag"),r="Arguments"==n(function(){return arguments}());t.exports=function(t){var e,i,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?i:r?n(e):"Object"==(s=n(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,i){var n=i(0),o=i(24),r=i(3),s=i(72),a="["+s+"]",l=RegExp("^"+a+a+"*"),h=RegExp(a+a+"*$"),c=function(t,e,i){var o={},a=r((function(){return!!s[t]()||"
"!="
"[t]()})),l=o[t]=a?e(u):s[t];i&&(o[i]=l),n(n.P+n.F*a,"String",o)},u=c.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(l,"")),2&e&&(t=t.replace(h,"")),t};t.exports=c},function(t,e){t.exports={}},function(t,e,i){var n=i(18),o=i(2),r=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:n.version,mode:i(29)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,i){var n=i(20);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){"use strict";var n=i(1);t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,i){var n=i(1),o=i(10),r=i(5)("species");t.exports=function(t,e){var i,s=n(t).constructor;return void 0===s||null==(i=n(s)[r])?e:o(i)}},function(t,e,i){var n=i(15),o=i(6),r=i(35);t.exports=function(t){return function(e,i,s){var a,l=n(e),h=o(l.length),c=r(s,h);if(t&&i!=i){for(;h>c;)if((a=l[c++])!=a)return!0}else for(;h>c;c++)if((t||c in l)&&l[c]===i)return t||c||0;return!t&&-1}}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,i){var n=i(20);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,i){var n=i(21),o=i(24);t.exports=function(t){return function(e,i){var r,s,a=String(o(e)),l=n(i),h=a.length;return l<0||l>=h?t?"":void 0:(r=a.charCodeAt(l))<55296||r>56319||l+1===h||(s=a.charCodeAt(l+1))<56320||s>57343?t?a.charAt(l):r:t?a.slice(l,l+2):s-56320+(r-55296<<10)+65536}}},function(t,e,i){var n=i(4),o=i(20),r=i(5)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[r])?!!e:"RegExp"==o(t))}},function(t,e,i){var n=i(5)("iterator"),o=!1;try{var r=[7][n]();r.return=function(){o=!0},Array.from(r,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var i=!1;try{var r=[7],s=r[n]();s.next=function(){return{done:i=!0}},r[n]=function(){return s},t(r)}catch(t){}return i}},function(t,e,i){"use strict";var n=i(44),o=RegExp.prototype.exec;t.exports=function(t,e){var i=t.exec;if("function"==typeof i){var r=i.call(t,e);if("object"!=typeof r)throw new TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==n(t))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},function(t,e,i){"use strict";i(113);var n=i(12),o=i(11),r=i(3),s=i(24),a=i(5),l=i(87),h=a("species"),c=!r((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),u=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var i="ab".split(t);return 2===i.length&&"a"===i[0]&&"b"===i[1]}();t.exports=function(t,e,i){var f=a(t),d=!r((function(){var e={};return e[f]=function(){return 7},7!=""[t](e)})),m=d?!r((function(){var e=!1,i=/a/;return i.exec=function(){return e=!0,null},"split"===t&&(i.constructor={},i.constructor[h]=function(){return i}),i[f](""),!e})):void 0;if(!d||!m||"replace"===t&&!c||"split"===t&&!u){var y=/./[f],p=i(s,f,""[t],(function(t,e,i,n,o){return e.exec===l?d&&!o?{done:!0,value:y.call(e,i,n)}:{done:!0,value:t.call(i,e,n)}:{done:!1}})),S=p[0],v=p[1];n(String.prototype,t,S),o(RegExp.prototype,f,2==e?function(t,e){return v.call(t,this,e)}:function(t){return v.call(t,this)})}}},function(t,e,i){var n=i(2).navigator;t.exports=n&&n.userAgent||""},function(t,e,i){"use strict";var n=i(2),o=i(0),r=i(12),s=i(41),a=i(30),l=i(40),h=i(39),c=i(4),u=i(3),f=i(57),d=i(43),m=i(73);t.exports=function(t,e,i,y,p,S){var v=n[t],F=v,I=p?"set":"add",g=F&&F.prototype,w={},C=function(t){var e=g[t];r(g,t,"delete"==t||"has"==t?function(t){return!(S&&!c(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return S&&!c(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,i){return e.call(this,0===t?0:t,i),this})};if("function"==typeof F&&(S||g.forEach&&!u((function(){(new F).entries().next()})))){var k=new F,P=k[I](S?{}:-0,1)!=k,D=u((function(){k.has(1)})),b=f((function(t){new F(t)})),R=!S&&u((function(){for(var t=new F,e=5;e--;)t[I](e,e);return!t.has(-0)}));b||((F=e((function(e,i){h(e,F,t);var n=m(new v,e,F);return null!=i&&l(i,p,n[I],n),n}))).prototype=g,g.constructor=F),(D||R)&&(C("delete"),C("has"),p&&C("get")),(R||P)&&C(I),S&&g.clear&&delete g.clear}else F=y.getConstructor(e,t,p,I),s(F.prototype,i),a.NEED=!0;return d(F,t),w[t]=F,o(o.G+o.W+o.F*(F!=v),w),S||y.setStrong(F,t,p),F}},function(t,e,i){for(var n,o=i(2),r=i(11),s=i(33),a=s("typed_array"),l=s("view"),h=!(!o.ArrayBuffer||!o.DataView),c=h,u=0,f="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");u<9;)(n=o[f[u++]])?(r(n.prototype,a,!0),r(n.prototype,l,!0)):c=!1;t.exports={ABV:h,CONSTR:c,TYPED:a,VIEW:l}},function(t,e,i){"use strict";t.exports=i(29)||!i(3)((function(){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete i(2)[t]}))},function(t,e,i){"use strict";var n=i(0);t.exports=function(t){n(n.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})}},function(t,e,i){"use strict";var n=i(0),o=i(10),r=i(19),s=i(40);t.exports=function(t){n(n.S,t,{from:function(t){var e,i,n,a,l=arguments[1];return o(this),(e=void 0!==l)&&o(l),null==t?new this:(i=[],e?(n=0,a=r(l,arguments[2],2),s(t,!1,(function(t){i.push(a(t,n++))}))):s(t,!1,i.push,i),new this(i))}})}},function(t,e,i){var n=i(4),o=i(2).document,r=n(o)&&n(o.createElement);t.exports=function(t){return r?o.createElement(t):{}}},function(t,e,i){var n=i(2),o=i(18),r=i(29),s=i(95),a=i(8).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=r?{}:n.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,i){var n=i(47)("keys"),o=i(33);t.exports=function(t){return n[t]||(n[t]=o(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var n=i(2).document;t.exports=n&&n.documentElement},function(t,e,i){var n=i(4),o=i(1),r=function(t,e){if(o(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{(n=i(19)(Function.call,i(16).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,i){return r(t,i),e?t.__proto__=i:n(t,i),t}}({},!1):void 0),check:r}},function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(t,e,i){var n=i(4),o=i(71).set;t.exports=function(t,e,i){var r,s=e.constructor;return s!==i&&"function"==typeof s&&(r=s.prototype)!==i.prototype&&n(r)&&o&&o(t,r),t}},function(t,e,i){"use strict";var n=i(21),o=i(24);t.exports=function(t){var e=String(o(this)),i="",r=n(t);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(i+=e);return i}},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e){var i=Math.expm1;t.exports=!i||i(10)>22025.465794806718||i(10)<22025.465794806718||-2e-17!=i(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:i},function(t,e,i){"use strict";var n=i(29),o=i(0),r=i(12),s=i(11),a=i(46),l=i(78),h=i(43),c=i(17),u=i(5)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,i,m,y,p,S){l(i,e,m);var v,F,I,g=function(t){if(!f&&t in P)return P[t];switch(t){case"keys":case"values":return function(){return new i(this,t)}}return function(){return new i(this,t)}},w=e+" Iterator",C="values"==y,k=!1,P=t.prototype,D=P[u]||P["@@iterator"]||y&&P[y],b=D||g(y),R=y?C?g("entries"):b:void 0,_="Array"==e&&P.entries||D;if(_&&(I=c(_.call(new t)))!==Object.prototype&&I.next&&(h(I,w,!0),n||"function"==typeof I[u]||s(I,u,d)),C&&D&&"values"!==D.name&&(k=!0,b=function(){return D.call(this)}),n&&!S||!f&&!k&&P[u]||s(P,u,b),a[e]=b,a[w]=d,y)if(v={values:C?b:g("values"),keys:p?b:g("keys"),entries:R},S)for(F in v)F in P||r(P,F,v[F]);else o(o.P+o.F*(f||k),e,v);return v}},function(t,e,i){"use strict";var n=i(36),o=i(32),r=i(43),s={};i(11)(s,i(5)("iterator"),(function(){return this})),t.exports=function(t,e,i){t.prototype=n(s,{next:o(1,i)}),r(t,e+" Iterator")}},function(t,e,i){var n=i(56),o=i(24);t.exports=function(t,e,i){if(n(e))throw TypeError("String#"+i+" doesn't accept regex!");return String(o(t))}},function(t,e,i){var n=i(5)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(i){try{return e[n]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,i){var n=i(46),o=i(5)("iterator"),r=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||r[o]===t)}},function(t,e,i){"use strict";var n=i(8),o=i(32);t.exports=function(t,e,i){e in t?n.f(t,e,o(0,i)):t[e]=i}},function(t,e,i){var n=i(44),o=i(5)("iterator"),r=i(46);t.exports=i(18).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||r[n(t)]}},function(t,e,i){var n=i(223);t.exports=function(t,e){return new(n(t))(e)}},function(t,e,i){"use strict";var n=i(9),o=i(35),r=i(6);t.exports=function(t){for(var e=n(this),i=r(e.length),s=arguments.length,a=o(s>1?arguments[1]:void 0,i),l=s>2?arguments[2]:void 0,h=void 0===l?i:o(l,i);h>a;)e[a++]=t;return e}},function(t,e,i){"use strict";var n=i(31),o=i(112),r=i(46),s=i(15);t.exports=i(77)(Array,"Array",(function(t,e){this._t=s(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,i=this._i++;return!t||i>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?i:"values"==e?t[i]:[i,t[i]])}),"values"),r.Arguments=r.Array,n("keys"),n("values"),n("entries")},function(t,e,i){"use strict";var n,o,r=i(50),s=RegExp.prototype.exec,a=String.prototype.replace,l=s,h=(n=/a/,o=/b*/g,s.call(n,"a"),s.call(o,"a"),0!==n.lastIndex||0!==o.lastIndex),c=void 0!==/()??/.exec("")[1];(h||c)&&(l=function(t){var e,i,n,o,l=this;return c&&(i=new RegExp("^"+l.source+"$(?!\\s)",r.call(l))),h&&(e=l.lastIndex),n=s.call(l,t),h&&n&&(l.lastIndex=l.global?n.index+n[0].length:e),c&&n&&n.length>1&&a.call(n[0],i,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)})),n}),t.exports=l},function(t,e,i){"use strict";var n=i(55)(!0);t.exports=function(t,e,i){return e+(i?n(t,e).length:1)}},function(t,e,i){var n,o,r,s=i(19),a=i(102),l=i(70),h=i(66),c=i(2),u=c.process,f=c.setImmediate,d=c.clearImmediate,m=c.MessageChannel,y=c.Dispatch,p=0,S={},v=function(){var t=+this;if(S.hasOwnProperty(t)){var e=S[t];delete S[t],e()}},F=function(t){v.call(t.data)};f&&d||(f=function(t){for(var e=[],i=1;arguments.length>i;)e.push(arguments[i++]);return S[++p]=function(){a("function"==typeof t?t:Function(t),e)},n(p),p},d=function(t){delete S[t]},"process"==i(20)(u)?n=function(t){u.nextTick(s(v,t,1))}:y&&y.now?n=function(t){y.now(s(v,t,1))}:m?(r=(o=new m).port2,o.port1.onmessage=F,n=s(r.postMessage,r,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(n=function(t){c.postMessage(t+"","*")},c.addEventListener("message",F,!1)):n="onreadystatechange"in h("script")?function(t){l.appendChild(h("script")).onreadystatechange=function(){l.removeChild(this),v.call(t)}}:function(t){setTimeout(s(v,t,1),0)}),t.exports={set:f,clear:d}},function(t,e,i){var n=i(2),o=i(89).set,r=n.MutationObserver||n.WebKitMutationObserver,s=n.process,a=n.Promise,l="process"==i(20)(s);t.exports=function(){var t,e,i,h=function(){var n,o;for(l&&(n=s.domain)&&n.exit();t;){o=t.fn,t=t.next;try{o()}catch(n){throw t?i():e=void 0,n}}e=void 0,n&&n.enter()};if(l)i=function(){s.nextTick(h)};else if(!r||n.navigator&&n.navigator.standalone)if(a&&a.resolve){var c=a.resolve(void 0);i=function(){c.then(h)}}else i=function(){o.call(n,h)};else{var u=!0,f=document.createTextNode("");new r(h).observe(f,{characterData:!0}),i=function(){f.data=u=!u}}return function(n){var o={fn:n,next:void 0};e&&(e.next=o),t||(t=o,i()),e=o}}},function(t,e,i){"use strict";var n=i(10);function o(t){var e,i;this.promise=new t((function(t,n){if(void 0!==e||void 0!==i)throw TypeError("Bad Promise constructor");e=t,i=n})),this.resolve=n(e),this.reject=n(i)}t.exports.f=function(t){return new o(t)}},function(t,e,i){"use strict";var n=i(2),o=i(7),r=i(29),s=i(62),a=i(11),l=i(41),h=i(3),c=i(39),u=i(21),f=i(6),d=i(122),m=i(37).f,y=i(8).f,p=i(85),S=i(43),v=n.ArrayBuffer,F=n.DataView,I=n.Math,g=n.RangeError,w=n.Infinity,C=v,k=I.abs,P=I.pow,D=I.floor,b=I.log,R=I.LN2,_=o?"_b":"buffer",x=o?"_l":"byteLength",A=o?"_o":"byteOffset";function T(t,e,i){var n,o,r,s=new Array(i),a=8*i-e-1,l=(1<<a)-1,h=l>>1,c=23===e?P(2,-24)-P(2,-77):0,u=0,f=t<0||0===t&&1/t<0?1:0;for((t=k(t))!=t||t===w?(o=t!=t?1:0,n=l):(n=D(b(t)/R),t*(r=P(2,-n))<1&&(n--,r*=2),(t+=n+h>=1?c/r:c*P(2,1-h))*r>=2&&(n++,r/=2),n+h>=l?(o=0,n=l):n+h>=1?(o=(t*r-1)*P(2,e),n+=h):(o=t*P(2,h-1)*P(2,e),n=0));e>=8;s[u++]=255&o,o/=256,e-=8);for(n=n<<e|o,a+=e;a>0;s[u++]=255&n,n/=256,a-=8);return s[--u]|=128*f,s}function O(t,e,i){var n,o=8*i-e-1,r=(1<<o)-1,s=r>>1,a=o-7,l=i-1,h=t[l--],c=127&h;for(h>>=7;a>0;c=256*c+t[l],l--,a-=8);for(n=c&(1<<-a)-1,c>>=-a,a+=e;a>0;n=256*n+t[l],l--,a-=8);if(0===c)c=1-s;else{if(c===r)return n?NaN:h?-w:w;n+=P(2,e),c-=s}return(h?-1:1)*n*P(2,c-e)}function N(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function B(t){return[255&t]}function E(t){return[255&t,t>>8&255]}function M(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function L(t){return T(t,52,8)}function G(t){return T(t,23,4)}function H(t,e,i){y(t.prototype,e,{get:function(){return this[i]}})}function U(t,e,i,n){var o=d(+i);if(o+e>t[x])throw g("Wrong index!");var r=t[_]._b,s=o+t[A],a=r.slice(s,s+e);return n?a:a.reverse()}function V(t,e,i,n,o,r){var s=d(+i);if(s+e>t[x])throw g("Wrong index!");for(var a=t[_]._b,l=s+t[A],h=n(+o),c=0;c<e;c++)a[l+c]=h[r?c:e-c-1]}if(s.ABV){if(!h((function(){v(1)}))||!h((function(){new v(-1)}))||h((function(){return new v,new v(1.5),new v(NaN),"ArrayBuffer"!=v.name}))){for(var W,z=(v=function(t){return c(this,v),new C(d(t))}).prototype=C.prototype,j=m(C),X=0;j.length>X;)(W=j[X++])in v||a(v,W,C[W]);r||(z.constructor=v)}var K=new F(new v(2)),Y=F.prototype.setInt8;K.setInt8(0,2147483648),K.setInt8(1,2147483649),!K.getInt8(0)&&K.getInt8(1)||l(F.prototype,{setInt8:function(t,e){Y.call(this,t,e<<24>>24)},setUint8:function(t,e){Y.call(this,t,e<<24>>24)}},!0)}else v=function(t){c(this,v,"ArrayBuffer");var e=d(t);this._b=p.call(new Array(e),0),this[x]=e},F=function(t,e,i){c(this,F,"DataView"),c(t,v,"DataView");var n=t[x],o=u(e);if(o<0||o>n)throw g("Wrong offset!");if(o+(i=void 0===i?n-o:f(i))>n)throw g("Wrong length!");this[_]=t,this[A]=o,this[x]=i},o&&(H(v,"byteLength","_l"),H(F,"buffer","_b"),H(F,"byteLength","_l"),H(F,"byteOffset","_o")),l(F.prototype,{getInt8:function(t){return U(this,1,t)[0]<<24>>24},getUint8:function(t){return U(this,1,t)[0]},getInt16:function(t){var e=U(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=U(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return N(U(this,4,t,arguments[1]))},getUint32:function(t){return N(U(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return O(U(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return O(U(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){V(this,1,t,B,e)},setUint8:function(t,e){V(this,1,t,B,e)},setInt16:function(t,e){V(this,2,t,E,e,arguments[2])},setUint16:function(t,e){V(this,2,t,E,e,arguments[2])},setInt32:function(t,e){V(this,4,t,M,e,arguments[2])},setUint32:function(t,e){V(this,4,t,M,e,arguments[2])},setFloat32:function(t,e){V(this,4,t,G,e,arguments[2])},setFloat64:function(t,e){V(this,8,t,L,e,arguments[2])}});S(v,"ArrayBuffer"),S(F,"DataView"),a(F.prototype,s.VIEW,!0),e.ArrayBuffer=v,e.DataView=F},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){t.exports=!i(7)&&!i(3)((function(){return 7!=Object.defineProperty(i(66)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,i){e.f=i(5)},function(t,e,i){var n=i(14),o=i(15),r=i(52)(!1),s=i(68)("IE_PROTO");t.exports=function(t,e){var i,a=o(t),l=0,h=[];for(i in a)i!=s&&n(a,i)&&h.push(i);for(;e.length>l;)n(a,i=e[l++])&&(~r(h,i)||h.push(i));return h}},function(t,e,i){var n=i(8),o=i(1),r=i(34);t.exports=i(7)?Object.defineProperties:function(t,e){o(t);for(var i,s=r(e),a=s.length,l=0;a>l;)n.f(t,i=s[l++],e[i]);return t}},function(t,e,i){var n=i(15),o=i(37).f,r={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"[object Window]"==r.call(t)?function(t){try{return o(t)}catch(t){return s.slice()}}(t):o(n(t))}},function(t,e,i){"use strict";var n=i(7),o=i(34),r=i(53),s=i(49),a=i(9),l=i(48),h=Object.assign;t.exports=!h||i(3)((function(){var t={},e={},i=Symbol(),n="abcdefghijklmnopqrst";return t[i]=7,n.split("").forEach((function(t){e[t]=t})),7!=h({},t)[i]||Object.keys(h({},e)).join("")!=n}))?function(t,e){for(var i=a(t),h=arguments.length,c=1,u=r.f,f=s.f;h>c;)for(var d,m=l(arguments[c++]),y=u?o(m).concat(u(m)):o(m),p=y.length,S=0;p>S;)d=y[S++],n&&!f.call(m,d)||(i[d]=m[d]);return i}:h},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,i){"use strict";var n=i(10),o=i(4),r=i(102),s=[].slice,a={},l=function(t,e,i){if(!(e in a)){for(var n=[],o=0;o<e;o++)n[o]="a["+o+"]";a[e]=Function("F,a","return new F("+n.join(",")+")")}return a[e](t,i)};t.exports=Function.bind||function(t){var e=n(this),i=s.call(arguments,1),a=function(){var n=i.concat(s.call(arguments));return this instanceof a?l(e,n.length,n):r(e,n,t)};return o(e.prototype)&&(a.prototype=e.prototype),a}},function(t,e){t.exports=function(t,e,i){var n=void 0===i;switch(e.length){case 0:return n?t():t.call(i);case 1:return n?t(e[0]):t.call(i,e[0]);case 2:return n?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},function(t,e,i){var n=i(2).parseInt,o=i(45).trim,r=i(72),s=/^[-+]?0[xX]/;t.exports=8!==n(r+"08")||22!==n(r+"0x16")?function(t,e){var i=o(String(t),3);return n(i,e>>>0||(s.test(i)?16:10))}:n},function(t,e,i){var n=i(2).parseFloat,o=i(45).trim;t.exports=1/n(i(72)+"-0")!=-1/0?function(t){var e=o(String(t),3),i=n(e);return 0===i&&"-"==e.charAt(0)?-0:i}:n},function(t,e,i){var n=i(20);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=n(t))throw TypeError(e);return+t}},function(t,e,i){var n=i(4),o=Math.floor;t.exports=function(t){return!n(t)&&isFinite(t)&&o(t)===t}},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,i){var n=i(75),o=Math.pow,r=o(2,-52),s=o(2,-23),a=o(2,127)*(2-s),l=o(2,-126);t.exports=Math.fround||function(t){var e,i,o=Math.abs(t),h=n(t);return o<l?h*(o/l/s+1/r-1/r)*l*s:(i=(e=(1+s/r)*o)-(e-o))>a||i!=i?h*(1/0):h*i}},function(t,e,i){var n=i(1);t.exports=function(t,e,i,o){try{return o?e(n(i)[0],i[1]):e(i)}catch(e){var r=t.return;throw void 0!==r&&n(r.call(t)),e}}},function(t,e,i){var n=i(10),o=i(9),r=i(48),s=i(6);t.exports=function(t,e,i,a,l){n(e);var h=o(t),c=r(h),u=s(h.length),f=l?u-1:0,d=l?-1:1;if(i<2)for(;;){if(f in c){a=c[f],f+=d;break}if(f+=d,l?f<0:u<=f)throw TypeError("Reduce of empty array with no initial value")}for(;l?f>=0:u>f;f+=d)f in c&&(a=e(a,c[f],f,h));return a}},function(t,e,i){"use strict";var n=i(9),o=i(35),r=i(6);t.exports=[].copyWithin||function(t,e){var i=n(this),s=r(i.length),a=o(t,s),l=o(e,s),h=arguments.length>2?arguments[2]:void 0,c=Math.min((void 0===h?s:o(h,s))-l,s-a),u=1;for(l<a&&a<l+c&&(u=-1,l+=c-1,a+=c-1);c-- >0;)l in i?i[a]=i[l]:delete i[a],a+=u,l+=u;return i}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,i){"use strict";var n=i(87);i(0)({target:"RegExp",proto:!0,forced:n!==/./.exec},{exec:n})},function(t,e,i){i(7)&&"g"!=/./g.flags&&i(8).f(RegExp.prototype,"flags",{configurable:!0,get:i(50)})},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,i){var n=i(1),o=i(4),r=i(91);t.exports=function(t,e){if(n(t),o(e)&&e.constructor===t)return e;var i=r.f(t);return(0,i.resolve)(e),i.promise}},function(t,e,i){"use strict";var n=i(118),o=i(42);t.exports=i(61)("Map",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=n.getEntry(o(this,"Map"),t);return e&&e.v},set:function(t,e){return n.def(o(this,"Map"),0===t?0:t,e)}},n,!0)},function(t,e,i){"use strict";var n=i(8).f,o=i(36),r=i(41),s=i(19),a=i(39),l=i(40),h=i(77),c=i(112),u=i(38),f=i(7),d=i(30).fastKey,m=i(42),y=f?"_s":"size",p=function(t,e){var i,n=d(e);if("F"!==n)return t._i[n];for(i=t._f;i;i=i.n)if(i.k==e)return i};t.exports={getConstructor:function(t,e,i,h){var c=t((function(t,n){a(t,c,e,"_i"),t._t=e,t._i=o(null),t._f=void 0,t._l=void 0,t[y]=0,null!=n&&l(n,i,t[h],t)}));return r(c.prototype,{clear:function(){for(var t=m(this,e),i=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete i[n.i];t._f=t._l=void 0,t[y]=0},delete:function(t){var i=m(this,e),n=p(i,t);if(n){var o=n.n,r=n.p;delete i._i[n.i],n.r=!0,r&&(r.n=o),o&&(o.p=r),i._f==n&&(i._f=o),i._l==n&&(i._l=r),i[y]--}return!!n},forEach:function(t){m(this,e);for(var i,n=s(t,arguments.length>1?arguments[1]:void 0,3);i=i?i.n:this._f;)for(n(i.v,i.k,this);i&&i.r;)i=i.p},has:function(t){return!!p(m(this,e),t)}}),f&&n(c.prototype,"size",{get:function(){return m(this,e)[y]}}),c},def:function(t,e,i){var n,o,r=p(t,e);return r?r.v=i:(t._l=r={i:o=d(e,!0),k:e,v:i,p:n=t._l,n:void 0,r:!1},t._f||(t._f=r),n&&(n.n=r),t[y]++,"F"!==o&&(t._i[o]=r)),t},getEntry:p,setStrong:function(t,e,i){h(t,e,(function(t,i){this._t=m(t,e),this._k=i,this._l=void 0}),(function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?c(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,c(1))}),i?"entries":"values",!i,!0),u(e)}}},function(t,e,i){"use strict";var n=i(118),o=i(42);t.exports=i(61)("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return n.def(o(this,"Set"),t=0===t?0:t,t)}},n)},function(t,e,i){"use strict";var n,o=i(2),r=i(26)(0),s=i(12),a=i(30),l=i(99),h=i(121),c=i(4),u=i(42),f=i(42),d=!o.ActiveXObject&&"ActiveXObject"in o,m=a.getWeak,y=Object.isExtensible,p=h.ufstore,S=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},v={get:function(t){if(c(t)){var e=m(t);return!0===e?p(u(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return h.def(u(this,"WeakMap"),t,e)}},F=t.exports=i(61)("WeakMap",S,v,h,!0,!0);f&&d&&(l((n=h.getConstructor(S,"WeakMap")).prototype,v),a.NEED=!0,r(["delete","has","get","set"],(function(t){var e=F.prototype,i=e[t];s(e,t,(function(e,o){if(c(e)&&!y(e)){this._f||(this._f=new n);var r=this._f[t](e,o);return"set"==t?this:r}return i.call(this,e,o)}))})))},function(t,e,i){"use strict";var n=i(41),o=i(30).getWeak,r=i(1),s=i(4),a=i(39),l=i(40),h=i(26),c=i(14),u=i(42),f=h(5),d=h(6),m=0,y=function(t){return t._l||(t._l=new p)},p=function(){this.a=[]},S=function(t,e){return f(t.a,(function(t){return t[0]===e}))};p.prototype={get:function(t){var e=S(this,t);if(e)return e[1]},has:function(t){return!!S(this,t)},set:function(t,e){var i=S(this,t);i?i[1]=e:this.a.push([t,e])},delete:function(t){var e=d(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,i,r){var h=t((function(t,n){a(t,h,e,"_i"),t._t=e,t._i=m++,t._l=void 0,null!=n&&l(n,i,t[r],t)}));return n(h.prototype,{delete:function(t){if(!s(t))return!1;var i=o(t);return!0===i?y(u(this,e)).delete(t):i&&c(i,this._i)&&delete i[this._i]},has:function(t){if(!s(t))return!1;var i=o(t);return!0===i?y(u(this,e)).has(t):i&&c(i,this._i)}}),h},def:function(t,e,i){var n=o(r(e),!0);return!0===n?y(t).set(e,i):n[t._i]=i,t},ufstore:y}},function(t,e,i){var n=i(21),o=i(6);t.exports=function(t){if(void 0===t)return 0;var e=n(t),i=o(e);if(e!==i)throw RangeError("Wrong length!");return i}},function(t,e,i){var n=i(37),o=i(53),r=i(1),s=i(2).Reflect;t.exports=s&&s.ownKeys||function(t){var e=n.f(r(t)),i=o.f;return i?e.concat(i(t)):e}},function(t,e,i){"use strict";var n=i(54),o=i(4),r=i(6),s=i(19),a=i(5)("isConcatSpreadable");t.exports=function t(e,i,l,h,c,u,f,d){for(var m,y,p=c,S=0,v=!!f&&s(f,d,3);S<h;){if(S in l){if(m=v?v(l[S],S,i):l[S],y=!1,o(m)&&(y=void 0!==(y=m[a])?!!y:n(m)),y&&u>0)p=t(e,i,m,r(m.length),p,u-1)-1;else{if(p>=9007199254740991)throw TypeError();e[p]=m}p++}S++}return p}},function(t,e,i){var n=i(6),o=i(74),r=i(24);t.exports=function(t,e,i,s){var a=String(r(t)),l=a.length,h=void 0===i?" ":String(i),c=n(e);if(c<=l||""==h)return a;var u=c-l,f=o.call(h,Math.ceil(u/h.length));return f.length>u&&(f=f.slice(0,u)),s?f+a:a+f}},function(t,e,i){var n=i(7),o=i(34),r=i(15),s=i(49).f;t.exports=function(t){return function(e){for(var i,a=r(e),l=o(a),h=l.length,c=0,u=[];h>c;)i=l[c++],n&&!s.call(a,i)||u.push(t?[i,a[i]]:a[i]);return u}}},function(t,e,i){var n=i(44),o=i(128);t.exports=function(t){return function(){if(n(this)!=t)throw TypeError(t+"#toJSON isn't generic");return o(this)}}},function(t,e,i){var n=i(40);t.exports=function(t,e){var i=[];return n(t,!1,i.push,i,e),i}},function(t,e){t.exports=Math.scale||function(t,e,i,n,o){return 0===arguments.length||t!=t||e!=e||i!=i||n!=n||o!=o?NaN:t===1/0||t===-1/0?t:(t-e)*(o-n)/(i-e)+n}},function(t,e,i){i(131),t.exports=i(333)},function(t,e,i){"use strict";(function(t){if(i(132),i(329),i(330),t._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");t._babelPolyfill=!0;function e(t,e,i){t[e]||Object.defineProperty(t,e,{writable:!0,configurable:!0,value:i})}e(String.prototype,"padLeft","".padStart),e(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach((function(t){[][t]&&e(Array,t,Function.call.bind([][t]))}))}).call(this,i(93))},function(t,e,i){i(133),i(136),i(137),i(138),i(139),i(140),i(141),i(142),i(143),i(144),i(145),i(146),i(147),i(148),i(149),i(150),i(151),i(152),i(153),i(154),i(155),i(156),i(157),i(158),i(159),i(160),i(161),i(162),i(163),i(164),i(165),i(166),i(167),i(168),i(169),i(170),i(171),i(172),i(173),i(174),i(175),i(176),i(177),i(178),i(179),i(180),i(181),i(182),i(183),i(184),i(185),i(186),i(187),i(188),i(189),i(190),i(191),i(192),i(193),i(194),i(195),i(196),i(197),i(198),i(199),i(200),i(201),i(202),i(203),i(204),i(205),i(206),i(207),i(208),i(209),i(210),i(211),i(213),i(214),i(216),i(217),i(218),i(219),i(220),i(221),i(222),i(224),i(225),i(226),i(227),i(228),i(229),i(230),i(231),i(232),i(233),i(234),i(235),i(236),i(86),i(237),i(113),i(238),i(114),i(239),i(240),i(241),i(242),i(243),i(117),i(119),i(120),i(244),i(245),i(246),i(247),i(248),i(249),i(250),i(251),i(252),i(253),i(254),i(255),i(256),i(257),i(258),i(259),i(260),i(261),i(262),i(263),i(264),i(265),i(266),i(267),i(268),i(269),i(270),i(271),i(272),i(273),i(274),i(275),i(276),i(277),i(278),i(279),i(280),i(281),i(282),i(283),i(284),i(285),i(286),i(287),i(288),i(289),i(290),i(291),i(292),i(293),i(294),i(295),i(296),i(297),i(298),i(299),i(300),i(301),i(302),i(303),i(304),i(305),i(306),i(307),i(308),i(309),i(310),i(311),i(312),i(313),i(314),i(315),i(316),i(317),i(318),i(319),i(320),i(321),i(322),i(323),i(324),i(325),i(326),i(327),i(328),t.exports=i(18)},function(t,e,i){"use strict";var n=i(2),o=i(14),r=i(7),s=i(0),a=i(12),l=i(30).KEY,h=i(3),c=i(47),u=i(43),f=i(33),d=i(5),m=i(95),y=i(67),p=i(135),S=i(54),v=i(1),F=i(4),I=i(9),g=i(15),w=i(23),C=i(32),k=i(36),P=i(98),D=i(16),b=i(53),R=i(8),_=i(34),x=D.f,A=R.f,T=P.f,O=n.Symbol,N=n.JSON,B=N&&N.stringify,E=d("_hidden"),M=d("toPrimitive"),L={}.propertyIsEnumerable,G=c("symbol-registry"),H=c("symbols"),U=c("op-symbols"),V=Object.prototype,W="function"==typeof O&&!!b.f,z=n.QObject,j=!z||!z.prototype||!z.prototype.findChild,X=r&&h((function(){return 7!=k(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a}))?function(t,e,i){var n=x(V,e);n&&delete V[e],A(t,e,i),n&&t!==V&&A(V,e,n)}:A,K=function(t){var e=H[t]=k(O.prototype);return e._k=t,e},Y=W&&"symbol"==typeof O.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof O},J=function(t,e,i){return t===V&&J(U,e,i),v(t),e=w(e,!0),v(i),o(H,e)?(i.enumerable?(o(t,E)&&t[E][e]&&(t[E][e]=!1),i=k(i,{enumerable:C(0,!1)})):(o(t,E)||A(t,E,C(1,{})),t[E][e]=!0),X(t,e,i)):A(t,e,i)},Z=function(t,e){v(t);for(var i,n=p(e=g(e)),o=0,r=n.length;r>o;)J(t,i=n[o++],e[i]);return t},q=function(t){var e=L.call(this,t=w(t,!0));return!(this===V&&o(H,t)&&!o(U,t))&&(!(e||!o(this,t)||!o(H,t)||o(this,E)&&this[E][t])||e)},Q=function(t,e){if(t=g(t),e=w(e,!0),t!==V||!o(H,e)||o(U,e)){var i=x(t,e);return!i||!o(H,e)||o(t,E)&&t[E][e]||(i.enumerable=!0),i}},$=function(t){for(var e,i=T(g(t)),n=[],r=0;i.length>r;)o(H,e=i[r++])||e==E||e==l||n.push(e);return n},tt=function(t){for(var e,i=t===V,n=T(i?U:g(t)),r=[],s=0;n.length>s;)!o(H,e=n[s++])||i&&!o(V,e)||r.push(H[e]);return r};W||(a((O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(i){this===V&&e.call(U,i),o(this,E)&&o(this[E],t)&&(this[E][t]=!1),X(this,t,C(1,i))};return r&&j&&X(V,t,{configurable:!0,set:e}),K(t)}).prototype,"toString",(function(){return this._k})),D.f=Q,R.f=J,i(37).f=P.f=$,i(49).f=q,b.f=tt,r&&!i(29)&&a(V,"propertyIsEnumerable",q,!0),m.f=function(t){return K(d(t))}),s(s.G+s.W+s.F*!W,{Symbol:O});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),it=0;et.length>it;)d(et[it++]);for(var nt=_(d.store),ot=0;nt.length>ot;)y(nt[ot++]);s(s.S+s.F*!W,"Symbol",{for:function(t){return o(G,t+="")?G[t]:G[t]=O(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in G)if(G[e]===t)return e},useSetter:function(){j=!0},useSimple:function(){j=!1}}),s(s.S+s.F*!W,"Object",{create:function(t,e){return void 0===e?k(t):Z(k(t),e)},defineProperty:J,defineProperties:Z,getOwnPropertyDescriptor:Q,getOwnPropertyNames:$,getOwnPropertySymbols:tt});var rt=h((function(){b.f(1)}));s(s.S+s.F*rt,"Object",{getOwnPropertySymbols:function(t){return b.f(I(t))}}),N&&s(s.S+s.F*(!W||h((function(){var t=O();return"[null]"!=B([t])||"{}"!=B({a:t})||"{}"!=B(Object(t))}))),"JSON",{stringify:function(t){for(var e,i,n=[t],o=1;arguments.length>o;)n.push(arguments[o++]);if(i=e=n[1],(F(e)||void 0!==t)&&!Y(t))return S(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!Y(e))return e}),n[1]=e,B.apply(N,n)}}),O.prototype[M]||i(11)(O.prototype,M,O.prototype.valueOf),u(O,"Symbol"),u(Math,"Math",!0),u(n.JSON,"JSON",!0)},function(t,e,i){t.exports=i(47)("native-function-to-string",Function.toString)},function(t,e,i){var n=i(34),o=i(53),r=i(49);t.exports=function(t){var e=n(t),i=o.f;if(i)for(var s,a=i(t),l=r.f,h=0;a.length>h;)l.call(t,s=a[h++])&&e.push(s);return e}},function(t,e,i){var n=i(0);n(n.S,"Object",{create:i(36)})},function(t,e,i){var n=i(0);n(n.S+n.F*!i(7),"Object",{defineProperty:i(8).f})},function(t,e,i){var n=i(0);n(n.S+n.F*!i(7),"Object",{defineProperties:i(97)})},function(t,e,i){var n=i(15),o=i(16).f;i(25)("getOwnPropertyDescriptor",(function(){return function(t,e){return o(n(t),e)}}))},function(t,e,i){var n=i(9),o=i(17);i(25)("getPrototypeOf",(function(){return function(t){return o(n(t))}}))},function(t,e,i){var n=i(9),o=i(34);i(25)("keys",(function(){return function(t){return o(n(t))}}))},function(t,e,i){i(25)("getOwnPropertyNames",(function(){return i(98).f}))},function(t,e,i){var n=i(4),o=i(30).onFreeze;i(25)("freeze",(function(t){return function(e){return t&&n(e)?t(o(e)):e}}))},function(t,e,i){var n=i(4),o=i(30).onFreeze;i(25)("seal",(function(t){return function(e){return t&&n(e)?t(o(e)):e}}))},function(t,e,i){var n=i(4),o=i(30).onFreeze;i(25)("preventExtensions",(function(t){return function(e){return t&&n(e)?t(o(e)):e}}))},function(t,e,i){var n=i(4);i(25)("isFrozen",(function(t){return function(e){return!n(e)||!!t&&t(e)}}))},function(t,e,i){var n=i(4);i(25)("isSealed",(function(t){return function(e){return!n(e)||!!t&&t(e)}}))},function(t,e,i){var n=i(4);i(25)("isExtensible",(function(t){return function(e){return!!n(e)&&(!t||t(e))}}))},function(t,e,i){var n=i(0);n(n.S+n.F,"Object",{assign:i(99)})},function(t,e,i){var n=i(0);n(n.S,"Object",{is:i(100)})},function(t,e,i){var n=i(0);n(n.S,"Object",{setPrototypeOf:i(71).set})},function(t,e,i){"use strict";var n=i(44),o={};o[i(5)("toStringTag")]="z",o+""!="[object z]"&&i(12)(Object.prototype,"toString",(function(){return"[object "+n(this)+"]"}),!0)},function(t,e,i){var n=i(0);n(n.P,"Function",{bind:i(101)})},function(t,e,i){var n=i(8).f,o=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in o||i(7)&&n(o,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},function(t,e,i){"use strict";var n=i(4),o=i(17),r=i(5)("hasInstance"),s=Function.prototype;r in s||i(8).f(s,r,{value:function(t){if("function"!=typeof this||!n(t))return!1;if(!n(this.prototype))return t instanceof this;for(;t=o(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,i){var n=i(0),o=i(103);n(n.G+n.F*(parseInt!=o),{parseInt:o})},function(t,e,i){var n=i(0),o=i(104);n(n.G+n.F*(parseFloat!=o),{parseFloat:o})},function(t,e,i){"use strict";var n=i(2),o=i(14),r=i(20),s=i(73),a=i(23),l=i(3),h=i(37).f,c=i(16).f,u=i(8).f,f=i(45).trim,d=n.Number,m=d,y=d.prototype,p="Number"==r(i(36)(y)),S="trim"in String.prototype,v=function(t){var e=a(t,!1);if("string"==typeof e&&e.length>2){var i,n,o,r=(e=S?e.trim():f(e,3)).charCodeAt(0);if(43===r||45===r){if(88===(i=e.charCodeAt(2))||120===i)return NaN}else if(48===r){switch(e.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+e}for(var s,l=e.slice(2),h=0,c=l.length;h<c;h++)if((s=l.charCodeAt(h))<48||s>o)return NaN;return parseInt(l,n)}}return+e};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var e=arguments.length<1?0:t,i=this;return i instanceof d&&(p?l((function(){y.valueOf.call(i)})):"Number"!=r(i))?s(new m(v(e)),i,d):v(e)};for(var F,I=i(7)?h(m):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),g=0;I.length>g;g++)o(m,F=I[g])&&!o(d,F)&&u(d,F,c(m,F));d.prototype=y,y.constructor=d,i(12)(n,"Number",d)}},function(t,e,i){"use strict";var n=i(0),o=i(21),r=i(105),s=i(74),a=1..toFixed,l=Math.floor,h=[0,0,0,0,0,0],c="Number.toFixed: incorrect invocation!",u=function(t,e){for(var i=-1,n=e;++i<6;)n+=t*h[i],h[i]=n%1e7,n=l(n/1e7)},f=function(t){for(var e=6,i=0;--e>=0;)i+=h[e],h[e]=l(i/t),i=i%t*1e7},d=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==h[t]){var i=String(h[t]);e=""===e?i:e+s.call("0",7-i.length)+i}return e},m=function(t,e,i){return 0===e?i:e%2==1?m(t,e-1,i*t):m(t*t,e/2,i)};n(n.P+n.F*(!!a&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!i(3)((function(){a.call({})}))),"Number",{toFixed:function(t){var e,i,n,a,l=r(this,c),h=o(t),y="",p="0";if(h<0||h>20)throw RangeError(c);if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(y="-",l=-l),l>1e-21)if(i=(e=function(t){for(var e=0,i=t;i>=4096;)e+=12,i/=4096;for(;i>=2;)e+=1,i/=2;return e}(l*m(2,69,1))-69)<0?l*m(2,-e,1):l/m(2,e,1),i*=4503599627370496,(e=52-e)>0){for(u(0,i),n=h;n>=7;)u(1e7,0),n-=7;for(u(m(10,n,1),0),n=e-1;n>=23;)f(1<<23),n-=23;f(1<<n),u(1,1),f(2),p=d()}else u(0,i),u(1<<-e,0),p=d()+s.call("0",h);return p=h>0?y+((a=p.length)<=h?"0."+s.call("0",h-a)+p:p.slice(0,a-h)+"."+p.slice(a-h)):y+p}})},function(t,e,i){"use strict";var n=i(0),o=i(3),r=i(105),s=1..toPrecision;n(n.P+n.F*(o((function(){return"1"!==s.call(1,void 0)}))||!o((function(){s.call({})}))),"Number",{toPrecision:function(t){var e=r(this,"Number#toPrecision: incorrect invocation!");return void 0===t?s.call(e):s.call(e,t)}})},function(t,e,i){var n=i(0);n(n.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,i){var n=i(0),o=i(2).isFinite;n(n.S,"Number",{isFinite:function(t){return"number"==typeof t&&o(t)}})},function(t,e,i){var n=i(0);n(n.S,"Number",{isInteger:i(106)})},function(t,e,i){var n=i(0);n(n.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,i){var n=i(0),o=i(106),r=Math.abs;n(n.S,"Number",{isSafeInteger:function(t){return o(t)&&r(t)<=9007199254740991}})},function(t,e,i){var n=i(0);n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,i){var n=i(0);n(n.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,i){var n=i(0),o=i(104);n(n.S+n.F*(Number.parseFloat!=o),"Number",{parseFloat:o})},function(t,e,i){var n=i(0),o=i(103);n(n.S+n.F*(Number.parseInt!=o),"Number",{parseInt:o})},function(t,e,i){var n=i(0),o=i(107),r=Math.sqrt,s=Math.acosh;n(n.S+n.F*!(s&&710==Math.floor(s(Number.MAX_VALUE))&&s(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:o(t-1+r(t-1)*r(t+1))}})},function(t,e,i){var n=i(0),o=Math.asinh;n(n.S+n.F*!(o&&1/o(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},function(t,e,i){var n=i(0),o=Math.atanh;n(n.S+n.F*!(o&&1/o(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,e,i){var n=i(0),o=i(75);n(n.S,"Math",{cbrt:function(t){return o(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,e,i){var n=i(0);n(n.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,e,i){var n=i(0),o=Math.exp;n(n.S,"Math",{cosh:function(t){return(o(t=+t)+o(-t))/2}})},function(t,e,i){var n=i(0),o=i(76);n(n.S+n.F*(o!=Math.expm1),"Math",{expm1:o})},function(t,e,i){var n=i(0);n(n.S,"Math",{fround:i(108)})},function(t,e,i){var n=i(0),o=Math.abs;n(n.S,"Math",{hypot:function(t,e){for(var i,n,r=0,s=0,a=arguments.length,l=0;s<a;)l<(i=o(arguments[s++]))?(r=r*(n=l/i)*n+1,l=i):r+=i>0?(n=i/l)*n:i;return l===1/0?1/0:l*Math.sqrt(r)}})},function(t,e,i){var n=i(0),o=Math.imul;n(n.S+n.F*i(3)((function(){return-5!=o(4294967295,5)||2!=o.length})),"Math",{imul:function(t,e){var i=+t,n=+e,o=65535&i,r=65535&n;return 0|o*r+((65535&i>>>16)*r+o*(65535&n>>>16)<<16>>>0)}})},function(t,e,i){var n=i(0);n(n.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},function(t,e,i){var n=i(0);n(n.S,"Math",{log1p:i(107)})},function(t,e,i){var n=i(0);n(n.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,i){var n=i(0);n(n.S,"Math",{sign:i(75)})},function(t,e,i){var n=i(0),o=i(76),r=Math.exp;n(n.S+n.F*i(3)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(o(t)-o(-t))/2:(r(t-1)-r(-t-1))*(Math.E/2)}})},function(t,e,i){var n=i(0),o=i(76),r=Math.exp;n(n.S,"Math",{tanh:function(t){var e=o(t=+t),i=o(-t);return e==1/0?1:i==1/0?-1:(e-i)/(r(t)+r(-t))}})},function(t,e,i){var n=i(0);n(n.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,e,i){var n=i(0),o=i(35),r=String.fromCharCode,s=String.fromCodePoint;n(n.S+n.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(t){for(var e,i=[],n=arguments.length,s=0;n>s;){if(e=+arguments[s++],o(e,1114111)!==e)throw RangeError(e+" is not a valid code point");i.push(e<65536?r(e):r(55296+((e-=65536)>>10),e%1024+56320))}return i.join("")}})},function(t,e,i){var n=i(0),o=i(15),r=i(6);n(n.S,"String",{raw:function(t){for(var e=o(t.raw),i=r(e.length),n=arguments.length,s=[],a=0;i>a;)s.push(String(e[a++])),a<n&&s.push(String(arguments[a]));return s.join("")}})},function(t,e,i){"use strict";i(45)("trim",(function(t){return function(){return t(this,3)}}))},function(t,e,i){"use strict";var n=i(55)(!0);i(77)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=n(e,i),this._i+=t.length,{value:t,done:!1})}))},function(t,e,i){"use strict";var n=i(0),o=i(55)(!1);n(n.P,"String",{codePointAt:function(t){return o(this,t)}})},function(t,e,i){"use strict";var n=i(0),o=i(6),r=i(79),s="".endsWith;n(n.P+n.F*i(80)("endsWith"),"String",{endsWith:function(t){var e=r(this,t,"endsWith"),i=arguments.length>1?arguments[1]:void 0,n=o(e.length),a=void 0===i?n:Math.min(o(i),n),l=String(t);return s?s.call(e,l,a):e.slice(a-l.length,a)===l}})},function(t,e,i){"use strict";var n=i(0),o=i(79);n(n.P+n.F*i(80)("includes"),"String",{includes:function(t){return!!~o(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,i){var n=i(0);n(n.P,"String",{repeat:i(74)})},function(t,e,i){"use strict";var n=i(0),o=i(6),r=i(79),s="".startsWith;n(n.P+n.F*i(80)("startsWith"),"String",{startsWith:function(t){var e=r(this,t,"startsWith"),i=o(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),n=String(t);return s?s.call(e,n,i):e.slice(i,i+n.length)===n}})},function(t,e,i){"use strict";i(13)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},function(t,e,i){"use strict";i(13)("big",(function(t){return function(){return t(this,"big","","")}}))},function(t,e,i){"use strict";i(13)("blink",(function(t){return function(){return t(this,"blink","","")}}))},function(t,e,i){"use strict";i(13)("bold",(function(t){return function(){return t(this,"b","","")}}))},function(t,e,i){"use strict";i(13)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},function(t,e,i){"use strict";i(13)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},function(t,e,i){"use strict";i(13)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},function(t,e,i){"use strict";i(13)("italics",(function(t){return function(){return t(this,"i","","")}}))},function(t,e,i){"use strict";i(13)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},function(t,e,i){"use strict";i(13)("small",(function(t){return function(){return t(this,"small","","")}}))},function(t,e,i){"use strict";i(13)("strike",(function(t){return function(){return t(this,"strike","","")}}))},function(t,e,i){"use strict";i(13)("sub",(function(t){return function(){return t(this,"sub","","")}}))},function(t,e,i){"use strict";i(13)("sup",(function(t){return function(){return t(this,"sup","","")}}))},function(t,e,i){var n=i(0);n(n.S,"Date",{now:function(){return(new Date).getTime()}})},function(t,e,i){"use strict";var n=i(0),o=i(9),r=i(23);n(n.P+n.F*i(3)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=o(this),i=r(e);return"number"!=typeof i||isFinite(i)?e.toISOString():null}})},function(t,e,i){var n=i(0),o=i(212);n(n.P+n.F*(Date.prototype.toISOString!==o),"Date",{toISOString:o})},function(t,e,i){"use strict";var n=i(3),o=Date.prototype.getTime,r=Date.prototype.toISOString,s=function(t){return t>9?t:"0"+t};t.exports=n((function(){return"0385-07-25T07:06:39.999Z"!=r.call(new Date(-50000000000001))}))||!n((function(){r.call(new Date(NaN))}))?function(){if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),i=t.getUTCMilliseconds(),n=e<0?"-":e>9999?"+":"";return n+("00000"+Math.abs(e)).slice(n?-6:-4)+"-"+s(t.getUTCMonth()+1)+"-"+s(t.getUTCDate())+"T"+s(t.getUTCHours())+":"+s(t.getUTCMinutes())+":"+s(t.getUTCSeconds())+"."+(i>99?i:"0"+s(i))+"Z"}:r},function(t,e,i){var n=Date.prototype,o=n.toString,r=n.getTime;new Date(NaN)+""!="Invalid Date"&&i(12)(n,"toString",(function(){var t=r.call(this);return t==t?o.call(this):"Invalid Date"}))},function(t,e,i){var n=i(5)("toPrimitive"),o=Date.prototype;n in o||i(11)(o,n,i(215))},function(t,e,i){"use strict";var n=i(1),o=i(23);t.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return o(n(this),"number"!=t)}},function(t,e,i){var n=i(0);n(n.S,"Array",{isArray:i(54)})},function(t,e,i){"use strict";var n=i(19),o=i(0),r=i(9),s=i(109),a=i(81),l=i(6),h=i(82),c=i(83);o(o.S+o.F*!i(57)((function(t){Array.from(t)})),"Array",{from:function(t){var e,i,o,u,f=r(t),d="function"==typeof this?this:Array,m=arguments.length,y=m>1?arguments[1]:void 0,p=void 0!==y,S=0,v=c(f);if(p&&(y=n(y,m>2?arguments[2]:void 0,2)),null==v||d==Array&&a(v))for(i=new d(e=l(f.length));e>S;S++)h(i,S,p?y(f[S],S):f[S]);else for(u=v.call(f),i=new d;!(o=u.next()).done;S++)h(i,S,p?s(u,y,[o.value,S],!0):o.value);return i.length=S,i}})},function(t,e,i){"use strict";var n=i(0),o=i(82);n(n.S+n.F*i(3)((function(){function t(){}return!(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=0,e=arguments.length,i=new("function"==typeof this?this:Array)(e);e>t;)o(i,t,arguments[t++]);return i.length=e,i}})},function(t,e,i){"use strict";var n=i(0),o=i(15),r=[].join;n(n.P+n.F*(i(48)!=Object||!i(22)(r)),"Array",{join:function(t){return r.call(o(this),void 0===t?",":t)}})},function(t,e,i){"use strict";var n=i(0),o=i(70),r=i(20),s=i(35),a=i(6),l=[].slice;n(n.P+n.F*i(3)((function(){o&&l.call(o)})),"Array",{slice:function(t,e){var i=a(this.length),n=r(this);if(e=void 0===e?i:e,"Array"==n)return l.call(this,t,e);for(var o=s(t,i),h=s(e,i),c=a(h-o),u=new Array(c),f=0;f<c;f++)u[f]="String"==n?this.charAt(o+f):this[o+f];return u}})},function(t,e,i){"use strict";var n=i(0),o=i(10),r=i(9),s=i(3),a=[].sort,l=[1,2,3];n(n.P+n.F*(s((function(){l.sort(void 0)}))||!s((function(){l.sort(null)}))||!i(22)(a)),"Array",{sort:function(t){return void 0===t?a.call(r(this)):a.call(r(this),o(t))}})},function(t,e,i){"use strict";var n=i(0),o=i(26)(0),r=i(22)([].forEach,!0);n(n.P+n.F*!r,"Array",{forEach:function(t){return o(this,t,arguments[1])}})},function(t,e,i){var n=i(4),o=i(54),r=i(5)("species");t.exports=function(t){var e;return o(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!o(e.prototype)||(e=void 0),n(e)&&null===(e=e[r])&&(e=void 0)),void 0===e?Array:e}},function(t,e,i){"use strict";var n=i(0),o=i(26)(1);n(n.P+n.F*!i(22)([].map,!0),"Array",{map:function(t){return o(this,t,arguments[1])}})},function(t,e,i){"use strict";var n=i(0),o=i(26)(2);n(n.P+n.F*!i(22)([].filter,!0),"Array",{filter:function(t){return o(this,t,arguments[1])}})},function(t,e,i){"use strict";var n=i(0),o=i(26)(3);n(n.P+n.F*!i(22)([].some,!0),"Array",{some:function(t){return o(this,t,arguments[1])}})},function(t,e,i){"use strict";var n=i(0),o=i(26)(4);n(n.P+n.F*!i(22)([].every,!0),"Array",{every:function(t){return o(this,t,arguments[1])}})},function(t,e,i){"use strict";var n=i(0),o=i(110);n(n.P+n.F*!i(22)([].reduce,!0),"Array",{reduce:function(t){return o(this,t,arguments.length,arguments[1],!1)}})},function(t,e,i){"use strict";var n=i(0),o=i(110);n(n.P+n.F*!i(22)([].reduceRight,!0),"Array",{reduceRight:function(t){return o(this,t,arguments.length,arguments[1],!0)}})},function(t,e,i){"use strict";var n=i(0),o=i(52)(!1),r=[].indexOf,s=!!r&&1/[1].indexOf(1,-0)<0;n(n.P+n.F*(s||!i(22)(r)),"Array",{indexOf:function(t){return s?r.apply(this,arguments)||0:o(this,t,arguments[1])}})},function(t,e,i){"use strict";var n=i(0),o=i(15),r=i(21),s=i(6),a=[].lastIndexOf,l=!!a&&1/[1].lastIndexOf(1,-0)<0;n(n.P+n.F*(l||!i(22)(a)),"Array",{lastIndexOf:function(t){if(l)return a.apply(this,arguments)||0;var e=o(this),i=s(e.length),n=i-1;for(arguments.length>1&&(n=Math.min(n,r(arguments[1]))),n<0&&(n=i+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}})},function(t,e,i){var n=i(0);n(n.P,"Array",{copyWithin:i(111)}),i(31)("copyWithin")},function(t,e,i){var n=i(0);n(n.P,"Array",{fill:i(85)}),i(31)("fill")},function(t,e,i){"use strict";var n=i(0),o=i(26)(5),r=!0;"find"in[]&&Array(1).find((function(){r=!1})),n(n.P+n.F*r,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i(31)("find")},function(t,e,i){"use strict";var n=i(0),o=i(26)(6),r="findIndex",s=!0;r in[]&&Array(1)[r]((function(){s=!1})),n(n.P+n.F*s,"Array",{findIndex:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i(31)(r)},function(t,e,i){i(38)("Array")},function(t,e,i){var n=i(2),o=i(73),r=i(8).f,s=i(37).f,a=i(56),l=i(50),h=n.RegExp,c=h,u=h.prototype,f=/a/g,d=/a/g,m=new h(f)!==f;if(i(7)&&(!m||i(3)((function(){return d[i(5)("match")]=!1,h(f)!=f||h(d)==d||"/a/i"!=h(f,"i")})))){h=function(t,e){var i=this instanceof h,n=a(t),r=void 0===e;return!i&&n&&t.constructor===h&&r?t:o(m?new c(n&&!r?t.source:t,e):c((n=t instanceof h)?t.source:t,n&&r?l.call(t):e),i?this:u,h)};for(var y=function(t){t in h||r(h,t,{configurable:!0,get:function(){return c[t]},set:function(e){c[t]=e}})},p=s(c),S=0;p.length>S;)y(p[S++]);u.constructor=h,h.prototype=u,i(12)(n,"RegExp",h)}i(38)("RegExp")},function(t,e,i){"use strict";i(114);var n=i(1),o=i(50),r=i(7),s=/./.toString,a=function(t){i(12)(RegExp.prototype,"toString",t,!0)};i(3)((function(){return"/a/b"!=s.call({source:"a",flags:"b"})}))?a((function(){var t=n(this);return"/".concat(t.source,"/","flags"in t?t.flags:!r&&t instanceof RegExp?o.call(t):void 0)})):"toString"!=s.name&&a((function(){return s.call(this)}))},function(t,e,i){"use strict";var n=i(1),o=i(6),r=i(88),s=i(58);i(59)("match",1,(function(t,e,i,a){return[function(i){var n=t(this),o=null==i?void 0:i[e];return void 0!==o?o.call(i,n):new RegExp(i)[e](String(n))},function(t){var e=a(i,t,this);if(e.done)return e.value;var l=n(t),h=String(this);if(!l.global)return s(l,h);var c=l.unicode;l.lastIndex=0;for(var u,f=[],d=0;null!==(u=s(l,h));){var m=String(u[0]);f[d]=m,""===m&&(l.lastIndex=r(h,o(l.lastIndex),c)),d++}return 0===d?null:f}]}))},function(t,e,i){"use strict";var n=i(1),o=i(9),r=i(6),s=i(21),a=i(88),l=i(58),h=Math.max,c=Math.min,u=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g;i(59)("replace",2,(function(t,e,i,m){return[function(n,o){var r=t(this),s=null==n?void 0:n[e];return void 0!==s?s.call(n,r,o):i.call(String(r),n,o)},function(t,e){var o=m(i,t,this,e);if(o.done)return o.value;var u=n(t),f=String(this),d="function"==typeof e;d||(e=String(e));var p=u.global;if(p){var S=u.unicode;u.lastIndex=0}for(var v=[];;){var F=l(u,f);if(null===F)break;if(v.push(F),!p)break;""===String(F[0])&&(u.lastIndex=a(f,r(u.lastIndex),S))}for(var I,g="",w=0,C=0;C<v.length;C++){F=v[C];for(var k=String(F[0]),P=h(c(s(F.index),f.length),0),D=[],b=1;b<F.length;b++)D.push(void 0===(I=F[b])?I:String(I));var R=F.groups;if(d){var _=[k].concat(D,P,f);void 0!==R&&_.push(R);var x=String(e.apply(void 0,_))}else x=y(k,f,P,D,R,e);P>=w&&(g+=f.slice(w,P)+x,w=P+k.length)}return g+f.slice(w)}];function y(t,e,n,r,s,a){var l=n+t.length,h=r.length,c=d;return void 0!==s&&(s=o(s),c=f),i.call(a,c,(function(i,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(l);case"<":a=s[o.slice(1,-1)];break;default:var c=+o;if(0===c)return i;if(c>h){var f=u(c/10);return 0===f?i:f<=h?void 0===r[f-1]?o.charAt(1):r[f-1]+o.charAt(1):i}a=r[c-1]}return void 0===a?"":a}))}}))},function(t,e,i){"use strict";var n=i(1),o=i(100),r=i(58);i(59)("search",1,(function(t,e,i,s){return[function(i){var n=t(this),o=null==i?void 0:i[e];return void 0!==o?o.call(i,n):new RegExp(i)[e](String(n))},function(t){var e=s(i,t,this);if(e.done)return e.value;var a=n(t),l=String(this),h=a.lastIndex;o(h,0)||(a.lastIndex=0);var c=r(a,l);return o(a.lastIndex,h)||(a.lastIndex=h),null===c?-1:c.index}]}))},function(t,e,i){"use strict";var n=i(56),o=i(1),r=i(51),s=i(88),a=i(6),l=i(58),h=i(87),c=i(3),u=Math.min,f=[].push,d="length",m=!c((function(){RegExp(4294967295,"y")}));i(59)("split",2,(function(t,e,i,c){var y;return y="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[d]||2!="ab".split(/(?:ab)*/)[d]||4!=".".split(/(.?)(.?)/)[d]||".".split(/()()/)[d]>1||"".split(/.?/)[d]?function(t,e){var o=String(this);if(void 0===t&&0===e)return[];if(!n(t))return i.call(o,t,e);for(var r,s,a,l=[],c=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),u=0,m=void 0===e?4294967295:e>>>0,y=new RegExp(t.source,c+"g");(r=h.call(y,o))&&!((s=y.lastIndex)>u&&(l.push(o.slice(u,r.index)),r[d]>1&&r.index<o[d]&&f.apply(l,r.slice(1)),a=r[0][d],u=s,l[d]>=m));)y.lastIndex===r.index&&y.lastIndex++;return u===o[d]?!a&&y.test("")||l.push(""):l.push(o.slice(u)),l[d]>m?l.slice(0,m):l}:"0".split(void 0,0)[d]?function(t,e){return void 0===t&&0===e?[]:i.call(this,t,e)}:i,[function(i,n){var o=t(this),r=null==i?void 0:i[e];return void 0!==r?r.call(i,o,n):y.call(String(o),i,n)},function(t,e){var n=c(y,t,this,e,y!==i);if(n.done)return n.value;var h=o(t),f=String(this),d=r(h,RegExp),p=h.unicode,S=(h.ignoreCase?"i":"")+(h.multiline?"m":"")+(h.unicode?"u":"")+(m?"y":"g"),v=new d(m?h:"^(?:"+h.source+")",S),F=void 0===e?4294967295:e>>>0;if(0===F)return[];if(0===f.length)return null===l(v,f)?[f]:[];for(var I=0,g=0,w=[];g<f.length;){v.lastIndex=m?g:0;var C,k=l(v,m?f:f.slice(g));if(null===k||(C=u(a(v.lastIndex+(m?0:g)),f.length))===I)g=s(f,g,p);else{if(w.push(f.slice(I,g)),w.length===F)return w;for(var P=1;P<=k.length-1;P++)if(w.push(k[P]),w.length===F)return w;g=I=C}}return w.push(f.slice(I)),w}]}))},function(t,e,i){"use strict";var n,o,r,s,a=i(29),l=i(2),h=i(19),c=i(44),u=i(0),f=i(4),d=i(10),m=i(39),y=i(40),p=i(51),S=i(89).set,v=i(90)(),F=i(91),I=i(115),g=i(60),w=i(116),C=l.TypeError,k=l.process,P=k&&k.versions,D=P&&P.v8||"",b=l.Promise,R="process"==c(k),_=function(){},x=o=F.f,A=!!function(){try{var t=b.resolve(1),e=(t.constructor={})[i(5)("species")]=function(t){t(_,_)};return(R||"function"==typeof PromiseRejectionEvent)&&t.then(_)instanceof e&&0!==D.indexOf("6.6")&&-1===g.indexOf("Chrome/66")}catch(t){}}(),T=function(t){var e;return!(!f(t)||"function"!=typeof(e=t.then))&&e},O=function(t,e){if(!t._n){t._n=!0;var i=t._c;v((function(){for(var n=t._v,o=1==t._s,r=0,s=function(e){var i,r,s,a=o?e.ok:e.fail,l=e.resolve,h=e.reject,c=e.domain;try{a?(o||(2==t._h&&E(t),t._h=1),!0===a?i=n:(c&&c.enter(),i=a(n),c&&(c.exit(),s=!0)),i===e.promise?h(C("Promise-chain cycle")):(r=T(i))?r.call(i,l,h):l(i)):h(n)}catch(t){c&&!s&&c.exit(),h(t)}};i.length>r;)s(i[r++]);t._c=[],t._n=!1,e&&!t._h&&N(t)}))}},N=function(t){S.call(l,(function(){var e,i,n,o=t._v,r=B(t);if(r&&(e=I((function(){R?k.emit("unhandledRejection",o,t):(i=l.onunhandledrejection)?i({promise:t,reason:o}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",o)})),t._h=R||B(t)?2:1),t._a=void 0,r&&e.e)throw e.v}))},B=function(t){return 1!==t._h&&0===(t._a||t._c).length},E=function(t){S.call(l,(function(){var e;R?k.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})}))},M=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),O(e,!0))},L=function(t){var e,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===t)throw C("Promise can't be resolved itself");(e=T(t))?v((function(){var n={_w:i,_d:!1};try{e.call(t,h(L,n,1),h(M,n,1))}catch(t){M.call(n,t)}})):(i._v=t,i._s=1,O(i,!1))}catch(t){M.call({_w:i,_d:!1},t)}}};A||(b=function(t){m(this,b,"Promise","_h"),d(t),n.call(this);try{t(h(L,this,1),h(M,this,1))}catch(t){M.call(this,t)}},(n=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i(41)(b.prototype,{then:function(t,e){var i=x(p(this,b));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=R?k.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&O(this,!1),i.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new n;this.promise=t,this.resolve=h(L,t,1),this.reject=h(M,t,1)},F.f=x=function(t){return t===b||t===s?new r(t):o(t)}),u(u.G+u.W+u.F*!A,{Promise:b}),i(43)(b,"Promise"),i(38)("Promise"),s=i(18).Promise,u(u.S+u.F*!A,"Promise",{reject:function(t){var e=x(this);return(0,e.reject)(t),e.promise}}),u(u.S+u.F*(a||!A),"Promise",{resolve:function(t){return w(a&&this===s?b:this,t)}}),u(u.S+u.F*!(A&&i(57)((function(t){b.all(t).catch(_)}))),"Promise",{all:function(t){var e=this,i=x(e),n=i.resolve,o=i.reject,r=I((function(){var i=[],r=0,s=1;y(t,!1,(function(t){var a=r++,l=!1;i.push(void 0),s++,e.resolve(t).then((function(t){l||(l=!0,i[a]=t,--s||n(i))}),o)})),--s||n(i)}));return r.e&&o(r.v),i.promise},race:function(t){var e=this,i=x(e),n=i.reject,o=I((function(){y(t,!1,(function(t){e.resolve(t).then(i.resolve,n)}))}));return o.e&&n(o.v),i.promise}})},function(t,e,i){"use strict";var n=i(121),o=i(42);i(61)("WeakSet",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return n.def(o(this,"WeakSet"),t,!0)}},n,!1,!0)},function(t,e,i){"use strict";var n=i(0),o=i(62),r=i(92),s=i(1),a=i(35),l=i(6),h=i(4),c=i(2).ArrayBuffer,u=i(51),f=r.ArrayBuffer,d=r.DataView,m=o.ABV&&c.isView,y=f.prototype.slice,p=o.VIEW;n(n.G+n.W+n.F*(c!==f),{ArrayBuffer:f}),n(n.S+n.F*!o.CONSTR,"ArrayBuffer",{isView:function(t){return m&&m(t)||h(t)&&p in t}}),n(n.P+n.U+n.F*i(3)((function(){return!new f(2).slice(1,void 0).byteLength})),"ArrayBuffer",{slice:function(t,e){if(void 0!==y&&void 0===e)return y.call(s(this),t);for(var i=s(this).byteLength,n=a(t,i),o=a(void 0===e?i:e,i),r=new(u(this,f))(l(o-n)),h=new d(this),c=new d(r),m=0;n<o;)c.setUint8(m++,h.getUint8(n++));return r}}),i(38)("ArrayBuffer")},function(t,e,i){var n=i(0);n(n.G+n.W+n.F*!i(62).ABV,{DataView:i(92).DataView})},function(t,e,i){i(27)("Int8",1,(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){i(27)("Uint8",1,(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){i(27)("Uint8",1,(function(t){return function(e,i,n){return t(this,e,i,n)}}),!0)},function(t,e,i){i(27)("Int16",2,(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){i(27)("Uint16",2,(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){i(27)("Int32",4,(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){i(27)("Uint32",4,(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){i(27)("Float32",4,(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){i(27)("Float64",8,(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){var n=i(0),o=i(10),r=i(1),s=(i(2).Reflect||{}).apply,a=Function.apply;n(n.S+n.F*!i(3)((function(){s((function(){}))})),"Reflect",{apply:function(t,e,i){var n=o(t),l=r(i);return s?s(n,e,l):a.call(n,e,l)}})},function(t,e,i){var n=i(0),o=i(36),r=i(10),s=i(1),a=i(4),l=i(3),h=i(101),c=(i(2).Reflect||{}).construct,u=l((function(){function t(){}return!(c((function(){}),[],t)instanceof t)})),f=!l((function(){c((function(){}))}));n(n.S+n.F*(u||f),"Reflect",{construct:function(t,e){r(t),s(e);var i=arguments.length<3?t:r(arguments[2]);if(f&&!u)return c(t,e,i);if(t==i){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return n.push.apply(n,e),new(h.apply(t,n))}var l=i.prototype,d=o(a(l)?l:Object.prototype),m=Function.apply.call(t,d,e);return a(m)?m:d}})},function(t,e,i){var n=i(8),o=i(0),r=i(1),s=i(23);o(o.S+o.F*i(3)((function(){Reflect.defineProperty(n.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(t,e,i){r(t),e=s(e,!0),r(i);try{return n.f(t,e,i),!0}catch(t){return!1}}})},function(t,e,i){var n=i(0),o=i(16).f,r=i(1);n(n.S,"Reflect",{deleteProperty:function(t,e){var i=o(r(t),e);return!(i&&!i.configurable)&&delete t[e]}})},function(t,e,i){"use strict";var n=i(0),o=i(1),r=function(t){this._t=o(t),this._i=0;var e,i=this._k=[];for(e in t)i.push(e)};i(78)(r,"Object",(function(){var t,e=this._k;do{if(this._i>=e.length)return{value:void 0,done:!0}}while(!((t=e[this._i++])in this._t));return{value:t,done:!1}})),n(n.S,"Reflect",{enumerate:function(t){return new r(t)}})},function(t,e,i){var n=i(16),o=i(17),r=i(14),s=i(0),a=i(4),l=i(1);s(s.S,"Reflect",{get:function t(e,i){var s,h,c=arguments.length<3?e:arguments[2];return l(e)===c?e[i]:(s=n.f(e,i))?r(s,"value")?s.value:void 0!==s.get?s.get.call(c):void 0:a(h=o(e))?t(h,i,c):void 0}})},function(t,e,i){var n=i(16),o=i(0),r=i(1);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return n.f(r(t),e)}})},function(t,e,i){var n=i(0),o=i(17),r=i(1);n(n.S,"Reflect",{getPrototypeOf:function(t){return o(r(t))}})},function(t,e,i){var n=i(0);n(n.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,i){var n=i(0),o=i(1),r=Object.isExtensible;n(n.S,"Reflect",{isExtensible:function(t){return o(t),!r||r(t)}})},function(t,e,i){var n=i(0);n(n.S,"Reflect",{ownKeys:i(123)})},function(t,e,i){var n=i(0),o=i(1),r=Object.preventExtensions;n(n.S,"Reflect",{preventExtensions:function(t){o(t);try{return r&&r(t),!0}catch(t){return!1}}})},function(t,e,i){var n=i(8),o=i(16),r=i(17),s=i(14),a=i(0),l=i(32),h=i(1),c=i(4);a(a.S,"Reflect",{set:function t(e,i,a){var u,f,d=arguments.length<4?e:arguments[3],m=o.f(h(e),i);if(!m){if(c(f=r(e)))return t(f,i,a,d);m=l(0)}if(s(m,"value")){if(!1===m.writable||!c(d))return!1;if(u=o.f(d,i)){if(u.get||u.set||!1===u.writable)return!1;u.value=a,n.f(d,i,u)}else n.f(d,i,l(0,a));return!0}return void 0!==m.set&&(m.set.call(d,a),!0)}})},function(t,e,i){var n=i(0),o=i(71);o&&n(n.S,"Reflect",{setPrototypeOf:function(t,e){o.check(t,e);try{return o.set(t,e),!0}catch(t){return!1}}})},function(t,e,i){"use strict";var n=i(0),o=i(52)(!0);n(n.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i(31)("includes")},function(t,e,i){"use strict";var n=i(0),o=i(124),r=i(9),s=i(6),a=i(10),l=i(84);n(n.P,"Array",{flatMap:function(t){var e,i,n=r(this);return a(t),e=s(n.length),i=l(n,0),o(i,n,n,e,0,1,t,arguments[1]),i}}),i(31)("flatMap")},function(t,e,i){"use strict";var n=i(0),o=i(124),r=i(9),s=i(6),a=i(21),l=i(84);n(n.P,"Array",{flatten:function(){var t=arguments[0],e=r(this),i=s(e.length),n=l(e,0);return o(n,e,e,i,0,void 0===t?1:a(t)),n}}),i(31)("flatten")},function(t,e,i){"use strict";var n=i(0),o=i(55)(!0);n(n.P,"String",{at:function(t){return o(this,t)}})},function(t,e,i){"use strict";var n=i(0),o=i(125),r=i(60),s=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r);n(n.P+n.F*s,"String",{padStart:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},function(t,e,i){"use strict";var n=i(0),o=i(125),r=i(60),s=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r);n(n.P+n.F*s,"String",{padEnd:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},function(t,e,i){"use strict";i(45)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},function(t,e,i){"use strict";i(45)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},function(t,e,i){"use strict";var n=i(0),o=i(24),r=i(6),s=i(56),a=i(50),l=RegExp.prototype,h=function(t,e){this._r=t,this._s=e};i(78)(h,"RegExp String",(function(){var t=this._r.exec(this._s);return{value:t,done:null===t}})),n(n.P,"String",{matchAll:function(t){if(o(this),!s(t))throw TypeError(t+" is not a regexp!");var e=String(this),i="flags"in l?String(t.flags):a.call(t),n=new RegExp(t.source,~i.indexOf("g")?i:"g"+i);return n.lastIndex=r(t.lastIndex),new h(n,e)}})},function(t,e,i){i(67)("asyncIterator")},function(t,e,i){i(67)("observable")},function(t,e,i){var n=i(0),o=i(123),r=i(15),s=i(16),a=i(82);n(n.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,i,n=r(t),l=s.f,h=o(n),c={},u=0;h.length>u;)void 0!==(i=l(n,e=h[u++]))&&a(c,e,i);return c}})},function(t,e,i){var n=i(0),o=i(126)(!1);n(n.S,"Object",{values:function(t){return o(t)}})},function(t,e,i){var n=i(0),o=i(126)(!0);n(n.S,"Object",{entries:function(t){return o(t)}})},function(t,e,i){"use strict";var n=i(0),o=i(9),r=i(10),s=i(8);i(7)&&n(n.P+i(63),"Object",{__defineGetter__:function(t,e){s.f(o(this),t,{get:r(e),enumerable:!0,configurable:!0})}})},function(t,e,i){"use strict";var n=i(0),o=i(9),r=i(10),s=i(8);i(7)&&n(n.P+i(63),"Object",{__defineSetter__:function(t,e){s.f(o(this),t,{set:r(e),enumerable:!0,configurable:!0})}})},function(t,e,i){"use strict";var n=i(0),o=i(9),r=i(23),s=i(17),a=i(16).f;i(7)&&n(n.P+i(63),"Object",{__lookupGetter__:function(t){var e,i=o(this),n=r(t,!0);do{if(e=a(i,n))return e.get}while(i=s(i))}})},function(t,e,i){"use strict";var n=i(0),o=i(9),r=i(23),s=i(17),a=i(16).f;i(7)&&n(n.P+i(63),"Object",{__lookupSetter__:function(t){var e,i=o(this),n=r(t,!0);do{if(e=a(i,n))return e.set}while(i=s(i))}})},function(t,e,i){var n=i(0);n(n.P+n.R,"Map",{toJSON:i(127)("Map")})},function(t,e,i){var n=i(0);n(n.P+n.R,"Set",{toJSON:i(127)("Set")})},function(t,e,i){i(64)("Map")},function(t,e,i){i(64)("Set")},function(t,e,i){i(64)("WeakMap")},function(t,e,i){i(64)("WeakSet")},function(t,e,i){i(65)("Map")},function(t,e,i){i(65)("Set")},function(t,e,i){i(65)("WeakMap")},function(t,e,i){i(65)("WeakSet")},function(t,e,i){var n=i(0);n(n.G,{global:i(2)})},function(t,e,i){var n=i(0);n(n.S,"System",{global:i(2)})},function(t,e,i){var n=i(0),o=i(20);n(n.S,"Error",{isError:function(t){return"Error"===o(t)}})},function(t,e,i){var n=i(0);n(n.S,"Math",{clamp:function(t,e,i){return Math.min(i,Math.max(e,t))}})},function(t,e,i){var n=i(0);n(n.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(t,e,i){var n=i(0),o=180/Math.PI;n(n.S,"Math",{degrees:function(t){return t*o}})},function(t,e,i){var n=i(0),o=i(129),r=i(108);n(n.S,"Math",{fscale:function(t,e,i,n,s){return r(o(t,e,i,n,s))}})},function(t,e,i){var n=i(0);n(n.S,"Math",{iaddh:function(t,e,i,n){var o=t>>>0,r=i>>>0;return(e>>>0)+(n>>>0)+((o&r|(o|r)&~(o+r>>>0))>>>31)|0}})},function(t,e,i){var n=i(0);n(n.S,"Math",{isubh:function(t,e,i,n){var o=t>>>0,r=i>>>0;return(e>>>0)-(n>>>0)-((~o&r|~(o^r)&o-r>>>0)>>>31)|0}})},function(t,e,i){var n=i(0);n(n.S,"Math",{imulh:function(t,e){var i=+t,n=+e,o=65535&i,r=65535&n,s=i>>16,a=n>>16,l=(s*r>>>0)+(o*r>>>16);return s*a+(l>>16)+((o*a>>>0)+(65535&l)>>16)}})},function(t,e,i){var n=i(0);n(n.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,e,i){var n=i(0),o=Math.PI/180;n(n.S,"Math",{radians:function(t){return t*o}})},function(t,e,i){var n=i(0);n(n.S,"Math",{scale:i(129)})},function(t,e,i){var n=i(0);n(n.S,"Math",{umulh:function(t,e){var i=+t,n=+e,o=65535&i,r=65535&n,s=i>>>16,a=n>>>16,l=(s*r>>>0)+(o*r>>>16);return s*a+(l>>>16)+((o*a>>>0)+(65535&l)>>>16)}})},function(t,e,i){var n=i(0);n(n.S,"Math",{signbit:function(t){return(t=+t)!=t?t:0==t?1/t==1/0:t>0}})},function(t,e,i){"use strict";var n=i(0),o=i(18),r=i(2),s=i(51),a=i(116);n(n.P+n.R,"Promise",{finally:function(t){var e=s(this,o.Promise||r.Promise),i="function"==typeof t;return this.then(i?function(i){return a(e,t()).then((function(){return i}))}:t,i?function(i){return a(e,t()).then((function(){throw i}))}:t)}})},function(t,e,i){"use strict";var n=i(0),o=i(91),r=i(115);n(n.S,"Promise",{try:function(t){var e=o.f(this),i=r(t);return(i.e?e.reject:e.resolve)(i.v),e.promise}})},function(t,e,i){var n=i(28),o=i(1),r=n.key,s=n.set;n.exp({defineMetadata:function(t,e,i,n){s(t,e,o(i),r(n))}})},function(t,e,i){var n=i(28),o=i(1),r=n.key,s=n.map,a=n.store;n.exp({deleteMetadata:function(t,e){var i=arguments.length<3?void 0:r(arguments[2]),n=s(o(e),i,!1);if(void 0===n||!n.delete(t))return!1;if(n.size)return!0;var l=a.get(e);return l.delete(i),!!l.size||a.delete(e)}})},function(t,e,i){var n=i(28),o=i(1),r=i(17),s=n.has,a=n.get,l=n.key,h=function(t,e,i){if(s(t,e,i))return a(t,e,i);var n=r(e);return null!==n?h(t,n,i):void 0};n.exp({getMetadata:function(t,e){return h(t,o(e),arguments.length<3?void 0:l(arguments[2]))}})},function(t,e,i){var n=i(119),o=i(128),r=i(28),s=i(1),a=i(17),l=r.keys,h=r.key,c=function(t,e){var i=l(t,e),r=a(t);if(null===r)return i;var s=c(r,e);return s.length?i.length?o(new n(i.concat(s))):s:i};r.exp({getMetadataKeys:function(t){return c(s(t),arguments.length<2?void 0:h(arguments[1]))}})},function(t,e,i){var n=i(28),o=i(1),r=n.get,s=n.key;n.exp({getOwnMetadata:function(t,e){return r(t,o(e),arguments.length<3?void 0:s(arguments[2]))}})},function(t,e,i){var n=i(28),o=i(1),r=n.keys,s=n.key;n.exp({getOwnMetadataKeys:function(t){return r(o(t),arguments.length<2?void 0:s(arguments[1]))}})},function(t,e,i){var n=i(28),o=i(1),r=i(17),s=n.has,a=n.key,l=function(t,e,i){if(s(t,e,i))return!0;var n=r(e);return null!==n&&l(t,n,i)};n.exp({hasMetadata:function(t,e){return l(t,o(e),arguments.length<3?void 0:a(arguments[2]))}})},function(t,e,i){var n=i(28),o=i(1),r=n.has,s=n.key;n.exp({hasOwnMetadata:function(t,e){return r(t,o(e),arguments.length<3?void 0:s(arguments[2]))}})},function(t,e,i){var n=i(28),o=i(1),r=i(10),s=n.key,a=n.set;n.exp({metadata:function(t,e){return function(i,n){a(t,e,(void 0!==n?o:r)(i),s(n))}}})},function(t,e,i){var n=i(0),o=i(90)(),r=i(2).process,s="process"==i(20)(r);n(n.G,{asap:function(t){var e=s&&r.domain;o(e?e.bind(t):t)}})},function(t,e,i){"use strict";var n=i(0),o=i(2),r=i(18),s=i(90)(),a=i(5)("observable"),l=i(10),h=i(1),c=i(39),u=i(41),f=i(11),d=i(40),m=d.RETURN,y=function(t){return null==t?void 0:l(t)},p=function(t){var e=t._c;e&&(t._c=void 0,e())},S=function(t){return void 0===t._o},v=function(t){S(t)||(t._o=void 0,p(t))},F=function(t,e){h(t),this._c=void 0,this._o=t,t=new I(this);try{var i=e(t),n=i;null!=i&&("function"==typeof i.unsubscribe?i=function(){n.unsubscribe()}:l(i),this._c=i)}catch(e){return void t.error(e)}S(this)&&p(this)};F.prototype=u({},{unsubscribe:function(){v(this)}});var I=function(t){this._s=t};I.prototype=u({},{next:function(t){var e=this._s;if(!S(e)){var i=e._o;try{var n=y(i.next);if(n)return n.call(i,t)}catch(t){try{v(e)}finally{throw t}}}},error:function(t){var e=this._s;if(S(e))throw t;var i=e._o;e._o=void 0;try{var n=y(i.error);if(!n)throw t;t=n.call(i,t)}catch(t){try{p(e)}finally{throw t}}return p(e),t},complete:function(t){var e=this._s;if(!S(e)){var i=e._o;e._o=void 0;try{var n=y(i.complete);t=n?n.call(i,t):void 0}catch(t){try{p(e)}finally{throw t}}return p(e),t}}});var g=function(t){c(this,g,"Observable","_f")._f=l(t)};u(g.prototype,{subscribe:function(t){return new F(t,this._f)},forEach:function(t){var e=this;return new(r.Promise||o.Promise)((function(i,n){l(t);var o=e.subscribe({next:function(e){try{return t(e)}catch(t){n(t),o.unsubscribe()}},error:n,complete:i})}))}}),u(g,{from:function(t){var e="function"==typeof this?this:g,i=y(h(t)[a]);if(i){var n=h(i.call(t));return n.constructor===e?n:new e((function(t){return n.subscribe(t)}))}return new e((function(e){var i=!1;return s((function(){if(!i){try{if(d(t,!1,(function(t){if(e.next(t),i)return m}))===m)return}catch(t){if(i)throw t;return void e.error(t)}e.complete()}})),function(){i=!0}}))},of:function(){for(var t=0,e=arguments.length,i=new Array(e);t<e;)i[t]=arguments[t++];return new("function"==typeof this?this:g)((function(t){var e=!1;return s((function(){if(!e){for(var n=0;n<i.length;++n)if(t.next(i[n]),e)return;t.complete()}})),function(){e=!0}}))}}),f(g.prototype,a,(function(){return this})),n(n.G,{Observable:g}),i(38)("Observable")},function(t,e,i){var n=i(2),o=i(0),r=i(60),s=[].slice,a=/MSIE .\./.test(r),l=function(t){return function(e,i){var n=arguments.length>2,o=!!n&&s.call(arguments,2);return t(n?function(){("function"==typeof e?e:Function(e)).apply(this,o)}:e,i)}};o(o.G+o.B+o.F*a,{setTimeout:l(n.setTimeout),setInterval:l(n.setInterval)})},function(t,e,i){var n=i(0),o=i(89);n(n.G+n.B,{setImmediate:o.set,clearImmediate:o.clear})},function(t,e,i){for(var n=i(86),o=i(34),r=i(12),s=i(2),a=i(11),l=i(46),h=i(5),c=h("iterator"),u=h("toStringTag"),f=l.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},m=o(d),y=0;y<m.length;y++){var p,S=m[y],v=d[S],F=s[S],I=F&&F.prototype;if(I&&(I[c]||a(I,c,f),I[u]||a(I,u,S),l[S]=f,v))for(p in n)I[p]||r(I,p,n[p],!0)}},function(t,e,i){(function(e){!function(e){"use strict";var i=Object.prototype,n=i.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},r=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag",l="object"==typeof t,h=e.regeneratorRuntime;if(h)l&&(t.exports=h);else{(h=e.regeneratorRuntime=l?t.exports:{}).wrap=y;var c={},u={};u[r]=function(){return this};var f=Object.getPrototypeOf,d=f&&f(f(D([])));d&&d!==i&&n.call(d,r)&&(u=d);var m=F.prototype=S.prototype=Object.create(u);v.prototype=m.constructor=F,F.constructor=v,F[a]=v.displayName="GeneratorFunction",h.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},h.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,F):(t.__proto__=F,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(m),t},h.awrap=function(t){return{__await:t}},I(g.prototype),g.prototype[s]=function(){return this},h.AsyncIterator=g,h.async=function(t,e,i,n){var o=new g(y(t,e,i,n));return h.isGeneratorFunction(e)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},I(m),m[a]="Generator",m[r]=function(){return this},m.toString=function(){return"[object Generator]"},h.keys=function(t){var e=[];for(var i in t)e.push(i);return e.reverse(),function i(){for(;e.length;){var n=e.pop();if(n in t)return i.value=n,i.done=!1,i}return i.done=!0,i}},h.values=D,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(i,n){return s.type="throw",s.arg=t,e.next=i,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o],s=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var a=n.call(r,"catchLoc"),l=n.call(r,"finallyLoc");if(a&&l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(a){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var s=r?r.completion:{};return s.type=t,s.arg=e,r?(this.method="next",this.next=r.finallyLoc,c):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),k(i),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;k(i)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:D(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),c}}}function y(t,e,i,n){var o=e&&e.prototype instanceof S?e:S,r=Object.create(o.prototype),s=new P(n||[]);return r._invoke=function(t,e,i){var n="suspendedStart";return function(o,r){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw r;return b()}for(i.method=o,i.arg=r;;){var s=i.delegate;if(s){var a=w(s,i);if(a){if(a===c)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=p(t,e,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}(t,i,s),r}function p(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}function S(){}function v(){}function F(){}function I(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function g(t){function i(e,o,r,s){var a=p(t[e],t,o);if("throw"!==a.type){var l=a.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?Promise.resolve(h.__await).then((function(t){i("next",t,r,s)}),(function(t){i("throw",t,r,s)})):Promise.resolve(h).then((function(t){l.value=t,r(l)}),s)}s(a.arg)}var o;"object"==typeof e.process&&e.process.domain&&(i=e.process.domain.bind(i)),this._invoke=function(t,e){function n(){return new Promise((function(n,o){i(t,e,n,o)}))}return o=o?o.then(n,n):n()}}function w(t,e){var i=t.iterator[e.method];if(void 0===i){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=p(i,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,c;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function D(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:b}}function b(){return{value:void 0,done:!0}}}("object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,i(93))},function(t,e,i){i(331),t.exports=i(18).RegExp.escape},function(t,e,i){var n=i(0),o=i(332)(/[\\^$*+?.()|[\]{}]/g,"\\$&");n(n.S,"RegExp",{escape:function(t){return o(t)}})},function(t,e){t.exports=function(t,e){var i=e===Object(e)?function(t){return e[t]}:e;return function(e){return String(e).replace(t,i)}}},function(t,e,i){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,i){return(o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}function s(t){var e=c();return function(){var i,n=f(t);if(e){var o=f(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return a(this,i)}}function a(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(t){var e="function"==typeof Map?new Map:void 0;return(l=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return h(t,arguments,f(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,t)})(t)}function h(t,e,i){return(h=c()?Reflect.construct:function(t,e,i){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return i&&u(o,i.prototype),o}).apply(null,arguments)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function d(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){if(t){if("string"==typeof t)return y(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function p(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function S(t,e,i){return e&&p(t.prototype,e),i&&p(t,i),t}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}i.r(e);var F={Asni:0,Utf8:1,Utf16:2},I=function t(){v(this,t)};I.XML="application/xml",I.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",I.PNG="image/png",I.BMP="application/x-bmp",I.IMAGE=I.PNG+","+(I.JPEG="image/jpeg")+","+I.BMP,I.PDF="application/pdf",I.JSON="application/json",I.JS="application/javascript",I.ZIP="application/zip",I.HTML="text/html",I.TXT="text/plain";var g=".text",w=function t(){v(this,t)};w.UnPlaceholderChar=(w.TibetanVowel="ེོིུ")+(w.TibetanOther="ྸཾ༷༵ྃཿྷྺྕྖཻླྲྟྱྭྀཽྥྩྪྫྰྶྡྦྔྨ྄ྒྒྮྯྴྐྑྤྣྠྗྙྼྻཱ༙༾༿྇྆ྲྀཷླྀཹཱིྚཱཱིུྜ࿆ྵྐྵྂྞྛ");var C=function(){function t(){v(this,t),this.lineBreak="\r\n",this._dpi=null}return S(t,[{key:"_getDPI",value:function(){var t={};if(null!=window.screen.deviceXDPI)t.x=window.screen.deviceXDPI,t.y=window.screen.deviceYDPI;else{var e=document.createElement("div");e.style.cssText="width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden",document.body.appendChild(e),t.x=parseInt(e.offsetWidth),t.y=parseInt(e.offsetHeight),e.parentNode.removeChild(e)}return t}},{key:"openURL",value:function(t){window.open(t)}},{key:"isOdd",value:function(t){return 1==(1&t)}},{key:"tryParseInt",value:function(t){var e=NaN,i=!1;return this.isNumber(t)&&(e=parseInt(t),i=!0),{value:e,ok:i}}},{key:"isNumber",value:function(t){return!(!/^\d+(\.\d+)?$/.test(t)&&!/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/.test(t))}},{key:"parseFloatDef",value:function(t,e){var i=parseFloat(t);return isNaN(i)?e:i}},{key:"parseIntDef",value:function(t,e){var i=parseInt(t);return isNaN(i)?e:i}},{key:"parseBooleanDef",value:function(t,e){var i=parseInt(t);return isNaN(i)?e:1==i}},{key:"assigned",value:function(t){return void 0!==t}},{key:"beep",value:function(){}},{key:"getUrlParam",value:function(t){for(var e,i=window.location.search.substring(1).split("&"),n=0;n<i.length;n++)if((e=i[n].split("="))[0]==t)return e[1];return""}},{key:"Timestamp",get:function(){return(new Date).getTime()}},{key:"dpi",get:function(){return this._dpi||(this._dpi=this._getDPI()),this._dpi}}],[{key:"stringFormatFloat",value:function(){var t=arguments;if(t.length>1){var e=t[0],i=t[1].toString(),n=i.indexOf(".");if(n>=0){var o=i.substr(0,n);""==o&&(o="0");var r=i.substr(n+1,e);return""==r.replace("0","")?o:o+"."+r}return i}}},{key:"stringFormat",value:function(){var t=arguments;if(t.length>0){if(t.length>1){var e=-1;return t[0].replace(/\{(\d+)\}/g,(function(i,n){return e=parseInt(n),t.length>e+1?t[e+1]:""}))}return t[0]}}},{key:"stringInsert",value:function(t,e,i){return t.slice(0,e)+i+t.slice(e)}},{key:"stringDelete",value:function(t,e,i){return t.substring(0,e)+t.substring(e+i,t.length)}},{key:"stringRemove",value:function(e,i,n){return t.stringDelete(e,i,n)}},{key:"setIntersection",value:function(t,e){return new Set(d(t).filter((function(t){return e.has(t)})))}},{key:"setDifference",value:function(t,e){return new Set(d(t).filter((function(t){return!e.has(t)})))}},{key:"setCompare",value:function(t,e){if(t.size!=e.size)return!1;var i,n=function(t,e){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=m(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,r=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}(t);try{for(n.s();!(i=n.n()).done;){var o=i.value;if(!e.has(o))return!1}}catch(t){n.e(t)}finally{n.f()}return!0}},{key:"setUnion",value:function(t,e){return new Set([].concat(d(t),d(e)))}},{key:"setRemove",value:function(t,e){t.delete(e)}},{key:"setCount",value:function(t){return t.size}}]),t}(),k=function(t){r(i,t);var e=s(i);function i(t){var n;return v(this,i),(n=e.call(this,t)).fill(null),n}return i}(l(Array)),P=function(t){r(i,t);var e=s(i);function i(t){var n;return v(this,i),(n=e.call(this,t)).fill(0),n}return i}(l(Array)),D=function(t){r(i,t);var e=s(i);function i(t){var n;return v(this,i),(n=e.call(this,t)).fill(0),n}return i}(l(Array)),b=function(t){r(i,t);var e=s(i);function i(t){var n;return v(this,i),(n=e.call(this,t)).fill(0),n}return S(i,[{key:"toText",value:function(){for(var t="",e=0,i=this.length;e<i;e++)t+=String.fromCharCode(this[e]);return t}},{key:"toBase64",value:function(){var t=this.toText();return window.btoa(t)}}],[{key:"fromBase64",value:function(t){for(var e=window.atob(t),n=new i(e.length),o=0,r=e.length;o<r;++o)n[o]=e.charCodeAt(o);return n}},{key:"fromBuffer",value:function(t){for(var e=new i(t.length),n=0,o=t.length;n<o;++n)e[n]=t[n];return e}}]),i}(l(Array)),R=function t(){if(v(this,t),this.constructor.prototype===t.prototype)throw"TEncoding类为抽象类,不可直接实例使用!";if("function"!=typeof this.getByteCount)throw this.prototype+" 没有实现getByteCount方法!";if("function"!=typeof this.getBytes)throw this.prototype+" 没有实现getBytes方法!";if("function"!=typeof this.getString)throw this.prototype+" 没有实现getString方法!"},_=function(t){r(i,t);var e=s(i);function i(){return v(this,i),e.call(this)}return i}(R),x=function(t){r(i,t);var e=s(i);function i(){return v(this,i),e.call(this)}return S(i,[{key:"getByteCount",value:function(t){for(var e,i=0,n=0,o=t.lenght;n<o;n++)(e=t.charCodeAt(n))>=0&&e<=127?i+=1:e>=128&&e<=2047?i+=2:e>=2048&&e<=65535?i+=3:e>65536&&e<=2097151?i+=4:e>2097152&&e<=67108863?i+=5:e>67108864&&e<=2147483647&&(i+=6);return i}}],[{key:"getBytes",value:function(t){for(var e,i=new b(0),n=0,o=t.length;n<o;n++)(e=t.charCodeAt(n))>=0&&e<=127?i.push(e):e>=128&&e<=2047?(i.push(192|e>>6&31),i.push(128|63&e)):e>=2048&&e<=65535&&(i.push(224|e>>12&15),i.push(128|e>>6&63),i.push(128|63&e));return i}},{key:"getString",value:function(t){var e=t instanceof Uint8Array?t:new Uint8Array(t),i=new Uint16Array(e.buffer);return String.fromCharCode.apply(null,i)}}]),i}(R),A=function(t){r(i,t);var e=s(i);function i(){return v(this,i),e.call(this)}return S(i,null,[{key:"getBytes",value:function(t){for(var e,i=new b(0),n=0,o=t.length;n<o;n++)(e=t.charCodeAt(n))<=65535?(i.push(255&e),i.push(e>>8)):(i.push(255&e),i.push((65280&e)>>8),i.push((16711680&e)>>16),i.push((4278190080&e)>>24));return i}},{key:"getByteCount",value:function(t){for(var e=0,i=0,n=t.length;i<n;i++)e+=t.charCodeAt(i)<=65535?2:4;return e}},{key:"getString",value:function(t){var e=t instanceof Uint8Array?t:new Uint8Array(t),i=new Uint16Array(e.buffer);return String.fromCharCode.apply(null,i)}},{key:"toUtf8",value:function(t){for(var e,i=new b(0),n=0,o=t.lenght;n<o;n++)(e=t.charCodeAt(n))>=0&&e<=127?i.push(e):e>=128&&e<=2047?(i.push(192|31&e>>6),i.push(128|63&e)):e>=2048&&e<=65535?(i.push(224|15&e>>12),i.push(128|63&e>>6),i.push(128|63&e)):e>=65536&&e<=1114111?(i.push(240|7&e>>18),i.push(128|63&e>>12),i.push(128|63&e>>6),i.push(128|63&e)):e>2097152&&e<=67108863?(i.push(248|3&e>>24),i.push(128|63&e>>18),i.push(128|63&e>>12),i.push(128|63&e>>6),i.push(128|63&e)):e>67108864&&e<=2147483647&&(i.push(252|1&e>>30),i.push(128|63&e>>24),i.push(128|63&e>>18),i.push(128|63&e>>12),i.push(128|63&e>>6),i.push(128|63&e));return i}}]),i}(R),T=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(v(this,t),e<-32768||e>32767)throw C.stringFormat("值 {0} 不在 -32768..32767内!",e);this._val=new Int16Array(1),this._val[0]=e}return S(t,[{key:"size",value:function(){return this._val.BYTES_PER_ELEMENT}},{key:"toString",value:function(){return this._val[0].toString()}},{key:"toInt8",value:function(){var t=new Int8Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt8",value:function(){var t=new Uint8Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt16",value:function(){return this._val[0]<0?this._val[0]+65536:this._val[0]}},{key:"value",get:function(){return this._val[0]},set:function(t){this._val[0]=t}}],[{key:"include",value:function(e){return e>=t.min&&e<=t.max}},{key:"min",get:function(){return-32768}},{key:"max",get:function(){return 32767}}]),t}(),O=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(v(this,t),e<0||e>65536)throw C.stringFormat("值 {0} 不在 0..65535内!",e);this._val=new Uint16Array(1),this._val[0]=e}return S(t,[{key:"size",value:function(){return this._val.BYTES_PER_ELEMENT}},{key:"toString",value:function(){return this._val[0].toString()}},{key:"toInt8",value:function(){var t=new Int8Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt8",value:function(){var t=new Uint8Array(1);return t[0]=this._val[0],t[0]}},{key:"toInt16",value:function(){return this._val[0]<32768?this._val[0]:this._val[0]-65536}},{key:"value",get:function(){return this._val[0]},set:function(t){this._val[0]=t}}],[{key:"include",value:function(e){return e>=t.min&&e<=t.max}},{key:"min",get:function(){return 0}},{key:"max",get:function(){return 65535}}]),t}(),N=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(v(this,t),e<-2147483648||e>2147483647)throw C.stringFormat("值 {0} 不在 -2147483648..2147483647内!",e);this._val=new Int32Array(1),this._val[0]=e}return S(t,[{key:"size",value:function(){return this._val.BYTES_PER_ELEMENT}},{key:"toString",value:function(){return this._val[0].toString()}},{key:"toInt8",value:function(){var t=new Int8Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt8",value:function(){var t=new Uint8Array(1);return t[0]=this._val[0],t[0]}},{key:"toInt16",value:function(){var t=new Int16Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt16",value:function(){var t=new Uint16Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt32",value:function(){return this._val[0]<0?this._val[0]+4294967296:this._val[0]}},{key:"value",get:function(){return this._val[0]},set:function(t){this._val[0]=t}}],[{key:"include",value:function(e){return e>=t.min&&e<=t.max}},{key:"min",get:function(){return-2147483648}},{key:"max",get:function(){return 2147483647}}]),t}(),B=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(v(this,t),e<0||e>4294967295)throw C.stringFormat("值 {0} 不在 0..4294967295内!",e);this._val=new Uint32Array(1),this._val[0]=e}return S(t,[{key:"size",value:function(){return this._val.BYTES_PER_ELEMENT}},{key:"toString",value:function(){return this._val[0].toString()}},{key:"toInt8",value:function(){var t=new Int8Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt8",value:function(){var t=new Uint8Array(1);return t[0]=this._val[0],t[0]}},{key:"toInt16",value:function(){var t=new Int16Array(1);return t[0]=this._val[0],t[0]}},{key:"toUInt16",value:function(){var t=new Uint16Array(1);return t[0]=this._val[0],t[0]}},{key:"toInt32",value:function(){return this._val[0]<2147483648?this._val[0]:this._val[0]-4294967296}},{key:"value",get:function(){return this._val[0]},set:function(t){this._val[0]=t}}],[{key:"include",value:function(e){return e>=t.min&&e<=t.max}},{key:"min",get:function(){return 0}},{key:"max",get:function(){return 4294967295}}]),t}(),E=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(v(this,t),e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER)throw C.stringFormat("值 {0} 不在 {1}..{2}内!",e,Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);if(e>B.max){var i=e.toString(2);this.hi32=parseInt(i.substr(0,i.length-32),2),this.lo32=parseInt(i.substr(i.length-32),2)}else this.hi32=0,this.lo32=e}return S(t,[{key:"size",value:function(){return this._val.BYTES_PER_ELEMENT+this._val.BYTES_PER_ELEMENT}},{key:"toString",value:function(){return((this._val[1]<<32)+this.val[0]).toString()}},{key:"buffer",get:function(){var t=new Array(8),e=new Uint8Array(1);return e[0]=this.lo32,t[0]=e[0],e[0]=this.lo32>>8,t[1]=e[0],e[0]=this.lo32>>16,t[2]=e[0],e[0]=this.lo32>>24,t[3]=e[0],e[0]=this.hi32,t[4]=e[0],e[0]=this.hi32>>8,t[5]=e[0],e[0]=this.hi32>>16,t[6]=e[0],e[0]=this.hi32>>24,t[7]=e[0],t}}]),t}(),M=function(){function t(){v(this,t),this.value=0}return S(t,[{key:"has",value:function(t){return(this.value&t)==t}},{key:"add",value:function(t){this.value=this.value|t}},{key:"remove",value:function(t){this.value=this.value&~t}},{key:"clear",value:function(){this.value=0}}]),t}(),L=function(){function t(){v(this,t),this.createBefor(),this._className=this.constructor.name}return S(t,[{key:"createBefor",value:function(){}},{key:"dispose",value:function(){}},{key:"isClass",value:function(t){return this instanceof t}},{key:"isSubClass",value:function(e){return e===t||Object.getPrototypeOf(this).isClass(e)}},{key:"newInstance",value:function(){return new this.constructor}},{key:"className",get:function(){return this._className}}]),t}(),G=function(){function t(){v(this,t),this.x=0,this.y=0}return S(t,[{key:"reset",value:function(t,e){this.x=t,this.y=e}},{key:"resetByPoint",value:function(t){this.reset(t.x,t.y)}},{key:"equal",value:function(t){return this.x==t.x&&this.y==t.y}},{key:"offset",value:function(e,i,n){if(n)return t.Create(this.x+e,this.y+i);this.x+=e,this.y+=i}}],[{key:"Create",value:function(e,i){var n=new t;return n.x=e,n.y=i,n}},{key:"CreateByPoint",value:function(e){return t.Create(e.x,e.y)}},{key:"inPoly",value:function(e,i){return t.inPolyAt(e.x,e.y,i)}},{key:"inPolyAt",value:function(t,e,i){for(var n,o,r,s,a=!1,l=0,h=i.length-1;l<i.length;h=l++)n=i[l].x,r=i[l].y,o=i[h].x,r>e!=(s=i[h].y)>e&&t<(o-n)*(e-r)/(s-r)+n&&(a=!a);return a}}]),t}(),H=function(){function t(){v(this,t),this.width=0,this.height=0}return S(t,[{key:"reset",value:function(t,e){this.width=t,this.height=e}}]),t}(),U=function(){function t(){v(this,t),this.left=0,this.top=0,this.right=0,this.bottom=0}return S(t,[{key:"reset",value:function(t,e,i,n){this.left=t,this.top=e,this.right=i,this.bottom=n}},{key:"resetRect",value:function(t){this.reset(t.left,t.top,t.right,t.bottom)}},{key:"resetBounds",value:function(t,e,i,n){this.reset(t,e,t+i,e+n)}},{key:"resetSize",value:function(t){this.right=this.left+t.width,this.bottom=this.top+t.height}},{key:"offset",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(n)return t.Create(this.left+e,this.top+i,this.right+e,this.bottom+i);this.left=this.left+e,this.top=this.top+i,this.right=this.right+e,this.bottom=this.bottom+i}},{key:"intersection",value:function(e){var i=new t;return e.right<=this.left||e.top>=this.bottom||e.left>=this.right||e.bottom<=this.top||(e.left>this.left?i.left=e.left:i.left=this.left,e.top>this.top?i.top=e.top:i.top=this.top,e.right>this.right?i.right=this.right:i.right=e.right,e.bottom>this.bottom?i.bottom=this.bottom:i.bottom=e.bottom),i}},{key:"union",value:function(e){var i=new t;return e.left<this.left?i.left=e.left:i.left=this.left,e.top<this.top?i.top=e.top:i.top=this.top,e.right>this.right?i.right=e.right:i.right=this.right,e.bottom>this.bottom?i.bottom=e.bottom:i.bottom=this.bottom,i}},{key:"inFlate",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(n)return t.Create(this.left-e,this.top-i,this.right+e,this.bottom+i);this.left-=e,this.right+=e,this.top-=i,this.bottom+=i}},{key:"pointInAt",value:function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom}},{key:"pointIn",value:function(t){return this.pointInAt(t.x,t.y)}},{key:"isIntersect",value:function(t){var e=this.left>t.left?this.left:t.left,i=this.top>t.top?this.top:t.top,n=this.right<t.right?this.right:t.right,o=this.bottom<t.bottom?this.bottom:t.bottom;return e<n&&i<o}},{key:"leftTop",get:function(){return G.Create(this.left,this.top)}},{key:"rightTop",get:function(){return G.Create(this.right,this.top)}},{key:"leftBottom",get:function(){return G.Create(this.left,this.bottom)}},{key:"rightBottom",get:function(){return G.Create(this.right,this.bottom)}},{key:"width",get:function(){return this.right-this.left},set:function(t){this.right=this.left+t}},{key:"height",get:function(){return this.bottom-this.top},set:function(t){this.bottom=this.top+t}}],[{key:"Create",value:function(e,i,n,o){var r=new t;return r.left=e,r.top=i,r.right=n,r.bottom=o,r}},{key:"CreateByRect",value:function(t){return this.Create(t.left,t.top,t.right,t.bottom)}},{key:"CreateByBounds",value:function(e,i,n,o){var r=new t;return r.left=e,r.top=i,r.right=e+n,r.bottom=i+o,r}}]),t}(),V=function(t){r(i,t);var e=s(i);function i(){var t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return v(this,i),(t=e.call(this))._onAdded=null,t._onRemoved=null,t.ownsObjects=null==n||n,t}return S(i,[{key:"doAdded_",value:function(t){null!=this._onAdded&&this._onAdded(t)}},{key:"doRemoved_",value:function(t){(null!=this._onRemoved&&this._onRemoved(t),this.ownsObjects)&&(Object.getPrototypeOf(t)instanceof L&&t.dispose())}},{key:"doClear_",value:function(){}},{key:"add",value:function(t){this[this.length]=t,this.doAdded_(t)}},{key:"indexOf",value:function(t){for(var e=0;e<this.length;e++)if(this[e]===t)return e;return-1}},{key:"removeAt",value:function(t){if(t>=0){var e=this[t];return this.splice(t,1),this.doRemoved_(e),e=null,!0}return!1}},{key:"remove",value:function(t){return this.removeAt(this.indexOf(t))}},{key:"removeRange",value:function(t,e){if(t>=0){for(var i=null,n=t;n<t+e;n++)i=this[n],this.doRemoved_(i),Object.getPrototypeOf(i)instanceof L&&i.dispose(),i=null;return this.splice(t,e),!0}return!1}},{key:"delete",value:function(t){return this.removeAt(t)}},{key:"insert",value:function(t,e){return t>=0&&t<=this.length&&(this.splice(t,0,e),this.doAdded_(e),!0)}},{key:"clear",value:function(){for(var t=null,e=this.length-1;e>=0;e--)t=this[e],this.splice(e,1),this.doRemoved_(t),t=null;this.doClear_()}},{key:"contains",value:function(t){return this.indexOf(t)>=0}},{key:"first",get:function(){return this[0]}},{key:"last",get:function(){return this[this.length-1]}},{key:"count",get:function(){return this.length}},{key:"onAdded",get:function(){return this._onAdded},set:function(t){this._onAdded=t}},{key:"onRemoved",get:function(){return this._onRemoved},set:function(t){this._onRemoved=t}}]),i}(l(Array)),W=function(t){r(i,t);var e=s(i);function i(){return v(this,i),e.call(this)}return S(i,[{key:"peek",value:function(){return this[this.length-1]}},{key:"clear",value:function(){this.splice(0,this.length)}},{key:"count",get:function(){return this.length}}]),i}(l(Array)),z=function(t){r(i,t);var e=s(i);function i(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return v(this,i),e.call(this,t)}return S(i,[{key:"add",value:function(t,e){var n={};n.key=t,n.val=e,o(f(i.prototype),"add",this).call(this,n)}},{key:"remove",value:function(t){var e=this.indexOfKey(t);e>=0&&o(f(i.prototype),"removeAt",this).call(this,e)}},{key:"indexOfKey",value:function(t){for(var e=0;e<this.count;e++)if(this[e].key==t)return e;return-1}},{key:"indexOfValue",value:function(t){for(var e=0;e<this.count-1;e++)if(this[e].val==t)return e;return-1}},{key:"valueByKey",value:function(t){var e=this.indexOfKey(t);return e<0?null:this[e].val}},{key:"keyByValue",value:function(t){var e=this.indexOfValue(t);return e<0?null:this[e].key}},{key:"setValue",value:function(t,e){var i=this.indexOfKey(t);i<0?this.add(t,e):this[i].val=e}},{key:"hasKey",value:function(t){return this.indexOfKey(t)>=0}}]),i}(V),j=function(t){r(i,t);var e=s(i);function i(){return v(this,i),e.call(this)}return S(i,[{key:"append",value:function(t){this.add(t)}},{key:"text",get:function(){var t="";if(this.length>0){t=this[0];for(var e=1,i=this.length;e<i;e++)t+="\r\n"+this[e]}return t}}]),i}(V),X=function(){function t(){v(this,t),this._datetime=new Date}return S(t,[{key:"initByDateTime",value:function(t){this.year=t.year,this.day=1,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.millisecond=t.millisecond}},{key:"format",value:function(t){var e={"M+":this.month,"d+":this.day,"h+":this.hour,"m+":this.minute,"s+":this.second,S:this.millisecond,z:this.millisecond};for(var i in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.year+"").substr(4-RegExp.$1.length))),e)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[i]:("00"+e[i]).substr((""+e[i]).length)));return t}},{key:"fromString",value:function(t){(t=(t=(t=t.replace(/[^a-zA-Z\d\u5e74\u6708\u65e5\u65f6\u5206\u79d2\u0020:-]/g,"")).replace(/-/g,"/").replace(/年/g,"/").replace(/月/g,"/").replace(/日/g,"/")).replace(/时/g,":").replace(/分/g,":").replace(/秒/g,"")).indexOf("/")<0&&(t=this.year+"/"+this.month+"/"+this.day+" "+t);var e=new Date(Date.parse(t));return!isNaN(e.getFullYear())&&(this._datetime=e,!0)}},{key:"toString",value:function(){return this.format("yyyy-MM-dd hh:mm:ss")}},{key:"toOADate",value:function(){var t=6e4*this._datetime.getTimezoneOffset();return(parseFloat(this._datetime.getTime())-t)/24/3600/1e3+25569}},{key:"fromOAData",value:function(t){this._datetime=new Date;var e=6e4*this._datetime.getTimezoneOffset();this._datetime.setTime(24*(t-25569)*3600*1e3+e)}},{key:"year",get:function(){return this._datetime.getFullYear()},set:function(t){this._datetime.setFullYear(t)}},{key:"month",get:function(){return this._datetime.getMonth()+1},set:function(t){this._datetime.setMonth(t-1)}},{key:"day",get:function(){return this._datetime.getDate()},set:function(t){this._datetime.setDate(t)}},{key:"hour",get:function(){return this._datetime.getHours()},set:function(t){this._datetime.setHours(t)}},{key:"minute",get:function(){return this._datetime.getMinutes()},set:function(t){this._datetime.setMinutes(t)}},{key:"second",get:function(){return this._datetime.getSeconds()},set:function(t){this._datetime.setSeconds(t)}},{key:"millisecond",get:function(){return this._datetime.getMilliseconds()},set:function(t){this._datetime.setMilliseconds(t)}}],[{key:"Create",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=new t;return l.year=e,l.day=1,l.month=i,l.day=n,l.hour=o,l.minute=r,l.second=s,l.millisecond=a,l}},{key:"CreateByDateTime",value:function(e){var i=new t;return i.year=e.year,i.day=1,i.month=e.month,i.day=e.day,i.hour=e.hour,i.minute=e.minute,i.second=e.second,i.millisecond=e.millisecond,i}},{key:"CreateByString",value:function(e){var i=new t;return i.fromString(e)?i:null}},{key:"Now",value:function(){return new t}},{key:"DaysInMonth",value:function(t,e){switch(e){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return 31;case 4:case 6:case 9:case 11:return 30;case 2:return t%4==0&&t%100!=0||t%400==0?29:28;default:return 0}}}]),t}(),K=function(){function t(){v(this,t),this._size=0,this._position=0,this._bytes=new b(0),this.onLoadStart=null,this.onLoadProgress=null,this.onLoadFinish=null}return S(t,[{key:"clear",value:function(){this._bytes.length=0,this._size=0,this._position=0}},{key:"copyFrom",value:function(t,e){0==e&&(t.position=0,e=t.size);var i=t.readBuffer(e);this.writeBuffer(i)}},{key:"loadFromFile",value:function(t){var e=this,i=new FileReader;i.onloadstart=function(){e._size=0,e._position=0,e._buffer=null,null!=e.onLoadStart&&e.onLoadStart()},i.onload=function(t){e._bytes=Array.prototype.slice.call(new Uint8Array(t.target.result)),e._size=t.total,e._position=0,null!=e.onLoadFinish&&e.onLoadFinish()},i.onloadend=function(){},i.onabort=function(){},i.onprogress=function(t){null!=e.onLoadProgress&&e.onLoadProgress(t.loaded,t.total)},i.onerror=function(){},i.readAsArrayBuffer(t)}},{key:"readBuffer",value:function(t){var e=this._bytes.slice(this._position,this._position+t);return this._position+=t,e}},{key:"writeBuffer",value:function(t){for(var e=0,i=t.length;e<i;e++)this._position<this._size?this._bytes.splice(this._position,1,t[e]):(this._bytes.push(t[e]),this._size++),this._position++}},{key:"readByte",value:function(){return this.readUInt8()}},{key:"writeByte",value:function(t){this.writeUInt8(t)}},{key:"readInt8",value:function(){return new Int8Array(this.readBuffer(1))[0]}},{key:"writeInt8",value:function(t){var e=new Uint8Array(1);e[0]=t,this.writeBuffer(e)}},{key:"readUInt8",value:function(){return this.readBuffer(1)[0]}},{key:"writeUInt8",value:function(t){var e=new Uint8Array(1);e[0]=t,this.writeBuffer(e)}},{key:"readInt16",value:function(){var t=this.readBuffer(2);return new T((t[1]<<8)+t[0]).value}},{key:"writeInt16",value:function(t){var e=new Uint16Array(1);e[0]=t,e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.writeBuffer(e)}},{key:"readUInt16",value:function(){var t=this.readBuffer(2);return(t[1]<<8)+t[0]}},{key:"writeUInt16",value:function(t){var e=new Uint16Array(1);e[0]=t,e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.writeBuffer(e)}},{key:"readInt32",value:function(){var t=this.readBuffer(4);return new N((t[3]<<24)+(t[2]<<16)+(t[1]<<8)+t[0]).value}},{key:"writeInt32",value:function(t){var e=new Uint32Array(1);e[0]=t,e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.writeBuffer(e)}},{key:"readUInt32",value:function(){var t=this.readBuffer(4);return(t[3]<<24)+(t[2]<<16)+(t[1]<<8)+t[0]}},{key:"writeUInt32",value:function(t){var e=new Uint32Array(1);e[0]=t,e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.writeBuffer(e)}},{key:"readInt64",value:function(){var t=this.readBuffer(8),e=new DataView(new Uint8Array(t).buffer);return e.getUint32(0,!0)+(e.getUint32(4,!0)<<32)}},{key:"writeInt64",value:function(){}},{key:"readUInt64",value:function(){var t=this.readBuffer(8);return(t[7]<<56)+(t[6]<<48)+(t[5]<<40)+(t[4]<<32)+(t[3]<<24)+(t[2]<<16)+(t[1]<<8)+t[0]}},{key:"writeUInt64",value:function(t){var e=new E(t);this.writeBuffer(e.buffer)}},{key:"readSingle",value:function(){var t=this.readBuffer(4);return new Float32Array(new Uint8Array(t).buffer)[0]}},{key:"writeSingle",value:function(t){var e=new Float32Array(1);e[0]=t,e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.writeBuffer(e)}},{key:"readDouble",value:function(){var t=this.readBuffer(8);return new Float64Array(new Uint8Array(t).buffer)[0]}},{key:"writeDouble",value:function(t){var e=new Float64Array(1);e[0]=t,e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.writeBuffer(e)}},{key:"readBoolean",value:function(){return 0!=this.readByte()}},{key:"writeBoolean",value:function(t){this.writeByte(t?1:0)}},{key:"readDateTime",value:function(){var t=this.readDouble(),e=new X;return e.fromOAData(t),e}},{key:"writeDateTime",value:function(t){var e=t.toOADate();this.writeDouble(e)}},{key:"toJSONString",value:function(){for(var t="",e=this._bytes.length,i=0;i<e-1;i++)t+=this._bytes[i]+",";return e>0&&(t+=this._bytes[e-1]),'{"hcstream":['+t+"]}"}},{key:"fromJSONString",value:function(t){var e=JSON.parse(t);e.hcstream&&(this._bytes=Array.prototype.slice.call(new Uint8Array(e.hcstream)),this._size=e.hcstream.length,this._position=0)}},{key:"size",get:function(){return this._size}},{key:"buffer",get:function(){return this._bytes}},{key:"position",get:function(){return this._position},set:function(t){t<0?this._position=0:t>this._size?this._position=this._size:this._position=t}}],[{key:"loadFromFile",value:function(e,i){var n=new t;n.onLoadFinish=function(){i(n)},n.loadFromFile(e)}}]),t}();function Y(t){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function J(t,e,i){return(J=it()?Reflect.construct:function(t,e,i){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return i&&$(o,i.prototype),o}).apply(null,arguments)}function Z(t){return function(t){if(Array.isArray(t))return q(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return q(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return q(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Q(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$(t,e)}function $(t,e){return($=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function tt(t){var e=it();return function(){var i,n=nt(t);if(e){var o=nt(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return et(this,i)}}function et(t,e){return!e||"object"!==Y(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function it(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function nt(t){return(nt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function st(t,e,i){return e&&rt(t.prototype,e),i&&rt(t,i),t}var at=function(){function t(){ot(this,t)}return st(t,null,[{key:"colorToRGBA",value:function(t){Rt.clearRect(1,1,1,1),_t.brush.color=t,_t.fillBounds(1,1,1,1);var e=Rt.getImageData(1,1,1,1);return 0==e.data[3]?{r:255,g:255,b:255,a:0}:{r:e.data[0],g:e.data[1],b:e.data[2],a:e.data[3]}}},{key:"rgbaToColor",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return"rgba("+t.toString()+", "+e.toString()+", "+i.toString()+", "+n.toString()+")"}},{key:"getColorPad",value:function(e){var i=e+e;Rt.clearRect(0,0,i,i);var n=255,o=0,r=0,s=t.rgbaToColor(n,o,r);_t.brush.color=s;var a,l,h,c,u=i+1,f=e+1,d=U.Create(i,e,u,f);_t.fillRect(d);for(var m=0;m<=i;m++){l=(a=(i-m)*Math.PI+1)/6,h=1530/a;for(var y=0;y<=a;y++)c=360/a*y,u=Math.cos(c*Math.PI/180)*(i-m+1)/2+e,f=Math.sin(c*Math.PI/180)*(i-m+1)/2+e,c>0&&c<=60&&(n=255,o=0,r=h*y),c>60&&c<=120&&(n=a/3/120*(c-60)>1?255-h*(y-l):255-h*Math.abs(y-l),o=0,r=255),c>120&&c<=180&&(n=0,o=a/3/120*(c-120)>1?h*(y-2*l):h*Math.abs(y-2*l),r=255),c>180&&c<=240&&(n=0,o=255,r=a/3/120*(c-120)>1?255-h*(y-a/2):255-h*Math.abs(y-a/2)),c>240&&c<=300&&(n=a/3/120*(c-240)>1?h*(y-4*l):h*Math.abs(y-4*l),o=255,r=0),c>300&&c<=360&&(n=255,o=a/3/120*(c-300)>1?255-h*(y-5*l):255-h*Math.abs(y-5*l),r=0),s=t.rgbaToColor(Math.round(n+(255-n)/i*m),Math.round(o+(255-o)/i*m),Math.round(r+(255-r)/i*m)),_t.brush.color=s,c>=0&&c<=45&&(d.reset(u,f,u-2,f-1),_t.fillRect(d)),c>45&&c<=135&&(d.reset(u,f,u-1,f-2),_t.fillRect(d)),c>135&&c<=225&&(d.reset(u,f,u+2,f+1),_t.fillRect(d)),c>215&&c<=315&&(d.reset(u,f,u+1,f+2),_t.fillRect(d)),c>315&&c<=360&&(d.reset(u,f,u-2,f-1),_t.fillRect(d))}return Rt.getImageData(0,0,i,i)}},{key:"sameColor",value:function(t,e){var i=this.colorToRGBA(t),n=this.colorToRGBA(e);return i.r==n.r&&i.g==n.g&&i.b==n.b&&i.a==n.a}}]),t}();at.Transparent="",at.Red="rgb(255, 0, 0)",at.Green="rgb(0, 255, 0)",at.Blue="rgb(0, 0, 255)",at.Black="rgb(0, 0, 0)",at.White="rgb(255, 255, 255)",at.Yellow="rgb(255, 255, 0)",at.Gray="gray",at.Pink="rgb(255, 192, 203)",at.Crimson="rgb(220, 20, 60)",at.Violet="rgb(238, 130, 238)",at.Magenta="rgb(255, 0, 255)",at.Purple="rgb(128, 0, 128)",at.MediumBlue="rgb(0, 0, 205)",at.DarkBlue="rgb(0, 0, 139)",at.Navy="rgb(0, 0, 128)",at.Cyan="rgb(0, 255, 255)",at.Teal="rgb(0, 128, 128)",at.Lime="rgb(0, 255, 0)",at.DarkGreen="rgb(0, 100, 0)",at.Gold="rgb(255, 215, 0)",at.Orange="rgb(255, 165, 0)",at.DarkOrange="rgb(255, 140, 0)",at.OrangeRed="rgb(255, 69, 0)",at.Brown="rgb(165, 42, 42)",at.DarkRed="rgb(139, 0, 0)",at.DarkGray="rgb(169, 169, 169)",at.LightGray="rgb(211, 211, 211)",at.Silver="rgb(192, 192, 192)";var lt=function(){function t(){ot(this,t),this.FUpdateCount=0}return st(t,[{key:"beginUpdate",value:function(){this.FUpdateCount++}},{key:"endUpdate",value:function(){this.FUpdateCount--,0===this.FUpdateCount&&this.doChange_()}},{key:"onChange",value:function(){}},{key:"doChange_",value:function(){this.onChange()}}]),t}(),ht={Bold:1,Italic:2,Underline:4,StrikeOut:8,SuperScript:16,SubScript:32,Emphasize:64},ct=function(){function t(){for(var e in ot(this,t),this._baseFonts=["monospace","sans-serif","serif"],this._body=document.body,this._span=document.createElement("span"),this._span.style.fontSize="72px",this._span.innerHTML="mmmmmmmmmmlli",this.defaultWidth=[],this.defaultHeight=[],this._baseFonts)this._span.style.fontFamily=this._baseFonts[e],this._body.appendChild(this._span),this.defaultWidth[this._baseFonts[e]]=this._span.offsetWidth,this.defaultHeight[this._baseFonts[e]]=this._span.offsetHeight,this._body.removeChild(this._span)}return st(t,[{key:"detect",value:function(t){var e,i=!1;for(var n in this._baseFonts)this._span.style.fontFamily=t+","+this._baseFonts[n],this._body.appendChild(this._span),e=this._span.offsetWidth!=this.defaultWidth[this._baseFonts[n]]||this._span.offsetHeight!=this.defaultHeight[this._baseFonts[n]],this._body.removeChild(this._span),i=i||e;return i}}],[{key:"getFontIndex",value:function(t){switch(t){case"宋体":return"1";case"幼圆":return"2";case"楷体":return"3";case"隶书":return"4";case"黑体":return"5";case"Arial":return"6";case"Tahoma":return"7";case"Courier New":return"8";case"Microsoft Himalaya":return"9";default:return"0"}}}]),t}(),ut=function(){function t(){ot(this,t),this._value=0,this.onChange=null}return st(t,[{key:"doChange_",value:function(){null!=this.onChange&&this.onChange()}},{key:"has",value:function(t){return(this._value&t)==t}},{key:"add",value:function(t){this._value=this._value|t,this.doChange_()}},{key:"remove",value:function(t){this._value=this._value&~t,this.doChange_()}},{key:"clear",value:function(){this._value=0,this.doChange_()}},{key:"bold",get:function(){return this.has(ht.Bold)}},{key:"italic",get:function(){return this.has(ht.Italic)}},{key:"value",get:function(){return this._value},set:function(t){this._value!=t&&(this._value=t,this.doChange_())}}]),t}(),ft=function t(){ot(this,t),this.name="宋体",this.size=10,this.measured=!1,this.height=13,this.ascent=11,this.advCharWidth=7,this.color=at.Black,this.stylesv=0},dt=function t(){ot(this,t),this.width=1,this.color=at.Black,this.style=pt.Solid,this.capType=yt.Square,this.userStyleDash=new Array(0)},mt=function(t){Q(i,t);var e=tt(i);function i(){var t;return ot(this,i),(t=e.call(this))._name="宋体",t._size=10,t._measured=!1,t._height=13,t._ascent=11,t._otmMacAscent=0,t._otmMacDescent=0,t._externalLeading=2,t._color=at.Black,t._advCharWidth=7,t._CJK=!0,t._trueType=!0,t._styles=new ut,t._styles.onChange=function(){t.doChange_()},t.onColorChange=null,t}return st(i,[{key:"_getMeasure",value:function(){var t=i.fontSizeToPt(this._size);switch(this._measured=!1,this._height=0,this._name){case"宋体":case"幼圆":case"楷体":case"隶书":case"黑体":switch(this._trueType=!0,this._CJK=!0,this._advCharWidth=6,t){case 5:case 5.5:this._height=7,this._ascent=6;break;case 6.5:this._height=9,this._ascent=8;break;case 7.5:this._height=10,this._ascent=9;break;case 8:this._height=11,this._ascent=9;break;case 9:this._height=12,this._ascent=10;break;case 10:this._height=13,this._ascent=11;break;case 10.5:this._height=14,this._ascent=12;break;case 11:this._height=15,this._ascent=13;break;case 12:this._height=16,this._ascent=14;break;case 14:this._height=19,this._ascent=16;break;case 15:this._height=20,this._ascent=17;break;case 16:this._height=21,this._ascent=18;break;case 18:this._height=24,this._ascent=21;break;case 20:this._height=27,this._ascent=23;break;case 22:this._height=29,this._ascent=25;break;case 24:this._height=33,this._ascent=28;break;case 26:this._height=35,this._ascent=30;break;case 28:this._height=37,this._ascent=32;break;case 36:this._height=48,this._ascent=41;break;case 42:this._height=56,this._ascent=48;break;case 48:this._height=64,this._ascent=55;break;case 72:this._height=97,this._ascent=83}break;case"Arial":switch(this._trueType=!0,this._CJK=!1,this._advCharWidth=5,t){case 5:case 5.5:this._height=7,this._ascent=6;break;case 6.5:this._styles.bold?(this._height=11,this._ascent=9):(this._height=12,this._ascent=9);break;case 7.5:this._styles.bold&&this._styles.italic?(this._height=11,this._ascent=9):this._styles.bold?(this._height=12,this._ascent=10):(this._height=13,this._ascent=10);break;case 8:this._styles.bold&&this._styles.italic?(this._height=13,this._ascent=11):(this._height=14,this._ascent=11);break;case 9:this._height=15,this._ascent=12;break;case 10:case 10.5:this._height=16,this._ascent=13;break;case 11:this._styles.bold&&!this._styles.italic?(this._height=18,this._ascent=14):(this._height=17,this._ascent=14);break;case 12:this._styles.bold&&!this._styles.italic?(this._height=19,this._ascent=15):!this._styles.bold&&this._styles.italic?(this._height=19,this._ascent=16):(this._height=18,this._ascent=15);break;case 14:this._styles.italic?(this._height=23,this._ascent=18):(this._height=22,this._ascent=18);break;case 15:0==this._styles.value?(this._height=23,this._ascent=19):(this._height=24,this._ascent=19);break;case 16:this._height=24,this._ascent=19;break;case 18:this._styles.italic?(this._height=28,this._ascent=22):this._styles.bold?(this._height=29,this._ascent=23):(this._height=27,this._ascent=21);break;case 20:this._styles.bold&&!this._styles.italic?(this._height=32,this._ascent=25):!this._styles.bold&&this._styles.italic?(this._height=31,this._ascent=25):(this._height=32,this._ascent=26);break;case 22:this._styles.bold||this._styles.italic?(this._height=34,this._ascent=27):(this._height=33,this._ascent=27);break;case 24:this._styles.bold&&!this._styles.italic?(this._height=37,this._ascent=30):!this._styles.bold&&this._styles.italic?(this._height=37,this._ascent=29):(this._height=36,this._ascent=29);break;case 26:this._styles.bold&&!this._styles.italic?(this._height=41,this._ascent=32):(this._height=40,this._ascent=32);break;case 28:this._styles.bold&&!this._styles.italic?(this._height=44,this._ascent=35):!this._styles.bold&&this._styles.italic?(this._height=43,this._ascent=34):(this._height=42,this._ascent=34);break;case 36:this._styles.bold&&!this._styles.italic?(this._height=56,this._ascent=45):!this._styles.bold&&this._styles.italic?(this._height=55,this._ascent=44):(this._height=55,this._ascent=45);break;case 42:!this._styles.bold&&this._styles.italic?(this._height=64,this._ascent=51):(this._height=65,this._ascent=52);break;case 48:this._styles.italic?(this._height=74,this._ascent=59):this._styles.bold?(this._height=75,this._ascent=60):(this._height=72,this._ascent=58);break;case 72:this._styles.bold&&!this._styles.italic?(this._height=111,this._ascent=89):!this._styles.bold&&this._styles.italic?(this._height=109,this._ascent=87):this._styles.bold&&this._styles.italic?(this._height=110,this._ascent=88):(this._height=107,this._ascent=86)}break;case"Tahoma":switch(this._trueType=!0,this._CJK=!1,this._advCharWidth=5,t){case 5:case 5.5:this._height=8,this._ascent=7;break;case 6.5:this._height=11,this._ascent=9;break;case 7.5:this._height=12,this._ascent=10;break;case 8:this._height=13,this._ascent=11;break;case 9:this._height=14,this._ascent=12;break;case 10:this._height=16,this._ascent=13;break;case 10.5:this._height=17,this._ascent=14;break;case 11:this._height=18,this._ascent=15;break;case 12:this._height=19,this._ascent=16;break;case 14:this._height=23,this._ascent=19;break;case 15:this._height=24,this._ascent=20;break;case 16:this._height=25,this._ascent=21;break;case 18:this._height=29,this._ascent=24;break;case 20:this._height=33,this._ascent=27;break;case 22:this._height=35,this._ascent=29;break;case 24:this._height=39,this._ascent=32;break;case 26:this._height=42,this._ascent=35;break;case 28:this._height=45,this._ascent=37;break;case 36:this._height=58,this._ascent=48;break;case 42:this._height=68,this._ascent=56;break;case 48:this._height=77,this._ascent=64;break;case 72:this._height=116,this._ascent=96}break;case"Courier New":switch(this._trueType=!0,this._CJK=!1,this._advCharWidth=5,t){case 5:case 5.5:this._height=8,this._ascent=6;break;case 6.5:this._height=12,this._ascent=9;break;case 7.5:this._styles.bold?(this._height=13,this._ascent=10):(this._height=12,this._ascent=9);break;case 8:!this._styles.bold&&this._styles.italic?(this._height=15,this._ascent=11):(this._height=14,this._ascent=11);break;case 9:this._styles.bold||this._styles.italic?(this._height=16,this._ascent=12):(this._height=15,this._ascent=12);break;case 10:!this._styles.bold&&this._styles.italic?(this._height=17,this._ascent=13):(this._height=16,this._ascent=12);break;case 10.5:this._styles.bold&&!this._styles.italic?(this._height=16,this._ascent=12):(this._height=17,this._ascent=13);break;case 11:this._styles.italic?(this._height=18,this._ascent=13):this._styles.bold?(this._height=17,this._ascent=12):(this._height=17,this._ascent=13);break;case 12:this._styles.italic?(this._height=19,this._ascent=14):this._styles.bold?(this._height=18,this._ascent=13):(this._height=18,this._ascent=14);break;case 14:this._styles.bold?(this._height=22,this._ascent=16):(this._height=21,this._ascent=16);break;case 15:this._styles.bold||this._styles.italic?(this._height=23,this._ascent=17):(this._height=22,this._ascent=17);break;case 16:!this._styles.bold&&this._styles.italic?(this._height=24,this._ascent=18):(this._height=23,this._ascent=17);break;case 18:this._styles.bold&&this._styles.italic?(this._height=28,this._ascent=21):(this._height=27,this._ascent=20);break;case 20:this._styles.bold?(this._height=31,this._ascent=23):(this._height=30,this._ascent=23);break;case 22:this._styles.bold?(this._height=33,this._ascent=24):this._styles.italic?(this._height=33,this._ascent=25):(this._height=32,this._ascent=24);break;case 24:this._styles.bold&&this._styles.italic?(this._height=37,this._ascent=27):this._styles.bold?(this._height=36,this._ascent=26):this._styles.italic?(this._height=35,this._ascent=27):(this._height=36,this._ascent=27);break;case 26:this._styles.bold?(this._height=40,this._ascent=29):this._styles.italic?(this._height=38,this._ascent=29):(this._height=39,this._ascent=29);break;case 28:this._styles.bold?(this._height=41,this._ascent=30):this._styles.italic?(this._height=40,this._ascent=30):(this._height=39,this._ascent=29);break;case 36:this._styles.bold&&this._styles.italic?(this._height=55,this._ascent=41):this._styles.bold?(this._height=54,this._ascent=40):this._styles.italic?(this._height=54,this._ascent=41):(this._height=50,this._ascent=37);break;case 42:this._styles.bold&&this._styles.italic?(this._height=64,this._ascent=47):this._styles.bold?(this._height=63,this._ascent=46):this._styles.italic?(this._height=62,this._ascent=47):(this._height=60,this._ascent=45);break;case 48:this._styles.bold&&this._styles.italic?(this._height=73,this._ascent=55):this._styles.bold?(this._height=73,this._ascent=54):this._styles.italic?(this._height=73,this._ascent=55):(this._height=69,this._ascent=51);break;case 72:this._styles.bold&&this._styles.italic?(this._height=111,this._ascent=82):this._styles.bold?(this._height=110,this._ascent=81):this._styles.italic?(this._height=107,this._ascent=81):(this._height=103,this._ascent=77)}break;default:var e=or.textMetricsIndexOf(this._name,t,this._styles.value);if(e>=0){var n=or.textMetrics[e];this._trueType=n.trueType,this._CJK=n.CJK,this._advCharWidth=n.advCharWidth,this._height=n.height,this._ascent=n.ascent}}this._measured=this._height>0}},{key:"_reSetSize",value:function(){if(!(this.FUpdateCount>0||(this._getMeasure(),this._measured))){var t=document.createElement("span");t.style.font=this.contextFont_(),t.innerText="M";var e=document.createElement("div");e.style.display="inline-block",e.style.width="1px",e.style.height="0px";var i=document.createElement("div");i.style.position="absolute",i.style.left="-100px",i.append(e,t),document.body.append(i);try{e.style.verticalAlign="baseline",this._ascent=this._styles.has(ht.SuperScript)||this._styles.has(ht.SubScript)?Math.trunc((e.offsetTop-t.offsetTop)/2):e.offsetTop-t.offsetTop,e.style.verticalAlign="bottom";var n=t.getBoundingClientRect();this._height=this._styles.has(ht.SuperScript)||this._styles.has(ht.SubScript)?Math.trunc(n.height/2):n.height,this._advCharWidth=this._styles.has(ht.SuperScript)||this._styles.has(ht.SubScript)?Math.trunc(n.width/2):n.width}finally{document.body.removeChild(i)}}}},{key:"endUpdate",value:function(){this.FUpdateCount--,0===this.FUpdateCount&&(this._reSetSize(),this.doChange_())}},{key:"assign",value:function(t){this._name=t.name,this._size=t.size,this._color=t.color,this._styles.value=t.styles.value,this._measured=t._measured,this._height=t.height,this._ascent=t.ascent,this._externalLeading=t.externalLeading,this._advCharWidth=t.advCharWidth,this._CJK=t.CJK,this._trueType=t.trueType,this.doChange_()}},{key:"saveInfo",value:function(t){t.name=this._name,t.size=this._size,t.measured=this._measured,t.height=this._height,t.ascent=this._ascent,t.advCharWidth=this._advCharWidth,t.color=this._color,t.stylesv=this._styles.value}},{key:"restoreInfo",value:function(t){this._name=t.name,this._size=t.size,this._measured=t.measured,this._height=t.height,this._ascent=t.ascent,this._advCharWidth=t.advCharWidth,this._color=t.color,this._styles.value=t.stylesv,this.doChange_()}},{key:"toContext",value:function(t){t.font=this.contextFont_(),null!=this._color?t.fillStyle=this._color:t.fillStyle=at.Black}},{key:"contextFont_",value:function(){return(this._styles.has(ht.Italic)?"italic ":"")+(this._styles.has(ht.Bold)?"bold ":"")+this._size+'pt "'+this._name+'"'}},{key:"name",get:function(){return this._name},set:function(t){this._name!=t&&(this._name=t,this._CJK=/^[\u3220-\uFA29]+$/.test(t),this._reSetSize(),this.doChange_())}},{key:"size",get:function(){return this._size},set:function(t){var e=t;this._size!=e&&(this._size=e,this._reSetSize(),this.doChange_())}},{key:"color",get:function(){return this._color},set:function(t){this._color!=t&&(this._color=t,this.doChange_(),null!=this.onColorChange&&this.onColorChange())}},{key:"styles",get:function(){return this._styles},set:function(t){this._styles=t,this._reSetSize(),this.doChange_()}},{key:"height",get:function(){return this._height}},{key:"advCharWidth",get:function(){return this._advCharWidth}},{key:"CJK",get:function(){return this._CJK}},{key:"trueType",get:function(){return this._trueType}},{key:"ascent",get:function(){return this._ascent}},{key:"descent",get:function(){return this._height-this._ascent}},{key:"externalLeading",get:function(){return this._externalLeading}},{key:"measureName",get:function(){return i.getMeasureName(this.name,this.size,this.styles.value.toString())}}],[{key:"fontSizeToPt",value:function(t){return"初号"==t?42:"小初"==t?36:"一号"==t?26:"小一"==t?24:"二号"==t?22:"小二"==t?18:"三号"==t?16:"小三"==t?15:"四号"==t?14:"小四"==t?12:"五号"==t?10.5:"小五"==t?9:"六号"==t?7.5:"小六"==t?6.5:"七号"==t?5.5:"八号"==t?5:or.system.isNumber(t)?t:void or.exception("无法识别的字号:"+t)}},{key:"fontPtToSize",value:function(t){return 42==t?"初号":36==t?"小初":26==t?"一号":24==t?"小一":22==t?"二号":18==t?"小二":16==t?"三号":15==t?"小三":14==t?"四号":12==t?"小四":10.5==t?"五号":9==t?"小五":7.5==t?"六号":6.5==t?"小六":5.5==t?"七号":5==t?"八号":t.toString()}},{key:"fontPixToPt",value:function(t){return 56==t?42:48==t?36:45==t?34:42==t?32:40==t?30:38==t?29:37==t?28:36==t?27:35==t?26:34==t?25:32==t?24:29==t?22:26==t?20:24==t?18:23==t?17:22==t?16:21==t?15:20==t?14.5:19==t?14:18==t?13.5:17==t?13:16==t?12:15==t?11:14==t?10.5:13==t?10:12==t?9:11==t?8:10==t?7.5:9==t?7:8==t?6.5:7==t?5.5:6==t?5:Math.round(t/or.system.dpi*72).toString()}},{key:"hasFont",value:function(t){if("string"!=typeof t)return!1;if(t.toLowerCase()=="Arial".toLowerCase())return!0;var e=function(t){Rt.clearRect(0,0,32,32),Rt.font="20px "+t+", Arial",Rt.fillText("a",16,16);var e=Rt.getImageData(0,0,32,32).data;return[].slice.call(e).filter((function(t){return 0!=t}))};return e("Arial").join("")!==e(t).join("")}},{key:"getMeasureName",value:function(t,e,n){return n&=~(ht.Underline|ht.StrikeOut|ht.SubScript|ht.SuperScript),ct.getFontIndex(t)+"_"+i.fontSizeToPt(e).toString().replace(".","")+"_"+n.toString()}}]),i}(lt),yt={Square:0,Butt:1,Round:2},pt={Solid:0,Dash:1,Dot:2,DashDot:3,DashDotDot:4,Clear:5,InsideFrame:6,UserStyle:7,Alternate:8},St=function(t){Q(i,t);var e=tt(i);function i(){var t;return ot(this,i),(t=e.call(this))._width=1,t._color=at.Black,t._style=pt.Solid,t._capType=yt.Square,t._userStyleDash=new Array(0),t}return st(i,[{key:"assign",value:function(t){this._width=t._width,this._color=t._color,this._style=t._style,this._capType=t._capType,this._userStyleDash=J(Array,Z(t._userStyleDash))}},{key:"saveInfo",value:function(t){t.width=this._width,t.color=this._color,t.style=this._style,t.capType=this._capType,t.userStyleDash=this._userStyleDash}},{key:"restoreInfo",value:function(t){this._width=t.width,this._color=t.color,this._style=t.style,this._capType=t.capType,this._userStyleDash=t.userStyleDash,this.doChange_()}},{key:"fromContext",value:function(t){switch(this._width=t.lineWidth,t.lineCap){case"butt":this._capType=yt.Butt;break;case"round":this._capType=yt.Round;break;default:this._capType=yt.Square}t.getLineDash().length>0?this._style=pt.Dash:this._style=pt.Solid,this._color=t.strokeStyle,this.doChange_()}},{key:"toContext",value:function(t){switch(t.lineWidth=this._width,this._capType){case yt.Butt:t.lineCap="butt";break;case yt.Round:t.lineCap="round";break;default:t.lineCap="square"}switch(this._style){case pt.Dash:t.setLineDash([5*this._width,5*this._width]),t.lineDashOffset=0;break;case pt.Dot:t.setLineDash([2*this._width,4*this._width]),t.lineDashOffset=0;break;default:t.setLineDash([])}t.strokeStyle=this._color}},{key:"width",get:function(){return this._width},set:function(t){this._width!=t&&(this._width=t,this.doChange_())}},{key:"color",get:function(){return this._color},set:function(t){this._color!=t&&(this._color=t,this._style!=pt.Clear&&this.doChange_())}},{key:"style",get:function(){return this._style},set:function(t){this._style!=t&&(this._style=t,this.doChange_())}}],[{key:"Create",value:function(t){var e=new i;return e.fromContext(t),e}}]),i}(lt),vt=0,Ft=1,It=2,gt=function(t){Q(i,t);var e=tt(i);function i(){var t;return ot(this,i),(t=e.call(this))._color="White",t._style=vt,t.onColorChange=null,t}return st(i,[{key:"fromContext",value:function(t){this.color=t.fillStyle}},{key:"toContext",value:function(t){t.fillStyle=this._color}},{key:"color",get:function(){return this._color},set:function(t){this._color!=t?(this._color=t,this._style=vt,this.doChange_(),null!=this.onColorChange&&this.onColorChange()):this._style!=vt&&(this._style=vt,this.doChange_())}},{key:"style",get:function(){return this._style},set:function(t){this._style!=t&&(this._style=t,this.doChange_())}}],[{key:"Create",value:function(t){var e=new i;return e.fromContext(t),e}}]),i}(lt),wt=1,Ct=2,kt=3,Pt=function(t){Q(i,t);var e=tt(i);function i(t,n){var o;return ot(this,i),(o=e.call(this)).x=t,o.y=n,o}return st(i,[{key:"scale",value:function(t){this.x+=t,this.y*=t}},{key:"add",value:function(t){this.x+=t.x,this.y=t.y}},{key:"sub",value:function(t){this.x-=t.x,this.y-=t.y}},{key:"negate",value:function(){this.x=-this.x,this.y=-this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"legnthSquared",value:function(){return this.x*this.x+this.y*this.y}},{key:"normalize",value:function(){var t=Math.sqrt(this.x*this.x+this.y*this.y);return t&&(this.x/=t,this.y/=t),t}},{key:"rotate",value:function(t){var e=this.x,i=this.y,n=Math.cos(t),o=Math.sin(t);this.x=e*n-i*o,this.y=e*o+i*n}}]),i}(L),Dt=function(){function t(e){var i=this;ot(this,t),this.h5context=e,this._scale=1,this._states=new Set([]),this._pfrist=!1,this._px1=-1,this._py1=-1,this._px2=-1,this._py2=-1,this._pywidth=0,this.pen=new St,this.pen.onChange=function(){i._penChanged()},this._penStack=new W,this._fontStack=new W,this.gradientBrush=null,this.brush=new gt,this.brush.onChange=function(){i._brushChanged()},this.brush.onColorChange=function(){i._fontChanged()},this.font=new mt,this.font.onChange=function(){i._fontChanged()},this.font.onColorChange=function(){i._brushChanged()},this.scaleSize=G.Create(1,1),this.prepareConext(1)}return st(t,[{key:"_penChanged",value:function(){this._states.delete(Ct)}},{key:"_brushChanged",value:function(){this._states.delete(kt)}},{key:"_fontChanged",value:function(){this._states.delete(wt)}},{key:"_requiredState",value:function(t){var e=C.setDifference(t,this._states);e.size>0?(e.has(Ct)&&this.pen.toContext(this.h5context),e.has(kt)&&(this.brush.toContext(this.h5context),this.brush.style==It&&(this.h5context.fillStyle=this.gradientBrush)),e.has(wt)&&this.font.toContext(this.h5context),this._states=C.setUnion(this._states,e)):(t.has(kt)&&(this.brush.toContext(this.h5context),this.brush.style==It&&(this.h5context.fillStyle=this.gradientBrush),this._states=C.setUnion(this._states,[kt])),t.has(wt)&&(this.font.toContext(this.h5context),this._states=C.setUnion(this._states,[wt])))}},{key:"_pointConnect",value:function(t,e,i,n){if(this.pen.style>pt.Solid&&this.pen.style<pt.Clear)t==i?(this._pfrist?this.h5context.moveTo(t+.5,e):this.h5context.moveTo(this._px2+.5,this._py2),this.h5context.lineTo(i+.5,n)):e==n?(this._pfrist?this.h5context.moveTo(t,e+.5):this.h5context.moveTo(this._px2,this._py2+.5),this.h5context.lineTo(i,n+.5)):(this._pfrist?this.h5context.moveTo(t,e):this.h5context.moveTo(this._px2,this._py2),this.h5context.lineTo(i,n));else if(t==i){var o=this.h5context.fillStyle;this.h5context.fillStyle=this.h5context.strokeStyle,this._pfrist?this.h5context.fillRect(t,e,this.h5context.lineWidth,n-e):this._py1==this._py2&&t==Math.max(this._px1,this._px2)?this.h5context.fillRect(t-this.h5context.lineWidth,e,this.h5context.lineWidth,n-e):this.h5context.fillRect(t,e,this.h5context.lineWidth,n-e),this.h5context.fillStyle=o}else if(e==n){var r=this.h5context.fillStyle;this.h5context.fillStyle=this.h5context.strokeStyle,this._pfrist?this.h5context.fillRect(t,e,i-t,this.h5context.lineWidth):this._px1==this._px2?i<t?this.h5context.fillRect(t+this._pywidth,e,i-t-this._pywidth,this.h5context.lineWidth):this.h5context.fillRect(t-this._pywidth,e,i-t+this._pywidth,this.h5context.lineWidth):this.h5context.fillRect(t,e,i-t,this.h5context.lineWidth),this.h5context.fillStyle=r}else this._pfrist?this.h5context.moveTo(t,e):this.h5context.moveTo(this._px2,this._py2),this.h5context.lineTo(i,n);this._px1=t,this._py1=e,this._px2=i,this._py2=n,this._pywidth=this.h5context.lineWidth,this._pfrist=!1}},{key:"prepareConext",value:function(t){this._scale=t,this.h5context.scale(t,t),this.h5context.shadowColor="black",this.h5context.textBaseline="top",this.h5context.textAlign="left",this.h5context.lineCap="square",this.h5context.setLineDash([]),this.h5context.lineDashOffset=0,this.h5context.font="10pt 宋体",this.font.name="宋体",this.font.size=10,this.font.styles.clear(),this._states.clear()}},{key:"save",value:function(){this.h5context.save();var t=new ft;this.font.saveInfo(t),this._fontStack.push(t);var e=new dt;this.pen.saveInfo(e),this._penStack.push(e)}},{key:"restore",value:function(){this.h5context.restore(),this.pen.fromContext(this.h5context),this.brush.fromContext(this.h5context),this.font.restoreInfo(this._fontStack.pop()),this.pen.restoreInfo(this._penStack.pop())}},{key:"translate",value:function(t,e){this.h5context.translate(t,e)}},{key:"clear",value:function(t,e,i,n){this.h5context.clearRect(t,e,i,n)}},{key:"clearRect",value:function(t){this.clear(t.left,t.top,t.width,t.height)}},{key:"clip",value:function(t,e,i,n){this.beginPath(),this.h5context.rect(t,e,i,n),this.closePath(),this.h5context.clip()}},{key:"clipRect",value:function(t){this.clip(t.left,t.top,t.width,t.height)}},{key:"bitBlt",value:function(t,e,i,n,o,r,s,a,l){var h=o.h5context.canvas;this.h5context.drawImage(h,r,s,a,l,t,e,i,n)}},{key:"bitBltRect",value:function(t,e,i){this.bitBlt(t.left,t.top,t.width,t.height,e,i.left,i.top,i.width,i.height)}},{key:"getImageData",value:function(t,e,i,n){return this.h5context.getImageData(t,e,i,n)}},{key:"setImageData",value:function(t,e,i){this.h5context.putImageData(t,e,i)}},{key:"setImageDataBounds",value:function(t,e,i,n,o,r,s){this.h5context.putImageData(t,e,i,n,o,r,s)}},{key:"drawImageData",value:function(t,e,i,n,o){Rt.putImageData(t,0,0),this.bitBlt(e,i,n,o,_t,0,0,n,o)}},{key:"createLinearGradient",value:function(t,e,i,n){return this.h5context.createLinearGradient(t,e,i,n)}},{key:"beginPath",value:function(){this._requiredState(new Set([Ct])),this.h5context.beginPath()}},{key:"closePath",value:function(){this.h5context.closePath()}},{key:"paintPath",value:function(){this.h5context.stroke()}},{key:"getTextRect",value:function(t,e){if(""!=t&&0!=e.width){for(var i=this.getTextExtentExPoint(t),n=i.length,o=e.width,r=0,s=0;s<n;)i[s]>o?(r+=this.font.height+this.font.ascent,s>0&&(o=i[s-1]+e.width)):s++;e.height=r+this.font.height+this.font.ascent}}},{key:"textOutRect",value:function(t,e){if(""!=t&&0!=e.width){for(var i=this.getTextExtentExPoint(t),n=i.length,o=e.width,r=e.top,s=0,a=0;s<n;)i[s]>o?(this.textOut(e.left,r,t.substr(a,s-a)),r+=this.font.height+this.font.ascent,a=s,s>0&&(o=i[s-1]+e.width)):s++;this.textOut(e.left,r,t.substr(a,s-a+1))}}},{key:"findUnPlace",value:function(t,e,i){for(var n=t;n<i-1&&w.UnPlaceholderChar.indexOf(e[n+1])>=0;)n++;return n}},{key:"textOut",value:function(t,e,i,n){this._requiredState(new Set([wt]));var o=!1;this.font.styles.has(ht.SuperScript)?(this.h5context.scale(.5,.5),t+=t,e+=e,o=!0):this.font.styles.has(ht.SubScript)&&(this.h5context.scale(.5,.5),t+=t,e+=e+this.font.height,o=!0);var r=0;if(null!=n){var s=n.length,a=0,l=this.findUnPlace(0,i,s);if(this.h5context.fillText(i.substring(a,l+1),t,e),a=l+1,o)for(;a<s;)l=this.findUnPlace(a,i,s),this.h5context.fillText(i.substring(a,l+1),t+n[a-1]+n[a-1],e),a=l+1;else for(;a<s;)l=this.findUnPlace(a,i,s),this.h5context.fillText(i.substring(a,l+1),t+n[a-1],e),a=l+1}else this.h5context.fillText(i,t,e);if(this.font.styles.has(ht.Underline)&&(0===r&&(r=this.measureText(i).width),this.brush.style=Ft,this.pen.color=this.font.color,this.pen.width=1,this.pen.style=pt.Solid,this.drawLineDriect(t,e+this.font.height,t+r,e+this.font.height)),this.font.styles.has(ht.StrikeOut)){0===r&&(r=this.measureText(i).width,this.pen.color=this.font.color,this.pen.width=1,this.pen.style=pt.Solid,this.brush.style=Ft);var h=Math.trunc(this.font.height/2);this.drawLineDriect(t,e+h,t+r,e+h)}(this.font.styles.has(ht.SuperScript)||this.font.styles.has(ht.SubScript))&&this.h5context.scale(2,2)}},{key:"textRect",value:function(t,e,i,n){this.save();try{this.clipRect(t),this.textOut(e,i,n)}finally{this.restore()}}},{key:"textOutShadow",value:function(t,e,i,n){this.h5context.shadowBlur=n,this.textOut(t,e,i),this.h5context.shadowBlur=0}},{key:"measureText",value:function(t){if(or.meaChr&&null!=or.localStorage.hcf[this.font.measureName]){for(var e=or.localStorage.hcf[this.font.measureName],i=t.length,n=0,o=0;o<i;o++)n+=e[t.charCodeAt(o)];return{width:n}}return this.h5context.measureText(t)}},{key:"textWidth",value:function(t){return this._requiredState(new Set([wt])),this.font.styles.has(ht.SuperScript)||this.font.styles.has(ht.SubScript)?Math.trunc(this.measureText(t).width/2):this.measureText(t).width}},{key:"textHeight",value:function(){return this.font.height}},{key:"getTextExtent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this._requiredState(new Set([wt]));var i=new Array,n=t.length;e>0&&e<n&&(n=e);var o=this.font.styles.has(ht.SuperScript)||this.font.styles.has(ht.SubScript);if(o)if(or.meaChr&&null!=or.localStorage.hcf[this.font.measureName])for(var r=or.localStorage.hcf[this.font.measureName],s=0;s<n;s++)i[s]=Math.round(r[t.charCodeAt(s)]/2);else for(var a=0;a<n;a++)i[a]=Math.round(this.h5context.measureText(t.charAt(a)).width/2);else if(or.meaChr&&null!=or.localStorage.hcf[this.font.measureName])for(var l=or.localStorage.hcf[this.font.measureName],h=0;h<n;h++)i[h]=l[t.charCodeAt(h)];else for(var c=0;c<n;c++)i[c]=this.h5context.measureText(t.charAt(c)).width;return i}},{key:"getTextExtentExPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this._requiredState(new Set([wt]));var i=new Array,n=t.length;e>0&&e<n&&(n=e);var o=0,r=0,s=this.font.styles.has(ht.SuperScript)||this.font.styles.has(ht.SubScript);if(s)if(or.meaChr&&null!=or.localStorage.hcf[this.font.measureName])for(var a=or.localStorage.hcf[this.font.measureName],l=0;l<n;l++)r=Math.round(a[t.charCodeAt(l)]/2),i[l]=o+r,o+=r;else for(var h=0;h<n;h++)r=Math.round(this.h5context.measureText(t.charAt(h)).width/2),i[h]=o+r,o+=r;else if(or.meaChr&&null!=or.localStorage.hcf[this.font.measureName]){for(var c=or.localStorage.hcf[this.font.measureName],u=0,f=0,d=new Array,m=0,y=!1;u<n-1;)if(y||(f=u),w.UnPlaceholderChar.indexOf(t[u+1])>=0)d.push(u),u++,y=!0;else{if(y=!1,r=c[t.charCodeAt(f)],i[u]=o+r,d.length>0){for(var p=r/((m=d.length)+1),S=o,v=0;v<m;v++)i[d[v]]=S+p,S+=p;d.splice(0,m)}o+=r,u++}if(r=y?c[t.charCodeAt(f)]:c[t.charCodeAt(n-1)],i[n-1]=o+r,d.length>0){for(var F=r/((m=d.length)+1),I=o,g=0;g<m;g++)i[d[g]]=I+F,I+=F;d.splice(0,m)}}else{for(var C="",k=0,P=new Array,D=0;k<n-1;)if(C+=t[k],w.UnPlaceholderChar.indexOf(t[k+1])>=0)P.push(k),k++;else{if(r=this.h5context.measureText(C).width,i[k]=o+r,P.length>0){for(var b=r/((D=P.length)+1),R=o,_=0;_<D;_++)i[P[_]]=R+b,R+=b;P.splice(0,D)}o+=r,C="",k++}if(C+=t[n-1],r=this.h5context.measureText(C).width,i[n-1]=o+r,P.length>0){for(var x=r/((D=P.length)+1),A=o,T=0;T<D;T++)i[P[T]]=A+x,A+=x;P.splice(0,D)}}return i}},{key:"textMetric",value:function(t){var e=new H;return e.width=this.textWidth(t),e.height=this.font.height,e}},{key:"drawImage",value:function(t,e,i){this.h5context.drawImage(i,t,e)}},{key:"drawImageRect",value:function(t,e){this.h5context.drawImage(e,t.left,t.top,t.width,t.height)}},{key:"toImage",value:function(t){return this.h5context.canvas.toDataURL("png")}},{key:"moveTo",value:function(t,e){this._pfrist=!0,this._px1=t,this._py1=e,this._px2=-1e4,this._py2=-1e4}},{key:"moveToPoint",value:function(t){this.moveTo(t.x,t.y)}},{key:"lineTo",value:function(t,e){this._pfrist?this._pointConnect(this._px1,this._py1,t,e):this._pointConnect(this._px2,this._py2,t,e)}},{key:"arrow",value:function(t,e,i,n,o){var r=new Pt(i-t,n-e);r.normalize(),this.h5context.save(),this.h5context.translate(i-o*r.x,n-o*r.y),this.h5context.moveTo(-o*r.y,o*r.x),this.h5context.lineTo(o*r.x,o*r.y),this.h5context.lineTo(o*r.y,-o*r.x),this.h5context.stroke(),this.h5context.restore()}},{key:"arrowLine",value:function(t,e,i,n,o){this.h5context.moveTo(t,e),this.h5context.lineTo(i,n),this.arrow(t,e,i,n,o)}},{key:"bezierCurve",value:function(t,e,i,n,o,r,s,a){this.h5context.beginPath(),this.h5context.moveTo(t,e),this.h5context.bezierCurveTo(o,r,s,a,i,n),this.h5context.stroke()}},{key:"lineToPoint",value:function(t){this.lineTo(t.x,t.y)}},{key:"drawLine",value:function(t,e,i,n){this._pfrist=!0,this._pointConnect(t,e,i,n)}},{key:"drawLineByPoints",value:function(t){if(!(t.length<2)){this._pfrist=!0;for(var e=0;e<t.length-1;e++)this._pointConnect(t[e].x,t[e].y,t[e+1].x,t[e+1].y)}}},{key:"drawLineDriect",value:function(t,e,i,n){this.beginPath(),this.drawLine(t,e,i,n),this.paintPath()}},{key:"ellipseBounds",value:function(t,e,i,n){this._requiredState(new Set([Ct,kt]));var o=Math.trunc(i/2),r=Math.trunc(n/2);this.h5context.ellipse(t+o,e+r,o,r,0,0,2*Math.PI)}},{key:"ellipseRect",value:function(t){this.ellipseBounds(t.left,t.top,t.width,t.height)}},{key:"ellipseDriect",value:function(t,e,i,n){var o=Math.min(t,i),r=Math.min(e,n);this.ellipseBoundsDriect(o,r,Math.abs(i-t),Math.abs(n-e))}},{key:"ellipseBoundsDriect",value:function(t,e,i,n){this.beginPath(),this.ellipseBounds(t,e,i,n),this.paintPath(),this.brush.style!=Ft&&this.h5context.fill()}},{key:"ellipseRectDriect",value:function(t){this.ellipseBoundsDriect(t.left,t.top,t.width,t.height)}},{key:"drawLineByPointsDriect",value:function(t){this.beginPath(),this.drawLineByPoints(t),this.paintPath()}},{key:"rectangleBounds",value:function(t,e,i,n){this.beginPath(),this.drawLine(t,e,t+i-this.pen.width,e),this.drawLine(t+i-this.pen.width,e,t+i-this.pen.width,e+n-this.pen.width),this.drawLine(t+i,e+n-this.pen.width,t,e+n-this.pen.width),this.drawLine(t,e+n-this.pen.width,t,e),this.paintPath()}},{key:"rectangle",value:function(t,e,i,n){this.rectangleBounds(t,e,i-t,n-e)}},{key:"rectangleRect",value:function(t){this.rectangle(t.left,t.top,t.right,t.bottom)}},{key:"_roundRectPath",value:function(t,e,i,n,o){this.h5context.moveTo(t+o,e),this.h5context.arcTo(t+i,e,t+i,e+n,o),this.h5context.arcTo(t+i,e+n,t,e+n,o),this.h5context.arcTo(t,e+n,t,e,o),this.h5context.arcTo(t,e,t+i,e,o)}},{key:"roundBounds",value:function(t,e,i,n,o){this.beginPath(),this._roundRectPath(t,e,i,n,o),this.paintPath()}},{key:"roundRect",value:function(t,e){this.roundBounds(t.left,t.top,t.width,t.height,e)}},{key:"fillBounds",value:function(t,e,i,n){this.brush.style!=Ft&&(this._requiredState(new Set([kt])),this.h5context.fillRect(t,e,i,n))}},{key:"fillRect",value:function(t){this.fillBounds(t.left,t.top,t.width,t.height)}},{key:"fillRoundBounds",value:function(t,e,i,n,o){this._requiredState(new Set([kt])),this.beginPath(),this._roundRectPath(t,e,i,n,o),this.closePath(),this.h5context.fill(),this.pen.style!=pt.Clear&&this.paintPath()}},{key:"fillRoundRect",value:function(t,e){this.fillRoundBounds(t.left,t.top,t.width,t.height,e)}},{key:"fillBoundShadow",value:function(t,e,i,n,o){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;this.h5context.shadowBlur=o,this.h5context.shadowColor=this.brush.color,this.h5context.shadowOffsetX=r,this.h5context.shadowOffsetY=s,this.fillBounds(t,e,i,n),this.h5context.shadowBlur=0,this.h5context.shadowOffsetX=0,this.h5context.shadowOffsetY=0}},{key:"fillRectShadow",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.fillBoundShadow(t.left,t.top,t.width,t.height,e,i,n)}},{key:"fillEllipseRect",value:function(t){this.fillEllipseBounds(t.left,t.top,t.width,t.height)}},{key:"fillEllipseBounds",value:function(t,e,i,n){this._requiredState(new Set([Ct,kt]));var o=Math.trunc(i/2),r=Math.trunc(n/2);this.beginPath(),this.h5context.ellipse(t+o,e+r,o,r,0,0,2*Math.PI),this.closePath(),this.h5context.fill()}},{key:"scale",value:function(t,e){this.scaleSize.reset(t,e),this.h5context.scale(t,e)}},{key:"alpha",get:function(){return this.h5context.globalAlpha},set:function(t){this.h5context.globalAlpha=t}}],[{key:"textWidth",value:function(e,i){return null!=e?_t.font.assign(e):_t.font.assign(t.DefaultFont),Math.round(_t.textWidth(i))}},{key:"getTextExtent",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return _t.font.assign(t),_t.getTextExtent(e,i)}},{key:"getTextExtentExPoint",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return _t.font.assign(t),_t.getTextExtentExPoint(e,i)}},{key:"getCanvasTemp",value:function(){return _t}},{key:"pointInPath",value:function(e,i){return t.pointInPathAt(i.x,i.y)}},{key:"pointInPathAt",value:function(t,e,i){Rt.beginPath(),Rt.moveTo(t[0].x,t[0].y);for(var n=1;n<t.length;n++)Rt.lineTo(t[n].x,t[n].y);return Rt.closePath(),Rt.isPointInPath(e,i)}},{key:"pointInEllipse",value:function(e,i,n,o,r,s){return t.pointInEllipseBounds(e,i,n-e,o-i,r,s)}},{key:"pointInEllipseBounds",value:function(t,e,i,n,o,r){Rt.beginPath();var s=Math.trunc(i/2),a=Math.trunc(n/2);return Rt.ellipse(t+s,e+a,s,a,0,0,2*Math.PI),Rt.closePath(),Rt.isPointInPath(o,r)}},{key:"pointInEllipseRect",value:function(e,i,n){return t.pointInEllipseBounds(e.left,e.top,e.width,e.height,i,n)}},{key:"_setViewSize_",value:function(t,e){bt.width=t,bt.height=e,_t.prepareConext(1)}},{key:"CreateTemp",value:function(e,i){var n=document.createElement("canvas");return n.width=e,n.height=i,new t(n.getContext("2d"))}},{key:"DestroyTemp",value:function(t){t.h5context.canvas.remove()}}]),t}();Dt.DefaultFont=new mt;var bt=document.createElement("canvas"),Rt=bt.getContext("2d"),_t=new Dt(Rt);function xt(t,e,i){return(xt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ut(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function At(t){return function(t){if(Array.isArray(t))return Tt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Tt(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Tt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Ot(t){return(Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Et(t,e,i){return e&&Bt(t.prototype,e),i&&Bt(t,i),t}function Mt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Lt(t,e)}function Lt(t,e){return(Lt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Gt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Ut(t);if(e){var o=Ut(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ht(this,i)}}function Ht(t,e){return!e||"object"!==Ot(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ut(t){return(Ut=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Vt=0,Wt=1,zt=2,jt=3,Xt=4,Kt=5,Yt=0,Jt=1,Zt=1,qt=2,Qt=1,$t=2,te=3,ee=1,ie=2,ne=3,oe=0,re=1,se=2,ae=3,le=4,he=5,ce=6,ue=7,fe=8,de=10,me=11,ye=12,pe=13,Se=14,ve=15,Fe=0,Ie=1,ge=2,we=1,Ce=2,ke=0,Pe=8,De=9,be=13,Re=16,_e=17,xe=18,Ae=27,Te=32,Oe=35,Ne=36,Be=37,Ee=38,Me=39,Le=40,Ge=46,He=65,Ue=67,Ve=70,We=88,ze=89,je=90,Xe=160,Ke=161,Ye=162,Je=163,Ze=164,qe=165,Qe=10,$e=function(t){Mt(i,t);var e=Gt(i);function i(){var t;return Nt(this,i),(t=e.call(this)).publishProperty=new V,t}return Et(i,[{key:"addPublisProperty",value:function(t){this.publishProperty.add(t)}}]),i}(function(t){Mt(i,t);var e=Gt(i);function i(){return Nt(this,i),e.call(this)}return Et(i,[{key:"assign",value:function(t){}}]),i}(L)),ti=function(){function t(){Nt(this,t),this.reset()}return Et(t,[{key:"reset",value:function(){this.control=null,this.controlScreenRect=new U,this.image=null,this.left=0,this.top=0,this.width=2,this.height=16,this.color=at.Black,this.shan=!0,this.visible=!1}},{key:"rect",get:function(){return U.CreateByBounds(this.left,this.top,this.width,this.height)}}]),t}(),ei=function(){function t(){Nt(this,t),this.shiftState=new Set([]),this.button=0,this.x=0,this.y=0,this.delta=0,this.clicks=0}return Et(t,[{key:"assign",value:function(t){this.shiftState=t.shiftState,this.button=t.button,this.x=t.x,this.y=t.y,this.delta=t.delta,this.clicks=t.clicks}}]),t}(),ii=function(){function t(){Nt(this,t),this.shiftState=new Set([]),this.key="",this.keyCode=0}return Et(t,[{key:"assign",value:function(t){this.shiftState=new Set(At(t.shiftState)),this.key=t.key,this.keyCode=t.keyCode}}]),t}(),ni=function(t){Mt(i,t);var e=Gt(i);function i(){var t;return Nt(this,i),(t=e.call(this)).state_=new Set([vi.Creating]),t.designState=!1,t._marginLeft=0,t._marginTop=0,t._marginRight=0,t._marginBottom=0,t._paddingLeft=0,t._paddingTop=0,t._paddingRight=0,t._paddingBottom=0,t.align_=Vt,t._parent=null,t.canFocus=!1,t._focused=!1,t.popupMenu_=null,t._rotate=0,t.transparent=!1,t.color_=null,t.alpha_=1,t.updateCount_=0,t.left_=0,t.top_=0,t.width_=75,t.height_=25,t.enabled_=!0,t.visible_=!0,t.drawShadow=!1,t.hint_="",t.tab_=-1,t.cursor_=oe,t.handle_=0,t.mouseStates=new Set([]),t.tag=null,t.state_.delete(vi.Creating),t.onKillFocus=null,t}return Et(i,[{key:"hclSelect",value:function(){or.application.hclSelectControl(this)}},{key:"_paintexec",value:function(t){this.transparent||this.doPaintBackground_(t),this.doPaint_(t)}},{key:"_setBounds",value:function(){this.doSetBounds_(),this.doResize_()}},{key:"doSetBounds_",value:function(){null!=this.parent&&this.parent.reAlign()}},{key:"doResize_",value:function(){this.onResize()}},{key:"doRequestFocus_",value:function(){return!(!this.visible_||!this.enabled_||this.state_.has(vi.Creating))}},{key:"doSetFocus_",value:function(t){if(null!=this.parent){for(var e=!0,i=this;null!=i.parent;)if(!(i=i.parent).doRequestFocus_()){e=!1;break}e?(this._focused=t,this.parent.setFocusControl_(this,t)):this.killFocus()}}},{key:"doKillFocus_",value:function(){this._focused=!1,this.onKillFocus&&this.onKillFocus(),null!=this.parent&&this.parent.killFocusControl_(this),or.ime._control===this&&or.ime.killFocus()}},{key:"getHint_",value:function(){return this.hint_}},{key:"setHint_",value:function(t){this.hint_=t}},{key:"added_",value:function(t){this._parent=t}},{key:"removed_",value:function(){this.deactivate(),this._parent=null}},{key:"controlVisible_",value:function(t,e){}},{key:"doSetParent_",value:function(t){this._parent!=t&&(null!=this._parent&&this._parent.removeControl(this),null!=t?t.addControl(this):this.removed_())}},{key:"doEnableChange_",value:function(t){t||this.doMouseLeave_(),this.update()}},{key:"doVisibleChange_",value:function(t){this.state_.add(vi.VisibleChange),this.update(),this.state_.delete(vi.VisibleChange),null!=this._parent&&this._parent.controlVisible_(this,t),this.visible_&&this.onShow?this.onShow():!this.visible_&&this.onHide&&this.onHide()}},{key:"doSetMarginLeft_",value:function(t){this._marginLeft=t,this.reAlign()}},{key:"doSetMarginTop_",value:function(t){this._marginTop=t,this.reAlign()}},{key:"doSetMarginRight_",value:function(t){this._marginRight=t,this.reAlign()}},{key:"doSetMarginBottom_",value:function(t){this._marginBottom=t,this.reAlign()}},{key:"doSetPaddingLeft_",value:function(t){this._paddingLeft=t,this.reAlign()}},{key:"doSetPaddingTop_",value:function(t){this._paddingTop=t,this.reAlign()}},{key:"doSetPaddingRight_",value:function(t){this._paddingRight=t,this.reAlign()}},{key:"doSetPaddingBottom_",value:function(t){this._paddingBottom=t,this.reAlign()}},{key:"doMouseEnter_",value:function(){this.mouseStates.add(Zt),or.application.setCursorBy(this),this.onMouseEnter()}},{key:"doMouseLeave_",value:function(){this.mouseStates.delete(Zt),this.mouseStates.delete(qt),this.onMouseLeave()}},{key:"doMouseWheel_",value:function(t){this.onMouseWheel(t)}},{key:"doMouseDown_",value:function(t){this.mouseStates.add(qt),this.setFocus(),this.onMouseDown(t)}},{key:"doMouseMove_",value:function(t){this.onMouseMove(t)}},{key:"doMouseUp_",value:function(t){this.mouseStates.has(qt)&&(this.mouseStates.delete(qt),this.onMouseUp(t),t.button===ee&&this.clientRect().pointInAt(t.x,t.y)?this.doClick_():t.button===ie&&(this.doContextMenu_(t.x,t.y),this.onContextmenu()))}},{key:"doClick_",value:function(){this.onClick(this)}},{key:"doDblClick_",value:function(t){this.onDblClick(t)}},{key:"doKeyDown_",value:function(t){this.onKeyDown(t)}},{key:"doKeyPress_",value:function(t){this.onKeyPress(t)}},{key:"doKeyUp_",value:function(t){this.onKeyUp(t)}},{key:"doCopy_",value:function(t){this.onCopy(t)}},{key:"doCut_",value:function(t){this.onCut(t)}},{key:"doPaste_",value:function(t){this.onPaste(t)}},{key:"doPaintBackground_",value:function(t){this.onPaintBackground(t)}},{key:"doPaint_",value:function(t){this.onPaint(t)}},{key:"doContextMenu_",value:function(t,e){if(null!=this.popupMenu_){var i=this.clientToScreen(new G(0,0));this.popupMenu_.popup(i.x+t,i.y+e)}}},{key:"doGetPopupMenu",value:function(){return this.popupMenu_}},{key:"doSetPopupMenu",value:function(t){this.popupMenu_=t}},{key:"setSize",value:function(t,e){this.width_=t,this.height_=e,this._setBounds()}},{key:"clientRect",value:function(){return U.Create(0,0,this.width,this.height)}},{key:"bounds",value:function(){return U.CreateByBounds(this.left,this.top,this.width,this.height)}},{key:"location",value:function(){return G.Create(this.left,this.top)}},{key:"mouseEnter",value:function(){this.enabled_&&this.doMouseEnter_()}},{key:"mouseLeave",value:function(){this.enabled_&&this.doMouseLeave_()}},{key:"mouseDown",value:function(t){this.enabled_&&this.doMouseDown_(t)}},{key:"mouseWheel",value:function(t){this.enabled_&&this.doMouseWheel_(t)}},{key:"mouseMove",value:function(t){this.enabled_&&this.doMouseMove_(t)}},{key:"mouseUp",value:function(t){this.enabled_&&this.doMouseUp_(t)}},{key:"dblClick",value:function(t){this.enabled_&&this.doDblClick_(t)}},{key:"keyDown",value:function(t){this.enabled_&&(this.state_.add(vi.KeyDown),this.doKeyDown_(t))}},{key:"keyPress",value:function(t){this.enabled_&&this.state_.has(vi.KeyDown)&&this.doKeyPress_(t)}},{key:"keyUp",value:function(t){this.enabled_&&(this.doKeyUp_(t),this.state_.delete(vi.KeyDown))}},{key:"copy",value:function(t){this.enabled_&&this.doCopy_(t)}},{key:"cut",value:function(t){this.enabled_&&this.doCut_(t)}},{key:"paste",value:function(t){this.enabled_&&this.doPaste_(t)}},{key:"dispose",value:function(){null!=this._parent&&this._parent.removeControl(this),xt(Ut(i.prototype),"dispose",this).call(this)}},{key:"broadcast",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;switch(t){case Qe:this.designState=e}}},{key:"activate",value:function(){}},{key:"deactivate",value:function(){this.killFocus()}},{key:"reAlign",value:function(){this.update()}},{key:"offset",value:function(t,e){this.left_=this.left_+t,this.top_=this.top_+e,this._setBounds()}},{key:"setLocal",value:function(t,e){this.left_=t,this.top_=e,this._setBounds()}},{key:"clientToScreenAt",value:function(t,e){return this.clientToScreen(G.Create(t,e))}},{key:"clientToScreen",value:function(t){return t.x+=this.left_,t.y+=this.top_,null!=this.parent?this.parent.clientToScreen(t):t}},{key:"isChildControl",value:function(t){for(var e=this;null!=e.parent;)if((e=e.parent)===t)return!0;return!1}},{key:"getHintRect",value:function(){return this.clientRect()}},{key:"paint",value:function(t){if(!(this.updateCount_>0))if(1!=this.alpha_){t.save();try{t.alpha=this.alpha_,this._paintexec(t)}finally{t.restore()}}else this._paintexec(t)}},{key:"paintTo",value:function(t,e,i){t.save();try{t.translate(e,i),this.paint(t)}finally{t.restore()}}},{key:"updateRect",value:function(t){this.updateCount_>0||this.state_.has(vi.Aligning)||(this.visible_||this.state_.has(vi.VisibleChange))&&(null!=this.parent?this.parent.updateRect(t.offset(this.left,this.top,!0)):this.onUpdate(t))}},{key:"update",value:function(){this.updateRect(this.clientRect())}},{key:"setFocus",value:function(){this._focused||(this.canFocus?(this.doSetFocus_(!0),this._focused&&this.update()):this.doSetFocus_(!1))}},{key:"tabSetFocus",value:function(){this.setFocus()}},{key:"killFocus",value:function(){this._focused&&(this.doKillFocus_(),this.mouseStates.clear(),this.update())}},{key:"beginUpdate",value:function(){this.updateCount_++}},{key:"endUpdate",value:function(){this.updateCount_>0&&(this.updateCount_--,0==this.updateCount_&&this.update())}},{key:"onResize",value:function(){}},{key:"onContextmenu",value:function(){}},{key:"onMouseEnter",value:function(){}},{key:"onMouseLeave",value:function(){}},{key:"onPaintBackground",value:function(t){}},{key:"onUpdate",value:function(t){}},{key:"onPaint",value:function(t){}},{key:"onMouseWheel",value:function(t){}},{key:"onMouseDown",value:function(t){}},{key:"onMouseMove",value:function(t){}},{key:"onClick",value:function(t){}},{key:"onDblClick",value:function(t){}},{key:"onMouseUp",value:function(t){}},{key:"onKeyDown",value:function(t){}},{key:"onKeyPress",value:function(t){}},{key:"onKeyUp",value:function(t){}},{key:"onCopy",value:function(t){}},{key:"onCut",value:function(t){}},{key:"onPaste",value:function(t){}},{key:"left",get:function(){return this.left_},set:function(t){this.left_!=t&&(this.left_=t,this._setBounds())}},{key:"top",get:function(){return this.top_},set:function(t){this.top_!=t&&(this.top_=t,this._setBounds())}},{key:"right",get:function(){return this.left_+this.width_},set:function(t){t>this.left_&&(this.width=t-this.left_)}},{key:"bottom",get:function(){return this.top_+this.height_},set:function(t){t>this.top_&&(this.height=t-this.top_)}},{key:"width",get:function(){return this.width_},set:function(t){this.width_!=t&&(this.width_=t,this._setBounds())}},{key:"height",get:function(){return this.height_},set:function(t){this.height_!=t&&(this.height_=t,this._setBounds())}},{key:"alpha",get:function(){return this.alpha_},set:function(t){this.alpha_!=t&&(this.alpha_=t,this.update())}},{key:"color",get:function(){return this.color_},set:function(t){this.color_!=t&&(this.color_=t,this.update())}},{key:"rotate",get:function(){return this._rotate},set:function(t){this._rotate!=t&&(this._rotate=t,this._setBounds())}},{key:"hint",get:function(){return this.getHint_()},set:function(t){this.setHint_(t)}},{key:"tab",get:function(){return this.tab_},set:function(t){this.tab_!=t&&this.parent.setTab(this,t)}},{key:"mouseIn",get:function(){return this.mouseStates.has(Zt)}},{key:"align",get:function(){return this.align_},set:function(t){this.align_!=t&&(this.align_=t,null!=this.parent&&this.parent.reAlign())}},{key:"marginLeft",get:function(){return this._marginLeft},set:function(t){this.doSetMarginLeft_(t)}},{key:"marginTop",get:function(){return this._marginTop},set:function(t){this.doSetMarginTop_(t)}},{key:"marginRight",get:function(){return this._marginRight},set:function(t){this.doSetMarginRight_(t)}},{key:"marginBottom",get:function(){return this._marginBottom},set:function(t){this.doSetMarginBottom_(t)}},{key:"paddingLeft",get:function(){return this._paddingLeft},set:function(t){this.doSetPaddingLeft_(t)}},{key:"paddingTop",get:function(){return this._paddingTop},set:function(t){this.doSetPaddingTop_(t)}},{key:"paddingRight",get:function(){return this._paddingRight},set:function(t){this.doSetPaddingRight_(t)}},{key:"paddingBottom",get:function(){return this._paddingBottom},set:function(t){this.doSetPaddingBottom_(t)}},{key:"enabled",get:function(){return this.enabled_},set:function(t){this.enabled_!=t&&(this.enabled_=t,this.doEnableChange_(t))}},{key:"visible",get:function(){return this.visible_},set:function(t){this.visible_!=t&&(this.visible_=t,this.doVisibleChange_(t))}},{key:"focused",get:function(){return this._focused}},{key:"parent",get:function(){return this._parent},set:function(t){this.doSetParent_(t)}},{key:"cursor",get:function(){return this.cursor_},set:function(t){this.cursor_!=t&&(this.cursor_=t,or.application.setCursorBy(this))}},{key:"popupMenu",get:function(){return this.doGetPopupMenu()},set:function(t){this.doSetPopupMenu(t)}}]),i}($e),oi=function(t){Mt(i,t);var e=Gt(i);function i(){var t;return Nt(this,i),(t=e.call(this)).width_=100,t.height_=100,t.dropDownStyle=!1,t.popupLinkedList=null,t.forward=null,t.next=null,t.onClose=null,t.onDone=null,t}return Et(i,[{key:"doPaintBackground_",value:function(t){var e=this.clientRect();or.theme.drawShadow(t,e,this.dropDownStyle),t.brush.color=or.theme.backgroundStaticColor,t.fillRect(e),xt(Ut(i.prototype),"doPaintBackground_",this).call(this,t)}},{key:"getControlAtPos",value:function(t,e){return this}},{key:"updateRect",value:function(t){or.application.updateRect(t.offset(this.left,this.top,!0))}},{key:"update",value:function(){this.updateRect(this.clientRect())}},{key:"popup",value:function(t,e,i){this.left=t,this.top=e,this.visible=!0,or.application.trackPopupControl(this,i)}},{key:"popupControl",value:function(t){var e=t.clientToScreenAt(0,0);this.popup(e.x,e.y+t.height,!0)}},{key:"closePopup",value:function(){null!=this.onClose&&this.onClose()}},{key:"donePopup",value:function(){or.application.closePopupControl(this.popupLinkedList.first),null!=this.onDone&&this.onDone()}},{key:"close",value:function(){or.application.closePopupControl(this)}}]),i}(ni),ri=0,si=1,ai=2,li=3,hi=0,ci=1,ui=2,fi=3,di=4,mi=function(t){Mt(i,t);var e=Gt(i);function i(){var t;return Nt(this,i),(t=e.call(this)).width_=100,t.height_=20,t.min_=0,t.max_=0,t.pageSize_=0,t.position_=0,t.range_=0,t.precent_=0,t.leftBlank_=0,t.rightBlank_=0,t.buttonSize=20,t.btnStep_=5,t.thumRect_=new U,t.leftBtnRect_=new U,t.rightBtnRect_=new U,t.mouseDownPt_=new G,t.mouseDownControl_=ri,t.orientation_=Yt,t.align_=Xt,t._onScroll=null,t}return Et(i,[{key:"_reCalcButtonRect",value:function(){this.orientation_==Yt?(this.leftBtnRect_=U.CreateByBounds(this.leftBlank_,0,this.buttonSize,this.height),this.rightBtnRect_=U.CreateByBounds(this.width-this.rightBlank_-this.buttonSize,0,this.buttonSize,this.height)):(this.leftBtnRect_=U.CreateByBounds(0,this.leftBlank_,this.width,this.buttonSize),this.rightBtnRect_=U.CreateByBounds(0,this.height-this.rightBlank_-this.buttonSize,this.width,this.buttonSize))}},{key:"_reCalcThumRect",value:function(){var t=0,e=0;if(this.orientation_==Yt)if(this.thumRect_.top=0,this.thumRect_.bottom=this.height,this.pageSize_<this.range_){if(t=this.pageSize_/this.range_,(e=Math.round((this.width-this.leftBlank_-this.rightBlank_-2*this.buttonSize)*t))<this.buttonSize&&(e=this.buttonSize),this.precent_=(this.width-this.leftBlank_-this.rightBlank_-2*this.buttonSize-e)/(this.range_-this.pageSize_),this.precent_<0)return;this.thumRect_.left=this.leftBlank_+this.buttonSize+Math.round(this.position_*this.precent_),this.thumRect_.right=this.thumRect_.left+e}else this.thumRect_.left=this.leftBlank_+this.buttonSize,this.thumRect_.right=this.width-this.rightBlank_-this.buttonSize;else if(this.thumRect_.left=0,this.thumRect_.right=this.width,this.pageSize_<this.range_){if(t=this.pageSize_/this.range_,(e=Math.round((this.height-this.leftBlank_-this.rightBlank_-2*this.buttonSize)*t))<this.buttonSize&&(e=this.buttonSize),this.precent_=(this.height-this.leftBlank_-this.rightBlank_-2*this.buttonSize-e)/(this.range_-this.pageSize_),this.precent_<0)return;this.thumRect_.top=this.leftBlank_+this.buttonSize+Math.round(this.position_*this.precent_),this.thumRect_.bottom=this.thumRect_.top+e}else this.thumRect_.top=this.leftBlank_+this.buttonSize,this.thumRect_.bottom=this.height-this.rightBlank_-this.buttonSize;0==this.precent_&&(this.precent_=1)}},{key:"_setOrientation",value:function(t){this.orientation_!=t&&(this.orientation_=t,t==Yt?(this.height_=this.buttonSize,this.align=Xt):(this.width_=this.buttonSize,this.align=jt))}},{key:"_setMin",value:function(t){this.min_!=t&&(t>this.max_?this.min_=this.max_:this.min_=t,this.position_<this.min_&&(this.position_=this.min_),this.range_=this.max_-this.min_,this._reCalcThumRect(),this._updateRangRect())}},{key:"_setMax",value:function(t){this.max_!=t&&(t<this.min_?this.max_=this.min_:this.max_=t,this.position_+this.pageSize_>this.max_&&(this.position_=Math.max(this.max_-this.pageSize_,this.min_)),this.range_=this.max_-this.min_,this._reCalcThumRect(),this._updateRangRect())}},{key:"_setPageSize",value:function(t){this.pageSize_!=t&&(this.pageSize_=t,this._reCalcThumRect(),this._updateRangRect())}},{key:"_setPosition",value:function(t){var e=0;e=t<this.min_?this.min_:t+this.pageSize_>this.max_?Math.max(this.max_-this.pageSize_,this.min_):t,this.position_!=e&&(this.position_=e,this._reCalcThumRect(),this._updateRangRect(),null!=this._onScroll&&this._onScroll(di,this.position_))}},{key:"scrollStep_",value:function(t){var e=0;switch(t){case hi:(e=this.position_-this.btnStep_)<this.min_&&(e=this.min_),this.position_!=e&&(this.position=e);break;case ci:(e=this.position_+this.btnStep_)>this.range_-this.pageSize_&&(e=this.range_-this.pageSize_),this.position_!=e&&(this.position=e);break;case ui:(e=this.position_-this.pageSize_)<this.min_&&(e=this.min_),this.position_!=e&&(this.position=e);break;case fi:(e=this.position_+this.pageSize_)>this.range_-this.pageSize_&&(e=this.range_-this.pageSize_),this.position_!=e&&(this.position=e)}}},{key:"doMouseDown_",value:function(t){xt(Ut(i.prototype),"doMouseDown_",this).call(this,t),this.mouseDownPt_.x=t.x,this.mouseDownPt_.y=t.y,this.leftBtnRect_.pointIn(this.mouseDownPt_)?(this.mouseDownControl_=si,this.scrollStep_(hi)):this.thumRect_.pointIn(this.mouseDownPt_)?this.mouseDownControl_=ai:this.rightBtnRect_.pointIn(this.mouseDownPt_)?(this.mouseDownControl_=li,this.scrollStep_(ci)):this._ptInLeftBlankArea(t.x,t.y)||this._ptInRightBlankArea(t.x,t.y)||(this.mouseDownControl_=ri,this.thumRect_.top>t.y||this.thumRect_.left>t.x?this.scrollStep_(ui):(this.thumRect_.bottom<t.y||this.thumRect_.right<t.x)&&this.scrollStep_(fi))}},{key:"doMouseMove_",value:function(t){xt(Ut(i.prototype),"doMouseMove_",this).call(this,t);var e=0;t.button==ee&&(this.orientation_==Yt?this.mouseDownControl_==ai&&(e=t.x-this.mouseDownPt_.x,this.position=this.position_+Math.round(e/this.precent_),this.mouseDownPt_.x=t.x):this.mouseDownControl_==ai&&(e=t.y-this.mouseDownPt_.y,this.position=this.position_+Math.round(e/this.precent_),this.mouseDownPt_.y=t.y))}},{key:"_updateRangRect",value:function(){this.update()}},{key:"_ptInLeftBlankArea",value:function(t,e){return 0!=this.leftBlank_&&(this.orientation_==Yt?U.CreateByBounds(0,0,this.leftBlank_,this.height).pointInAt(t,e):U.CreateByBounds(0,0,this.width,this.leftBlank_).pointInAt(t,e))}},{key:"_ptInRightBlankArea",value:function(t,e){return 0!=this.rightBlank_&&(this.orientation_==Yt?U.CreateByBounds(this.width-this.rightBlank_,0,this.rightBlank_,this.height).pointInAt(t,e):U.CreateByBounds(0,this.height-this.rightBlank_,this.width,this.rightBlank_).pointInAt(t,e))}},{key:"doResize_",value:function(){xt(Ut(i.prototype),"doResize_",this).call(this),this.orientation_==Jt?this.pageSize_=this.height:this.pageSize_=this.width,this.position_+this.pageSize_>this.max_&&(this.position_=Math.max(this.max_-this.pageSize_,this.min_)),this._reCalcThumRect(),this._reCalcButtonRect()}},{key:"doPaint_",value:function(t){this.paintToEx(t)}},{key:"doDrawThumBefor_",value:function(t,e){}},{key:"paintToEx",value:function(t){t.brush.color=or.theme.backgroundStaticColor,t.fillBounds(0,0,this.width,this.height);var e=U.CreateByRect(this.thumRect_);t.pen.width=1,this.orientation_==Yt?(e.inFlate(0,-1),this.doDrawThumBefor_(t,e),t.brush.color=or.theme.backgroundHotColor,t.fillRect(e),t.pen.color=or.theme.borderColor,t.beginPath(),t.drawLine(e.left,e.top,e.right,e.top),t.drawLine(e.right,e.top,e.right,e.bottom),t.drawLine(e.right,e.bottom-1,e.left,e.bottom-1),t.drawLine(e.left,e.bottom,e.left,e.top),e.left=e.left+Math.trunc(e.width/2),t.drawLine(e.left,5,e.left,this.height-5),t.drawLine(e.left+3,5,e.left+3,this.height-5),t.drawLine(e.left-3,5,e.left-3,this.height-5),t.paintPath(),t.pen.color=or.theme.backgroundHotColor,t.beginPath(),e.left=this.leftBtnRect_.left+Math.trunc((this.leftBtnRect_.width-4)/2)+4,e.top=this.leftBtnRect_.top+Math.trunc((this.leftBtnRect_.height-7)/2),t.drawLine(e.left,e.top,e.left,e.top+7),t.drawLine(e.left-1,e.top+1,e.left-1,e.top+6),t.drawLine(e.left-2,e.top+2,e.left-2,e.top+5),t.drawLine(e.left-3,e.top+3,e.left-3,e.top+4),e.left=this.rightBtnRect_.left+Math.trunc((this.rightBtnRect_.width-4)/2),e.top=this.rightBtnRect_.top+Math.trunc((this.rightBtnRect_.height-7)/2),t.drawLine(e.left,e.top,e.left,e.top+7),t.drawLine(e.left+1,e.top+1,e.left+1,e.top+6),t.drawLine(e.left+2,e.top+2,e.left+2,e.top+5),t.drawLine(e.left+3,e.top+3,e.left+3,e.top+4),t.paintPath()):(e.inFlate(-1,0),this.doDrawThumBefor_(t,e),t.brush.color=or.theme.backgroundHotColor,t.fillRect(e),t.pen.color=or.theme.borderColor,t.beginPath(),t.drawLine(e.left,e.top,e.right,e.top),t.drawLine(e.right-1,e.top,e.right-1,e.bottom),t.drawLine(e.right,e.bottom,e.left,e.bottom),t.drawLine(e.left,e.bottom,e.left,e.top),e.top=e.top+Math.trunc(e.height/2),t.drawLine(5,e.top,this.width-5,e.top),t.drawLine(5,e.top-3,this.width-5,e.top-3),t.drawLine(5,e.top+3,this.width-5,e.top+3),t.paintPath(),t.pen.color=or.theme.backgroundHotColor,t.beginPath(),e.left=this.leftBtnRect_.left+Math.trunc((this.leftBtnRect_.width-7)/2),e.top=this.leftBtnRect_.top+Math.trunc((this.leftBtnRect_.height-4)/2)+4,t.drawLine(6,12,13,12),t.drawLine(e.left,e.top,e.left+7,e.top),t.drawLine(e.left+1,e.top-1,e.left+6,e.top-1),t.drawLine(e.left+2,e.top-2,e.left+5,e.top-2),t.drawLine(e.left+3,e.top-3,e.left+4,e.top-3),e.left=this.rightBtnRect_.left+Math.trunc((this.rightBtnRect_.width-7)/2),e.top=this.rightBtnRect_.top+Math.trunc((this.rightBtnRect_.height-4)/2),t.drawLine(e.left,e.top,e.left+7,e.top),t.drawLine(e.left+1,e.top+1,e.left+6,e.top+1),t.drawLine(e.left+2,e.top+2,e.left+5,e.top+2),t.drawLine(e.left+3,e.top+3,e.left+4,e.top+3),t.paintPath())}},{key:"orientation",get:function(){return this.orientation_},set:function(t){this._setOrientation(t)}},{key:"min",get:function(){return this.min_},set:function(t){this._setMin(t)}},{key:"max",get:function(){return this.max_},set:function(t){this._setMax(t)}},{key:"pageSize",get:function(){return this.pageSize_},set:function(t){this._setPageSize(t)}},{key:"range",get:function(){return this.range_}},{key:"position",get:function(){return this.position_},set:function(t){this._setPosition(t)}},{key:"btnStep",get:function(){return this.btnStep_},set:function(t){this.btnStep_!=t&&(this.btnStep_=t)}},{key:"onScroll",get:function(){return this._onScroll},set:function(t){this._onScroll=t}}]),i}(ni),yi=0,pi=1,Si=2,vi={Creating:1,Removing:2,Aligning:3,VisibleChange:4,KeyDown:5},Fi=1,Ii=2,gi=function(t){Mt(i,t);var e=Gt(i);function i(){return Nt(this,i),e.call(this)}return i}(function(t){Mt(i,t);var e=Gt(i);function i(){var t;return Nt(this,i),(t=e.call(this)).state_.add(vi.Creating),t.handle_=0,t.image=null,t.controls=new V,t.controls.onAdded=function(e){t.doAddControl_(e)},t.controls.onRemoved=function(e){t.doRemoveControl_(e)},t._focusControl=null,t._captureControl=null,t._mouseMoveControl=null,t.state_.delete(vi.Creating),t}return Et(i,[{key:"doResize_",value:function(){this.reAlign(),xt(Ut(i.prototype),"doResize_",this).call(this)}},{key:"doAddControl_",value:function(t){t.tab_=this.controls.count-1,t.added_(this),this.reAlignControl(t)}},{key:"doAlign_",value:function(){for(var t=this.paddingLeft,e=this.paddingTop,i=this.width-this.paddingRight,n=this.height-this.paddingBottom,o=null,r=0;r<this.controls.count;r++)(o=this.controls[r]).visible&&o.align==zt&&(o.left=this.paddingLeft+o.marginLeft,o.top=e+o.marginTop,o.width=this.width-this.paddingLeft-this.paddingRight-o.marginLeft-o.marginRight,o.reAlign(),e=o.top+o.height+o.marginBottom);for(var s=0;s<this.controls.count;s++)(o=this.controls[s]).visible&&o.align==Xt&&(o.left=this.paddingLeft+o.marginLeft,o.width=this.width-this.paddingLeft-this.paddingRight-o.marginLeft-o.marginRight,n=n-o.marginBottom-o.height,o.top=n,o.reAlign(),n=o.top-o.marginTop);for(var a=0;a<this.controls.count;a++)(o=this.controls[a]).visible&&o.align==Wt&&(o.left=t+o.marginLeft,o.top=e+o.marginTop,o.height=n-e-o.marginTop-o.marginBottom,o.reAlign(),t=o.left+o.width+o.marginRight);for(var l=0;l<this.controls.count;l++)(o=this.controls[l]).visible&&o.align==jt&&(i=i-o.marginRight-o.width,o.left=i,o.top=e+o.marginTop,o.height=n-e-o.marginTop-o.marginBottom,o.reAlign(),i=o.left-o.marginLeft);for(var h=0;h<this.controls.count;h++)(o=this.controls[h]).visible&&o.align==Kt&&(o.left=t+o.marginLeft,o.top=e+o.marginTop,o.width=i-t-o.marginLeft-o.marginRight,o.height=n-e-o.marginTop-o.marginBottom,o.reAlign())}},{key:"removed_",value:function(){this.state_.add(vi.Removing),xt(Ut(i.prototype),"removed_",this).call(this),this.controls.clear()}},{key:"doRemoveControl_",value:function(t){this._focusControl===t&&(this._focusControl=null),this._captureControl===t&&(this._captureControl=null),this._mouseMoveControl===t&&(this._mouseMoveControl=null),t.removed_(),this.reAlign()}},{key:"controlVisible_",value:function(t,e){!e&&this.focusControl&&(this.focusControl==t||this.focusControl.isChildControl(t))&&this.focusControl.killFocus(),this.reAlignControl(t)}},{key:"insertControl",value:function(t,e){this.controls.insert(t,e)}},{key:"addControl",value:function(t){this.controls.add(t),t.visible&&t.canFocus&&this.setFocusControl_(t,!0)}},{key:"removeControl",value:function(t){this.controls.remove(t)}},{key:"reAlign",value:function(){if(!this.state_.has(vi.Creating)&&!this.state_.has(vi.Aligning)&&!this.state_.has(vi.Removing)){this.state_.add(vi.Aligning);try{this.doAlign_(),xt(Ut(i.prototype),"reAlign",this).call(this)}finally{this.state_.delete(vi.Aligning),this.update()}}}},{key:"reAlignControl",value:function(t){t.align!=Vt&&this.reAlign()}},{key:"setFocusControl_",value:function(t,e){t!=this._focusControl&&e&&(null!=this._focusControl&&this._focusControl.killFocus(),this._focusControl=t),this.visible_&&null!=this.parent&&this.parent.setFocusControl_(t,e)}},{key:"killFocusControl_",value:function(t){this._focusControl=null,null!=this.parent?this.parent.killFocusControl_(t):or.application.killFocusControl_(t)}},{key:"killFocus",value:function(){this.focused?xt(Ut(i.prototype),"killFocus",this).call(this):null!=this._focusControl&&this._focusControl.killFocus()}},{key:"deactivate",value:function(){this.killFocus()}},{key:"getControlIndexAt",value:function(t,e){for(var i=null,n=this.controls.count-1;n>=0;n--)if((i=this.controls[n]).visible&&i.bounds().pointInAt(t,e))return n;return-1}},{key:"getControlAt",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getControlIndexAt(t,e);if(n>=0){var o=this.controls[n];return i&&!o.enabled?null:o}return null}},{key:"getControlAtPos",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=this.getControlAt(t,e,n);return null!=o?o.isClass(i)?o.getControlAtPos(t-o.left,e-o.top,n):o:this}},{key:"doMouseLeave_",value:function(){null!=this._mouseMoveControl&&(this._mouseMoveControl.mouseLeave(),this._mouseMoveControl=null),xt(Ut(i.prototype),"doMouseLeave_",this).call(this)}},{key:"doMouseWheel_",value:function(t){if(this.enabled_)if(null!=this._mouseMoveControl){var e=new ei;e.assign(t),e.x=t.x-this._mouseMoveControl.left,e.y=t.y-this._mouseMoveControl.top,this._mouseMoveControl.mouseWheel(e)}else xt(Ut(i.prototype),"doMouseDown_",this).call(this,t)}},{key:"mouseDown",value:function(t){if(this.enabled_){var e=this.getControlAt(t.x,t.y);if(this.designState&&(null!=e?e.hclSelect():this.hclSelect()),null!=e){this._captureControl=e;var n=new ei;n.assign(t),n.x=t.x-this._captureControl.left,n.y=t.y-this._captureControl.top,this._captureControl.mouseDown(n)}else null!=this._focusControl&&this._focusControl.killFocus(),xt(Ut(i.prototype),"mouseDown",this).call(this,t)}}},{key:"mouseMove",value:function(t){if(this.enabled_){if(t.button==ee&&null!=this._captureControl){var e=new ei;return e.assign(t),e.x=t.x-this._captureControl.left,e.y=t.y-this._captureControl.top,void this._captureControl.mouseMove(e)}var n=this.getControlAt(t.x,t.y);if(n!=this._mouseMoveControl&&(null!=this._mouseMoveControl&&this._mouseMoveControl.mouseLeave(),this._mouseMoveControl=n,null!=this._mouseMoveControl&&this._mouseMoveControl.mouseEnter()),null!=this._mouseMoveControl){var o=new ei;o.assign(t),o.x=t.x-this._mouseMoveControl.left,o.y=t.y-this._mouseMoveControl.top,this._mouseMoveControl.mouseMove(o)}else or.application.setCursorBy(this),xt(Ut(i.prototype),"mouseMove",this).call(this,t)}}},{key:"mouseUp",value:function(t){if(this.enabled_){if(null!==this._captureControl){var e=new ei;e.assign(t),e.x=t.x-this._captureControl.left,e.y=t.y-this._captureControl.top,this._captureControl.mouseUp(e)}else xt(Ut(i.prototype),"mouseUp",this).call(this,t);this._captureControl=null}}},{key:"doDblClick_",value:function(t){if(this.enabled_){var e=this.getControlAt(t.x,t.y);if(null!=e){var n=new ei;n.assign(t),n.x-=e.left,n.y-=e.top,e.dblClick(n)}else xt(Ut(i.prototype),"doDblClick_",this).call(this,t)}}},{key:"setTab",value:function(t,e){e>this.controls.count-1&&(e=this.controls.count-1),t.tab_=e}},{key:"tabNext",value:function(t){for(var e=0;e<this.controls.count;e++)if(this.controls[e].tab>t.tab&&this.controls[e].canFocus&&this.controls[e].visible&&this.controls[e].enabled){this.controls[e].tabSetFocus();break}}},{key:"tabPrev",value:function(t){for(var e=this.controls.count-1;e>=0;e--)if(this.controls[e].tab<t.tab&&this.controls[e].canFocus&&this.controls[e].visible&&this.controls[e].enabled){this.controls[e].tabSetFocus();break}}},{key:"doKeyDown_",value:function(t){null!=this._focusControl?this._focusControl.keyDown(t):this.keyPreview||xt(Ut(i.prototype),"doKeyDown_",this).call(this,t)}},{key:"doKeyPress_",value:function(t){null!=this._focusControl?this._focusControl.keyPress(t):this.keyPreview||xt(Ut(i.prototype),"doKeyPress_",this).call(this,t)}},{key:"doKeyUp_",value:function(t){null!=this._focusControl?this._focusControl.keyUp(t):this.keyPreview||xt(Ut(i.prototype),"doKeyUp_",this).call(this,t)}},{key:"doCopy_",value:function(t){null!=this._focusControl?this._focusControl.copy(t):xt(Ut(i.prototype),"doCopy_",this).call(this,t)}},{key:"doCut_",value:function(t){null!=this._focusControl?this._focusControl.cut(t):xt(Ut(i.prototype),"doCut_",this).call(this,t)}},{key:"doPaste_",value:function(t){null!=this._focusControl?this._focusControl.paste(t):xt(Ut(i.prototype),"doPaste_",this).call(this,t)}},{key:"doPaintBackground_",value:function(t){null!=this.image?t.drawImage(0,0,this.image.image):(null!=this.color?t.brush.color=this.color:t.brush.color=or.theme.backgroundStaticColor,t.fillBounds(0,0,this.width,this.height)),xt(Ut(i.prototype),"doPaintBackground_",this).call(this,t)}},{key:"doPaint_",value:function(t){for(var e=null,n=0;n<this.controls.count;n++)if((e=this.controls[n]).visible){t.save();try{t.translate(e.left,e.top),e.drawShadow&&or.theme.drawShadow(t,U.CreateByBounds(0,0,e.width,e.height),e.dropDownStyle),t.clip(0,0,e.width,e.height),e.paint(t)}finally{t.restore()}}xt(Ut(i.prototype),"doPaint_",this).call(this,t)}},{key:"broadcast",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=0;o<this.controls.count;o++)this.controls[o].broadcast(t,e,n);xt(Ut(i.prototype),"broadcast",this).call(this,t,e,n)}},{key:"handle",get:function(){return this.handle_}},{key:"focusControl",get:function(){return this._focusControl}}]),i}(ni)),wi=function(t){Mt(i,t);var e=Gt(i);function i(){var t;return Nt(this,i),(t=e.call(this)).dropDownStyle=!1,t.popupLinkedList=null,t.forward=null,t.next=null,t.onDone=null,t}return Et(i,[{key:"_doPaintShadow",value:function(t,e){t.brush.color=or.theme.backgroundStaticColor,t.fillRectShadow(e,or.theme.shadow)}},{key:"doPaintBackground_",value:function(t){var e=this.clientRect();or.theme.drawShadow(t,e,this.dropDownStyle),xt(Ut(i.prototype),"doPaintBackground_",this).call(this,t)}},{key:"updateRect",value:function(t){or.application.updateRect(t.offset(this.left,this.top,!0))}},{key:"popup",value:function(t,e,i){this.left=t,this.top=e,this.visible=!0,or.application.trackPopupControl(this,i)}},{key:"popupControl",value:function(t){var e=t.clientToScreenAt(0,0);this.popup(e.x,e.y+t.height,!0)}},{key:"donePopup",value:function(){or.application.closePopupControl(this.popupLinkedList.first),null!=this.onDone&&this.onDone()}},{key:"closePopup",value:function(){this.deactivate(),null!=this.onClose&&this.onClose()}},{key:"close",value:function(){or.application.closePopupControl(this)}}]),i}(gi);function Ci(t){return(Ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ki(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pi(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Di(t,e,i){return e&&Pi(t.prototype,e),i&&Pi(t,i),t}function bi(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ri(t,e)}function Ri(t,e){return(Ri=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _i(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Ai(t);if(e){var o=Ai(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return xi(this,i)}}function xi(t,e){return!e||"object"!==Ci(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ai(t){return(Ai=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ti=function(t){bi(i,t);var e=_i(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;return ki(this,i),(t=e.call(this))._handle=0,t._lastExecTime=0,t._stoped=!0,t.loop=!1,t._interval=n,t.onExecute=null,t}return Di(i,[{key:"_execute",value:function(t){var e=this;if(0==this._lastExecTime)this._lastExecTime=t;else if(t-this._lastExecTime>=this._interval){if(this.doExecute_(),!this.loop)return void this.doStop_();this._lastExecTime=t}this._stoped||(this._handle=window.requestAnimationFrame((function(t){return e._execute(t)})))}},{key:"doStop_",value:function(){this._stoped=!0}},{key:"doExecute_",value:function(){null!=this.onExecute&&this.onExecute()}},{key:"start",value:function(){var t=this;0==this._handle&&(this._stoped=!1,this._lastExecTime=0,this._handle=window.requestAnimationFrame((function(e){return t._execute(e)})))}},{key:"stop",value:function(){this._handle>0&&(window.cancelAnimationFrame(this._handle),this.doStop_(),this._handle=0)}},{key:"enabled",get:function(){return!this._stoped},set:function(t){t?this._stoped&&this.start():this._stoped||this.stop()}}]),i}($e),Oi=function(t){bi(i,t);var e=_i(i);function i(){var t;return ki(this,i),(t=e.call(this)).rect=new U,t.text="",t.visible=!1,t.control=null,t}return i}(L),Ni=(window.AudioContext||window.webkitAudioContext,function(t){bi(i,t);var e=_i(i);function i(){return ki(this,i),e.call(this)}return Di(i,null,[{key:"request",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=null;if(window.XMLHttpRequest?r=new XMLHttpRequest:window.ActiveXObject&&(r=new ActiveXObject("Microsoft.XMLHTTP")),null!=r){var s=i.toUpperCase(),a=t,l=o,h=e||[],c=[];for(var u in h)c.push(u+"="+h[u]);var f=c.join("&");r.onreadystatechange=function(){4==r.readyState&&200==r.status&&null!=n&&n(r.responseText)},r.onloadend=function(t){},"GET"==s?(r.open("GET",a+"?"+f,l),r.send(null)):"POST"==s&&(r.open("POST",a,l),r.setRequestHeader("Content-type","application/x-www-form-urlencoded"),r.send(f))}else alert("你的浏览器不支持XMLHttp")}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];i.request(t,e,"GET",n,o)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];i.request(t,e,"POST",n,o)}}]),i}(L));function Bi(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Ei=0,Mi=1,Li=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._control=null,this._active=!1,this._input=document.createElement("input"),this._input.type="text",this._input.style.position="absolute",this._input.style.opacity=0,this._input.style.zIndex=-1,this._input.style.left="20px",this._input.style.top="10px",this._input.style.width="10px",this._input.style.height="10px",this._input.onfocus=function(t){e._doSetFocus()},this._input.onblur=function(t){e._doKillFocus()},this._input.addEventListener("compositionstart",(function(t){e._input.value=""})),this._input.addEventListener("compositionend",(function(t){e._doInput(t.data)})),this._input.oninput=function(t){if(!t.isComposing){if("insertText"!=t.inputType)return void(e._input.value="");e._doInput(e._input.value),e._input.value=""}}}var e,i,n;return e=t,(i=[{key:"__hclLoaded",value:function(t){this._input.setAttribute("id","hclInput_"+t.system.Timestamp),t.parentElement.appendChild(this._input)}},{key:"__hclUnLoaded",value:function(t){t.parentElement.removeChild(this._input)}},{key:"_doSetFocus",value:function(){this._active=!0}},{key:"_doKillFocus",value:function(){this._active=!1}},{key:"_doInput",value:function(t){this._input.value="",null!==this._control&&this._control.imeInput(t)}},{key:"setControl",value:function(t){this._control=null!==t?t:null,null!==this._control?t.imeMode==Ei||this._active||(this.updateSize(14),this._input.focus(),this._control.imeActive()):this._input.value=""}},{key:"removeControl",value:function(t){this._control===t&&(this._control=null,this._input.value="")}},{key:"updateSize",value:function(t){null!==this._control&&(this._input.style.height=t+"px")}},{key:"updatePosition",value:function(t,e){if(null!==this._control){var i=this._control.clientToScreen(G.Create(t,e));this._input.style.left=i.x+"px",this._input.style.top=i.y+"px"}}},{key:"killFocus",value:function(){this._doKillFocus()}}])&&Bi(e.prototype,i),n&&Bi(e,n),t}();function Gi(t){return(Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hi(t,e,i){return(Hi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Yi(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Ui(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Vi(t,e,i){return e&&Ui(t.prototype,e),i&&Ui(t,i),t}function Wi(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zi(t,e)}function zi(t,e){return(zi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ji(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Yi(t);if(e){var o=Yi(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Xi(this,i)}}function Xi(t,e){return!e||"object"!==Gi(e)&&"function"!=typeof e?Ki(t):e}function Ki(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Yi(t){return(Yi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ji(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Zi=0,qi=1,Qi=2,$i=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).autoSize=!0,t._srcType=Zi,t._imageType="",t._onImageLoaded=null,t.image=new Image,t.image.onload=function(e){t.doImageLoad_()},t}return Vi(i,[{key:"assign",value:function(t){this.autoSize=t.autoSize,this._srcType=t._srcType,this._imageType=t._imageType,this.image=new this.image,this.image.src=t.image.src}},{key:"doImageLoad_",value:function(){if(this.loaded=!0,this.autoSize&&(this.width=this.image.width,this.height=this.image.height),this.image.src.indexOf("data:image")>-1){this._srcType=Qi;var t=this.image.src.split(",");this._imageType=t[0].match(/:(.*?);/)[1]}else{this._srcType=qi;var e=this.image.src.lastIndexOf(".");this._imageType=this.image.src.substring(e)}null!=this._onImageLoaded&&this._onImageLoaded(),this.update()}},{key:"doPaint_",value:function(t){this.loaded&&t.drawImage(0,0,this.image)}},{key:"doPaintBackground_",value:function(t){}},{key:"saveToStream",value:function(t){var e;switch(t.writeByte(this._srcType),this._srcType){case qi:e=A.getBytes(this.image.src);break;case Qi:var i=this.image.src.split(",");e=b.fromBase64(i[1]);break;default:return}t.writeUInt32(e.length),t.writeBuffer(e)}},{key:"loadFromStream",value:function(t){if(this._srcType=t.readByte(),this._srcType!=Zi){var e=t.readUInt32();if(e>0){var i=t.readBuffer(e);switch(this._srcType){case qi:this.image.src=i.toText();break;case Qi:this.image.src="data:image/png;base64,"+i.toBase64();break;default:return}}}}},{key:"src",get:function(){return this.image.src},set:function(t){this.image.src=t}},{key:"srcType",get:function(){return this._srcType}},{key:"imageType",get:function(){return this._imageType}},{key:"onImageLoaded",get:function(){return this._onImageLoaded},set:function(t){this._onImageLoaded=t}}],[{key:"Create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=new i;return n.width=t,n.height=e,n}}]),i}(ni),tn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this)).text_=null!=t?t:"",n.font=new mt,n.font.onChange=function(){n.doFontChange()},n.borderVisible_=!1,n.borderWidth_=1,n._horiAlign=Fe,n._vertAlign=Ce,n._autoWidth=!1,n._autoHeight=!1,n.width_=75,n.height_=20,n._onChange=null,n}return Vi(i,[{key:"doSetPaddingLeft_",value:function(t){this.paddingLeft!=t&&(Hi(Yi(i.prototype),"doSetPaddingLeft_",this).call(this,t),this._autoWidth&&this.doSetAutoWidth_())}},{key:"doSetPaddingTop_",value:function(t){this.paddingTop!=t&&(Hi(Yi(i.prototype),"doSetPaddingTop_",this).call(this,t),this._autoHeight&&this.doSetAutoHeight_())}},{key:"doSetPaddingRight_",value:function(t){this.paddingRight!=t&&(Hi(Yi(i.prototype),"doSetPaddingRight_",this).call(this,t),this._autoWidth&&this.doSetAutoWidth_())}},{key:"doSetPaddingBottom_",value:function(t){this.paddingBottom!=t&&(Hi(Yi(i.prototype),"doSetPaddingBottom_",this).call(this,t),this._autoHeight&&this.doSetAutoHeight_())}},{key:"doCalcWidth_",value:function(){return this.paddingLeft+this.paddingRight+Dt.textWidth(this.font,this.text)}},{key:"doSetAutoWidth_",value:function(){var t=this.doCalcWidth_();this.width!=t&&(this.width=t)}},{key:"doCalcHeight_",value:function(){return this.paddingTop+this.paddingBottom+this.font.height}},{key:"doSetAutoHeight_",value:function(){var t=this.doCalcHeight_();this.height!=t&&(this.height=t)}},{key:"reCalcSize_",value:function(){this.beginUpdate();try{this._autoWidth&&this.doSetAutoWidth_(),this._autoHeight&&this.doSetAutoHeight_()}finally{this.endUpdate()}}},{key:"doFontChange",value:function(){this.reCalcSize_()}},{key:"doChange_",value:function(){this.reCalcSize_(),null!=this._onChange&&this._onChange()}},{key:"doPaintText_",value:function(t,e,i){t.textOut(e,i,this.text_)}},{key:"doPaint_",value:function(t){if(this.text_.length>0){t.font.assign(this.font),this.enabled||(t.font.color=or.theme.textDisableColor);var e=0;switch(this._vertAlign){case we:e=this.height-this.paddingBottom;break;case Ce:e=Math.max(0,(this.height-this.font.height)/2);break;default:e=this.paddingTop}var i=0,n=Dt.textWidth(this.font,this.text_);switch(this._horiAlign){case Ie:i=this.width-n-this.paddingRight;break;case ge:i=this.paddingLeft+Math.max(0,(this.width-this.paddingLeft-this.paddingRight-n)/2);break;default:i=this.paddingLeft}this.doPaintText_(t,i,e)}}},{key:"doSetBorderVisible_",value:function(){this.update()}},{key:"getText_",value:function(){return this.text_}},{key:"setText_",value:function(t){this.text_!=t&&(this.text_=t.toString(),this.doSetText_())}},{key:"doSetText_",value:function(){this.doChange_()}},{key:"textArea",value:function(){return U.Create(this.paddingLeft+(this.borderVisible_?this.borderWidth_:0),this.paddingTop+(this.borderVisible_?this.borderWidth_:0),this.width-(this.borderVisible_?this.borderWidth_:0)-this.paddingRight,this.height-(this.borderVisible_?this.borderWidth_:0)-this.paddingBottom)}},{key:"clear",value:function(){this.text=""}},{key:"autoWidth",get:function(){return this._autoWidth},set:function(t){this._autoWidth!=t&&(this._autoWidth=t,t&&this.doSetAutoWidth_())}},{key:"autoHeight",get:function(){return this._autoHeight},set:function(t){this._autoHeight!=t&&(this._autoHeight=t,t&&this.doSetAutoHeight_())}},{key:"autoSize",get:function(){return this._autoWidth&&this._autoHeight},set:function(t){this.autoWidth=t,this.autoHeight=t}},{key:"text",get:function(){return this.getText_()},set:function(t){this.setText_(t)}},{key:"borderVisible",get:function(){return this.borderVisible_},set:function(t){this.borderVisible_!=t&&(this.borderVisible_=t,this.doSetBorderVisible_())}},{key:"onChange",get:function(){return this._onChange},set:function(t){this._onChange=t}}]),i}(ni),en=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t))._vertAlign=Ce,n.transparent=!0,n.autoWidth=!0,n.autoHeight=!0,n}return i}(tn),nn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t))._horiAlign=ge,n._vertAlign=Ce,n._paddingLeft=5,n._paddingTop=5,n._paddingRight=5,n._paddingBottom=5,n.textVisible_=!0,n.canFocus=!0,n.width=75,n}return Vi(i,[{key:"doMouseEnter_",value:function(){Hi(Yi(i.prototype),"doMouseEnter_",this).call(this),this.update()}},{key:"doMouseLeave_",value:function(){Hi(Yi(i.prototype),"doMouseLeave_",this).call(this),this.update()}},{key:"doMouseDown_",value:function(t){Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t),this.update()}},{key:"doMouseUp_",value:function(t){Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t),this.update()}},{key:"doSetAutoWidth_",value:function(){this.textVisible_?Hi(Yi(i.prototype),"doSetAutoWidth_",this).call(this):this.width=this.paddingLeft+this.paddingRight,this.width<or.theme.iconWidth&&(this.width=or.theme.iconWidth)}},{key:"doPaintStaticBackground_",value:function(t){t.brush.color=or.theme.backgroundLightColor,t.fillBounds(0,0,this.width,this.height)}},{key:"doPaintHotBackground_",value:function(t){this.mouseStates.has(qt)?t.brush.color=or.theme.backgroundDownColor:t.brush.color=or.theme.backgroundHotColor,t.fillBounds(0,0,this.width,this.height)}},{key:"doPaintBackground_",value:function(t){this.mouseStates.has(Zt)?this.doPaintHotBackground_(t):this.doPaintStaticBackground_(t),Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t)}},{key:"doPaint_",value:function(t){this.textVisible_&&Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}},{key:"setTextVisible_",value:function(t){this.textVisible_!=t&&(this.textVisible_=t)}},{key:"textVisible",get:function(){return this.textVisible_},set:function(t){this.setTextVisible_(t),this.doSetAutoWidth_()}}]),i}(tn),on=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t)).image=$i.Create(16,16),n.image.left=2,n.image.onImageLoaded=function(){n.doImageLoaded_()},n}return Vi(i,[{key:"doImageLoaded_",value:function(){this.paddingLeft=this.image.width+4,this.autoWidth&&this.doSetAutoWidth_(),this.updateRect(this.image.bounds())}},{key:"doPaintStaticBackground_",value:function(t){}},{key:"doPaint_",value:function(t){if(""!=this.image.src){this.image.top=Math.trunc((this.height-this.image.height)/2),this.image.paintTo(t,this.image.left,this.image.top),t.save();try{Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}finally{t.restore()}}else Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}},{key:"setTextVisible_",value:function(t){this.textVisible_!=t&&(this.textVisible_=t,this._paddingRight=t?5:0)}}]),i}(nn),rn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t)).dropDownMenu=null,n._paddingRight=or.theme.dropDownButtonSize,n}return Vi(i,[{key:"doClick_",value:function(){null!=this.dropDownMenu&&(this.dropDownMenu.dropDownStyle=!0,this.dropDownMenu.popupControl(this)),Hi(Yi(i.prototype),"doClick_",this).call(this)}},{key:"doPaintBackground_",value:function(t){Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t),or.theme.drawDropDown(t,U.CreateByBounds(this.width-or.theme.dropDownButtonSize,0,or.theme.dropDownButtonSize,this.height))}},{key:"setTextVisible_",value:function(t){this.textVisible_!=t&&(this.textVisible_=t,this._paddingRight=t?or.theme.dropDownButtonSize:0)}}]),i}(on),sn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t)).canFocus=!1,n._checked=!1,n.textVisible_=!1,n._paddingRight=0,n.align=Wt,n.autoWidth=!0,n.group=0,n.onCheckChange=null,n}return Vi(i,[{key:"doPaintBackground_",value:function(t){this._checked?(t.brush.color=or.theme.backgroundDownColor,t.fillBounds(0,0,this.width,this.height)):Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t)}},{key:"checked",get:function(){return this._checked},set:function(t){this._checked!=t&&(this._checked=t,this.update(),this._checked&&null!=this.onCheckChange&&this.onCheckChange(this))}}]),i}(on),an=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t)).canFocus=!1,n._checked=!1,n.textVisible_=!1,n.align=Wt,n.autoWidth=!0,n}return i}(rn),ln=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).width=3,t.align=Wt,t}return Vi(i,[{key:"doPaintBackground_",value:function(t){t.pen.width=1,t.pen.color=or.theme.borderColor,t.beginPath(),t.drawLine((this.width-t.pen.width)/2,2,(this.width-t.pen.width)/2,this.height-2),t.paintPath()}}]),i}(ni),hn=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).width_=200,t.height_=200,t.borderVisible_=!0,t}return Vi(i,[{key:"doPaintBorder_",value:function(t){this.borderVisible_&&(t.pen.color=or.theme.borderColor,t.pen.width=or.theme.borderWidth,t.rectangleBounds(0,0,this.width,this.height))}},{key:"doPaint_",value:function(t){Hi(Yi(i.prototype),"doPaint_",this).call(this,t),this.doPaintBorder_(t)}},{key:"borderVisible",get:function(){return this.borderVisible_},set:function(t){this.borderVisible_!=t&&(this.borderVisible_=t,this.update())}}]),i}(gi),cn=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this))._x=0,t._y=0,t.captureParent=!0,t}return Vi(i,[{key:"doMouseDown_",value:function(t){Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t),this._x=t.x,this._y=t.y,t.button==ee&&this.captureParent&&null===this.getControlAt(t.x,t.y,!1)?(or.application.setCapture(this),this.captured=!0):this.captured=!1}},{key:"doMouseMove_",value:function(t){if(Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t),this.captured&&this.captureParent){var e=this.parent,n=this.parent.bounds(),o=n.offset(t.x-this._x,t.y-this._y,!0);(o=o.union(n)).offset(-1,-1),e.left+=t.x-this._x,e.top+=t.y-this._y,or.application.updateRect(o)}}},{key:"doMouseUp_",value:function(t){Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t),this.captured&&(or.application.releaseCapture(),this.captured=!1)}}]),i}(function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).height=22,t}return Vi(i,[{key:"doAlign_",value:function(){for(var t=this.paddingLeft,e=this.width-this.paddingRight,i=null,n=0;n<this.controls.count;n++)(i=this.controls[n]).visible&&(i.align==Wt?(i.left=t+i.marginLeft,i.top=this.paddingTop+i.marginTop,i.height=this.height-this.paddingTop-this.paddingBottom-i.marginTop-i.marginBottom,t=i.left+i.width+i.marginRight):(e=e-i.marginRight-i.width,i.left=e,i.top=this.paddingTop+i.marginTop,i.height=this.height-this.paddingTop-this.paddingBottom-i.marginTop-i.marginBottom,e-=i.marginLeft));this.update()}},{key:"addButton",value:function(t){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=new sn(t);return o.textVisible=i,o.onCheckChange=function(t){if(t.checked&&t.group>0)for(var i=0;i<e.controls.count;i++)e.controls[i]!=t&&e.controls[i].group==t.group&&(e.controls[i].checked=!1)},""!=n&&(o.image.src=n),this.addControl(o),o}},{key:"addSpliter",value:function(){var t=new ln;this.addControl(t)}}]),i}(gi)),un=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t))._checked=!1,n._downInCheck=!1,n._checkByText=!0,n._state=Si,n.useCheckState=!1,n.paddingLeft=2+or.theme.iconSize,n.onSwitch=null,n}return Vi(i,[{key:"_getBoxRect",value:function(){return U.CreateByBounds(2,Math.trunc((this.height-or.theme.iconSize)/2)+1,or.theme.iconSize-2,or.theme.iconSize-2)}},{key:"doCalcWidth_",value:function(){return Hi(Yi(i.prototype),"doCalcWidth_",this).call(this)}},{key:"doSetBounds_",value:function(){this.height_<or.theme.iconSize&&(this.height_=or.theme.iconSize),Hi(Yi(i.prototype),"doSetBounds_",this).call(this)}},{key:"doMouseEnter_",value:function(){Hi(Yi(i.prototype),"doMouseEnter_",this).call(this),this.updateRect(this._getBoxRect())}},{key:"doMouseLeave_",value:function(){Hi(Yi(i.prototype),"doMouseLeave_",this).call(this),this.updateRect(this._getBoxRect())}},{key:"doMouseDown_",value:function(t){var e=this._getBoxRect();t.y<e.top||t.y>e.bottom||(this._checkByText?this._downInCheck=!0:this._downInCheck=e.pointInAt(t.x,t.y),Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t))}},{key:"doMouseUp_",value:function(t){var e=this._getBoxRect();t.y<e.top||t.y>e.bottom||(this._downInCheck&&(this._checkByText||e.pointInAt(t.x,t.y))&&(this.useCheckState?this._state==yi?this.state=pi:this._state==pi?this.state=Si:this.state=yi:this.checked=!this._checked,null!=this.onSwitch&&this.onSwitch()),Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t))}},{key:"doPaint_",value:function(t){this.mouseIn?t.pen.color=or.theme.borderHotColor:t.pen.color=or.theme.borderColor;var e=this._getBoxRect();this._state==yi?or.theme.drawFrameControl(t,e,new Set([yi]),Ii):this._state==pi?or.theme.drawFrameControl(t,e,new Set([pi]),Ii):this._state==Si&&or.theme.drawFrameControl(t,e,new Set([]),Ii),Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}},{key:"checked",get:function(){return this._checked},set:function(t){this._checked!=t&&(this._checked=t,this._state=t?yi:Si,this.updateRect(this._getBoxRect()))}},{key:"state",get:function(){return this._state},set:function(t){this._state!=t&&(this._state=t,this._checked=t==yi,this.updateRect(this._getBoxRect()))}}]),i}(en),fn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;Ji(this,i),(n=e.call(this,t))._readOnly=!1,n.cursor_=ue,n.imeMode=Ei,n.popupMenuEnable=!0,n.popupMenu=new _n,n._copyMenuItem=n.popupMenu.addItem("复制"),n._copyMenuItem.onClick=function(){n.doCopy_()},n._copyToBrowerMenuItem=n.popupMenu.addItem("复制到浏览器"),n._copyToBrowerMenuItem.onClick=function(){n.doCopyToBrower_()},n._cutMenuItem=n.popupMenu.addItem("剪切"),n._cutMenuItem.onClick=function(){n.doCut_()},n._pasteMenuItem=n.popupMenu.addItem("粘贴"),n._pasteMenuItem.onClick=function(){n.doPaste_()},n.popupMenu.addSpliter();var o=n.popupMenu.addItem("删除");o.addItem("全部删除");var r=o.addItem("增量删除");return r.addItem("1111111"),r.addItem("2222222"),r.addItem("3333333"),(r=o.addItem("删除选中")).addItem("aaaa"),r.addItem("bbbb"),r.addItem("cccc"),n}return Vi(i,[{key:"removed_",value:function(){Hi(Yi(i.prototype),"removed_",this).call(this),or.ime.removeControl(this)}},{key:"doContextMenu_",value:function(t,e){this.popupMenuEnable&&(this._copyMenuItem.enabled=this.canCopy_(),this._cutMenuItem.enabled=this.canCut_(),this._pasteMenuItem.enabled=this.canPaste_(),Hi(Yi(i.prototype),"doContextMenu_",this).call(this,t,e))}},{key:"doCheckImeMode_",value:function(){this._readOnly||this.imeMode!=Ei&&or.ime.setControl(this)}},{key:"doMouseDown_",value:function(t){Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t),this.doCheckImeMode_()}},{key:"doMouseUp_",value:function(t){!this._readOnly&&this.mouseStates.has(qt)&&this.imeMode!=Ei&&or.ime.setControl(this),Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}},{key:"doSetReadOnly_",value:function(){}},{key:"doCopy_",value:function(){}},{key:"doCopyToBrower_",value:function(){}},{key:"doCut_",value:function(){}},{key:"doPaste_",value:function(){}},{key:"canCopy_",value:function(){return!1}},{key:"canCut_",value:function(){return!1}},{key:"canPaste_",value:function(){return!1}},{key:"imeActive",value:function(){}},{key:"insertText",value:function(t,e){this.text=C.stringInsert(this.text,t,e)}},{key:"deleteText",value:function(t,e){this.text=C.stringDelete(this.text,t,e)}},{key:"imeInput",value:function(t){}},{key:"readOnly",get:function(){return this._readOnly},set:function(t){this._readOnly!=t&&(this._readOnly=t,this.doSetReadOnly_())}}]),i}(tn),dn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t)).canFocus=!0,n.borderVisible_=!0,n._vertAlign=Ce,n._selStart=-1,n._selEnd=-1,n._selMove=-1,n._leftOffset=0,n._marginLeft=2,n._marginTop=2,n._marginRight=2,n._marginBottom=2,n._paddingLeft=2,n._paddingTop=2,n._paddingRight=2,n._paddingBottom=2,n._textPrompt="",n.imeMode=Mi,n}return Vi(i,[{key:"_selectActionLeft",value:function(){this.selectExists()?(this._selMove==this._selStart&&this._selStart>0?(this._selStart--,this._selMove=this._selStart):this._selMove==this._selEnd&&this._selEnd<=this.text.length&&(this._selEnd--,this._selEnd==this._selStart?(this._selEnd=-1,this._selMove=this._selStart):this._selMove=this._selEnd),this.scrollAdjust_(this._selMove),this.resetSelect_()):this._selStart>0&&(this._selEnd=this._selStart,this._selStart--,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.resetSelect_())}},{key:"_selectActionRight",value:function(){this.selectExists()?(this._selMove==this._selStart&&this._selStart<this.text.length?(this._selStart++,this._selStart==this._selEnd&&(this._selEnd=-1),this._selMove=this._selStart):this._selMove==this._selEnd&&this._selEnd<this.text.length&&(this._selEnd++,this._selMove=this._selEnd),this.scrollAdjust_(this._selMove),this.resetSelect_()):this._selStart<this.text.length&&(this._selEnd=this._selStart+1,this._selMove=this._selEnd,this.scrollAdjust_(this._selMove),this.resetSelect_())}},{key:"_createCaret",value:function(){or.application.createCaret(this,null,0,this.font.height+1)}},{key:"_destroyCaret",value:function(){or.application.destroyCaret(this)}},{key:"getCharOffsetAt_",value:function(t,e){var i=t-(this.borderVisible_?this.borderWidth_:0)-this.paddingLeft+this._leftOffset;if(this.text.length>0){for(var n=Dt.getTextExtent(this.font,this.text),o=0,r=0;r<n.length;r++)if((o+=n[r])>=i)return Math.trunc(o-n[r]/2)>i?r:r+1;if(i>o)return this.text.length}return 0}},{key:"getCharLeft_",value:function(t){var e=0;if(t>0)for(var i=Dt.getTextExtent(this.font,this.text,t),n=0;n<t;n++)e+=i[n];return e+(this.borderVisible_?this.borderWidth_:0)+this.paddingLeft-this._leftOffset}},{key:"getCharTop_",value:function(){switch(this._vertAlign){case we:return this.height-this.paddingBottom-(this.borderVisible_?this.borderWidth_:0);case Ce:return this.paddingTop+(this.borderVisible_?this.borderWidth_:0)+Math.max(0,(this.height-this.paddingTop-this.paddingBottom-(this.borderVisible_?this.borderWidth_+this.borderWidth_:0)-this.font.height)/2);default:return this.paddingTop+(this.borderVisible_?this.borderWidth_:0)}}},{key:"resetSelect_",value:function(){this.selectExists()?this.hideCaret_():this._selStart>=0&&this.showCaret_(),this.update()}},{key:"scrollAdjust_",value:function(t){var e=this.textArea(),i=Dt.textWidth(this.font,this.text);if(i<e.width)this._leftOffset=0;else if(i-this._leftOffset<e.width)this._leftOffset=i-e.width;else{var n=this.text.substring(0,t),o=Dt.textWidth(this.font,n)+e.left-this._leftOffset;o>e.right?this._leftOffset+=o-e.right:o<e.left&&(this._leftOffset-=e.left-o)}}},{key:"doPaintBorder_",value:function(t,e){t.pen.width=this.borderWidth_,t.pen.style=pt.Solid,this._readOnly?t.pen.color=or.theme.borderColor:this.focused?t.pen.color=or.theme.borderActiveColor:this.mouseIn?t.pen.color=or.theme.borderHotColor:t.pen.color=or.theme.borderColor,t.rectangleRect(e)}},{key:"doPaintSelected_",value:function(t){t.brush.color=or.theme.backgroundSelectColor;var e=this.getCharLeft_(this._selStart),i=this.getCharLeft_(this._selEnd),n=this.textArea();e=Math.max(n.left,Math.min(e,n.right)),i=Math.max(n.left,Math.min(i,n.right)),t.fillBounds(e,n.top,i-e,n.height)}},{key:"showCaret_",value:function(){if(!(this._selStart<0)){var t=this.getCharLeft_(this._selStart)-1;or.ime.updatePosition(t,0),or.application.setCaretPos(t,this.getCharTop_()-1),or.application.showCaret(this)}}},{key:"hideCaret_",value:function(){or.application.hideCaret(this)}},{key:"doCopy_",value:function(){this.copy()}},{key:"doCopyToBrower_",value:function(){this.copyToBrower()}},{key:"doCut_",value:function(){this.cut()}},{key:"doPaste_",value:function(){this.paste()}},{key:"canCopy_",value:function(){return this.selectExists()}},{key:"canCut_",value:function(){return!this.readOnly&&this.selectExists()}},{key:"canPaste_",value:function(){return!this.readOnly}},{key:"doSetBounds_",value:function(){Hi(Yi(i.prototype),"doSetBounds_",this).call(this),this.showCaret_()}},{key:"doBackKeyDown_",value:function(){this.beginUpdate();try{this.selectExists()?this.deleteSelect():this._selStart>0&&(this._selStart--,this.deleteText(this._selStart,1),this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.showCaret_())}finally{this.endUpdate()}}},{key:"doDeleteKeyDown_",value:function(){this.beginUpdate();try{this.selectExists()?this.deleteSelect():this._selStart<this.text.length&&(this.deleteText(this._selStart,1),this.showCaret_())}finally{this.endUpdate()}}},{key:"doLeftKeyDown_",value:function(){this.beginUpdate();try{!this.selectExists()&&this._selStart>0&&this._selStart--,this._selEnd=-1,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.showCaret_()}finally{this.endUpdate()}}},{key:"doRightKeyDown_",value:function(){this.beginUpdate();try{!this.selectExists()&&this._selStart<this.text.length&&this._selStart++,this._selEnd=-1,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.showCaret_()}finally{this.endUpdate()}}},{key:"doHomeKeyDown_",value:function(){this.beginUpdate();try{this._selEnd=-1,this._selStart=0,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.showCaret_()}finally{this.endUpdate()}}},{key:"doEndKeyDown_",value:function(){this.beginUpdate();try{this._selEnd=-1,this._selStart=this.text.length,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.showCaret_()}finally{this.endUpdate()}}},{key:"doMouseEnter_",value:function(){Hi(Yi(i.prototype),"doMouseEnter_",this).call(this),this._readOnly||this.update()}},{key:"doMouseLeave_",value:function(){Hi(Yi(i.prototype),"doMouseLeave_",this).call(this),this._readOnly||this.update()}},{key:"doMouseDown_",value:function(t){Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t),t.button==ee?(this.disSelect(),t.x>0&&t.x<this.width-(this.borderVisible_?this.borderWidth_:0)-this.paddingRight&&(this._selStart=this.getCharOffsetAt_(t.x,t.y),this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.resetSelect_())):this._selStart<0&&(this._selStart=this.getCharOffsetAt_(t.x,t.y),this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.resetSelect_())}},{key:"doMouseMove_",value:function(t){var e=this.textArea();if(t.button===ee){if(t.x<0)this._leftOffset=Math.max(0,this._leftOffset-this.font.advCharWidth);else if(t.x>0){var n=Dt.textWidth(this.font,this.text_);t.x>e.right&&(this._leftOffset=Math.max(0,Math.min(n-e.width,this._leftOffset+this.font.advCharWidth)))}this._selEnd=this.getCharOffsetAt_(t.x,t.y),this._selMove=this._selEnd,this.selectExists()||this._selEnd>=0&&(this._selEnd=-1,this._selMove=this._selStart),this.scrollAdjust_(this._selMove),this.resetSelect_()}e.pointInAt(t.x,t.y)?this.cursor=ue:this.cursor=oe,Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t)}},{key:"doMouseUp_",value:function(t){if(t.button==ee&&this._selEnd>=0&&this._selEnd<this._selStart){var e=this._selStart;this._selStart=this._selEnd,this._selEnd=e}Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}},{key:"doKeyDown_",value:function(t){if(!this.readOnly)switch(t.keyCode){case Pe:this.doBackKeyDown_();break;case Ge:this.doDeleteKeyDown_();break;case Be:C.setCompare(t.shiftState,new Set([Qt]))?this._selectActionLeft():this.doLeftKeyDown_();break;case Me:C.setCompare(t.shiftState,new Set([Qt]))?this._selectActionRight():this.doRightKeyDown_();break;case Ne:this.doHomeKeyDown_();break;case Oe:this.doEndKeyDown_();break;case He:C.setCompare(t.shiftState,new Set([te]))&&this.selectAll();break;case Ue:C.setCompare(t.shiftState,new Set([te]))&&this.copy();break;case We:C.setCompare(t.shiftState,new Set([te]))&&this.cut();break;default:Hi(Yi(i.prototype),"doKeyDown_",this).call(this,t)}}},{key:"doKeyPress_",value:function(t){this.insertText(this._selStart,t.key),Hi(Yi(i.prototype),"doKeyPress_",this).call(this,t)}},{key:"doKeyUp_",value:function(t){t.keyCode==De?or.keyDownStates[Re]?this.parent.tabPrev(this):this.parent.tabNext(this):Hi(Yi(i.prototype),"doKeyUp_",this).call(this,t)}},{key:"doSetFocus_",value:function(t){Hi(Yi(i.prototype),"doSetFocus_",this).call(this,t),t&&(this.doCheckImeMode_(),this._createCaret(),this._selStart=0,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.resetSelect_())}},{key:"doKillFocus_",value:function(){this.disSelect(),this._selStart=-1,this._selMove=-1,this._leftOffset=0,Hi(Yi(i.prototype),"doKillFocus_",this).call(this)}},{key:"doDblClick_",value:function(t){this.selectAll(),Hi(Yi(i.prototype),"doDblClick_",this).call(this,t)}},{key:"doPaintBackground_",value:function(t){var e=this.clientRect();e.left=this.paddingLeft,t.brush.color=or.theme.backgroundContentColor,t.fillRect(e),this.selectExists()&&this.doPaintSelected_(t),this.borderVisible_&&(e.left-=this.borderWidth_,this.doPaintBorder_(t,e)),e=this.textArea(),this._leftOffset>0&&(t.brush.color=this.font.color,t.fillBounds(e.left-1,e.top+1,1,e.height-2)),Dt.textWidth(this.font,this.text_)>this._leftOffset+e.width&&(t.brush.color=this.font.color,t.fillBounds(e.right+1,e.top+1,1,e.height-2))}},{key:"doPaintText_",value:function(t,e,i){""!=this.text_&&t.textOut(e-this._leftOffset,i,this.text_)}},{key:"doPaint_",value:function(t){t.save();try{var e=this.textArea();t.clipRect(e),""!=this.text?Hi(Yi(i.prototype),"doPaint_",this).call(this,t):""!=this._textPrompt&&(t.font.styles.value=ht.Italic,t.font.color=at.Gray,t.textOut(this.getCharLeft_(0),this.getCharTop_(),this._textPrompt))}finally{t.restore()}}},{key:"doSetText_",value:function(){this.disSelect(),this._selStart>this.text.length&&(this._selStart=this.text.length),Hi(Yi(i.prototype),"doSetText_",this).call(this)}},{key:"doInsertText",value:function(t,e){Hi(Yi(i.prototype),"insertText",this).call(this,t,e),this._selStart>=0&&(this._selStart+=e.length,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.showCaret_())}},{key:"dispose",value:function(){this._destroyCaret()}},{key:"insertText",value:function(t,e){this.beginUpdate();try{this.selectExists()&&this.deleteSelect(),this.doInsertText(t,e)}finally{this.endUpdate()}}},{key:"copy",value:function(){or.clipboard.clear(),this.selectExists()&&or.clipboard.setText(this.selectText())}},{key:"copyToBrower",value:function(){this.selectExists()&&or.clipboard.toBrowerClipboard(this.selectText())}},{key:"cut",value:function(){this.copy(),this.deleteSelect()}},{key:"paste",value:function(){var t=or.localStorage.getString(g);null!=t&&this.insertText(this._selStart,t)}},{key:"deleteSelect",value:function(){this.beginUpdate();try{this.deleteText(this._selStart,this.selLength),this._selEnd=-1,this._selMove=this._selStart,this.scrollAdjust_(this._selMove),this.showCaret_()}finally{this.endUpdate()}}},{key:"disSelect",value:function(){this._selMove=this._selStart,this.selectExists()&&(this._selEnd=-1,this.resetSelect_())}},{key:"select",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t<0||(this._selStart=t,e>0?(this._selEnd=t+e,this._selMove=this._selEnd):(this._selEnd=-1,this._selMove=this._selStart),this.scrollAdjust_(this._selMove),this.resetSelect_())}},{key:"selectAll",value:function(){this.select(0,this.text.length)}},{key:"selectText",value:function(){return this._selEnd>=0?this.text.substring(this._selStart,this._selEnd):""}},{key:"selectExists",value:function(){return this._selEnd>=0&&this._selEnd!=this._selStart}},{key:"imeInput",value:function(t){this.readOnly||this.insertText(this._selStart,t)}},{key:"tabSetFocus",value:function(){Hi(Yi(i.prototype),"tabSetFocus",this).call(this),this.selectAll()}},{key:"selStart",get:function(){return this.selectExists()&&this._selEnd<this._selStart?this._selEnd:this._selStart}},{key:"selLength",get:function(){return this._selEnd<0?0:Math.abs(this._selEnd-this._selStart)}},{key:"textPrompt",get:function(){return this._textPrompt},set:function(t){this._textPrompt!=t&&(this._textPrompt=t,this.update())}},{key:"number",get:function(){return parseInt(this.text)}}]),i}(fn),mn=0,yn=1,pn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),n=e.call(this,t),t||(n.text_="0"),n.valueMask_=mn,n.min=NaN,n.max=NaN,n.length,n}return Vi(i,[{key:"doInsertText",value:function(t,e){var n=C.stringInsert(this.text,t,e);switch(this.valueMask_){case mn:if(!/^-?\d+$/.test(n))return;break;case yn:if(!/^(-?\d+)(\.\d+)?$/.test(n)&&!/^(-?\d+)(\.)?$/.test(n))return}Hi(Yi(i.prototype),"doInsertText",this).call(this,t,e)}},{key:"doKeyDown_",value:function(t){if(t.keyCode==Ee){var e=or.system.tryParseInt(this.text);e.ok&&(this.text=(e.value+1).toString())}else if(t.keyCode==Le){var n=or.system.tryParseInt(this.text);n.ok&&(this.text=(n.value-1).toString())}else Hi(Yi(i.prototype),"doKeyDown_",this).call(this,t)}},{key:"getNumber",value:function(t){switch(this.valueMask_){case yn:return parseFloat(t);default:return parseInt(t)}}},{key:"setText_",value:function(t){!isNaN(this.min)&&this.getNumber(t)<this.min||!isNaN(this.max)&&this.getNumber(t)>this.max||Hi(Yi(i.prototype),"setText_",this).call(this,t)}},{key:"number",get:function(){return this.getNumber(this.text)}},{key:"valueMask",get:function(){return this.valueMask_},set:function(t){this.valueMask_=t}}]),i}(dn),Sn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t))._paddingRight=10,n.FIncrement=1,n.btnUpRect=new U,n.btnDownRect=new U,n.calcButtonRect_(),n}return Vi(i,[{key:"calcButtonRect_",value:function(){this.btnUpRect.reset(this.width-this._paddingRight+1,this.borderWidth_,this.width-this.borderWidth_,this.height/2-this.borderWidth_),this.btnDownRect.reset(this.btnUpRect.left,this.height/2-this.borderWidth_,this.btnUpRect.right,this.height-this.borderWidth_)}},{key:"doPaintBackground_",value:function(t){Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t),t.brush.color=or.theme.backgroundHotColor,t.fillRect(this.btnUpRect),t.fillRect(this.btnDownRect),or.theme.drawDropUp(t,this.btnUpRect),or.theme.drawDropDown(t,this.btnDownRect)}},{key:"doUpButtonClick_",value:function(){this.onUpButtonClick?this.onUpButtonClick():this.text=this.number+this.FIncrement,this.doChange_()}},{key:"doDownButtonClick_",value:function(){this.onDownButtonClick?this.onDownButtonClick():this.text=this.number-this.FIncrement,this.doChange_()}},{key:"doMouseUp_",value:function(t){this.readOnly?Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t):this.btnUpRect.pointInAt(t.x,t.y)?this.doUpButtonClick_():this.btnDownRect.pointInAt(t.x,t.y)?this.doDownButtonClick_():Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}},{key:"doResize_",value:function(){Hi(Yi(i.prototype),"doResize_",this).call(this),this.calcButtonRect_()}}]),i}(pn),vn=function(t){Wi(i,t);var e=ji(i);function i(t,n){var o;return Ji(this,i),(o=e.call(this,n))._lableText=t,o._paddingLeft=or.theme.marginSpaceDouble+Dt.textWidth(o.font,o._lableText),o.width_=Dt.textWidth(Dt.DefaultFont,t)+75,o}return Vi(i,[{key:"doPaintBackground_",value:function(t){t.font.assign(Dt.DefaultFont),t.textOut(or.theme.marginSpace,this.getCharTop_(),this._lableText),Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t)}},{key:"lableText",get:function(){return this._lableText},set:function(t){this._lableText=t}}]),i}(dn),Fn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t)).image=new Image(or.theme.iconSize,or.theme.iconSize),n.image.onload=function(t){n._updateButtonRect()},n._paddingRight=or.theme.iconSize,n._buttonMouseIn=!1,n._buttonDown=!1,n._buttonRect=new U,n.calcButtonRect_(),n}return Vi(i,[{key:"doButtonClick_",value:function(){this.onButtonClick&&this.onButtonClick()}},{key:"_updateButtonRect",value:function(){this.updateRect(this._buttonRect)}},{key:"calcButtonRect_",value:function(){this._buttonRect.reset(this.width-this._paddingRight+1,this.borderWidth_,this.width-this.borderWidth_,this.height-this.borderWidth_)}},{key:"doPaintBackground_",value:function(t){Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t),this._buttonMouseIn&&(this._buttonDown?t.brush.color=or.theme.backgroundDownColor:t.brush.color=or.theme.backgroundHotColor,t.fillRect(this._buttonRect)),this.image.loaded?t.drawImage(this._buttonRect.left,this._buttonRect.top,this.image):or.theme.drawDropDown(t,this._buttonRect)}},{key:"doMouseEnter_",value:function(){Hi(Yi(i.prototype),"doMouseEnter_",this).call(this),this.cursor=ue}},{key:"doMouseLeave_",value:function(){this._buttonMouseIn=!1,this._buttonDown=!1,Hi(Yi(i.prototype),"doMouseLeave_",this).call(this)}},{key:"doMouseDown_",value:function(t){this._buttonRect.pointInAt(t.x,t.y)?(this.hideCaret_(),this._buttonDown=!0,this._updateButtonRect(),this.focused||Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t)):(this._buttonDown=!1,Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t))}},{key:"doMouseMove_",value:function(t){this._buttonRect.pointInAt(t.x,t.y)?this._buttonMouseIn||(this._buttonMouseIn=!0,this._updateButtonRect(),this.cursor=oe):this._buttonMouseIn&&(this._buttonMouseIn=!1,this._updateButtonRect(),this.cursor=ue),this._buttonDown||Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t)}},{key:"doMouseUp_",value:function(t){this._buttonDown?(this._buttonDown=!1,this._updateButtonRect(),this._buttonRect.pointInAt(t.x,t.y)&&!this.readOnly&&this.doButtonClick_()):Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}},{key:"doDblClick_",value:function(t){this._buttonRect.pointInAt(t.x,t.y)||Hi(Yi(i.prototype),"doDblClick_",this).call(this,t)}},{key:"doResize_",value:function(){Hi(Yi(i.prototype),"doResize_",this).call(this),this.calcButtonRect_()}},{key:"onButtonClick",value:function(){}}]),i}(dn),In=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).text="",t.object=null,t}return Vi(i,null,[{key:"Create",value:function(t,e){var n=new i;return n.text=t,n.object=e,n}}]),i}(L),gn=function(t){Wi(i,t);var e=ji(i);function i(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Ji(this,i),e.call(this,t)}return Vi(i,[{key:"add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Hi(Yi(i.prototype),"add",this).call(this,In.Create(t,e))}},{key:"indexOf",value:function(t){for(var e=0;e<this.count;e++)if(this[e].text==t)return e;return-1}},{key:"indexOfObject",value:function(t){for(var e=0;e<this.count;e++)if(this[e].object===t)return e;return-1}}]),i}(V),wn=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this,"")).height_=100,t._itemIndex=-1,t._hotIndex=-1,t._displayFirst=-1,t._displayLast=-1,t._paddingLeft=2,t._paddingTop=2,t._paddingRight=2,t._paddingBottom=2,t.borderVisible_=!0,t._mouseDownScrollBar=!1,t._scrollBar=new mi,t._scrollBar.width=20,t._scrollBar.orientation=Jt,t._scrollBar.onScroll=function(e,i){t._calcDisplayItem(),t.update()},t._items=new gn,t._items.onAdded=function(e){t._reSetContent()},t._items.onRemoved=function(e){t._itemIndex=-1,t._hotIndex=-1,t._reSetContent()},t._onSelectedIndexChange=null,t}return Vi(i,[{key:"_getTopOffset",value:function(){return this._scrollBar.visible?this._scrollBar.position:0}},{key:"_calcDisplayItem",value:function(){if(this._items.count>0){this._displayFirst=0;for(var t=this.paddingTop-this._getTopOffset()+this.font.height+or.theme.marginSpaceDouble,e=0;e<this._items.count;e++){if(t>0){this._displayFirst=e;break}t=t+this.font.height+or.theme.marginSpaceDouble}this._displayLast=this._items.count-1;for(var i=this._displayFirst;i<this._items.count;i++){if(t>this.height_-this.paddingBottom){this._displayLast=i;break}t=t+this.font.height+or.theme.marginSpaceDouble}}else this._displayFirst=-1,this._displayLast=-1}},{key:"_getItemRect",value:function(t){return U.CreateByBounds(this.paddingLeft,t*(this.font.height+or.theme.marginSpaceDouble)-this._getTopOffset()+this.paddingTop+(this.borderVisible_?this.borderWidth_:0),this.width-this._paddingLeft-this.paddingRight,this.font.height+or.theme.marginSpaceDouble)}},{key:"_getItemIndexAt",value:function(t,e){if(t>0&&t<(this._scrollBar.visible?this._scrollBar.left:this.width))for(var i=-this._getTopOffset(),n=0;n<this._items.count;n++){if(e>i&&e<=i+this.font.height+or.theme.marginSpaceDouble)return n;i+=this.font.height+or.theme.marginSpaceDouble}return-1}},{key:"_getContentHeight",value:function(){return this._items.count*(this.font.height+or.theme.marginSpaceDouble)}},{key:"_setHotIndex",value:function(t){if(t!=this._hotIndex){var e=this._hotIndex;this._hotIndex=t,e>=0&&this.updateRect(this._getItemRect(e)),this._hotIndex>=0&&this.updateRect(this._getItemRect(this._hotIndex))}}},{key:"doSelectedIndexChange_",value:function(){null!=this._onSelectedIndexChange&&this._onSelectedIndexChange()}},{key:"_setItemIndex",value:function(t){if(t!=this._itemIndex){var e=this._itemIndex;if(this._itemIndex=t,e>=0&&this.updateRect(this._getItemRect(e)),this._itemIndex>=0&&this._itemIndex<this._items.count){this.text=this._items[this._itemIndex].text;var i=this._getItemRect(this._itemIndex);i.top<this.paddingTop?this._scrollBar.position-=this.paddingTop-i.top:i.bottom>this.height-this.paddingBottom?this._scrollBar.position+=i.bottom-this.height+this.paddingBottom:this.update()}else this.text="";this.doSelectedIndexChange_()}}},{key:"_reSetContent",value:function(){var t=this._getContentHeight();t>this.height?(this.borderVisible_?(this._scrollBar.height=this.height-this.borderWidth_-this.borderWidth_-1,this._scrollBar.left=this.width-this._scrollBar.width-this._paddingRight-this.borderWidth_+2,this._scrollBar.top=this.borderWidth_+1):(this._scrollBar.height=this.height,this._scrollBar.left=this.width-this._scrollBar.width-this._paddingRight,this._scrollBar.top=0),this._scrollBar.max=t,this._scrollBar.visible=!0):this._scrollBar.visible=!1,this._calcDisplayItem(),this.update()}},{key:"doSetPaddingRight_",value:function(t){Hi(Yi(i.prototype),"doSetPaddingRight_",this).call(this,t)}},{key:"doResize_",value:function(){Hi(Yi(i.prototype),"doResize_",this).call(this),this._reSetContent()}},{key:"doMouseEnter_",value:function(){Hi(Yi(i.prototype),"doMouseEnter_",this).call(this),this.update()}},{key:"doMouseLeave_",value:function(){this._hotIndex=-1,Hi(Yi(i.prototype),"doMouseLeave_",this).call(this),this.update()}},{key:"doMouseWheel_",value:function(t){this._scrollBar.visible&&(t.delta<0?this._scrollBar.position+=20:this._scrollBar.position-=20),Hi(Yi(i.prototype),"doMouseWheel_",this).call(this,t)}},{key:"doMouseDown_",value:function(t){if(this._mouseDownScrollBar=!1,this._scrollBar.visible){var e=this._scrollBar.bounds();if(e.pointInAt(t.x,t.y)){this._mouseDownScrollBar=!0;var n=new ei;return n.assign(t),n.x-=e.left,n.y-=e.top,void this._scrollBar.mouseDown(n)}}this.textArea().pointInAt(t.x,t.y)&&Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t)}},{key:"doMouseMove_",value:function(t){var e=!1;if(this._scrollBar.visible){var n=this._scrollBar.bounds();if(n.pointInAt(t.x,t.y)){e=!0;var o=new ei;o.assign(t),o.x-=n.left,o.y-=n.top,this._scrollBar.mouseMove(o)}else if(this._mouseDownScrollBar){e=!0;var r=new ei;r.assign(t),r.x=n.left,r.y-=n.top,this._scrollBar.mouseMove(r)}}e&&this._hotIndex>=0?this._setHotIndex(-1):(this._mouseDownScrollBar?this._setHotIndex(-1):this._setHotIndex(this._getItemIndexAt(t.x,t.y)),Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t))}},{key:"doMouseUp_",value:function(t){if(this._mouseDownScrollBar){if(this._scrollBar.visible){var e=this._scrollBar.bounds();if(e.pointInAt(t.x,t.y)){var n=new ei;n.assign(t),n.x-=e.left,n.y-=e.top,this._scrollBar.mouseUp(n)}}this._mouseDownScrollBar=!1}else{if(this._scrollBar.visible)if(this._scrollBar.bounds().pointInAt(t.x,t.y))return;t.button==ee&&this.textArea().pointInAt(t.x,t.y)&&(this.itemIndex=this._getItemIndexAt(t.x,t.y)),Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}}},{key:"_doPaintBorder",value:function(t,e){t.pen.width=this.borderWidth_,this._readOnly?t.pen.color=or.theme.borderColor:this.focused?t.pen.color=or.theme.borderActiveColor:this.mouseIn?t.pen.color=or.theme.borderHotColor:t.pen.color=or.theme.borderColor,t.rectangleRect(e)}},{key:"_doPaintSelected",value:function(t){}},{key:"doPaintBackground_",value:function(t){var e=this.clientRect();if(t.brush.color=or.theme.backgroundContentColor,t.fillRect(e),this._itemIndex>=0||this._hotIndex>=0){var i=this.textArea();if(this._itemIndex>=0){var n=this._getItemRect(this._itemIndex);n=i.intersection(n),t.brush.color=or.theme.backgroundSelectColor,t.fillRect(n)}if(this._hotIndex>=0&&this._hotIndex!=this._itemIndex){var o=this._getItemRect(this._hotIndex);o=i.intersection(o),t.brush.color=or.theme.backgroundHotColor,t.fillRect(o)}}this.borderVisible_&&this._doPaintBorder(t,e)}},{key:"doPaintText_",value:function(t,e,i){var n=this.paddingLeft+or.theme.marginSpace+(this.borderVisible_?this.borderWidth_:0);if(!(this._displayLast<0)){t.font.assign(Dt.DefaultFont);for(var o=this._getItemRect(this._displayFirst).top,r=this._displayFirst;r<=this._displayLast;r++)t.textOut(n,o+or.theme.marginSpace,this._items[r].text),o+=this.font.height+or.theme.marginSpaceDouble}}},{key:"doSetBorderVisible_",value:function(){this._reSetContent(),Hi(Yi(i.prototype),"doSetBorderVisible_",this).call(this)}},{key:"doPaint_",value:function(t){var e=this.textArea();t.save();try{t.clipRect(e),this.doPaintText_(t,this.paddingLeft,this.paddingTop)}finally{t.restore()}if(this._scrollBar.visible){e=this.clientRect(),t.save();try{t.clipRect(e),this._scrollBar.paintTo(t,this._scrollBar.left,this._scrollBar.top)}finally{t.restore()}}}},{key:"dispose",value:function(){this._items.clear()}},{key:"textArea",value:function(){var t=Hi(Yi(i.prototype),"textArea",this).call(this);return this._scrollBar.visible&&(t.right=t.right-this._scrollBar.width+2),t}},{key:"addItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._items.add(t,e)}},{key:"deleteItem",value:function(t){t>=0&&t<this._items.count&&this._items.removeAt(t)}},{key:"itemIndexOf",value:function(t){return this._items.indexOf(t)}},{key:"scrollBarVisible",get:function(){return this._scrollBar.visible}},{key:"items",get:function(){return this._items},set:function(t){this._items=t,this._reSetContent()}},{key:"selectItem",get:function(){return this._itemIndex>=0?this._items[this._itemIndex]:null}},{key:"itemIndex",get:function(){return this._itemIndex},set:function(t){this._setItemIndex(t)}},{key:"contentHeight",get:function(){return this._getContentHeight()}},{key:"onSelectedIndexChange",get:function(){return this._onSelectedIndexChange},set:function(t){this._onSelectedIndexChange=t}}]),i}(tn),Cn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t)).popupAlign_=Wt,n.DropDownWidth_=100,n.dropDownCount_=8,n.static_=!1,n.popupDownInTextArea_=!1,n.onSelectedIndexChange_=null,n._listBox=new wn,n._listBox.paddingLeft=0,n._listBox.paddingTop=0,n._listBox.paddingRight=0,n._listBox.paddingBottom=0,n._listBox.onUpdate=function(t){n._listBoxUpdate(t)},n._popupControl=null,n}return Vi(i,[{key:"doKeyDown_",value:function(t){!this.readOnly&&this.items.count>0&&(t.keyCode==Ee&&this.itemIndex>0?this.itemIndex--:t.keyCode==Le&&this.itemIndex<this.items.count-1&&this.itemIndex++),this.static_||Hi(Yi(i.prototype),"doKeyDown_",this).call(this,t)}},{key:"doKeyPress_",value:function(t){this.static_||Hi(Yi(i.prototype),"doKeyPress_",this).call(this,t)}},{key:"insertText",value:function(t,e){this.static_||Hi(Yi(i.prototype),"insertText",this).call(this,t,e)}},{key:"_listBoxUpdate",value:function(t){null!=this._popupControl&&this._popupControl.updateRect(t)}},{key:"_popup",value:function(){var t=this;if(null==this._popupControl){this._listBox.width=this.DropDownWidth_,this._listBox.itemIndex=this._listBox.itemIndexOf(this.text);var e=this.dropDownCount_*(this._listBox.font.height+or.theme.marginSpaceDouble),i=this._listBox.contentHeight;this._listBox.height=i>e?e:i,this._popupControl=new oi,this._popupControl.width=this._listBox.width,this._popupControl.height=this._listBox.height,this._popupControl.dropDownStyle=!0,this._popupControl.onClose=function(){t._popupControl=null},this._popupControl.onDone=function(){t.doSelectedIndexChange_()},this._popupControl.onPaint=function(e){t._listBox.paintTo(e,0,0)},this._popupControl.onMouseEnter=function(){t._listBox.mouseEnter()},this._popupControl.onMouseLeave=function(){t._listBox.mouseLeave()},this._popupControl.onMouseWheel=function(e){t._listBox.mouseWheel(e)},this._popupControl.onMouseDown=function(e){t.popupDownInTextArea_=t._listBox.textArea().pointInAt(e.x,e.y),t._listBox.mouseDown(e)},this._popupControl.onMouseMove=function(e){t._listBox.mouseMove(e)},this._popupControl.onMouseUp=function(e){t._listBox.mouseUp(e),t.popupDownInTextArea_&&t._listBox.textArea().pointInAt(e.x,e.y)&&t.doDonePopup_()}}var n=this.clientToScreen(G.Create(0,0));this.popupAlign_==Wt?n.x+=this.paddingLeft-(this.borderVisible_?this.borderWidth_:0):n.x+=this.width-this._popupControl.width,this._popupControl.popup(n.x,n.y+this.height,!0)}},{key:"doDonePopup_",value:function(){this._popupControl.donePopup()}},{key:"doSelectedIndexChange_",value:function(){this.text=this._listBox.text,null!=this.onSelectedIndexChange_&&this.onSelectedIndexChange_()}},{key:"doButtonClick_",value:function(){this.readOnly||this._popup(),Hi(Yi(i.prototype),"doButtonClick_",this).call(this)}},{key:"addItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this._listBox.addItem(t,e)}},{key:"removeItem",value:function(t){this._listBox.removeItem(t)}},{key:"itemIndexOf",value:function(t){return this._listBox.itemIndexOf(t)}},{key:"dropDownWidth",get:function(){return this.DropDownWidth_},set:function(t){this.DropDownWidth_=t}},{key:"itemIndex",get:function(){return this._listBox.itemIndex},set:function(t){this._listBox.itemIndex=t,this.text=this._listBox.text}},{key:"items",get:function(){return this._listBox.items}},{key:"static",get:function(){return this.static_},set:function(t){this.static_=t}},{key:"onSelectedIndexChange",get:function(){return this.onSelectedIndexChange_},set:function(t){this.onSelectedIndexChange_=t}}]),i}(Fn),kn=function(t){Wi(i,t);var e=ji(i);function i(){var t;Ji(this,i),(t=e.call(this)).FDateTime=X.Now(),t.width_=170,t.height_=185,t.edtHour=new Sn(0),t.edtHour.min=0,t.edtHour.max=23,t.edtHour.left=5,t.edtHour.top=162,t.edtHour.width=28,t.edtHour.onChange=function(){t.doChange_()};var n=new en("时");n.left=34,n.top=166,t.edtMinute=new Sn(0),t.edtMinute.min=0,t.edtMinute.max=59,t.edtMinute.left=48,t.edtMinute.top=162,t.edtMinute.width=28,t.edtMinute.onChange=function(){t.doChange_()};var o=new en("分");o.left=77,o.top=166,t.edtSecond=new Sn(0),t.edtSecond.min=0,t.edtSecond.max=59,t.edtSecond.left=90,t.edtSecond.top=162,t.edtSecond.width=28,t.edtSecond.onChange=function(){t.doChange_()};var r=new en("秒");r.left=118,r.top=166,t.btnDone=new nn("确定"),t.btnDone.left=t.width-38,t.btnDone.top=162,t.btnDone.width=35,t.btnDone.onClick=function(){t.doDone_()},t.beginUpdate();try{t.addControl(t.edtHour),t.addControl(n),t.addControl(t.edtMinute),t.addControl(o),t.addControl(t.edtSecond),t.addControl(r),t.addControl(t.btnDone)}finally{t.endUpdate()}return t._initNewDT(),t}return Vi(i,[{key:"_initNewDT",value:function(){this.newYear_=this.FDateTime.year,this.newMonth_=this.FDateTime.month,this.newDay_=this.FDateTime.day,this.newHour_=this.FDateTime.hour,this.newMinute_=this.FDateTime.minute,this.newSecond_=this.FDateTime.second,this.edtHour.text=this.newHour_.toString(),this.edtMinute.text=this.newMinute_.toString(),this.edtSecond.text=this.newSecond_.toString()}},{key:"doPaint_",value:function(t){t.brush.color=at.White,t.fillBounds(0,0,this.width_,this.height_-25),t.textOut(3,3,"<"),t.textOut(13,3,this.newYear_),t.textOut(45,3,">"),t.textOut(63,3,"<"),t.textOut(72,3,this.newMonth_),t.textOut(89,3,">"),t.textOut(this.width-30,3,"今天"),t.brush.color=at.LightGray,t.fillBounds(0,20,this.width_,20),t.textOut(5,23,"日"),t.textOut(29,23,"一"),t.textOut(53,23,"二"),t.textOut(77,23,"三"),t.textOut(101,23,"四"),t.textOut(125,23,"五"),t.textOut(149,23,"六");for(var e=new X,n=this.newYear_==e.year&&this.newMonth_==e.month,o=new Date(this.newYear_,this.newMonth_,0),r=o.getDate(),s=(o=new Date(this.newYear_,this.newMonth_-1,1)).getDay(),a=24*s+3,l=43,h=1;h<=r;h++)n&&h==e.day&&(t.brush.color=at.Gray,t.fillBounds(a,l,20,20)),h==this.newDay_&&(t.brush.color=or.theme.backgroundSelectColor,t.fillBounds(a,l,20,20)),t.textOut(a+3,l+3,h),7==++s?(s=0,a=3,l+=20):a+=24;Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}},{key:"doMouseUp_",value:function(t){if(t.x>0&&t.x<12&&t.y>0&&t.y<20)this.newYear_--,this.doChange_();else if(t.x>42&&t.x<54&&t.y>0&&t.y<20)this.newYear_++,this.doChange_();else if(t.x>60&&t.x<72&&t.y>0&&t.y<20){this.newMonth_>1?this.newMonth_--:(this.newYear_--,this.newMonth_=12);var e=new Date(this.newYear_,this.newMonth_,0).getDate();this.newDay_>e&&(this.newDay_=e),this.doChange_()}else if(t.x>86&&t.x<98&&t.y>0&&t.y<20){this.newMonth_<12?this.newMonth_++:(this.newYear_++,this.newMonth_=1);var n=new Date(this.newYear_,this.newMonth_,0).getDate();this.newDay_>n&&(this.newDay_=n),this.doChange_()}else if(t.x>this.width_-30&&t.y<20){var o=new X;this.newYear_=o.year,this.newMonth_=o.month,this.newDay_=o.day,this.doChange_()}else for(var r=new Date(this.newYear_,this.newMonth_,0),s=r.getDate(),a=(r=new Date(this.newYear_,this.newMonth_-1,1)).getDay(),l=24*a+3,h=43,c=1;c<=s;c++){if(t.x>l&&t.x<l+20&&t.y>h&&t.y<h+20){this.newDay_=c,this.doChange_();break}7==++a?(a=0,l=3,h+=20):l+=24}Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}},{key:"doDone_",value:function(){null!=this.onDone&&this.onDone()}},{key:"doChange_",value:function(){this.update(),null!=this.onChange&&this.onChange()}},{key:"newHour",get:function(){return this.newHour_},set:function(t){this.newHour_=t,this.edtHour.text=t.toString()}},{key:"newMinute",get:function(){return this.newMinute_},set:function(t){this.newMinute_=t,this.edtMinute.text=t.toString()}},{key:"newSecond",get:function(){return this.newSecond_},set:function(t){this.newSecond_=t,this.edtSecond.text=t.toString()}},{key:"dateTime",set:function(t){t&&(this.FDateTime.initByDateTime(t),this._initNewDT(),this.doChange_())},get:function(){return X.Create(this.newYear_,this.newMonth_,this.newDay_,or.system.parseIntDef(this.edtHour.text,0),or.system.parseIntDef(this.edtMinute.text,0),or.system.parseIntDef(this.edtSecond.text,0))}}]),i}(gi),Pn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t.toString())).FDateTime=t,n.FFormat="yyyy-MM-dd hh:mm:ss",n._popupControl=null,n}return Vi(i,[{key:"_popup",value:function(){var t=this;null==this._popupControl&&(this._popupControl=new wi,this._popupControl.width=170,this._popupControl.height=185,this._popupControl.dropDownStyle=!0,this.monthCalendar=new kn,this.monthCalendar.onDone=function(){t._popupControl.donePopup()},this._popupControl.addControl(this.monthCalendar),this._popupControl.onClose=function(){t._popupControl=null},this._popupControl.onDone=function(){t.FDateTime=X.CreateByDateTime(t.monthCalendar.dateTime),t.text=t.FDateTime.format(t.FFormat)}),this.monthCalendar.dateTime=X.CreateByDateTime(this.FDateTime);var e=this.clientToScreen(G.Create(0,0));e.x+=this.paddingLeft-(this.borderVisible_?this.borderWidth_:0),this._popupControl.popup(e.x,e.y+this.height,!0)}},{key:"setText_",value:function(t){var e=new X;e.fromString(t)&&(this.FDateTime=e,Hi(Yi(i.prototype),"setText_",this).call(this,t))}},{key:"doButtonClick_",value:function(){this.readOnly||this._popup(),Hi(Yi(i.prototype),"doButtonClick_",this).call(this)}},{key:"doKillFocus_",value:function(){this.text=this.FDateTime.format(this.FFormat),Hi(Yi(i.prototype),"doKillFocus_",this).call(this)}},{key:"format",get:function(){return this.FFormat},set:function(t){t!=this.FFormat&&(this.FFormat=t,this.text=this.FDateTime.format(this.FFormat))}},{key:"dateTime",get:function(){return this.FDateTime},set:function(t){t&&(this.FDateTime=t,this.text=this.FDateTime.format(this.FFormat))}}]),i}(Fn),Dn=function(t){Wi(i,t);var e=ji(i);function i(){var t;Ji(this,i),(t=e.call(this)).static_=!0;var n=new ct;return n.detect("宋体")&&t.addItem("宋体"),n.detect("幼圆")&&t.addItem("幼圆"),n.detect("楷体")&&t.addItem("楷体"),n.detect("隶书")&&t.addItem("隶书"),n.detect("黑体")&&t.addItem("黑体"),n.detect("Arial")&&t.addItem("Arial"),n.detect("Tahoma")&&t.addItem("Tahoma"),n.detect("Courier New")&&t.addItem("Courier New"),t.itemIndex=0,t}return i}(Cn),bn=function(t){Wi(i,t);var e=ji(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;return Ji(this,i),(t=e.call(this))._colorBand=50,t.width_=n,t.height_=n+t._colorBand,t._color=at.White,t._iniHotColor(),t._imageData=at.getColorPad(Math.round(n/2)),t._edtR=new dn,t._edtR.hint="颜色的R值",t._edtR.parent=Ki(t),t._edtR.left=20,t._edtR.top=n+5,t._edtR.width=40,t}return Vi(i,[{key:"_iniHotColor",value:function(){var t=at.colorToRGBA(this._color);this._R=t.r,this._G=t.g,this._B=t.b,this._A=t.a}},{key:"_setColor",value:function(t){this._color!=t&&(this._color=t,this._iniHotColor(),this.update())}},{key:"doPaintBackground_",value:function(t){t.brush.color=this.hotColor,t.fillRect(this.clientRect()),t.drawImageData(this._imageData,0,0,this.width,this.height)}},{key:"doPaint_",value:function(t){Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}},{key:"doMouseLeave_",value:function(){Hi(Yi(i.prototype),"doMouseLeave_",this).call(this),this._iniHotColor(),this.update()}},{key:"doMouseMove_",value:function(t){if(Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t),Dt.pointInEllipseBounds(0,0,this.width_,this.width_,t.x,t.y)){var e=4*(this.width_*t.y+t.x);this._R=this._imageData.data[e],this._G=this._imageData.data[e+1],this._B=this._imageData.data[e+2],this._A=this._imageData.data[e+3]}else this._iniHotColor();this.update()}},{key:"doClick_",value:function(){this._color=this.hotColor,Hi(Yi(i.prototype),"doClick_",this).call(this)}},{key:"hotColor",get:function(){return at.rgbaToColor(this._R,this._G,this._B,this._A)}},{key:"color",get:function(){return this._color},set:function(t){this._setColor(t)}}]),i}(gi),Rn=function(t){Wi(i,t);var e=ji(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"rgb(0, 0, 0)";return Ji(this,i),(t=e.call(this,n)).width_=36,t.height_=20,t.canFocus=!1,t.dropDownCount_=16,t.imeMode=Ei,t.dropDownWidth=64,t.addItem(at.Black),t.addItem(at.Red),t.addItem(at.Green),t.addItem(at.Blue),t.addItem(at.Yellow),t.addItem(at.Gray),t.addItem(at.Orange),t.addItem("更多..."),t._listBox.doPaintBackground_=function(e){t._listBoxPaintBackground(e)},t._listBox.doPaintText_=function(e,i,n){t._listBoxPaintText(e,i,n)},setTimeout((function(){t._pad=new bn,t._pad.align=Kt,t._pad.paddingLeft=0,t._pad.paddingTop=0,t._pad.paddingRight=0,t._pad.paddingBottom=0,t._pad.onClick=function(){t._padClick()}}),0),t._popupPadControl=null,t}return Vi(i,[{key:"_listBoxPaintBackground",value:function(t){var e=this._listBox.clientRect();t.brush.color=or.theme.backgroundContentColor,t.fillRect(e),this._listBox.borderVisible_&&this._listBox._doPaintBorder(t,e)}},{key:"_listBoxPaintText",value:function(t,e,i){if(!(this._listBox._displayLast<0)){var n=new U,o=this._listBox._getItemRect(this._listBox._displayFirst);o.inFlate(-1,0);for(var r=this._listBox._displayFirst;r<=this._listBox._displayLast;r++)r==this._listBox.items.count-1?(t.brush.color=at.White,n.resetRect(o),t.textOut(o.left+this._listBox.paddingLeft+or.theme.marginSpace,o.top+or.theme.marginSpace,this._listBox._items[r].text)):(t.brush.color=this._listBox._items[r].text,n.resetRect(o),n.inFlate(-1,0),t.fillRect(n)),this._listBox._itemIndex==r&&(t.pen.color=or.theme.borderActiveColor,t.rectangleRect(o)),this._listBox._hotIndex==r&&(t.pen.color=or.theme.borderHotColor,t.rectangleRect(o)),o.offset(0,this._listBox.font.height+or.theme.marginSpaceDouble)}}},{key:"_padClick",value:function(){this._popupPadControl.donePopup(),this._listBox.text=this._pad.color,Hi(Yi(i.prototype),"doSelectedIndexChange_",this).call(this)}},{key:"doDonePopup_",value:function(){this._listBox.itemIndex==this._listBox.items.count-1?this._popupPad():Hi(Yi(i.prototype),"doDonePopup_",this).call(this)}},{key:"_popupPad",value:function(){var t=this;if(null==this._popupPadControl)if(this._pad.color=this.text,this._popupPadControl=new wi,this._popupPadControl.width=this._pad.width,this._popupPadControl.height=this._pad.height,this._pad.parent=this._popupPadControl,this._popupPadControl.onClose=function(){t._popupPadControl=null},this._popupPadControl.onDone=function(){t._listBox.text=t._pad.color},null!=this._popupControl)this._popupPadControl.popup(this._popupControl.right,this._popupControl.top,!1);else{var e=this.clientToScreen(G.Create(0,0));this.popupAlign_==Wt?e.x+=this.paddingLeft-(this.borderVisible_?this.borderWidth_:0):e.x+=this.width-this._popupControl.width,this._popupPadControl.popup(e.x,e.y+this.height,!0)}}},{key:"doSetFocus_",value:function(){}},{key:"showCaret_",value:function(){}},{key:"doPaintSelected_",value:function(t){}},{key:"doPaintBackground_",value:function(t){var e=this.clientRect();e.left=this.paddingLeft,t.brush.color=or.theme.backgroundContentColor,t.fillRect(e),this.borderVisible_&&(e.left-=this.borderWidth_,this.doPaintBorder_(t,e)),this._buttonMouseIn&&(this._buttonDown?t.brush.color=or.theme.backgroundDownColor:t.brush.color=or.theme.backgroundHotColor,t.fillRect(this._buttonRect)),this.image.loaded?t.drawImage(this._buttonRect.left,this._buttonRect.top,this.image):or.theme.drawDropDown(t,this._buttonRect),e=this.textArea(),t.brush.color=this.color,t.fillRect(e)}},{key:"doPaint_",value:function(t){}},{key:"doMouseMove_",value:function(t){Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t),this.cursor=oe}},{key:"doMouseUp_",value:function(t){this._buttonDown?Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t):this.doButtonClick_()}},{key:"color",get:function(){return this.text},set:function(t){this.text=t}}]),i}(Cn),_n=function(t){Wi(i,t);var e=ji(i);function i(){return Ji(this,i),e.call(this,"")}return i}(function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this,t))._popupControl=null,n.dropDownStyle=!1,n.image=$i.Create(16,16),n.image.onImageLoaded=function(){n.doImageLoaded_()},n._onClick=null,n.onPopup=null,n}return Vi(i,[{key:"doImageLoaded_",value:function(){this.image.left=Math.trunc((or.theme.popupMenuImagePadding-this.image.width)/2),this.image.top=Math.trunc((this.height-this.image.height)/2)}},{key:"_closePopupControl_",value:function(){null!=this._popupControl&&this._popupControl.close(),this.hasSubItem&&this.onPopupClose&&this.onPopupClose()}},{key:"paint",value:function(t){""!=this.image.src&&this.image.paintTo(t,this.image.left,this.top+this.image.top),this.enabled?t.font.color=or.theme.textColor:t.font.color=or.theme.textDisableColor,Hi(Yi(i.prototype),"paint",this).call(this,t)}},{key:"visibleCount",value:function(){for(var t=0,e=0;e<this.subItems.count;e++)this.subItems[e].visible&&t++;return t}},{key:"addItem",value:function(t){var e=new i(t);return this.subItems.add(e),this.hasSubItem_=!0,e}},{key:"addControl",value:function(t){this.subItems.add(t)}},{key:"addSpliter",value:function(){return this.addItem("-")}},{key:"popup",value:function(t,e){var i=this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];null==this._popupControl&&(null!=this.onPopup&&this.onPopup(t,e,n),this.subItems.count>0&&(this._popupControl=new xn(this),this._popupControl.dropDownStyle=this.dropDownStyle,this._popupControl.onClose=function(){i._popupControl=null},this._popupControl.popup(t,e,n)))}},{key:"popupControl",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t.clientToScreen(G.Create(0,0));this.popup(i.x,i.y+t.height,e)}},{key:"onClick",get:function(){return this._onClick},set:function(t){this._onClick=t}}]),i}(function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this)).hasSubItem_=!1,n.text=t,n.subItems=new V,n.enabled=!0,n.visible=!0,n.left=0,n.top=0,n.shortCut=0,n.width=or.theme.popupMenuImagePadding+or.theme.marginSpaceDouble,n.height=or.theme.itemHeight,n}return Vi(i,[{key:"paint",value:function(t){var e;this.isSpliter?(t.pen.width=1,t.pen.color=at.Gray,e=this.top+Math.trunc(this.height/2),t.drawLineDriect(this.left+or.theme.popupMenuImagePadding,e,this.left+this.width-or.theme.marginSpace,e)):(e=this.top+Math.trunc((this.height-t.font.height)/2),t.textOut(this.left+or.theme.popupMenuImagePadding+or.theme.marginSpace,e,this.text),this.hasSubItem_&&or.theme.drawDropRight(t,U.CreateByBounds(this.left+this.width-or.theme.iconSize,this.top,or.theme.iconSize,this.height)))}},{key:"bounds",value:function(){return U.CreateByBounds(this.left,this.top,this.width,this.height)}},{key:"subItemByText",value:function(t){for(var e=0,i=this.subItems.count;e<i;e++)if(this.subItems[e].text==t)return this.subItems[e];return null}},{key:"isSpliter",get:function(){return"-"==this.text}},{key:"hasSubItem",get:function(){return this.hasSubItem_},set:function(t){this.hasSubItem_=t}}]),i}(L))),xn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this)).font=new mt,n._mouseMoveIndex=-1,n.menuItem=t,n.adjustPosition=!0,n._calcPopupControl(),n}return Vi(i,[{key:"_calcPopupControl",value:function(){for(var t=0,e=0,i=100,n=null,o=0,r=this.menuItem.subItems.count;o<r;o++)(n=this.menuItem.subItems[o]).visible&&(n.left=0,n.top=e,n.isSpliter?(n.width=or.theme.marginSpaceDouble,n.height=or.theme.marginSpace):(n.width=or.theme.popupMenuImagePadding+or.theme.marginSpace+Dt.textWidth(this.font,n.text)+or.theme.iconSize,n.height=this.font.height+or.theme.marginSpaceDouble),i<n.width&&(i=n.width),e=n.top+n.height,t+=n.height);for(var s=0,a=this.menuItem.subItems.count;s<a;s++)(n=this.menuItem.subItems[s]).visible&&(n.width=i);this.width=i,this.height=t}},{key:"_getItemIndexAt",value:function(t,e){for(var i=0;i<this.menuItem.subItems.count;i++)if(!this.menuItem.subItems[i].isSpliter&&this.menuItem.subItems[i].visible&&this.menuItem.subItems[i].bounds().pointInAt(t,e))return i;return-1}},{key:"_getItemAt",value:function(t,e){var i=this._getItemIndexAt(t,e);return i>=0?this.items[i]:null}},{key:"getHint_",value:function(){if(this._mouseMoveIndex>=0){var t=this.menuItem.subItems[this._mouseMoveIndex].hint;return or.system.assigned(t)&&""!=t?t:Hi(Yi(i.prototype),"getHint_",this).call(this)}return Hi(Yi(i.prototype),"getHint_",this).call(this)}},{key:"doMouseMove_",value:function(t){Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t);var e=this._getItemIndexAt(t.x,t.y);if(this._mouseMoveIndex!=e){if(this._mouseMoveIndex>=0&&this.menuItem.subItems[this._mouseMoveIndex]._closePopupControl_(),this._mouseMoveIndex=e,this._mouseMoveIndex>=0){var n=this.menuItem.subItems[this._mouseMoveIndex];n.visible&&n.enabled&&n.popup(this.left+this.width,this.top+n.top,!1)}this.update()}}},{key:"doMouseUp_",value:function(t){if(Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t),this._mouseMoveIndex>=0){var e=this.menuItem.subItems[this._mouseMoveIndex];e.enabled&&null!=e.onClick&&(e.onClick(),this.donePopup())}}},{key:"doPaintBackground_",value:function(t){if(Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t),this._mouseMoveIndex>=0){var e=this.menuItem.subItems[this._mouseMoveIndex];!e.isSpliter&&e.visible&&(e.enabled?t.brush.color=or.theme.backgroundSelectColor:t.brush.color=or.theme.backgroundHotColor,t.fillRect(e.bounds()))}t.pen.width=1,t.pen.color=at.Gray,t.drawLineDriect(or.theme.popupMenuImagePadding,0,or.theme.popupMenuImagePadding,this.height)}},{key:"doPaint_",value:function(t){Hi(Yi(i.prototype),"doPaint_",this).call(this,t),t.font.assign(this.font);for(var e=0,n=this.menuItem.subItems.count;e<n;e++)this.menuItem.subItems[e].visible&&this.menuItem.subItems[e].paint(t)}},{key:"getHintRect",value:function(){if(this._mouseMoveIndex>=0){var t=this.menuItem.subItems[this._mouseMoveIndex].hint;return or.system.assigned(t)&&""!=t?this.menuItem.subItems[this._mouseMoveIndex].bounds():Hi(Yi(i.prototype),"getHintRect",this).call(this)}return Hi(Yi(i.prototype),"getHintRect",this).call(this)}}]),i}(oi),An=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).state_.add(vi.Creating),t.contentHeight_=0,t.contentWidth_=0,t.HScroll_=new mi,t.HScroll_.orientation=Yt,t.HScroll_.align=Xt,t.HScroll_.onScroll=function(){t.viewScroll_()},t.VScroll_=new mi,t.VScroll_.orientation=Jt,t.VScroll_.onScroll=function(){t.viewScroll_()},t.addControl(t.VScroll_),t.addControl(t.HScroll_),t.state_.delete(vi.Creating),t}return Vi(i,[{key:"viewScroll_",value:function(){this.update()}},{key:"doResize_",value:function(){Hi(Yi(i.prototype),"doResize_",this).call(this),this.doContentResize_()}},{key:"doAlign_",value:function(){Hi(Yi(i.prototype),"doAlign_",this).call(this),this.VScroll_.visible?this.HScroll_.width=this.width-this.VScroll_.width:this.HScroll_.width=this.width,this.HScroll_.visible?this.VScroll_.height=this.height-this.HScroll_.height:this.VScroll_.height=this.height}},{key:"calcContentSize_",value:function(){this.contentHeight_=0,this.contentWidth_=0}},{key:"doContentResize_",value:function(){this.calcContentSize_(),this.VScroll_.visible=this.contentHeight_>this.height,this.VScroll_.max=this.contentHeight_,this.HScroll_.visible=this.contentWidth_>this.width,this.HScroll_.max=this.contentWidth_,this.HScroll_.visible&&this.contentHeight_+this.HScroll_.height>this.height&&(this.VScroll_.visible=!0,this.VScroll_.max=this.contentHeight_+this.HScroll_.height),this.VScroll_.visible&&this.contentWidth_+this.VScroll_.width>this.width&&(this.HScroll_.visible=!0,this.HScroll_.max=this.contentWidth_+this.VScroll_.width),this.HScroll_.visible?this.VScroll_.visible?this.HScroll_.width=this.width-this.VScroll_.width:this.HScroll_.width=this.width:this.HScroll_.position=0,this.VScroll_.visible?this.HScroll_.visible?this.VScroll_.height=this.height-this.HScroll_.height:this.VScroll_.height=this.height:this.VScroll_.position=0}},{key:"doMouseWheel_",value:function(t){or.keyDownStates[Re]?this.HScroll_.position-=t.delta:this.VScroll_.position-=t.delta}}]),i}(hn),Tn=function(t){Wi(i,t);var e=ji(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"page";return Ji(this,i),(t=e.call(this))._headerRect_=new U,t._visible=!0,t.text_=n,t.onUpdateText=null,t}return Vi(i,[{key:"doPaintBackground_",value:function(t){}},{key:"updateText",value:function(){null!=this.onUpdateText&&this.onUpdateText(this)}},{key:"text",get:function(){return this.text_},set:function(t){this.text_!=t&&(this.text_=t,this.updateText())}}]),i}(gi),On=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).width=200,t.height=200,t._showCloseButton=!1,t._headerHeight=20,t._headerOffset=0,t._headerVisible=!0,t._activePageIndex=-1,t._hotHeaderIndex=-1,t._hotBtnPageIndex=-1,t.paddingTop=t._headerHeight,t}return Vi(i,[{key:"doPageUpdateHeaderText",value:function(t){t.visible&&(this._formatHeader(t),this.updateRect(U.CreateByBounds(0,0,this.width,this._headerHeight)))}},{key:"_formatHeader",value:function(t){var e=Dt.textWidth(Dt.DefaultFont,t.text);this._showCloseButton&&(e+=or.theme.iconWidth),t._headerRect_.resetBounds(0,0,e+or.theme.marginSpaceDouble,this._headerHeight);for(var i,n=0,o=0;o<this.controls.count;o++)(i=this.controls[o])._headerRect_.resetBounds(n,0,i._headerRect_.width,i._headerRect_.height),n+=i._headerRect_.width}},{key:"_formatAllHeader",value:function(){for(var t=0;t<this.controls.count;t++)this._formatHeader(this.controls[t])}},{key:"doAddControl_",value:function(t){var e=this;t.isClass(Tn)?(t.align=Kt,t.onUpdate=function(i){e.doPageUpdateRect(t,i)},t.onUpdateText=function(t){e.doPageUpdateHeaderText(t)},this._formatHeader(t),this.pageIndex=this.controls.count-1,Hi(Yi(i.prototype),"doAddControl_",this).call(this,t)):or.exception("只能添加TPage及其子类")}},{key:"doRemoveControl_",value:function(t){this._formatAllHeader(),0==this.controls.count?this._activePageIndex=-1:this._activePageIndex>this.controls.count-1&&(this.pageIndex=this.controls.count-1),Hi(Yi(i.prototype),"doRemoveControl_",this).call(this,t)}},{key:"doPaintBorder_",value:function(t){this._headerVisible?this.borderVisible_&&(this.controls.count>0?(t.pen.color=or.theme.borderColor,t.pen.width=or.theme.borderWidth,t.beginPath(),t.moveTo(0,this._headerHeight),t.lineTo(0,this.height-1),t.lineTo(this.width,this.height-1),t.lineTo(this.width,this._headerHeight),t.paintPath()):Hi(Yi(i.prototype),"doPaintBorder_",this).call(this,t)):Hi(Yi(i.prototype),"doPaintBorder_",this).call(this,t)}},{key:"doPaintPageHeader",value:function(t){var e;t.font.assign(Dt.DefaultFont);for(var i=0;i<this.controls.count;i++)e=this.controls[i],t.textOut(e._headerRect_.left+or.theme.marginSpace,e._headerRect_.top+or.theme.marginSpace,e.text),this._showCloseButton&&i==this._hotBtnPageIndex&&(t.brush.color=or.theme.backgroundHotColor,t.fillBounds(e._headerRect_.right-or.theme.iconWidth,e._headerRect_.top,or.theme.iconWidth,or.theme.iconWidth)),i==this._activePageIndex?(this._showCloseButton&&t.drawImage(e._headerRect_.right-or.theme.iconWidth,e._headerRect_.top+2,or.theme.closeImage),t.pen.color=or.theme.borderColor,t.pen.width=or.theme.borderWidth,t.beginPath(),t.moveTo(0,this._headerHeight),t.lineTo(e._headerRect_.left+1,this._headerHeight),t.lineTo(e._headerRect_.left+1,0),t.lineTo(e._headerRect_.right,0),t.lineTo(e._headerRect_.right,this._headerHeight),t.lineTo(this.width,this._headerHeight),t.paintPath()):this._showCloseButton&&i==this._hotHeaderIndex&&t.drawImage(e._headerRect_.right-or.theme.iconWidth,e._headerRect_.top+2,or.theme.closeImage)}},{key:"doPaintBackground_",value:function(t){Hi(Yi(i.prototype),"doPaintBackground_",this).call(this,t)}},{key:"doPaint_",value:function(t){if(this._activePageIndex>=0){var e=this.controls[this._activePageIndex];t.save();try{t.translate(e.left,e.top),t.clip(0,0,e.width,e.height),e.paint(t)}finally{t.restore()}}this.borderVisible&&this.doPaintBorder_(t),this._headerVisible&&this.doPaintPageHeader(t)}},{key:"_pageHeaderIndexAt",value:function(t,e){if(this._headerVisible)for(var i=new U,n=0;n<this.controls.count;n++)if(i.resetRect(this.controls[n]._headerRect_),i.offset(-this._headerOffset,0),i.pointInAt(t,e))return n;return-1}},{key:"getControlAt",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this._headerVisible&&e<this._headerHeight)return null;if(this._activePageIndex>=0){var o=this.controls[this._activePageIndex];if(n&&o.enabled)return o}return Hi(Yi(i.prototype),"getControlAt",this).call(this,t,e,n)}},{key:"doMouseDown_",value:function(t){if(this._headerVisible&&t.y<this._headerHeight){var e=this._pageHeaderIndexAt(t.x,t.y);e>=0&&e!=this._activePageIndex&&(this.pageIndex=e)}else Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t)}},{key:"doMouseMove_",value:function(t){if(this._headerVisible){var e=!1,n=-1,o=this._pageHeaderIndexAt(t.x,t.y);if(o!=this._hotHeaderIndex&&(this._hotHeaderIndex=o,e=!0),this._hotHeaderIndex>=0){var r=this.controls[this._hotHeaderIndex];t.x>r._headerRect_.right-or.theme.iconWidth&&r._headerRect_.pointInAt(t.x,t.y)&&(n=this._hotHeaderIndex)}this._hotBtnPageIndex!=n&&(this._hotBtnPageIndex=n,e=!0),e&&this.updateRect(U.CreateByBounds(0,0,this.width,this._headerHeight))}Hi(Yi(i.prototype),"doMouseMove_",this).call(this,t)}},{key:"doMouseUp_",value:function(t){if(this._showCloseButton&&this._headerVisible&&t.y<this._headerHeight){var e=this.controls[this._activePageIndex];this._activePageIndex>=0&&t.x>e._headerRect_.right-or.theme.iconWidth&&t.x<e._headerRect_.right&&this.closePage(this._activePageIndex)}else Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}},{key:"closePage",value:function(t){this.beginUpdate();try{this.controls.removeAt(t)}finally{this.endUpdate()}}},{key:"addPage",value:function(t){var e=new Tn(t);return this.addControl(e),e}},{key:"pageIndex",get:function(){return this._activePageIndex},set:function(t){t>=0&&t<this.controls.count&&t!=this._activePageIndex&&(this._activePageIndex>=0&&this._activePageIndex<this.controls.count&&this.controls[this._activePageIndex].deactivate(),this._activePageIndex=t,this.update())}},{key:"activePage",get:function(){return this._activePageIndex>=0?this.controls[this._activePageIndex]:null}},{key:"headerVisible",get:function(){return this._headerVisible},set:function(t){this._headerVisible!=t&&(this._headerVisible=t,this.paddingTop=t?this._headerHeight:0)}},{key:"pageCount",get:function(){return this.controls.count}},{key:"pages",get:function(){return this.controls}},{key:"showCloseButton",get:function(){return this._showCloseButton},set:function(t){this._showCloseButton!=t&&(this._showCloseButton=t,this._formatAllHeader(),this.updateRect(U.CreateByBounds(0,0,this.width,this._headerHeight)))}}]),i}(hn),Nn=function(t){Wi(i,t);var e=ji(i);function i(t){var n;return Ji(this,i),(n=e.call(this)).onAdded=function(t){t.onUpdate=function(){null!=n.onUpdate&&n.onUpdate()}},n.initCol(t),n}return Vi(i,[{key:"createNewCell",value:function(){return new Bn}},{key:"initCol",value:function(t){var e;this.clear();for(var i=0;i<t;i++)e=this.createNewCell(),this.add(e)}}]),i}(V),Bn=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this))._value="",t.onUpdate=null,t}return Vi(i,[{key:"setValue",value:function(t){this._value!=t&&(this._value=t,null!=this.onUpdate&&this.onUpdate())}},{key:"paintTo",value:function(t,e){t.textRect(e,e.left+2,e.top+4,this._value)}},{key:"value",get:function(){return this._value},set:function(t){this.setValue(t)}}]),i}(L),En=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).rowSelect=!0,t}return i}(L),Mn=function(t){Wi(i,t);var e=ji(i);function i(t,n){var o;return Ji(this,i),(o=e.call(this,t,n)).readOnly=!1,o.FInnerEdit_=new dn,o.FInnerEdit_.visible_=!1,o.FInnerEdit_._marginLeft=0,o.FInnerEdit_._marginTop=0,o.FInnerEdit_._marginRight=0,o.FInnerEdit_._marginBottom=0,o.FInnerEdit_._paddingLeft=2,o.FInnerEdit_._paddingTop=0,o.FInnerEdit_._paddingRight=2,o.FInnerEdit_._paddingBottom=0,o.FInnerEdit_.onKeyDown=function(t){t.keyCode==be?o.doSetInnerEdit_():t.keyCode==Ae&&o.doSetInnerEdit_(!1)},o.FInnerEdit_.onKillFocus=function(){o.doSetInnerEdit_()},o.FEditRow=-1,o.FEditCol=-1,o.addControl(o.FInnerEdit_),o}return Vi(i,[{key:"doSetInnerEdit_",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.FEditRow>=0&&this.FEditRow<this.rowCount&&(t?this.rows[this.FEditRow][this.FEditCol].value=this.FInnerEdit_.text:this.FInnerEdit_.text=this.rows[this.FEditRow][this.FEditCol].value),this.FInnerEdit_.visible=!1}},{key:"doMouseDown_",value:function(t){if(this.FInnerEdit_.visible_&&this.FInnerEdit_.bounds().pointInAt(t.x,t.y))Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t);else{var e=this.row_,n=this.col_;if(Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t),!this.readOnly&&this.row_>this.fixRowCount_-1&&this.col_>=0&&e==this.row_&&n==this.col_){this.FInnerEdit_.text=this.rows[this.row_][this.col_].value;var o=this.getCellRect(this.row_,this.col_);o.left-=or.theme.borderWidth,o.top-=or.theme.borderWidth,this.FInnerEdit_.left=o.left,this.FInnerEdit_.top=o.top,this.FInnerEdit_.width_=o.width,this.FInnerEdit_.height_=o.height,this.FInnerEdit_.visible=!0,this.FEditRow=e,this.FEditCol=n;var r=new ei;r.assign(t),r.x-=this.FInnerEdit_.left,r.y-=this.FInnerEdit_.top,this.FInnerEdit_.mouseDown(r)}}}},{key:"doMouseUp_",value:function(t){if(Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t),!this.readOnly&&this.FInnerEdit_.visible_){var e=new ei;e.assign(t),e.x-=this.FInnerEdit_.left,e.y-=this.FInnerEdit_.top,this.FInnerEdit_.mouseUp(e)}}}]),i}(function(t){Wi(i,t);var e=ji(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Ji(this,i),(t=e.call(this)).state_.add(vi.Creating),t.canFocus=!0,t.defaultRowHeight=22,t.defaultColWidth=30,t._colWidths=new Array,t.row_=-1,t.col_=-1,t.width_=200,t.height_=200,t.leftOffset_=0,t.topOffset_=0,t.fixRowCount_=0,t.FRowDispRange=null,t.FColDispRange=null,t.option=new En,t.rows=new V,t.rows.onAdded=function(e){e.onUpdate=function(){t.update()},t.doContentResize_()},t.rows.onRemoved=function(e){t.doContentResize_()},t.initRowCol(n,o),t.state_.delete(vi.Creating),t}return Vi(i,[{key:"_calcDisplayRow",value:function(){for(var t=0,e=this.rows.count-1,i=0,n=0;n<e;n++)if((i+=this.getRowHeight_(n))>this.VScroll_.position){t=n,i-=this.getRowHeight_(n);break}for(var o=t;o<e;o++)if((i+=this.getRowHeight_(o))-this.VScroll_.position>this.height){e=o;break}return{first:t,last:e}}},{key:"_calcDisplayCol",value:function(){for(var t=0,e=this._colWidths.length-1,i=0,n=0;n<e;n++)if((i+=this._colWidths[n])>this.HScroll_.position){t=n,i-=this._colWidths[n];break}for(var o=t;o<e;o++)if((i+=this._colWidths[o])-this.HScroll_.position>this.width){e=o;break}return{first:t,last:e}}},{key:"_calcDisplayRowAndCol",value:function(){this.FRowDispRange=this._calcDisplayRow(),this.FColDispRange=this._calcDisplayCol(),this.topOffset_=0,this.leftOffset_=0;for(var t=0;t<this.FRowDispRange.first;t++)this.topOffset_+=this.getRowHeight_(t);this.topOffset_-=this.VScroll_.position;for(var e=0;e<this.FColDispRange.first;e++)this.leftOffset_+=this._colWidths[e];this.leftOffset_-=this.HScroll_.position}},{key:"viewScroll_",value:function(){this._calcDisplayRowAndCol(),Hi(Yi(i.prototype),"viewScroll_",this).call(this)}},{key:"calcContentSize_",value:function(){this.col_>this._colWidths.length-1&&(this.col_=-1),this.row_>this.rows.count-1&&(this.row_=-1),this.contentHeight_=0;for(var t=0;t<this.rows.count;t++)this.contentHeight_+=this.getRowHeight_(t);this.contentWidth_=0;for(var e=0;e<this._colWidths.length;e++)this.contentWidth_+=this._colWidths[e]}},{key:"doContentResize_",value:function(){this.updateCount_>0||(Hi(Yi(i.prototype),"doContentResize_",this).call(this),this._calcDisplayRowAndCol(),this.update())}},{key:"endUpdate",value:function(){Hi(Yi(i.prototype),"doContentResize_",this).call(this),this._calcDisplayRowAndCol(),Hi(Yi(i.prototype),"endUpdate",this).call(this)}},{key:"getRowHeight_",value:function(t){return this.defaultRowHeight}},{key:"getCellWidth_",value:function(t,e){return this._colWidths[e]}},{key:"doKeyDown_",value:function(t){Hi(Yi(i.prototype),"doKeyDown_",this).call(this,t),t.keyCode==Le?this.row_<this.rows.count-1?this.fixRowCount_>0&&this.row_<this.fixRowCount_?this.row=this.fixRowCount_:this.row=this.row_+1:this.rows.count>0&&(this.fixRowCount_>0&&this.rows.count>this.fixRowCount_?this.row=this.fixRowCount_:this.row=0):t.keyCode==Ee&&this.rows.count>0&&(this.row_>0?this.fixRowCount_>0?this.row_>this.fixRowCount_?this.row=this.row_-1:this.row=this.rows.count-1:this.row_>0&&(this.row=this.row_-1):this.row=this.rows.count-1)}},{key:"doMouseDown_",value:function(t){if(Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t),null==this.getControlAt(t.x,t.y,!0)){var e=this.getCellAt(t.x,t.y);this.row_==e.row&&this.col_==e.col||(this.row_=e.row,this.col_=e.col,this.update())}}},{key:"doRowPaint_",value:function(t,e,i){return null!=this.onRowPaint&&this.onRowPaint(t,e,i)}},{key:"doCellPaint_",value:function(t,e,i,n){if(null==this.onCellPaint)return!1;t.save();try{return this.onCellPaint(t,e,i,n)}finally{t.restore()}}},{key:"doPaint_",value:function(t){if(0!=this.rows.count){var e,n,o=0,r=0;t.font.assign(Dt.DefaultFont),t.pen.width=or.theme.borderWidth,t.pen.color=or.theme.borderColor;var s=new U;if(this.fixRowCount_){r=0,t.brush.color=or.theme.backgroundDownColor;for(var a=0;a<this.fixRowCount;a++){n=this.getRowHeight_(a),o=this.leftOffset_;for(var l=this.FColDispRange.first;l<=this.FColDispRange.last;l++)(e=this.getCellWidth_(a,l))>0&&(s.resetBounds(o,r,e,n),t.fillRect(s),this.doCellPaint_(t,s,a,l)||this.rows[a][l].paintTo(t,s),s.left-=or.theme.borderWidth,s.top-=or.theme.borderWidth,t.rectangleRect(s),o+=e);r+=n}}this.HScroll_.visible&&this.VScroll_.visible&&(t.brush.color=or.theme.backgroundStaticColor,t.fillBounds(this.VScroll_.left,this.HScroll_.top,this.VScroll_.width,this.HScroll_.height)),t.save();try{t.clip(this.borderVisible?or.theme.borderWidth:0,r,this.VScroll_.visible?this.width-this.VScroll_.width:this.width-or.theme.borderWidth,this.HScroll_.visible?this.height-r-this.HScroll_.height:this.height-r-or.theme.borderWidth),o=this.leftOffset_,r=this.topOffset_;for(var h=this.FRowDispRange.first;h<=this.FRowDispRange.last;h++){n=this.getRowHeight_(h),o=this.leftOffset_,s.resetBounds(o,r,this.width,n),this.doRowPaint_(t,s,h)||(t.brush.color=or.theme.backgroundContentColor,t.fillRect(s));for(var c=this.FColDispRange.first;c<=this.FColDispRange.last;c++)(e=this.getCellWidth_(h,c))>0&&(s.resetBounds(o,r,e,n),h==this.row_&&(this.option.rowSelect||c==this.col_)&&(t.brush.color=or.theme.backgroundSelectColor,t.fillRect(s)),this.doCellPaint_(t,s,h,c)||this.rows[h][c].paintTo(t,s),s.left-=or.theme.borderWidth,s.top-=or.theme.borderWidth,t.rectangleRect(s),o+=e);r+=n}}finally{t.restore()}Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}}},{key:"doCreateNewRow_",value:function(t){return new Nn(t)}},{key:"initRowCol",value:function(t,e){var i;this.rows.clear();for(var n=0;n<t;n++)i=this.doCreateNewRow_(e),this.rows.add(i);this._colWidths=new Array(e);for(var o=0;o<e;o++)this._colWidths[o]=this.defaultColWidth;this.doContentResize_()}},{key:"setColWidth",value:function(t,e){this._colWidths[t]=e,this.doContentResize_()}},{key:"setRowCount",value:function(t){if(this.rows.count!=t)if(this.rows.count>t){this.beginUpdate();try{for(;this.rows.count>t;)this.rows.removeAt(this.rows.count-1)}finally{this.endUpdate()}}else{var e;this.beginUpdate();try{for(;this.rows.count<t;)e=this.doCreateNewRow_(this.colCount),this.rows.add(e)}finally{this.endUpdate()}}}},{key:"setColCount",value:function(t){if(this._colWidths.length!=t){if(this._colWidths.length>t)for(;this._colWidths.length>t;){for(var e=0;e<this.rows.count;e++)this.rows[e].removeAt(this._colWidths.length-1);this._colWidths.length-=1}else for(var i;this._colWidths.length<t;)for(var n=0;n<this.rows.count;n++)i=this.rows[n].createNewCell(),this.rows[n].add(i);this.doContentResize_()}}},{key:"getCellAt",value:function(t,e){for(var i,n,o,r=new U,s=this.topOffset_,a=this.FRowDispRange.first;a<=this.FRowDispRange.last;a++){n=this.getRowHeight_(a),i=this.leftOffset_;for(var l=this.FColDispRange.first;l<=this.FColDispRange.last;l++){if(o=this.getCellWidth_(a,l),r.resetBounds(i,s,o,n),r.pointInAt(t,e))return{row:a,col:l};i+=o}s+=n}return{row:-1,col:-1}}},{key:"getCellRect",value:function(t,e){for(var i=0,n=0,o=0;o<t;o++)i+=this.getRowHeight_(o);i-=this.VScroll_.position;for(var r=0;r<e;r++)n+=this._colWidths[r];return n-=this.HScroll_.position,U.CreateByBounds(n,i,this._colWidths[e],this.getRowHeight_(t))}},{key:"deleteRow",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!(t<this.fixRowCount_||e<1)){var i=this.rowCount,n=this.colCount;for(e=Math.min(e,i-t);t+e<i;){for(var o=0;o<n;o++)this.rows[t][o].value=this.rows[t+e][o].value;t++}this.rowCount=this.rowCount-e}}},{key:"contentHeight",get:function(){return this.contentHeight_}},{key:"rowCount",get:function(){return this.rows.count},set:function(t){this.setRowCount(t)}},{key:"colCount",get:function(){return this._colWidths.length},set:function(t){this.setColCount(t)}},{key:"fixRowCount",get:function(){return this.fixRowCount_},set:function(t){this.fixRowCount_!=t&&(this.fixRowCount_=t,this.update())}},{key:"row",get:function(){return this.row_},set:function(t){this.row_!=t&&(t>=0&&t<this.rows.count?this.row_=t:this.row_=-1,this.update())}},{key:"col",get:function(){return this.col_},set:function(t){this.col_!=t&&(t>=0&&t<this._colWidths.length-1?this.col_=t:this.col_=-1,this.update())}}]),i}(An)),Ln=function(t){Wi(i,t);var e=ji(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ji(this,i),(t=e.call(this)).text_=n,t.level=0,t._expand=!1,t.parent=null,t.object=null,t.onChange=null,t.onPaint=null,t.childs=new V,t.childs.onAdded=function(e){e.parent=Ki(t),e.level=t.level+1,e.onChange=function(e){t.doChange_(e)},e.onPaint=function(e,i,n,o){t.doPaint_(e,i,n,o)},t.doChange_()},t.childs.onRemoved=function(e){t.doChange_(e)},t}return Vi(i,[{key:"doChange_",value:function(t){null!=this.onChange&&this.onChange(t)}},{key:"doPaint_",value:function(t,e,i,n){null!=this.onPaint&&this.onPaint(t,e,i,n)}},{key:"setText",value:function(t){this.text_!=t&&(this.text_=t,this.doChange_())}},{key:"getNodeAt",value:function(t,e,i){if(e>i&&e<=i+or.theme.itemHeight)return{node:this,top:i+or.theme.itemHeight};if(i+=or.theme.itemHeight,this._expand)for(var n,o=0,r=this.childCount;o<r;o++){if(null!=(n=this.childs[o].getNodeAt(t+or.theme.iconWidth,e,i)).node)return n;i=n.top}return{node:null,top:i}}},{key:"paintTo",value:function(t,e,i){if(this.doPaint_(t,this,e,i),i+=or.theme.itemHeight,this._expand)for(var n=0,o=this.childCount;n<o;n++)i=this.childs[n].paintTo(t,e+or.theme.iconWidth,i);return i}},{key:"addNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=new i(t);return n.object=e,this.childs.add(n),n}},{key:"getHeight",value:function(){var t=or.theme.itemHeight;if(this._expand)for(var e=0,i=this.childCount;e<i;e++)t+=this.childs[e].getHeight();return t}},{key:"deleteNode",value:function(t){null!=t&&this.childs.remove(t)}},{key:"childCount",get:function(){return this.childs.count}},{key:"text",get:function(){return this.text_},set:function(t){this.setText(t)}},{key:"expand",get:function(){return this._expand},set:function(t){this.childs.count>0&&this._expand!=t&&(this._expand=t,this.doChange_())}}]),i}(L),Gn=function(t){Wi(i,t);var e=ji(i);function i(){var t;return Ji(this,i),(t=e.call(this)).state_.add(vi.Creating),t.canFocus=!0,t.selectNode=null,t.nodes=new V,t.nodes.onAdded=function(e){e.parent=null,e.level=0,e.onPaint=function(e,i,n,o){t._doNodePaint(e,i,n,o)},e.onChange=function(e){t._doNodeChange(e)},t.doContentResize_()},t.nodes.onRemoved=function(e){t.doContentResize_()},t.width=200,t.height=200,t.onNodePaint=null,t.onCollaps=null,t.onExpand=null,t.onSelectChanged=null,t.state_.delete(vi.Creating),t}return Vi(i,[{key:"_doNodePaint",value:function(t,e,i,n){n+or.theme.itemHeight<0||n>this.height||(e===this.selectNode&&(t.brush.color=or.theme.backgroundSelectColor,t.fillBounds(0,n,this.width,or.theme.itemHeight)),e.childCount>0&&(e._expand?t.drawImage(i+2,n+2,or.theme.expandImage):t.drawImage(i+2,n+2,or.theme.foldImage)),null!=this.onNodePaint&&this.onNodePaint(t,e,i,n)||t.textOut(i+or.theme.iconWidth,n+3,e.text))}},{key:"_doNodeChange",value:function(t){this.doContentResize_()}},{key:"calcContentSize_",value:function(){Hi(Yi(i.prototype),"calcContentSize_",this).call(this);for(var t=0,e=this.nodes.count;t<e;t++)this.contentHeight_+=this.nodes[t].getHeight()}},{key:"doContentResize_",value:function(){Hi(Yi(i.prototype),"doContentResize_",this).call(this),this.update()}},{key:"doPaint_",value:function(t){var e=0,n=0;this.borderVisible&&(e=or.theme.borderWidth,n=or.theme.borderWidth),n-=this.VScroll_.position,t.font.assign(Dt.DefaultFont);for(var o=0,r=this.nodes.count;o<r;o++)n=this.nodes[o].paintTo(t,e,n);Hi(Yi(i.prototype),"doPaint_",this).call(this,t)}},{key:"doMouseDown_",value:function(t){var e=this.getNodeAt(t.x,t.y);this.selectNode!==e&&(this.selectNode=e,this.onSelectChanged&&this.onSelectChanged(),this.update()),Hi(Yi(i.prototype),"doMouseDown_",this).call(this,t)}},{key:"doMouseUp_",value:function(t){var e=this.getNodeAt(t.x,t.y);null!=e&&e===this.selectNode&&t.x>e.level*or.theme.iconWidth&&t.x<(e.level+1)*or.theme.iconWidth&&this.expandSwitch(e),Hi(Yi(i.prototype),"doMouseUp_",this).call(this,t)}},{key:"doDblClick_",value:function(t){null!=this.selectNode&&this.expandSwitch(this.selectNode),Hi(Yi(i.prototype),"doDblClick_",this).call(this,t)}},{key:"expandSwitch",value:function(t){t.expand&&null!=this.onCollaps?this.onCollaps(t):t.expand||null==this.onExpand||this.onExpand(t),t.expand=!t.expand}},{key:"getNodeAt",value:function(t,e){var i=this.borderVisible?or.theme.borderWidth:0;i-=this.VScroll_.position;for(var n=null,o=0,r=this.nodes.count;o<r;o++){if(null!=(n=this.nodes[o].getNodeAt(t,e,i)).node)return n.node;i=n.top}return null}},{key:"addNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=new Ln(t);return i.object=e,this.nodes.add(i),i}},{key:"deleteNode",value:function(t){null!=t&&(null!=t.parent?t.parent.deleteNode(t):this.nodes.remove(t),this.selectNode=null)}}]),i}(An);function Hn(t){return(Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Un(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vn(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Wn(t,e,i){return e&&Vn(t.prototype,e),i&&Vn(t,i),t}function zn(t,e,i){return(zn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Zn(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function jn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Xn(t,e)}function Xn(t,e){return(Xn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Kn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Zn(t);if(e){var o=Zn(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Yn(this,i)}}function Yn(t,e){return!e||"object"!==Hn(e)&&"function"!=typeof e?Jn(t):e}function Jn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Zn(t){return(Zn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var qn=0,Qn=1,$n=2,to=3,eo=4,io=0,no=1,oo=function(t){jn(i,t);var e=Kn(i);function i(t,n){var o;return Un(this,i),(o=e.call(this))._modalOkEvent=null,o.visible_=!1,o.width_=t,o.height_=n,o.keyPreview=!1,o.closeFree=!0,o.showState=qn,o.modalResult=io,o}return Wn(i,[{key:"doKeyDown_",value:function(t){this.keyPreview&&(this.onKeyDown(t),t.keyCode==ke)||zn(Zn(i.prototype),"doKeyDown_",this).call(this,t)}},{key:"doKeyPress_",value:function(t){this.keyPreview&&(this.onKeyPress(t),t.keyCode==ke)||zn(Zn(i.prototype),"doKeyPress_",this).call(this,t)}},{key:"doKeyUp_",value:function(t){this.keyPreview&&(this.onKeyUp(t),t.keyCode==ke)||zn(Zn(i.prototype),"doKeyUp_",this).call(this,t)}},{key:"doSetBounds_",value:function(){null!=this.parent&&this.parent.isClass(gi)&&zn(Zn(i.prototype),"doSetBounds_",this).call(this)}},{key:"doPaintBorder_",value:function(t){t.brush.color="#909090",this.paddingLeft>0&&t.fillBounds(0,0,this.paddingLeft,this.height),this.paddingTop&&t.fillBounds(0,0,this.width,this.paddingTop),this.paddingRight>0&&t.fillBounds(this.width-this.paddingRight,0,this.paddingRight,this.height),this.paddingBottom>0&&t.fillBounds(0,this.height-this.paddingBottom,this.width,this.paddingBottom)}},{key:"_checkParent",value:function(){null==this.parent&&or.application.addForm(this)}},{key:"doVisibleChange_",value:function(t){t||this.showState==eo||(this.showState=Qn),zn(Zn(i.prototype),"doVisibleChange_",this).call(this,t)}},{key:"doCloseQuery",value:function(){return null==this.onCloseQuery||this.onCloseQuery()}},{key:"doClose_",value:function(){this.doCloseQuery()&&(this.visible=!1,this.showState=qn,this.onClose(),this.modalResult==no&&null!=this._modalOkEvent&&this._modalOkEvent(this),this.modalResult=io,this.closeFree&&this.dispose())}},{key:"hide",value:function(){this.visible=!1}},{key:"show",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$n;this.visible_||(this._checkParent(),this.showState=t,this.visible=!0)}},{key:"showNoActive",value:function(){this.show(to)}},{key:"showModal",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this._modalOkEvent=t,this.modalResult=io,this.show(eo)}},{key:"moveCenter",value:function(){this.left=Math.trunc((or.width-this.width)/2),this.top=Math.trunc((or.height-this.height)/2)}},{key:"close",value:function(){this.doClose_()}},{key:"onClose",value:function(){}}]),i}(gi),ro=function(t){jn(i,t);var e=Kn(i);function i(t,n){var o,r,s;return Un(this,i),(s=e.call(this,t,n)).canFocus=!1,s.captionBar=new cn,s.captionBar.transparent=!0,s.captionBar.align=zt,s.captionBar.paddingLeft=5,s.captionBar.paddingRight=5,s.captionBar.width=t,s.lblCaption=new en("form"+(or.application.forms.count+1).toString()),s.lblCaption.align=Wt,s.captionBar.addControl(s.lblCaption),s.btnClose=new nn("关闭"),s.btnClose.autoWidth=!0,s.btnClose.align=jt,s.btnClose.onClick=function(){s.close()},s.captionBar.addControl(s.btnClose),zn((o=Jn(s),Zn(i.prototype)),"addControl",o).call(o,s.captionBar),s.clientArea=new hn,s.clientArea.borderVisible=!1,s.clientArea.transparent=!0,s.clientArea.align=Kt,s.clientArea.onPaint=function(t){s.doClientPaint_(t)},zn((r=Jn(s),Zn(i.prototype)),"addControl",r).call(r,s.clientArea),s}return Wn(i,[{key:"doClientPaint_",value:function(t){}},{key:"doGetPopupMenu",value:function(){return this.clientArea.popupMenu}},{key:"doSetPopupMenu",value:function(t){this.clientArea.popupMenu=t}},{key:"doSetColor_",value:function(){this.clientArea.color=this.color}},{key:"insertControl",value:function(t,e){this.clientArea.insertControl(t,e)}},{key:"addControl",value:function(t){this.clientArea.addControl(t)}},{key:"caption",get:function(){return this.lblCaption.text},set:function(t){this.lblCaption.text=t}}]),i}(oo),so=function(t){jn(i,t);var e=Kn(i);function i(){var t;return Un(this,i),(t=e.call(this,200,120)).moveCenter(),t}return Wn(i,[{key:"doPaintBackground_",value:function(t){t.brush.color=or.theme.backgroundStaticColor,t.fillRectShadow(this.clientRect(),or.theme.shadow)}}]),i}(ro),ao=function(t){jn(i,t);var e=Kn(i);function i(){var t;return Un(this,i),(t=e.call(this))._reset(),t._onExecute=null,t}return Wn(i,[{key:"_reset",value:function(){this._fileName="",this._firstFile=null,this._files=null}},{key:"execute",value:function(t){var e=this;this._reset();var i=document.createElement("input");i.setAttribute("type","file"),i.setAttribute("style","visibility:hidden"),i.setAttribute("accept",null!=t?t:""),i.onchange=function(t){i.files.length>0&&(e._fileName=i.value,e._firstFile=i.files[0],e._files=i.files,null!=e._onExecute&&e._onExecute())},document.body.appendChild(i);try{i.click()}finally{document.body.removeChild(i)}}},{key:"fileName",get:function(){return this._fileName}},{key:"firstFile",get:function(){return this._firstFile}},{key:"files",get:function(){return this._files}},{key:"onExecute",get:function(){return this._onExecute},set:function(t){this._onExecute=t}}],[{key:"execute",value:function(t,e){var n=new i;n.onExecute=function(){e(n)},n.execute(t)}}]),i}(so),lo=1,ho=2,co=4,uo=8,fo=16,mo=32,yo=64,po=128,So=256,vo=512,Fo=function(t){jn(i,t);var e=Kn(i);function i(t,n){var o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];Un(this,i),(o=e.call(this)).caption=t,o.text=n,o.dlgBtn=null;for(var s=n.split(or.system.lineBreak),a=0,l=0,h=0;h<s.length;h++)l<(a=Dt.textWidth(null,s[h])+40)&&(l=a);o.contentHeight=s.length*(Dt.DefaultFont.height+5),o.height=Math.max(o.height_,o.contentHeight+40),o.width=Math.max(o.width_,l),o.moveCenter();for(var c,u=Math.trunc((o.width-(75*r.length+(r.length-1)*or.theme.marginSpace))/2),f=function(t){switch(r[t]){case lo:c=new nn("是");break;case ho:c=new nn("否");break;case co:c=new nn("确定");break;case uo:c=new nn("取消");break;case fo:c=new nn("中止");break;case mo:c=new nn("重试");break;case yo:c=new nn("忽略");break;case po:c=new nn("全部");break;case So:c=new nn("全部否");break;case vo:c=new nn("全部是");break;default:c=new nn("确定")}c.onClick=function(){o.dlgBtn=r[t],o.modalResult=no,o.close()},c.left=u,u+=c.width+or.theme.marginSpace,c.top=o.clientArea.height-10-c.height,o.addControl(c)},d=0;d<r.length;d++)f(d);return o}return Wn(i,[{key:"doClientPaint_",value:function(t){zn(Zn(i.prototype),"doClientPaint_",this).call(this,t);for(var e=this.text.split(or.system.lineBreak),n=Math.trunc((this.clientArea.height-this.contentHeight)/2+5),o=0;o<e.length;o++)t.textOut(20,n,e[o]),n+=Dt.DefaultFont.height+5}}]),i}(so);function Io(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var go=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onImageLoad=null,this.iconSize=16,this.iconWidth=20,this.itemHeight=20,this.radioButtonWidth=16,this.checkBoxWidth=16,this.shadow=10,this.borderWidth=1,this.marginSpace=5,this.marginSpaceDouble=10,this.popupMenuImagePadding=30,this.dropDownButtonSize=20,this.dropDownButtonColor="black",this.borderColor="#848484",this.borderHotColor="green",this.borderActiveColor="blue",this.backgroundStaticColor="#f0f0f0",this.backgroundLightColor="#eaeaea",this.backgroundHotColor="#dcdcdc",this.backgroundDownColor="#c8c8c8",this.backgroundContentColor="#ffffff",this.backgroundSelectColor="#3390ff",this.ShadowColor="black",this.textColor="black",this.textDisableColor="gray",this._path="",this.expandImage=new Image,this.expandImage.onload=function(){null!=e.onImageLoad&&e.onImageLoad()},this.foldImage=new Image,this.foldImage.onload=function(){null!=e.onImageLoad&&e.onImageLoad()},this.closeImage=new Image,this.closeImage.onload=function(){null!=e.onImageLoad&&e.onImageLoad()}}var e,i,n;return e=t,(i=[{key:"getCSSCursor",value:function(t){switch(t){case se:return"crosshair";case ae:return"grab";case le:return"pointer";case he:return"wait";case ce:return"col-resize";case ue:return"text";case fe:return"not-allowed";case de:return"all-scroll";case me:return"nesw-resize";case ye:return"ns-resize";case pe:return"nwse-resize";case Se:return"w-resize";case ve:return"row-resize";default:return"string"==typeof t?t:"default"}}},{key:"drawDropUp",value:function(t,e){t.pen.width=1,t.pen.color=this.dropDownButtonColor,t.beginPath();var i=e.left+Math.trunc((e.width-7)/2),n=e.bottom-Math.trunc((e.height-4)/2);t.drawLine(i,n,i+7,n),t.drawLine(i+1,n-1,i+6,n-1),t.drawLine(i+2,n-2,i+5,n-2),t.drawLine(i+3,n-3,i+4,n-3),t.paintPath()}},{key:"drawDropDown",value:function(t,e){t.pen.width=1,t.pen.color=this.dropDownButtonColor,t.beginPath();var i=e.left+Math.trunc((e.width-7)/2),n=e.top+Math.trunc((e.height-4)/2);t.drawLine(i,n,i+7,n),t.drawLine(i+1,n+1,i+6,n+1),t.drawLine(i+2,n+2,i+5,n+2),t.drawLine(i+3,n+3,i+4,n+3),t.paintPath()}},{key:"drawDropRight",value:function(t,e){t.pen.width=1,t.pen.color=this.dropDownButtonColor,t.beginPath();var i=e.left+Math.trunc((e.width-4)/2),n=e.top+Math.trunc((e.height-7)/2);t.drawLine(i,n,i,n+7),t.drawLine(i+1,n+1,i+1,n+6),t.drawLine(i+2,n+2,i+2,n+5),t.drawLine(i+3,n+3,i+3,n+4),t.paintPath()}},{key:"drawFrameControl",value:function(t,e,i,n){var o=U.CreateByBounds(e.left+Math.trunc((e.width-this.checkBoxWidth)/2),e.top+Math.trunc((e.height-this.checkBoxWidth)/2)+1,this.checkBoxWidth-2,this.checkBoxWidth-2);switch(n){case Fi:t.save();try{t.pen.color=this.borderColor,t.pen.style=pt.Solid,t.pen.width=1,t.brush.style=Ft,t.ellipseRectDriect(o),i.has(yi)&&(t.brush.color=this.textColor,t.brush.style=vt,t.pen.style=pt.Clear,o.inFlate(-3,-3),t.ellipseRectDriect(o))}finally{t.restore()}break;case Ii:t.save();try{t.pen.color=this.borderColor,t.pen.width=1,t.rectangleRect(o),i.has(yi)?(t.pen.color=this.textColor,t.beginPath(),t.moveTo(o.left+3,o.top+this.checkBoxWidth/2),t.lineTo(o.left-2+this.checkBoxWidth/2,o.bottom-3),t.lineTo(o.right-3,o.top+3),t.paintPath()):i.has(pi)&&(t.pen.color=this.textColor,t.beginPath(),t.moveTo(o.left+3,o.top+3),t.lineTo(o.right-3,o.bottom-3),t.moveTo(o.left+3,o.bottom-3),t.lineTo(o.right-3,o.top+3),t.paintPath())}finally{t.restore()}}}},{key:"getHoverHintSize",value:function(t){return{width:this.marginSpace+Dt.textWidth(Dt.DefaultFont,t)+this.marginSpace,height:this.marginSpace+Dt.DefaultFont.height+this.marginSpace}}},{key:"drawHoverHint",value:function(t,e){t.brush.color=this.backgroundStaticColor;var i=U.CreateByRect(e.rect);i.right--,i.bottom--,t.fillRect(i),t.pen.color=this.borderColor,t.pen.width=1,t.beginPath(),t.moveTo(i.left,i.top),t.lineTo(i.right,i.top),t.lineTo(i.right,i.bottom),t.lineTo(i.left,i.bottom),t.lineTo(i.left,i.top),t.paintPath(),t.pen.color=this.ShadowColor,t.beginPath(),t.moveTo(i.left+2,i.bottom+1),t.lineTo(i.right+1,i.bottom+1),t.lineTo(i.right+1,i.top+2),t.paintPath(),t.font.assign(Dt.DefaultFont),t.textOut(e.rect.left+this.marginSpace,e.rect.top+this.marginSpace,e.text)}},{key:"drawDesign",value:function(t,e,i,n,o){t.brush.color=this.backgroundSelectColor,t.fillBounds(e-2,i-2,4,4);var r=e+Math.trunc(n/2);t.fillBounds(r-2,i-2,4,4),t.fillBounds(e+n-2,i-2,4,4);var s=i+Math.trunc(o/2);t.fillBounds(e+n-2,s-2,4,4),t.fillBounds(e+n-2,i+o-2,4,4),t.fillBounds(r-2,i+o-2,4,4),t.fillBounds(e-2,i+o-2,4,4),t.fillBounds(e-2,s-2,4,4)}},{key:"drawShadow",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.brush.color=this.ShadowColor,i){t.save();try{t.clip(e.left-this.shadow,e.top,e.width+this.shadow+this.shadow,e.bottom+this.shadow),t.fillRectShadow(e,this.shadow)}finally{t.restore()}}else t.fillRectShadow(e,this.shadow)}},{key:"path",get:function(){return this._path},set:function(t){this._path!=t&&(this._path=t,this.expandImage.src=this.path+"image/minus.png",this.foldImage.src=this.path+"image/plus.png",this.closeImage.src=this.path+"image/close.png")}}])&&Io(e.prototype,i),n&&Io(e,n),t}();function wo(t){return(wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Co(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ko(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Po(t,e,i){return e&&ko(t.prototype,e),i&&ko(t,i),t}function Do(t,e){return(Do=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function bo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=_o(t);if(e){var o=_o(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ro(this,i)}}function Ro(t,e){return!e||"object"!==wo(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _o(t){return(_o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xo=1,Ao=2,To=3,Oo=4,No=5,Bo=7,Eo=8,Mo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Do(t,e)}(i,t);var e=bo(i);function i(){var t;return Co(this,i),(t=e.call(this))._customFormatID=Eo,t._opening=!1,t._formats=new V,t._datas=new V,t}return Po(i,[{key:"_getFormatIndex",value:function(t){for(var e=0;e<this._formats.count;e++)if(this._formats[e]==t)return e;return-1}},{key:"setFormatData",value:function(t,e){var i=this._getFormatIndex(t);i<0?(this._formats.add(t),this._datas.add(e)):(this._formats[i]=t,this._datas[i]=e)}},{key:"removeFormat",value:function(t){var e=this._getFormatIndex(t);e>=0&&(this._formats.delete(e),this._datas.delete(e))}},{key:"hasFormat",value:function(t){return this._getFormatIndex(t)>=0}},{key:"clear",value:function(){this._formats.clear(),this._datas.clear()}},{key:"registerFormat",value:function(){return this._customFormatID++}},{key:"getData",value:function(t){var e=this._getFormatIndex(t);return e>=0?this._datas[e]:null}},{key:"getAnsiText",value:function(){var t=this._getFormatIndex(xo);return t>=0?_.getString(this._datas[t]):null}},{key:"getUnicodeText",value:function(){var t=this._getFormatIndex(Ao);return t>=0?A.getString(this._datas[t]):null}},{key:"getText",value:function(){var t=this.getUnicodeText();return null==t&&(t=this.getAnsiText()),t}},{key:"setText",value:function(t){this.setFormatData(Ao,A.getBytes(t))}},{key:"setEncodeText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F.Utf16;e==F.Ansi?this.setFormatData(xo,_.getBytes(t)):this.setFormatData(Ao,A.getBytes(t))}},{key:"getEncodeText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F.Utf16;switch(t){case F.Ansi:return this.getAnsiText();case F.Unicode:return this.getUnicodeText();default:var e=this._getFormatIndex(Ao);return x.getString(this._datas[e])}}},{key:"toBrowerClipboard",value:function(t){var e=document.createElement("input");try{document.body.appendChild(e),e.setAttribute("value",t),e.setAttribute("readonly","readonly"),e.select(),document.execCommand("copy")}finally{document.body.removeChild(e)}}},{key:"fromBrowerClipboard",value:function(){}}]),i}(L),Lo=function(){function t(){Co(this,t)}return Po(t,[{key:"removeItem",value:function(t){localStorage.removeItem(t)}},{key:"setString",value:function(t,e){localStorage.setItem(t,e)}},{key:"getString",value:function(t){return localStorage.getItem(t)}},{key:"setStream",value:function(t,e){this.setString(t,e.buffer.toString())}},{key:"getStream",value:function(t){for(var e=this.getString(t).split(","),i=new K,n=0,o=e.length;n<o;n++)i.writeByte(e[n]);return i.position=0,i}},{key:"getBytes",value:function(t){return this.getStream(t).buffer}},{key:"removeKey",value:function(t){localStorage.removeItem(t)}},{key:"hasKey",value:function(t){for(var e=0;e<localStorage.length;e++)if(localStorage.key(e)==t)return!0;return!1}},{key:"clear",value:function(){localStorage.clear()}}]),t}();function Go(t){return(Go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ho(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Uo(t,e){return(Uo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=zo(t);if(e){var o=zo(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Wo(this,i)}}function Wo(t,e){return!e||"object"!==Go(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function zo(t){return(zo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var jo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Uo(t,e)}(r,t);var e,i,n,o=Vo(r);function r(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this))._updateCount=0,t._runing=!1,t.icon=new Image(16,16),t.forms=new V,t.forms.onAdded=function(e){1==t.forms.count&&(t.mainForm=e)},t._activeForm=null,t._captureControl=null,t._mouseMoveForm=null,t.title="HCL Application",t.mainForm=null,t.hclDesignControl=null,t.hclDesignPt=new G,t.hclDesignDown=!1,t}return e=r,(i=[{key:"_getActiveForm",value:function(){for(var t=this.forms.count-1;t>=0;t--)if(this.forms[t].visible)return this.forms[t];return null}},{key:"_showForm",value:function(t){this.beginUpdate();try{null!=this._activeForm&&this._activeForm.deactivate(),this._mouseMoveForm=t,this._activeForm=t,t.activate()}finally{this.endUpdate()}}},{key:"_hideForm",value:function(t){this.beginUpdate();try{null!=this._activeForm&&this._activeForm.deactivate(),this._activeForm=this._getActiveForm(),null!=this._activeForm&&this._activeForm.activate()}finally{this.endUpdate()}}},{key:"_resize_",value:function(){this.mainForm&&(this.mainForm.width=or.width,this.mainForm.height=or.height)}},{key:"setFocusControl_",value:function(t,e){}},{key:"killFocusControl_",value:function(t){or._killFocusControl_(this,t)}},{key:"hclSelectControl",value:function(t){this.hclDesignControl=t!==this?t:null,or.update()}},{key:"controlVisible_",value:function(t,e){e?this._showForm(t):this._hideForm(t)}},{key:"doRequestFocus_",value:function(){return!0}},{key:"beginUpdate",value:function(){this._updateCount++}},{key:"endUpdate",value:function(){this._updateCount>0&&(this._updateCount--,0==this._updateCount&&this.update())}},{key:"addControl",value:function(t){this.addForm(t)}},{key:"addForm",value:function(t){t.isClass(oo)?(this.forms.add(t),t.added_(this)):or.exception("application只能添加TCustomForm的子类!")}},{key:"removeControl",value:function(t){this.beginUpdate();try{this.forms.remove(t),t.removed_(),this._activeForm=this._getActiveForm(),null!=this._activeForm&&this._activeForm.activate()}finally{this.endUpdate()}}},{key:"getFormAt",value:function(t,e){for(var i=null,n=this.forms.count-1;n>=0;n--)if((i=this.forms[n]).visible&&i.bounds().pointInAt(t,e))return i;return null}},{key:"getControlAtPos",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getFormAt(t,e);return null!=n?(t-=n.left,e-=n.top,n.getControlAtPos(t,e,i)):null}},{key:"pointAtDesignControl",value:function(t,e){if(null!=this.hclDesignControl){var i=this.hclDesignControl.clientToScreen(G.Create(0,0)),n=this.hclDesignControl.clientRect();if(n.offset(i.x,i.y),n.pointInAt(t,e))return!0}return!1}},{key:"removeForm",value:function(t){this.removeControl(t)}},{key:"setCapture",value:function(t){this._captureControl=t}},{key:"releaseCapture",value:function(){this._captureControl=null}},{key:"clientToScreen",value:function(t){return t}},{key:"mouseWheel",value:function(t){this._activeForm=this._mouseMoveForm;var e=new ei;e.assign(t),e.x-=this._mouseMoveForm.left,e.y-=this._mouseMoveForm.top,this._mouseMoveForm.mouseWheel(e)}},{key:"mouseDown",value:function(t){if(this._activeForm=this._mouseMoveForm,this._mouseMoveForm){var e=new ei;e.assign(t),e.x-=this._mouseMoveForm.left,e.y-=this._mouseMoveForm.top,this._mouseMoveForm.mouseDown(e)}if(or.design&&this.pointAtDesignControl(t.x,t.y))return this.hclDesignPt.reset(t.x,t.y),this.hclDesignDown=t.button==ee,void(null!=this._activeForm&&this._activeForm.deactivate())}},{key:"doMouseMoveFromChange",value:function(t){this._mouseMoveForm!==t&&(null!==this._mouseMoveForm&&this._mouseMoveForm.mouseLeave(),this._mouseMoveForm=t,null!==this._mouseMoveForm&&this._mouseMoveForm.mouseEnter())}},{key:"doFormMouseMove",value:function(t){for(var e=null,i=this.forms.count-1;i>=0;i--)if((e=this.forms[i]).visible){if(e.showState==eo)return this.doMouseMoveFromChange(e),t.x-=e.left,t.y-=e.top,void e.mouseMove(t);if(e.bounds().pointInAt(t.x,t.y))return this.doMouseMoveFromChange(e),t.x-=e.left,t.y-=e.top,void e.mouseMove(t)}}},{key:"doCaptureMouseMove",value:function(t){this.doMouseMoveFromChange(this._captureControl);var e=this._captureControl.clientToScreen(G.Create(0,0));t.x-=e.x,t.y-=e.y,this._captureControl.mouseMove(t)}},{key:"mouseMove",value:function(t){if(or.design){if(this.hclDesignDown)return this.hclDesignControl.left+=t.x-this.hclDesignPt.x,this.hclDesignControl.top+=t.y-this.hclDesignPt.y,void this.hclDesignPt.reset(t.x,t.y);this.pointAtDesignControl(t.x,t.y)}null!=this._captureControl?this.doCaptureMouseMove(t):this.doFormMouseMove(t)}},{key:"doCaptureMouseUp",value:function(t){var e=this._captureControl.clientToScreen(G.Create(0,0));t.x-=e.x,t.y-=e.y,this._captureControl.mouseUp(t)}},{key:"doMouseUp",value:function(t){if(null!=this._activeForm)return t.x-=this._activeForm.left,t.y-=this._activeForm.top,void this._activeForm.mouseUp(t);this._mouseMoveForm&&(t.x-=this._mouseMoveForm.left,t.y-=this._mouseMoveForm.top,this._mouseMoveForm.mouseUp(t))}},{key:"mouseUp",value:function(t){or.design&&(this.hclDesignDown=!1,this.pointAtDesignControl(t.x,t.y))||(null!=this._captureControl?this.doCaptureMouseUp(t):this.doMouseUp(t))}},{key:"mouseEnter",value:function(t){null!=this._activeForm&&this._activeForm.mouseEnter()}},{key:"mouseLeave",value:function(t){null!=this._activeForm&&this._activeForm.mouseLeave()}},{key:"dblClick",value:function(t){if(null!=this._activeForm){var e=new ei;e.assign(t),e.x-=this._activeForm.left,e.y-=this._activeForm.top,this._activeForm.dblClick(e)}}},{key:"keyDown",value:function(t){if(or.design&&null!=this.hclDesignControl)switch(t.keyCode){case Be:return void this.hclDesignControl.left--;case Ee:return void this.hclDesignControl.top--;case Me:return void this.hclDesignControl.left++;case Le:return void this.hclDesignControl.top++;case Ae:return void this.hclSelectControl(this.hclDesignControl.parent)}null!=this._activeForm?this._activeForm.keyDown(t):this.mainForm.keyDown(t)}},{key:"keyPress",value:function(t){null!=this._activeForm?this._activeForm.keyPress(t):this.mainForm.keyPress(t)}},{key:"keyUp",value:function(t){null!=this._activeForm?this._activeForm.keyUp(t):this.mainForm.keyUp(t)}},{key:"copy",value:function(t){null!=this._activeForm?this._activeForm.copy(t):this.mainForm.copy(t)}},{key:"cut",value:function(t){null!=this._activeForm?this._activeForm.cut(t):this.mainForm.cut(t)}},{key:"paste",value:function(t){null!=this._activeForm?this._activeForm.paste(t):this.mainForm.paste(t)}},{key:"update",value:function(){this.updateRect(U.CreateByBounds(0,0,or.width,or.height))}},{key:"updateRect",value:function(t){this._updateCount>0||or.updateRect(t)}},{key:"createCaret",value:function(t,e,i,n){or.__createCaret(t,e,i,n)}},{key:"setCaretPos",value:function(t,e){or._setCaretPos_(t,e)}},{key:"setCursorBy",value:function(t){or._setCursorBy_(t)}},{key:"showCaret",value:function(t){or._showCaret_(t)}},{key:"hideCaret",value:function(t){or._hideCaret_(t)}},{key:"destroyCaret",value:function(t){or._destroyCaret_(t)}},{key:"trackPopupControl",value:function(t,e){or._trackPopupControl_(t,e)}},{key:"closePopupControl",value:function(t){or._closePopupControl_(t)}},{key:"paint",value:function(t){if(0!==this.forms.count&&!(this._updateCount>0)){for(var e=null,i=0;i<this.forms.count;i++)if(!((e=this.forms[i]).showState<$n)){t.save();try{e.showState==eo&&(t.alpha=.5,t.brush.color=at.Black,t.fillBounds(0,0,or.width,or.height),t.alpha=1),t.translate(e.left,e.top),t.clip(-or.theme.shadow,-or.theme.shadow,e.width+or.theme.shadow+or.theme.shadow,e.height+or.theme.shadow+or.theme.shadow),e.paint(t)}finally{t.restore()}}if(or.design&&null!=this.hclDesignControl){var n=this.hclDesignControl.clientToScreen(G.Create(0,0));or.theme.drawDesign(t,n.x,n.y,this.hclDesignControl.width,this.hclDesignControl.height)}}}},{key:"broadcast",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.forms.count-1;n>=0;n--)this.forms[n].broadcast(t,e,i)}},{key:"run",value:function(){or.applicationRun(),this._runing=!0,this.mainForm&&this.mainForm.show()}},{key:"runing",get:function(){return this._runing}}])&&Ho(e.prototype,i),n&&Ho(e,n),r}(L);function Xo(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ko(t){return(Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Zo(t,e)}function Zo(t,e){return(Zo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=$o(t);if(e){var o=$o(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Qo(this,i)}}function Qo(t,e){return!e||"object"!==Ko(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function $o(t){return($o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var tr={Chrome:1,Firefox:2,Safari:3,Opera:4,IE:5},er=function(t){Jo(i,t);var e=qo(i);function i(t){var n;return Yo(this,i),(n=e.call(this)).text=t,n}return i}(L),ir=function(t){Jo(i,t);var e=qo(i);function i(){var t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Yo(this,i),(t=e.call(this,n)).rect=U.CreateByBounds(0,0,300,20),t}return i}(V),nr=function(t){Jo(r,t);var e,i,n,o=qo(r);function r(){var t;return Yo(this,r),(t=o.call(this)).debug=!1,t.meaChr=!1,t.brower=t.__GetBrowerType(),t.system=new C,t.ime=new Li,t.clipboard=new Mo,t.localStorage=new Lo,t.theme=new go,t.theme.onImageLoad=function(){t.update()},t._curApplication=null,t._updateCount=0,t._handleSeq=1e3,t._cursorPos=new G,t._cursor=oe,t._cursorControl=null,t._caret=new ti,t._idle=!1,t._idleInterval=new Ti(500),t._idleInterval.loop=!0,t._idleInterval.onExecute=function(){t._doIdle()},t._idleInterval.enabled=!0,t.keyDownStates=new Array(255),t.width_=854,t.height_=400,t.left_=t._getAdjustLeft(),t.top_=0,t.design_=!1,t._focus=!1,t._mouseIn=!1,t._horizontalCenter=!0,t._autoWidth=!1,t._autoHeight=!0,t._focusLayer=null,t._captureLayer=null,t._mouseMoveLayer=null,t._capturePopupControl=null,t._mouseMovePopupControl=null,t._waitList=new ir,t._waitList.onAdded=function(e){t.update()},t._waitList.onRemoved=function(){t.update()},t._applicationLayer=new V,t._popupLayer=new V,t._popupLayer.onAdded=function(e){t.update()},t._popupLayer.onRemoved=function(e){e.clear(),t.update()},t.__windowKeyDown=function(e){t.windowKeyDown_(e)},t.__windowKeyPress=function(e){t.windowKeyPress_(e)},t.__windowKeyUp=function(e){t.windowKeyUp_(e)},t.__windowResize=function(e){t.windowResize_(e)},t.__windowFocus=function(e){t.windowFocus_(e)},t.__windowFocuOut=function(e){t.windowFocusOut_(e)},t.__windowMouseMove=function(e){t.windowMouseMove_(e)},t.__windowMouseDown=function(e){t.windowMouseDown_(e)},t.__windowMouseWheel=function(e){e.target===t._hclH5Canvas&&t._mouseWheel(e)},t.__windowLoad=function(e){t.windowLoad_(e)},t.__windowDocVisibilitychange=function(e){t.windowDocVisibilitychange_(e)},t.__windowDocCopy=function(e){t.windowDocCopy_(e)},t.__windowDocCut=function(e){t.windowDocCut_(e)},t.__windowDocPaste=function(e){t.windowDocPaste_(e)},t._hoverHintInfo=new Oi,t._scale=1,t._hclH5Canvas=null,t._hclCanvas=null,t._appH5Canvas=null,t._appCanvas=null,t._popupH5Canvas=null,t._popupCanvas=null,t.parentElement=null,t.textMetrics=new V,t}return e=r,n=[{key:"createInstance",value:function(){or||(or=new r)}},{key:"disposeInstance",value:function(){or&&(or.dispose(),or=null)}}],(i=[{key:"textMetricsIndexOf",value:function(t,e,i){for(var n=null,o=0;o<this.textMetrics.count;o++)if((n=this.textMetrics[o]).name==t&&n.size==e&&n.styles==i)return o;return-1}},{key:"__GetBrowerType",value:function(){var t=window.navigator.userAgent;return window.ActiveXObject||"ActiveXObject"in window?(null==CanvasRenderingContext2D.prototype.ellipse&&(CanvasRenderingContext2D.prototype.ellipse=function(t,e,i,n,o,r,s,a){this.save(),this.translate(t,e),this.rotate(o||0),this.scale(i,n),this.arc(0,0,1,r||0,s||Math.PI,a||!0),this.restore()}),tr.IE):t.indexOf("Firefox")>=0?tr.FireFox:t.indexOf("Chrome")>=0?tr.Chrome:t.indexOf("Opera")>=0?tr.Opera:t.indexOf("Safari")>=0?tr.Safari:void 0}},{key:"__createCaret",value:function(t,e,i,n){if(this._resetCaret_(),this._caret.reset(),this._caret.control=t,this._focusLayer=this._applicationLayer,this._popupLayer.count>0)for(var o=this._caret.control.parent;null!=o;){if(o.isClass(wi)){this._focusLayer=this._popupLayer;break}o=o.parent}this._caret.image=e,i>0&&(this._caret.width=i),n>t.height?this._caret.height=t.height:this._caret.height=n}},{key:"_setCaretPos_",value:function(t,e){if(null!=this._caret.control){this._resetCaret_();var i=this._caret.control.clientToScreenAt(0,0);this._caret.left=i.x+t,this._caret.top=i.y+e,this._caret.controlScreenRect.resetBounds(i.x,i.y,this._caret.control.width,this._caret.control.height)}}},{key:"_showCaret_",value:function(t){this._focus&&null!=this._caret.control&&(this._caret.visible=!0)}},{key:"_hideCaret_",value:function(t){this._caret.control==t&&this._caret.visible&&(this._resetCaret_(),this._caret.visible=!1)}},{key:"_destroyCaret_",value:function(t){this._caret.control==t&&(this._hideCaret_(t),this._caret.control=null)}},{key:"_paintCaretShan",value:function(){this._hclCanvas.brush.color=this._caret.color,this._hclCanvas.fillRect(this._caret.rect.intersection(this._caret.controlScreenRect)),this._popupLayer.count>0&&this._focusLayer!=this._popupLayer&&this._hclCanvas.bitBlt(this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2,this._popupCanvas,this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2)}},{key:"_doCaretShan_",value:function(){this._caret.shan=!1,this._paintCaretShan(),this._hoverHintInfo.visible&&this._hoverHintInfo.rect.isIntersect(this._caret.rect)&&this._paintHintLayer()}},{key:"_paintCaretShuo",value:function(){this._hclCanvas.bitBlt(this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2,this._appCanvas,this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2),this._popupLayer.count>0&&this._focusLayer!=this._popupLayer&&this._hclCanvas.bitBlt(this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2,this._popupCanvas,this._caret.left,this._caret.top-1,this._caret.width,this._caret.height+2)}},{key:"_doCaretShuo_",value:function(){this._caret.shan=!0,this._paintCaretShuo(),this._hoverHintInfo.visible&&this._hoverHintInfo.rect.isIntersect(this._caret.rect)&&this._paintHintLayer()}},{key:"_resetCaret_",value:function(){this._caret.visible&&!this._caret.shan&&this._doCaretShuo_()}},{key:"_doCaretTimer_",value:function(){this._caret.visible&&(this._caret.shan?this._doCaretShan_():this._doCaretShuo_())}},{key:"_closeHoverHint",value:function(){this._hoverHintInfo.visible&&(this._hoverHintInfo.visible=!1,this.updateRect(this._hoverHintInfo.rect))}},{key:"showHoverHint",value:function(t){if(this._hoverHintInfo.visible){if(this._hoverHintInfo.control===t)return;this._hoverHintInfo.visible=!1,this.updateRect(this._hoverHintInfo.rect)}if(this._hoverHintInfo.control=t,this._hoverHintInfo.text=t.hint,""!=this._hoverHintInfo.text){if(this._hoverHintInfo.rect=t.getHintRect(),this._hoverHintInfo.rect){var e=t.clientToScreenAt(0,0);this._hoverHintInfo.rect.bottom+this._hoverHintInfo.rect.height+e.y+this.theme.marginSpace>this.height_?this._hoverHintInfo.rect.offset(e.x,e.y-this._hoverHintInfo.rect.height-this.theme.marginSpace):this._hoverHintInfo.rect.offset(e.x,e.y+this._hoverHintInfo.rect.height+this.theme.marginSpace),this._hoverHintInfo.rect.resetSize(this.theme.getHoverHintSize(this._hoverHintInfo.text)),this._hoverHintInfo.rect.left<0?e.x=this._hoverHintInfo.rect.left:this._hoverHintInfo.rect.right>this.width_?e.x=this._hoverHintInfo.rect.right-this.width_:e.x=0,this._hoverHintInfo.rect.top<0?e.y=this._hoverHintInfo.rect.top:this._hoverHintInfo.rect.bottom>this.height_?e.y=this._hoverHintInfo.rect.bottom-this.height_:e.y=0,this._hoverHintInfo.rect.offset(-e.x,-e.y)}else{var i=this.theme.getHoverHintSize(this._hoverHintInfo.text);this._hoverHintInfo.rect=U.CreateByBounds(this.cursorPos.x,this.cursorPos.y+this.theme.itemHeight,i.width,i.height)}this._hoverHintInfo.visible=!0,this.updateRect(this._hoverHintInfo.rect)}}},{key:"_doIdle",value:function(){this._doCaretTimer_(),this._idle&&this._mouseIn?null!=this._cursorControl&&this.showHoverHint(this._cursorControl):this._idle=!0}},{key:"_cancelIdle",value:function(){this._idle=!1,this._closeHoverHint()}},{key:"_setCursorBy_",value:function(t){this._getControlAtPos(this._cursorPos.x,this._cursorPos.y)===t&&(this._cursorControl=t,this._cursor!=t.cursor&&(this._cursor=t.cursor,this._hclH5Canvas.style.cursor=this.theme.getCSSCursor(this._cursor)))}},{key:"_isPreventKeyDown",value:function(t){return t==Pe||t==Ge||t==Be||t==Me||t==Ee||t==Le||t==be||t==Ne||t==Oe||t==De}},{key:"_setFocus",value:function(){this._focus=!0,this._idleInterval.enabled||(this._idleInterval.enabled=!0)}},{key:"_killFocus",value:function(){this._focus=!1,this._caret.visible=!1,null!=this._caret.control&&this._caret.control.killFocus(),this._idleInterval.enabled&&(this._idleInterval.enabled=!1,this._cancelIdle()),this.ime.killFocus()}},{key:"_killFocusControl_",value:function(t,e){this._caret.visible&&this._destroyCaret_(this._caret.control),this.ime.removeControl(e)}},{key:"_closePopupControl_",value:function(t){if(null!=t){t.closePopup();var e=t.popupLinkedList;if(null!=t.forward){for(var i,n=t;null!==n.next;)n=n.next;for(;n!==t;)(i=n.forward).next=null,n.forward=null,n.closePopup(),e.remove(n),n=i;t.forward.next=null,t.forward=null,e.remove(t),this.update(),0==e.count&&(this._popupLayer.remove(e),this._reAdjustMouseMove())}else this._popupLayer.remove(e),this.update(),this._reAdjustMouseMove()}}},{key:"_trackPopupControl_",value:function(t,e){var i=this,n=Math.min(this.width_,this._getViewPortWidth()),o=Math.min(this.height_,this._getViewPortHeight());if(e){t.adjustPosition&&(t.left+t.width+this.theme.shadow>n&&(t.left=n-t.width-this.theme.shadow),t.top+t.height+this.theme.shadow>o&&(t.top=o-t.height-this.theme.shadow));var r=new V;r.onAdded=function(t){i.update()},r.onRemoved=function(t){t.onClose()},t.popupLinkedList=r,r.add(t),this._popupLayer.add(r)}else this._popupLayer.count>0&&(t.forward=this._popupLayer.last.last,this._popupLayer.last.last.next=t,t.adjustPosition&&(t.left+t.width+this.theme.shadow>n&&(t.left=t.forward.left-t.width),t.top+t.height+this.theme.shadow>o&&(t.top=o-t.height-this.theme.shadow)),t.popupLinkedList=this._popupLayer.last,this._popupLayer.last.add(t));this._reAdjustMouseMove()}},{key:"_getControlAtPos",value:function(t,e){var i=this._getPopupControlAtPos(t,e);return null!==i?i:this.application.getControlAtPos(t,e)}},{key:"_reAdjustMouseMove",value:function(){var t=new ei;t.x=this._cursorPos.x,t.y=this._cursorPos.y,this._mouseMove(t)}},{key:"_getPopupControlAt",value:function(t,e){if(this._popupLayer.count>0)for(var i=null,n=this._popupLayer.count-1;n>=0;n--)for(var o=(i=this._popupLayer[n]).count-1;o>=0;o--)if(i[o].bounds().pointInAt(t,e))return i[o];return null}},{key:"_popupMouseWheel",value:function(t){var e=this._mouseMovePopupControl;if(null!==e){var i=new ei;return i.assign(t),i.x-=e.left,i.y-=e.top,e.mouseWheel(i),!0}return!1}},{key:"_popupMouseDown",value:function(t){if(this._capturePopupControl=this._getPopupControlAt(t.x,t.y),null!==this._capturePopupControl)return t.x-=this._capturePopupControl.left,t.y-=this._capturePopupControl.top,this._capturePopupControl.mouseDown(t),!0;if(this._popupLayer.count>0)for(var e=this._popupLayer.count-1;e>=0;e--)this._closePopupControl_(this._popupLayer[e].first);return!1}},{key:"_waitListResponsive",value:function(t){return this._waitList.count>0&&this._waitList.rect.pointInAt(t.x,t.y)}},{key:"_waitListMouseDown",value:function(t){return this._waitListResponsive(t)}},{key:"_waitListMouseMove",value:function(t){return!!this._waitListResponsive(t)&&(this._cursor=re,this._hclH5Canvas.style.cursor=this.theme.getCSSCursor(this._cursor),!0)}},{key:"_waitListMouseUp",value:function(t){return!!this._waitListResponsive(t)&&(this._waitList.delete(this._waitList.count-1),this.update(),!0)}},{key:"_popupMouseMove",value:function(t){if(null!==this._capturePopupControl){var e=new ei;return e.assign(t),e.x-=this._capturePopupControl.left,e.y-=this._capturePopupControl.top,this._capturePopupControl.mouseMove(e),!0}var i=this._getPopupControlAt(t.x,t.y);if(i!=this._mouseMovePopupControl&&(null!=this._mouseMovePopupControl&&this._mouseMovePopupControl.mouseLeave(),this._mouseMovePopupControl=i,null!=this._mouseMovePopupControl&&this._mouseMovePopupControl.mouseEnter()),null!==this._mouseMovePopupControl){var n=new ei;return n.assign(t),n.x-=this._mouseMovePopupControl.left,n.y-=this._mouseMovePopupControl.top,this._mouseMovePopupControl.mouseMove(n),!0}return!1}},{key:"_popupMouseUp",value:function(t){if(null!==this._capturePopupControl){var e=new ei;return e.assign(t),e.x=t.x-this._capturePopupControl.left,e.y=t.y-this._capturePopupControl.top,this._capturePopupControl.mouseUp(e),this._capturePopupControl=null,this._mouseMovePopupControl=null,!0}var i=this._mouseMovePopupControl;return null!==i&&(t.x-=i.left,t.y-=i.top,i.mouseUp(t),!0)}},{key:"_popupKeyDown",value:function(t){return this._focusLayer==this._popupLayer&&(null!=this._caret.control&&this._caret.control.keyDown(t),!0)}},{key:"_popupKeyPress",value:function(t){return this._focusLayer==this._popupLayer&&(null!=this._caret.control&&this._caret.control.keyPress(t),!0)}},{key:"_getPopupControlAtPos",value:function(t,e){var i=this._getPopupControlAt(t,e);return null!==i?i.getControlAtPos(t-i.left,e-i.top):null}},{key:"windowKeyDown_",value:function(t){this._focus&&this._keyDown(t)}},{key:"windowKeyPress_",value:function(t){this._focus&&this._keyPress(t)}},{key:"windowKeyUp_",value:function(t){this._focus&&this._keyUp(t)}},{key:"windowResize_",value:function(t){this.resize()}},{key:"windowFocus_",value:function(t){this._clearKeyState()}},{key:"windowFocusOut_",value:function(t){t.relatedTarget!=this.ime._input&&t.relatedTarget!=this._hclH5Canvas&&this._killFocus()}},{key:"_removeBindEvent",value:function(){window.removeEventListener("keydown",this.__windowKeyDown),window.removeEventListener("keypress",this.__windowKeyPress,!1),window.removeEventListener("keyup",this.__windowKeyUp),window.removeEventListener("resize",this.__windowResize),window.removeEventListener("focus",this.__windowFocus),window.removeEventListener("focusout",this.__windowFocuOut),window.removeEventListener("mousedown",this.__windowMouseDown),window.removeEventListener("mousemove",this.__windowMouseMove),window.removeEventListener("load",this.__windowLoad),window.document.removeEventListener("visibilitychange",this.__windowDocVisibilitychange),window.document.removeEventListener("copy",this.__windowDocCopy),window.document.removeEventListener("cut",this.__windowDocCut),window.document.removeEventListener("paste",this.__windowDocPaste),this.brower==tr.Firefox&&window.removeEventListener("DOMMouseScroll",this.__windowMouseWheel)}},{key:"_initBindEvent",value:function(){var t=this;this._removeBindEvent(),window.addEventListener("keydown",this.__windowKeyDown,!1),window.addEventListener("keypress",this.__windowKeyPress,!1),window.addEventListener("keyup",this.__windowKeyUp,!1),window.addEventListener("resize",this.__windowResize,!1),window.addEventListener("focus",this.__windowFocus,!1),window.addEventListener("focusout",this.__windowFocuOut,!1),window.addEventListener("mousedown",this.__windowMouseDown,!1),window.addEventListener("mousemove",this.__windowMouseMove,!1),window.addEventListener("load",this.__windowLoad,!1),window.document.addEventListener("visibilitychange",this.__windowDocVisibilitychange,!1),window.document.addEventListener("copy",this.__windowDocCopy,!1),window.document.addEventListener("cut",this.__windowDocCut,!1),window.document.addEventListener("paste",this.__windowDocPaste,!1),this._hclH5Canvas.onmousedown=function(e){t._focus||t.windowMouseDown_(e),t._mouseDown(t._makeMouseEventArgs(e))},this._hclH5Canvas.onmousemove=function(e){t._mouseMove(t._makeMouseEventArgs(e))},this._hclH5Canvas.onmouseup=function(e){var i=t._makeMouseEventArgs(e);0===e.buttons&&(0===e.button?i.button=ee:1===e.button?i.button=ne:2===e.button&&(i.button=ie)),t._mouseUp(i)},this._hclH5Canvas.onmouseenter=function(e){t._mouseEnter(t._makeMouseEventArgs(e))},this.brower==tr.Firefox?window.addEventListener("DOMMouseScroll",this.__windowMouseWheel,!1):this._hclH5Canvas.onmousewheel=function(e){t._mouseWheel(e)},this._hclH5Canvas.onmouseleave=function(e){t._mouseLeave(t._makeMouseEventArgs(e))},this._hclH5Canvas.ondblclick=function(e){t._dblClick(t._makeMouseEventArgs(e))},this._parentElement===document.body&&(document.body.parentNode.style.overflowY="hidden"),this._parentElement.oncontextmenu=function(t){t.returnValue=!1},this.ime.__hclLoaded(this)}},{key:"windowMouseDown_",value:function(t){t.target!=this._hclH5Canvas?this._killFocus():this._setFocus()}},{key:"windowMouseMove_",value:function(t){t.target!=this._hclH5Canvas?(this._mouseIn=!1,this._cancelIdle()):this._mouseIn=!0}},{key:"windowLoad_",value:function(t){this._loaded=!0,t.preventDefault()}},{key:"windowDocVisibilitychange_",value:function(t){window.document.hidden?this._deactivate():this._activate(),t.preventDefault()}},{key:"windowDocCopy_",value:function(t){this._focus&&(this._copy(t),t.preventDefault())}},{key:"windowDocCut_",value:function(t){this._focus&&(this._cut(t),t.preventDefault())}},{key:"windowDocPaste_",value:function(t){this._focus&&(this._paste(t),t.preventDefault())}},{key:"dispose",value:function(){this._removeBindEvent(),null!=this._parentElement&&(this.ime.__hclUnLoaded(this),this._parentElement.removeChild(this._hclH5Canvas)),this.ime=null,this.system=null,this.clipboard=null,this.localStorage.clear(),this.localStorage=null,this.theme=null}},{key:"_windowToCanvas",value:function(t,e,i){var n=t.getBoundingClientRect();return{x:(e-n.left)*(t.width/n.width)/this._scale,y:(i-n.top)*(t.height/n.height)/this._scale}}},{key:"_getAdjustLeft",value:function(){var t=(this._getViewPortWidth()-this.width_)/2;return this._loaded&&t<this._parentElement.clientLeft&&(t=this._parentElement.clientLeft),0}},{key:"_getViewPortWidth",value:function(){return null!=this._parentElement&&this._parentElement!=document.body?this._parentElement.clientWidth:document.documentElement.clientWidth||document.body.clientWidth}},{key:"_getViewPortHeight",value:function(){return null!=this._parentElement&&this._parentElement!=document.body?this._parentElement.clientHeight:document.documentElement.clientHeight||document.body.clientHeight}},{key:"applicationRun",value:function(){this._parentElement||(this.parentElement=document.body),this.resize()}},{key:"resize",value:function(){if(this._parentElement){this.beginUpdate();try{this._autoWidth?(this.left_=0,this.width_=this._getViewPortWidth()):this._horizontalCenter&&(this.left_=this._getAdjustLeft()),this._autoHeight&&(this.height_=this._getViewPortHeight()),this._hclH5Canvas.style.left!=this.left_+"px"&&(this._hclH5Canvas.style.left=this.left_+"px"),Dt._setViewSize_(this.width_,this.height_),this._hclH5Canvas.width=this.width_,this._hclH5Canvas.height=this.height_,this._hclCanvas.prepareConext(this._scale),this._appH5Canvas.width=this.width_,this._appH5Canvas.height=this.height_,this._appCanvas.prepareConext(this._scale),this._popupH5Canvas.width=this.width_,this._popupH5Canvas.height=this.height_,this._popupCanvas.prepareConext(this._scale),null!=this.application&&this.application._resize_()}finally{this.endUpdate()}}}},{key:"_paintWaitList",value:function(){if(this._waitList.count>0){this._hclCanvas.font.name="宋体",this._hclCanvas.font.size=12,this._hclCanvas.font.color="white",this._hclCanvas.brush.color="black";var t=this._hclCanvas.alpha;this._hclCanvas.alpha=.6,this._hclCanvas.fillRect(this._waitList.rect),this._hclCanvas.alpha=t,this._hclCanvas.textOut(2,2,"["+this._waitList.count.toString()+"] "+this._waitList.last.text)}}},{key:"_paintApplicationLayer",value:function(t){this._appCanvas.save();try{this._appCanvas.clearRect(t),this._appCanvas.clipRect(t),this.application.paint(this._appCanvas)}finally{this._appCanvas.restore()}this._hclCanvas.bitBltRect(t,this._appCanvas,t)}},{key:"_paintPopupLayer",value:function(t){if(0!=this._popupLayer.count){this._popupCanvas.clearRect(t);for(var e=null,i=null,n=0;n<this._popupLayer.count;n++){e=this._popupLayer[n];for(var o=0;o<e.count;o++){i=e[o],this._popupCanvas.save();try{this._popupCanvas.translate(i.left,i.top),i.paint(this._popupCanvas)}finally{this._popupCanvas.restore()}}}this._hclCanvas.bitBltRect(t,this._popupCanvas,t)}}},{key:"_paintHintLayer",value:function(){this._hoverHintInfo.visible&&this.theme.drawHoverHint(this._hclCanvas,this._hoverHintInfo)}},{key:"_paint",value:function(t){if(null!=this.application&&this.application.runing){this._hclCanvas.save();try{this.brower==tr.Safari&&t.reset(0,0,this.width_,this.height_),this._hclCanvas.clearRect(t),t.right*=this._scale,t.bottom*=this._scale,this._hclCanvas.clipRect(t),this._paintApplicationLayer(t),this._paintPopupLayer(t),this._caret.visible&&this._caret.shan&&t.isIntersect(this._caret.rect)&&this._paintCaretShan(),this._paintHintLayer(),this._paintWaitList()}finally{this._hclCanvas.restore()}}else this._paintWaitList()}},{key:"_deactivate",value:function(){this._cursorControl=null}},{key:"_activate",value:function(){this.update()}},{key:"_makeMouseEventArgs",value:function(t){var e=this._windowToCanvas(this._hclH5Canvas,t.clientX,t.clientY),i=new ei;return t.ctrlKey&&i.shiftState.add(te),t.altKey&&i.shiftState.add($t),t.shiftKey&&i.shiftState.add(Qt),0==t.buttons?1==t.button?i.button=ee:4==t.button?i.button=ne:2==t.button&&(i.button=ie):1==t.buttons?i.button=ee:4==t.buttons?i.button=ne:2==t.buttons&&(i.button=ie),i.x=e.x,i.y=e.y,t.wheelDelta?i.delta=t.wheelDelta:i.delta=40*-t.detail,i.clicks=t.detail,i}},{key:"_mouseEnter",value:function(t){var e=this._makeMouseEventArgs(t);this.application.mouseEnter(e)}},{key:"_mouseLeave",value:function(t){var e=this._makeMouseEventArgs(t);this.application.mouseLeave(e)}},{key:"_mouseWheel",value:function(t){this._cancelIdle();var e=this._makeMouseEventArgs(t);this._popupMouseWheel(e)||this.application.mouseWheel(e)}},{key:"_mouseDown",value:function(t){this._cancelIdle(),this._waitListMouseDown(t)||(this._popupMouseDown(t)?this._captureLayer=this._popupLayer:(this.application.mouseDown(t),this._captureLayer=this._applicationLayer))}},{key:"_mouseMove",value:function(t){this._cancelIdle(),this._cursorPos.reset(t.x,t.y),this._waitListMouseMove(t)||(this._captureLayer!=this._popupLayer?this._popupMouseMove(t)?this._mouseMoveLayer!=this._popupLayer&&(this._mouseMoveLayer=this._popupLayer,this.application.mouseLeave(t),this._setCursorBy_(this._mouseMovePopupControl)):(this._mouseMoveLayer!=this._applicationLayer&&(this._mouseMoveLayer=this._applicationLayer,this.application.mouseEnter(t)),this.application.mouseMove(t)):this._popupMouseMove(t))}},{key:"_mouseUp",value:function(t){if(!this._waitListMouseUp(t))try{this._captureLayer==this._popupLayer?this._popupMouseUp(t):this.application.mouseUp(t)}finally{this._captureLayer=null}}},{key:"_dblClick",value:function(t){this.application.dblClick(t)}},{key:"_makeKeyEventArgs",value:function(t){var e=new ii;return t.ctrlKey&&e.shiftState.add(te),t.altKey&&e.shiftState.add($t),t.shiftKey&&e.shiftState.add(Qt),e.keyCode=t.keyCode,e.key=t.key,e}},{key:"_clearKeyState",value:function(){for(var t=0,e=this.keyDownStates.length;t<e;t++)this.keyDownStates[t]=!1}},{key:"_setKeyState",value:function(t,e,i){switch(this.keyDownStates[t]=i,e){case"ControlLeft":this.keyDownStates[Ye]=i,this.keyDownStates[_e]=i;break;case"ControlRight":this.keyDownStates[Je]=i,this.keyDownStates[_e]=i;break;case"ShiftLeft":this.keyDownStates[Xe]=i,this.keyDownStates[Re]=i;break;case"ShiftRight":this.keyDownStates[Ke]=i,this.keyDownStates[Re]=i;break;case"AltLeft":this.keyDownStates[Ze]=i,this.keyDownStates[xe]=i;break;case"AltRight":this.keyDownStates[qe]=i,this.keyDownStates[xe]=i}}},{key:"_keyDown",value:function(t){this._cancelIdle(),this._isPreventKeyDown(t.keyCode)&&t.preventDefault();var e=this._makeKeyEventArgs(t);this._setKeyState(t.keyCode,t.code,!0),this._popupKeyDown(e)||this.application.keyDown(e)}},{key:"_keyPress",value:function(t){this._cancelIdle();var e=this._makeKeyEventArgs(t);t.target!==this.ime._input&&(this._popupKeyPress(e)||this.application.keyPress(e))}},{key:"_keyUp",value:function(t){var e=this._makeKeyEventArgs(t);this._setKeyState(t.keyCode,t.code,!1),this.application.keyUp(e)}},{key:"_copy",value:function(t){this.application.copy(t)}},{key:"_cut",value:function(t){this.application.cut(t)}},{key:"_paste",value:function(t){this.application.paste(t)}},{key:"handleAllocate",value:function(){return++this._handleSeq}},{key:"beginUpdate",value:function(){this._updateCount++}},{key:"endUpdate",value:function(){this._updateCount>0&&(this._updateCount--,0==this._updateCount&&this.update())}},{key:"update",value:function(){this._updateCount>0||this._paint(U.CreateByBounds(0,0,this.width_,this.height_))}},{key:"updateRect",value:function(t){this._updateCount>0||(this.brower==tr.IE?this._paint(t):this._paint(t.inFlate(this.theme.shadow,this.theme.shadow,!0)))}},{key:"showMessage",value:function(t){new Fo("提示",t).showModal()}},{key:"messageDlg",value:function(t,e,i,n){new Fo("提示",t,i,e).showModal(n)}},{key:"waitMessage",value:function(t,e){var i=new er(t);return this._waitList.add(i),setTimeout(e,0),i}},{key:"endWaitMessage",value:function(t){this._waitList.remove(t)}},{key:"broadcast",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.application.broadcast(t,e,i)}},{key:"exception",value:function(t){throw"HCL异常:"+t}},{key:"log",value:function(t){console.log(t)}},{key:"returnFalseLog",value:function(t){return console.log(t),!1}},{key:"returnTrueLog",value:function(t){return console.log(t),!0}},{key:"debugLog",value:function(t){this.debug&&console.log("hcl_debug:"+t)}},{key:"onCatch",value:function(t){}},{key:"parentElement",get:function(){return this._parentElement},set:function(t){t&&this._parentElement!=t&&(this._parentElement=t,this._hclH5Canvas=document.createElement("canvas"),this._hclH5Canvas.setAttribute("id","hclH5canvas_"+this.system.Timestamp),this._hclH5Canvas.width=this.width_,this._hclH5Canvas.height=this.height_,this._hclH5Canvas.style.position="absolute",this._hclH5Canvas.style.left=this.left_+"px",this._hclH5Canvas.style.top="0px",this._hclH5Canvas.style.imeMode="active",this._hclH5Canvas.tabIndex="-1",this._hclH5Canvas.style.outline="none",this._hclCanvas=new Dt(this._hclH5Canvas.getContext("2d")),this._appH5Canvas=document.createElement("canvas"),this._appCanvas=new Dt(this._appH5Canvas.getContext("2d")),this._popupH5Canvas=document.createElement("canvas"),this._popupCanvas=new Dt(this._popupH5Canvas.getContext("2d")),t.appendChild(this._hclH5Canvas),this.resize(),this._initBindEvent())}},{key:"autoWidth",get:function(){return this._autoWidth},set:function(t){this._autoWidth!=t&&(this._autoWidth=t,this.resize())}},{key:"autoHeight",get:function(){return this._autoHeight},set:function(t){this._autoHeight!=t&&(this._autoHeight=t,this.resize())}},{key:"design",get:function(){return this.design_},set:function(t){this.design_!=t&&(this.design_=t,this.broadcast(Qe,t),this.update())}},{key:"left",get:function(){return this.left_}},{key:"top",get:function(){return this.top_}},{key:"width",get:function(){return this.width_}},{key:"height",get:function(){return this.height_}},{key:"cursorPos",get:function(){return this._cursorPos}},{key:"cursor",get:function(){return this._cursor}},{key:"homePath",get:function(){return this.theme.path},set:function(t){this.theme.path=t}},{key:"application",get:function(){return this._curApplication||(this._curApplication=new jo),this._curApplication}}])&&Xo(e.prototype,i),n&&Xo(e,n),r}(L),or=new nr;function rr(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var sr=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,n=[{key:"Initialization",value:function(){var e=or.system.dpi;t.PixelsPerInchX=e.x,t.PixelsPerInchY=e.y,t.FontSizeScale=72/t.PixelsPerInchX,t.PixelsPerMMX=t.PixelsPerInchX/25.4,t.PixelsPerMMY=t.PixelsPerInchY/25.4}},{key:"twipToPixel",value:function(t,e){return Math.round(t*e/1440)}},{key:"pixelToTwip",value:function(t,e){return Math.round(1440*t/e)}},{key:"twipToMillimeter",value:function(t){return 25.4*t/1440}},{key:"millimeterToTwip",value:function(t){return 1440*t/25.4}},{key:"pixXToMillimeter",value:function(e){return e/t.PixelsPerMMX}},{key:"millimeterToPixX",value:function(e){return Math.round(e*t.PixelsPerMMX)}},{key:"millimeterToPixY",value:function(e){return Math.round(e*t.PixelsPerMMY)}},{key:"pixYToMillimeter",value:function(e){return e/t.PixelsPerMMY}},{key:"ptToPixel",value:function(t,e){return Math.round(t*e/72)}},{key:"pixelToPt",value:function(t,e){return t/e*72}},{key:"twipToPt",value:function(t){return t/1440*72}}],(i=null)&&rr(e.prototype,i),n&&rr(e,n),t}();function ar(t){return(ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lr(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function hr(t,e){return(hr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function cr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=fr(t);if(e){var o=fr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ur(this,i)}}function ur(t,e){return!e||"object"!==ar(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function fr(t){return(fr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}sr.PixelsPerInchX=0,sr.PixelsPerInchY=0,sr.FontSizeScale=72/sr.PixelsPerInchX,sr.PixelsPerMMX=sr.PixelsPerInchX/25.4,sr.PixelsPerMMY=sr.PixelsPerInchY/25.4;var dr=0,mr=1,yr=2,pr=3,Sr=4,vr=0,Fr=1,Ir=2,gr={PLS100:0,PLS115:1,PLS150:2,PLS200:3,PLSMin:4,PLSFix:5,PLSMult:6},wr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&hr(t,e)}(r,t);var e,i,n,o=cr(r);function r(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this)).FLineSpaceMode=gr.PLS150,t.FLineSpace=1,t.FFirstIndentPix=0,t.FLeftIndentPix=0,t.FRightIndentPix=0,t.FFirstIndent=0,t.FLeftIndent=0,t.FRightIndent=0,t.FBreakRough=!1,t.FBackColor="silver",t.FAlignHorz=pr,t.FAlignVert=Fr,t.CheckSaveUsed,t.TempNo,t}return e=r,(i=[{key:"SetFirstIndent",value:function(t){this.FFirstIndent!=t&&(this.FFirstIndent=t,this.FFirstIndentPix=sr.millimeterToPixX(this.FFirstIndent))}},{key:"SetLeftIndent",value:function(t){this.FLeftIndent!=t&&(this.FLeftIndent=t,this.FLeftIndentPix=sr.millimeterToPixX(this.FLeftIndent))}},{key:"SetRightIndent",value:function(t){this.FRightIndent!=t&&(this.FRightIndent=t,this.FRightIndentPix=sr.millimeterToPixX(this.FRightIndent))}},{key:"EqualsEx",value:function(t){return this.FLineSpaceMode==t.LineSpaceMode&&this.FLineSpace==t.LineSpace&&this.FFirstIndent==t.FirstIndent&&this.FLeftIndent==t.LeftIndent&&this.FRightIndent==t.RightIndent&&this.FBackColor==t.BackColor&&this.FBreakRough==t.BreakRough&&this.FAlignHorz==t.AlignHorz&&this.FAlignVert==t.AlignVert}},{key:"AssignEx",value:function(t){this.FLineSpaceMode=t.LineSpaceMode,this.FLineSpace=t.LineSpace,this.FirstIndent=t.FirstIndent,this.LeftIndent=t.LeftIndent,this.RightIndent=t.RightIndent,this.FBackColor=t.BackColor,this.FBreakRough=t.BreakRough,this.FAlignHorz=t.AlignHorz,this.FAlignVert=t.AlignVert}},{key:"SaveToStream",value:function(t){t.writeByte(this.FLineSpaceMode),t.writeSingle(this.FLineSpace),t.writeSingle(this.FFirstIndent),t.writeSingle(this.FLeftIndent),t.writeSingle(this.FRightIndent),lp.HCSaveColorToStream(t,this.FBackColor);var e=0;this.FBreakRough&&(e|=128),t.writeByte(e),e=this.FAlignHorz,t.writeByte(e),e=this.FAlignVert,t.writeByte(e)}},{key:"LoadFromStream",value:function(t,e){e<15&&t.readInt32(),e>16&&(this.FLineSpaceMode=t.readByte()),e>30?this.FLineSpace=t.readSingle():this.FLineSpaceMode==gr.Fix&&(this.FLineSpace=12),e<22?(this.FFirstIndentPix=t.readInt32(),this.FLeftIndentPix=t.readInt32()):(this.FFirstIndent=t.readSingle(),this.FFirstIndentPix=sr.millimeterToPixX(this.FFirstIndent),this.FLeftIndent=t.readSingle(),this.FLeftIndentPix=sr.millimeterToPixX(this.FLeftIndent),this.FRightIndent=t.readSingle(),this.FRightIndentPix=sr.millimeterToPixX(this.FRightIndent)),this.FBackColor=lp.HCLoadColorFromStream(t);var i=0;e>31&&(i=t.readByte(),this.FBreakRough=or.system.isOdd(i>>7)),this.FAlignHorz=t.readByte(),e>17&&(this.FAlignVert=t.readByte())}},{key:"ToCSS",value:function(){var t=" text-align: ";switch(this.FAlignHorz){case dr:t+="left";break;case yr:t+="right";break;case mr:t+="center";break;case pr:case Sr:t+="justify"}switch(this.FLineSpaceMode){case gr.PLS100:t+="; line-height: 100%";break;case gr.PLS115:t+="; line-height: 115%";break;case gr.PLS150:t+="; line-height: 150%";break;case gr.PLS200:t+="; line-height: 200%";break;case gr.PLSFix:t+="; line-height: 10px"}return t}},{key:"GetLineSpaceModeXML_",value:function(){switch(this.FLineSpaceMode){case gr.PLS100:return"100";case gr.PLS115:return"115";case gr.PLS150:return"150";case gr.PLS200:return"200";case gr.PLSMin:return"min";case gr.PLSMult:return"mult";case gr.PLSFix:return"fix";default:return"100"}}},{key:"GetHorzXML_",value:function(){switch(this.FAlignHorz){case dr:return"left";case yr:return"right";case mr:return"center";case pr:return"justify";default:return"scatter"}}},{key:"GetVertXML_",value:function(){switch(this.FAlignVert){case vr:return"top";case Fr:return"center";default:return"bottom"}}},{key:"ToXml",value:function(t){t.SetAttribute("firstindent",C.stringFormatFloat(1,this.FFirstIndent)),t.SetAttribute("leftindent",C.stringFormatFloat(1,this.FLeftIndent)),t.SetAttribute("rightindent",C.stringFormatFloat(1,this.FRightIndent)),t.SetAttribute("bkcolor",lp.HCColorToRGBString(this.FBackColor)),this.FBreakRough&&t.SetAttribute("breakrough","1"),t.SetAttribute("spacemode",this.GetLineSpaceModeXML_()),t.SetAttribute("horz",this.GetHorzXML_()),t.SetAttribute("vert",this.GetVertXML_())}},{key:"ParseXml",value:function(t){this.FirstIndent=t.GetAttribute("firstindent"),this.LeftIndent=t.GetAttribute("leftindent"),this.RightIndent=t.GetAttribute("rightindent"),this.FBackColor=lp.HCRGBStringToColor(t.GetAttribute("bkcolor")),this.FBreakRough="1"==t.GetAttribute("breakrough"),"100"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLS100:"115"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLS115:"150"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLS150:"200"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLS200:"min"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLSMin:"mult"==t.GetAttribute("spacemode")?this.FLineSpaceMode=gr.PLSMult:"fix"==t.GetAttribute("spacemode")&&(this.FLineSpaceMode=gr.PLSFix),"left"==t.GetAttribute("horz")?this.FAlignHorz=dr:"right"==t.GetAttribute("horz")?this.FAlignHorz=yr:"center"==t.GetAttribute("horz")?this.FAlignHorz=mr:"justify"==t.GetAttribute("horz")?this.FAlignHorz=pr:"scatter"==t.GetAttribute("horz")&&(this.FAlignHorz=Sr),"top"==t.GetAttribute("vert")?this.FAlignVert=vr:"center"==t.GetAttribute("vert")?this.FAlignVert=Fr:"bottom"==t.GetAttribute("vert")&&(this.FAlignVert=Ir)}},{key:"LineSpaceMode",get:function(){return this.FLineSpaceMode},set:function(t){this.FLineSpaceMode=t}},{key:"LineSpace",get:function(){return this.FLineSpace},set:function(t){this.FLineSpace=t}},{key:"FirstIndent",get:function(){return this.FFirstIndent},set:function(t){this.SetFirstIndent(t)}},{key:"LeftIndent",get:function(){return this.FLeftIndent},set:function(t){this.SetLeftIndent(t)}},{key:"RightIndent",get:function(){return this.FRightIndent},set:function(t){this.SetRightIndent(t)}},{key:"FirstIndentPix",get:function(){return this.FFirstIndentPix}},{key:"LeftIndentPix",get:function(){return this.FLeftIndentPix}},{key:"RightIndentPix",get:function(){return this.FRightIndentPix}},{key:"BackColor",get:function(){return this.FBackColor},set:function(t){this.FBackColor=t}},{key:"BreakRough",get:function(){return this.FBreakRough},set:function(t){this.FBreakRough=t}},{key:"AlignHorz",get:function(){return this.FAlignHorz},set:function(t){this.FAlignHorz=t}},{key:"AlignVert",get:function(){return this.FAlignVert},set:function(t){this.FAlignVert=t}}])&&lr(e.prototype,i),n&&lr(e,n),r}(L);function Cr(t){return(Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kr(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Pr(t,e){return(Pr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Dr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Rr(t);if(e){var o=Rr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return br(this,i)}}function br(t,e){return!e||"object"!==Cr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Rr(t){return(Rr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var _r=1,xr=2,Ar=4,Tr=8,Or=16,Nr=32,Br=64,Er=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pr(t,e)}(r,t);var e,i,n,o=Dr(r);function r(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this)).DefaultFontSize=10.5,t.DefaultFontFamily="宋体",t.MaxFontSize=512,t.FSize=t.DefaultFontSize,t.FFontHeight=14,t.FFamily=t.DefaultFontFamily,t.FFontStyles=new M,t.FColor="black",t.FBackColor=lp.HCTransparentColor,t.FCJKFont=!0,t.FTrueType=!0,t.FTextmetric_tmAscent=12,t.FTextmetric_tmDescent=2,t.FTextMetric_tmAveCharWidth=7,t.FTextMetric_tmExternalLeading=2,t.FTextMetric_tmHeight=14,t.CheckSaveUsed=!1,t.TempNo=-1,t}return e=r,(i=[{key:"SetFamily",value:function(t){this.FFamily!=t&&(this.FFamily=t)}},{key:"SetSize",value:function(t){this.FSize!=t&&(this.FSize=t)}},{key:"SetFontStyles",value:function(t){this.FFontStyles!=t&&(this.FFontStyles=t)}},{key:"ApplyStyle",value:function(t){this.FBackColor==lp.HCTransparentColor?t.brush.style=Ft:t.brush.color=this.FBackColor,t.font.beginUpdate();try{t.font.color=this.FColor,t.font.name=this.FFamily,t.font.size=this.FSize,t.font.styles.value=this.FFontStyles.value}finally{t.font.endUpdate()}this.FFontStyles.has(Br)&&(t.pen.style=pt.Solid,t.pen.width=1,t.pen.color=at.Red),this.FTextMetric_tmAveCharWidth=t.font.advCharWidth,this.FTextMetric_tmExternalLeading=t.font.externalLeading,this.FTextMetric_tmHeight=t.font.height,this.FFontHeight=t.font.height,this.FCJKFont=t.font.CJK,this.FTrueType=t.font.trueType,this.FTextmetric_tmAscent=t.font.ascent,this.FTextmetric_tmDescent=t.font.descent}},{key:"EqualsEx",value:function(t){return this.FSize==t.Size&&this.FFontStyles.value==t.FontStyles.value&&this.FFamily==t.Family&&at.sameColor(this.FColor,t.Color)&&at.sameColor(this.FBackColor,t.BackColor)}},{key:"AssignEx",value:function(t){this.FSize=t.Size,this.FFontHeight=t.FontHeight,this.FFontStyles.value=t.FontStyles.value,this.FFamily=t.Family,this.FColor=t.Color,this.FBackColor=t.BackColor}},{key:"SaveToStream",value:function(t){t.writeSingle(this.FSize),lp.HCSaveTextToStream(t,this.FFamily),t.writeByte(this.FFontStyles.value),lp.HCSaveColorToStream(t,this.FColor),lp.HCSaveColorToStream(t,this.FBackColor)}},{key:"LoadFromStream",value:function(t,e){if(e<12){var i=t.readInt32();this.FSize=new O(i).value}else this.FSize=t.readSingle();this.FFamily=lp.HCLoadTextFromStream(t,e),this.FFontStyles.value=t.readByte(),this.FColor=lp.HCLoadColorFromStream(t),this.FBackColor=lp.HCLoadColorFromStream(t)}},{key:"GetTextDecoration",value:function(){var t="";return this.FFontStyles.has(ht.Underline)&&(t=" underline"),this.FFontStyles.has(ht.StrikeOut)&&(""!=t?t+=", line-through":t=" line-through"),"text-decoration:"+t+";"}},{key:"ToCSS",value:function(){var t=C.stringFormat(" font-size: {0:N1}pt",this.FSize)+C.stringFormat(" font-family: {0};",this.FFamily)+C.stringFormat(" color:{0};",this.FColor);return this.FFontStyles.has(ht.Italic)?t+=C.stringFormat(" font-style: {0};","italic"):t+=C.stringFormat(" font-style: {0};","normal"),this.FFontStyles.has(ht.Bold)||this.FFontStyles.has(ht.StrikeOut)?t+=C.stringFormat(" font-weight: {0};","bold"):t+=C.stringFormat(" font-weight: {0};","normal"),(this.FFontStyles.has(ht.Underline)||this.FFontStyles.has(ht.StrikeOut))&&(t+=" "+this.GetTextDecoration()),this.FFontStyles.has(ht.SuperScript)&&(t+=" vertical-align:super;"),this.FFontStyles.has(ht.SubScript)&&(t+=" vertical-align:sub;"),t}},{key:"GetFontStyleXML",value:function(){var t="";return this.FFontStyles.has(ht.Bold)&&(t="bold"),this.FFontStyles.has(ht.Italic)&&(""!=t?t+=", italic":t="italic"),this.FFontStyles.has(ht.Underline)&&(""!=t?t+=", underline":t="underline"),this.FFontStyles.has(ht.StrikeOut)&&(""!=t?t+=", strikeout":t="strikeout"),this.FFontStyles.has(ht.SuperScript)&&(""!=t?t+=", sup":t="sup"),this.FFontStyles.has(ht.SubScript)&&(""!=t?t+=", sub":t="sub"),t}},{key:"ToXml",value:function(t){t.SetAttribute("size",C.stringFormatFloat(1,this.FSize)),t.SetAttribute("color",lp.HCColorToRGBString(this.FColor)),t.SetAttribute("bkcolor",lp.HCColorToRGBString(this.FBackColor)),t.SetAttribute("style",this.GetFontStyleXML()),t.Value=this.FFamily}},{key:"ParseXml",value:function(t){this.FFamily=t.Value,this.FSize=t.GetAttribute("size"),this.FColor=lp.HCRGBStringToColor(t.GetAttribute("color")),this.FBackColor=lp.HCRGBStringToColor(t.GetAttribute("bkcolor"));for(var e=t.GetAttribute("style").split(","),i=0;i<e.length;i++)"bold"==e[i]?this.FFontStyles.add(_r):"italic"==e[i]?this.FFontStyles.add(xr):"underline"==e[i]?this.FFontStyles.add(Ar):"strikeout"==e[i]?this.FFontStyles.add(Tr):"sup"==e[i]?this.FFontStyles.add(Or):"sub"==e[i]&&this.FFontStyles.add(Nr)}},{key:"trueType",get:function(){return this.FTrueType}},{key:"CJKFont",get:function(){return this.FCJKFont}},{key:"Textmetric_tmAscent",get:function(){return this.FTextmetric_tmAscent}},{key:"Textmetric_tmDescent",get:function(){return this.FTextmetric_tmDescent}},{key:"TextMetric_tmAveCharWidth",get:function(){return this.FTextMetric_tmAveCharWidth}},{key:"TextMetric_tmExternalLeading",get:function(){return this.FTextMetric_tmExternalLeading}},{key:"TextMetric_tmHeight",get:function(){return this.FTextMetric_tmHeight}},{key:"Family",get:function(){return this.FFamily},set:function(t){this.SetFamily(t)}},{key:"Size",get:function(){return this.FSize},set:function(t){this.SetSize(t)}},{key:"FontHeight",get:function(){return this.FFontHeight}},{key:"FontStyles",get:function(){return this.FFontStyles},set:function(t){this.SetFontStyles(t)}},{key:"Color",get:function(){return this.FColor},set:function(t){this.FColor=t}},{key:"BackColor",get:function(){return this.FBackColor},set:function(t){this.FBackColor=t}}])&&kr(e.prototype,i),n&&kr(e,n),r}(L);function Mr(t){return(Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lr(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Gr(t,e,i){return e&&Lr(t.prototype,e),i&&Lr(t,i),t}function Hr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ur(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Vr(t,e)}function Vr(t,e){return(Vr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Wr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=jr(t);if(e){var o=jr(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return zr(this,i)}}function zr(t,e){return!e||"object"!==Mr(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function jr(t){return(jr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Xr=function(t){Ur(i,t);var e=Wr(i);function i(){var t;return Hr(this,i),(t=e.call(this)).Name="",t.Value="",t}return i}(L),Kr=function(t){Ur(i,t);var e=Wr(i);function i(){var t;return Hr(this,i),(t=e.call(this)).Attributes=null,t.ChildNodes=null,t}return Gr(i,[{key:"SetAttribute",value:function(t,e){this.Attributes||(this.Attributes=new V);var i=new Xr;i.Name=t,i.Value=e,this.Attributes.add(i)}},{key:"HasAttribute",value:function(t){if(!this.Attributes)return!1;for(var e=0;e<this.Attributes.count;e++)if(this.Attributes[e].Name==t)return!0;return!1}},{key:"GetAttribute",value:function(t){if(!this.Attributes)return null;for(var e=0;e<this.Attributes.count;e++)if(this.Attributes[e].Name==t)return this.Attributes[e].Value;return null}},{key:"AppendChild",value:function(t){this.ChildNodes||(this.ChildNodes=new V),this.ChildNodes.add(t)}},{key:"FindNode",value:function(t){if(null==this.ChildNodes)return null;for(var e=0;e<this.ChildNodes.count;e++)if(this.ChildNodes[e].Name==t)return this.ChildNodes[e];return null}},{key:"ToString",value:function(){var t="<"+this.Name;if(this.Attributes&&this.Attributes.count>0)for(var e=0;e<this.Attributes.count;e++)t+=" "+this.Attributes[e].Name+'="'+this.Attributes[e].Value+'"';if(t+=">",this.ChildNodes&&this.ChildNodes.count>0)for(var i=0;i<this.ChildNodes.count;i++)t+=this.ChildNodes[i].ToString();else t+=this.Value;return t+="</"+this.Name+">"}}],[{key:"Create",value:function(t,e){var n=new i;return n.Name=t,e&&(n.Value=e),n}}]),i}(Xr),Yr=0,Jr=1,Zr=2,qr=3,Qr=function(t){Ur(i,t);var e=Wr(i);function i(){var t;return Hr(this,i),(t=e.call(this)).Version="1.0",t.Encoding="UTF-8",t}return Gr(i,[{key:"CreateNode",value:function(t,e){return Kr.Create(t,e)}},{key:"ToString",value:function(){var t='<?xml version="'+this.Version+'" encoding="'+this.Encoding+'"?>';if(this.ChildNodes&&this.ChildNodes.count>0)for(var e=0;e<this.ChildNodes.count;e++)t+=this.ChildNodes[e].ToString();return t}},{key:"_findEndOffs",value:function(t,e,i,n){for(var o=i;o<n;){if(e[o]==t)return o;o++}return-1}},{key:"_parseNode",value:function(t,e,i,n){var o=this._findEndOffs(">",t,e+1,i);if(o>0){if("?"==t[e+1])return o;var r=new Kr;null!=n&&n.AppendChild(r);for(var s="",a="",l=Yr,h=e+1;h<o;h++){if(" "==t[h]){if(l==Yr){r.Name=s,l=Jr,s="";continue}if(l==qr)continue}else if("="==t[h]){if(l==Jr){a=s,s="";continue}}else{if('"'==t[h]){l!=Zr?l=Zr:(r.SetAttribute(a,s),l=qr,s="");continue}l==qr&&(l=Jr)}s+=t[h]}for(""==r.Name&&(r.Name=s),s="",e=o+1;e<i;){if("<"==t[e]){if(e<i-1){if("/"==t[e+1]){r.Value=s,e+=1+r.Name.length+1;break}if((e=this._parseNode(t,e,i,r))<0)return-1}}else s+=t[e];e++}return e}return console.log("不正确的xml节点!位置:"+e.toString()),-1}},{key:"FromString",value:function(t){for(var e=0,i=t.length;e<i;){if("<"==t[e]&&(e=this._parseNode(t,e,i,this))<0)return;e++}}},{key:"Text",get:function(){return this.ToString()}}]),i}(Kr);function $r(t){return($r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ts(t,e){return(ts=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function es(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=ns(t);if(e){var o=ns(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return is(this,i)}}function is(t,e){return!e||"object"!==$r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ns(t){return(ns=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function os(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function rs(t,e,i){return e&&os(t.prototype,e),i&&os(t,i),t}function ss(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var as=function t(){ss(this,t),this.RePaint=!1,this.ReCaret=!1,this.ReStyle=!1,this.ReScroll=!1,this.Selecting=!1,this.DragingSelected=!1},ls=function t(){ss(this,t),this.State=Ip.Loading,this.Count=0},hs=function(){function t(){ss(this,t),this.FStates=new V}return rs(t,[{key:"_deleteState",value:function(t){this.FStates.delete(t)}},{key:"_getStateIndex",value:function(t){for(var e=0;e<this.FStates.count;e++)if(this.FStates[e].State===t)return e;return-1}},{key:"Include",value:function(t){var e=this._getStateIndex(t);if(e>=0)this.FStates[e].Count++;else{var i=new ls;i.State=t,i.Count=1,this.FStates.add(i)}}},{key:"Exclude",value:function(t){var e=this._getStateIndex(t);e>=0&&(this.FStates[e].Count>1?this.FStates[e].Count--:this._deleteState(e))}},{key:"Contain",value:function(t){return this._getStateIndex(t)>=0}},{key:"UndoRedo",value:function(){return this.Contain(Ip.Undoing)||this.Contain(Ip.Redoing)}}]),t}(),cs=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ts(t,e)}(i,t);var e=es(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ss(this,i),(t=e.call(this)).FTempCanvas=t.CreateStyleCanvas(),t.FTempStyleNo=i.Null,t.FBackgroundColor="#ffffff",t.FSelColor="#a6caf0",t.FLineSpaceMin=8,t.FShowParaLastMark=!0,t.FDrawActiveDomainRegion=!0,t.FDrawHotDomainRegion=!0,t.FFormatVersion=2,t.FStates=new hs,t.FUpdateInfo=new as,t.FDefaultTextStyle=new Er,t.FDefaultTextStyle.ApplyStyle(t.FTempCanvas),t.FTextStyles=new V,t.FParaStyles=new V,t.SkipFormat=!1,t.FormatBrushStyleNo=0,n&&t.NewDefaultTextStyle(),o&&t.NewDefaultParaStyle(),t.FOnInvalidateRect=null,t}return rs(i,[{key:"SetShowParaLastMark",value:function(t){this.FShowParaLastMark!=t&&(this.FShowParaLastMark=t,this.UpdateInfoRePaint())}},{key:"Initialize",value:function(){this.FTextStyles.removeRange(1,this.FTextStyles.count-1),this.FParaStyles.removeRange(1,this.FParaStyles.count-1)}},{key:"UpdateInfoRePaint",value:function(){this.FUpdateInfo.RePaint=!0}},{key:"UpdateInfoReStyle",value:function(){this.FUpdateInfo.ReStyle=!0}},{key:"UpdateInfoReScroll",value:function(){this.FUpdateInfo.ReScroll=!0}},{key:"UpdateInfoReCaret",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.FUpdateInfo.ReCaret=!0,this.FUpdateInfo.ReStyle=t}},{key:"AddTextStyle",value:function(t){return this.FTextStyles.add(t),this.FTextStyles.count-1}},{key:"CreateStyleCanvas",value:function(){var t=document.createElement("canvas").getContext("2d");return new Dt(t)}},{key:"DestroyStyleCanvas",value:function(t){t.h5context.canvas=null}},{key:"NewDefaultTextStyle",value:function(){var t=new Er;return this.FTextStyles.add(t),t.ApplyStyle(this.TempCanvas),this.FTempStyleNo=this.FTextStyles.count-1,this.FTextStyles.count-1}},{key:"NewDefaultParaStyle",value:function(){var t=new wr;return this.FParaStyles.add(t),this.FParaStyles.count-1}},{key:"GetDefaultStyleNo",value:function(){return this.GetStyleNo(this.FDefaultTextStyle,!0)}},{key:"GetStyleNo",value:function(t,e){for(var i=-1,n=0;n<=this.FTextStyles.count-1;n++)if(this.FTextStyles[n].EqualsEx(t))return i=n;if(e&&i<0){var o=new Er;o.AssignEx(t),this.FTextStyles.add(o),o.ApplyStyle(this.TempCanvas),i=this.FTextStyles.count-1,this.FTempStyleNo=i}return i}},{key:"GetParaNo",value:function(t,e){for(var i=-1,n=0;n<=this.FParaStyles.count-1;n++)if(this.FParaStyles[n].EqualsEx(t))return i=n;if(e&&i<0){var o=new wr;o.AssignEx(t),this.FParaStyles.add(o),i=this.FParaStyles.count-1}return i}},{key:"ApplyTempStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.FTempStyleNo!=t&&(this.FTempStyleNo=t,t>i.Null&&this.FTextStyles[t].ApplyStyle(this.FTempCanvas,e))}},{key:"SaveParaStyles",value:function(t){var e=this.FParaStyles.count;t.writeInt32(e);for(var i=0;i<=this.FParaStyles.count-1;i++)this.FParaStyles[i].SaveToStream(t)}},{key:"SaveTextStyles",value:function(t){var e=this.TextStyles.count;t.writeInt32(e);for(var i=0;i<=this.FTextStyles.count-1;i++)this.FTextStyles[i].SaveToStream(t)}},{key:"SaveToStream",value:function(t){var e=t.position;t.writeUInt64(e),t.writeByte(this.FFormatVersion),t.writeByte(this.FLineSpaceMin);var i=0;this.FShowParaLastMark&&(i|=128),t.writeByte(i),this.SaveParaStyles(t),this.SaveTextStyles(t);var n=t.position;t.position=e,e=n-e-8,t.writeUInt64(e),t.position=n}},{key:"LoadParaStyles",value:function(t,e){this.FParaStyles.clear();for(var i=t.readInt32(),n=0;n<=i-1;n++)this.FParaStyles[this.NewDefaultParaStyle()].LoadFromStream(t,e)}},{key:"LoadTextStyles",value:function(t,e){this.FTextStyles.clear();for(var i=t.readInt32(),n=0;n<=i-1;n++)this.FTextStyles[this.NewDefaultTextStyle()].LoadFromStream(t,e)}},{key:"LoadFromStream",value:function(t,e){if(t.readInt64(),this.FFormatVersion=e>33?t.readByte():1,this.FLineSpaceMin=e>49?t.readByte():8,e>53){var i=t.readByte();this.FShowParaLastMark=or.system.isOdd(i>>7)}else this.FShowParaLastMark=!0;this.LoadParaStyles(t,e),this.LoadTextStyles(t,e)}},{key:"GetHtmlFileTempName",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t?this.FHtmlFileTempName=0:this.FHtmlFileTempName++,this.FHtmlFileTempName.toString()}},{key:"ToCSS",value:function(){for(var t='<style type="text/css">',e=0;e<this.FTextStyles.count;e++)t=(t=t+lp.sLineBreak+"a.fs"+e.toString()+" {")+this.FTextStyles[e].ToCSS()+" }";for(var i=0;i<this.FParaStyles.count;i++)t+=lp.sLineBreak+"p.ps"+i.toString()+" {",t+=this.FParaStyles[i].ToCSS()+" }";return t+lp.sLineBreak+"</style>"}},{key:"ToXml",value:function(t){t.SetAttribute("fscount",this.FTextStyles.count.toString()),t.SetAttribute("pscount",this.FParaStyles.count.toString()),t.SetAttribute("fmtver",this.FFormatVersion.toString()),t.SetAttribute("linespacemin",this.FLineSpaceMin.toString()),t.SetAttribute("showplm",this.FShowParaLastMark.toString());for(var e,i,n=Kr.Create("textstyles"),o=0;o<this.FTextStyles.count;o++)e=Kr.Create("ts"),this.FTextStyles[o].ToXml(e),n.AppendChild(e);t.AppendChild(n),n=Kr.Create("parastyles","");for(var r=0;r<this.FParaStyles.count;r++)i=Kr.Create("ps"),this.FParaStyles[r].ToXml(i),n.AppendChild(i);t.AppendChild(n)}},{key:"ParseXml",value:function(t){var e;t.HasAttribute("fmtver")?this.FFormatVersion=t.GetAttribute("fmtver"):this.FFormatVersion=1,t.HasAttribute("linespacemin")?this.FLineSpaceMin=t.GetAttribute("linespacemin"):this.FLineSpaceMin=8,t.HasAttribute("showplm")?this.FShowParaLastMark=t.GetAttribute("showplm"):this.FShowParaLastMark=!0;for(var i=0;i<t.ChildNodes.count;i++)if("textstyles"==t.ChildNodes[i].Name){this.FTextStyles.clear(),e=t.ChildNodes[i];for(var n=0;n<e.ChildNodes.count;n++)this.FTextStyles[this.NewDefaultTextStyle()].ParseXml(e.ChildNodes[n])}else if("parastyles"==t.ChildNodes[i].Name){this.FParaStyles.clear(),e=t.ChildNodes[i];for(var o=0;o<e.ChildNodes.count;o++)this.FParaStyles[this.NewDefaultParaStyle()].ParseXml(e.ChildNodes[o])}}},{key:"InvalidateRect",value:function(t){null!=this.FOnInvalidateRect&&this.FOnInvalidateRect(t)}},{key:"DefaultTextStyle",get:function(){return this.FDefaultTextStyle}},{key:"TextStyles",get:function(){return this.FTextStyles}},{key:"TextStyle",set:function(t){this.FTextStyles=t}},{key:"ParaStyles",get:function(){return this.FParaStyles},set:function(t){this.FParaStyles=t}},{key:"BackgroundColor",get:function(){return this.FBackgroundColor},set:function(t){this.FBackgroundColor=t}},{key:"SelColor",get:function(){return this.FSelColor},set:function(t){this.FSelColor=t}},{key:"LineSpaceMin",get:function(){return this.FLineSpaceMin},set:function(t){this.FLineSpaceMin=t}},{key:"TempStyleNo",get:function(){return this.FTempStyleNo}},{key:"TempCanvas",get:function(){return this.FTempCanvas}},{key:"UpdateInfo",get:function(){return this.FUpdateInfo}},{key:"DrawActiveDomainRegion",get:function(){return this.FDrawActiveDomainRegion},set:function(t){this.FDrawActiveDomainRegion=t}},{key:"DrawHotDomainRegion",get:function(){return this.FDrawHotDomainRegion},set:function(t){this.FDrawHotDomainRegion=t}},{key:"ShowParaLastMark",get:function(){return this.FShowParaLastMark},set:function(t){this.SetShowParaLastMark(t)}},{key:"States",get:function(){return this.FStates}},{key:"FormatVersion",get:function(){return this.FFormatVersion}},{key:"OnInvalidateRect",get:function(){return this.FOnInvalidateRect},set:function(t){this.FOnInvalidateRect=t}}]),i}(L);function us(t){return(us="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fs(t,e,i){return(fs="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Is(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function ds(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ms(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ys(t,e,i){return e&&ms(t.prototype,e),i&&ms(t,i),t}function ps(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ss(t,e)}function Ss(t,e){return(Ss=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function vs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Is(t);if(e){var o=Is(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Fs(this,i)}}function Fs(t,e){return!e||"object"!==us(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Is(t){return(Is=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}cs.Null=-1,cs.Image=-2,cs.Table=-3,cs.Tab=-4,cs.Line=-5,cs.Express=-6,cs.Vector=-7,cs.Domain=-8,cs.PageBreak=-9,cs.CheckBox=-10,cs.Gif=-11,cs.Control=-12,cs.Edit=-13,cs.Combobox=-14,cs.QRCode=-15,cs.BarCode=-16,cs.Fraction=-17,cs.DateTimePicker=-18,cs.RadioGroup=-19,cs.SupSubScript=-20,cs.Button=-21,cs.Bullet=-22,cs.FloatLine=-101,cs.FloatBarCode=-102,cs.FloatQRCode=-117,cs.Annotate=-118,cs.Custom=-1e3;var gs=0,ws=2,Cs=function(t){ps(i,t);var e=vs(i);function i(){var t;return ds(this,i),(t=e.call(this)).FOptions=new Set([]),t.ItemNo=-1,t.CharOffs=-1,t.CharLen=-1,t.rect=new U,t}return ys(i,[{key:"GetLineFirst",value:function(){return this.FOptions.has(gs)}},{key:"SetLineFirst",value:function(t){t?this.FOptions.add(gs):this.FOptions.delete(gs)}},{key:"GetParaFirst",value:function(){return this.FOptions.has(ws)}},{key:"SetParaFirst",value:function(t){t?this.FOptions.add(ws):this.FOptions.delete(ws)}},{key:"CharOffsetStart",value:function(){return this.CharOffs-1}},{key:"CharOffsetEnd",value:function(){return this.CharOffs+this.CharLen-1}},{key:"width",get:function(){return this.rect.width}},{key:"height",get:function(){return this.rect.height}},{key:"LineFirst",get:function(){return this.GetLineFirst()},set:function(t){this.SetLineFirst(t)}},{key:"ParaFirst",get:function(){return this.GetParaFirst()},set:function(t){this.SetParaFirst(t)}}]),i}(L),ks=function(t){ps(i,t);var e=vs(i);function i(){var t;return ds(this,i),(t=e.call(this)).FDeleteStartDrawItemNo=-1,t.FDeleteCount=0,t}return ys(i,[{key:"insert",value:function(t,e){if(0==this.FDeleteCount)return fs(Is(i.prototype),"insert",this).call(this,t,e);this.FDeleteStartDrawItemNo++,this.FDeleteCount--;var n=this[t];return this.splice(t,1,e),this.doRemoved_(n),Object.getPrototypeOf(n)instanceof L&&n.dispose(),n=null,!0}},{key:"clear",value:function(){fs(Is(i.prototype),"clear",this).call(this),this.ClearFormatMark()}},{key:"MarkFormatDelete",value:function(t,e){this.FDeleteStartDrawItemNo=t,this.FDeleteCount=e-t+1}},{key:"DeleteFormatMark",value:function(){this.removeRange(this.FDeleteStartDrawItemNo,this.FDeleteCount),this.FDeleteStartDrawItemNo=-1,this.FDeleteCount=0}},{key:"ClearFormatMark",value:function(){this.FDeleteStartDrawItemNo=-1,this.FDeleteCount=0}}]),i}(V);function Ps(t){return(Ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ds(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bs(t,e)}function bs(t,e){return(bs=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Rs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=xs(t);if(e){var o=xs(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return _s(this,i)}}function _s(t,e){return!e||"object"!==Ps(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function xs(t){return(xs=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function As(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ts(t,e,i){return e&&As(t.prototype,e),i&&As(t,i),t}function Os(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Ns=function t(){Os(this,t),this.MapMode=0,this.WindowOrg=new G,this.WindowExt=new H,this.ViewportOrg=new G,this.ViewportExt=new H},Bs=1,Es=1,Ms=2,Ls=0,Gs=1,Hs=2,Us=function(){function t(){Os(this,t),this.FTopItems=new V,this.Print=!1,this.ViewMode=Bs,this.WindowWidth=0,this.WindowHeight=0,this.ScaleX=1,this.ScaleY=1,this.Zoom=1}return Ts(t,[{key:"scaleCanvas",value:function(t){var e=new Ns;return 1==this.ScaleX&&1==this.ScaleY?(e.MapMode=0,e):(e.ScaleX=1,e.ScaleY=1,t.scale(this.ScaleX,this.ScaleY),e)}},{key:"restoreCanvasScale",value:function(t,e){t.scale(e.ScaleX,e.ScaleY)}},{key:"getScaleX",value:function(t){return Math.round(t*this.ScaleX)}},{key:"getScaleY",value:function(t){return Math.round(t*this.ScaleY)}},{key:"drawNoScaleLine",value:function(t,e){var i=t.scaleSize;t.scale(1,1);try{t.drawLineByPointsDriect(e)}finally{t.scale(i.x,i.y)}}},{key:"topItems",get:function(){return this.FTopItems}}]),t}(),Vs=function(t){Ds(i,t);var e=Rs(i);function i(){var t;return Os(this,i),(t=e.call(this)).FParaNo=cs.Null,t.FStyleNo=cs.Null,t.FFirstDItemNo=-1,t.FActive=!1,t.FVisible=!0,t.FPrintInvisible=!1,t.FOptions=new M,t.FSelectState=Ls,t.OnDblClick=null,t}return Ts(i,[{key:"GetParaFirst",value:function(){return this.FOptions.has(Es)}},{key:"SetParaFirst",value:function(t){t?this.FOptions.add(Es):this.FOptions.remove(Es)}},{key:"GetPageBreak",value:function(){return this.FOptions.has(Ms)}},{key:"SetPageBreak",value:function(t){t?this.FOptions.add(Ms):this.FOptions.remove(Ms)}},{key:"GetSelectComplate",value:function(){return this.FSelectState==Hs}},{key:"GetSelectPart",value:function(){return this.FSelectState==Gs}},{key:"GetText",value:function(){return""}},{key:"SetText",value:function(t){}},{key:"GetHyperLink",value:function(){return""}},{key:"SetHyperLink",value:function(t){}},{key:"SetActive",value:function(t){this.FActive=t}},{key:"GetLength",value:function(){return 0}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){}},{key:"Assign",value:function(t){this.FStyleNo=t.StyleNo,this.FParaNo=t.ParaNo,this.FOptions.value=t.Options.value}},{key:"PaintTo",value:function(t,e,i,n,o,r,s,a){if(!a.Print||!this.FPrintInvisible){s.save();try{this.DoPaint(t,e,i,n,o,r,s,a)}finally{s.restore()}}}},{key:"PaintTop",value:function(t){}},{key:"CanConcatItems",value:function(t){return this.className==t.className&&this.FStyleNo==t.StyleNo}},{key:"DisSelect",value:function(){this.FSelectState=Ls}},{key:"CanDrag",value:function(){return!0}},{key:"KillFocus",value:function(){}},{key:"DblClick",value:function(t,e){null!=this.OnDblClick&&this.OnDblClick()}},{key:"MouseDown",value:function(t){return this.Active=!0,this.FActive}},{key:"MouseMove",value:function(t){return this.FActive}},{key:"MouseUp",value:function(t){return this.FActive}},{key:"MouseEnter",value:function(){}},{key:"MouseLeave",value:function(){}},{key:"GetHint",value:function(){return""}},{key:"SelectComplate",value:function(){this.FSelectState=Hs}},{key:"SelectPart",value:function(){this.FSelectState=Gs}},{key:"Selected",value:function(){return this.FSelectState!=Ls}},{key:"AcceptAction",value:function(t,e,i){return!0}},{key:"BreakByOffset",value:function(t){var e=this.newInstance();return e.Assign(this),e.ParaFirst=!1,e}},{key:"SaveToStream",value:function(t){this.SaveToStreamRange(t,0,this.Length)}},{key:"SaveToStreamRange",value:function(t,e,i){t.writeInt32(this.FStyleNo),t.writeInt32(this.FParaNo),t.writeByte(this.FOptions.value);var n=0;this.FPrintInvisible&&(n|=128),t.writeByte(n)}},{key:"LoadFromStream",value:function(t,e,i){if(this.FParaNo=t.readInt32(),i>25?this.FOptions.value=t.readByte():this.ParaFirst=t.readBoolean(),i>33){var n=t.readByte();this.FPrintInvisible=or.system.isOdd(n>>7)}}},{key:"ToHtml",value:function(){return""}},{key:"ToXml",value:function(t){t.SetAttribute("sno",this.FStyleNo.toString()),t.SetAttribute("pno",this.FParaNo.toString()),t.SetAttribute("parafirst",this.ParaFirst.toString()),t.SetAttribute("pagebreak",this.PageBreak.toString()),this.FPrintInvisible&&t.SetAttribute("printvisible","1")}},{key:"ParseXml",value:function(t){this.FStyleNo=t.GetAttribute("sno"),this.FParaNo=t.GetAttribute("pno"),this.ParaFirst="true"==t.GetAttribute("parafirst"),this.PageBreak="true"==t.GetAttribute("pagebreak"),this.FPrintInvisible="1"==t.GetAttribute("printvisible")}},{key:"ToJSONString",value:function(){return'"StyleNo":'+this.StyleNo}},{key:"ToJSONObject",value:function(){return JSON.parse("{"+this.ToJSONString()+"}")}},{key:"ParseJSONOjbect",value:function(t){this.FStyleNo=t.styleno}},{key:"Undo",value:function(t){}},{key:"Redo",value:function(t){}},{key:"Options",get:function(){return this.FOptions}},{key:"Text",get:function(){return this.GetText()},set:function(t){this.SetText(t)}},{key:"Length",get:function(){return this.GetLength()}},{key:"ParaFirst",get:function(){return this.GetParaFirst()},set:function(t){this.SetParaFirst(t)}},{key:"PageBreak",get:function(){return this.GetPageBreak()},set:function(t){this.SetPageBreak(t)}},{key:"HyperLink",get:function(){return this.GetHyperLink()},set:function(t){this.SetHyperLink(t)}},{key:"IsSelectComplate",get:function(){return this.GetSelectComplate()}},{key:"IsSelectPart",get:function(){return this.GetSelectPart()}},{key:"StyleNo",get:function(){return this.FStyleNo},set:function(t){this.FStyleNo=t}},{key:"ParaNo",get:function(){return this.FParaNo},set:function(t){this.FParaNo=t}},{key:"FirstDItemNo",get:function(){return this.FFirstDItemNo},set:function(t){this.FFirstDItemNo=t}},{key:"Active",get:function(){return this.FActive},set:function(t){this.SetActive(t)}},{key:"Visible",get:function(){return this.FVisible},set:function(t){this.FVisible=t}},{key:"PrintInvisible",get:function(){return this.FPrintInvisible},set:function(t){this.FPrintInvisible=t}}]),i}(L),Ws=function(t){Ds(i,t);var e=Rs(i);function i(){return Os(this,i),e.call(this)}return i}(V);function zs(t){return(zs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function js(t,e,i){return(js="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$s(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Xs(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ks(t,e,i){return e&&Xs(t.prototype,e),i&&Xs(t,i),t}function Ys(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Js(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Zs(t,e)}function Zs(t,e){return(Zs=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qs(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=$s(t);if(e){var o=$s(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Qs(this,i)}}function Qs(t,e){return!e||"object"!==zs(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function $s(t){return($s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ta=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).Stream=new K,t}return i}(L),ea=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).A=-1,t.B=-1,t}return i}(L),ia=function(t){Js(i,t);var e=qs(i);function i(){return Ys(this,i),e.call(this)}return Ks(i,[{key:"Row",get:function(){return this.A},set:function(t){this.A=t}},{key:"Col",get:function(){return this.B},set:function(t){this.B=t}}]),i}(ea),na=function(t){Js(i,t);var e=qs(i);function i(){return Ys(this,i),e.call(this)}return i}(ia),oa=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).FCol=-1,t}return Ks(i,[{key:"Col",get:function(){return this.FCol},set:function(t){this.FCol=t}},{key:"OldWidth",get:function(){return this.A},set:function(t){this.A=t}},{key:"NewWidth",get:function(){return this.B},set:function(t){this.B=t}}]),i}(ea),ra=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).FRow=-1,t}return Ks(i,[{key:"Row",get:function(){return this.FRow},set:function(t){this.FRow=t}},{key:"OldHeight",get:function(){return this.A},set:function(t){this.A=t}},{key:"NewHeight",get:function(){return this.B},set:function(t){this.B=t}}]),i}(ea),sa=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).FNewWidth=0,t.FNewHeight=0,t}return Ks(i,[{key:"OldWidth",get:function(){return this.A},set:function(t){this.A=t}},{key:"OldHeight",get:function(){return this.B},set:function(t){this.B=t}},{key:"NewWidth",get:function(){return this.FNewWidth},set:function(t){this.FNewWidth=t}},{key:"NewHeight",get:function(){return this.FNewHeight},set:function(t){this.FNewHeight=t}}]),i}(ea),aa=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).Tag=null,t.ItemNo=-1,t.Offset=-1,t.ParaFirst=!1,t}return i}(L),la=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).Text="",t}return i}(aa),ha=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).NextText="",t}return i}(la),ca=0,ua=1,fa=2,da=3,ma=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).Tag=wp.ItemProperty,t.ItemProperty=null,t}return i}(aa),ya=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).ItemProperty=ca,t.OldStyleNo=0,t.NewStyleNo=0,t}return i}(ma),pa=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).ItemProperty=ua,t.OldParaNo=0,t.NewParaNo=0,t}return i}(ma),Sa=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).ItemProperty=fa,t.OldParaFirst=0,t.NewParaFirst=0,t}return i}(ma),va=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).ItemProperty=da,t.OldPageBreak=0,t.NewPageBreak=0,t}return i}(ma),Fa=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).ItemStream=new K,t}return i}(aa),Ia=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).Tag=wp.ItemSelf,t.Object=null,t}return i}(aa),ga=function(t){Js(i,t);var e=qs(i);function i(){return Ys(this,i),e.call(this)}return i}(V),wa=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).Data=null,t}return Ks(i,[{key:"ActionAppend",value:function(t,e,i,n){var o=null;switch(t){case wp.BackDeleteText:case wp.DeleteText:case wp.InsertText:o=new la;break;case wp.SetItemText:o=new ha;break;case wp.DeleteItem:case wp.InsertItem:case wp.ItemMirror:o=new Fa;break;case wp.ItemSelf:o=new Ia;break;default:o=new aa}return o.Tag=t,o.ItemNo=e,o.Offset=i,o.ParaFirst=n,this.Actions.add(o),o}}]),i}(function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).IsUndo=!0,t.Actions=new ga,t}return i}(L)),Ca=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).CaretDrawItemNo=-1,t}return i}(wa),ka=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).HScrollPos=0,t.VScrollPos=0,t}return i}(Ca),Pa=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).SectionIndex=-1,t}return i}(ka),Da=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).ItemNo=-1,t.Offset=-1,t}return i}(Ca),ba=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).HScrollPos=0,t.VScrollPos=0,t}return i}(Da),Ra=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).SectionIndex=-1,t}return i}(ba),_a=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).ItemNo=-1,t.Offset=-1,t}return i}(Ca),xa=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).HScrollPos=0,t.VScrollPos=0,t}return i}(_a),Aa=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).SectionIndex=-1,t}return i}(xa),Ta=function(t){Js(i,t);var e=qs(i);function i(){var t;return Ys(this,i),(t=e.call(this)).FSeek=-1,t.FEnable=!0,t.FEnableStateStack=new W,t.FMaxUndoCount=99,t.FGroupWorking=!1,t.FGroupBeginIndex=-1,t.FGroupEndIndex=-1,t.FOnUndoNew=null,t.FOnUndoGroupStart=null,t.FOnUndoGroupEnd=null,t.FOnUndo=null,t.FOnRedo=null,t.FOnUndoDestroy=null,t.FOnUndoDestroy=null,t}return Ks(i,[{key:"doClear_",value:function(){js($s(i.prototype),"doClear_",this).call(this),this.FSeek=-1,this.FGroupBeginIndex=-1,this.FGroupEndIndex=-1}},{key:"doRemoved_",value:function(t){js($s(i.prototype),"doRemoved_",this).call(this,t),null!=this.FOnUndoDestroy&&this.FOnUndoDestroy(t)}},{key:"DoNewUndo",value:function(t){if(this.FSeek<this.count-1&&(this.FSeek>0?(this[this.FSeek].IsUndo&&this.FSeek++,this.removeRange(this.FSeek,this.count-this.FSeek)):this.clear()),this.count>this.FMaxUndoCount&&!this.FGroupWorking){var e=0,i=-1;if(this[0].isClass(Da)){for(var n=1;n<=this.count-1;n++)if(this[n].isClass(_a)){if(0==e){i=n;break}e--}else this[n].isClass(Da)&&e++;this.removeRange(0,i+1)}else this.removeAt(0)}this.add(t),this.FSeek=this.count-1}},{key:"UndoGroupBegin",value:function(t,e){this.FGroupWorking=!0;var i=null;(i=null!=this.FOnUndoGroupStart?this.FOnUndoGroupStart(t,e):new Da).ItemNo=t,i.Offset=e,this.DoNewUndo(i)}},{key:"UndoGroupEnd",value:function(t,e){if(this.last.isClass(Da))this.last.isClass(Da)&&this.delete(this.count-1);else{var i=null;(i=null!=this.FOnUndoGroupEnd?this.FOnUndoGroupEnd(t,e):new _a).ItemNo=t,i.Offset=e,this.DoNewUndo(i)}this.FGroupWorking=!1}},{key:"UndoNew",value:function(){var t=null;return t=null!=this.FOnUndoNew?this.FOnUndoNew():new wa,this.DoNewUndo(t),t}},{key:"DoSeekUndoEx",value:function(t){return null!=this.FOnUndo&&this.FOnUndo(this[t]),this[t].IsUndo=!1,--t}},{key:"Undo",value:function(){if(this.FSeek>=0){var t=0,e=-1;if(this[this.FSeek].isClass(_a)){t=0,e=0;for(var i=this.FSeek-1;i>=0;i--)if(this[i].isClass(Da)){if(0==t){e=i;break}t--}else this[i].isClass(_a)&&t++;this.FGroupBeginIndex=e,this.FGroupEndIndex=this.FSeek;try{for(this.FGroupWorking=!0;this.FSeek>=e;)this.FSeek==e&&(this.FGroupWorking=!1),this.FSeek=this.DoSeekUndoEx(this.FSeek)}finally{this.FGroupWorking=!1,this.FGroupBeginIndex=-1,this.FGroupEndIndex=-1}}else this.FSeek=this.DoSeekUndoEx(this.FSeek)}}},{key:"DoSeekRedoEx",value:function(t){return t++,null!=this.FOnRedo&&this.FOnRedo(this[t]),this[t].IsUndo=!0,t}},{key:"Redo",value:function(){if(this.FSeek<this.count-1){var t=-1,e=-1;if(this[this.FSeek+1].isClass(Da)){t=0,e=this.count-1;for(var i=this.FSeek+2;i<=this.count-1;i++)if(this[i].isClass(_a)){if(0==t){e=i;break}t--}else this[i].isClass(Da)&&t++;this.FGroupBeginIndex=this.FSeek+1,this.FGroupEndIndex=e;try{for(this.FGroupWorking=!0;this.FSeek<e;)this.FSeek==e-1&&(this.FGroupWorking=!1),this.FSeek=this.DoSeekRedoEx(this.FSeek)}finally{this.FGroupWorking=!1,this.FGroupBeginIndex=-1,this.FGroupEndIndex=-1}}else this.FSeek=this.DoSeekRedoEx(this.FSeek)}}},{key:"SaveState",value:function(){this.FEnableStateStack.push(this.FEnable)}},{key:"RestoreState",value:function(){this.FEnableStateStack.count>0&&(this.FEnable=this.FEnableStateStack.pop())}},{key:"Enable",get:function(){return this.FEnable},set:function(t){this.FEnable=t}},{key:"MaxUndoCount",get:function(){return this.FMaxUndoCount},set:function(t){this.FMaxUndoCount=t}},{key:"Seek",get:function(){return this.FSeek}},{key:"GroupWorking",get:function(){return this.FGroupWorking}},{key:"CurGroupBeginIndex",get:function(){return this.FGroupBeginIndex}},{key:"CurGroupEndIndex",get:function(){return this.FGroupEndIndex}},{key:"OnUndoNew",get:function(){return this.FOnUndoNew},set:function(t){this.FOnUndoNew=t}},{key:"OnUndoGroupStart",get:function(){return this.FOnUndoGroupStart},set:function(t){this.FOnUndoGroupStart=t}},{key:"OnUndoGroupEnd",get:function(){return this.FOnUndoGroupEnd},set:function(t){this.FOnUndoGroupEnd=t}},{key:"OnUndoDestroy",get:function(){return this.FOnUndoDestroy},set:function(t){this.FOnUndoDestroy=t}},{key:"OnUndo",get:function(){return this.FOnUndo},set:function(t){this.FOnUndo=t}},{key:"OnRedo",get:function(){return this.FOnRedo},set:function(t){this.FOnRedo=t}}]),i}(V);function Oa(t){return(Oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Na(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ba(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ea(t,e,i){return e&&Ba(t.prototype,e),i&&Ba(t,i),t}function Ma(t,e,i){return(Ma="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Va(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function La(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ga(t,e)}function Ga(t,e){return(Ga=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ha(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Va(t);if(e){var o=Va(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ua(this,i)}}function Ua(t,e){return!e||"object"!==Oa(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Va(t){return(Va=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Wa=function(t){La(i,t);var e=Ha(i);function i(t){var n;return Na(this,i),(n=e.call(this,t)).FOwnerData=t,n.FWidth=100,n.FHeight=50,n.ParaNo=t.CurParaNo,n.FOnGetMainUndoList=t.OnGetUndoList,n.FTextWrapping=!1,n.FIsFormatDirty=!1,n.FCanPageBreak=!1,n.FMangerUndo=!1,n}return Ea(i,[{key:"GetWidth",value:function(){return this.FWidth}},{key:"SetWidth",value:function(t){this.FWidth=t}},{key:"GetHeight",value:function(){return this.FHeight}},{key:"SetHeight",value:function(t){this.FHeight=t}},{key:"DoChange",value:function(){this.OwnerData.Change()}},{key:"SelfUndoListInitializate",value:function(t){var e=this;t.OnUndoNew=function(){return e.DoSelfUndoNew()},t.OnUndo=function(t){e.DoSelfUndo(t)},t.OnRedo=function(t){e.DoSelfRedo(t)},t.OnUndoDestroy=function(t){e.DoSelfUndoDestroy(t)}}},{key:"SelfUndo_New",value:function(){var t=this.GetSelfUndoList();null!=t&&t.Enable&&t.UndoNew()}},{key:"GetSelfUndoList",value:function(){if(null==this.FOnGetMainUndoList)return null;var t=this.FOnGetMainUndoList();if(null!=t&&t.Enable&&t.count>0&&t.last.Actions.count>0&&t.last.Actions.last.isClass(Ia)){var e=t.last.Actions.last;null==e.Object&&(e.Object=new Ta,this.SelfUndoListInitializate(e.Object)),t=e.Object}return t}},{key:"DoSelfUndoDestroy",value:function(t){null!=t.Data&&(t.Data.Dispose(),t.Data=null)}},{key:"DoSelfUndoNew",value:function(){return new wa}},{key:"DoSelfUndo",value:function(t){}},{key:"DoSelfRedo",value:function(t){}},{key:"GetPageBreakCount",value:function(){return 0}},{key:"ApplySelectParaStyle",value:function(t,e){}},{key:"MatchTextStyle",value:function(t,e){return!1}},{key:"ApplySelectTextStyle",value:function(t,e){}},{key:"ApplyContentAlign",value:function(t){}},{key:"FormatToDrawItem",value:function(t,e){}},{key:"ClearFormatExtraHeight",value:function(){return 0}},{key:"ReFormatActiveItem",value:function(){}},{key:"ReFormatRequest",value:function(){}},{key:"ActiveItemReAdaptEnvironment",value:function(){}},{key:"DeleteSelected",value:function(){return!1}},{key:"InsertAnnotate",value:function(t,e){return!1}},{key:"DeleteActiveAnnotate",value:function(){return!1}},{key:"DeleteActiveDomain",value:function(){return!1}},{key:"DeleteActiveDataItems",value:function(t,e,i){}},{key:"SetActiveItemText",value:function(t){}},{key:"MarkStyleUsed",value:function(t){}},{key:"SaveSelectToStream",value:function(t){}},{key:"SaveSelectToText",value:function(){return""}},{key:"GetActiveItem",value:function(){return this}},{key:"GetTopLevelItem",value:function(){return this}},{key:"GetTopLevelDrawItem",value:function(){return null}},{key:"GetTopLevelDrawItemCoord",value:function(){return G.Create(-1,-1)}},{key:"GetTopLevelRectDrawItem",value:function(){return null}},{key:"GetTopLevelRectDrawItemCoord",value:function(){return G.Create(-1,-1)}},{key:"GetOffsetAt",value:function(t){return t<=0?lp.OffsetBefor:t>=this.Width?lp.OffsetAfter:lp.OffsetInner}},{key:"CoordInSelect",value:function(t,e){return!!this.IsSelectComplate&&U.Create(0,0,this.FWidth,this.FHeight).pointInAt(t,e)}},{key:"WantKeyDown",value:function(t){return!1}},{key:"JustifySplit",value:function(){return!0}},{key:"GetCaretInfo",value:function(t){t.Visible=!1}},{key:"CheckFormatPageBreakBefor",value:function(){}},{key:"CheckFormatPageBreak",value:function(t,e,i,n,o,r,s,a,l){return s=-1,a=0,l=0,this.FCanPageBreak?(s=this.Height-r-(o-e),i>o&&(l=o-i)):(s=0,i>o&&(a=o-e)),{breakSeat:s,fmtOffset:a,fmtHeightInc:l}}},{key:"CheckPageSurplus",value:function(t){return 0}},{key:"InsertItem",value:function(t){return!1}},{key:"InsertText",value:function(t){return!1}},{key:"InsertGraphic",value:function(t,e){return!1}},{key:"InsertStream",value:function(t,e,i){return!1}},{key:"KeyDown",value:function(t){t.Handled=!0}},{key:"KeyPress",value:function(t){return 0}},{key:"IsSelectComplateTheory",value:function(){return this.IsSelectComplate||this.Active}},{key:"SelectExists",value:function(){return!1}},{key:"Search",value:function(t,e,i){return!1}},{key:"Clear",value:function(){}},{key:"GetActiveData",value:function(){return null}},{key:"GetTopLevelDataAt",value:function(t,e){return null}},{key:"GetTopLevelData",value:function(){return null}},{key:"FormatDirty",value:function(){this.FIsFormatDirty=!0}},{key:"TraverseItem",value:function(t){}},{key:"SaveToImage",value:function(t){if(0==this.FWidth||0==this.FHeight)return null;var e=new Us;e.Print=!0,e.WindowWidth=this.FWidth,e.WindowHeight=this.FHeight,e.ScaleX=1,e.ScaleY=1,e.Zoom=1;var i=null,n=Dt.CreateTemp(this.FWidth,this.FHeight);try{n.clear(0,0,this.FWidth,this.FHeight),this.DoPaint(this.OwnerData.Style,U.Create(0,0,this.FWidth,this.FHeight),0,this.FHeight,0,this.FHeight,n,e),i=n.toImage(t)}finally{Dt.DestroyTemp(n)}return i}},{key:"MouseDown",value:function(t){return this.Active=U.CreateByBounds(0,0,this.FWidth,this.FHeight).pointInAt(t.x,t.y),this.Active}},{key:"BreakByOffset",value:function(t){return null}},{key:"CanConcatItems",value:function(t){return!1}},{key:"Assign",value:function(t){Ma(Va(i.prototype),"Assign",this).call(this,t),this.FWidth=t.Width,this.FHeight=t.Height}},{key:"Undo",value:function(t){if(t.isClass(Ia)){var e=t.Object;null!=e?e.Undo():Ma(Va(i.prototype),"Undo",this).call(this,t)}else Ma(Va(i.prototype),"Undo",this).call(this,t)}},{key:"Redo",value:function(t){if(t.isClass(Ia)){var e=t.Object;null!=e?(e.Seek<0&&this.SelfUndoListInitializate(e),e.Redo()):Ma(Va(i.prototype),"Redo",this).call(this,t)}else Ma(Va(i.prototype),"Redo",this).call(this,t)}},{key:"SaveToStreamRange",value:function(t,e,n){Ma(Va(i.prototype),"SaveToStreamRange",this).call(this,t,e,n),t.writeInt32(this.FWidth),t.writeInt32(this.FHeight)}},{key:"LoadFromStream",value:function(t,e,n){Ma(Va(i.prototype),"LoadFromStream",this).call(this,t,e,n),this.FWidth=t.readInt32(),this.FHeight=t.readInt32(),this.FormatDirty()}},{key:"ToHtml",value:function(){var t=this.SaveToImage();return t?'<img width="'+this.FWidth.toString()+'" height="'+this.FHeight.toString()+'" src="'+t+'" alt="'+this.className+'" />':""}},{key:"ToXml",value:function(t){Ma(Va(i.prototype),"ToXml",this).call(this,t),t.SetAttribute("width",this.FWidth.toString()),t.SetAttribute("height",this.FHeight.toString())}},{key:"ParseXml",value:function(t){}},{key:"ToJSONString",value:function(){return Ma(Va(i.prototype),"ToJSONString",this).call(this)+',"Width":"'+this.FWidth+'","Height":"'+this.FHeight+'"'}},{key:"ParseJSONOjbect",value:function(t){Ma(Va(i.prototype),"ParseJSONOjbect",this).call(this,t),this.FWidth=t.width,this.FHeight=t.height}},{key:"GetLength",value:function(){return 1}},{key:"Width",get:function(){return this.GetWidth()},set:function(t){this.SetWidth(t)}},{key:"Height",get:function(){return this.GetHeight()},set:function(t){this.SetHeight(t)}},{key:"TextWrapping",get:function(){return this.FTextWrapping},set:function(t){this.FTextWrapping=t}},{key:"IsFormatDirty",get:function(){return this.FIsFormatDirty},set:function(t){this.FIsFormatDirty=t}},{key:"CanPageBreak",get:function(){return this.FCanPageBreak},set:function(t){this.FCanPageBreak=t}},{key:"PageBreakCount",get:function(){return this.GetPageBreakCount()}},{key:"OwnerData",get:function(){return this.FOwnerData}},{key:"MangerUndo",get:function(){return this.FMangerUndo}}],[{key:"Create",value:function(t,e,n){var o=new i(t);return o.Width=e,o.Height=n,o}}]),i}(Vs),za=function(t){La(i,t);var e=Ha(i);function i(t){var n;return Na(this,i),(n=e.call(this,t)).StyleNo=cs.Domain,n.FMarkType=Pp.Beg,n.FDrawRect=new U,n.FLevel=0,n.Width=0,n.Height=t.Style.TextStyles[0].FontHeight,n.Empty=!0,n}return Ea(i,[{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){Ma(Va(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l),l.Print||(this.FDrawRect.resetRect(e),l.topItems.add(this))}},{key:"GetOffsetAt",value:function(t){return t>=0&&t<=this.Width?this.FMarkType==Pp.Beg?lp.OffsetAfter:lp.OffsetBefor:Ma(Va(i.prototype),"GetOffsetAt",this).call(this,t)}},{key:"JustifySplit",value:function(){return!1}},{key:"FormatToDrawItem",value:function(t,e){if(this.Width=0,this.Height=t.Style.TextStyles[0].FontHeight,this.Empty=!1,this.MarkType==Pp.Beg)if(e<t.Items.count-1){var i=t.Items[e+1];i.StyleNo==this.StyleNo&&i.MarkType==Pp.End?(this.Width=10,this.Empty=!0):i.ParaFirst?this.Width=10:i.StyleNo>cs.Null&&(this.Height=t.Style.TextStyles[i.StyleNo].FontHeight)}else this.Width=10;else{var n=t.Items[e-1];n.StyleNo==this.StyleNo&&n.MarkType==Pp.Beg?(this.Width=10,this.Empty=!0):this.ParaFirst?this.Width=10:n.StyleNo>cs.Null&&(this.Height=t.Style.TextStyles[n.StyleNo].FontHeight)}}},{key:"PaintTop",value:function(t){Ma(Va(i.prototype),"PaintTop",this).call(this,t),t.pen.width=1,this.FMarkType==Pp.Beg?(t.pen.width=1,t.pen.style=pt.Solid,t.pen.color=at.Blue,t.drawLineByPointsDriect(new Array(G.Create(this.FDrawRect.left+3,this.FDrawRect.top-1),G.Create(this.FDrawRect.left,this.FDrawRect.top-1),G.Create(this.FDrawRect.left,this.FDrawRect.bottom+1))),t.moveTo(this.FDrawRect.left,this.FDrawRect.bottom+1),t.lineTo(this.FDrawRect.left+3,this.FDrawRect.bottom+1)):(t.pen.width=1,t.pen.style=pt.Solid,t.pen.color=at.Blue,t.drawLineByPointsDriect(new Array(G.Create(this.FDrawRect.right-3,this.FDrawRect.top-1),G.Create(this.FDrawRect.right,this.FDrawRect.top-1),G.Create(this.FDrawRect.right,this.FDrawRect.bottom+1))),t.moveTo(this.FDrawRect.right,this.FDrawRect.bottom+1),t.lineTo(this.FDrawRect.right-3,this.FDrawRect.bottom+1))}},{key:"SaveToBitmap",value:function(t){return!1}},{key:"SaveToStreamRange",value:function(t,e,n){Ma(Va(i.prototype),"SaveToStreamRange",this).call(this,t,e,n),t.writeByte(this.FMarkType),t.writeByte(this.FLevel)}},{key:"LoadFromStream",value:function(t,e,n){Ma(Va(i.prototype),"LoadFromStream",this).call(this,t,e,n),this.FMarkType=t.readByte(),n>38&&(this.FLevel=t.readByte())}},{key:"ToXml",value:function(t){}},{key:"ParseXml",value:function(t){}},{key:"MarkType",get:function(){return this.FMarkType},set:function(t){this.FMarkType=t}},{key:"Level",get:function(){return this.FLevel},set:function(t){this.FLevel=t}}],[{key:"IsBeginMark",value:function(t){return t.isClass(i)&&t.MarkType==Pp.Beg}},{key:"IsEndMark",value:function(t){return t.isClass(i)&&t.MarkType==Pp.End}}]),i}(Wa),ja=0,Xa=1,Ka=2,Ya=function(t){La(i,t);var e=Ha(i);function i(t){var n;return Na(this,i),(n=e.call(this,t)).FTextStyleNo=0,t.CurStyleNo>cs.Null&&(n.FTextStyleNo=t.CurStyleNo),n}return Ea(i,[{key:"SetTextStyleNo",value:function(t){this.FTextStyleNo!=t&&(this.FTextStyleNo=t)}},{key:"Assign",value:function(t){Ma(Va(i.prototype),"Assign",this).call(this,t),this.FTextStyleNo=t.TextStyleNo}},{key:"GetOffsetAt",value:function(t){return t<this.Width/2?lp.OffsetBefor:lp.OffsetAfter}},{key:"JustifySplit",value:function(){return!1}},{key:"MatchTextStyle",value:function(t,e){return e.Append=!e.StyleHasMatch(t,this.FTextStyleNo),!0}},{key:"ApplySelectTextStyle",value:function(t,e){this.FTextStyleNo=e.GetMatchStyleNo(t,this.FTextStyleNo)}},{key:"MarkStyleUsed",value:function(t){t?this.OwnerData.Style.TextStyles[this.FTextStyleNo].CheckSaveUsed=!0:this.FTextStyleNo=this.OwnerData.Style.TextStyles[this.FTextStyleNo].TempNo}},{key:"SelectExists",value:function(){return this.GetSelectComplate()}},{key:"SaveToStreamRange",value:function(t,e,n){Ma(Va(i.prototype),"SaveToStreamRange",this).call(this,t,e,n),t.writeInt32(this.FTextStyleNo)}},{key:"LoadFromStream",value:function(t,e,n){Ma(Va(i.prototype),"LoadFromStream",this).call(this,t,e,n),this.FTextStyleNo=t.readInt32(),this.OwnerData.Style.States.Contain(Ip.Loading)?null!=e&&this.FTextStyleNo>e.TextStyles.count-1&&(this.FTextStyleNo=0):this.FTextStyleNo=null!=e?this.OwnerData.Style.GetStyleNo(e.TextStyles[this.FTextStyleNo],!0):0}},{key:"ToXml",value:function(t){}},{key:"ParseXml",value:function(t){}},{key:"ToJSONString",value:function(){return Ma(Va(i.prototype),"ToJSONString",this).call(this)+',"Text":"'+this.FText+'"'}},{key:"ParseJSONOjbect",value:function(t){Ma(Va(i.prototype),"ParseJSONOjbect",this).call(this,t),this.Text=t.text}},{key:"TextStyleNo",get:function(){return this.FTextStyleNo},set:function(t){this.SetTextStyleNo(t)}}]),i}(Wa),Ja=function(t){La(i,t);var e=Ha(i);function i(t){var n;return Na(this,i),(n=e.call(this,t)).FMouseIn=!1,n.FAutoSize=!0,n.FEnabled=!0,n.FPaddingLeft=5,n.FPaddingRight=5,n.FPaddingTop=5,n.FPaddingBottom=5,n.FMinWidth=20,n.FMinHeight=10,n.Tag=0,n}return Ea(i,[{key:"DoClick",value:function(){null!=this.OnClick&&this.OwnerData.CanEdit()&&this.OnClick()}},{key:"KeyDown",value:function(t){null!=this.OnKeyDown&&this.OnKeyDown(t)}},{key:"SetActive",value:function(t){t||(this.FMouseIn=!1),Ma(Va(i.prototype),"SetActive",this).call(this,t)}},{key:"MouseEnter",value:function(){this.FMouseIn=!0,Ma(Va(i.prototype),"MouseEnter",this).call(this)}},{key:"MouseLeave",value:function(){this.FMouseIn=!1,Ma(Va(i.prototype),"MouseLeave",this).call(this)}},{key:"MouseUp",value:function(t){t.button==ee&&this.FEnabled&&this.ClientRect().pointInAt(t.x,t.y)&&this.DoClick()}},{key:"Assign",value:function(t){Ma(Va(i.prototype),"Assign",this).call(this,t),this.FAutoSize=t.AutoSize,this.FEnabled=t.Enabled}},{key:"SaveToStreamRange",value:function(t,e,n){Ma(Va(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FAutoSize&&(o|=128),this.FEnabled&&(o|=64),t.writeByte(o),t.writeInt32(this.Tag)}},{key:"LoadFromStream",value:function(t,e,n){if(Ma(Va(i.prototype),"LoadFromStream",this).call(this,t,e,n),n<51)this.FAutoSize=t.readBoolean();else{var o=t.readByte();this.FAutoSize=or.system.isOdd(o>>7),this.FEnabled=or.system.isOdd(o>>6),this.Tag=n>53?t.readInt32():0}}},{key:"ToXml",value:function(t){Ma(Va(i.prototype),"ToXml",this).call(this,t),this.FAutoSize&&t.SetAttribute("autosize","1"),this.FEnabled&&t.SetAttribute("enabled","1"),t.SetAttribute("tag",this.Tag.toString())}},{key:"ParseXml",value:function(t){Ma(Va(i.prototype),"ParseXml",this).call(this,t),t.HasAttribute("autosize")?this.FAutoSize="1"==t.GetAttribute("autosize"):this.FAutoSize=!1,t.HasAttribute("enabled")?this.FEnabled="1"==t.GetAttribute("enabled"):this.FEnabled=!0,t.HasAttribute("tag")?this.Tag=parseInt(t.GetAttribute("tag")):this.Tag=0}},{key:"ClientRect",value:function(){return U.Create(0,0,this.Width,this.Height)}},{key:"AutoSize",get:function(){return this.FAutoSize},set:function(t){this.FAutoSize=t}},{key:"Enabled",get:function(){return this.FEnabled},set:function(t){this.FEnabled=t}}]),i}(Ya),Za=0,qa=1,Qa=2,$a=3,tl=4,el=5,il=6,nl=7,ol=8,rl=function(t){La(i,t);var e=Ha(i);function i(t){var n;return Na(this,i),(n=e.call(this,t)).FCanResize=!0,n.FGripSize=8,n.FResizing=!1,n.FResizeRect=null,n.FResizeWidth=0,n.FResizeHeight=0,n.FResizeX=0,n.FResizeY=0,n}return Ea(i,[{key:"Assign",value:function(t){Ma(Va(i.prototype),"Assign",this).call(this,t),this.FCanResize=t.CanResize}},{key:"GetGripType",value:function(t,e){var i=G.Create(t,e);return U.CreateByBounds(0,0,this.GripSize,this.GripSize).pointIn(i)?qa:U.CreateByBounds(this.Width-this.GripSize,0,this.GripSize,this.GripSize).pointIn(i)?Qa:U.CreateByBounds(0,this.Height-this.GripSize,this.GripSize,this.GripSize).pointIn(i)?$a:U.CreateByBounds(this.Width-this.GripSize,this.Height-this.GripSize,this.GripSize,this.GripSize).pointIn(i)?tl:Za}},{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){if(Ma(Va(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l),!l.Print&&this.Active){if(this.Resizing){switch(this.FResizeGrip){case qa:this.FResizeRect=U.CreateByBounds(e.left+this.Width-this.FResizeWidth,e.top+this.Height-this.FResizeHeight,this.FResizeWidth,this.FResizeHeight);break;case Qa:this.FResizeRect=U.CreateByBounds(e.left,e.top+this.Height-this.FResizeHeight,this.FResizeWidth,this.FResizeHeight);break;case $a:this.FResizeRect=U.CreateByBounds(e.left+this.Width-this.FResizeWidth,e.top,this.FResizeWidth,this.FResizeHeight);break;case tl:this.FResizeRect=U.CreateByBounds(e.left,e.top,this.FResizeWidth,this.FResizeHeight)}l.topItems.add(this)}this.AllowResize&&(a.brush.color=at.Gray,a.fillRect(U.CreateByBounds(e.left,e.top,this.GripSize,this.GripSize)),a.fillRect(U.CreateByBounds(e.right-this.GripSize,e.top,this.GripSize,this.GripSize)),a.fillRect(U.CreateByBounds(e.left,e.bottom-this.GripSize,this.GripSize,this.GripSize)),a.fillRect(U.CreateByBounds(e.right-this.GripSize,e.bottom-this.GripSize,this.GripSize,this.GripSize)))}}},{key:"MouseDown",value:function(t){this.FResizeGrip=Za;var e=Ma(Va(i.prototype),"MouseDown",this).call(this,t);return this.Active&&this.AllowResize&&(this.FResizeGrip=this.GetGripType(t.x,t.y),this.FResizing=this.FResizeGrip!=Za,this.FResizing&&(this.FResizeX=t.x,this.FResizeY=t.y,this.FResizeWidth=this.Width,this.FResizeHeight=this.Height)),e}},{key:"SelfUndo_Resize",value:function(t,e){var i=this.GetSelfUndoList();if(null!=i&&i.Enable){this.SelfUndo_New();var n=i.last;if(null!=n){var o=new sa;o.OldWidth=this.Width,o.OldHeight=this.Height,o.NewWidth=t,o.NewHeight=e,n.Data=o}}}},{key:"DoSelfUndoDestroy",value:function(t){null!=t.Data&&t.Data.isClass(sa)&&(t.Data.Dispose(),t.Data=null),Ma(Va(i.prototype),"DoSelfUndoDestroy",this).call(this,t)}},{key:"DoSelfUndo",value:function(t){if(t.Data)if(t.Data.isClass(sa)){var e=t.Data;this.Width=e.OldWidth,this.Height=e.OldHeight}else Ma(Va(i.prototype),"DoSelfUndo",this).call(this,t);else Ma(Va(i.prototype),"DoSelfUndo",this).call(this,t)}},{key:"DoSelfRedo",value:function(t){if(t.Data)if(t.Data.isClass(sa)){var e=t.Data;this.Width=e.NewWidth,this.Height=e.NewHeight}else Ma(Va(i.prototype),"DoSelfRedo",this).call(this,t);else Ma(Va(i.prototype),"DoSelfRedo",this).call(this,t)}},{key:"GetResizing",value:function(){return this.FResizing}},{key:"SetResizing",value:function(t){this.FResizing!=t&&(this.FResizing=t)}},{key:"GetAllowResize",value:function(){return this.FCanResize&&this.OwnerData.CanEdit()}},{key:"CoordInSelect",value:function(t,e){return this.SelectExists()&&U.CreateByBounds(0,0,this.Width,this.Height).pointInAt(t,e)&&this.GetGripType(t,e)==Za}},{key:"PaintTop",value:function(t){Ma(Va(i.prototype),"PaintTop",this).call(this,t),this.FResizing&&(t.brush.style=Ft,t.rectangleRect(this.FResizeRect),t.brush.color=at.White,t.font.size=8,t.font.color=at.Black,t.font.styles.value=0,t.textOut(this.FResizeRect.left+2,this.FResizeRect.top+2,this.FResizeWidth+" x "+this.FResizeHeight))}},{key:"MouseMove",value:function(t){var e=Ma(Va(i.prototype),"MouseMove",this).call(this,t);if(lp.GCursor=oe,this.Active&&this.AllowResize){var n=0,o=0,r=0,s=0,a=0;if(this.FResizing)switch(a=this.Width/this.Height,n=t.x-this.FResizeX,o=t.y-this.FResizeY,this.FResizeGrip){case qa:r=Math.round(o*a),s=Math.round(n/a),r>n?o=s:n=r,this.FResizeWidth=this.Width-n,this.FResizeHeight=this.Height-o;break;case Qa:r=Math.abs(Math.round(o*a)),s=Math.abs(Math.round(n/a)),n<0?o>s?o=s:n=o>0?-r:r:-o<s?o=-s:n=r,this.FResizeWidth=this.Width+n,this.FResizeHeight=this.Height-o;break;case $a:r=Math.abs(Math.round(o*a)),s=Math.abs(Math.round(n/a)),n<0?o<s?o=s:n=-r:n>r||o>s?n=o<0?r:-r:o=-s,this.FResizeWidth=this.Width-n,this.FResizeHeight=this.Height+o;break;case tl:r=Math.round(o*a),s=Math.round(n/a),r>n?n=r:o=s,this.FResizeWidth=this.Width+n,this.FResizeHeight=this.Height+o}else switch(this.GetGripType(t.x,t.y)){case qa:case tl:lp.GCursor=pe;break;case Qa:case $a:lp.GCursor=me;break;case el:case nl:lp.GCursor=Se;break;case il:case ol:lp.GCursor=ye}}return e}},{key:"MouseUp",value:function(t){var e=Ma(Va(i.prototype),"MouseUp",this).call(this,t);if(this.FResizing){if(this.FResizeWidth<0||this.FResizeHeight<0)return this.FResizing=!1,e;this.SelfUndo_Resize(this.FResizeWidth,this.FResizeHeight),this.Width=this.FResizeWidth,this.Height=this.FResizeHeight,this.FResizing=!1}return e}},{key:"CanDrag",value:function(){return!this.FResizing}},{key:"SelectExists",value:function(){return this.IsSelectComplateTheory()}},{key:"IsSelectComplateTheory",value:function(){return!!this.AllowResize&&Ma(Va(i.prototype),"IsSelectComplateTheory",this).call(this)}},{key:"GetOffsetAt",value:function(t){return this.AllowResize?Ma(Va(i.prototype),"GetOffsetAt",this).call(this,t):t<this.Width/2?lp.OffsetBefor:lp.OffsetAfter}},{key:"SaveToStreamRange",value:function(t,e,n){Ma(Va(i.prototype),"SaveToStreamRange",this).call(this,t,e,n),t.writeBoolean(this.FCanResize)}},{key:"LoadFromStream",value:function(t,e,n){Ma(Va(i.prototype),"LoadFromStream",this).call(this,t,e,n),n>44&&(this.FCanResize=t.readBoolean())}},{key:"ToXml",value:function(t){Ma(Va(i.prototype),"ToXml",this).call(this,t),t.SetAttribute("canresize",this.FCanResize.toString())}},{key:"ParseXml",value:function(t){Ma(Va(i.prototype),"ParseXml",this).call(this,t),this.FCanResize=t.GetAttribute("canresize")}},{key:"RestrainSize",value:function(t,e){}},{key:"ResizeGrip",get:function(){return this.FResizeGrip}},{key:"ResizeRect",get:function(){return this.FResizeRect}},{key:"GripSize",get:function(){return this.FGripSize},set:function(t){this.FGripSize=t}},{key:"Resizing",get:function(){return this.GetResizing()},set:function(t){this.SetResizing(t)}},{key:"ResizeWidth",get:function(){return this.FResizeWidth}},{key:"ResizeHeight",get:function(){return this.FResizeHeight}},{key:"CanResize",get:function(){return this.FCanResize},set:function(t){this.FCanResize=t}},{key:"AllowResize",get:function(){return this.GetAllowResize()}}],[{key:"Create",value:function(t,e,n){var o=new i(t);return o.Width=e,o.Height=n,o.CanResize=!0,o.GripSize=8,o}}]),i}(Wa),sl=function(t){La(i,t);var e=Ha(i);function i(t){return Na(this,i),e.call(this,t)}return Ea(i,[{key:"GetOffsetAt",value:function(t){return t<this.Width/2?lp.OffsetBefor:lp.OffsetAfter}}]),i}(Wa),al=function(t){La(i,t);var e=Ha(i);function i(t){return Na(this,i),e.call(this,t)}return Ea(i,[{key:"DoChange",value:function(){this.FormatDirty(),Ma(Va(i.prototype),"DoChange",this).call(this)}}]),i}(rl);function ll(t){return(ll="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cl(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ul(t,e,i){return e&&cl(t.prototype,e),i&&cl(t,i),t}function fl(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&dl(t,e)}function dl(t,e){return(dl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ml(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=pl(t);if(e){var o=pl(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yl(this,i)}}function yl(t,e){return!e||"object"!==ll(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function pl(t){return(pl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}za.HCDefaultDomainItemClass=za;var Sl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).constructor.prototype===i.prototype&&or.exception("THCStyleMatch类为抽象类,不可直接实例使用!"),"function"!=typeof t.DoMatchCur&&or.exception(t.prototype+" 没有实现DoMatchCur方法!"),"function"!=typeof t.DoMatchNew&&or.exception(t.prototype+" 没有实现DoMatchNew方法!"),t.FAppend=!1,t.FLock=!1,t.FOnTextStyle=null,t}return ul(i,[{key:"SetAppend",value:function(t){this.FAppend==t||this.FLock||(this.FAppend=t),this.FLock=!0}},{key:"GetMatchStyleNo",value:function(t,e){if(this.DoMatchCur(t.TextStyles[e]))return e;var i=new Er;return i.AssignEx(t.TextStyles[e]),this.DoMatchNew(i),null!=this.FOnTextStyle&&this.FOnTextStyle(e,i),t.GetStyleNo(i,!0)}},{key:"StyleHasMatch",value:function(t,e){return!1}},{key:"Append",get:function(){return this.FAppend},set:function(t){this.SetAppend(t)}},{key:"OnTextStyle",get:function(){return this.FOnTextStyle},set:function(t){this.FOnTextStyle=t}}]),i}(L),vl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).FontStyle=0,t}return ul(i,[{key:"DoMatchCur",value:function(t){return this.Append&&t.FontStyles.has(this.FontStyle)}},{key:"DoMatchNew",value:function(t){this.Append?(this.FontStyle==Or?t.FontStyles.remove(Nr):this.FontStyle==Nr&&t.FontStyles.remove(Or),t.FontStyles.add(this.FontStyle)):t.FontStyles.remove(this.FontStyle)}},{key:"StyleHasMatch",value:function(t,e){return t.TextStyles[e].FontStyles.has(this.FontStyle)}}]),i}(Sl),Fl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).FontName="",t}return ul(i,[{key:"DoMatchCur",value:function(t){return t.Family==this.FontName}},{key:"DoMatchNew",value:function(t){t.Family=this.FontName}}]),i}(Sl),Il=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).FontSize=10,t}return ul(i,[{key:"DoMatchCur",value:function(t){return t.Size==this.FontSize}},{key:"DoMatchNew",value:function(t){t.Size=this.FontSize}}]),i}(Sl),gl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).Color="black",t}return ul(i,[{key:"DoMatchCur",value:function(t){return at.sameColor(t.Color,this.Color)}},{key:"DoMatchNew",value:function(t){t.Color=this.Color}}]),i}(Sl),wl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).Color="white",t}return ul(i,[{key:"DoMatchCur",value:function(t){return t.BackColor==this.Color}},{key:"DoMatchNew",value:function(t){t.BackColor=this.Color}}]),i}(Sl),Cl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).StyleNo=0,t}return ul(i,[{key:"DoMatchCur",value:function(t){return!1}},{key:"DoMatchNew",value:function(t){}},{key:"GetMatchStyleNo",value:function(t,e){return this.StyleNo}},{key:"StyleHasMatch",value:function(t,e){return!1}}]),i}(Sl),kl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).constructor.prototype===Sl.prototype&&or.exception("THCParaMatch类为抽象类,不可直接实例使用!"),"function"!=typeof t.DoMatchCurPara&&or.exception(t.prototype+" 没有实现DoMatchCurPara方法!"),"function"!=typeof t.DoMatchNewPara&&or.exception(t.prototype+" 没有实现DoMatchNewPara方法!"),t}return ul(i,[{key:"GetMatchParaNo",value:function(t,e){if(this.DoMatchCurPara(t.ParaStyles[e]))return e;var i=new wr;return i.AssignEx(t.ParaStyles[e]),this.DoMatchNewPara(i),t.GetParaNo(i,!0)}}]),i}(L),Pl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).Align=dr,t}return ul(i,[{key:"DoMatchCurPara",value:function(t){return t.AlignHorz==this.Align}},{key:"DoMatchNewPara",value:function(t){t.AlignHorz=this.Align}}]),i}(kl),Dl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).Align=Fr,t}return ul(i,[{key:"DoMatchCurPara",value:function(t){return t.AlignVert==this.Align}},{key:"DoMatchNewPara",value:function(t){t.AlignVert=this.Align}}]),i}(kl),bl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).SpaceMode=gr.PLS100,t.Space=1,t}return ul(i,[{key:"DoMatchCurPara",value:function(t){return!(this.SpaceMode!=t.LineSpaceMode)&&(this.SpaceMode==gr.Fix?this.Space==t.LineSpace:this.SpaceMode!=gr.Mult||this.Space==t.LineSpace)}},{key:"DoMatchNewPara",value:function(t){t.LineSpaceMode=this.SpaceMode,t.LineSpace=this.Space}}]),i}(kl),Rl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).BackColor="white",t}return ul(i,[{key:"DoMatchCurPara",value:function(t){return t.BackColor==this.BackColor}},{key:"DoMatchNewPara",value:function(t){t.BackColor=this.BackColor}}]),i}(kl),_l=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).BreakRough=!1,t}return ul(i,[{key:"DoMatchCurPara",value:function(t){return t.BreakRough==this.BreakRough}},{key:"DoMatchNewPara",value:function(t){t.BreakRough=this.BreakRough}}]),i}(kl),xl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).Indent=0,t}return ul(i,[{key:"DoMatchCurPara",value:function(t){return t.FirstIndent==this.Indent}},{key:"DoMatchNewPara",value:function(t){t.FirstIndent=this.Indent}}]),i}(kl),Al=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).Indent=0,t}return ul(i,[{key:"DoMatchCurPara",value:function(t){return t.LeftIndent==this.Indent}},{key:"DoMatchNewPara",value:function(t){t.LeftIndent=this.Indent}}]),i}(kl),Tl=function(t){fl(i,t);var e=ml(i);function i(){var t;return hl(this,i),(t=e.call(this)).Indent=0,t}return ul(i,[{key:"DoMatchCurPara",value:function(t){return t.RightIndent==this.Indent}},{key:"DoMatchNewPara",value:function(t){t.RightIndent=this.Indent}}]),i}(kl);function Ol(t){return(Ol="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nl(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Bl(t,e,i){return(Bl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Gl(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function El(t,e){return(El=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ml(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Gl(t);if(e){var o=Gl(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ll(this,i)}}function Ll(t,e){return!e||"object"!==Ol(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Gl(t){return(Gl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Hl=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&El(t,e)}(r,t);var e,i,n,o=Ml(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this)).FText=t,e.FHyperLink="",e}return e=r,(i=[{key:"GetText",value:function(){return this.FText}},{key:"SetText",value:function(t){this.FText=lp.HCDeleteBreak(t.toString())}},{key:"GetHyperLink",value:function(){return this.FHyperLink}},{key:"SetHyperLink",value:function(t){this.FHyperLink=t}},{key:"GetLength",value:function(){return this.FText.length}},{key:"TextEffective",value:function(){return this.GetText()}},{key:"SubStringEffective",value:function(t,e){return this.SubString(t,e)}},{key:"Assign",value:function(t){Bl(Gl(r.prototype),"Assign",this).call(this,t),this.FText=t.Text,this.FHyperLink=t.HyperLink}},{key:"BreakByOffset",value:function(t){var e=null;return t>=this.Length||t<=0||((e=Bl(Gl(r.prototype),"BreakByOffset",this).call(this,t)).Text=this.SubString(t+1,this.Length-t),this.FText=this.FText.substr(0,t)),e}},{key:"CanConcatItems",value:function(t){var e=Bl(Gl(r.prototype),"CanConcatItems",this).call(this,t);return e&&(e=this.FHyperLink==t.HyperLink),e}},{key:"AcceptAction",value:function(t,e,i){var n=Bl(Gl(r.prototype),"AcceptAction",this).call(this,t,e,i);return n&&""!=this.FHyperLink&&i==wp.ConcatText&&(n=!1),n}},{key:"SaveToStreamRange",value:function(t,e,i){Bl(Gl(r.prototype),"SaveToStreamRange",this).call(this,t,e,i);var n=this.SubString(e+1,i-e),o=A.getBytes(n),s=o.length;s>lp.HC_TEXTMAXSIZE&&or.exception(lp.HCS_EXCEPTION_TEXTOVER),t.writeUInt32(s),s>0&&t.writeBuffer(o),lp.HCSaveTextToStream(t,this.FHyperLink)}},{key:"LoadFromStream",value:function(t,e,i){Bl(Gl(r.prototype),"LoadFromStream",this).call(this,t,e,i);var n=t.readUInt32();if(n>0){var o=t.readBuffer(n);this.FText=A.getString(o)}this.FHyperLink=i>34?lp.HCLoadTextFromStream(t,i):""}},{key:"ToHtml",value:function(){return'<a class="fs'+this.StyleNo.toString()+'">'+this.Text+"</a>"}},{key:"ToXml",value:function(t){Bl(Gl(r.prototype),"ToXml",this).call(this,t),""!=this.FHyperLink&&t.SetAttribute("link",this.FHyperLink),t.Value=this.FText}},{key:"ParseXml",value:function(t){Bl(Gl(r.prototype),"ParseXml",this).call(this,t),t.HasAttribute("link")&&(this.FHyperLink=t.GetAttribute("link")),this.FText=t.Value}},{key:"ToJSONString",value:function(){return Bl(Gl(r.prototype),"ToJSONString",this).call(this)+',"Text":"'+this.FText+'","HyperLink":"'+this.FHyperLink+'"'}},{key:"ParseJSONOjbect",value:function(t){Bl(Gl(r.prototype),"ParseJSONOjbect",this).call(this,t),this.FText=t.text,this.FHyperLink=t.hyperlink}},{key:"SubString",value:function(t,e){return this.FText.substr(t-1,e)}}])&&Nl(e.prototype,i),n&&Nl(e,n),r}(Vs);function Ul(t){return(Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vl(t,e,i){return(Vl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Zl(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Wl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zl(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function jl(t,e,i){return e&&zl(t.prototype,e),i&&zl(t,i),t}function Xl(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Kl(t,e)}function Kl(t,e){return(Kl=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Yl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Zl(t);if(e){var o=Zl(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Jl(this,i)}}function Jl(t,e){return!e||"object"!==Ul(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Zl(t){return(Zl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Hl.HCDefaultTextItemClass=Hl;var ql=function(t){Xl(i,t);var e=Yl(i);function i(){var t;return Wl(this,i),(t=e.call(this)).Clear(),t}return jl(i,[{key:"Clear",value:function(){this.Data=null,this.BeginNo=-1,this.EndNo=-1}},{key:"Assign",value:function(t){this.Data=t.Data,this.BeginNo=t.BeginNo,this.EndNo=t.EndNo}},{key:"Contain",value:function(t){return t>=this.BeginNo&&t<=this.EndNo}}]),i}(L),Ql=function(t){Xl(i,t);var e=Yl(i);function i(){var t;return Wl(this,i),(t=e.call(this)).Parent=null,t.Childs=new V(!1),t}return jl(i,[{key:"Clear",value:function(){if(Vl(Zl(i.prototype),"Clear",this).call(this),null!=this.Childs){for(var t=0;t<this.Childs.count;t++)this.Childs[t].Clear(),this.Childs[t]=null;this.Childs.clear()}}},{key:"AppendChild",value:function(){var t=new i;return t.Parent=this,this.Childs.add(t),t}}]),i}(ql),$l=function(t){Xl(i,t);var e=Yl(i);function i(){var t;return Wl(this,i),(t=e.call(this)).SectionIndex=-1,t.Areas=new Set([]),t.Tag=0,t.Stop=!1,t.ReverseOrder=!1,t.Process=null,t.DomainNode=new Ql,t.DomainStack=new W,t.DomainStack.push(t.DomainNode),t}return i}(L),th=function(t){Xl(i,t);var e=Yl(i);function i(){var t;return Wl(this,i),(t=e.call(this)).Initialize(),t}return jl(i,[{key:"Initialize",value:function(){this.StartItemNo=-1,this.StartItemOffset=-1,this.StartRestrain=!1,this.EndItemNo=-1,this.EndItemOffset=-1}}]),i}(L),eh=function(t){Xl(i,t);var e=Yl(i);function i(t){var n;return Wl(this,i),(n=e.call(this)).FParentData=null,n.FStyle=t,n.FCurStyleNo=-1,n.FCurParaNo=-1,n.FDrawItems=new ks,n.FItems=new Ws,n.FItems.onAdded=function(t){n.DoInsertItem(t)},n.FItems.onRemoved=function(t){n.DoRemoveItem_(t)},n.FLoading=!1,n.FCurStyleNo=0,n.FCurParaNo=0,n.FCaretDrawItemNo=-1,n.FSelectInfo=new th,n.OnInsertItem=null,n.OnRemoveItem=null,n.OnSaveItem=null,n.OnGetUndoList=null,n.OnCurParaNoChange=null,n.OnChange=null,n.OnDrawItemPaintBefor=null,n.OnDrawItemPaintAfter=null,n.OnDrawItemPaintContent=null,n}return jl(i,[{key:"DoRemoveItem_",value:function(t){this.FStyle.States.Contain(Ip.Destroying)||this.DoRemoveItem(t)}},{key:"DrawItemPaintBefor",value:function(t,e,i,n,o,r,s,a,l,h,c,u){c.save();try{this.DoDrawItemPaintBefor(t,e,i,n,o,r,s,a,l,h,c,u)}finally{c.restore()}}},{key:"DrawItemPaintAfter",value:function(t,e,i,n,o,r,s,a,l,h,c,u){c.save();try{this.DoDrawItemPaintAfter(t,e,i,n,o,r,s,a,l,h,c,u)}finally{c.restore()}}},{key:"DrawItemPaintContent",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){u.save();try{this.DoDrawItemPaintContent(t,e,i,n,o,r,s,a,l,h,c,u,f)}finally{u.restore()}}},{key:"SetCurStyleNo",value:function(t){this.FCurStyleNo!=t&&(this.FCurStyleNo=t)}},{key:"SetCurParaNo",value:function(t){this.FCurParaNo!=t&&(this.FCurParaNo=t,null!=this.OnCurParaNoChange&&this.OnCurParaNoChange(this,null))}},{key:"MatchTextStyleNoAt",value:function(t,e){return this.FItems[t].StyleNo<cs.Null?e==lp.OffsetBefor?this.FItems[t].ParaFirst||this.FItems[t-1].StyleNo<cs.Null?this.FStyle.GetStyleNo(this.FStyle.DefaultTextStyle,!0):this.FItems[t-1].StyleNo:e==lp.OffsetAfter?t<this.FItems.count-1?this.FItems[t+1].ParaFirst||this.FItems[t+1].StyleNo<cs.Null?this.FStyle.GetStyleNo(this.FStyle.DefaultTextStyle,!0):this.FItems[t+1].StyleNo:this.FStyle.GetStyleNo(this.FStyle.DefaultTextStyle,!0):this.FItems[t].isClass(Ya)?this.FItems[t].TextStyleNo:this.FStyle.GetStyleNo(this.FStyle.DefaultTextStyle,!0):this.FItems[t].StyleNo}},{key:"MergeItemText",value:function(t,e){var i=t.CanConcatItems(e);return i&&(t.Text=t.Text+e.Text),i}},{key:"MergeItemToPrio",value:function(t){return t>0&&!this.FItems[t].ParaFirst&&this.MergeItemText(this.FItems[t-1],this.FItems[t])}},{key:"MergeItemToNext",value:function(t){return t<this.FItems.count-1&&!this.FItems[t+1].ParaFirst&&this.MergeItemText(this.FItems[t],this.FItems[t+1])}},{key:"CalcContentHeight",value:function(){return this.FDrawItems.count>0?this.FDrawItems.last.rect.bottom-this.FDrawItems[0].rect.top:0}},{key:"CheckItemSelectedState",value:function(t){t>this.FSelectInfo.StartItemNo&&t<this.FSelectInfo.EndItemNo?this.FItems[t].SelectComplate():t==this.FSelectInfo.StartItemNo?t==this.FSelectInfo.EndItemNo?this.FItems[t].StyleNo<cs.Null?this.FSelectInfo.StartItemOffset==lp.OffsetInner||this.FSelectInfo.EndItemOffset==lp.OffsetInner?this.FItems[t].SelectPart():this.FItems[t].SelectComplate():0==this.FSelectInfo.StartItemOffset&&this.FSelectInfo.EndItemOffset==this.FItems[t].Length?this.FItems[t].SelectComplate():this.FItems[t].SelectPart():0==this.FSelectInfo.StartItemOffset?this.FItems[t].SelectComplate():this.FSelectInfo.StartItemOffset<this.GetItemOffsetAfter(t)&&this.FItems[t].SelectPart():this.FItems[t].StyleNo<cs.Null?this.FSelectInfo.EndItemOffset==lp.OffsetAfter?this.FItems[t].SelectComplate():this.FSelectInfo.EndItemOffset>lp.OffsetBefor&&this.FItems[t].SelectPart():this.FSelectInfo.EndItemOffset==this.FItems[t].Length?this.FItems[t].SelectComplate():this.FItems[t].SelectPart()}},{key:"MatchItemSelectState",value:function(){if(this.SelectExists())for(var t=this.FSelectInfo.StartItemNo;t<=this.FSelectInfo.EndItemNo;t++)this.CheckItemSelectedState(t)}},{key:"GetParaItemRang",value:function(t,e,i){for(e=t;e>0&&!this.FItems[e].ParaFirst;)e--;for(i=t+1;i<this.FItems.count&&!this.FItems[i].ParaFirst;)i++;return{a:e,b:--i}}},{key:"GetParaFirstItemNo",value:function(t){for(var e=t;e>0&&!this.FItems[e].ParaFirst;)e--;return e}},{key:"GetParaLastItemNo",value:function(t){for(var e=t+1;e<this.FItems.count&&!this.FItems[e].ParaFirst;)e++;return--e}},{key:"GetLineFirstItemNo",value:function(t,e){for(var i=this.GetDrawItemNoByOffset(t,e);i>0&&!this.FDrawItems[i].LineFirst;)i--;return i}},{key:"GetLineLastItemNo",value:function(t,e){for(var i=this.GetDrawItemNoByOffset(t,e)+1;i<this.FDrawItems.count&&!this.FDrawItems[i].LineFirst;)i++;return i--,this.FDrawItems[i].ItemNo}},{key:"GetLineDrawItemRang",value:function(t,e){for(;t>0&&!this.FDrawItems[t].LineFirst;)t--;for(e=t+1;e<this.FDrawItems.count&&!this.FDrawItems[e].LineFirst;)e++;return{a:t,b:--e}}},{key:"GetJustifyCount",value:function(t,e){var i=0;if(""==t)throw"异常:不能对空字符串计算分散!";null!=e&&e.clear();for(var n=1;n<=t.length;n++)lp.UNPLACEHOLDERCHAR?lp.UnPlaceholderChar.indexOf(t[n-1])<0&&(i++,null!=e&&e.add(n)):(i++,null!=e&&e.add(n));return null!=e&&e.add(t.length+1),i}},{key:"DeleteEmptyItem",value:function(){for(var t=this.FItems.count-1;t>=0;t--)this.FItems[t].StyleNo>cs.Null&&0==this.FItems[t].Length&&(this.FItems[t].ParaFirst?t<this.FItems.count-1&&!this.FItems[t+1].ParaFirst&&(this.FItems[t+1].ParaFirst=!0,this.FItems.delete(t)):this.FItems.delete(t))}},{key:"SetCaretDrawItemNo",value:function(t){if(this.FCaretDrawItemNo>=0&&this.FCaretDrawItemNo<this.FDrawItems.count){var e=this.FDrawItems[this.FCaretDrawItemNo].ItemNo;t>=0&&e!=this.FDrawItems[t].ItemNo&&(this.FItems[e].Active=!1)}this.FCaretDrawItemNo=t,this.FStyle.States.Contain(Ip.Loading)||(this.SetCurStyleNo(this.FItems[this.FDrawItems[this.FCaretDrawItemNo].ItemNo].StyleNo),this.SetCurParaNo(this.FItems[this.FDrawItems[this.FCaretDrawItemNo].ItemNo].ParaNo),this.FCaretDrawItemNo>=0&&(this.FItems[this.FDrawItems[this.FCaretDrawItemNo].ItemNo].StyleNo<cs.Null?this.FSelectInfo.StartItemOffset==lp.OffsetInner&&(this.FItems[this.FDrawItems[this.FCaretDrawItemNo].ItemNo].Active=!0):this.FItems[this.FDrawItems[this.FCaretDrawItemNo].ItemNo].Active=!0),this.DoCaretItemChanged())}},{key:"CalculateLineHeight",value:function(t,e){var i=t.FontHeight;if(e.LineSpaceMode==gr.PLSMin)return i;if(e.LineSpaceMode==gr.PLSFix){var n=sr.millimeterToPixY(.3527*e.LineSpace);return n<i?i:n}if(2==this.FStyle.FormatVersion)switch(e.LineSpaceMode){case gr.PLS115:i+=Math.round(.15*t.TextMetric_tmHeight);break;case gr.PLS150:i+=Math.round(.5*t.TextMetric_tmHeight);break;case gr.PLS200:i+=t.TextMetric_tmHeight;break;case gr.PLSMult:i+=Math.round(t.TextMetric_tmHeight*e.LineSpace)}else{var o=0,r=0;if(t.trueType>0&&t.CJKFont)if(0!=(128&t.OutlineTextmetric_otmfsSelection))o=t.OutlineTextmetric_otmAscent,r=-t.OutlineTextmetric_otmDescent;else{o=t.Textmetric_tmAscent,r=t.Textmetric_tmDescent;var s=Math.ceil(1.3*(o+r))-(o+r),a=Math.trunc(s/2);switch(i=(o+=a)+(r+=s-a),e.LineSpaceMode){case gr.PLS115:i+=Math.trunc(3*i/20);break;case gr.PLS150:i=Math.trunc(3*i/2);break;case gr.PLS200:i*=2;break;case gr.PLSMult:i=Math.trunc(i*e.LineSpace)}}else switch(e.LineSpaceMode){case gr.PLS100:i+=t.TextMetric_tmExternalLeading;break;case gr.PLS115:i=i+t.TextMetric_tmExternalLeading+Math.round(.15*(t.TextMetric_tmHeight+t.TextMetric_tmExternalLeading));break;case gr.PLS150:i=i+t.TextMetric_tmExternalLeading+Math.round(.5*(t.TextMetric_tmHeight+t.TextMetric_tmExternalLeading));break;case gr.PLS200:i=i+t.TextMetric_tmExternalLeading+t.TextMetric_tmHeight+t.TextMetric_tmExternalLeading;break;case gr.PLSMult:i=i+t.TextMetric_tmExternalLeading+Math.round((t.TextMetric_tmHeight+t.TextMetric_tmExternalLeading)*e.LineSpace)}}return i}},{key:"GetUndoList",value:function(){return null!=this.OnGetUndoList?this.OnGetUndoList():null}},{key:"DoSaveItem",value:function(t){return null==this.OnSaveItem||this.OnSaveItem(this,t)}},{key:"DoInsertItem",value:function(t){null!=this.OnInsertItem&&this.OnInsertItem(this,t)}},{key:"DoRemoveItem",value:function(t){null!=this.OnRemoveItem&&this.OnRemoveItem(this,t)}},{key:"DoItemAction",value:function(t,e,i){}},{key:"DoDrawItemPaintBefor",value:function(t,e,i,n,o,r,s,a,l,h,c,u){null!=this.OnDrawItemPaintBefor&&this.OnDrawItemPaintBefor(t,e,i,n,o,r,s,a,l,h,c,u)}},{key:"DoDrawItemPaintContent",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){null!=this.OnDrawItemPaintContent&&this.OnDrawItemPaintContent(t,e,i,n,o,r,s,a,l,h,c,u,f)}},{key:"DoDrawItemPaintAfter",value:function(t,e,i,n,o,r,s,a,l,h,c,u){null!=this.OnDrawItemPaintAfter&&this.OnDrawItemPaintAfter(t,e,i,n,o,r,s,a,l,h,c,u)}},{key:"DoLoadFromStream",value:function(t,e,i){this.Clear()}},{key:"DoCaretItemChanged",value:function(){}},{key:"CanEdit",value:function(){return null==this.ParentData||this.ParentData.CanEdit()}},{key:"SelectAll",value:function(){this.FItems.count>0&&(this.FSelectInfo.StartItemNo=0,this.FSelectInfo.StartItemOffset=0,this.IsEmptyData()?(this.FSelectInfo.EndItemNo=-1,this.FSelectInfo.EndItemOffset=-1):(this.FSelectInfo.EndItemNo=this.FItems.count-1,this.FSelectInfo.EndItemOffset=this.GetItemOffsetAfter(this.FSelectInfo.EndItemNo)),this.MatchItemSelectState())}},{key:"SelectedAll",value:function(){return 0==this.FSelectInfo.StartItemNo&&0==this.FSelectInfo.StartItemOffset&&this.FSelectInfo.EndItemNo==this.FItems.count-1&&this.FSelectInfo.EndItemOffset==this.GetItemOffsetAfter(this.FItems.count-1)}},{key:"Clear",value:function(){this.FSelectInfo.Initialize(),this.FCaretDrawItemNo=-1,this.FDrawItems.clear(),this.FItems.clear(),this.FCurStyleNo=0,this.FCurParaNo=0}},{key:"InitializeField",value:function(){this.FCaretDrawItemNo=-1}},{key:"Change",value:function(){null!=this.OnChange&&this.OnChange()}},{key:"Clone",value:function(t){this.InitializeField(),this.FItems.clear();for(var e=0;e<t.Items.count;e++){var i=this.CreateItemByStyle(t.Items[e].StyleNo);i.Assign(t.Items[e]),i.Active=!1,i.DisSelect(),this.FItems.add(i)}}},{key:"GetRootData",value:function(){return this}},{key:"GetScreenCoord",value:function(t,e){return this.GetRootData().GetScreenCoord(t,e)}},{key:"CreateDefaultTextItem",value:function(){var t=new Hl.HCDefaultTextItemClass("");return this.FCurStyleNo<cs.Null?t.StyleNo=this.FStyle.GetStyleNo(this.FStyle.DefaultTextStyle,!0):t.StyleNo=this.FCurStyleNo,t.ParaNo=this.FCurParaNo,t}},{key:"CreateDefaultDomainItem",value:function(){var t=new za.HCDefaultDomainItemClass(this);return t.ParaNo=this.FCurParaNo,t}},{key:"CreateItemByStyle",value:function(t){return null}},{key:"GetCaretInfo",value:function(t,e,i){var n,o;n=this.FCaretDrawItemNo<0?this.FItems[t].StyleNo<cs.Null?this.FItems[t].FirstDItemNo:this.GetDrawItemNoByOffset(t,e):this.FCaretDrawItemNo;var r=this.FDrawItems[n];if(i.Height=r.height,this.FStyle.UpdateInfo.ReStyle&&(o=t,0==e&&!this.FItems[t].ParaFirst&&t>0&&this.FItems[t-1].StyleNo>cs.Null&&(o=t-1),this.CurStyleNo=this.MatchTextStyleNoAt(o,this.FSelectInfo.StartItemOffset),this.CurParaNo=this.FItems[o].ParaNo),this.FItems[t].StyleNo<cs.Null){var s=this.FItems[t];e==lp.OffsetBefor?(s.CanPageBreak&&this.GetRectItemInnerCaretInfo(s,t,n,r,i),i.X=i.X+r.rect.left):e==lp.OffsetInner?(this.GetRectItemInnerCaretInfo(s,t,n,r,i),i.X=i.X+r.rect.left):(s.CanPageBreak&&this.GetRectItemInnerCaretInfo(s,t,n,r,i),i.X=i.X+r.rect.right),s.JustifySplit()&&(this.FStyle.ParaStyles[s.ParaNo].AlignHorz==pr&&!this.IsParaLastDrawItem(n)||this.FStyle.ParaStyles[s.ParaNo].AlignHorz==Sr?this.IsLineLastDrawItem(n)&&(i.X=i.X+r.width-s.Width):i.X=i.X+r.width-s.Width)}else i.X=i.X+r.rect.left+this.GetDrawItemOffsetWidth(n,e-r.CharOffs+1);i.Y=i.Y+r.rect.top}},{key:"GetItemAt",value:function(t,e,i,n,o,r){if(i=-1,n=-1,o=-1,r=!0,this.IsEmptyData())return{itemNo:i=0,offset:n=0,drawItemNo:o=0,restrain:r};var s,a,l,h=-1;if(e<0)s=0;else{if(e>(l=this.FDrawItems.last.rect).bottom)s=this.FDrawItems.count-1;else for(s=0,h=this.FDrawItems.count-1;;){if(h-s>1){if(a=Math.trunc(s+(h-s)/2),e>this.FDrawItems[a].rect.bottom){s=a+1;continue}if(e<this.FDrawItems[a].rect.top){h=a-1;continue}s=a;break}(e>=this.FDrawItems[h].rect.bottom||e>this.FDrawItems[h].rect.top)&&(s=h);break}e<this.FDrawItems[s].rect.top&&s--}var c=this.GetLineDrawItemRang(s,h);if(s=c.a,h=c.b,t<=this.FDrawItems[s].rect.left)o=s,i=this.FDrawItems[s].ItemNo,n=this.FItems[i].StyleNo<cs.Null?this.GetDrawItemOffsetAt(s,t):this.FDrawItems[s].CharOffs-1;else if(t>=this.FDrawItems[h].rect.right)o=h,i=this.FDrawItems[h].ItemNo,n=this.FItems[i].StyleNo<cs.Null?this.GetDrawItemOffsetAt(h,t):this.FDrawItems[h].CharOffs+this.FDrawItems[h].CharLen-1;else for(var u=s;u<=h;u++)if(t>=(l=this.FDrawItems[u].rect).left&&t<l.right){r=e<l.top||e>l.bottom,o=u,i=this.FDrawItems[u].ItemNo,n=this.FItems[i].StyleNo<cs.Null?this.GetDrawItemOffsetAt(u,t):this.FDrawItems[u].CharOffs+this.GetDrawItemOffsetAt(u,t)-1;break}return{itemNo:i,offset:n,drawItemNo:o,restrain:r}}},{key:"CoordInSelect",value:function(t,e,i,n,o){var r=!1;if(i<0||n<0)return r;if(o)return r;var s=this.GetDrawItemNoByOffset(i,n);return(r=this.FDrawItems[s].rect.pointInAt(t,e))&&(r=this.OffsetInSelect(i,n)),r}},{key:"GetDrawItemText",value:function(t){var e=this.FDrawItems[t];return this.FItems[e.ItemNo].Text.substr(e.CharOffs-1,e.CharLen)}},{key:"_GetNorAlignDrawItemOffsetWidth",value:function(t,e,i){var n,o=0;if(lp.UNPLACEHOLDERCHAR){if(""!=(n=this.GetDrawItemText(t))){var r=n.length;o=i.getTextExtentExPoint(n,r)[e-1]}}else{var s=this.FDrawItems[t];""!=(n=this.FItems[s.ItemNo].Text.substr(s.CharOffs-1,e))&&(o=i.textWidth(n))}return o}},{key:"GetDrawItemOffsetWidth",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(0==e)return 0;if(!this.Items[this.FDrawItems[t].ItemNo].Visible)return 0;var n=0,o=this.FDrawItems[t],r=this.FItems[o.ItemNo].StyleNo;if(r<cs.Null)e>lp.OffsetBefor&&(n=this.FDrawItems[t].width);else{var s=null;null!=i?s=i:(s=this.FStyle.TempCanvas,this.FStyle.ApplyTempStyle(r));var a=this.FStyle.ParaStyles[this.GetDrawItemParaStyle(t)].AlignHorz;switch(a){case dr:case yr:case mr:n=this._GetNorAlignDrawItemOffsetWidth(t,e,s);break;case pr:case Sr:if(a==pr&&this.IsParaLastDrawItem(t))return n=this._GetNorAlignDrawItemOffsetWidth(t,e,s);var l=this.GetDrawItemText(t),h=l.length,c=s.getTextExtentExPoint(l,h),u=o.width-c[h-1],f=0,d=new V,m=this.GetJustifyCount(l,d),y=this.IsLineLastDrawItem(t);y&&m>0&&m--,m>0&&(f=u%m,u=Math.trunc(u/m));for(var p=0,S=0,v=0;v<=d.count-2;v++){if(y&&v==d.count-2||(f>0?(p+=u+1,f--):p+=u),(S=d[v+1]-1)==e){n=c[S-1]+p;break}if(S>e){n=c[e-d[v]]+p;break}}}}return n}},{key:"GetRectItemInnerCaretInfo",value:function(t,e,i,n,o){t.GetCaretInfo(o);var r=Math.trunc(this.GetLineBlankSpace(i)/2),s=n.rect.inFlate(0,-r,!0);switch(this.FStyle.ParaStyles[this.FItems[e].ParaNo].AlignVert){case Fr:o.Y=o.Y+r+(s.height-t.Height)/2;break;case vr:o.Y=o.Y+r;break;default:o.Y=o.Y+r+s.height-t.Height}}},{key:"GetItemActualOffset",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return lp.GetTextActualOffset(this.FItems[t].Text,e,i)}},{key:"GetItemOffsetAfter",value:function(t){return this.FItems[t].StyleNo<cs.Null?lp.OffsetAfter:this.FItems[t].Length}},{key:"GetDataDrawItemRang",value:function(t,e,i,n){i=-1,n=-1;for(var o=0;o<=this.FDrawItems.count-1;o++)if(this.FDrawItems[o].LineFirst&&this.FDrawItems[o].rect.bottom>t&&this.FDrawItems[o].rect.top<e){i=o;break}if(i<0)return{a:i,b:n};for(var r=i;r<=this.FDrawItems.count-1;r++)if(this.FDrawItems[r].LineFirst&&this.FDrawItems[r].rect.top>=e){n=r-1;break}return n<0&&(n=this.FDrawItems.count-1),{a:i,b:n}}},{key:"GetItemLastDrawItemNo",value:function(t){var e=-1;if(this.FItems[t].FirstDItemNo<0)return e;for(e=this.FItems[t].FirstDItemNo+1;e<this.FDrawItems.count&&!this.FDrawItems[e].ParaFirst&&this.FDrawItems[e].ItemNo==t;)e++;return--e}},{key:"OffsetInSelect",value:function(t,e){var i=!1;return t<0||e<0?i:this.FItems[t].StyleNo<cs.Null?(e==lp.OffsetInner&&this.FItems[t].IsSelectComplate&&(i=!0),i):(this.SelectExists()&&(t>this.FSelectInfo.StartItemNo&&t<this.FSelectInfo.EndItemNo?i=!0:t==this.FSelectInfo.StartItemNo?i=t==this.FSelectInfo.EndItemNo?e>=this.FSelectInfo.StartItemOffset&&e<=this.FSelectInfo.EndItemOffset:e>=this.FSelectInfo.StartItemOffset:t==this.FSelectInfo.EndItemNo&&(i=e<=this.FSelectInfo.EndItemOffset)),i)}},{key:"CoordToDrawItem",value:function(t,e,i,n,o){n=t,o=e;var r=this.FDrawItems[i].rect.inFlate(0,-Math.trunc(this.GetLineBlankSpace(i)/2),!0);if(n-=r.left,o-=r.top,this.FItems[this.FDrawItems[i].ItemNo].StyleNo<cs.Null){var s=this.FItems[this.FDrawItems[i].ItemNo];switch(this.FStyle.ParaStyles[s.ParaNo].AlignVert){case Fr:o-=Math.trunc((r.height-s.Height)/2);break;case vr:break;default:o-=r.height-s.Height}}return{x:n,y:o}}},{key:"CoordToItemOffset",value:function(t,e,i,n,o,r){if(o=t,r=e,i<0)return{x:o,y:r};var s=this.GetDrawItemNoByOffset(i,n);return this.CoordToDrawItem(t,e,s,o,r)}},{key:"GetDrawItemNoByOffset",value:function(t,e){var i=this.FItems[t].FirstDItemNo;if(this.FItems[t].StyleNo>cs.Null&&this.FItems[t].Length>0)for(var n,o=this.FItems[t].FirstDItemNo;o<=this.FDrawItems.count-1&&(n=this.FDrawItems[o]).ItemNo==t;o++)if(e-n.CharOffs<n.CharLen){i=o;break}return i}},{key:"IsLineLastDrawItem",value:function(t){return t==this.FDrawItems.count-1||this.FDrawItems[t+1].LineFirst}},{key:"IsParaLastDrawItem",value:function(t){var e=!1,i=this.FDrawItems[t].ItemNo;return i<this.FItems.count-1?this.FItems[i+1].ParaFirst&&(e=this.FDrawItems[t].CharOffsetEnd()==this.FItems[i].Length):e=this.FDrawItems[t].CharOffsetEnd()==this.FItems[i].Length,e}},{key:"IsParaLastItem",value:function(t){return t==this.FItems.count-1||this.FItems[t+1].ParaFirst}},{key:"GetTopLevelData",value:function(){var t=null;return this.FSelectInfo.StartItemNo>=0&&this.FSelectInfo.EndItemNo<0&&this.FItems[this.FSelectInfo.StartItemNo].StyleNo<cs.Null&&this.FSelectInfo.StartItemOffset==lp.OffsetInner&&(t=this.FItems[this.FSelectInfo.StartItemNo].GetActiveData()),null==t&&(t=this),t}},{key:"GetTopLevelDataAt",value:function(t,e){var i=null,n=-1,o=0,r=-1,s=!1,a=this.GetItemAt(t,e,n,o,r,s);if(n=a.itemNo,o=a.offset,r=a.drawItemNo,!(s=a.restrain)&&n>=0&&this.FItems[n].StyleNo<cs.Null){var l=this.CoordToItemOffset(t,e,n,o,0,0);i=this.FItems[n].GetTopLevelDataAt(l.x,l.y)}return null==i&&(i=this),i}},{key:"GetActiveDrawItemNo",value:function(){if(this.FCaretDrawItemNo>=0)return this.FCaretDrawItemNo;var t=-1;if(this.FSelectInfo.StartItemNo<0);else{var e=-1;if(e=this.SelectExists()&&this.FSelectInfo.EndItemNo>=0?this.FSelectInfo.EndItemNo:this.FSelectInfo.StartItemNo,this.FItems[e].StyleNo<cs.Null)t=this.FItems[e].FirstDItemNo;else for(var i=this.FItems[e].FirstDItemNo;i<=this.FDrawItems.count-1;i++){var n=this.FDrawItems[i];if(this.FSelectInfo.StartItemOffset-n.CharOffs+1<=n.CharLen){t=i;break}}}return t}},{key:"GetActiveDrawItem",value:function(){var t=this.GetActiveDrawItemNo();return t<0?null:this.FDrawItems[t]}},{key:"GetActiveItemNo",value:function(){return this.FSelectInfo.StartItemNo}},{key:"GetActiveItem",value:function(){var t=this.GetActiveItemNo();return t<0?null:this.FItems[t]}},{key:"GetActiveRectItem",value:function(){var t=this.GetActiveItem();return null!=t&&t.StyleNo<cs.Null?t:null}},{key:"GetTopLevelItem",value:function(){var t=this.GetActiveItem();return null!=t&&t.StyleNo<cs.Null&&(t=t.GetTopLevelItem()),t}},{key:"GetTopLevelDrawItem",value:function(){var t=null,e=this.GetActiveItem();return null!=e&&e.StyleNo<cs.Null&&(t=e.GetTopLevelDrawItem()),null==t&&(t=this.GetActiveDrawItem()),t}},{key:"GetTopLevelDrawItemCoord",value:function(){var t=G.Create(0,0),e=G.Create(0,0),i=this.GetActiveDrawItem();if(null!=i){t=i.rect.leftTop;var n=this.GetActiveItem();null!=n&&n.StyleNo<cs.Null&&((e=n.GetTopLevelDrawItemCoord()).y=e.y+Math.trunc(this.FStyle.LineSpaceMin/2)),t.x=t.x+e.x,t.y=t.y+e.y}return t}},{key:"GetTopLevelRectDrawItem",value:function(){var t=null,e=this.GetActiveItem();return null!=e&&e.StyleNo<cs.Null&&null==(t=e.GetTopLevelRectDrawItem())&&(t=this.GetActiveDrawItem()),t}},{key:"GetTopLevelRectDrawItemCoord",value:function(){var t=G.Create(-1,-1),e=this.GetActiveItem();if(null!=e&&e.StyleNo<cs.Null){t=this.FDrawItems[e.FirstDItemNo].rect.leftTop;var i=e.GetTopLevelRectDrawItemCoord();i.x>=0&&(i.y=i.y+Math.trunc(this.FStyle.LineSpaceMin/2),t.x=t.x+i.x,t.y=t.y+i.y)}return t}},{key:"IsRectItem",value:function(t){return this.FItems[t].StyleNo<cs.Null}},{key:"GetItemStyle",value:function(t){return this.FItems[t].StyleNo}},{key:"GetDrawItemStyle",value:function(t){return this.GetItemStyle(this.FDrawItems[t].ItemNo)}},{key:"GetItemParaStyle",value:function(t){return this.FItems[t].ParaNo}},{key:"GetDrawItemParaStyle",value:function(t){return this.GetItemParaStyle(this.FDrawItems[t].ItemNo)}},{key:"GetDrawItemOffsetAt",value:function(t,e){var i=0,n=this.FDrawItems[t],o=this.FItems[n.ItemNo];if(o.StyleNo<cs.Null)i=o.GetOffsetAt(e-n.rect.left);else{i=n.CharLen;var r=o.SubString(n.CharOffs,n.CharLen);this.FStyle.ApplyTempStyle(o.StyleNo);var s=this.FStyle.ParaStyles[o.ParaNo],a=e-n.rect.left;switch(s.AlignHorz){case dr:case yr:case mr:i=lp.GetNorAlignCharOffsetAt(this.FStyle.TempCanvas,r,a);break;case pr:case Sr:if(s.AlignHorz==pr&&this.IsParaLastDrawItem(t))return i=lp.GetNorAlignCharOffsetAt(this.FStyle.TempCanvas,r,a);var l=r.length,h=this.FStyle.TempCanvas.getTextExtentExPoint(r,l),c=n.width-h[l-1],u=0,f=new V,d=this.GetJustifyCount(r,f),m=this.IsLineLastDrawItem(t);m&&d>0&&d--,d>0&&(u=c%d,c=Math.trunc(c/d));for(var y=0,p=0,S=0;S<=f.count-2;S++)if(m&&S==f.count-2?p=0:(u>0?(p=c+1,u--):p=c,y+=p),h[f[S+1]-1-1]+y>a){for(var v=f[S];v<f[S+1];)if(lp.UNPLACEHOLDERCHAR&&(v=lp.GetTextActualOffset(r,v,!0)),h[v-1]+y>a){a>(lp.UNPLACEHOLDERCHAR?y-Math.trunc(p/2)+lp.GetCharHalfFarfromUN(r,v,h):y-Math.trunc(p/2)+lp.GetCharHalfFarfrom(v,h))?i=v:(i=v-1,lp.UNPLACEHOLDERCHAR&&lp.IsUnPlaceHolderChar(r[i+1-1])&&(i=lp.GetTextActualOffset(r,i)-1));break}break}}}return i}},{key:"GetSelectStartDrawItemNo",value:function(){var t=-1;return this.FSelectInfo.StartItemNo<0||(t=this.GetDrawItemNoByOffset(this.FSelectInfo.StartItemNo,this.FSelectInfo.StartItemOffset),this.FSelectInfo.EndItemNo>=0&&t<this.FItems.count-1&&(this.FDrawItems[t+1].ParaFirst||(this.FItems[this.FSelectInfo.StartItemNo].StyleNo<cs.Null?this.FSelectInfo.StartItemOffset==lp.OffsetAfter&&t++:this.FDrawItems[t].CharOffsetEnd()==this.FSelectInfo.StartItemOffset&&t++))),t}},{key:"GetSelectEndDrawItemNo",value:function(){var t=-1;return this.FSelectInfo.EndItemNo<0?t:t=this.GetDrawItemNoByOffset(this.FSelectInfo.EndItemNo,this.FSelectInfo.EndItemOffset)}},{key:"SelectInSameDrawItem",value:function(){var t=this.GetSelectStartDrawItemNo();return!(t<0)&&(this.GetDrawItemStyle(t)<cs.Null?this.FItems[this.FDrawItems[t].ItemNo].IsSelectComplate&&this.FSelectInfo.EndItemNo<0:t==this.GetSelectEndDrawItemNo())}},{key:"SelectInSameItem",value:function(){return this.FSelectInfo.StartItemNo==this.FSelectInfo.EndItemNo}},{key:"DisSelect",value:function(){var t=null;this.FSelectInfo.StartItemNo>=0&&((t=this.FItems[this.FSelectInfo.StartItemNo]).Active=!1,t.DisSelect());var e=this.SelectExists();if(e){for(var i=this.FSelectInfo.StartItemNo+1;i<=this.FSelectInfo.EndItemNo;i++)(t=this.FItems[i]).Active=!1,t.DisSelect();this.FSelectInfo.EndItemNo=-1,this.FSelectInfo.EndItemOffset=-1}return this.FSelectInfo.StartItemNo=-1,this.FSelectInfo.StartItemOffset=-1,e}},{key:"SelectedCanDrag",value:function(){var t=!0;if(this.FSelectInfo.EndItemNo<0)this.FSelectInfo.StartItemNo>=0&&(t=this.FItems[this.FSelectInfo.StartItemNo].CanDrag());else for(var e=this.FSelectInfo.StartItemNo;e<=this.FSelectInfo.EndItemNo;e++){if(this.FItems[e].StyleNo<cs.Null&&!this.FItems[e].IsSelectComplate){t=!1;break}if(!this.FItems[e].CanDrag()){t=!1;break}}return t}},{key:"SelectedResizing",value:function(){return!!(this.FSelectInfo.StartItemNo>=0&&(this.FSelectInfo.EndItemNo<0||this.FSelectInfo.StartItemNo==this.FSelectInfo.EndItemNo)&&this.FItems[this.FSelectInfo.StartItemNo].isClass(rl))&&this.FItems[this.FSelectInfo.StartItemNo].Resizing}},{key:"IsEmptyData",value:function(){return 1==this.FItems.count&&this.IsEmptyLine(0)}},{key:"IsEmptyLine",value:function(t){return this.FItems[t].StyleNo>cs.Null&&""==this.FItems[t].Text}},{key:"ApplyParaAlignHorz",value:function(t){var e=new Pl;e.Align=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaAlignVert",value:function(t){var e=new Dl;e.Align=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaBackColor",value:function(t){var e=new Rl;e.BackColor=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaBreakRough",value:function(t){var e=new _l;e.BreakRough=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaLineSpace",value:function(t,e){var i=new bl;i.SpaceMode=t,i.Space=e,this.ApplySelectParaStyle(i)}},{key:"ApplyParaLeftIndent",value:function(t){var e=new Al;e.Indent=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaRightIndent",value:function(t){var e=new Tl;e.Indent=t,this.ApplySelectParaStyle(e)}},{key:"ApplyParaFirstIndent",value:function(t){var e=new xl;e.Indent=t,this.ApplySelectParaStyle(e)}},{key:"ApplyBullet",value:function(t,e,i,n){}},{key:"ApplySelectTextStyle",value:function(t){}},{key:"ApplySelectParaStyle",value:function(t){}},{key:"ApplyTableCellAlign",value:function(t){}},{key:"DeleteSelected",value:function(){return!1}},{key:"DeleteItemDirect",value:function(t){this.FItems.delete(t)}},{key:"ApplyTextStyle",value:function(t){var e=new vl;e.FontStyle=t,this.ApplySelectTextStyle(e)}},{key:"ApplyTextStyleNo",value:function(t){var e=new Cl;e.StyleNo=t,this.ApplySelectTextStyle(e)}},{key:"ApplyTextFontName",value:function(t){var e=new Fl;e.FontName=t,this.ApplySelectTextStyle(e)}},{key:"ApplyTextFontSize",value:function(t){var e=new Il;e.FontSize=t,this.ApplySelectTextStyle(e)}},{key:"ApplyTextColor",value:function(t){var e=new gl;e.Color=t,this.ApplySelectTextStyle(e)}},{key:"ApplyTextBackColor",value:function(t){var e=new wl;e.Color=t,this.ApplySelectTextStyle(e)}},{key:"DrawItemSelectAll",value:function(t,e){var i=this.GetSelectStartDrawItemNo(),n=this.GetSelectEndDrawItemNo();return(i<t||i==t&&this.FSelectInfo.StartItemOffset==this.FDrawItems[i].CharOffsetStart())&&(n>e||n==e&&this.SelectInfo.EndItemOffset==this.FDrawItems[n].CharOffsetEnd())}},{key:"DrawTextJsutify",value:function(t,e,i,n,o){var r=e.left,s=i.length,a=t.getTextExtentExPoint(i,s),l=e.width-a[s-1];if(l>0){var h=new V,c=this.GetJustifyCount(i,h);n&&c>0&&c--;var u=0;c>0&&(u=l%c,l=Math.trunc(l/c)),r=0;for(var f,d=0,m=0;m<=h.count-2;m++)s=h[m+1]-h[m],f=i.substr(h[m]-1,s),m>0&&(r=a[h[m]-2]+d),t.textOut(e.left+r,o,f),n&&m==h.count-2||(u>0?(d+=l+1,u--):d+=l)}else t.textOut(r,o,i,a)}},{key:"PaintDataRange",value:function(t,e,i,n,o,r,s,a,l,h,c){if(!(a<0||l<0)){var u=-1,f=-1,d=-1,m=-1,y=!1;c.Print||(f=(u=this.GetSelectStartDrawItemNo())<0?-1:this.FSelectInfo.StartItemOffset-this.FDrawItems[u].CharOffs+1,m=(d=this.GetSelectEndDrawItemNo())<0?-1:this.FSelectInfo.EndItemOffset-this.FDrawItems[d].CharOffs+1,y=this.DrawItemSelectAll(a,l));var p=cs.Null,S=cs.Null,v=0,F=e-s;h.save();try{var I,g,w,C=-1;this.FDrawItems[a].LineFirst||(C=this.GetLineBlankSpace(a));for(var k,P,D,b=dr,R=a;R<=l;R++)if(I=this.FDrawItems[R],k=this.FItems[I.ItemNo],g=I.rect.offset(t,F,!0),I.LineFirst&&(C=this.GetLineBlankSpace(R)),w=g.inFlate(0,-Math.trunc(C/2),!0),k.Visible){if(this.DrawItemPaintBefor(this,I.ItemNo,R,g,w,t,i,n,o,r,h,c),S!=k.ParaNo&&(S=k.ParaNo,b=this.FStyle.ParaStyles[k.ParaNo].AlignHorz),k.StyleNo<cs.Null){switch(p=(P=k).StyleNo,P.JustifySplit()&&(b==pr&&!this.IsLineLastDrawItem(R)||b==Sr?this.IsLineLastDrawItem(R)&&w.offset(w.width-P.Width,0):w.right=w.left+P.Width),this.FStyle.ParaStyles[k.ParaNo].AlignVert){case Fr:w.inFlate(0,-Math.trunc((w.height-P.Height)/2));break;case vr:break;default:w.left=w.bottom-P.Height}this.DrawItemPaintContent(this,I.ItemNo,R,g,w,"",t,i,n,o,r,h,c),!c.Print&&P.IsSelectComplate&&(h.brush.color=this.FStyle.SelColor,h.fillRect(g)),k.PaintTo(this.FStyle,w,e,n,o,r,h,c)}else{k.StyleNo!=p&&(p=k.StyleNo,this.FStyle.TextStyles[p].ApplyStyle(h,c.ScaleY/c.Zoom),this.FStyle.ApplyTempStyle(p),v=this.FStyle.TextStyles[p].FontHeight,(this.FStyle.TextStyles[p].FontStyles.has(ht.Superscript)||this.FStyle.TextStyles[p].FontStyles.has(ht.Subscript))&&(v+=v));var _=void 0;switch(this.FStyle.ParaStyles[k.ParaNo].AlignVert){case Fr:_=w.top+Math.trunc((w.bottom-w.top-v)/2);break;case vr:_=w.top;break;default:_=w.bottom-v}if(this.FStyle.TextStyles[p].FontStyles.has(ht.Subscript)&&(_+=Math.trunc(v/2)),this.FStyle.TextStyles[p].BackColor!=lp.HCTransparentColor&&(h.brush.color=this.FStyle.TextStyles[p].BackColor,h.fillRect(U.Create(w.left,w.top,w.left+I.width,w.bottom))),D=k.Text.substr(I.CharOffs-1,I.CharLen),this.DrawItemPaintContent(this,I.ItemNo,R,g,w,D,t,i,n,o,r,h,c),c.Print||(y?(h.brush.color=this.FStyle.SelColor,h.fillRect(U.Create(g.left,g.top,g.left+I.width,Math.min(g.bottom,r)))):d>=0&&(h.brush.color=this.FStyle.SelColor,u==d&&R==u?h.fillRect(U.Create(g.left+this.GetDrawItemOffsetWidth(R,f),g.top,g.left+this.GetDrawItemOffsetWidth(R,m,this.FStyle.TempCanvas),Math.min(g.bottom,r))):R==u?h.fillRect(U.Create(g.left+this.GetDrawItemOffsetWidth(R,f,this.FStyle.TempCanvas),g.top,g.right,Math.min(g.bottom,r))):R==d?h.fillRect(U.Create(g.left,g.top,g.left+this.GetDrawItemOffsetWidth(R,m,this.FStyle.TempCanvas),Math.min(g.bottom,r))):R>u&&R<d&&h.fillRect(g))),k.PaintTo(this.FStyle,w,e,n,o,r,h,c),""!=D){if(!c.Print||!k.PrintInvisible){switch(h.brush.style=Ft,b){case dr:case yr:case mr:h.textOut(w.left,_,D);break;case pr:case Sr:this.DrawTextJsutify(h,w,D,this.IsLineLastDrawItem(R),_)}this.FStyle.TextStyles[p].FontStyles.has(ht.Emphasize)&&(h.drawLineDriect(w.left,w.bottom-1,w.right,w.bottom-1),h.drawLineDriect(w.left,w.bottom+1,w.right,w.bottom+1))}}else if(lp.CHECKNULLITEM&&!k.ParaFirst)throw lp.HCS_EXCEPTION_NULLTEXT}this.DrawItemPaintAfter(this,I.ItemNo,R,g,w,t,i,n,o,r,h,c)}else this.DrawItemPaintAfter(this,I.ItemNo,R,g,w,t,i,n,o,r,h,c)}finally{h.restore()}}}},{key:"PaintData",value:function(t,e,i,n,o,r,s,a,l){if(0!=this.FItems.count){var h=-1,c=-1,u=e-s,f=this.GetDataDrawItemRang(Math.max(e,o)-u,Math.min(n,r)-u,h,c);h=f.a,c=f.b,this.PaintDataRange(t,e,i,n,o,r,s,h,c,a,l)}}},{key:"GetLineBlankSpace",value:function(t){var e=t,i=-1,n=this.GetLineDrawItemRang(e,i);e=n.a,i=n.b;var o,r,s=0;o=e;for(var a=e;a<=i;a++)(r=this.GetDrawItemStyle(a)<cs.Null?this.FItems[this.FDrawItems[a].ItemNo].Height:this.FStyle.TextStyles[this.FItems[this.FDrawItems[a].ItemNo].StyleNo].FontHeight)>s&&(s=r,o=a);var l=this.GetDrawItemStyle(o);return l<cs.Null?l==cs.Bullet?this.GetDrawItemLineSpace(o)-s:this.FStyle.LineSpaceMin:this.GetDrawItemLineSpace(o)-s}},{key:"GetDrawItemLineSpace",value:function(t){var e=this.FStyle.LineSpaceMin,i=this.GetDrawItemStyle(t);return i>=cs.Null?e=this.CalculateLineHeight(this.FStyle.TextStyles[this.GetDrawItemStyle(t)],this.FStyle.ParaStyles[this.GetDrawItemParaStyle(t)]):i==cs.Bullet&&(i=this.FItems[this.FDrawItems[t].ItemNo].TextStyleNo,e=this.CalculateLineHeight(this.FStyle.TextStyles[i],this.FStyle.ParaStyles[this.GetDrawItemParaStyle(t)])),e}},{key:"SelectStartItemBoundary",value:function(){return this.FSelectInfo.StartItemNo>=0&&(0==this.FSelectInfo.StartItemOffset||(this.FSelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.FSelectInfo.StartItemNo)))}},{key:"SelectExists",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!1;return this.FSelectInfo.StartItemNo>=0&&(this.FSelectInfo.EndItemNo>=0?e=this.FSelectInfo.StartItemNo!=this.FSelectInfo.EndItemNo||this.FSelectInfo.StartItemOffset!=this.FSelectInfo.EndItemOffset:t&&this.FItems[this.FSelectInfo.StartItemNo].StyleNo<cs.Null&&(e=this.FItems[this.FSelectInfo.StartItemNo].SelectExists())),e}},{key:"MarkStyleUsed",value:function(t){for(var e,i=0;i<=this.FItems.count-1;i++)e=this.FItems[i],t?(this.FStyle.ParaStyles[e.ParaNo].CheckSaveUsed=!0,e.StyleNo<cs.Null?e.MarkStyleUsed(t):this.FStyle.TextStyles[e.StyleNo].CheckSaveUsed=!0):(e.ParaNo=this.FStyle.ParaStyles[e.ParaNo].TempNo,e.StyleNo<cs.Null?e.MarkStyleUsed(t):e.StyleNo=this.FStyle.TextStyles[e.StyleNo].TempNo)}},{key:"SaveItemToStream",value:function(t,e,i,n,o){var r=t.position;t.writeUInt64(r);var s=n-e+1;t.writeInt32(s);var a=0;if(s>0)if(e!=n){var l=!1;this.DoSaveItem(e)?(this.FItems[e].SaveToStreamRange(t,i,this.FItems[e].Length),a++):l=this.FItems[e].ParaFirst;for(var h=e+1;h<=n-1;h++)if(this.DoSaveItem(h)){if(l&&!this.FItems[h].ParaFirst){this.FItems[h].ParaFirst=!0;try{this.FItems[h].SaveToStream(t)}finally{this.FItems[h].ParaFirst=!1}l=!1}else this.FItems[h].SaveToStream(t);a++}else l=l||this.FItems[h].ParaFirst;if(this.DoSaveItem(n)){if(l&&!this.FItems[n].ParaFirst){this.FItems[n].ParaFirst=!0;try{this.FItems[n].SaveToStreamRange(t,0,o)}finally{this.FItems[n].ParaFirst=!1}}else this.FItems[n].SaveToStreamRange(t,0,o);a++}}else this.DoSaveItem(e)&&(this.FItems[e].SaveToStreamRange(t,i,o),a++);var c=t.position;t.position=r,r=c-r-8,t.writeUInt64(r),s!=a&&t.writeInt32(a),t.position=c}},{key:"SaveToStream",value:function(t){this.SaveToStreamRange(t,0,0,this.FItems.count-1,this.FItems.last.Length)}},{key:"SaveToStreamRange",value:function(t,e,i,n,o){this.SaveItemToStream(t,e,i,n,o)}},{key:"SaveToText",value:function(){return this.SaveToTextRange(0,0,this.FItems.count-1,this.GetItemOffsetAfter(this.FItems.count-1))}},{key:"SaveToTextRange",value:function(t,e,i,n){var o="";if(i-t+1>0)if(t!=i){var r=!1;this.FItems[t].Visible&&this.DoSaveItem(t)?o=this.FItems[t].StyleNo>cs.Null?this.FItems[t].SubStringEffective(e+1,this.FItems[t].Length-e):this.FItems[t].SelectExists()?this.FItems[t].SaveSelectToText():this.FItems[t].Text:r=this.FItems[t].ParaFirst;for(var s="",a=t+1;a<=i-1;a++)this.FItems[a].Visible&&this.DoSaveItem(a)?(s=this.FItems[a].StyleNo>cs.Null?this.FItems[a].TextEffective():this.FItems[a].Text,r||this.FItems[a].ParaFirst?o+=lp.sLineBreak+s:o+=s,r&&!this.FItems[a].ParaFirst&&(r=!1)):r=r||this.FItems[a].ParaFirst;this.FItems[i].Visible&&this.DoSaveItem(i)&&(this.FItems[i].StyleNo>cs.Null?((r||this.FItems[i].ParaFirst)&&(o+=lp.sLineBreak),o+=this.FItems[i].SubStringEffective(1,n)):((r||this.FItems[i].ParaFirst)&&(o+=lp.sLineBreak),n==lp.OffsetAfter?o+=this.FItems[i].Text:o+=this.FItems[i].SaveSelectToText()))}else this.FItems[t].Visible&&this.DoSaveItem(t)&&(o=this.FItems[t].StyleNo>cs.Null?this.FItems[t].SubStringEffective(e+1,n-e):this.FItems[t].SelectExists()?this.FItems[t].SaveSelectToText():this.FItems[t].Text);return o}},{key:"SaveSelectToStream",value:function(t){this.SelectExists()?this.FSelectInfo.EndItemNo<0&&this.FItems[this.FSelectInfo.StartItemNo].StyleNo<cs.Null?this.FItems[this.FSelectInfo.StartItemNo].IsSelectComplateTheory()?this.SaveToStreamRange(t,this.FSelectInfo.StartItemNo,lp.OffsetBefor,this.FSelectInfo.StartItemNo,lp.OffsetAfter):this.FItems[this.FSelectInfo.StartItemNo].SaveSelectToStream(t):this.SaveToStreamRange(t,this.FSelectInfo.StartItemNo,this.FSelectInfo.StartItemOffset,this.FSelectInfo.EndItemNo,this.FSelectInfo.EndItemOffset):t.writeUInt64(0)}},{key:"SaveSelectToText",value:function(){var t="";return this.SelectExists()&&(t=this.FSelectInfo.EndItemNo<0&&this.FItems[this.FSelectInfo.StartItemNo].StyleNo<cs.Null?this.FItems[this.FSelectInfo.StartItemNo].SaveSelectToText():this.SaveToTextRange(this.FSelectInfo.StartItemNo,this.FSelectInfo.StartItemOffset,this.FSelectInfo.EndItemNo,this.FSelectInfo.EndItemOffset)),t}},{key:"GetSelectText",value:function(){return this.SaveSelectToText()}},{key:"InsertStream",value:function(t,e,i){return!1}},{key:"LoadFromStream",value:function(t,e,i){this.FLoading=!0;try{this.DoLoadFromStream(t,e,i)}finally{this.FLoading=!1}}},{key:"ToHtml",value:function(t,e){for(var i="",n=t||0,o=e||this.FItems.count-1,r=n;r<=o;r++)this.FItems[r].Visible&&(this.FItems[r].ParaFirst&&(0!=r&&(i+=lp.sLineBreak+"</p>"),i+=lp.sLineBreak+'<p class="ps'+this.FItems[r].ParaNo.toString()+'">'),i+=lp.sLineBreak+this.FItems[r].ToHtml());return i+lp.sLineBreak+"</p>"}},{key:"ToXml",value:function(t){var e;t.SetAttribute("itemcount",this.FItems.count.toString());for(var i=0;i<this.FItems.count;i++)e=Kr.Create("item"),this.FItems[i].ToXml(e),t.AppendChild(e)}},{key:"ParseXml",value:function(t){var e,i;this.Clear();for(var n=0;n<t.ChildNodes.count;n++)e=t.ChildNodes[n],(i=this.CreateItemByStyle(e.GetAttribute("sno"))).ParseXml(e),this.FItems.add(i);0==this.FItems[0].Length&&this.FItems.delete(0)}},{key:"Loading",get:function(){return this.FLoading}},{key:"ParentData",get:function(){return this.FParentData},set:function(t){this.FParentData=t}},{key:"Style",get:function(){return this.FStyle}},{key:"CurStyleNo",get:function(){return this.FCurStyleNo},set:function(t){this.SetCurStyleNo(t)}},{key:"CurParaNo",get:function(){return this.FCurParaNo},set:function(t){this.SetCurParaNo(t)}},{key:"Items",get:function(){return this.FItems}},{key:"DrawItems",get:function(){return this.FDrawItems}},{key:"SelectInfo",get:function(){return this.FSelectInfo}},{key:"CaretDrawItemNo",get:function(){return this.FCaretDrawItemNo},set:function(t){this.SetCaretDrawItemNo(t)}}]),i}(L);function ih(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function nh(t){return(nh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rh(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&sh(t,e)}function sh(t,e){return(sh=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ah(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=hh(t);if(e){var o=hh(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return lh(this,i)}}function lh(t,e){return!e||"object"!==nh(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function hh(t){return(hh=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ch=function(t){rh(i,t);var e=ah(i);function i(){var t;return oh(this,i),(t=e.call(this)).rbIndex=0,t}return i}(V),uh=function(t){rh(r,t);var e,i,n,o=ah(r);function r(){return oh(this,r),o.call(this)}return e=r,(i=[{key:"_rectSort",value:function(t,e){var i=t.y-e.y;if(i<0)return-1;if(i>0)return 1;var n=t.x-e.x;return n<0?-1:n>0?1:0}},{key:"_addRectPath",value:function(t){var e,i=G.CreateByPoint(t.leftTop),n=G.CreateByPoint(t.rightTop),o=G.CreateByPoint(t.rightBottom),r=G.CreateByPoint(t.leftBottom);if(0==this.count)return(e=new ch).add(i),e.add(n),e.add(o),e.add(r),e.rbIndex=2,void this.add(e);var s,a=!1;if(s=(e=this.last)[e.rbIndex],(r.equal(s)||r.equal(e[e.rbIndex+1]))&&(e[e.rbIndex-1].resetByPoint(n),s.resetByPoint(o),a=!0),a||((e=new ch).add(i),e.add(n),e.add(o),e.add(r),e.rbIndex=2,this.add(e)),this.count>1){e=this.last;var l=this[this.count-2],h=e[0],c=e[1];h.y==l[l.rbIndex].y&&c.x>l[l.rbIndex+1].x&&(h.x==l[l.rbIndex+1].x?l[l.rbIndex+1].resetByPoint(e[3]):(l.insert(l.rbIndex+1,e[0]),l.insert(l.rbIndex+1,e[3])),l.insert(l.rbIndex+1,e[2]),l.insert(l.rbIndex+1,e[1]),l.rbIndex+=2,this.delete(this.count-1))}}},{key:"combineRect",value:function(t){this._addRectPath(t)}},{key:"frameRgn",value:function(t){for(var e,i=0;i<this.count;i++){e=this[i],t.beginPath(),t.moveToPoint(e[0]);for(var n=1;n<e.length;n++)t.lineToPoint(e[n]);t.lineToPoint(e[0]),t.paintPath()}}}])&&ih(e.prototype,i),n&&ih(e,n),r}(V);function fh(t){return(fh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dh(t,e,i){return(dh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ih(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function mh(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function yh(t,e,i){return e&&mh(t.prototype,e),i&&mh(t,i),t}function ph(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Sh(t,e)}function Sh(t,e){return(Sh=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function vh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Ih(t);if(e){var o=Ih(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Fh(this,i)}}function Fh(t,e){return!e||"object"!==fh(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ih(t){return(Ih=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function gh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var wh=0,Ch=1,kh=2,Ph=3,Dh=4,bh=5,Rh=function t(){gh(this,t),this.TableSite=wh,this.DestX=0,this.DestY=0},_h=function t(){gh(this,t),this.Row=-1,this.Leftside=!0},xh=function(t){ph(i,t);var e=vh(i);function i(){var t;return gh(this,i),(t=e.call(this)).StartRow=-1,t.StartCol=-1,t.EndRow=-1,t.EndCol=-1,t}return yh(i,[{key:"SelectCellRang",value:function(){this.Initialize()}},{key:"Initialize",value:function(){this.StartRow=-1,this.StartCol=-1,this.InitializeEnd()}},{key:"InitializeEnd",value:function(){this.EndRow=-1,this.EndCol=-1}},{key:"SetStart",value:function(t,e){this.StartRow=t,this.StartCol=e}},{key:"SetEnd",value:function(t,e){this.EndRow=t,this.EndCol=e}},{key:"EditCell",value:function(){return this.StartRow>=0&&this.EndRow<0}},{key:"SameRow",value:function(){return this.StartRow>=0&&this.StartRow==this.EndRow}},{key:"SameCol",value:function(){return this.StartCol>=0&&this.StartCol==this.EndCol}},{key:"SelectExists",value:function(){return this.StartRow>=0&&this.EndRow>=0}}]),i}(L),Ah=0,Th=1,Oh=2,Nh=function(t){ph(i,t);var e=vh(i);function i(t){var n;return gh(this,i),(n=e.call(this)).FCellData=new lp.TableCellData(t),n.FAlignVert=Ah,n.FBorderSides=new Dp,n.FBorderSides.add(fp.Left),n.FBorderSides.add(fp.Top),n.FBorderSides.add(fp.Right),n.FBorderSides.add(fp.Bottom),n.FBackgroundColor=t.BackgroundColor,n.FRowSpan=0,n.FColSpan=0,n.FWidth=0,n.FHeight=0,n}return yh(i,[{key:"GetActive",value:function(){return null!=this.FCellData&&this.FCellData.Active}},{key:"SetActive",value:function(t){null!=this.FCellData&&(this.FCellData.Active=t)}},{key:"SetHeight",value:function(t){this.FHeight!=t&&(this.FHeight=t,null!=this.FCellData&&(this.FCellData.CellHeight=t))}},{key:"dispose",value:function(){dh(Ih(i.prototype),"dispose",this).call(this),null!=this.FCellData&&this.FCellData.dispose()}},{key:"MouseDown",value:function(t,e,i){if(this.Active=!0,null!=this.FCellData){var n=new ei;n.assign(t),n.x-=e,n.y-=this.GetCellDataTop(i),this.FCellData.MouseDown(n)}}},{key:"MouseMove",value:function(t,e,i){if(null!=this.FCellData){var n=new ei;n.assign(t),n.x-=e,n.y-=this.GetCellDataTop(i),this.FCellData.MouseMove(n)}}},{key:"MouseUp",value:function(t,e,i){if(null!=this.FCellData){var n=new ei;n.assign(t),n.x-=e,n.y-=this.GetCellDataTop(i),this.FCellData.MouseUp(n)}}},{key:"IsMergeSource",value:function(){return null==this.FCellData}},{key:"IsMergeDest",value:function(){return this.FRowSpan>0||this.FColSpan>0}},{key:"ClearFormatExtraHeight",value:function(){return null!=this.FCellData?this.FCellData.ClearFormatExtraHeight():0}},{key:"SaveToStream",value:function(t){t.writeInt32(this.FWidth),t.writeInt32(this.FHeight),t.writeInt32(this.FRowSpan),t.writeInt32(this.FColSpan),t.writeByte(this.FAlignVert),lp.HCSaveColorToStream(t,this.FBackgroundColor),t.writeByte(this.FBorderSides.value);var e=null==this.FCellData;t.writeBoolean(e),e||this.FCellData.SaveToStream(t)}},{key:"LoadFromStream",value:function(t,e,i){this.FWidth=t.readInt32(),this.FHeight=t.readInt32(),this.FRowSpan=t.readInt32(),this.FColSpan=t.readInt32(),i>11&&(this.FAlignVert=t.readByte(),this.FBackgroundColor=lp.HCLoadColorFromStream(t)),i>13&&(this.FBorderSides.value=t.readByte()),t.readBoolean()?(this.FRowSpan<0||this.FColSpan<0)&&(this.FCellData.dispose(),this.FCellData=null):(this.FCellData.LoadFromStream(t,e,i),this.FCellData.CellHeight=this.FHeight)}},{key:"ToXml",value:function(t){}},{key:"ParseXml",value:function(t){}},{key:"GetCellDataTop",value:function(t){switch(this.FAlignVert){case Ah:return t;case Th:return t+Math.trunc((this.FHeight-t-this.FCellData.height-t)/2);default:return this.FHeight-t-this.FCellData.height}}},{key:"GetCaretInfo",value:function(t,e,i,n,o){null!=this.FCellData?(this.FCellData.GetCaretInfo(t,e,o),o.Visible&&(o.X+=i,o.Y+=this.GetCellDataTop(n))):o.Visible=!1}},{key:"PaintTo",value:function(t,e,i,n,o,r,s,a,l,h,c){if(null!=this.FCellData){if(!c.Print&&""!=this.FCellData.Script){h.pen.width=1,h.pen.color=at.Gray,h.pen.style=pt.Solid,h.beginPath();try{h.moveTo(i-5,e),h.lineTo(i,e),h.moveTo(i-4,e+1),h.lineTo(i,e+1),h.moveTo(i-3,e+2),h.lineTo(i,e+2),h.moveTo(i-2,e+3),h.lineTo(i,e+3),h.moveTo(i-1,e+4),h.lineTo(i,e+4),h.moveTo(i,e+5),h.lineTo(i,e+5)}finally{h.paintPath()}}var u=e+this.GetCellDataTop(l);this.FCellData.PaintData(t+a,u,i-a,n,o,r,s,h,c)}}},{key:"CellData",get:function(){return this.FCellData},set:function(t){this.FCellData=t}},{key:"Width",get:function(){return this.FWidth},set:function(t){this.FWidth=t}},{key:"Height",get:function(){return this.FHeight},set:function(t){this.SetHeight(t)}},{key:"RowSpan",get:function(){return this.FRowSpan},set:function(t){this.FRowSpan=t}},{key:"ColSpan",get:function(){return this.FColSpan},set:function(t){this.FColSpan=t}},{key:"BackgroundColor",get:function(){return this.FBackgroundColor},set:function(t){this.FBackgroundColor=t}},{key:"Active",get:function(){return this.GetActive()},set:function(t){this.SetActive(t)}},{key:"AlignVert",get:function(){return this.FAlignVert},set:function(t){this.FAlignVert=t}},{key:"BorderSides",get:function(){return this.FBorderSides},set:function(t){this.FBorderSides=t}}]),i}(L);function Bh(t){return(Bh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Eh(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Mh(t,e){return(Mh=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Lh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Hh(t);if(e){var o=Hh(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Gh(this,i)}}function Gh(t,e){return!e||"object"!==Bh(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Hh(t){return(Hh=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Uh=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Mh(t,e)}(r,t);var e,i,n,o=Lh(r);function r(t,e){var i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(i=o.call(this)).FHeight=10,i.FFmtOffset=0,i.FAutoHeight=!0,i.FOnGetVPaddingPix=null,i.OnGetDefaultRowHeight=null;for(var n=0;n<e;n++)i.add(i.DoCreateCell(t));return i}return e=r,(i=[{key:"CalcMaxCellDataHeight",value:function(){var t;t=null!=this.OnGetDefaultRowHeight?this.OnGetDefaultRowHeight():lp.MinRowHeight;for(var e=0,i=this.count;e<i;e++)null!=this[e].CellData&&0==this[e].RowSpan&&this[e].CellData.height>t&&(t=this[e].CellData.height);return t}},{key:"SetRowWidth",value:function(t){for(var e=Math.trunc(t/this.count),i=0;i<=this.count-2;i++)this[i].Width=e;this.last.Width=t-(this.count-1)*e}},{key:"SetHeight",value:function(t){if(this.FHeight!=t){var e=this.CalcMaxCellDataHeight()+this.GetVPadding()+this.GetVPadding();this.FHeight=e<t?t:e;for(var i=0,n=this.count;i<n;i++)this[i].Height=this.FHeight}}},{key:"GetVPadding",value:function(){return null!=this.FOnGetVPaddingPix?this.FOnGetVPaddingPix():0}},{key:"DoCreateCell",value:function(t){return new Nh(t)}},{key:"FormatInit",value:function(){var t=this.CalcMaxCellDataHeight()+this.GetVPadding()+this.GetVPadding();this.FAutoHeight?this.FHeight=t:this.FHeight<t&&(this.FHeight=t,this.FAutoHeight=!0);for(var e=0,i=this.count;e<i;e++)this[e].Height=this.FHeight}},{key:"CreateCell",value:function(t){return this.DoCreateCell(t)}},{key:"SaveToStream",value:function(t){}},{key:"LoadFromStream",value:function(t,e){}},{key:"ToXml",value:function(t){}},{key:"ParseXml",value:function(t){}},{key:"ColCount",get:function(){return this.count}},{key:"Height",get:function(){return this.FHeight},set:function(t){this.SetHeight(t)}},{key:"AutoHeight",get:function(){return this.FAutoHeight},set:function(t){this.FAutoHeight=t}},{key:"FmtOffset",get:function(){return this.FFmtOffset},set:function(t){this.FFmtOffset=t}},{key:"OnGetVPaddingPix",get:function(){return this.FOnGetVPaddingPix},set:function(t){this.FOnGetVPaddingPix=t}}])&&Eh(e.prototype,i),n&&Eh(e,n),r}(V);function Vh(t){return(Vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wh(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function zh(t,e,i){return e&&Wh(t.prototype,e),i&&Wh(t,i),t}function jh(t,e,i){return(jh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Zh(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Xh(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Kh(t,e)}function Kh(t,e){return(Kh=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Yh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Zh(t);if(e){var o=Zh(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Jh(this,i)}}function Jh(t,e){return!e||"object"!==Vh(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Zh(t){return(Zh=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function qh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Qh=function t(){qh(this,t),this.PageIndex=-1,this.Row=-1,this.BreakSeat=0,this.BreakBottom=0},$h=function(t){Xh(i,t);var e=Yh(i);function i(){var t;return qh(this,i),(t=e.call(this)).FOnRowAdd=null,t}return zh(i,[{key:"doAdded_",value:function(t){jh(Zh(i.prototype),"doAdded_",this).call(this,t),null!=this.FOnRowAdd&&this.FOnRowAdd(t)}},{key:"onRowAdd",get:function(){return this.FOnRowAdd},set:function(t){this.FOnRowAdd=t}}]),i}(V),tc=function t(){qh(this,t),this.Col=-1,this.DrawItemNo=-1,this.VDrawOffset=0},ec=function(){function t(){qh(this,t),this.FEnable=!1,this.Row=-1,this.Col=-1}return zh(t,[{key:"SetEnable",value:function(t){this.FEnable!=t&&(this.FEnable=t,this.FEnable&&this.Init(-1,-1))}},{key:"Init",value:function(t,e){this.Row=t,this.Col=e}},{key:"Enable",get:function(){return this.FEnable},set:function(t){this.SetEnable(t)}}]),t}(),ic=function(t){Xh(i,t);var e=Yh(i);function i(t,n,o,r){var s;return qh(this,i),s=e.call(this,t),0==n&&or.exception("异常:不能创建行数为0的表格!"),0==o&&or.exception("异常:不能创建列数为0的表格!"),s.StyleNo=cs.Table,s.ParaNo=t.CurParaNo,s.GripSize=2,s.FBorderWidthPix=0,s.FCellHPaddingPix=2,s.FCellVPaddingPix=2,s.BorderWidthPt=.5,s.CellVPaddingMM=0,s.CellHPaddingMM=.5,s.FOutsideInfo=new _h,s.FMouseDownRow=-1,s.FMouseDownCol=-1,s.FMouseMoveRow=-1,s.FMouseMoveCol=-1,s.FMouseDownX=0,s.FMouseDownY=0,s.FFormatHeight=0,s.FDefaultRowHeight=lp.MinRowHeight,s.FResizeInfo=null,s.FMulCellUndo=new ec,s.FBorderVisible=!0,s.FMouseLBDowning=!1,s.FSelecting=!1,s.FDraging=!1,s.FOutSelectInto=!1,s.FResizeKeepWidth=!1,s.FBorderColor="black",s.FFixColor=lp.clBtnFace,s.BorderWidthPt=.5,s.CanPageBreak=!0,s.FPageBreaks=new V,s.FSelectCellRang=new xh,s.FColWidths=new V,s.FRows=new $h,s.FRows.onRowAdd=function(t){s.DoRowAdd(t)},s.FRows.onRemoved=function(t){s.DoRowRemove(t)},s.FRowCacheCount=0,s.FRowCache=new Array(0),s.ResetRowCol(r,n,o),s.FMangerUndo=!0,s.FOnCellPaintBK=null,s.FOnCellPaintData=null,s.OnKeyDown=null,s}return zh(i,[{key:"InitializeMouseInfo",value:function(){this.FMouseDownRow=-1,this.FMouseDownCol=-1,this.FMouseMoveRow=-1,this.FMouseMoveCol=-1,this.FMouseLBDowning=!1}},{key:"InitializeCellData",value:function(t){var e=this;t.ParentData=this.OwnerData,t.OnInsertItem=function(t,i){e.OwnerData.OnInsertItem(t,i)},t.OnRemoveItem=function(t,i){e.OwnerData.OnRemoveItem(t,i)},t.OnSaveItem=function(t,i){return e.OwnerData.OnSaveItem(t,i)},t.OnAcceptAction=function(t,i,n,o){return e.OwnerData.OnAcceptAction(t,i,n,o)},t.OnItemMouseDown=function(t,i,n,o){e.OwnerData.OnItemMouseDown(t,i,n,o)},t.OnItemMouseUp=function(t,i,n,o){e.OwnerData.OnItemMouseUp(t,i,n,o)},t.OnDrawItemMouseMove=function(t,i,n,o,r){e.OwnerData.OnDrawItemMouseMove(t,i,n,o,r)},t.OnItemReFormatRequest=function(t,i){e.DoCellDataItemReFormatRequest(t,i)},t.OnItemSetCaretRequest=function(t,i,n){e.DoCellDataItemSetCaretRequest(t,i,n)},t.OnCreateItemByStyle=function(t,i){return e.OwnerData.OnCreateItemByStyle(t,i)},t.OnDrawItemPaintBefor=function(t,i,n,o,r,s,a,l,h,c,u,f){e.OwnerData.OnDrawItemPaintBefor(t,i,n,o,r,s,a,l,h,c,u,f)},t.OnDrawItemPaintContent=function(t,i,n,o,r,s,a,l,h,c,u,f,d){e.OwnerData.OnDrawItemPaintContent(t,i,n,o,r,s,a,l,h,c,u,f,d)},t.OnDrawItemPaintAfter=function(t,i,n,o,r,s,a,l,h,c,u,f){e.DoCellDataDrawItemPaintAfter(t,i,n,o,r,s,a,l,h,c,u,f)},t.OnInsertAnnotate=function(t,i){e.OwnerData.OnInsertAnnotate(t,i)},t.OnRemoveAnnotate=function(t,i){e.OwnerData.OnRemoveAnnotate(t,i)},t.OnDrawItemAnnotate=function(t,i,n,o){e.OwnerData.OnDrawItemAnnotate(t,i,n,o)},t.OnCaretItemChanged=function(t,i){e.OwnerData.OnCaretItemChanged(t,i)},t.OnDomainSwitch=function(t,i){e.OwnerData.OnDomainSwitch(t,i)},t.OnChange=function(){e.OwnerData.OnChange()},t.OnCanEdit=function(t){return e.OwnerData.OnCanEdit(t)},t.OnInsertTextBefor=function(t,i,n,o){return e.OwnerData.OnInsertTextBefor(t,i,n,o)},t.OnPaintDomainRegion=function(t,i){return e.OwnerData.OnPaintDomainRegion(t,i)},t.OnMatchTextStyleNoAt=function(t,i,n){return e.OwnerData.OnMatchTextStyleNoAt(t,i,n)},t.OnItemResized=function(t,i){e.OwnerData.OnItemResized(t,i)},t.OnCurParaNoChange=function(t){e.OwnerData.OnCurParaNoChange(t)},t.OnCreateItem=function(t){e.OwnerData.OnCreateItem(t)},t.OnGetUndoList=function(){return e.GetSelfUndoList()},t.OnGetRootData=function(){return e.DoCellDataGetRootData()},t.OnGetFormatTop=function(t){return e.DoCellDataGetFormatTop(t)},t.OnFormatDirty=function(){e.DoCellDataFormatDirty()},t.OnSetFormatHeightChange=function(){e.DoCellDataSetFormatHeightChange()}}},{key:"DoCellDataGetRootData",value:function(){return this.OwnerData.GetRootData()}},{key:"DoCellDataFormatDirty",value:function(){this.FormatDirty()}},{key:"DoCellDataSetFormatHeightChange",value:function(){this.OwnerData.SetFormatHeightChange()}},{key:"_safeRowCol",value:function(t,e){return!(t<0||t>this.FRows.count-1)&&!(e<0||e>this.FColWidths.count-1)}},{key:"getCellText",value:function(t,e){if(this._safeRowCol(t,e))return null!=this.FRows[t][e].CellData?this.FRows[t][e].CellData.Items[0].Text:""}},{key:"setCellText",value:function(t,e,i){this._safeRowCol(t,e)&&""!=i&&null!=this.FRows[t][e].CellData&&(this.FRows[t][e].CellData.Items[0].Text=i)}},{key:"setCellColor",value:function(t,e,i){this._safeRowCol(t,e)&&(this.FRows[t][e].BackgroundColor=i)}},{key:"DoCheckCellScript",value:function(t,e){for(var i=this.FRows.count,n=this.FColWidths.count,o=!1,r=null,s=0;s<i;s++)for(var a=0;a<n;a++)if(null!=this.FRows[s][a].CellData&&""!=this.FRows[s][a].CellData.Script){r=new Function("cgrow","cgcol","table","row","col",this.FRows[s][a].CellData.Script);try{r(t,e,this,s,a)&&(o=!0)}catch(t){this.setCellText(s,a,t.message),o=!0}r=null}o&&this.ReFormatRequest()}},{key:"DoColCountChange",value:function(){this._CacheDynamicAppendRow(!0)}},{key:"DoCellDataItemReFormatRequest",value:function(t,e){this.FormatDirty(),this.OwnerData.ItemReFormatRequest(this)}},{key:"DoCellDataItemSetCaretRequest",value:function(t,e,i){this.DisSelect();for(var n=-1,o=-1,r=0;r<this.RowCount&&!(n>=0);r++)for(var s=0;s<this.FColWidths.count;s++)if(this.FRows[r][s].CellData===t){n=r,o=s;break}n>=0&&(this.FSelectCellRang.SetStart(n,o),this.OwnerData.ItemSetCaretRequest(this.OwnerData.GetItemNo(this),lp.OffsetInner))}},{key:"DoCellDataGetFormatTop",value:function(t){for(var e=0,i=!1,n=0;n<this.FRows.count&&!i;n++){for(var o=0;o<this.FColWidths.count;o++)if(this.FRows[n][o].CellData===t){e+=this.FCellVPaddingPix,i=!0;break}i||(e+=this.FRows[n].FmtOffset+this.FRows[n].Height+this.FBorderWidthPix)}return e+this.OwnerData.GetDrawItemFormatTop(this.FirstDItemNo)}},{key:"DoSelectCellChange",value:function(t,e,i,n){lp.USESCRIPT&&t>=0&&e>=0&&this.DoCheckCellScript(t,e)}},{key:"DoRowAdd",value:function(t){var e=this;t.OnGetVPaddingPix=function(){return e.DoRowGetVPaddingPix()},t.OnGetDefaultRowHeight=function(){return e.DoRowGetDefaultRowHeight()};for(var i=null,n=0;n<t.ColCount;n++)null!=(i=t[n].CellData)&&this.InitializeCellData(i)}},{key:"DoRowRemove",value:function(t){this.InitializeMouseInfo()}},{key:"DoRowGetVPaddingPix",value:function(){return this.FCellVPaddingPix}},{key:"DoRowGetDefaultRowHeight",value:function(){return this.FDefaultRowHeight}},{key:"CellChangeByAction",value:function(t,e,i){this.IsFormatDirty=!1,i(),this.IsFormatDirty||(this.IsFormatDirty=this.FRows[t][e].CellData.FormatHeightChange)}},{key:"GetFormatHeight",value:function(){this.FFormatHeight=this.FBorderWidthPix;for(var t=0;t<this.RowCount;t++)this.FFormatHeight=this.FFormatHeight+this.FRows[t].Height+this.FBorderWidthPix;return this.FFormatHeight}},{key:"CalcRowCellHeight",value:function(t){for(var e=0,i=0;i<this.FRows[t].ColCount;i++)null!=this.FRows[t][i].CellData&&0==this.FRows[t][i].RowSpan&&(e=Math.max(e,this.FRows[t][i].CellData.height));e=this.FCellVPaddingPix+e+this.FCellVPaddingPix,this.FRows[t].AutoHeight?this.FRows[t].Height=e:e>this.FRows[t].Height&&(this.FRows[t].AutoHeight=!0,this.FRows[t].Height=e)}},{key:"CalcMergeRowHeightFrom",value:function(t){for(var e=-1,i=-1,n=0,o=0,r=-1,s=-1,a=t;a<this.RowCount;a++)for(var l=0;l<this.FRows[a].ColCount;l++)if(null==this.FRows[a][l].CellData){if(this.FRows[a][l].ColSpan<0)continue;var h=this.GetDestCell(a,l);if(e=h.row,i=h.col,e+this.FRows[e][l].RowSpan==a){n=this.FCellVPaddingPix+this.FRows[e][l].CellData.height+this.FCellVPaddingPix,this.FRows[e][l].Height=n,n=n-this.FRows[e].Height-this.FBorderWidthPix;for(var c=e+1;c<=a-1;c++)n=n-this.FRows[c].FmtOffset-this.FRows[c].Height-this.FBorderWidthPix;if(n>this.FRows[a].FmtOffset+this.FRows[a].Height){o=n-this.FRows[a].FmtOffset-this.FRows[a].Height,this.FRows[a].Height=n-this.FRows[a].FmtOffset;for(var u=0;u<this.FRows[a].ColCount;u++)if(null==this.FRows[a][u].CellData){if(this.FRows[a][u].ColSpan<0)continue;r=(h=this.GetDestCell(a,u)).row,s=h.col,r==e&&s==i||(this.FRows[r][u].Height=this.FRows[r][u].Height+o)}}else this.FRows[e][l].Height+=this.FRows[a].FmtOffset+this.FRows[a].Height-n}}}},{key:"SrcCellDataTopDistanceToDest",value:function(t,e){for(var i=this.FBorderWidthPix+this.FRows[t].FmtOffset,n=t-1;n>e;)i+=this.FRows[n].Height+this.FBorderWidthPix+this.FRows[n].FmtOffset,n--;return i+this.FRows[e].Height}},{key:"GetCellPostion",value:function(t,e){for(var i=G.Create(this.FBorderWidthPix,this.FBorderWidthPix),n=0;n<t;n++)i.y=i.y+this.FRows[n].FmtOffset+this.FRows[n].Height+this.FBorderWidthPix;i.y=i.y+this.FRows[t].FmtOffset;for(var o=0;o<e;o++)i.x=i.x+this.FColWidths[o]+this.FBorderWidthPix;return i}},{key:"ActiveDataResizing",value:function(){return!!this.FSelectCellRang.EditCell()&&this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectedResizing()}},{key:"DisSelectSelectedCell",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(this.FSelectCellRang.StartRow>=0){var i=null;this.FSelectCellRang.StartRow==t&&this.FSelectCellRang.StartCol==e||(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1);for(var n=this.FSelectCellRang.StartRow;n<=this.FSelectCellRang.EndRow;n++)for(var o=this.FSelectCellRang.StartCol;o<=this.FSelectCellRang.EndCol;o++)n==t&&o==e||(this.FRows[n][o].Active=!1,null!=(i=this.FRows[n][o].CellData)&&(i.DisSelect(),i.InitializeField()))}}},{key:"SetBorderWidthPt",value:function(t){this.FBorderWidthPt!=t&&(this.FBorderWidthPt=t,this.FBorderWidthPix=sr.ptToPixel(this.FBorderWidthPt,sr.PixelsPerInchX),this.FormatDirty())}},{key:"SetCellVPaddingMM",value:function(t){this.FCellVPaddingMM!=t&&(this.FCellVPaddingMM=t,this.FCellVPaddingPix=sr.millimeterToPixY(this.FCellVPaddingMM),this.FormatDirty())}},{key:"SetCellHPaddingMM",value:function(t){this.FCellHPaddingMM!=t&&(this.FCellHPaddingMM=t,this.FCellHPaddingPix=sr.millimeterToPixX(this.FCellHPaddingMM),this.FormatDirty())}},{key:"CanDrag",value:function(){var t=jh(Zh(i.prototype),"CanDrag",this).call(this);return t&&(t=this.FSelectCellRang.EditCell()?this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectedCanDrag():this.IsSelectComplate||this.IsSelectPart),t}},{key:"GetSelectComplate",value:function(){return 0==this.FSelectCellRang.StartRow&&0==this.FSelectCellRang.StartCol&&this.FSelectCellRang.EndRow==this.FRows.count-1&&this.FSelectCellRang.EndCol==this.FColWidths.count-1}},{key:"SelectComplate",value:function(){this.SelectRange(0,0,this.RowCount-1,this.FColWidths.count-1)}},{key:"GetResizing",value:function(){return jh(Zh(i.prototype),"GetResizing",this).call(this)||this.ActiveDataResizing()}},{key:"SetResizing",value:function(t){jh(Zh(i.prototype),"SetResizing",this).call(this,t)}},{key:"DoCreateRow",value:function(t,e){return new Uh(t,e)}},{key:"CheckRowBorderShouLian",value:function(t,e,i,n,o,r){if(0==o){for(var s=n.top+this.FBorderWidthPix-1,a=0;a<t;a++)s=s+this.FRows[a].FmtOffset+this.FRows[a].Height+this.FBorderWidthPix;if(this.FRows[t].FmtOffset>0){if(t!=r)return{shouLian:o=s-this.FBorderWidthPix,firstDrawRow:r};if(s+this.FRows[t].FmtOffset+this.FRows[t].Height<=e)return{shouLian:o=s+this.FRows[t].FmtOffset+this.FRows[t].Height,firstDrawRow:r}}s+=this.FRows[t].FmtOffset;for(var l,h,c,u=0,f=0,d=-1,m=-1,y=0,p=null,S=this.FRows[t].ColCount,v=!1,F=0;F<S;F++)if(f=s,d=(l=this.GetDestCell(t,F)).row,m=l.col,c=this.FRows[d][m].GetCellDataTop(this.FCellVPaddingPix),F==m+this.FRows[d][m].ColSpan){p=this.FRows[d][m].CellData,d!=t&&(f-=this.SrcCellDataTopDistanceToDest(t,d)),y=p.DrawItems.count;for(var I=0;I<y;I++)if(p.DrawItems[I].LineFirst){if((h=U.CreateByRect(p.DrawItems[I].rect)).bottom=h.bottom+this.FCellVPaddingPix,f+c+h.bottom>e){o=I>0?e-f-c-p.DrawItems[I-1].rect.bottom>this.FCellVPaddingPix?Math.max(o,f+c+p.DrawItems[I-1].rect.bottom+this.FCellVPaddingPix):Math.max(o,f+c+p.DrawItems[I-1].rect.bottom):Math.max(o,f-this.FBorderWidthPix),v=!0;break}u=Math.max(u,f+c+h.bottom)}}o=v?Math.max(o,u):Math.min(i,s+this.FRows[t].FmtOffset+this.FRows[t].Height)}return{shouLian:o,firstDrawRow:r}}},{key:"DoDrawPageBreakMark",value:function(t,e,i,n,o){e.pen.color="gray",e.pen.style=pt.Dot,e.pen.width=1,t?(e.drawLineDriect(i+5,n-1,i+20,n-1),e.pen.style=pt.Solid,e.drawLineByPointsDriect([G.Create(i+19,n-2),G.Create(i+19,n-10),G.Create(i+5,n-10),G.Create(i+5,n-2)])):(e.drawLineDriect(i+5,o+1,i+20,o+1),e.pen.style=pt.Solid,e.drawLineByPointsDriect([G.Create(i+19,o+3),G.Create(i+19,o+10),G.Create(i+5,o+10),G.Create(i+5,o+3)])),e.pen.color="black"}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){for(var l,h,c,u,f,d,m=-1,y=0,p=0,S=0,v=0,F=0,I=0,g=0,w=0,C=0,k=0,P=0,D=0,b=0,R=0,_=!1,x=Math.trunc(this.FBorderWidthPix/2),A=!1,T=e.top+this.FBorderWidthPix,O=this.FRows.count,N=0,B=this.FColWidths.length,E=0;E<O;E++){if((T=T+this.FRows[E].FmtOffset+this.FCellVPaddingPix)>=r){m<0&&this.IsBreakRow(E)&&(A=this.FFixRow>=0&&E>this.FFixRow+this.FFixRowCount-1);break}if((y=T-this.FCellVPaddingPix+this.FRows[E].Height-this.FCellVPaddingPix)<=o)T=y+this.FCellVPaddingPix+this.FBorderWidthPix;else{m<0&&(m=E,A=this.FFixRow>=0&&E>this.FFixRow+this.FFixRowCount-1),p=e.left+this.FBorderWidthPix,S=0,N=this.FRows[E].ColCount;for(var M=0;M<N;M++)if(this.FRows[E][M].ColSpan<0)p=p+this.FColWidths[M]+this.FBorderWidthPix;else{if(_=!0,this.FRows[E][M].RowSpan<0&&E!=m&&(_=!1),v=T,F=(h=this.GetDestCell(E,M)).row,I=h.col,F!=E&&(v-=this.SrcCellDataTopDistanceToDest(E,F)),d=this.FBorderVisible||!a.Print,(C=(l=v-this.FCellVPaddingPix-this.FBorderWidthPix)+this.FBorderWidthPix+Math.max(this.FRows[E].Height,this.FRows[F][I].Height))>r)if(D=0,this.FRows[E][M].RowSpan>0)for(D=l,g=E;g<O;){if((D=D+this.FRows[g].FmtOffset+this.FRows[g].Height+this.FBorderWidthPix)>r){D>n&&(S=(h=this.CheckRowBorderShouLian(g,n,r,e,S,m)).shouLian,m=h.firstDrawRow,C=S);break}g++}else if(this.FRows[E][M].RowSpan<0)if(E!=m)d=!1;else{D=l;for(var L=F;L<E;L++)D=D+this.FRows[L].Height+this.FBorderWidthPix;for(g=E;g<O;){if((D=D+this.FRows[g].Height+this.FBorderWidthPix)>r){D>n&&(S=(h=this.CheckRowBorderShouLian(g,n,r,e,S,m)).shouLian,m=h.firstDrawRow,C=S);break}g++}}else this.IsBreakRow(E)&&(S=(h=this.CheckRowBorderShouLian(E,n,r,e,S,m)).shouLian,m=h.firstDrawRow,C=S);_&&(k=Math.min(r,T+Math.max(this.FRows[E].Height,this.FRows[F][I].Height)-this.FCellVPaddingPix),c=this.FRows[F][I].CellData,(P=Math.max(o,T-this.FCellVPaddingPix))-v<this.FRows[F][I].Height&&(u=U.Create(p,v-this.FCellVPaddingPix,p+this.FRows[F][I].CellData.Width+this.FCellHPaddingPix+this.FCellHPaddingPix,Math.max(C,v+this.FRows[F][I].CellData.height+this.FCellVPaddingPix)),!this.IsSelectComplate&&!c.CellSelectedAll||a.Print?(f=!0,null!=this.FOnCellPaintBK&&(f=this.FOnCellPaintBK(this,this.FRows[F][I],u,s,a,f)),f&&(this.IsFixRow(E)||this.IsFixCol(M)?s.brush.color=this.FFixColor:this.FRows[F][I].BackgroundColor!=lp.HCTransparentColor?s.brush.color=this.FRows[F][I].BackgroundColor:s.brush.style=Ft,s.fillRect(u))):(s.brush.color=this.OwnerData.Style.SelColor,s.fillRect(u)),k-P>this.FCellVPaddingPix&&(this.DoCellPaintDataBefor(F,I,u,s,a),this.FRows[F][I].PaintTo(p,v-this.FCellVPaddingPix,p+this.FColWidths[M]+this.GetColSpanWidth(F,I),n,o,r,0,this.FCellHPaddingPix,this.FCellVPaddingPix,s,a),null!=this.FOnCellPaintData&&this.FOnCellPaintData(this,e,u,F,I,v,n,o,r,s,a)))),d&&(a.Print?s.pen.width=Math.max(1,sr.ptToPixel(this.FBorderWidthPt,a.DPI)):s.pen.width=this.FBorderWidthPix,this.FBorderVisible?(s.pen.color=at.Black,s.pen.style=pt.Solid):a.Print||(s.pen.color=lp.clActiveBorder,s.pen.style=pt.Dot,s.pen.width=1),b=p-this.FBorderWidthPix,R=p+this.FColWidths[M]+this.GetColSpanWidth(F,I),this.IsBreakRow(E)&&E==m&&(l-=1),l<o&&i>=0&&(l=o),l+this.FBorderWidthPix>0&&this.FRows[E][M].BorderSides.has(fp.Top)&&(a.Print?a.drawNoScaleLine(s,[G.Create(b+x,l+x),G.Create(R+x,l+x)]):s.drawLineDriect(b+x,l+x,R+x,l+x)),this.FRows[E][M].BorderSides.has(fp.Right)&&(a.Print?a.drawNoScaleLine(s,[G.Create(R+x,l+x),G.Create(R+x,C+x)]):s.drawLineDriect(R+x,l+x,R+x,C+x)),C<=r&&this.FRows[E][M].BorderSides.has(fp.Bottom)&&(a.Print?a.drawNoScaleLine(s,[G.Create(b+x,C+x),G.Create(R+x,C+x)]):s.drawLineDriect(b+x,C+x,R+x+1,C+x)),this.FRows[E][M].BorderSides.has(fp.Left)&&(a.Print?a.drawNoScaleLine(s,[G.Create(b+x,l+x),G.Create(b+x,C+x)]):s.drawLineDriect(b+x,l+x,b+x,C+x)),this.FRows[E][M].BorderSides.has(fp.LTRB)&&(a.Print?a.drawNoScaleLine(s,[G.Create(b+x,l+x),G.Create(R+x,C+x)]):s.drawLineDriect(b+x,l+x,R+x,C+x)),this.FRows[E][M].BorderSides.has(fp.RTLB)&&(a.Print?a.drawNoScaleLine(s,[G.Create(R+x,l+x),G.Create(b+x,C+x)]):s.drawLineDriect(R+x,l+x,b+x,C+x)),this.DoPaintCellBorderSides(s,E,M,b+x,l+x,R+x,C+x),w=M+this.FRows[E][M].ColSpan,a.Print||w!=B-1||((T+this.FRows[E].Height-this.FCellVPaddingPix>n||E<O-1&&C+this.FRows[E+1].FmtOffset+this.FRows[E+1].Height>n&&(this.FRows[E+1].FmtOffset>0||C==n))&&this.DoDrawPageBreakMark(!0,s,R,C,i),0!=m&&E==m&&e.top<i&&this.DoDrawPageBreakMark(!1,s,R,C,i))),p=p+this.FColWidths[M]+this.FBorderWidthPix}T=y+this.FCellVPaddingPix+this.FBorderWidthPix}}A&&this.PaintFixRows(e.left,i,r,s,a),this.FFixCol>=0&&this.GetFixColLeft()+e.left<0&&this.PaintFixCols(e.top,0,i,r,s,a),this.Resizing&&this.FResizeInfo.TableSite==Dh?(s.pen.color=this.FBorderColor,s.pen.style=pt.Dot,s.pen.width=1,s.drawLineDriect(e.left+this.FResizeInfo.DestX,Math.max(i,e.top),e.left+this.FResizeInfo.DestX,Math.min(n,Math.min(e.bottom,C)))):this.Resizing&&this.FResizeInfo.TableSite==bh&&(s.pen.color=this.FBorderColor,s.pen.style=pt.Dot,s.pen.width=1,s.drawLineDriect(e.left,e.top+this.FResizeInfo.DestY,e.right,e.top+this.FResizeInfo.DestY))}},{key:"DoCellPaintDataBefor",value:function(t,e,i,n,o){}},{key:"DoCellDataDrawItemPaintAfter",value:function(t,e,i,n,o,r,s,a,l,h,c,u){null!=this.OwnerData.OnDrawItemPaintAfter&&this.OwnerData.OnDrawItemPaintAfter(t,e,i,n,o,r,s,a,l,h,c,u)}},{key:"DoPaintCellBorderSides",value:function(t,e,i,n,o,r,s){}},{key:"DoFormatToDrawItem",value:function(){}},{key:"MouseDown",value:function(t){var e,n=jh(Zh(i.prototype),"MouseDown",this).call(this,t),o=-1,r=-1,s=null,a=new G;this.FMouseLBDowning=t.button==ee&&!or.keyDownStates[Re],this.FOutSelectInto=!1,this.FSelecting=!1,this.FDraging=!1,this.FOutsideInfo.Row=-1;var l=this.GetCellAt(t.x,t.y,o,r);return this.FResizeInfo=l.resizeInfo,o=l.row,r=l.col,this.Resizing=t.button==ee&&(this.FResizeInfo.TableSite==Dh||this.FResizeInfo.TableSite==bh)&&this.AllowResize,this.Resizing?(this.FMouseDownRow==o&&this.FMouseDownCol==r||(this.FMouseDownRow>=0&&(this.FRows[this.FMouseDownRow][this.FMouseDownCol].Active=!1),this.FMouseDownRow=o,this.FMouseDownCol=r),this.FMouseDownX=t.x,this.FMouseDownY=t.y,this.OwnerData.Style.UpdateInfoRePaint(),n):(this.FResizeInfo.TableSite==Ch?this.CoordInSelect(t.x,t.y)?(this.FMouseLBDowning&&(this.FDraging=!0),this.FMouseDownRow==o&&this.FMouseDownCol==r||(this.FMouseDownRow>=0&&t.button!=ie&&(this.FRows[this.FMouseDownRow][this.FMouseDownCol].Active=!1),this.FMouseDownRow=o,this.FMouseDownCol=r),a=this.GetCellPostion(this.FMouseDownRow,this.FMouseDownCol),(e=new ei).assign(t),e.x-=a.x,e.y-=a.y,this.FRows[this.FMouseDownRow][this.FMouseDownCol].MouseDown(e,this.FCellHPaddingPix,this.FCellVPaddingPix)):(o==this.FMouseDownRow&&r==this.FMouseDownCol||(null!=(s=this.GetEditCell())&&(s.Active=!1),this.DoSelectCellChange(this.FMouseDownRow,this.FMouseDownCol,o,r),this.OwnerData.Style.UpdateInfoReCaret()),t.button==ee&&or.keyDownStates[Re]||this.DisSelect(),o==this.FMouseDownRow&&r==this.FMouseDownCol||(this.FMouseDownRow=o,this.FMouseDownCol=r),this.FSelectCellRang.SetStart(this.FMouseDownRow,this.FMouseDownCol),a=this.GetCellPostion(this.FMouseDownRow,this.FMouseDownCol),(e=new ei).assign(t),e.x-=a.x,e.y-=a.y,this.FRows[this.FMouseDownRow][this.FMouseDownCol].MouseDown(e,this.FCellHPaddingPix,this.FCellVPaddingPix)):(this.DisSelect(),this.InitializeMouseInfo(),this.FResizeInfo.TableSite==wh&&(this.FOutsideInfo.Row=o,this.FOutsideInfo.Leftside=t.x<0)),n)}},{key:"AdjustSelectRang",value:function(t,e){if(this.FSelectCellRang.StartRow>=0)for(var i=this.FSelectCellRang.StartRow;i<=this.FSelectCellRang.EndRow;i++)for(var n=this.FSelectCellRang.StartCol;n<=this.FSelectCellRang.EndCol;n++)i==this.FMouseDownRow&&n==this.FMouseDownCol||null!=this.FRows[i][n].CellData&&this.FRows[i][n].CellData.DisSelect();var o,r=-1,s=-1;this.FMouseDownRow<0?(0==t?(this.FMouseDownRow=0,this.FMouseDownCol=0,this.FSelectCellRang.SetStart(this.FMouseDownRow,this.FMouseDownCol),this.FSelectCellRang.SetEnd(t,e)):(r=(o=this.GetDestCell(this.RowCount-1,this.FColWidths.count-1)).row,s=o.col,this.FMouseDownRow=r,this.FMouseDownCol=s,this.FSelectCellRang.SetStart(t,e),this.FSelectCellRang.SetEnd(this.FMouseDownRow,this.FMouseDownCol)),this.FOutSelectInto=!0):this.FMouseMoveRow>this.FMouseDownRow?(this.FSelectCellRang.StartRow=this.FMouseDownRow,this.FSelectCellRang.EndRow=this.FMouseMoveRow,this.FMouseMoveCol<this.FMouseDownCol?(this.FSelectCellRang.StartCol=this.FMouseMoveCol,this.FSelectCellRang.EndCol=this.FMouseDownCol):(this.FSelectCellRang.StartCol=this.FMouseDownCol,this.FSelectCellRang.EndCol=this.FMouseMoveCol)):this.FMouseMoveRow<this.FMouseDownRow?(this.FSelectCellRang.StartRow=this.FMouseMoveRow,this.FSelectCellRang.EndRow=this.FMouseDownRow,this.FMouseMoveCol<this.FMouseDownCol?(this.FSelectCellRang.StartCol=this.FMouseMoveCol,this.FSelectCellRang.EndCol=this.FMouseDownCol):(this.FSelectCellRang.StartCol=this.FMouseDownCol,this.FSelectCellRang.EndCol=this.FMouseMoveCol)):(this.FSelectCellRang.StartRow=this.FMouseDownRow,this.FSelectCellRang.EndRow=this.FMouseMoveRow,this.FMouseMoveCol>this.FMouseDownCol?(this.FSelectCellRang.StartCol=this.FMouseDownCol,this.FSelectCellRang.EndCol=this.FMouseMoveCol):this.FMouseMoveCol<this.FMouseDownCol?(this.FSelectCellRang.StartCol=this.FMouseMoveCol,this.FSelectCellRang.EndCol=this.FMouseDownCol):(this.FSelectCellRang.StartCol=this.FMouseDownCol,this.FSelectCellRang.EndCol=this.FMouseMoveCol)),this.FSelectCellRang.StartRow==this.FSelectCellRang.EndRow&&this.FSelectCellRang.StartCol==this.FSelectCellRang.EndCol?this.FSelectCellRang.InitializeEnd():(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].IsMergeSource()&&(r=(o=this.GetDestCell(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol)).row,s=o.col,this.FSelectCellRang.SetStart(r,s)),this.FRows[this.FSelectCellRang.EndRow][this.FSelectCellRang.EndCol].IsMergeDest()&&(r=(o=this.GetSourceCell(this.FSelectCellRang.EndRow,this.FSelectCellRang.EndCol)).row,s=o.col,this.FSelectCellRang.SetEnd(r,s)),this.FSelectCellRang.StartRow==this.FSelectCellRang.EndRow&&this.FSelectCellRang.StartCol==this.FSelectCellRang.EndCol&&this.FSelectCellRang.InitializeEnd())}},{key:"MatchCellSelectState",value:function(){if(this.FSelectCellRang.EditCell())this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.CellSelectedAll=!1;else for(var t=this.FSelectCellRang.StartRow;t<=this.FSelectCellRang.EndRow;t++)for(var e=this.FSelectCellRang.StartCol;e<=this.FSelectCellRang.EndCol;e++)null!=this.FRows[t][e].CellData&&this.FRows[t][e].CellData.SelectAll()}},{key:"MouseMove",value:function(t){var e=new G;if(this.ActiveDataResizing()){e=this.GetCellPostion(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol);var i=new ei;return i.assign(t),i.x-=e.x,i.y-=e.y,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].MouseMove(i,this.FCellHPaddingPix,this.FCellVPaddingPix),!0}if(this.Resizing)return this.FResizeInfo.DestX=t.x,this.FResizeInfo.DestY=t.y,this.OwnerData.Style.UpdateInfoRePaint(),this.FResizeInfo.TableSite==Dh?lp.GCursor=ce:this.FResizeInfo.TableSite==bh&&(lp.GCursor=ve),!0;var n,o=-1,r=-1,s=this.GetCellAt(t.x,t.y,o,r),a=s.resizeInfo;if(o=s.row,r=s.col,a.TableSite==Ch)if(this.FMouseLBDowning||t.button==ee&&!or.keyDownStates[Re]){if(this.FDraging||this.OwnerData.Style.UpdateInfo.DragingSelected)return this.FMouseMoveRow=o,this.FMouseMoveCol=r,e=this.GetCellPostion(this.FMouseMoveRow,this.FMouseMoveCol),(n=new ei).assign(t),n.x-=e.x,n.y-=e.y,this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].MouseMove(n,this.FCellHPaddingPix,this.FCellVPaddingPix),!0;this.FSelecting||(this.FSelecting=!0),o==this.FMouseMoveRow&&r==this.FMouseMoveCol||(this.FMouseMoveRow=o,this.FMouseMoveCol=r,this.AdjustSelectRang(o,r),this.MatchCellSelectState()),e=this.GetCellPostion(this.FMouseMoveRow,this.FMouseMoveCol),(n=new ei).assign(t),n.x-=e.x,n.y-=e.y,this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].MouseMove(n,this.FCellHPaddingPix,this.FCellVPaddingPix)}else{if(o==this.FMouseMoveRow&&r==this.FMouseMoveCol||(this.FMouseMoveRow>=0&&this.FMouseMoveCol>=0&&null!=this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData&&this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData.MouseLeave(),this.FMouseMoveRow=o,this.FMouseMoveCol=r),this.FMouseMoveRow<0||this.FMouseMoveCol<0)return!0;e=this.GetCellPostion(this.FMouseMoveRow,this.FMouseMoveCol),(n=new ei).assign(t),n.x-=e.x,n.y-=e.y,this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].MouseMove(n,this.FCellHPaddingPix,this.FCellVPaddingPix)}else this.FMouseMoveRow>=0&&this.FMouseMoveCol>=0&&null!=this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData&&this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData.MouseLeave(),this.FMouseMoveRow=-1,this.FMouseMoveCol=-1,this.AllowResize&&(a.TableSite==Dh?lp.GCursor=ce:a.TableSite==bh&&(lp.GCursor=ve));return this.OwnerData.Style.UpdateInfo.DragingSelected&&this.FSelectCellRang.SetStart(this.FMouseMoveRow,this.FMouseMoveCol),!0}},{key:"MouseUp",value:function(t){var e=new G;if(this.FMouseLBDowning=!1,this.ActiveDataResizing()){e=this.GetCellPostion(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol);var i=new ei;return i.assign(t),i.x-=e.x,i.y-=e.y,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].MouseUp(i,this.FCellHPaddingPix,this.FCellVPaddingPix),!0}var n,o,r,s=-1,a=-1;return this.Resizing?(this.FResizeInfo.TableSite==Dh?(e.x=t.x-this.FMouseDownX,0!=e.x&&(n=(o=this.GetCellAt(this.FMouseDownX,this.FMouseDownY,s,a,!1)).resizeInfo,s=o.row,a=o.col,n.TableSite!=wh&&0!=e.x&&(e.x>0?a<this.FColWidths.count-1?(this.FColWidths[a+1]-e.x<lp.MinColWidth&&(e.x=this.FColWidths[a+1]-lp.MinColWidth),0!=e.x&&(this.Undo_ColResize(a,this.FColWidths[a],this.FColWidths[a]+e.x),this.FColWidths[a]=this.FColWidths[a]+e.x,this.FResizeKeepWidth&&a<this.FColWidths.count-1&&(this.FColWidths[a+1]-=e.x))):(this.FResizeKeepWidth&&this.FColWidths[a]+e.x>this.OwnerData.Width&&(e.x=this.OwnerData.Width-this.FColWidths[a+1]),this.Undo_ColResize(a,this.FColWidths[a],this.FColWidths[a]+e.x),this.FColWidths[a]=this.FColWidths[a]+e.x):(this.FColWidths[a]+e.x<lp.MinColWidth&&(e.x=lp.MinColWidth-this.FColWidths[a]),0!=e.x&&(this.Undo_ColResize(a,this.FColWidths[a],this.FColWidths[a]+e.x),this.FColWidths[a]=this.FColWidths[a]+e.x,this.FResizeKeepWidth&&a<this.FColWidths.count-1&&(this.FColWidths[a+1]-=e.x)))))):this.FResizeInfo.TableSite==bh&&(e.y=t.y-this.FMouseDownY,0!=e.y&&(this.Undo_RowResize(this.FMouseDownRow,this.FRows[this.FMouseDownRow].Height,this.FRows[this.FMouseDownRow].Height+e.y),e.y=this.FRows[this.FMouseDownRow].Height+e.y,this.FRows[this.FMouseDownRow].Height=e.y,this.FRows[this.FMouseDownRow].AutoHeight=e.y!=this.FRows[this.FMouseDownRow].Height)),this.FormatDirty(),this.Resizing=!1,lp.GCursor=oe,this.OwnerData.Style.UpdateInfoRePaint(),this.OwnerData.Style.UpdateInfoReCaret(),!0):(this.FSelecting||this.OwnerData.Style.UpdateInfo.Selecting?(this.FSelecting=!1,this.FMouseDownRow>=0&&!this.FOutSelectInto&&(e=this.GetCellPostion(this.FMouseDownRow,this.FMouseDownCol),(r=new ei).assign(t),r.x-=e.x,r.y-=e.y,this.FRows[this.FMouseDownRow][this.FMouseDownCol].MouseUp(r,this.FCellHPaddingPix,this.FCellVPaddingPix)),n=(o=this.GetCellAt(t.x,t.y,s,a)).resizeInfo,s=o.row,a=o.col,n.TableSite==Ch&&(s==this.FMouseDownRow&&a==this.FMouseDownCol||(e=this.GetCellPostion(s,a),(r=new ei).assign(t),r.x-=e.x,r.y-=e.y,this.FRows[s][a].MouseUp(r,this.FCellHPaddingPix,this.FCellVPaddingPix)))):this.FDraging||this.OwnerData.Style.UpdateInfo.DragingSelected?(this.FDraging=!1,n=(o=this.GetCellAt(t.x,t.y,s,a)).resizeInfo,s=o.row,a=o.col,n.TableSite==Ch&&(this.DisSelect(),this.FMouseMoveRow=s,this.FMouseMoveCol=a,this.FSelectCellRang.StartRow=s,this.FSelectCellRang.StartCol=a,e=this.GetCellPostion(s,a),(r=new ei).assign(t),r.x-=e.x,r.y-=e.y,this.FRows[s][a].MouseUp(r,this.FCellHPaddingPix,this.FCellVPaddingPix))):this.FMouseDownRow>=0&&(e=this.GetCellPostion(this.FMouseDownRow,this.FMouseDownCol),(r=new ei).assign(t),r.x-=e.x,r.y-=e.y,this.FRows[this.FMouseDownRow][this.FMouseDownCol].MouseUp(r,this.FCellHPaddingPix,this.FCellVPaddingPix)),!0)}},{key:"MouseLeave",value:function(){jh(Zh(i.prototype),"MouseLeave",this).call(this),this.FMouseMoveRow<0||this.FMouseMoveCol<0||(null!=this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData&&this.FRows[this.FMouseMoveRow][this.FMouseMoveCol].CellData.MouseLeave(),this.SelectExists()||this.InitializeMouseInfo())}},{key:"ClearFormatExtraHeight",value:function(){if(this.Height==this.FFormatHeight)return 0;for(var t,e=this.Height,i=-1,n=0,o=this.FRows.count-1;o>=0;o--){0!=this.FRows[o].FmtOffset&&(i=o,this.FRows[o].FmtOffset=0);for(var r=0;r<this.ColCount;r++)(0!=(t=this.FRows[o][r]).ClearFormatExtraHeight()||null!=t.CellData&&t.Height!=this.FCellHPaddingPix+t.CellData.height+this.FCellHPaddingPix)&&(i=o,this.CalcRowCellHeight(o))}return i>=0&&(this.CalcMergeRowHeightFrom(i),this.Height=this.GetFormatHeight(),n=e-this.Height),n}},{key:"DeleteSelected",value:function(){var t=this,e=jh(Zh(i.prototype),"DeleteSelected",this).call(this);if(this.FSelectCellRang.StartRow>=0)if(this.FSelectCellRang.EndRow>=0){this.FMulCellUndo.Enable=!0;try{var n=this.GetSelfUndoList();n.UndoGroupBegin(0,0);try{for(var o=this.FSelectCellRang.StartRow;o<=this.FSelectCellRang.EndRow;o++)for(var r=this.FSelectCellRang.StartCol;r<=this.FSelectCellRang.EndCol;r++)null!=this.FRows[o][r].CellData&&(this.FMulCellUndo.Init(o,r),this.FRows[o][r].CellData.DeleteSelected())}finally{n.UndoGroupEnd(0,0)}}finally{this.FMulCellUndo.Enable=!1}this.FormatDirty(),e=!0}else{this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){e=t.FRows[t.FSelectCellRang.StartRow][t.FSelectCellRang.StartCol].CellData.DeleteSelected()}))}return e}},{key:"DisSelect",value:function(){jh(Zh(i.prototype),"DisSelect",this).call(this),this.DisSelectSelectedCell(),this.InitializeMouseInfo(),this.FSelectCellRang.Initialize(),this.FSelecting=!1,this.FDraging=!1,this.FOutSelectInto=!1}},{key:"MarkStyleUsed",value:function(t){jh(Zh(i.prototype),"MarkStyleUsed",this).call(this,t);for(var e=0;e<=this.FRows.count-1;e++)for(var n=0;n<this.FRows[e].ColCount;n++)null!=this.FRows[e][n].CellData&&this.FRows[e][n].CellData.MarkStyleUsed(t)}},{key:"GetCaretInfo",value:function(t){var e=-1,i=-1;this.OwnerData.Style.UpdateInfo.DragingSelected?(e=this.FMouseMoveRow,i=this.FMouseMoveCol):(e=this.FSelectCellRang.StartRow,i=this.FSelectCellRang.StartCol);var n=null,o=-1,r=-1;if(e<0){e=this.FOutsideInfo.Row>=0?this.FOutsideInfo.Row:this.FRows.count-1,this.FOutsideInfo.Leftside&&(t.X=t.X-2),o=0;for(var s=this.FPageBreaks.count-1;s>=0;s--)if(this.FPageBreaks[s].Row<=e&&this.FPageBreaks[s].PageIndex==t.PageIndex-1){o=this.FPageBreaks[s].BreakBottom;break}r=this.Height;for(var a=0;a<=this.FPageBreaks.count-1;a++)if(this.FPageBreaks[a].Row>=e&&this.FPageBreaks[a].PageIndex==t.PageIndex){r=this.FPageBreaks[a].BreakSeat;break}return t.Y=t.Y+o,void(t.Height=r-o)}if(n=this.FRows[e][i],this.OwnerData.Style.UpdateInfo.DragingSelected){if(n.CellData.MouseMoveItemNo<0||n.CellData.MouseMoveItemOffset<0)return void(t.Visible=!1);n.GetCaretInfo(n.CellData.MouseMoveItemNo,n.CellData.MouseMoveItemOffset,this.FCellHPaddingPix,this.FCellVPaddingPix,t)}else{if(n.CellData.SelectInfo.StartItemNo<0||n.CellData.SelectInfo.StartItemOffset<0)return void(t.Visible=!1);n.GetCaretInfo(n.CellData.SelectInfo.StartItemNo,n.CellData.SelectInfo.StartItemOffset,this.FCellHPaddingPix,this.FCellVPaddingPix,t)}var l=this.GetCellPostion(e,i);t.X=l.x+t.X,t.Y=l.y+t.Y}},{key:"SetActive",value:function(t){if(this.Active!=t){var e=this.GetEditCell();null!=e&&(e.Active=t),t||(this.DoSelectCellChange(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,-1,-1),this.InitializeMouseInfo()),jh(Zh(i.prototype),"SetActive",this).call(this,t)}}},{key:"DoSelfUndoNew",value:function(){if(this.FMulCellUndo.Enable){var t=new Ca,e=new na;return e.Row=this.FMulCellUndo.Row,e.Col=this.FMulCellUndo.Col,t.Data=e,t}if(this.FSelectCellRang.EditCell()){var n=new Ca,o=new ia;return o.Row=this.FSelectCellRang.StartRow,o.Col=this.FSelectCellRang.StartCol,n.Data=o,n}return jh(Zh(i.prototype),"DoSelfUndoNew",this).call(this)}},{key:"DoSelfUndoDestroy",value:function(t){t.Data.isClass(ia)&&(t.Data.dispose(),t.Data=null),jh(Zh(i.prototype),"DoSelfUndoDestroy",this).call(this,t)}},{key:"DoSelfUndo",value:function(t){var e=this;if(this.InitializeMouseInfo(),this.FSelectCellRang.Initialize(),t.Data)if(t.Data.isClass(na)){var n=t.Data;this.FRows[n.Row][n.Col].CellData.Undo(t),this.FormatDirty()}else if(t.Data.isClass(ia)){var o=t.Data;this.FSelectCellRang.StartRow=o.Row,this.FSelectCellRang.StartCol=o.Col;this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){e.FRows[o.Row][o.Col].CellData.Undo(t)}))}else if(t.Data.isClass(oa)){var r=t.Data;this.FResizeKeepWidth&&r.Col<this.FColWidths.count-1&&(this.FColWidths[r.Col+1]=this.FColWidths[r.Col+1]+r.NewWidth-r.OldWidth),this.FColWidths[r.Col]=r.OldWidth,this.FormatDirty()}else if(t.Data.isClass(ra)){var s=t.Data;this.FRows[s.Row].Height=s.OldHeight,this.FormatDirty()}else if(t.Data.isClass(ta)){var a=new K;try{this.SaveToStream(a);var l=t.Data;l.Stream.position=0,l.Stream.readInt32(),this.LoadFromStream(l.Stream,this.OwnerData.Style,lp.HC_FileVersionInt),l.Stream.clear(0),l.Stream.copyFrom(a,0),this.FormatDirty()}finally{a=null}}else jh(Zh(i.prototype),"DoSelfUndo",this).call(this,t);else jh(Zh(i.prototype),"DoSelfUndo",this).call(this,t)}},{key:"DoSelfRedo",value:function(t){var e=this;if(this.InitializeMouseInfo(),this.FSelectCellRang.Initialize(),t.Data)if(t.Data.isClass(na)){var n=t.Data;this.FRows[n.Row][n.Col].CellData.Redo(t),this.FormatDirty()}else if(t.Data.isClass(ia)){var o=t.Data;this.FSelectCellRang.StartRow=o.Row,this.FSelectCellRang.StartCol=o.Col;this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){e.FRows[o.Row][o.Col].CellData.Redo(t)}))}else if(t.Data.isClass(oa)){var r=t.Data;this.FResizeKeepWidth&&r.Col<this.FColWidths.count-1&&(this.FColWidths[r.Col+1]=this.FColWidths[r.Col+1]-r.NewWidth-r.OldWidth),this.FColWidths[r.Col]=r.NewWidth,this.FormatDirty()}else if(t.Data.isClass(ra)){var s=t.Data;this.FRows[s.Row].Height=s.NewHeight,this.FormatDirty()}else if(t.Data.isClass(ta)){var a=new K;try{this.SaveToStream(a);var l=t.Data;l.Stream.position=0,l.Stream.readInt32(),this.LoadFromStream(l.Stream,this.OwnerData.Style,lp.HC_FileVersionInt),l.Stream.clear(0),l.Stream.copyFrom(a,0),this.FormatDirty()}finally{a=null}}else jh(Zh(i.prototype),"DoSelfRedo",this).call(this,t);else jh(Zh(i.prototype),"DoSelfRedo",this).call(this,t)}},{key:"Undo_ColResize",value:function(t,e,i){var n=this.GetSelfUndoList();if(null!=n&&n.Enable){this.SelfUndo_New();var o=n.last;if(null!=o){var r=new oa;r.Col=t,r.OldWidth=e,r.NewWidth=i,o.Data=r}}}},{key:"Undo_RowResize",value:function(t,e,i){var n=this.GetSelfUndoList();if(null!=n&&n.Enable){this.SelfUndo_New();var o=n.last;if(null!=n){var r=new ra;r.Row=t,r.OldHeight=e,r.NewHeight=i,o.Data=r}}}},{key:"Undo_Mirror",value:function(){var t=this.GetSelfUndoList();if(null!=t&&t.Enable){this.SelfUndo_New();var e=t.last;if(null!=e){var i=new ta;this.SaveToStream(i.Stream),e.Data=i}}}},{key:"GetRowCount",value:function(){return this.FRows.count}},{key:"GetColCount",value:function(){return this.FColWidths.count}},{key:"CheckFixColSafe",value:function(t){this.FFixCol+this.FFixColCount-1>=t&&(this.FFixCol=-1,this.FFixColCount=0)}},{key:"CheckFixRowSafe",value:function(t){this.FFixRow+this.FFixRowCount-1>=t&&(this.FFixRow=-1,this.FFixRowCount=0)}},{key:"AdjustCellRange",value:function(t,e,i,n){for(var o,r=i,s=n,a=null,l=-1,h=-1,c=t;c<=i;c++)for(var u=e;u<=n;u++)((a=this.FRows[c][u]).RowSpan>0||a.ColSpan>0)&&(l=(o=this.GetDestCell(c,u)).row,h=o.col,r<(l+=(a=this.FRows[l][h]).RowSpan)&&(r=l),s<(h+=a.ColSpan)&&(s=h));return{row:r,col:s}}},{key:"DeleteEmptyRows",value:function(t,e){for(var i,n=e;n>=t;n--){i=!0;for(var o=0;o<this.FRows[n].ColCount;o++)if(null!=this.FRows[n][o].CellData){i=!1;break}if(i){for(var r=null,s=0;s<n;s++)for(var a=0;a<this.FRows[s].ColCount;a++)s+(r=this.FRows[s][a]).RowSpan>=n&&r.RowSpan--;for(var l=n+1;l<this.FRows.count;l++)for(var h=0;h<this.FRows[l].ColCount;h++)l+(r=this.FRows[l][h]).RowSpan<n&&r.RowSpan++;this.FRows.removeAt(n)}}}},{key:"DeleteEmptyCols",value:function(t,e){for(var i=!1,n=e;n>=t;n--){i=!0;for(var o=0;o<this.RowCount;o++)if(null!=this.FRows[o][n].CellData){i=!1;break}if(i){for(var r=null,s=this.RowCount-1;s>=0;s--){for(var a=0;a<n;a++)a+(r=this.FRows[s][a]).ColSpan>=n&&(r.ColSpan=r.ColSpan-1);for(var l=n;l<this.FRows[s].ColCount;l++)l+(r=this.FRows[s][l]).ColSpan<n&&(r.ColSpan=r.ColSpan+1);this.FRows[s].removeAt(n)}this.FColWidths[n-1]+=this.FBorderWidthPix+this.FColWidths[n],this.FColWidths.removeAt(n),this.DoColCountChange()}}}},{key:"MergeCells",value:function(t,e,i,n){var o=!1,r=i,s=n,a=this.AdjustCellRange(t,e,r,s);if(r=a.row,s=a.col,!(o=this.CellsCanMerge(t,e,r,s)))return o;if(t==r){for(var l=e+1;l<=s;l++)null!=this.FRows[t][l].CellData&&(this.FRows[t][e].CellData.AddData(this.FRows[t][l].CellData),this.FRows[t][l].CellData.dispose(),this.FRows[t][l].CellData=null),this.FRows[t][l].ColSpan=e-l;this.FRows[t][e].ColSpan=s-e,this.DeleteEmptyCols(e+1,s),o=!0}else if(e==s){for(var h=t+1;h<=r;h++)null!=this.FRows[h][e].CellData&&(this.FRows[t][e].CellData.AddData(this.FRows[h][e].CellData),this.FRows[h][e].CellData.dispose(),this.FRows[h][e].CellData=null),this.FRows[h][e].RowSpan=t-h;this.FRows[t][e].RowSpan=r-t,this.DeleteEmptyRows(t+1,r),o=!0}else{for(var c=e+1;c<=s;c++)null!=this.FRows[t][c].CellData&&(this.FRows[t][e].CellData.AddData(this.FRows[t][c].CellData),this.FRows[t][c].CellData.dispose(),this.FRows[t][c].CellData=null),this.FRows[t][c].RowSpan=0,this.FRows[t][c].ColSpan=e-c;for(var u=t+1;u<=r;u++)for(var f=e;f<=s;f++)null!=this.FRows[u][f].CellData&&(this.FRows[t][e].CellData.AddData(this.FRows[u][f].CellData),this.FRows[u][f].CellData.dispose(),this.FRows[u][f].CellData=null),this.FRows[u][f].ColSpan=e-f,this.FRows[u][f].RowSpan=t-u;this.FRows[t][e].RowSpan=r-t,this.FRows[t][e].ColSpan=s-e,this.DeleteEmptyRows(t+1,r),this.DeleteEmptyCols(e+1,s),o=!0}return o}},{key:"GetCells",value:function(t,e){return this.FRows[t][e]}},{key:"GetColWidth",value:function(t){return this.FColWidths[t]}},{key:"InsertCol",value:function(t,e){this.Undo_Mirror();for(var i,n,o=-1,r=-1,s=lp.MinColWidth-this.FBorderWidthPix,a=0;a<e;a++){for(var l=0;l<this.RowCount;l++){if((i=this.FRows[l].CreateCell(this.OwnerData.Style)).Width=s,i.Height=this.FRows[l].Height,this.InitializeCellData(i.CellData),t<this.FColWidths.count&&this.FRows[l][t].ColSpan<0){o=(n=this.GetDestCell(l,t)).row,r=n.col,i.CellData.dispose(),i.CellData=null,i.RowSpan=this.FRows[l][t].RowSpan,i.ColSpan=this.FRows[l][t].ColSpan;for(var h=t;h<=r+this.FRows[o][r].ColSpan;h++)this.FRows[l][h].ColSpan=this.FRows[l][h].ColSpan-1;l==o+this.FRows[o][r].RowSpan&&this.FRows[o][r].ColSpan++}this.FRows[l].insert(t,i)}this.FColWidths.insert(t,s)}return this.DoColCountChange(),this.InitializeMouseInfo(),this.FSelectCellRang.Initialize(),this.FormatDirty(),!0}},{key:"InsertRow",value:function(t,e){this.Undo_Mirror();for(var i,n,o=-1,r=-1,s=0;s<e;s++){i=this.DoCreateRow(this.OwnerData.Style,this.FColWidths.count);for(var a=0;a<=this.FColWidths.count-1;a++)if(i[a].Width=this.FColWidths[a],i.Height=this.FDefaultRowHeight,t<this.FRows.count&&this.FRows[t][a].RowSpan<0){o=(n=this.GetDestCell(t,a)).row,r=n.col,i[a].CellData.dispose(),i[a].CellData=null,i[a].RowSpan=this.FRows[t][a].RowSpan,i[a].ColSpan=this.FRows[t][a].ColSpan;for(var l=t;l<=o+this.FRows[o][r].RowSpan;l++)this.FRows[l][a].RowSpan--;a==r+this.FRows[o][r].ColSpan&&this.FRows[o][r].RowSpan++}this.FRows.insert(t,i)}return this.InitializeMouseInfo(),this.FSelectCellRang.Initialize(),this.FormatDirty(),!0}},{key:"DeleteCol",value:function(t){if(!this.ColCanDelete(t))return!1;this.Undo_Mirror();for(var e,i=-1,n=-1,o=0;o<this.RowCount;o++){if(this.FRows[o][t].ColSpan<0){i=(e=this.GetDestCell(o,t)).row,n=e.col;for(var r=t;r<=n+this.FRows[i][n].ColSpan;r++)this.FRows[o][r].ColSpan++;o==i+this.FRows[i][n].RowSpan&&this.FRows[i][n].ColSpan--}else this.FRows[o][t].ColSpan;this.FRows[o].removeAt(t)}return this.FColWidths.removeAt(t),this.DoColCountChange(),this.DeleteEmptyRows(0,this.RowCount-1),this.CheckFixColSafe(t),this.InitializeMouseInfo(),this.FSelectCellRang.Initialize(),this.FormatDirty(),!0}},{key:"DeleteRow",value:function(t){return this.DeleteRowFrom(t,t)}},{key:"DeleteRowFrom",value:function(t,e){if(1==this.FRows.count)return!1;if(t<0||e>this.FRows.count-1)return!1;var i,n=-1,o=-1;this.Undo_Mirror();for(var r=e;r>=t;r--){if(!this.RowCanDelete(r))return!1;for(var s=0;s<this.FColWidths.count;s++)if(this.FRows[r][s].RowSpan<0){n=(i=this.GetDestCell(r,s)).row,o=i.col;for(var a=r;a<=n+this.FRows[n][o].RowSpan;a++)this.FRows[a][s].RowSpan++;s==o+this.FRows[n][o].ColSpan&&this.FRows[n][o].RowSpan--}else this.FRows[r][s].ColSpan;this.FRows.removeAt(r)}return this.DeleteEmptyCols(0,this.ColCount-1),this.CheckFixRowSafe(t),this.InitializeMouseInfo(),this.FSelectCellRang.Initialize(),this.FormatDirty(),!0}},{key:"dispose",value:function(){this.FSelectCellRang.dispose(),this.FRows.clear(),jh(Zh(i.prototype),"dispose",this).call(this)}},{key:"Assign",value:function(t){jh(Zh(i.prototype),"Assign",this).call(this,t);var e=t;this.FBorderVisible=e.BorderVisible,this.BorderWidthPt=e.BorderWidthPt,this.CellHPaddingMM=e.CellHPaddingMM,this.CellVPaddingMM=e.CellVPaddingMM,this.FFixRow=e.FixRow,this.FFixRowCount=e.FixRowCount,this.FFixCol=e.FixCol,this.FFixColCount=e.FixColCount;for(var n=0;n<this.ColCount;n++)this.FColWidths[n]=e.FColWidths[n];for(var o=0;o<this.RowCount;o++){this.FRows[o].AutoHeight=e.Rows[o].AutoHeight,this.FRows[o].Height=e.Rows[o].Height;for(var r=0;r<=this.ColCount-1;r++)this.FRows[o][r].Width=this.FColWidths[r],this.FRows[o][r].RowSpan=e[r].RowSpan,this.FRows[o][r].ColSpan=e[r].ColSpan,this.FRows[o][r].BackgroundColor=e[r].BackgroundColor,this.FRows[o][r].AlignVert=e[r].AlignVert,this.FRows[o][r].BorderSides=e[r].BorderSides,null!=e[o][r].CellData?this.FRows[o][r].CellData.AddData(e[r].CellData):(this.FRows[o][r].CellData.dispose(),this.FRows[o][r].CellData=null)}}},{key:"DblClick",value:function(t,e){if(this.FSelectCellRang.EditCell()){var n=this.GetCellPostion(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol),o=this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol];o.CellData.DblClick(t-n.x-this.FCellHPaddingPix,e-n.y-o.GetCellDataTop(this.FCellVPaddingPix))}else jh(Zh(i.prototype),"DblClick",this).call(this,t,e)}},{key:"CoordInSelect",value:function(t,e){var n=jh(Zh(i.prototype),"CoordInSelect",this).call(this,t,e);if(n){var o=-1,r=-1,s=this.GetCellAt(t,e,o,r),a=s.resizeInfo;if(o=s.row,r=s.col,(n=a.TableSite==Ch)&&this.FSelectCellRang.StartRow>=0)if(this.FSelectCellRang.EndRow>=0)n=o>=this.FSelectCellRang.StartRow&&o<=this.FSelectCellRang.EndRow&&r>=this.FSelectCellRang.StartCol&&r<=this.FSelectCellRang.EndCol;else{var l=this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol];if(l.CellData.SelectExists()){var h=this.GetCellPostion(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol),c=t-h.x-this.FCellHPaddingPix,u=e-h.y-l.GetCellDataTop(this.FCellVPaddingPix),f=-1,d=-1,m=-1,y=!1;f=(s=l.CellData.GetItemAt(c,u,f,d,m,y)).itemNo,d=s.offset,m=s.drawItemNo,y=s.restrain,n=l.CellData.CoordInSelect(c,u,f,d,y)}}}return n}},{key:"GetTopLevelDataAt",value:function(t,e){var i=null,n=-1,o=-1,r=this.GetCellAt(t,e,n,o);if(n=r.row,o=r.col,n<0||o<0)return i;var s=this.GetCellPostion(n,o);return i=this.FRows[n][o].CellData.GetTopLevelDataAt(t-s.x-this.FCellHPaddingPix,e-s.y-this.FCellVPaddingPix)}},{key:"GetTopLevelData",value:function(){var t=this.GetEditCell();return null!=t?t.CellData.GetTopLevelData():jh(Zh(i.prototype),"GetTopLevelData",this).call(this)}},{key:"GetActiveData",value:function(){var t=this.GetEditCell();return null!=t?t.CellData.GetTopLevelData():jh(Zh(i.prototype),"GetActiveData",this).call(this)}},{key:"GetActiveItem",value:function(){var t=this.GetEditCell();return null!=t?t.CellData.GetActiveItem():jh(Zh(i.prototype),"GetActiveItem",this).call(this)}},{key:"GetTopLevelItem",value:function(){var t=this.GetEditCell();return null!=t?t.CellData.GetTopLevelItem():jh(Zh(i.prototype),"GetTopLevelItem",this).call(this)}},{key:"GetTopLevelDrawItem",value:function(){var t=this.GetActiveData();return null!=t?t.GetTopLevelDrawItem():jh(Zh(i.prototype),"GetTopLevelDrawItem",this).call(this)}},{key:"GetTopLevelDrawItemCoord",value:function(){var t=G.Create(0,0),e=this.GetEditCell();if(null!=e){t=e.CellData.GetTopLevelDrawItemCoord();var i=this.GetCellPostion(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol);t.x=t.x+i.x+this.FCellHPaddingPix,t.y=t.y+i.y+e.GetCellDataTop(this.FCellVPaddingPix)}return t}},{key:"GetTopLevelRectDrawItem",value:function(){var t=this.GetActiveData();return null!=t?t.GetTopLevelRectDrawItem():jh(Zh(i.prototype),"GetTopLevelRectDrawItem",this).call(this)}},{key:"GetTopLevelRectDrawItemCoord",value:function(){var t=G.Create(-1,-1),e=this.GetEditCell();if(null!=e){var i=e.CellData.GetTopLevelRectDrawItemCoord();i.x>=0&&((t=this.GetCellPostion(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol)).x=t.x+i.x+this.FCellHPaddingPix,t.y=t.y+i.y+e.GetCellDataTop(this.FCellVPaddingPix))}return t}},{key:"GetHint",value:function(){var t=jh(Zh(i.prototype),"GetHint",this).call(this);if(this.FMouseMoveRow<0||this.FMouseMoveCol<0)return t;var e=this.FRows[this.FMouseMoveRow][this.FMouseMoveCol];return null!=e&&null!=e.CellData&&(t=e.CellData.GetHint()),t}},{key:"InsertText",value:function(t){var e=this,n=!1;if(this.FSelectCellRang.EditCell()){return this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){var i=e.FRows[e.FSelectCellRang.StartRow][e.FSelectCellRang.StartCol];n=i.CellData.InsertText(t)})),n}return jh(Zh(i.prototype),"InsertText",this).call(this,t)}},{key:"InsertItem",value:function(t){var e=this.GetEditCell();if(null==e)return!1;var i=!1;return this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){i=e.CellData.InsertItem(t)})),i}},{key:"InsertStream",value:function(t,e,n){var o=this,r=!1;if(this.FSelectCellRang.EditCell()){return this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){var i=o.FRows[o.FSelectCellRang.StartRow][o.FSelectCellRang.StartCol];r=i.CellData.InsertStream(t,e,n)})),r}return jh(Zh(i.prototype),"InsertStream",this).call(this,t,e,n)}},{key:"ReFormatActiveItem",value:function(){var t=this;if(this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){t.FRows[t.FSelectCellRang.StartRow][t.FSelectCellRang.StartCol].CellData.ReFormatActiveItem()}))}this.FormatDirty()}},{key:"ReFormatRequest",value:function(){this.FormatDirty(),this.OwnerData.ItemReFormatRequest(this)}},{key:"ActiveItemReAdaptEnvironment",value:function(){var t=this;if(this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){t.FRows[t.FSelectCellRang.StartRow][t.FSelectCellRang.StartCol].CellData.ActiveItemReAdaptEnvironment()}))}}},{key:"DeleteActiveDomain",value:function(){var t=this,e=jh(Zh(i.prototype),"DeleteActiveDomain",this).call(this);if(this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){var i=t.FRows[t.FSelectCellRang.StartRow][t.FSelectCellRang.StartCol];e=i.CellData.DeleteActiveDomain()}))}return e}},{key:"InsertAnnotate",value:function(t,e){var i=this.GetEditCell();if(null==i)return!1;var n=!1;return this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){n=i.CellData.InsertAnnotate(t,e)})),n}},{key:"DeleteActiveAnnotate",value:function(){var t=this,e=jh(Zh(i.prototype),"DeleteActiveAnnotate",this).call(this);if(this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){var i=t.FRows[t.FSelectCellRang.StartRow][t.FSelectCellRang.StartCol];e=i.CellData.DeleteActiveAnnotate()}))}return e}},{key:"DeleteActiveDataItems",value:function(t,e,i){var n=this;if(this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){n.FRows[n.FSelectCellRang.StartRow][n.FSelectCellRang.StartCol].CellData.DeleteActiveDataItems(t,e,i)}))}}},{key:"SetActiveItemText",value:function(t){var e=this;if(jh(Zh(i.prototype),"SetActiveItemText",this).call(this,t),this.FSelectCellRang.EditCell()){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){e.FRows[e.FSelectCellRang.StartRow][e.FSelectCellRang.StartCol].CellData.SetActiveItemText(t)}))}}},{key:"DoCrossCellKey",value:function(t,e){var i=!1,n=-1,o=-1,r=this.FSelectCellRang.StartRow,s=this.FSelectCellRang.StartCol;if(t==Be){if(e.CellData.SelectFirstItemOffsetBefor()){for(var a=this.FSelectCellRang.StartCol-1;a>=0;a--)if(this.FRows[this.FSelectCellRang.StartRow][a].ColSpan>=0){this.FRows[this.FSelectCellRang.StartRow][a].RowSpan<0&&(this.FSelectCellRang.StartRow+=this.FRows[this.FSelectCellRang.StartRow][a].RowSpan),o=a;break}o>=0&&(r>=0&&s>=0&&(this.FRows[r][s].Active=!1),this.FSelectCellRang.StartCol=o,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectLastItemAfterWithCaret(),i=!0)}}else if(t==Me){if(e.CellData.SelectLastItemOffsetAfter()){for(var l=this.FSelectCellRang.StartCol+1;l<this.FColWidths.count;l++)if(this.FRows[this.FSelectCellRang.StartRow][l].ColSpan>=0){this.FRows[this.FSelectCellRang.StartRow][l].RowSpan<0&&(this.FSelectCellRang.StartRow+=this.FRows[this.FSelectCellRang.StartRow][l].RowSpan),o=l;break}o>=0&&(r>=0&&s>=0&&(this.FRows[r][s].Active=!1),this.FSelectCellRang.StartCol=o,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectFirstItemBeforWithCaret(),i=!0)}}else if(t==Ee){if(e.CellData.SelectFirstLine()&&this.FSelectCellRang.StartRow>0){var h=this.GetDestCell(this.FSelectCellRang.StartRow-1,this.FSelectCellRang.StartCol);n=h.row,o=h.col,n>=0&&o>=0&&(r>=0&&s>=0&&(this.FRows[r][s].Active=!1),this.FSelectCellRang.StartRow=n,this.FSelectCellRang.StartCol=o,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectLastItemAfterWithCaret(),i=!0)}}else if(t==Le&&e.CellData.SelectLastLine()&&this.FSelectCellRang.StartRow<this.RowCount-1){var c=this.GetDestCell(this.FSelectCellRang.StartRow+1,this.FSelectCellRang.StartCol);n=c.row,o=c.col,n>=0&&o>=0&&(r>=0&&s>=0&&(this.FRows[r][s].Active=!1),this.FSelectCellRang.StartRow=n,this.FSelectCellRang.StartCol=o,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectFirstItemBeforWithCaret(),i=!0)}return i}},{key:"KeyDown",value:function(t){var e=this.GetEditCell();if(null!=e){var i=t.keyCode;switch(t.keyCode){case Pe:case Ge:case be:case De:this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){e.CellData.KeyDown(t)}));break;case Be:case Me:case Ee:case Le:case Ne:case Oe:e.CellData.KeyDown(t),t.Handled&&lp.IsDirectionKey(t.keyCode)&&this.DoCrossCellKey(t.keyCode,e)&&(this.OwnerData.Style.UpdateInfoReCaret(),t.keyCode=i);break;default:e.CellData.KeyDown(t)}null!=this.OnKeyDown&&this.OnKeyDown(t)}else t.Handled=!0}},{key:"KeyPress",value:function(t){var e=this.GetEditCell();if(null!=e){this.CellChangeByAction(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,(function(){e.CellData.KeyPress(t)}))}}},{key:"GetText",value:function(){for(var t=jh(Zh(i.prototype),"GetText",this).call(this),e=0;e<=this.FRows.count-1;e++)for(var n=0;n<this.FRows[e].ColCount;n++)null!=this.FRows[e][n].CellData&&(t+=""!=t?","+this.FRows[e][n].CellData.SaveToText():this.FRows[e][n].CellData.SaveToText());return t}},{key:"GetPageBreakCount",value:function(){return this.FPageBreaks.count}},{key:"IsSelectComplateTheory",value:function(){return this.IsSelectComplate}},{key:"SelectExists",value:function(){var t=!1;return this.IsSelectComplate?t=!0:this.FSelectCellRang.StartRow>=0&&(t=this.FSelectCellRang.EndRow>=0||this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.SelectExists()),t}},{key:"GetOffsetAt",value:function(t){return t<=0?lp.OffsetBefor:t>=this.Width?lp.OffsetAfter:lp.OffsetInner}},{key:"TraverseItem",value:function(t){for(var e=0;e<this.FRows.count&&!t.Stop;e++)for(var i=0;i<this.FColWidths.count&&!t.Stop;i++)null!=this.FRows[e][i].CellData&&this.FRows[e][i].CellData.TraverseItem(t)}},{key:"Search",value:function(t,e,i){var n=!1,o=-1,r=-1,s=null;if(e){if(this.FSelectCellRang.StartRow<0&&(this.FSelectCellRang.StartRow=this.FRows.count-1,this.FSelectCellRang.StartCol=this.FColWidths.count-1,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,o=this.FSelectCellRang.StartRow,r=this.FSelectCellRang.StartCol,null!=this.FRows[o][r].CellData&&((s=this.FRows[o][r].CellData).SelectInfo.StartItemNo=s.Items.count-1,s.SelectInfo.StartItemOffset=s.GetItemOffsetAfter(s.Items.count-1))),o=this.FSelectCellRang.StartRow,r=this.FSelectCellRang.StartCol,o>=0&&r>=0){if(null!=this.FRows[o][r].CellData&&(n=this.FRows[o][r].CellData.Search(t,e,i)),!n)for(var a=r-1;a>=0&&(this.FRows[o][a].ColSpan<0||this.FRows[o][a].RowSpan<0||(this.FSelectCellRang.StartRow>=0&&this.FSelectCellRang.StartCol>=0&&(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1),this.FSelectCellRang.StartCol=a,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,(s=this.FRows[o][a].CellData).SelectInfo.StartItemNo=s.Items.count-1,s.SelectInfo.StartItemOffset=s.GetItemOffsetAfter(s.Items.count-1),!(n=this.FRows[o][a].CellData.Search(t,e,i))));a--);if(!n)for(var l=this.FSelectCellRang.StartRow-1;l>=0;l--){for(var h=this.FColWidths.count-1;h>=0&&(this.FRows[l][h].ColSpan<0||this.FRows[l][h].RowSpan<0||(this.FSelectCellRang.StartRow>=0&&this.FSelectCellRang.StartCol>=0&&(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1),this.FSelectCellRang.StartRow=l,this.FSelectCellRang.StartCol=h,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,(s=this.FRows[l][h].CellData).SelectInfo.StartItemNo=s.Items.count-1,s.SelectInfo.StartItemOffset=s.GetItemOffsetAfter(s.Items.count-1),!(n=this.FRows[l][h].CellData.Search(t,e,i))));h--);if(n)break}}}else if(this.FSelectCellRang.StartRow<0&&(this.FSelectCellRang.StartRow=0,this.FSelectCellRang.StartCol=0,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[0][0].CellData.SelectInfo.StartItemNo=0,this.FRows[0][0].CellData.SelectInfo.StartItemOffset=0),o=this.FSelectCellRang.StartRow,r=this.FSelectCellRang.StartCol,o>=0&&r>=0){if(!(n=this.FRows[o][r].CellData.Search(t,e,i)))for(var c=r+1;c<this.FColWidths.count&&(this.FRows[o][c].ColSpan<0||this.FRows[o][c].RowSpan<0||(this.FSelectCellRang.StartRow>=0&&this.FSelectCellRang.StartCol>=0&&(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1),this.FSelectCellRang.StartCol=c,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[o][c].CellData.SelectInfo.StartItemNo=0,this.FRows[o][c].CellData.SelectInfo.StartItemOffset=0,!(n=this.FRows[o][c].CellData.Search(t,e,i))));c++);if(!n)for(var u=this.FSelectCellRang.StartRow+1;u<this.FRows.count;u++){for(var f=0;f<this.FColWidths.count&&(this.FRows[u][f].ColSpan<0||this.FRows[u][f].RowSpan<0||(this.FSelectCellRang.StartRow>=0&&this.FSelectCellRang.StartCol>=0&&(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1),this.FSelectCellRang.StartRow=u,this.FSelectCellRang.StartCol=f,this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!0,this.FRows[u][f].CellData.SelectInfo.StartItemNo=0,this.FRows[u][f].CellData.SelectInfo.StartItemOffset=0,!(n=this.FRows[u][f].CellData.Search(t,e,i))));f++);if(n)break}}return n||(this.FSelectCellRang.StartRow>=0&&this.FSelectCellRang.StartCol>=0&&(this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].Active=!1),this.FSelectCellRang.Initialize()),n}},{key:"CheckFormatPageBreakBefor",value:function(){this.FPageBreaks.clear()}},{key:"ApplySelectTextStyle",value:function(t,e){var i=null;if(this.FSelectCellRang.EditCell())(i=this.GetEditCell().CellData).ApplySelectTextStyle(e),this.IsFormatDirty=i.FormatHeightChange||i.FormatDrawItemCountChange;else if(this.FSelectCellRang.StartRow>=0)for(var n=this.FSelectCellRang.StartRow;n<=this.FSelectCellRang.EndRow;n++)for(var o=this.FSelectCellRang.StartCol;o<=this.FSelectCellRang.EndCol;o++)if(null!=(i=this.FRows[n][o].CellData))if(this.IsFormatDirty){i.BeginFormat();try{i.ApplySelectTextStyle(e)}finally{i.EndFormat(!1)}}else i.ApplySelectTextStyle(e),this.IsFormatDirty=i.FormatHeightChange|i.FormatDrawItemCountChange}},{key:"ApplySelectParaStyle",value:function(t,e){if(jh(Zh(i.prototype),"ApplySelectParaStyle",this).call(this,t,e),this.FSelectCellRang.StartRow>=0){var n=null;if(this.FSelectCellRang.EndRow>=0){for(var o=this.FSelectCellRang.StartRow;o<=this.FSelectCellRang.EndRow;o++)for(var r=this.FSelectCellRang.StartCol;r<=this.FSelectCellRang.EndCol;r++)if(null!=(n=this.FRows[o][r].CellData))if(this.IsFormatDirty){n.BeginFormat();try{n.ApplySelectParaStyle(e)}finally{n.EndFormat(!1)}}else n.ApplySelectParaStyle(e),this.IsFormatDirty=n.FormatHeightChange||n.FormatDrawItemCountChange}else(n=this.GetEditCell().CellData).ApplySelectParaStyle(e),this.IsFormatDirty=n.FormatHeightChange||n.FormatDrawItemCountChange}else this.ParaNo=e.GetMatchParaNo(this.OwnerData.Style,this.ParaNo)}},{key:"ApplyCellAlign_",value:function(t,e){switch(e){case yp.TopLeft:case yp.TopCenter:case yp.TopRight:t.AlignVert=Ah;break;case yp.CenterLeft:case yp.CenterCenter:case yp.CenterRight:t.AlignVert=Th;break;default:t.AlignVert=Oh}var i=t.CellData;if(null!=i){i.BeginFormat();try{switch(e){case yp.TopLeft:case yp.CenterLeft:case yp.BottomLeft:i.ApplyParaAlignHorz(dr);break;case yp.TopCenter:case yp.CenterCenter:case yp.BottomCenter:i.ApplyParaAlignHorz(mr);break;default:i.ApplyParaAlignHorz(yr)}}finally{i.EndFormat(!0)}}}},{key:"ApplyContentAlign",value:function(t){if(jh(Zh(i.prototype),"ApplyContentAlign",this).call(this,t),this.FSelectCellRang.StartRow>=0)if(this.FSelectCellRang.EndRow>=0)for(var e=this.FSelectCellRang.StartRow;e<=this.FSelectCellRang.EndRow;e++)for(var n=this.FSelectCellRang.StartCol;n<=this.FSelectCellRang.EndCol;n++)this.ApplyCellAlign_(this.FRows[e][n],t);else this.ApplyCellAlign_(this.GetEditCell(),t);else for(var o=0;o<this.FRows.count;o++)for(var r=0;r<this.FColWidths.count;r++)this.ApplyCellAlign_(this.FRows[o][r],t)}},{key:"FormatToDrawItem",value:function(t,e){if(this.IsFormatDirty){this.DoFormatToDrawItem();for(var i=0;i<this.RowCount;i++)this.FormatRow(i),this.CalcRowCellHeight(i);this.CalcMergeRowHeightFrom(0),this.Height=this.GetFormatHeight(),this.Width=this.GetFormatWidth(),this.FSelectCellRang.SelectExists()&&this.MatchCellSelectState()}else this.ClearFormatExtraHeight()}},{key:"WantKeyDown",value:function(t){return!0}},{key:"AddPageBreak",value:function(t,e,i,n,o){var r=new Qh;r.PageIndex=i,r.Row=t,r.BreakSeat=e,r.BreakBottom=n-o,this.FPageBreaks.add(r)}},{key:"CheckFormatPageBreak",value:function(t,e,i,n,o,r,s,a,l){s=-1,a=0,l=0;for(var h=e+this.FBorderWidthPix-1,c=0;c<r;c++)h+=this.FRows[c].FmtOffset+this.FRows[c].Height+this.FBorderWidthPix;for(var u=r,f=0;u<this.RowCount;){if((f=h+this.FRows[u].FmtOffset+this.FRows[u].Height+this.FBorderWidthPix)>o){s=u;break}h=f,u++}if(s<0)return{breakSeat:s,fmtOffset:a,fmtHeightInc:l};if(!this.CanPageBreak&&0==s)return{breakSeat:s,fmtOffset:a=o-e,fmtHeightInc:l};for(var d,m,y=!0,p=!1,S=o,v=-1,F=-1,I=0,g=null,w=null,C=0;C<this.FRows[s].ColCount;C++)if(!(this.FRows[s][C].ColSpan<0)){v=(d=this.GetDestCell(s,C)).row,F=d.col,g=this.FRows[v][F].CellData,I=h+this.FCellVPaddingPix,s!=v&&(I-=this.SrcCellDataTopDistanceToDest(s,v)),m=this.FRows[v][F].GetCellDataTop(this.FCellVPaddingPix);for(var k=0;k<g.DrawItems.count;k++)if((w=g.DrawItems[k]).LineFirst&&I+m+w.rect.bottom+this.FBorderWidthPix>o){p=!0,0==k&&(y=!1,S=h);break}if(!y)break}y&&!p&&(y=!1);for(var P,D=0,b=0,R=0,_=0,x=new V,A=0;A<this.FRows[s].ColCount;A++)if(!(this.FRows[s][A].ColSpan<0)){v=(d=this.GetDestCell(s,A)).row,F=d.col,g=this.FRows[v][F].CellData,_=this.FRows[v][F].Height-(this.FCellVPaddingPix+g.height+this.FCellVPaddingPix),I=h+this.FCellVPaddingPix,s!=v&&(I-=this.SrcCellDataTopDistanceToDest(s,v)),(P=new tc).Col=A;for(var T=0;T<g.DrawItems.count;T++)if((w=g.DrawItems[T]).LineFirst&&I+w.rect.bottom+this.FCellVPaddingPix+this.FBorderWidthPix>S){D=(R=o-(I+w.rect.top)+this.FBorderWidthPix+this.FCellVPaddingPix-1)>_?R-_:0,P.DrawItemNo=T,P.VDrawOffset=R,T>0?I+g.DrawItems[T-1].rect.bottom+this.FCellVPaddingPix+this.FBorderWidthPix>b&&(b=I+g.DrawItems[T-1].rect.bottom+this.FCellVPaddingPix+this.FBorderWidthPix):I>b&&(b=I-this.FCellVPaddingPix);break}l<D&&(l=D),x.add(P)}b=b-e+1;var O=0;if(this.FFixRow>=0&&s>this.FFixRow+this.FFixRowCount-1&&(l+=O=this.GetFixRowHeight()),y)this.FRows[s].Height=this.FRows[s].Height+l;else{if(0==s)return{breakSeat:s,fmtOffset:a=o-e,fmtHeightInc:l=0};for(var N=0;N<x.count;N++)0==x[N].DrawItemNo&&(x[N].VDrawOffset>0?(this.FRows[s].FmtOffset=x[N].VDrawOffset+O,x[N].VDrawOffset=0):this.FRows[s].FmtOffset=O)}this.AddPageBreak(s,b,t,o,e);for(var B=0;B<x.count;B++)if(!(x[B].DrawItemNo<0||0==x[B].VDrawOffset)){v=(d=this.GetDestCell(s,x[B].Col)).row,F=d.col,g=this.FRows[v][F].CellData;for(var E=x[B].DrawItemNo;E<g.DrawItems.count;E++)g.DrawItems[E].rect.offset(0,x[B].VDrawOffset+O)}return this.CalcMergeRowHeightFrom(s),{breakSeat:s,fmtOffset:a,fmtHeightInc:l}}},{key:"SaveToStreamRange",value:function(t,e,n){jh(Zh(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FBorderVisible&&(o|=128),this.FResizeKeepWidth&&(o|=64),t.writeByte(o),t.writeSingle(this.FBorderWidthPt),t.writeSingle(this.FCellVPaddingMM),t.writeSingle(this.FCellHPaddingMM),t.writeInt32(this.FRows.count),t.writeInt32(this.FColWidths.count),t.writeByte(this.FFixRow),t.writeByte(this.FFixRowCount),t.writeByte(this.FFixCol),t.writeByte(this.FFixColCount);for(var r=0;r<=this.FColWidths.count-1;r++)t.writeInt32(this.FColWidths[r]);for(var s=0;s<=this.FRows.count-1;s++){t.writeBoolean(this.FRows[s].AutoHeight),this.FRows[s].AutoHeight||t.writeInt32(this.FRows[s].Height);for(var a=0;a<=this.FRows[s].ColCount-1;a++)this.FRows[s][a].SaveToStream(t);this.FRows[s].SaveToStream(t)}}},{key:"SaveSelectToStream",value:function(t){var e=this;if(this.IsSelectComplate)or.exception("保存选中内容出错,表格不应该由内部处理全选中的保存!");else if(this.FSelectCellRang.EditCell()){var i=this.GetActiveData();null!=i&&i.SaveSelectToStream(t)}else if(this.FSelectCellRang.SelectExists()){var n=new $y(this.OwnerData.Style);n.BeginFormat(),n.Items.clear(),n.OnSaveItem=function(t,i){return e.OwnerData.OnSaveItem(t,i)},n.OnCreateItemByStyle=function(t,i){return e.OwnerData.OnCreateItemByStyle(t,i)};for(var o=null,r=this.FSelectCellRang.StartRow;r<=this.FSelectCellRang.EndRow;r++)for(var s=this.FSelectCellRang.StartCol;s<=this.FSelectCellRang.EndCol;s++)null!=(o=this.FRows[r][s].CellData)&&n.AddData(o);n.SaveItemToStream(t,0,0,n.Items.count-1,n.Items.last.Length),n.dispose()}}},{key:"LoadFromStream",value:function(t,e,n){if(this.FRows.clear(),jh(Zh(i.prototype),"LoadFromStream",this).call(this,t,e,n),n>55){var o=t.readByte();this.FBorderVisible=or.system.isOdd(o>>7),this.FResizeKeepWidth=or.system.isOdd(o>>6)}else this.FBorderVisible=t.readBoolean();n>31?this.BorderWidthPt=t.readSingle():n>29&&(this.FBorderWidthPix=t.readByte(),this.FBorderWidthPt=Math.min(.5,sr.pixelToPt(this.FBorderWidthPix,sr.PixelsPerInchX))),n>34?(this.FCellVPaddingMM=t.readSingle(),this.FCellVPaddingPix=sr.millimeterToPixY(this.FCellVPaddingMM),this.FCellHPaddingMM=t.readSingle(),this.FCellHPaddingPix=sr.millimeterToPixY(this.FCellHPaddingMM)):(this.FCellVPaddingMM=sr.pixYToMillimeter(2),this.FCellVPaddingPix=2,this.FCellHPaddingMM=sr.pixXToMillimeter(2),this.FCellHPaddingPix=2);var r,s=t.readInt32(),a=t.readInt32();n>24&&(this.FFixRow=t.readInt8(),this.FFixRowCount=t.readByte(),this.FFixCol=t.readInt8(),this.FFixColCount=t.readByte());for(var l=0;l<s;l++)r=this.DoCreateRow(this.OwnerData.Style,a),this.FRows.add(r);this.FColWidths.clear();for(var h=lp.MinColWidth,c=0;c<a;c++)h=t.readInt32(),this.FColWidths.add(h);this.DoColCountChange();for(var u=!1,f=0;f<this.FRows.count;f++){u=t.readBoolean(),this.FRows[f].AutoHeight=u,this.FRows[f].AutoHeight||(this.FRows[f].Height=t.readInt32());for(var d=0;d<this.FRows[f].ColCount;d++)this.FRows[f][d].CellData.Width=this.FColWidths[d]-2*this.FCellHPaddingPix,this.FRows[f][d].LoadFromStream(t,e,n);this.FRows[f].LoadFromStream(t,n)}}},{key:"ToHtml",value:function(){for(var t,e='<table border="'+this.FBorderWidthPix.toString()+'" cellpadding="0"; cellspacing="0"',i=0;i<this.FRows.count;i++){e+=lp.sLineBreak+"<tr>";for(var n=0;n<this.FColWidths.count;n++)(t=this.FRows[i][n]).RowSpan<0||t.ColSpan<0||(e+=lp.sLineBreak+C.stringFormat('<td rowspan="{0}"; colspan="{1}"; width="{2}"; height="{3}">',t.RowSpan+1,t.ColSpan+1,t.Width,t.Height),null!=t.CellData&&(e+=t.CellData.ToHtml()),e+=lp.sLineBreak+"</td>");e+=lp.sLineBreak+"</tr>"}return e+=lp.sLineBreak+"</table>"}},{key:"ToXml",value:function(t){}},{key:"ParseXml",value:function(t){this.DoColCountChange()}},{key:"ResetRowCol",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.FFixRow=-1,this.FFixRowCount=0,this.FFixCol=-1,this.FFixColCount=0,this.FDefaultRowHeight=lp.MinRowHeight,this.InitializeMouseInfo(),this.FSelectCellRang.Initialize(),this.Width=t;var o=-1;lp.RESETTABLEUSEFIRSTROWHEIGHT&&this.FRows.count>0&&(o=this.FRows[0].Height),this.Height=e*(this.FDefaultRowHeight+this.FBorderWidthPix)+this.FBorderWidthPix;var r,s=t-(i+1)*this.FBorderWidthPix;this.FRows.clear();for(var a=0;a<e;a++)(r=this.DoCreateRow(this.OwnerData.Style,i)).SetRowWidth(s),0==a&&(n?o=r[0].CellData.height+this.FCellVPaddingPix+this.FCellVPaddingPix:o<0&&(o=this.FDefaultRowHeight)),lp.RESETTABLEUSEFIRSTROWHEIGHT&&(r.Height=o,o!=this.FDefaultRowHeight&&(r.AutoHeight=!1)),this.FRows.add(r);this.FColWidths.clear();for(var l=0;l<i;l++)this.FColWidths.add(this.FRows[0][l].Width);return this.DoColCountChange(),this.FormatDirty(),!0}},{key:"GetFormatWidth",value:function(){for(var t=this.FBorderWidthPix,e=0;e<this.FColWidths.count;e++)t=t+this.FColWidths[e]+this.FBorderWidthPix;return t}},{key:"AdjustWidth",value:function(t){var e=this.OwnerData.Width-this.GetFormatWidth();if(0!=e){for(var i=e/this.FColWidths.count,n=e%this.FColWidths.count,o=0;o<this.FColWidths.count;o++)this.FColWidths[o]+=i,0!=n&&(o==this.FColWidths.count-1?this.FColWidths[o]+=n:n>0?(this.FColWidths[o]+=1,n--):(this.FColWidths[o]-=1,n++));t&&this.ReFormatRequest()}}},{key:"CheckRowBorderRang",value:function(t,e){return t>=e-this.GripSize&&t<=e+this.GripSize}},{key:"CheckColBorderRang",value:function(t,e){return t>=e-this.GripSize&&t<=e+this.GripSize}},{key:"GetCellAt",value:function(t,e,i,n){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=new Rh;if(r.TableSite=wh,r.DestX=-1,r.DestY=-1,i=-1,n=-1,e<0||e>this.Height)return{resizeInfo:r,row:i,col:n};var s=0,a=0;if(t<0||t>this.Width){s=this.FBorderWidthPix;for(var l=0;l<this.RowCount;l++){if(a=(s+=this.FRows[l].FmtOffset)+this.FRows[l].Height,s<e&&a>e){i=l;break}s=a}return{resizeInfo:r,row:i,col:n}}if(s=this.FBorderWidthPix,this.CheckRowBorderRang(e,s))return r.TableSite=Ph,{resizeInfo:r,row:i,col:n};if(this.CheckColBorderRang(t,s))return r.TableSite=kh,{resizeInfo:r,row:i,col:n};for(var h=0;h<this.RowCount;h++){if(a=(s+=this.FRows[h].FmtOffset)+this.FRows[h].Height+this.FBorderWidthPix,this.CheckRowBorderRang(e,a)){i=h,r.TableSite=bh,r.DestY=a;break}if(s<e&&a>e){i=h;break}s=a}if(i<0)return{resizeInfo:r,row:i,col:n};for(var c,u=this.FBorderWidthPix,f=0,d=-1,m=-1,y=0;y<this.FColWidths.count;y++){if(f=u+this.FColWidths[y]+this.FBorderWidthPix,d=(c=this.GetDestCell(i,y)).row,m=c.col,this.CheckColBorderRang(t,f)){n=y,m+this.FRows[d][m].ColSpan!=y?r.TableSite=Ch:r.TableSite=Dh,r.DestX=f;break}if(u<t&&f>t){n=y,r.TableSite==bh&&d+this.FRows[d][m].RowSpan!=i&&(r.TableSite=Ch);break}u=f}return n>=0&&(r.TableSite==wh&&(r.TableSite=Ch),o&&null==this.FRows[i][n].CellData&&(i=(c=this.GetDestCell(i,n)).row,n=c.col)),{resizeInfo:r,row:i,col:n}}},{key:"GetDestCell",value:function(t,e){var i=t,n=e;return this.FRows[t][e].RowSpan<0&&(i+=this.FRows[t][e].RowSpan),this.FRows[t][e].ColSpan<0&&(n+=this.FRows[t][e].ColSpan),{row:i,col:n}}},{key:"GetSourceCell",value:function(t,e){if(null!=this.FRows[t][e].CellData)return{row:t+this.FRows[t][e].RowSpan,col:e+this.FRows[t][e].ColSpan};or.exception(lp.HCS_EXCEPTION_VOIDSOURCECELL)}},{key:"SelectRange",value:function(t,e,n,o){0==t&&0==e&&n==this.RowCount-1&&o==this.FColWidths.count-1&&jh(Zh(i.prototype),"SelectComplate",this).call(this),this.FSelectCellRang.SetStart(t,e),this.FSelectCellRang.SetEnd(n,o);for(var r=t;r<=n;r++)for(var s=e;s<=o;s++)null!=this.FRows[r][s].CellData&&this.FRows[r][s].CellData.SelectAll()}},{key:"SelectAll",value:function(){this.SelectComplate()}},{key:"PaintRow",value:function(t,e,i,n,o,r){for(var s,a=Math.trunc(this.FBorderWidthPix/2),l=e+this.FBorderWidthPix,h=i+this.FBorderWidthPix+this.FCellVPaddingPix,c=-1,u=-1,f=-1,d=-1,m=-1,y=null,p=!1,S=0;S<this.FRows[t].ColCount;S++)this.FRows[t][S].ColSpan<0||this.FRows[t][S].RowSpan<0||(c=Math.min(n,h+Math.max(this.FRows[t].Height,this.FRows[t][S].Height)-this.FCellVPaddingPix),s=U.Create(l,i+this.FBorderWidthPix,l+this.FRows[t][S].Width,c),y=this.FRows[t][S].CellData,!this.IsSelectComplate&&!y.CellSelectedAll||r.Print?(p=!0,null!=this.FOnCellPaintBK&&(p=this.FOnCellPaintBK(this,this.FRows[t][S],s,o,r,p)),p&&(this.FRows[t][S].BackgroundColor!=lp.HCTransparentColor?o.brush.color=this.FRows[t][S].BackgroundColor:o.brush.style=Ft,o.fillRect(s))):(o.brush.color=this.OwnerData.Style.SelColor,o.fillRect(s)),c-h>this.FCellVPaddingPix&&this.FRows[t][S].PaintTo(l,h-this.FCellVPaddingPix,s.right,c,i,n,0,this.FCellHPaddingPix,this.FCellVPaddingPix,o,r),!this.FBorderVisible&&r.Print||(r.Print?o.pen.width=Math.max(1,sr.ptToPixel(this.FBorderWidthPt,r.DPI)):o.pen.width=this.FBorderWidthPix,this.FBorderVisible?(o.pen.color="black",o.pen.style=pt.Solid):r.Print||(o.pen.color=lp.clActiveBorder,o.pen.style=pt.Dot),f=(u=h-this.FCellVPaddingPix-this.FBorderWidthPix)+this.FBorderWidthPix+Math.max(this.FRows[t].Height,this.FRows[t][S].Height),d=l-this.FBorderWidthPix,m=l+this.FColWidths[S]+this.GetColSpanWidth(t,S),u>=0&&this.FRows[t][S].BorderSides.has(fp.Top)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+a,u+a),G.Create(m+a,u+a)]):o.drawLineDriect(d+a,u+a,m+a,u+a)),this.FRows[t][S].BorderSides.has(fp.Right)&&(r.Print?r.drawNoScaleLine(o,[G.Create(m+a,u+a),G.Create(m+a,f+a)]):o.drawLineDriect(m+a,u+a,m+a,f+a)),this.FRows[t][S].BorderSides.has(fp.Bottom)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+a,f+a),G.Create(m+a,f+a)]):o.drawLineDriect(d+a,f+a,m+a,f+a)),this.FRows[t][S].BorderSides.has(fp.Left)&&(r.Print?r.drawNoScaleLine(o,[G(d+a,u+a),G.Create(d+a,f+a)]):o.drawLineDriect(d+a,u+a,d+a,f+a)),this.FRows[t][S].BorderSides.has(fp.LTRB)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+a,u+a),G(m+a,f+a)]):o.drawLineDriect(d+a,u+a,m+a,f+a)),this.FRows[t][S].BorderSides.has(fp.RTLB)&&(r.Print?r.drawNoScaleLine(o,[G.Create(m+a,u+a),G.Create(d+a,f+a)]):o.drawLineDriect(m+a,u+a,d+a,f+a)))),l=l+this.FColWidths[S]+this.FBorderWidthPix}},{key:"PaintFixRows",value:function(t,e,i,n,o){var r=this.GetFixRowHeight();if(!(e+r<0)){var s=U.CreateByBounds(t,e,this.Width,r);this.DoPaint(this.OwnerData.Style,s,e,e+r,e,e+r,n,o)}}},{key:"PaintFixCols",value:function(t,e,i,n,o,r){for(var s=Math.max(i,t)+this.FBorderWidthPix,a=0;a<this.FFixRow+this.FFixRowCount;a++)s=s+this.FRows[a].FmtOffset+this.FRows[a].Height+this.FBorderWidthPix;var l=U.CreateByBounds(e,s,this.GetFixColWidth(),n-s);o.brush.color=lp.clBtnFace,o.fillRect(l);var h=0,c=0,u=0,f=0,d=0,m=0,y=Math.trunc(this.FBorderWidthPix/2);s=t+this.FBorderWidthPix;for(var p=0;p<this.FRows.count;p++)if((h=(s+=this.FRows[p].FmtOffset)+this.FRows[p].Height)<i||p<this.FFixRow+this.FFixRowCount)s=h+this.FBorderWidthPix;else{c=e+this.FBorderWidthPix;for(var S=this.FFixCol;S<this.FFixCol+this.FFixColCount&&!((l=U.Create(c,s,c+this.FColWidths[S],h)).top>n);S++)l.bottom>n&&(l.bottom=n),this.FRows[p][S].PaintTo(c,s,l.right,h,i,n,0,this.FCellHPaddingPix,this.FCellVPaddingPix,o,r),!this.FBorderVisible&&r.Print||(r.Print?o.pen.width=Math.max(1,sr.ptToPixel(this.FBorderWidthPt,r.DPI)):o.pen.width=this.FBorderWidthPix,this.FBorderVisible?(o.pen.color="black",o.pen.style=pt.Solid):r.Print||(o.pen.color=lp.clActiveBorder,o.pen.style=pt.Dot),f=(u=s-this.FBorderWidthPix)+this.FBorderWidthPix+Math.max(this.FRows[p].Height,this.FRows[p][S].Height),d=c-this.FBorderWidthPix,m=c+this.FColWidths[S]+this.GetColSpanWidth(p,S),u>=0&&this.FRows[p][S].BorderSides.has(fp.Top)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+y,u+y),G.Create(m+y,u+y)]):o.drawLineDriect(d+y,u+y,m+y,u+y)),this.FRows[p][S].BorderSides.has(fp.Right)&&(r.Print?r.drawNoScaleLine(o,[G.Create(m+y,u+y),G.Create(m+y,f+y)]):o.drawLineDriect(m+y,u+y,m+y,f+y)),f<=n&&this.FRows[p][S].BorderSides.has(fp.Bottom)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+y,f+y),G.Create(m+y,f+y)]):o.drawLineDriect(d+y,f+y,m+y,f+y)),this.FRows[p][S].BorderSides.has(fp.Left)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+y,u+y),G.Create(d+y,f+y)]):o.drawLineDriect(d+y,u+y,d+y,f+y)),this.FRows[p][S].BorderSides.has(fp.LTRB)&&(r.Print?r.drawNoScaleLine(o,[G.Create(d+y,u+y),G.Create(m+y,f+y)]):o.drawLineDriect(d+y,u+y,m+y,f+y)),this.FRows[p][S].BorderSides.has(fp.RTLB)&&(r.Print?r.drawNoScaleLine(o,[G.Create(m+y,u+y),G.Create(d+y,f+y)]):o.drawLineDriect(m+y,u+y,d+y,f+y))),c=c+this.FColWidths[S]+this.FBorderWidthPix;s=h+this.FBorderWidthPix}}},{key:"FormatRow",value:function(t){var e,i=this.FRows[t];i.FmtOffset=0,i.FormatInit();for(var n=0;n<i.ColCount;n++)null!=i[n].CellData&&(e=this.FColWidths[n]+this.GetColSpanWidth(t,n),i[n].Width=e,i[n].CellData.Width=e-this.FCellHPaddingPix-this.FCellHPaddingPix,i[n].CellData.ReFormat())}},{key:"GetColSpanWidth",value:function(t,e){for(var i=0,n=1;n<=this.FRows[t][e].ColSpan;n++)i=i+this.FBorderWidthPix+this.FColWidths[e+n];return i}},{key:"CellsCanMerge",value:function(t,e,i,n){for(var o,r,s=t;s<=i;s++)for(var a=e;a<=n;a++)if(null==this.FRows[s][a].CellData&&(o=this.GetDestCell(s,a),r=this.GetSourceCell(o.row,o.col),o.row<t||r.row>i||o.col<e||r.col>n))return!1;return!0}},{key:"RowCanDelete",value:function(t){for(var e=!1,i=0;i<this.FColWidths.count;i++)if(this.FRows[t][i].RowSpan>0)return e;return e=!0}},{key:"CurRowCanDelete",value:function(){return this.FSelectCellRang.EndRow<0&&this.FSelectCellRang.StartRow>=0&&this.RowCanDelete(this.FSelectCellRang.StartRow)}},{key:"ColCanDelete",value:function(t){for(var e=!1,i=0;i<this.RowCount;i++)if(this.FRows[i][t].ColSpan>0)return e;return e=!0}},{key:"CurColCanDelete",value:function(){return this.FSelectCellRang.EndCol<0&&this.FSelectCellRang.StartCol>=0&&this.ColCanDelete(this.FSelectCellRang.StartCol)}},{key:"SetFixRowAndCount",value:function(t,e){if(t<0||0==e)this.FFixRow=-1,this.FFixRowCount=0;else{var i=t;t>this.FRows.count-1&&(i=this.FRows.count-1);var n=e;i+e>this.FRows.count&&(n=this.FRows.count-i),this.FFixRow==i&&this.FFixRowCount==n||(this.FFixRow=i,this.FFixRowCount=n,this.FormatDirty())}}},{key:"SetFixColAndCount",value:function(t,e){if(t<0||0==e)this.FFixCol=-1,this.FFixColCount=0;else{var i=t;t>this.FColWidths.count-1&&(i=this.FColWidths.count-1);var n=e;i+e>this.FColWidths.count&&(n=this.FColWidths.count-i),this.FFixCol==i&&this.FFixColCount==n||(this.FFixCol=i,this.FFixColCount=n,this.FormatDirty())}}},{key:"MergeSelectCells",value:function(){var t=!1;if(this.FSelectCellRang.StartRow>=0&&this.FSelectCellRang.EndRow>=0){if(this.Undo_Mirror(),t=this.MergeCells(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,this.FSelectCellRang.EndRow,this.FSelectCellRang.EndCol)){this.FormatDirty();var e=this.FSelectCellRang.StartRow,i=this.FSelectCellRang.StartCol;this.FSelectCellRang.InitializeEnd(),this.DisSelect(),this.FSelectCellRang.SetStart(e,i),this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.InitializeField()}}else t=!!this.FSelectCellRang.EditCell()&&this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol].CellData.MergeTableSelectCells();return t}},{key:"SelectedCellCanMerge",value:function(){return!!this.FSelectCellRang.SelectExists()&&this.CellsCanMerge(this.FSelectCellRang.StartRow,this.FSelectCellRang.StartCol,this.FSelectCellRang.EndRow,this.FSelectCellRang.EndCol)}},{key:"GetEditCell",value:function(){return this.FSelectCellRang.EditCell()?this.FRows[this.FSelectCellRang.StartRow][this.FSelectCellRang.StartCol]:null}},{key:"GetEditCellWith",value:function(){var t=-1,e=-1,i=!1;return this.FSelectCellRang.EditCell()&&(t=this.FSelectCellRang.StartRow,e=this.FSelectCellRang.StartCol,i=!0),{result:i,row:t,col:e}}},{key:"_CacheDynamicAppendRow",value:function(t){var e=this;t&&this.FRowCache.splice(0,this.FRowCache.length),this.FRowCache.length<this.FRowCacheCount&&setTimeout((function(){for(var t=null;e.FRowCache.length<e.FRowCacheCount;)(t=e.DoCreateRow(e.OwnerData.Style,e.ColCount)).Height=e.FDefaultRowHeight,e.FRowCache[e.FRowCache.length]=t}),0)}},{key:"AppendRowDynamic",value:function(t){if(0!=t){this.InitializeMouseInfo();var e=t;if(this.FRowCache.length==this.FRowCacheCount){for(var i=0;i<this.FRowCacheCount&&0!=e;i++)this.FRows.add(this.FRowCache[this.FRowCache.length-1]),this.FormatRow(this.FRows.count-1),this.FRowCache.splice(this.FRowCache.length-1,1),e--;if(0==e)return this.GetFormatHeight(),void this._CacheDynamicAppendRow()}for(var n=null,o=0;o<e;o++){this.OwnerData.Style.SkipFormat=!0;try{n=this.DoCreateRow(this.OwnerData.Style,this.ColCount),this.FRows.add(n),n.Height=this.FDefaultRowHeight}finally{this.OwnerData.Style.SkipFormat=!1}this.FormatRow(this.FRows.count-1)}this.GetFormatHeight(),this.FRowCacheCount=this.FRows.count,this._CacheDynamicAppendRow()}}},{key:"InsertRowAfter",value:function(t){var e=this.GetEditCell();return null!=e&&(e.CellData.InitializeField(),e.RowSpan>0?this.InsertRow(this.FSelectCellRang.StartRow+e.RowSpan+1,t):this.InsertRow(this.FSelectCellRang.StartRow+1,t))}},{key:"InsertRowBefor",value:function(t){var e=this.GetEditCell();return null!=e&&(e.CellData.InitializeField(),this.InsertRow(this.FSelectCellRang.StartRow,t))}},{key:"InsertColAfter",value:function(t){var e=this.GetEditCell();return null!=e&&(e.CellData.InitializeField(),e.ColSpan>0?this.InsertCol(this.FSelectCellRang.StartCol+e.ColSpan+1,t):this.InsertCol(this.FSelectCellRang.StartCol+1,t))}},{key:"InsertColBefor",value:function(t){var e=this.GetEditCell();return null!=e&&(e.CellData.InitializeField(),this.InsertCol(this.FSelectCellRang.StartCol,t))}},{key:"DeleteCurCol",value:function(){var t=this.GetEditCell();return null!=t&&(t.CellData.InitializeField(),this.FColWidths.count>1&&this.DeleteCol(this.FSelectCellRang.StartCol))}},{key:"DeleteCurRow",value:function(){var t=this.GetEditCell();return null!=t&&(t.CellData.InitializeField(),this.DeleteRow(this.FSelectCellRang.StartRow))}},{key:"SplitCurRow",value:function(){var t=this.GetEditCell();if(null==t)return!1;t.CellData.InitializeField();var e=this.FSelectCellRang.StartRow,i=this.FSelectCellRang.StartCol,n=-1,o=-1,r=-1,s=-1;if(this.Undo_Mirror(),this.FRows[e][i].RowSpan>0){var a=this.GetSourceCell(e,i);n=a.row,o=a.col,this.FRows[e][i].RowSpan=0;for(var l=e;l<=n;l++)for(var h=i;h<=o;h++)this.FRows[l][h].RowSpan=this.FRows[l][h].RowSpan+1;this.FRows[e+1][i].CellData=new lp.TableCellData(this.OwnerData.Style),this.FRows[e+1][i].RowSpan=n-(e+1),this.FRows[e+1][i].ColSpan=o-i}else if(this.InsertRow(e+1,1))for(var c=0;c<this.ColCount;)if(t=this.FRows[e][c],c==i)if(t.ColSpan>0)for(o=i+t.ColSpan;c<=o;)this.FRows[e+1][c].ColSpan=this.FRows[e][c].ColSpan,this.FRows[e+1][c].ColSpan<0&&(this.FRows[e+1][c].CellData.dispose(),this.FRows[e+1][c].CellData=null),c++;else c++;else if(0==t.ColSpan)0==t.RowSpan?(this.FRows[e+1][c].CellData.dispose(),this.FRows[e+1][c].CellData=null,this.FRows[e+1][c].RowSpan=-1,t.RowSpan=1,c++):t.RowSpan<0?(e==(n=(r=e+t.RowSpan)+this.FRows[r][c].RowSpan)&&(this.FRows[e+1][c].CellData.dispose(),this.FRows[e+1][c].CellData=null,this.FRows[e+1][c].RowSpan=t.RowSpan-1,this.FRows[r][c].RowSpan=this.FRows[r][c].RowSpan+1),c++):c++;else if(t.ColSpan>0)if(0==t.RowSpan)for(t.RowSpan=1,s=c,o=c+t.ColSpan;c<=o;)this.FRows[e+1][c].CellData.dispose(),this.FRows[e+1][c].CellData=null,this.FRows[e+1][c].ColSpan=s-c,this.FRows[e+1][c].RowSpan=-1,c++;else c++;else c++;return this.FormatDirty(),!0}},{key:"SplitCurCol",value:function(){var t=this.GetEditCell();if(null==t)return!1;t.CellData.InitializeField();var e=this.FSelectCellRang.StartRow,i=this.FSelectCellRang.StartCol,n=-1,o=-1,r=-1,s=-1;if(this.Undo_Mirror(),this.FRows[e][i].ColSpan>0){var a=this.GetSourceCell(e,i);n=a.row,o=a.col,this.FRows[e][i].ColSpan=0;for(var l=i;l<=o;l++)for(var h=e;h<=n;h++)this.FRows[h][l].ColSpan=this.FRows[h][l].ColSpan+1;this.FRows[e][i+1].CellData=new lp.TableCellData(this.OwnerData.Style),this.FRows[e][i+1].RowSpan=n-e,this.FRows[e][i+1].ColSpan=o-(i+1)}else if(this.InsertCol(i+1,1))for(var c=0;c<this.RowCount;)if(t=this.FRows[c][i],c==e)if(t.RowSpan>0)for(n=e+t.RowSpan;c<=n;)this.FRows[c][i+1].RowSpan=this.FRows[c][i].RowSpan,this.FRows[c][i+1].RowSpan<0&&(this.FRows[c][i+1].CellData.dispose(),this.FRows[c][i+1].CellData=null),c++;else c++;else if(0==t.RowSpan)0==t.ColSpan?(this.FRows[c][i+1].CellData.dispose(),this.FRows[c][i+1].CellData=null,this.FRows[c][i+1].ColSpan=-1,t.ColSpan=1,c++):t.ColSpan<0?(i==(o=(s=i+t.ColSpan)+this.FRows[c][s].ColSpan)&&(this.FRows[c][i+1].CellData.dispose(),this.FRows[c][i+1].CellData=null,this.FRows[c][i+1].ColSpan=t.ColSpan-1,this.FRows[c][s].ColSpan=this.FRows[c][s].ColSpan+1),c++):c++;else if(t.RowSpan>0)if(0==t.ColSpan)for(t.ColSpan=1,r=c,n=c+t.RowSpan;c<=n;)this.FRows[c][i+1].CellData.dispose(),this.FRows[c][i+1].CellData=null,this.FRows[c][i+1].RowSpan=r-c,this.FRows[c][i+1].ColSpan=-1,c++;else c++;else c++;return this.FormatDirty(),!0}},{key:"IsBreakRow",value:function(t){for(var e=!1,i=0;i<this.FPageBreaks.count;i++)if(t==this.FPageBreaks[i].Row){e=!0;break}return e}},{key:"IsFixRow",value:function(t){return this.FFixRow>=0&&(t>=this.FFixRow&&t<this.FFixRow+this.FFixRowCount)}},{key:"IsFixCol",value:function(t){return this.FFixCol>=0&&(t>=this.FFixCol&&t<this.FFixCol+this.FFixColCount)}},{key:"GetFixRowHeight",value:function(){if(this.FFixRow<0)return 0;for(var t=this.FBorderWidthPix,e=this.FFixRow;e<this.FFixRow+this.FFixRowCount;e++)t=t+this.FRows[e].Height+this.FBorderWidthPix;return t}},{key:"GetFixColWidth",value:function(){if(this.FFixCol<0)return 0;for(var t=this.FBorderWidthPix,e=this.FFixCol;e<this.FFixCol+this.FFixColCount;e++)t=t+this.FColWidths[e]+this.FBorderWidthPix;return t}},{key:"GetFixColLeft",value:function(){if(this.FFixCol<0)return 0;for(var t=this.FBorderWidthPix,e=0;e<this.FFixCol;e++)t=t+this.FColWidths[e]+this.FBorderWidthPix;return t}},{key:"ColWidth",value:function(t){return this.GetColWidth(t)}},{key:"SetColWidth",value:function(t,e){this.FColWidths[t]=e;for(var i=0;i<this.RowCount;i++)this.FRows[i][t].Width=e,null!=this.FRows[i][t].CellData&&(this.FRows[i][t].CellData.Width=e-this.FCellHPaddingPix-this.FCellHPaddingPix)}},{key:"Rows",get:function(){return this.FRows}},{key:"RowCount",get:function(){return this.GetRowCount()}},{key:"ColCount",get:function(){return this.GetColCount()}},{key:"SelectCellRang",get:function(){return this.FSelectCellRang}},{key:"BorderVisible",get:function(){return this.FBorderVisible},set:function(t){this.FBorderVisible=t}},{key:"BorderWidthPix",get:function(){return this.FBorderWidthPix}},{key:"BorderWidthPt",get:function(){return this.FBorderWidthPt},set:function(t){this.SetBorderWidthPt(t)}},{key:"CellHPaddingPix",get:function(){return this.FCellHPaddingPix}},{key:"CellVPaddingPix",get:function(){return this.FCellVPaddingPix}},{key:"CellVPaddingMM",get:function(){return this.FCellVPaddingMM},set:function(t){this.SetCellVPaddingMM(t)}},{key:"CellHPaddingMM",get:function(){return this.FCellHPaddingMM},set:function(t){this.SetCellHPaddingMM(t)}},{key:"FixCol",get:function(){return this.FFixCol}},{key:"FixColCount",get:function(){return this.FFixColCount}},{key:"FixRow",get:function(){return this.FFixRow}},{key:"FixRowCount",get:function(){return this.FFixRowCount}},{key:"ResizeKeepWidth",get:function(){return this.FResizeKeepWidth},set:function(t){this.FResizeKeepWidth=t}},{key:"DefaultRowHeight",get:function(){return this.FDefaultRowHeight}},{key:"OnCellPaintBK",get:function(){return this.FOnCellPaintBK},set:function(t){this.OnCellPaintBK=t}},{key:"OnCellPaintData",get:function(){return this.OnCellPaintData},set:function(t){this.OnCellPaintData=t}}]),i}(al);function nc(t){return(nc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oc(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function rc(t,e,i){return(rc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=hc(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function sc(t,e){return(sc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ac(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=hc(t);if(e){var o=hc(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return lc(this,i)}}function lc(t,e){return!e||"object"!==nc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function hc(t){return(hc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function cc(t){return(cc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uc(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function fc(t,e,i){return(fc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=pc(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function dc(t,e){return(dc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function mc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=pc(t);if(e){var o=pc(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yc(this,i)}}function yc(t,e){return!e||"object"!==cc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function pc(t){return(pc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Sc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&dc(t,e)}(r,t);var e,i,n,o=mc(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).FFormatFirstItemNo,e.FFormatFirstDrawItemNo,e.FFormatLastItemNo,e.FUndoGroupCount=0,e.FItemAddCount=0,e.FForceClearExtra,e}return e=r,(i=[{key:"UndoRedoDeleteBackText",value:function(t,e,i,n){var o=t;i=o.ItemNo;var r=o.Text.length,s=this.Items[o.ItemNo].Text;return e?(s=C.stringInsert(s,o.Offset-1,o.Text),n=o.Offset-1):(s=C.stringDelete(s,o.Offset-1,r),n=o.Offset-1),this.Items[o.ItemNo].Text=s,{itemNo:i,offset:n}}},{key:"UndoRedoDeleteText",value:function(t,e,i,n){var o=t;i=o.ItemNo;var r=o.Text.length,s=this.Items[o.ItemNo].Text;return s=e?C.stringInsert(s,o.Offset-1,o.Text):C.stringDelete(s,o.Offset-1,r),n=o.Offset-1,this.Items[o.ItemNo].Text=s,{itemNo:i,offset:n}}},{key:"UndoRedoInsertText",value:function(t,e,i,n){var o=t;i=o.ItemNo;var r=this.Items[o.ItemNo].Text,s=o.Text.length;return e?(r=C.stringDelete(r,o.Offset-1,s),n=o.Offset-1):(r=C.stringInsert(r,o.Offset-1,o.Text),n=o.Offset+s-1),this.Items[o.ItemNo].Text=r,{itemNo:i,offset:n}}},{key:"UndoRedoSetItemText",value:function(t,e,i,n){var o=t;return i=o.ItemNo,e?(this.Items[o.ItemNo].Text=o.Text,n=o.Offset):(this.Items[o.ItemNo].Text=o.NewText,n=o.NewText.length),{itemNo:i,offset:n}}},{key:"UndoRedoDeleteItem",value:function(t,e,i,n){var o=t;if(i=o.ItemNo,e){var r=this.LoadItemFromStreamAlone(o.ItemStream);this.Items.insert(o.ItemNo,r),this.FItemAddCount++,n=o.Offset}else this.Items.delete(o.ItemNo),this.FItemAddCount--,i>0?(i--,n=this.Items[i].StyleNo>cs.Null?this.Items[i].Length:lp.OffsetAfter):n=0;return{itemNo:i,offset:n}}},{key:"UndoRedoInsertItem",value:function(t,e,i,n,o,r){var s=e;if(n=s.ItemNo,i)n<this.Items.count-1?this.Items[n].ParaFirst?(o=0,r=this.Items[n+1].FirstDItemNo):(n--,o=this.Items[n].StyleNo>cs.Null?this.Items[n].Length:lp.OffsetAfter,r=t.CaretDrawItemNo):n>0?(n--,o=this.Items[n].StyleNo>cs.Null?this.Items[n].Length:lp.OffsetAfter,r=t.CaretDrawItemNo-1):o=0,this.Items.delete(s.ItemNo),this.FItemAddCount--;else{var a=this.LoadItemFromStreamAlone(s.ItemStream);this.Items.insert(s.ItemNo,a),this.FItemAddCount++,n=s.ItemNo,o=this.Items[n].StyleNo>cs.Null?this.Items[n].Length:lp.OffsetAfter,r=t.CaretDrawItemNo+1}return{itemNo:n,offset:o,drawItemNo:r}}},{key:"UndoRedoItemProperty",value:function(t,e,i,n){var o=t;i=o.ItemNo,n=o.Offset;var r=this.Items[o.ItemNo];switch(o.ItemProperty){case ca:r.StyleNo=e?o.OldStyleNo:o.NewStyleNo;break;case ua:var s=this.GetParaLastItemNo(o.ItemNo);if(e)for(var a=o.ItemNo;a<=s;a++)this.Items[a].ParaNo=o.OldParaNo;else for(var l=o.ItemNo;l<=s;l++)this.Items[l].ParaNo=o.NewParaNo;break;case fa:r.ParaFirst=e?o.OldParaFirst:o.NewParaFirst;break;case da:this.FForceClearExtra=!0,r.PageBreak=e?o.OldPageBreak:o.NewPageBreak}return{itemNo:i,offset:n}}},{key:"UndoRedoItemSelf",value:function(t,e,i,n){var o=t;return i=o.ItemNo,n=o.Offset,e?this.Items[i].Undo(o):this.Items[i].Redo(o),{itemNo:i,offset:n}}},{key:"UndoRedoItemMirror",value:function(t,e,i,n){var o=t;return i=o.ItemNo,n=o.Offset,this.Items[i]=this.LoadItemFromStreamAlone(o.ItemStream),{itemNo:i,offset:n}}},{key:"DoUndoRedoAction",value:function(t,e,i,n,o,r){var s;switch(e.Tag){case wp.BackDeleteText:n=(s=this.UndoRedoDeleteBackText(e,i,n,o)).itemNo,o=s.offset;break;case wp.DeleteText:n=(s=this.UndoRedoDeleteText(e,i,n,o)).itemNo,o=s.offset;break;case wp.InsertText:n=(s=this.UndoRedoInsertText(e,i,n,o)).itemNo,o=s.offset;break;case wp.SetItemText:n=(s=this.UndoRedoSetItemText(e,i,n,o)).itemNo,o=s.offset;break;case wp.DeleteItem:n=(s=this.UndoRedoDeleteItem(e,i,n,o)).itemNo,o=s.offset;break;case wp.InsertItem:n=(s=this.UndoRedoInsertItem(t,e,i,n,o,r)).itemNo,o=s.offset,r=s.drawItemNo;break;case wp.ItemProperty:n=(s=this.UndoRedoItemProperty(e,i,n,o)).itemNo,o=s.offset;break;case wp.ItemSelf:n=(s=this.UndoRedoItemSelf(e,i,n,o)).itemNo,o=s.offset;break;case wp.ItemMirror:n=(s=this.UndoRedoItemMirror(e,i,n,o)).itemNo,o=s.offset}return{itemNo:n,offset:o,drawItemNo:r}}},{key:"GetActionAffectFirst",value:function(t,e){var i=t.ItemNo;switch(t.Tag){case wp.DeleteItem:i>0&&i--;break;case wp.InsertItem:e?i>0&&i--:i>this.Items.count-1&&i--;break;case wp.ItemProperty:var n=t;n.ItemProperty!=fa&&n.ItemProperty!=da&&n.ItemProperty!=ca||i>0&&i--}return i>this.Items.count-1&&(i=this.Items.count-1),i}},{key:"GetActionAffectLast",value:function(t,e){var i=t.ItemNo;switch(t.Tag){case wp.DeleteItem:e?i>0&&i--:i<this.Items.count-1&&i++;break;case wp.InsertItem:e?i<this.Items.count-1&&t.ParaFirst&&i++:i>this.Items.count-1&&i--;break;case wp.ItemProperty:var n=t;n.ItemProperty!=fa&&n.ItemProperty!=da&&n.ItemProperty!=ca||i<this.Items.count-1&&i++}return i>this.Items.count-1&&(i=this.Items.count-1),i}},{key:"CalcAffectRange",value:function(t){this.FFormatFirstItemNo=this.GetActionAffectFirst(t.Actions.first,t.IsUndo),this.FFormatLastItemNo=this.GetActionAffectLast(t.Actions.first,t.IsUndo);var e=-1,i=-1,n=0;t.Actions.first.Tag==wp.InsertItem&&n++;for(var o=1;o<t.Actions.count;o++)e=this.GetActionAffectFirst(t.Actions[o],t.IsUndo),i=this.GetActionAffectLast(t.Actions[o],t.IsUndo),t.Actions[o].Tag==wp.InsertItem&&n++,this.FFormatFirstItemNo>e&&(this.FFormatFirstItemNo=e),this.FFormatLastItemNo<i&&(this.FFormatLastItemNo=i);this.FFormatFirstItemNo<0&&(this.FFormatFirstItemNo=0),t.IsUndo&&(this.FFormatLastItemNo+=n),this.FFormatLastItemNo>this.Items.count-1&&(this.FFormatLastItemNo=this.Items.count-1)}},{key:"DoUndoRedo",value:function(t){if(this.FForceClearExtra=!1,t.isClass(_a))if(t.IsUndo){if(0==this.FUndoGroupCount){var e=this.GetUndoList();if(this.FFormatFirstItemNo=e[e.CurGroupBeginIndex].ItemNo,this.FFormatLastItemNo=e[e.CurGroupEndIndex].ItemNo,this.FFormatFirstItemNo>0&&this.FFormatFirstItemNo--,this.FFormatLastItemNo<this.Items.count-1&&this.FFormatLastItemNo++,this.FFormatFirstItemNo!=this.FFormatLastItemNo)this.FFormatFirstItemNo=this.GetParaFirstItemNo(this.FFormatFirstItemNo),this.FFormatFirstDrawItemNo=this.Items[this.FFormatFirstItemNo].FirstDItemNo,this.FFormatLastItemNo=this.GetParaLastItemNo(this.FFormatLastItemNo);else{var i=this.GetFormatRangeByOffset(this.FFormatFirstItemNo,1,this.FFormatFirstDrawItemNo,this.FFormatLastItemNo);this.FFormatFirstDrawItemNo=i.firstDrawItemNo,this.FFormatLastItemNo=i.lastItemNo}this.FormatPrepare(this.FFormatFirstDrawItemNo,this.FFormatLastItemNo),this.SelectInfo.Initialize(),this.InitializeField(),this.FItemAddCount=0}this.FUndoGroupCount++}else this.FUndoGroupCount--,0==this.FUndoGroupCount&&(this.ReFormatData(this.FFormatFirstDrawItemNo,this.FFormatLastItemNo+this.FItemAddCount,this.FItemAddCount,this.FForceClearExtra),this.SelectInfo.StartItemNo=t.ItemNo,this.SelectInfo.StartItemOffset=t.Offset,this.CaretDrawItemNo=t.CaretDrawItemNo,this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoRePaint());else if(t.isClass(Da))if(t.IsUndo)this.FUndoGroupCount--,0==this.FUndoGroupCount&&(this.ReFormatData(this.FFormatFirstDrawItemNo,this.FFormatLastItemNo+this.FItemAddCount,this.FItemAddCount,this.FForceClearExtra),this.SelectInfo.StartItemNo=t.ItemNo,this.SelectInfo.StartItemOffset=t.Offset,this.CaretDrawItemNo=t.CaretDrawItemNo,this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoRePaint());else{if(0==this.FUndoGroupCount){var n=this.GetUndoList();this.FFormatFirstItemNo=-1,this.FFormatLastItemNo=-1;for(var o=-1,r=n.CurGroupBeginIndex;r<=n.CurGroupEndIndex;r++)n[r].isClass(Da)?this.FFormatFirstItemNo>n[r].ItemNo&&(this.FFormatFirstItemNo=n[r].ItemNo):n[r].isClass(_a)?this.FFormatLastItemNo<n[r].ItemNo&&(this.FFormatLastItemNo=n[r].ItemNo):(o=this.GetParaFirstItemNo(this.GetActionAffectFirst(n[r].Actions.first,n[r].IsUndo)),this.FFormatFirstItemNo>o&&(this.FFormatFirstItemNo=o),o=this.GetParaLastItemNo(this.GetActionAffectLast(n[r].Actions.last,n[r].IsUndo)),this.FFormatLastItemNo<o&&(this.FFormatLastItemNo=o));this.FFormatFirstItemNo<0&&(this.FFormatFirstItemNo=0),this.FFormatLastItemNo>this.Items.count-1&&(this.FFormatLastItemNo=this.Items.count-1),this.FFormatFirstDrawItemNo=this.GetFormatFirstDrawItem(this.Items[this.FFormatFirstItemNo].FirstDItemNo),this.FormatPrepare(this.FFormatFirstDrawItemNo,this.FFormatLastItemNo),this.SelectInfo.Initialize(),this.InitializeField(),this.FItemAddCount=0}this.FUndoGroupCount++}else if(0!=t.Actions.count){var s,a=-1,l=-1,h=-1;if(0==this.FUndoGroupCount&&(this.SelectInfo.Initialize(),this.InitializeField(),this.FItemAddCount=0,a=t.CaretDrawItemNo,this.CalcAffectRange(t),this.FFormatLastItemNo=this.GetParaLastItemNo(this.FFormatLastItemNo),this.FFormatFirstDrawItemNo=this.GetFormatFirstDrawItem(this.FFormatFirstItemNo),this.FormatPrepare(this.FFormatFirstDrawItemNo,this.FFormatLastItemNo)),t.IsUndo)for(var c=t.Actions.count-1;c>=0;c--)l=(s=this.DoUndoRedoAction(t,t.Actions[c],!0,l,h,a)).itemNo,h=s.offset,a=s.drawItemNo;else for(var u=0;u<=t.Actions.count-1;u++)l=(s=this.DoUndoRedoAction(t,t.Actions[u],!1,l,h,a)).itemNo,h=s.offset,a=s.drawItemNo;if(0==this.FUndoGroupCount){this.ReFormatData(this.FFormatFirstDrawItemNo,this.FFormatLastItemNo+this.FItemAddCount,this.FItemAddCount,this.FForceClearExtra);var f=this.GetDrawItemNoByOffset(l,h);a<0||a>this.DrawItems.count-1?a=f:f!=a&&(this.DrawItems[a].ItemNo==l&&this.DrawItems[a].CharOffs==h||(a=f)),this.CaretDrawItemNo=a,this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoRePaint()}this.SelectInfo.StartItemNo=l,this.SelectInfo.StartItemOffset=h}}},{key:"GetUndoList",value:function(){return this.Loading?null:fc(pc(r.prototype),"GetUndoList",this).call(this)}},{key:"Undo_New",value:function(){var t=this.GetUndoList();if(null!=t&&t.Enable){var e=t.UndoNew();e.isClass(Ca)&&(e.CaretDrawItemNo=this.CaretDrawItemNo)}}},{key:"Undo_GroupBegin",value:function(t,e){var i=this.GetUndoList();null!=i&&i.Enable&&i.UndoGroupBegin(t,e)}},{key:"Undo_GroupEnd",value:function(t,e){var i=this.GetUndoList();null!=i&&i.Enable&&i.UndoGroupEnd(t,e)}},{key:"UndoAction_DeleteBackText",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;null!=o&&(o.ActionAppend(wp.BackDeleteText,t,e,this.Items[t].ParaFirst).Text=i)}}},{key:"UndoAction_DeleteText",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;null!=o&&(o.ActionAppend(wp.DeleteText,t,e,this.Items[t].ParaFirst).Text=i)}}},{key:"UndoAction_InsertText",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;null!=o&&(o.ActionAppend(wp.InsertText,t,e,this.Items[t].ParaFirst).Text=i)}}},{key:"UndoAction_SetItemText",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;if(null!=o){var r=o.ActionAppend(wp.SetItemText,t,e,this.Items[t].ParaFirst);r.Text=this.Items[t].Text,r.NewText=i}}}},{key:"UndoAction_DeleteItem",value:function(t,e){var i=this.GetUndoList();if(null!=i&&i.Enable){var n=i.last;if(null!=n){var o=n.ActionAppend(wp.DeleteItem,t,e,this.Items[t].ParaFirst);this.SaveItemToStreamAlone(o.ItemStream,this.Items[t])}}}},{key:"UndoAction_InsertItem",value:function(t,e){var i=this.GetUndoList();if(null!=i&&i.Enable){var n=i.last;if(null!=n){var o=n.ActionAppend(wp.InsertItem,t,e,this.Items[t].ParaFirst);this.SaveItemToStreamAlone(o.ItemStream,this.Items[t])}}}},{key:"UndoAction_ItemStyle",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;if(null!=o){var r=new ya;r.ItemNo=t,r.Offset=e,r.OldStyleNo=this.Items[t].StyleNo,r.NewStyleNo=i,o.Actions.add(r)}}}},{key:"UndoAction_ItemParaNo",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;if(null!=o){var r=new pa;r.ItemNo=t,r.Offset=e,r.OldParaNo=this.Items[t].ParaNo,r.NewParaNo=i,o.Actions.add(r)}}}},{key:"UndoAction_ItemParaFirst",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;if(null!=o){var r=new Sa;r.ItemNo=t,r.Offset=e,r.OldParaFirst=this.Items[t].ParaFirst,r.NewParaFirst=i,o.Actions.add(r)}}}},{key:"UndoAction_ItemPageBreak",value:function(t,e,i){var n=this.GetUndoList();if(null!=n&&n.Enable){var o=n.last;if(null!=o){var r=new va;r.ItemNo=t,r.Offset=e,r.OldPageBreak=this.Items[t].PageBreak,r.NewPageBreak=i,o.Actions.add(r)}}}},{key:"UndoAction_ItemSelf",value:function(t,e){var i=this.GetUndoList();if(null!=i&&i.Enable){var n=i.last;null!=n&&n.ActionAppend(wp.ItemSelf,t,e,this.Items[t].ParaFirst)}}},{key:"UndoAction_ItemMirror",value:function(t,e){var i=this.GetUndoList();if(null!=i&&i.Enable){var n=i.last;if(null!=n){var o=n.ActionAppend(wp.ItemMirror,t,e,this.Items[t].ParaFirst);this.SaveItemToStreamAlone(o.ItemStream,this.Items[t])}}}},{key:"Clear",value:function(){if(this.Items.count>0){var t=this.GetUndoList();if(null!=t&&t.Enable){this.Undo_New();for(var e=this.Items.count-1;e>=0;e--)this.UndoAction_DeleteItem(e,0)}}fc(pc(r.prototype),"Clear",this).call(this)}},{key:"Undo",value:function(t){this.DoUndoRedo(t)}},{key:"Redo",value:function(t){this.DoUndoRedo(t)}},{key:"UndoItemMirror",value:function(t,e){this.UndoAction_ItemMirror(t,e)}},{key:"SaveItemToStreamAlone",value:function(t,e){lp._SaveFileFormatAndVersion(t),this.Style.SaveToStream(t),e.SaveToStream(t)}},{key:"LoadItemFromStreamAlone",value:function(t,e){t.position=0;var i=lp._LoadFileFormatAndVersion(t),n=i.fileExt,o=i.fileVersion;n!=lp.HC_EXT&&"cff."!=n&&or.exception("加载失败,不是"+lp.HC_EXT+"文件!");var r=new cs;r.LoadFromStream(t,o);var s=t.readInt32();if(s>cs.Null){var a=r.TextStyles[s];s=this.Style.GetStyleNo(a,!0)}null==e&&(e=this.CreateItemByStyle(s)),e.LoadFromStream(t,r,o),e.StyleNo=s;var l=e.ParaNo,h=r.ParaStyles[l];return l=this.Style.GetParaNo(h,!0),e.ParaNo=l,e}}])&&uc(e.prototype,i),n&&uc(e,n),r}(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&sc(t,e)}(r,t);var e,i,n,o=ac(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).FormatTextCut=8192,e.FWidth=0,e.FFormatCount=0,e.FItemFormatHeight=0,e.FFormatChange=!1,e.OnItemReFormatRequest=null,e.OnItemSetCaretRequest=null,e.FormatInit(),e}return e=r,(i=[{key:"FormatRange",value:function(t,e){var i=-1,n=-1,o=-1,r=null,s=new G;this.FFormatChange?this.FFormatStartDrawItemNo<t&&(this.FFormatStartDrawItemNo=t):this.FFormatStartDrawItemNo=t,t>0?(i=t-1,n=this.DrawItems[t].ItemNo,o=this.DrawItems[t].CharOffs,r=this.Style.ParaStyles[this.Items[n].ParaNo],this.DrawItems[t].LineFirst?(s.x=r.LeftIndentPix,s.y=this.DrawItems[i].rect.bottom):(s.x=this.DrawItems[i].rect.right,s.y=this.DrawItems[i].rect.top)):(i=-1,n=0,o=1,r=this.Style.ParaStyles[this.Items[n].ParaNo],s.x=r.LeftIndentPix,s.y=0),this.Style.ApplyTempStyle(cs.Null);var a=this.FormatItemToDrawItems(n,o,r.LeftIndentPix,this.FWidth-r.RightIndentPix,this.FWidth,s,i);s=a.pos,i=a.drawItemNo;for(var l=n+1;l<=e;l++)this.Items[l].ParaFirst&&(r=this.Style.ParaStyles[this.Items[l].ParaNo],s.x=r.LeftIndentPix),s=(a=this.FormatItemToDrawItems(l,1,r.LeftIndentPix,this.FWidth-r.RightIndentPix,this.FWidth,s,i)).pos,i=a.drawItemNo;this.DrawItems.DeleteFormatMark()}},{key:"FormatItem",value:function(t){var e=this.GetItemNo(t);e>=0&&this.FormatItemNo(e)}},{key:"FormatItemNo",value:function(t){if(t>=0){var e=this.GetFormatRange(t,0);this.FormatPrepare(e.firstDrawItemNo,e.lastItemNo),this.ReFormatData(e.firstDrawItemNo,e.lastItemNo),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.SelectInfo.StartItemNo==t&&this.SelectInfo.StartItemOffset>this.Items[t].Length&&this.ReSetSelectAndCaret(t)}}},{key:"CalcItemFormatHeigh",value:function(t){this.Style.TempStyleNo!=t.StyleNo?(this.Style.ApplyTempStyle(t.StyleNo),this.FLastFormatParaNo=t.ParaNo,this.FItemFormatHeight=this.CalculateLineHeight(this.Style.TextStyles[t.StyleNo],this.Style.ParaStyles[t.ParaNo])):this.FLastFormatParaNo!=t.ParaNo&&(this.FLastFormatParaNo=t.ParaNo,this.FItemFormatHeight=this.CalculateLineHeight(this.Style.TextStyles[t.StyleNo],this.Style.ParaStyles[t.ParaNo]))}},{key:"FinishLine",value:function(t,e,i){for(var n=e,o=e;o>=0;o--)if(this.DrawItems[o].LineFirst){n=o;break}for(var r=-1,s=n;s<=e;s++)if(this.Items[this.DrawItems[s].ItemNo].Visible){r=s;break}var a=r>=0;if(!a)return!1;for(var l,h=this.DrawItems[e].rect.bottom,c=e-1;c>=n;c--)this.DrawItems[c].rect.bottom>h&&(h=this.DrawItems[c].rect.bottom);for(var u=e;u>=n;u--)this.DrawItems[u].rect.bottom=h;var f=this.Style.ParaStyles[this.Items[t].ParaNo];switch(f.AlignHorz){case dr:break;case yr:for(var d=e;d>=n;d--)this.DrawItems[d].rect.offset(i,0);break;case mr:l=Math.trunc(i/2);for(var m=e;m>=n;m--)this.DrawItems[m].rect.offset(l,0);break;case pr:case Sr:if(f.AlignHorz==pr){if(this.IsParaLastDrawItem(e))return a}else if(n==e&&this.Items[this.DrawItems[n].ItemNo].Length<2)return g=Math.trunc(i/2),this.DrawItems[n].rect.offset(g,0),a;for(var y,p,S,v=0,F=0,I=0,g=i,w=new Array(e-n+1),C=n;C<=e;C++)this.Items[this.DrawItems[C].ItemNo].Visible&&(this.GetDrawItemStyle(C)<cs.Null?y=this.Items[this.DrawItems[C].ItemNo].JustifySplit()&&n!=e&&C!=e?1:0:(y=this.GetJustifyCount(this.GetDrawItemText(C),null),C==e&&y>0&&y--),w[C-n]=y,v+=y);v>1&&(g=Math.trunc(i/v),I=i%v),w[0]>0&&(this.DrawItems[n].rect.width+=w[0]*g,I>0&&(I>(S=this.DrawItems[n].CharLen)?(this.DrawItems[n].rect.right+=S,I-=S):(this.DrawItems[n].rect.right+=I,I=0)));for(var k=n+1;k<=e;k++)this.Items[this.DrawItems[k].ItemNo].Visible?(p=this.DrawItems[k].width,w[k-n]>0?(F=w[k-n]*g,I>0&&(this.GetDrawItemStyle(k)<cs.Null?this.Items[this.DrawItems[k].ItemNo].JustifySplit()&&(F++,I--):I>(S=this.DrawItems[k].CharLen)?(F+=S,I-=S):(F+=I,I=0))):F=0,this.DrawItems[k].rect.left=this.DrawItems[k-1].rect.right,this.DrawItems[k].rect.right=this.DrawItems[k].rect.left+p+F):(this.DrawItems[k].rect.left=this.DrawItems[k-1].rect.right,this.DrawItems[k].rect.right=this.DrawItems[k].rect.left)}return a}},{key:"NewDrawItem",value:function(t,e,i,n,o,r,s){var a=new Cs;return a.ItemNo=t,a.CharOffs=e,a.CharLen=i,a.ParaFirst=o,a.LineFirst=r,a.rect.resetRect(n),s++,this.DrawItems.insert(s,a),1==e&&(this.Items[t].FirstDItemNo=s),s}},{key:"GetHeadTailBreak",value:function(t,e){if(e<1)return e;var i=t[e+1-1];return lp.PosCharHC(i,lp.DontLineFirstChar)>0?(e--,e=this.GetHeadTailBreak(t,e)):(i=t[e-1],lp.PosCharHC(i,lp.DontLineLastChar)>0&&(e--,e=this.GetHeadTailBreak(t,e))),e}},{key:"MatchBreak",value:function(t,e,i,n){switch(e){case gp.HZ:if(t==gp.ZM||t==gp.SZ||t==gp.HZ||t==gp.FH)return mp.Prev;break;case gp.ZW:if(t!=gp.ZW&&t!=gp.ZM&&t!=gp.SZ)return mp.Prev;break;case gp.ZM:if(t!=gp.ZM&&t!=gp.SZ)return mp.Prev;break;case gp.SZ:switch(t){case gp.ZM:case gp.SZ:break;case gp.FH:var o=i[n-1-1];if("¢"==o);else if("."!=o&&":"!=o&&"-"!=o&&"^"!=o&&"*"!=o&&"/"!=o)return mp.Prev;break;default:return mp.Prev}break;case gp.FH:switch(t){case gp.FH:break;case gp.SZ:var r=i[n-1];if("."!=r&&":"!=r&&"-"!=r&&"^"!=r&&"*"!=r&&"/"!=r)return mp.Prev;break;case gp.ZM:if(":"!=i[n-1])return mp.Prev;break;default:return mp.Prev}}return mp.None}},{key:"FindLineBreak",value:function(t,e,i,n){if((n=this.GetHeadTailBreak(t,n))<1)return n;if(e)return n;var o=lp.GetUnicodeCharType(t[n-1]),r=lp.GetUnicodeCharType(t[n+1-1]);if(this.MatchBreak(o,r,t,n+1)!=mp.Prev&&o!=gp.Break){for(var s,a=!1,l=n-1;l>=i;l--){if(s=lp.GetUnicodeCharType(t[l-1]),this.MatchBreak(s,o,t,l+1)==mp.Prev){n=l,a=!0;break}o=s}a||(n=0)}return n}},{key:"DoFormatRectItemToDrawItem",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){t.FormatToDrawItem(this,e);var d=o-l.x;return t.Width>d&&!c&&(this.FinishLine(e,u,d),l.x=i,l.y=this.DrawItems[u].rect.bottom,c=!0),h.left=l.x,h.top=l.y,h.right=h.left+t.Width,t.StyleNo==cs.Bullet?h.bottom=h.top+t.Height:h.bottom=h.top+t.Height+this.Style.LineSpaceMin,u=this.NewDrawItem(e,r,1,h,s,c,u),t.IsFormatDirty=!1,{pos:l,rect:h,lineFirst:c,drawItemNo:u,remainderWidth:o-h.right}}},{key:"_FormatBreakTextDrawItem",value:function(t,e,i,n,o,r,s,a){var l=this.DrawItems[n],h=this.Items[l.ItemNo],c=h.Text.length;this.CalcItemFormatHeigh(h);var u=this.Style.TempCanvas.textWidth(h.Text[c-1]);return l.CharLen=l.CharLen-1,l.rect.right=l.rect.right-u,s=i-l.rect.right,this.FinishLine(t,n,s),o.x=e,o.y=l.rect.bottom,r.left=o.x,r.top=o.y,r.right=r.left+u,r.bottom=r.top+this.FItemFormatHeight,n=this.NewDrawItem(l.ItemNo,c,1,r,!1,!0,n),o.x=r.right,{drawItemNo:n,point:o,rect:r,remainderWidth:s=i-r.right,paraFirst:!1}}},{key:"DoFormatTextItemToDrawItems",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f,d,m,y,p,S,v){var F,I,g,w=!1;if(m=d||y.x==l&&(0!=this.DrawItems[v].width||!this.DrawItems[v].LineFirst),I=0,g=u[n-1]-r,o<0)I=n;else if(2==this.Style.FormatVersion){w=!1;for(var C=n-1;C<=a-1;C++)if(u[C]-r>o){if(!w&&lp.PosCharHC(i[C],lp.LineSqueezeChar)>0&&u[C]-r-o>3){w=!0;continue}I=C+1;break}}else for(var k=n-1;k<=a-1;k++)if(u[k]-r>o){I=k+1;break}if(0==I)p.left=y.x,p.top=y.y,p.right=p.left+u[a-1]-r,p.bottom=p.top+this.FItemFormatHeight,v=this.NewDrawItem(s,e+n-1,a-n+1,p,d,m,v),d=!1,S=c-p.right;else if(I==n)if(g>c-l){if(p.left=y.x,p.top=y.y,p.right=p.left+u[a-1]-r,p.bottom=p.top+this.FItemFormatHeight,v=this.NewDrawItem(s,e+n-1,1,p,d,m,v),d=!1,S=c-p.right,this.FinishLine(s,v,S),y.x=l,y.y=this.DrawItems[v].rect.bottom,n<a){var P=this.DoFormatTextItemToDrawItems(t,e,i,n+1,c-y.x,u[n-1],s,a,l,h,c,u,f,d,m,y,p,S,v);d=P.paraFirst,m=P.lineFirst,y=P.pos,p=P.rect,S=P.remainderWidth,v=P.drawItemNo}}else if(lp.PosCharHC(i[n-1],lp.DontLineFirstChar)>0&&this.Items[s-1].StyleNo>cs.Null&&this.DrawItems[v].CharLen>1){var D=this._FormatBreakTextDrawItem(s,l,c,v,y,p,S,d);v=D.drawItemNo,y=D.point,p=D.rect,S=D.remainderWidth,d=D.paraFirst,this.CalcItemFormatHeigh(t);var b=this.DoFormatTextItemToDrawItems(t,e,i,n,c-y.x,r,s,a,l,h,c,u,f,d,m,y,p,S,v);d=b.paraFirst,m=b.lineFirst,y=b.pos,p=b.rect,S=b.remainderWidth,v=b.drawItemNo}else{S=o,this.FinishLine(s,v,S),y.x=l,y.y=this.DrawItems[v].rect.bottom;var R=this.DoFormatTextItemToDrawItems(t,e,i,n,c-y.x,r,s,a,l,h,c,u,f,d,m,y,p,S,v);d=R.paraFirst,m=R.lineFirst,y=R.pos,p=R.rect,S=R.remainderWidth,v=R.drawItemNo}else if(F=g>c-l?I:I-1,0==(F=this.FindLineBreak(i,f.BreakRough,n,F))&&!m&&y.x>l){S=o,this.FinishLine(s,v,S),y.x=l,y.y=this.DrawItems[v].rect.bottom;var _=this.DoFormatTextItemToDrawItems(t,e,i,n,c-y.x,r,s,a,l,h,c,u,f,d,m,y,p,S,v);d=_.paraFirst,m=_.lineFirst,y=_.pos,p=_.rect,S=_.remainderWidth,v=_.drawItemNo}else if(F<n&&(F=g>c-l?I:I-1),p.left=y.x,p.top=y.y,p.right=p.left+u[F-1]-r,p.bottom=p.top+this.FItemFormatHeight,v=this.NewDrawItem(s,e+n-1,F-n+1,p,d,m,v),d=!1,S=w?0:c-p.right,this.FinishLine(s,v,S),y.x=l,y.y=this.DrawItems[v].rect.bottom,F<a){var x=this.DoFormatTextItemToDrawItems(t,e,i,F+1,c-y.x,u[F-1],s,a,l,h,c,u,f,d,m,y,p,S,v);d=x.paraFirst,m=x.lineFirst,y=x.pos,p=x.rect,S=x.remainderWidth,v=x.drawItemNo}return{paraFirst:d,lineFirst:m,pos:y,rect:p,remainderWidth:S,drawItemNo:v}}},{key:"FormatItemToDrawItems",value:function(t,e,i,n,o,r,s){var a=!1,l=!1,h=null,c="",u=new U,f=0,d=this.Items[t],m=this.Style.ParaStyles[d.ParaNo];if(d.ParaFirst&&1==e?(a=!0,l=!0,r.x+=m.FirstIndentPix):(a=!1,(l=r.x==i)&&0==this.DrawItems[s].width&&this.DrawItems[s].LineFirst&&(l=!1)),d.Visible)if(d.StyleNo<cs.Null){h=d;var y=this.DoFormatRectItemToDrawItem(h,t,i,o,n,e,a,m,r,u,l,s,f);r=y.pos,u=y.rect,l=y.lineFirst,s=y.drawItemNo,f=y.remainderWidth,this.Style.ApplyTempStyle(cs.Null)}else if(this.CalcItemFormatHeigh(d),f=n-r.x,""==(c=1!=e?d.Text.substr(e-1,d.Length-e+1):d.Text)){if(lp.CHECKNULLITEM&&!d.ParaFirst)throw lp.HCS_EXCEPTION_NULLTEXT;u.left=r.x,u.top=r.y,u.right=u.left,u.bottom=u.top+this.FItemFormatHeight,a=!0,l=!0,s=this.NewDrawItem(t,e,0,u,a,l,s),a=!1}else{for(var p=c.length,S=new Array(p),v=null,F=p,I=0,g=0;F>this.FormatTextCut;){v=this.Style.TempCanvas.getTextExtentExPoint(c.substr(I,this.FormatTextCut),this.FormatTextCut);for(var w=0;w<=this.FormatTextCut-1;w++)S[I+w]=v[w]+g;F-=this.FormatTextCut,g=S[(I+=this.FormatTextCut)-1]}v=this.Style.TempCanvas.getTextExtentExPoint(c.substr(I,F),F);for(var C=0;C<=F-1;C++)S[I+C]=v[C]+g;var k=this.DoFormatTextItemToDrawItems(d,e,c,1,n-r.x,0,t,p,i,o,n,S,m,a,l,r,u,f,s);a=k.paraFirst,l=k.lineFirst,r=k.pos,u=k.rect,f=k.remainderWidth,s=k.drawItemNo}else u.left=r.x,u.top=r.y,u.right=u.left,u.bottom=u.top+this.FItemFormatHeight,s=this.NewDrawItem(t,e,d.Length,u,a,l,s);return t==this.Items.count-1?this.FinishLine(t,s,f):this.Items[t+1].ParaFirst?(this.FinishLine(t,s,f),r.x=0,r.y=this.DrawItems[s].rect.bottom):r.x=u.right,{pos:r,drawItemNo:s}}},{key:"FormatInit",value:function(){this.FFormatChange||(this.FFormatHeightChange=!1,this.FFormatStartDrawItemNo=-1),this.FFormatDrawItemCountChange=!1,this.FFormatStartTop=0,this.FFormatEndBottom=0,this.FLastFormatParaNo=cs.Null}},{key:"Clear",value:function(){this.FFormatChange=!1,this.FormatInit(),rc(hc(r.prototype),"Clear",this).call(this)}},{key:"ReSetSelectAndCaret",value:function(t){this.ReSetSelectAndCaretByOffset(t,this.GetItemOffsetAfter(t))}},{key:"ReSetSelectAndCaretByOffset",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e,0!=this.FFormatCount)return this.FCurStyleNo=this.Items[this.SelectInfo.StartItemNo].StyleNo,void(this.FCurParaNo=this.Items[this.SelectInfo.StartItemNo].ParaNo);var n=0;n=this.Items[t].StyleNo>cs.Null&&this.SelectInfo.StartItemOffset>this.Items[t].Length?this.Items[t].Length:e;var o=this.GetDrawItemNoByOffset(t,n);i&&o<this.DrawItems.count-1&&this.DrawItems[o+1].ItemNo==t&&this.DrawItems[o+1].CharOffs==n+1&&o++,this.CaretDrawItemNo=o}},{key:"GetFormatRange",value:function(t,e){var i=this.GetFormatRangeByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,t,e);return{firstDrawItemNo:i.firstDrawItemNo,lastItemNo:i.lastItemNo}}},{key:"GetFormatRangeByOffset",value:function(t,e,i,n){return 0!=this.FFormatCount?{firstDrawItemNo:i,lastItemNo:n}:{firstDrawItemNo:this.GetFormatFirstDrawItemByOffset(t,e),lastItemNo:this.GetParaLastItemNo(t)}}},{key:"GetFormatFirstDrawItemByOffset",value:function(t,e){var i=this.GetDrawItemNoByOffset(t,e);return this.GetFormatFirstDrawItem(i)}},{key:"GetFormatFirstDrawItem",value:function(t){var e=t;if(!this.DrawItems[e].ParaFirst)for(this.DrawItems[e].LineFirst&&e--;e>0&&!this.DrawItems[e].LineFirst;)e--;return e>0&&this.GetDrawItemStyle(e-1)<cs.Null&&this.Items[this.DrawItems[e-1].ItemNo].PageBreakCount>0&&e--,e}},{key:"FormatPrepare",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==this.FFormatCount){if(this.FormatInit(),t>0&&!this.DrawItems[t].LineFirst)throw"行中格式化必需从行首开始,否则会影响分散的计算!";var i=-1,n=-1;i=e<0?this.DrawItems[t].ItemNo:e;var o=this.GetItemLastDrawItemNo(i);this.DrawItems.MarkFormatDelete(t,o),t>0?(this.FFormatStartTop=this.DrawItems[t-1].rect.bottom,n=this.DrawItems[t].rect.top-this.FFormatStartTop):(this.FFormatStartTop=0,n=0);for(var r=t+1;r<=o;r++)this.DrawItems[r].LineFirst&&(n=n+this.DrawItems[r].rect.top-this.DrawItems[r-1].rect.bottom);this.FFormatEndBottom=0!=n?-1:this.DrawItems[o].rect.bottom-n}}},{key:"ReFormatData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0==this.FFormatCount){var o=-1;o=e<0?this.DrawItems[t].ItemNo:e;var r=this.DrawItems.count;this.FormatRange(t,o),this.FFormatDrawItemCountChange=this.DrawItems.count!=r;var s=!1,a=this.GetItemLastDrawItemNo(o);if((s=!!(this.Items[o].StyleNo<cs.Null&&this.Items[o].IsFormatDirty)||n||this.DrawItems[t].rect.top!=this.FFormatStartTop||this.DrawItems[a].rect.bottom!=this.FFormatEndBottom)||0!=i||this.FFormatDrawItemCountChange){this.FFormatChange=!0,o=-1;for(var l=0,h=0,c=a+1;c<=this.DrawItems.count-1;c++)(0!=i||this.FFormatDrawItemCountChange)&&(this.DrawItems[c].ItemNo=this.DrawItems[c].ItemNo+i,o!=this.DrawItems[c].ItemNo&&(o=this.DrawItems[c].ItemNo,this.Items[o].FirstDItemNo=c)),s&&(this.DrawItems[c].LineFirst&&(l=this.DrawItems[c-1].rect.bottom-this.DrawItems[c].rect.top),this.DrawItems[c].rect.offset(0,l),this.Items[this.DrawItems[c].ItemNo].StyleNo<cs.Null&&(h=this.Items[this.DrawItems[c].ItemNo].ClearFormatExtraHeight(),this.DrawItems[c].rect.bottom=this.DrawItems[c].rect.bottom-h))}this.FFormatChange&&this.FFormatHeightChange||(this.FFormatHeightChange=s)}}},{key:"ReFormat",value:function(){0==this.FFormatCount&&(this.DrawItems.clear(),this.InitializeField(),this.DrawItems.MarkFormatDelete(0,this.DrawItems.count-1),this.FormatInit(),this.FormatRange(0,this.Items.count-1),this.FFormatHeightChange=!0),this.SelectInfo.StartItemNo>=0&&this.SelectInfo.StartItemNo<this.Items.count&&this.SelectInfo.StartItemOffset>=0&&this.SelectInfo.StartItemOffset<=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo)?this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset):this.ReSetSelectAndCaretByOffset(0,0)}},{key:"ReFormatActiveParagraph",value:function(){if(this.SelectInfo.StartItemNo>=0){var t=-1,e=-1,i=this.GetParaItemRang(this.SelectInfo.StartItemNo,t,e);t=i.a,e=i.b,this.FormatPrepare(this.Items[t].FirstDItemNo,e),this.ReFormatData(this.Items[t].FirstDItemNo,e),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.ReSetSelectAndCaret(this.SelectInfo.StartItemNo)}}},{key:"ReFormatActiveItem",value:function(){if(!this.SelectExists()&&this.SelectInfo.StartItemNo>=0){var t=-1,e=-1,i=this.GetFormatRange(t,e);t=i.firstDrawItemNo,e=i.lastItemNo,this.FormatPrepare(t,e),this.Items[this.SelectInfo.StartItemNo].StyleNo<cs.Null&&this.Items[this.SelectInfo.StartItemNo].ReFormatActiveItem(),this.ReFormatData(t,e),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.SelectInfo.StartItemOffset>this.Items[this.SelectInfo.StartItemNo].Length&&this.ReSetSelectAndCaret(this.SelectInfo.StartItemNo)}}},{key:"ItemReFormatRequest",value:function(t){null!=this.OnItemReFormatRequest&&this.OnItemReFormatRequest(this,t)}},{key:"ItemReFormatResponse",value:function(t){this.FormatItem(t)}},{key:"ItemSetCaretRequest",value:function(t,e){t>=0&&(this.DisSelect(),this.ReSetSelectAndCaretByOffset(t,e),this.Style.UpdateInfoReCaret(!0),null!=this.OnItemSetCaretRequest&&this.OnItemSetCaretRequest(this,t,e))}},{key:"SetFormatHeightChange",value:function(){this.FFormatChange=!0}},{key:"GetDrawItemFormatTop",value:function(t){return this.DrawItems[t].rect.top}},{key:"Clone",value:function(t){rc(hc(r.prototype),"Clone",this).call(this,t),this.ReFormat()}},{key:"GetItemNo",value:function(t){for(var e=0;e<this.Items.count;e++)if(this.Items[e]===t)return e;return-1}},{key:"BeginFormat",value:function(){this.FFormatCount++}},{key:"EndFormat",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.FFormatCount>0&&this.FFormatCount--,0==this.FFormatCount&&t&&this.ReFormat()}},{key:"Width",get:function(){return this.FWidth},set:function(t){this.FWidth=t}},{key:"FormatStartDrawItemNo",get:function(){return this.FFormatStartDrawItemNo}},{key:"FormatHeightChange",get:function(){return this.FFormatHeightChange}},{key:"FormatDrawItemCountChange",get:function(){return this.FFormatDrawItemCountChange}},{key:"FormatChange",get:function(){return this.FFormatChange},set:function(t){this.FFormatChange=t}},{key:"FormatCount",get:function(){return this.FFormatCount}}])&&oc(e.prototype,i),n&&oc(e,n),r}(eh));function vc(t){return(vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fc(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ic(t,e)}function Ic(t,e){return(Ic=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=bc(t);if(e){var o=bc(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return wc(this,i)}}function wc(t,e){return!e||"object"!==vc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Cc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kc(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Pc(t,e,i){return e&&kc(t.prototype,e),i&&kc(t,i),t}function Dc(t,e,i){return(Dc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=bc(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function bc(t){return(bc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Rc=0,_c=1,xc=2,Ac=3,Tc=4,Oc=0,Nc=1,Bc=2,Ec=function(){function t(){Cc(this,t),this.FStyle=Rc,this.FStructState=Oc,this.FVersion=0,this.FColor=at.Black,this.Cursor=oe,this.FActive=!1,this.PointSize=5,this.FOnStructOver=null}return Pc(t,[{key:"PaintAnchor",value:function(t,e){}},{key:"SetActive",value:function(t){this.FActive!=t&&(this.FActive=t,t||(this.FStructState=Oc))}},{key:"SetColor",value:function(t){this.FColor!=t&&(this.FColor=t)}},{key:"Assign",value:function(t){this.FStyle=t.Style,this.FVersion=t.Version,this.FColor=t.Color}},{key:"MouseDown",value:function(t){return this.Active=!0,this.FActive}},{key:"MouseMove",value:function(t){return this.FActive}},{key:"MouseUp",value:function(t){return this.FActive}},{key:"KeyDown",value:function(t){return!1}},{key:"KeyPress",value:function(t){return!1}},{key:"KeyUp",value:function(t){return!1}},{key:"PaintTo",value:function(t,e,i){}},{key:"PointInClient",value:function(t,e){return this.ClientRect().pointInAt(t,e)}},{key:"ClientRect",value:function(){return U.CreateByBounds(0,0,0,0)}},{key:"SaveToStream",value:function(t){this.FStyle==Rc&&or.exception("HCShape保存失败,无效的样式值!"),t.writeByte(this.FStyle),t.writeByte(this.FVersion),lp.HCSaveColorToStream(t,this.FColor)}},{key:"LoadFromStream",value:function(t){this.FStyle=t.readByte(),this.FVersion=t.readByte(),this.FColor=lp.HCLoadColorFromStream(t)}},{key:"ToXml",value:function(e){Dc(bc(t.prototype),"ToXml",this).call(this,e)}},{key:"ParseXml",value:function(e){Dc(bc(t.prototype),"ParseXml",this).call(this,e)}},{key:"StructStart",value:function(){this.FStructState=Nc}},{key:"StructOver",value:function(){this.FStructState=Oc,null!=this.FOnStructOver&&this.FOnStructOver(this)}},{key:"Version",get:function(){return this.FVersion},set:function(t){this.FVersion=t}},{key:"StructState",get:function(){return this.FStructState},set:function(t){this.FStructState=t}},{key:"Style",get:function(){return this.FStyle},set:function(t){this.FStyle=t}},{key:"Active",get:function(){return this.FActive},set:function(t){this.SetActive(t)}},{key:"Color",get:function(){return this.FColor},set:function(t){this.SetColor(t)}},{key:"OnStructOver",get:function(){return this.FOnStructOver},set:function(t){this.FOnStructOver=t}}]),t}(),Mc=0,Lc=1,Gc=2,Hc=3,Uc=function(t){Fc(i,t);var e=gc(i);function i(){var t;return Cc(this,i),(t=e.call(this)).Style=_c,t.FStartPt=G.Create(0,0),t.FEndPt=G.Create(0,0),t.FWidth=1,t.FActiveOjb=Mc,t.FLineStyle=pt.Solid,t.FMousePt=G.Create(0,0),t}return Pc(i,[{key:"SetWidth",value:function(t){this.FWidth!=t&&(this.FWidth=t)}},{key:"SetLineStyle",value:function(t){this.FLineStyle!=t&&(this.FLineStyle=t)}},{key:"PaintAnchor",value:function(t,e){t.pen.color=at.Black,t.pen.width=1,t.pen.style=pt.Solid,t.brush.color=at.White,t.rectangleBounds(this.FStartPt.x+e.left-this.PointSize,this.FStartPt.y+e.top-this.PointSize,this.PointSize+this.PointSize,this.PointSize+this.PointSize),t.rectangleBounds(this.FEndPt.x+e.left-this.PointSize,this.FEndPt.y+e.top-this.PointSize,this.PointSize+this.PointSize,this.PointSize+this.PointSize)}},{key:"SetActive",value:function(t){Dc(bc(i.prototype),"SetActive",this).call(this,t),this.Active||(this.FActiveOjb=Mc)}},{key:"GetObjAt",value:function(t,e){var i=Mc;if(U.Create(this.FStartPt.x-this.PointSize,this.FStartPt.y-this.PointSize,this.FStartPt.x+this.PointSize,this.FStartPt.y+this.PointSize).pointInAt(t,e))i=Gc;else if(U.Create(this.FEndPt.x-this.PointSize,this.FEndPt.y-this.PointSize,this.FEndPt.x+this.PointSize,this.FEndPt.y+this.PointSize).pointInAt(t,e))i=Hc;else{var n=new Array(4);n[0]=G.Create(this.FStartPt.x-this.PointSize,this.FStartPt.y),n[1]=G.Create(this.FStartPt.x+this.PointSize,this.FStartPt.y),n[2]=G.Create(this.FEndPt.x+this.PointSize,this.FEndPt.y),n[3]=G.Create(this.FEndPt.x-this.PointSize,this.FEndPt.y),Dt.pointInPathAt(n,t,e)&&(i=Lc)}return i}},{key:"Assign",value:function(t){Dc(bc(i.prototype),"Assign",this).call(this,t),this.FStartPt.resetByPoint(t.FStartPt),this.FEndPt.resetByPoint(t.FEndPt)}},{key:"MouseDown",value:function(t){if(t.button!=ee)return!1;var e=!1;if(this.StructState!=Oc)this.StructState==Nc?(this.FStartPt.reset(t.x,t.y),this.FEndPt.reset(t.x,t.y),this.StructState=Bc):this.StructOver(),e=!0;else{var i=this.GetObjAt(t.x,t.y);this.FActiveOjb!=i?(this.FActiveOjb=i,this.Active=this.FActiveOjb!=Mc,e=this.Active):e=i!=Mc,e&&this.FActiveOjb==Lc&&this.FMousePt.reset(t.x,t.y)}return e}},{key:"MouseMove",value:function(t){if(this.StructState==Bc)return this.FEndPt.reset(t.x,t.y),!0;var e=!1;if(t.button!=ee||or.keyDownStates[Re]||this.FActiveOjb==Mc){var i=this.GetObjAt(t.x,t.y);!this.Active||i!=Gc&&i!=Hc?i!=Mc&&(this.Cursor=de):this.Cursor=se,e=i!=Mc}else switch(e=!0,this.FActiveOjb){case Lc:this.FStartPt.x=this.FStartPt.x+t.x-this.FMousePt.x,this.FStartPt.y=this.FStartPt.y+t.y-this.FMousePt.y,this.FEndPt.x=this.FEndPt.x+t.x-this.FMousePt.x,this.FEndPt.y=this.FEndPt.y+t.y-this.FMousePt.y,this.FMousePt.x=t.x,this.FMousePt.y=t.y;break;case Gc:this.FStartPt.x=t.x,this.FStartPt.y=t.y;break;case Hc:this.FEndPt.x=t.x,this.FEndPt.y=t.y}return e}},{key:"MouseUp",value:function(t){return!1}},{key:"PaintTo",value:function(t,e,i){t.pen.color=this.Color,t.pen.width=this.FWidth,t.pen.style=this.FLineStyle,t.drawLineDriect(this.FStartPt.x+e.left,this.FStartPt.y+e.top,this.FEndPt.x+e.left,this.FEndPt.y+e.top),!i.Print&&this.Active&&this.PaintAnchor(t,e)}},{key:"PointInClient",value:function(t,e){return this.GetObjAt(t,e)!=Mc}},{key:"ClientRect",value:function(){var t=new U;return this.FStartPt.x<this.FEndPt.x?(t.left=this.FStartPt.x,t.right=this.FEndPt.x):(t.left=this.FEndPt.x,t.right=this.FStartPt.x),this.FStartPt.y<this.FEndPt.y?(t.top=this.FStartPt.y,t.bottom=this.FEndPt.y):(t.top=this.FEndPt.y,t.bottom=this.FStartPt.y),t}},{key:"SaveToStream",value:function(t){Dc(bc(i.prototype),"SaveToStream",this).call(this,t),t.writeByte(this.FWidth),t.writeByte(this.FLineStyle),t.writeInt32(this.FStartPt.x),t.writeInt32(this.FStartPt.y),t.writeInt32(this.FEndPt.x),t.writeInt32(this.FEndPt.y)}},{key:"LoadFromStream",value:function(t){Dc(bc(i.prototype),"LoadFromStream",this).call(this,t),this.FWidth=t.readByte(),this.FLineStyle=t.readByte(),this.FStartPt.x=t.readInt32(),this.FStartPt.y=t.readInt32(),this.FEndPt.x=t.readInt32(),this.FEndPt.y=t.readInt32()}},{key:"ToXml",value:function(t){Dc(bc(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Dc(bc(i.prototype),"ParseXml",this).call(this,t)}},{key:"StartPt",get:function(){return this.FStartPt}},{key:"startPt",set:function(t){this.FStartPt=t}},{key:"EndPt",get:function(){return this.FEndPt}},{key:"endPt",set:function(t){this.FEndPt=t}},{key:"Width",get:function(){return this.FWidth},set:function(t){this.SetWidth(t)}},{key:"LineStyle",get:function(){return this.FLineStyle},set:function(t){this.SetLineStyle(t)}},{key:"ActiveObj",get:function(){return this.FActiveOjb}}],[{key:"Create",value:function(t,e){var n=new i;return n.FStartPt.reset(t.x,t.y),n.FEndPt.reset(e.x,e.y),n}}]),i}(Ec),Vc=function(t){Fc(i,t);var e=gc(i);function i(){var t;return Cc(this,i),(t=e.call(this)).Style=xc,t.FBackColor=lp.HCTransparentColor,t}return Pc(i,[{key:"GetObjAt",value:function(t,e){var i=Mc;if(U.Create(this.StartPt.x-this.PointSize,this.StartPt.y-this.PointSize,this.StartPt.x+this.PointSize,this.StartPt.y+this.PointSize).pointInAt(t,e))i=Gc;else if(U.Create(this.EndPt.x-this.PointSize,this.EndPt.y-this.PointSize,this.EndPt.x+this.PointSize,this.EndPt.y+this.PointSize).pointInAt(t,e))i=Hc;else{var n=this.ClientRect();n.inFlate(this.PointSize,this.PointSize),n.pointInAt(t,e)&&(n.inFlate(-this.PointSize-this.PointSize,-this.PointSize-this.PointSize),n.pointInAt(t,e)||(i=Lc))}return i}},{key:"PaintTo",value:function(t,e,i){t.pen.color=this.Color,t.pen.width=this.Width,t.pen.style=this.LineStyle,this.FBackColor==lp.HCTransparentColor&&(t.brush.style=Ft),t.rectangle(this.StartPt.x+e.left,this.StartPt.y+e.top,this.EndPt.x+e.left,this.EndPt.y+e.top),!i.Print&&this.Active&&this.PaintAnchor(t,e)}},{key:"BackColor",get:function(){return this.FBackColor},set:function(t){this.FBackColor=t}}]),i}(Uc),Wc=function(t){Fc(i,t);var e=gc(i);function i(){var t;return Cc(this,i),(t=e.call(this)).Style=Ac,t}return Pc(i,[{key:"GetObjAt",value:function(t,e){var i=Mc;if(U.Create(this.StartPt.x-this.PointSize,this.StartPt.y-this.PointSize,this.StartPt.x+this.PointSize,this.StartPt.y+this.PointSize).pointInAt(t,e))i=Gc;else if(U.Create(this.EndPt.x-this.PointSize,this.EndPt.y-this.PointSize,this.EndPt.x+this.PointSize,this.EndPt.y+this.PointSize).pointInAt(t,e))i=Hc;else{var n=this.ClientRect();n.inFlate(this.PointSize,this.PointSize),Dt.pointInEllipseRect(n,t,e)&&(n.inFlate(-this.PointSize-this.PointSize,-this.PointSize-this.PointSize),Dt.pointInEllipseRect(n,t,e)||(i=Lc))}return i}},{key:"PaintTo",value:function(t,e,i){t.pen.color=this.Color,t.pen.width=this.Width,t.pen.style=this.LineStyle,this.BackColor==lp.HCTransparentColor&&(t.brush.style=Ft),t.ellipseDriect(this.StartPt.x+e.left,this.StartPt.y+e.top,this.EndPt.x+e.left,this.EndPt.y+e.top),!i.Print&&this.Active&&this.PaintAnchor(t,e)}}]),i}(Vc),zc=function(t){Fc(i,t);var e=gc(i);function i(){var t;return Cc(this,i),(t=e.call(this)).Style=Tc,t.FWidth=1,t.FLineStyle=pt.Solid,t.FPoints=new V,t.FActivePointIndex=-1,t.FActiveLineIndex=-1,t.FMousePt=new G,t}return Pc(i,[{key:"OffsetPoints",value:function(t,e){for(var i=0;i<this.FPoints.count;i++)this.FPoints[i].offset(t,e)}},{key:"SetWidth",value:function(t){this.FWidth!=t&&(this.FWidth=t)}},{key:"SetLineStyle",value:function(t){this.FLineStyle!=t&&(this.FLineStyle=t)}},{key:"PaintAnchor",value:function(t,e){t.pen.color=at.Black,t.pen.width=1,t.pen.style=pt.Solid,t.brush.color=at.White;for(var i=0;i<this.FPoints.count;i++)t.rectangle(this.FPoints[i].x+e.left-this.PointSize,this.FPoints[i].y+e.top-this.PointSize,this.FPoints[i].x+e.left+this.PointSize,this.FPoints[i].y+e.top+this.PointSize);this.FActivePointIndex>=0&&(t.pen.color=at.Red,this.StructState==Bc&&(t.pen.style=pt.Dot),t.rectangle(this.FPoints[this.FActivePointIndex].x+e.left-this.PointSize,this.FPoints[this.FActivePointIndex].y+e.top-this.PointSize,this.FPoints[this.FActivePointIndex].x+e.left+this.PointSize,this.FPoints[this.FActivePointIndex].y+e.top+this.PointSize))}},{key:"SetActive",value:function(t){Dc(bc(i.prototype),"SetActive",this).call(this,t),this.Active||(this.FActivePointIndex=-1,this.FActiveLineIndex=-1)}},{key:"GetPointAt",value:function(t,e){for(var i=null,n=0;n<this.FPoints.count;n++)if(i=this.FPoints[n],U.Create(i.x-this.PointSize,i.y-this.PointSize,i.x+this.PointSize,i.y+this.PointSize).pointInAt(t,e))return n;return-1}},{key:"GetLineAt",value:function(t,e){for(var i=new Array(4),n=0;n<this.FPoints.count;n++)if(i[0]=new G(this.FPoints[n].x-this.PointSize,this.FPoints[n].y),i[1]=new G(this.FPoints[n].x+this.PointSize,this.FPoints[n].y),n==this.FPoints.count-1?(i[2]=new G(this.FPoints[0].x+this.PointSize,this.FPoints[0].y),i[3]=new G(this.FPoints[0].x-this.PointSize,this.FPoints[0].y)):(i[2]=new G(this.FPoints[n+1].x+this.PointSize,this.FPoints[n+1].y),i[3]=new G(this.FPoints[n+1].x-this.PointSize,this.FPoints[n+1].y)),Dt.pointInPathAt(i,t,e))return n;return-1}},{key:"Assign",value:function(t){Dc(bc(i.prototype),"Assign",this).call(this,t);var e=null;this.FPoints.Clear();for(var n=0;n<t.Points.count;n++)e=G.Create(t.Points[n].x,t.Points[n].y),this.FPoints.add(e)}},{key:"MouseDown",value:function(t){if(t.button==ie)return this.StructState==Bc&&this.StructOver(),!1;if(t.button!=ee)return!1;var e=null,i=!1;if(this.StructState!=Oc)this.StructState==Nc?(e=G.Create(t.x,t.y),this.FPoints.add(e),e=G.Create(t.x,t.y),this.FPoints.add(e),this.FActivePointIndex=this.FPoints.count-1,this.StructState=Bc):this.StructState==Bc?(e=G.Create(t.x,t.y),this.FPoints.add(e),this.FActivePointIndex=this.FPoints.count-1):this.StructOver(),i=!0;else{var n=this.GetPointAt(t.x,t.y);this.FActivePointIndex!=n?(this.FActivePointIndex=n,this.Active=this.FActivePointIndex>=0,i=this.Active):i=n>=0,i||(n=this.GetLineAt(t.x,t.y),this.FActiveLineIndex!=n?(this.FActiveLineIndex=n,this.Active=this.FActiveLineIndex>=0,i=this.Active):i=n>=0),i&&this.FMousePt.reset(t.x,t.y)}return i}},{key:"MouseMove",value:function(t){if(this.StructState==Bc)return this.FPoints[this.FActivePointIndex].reset(t.x,t.y),!0;if(t.button!=ee||or.keyDownStates[Re]){var e=this.GetPointAt(t.x,t.y);if(e>=0)return this.Cursor=se,!0;if((e=this.GetLineAt(t.x,t.y))>=0)return this.Cursor=de,!0}else{if(this.FActivePointIndex>=0)return this.FPoints[this.FActivePointIndex].reset(t.x,t.y),!0;if(this.FActiveLineIndex>=0)return this.OffsetPoints(t.x-this.FMousePt.x,t.y-this.FMousePt.y),this.FMousePt.reset(t.x,t.y),!0}return!1}},{key:"MouseUp",value:function(t){return!1}},{key:"KeyDown",value:function(t){return(t.keyCode==Pe||t.keyCode==Ge)&&this.StructState==Oc&&this.FActivePointIndex>=0&&this.FPoints.count>2&&(this.FPoints.removeAt(this.FActivePointIndex),this.FActivePointIndex=-1,!0)}},{key:"PaintTo",value:function(t,e,i){t.pen.color=this.Color,t.pen.width=this.FWidth,t.pen.style=this.FLineStyle,t.beginPath(),t.drawLineByPoints(this.FPoints),this.FPoints.count>1&&t.lineTo(this.FPoints[0].x+e.left,this.FPoints[0].y+e.top),t.paintPath(),!i.Print&&this.Active&&this.PaintAnchor(t,e)}},{key:"PointInClient",value:function(t,e){var i=this.GetPointAt(t,e);return i>=0||(i=this.GetLineAt(t,e))>=0}},{key:"StructOver",value:function(){this.FActivePointIndex=-1,this.FActiveLineIndex=-1,this.FPoints.count>2&&this.FPoints.removeAt(this.FPoints.count-1),Dc(bc(i.prototype),"StructOver",this).call(this)}},{key:"SaveToStream",value:function(t){Dc(bc(i.prototype),"SaveToStream",this).call(this,t),t.writeByte(this.FWidth),t.writeByte(this.FLineStyle),t.writeInt32(this.FPoints.count);for(var e=0;e<this.FPoints.count;e++)t.writeInt32(this.FPoints[e].x),t.writeInt32(this.FPoints[e].y)}},{key:"LoadFromStream",value:function(t){this.FPoints.clear(),Dc(bc(i.prototype),"LoadFromStream",this).call(this,t),this.FWidth=t.readByte(),this.FLineStyle=t.readByte();for(var e=t.readInt32(),n=0,o=0,r=null,s=0;s<e;s++)n=t.readInt32(),o=t.readInt32(),r=G.Create(n,o),this.FPoints.add(r)}},{key:"ToXml",value:function(t){Dc(bc(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Dc(bc(i.prototype),"ParseXml",this).call(this,t)}},{key:"Points",get:function(){return this.FPoints}}]),i}(Ec),jc=function(t){Fc(i,t);var e=gc(i);function i(){var t;return Cc(this,i),(t=e.call(this)).FActiveIndex=-1,t.FHotIndex=-1,t.FOperStyle=Rc,t.FOnStructOver=null,t}return Pc(i,[{key:"NewShape",value:function(t){var e=this,i=null;switch(t){case Rc:break;case _c:i=new Uc;break;case xc:i=new Vc;break;case Ac:i=new Wc;break;case Tc:i=new zc}return null!=i?(i.OnStructOver=function(t){e.DoShapeStructOver(t)},this.add(i),this.count-1):-1}},{key:"DoShapeStructOver",value:function(t){this.ActiveIndex=-1,null!=this.FOnStructOver&&this.FOnStructOver(t)}},{key:"SetOperStyle",value:function(t){this.FOperStyle!=t&&(this.ActiveIndex=-1,this.FOperStyle=t)}},{key:"SetActiveIndex",value:function(t){this.FActiveIndex!=t&&(this.FActiveIndex>=0&&(this[this.FActiveIndex].Active=!1),this.FActiveIndex=t,this.FActiveIndex>=0&&(this[this.FActiveIndex].Active=!0))}},{key:"MouseDown",value:function(t){var e=!1;if(this.FOperStyle!=Rc)this.FActiveIndex<0&&(this.ActiveIndex=this.NewShape(this.FOperStyle),this[this.FActiveIndex].StructStart()),this.FActiveIndex>=0&&(e=this[this.FActiveIndex].MouseDown(t));else{for(var i=-1,n=0;n<this.count;n++)if(this[n].PointInClient(t.x,t.y)&&this[n].MouseDown(t)){i=n,e=!0;break}i!=this.FActiveIndex&&(this.ActiveIndex=i,e=!0)}return e}},{key:"MouseMove",value:function(t){if(this.FActiveIndex>=0&&this[this.FActiveIndex].MouseMove(t))return this.FHotIndex=this.FActiveIndex,!0;this.FHotIndex=-1;for(var e=0;e<this.count;e++)if(this[e].PointInClient(t.x,t.y)&&this[e].MouseMove(t))return this.FHotIndex=e,!0;return!1}},{key:"MouseUp",value:function(t){for(var e=0;e<this.count;e++)if(this[e].MouseUp(t))return!0;return!1}},{key:"KeyDown",value:function(t){if(this.FActiveIndex>=0){if(this[this.FActiveIndex].KeyDown(t))return!0;if(t.keyCode==Pe||t.keyCode==Ge)return this.removeAt(this.FActiveIndex),this.FActiveIndex=-1,!0}return!1}},{key:"DisActive",value:function(){this.FOperStyle=Rc,this.FActiveIndex>=0&&(this[this.FActiveIndex].Active=!1)}},{key:"PaintTo",value:function(t,e,i){for(var n=0;n<this.count;n++)this[n].PaintTo(t,e,i)}},{key:"SaveToStream",value:function(t){t.writeInt32(this.count);for(var e=0;e<this.count;e++)this[e].SaveToStream(t)}},{key:"LoadFromStream",value:function(t){this.clear();for(var e=t.readInt32(),i=null,n=0;n<e;n++){switch(t.readByte()){case Rc:or.exception("HCShape读取失败,无效的样式值!");break;case _c:i=new Uc;break;case xc:i=new Vc;break;case Ac:i=new Wc;break;case Tc:i=new zc}t.position=t.position-1,i.LoadFromStream(t),this.add(i)}}},{key:"ToXml",value:function(t){Dc(bc(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Dc(bc(i.prototype),"ParseXml",this).call(this,t)}},{key:"OperStyle",get:function(){return this.FOperStyle},set:function(t){this.SetOperStyle(t)}},{key:"ActiveIndex",get:function(){return this.FActiveIndex},set:function(t){this.SetActiveIndex(t)}},{key:"HotIndex",get:function(){return this.FHotIndex}},{key:"OnStructOver",get:function(){return this.FOnStructOver},set:function(t){this.FOnStructOver=t}}]),i}(V);function Xc(t){return(Xc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kc(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Yc(t,e,i){return(Yc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Qc(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Jc(t,e){return(Jc=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Zc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Qc(t);if(e){var o=Qc(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return qc(this,i)}}function qc(t,e){return!e||"object"!==Xc(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Qc(t){return(Qc=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jc(t,e)}(r,t);var e,i,n,o=Zc(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).FImage=null,e.StyleNo=cs.Image,e.FShapeManager=new jc,e.FEmpty=!0,e.Clear(),e}return e=r,n=[{key:"Create",value:function(t,e,i){var n=new r(t);return n.Width=e,n.Height=i,n.FCanResize=!0,n.FGripSize=8,n}}],(i=[{key:"GetWidth",value:function(){var t=Yc(Qc(r.prototype),"GetWidth",this).call(this);return 0==t&&(t=this.FImage.width),t}},{key:"GetHeight",value:function(){var t=Yc(Qc(r.prototype),"GetHeight",this).call(this);return 0==t&&(t=this.FImage.height),t}},{key:"DoPaint",value:function(t,e,i,n,o,s,a,l){this.FImage.width!=this.Width||this.FImage.height!=this.Height?a.drawImageRect(e,this.FImage.image):a.drawImage(e.left,e.top,this.FImage.image),this.FEmpty&&(a.pen.style=pt.Solid,a.pen.color=at.Black,a.pen.width=1,a.rectangleRect(e)),this.FShapeManager.PaintTo(a,e,l),Yc(Qc(r.prototype),"DoPaint",this).call(this,t,e,i,n,s,s,a,l)}},{key:"Assign",value:function(t){Yc(Qc(r.prototype),"Assign",this).call(this,t),this.FImage.assign(t.Image),this.FEmpty=t.Empty}},{key:"PaintTop",value:function(t){if(this.Resizing){t.save();try{t.alpha=.5,t.drawImageRect(this.ResizeRect,this.FImage.image)}finally{t.restore()}}Yc(Qc(r.prototype),"PaintTop",this).call(this,t)}},{key:"Clear",value:function(){var t=this;this.FImage=$i.Create(this.Width,this.Height),this.FImage.onImageLoaded=function(){t.OwnerData.Style.InvalidateRect(null)},this.FEmpty=!0}},{key:"RestrainSize",value:function(t,e){if(this.Width>t){var i=this.Width/t;this.Width=t,this.Height=Math.round(this.Height/i)}if(this.Height>e){var n=this.Height/e;this.Height=e,this.Width=Math.round(this.Width/n)}}},{key:"LoadGraphicFile",value:function(t,e){var i=this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=new FileReader;o.readAsDataURL(t),o.onload=function(t){i.FImage=new $i,i.FImage.onImageLoaded=function(){n&&(i.Width=i.FImage.width,i.Height=i.FImage.height),i.FEmpty=!1,e(!0)},i.FImage.src=o.result},o.onerror=function(t){e(!1)}}},{key:"LoadGraphicStream",value:function(t){var e=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];null==this.FImage&&(this.FImage=new $i);var n=t.buffer;this.FImage.onImageLoaded=function(){i&&(e.Width=e.FImage.width,e.Height=e.FImage.height),e.FEmpty=!1},this.FImage.src="data:image/png;base64,"+n.toBase64()}},{key:"LoadFromBase64",value:function(t,e,i){var n=this;null==this.FImage&&(this.FImage=new $i),this.FImage.onImageLoaded=function(){n.Width=n.FImage.width,n.Height=n.FImage.height,n.FEmpty=!1,i&&i()},t?0!=t.indexOf("data:")?this.FImage.src="data:image/"+e+";base64,"+t:this.FImage.src=t:(this.Clear(),i&&i())}},{key:"SaveToStreamRange",value:function(t,e,i){if(Yc(Qc(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),""!=this.FImage.src){var n=this.FImage.src.split(","),o=b.fromBase64(n[1]);t.writeUInt32(o.length),o.length>0&&t.writeBuffer(o)}else t.writeUInt32(0);this.FShapeManager.SaveToStream(t)}},{key:"LoadFromStream",value:function(t,e,i){var n=this;Yc(Qc(r.prototype),"LoadFromStream",this).call(this,t,e,i);var o=t.readUInt32();if(o>0){null==this.FImage&&(this.FImage=new $i);var s=t.readBuffer(o);this.FImage.src="data:image/png;base64,"+b.fromBuffer(s).toBase64(),this.FEmpty=!1}else this.FImage=$i.Create(this.Width,this.Height),this.FEmpty=!0;this.FImage.onImageLoaded=function(){n.OwnerData.Style.InvalidateRect(null)},i>26&&this.FShapeManager.LoadFromStream(t)}},{key:"ToHtml",value:function(){return Yc(Qc(r.prototype),"ToHtml",this).call(this)}},{key:"ToXml",value:function(t){Yc(Qc(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Yc(Qc(r.prototype),"ParseXml",this).call(this,t)}},{key:"RecoverOrigianlSize",value:function(){this.Width=this.FImage.width,this.Height=this.FImage.height}},{key:"Image",get:function(){return this.FImage},set:function(t){this.FImage=t}},{key:"Empty",get:function(){return this.FEmpty}},{key:"ShapeManager",get:function(){return this.FShapeManager}}])&&Kc(e.prototype,i),n&&Kc(e,n),r}(rl);function tu(t){return(tu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eu(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function iu(t,e){return(iu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function nu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=ru(t);if(e){var o=ru(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ou(this,i)}}function ou(t,e){return!e||"object"!==tu(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ru(t){return(ru=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var su=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&iu(t,e)}(r,t);var e,i,n,o=nu(r);function r(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).StyleNo=cs.Tab;var i=t.Style.TempCanvas.textMetric("荆通");return e.Width=i.width,e.Height=i.height,e}return e=r,(i=[{key:"GetOffsetAt",value:function(t){return t<this.Width/2?lp.OffsetBefor:lp.OffsetAfter}},{key:"JustifySplit",value:function(){return!1}}])&&eu(e.prototype,i),n&&eu(e,n),r}(Ya);function au(t){return(au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lu(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function hu(t,e,i){return(hu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=du(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function cu(t,e){return(cu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function uu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=du(t);if(e){var o=du(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return fu(this,i)}}function fu(t,e){return!e||"object"!==au(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function du(t){return(du=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var mu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&cu(t,e)}(r,t);var e,i,n,o=uu(r);function r(t,e,i){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(n=o.call(this,t)).StyleNo=cs.Line,n.FLineHeight=1,n.Width=e,n.Height=i,n.FLineStyle=pt.Solid,n}return e=r,(i=[{key:"GetOffsetAt",value:function(t){return t<this.Width/2?lp.OffsetBefor:lp.OffsetAfter}},{key:"FormatToDrawItem",value:function(t,e){}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){s.pen.width=this.FLineHeight,s.pen.style=this.FLineStyle,s.pen.color=at.Black;var l=Math.trunc((e.top+e.bottom)/2);s.drawLineDriect(e.left,l,e.right,l)}},{key:"Assign",value:function(t){hu(du(r.prototype),"Assign",this).call(this,t),this.FLineHeight=t.LineHeight,this.FLineStyle=t.FLineStyle}},{key:"SaveToStreamRange",value:function(t,e,i){hu(du(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),t.writeByte(this.FLineHeight),t.writeByte(this.FLineStyle)}},{key:"LoadFromStream",value:function(t,e,i){hu(du(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FLineHeight=t.readByte(),this.FLineStyle=t.readByte()}},{key:"ToXml",value:function(t){hu(du(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){hu(du(r.prototype),"ParseXml",this).call(this,t)}},{key:"LineStyle",get:function(){return this.FLineStyle},set:function(t){this.FLineStyle=t}},{key:"LineHeight",get:function(){return this.FLineHeight},set:function(t){this.FLineHeight=t}}])&&lu(e.prototype,i),n&&lu(e,n),r}(Wa);function yu(t){return(yu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pu(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Su(t,e,i){return(Su="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=gu(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function vu(t,e){return(vu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Fu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=gu(t);if(e){var o=gu(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Iu(this,i)}}function Iu(t,e){return!e||"object"!==yu(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function gu(t){return(gu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var wu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&vu(t,e)}(r,t);var e,i,n,o=Fu(r);function r(t,e,i){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(n=o.call(this,t)).StyleNo=cs.Fraction,n.FPadding=5,n.FActiveArea=up.None,n.FCaretOffset=-1,n.FLineHide=!1,n.FTopText=e,n.FBottomText=i,n.FTopRect=new U,n.FBottomRect=new U,n.FMouseLBDowning=!1,n.FOutSelectInto=!1,n.FActiveArea=up.None,n.FMouseMoveArea=up.None,n}return e=r,(i=[{key:"FormatToDrawItem",value:function(t,e){var i=t.Style;i.ApplyTempStyle(this.TextStyleNo);var n=i.TextStyles[this.TextStyleNo].FontHeight,o=Math.max(i.TempCanvas.textWidth(this.FTopText),this.FPadding),r=Math.max(i.TempCanvas.textWidth(this.FBottomText),this.FPadding);this.Width=o>r?o+4*this.FPadding:r+4*this.FPadding,this.Height=2*n+4*this.FPadding,this.FTopRect.resetBounds(this.FPadding+Math.trunc((this.Width-this.FPadding-this.FPadding-o)/2),this.FPadding,o,n),this.FBottomRect.resetBounds(this.FPadding+Math.trunc((this.Width-this.FPadding-this.FPadding-r)/2),this.Height-this.FPadding-n,r,n)}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){if(this.Active&&!a.Print&&(s.brush.color=lp.clBtnFace,s.fillRect(e)),this.FLineHide||(s.pen.color=at.Black,s.drawLineDriect(e.left+this.FPadding,e.top+this.FTopRect.bottom+this.FPadding,e.left+this.Width-this.FPadding,e.top+this.FTopRect.bottom+this.FPadding)),!a.Print){var l=new U;this.FActiveArea!=up.None&&(this.FActiveArea==up.Top?l.resetRect(this.FTopRect):this.FActiveArea==up.Bottom&&l.resetRect(this.FBottomRect),l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=at.Blue,s.rectangleRect(l)),this.FMouseMoveArea!=up.None&&this.FMouseMoveArea!=this.FActiveArea&&(this.FMouseMoveArea==up.Top?l.resetRect(this.FTopRect):this.FMouseMoveArea==up.Bottom&&l.resetRect(this.FBottomRect),l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=lp.clMedGray,s.rectangleRect(l))}t.TextStyles[this.TextStyleNo].ApplyStyle(s,a.ScaleY/a.Zoom),s.textOut(e.left+this.FTopRect.left,e.top+this.FTopRect.top,this.FTopText),s.textOut(e.left+this.FBottomRect.left,e.top+this.FBottomRect.top,this.FBottomText)}},{key:"GetOffsetAt",value:function(t){return this.FOutSelectInto?Su(gu(r.prototype),"GetOffsetAt",this).call(this,t):t<=0?lp.OffsetBefor:t>=this.Width?lp.OffsetAfter:lp.OffsetInner}},{key:"SetActive",value:function(t){Su(gu(r.prototype),"SetActive",this).call(this,t),t||(this.FActiveArea=up.None)}},{key:"MouseLeave",value:function(){Su(gu(r.prototype),"MouseLeave",this).call(this),this.FMouseMoveArea=up.None}},{key:"MouseDown",value:function(t){var e=Su(gu(r.prototype),"MouseDown",this).call(this,t);this.FMouseLBDowning=t.button==ee&&!or.keyDownStates[Re],this.FOutSelectInto=!1,this.FMouseMoveArea!=this.FActiveArea&&(this.FActiveArea=this.FMouseMoveArea,this.OwnerData.Style.UpdateInfoReCaret());var i="",n=0;this.FActiveArea==up.Top?(i=this.FTopText,n=t.x-this.FTopRect.left):this.FActiveArea==up.Bottom&&(i=this.FBottomText,n=t.x-this.FBottomRect.left);var o=-1;return this.FActiveArea!=up.None&&(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),o=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,i,n)),o!=this.FCaretOffset&&(this.FCaretOffset=o,this.OwnerData.Style.UpdateInfoReCaret()),e}},{key:"MouseMove",value:function(t){if(this.FMouseLBDowning||t.button!=ee||or.keyDownStates[Re]||(this.FOutSelectInto=!0),this.FOutSelectInto)this.FMouseMoveArea=up.None;else{var e=this.GetExpressArea(t.x,t.y);e!=this.FMouseMoveArea&&(this.FMouseMoveArea=e,this.OwnerData.Style.UpdateInfoRePaint())}return Su(gu(r.prototype),"MouseMove",this).call(this,t)}},{key:"MouseUp",value:function(t){return this.FMouseLBDowning=!1,this.FOutSelectInto=!1,Su(gu(r.prototype),"MouseUp",this).call(this,t)}},{key:"WantKeyDown",value:function(t){return!0}},{key:"KeyDown",value:function(t){switch(t.keyCode){case Pe:this.FActiveArea==up.Top?this.FCaretOffset>0&&(this.FTopText=C.stringDelete(this.FTopText,this.FCaretOffset-1,1),this.FCaretOffset--):this.FActiveArea==up.Bottom&&this.FCaretOffset>0&&(this.FBottomText=C.stringDelete(this.FBottomText,this.FCaretOffset-1,1),this.FCaretOffset--),this.FormatDirty();break;case Be:this.FCaretOffset>0&&this.FCaretOffset--;break;case Me:var e="";this.FActiveArea==up.Top?e=this.FTopText:this.FActiveArea==up.Bottom&&(e=this.FBottomText),this.FCaretOffset<e.length&&this.FCaretOffset++;break;case Ge:this.FActiveArea==up.Top?this.FCaretOffset<this.FTopText.length&&(this.FTopText=C.stringDelete(this.FTopText,this.FCaretOffset,1)):this.FActiveArea==up.Bottom&&this.FCaretOffset<this.FBottomText.length&&(this.FBottomText=C.stringDelete(this.FBottomText,this.FCaretOffset,1)),this.FormatDirty();break;case Ne:this.FCaretOffset=0;break;case Oe:this.FActiveArea==up.Top?this.FCaretOffset=this.FTopText.length:this.FActiveArea==up.Bottom&&(this.FCaretOffset=this.FBottomText.length)}}},{key:"KeyPress",value:function(t){if(this.FActiveArea==up.None)return 0;this.InsertText(String.fromCharCode(t))}},{key:"InsertText",value:function(t){return this.FActiveArea!=up.None&&(this.FActiveArea==up.Top?this.FTopText=C.stringInsert(this.FTopText,this.FCaretOffset,t):this.FActiveArea==up.Bottom&&(this.FBottomText=C.stringInsert(this.FBottomText,this.FCaretOffset,t)),this.FCaretOffset+=t.length,this.FormatDirty(),!0)}},{key:"GetCaretInfo",value:function(t){this.FActiveArea!=up.None&&this.FCaretOffset>=0?(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),this.FActiveArea==up.Top?(this.FCaretOffset<0&&(this.FCaretOffset=0),t.Height=this.FTopRect.bottom-this.FTopRect.top,t.X=this.FTopRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FTopText.substr(0,this.FCaretOffset)),t.Y=this.FTopRect.top):this.FActiveArea==up.Bottom&&(this.FCaretOffset<0&&(this.FCaretOffset=0),t.Height=this.FBottomRect.bottom-this.FBottomRect.top,t.X=this.FBottomRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FBottomText.substr(0,this.FCaretOffset)),t.Y=this.FBottomRect.top)):t.Visible=!1}},{key:"GetExpressArea",value:function(t,e){return this.FTopRect.pointInAt(t,e)?up.Top:this.FBottomRect.pointInAt(t,e)?up.Bottom:up.None}},{key:"Assign",value:function(t){this.Assign(t),this.FTopText=t.TopText,this.FBottomText=t.BottomText}},{key:"SaveToStreamRange",value:function(t,e,i){Su(gu(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FTopText),lp.HCSaveTextToStream(t,this.FBottomText)}},{key:"LoadFromStream",value:function(t,e,i){Su(gu(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FTopText=lp.HCLoadTextFromStream(t,i),this.FBottomText=lp.HCLoadTextFromStream(t,i)}},{key:"ToXml",value:function(t){Su(gu(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Su(gu(r.prototype),"ParseXml",this).call(this,t)}},{key:"TopRect",get:function(){return this.FTopRect},set:function(t){this.FTopRect=t}},{key:"BottomRect",get:function(){return this.FBottomRect},set:function(t){this.FBottomRect=t}},{key:"Padding",get:function(){return this.FPadding}},{key:"LineHide",get:function(){return this.FLineHide},set:function(t){this.FLineHide=t}},{key:"TopText",get:function(){return this.FTopText},set:function(t){this.FTopText=t}},{key:"BottomText",get:function(){return this.FBottomText},set:function(t){this.FBottomText=t}},{key:"ActiveArea",get:function(){return this.FActiveArea}}])&&pu(e.prototype,i),n&&pu(e,n),r}(Ya);function Cu(t){return(Cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ku(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Pu(t,e,i){return(Pu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_u(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Du(t,e){return(Du=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function bu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=_u(t);if(e){var o=_u(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ru(this,i)}}function Ru(t,e){return!e||"object"!==Cu(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function _u(t){return(_u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var xu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Du(t,e)}(r,t);var e,i,n,o=bu(r);function r(t,e,i,n,s){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(a=o.call(this,t,i,s)).StyleNo=cs.Express,a.FLeftText=e,a.FRightText=n,a.FLeftRect=new U,a.FRightRect=new U,a}return e=r,(i=[{key:"FormatToDrawItem",value:function(t,e){var i=t.Style;i.ApplyTempStyle(this.TextStyleNo);var n=i.TempCanvas.textHeight("H"),o=Math.max(i.TempCanvas.textWidth(this.FLeftText),this.Padding),r=Math.max(i.TempCanvas.textWidth(this.TopText),this.Padding),s=Math.max(i.TempCanvas.textWidth(this.FRightText),this.Padding),a=Math.max(i.TempCanvas.textWidth(this.BottomText),this.Padding);this.Width=r>a?o+r+s+6*this.Padding:o+a+s+6*this.Padding,this.Height=2*n+4*this.Padding,this.FLeftRect.resetBounds(this.Padding,Math.trunc((this.Height-n)/2),o,n),this.FRightRect.resetBounds(this.Width-this.Padding-s,Math.trunc((this.Height-n)/2),s,n),this.TopRect.resetBounds(this.FLeftRect.right+this.Padding+Math.trunc((this.FRightRect.left-this.Padding-(this.FLeftRect.right+this.Padding)-r)/2),this.Padding,r,n),this.BottomRect.resetBounds(this.FLeftRect.right+this.Padding+Math.trunc((this.FRightRect.left-this.Padding-(this.FLeftRect.right+this.Padding)-a)/2),this.Height-this.Padding-n,a,n)}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){if(this.Active&&!a.Print&&(s.brush.color=lp.clBtnFace,s.fillRect(e)),s.pen.color=at.Black,s.drawLineDriect(e.left+this.FLeftRect.right+this.Padding,e.top+this.TopRect.bottom+this.Padding,e.left+this.FRightRect.left-this.Padding,e.top+this.TopRect.bottom+this.Padding),!a.Print){var l=new U;if(this.FActiveArea!=up.None){switch(this.FActiveArea){case up.Left:l.resetRect(this.FLeftRect);break;case up.Top:l.resetRect(this.TopRect);break;case up.Right:l.resetRect(this.FRightRect);break;case up.Bottom:l.resetRect(this.BottomRect)}l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=at.Blue,s.rectangleRect(l)}if(this.FMouseMoveArea!=up.None&&this.FMouseMoveArea!=this.FActiveArea){switch(this.FMouseMoveArea){case up.Left:l.resetRect(this.FLeftRect);break;case up.Top:l.resetRect(this.TopRect);break;case up.Right:l.resetRect(this.FRightRect);break;case up.Bottom:l.resetRect(this.BottomRect)}l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=lp.clMedGray,s.rectangleRect(l)}}t.TextStyles[this.TextStyleNo].ApplyStyle(s,a.ScaleY/a.Zoom),s.textOut(e.left+this.FLeftRect.left,e.top+this.FLeftRect.top,this.FLeftText),s.textOut(e.left+this.TopRect.left,e.top+this.TopRect.top,this.TopText),s.textOut(e.left+this.FRightRect.left,e.top+this.FRightRect.top,this.FRightText),s.textOut(e.left+this.BottomRect.left,e.top+this.BottomRect.top,this.BottomText)}},{key:"MouseDown",value:function(t){var e=Pu(_u(r.prototype),"MouseDown",this).call(this,t);this.FMouseLBDowning=t.button==ee&&!or.keyDownStates[Re],this.FOutSelectInto=!1,this.FMouseMoveArea!=this.FActiveArea&&(this.FActiveArea=this.FMouseMoveArea,this.OwnerData.Style.UpdateInfoReCaret());var i="",n=0;switch(this.FActiveArea){case up.Left:i=this.FLeftText,n=t.x-this.FLeftRect.left;break;case up.Top:i=this.TopText,n=t.x-this.TopRect.left;break;case up.Right:i=this.FRightText,n=t.x-this.FRightRect.left;break;case up.Bottom:i=this.BottomText,n=t.x-this.BottomRect.left}var o=0;return this.FActiveArea!=up.None?(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),o=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,i,n)):o=-1,o!=this.FCaretOffset&&(this.FCaretOffset=o,this.OwnerData.Style.UpdateInfoReCaret()),e}},{key:"KeyDown",value:function(t){if(this.FActiveArea==up.Left||this.FActiveArea==up.Right)switch(t.keyCode){case Pe:this.FActiveArea==up.Left?this.FCaretOffset>0&&(this.FLeftText=C.stringDelete(this.FLeftText,this.FCaretOffset-1,1),this.FCaretOffset--):this.FCaretOffset>0&&(this.FRightText=C.stringDelete(this.FRightText,this.FCaretOffset-1,1),this.FCaretOffset--),this.FormatDirty();break;case Be:this.FCaretOffset>0&&this.FCaretOffset--;break;case Me:var e=this.FRightText;this.FActiveArea==up.Left&&(e=this.FLeftText),this.FCaretOffset<e.length&&this.FCaretOffset++;break;case Ge:this.FActiveArea==up.Left?this.FCaretOffset<this.FLeftText.length&&(this.FLeftText=C.stringDelete(this.FLeftText,this.FCaretOffset,1)):this.FCaretOffset<this.FRightText.length&&(this.FRightText=C.stringDelete(this.FRightText,this.FCaretOffset,1)),this.FormatDirty();break;case Ne:this.FCaretOffset=0;break;case Oe:this.FActiveArea==up.Left?this.FCaretOffset=this.FLeftText.length:this.FCaretOffset=this.FRightText.length}else Pu(_u(r.prototype),"KeyDown",this).call(this,t)}},{key:"GetExpressArea",value:function(t,e){var i=Pu(_u(r.prototype),"GetExpressArea",this).call(this,t,e);return i==up.None?this.FLeftRect.pointInAt(t,e)?up.Left:this.FRightRect.pointInAt(t,e)?up.Right:i:i}},{key:"InsertText",value:function(t){if(this.FActiveArea==up.None)return!1;switch(this.FActiveArea){case up.Left:return this.FLeftText=C.stringInsert(this.FLeftText,this.FCaretOffset,t),this.FCaretOffset+=t.length,this.FormatDirty(),!0;case up.Right:return this.FRightText=C.stringInsert(this.FRightText,this.FCaretOffset,t),this.FCaretOffset+=t.length,this.FormatDirty(),!0;default:return Pu(_u(r.prototype),"InsertText",this).call(this,t)}}},{key:"GetCaretInfo",value:function(t){if(this.FActiveArea!=up.None)switch(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),this.FActiveArea){case up.Left:this.FCaretOffset<0&&(this.FCaretOffset=0),t.Height=this.FLeftRect.bottom-this.FLeftRect.top,t.X=this.FLeftRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FLeftText.substr(0,this.FCaretOffset)),t.Y=this.FLeftRect.top;break;case up.Top:this.FCaretOffset<0&&(this.FCaretOffset=0),t.Height=this.TopRect.bottom-this.TopRect.top,t.X=this.TopRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.TopText.substr(0,this.FCaretOffset)),t.Y=this.TopRect.top;break;case up.Right:this.FCaretOffset<0&&(this.FCaretOffset=0),t.Height=this.FRightRect.bottom-this.FRightRect.top,t.X=this.FRightRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FRightText.substr(0,this.FCaretOffset)),t.Y=this.FRightRect.top;break;case up.Bottom:this.FCaretOffset<0&&(this.FCaretOffset=0),t.Height=this.BottomRect.bottom-this.BottomRect.top,t.X=this.BottomRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.BottomText.substr(0,this.FCaretOffset)),t.Y=this.BottomRect.top}else t.Visible=!1}},{key:"Assign",value:function(t){Pu(_u(r.prototype),"Assign",this).call(this,t),this.FLeftText=t.LeftText,this.FRightText=t.RightText}},{key:"SaveToStreamRange",value:function(t,e,i){Pu(_u(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FLeftText),lp.HCSaveTextToStream(t,this.FRightText)}},{key:"LoadFromStream",value:function(t,e,i){Pu(_u(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FLeftText=lp.HCLoadTextFromStream(t,i),this.FRightText=lp.HCLoadTextFromStream(t,i)}},{key:"ToXml",value:function(t){Pu(_u(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Pu(_u(r.prototype),"ParseXml",this).call(this,t)}},{key:"LeftRect",get:function(){return this.FLeftRect},set:function(t){this.FLeftRect=t}},{key:"RightRect",get:function(){return this.FRightRect},set:function(t){this.FRightRect=t}},{key:"LeftText",get:function(){return this.FLeftText},set:function(t){this.FLeftText=t}},{key:"RightText",get:function(){return this.FRightText},set:function(t){this.FRightText=t,this.FActiveArea==up.Right&&this.FCaretOffset>this.FRightText.length&&(this.FCaretOffset=this.FRightText.length)}}])&&ku(e.prototype,i),n&&ku(e,n),r}(wu);function Au(t){return(Au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tu(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ou(t,e,i){return(Ou="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mu(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Nu(t,e){return(Nu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Bu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Mu(t);if(e){var o=Mu(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Eu(this,i)}}function Eu(t,e){return!e||"object"!==Au(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Mu(t){return(Mu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Nu(t,e)}(r,t);var e,i,n,o=Bu(r);function r(t,e,i){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(n=o.call(this,t)).StyleNo=cs.CheckBox,n.FChecked=i,n.FText=e,n.FPaddingLeft=2,n.FItemHit=!1,n.BoxRight=!1,n.CheckBoxSize=14,n.OnCheckChanged=null,n}return e=r,(i=[{key:"GetBoxRect",value:function(){return this.BoxRight?U.CreateByBounds(this.Width-this.FPaddingLeft-this.CheckBoxSize,Math.trunc((this.Height-this.CheckBoxSize)/2),this.CheckBoxSize,this.CheckBoxSize):U.CreateByBounds(this.FPaddingLeft,Math.trunc((this.Height-this.CheckBoxSize)/2),this.CheckBoxSize,this.CheckBoxSize)}},{key:"SetChecked",value:function(t){this.FChecked!=t&&(this.FChecked=t,this.DoChange(),null!=this.OnCheckChanged&&this.OnCheckChanged(this))}},{key:"DoSetChecked",value:function(t){this.SetChecked(t)}},{key:"GetText",value:function(){return this.FText}},{key:"SetText",value:function(t){this.FText=t}},{key:"MouseMove",value:function(t){return lp.GCursor=re,Ou(Mu(r.prototype),"MouseMove",this).call(this,t)}},{key:"MouseUp",value:function(t){if(this.Enabled&&this.OwnerData.CanEdit()&&!this.OwnerData.Style.UpdateInfo.Selecting)if(this.FItemHit){this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo);var e=this.OwnerData.Style.TempCanvas.textMetric(this.FText);U.CreateByBounds(this.FPaddingLeft,0,this.FPaddingLeft+this.CheckBoxSize+this.FPaddingLeft+e.width,e.height).pointInAt(t.x,t.y)&&this.DoSetChecked(!this.FChecked)}else this.GetBoxRect().pointInAt(t.x,t.y)&&this.DoSetChecked(!this.FChecked);return Ou(Mu(r.prototype),"MouseUp",this).call(this,t)}},{key:"FormatToDrawItem",value:function(t,e){if(this.AutoSize){t.Style.ApplyTempStyle(this.TextStyleNo);var i=t.Style.TempCanvas.textMetric(this.FText);this.Width=this.FPaddingLeft+this.CheckBoxSize+this.FPaddingLeft+i.width,this.Height=Math.max(i.height,this.CheckBoxSize)}this.Width<this.FMinWidth&&(this.Width=this.FMinWidth),this.Height<this.FMinHeight&&(this.Height=this.FMinHeight)}},{key:"DoPaint",value:function(t,e,i,n,o,s,a,l){Ou(Mu(r.prototype),"DoPaint",this).call(this,t,e,i,n,o,s,a,l);var h=this.GetBoxRect();h.offset(e.left,e.top),l.Print||(this.IsSelectComplate?(a.brush.color=t.SelColor,a.fillRect(e)):this.FMouseIn&&(a.brush.color=lp.clBtnFace,a.fillRect(e))),this.FChecked?or.theme.drawFrameControl(a,h,new Set([yi]),Ii):or.theme.drawFrameControl(a,h,new Set([]),Ii),t.TextStyles[this.TextStyleNo].ApplyStyle(a,l.ScaleY/l.Zoom),this.BoxRight?a.textOut(e.left,Math.trunc(e.top+(this.Height-a.font.height)/2),this.FText):a.textOut(e.left+this.FPaddingLeft+this.CheckBoxSize+this.FPaddingLeft,Math.trunc(e.top+(this.Height-a.font.height)/2),this.FText)}},{key:"Assign",value:function(t){Ou(Mu(r.prototype),"Assign",this).call(this,t),this.FChecked=t.Checked,this.FText=t.Text}},{key:"SaveToStreamRange",value:function(t,e,i){Ou(Mu(r.prototype),"SaveToStreamRange",this).call(this,t,e,i);var n=0;this.FChecked&&(n|=128),this.BoxRight&&(n|=64),t.writeByte(n),lp.HCSaveTextToStream(t,this.FText)}},{key:"LoadFromStream",value:function(t,e,i){if(Ou(Mu(r.prototype),"LoadFromStream",this).call(this,t,e,i),i>51){var n=t.readByte();this.FChecked=or.system.isOdd(n>>7),this.BoxRight=or.system.isOdd(n>>6)}else this.FChecked=t.readBoolean();this.FText=lp.HCLoadTextFromStream(t,i)}},{key:"ToXml",value:function(t){Ou(Mu(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Ou(Mu(r.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Ou(Mu(r.prototype),"ToJSONString",this).call(this)+',"Checked":"'+this.FChecked+'"'}},{key:"ParseJSONOjbect",value:function(t){Ou(Mu(r.prototype),"ParseJSONOjbect",this).call(this,t),this.FChecked=t.checked}},{key:"Checked",get:function(){return this.FChecked},set:function(t){this.SetChecked(t)}}])&&Tu(e.prototype,i),n&&Tu(e,n),r}(Ja);function Gu(t){return(Gu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Uu(t,e){return(Uu=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=zu(t);if(e){var o=zu(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Wu(this,i)}}function Wu(t,e){return!e||"object"!==Gu(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function zu(t){return(zu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ju=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Uu(t,e)}(i,t);var e=Vu(i);function i(){return Hu(this,i),e.apply(this,arguments)}return i}(sl);function Xu(t){return(Xu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ku(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Yu(t,e,i){return(Yu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Qu(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Ju(t,e){return(Ju=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Zu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Qu(t);if(e){var o=Qu(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return qu(this,i)}}function qu(t,e){return!e||"object"!==Xu(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Qu(t){return(Qu=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $u=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ju(t,e)}(r,t);var e,i,n,o=Zu(r);function r(t,e){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(i=o.call(this,t)).StyleNo=cs.Edit,i.FText=e,i.FTextAlignHorz=ja,i.FBorderWidth=1,i.FReadOnly=!1,i.FPrintOnlyText=!1,i.FCaretOffset=-1,i.FSelEnd=-1,i.FSelMove=-1,i.FLeftOffset=0,i.FAlignLeft=0,i.FPaddingLeft=4,i.FPaddingRight=4,i.FPaddingTop=4,i.FPaddingBottom=4,i.Width=50,i.FTextSize=null,i.FBorderSides=new Dp,i.FBorderSides.add(fp.Left),i.FBorderSides.add(fp.Top),i.FBorderSides.add(fp.Right),i.FBorderSides.add(fp.Bottom),i.OnActivate=null,i.OnDeactivate=null,i.CalcSize(),i}return e=r,(i=[{key:"CalcTextSize",value:function(){this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),""!=this.FText?this.FTextSize=this.OwnerData.Style.TempCanvas.textMetric(this.FText):this.FTextSize=this.OwnerData.Style.TempCanvas.textMetric("H")}},{key:"CalcSize",value:function(){this.CalcTextSize(),this.AutoSize&&(this.Width=this.FPaddingLeft+this.FTextSize.width+this.FPaddingRight,this.Height=this.FPaddingTop+this.FTextSize.height+this.FPaddingBottom),this.Width<this.FMinWidth&&(this.Width=this.FMinWidth),this.Height<this.FMinHeight&&(this.Height=this.FMinHeight)}},{key:"ScrollAdjust",value:function(t){if(this.AutoSize)this.FLeftOffset=0;else if(this.FTextSize.width+this.FPaddingLeft<=this.Width-this.FPaddingRight)this.FLeftOffset=0;else if(this.FTextSize.width+this.FPaddingLeft-this.FLeftOffset<this.Width-this.FPaddingRight)this.FLeftOffset=this.FLeftOffset-(this.Width-this.FPaddingLeft-this.FTextSize.width+this.FLeftOffset-this.FPaddingRight);else{this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo);var e=this.FText.substr(0,t),i=this.OwnerData.Style.TempCanvas.textWidth(e)+this.FPaddingLeft+this.FAlignLeft-this.FLeftOffset;i>this.Width-this.FPaddingRight?this.FLeftOffset=this.FLeftOffset+i-this.Width+this.FPaddingRight:i<0&&(this.FLeftOffset=this.FLeftOffset+i)}}},{key:"GetCharDrawLeft",value:function(t){var e=0;return t>0&&(t==this.FText.length?e=this.Width:(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),e=this.FPaddingLeft+this.FAlignLeft+this.OwnerData.Style.TempCanvas.textWidth(this.FText.substr(0,t))-this.FLeftOffset)),e}},{key:"OffsetInSelect",value:function(t){return t>=this.FCaretOffset&&t<=this.FSelEnd}},{key:"DeleteSelectText",value:function(){this.FText=C.stringDelete(this.FText,this.FCaretOffset,this.FSelEnd-this.FCaretOffset),this.FSelEnd=-1,this.FSelMove=this.FCaretOffset,this.CalcTextSize()}},{key:"DisSelectText",value:function(){this.FSelMove=this.FCaretOffset,this.SelectTextExists()&&(this.FSelEnd=-1)}},{key:"GetReadOnly",value:function(){return this.FReadOnly}},{key:"SetReadOnly",value:function(t){this.FReadOnly!=t&&(this.FReadOnly=t)}},{key:"FormatToDrawItem",value:function(t,e){switch(this.CalcSize(),this.FTextAlignHorz){case Xa:this.FAlignLeft=(this.Width-this.FPaddingLeft-this.FTextSize.width-this.FPaddingRight)/2;break;case Ka:this.FAlignLeft=this.Width-this.FPaddingLeft-this.FTextSize.width-this.FPaddingRight;break;default:this.FAlignLeft=0}}},{key:"DoPaint",value:function(t,e,i,n,o,s,a,l){if(Yu(Qu(r.prototype),"DoPaint",this).call(this,t,e,i,n,o,s,a,l),!l.Print&&(this.FReadOnly?(a.brush.color=lp.clBtnFace,a.fillRect(e)):this.IsSelectComplate&&(a.brush.color=t.SelColor,a.fillRect(e)),this.SelectTextExists())){a.brush.color=t.SelColor;var h=this.GetCharDrawLeft(this.FCaretOffset),c=this.GetCharDrawLeft(this.FSelEnd);h=Math.max(0,Math.min(h,this.Width)),c=Math.max(0,Math.min(c,this.Width)),a.fillRect(U.Create(e.left+h,e.top,e.left+c,e.bottom))}if(t.TextStyles[this.TextStyleNo].ApplyStyle(a,l.ScaleY/l.Zoom),this.AutoSize||l.Print?a.textOut(e.left+this.FPaddingLeft+this.FAlignLeft,e.top+this.FPaddingTop,this.FText):a.textRect(e,e.left+this.FPaddingLeft+this.FAlignLeft-this.FLeftOffset,e.top+this.FPaddingTop,this.FText),(!l.Print||!this.FPrintOnlyText)&&this.FBorderSides.value>0){l.Print||!this.FMouseIn&&!this.Active?a.pen.color=at.Black:a.pen.color=at.Blue,a.pen.width=this.FBorderWidth,a.pen.style=pt.Solid,a.beginPath();try{this.FBorderSides.has(fp.Left)&&a.drawLine(e.left,e.top,e.left,e.bottom),this.FBorderSides.has(fp.Top)&&a.drawLine(e.left,e.top,e.right,e.top),this.FBorderSides.has(fp.Right)&&a.drawLine(e.right-1,e.top,e.right-1,e.bottom),this.FBorderSides.has(fp.Bottom)&&a.drawLine(e.left,e.bottom-1,e.right,e.bottom-1)}finally{a.paintPath()}}}},{key:"GetOffsetAt",value:function(t){return t<=this.FPaddingLeft?lp.OffsetBefor:t>=this.Width-this.FPaddingRight?lp.OffsetAfter:lp.OffsetInner}},{key:"SetActive",value:function(t){var e=this.Active;Yu(Qu(r.prototype),"SetActive",this).call(this,t),t||(this.DisSelectText(),this.FLeftOffset=0,this.FCaretOffset=-1),e!=this.Active&&(e&&null!=this.OnDeactivate?this.OnDeactivate(this):e||null==this.OnActivate||this.OnActivate(this,null))}},{key:"MouseDown",value:function(t){var e=Yu(Qu(r.prototype),"MouseDown",this).call(this,t);if(!this.Active)return e;this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo);var i=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,this.FText,t.x-this.FPaddingLeft-this.FAlignLeft+this.FLeftOffset);if(t.button==ee)this.DisSelectText();else{if(this.OffsetInSelect(i))return e;this.DisSelectText()}return i!=this.FCaretOffset&&(this.FCaretOffset=i,this.FSelMove=i,this.ScrollAdjust(i),this.OwnerData.Style.UpdateInfoReCaret()),e}},{key:"MouseMove",value:function(t){var e=Yu(Qu(r.prototype),"MouseMove",this).call(this,t);return t.button==ee&&(t.x<0?this.FLeftOffset=Math.max(this.FAlignLeft,this.FLeftOffset-this.OwnerData.Style.TextStyles[this.TextStyleNo].TextMetric_tmAveCharWidth):t.x>this.Width-this.FPaddingRight&&(this.FLeftOffset=Math.max(this.FAlignLeft,Math.min(this.FTextSize.width-this.Width+this.FPaddingRight+this.FAlignLeft,this.FLeftOffset+this.OwnerData.Style.TextStyles[this.TextStyleNo].TextMetric_tmAveCharWidth))),this.FSelEnd=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,this.FText,t.x-this.FPaddingLeft-this.FAlignLeft+this.FLeftOffset),this.FSelMove=this.FSelEnd,!this.SelectTextExists()&&this.FSelEnd>=0&&(this.FSelEnd=-1,this.FSelMove=this.FCaretOffset),this.ScrollAdjust(this.FSelMove)),e}},{key:"MouseUp",value:function(t){if(t.button==ee&&this.FSelEnd>=0&&this.FSelEnd<this.FCaretOffset){var e=this.FCaretOffset;this.FCaretOffset=this.FSelEnd,this.FSelEnd=e}return this.OwnerData.Style.UpdateInfo.DragingSelected&&this.DisSelect(),Yu(Qu(r.prototype),"MouseUp",this).call(this,t)}},{key:"WantKeyDown",value:function(t){var e=!1;return t.keyCode==Be?0==this.FCaretOffset?this.FCaretOffset=-1:this.FCaretOffset<0?(this.FCaretOffset=this.FText.length,this.ScrollAdjust(this.FCaretOffset),this.OwnerData.Style.UpdateInfoRePaint(),e=!0):e=!0:t.keyCode==Me?this.FCaretOffset==this.FText.length?this.FCaretOffset=-1:this.FCaretOffset<0?(this.FCaretOffset=0,this.ScrollAdjust(this.FCaretOffset),this.OwnerData.Style.UpdateInfoRePaint(),e=!0):e=!0:e=!0,e}},{key:"KeyDown",value:function(t){if(this.Enabled&&!this.FReadOnly)switch(t.keyCode){case Pe:this.SelectTextExists()?this.DeleteSelectText():this.FCaretOffset>0&&(this.FText=C.stringDelete(this.FText,this.FCaretOffset-1,1),this.FCaretOffset--,this.CalcTextSize()),this.ScrollAdjust(this.FCaretOffset),this.FormatDirty();break;case Be:this.DisSelectText(),this.FCaretOffset>0&&this.FCaretOffset--,this.ScrollAdjust(this.FCaretOffset),this.OwnerData.Style.UpdateInfoRePaint();break;case Me:this.DisSelectText(),this.FCaretOffset<this.FText.length&&this.FCaretOffset++,this.ScrollAdjust(this.FCaretOffset),this.OwnerData.Style.UpdateInfoRePaint();break;case Ge:this.SelectTextExists()?this.DeleteSelectText():this.FCaretOffset<this.FText.length&&(this.FText=C.stringDelete(this.FText,this.FCaretOffset,1),this.CalcTextSize()),this.ScrollAdjust(this.FCaretOffset),this.FormatDirty();break;case Ne:this.FCaretOffset=0,this.ScrollAdjust(this.FCaretOffset);break;case Oe:this.FCaretOffset=this.FText.length,this.ScrollAdjust(this.FCaretOffset)}Yu(Qu(r.prototype),"KeyDown",this).call(this,t)}},{key:"KeyPress",value:function(t){this.Enabled&&!this.FReadOnly&&(this.SelectTextExists()&&this.DeleteSelectText(),this.FText=C.stringInsert(this.FText,this.FCaretOffset,String.fromCharCode(t)),this.FCaretOffset++,this.CalcTextSize(),this.ScrollAdjust(this.FCaretOffset),this.FormatDirty()),Yu(Qu(r.prototype),"KeyPress",this).call(this,t)}},{key:"InsertText",value:function(t){return this.FText=C.stringInsert(this.FText,this.FCaretOffset,t),this.FCaretOffset+=t.length,this.ScrollAdjust(this.FCaretOffset),this.FormatDirty(),!0}},{key:"InsertStream",value:function(t,e,i){return!!this.OwnerData.Style.States.Contain(Ip.Pasting)&&this.InsertText(or.clipboard.toString())}},{key:"GetCaretInfo",value:function(t){if(this.FCaretOffset<0)t.Visible=!1;else if(this.SelectTextExists())t.Visible=!1;else{var e=this.FText.substring(0,this.FCaretOffset);if(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),""!=e){var i=this.OwnerData.Style.TempCanvas.textMetric(e);t.Height=i.height,t.X=this.FPaddingLeft+this.FAlignLeft-this.FLeftOffset+i.width}else t.Height=this.OwnerData.Style.TextStyles[this.TextStyleNo].FontHeight,t.X=this.FPaddingLeft+this.FAlignLeft-this.FLeftOffset;t.Y=this.FPaddingTop,!this.AutoSize&&t.X>this.Width&&(t.Visible=!1)}}},{key:"GetText",value:function(){return this.FText}},{key:"SetText",value:function(t){this.FReadOnly||this.FText==t||(this.FText=t,this.FCaretOffset>this.FText.length&&(this.FCaretOffset=0),this.AutoSize?this.OwnerData.ItemReFormatRequest(this):this.OwnerData.Style.UpdateInfoRePaint())}},{key:"SetTextAlignHorz",value:function(t){this.FTextAlignHorz!=t&&(this.FTextAlignHorz=t,this.ReFormatRequest())}},{key:"SelectTextExists",value:function(){return this.FSelEnd>=0&&this.FSelEnd!=this.FCaretOffset}},{key:"CoordInSelect",value:function(t,e){return this.SelectExists()&&U.CreateByBounds(0,0,this.Width,this.Height).pointInAt(t,e)}},{key:"SelectExists",value:function(){return Yu(Qu(r.prototype),"SelectExists",this).call(this)||this.SelectTextExists()}},{key:"IsSelectComplateTheory",value:function(){return this.IsSelectComplate}},{key:"DeleteSelected",value:function(){var t=Yu(Qu(r.prototype),"DeleteSelected",this).call(this);return this.SelectTextExists()&&(this.DeleteSelectText(),t=!0),t}},{key:"DisSelect",value:function(){this.DisSelectText(),Yu(Qu(r.prototype),"DisSelect",this).call(this)}},{key:"SaveSelectToText",value:function(){return this.SelectTextExists()?this.FText.substr(this.FCaretOffset,this.FSelEnd-this.FCaretOffset):Yu(Qu(r.prototype),"SaveSelectToText",this).call(this)}},{key:"Assign",value:function(t){Yu(Qu(r.prototype),"Assign",this).call(this,t),this.FText=t.Text,this.FReadOnly=t.ReadOnly,this.FPrintOnlyText=t.PrintOnlyText,this.FBorderSides.Value=t.BorderSides.Value,this.FBorderWidth=t.BorderWidth}},{key:"Clear",value:function(){this.Text=""}},{key:"ReFormatRequest",value:function(){this.FormatDirty(),this.OwnerData.ItemReFormatRequest(this)}},{key:"SaveToStreamRange",value:function(t,e,i){Yu(Qu(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FText);var n=0;this.FReadOnly&&(n|=128),this.FPrintOnlyText&&(n|=64),t.writeByte(n),t.writeByte(this.FBorderSides.value),t.writeByte(this.FBorderWidth),t.writeByte(this.FTextAlignHorz)}},{key:"LoadFromStream",value:function(t,e,i){if(Yu(Qu(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FText=lp.HCLoadTextFromStream(t,i),i>33){var n=t.readByte();this.FReadOnly=or.system.isOdd(n>>7),this.FPrintOnlyText=or.system.isOdd(n>>6)}else this.FReadOnly=t.readBoolean(),this.FPrintOnlyText=!1;i>15&&(this.FBorderSides.value=t.readByte(),this.FBorderWidth=t.readByte()),i>56&&(this.FTextAlignHorz=t.readByte())}},{key:"ToXml",value:function(t){Yu(Qu(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Yu(Qu(r.prototype),"ParseXml",this).call(this,t)}},{key:"ReadOnly",get:function(){return this.GetReadOnly()},set:function(t){this.SetReadOnly(t)}},{key:"PrintOnlyText",get:function(){return this.FPrintOnlyText},set:function(t){this.FPrintOnlyText=t}},{key:"BorderSides",get:function(){return this.FBorderSides},set:function(t){this.FBorderSides=t}},{key:"BorderWidth",get:function(){return this.FBorderWidth},set:function(t){this.FBorderWidth=t}},{key:"TextAlignHorz",get:function(){return this.FTextAlignHorz},set:function(t){this.SetTextAlignHorz(t)}}])&&Ku(e.prototype,i),n&&Ku(e,n),r}(Ja);function tf(t){return(tf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ef(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function nf(t,e,i){return(nf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=lf(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function of(t,e){return(of=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function rf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=lf(t);if(e){var o=lf(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return sf(this,i)}}function sf(t,e){return!e||"object"!==tf(e)&&"function"!=typeof e?af(t):e}function af(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function lf(t){return(lf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var hf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&of(t,e)}(r,t);var e,i,n,o=rf(r);function r(t,e){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(i=o.call(this,t,e)).StyleNo=cs.Combobox,i.BTNWIDTH=16,i.BTNMARGIN=1,i.FPaddingRight=i.BTNWIDTH,i.Width=80,i.FSaveItem=!0,i.FStatic=!1,i.FItemIndex=-1,i.FItemValues=new V,i.FButtonDrawRect=new U,i.FButtonRect=new U,i.FMouseInButton=!1,i.OnPopupItem=null,i._popupControl=null,i._dropDownCount=8,i._popupAlign=Wt,i._listBox=new wn,i._listBox.width=80,i._listBox.onUpdate=function(t){i._listBoxUpdate(t)},i._listBox.onSelectedIndexChange=function(){i.FItemIndex=i._listBox.itemIndex,i.Text=i._listBox.text,null!=i.OnItemIndexChanged&&i.OnItemIndexChanged(af(i))},i.OnItemIndexChanged=null,i}return e=r,(i=[{key:"_listBoxUpdate",value:function(t){null!=this._popupControl&&this._popupControl.updateRect(t)}},{key:"FormatToDrawItem",value:function(t,e){nf(lf(r.prototype),"FormatToDrawItem",this).call(this,t,e),this.FButtonRect.resetBounds(this.Width-this.BTNMARGIN-this.BTNWIDTH,this.BTNMARGIN,this.BTNWIDTH,this.Height-this.BTNMARGIN-this.BTNMARGIN),this._listBox.width=this.Width}},{key:"DoPaint",value:function(t,e,i,n,o,s,a,l){if(nf(lf(r.prototype),"DoPaint",this).call(this,t,e,i,n,o,s,a,l),this.FButtonDrawRect.resetRect(this.FButtonRect),this.FButtonDrawRect.offset(e.left,e.top),!l.Print){this.IsSelectComplate?a.brush.color=t.SelColor:this.FMouseInButton?a.brush.color=lp.clMenu:a.brush.color=lp.clWindow,a.fillRect(this.FButtonDrawRect),a.pen.color=at.Black;var h=this.FButtonDrawRect.left+Math.trunc((this.BTNWIDTH-7)/2),c=this.FButtonDrawRect.top+Math.trunc((this.FButtonDrawRect.height-4)/2);a.beginPath();try{for(var u=0;u<=3;u++)a.drawLine(h,c,h+7-u-u,c),h++,c++}finally{a.paintPath()}}}},{key:"DoPopup",value:function(){var t=this;if(null!=this.OnPopupItem){var e=this.OnPopupItem(this);if(e&&e.stopPopup)return}if(null==this._popupControl){this._listBox.scrollBarVisible?this._listBox.width=Math.max(this.Width+20,50):this._listBox.width=Math.max(this.Width,50),this._listBox.itemIndex=this._listBox.itemIndexOf(this.Text);var i=this._dropDownCount*(this._listBox.font.height+or.theme.marginSpaceDouble),n=this._listBox.contentHeight;this._listBox.height=n>i?i:n,this._popupControl=new oi,this._popupControl.width=this._listBox.width,this._popupControl.height=this._listBox.height,this._popupControl.dropDownStyle=!0,this._popupControl.onClose=function(){t._popupControl=null},this._popupControl.onPaint=function(e){t._listBox.paintTo(e,0,0)},this._popupControl.onMouseEnter=function(){t._listBox.mouseEnter()},this._popupControl.onMouseLeave=function(){t._listBox.mouseLeave()},this._popupControl.onMouseWheel=function(e){t._listBox.mouseWheel(e)},this._popupControl.onMouseDown=function(e){t._popupDownInTextArea=t._listBox.textArea().pointInAt(e.x,e.y),t._listBox.mouseDown(e)},this._popupControl.onMouseMove=function(e){t._listBox.mouseMove(e)},this._popupControl.onMouseUp=function(e){t._listBox.mouseUp(e),t._popupDownInTextArea&&t._listBox.textArea().pointInAt(e.x,e.y)&&(t._popupControl.donePopup(),t.OwnerData.Style.InvalidateRect(U.Create(t.FButtonDrawRect.right-t.Width,t.FButtonDrawRect.top,t.FButtonDrawRect.right,t.FButtonDrawRect.bottom)))}}var o=this.OwnerData.GetScreenCoord(this.FButtonDrawRect.left-(this.Width-this.FButtonDrawRect.width),this.FButtonDrawRect.bottom+1);this._popupAlign==Wt||(o.x+=this.Width-this._popupControl.width),this._popupControl.popup(o.x,o.y,!0)}},{key:"KeyDown",value:function(t){!this.FStatic&&this.Enabled&&nf(lf(r.prototype),"KeyDown",this).call(this,t)}},{key:"KeyPress",value:function(t){!this.FStatic&&this.Enabled&&nf(lf(r.prototype),"KeyPress",this).call(this,t)}},{key:"MouseDown",value:function(t){return this.Enabled&&!this.ReadOnly&&this.OwnerData.CanEdit()&&t.button==ee&&this.FButtonRect.pointInAt(t.x,t.y)?(this.DoPopup(),!0):nf(lf(r.prototype),"MouseDown",this).call(this,t)}},{key:"MouseMove",value:function(t){return this.FButtonRect.pointInAt(t.x,t.y)?(this.FMouseInButton||(this.FMouseInButton=!0,this.OwnerData.Style.UpdateInfoRePaint()),lp.GCursor=oe,!0):(this.FMouseInButton&&(this.FMouseInButton=!1,this.OwnerData.Style.UpdateInfoRePaint()),nf(lf(r.prototype),"MouseMove",this).call(this,t))}},{key:"MouseLeave",value:function(){nf(lf(r.prototype),"MouseLeave",this).call(this),this.FMouseInButton=!1}},{key:"GetCaretInfo",value:function(t){nf(lf(r.prototype),"GetCaretInfo",this).call(this,t),!this.AutoSize&&t.X>this.Width-this.BTNWIDTH&&(t.Visible=!1)}},{key:"SetItemIndex",value:function(t){this.ReadOnly||(t>=0&&t<=this._listBox.items.count-1?this._listBox.itemIndex=t:(this.FItemIndex=-1,this.Text=""),this.DoChange(),null!=this.OnItemIndexChanged&&this.OnItemIndexChanged(this))}},{key:"Assign",value:function(t){nf(lf(r.prototype),"Assign",this).call(this,t),this.FStatic=t.Static,this.FSaveItem=t.SaveItem,this._listBox.items.clear();for(var e=0;e<t.Items.count;e++)this._listBox.items.add(t.Items[e]);this.FItemValues.clear();for(var i=0;i<t.ItemValues.count;i++)this.FItemValues.Add(t.ItemValues[i])}},{key:"InsertText",value:function(t){return!(this.FStatic||!this.Enabled)&&nf(lf(r.prototype),"InsertText",this).call(this,t)}},{key:"SaveToStreamRange",value:function(t,e,i){nf(lf(r.prototype),"SaveToStreamRange",this).call(this,t,e,i);var n=0;if(this.FStatic&&(n|=128),this.FSaveItem&&(n|=64),t.writeByte(n),this.FSaveItem){var o="";if(this._listBox.items.count>0){o=this._listBox.items[0].text;for(var s=1;s<this._listBox.items.count;s++)o=o+lp.sLineBreak+this._listBox.items[s].text}if(lp.HCSaveTextToStream(t,o),o="",this.FItemValues.count>0){o=this.FItemValues[0];for(var a=1;a<this.FItemValues.count;a++)o=o+lp.sLineBreak+this.FItemValues[a]}lp.HCSaveTextToStream(t,o)}}},{key:"LoadFromStream",value:function(t,e,i){if(nf(lf(r.prototype),"LoadFromStream",this).call(this,t,e,i),this._listBox.items.clear(),i>36){if(i>40){var n=t.readByte();this.FStatic=or.system.isOdd(n>>7),this.FSaveItem=or.system.isOdd(n>>6)}else this.FSaveItem=t.readBoolean();if(this.FSaveItem){for(var o=lp.HCLoadTextFromStream(t,i).split(lp.sLineBreak),s=0,a=o.length;s<a;s++)this._listBox.items.add(o[s]);for(var l=0,h=(o=lp.HCLoadTextFromStream(t,i).split(lp.sLineBreak)).length;l<h;l++)this.FItemValues.add(o[l])}}else{for(var c=lp.HCLoadTextFromStream(t,i).split(lp.sLineBreak),u=0,f=c.length;u<f;u++)this._listBox.items.add(c[u]);if(this._listBox.items.count>0&&i>35)for(var d=0,m=(c=lp.HCLoadTextFromStream(t,i).split(lp.sLineBreak)).length;d<m;d++)this.FItemValues.add(c[d]);else this.FItemValues.clear();this.FSaveItem=this._listBox.items.count>0}}},{key:"AddItem",value:function(t,e){this._listBox.items.add(t),this.FItemValues.add(e)}},{key:"Clear",value:function(){this._listBox.items.clear(),this.FItemValues.clear()}},{key:"ToXml",value:function(t){nf(lf(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){nf(lf(r.prototype),"ParseXml",this).call(this,t)}},{key:"Items",get:function(){return this._listBox.items}},{key:"ItemValues",get:function(){return this.FItemValues}},{key:"ItemIndex",get:function(){return this.FItemIndex},set:function(t){this.SetItemIndex(t)}},{key:"SaveItem",get:function(){return this.FSaveItem},set:function(t){this.FSaveItem=t}},{key:"Static",get:function(){return this.FStatic},set:function(t){this.FStatic=t}}])&&ef(e.prototype,i),n&&ef(e,n),r}($u);function cf(t){return(cf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uf(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ff(t,e){return(ff=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function df(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=yf(t);if(e){var o=yf(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return mf(this,i)}}function mf(t,e){return!e||"object"!==cf(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function yf(t){return(yf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var pf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ff(t,e)}(r,t);var e,i,n,o=df(r);function r(t,e){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(i=o.call(this))._canvas=document.createElement("canvas"),i._canvas.width=t||100,i._canvas.height=e||100,i._context=i._canvas.getContext("2d"),i.canvas=new Dt(i._context),i.canvas.prepareConext(or._scale),i}return e=r,(i=[{key:"width",get:function(){return this._canvas.width},set:function(t){this._canvas.width=t}},{key:"height",get:function(){return this._canvas.height},set:function(t){this._canvas.height=t}}])&&uf(e.prototype,i),n&&uf(e,n),r}(L);function Sf(t,e,i){return(Sf="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=bf(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function vf(t){return(vf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ff(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function If(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function gf(t,e,i){return e&&If(t.prototype,e),i&&If(t,i),t}function wf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Cf(t,e)}function Cf(t,e){return(Cf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function kf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=bf(t);if(e){var o=bf(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Pf(this,i)}}function Pf(t,e){return!e||"object"!==vf(e)&&"function"!=typeof e?Df(t):e}function Df(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bf(t){return(bf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Rf=0,_f=0,xf=1,Af=2,Tf=4,Of=6,Nf=function(t){wf(i,t);var e=kf(i);function i(){var t;return Ff(this,i),(t=e.call(this)).Bits=0,t.Ordinal=0,t}return gf(i,[{key:"Assign",value:function(t){this.Bits=t.Bits}}]),i}(L),Bf=function(t){wf(i,t);var e=kf(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Ff(this,i),(t=e.call(this)).Size=n,t.Bits=new P(n>0?n+31>>5:1),t}return gf(i,[{key:"EnsureCapacity",value:function(t){if(t>this.Bits.length<<5){var e=this.Bits.length;this.Bits.length=t;for(var i=e;i<this.Bits.length;i++)this.Bits[i]=0}}},{key:"GetSizeInBytes",value:function(){return this.Size+7>>3}},{key:"GetSize",value:function(){return this.Size}},{key:"Get",value:function(t){return 0!=(this.Bits[t>>5]&1<<(31&t))}},{key:"SetBit",value:function(t){this.Bits[t>>5]|=1<<(31&t)}},{key:"AppendBit",value:function(t){this.EnsureCapacity(this.Size+1),t&&(this.Bits[this.Size>>5]|=1<<(31&this.Size)),this.Size++}},{key:"AppendBits",value:function(t,e){this.EnsureCapacity(this.Size+e);for(var i=e;i>0;i--)this.AppendBit(1==(t>>i-1&1))}},{key:"AppendBitArray",value:function(t){var e=t.GetSize();this.EnsureCapacity(this.Size+e);for(var i=0;i<e;i++)this.AppendBit(t.Get(i))}},{key:"ToBytes",value:function(t,e,i,n){for(var o,r=0;r<n;r++){o=0;for(var s=0;s<8;s++)this.Get(t)&&(o|=1<<7-s),t++;e[i+r]=o}}},{key:"XorOperation",value:function(t){if(this.Bits.length==t.Bits.length)for(var e=0;e<this.Bits.length;e++)this.Bits[e]^=t.Bits[e]}}]),i}(L),Ef=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1],Mf=[[0,0,0],[10,12,14],[9,11,13],[0,0,0],[8,16,16],[0,0,0],[8,10,12],[0,0,0],[0,0,0],[8,10,12]],Lf=[0,1,2,3,4,7,8,5,9,13],Gf=[[8,0],[8,1],[8,2],[8,3],[8,4],[8,5],[8,7],[8,8],[7,8],[5,8],[4,8],[3,8],[2,8],[1,8],[0,8]],Hf=[[0,0,0,0,0,0,0,0]],Uf=[[0],[0],[0],[0],[0],[0],[0]],Vf=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,1,1,1,0,1],[1,0,1,1,1,0,1],[1,0,1,1,1,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],Wf=[[1,1,1,1,1],[1,0,0,0,1],[1,0,1,0,1],[1,0,0,0,1],[1,1,1,1,1]],zf=[[-1,-1,-1,-1,-1,-1,-1],[6,18,-1,-1,-1,-1,-1],[6,22,-1,-1,-1,-1,-1],[6,26,-1,-1,-1,-1,-1],[6,30,-1,-1,-1,-1,-1],[6,34,-1,-1,-1,-1,-1],[6,22,38,-1,-1,-1,-1],[6,24,42,-1,-1,-1,-1],[6,26,46,-1,-1,-1,-1],[6,28,50,-1,-1,-1,-1],[6,30,54,-1,-1,-1,-1],[6,32,58,-1,-1,-1,-1],[6,34,62,-1,-1,-1,-1],[6,26,46,66,-1,-1,-1],[6,26,48,70,-1,-1,-1],[6,26,50,74,-1,-1,-1],[6,30,54,78,-1,-1,-1],[6,30,56,82,-1,-1,-1],[6,30,58,86,-1,-1,-1],[6,34,62,90,-1,-1,-1],[6,28,50,72,94,-1,-1],[6,26,50,74,98,-1,-1],[6,30,54,78,102,-1,-1],[6,28,54,80,106,-1,-1],[6,32,58,84,110,-1,-1],[6,30,58,86,114,-1,-1],[6,34,62,90,118,-1,-1],[6,26,50,74,98,122,-1],[6,30,54,78,102,126,-1],[6,26,52,78,104,130,-1],[6,30,56,82,108,134,-1],[6,34,60,86,112,138,-1],[6,30,58,86,114,142,-1],[6,34,62,90,118,146,-1],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],jf=function(t){wf(i,t);var e=kf(i);function i(t,n){var o;return Ff(this,i),(o=e.call(this)).Count=t,o.DataCodewords=n,o}return gf(i,[{key:"GetCount",value:function(){return this.Count}},{key:"GetDataCodewords",value:function(){return this.DataCodewords}}]),i}(L),Xf=function(t){wf(i,t);var e=kf(i);function i(){var t;return Ff(this,i),(t=e.call(this)).ECCodewordsPerBlock,t.ECBlocks,t}return gf(i,[{key:"GetTotalECCodewords",value:function(){return this.ECCodewordsPerBlock*this.GetNumBlocks()}},{key:"GetNumBlocks",value:function(){for(var t=0,e=0;e<this.ECBlocks.length;e++)t+=this.ECBlocks[e].GetCount();return t}},{key:"GetECCodewordsPerBlock",value:function(){return this.ECCodewordsPerBlock}},{key:"GetECBlocks",value:function(){return this.ECBlocks}}],[{key:"Create2",value:function(t,e){var n=new i;return n.ECCodewordsPerBlock=t,n.ECBlocks=new k(1),n.ECBlocks[0]=e,n}},{key:"Create3",value:function(t,e,n){var o=new i;return o.ECCodewordsPerBlock=t,o.ECBlocks=new k(2),o.ECBlocks[0]=e,o.ECBlocks[1]=n,o}}]),i}(L),Kf=function(t){wf(i,t);var e=kf(i);function i(t,n,o,r,s,a){var l;Ff(this,i),(l=e.call(this)).VersionNumber=t,l.AlignmentPatternCenters=n,l.ECBlocks=new k(4),l.ECBlocks[0]=o,l.ECBlocks[1]=r,l.ECBlocks[2]=s,l.ECBlocks[3]=a,l.TotalCodewords=0,l.ECCodewords=o.GetECCodewordsPerBlock();for(var h,c=o.GetECBlocks(),u=0;u<c.length;u++)h=c[u],l.TotalCodewords+=h.GetCount()*(h.GetDataCodewords()+l.ECCodewords);return l}return gf(i,[{key:"GetTotalCodewords",value:function(){return this.TotalCodewords}},{key:"GetECBlocksForLevel",value:function(t){return this.ECBlocks[t.Ordinal]}},{key:"GetDimensionForVersion",value:function(){return 17+4*this.VersionNumber}}],[{key:"GetVersionForNumber",value:function(t){return 1==t?new i(1,[],Xf.Create2(7,new jf(1,19)),Xf.Create2(10,new jf(1,16)),Xf.Create2(13,new jf(1,13)),Xf.Create2(17,new jf(1,9))):2==t?new i(2,[6,18],Xf.Create2(10,new jf(1,34)),Xf.Create2(16,new jf(1,28)),Xf.Create2(22,new jf(1,22)),Xf.Create2(28,new jf(1,16))):3==t?new i(3,[6,22],Xf.Create2(15,new jf(1,55)),Xf.Create2(26,new jf(1,44)),Xf.Create2(18,new jf(2,17)),Xf.Create2(22,new jf(2,13))):4==t?new i(4,[6,26],Xf.Create2(20,new jf(1,80)),Xf.Create2(18,new jf(2,32)),Xf.Create2(26,new jf(2,24)),Xf.Create2(16,new jf(4,9))):5==t?new i(5,[6,30],Xf.Create2(26,new jf(1,108)),Xf.Create2(24,new jf(2,43)),Xf.Create3(18,new jf(2,15),new jf(2,16)),Xf.Create3(22,new jf(2,11),new jf(2,12))):6==t?new i.Create(6,[6,34],Xf.Create2(18,new jf(2,68)),Xf.Create2(16,new jf(4,27)),Xf.Create2(24,new jf(4,19)),Xf.Create2(28,new jf(4,15))):7==t?new i.Create(7,[6,22,38],Xf.Create2(20,new jf(2,78)),Xf.Create2(18,new jf(4,31)),Xf.Create3(18,new jf(2,14),new jf(4,15)),Xf.Create3(26,new jf(4,13),new jf(1,14))):8==t?new i.Create(8,[6,24,42],Xf.Create2(24,new jf(2,97)),Xf.Create3(22,new jf(2,38),new jf(2,39)),Xf.Create3(22,new jf(4,18),new jf(2,19)),Xf.Create3(26,new jf(4,14),new jf(2,15))):9==t?new i.Create(9,[6,26,46],Xf.Create2(30,new jf(2,116)),Xf.Create3(22,new jf(3,36),new jf(2,37)),Xf.Create3(20,new jf(4,16),new jf(4,17)),Xf.Create3(24,new jf(4,12),new jf(4,13))):10==t?new i.Create(10,[6,28,50],Xf.Create3(18,new jf(2,68),new jf(2,69)),Xf.Create3(26,new jf(4,43),new jf(1,44)),Xf.Create3(24,new jf(6,19),new jf(2,20)),Xf.Create3(28,new jf(6,15),new jf(2,16))):11==t?new i.Create(11,[6,30,54],Xf.Create2(20,new jf(4,81)),Xf.Create3(30,new jf(1,50),new jf(4,51)),Xf.Create3(28,new jf(4,22),new jf(4,23)),Xf.Create3(24,new jf(3,12),new jf(8,13))):12==t?new i.Create(12,[6,32,58],Xf.Create3(24,new jf(2,92),new jf(2,93)),Xf.Create3(22,new jf(6,36),new jf(2,37)),Xf.Create3(26,new jf(4,20),new jf(6,21)),Xf.Create3(28,new jf(7,14),new jf(4,15))):13==t?new i.Create(13,[6,34,62],Xf.Create2(26,new jf(4,107)),Xf.Create3(22,new jf(8,37),new jf(1,38)),Xf.Create3(24,new jf(8,20),new jf(4,21)),Xf.Create3(22,new jf(12,11),new jf(4,12))):14==t?new i.Create(14,[6,26,46,66],Xf.Create3(30,new jf(3,115),new jf(1,116)),Xf.Create3(24,new jf(4,40),new jf(5,41)),Xf.Create3(20,new jf(11,16),new jf(5,17)),Xf.Create3(24,new jf(11,12),new jf(5,13))):15==t?new i.Create(15,[6,26,48,70],Xf.Create3(22,new jf(5,87),new jf(1,88)),Xf.Create3(24,new jf(5,41),new jf(5,42)),Xf.Create3(30,new jf(5,24),new jf(7,25)),Xf.Create3(24,new jf(11,12),new jf(7,13))):16==t?new i.Create(16,[6,26,50,74],Xf.Create3(24,new jf(5,98),new jf(1,99)),Xf.Create3(28,new jf(7,45),new jf(3,46)),Xf.Create3(24,new jf(15,19),new jf(2,20)),Xf.Create3(30,new jf(3,15),new jf(13,16))):17==t?new i.Create(17,[6,30,54,78],Xf.Create3(28,new jf(1,107),new jf(5,108)),Xf.Create3(28,new jf(10,46),new jf(1,47)),Xf.Create3(28,new jf(1,22),new jf(15,23)),Xf.Create3(28,new jf(2,14),new jf(17,15))):18==t?new i.Create(18,[6,30,56,82],Xf.Create3(30,new jf(5,120),new jf(1,121)),Xf.Create3(26,new jf(9,43),new jf(4,44)),Xf.Create3(28,new jf(17,22),new jf(1,23)),Xf.Create3(28,new jf(2,14),new jf(19,15))):19==t?new i.Create(19,[6,30,58,86],Xf.Create3(28,new jf(3,113),new jf(4,114)),Xf.Create3(26,new jf(3,44),new jf(11,45)),Xf.Create3(26,new jf(17,21),new jf(4,22)),Xf.Create3(26,new jf(9,13),new jf(16,14))):20==t?new i.Create(20,[6,34,62,90],Xf.Create3(28,new jf(3,107),new jf(5,108)),Xf.Create3(26,new jf(3,41),new jf(13,42)),Xf.Create3(30,new jf(15,24),new jf(5,25)),Xf.Create3(28,new jf(15,15),new jf(10,16))):21==t?new i.Create(21,[6,28,50,72,94],Xf.Create3(28,new jf(4,116),new jf(4,117)),Xf.Create2(26,new jf(17,42)),Xf.Create3(28,new jf(17,22),new jf(6,23)),Xf.Create3(30,new jf(19,16),new jf(6,17))):22==t?new i.Create(22,[6,26,50,74,98],Xf.Create3(28,new jf(2,111),new jf(7,112)),Xf.Create2(28,new jf(17,46)),Xf.Create3(30,new jf(7,24),new jf(16,25)),Xf.Create2(24,new jf(34,13))):23==t?new i.Create(23,[6,30,54,78,102],Xf.Create3(30,new jf(4,121),new jf(5,122)),Xf.Create3(28,new jf(4,47),new jf(14,48)),Xf.Create3(30,new jf(11,24),new jf(14,25)),Xf.Create3(30,new jf(16,15),new jf(14,16))):24==t?new i.Create(24,[6,28,54,80,106],Xf.Create3(30,new jf(6,117),new jf(4,118)),Xf.Create3(28,new jf(6,45),new jf(14,46)),Xf.Create3(30,new jf(11,24),new jf(16,25)),Xf.Create3(30,new jf(30,16),new jf(2,17))):25==t?new i.Create(25,[6,32,58,84,110],Xf.Create3(26,new jf(8,106),new jf(4,107)),Xf.Create3(28,new jf(8,47),new jf(13,48)),Xf.Create3(30,new jf(7,24),new jf(22,25)),Xf.Create3(30,new jf(22,15),new jf(13,16))):26==t?new i.Create(26,[6,30,58,86,114],Xf.Create3(28,new jf(10,114),new jf(2,115)),Xf.Create3(28,new jf(19,46),new jf(4,47)),Xf.Create3(28,new jf(28,22),new jf(6,23)),Xf.Create3(30,new jf(33,16),new jf(4,17))):27==t?new i.Create(27,[6,34,62,90,118],Xf.Create3(30,new jf(8,122),new jf(4,123)),Xf.Create3(28,new jf(22,45),new jf(3,46)),Xf.Create3(30,new jf(8,23),new jf(26,24)),Xf.Create3(30,new jf(12,15),new jf(28,16))):28==t?new i.Create(28,[6,26,50,74,98,122],Xf.Create3(30,new jf(3,117),new jf(10,118)),Xf.Create3(28,new jf(3,45),new jf(23,46)),Xf.Create3(30,new jf(4,24),new jf(31,25)),Xf.Create3(30,new jf(11,15),new jf(31,16))):29==t?new i.Create(29,[6,30,54,78,102,126],Xf.Create3(30,new jf(7,116),new jf(7,117)),Xf.Create3(28,new jf(21,45),new jf(7,46)),Xf.Create3(30,new jf(1,23),new jf(37,24)),Xf.Create3(30,new jf(19,15),new jf(26,16))):30==t?new i.Create(30,[6,26,52,78,104,130],Xf.Create3(30,new jf(5,115),new jf(10,116)),Xf.Create3(28,new jf(19,47),new jf(10,48)),Xf.Create3(30,new jf(15,24),new jf(25,25)),Xf.Create3(30,new jf(23,15),new jf(25,16))):31==t?new i.Create(31,[6,30,56,82,108,134],Xf.Create3(30,new jf(13,115),new jf(3,116)),Xf.Create3(28,new jf(2,46),new jf(29,47)),Xf.Create3(30,new jf(42,24),new jf(1,25)),Xf.Create3(30,new jf(23,15),new jf(28,16))):32==t?new i.Create(32,[6,34,60,86,112,138],Xf.Create2(30,new jf(17,115)),Xf.Create3(28,new jf(10,46),new jf(23,47)),Xf.Create3(30,new jf(10,24),new jf(35,25)),Xf.Create3(30,new jf(19,15),new jf(35,16))):33==t?new i.Create(33,[6,30,58,86,114,142],Xf.Create3(30,new jf(17,115),new jf(1,116)),Xf.Create3(28,new jf(14,46),new jf(21,47)),Xf.Create3(30,new jf(29,24),new jf(19,25)),Xf.Create3(30,new jf(11,15),new jf(46,16))):34==t?new i.Create(34,[6,34,62,90,118,146],Xf.Create3(30,new jf(13,115),new jf(6,116)),Xf.Create3(28,new jf(14,46),new jf(23,47)),Xf.Create3(30,new jf(44,24),new jf(7,25)),Xf.Create3(30,new jf(59,16),new jf(1,17))):35==t?new i.Create(35,[6,30,54,78,102,126,150],Xf.Create3(30,new jf(12,121),new jf(7,122)),Xf.Create3(28,new jf(12,47),new jf(26,48)),Xf.Create3(30,new jf(39,24),new jf(14,25)),Xf.Create3(30,new jf(22,15),new jf(41,16))):36==t?new i.Create(36,[6,24,50,76,102,128,154],Xf.Create3(30,new jf(6,121),new jf(14,122)),Xf.Create3(28,new jf(6,47),new jf(34,48)),Xf.Create3(30,new jf(46,24),new jf(10,25)),Xf.Create3(30,new jf(2,15),new jf(64,16))):37==t?new i.Create(37,[6,28,54,80,106,132,158],Xf.Create3(30,new jf(17,122),new jf(4,123)),Xf.Create3(28,new jf(29,46),new jf(14,47)),Xf.Create3(30,new jf(49,24),new jf(10,25)),Xf.Create3(30,new jf(24,15),new jf(46,16))):38==t?new i.Create(38,[6,32,58,84,110,136,162],Xf.Create3(30,new jf(4,122),new jf(18,123)),Xf.Create3(28,new jf(13,46),new jf(32,47)),Xf.Create3(30,new jf(48,24),new jf(14,25)),Xf.Create3(30,new jf(42,15),new jf(32,16))):39==t?new i.Create(39,[6,26,54,82,110,138,166],Xf.Create3(30,new jf(20,117),new jf(4,118)),Xf.Create3(28,new jf(40,47),new jf(7,48)),Xf.Create3(30,new jf(43,24),new jf(22,25)),Xf.Create3(30,new jf(10,15),new jf(67,16))):40==t?new i.Create(40,[6,30,58,86,114,142,170],Xf.Create3(30,new jf(19,118),new jf(6,119)),Xf.Create3(28,new jf(18,47),new jf(31,48)),Xf.Create3(30,new jf(34,24),new jf(34,25)),Xf.Create3(30,new jf(20,15),new jf(61,16))):null}},{key:"ChooseVersion",value:function(t,e){for(var n,o=1;o<=40;o++)if((n=i.GetVersionForNumber(o)).GetTotalCodewords()-n.GetECBlocksForLevel(e).GetTotalECCodewords()>=Math.trunc((t+7)/8))return n;return null}}]),i}(L),Yf=function(t){wf(i,t);var e=kf(i);function i(){return Ff(this,i),e.call(this)}return gf(i,[{key:"GetDataMaskBit",value:function(t,e,i){var n,o=0;if(t>=0&&t<8)switch(t){case 0:o=i+e&1;break;case 1:o=1&i;break;case 2:o=e%3;break;case 3:o=(i+e)%3;break;case 4:o=(i>>1)+Math.trunc(e/3)&1;break;case 5:o=(1&(n=i*e))+n%3;break;case 6:o=(1&(n=i*e))+(3&n)&1;break;case 7:o=(n=i*e)%3+(i+e&1)&1}return 0==o}}]),i}(L),Jf=function(t){wf(i,t);var e=kf(i);function i(){var t;return Ff(this,i),(t=e.call(this)).MatrixUtilError=!1,t}return gf(i,[{key:"ClearMatrix",value:function(t){t.Clear(255)}},{key:"EmbedBasicPatterns",value:function(t,e){this.EmbedPositionDetectionPatternsAndSeparators(e),this.EmbedDarkDotAtLeftBottomCorner(e),this.MaybeEmbedPositionAdjustmentPatterns(t,e),this.EmbedTimingPatterns(e)}},{key:"EmbedTypeInfo",value:function(t,e,i){var n,o,r,s,a,l=new Bf;this.MakeTypeInfoBits(t,e,l);for(var h=0;h<l.GetSize();h++)n=l.Get(l.GetSize()-1-h),o=Gf[h][0],s=Gf[h][1],i.SetBoolean(o,s,n),h<8?(r=i.Width-h-1,a=8,i.SetBoolean(r,a,n)):(r=8,a=i.Height-7+(h-8),i.SetBoolean(r,a,n))}},{key:"MaybeEmbedVersionInfo",value:function(t,e){if(!(t<7)){var i=new Bf;this.MakeVersionInfoBits(t,i);for(var n,o=17,r=0;r<6;r++)for(var s=0;s<3;s++)n=i.Get(o),o--,e.SetBoolean(r,e.Height-11+s,n),e.SetBoolean(e.Height-11+s,r,n)}}},{key:"EmbedDataBits",value:function(t,e,i){for(var n,o,r=new Yf,s=0,a=-1,l=i.Width-1,h=i.Height-1;l>0;){for(6==l&&l--;h>=0&&h<i.Height;){for(var c=0;c<2;c++)n=l-c,this.IsEmpty(i.Get(n,h))&&(s<t.GetSize()?(o=t.Get(s),s++):o=!1,-1!=e&&r.GetDataMaskBit(e,n,h)&&(o=!o),i.SetBoolean(n,h,o));h+=a}h+=a=-a,l-=2}s!=t.GetSize()&&(this.MatrixUtilError=!0)}},{key:"FindMSBSet",value:function(t){for(var e=0;0!=t;)t>>=1,e++;return e}},{key:"CalculateBCHCode",value:function(t,e){var i=this.FindMSBSet(e);for(t<<=i-1;this.FindMSBSet(t)>=i;)t^=e<<this.FindMSBSet(t)-i;return t}},{key:"MakeTypeInfoBits",value:function(t,e,i){if(e>=0&&e<8){var n=t.Bits<<3|e;i.AppendBits(n,5);var o=this.CalculateBCHCode(n,1335);i.AppendBits(o,10);var r=new Bf;if(r.AppendBits(21522,15),i.XorOperation(r),15!=i.GetSize())return void(this.MatrixUtilError=!0)}}},{key:"MakeVersionInfoBits",value:function(t,e){e.AppendBits(t,6);var i=this.CalculateBCHCode(t,7973);e.AppendBits(i,12),18!=e.GetSize()&&(this.MatrixUtilError=!0)}},{key:"IsEmpty",value:function(t){return-1==t}},{key:"EmbedTimingPatterns",value:function(t){for(var e,i=8;i<=t.Width-9;i++)e=(i+1)%2,this.IsEmpty(t.Get(i,6))&&t.SetInteger(i,6,e),this.IsEmpty(t.Get(6,i))&&t.SetInteger(6,i,e)}},{key:"EmbedDarkDotAtLeftBottomCorner",value:function(t){0!=t.Get(8,t.Height-8)?t.SetInteger(8,t.Height-8,1):this.MatrixUtilError=!0}},{key:"EmbedHorizontalSeparationPattern",value:function(t,e,i){for(var n=0;n<8;n++){if(!this.IsEmpty(i.Get(t+n,e)))return void(this.MatrixUtilError=!0);i.SetInteger(t+n,e,Hf[0][n])}}},{key:"EmbedVerticalSeparationPattern",value:function(t,e,i){for(var n=0;n<7;n++){if(!this.IsEmpty(i.Get(t,e+n)))return void(this.MatrixUtilError=!0);i.SetInteger(t,e+n,Uf[n][0])}}},{key:"EmbedPositionAdjustmentPattern",value:function(t,e,i){for(var n=0;n<5;n++)for(var o=0;o<5;o++){if(!this.IsEmpty(i.Get(t+o,e+n)))return void(this.MatrixUtilError=!0);i.SetInteger(t+o,e+n,Wf[n][o])}}},{key:"EmbedPositionDetectionPattern",value:function(t,e,i){for(var n=0;n<7;n++)for(var o=0;o<7;o++){if(!this.IsEmpty(i.Get(t+o,e+n)))return void(this.MatrixUtilError=!0);i.SetInteger(t+o,e+n,Vf[n][o])}}},{key:"EmbedPositionDetectionPatternsAndSeparators",value:function(t){var e=Vf[0].length;this.EmbedPositionDetectionPattern(0,0,t),this.EmbedPositionDetectionPattern(t.Width-e,0,t),this.EmbedPositionDetectionPattern(0,t.Width-e,t);var i=Hf[0].length;this.EmbedHorizontalSeparationPattern(0,i-1,t),this.EmbedHorizontalSeparationPattern(t.Width-i,i-1,t),this.EmbedHorizontalSeparationPattern(0,t.Width-i,t);var n=Uf.length;this.EmbedVerticalSeparationPattern(n,0,t),this.EmbedVerticalSeparationPattern(t.Height-n-1,0,t),this.EmbedVerticalSeparationPattern(n,t.Height-n,t)}},{key:"MaybeEmbedPositionAdjustmentPatterns",value:function(t,e){if(t>=2){for(var i,n,o=t-1,r=zf[o].length,s=new P(r),a=0;a<r;a++)s[a]=zf[o][a];for(var l=0;l<r;l++)for(var h=0;h<r;h++)n=s[l],-1!=(i=s[h])&&-1!=n&&this.IsEmpty(e.Get(i,n))&&this.EmbedPositionAdjustmentPattern(i-2,n-2,e)}}},{key:"BuildMatrix",value:function(t,e,i,n,o){this.ClearMatrix(o),this.EmbedBasicPatterns(i,o),this.EmbedTypeInfo(e,n,o),this.MaybeEmbedVersionInfo(i,o),this.EmbedDataBits(t,n,o)}}]),i}(L),Zf=function(t){wf(i,t);var e=kf(i);function i(t,n,o){var r;return Ff(this,i),(r=e.call(this)).FInitialized=!1,r.FPrimitive=t,r.FSize=n,r.FGeneratorBase=o,r.FPolyList=new k(0),r.FSize<0&&r.Initialize(),r}return gf(i,[{key:"CheckInit",value:function(){this.FInitialized||this.Initialize()}},{key:"Initialize",value:function(){this.FExpTable=new P(this.FSize),this.FLogTable=new P(this.FSize);for(var t=1,e=0;e<this.FSize;e++)this.FExpTable[e]=t,(t<<=1)>=this.FSize&&(t^=this.FPrimitive,t&=this.FSize-1);for(var i=0;i<this.FSize-1;i++)this.FLogTable[this.FExpTable[i]]=i;var n=new P(1);n[0]=0,this.FZero=new qf(this,n),(n=new P(1))[0]=1,this.FOne=new qf(this,n),this.FInitialized=!0}},{key:"GetZero",value:function(){return this.CheckInit(),this.FZero}},{key:"Exp",value:function(t){return this.CheckInit(),this.FExpTable[t]}},{key:"GetGeneratorBase",value:function(){return this.FGeneratorBase}},{key:"Inverse",value:function(t){return this.CheckInit(),0!=t?this.FExpTable[this.FSize-this.FLogTable[t]-1]:0}},{key:"Multiply",value:function(t,e){return this.CheckInit(),0!=t&&0!=e?this.FExpTable[(this.FLogTable[t]+this.FLogTable[e])%(this.FSize-1)]:0}},{key:"BuildMonomial",value:function(t,e){if(this.CheckInit(),t>=0){if(0==e)return this.FZero;var i=new P(t+1);return i[0]=e,new qf(this,i)}return null}}],[{key:"CreateQRCodeField256",value:function(){return new i(285,256,0)}},{key:"AddOrSubtract",value:function(t,e){return t^e}}]),i}(L),qf=function(t){wf(i,t);var e=kf(i);function i(t,n){var o;Ff(this,i),(o=e.call(this)).Coefficients=n,o.FField=t,o.FField.FPolyList.length=o.FField.FPolyList.length+1,o.FField.FPolyList[o.FField.FPolyList.length-1]=Df(o);var r=n.length;if(r>1&&0==n[0]){for(var s=1;s<r&&0==n[s];)s--;if(s==r)o.Coefficients=t.GetZero().Coefficients;else{var a=r-s;o.Coefficients=new P(a);for(var l=0;l<a;l++)o.Coefficients[l]=n[s+l]}}return o}return gf(i,[{key:"Multiply",value:function(t){var e,n,o,r;if(this.FField==t.FField){if(this.IsZero()||t.IsZero())return this.FField.GetZero();o=(e=this.Coefficients.concat()).length,r=(n=t.Coefficients.concat()).length;for(var s=new P(o+r-1),a=0,l=0;l<o;l++){a=e[l];for(var h=0;h<r;h++)s[l+h]=Zf.AddOrSubtract(s[l+h],this.FField.Multiply(a,n[h]))}return new i(this.FField,s)}return null}},{key:"MultiplyByMonomial",value:function(t,e){if(t>=0){if(0==e)return this.FField.GetZero();for(var n=this.Coefficients.length,o=new P(n+t),r=0;r<n;r++)o[r]=this.FField.Multiply(this.Coefficients[r],e);return new i(this.FField,o)}}},{key:"Divide",value:function(t){var e=null;if(this.FField==t.FField&&!t.IsZero()){for(var i,n,o,r,s=this.FField.GetZero(),a=this,l=t.GetCoefficient(t.GetDegree()),h=this.FField.Inverse(l);a.GetDegree()>=t.GetDegree()&&!a.IsZero();)i=a.GetDegree()-t.GetDegree(),n=this.FField.Multiply(a.GetCoefficient(a.GetDegree()),h),o=t.MultiplyByMonomial(i,n),r=this.FField.BuildMonomial(i,n),s=s.AddOrSubtract(r),a=a.AddOrSubtract(o);(e=new k(2))[0]=s,e[1]=a}return e}},{key:"GetCoefficients",value:function(){return this.Coefficients}},{key:"IsZero",value:function(){return 0==this.Coefficients[0]}},{key:"GetCoefficient",value:function(t){return this.Coefficients[this.Coefficients.length-1-t]}},{key:"GetDegree",value:function(){return this.Coefficients.length-1}},{key:"AddOrSubtract",value:function(t){if(null!=t&&this.FField===t.FField){if(this.IsZero())return t;if(t.IsZero())return this;var e=this.Coefficients.concat(),n=t.Coefficients.concat();if(e.length>n.length){var o=e.concat();e=n,n=o}var r=new P(n.length),s=n.length-e.length;s>0&&(r=n.concat());for(var a=s,l=n.length;a<l;a++)r[a]=Zf.AddOrSubtract(e[a-s],n[a]);return new i(this.FField,r)}return null}}]),i}(L),Qf=function(t){wf(i,t);var e=kf(i);function i(t){var n;Ff(this,i),(n=e.call(this)).FField=t,n.FCachedGenerators=new V;var o=new P(1);o[0]=1;var r=new qf(t,o);return n.FCachedGenerators.add(r),n}return gf(i,[{key:"Encode",value:function(t,e){if(e>0){var i=t.length-e;if(i>0){for(var n=this.BuildGenerator(e),o=new P(i),r=0;r<i;r++)o[r]=t[r];for(var s=new qf(this.FField,o),a=(s=s.MultiplyByMonomial(e,1)).Divide(n)[1].GetCoefficients(),l=e-a.length,h=0;h<l;h++)t[i+h]=0;for(var c=0,u=a.length;c<u;c++)t[i+l+c]=a[c]}}}},{key:"BuildGenerator",value:function(t){if(t>=this.FCachedGenerators.count)for(var e,i,n=this.FCachedGenerators[this.FCachedGenerators.count-1],o=new P(2),r=this.FCachedGenerators.count;r<=t;r++)o[0]=1,o[1]=this.FField.Exp(r-1+this.FField.GetGeneratorBase()),e=new qf(this.FField,o),i=n.Multiply(e),this.FCachedGenerators.add(i),n=i;return this.FCachedGenerators[t]}}]),i}(L),$f=function(t){wf(i,t);var e=kf(i);function i(t,n){var o;return Ff(this,i),(o=e.call(this)).FDataBytes=t,o.FErrorCorrectionBytes=n,o}return gf(i,[{key:"GetDataBytes",value:function(){return this.FDataBytes}},{key:"GetErrorCorrectionBytes",value:function(){return this.FErrorCorrectionBytes}}]),i}(L),td=function(t){wf(i,t);var e=kf(i);function i(){var t;return Ff(this,i),(t=e.call(this)).EncoderError=!1,t}return gf(i,[{key:"ApplyMaskPenaltyRule1Internal",value:function(t,e){var i,n,o=0,r=0,s=-1;e?(i=t.Height,n=t.Width):(i=t.Width,n=t.Height);for(var a,l=t.GetArray(),h=0;h<i;h++){for(var c=0;c<n;c++)(a=e?l[h][c]:l[c][h])==s?5==++r?o+=3:r>5&&o++:(r=1,s=a);r=0}return o}},{key:"ChooseMode",value:function(t,e){var i,n=!0,o=!0,r=!0;if(0==e){for(var s=0;s<t.length;s++)if((i=t[s])<"0"||i>"9"){n=!1;break}if(n)o=!1;else for(var a=0;a<t.length;a++)if(i=t[a],this.GetAlphanumericCode(i.charCodeAt(0))<0){o=!1;break}if(o)r=!1;else for(var l=0;l<t.length;l++)if((i=t[l]).charCodeAt(0)>255){r=!1;break}return n?{mode:xf,encoding:e}:o?{mode:Af,encoding:e}:r?{mode:Tf,encoding:3}:{mode:Tf,encoding:4}}return 1==e?{mode:xf,encoding:e}:2==e?{mode:Af,encoding:e}:{mode:Tf,encoding:e}}},{key:"FilterContent",value:function(t,e,i){for(var n="",o=!1,r=0;r<t.length;r++)o=!1,e==xf?o=t[r]>="0"&&t[r]<="9":e==Af?o=this.GetAlphanumericCode(t[r].charCodeAt(0))>0:e==Tf&&(3==i?o=t[r].charCodeAt(0)<=255:4!=i&&5!=i||(o=!0)),o&&(n+=t[r]);return n}},{key:"Append8BitBytes",value:function(t,e,i){var n=null;if(3==i){n=new Uint8Array(t.length);for(var o=0;o<t.length;o++)n[o]=255&t[o].charCodeAt(0)}else if(4==i){var r=x.getBytes(t);(n=new Uint8Array(r.length+3))[0]=239,n[1]=187,n[2]=191;for(var s=0;s<r.length;s++)n[3+s]=r[s]}else 5==i&&(n=x.getBytes(t));if(null!=n)for(var a=0;a<n.length;a++)e.AppendBits(n[a],8)}},{key:"AppendAlphanumericBytes",value:function(t,e){for(var i,n,o=t.length,r=0;r<o;){if(-1==(i=this.GetAlphanumericCode(t[r].charCodeAt(0))))return void(this.EncoderError=!0);if(r+1<o){if(-1==(n=this.GetAlphanumericCode(t[r+1].charCodeAt(0))))return void(this.EncoderError=!0);e.AppendBits(45*i+n,11),r+=2}else e.AppendBits(i,6),r++}}},{key:"AppendBytes",value:function(t,e,i,n){e==xf?this.AppendNumericBytes(t,i):e==Af?this.AppendAlphanumericBytes(t,i):e==Tf?this.Append8BitBytes(t,i,n):e==Of?this.AppendKanjiBytes():this.EncoderError=!0}},{key:"AppendKanjiBytes",value:function(){}},{key:"AppendLengthInfo",value:function(t,e,i,n){var o=Kf.GetVersionForNumber(e),r=this.GetModeCharacterCountBits(i,o);t>(1<<r)-1?this.EncoderError=!0:n.AppendBits(t,r)}},{key:"GetModeBits",value:function(t){return Lf[t]}},{key:"AppendModeInfo",value:function(t,e){e.AppendBits(this.GetModeBits(t),4)}},{key:"AppendNumericBytes",value:function(t,e){for(var i,n,o,r=t.length,s=0;s<r;)i=t[s].charCodeAt(0)-"0".charCodeAt(0),s+2<r?(n=t[s+1].charCodeAt(0)-"0".charCodeAt(0),o=t[s+2].charCodeAt(0)-"0".charCodeAt(0),e.AppendBits(100*i+10*n+o,10),s+=3):s+1<r?(n=t[s+1].charCodeAt(0)-"0".charCodeAt(0),e.AppendBits(10*i+n,7),s+=2):(e.AppendBits(i,4),s++)}},{key:"ChooseMaskPattern",value:function(t,e,i,n){for(var o,r=2147483647,s=-1,a=0;a<8;a++)(new Jf).BuildMatrix(t,e,i,a,n),(o=this.CalculateMaskPenalty(n))<r&&(r=o,s=a);return s}},{key:"GenerateECBytes",value:function(t,e){for(var i=t.length,n=new P(i+e),o=0;o<i;o++)n[o]=255&t[o];var r=Zf.CreateQRCodeField256();new Qf(r).Encode(n,e);for(var s=new Uint8Array(e),a=0;a<e;a++)s[a]=n[i+a];return s}},{key:"GetAlphanumericCode",value:function(t){return t<Ef.length?Ef[t]:-1}},{key:"GetNumDataBytesAndNumECBytesForBlockID",value:function(t,e,i,n,o,r){if(n>=i)this.EncoderError=!0;else{var s=t%i,a=i-s,l=Math.trunc(t/i),h=l+1,c=Math.trunc(e/i),u=c+1,f=l-c,d=h-u;f==d&&i==a+s&&t==(c+f)*a+(u+d)*s?n<a?(o[0]=c,r[0]=f):(o[0]=u,r[0]=d):this.EncoderError=!0}}},{key:"InterleaveWithECBytes",value:function(t,e,i,n,o){if(t.GetSizeInBytes()==i){for(var r,s,a,l,h=0,c=0,u=0,f=new P(1),d=new P(1),m=new V,y=0;y<n;y++)this.GetNumDataBytesAndNumECBytesForBlockID(e,i,n,y,f,d),r=f[0],s=new D(r),t.ToBytes(8*h,s,0,r),a=this.GenerateECBytes(s,d[0]),l=new $f(s,a),m.add(l),c=Math.max(c,r),u=Math.max(u,a.length),h+=f[0];if(i==h){for(var p=0;p<c;p++)for(var S=0;S<m.count;S++)p<(s=m[S].GetDataBytes()).length&&o.AppendBits(s[p],8);for(var v=0;v<u;v++)for(var F=0;F<m.count;F++)v<(a=m[F].GetErrorCorrectionBytes()).length&&o.AppendBits(a[v],8);e!=o.GetSizeInBytes()&&(this.EncoderError=!0)}else this.EncoderError=!0}else this.EncoderError=!0}},{key:"TerminateBits",value:function(t,e){var i=t<<3;if(e.GetSize()>i)this.FEncoderError=!0;else{for(var n=0;n<4&&e.GetSize()<i;)e.AppendBit(!1),n++;var o=7&e.GetSize();if(o>0)for(var r=o;r<8;r++)e.AppendBit(!1);for(var s=t-e.GetSizeInBytes(),a=0;a<s;a++)0==(1&a)?e.AppendBits(236,8):e.AppendBits(17,8);e.GetSize()!=i&&(this.EncoderError=!0)}}},{key:"CalculateMaskPenalty",value:function(t){var e=0;return e+=this.ApplyMaskPenaltyRule1(t),e+=this.ApplyMaskPenaltyRule2(t),e+=this.ApplyMaskPenaltyRule3(t),e+=this.ApplyMaskPenaltyRule4(t)}},{key:"ApplyMaskPenaltyRule1",value:function(t){return this.ApplyMaskPenaltyRule1Internal(t,!0)+this.ApplyMaskPenaltyRule1Internal(t,!1)}},{key:"ApplyMaskPenaltyRule2",value:function(t){for(var e,i=0,n=t.GetArray(),o=t.Width,r=t.Height,s=0;s<r-1;s++)for(var a=0;a<o-1;a++)(e=n[s][a])==n[s][a+1]&&e==n[s+1][a]&&e==n[s+1][a+1]&&(i+=3);return i}},{key:"ApplyMaskPenaltyRule3",value:function(t){for(var e=0,i=t.GetArray(),n=t.Width,o=t.Height,r=0;r<o;r++)for(var s=0;s<n;s++)s+6<n&&1==i[r][s]&&0==i[r][s+1]&&1==i[r][s+2]&&1==i[r][s+3]&&1==i[r][s+4]&&0==i[r][s+5]&&1==i[r][s+6]&&(s+10<n&&0==i[r][s+7]&&0==i[r][s+8]&&0==i[r][s+9]&&0==i[r][s+10]||s-4>=0&&0==i[r][s-1]&&0==i[r][s-2]&&0==i[r][s-3]&&0==i[r][s-4])&&(e+=40),r+6<o&&1==i[r][s]&&0==i[r+1][s]&&1==i[r+2][s]&&1==i[r+3][s]&&1==i[r+4][s]&&0==i[r+5][s]&&1==i[r+6][s]&&(r+10<o&&0==i[r+7][s]&&0==i[r+8][s]&&0==i[r+9][s]&&0==i[r+10][s]||r-4>=0&&0==i[r-1][s]&&0==i[r-2][s]&&0==i[r-3][s]&&0==i[r-4][s])&&(e+=40);return e}},{key:"ApplyMaskPenaltyRule4",value:function(t){for(var e=0,i=t.GetArray(),n=t.Width,o=t.Height,r=0;r<o;r++)for(var s=0;s<n;s++)1==i[r][s]&&e++;var a=e/(t.Height*t.Width);return Math.round(Math.abs(100*a-50)/50)}},{key:"GetModeCharacterCountBits",value:function(t,e){var i=e.VersionNumber;return Mf[t][i<=9?0:i<=26?1:2]}},{key:"Encode",value:function(t,e,i,n){var o=new Bf,r=new Bf,s=this.ChooseMode(t,e);e=s.encoding;var a=this.FilterContent(t,s.mode,e);this.AppendBytes(a,s.mode,o,e),this.AppendModeInfo(s.mode,r);var l=Kf.GetVersionForNumber(1),h=r.GetSize()+this.GetModeCharacterCountBits(s.mode,l)+o.GetSize();l=Kf.ChooseVersion(h,i);var c=r.GetSize()+this.GetModeCharacterCountBits(s.mode,l)+o.GetSize(),u=Kf.ChooseVersion(c,i),f=new Bf,d=new Bf;f.AppendBitArray(r);var m=a.length;s.mode==Tf&&(m=o.GetSizeInBytes()),this.AppendLengthInfo(m,u.VersionNumber,s.mode,f),f.AppendBitArray(o);var y=u.GetECBlocksForLevel(i),p=u.GetTotalCodewords()-y.GetTotalECCodewords();this.TerminateBits(p,f),this.InterleaveWithECBytes(f,u.GetTotalCodewords(),p,y.GetNumBlocks(),d),n.SetECLevel(i),n.Mode=s.mode,n.Version=u.VersionNumber;var S=u.GetDimensionForVersion(),v=new id(S,S);n.MaskPattern=this.ChooseMaskPattern(d,i,u.VersionNumber,v),v=new id(S,S),(new Jf).BuildMatrix(d,n.ECLevel,n.Version,n.MaskPattern,v),n.SetMatrix(v)}}]),i}(L),ed=function(t){wf(i,t);var e=kf(i);function i(){var t;return Ff(this,i),(t=e.call(this)).Matrix=null,t.ECLevel=null,t.Mode=_f,t.Version=-1,t.MatrixWidth=-1,t.MaskPattern=-1,t.NumTotalBytes=-1,t.NumDataBytes=-1,t.NumECBytes=-1,t.NumRSBlocks=-1,t.QRCodeError=!1,t}return gf(i,[{key:"At",value:function(t,e){var i=this.Matrix.Get(t,e);return 0!=i&&1!=i&&(this.QRCodeError=!0),i}},{key:"IsValid",value:function(){return null!=this.ECLevel&&-1!=this.Version&&-1!=this.MatrixWidth&&-1!=this.MaskPattern&&-1!=this.NumTotalBytes&&-1!=this.NumDataBytes&&-1!=this.NumECBytes&&-1!=this.NumRSBlocks&&this.IsValidMaskPattern(this.MaskPattern)&&this.NumTotalBytes==this.NumDataBytes+this.NumECBytes&&null!=this.Matrix&&this.MatrixWidth==this.Matrix.Width&&this.Matrix.Width==this.Matrix.Height}},{key:"IsValidMaskPattern",value:function(t){return t>=0&&t<8}},{key:"SetMatrix",value:function(t){this.Matrix=t}},{key:"SetECLevel",value:function(t){this.ECLevel=new Nf,this.ECLevel.Assign(t)}},{key:"SetAll",value:function(t,e,i,n,o,r){this.Version=t,this.NumTotalBytes=e,this.NumDataBytes=i,this.NumRSBlocks=n,this.NumECBytes=o,this.MatrixWidth=r}}]),i}(L),id=function(t){wf(i,t);var e=kf(i);function i(t,n){var o;Ff(this,i),(o=e.call(this)).Width=t,o.Height=n,o.Bytes=new k(n);for(var r=0;r<n;r++){o.Bytes[r]=new Uint8Array(t);for(var s=0;s<t;s++)o.Bytes[r][s]=0}return o}return gf(i,[{key:"Get",value:function(t,e){return 255==this.Bytes[e][t]?-1:this.Bytes[e][t]}},{key:"SetBoolean",value:function(t,e,i){this.Bytes[e][t]=255&(i?1:0)}},{key:"SetInteger",value:function(t,e,i){this.Bytes[e][t]=255&i}},{key:"GetArray",value:function(){return this.Bytes}},{key:"Assign",value:function(t){this.Bytes=t.Bytes.concat(),this.Width=t.Width,this.Height=t.Height}},{key:"Clear",value:function(t){for(var e=0;e<this.Height;e++)for(var i=0;i<this.Width;i++)this.Bytes[e][i]=t}},{key:"Hash",value:function(){for(var t,e,i="",n=0;n<this.Height;n++){t=0;for(var o=0;o<this.Width;o++)-1==(e=this.Get(o,n))&&(e=255),t+=e;i+=String.fromCharCode(t%26+65)}return i}}]),i}(L),nd=function(t){wf(i,t);var e=kf(i);function i(t,n,o){var r;return Ff(this,i),(r=e.call(this,n,o)).FText=t,r.FEncoding=Rf,r.FElements=null,r.FRows=0,r.FColumns=0,r.FPixSize=4,r.Encode(),r}return gf(i,[{key:"GenerateQRCode",value:function(t,e){var i=new Nf;i.Bits=1;var n=new td,o=new ed;return n.Encode(t,e,i,o),o.Matrix}},{key:"Encode",value:function(){""==this.FText&&or.exception(this.className+" 无效的字符!"),(this.width<0||this.height<0)&&or.exception(this.className+"无效的尺寸!"),this.FElements=this.GenerateQRCode(this.FText,this.FEncoding),this.FRows=this.FElements.Height,this.FColumns=this.FElements.Width,this.width=this.FColumns*this.FPixSize,this.height=this.FRows*this.FPixSize,this.canvas.brush.color=at.Black;var t,e=0,i=0;this.canvas.beginPath();try{for(var n=0;n<this.FRows;n++){t=this.FElements.Bytes[n],e=0;for(var o=0;o<this.FColumns;o++)1==t[o]&&this.canvas.fillBounds(e,i,this.FPixSize,this.FPixSize),e+=this.FPixSize;i+=this.FPixSize}}finally{this.canvas.paintPath()}}},{key:"Text",get:function(){return this.FText},set:function(t){this.FText!=t&&(this.FText=t,this.Encode())}}]),i}(pf),od=function(t){wf(i,t);var e=kf(i);function i(t,n){var o;return Ff(this,i),(o=e.call(this,t)).StyleNo=cs.QRCode,o.Width=100,o.Height=100,o.FQRCode=new nd(n,100,100),o}return gf(i,[{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){s.bitBlt(e.left,e.top,e.width,e.height,this.FQRCode.canvas,0,0,this.FQRCode.width,this.FQRCode.height)}},{key:"GetText",value:function(){return this.FQRCode.Text}},{key:"SetText",value:function(t){this.FQRCode.Text=t}},{key:"SaveToStreamRange",value:function(t,e,n){Sf(bf(i.prototype),"SaveToStreamRange",this).call(this,t,e,n),lp.HCSaveTextToStream(t,this.FQRCode.Text)}},{key:"LoadFromStream",value:function(t,e,n){Sf(bf(i.prototype),"LoadFromStream",this).call(this,t,e,n),this.FQRCode.Text=lp.HCLoadTextFromStream(t,n)}},{key:"ToHtml",value:function(){return""}},{key:"ToXml",value:function(t){Sf(bf(i.prototype),"ToXml",this).call(this,t),t.Value=this.FQRCode.Text}},{key:"ParseXml",value:function(t){}},{key:"RestrainSize",value:function(t,e){var i;this.Width>t&&(i=this.Width/t,this.Width=t,this.Height=Math.round(this.Height/i)),this.Height>e&&(i=this.Height/e,this.Height=e,this.Width=Math.round(this.Width/i))}}]),i}(rl);function rd(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var sd=0,ad=1,ld=2,hd=3,cd=4,ud=0,fd=1,dd=2,md=3,yd=4,pd=5,Sd=[[" "," ","00","212222"],["!","!","01","222122"],['"','"',"02","222221"],["#","#","03","121223"],["$","$","04","121322"],["%","%","05","131222"],["&","&","06","122213"],["'","'","07","122312"],["(","(","08","132212"],[")",")","09","221213"],["*","*","10","221312"],["+","+","11","231212"],[",",",","12","112232"],["-","-","13","122132"],[".",".","14","122231"],["/","/","15","113222"],["0","0","16","123122"],["1","1","17","123221"],["2","2","18","223211"],["3","3","19","221132"],["4","4","20","221231"],["5","5","21","213212"],["6","6","22","223112"],["7","7","23","312131"],["8","8","24","311222"],["9","9","25","321122"],[":",":","26","321221"],[";",";","27","312212"],["<","<","28","322112"],["=","=","29","322211"],[">",">","30","212123"],["?","?","31","212321"],["@","@","32","232121"],["A","A","33","111323"],["B","B","34","131123"],["C","C","35","131321"],["D","D","36","112313"],["E","E","37","132113"],["F","F","38","132311"],["G","G","39","211313"],["H","H","40","231113"],["I","I","41","231311"],["J","J","42","112133"],["K","K","43","112331"],["L","L","44","132131"],["M","M","45","113123"],["N","N","46","113321"],["O","O","47","133121"],["P","P","48","313121"],["Q","Q","49","211331"],["R","R","50","231131"],["S","S","51","213113"],["T","T","52","213311"],["U","U","53","213131"],["V","V","54","311123"],["W","W","55","311321"],["X","X","56","331121"],["Y","Y","57","312113"],["Z","Z","58","312311"],["[","[","59","332111"],["\\","\\","60","314111"],["]","]","61","221411"],["^","^","62","431111"],["_","_","63","111224"],[String.fromCharCode(0),"`","64","111422"],[String.fromCharCode(1),"a","65","121124"],[String.fromCharCode(2),"b","66","121421"],[String.fromCharCode(3),"c","67","141122"],[String.fromCharCode(4),"d","68","141221"],[String.fromCharCode(5),"e","69","112214"],[String.fromCharCode(6),"f","70","112412"],[String.fromCharCode(7),"g","71","122114"],[String.fromCharCode(8),"h","72","122411"],[String.fromCharCode(9),"i","73","142112"],[String.fromCharCode(10),"j","74","142211"],[String.fromCharCode(11),"k","75","241211"],[String.fromCharCode(12),"l","76","221114"],[String.fromCharCode(13),"m","77","413111"],[String.fromCharCode(14),"n","78","241112"],[String.fromCharCode(15),"o","79","134111"],[String.fromCharCode(16),"p","80","111242"],[String.fromCharCode(17),"q","81","121142"],[String.fromCharCode(18),"r","82","121241"],[String.fromCharCode(19),"s","83","114212"],[String.fromCharCode(20),"t","84","124112"],[String.fromCharCode(21),"u","85","124211"],[String.fromCharCode(22),"v","86","411212"],[String.fromCharCode(23),"w","87","421112"],[String.fromCharCode(24),"x","88","421211"],[String.fromCharCode(25),"y","89","212141"],[String.fromCharCode(26),"z","90","214121"],[String.fromCharCode(27),"{","91","412121"],[String.fromCharCode(28),"|","92","111143"],[String.fromCharCode(29),"}","93","111341"],[String.fromCharCode(30),"~","94","131141"],[String.fromCharCode(31)," ","95","114113"],[" "," ","96","114311"],[" "," ","97","411113"],[" "," ","98","411311"],[" "," ","99","113141"],[" "," "," ","114131"],[" "," "," ","311141"],[" "," "," ","411131"],[" "," "," ","211412"],[" "," "," ","211214"],[" "," "," ","211232"]],vd=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.FModul=1,this.FZoom=1,this.FWidth=1,this.FHeight=100,this.FModules=new Array(4),this.FText="",this.FCode="",this.FTextVisible=!0,this.onWidthChanged=null,this.SetText(e)}var e,i,n;return e=t,(i=[{key:"IsDigit",value:function(t){return t>=0&&t<=9}},{key:"IsFourOrMoreDigits",value:function(t,e,i){i=0;var n=t.length;if(this.IsDigit(t[e])&&e+4<n)for(;e+i<n&&this.IsDigit(t[e+i]);)i++;return{numDigits:i,result:i>=4}}},{key:"FindCodeA",value:function(t){for(var e=0,i=Sd.length;e<i;e++)if(t==Sd[e][0])return e;return-1}},{key:"FindCodeB",value:function(t){for(var e=0,i=Sd.length;e<i;e++)if(t==Sd[e][1])return e;return-1}},{key:"FindCodeC",value:function(t){for(var e=0,i=Sd.length;e<i;e++)if(t==Sd[e][2])return e;return-1}},{key:"GetNextChar",value:function(t,e,i){var n=t.length-1;if(e>n)return{index:e,encoding:i,result:""};var o="",r="";return"&"==t[e]&&e+2<=n&&";"==t[e+2]&&("A"==(r=t[e+1].toUpperCase())||"B"==r||"C"==r||"S"==r||"1"==r||"2"==r||"3"==r||"4"==r)?{index:e+=3,encoding:i,result:o="&"+r+";"}:i==hd&&e+1<=n?(o=t.substr(e,2),{index:e+=2,encoding:i,result:o}):(o=t.substr(e,1),{index:++e,encoding:i,result:o})}},{key:"StripControlCodes",value:function(t,e){for(var i,n,o="",r=0,s=t.length,a=sd;r<s;)i=(n=this.GetNextChar(t,r,a)).result,r=n.index,a=n.encoding,"&A;"!=i&&"&B;"!=i&&"&C;"!=i&&"&S;"!=i&&(!e||"&1;"!=i&&"&2;"!=i&&"&3;"!=i&&"&4;"!=i)&&(o+=i);return o}},{key:"GetNextPortion",value:function(t,e,i){var n,o,r,s,a,l,h=t.length;if(e>h-1)return{index:e,encoding:i,result:""};var c,u="",f="";"&"==t[e]&&e+2<h&&";"==t[e+2]&&("A"==(u=t[e+1].toUpperCase())||"B"==u||"C"==u||"S"==u||"1"==u||"2"==u||"3"==u||"4"==u?(u=t.substr(e,3),e+=3):u=""),n=this.FindCodeA(t[e]),o=this.FindCodeB(t[e]),a=ad,-1==n&&-1!=o?a=ld:-1!=n&&-1!=o&&(a=cd),r=0;var d=this.IsFourOrMoreDigits(t,e,r);if(r=d.numDigits,d.result&&(a=hd),a==hd)return r=2*parseInt(r/2),f=t.substr(e,r),f=i!=hd?"&C;"+u+f:u+f,{index:e+=r,encoding:i=hd,result:f};for(s=1;e+s<h&&(n=this.FindCodeA(t[e+s]),o=this.FindCodeB(t[e+s]),l=ad,-1==n&&-1!=o?l=ld:-1!=n&&-1!=o&&(l=cd),r=(d=this.IsFourOrMoreDigits(t,e+s,r)).numDigits,d.result&&(l=hd),l!=hd&&l!=a&&(a==cd?a=l:l==cd&&(l=a)),a==l);)s++;return a==cd&&(a=ld),c=a==ad?"&A;":"&B;",i==a||1!=s||i!=ad&&i!=ld||a!=ad&&a!=ld?i=a:c="&S;",f=c+u+t.substr(e,s),{index:e+=s,encoding:i,result:f}}},{key:"Encode",value:function(t){t=this.StripControlCodes(t,!1);for(var e,i="",n=0,o=sd,r=t.length;n<r;)n=(e=this.GetNextPortion(t,n,o)).index,o=e.encoding,i+=e.result;return i}},{key:"Convert",value:function(t){for(var e,i="",n=0,o=t.length;n<o;n++)e=t[n].charCodeAt()-1,or.system.isOdd(n)||(e+=5),i+=String.fromCharCode(e);return i}},{key:"GetCode",value:function(t){t=t.replace(/&FNC1;/g,"&1;"),t=this.Encode(t);var e,i,n,o=sd,r=0,s=this.GetNextChar(t,r,o);r=s.index,o=s.encoding;var a=s.result,l="";"&A;"==a?(o=ad,e=103,l=Sd[103][3]):"&B;"==a?(o=ld,e=104,l=Sd[104][3]):"&C;"==a?(o=hd,e=105,l=Sd[105][3]):or.exception("无效的条码内容!");var h=l;i=1;for(var c=t.length;r<c;)r=(s=this.GetNextChar(t,r,o)).index,o=s.encoding,"&A;"==(a=s.result)?(o=ad,n=101):"&B;"==a?(o=ld,n=100):"&C;"==a?(o=hd,n=99):"&S;"==a?(o=o==ad?ld:ad,n=98):n="&1;"==a?102:"&2;"==a?97:"&3;"==a?96:"&4;"==a?o==ad?101:100:o==ad?this.FindCodeA(a[0]):o==ld?this.FindCodeB(a[0]):this.FindCodeC(a),n<0&&or.exception("无效的条码内容!"),h+=Sd[n][3],e+=n*i,i++,"&S;"==a&&(o=o==ad?ld:ad);return h+=Sd[e%=103][3],h+="2331112",h=this.Convert(h)}},{key:"OneBarProps",value:function(t){var e,i=0;switch(t){case"0":i=this.FModules[0],e=ud;break;case"1":i=this.FModules[1],e=ud;break;case"2":i=this.FModules[2],e=ud;break;case"3":i=this.FModules[3],e=ud;break;case"5":i=this.FModules[0],e=fd;break;case"6":i=this.FModules[1],e=fd;break;case"7":i=this.FModules[2],e=fd;break;case"8":i=this.FModules[3],e=fd;break;case"A":i=this.FModules[0],e=dd;break;case"B":i=this.FModules[1],e=dd;break;case"C":i=this.FModules[2],e=dd;break;case"D":i=this.FModules[3],e=dd;break;case"F":i=this.FModules[0],e=md;break;case"G":i=this.FModules[0],e=yd;break;case"H":i=this.FModules[0],e=pd;break;default:or.exception("HCCode128计算宽度出错!")}return{w:i,lineType:e}}},{key:"GetBarWidth",value:function(t){this.FModules[0]=this.FModul,this.FModules[1]=2*this.FModul,this.FModules[2]=parseInt(3*this.FModules[1]/2),this.FModules[3]=2*this.FModules[1];for(var e=0,i=0,n=t.length;i<n;i++)e+=this.OneBarProps(t[i]).w;return e}},{key:"PaintTo",value:function(t,e){var i,n,o=0,r=this.Height;this.FTextVisible&&(r-=12);for(var s=new U,a=0,l=this.FCode.length;a<l;a++)n=(i=this.OneBarProps(this.FCode[a])).lineType,t.brush.color=n!=ud?at.Black:at.White,s.reset(o,0,o+i.w*this.FZoom,r),o=s.right,s.offset(e.left,e.top),t.fillRect(s);""==this.FCode&&(t.pen.width=1,t.pen.color=at.Black,t.rectangleRect(e)),this.FTextVisible&&(t.font.size=8,t.font.styles.clear(),t.font.name="Arial",t.font.color=at.Black,""!=this.FCode?t.textOut(e.left+(e.width-t.textWidth(this.FText))/2,e.top+r,this.FText):t.textOut(e.left+Math.trunc((e.width-t.textWidth("无效条码"+this.FText))/2),e.top+Math.trunc((e.height-t.font.height)/2),"无效条码"+this.FText))}},{key:"_calcWidth",value:function(){var t;(t=""!=this.FCode?this.GetBarWidth(this.FCode)*this.FZoom:60)!=this.FWidth&&(this.FWidth=t,null!=this.onWidthChanged&&this.onWidthChanged())}},{key:"SetText",value:function(t){if(this.FText!=t){this.FText=t;try{this.FCode=this.GetCode(this.FText)}catch(t){this.FCode=""}this._calcWidth()}}},{key:"SetZoom",value:function(t){this.FZoom!=t&&(this.FZoom=t,this._calcWidth())}},{key:"Text",get:function(){return this.FText},set:function(t){this.SetText(t)}},{key:"TextVisible",get:function(){return this.FTextVisible},set:function(t){this.FTextVisible=t}},{key:"Width",get:function(){return this.FWidth}},{key:"Height",get:function(){return this.FHeight},set:function(t){this.FHeight=t}},{key:"Zoom",get:function(){return this.FZoom},set:function(t){this.SetZoom(t)}}])&&rd(e.prototype,i),n&&rd(e,n),t}();function Fd(t){return(Fd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Id(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function gd(t,e,i){return(gd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pd(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function wd(t,e){return(wd=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Cd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Pd(t);if(e){var o=Pd(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return kd(this,i)}}function kd(t,e){return!e||"object"!==Fd(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Pd(t){return(Pd=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Dd=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wd(t,e)}(r,t);var e,i,n,o=Cd(r);function r(t,e){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(i=o.call(this,t)).StyleNo=cs.BarCode,i.FCode128=new vd(e),i.FCode128.onWidthChanged=function(){i.Width=i.FCode128.Width},i.Width=i.FCode128.Width,i.Height=100,i}return e=r,(i=[{key:"DoPaint",value:function(t,e,i,n,o,s,a,l){this.FCode128.PaintTo(a,e),gd(Pd(r.prototype),"DoPaint",this).call(this,t,e,i,n,o,s,a,l)}},{key:"GetText",value:function(){return this.FCode128.FText}},{key:"SetText",value:function(t){this.FCode128.Text=t}},{key:"SetWidth",value:function(t){gd(Pd(r.prototype),"SetWidth",this).call(this,this.FCode128.Width)}},{key:"SetHeight",value:function(t){gd(Pd(r.prototype),"SetHeight",this).call(this,t),this.FCode128.Height=this.Height}},{key:"Assign",value:function(t){gd(Pd(r.prototype),"Assign",this).call(this,t),this.FCode128.Text=t.Text}},{key:"SaveToStreamRange",value:function(t,e,i){gd(Pd(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FCode128.Text)}},{key:"LoadFromStream",value:function(t,e,i){gd(Pd(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FCode128.Text=lp.HCLoadTextFromStream(t,i)}},{key:"ToXml",value:function(t){gd(Pd(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){gd(Pd(r.prototype),"ParseXml",this).call(this,t)}},{key:"RestrainSize",value:function(t,e){this.Height>e&&(this.Height=e)}}])&&Id(e.prototype,i),n&&Id(e,n),r}(rl);function bd(t){return(bd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rd(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _d(t,e,i){return(_d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Od(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function xd(t,e){return(xd=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ad(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Od(t);if(e){var o=Od(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Td(this,i)}}function Td(t,e){return!e||"object"!==bd(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Od(t){return(Od=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Nd={None:1,Year:2,Month:4,Day:8,Hour:16,Minute:32,Second:64,Millisecond:128},Bd=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xd(t,e)}(r,t);var e,i,n,o=Ad(r);function r(t,e){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(i=o.call(this,t,e.format("yyyy-MM-dd hh:mm:ss"))).StyleNo=cs.DateTimePicker,i.FFormat="yyyy-MM-dd hh:mm:ss",i.FDateTime=e,i.Width=80,i.FPaddingLeft=2,i.FActiveArea=Nd.None,i.FAreaRect=new U,i.FNewYear="",i.FJoinKey=!1,i}return e=r,(i=[{key:"GetAreaPosition",value:function(t,e){for(var i=!1,n=-1,o=0,r=0;r<this.FFormat.length;r++)if((e?this.FFormat[r].toUpperCase():this.FFormat[r])==t)i||(i=!0),n<0&&(n=r),o++;else if(i)return{index:n,count:o};return{index:n,count:o}}},{key:"AppendFormat",value:function(t,e,i){i.reset(0,0,0,0);var n,o=0,r=-1;switch(e){case Nd.Year:o=(n=this.GetAreaPosition("y",!1)).index,r=n.count;break;case Nd.Month:o=(n=this.GetAreaPosition("M",!0)).index,r=n.count;break;case Nd.Day:o=(n=this.GetAreaPosition("d",!1)).index,r=n.count;break;case Nd.Hour:o=(n=this.GetAreaPosition("H",!0)).index,r=n.count;break;case Nd.Minute:o=(n=this.GetAreaPosition("m",!1)).index,r=n.count;break;case Nd.Second:o=(n=this.GetAreaPosition("s",!1)).index,r=n.count}if(r>0){var s="";o>0&&(s=this.FFormat.substr(0,o)),i.left=this.FPaddingLeft,""!=s&&(i.left+=t.textWidth(s));var a=t.textMetric(this.FFormat.substr(o,r));i.top=Math.trunc((this.Height-a.height)/2),i.right=i.left+a.width,i.bottom=i.top+a.height}}},{key:"GetAreaRect",value:function(t){var e=new U;if(t==Nd.None)return e;var i=Dt.getCanvasTemp();return this.OwnerData.Style.TextStyles[this.TextStyleNo].ApplyStyle(i),""!=this.FFormat&&this.AppendFormat(i,t,e),e}},{key:"GetAreaAt",value:function(t,e){return this.GetAreaRect(Nd.Year).pointInAt(t,e)?Nd.Year:this.GetAreaRect(Nd.Month).pointInAt(t,e)?Nd.Month:this.GetAreaRect(Nd.Day).pointInAt(t,e)?Nd.Day:this.GetAreaRect(Nd.Hour).pointInAt(t,e)?Nd.Hour:this.GetAreaRect(Nd.Minute).pointInAt(t,e)?Nd.Minute:this.GetAreaRect(Nd.Second).pointInAt(t,e)?Nd.Second:this.GetAreaRect(Nd.Millisecond).pointInAt(t,e)?Nd.dtaMillisecond:Nd.None}},{key:"SetDateTime",value:function(t){this.FDateTime!=t&&(this.FDateTime=t,_d(Od(r.prototype),"SetText",this).call(this,this.FDateTime.format(this.FFormat)),this.FAreaRect=this.GetAreaRect(this.FActiveArea))}},{key:"Power10",value:function(t){for(var e=10,i=2;i<=t;i++)e*=10;return e}},{key:"GetYear",value:function(t){var e=this.FDateTime.year,i=1999,n=or.system.tryParseInt(t);if(n.ok)if((i=n.value)<e){var o=this.Power10(t.length);e=Math.trunc(e/o),e=Math.trunc(e*o)+i}else e=i;return e}},{key:"SetInputYear",value:function(){""!=this.FNewYear&&(this.DateTime=X.Create(this.GetYear(this.FNewYear),this.FDateTime.month,this.FDateTime.day,this.FDateTime.hour,this.FDateTime.minute,this.FDateTime.second),this.FNewYear="")}},{key:"SetFormat",value:function(t){this.FFormat!=t&&(this.FFormat=t,this.Text=this.FDateTime.format(this.FFormat),this.FAreaRect=this.GetAreaRect(this.FActiveArea))}},{key:"DoPopup",value:function(){}},{key:"DoPaint",value:function(t,e,i,n,o,s,a,l){var h=U.CreateByRect(this.FAreaRect);h.offset(e.left,e.top),this.FActiveArea==Nd.None||this.IsSelectComplate||l.Print||(a.brush.color=t.SelColor,a.fillRect(h)),_d(Od(r.prototype),"DoPaint",this).call(this,t,e,i,n,o,s,a,l),this.FActiveArea!=Nd.Year||""==this.FNewYear||l.Print||(a.brush.color=t.SelColor,a.fillRect(h),a.textRect(h,h.left,h.top,this.FNewYear))}},{key:"SetActive",value:function(t){_d(Od(r.prototype),"SetActive",this).call(this,t),this.Active||(this.FActiveArea==Nd.Year&&this.SetInputYear(),this.FActiveArea=Nd.None)}},{key:"MouseDown",value:function(t){this.Active=U.Create(0,0,this.Width,this.Height).pointInAt(t.x,t.y);var e=this.GetAreaAt(t.x,t.y);return e!=this.FActiveArea&&(this.FActiveArea==Nd.Year&&this.SetInputYear(),this.FActiveArea=e,this.FActiveArea!=Nd.None&&(this.FAreaRect=this.GetAreaRect(this.FActiveArea)),this.OwnerData.Style.UpdateInfoRePaint()),this.DoPopup(),!0}},{key:"WantKeyDown",value:function(t){return!0}},{key:"KeyDown",value:function(t){if(this.Enabled&&!this.ReadOnly)switch(t.keyCode){case Ae:""!=this.FNewYear&&(this.FNewYear="",this.OwnerData.Style.UpdateInfoRePaint());break;case be:this.FActiveArea==Nd.Year&&(this.SetInputYear(),this.OwnerData.Style.UpdateInfoRePaint());break;case Be:this.FActiveArea>Nd.None&&(this.FActiveArea==Nd.Year&&this.SetInputYear(),this.FActiveArea=this.FActiveArea>>1,this.FAreaRect=this.GetAreaRect(this.FActiveArea),this.OwnerData.Style.UpdateInfoRePaint());break;case Me:this.FActiveArea<Nd.Millisecond&&(this.FActiveArea==Nd.Year&&this.SetInputYear(),this.FActiveArea=this.FActiveArea<<1,this.FAreaRect=this.GetAreaRect(this.FActiveArea),this.OwnerData.Style.UpdateInfoRePaint())}}},{key:"KeyPress",value:function(t){if(this.Enabled&&!this.ReadOnly){var e=String.fromCharCode(t),i=0,n=X.CreateByDateTime(this.FDateTime);if(this.FActiveArea!=Nd.None){if("0123456789".indexOf(e)>=0)switch(this.FActiveArea){case Nd.Year:this.FNewYear.length>3&&(this.FNewYear=C.stringDelete(this.FNewYear,0,1)),this.FNewYear=this.FNewYear+e;break;case Nd.Month:if((i=n.month)>9){if("0"==e)return;n=X.Create(n.year,parseInt(e),n.day,n.hour,n.minute,n.second)}else if(1==i&&this.FJoinKey)"012".indexOf(e)>=0?(i=10*i+parseInt(e),n=X.Create(n.year,i,n.day,n.hour,n.minute,n.second)):n=X.Create(n.year,parseInt(e),n.day,n.hour,n.minute,n.second);else{if("0"==e)return;n=X.Create(n.year,parseInt(e),n.day,n.hour,n.minute,n.second)}break;case Nd.Day:if((i=n.day)>9){if("0"==t)return;n=X.Create(n.year,n.month,parseInt(e),n.hour,n.minute,n.second)}else this.FJoinKey&&((i=10*i+parseInt(e))>X.DaysInMonth(n.year,n.month)&&(i=parseInt(e)),n=X.Create(n.year,n.month,i,n.hour,n.minute,n.second));break;case Nd.Hour:if((i=n.hour)>9){if("0"==e)return;n=X.Create(n.year,n.month,n.day,parseInt(e),n.minute,n.second)}else if(this.FJoinKey)(i=10*i+parseInt(e))>23&&(i=parseInt(e)),n=X.Create(n.year,n.month,n.day,i,n.minute,n.second);else{if("0"==e)return;n=X.Create(n.year,n.month,n.day,parseInt(e),n.minute,n.second)}break;case Nd.Minute:if((i=n.minute)>9){if("0"==e)return;n=X.Create(n.year,n.month,n.day,n.hour,parseInt(e),n.second)}else if(this.FJoinKey)(i=10*i+parseInt(e))>59&&(i=parseInt(e)),n=X.Create(n.year,n.month,n.day,n.hour,i,n.second);else{if("0"==e)return;n=X.Create(n.year,n.month,n.day,n.minute,parseInt(e),n.second)}break;case Nd.Second:if((i=n.second)>9){if("0"==e)return;n=X.Create(n.year,n.month,n.day,n.hour,n.minute,parseInt(e))}else if(this.FJoinKey)(i=10*i+parseInt(e))>59&&(i=parseInt(e)),n=X.Create(n.year,n.month,n.day,n.hour,n.minute,i);else{if("0"==e)return;n=X.Create(n.year,n.month,n.day,n.hour,n.minute,parseInt(e))}}this.FActiveArea!=Nd.Year&&(this.FActiveArea=this.GetAreaAt(this.FAreaRect.left,this.FAreaRect.top),this.FActiveArea!=Nd.None&&(this.FAreaRect=this.GetAreaRect(this.FActiveArea)),this.FJoinKey=!0,this.SetDateTime(n)),this.OwnerData.Style.UpdateInfoRePaint()}}}},{key:"InsertText",value:function(t){return 1==t.length&&"0123456789".indexOf(t)>=0&&this.KeyPress(t.charCodeAt(0)),!1}},{key:"SetText",value:function(t){}},{key:"Assign",value:function(t){_d(Od(r.prototype),"Assign",this).call(this,t),this.FFormat=t.Format,this.FDateTime=X.CreateByDateTime(t.DateTime)}},{key:"SaveToStreamRange",value:function(t,e,i){_d(Od(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FFormat),t.writeDateTime(this.FDateTime)}},{key:"LoadFromStream",value:function(t,e,i){_d(Od(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FFormat=lp.HCLoadTextFromStream(t,i),this.FDateTime=t.readDateTime()}},{key:"ToXml",value:function(t){_d(Od(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){_d(Od(r.prototype),"ParseXml",this).call(this,t)}},{key:"Format",get:function(){return this.FFormat},set:function(t){this.SetFormat(t)}},{key:"DateTime",get:function(){return this.FDateTime},set:function(t){this.SetDateTime(t)}}])&&Rd(e.prototype,i),n&&Rd(e,n),r}($u);function Ed(t){return(Ed="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Md(t,e,i){return(Md="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ud(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Ld(t,e){return(Ld=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Gd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Ud(t);if(e){var o=Ud(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Hd(this,i)}}function Hd(t,e){return!e||"object"!==Ed(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ud(t){return(Ud=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Vd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wd(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function zd(t,e,i){return e&&Wd(t.prototype,e),i&&Wd(t,i),t}var jd=0,Xd=1,Kd=function(){function t(){Vd(this,t),this.FChecked=!1,this.OnSetChecked=null,this.Text="",this.TextValue="",this.Rect=new U}return zd(t,[{key:"SetChecked",value:function(t){this.FChecked!=t&&(this.FChecked=t,null!=this.OnSetChecked&&this.OnSetChecked(this))}},{key:"Checked",get:function(){return this.FChecked},set:function(t){this.SetChecked(t)}}]),t}(),Yd=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ld(t,e)}(i,t);var e=Gd(i);function i(t){var n;return Vd(this,i),(n=e.call(this,t)).StyleNo=cs.RadioGroup,n.Width=100,n.FMultSelect=!1,n.FItemHit=!1,n.FColumns=0,n.FBatchCount=0,n.FColumnAlign=!0,n.FItems=new V,n.FItems.onAdded=function(t){n.DoItemNotify(t)},n.FItems.onRemoved=function(){n.ReLayout()},n.FRadioStyle=jd,n.RadioButtonWidth=16,n.BoxRight=!1,n.OnSetItemChecked=null,n}return zd(i,[{key:"ReLayout",value:function(){if(!(this.FBatchCount>0)){this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo);var t=this.FPaddingLeft,e=this.FPaddingTop,i=new H;if(0==this.FColumns){for(var n=0;n<this.FItems.count;n++)i=""!=this.FItems[n].Text?this.OwnerData.Style.TempCanvas.textMetric(this.FItems[n].Text):this.OwnerData.Style.TempCanvas.textMetric("H"),this.AutoSize&&t+i.width+this.RadioButtonWidth>this.Width&&(t=this.FPaddingLeft,e+=i.height+this.FPaddingBottom),this.FItems[n].Rect.resetBounds(t,e,this.RadioButtonWidth+i.width,i.height),t=t+this.RadioButtonWidth+i.width+this.FPaddingRight;this.AutoSize&&(this.Width=t),this.Height=e+i.height+this.FPaddingBottom}else{var o=0,r=1,s=this.FColumns;i.height=0,this.FColumns>this.FItems.count&&(s=this.FItems.count);for(var a=0;a<this.FItems.count;a++)i=""!=this.FItems[a].Text?this.OwnerData.Style.TempCanvas.textMetric(this.FItems[a].Text):this.OwnerData.Style.TempCanvas.textMetric("H"),this.FItems[a].Rect.resetBounds(t,e,this.RadioButtonWidth+i.width,i.height),t+=this.RadioButtonWidth+i.width+this.FPaddingRight,r==s?(t>o&&(o=t),a<this.FItems.count-1&&(r=1,t=this.FPaddingLeft,e+=i.height+this.FPaddingBottom)):r++;if(this.Height=e+i.height+this.FPaddingBottom,this.FColumnAlign&&this.FItems.count>0){for(var l=0;l<s-1;l++){for(r=l,o=this.FItems[r].Rect.right;r+s<this.FItems.count;)r+=s,o<this.FItems[r].Rect.right&&(o=this.FItems[r].Rect.right);for(o+=this.FPaddingRight,r=l+1,this.FItems[r].Rect.offset(o-this.FItems[r].Rect.left,0);r+s<this.FItems.count;)r+=s,this.FItems[r].Rect.offset(o-this.FItems[r].Rect.left,0)}if(this.AutoSize){for(r=s-1,o=this.FItems[r].Rect.right;r+s<this.FItems.count;)r+=s,o<this.FItems[r].Rect.right&&(o=this.FItems[r].Rect.right);this.Width=o+this.FPaddingRight}}else this.AutoSize&&(this.Width=o)}}}},{key:"GetItemAt",value:function(t,e){for(var i=0;i<this.FItems.count;i++)if(this.FItemHit){if(this.FItems[i].Rect.pointInAt(t,e))return i}else{var n=new U;if(this.BoxRight?n.resetBounds(this.FItems[i].Rect.right-this.RadioButtonWidth,this.FItems[i].Rect.top,this.RadioButtonWidth,this.RadioButtonWidth):n.resetBounds(this.FItems[i].Rect.left,this.FItems[i].Rect.top,this.RadioButtonWidth,this.RadioButtonWidth),n.pointInAt(t,e))return i}return-1}},{key:"SetColumns",value:function(t){this.FColumns!=t&&(this.FColumns=t,this.ReLayout())}},{key:"SetColumnAlign",value:function(t){this.FColumnAlign!=t&&(this.FColumnAlign=t,this.ReLayout())}},{key:"DoSetItemChecked",value:function(t,e){this.FItems[t].Checked=e,this.DoChange(),null!=this.OnSetItemChecked&&this.OnSetItemChecked(this)}},{key:"DoItemNotify",value:function(t){var e=this;t.OnSetChecked=function(t){e.DoItemSetChecked(t)},this.ReLayout()}},{key:"DoItemSetChecked",value:function(t){if(!this.FMultSelect&&t.Checked)for(var e=this.FItems.indexOf(t),i=0;i<this.FItems.count;i++)i!=e&&(this.FItems[i].Checked=!1)}},{key:"DoPaintItems",value:function(t,e){for(var i=new G,n=new U,o=0;o<=this.FItems.count-1;o++)i.x=this.FItems[o].Rect.left,i.y=this.FItems[o].Rect.top,i.offset(e.left,e.top),this.BoxRight?n.resetBounds(this.FItems[o].Rect.right+e.left-this.RadioButtonWidth,i.y,this.RadioButtonWidth,this.RadioButtonWidth):n.resetBounds(i.x,i.y,this.RadioButtonWidth,this.RadioButtonWidth),this.FItems[o].Checked?or.theme.drawFrameControl(t,n,new Set([yi]),this.FRadioStyle==jd?Fi:Ii):or.theme.drawFrameControl(t,n,new Set([]),this.FRadioStyle==jd?Fi:Ii),this.BoxRight?t.textOut(i.x,i.y,this.FItems[o].Text):t.textOut(i.x+this.RadioButtonWidth,i.y,this.FItems[o].Text)}},{key:"FormatToDrawItem",value:function(t,e){this.Width<this.FMinWidth&&(this.Width=this.FMinWidth),this.Height<this.FMinHeight&&(this.Height=this.FMinHeight)}},{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){if(Md(Ud(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l),l.Print||(this.IsSelectComplate?(a.brush.color=t.SelColor,a.fillRect(e)):this.FMouseIn&&(a.brush.color=lp.clBtnFace,a.fillRect(e))),t.TextStyles[this.TextStyleNo].ApplyStyle(a,l.ScaleY/l.Zoom),this.Enabled||l.Print||(a.font.color=at.Gray),this.AutoSize)this.DoPaintItems(a,e);else{a.save();try{a.clipRect(e),this.DoPaintItems(a,e)}finally{a.restore()}}}},{key:"MouseDown",value:function(t){var e=Md(Ud(i.prototype),"MouseDown",this).call(this,t);if(this.Enabled&&this.OwnerData.CanEdit()&&t.button==ee){var n=this.GetItemAt(t.x,t.y);n>=0&&this.DoSetItemChecked(n,!this.FItems[n].Checked)}return e}},{key:"MouseMove",value:function(t){return lp.GCursor=oe,Md(Ud(i.prototype),"MouseMove",this).call(this,t)}},{key:"GetOffsetAt",value:function(t){return t<=this.FPaddingLeft?lp.OffsetBefor:t>=this.Width-this.FPaddingRight?lp.OffsetAfter:lp.OffsetInner}},{key:"GetText",value:function(){for(var t=Md(Ud(i.prototype),"GetText",this).call(this),e=0;e<this.FItems.count;e++)this.FItems[e].Checked&&(t+=""!=t?","+this.FItems[e].Text:this.FItems[e].Text);return t}},{key:"Assign",value:function(t){Md(Ud(i.prototype),"Assign",this).call(this,t),this.FItems.clear();for(var e=0;e<t.Items.count;e++)this.AddItem(t.Items[e].Text,t.Items[e].TextValue,t.Items[e].Checked)}},{key:"BeginAdd",value:function(){this.FBatchCount++}},{key:"EndAdd",value:function(){this.FBatchCount>0&&this.FBatchCount--,0==this.FBatchCount&&this.ReLayout()}},{key:"AddItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new Kd;n.Checked=i,n.Text=t,n.TextValue=e,this.FItems.add(n)}},{key:"SetAllChecked",value:function(t){for(var e=0;e<this.FItems.count;e++)this.FItems[e].Checked=t;this.DoChange()}},{key:"SaveToStreamRange",value:function(t,e,n){Md(Ud(i.prototype),"SaveToStreamRange",this).call(this,t,e,n),t.writeByte(this.FColumns);var o=0;this.FMultSelect&&(o|=128),this.FItemHit&&(o|=64),this.FColumnAlign&&(o|=32),this.BoxRight&&(o|=16),t.writeByte(o);var r="",s="";if(this.FItems.count>0){r=this.FItems[0].Text,s=this.FItems[0].TextValue;for(var a=1;a<this.FItems.count;a++)r=r+lp.sLineBreak+this.FItems[a].Text,s=s+lp.sLineBreak+this.FItems[a].TextValue}lp.HCSaveTextToStream(t,r),lp.HCSaveTextToStream(t,s);for(var l=0;l<this.FItems.count;l++)t.writeBoolean(this.FItems[l].Checked);t.writeByte(this.FRadioStyle)}},{key:"LoadFromStream",value:function(t,e,n){Md(Ud(i.prototype),"LoadFromStream",this).call(this,t,e,n),this.BeginAdd();try{if(n>39){this.FColumns=t.readByte();var o=t.readByte();this.FMultSelect=or.system.isOdd(o>>7),this.FItemHit=or.system.isOdd(o>>6),this.FColumnAlign=or.system.isOdd(o>>5),this.BoxRight=or.system.isOdd(o>>4)}this.FItems.clear();var r=lp.HCLoadTextFromStream(t,n);if(""!=r){for(var s=r.split(lp.sLineBreak),a=0;a<s.length;a++)this.AddItem(s[a]);if(n>35&&""!=(r=lp.HCLoadTextFromStream(t,n))){s=r.split(lp.sLineBreak);for(var l=0;l<s.length;l++)this.FItems[l].TextValue=s[l]}for(var h=0;h<this.FItems.count;h++)this.FItems[h].Checked=t.readBoolean()}n>33&&(this.FRadioStyle=t.readByte())}finally{this.EndAdd()}}},{key:"ToXml",value:function(t){Md(Ud(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Md(Ud(i.prototype),"ParseXml",this).call(this,t)}},{key:"MultSelect",get:function(){return this.FMultSelect},set:function(t){this.FMultSelect=t}},{key:"RadioStyle",get:function(){return this.FRadioStyle},set:function(t){this.FRadioStyle=t}},{key:"ItemHit",get:function(){return this.FItemHit},set:function(t){this.FItemHit=t}},{key:"Columns",get:function(){return this.FColumns},set:function(t){this.SetColumns(t)}},{key:"ColumnAlign",get:function(){return this.FColumnAlign},set:function(t){this.SetColumnAlign(t)}},{key:"Items",get:function(){return this.FItems}}]),i}(Ja);function Jd(t){return(Jd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zd(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function qd(t,e,i){return(qd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=em(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Qd(t,e){return(Qd=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function $d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=em(t);if(e){var o=em(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return tm(this,i)}}function tm(t,e){return!e||"object"!==Jd(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function em(t){return(em=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var im=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Qd(t,e)}(r,t);var e,i,n,o=$d(r);function r(t,e,i){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(n=o.call(this,t)).StyleNo=cs.SupSubScript,n.FPadding=1,n.FActiveArea=up.None,n.FMouseMoveArea=up.None,n.FCaretOffset=-1,n.FSupText=e,n.FSubText=i,n.FSupRect=new U,n.FSubRect=new U,n.FMouseLBDowning=!1,n.FOutSelectInto=!1,n}return e=r,(i=[{key:"ApplySupSubStyle",value:function(t,e){t.BackColor==lp.HCTransparentColor?e.brush.style=Ft:e.brush.color=t.BackColor,e.font.color=t.Color,e.font.name=t.Family,e.font.size=Math.round(2*t.Size/3),t.FontStyles.has(_r)?e.font.styles.add(_r):e.font.styles.remove(_r),t.FontStyles.has(xr)?e.font.styles.add(xr):e.font.styles.remove(xr),t.FontStyles.has(Ar)?e.font.styles.add(Ar):e.font.styles.remove(Ar),t.FontStyles.has(Tr)?e.font.styles.add(Tr):e.font.styles.remove(Tr)}},{key:"FormatToDrawItem",value:function(t,e){var i=t.Style;this.ApplySupSubStyle(i.TextStyles[this.TextStyleNo],i.TempCanvas);var n=i.TempCanvas.textHeight("H"),o=Math.max(i.TempCanvas.textWidth(this.FSupText),this.FPadding),r=Math.max(i.TempCanvas.textWidth(this.FSubText),this.FPadding);this.Width=o>r?o+4*this.FPadding:r+4*this.FPadding,this.Height=2*n+4*this.FPadding,this.FSupRect.resetBounds(this.FPadding,this.FPadding,o,n),this.FSubRect.resetBounds(this.FPadding,this.Height-this.FPadding-n,r,n)}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){if(this.Active&&!a.Print&&(s.brush.color=lp.clBtnFace,s.fillRect(e)),!a.Print){var l=new U;this.FActiveArea!=up.None&&(this.FActiveArea==up.Top?l.resetRect(this.FSupRect):this.FActiveArea==up.Bottom&&l.resetRect(this.FSubRect),l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=at.Blue,s.rectangleRect(l)),this.FMouseMoveArea!=up.None&&this.FMouseMoveArea!=this.FActiveArea&&(this.FMouseMoveArea==up.Top?l.resetRect(this.FSupRect):this.FMouseMoveArea==up.Bottom&&l.resetRect(this.FSubRect),l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=lp.clMedGray,s.rectangleRect(l))}this.ApplySupSubStyle(t.TextStyles[this.TextStyleNo],s,a.ScaleY/a.Zoom),s.textOut(e.left+this.FSupRect.left,e.top+this.FSupRect.top,this.FSupText),s.textOut(e.left+this.FSubRect.left,e.top+this.FSubRect.top,this.FSubText)}},{key:"GetOffsetAt",value:function(t){return this.FOutSelectInto?qd(em(r.prototype),"GetOffsetAt",this).call(this,t):t<=0?lp.OffsetBefor:t>=this.Width?lp.OffsetAfter:lp.OffsetInner}},{key:"SetActive",value:function(t){qd(em(r.prototype),"SetActive",this).call(this,t),t||(this.FActiveArea=up.None)}},{key:"MouseLeave",value:function(){qd(em(r.prototype),"MouseLeave",this).call(this),this.FMouseMoveArea=up.None}},{key:"MouseDown",value:function(t){var e=qd(em(r.prototype),"MouseDown",this).call(this,t);this.FMouseLBDowning=t.button==ee&&!or.keyDownStates[Re],this.FOutSelectInto=!1,this.FMouseMoveArea!=this.FActiveArea&&(this.FActiveArea=this.FMouseMoveArea,this.OwnerData.Style.UpdateInfoReCaret());var i="",n=0;this.FActiveArea==up.Top?(i=this.FSupText,n=t.x-this.FSupRect.left):this.FActiveArea==up.Bottom&&(i=this.FSubText,n=t.x-this.FSubRect.left);var o=0;return this.FActiveArea!=up.None?(this.ApplySupSubStyle(this.OwnerData.Style.TextStyles[this.TextStyleNo],this.OwnerData.Style.TempCanvas),o=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,i,n)):o=-1,o!=this.FCaretOffset&&(this.FCaretOffset=o,this.OwnerData.Style.UpdateInfoReCaret()),e}},{key:"MouseMove",value:function(t){if(this.FMouseLBDowning||t.button!=ee||or.keyDownStates[Re]||(this.FOutSelectInto=!0),this.FOutSelectInto)this.FMouseMoveArea=up.None;else{var e=this.GetExpressArea(t.x,t.y);e!=this.FMouseMoveArea&&(this.FMouseMoveArea=e,this.OwnerData.Style.UpdateInfoRePaint())}return qd(em(r.prototype),"MouseMove",this).call(this,t)}},{key:"MouseUp",value:function(t){return this.FMouseLBDowning=!1,this.FOutSelectInto=!1,qd(em(r.prototype),"MouseUp",this).call(this,t)}},{key:"KeyDown",value:function(t){switch(t.keyCode){case Pe:this.FActiveArea==up.Top?this.FCaretOffset>0&&(this.FSupText=C.stringDelete(this.FSupText,this.FCaretOffset-1,1),this.FCaretOffset--):this.FActiveArea==up.Bottom&&this.FCaretOffset>0&&(this.FSubText=C.stringDelete(this.FSubText,this.FCaretOffset-1,1),this.FCaretOffset--),this.FormatDirty();break;case Be:this.FCaretOffset>0&&this.FCaretOffset--;break;case Me:var e="";this.FActiveArea==up.Top?e=this.FSupText:this.FActiveArea==up.Bottom&&(e=this.FSubText),this.FCaretOffset<e.length&&this.FCaretOffset--;break;case Ge:this.FActiveArea==up.Top?this.FCaretOffset<this.FSupText.length&&(this.FSupText=C.stringDelete(this.FSupText,this.FCaretOffset,1)):this.FActiveArea==up.Bottom&&this.FCaretOffset<this.FSubText.length&&(this.FSubText=C.stringDelete(this.FSubText,this.FCaretOffset,1)),this.FormatDirty();break;case Ne:this.FCaretOffset=0;break;case Oe:this.FActiveArea==up.Top?this.FCaretOffset=this.FSupText.length:this.FActiveArea==up.Bottom&&(this.FCaretOffset=this.FSubText.length)}}},{key:"KeyPress",value:function(t){if(this.FActiveArea==up.None)return 0;this.InsertText(String.fromCharCode(t))}},{key:"InsertText",value:function(t){return this.FActiveArea!=up.None&&(this.FActiveArea==up.Top?this.FSupText=C.stringInsert(this.FSupText,this.FCaretOffset,t):this.FActiveArea==up.Bottom&&(this.FSubText=C.stringInsert(this.FSubText,this.FCaretOffset,t)),this.FCaretOffset+=t.length,this.FormatDirty(),!0)}},{key:"GetCaretInfo",value:function(t){this.FActiveArea!=up.None?(this.ApplySupSubStyle(this.OwnerData.Style.TextStyles[this.TextStyleNo],this.OwnerData.Style.TempCanvas),this.FActiveArea==up.Top?(t.Height=this.FSupRect.bottom-this.FSupRect.top,t.X=this.FSupRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FSupText.substr(0,this.FCaretOffset)),t.Y=this.FSupRect.top):this.FActiveArea==up.Bottom&&(t.Height=this.FSubRect.bottom-this.FSubRect.top,t.X=this.FSubRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FSubText.substr(0,this.FCaretOffset)),t.Y=this.FSubRect.top)):t.Visible=!1}},{key:"GetExpressArea",value:function(t,e){var i=up.None;return this.FSupRect.pointInAt(t,e)?i=up.Top:this.FSubRect.pointInAt(t,e)&&(i=up.Bottom),i}},{key:"Assign",value:function(t){qd(em(r.prototype),"Assign",this).call(this,t),this.FSupText=t.SupText,this.FSubText=t.SubText}},{key:"WantKeyDown",value:function(t){return!0}},{key:"SaveToStreamRange",value:function(t,e,i){qd(em(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FSupText),lp.HCSaveTextToStream(t,this.FSubText)}},{key:"LoadFromStream",value:function(t,e,i){qd(em(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FSupText=lp.HCLoadTextFromStream(t,i),this.FSubText=lp.HCLoadTextFromStream(t,i)}},{key:"ToXml",value:function(t){qd(em(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){qd(em(r.prototype),"ParseXml",this).call(this,t)}},{key:"SupRect",get:function(){return this.FSupRect},set:function(t){this.FSupRect=t}},{key:"SubRect",get:function(){return this.FSubRect},set:function(t){this.FSubRect=t}},{key:"SupText",get:function(){return this.FSupText},set:function(t){this.FSupText=t}},{key:"SubText",get:function(){return this.FSubText},set:function(t){this.FSubText=t}}])&&Zd(e.prototype,i),n&&Zd(e,n),r}(Ya);function nm(t){return(nm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function om(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function rm(t,e,i){return(rm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=hm(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function sm(t,e){return(sm=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function am(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=hm(t);if(e){var o=hm(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return lm(this,i)}}function lm(t,e){return!e||"object"!==nm(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function hm(t){return(hm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var cm=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&sm(t,e)}(r,t);var e,i,n,o=am(r);function r(t,e){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(i=o.call(this,t)).StyleNo=cs.Button,i.FText=e,i.FDown=!1,i.OnClick=null,i}return e=r,(i=[{key:"GetText",value:function(){return this.FText}},{key:"SetText",value:function(t){this.FText=t}},{key:"MouseLeave",value:function(){this.FDown=!1,rm(hm(r.prototype),"MouseLeave",this).call(this)}},{key:"MouseMove",value:function(t){return lp.GCursor=re,rm(hm(r.prototype),"MouseMove",this).call(this,t)}},{key:"MouseDown",value:function(t){return this.Enabled&&this.ClientRect().pointInAt(t.x,t.y)&&(this.FDown=t.button===ee),rm(hm(r.prototype),"MouseDown",this).call(this,t)}},{key:"MouseUp",value:function(t){return this.FDown=!1,rm(hm(r.prototype),"MouseUp",this).call(this,t)}},{key:"FormatToDrawItem",value:function(t,e){if(this.AutoSize){t.Style.ApplyTempStyle(this.TextStyleNo);var i=t.Style.TempCanvas.textMetric(this.FText);this.Width=this.FPaddingLeft+this.FPaddingRight+i.width,this.Height=this.FPaddingTop+this.FPaddingBottom+i.height}this.Width<this.FMinWidth&&(this.Width=this.FMinWidth),this.Height<this.FMinHeight&&(this.Height=this.FMinHeight)}},{key:"DoPaint",value:function(t,e,i,n,o,s,a,l){rm(hm(r.prototype),"DoPaint",this).call(this,t,e,i,n,o,s,a,l),this.IsSelectComplate?a.brush.color=t.SelColor:this.FDown?a.brush.color=lp.clHighlight:this.FMouseIn?a.brush.color=lp.clBtnFace:a.brush.color=lp.clMedGray,a.fillRect(e),t.TextStyles[this.TextStyleNo].ApplyStyle(a,l.ScaleY/l.Zoom);var h=a.textMetric(this.FText);a.textOut(e.left+(e.width-h.width)/2,e.top+(e.height-h.height)/2,this.FText)}},{key:"Assign",value:function(t){rm(hm(r.prototype),"Assign",this).call(this,t),this.FText=t.Text}},{key:"SaveToStreamRange",value:function(t,e,i){rm(hm(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FText)}},{key:"LoadFromStream",value:function(t,e,i){rm(hm(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FText=lp.HCLoadTextFromStream(t,i)}},{key:"ToXml",value:function(t){rm(hm(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){rm(hm(r.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return rm(hm(r.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){rm(hm(r.prototype),"ParseJSONOjbect",this).call(this,t)}}])&&om(e.prototype,i),n&&om(e,n),r}(Ja);function um(t){return(um="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fm(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function dm(t,e,i){return(dm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Sm(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function mm(t,e){return(mm=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ym(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Sm(t);if(e){var o=Sm(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return pm(this,i)}}function pm(t,e){return!e||"object"!==um(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Sm(t){return(Sm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var vm=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mm(t,e)}(r,t);var e,i,n,o=ym(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).StyleNo=cs.Bullet,e.FBulletStyle=Cp.Symbol,e.FText="●",e.FPrefix="",e.FSuffix="",e.Width=t.Style.TextStyles[e.TextStyleNo].FontHeight,e.Height=e.Width,e}return e=r,(i=[{key:"GetText",value:function(){return this.FText}},{key:"SetText",value:function(t){this.FText=t}},{key:"FormatToDrawItem",value:function(t,e){t.Style.ApplyTempStyle(this.TextStyleNo);var i=t.Style.TempCanvas.textMetric(this.FText);this.Width=i.width+5,this.Height=i.height}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){this.IsSelectComplate&&(s.brush.color=t.SelColor,s.fillRect(e)),s.brush.style=Ft,t.TextStyles[this.TextStyleNo].ApplyStyle(s,a.ScaleY/a.Zoom),s.textOut(e.left,e.top+(e.bottom-e.top-this.Height)/2,this.FText)}},{key:"Assign",value:function(t){dm(Sm(r.prototype),"Assign",this).call(this,t),this.FText=t.Text}},{key:"SaveToStreamRange",value:function(t,e,i){dm(Sm(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),t.writeByte(this.FBulletStyle),lp.HCSaveTextToStream(t,this.FText)}},{key:"LoadFromStream",value:function(t,e,i){dm(Sm(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FBulletStyle=t.readByte(),this.FText=lp.HCLoadTextFromStream(t,i)}},{key:"ToXml",value:function(t){dm(Sm(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){dm(Sm(r.prototype),"ParseXml",this).call(this,t)}},{key:"SetOrderNumber",value:function(t){switch(this.FBulletStyle){case Cp.OrderCustom:this.FText=this.FPrefix+t.toString()+this.FSuffix;break;case Cp.hbsOrderRoman:this.FText=this.FPrefix+lp.ROMANUMBER[t-1]+this.FSuffix;break;case Cp.hbsOrderCustomCircle:this.FText=this.FPrefix+lp.CIRCLENUMBER[t-1]+this.FSuffix;break;default:this.FText=t.toString()}}},{key:"BulletStyle",get:function(){return this.FBulletStyle},set:function(t){this.FBulletStyle=t}},{key:"Prefix",get:function(){return this.FPrefix},set:function(t){this.FPrefix=t}},{key:"Suffix",get:function(){return this.FSuffix},set:function(t){this.FSuffix=t}}])&&fm(e.prototype,i),n&&fm(e,n),r}(Ya);function Fm(t){return(Fm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Im(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gm(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function wm(t,e,i){return e&&gm(t.prototype,e),i&&gm(t,i),t}function Cm(t,e,i){return(Cm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Rm(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function km(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pm(t,e)}function Pm(t,e){return(Pm=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Dm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Rm(t);if(e){var o=Rm(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return bm(this,i)}}function bm(t,e){return!e||"object"!==Fm(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Rm(t){return(Rm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var _m=function(t){km(i,t);var e=Dm(i);function i(t){var n;return Im(this,i),(n=e.call(this,t)).FLeft=0,n.FTop=0,n.FLock=!1,n.FPageIndex=-1,n.FDrawRect=new U,n.FMousePt=new G,n}return wm(i,[{key:"PointInClient",value:function(t,e){return U.CreateByBounds(0,0,this.Width,this.Height).pointInAt(t,e)}},{key:"Assign",value:function(t){Cm(Rm(i.prototype),"Assign",this).call(this,t),this.FLeft=t.Left,this.FTop=t.Top,this.Width=t.Width,this.Height=t.Height}},{key:"MouseDown",value:function(t){if(this.FLock)return this.Active;var e=Cm(Rm(i.prototype),"MouseDown",this).call(this,t);return this.Resizing||this.FMousePt.reset(t.x,t.y),e}},{key:"MouseMove",value:function(t){if(this.FLock)return this.Active;var e=Cm(Rm(i.prototype),"MouseMove",this).call(this,t);return this.Resizing||t.button!=ee||or.keyDownStates[Re]||(this.FLeft+=t.x-this.FMousePt.x,this.FTop+=t.y-this.FMousePt.y),e}},{key:"MouseUp",value:function(t){if(this.FLock)return!1;var e=!1;if(this.Resizing){if(this.Resizing=!1,this.ResizeWidth<1||this.ResizeHeight<1)return e;this.Width=this.ResizeWidth,this.Height=this.ResizeHeight,e=!0}return e}},{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){Cm(Rm(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l),this.Active&&a.rectangleRect(this.FDrawRect)}},{key:"SaveToStreamRange",value:function(t,e,i){t.writeInt32(this.StyleNo),t.writeInt32(this.FLeft),t.writeInt32(this.FTop),t.writeInt32(this.Width),t.writeInt32(this.Height),t.writeInt32(this.FPageIndex),t.writeBoolean(this.FLock)}},{key:"LoadFromStream",value:function(t,e,i){this.FLeft=t.readInt32(),this.FTop=t.readInt32(),this.Width=t.readInt32(),this.Height=t.readInt32(),i>28&&(this.FPageIndex=t.readInt32()),this.FLock=i>37&&t.readBoolean()}},{key:"ToXml",value:function(t){t.SetAttribute("sno",this.StyleNo.toString()),t.SetAttribute("left",this.FLeft.toString()),t.SetAttribute("top",this.FTop.toString()),t.SetAttribute("width",this.Width.toString()),t.SetAttribute("height",this.Height.toString()),t.SetAttribute("pageindex",this.FPageIndex.toString()),this.FLock&&t.SetAttribute("lock",this.FLock.toString())}},{key:"ParseXml",value:function(t){}},{key:"DrawRect",get:function(){return this.FDrawRect},set:function(t){this.FDrawRect=t}},{key:"Left",get:function(){return this.FLeft},set:function(t){this.FLeft=t}},{key:"Top",get:function(){return this.FTop},set:function(t){this.FTop=t}},{key:"PageIndex",get:function(){return this.FPageIndex},set:function(t){this.FPageIndex=t}},{key:"Lock",get:function(){return this.FLock},set:function(t){this.FLock=t}}]),i}(rl),xm=function(t){km(i,t);var e=Dm(i);function i(){var t;return Im(this,i),(t=e.call(this)).OnInsertItem=null,t.OnRemoveItem=null,t}return wm(i,[{key:"doAdded_",value:function(t){Cm(Rm(i.prototype),"doAdded_",this).call(this,t),null!=this.OnInsertItem&&this.OnInsertItem(t)}},{key:"doRemoved_",value:function(t){Cm(Rm(i.prototype),"doRemoved_",this).call(this,t),null!=this.OnRemoveItem&&this.OnRemoveItem(t)}}]),i}(V);function Am(t){return(Am="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tm(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Om(t,e,i){return(Om="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mm(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Nm(t,e){return(Nm=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Bm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Mm(t);if(e){var o=Mm(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Em(this,i)}}function Em(t,e){return!e||"object"!==Am(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Mm(t){return(Mm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lm=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Nm(t,e)}(r,t);var e,i,n,o=Bm(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).StyleNo=cs.FloatLine,e.Width=100,e.Height=70,e.FLeftTop=null,e.FShapeLine=Uc.Create(G.Create(0,0),G.Create(e.Width,e.Height)),e}return e=r,(i=[{key:"GetShapeLeftTop",value:function(){var t=new G;return this.FShapeLine.StartPt.x<this.FShapeLine.EndPt.x?t.x=this.FShapeLine.StartPt.x:t.x=this.FShapeLine.EndPt.x,this.FShapeLine.StartPt.y<this.FShapeLine.EndPt.y?t.y=this.FShapeLine.StartPt.y:t.y=this.FShapeLine.EndPt.y,t}},{key:"SetActive",value:function(t){Om(Mm(r.prototype),"SetActive",this).call(this,t),this.FShapeLine.Active=this.Active}},{key:"PointInClient",value:function(t,e){return this.FShapeLine.PointInClient(t,e)}},{key:"Assign",value:function(t){Om(Mm(r.prototype),"Assign",this).call(this,t),this.FShapeLine.Assign(t.FShapeLine)}},{key:"MouseDown",value:function(t){var e=this.FShapeLine.MouseDown(t);return this.Active=this.FShapeLine.ActiveObj!=Mc,this.Active&&t.button==ee&&(this.Resizing=this.FShapeLine.ActiveObj==Gc||this.FShapeLine.ActiveObj==Hc,this.Resizing?(this.FResizeX=t.x,this.FResizeY=t.y,this.FLeftTop=this.GetShapeLeftTop()):this.FShapeLine.ActiveObj==Lc&&(this.FLeftTop=this.GetShapeLeftTop())),e}},{key:"MouseMove",value:function(t){var e=this.FShapeLine.MouseMove(t);return this.Active&&this.Resizing&&(this.FResizeX=t.x,this.FResizeY=t.y),e&&(lp.GCursor=this.FShapeLine.Cursor),e}},{key:"_CalcNewLeftTop",value:function(){var t=this.GetShapeLeftTop();this.Left=this.Left+t.x-this.FLeftTop.x,this.Top=this.Top+t.y-this.FLeftTop.y,this.FShapeLine.StartPt.reset(this.FShapeLine.StartPt.x-t.x,this.FShapeLine.StartPt.y-t.y),this.FShapeLine.EndPt.reset(this.FShapeLine.EndPt.x-t.x,this.FShapeLine.EndPt.y-t.y)}},{key:"MouseUp",value:function(t){return this.Resizing?(this.Resizing=!1,this._CalcNewLeftTop(),this.Width=Math.abs(this.FShapeLine.EndPt.x-this.FShapeLine.StartPt.x),this.Height=Math.abs(this.FShapeLine.EndPt.y-this.FShapeLine.StartPt.y)):this.FShapeLine.ActiveObj==Lc&&this._CalcNewLeftTop(),this.FShapeLine.MouseUp(t)}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){this.FShapeLine.PaintTo(s,e,a)}},{key:"SaveToStreamRange",value:function(t,e,i){Om(Mm(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),this.FShapeLine.SaveToStream(t)}},{key:"LoadFromStream",value:function(t,e,i){if(Om(Mm(r.prototype),"LoadFromStream",this).call(this,t,e,i),i>26)this.FShapeLine.LoadFromStream(t);else{this.FShapeLine.Width=1,this.FShapeLine.Color=at.Black;var n=t.readInt32(),o=t.readInt32();this.FShapeLine.StartPt.reset(n,o),n=t.readInt32(),o=t.readInt32(),this.FShapeLine.EndPt.reset(n,o)}}},{key:"ToXml",value:function(t){Om(Mm(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Om(Mm(r.prototype),"ParseXml",this).call(this,t)}}])&&Tm(e.prototype,i),n&&Tm(e,n),r}(_m);function Gm(t){return(Gm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hm(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Um(t,e,i){return(Um="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=jm(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Vm(t,e){return(Vm=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Wm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=jm(t);if(e){var o=jm(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return zm(this,i)}}function zm(t,e){return!e||"object"!==Gm(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function jm(t){return(jm=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Xm=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Vm(t,e)}(r,t);var e,i,n,o=Wm(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).StyleNo=cs.FloatBarCode,e.FAutoSize=!0,e.FCode128=new vd("123456"),e.FCode128.onWidthChanged=function(){e.doCodeWidthChanged()},e.Width=e.FCode128.Width,e.Height=100,e}return e=r,(i=[{key:"doCodeWidthChanged",value:function(){this.Width=this.FCode128.Width}},{key:"GetPenWidth",value:function(){return this.FCode128.Zoom}},{key:"SetPenWidth",value:function(t){this.FCode128.Zoom=t}},{key:"GetShowText",value:function(){return this.FCode128.TextVisible}},{key:"SetShowText",value:function(t){this.FCode128.TextVisible=t}},{key:"GetText",value:function(){return this.FCode128.Text}},{key:"SetText",value:function(t){this.FCode128.Text=t}},{key:"SetWidth",value:function(t){Um(jm(r.prototype),"SetWidth",this).call(this,this.FCode128.Width)}},{key:"SetHeight",value:function(t){Um(jm(r.prototype),"SetHeight",this).call(this,t),this.FCode128.Height=this.Height}},{key:"Assign",value:function(t){Um(jm(r.prototype),"Assign",this).call(this,t),this.FCode128.Text=t.Text}},{key:"DoPaint",value:function(t,e,i,n,o,s,a,l){this.FCode128.PaintTo(a,e),Um(jm(r.prototype),"DoPaint",this).call(this,t,e,i,n,o,s,a,l)}},{key:"SaveToStreamRange",value:function(t,e,i){Um(jm(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FCode128.Text),t.writeBoolean(this.FAutoSize),t.writeBoolean(this.FCode128.TextVisible),t.writeByte(this.FCode128.Zoom)}},{key:"LoadFromStream",value:function(t,e,i){Um(jm(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FCode128.Text=lp.HCLoadTextFromStream(t,i),i>34&&(this.FAutoSize=t.readBoolean(),this.FCode128.TextVisible=t.readBoolean(),this.FCode128.Zoom=t.readByte())}},{key:"ToXml",value:function(t){Um(jm(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Um(jm(r.prototype),"ParseXml",this).call(this,t)}},{key:"PenWidth",get:function(){return this.GetPenWidth()},set:function(t){this.SetPenWidth(t)}},{key:"AutoSize",get:function(){return this.FAutoSize},set:function(t){this.FAutoSize=t}},{key:"ShowText",get:function(){return this.GetShowText()},set:function(t){this.SetShowText(t)}}])&&Hm(e.prototype,i),n&&Hm(e,n),r}(_m);function Km(t){return(Km="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ym(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Jm(t,e,i){return(Jm="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$m(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Zm(t,e){return(Zm=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=$m(t);if(e){var o=$m(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Qm(this,i)}}function Qm(t,e){return!e||"object"!==Km(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function $m(t){return($m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ty=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Zm(t,e)}(r,t);var e,i,n,o=qm(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).StyleNo=cs.FloatQRCode,e.FQRCode=new nd("http://www.hcview.cn",100,100),e.Width=100,e.Height=100,e}return e=r,(i=[{key:"GetText",value:function(){return this.FQRCode.Text}},{key:"SetText",value:function(t){this.FQRCode.Text=t}},{key:"Assign",value:function(t){Jm($m(r.prototype),"Assign",this).call(this,t),this.FText=t.Text}},{key:"DoPaint",value:function(t,e,i,n,o,s,a,l){a.bitBlt(e.left,e.top,this.FQRCode.width,this.FQRCode.height,this.FQRCode.canvas,0,0,this.FQRCode.width,this.FQRCode.height),Jm($m(r.prototype),"DoPaint",this).call(this,t,e,i,n,o,s,a,l)}},{key:"SaveToStreamRange",value:function(t,e,i){Jm($m(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FQRCode.Text)}},{key:"LoadFromStream",value:function(t,e,i){Jm($m(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FQRCode.Text=lp.HCLoadTextFromStream(t,i)}},{key:"ToXml",value:function(t){Jm($m(r.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Jm($m(r.prototype),"ParseXml",this).call(this,t)}}])&&Ym(e.prototype,i),n&&Ym(e,n),r}(_m);function ey(t){return(ey="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function iy(t,e,i){return(iy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=sy(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function ny(t,e){return(ny=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function oy(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=sy(t);if(e){var o=sy(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ry(this,i)}}function ry(t,e){return!e||"object"!==ey(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function sy(t){return(sy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ay(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ly(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function hy(t,e,i){return e&&ly(t.prototype,e),i&&ly(t,i),t}var cy=function(){function t(){ay(this,t),this.Title="",this.Text=""}return hy(t,[{key:"SaveToStream",value:function(t){lp.HCSaveTextToStream(t,this.Title),lp.HCSaveTextToStream(t,this.Text)}},{key:"LoadFromStream",value:function(t,e){this.Title=lp.HCLoadTextFromStream(t,e),this.Text=lp.HCLoadTextFromStream(t,e)}},{key:"ToXml",value:function(t){}},{key:"ParseXml",value:function(t){}}]),t}(),uy=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ny(t,e)}(i,t);var e=oy(i);function i(t){var n;return ay(this,i),(n=e.call(this,t)).StyleNo=cs.Annotate,n.FDrawRect=new U,n.FContent=new cy,n.Replys=new V,n.ID=0,n.MarkType=Pp.Beg,n.Width=0,n.Height=0,n}return hy(i,[{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){iy(sy(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l),l.Print||(this.FDrawRect.resetRect(e),l.topItems.add(this))}},{key:"Assign",value:function(t){iy(sy(i.prototype),"Assign",this).call(this,t),this.FContent.Text=t.Content.Text,this.FContent.Title=t.Content.Title,this.ID=t.ID}},{key:"IsBeginMark",value:function(){return this.MarkType===Pp.Beg}},{key:"IsEndMark",value:function(){return this.MarkType===Pp.End}},{key:"GetOffsetAt",value:function(t){return t>=0&&t<=this.Width?this.MarkType===Pp.Beg?lp.OffsetAfter:lp.OffsetBefor:iy(sy(i.prototype),"GetOffsetAt",this).call(this,t)}},{key:"JustifySplit",value:function(){return!1}},{key:"FormatToDrawItem",value:function(t,e){if(this.Width=0,this.Height=t.Style.TextStyles[0].FontHeight-t.Style.LineSpaceMin,this.MarkType===Pp.Beg)if(e<t.Items.count-1){var i=t.Items[e+1];(i.StyleNo===this.StyleNo&&i.MarkType===Pp.End||i.ParaFirst)&&(this.Width=10)}else this.Width=10;else{var n=t.Items[e-1];(n.StyleNo==this.StyleNo&&n.MarkType===Pp.Beg||this.ParaFirst)&&(this.Width=10)}}},{key:"PaintTop",value:function(t){iy(sy(i.prototype),"PaintTop",this).call(this,t),t.pen.width=1,this.MarkType===Pp.Beg?(t.pen.width=1,t.pen.style=pt.Solid,t.pen.color=at.Red,t.drawLineDriect(this.FDrawRect.left,this.FDrawRect.top-1,this.FDrawRect.left,this.FDrawRect.bottom+1)):(t.pen.width=1,t.pen.style=pt.Solid,t.pen.color=at.Red,t.drawLineDriect(this.FDrawRect.right,this.FDrawRect.top-1,this.FDrawRect.right,this.FDrawRect.bottom+1))}},{key:"SaveToStreamRange",value:function(t,e,n){if(iy(sy(i.prototype),"SaveToStreamRange",this).call(this,t,e,n),t.writeUInt32(this.ID),t.writeByte(this.MarkType),this.MarkType===Pp.End){this.FContent.SaveToStream(t);var o=this.Replys.Count;t.writeUInt32(o);for(var r=0;r<o;r++)this.Replys[r].SaveToStream(t)}}},{key:"LoadFromStream",value:function(t,e,n){if(iy(sy(i.prototype),"LoadFromStream",this).call(this,t,e,n),this.ID=t.readUInt32(),this.MarkType=t.readByte(),this.MarkType===Pp.End){this.FContent.LoadFromStream(t,n);var o=t.readUInt32();if(o>0)for(var r=null,s=0;s<o;s++)(r=new cy).LoadFromStream(t,n),this.Replys.add(r)}}},{key:"ToXml",value:function(t){iy(sy(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){iy(sy(i.prototype),"ParseXml",this).call(this,t)}},{key:"Content",get:function(){return this.FContent}}]),i}(Wa);function fy(t){return(fy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dy(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function my(t,e,i){return(my="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=vy(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function yy(t,e){return(yy=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function py(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=vy(t);if(e){var o=vy(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Sy(this,i)}}function Sy(t,e){return!e||"object"!==fy(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function vy(t){return(vy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Fy=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yy(t,e)}(r,t);var e,i,n,o=py(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).FMouseLBDouble=!1,e.FMouseDownReCaret=!1,e.FMouseDownX=-1,e.FMouseDownY=-1,e.FMouseMoveDrawItemNo=-1,e.FSelectSeekNo=-1,e.FSelectSeekOffset=-1,e.FReadOnly=!1,e.FCheckEmptyItem=!1,e.OnItemResized=null,e.OnItemMouseDown=null,e.OnItemMouseUp=null,e.OnDrawItemMouseMove=null,e.OnCreateItem=null,e.OnAcceptAction=null,e.InitializeField(),e.SetEmptyData(),e}return e=r,(i=[{key:"SelectByMouseDownShift",value:function(t,e){var i,n=!0,o=-1,r=-1;return this.SelectExists()?this.IsSelectSeekStart()?t<this.FSelectSeekNo||t==this.FSelectSeekNo&&e<this.FSelectSeekOffset||t>this.FSelectSeekNo&&t<this.SelectInfo.EndItemNo||t==this.FSelectSeekNo&&e>this.FSelectSeekOffset||t==this.SelectInfo.EndItemNo&&e<this.SelectInfo.EndItemOffset?(o=this.SelectInfo.EndItemNo,r=this.SelectInfo.EndItemOffset,t=(i=this.AdjustSelectRange(t,e,o,r)).startItemNo,e=i.startItemOffset,o=i.endItemNo,r=i.endItemOffset):t>this.SelectInfo.EndItemNo||t==this.SelectInfo.EndItemNo&&e>this.SelectInfo.EndItemOffset?(o=this.SelectInfo.EndItemNo,r=this.SelectInfo.EndItemOffset,o=(i=this.AdjustSelectRange(o,r,t,e)).startItemNo,r=i.startItemOffset,t=i.endItemNo,e=i.endItemOffset):n=!1:t>this.FSelectSeekNo||t==this.FSelectSeekNo&&e>this.FSelectSeekOffset||t>this.SelectInfo.StartItemNo&&t<this.FSelectSeekNo||t==this.FSelectSeekNo&&e<this.FSelectSeekOffset||t==this.SelectInfo.StartItemNo&&e>this.SelectInfo.StartItemOffset?(o=this.SelectInfo.StartItemNo,r=this.SelectInfo.StartItemOffset,o=(i=this.AdjustSelectRange(o,r,t,e)).startItemNo,r=i.startItemOffset,t=i.endItemNo,e=i.endItemOffset):t<this.SelectInfo.StartItemNo||t==this.SelectInfo.StartItemNo&&e<this.SelectInfo.StartItemOffset?(o=this.SelectInfo.StartItemNo,r=this.SelectInfo.StartItemOffset,t=(i=this.AdjustSelectRange(t,e,o,r)).startItemNo,e=i.startItemOffset,o=i.endItemNo,r=i.endItemOffset):n=!1:this.SelectInfo.StartItemNo>=0&&(t<this.SelectInfo.StartItemNo||t==this.SelectInfo.StartItemNo&&e<this.SelectInfo.StartItemOffset?(o=this.SelectInfo.StartItemNo,r=this.SelectInfo.StartItemOffset,t=(i=this.AdjustSelectRange(t,e,o,r)).startItemNo,e=i.startItemOffset,o=i.endItemNo,r=i.endItemOffset):t>this.SelectInfo.StartItemNo||t==this.SelectInfo.StartItemNo&&e>this.SelectInfo.StartItemOffset?(o=this.SelectInfo.StartItemNo,r=this.SelectInfo.StartItemOffset,o=(i=this.AdjustSelectRange(o,r,t,e)).startItemNo,r=i.startItemOffset,t=i.endItemNo,e=i.endItemOffset):n=!1),{itemNo:t,offset:e,result:n}}},{key:"SetEmptyData",value:function(){if(0==this.Items.count){var t=this.CreateDefaultTextItem();t.ParaFirst=!0,this.Items.add(t),this.ReFormat()}}},{key:"EmptyDataInsertItem",value:function(t){return!(t.StyleNo>cs.Null&&""==t.Text||(t.ParaNo=this.Items[0].ParaNo,this.UndoAction_DeleteItem(0,0),this.Items.clear(),this.DrawItems.clear(),t.ParaFirst=!0,this.Items.add(t),this.UndoAction_InsertItem(0,0),this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(0),this.ReFormat(),0))}},{key:"SelectPerfect",value:function(){if(this.SelectInfo.EndItemNo>=0)for(var t=this.SelectInfo.StartItemNo;t<=this.SelectInfo.EndItemNo;t++)if(this.Items[t].StyleNo<cs.Null&&this.Items[t].IsSelectPart)return!1;return!0}},{key:"RectItemAction",value:function(t,e){var i=!1,n=-1,o=-1;if(this.Items[t].isClass(Wa)){var r=this.GetFormatRangeByOffset(t,1,n,o);n=r.firstDrawItemNo,o=r.lastItemNo,this.FormatPrepare(n,o),this.Undo_New(),this.Items[t].MangerUndo?this.UndoAction_ItemSelf(t,lp.OffsetInner):this.UndoAction_ItemMirror(t,lp.OffsetInner),(i=e(this.Items[t]))&&(this.ReFormatData(n,o,0),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()),this.InitializeMouseField()}return i}},{key:"TextItemAction",value:function(t,e){var i=!1,n=-1,o=-1;if(this.Items[t].isClass(Hl)){var r=this.GetFormatRange(t,0);n=r.firstDrawItemNo,o=r.lastItemNo,this.FormatPrepare(n,o),this.Undo_New(),this.UndoAction_ItemMirror(t,0),(i=e(this.Items[t]))&&(this.ReFormatData(n,o,0),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()),this.InitializeMouseField()}return i}},{key:"InitializeMouseField",value:function(){this.FMouseLBDowning=!1,this.FMouseDownItemNo=-1,this.FMouseDownItemOffset=-1,this.FMouseMoveItemNo=-1,this.FMouseMoveItemOffset=-1,this.FMouseMoveDrawItemNo=-1,this.FMouseMoveRestrain=!1,this.FSelecting=!1,this.FDraging=!1}},{key:"IsSelectSeekStart",value:function(){return this.FSelectSeekNo==this.SelectInfo.StartItemNo&&this.FSelectSeekOffset==this.SelectInfo.StartItemOffset}},{key:"AdjustSelectRange",value:function(t,e,i,n){var o=!1,r=this.SelectInfo.StartItemNo,s=this.SelectInfo.EndItemNo;if(t<i?(o=!0,this.Items[t].Length>0&&e==this.GetItemOffsetAfter(t)&&t<this.Items.count-1&&!this.Items[t+1].ParaFirst&&(t+=1,e=0),t!=i&&i>=0&&this.Items[i].Length>0&&0==n&&!this.Items[i].ParaFirst&&(this.Items[i].DisSelect(),i-=1,n=this.GetItemOffsetAfter(i))):i<t&&(o=!1,t>0&&0==e&&!this.Items[t].ParaFirst&&(t-=1,e=this.GetItemOffsetAfter(t)),t!=i&&n==this.GetItemOffsetAfter(i)&&(this.Items[i].DisSelect(),i<this.Items.count-1&&!this.Items[i+1].ParaFirst&&(i+=1,n=0))),t==i?n>e?this.Items[t].StyleNo<cs.Null?(this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e,e==lp.OffsetBefor&&n==lp.OffsetAfter?(this.SelectInfo.EndItemNo=i,this.SelectInfo.EndItemOffset=n):(this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1)):(this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e,this.SelectInfo.EndItemNo=t,this.SelectInfo.EndItemOffset=n):n<e?this.Items[t].StyleNo<cs.Null?n==lp.OffsetBefor?(this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=n,this.SelectInfo.EndItemNo=t,this.SelectInfo.EndItemOffset=e):(this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e,this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1):(this.SelectInfo.StartItemNo=i,this.SelectInfo.StartItemOffset=n,this.SelectInfo.EndItemNo=i,this.SelectInfo.EndItemOffset=e):(this.SelectInfo.EndItemNo>=0&&this.Items[this.SelectInfo.EndItemNo].DisSelect(),this.SelectInfo.StartItemNo>=0&&(0!=e&&e!=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo)||this.Items[this.SelectInfo.StartItemNo].DisSelect()),this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e,this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1):o?(this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e,this.SelectInfo.EndItemNo=i,this.SelectInfo.EndItemOffset=n):(this.SelectInfo.StartItemNo=i,this.SelectInfo.StartItemOffset=n,this.SelectInfo.EndItemNo=t,this.SelectInfo.EndItemOffset=e),r>=0)if(r>this.SelectInfo.StartItemNo)for(var a=r;a>=this.SelectInfo.StartItemNo+1;a--)this.Items[a].DisSelect();else for(var l=r;l<=this.SelectInfo.StartItemNo-1;l++)this.Items[l].DisSelect();if(this.SelectInfo.EndItemNo<0)for(var h=s;h>=this.SelectInfo.StartItemNo+1;h--)this.Items[h].DisSelect();else for(var c=s;c>=this.SelectInfo.EndItemNo+1;c--)this.Items[c].DisSelect();return{startItemNo:t,startItemOffset:e,endItemNo:i,endItemOffset:n}}},{key:"DoLoadFromStream",value:function(t,e,i){if(this.FReadOnly=!1,this.CanEdit()){my(vy(r.prototype),"DoLoadFromStream",this).call(this,t,e,i),this.BeginFormat();try{this.FCheckEmptyItem=!1,this.InsertStream(t,e,i),i>48||i>47&&(t.readBoolean(),this.FReadOnly=!1),this.FCheckEmptyItem&&this.DeleteEmptyItem(),this.ReSetSelectAndCaretByOffset(0,0)}finally{this.EndFormat()}}}},{key:"ReSetSelectAndCaretByOffset",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];my(vy(r.prototype),"ReSetSelectAndCaretByOffset",this).call(this,t,e,i),this.FSelectSeekNo=this.SelectInfo.StartItemNo,this.FSelectSeekOffset=this.SelectInfo.StartItemOffset}},{key:"DoAcceptAction",value:function(t,e,i){var n=this.Items[t].AcceptAction(e,this.SelectInfo.StartRestrain,i);return n&&null!=this.OnAcceptAction&&(n=this.OnAcceptAction(this,t,e,i)),n}},{key:"DoDrawItemMouseMove",value:function(t,e,i,n,o){null!=this.OnDrawItemMouseMove&&this.OnDrawItemMouseMove(t,e,i,n,o)}},{key:"CheckInsertItemCount",value:function(t,e){return e-t+1}},{key:"DoItemMouseLeave",value:function(t){this.Items[t].MouseLeave()}},{key:"DoItemMouseEnter",value:function(t){this.Items[t].MouseEnter()}},{key:"DoItemResized",value:function(t){this.Change(),null!=this.OnItemResized&&this.OnItemResized(this,t)}},{key:"GetHeight",value:function(){return this.CalcContentHeight()}},{key:"SetReadOnly",value:function(t){this.FReadOnly=t}},{key:"CreateItemByStyle",value:function(t){var e=null;if(t<cs.Null)switch(t){case cs.Image:e=new $c(this,0,0);break;case cs.Table:e=new ic(this,1,1,1);break;case cs.Tab:e=new su(this,0,0);break;case cs.Line:e=new mu(this,1,1);break;case cs.Express:e=new xu(this,"","","","");break;case cs.Domain:e=this.CreateDefaultDomainItem();break;case cs.CheckBox:e=new Lu(this,"勾选框",!1);break;case cs.Gif:e=new ju(this,1,1);break;case cs.Edit:e=new $u(this,"");break;case cs.Combobox:e=new hf(this,"");break;case cs.QRCode:e=new od(this,"");break;case cs.Button:e=new cm(this,"");break;case cs.BarCode:e=new Dd(this,"");break;case cs.Fraction:e=new wu(this,"","");break;case cs.DateTimePicker:e=new Bd(this,X.Now());break;case cs.RadioGroup:e=new Yd(this);break;case cs.SupSubScript:e=new im(this,"","");break;case cs.Bullet:e=new vm(this);break;case cs.Annotate:e=new uy(this);break;case cs.FloatLine:e=new Lm(this);break;case cs.FloatBarCode:e=new Xm(this);break;case cs.FloatQRCode:e=new ty(this);break;default:console.log("HC异常:未找到类型 "+t.toString()+" 对应的创建Item代码!")}else(e=this.CreateDefaultTextItem()).StyleNo=t;return null!=this.OnCreateItem&&this.OnCreateItem(e),e}},{key:"CanEdit",value:function(){return!this.FReadOnly&&my(vy(r.prototype),"CanEdit",this).call(this)}},{key:"Clear",value:function(){this.InitializeField();var t=this.Items[0].StyleNo,e=this.Items[0].ParaNo;my(vy(r.prototype),"Clear",this).call(this),t>cs.Null&&t<this.Style.TextStyles.count&&(this.FCurStyleNo=t),e<this.Style.ParaStyles.count&&(this.FCurParaNo=e),this.SetEmptyData()}},{key:"ApplySameItem",value:function(t,e,i){var n=this.Items[t];if(n.StyleNo<cs.Null)n.MangerUndo?this.UndoAction_ItemSelf(t,lp.OffsetInner):this.UndoAction_ItemMirror(t,lp.OffsetInner),n.ApplySelectTextStyle(this.Style,i);else{var o=i.GetMatchStyleNo(this.Style,n.StyleNo);if(this.CurStyleNo=o,n.IsSelectComplate){if(this.UndoAction_ItemStyle(t,this.SelectInfo.EndItemOffset,o),n.StyleNo=o,this.MergeItemToNext(t)&&(this.UndoAction_InsertText(t,this.Items[t].Length-this.Items[t+1].Length+1,this.Items[t+1].Text),this.UndoAction_DeleteItem(t+1,0),this.Items.delete(t+1),e--),t>0){var r=this.Items[t-1].Length;this.MergeItemToPrio(t)&&(this.UndoAction_InsertText(t-1,this.Items[t-1].Length-this.Items[t].Length+1,this.Items[t].Text),this.UndoAction_DeleteItem(t,0),this.Items.delete(t),e--,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=r,this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=r+this.SelectInfo.EndItemOffset)}}else{var s=n.Text,a=s.substr(this.SelectInfo.StartItemOffset+1-1,this.SelectInfo.EndItemOffset-this.SelectInfo.StartItemOffset),l=s.substr(0,this.SelectInfo.StartItemOffset),h=this.Items[t].BreakByOffset(this.SelectInfo.EndItemOffset);if(null!=h){this.UndoAction_DeleteText(t,this.SelectInfo.EndItemOffset+1,h.Text),this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(t+1,h)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(t+1,0),e++}if(""!=l){this.UndoAction_DeleteText(t,this.SelectInfo.StartItemOffset+1,a),n.Text=l;var c=this.CreateDefaultTextItem();if(c.ParaNo=n.ParaNo,c.StyleNo=o,c.Text=a,null!=h)this.Items.insert(t+1,c),this.UndoAction_InsertItem(t+1,0),e++;else{if(t<this.Items.count-1&&!this.Items[t+1].ParaFirst&&this.MergeItemText(c,this.Items[t+1]))return this.UndoAction_InsertText(t+1,1,a),this.Items[t+1].Text=a+this.Items[t+1].Text,c.Dispose(),this.SelectInfo.StartItemNo=t+1,this.SelectInfo.StartItemOffset=0,this.SelectInfo.EndItemNo=t+1,void(this.SelectInfo.EndItemOffset=a.length);this.Items.insert(t+1,c),this.UndoAction_InsertItem(t+1,0),e++}this.SelectInfo.StartItemNo=t+1,this.SelectInfo.StartItemOffset=0,this.SelectInfo.EndItemNo=t+1,this.SelectInfo.EndItemOffset=a.length}else if(this.UndoAction_ItemStyle(t,this.SelectInfo.EndItemOffset,o),n.StyleNo=o,this.MergeItemToPrio(t)){this.UndoAction_InsertText(t-1,this.Items[t-1].Length-this.Items[t].Length+1,this.Items[t].Text),this.UndoAction_DeleteItem(t,0),this.Items.delete(t),e--,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1;var u=this.Items[this.SelectInfo.StartItemNo].Length;this.SelectInfo.StartItemOffset=u-a.length,this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=u}}}return e}},{key:"ApplyRangeStartItem",value:function(t,e,i){var n=this.Items[t];if(n.StyleNo<cs.Null)n.MangerUndo?this.UndoAction_ItemSelf(t,this.SelectInfo.StartItemOffset):this.UndoAction_ItemMirror(t,this.SelectInfo.StartItemOffset),n.ApplySelectTextStyle(this.Style,i);else{var o=i.GetMatchStyleNo(this.Style,n.StyleNo);if(n.StyleNo!=o)if(n.IsSelectComplate)this.UndoAction_ItemStyle(t,0,o),n.StyleNo=o;else{var r=this.Items[t].BreakByOffset(this.SelectInfo.StartItemOffset);this.UndoAction_DeleteText(t,this.SelectInfo.StartItemOffset+1,r.Text),this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(t+1,r)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(t+1,0),this.UndoAction_ItemStyle(t+1,0,o),r.StyleNo=o,e++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0,this.SelectInfo.EndItemNo=this.SelectInfo.EndItemNo+1}}return e}},{key:"ApplyRangeEndItem",value:function(t,e,i){var n=this.Items[t];if(n.StyleNo<cs.Null)n.MangerUndo?this.UndoAction_ItemSelf(t,this.SelectInfo.EndItemOffset):this.UndoAction_ItemMirror(t,this.SelectInfo.EndItemOffset),n.ApplySelectTextStyle(this.Style,i);else{var o=i.GetMatchStyleNo(this.Style,n.StyleNo);if(n.StyleNo!=o)if(n.IsSelectComplate)this.UndoAction_ItemStyle(t,this.SelectInfo.EndItemOffset,o),n.StyleNo=o;else{var r=n.Text,s=r.substr(0,this.SelectInfo.EndItemOffset);this.UndoAction_DeleteBackText(t,1,s),n.Text=C.stringDelete(r,0,this.SelectInfo.EndItemOffset);var a=this.CreateDefaultTextItem();a.ParaNo=n.ParaNo,a.StyleNo=o,a.Text=s,a.ParaFirst=n.ParaFirst,n.ParaFirst&&(this.UndoAction_ItemParaFirst(t,0,!1),n.ParaFirst=!1),this.Items.insert(t,a),this.UndoAction_InsertItem(t,0),e++}}return e}},{key:"ApplyRangeNorItem",value:function(t,e){var i=this.Items[t];if(i.StyleNo<cs.Null)i.MangerUndo?this.UndoAction_ItemSelf(t,lp.OffsetInner):this.UndoAction_ItemMirror(t,lp.OffsetInner),i.ApplySelectTextStyle(this.Style,e);else{var n=e.GetMatchStyleNo(this.Style,i.StyleNo);this.UndoAction_ItemStyle(t,0,n),i.StyleNo=n}}},{key:"ApplySelectTextStyle",value:function(t){this.Undo_New(),this.InitializeField();var e,i=0,n=-1,o=-1;if(!this.SelectExists())return this.CurStyleNo>cs.Null&&(t.Append=!t.StyleHasMatch(this.Style,this.CurStyleNo),this.CurStyleNo=t.GetMatchStyleNo(this.Style,this.CurStyleNo),this.Style.UpdateInfoRePaint(),0==this.Items[this.SelectInfo.StartItemNo].Length?(n=(e=this.GetFormatRange(n,o)).firstDrawItemNo,o=e.lastItemNo,this.FormatPrepare(n,o),this.UndoAction_ItemStyle(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,this.CurStyleNo),this.Items[this.SelectInfo.StartItemNo].StyleNo=this.CurStyleNo,this.ReFormatData(n,o),this.Style.UpdateInfoReCaret()):(this.Items[this.SelectInfo.StartItemNo].isClass(Ya)&&(n=(e=this.GetFormatRange(n,o)).firstDrawItemNo,o=e.lastItemNo,this.FormatPrepare(n,o),this.Items[this.SelectInfo.StartItemNo].TextStyleNo=this.CurStyleNo,this.ReFormatData(n,o)),this.Style.UpdateInfoReCaret(!1))),void this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);if(this.SelectInfo.EndItemNo<0)this.Items[this.SelectInfo.StartItemNo].StyleNo<cs.Null&&(this.Items[this.SelectInfo.StartItemNo].MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),this.Items[this.SelectInfo.StartItemNo].ApplySelectTextStyle(this.Style,t),this.Items[this.SelectInfo.StartItemNo].IsFormatDirty?(n=(e=this.GetFormatRange(n,o)).firstDrawItemNo,o=e.lastItemNo,this.FormatPrepare(n,o),this.ReFormatData(n,o)):this.FormatInit());else{n=(e=this.GetFormatRange(n,o)).firstDrawItemNo,o=e.lastItemNo,this.SelectInfo.StartItemNo!=this.SelectInfo.EndItemNo&&(o=this.GetParaLastItemNo(this.SelectInfo.EndItemNo)),this.FormatPrepare(n,o);for(var r=this.SelectInfo.StartItemNo;r<=this.SelectInfo.EndItemNo;r++){if(this.Items[r].StyleNo>cs.Null){t.Append=!t.StyleHasMatch(this.Style,this.Items[r].StyleNo);break}if(this.Items[r].MatchTextStyle(this.Style,t))break}if(this.SelectInfo.StartItemNo===this.SelectInfo.EndItemNo)i=this.ApplySameItem(this.SelectInfo.StartItemNo,i,t);else{i=this.ApplyRangeEndItem(this.SelectInfo.EndItemNo,i,t);for(var s=this.SelectInfo.EndItemNo-1;s>=this.SelectInfo.StartItemNo+1;s--)this.ApplyRangeNorItem(s,t);i=this.ApplyRangeStartItem(this.SelectInfo.StartItemNo,i,t),this.SelectInfo.EndItemNo<o+i&&this.MergeItemToNext(this.SelectInfo.EndItemNo)&&(this.UndoAction_InsertText(this.SelectInfo.EndItemNo,this.Items[this.SelectInfo.EndItemNo].Length-this.Items[this.SelectInfo.EndItemNo+1].Length+1,this.Items[this.SelectInfo.EndItemNo+1].Text),this.UndoAction_DeleteItem(this.SelectInfo.EndItemNo+1,0),this.Items.delete(this.SelectInfo.EndItemNo+1),i--);for(var a=-1,l=this.SelectInfo.EndItemNo;l>=this.SelectInfo.StartItemNo+1;l--)a=this.Items[l-1].Length,this.MergeItemToPrio(l)&&(this.UndoAction_InsertText(l-1,this.Items[l-1].Length-this.Items[l].Length+1,this.Items[l].Text),this.UndoAction_DeleteItem(l,0),this.Items.delete(l),i--,l==this.SelectInfo.EndItemNo&&(this.SelectInfo.EndItemOffset=this.SelectInfo.EndItemOffset+a),this.SelectInfo.EndItemNo=this.SelectInfo.EndItemNo-1);this.SelectInfo.StartItemNo>0&&!this.Items[this.SelectInfo.StartItemNo].ParaFirst&&(a=this.Items[this.SelectInfo.StartItemNo-1].Length,this.MergeItemToPrio(this.SelectInfo.StartItemNo)&&(this.UndoAction_InsertText(this.SelectInfo.StartItemNo-1,this.Items[this.SelectInfo.StartItemNo-1].Length-this.Items[this.SelectInfo.StartItemNo].Length+1,this.Items[this.SelectInfo.StartItemNo].Text),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),i--,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=a,this.SelectInfo.EndItemNo=this.SelectInfo.EndItemNo-1,this.SelectInfo.StartItemNo==this.SelectInfo.EndItemNo&&(this.SelectInfo.EndItemOffset=this.SelectInfo.EndItemOffset+a)))}this.ReFormatData(n,o+i,i)}this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()}},{key:"DoApplyParagraphStyle",value:function(t,e,i){var n,o,r;e.isClass(xl)?(n=e.Indent,r=this.Style.ParaStyles[this.GetItemParaStyle(t)],o=sr.pixXToMillimeter(this.Width)-r.LeftIndent-r.RightIndent-sr.pixXToMillimeter(lp.TabCharWidth),r.FirstIndent+i>o?e.Indent=o:e.Indent=r.FirstIndent+i):e.isClass(Al)?(n=e.Indent,r=this.Style.ParaStyles[this.GetItemParaStyle(t)],o=sr.pixXToMillimeter(this.Width)-r.FirstIndent-r.RightIndent-sr.pixXToMillimeter(lp.TabCharWidth),r.LeftIndent>0&&r.LeftIndent+i<0||r.LeftIndent<0&&r.LeftIndent+i>0?e.Indent=0:r.LeftIndent+i>o?e.Indent=o:e.Indent=r.LeftIndent+i):e.isClass(Tl)&&(n=e.Indent,r=this.Style.ParaStyles[this.GetItemParaStyle(t)],o=sr.pixXToMillimeter(this.Width)-r.FirstIndent-r.LeftIndent-sr.pixXToMillimeter(lp.TabCharWidth),r.RightIndent+i>o?e.Indent=o:e.Indent=r.RightIndent+i);var s=e.GetMatchParaNo(this.Style,this.GetItemParaStyle(t));if(this.Items[t].ParaNo!=s){var a=-1,l=-1,h=this.GetParaItemRang(t,a,l);a=h.a,l=h.b,this.UndoAction_ItemParaNo(a,0,s);for(var c=a;c<=l;c++)this.Items[c].ParaNo=s}(e.isClass(xl)||e.isClass(Al)||e.isClass(Tl))&&(e.Indent=n)}},{key:"ApplyParagraphSelecteStyle",value:function(t,e){var i=-1,n=-1,o=this.GetParaItemRang(this.SelectInfo.StartItemNo,i,n);i=o.a,n=o.b,this.DoApplyParagraphStyle(this.SelectInfo.StartItemNo,t,e);for(var r=n+1;r<=this.SelectInfo.EndItemNo;)this.Items[r].ParaFirst&&this.DoApplyParagraphStyle(r,t,e),r++}},{key:"ApplySelectParaStyle",value:function(t){if(!(this.SelectInfo.StartItemNo<0)){var e=0;t.isClass(xl)?e=t.Indent-this.Style.ParaStyles[this.GetItemParaStyle(this.SelectInfo.StartItemNo)].FirstIndent:t.isClass(Al)?e=t.Indent-this.Style.ParaStyles[this.GetItemParaStyle(this.SelectInfo.StartItemNo)].LeftIndent:t.isClass(Tl)&&(e=t.Indent-this.Style.ParaStyles[this.GetItemParaStyle(this.SelectInfo.StartItemNo)].RightIndent);var i=-1,n=-1;this.Undo_New(),this.SelectInfo.EndItemNo>=0?(i=this.Items[this.GetParaFirstItemNo(this.SelectInfo.StartItemNo)].FirstDItemNo,n=this.GetParaLastItemNo(this.SelectInfo.EndItemNo),this.FormatPrepare(i,n),this.ApplyParagraphSelecteStyle(t,e),this.ReFormatData(i,n)):this.GetItemStyle(this.SelectInfo.StartItemNo)<cs.Null&&this.SelectInfo.StartItemOffset==lp.OffsetInner?(this.Items[this.SelectInfo.StartItemNo].MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),i=this.GetFormatFirstDrawItem(this.Items[this.SelectInfo.StartItemNo].FirstDItemNo),this.FormatPrepare(i,this.SelectInfo.StartItemNo),this.Items[this.SelectInfo.StartItemNo].ApplySelectParaStyle(this.Style,t),this.ReFormatData(i,this.SelectInfo.StartItemNo)):(i=this.Items[this.GetParaFirstItemNo(this.SelectInfo.StartItemNo)].FirstDItemNo,n=this.GetParaLastItemNo(this.SelectInfo.StartItemNo),this.FormatPrepare(i,n),this.DoApplyParagraphStyle(this.SelectInfo.StartItemNo,t,e),this.ReFormatData(i,n)),this.FSelectSeekNo>=0?this.FCurParaNo=this.Items[this.FSelectSeekNo].ParaNo:this.FCurParaNo=this.Items[this.SelectInfo.StartItemNo].ParaNo,this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()}}},{key:"ApplyTableCellAlign",value:function(t){this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(e){return e.ApplyContentAlign(t),!0}))}},{key:"ParaFirstItemAddBullet_",value:function(t,e,i,n,o,r,s){if(this.Items[t].StyleNo>cs.Null&&""==this.Items[t].Text){this.UndoAction_DeleteItem(t,0),this.Items.removeAt(t);var a=new vm(this);a.BulletStyle=e,a.Prefix=n,a.Suffix=o,e==Cp.Symbol?a.Text=n+i+o:a.SetOrderNumber(s),a.ParaFirst=!0,this.Items.insert(t,a),this.UndoAction_InsertItem(t,0)}else if(za.IsBeginMark(this.Items[t])){var l=new vm(this);l.BulletStyle=e,l.Prefix=n,l.Suffix=o,e==Cp.Symbol?l.Text=n+i+o:l.SetOrderNumber(s),this.Items.insert(t+1,l),this.UndoAction_InsertItem(t+1,0),r++}else{this.UndoAction_ItemParaFirst(t,0,!1),this.Items[t].ParaFirst=!1;var h=new vm(this);h.BulletStyle=e,h.Prefix=n,h.Suffix=o,e==Cp.Symbol?h.Text=n+i+o:h.SetOrderNumber(s),h.ParaFirst=!0,this.Items.insert(t,h),this.UndoAction_InsertItem(t,0),r++}return e!=Cp.Symbol&&s--,{incCount:r,order:s}}},{key:"ApplyBullet",value:function(t,e,i,n){if(!(this.SelectInfo.StartItemNo<0)){var o=this.SelectInfo.StartItemNo,r=this.SelectInfo.EndItemNo,s=0;this.InitializeField(),t!=Cp.Symbol&&(s=parseInt(e));var a=0,l=-1,h=-1,c=-1;if(this.Undo_New(),r>=0){l=this.GetParaFirstItemNo(o),h=this.Items[l].FirstDItemNo,c=this.GetParaLastItemNo(r),this.FormatPrepare(h,c);for(var u=l+1;u<=r;u++)this.Items[u].ParaFirst&&s++;for(var f,d=r;d>=l;d--)this.Items[d].ParaFirst&&(a=(f=this.ParaFirstItemAddBullet_(d,t,e,i,n,a,s)).incCount,s=f.order);l<=o&&(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1),this.SelectInfo.EndItemNo=this.SelectInfo.EndItemNo+a}else o>=0&&(l=this.GetParaFirstItemNo(o),h=this.Items[l].FirstDItemNo,c=this.GetParaLastItemNo(o),this.FormatPrepare(h,c),this.ParaFirstItemAddBullet_(l,t,e,i,n,a,s));this.ReFormatData(h,c+a,a),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()}}},{key:"DisSelect",value:function(){var t=my(vy(r.prototype),"DisSelect",this).call(this);return t&&(this.FDraging=!1,this.FSelecting=!1,this.Style.UpdateInfoRePaint()),this.Style.UpdateInfoReCaret(),t}},{key:"DeleteItemSelectComplate",value:function(t,e,i,n,o){if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.DeleteItem))return{delCount:t,result:!1};if(this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),t++,this.SelectInfo.StartItemNo>n&&this.SelectInfo.StartItemNo<o){var r=this.Items[this.SelectInfo.StartItemNo-1].Length;this.MergeItemText(this.Items[this.SelectInfo.StartItemNo-1],this.Items[this.SelectInfo.StartItemNo])?(this.UndoAction_InsertText(this.SelectInfo.StartItemNo-1,r+1,this.Items[this.SelectInfo.StartItemNo].Text),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),t++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=r):(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo))}else if(this.SelectInfo.StartItemNo==e)if(e==i){var s=this.CreateDefaultTextItem();this.CurStyleNo=s.StyleNo,s.ParaFirst=!0,this.Items.insert(this.SelectInfo.StartItemNo,s),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),this.SelectInfo.StartItemOffset=0,t--}else this.SelectInfo.StartItemOffset=0,this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!0),this.Items[this.SelectInfo.StartItemNo].ParaFirst=!0;else if(this.SelectInfo.StartItemNo==i)this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo);else if(this.SelectInfo.StartItemNo>0){var a=this.Items[this.SelectInfo.StartItemNo-1].Length;this.MergeItemText(this.Items[this.SelectInfo.StartItemNo-1],this.Items[this.SelectInfo.StartItemNo])&&(this.UndoAction_InsertText(this.SelectInfo.StartItemNo-1,a+1,this.Items[this.SelectInfo.StartItemNo].Text),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),t++,this.SelectInfo.StartItemOffset=a),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo)}return{delCount:t,result:!1}}},{key:"DeleteSelected",value:function(){if(!this.CanEdit())return!1;if(!this.SelectPerfect())return this.DisSelect(),!1;if(!this.SelectExists())return!0;if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.DeleteSelected))return!1;var t=this.IsSelectSeekStart(),e=0;this.InitializeField();var i,n=-1,o=-1,s=-1,a=-1,l=-1,h=-1;if(this.SelectInfo.EndItemNo<0&&this.Items[this.SelectInfo.StartItemNo].StyleNo<cs.Null){if(n=(i=this.GetFormatRange(n,s)).firstDrawItemNo,s=i.lastItemNo,this.FormatPrepare(n,s),o=this.FormatCount>0?this.SelectInfo.StartItemNo:this.DrawItems[n].ItemNo,this.Undo_New(),this.Items[this.SelectInfo.StartItemNo].IsSelectComplateTheory()){var c=this.GetParaItemRang(this.SelectInfo.StartItemNo,a,l);a=c.a,l=c.b;var u=this.DeleteItemSelectComplate(e,a,l,o,s);e=u.delCount,u.result}else this.Items[this.SelectInfo.StartItemNo].MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),this.Items[this.SelectInfo.StartItemNo].DeleteSelected();this.ReFormatData(n,s-e,-e)}else{var f=this.Items[this.SelectInfo.EndItemNo];if(this.SelectInfo.EndItemNo==this.SelectInfo.StartItemNo){if(this.Undo_New(),n=(i=this.GetFormatRange(n,s)).firstDrawItemNo,s=i.lastItemNo,this.FormatPrepare(n,s),o=this.FormatCount>0?this.SelectInfo.StartItemNo:this.DrawItems[n].ItemNo,f.IsSelectComplate){var d=this.GetParaItemRang(this.SelectInfo.StartItemNo,a,l);a=d.a,l=d.b;var m=this.DeleteItemSelectComplate(e,a,l,o,s);e=m.delCount,m.result}else if(f.StyleNo<cs.Null)this.Items[this.SelectInfo.StartItemNo].MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),f.DeleteSelected();else if(this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.BackDeleteText)){var y=f.Text;this.UndoAction_DeleteBackText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,y.substr(this.SelectInfo.StartItemOffset+1-1,this.SelectInfo.EndItemOffset-this.SelectInfo.StartItemOffset)),f.Text=C.stringDelete(y,this.SelectInfo.StartItemOffset+1-1,this.SelectInfo.EndItemOffset-this.SelectInfo.StartItemOffset)}this.ReFormatData(n,s-e,-e)}else{h=this.SelectInfo.EndItemNo,o=this.GetParaFirstItemNo(this.SelectInfo.StartItemNo),n=this.Items[o].FirstDItemNo,s=this.GetParaLastItemNo(this.SelectInfo.EndItemNo),this.FormatPrepare(n,s);var p=this.Items[this.SelectInfo.StartItemNo].ParaFirst,S=this.Items[this.SelectInfo.StartItemNo].IsSelectComplate,v=this.Items[this.SelectInfo.EndItemNo].IsSelectComplate;this.Undo_New();var F=!1,I=!1;if(f.StyleNo<cs.Null)v?this.DoAcceptAction(this.SelectInfo.EndItemNo,this.SelectInfo.EndItemOffset,wp.DeleteItem)?(this.UndoAction_DeleteItem(this.SelectInfo.EndItemNo,lp.OffsetAfter),this.Items.delete(this.SelectInfo.EndItemNo),I=!0,e++,h--):h=this.SelectInfo.EndItemNo:this.SelectInfo.EndItemOffset==lp.OffsetInner?f.DeleteSelected():this.Items[this.SelectInfo.EndItemNo].ParaFirst&&(this.UndoAction_ItemParaFirst(this.SelectInfo.EndItemNo,0,!1),this.Items[this.SelectInfo.EndItemNo].ParaFirst=!1);else if(v)this.DoAcceptAction(this.SelectInfo.EndItemNo,this.SelectInfo.EndItemOffset,wp.DeleteItem)?(this.UndoAction_DeleteItem(this.SelectInfo.EndItemNo,f.Length),this.Items.delete(this.SelectInfo.EndItemNo),I=!0,e++,h--):h=this.SelectInfo.EndItemNo;else if(this.DoAcceptAction(this.SelectInfo.EndItemNo,this.SelectInfo.EndItemOffset,wp.BackDeleteText))if(0==this.SelectInfo.EndItemOffset&&this.Items[this.SelectInfo.EndItemNo].ParaFirst)this.UndoAction_ItemParaFirst(this.SelectInfo.EndItemNo,0,!1),this.Items[this.SelectInfo.EndItemNo].ParaFirst=!1;else{this.UndoAction_DeleteBackText(this.SelectInfo.EndItemNo,1,f.Text.substr(0,this.SelectInfo.EndItemOffset));var g=f.SubString(this.SelectInfo.EndItemOffset+1,f.Length-this.SelectInfo.EndItemOffset);f.Text=g}else h=this.SelectInfo.EndItemNo;for(var w=this.SelectInfo.EndItemNo-1;w>=this.SelectInfo.StartItemNo+1;w--)this.DoAcceptAction(w,0,wp.DeleteItem)?(this.UndoAction_DeleteItem(w,0),this.Items.delete(w),e++,h--):h=w;var k=this.Items[this.SelectInfo.StartItemNo];if(k.StyleNo<cs.Null)this.SelectInfo.StartItemOffset==lp.OffsetBefor?this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.startItemOffset,wp.DeleteItem)?(this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),F=!0,e++,h--):h=this.SelectInfo.StartItemNo:this.SelectInfo.StartItemOffset==lp.OffsetInner&&k.DeleteSelected();else if(S)this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.startItemOffset,wp.DeleteItem)?(this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),F=!0,e++,h--):h=this.SelectInfo.StartItemNo;else if(this.SelectInfo.StartItemOffset<k.Length)if(this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.BackDeleteText)){this.UndoAction_DeleteBackText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,k.Text.substr(this.SelectInfo.StartItemOffset+1-1,k.Length-this.SelectInfo.StartItemOffset));var P=k.SubString(1,this.SelectInfo.StartItemOffset);k.Text=P}else h=this.SelectInfo.StartItemNo;if(this.SelectInfo.EndItemNo-this.SelectInfo.StartItemNo+1==e)if(this.SelectInfo.StartItemNo==o)if(this.SelectInfo.EndItemNo==s){var D=this.CreateDefaultTextItem();this.CurStyleNo=D.StyleNo,D.ParaFirst=!0,this.Items.insert(this.SelectInfo.StartItemNo,D),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,D.Length),e--}else this.Items[this.SelectInfo.EndItemNo-e+1].ParaFirst=!0;else if(this.SelectInfo.EndItemNo==s)this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo);else{var b=this.Items[this.SelectInfo.StartItemNo-1].Length;this.MergeItemText(this.Items[this.SelectInfo.StartItemNo-1],this.Items[this.SelectInfo.EndItemNo-e+1])?(this.UndoAction_InsertText(this.SelectInfo.StartItemNo-1,this.Items[this.SelectInfo.StartItemNo-1].Length-this.Items[this.SelectInfo.EndItemNo-e+1].Length+1,this.Items[this.SelectInfo.EndItemNo-e+1].Text),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=b,this.UndoAction_DeleteItem(this.SelectInfo.EndItemNo-e+1,0),this.Items.delete(this.SelectInfo.EndItemNo-e+1),e++):this.Items[this.SelectInfo.EndItemNo-e+1].ParaFirst&&(this.UndoAction_ItemParaFirst(this.SelectInfo.EndItemNo-e+1,0,!1),this.Items[this.SelectInfo.EndItemNo-e+1].ParaFirst=!1)}else F?this.Items[h].ParaFirst!=p&&(this.UndoAction_ItemParaFirst(h,0,p),this.Items[h].ParaFirst=p):I||this.SelectInfo.StartItemNo+1!=this.SelectInfo.EndItemNo-e||(this.MergeItemText(this.Items[this.SelectInfo.StartItemNo],this.Items[this.SelectInfo.EndItemNo-e])?(this.UndoAction_InsertText(this.SelectInfo.StartItemNo,this.Items[this.SelectInfo.StartItemNo].Length-this.Items[this.SelectInfo.EndItemNo-e].Length+1,this.Items[this.SelectInfo.EndItemNo-e].Text),this.UndoAction_DeleteItem(this.SelectInfo.EndItemNo-e,0),this.Items.delete(this.SelectInfo.EndItemNo-e),e++):this.SelectInfo.EndItemNo!=s&&this.Items[this.SelectInfo.EndItemNo-e].ParaFirst&&(this.UndoAction_ItemParaFirst(this.SelectInfo.EndItemNo-e,0,!1),this.Items[this.SelectInfo.EndItemNo-e].ParaFirst=!1));this.ReFormatData(n,s-e,-e)}for(var R=this.SelectInfo.StartItemNo;R<=this.SelectInfo.EndItemNo-e;R++)this.Items[R].DisSelect();this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1}return this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),my(vy(r.prototype),"DeleteSelected",this).call(this),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,!t),!0}},{key:"DeleteItemDirect",value:function(t){var e=this.GetFormatFirstDrawItemByOffset(t,0),i=this.GetParaLastItemNo(t);this.Items[t].ParaFirst&&t<i&&(this.Items[t+1].ParaFirst=!0),this.FormatPrepare(e,i),my(vy(r.prototype),"DeleteItemDirect",this).call(this,t),0==this.Items.count?this.SetEmptyData():this.ReFormatData(e,i-1,-1)}},{key:"InitializeField",value:function(){this.FSelectSeekNo=-1,this.FSelectSeekOffset=-1,this.InitializeMouseField(),my(vy(r.prototype),"InitializeField",this).call(this)}},{key:"InsertStream",value:function(t,e,i){if(0==t.readInt64())return!1;if(!this.CanEdit())return!1;if(!this.DeleteSelected())return!1;if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.InsertItem))return!1;if(!this.SelectPerfect())return!1;var n,o=!1,r=null,s=!1,a=!1,l=0,h=-1,c=-1,u=this.CurParaNo;this.Undo_GroupBegin(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);try{if(0==this.Items.count)l=0;else if(this.DeleteSelected(),l=this.SelectInfo.StartItemNo,this.Items[l].StyleNo<cs.Null){if(this.SelectInfo.StartItemOffset==lp.OffsetInner)return h=(n=this.GetFormatRangeByOffset(this.SelectInfo.StartItemNo,lp.OffsetInner,h,c)).firstDrawItemNo,c=n.lastItemNo,this.FormatPrepare(h,c),this.Undo_New(),this.Items[l].MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),t.position-=8,o=this.Items[l].InsertStream(t,e,i),this.ReFormatData(h,c),o;this.SelectInfo.StartItemOffset==lp.OffsetBefor?s=!0:l+=1}else this.SelectInfo.StartItemOffset==this.Items[l].Length?(a=this.IsEmptyLine(l),l+=1):0==this.SelectInfo.StartItemOffset?s=0!=this.Items[l].Length:(this.Undo_New(),this.UndoAction_DeleteBackText(l,this.SelectInfo.StartItemOffset+1,this.Items[l].Text.substr(this.SelectInfo.StartItemOffset+1-1,this.Items[l].Length-this.SelectInfo.StartItemOffset)),r=this.Items[l].BreakByOffset(this.SelectInfo.StartItemOffset),l+=1);var f=t.readInt32();if(0==f)return o;h=(n=this.GetFormatRange(h,c)).firstDrawItemNo,c=n.lastItemNo,this.Items.count>0?this.FormatPrepare(h,c):(h=0,c=-1);var d=0,m=0;this.Undo_New();for(var y=cs.Null,p=null,S=0;S<=f-1;S++)if(y=t.readInt32(),(p=this.CreateItemByStyle(y)).LoadFromStream(t,e,i),null!=e?(p.StyleNo>cs.Null&&(p.StyleNo=this.Style.GetStyleNo(e.TextStyles[p.StyleNo],!0)),this.Style.States.Contain(Ip.Pasting)?p.ParaNo=u:p.ParaNo=this.Style.GetParaNo(e.ParaStyles[p.ParaNo],!0)):(p.StyleNo>cs.Null&&(this.CurStyleNo<cs.Null?p.StyleNo=this.Style.GetStyleNo(this.Style.DefaultTextStyle,!0):p.StyleNo=this.CurStyleNo),p.ParaNo=u),p.StyleNo>cs.Null&&""==p.Text&&!p.ParaFirst)m++,p.dispose(),p=null;else{if(0==S)s?(p.ParaFirst=this.Items[l].ParaFirst,this.Items[l].ParaFirst&&(this.UndoAction_ItemParaFirst(l,0,!1),this.Items[l].ParaFirst=!1)):p.ParaFirst=!1;else if(!this.Loading&&!p.ParaFirst&&this.MergeItemText(this.Items[l+S-1-m],p)){m++,p.dispose(),p=null;continue}!this.FCheckEmptyItem&&S>0&&!p.ParaFirst&&(p.StyleNo>cs.Null&&0==p.Length&&(this.FCheckEmptyItem=!0),this.Items[l+S-m-1].StyleNo>cs.Null&&0==this.Items[l+S-m-1].Length&&(this.FCheckEmptyItem=!0)),this.Items.insert(l+S-m,p),this.UndoAction_InsertItem(l+S-m,0),d++}var v=l+(f=this.CheckInsertItemCount(l,l+d-1))-1,F=this.GetItemOffsetAfter(v);if(null!=r)if(this.MergeItemText(this.Items[v],r))this.UndoAction_InsertText(v,this.Items[v].Length-r.Length+1,r.Text),r.dispose(),r=null;else{this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(v+1,r)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(v+1,0),f++}if(l>0){if(a)this.UndoAction_ItemParaFirst(l,0,this.Items[l-1].ParaFirst),this.Items[l].ParaFirst=this.Items[l-1].ParaFirst,this.Items[l-1].PageBreak&&(this.UndoAction_ItemPageBreak(l,0,!0),this.Items[l].PageBreak=!0),this.UndoAction_DeleteItem(l-1,0),this.Items.delete(l-1),f--,v--;else{var I=this.Items[l-1].Length;!this.Items[l].ParaFirst&&this.MergeItemText(this.Items[l-1],this.Items[l])?(this.UndoAction_InsertText(l-1,this.Items[l-1].Length-this.Items[l].Length+1,this.Items[l].Text),this.UndoAction_DeleteItem(l,0),this.Items.delete(l),1==f&&(F=I+F),f--,v--):this.Items[l].StyleNo>cs.Null&&0==this.Items[l].Length&&(this.UndoAction_DeleteItem(l,0),this.Items.delete(l),f--,v--)}v<this.Items.count-1&&!this.Items[v+1].ParaFirst&&this.MergeItemText(this.Items[v],this.Items[v+1])&&(this.UndoAction_InsertText(v,this.Items[v].Length-this.Items[v+1].Length+1,this.Items[v+1].Text),this.UndoAction_DeleteItem(v+1,0),this.Items.delete(v+1),f--)}else this.MergeItemText(this.Items[v],this.Items[v+1])&&(p=this.Items[v+1],this.UndoAction_InsertText(v,this.Items[v].Length-p.Length+1,p.Text),this.UndoAction_DeleteItem(l+f,0),this.Items.delete(l+f),f--);this.ReFormatData(h,c+f,f),this.ReSetSelectAndCaretByOffset(v,F)}finally{this.Undo_GroupEnd(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)}return this.InitializeMouseField(),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoReScroll(),o}},{key:"ParseXml",value:function(t){this.CanEdit()&&(my(vy(r.prototype),"ParseXml",this).call(this,t),this.ReFormat(),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoReScroll())}},{key:"InsertItem",value:function(t){if(!this.CanEdit())return!1;if(!this.DeleteSelected())return!1;var e,i=!1;if(t.ParaNo>this.Style.ParaStyles.count-1&&(t.ParaNo=this.CurParaNo),!t.ParaFirst){if(this.IsEmptyData())return this.Undo_New(),i=this.EmptyDataInsertItem(t),this.CurParaNo=t.ParaNo,i;t.ParaNo=this.CurParaNo}var n=-1,o=-1,r=this.GetActiveItemNo();if(this.Items[r].StyleNo<cs.Null)this.SelectInfo.StartItemOffset==lp.OffsetInner?(n=(e=this.GetFormatRange(n,o)).firstDrawItemNo,o=e.lastItemNo,this.FormatPrepare(n,o),this.Undo_New(),this.UndoAction_ItemSelf(r,lp.OffsetInner),(i=this.Items[r].InsertItem(t))&&this.ReFormatData(n,o,0)):i=this.SelectInfo.StartItemOffset==lp.OffsetBefor?this.InsertItemEx(this.SelectInfo.StartItemNo,t):this.InsertItemEx(this.SelectInfo.StartItemNo+1,t,!1);else if(this.SelectInfo.StartItemOffset==this.Items[r].Length)i=this.InsertItemEx(this.SelectInfo.StartItemNo+1,t,!1);else if(0==this.SelectInfo.StartItemOffset)i=this.InsertItemEx(this.SelectInfo.StartItemNo,t);else{n=(e=this.GetFormatRange(n,o)).firstDrawItemNo,o=e.lastItemNo,this.FormatPrepare(n,o);var s=this.Items[r].Text,a=s.substr(0,this.SelectInfo.StartItemOffset),l=s.substr(this.SelectInfo.StartItemOffset+1-1,this.Items[r].Length-this.SelectInfo.StartItemOffset);if(this.Undo_New(),this.Items[r].CanConcatItems(t))t.ParaFirst?(this.UndoAction_DeleteBackText(r,this.SelectInfo.StartItemOffset+1,l),this.Items[r].Text=a,t.Text=t.Text+l,r+=1,this.Items.insert(r,t),this.UndoAction_InsertItem(r,0),this.ReFormatData(n,o+1,1),this.ReSetSelectAndCaret(r)):(this.UndoAction_InsertText(r,this.SelectInfo.StartItemOffset+1,t.Text),a+=t.Text,this.Items[r].Text=a+l,this.ReFormatData(n,o,0),this.SelectInfo.StartItemNo=r,this.SelectInfo.StartItemOffset=a.length);else{this.UndoAction_DeleteBackText(r,this.SelectInfo.StartItemOffset+1,l);var h=this.Items[r].BreakByOffset(this.SelectInfo.StartItemOffset);r+=1,this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(r,h)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(r,0),this.Items.insert(r,t),this.UndoAction_InsertItem(r,0),this.ReFormatData(n,o+2,2),this.ReSetSelectAndCaret(r)}i=!0}return i}},{key:"InsertItemEx",value:function(t,e){var i,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!this.CanEdit())return!1;if(!this.DeleteSelected())return!1;if(e.ParaNo>this.Style.ParaStyles.count-1&&(e.ParaNo=this.CurParaNo),!e.ParaFirst){if(this.IsEmptyData()){this.Undo_New();var o=this.EmptyDataInsertItem(e);return this.CurParaNo=e.ParaNo,o}e.ParaNo=this.CurParaNo}var r=0,s=-1,a=-1;if(this.Undo_New(),e.StyleNo<cs.Null){var l=t;t<this.Items.count?n?(s=(i=this.GetFormatRangeByOffset(t,1,s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),this.IsEmptyLine(t)?(e.ParaFirst=!0,e.PageBreak=this.Items[t].PageBreak,this.UndoAction_DeleteItem(t,0),this.Items.delete(t),r--):e.ParaFirst||(e.ParaFirst=this.Items[t].ParaFirst,this.Items[t].ParaFirst&&(this.UndoAction_ItemParaFirst(t,0,!1),this.Items[t].ParaFirst=!1,this.Items[t].PageBreak&&(this.UndoAction_ItemPageBreak(t,0,!1),this.Items[t].PageBreak=!1,e.PageBreak=!0)))):t>0&&this.Items[t-1].StyleNo>cs.Null&&""==this.Items[t-1].Text?(s=(i=this.GetFormatRangeByOffset(t-1,1,s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),e.ParaFirst=!0,e.PageBreak=this.Items[t-1].PageBreak,this.UndoAction_DeleteItem(t-1,0),this.Items.delete(t-1),r--,l--):(s=(i=this.GetFormatRangeByOffset(t-1,this.GetItemLastDrawItemNo(t-1),s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a)):(s=(i=this.GetFormatRangeByOffset(t-1,this.GetItemLastDrawItemNo(t-1),s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),!e.ParaFirst&&this.Items[t-1].StyleNo>cs.Null&&""==this.Items[t-1].Text&&(e.ParaFirst=!0,e.PageBreak=this.Items[t-1].PageBreak,this.UndoAction_DeleteItem(t-1,0),this.Items.delete(t-1),r--,l--)),this.Items.insert(l,e),this.UndoAction_InsertItem(l,lp.OffsetAfter),r++,this.ReFormatData(s,a+r,r),this.ReSetSelectAndCaret(l)}else{var h=!1;e.ParaFirst||(n?t<this.Items.count&&this.Items[t].CanConcatItems(e)?(s=(i=this.GetFormatRangeByOffset(t,1,s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),this.UndoAction_InsertText(t,1,e.Text),this.Items[t].Text=e.Text+this.Items[t].Text,this.ReFormatData(s,a,0),this.ReSetSelectAndCaret(t),h=!0):!this.Items[t].ParaFirst&&t>0&&this.Items[t-1].CanConcatItems(e)&&(s=(i=this.GetFormatRangeByOffset(t-1,this.GetItemOffsetAfter(t-1),s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),this.UndoAction_InsertText(t-1,this.Items[t-1].Length+1,e.Text),this.Items[t-1].Text=this.Items[t-1].Text+e.Text,this.ReFormatData(s,a,0),this.ReSetSelectAndCaret(t-1),h=!0):this.IsEmptyLine(t-1)?(s=(i=this.GetFormatRangeByOffset(t-1,1,s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),e.ParaFirst=!0,this.Items.insert(t,e),this.UndoAction_InsertItem(t,0),this.UndoAction_DeleteItem(t-1,0),this.Items.delete(t-1),this.ReFormatData(s,a,0),this.ReSetSelectAndCaret(t-1),h=!0):this.Items[t-1].CanConcatItems(e)?(s=(i=this.GetFormatRangeByOffset(t-1,this.GetItemOffsetAfter(t-1),s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),this.UndoAction_InsertText(t-1,this.Items[t-1].Length+1,e.Text),this.Items[t-1].Text=this.Items[t-1].Text+e.Text,this.ReFormatData(s,a,0),this.ReSetSelectAndCaret(t-1),h=!0):t<this.Items.count&&!this.Items[t].ParaFirst&&this.Items[t].CanConcatItems(e)&&(s=(i=this.GetFormatRangeByOffset(t,1,s,a)).firstDrawItemNo,a=i.lastItemNo,this.FormatPrepare(s,a),this.UndoAction_InsertText(t,1,e.Text),this.Items[t].Text=e.Text+this.Items[t].Text,this.ReFormatData(s,a,0),this.ReSetSelectAndCaretByOffset(t,e.Length),h=!0)),h||(n?(s=(i=this.GetFormatRangeByOffset(t,1,s,a)).firstDrawItemNo,a=i.lastItemNo,e.ParaFirst||(e.ParaFirst=this.Items[t].ParaFirst,this.Items[t].ParaFirst&&(this.UndoAction_ItemParaFirst(t,0,!1),this.Items[t].ParaFirst=!1))):(s=(i=this.GetFormatRangeByOffset(t-1,this.GetItemOffsetAfter(t-1),s,a)).firstDrawItemNo,a=i.lastItemNo),this.FormatPrepare(s,a),this.Items.insert(t,e),this.UndoAction_InsertItem(t,0),this.ReFormatData(s,a+1,1),this.ReSetSelectAndCaret(t))}return!0}},{key:"SetActiveItemText",value:function(t){if(this.CanEdit()&&""!=t){this.InitializeField();var e=this.GetActiveItem();if(null!=e){var i,n=-1,o=-1;if(e.StyleNo<cs.Null&&this.SelectInfo.StartItemOffset==lp.OffsetInner){this.Undo_New();var r=e;r.MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),r.SetActiveItemText(t),r.IsFormatDirty?(n=(i=this.GetFormatRange(n,o)).firstDrawItemNo,o=i.lastItemNo,this.FormatPrepare(n,o),this.ReFormatData(n,o)):this.FormatInit()}else{if(t.indexOf("\r\n")>=0){this.Undo_GroupBegin(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);try{this.DeleteItems(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemNo,!0),this.InsertText(t)}finally{this.Undo_GroupEnd(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)}return}if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.SetItemText))return;this.Undo_New(),this.UndoAction_SetItemText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,t),this.Items[this.SelectInfo.StartItemNo].Text=t,n=(i=this.GetFormatRange(n,o)).firstDrawItemNo,o=i.lastItemNo,this.FormatPrepare(n,o),this.ReFormatData(n,o),this.SelectInfo.StartItemOffset=t.length,this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1,this.Items[this.SelectInfo.StartItemNo].DisSelect(),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)}this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()}}}},{key:"KillFocus",value:function(){var t=this.GetActiveItemNo();t>0&&this.Items[t].KillFocus()}},{key:"DoItemMouseDown",value:function(t,e,i){if(!(t<0)){var n=this.CoordToItemOffset(i.x,i.y,t,e,-1,-1),o=new ei;o.assign(i),o.x=n.x,o.y=n.y,this.Items[t].MouseDown(o),null!=this.OnItemMouseDown&&this.OnItemMouseDown(this,t,e,o)}}},{key:"MouseDown",value:function(t){this.FSelecting=!1,this.FDraging=!1,this.FMouseLBDouble=!1,this.FMouseDownReCaret=!1,this.FMouseLBDowning=t.button==ee&&!or.keyDownStates[Re],this.FMouseDownX=t.x,this.FMouseDownY=t.y;var e=-1,i=-1,n=-1,o=!1,r=this.GetItemAt(t.x,t.y,e,i,n,o);if(e=r.itemNo,i=r.offset,n=r.drawItemNo,o=r.restrain,this.FSelectSeekNo=e,this.FSelectSeekOffset=i,t.button==ee&&or.keyDownStates[Re])if(this.FMouseDownItemNo=e,this.FMouseDownItemOffset=i,!o&&this.Items[this.FMouseDownItemNo].StyleNo<cs.Null&&i==lp.OffsetInner)this.DoItemMouseDown(this.FMouseDownItemNo,this.FMouseDownItemOffset,t);else{var s=this.SelectByMouseDownShift(e,i);e=s.itemNo,i=s.offset,s.result&&(this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.FMouseDownItemNo=e,this.FMouseDownItemOffset=i,this.FSelectSeekNo=e,this.FSelectSeekOffset=i)}else this.CoordInSelect(t.x,t.y,e,i,o)?(this.Items[e].StyleNo<cs.Null&&this.DoItemMouseDown(e,i,t),this.FMouseLBDowning&&!this.SelectedResizing()?(this.FDraging=!0,this.Style.UpdateInfo.DragingSelected=!0):(this.FMouseDownItemNo=e,this.FMouseDownItemOffset=i)):(e==this.FMouseDownItemNo&&i==this.FMouseDownItemOffset&&this.CaretDrawItemNo==n||(this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.FMouseDownReCaret=!0,this.DisSelect(),this.FMouseDownItemNo=e,this.FMouseDownItemOffset=i,!this.SelectInfo.StartRestrain&&o&&(this.Items[this.FMouseDownItemNo].Active=!1),this.SelectInfo.StartItemNo=this.FMouseDownItemNo,this.SelectInfo.StartItemOffset=this.FMouseDownItemOffset,this.SelectInfo.StartRestrain=o,this.CaretDrawItemNo=n),this.DoItemMouseDown(this.FMouseDownItemNo,this.FMouseDownItemOffset,t))}},{key:"DoItemMouseMove",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!(t<0)){var o=this.CoordToDrawItem(i.x,i.y,this.FMouseMoveDrawItemNo,-1,-1),r=new ei;r.assign(i),r.x=o.x,r.y=o.y,n&&this.DoDrawItemMouseMove(this,t,e,this.FMouseMoveDrawItemNo,r),this.Items[t].MouseMove(r)}}},{key:"MouseMove",value:function(t){if(this.SelectedResizing())return this.FMouseMoveItemNo=this.FMouseDownItemNo,this.FMouseMoveItemOffset=this.FMouseDownItemOffset,this.FMouseMoveDrawItemNo=this.GetDrawItemNoByOffset(this.FMouseMoveItemNo,this.FMouseMoveItemOffset),this.FMouseMoveRestrain=!1,this.DoItemMouseMove(this.FMouseMoveItemNo,this.FMouseMoveItemOffset,t),void this.Style.UpdateInfoRePaint();var e=-1,i=-1,n=!1,o=this.GetItemAt(t.x,t.y,e,i,this.FMouseMoveDrawItemNo,n);if(e=o.itemNo,i=o.offset,this.FMouseMoveDrawItemNo=o.drawItemNo,n=o.restrain,this.FDraging||this.Style.UpdateInfo.DragingSelected)lp.GCursor=ae,this.FMouseMoveItemNo=e,this.FMouseMoveItemOffset=i,this.SelectInfo.StartItemNo=e,this.SelectInfo.StartItemOffset=i,this.FMouseMoveRestrain=n,this.CaretDrawItemNo=this.FMouseMoveDrawItemNo,this.Style.UpdateInfoReCaret(),!n&&this.Items[this.FMouseMoveItemNo].StyleNo<cs.Null&&this.DoItemMouseMove(this.FMouseMoveItemNo,this.FMouseMoveItemOffset,t);else if(this.FSelecting){if(this.Items[this.FMouseDownItemNo].StyleNo<cs.Null&&this.FMouseDownItemOffset==lp.OffsetInner)return this.FMouseMoveItemNo=this.FMouseDownItemNo,this.FMouseMoveItemOffset=this.FMouseDownItemOffset,e==this.FMouseDownItemNo?this.FMouseMoveRestrain=n:this.FMouseMoveRestrain=!0,this.DoItemMouseMove(this.FMouseMoveItemNo,this.FMouseMoveItemOffset,t),this.Style.UpdateInfoRePaint(),void this.Style.UpdateInfoReCaret();this.FMouseMoveItemNo=e,this.FMouseMoveItemOffset=i,this.FMouseMoveRestrain=n;var r=this.AdjustSelectRange(this.FMouseDownItemNo,this.FMouseDownItemOffset,this.FMouseMoveItemNo,this.FMouseMoveItemOffset);this.FMouseDownItemNo=r.startItemNo,this.FMouseDownItemOffset=r.startItemOffset,this.FMouseMoveItemNo=r.endItemNo,this.FMouseMoveItemOffset=r.endItemOffset,this.FSelectSeekNo=this.FMouseMoveItemNo,this.FSelectSeekOffset=this.FMouseMoveItemOffset,this.SelectExists()?this.MatchItemSelectState():this.CaretDrawItemNo=this.FMouseMoveDrawItemNo,this.Items[this.FMouseMoveItemNo].StyleNo<cs.Null&&this.FMouseDownItemOffset==lp.OffsetInner&&this.DoItemMouseMove(this.FMouseMoveItemNo,this.FMouseMoveItemOffset,t),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()}else!this.FMouseLBDowning||this.FMouseDownX==t.x&&this.FMouseDownY==t.y?(e!=this.FMouseMoveItemNo?(this.FMouseMoveItemNo>=0&&this.DoItemMouseLeave(this.FMouseMoveItemNo),e>=0&&!n&&this.DoItemMouseEnter(e),this.Style.UpdateInfoRePaint()):n!=this.FMouseMoveRestrain&&(!this.FMouseMoveRestrain&&n?this.FMouseMoveItemNo>=0&&this.DoItemMouseLeave(this.FMouseMoveItemNo):this.FMouseMoveRestrain&&!n&&e>=0&&this.DoItemMouseEnter(e),this.Style.UpdateInfoRePaint()),this.FMouseMoveItemNo=e,this.FMouseMoveItemOffset=i,this.FMouseMoveRestrain=n,n||(this.DoItemMouseMove(this.FMouseMoveItemNo,this.FMouseMoveItemOffset,t,!0),or.keyDownStates[_e]&&""!=this.Items[this.FMouseMoveItemNo].HyperLink&&(lp.GCursor=le))):(this.FSelecting=!0,this.Style.UpdateInfo.Selecting=!0)}},{key:"DoItemMouseUp",value:function(t,e,i,n){if(!(t<0)){var o=this.CoordToItemOffset(n.x,n.y,t,e,-1,-1),r=new ei;r.assign(n),r.x=o.x,r.y=o.y,this.Items[t].MouseUp(r),i||null==this.OnItemMouseUp||this.OnItemMouseUp(this,t,e,r)}}},{key:"DoNormalMouseUp",value:function(t,e,i,n,o){this.FMouseMoveItemNo<0?(this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e,this.SelectInfo.StartRestrain=n,this.CaretDrawItemNo=i):(this.SelectInfo.StartItemNo=this.FMouseMoveItemNo,this.SelectInfo.StartItemOffset=this.FMouseMoveItemOffset,this.SelectInfo.StartRestrain=n,this.CaretDrawItemNo=this.FMouseMoveDrawItemNo),this.Style.UpdateInfoRePaint(),this.FMouseDownReCaret||this.Style.UpdateInfoReCaret(),this.DoItemMouseUp(t,e,n,o)}},{key:"MouseUp",value:function(t){if(this.FMouseLBDowning=!1,!(this.FMouseLBDouble||t.button==ee&&or.keyDownStates[Re])){var e=!1;if(this.SelectedResizing()){this.Undo_New(),this.UndoAction_ItemSelf(this.FMouseDownItemNo,this.FMouseDownItemOffset),this.DoItemMouseUp(this.FMouseDownItemNo,this.FMouseDownItemOffset,e,t),this.DoItemResized(this.FMouseDownItemNo);var i=-1,n=-1,o=this.GetFormatRangeByOffset(this.FMouseDownItemNo,this.FMouseDownItemOffset,i,n);return i=o.firstDrawItemNo,n=o.lastItemNo,this.FormatPrepare(i,n),this.ReFormatData(i,n),void this.Style.UpdateInfoRePaint()}var r=-1,s=-1,a=-1,l=this.GetItemAt(t.x,t.y,r,s,a,e);if(r=l.itemNo,s=l.offset,a=l.drawItemNo,e=l.restrain,this.FSelecting||this.Style.UpdateInfo.Selecting){if(this.FSelecting=!1,this.SelectInfo.StartItemNo>=0)for(var h=this.SelectInfo.StartItemNo;h<=this.SelectInfo.EndItemNo;h++)h!=r&&this.Items[h].StyleNo<cs.Null&&this.DoItemMouseUp(h,0,e,t);this.SelectInfo.EndItemNo<0?this.FMouseDownItemNo>=0&&this.Items[this.FMouseDownItemNo].StyleNo<cs.Null?this.DoItemMouseUp(this.FMouseDownItemNo,lp.OffsetInner,e,t):this.DoItemMouseUp(r,s,e,t):this.Items[r].StyleNo<cs.Null&&this.DoItemMouseUp(r,s,e,t)}else if(this.FDraging||this.Style.UpdateInfo.DragingSelected){if(this.FDraging=!1,this.SelectInfo.StartItemNo>=0)for(var c=this.SelectInfo.StartItemNo;c<=this.SelectInfo.EndItemNo;c++)this.Items[c].DisSelect();this.FMouseMoveItemNo=r,this.FMouseMoveItemOffset=s,this.FMouseMoveDrawItemNo=a,this.FMouseDownItemNo=r,this.FMouseDownItemOffset=s,this.DoNormalMouseUp(r,s,a,e,t),this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1}else this.SelectExists(!1)&&this.DisSelect(),this.DoNormalMouseUp(r,s,a,e,t)}}},{key:"MouseLeave",value:function(){this.FMouseMoveItemNo>=0&&(this.DoItemMouseLeave(this.FMouseMoveItemNo),this.FMouseMoveItemNo=-1,this.FMouseMoveItemOffset=-1,this.FMouseMoveDrawItemNo=-1,this.Style.UpdateInfoRePaint())}},{key:"KeyPress",value:function(t){if(!this.CanEdit())return t;var e=this.GetActiveItem();if(null==e)return t;if(e.StyleNo<cs.Null&&this.SelectInfo.StartItemOffset==lp.OffsetInner){this.Undo_New();var i=e;if(i.MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),i.KeyPress(t),i.IsFormatDirty){var n=-1,o=-1,r=this.GetFormatRange(n,o);n=r.firstDrawItemNo,o=r.lastItemNo,this.FormatPrepare(n,o),0!=t&&this.ReFormatData(n,o),i.IsFormatDirty=!1,this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoReScroll()}else this.FormatInit()}else this.InsertText(String.fromCharCode(t));return t}},{key:"CheckSelectEndEff",value:function(){var t=this.SelectInfo.StartItemNo,e=this.SelectInfo.StartItemOffset,i=this.SelectInfo.EndItemNo,n=this.SelectInfo.EndItemOffset;this.AdjustSelectRange(t,e,i,n)}},{key:"SetSelectSeekStart",value:function(){this.FSelectSeekNo=this.SelectInfo.StartItemNo,this.FSelectSeekOffset=this.SelectInfo.StartItemOffset}},{key:"SetSelectSeekEnd",value:function(){this.FSelectSeekNo=this.SelectInfo.EndItemNo,this.FSelectSeekOffset=this.SelectInfo.EndItemOffset}},{key:"TABKeyDown",value:function(t,e){if(0==this.SelectInfo.StartItemOffset&&this.Items[this.SelectInfo.StartItemNo].ParaFirst){var i=this.Style.ParaStyles[t.ParaNo],n=this.MatchTextStyleNoAt(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);n<cs.Null&&(n=this.Style.GetDefaultStyleNo());var o=lp.TabCharWidth;n>cs.Null&&(this.Style.ApplyTempStyle(n),o=2*this.Style.TempCanvas.textWidth("荆")),this.ApplyParaFirstIndent(i.FirstIndent+sr.pixXToMillimeter(o))}else if(t.StyleNo<cs.Null)if(this.SelectInfo.StartItemOffset==lp.OffsetInner){if(t.WantKeyDown(e)){var r=-1,s=-1,a=this.GetFormatRange(r,s);r=a.firstDrawItemNo,s=a.lastItemNo,this.FormatPrepare(r,s),t.KeyDown(e),this.ReFormatData(r,s)}}else{var l=new su(this);this.InsertItem(l)}else{var h=new su(this);this.InsertItem(h)}}},{key:"SelectPrio",value:function(t,e){return e>0?this.Items[t].StyleNo<cs.Null?e=this.Items[t].isClass(za)?this.Items[t].GetOffsetAt(0):lp.OffsetBefor:e-=1:t>0&&(t-=1,e=this.Items[t].StyleNo<cs.Null?this.Items[t].isClass(za)?this.Items[t].GetOffsetAt(0):lp.OffsetBefor:this.Items[t].Length>0?this.Items[t].Length-1:0),lp.UNPLACEHOLDERCHAR&&this.Items[t].StyleNo>cs.Null&&this.Items[t].Length>0&&lp.IsUnPlaceHolderChar(this.Items[t].Text[e+1-1])&&(e=this.GetItemActualOffset(t,e)-1),{itemNo:t,offset:e}}},{key:"SelectStartItemPrio",value:function(){var t=this.SelectPrio(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);this.SelectInfo.StartItemNo=t.itemNo,this.SelectInfo.StartItemOffset=t.offset}},{key:"SelectEndItemPrio",value:function(){var t=this.SelectPrio(this.SelectInfo.EndItemNo,this.SelectInfo.EndItemOffset);this.SelectInfo.EndItemNo=t.itemNo,this.SelectInfo.EndItemOffset=t.offset}},{key:"LeftKeyDown",value:function(t,e){if(e.shiftState.has(Qt))this.SelectInfo.EndItemNo>=0?this.IsSelectSeekStart()?(this.SelectStartItemPrio(),this.CheckSelectEndEff(),this.SetSelectSeekStart()):(this.SelectEndItemPrio(),this.CheckSelectEndEff(),this.SetSelectSeekEnd()):(this.SelectInfo.StartItemNo>0&&0==this.SelectInfo.StartItemOffset&&(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo)),this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectStartItemPrio(),this.CheckSelectEndEff(),this.SetSelectSeekStart()),this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.SelectExists(!1)||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset));else{if(t){for(var i=this.SelectInfo.StartItemNo;i<=this.SelectInfo.EndItemNo;i++)this.Items[i].DisSelect();this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1}else if(0!=this.SelectInfo.StartItemOffset){if(this.SelectInfo.StartItemOffset=this.SelectInfo.StartItemOffset-1,lp.UNPLACEHOLDERCHAR){var n=this.Items[this.SelectInfo.StartItemNo].Text[this.SelectInfo.StartItemOffset+1-1];lp.TibetanVowel.indexOf(n)>=0||lp.IsUnPlaceHolderChar(n)&&(this.SelectInfo.StartItemOffset=this.GetItemActualOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)-1)}}else if(this.SelectInfo.StartItemNo>0){if(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo),!this.DrawItems[this.Items[this.SelectInfo.StartItemNo+1].FirstDItemNo].LineFirst)return this.Style.UpdateInfoRePaint(),void this.KeyDown(e)}else e.Handled=!0;if(!e.Handled){var o=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);o!=this.CaretDrawItemNo?o==this.CaretDrawItemNo-1&&this.DrawItems[o].ItemNo==this.DrawItems[this.CaretDrawItemNo].ItemNo&&this.DrawItems[this.CaretDrawItemNo].LineFirst&&this.SelectInfo.StartItemOffset==this.DrawItems[this.CaretDrawItemNo].CharOffs-1||(this.CaretDrawItemNo=o):this.SelectInfo.StartRestrain&&(this.SelectInfo.StartRestrain=!1,this.Items[this.DrawItems[o].ItemNo].Active=!0),this.Style.UpdateInfoRePaint()}}}},{key:"SelectNext",value:function(t,e){return e==this.GetItemOffsetAfter(t)?t<this.Items.count-1&&(t++,e=this.Items[t].StyleNo<cs.Null?this.Items[t].isClass(za)?this.Items[t].GetOffsetAt(0):lp.OffsetAfter:this.Items[t].Length>0?1:0):this.Items[t].StyleNo<cs.Null?e=this.Items[t].isClass(za)?this.Items[t].GetOffsetAt(0):lp.OffsetAfter:e+=1,lp.UNPLACEHOLDERCHAR&&(e=this.GetItemActualOffset(t,e,!0)),{itemNo:t,offset:e}}},{key:"SelectStartItemNext",value:function(){var t=this.SelectNext(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);this.SelectInfo.StartItemNo=t.itemNo,this.SelectInfo.StartItemOffset=t.offset}},{key:"SelectEndItemNext",value:function(){var t=this.SelectNext(this.SelectInfo.EndItemNo,this.SelectInfo.EndItemOffset);this.SelectInfo.EndItemNo=t.itemNo,this.SelectInfo.EndItemOffset=t.offset}},{key:"RightKeyDown",value:function(t,e,i){if(i.shiftState.has(Qt))this.SelectInfo.EndItemNo>=0?this.IsSelectSeekStart()?(this.SelectStartItemNext(),this.CheckSelectEndEff(),this.SetSelectSeekStart()):(this.SelectEndItemNext(),this.CheckSelectEndEff(),this.SetSelectSeekEnd()):(this.SelectInfo.StartItemNo<this.Items.count-1&&(this.Items[this.SelectInfo.StartItemNo].StyleNo<cs.Null?this.SelectInfo.StartItemOffset==lp.OffsetAfter&&(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0):this.SelectInfo.StartItemOffset==this.Items[this.SelectInfo.StartItemNo].Length&&(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0)),this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectEndItemNext(),this.CheckSelectEndEff(),this.SetSelectSeekEnd()),this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.SelectExists(!1)||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset));else{if(t){for(var n=this.SelectInfo.StartItemNo;n<=this.SelectInfo.EndItemNo;n++)this.Items[n].DisSelect();this.SelectInfo.StartItemNo=this.SelectInfo.EndItemNo,this.SelectInfo.StartItemOffset=this.SelectInfo.EndItemOffset,this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1}else if(this.SelectInfo.StartItemOffset<e.Length)lp.UNPLACEHOLDERCHAR?this.SelectInfo.StartItemOffset=this.GetItemActualOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,!0):this.SelectInfo.StartItemOffset=this.SelectInfo.StartItemOffset+1;else if(this.SelectInfo.StartItemNo<this.Items.count-1){if(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0,!this.DrawItems[this.Items[this.SelectInfo.StartItemNo].FirstDItemNo].LineFirst)return this.Style.UpdateInfoRePaint(),void this.KeyDown(i)}else i.Handled=!0;if(!i.Handled){var o=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);o==this.CaretDrawItemNo?this.SelectInfo.StartItemOffset==this.DrawItems[o].CharOffsetEnd()&&o<this.DrawItems.count-1&&this.DrawItems[o].ItemNo==this.DrawItems[o+1].ItemNo&&this.DrawItems[o+1].LineFirst&&this.SelectInfo.StartItemOffset==this.DrawItems[o+1].CharOffs-1&&(this.CaretDrawItemNo=o+1):this.CaretDrawItemNo=o,this.Style.UpdateInfoRePaint()}}}},{key:"HomeKeyDown",value:function(t,e){if(e.shiftState.has(Qt)){for(var i=this.GetDrawItemNoByOffset(this.FSelectSeekNo,this.FSelectSeekOffset);i>0&&!this.DrawItems[i].LineFirst;)i--;this.SelectInfo.EndItemNo>=0?this.IsSelectSeekStart()?(this.SelectInfo.StartItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=this.DrawItems[i].CharOffs-1,this.CheckSelectEndEff(),this.SetSelectSeekStart()):this.DrawItems[i].ItemNo>this.SelectInfo.StartItemNo?(this.SelectInfo.EndItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.EndItemNo].isClass(za)?this.SelectInfo.EndItemOffset=this.Items[this.SelectInfo.EndItemNo].GetOffsetAt(0):this.SelectInfo.EndItemOffset=this.DrawItems[i].CharOffs-1,this.CheckSelectEndEff(),this.SetSelectSeekEnd()):this.DrawItems[i].ItemNo==this.SelectInfo.StartItemNo?this.DrawItems[i].CharOffs-1>this.SelectInfo.StartItemOffset&&(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.Items[this.SelectInfo.EndItemNo].isClass(za)?this.SelectInfo.EndItemOffset=this.Items[this.SelectInfo.EndItemNo].GetOffsetAt(0):this.SelectInfo.EndItemOffset=this.DrawItems[i].CharOffs-1,this.CheckSelectEndEff(),this.SetSelectSeekEnd()):(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectInfo.StartItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=this.DrawItems[i].CharOffs-1,this.CheckSelectEndEff(),this.SetSelectSeekStart()):(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectInfo.StartItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=this.DrawItems[i].CharOffs-1,this.CheckSelectEndEff(),this.SetSelectSeekStart()),this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.SelectExists(!1)||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset))}else{if(t){for(var n=this.SelectInfo.StartItemNo;n<=this.SelectInfo.EndItemNo;n++)this.Items[n].DisSelect();this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1}else{var o=this.GetSelectStartDrawItemNo(),r=-1,s=this.GetLineDrawItemRang(o,r);o=s.a,r=s.b,this.SelectInfo.StartItemNo=this.DrawItems[o].ItemNo,this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=this.DrawItems[o].CharOffs-1}e.Handled||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)),this.Style.UpdateInfoRePaint()}}},{key:"EndKeyDown",value:function(t,e){if(e.shiftState.has(Qt)){var i=this.GetDrawItemNoByOffset(this.FSelectSeekNo,this.FSelectSeekOffset);for(i+=1;i<this.DrawItems.count&&!this.DrawItems[i].LineFirst;)i++;i--,this.SelectInfo.EndItemNo>=0?this.IsSelectSeekStart()?this.DrawItems[i].ItemNo>this.SelectInfo.EndItemNo?(this.SelectInfo.StartItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.StartItemNo].StyleNo<cs.Null?this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=lp.OffsetAfter:this.SelectInfo.StartItemOffset=this.DrawItems[i].CharOffsetEnd(),this.CheckSelectEndEff(),this.SetSelectSeekStart()):this.DrawItems[i].ItemNo==this.SelectInfo.EndItemNo?(this.SelectInfo.StartItemNo=this.SelectInfo.EndItemNo,this.DrawItems[i].CharOffsetEnd()<this.SelectInfo.EndItemOffset?(this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=this.DrawItems[i].CharOffsetEnd(),this.CheckSelectEndEff(),this.SetSelectSeekStart()):(this.SelectInfo.StartItemOffset=this.SelectInfo.EndItemOffset,this.Items[this.SelectInfo.EndItemNo].isClass(za)?this.SelectInfo.EndItemOffset=this.Items[this.SelectInfo.EndItemNo].GetOffsetAt(0):this.SelectInfo.EndItemOffset=this.DrawItems[i].CharOffsetEnd(),this.CheckSelectEndEff(),this.SetSelectSeekEnd())):(this.SelectInfo.StartItemNo=this.SelectInfo.EndItemNo,this.SelectInfo.StartItemOffset=this.SelectInfo.EndItemOffset,this.SelectInfo.EndItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.EndItemNo].isClass(za)?this.SelectInfo.EndItemOffset=this.Items[this.SelectInfo.EndItemNo].GetOffsetAt(0):this.SelectInfo.EndItemOffset=this.DrawItems[i].CharOffsetEnd(),this.CheckSelectEndEff(),this.SetSelectSeekEnd()):(this.SelectInfo.EndItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.EndItemNo].isClass(za)?this.SelectInfo.EndItemOffset=this.Items[this.SelectInfo.EndItemNo].GetOffsetAt(0):this.SelectInfo.EndItemOffset=this.DrawItems[i].CharOffsetEnd(),this.CheckSelectEndEff(),this.SetSelectSeekEnd()):(this.SelectInfo.EndItemNo=this.DrawItems[i].ItemNo,this.Items[this.SelectInfo.EndItemNo].isClass(za)?this.SelectInfo.EndItemOffset=this.Items[this.SelectInfo.EndItemNo].GetOffsetAt(0):this.SelectInfo.EndItemOffset=this.DrawItems[i].CharOffsetEnd(),this.CheckSelectEndEff(),this.SelectInfo.EndItemNo<0?this.SetSelectSeekStart():this.SetSelectSeekEnd()),this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.SelectExists(!1)||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset))}else{if(t){for(var n=this.SelectInfo.StartItemNo;n<=this.SelectInfo.EndItemNo;n++)this.Items[n].DisSelect();this.SelectInfo.StartItemNo=this.SelectInfo.EndItemNo,this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=this.SelectInfo.EndItemOffset,this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1}else{var o=this.GetSelectStartDrawItemNo(),r=-1,s=this.GetLineDrawItemRang(o,r);o=s.a,r=s.b,this.SelectInfo.StartItemNo=this.DrawItems[r].ItemNo,this.Items[this.SelectInfo.StartItemNo].isClass(za)?this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].GetOffsetAt(0):this.SelectInfo.StartItemOffset=this.DrawItems[r].CharOffsetEnd()}e.Handled||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)),this.Style.UpdateInfoRePaint()}}},{key:"GetUpDrawItemNo",value:function(t,e){var i=!1,n=t,o=-1,r=this.GetLineDrawItemRang(n,o);if(n=r.a,o=r.b,n>0){i=!0;var s=this.DrawItems[t].rect.left+this.GetDrawItemOffsetWidth(t,e);n-=1,n=(r=this.GetLineDrawItemRang(n,o)).a,o=r.b;for(var a=n;a<=o;a++)if(this.DrawItems[a].rect.right>s)return{drawItemNo:t=a,drawItemOffset:e=this.Items[this.DrawItems[a].ItemNo].isClass(za)?this.Items[this.DrawItems[a].ItemNo].GetOffsetAt(0):this.DrawItems[a].CharOffs+this.GetDrawItemOffsetAt(a,s)-1,result:i};t=o,e=this.Items[this.DrawItems[o].ItemNo].isClass(za)?this.Items[this.DrawItems[o].ItemNo].GetOffsetAt(0):this.DrawItems[o].CharOffsetEnd()}return{drawItemNo:t,drawItemOffset:e,result:i}}},{key:"UpKeyDown",value:function(t,e){if(e.shiftState.has(Qt)){var i,n=-1,o=-1;this.SelectInfo.EndItemNo>=0?this.IsSelectSeekStart()?(n=this.GetSelectStartDrawItemNo(),o=this.SelectInfo.StartItemOffset-this.DrawItems[n].CharOffs+1,n=(i=this.GetUpDrawItemNo(n,o)).drawItemNo,o=i.drawItemOffset,i.result&&(this.SelectInfo.StartItemNo=this.DrawItems[n].ItemNo,this.SelectInfo.StartItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekStart())):(n=this.GetSelectEndDrawItemNo(),o=this.SelectInfo.EndItemOffset-this.DrawItems[n].CharOffs+1,n=(i=this.GetUpDrawItemNo(n,o)).drawItemNo,o=i.drawItemOffset,i.result&&(this.DrawItems[n].ItemNo>this.SelectInfo.StartItemNo?(this.SelectInfo.EndItemNo=n,this.SelectInfo.EndItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekEnd()):this.DrawItems[n].ItemNo==this.SelectInfo.StartItemNo?(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,o>this.SelectInfo.StartItemOffset?(this.SelectInfo.EndItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekEnd()):(this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectInfo.StartItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekStart())):(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectInfo.StartItemNo=this.DrawItems[n].ItemNo,this.SelectInfo.StartItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekStart()))):(n=this.CaretDrawItemNo,o=this.SelectInfo.StartItemOffset-this.DrawItems[n].CharOffs+1,n=(i=this.GetUpDrawItemNo(n,o)).drawItemNo,o=i.drawItemOffset,i.result&&(this.SelectInfo.EndItemNo=this.SelectInfo.StartItemNo,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset,this.SelectInfo.StartItemNo=this.DrawItems[n].ItemNo,this.SelectInfo.StartItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekStart())),this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.SelectExists(!1)||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset))}else if(t)this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1;else{var r=this.CaretDrawItemNo,s=this.SelectInfo.StartItemOffset-this.DrawItems[r].CharOffs+1,a=this.GetUpDrawItemNo(r,s);r=a.drawItemNo,s=a.drawItemOffset,a.result?(this.SelectInfo.StartItemNo=this.DrawItems[r].ItemNo,this.SelectInfo.StartItemOffset=s,this.CaretDrawItemNo=r,this.Style.UpdateInfoRePaint()):e.Handled=!0}}},{key:"GetDownDrawItemNo",value:function(t,e){var i=!1,n=t,o=-1,r=this.GetLineDrawItemRang(n,o);if(n=r.a,(o=r.b)<this.DrawItems.count-1){i=!0;var s=this.DrawItems[t].rect.left+this.GetDrawItemOffsetWidth(t,e);n=o+1,n=(r=this.GetLineDrawItemRang(n,o)).a,o=r.b;for(var a=n;a<=o;a++)if(this.DrawItems[a].rect.right>s)return{drawItemNo:t=a,drawItemOffset:e=this.Items[this.DrawItems[a].ItemNo].isClass(za)?this.Items[this.DrawItems[a].ItemNo].GetOffsetAt(0):this.DrawItems[a].CharOffs+this.GetDrawItemOffsetAt(a,s)-1,result:i};t=o,e=this.Items[this.DrawItems[o].ItemNo].isClass(za)?this.Items[this.DrawItems[o].ItemNo].GetOffsetAt(0):this.DrawItems[o].CharOffsetEnd()}return{drawItemNo:t,drawItemOffset:e,result:i}}},{key:"DownKeyDown",value:function(t,e){if(e.shiftState.has(Qt)){var i,n=-1,o=-1;this.SelectInfo.EndItemNo>=0?this.IsSelectSeekStart()?(n=this.GetSelectStartDrawItemNo(),o=this.SelectInfo.StartItemOffset-this.DrawItems[n].CharOffs+1,n=(i=this.GetDownDrawItemNo(n,o)).drawItemNo,o=i.drawItemOffset,i.result&&(this.DrawItems[n].ItemNo<this.SelectInfo.EndItemNo?(this.SelectInfo.StartItemNo=this.SelectInfo.EndItemNo,this.SelectInfo.StartItemOffset=this.SelectInfo.EndItemOffset,this.CheckSelectEndEff(),this.SetSelectSeekStart()):this.DrawItems[n].ItemNo==this.SelectInfo.EndItemNo?(this.SelectInfo.StartItemNo=this.SelectInfo.EndItemNo,o<this.SelectInfo.EndItemOffset?(this.SelectInfo.StartItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekStart()):(this.SelectInfo.StartItemOffset=this.SelectInfo.EndItemOffset,this.SelectInfo.EndItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekEnd())):(this.SelectInfo.StartItemNo=this.SelectInfo.EndItemNo,this.SelectInfo.StartItemOffset=this.SelectInfo.EndItemOffset,this.SelectInfo.EndItemNo=this.DrawItems[n].ItemNo,this.SelectInfo.EndItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekEnd()))):(n=this.GetSelectEndDrawItemNo(),o=this.SelectInfo.EndItemOffset-this.DrawItems[n].CharOffs+1,n=(i=this.GetDownDrawItemNo(n,o)).drawItemNo,o=i.drawItemOffset,i.result&&(this.SelectInfo.EndItemNo=this.DrawItems[n].ItemNo,this.SelectInfo.EndItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekEnd())):(n=this.CaretDrawItemNo,o=this.SelectInfo.StartItemOffset-this.DrawItems[n].CharOffs+1,n=(i=this.GetDownDrawItemNo(n,o)).drawItemNo,o=i.drawItemOffset,i.result&&(this.SelectInfo.EndItemNo=this.DrawItems[n].ItemNo,this.SelectInfo.EndItemOffset=o,this.CheckSelectEndEff(),this.SetSelectSeekEnd())),this.MatchItemSelectState(),this.Style.UpdateInfoRePaint(),this.SelectExists(!1)||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset))}else if(t)this.SelectInfo.StartItemNo=this.SelectInfo.EndItemNo,this.SelectInfo.StartItemOffset=this.SelectInfo.EndItemOffset,this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1;else{var r=this.CaretDrawItemNo,s=this.SelectInfo.StartItemOffset-this.DrawItems[r].CharOffs+1,a=this.GetDownDrawItemNo(r,s);r=a.drawItemNo,s=a.drawItemOffset,a.result?(this.SelectInfo.StartItemNo=this.DrawItems[r].ItemNo,this.SelectInfo.StartItemOffset=s,this.CaretDrawItemNo=r,this.Style.UpdateInfoRePaint()):e.Handled=!0}}},{key:"RectItemKeyDown",value:function(t,e,i,n){var o,r=i.keyCode,s=-1,a=-1,l=e;if(this.SelectInfo.StartItemOffset==lp.OffsetInner)if(l.WantKeyDown(i))this.Undo_New(),l.MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),l.KeyDown(i),l.IsFormatDirty?(s=(o=this.GetFormatRange(s,a)).firstDrawItemNo,a=o.lastItemNo,this.FormatPrepare(s,a),this.ReFormatData(s,a)):this.FormatInit();else switch(r){case Pe:this.SelectInfo.StartItemOffset=lp.OffsetAfter,this.RectItemKeyDown(t,e,i,n);break;case Ge:this.SelectInfo.StartItemOffset=lp.OffsetBefor,this.RectItemKeyDown(t,e,i,n);break;case Be:this.SelectInfo.StartItemOffset=lp.OffsetBefor,l.Active=!1,this.Style.UpdateInfoRePaint();break;case Me:this.SelectInfo.StartItemOffset=lp.OffsetAfter,l.Active=!1,this.Style.UpdateInfoRePaint();break;default:l.KeyDown(i)}else if(this.SelectInfo.StartItemOffset==lp.OffsetBefor)switch(r){case Be:this.LeftKeyDown(t,i);break;case Me:i.shiftState.has(Qt)?this.RightKeyDown(t,e,i):(l.WantKeyDown(i)?this.SelectInfo.StartItemOffset=lp.OffsetInner:l.isClass(za)?this.SelectInfo.StartItemOffset=l.GetOffsetAt(l.Width+1):this.SelectInfo.StartItemOffset=lp.OffsetAfter,this.CaretDrawItemNo=this.Items[this.SelectInfo.StartItemNo].FirstDItemNo);break;case Ee:this.UpKeyDown(t,i);break;case Le:this.DownKeyDown(t,i);break;case Oe:this.EndKeyDown(t,i);break;case Ne:this.HomeKeyDown(t,i);break;case be:if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.ReturnItem))return;s=(o=this.GetFormatRange(s,a)).firstDrawItemNo,a=o.lastItemNo,this.FormatPrepare(s,a),e.ParaFirst?((e=this.CreateDefaultTextItem()).ParaFirst=!0,this.Items.insert(this.SelectInfo.StartItemNo,e),this.Undo_New(),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),n&&(this.UndoAction_ItemPageBreak(this.SelectInfo.StartItemNo+1,0,!0),this.Items[this.SelectInfo.StartItemNo+1].PageBreak=!0),this.ReFormatData(s,a+1,1),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)):(this.Undo_New(),this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!0),e.ParaFirst=!0,n&&(this.UndoAction_ItemPageBreak(this.SelectInfo.StartItemNo,0,!0),e.PageBreak=!0),this.ReFormatData(s,a));break;case Pe:e.ParaFirst&&this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.BackDeleteText)?this.Style.ParaStyles[e.ParaNo].FirstIndent>0?this.ApplyParaFirstIndent(Math.max(0,this.Style.ParaStyles[e.ParaNo].FirstIndent-sr.pixXToMillimeter(lp.TabCharWidth))):this.SelectInfo.StartItemNo>0&&(s=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo-1,this.GetItemOffsetAfter(this.SelectInfo.StartItemNo-1)),a=this.GetParaLastItemNo(this.SelectInfo.StartItemNo),this.FormatPrepare(s,a),this.Undo_New(),this.IsEmptyLine(this.SelectInfo.StartItemNo-1)?(this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo-1,0),this.Items.delete(this.SelectInfo.StartItemNo-1),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,0)):(this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,!1),e.ParaFirst=!1,e.PageBreak&&(this.UndoAction_ItemPageBreak(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,!1),e.PageBreak=!1),this.ReFormatData(s,a))):(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo),this.KeyDown(i));break;case Ge:if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.startItemOffset,wp.DeleteItem))return void(this.SelectInfo.StartItemOffset=lp.OffsetAfter);if(s=(o=this.GetFormatRange(s,a)).firstDrawItemNo,a=o.lastItemNo,this.FormatPrepare(s,a),e.ParaFirst)this.SelectInfo.StartItemNo!=a?(this.Undo_New(),this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo+1,0,!0),this.Items[this.SelectInfo.StartItemNo+1].ParaFirst=!0,this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),this.ReFormatData(s,a-1,-1)):(this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),(e=this.CreateDefaultTextItem()).ParaFirst=!0,this.Items.insert(this.SelectInfo.StartItemNo,e),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),this.ReFormatData(s,a));else if(this.SelectInfo.StartItemNo<a){var h=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo-1);this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),this.MergeItemText(this.Items[this.SelectInfo.StartItemNo-1],this.Items[this.SelectInfo.StartItemNo])?(this.UndoAction_InsertText(this.SelectInfo.StartItemNo-1,this.Items[this.SelectInfo.StartItemNo-1].Length-this.Items[this.SelectInfo.StartItemNo].Length+1,this.Items[this.SelectInfo.StartItemNo].Text),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),this.ReFormatData(s,a-2,-2)):this.ReFormatData(s,a-1,-1),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=h}else this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),this.ReFormatData(s,a-1,-1),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo);this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);break;case De:this.TABKeyDown(e,i)}else if(this.SelectInfo.StartItemOffset==lp.OffsetAfter)switch(r){case Pe:if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.startItemOffset,wp.DeleteItem))return void(this.SelectInfo.StartItemOffset=lp.OffsetBefor);if(s=(o=this.GetFormatRange(s,a)).firstDrawItemNo,a=o.lastItemNo,this.FormatPrepare(s,a),e.ParaFirst)if(this.SelectInfo.StartItemNo>=0&&this.SelectInfo.StartItemNo<this.Items.count-1&&!this.Items[this.SelectInfo.StartItemNo+1].ParaFirst)this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),this.Items.delete(this.SelectInfo.StartItemNo),this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!0),this.Items[this.SelectInfo.StartItemNo].ParaFirst=!0,this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,0);else{this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo);var c=this.CreateDefaultTextItem();c.ParaFirst=!0,this.Items.insert(this.SelectInfo.StartItemNo,c),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),this.ReFormatData(s,a),this.SelectInfo.StartItemOffset=0}else{this.SelectInfo.StartItemOffset=lp.OffsetBefor;var u=Ge;i.shiftState.has(Qt)&&(u|=Re),i.Alt&&(u|=xe);var f=new ii;f.assign(i),f.keyCode=u,this.RectItemKeyDown(t,e,f,n)}break;case Ge:this.SelectInfo.StartItemNo<this.Items.count-1&&(this.Items[this.SelectInfo.StartItemNo+1].ParaFirst?(s=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),a=this.GetParaLastItemNo(this.SelectInfo.StartItemNo+1),this.FormatPrepare(s,a),this.Undo_New(),this.IsEmptyLine(this.SelectInfo.StartItemNo+1)?(this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo+1,0),this.Items.delete(this.SelectInfo.StartItemNo+1),this.ReFormatData(s,a-1,-1)):(this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo+1,0,!1),this.Items[this.SelectInfo.StartItemNo+1].ParaFirst=!1,this.ReFormatData(s,a),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo+1,0))):(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0,this.KeyDown(i)));break;case Be:i.shiftState.has(Qt)?this.LeftKeyDown(t,i):(l.WantKeyDown(i)?this.SelectInfo.StartItemOffset=lp.OffsetInner:l.isClass(za)?this.SelectInfo.StartItemOffset=l.GetOffsetAt(-1):this.SelectInfo.StartItemOffset=lp.OffsetBefor,this.CaretDrawItemNo=this.Items[this.SelectInfo.StartItemNo].FirstDItemNo);break;case Me:this.RightKeyDown(t,e,i);break;case Ee:this.UpKeyDown(t,i);break;case Le:this.DownKeyDown(t,i);break;case Oe:this.EndKeyDown(t,i);break;case Ne:this.HomeKeyDown(t,i);break;case be:if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.ReturnItem))return;s=(o=this.GetFormatRange(s,a)).firstDrawItemNo,a=o.lastItemNo,this.FormatPrepare(s,a),this.Undo_New(),this.SelectInfo.StartItemNo<this.Items.count-1&&!this.Items[this.SelectInfo.StartItemNo+1].ParaFirst?(this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo+1,0,!0),this.Items[this.SelectInfo.StartItemNo+1].ParaFirst=!0,this.ReFormatData(s,a),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0,this.CaretDrawItemNo=this.Items[this.SelectInfo.StartItemNo].FirstDItemNo):((e=this.CreateDefaultTextItem()).ParaFirst=!0,e.PageBreak=n,this.Items.insert(this.SelectInfo.StartItemNo+1,e),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),this.ReFormatData(s,a+1,1),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo+1,e.Length));break;case De:this.TABKeyDown(e,i)}}},{key:"EnterKeyDown",value:function(t,e,i){if(this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.ReturnItem)){var n=-1,o=-1,r=this.GetFormatRange(n,o);if(n=r.firstDrawItemNo,o=r.lastItemNo,this.FormatPrepare(n,o),0==this.SelectInfo.StartItemOffset)if(t.ParaFirst)if(i)if(this.Undo_New(),1==this.Items.count){var s=this.CreateDefaultTextItem();s.StyleNo=t.StyleNo,s.ParaNo=t.ParaNo,s.ParaFirst=!0,this.UndoAction_ItemPageBreak(this.SelectInfo.StartItemNo,0,!0),t.PageBreak=!0,this.Items.insert(this.SelectInfo.StartItemNo,s),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),this.SelectInfo.StartItemNo++,this.ReFormatData(n,o+1,1)}else this.UndoAction_ItemPageBreak(this.SelectInfo.StartItemNo,0,!0),t.PageBreak=!0,this.ReFormatData(n,o,0,!0);else{var a=this.CreateDefaultTextItem();a.ParaNo=t.ParaNo,a.StyleNo=t.StyleNo,a.ParaFirst=!0,this.Items.insert(this.SelectInfo.StartItemNo,a),this.Undo_New(),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.ReFormatData(n,o+1,1)}else this.Undo_New(),this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!0),t.ParaFirst=!0,i&&(this.UndoAction_ItemPageBreak(this.SelectInfo.StartItemNo,0,!0),t.PageBreak=!0),this.ReFormatData(n,o,0,i);else if(this.SelectInfo.StartItemOffset==t.Length){var l=null;this.SelectInfo.StartItemNo<this.Items.count-1?((l=this.Items[this.SelectInfo.StartItemNo+1]).ParaFirst?((l=this.CreateDefaultTextItem()).ParaNo=t.ParaNo,l.StyleNo=t.StyleNo,l.ParaFirst=!0,i&&(l.PageBreak=!0),this.Items.insert(this.SelectInfo.StartItemNo+1,l),this.Undo_New(),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),this.ReFormatData(n,o+1,1,i)):(this.Undo_New(),this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo+1,0,!0),l.ParaFirst=!0,i&&(this.UndoAction_ItemPageBreak(this.SelectInfo.StartItemNo+1,0,!0),l.PageBreak=!0),this.ReFormatData(n,o,0,i)),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0):((l=this.CreateDefaultTextItem()).ParaNo=t.ParaNo,l.StyleNo=t.StyleNo,l.ParaFirst=!0,i&&(l.PageBreak=!0),this.Items.insert(this.SelectInfo.StartItemNo+1,l),this.Undo_New(),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),this.ReFormatData(n,o+1,1,i),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0)}else{var h=t.BreakByOffset(this.SelectInfo.StartItemOffset);this.Undo_New(),this.UndoAction_DeleteText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,h.Text),h.ParaFirst=!0,i&&(h.PageBreak=!0),this.Items.insert(this.SelectInfo.StartItemNo+1,h),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),this.ReFormatData(n,o+1,1,i),this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0}e.Handled||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset))}}},{key:"DeleteKeyDown",value:function(t,e){if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.DeleteText))return this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].Length,void this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);var i=0,n=-1,o=-1,r=this.SelectInfo.StartItemNo,s=this.GetFormatRange(n,o);if(n=s.firstDrawItemNo,o=s.lastItemNo,this.SelectInfo.StartItemOffset==t.Length){if(r!=this.Items.count-1){if(!this.Items[r+1].ParaFirst)return this.SelectInfo.StartItemNo=r+1,this.SelectInfo.StartItemOffset=0,this.CaretDrawItemNo=this.Items[this.SelectInfo.StartItemNo].FirstDItemNo,void this.KeyDown(e);if(o=this.GetParaLastItemNo(r+1),0==t.Length)this.FormatPrepare(n,o),this.Undo_New(),this.UndoAction_DeleteItem(r,0),this.Items.delete(r),this.ReFormatData(n,o-1,-1);else if(this.Items[r+1].StyleNo<cs.Null)o=this.GetParaLastItemNo(r+1),this.FormatPrepare(n,o),this.Undo_New(),this.UndoAction_ItemParaFirst(r+1,0,!1),this.Items[r+1].ParaFirst=!1,this.Items[r+1].PageBreak&&(this.UndoAction_ItemPageBreak(r+1,0,!1),this.Items[r+1].PageBreak=!1),this.ReFormatData(n,o),this.SelectInfo.StartItemNo=r+1,this.SelectInfo.StartItemOffset=lp.OffsetBefor;else{if(this.FormatPrepare(n,o),0==this.Items[r+1].Length)this.Undo_New(),this.UndoAction_DeleteItem(r+1,0),this.Items.delete(r+1),i++;else{t.CanConcatItems(this.Items[r+1])?(this.Undo_New(),this.UndoAction_InsertText(r,t.Length+1,this.Items[r+1].Text),t.Text=t.Text+this.Items[r+1].Text,this.UndoAction_DeleteItem(r+1,0),this.Items.delete(r+1),i++):this.Items[r+1].ParaFirst=!1;for(var a=this.Items[r].ParaNo,l=r+1;l<=o-i;l++)this.Items[l].ParaNo=a}this.ReFormatData(n,o-i,-i)}}}else{var h,c=this.Items[r].Text;if(lp.UNPLACEHOLDERCHAR){var u=lp.GetTextActualOffset(c,this.SelectInfo.StartItemOffset+1,!0)-this.SelectInfo.StartItemOffset;h=c.substr(this.SelectInfo.StartItemOffset+1-1,u),c=C.stringDelete(c,this.SelectInfo.StartItemOffset+1-1,u)}else h=c.substr(this.SelectInfo.StartItemOffset+1-1,1),t.Text=C.stringDelete(c,this.SelectInfo.StartItemOffset+1-1,1);if(this.DoItemAction(r,this.SelectInfo.StartItemOffset+1,wp.DeleteText),""==c)if(this.DrawItems[this.Items[r].FirstDItemNo].LineFirst)if(r!=o)this.FormatPrepare(n,o),this.SelectInfo.StartItemOffset=0,this.Undo_New(),this.UndoAction_ItemParaFirst(r+1,0,this.Items[r].ParaFirst),this.Items[r+1].ParaFirst=this.Items[r].ParaFirst,this.Undo_New(),this.UndoAction_DeleteItem(r,0),this.Items.delete(r),this.ReFormatData(n,o-1,-1);else{this.FormatPrepare(n);var f=t.PageBreak;this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo);var d=this.CreateDefaultTextItem();d.ParaFirst=!0,d.PageBreak=f,this.Items.insert(this.SelectInfo.StartItemNo,d),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),this.SelectInfo.StartItemOffset=0,this.ReFormatData(n)}else if(r<this.Items.count-1){var m=-1;this.MergeItemText(this.Items[r-1],this.Items[r+1])?(m=this.Items[r+1].Length,this.Undo_New(),this.UndoAction_InsertText(r-1,this.Items[r-1].Length-m+1,this.Items[r+1].Text),n=(s=this.GetFormatRangeByOffset(r-1,m,n,o)).firstDrawItemNo,o=s.lastItemNo,this.FormatPrepare(n,o),this.UndoAction_DeleteItem(r,0),this.Items.delete(r),this.UndoAction_DeleteItem(r,0),this.Items.delete(r),this.ReFormatData(n,o-2,-2)):(m=0,this.FormatPrepare(n,o),this.Undo_New(),this.UndoAction_DeleteItem(r,0),this.Items.delete(r),this.ReFormatData(n,o-1,-1)),this.SelectInfo.StartItemNo=r-1,this.GetItemStyle(this.SelectInfo.StartItemNo)<cs.Null?this.SelectInfo.StartItemOffset=lp.OffsetAfter:this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].Length-m}else this.FormatPrepare(n,o),this.Undo_New(),this.UndoAction_DeleteItem(r,0),this.Items.delete(r),this.SelectInfo.StartItemNo=r-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo),this.ReFormatData(n,o-1,-1);else t.Text=c,this.Undo_New(),this.UndoAction_DeleteText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,h),this.FormatPrepare(n,o),this.ReFormatData(n,o)}e.Handled||(this.CaretDrawItemNo=this.GetDrawItemNoByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset))}},{key:"BackspaceKeyDown",value:function(t,e,i){if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.BackDeleteText))return this.SelectInfo.StartItemOffset=0,void this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);var n,o=-1,r=-1,s=-1,a=-1,l=-1,h=!1;if(0==this.SelectInfo.StartItemOffset){if(""==t.Text&&this.Style.ParaStyles[t.ParaNo].AlignHorz!=pr)this.ApplyParaAlignHorz(pr);else if(t.ParaFirst&&this.Style.ParaStyles[t.ParaNo].FirstIndent>0){var c=this.Style.ParaStyles[t.ParaNo];this.ApplyParaFirstIndent(Math.max(0,c.FirstIndent-sr.pixXToMillimeter(lp.TabCharWidth)))}else if(t.PageBreak)s=(n=this.GetFormatRange(s,a)).firstDrawItemNo,a=n.lastItemNo,this.FormatPrepare(s,a),this.Undo_New(),this.UndoAction_ItemPageBreak(this.SelectInfo.StartItemNo,0,!1),t.PageBreak=!1,this.ReFormatData(s,a,0,!0);else if(0!=this.SelectInfo.StartItemNo){if(!t.ParaFirst)return this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.GetItemOffsetAfter(this.SelectInfo.StartItemNo),this.CaretDrawItemNo=this.Items[this.SelectInfo.StartItemNo].FirstDItemNo,void this.KeyDown(i);if(r=this.Items[this.SelectInfo.StartItemNo-1].Length,t.CanConcatItems(this.Items[this.SelectInfo.StartItemNo-1])){if(s=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo-1,r),a=this.GetParaLastItemNo(this.SelectInfo.StartItemNo),this.FormatPrepare(s,a),this.Undo_New(),this.UndoAction_InsertText(this.SelectInfo.StartItemNo-1,this.Items[this.SelectInfo.StartItemNo-1].Length+1,this.Items[this.SelectInfo.StartItemNo].Text),this.Items[this.SelectInfo.StartItemNo-1].Text=this.Items[this.SelectInfo.StartItemNo-1].Text+this.Items[this.SelectInfo.StartItemNo].Text,this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),this.Items.delete(this.SelectInfo.StartItemNo),(l=this.Items[this.SelectInfo.StartItemNo-1].ParaNo)!=t.ParaNo)for(var u=this.SelectInfo.StartItemNo;u<=a-1;u++)this.Items[u].ParaNo=l;this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo-1,r)}else if(this.IsEmptyLine(this.SelectInfo.StartItemNo-1))s=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo-1,r),a=this.GetParaLastItemNo(this.SelectInfo.StartItemNo),this.FormatPrepare(s,a),this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo-1,0),this.Items.delete(this.SelectInfo.StartItemNo-1),this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo-1,0);else if(0==t.Length)s=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo-1,r),this.FormatPrepare(s,this.SelectInfo.StartItemNo),this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),this.Items.delete(this.SelectInfo.StartItemNo),this.ReFormatData(s,this.SelectInfo.StartItemNo-1,-1),this.ReSetSelectAndCaret(this.SelectInfo.StartItemNo-1);else{if(s=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo-1,this.GetItemOffsetAfter(this.SelectInfo.StartItemNo-1)),a=this.GetParaLastItemNo(this.SelectInfo.StartItemNo),this.FormatPrepare(s,a),this.Undo_New(),this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,!1),t.ParaFirst=!1,(l=this.Items[this.SelectInfo.StartItemNo-1].ParaNo)!=t.ParaNo)for(var f=this.SelectInfo.StartItemNo;f<=a;f++)this.Items[f].ParaNo=l;this.ReFormatData(s,a),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,0)}}}else if(1==t.Length)if(o=this.SelectInfo.StartItemNo,this.DrawItems[this.Items[o].FirstDItemNo].LineFirst)if(this.Items[o].ParaFirst)if(s=(n=this.GetFormatRange(s,a)).firstDrawItemNo,a=n.lastItemNo,this.FormatPrepare(s,a),o<a)this.Undo_New(),h=!0,this.UndoAction_DeleteItem(o,this.Items[o].Length),this.Items.delete(o),h&&(this.UndoAction_ItemParaFirst(o,0,h),this.Items[o].ParaFirst=h),this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaretByOffset(o,0);else{var d=t.PageBreak;this.Undo_New(),this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo);var m=this.CreateDefaultTextItem();m.ParaFirst=!0,m.PageBreak=d,this.Items.insert(this.SelectInfo.StartItemNo,m),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),this.SelectInfo.StartItemOffset=0,this.ReFormatData(s,a)}else this.Undo_New(),o<this.GetParaLastItemNo(o)?(r=this.Items[o-1].Length,this.MergeItemText(this.Items[o-1],this.Items[o+1])?(this.UndoAction_InsertText(o-1,this.Items[o-1].Length-this.Items[o+1].Length+1,this.Items[o+1].Text),s=(n=this.GetFormatRangeByOffset(o-1,this.GetItemOffsetAfter(o-1),s,a)).firstDrawItemNo,a=n.lastItemNo,this.FormatPrepare(s,a),this.UndoAction_DeleteItem(o,this.Items[o].Length),this.Items.delete(o),this.UndoAction_DeleteItem(o,this.Items[o].Length),this.Items.delete(o),this.ReFormatData(s,a-2,-2),this.ReSetSelectAndCaretByOffset(o-1,r)):(s=(n=this.GetFormatRange(s,a)).firstDrawItemNo,a=n.lastItemNo,this.FormatPrepare(s,a),this.UndoAction_DeleteItem(o,this.Items[o].Length),this.Items.delete(o),this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaret(o-1))):(s=(n=this.GetFormatRange(s,a)).firstDrawItemNo,a=n.lastItemNo,this.FormatPrepare(s,a),this.UndoAction_DeleteItem(o,this.Items[o].Length),this.Items.delete(o),this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaret(o-1));else r=this.Items[o-1].Length,o>0&&o<e&&this.MergeItemText(this.Items[o-1],this.Items[o+1])?(this.Undo_New(),this.UndoAction_InsertText(o-1,this.Items[o-1].Length-this.Items[o+1].Length+1,this.Items[o+1].Text),s=(n=this.GetFormatRangeByOffset(o-1,r,s,a)).firstDrawItemNo,a=n.lastItemNo,this.FormatPrepare(s,a),this.UndoAction_DeleteItem(o,this.Items[o].Length),this.Items.delete(o),this.UndoAction_DeleteItem(o,0),this.Items.delete(o),this.ReFormatData(s,a-2,-2),this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo-1,r)):this.SelectInfo.StartItemNo==e?(s=(n=this.GetFormatRange(s,a)).firstDrawItemNo,a=n.lastItemNo,this.FormatPrepare(s,a),this.Undo_New(),this.UndoAction_DeleteItem(o,this.SelectInfo.StartItemOffset),this.Items.delete(o),this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaret(o-1)):(s=(n=this.GetFormatRange(s,a)).firstDrawItemNo,a=n.lastItemNo,this.FormatPrepare(s,a),this.Undo_New(),this.UndoAction_DeleteItem(o,this.Items[o].Length),this.Items.delete(o),this.ReFormatData(s,a-1,-1),this.ReSetSelectAndCaret(o-1));else{s=(n=this.GetFormatRange(s,a)).firstDrawItemNo,a=n.lastItemNo,this.FormatPrepare(s,a),this.DoItemAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.BackDeleteText);var y=t.Text;this.Undo_New(),this.UndoAction_DeleteBackText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,y.substr(this.SelectInfo.StartItemOffset-1,1)),t.Text=C.stringDelete(y,this.SelectInfo.StartItemOffset-1,1),this.ReFormatData(s,a),this.SelectInfo.StartItemOffset=this.SelectInfo.StartItemOffset-1,this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)}}},{key:"KeyDown",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!lp.IsKeyDownEdit(t.keyCode)||this.CanEdit()){var i=t.keyCode;i!=Pe&&i!=Ge&&i!=be&&i!=De||this.InitializeMouseField();var n=this.GetActiveItem();if(null!=n){var o=this.SelectExists();if(o&&(i==Pe||i==Ge||i==be||i==De)){if(!this.DeleteSelected())return;if(i==Pe||i==Ge)return}var r=-1,s=-1,a=this.GetParaItemRang(this.SelectInfo.StartItemNo,r,s);if(r=a.a,s=a.b,n.StyleNo<cs.Null)this.RectItemKeyDown(o,n,t,e);else switch(i){case Pe:this.BackspaceKeyDown(n,s,t);break;case be:this.EnterKeyDown(n,t,e);break;case Be:this.LeftKeyDown(o,t);break;case Me:this.RightKeyDown(o,n,t);break;case Ge:this.DeleteKeyDown(n,t);break;case Ne:this.HomeKeyDown(o,t);break;case Oe:this.EndKeyDown(o,t);break;case Ee:this.UpKeyDown(o,t);break;case Le:this.DownKeyDown(o,t);break;case De:this.TABKeyDown(n,t)}switch(i){case Pe:case Ge:case be:case De:this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoReScroll();break;case Be:case Me:case Ee:case Le:case Ne:case Oe:o&&this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoReScroll()}}}}},{key:"KeyUp",value:function(){this.CanEdit()}},{key:"DoInsertTextBefor",value:function(t){return""!=t}},{key:"DblClick",value:function(t,e){this.FMouseLBDouble=!0;var i=-1,n=-1,o=-1,r=!1,s=this.GetItemAt(t,e,i,n,o,r);if(i=s.itemNo,n=s.offset,o=s.drawItemNo,r=s.restrain,!(i<0)){if(this.Items[i].StyleNo<cs.Null){var a=this.CoordToItemOffset(t,e,i,n,-1,-1);this.Items[i].DblClick(a.x,a.y)}else if(this.Items[i].Length>0){var l,h=this.GetDrawItemText(o);l=(n=n-this.DrawItems[o].CharOffs+1)>0?lp.GetUnicodeCharType(h[n-1]):lp.GetUnicodeCharType(h[0]);for(var c=0,u=n-1;u>=1;u--)if(lp.GetUnicodeCharType(h[u-1])!=l){c=u;break}for(var f=h.length,d=n+1;d<=h.length;d++)if(lp.GetUnicodeCharType(h[d-1])!=l){f=d-1;break}this.SelectInfo.StartItemNo=i,this.SelectInfo.StartItemOffset=c+this.DrawItems[o].CharOffs-1,c!=f&&(this.SelectInfo.EndItemNo=i,this.SelectInfo.EndItemOffset=f+this.DrawItems[o].CharOffs-1,this.MatchItemSelectState())}this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(!1)}}},{key:"DeleteItems",value:function(t,e,i){if(this.CanEdit()&&!(e<t)){this.InitializeField();var n=-1,o=-1,r=this.GetFormatRangeByOffset(t,0,n,o);n=r.firstDrawItemNo,o=r.lastItemNo,o=(r=!i&&e<this.Items.count-1&&this.Items[e+1].ParaFirst?this.GetFormatRangeByOffset(e+1,this.GetItemOffsetAfter(e+1),0,o):this.GetFormatRangeByOffset(e,this.GetItemOffsetAfter(e),0,o)).lastItemNo,this.Items[t].ParaFirst&&n>0&&(n--,n=this.GetFormatFirstDrawItem(n)),this.FormatPrepare(n,o);var s=this.Items[t].ParaFirst,a=e-t+1;this.Undo_New();for(var l=e;l>=t;l--)this.UndoAction_DeleteItem(l,0),this.Items.delete(l);if(0==this.Items.count){var h=this.CreateDefaultTextItem();this.CurStyleNo=h.StyleNo,h.ParaFirst=!0,this.Items.add(h),a--,this.UndoAction_InsertItem(0,0)}else if(s)if(t<this.Items.count-1&&!this.Items[t].ParaFirst)this.UndoAction_ItemParaFirst(t,0,!0),this.Items[t].ParaFirst=!0;else if(i){var c=this.CreateDefaultTextItem();this.CurStyleNo=c.StyleNo,c.ParaFirst=!0,this.Items.insert(t,c),a--,this.UndoAction_InsertItem(t,0)}this.ReFormatData(n,o-a,-a),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),s&&i?this.ReSetSelectAndCaretByOffset(t,0):t>0?this.ReSetSelectAndCaret(t-1):this.ReSetSelectAndCaretByOffset(0,0)}}},{key:"DeleteActiveDataItems",value:function(t,e,i){if(!(t<0||t>this.Items.count-1)){var n=this.GetActiveItem();if(n.StyleNo<cs.Null&&this.SelectInfo.StartItemOffset==lp.OffsetInner){this.Undo_New();var o=n;if(o.MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),o.DeleteActiveDataItems(t,e,i),o.IsFormatDirty){var r=-1,s=-1,a=this.GetFormatRange(r,s);r=a.firstDrawItemNo,s=a.lastItemNo,this.FormatPrepare(r,s),this.ReFormatData(r,s)}else this.FormatInit()}else this.DeleteItems(t,e,i)}}},{key:"AddData",value:function(t){this.InitializeField();var e=0;this.Items.count>0&&this.Items[this.Items.count-1].CanConcatItems(t.Items[0])?(this.Items[this.Items.count-1].Text=this.Items[this.Items.count-1].Text+t.Items[0].Text,e=1):e=0;for(var i=e;i<t.Items.count;i++)if(!t.IsEmptyLine(i)){var n=this.CreateItemByStyle(t.Items[i].StyleNo);n.Assign(t.Items[i]),n.Active=!1,n.DisSelect(),this.Items.add(n)}}},{key:"InsertBreak",value:function(){if(!this.CanEdit())return!1;var t=new ii;return t.key="Enter",t.keyCode=be,this.KeyDown(t),this.InitializeMouseField(),!0}},{key:"DoTextItemInsert",value:function(t,e,i){var n=!1,o=this.Items[this.SelectInfo.StartItemNo];if(o.StyleNo==this.CurStyleNo){var r=0;if(0==this.SelectInfo.StartItemOffset&&o.Length>0)if(r=t.length,e||""==t)if(e||this.Items[this.SelectInfo.StartItemNo].ParaFirst){var s=this.CreateDefaultTextItem();s.Text=t,s.ParaFirst=!0,this.Items.insert(this.SelectInfo.StartItemNo,s),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++}else this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!0),o.ParaFirst=!0;else if(o.AcceptAction(0,this.SelectInfo.StartRestrain,wp.ConcatText))this.UndoAction_InsertText(this.SelectInfo.StartItemNo,1,t),o.Text=t+o.Text;else if(o.ParaFirst){var a=this.CreateDefaultTextItem();a.Text=t,a.ParaFirst=!0,this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!1),o.ParaFirst=!1,this.Items.insert(this.SelectInfo.StartItemNo,a),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++}else if(this.Items[this.SelectInfo.StartItemNo-1].StyleNo>cs.Null)if((o=this.Items[this.SelectInfo.StartItemNo-1]).AcceptAction(o.Length,!0,wp.ConcatText))this.UndoAction_InsertText(this.SelectInfo.StartItemNo-1,o.Length+1,t),o.Text=o.Text+t,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,r=o.Length;else{var l=this.CreateDefaultTextItem();l.Text=t,this.Items.insert(this.SelectInfo.StartItemNo,l),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++}else{var h=this.CreateDefaultTextItem();h.Text=t,this.Items.insert(this.SelectInfo.StartItemNo,h),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++}else if(this.SelectInfo.StartItemOffset==o.Length)if(e||""==t)if(!e&&this.SelectInfo.StartItemNo<this.Items.count-1&&!this.Items[this.SelectInfo.StartItemNo+1].ParaFirst)this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo+1,0,!0),this.Items[this.SelectInfo.StartItemNo+1].ParaFirst=!0,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,r=0;else{var c=this.CreateDefaultTextItem();c.Text=t,c.ParaFirst=!0,this.Items.insert(this.SelectInfo.StartItemNo+1,c),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,r=c.Length}else if(o.AcceptAction(this.SelectInfo.StartItemOffset,this.SelectInfo.StartRestrain,wp.ConcatText))this.UndoAction_InsertText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,t),o.Text=o.Text+t,r=o.Length;else if(this.IsParaLastItem(this.SelectInfo.StartItemNo)){var u=this.CreateDefaultTextItem();u.Text=t,this.Items.insert(this.SelectInfo.StartItemNo+1,u),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,r=t.length}else if(this.Items[this.SelectInfo.StartItemNo+1].StyleNo>cs.Null)if((o=this.Items[this.SelectInfo.StartItemNo+1]).AcceptAction(0,!0,wp.ConcatText))this.UndoAction_InsertText(this.SelectInfo.StartItemNo+1,1,t),o.Text=t+o.Text,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,r=t.length;else{var f=this.CreateDefaultTextItem();f.Text=t,this.Items.insert(this.SelectInfo.StartItemNo+1,f),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,r=t.length}else{var d=this.CreateDefaultTextItem();d.Text=t,this.Items.insert(this.SelectInfo.StartItemNo+1,d),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,r=t.length}else if(e||""==t){var m=o.SubString(this.SelectInfo.StartItemOffset+1-1,o.Length-this.SelectInfo.StartItemOffset);this.UndoAction_DeleteText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,m);var y=o.BreakByOffset(this.SelectInfo.StartItemOffset);y.Text=t+y.Text,y.ParaFirst=!0,this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(this.SelectInfo.StartItemNo+1,y)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,r=t.length}else{r=this.SelectInfo.StartItemOffset+t.length;var p=o.Text;p=C.stringInsert(p,this.SelectInfo.StartItemOffset,t),this.UndoAction_InsertText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,t),o.Text=p}this.SelectInfo.StartItemOffset=r,n=!0}else{var S=this.CreateDefaultTextItem();if(S.Text=t,S.ParaFirst=e||""==t,0==this.SelectInfo.StartItemOffset)!S.ParaFirst&&o.ParaFirst&&(S.ParaFirst=!0,0==o.Length?(this.UndoAction_DeleteItem(this.SelectInfo.StartItemNo,0),this.Items.delete(this.SelectInfo.StartItemNo),i--):(this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!1),o.ParaFirst=!1)),this.Items.insert(this.SelectInfo.StartItemNo,S),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++,this.SelectInfo.StartItemOffset=S.Length;else if(this.SelectInfo.StartItemOffset==o.Length)this.Items.insert(this.SelectInfo.StartItemNo+1,S),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=S.Length;else{var v=o.SubString(this.SelectInfo.StartItemOffset+1,o.Length-this.SelectInfo.StartItemOffset);this.UndoAction_DeleteText(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset+1,v);var F=o.BreakByOffset(this.SelectInfo.StartItemOffset);F.ParaFirst=!1,this.Items.insert(this.SelectInfo.StartItemNo+1,S),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=S.Length,this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(this.SelectInfo.StartItemNo+1,F)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++}}return this.CurStyleNo=this.Items[this.SelectInfo.StartItemNo].StyleNo,{addCount:i,result:n}}},{key:"DoInsertTextEx",value:function(t,e,i){var n=this.Items[this.SelectInfo.StartItemNo];return n.StyleNo<cs.Null?this.SelectInfo.StartItemOffset==lp.OffsetAfter?this.SelectInfo.StartItemNo<this.Items.count-1&&this.Items[this.SelectInfo.StartItemNo+1].StyleNo>cs.Null&&!this.Items[this.SelectInfo.StartItemNo+1].ParaFirst?(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0,this.CurStyleNo=this.Items[this.SelectInfo.StartItemNo].StyleNo,i=this.DoInsertTextEx(t,e,i)):""==t&&this.SelectInfo.StartItemNo<this.Items.count-1&&!this.Items[this.SelectInfo.StartItemNo+1].ParaFirst?(this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo+1,0,!0),this.Items[this.SelectInfo.StartItemNo+1].ParaFirst=!0,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=0):((n=this.CreateDefaultTextItem()).Text=t,n.ParaFirst=e||""==t,this.Items.insert(this.SelectInfo.StartItemNo+1,n),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo+1,0),i++,this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo+1,this.SelectInfo.StartItemOffset=n.Length,this.CurStyleNo=n.StyleNo):this.SelectInfo.StartItemNo>0&&this.Items[this.SelectInfo.StartItemNo-1].StyleNo>cs.Null&&!n.ParaFirst?(this.SelectInfo.StartItemNo=this.SelectInfo.StartItemNo-1,this.SelectInfo.StartItemOffset=this.Items[this.SelectInfo.StartItemNo].Length,this.CurStyleNo=this.Items[this.SelectInfo.StartItemNo].StyleNo,i=this.DoInsertTextEx(t,e,i)):""!=t||n.ParaFirst?((n=this.CreateDefaultTextItem()).Text=t,(e||""==t)&&(n.ParaFirst=!0),this.Items[this.SelectInfo.StartItemNo].ParaFirst&&(this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!1),this.Items[this.SelectInfo.StartItemNo].ParaFirst=!1,n.ParaFirst=!0),this.Items.insert(this.SelectInfo.StartItemNo,n),this.UndoAction_InsertItem(this.SelectInfo.StartItemNo,0),i++,this.SelectInfo.StartItemOffset=n.Length,this.CurStyleNo=n.StyleNo):(this.UndoAction_ItemParaFirst(this.SelectInfo.StartItemNo,0,!0),n.ParaFirst=!0):i=this.DoTextItemInsert(t,e,i).addCount,i}},{key:"InsertText",value:function(t){if(!this.CanEdit())return!1;if(!this.DeleteSelected())return!1;if(!this.DoAcceptAction(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,wp.InsertText))return!1;if(!this.DoInsertTextBefor(t))return!1;var e=!1;this.Undo_GroupBegin(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);try{var i;this.Undo_New();var n=-1,o=-1;if(this.Items[this.SelectInfo.StartItemNo].StyleNo<cs.Null&&this.SelectInfo.StartItemOffset==lp.OffsetInner){var r=this.Items[this.SelectInfo.StartItemNo];r.MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),e=r.InsertText(t),r.IsFormatDirty?(n=(i=this.GetFormatRange(n,o)).firstDrawItemNo,o=i.lastItemNo,this.FormatPrepare(n,o),this.ReFormatData(n,o)):this.FormatInit()}else{var s=!1,a=0;this.CurStyleNo=this.MatchTextStyleNoAt(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),n=(i=this.GetFormatRange(n,o)).firstDrawItemNo,o=i.lastItemNo,this.FormatPrepare(n,o);for(var l,h=lp.ReplaceUnPreChar(t).split(lp.sLineBreak),c=0;c<h.length-1;c++)l=h[c],(s||""!=l)&&(a=this.DoInsertTextEx(l,s,a)),s=!0;l=h[h.length-1],a=this.DoInsertTextEx(l,s,a),this.ReFormatData(n,o+a,a),e=!0}this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)}finally{this.Undo_GroupEnd(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)}return this.InitializeMouseField(),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoReScroll(),e}},{key:"InsertTable",value:function(t,e){if(!this.CanEdit())return!1;var i,n=this.GetTopLevelData(),o=new ic(n,t,e,n.Width);return i=this.InsertItem(o),this.InitializeMouseField(),i}},{key:"InsertImage",value:function(t){if(!this.CanEdit())return!1;var e,i=this.GetTopLevelData(),n=new $c(i);return n.Image=t,n.width=t.width,n.height=t.height,n.RestrainSize(i.Width,n.height),e=this.InsertItem(n),this.InitializeMouseField(),e}},{key:"InsertGifImage",value:function(t){if(!this.CanEdit())return!1;var e,i=this.GetTopLevelData(),n=new ju(i);return n.LoadFromFile(t),e=this.InsertItem(n),this.InitializeMouseField(),e}},{key:"InsertLine",value:function(t){if(!this.CanEdit())return!1;var e,i=new mu(this,this.Width,t);return e=this.InsertItem(i),this.InitializeMouseField(),e}},{key:"SetActiveImage",value:function(t){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(e){return e.Image.loadFromStream(t),!0}))}},{key:"ActiveTableResetRowCol",value:function(t,e){var i=this;return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(n){return n.ResetRowCol(i.Width,t,e)}))}},{key:"TableInsertRowAfter",value:function(t){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(e){return e.InsertRowAfter(t)}))}},{key:"TableInsertRowBefor",value:function(t){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(e){return e.InsertRowBefor(t)}))}},{key:"ActiveTableDeleteCurRow",value:function(){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(t){return t.DeleteCurRow()}))}},{key:"ActiveTableDeleteRowFrom",value:function(t,e){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(i){return i.DeleteRowFrom(t,e)}))}},{key:"ActiveTableSplitCurRow",value:function(){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(t){return t.SplitCurRow()}))}},{key:"ActiveTableSplitCurCol",value:function(){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(t){return t.SplitCurCol()}))}},{key:"TableInsertColAfter",value:function(t){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(e){return e.InsertColAfter(t)}))}},{key:"TableInsertColBefor",value:function(t){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(e){return e.InsertColBefor(t)}))}},{key:"ActiveTableDeleteCurCol",value:function(){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(t){return t.DeleteCurCol()}))}},{key:"MergeTableSelectCells",value:function(){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(t){return t.MergeSelectCells()}))}},{key:"TableApplyContentAlign",value:function(t){return!!this.CanEdit()&&this.RectItemAction(this.GetActiveItemNo(),(function(e){return e.ApplyContentAlign(t),!0}))}},{key:"ActiveItemReAdaptEnvironment",value:function(){if(this.CanEdit()){this.InitializeField();var t=this.GetActiveItem();if(null!=t){var e,i=-1,n=-1;if(t.StyleNo<cs.Null&&this.SelectInfo.StartItemOffset==lp.OffsetInner){this.Undo_New();var o=t;o.MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),o.ActiveItemReAdaptEnvironment(),o.IsFormatDirty?(i=(e=this.GetFormatRange(i,n)).firstDrawItemNo,n=e.lastItemNo,this.FormatPrepare(i,n),this.ReFormatData(i,n)):this.FormatInit()}else{var r=0;i=(e=this.GetFormatRange(i,n)).firstDrawItemNo,n=e.lastItemNo,this.FormatPrepare(i,n),this.Undo_New();var s=this.SelectInfo.StartItemNo;if(this.MergeItemToNext(s)&&(this.UndoAction_InsertText(s,this.Items[s].Length-this.Items[s+1].Length+1,this.Items[s+1].Text),this.UndoAction_DeleteItem(s+1,0),this.Items.delete(s+1),r--),s>0){var a=this.Items[s-1].Length;this.MergeItemToPrio(s)&&(this.UndoAction_InsertText(s-1,this.Items[s-1].Length-this.Items[s].Length+1,this.Items[s].Text),this.UndoAction_DeleteItem(s,0),this.Items.delete(s),r--,this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo-1,a+this.SelectInfo.StartItemOffset))}0!=r&&(this.ReFormatData(i,n+r,r),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret())}}}}},{key:"DisActive",value:function(){if(this.InitializeField(),this.Items.count>0){var t=this.GetActiveItem();null!=t&&(t.Active=!1)}}},{key:"GetHint",value:function(){return!this.FMouseMoveRestrain&&this.FMouseMoveItemNo>=0?this.Items[this.FMouseMoveItemNo].GetHint():""}},{key:"MouseMoveDrawItemNo",get:function(){return this.FMouseMoveDrawItemNo}},{key:"MouseDownItemNo",get:function(){return this.FMouseDownItemNo}},{key:"MouseDownItemOffset",get:function(){return this.FMouseDownItemOffset}},{key:"MouseMoveItemNo",get:function(){return this.FMouseMoveItemNo}},{key:"MouseMoveItemOffset",get:function(){return this.FMouseMoveItemOffset}},{key:"MouseMoveRestrain",get:function(){return this.FMouseMoveRestrain}},{key:"HotDrawItemNo",get:function(){return this.FMouseMoveDrawItemNo}},{key:"height",get:function(){return this.GetHeight()}},{key:"ReadOnly",get:function(){return this.FReadOnly},set:function(t){this.SetReadOnly(t)}},{key:"Selecting",get:function(){return this.FSelecting}}])&&dy(e.prototype,i),n&&dy(e,n),r}(Sc);function Iy(t){return(Iy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gy(t,e,i){return(gy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xy(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function wy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cy(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ky(t,e,i){return e&&Cy(t.prototype,e),i&&Cy(t,i),t}function Py(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Dy(t,e)}function Dy(t,e){return(Dy=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function by(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=xy(t);if(e){var o=xy(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ry(this,i)}}function Ry(t,e){return!e||"object"!==Iy(e)&&"function"!=typeof e?_y(t):e}function _y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xy(t){return(xy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ay=function(t){Py(i,t);var e=by(i);function i(){var t;return wy(this,i),(t=e.call(this)).ID,t.Title,t.Text,t}return ky(i,[{key:"LoadFromStream",value:function(t,e){t.readInt32(),t.readInt32(),t.readInt32(),t.readInt32(),this.ID=t.readInt32(),this.Title=lp.HCLoadTextFromStream(t,e),this.Text=lp.HCLoadTextFromStream(t,e)}}]),i}(th),Ty=function(t){Py(i,t);var e=by(i);function i(){return wy(this,i),e.call(this)}return i}(ql);function Oy(t){return(Oy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ny(t,e){return(Ny=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function By(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=My(t);if(e){var o=My(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ey(this,i)}}function Ey(t,e){return!e||"object"!==Oy(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function My(t){return(My=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ly(t){return(Ly="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gy(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Hy(t,e,i){return(Hy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=zy(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Uy(t,e){return(Uy=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vy(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=zy(t);if(e){var o=zy(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Wy(this,i)}}function Wy(t,e){return!e||"object"!==Ly(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function zy(t){return(zy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var jy=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Uy(t,e)}(r,t);var e,i,n,o=Vy(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).Script="",e.FDomainStartDeletes=new V,e.FCaretItemChanged=!1,e.FHotDomainRGN=new uh,e.FActiveDomainRGN=new uh,e.OnCreateItemByStyle=null,e.OnCanEdit=null,e.OnInsertTextBefor=null,e.OnDomainSwitch=null,e.OnCaretItemChanged=null,e.OnPaintDomainRegion=null,e.OnMatchTextStyleNoAt=null,e}return e=r,(i=[{key:"createBefor",value:function(){Hy(zy(r.prototype),"createBefor",this).call(this),this.FHotDomain=new ql,this.FHotDomain.Data=this,this.FActiveDomain=new ql,this.FActiveDomain.Data=this,this.FDomainCount=0}},{key:"DoAcceptAction",value:function(t,e,i){if(this.Style.States.Contain(Ip.Loading)||this.Style.States.Contain(Ip.Undoing)||this.Style.States.Contain(Ip.Redoing))return!0;var n=!0;if(i==wp.DeleteItem&&this.Items[t].StyleNo==cs.Domain)if(this.Items[t].MarkType==Pp.End){var o=this.GetDomainAnother(t);(n=o==this.SelectInfo.StartItemNo?this.SelectInfo.StartItemOffset==lp.OffsetBefor:o>=this.SelectInfo.StartItemNo&&o<=this.SelectInfo.EndItemNo)&&this.FDomainStartDeletes.add(o)}else n=this.FDomainStartDeletes.indexOf(t)>=0;return n&&(n=Hy(zy(r.prototype),"DoAcceptAction",this).call(this,t,e,i)),n}},{key:"DoSaveItem",value:function(t){var e=Hy(zy(r.prototype),"DoSaveItem",this).call(this,t);if(e&&this.Style.States.Contain(Ip.Copying)&&this.Items[t].StyleNo==cs.Domain){var i=this.GetDomainAnother(t);e=i>=this.SelectInfo.StartItemNo&&i<=this.SelectInfo.EndItemNo}return e}},{key:"CheckInsertItemCount",value:function(t,e){var i=Hy(zy(r.prototype),"CheckInsertItemCount",this).call(this,t,e);if(this.Loading)return i;var n=-1,o=new ql;this.GetDomainFrom(t,0,o),o.BeginNo>=0&&(n=this.Items[o.BeginNo].Level);for(var s=t;s<=e;s++)this.Items[s].isClass(za)&&(this.Items[s].MarkType==Pp.Beg&&n++,this.Items[s].Level=n,this.Items[s].MarkType==Pp.End&&n--);return this.Style.States.Contain(Ip.DomainWholeReplace)&&(!this.Items[t].ParaFirst&&t>0&&this.Items[t-1].isClass(za)&&this.Items[t-1].ParaFirst&&(this.Items[t-1].ParaNo=this.Items[t].ParaNo),this.IsParaLastItem(e+1)&&this.Items[e+1].isClass(za)&&(this.Items[e+1].ParaNo=this.Items[e].ParaNo)),i}},{key:"ReSetSelectAndCaretByOffset",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Hy(zy(r.prototype),"ReSetSelectAndCaretByOffset",this).call(this,t,e,i),this.Style.States.Contain(Ip.BatchInsert)||(this.FDomainCount>0?this.GetDomainFrom(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,this.FActiveDomain):this.FActiveDomain.Clear())}},{key:"DoCaretItemChanged",value:function(){this.FCaretItemChanged=!0}},{key:"DoInsertItem",value:function(t){za.IsBeginMark(t)&&this.FDomainCount++,this.FHotDomain.Clear(),Hy(zy(r.prototype),"DoInsertItem",this).call(this,t)}},{key:"DoRemoveItem",value:function(t){za.IsBeginMark(t)&&this.FDomainCount--,this.FHotDomain.Clear(),Hy(zy(r.prototype),"DoRemoveItem",this).call(this,t)}},{key:"DoDrawItemPaintBefor",value:function(t,e,i,n,o,s,a,l,h,c,u,f){if(Hy(zy(r.prototype),"DoDrawItemPaintBefor",this).call(this,t,e,i,n,o,s,a,l,h,c,u,f),!f.Print){var d=!1,m=!1;this.Style.DrawHotDomainRegion&&this.FHotDomain.BeginNo>=0&&(d=this.FHotDomain.Contain(e)),this.Style.DrawActiveDomainRegion&&this.FActiveDomain.BeginNo>=0&&(m=this.FActiveDomain.Contain(e)),(d||m)&&(d&&this.FHotDomainRGN.combineRect(n),m&&this.FActiveDomainRGN.combineRect(n))}}},{key:"SelectOffsetAfter_",value:function(t,e){var i=this.Items[t].IsSelectComplate;return!i&&this.Items[t].StyleNo>cs.Null&&this.SelectInfo.EndItemNo>=0&&(t==this.SelectInfo.EndItemNo?this.SelectInfo.EndItemOffset==this.DrawItems[e].CharOffsetEnd()&&(i=!0):t==this.SelectInfo.StartItemNo&&(i=!0)),i}},{key:"DrawLineLastMrak",value:function(t,e,i,n,o,r){this.SelectOffsetAfter_(n,o)&&(t.brush.color=this.Style.SelColor,t.fillRect(U.Create(e.right,e.top,e.right+10,e.bottom))),t.pen.width=1,t.pen.style=pt.Solid,t.pen.color=lp.clActiveBorder,t.beginPath();try{t.moveTo(i.right+4,i.bottom-8),t.lineTo(i.right+6,i.bottom-8),t.moveTo(i.right+6,i.bottom-8),t.lineTo(i.right+6,i.bottom-3),t.moveTo(i.right,i.bottom-3),t.lineTo(i.right+6,i.bottom-3),t.moveTo(i.right+1,i.bottom-4),t.lineTo(i.right+1,i.bottom-1),t.moveTo(i.right+2,i.bottom-5),t.lineTo(i.right+2,i.bottom)}finally{t.paintPath()}}},{key:"DoDrawItemPaintAfter",value:function(t,e,i,n,o,s,a,l,h,c,u,f){Hy(zy(r.prototype),"DoDrawItemPaintAfter",this).call(this,t,e,i,n,o,s,a,l,h,c,u,f),f.Print||t.Style.ShowParaLastMark&&(i<this.DrawItems.count-1&&this.DrawItems[i+1].ParaFirst||i==this.DrawItems.count-1)&&this.DrawLineLastMrak(u,n,o,e,i,f)}},{key:"doAskIsWantDomain",value:function(t,e){return!t||t(this.Items[e])}},{key:"DoPaintDomainRegion",value:function(t){return!(t<0)&&(null==this.OnPaintDomainRegion||this.OnPaintDomainRegion(this,t))}},{key:"MatchTextStyleNoAt",value:function(t,e){if(null!==this.OnMatchTextStyleNoAt){var i=this.OnMatchTextStyleNoAt(this,t,e);if(i!==cs.Null)return i}return Hy(zy(r.prototype),"MatchTextStyleNoAt",this).call(this,t,e)}},{key:"CreateItemByStyle",value:function(t){var e=null;return null!=this.OnCreateItemByStyle&&(e=this.OnCreateItemByStyle(this,t)),null==e&&(e=Hy(zy(r.prototype),"CreateItemByStyle",this).call(this,t)),e}},{key:"PaintDataRange",value:function(t,e,i,n,o,s,a,l,h,c,u){if(u.Print||(this.Style.DrawHotDomainRegion&&this.FHotDomainRGN.clear(),this.Style.DrawActiveDomainRegion&&this.FActiveDomainRGN.clear()),Hy(zy(r.prototype),"PaintDataRange",this).call(this,t,e,i,n,o,s,a,l,h,c,u),!u.Print){var f=c.pen.color;try{this.Style.DrawHotDomainRegion&&this.DoPaintDomainRegion(this.FHotDomain.BeginNo)&&(c.pen.color=lp.clActiveBorder,c.pen.style=pt.Solid,this.FHotDomainRGN.frameRgn(c)),this.Style.DrawActiveDomainRegion&&this.DoPaintDomainRegion(this.FActiveDomain.BeginNo)&&(c.pen.color=at.Blue,c.pen.style=pt.Solid,this.FActiveDomainRGN.frameRgn(c))}finally{c.pen.color=f}}}},{key:"InitializeField",value:function(){Hy(zy(r.prototype),"InitializeField",this).call(this),null!=this.FActiveDomain&&this.FActiveDomain.Clear(),null!=this.FHotDomain&&this.FHotDomain.Clear()}},{key:"GetCaretInfo",value:function(t,e,i){Hy(zy(r.prototype),"GetCaretInfo",this).call(this,t,e,i);var n=!1,o=this.ActiveDomainBeginItem();this.SelectInfo.StartItemNo>=0?this.GetTopLevelData()==this&&(this.Style.DrawActiveDomainRegion&&this.FActiveDomain.BeginNo>=0&&(n=!0),this.FDomainCount>0?this.GetDomainFrom(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,this.FActiveDomain):this.FActiveDomain.Clear(),this.Style.DrawActiveDomainRegion&&this.FActiveDomain.BeginNo>=0&&(n=!0)):this.Style.DrawActiveDomainRegion&&this.FActiveDomain.BeginNo>=0&&(this.FActiveDomain.Clear(),n=!0),n&&this.Style.UpdateInfoRePaint(),this.FCaretItemChanged&&(this.FCaretItemChanged=!1,null!=this.OnCaretItemChanged&&this.OnCaretItemChanged(this,this.Items[this.SelectInfo.StartItemNo])),o!=this.ActiveDomainBeginItem()&&this.FActiveDomain.BeginNo>=0&&null!=this.OnDomainSwitch&&this.OnDomainSwitch(this,this.FActiveDomain.BeginNo)}},{key:"DeleteSelected",value:function(){return this.FDomainStartDeletes.clear(),Hy(zy(r.prototype),"DeleteSelected",this).call(this)}},{key:"DeleteActiveDomain",value:function(){if(this.SelectExists())return!1;var t=!1;if(this.FActiveDomain.BeginNo>=0)t=this.DeleteDomain(this.FActiveDomain);else if(this.Items[this.SelectInfo.StartItemNo].StyleNo<cs.Null&&(t=this.Items[this.SelectInfo.StartItemNo].DeleteActiveDomain())){var e=-1,i=-1,n=this.GetFormatRange(e,i);e=n.firstDrawItemNo,i=n.lastItemNo,this.FormatPrepare(e,i),this.ReFormatData(e,i),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()}return t}},{key:"DeleteDomain",value:function(t){return this.DeleteDomainByItemNo(t.BeginNo,t.EndNo)}},{key:"DeleteDomainByItemNo",value:function(t,e){if(t<0)return!1;this.Undo_New();var i=this.GetFormatFirstDrawItem(this.Items[t].FirstDItemNo),n=this.GetParaLastItemNo(e);this.Items[t].ParaFirst&&(e==n?t>0&&(i=this.GetFormatFirstDrawItem(this.Items[t].FirstDItemNo-1)):(this.UndoAction_ItemParaFirst(e+1,0,!0),this.Items[e+1].ParaFirst=!0)),this.FormatPrepare(i,n);for(var o=0,r=this.Items[t].PageBreak,s=e;s>=t;s--)this.UndoAction_DeleteItem(s,0),this.Items.delete(s),o++;if(this.FActiveDomain.Clear(),0==t){var a=this.CreateDefaultTextItem();a.ParaFirst=!0,a.PageBreak=r,this.Items.insert(t,a),this.UndoAction_InsertItem(t,0),o--}return this.ReFormatData(i,n-o,-o),this.InitializeField(),t>this.Items.count-1?this.ReSetSelectAndCaret(t-1):this.ReSetSelectAndCaretByOffset(t,0),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),!0}},{key:"MouseMove",value:function(t){var e=this.Style.DrawHotDomainRegion&&this.FHotDomain.BeginNo>=0;Hy(zy(r.prototype),"MouseMove",this).call(this,t),this.FDomainCount>0?this.GetDomainFrom(this.MouseMoveItemNo,this.MouseMoveItemOffset,this.FHotDomain):this.FHotDomain.Clear();var i=this.GetTopLevelDataAt(t.x,t.y);(i==this||i.HotDomain.BeginNo<0)&&this.Style.DrawHotDomainRegion&&this.FHotDomain.BeginNo>=0&&(e=!0),e&&this.Style.UpdateInfoRePaint()}},{key:"InsertItem",value:function(t){var e=Hy(zy(r.prototype),"InsertItem",this).call(this,t);return e&&(this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoReScroll()),e}},{key:"InsertItemEx",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Hy(zy(r.prototype),"InsertItemEx",this).call(this,t,e,i);return n&&(this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.Style.UpdateInfoReScroll()),n}},{key:"CanEdit",value:function(){var t=Hy(zy(r.prototype),"CanEdit",this).call(this);return t&&null!=this.OnCanEdit&&(t=this.OnCanEdit(this)),t}},{key:"DoInsertTextBefor",value:function(t,e,i){var n=Hy(zy(r.prototype),"DoInsertTextBefor",this).call(this,t,e,i);return n&&null!=this.OnInsertTextBefor&&(n=this.OnInsertTextBefor(this,t,e,i)),n}},{key:"DoLoadFromStream",value:function(t,e,i){Hy(zy(r.prototype),"DoLoadFromStream",this).call(this,t,e,i),i>42&&(this.Script=lp.HCLoadTextFromStream(t,i))}},{key:"SaveToStream",value:function(t){Hy(zy(r.prototype),"SaveToStream",this).call(this,t),lp.HCSaveTextToStream(t,this.Script)}},{key:"InsertDomain",value:function(t){if(!this.CanEdit())return!1;var e=!1,i=null;this.Undo_GroupBegin(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset);try{this.Style.States.Include(Ip.BatchInsert);try{i=this.CreateDefaultDomainItem(),null!=t&&i.Assign(t),i.MarkType=Pp.Beg,this.FActiveDomain.BeginNo>=0&&(i.Level=this.Items[this.FActiveDomain.BeginNo].Level+1),(e=this.InsertItem(i))&&(i=this.CreateDefaultDomainItem(),null!=t&&i.Assign(t),i.MarkType=Pp.End,this.FActiveDomain.BeginNo>=0&&(i.Level=this.Items[this.FActiveDomain.BeginNo].Level+1),e=this.InsertItem(i))}finally{this.Style.States.Exclude(Ip.BatchInsert)}}finally{this.Undo_GroupEnd(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset)}return this.ReSetSelectAndCaret(this.SelectInfo.StartItemNo),e}},{key:"GetItemDomain",value:function(t){var e=new ql;return this.GetDomainFrom(t,0,e,null),{beginNo:e.BeginNo,endNo:e.EndNo}}},{key:"GetDomainFrom",value:function(t,e,i,n){if(i.Clear(),!(t<0||e<0)){var o=0,r=0,s=t,a=t;if(this.Items[t].isClass(za)&&this.doAskIsWantDomain(n,t))if(this.Items[t].MarkType==Pp.Beg)if(e==lp.OffsetAfter)i.Data=this,i.BeginNo=t,r=this.Items[t].Level,a=t+1;else{if(!(t>0))return;s=t-1}else if(e==lp.OffsetAfter){if(!(t<this.Items.count-1))return;a=t+1}else i.EndNo=t,s=t-1;if(i.BeginNo<0)if(o=0,s<this.Items.count/2){for(var l=s;l>=0;l--)if(this.Items[l].isClass(za)&&this.doAskIsWantDomain(n,l))if(this.Items[l].MarkType==Pp.Beg){if(0==o){i.Data=this,i.BeginNo=l,r=this.Items[l].Level;break}o--}else o++;if(i.BeginNo>=0&&i.EndNo<0){for(var h=a;h<=this.Items.count-1;h++)if(this.Items[h].isClass(za)&&this.doAskIsWantDomain(n,h)&&this.Items[h].MarkType==Pp.End&&this.Items[h].Level==r){i.EndNo=h;break}if(i.EndNo<0)throw"异常:获取数据组结束出错!"}}else{for(var c=a;c<=this.Items.count-1;c++)if(this.Items[c].isClass(za)&&this.doAskIsWantDomain(n,c))if(this.Items[c].MarkType==Pp.End){if(!(o>0)){i.EndNo=c,r=this.Items[c].Level;break}o--}else o++;if(i.EndNo>=0&&i.BeginNo<0){for(var u=s;u>=0;u--)if(this.Items[u].isClass(za)&&this.doAskIsWantDomain(n,u)&&this.Items[u].MarkType==Pp.Beg&&this.Items[u].Level==r){i.Data=this,i.BeginNo=u;break}if(i.BeginNo<0)throw"异常:获取域起始位置出错!"}}else if(i.EndNo<0){for(var f=a;f<=this.Items.count-1;f++)if(this.Items[f].isClass(za)&&this.doAskIsWantDomain(n,f)&&this.Items[f].MarkType==Pp.End&&this.Items[f].Level==r){i.EndNo=f;break}if(i.EndNo<0)throw"异常:获取域起始位置出错!"}}}},{key:"SetSelectBound",value:function(t,e,i,n){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=-1,s=-1,a=-1,l=-1;i<0?(r=t,a=e,s=-1,l=-1):i>=t?(r=t,s=i,i==t?n>=e?(a=e,l=n):(a=n,l=e):(a=e,l=n)):(r=i,s=t,l=a=n);var h=this.AdjustSelectRange(r,a,s,l);r=h.startItemNo,a=h.startItemOffset,s=h.endItemNo,l=h.endItemOffset,this.MatchItemSelectState(),o?(this.FCurStyleNo=this.Items[this.SelectInfo.StartItemNo].StyleNo,this.FCurParaNo=this.Items[this.SelectInfo.StartItemNo].ParaNo):(this.ReSetSelectAndCaretByOffset(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,!0),this.Style.UpdateInfoRePaint())}},{key:"SelectItemAfterWithCaret",value:function(t){this.ReSetSelectAndCaret(t)}},{key:"SelectLastItemAfterWithCaret",value:function(){this.SelectItemAfterWithCaret(this.Items.count-1)}},{key:"SelectFirstItemBeforWithCaret",value:function(){this.ReSetSelectAndCaretByOffset(0,0)}},{key:"GetDomainAnother",value:function(t){var e=-1,i=this.Items[t];if(i.MarkType==Pp.End){for(var n=t-1;n>=0;n--)if(this.Items[n].StyleNo==cs.Domain&&this.Items[n].MarkType==Pp.Beg&&this.Items[n].Level==i.Level){e=n;break}}else for(var o=t+1;o<=this.Items.count-1;o++)if(this.Items[o].StyleNo==cs.Domain&&this.Items[o].MarkType==Pp.End&&this.Items[o].Level==i.Level){e=o;break}return e}},{key:"ReversePos",value:function(t,e){var i=e.lastIndexOf(t);return i<0?0:i+1}},{key:"DoSearchByOffset",value:function(t,e,i,n,o,r){if(!this.Items[o].Visible)return!1;var s,a,l,h=-1,c=-1,u=!1;if(this.Items[o].StyleNo<cs.Null)(u=this.Items[o].Search(t,i,n))&&(this.SelectInfo.StartItemNo=o,this.SelectInfo.StartItemOffset=lp.OffsetInner,this.SelectInfo.EndItemNo=-1,this.SelectInfo.EndItemOffset=-1);else if(i?(s=this.Items[o].SubString(1,r),n||(s=s.toUpperCase()),h=this.ReversePos(e,s)):(s=this.Items[o].SubString(r+1,this.Items[o].Length-r),n||(s=s.toUpperCase()),h=s.indexOf(e)+1),h>0)this.SelectInfo.StartItemNo=o,this.SelectInfo.StartItemOffset=i?h-1:r+h-1,this.SelectInfo.EndItemNo=o,this.SelectInfo.EndItemOffset=this.SelectInfo.StartItemOffset+e.length,u=!0;else if(""!=s&&e.length>1)if(i)for(c=o,a=s,l="";c>0&&!this.Items[c].ParaFirst&&this.Items[c-1].StyleNo>cs.Null;)if(this.Items[c-1].Visible){if(s.length>e.length-1&&(s=this.Items[c-1].TextEffective().substr(e.length-1,this.Items[c-1].Text.length-e.length+1)),l+=s,a=s+a,n||(a=a.toUpperCase()),(h=a.indexOf(e)+1)>0){for(this.SelectInfo.StartItemNo=c-1,this.SelectInfo.StartItemOffset=this.Items[c-1].Length-(s.length-h)-1,this.SelectInfo.EndItemNo=o,this.SelectInfo.EndItemOffset=h+e.length-1-s.length;c<o;)this.Items[c].Visible&&(this.SelectInfo.EndItemOffset=this.SelectInfo.EndItemOffset-this.Items[c].TextEffective().length),c++;u=!0;break}if(l.length>=e.length-1)break;c--}else c--;else for(c=o,a=s,l="";c<this.Items.count-1&&!this.Items[c+1].ParaFirst&&this.Items[c+1].StyleNo>cs.Null;)if(this.Items[c+1].Visible){if(s.length>e.length-1&&(s=this.Items[c+1].TextEffective().substr(0,e.length-1)),l+=s,a+=s,n||(a=a.toUpperCase()),(h=a.indexOf(e)+1)>0){for(this.SelectInfo.StartItemNo=o,this.SelectInfo.StartItemOffset=r+h-1,this.SelectInfo.EndItemNo=c+1,this.SelectInfo.EndItemOffset=h+e.length-1-(this.Items[o].Length-r);c>=o+1;)this.Items[c].Visible||(this.SelectInfo.EndItemOffset=this.SelectInfo.EndItemOffset-this.Items[c].TextEffective().length),c--;u=!0;break}if(l.length>=e.length-1)break;c++}else c++;return u}},{key:"Search",value:function(t,e,i){var n=!1,o="";o=i?t:t.toUpperCase();var r=-1,s=-1;if(this.SelectInfo.StartItemNo<0?(r=0,s=0):this.SelectInfo.EndItemNo>=0?(e?(r=this.SelectInfo.StartItemNo,s=this.SelectInfo.StartItemOffset):(r=this.SelectInfo.EndItemNo,s=this.SelectInfo.EndItemOffset),this.DisSelect()):(r=this.SelectInfo.StartItemNo,s=this.SelectInfo.StartItemOffset),!(n=this.DoSearchByOffset(t,o,e,i,r,s)))if(e){for(var a=r-1;a>=0;a--)if(this.DoSearchByOffset(t,o,e,i,a,this.GetItemOffsetAfter(a))){n=!0;break}}else for(var l=r+1;l<=this.Items.count-1;l++)if(this.DoSearchByOffset(t,o,e,i,l,0)){n=!0;break}return n?(r=this.SelectInfo.StartItemNo,s=this.SelectInfo.StartItemOffset,this.SelectInfo.EndItemNo>=0?this.ReSetSelectAndCaretByOffset(this.SelectInfo.EndItemNo,this.SelectInfo.EndItemOffset,!e):this.ReSetSelectAndCaretByOffset(r,s,!e),this.SelectInfo.StartItemNo=r,this.SelectInfo.StartItemOffset=s,this.MatchItemSelectState()):this.SelectInfo.EndItemNo>=0?(e?(r=this.SelectInfo.StartItemNo,s=this.SelectInfo.StartItemOffset):(r=this.SelectInfo.EndItemNo,s=this.SelectInfo.EndItemOffset),this.DisSelect(),this.SelectInfo.StartItemNo=r,this.SelectInfo.StartItemOffset=s):this.SelectInfo.StartItemNo<0&&(this.SelectInfo.StartItemNo=r,this.SelectInfo.StartItemOffset=s),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),n}},{key:"Replace",value:function(t){return this.InsertText(t)}},{key:"ActiveDomainBeginItem",value:function(){return this.FActiveDomain.BeginNo>=0?this.Items[this.FActiveDomain.BeginNo]:null}},{key:"GetCaretInfoCur",value:function(t){this.Style.UpdateInfo.DragingSelected?this.GetCaretInfo(this.MouseMoveItemNo,this.MouseMoveItemOffset,t):this.GetCaretInfo(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,t)}},{key:"TraverseItemExecute",value:function(t,e){var i;this.Items[t].StyleNo==cs.Domain&&(za.IsBeginMark(this.Items[t])?((i=(i=e.DomainStack.peek()).AppendChild()).Data=this,i.BeginNo=t,e.DomainStack.push(i)):(i=e.DomainStack.pop()).EndNo=t),e.ReverseOrder&&this.Items[t].StyleNo<cs.Null&&this.Items[t].TraverseItem(e),e.Stop=e.Process(this,t,e.Tag,e.DomainStack,e.Stop),!e.ReverseOrder&&!e.Stop&&this.Items[t].StyleNo<cs.Null&&this.Items[t].TraverseItem(e)}},{key:"TraverseItem",value:function(t){if(null!=t)if(t.ReverseOrder)for(var e=this.Items.count-1;e>=0&&!t.Stop;e--)this.TraverseItemExecute(e,t);else for(var i=0;i<this.Items.count&&!t.Stop;i++)this.TraverseItemExecute(i,t)}},{key:"ExecuteScript",value:function(t){return!1}},{key:"HotDomain",get:function(){return this.FHotDomain}},{key:"ActiveDomain",get:function(){return this.FActiveDomain}},{key:"DomainCount",get:function(){return this.FDomainCount}}])&&Gy(e.prototype,i),n&&Gy(e,n),r}(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ny(t,e)}(i,t);var e=By(i);function i(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e.call(this,t)}return i}(function(t){Py(i,t);var e=by(i);function i(t){var n;return wy(this,i),(n=e.call(this,t)).FNextID=0,n.FAnnotateCount=0,n.FIDStrack=new W,n.FHotAnnotate=new Ty,n.FHotAnnotate.Data=_y(n),n.FActiveAnnotate=new Ty,n.FActiveAnnotate.Data=_y(n),n.OnDrawItemAnnotate=null,n.OnInsertAnnotate=null,n.OnRemoveAnnotate=null,n}return ky(i,[{key:"GetActiveAnnotateItem",value:function(){return this.FActiveAnnotate.EndNo>0?this.Items[this.FActiveAnnotate.EndNo]:null}},{key:"DoLoadFromStream",value:function(t,e,n){if(gy(xy(i.prototype),"DoLoadFromStream",this).call(this,t,e,n),n>22&&n<55){var o=t.readUInt16();if(o>0)for(var r=0;r<o;r++)(new Ay).LoadFromStream(aStream,aFileVersion)}this.FNextID=n>54?t.readUInt32():0}},{key:"DoInsertItem",value:function(t){t.StyleNo===cs.Annotate&&t.MarkType===Pp.Beg&&(this.FAnnotateCount++,null!=this.OnInsertAnnotate&&this.OnInsertAnnotate(this,t)),gy(xy(i.prototype),"DoInsertItem",this).call(this,t)}},{key:"DoRemoveItem",value:function(t){t.StyleNo===cs.Annotate&&t.MarkType===Pp.Beg&&(this.FAnnotateCount--,null!=this.OnRemoveAnnotate&&this.OnRemoveAnnotate(this,t)),gy(xy(i.prototype),"DoRemoveItem",this).call(this,t)}},{key:"DoAcceptAction",value:function(t,e,n){if(this.Style.States.Contain(Ip.Loading)||this.Style.States.Contain(Ip.Undoing)||this.Style.States.Contain(Ip.Redoing))return!0;var o=!0;return n===wp.DeleteItem&&this.Items[t].StyleNo===cs.Annotate&&(o=!1),o&&(o=gy(xy(i.prototype),"DoAcceptAction",this).call(this,t,e,n)),o}},{key:"DoDrawItemPaintContent",value:function(t,e,n,o,r,s,a,l,h,c,u,f,d){d.Print||null==this.OnDrawItemAnnotate||t.Items[e].StyleNo===cs.Annotate&&t.Items[e].MarkType===Pp.End&&this.OnDrawItemAnnotate(t,n,o,t.Items[e]),gy(xy(i.prototype),"DoDrawItemPaintContent",this).call(this,t,e,n,o,r,s,a,l,h,c,u,f,d)}},{key:"GetCaretInfo",value:function(t,e,n){this.FAnnotateCount>0&&this.SelectInfo.StartItemNo>=0&&(this.GetTopLevelData()==this&&this.GetAnnotateFrom(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset,this.FActiveAnnotate));gy(xy(i.prototype),"GetCaretInfo",this).call(this,t,e,n)}},{key:"MouseMove",value:function(t){gy(xy(i.prototype),"MouseMove",this).call(this,t),this.FAnnotateCount>0?this.GetAnnotateFrom(this.MouseMoveItemNo,this.MouseMoveItemOffset,this.FHotAnnotate):this.FHotAnnotate.Clear();var e=this.GetTopLevelDataAt(t.x,t.y);(e==this||e.HotAnnotate.BeginNo<0)&&this.FHotAnnotate.BeginNo>=0&&this.Style.UpdateInfoRePaint()}},{key:"InitializeField",value:function(){gy(xy(i.prototype),"InitializeField",this).call(this),null!=this.FHotAnnotate&&this.FHotAnnotate.Clear(),null!=this.FActiveAnnotate&&this.FActiveAnnotate.Clear()}},{key:"SaveToStream",value:function(t){gy(xy(i.prototype),"SaveToStream",this).call(this,t),t.writeInt32(this.FNextID)}},{key:"GetAnnotateBeginBefor",value:function(t,e){for(var i=t;i>=0;i--)if(this.Items[i].StyleNo===cs.Annotate&&this.Items[i].MarkType===Pp.Beg&&this.Items[i].ID===e)return i;return-1}},{key:"GetAnnotateEndAfter",value:function(t,e){for(var i=t;i<this.Items.count;i++)if(this.Items[i].StyleNo===cs.Annotate&&this.Items[i].MarkType===Pp.End&&this.Items[i].ID===e)return i;return-1}},{key:"GetAnnotateFrom",value:function(t,e,i){if(i.Clear(),!(t<0||e<0)){var n=null,o=0;if(this.Items[t].StyleNo===cs.Annotate)if((n=this.Items[t]).MarkType===Pp.Beg){if(e===lp.OffsetAfter)return i.Data=this,i.BeginNo=t,o=n.ID,void(i.EndNo=this.GetAnnotateEndAfter(t+1,o))}else if(e===lp.OffsetBefor)return i.Data=this,i.EndNo=t,o=n.ID,void(i.BeginNo=this.GetAnnotateBeginBefor(t-1,o));this.FIDStrack.clear();for(var r=t;r>=0;r--)if(this.Items[r].StyleNo===cs.Annotate)if((n=this.Items[r]).MarkType===Pp.End)this.FIDStrack.push(n.ID);else{if(!(this.FIDStrack.count>0)){i.Data=this,i.BeginNo=r,o=n.ID;break}if(o=this.FIDStrack.peek(),n.ID!==o){i.Data=this,i.BeginNo=r,o=n.ID;break}this.FIDStrack.pop()}i.BeginNo>=0&&(i.EndNo=this.GetAnnotateEndAfter(t+1,o))}}},{key:"InsertAnnotateByOffset",value:function(t,e,i){var n=0;if(i===lp.OffsetBefor)t.ParaFirst=this.Items[e].ParaFirst,t.PageBreak=this.Items[e].PageBreak,this.Items[e].StyleNo>cs.Null&&""===this.Items[e].Text?(this.UndoAction_DeleteItem(e,0),this.Items.delete(e),n--):(this.Items[e].ParaFirst&&(this.UndoAction_ItemParaFirst(e,0,!1),this.Items[e].ParaFirst=!1),this.Items[e].PageBreak&&(this.UndoAction_ItemPageBreak(e,0,!1),this.Items[e].PageBreak=!1)),this.Items.insert(e,t),this.UndoAction_InsertItem(e,lp.OffsetBefor),n++;else if(i===this.GetItemOffsetAfter(e))this.Items.insert(e+1,t),this.UndoAction_InsertItem(e+1,lp.OffsetBefor),n++;else if(this.IsRectItem(e))this.Items.insert(e+1,t),this.UndoAction_InsertItem(e+1,lp.OffsetBefor),n++;else{var o=this.Items[e].SubString(i+1,this.Items[e].Length-i);this.UndoAction_DeleteText(e,i+1,o);var r=this.Items[e].BreakByOffset(i);this.Style.States.Include(Ip.InsertBreakItem);try{this.Items.insert(e+1,r)}finally{this.Style.States.Exclude(Ip.InsertBreakItem)}this.UndoAction_InsertItem(e+1,0),n++,this.Items.insert(e+1,t),this.UndoAction_InsertItem(e+1,lp.OffsetBefor),n++}return n}},{key:"InsertAnnotate",value:function(t,e){var i=!1;if(this.Items[this.SelectInfo.StartItemNo].StyleNo<cs.Null&&this.SelectInfo.StartItemOffset===lp.OffsetInner){this.Undo_New();var n=this.Items[this.SelectInfo.StartItemNo];n.MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),i=this.Items[this.SelectInfo.StartItemNo].InsertAnnotate(t,e);if(n.IsFormatDirty){this.GetFormatRange(-1,-1);this.FormatPrepare(vInfo.firstDrawItemNo,vInfo.lastItemNo),this.ReFormatData(vInfo.firstDrawItemNo,vInfo.lastItemNo)}else this.FormatInit();return i}if(!this.CanEdit())return!1;this.Style.States.Include(Ip.BatchInsert);try{var o=0,r=-1,s=-1;if(this.Undo_New(),this.SelectExists())r=this.GetFormatFirstDrawItem(this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),s=this.GetParaLastItemNo(this.SelectInfo.EndItemNo);else{var a=this.GetFormatRangeByOffset(this.SelectInfo.StartItemNo,1,r,s);r=a.firstDrawItemNo,s=a.lastItemNo}this.FormatPrepare(r,s),this.FNextID++;var l=new uy(this);l.MarkType=Pp.End,l.ID=this.FNextID,l.Content.Title=t,l.Content.Text=e,o=this.SelectInfo.EndItemNo>=0?this.InsertAnnotateByOffset(l,this.SelectInfo.EndItemNo,this.SelectInfo.EndItemOffset):this.InsertAnnotateByOffset(l,this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),(l=new uy(this)).MarkType=Pp.Beg,l.ID=this.FNextID,o+=this.InsertAnnotateByOffset(l,this.SelectInfo.StartItemNo,this.SelectInfo.StartItemOffset),this.ReFormatData(r,s+o,o)}finally{this.Style.States.Exclude(Ip.BatchInsert)}return this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),this.ReSetSelectAndCaret(this.SelectInfo.StartItemNo),!0}},{key:"DeleteAnnotate",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!this.CanEdit())return!1;if(e<t)return!1;this.InitializeField();var n=-1,o=-1,r=-1,s=this.GetFormatRangeByOffset(t,0,n,r);n=s.firstDrawItemNo,r=s.lastItemNo,r=(s=!i&&e<this.Items.count-1&&this.Items[e+1].ParaFirst?this.GetFormatRange(e+1,this.GetItemOffsetAfter(e+1),o,r):this.GetFormatRange(e,this.GetItemOffsetAfter(e),o,r)).lastItemNo,this.Items[t].ParaFirst&&n>0&&(n--,n=this.GetFormatFirstDrawItem(n)),this.FormatPrepare(n,r);var a=this.Items[t].ParaFirst,l=2;if(this.Undo_New(),this.UndoAction_DeleteItem(e,0),this.Items.delete(e),this.UndoAction_DeleteItem(t,0),this.Items.delete(t),0===this.Items.count){var h=this.CreateDefaultTextItem();this.CurStyleNo=h.StyleNo,h.ParaFirst=!0,this.Items.add(h),l--,this.UndoAction_InsertItem(0,0)}else if(a)if(t<this.Items.count-1&&!this.Items[t].ParaFirst)this.UndoAction_ItemParaFirst(t,0,!0),this.Items[t].ParaFirst=!0;else if(i){var c=this.CreateDefaultTextItem();this.CurStyleNo=c.StyleNo,c.ParaFirst=!0,this.Items.insert(t,c),l--,this.UndoAction_InsertItem(t,0)}return this.ReFormatData(n,r-l,-l),this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret(),a&&i?this.ReSetSelectAndCaret(t,0):t>0?this.ReSetSelectAndCaret(t-1):this.ReSetSelectAndCaretByOffset(0,0),!0}},{key:"DeleteActiveAnnotate",value:function(){if(this.SelectExists())return!1;var t=!1;if(this.FActiveAnnotate.BeginNo>=0)t=this.DeleteAnnotate(this.FActiveAnnotate.BeginNo,this.FActiveAnnotate.EndNo);else if(this.Items[this.SelectInfo.StartItemNo].StyleNo<cs.Null&&this.SelectInfo.StartItemOffset===lp.OffsetInner){this.Undo_New();var e=this.Items[this.SelectInfo.StartItemNo];if(e.MangerUndo?this.UndoAction_ItemSelf(this.SelectInfo.StartItemNo,lp.OffsetInner):this.UndoAction_ItemMirror(this.SelectInfo.StartItemNo,lp.OffsetInner),t=this.Items[this.SelectInfo.StartItemNo].DeleteActiveAnnotate(),e.IsFormatDirty){var i=this.GetFormatRange(-1,-1);this.FormatPrepare(i.firstDrawItemNo,i.lastItemNo),this.ReFormatData(i.firstDrawItemNo,i.lastItemNo)}else this.FormatInit()}return t}},{key:"HotAnnotate",get:function(){return this.FHotAnnotate}},{key:"ActiveAnnotate",get:function(){return this.FActiveAnnotate}},{key:"ActiveAnnotateItem",get:function(){return this.GetActiveAnnotateItem()}}]),i}(Fy)));function Xy(t){return(Xy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ky(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Yy(t,e,i){return(Yy="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Qy(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Jy(t,e){return(Jy=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Zy(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Qy(t);if(e){var o=Qy(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return qy(this,i)}}function qy(t,e){return!e||"object"!==Xy(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Qy(t){return(Qy=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jy(t,e)}(r,t);var e,i,n,o=Zy(r);function r(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=o.call(this,t)).FActive=!1,e.FCellSelectedAll=!1,e.FCellHeight=20,e.FOnFormatDirty=null,e.OnSetFormatHeightChange=null,e.FOnGetRootData=null,e.FOnGetFormatTop=null,e}return e=r,(i=[{key:"PointInCellRect",value:function(t){return U.CreateByBounds(0,0,this.Width,this.FCellHeight).pointIn(t)}},{key:"GetHeight",value:function(){var t=Yy(Qy(r.prototype),"GetHeight",this).call(this);return this.DrawItems.count>0&&(t+=this.DrawItems[0].rect.top),t}},{key:"DoLoadFromStream",value:function(t,e,i){this.BeginFormat();try{Yy(Qy(r.prototype),"DoLoadFromStream",this).call(this,t,e,i)}finally{this.EndFormat(!1)}}},{key:"ReSetSelectAndCaretByOffset",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.FActive?Yy(Qy(r.prototype),"ReSetSelectAndCaretByOffset",this).call(this,t,e,i):(this.SelectInfo.Initialize(),this.SelectInfo.StartItemNo=t,this.SelectInfo.StartItemOffset=e)}},{key:"ReFormatData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Yy(Qy(r.prototype),"ReFormatData",this).call(this,t,e,i,n),this.FormatChange=!1,this.FormatHeightChange&&(this.SetFormatHeightChange(),this.DoFormatDirty())}},{key:"DoFormatDirty",value:function(){null!=this.FOnFormatDirty&&this.FOnFormatDirty()}},{key:"DoSetFormatHeightChange",value:function(){null!=this.OnSetFormatHeightChange&&this.OnSetFormatHeightChange()}},{key:"ReFormat",value:function(){this.Style.SkipFormat||Yy(Qy(r.prototype),"ReFormat",this).call(this)}},{key:"DisSelect",value:function(){var t=Yy(Qy(r.prototype),"DisSelect",this).call(this);return this.FCellSelectedAll=!1,t}},{key:"DeleteSelected",value:function(){var t=Yy(Qy(r.prototype),"DeleteSelected",this).call(this);return this.FCellSelectedAll=!1,t}},{key:"DeleteItemDirect",value:function(t){Yy(Qy(r.prototype),"DeleteItemDirect",this).call(this,t),this.DoFormatDirty()}},{key:"SetFormatHeightChange",value:function(){this.FormatChange=!1,this.DoSetFormatHeightChange()}},{key:"SetActive",value:function(t){this.FActive!=t&&(this.FActive=t),this.FActive||(this.DisSelect(),this.InitializeField(),this.Style.UpdateInfoRePaint())}},{key:"GetFormatTop",value:function(){return null!=this.FOnGetFormatTop?this.FOnGetFormatTop(this):0}},{key:"ApplySelectTextStyle",value:function(t){this.FCellSelectedAll&&(this.CurStyleNo=this.Items[0].StyleNo),Yy(Qy(r.prototype),"ApplySelectTextStyle",this).call(this,t)}},{key:"ApplySelectParaStyle",value:function(t){this.FCellSelectedAll&&(this.CurParaNo=this.Items[0].ParaNo),Yy(Qy(r.prototype),"ApplySelectParaStyle",this).call(this,t)}},{key:"GetDrawItemFormatTop",value:function(t){return Yy(Qy(r.prototype),"GetDrawItemFormatTop",this).call(this,t)+this.GetFormatTop()}},{key:"SelectAll",value:function(){Yy(Qy(r.prototype),"SelectAll",this).call(this),this.FCellSelectedAll=!0}},{key:"CoordInSelect",value:function(t,e,i,n,o){return this.FCellSelectedAll?this.PointInCellRect(G.Create(t,e)):Yy(Qy(r.prototype),"CoordInSelect",this).call(this,t,e,i,n,o)}},{key:"GetItemAt",value:function(t,e,i,n,o,s){var a=Yy(Qy(r.prototype),"GetItemAt",this).call(this,t,e,i,n,o,s);return this.FCellSelectedAll&&(a.restrain=!this.PointInCellRect(G.Create(t,e))),a}},{key:"GetRootData",value:function(){return null!=this.FOnGetRootData?this.FOnGetRootData():Yy(Qy(r.prototype),"GetRootData",this).call(this)}},{key:"SelectFirstItemOffsetBefor",value:function(){return!this.SelectExists()&&0==this.SelectInfo.StartItemNo&&0==this.SelectInfo.StartItemOffset}},{key:"SelectLastItemOffsetAfter",value:function(){return!this.SelectExists()&&this.SelectInfo.StartItemNo==this.Items.count-1&&this.SelectInfo.StartItemOffset==this.GetItemOffsetAfter(this.SelectInfo.StartItemNo)}},{key:"SelectFirstLine",value:function(){return 0==this.GetParaFirstItemNo(this.SelectInfo.StartItemNo)}},{key:"SelectLastLine",value:function(){return this.GetParaLastItemNo(this.SelectInfo.StartItemNo)==this.Items.count-1}},{key:"ClearFormatExtraHeight",value:function(){for(var t=0,e=0,i=1,n=this.DrawItems.count;i<n;i++)if(this.DrawItems[i].LineFirst&&this.DrawItems[i].rect.top!=this.DrawItems[i-1].rect.bottom&&(e=this.DrawItems[i].rect.top-this.DrawItems[i-1].rect.bottom)>t&&(t=e),this.DrawItems[i].rect.offset(0,-e),this.Items[this.DrawItems[i].ItemNo].StyleNo<cs.Null){var o=this.Items[this.DrawItems[i].ItemNo].ClearFormatExtraHeight();this.DrawItems[i].rect.bottom=this.DrawItems[i].rect.bottom-o}return t}},{key:"CellSelectedAll",get:function(){return this.FCellSelectedAll},set:function(t){this.FCellSelectedAll=t}},{key:"CellHeight",get:function(){return this.FCellHeight},set:function(t){this.FCellHeight=t}},{key:"Active",get:function(){return this.FActive},set:function(t){this.SetActive(t)}},{key:"OnGetRootData",get:function(){return this.FOnGetRootData},set:function(t){this.FOnGetRootData=t}},{key:"OnGetFormatTop",get:function(){return this.FOnGetFormatTop},set:function(t){this.FOnGetFormatTop=t}},{key:"OnFormatDirty",get:function(){return this.FOnFormatDirty},set:function(t){this.FOnFormatDirty=t}}])&&Ky(e.prototype,i),n&&Ky(e,n),r}(jy);function tp(t){return(tp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ep(t,e){return(ep=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ip(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=op(t);if(e){var o=op(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return np(this,i)}}function np(t,e){return!e||"object"!==tp(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function op(t){return(op=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sp(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ap(t,e,i){return e&&sp(t.prototype,e),i&&sp(t,i),t}var lp=function(){function t(){rp(this,t)}return ap(t,null,[{key:"IsKeyPressWant",value:function(e){return t.UNPLACEHOLDERCHAR?e.keyCode>=32&&e.keyCode<=126||e.keyCode>=3840&&e.keyCode<=4095||e.keyCode>=6144&&e.keyCode<=6319:e.keyCode>=32&&e.keyCode<=126}},{key:"IsKeyDownWant",value:function(t){return t==Pe||t==Ge||t==Be||t==Me||t==Ee||t==Le||t==be||t==Ne||t==Oe||t==De}},{key:"IsKeyDownEdit",value:function(t){return t==Pe||t==Ge||t==be||t==De}},{key:"IsDirectionKey",value:function(t){return t==Be||t==Ee||t==Me||t==Le}},{key:"PosCharHC",value:function(t,e){for(var i=0,n=1;n<=e.length;n++)if(t==e[n-1])return i=n;return i}},{key:"IsUnPlaceHolderChar",value:function(e){return t.UnPlaceholderChar.indexOf(e)>=0}},{key:"GetTextActualOffset",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=i,r=e.length;if(n)for(;o<r&&t.UnPlaceholderChar.indexOf(e[o+1-1])>=0;)o++;else for(;o>1&&t.UnPlaceholderChar.indexOf(e[o-1])>=0;)o--;return o}},{key:"GetCharHalfFarfromUN",value:function(e,i,n){var o=t.GetTextActualOffset(e,i,!0),r=t.GetTextActualOffset(e,i)-1;return r>0?o==r?r>1?n[r-2]+Math.trunc((n[o-1]-n[r-2])/2):Math.trunc(n[r-1]/2):n[r-1]+Math.trunc((n[o-1]-n[r-1])/2):Math.trunc(n[o-1]/2)}},{key:"GetCharHalfFarfrom",value:function(t,e){var i=0;return t>1?i=e[t-2]+Math.trunc((e[t-1]-e[t-2])/2):1==t&&(i=Math.trunc(e[t-1]/2)),i}},{key:"GetNorAlignCharOffsetAt",value:function(e,i,n){var o;if(n<0)o=0;else{var r=i.length,s=e.getTextExtentExPoint(i,r);if(0==s.length||n>s[s.length-1])o=r;else for(var a=1;a<=r;){if(t.UNPLACEHOLDERCHAR&&(a=t.GetTextActualOffset(i,a,!0)),n==s[a-1]){o=a;break}if(!(n>s[a-1])){o=t.UNPLACEHOLDERCHAR&&n>t.GetCharHalfFarfromUN(i,a,s)||!t.UNPLACEHOLDERCHAR&&t.GetCharHalfFarfrom(a,s)?a:t.UNPLACEHOLDERCHAR?t.GetTextActualOffset(i,a)-1:a-1;break}a++}}return o}},{key:"GetPaperSizeInfo",value:function(e){var i;switch(e){case kp.A3:i='{"Name":"A3", "Width":297, "Height":420}';break;case kp.A4:i='{"Name":"A4", "Width":210, "Height":297}';break;case kp.A5:i='{"Name":"A5", "Width":148, "Height":210}';break;case kp.B5:i='{"Name":"B5", "Width":182, "Height":257}';break;case t.DMPAPER_HC_16K:i='{"Name":"16K", "Width":195, "Height":271}';break;default:i='{"Name":"自定义", "Width":210, "Height":297}'}return JSON.parse(i)}},{key:"GetPaperSizeName",value:function(e){return t.GetPaperSizeInfo(e).Name}},{key:"GetPaperSizeByName",value:function(e){switch(e){case"A3":return kp.A3;case"A4":return kp.A4;case"A5":return kp.A5;case"B5":return kp.B5;case"16K":return t.DMPAPER_HC_16K;default:return kp.Custom}}},{key:"GetVersionAsInteger",value:function(t){return t.replace(/[^0-9]/gi,"")}},{key:"HCSaveTextToStream",value:function(e,i){var n=A.getBytes(i),o=n.length;o>O.max&&or.exception(t.HCS_EXCEPTION_TEXTOVER),e.writeUInt16(o),o>0&&e.writeBuffer(n)}},{key:"HCLoadTextFromStream",value:function(t,e){var i=t.readUInt16();if(i>0){var n=t.readBuffer(i);return A.getString(n)}return""}},{key:"GetPropertyString",value:function(e){for(var i,n="",o=0;o<e.count;o++)""!=(i=e[o]).key&&""!=i.val&&(n+=i.key+"="+i.val+t.sLineBreak);return n}},{key:"GetPropertyJSON",value:function(t){for(var e,i="",n=0;n<t.count;n++)""!=(e=t[n]).key&&""!=e.val&&(""!=i&&(i+=","),i+='"'+e.key+'":"'+e.val+'"');return JSON.parse("{"+i+"}")}},{key:"SetPropertyJSON",value:function(t,e){for(var i in t.clear(),e)""==i&&""==e[i]||t.add(i,e[i])}},{key:"SetPropertyString",value:function(e,i){if(i.clear(),""!=e)for(var n,o=e.split(t.sLineBreak),r=0;r<o.length;r++)""!=o[r]&&""!=(n=o[r].split("="))[0]&&i.add(n[0].replace("\r",""),n[1].replace("\r",""))}},{key:"SetItemPropertyString",value:function(e,i){if(""!=e)for(var n,o=e.split(t.sLineBreak),r=0;r<o.length;r++)"Text"!=o[r]?""!=o[r]&&""!=(n=o[r].split("="))[0]&&i.SetValue(n[0],n[1]):console.log("不支持Text属性")}},{key:"SetItemPropertyJSON",value:function(t,e){for(var i in t)"Text"!=i?""==i&&""==t[i]||e.SetValue(i,t[i]):console.log("不支持Text属性")}},{key:"HCGetProperty",value:function(t,e){var i=t.valueByKey(e);return null!=i?i:""}},{key:"HCSetProperty",value:function(t,e,i){i&&e&&((i=i.toString()).indexOf("=")>=0?or.exception("HCSetProperty属性值中不允许有=号"):""!=i?t.setValue(e,i):t.remove(e))}},{key:"HCRemoveProperty",value:function(t,e){t.remove(e)}},{key:"_SaveFileFormatAndVersion",value:function(e){var i=A.getBytes(t.HC_EXT);e.writeBuffer(i),i=A.getBytes(t.HC_FileVersion),e.writeBuffer(i),e.writeByte(t.HC_PROGRAMLANGUAGE)}},{key:"_LoadFileFormatAndVersion",value:function(e){var i=e.readBuffer(A.getByteCount(this.HC_EXT)),n=A.getString(i,0,i.length);i=e.readBuffer(A.getByteCount(this.HC_FileVersion));var o=A.getString(i,0,i.length),r=t.GetVersionAsInteger(o),s=0;return r>19&&(s=e.readByte()),{fileExt:n,fileVersion:r,lang:s}}},{key:"HCSaveColorToStream",value:function(t,e){var i=at.colorToRGBA(e);t.writeByte(i.a),t.writeByte(i.r),t.writeByte(i.g),t.writeByte(i.b)}},{key:"HCLoadColorFromStream",value:function(t){var e=t.readByte();return"rgba("+t.readByte()+", "+t.readByte()+", "+t.readByte()+", "+e+")"}},{key:"HCRGBStringToColor",value:function(e){var i=e.split(",");return i.length>3?"0"==i[0]?t.HCTransparentColor:at.rgbaToColor(i[1],i[2],i[3]):at.rgbaToColor(i[0],i[1],i[2])}},{key:"HCColorToRGBString",value:function(e){if(e==t.HCTransparentColor)return"0,255,255,255";var i=at.colorToRGBA(e);return C.stringFormat("255,{0},{1},{2}",i.r,i.g,i.b)}},{key:"HCSaveImageToStream",value:function(t,e){if(e&&""!=e.src){var i=e.src.split(","),n=b.fromBase64(i[1]);t.writeUInt32(n.length),n.length>0&&t.writeBuffer(n)}else t.writeUInt32(0)}},{key:"HCLoadImageFromStream",value:function(t){var e=null,i=t.readUInt32();if(i>0){var n=t.readBuffer(i);(e=new $i).src="data:image/png;base64,"+b.fromBuffer(n).toBase64()}return e}},{key:"GetXmlRN",value:function(t){return t.replace("\n","\r\n")}},{key:"SetBorderSideByPro",value:function(t,e){}},{key:"GetBorderSidePro",value:function(t){}},{key:"GraphicToBase64",value:function(t,e){}},{key:"Base64ToGraphic",value:function(t){}},{key:"HCDeleteBreak",value:function(t){return t.replace(new RegExp(this.sLineBreak,"g"),"")}},{key:"GetUnicodeCharType",value:function(t){var e=t.charCodeAt(0);return e>=11904&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||12295==e||e>=12549&&e<=12591||e>=12704&&e<=12730||e>=12736&&e<=12771||e>=13312&&e<=19893||e>=19968&&e<=40869||e>=40870&&e<=40943||e>=58368&&e<=58856||e>=58880&&e<=59087||e>=59413&&e<=59503||e>=63744&&e<=64217||e>=131072&&e<=173782||e>=173824&&e<=177972||e>=177984&&e<=178205||e>=178208&&e<=183969||e>=183984&&e<=191456||e>=194560&&e<=195101?gp.HZ:e>=3840&&e<=3850||e>=3854&&e<=4095?gp.ZW:e>=3851&&e<=3853?gp.Break:e>=6144&&e<=6319?gp.HZ:e>=33&&e<=47||e>=58&&e<=64||e>=91&&e<=96||e>=123&&e<=126||65504==e?gp.FH:e>=48&&e<=57?gp.SZ:e>=65&&e<=90||e>=97&&e<=122?gp.ZM:gp.Break}},{key:"ReplaceUnPreChar",value:function(t){return t.replace(/\u2002/g," ").replace(/\u0009/g,"")}},{key:"HCDrawArrow",value:function(t,e,i,n,o){switch(o){case 0:t.pen.color=e,t.beginPath();try{t.moveTo(i,n),t.lineTo(i+1,n),t.moveTo(i-1,n+1),t.lineTo(i+2,n+1),t.moveTo(i-2,n+2),t.lineTo(i+3,n+2),t.moveTo(i-3,n+3),t.lineTo(i+4,n+3),t.moveTo(i-4,n+4),t.lineTo(i+5,n+4)}finally{t.paintPath()}break;case 1:t.pen.color=e,t.beginPath();try{t.moveTo(i,n),t.lineTo(i+1,n),t.moveTo(i-1,n-1),t.lineTo(i+2,n-1),t.moveTo(i-2,n-2),t.lineTo(i+3,n-2),t.moveTo(i-3,n-3),t.lineTo(i+4,n-3),t.moveTo(i-4,n-4),t.lineTo(i+5,n-4)}finally{t.paintPath()}}}},{key:"HCDrawWave",value:function(t,e){var i=!1,n=e.left;for(t.beginPath(),t.moveTo(n,e.bottom);n<e.right;)(n+=2)>e.right&&(n=e.right),i?t.lineTo(n,e.bottom):t.lineTo(n,e.bottom+2),i=!i;t.paintPath()}}]),t}();lp.TableCellData=$y,lp.AnnotationWidth=200,lp.HCExtFormat=0,lp.OffsetBefor=0,lp.OffsetInner=1,lp.OffsetAfter=2,lp.MinRowHeight=20,lp.MinColWidth=20,lp.clActiveBorder="rgb(180, 180, 180)",lp.clBtnFace="rgb(240, 240, 240)",lp.clMedGray="rgb(160, 160, 164)",lp.clMenu="rgb(240, 240, 240)",lp.clWindow="rgb(255, 255, 255)",lp.clHighlight="rgb(51, 153, 255)",lp.clInfoBk="rgb(255, 255, 225)",lp.AnnotateBKColor="rgb(255, 213, 213)",lp.AnnotateBKActiveColor="rgb(255, 168, 168)",lp.HyperTextColor="rgb(5, 99, 193)",lp.HCTransparentColor="rgba(255, 255, 255, 0)",lp.HC_TEXTMAXSIZE=4294967295,lp.GCursor=oe,lp.HC_PROGRAMLANGUAGE=4,lp.TabCharWidth=28,lp.DefaultColWidth=50,lp.PMSLineHeight=24,lp.AnnotationWidth=200,lp.DMPAPER_HC_16K=-1e3,lp.ROMANUMBER=["Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ"],lp.CIRCLENUMBER=["①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳"],lp.HC_EXCEPTION="HC异常:",lp.HCS_EXCEPTION_NULLTEXT=lp.HC_EXCEPTION+"文本Item的内容出现为空的情况!",lp.HCS_EXCEPTION_TEXTOVER=lp.HC_EXCEPTION+"TextItem的内容超出允许的最大字节数4294967295!",lp.HCS_EXCEPTION_MEMORYLESS=lp.HC_EXCEPTION+"复制时没有申请到足够的内存",lp.HCS_EXCEPTION_VOIDSOURCECELL=lp.HC_EXCEPTION+"源单元格无法再获取源单元格!",lp.HCS_EXCEPTION_TIMERRESOURCEOUTOF=lp.HC_EXCEPTION+"安装计时器的资源不足!",lp.CHECKNULLITEM=!0,lp.PROCSERIES=!0,lp.USESCRIPT=!1,lp.UNPLACEHOLDERCHAR=!0,lp.USESAVEITEMEVENT=!1,lp.RESETTABLEUSEFIRSTROWHEIGHT=!0,lp.TibetanVowel="ེོིུ",lp.TibetanOther="ྸཾ༷༵ྃཿྷྺྕྖཻླྲྟྱྭྀཽྥྩྪྫྰྶྡྦྔྨ྄ྒྒྮྯྴྐྑྤྣྠྗྙྼྻཱ༙༾༿྇྆ྲྀཷླྀཹཱིྚཱཱིུྜ࿆ྵྐྵྂྞྛ",lp.UnPlaceholderChar=lp.TibetanVowel+lp.TibetanOther,lp.DontLineFirstChar='`-=[]\\;,./~!@#$%^&*()_+{}|:""<>?·-=【】\;’,。、~!@#¥%……&×()——+{}|:”《》?°་༌།'+lp.UnPlaceholderChar,lp.DontLineLastChar="/\\\“‘",lp.LineSqueezeChar=",。;、?“”",lp.sLineBreak="\r\n",lp.HC_EXT=".hcf",lp.HC_EXT_DOCX=".docx",lp.HC_FileVersion="5.7",lp.HC_FileVersionInt=57,lp.HCExtFormat=0;var hp=0,cp=1,up={None:0,Left:1,Top:2,Right:3,Bottom:4},fp={Left:1,Top:2,Right:4,Bottom:8,LTRB:16,RTLB:32},dp={Header:1,Page:2,Footer:4},mp={None:0,Prev:1},yp={TopLeft:0,TopCenter:1,TopRight:2,CenterLeft:3,CenterCenter:4,CenterRight:5,BottomLeft:6,BottomCenter:7,BottomRight:8},pp=0,Sp=1,vp=2,Fp=3,Ip={Loading:0,Saving:1,Cutting:2,Copying:3,Pasting:4,DomainWholeReplace:5,Undoing:6,Redoing:7,InsertBreakItem:8,BatchInsert:9,Destroying:10,FormatBrushing:11},gp={Break:0,HZ:1,ZM:2,SZ:3,FH:4,ZW:5},wp={BackDeleteText:0,DeleteText:1,InsertText:2,ReturnItem:3,SetItemText:4,DeleteItem:5,InsertItem:6,ItemProperty:7,ItemSelf:8,ItemMirror:9,ConcatText:10,DeleteSelected:11},Cp={Symbol:0,OrderCustom:1,OrderRoman:2,OrderCustomCircle:3},kp={Custom:0,Letter:1,LetterSmall:2,Tabloid:3,Ledger:4,Legal:5,Statement:6,Executive:7,A3:8,A4:9,A4Small:10,A5:11,B4:12,B5:13,Folio:14,Quarto:15,Standard10x14:16,Standard11x17:17,Note:18,Number9Envelope:19,Number10Envelope:20,Number11Envelope:21,Number12Envelope:22,Number14Envelope:23,CSheet:24,DSheet:25,ESheet:26,DLEnvelope:27,C5Envelope:28,C3Envelope:29,C4Envelope:30,C6Envelope:31,C65Envelope:32,B4Envelope:33,B5Envelope:34,B6Envelope:35,ItalyEnvelope:36,MonarchEnvelope:37,PersonalEnvelope:38,USStandardFanfold:39,GermanStandardFanfold:40,GermanLegalFanfold:41,JapanesePostcard:43,Standard9x11:44,Standard10x11:45,Standard15x11:46,InviteEnvelope:47,LetterExtra:50,LegalExtra:51,TabloidExtra:52,A4Extra:53,LetterTransverse:54,A4Transverse:55,LetterExtraTransverse:56,APlus:57,BPlus:58,LetterPlus:59,A4Plus:60,A5Transverse:61,B5Transverse:62,A3Extra:63,A5Extra:64,B5Extra:65,A2:66,A3Transverse:67,A3ExtraTransverse:68,JapaneseDoublePostcard:69,A6:70,JapaneseEnvelopeKakuNumber2:71,JapaneseEnvelopeKakuNumber3:72,JapaneseEnvelopeChouNumber3:73,JapaneseEnvelopeChouNumber4:74,LetterRotated:75,A3Rotated:76,A4Rotated:77,A5Rotated:78,B4JisRotated:79,B5JisRotated:80,JapanesePostcardRotated:81,JapaneseDoublePostcardRotated:82,A6Rotated:83,JapaneseEnvelopeKakuNumber2Rotated:84,JapaneseEnvelopeKakuNumber3Rotated:85,JapaneseEnvelopeChouNumber3Rotated:86,JapaneseEnvelopeChouNumber4Rotated:87,B6Jis:88,B6JisRotated:89,Standard12x11:90,JapaneseEnvelopeYouNumber4:91,JapaneseEnvelopeYouNumber4Rotated:92,Prc16K:93,Prc32K:94,Prc32KBig:95,PrcEnvelopeNumber1:96,PrcEnvelopeNumber2:97,PrcEnvelopeNumber3:98,PrcEnvelopeNumber4:99,PrcEnvelopeNumber5:100,PrcEnvelopeNumber6:101,PrcEnvelopeNumber7:102,PrcEnvelopeNumber8:103,PrcEnvelopeNumber9:104,PrcEnvelopeNumber10:105,Prc16KRotated:106,Prc32KRotated:107,Prc32KBigRotated:108,PrcEnvelopeNumber1Rotated:109,PrcEnvelopeNumber2Rotated:110,PrcEnvelopeNumber3Rotated:111,PrcEnvelopeNumber4Rotated:112,PrcEnvelopeNumber5Rotated:113,PrcEnvelopeNumber6Rotated:114,PrcEnvelopeNumber7Rotated:115,PrcEnvelopeNumber8Rotated:116,PrcEnvelopeNumber9Rotated:117,PrcEnvelopeNumber10Rotated:118},Pp={Beg:0,End:1},Dp=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ep(t,e)}(i,t);var e=ip(i);function i(){return rp(this,i),e.call(this)}return i}(M),bp=function t(){rp(this,t),this.X=0,this.Y=0,this.Height=20,this.PageIndex=0,this.Visible=!1},Rp=function(){function t(e){rp(this,t),this.FReCreate=!1,this.FDisFocus=!1,this.VScroll=!1,this.HScroll=!1,this.control=e,this.FWidth=0,this.FHeight=0,this.FX=0,this.FY=0,this.Visible=!1}return ap(t,[{key:"setX_",value:function(t){this.FX!=t&&(this.FX=t,this.Show())}},{key:"setY_",value:function(t){this.FY!=t&&(this.FY=t,this.Show())}},{key:"setHeight_",value:function(t){this.FHeight!=t&&(this.FHeight=t,this.FReCreate=!0)}},{key:"setWidth_",value:function(t){this.FWidth!=t&&(this.FWidth=t,this.FReCreate=!0)}},{key:"ReCreate",value:function(){or.application.destroyCaret(this.control),or.application.createCaret(this.control,null,this.FWidth,this.FHeight)}},{key:"ShowAt",value:function(t,e){this.FDisFocus=!1,this.FReCreate&&this.ReCreate(),this.Visible=!0,or.ime.updatePosition(t,e),or.application.setCaretPos(t,e),or.application.showCaret(this.control)}},{key:"Show",value:function(){this.ShowAt(this.FX,this.FY)}},{key:"Hide",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.FDisFocus=t,this.Visible=!1,or.application.hideCaret(this.control)}},{key:"Height",get:function(){return this.FHeight},set:function(t){this.setHeight_(t)}},{key:"Width",get:function(){return this.FWidth},set:function(t){this.setWidth_(t)}},{key:"X",get:function(){return this.FX},set:function(t){this.setX_(t)}},{key:"Y",get:function(){return this.FY},set:function(t){this.setY_(t)}},{key:"DisFocus",get:function(){return this.FDisFocus}}]),t}();function _p(t){return(_p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xp(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ap(t,e,i){return e&&xp(t.prototype,e),i&&xp(t,i),t}function Tp(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Op(t,e)}function Op(t,e){return(Op=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Np(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Ep(t);if(e){var o=Ep(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Bp(this,i)}}function Bp(t,e){return!e||"object"!==_p(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ep(t){return(Ep=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Mp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Lp=function t(){Mp(this,t)};Lp.EMRSTYLE_TOOTH=-1001,Lp.EMRSTYLE_FANGJIAO=-1002,Lp.EMRSTYLE_YUEJING=-1003;var Gp=function(t){Tp(i,t);var e=Np(i);function i(){var t;return Mp(this,i),(t=e.call(this)).id,t.owner,t.desID,t.nameEx,t.ownerID,t}return i}(L),Hp=function(t){Tp(i,t);var e=Np(i);function i(){var t;return Mp(this,i),(t=e.call(this)).id,t.pid,t.groupClass,t.groupType,t.useRang,t.inOrOut,t.groupCode,t.groupName,t}return i}(L),Up=function(t){Tp(i,t);var e=Np(i);function i(){var t;return Mp(this,i),(t=e.call(this)).DesPID=0,t}return i}(L),Vp=function(t){Tp(i,t);var e=Np(i);function i(){var t;return Mp(this,i),(t=e.call(this)).ID=0,t.DesID=0,t.RecName="",t.DT="",t.LastDT="",t}return i}(L);Hp.CLASS_PAGE=1,Hp.CLASS_HEADER=2,Hp.CLASS_FOOTER=3,Hp.USERANG_CLINIC=1,Hp.USERANG_NURSE=2,Hp.USERANG_CLINICANDNURSE=3,Hp.INOROUT_IN=1,Hp.INOROUT_OUT=2,Hp.INOROUT_INOUT=3;var Wp=function(){function t(){Mp(this,t),this.ServerURL="http://127.0.0.1:12860/",this.resURL="",this.ToHtmlUseTrace=!1,this.G_SaveTrace=!0}return Ap(t,[{key:"TreeNodeIsTemplate",value:function(t){return null!=t&&null!=t.object&&t.object.isClass(Gp)}},{key:"TreeNodeIsRecord",value:function(t){return null!=t&&null!=t.object&&t.object.isClass(Vp)}},{key:"TreeNodeIsRecordDataSet",value:function(t){return null!=t&&null!=t.object&&t.object.isClass(Up)}},{key:"ClearRecordNode",value:function(t){for(var e,i=0;i<t.nodes.count;i++)null!=(e=t.nodes[i])&&(e.object=null);t.nodes.clear()}},{key:"GetNodeRecordInfo",value:function(t){var e=-1,i=-1,n=-1;if(this.TreeNodeIsRecord(t)){i=t.object.DesID,n=t.object.ID,e=-1;for(var o=t;null!=o.parent;)if(o=o.parent,this.TreeNodeIsRecordDataSet(o)){e=o.object.DesPID;break}}return{despid:e,desid:i,recordid:n}}}]),t}();function zp(t){return(zp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jp(t,e){return(jp=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Xp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Yp(t);if(e){var o=Yp(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Kp(this,i)}}function Kp(t,e){return!e||"object"!==zp(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Yp(t){return(Yp=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Jp=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&jp(t,e)}(i,t);var e=Xp(i);function i(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(t=e.call(this))._height=120,t.caption="插入表格",t.edtRowCount=new vn("行数","2"),t.edtRowCount.left=20,t.edtRowCount.top=20,t.edtRowCount.width=70,t.addControl(t.edtRowCount),t.edtColCount=new vn("列数","2"),t.edtColCount.left=t.edtRowCount.left+t.edtRowCount.width+20,t.edtColCount.top=20,t.edtColCount.width=70,t.addControl(t.edtColCount),t.btnOk=new nn("确定"),t.btnOk.onClick=function(){t.modalResult=no,t.close()},t.btnOk.left=Math.trunc((t.width-t.btnOk.width)/2),t.btnOk.top=t.edtColCount.top+t.edtColCount.height+20,t.addControl(t.btnOk),t}return i}(so);function Zp(t,e,i){return(Zp="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=oS(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function qp(t){return(qp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qp(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $p(t,e,i){return e&&Qp(t.prototype,e),i&&Qp(t,i),t}function tS(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&eS(t,e)}function eS(t,e){return(eS=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function iS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=oS(t);if(e){var o=oS(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return nS(this,i)}}function nS(t,e){return!e||"object"!==qp(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function oS(t){return(oS=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var sS={Del:1,Add:2,Mod:4},aS="Index",lS="Code",hS="Name",cS="Frmtp",uS="Unit",fS="HdUnit",dS="CMV",mS="CMVVCode",yS="DTFMT",pS="Trace",SS="TcDel",vS="TcAdd",FS="TcDelL",IS="TcAddL",gS="Secret",wS="EdtVal",CS="RS",kS="MS",PS="N",DS="S",bS="D",RS="T",_S="DT",xS="ItemMutex",AS="MutexYes",TS="MutexNo",OS=0,NS=1,BS=function t(){rS(this,t),this.Problem=OS,this.Offset=0,this.Length=0},ES=function(t){tS(i,t);var e=iS(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return rS(this,i),(t=e.call(this,n)).FEditProtect=!1,t.FDeleteAllow=!0,t.FAllocOnly=!1,t.FCopyProtect=!1,t.FAllocValue=!1,t.FOutOfRang=!1,t.FMouseIn=!1,t.FTraceStyles=new M,t.FPropertys=new z,t}return $p(i,[{key:"HasProp",value:function(t){return this.FPropertys.hasKey(t)}},{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){e=e.toString(),"Text"==t||("EditProtect"==t?this.FEditProtect=or.system.parseBooleanDef(e,this.FEditProtect):"DeleteAllow"==t?this.FDeleteAllow=or.system.parseBooleanDef(e,this.FDeleteAllow):"CopyProtect"==t?this.FCopyProtect=or.system.parseBooleanDef(e,this.FCopyProtect):"AllocValue"==t?this.FAllocValue=or.system.parseBooleanDef(e,this.FAllocValue):lp.HCSetProperty(this.FPropertys,t,e))}},{key:"GetIsElement",value:function(){return null!=this.FPropertys.valueByKey(aS)}},{key:"SetText",value:function(t){""!=t?Zp(oS(i.prototype),"SetText",this).call(this,t):this.IsElement?this.Text=this.FPropertys.valueByKey(hS):Zp(oS(i.prototype),"SetText",this).call(this,"")}},{key:"MouseEnter",value:function(){Zp(oS(i.prototype),"MouseEnter",this).call(this),this.FMouseIn=!0}},{key:"MouseLeave",value:function(){Zp(oS(i.prototype),"MouseLeave",this).call(this),this.FMouseIn=!1}},{key:"SetActive",value:function(t){t||(this.FMouseIn=!1),Zp(oS(i.prototype),"SetActive",this).call(this,t)}},{key:"TextEffective",value:function(){return this.FTraceStyles.has(sS.Del)?"":Zp(oS(i.prototype),"TextEffective",this).call(this)}},{key:"SubStringEffective",value:function(t,e){return this.FTraceStyles.has(sS.Del)?"":Zp(oS(i.prototype),"SubStringEffective",this).call(this,t,e)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FTraceStyles.value=t.TraceStyles.value,this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow,this.FCopyProtect=t.CopyProtect,this.FAllocValue=t.AllocValue,this.FOutOfRang=t.OutOfRang;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"CanConcatItems",value:function(t){var e=Zp(oS(i.prototype),"CanConcatItems",this).call(this,t);return e&&(e=this.GetValue(aS)==t.GetValue(aS)&&this.FTraceStyles.value==t.TraceStyles.value&&this.FEditProtect==t.FEditProtect&&this.FDeleteAllow==t.DeleteAllow&&this.FCopyProtect==t.CopyProtect&&this.GetValue(SS)==t.GetValue(SS)&&this.GetValue(vS)==t.GetValue(vS)&&this.GetValue(FS)==t.GetValue(FS)&&this.GetValue(IS)==t.GetValue(IS)),e}},{key:"GetHint",value:function(){if(0==this.FTraceStyles.value)return this.GetValue(hS);var t=this.GetValue(vS),e=this.GetValue(SS);return""!=t?""!=e?t+"\r\n"+e:t:e}},{key:"DeleteProperty",value:function(t){lp.HCRemoveProperty(this.FPropertys,t)}},{key:"AcceptAction",value:function(t,e,n){var o=Zp(oS(i.prototype),"AcceptAction",this).call(this,t,e,n);if(o)switch(n){case wp.InsertText:(this.FEditProtect||this.FAllocOnly)&&(o=0==t||t==this.Length);break;case wp.ConcatText:(this.FEditProtect||this.IsElement)&&(o=!1);break;case wp.BackDeleteText:(this.FEditProtect||this.FAllocOnly)&&(o=0==t);break;case wp.DeleteText:(this.FEditProtect||this.FAllocOnly)&&(o=t==this.Length)}return o}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FOutOfRang&&(o|=64),this.FCopyProtect&&(o|=32),this.FAllocValue&&(o|=16),this.FDeleteAllow&&(o|=8),this.FAllocOnly&&(o|=4),t.writeByte(o),or.emrCommon.G_SaveTrace?t.writeByte(this.FTraceStyles.value):t.writeByte(0),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FOutOfRang=or.system.isOdd(o>>6),this.FCopyProtect=or.system.isOdd(o>>5),this.FAllocValue=or.system.isOdd(o>>4),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>3),this.FAllocOnly=or.system.isOdd(o>>2),o=t.readByte(),this.FTraceStyles.value=n>46?o:0==o?0:1==o?sS.Del:sS.Add;var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys),n<=46&&""!=this.GetValue(pS)&&(0==o||(1==o?this.SetValue(SS,this.GetValue(pS)):this.SetValue(vS,this.GetValue(pS))),this.SetValue(pS,""))}},{key:"ToHtml",value:function(){if(or.emrCommon.ToHtmlUseTrace){var t="",e='<a class="fs'+this.StyleNo.toString()+'"';return this.FTraceStyles.has(sS.Add)&&(t+=" underline"),this.FTraceStyles.has(sS.Del)&&(t+=" line-through"),""!=t&&(t+=' style="text-decoration:'+t+'"'),e+t+">"+this.Text+"</a>"}return this.FTraceStyles.has(sS.Del)?"":Zp(oS(i.prototype),"ToHtml",this).call(this)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t),this.FEditProtect&&t.SetAttribute("editprotect","1"),this.FOutOfRang&&t.SetAttribute("outofrang","1"),this.FCopyProtect&&t.SetAttribute("copyprotect","1"),this.FAllocValue&&t.SetAttribute("allocvalue","1"),this.FDeleteAllow&&t.SetAttribute("deleteallow","1"),this.FAllocOnly&&t.SetAttribute("alloconly","1"),t.SetAttribute("tracestyles",this.FTraceStyles.value.toString());var e=lp.GetPropertyString(this.FPropertys);""!=e&&t.SetAttribute("property",e)}},{key:"ParseXml",value:function(t){if(Zp(oS(i.prototype),"ParseXml",this).call(this,t),this.FEditProtect="1"==t.GetAttribute("editprotect"),t.HasAttribute("deleteallow")?this.FDeleteAllow="1"==t.GetAttribute("deleteallow"):this.FDeleteAllow=!0,t.HasAttribute("alloconly")?this.FAllocOnly="1"==t.GetAttribute("alloconly"):this.FAllocOnly=!1,t.HasAttribute("property")){var e=lp.GetXmlRN(t.GetAttribute("property"));lp.SetPropertyString(e,this.FPropertys)}}},{key:"ToJSONString",value:function(){for(var t,e="",n=0;n<this.FPropertys.count;n++)""!=(t=this.FPropertys[n]).key&&(""!=e&&(e+=","),e+='"'+t.key+'":"'+t.val+'"');return""!=e?Zp(oS(i.prototype),"ToJSONString",this).call(this)+","+e:Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t),t.index?this.SetValue(aS,t.index):this.FPropertys.remove(aS),t.unit?this.SetValue(uS,t.unit):this.FPropertys.remove(uS)}},{key:"Reset",value:function(){""!=this.Name&&(this.Text=this.Name),this.FAllocValue=!1}},{key:"IsElement",get:function(){return this.GetIsElement()}},{key:"MouseIn",get:function(){return this.FMouseIn}},{key:"TraceStyles",get:function(){return this.FTraceStyles},set:function(t){this.FTraceStyles=t}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"CopyProtect",get:function(){return this.FCopyProtect},set:function(t){this.FCopyProtect=t}},{key:"AllocOnly",get:function(){return this.FAllocOnly},set:function(t){this.FAllocOnly=t}},{key:"AllocValue",get:function(){return this.FAllocValue},set:function(t){this.FAllocValue=t}},{key:"OutOfRang",get:function(){return this.FOutOfRang},set:function(t){this.FOutOfRang=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}},{key:"Name",get:function(){return this.GetValue(hS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,hS):this.SetValue(hS,t)}},{key:"Frmtp",get:function(){return this.GetValue(cS)}}],[{key:"GetSecretRange",value:function(t){if(""==t)return{low:-1,hi:-1};var e=-1,i=-1,n=t.indexOf("-"),o="";return n<0?e=parseInt(t):0===n?(e=1,null!=(o=t.substr(n+1,t.length-n-1))&&""!=o&&(i=parseInt(o))):(o=t.substr(0,n),e=parseInt(o),t.length-n>1&&null!=(o=t.substr(n+1,t.length-n-1))&&""!=o&&(i=parseInt(o))),{low:e,hi:i}}}]),i}(function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FSyntaxs=null,n}return $p(i,[{key:"SyntaxAdd",value:function(t,e,i){var n=new BS;n.Offset=t,n.Length=e,n.Problem=i,null==this.FSyntaxs&&(this.FSyntaxs=new V),this.FSyntaxs.add(n)}},{key:"SyntaxClear",value:function(){null!=this.FSyntaxs&&this.FSyntaxs.clear()}},{key:"SyntaxCount",value:function(){return null!=this.FSyntaxs?this.FSyntaxs.count:0}},{key:"Syntaxs",get:function(){return this.FSyntaxs}}]),i}(Hl)),MS=function(t){tS(i,t);var e=iS(i);function i(t,n){var o;return rS(this,i),(o=e.call(this,t,n)).FPropertys=new z,o}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoCreateCell",value:function(t){return new LS(t)}},{key:"SaveToStream",value:function(t){Zp(oS(i.prototype),"SaveToStream",this).call(this,t),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e){if(Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e),e>53){var n=lp.HCLoadTextFromStream(t,e);lp.SetPropertyString(n,this.FPropertys)}}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"Propertys",get:function(){return this.FPropertys}}]),i}(Uh),LS=function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FEditProtect=!1,n.FPropertys=new z,n}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"SetEditProtect",value:function(t){this.FEditProtect=t,null!=this.CellData&&(this.CellData.ReadOnly=this.FEditProtect)}},{key:"SaveToStream",value:function(t){Zp(oS(i.prototype),"SaveToStream",this).call(this,t);var e=0;this.FEditProtect&&(e|=128),t.writeByte(e),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){if(Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n),n>53){if(n>56){var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7)}var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.SetEditProtect(t)}}]),i}(Nh),GS=function(t){tS(i,t);var e=iS(i);function i(t,n,o,r){var s;return rS(this,i),(s=e.call(this,t,n,o,r)).FDrawRect=new U,s.FEditProtect=!1,s.FDeleteAllow=!0,s.FPropertys=new z,s.FAutoLineCol=-1,s.FPaintCellCol=-1,s.FAutoFillPage=!1,s.FLightEditRow=!1,s.FLightEditCol=!1,s}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"CellChangeByAction",value:function(t,e,n){Zp(oS(i.prototype),"CellChangeByAction",this).call(this,t,e,n)}},{key:"DoCreateRow",value:function(t,e){return new MS(t,e)}},{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){this.FDrawRect.resetRect(e),Zp(oS(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l)}},{key:"DoCellPaintDataBefor",value:function(t,e,i,n,o){this.FPaintCellCol=e}},{key:"DoCellDataDrawItemPaintAfter",value:function(t,e,n,o,r,s,a,l,h,c,u,f){Zp(oS(i.prototype),"DoCellDataDrawItemPaintAfter",this).call(this,t,e,n,o,r,s,a,l,h,c,u,f),this.FPaintCellCol==this.FAutoLineCol&&n<t.DrawItems.count-1&&t.DrawItems[n+1].LineFirst&&(u.pen.width=this.BorderWidthPix,u.pen.color=at.Black,f.Print?u.pen.style=pt.Solid:u.pen.style=pt.Dot,u.drawLineDriect(this.FDrawRect.left,o.bottom,this.FDrawRect.right,o.bottom))}},{key:"DoPaintCellBorderSides",value:function(t,e,i,n,o,r,s){if(this.FLightEditRow&&e==this.SelectCellRang.StartRow){var a=t.pen.width;t.pen.width++;var l=t.pen.color;t.pen.color=at.Blue,t.drawLineDriect(n,o,r,o),t.drawLineDriect(n,s-1,r,s-1),t.pen.width=a,t.pen.color=l}if(this.FLightEditCol&&i==this.SelectCellRang.StartCol){var h=t.pen.width;t.pen.width++;var c=t.pen.color;t.pen.color=at.Blue,t.drawLineDriect(n,o,n,s),t.drawLineDriect(r-1,o,r-1,s),t.pen.width=h,t.pen.color=c}}},{key:"DoFormatToDrawItem",value:function(){if(this.FAutoFillPage){var t=this.RowCount-1,e=1,i=!1;this.FixRow>=0&&(e=this.FixRow+this.FixRowCount);for(var n=this.RowCount-1;n>=e&&!i;n--)for(var o=this.Rows[n].ColCount,r=0;r<o;r++){if(null==this.Rows[n][r].CellData){t=n,i=!0;break}if(!this.Rows[n][r].CellData.IsEmptyData()){t=n,i=!0;break}}if(i){var s=this.GetEditCellWith();s.row>=0&&t<s.row&&(t=s.row);for(var a=this.RowCount-1;a>t;a--)this.Rows.delete(a)}}}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys),this.PropertyChange()}},{key:"CheckPageSurplus",value:function(t){if(this.FAutoFillPage){var e=Math.floor(t/(this.DefaultRowHeight+this.BorderWidthPix));return e>0?(this.AppendRowDynamic(e),e*(this.DefaultRowHeight+this.BorderWidthPix)):0}return Zp(oS(i.prototype),"CheckPageSurplus",this).call(this,t)}},{key:"Change",value:function(){this.DoChange()}},{key:"PropertyChange",value:function(){var t=this.GetValue(i.AutoLineColProp);this.FAutoLineCol=""!=t?parseInt(t):-1,t=this.GetValue(i.AutoFillPageProp),this.FAutoFillPage="1"==t,t=this.GetValue(i.LightEditRowProp),this.FLightEditRow="1"==t,t=this.GetValue(i.LightEditColProp),this.FLightEditCol="1"==t}},{key:"SetRowReadOnly",value:function(t,e){for(var i=this.Rows[t].ColCount,n=0;n<i;n++)null!=this.Rows[t][n].CellData&&(this.Rows[t][n].CellData.ReadOnly=e)}},{key:"SetCellReadOnly",value:function(t,e,i){null!=this.Rows[t][e].CellData&&(this.Rows[t][e].CellData.ReadOnly=i)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys),this.PropertyChange()}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"AutoLineCol",get:function(){return this.FAutoLineCol}},{key:"AutoFillPage",get:function(){return this.FAutoFillPage}},{key:"LightEditRow",get:function(){return this.FLightEditRow}},{key:"LightEditCol",get:function(){return this.FLightEditCol}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(ic);GS.AutoLineColProp="AutoLineCol",GS.AutoFillPageProp="AutoFillPage",GS.LightEditRowProp="LightEditRow",GS.LightEditColProp="LightEditCol";var HS=function(t){tS(i,t);var e=iS(i);function i(t,n,o){var r;return rS(this,i),(r=e.call(this,t,n,o)).FDeleteAllow=!0,r.FEditProtect=!1,r.FPropertys=new z,r}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoSetChecked",value:function(t){this.EditProtect||Zp(oS(i.prototype),"DoSetChecked",this).call(this,t)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(Lu),US=function(t){tS(i,t);var e=iS(i);function i(t,n){var o;return rS(this,i),(o=e.call(this,t,n)).FDeleteAllow=!0,o.FEditProtect=!1,o.FPropertys=new z,o}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(cm),VS=function(t){tS(i,t);var e=iS(i);function i(t,n){var o;return rS(this,i),(o=e.call(this,t,n)).FDeleteAllow=!0,o.FEditProtect=!1,o.FPropertys=new z,o}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"KeyDown",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyDown",this).call(this,t)}},{key:"KeyPress",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyPress",this).call(this,t)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"InsertText",value:function(t){return!this.FEditProtect&&Zp(oS(i.prototype),"InsertText",this).call(this,t)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}($u),WS=function(t){tS(i,t);var e=iS(i);function i(t,n){var o;return rS(this,i),(o=e.call(this,t,n)).FDeleteAllow=!0,o.FEditProtect=!1,o.FPropertys=new z,o.SaveItem=!1,o}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"KeyDown",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyDown",this).call(this,t)}},{key:"KeyPress",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyPress",this).call(this,t)}},{key:"DoPopup",value:function(){this.FEditProtect||Zp(oS(i.prototype),"DoPopup",this).call(this)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"InsertText",value:function(t){return!this.FEditProtect&&Zp(oS(i.prototype),"InsertText",this).call(this,t)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(hf),zS=function(t){tS(i,t);var e=iS(i);function i(t,n){var o;return rS(this,i),(o=e.call(this,t,n)).FDeleteAllow=!0,o.FEditProtect=!1,o.FPropertys=new z,o}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoPopup",value:function(){this.FEditProtect||Zp(oS(i.prototype),"DoPopup",this).call(this)}},{key:"KeyDown",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyDown",this).call(this,t)}},{key:"KeyPress",value:function(t){this.FEditProtect||Zp(oS(i.prototype),"KeyPress",this).call(this,t)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"InsertText",value:function(t){return!this.FEditProtect&&Zp(oS(i.prototype),"InsertText",this).call(this,t)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(Bd),jS=function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FDeleteAllow=!0,n.FEditProtect=!1,n.FPropertys=new z,n}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoSetItemChecked",value:function(t,e){this.FEditProtect||Zp(oS(i.prototype),"DoSetItemChecked",this).call(this,t,e)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(Yd),XS=function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FDeleteAllow=!0,n.FEditProtect=!1,n.FPropertys=new z,n}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(Xm),KS=function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FDeleteAllow=!0,n.FEditProtect=!1,n.FPropertys=new z,n}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n);var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}(ty),YS=function(t){tS(i,t);var e=iS(i);function i(t){var n;return rS(this,i),(n=e.call(this,t)).FDeleteAllow=!0,n.FEditProtect=!1,n.FPropertys=new z,n}return $p(i,[{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){Zp(oS(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l),this.Empty&&this.Active&&!l.Print&&(a.font.size=12,a.font.styles.add(ht.Italic),a.textOut(e.left+2,e.top+2,"DeIndex:"+this.GetValue(aS)))}},{key:"Assign",value:function(t){Zp(oS(i.prototype),"Assign",this).call(this,t),this.FEditProtect=t.EditProtect,this.FDeleteAllow=t.DeleteAllow;var e=lp.GetPropertyString(t.Propertys);lp.SetPropertyString(e,this.FPropertys)}},{key:"SaveToStreamRange",value:function(t,e,n){Zp(oS(i.prototype),"SaveToStreamRange",this).call(this,t,e,n);var o=0;this.FEditProtect&&(o|=128),this.FDeleteAllow&&(o|=64),t.writeByte(o),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){if(Zp(oS(i.prototype),"LoadFromStream",this).call(this,t,e,n),!(n<33)){var o=t.readByte();this.FEditProtect=or.system.isOdd(o>>7),this.FDeleteAllow=!(n>34)||or.system.isOdd(o>>6);var r=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(r,this.FPropertys)}}},{key:"ToXml",value:function(t){Zp(oS(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){Zp(oS(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){return Zp(oS(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){Zp(oS(i.prototype),"ParseJSONOjbect",this).call(this,t)}},{key:"EditProtect",get:function(){return this.FEditProtect},set:function(t){this.FEditProtect=t}},{key:"DeleteAllow",get:function(){return this.FDeleteAllow},set:function(t){this.FDeleteAllow=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"Index",get:function(){return this.GetValue(aS)}},{key:"Code",get:function(){return this.GetValue(lS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,lS):this.SetValue(lS,t)}}]),i}($c);function JS(t){return(JS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ZS(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function qS(t,e){return(qS=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function QS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=tv(t);if(e){var o=tv(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return $S(this,i)}}function $S(t,e){return!e||"object"!==JS(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function tv(t){return(tv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ev=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qS(t,e)}(r,t);var e,i,n,o=QS(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this)).visible=!1,t.headerVisible=!1,t.drawShadow=!0,t.dropDownStyle=!0,t.beginUpdate();try{t.FPageDomain=t.addPage("pgDomain"),t._initDomainPage(),t.FPageNumber=t.addPage("pgNumber"),t._initNumberPage(),t.FPageMemo=t.addPage("pgMemo"),t._initMemoPage(),t.FPageDateTime=t.addPage("pgDateTime"),t._initDateTimePage()}finally{t.endUpdate()}return t.FMultSelect=!1,t.FFrmtp="",t.FDeItem=null,t.FDomainItems=null,t.FDomainMinH=100,t.DomainNoItemSelectStop=!1,t.OnSetActiveItemExtra=null,t.OnSetPopupItemText=null,t.OnPopupGetDeItemInfoLib=null,t.OnPopupGetDeItemDomainLib=null,t.OnPopupGetDomainItemExtraLib=null,t.OnItemPopupSetCloseLib=null,t}return e=r,(i=[{key:"_initDB",value:function(){var t=this;this.FDB.onUpgradeneeded=function(){t.FDB.db.objectStoreNames.contains("Comm_DataElement")||t.FDB.db.createObjectStore("Comm_DataElement",{keyPath:"deid"})},this.FDB.onOpen=function(){t._initCache()},this.FDB.open("clt",1)}},{key:"_initCache",value:function(){var t=null;window.XMLHttpRequest?t=new XMLHttpRequest:window.ActiveXObject&&(t=new ActiveXObject("Microsoft.XMLHTTP")),null!=t?(t.onreadystatechange=function(){4==t.readyState&&t.status},t.open("GET","url",!0),t.send(null)):or.exception("浏览器不支持XMLHttpRequest!")}},{key:"_initDomainPage",value:function(){var t=this;this.pnlDomain=new hn,this.pnlDomain.transparent=!0,this.pnlDomain.borderVisible=!1,this.pnlDomain.height=54;var e=new en("检索");e.top=10,e.left=2,this.pnlDomain.addControl(e),this.edtFilter=new dn,this.edtFilter.top=5,this.edtFilter.left=e.right+5,this.edtFilter.width=60,this.edtFilter.textPrompt="拼音、值",this.edtFilter.onChange=function(){t._filterDomainItem(t.edtFilter.text)},this.edtFilter.onKeyDown=function(e){e.keyCode!=Le&&e.keyCode!=Ee||t.FGridDomain.keyDown(e)},this.pnlDomain.addControl(this.edtFilter),this.btnCustom=new nn("自定义"),this.btnCustom.top=5,this.btnCustom.left=this.edtFilter.right+5,this.btnCustom.width=48,this.btnCustom.onClick=function(){t._trunStringPage("")},this.pnlDomain.addControl(this.btnCustom),this.btnRM=new nn("多选"),this.btnRM.top=5,this.btnRM.left=this.btnCustom.right+5,this.btnRM.width=40,this.btnRM.onClick=function(){t.MultSelect=!t.FMultSelect},this.pnlDomain.addControl(this.btnRM);var i=new nn("确定");i.top=5,i.left=this.btnRM.right+5,i.width=50,i.onClick=function(){t.btnDomainOKClick()},this.pnlDomain.addControl(i),this.chkItemOrd=new un("序号"),this.chkItemOrd.left=e.left,this.chkItemOrd.top=i.bottom+8,this.pnlDomain.addControl(this.chkItemOrd);var n=new en("间隔");n.left=this.chkItemOrd.right,n.top=this.chkItemOrd.top+2,this.pnlDomain.addControl(n),this.cbbOrdSplit=new Cn("、"),this.cbbOrdSplit.addItem("."),this.cbbOrdSplit.addItem("、"),this.cbbOrdSplit.addItem(""),this.cbbOrdSplit.left=n.right,this.cbbOrdSplit.top=this.chkItemOrd.top-2,this.cbbOrdSplit.width=34,this.cbbOrdSplit.dropDownWidth=34,this.pnlDomain.addControl(this.cbbOrdSplit);var o=new en("选项间隔");o.left=this.cbbOrdSplit.right+5,o.top=this.chkItemOrd.top+2,this.pnlDomain.addControl(o),this.cbbItemSplit=new Cn(";"),this.cbbItemSplit.addItem("、"),this.cbbItemSplit.addItem(";"),this.cbbItemSplit.addItem(""),this.cbbItemSplit.left=o.right+2,this.cbbItemSplit.top=this.cbbOrdSplit.top,this.cbbItemSplit.width=34,this.cbbItemSplit.dropDownWidth=34,this.pnlDomain.addControl(this.cbbItemSplit),this.chkItemMutex=new un("排斥"),this.chkItemMutex.left=this.cbbItemSplit.right+2,this.chkItemMutex.top=this.chkItemOrd.top,this.pnlDomain.addControl(this.chkItemMutex),this.pnlDomain.align=zt,this.FPageDomain.addControl(this.pnlDomain),this.FGridDomain=new Mn(3,6),this.FGridDomain.readOnly=!0,this.FGridDomain.onClick=function(){t.doGridDomainClick()},this.FGridDomain.onDblClick=function(){!t.FMultSelect&&t.FGridDomain.row>0&&t.FGridDomain.col>0&&t.btnDomainOKClick()},this.FGridDomain.onKeyDown=function(e){t.doGridDomainKeyDown(e)},this.FGridDomain.onCellPaint=function(e,i,n,o){return t.DomainCellPaint(e,i,n,o)},this.FGridDomain.borderVisible=!1,this.FGridDomain.setColWidth(0,0),null!=or.emrCommon.domainPopupGridItemColWidth?this.FGridDomain.setColWidth(1,or.emrCommon.domainPopupGridItemColWidth):this.FGridDomain.setColWidth(1,110),this.FGridDomain.setColWidth(2,35),this.FGridDomain.setColWidth(3,25),this.FGridDomain.setColWidth(4,30),this.FGridDomain.setColWidth(5,30),this.FGridDomain.transparent=!0,this.FGridDomain.align=Kt,this.FPageDomain.addControl(this.FGridDomain),this.FGridDomain.rows[0][0].value="",this.FGridDomain.rows[0][1].value="值",this.FGridDomain.rows[0][2].value="编码",this.FGridDomain.rows[0][3].value="ID",this.FGridDomain.rows[0][4].value="拼音",this.FGridDomain.rows[0][5].value="扩展",this.FGridDomain.fixRowCount=1,this.FPageDomain.addControl(this.FGridDomain),this.lblWait=new en("正在加载..."),this.lblWait.left=this.FGridDomain.left,this.lblWait.top=this.FGridDomain.top,this.lblWait.width=100,this.FPageDomain.addControl(this.lblWait)}},{key:"_initNumberPage",value:function(){var t=this,e=new en("数值");e.left=5,e.top=10,this.FPageNumber.addControl(e);var i=new en("单位");i.left=5,i.top=35,this.FPageNumber.addControl(i),this.edtValue=new pn,this.edtValue.valueMask=yn,this.edtValue.top=5,this.edtValue.left=e.right+5,this.edtValue.width=60,this.edtValue.onKeyDown=function(e){t.doNumberValueKeyDonw(e)},this.FPageNumber.addControl(this.edtValue),this.cbbUnit=new Cn,this.cbbUnit.left=i.right+5,this.cbbUnit.top=30,this.cbbUnit.width=60,this.FPageNumber.addControl(this.cbbUnit),this.chkHideUnit=new un("隐藏单位"),this.chkHideUnit.top=this.cbbUnit.bottom+5,this.chkHideUnit.left=5,this.FPageNumber.addControl(this.chkHideUnit);var n=new nn("确定");n.left=this.edtValue.right+5,n.top=5,n.onClick=function(){t.doNumberOk()},this.FPageNumber.addControl(n)}},{key:"_initMemoPage",value:function(){var t=this;this.memo=new dn,this.memo.top=5,this.memo.left=5,this.memo.width=190,this.memo.onKeyDown=function(e){t.doMemoValueKeyDown(e)};var e=new nn("确定");e.left=this.memo.left,e.top=this.memo.bottom+5,e.onClick=function(){t.doMemoOK()},this.FPageMemo.addControl(this.memo),this.FPageMemo.addControl(e)}},{key:"_initDateTimePage",value:function(){var t=this;this.dtpDateTime=new Pn(X.Now()),this.dtpDateTime.top=5,this.dtpDateTime.left=5,this.dtpDateTime.width=190,this.FPageDateTime.addControl(this.dtpDateTime);var e=new en("格式:");e.left=this.dtpDateTime.left,e.top=this.dtpDateTime.bottom+8,this.FPageDateTime.addControl(e),this.cbbDTFmt=new Cn("yyyy-MM-dd hh:mm"),this.cbbDTFmt.left=e.right,this.cbbDTFmt.top=this.dtpDateTime.bottom+5,this.cbbDTFmt.width=this.dtpDateTime.width-e.width,this.cbbDTFmt.dropDownWidth=this.dtpDateTime.width,this.cbbDTFmt.addItem("yyyy-MM-dd hh:mm"),this.cbbDTFmt.addItem("yyyy-MM-dd hh:mm:ss"),this.cbbDTFmt.addItem("yyyy年MM月dd日 hh时mm"),this.cbbDTFmt.addItem("yyyy-MM-dd"),this.cbbDTFmt.addItem("yyyy年MM月dd日"),this.cbbDTFmt.static=!0,this.cbbDTFmt.onSelectedIndexChange=function(){t.dtpDateTime.format=t.cbbDTFmt.text,t.dtpDateTime.dateTime=X.CreateByDateTime(t.dtCalc.dateTime)},this.FPageDateTime.addControl(this.cbbDTFmt),this.dtCalc=new kn(X.Now()),this.dtCalc.left=5,this.dtCalc.top=this.cbbDTFmt.bottom+5,this.dtCalc.width=190,this.dtCalc.btnDone.visible_=!1,this.dtCalc.onChange=function(){t.dtpDateTime.dateTime=X.CreateByDateTime(t.dtCalc.dateTime)},this.FPageDateTime.addControl(this.dtCalc);var i=new nn("当前日期时间");i.autoWidth=!0,i.left=35,i.top=this.dtCalc.bottom+5,i.onClick=function(){t.dtpDateTime.dateTime=X.Now(),t.dtCalc.dateTime=X.CreateByDateTime(t.dtpDateTime.dateTime)},this.FPageDateTime.addControl(i);var n=new nn("确定");n.width=56,n.left=i.right+10,n.top=i.top,n.onClick=function(){t.btnDateTimeOkClick()},this.FPageDateTime.addControl(n)}},{key:"_filterDomainItem",value:function(t){var e=this.FDomainItems.cv;if(""==t)for(var i in this.FDomainItems.count=this.FDomainItems.cv.length,e)e[i].visible=!0;else{for(var n=!1,o=0;o<t.length;o++)if(t.charCodeAt(o)>255){n=!0;break}var r=0,s=t.toUpperCase();for(var a in e)(n?e[a].value.indexOf(t)>=0:e[a].py.toUpperCase().indexOf(s)>=0)?(e[a].visible=!0,r++):e[a].visible=!1;this.FDomainItems.count=r}this._iniDomainItems()}},{key:"_iniDomainItems",value:function(){var t=this.FDomainItems.cv,e="",i=!0;this.FDeItem.AllocValue&&(e=","+this.FDeItem.GetValue(mS)+","),this.FGridDomain.beginUpdate();try{this.FGridDomain.rowCount=this.FDomainItems.count+1,this.FGridDomain.fixRowCount=1;var n=1;for(var o in t)t[o].visible&&(e.indexOf(","+t[o].code+",")>=0?this.FGridDomain.rows[n][0].value="1":(this.FGridDomain.rows[n][0].value="0",i=!1),this.FGridDomain.rows[n][1].value=t[o].value,this.FGridDomain.rows[n][2].value=t[o].code,this.FGridDomain.rows[n][3].value=t[o].id,this.FGridDomain.rows[n][4].value=t[o].py,this.FGridDomain.rows[n][5].value=t[o].content,n++);if(this.FGridDomain.rows[0][0].value=i?"1":"0",this.FGridDomain.rowCount>13)this.height=300,this._popupShow(this.left,this.top);else{var r=this.pnlDomain.height+this.FGridDomain.contentHeight;this.FGridDomain.HScroll_.visible&&(r+=this.FGridDomain.HScroll_.height),this.height=r<this.FDomainMinH?this.FDomainMinH:r}this.lblWait.visible=!1,this.FGridDomain.visible=!0}finally{this.FGridDomain.endUpdate()}}},{key:"IniDomainUIByJSON",value:function(t){this.FMultSelect?this.pnlDomain.height=54:this.pnlDomain.height=30,this.FDeItem.GetValue(xS)?this.chkItemMutex.checked=!0:this.chkItemMutex.checked=!1,this.FGridDomain.beginUpdate();try{if(this.FGridDomain.rowCount=1,null==t)return this.FDomainItems=JSON.parse('{"count": 0, "cv": []}'),this.lblWait.visible=!1,this.FGridDomain.visible=!0,void(this.height=this.FDomainMinH)}finally{this.FGridDomain.endUpdate()}for(var e in this.FDomainItems=t,this.FDomainItems.count=this.FDomainItems.cv.length,this.FDomainItems.cv)this.FDomainItems.cv[e].visible=!0;this._iniDomainItems(),this.FGridDomain.rowCount>1&&(this.FGridDomain.row=1),this.FGridDomain.setFocus()}},{key:"DomainCellPaint",value:function(t,e,i,n){return!(!this.FMultSelect||0!=n||("1"==this.FGridDomain.rows[i][n].value?or.theme.drawFrameControl(t,e,new Set([yi]),Ii):"2"==this.FGridDomain.rows[i][n].value?or.theme.drawFrameControl(t,e,new Set([pi]),Ii):or.theme.drawFrameControl(t,e,new Set([]),Ii),0))}},{key:"doGridDomainClick",value:function(){if(this.FMultSelect&&this.FGridDomain.col<2){this.FGridDomain.beginUpdate();try{var t="0";if(0==this.FGridDomain.row){this.chkItemMutex.state==pi?"0"==this.FGridDomain.rows[0][0].value?t="1":"1"==this.FGridDomain.rows[0][0].value?t="2":"2"==this.FGridDomain.rows[0][0].value&&(t="0"):t="0"==this.FGridDomain.rows[0][0].value?"1":"0",this.FGridDomain.rows[0][0].value=t;for(var e=0,i=this.FGridDomain.rowCount;e<i;e++)this.FGridDomain.rows[e][0].value=t}else{this.chkItemMutex.state==pi?"0"==this.FGridDomain.rows[this.FGridDomain.row][0].value?t="1":"1"==this.FGridDomain.rows[this.FGridDomain.row][0].value?t="2":"2"==this.FGridDomain.rows[this.FGridDomain.row][0].value&&(t="0"):t="0"==this.FGridDomain.rows[this.FGridDomain.row][0].value?"1":"0",this.FGridDomain.rows[this.FGridDomain.row][0].value=t;for(var n=1,o=this.FGridDomain.rowCount;n<o;n++)if(this.FGridDomain.rows[n][0].value!=t)return void(this.FGridDomain.rows[0][0].value="0");this.FGridDomain.rows[0][0].value=t}}finally{this.FGridDomain.endUpdate()}}}},{key:"doItemPopupSetClose",value:function(){null!=this.OnItemPopupSetCloseLib&&this.OnItemPopupSetCloseLib()}},{key:"doNumberOk",value:function(){var t=this.edtValue.text;""!=t&&(this.chkHideUnit.checked||(t+=this.cbbUnit.text),this.SetDeItemValue(t)||(this.FDeItem.SetValue(uS,this.cbbUnit.text),this.chkHideUnit.checked?this.FDeItem.SetValue(fS,"1"):this.FDeItem.DeleteProperty(fS),this.visible=!1,this.doItemPopupSetClose()))}},{key:"doMemoOK",value:function(){var t=this.memo.text;""!=t&&(this.SetDeItemValue(t)||(this.FDeItem.Propertys.remove(xS),this.FDeItem.Propertys.remove(mS),this.visible=!1,this.doItemPopupSetClose()))}},{key:"btnDomainOKClick",value:function(){var t=!1;if(this.FMultSelect){for(var e="",i="",n="",o=0,r=1;r<this.FGridDomain.rowCount;r++)this.chkItemMutex.state!=Si?"1"==this.FGridDomain.rows[r][0].value?(n=n+this.FGridDomain.rows[r][2].value+",",e+=this.FGridDomain.rows[r][1].value+this.cbbItemSplit.text):this.chkItemMutex.state==pi&&"0"==this.FGridDomain.rows[r][0].value||(i+=this.FGridDomain.rows[r][1].value+this.cbbItemSplit.text):"1"==this.FGridDomain.rows[r][0].value&&(o++,n=n+this.FGridDomain.rows[r][2].value+",",this.chkItemOrd.checked&&(e+=o.toString()+this.cbbOrdSplit.text),e+=this.FGridDomain.rows[r][1].value+this.cbbItemSplit.text);if(n=C.stringDelete(n,n.length-1,1),this.chkItemMutex.state!=Si)""!=e&&(""!=this.cbbItemSplit.text&&(e=C.stringDelete(e,e.length-1,1)),e=""!=this.FDeItem.GetValue(AS)?this.FDeItem.GetValue(AS)+e:"有"+e),""!=i&&(""!=this.cbbItemSplit.text&&(i=C.stringDelete(i,i.length-1,1)),i=""!=this.FDeItem.GetValue(TS)?this.FDeItem.GetValue(TS)+i:"无"+i),(t=""==e?this.SetDeItemValue(i):""==i?this.SetDeItemValue(e):this.SetDeItemValue(e+","+i))||(this.FDeItem.SetValue(mS,n),this.FDeItem.SetValue(xS,"1"));else if(""!=e)e=C.stringDelete(e,e.length-1,1),(t=this.SetDeItemValue(e))||(this.FDeItem.SetValue(mS,n),this.FDeItem.Propertys.remove(xS));else{if(this.DomainNoItemSelectStop)return;t=this._initDEText()}}else if(this.FGridDomain.row_>=0){var s=this.FGridDomain.row;(t=this.SetDeItemValue(this.FGridDomain.rows[s][1].value))||(this.FDeItem.SetValue(cS,CS),this.FDeItem.SetValue(mS,this.FGridDomain.rows[s][2].value),""!=this.FGridDomain.rows[s][5].value&&this.SetDeItemExtraValue(this.FGridDomain.rows[s][3].value))}else{if(this.DomainNoItemSelectStop)return;t=this._initDEText()}t||(this.visible=!1,this.doItemPopupSetClose())}},{key:"btnDateTimeOkClick",value:function(){""!=this.dtpDateTime.text&&(this.SetDeItemValue(this.dtpDateTime.text)||(this.visible=!1,this.doItemPopupSetClose()))}},{key:"doNumberValueKeyDonw",value:function(t){t.keyCode==be&&this.doNumberOk()}},{key:"doMemoValueKeyDown",value:function(t){t.keyCode==be&&this.doMemoOK()}},{key:"doGridDomainKeyDown",value:function(t){t.keyCode==be?this.btnDomainOKClick():t.keyCode==Te&&(this.FGridDomain.col=0,this.doGridDomainClick())}},{key:"_trunStringPage",value:function(t){this.pageIndex=2,this.width=200,this.height=60,this.memo.text=t,""!=this.memo.text&&this.memo.select(0,this.memo.text.length),this.memo.setFocus()}},{key:"_popupShow",value:function(t,e){t+this.width>this.parent.width&&(t=this.parent.width-this.width),t<0&&(t=0),e+this.height>this.parent.height&&(e=this.parent.height-this.height),e<0&&(e=0),this.left=t,this.top=e,this.visible=!0}},{key:"_showPopupDeItem",value:function(t,e){this.FFrmtp=DS;var i="",n="";if(""!=t){var o=JSON.parse(t);this.FFrmtp=o.Frmtp,i=o.Unit,n=o.CMV}if(this.FFrmtp==PS){if(this.FTemplate=!1,this.FTemp=!1,this.FConCalcValue=!1,""!=this.FDeItem.GetValue(uS)?this.edtValue.text=this.FDeItem.Text.replace(new RegExp(this.FDeItem.GetValue(uS),"g"),""):this.edtValue.text=this.FDeItem.Text,""!=this.edtValue.text&&this.edtValue.selectAll(),this.cbbUnit.items.clear(),i)for(var r=i.split(","),s=0;s<r.length;s++)""!=r[s]&&this.cbbUnit.items.add(r[s]);else console.log(this.FDeItem.Index+" 数值元素缺少单位!");this.cbbUnit.items.count>0?(this.cbbUnit.itemIndex=this.cbbUnit.items.indexOf(this.FDeItem.GetValue(uS)),this.cbbUnit.itemIndex<0&&(this.cbbUnit.itemIndex=0)):this.cbbUnit.text=this.FDeItem.GetValue(uS),this.chkHideUnit.checked="1"==this.FDeItem.GetValue(fS),this.pageIndex=1,this.width=185,this.height=100}else if(this.FFrmtp==bS||this.FFrmtp==RS||this.FFrmtp==_S){this.pageIndex=3,this.dtpDateTime.dateTime=X.CreateByString(this.FDeItem.Text),this.dtCalc.dateTime=X.CreateByString(this.FDeItem.Text),this.width=200,this.height=275,or.emrCommon.disPopupDateTimeFormat?this.cbbDTFmt.enabled=!1:this.cbbDTFmt.enabled=!0;var a=this.FDeItem.GetValue(yS);""!=a?this.cbbDTFmt.text=a:this.FFrmtp==bS?this.cbbDTFmt.text=or.emrCommon.dateFormatDef:this.FFrmtp==RS?this.cbbDTFmt.text=or.emrCommon.timeFormatDef:this.cbbDTFmt.text=or.emrCommon.dateFormatDef+" "+or.emrCommon.timeFormatDef,this.dtpDateTime.format=this.cbbDTFmt.text}else if(this.FFrmtp==CS||this.FFrmtp==kS){this.beginUpdate();try{this.pageIndex=0,this.width=250,this.height=this.FDomainMinH,this.lblWait.visible_=!0,this.FGridDomain.visible_=!1,this._popupShow(e.x,e.y)}finally{this.endUpdate()}this.beginUpdate();try{if(this.MultSelect=this.FFrmtp==kS,this.edtFilter.clear(),this.FGridDomain.rowCount>1&&(this.FGridDomain.rowCount=1),""!=n){if(null!=this.OnPopupGetDeItemDomainLib){var l=this.OnPopupGetDeItemDomainLib(n);return null!==l&&this.IniDomainUIByJSON(l),!0}this.lblWait.visible_=!1}}finally{this.endUpdate()}}else{if(this.FFrmtp!=DS)return!1;this._trunStringPage(this.FDeItem.Text)}return this._popupShow(e.x,e.y),this.FFrmtp==PS?this.edtValue.setFocus():this.FFrmtp==DS&&this.memo.setFocus(),!0}},{key:"PopupDeItem",value:function(t,e){return this.MultSelect=!1,this.FDeItem=t,this.FFrmtp="",null!=this.OnPopupGetDeItemInfoLib&&this.OnPopupGetDeItemInfoLib(t),this._showPopupDeItem("{"+t.ToJSONString()+"}",e)}},{key:"SetDeItemValue",value:function(t){return null!=this.OnSetPopupItemText&&this.OnSetPopupItemText(this.FDeItem,t)}},{key:"SetDeItemExtraValue",value:function(t){if(null!=this.OnPopupGetDomainItemExtraLib)this.OnPopupGetDomainItemExtraLib(this.FDeItem,t);else if(null!=this.OnSetActiveItemExtra&&(this.FDBDomain.select("id="+t),this.FDBDomain.count>0)){var e=new K;this.FDBDomain[0].fieldByName("content").saveToStream(e),e.position=0,this.OnSetActiveItemExtra(this.FDeItem,e)}}},{key:"_initDEText",value:function(){var t=this.FDeItem.GetValue(hS);this.FDeItem.Propertys.remove(mS);var e=this.SetDeItemValue(t);return this.FDeItem.AllocValue=!1,e}},{key:"SetMultSelect",value:function(t){if(this.FMultSelect!=t){this.beginUpdate();try{this.FMultSelect=t,this.FMultSelect?(this.cbbItemSplit.text=r.MultItemSpliter,this.FGridDomain.setColWidth(0,20),this.pnlDomain.height=54,this.height+=24,this.btnRM.text="单选"):(this.FGridDomain.setColWidth(0,0),this.pnlDomain.height=30,this.height-=24,this.btnRM.text="多选"),this.FGridDomain.setFocus()}finally{this.endUpdate()}}}},{key:"MultSelect",get:function(){return this.FMultSelect},set:function(t){this.SetMultSelect(t)}}])&&ZS(e.prototype,i),n&&ZS(e,n),r}(On);function iv(t){return(iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nv(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ov(t,e,i){return(ov="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=lv(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function rv(t,e){return(rv=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function sv(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=lv(t);if(e){var o=lv(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return av(this,i)}}function av(t,e){return!e||"object"!==iv(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function lv(t){return(lv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ev.MultItemSpliter=";";var hv=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&rv(t,e)}(r,t);var e,i,n,o=sv(r);function r(t,e,i,n,s){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(a=o.call(this,t,e,i,n,s)).StyleNo=Lp.EMRSTYLE_FANGJIAO,a.FMouseIn=!1,a}return e=r,(i=[{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){if(this.Active&&!a.Print&&(s.brush.color=lp.clBtnFace,s.fillRect(e)),t.TextStyles[this.TextStyleNo].ApplyStyle(s,a.ScaleY/a.Zoom),s.textOut(e.left+this.LeftRect.left,e.top+this.LeftRect.top,this.LeftText),s.textOut(e.left+this.TopRect.left,e.top+this.TopRect.top,this.TopText),s.textOut(e.left+this.RightRect.left,e.top+this.RightRect.top,this.RightText),s.textOut(e.left+this.BottomRect.left,e.top+this.BottomRect.top,this.BottomText),s.pen.color=at.Black,s.drawLineDriect(e.left,e.top,e.right,e.bottom),s.drawLineDriect(e.right,e.top,e.left,e.bottom),!a.Print){var l=new U;if(this.FMouseIn&&(s.pen.color=at.Gray,l.resetRect(this.LeftRect),l.offset(e.left,e.top),l.inFlate(2,2),s.rectangleRect(l),l.resetRect(this.TopRect),l.offset(e.left,e.top),l.inFlate(2,2),s.rectangleRect(l),l.resetRect(this.RightRect),l.offset(e.left,e.top),l.inFlate(2,2),s.rectangleRect(l),l.resetRect(this.BottomRect),l.offset(e.left,e.top),l.inFlate(2,2),s.rectangleRect(l)),this.FActiveArea!=up.None){switch(this.FActiveArea){case up.Left:l.resetRect(this.LeftRect);break;case up.Top:l.resetRect(this.TopRect);break;case up.Right:l.resetRect(this.RightRect);break;default:l.resetRect(this.BottomRect)}l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=at.Blue,s.rectangleRect(l)}}}},{key:"MouseEnter",value:function(){ov(lv(r.prototype),"MouseEnter",this).call(this),this.FMouseIn=!0}},{key:"MouseLeave",value:function(){ov(lv(r.prototype),"MouseLeave",this).call(this),this.FMouseIn=!1}},{key:"ToXmlEmr",value:function(t){}},{key:"ParseXmlEmr",value:function(t){}}])&&nv(e.prototype,i),n&&nv(e,n),r}(xu);function cv(t){return(cv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uv(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function fv(t,e,i){return e&&uv(t.prototype,e),i&&uv(t,i),t}function dv(t,e,i){return(dv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=vv(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function mv(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yv(t,e)}function yv(t,e){return(yv=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function pv(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=vv(t);if(e){var o=vv(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Sv(this,i)}}function Sv(t,e){return!e||"object"!==cv(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function vv(t){return(vv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Fv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Iv=function t(){Fv(this,t)};Iv.Index="Index",Iv.Code="Code",Iv.Name="Name",Iv.SubType="RT",Iv.Prompt="Prompt",Iv.Title="Title",Iv.Propertys="Propertys",Iv.EndRestrain="EndRestrain",Iv.BeginRestrain="BeginRestrain";var gv=function t(){Fv(this,t)};gv.Proc="P";var wv=function(t){mv(i,t);var e=pv(i);function i(t){var n;return Fv(this,i),(n=e.call(this,t)).FChanged=!1,n.FReadOnly=!1,n.FTitle="",n.FPrompt="",n.FTextStyleNo=cs.Domain,n.FEndRestrain=!1,n.FBeginRestrain=!1,lp.PROCSERIES&&(n.FIsProc=!1),n.FPropertys=new z,n}return fv(i,[{key:"GetValue",value:function(t){var e=this.FPropertys.valueByKey(t);return null!=e?e:""}},{key:"SetValue",value:function(t,e){(e=e.toString()).indexOf("=")>=0?or.exception("属性值中不允许有=号"):this.FPropertys.setValue(t,e)}},{key:"GetIsProcBegin",value:function(){return this.MarkType==Pp.Beg&&this.FIsProc}},{key:"GetIsProcEnd",value:function(){return this.MarkType==Pp.End&&this.FIsProc}},{key:"DoPaint",value:function(t,e,n,o,r,s,a,l){if(dv(vv(i.prototype),"DoPaint",this).call(this,t,e,n,o,r,s,a,l),this.MarkType==Pp.Beg){var h=0;""!=this.FTitle&&(this.Selected()||(a.brush.style=Ft),t.TextStyles[this.FTextStyleNo].ApplyStyle(a,l.ScaleY/l.Zoom),a.textOut(e.left,e.top,this.FTitle),h=a.textMetric(this.FTitle).width),this.Empty&&""!=this.FPrompt&&(this.Selected()||(this.Active?(a.brush.color=t.SelColor,a.fillRect(U.Create(e.left+h,e.top,e.right,e.bottom))):a.brush.style=Ft),t.TextStyles[this.FTextStyleNo].ApplyStyle(a,l.ScaleY/l.Zoom),a.font.styles.add(ht.Italic),a.font.color=at.Gray,a.textOut(e.left+h,e.top,this.FPrompt))}}},{key:"SaveToStreamRange",value:function(t,e,n){dv(vv(i.prototype),"SaveToStreamRange",this).call(this,t,e,n),t.writeInt32(this.FTextStyleNo),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"LoadFromStream",value:function(t,e,n){dv(vv(i.prototype),"LoadFromStream",this).call(this,t,e,n),n>51&&(this.FTextStyleNo=t.readInt32(),this.OwnerData.Style.States.Contain(Ip.Loading)||(this.FTextStyleNo=null!=e?this.OwnerData.Style.GetStyleNo(e.TextStyles[this.FTextStyleNo],!0):0));var o=lp.HCLoadTextFromStream(t,n);lp.SetPropertyString(o,this.FPropertys),this.CheckPropertys()}},{key:"Assign",value:function(t){dv(vv(i.prototype),"Assign",this).call(this,t);var e=lp.GetPropertyString(t.Propertys);this.FReadOnly=t.ReadOnly,lp.SetPropertyString(e,this.FPropertys),this.CheckPropertys()}},{key:"MatchTextStyle",value:function(t,e){return e.Append=!e.StyleHasMatch(t,this.FTextStyleNo),!0}},{key:"ApplySelectTextStyle",value:function(t,e){this.FTextStyleNo=e.GetMatchStyleNo(t,this.FTextStyleNo)}},{key:"MarkStyleUsed",value:function(t){t?this.OwnerData.Style.TextStyles[this.FTextStyleNo].CheckSaveUsed=!0:this.FTextStyleNo=this.OwnerData.Style.TextStyles[this.FTextStyleNo].TempNo}},{key:"FormatToDrawItem",value:function(t,e){if(this.Width=0,this.FTextStyleNo<cs.Null)if(this.OwnerData.Style.States.Contain(Ip.Loading)){var i=new Er;this.FTextStyleNo=t.Style.GetStyleNo(i,!0),i=null}else this.FTextStyleNo=t.Style.GetDefaultStyleNo();t.Style.ApplyTempStyle(this.FTextStyleNo),this.Height=t.CalculateLineHeight(t.Style.TextStyles[this.FTextStyleNo],t.Style.ParaStyles[this.ParaNo])-t.Style.LineSpaceMin,this.Empty=!1;var n=null;if(this.MarkType==Pp.Beg){e<t.Items.count-1?(n=t.Items[e+1]).StyleNo==this.StyleNo&&n.MarkType==Pp.End?(this.Width=10,this.Empty=!0):n.ParaFirst&&(this.Width=10):this.Width=10;var o=0;""!=this.FTitle&&(o=t.Style.TempCanvas.textMetric(this.FTitle).width),this.Empty&&""!=this.FPrompt&&(o+=t.Style.TempCanvas.textMetric(this.FPrompt).width),0!=o&&(this.Width=o)}else(n=t.Items[e-1]).StyleNo==this.StyleNo&&n.MarkType==Pp.Beg?(this.Width=10,this.Empty=!0):this.ParaFirst&&(this.Width=10)}},{key:"PaintTop",value:function(t){t.pen.width=1;var e=(this.FDrawRect.height-this.OwnerData.Style.TextStyles[this.FTextStyleNo].FontHeight)/2;this.MarkType==Pp.Beg?(t.pen.width=1,t.pen.style=pt.Solid,t.pen.color=at.Blue,t.drawLineByPointsDriect(new Array(G.Create(this.FDrawRect.left+3,this.FDrawRect.top+e),G.Create(this.FDrawRect.left,this.FDrawRect.top+e),G.Create(this.FDrawRect.left,this.FDrawRect.bottom-e))),t.moveTo(this.FDrawRect.left,this.FDrawRect.bottom-e),t.lineTo(this.FDrawRect.left+3,this.FDrawRect.bottom-e)):(t.pen.width=1,t.pen.style=pt.Solid,t.pen.color=at.Blue,t.drawLineByPointsDriect(new Array(G.Create(this.FDrawRect.right-3,this.FDrawRect.top+e),G.Create(this.FDrawRect.right,this.FDrawRect.top+e),G.Create(this.FDrawRect.right,this.FDrawRect.bottom-e))),t.moveTo(this.FDrawRect.right,this.FDrawRect.bottom-e),t.lineTo(this.FDrawRect.right-3,this.FDrawRect.bottom-e))}},{key:"GetOffsetAt",value:function(t){return this.FBeginRestrain&&this.MarkType==Pp.Beg?lp.OffsetAfter:this.FEndRestrain&&this.MarkType==Pp.End?lp.OffsetBefor:lp.PROCSERIES?this.GetIsProcEnd()?lp.OffsetBefor:this.GetIsProcBegin()?lp.OffsetAfter:dv(vv(i.prototype),"GetOffsetAt",this).call(this,t):dv(vv(i.prototype),"GetOffsetAt",this).call(this,t)}},{key:"ToXml",value:function(t){dv(vv(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){dv(vv(i.prototype),"ParseXml",this).call(this,t)}},{key:"ToJSONString",value:function(){for(var t,e="",n=0;n<this.FPropertys.count;n++)""!=(t=this.FPropertys[n]).key&&(""!=e&&(e+=","),e+='"'+t.key+'":"'+t.val+'"');return""!=e?dv(vv(i.prototype),"ToJSONString",this).call(this)+","+e:dv(vv(i.prototype),"ToJSONString",this).call(this)}},{key:"ParseJSONOjbect",value:function(t){dv(vv(i.prototype),"ParseJSONOjbect",this).call(this,t),t.index?this.SetValue(aS,t.index):this.FPropertys.remove(aS)}},{key:"CheckPropertys",value:function(){this.FBeginRestrain="1"==this.GetValue(Iv.BeginRestrain),this.FEndRestrain="1"==this.GetValue(Iv.EndRestrain),this.FTitle=this.GetValue(Iv.Title),this.FPrompt=this.GetValue(Iv.Prompt),lp.PROCSERIES&&(this.FIsProc=this.GetValue(Iv.SubType)==gv.Proc)}},{key:"Index",get:function(){return this.GetValue(Iv.Index)}},{key:"Code",get:function(){return this.GetValue(Iv.Code)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,Iv.Code):this.SetValue(lS,t)}},{key:"Name",get:function(){return this.GetValue(hS)},set:function(t){""==t?lp.HCRemoveProperty(this.FPropertys,hS):this.SetValue(hS,t)}},{key:"TextStyleNo",get:function(){return this.FTextStyleNo},set:function(t){this.FTextStyleNo=t}},{key:"Propertys",get:function(){return this.FPropertys}},{key:"ReadOnly",get:function(){return this.FReadOnly},set:function(t){this.FReadOnly=t}},{key:"Changed",get:function(){return this.FChanged},set:function(t){this.FChanged=t}},{key:"IsProc",get:function(){return this.FIsProc}},{key:"IsProcBegin",get:function(){return this.GetIsProcBegin()}},{key:"IsProcEnd",get:function(){return this.GetIsProcEnd()}}]),i}(za),Cv=function(t){mv(i,t);var e=pv(i);function i(){var t;return Fv(this,i),(t=e.call(this)).Clear(),t}return fv(i,[{key:"Clear",value:function(){this.Index="",this.SectionIndex=-1,dv(vv(i.prototype),"Clear",this).call(this)}},{key:"Assign",value:function(t){dv(vv(i.prototype),"Assign",this).call(this,t),this.Index=t.Index,this.SectionIndex=t.SectionIndex}}]),i}(ql);function kv(t){return(kv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pv(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Dv(t,e,i){return(Dv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xv(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function bv(t,e){return(bv=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Rv(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=xv(t);if(e){var o=xv(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return _v(this,i)}}function _v(t,e){return!e||"object"!==kv(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function xv(t){return(xv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Av=0,Tv=1,Ov=2,Nv=3,Bv=4,Ev=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bv(t,e)}(r,t);var e,i,n,o=Rv(r);function r(t,e,i,n,s){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(a=o.call(this,t)).StyleNo=Lp.EMRSTYLE_TOOTH,a.FPadding=2,a.FActiveArea=Av,a.FMouseMoveArea=Av,a.FCaretOffset=-1,a.FEmptyLower=!0,a.FMouseLBDowning=!1,a.FOutSelectInto=!1,a.AreaMinSize=5,a.FLeftTopText=e,a.FLeftBottomText=n,a.FRightTopText=i,a.FRightBottomText=s,a.FLeftTopRect=new U,a.FLeftBottomRect=new U,a.FRightTopRect=new U,a.FRightBottomRect=new U,a}return e=r,(i=[{key:"GetToothArea",value:function(t,e){return this.FLeftTopRect.pointInAt(t,e)?Tv:this.FLeftBottomRect.pointInAt(t,e)?Nv:this.FRightTopRect.pointInAt(t,e)?Ov:this.FRightBottomRect.pointInAt(t,e)?Bv:Av}},{key:"DoPaint",value:function(t,e,i,n,o,r,s,a){if(this.Active&&!a.Print&&(s.brush.color=lp.clBtnFace,s.fillRect(e)),t.TextStyles[this.TextStyleNo].ApplyStyle(s,a.ScaleY/a.Zoom),""!=this.FLeftTopText&&s.textOut(e.left+this.FLeftTopRect.left,e.top+this.FLeftTopRect.top,this.FLeftTopText),""!=this.FLeftBottomText&&s.textOut(e.left+this.FLeftBottomRect.left,e.top+this.FLeftBottomRect.top,this.FLeftBottomText),""!=this.FRightTopText&&s.textOut(e.left+this.FRightTopRect.left,e.top+this.FRightTopRect.top,this.FRightTopText),""!=this.FRightBottomText&&s.textOut(e.left+this.FRightBottomRect.left,e.top+this.FRightBottomRect.top,this.FRightBottomText),s.pen.color=at.Black,s.pen.width=1,""==this.FLeftTopText&&""==this.FLeftBottomText?s.drawLineDriect(e.left+this.FLeftTopRect.right+this.FPadding,e.top+this.FLeftTopRect.bottom+this.FPadding,e.right,e.top+this.FLeftTopRect.bottom+this.FPadding):""==this.FRightTopText&&""==this.FRightBottomText?s.drawLineDriect(e.left,e.top+this.FLeftTopRect.bottom+this.FPadding,e.left+this.FLeftTopRect.right+this.FPadding,e.top+this.FLeftTopRect.bottom+this.FPadding):s.drawLineDriect(e.left,e.top+this.FLeftTopRect.bottom+this.FPadding,e.right,e.top+this.FLeftTopRect.bottom+this.FPadding),""==this.FLeftTopText&&""==this.FRightTopText?s.drawLineDriect(e.left+this.FLeftTopRect.right+this.FPadding,e.top+this.FLeftTopRect.bottom+this.FPadding,e.left+this.FLeftTopRect.right+this.FPadding,e.bottom):""==this.FLeftBottomText&&""==this.FRightBottomText?s.drawLineDriect(e.left+this.FLeftTopRect.right+this.FPadding,e.top,e.left+this.FLeftTopRect.right+this.FPadding,e.top+this.FLeftTopRect.bottom+this.FPadding+1):s.drawLineDriect(e.left+this.FLeftTopRect.right+this.FPadding,e.top,e.left+this.FLeftTopRect.right+this.FPadding,e.bottom),!a.Print){var l=new U;if(this.FActiveArea!=Av){switch(this.FActiveArea){case Tv:l.resetRect(this.FLeftTopRect);break;case Nv:l.resetRect(this.FLeftBottomRect);break;case Ov:l.resetRect(this.FRightTopRect);break;case Bv:l.resetRect(this.FRightBottomRect)}l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=at.Blue,s.rectangleRect(l)}if(this.FMouseMoveArea!=Av&&this.FMouseMoveArea!=this.FActiveArea){switch(this.FMouseMoveArea){case Tv:l.resetRect(this.FLeftTopRect);break;case Nv:l.resetRect(this.FLeftBottomRect);break;case Ov:l.resetRect(this.FRightTopRect);break;case Bv:l.resetRect(this.FRightBottomRect)}l.offset(e.left,e.top),l.inFlate(2,2),s.pen.color=at.LightGray,s.rectangleRect(l)}}}},{key:"SetActive",value:function(t){Dv(xv(r.prototype),"SetActive",this).call(this,t),t||(this.FActiveArea=Av,this.FCaretOffset=-1)}},{key:"FormatToDrawItem",value:function(t,e){var i=t.Style;i.ApplyTempStyle(this.TextStyleNo);var n=i.TextStyles[this.TextStyleNo].FontHeight,o=Math.max(i.TempCanvas.textWidth(this.FLeftTopText),this.FPadding),r=Math.max(i.TempCanvas.textWidth(this.FLeftBottomText),this.FPadding),s=Math.max(i.TempCanvas.textWidth(this.FRightTopText),this.FPadding),a=Math.max(i.TempCanvas.textWidth(this.FRightBottomText),this.FPadding),l=4*this.FPadding;l+=o>r?o:r,l+=s>a?s:a,this.Width=l,this.Height=2*n+4*this.FPadding,o>r?(this.FLeftTopRect.resetBounds(this.FPadding,this.FPadding,o,n),this.FLeftBottomRect.resetBounds(this.FPadding,this.Height-this.FPadding-n,o,n)):(this.FLeftTopRect.resetBounds(this.FPadding,this.FPadding,r,n),this.FLeftBottomRect.resetBounds(this.FPadding,this.Height-this.FPadding-n,r,n)),s>a?(this.FRightTopRect.resetBounds(this.FLeftTopRect.right+this.FPadding+this.FPadding,this.FPadding,s,n),this.FRightBottomRect.resetBounds(this.FLeftTopRect.right+this.FPadding+this.FPadding,this.Height-this.FPadding-n,s,n)):(this.FRightTopRect.resetBounds(this.FLeftTopRect.right+this.FPadding+this.FPadding,this.FPadding,a,n),this.FRightBottomRect.resetBounds(this.FLeftTopRect.right+this.FPadding+this.FPadding,this.Height-this.FPadding-n,a,n)),this.FEmptyLower&&(n=0,""==this.FLeftTopText&&""==this.FRightTopText&&(n=this.FLeftTopRect.height-this.AreaMinSize,this.FLeftTopRect.height=this.AreaMinSize,this.FRightTopRect.height=this.AreaMinSize,this.FLeftBottomRect.offset(0,-n),this.FRightBottomRect.offset(0,-n)),""==this.FLeftBottomText&&""==this.FRightBottomText&&(n=n+this.FLeftBottomRect.height-this.AreaMinSize,this.FLeftBottomRect.height=this.AreaMinSize,this.FRightBottomRect.height=this.AreaMinSize),this.Height=this.Height-n)}},{key:"GetOffsetAt",value:function(t){return this.FOutSelectInto?Dv(xv(r.prototype),"GetOffsetAt",this).call(this,t):t<=0?lp.OffsetBefor:t>=this.Width?lp.OffsetAfter:lp.OffsetInner}},{key:"MouseLeave",value:function(){Dv(xv(r.prototype),"MouseLeave",this).call(this),this.FMouseMoveArea=Av}},{key:"MouseDown",value:function(t){var e=Dv(xv(r.prototype),"MouseDown",this).call(this,t);this.FMouseLBDowning=t.button==ee,this.FOutSelectInto=!1,this.FMouseMoveArea!=this.FActiveArea&&(this.FActiveArea=this.FMouseMoveArea,this.OwnerData.Style.UpdateInfoReCaret());var i="",n=-1;switch(this.FActiveArea){case Tv:i=this.FLeftTopText,n=t.x-this.FLeftTopRect.left;break;case Nv:i=this.FLeftBottomText,n=t.x-this.FLeftBottomRect.left;break;case Ov:i=this.FRightTopText,n=t.x-this.FRightTopRect.left;break;case Bv:i=this.FRightBottomText,n=t.x-this.FRightBottomRect.left}var o=0;return this.FActiveArea!=Av?(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),o=lp.GetNorAlignCharOffsetAt(this.OwnerData.Style.TempCanvas,i,n)):o=-1,o!=this.FCaretOffset&&(this.FCaretOffset=o,this.OwnerData.Style.UpdateInfoReCaret()),e}},{key:"MouseMove",value:function(t){if(this.FMouseLBDowning||t.button!=ee||(this.FOutSelectInto=!0),this.FOutSelectInto)this.FMouseMoveArea=Av;else{var e=this.GetToothArea(t.x,t.y);e!=this.FMouseMoveArea&&(this.FMouseMoveArea=e,this.OwnerData.Style.UpdateInfoRePaint())}return Dv(xv(r.prototype),"MouseMove",this).call(this,t)}},{key:"MouseUp",value:function(t){return this.FMouseLBDowning=!1,this.FOutSelectInto=!1,Dv(xv(r.prototype),"MouseUp",this).call(this,t)}},{key:"WantKeyDown",value:function(t){var e=!1;return t.keyCode==Be?this.FActiveArea==Tv&&0==this.FCaretOffset?e=!1:this.FActiveArea==Av?(this.FActiveArea=Bv,this.FCaretOffset=this.FRightBottomText.length,e=!0):e=!0:t.keyCode==Me?this.FActiveArea==Bv&&this.FCaretOffset==this.FRightBottomText.length?e=!1:this.FActiveArea==Av?(this.FActiveArea=Tv,this.FCaretOffset=0,e=!0):e=!0:e=!0,e}},{key:"BackDeleteChar",value:function(t){return this.FCaretOffset>0&&(t=C.stringDelete(t,this.FCaretOffset-1,1),this.FCaretOffset--),t}},{key:"BackspaceKeyDown",value:function(){switch(this.FActiveArea){case Tv:this.FLeftTopText=this.BackDeleteChar(this.FLeftTopText);break;case Nv:this.FLeftBottomText=this.BackDeleteChar(this.FLeftBottomText);break;case Ov:this.FRightTopText=this.BackDeleteChar(this.FRightTopText);break;case Bv:this.FRightBottomText=this.BackDeleteChar(this.FRightBottomText)}this.FormatDirty()}},{key:"LeftKeyDown",value:function(){if(this.FCaretOffset>0)this.FCaretOffset--;else if(this.FActiveArea>Tv){var t=this.FActiveArea-1;if(this.FActiveArea!=t){switch(this.FActiveArea=t,this.FActiveArea){case Tv:this.FCaretOffset=this.FLeftTopText.length;break;case Nv:this.FCaretOffset=this.FLeftBottomText.length;break;case Ov:this.FCaretOffset=this.FRightTopText.length;break;case Bv:this.FCaretOffset=this.FRightBottomText.length}this.OwnerData.Style.UpdateInfoRePaint()}}}},{key:"RightKeyDown",value:function(){var t="";switch(this.FActiveArea){case Tv:t=this.FLeftTopText;break;case Nv:t=this.FLeftBottomText;break;case Ov:t=this.FRightTopText;break;case Bv:t=this.FRightBottomText}if(this.FCaretOffset<t.length)this.FCaretOffset++;else if(this.FActiveArea<Bv){var e=this.FActiveArea+1;this.FActiveArea!=e&&(this.FActiveArea=e,this.FCaretOffset=0,this.OwnerData.Style.UpdateInfoRePaint())}}},{key:"UpKeyDown",value:function(){this.FActiveArea==Nv?(this.FActiveArea=Tv,this.FCaretOffset=0,this.OwnerData.Style.UpdateInfoRePaint()):this.FActiveArea==Bv&&(this.FActiveArea=Ov,this.FCaretOffset=0,this.OwnerData.Style.UpdateInfoRePaint())}},{key:"DownKeyDown",value:function(){this.FActiveArea==Tv?(this.FActiveArea=Nv,this.FCaretOffset=0,this.OwnerData.Style.UpdateInfoRePaint()):this.FActiveArea==Ov&&(this.FActiveArea=Bv,this.FCaretOffset=0,this.OwnerData.Style.UpdateInfoRePaint())}},{key:"DeleteChar",value:function(t){return this.FCaretOffset<t.length&&(t=C.stringDelete(t,this.FCaretOffset+1-1,1)),t}},{key:"DeleteKeyDown",value:function(){switch(this.FActiveArea){case Tv:this.FLeftTopText=this.DeleteChar(this.FLeftTopText);break;case Nv:this.FLeftBottomText=this.DeleteChar(this.FLeftBottomText);break;case Ov:this.FRightTopText=this.DeleteChar(this.FRightTopText);break;case Bv:this.FRightBottomText=this.DeleteChar(this.FRightBottomText)}this.FormatDirty()}},{key:"HomeKeyDown",value:function(){this.FCaretOffset=0}},{key:"EndKeyDown",value:function(){var t="";switch(this.FActiveArea){case Tv:t=this.FLeftTopText;break;case Nv:t=this.FLeftBottomText;break;case Ov:t=this.FRightTopText;break;case Bv:t=this.RightBottomText}this.FCaretOffset=t.length}},{key:"KeyDown",value:function(t){switch(t.keyCode){case Pe:this.BackspaceKeyDown();break;case Be:this.LeftKeyDown();break;case Me:this.RightKeyDown();break;case Ee:this.UpKeyDown();break;case Le:this.DownKeyDown();break;case Ge:this.DeleteKeyDown();break;case Ne:this.HomeKeyDown();break;case Oe:this.EndKeyDown()}}},{key:"KeyPress",value:function(t){this.FActiveArea!=Av?this.InsertText(t):t=0}},{key:"InsertText",value:function(t){if(this.FActiveArea!=Av){switch(this.FActiveArea){case Tv:this.FLeftTopText=C.stringInsert(this.FLeftTopText,this.FCaretOffset+1-1,t);break;case Nv:this.FLeftBottomText=C.stringInsert(this.FLeftBottomText,this.FCaretOffset+1-1,t);break;case Ov:this.FRightTopText=C.stringInsert(this.FRightTopText,this.FCaretOffset+1-1,t);break;case Bv:this.FRightBottomText=C.stringInsert(this.FRightBottomText,this.FCaretOffset+1-1,t)}return this.FCaretOffset+=t.length,this.FormatDirty(),!0}return!1}},{key:"GetCaretInfo",value:function(t){if(this.FActiveArea!=Av)switch(this.OwnerData.Style.ApplyTempStyle(this.TextStyleNo),this.FActiveArea){case Tv:t.Height=this.FLeftTopRect.bottom-this.FLeftTopRect.top,""!=this.FLeftTopText?t.X=this.FLeftTopRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FLeftTopText.substr(0,this.FCaretOffset)):t.X=this.FLeftTopRect.left,t.Y=this.FLeftTopRect.top;break;case Nv:t.Height=this.FLeftBottomRect.bottom-this.FLeftBottomRect.top,""!=this.FLeftBottomText?t.X=this.FLeftBottomRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FLeftBottomText.substr(0,this.FCaretOffset)):t.X=this.FLeftBottomRect.left,t.Y=this.FLeftBottomRect.top;break;case Ov:t.Height=this.FRightTopRect.bottom-this.FRightTopRect.top,""!=this.FRightTopText?t.X=this.FRightTopRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FRightTopText.substr(0,this.FCaretOffset)):t.X=this.FRightTopRect.left,t.Y=this.FRightTopRect.top;break;case Bv:t.Height=this.FRightBottomRect.bottom-this.FRightBottomRect.top,""!=this.FRightBottomText?t.X=this.FRightBottomRect.left+this.OwnerData.Style.TempCanvas.textWidth(this.FRightBottomText.substr(0,this.FCaretOffset)):t.X=this.FRightBottomRect.left,t.Y=this.FRightBottomRect.top}else t.Visible=!1}},{key:"SaveToStreamRange",value:function(t,e,i){Dv(xv(r.prototype),"SaveToStreamRange",this).call(this,t,e,i),lp.HCSaveTextToStream(t,this.FLeftTopText),lp.HCSaveTextToStream(t,this.FLeftBottomText),lp.HCSaveTextToStream(t,this.FRightTopText),lp.HCSaveTextToStream(t,this.FRightBottomText)}},{key:"LoadFromStream",value:function(t,e,i){Dv(xv(r.prototype),"LoadFromStream",this).call(this,t,e,i),this.FLeftTopText=lp.HCLoadTextFromStream(t,i),this.FLeftBottomText=lp.HCLoadTextFromStream(t,i),this.FRightTopText=lp.HCLoadTextFromStream(t,i),this.FRightBottomText=lp.HCLoadTextFromStream(t,i)}},{key:"ToXml",value:function(t){Dv(xv(r.prototype),"ToXml",this).call(this,t),this.ToXmlEmr(t)}},{key:"ParseXml",value:function(t){Dv(xv(r.prototype),"ParseXml",this).call(this,t),this.ParseXmlEmr(t)}},{key:"ToXmlEmr",value:function(t){}},{key:"ParseXmlEmr",value:function(t){}},{key:"LeftTopText",get:function(){return this.FLeftTopText},set:function(t){this.FLeftTopText=t}},{key:"LeftBottomText",get:function(){return this.FLeftBottomText},set:function(t){this.FLeftBottomText=t}},{key:"RightTopText",get:function(){return this.FRightTopText},set:function(t){this.FRightTopText=t}},{key:"RightBottomText",get:function(){return this.FRightBottomText},set:function(t){this.FRightBottomText=t}}])&&Pv(e.prototype,i),n&&Pv(e,n),r}(Ya);function Mv(t){return(Mv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lv(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Gv(t,e,i){return(Gv="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Wv(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Hv(t,e){return(Hv=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Uv(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Wv(t);if(e){var o=Wv(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Vv(this,i)}}function Vv(t,e){return!e||"object"!==Mv(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Wv(t){return(Wv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function zv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var jv=function t(){zv(this,t),this.tag=0,this.position=0,this.height=0},Xv=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Hv(t,e)}(r,t);var e,i,n,o=Uv(r);function r(){var t;return zv(this,r),(t=o.call(this)).rightBlank_=40,t.FAreaMarks=new V,t.OnPageUpClick=null,t.OnPageDownClick=null,t}return e=r,(i=[{key:"_getAreaMarkByTag",value:function(t){for(var e=-1,i=0;i<this.FAreaMarks.count;i++)if(this.FAreaMarks[i].tag==t){e=i;break}return e}},{key:"_getAreaMarkRect",value:function(t){var e=new U;if(this.orientation==Jt){var i=this.leftBlank_+this.buttonSize+Math.round(this.FAreaMarks[t].position*this.precent_),n=Math.round(this.FAreaMarks[t].height*this.precent_);n<2&&(n=2),e.resetBounds(0,i,this.width,n)}return e}},{key:"doDrawThumBefor_",value:function(t,e){if(this.orientation==Jt&&this.FAreaMarks.count>0){var i;t.brush.color="rgb(82, 89, 107)";for(var n=0;n<this.FAreaMarks.count;n++)(i=this._getAreaMarkRect(n)).bottom>this.leftBlank_+this.buttonSize&&i.top<this.height-this.rightBlank_-this.buttonSize&&t.fillRect(i)}}},{key:"doMouseDown_",value:function(t){if(Gv(Wv(r.prototype),"doMouseDown_",this).call(this,t),!this.thumRect_.pointIn(this.mouseDownPt_)&&this.orientation==Jt&&this.FAreaMarks.count>0)for(var e,i=0;i<this.FAreaMarks.count;i++)if((e=this._getAreaMarkRect(i)).pointIn(this.mouseDownPt_)){this.position=this.FAreaMarks[i].position-e.top;break}}},{key:"doMouseUp_",value:function(t){Gv(Wv(r.prototype),"doMouseUp_",this).call(this,t),this.orientation==Jt&&(U.CreateByBounds(2,this.height-this.rightBlank_+2,16,16).pointInAt(t.x,t.y)?null!=this.OnPageUpClick&&this.OnPageUpClick(this):U.CreateByBounds(2,this.height-this.rightBlank_+2+16+2,16,16).pointInAt(t.x,t.y)&&null!=this.OnPageDownClick&&this.OnPageDownClick(this))}},{key:"paintToEx",value:function(t){if(Gv(Wv(r.prototype),"paintToEx",this).call(this,t),this.orientation==Jt&&this.rightBlank_>0){t.brush.color="#52596b",t.fillRect(U.Create(2,this.height-this.rightBlank_+2,this.width-2,this.height-2)),t.pen.color="#aaabb3";var e=Math.trunc((this.width-5)/2),i=this.height-this.rightBlank_+2+this.buttonSize-9;t.beginPath(),t.drawLine(e,i,e+5,i),t.drawLine(e+1,i-1,e+4,i-1),t.drawLine(e+2,i-2,e+3,i-2),i-=3,t.drawLine(e,i,e+5,i),t.drawLine(e+1,i-1,e+4,i-1),t.drawLine(e+2,i-2,e+3,i-2),i=this.height-this.rightBlank_+2+this.buttonSize+2+3,t.drawLine(e,i,e+5,i),t.drawLine(e+1,i+1,e+4,i+1),t.drawLine(e+2,i+2,e+3,i+2),i+=3,t.drawLine(e,i,e+5,i),t.drawLine(e+1,i+1,e+4,i+1),t.drawLine(e+2,i+2,e+3,i+2),t.paintPath()}}},{key:"SetAreaPos",value:function(t,e,i){null==this.FAreaMarks&&(this.FAreaMarks=new V);var n=this._getAreaMarkByTag(t);if(n<0){var o=new jv;o.tag=t,o.position=e,o.height=i,this.FAreaMarks.add(o);var r=this._getAreaMarkRect(this.FAreaMarks.count-1);this.updateRect(r)}else if(this.FAreaMarks[n].position!=e||this.FAreaMarks[n].height!=i){var s=this._getAreaMarkRect(n);this.FAreaMarks[n].position=e,this.FAreaMarks[n].height=i,this.updateRect(s),s=this._getAreaMarkRect(n),this.updateRect(s)}}}])&&Lv(e.prototype,i),n&&Lv(e,n),r}(mi);function Kv(t){return(Kv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yv(t,e){return(Yv=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Jv(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=qv(t);if(e){var o=qv(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Zv(this,i)}}function Zv(t,e){return!e||"object"!==Kv(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function qv(t){return(qv=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Qv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $v(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function tF(t,e,i){return e&&$v(t.prototype,e),i&&$v(t,i),t}var eF=function(){function t(){Qv(this,t),this.FSize=kp.A4,this.FWidth=0,this.FHeight=0,this.FWidthPix=0,this.FHeightPix=0,this.FMarginTop=0,this.FMarginLeft=0,this.FMarginRight=0,this.FMarginBottom=0,this.FMarginTopPix=0,this.FMarginLeftPix=0,this.FMarginRightPix=0,this.FMarginBottomPix=0,this.MarginLeft=25,this.MarginTop=25,this.MarginRight=20,this.MarginBottom=20,this.Size=kp.A4,this.Width=210,this.Height=297}return tF(t,[{key:"setSize_",value:function(t){this.FSize!=t&&(this.FSize=t)}},{key:"setWidth_",value:function(t){this.FWidth=t,this.FWidthPix=sr.millimeterToPixX(this.FWidth)}},{key:"setHeight_",value:function(t){this.FHeight=t,this.FHeightPix=sr.millimeterToPixY(this.FHeight)}},{key:"setMarginTop_",value:function(t){this.FMarginTop=t,this.FMarginTopPix=sr.millimeterToPixY(this.FMarginTop)}},{key:"setMarginLeft_",value:function(t){this.FMarginLeft=t,this.FMarginLeftPix=sr.millimeterToPixX(this.FMarginLeft)}},{key:"setMarginRight_",value:function(t){this.FMarginRight=t,this.FMarginRightPix=sr.millimeterToPixX(this.FMarginRight)}},{key:"setMarginBottom_",value:function(t){this.FMarginBottom=t,this.FMarginBottomPix=sr.millimeterToPixY(this.FMarginBottom)}},{key:"SaveToStream",value:function(t){var e=t.position;t.writeUInt64(e),t.writeInt32(this.FSize),t.writeSingle(this.FWidth),t.writeSingle(this.FHeight),t.writeSingle(this.FMarginLeft),t.writeSingle(this.FMarginTop),t.writeSingle(this.FMarginRight),t.writeSingle(this.FMarginBottom);var i=t.position;t.position=e,e=i-e-8,t.writeUInt64(e),t.position=i}},{key:"LoadFromStream",value:function(t,e){t.readInt64(),this.Size=t.readInt32(),this.Width=t.readSingle(),this.Height=t.readSingle(),this.MarginLeft=t.readSingle(),this.MarginTop=t.readSingle(),this.MarginRight=t.readSingle(),this.MarginBottom=t.readSingle()}},{key:"Size",get:function(){return this.FSize},set:function(t){this.setSize_(t)}},{key:"Width",get:function(){return this.FWidth},set:function(t){this.setWidth_(t)}},{key:"Height",get:function(){return this.FHeight},set:function(t){this.setHeight_(t)}},{key:"MarginTop",get:function(){return this.FMarginTop},set:function(t){this.setMarginTop_(t)}},{key:"MarginLeft",get:function(){return this.FMarginLeft},set:function(t){this.setMarginLeft_(t)}},{key:"MarginRight",get:function(){return this.FMarginRight},set:function(t){this.setMarginRight_(t)}},{key:"MarginBottom",get:function(){return this.FMarginBottom},set:function(t){this.setMarginBottom_(t)}},{key:"WidthPix",get:function(){return this.FWidthPix}},{key:"HeightPix",get:function(){return this.FHeightPix}},{key:"MarginTopPix",get:function(){return this.FMarginTopPix}},{key:"MarginLeftPix",get:function(){return this.FMarginLeftPix}},{key:"MarginRightPix",get:function(){return this.FMarginRightPix}},{key:"MarginBottomPix",get:function(){return this.FMarginBottomPix}}]),t}(),iF=function(){function t(){Qv(this,t),this.Clear()}return tF(t,[{key:"Assign",value:function(t){this.FStartDrawItemNo=t.StartDrawItemNo,this.FEndDrawItemNo=t.EndDrawItemNo}},{key:"Clear",value:function(){this.FStartDrawItemNo=0,this.FEndDrawItemNo=0}},{key:"StartDrawItemNo",get:function(){return this.FStartDrawItemNo},set:function(t){this.FStartDrawItemNo=t}},{key:"EndDrawItemNo",get:function(){return this.FEndDrawItemNo},set:function(t){this.FEndDrawItemNo=t}}]),t}(),nF=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Yv(t,e)}(i,t);var e=Jv(i);function i(){return Qv(this,i),e.call(this)}return tF(i,[{key:"ClearEx",value:function(){this.removeRange(1,this.count-1),this[0].Clear()}}]),i}(V);function oF(t){return(oF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sF(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function aF(t,e,i){return e&&sF(t.prototype,e),i&&sF(t,i),t}function lF(t,e,i){return(lF="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=dF(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function hF(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&cF(t,e)}function cF(t,e){return(cF=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function uF(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=dF(t);if(e){var o=dF(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return fF(this,i)}}function fF(t,e){return!e||"object"!==oF(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function dF(t){return(dF=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var mF=function(t){hF(i,t);var e=uF(i);function i(t){var n;return rF(this,i),(n=e.call(this,t)).FFloatItems=new xm,n.FFloatItems.OnInsertItem=function(t){n.DoInsertFloatItem(t)},n.FFloatItemIndex=-1,n.FMouseDownIndex=-1,n.FMouseMoveIndex=-1,n.OnReadOnlySwitch=null,n.OnGetScreenCoord=null,n.OnFloatItemPaintAfter=null,n}return aF(i,[{key:"GetFloatItemAt",value:function(t,e){for(var i=-1,n=null,o=0;o<=this.FFloatItems.count-1;o++)if((n=this.FFloatItems[o]).PointInClient(t-n.Left,e-n.Top)){i=o;break}return i}},{key:"DoInsertFloatItem",value:function(t){this.DoInsertItem(t)}},{key:"SetReadOnly",value:function(t){this.ReadOnly!=t&&(lF(dF(i.prototype),"SetReadOnly",this).call(this,t),null!=this.OnReadOnlySwitch&&this.OnReadOnlySwitch(this,null))}},{key:"DoLoadFromStream",value:function(t,e,n){if(n>42&&t.readInt64(),lF(dF(i.prototype),"DoLoadFromStream",this).call(this,t,e,n),n>12)for(var o=t.readInt32();o>0;){var r=null,s=cs.Null;s=t.readInt32(),(r=n<28&&s==_c?new Lm(this):this.CreateItemByStyle(s)).LoadFromStream(t,e,n),this.FFloatItems.add(r),o--}}},{key:"UndoAction_FloatItemMirror",value:function(t){}},{key:"DoFloatItemPaintAfter",value:function(t,e,i){if(null!==this.OnFloatItemPaintAfter){e.save();try{this.OnFloatItemPaintAfter(this,t,e,i)}finally{e.restore()}}}},{key:"MouseDownFloatItem",value:function(t){var e=!1;this.FMouseDownIndex=this.GetFloatItemAt(t.x,t.y);var i=this.FFloatItemIndex;if(this.FFloatItemIndex!=this.FMouseDownIndex&&(this.FFloatItemIndex>=0&&(this.FFloatItems[this.FFloatItemIndex].Active=!1),this.FFloatItemIndex=this.FMouseDownIndex,this.Style.UpdateInfoRePaint(),this.Style.UpdateInfoReCaret()),this.FFloatItemIndex>=0){if(this.ReadOnly)return!0;if(2==t.clicks)return this.FFloatItems[this.FFloatItemIndex].DblClick(t.x-this.FFloatItems[this.FFloatItemIndex].Left,t.y-this.FFloatItems[this.FFloatItemIndex].Top),!0;var n=new ei;n.assign(t),n.x=t.x-this.FFloatItems[this.FFloatItemIndex].Left,n.y=t.y-this.FFloatItems[this.FFloatItemIndex].Top,e=this.FFloatItems[this.FFloatItemIndex].MouseDown(n)}return this.FMouseDownIndex<0&&i<0&&(e=!1),e}},{key:"MouseMoveFloatItem",value:function(t){var e=!1;if(t.button!=ee||or.keyDownStates[Re]){var i=this.GetFloatItemAt(t.x,t.y);if(this.FMouseMoveIndex!=i&&(this.FMouseMoveIndex>=0&&this.FFloatItems[this.FMouseMoveIndex].MouseLeave(),this.FMouseMoveIndex=i,this.FMouseMoveIndex>=0&&this.FFloatItems[this.FMouseMoveIndex].MouseEnter()),i>=0){var n=this.FFloatItems[i],o=new ei;o.assign(t),o.x=t.x-n.Left,o.y=t.y-n.Top,e=n.MouseMove(o)}}else{if(this.ReadOnly)return e;if(this.FMouseDownIndex>=0){var r=this.FFloatItems[this.FMouseDownIndex],s=new ei;s.assign(t),s.x=t.x-r.Left,s.y=t.y-r.Top,(e=r.MouseMove(s))&&this.Style.UpdateInfoRePaint()}}return e}},{key:"MouseUpFloatItem",value:function(t){var e=!1;if(this.FMouseDownIndex>=0){if(this.ReadOnly)return!0;this.Undo_New(),this.UndoAction_FloatItemMirror(this.FMouseDownIndex);var i=this.FFloatItems[this.FMouseDownIndex],n=new ei;n.assign(t),n.x=t.x-i.Left,n.y=t.y-i.Top,(e=i.MouseUp(n))&&this.Style.UpdateInfoRePaint()}return e}},{key:"KeyDownFloatItem",value:function(t){if(this.ReadOnly)return!0;var e=!0;if(this.FFloatItemIndex>=0&&!this.FFloatItems[this.FFloatItemIndex].Lock)switch(t.keyCode){case Pe:case Ge:this.FFloatItems.delete(this.FFloatItemIndex),this.FFloatItemIndex=-1,this.FMouseMoveIndex=-1;break;case Be:this.FFloatItems[this.FFloatItemIndex].Left-=1;break;case Me:this.FFloatItems[this.FFloatItemIndex].Left+=1;break;case Ee:this.FFloatItems[this.FFloatItemIndex].Left-=1;break;case Le:this.FFloatItems[this.FFloatItemIndex].Left+=1;break;default:e=!1}else e=!1;return e&&this.Style.UpdateInfoRePaint(),e}},{key:"Clear",value:function(){this.FFloatItemIndex=-1,this.FMouseDownIndex=-1,this.FMouseMoveIndex=-1,this.FFloatItems.clear(),lF(dF(i.prototype),"Clear",this).call(this)}},{key:"GetCaretInfo",value:function(t,e,n){this.FFloatItemIndex>=0?n.Visible=!1:lF(dF(i.prototype),"GetCaretInfo",this).call(this,t,e,n)}},{key:"GetScreenCoord",value:function(t,e){return null!=this.OnGetScreenCoord?this.OnGetScreenCoord(t,e):new G}},{key:"TraverseFloatItem",value:function(t){if(null!=t)for(var e=0;e<this.FFloatItems.count;e++){if(t.Stop)return;t.Process(this,e,t.Tag,t.DomainStack,t.Stop)}}},{key:"GetActiveItemNo",value:function(){return this.FFloatItemIndex<0?lF(dF(i.prototype),"GetActiveItemNo",this).call(this):-1}},{key:"GetActiveItem",value:function(){return this.FFloatItemIndex<0?lF(dF(i.prototype),"GetActiveItem",this).call(this):null}},{key:"GetActiveFloatItem",value:function(){return this.FFloatItemIndex<0?null:this.FFloatItems[this.FFloatItemIndex]}},{key:"InsertFloatItem",value:function(t){var e=this.SelectInfo.StartItemNo,i=this.SelectInfo.StartItemOffset,n=this.GetDrawItemNoByOffset(e,i);return t.Left=this.DrawItems[n].rect.left+this.GetDrawItemOffsetWidth(n,this.SelectInfo.StartItemOffset-this.DrawItems[n].CharOffs+1),t.Left=this.DrawItems[n].rect.top,this.FloatItems.add(t),this.FFloatItemIndex=this.FloatItems.count-1,t.Active=!0,this.DisSelect()||this.Style.UpdateInfoRePaint(),!0}},{key:"SaveToStream",value:function(t){var e=t.position;t.writeUInt64(e),lF(dF(i.prototype),"SaveToStream",this).call(this,t),t.writeInt32(this.FFloatItems.count);for(var n=0;n<=this.FFloatItems.count-1;n++)this.FFloatItems[n].SaveToStream(t);var o=t.position;t.position=e,e=o-e-8,t.writeUInt64(e),t.position=o}},{key:"ToXml",value:function(t){var e,n=Kr.Create("items");lF(dF(i.prototype),"ToXml",this).call(this,n),t.AppendChild(n),(n=Kr.Create("floatitems")).SetAttribute("count",this.FFloatItems.count.toString());for(var o=0;o<this.FFloatItems.count;o++)e=Kr.Create("floatitem"),this.FFloatItems[o].ToXml(e),n.AppendChild(e);t.AppendChild(n)}},{key:"ParseXml",value:function(t){var e=t.FindNode("items");lF(dF(i.prototype),"ParseXml",this).call(this,e);var n=null,o=null;if(null!=(e=t.FindNode("floatitems")).ChildNodes)for(var r=0;r<e.ChildNodes.count;r++)n=e.ChildNodes[r],(o=this.CreateItemByStyle(n.GetAttribute("sno"))).ParseXml(n),this.FFloatItems.add(o)}},{key:"ApplyTextFontSize",value:function(t){if(this.FFloatItemIndex>=0){var e=new FontSizeStyleMatch;e.FontSize=t,this.FFloatItems[this.FFloatItemIndex].ApplySelectTextStyle(this.Style,e)}else lF(dF(i.prototype),"ApplyTextFontSize",this).call(this,t)}},{key:"PaintFloatItems",value:function(t,e,i,n,o,r){for(var s=null,a=0;a<=this.FFloatItems.count-1;a++)(s=this.FFloatItems[a]).DrawRect.resetBounds(s.Left,s.Top,s.Width,s.Height),s.DrawRect.offset(e,i-n),s.PaintTo(this.Style,s.DrawRect,i,0,0,0,o,r),this.DoFloatItemPaintAfter(s,o,r)}},{key:"FloatItemIndex",get:function(){return this.FFloatItemIndex}},{key:"ActiveFloatItem",get:function(){return this.GetActiveFloatItem()}},{key:"FloatItems",get:function(){return this.FFloatItems}}]),i}(jy),yF=function(t){hF(i,t);var e=uF(i);function i(t){return rF(this,i),e.call(this,t)}return i}(mF),pF=function(t){hF(i,t);var e=uF(i);function i(t){return rF(this,i),e.call(this,t)}return i}(mF),SF=function(t){hF(i,t);var e=uF(i);function i(t){var n;return rF(this,i),(n=e.call(this,t)).FShowLineActiveMark=!1,n.FShowUnderLine=!1,n.FShowLineNo=!1,n}return aF(i,[{key:"DoDrawItemPaintAfter",value:function(t,e,n,o,r,s,a,l,h,c,u,f){lF(dF(i.prototype),"DoDrawItemPaintAfter",this).call(this,t,e,n,o,r,s,a,l,h,c,u,f),this.FShowUnderLine&&t.IsLineLastDrawItem(n)&&(u.pen.color="black",u.drawLineDriect(s,o.top,s+this.Width,o.top),u.drawLineDriect(s,o.bottom,s+this.Width,o.bottom))}},{key:"DoDrawItemPaintBefor",value:function(t,e,n,o,r,s,a,l,h,c,u,f){if(lF(dF(i.prototype),"DoDrawItemPaintBefor",this).call(this,t,e,n,o,r,s,a,l,h,c,u,f),!f.Print){if(this.FShowLineActiveMark&&n==this.GetSelectStartDrawItemNo()){u.pen.color="blue";var d=o.top+Math.trunc(this.DrawItems[n].height/2);u.beginPath();try{u.moveTo(s-10,d),u.lineTo(s-11,d),u.moveTo(s-11,d-1),u.lineTo(s-11,d+2),u.moveTo(s-12,d-2),u.lineTo(s-12,d+3),u.moveTo(s-13,d-3),u.lineTo(s-13,d+4),u.moveTo(s-14,d-4),u.lineTo(s-14,d+5),u.moveTo(s-15,d-2),u.lineTo(s-15,d+3),u.moveTo(s-16,d-2),u.lineTo(s-16,d+3)}finally{u.paintPath()}}if(this.FShowLineNo&&this.DrawItems[n].LineFirst){for(var m=0,y=0;y<=n;y++)this.DrawItems[y].LineFirst&&m++;u.font.size=10,u.font.name="Courier New",u.font.color="rgb(180, 180, 180)",u.textOut(s-50,o.top+Math.trunc((o.height-16)/2),m.toString())}}}},{key:"DoLoadFromStream",value:function(t,e,n){this.FShowUnderLine=t.readBoolean(),lF(dF(i.prototype),"DoLoadFromStream",this).call(this,t,e,n)}},{key:"MouseDown",value:function(t){if(this.FShowLineActiveMark){var e=this.MouseDownItemNo,n=this.MouseDownItemOffset;lF(dF(i.prototype),"MouseDown",this).call(this,t),e==this.MouseDownItemNo&&n==this.MouseDownItemOffset||this.Style.UpdateInfoRePaint()}else lF(dF(i.prototype),"MouseDown",this).call(this,t)}},{key:"SaveToStream",value:function(t){t.writeBoolean(this.FShowUnderLine),lF(dF(i.prototype),"SaveToStream",this).call(this,t)}},{key:"InsertStream",value:function(t,e,n){return lF(dF(i.prototype),"InsertStream",this).call(this,t,e,n)}},{key:"PaintFloatItems",value:function(t,e,i,n,o,r){for(var s=null,a=0;a<this.FloatItems.count;a++)(s=this.FloatItems[a]).PageIndex==t&&(s.DrawRect.resetBounds(s.Left+e,s.Top+i-n,s.Width,s.Height),s.PaintTo(this.Style,s.DrawRect,i,0,0,0,o,r),this.DoFloatItemPaintAfter(s,o,r))}},{key:"InsertPageBreak",value:function(){if(this.SelectExists())return!1;if(this.Items[this.SelectInfo.StartItemNo].StyleNo<cs.Null&&this.SelectInfo.StartItemOffset==lp.OffsetInner)return!1;var t=new ii;return t.keyCode=be,this.KeyDown(t,!0),!0}},{key:"ToXml",value:function(t){this.FShowUnderLine&&t.SetAttribute("SUL".this.FShowUnderLine.toString()),lF(dF(i.prototype),"ToXml",this).call(this,t)}},{key:"ParseXml",value:function(t){t.HasAttribute("SUL")&&(this.FShowUnderLine=t.GetAttribute("SUL")),lF(dF(i.prototype),"ParseXml",this).call(this,t)}},{key:"ShowLineActiveMark",get:function(){return this.FShowLineActiveMark},set:function(t){this.FShowLineActiveMark=t}},{key:"ShowLineNo",get:function(){return this.FShowLineNo},set:function(t){this.FShowLineNo=t}},{key:"ShowUnderLine",get:function(){return this.FShowUnderLine},set:function(t){this.FShowUnderLine=t}}]),i}(mF);function vF(t){return(vF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function FF(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function IF(t,e,i){return e&&FF(t.prototype,e),i&&FF(t,i),t}function gF(t,e,i){return(gF="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=bF(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function wF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function CF(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&kF(t,e)}function kF(t,e){return(kF=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function PF(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=bF(t);if(e){var o=bF(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return DF(this,i)}}function DF(t,e){return!e||"object"!==vF(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function bF(t){return(bF=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var RF=function(t){CF(i,t);var e=PF(i);function i(){var t;return wF(this,i),(t=e.call(this)).SectionIndex=-1,t.PageIndex=-1,t.pageDataFmtTop=0,t}return i}(Us),_F=function(t){CF(i,t);var e=PF(i);function i(t){var n;return wF(this,i),(n=e.call(this,t)).FPropertys=new z,n}return IF(i,[{key:"DoSaveToStream",value:function(t){gF(bF(i.prototype),"DoSaveToStream",this).call(this,t),lp.HCSaveTextToStream(t,lp.GetPropertyString(this.FPropertys))}},{key:"DoLoadFromStream",value:function(t,e){gF(bF(i.prototype),"DoLoadFromStream",this).call(this,t,e);var n=lp.HCLoadTextFromStream(t,e);lp.SetPropertyString(n,this.FPropertys)}},{key:"AssignPaper",value:function(t){this.PaperSize=t.PaperSize,this.PaperWidth=t.PaperWidth,this.PaperHeight=t.PaperHeight,this.PaperMarginTop=t.PaperMarginTop,this.PaperMarginLeft=t.PaperMarginLeft,this.PaperMarginRight=t.PaperMarginRight,this.PaperMarginBottom=t.PaperMarginBottom,this.PaperOrientation=t.PaperOrientation,this.HeaderOffset=t.HeaderOffset,this.ResetMargin()}},{key:"Search",value:function(t,e,i){var n=this.ActiveData.Search(t,e,i);return this.DoActiveDataCheckUpdateInfo(),n}},{key:"Replace",value:function(t){var e=this;return this.DoSectionDataAction(this.ActiveData,(function(){return e.ActiveData.Replace(t)}))}},{key:"ParseHtml",value:function(t){return this.DoSectionDataAction(this.ActiveData,(function(){return!0})),!0}},{key:"InsertFloatItem",value:function(t){if(!this.ActiveData.CanEdit())return!1;t.PageIndex=this.ActivePageIndex;var e=this.ActiveData.InsertFloatItem(t);return this.DoDataChanged(this),e}},{key:"SeekStreamToArea",value:function(t,e,i,n,o){var r=t.readInt64();(i>41&&lp.HCLoadTextFromStream(t,i),t.readBoolean(),i>11&&(t.readByte(),t.readBoolean()),i>45&&(t.readInt32(),lp.HCLoadTextFromStream(t,i)),o)?this.FPaper.LoadFromStream(t,i):(new eF).LoadFromStream(t,i);var s=new Set([]);if(t.readBoolean()&&s.add(dp.Header),t.readBoolean()&&s.add(dp.Footer),t.readBoolean()&&s.add(dp.Page),s.has(dp.Header)){if(t.readInt32(),n==dp.Header)return;r=t.readInt64(),t.position+=r}n!=dp.Header&&n!=dp.Footer&&(s.has(dp.Footer)&&(r=t.readInt64(),t.position+=r),t.readBoolean(),t.readInt64())}},{key:"ToHtml",value:function(){return this.Header.ToHtml()+lp.sLineBreak+this.Page.ToHtml()+lp.sLineBreak+this.Footer.ToHtml()}},{key:"ToXml",value:function(t){t.SetAttribute("symmargin",this.FSymmetryMargin.toString()),t.SetAttribute("ori",this.FPaperOrientation.toString()),t.SetAttribute("pagenovisible",this.FPageNoVisible.toString()),t.SetAttribute("pagenofrom",this.FPageNoFrom.toString()),t.SetAttribute("pagenoformat",this.FPageNoFormat),t.SetAttribute("pagesize",this.PaperSize.toString()+","+C.stringFormatFloat(1,this.PaperWidth)+","+C.stringFormatFloat(1,this.PaperHeight)),t.SetAttribute("margin",C.stringFormatFloat(1,this.PaperMarginLeft)+","+C.stringFormatFloat(1,this.PaperMarginTop)+","+C.stringFormatFloat(1,this.PaperMarginRight)+","+C.stringFormatFloat(1,this.PaperMarginBottom)),t.SetAttribute("property",lp.GetPropertyString(this.FPropertys));var e=Kr.Create("header");e.SetAttribute("offset",this.HeaderOffset.toString()),this.Header.ToXml(e),t.AppendChild(e),e=Kr.Create("footer"),this.Footer.ToXml(e),t.AppendChild(e),e=Kr.Create("page"),this.Page.ToXml(e),t.AppendChild(e)}},{key:"ParseXml",value:function(t){this.SymmetryMargin=t.GetAttribute("symmargin"),this.PaperOrientation=t.GetAttribute("ori"),this.PageNoVisible=t.GetAttribute("pagenovisible"),t.HasAttribute("pagenofrom")&&(this.FPageNoFrom=t.GetAttribute("pagenofrom")),t.HasAttribute("pagenoformat")&&(this.FPageNoFormat=t.GetAttribute("pagenoformat"));var e=t.GetAttribute("pagesize").split(",");if(this.PaperSize=e[0],this.PaperWidth=e[1],this.PaperHeight=e[2],e=t.GetAttribute("margin").split(","),this.PaperMarginLeft=e[0],this.PaperMarginTop=e[1],this.PaperMarginRight=e[2],this.PaperMarginBottom=e[3],t.HasAttribute("property")){var i=lp.GetXmlRN(t.GetAttribute("property"));lp.SetPropertyString(i,this.FPropertys)}this.Page.Width=this.GetPageWidth();for(var n=0;n<t.ChildNodes.count;n++)"header"==t.ChildNodes[n].Name?(this.HeaderOffset=t.ChildNodes[n].GetAttribute("offset"),this.Header.Width=this.Page.Width,this.Header.ParseXml(t.ChildNodes[n])):"footer"==t.ChildNodes[n].Name?(this.Footer.Width=this.Page.Width,this.Footer.ParseXml(t.ChildNodes[n])):"page"==t.ChildNodes[n].Name&&this.Page.ParseXml(t.ChildNodes[n]);this.BuildSectionPages(0)}},{key:"Propertys",get:function(){return this.FPropertys}}]),i}(function(t){CF(i,t);var e=PF(i);function i(t){var n;wF(this,i),(n=e.call(this)).FStyle=t,n.FPaper=new eF,n.FPaperOrientation=hp,n.FViewModel=Bs,n.FMoveData=null,n.FPageNoVisible=!0,n.FPageNoFormat="{0}/{1}",n.FPagePadding=20,n.FPageNoFrom=1,n.FActivePageIndex=0,n.FMousePageIndex=0,n.FDisplayFirstPageIndex=-1,n.FDisplayLastPageIndex=-1,n.FHeaderOffset=20;var o=n.GetPageWidth();return n.FPage=new SF(t),n.SetDataProperty(o,n.FPage),n.FHeader=new yF(t),n.SetDataProperty(o,n.FHeader),n.FFooter=new pF(t),n.SetDataProperty(o,n.FFooter),n.FActiveData=n.FPage,n.FSymmetryMargin=!0,n.FPages=new nF,n.NewEmptyPage(),n.FPages[0].StartDrawItemNo=0,n.FPages[0].EndDrawItemNo=0,n.OnDataChange=null,n.OnDataSetChange=null,n.OnCheckUpdateInfo=null,n.OnReadOnlySwitch=null,n.OnChangeTopLevelData=null,n.OnGetScreenCoord=null,n.OnPaintHeaderBefor=null,n.OnPaintHeaderAfter=null,n.OnPaintFooterBefor=null,n.OnPaintFooterAfter=null,n.OnPaintPageBefor=null,n.OnPaintPageAfter=null,n.OnPaintPaperBefor=null,n.OnPaintPaperAfter=null,n.OnDrawItemPaintBefor=null,n.OnDrawItemPaintAfter=null,n.OnInsertAnnotate=null,n.OnRemoveAnnotate=null,n.OnDrawItemAnnotate=null,n.OnDrawItemPaintContent=null,n.OnInsertItem=null,n.OnRemoveItem=null,n.OnSaveItem=null,n.OnPaintDomainRegion=null,n.OnMatchTextStyleNoAt=null,n.OnDataAcceptAction=null,n.OnItemMouseDown=null,n.OnItemMouseUp=null,n.OnDrawItemMouseMove=null,n.OnItemResize=null,n.OnCreateItem=null,n.OnFloatItemPaintAfter=null,n.OnCaretItemChanged=null,n.OnDataDomainSwitch=null,n.OnCurParaNoChange=null,n.OnActivePageChange=null,n.OnCreateItemByStyle=null,n.OnCanEdit=null,n.OnInsertTextBefor=null,n.OnGetUndoList=null,n}return IF(i,[{key:"GetPageIndexByFilm",value:function(t){for(var e=-1,i=0,n=0;n<=this.FPages.count-1;n++)if(this.FViewModel==Bs?i=i+this.FPagePadding+this.FPaper.HeightPix:i+=this.GetPageHeight(),i>=t){e=n;break}return e<0&&t>i&&(e=this.FPages.count-1),e}},{key:"DoActiveDataCheckUpdateInfo",value:function(){null!=this.OnCheckUpdateInfo&&this.OnCheckUpdateInfo(this)}},{key:"DoDataReadOnlySwitch",value:function(t){null!=this.OnReadOnlySwitch&&this.OnReadOnlySwitch(this)}},{key:"DoGetScreenCoordEvent",value:function(t,e){return null!=this.OnGetScreenCoord?this.OnGetScreenCoord(t,e):G.Create(0,0)}},{key:"DoDataDrawItemPaintBefor",value:function(t,e,i,n,o,r,s,a,l,h,c,u){null!=this.OnDrawItemPaintBefor&&this.OnDrawItemPaintBefor(this,t,e,i,n,o,r,s,a,l,h,c,u)}},{key:"DoDataDrawItemPaintContent",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){null!=this.OnDrawItemPaintContent&&this.OnDrawItemPaintContent(t,e,i,n,o,r,s,a,l,h,c,u,f)}},{key:"DoDataDrawItemPaintAfter",value:function(t,e,i,n,o,r,s,a,l,h,c,u){null!=this.OnDrawItemPaintAfter&&this.OnDrawItemPaintAfter(this,t,e,i,n,o,r,s,a,l,h,c,u)}},{key:"DoDataInsertAnnotate",value:function(t,e){null!=this.OnInsertAnnotate&&this.OnInsertAnnotate(this,t,e)}},{key:"DoDataRemoveAnnotate",value:function(t,e){null!=this.OnRemoveAnnotate&&this.OnRemoveAnnotate(this,t,e)}},{key:"DoDataDrawItemAnnotate",value:function(t,e,i,n){null!=this.OnDrawItemAnnotate&&this.OnDrawItemAnnotate(this,t,e,i,n)}},{key:"DoDataInsertItem",value:function(t,e){null!=this.OnInsertItem&&this.OnInsertItem(this,t,e)}},{key:"DoDataRemoveItem",value:function(t,e){null!=this.OnRemoveItem&&this.OnRemoveItem(this,t,e)}},{key:"DoDataSaveItem",value:function(t,e){return null==this.OnSaveItem||this.OnSaveItem(this,t,e)}},{key:"DoDataPaintDomainRegion",value:function(t,e){return null==this.OnPaintDomainRegion||this.OnPaintDomainRegion(this,t,e)}},{key:"DoMatchTextStyleNoAt",value:function(t,e,i){return null!==this.OnMatchTextStyleNoAt?this.OnMatchTextStyleNoAt(t,e,i):cs.Null}},{key:"DoDataAcceptAction",value:function(t,e,i,n){return null==this.OnDataAcceptAction||this.OnDataAcceptAction(this,t,e,i,n)}},{key:"DoDataItemMouseDown",value:function(t,e,i,n){null!=this.OnItemMouseDown&&this.OnItemMouseDown(this,t,e,i,n)}},{key:"DoDataItemMouseUp",value:function(t,e,i,n){null!=this.OnItemMouseUp&&this.OnItemMouseUp(this,t,e,i,n)}},{key:"DoDataDrawItemMouseMove",value:function(t,e,i,n,o){null!=this.OnDrawItemMouseMove&&this.OnDrawItemMouseMove(this,t,e,i,n,o)}},{key:"DoDataChanged",value:function(t){null!=this.OnDataChange&&this.OnDataChange(t,null)}},{key:"DoDataSetChange",value:function(){null!=this.OnDataSetChange&&this.OnDataSetChange()}},{key:"DoDataFloatItemPaintAfter",value:function(t,e,i,n){null!==this.OnFloatItemPaintAfter&&this.OnFloatItemPaintAfter(this,t,e,i,n)}},{key:"DoDataItemReFormatRequest",value:function(t,e){this.DoSectionDataAction(t,(function(){return t.ItemReFormatResponse(e),!0}))}},{key:"DoDataItemSetCaretRequest",value:function(t,e,i){this.DoActiveDataCheckUpdateInfo()}},{key:"DoDataItemResized",value:function(t,e){var i=t.Items[e],n=this.GetPageWidth(),o=0,r=t.GetRootData();o=r==this.FHeader?this.GetHeaderAreaHeight():r==this.FFooter?this.FPaper.MarginBottomPix:this.GetPageHeight(),i.RestrainSize(n,o),null!=this.OnItemResize&&this.OnItemResize(t,e)}},{key:"DoDataCreateStyleItem",value:function(t,e){return null!=this.OnCreateItemByStyle?this.OnCreateItemByStyle(t,e):null}},{key:"DoDataCanEdit",value:function(t){return null==this.OnCanEdit||this.OnCanEdit(t)}},{key:"DoDataInsertTextBefor",value:function(t,e,i,n){return null==this.OnInsertTextBefor||this.OnInsertTextBefor(t,e,i,n)}},{key:"DoDataCreateItem",value:function(t){null!=this.OnCreateItem&&this.OnCreateItem(t,null)}},{key:"DoDataCurParaNoChange",value:function(t){null!=this.OnCurParaNoChange&&this.OnCurParaNoChange(t)}},{key:"DoDataCaretItemChanged",value:function(t,e){null!=this.OnCaretItemChanged&&this.OnCaretItemChanged(this,t,e)}},{key:"DoDataDomainSwitch",value:function(t,e){null!=this.OnDataDomainSwitch&&this.OnDataDomainSwitch(this,t,e)}},{key:"DoDataGetUndoList",value:function(){return null!=this.OnGetUndoList?this.OnGetUndoList():null}},{key:"GetPageIndexByPageDataDrawItem",value:function(t){if(t<0)return 0;for(var e=this.FPages.count-1,i=0;i<=this.FPages.count-1;i++)if(this.FPages[i].EndDrawItemNo>=t){e=i;break}return e}},{key:"PaperCoordToData",value:function(t,e,i,n){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(this.FViewModel!=Bs)return{x:i,y:n};var r=-1,s=this.GetPageMarginLeft(t);return i-=s,e==this.FHeader?(n-=this.GetHeaderPageDrawTop(),o&&(n<0?n=1:n>(r=this.FHeader.height)&&(n=r-1))):e==this.FFooter?(n=n-this.FPaper.HeightPix+this.FPaper.MarginBottomPix,o&&(n<0?n=1:n>this.FPaper.MarginBottomPix&&(n=this.FPaper.MarginBottomPix-1))):e==this.FPage&&(n-=this.GetHeaderAreaHeight(),o&&(n<0?n=1:n>=(r=this.GetPageHeight())&&(n=r-1))),{x:i,y:n}}},{key:"GetReadOnly",value:function(){return this.FHeader.ReadOnly&&this.FFooter.ReadOnly&&this.FPage.ReadOnly}},{key:"SetReadOnly",value:function(t){this.FHeader.ReadOnly=t,this.FFooter.ReadOnly=t,this.FPage.ReadOnly=t}},{key:"SetActivePageIndex",value:function(t){this.FActivePageIndex!=t&&(this.FActivePageIndex=t,null!=this.OnActivePageChange&&this.OnActivePageChange(this,null))}},{key:"GetCurStyleNo",value:function(){return this.FActiveData.GetTopLevelData().CurStyleNo}},{key:"GetCurParaNo",value:function(){return this.FActiveData.GetTopLevelData().CurParaNo}},{key:"KillFocus",value:function(){this.FActiveData.KillFocus()}},{key:"GetPaperSize",value:function(){return this.FPaper.Size}},{key:"SetPaperSize",value:function(t){this.FPaper.Size=t}},{key:"GetPaperWidth",value:function(){return this.FPaper.Width}},{key:"GetPaperHeight",value:function(){return this.FPaper.Height}},{key:"GetPaperMarginTop",value:function(){return this.FPaper.MarginTop}},{key:"GetPaperMarginLeft",value:function(){return this.FPaper.MarginLeft}},{key:"GetPaperMarginRight",value:function(){return this.FPaper.MarginRight}},{key:"GetPaperMarginBottom",value:function(){return this.FPaper.MarginBottom}},{key:"SetPaperWidth",value:function(t){this.FPaper.Width=t}},{key:"SetPaperHeight",value:function(t){this.FPaper.Height=t}},{key:"SetPaperMarginTop",value:function(t){this.FPaper.MarginTop=t}},{key:"SetPaperMarginLeft",value:function(t){this.FPaper.MarginLeft=t}},{key:"SetPaperMarginRight",value:function(t){this.FPaper.MarginRight=t}},{key:"SetPaperMarginBottom",value:function(t){this.FPaper.MarginBottom=t}},{key:"GetPaperWidthPix",value:function(){return this.FPaper.WidthPix}},{key:"GetPaperHeightPix",value:function(){return this.FPaper.HeightPix}},{key:"GetPaperMarginTopPix",value:function(){return this.FPaper.MarginTopPix}},{key:"GetPaperMarginLeftPix",value:function(){return this.FPaper.MarginLeftPix}},{key:"GetPaperMarginRightPix",value:function(){return this.FPaper.MarginRightPix}},{key:"GetPaperMarginBottomPix",value:function(){return this.FPaper.MarginBottomPix}},{key:"SetHeaderOffset",value:function(t){this.FHeaderOffset!=t&&(this.FHeaderOffset=t,this.BuildSectionPages(0),this.DoDataChanged(this))}},{key:"NewEmptyPage",value:function(){var t=new iF;return this.FPages.add(t),t}},{key:"GetPageCount",value:function(){return this.FPages.count}},{key:"GetSectionDataAt",value:function(t,e){return t<0||t>this.FPaper.WidthPix||e<0||e>this.FPaper.HeightPix?this.FActiveData:e>=this.FPaper.HeightPix-this.FPaper.MarginBottomPix?this.FFooter:e<this.GetHeaderAreaHeight()?this.FHeader:this.FPage}},{key:"GetActiveArea",value:function(){return this.FActiveData==this.FHeader?dp.saHeader:this.FActiveData==this.FFooter?dp.saFooter:dp.saPage}},{key:"SetActiveData",value:function(t){this.FViewModel!=Bs&&t!=this.FPage||this.FActiveData!=t&&(null!=this.FActiveData&&(this.FActiveData.DisSelect(),this.FActiveData.DisActive()),this.FActiveData=t,this.FStyle.UpdateInfoReScroll())}},{key:"DoSectionDataAction",value:function(t,e){if(!t.CanEdit())return!1;var i=e();return t.FormatChange&&(t.FormatChange=!1,t===this.FPage?this.BuildSectionPages(t.FormatStartDrawItemNo):this.BuildSectionPages(0)),this.DoDataChanged(this),i}},{key:"SetDataProperty",value:function(t,e){var i=this;e.Width=t,e.OnInsertItem=function(t,e){i.DoDataInsertItem(t,e)},e.OnRemoveItem=function(t,e){i.DoDataRemoveItem(t,e)},e.OnSaveItem=function(t,e){return i.DoDataSaveItem(t,e)},e.OnAcceptAction=function(t,e,n,o){return i.DoDataAcceptAction(t,e,n,o)},e.OnItemResized=function(t,e){i.DoDataItemResized(t,e)},e.OnItemMouseDown=function(t,e,n,o){i.DoDataItemMouseDown(t,e,n,o)},e.OnItemMouseUp=function(t,e,n,o){i.DoDataItemMouseUp(t,e,n,o)},e.OnDrawItemMouseMove=function(t,e,n,o,r){i.DoDataDrawItemMouseMove(t,e,n,o,r)},e.OnItemReFormatRequest=function(t,e){i.DoDataItemReFormatRequest(t,e)},e.OnItemSetCaretRequest=function(t,e,n){i.DoDataItemSetCaretRequest(t,e,n)},e.OnCreateItemByStyle=function(t,e){return i.DoDataCreateStyleItem(t,e)},e.OnPaintDomainRegion=function(t,e){return i.DoDataPaintDomainRegion(t,e)},e.OnMatchTextStyleNoAt=function(t,e,n){return i.DoMatchTextStyleNoAt(t,e,n)},e.OnCanEdit=function(t){return i.DoDataCanEdit(t)},e.OnInsertTextBefor=function(t,e,n,o){return i.DoDataInsertTextBefor(t,e,n,o)},e.OnCreateItem=function(t){i.DoDataCreateItem(t)},e.OnReadOnlySwitch=function(t){i.DoDataReadOnlySwitch(t)},e.OnGetScreenCoord=function(t,e){return i.DoGetScreenCoordEvent(t,e)},e.OnDrawItemPaintBefor=function(t,e,n,o,r,s,a,l,h,c,u,f){i.DoDataDrawItemPaintBefor(t,e,n,o,r,s,a,l,h,c,u,f)},e.OnDrawItemPaintAfter=function(t,e,n,o,r,s,a,l,h,c,u,f){i.DoDataDrawItemPaintAfter(t,e,n,o,r,s,a,l,h,c,u,f)},e.OnDrawItemPaintContent=function(t,e,n,o,r,s,a,l,h,c,u,f,d){i.DoDataDrawItemPaintContent(t,e,n,o,r,s,a,l,h,c,u,f,d)},e.OnInsertAnnotate=function(t,e){i.DoDataInsertAnnotate(t,e)},e.OnRemoveAnnotate=function(t,e){i.DoDataRemoveAnnotate(t,e)},e.OnDrawItemAnnotate=function(t,e,n,o){i.DoDataDrawItemAnnotate(t,e,n,o)},e.OnGetUndoList=function(){return i.DoDataGetUndoList()},e.OnCurParaNoChange=function(t){i.DoDataCurParaNoChange(t)},e.OnCaretItemChanged=function(t,e){i.DoDataCaretItemChanged(t,e)},e.OnDomainSwitch=function(t,e){i.DoDataDomainSwitch(t,e)},e.OnChange=function(){i.DoDataSetChange()},e.OnFloatItemPaintAfter=function(t,e,n,o){i.DoDataFloatItemPaintAfter(t,e,n,o)}}},{key:"DoSaveToStream",value:function(t){}},{key:"DoLoadFromStream",value:function(t,e){}},{key:"dispose",value:function(){this.FHeader.dispose(),this.FFooter.dispose(),this.FPage.dispose(),gF(bF(i.prototype),"dispose",this).call(this)}},{key:"ResetMargin",value:function(){this.FPage.Width=this.GetPageWidth(),this.FHeader.Width=this.FPage.Width,this.FFooter.Width=this.FPage.Width,this.FormatData(),this.BuildSectionPages(0),this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),this.DoDataChanged(this)}},{key:"ActiveItemReAdaptEnvironment",value:function(){var t=this;this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ActiveItemReAdaptEnvironment(),!0}))}},{key:"DisActive",value:function(){this.FActiveData.DisSelect(),this.FHeader.InitializeField(),this.FFooter.InitializeField(),this.FPage.InitializeField(),this.FActiveData=this.FPage}},{key:"SelectExists",value:function(){return this.FActiveData.SelectExists()}},{key:"SelectAll",value:function(){this.FActiveData.SelectAll()}},{key:"GetHint",value:function(){return this.FActiveData.GetTopLevelData().GetHint()}},{key:"GetActiveItem",value:function(){return this.FActiveData.GetActiveItem()}},{key:"GetActiveRectItem",value:function(){return this.FActiveData.GetActiveRectItem()}},{key:"GetTopLevelItem",value:function(){return this.FActiveData.GetTopLevelItem()}},{key:"GetTopLevelDrawItem",value:function(){return this.FActiveData.GetTopLevelDrawItem()}},{key:"GetTopLevelDrawItemCoord",value:function(){return this.FActiveData.GetTopLevelDrawItemCoord()}},{key:"GetTopLevelRectDrawItemCoord",value:function(){return this.FActiveData.GetTopLevelRectDrawItemCoord()}},{key:"PageDataFormtToFilmCoord",value:function(t){for(var e=0,i=0,n=this.GetPageHeight(),o=0;o<=this.FPages.count-1;o++){if((i+=n)>=t){i=t-(i-n);break}e=e+this.FPagePadding+this.FPaper.HeightPix}return e=e+this.FPagePadding+this.GetHeaderAreaHeight()+i}},{key:"GetPageIndexByCurrent",value:function(){var t=-1,e=-1;if(this.FActiveData!=this.FPage)t=this.FActivePageIndex;else{e=this.FPage.CaretDrawItemNo<0?this.FPage.GetDrawItemNoByOffset(this.FPage.SelectInfo.StartItemNo,this.FPage.SelectInfo.StartItemOffset):this.FPage.CaretDrawItemNo;for(var i=new bp,n=0;n<=this.FPages.count-1;n++)if(this.FPages[n].EndDrawItemNo>=e){n<this.FPages.count-1&&this.FPages[n+1].StartDrawItemNo==e?this.FPage.SelectInfo.StartItemNo>=0?(i.Y=0,this.FPage.GetCaretInfo(this.FPage.SelectInfo.StartItemNo,this.FPage.SelectInfo.StartItemOffset,i),t=this.GetPageIndexByFormat(i.Y)):t=this.GetPageIndexByPageDataDrawItem(e):t=n;break}}return t}},{key:"GetPageIndexByFormat",value:function(t){return Math.trunc(t/this.GetPageHeight())}},{key:"SetActiveItemText",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.SetActiveItemText(t),!0}))}},{key:"PaintDisplayPage",value:function(t,e,i,n){for(var o=this.FDisplayFirstPageIndex;o<=this.FDisplayLastPageIndex;o++){n.PageIndex=o;var r=0;r=n.ViewModel==Bs?this.GetPageTopFilm(o):this.GetPageTop(o),this.paintPaper(o,t,r-e,i,n)}}},{key:"KeyPress",value:function(t){var e=this;if(this.FActiveData.CanEdit())if(lp.IsKeyPressWant(t)){var i=t.keyCode;this.DoSectionDataAction(this.FActiveData,(function(){return i=e.FActiveData.KeyPress(i),!0})),t.keyCode=i}else t.keyCode=0}},{key:"KeyDown",value:function(t){var e=this;if(this.FActiveData.CanEdit())if(this.FActiveData.KeyDownFloatItem(t))this.DoActiveDataCheckUpdateInfo();else{var i=t.keyCode;if(lp.IsKeyDownWant(i))switch(i){case Pe:case Ge:case be:case De:this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.KeyDown(t),!0}));break;case Be:case Me:case Ee:case Le:case Ne:case Oe:this.FActiveData.KeyDown(t),this.SetActivePageIndex(this.GetPageIndexByCurrent()),this.DoActiveDataCheckUpdateInfo()}else this.FActiveData.KeyDown(t)}}},{key:"KeyUp",value:function(t){this.FActiveData.CanEdit()&&this.FActiveData.KeyUp(t)}},{key:"ApplyTextStyle",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextStyle(t),!0}))}},{key:"ApplyTextStyleNo",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextStyleNo(t),!0}))}},{key:"ApplyTextFontName",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextFontName(t),!0}))}},{key:"ApplyTextFontSize",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextFontSize(t),!0}))}},{key:"ApplyTextColor",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextColor(t),!0}))}},{key:"ApplyTextBackColor",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTextBackColor(t),!0}))}},{key:"ApplyTableCellAlign",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyTableCellAlign(t),!0}))}},{key:"InsertText",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertText(t)}))}},{key:"InsertTable",value:function(t,e){var i=this;return this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.InsertTable(t,e)}))}},{key:"InsertImage",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertImage(t)}))}},{key:"InsertGifImage",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertGifImage(t)}))}},{key:"InsertLine",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertLine(t)}))}},{key:"InsertItem",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertItem(t)}))}},{key:"InsertItemEx",value:function(t,e){var i=this;return this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.InsertItemEx(t,e)}))}},{key:"InsertBreak",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.InsertBreak()}))}},{key:"InsertPageBreak",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FPage.InsertPageBreak()}))}},{key:"InsertDomain",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.InsertDomain(t)}))}},{key:"InsertAnnotate",value:function(t,e){var i=this;return this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.InsertAnnotate(t,e)}))}},{key:"SetActiveImage",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.SetActiveImage(t)}))}},{key:"ActiveTableResetRowCol",value:function(t,e){var i=this;return this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.ActiveTableResetRowCol(t,e)}))}},{key:"ActiveTableInsertRowAfter",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.TableInsertRowAfter(t)}))}},{key:"ActiveTableInsertRowBefor",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.TableInsertRowBefor(t)}))}},{key:"ActiveTableDeleteCurRow",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ActiveTableDeleteCurRow()}))}},{key:"ActiveTableDeleteRowFrom",value:function(t,e){var i=this;return this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.ActiveTableDeleteRowFrom(t,e)}))}},{key:"ActiveTableSplitCurRow",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ActiveTableSplitCurRow()}))}},{key:"ActiveTableSplitCurCol",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ActiveTableSplitCurCol()}))}},{key:"ActiveTableInsertColAfter",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.TableInsertColAfter(t)}))}},{key:"ActiveTableInsertColBefor",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.TableInsertColBefor(t)}))}},{key:"ActiveTableDeleteCurCol",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ActiveTableDeleteCurCol()}))}},{key:"SectionCoordToPaper",value:function(t,e,i,n,o){return{x:e,y:i-(this.FViewModel==Bs?this.GetPageTopFilm(t):this.GetPageTop(t))}}},{key:"ApplyParaAlignHorz",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaAlignHorz(t),!0}))}},{key:"ApplyParaAlignVert",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaAlignVert(t),!0}))}},{key:"ApplyParaBackColor",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaBackColor(t),!0}))}},{key:"ApplyParaBreakRough",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaBreakRough(t),!0}))}},{key:"ApplyParaLineSpace",value:function(t,e){var i=this;this.DoSectionDataAction(this.FActiveData,(function(){return i.FActiveData.ApplyParaLineSpace(t,e),!0}))}},{key:"ApplyParaLeftIndent",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaLeftIndent(t),!0}))}},{key:"ApplyParaRightIndent",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaRightIndent(t),!0}))}},{key:"ApplyParaFirstIndent",value:function(t){var e=this;this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.ApplyParaFirstIndent(t),!0}))}},{key:"ApplyBullet",value:function(t,e,i,n){var o=this;this.DoSectionDataAction(this.FActiveData,(function(){return o.FActiveData.ApplyBullet(t,e,i,n),!0}))}},{key:"DataAction",value:function(t,e){return this.DoSectionDataAction(t,e)}},{key:"GetPageCaretInfo",value:function(t){var e=-1,i=-1;i=this.FStyle.UpdateInfo.DragingSelected?this.FMousePageIndex:this.FActivePageIndex,this.FActiveData.SelectInfo.StartItemNo<0||i<0?t.Visible=!1:(t.PageIndex=i,this.FActiveData.GetCaretInfoCur(t),t.Visible&&(this.FActiveData==this.FPage&&i!=(e=this.GetPageIndexByFormat(t.Y))&&(i=e,this.SetActivePageIndex(i)),this.FViewModel==Bs?(e=this.GetPageMarginLeft(i),t.X=t.X+e,t.Y=t.Y+this.GetPageTopFilm(i),this.FActiveData==this.FHeader?t.Y=t.Y+this.GetHeaderPageDrawTop():this.FActiveData==this.FPage?t.Y=t.Y+this.GetHeaderAreaHeight()-this.GetPageDataFmtTop(i):this.FActiveData==this.FFooter&&(t.Y=t.Y+this.FPaper.HeightPix-this.FPaper.MarginBottomPix)):(t.Y=t.Y+this.GetPageTop(i),this.FActiveData==this.FPage&&(t.Y=t.Y-this.GetPageDataFmtTop(i)))))}},{key:"PaintHeader",value:function(t,e,i,n,o,r,s,a,l,h){var c=s+t;t>0&&(c=t+s);var u=t+this.GetHeaderPageDrawTop();if(null!=this.OnPaintHeaderBefor){l.save();try{this.OnPaintHeaderBefor(this,a,new U(i,u,n,e),l,h)}finally{l.restore()}}if(this.FHeader.PaintData(i,u,n,e,Math.max(u,0),c,0,l,h),null!=this.OnPaintHeaderAfter){l.save();try{this.OnPaintHeaderAfter(this,a,U.Create(i,u,n,e),l,h)}finally{l.restore()}}}},{key:"PaintFooter",value:function(t,e,i,n,o,r,s,a,l){var h=l.WindowHeight-n;if(h=h>this.FPaper.MarginBottomPix?t:l.WindowHeight,null!=this.OnPaintFooterBefor){a.save();try{this.OnPaintFooterBefor(this,s,U.Create(e,n,i,t),a,l)}finally{a.restore()}}if(this.FFooter.PaintData(e,n,i,t,Math.max(n,0),t+h,0,a,l),null!=this.OnPaintFooterAfter){a.save();try{this.OnPaintFooterAfter(this,s,U.Create(e,n,i,t),a,l)}finally{a.restore()}}}},{key:"PaintPage",value:function(t,e,i,n,o,r,s,a,l,h,c,u){if(!(this.FPages[h].StartDrawItemNo<0||this.FPages[h].EndDrawItemNo<0)){if(null!=this.OnPaintPageBefor){c.save();try{this.OnPaintPageBefor(this,h,U.Create(t,e,i,n),c,u)}finally{c.restore()}}if(this.FPage.PaintData(t,e,i,n,a,l,u.PageDataFmtTop,c,u),null!=this.OnPaintPageAfter){c.save();try{this.OnPaintPageAfter(this,h,U.Create(t,e,i,n),c,u)}finally{c.restore()}}}}},{key:"paintPaper",value:function(t,e,i,n,o){var r,s,a,l,h=Math.round(o.WindowWidth/o.ScaleX),c=Math.round(o.WindowHeight/o.ScaleY),u=e,f=i,d=0,m=0,y=0,p=0,S=0;if(o.ViewModel==Bs){r=e+this.FPaper.WidthPix,s=f+this.FPaper.HeightPix;var v=this.GetPageMarginLeftAndRight(t);a=u+(y=v.left),d=r-(p=v.right),l=f+(S=this.GetHeaderAreaHeight()),m=s-this.FPaper.MarginBottomPix}else a=u,d=r=e+this.GetPageWidth(),S=0,y=0,p=0,l=f,m=(s=i+this.GetPageHeight())-1;var F=Math.max(l,0),I=Math.min(m,c);o.PageDataFmtTop=this.GetPageDataFmtTop(t),n.save();try{if(o.Print||(n.brush.color=this.FStyle.BackgroundColor,n.fillRect(U.Create(u,f,Math.min(r,h),Math.min(s,c)))),null!=this.OnPaintPaperBefor){n.save();try{this.OnPaintPaperBefor(this,t,U.Create(u,f,r,s),n,o)}finally{n.restore()}}o.Print||(o.ViewModel==Bs?(l>0&&(S>this.FPaper.MarginTopPix&&(n.pen.style=pt.Dot,n.pen.color="rgb(211, 211, 211)",o.drawNoScaleLine(n,[G.Create(a,l-1),G.Create(d,l-1)])),this.FActiveData==this.FHeader?(n.pen.width=1,n.pen.color="blue",n.pen.style=pt.Solid,n.drawLine(a,l,d,l),n.drawLineByPointsDriect([G.Create(a,l),G.Create(a,f+this.FHeaderOffset),G.Create(d,f+this.FHeaderOffset),G.Create(d,l)]),n.brush.color="rgb(216, 232, 245)",n.fillRect(U.Create(a-40,l,a,l+20)),n.font.size=10,n.font.name="宋体",n.font.styles.clear(),n.font.color="rgb(21, 66, 139)",n.textOut(a-32,l+4,"页眉")):(n.pen.width=1,n.pen.color="gray",n.pen.style=pt.Solid),o.drawNoScaleLine(n,[G.Create(a-lp.PMSLineHeight,i+this.FPaper.MarginTopPix),G.Create(a,i+this.FPaper.MarginTopPix),G.Create(a,i+this.FPaper.MarginTopPix-lp.PMSLineHeight)]),o.drawNoScaleLine(n,[G.Create(d+lp.PMSLineHeight,i+this.FPaper.MarginTopPix),G.Create(d,i+this.FPaper.MarginTopPix),G.Create(d,i+this.FPaper.MarginTopPix-lp.PMSLineHeight)])),m<o.WindowHeight&&(this.FActiveData==this.FFooter?(n.pen.width=1,n.pen.color="blue",n.pen.style=pt.Solid,n.drawLine(a,m,d,m),n.brush.color="rgb(216, 232, 245)",n.fillRect(U.Create(a-40,m,a,m-20)),n.font.size=10,n.font.family="宋体",n.font.styles.clear(),n.font.color="rgb(21, 66, 139)",n.textOut(a-32,m-16,"页脚")):(n.pen.width=1,n.pen.color="gray",n.pen.style=pt.Solid),o.drawNoScaleLine(n,[G.Create(a-lp.PMSLineHeight,m),G.Create(a,m),G.Create(a,m+lp.PMSLineHeight)]),o.drawNoScaleLine(n,[G.Create(d+lp.PMSLineHeight,m),G.Create(d,m),G.Create(d,m+lp.PMSLineHeight)]))):(l>0&&(n.pen.width=1,n.pen.color="gray",n.pen.style=pt.DashDot,n.drawLine(u,l,r,l)),m<o.WindowHeight&&(n.pen.width=1,n.pen.color="gray",n.pen.style=pt.DashDot,n.drawLine(u,m,r,m))));var g=new U;if(o.ViewModel==Bs){if(l>0){g.reset(u,Math.max(f+this.FHeaderOffset,0),r,Math.min(l,o.WindowHeight)),n.save();try{n.clipRect(g),this.PaintHeader(f,l,a,d,y,p,S,t,n,o)}finally{n.restore()}}if(m<o.WindowHeight){g.reset(u,Math.max(m,0),r,Math.min(s,o.WindowHeight)),n.save();try{n.clipRect(g),this.PaintFooter(s,a,d,m,y,p,t,n,o)}finally{n.restore()}}}if(I>F){g.reset(u,Math.max(l,F),r,Math.min(m,I)+1),n.save();try{n.clipRect(g),this.PaintPage(a,l,d,m,y,p,S,F,I,t,n,o)}finally{n.restore()}}g.reset(u,f,r,s),n.save();try{n.clipRect(g),this.FHeader.PaintFloatItems(t,a,f+this.GetHeaderPageDrawTop(),0,n,o),this.FFooter.PaintFloatItems(t,a,m,0,n,o),this.FPage.PaintFloatItems(t,a,l,this.GetPageDataFmtTop(t),n,o)}finally{n.restore()}}finally{n.restore()}if(null!=this.OnPaintPaperAfter){n.save();try{this.OnPaintPaperAfter(this,t,U.Create(u,f,r,s),n,o)}finally{n.restore()}}}},{key:"Clear",value:function(){this.FHeader.Clear(),this.FFooter.Clear(),this.FPage.Clear(),this.FPages.ClearEx(),this.FActivePageIndex=0}},{key:"MouseDown",value:function(t){var e=!1,i=this.FActiveData.GetTopLevelData(),n=this.GetPageIndexByFilm(t.y);this.FActivePageIndex!=n&&(this.FActivePageIndex=n);var o=this.SectionCoordToPaper(this.FActivePageIndex,t.x,t.y,-1,-1),r=o.x,s=o.y,a=this.GetSectionDataAt(r,s);if(a!=this.FActiveData&&2==t.clicks&&this.FViewModel==Bs&&(this.SetActiveData(a),e=!0),this.FActiveData.FloatItems.count>0){var l=this.PaperCoordToData(this.FActivePageIndex,this.FActiveData,r,s,!1);this.FActiveData==this.FPage&&(l.y=l.y+this.GetPageDataFmtTop(this.FActivePageIndex));var h=new ei;if(h.assign(t),h.x=l.x,h.y=l.y,this.FActiveData.MouseDownFloatItem(h))return}if(r=(o=this.PaperCoordToData(this.FActivePageIndex,this.FActiveData,r,s)).x,s=o.y,this.FActiveData==this.FPage&&(s+=this.GetPageDataFmtTop(this.FActivePageIndex)),2!=t.clicks||e){var c=new ei;c.assign(t),c.x=r,c.y=s,this.FActiveData.MouseDown(c)}else this.FActiveData.DblClick(r,s);i!=this.FActiveData.GetTopLevelData()&&null!=this.OnChangeTopLevelData&&this.OnChangeTopLevelData(this,null)}},{key:"MouseMove",value:function(t){var e=this.GetPageMarginLeftAndRight(this.FMousePageIndex),i=e.left,n=e.right;t.x<i||t.x>this.FPaper.WidthPix-n?lp.GCursor=oe:lp.GCursor=ue,this.FMousePageIndex=this.GetPageIndexByFilm(t.y);var o,r=-1,s=-1;if(this.FActiveData.FloatItems.count>0){t.button==ee&&!or.keyDownStates[Re]&&this.FActiveData.FloatItemIndex>=0&&(this.FActiveData.ActiveFloatItem.Resizing||(this.FActiveData.ActiveFloatItem.PageIndex=this.FMousePageIndex)),this.FActiveData==this.FPage?this.FActiveData.FloatItemIndex>=0&&this.FActiveData.ActiveFloatItem.Resizing?(o=this.SectionCoordToPaper(this.FActiveData.ActiveFloatItem.PageIndex,t.x,t.y,r,s),r=(o=this.PaperCoordToData(this.FActiveData.ActiveFloatItem.PageIndex,this.FActiveData,o.x,o.y,!1)).x,s=o.y+this.GetPageDataFmtTop(this.FActiveData.ActiveFloatItem.PageIndex)):(o=this.SectionCoordToPaper(this.FMousePageIndex,t.x,t.y,r,s),r=(o=this.PaperCoordToData(this.FMousePageIndex,this.FActiveData,o.x,o.y,!1)).x,s=o.y+this.GetPageDataFmtTop(this.FMousePageIndex)):this.FActiveData.FloatItemIndex>=0&&this.FActiveData.ActiveFloatItem.Resizing?(o=this.SectionCoordToPaper(this.FActivePageIndex,t.x,t.y,r,s),r=(o=this.PaperCoordToData(this.FActivePageIndex,this.FActiveData,o.x,o.y,!1)).x,s=o.y):(o=this.SectionCoordToPaper(this.FMousePageIndex,t.x,t.y,r,s),r=(o=this.PaperCoordToData(this.FMousePageIndex,this.FActiveData,o.x,o.y,!1)).x,s=o.y);var a=new ei;if(a.assign(t),a.x=r,a.y=s,this.FActiveData.MouseMoveFloatItem(a))return}r=(o=this.SectionCoordToPaper(this.FMousePageIndex,t.x,t.y,r,s)).x,s=o.y;var l=this.GetSectionDataAt(r,s);l!=this.FMoveData&&(null!=this.FMoveData?this.FMoveData.SelectedResizing()||(this.FMoveData.MouseLeave(),this.FMoveData=l):this.FMoveData=l),r=(o=this.PaperCoordToData(this.FMousePageIndex,this.FActiveData,r,s,0!=t.button)).x,s=o.y,this.FActiveData==this.FPage&&(s+=this.GetPageDataFmtTop(this.FMousePageIndex));var h=new ei;h.assign(t),h.x=r,h.y=s,this.FActiveData.MouseMove(h)}},{key:"MouseUp",value:function(t){var e,i=this,n=this.GetPageIndexByFilm(t.y),o=-1,r=-1,s=null;if(!(this.FActiveData.FloatItems.count>0&&this.FActiveData.FloatItemIndex>=0&&(this.FActiveData==this.FPage?(e=this.SectionCoordToPaper(this.FActiveData.ActiveFloatItem.PageIndex,t.x,t.y,o,r),e=this.PaperCoordToData(this.FActiveData.ActiveFloatItem.PageIndex,this.FActiveData,e.x,e.y,!1),o=e.x,r=e.y+this.GetPageDataFmtTop(this.FActiveData.ActiveFloatItem.PageIndex)):(e=this.SectionCoordToPaper(n,t.x,t.y,o,r),e=this.PaperCoordToData(n,this.FActiveData,e.x,e.y,!1),o=e.x,r=e.y),(s=new ei).assign(t),s.x=o,s.y=r,this.FActiveData.MouseUpFloatItem(s))))if(e=this.SectionCoordToPaper(n,t.x,t.y,o,r),e=this.PaperCoordToData(n,this.FActiveData,e.x,e.y),o=e.x,r=e.y,this.FActiveData==this.FPage&&(r+=this.GetPageDataFmtTop(n)),this.FActiveData.SelectedResizing())this.DoSectionDataAction(this.FActiveData,(function(){var e=new ei;return e.assign(t),e.x=o,e.y=r,i.FActiveData.MouseUp(e),!0}));else{var a=new ei;a.assign(t),a.x=o,a.y=r,this.FActiveData.MouseUp(a)}}},{key:"GetPageTopFilm",value:function(t){for(var e=this.FPagePadding,i=0;i<=t-1;i++)e=e+this.FPaper.HeightPix+this.FPagePadding;return e}},{key:"GetPageTop",value:function(t){for(var e=0,i=this.GetPageHeight(),n=0;n<=t-1;n++)e+=i;return e}},{key:"GetPageDataFmtTop",value:function(t){var e=0;if(t>0)for(var i=this.GetPageHeight(),n=0;n<=t-1;n++)e+=i;return e}},{key:"GetHeaderPageDrawTop",value:function(){var t=this.FHeaderOffset,e=this.FHeader.height;return e<this.FPaper.MarginTopPix-this.FHeaderOffset&&(t+=Math.trunc((this.FPaper.MarginTopPix-this.FHeaderOffset-e)/2)),t}},{key:"GetPageDataHeight",value:function(t){return this.Page.DrawItems[this.FPages[t].EndDrawItemNo].rect.bottom-this.Page.DrawItems[this.FPages[t].StartDrawItemNo].rect.top}},{key:"GetPageMarginLeft",value:function(t){return this.GetPageMarginLeftAndRight(t).left}},{key:"GetPageMarginLeftAndRight",value:function(t){return this.FSymmetryMargin&&or.system.isOdd(t)?{left:this.FPaper.MarginRightPix,right:this.FPaper.MarginLeftPix}:{left:this.FPaper.MarginLeftPix,right:this.FPaper.MarginRightPix}}},{key:"_FormatNewPage",value:function(t,e,i){this.FPages[t].EndDrawItemNo=e;var n=new iF;return n.StartDrawItemNo=i,this.FPages.insert(t+1,n),++t}},{key:"_RectItemCheckPage",value:function(t,e,i,n,o,r,s,a,l){var h=0,c=0;if(this.FPage.DrawItems[t].rect.bottom>l){if(this.FPages[o].StartDrawItemNo==t&&0==e&&!n.CanPageBreak)return s+=h=l-this.FPage.DrawItems[t].rect.bottom,this.FPage.DrawItems[t].rect.bottom=this.FPage.DrawItems[t].rect.bottom+h,n.Height=n.Height+h,{pageIndex:o,breakSeat:r,suplus:s,pageFmtTop:a,pageFmtBottom:l};var u=U.CreateByRect(this.FPage.DrawItems[t].rect);(t==this.FPage.DrawItems.count-1||this.FPage.DrawItems[t+1].LineFirst)&&u.inFlate(0,-Math.trunc(this.FPage.GetLineBlankSpace(t)/2));var f=n.CheckFormatPageBreak(this.FPages.count-1,u.top,u.bottom,a,l,e,r,c,h);if(r=f.breakSeat,c=f.fmtOffset,h=f.fmtHeightInc,!(r<0))return c>0?(s=s+(c+=this.FPage.GetLineBlankSpace(t)/2)+h,this.FPage.DrawItems[t].rect.offset(0,c),l=(a=l)+i,o=this._FormatNewPage(o,t-1,t),this._RectItemCheckPage(t,e,i,n,o,r,s,a,l)):(s+=h,this.FPage.DrawItems[t].rect.bottom=this.FPage.DrawItems[t].rect.bottom+h,n.Height=n.Height+h,l=(a=l)+i,o=this._FormatNewPage(o,t,t),this._RectItemCheckPage(t,e,i,n,o,r,s,a,l));s=s+l-u.bottom}else(h=n.CheckPageSurplus(l-this.FPage.DrawItems[t].rect.bottom,h))>0&&(s+=h,this.FPage.DrawItems[t].rect.bottom=this.FPage.DrawItems[t].rect.bottom+h,n.Height=n.Height+h);return{pageIndex:o,breakSeat:r,suplus:s,pageFmtTop:a,pageFmtBottom:l}}},{key:"_FormatRectItemCheckPageBreak",value:function(t,e,i,n,o){var r=0,s=0,a=this.FPage.Items[this.FPage.DrawItems[t].ItemNo];a.CheckFormatPageBreakBefor();var l=this._RectItemCheckPage(t,0,e,a,i,s,r,n,o);if(i=l.pageIndex,s=l.breakSeat,r=l.suplus,n=l.pageFmtTop,o=l.pageFmtBottom,0!=r)for(var h=t+1;h<=this.FPage.DrawItems.count-1;h++)this.FPage.DrawItems[h].rect.offset(0,r);return{pageIndex:i,pageFmtTop:n,pageFmtBottom:o}}},{key:"_FormatTextItemCheckPageBreak",value:function(t,e,i,n,o){if(this.FPage.DrawItems[e].rect.bottom>n){for(var r=n-this.FPage.DrawItems[e].rect.top,s=e;s<=this.FPage.DrawItems.count-1;s++)this.FPage.DrawItems[s].rect.offset(0,r);n=(i=n)+t,o=this._FormatNewPage(o,e-1,e)}return{pageFmtTop:i,pageFmtBottom:n,pageIndex:o}}},{key:"BuildSectionPages",value:function(t){if(!(this.FPage.FormatCount>0)){for(var e=t,i=null;e>0&&!this.FPage.DrawItems[e].LineFirst;)e--;var n=0;if(--e>0)for(var o=this.FPages.count-1;o>=0;o--)if(e>=(i=this.FPages[o]).StartDrawItemNo&&e<=i.EndDrawItemNo){n=o;break}this.FPages.removeRange(n+1,this.FPages.count-n-1),0==this.FPages.count&&((i=new iF).StartDrawItemNo=0,this.FPages.add(i),n=0);for(var r=this.GetPageDataFmtTop(n),s=this.GetPageHeight(),a=r+s,l=0,h=null,c=e+1;c<=this.FPage.DrawItems.count-1;c++)if(this.FPage.DrawItems[c].LineFirst){if((h=this.FPage.Items[this.FPage.DrawItems[c].ItemNo]).PageBreak&&h.FirstDItemNo==c){if((l=a-this.FPage.DrawItems[c].rect.top)>0)for(var u=c;u<=this.FPage.DrawItems.count-1;u++)this.FPage.DrawItems[u].rect.offset(0,l);a=(r=a)+s,n=this._FormatNewPage(n,c-1,c)}if(this.FPage.GetDrawItemStyle(c)<cs.Null){var f=this._FormatRectItemCheckPageBreak(c,s,n,r,a);n=f.pageIndex,r=f.pageFmtTop,a=f.pageFmtBottom}else{var d=this._FormatTextItemCheckPageBreak(s,c,r,a,n);n=d.pageIndex,r=d.pageFmtTop,a=d.pageFmtBottom}}this.FPages[n].EndDrawItemNo=this.FPage.DrawItems.count-1,this.SetActivePageIndex(this.GetPageIndexByCurrent());for(var m=this.FPage.FloatItems.count-1;m>=0;m--)this.FPage.FloatItems[m].PageIndex>this.FPages.count-1&&this.FPage.FloatItems.delete(m)}}},{key:"DeleteSelected",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.DeleteSelected()}))}},{key:"DisSelect",value:function(){this.FActiveData.DisSelect()}},{key:"DeleteActiveAnnotate",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.DeleteActiveAnnotate()}))}},{key:"DeleteActiveDomain",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.DeleteActiveDomain()}))}},{key:"DeleteActiveDataItems",value:function(t,e,i){var n=this;return this.DoSectionDataAction(this.FActiveData,(function(){return n.FActiveData.DeleteActiveDataItems(t,e,i),!0}))}},{key:"MergeTableSelectCells",value:function(){var t=this;return this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.MergeTableSelectCells()}))}},{key:"TableApplyContentAlign",value:function(t){var e=this;return this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.TableApplyContentAlign(t)}))}},{key:"ReFormatActiveParagraph",value:function(){var t=this;this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ReFormatActiveParagraph(),!0}))}},{key:"ReFormatActiveItem",value:function(){var t=this;this.DoSectionDataAction(this.FActiveData,(function(){return t.FActiveData.ReFormatActiveItem(),!0}))}},{key:"GetHeaderAreaHeight",value:function(){var t=this.FHeaderOffset+this.FHeader.height;return t<this.FPaper.MarginTopPix&&(t=this.FPaper.MarginTopPix),t}},{key:"GetPageHeight",value:function(){return this.FPaper.HeightPix-this.GetHeaderAreaHeight()-this.FPaper.MarginBottomPix}},{key:"GetPageWidth",value:function(){return this.FPaper.WidthPix-this.FPaper.MarginLeftPix-this.FPaper.MarginRightPix}},{key:"GetFilmHeight",value:function(){return this.FViewModel==Bs?this.FPages.count*(this.FPagePadding+this.FPaper.HeightPix):this.FPages.count*this.GetPageHeight()}},{key:"GetFilmWidth",value:function(){return this.FPages.count*(this.FPagePadding+this.FPaper.WidthPix)}},{key:"MarkStyleUsed",value:function(t,e){e.has(dp.Header)&&this.FHeader.MarkStyleUsed(t),e.has(dp.Footer)&&this.FFooter.MarkStyleUsed(t),e.has(dp.Page)&&this.FPage.MarkStyleUsed(t)}},{key:"SaveToStream",value:function(t,e){var i=t.position;if(t.writeUInt64(i),this.DoSaveToStream(t),e.size>0){t.writeBoolean(this.FSymmetryMargin),t.writeByte(this.FPaperOrientation),t.writeBoolean(this.FPageNoVisible),t.writeInt32(this.FPageNoFrom),lp.HCSaveTextToStream(t,this.FPageNoFormat),this.FPaper.SaveToStream(t);var n=e.has(dp.Header);t.writeBoolean(n),n=e.has(dp.Footer),t.writeBoolean(n),n=e.has(dp.Page),t.writeBoolean(n),e.has(dp.Header)&&(t.writeInt32(this.FHeaderOffset),this.FHeader.SaveToStream(t)),e.has(dp.Footer)&&this.FFooter.SaveToStream(t),e.has(dp.Page)&&this.FPage.SaveToStream(t)}var o=t.position;t.position=i,i=o-i-8,t.writeUInt64(i),t.position=o}},{key:"SaveToText",value:function(){return this.FPage.SaveToText()}},{key:"LoadFromStream",value:function(t,e,i){t.readInt64(),i>41&&this.DoLoadFromStream(t,i),this.FSymmetryMargin=t.readBoolean(),i>11&&(this.FPaperOrientation=t.readByte(),this.FPageNoVisible=t.readBoolean()),i>45&&(this.FPageNoFrom=t.readInt32(),this.FPageNoFormat=lp.HCLoadTextFromStream(t,i),this.FPageNoFormat=this.FPageNoFormat.replace("%d","{0}"),this.FPageNoFormat=this.FPageNoFormat.replace("%d","{1}")),this.FPaper.LoadFromStream(t,i),this.FPage.Width=this.GetPageWidth();var n=new Set([]);t.readBoolean()&&n.add(dp.Header),t.readBoolean()&&n.add(dp.Footer),t.readBoolean()&&n.add(dp.Page),n.has(dp.Header)&&(this.FHeaderOffset=t.readInt32(),this.FHeader.Width=this.FPage.Width,this.FHeader.LoadFromStream(t,this.FStyle,i)),n.has(dp.Footer)&&(this.FFooter.Width=this.FPage.Width,this.FFooter.LoadFromStream(t,this.FStyle,i)),n.has(dp.Page)&&this.FPage.LoadFromStream(t,this.FStyle,i),this.BuildSectionPages(0)}},{key:"InsertStream",value:function(t,e,i){var n=this;return this.DoSectionDataAction(this.FActiveData,(function(){return n.FActiveData.InsertStream(t,e,i)}))}},{key:"FormatData",value:function(){this.FHeader.ReFormat(),this.Footer.ReFormat(),this.FPage.ReFormat()}},{key:"ActiveDataSetSelectBound",value:function(t,e,i,n){this.FActiveData.SetSelectBound(t,e,i,n,!1),this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.FStyle.UpdateInfoReScroll(),this.DoActiveDataCheckUpdateInfo()}},{key:"Undo",value:function(t){var e=this;this.DoDataGetUndoList().GroupWorking?t.Data.Undo(t):(this.FActiveData!=t.Data&&this.SetActiveData(t.Data),this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.Undo(t),!0})))}},{key:"Redo",value:function(t){var e=this;this.DoDataGetUndoList().GroupWorking?t.Data.Redo(t):(this.FActiveData!=t.Data&&this.SetActiveData(t.Data),this.DoSectionDataAction(this.FActiveData,(function(){return e.FActiveData.Redo(t),!0})))}},{key:"Style",get:function(){return this.FStyle}},{key:"PaperSize",get:function(){return this.GetPaperSize()},set:function(t){this.SetPaperSize(t)}},{key:"PaperWidth",get:function(){return this.GetPaperWidth()},set:function(t){this.SetPaperWidth(t)}},{key:"PaperHeight",get:function(){return this.GetPaperHeight()},set:function(t){this.SetPaperHeight(t)}},{key:"PaperMarginTop",get:function(){return this.GetPaperMarginTop()},set:function(t){this.SetPaperMarginTop(t)}},{key:"PaperMarginLeft",get:function(){return this.GetPaperMarginLeft()},set:function(t){this.SetPaperMarginLeft(t)}},{key:"PaperMarginRight",get:function(){return this.GetPaperMarginRight()},set:function(t){this.SetPaperMarginRight(t)}},{key:"PaperMarginBottom",get:function(){return this.GetPaperMarginBottom()},set:function(t){this.SetPaperMarginBottom(t)}},{key:"PaperOrientation",get:function(){return this.FPaperOrientation},set:function(t){this.FPaperOrientation=t}},{key:"PaperWidthPix",get:function(){return this.GetPaperWidthPix()}},{key:"PaperHeightPix",get:function(){return this.GetPaperHeightPix()}},{key:"PaperMarginTopPix",get:function(){return this.GetPaperMarginTopPix()}},{key:"PaperMarginLeftPix",get:function(){return this.GetPaperMarginLeftPix()}},{key:"PaperMarginRightPix",get:function(){return this.GetPaperMarginRightPix()}},{key:"PaperMarginBottomPix",get:function(){return this.GetPaperMarginBottomPix()}},{key:"HeaderOffset",get:function(){return this.FHeaderOffset},set:function(t){this.SetHeaderOffset(t)}},{key:"Header",get:function(){return this.FHeader}},{key:"Footer",get:function(){return this.FFooter}},{key:"Page",get:function(){return this.FPage}},{key:"CurStyleNo",get:function(){return this.GetCurStyleNo()}},{key:"CurParaNo",get:function(){return this.GetCurParaNo()}},{key:"ActiveData",get:function(){return this.FActiveData},set:function(t){this.SetActiveData(t)}},{key:"ActiveArea",get:function(){return this.GetActiveArea()}},{key:"ActivePageIndex",get:function(){return this.FActivePageIndex}},{key:"ViewModel",get:function(){return this.FViewModel},set:function(t){this.FViewModel!=t&&(this.FViewModel=t,this.SetActiveData(this.FPage))}},{key:"SymmetryMargin",get:function(){return this.FSymmetryMargin},set:function(t){this.FSymmetryMargin=t}},{key:"DisplayFirstPageIndex",get:function(){return this.FDisplayFirstPageIndex},set:function(t){this.FDisplayFirstPageIndex=t}},{key:"DisplayLastPageIndex",get:function(){return this.FDisplayLastPageIndex},set:function(t){this.FDisplayLastPageIndex=t}},{key:"PageCount",get:function(){return this.GetPageCount()}},{key:"PageNoVisible",get:function(){return this.FPageNoVisible},set:function(t){this.FPageNoVisible=t}},{key:"PageNoFrom",get:function(){return this.FPageNoFrom},set:function(t){this.FPageNoFrom=t}},{key:"PageNoFormat",get:function(){return this.FPageNoFormat},set:function(t){this.FPageNoFormat!=t&&(this.FPageNoFormat=t,this.DoActiveDataCheckUpdateInfo())}},{key:"PagePadding",get:function(){return this.FPagePadding},set:function(t){this.FPagePadding=t}},{key:"ReadOnly",get:function(){return this.GetReadOnly()},set:function(t){this.SetReadOnly(t)}}]),i}(L));function xF(t){return(xF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function AF(t,e,i){return(AF="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=GF(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function TF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OF(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function NF(t,e,i){return e&&OF(t.prototype,e),i&&OF(t,i),t}function BF(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&EF(t,e)}function EF(t,e){return(EF=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function MF(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=GF(t);if(e){var o=GF(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return LF(this,i)}}function LF(t,e){return!e||"object"!==xF(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function GF(t){return(GF=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var HF=function(t){BF(i,t);var e=MF(i);function i(){var t;return TF(this,i),(t=e.call(this)).FWidth=100,t.FText="",t.onChange=null,t}return NF(i,[{key:"setWidth",value:function(t){this.FWidth!=t&&(this.FWidth=t,this.doChange())}},{key:"setText",value:function(t){this.FText!=t&&(this.FText=t,this.doChange())}},{key:"doChange",value:function(){null!=this.onChange&&this.onChange(this)}},{key:"width",get:function(){return this.FWidth},set:function(t){this.setWidth(t)}},{key:"text",get:function(){return this.FText},set:function(t){this.setText(t)}}]),i}(L),UF=function(t){BF(i,t);var e=MF(i);function i(){var t;return TF(this,i),(t=e.call(this)).FStatuses=new V(!0),t}return NF(i,[{key:"DoStatusChange",value:function(t){this.update()}},{key:"paintToEx",value:function(t){if(AF(GF(i.prototype),"paintToEx",this).call(this,t),this.orientation==Yt&&this.FStatuses.count>0){t.brush.color="#52596b",t.fillRect(U.Create(2,2,this.leftBtnRect_.left,this.height-2)),t.font.size=8,t.font.color="#d0d1d5",t.font.name="宋体",t.font.styles.clear();for(var e=2,n=Math.trunc((this.height-t.font.height)/2),o="",r=0,s=this.FStatuses.count;r<s;r++)o=this.FStatuses[r].text,t.textOut(e,n,o),e+=this.FStatuses[r].width+2}}},{key:"addStatus",value:function(t){var e=this,i=new HF;i.onChange=function(){e.DoStatusChange()},i.width=t,this.FStatuses.add(i);for(var n=0,o=0,r=this.FStatuses.count;o<r;o++)n+=this.FStatuses[o].width;this.leftBlank_=n,this.update()}},{key:"Statuses",get:function(){return this.FStatuses}}]),i}(mi);function VF(t){return(VF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function WF(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function zF(t,e,i){return(zF="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=YF(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function jF(t,e){return(jF=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function XF(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=YF(t);if(e){var o=YF(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return KF(this,i)}}function KF(t,e){return!e||"object"!==VF(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function YF(t){return(YF=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var JF=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&jF(t,e)}(r,t);var e,i,n,o=XF(r);function r(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),e=o.call(this,300,155);var i=new en("查找");i.left=20,i.top=10,e.cbbKey=new Cn(""),e.cbbKey.left=20,e.cbbKey.top=i.bottom+5,e.cbbKey.width=100,e.chkCase=new un("区分大小写"),e.chkCase.left=e.cbbKey.right+5,e.chkCase.top=e.cbbKey.top,e.btnSchPrev=new nn("查找上一处"),e.btnSchPrev.left=e.cbbKey.left,e.btnSchPrev.top=e.cbbKey.bottom+5,e.btnSchPrev.onClick=function(){t.Search(e.cbbKey.text,!0,e.chkCase.checked)||or.showMessage("向前查找完成,未到关键字!")},e.btnSchNext=new nn("查找下一处"),e.btnSchNext.left=e.btnSchPrev.right+10,e.btnSchNext.top=e.btnSchPrev.top,e.btnSchNext.onClick=function(){t.Search(e.cbbKey.text,!1,e.chkCase.checked)||or.showMessage("向后查找完成,未找到关键字!")};var n=new en("替换为");n.left=20,n.top=e.btnSchPrev.bottom+10,e.edtReplace=new dn(""),e.edtReplace.left=20,e.edtReplace.top=n.bottom+5,e.edtReplace.width=100,e.btnReplace=new nn("替 换"),e.btnReplace.left=e.edtReplace.right+5,e.btnReplace.top=e.edtReplace.top,e.btnReplace.onClick=function(){""!=e.edtReplace.text?(t.ActiveSection.SelectExists()&&t.Replace(e.edtReplace.text),t.Search(e.cbbKey.text,!1,e.chkCase.checked)||or.showMessage("向后查找完成,未到关键字!")):or.showMessage("不能替换为空内容!")},e.beginUpdate();try{e.caption="查找",e.addControl(i),e.addControl(e.cbbKey),e.addControl(e.chkCase),e.addControl(e.btnSchPrev),e.addControl(e.btnSchNext),e.addControl(n),e.addControl(e.edtReplace),e.addControl(e.btnReplace)}finally{e.endUpdate()}return e}return e=r,(i=[{key:"doPaintBackground_",value:function(t){t.brush.color=or.theme.backgroundStaticColor,t.fillRectShadow(this.clientRect(),or.theme.shadow)}},{key:"show",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$n;zF(YF(r.prototype),"show",this).call(this,t),this.cbbKey.setFocus()}}])&&WF(e.prototype,i),n&&WF(e,n),r}(ro);function ZF(t,e,i){return(ZF="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=sI(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function qF(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function QF(t,e,i){return e&&qF(t.prototype,e),i&&qF(t,i),t}function $F(t){return($F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eI(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&iI(t,e)}function iI(t,e){return(iI=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function nI(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=sI(t);if(e){var o=sI(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return oI(this,i)}}function oI(t,e){return!e||"object"!==$F(e)&&"function"!=typeof e?rI(t):e}function rI(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sI(t){return(sI=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var aI=function(t){eI(i,t);var e=nI(i);function i(){var t;return tI(this,i),(t=e.call(this)).DrawRect=new U,t.AnnotateItem=null,t.Data=null,t.rect=new U,t}return i}(L),lI=function(t){eI(i,t);var e=nI(i);function i(){var t;return tI(this,i),(t=e.call(this)).Title,t.Text,t}return i}(aI),hI=function(){function t(){tI(this,t),this.FDrawAnnotates=new V,this.FCount=0,this.FVisible=!1,this.FMouseIn=!1,this.FActiveDrawAnnotateIndex=-1,this.FDrawRect=new U,this.FOnUpdateView=null}return QF(t,[{key:"_getDrawCount",value:function(){return this.FDrawAnnotates.count}},{key:"_getDrawAnnotateAt",value:function(t,e){return this._getDrawAnnotateAtPt(G.Create(t,e))}},{key:"_getDrawAnnotateAtPt",value:function(t){for(var e=-1,i=0;i<this.FDrawAnnotates.count;i++)if(this.FDrawAnnotates[i].rect.pointIn(t))return void(e=i);return e}},{key:"_doUpdateView",value:function(){null!=this.FOnUpdateView&&this.FOnUpdateView(this)}},{key:"PaintDrawAnnotate",value:function(t,e,i,n){if(this.FDrawRect.reset(e.right,e.top,e.right+lp.AnnotationWidth,e.bottom),n.Print||(this.FMouseIn?i.brush.color="#d0d1d5":i.brush.color="#f4f4f4",i.fillRect(this.FDrawRect)),this.FDrawAnnotates.count>0){for(var o=-1,r=-1,s=null,a="",l=t,h=l.GetHeaderAreaHeight(),c=e.top+h-n.PageDataFmtTop,u=n.PageDataFmtTop+c,f=u+l.PaperHeightPix-h-l.PaperMarginBottomPix,d=0;d<=this.FDrawAnnotates.count-1&&!((s=this.FDrawAnnotates[d]).DrawRect.top>f);d++)s.DrawRect.bottom>u&&(r=d,o<0&&(o=d));if(o>=0){i.font.size=8,i.font.name="宋体",i.font.color=at.Black,u=this.FDrawAnnotates[o].DrawRect.top;for(var m=o;m<=r;m++){if((s=this.FDrawAnnotates[m]).DrawRect.top>u&&(u=s.DrawRect.top),a=s.isClass(lI)?s.Title+":"+s.Text:s.AnnotateItem.Content.Title+":"+s.AnnotateItem.Content.Text,s.rect.reset(0,0,lp.AnnotationWidth-30,i.font.height),i.getTextRect(m.toString()+a,s.rect),s.rect.right<lp.AnnotationWidth-30&&(s.rect.right=lp.AnnotationWidth-30),null!=s.AnnotateItem&&s.AnnotateItem.Replys.count>0){s.rect.bottom+=20*s.AnnotateItem.Replys.count;for(var y=0;y<s.AnnotateItem.Replys.count;y++);}s.rect.offset(e.right+20,u+5),s.rect.inFlate(5,5),u=s.rect.bottom+5}if(this.FDrawAnnotates[r].rect.bottom>e.bottom){c=this.FDrawAnnotates[r].rect.bottom-e.bottom+5;var p=0,S=-1;u=this.FDrawAnnotates[r].rect.top;for(var v=r;v>=o;v--){if((c-=p=u-this.FDrawAnnotates[v].rect.bottom-5)<=0){S=v+1,c<0&&(p+=c);break}u=this.FDrawAnnotates[v].rect.top}S<0&&(S=o,(p=this.FDrawAnnotates[o].rect.top-e.top-5)>c&&(p=c)),this.FDrawAnnotates[S].rect.offset(0,-p),u=this.FDrawAnnotates[S].rect.bottom+5;for(var F=S;F<=r;F++)c=u-this.FDrawAnnotates[F].rect.top,this.FDrawAnnotates[F].rect.offset(0,c),u=this.FDrawAnnotates[F].rect.bottom+5}var I,g=new U;i.pen.color=at.Red;for(var w=o;w<=r;w++){(s=this.FDrawAnnotates[w]).isClass(lI)?(a=s.Title+":"+s.Text,i.pen.style=pt.Dot,i.pen.width=1,i.brush.color=lp.AnnotateBKColor):(a=s.AnnotateItem.Content.Title+":"+s.AnnotateItem.Content.Text,(I=s.Data).HotAnnotate.EndNo>=0&&s.AnnotateItem==I.HotAnnotate.Data.Items[I.HotAnnotate.EndNo]?(i.pen.style=pt.Solid,i.pen.width=1,i.brush.color=lp.AnnotateBKActiveColor):I.ActiveAnnotate.EndNo>=0&&s.AnnotateItem==I.ActiveAnnotate.Data.Items[I.ActiveAnnotate.EndNo]?(i.pen.style=pt.Solid,i.pen.width=2,i.brush.color=lp.AnnotateBKActiveColor):(i.pen.style=pt.Dot,i.pen.width=1,i.brush.color=lp.AnnotateBKColor)),n.Print&&(i.brush.style=Ft),i.fillRoundRect(s.rect,5),g.resetRect(s.rect),g.inFlate(-5,-5),i.textOutRect(w.toString()+a,g),i.brush.style=Ft,i.beginPath();try{i.moveTo(s.DrawRect.right,s.DrawRect.bottom),i.lineTo(e.right,s.DrawRect.bottom),i.lineTo(s.rect.left,g.top)}finally{i.paintPath()}}}}}},{key:"InsertDataAnnotate",value:function(t){this.FCount++,this.FVisible=!0}},{key:"RemoveDataAnnotate",value:function(t){this.FCount--,0==this.FCount&&(this.FVisible=!1)}},{key:"AddDrawAnnotate",value:function(t){this.FDrawAnnotates.add(t)}},{key:"ClearDrawAnnotate",value:function(){this.FDrawAnnotates.clear()}},{key:"MouseDown",value:function(t,e){this.FActiveDrawAnnotateIndex=this._getDrawAnnotateAt(t,e)}},{key:"MouseMove",value:function(t,e){this.MouseIn=this.FDrawRect.pointInAt(t,e)}},{key:"DrawCount",get:function(){return this._getDrawCount()}},{key:"DrawAnnotates",get:function(){return this.FDrawAnnotates}},{key:"Visible",get:function(){return this.FVisible}},{key:"Count",get:function(){return this.FCount}},{key:"DrawRect",get:function(){return this.FDrawRect}},{key:"MouseIn",get:function(){return this.FMouseIn},set:function(t){this.FMouseIn!=t&&(this.FMouseIn=t,this._doUpdateView())}},{key:"ActiveDrawAnnotateIndex",get:function(){return this.FActiveDrawAnnotateIndex}},{key:"OnUpdateView",get:function(){return this.FOnUpdateView},set:function(t){this.FOnUpdateView=t}}]),t}(),cI=function(t){eI(i,t);var e=nI(i);function i(){var t;return tI(this,i),(t=e.call(this)).width_=500,t.height_=500,t.color=at.rgbaToColor(82,89,107),t.canFocus=!0,t.cursor=ue,t._canvas=document.createElement("canvas"),t._context=t._canvas.getContext("2d"),t.FDataBmpCanvas=new Dt(t._context),t.FDataBmpCanvas.prepareConext(or._scale),sr.Initialization(),0==lp.HCExtFormat&&(lp.HCExtFormat=or.clipboard.registerFormat()),t.FUndoList=new Ta,t.FUndoList.OnUndo=function(e){t.DoUndo(e)},t.FUndoList.OnRedo=function(e){t.DoRedo(e)},t.FUndoList.OnUndoNew=function(){return t.DoUndoNew()},t.FUndoList.OnUndoGroupStart=function(e,i){return t.DoUndoGroupBegin(e,i)},t.FUndoList.OnUndoGroupEnd=function(e,i){return t.DoUndoGroupEnd(e,i)},t.FUndoList.OnUndoDestroy=function(e){t.DoUndoDestroy(e)},t.FAnnotatePre=new hI,t.FAnnotatePre.OnUpdateView=function(e){t.DoAnnotatePreUpdateView(e)},t.BKCanvas=document.createElement("canvas"),t.BKContext=t.BKCanvas.getContext("2d"),t.BKImage=null,t.FBKImageVisible=!1,t.BKImagePrintVisible=!1,t.FBKImageLayout=vp,t.FUpdateCount=0,t.FFileName="",t.FViewWidth=0,t.FViewHeight=0,t.FIsChanged=!1,t.FCanEditChecked=!1,t.FCanEditSnapShot=!1,t.FZoom=1,t.FAutoZoom=!1,t.FPrintView=!1,t.FViewModel=Bs,t.FHScrollBarAutoVisible=!1,t.FPagePadding=20,t.ExtrnalCP=!0,t.FStyle=new cs(!0,!0),t.FStyle.OnInvalidateRect=function(e){t.DoStyleInvalidateRect(e)},t.FSections=new V,t.FSections.add(t.NewDefaultSection()),t.FActiveSectionIndex=0,t.FDisplayFirstSection=0,t.FDisplayLastSection=0,t.FVScrollBar=new Xv,t.FVScrollBar.orientation=Jt,t.FVScrollBar.align=Vt,t.FVScrollBar.onScroll=function(e,i,n){t.DoVerScroll(e,i,n)},t.FVScrollBar.OnPageUpClick=function(e){t.DoPageUp(e)},t.FVScrollBar.OnPageDownClick=function(e){t.DoPageDown(e)},t.FHScrollBar=new UF,t.FHScrollBar.orientation=Yt,t.FHScrollBar.addStatus(100),t.FHScrollBar.align=Vt,t.FHScrollBar.onScroll=function(e,i,n){t.DoHorScroll(e,i,n)},t.controls.add(t.FHScrollBar),t.controls.add(t.FVScrollBar),t.btnInfo=new on(""),t.btnInfo.textVisible=!1,t.btnInfo.image.src=or.application.icon.src,t.btnInfo.onClick=function(){null!=t.ShowCopyRight?t.ShowCopyRight():or.showMessage("欢迎使用HCView!")},t.controls.add(t.btnInfo),t.handle_=or.handleAllocate(),t.FCaret=new Rp,t.FCaret.control=rI(t),t.imeMode=Mi,t.FFrmSearch=null,t.OnCaretChange=null,t.OnVerScroll=null,t.OnHorScroll=null,t.OnSectionCreateItem=null,t.OnSectionReadOnlySwitch=null,t.OnSectionCurParaNoChange=null,t.OnSectionActivePageChange=null,t.OnSectionCreateStyleItem=null,t.OnSectionCaretItemChanged=null,t.OnSectionDataDomainSwitch=null,t.OnSectionCanEdit=null,t.OnSectionInsertTextBefor=null,t.OnSectionInsertItem=null,t.OnSectionRemoveItem=null,t.OnSectionDrawItemMouseMove=null,t.OnSectionSaveItem=null,t.OnSectionAcceptAction=null,t.OnSectionDrawItemPaintAfter=null,t.OnSectionDrawItemPaintBefor=null,t.OnSectionFloatItemPaintAfter=null,t.OnSectionPaintHeaderBefor=null,t.OnSectionPaintHeaderAfter=null,t.OnSectionPaintFooterBefor=null,t.OnSectionPaintFooterAfter=null,t.OnSectionPaintPageBefor=null,t.OnSectionPaintPageAfter=null,t.OnSectionPaintPaperBefor=null,t.OnSectionPaintPaperAfter=null,t.OnPaintViewBefor=null,t.OnPaintViewAfter=null,t.OnChange=null,t.OnChangedSwitch=null,t.OnZoomChanged=null,t.OnViewResize=null,t.OnStyleLoaded=null,t.CalcScrollRang(),t}return QF(i,[{key:"dispose",value:function(){this.FStyle.States.Include(Ip.Destroying),ZF(sI(i.prototype),"dispose",this).call(this)}},{key:"SetPrintBySectionInfo",value:function(t,e){}},{key:"GetViewWidth",value:function(){this.FVScrollBar.visible?this.FViewWidth=this.width-this.FVScrollBar.width:this.FViewWidth=this.width}},{key:"GetViewHeight",value:function(){this.FHScrollBar.visible?this.FViewHeight=this.height-this.FHScrollBar.height:this.FViewHeight=this.height}},{key:"GetSymmetryMargin",value:function(){return this.ActiveSection.SymmetryMargin}},{key:"SetSymmetryMargin",value:function(t){this.ActiveSection.SymmetryMargin!=t&&(this.ActiveSection.SymmetryMargin=t,this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),this.DoMapChanged(),this.DoViewResize())}},{key:"SetBKImageVisible",value:function(t){this.FBKImageVisible!=t&&(this.FBKImageVisible=t,this.UpdateView())}},{key:"SetBKImageLayout",value:function(t){this.FBKImageLayout!=t&&(this.FBKImageLayout=t,this.UpdateView())}},{key:"DoVerScroll",value:function(t,e,i){this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),this.CheckUpdateInfo(),this.GetPagesAndActive(),null!=this.OnVerScroll&&this.OnVerScroll(this)}},{key:"DoHorScroll",value:function(t,e,i){this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),this.CheckUpdateInfo(),null!=this.OnHorScroll&&this.OnHorScroll(this)}},{key:"DoSectionDataChange",value:function(t){this.DoChange()}},{key:"DoSetChange",value:function(){this.FCanEditChecked=!1,this.SetIsChanged(!0),null!=this.OnChange&&this.OnChange(this)}},{key:"DoSectionChangeTopLevelData",value:function(t){this.DoViewResize()}},{key:"DoSectionDataCheckUpdateInfo",value:function(t){this.CheckUpdateInfo()}},{key:"DoLoadFromStream",value:function(t,e,i){var n=this;t.position=0;var o=lp._LoadFileFormatAndVersion(t),r=o.fileExt,s=o.fileVersion;if(r!=lp.HC_EXT&&or.exception("加载失败,不是"+lp.HC_EXT+"文件!"),s>lp.HC_FileVersionInt&&or.exception("加载失败,当前编辑器最高支持版本为"+lp.HC_FileVersionInt.toString()+"的文件,无法打开版本为"+s.toString()+"的文件!"),this.DoLoadStreamBefor(t,s),e.LoadFromStream(t,s),null!=this.OnStyleLoaded&&this.OnStyleLoaded(e,s),s>55){var a=t.readByte();this.FBKImageVisible=or.system.isOdd(a>>7),this.BKImagePrintVisible=or.system.isOdd(a>>6),this.FBKImageLayout=t.readByte(),this.BKImage=lp.HCLoadImageFromStream(t),null!=this.BKImage&&(this.BKImage.onImageLoaded=function(){n.UpdateView()})}else this.BKImage=null;i(s,o.lang),this.DoLoadStreamAfter(t,s),this.DoMapChanged()}},{key:"DoUndoNew",value:function(){var t=new Pa;return t.SectionIndex=this.FActiveSectionIndex,t.HScrollPos=this.FHScrollBar.position,t.VScrollPos=this.FVScrollBar.position,t.Data=this.ActiveSection.ActiveData,t}},{key:"DoUndoGroupBegin",value:function(t,e){var i=new Ra;return i.SectionIndex=this.FActiveSectionIndex,i.HScrollPos=this.FHScrollBar.position,i.VScrollPos=this.FVScrollBar.position,i.Data=this.ActiveSection.ActiveData,i.CaretDrawItemNo=this.ActiveSection.ActiveData.CaretDrawItemNo,i}},{key:"DoUndoGroupEnd",value:function(t,e){var i=new Aa;return i.SectionIndex=this.FActiveSectionIndex,i.HScrollPos=this.FHScrollBar.position,i.VScrollPos=this.FVScrollBar.position,i.Data=this.ActiveSection.ActiveData,i.CaretDrawItemNo=this.ActiveSection.ActiveData.CaretDrawItemNo,i}},{key:"DoUndo",value:function(t){(t.isClass(Pa)||t.isClass(Ra))&&(this.FActiveSectionIndex!=t.SectionIndex&&this.SetActiveSectionIndex(t.SectionIndex),this.FHScrollBar.position=t.HScrollPos,this.FVScrollBar.position=t.VScrollPos),this.ActiveSection.Undo(t)}},{key:"DoRedo",value:function(t){(t.isClass(Pa)||t.isClass(Aa))&&(this.FActiveSectionIndex!=t.SectionIndex&&this.SetActiveSectionIndex(t.SectionIndex),this.FHScrollBar.position=t.HScrollPos,this.FVScrollBar.position=t.VScrollPos),this.ActiveSection.Redo(t)}},{key:"DoUndoDestroy",value:function(t){}},{key:"DoViewResize",value:function(){null!=this.OnViewResize&&this.OnViewResize(this)}},{key:"DoMapChanged",value:function(){0==this.FUpdateCount&&(this.CalcScrollRang(),this.CheckUpdateInfo())}},{key:"DoSectionReadOnlySwitch",value:function(t){null!=this.OnSectionReadOnlySwitch&&this.OnSectionReadOnlySwitch(this)}},{key:"DoSectionGetScreenCoord",value:function(t,e){var i=this.clientToScreen(G.Create(t,e));return G.Create(this.ZoomIn(i.x),this.ZoomIn(i.y))}},{key:"DoSectionItemResize",value:function(t,e){this.DoViewResize()}},{key:"DoSectionDrawItemAnnotate",value:function(t,e,i,n,o){var r=new aI;r.Data=e,r.DrawRect.resetRect(n),r.AnnotateItem=o,this.FAnnotatePre.AddDrawAnnotate(r)}},{key:"DoSectionGetUndoList",value:function(){return this.FUndoList}},{key:"DoSectionInsertAnnotate",value:function(t,e,i){this.FAnnotatePre.InsertDataAnnotate(i)}},{key:"DoSectionRemoveAnnotate",value:function(t,e,i){this.FAnnotatePre.RemoveDataAnnotate(i)}},{key:"DoSectionCurParaNoChange",value:function(t){null!=this.OnSectionCurParaNoChange&&this.OnSectionCurParaNoChange(t)}},{key:"DoSectionActivePageChange",value:function(t){null!=this.OnSectionActivePageChange&&this.OnSectionActivePageChange(t)}},{key:"DoStyleInvalidateRect",value:function(t){t?this.UpdateViewRect(t):this.UpdateView()}},{key:"DoAnnotatePreUpdateView",value:function(t){this.FAnnotatePre.Visible?(this.FStyle.UpdateInfoRePaint(),this.DoMapChanged()):this.UpdateView()}},{key:"NewDefaultSection",value:function(){var t=this,e=new _F(this.FStyle);return e.OnDataChange=function(e){t.DoSectionDataChange(e)},e.OnDataSetChange=function(){t.DoSetChange()},e.OnChangeTopLevelData=function(e){t.DoSectionChangeTopLevelData(e)},e.OnCheckUpdateInfo=function(e){t.DoSectionDataCheckUpdateInfo(e)},e.OnCreateItem=function(e){t.DoSectionCreateItem(e)},e.OnDataAcceptAction=function(e,i,n,o,r){return t.DoSectionAcceptAction(e,i,n,o,r)},e.OnCreateItemByStyle=function(e,i){return t.DoSectionCreateStyleItem(e,i)},e.OnPaintDomainRegion=function(e,i,n){return t.DoSectionPaintDomainRegion(e,i,n)},e.OnMatchTextStyleNoAt=function(e,i,n){return t.DoSectionMatchTextStyleNoAt(e,i,n)},e.OnCanEdit=function(e){return t.DoSectionCanEdit(e)},e.OnInsertTextBefor=function(e,i,n,o){return t.DoSectionInsertTextBefor(e,i,n,o)},e.OnInsertItem=function(e,i,n){t.DoSectionInsertItem(e,i,n)},e.OnRemoveItem=function(e,i,n){t.DoSectionRemoveItem(e,i,n)},e.OnSaveItem=function(e,i,n){return t.DoSectionSaveItem(e,i,n)},e.OnDrawItemMouseMove=function(e,i,n,o,r,s){t.DoSectionDrawItemMouseMove(e,i,n,o,r,s)},e.OnItemResize=function(e,i){t.DoSectionItemResize(e,i)},e.OnReadOnlySwitch=function(e){t.DoSectionReadOnlySwitch(e)},e.OnGetScreenCoord=function(e,i){return t.DoSectionGetScreenCoord(e,i)},e.OnDrawItemPaintAfter=function(e,i,n,o,r,s,a,l,h,c,u,f,d){t.DoSectionDrawItemPaintAfter(e,i,n,o,r,s,a,l,h,c,u,f,d)},e.OnDrawItemPaintBefor=function(e,i,n,o,r,s,a,l,h,c,u,f,d){t.DoSectionDrawItemPaintBefor(e,i,n,o,r,s,a,l,h,c,u,f,d)},e.OnPaintHeaderBefor=function(e,i,n,o,r){t.DoSectionPaintHeaderBefor(e,i,n,o,r)},e.OnPaintHeaderAfter=function(e,i,n,o,r){t.DoSectionPaintHeaderAfter(e,i,n,o,r)},e.OnPaintFooterBefor=function(e,i,n,o,r){t.DoSectionPaintFooterBefor(e,i,n,o,r)},e.OnPaintFooterAfter=function(e,i,n,o,r){t.DoSectionPaintFooterAfter(e,i,n,o,r)},e.OnPaintPageBefor=function(e,i,n,o,r){t.DoSectionPaintPageBefor(e,i,n,o,r)},e.OnPaintPageAfter=function(e,i,n,o,r){t.DoSectionPaintPageAfter(e,i,n,o,r)},e.OnPaintPaperBefor=function(e,i,n,o,r){t.DoSectionPaintPaperBefor(e,i,n,o,r)},e.OnPaintPaperAfter=function(e,i,n,o,r){t.DoSectionPaintPaperAfter(e,i,n,o,r)},e.OnInsertAnnotate=function(e,i,n){t.DoSectionInsertAnnotate(e,i,n)},e.OnRemoveAnnotate=function(e,i,n){t.DoSectionRemoveAnnotate(e,i,n)},e.OnDrawItemAnnotate=function(e,i,n,o,r){t.DoSectionDrawItemAnnotate(e,i,n,o,r)},e.OnGetUndoList=function(){return t.DoSectionGetUndoList()},e.OnCurParaNoChange=function(e){t.DoSectionCurParaNoChange(e)},e.OnCaretItemChanged=function(e,i,n){t.DoSectionCaretItemChanged(e,i,n)},e.OnDataDomainSwitch=function(e,i,n){t.DoSectionDataDomainSwitch(e,i,n)},e.OnActivePageChange=function(e){t.DoSectionActivePageChange(e)},e.OnFloatItemPaintAfter=function(e,i,n,o,r){t.DoSectionFloatItemPaintAfter(e,i,n,o,r)},e}},{key:"GetViewRect",value:function(){return U.CreateByBounds(0,0,this.FViewWidth,this.FViewHeight)}},{key:"GetPageIndexFilmTop",value:function(t){var e=this.GetSectionPageIndexByPageIndex(t,-1),i=e.pageIndex,n=e.result,o=this.GetSectionTopFilm(n);return i>0&&(this.FSections[n].ViewModel==Bs?o+=i*(this.FPagePadding+this.FSections[n].PaperHeightPix):o+=i*(this.FPagePadding+this.FSections[n].GetPageHeight())),o}},{key:"DoPageUp",value:function(t){var e=this.GetPagePreviewFirst();this.FVScrollBar.position=e>0?this.GetPageIndexFilmTop(e-1):0}},{key:"DoPageDown",value:function(t){var e=this.GetPagePreviewFirst();e<this.GetPageCount()-1?this.FVScrollBar.position=this.GetPageIndexFilmTop(e+1):this.FVScrollBar.position=this.FVScrollBar.max}},{key:"ReBuildCaret",value:function(){if(null!=this.FCaret)if(this.FStyle.UpdateInfo.DragingSelected||!this.ActiveSection.SelectExists()){var t=new bp;if(t.X=0,t.Y=0,t.Height=0,t.Visible=!0,this.ActiveSection.GetPageCaretInfo(t),this.focused&&t.Visible){if(t.Y+=this.GetSectionTopFilm(this.FActiveSectionIndex),this.FVScrollBar.SetAreaPos(-1,t.Y,t.Height),this.FCaret.X=this.ZoomIn(this.GetSectionDrawLeft(this.FActiveSectionIndex)+t.X)-this.FHScrollBar.position,this.FCaret.Y=this.ZoomIn(t.Y)-this.FVScrollBar.position,this.FCaret.Height=this.ZoomIn(t.Height),this.FStyle.UpdateInfo.ReScroll){if(this.FCaret.Height<this.FViewHeight){if(!this.FCaret.VScroll){this.FCaret.VScroll=!0;try{this.FCaret.Y<0?this.FVScrollBar.position=this.FVScrollBar.position+this.FCaret.Y-this.FPagePadding:this.FCaret.Y+this.FCaret.Height+this.FPagePadding>this.FViewHeight&&(this.FVScrollBar.position=this.FVScrollBar.position+this.FCaret.Y+this.FCaret.Height+this.FPagePadding-this.FViewHeight)}finally{this.FCaret.VScroll=!1}}if(!this.FCaret.HScroll){this.FCaret.HScroll=!0;try{this.FCaret.X<0?this.FHScrollBar.position=this.FHScrollBar.position+this.FCaret.X-this.FPagePadding:this.FCaret.X+this.FPagePadding>this.FViewWidth&&(this.FHScrollBar.position=this.FHScrollBar.position+this.FCaret.X+this.FPagePadding-this.FViewWidth)}finally{this.FCaret.HScroll=!1}}}}else{if(this.FCaret.X<0||this.FCaret.X>this.FViewWidth)return void this.FCaret.Hide();if(this.FCaret.Y+this.FCaret.Height<0||this.FCaret.Y>this.FViewHeight)return void this.FCaret.Hide()}this.FCaret.VScroll||this.FCaret.HScroll||(this.FCaret.Y+this.FCaret.Height>this.FViewHeight&&(this.FCaret.Height=this.FViewHeight-this.FCaret.Y),this.FCaret.Show(),this.DoCaretChange())}else this.FCaret.Hide()}else this.FCaret.Hide()}},{key:"GetSectionByCrood",value:function(t,e,i){i=-1;for(var n=0,o=0;o<=this.FSections.count-1;o++)if((n+=this.FSections[o].GetFilmHeight())>e){i=o;break}return i<0&&n+this.FPagePadding>=e&&(i=this.FSections.count-1),i<0&&(i=0),i}},{key:"SetZoom",value:function(t){var e=t;e<.25?e=.25:e>5&&(e=5),this.FZoom!=e&&(this.FZoom=e,this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),null!=this.OnZoomChanged&&this.OnZoomChanged(this),this.DoMapChanged(),this.DoViewResize())}},{key:"GetHScrollValue",value:function(){return this.FHScrollBar.position}},{key:"GetCurStyleNo",value:function(){return this.ActiveSection.CurStyleNo}},{key:"GetCurParaNo",value:function(){return this.ActiveSection.CurParaNo}},{key:"GetShowLineActiveMark",value:function(){return this.FSections[0].Page.ShowLineActiveMark}},{key:"SetShowLineActiveMark",value:function(t){for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].Page.ShowLineActiveMark=t;this.UpdateView()}},{key:"GetShowLineNo",value:function(){return this.FSections[0].Page.ShowLineNo}},{key:"SetShowLineNo",value:function(t){for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].Page.ShowLineNo=t;this.UpdateView()}},{key:"GetShowUnderLine",value:function(){return this.FSections[0].Page.ShowUnderLine}},{key:"SetShowUnderLine",value:function(t){for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].Page.ShowUnderLine=t;this.UpdateView()}},{key:"GetReadOnly",value:function(){for(var t=0;t<=this.FSections.count-1;t++)if(!this.FSections[t].ReadOnly)return!1;return!0}},{key:"SetReadOnly",value:function(t){for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].ReadOnly=t;this.UpdateView()}},{key:"SetViewModel",value:function(t){if(this.FViewModel!=t){this.FViewModel=t;for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].ViewModel=t;this.PagePadding=t==Bs?20:0}}},{key:"SetPrintView",value:function(t){this.FPrintView!=t&&(this.FPrintView=t,t&&!this.ReadOnly&&(this.ReadOnly=!0),this.UpdateView())}},{key:"SetActiveSectionIndex",value:function(t){this.FActiveSectionIndex!=t&&(this.FActiveSectionIndex>=0&&this.FSections[this.FActiveSectionIndex].DisActive(),this.FActiveSectionIndex=t,this.DoViewResize())}},{key:"SetIsChanged",value:function(t){this.FIsChanged!=t&&(this.FIsChanged=t,null!=this.OnChangedSwitch&&this.OnChangedSwitch(this))}},{key:"SetPagePadding",value:function(t){if(this.FPagePadding!=t){this.FPagePadding=t;for(var e=0;e<=this.FSections.count-1;e++)this.FSections[e].PagePadding=this.FPagePadding;this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),this.DoMapChanged(),this.DoViewResize()}}},{key:"GetActiveSection",value:function(){return this.FSections[this.FActiveSectionIndex]}},{key:"AutoScrollTimer",value:function(t){}},{key:"GetPagesAndActive",value:function(){this.FHScrollBar.Statuses[0].text="预览"+(this.PagePreviewFirst+1).toString()+" 光标"+(this.ActivePageIndex+1).toString()+"/"+this.PageCount.toString()+"页"}},{key:"ResetCanEditShot",value:function(){this.FCanEditChecked=!1,this.FCanEditSnapShot=!1}},{key:"doContextMenu_",value:function(t,e){if(this.popupMenu){var i=this.clientToScreen(new G(0,0));this.popupMenu.popup(i.x+t,i.y+e)}}},{key:"doPaint_",value:function(t){t.bitBlt(0,0,this.FViewWidth,this.FViewHeight,this.FDataBmpCanvas,0,0,this.FViewWidth,this.FViewHeight),t.brush.color=this.color,t.fillBounds(this.FVScrollBar.left,this.FHScrollBar.top,this.FVScrollBar.width,this.FHScrollBar.height),ZF(sI(i.prototype),"doPaint_",this).call(this,t)}},{key:"doSetBounds_",value:function(){this.FHScrollBar.top=this.height-this.FHScrollBar.height,this.FHScrollBar.width=this.width-this.FVScrollBar.width,this.FHScrollBarAutoVisible&&(this.FHScrollBar.visible=this.FHScrollBar.pageSize<this.FHScrollBar.range),this.FVScrollBar.left=this.width-this.FVScrollBar.width,this.FVScrollBar.height=this.height-this.FHScrollBar.height,this.btnInfo.left=this.FVScrollBar.left,this.btnInfo.top=this.FHScrollBar.top,ZF(sI(i.prototype),"doSetBounds_",this).call(this)}},{key:"doResize_",value:function(){ZF(sI(i.prototype),"doResize_",this).call(this),this.GetViewWidth(),this.GetViewHeight(),this.FViewWidth>0&&this.FViewHeight>0&&(this._canvas.width=this.FViewWidth,this._canvas.height=this.FViewHeight,this._context=this._canvas.getContext("2d"),this.FDataBmpCanvas=new Dt(this._context),this.FDataBmpCanvas.prepareConext(or._scale)),this.FAutoZoom&&(this.FAnnotatePre.Visible?this.FZoom=(this.FViewWidth-2*this.FPagePadding)/(this.ActiveSection.PaperWidthPix+lp.AnnotationWidth):this.FZoom=(this.FViewWidth-2*this.FPagePadding)/this.ActiveSection.PaperWidthPix),this.CalcScrollRang(),this.FStyle.UpdateInfoRePaint(),null!=this.FCaret&&this.FStyle.UpdateInfoReCaret(!1),this.CheckUpdateInfo(),this.DoViewResize()}},{key:"DoChange",value:function(){this.DoMapChanged(),this.DoSetChange()}},{key:"DoCaretChange",value:function(){this.GetPagesAndActive(),null!=this.OnCaretChange&&this.OnCaretChange(this,null)}},{key:"DoKillFocus",value:function(){null!=this.FCaret&&(this.FCaret.Hide(!0),this.UpdateViewRect(U.CreateByBounds(this.FCaret.X-1,this.FCaret.Y,this.FCaret.Width+1,this.FCaret.Height)))}},{key:"DoSectionCreateItem",value:function(t){null!=this.OnSectionCreateItem&&this.OnSectionCreateItem(this)}},{key:"DoSectionAcceptAction",value:function(t,e,i,n,o){return null==this.OnSectionAcceptAction||this.OnSectionAcceptAction(t,e,i,n,o)}},{key:"DoSectionCreateStyleItem",value:function(t,e){return null!=this.OnSectionCreateStyleItem?this.OnSectionCreateStyleItem(t,e):null}},{key:"DoSectionPaintDomainRegion",value:function(t,e,i){return!0}},{key:"DoSectionMatchTextStyleNoAt",value:function(t,e,i){return cs.Null}},{key:"DoSectionCaretItemChanged",value:function(t,e,i){null!=this.OnSectionCaretItemChanged&&this.OnSectionCaretItemChanged(t,e,i)}},{key:"DoSectionDataDomainSwitch",value:function(t,e,i){null!=this.OnSectionDataDomainSwitch&&this.OnSectionDataDomainSwitch(t,e,i)}},{key:"DoSectionCreateFloatStyleItem",value:function(t,e){return null!=this.FOnSectionCreateFloatStyleItem?this.FOnSectionCreateFloatStyleItem(t,e):null}},{key:"DoSectionInsertItem",value:function(t,e,i){null!=this.OnSectionInsertItem&&this.OnSectionInsertItem(t,e,i)}},{key:"DoSectionRemoveItem",value:function(t,e,i){null!=this.OnSectionRemoveItem&&this.OnSectionRemoveItem(t,e,i)}},{key:"DoSectionSaveItem",value:function(t,e,i){return null==this.OnSectionSaveItem||this.OnSectionSaveItem(t,e,i)}},{key:"DoSectionDrawItemMouseMove",value:function(t,e,i,n,o,r){null!=this.OnSectionDrawItemMouseMove&&this.OnSectionDrawItemMouseMove(t,e,i,n,o,r)}},{key:"DoSectionCanEdit",value:function(t){var e=!0;return this.Style.States.Contain(Ip.Loading)||null==this.OnSectionCanEdit||(e=this.OnSectionCanEdit(t)),this.FCanEditChecked=!0,this.FCanEditSnapShot=e,e}},{key:"DoSectionInsertTextBefor",value:function(t,e,i,n){return null==this.OnSectionInsertTextBefor||this.OnSectionInsertTextBefor(t,e,i,n)}},{key:"DoSectionPaintHeaderBefor",value:function(t,e,i,n,o){null!=this.OnSectionPaintHeaderBefor&&this.OnSectionPaintHeaderBefor(t,e,i,n,o)}},{key:"DoSectionPaintHeaderAfter",value:function(t,e,i,n,o){null!=this.OnSectionPaintHeaderAfter&&this.OnSectionPaintHeaderAfter(t,e,i,n,o)}},{key:"DoSectionPaintFooterBefor",value:function(t,e,i,n,o){null!=this.OnSectionPaintFooterBefor&&this.OnSectionPaintFooterBefor(t,e,i,n,o)}},{key:"DoSectionPaintFooterAfter",value:function(t,e,i,n,o){var r=t;if(r.PageNoVisible){for(var s=this.FSections.indexOf(r),a=0,l=0,h=0;h<=this.FSections.count-1;h++)h==s&&(a=l),l+=this.FSections[h].PageCount;var c=C.stringFormat(r.PageNoFormat,a+r.PageNoFrom+e,l);n.font.size=10,n.font.name="宋体",n.font.color=at.Black,n.font.styles.clear(),n.textOut(i.left+Math.trunc((i.width-n.textWidth(c))/2),i.top+r.Footer.height,c)}null!=this.OnSectionPaintFooterAfter&&this.OnSectionPaintFooterAfter(r,e,i,n,o)}},{key:"DoSectionPaintPageBefor",value:function(t,e,i,n,o){null!=this.OnSectionPaintPageBefor&&this.OnSectionPaintPageBefor(t,e,i,n,o)}},{key:"DoSectionPaintPageAfter",value:function(t,e,i,n,o){null!=this.OnSectionPaintPageAfter&&this.OnSectionPaintPageAfter(t,e,i,n,o)}},{key:"DoSectionPaintPaperBefor",value:function(t,e,i,n,o){if(o.Print&&this.FAnnotatePre.DrawCount>0&&this.FAnnotatePre.ClearDrawAnnotate(),null!==this.BKImage&&this.BKImage.loaded){if(o.Print?this.BKImagePrintVisible:this.FBKImageVisible)switch(this.FBKImageLayout){case vp:n.drawImage(i.left,i.top,this.BKImage.image);break;case Fp:n.drawImage(i.left+(i.width-this.BKImage.width)/2,i.top+(i.height-this.BKImage.height)/2,this.BKImage.image);break;case pp:this.BKCanvas.width=i.width,this.BKCanvas.height=i.height,this.BKContext.fillStyle=this.BKContext.createPattern(this.BKImage.image,"repeat"),this.BKContext.fillRect(0,0,i.width,i.height),n.h5context.drawImage(this.BKCanvas,0,0,i.width,i.height,i.left,i.top,i.width,i.height);break;case Sp:n.drawImageRect(i,this.BKImage.image)}}null!=this.OnSectionPaintPaperBefor&&this.OnSectionPaintPaperBefor(t,e,i,n,o)}},{key:"DoSectionPaintPaperAfter",value:function(t,e,i,n,o){!o.Print&&this.FViewModel==Bs&&t.PagePadding>10&&(n.font.size=10,n.font.name="宋体",n.font.color="#d0d1d5",n.font.styles.clear()),this.FAnnotatePre.Visible&&this.FAnnotatePre.PaintDrawAnnotate(t,i,n,o),null!=this.OnSectionPaintPaperAfter&&this.OnSectionPaintPaperAfter(t,e,i,n,o)}},{key:"DoSectionDrawItemPaintBefor",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){null!=this.OnSectionDrawItemPaintBefor&&this.OnSectionDrawItemPaintBefor(this,e,i,n,o,r,s,a,l,h,c,u,f)}},{key:"DoSectionDrawItemPaintAfter",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){""!=e.Items[i].HyperLink&&(u.pen.style=pt.Solid,u.pen.color="rgb(0, 0, 255)",u.pen.width=1,u.drawLineDriect(o.left,o.bottom,o.right,o.bottom)),null!=this.OnSectionDrawItemPaintAfter&&this.OnSectionDrawItemPaintAfter(this,e,i,n,o,r,s,a,l,h,c,u,f)}},{key:"DoSectionDrawItemPaintContent",value:function(){}},{key:"DoSectionFloatItemPaintAfter",value:function(t,e,i,n,o){null!==this.OnSectionFloatItemPaintAfter&&this.OnSectionFloatItemPaintAfter(t,e,i,n,o)}},{key:"DoInsertText",value:function(t){return this.ActiveSection.InsertText(t)}},{key:"DoCopyRequest",value:function(t){var e=this.ActiveSection.GetTopLevelItem();return!e.isClass($u)||!e.SelectTextExists()||t==Ao}},{key:"DoPasteRequest",value:function(t){return!this.ActiveSection.GetTopLevelItem().isClass($u)||t==Ao}},{key:"DoPasteFormatStream",value:function(t){return!0}},{key:"DoCopyAsStream",value:function(t){}},{key:"DoPaintViewBefor",value:function(t,e){null!=this.OnPaintViewBefor&&this.OnPaintViewBefor(t,e)}},{key:"DoPaintViewAfter",value:function(t,e){null!=this.OnPaintViewAfter&&this.OnPaintViewAfter(t,e)}},{key:"DoSaveStreamBefor",value:function(t){}},{key:"DoSaveStreamAfter",value:function(t){}},{key:"DoLoadStreamBefor",value:function(t,e){this.ResetCanEditShot()}},{key:"DoLoadStreamAfter",value:function(t,e){}},{key:"DoSaveXmlDocument",value:function(t){}},{key:"DoLoadXmlDocument",value:function(t){this.ResetCanEditShot()}},{key:"doSetFocus_",value:function(t){ZF(sI(i.prototype),"doSetFocus_",this).call(this,t),this.focused&&this.imeMode==Mi&&or.ime.setControl(this)}},{key:"imeActive",value:function(){this.FCaret.Visible&&this.FCaret.Show()}},{key:"doMouseDown_",value:function(t){ZF(sI(i.prototype),"doMouseDown_",this).call(this,t);var e=this.GetSectionByCrood(this.ZoomOut(this.FHScrollBar.position+t.x),this.ZoomOut(this.FVScrollBar.position+t.y),-1);if(e!=this.FActiveSectionIndex&&this.SetActiveSectionIndex(e),!(this.FActiveSectionIndex<0)){var n=this.GetSectionDrawLeft(this.FActiveSectionIndex);this.FAnnotatePre.DrawCount>0&&this.FAnnotatePre.MouseDown(this.ZoomOut(t.x),this.ZoomOut(t.y));var o=new G;o.x=this.ZoomOut(this.FHScrollBar.position+t.x)-n,o.y=this.ZoomOut(this.FVScrollBar.position+t.y)-this.GetSectionTopFilm(this.FActiveSectionIndex);var r=new ei;r.assign(t),r.x=o.x,r.y=o.y,this.FSections[this.FActiveSectionIndex].MouseDown(r),this.CheckUpdateInfo()}}},{key:"doMouseMove_",value:function(t){if(ZF(sI(i.prototype),"doMouseMove_",this).call(this,t),this.FActiveSectionIndex>=0){var e=new ei;e.assign(t),e.x=this.ZoomOut(this.FHScrollBar.position+t.x)-this.GetSectionDrawLeft(this.FActiveSectionIndex),e.y=this.ZoomOut(this.FVScrollBar.position+t.y)-this.GetSectionTopFilm(this.FActiveSectionIndex),this.FSections[this.FActiveSectionIndex].MouseMove(e),this.FStyle.UpdateInfo.Selecting&&this.AutoScrollTimer(!0)}this.FAnnotatePre.DrawCount>0&&this.FAnnotatePre.MouseMove(this.ZoomOut(t.x),this.ZoomOut(t.y)),this.CheckUpdateInfo(),this.cursor=lp.GCursor}},{key:"doMouseUp_",value:function(t){if(this.FStyle.UpdateInfo.Selecting&&this.AutoScrollTimer(!1),t.button==ie)return ZF(sI(i.prototype),"doMouseUp_",this).call(this,t),void(this.FStyle.States.Contain(Ip.FormatBrushing)&&this.FStyle.States.Exclude(Ip.FormatBrushing));if(this.FActiveSectionIndex>=0){var e=new ei;e.assign(t),e.x=this.ZoomOut(this.FHScrollBar.position+t.x)-this.GetSectionDrawLeft(this.FActiveSectionIndex),e.y=this.ZoomOut(this.FVScrollBar.position+t.y)-this.GetSectionTopFilm(this.FActiveSectionIndex),this.FSections[this.FActiveSectionIndex].MouseUp(e)}this.FStyle.UpdateInfo.DragingSelected&&(lp.GCursor=oe),this.cursor=lp.GCursor,this.imeMode==Mi&&or.ime.setControl(this),ZF(sI(i.prototype),"doMouseUp_",this).call(this,t),this.CheckUpdateInfo(),this.FStyle.UpdateInfo.Selecting&&(this.FStyle.UpdateInfo.Selecting=!1,this.FStyle.States.Contain(Ip.FormatBrushing)&&this.ApplyTextStyleNo(this.FStyle.FormatBrushStyleNo)),this.FStyle.States.Contain(Ip.FormatBrushing)&&this.FStyle.States.Exclude(Ip.FormatBrushing),this.FStyle.UpdateInfo.DragingSelected=!1}},{key:"doMouseWheel_",value:function(t){or.keyDownStates[_e]||(or.keyDownStates[Re]?this.FHScrollBar.position-=t.delta:this.FVScrollBar.position-=t.delta)}},{key:"doKeyDown_",value:function(t){or.keyDownStates[_e]&&t.keyCode==Ve?this.ShowSearchForm():or.keyDownStates[_e]&&t.keyCode==He?this.SelectAll():or.keyDownStates[_e]&&t.keyCode==je?this.Undo():or.keyDownStates[_e]&&t.keyCode==ze?this.Redo():this.ActiveSection.KeyDown(t),ZF(sI(i.prototype),"doKeyDown_",this).call(this,t)}},{key:"doKeyUp_",value:function(t){ZF(sI(i.prototype),"doKeyUp_",this).call(this,t),this.ActiveSection.KeyUp(t)}},{key:"doKeyPress_",value:function(t){ZF(sI(i.prototype),"doKeyPress_",this).call(this,t),or.keyDownStates[_e]||this.ActiveSection.KeyPress(t)}},{key:"imeInput",value:function(t){""!=t&&this.InsertText(t)}},{key:"DataSaveLiteStream",value:function(t,e){lp._SaveFileFormatAndVersion(t),this.FStyle.SaveToStream(t),e()}},{key:"DataLoadLiteStream",value:function(t,e){var i=lp._LoadFileFormatAndVersion(t),n=new cs;n.LoadFromStream(t,i.fileVersion),e(i.fileVersion,n)}},{key:"CalcScrollRang",value:function(){var t=0,e=0,i=0;if(this.FViewModel==Bs){e=this.FSections[0].PaperWidthPix;for(var n=0;n<=this.FSections.count-1;n++)t+=this.FSections[n].GetFilmHeight(),(i=this.FSections[n].PaperWidthPix)>e&&(e=i)}else{e=this.FSections[0].GetPageWidth();for(var o=0;o<=this.FSections.count-1;o++)t+=this.FSections[o].GetFilmHeight(),(i=this.FSections[o].GetPageWidth())>e&&(e=i)}this.FAnnotatePre.Visible&&(e+=lp.AnnotationWidth),t=this.ZoomIn(t+this.FPagePadding),e=this.ZoomIn(e+this.FPagePadding+this.FPagePadding),this.FVScrollBar.max=t,this.FHScrollBar.max=e}},{key:"CheckUpdateInfo",value:function(){this.FUpdateCount>0||(null!=this.FCaret&&this.FStyle.UpdateInfo.ReCaret&&(this.ReBuildCaret(),this.FStyle.UpdateInfo.ReCaret=!1,this.FStyle.UpdateInfo.ReStyle=!1,this.FStyle.UpdateInfo.ReScroll=!1),this.FStyle.UpdateInfo.RePaint&&(this.FStyle.UpdateInfo.RePaint=!1,this.UpdateView()))}},{key:"InitializeComponent",value:function(){this.SuspendLayout(),this.Name="HCView",this.ResumeLayout(!1)}},{key:"DeleteUnUsedStyle",value:function(t,e,i){t.TextStyles[0].CheckSaveUsed=!0,t.TextStyles[0].TempNo=0;for(var n=1;n<t.TextStyles.count;n++)t.TextStyles[n].CheckSaveUsed=!1,t.TextStyles[n].TempNo=cs.Null;for(var o=0;o<t.ParaStyles.count;o++)t.ParaStyles[o].CheckSaveUsed=!1,t.ParaStyles[o].TempNo=cs.Null;for(var r=0;r<e.count;r++)e[r].MarkStyleUsed(!0,i);for(var s=0,a=1;a<t.TextStyles.count;a++)t.TextStyles[a].CheckSaveUsed?t.TextStyles[a].TempNo=a-s:s++;s=0;for(var l=0;l<t.ParaStyles.count;l++)t.ParaStyles[l].CheckSaveUsed?t.ParaStyles[l].TempNo=l-s:s++;for(var h=null,c=0;c<e.count;c++)e[c].MarkStyleUsed(!1,i),(h=e[c].ActiveData.GetTopLevelData()).CurStyleNo>cs.Null&&(h.CurStyleNo=t.TextStyles[h.CurStyleNo].TempNo),h.CurParaNo=t.ParaStyles[h.CurParaNo].TempNo;for(var u=t.TextStyles.count-1;u>=1;u--)t.TextStyles[u].CheckSaveUsed||t.TextStyles.delete(u);for(var f=t.ParaStyles.count-1;f>=0;f--)t.ParaStyles[f].CheckSaveUsed||t.ParaStyles.delete(f)}},{key:"ResetActiveSectionMargin",value:function(){this.ActiveSection.ResetMargin(),this.DoViewResize()}},{key:"ActiveItemReAdaptEnvironment",value:function(){this.ActiveSection.ActiveItemReAdaptEnvironment()}},{key:"Clear",value:function(){this.BeginUpdate();try{this.FStyle.Initialize(),this.FSections.removeRange(1,this.FSections.count-1),this.FActiveSectionIndex=0,this.FDisplayFirstSection=-1,this.FDisplayLastSection=-1,this.FUndoList.SaveState();try{this.FUndoList.Enable=!1,this.FSections[0].Clear(),this.FUndoList.clear()}finally{this.FUndoList.RestoreState()}this.FHScrollBar.position=0,this.FVScrollBar.position=0,this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.DoMapChanged(),this.DoViewResize()}finally{this.EndUpdate()}}},{key:"ClearUndo",value:function(){this.FUndoList.clear()}},{key:"DisSelect",value:function(){this.ActiveSection.DisSelect(),this.DoSectionDataCheckUpdateInfo(this,null)}},{key:"DeleteSelected",value:function(){this.ActiveSection.DeleteSelected()}},{key:"DeleteActiveDomain",value:function(){return this.ActiveSection.DeleteActiveDomain()}},{key:"DeleteActiveAnnotate",value:function(){return this.ActiveSection.DeleteActiveAnnotate()}},{key:"DeleteActiveDataItems",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e<t?this.ActiveSection.DeleteActiveDataItems(t,t,i):this.ActiveSection.DeleteActiveDataItems(t,e,i)}},{key:"DeleteActiveSection",value:function(){!this.ReadOnly&&this.FActiveSectionIndex>0&&(this.FSections.delete(this.FActiveSectionIndex),this.FActiveSectionIndex=this.FActiveSectionIndex-1,this.FDisplayFirstSection=-1,this.FDisplayLastSection=-1,this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.DoChange())}},{key:"FormatData",value:function(){for(var t=0;t<=this.FSections.count-1;t++)this.FSections[t].FormatData(),this.FSections[t].BuildSectionPages(0);this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.DoMapChanged()}},{key:"InsertStream",value:function(t){var e=this,i=!1;this.BeginUpdate();try{var n=new cs;this.DoLoadFromStream(t,n,(function(o,r){if(t.readByte(),o>42)return e.ActiveSection.SeekStreamToArea(t,n,o,dp.Page),void(i=e.ActiveSection.InsertStream(t,n,o));var s=new _F(n);s.OnCreateItemByStyle=function(t,i){return e.DoSectionCreateStyleItem(t,i)};var a=new K;s.LoadFromStream(t,n,o),s.Page.SaveToStream(a),a.position=0,a.readBoolean(),a.readInt64(),i=e.ActiveSection.InsertStream(a,n,lp.HC_FileVersionInt)}))}finally{this.EndUpdate()}return i}},{key:"InsertLiteStream",value:function(t){var e=this,i=!1;return this.DataLoadLiteStream(t,(function(n,o){e.BeginUpdate();try{i=e.ActiveSection.InsertStream(t,o,n)}finally{e.EndUpdate()}})),i}},{key:"AppendStream",value:function(t){return this.ActiveSection.ActiveData.SelectLastItemAfterWithCaret(),this.InsertBreak(),this.ApplyParaAlignHorz(dr),this.InsertStream(t)}},{key:"LoadHeaderFromStream",value:function(t,e){var i=this,n=!1;this.BeginUpdate();try{var o=new cs;this.DoLoadFromStream(t,o,(function(r,s){if(t.readByte(),r>42){i.ActiveSection.Header.BeginFormat();try{i.ActiveSection.SeekStreamToArea(t,o,r,dp.Header,e),i.ActiveSection.Header.LoadFromStream(t,o,r)}finally{i.ActiveSection.Header.EndFormat(!1)}i.ResetActiveSectionMargin(),n=!0}}))}finally{this.EndUpdate()}return n}},{key:"LoadFooterFromStream",value:function(t,e){var i=this,n=!1;this.BeginUpdate();try{var o=new cs;this.DoLoadFromStream(t,o,(function(r,s){if(t.readByte(),r>42){i.ActiveSection.Footer.BeginFormat();try{i.ActiveSection.SeekStreamToArea(t,o,r,dp.Footer,e),i.ActiveSection.Footer.LoadFromStream(t,o,r)}finally{i.ActiveSection.Footer.EndFormat(!1)}i.ResetActiveSectionMargin(),n=!0}}))}finally{this.EndUpdate()}return n}},{key:"InsertText",value:function(t){this.BeginUpdate();try{return this.DoInsertText(t)}finally{this.EndUpdate()}}},{key:"InsertTable",value:function(t,e){this.BeginUpdate();try{return this.ActiveSection.InsertTable(t,e)}finally{this.EndUpdate()}}},{key:"InsertImageFile",value:function(t){}},{key:"InsertImage",value:function(t){this.BeginUpdate();try{return this.ActiveSection.InsertImage(t)}finally{this.EndUpdate()}}},{key:"InsertGifImage",value:function(t){this.BeginUpdate();try{return this.ActiveSection.InsertGifImage(t)}finally{this.EndUpdate()}}},{key:"InsertLine",value:function(t){return this.ActiveSection.InsertLine(t)}},{key:"InsertItem",value:function(t){return this.ActiveSection.InsertItem(t)}},{key:"InsertItemEx",value:function(t,e){return this.ActiveSection.InsertItemEx(t,e)}},{key:"InsertFloatItem",value:function(t){return this.ActiveSection.InsertFloatItem(t)}},{key:"InsertAnnotate",value:function(t,e){return this.ActiveSection.InsertAnnotate(t,e)}},{key:"InsertBreak",value:function(){return this.ActiveSection.InsertBreak()}},{key:"InsertPageBreak",value:function(){return this.ActiveSection.InsertPageBreak()}},{key:"InsertSectionBreak",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.ReadOnly)return!1;var i=!1;this.BeginUpdate();try{var n=this.NewDefaultSection();n.PageNoFormat=this.FSections[this.FActiveSectionIndex].PageNoFormat,n.AssignPaper(this.FSections[this.FActiveSectionIndex]),t&&n.Header.Clone(this.FSections[this.FActiveSectionIndex].Header),e&&n.Footer.Clone(this.FSections[this.FActiveSectionIndex].Footer),this.FSections.insert(this.FActiveSectionIndex+1,n),this.FActiveSectionIndex=this.FActiveSectionIndex+1,i=!0,this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.FStyle.UpdateInfoReScroll(),this.DoChange()}finally{this.EndUpdate()}return i}},{key:"InsertDomain",value:function(t){return this.ActiveSection.InsertDomain(t)}},{key:"SetActiveImage",value:function(t){return this.ActiveSection.SetActiveImage(t)}},{key:"ActiveTableResetRowCol",value:function(t,e){return this.ActiveSection.ActiveTableResetRowCol(t,e)}},{key:"ActiveTableInsertRowAfter",value:function(t){return this.ActiveSection.ActiveTableInsertRowAfter(t)}},{key:"ActiveTableInsertRowBefor",value:function(t){return this.ActiveSection.ActiveTableInsertRowBefor(t)}},{key:"ActiveTableDeleteCurRow",value:function(){return this.ActiveSection.ActiveTableDeleteCurRow()}},{key:"ActiveTableDeleteRowFrom",value:function(t,e){return this.ActiveSection.ActiveTableDeleteRowFrom(t,e)}},{key:"ActiveTableSplitCurRow",value:function(){return this.ActiveSection.ActiveTableSplitCurRow()}},{key:"ActiveTableSplitCurCol",value:function(){return this.ActiveSection.ActiveTableSplitCurCol()}},{key:"ActiveTableInsertColBefor",value:function(t){return this.ActiveSection.ActiveTableInsertColBefor(t)}},{key:"ActiveTableInsertColAfter",value:function(t){return this.ActiveSection.ActiveTableInsertColAfter(t)}},{key:"ActiveTableDeleteCurCol",value:function(){return this.ActiveSection.ActiveTableDeleteCurCol()}},{key:"ApplyParaAlignHorz",value:function(t){this.ActiveSection.ApplyParaAlignHorz(t)}},{key:"ApplyParaAlignVert",value:function(t){this.ActiveSection.ApplyParaAlignVert(t)}},{key:"ApplyParaBackColor",value:function(t){this.ActiveSection.ApplyParaBackColor(t)}},{key:"ApplyParaBreakRough",value:function(t){this.ActiveSection.ApplyParaBreakRough(t)}},{key:"ApplyParaLineSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.ActiveSection.ApplyParaLineSpace(t,e)}},{key:"ApplyParaLeftIndentAdd",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t?this.ActiveSection.ApplyParaLeftIndent(this.FStyle.ParaStyles[this.CurParaNo].LeftIndent+sr.pixXToMillimeter(lp.TabCharWidth)):this.ActiveSection.ApplyParaLeftIndent(Math.max(0,this.FStyle.ParaStyles[this.CurParaNo].LeftIndent-sr.pixXToMillimeter(lp.TabCharWidth)))}},{key:"ApplyParaLeftIndent",value:function(t){this.ActiveSection.ApplyParaLeftIndent(t)}},{key:"ApplyParaRightIndent",value:function(t){this.ActiveSection.ApplyParaRightIndent(t)}},{key:"ApplyParaFirstIndent",value:function(t){this.ActiveSection.ApplyParaFirstIndent(t)}},{key:"ApplyBullet",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";this.ActiveSection.ApplyBullet(t,e,i,n)}},{key:"ApplyTextStyle",value:function(t){this.ActiveSection.ApplyTextStyle(t)}},{key:"ApplyTextStyleNo",value:function(t){t>cs.Null&&this.ActiveSection.ApplyTextStyleNo(t)}},{key:"ApplyTextFontName",value:function(t){this.ActiveSection.ApplyTextFontName(t)}},{key:"ApplyTextFontSize",value:function(t){this.ActiveSection.ApplyTextFontSize(t)}},{key:"ApplyTextColor",value:function(t){this.ActiveSection.ApplyTextColor(t)}},{key:"ApplyTextBackColor",value:function(t){this.ActiveSection.ApplyTextBackColor(t)}},{key:"ApplyTableCellAlign",value:function(t){this.ActiveSection.ApplyTableCellAlign(t)}},{key:"SelectAll",value:function(){for(var t=0;t<=this.FSections.count-1;t++)this.FSections[t].SelectAll();this.FStyle.UpdateInfoRePaint(),this.CheckUpdateInfo()}},{key:"doCut_",value:function(t){this.FStyle.States.Include(Ip.Cutting);try{this.doCopy_(t),this.ActiveSection.DeleteSelected(),this.doCutAfter_()}finally{this.FStyle.States.Exclude(Ip.Cutting)}}},{key:"doCutAfter_",value:function(){null!=this.OnCutAfter&&this.OnCutAfter()}},{key:"doCopy_",value:function(t){var e=this;if(or.localStorage.removeItem(g),or.localStorage.removeItem(lp.HC_EXT),this.ActiveSection.SelectExists()){this.FStyle.States.Include(Ip.Copying);try{if(this.DoCopyRequest(Ao)){var i=this.ActiveSectionTopLevelData().SaveSelectToText();or.localStorage.setString(g,i),this.ExtrnalCP&&t.clipboardData.setData(I.TXT,i)}if(this.DoCopyRequest(lp.HCExtFormat)){var n=new K;this.DoCopyAsStream(n),this.DataSaveLiteStream(n,(function(){e.ActiveSectionTopLevelData().SaveSelectToStream(n)})),or.localStorage.setStream(lp.HC_EXT,n),this.ExtrnalCP&&t.clipboardData.setData(lp.HC_EXT,n.toJSONString())}this.FStyle.States.Contain(Ip.Cutting)||this.doCopyAfter_()}finally{this.FStyle.States.Exclude(Ip.Copying)}}}},{key:"CopyAsText",value:function(){this.DoCopyRequest(Ao)&&(or.localStorage.setString(g,this.ActiveSectionTopLevelData().SaveSelectToText()),this.doCopyAfter_())}},{key:"doCopyAfter_",value:function(){null!=this.OnCopyAfter&&this.OnCopyAfter()}},{key:"doPaste_",value:function(t){var e=this;if(this.ExtrnalCP){if(this.doPasteBefor_()){this.FStyle.States.Include(Ip.Pasting);try{if(t.clipboardData.types.indexOf(lp.HC_EXT)>-1&&this.DoPasteRequest(lp.HCExtFormat)){var i=new K;if(i.fromJSONString(t.clipboardData.getData(lp.HC_EXT)),!this.DoPasteFormatStream(i))return;this.InsertLiteStream(i)}else if(t.clipboardData.types.indexOf(I.TXT)>-1&&this.DoPasteRequest(Ao))this.InsertText(t.clipboardData.getData(I.TXT));else{var n=t.clipboardData.types.indexOf("Files");if(n>-1){var o=t.clipboardData.items[n].type;if(o==I.PNG&&this.DoPasteRequest(No)||o==I.JPEG&&this.DoPasteRequest(Oo)||o==I.BMP&&this.DoPasteRequest(To)){var r=t.clipboardData.items[n].getAsFile();if(r){var s=this.ActiveSectionTopLevelData(),a=s.CreateItemByStyle(cs.Image);a.LoadGraphicFile(r,(function(){a.RestrainSize(s.Width,a.Height),e.InsertItem(a)}))}}}}}finally{this.FStyle.States.Exclude(Ip.Pasting)}}}else this.Paste()}},{key:"Paste",value:function(){if(this.doPasteBefor_()){this.FStyle.States.Include(Ip.Pasting);try{if(or.localStorage.hasKey(lp.HC_EXT)&&this.DoPasteRequest(lp.HCExtFormat)){var t=or.localStorage.getStream(lp.HC_EXT);if(!this.DoPasteFormatStream(t))return;this.InsertLiteStream(t)}else or.clipboard.hasFormat(Bo)&&this.DoPasteRequest(Bo)||(or.localStorage.hasKey(g)&&this.DoPasteRequest(Ao)?this.InsertText(or.localStorage.getString(g)):or.clipboard.hasFormat(To)&&this.DoPasteRequest(To))}finally{this.FStyle.States.Exclude(Ip.Pasting)}}}},{key:"PasteAsText",value:function(){this.doPasteBefor_()&&or.localStorage.hasKey(g)&&this.DoPasteRequest(Ao)&&this.InsertText(or.localStorage.getString(g))}},{key:"doPasteBefor_",value:function(){return null==this.OnPasteBefor||this.OnPasteBefor()}},{key:"ShowSearchForm",value:function(){null==this.FFrmSearch&&(this.FFrmSearch=new JF(this),this.FFrmSearch.closeFree=!1),this.FFrmSearch.cbbKey.text=this.ActiveSectionTopLevelData().SaveSelectToText(),this.FFrmSearch.visible||(this.FFrmSearch.moveCenter(),this.FFrmSearch.show())}},{key:"ZoomIn",value:function(t){return Math.round(t*this.FZoom)}},{key:"ZoomOut",value:function(t){return Math.round(t/this.FZoom)}},{key:"MapChange",value:function(){this.DoMapChanged()}},{key:"UpdateView",value:function(){this.UpdateViewRect(this.GetViewRect())}},{key:"CalcDisplaySectionAndPage",value:function(){this.FDisplayFirstSection>=0&&(this.FSections[this.FDisplayFirstSection].DisplayFirstPageIndex=-1,this.FSections[this.FDisplayFirstSection].DisplayLastPageIndex=-1,this.FDisplayFirstSection=-1),this.FDisplayLastSection>=0&&(this.FSections[this.FDisplayLastSection].DisplayFirstPageIndex=-1,this.FSections[this.FDisplayLastSection].DisplayLastPageIndex=-1,this.FDisplayLastSection=-1);for(var t=-1,e=-1,i=0,n=0;n<=this.FSections.count-1;n++){for(var o=0;o<=this.FSections[n].PageCount-1;o++)if(this.FSections[n].ViewModel==Bs?i+=this.ZoomIn(this.FPagePadding+this.FSections[n].PaperHeightPix):i+=this.ZoomIn(this.FPagePadding+this.FSections[n].GetPageHeight()),i>this.FVScrollBar.position){t=o;break}if(t>=0){this.FDisplayFirstSection=n,this.FSections[this.FDisplayFirstSection].DisplayFirstPageIndex=t;break}}if(this.FDisplayFirstSection>=0){for(var r=this.FVScrollBar.position+this.FViewHeight,s=this.FDisplayFirstSection;s<=this.FSections.count-1;s++){for(var a=t;a<=this.FSections[s].PageCount-1;a++){if(!(i<r)){e=a;break}this.FSections[s].ViewModel==Bs?i+=this.ZoomIn(this.FPagePadding+this.FSections[s].PaperHeightPix):i+=this.ZoomIn(this.FPagePadding+this.FSections[s].GetPageHeight())}if(e>=0){this.FDisplayLastSection=s,this.FSections[this.FDisplayLastSection].DisplayLastPageIndex=e;break}t=0}this.FDisplayLastSection<0&&(this.FDisplayLastSection=this.FSections.count-1,this.FSections[this.FDisplayLastSection].DisplayLastPageIndex=this.FSections[this.FDisplayLastSection].PageCount-1)}if(this.FDisplayFirstSection<0||this.FDisplayLastSection<0)throw"异常:获取当前显示起始页和结束页失败!";this.FDisplayFirstSection!=this.FDisplayLastSection&&(this.FSections[this.FDisplayFirstSection].DisplayLastPageIndex=this.FSections[this.FDisplayFirstSection].PageCount-1,this.FSections[this.FDisplayLastSection].DisplayFirstPageIndex=0)}},{key:"UpdateViewRect",value:function(t){if(!this.FStyle.States.Contain(Ip.Destroying)&&0==this.FUpdateCount){this.FDataBmpCanvas.save();try{this.FDataBmpCanvas.clipRect(t),this.FDataBmpCanvas.beginPath(),this.FViewModel==Bs?this.FDataBmpCanvas.brush.color=this.color:this.FDataBmpCanvas.brush.color=this.FStyle.BackgroundColor,this.FDataBmpCanvas.fillBounds(0,0,this.FViewWidth,this.FViewHeight),this.CalcDisplaySectionAndPage();var e=new RF;try{e.ScaleX=this.FZoom,e.ScaleY=this.FZoom,e.Zoom=this.FZoom,e.ViewModel=this.FViewModel,e.WindowWidth=this.FViewWidth,e.WindowHeight=this.FViewHeight,e.DPI=sr.PixelsPerInchX,e.Print=this.FPrintView;var i=e.scaleCanvas(this.FDataBmpCanvas);try{this.DoPaintViewBefor(this.FDataBmpCanvas,e),this.FAnnotatePre.DrawCount>0&&this.FAnnotatePre.ClearDrawAnnotate();for(var n=0,o=this.FDisplayFirstSection;o<=this.FDisplayLastSection;o++)e.SectionIndex=o,n=this.ZoomOut(this.FVScrollBar.position)-this.GetSectionTopFilm(o),this.FSections[o].PaintDisplayPage(this.GetSectionDrawLeft(o)-this.ZoomOut(this.FHScrollBar.position),n,this.FDataBmpCanvas,e);for(var r=0;r<=e.topItems.count-1;r++)e.topItems[r].PaintTop(this.FDataBmpCanvas);this.DoPaintViewAfter(this.FDataBmpCanvas,e),!e.Print&&null!=this.FCaret&&this.FCaret.DisFocus&&(this.FDataBmpCanvas.pen.color="gray",this.FDataBmpCanvas.pen.style=pt.Solid,this.FDataBmpCanvas.pen.width=this.FCaret.Width,this.FDataBmpCanvas.drawLineDriect(this.FCaret.X,this.FCaret.Y,this.FCaret.X,this.FCaret.Y+this.FCaret.Height))}finally{e.restoreCanvasScale(this.FDataBmpCanvas,i)}}finally{e=null}}finally{this.FDataBmpCanvas.paintPath(),this.FDataBmpCanvas.restore()}this.updateRect(t)}}},{key:"BeginUpdate",value:function(){this.FUpdateCount++}},{key:"EndUpdate",value:function(){this.FUpdateCount>0&&this.FUpdateCount--,this.DoMapChanged()}},{key:"UndoGroupBegin",value:function(){if(this.FUndoList.Enable){var t=this.ActiveSection.ActiveData;this.FUndoList.UndoGroupBegin(t.SelectInfo.StartItemNo,t.SelectInfo.StartItemOffset)}}},{key:"UndoGroupEnd",value:function(){if(this.FUndoList.Enable){var t=this.ActiveSection.ActiveData;this.FUndoList.UndoGroupEnd(t.SelectInfo.StartItemNo,t.SelectInfo.StartItemOffset)}}},{key:"GetActiveItem",value:function(){return this.ActiveSection.GetActiveItem()}},{key:"GetTopLevelItem",value:function(){return this.ActiveSection.GetTopLevelItem()}},{key:"GetTopLevelDrawItem",value:function(){return this.ActiveSection.GetTopLevelDrawItem()}},{key:"GetActivePageIndex",value:function(){for(var t=0,e=0;e<=this.ActiveSectionIndex-1;e++)t+=this.FSections[e].PageCount;return t+this.ActiveSection.ActivePageIndex}},{key:"GetPagePreviewFirst",value:function(){for(var t=0,e=0;e<=this.ActiveSectionIndex-1;e++)t+=this.FSections[e].PageCount;return t+this.FSections[this.FActiveSectionIndex].DisplayFirstPageIndex}},{key:"GetPageCount",value:function(){for(var t=0,e=0;e<=this.FSections.count-1;e++)t+=this.FSections[e].PageCount;return t}},{key:"PageUp",value:function(){this.DoPageUp(this)}},{key:"PageDown",value:function(){this.DoPageDown(this)}},{key:"GetSectionDrawLeft",value:function(t){var e=0;return this.FViewModel==Bs&&(e=this.FAnnotatePre.Visible?Math.max(Math.trunc((this.FViewWidth-this.ZoomIn(this.FSections[t].PaperWidthPix+lp.AnnotationWidth))/2),this.ZoomIn(this.FPagePadding)):Math.max(Math.trunc((this.FViewWidth-this.ZoomIn(this.FSections[t].PaperWidthPix))/2),this.ZoomIn(this.FPagePadding))),e=this.ZoomOut(e)}},{key:"GetFormatPointToViewCoord",value:function(t){var e=G.Create(t.x,t.y),i=this.ActiveSection,n=-1;return n=i.ActiveData==i.Page?i.GetPageIndexByFormat(e.y):i.ActivePageIndex,e.x=this.ZoomIn(this.GetSectionDrawLeft(this.ActiveSectionIndex)+(i.GetPageMarginLeft(n)+e.x))-this.FHScrollBar.position,i.ActiveData==i.Header?e.y=this.ZoomIn(this.GetSectionTopFilm(this.ActiveSectionIndex)+i.GetPageTopFilm(n)+i.GetHeaderPageDrawTop()+e.y)-this.FVScrollBar.position:i.ActiveData==i.Footer?e.y=this.ZoomIn(this.GetSectionTopFilm(this.ActiveSectionIndex)+i.GetPageTopFilm(n)+i.PaperHeightPix-i.PaperMarginBottomPix+e.y)-this.FVScrollBar.position:e.y=this.ZoomIn(this.GetSectionTopFilm(this.ActiveSectionIndex)+i.GetPageTopFilm(n)+i.GetHeaderAreaHeight()+e.y-i.GetPageDataFmtTop(n))-this.FVScrollBar.position,e}},{key:"GetTopLevelDrawItemViewCoord",value:function(){var t=this.ActiveSection.GetTopLevelDrawItemCoord();return t=this.GetFormatPointToViewCoord(t)}},{key:"GetTopLevelRectDrawItemViewCoord",value:function(){var t=this.ActiveSection.GetTopLevelRectDrawItemCoord();return t=this.GetFormatPointToViewCoord(t)}},{key:"SetActiveItemText",value:function(t){this.ActiveSection.SetActiveItemText(t)}},{key:"FormatSection",value:function(t){this.FSections[t].FormatData(),this.FSections[t].BuildSectionPages(0),this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.DoChange()}},{key:"ActiveSectionTopLevelData",value:function(){return this.ActiveSection.ActiveData.GetTopLevelData()}},{key:"GetSectionTopFilm",value:function(t){for(var e=0,i=0;i<=t-1;i++)e+=this.FSections[i].GetFilmHeight();return e}},{key:"SaveToFile",value:function(t){}},{key:"LoadFromFile",value:function(t){var e=this,i=!1;return K.loadFromFile(t,(function(n){(i=e.LoadFromStream(n))&&(e.FFileName=t)})),i}},{key:"SaveToText",value:function(){for(var t=this.FSections[0].SaveToText(),e=1;e<=this.FSections.count-1;e++)t=t+lp.sLineBreak+this.FSections[e].SaveToText();return t}},{key:"SaveToImage",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=new RF;e.ScaleX=1,e.ScaleY=1,e.Zoom=1,e.Print=!0,e.DPI=sr.PixelsPerInchX,e.ViewModel=Bs;var i=0,n=0;if(t){for(var o=0;o<this.FSections.count;o++)n+=this.FSections[o].PaperHeightPix*this.FSections[o].PageCount,i<this.FSections[o].PaperWidthPix&&(i=this.FSections[o].PaperWidthPix);e.WindowWidth=i,e.WindowHeight=n;var r=document.createElement("canvas");r.setAttribute("id","hclH5canvas_"+or.system.Timestamp),r.width=i,r.height=n,r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style.display="none",document.body.appendChild(r);for(var s,a=new Dt(r.getContext("2d")),l=0,h=0,c=0,u=0;u<this.PageCount;u++){l=(s=this.GetSectionPageIndexByPageIndex(u,h)).result,h=s.pageIndex,n=this.FSections[l].PaperHeightPix,a.brush.color=at.White,a.fillRect(U.Create(0,c,i,c+n));var f=e.scaleCanvas(a);try{this.FSections[l].paintPaper(h,0,c,a,e),c+=n}finally{e.restoreCanvasScale(a,f)}}var d=new Array;return d.push({width:i,height:r.height,dataurl:r.toDataURL()}),document.body.removeChild(r),d}var m=document.createElement("canvas");m.setAttribute("id","hclH5SaveImageCanvas_"+or.system.Timestamp),m.style.position="absolute",m.style.left="0px",m.style.top="0px",m.style.display="none",document.body.appendChild(m);for(var y,p=new Array,S=0,v=0,F=0;F<this.PageCount;F++){S=(y=this.GetSectionPageIndexByPageIndex(F,v)).result,v=y.pageIndex,m.width=this.FSections[S].PaperWidthPix,m.height=this.FSections[S].PaperHeightPix;var I=new Dt(m.getContext("2d"));I.brush.color=at.White,I.fillRect(U.Create(0,0,m.width,m.height)),e.WindowWidth=m.width,e.WindowHeight=m.height;var g=e.scaleCanvas(I);try{I.brush.color=at.White,I.fillRect(U.Create(0,0,m.width,m.height)),this.FSections[S].paintPaper(v,0,0,I,e)}finally{e.restoreCanvasScale(I,g)}p.push({width:m.width,height:m.height,dataurl:m.toDataURL()})}return document.body.removeChild(m),p}},{key:"LoadFromText",value:function(t){if(this.Clear(),this.FStyle.Initialize(),""==t)return!1;this.FStyle.States.Include(Ip.Saving);try{return this.ActiveSection.InsertText(t)}finally{this.FStyle.States.Exclude(Ip.Saving)}}},{key:"SaveToTextFile",value:function(t,e){}},{key:"LoadFromTextFile",value:function(t,e){}},{key:"SaveToTextStream",value:function(t,e){}},{key:"LoadFromTextStream",value:function(t,e){}},{key:"SaveToStream",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;lp.USESCRIPT&&!e&&this.DisSelect(),this.FStyle.States.Include(Ip.Saving);try{lp._SaveFileFormatAndVersion(t),this.DoSaveStreamBefor(t);var n=i;null==n&&((n=new Set([])).add(dp.Header),n.add(dp.Footer),n.add(dp.Page)),e||(this.FUndoList.clear(),this.DeleteUnUsedStyle(this.FStyle,this.FSections,n)),this.FStyle.SaveToStream(t);var o=0;this.FBKImageVisible&&(o|=128),this.BKImagePrintVisible&&(o|=64),t.writeByte(o),t.writeByte(this.FBKImageLayout),lp.HCSaveImageToStream(t,this.BKImage),t.writeByte(this.FSections.count);for(var r=0;r<=this.FSections.count-1;r++)this.FSections[r].SaveToStream(t,n);this.DoSaveStreamAfter(t)}finally{this.FStyle.States.Exclude(Ip.Saving)}}},{key:"DoLoadProceDelegate",value:function(t){var e=!1;this.BeginUpdate();try{this.FUndoList.clear(),this.FUndoList.SaveState();try{this.FUndoList.Enable=!1,this.FStyle.States.Include(Ip.Loading);try{t()}finally{this.FStyle.States.Exclude(Ip.Loading)}e=!0,this.DoViewResize()}finally{this.FUndoList.RestoreState()}}finally{this.EndUpdate()}return e}},{key:"LoadFromStream",value:function(t){var e=this;return this.DoLoadProceDelegate((function(){e.Clear(),t.position=0;e.DoLoadFromStream(t,e.FStyle,(function(i){var n=t.readByte();e.FSections[0].LoadFromStream(t,e.FStyle,i);for(var o=1;o<n;o++){var r=e.NewDefaultSection();r.LoadFromStream(t,e.FStyle,i),e.FSections.add(r)}}))}))}},{key:"InsertSectionFromFileStream",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=function(){t.Position=0;var n=new cs;e.DoLoadFromStream(t,n,(function(o){for(var r=t.readByte(),s=0;s<r;s++){var a=e.NewDefaultSection();a.LoadFromStream(t,n,o),i<0?e.FSections.add(a):e.FSections.insert(i+s,a)}}))};return this.DoLoadProceDelegate(n)}},{key:"SaveToXml",value:function(){this.FUndoList.clear();var t=new Set([]);t.add(dp.Header),t.add(dp.Footer),t.add(dp.Page),this.DeleteUnUsedStyle(this.FStyle,this.FSections,t);var e=new Qr,i=e.CreateNode("HCView");i.SetAttribute("EXT",lp.HC_EXT),i.SetAttribute("ver",lp.HC_FileVersion),i.SetAttribute("lang",lp.HC_PROGRAMLANGUAGE.toString()),this.DoSaveXmlDocument(i),e.AppendChild(i);var n,o=e.CreateNode("style");this.FStyle.ToXml(o),i.AppendChild(o),(o=e.CreateNode("sections")).SetAttribute("count",this.FSections.count.toString()),i.AppendChild(o);for(var r=0;r<this.FSections.count;r++)n=e.CreateNode("sc"),this.FSections[r].ToXml(n),o.AppendChild(n);return e.Text}},{key:"SaveToXmlStream",value:function(t,e){}},{key:"LoadFromXml",value:function(t){var e=!1;this.BeginUpdate();try{this.FUndoList.clear(),this.FUndoList.SaveState();try{this.FUndoList.Enable=!1,this.Clear();var i=t.ChildNodes[0];if("HCView"==i.Name){if(i.GetAttribute("EXT")!=lp.HC_EXT)return!1;i.GetAttribute("ver"),i.GetAttribute("lang");this.DoLoadXmlDocument(i),this.FStyle.States.Include(Ip.Loading);try{for(var n,o=0;o<i.ChildNodes.count;o++)if("style"==(n=i.ChildNodes[o]).Name)this.FStyle.ParseXml(n);else if("sections"==n.Name){this.FSections[0].ParseXml(n.ChildNodes[0]);for(var r=1;r<n.ChildNodes.Count;r++){var s=this.NewDefaultSection();s.ParseXml(n.ChildNodes[r]),this.FSections.add(s)}}this.DoMapChanged()}finally{this.FStyle.States.Exclude(Ip.Loading)}e=!0,this.DoViewResize()}}finally{this.FUndoList.RestoreState()}}finally{this.EndUpdate()}return e}},{key:"LoadFromXmlStream",value:function(t){}},{key:"SaveToHtml",value:function(){this.FUndoList.clear();var t=new Set([]);t.add(dp.Header),t.add(dp.Footer),t.add(dp.Page),this.DeleteUnUsedStyle(this.FStyle,this.FSections,t);var e=new j;e.append("<!DOCTYPE HTML>"),e.append("<html>"),e.append("<head>"),e.append("<title>"),e.append("</title>"),e.append(this.FStyle.ToCSS()),e.append("</head>"),e.append("<body>");for(var i=0;i<this.FSections.count;i++)e.append(this.FSections[i].ToHtml());return e.append("</body>"),e.append("</html>"),e.text}},{key:"GetSectionPageIndexByPageIndex",value:function(t,e){for(var i=-1,n=0,o=0;o<=this.FSections.count-1;o++){if(n+this.FSections[o].PageCount>t){i=o,e=t-n;break}n+=this.FSections[o].PageCount}return{pageIndex:e,result:i}}},{key:"Print",value:function(){return this.Print("")}},{key:"PrintCopies",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.PrintRange(t,0,this.PageCount-1,e)}},{key:"PrintRange",value:function(t,e,i,n){for(var o=new Array(i-e+1),r=e;r<=i;r++)o[r-e]=r;return this.PrintPages(t,n,o)}},{key:"PrintPages",value:function(t,e,i){}},{key:"PrintOdd",value:function(t){var e=new Array(0);return this.PrintPages(t,1,e)}},{key:"PrintEven",value:function(t){var e=new Array(0);return this.PrintPages(t,1,e)}},{key:"PrintCurPageByActiveLine",value:function(t,e,i){}},{key:"PrintCurPageByItemRange",value:function(t,e,i,n,o,r,s){}},{key:"PrintCurPageSelected",value:function(t,e,i){return this.ActiveSection.ActiveData.SelectExists(!1)?this.PrintCurPageByItemRange(t,e,i,this.ActiveSection.ActiveData.SelectInfo.StartItemNo,this.ActiveSection.ActiveData.SelectInfo.StartItemOffset,this.ActiveSection.ActiveData.SelectInfo.EndItemNo,this.ActiveSection.ActiveData.SelectInfo.EndItemOffset):TPrintResult.prNoSupport}},{key:"MergeTableSelectCells",value:function(){return this.ActiveSection.MergeTableSelectCells()}},{key:"TableApplyContentAlign",value:function(t){return this.ActiveSection.TableApplyContentAlign(t)}},{key:"Undo",value:function(){this.FStyle.States.Include(Ip.Undoing);try{if(this.FUndoList.Enable)try{this.FUndoList.Enable=!1,this.BeginUpdate();try{this.FUndoList.Undo()}finally{this.EndUpdate()}}finally{this.FUndoList.Enable=!0}}finally{this.FStyle.States.Exclude(Ip.Undoing)}}},{key:"Redo",value:function(){this.FStyle.States.Include(Ip.Redoing);try{if(this.FUndoList.Enable)try{this.FUndoList.Enable=!1,this.BeginUpdate();try{this.FUndoList.Redo()}finally{this.EndUpdate()}}finally{this.FUndoList.Enable=!0}}finally{this.FStyle.States.Exclude(Ip.Redoing)}}},{key:"Search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.ActiveSection.Search(t,e,i);if(n){var o=this.GetTopLevelDrawItemViewCoord(),r=this.ActiveSectionTopLevelData(),s=r.GetDrawItemNoByOffset(r.SelectInfo.StartItemNo,r.SelectInfo.StartItemOffset),a=r.GetDrawItemNoByOffset(r.SelectInfo.EndItemNo,r.SelectInfo.EndItemOffset),l=new U;s==a?(l.left=o.x+this.ZoomIn(r.GetDrawItemOffsetWidth(s,r.SelectInfo.StartItemOffset-r.DrawItems[s].CharOffs+1)),l.top=o.y,l.right=o.x+this.ZoomIn(r.GetDrawItemOffsetWidth(a,r.SelectInfo.EndItemOffset-r.DrawItems[a].CharOffs+1)),l.bottom=o.y+this.ZoomIn(r.DrawItems[a].rect.height)):e?(l.left=o.x+this.ZoomIn(r.DrawItems[s].rect.left-r.DrawItems[a].rect.left+r.GetDrawItemOffsetWidth(s,r.SelectInfo.StartItemOffset-r.DrawItems[s].CharOffs+1)),l.top=o.y+this.ZoomIn(r.DrawItems[s].rect.top-r.DrawItems[a].rect.top),l.right=o.x+this.ZoomIn(r.DrawItems[s].rect.left-r.DrawItems[a].rect.left+r.DrawItems[s].rect.width),l.bottom=l.top+this.ZoomIn(r.DrawItems[s].rect.height)):(l.left=o.x,l.top=o.y,l.right=o.x+this.ZoomIn(r.GetDrawItemOffsetWidth(a,r.SelectInfo.EndItemOffset-r.DrawItems[a].CharOffs+1)),l.bottom=o.y+this.ZoomIn(r.DrawItems[a].rect.height)),l.top<0?this.FVScrollBar.position=this.FVScrollBar.position+l.top:l.bottom>this.FViewHeight&&(this.FVScrollBar.position=this.FVScrollBar.position+l.bottom-this.FViewHeight),l.left<0?this.FHScrollBar.position=this.FHScrollBar.position+l.left:l.right>this.FViewWidth&&(this.FHScrollBar.position=this.FHScrollBar.position+l.right-this.FViewWidth)}return n}},{key:"Replace",value:function(t){return this.ActiveSection.Replace(t)}},{key:"NumberOfWords",value:function(){return this.SaveToText().length}},{key:"CanEdit",value:function(){return this.DoSectionCanEdit(this)}},{key:"Caret",get:function(){return this.FCaret}},{key:"FileName",get:function(){return this.FFileName},set:function(t){this.FFileName=t}},{key:"Style",get:function(){return this.FStyle}},{key:"SymmetryMargin",get:function(){return this.GetSymmetryMargin()},set:function(t){this.SetSymmetryMargin(t)}},{key:"ActivePageIndex",get:function(){return this.GetActivePageIndex()}},{key:"PagePreviewFirst",get:function(){return this.GetPagePreviewFirst()}},{key:"PageCount",get:function(){return this.GetPageCount()}},{key:"ActiveSectionIndex",get:function(){return this.FActiveSectionIndex},set:function(t){this.SetActiveSectionIndex(t)}},{key:"ActiveSection",get:function(){return this.GetActiveSection()}},{key:"HScrollBar",get:function(){return this.FHScrollBar}},{key:"VScrollBar",get:function(){return this.FVScrollBar}},{key:"HScrollBarAutoVisible",get:function(){return this.FHScrollBarAutoVisible},set:function(t){this.FHScrollBarAutoVisible!=t&&(this.FHScrollBarAutoVisible=t,this.FHScrollBar.visible=!t||this.FHScrollBar.pageSize<this.FHScrollBar.range)}},{key:"CurStyleNo",get:function(){return this.GetCurStyleNo()}},{key:"CurParaNo",get:function(){return this.GetCurParaNo()}},{key:"Zoom",get:function(){return this.FZoom},set:function(t){this.SetZoom(t)}},{key:"Sections",get:function(){return this.FSections}},{key:"ShowLineActiveMark",get:function(){return this.GetShowLineActiveMark()},set:function(t){this.SetShowLineActiveMark(t)}},{key:"ShowLineNo",get:function(){return this.GetShowLineNo()},set:function(t){this.SetShowLineNo(t)}},{key:"ShowUnderLine",get:function(){return this.GetShowUnderLine()},set:function(t){this.SetShowUnderLine(t)}},{key:"IsChanged",get:function(){return this.FIsChanged},set:function(t){this.SetIsChanged(t)}},{key:"PagePadding",get:function(){return this.FPagePadding},set:function(t){this.SetPagePadding(t)}},{key:"AnnotatePre",get:function(){return this.FAnnotatePre}},{key:"ViewWidth",get:function(){return this.FViewWidth}},{key:"ViewHeight",get:function(){return this.FViewHeight}},{key:"ViewModel",get:function(){return this.FViewModel},set:function(t){this.SetViewModel(t)}},{key:"PrintView",get:function(){return this.FPrintView},set:function(t){this.SetPrintView(t)}},{key:"AutoZoom",get:function(){return this.FAutoZoom},set:function(t){this.FAutoZoom=t}},{key:"ReadOnly",get:function(){return this.GetReadOnly()},set:function(t){this.SetReadOnly(t)}},{key:"PageNoFormat",get:function(){return this.ActiveSection.PageNoFormat},set:function(t){this.ActiveSection.PageNoFormat=t}},{key:"BKImageVisible",get:function(){return this.FBKImageVisible},set:function(t){this.SetBKImageVisible(t)}},{key:"BKImageLayout",get:function(){return this.FBKImageLayout},set:function(t){this.SetBKImageLayout(t)}}]),i}(gi);function uI(t){return(uI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fI(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function dI(t,e){return(dI=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function mI(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=pI(t);if(e){var o=pI(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return yI(this,i)}}function yI(t,e){return!e||"object"!==uI(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function pI(t){return(pI=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var SI=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&dI(t,e)}(r,t);var e,i,n,o=mI(r);function r(t,e,i,n,s){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(a=o.call(this,t,e,i,n,s)).StyleNo=Lp.EMRSTYLE_YUEJING,a}return e=r,(i=[{key:"GetMenarcheAge",value:function(){return this.LeftText}},{key:"SetMenarcheAge",value:function(t){this.LeftText=t}},{key:"GetMenstrualDuration",value:function(){return this.TopText}},{key:"SetMenstrualDuration",value:function(t){this.TopText=t}},{key:"GetMenstrualCycle",value:function(){return this.BottomText}},{key:"SetMenstrualCycle",value:function(t){this.BottomText=t}},{key:"GetMenstrualPause",value:function(){return this.RightText}},{key:"SetMenstrualPause",value:function(t){this.RightText=t}},{key:"ToXmlEmr",value:function(t){}},{key:"ParseXmlEmr",value:function(t){}},{key:"MenarcheAge",get:function(){return this.GetMenarcheAge()},set:function(t){this.SetMenarcheAge(t)}},{key:"MenstrualDuration",get:function(){return this.GetMenstrualDuration()},set:function(t){this.SetMenstrualDuration(t)}},{key:"MenstrualCycle",get:function(){return this.GetMenstrualCycle()},set:function(t){this.SetMenstrualCycle(t)}},{key:"MenstrualPause",get:function(){return this.GetMenstrualPause()},set:function(t){this.SetMenstrualPause(t)}}])&&fI(e.prototype,i),n&&fI(e,n),r}(xu);function vI(t){return(vI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function FI(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function II(t,e){return(II=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gI(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=CI(t);if(e){var o=CI(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return wI(this,i)}}function wI(t,e){return!e||"object"!==vI(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function CI(t){return(CI=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function kI(t){return(kI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function PI(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function DI(t,e,i){return(DI="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=xI(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function bI(t,e){return(bI=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function RI(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=xI(t);if(e){var o=xI(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return _I(this,i)}}function _I(t,e){return!e||"object"!==kI(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function xI(t){return(xI=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var AI=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bI(t,e)}(r,t);var e,i,n,o=RI(r);function r(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this)).FPropertys=new z,t}return e=r,n=[{key:"CreateEmrStyleItem",value:function(t,e){switch(e){case cs.Table:return new GS(t,1,1,1);case cs.CheckBox:return new HS(t,"勾选框",!1);case cs.Edit:return new VS(t,"");case cs.Combobox:return new WS(t,"");case cs.DateTimePicker:return new zS(t,X.Now());case cs.Button:return new US(t,"");case cs.RadioGroup:return new jS(t);case Lp.EMRSTYLE_YUEJING:return new SI(t,"","","","");case Lp.EMRSTYLE_TOOTH:return new Ev(t,"","","","");case Lp.EMRSTYLE_FANGJIAO:return new hv(t,"","","","");case cs.FloatBarCode:return new XS(t);case cs.FloatQRCode:return new KS(t);case cs.Image:return new YS(t);default:return null}}}],(i=[{key:"createBefor",value:function(){DI(xI(r.prototype),"createBefor",this).call(this),Hl.HCDefaultTextItemClass=ES,za.HCDefaultDomainItemClass=wv}},{key:"DoSectionCreateStyleItem",value:function(t,e){return r.CreateEmrStyleItem(t,e)}},{key:"DoLoadStreamBefor",value:function(t,e){var i=0;if(e>43&&(i=t.readByte()),i>0){var n=lp.HCLoadTextFromStream(t,e);this.Style.States.Contain(Ip.Loading)&&lp.SetPropertyString(n,this.FPropertys)}else this.Style.States.Contain(Ip.Loading)&&this.FPropertys.clear();DI(xI(r.prototype),"DoLoadStreamBefor",this).call(this,t,e)}},{key:"DoSaveStreamBefor",value:function(t){t.writeByte(r.EmrViewVersion);var e=lp.GetPropertyString(this.FPropertys);lp.HCSaveTextToStream(t,e),DI(xI(r.prototype),"DoSaveStreamBefor",this).call(this,t)}},{key:"TraverseItem",value:function(t){if(0!=t.Areas.values)for(var e=0;e<this.Sections.count;e++)t.Stop||(t.Areas.has(dp.Header)&&this.Sections[e].Header.TraverseItem(t),!t.Stop&&t.Areas.has(dp.Page)&&this.Sections[e].Page.TraverseItem(t),!t.Stop&&t.Areas.has(dp.Footer)&&this.Sections[e].Footer.TraverseItem(t))}}])&&PI(e.prototype,i),n&&PI(e,n),r}(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&II(t,e)}(r,t);var e,i,n,o=gI(r);function r(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this)).FStyle=new cs(!0,!0),t.FSections=new V,t.FSections.add(t.NewDefaultSection()),t.FActiveSectionIndex=0,t.BKImage=null,t.FBKImageVisible=!1,t.BKImagePrintVisible=!1,t.FBKImageLayout=vp,t}return e=r,(i=[{key:"NewDefaultSection",value:function(){var t=this,e=new _F(this.FStyle);return e.OnPaintFooterAfter=function(e,i,n,o,r){t.DoSectionPaintFooterAfter(e,i,n,o,r)},e.OnCreateItemByStyle=function(e,i){return t.DoSectionCreateStyleItem(e,i)},e}},{key:"DoLoadFromStream",value:function(t,e,i){t.position=0;var n=lp._LoadFileFormatAndVersion(t),o=n.fileExt,r=n.fileVersion;if(o!=lp.HC_EXT&&or.exception("加载失败,不是"+lp.HC_EXT+"文件!"),r>lp.HC_FileVersionInt&&or.exception("加载失败,当前编辑器最高支持版本为"+lp.HC_FileVersionInt.toString()+"的文件,无法打开版本为"+r.toString()+"的文件!"),this.DoLoadStreamBefor(t,r),e.LoadFromStream(t,r),r>55){var s=t.readByte();this.FBKImageVisible=or.system.isOdd(s>>7),this.BKImagePrintVisible=or.system.isOdd(s>>6),this.FBKImageLayout=t.readByte(),this.BKImage=lp.HCLoadImageFromStream(t)}else this.BKImage=null;i(r),this.DoLoadStreamAfter(t,r)}},{key:"GetActiveSection",value:function(){return this.FSections[this.FActiveSectionIndex]}},{key:"DoSectionPaintFooterAfter",value:function(t,e,i,n,o){var r=t;if(r.PageNoVisible){for(var s=this.FSections.indexOf(r),a=0,l=0,h=0;h<=this.FSections.count-1;h++)h==s&&(a=l),l+=this.FSections[h].PageCount;var c=C.stringFormat(r.PageNoFormat,a+r.PageNoFrom+e,l);n.font.size=10,n.font.name="宋体",n.textOut(i.left+Math.trunc((i.width-n.textWidth(c))/2),i.top+r.Footer.height,c)}}},{key:"DoSectionCreateStyleItem",value:function(t,e){return null}},{key:"DoSaveStreamBefor",value:function(t){}},{key:"DoSaveStreamAfter",value:function(t){}},{key:"DoLoadStreamBefor",value:function(t,e){}},{key:"DoLoadStreamAfter",value:function(t,e){}},{key:"DataLoadLiteStream",value:function(t,e){var i=lp._LoadFileFormatAndVersion(t),n=new cs;n.LoadFromStream(t,i.fileVersion),e(i.fileVersion,n)}},{key:"DeleteUnUsedStyle",value:function(t,e,i){t.TextStyles[0].CheckSaveUsed=!0,t.TextStyles[0].TempNo=0;for(var n=1;n<t.TextStyles.count;n++)t.TextStyles[n].CheckSaveUsed=!1,t.TextStyles[n].TempNo=cs.Null;for(var o=0;o<t.ParaStyles.count;o++)t.ParaStyles[o].CheckSaveUsed=!1,t.ParaStyles[o].TempNo=cs.Null;for(var r=0;r<e.count;r++)e[r].MarkStyleUsed(!0,i);for(var s=0,a=1;a<t.TextStyles.count;a++)t.TextStyles[a].CheckSaveUsed?t.TextStyles[a].TempNo=a-s:s++;s=0;for(var l=0;l<t.ParaStyles.count;l++)t.ParaStyles[l].CheckSaveUsed?t.ParaStyles[l].TempNo=l-s:s++;for(var h=null,c=0;c<=e.count-1;c++)e[c].MarkStyleUsed(!1,i),(h=e[c].ActiveData.GetTopLevelData()).CurStyleNo>cs.Null&&(h.CurStyleNo=t.TextStyles[h.CurStyleNo].TempNo),h.CurParaNo=t.ParaStyles[h.CurParaNo].TempNo;for(var u=t.TextStyles.count-1;u>=1;u--)t.TextStyles[u].CheckSaveUsed||t.TextStyles.delete(u);for(var f=t.ParaStyles.count-1;f>=0;f--)t.ParaStyles[f].CheckSaveUsed||t.ParaStyles.delete(f)}},{key:"Clear",value:function(){this.FStyle.Initialize(),this.FSections.removeRange(1,this.FSections.count-1),this.FActiveSectionIndex=0,this.FSections[0].clear()}},{key:"GetPageCount",value:function(){for(var t=0,e=0;e<=this.FSections.count-1;e++)t+=this.FSections[e].PageCount;return t}},{key:"GetSectionPageIndexByPageIndex",value:function(t,e){for(var i=-1,n=0,o=0;o<=this.FSections.count-1;o++){if(n+this.FSections[o].PageCount>t){i=o,e=t-n;break}n+=this.FSections[o].PageCount}return{pageIndex:e,result:i}}},{key:"SaveToFile",value:function(t){}},{key:"LoadFromFile",value:function(t){var e=this,i=!1;return K.loadFromFile(t,(function(t){i=e.LoadFromStream(t)})),i}},{key:"SaveToText",value:function(){this.FStyle.States.Include(Ip.Saving);try{for(var t=this.FSections[0].SaveToText(),e=1;e<=this.FSections.count-1;e++)t=t+lp.sLineBreak+this.FSections[e].SaveToText();return t}finally{this.FStyle.States.Exclude(Ip.Saving)}}},{key:"LoadFromText",value:function(t){if(this.clear(),this.FStyle.Initialize(),""==t)return!1;this.FStyle.States.Include(Ip.Saving);try{return this.ActiveSection.InsertText(t)}finally{this.FStyle.States.Exclude(Ip.Saving)}}},{key:"SaveToStream",value:function(t,e){this.FStyle.States.Include(Ip.Saving);try{lp._SaveFileFormatAndVersion(t),this.DoSaveStreamBefor(t);var i=new Set([]);i.add(dp.Header),i.add(dp.Footer),i.add(dp.Page),e||this.DeleteUnUsedStyle(this.FStyle,this.FSections,i),this.FStyle.SaveToStream(t);var n=0;this.FBKImageVisible&&(n|=128),this.BKImagePrintVisible&&(n|=64),t.writeByte(n),t.writeByte(this.FBKImageLayout),lp.HCSaveImageToStream(t,this.BKImage),t.writeByte(this.FSections.count);for(var o=0;o<=this.FSections.count-1;o++)this.FSections[o].SaveToStream(t,i);this.DoSaveStreamAfter(t)}finally{this.FStyle.States.Exclude(Ip.Saving)}}},{key:"LoadFromBytes",value:function(t){var e=new K;e.writeBuffer(t),e.position=0,this.LoadFromStream(e),e=null}},{key:"LoadFromStream",value:function(t){var e=this;this.FStyle.States.Include(Ip.Loading);try{t.position=0,this.DoLoadFromStream(t,this.FStyle,(function(i){var n=t.readByte();e.FSections[0].LoadFromStream(t,e.FStyle,i);for(var o=1;o<=n-1;o++){var r=e.NewDefaultSection();r.LoadFromStream(t,e.FStyle,i),e.FSections.add(r)}}))}finally{this.FStyle.States.Exclude(Ip.Loading)}return!0}},{key:"InsertLiteStream",value:function(t){var e=this,i=!1;return this.DataLoadLiteStream(t,(function(n,o){i=e.ActiveSection.InsertStream(t,o,n)})),i}},{key:"PageCount",get:function(){return this.GetPageCount()}},{key:"ActiveSection",get:function(){return this.GetActiveSection()}},{key:"Sections",get:function(){return this.FSections}},{key:"Style",get:function(){return this.FStyle}}])&&FI(e.prototype,i),n&&FI(e,n),r}(L));function TI(t,e,i){return(TI="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=UI(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function OI(t){return(OI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function NI(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function BI(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function EI(t,e,i){return e&&BI(t.prototype,e),i&&BI(t,i),t}function MI(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&LI(t,e)}function LI(t,e){return(LI=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function GI(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=UI(t);if(e){var o=UI(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return HI(this,i)}}function HI(t,e){return!e||"object"!==OI(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function UI(t){return(UI=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}AI.EmrViewVersion=1;var VI=function(t){MI(i,t);var e=GI(i);function i(){var t;return NI(this,i),(t=e.call(this)).Section=null,t.Data=null,t.ItemNo=-1,t.DrawItemNo=-1,t}return EI(i,[{key:"getHint",value:function(){if(null===this.Data||this.Data.MouseMoveRestrain)return"";if(this.ItemNo<0||this.ItemNo>this.Data.Items.count-1)return"";var t=this.Data.Items[this.ItemNo].Name;return null!=t?this.Data.HotDomain.BeginNo>=0&&!this.Data.Items[this.Data.HotDomain.BeginNo].IsProc&&this.Data.HotDomain.BeginNo!=this.ItemNo&&this.Data.HotDomain.EndNo!=this.ItemNo&&(t=""!=t?this.Data.Items[this.Data.HotDomain.BeginNo].Name+">"+t:this.Data.Items[this.Data.HotDomain.BeginNo].Name):t="",t}}]),i}(L),WI=function(t){MI(i,t);var e=GI(i);function i(){var t;return NI(this,i),(t=e.call(this))._width=100,t._height=100,t.FHideTrace=!1,t.Secret=!1,t.TraceInfoAnnotate=!1,t.FTrace=!1,t.FTraceCount=0,t.FInsertTraceStream=!1,t.FPrintUnAlloc=!1,t.FDesignMode=!1,t.FIgnoreAcceptAction=!1,t.FDeDoneColor=lp.clBtnFace,t.FDeUnDoneColor="#FFDD80",t.FDeHotColor="rgb(204, 224, 244)",t.FPageBlankTip="",t.FPropertys=new z,t.FHintInfo=new VI,t.OnCanNotEdit=null,t.OnSyncDeItem=null,t.OnCopyRequest=null,t.OnPasteRequest=null,t.OnCopyAsStream=null,t.OnPasteFromStream=null,t.OnSyntaxCheck=null,t.OnSyntaxPaint=null,t.OnDrawTrace=null,t.OnSaveItem=null,t.Style.DefaultTextStyle.Size=mt.fontSizeToPt("小四"),t.Style.DefaultTextStyle.Family="宋体",t.HScrollBar.addStatus(200),lp.PROCSERIES&&(t.FUnEditProcBKColor=lp.clBtnFace,t.FShowProcSplit=!0,t.CanEditCheckInEditProc=!0,t.FProcCount=0,t.FCaretProcInfo=new Cv,t.FEditProcInfo=new Cv,t.FEditProcIndex=""),t.PrintHideUnAllocValue=!1,t.UnAllocWarning=!0,t.PrintSave=!1,t}return EI(i,[{key:"createBefor",value:function(){Hl.HCDefaultTextItemClass=ES,za.HCDefaultDomainItemClass=wv}},{key:"getHint_",value:function(){return this.FHintInfo.getHint()}},{key:"getHintRect",value:function(){return null}},{key:"DoSectionDrawItemMouseMove",value:function(t,e,n,o,r,s){TI(UI(i.prototype),"DoSectionDrawItemMouseMove",this).call(this,t,e,n,o,r,s),this.FHintInfo.Section=t,this.FHintInfo.Data=e,this.FHintInfo.ItemNo=n,this.FHintInfo.DrawItemNo=r}},{key:"SetHideTrace",value:function(t){var e=this;if(this.FHideTrace!=t){var i;this.FHideTrace=t,this.DisSelect();var n=new $l;n.Areas.add(dp.Page),n.Process=function(t,n,o,r,s){t.Items[n].isClass(ES)?((i=t.Items[n]).TraceStyles.has(sS.Del)&&(i.Visible=!e.FHideTrace),e.TraceInfoAnnotate&&0!=i.TraceStyles.value&&(e.FHideTrace?e.AnnotatePre.RemoveDataAnnotate(null):e.AnnotatePre.InsertDataAnnotate(null))):t.Items[n].isClass(al)&&t.Items[n].FormatDirty()},this.TraverseItem(n),this.FormatData()}}},{key:"SetPageBlankTip",value:function(t){this.FPageBlankTip!=t&&(this.FPageBlankTip=t,this.UpdateView())}},{key:"DoSyntaxCheck",value:function(t,e,i,n){t.Items[e].StyleNo>cs.Null&&this.OnSyntaxCheck(t,n,e)}},{key:"DoSyncDeItem",value:function(t,e,i){null!=this.OnSyncDeItem&&this.OnSyncDeItem(t,e,i)}},{key:"InsertEmrTraceText",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t.replace(/\r\n/g,""),n=new ES(i);this.CurStyleNo<cs.Null?n.StyleNo=0:n.StyleNo=this.CurStyleNo,n.ParaNo=this.CurParaNo,n.TraceStyles.value=e?sS.Add:sS.Del,this.InsertItem(n)}},{key:"MakeSelectTraceIf",value:function(){var t=this.ActiveSectionTopLevelData();if(!(t.SelectInfo.StartItemNo<0)&&t.SelectExists()){this.UndoGroupBegin();try{var e=t.GetSelectText();this.DeleteSelected(),this.InsertEmrTraceText(e,!1)}finally{this.UndoGroupEnd()}}}},{key:"CanNotEdit",value:function(){var t=!this.ActiveSectionTopLevelData().CanEdit();return t&&null!=this.OnCanNotEdit&&this.OnCanNotEdit(this),t}},{key:"DeItemIndexMatch",value:function(t,e){return t.StyleNo>cs.Null||t.StyleNo==cs.Image||t.StyleNo==cs.Table||t.StyleNo==cs.CheckBox||t.StyleNo==cs.Edit||t.StyleNo==cs.Combobox||t.StyleNo==cs.DateTimePicker||t.StyleNo==cs.RadioGroup?t.GetValue(aS)==e:void 0}},{key:"GetValue",value:function(t){return lp.HCGetProperty(this.FPropertys,t)}},{key:"SetValue",value:function(t,e){e=e.toString(),lp.HCSetProperty(this.FPropertys,t,e)}},{key:"DoSectionCreateStyleItem",value:function(t,e){return AI.CreateEmrStyleItem(t,e)}},{key:"DoSectionCaretItemChanged",value:function(t,e,n){var o,r="",s=this.GetTopLevelItem();if(null!=s){lp.PROCSERIES&&this.FProcCount>0&&e==this.ActiveSection.Page&&(this.CheckCaretProcInfo(),this.FCaretProcInfo.EndNo>0&&(r=(o=this.ActiveSection.ActiveData.Items[this.FCaretProcInfo.BeginNo]).GetValue(hS)));var a=this.ActiveSectionTopLevelData();a.ActiveDomain.EndNo>0&&(o=a.Items[a.ActiveDomain.BeginNo],(lp.PROCSERIES&&!o.IsProc||!lp.PROCSERIES)&&(r=""!=r?r+">"+o.GetValue(hS)+"("+o.GetValue(aS)+")":o.GetValue(hS)+"("+o.GetValue(aS)+")")),s.isClass(ES)?0!=s.TraceStyles.value?r=r+"-"+s.GetHint():s.IsElement&&(r=""!=r?r+" > "+s.GetValue(hS)+"("+s.GetValue(aS)+")":s.GetValue(hS)+"("+s.GetValue(aS)+")"):s.isClass(VS)||s.isClass(WS)||s.isClass(zS)?r=""!=r?r+" > "+s.GetValue(hS)+"("+s.GetValue(aS)+")":s.GetValue(hS)+"("+s.GetValue(aS)+")":s.isClass(YS)&&(r=""!=r?r+" > "+s[hS]+"("+s[aS]+")":s[hS]+"("+s[aS]+")")}this.HScrollBar.Statuses[1].text=r,TI(UI(i.prototype),"DoSectionCaretItemChanged",this).call(this,t,e,n)}},{key:"DoSectionInsertItem",value:function(t,e,n){if(n.StyleNo>cs.Null){if(this.Style.States.UndoRedo())return;this.Style.States.Contain(Ip.InsertBreakItem)||this.Style.States.Contain(Ip.Loading)||(this.FInsertTraceStream?(n.TraceStyles.add(sS.Del),n.ParaFirst=!1):this.FTrace&&!n.TraceStyles.has(sS.Del)&&(n.TraceStyles.value=sS.Add)),0!=n.TraceStyles.value&&(this.FTraceCount++,n.TraceStyles.has(sS.Del)?n.Visible=!this.FHideTrace:n.Visible=!0,this.TraceInfoAnnotate&&!this.FHideTrace&&this.AnnotatePre.InsertDataAnnotate(null)),n.TraceStyles.has(sS.Del)||this.Style.States.Contain(Ip.InsertBreakItem)||this.DoSyncDeItem(t,e,n)}else if(lp.PROCSERIES&&n.StyleNo==cs.Domain)n.IsProcBegin&&this.FProcCount++;else if(n.StyleNo!=cs.Line){if(this.Style.States.UndoRedo())return;this.DoSyncDeItem(t,e,n)}TI(UI(i.prototype),"DoSectionInsertItem",this).call(this,t,e,n)}},{key:"DoSectionRemoveItem",value:function(t,e,n){n.isClass(ES)&&0!=n.TraceStyles.value&&this.FTraceCount>0&&(this.FTraceCount--,this.TraceInfoAnnotate&&this.AnnotatePre.RemoveDataAnnotate(null)),TI(UI(i.prototype),"DoSectionRemoveItem",this).call(this,t,e,n)}},{key:"DoSectionSaveItem",value:function(t,e,n){var o=TI(UI(i.prototype),"DoSectionSaveItem",this).call(this,t,e,n);return o&&!or.emrCommon.G_SaveTrace&&e.Items[n].StyleNo>cs.Null&&e.Items[n].TraceStyles.has(sS.Del)&&(o=!1),o&&this.Style.States.Contain(Ip.Copying)&&e.Items[n].StyleNo>cs.Null&&(o=!e.Items[n].TraceStyles.has(sS.Del)&&!e.Items[n].CopyProtect),lp.USESAVEITEMEVENT&&!this.PrintSave&&this.Style.States.Contain(Ip.Saving)&&o&&null!=this.OnSaveItem&&this.OnSaveItem(t,e,e.Items[n]),o}},{key:"DoSectionPaintDomainRegion",value:function(t,e,i){return e.Items[i].GetValue(Iv.SubType)!=gv.Proc}},{key:"DoSectionMatchTextStyleNoAt",value:function(t,e,n){return t.Items[e].StyleNo===cs.Domain&&t.Items[e].Empty?t.Items[e].TextStyleNo:TI(UI(i.prototype),"DoSectionMatchTextStyleNoAt",this).call(this,t,e,n)}},{key:"DoSectionItemMouseDown",value:function(t,e,n,o,r){if(TI(UI(i.prototype),"DoSectionItemMouseDown",this).call(this,t,e,n,o,r),!t.SelectExists()){var s=e.Items[n];s.isClass(ES)&&e.SelectInfo.StartRestrain&&s.Length>0&&(s.Active=!1)}}},{key:"DoSectionCanEdit",value:function(t){return!!this.FIgnoreAcceptAction||(!lp.PROCSERIES||!this.CanEditCheckInEditProc||this.FEditProcIndex==this.FCaretProcInfo.Index)&&(!!TI(UI(i.prototype),"DoSectionCanEdit",this).call(this,t)&&(!(null!=t.ActiveDomain&&t.ActiveDomain.BeginNo>=0)||!t.Items[t.ActiveDomain.BeginNo].ReadOnly))}},{key:"DoSectionAcceptAction",value:function(t,e,n,o,r){if(this.FIgnoreAcceptAction)return!0;if(lp.PROCSERIES){if(r==wp.DeleteSelected&&e==this.ActiveSection.Page&&this.FEditProcInfo.EndNo>0&&!(e.SelectInfo.StartItemNo>this.FEditProcInfo.BeginNo&&e.SelectInfo.EndItemNo<this.FEditProcInfo.EndNo))return!1;this.FCaretProcInfo.EndNo>0&&(this.Sections[this.FCaretProcInfo.SectionIndex].Page.Items[this.FCaretProcInfo.BeginNo].Changed=!0)}var s=TI(UI(i.prototype),"DoSectionAcceptAction",this).call(this,t,e,n,o,r);if(s)switch(r){case wp.BackDeleteText:case wp.DeleteText:if(e.Items[n].isClass(ES)){var a=e.Items[n];this.FTrace||!a.IsElement||1!=a.Length||a.DeleteAllow||(""!=a.GetValue(hS)?this.SetActiveItemText(a.GetValue(hS)):this.SetActiveItemText("未填写"),a.AllocValue=!1,s=!1)}break;case wp.SetItemText:if(e.Items[n].isClass(ES))e.Items[n].AllocValue=!0;break;case wp.ReturnItem:if(e.Items[n].isClass(ES)){var l=e.Items[n];o>0&&o<l.Length&&l.IsElement&&(s=!1)}break;case wp.DeleteItem:var h=e.Items[n];h.isClass(wv)?s=!1:(h.isClass(ES)||h.isClass(GS)||h.isClass(HS)||h.isClass(VS)||h.isClass(WS)||h.isClass(zS)||h.isClass(jS)||h.isClass(XS)||h.isClass(YS))&&(s=h.DeleteAllow)}return s}},{key:"Clear",value:function(){this.FTraceCount=0,lp.PROCSERIES&&(this.FProcCount=0,this.FCaretProcInfo.Clear(),this.FEditProcInfo.Clear(),this.FEditProcIndex=""),this.FPropertys.clear(),TI(UI(i.prototype),"Clear",this).call(this)}},{key:"doKeyDown_",value:function(t){if(this.FTrace)if(lp.IsKeyDownEdit(t.keyCode)){if(this.CanNotEdit())return;var e="",n="",o="",r="",s="",a=cs.Null,l=cs.Null,h=new M,c=this.ActiveSectionTopLevelData();if(c.SelectExists()){var u=new K;this.SaveSelectToStream(u),this.BeginUpdate();try{this.UndoGroupBegin();try{TI(UI(i.prototype),"doKeyDown_",this).call(this,t),u.position=0,this.FInsertTraceStream=!0,this.InsertLiteStream(u)}finally{this.FInsertTraceStream=!1,this.UndoGroupEnd(),u=null}}finally{this.EndUpdate()}return}if(c.SelectInfo.StartItemNo<0)return;if(c.Items[c.SelectInfo.StartItemNo].StyleNo<cs.Null)return void TI(UI(i.prototype),"doKeyDown_",this).call(this,t);if(t.keyCode==Pe){if(0==c.SelectInfo.StartItemNo&&0==c.SelectInfo.StartItemOffset)return;if(0==c.SelectInfo.StartItemOffset)return void(c.Items[c.SelectInfo.StartItemNo].ParaFirst?TI(UI(i.prototype),"doKeyDown_",this).call(this,t):(c.SelectInfo.StartItemNo=c.SelectInfo.StartItemNo-1,c.SelectInfo.StartItemOffset=c.Items[c.SelectInfo.StartItemNo].Length,this.doKeyDown_(t)));if(c.Items[c.SelectInfo.StartItemNo].isClass(ES)){var f=c.Items[c.SelectInfo.StartItemNo];if(!f.AcceptAction(c.SelectInfo.StartItemOffset,!1,wp.BackDeleteText))return void TI(UI(i.prototype),"doKeyDown_",this).call(this,t);e=f.SubString(c.SelectInfo.StartItemOffset,1),a=f.StyleNo,l=f.ParaNo,h.value=f.TraceStyles.value,n=f.GetValue(vS),o=f.GetValue(IS),r=f.GetValue(SS),s=f.GetValue(FS)}}else if(t.keyCode==Ge){if(c.SelectInfo.StartItemNo==c.Items.count-1&&c.SelectInfo.StartItemOffset==c.Items[c.Items.count-1].Length)return;if(c.SelectInfo.StartItemOffset==c.Items[c.SelectInfo.StartItemNo].Length)return c.SelectInfo.StartItemNo=c.SelectInfo.StartItemNo+1,c.SelectInfo.StartItemOffset=0,void this.doKeyDown_(t);if(c.Items[c.SelectInfo.StartItemNo].isClass(ES)){var d=c.Items[c.SelectInfo.StartItemNo];if(!d.AcceptAction(c.SelectInfo.StartItemOffset,!1,wp.DeleteText))return void TI(UI(i.prototype),"doKeyDown_",this).call(this,t);e=d.SubString(c.SelectInfo.StartItemOffset+1,1),a=d.StyleNo,l=d.ParaNo,h.value=d.TraceStyles.value,n=d.GetValue(vS),o=d.GetValue(IS),r=d.GetValue(SS),s=d.GetValue(FS)}}this.BeginUpdate();try{if(TI(UI(i.prototype),"doKeyDown_",this).call(this,t),this.FTrace&&""!=e){if(h.has(sS.Add)&&""==n)return;var m=new ES;m.Text=e,m.StyleNo=a,m.ParaNo=l,m.TraceStyles.value=h.value,m.SetValue(IS,o),m.SetValue(vS,n),h.has(sS.Del)&&""==r?m.TraceStyles.remove(sS.Del):(m.TraceStyles.add(sS.Del),m.SetValue(FS,s),m.SetValue(SS,r));var y=c.Items[c.SelectInfo.StartItemNo];0==c.SelectInfo.StartItemOffset?m.CanConcatItems(y)?(y.Text=m.Text+y.Text,t.keyCode==Ge&&(c.SelectInfo.StartItemOffset=c.SelectInfo.StartItemOffset+1),this.ActiveSection.ReFormatActiveItem()):(c.IsEmptyLine(c.SelectInfo.StartItemNo)?m.ParaFirst=!1:(m.ParaFirst=y.ParaFirst,y.ParaFirst=!1),this.InsertItem(m),t.keyCode==Pe&&(c.SelectInfo.StartItemOffset=c.SelectInfo.StartItemOffset-1)):c.SelectInfo.StartItemOffset==y.Length&&y.CanConcatItems(m)?(y.Text=y.Text+m.Text,t.keyCode==Ge&&(c.SelectInfo.StartItemOffset=c.SelectInfo.StartItemOffset+1),this.ActiveSection.ReFormatActiveItem()):(this.InsertItem(m),t.keyCode==Pe&&(c.SelectInfo.StartItemOffset=c.SelectInfo.StartItemOffset-1))}}finally{this.EndUpdate()}}else TI(UI(i.prototype),"doKeyDown_",this).call(this,t);else TI(UI(i.prototype),"doKeyDown_",this).call(this,t)}},{key:"doKeyPress_",value:function(t){if(lp.IsKeyPressWant(t)){if(this.CanNotEdit())return;if(this.FTrace){var e=this.ActiveSectionTopLevelData().GetActiveItem();return e&&e.isClass(Ya)?void TI(UI(i.prototype),"doKeyPress_",this).call(this,t):(this.MakeSelectTraceIf(),void this.InsertEmrTraceText(t.key))}TI(UI(i.prototype),"doKeyPress_",this).call(this,t)}}},{key:"DoInsertText",value:function(t){return!this.CanNotEdit()&&(this.FTrace?(this.MakeSelectTraceIf(),this.InsertEmrTraceText(t),!0):TI(UI(i.prototype),"DoInsertText",this).call(this,t))}},{key:"DoCopyRequest",value:function(t){return null!=this.OnCopyRequest?this.OnCopyRequest(t):TI(UI(i.prototype),"DoCopyRequest",this).call(this,t)}},{key:"DoPasteRequest",value:function(t){var e=this.ActiveSectionTopLevelData(),n=e.GetActiveItem();return!(n.isClass(ES)&&n.IsElement&&t!=Ao&&!e.SelectStartItemBoundary())&&(null!=this.OnPasteRequest?this.OnPasteRequest(t):TI(UI(i.prototype),"DoPasteRequest",this).call(this,t))}},{key:"DoCopyAsStream",value:function(t){null!=this.OnCopyAsStream?this.OnCopyAsStream(t):TI(UI(i.prototype),"DoCopyAsStream",this).call(this,t)}},{key:"DoPasteFormatStream",value:function(t){return null!=this.OnPasteFromStream?this.OnPasteFromStream(t):TI(UI(i.prototype),"DoPasteFormatStream",this).call(this,t)}},{key:"DoSaveStreamBefor",value:function(t){t.writeByte(AI.EmrViewVersion);var e=lp.GetPropertyString(this.FPropertys);lp.HCSaveTextToStream(t,e),TI(UI(i.prototype),"DoSaveStreamBefor",this).call(this,t)}},{key:"DoLoadStreamAfter",value:function(t,e){TI(UI(i.prototype),"DoLoadStreamAfter",this).call(this,t,e),null!=this.OnLoadStreamAfter&&this.OnLoadStreamAfter()}},{key:"DoSaveXmlDocument",value:function(t){TI(UI(i.prototype),"DoSaveXmlDocument",this).call(this,t),this.FPropertys.count>0&&t.SetAttribute("property",lp.GetPropertyString(this.FPropertys))}},{key:"DoLoadXmlDocument",value:function(t){TI(UI(i.prototype),"DoLoadXmlDocument",this).call(this,t),t.HasAttribute("property")&&lp.SetPropertyString(t.GetAttribute("property"),this.FPropertys)}},{key:"DoLoadStreamBefor",value:function(t,e){var n=0;if(e>43&&(n=t.readByte()),n>0){var o=lp.HCLoadTextFromStream(t,e);this.Style.States.Contain(Ip.Loading)&&lp.SetPropertyString(o,this.FPropertys)}else this.Style.States.Contain(Ip.Loading)&&this.FPropertys.clear();TI(UI(i.prototype),"DoLoadStreamBefor",this).call(this,t,e)}},{key:"DoSectionPaintPageBefor",value:function(t,e,n,o,r){if(TI(UI(i.prototype),"DoSectionPaintPageBefor",this).call(this,t,e,n,o,r),lp.PROCSERIES&&!r.Print&&this.FEditProcInfo.EndNo>0){var s=this.FEditProcInfo.Data,a=s.DrawItems[s.Items[this.FEditProcInfo.BeginNo].FirstDItemNo].rect.leftTop;(a=this.GetFormatPointToViewCoord(a)).y>n.top&&(o.brush.color=this.FUnEditProcBKColor,o.fillRect(U.Create(n.left,n.top,n.right,a.y))),this.FEditProcInfo.EndNo<s.Items.count-1&&(a=s.DrawItems[s.Items[this.FEditProcInfo.EndNo].FirstDItemNo].rect.rightBottom,(a=this.GetFormatPointToViewCoord(a)).y<n.bottom&&(o.brush.color=this.FUnEditProcBKColor,a.x=n.top+t.GetPageDataHeight(e),a.x<n.bottom?o.fillRect(U.Create(n.left,a.y,n.right,a.x)):o.fillRect(U.Create(n.left,a.y,n.right,n.bottom))))}}},{key:"DoSectionDrawItemPaintBefor",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){if(!f.Print){if(lp.PROCSERIES)if(this.FShowProcSplit&&this.FProcCount>0)if(e.isClass(SF)&&e.Items[i].isClass(wv))e.Items[i].IsProcBegin&&(u.pen.style=pt.DashDotDot,u.pen.color=at.Blue,u.moveTo(s,o.top-1),u.lineTo(a,o.top-1));if(this.UnAllocWarning&&e.Items[i].StyleNo==cs.Domain&&e.Items[i].Empty&&(u.pen.color=at.Red,u.pen.width=1,u.pen.style=pt.Solid,lp.HCDrawWave(u,r)),e.Items[i].isClass(ES)){var d=e.Items[i];if(!d.Selected())if(d.IsElement){if(d.MouseIn||d.Active?(d.OutOfRang?u.brush.color=at.Red:u.brush.color=this.FDeHotColor,u.fillRect(o)):this.FDesignMode?(d.AllocValue?u.brush.color=this.FDeDoneColor:u.brush.color=this.FDeUnDoneColor,u.fillRect(o)):d.OutOfRang?(u.brush.color=at.Red,u.fillRect(o)):(d.AllocValue?u.brush.color=this.FDeDoneColor:u.brush.color=this.FDeUnDoneColor,u.fillRect(o)),i<e.Items.count-1&&!e.Items[i+1].ParaFirst&&e.Items[i+1].StyleNo>cs.Null&&e.Items[i+1].IsElement){u.pen.width=1,u.pen.color=this.Style.BackgroundColor,u.beginPath();try{u.moveTo(o.right-1,o.bottom-5),u.lineTo(o.right-1,o.bottom),u.moveTo(o.right-2,o.bottom-4),u.lineTo(o.right-2,o.bottom),u.moveTo(o.right-3,o.bottom-3),u.lineTo(o.right-3,o.bottom),u.moveTo(o.right-4,o.bottom-2),u.lineTo(o.right-4,o.bottom),u.moveTo(o.right-5,o.bottom-1),u.lineTo(o.right-5,o.bottom)}finally{u.paintPath()}}if(i>0&&!e.Items[i].ParaFirst&&e.Items[i-1].StyleNo>cs.Null&&e.Items[i-1].IsElement){u.pen.width=1,u.pen.color=this.Style.BackgroundColor,u.beginPath();try{u.moveTo(o.left,o.bottom-5),u.lineTo(o.left,o.bottom),u.moveTo(o.left+1,o.bottom-4),u.lineTo(o.left+1,o.bottom),u.moveTo(o.left+2,o.bottom-3),u.lineTo(o.left+2,o.bottom),u.moveTo(o.left+3,o.bottom-2),u.lineTo(o.left+3,o.bottom),u.moveTo(o.left+4,o.bottom-1),u.lineTo(o.left+4,o.bottom)}finally{u.paintPath()}}}else(this.FDesignMode||d.MouseIn||d.Active)&&(d.EditProtect||d.CopyProtect)&&(u.brush.color=lp.clBtnFace,u.fillRect(o));if(!this.FHideTrace&&0!=d.TraceStyles.value)if(null!=this.OnDrawTrace)this.OnDrawTrace(d,r,u);else{if(d.TraceStyles.has(sS.Del)){var m,y=this.Style.TextStyles[d.StyleNo].FontHeight;switch(this.Style.ParaStyles[d.ParaNo].AlignVert){case vr:m=o.top+Math.trunc(y/2);break;case Fr:m=o.top+Math.trunc((o.bottom-o.top)/2);break;default:m=o.bottom-Math.trunc(y/2)}u.pen.style=pt.Solid,u.pen.color=at.Red,u.pen.width=1,u.drawLineDriect(o.left,m-1,o.right,m-1),u.drawLineDriect(o.left,m+2,o.right,m+2)}if(d.TraceStyles.has(sS.Add)){var p=this.Style.TextStyles[d.StyleNo].FontHeight,S=o.bottom;switch(this.Style.ParaStyles[d.ParaNo].AlignVert){case vr:S=o.top+p;break;case Fr:S=o.top+Math.trunc((o.height+p)/2)}u.pen.style=pt.Solid,u.pen.color=at.Blue,u.pen.width=1,u.drawLineDriect(o.left,S,o.right,S)}}}}}},{key:"DoSectionDrawItemPaintContent",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){if(!(f.Print||t.Items[e].StyleNo<cs.Null)){var d=t.Items[e];if(d.SyntaxCount()>0&&!d.IsSelectComplate)for(var m,y=t.DrawItems[i].CharOffs,p=t.DrawItems[i].CharOffsetEnd(),S=0,v=0,F=0,I=new U,g=!1,w=0;w<d.Syntaxs.count;w++)if(!((S=d.Syntaxs[w].Offset)>p)&&!((v=S+d.Syntaxs[w].Length-1)<y)&&(g=!1,S<=y&&v>=p?(g=!0,I.left=o.left,I.right=o.right):S>=y?(g=!0,v<=p?(F=S-y,m=d.Syntaxs[w].Length,I.left=o.left+t.GetDrawItemOffsetWidth(i,F,u),I.right=o.left+t.GetDrawItemOffsetWidth(i,F+m,u)):(I.left=o.left+t.GetDrawItemOffsetWidth(i,S-y,u),I.right=o.right)):v<=p&&(g=!0,I.left=o.left,I.right=o.left+t.GetDrawItemOffsetWidth(i,v-y+1,u)),g))if(I.top=o.top,I.bottom=o.bottom,null!=this.OnSyntaxPaint)this.OnSyntaxPaint(t,e,r,d.Syntaxs[w],I,u);else{switch(d.Syntaxs[w].Problem){case OS:u.pen.color=at.Red;break;case NS:u.pen.color=at.Orange}lp.HCDrawWave(u,I)}}}},{key:"DrawBlankTip_",value:function(t,e,i,n,o){e+14<=n&&(o.font.size=12,o.font.styles.clear(),o.font.color=at.Black,o.textOut(t+(i-t-o.textWidth(this.FPageBlankTip))/2,e,this.FPageBlankTip))}},{key:"DrawTraceHint_",value:function(t,e,i,n,o){o.font.size=12,o.font.color=at.Black;var r=t.GetValue(vS)+" "+t.GetValue(SS),s=o.textMetric(r),a=U.CreateByBounds(e.left,e.top-s.height-5,s.width,s.height);a.right>i&&a.offset(i-a.right,0),a.top<n&&a.offset(0,e.height),t.TraceStyles.has(sS.Del)?o.brush.color=lp.clBtnFace:o.brush.color=lp.clInfoBk,o.fillRect(a),o.textRect(a,a.left,a.top,r),o.pen.color=at.Gray,o.pen.width=2,o.moveTo(a.left+2,a.bottom),o.lineTo(a.right,a.bottom),o.moveTo(a.right,a.top+2),o.lineTo(a.right,a.bottom+1)}},{key:"DoSectionDrawItemPaintAfter",value:function(t,e,n,o,r,s,a,l,h,c,u,f,d){if(d.Print&&!this.FPrintUnAlloc){var m=e.Items[n];if(m.StyleNo>cs.Null&&m.IsElement&&!m.AllocValue)return f.brush.color=at.White,void f.fillRect(s)}if(!this.FHideTrace&&this.FTraceCount>0){var y=e.Items[n];if(y.StyleNo>cs.Null&&0!=y.TraceStyles.value&&(""!=y.GetValue(vS)||""!=y.GetValue(SS)))if(this.TraceInfoAnnotate){var p=new lI;p.DrawRect.resetRect(s),p.Title=y.GetHint(),p.Text=e.GetDrawItemText(o),this.AnnotatePre.AddDrawAnnotate(p)}else o!=e.HotDrawItemNo||e.MouseMoveRestrain||this.DrawTraceHint_(y,s,l,c,f)}if(this.Secret){var S=e.Items[n];if(S.StyleNo>cs.Null&&""!=S.GetValue(gS)){var v=ES.GetSecretRange(S.GetValue(gS));if(v.low>0){v.hi<0&&(v.hi=S.Length);var F=e.DrawItems[o];if(v.low<=F.CharOffsetEnd()&&(v.low<F.CharOffs&&(v.low=F.CharOffs),v.hi>F.CharOffsetEnd()&&(v.hi=F.CharOffsetEnd()),v.low=v.low-F.CharOffs+1,v.low>0&&v.low--,v.hi=v.hi-F.CharOffs+1,v.hi>=0)){f.brush.style=vt;var I=f.brush.color;f.brush.color=at.DarkGray,f.fillRect(U.Create(s.left+e.GetDrawItemOffsetWidth(o,v.low),s.top,s.left+e.GetDrawItemOffsetWidth(o,v.hi),s.bottom)),f.brush.style=vt,f.brush.color=I}}}}if(lp.PROCSERIES&&!d.Print&&e.Items[n].isClass(wv)){var g=e.Items[n];g.MarkType==Pp.Beg?g.GetValue(Iv.SubType)==gv.Proc&&(n>0&&e.Items[n-1].isClass(wv)&&e.Items[n-1].GetValue(Iv.SubType)==gv.Proc&&lp.HCDrawArrow(f,lp.clMedGray,s.left-10,s.top,0),this.FEditProcInfo.BeginNo==n?lp.HCDrawArrow(f,at.Blue,s.left-10,s.top+12,1):lp.HCDrawArrow(f,lp.clMedGray,s.left-10,s.top+12,1)):g.GetValue(Iv.SubType)==gv.Proc&&(n<e.Items.count-1&&e.Items[n+1].isClass(wv)&&e.Items[n+1].GetValue(Iv.SubType)==gv.Proc&&lp.HCDrawArrow(f,lp.clMedGray,s.right+10,s.top+12,1),this.FEditProcInfo.EndNo==n?lp.HCDrawArrow(f,at.Blue,s.right+10,s.top,0):lp.HCDrawArrow(f,lp.clMedGray,s.right+10,s.top,0))}""!=this.FPageBlankTip&&e.isClass(SF)&&(o<e.DrawItems.count-1?e.Items[e.DrawItems[o+1].ItemNo].PageBreak&&this.DrawBlankTip_(a,s.top+s.height+e.GetLineBlankSpace(o),l,h,f):this.DrawBlankTip_(a,s.top+s.height+e.GetLineBlankSpace(o),l,h,f)),TI(UI(i.prototype),"DoSectionDrawItemPaintAfter",this).call(this,t,e,n,o,r,s,a,l,h,c,u,f,d)}},{key:"Search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=TI(UI(i.prototype),"Search",this).call(this,t,e,n);return lp.PROCSERIES&&this.CheckCaretProcInfo(),o}},{key:"Replace",value:function(t){var e=TI(UI(i.prototype),"Replace",this).call(this,t);return lp.PROCSERIES&&this.CheckCaretProcInfo(),e}},{key:"TraverseItem",value:function(t){if(0!=t.Areas.size)for(var e=0;e<=this.Sections.count-1;e++)t.Stop||(t.SectionIndex=e,t.Areas.has(dp.Header)&&this.Sections[e].Header.TraverseItem(t),!t.Stop&&t.Areas.has(dp.Page)&&this.Sections[e].Page.TraverseItem(t),!t.Stop&&t.Areas.has(dp.Footer)&&this.Sections[e].Footer.TraverseItem(t))}},{key:"InsertDeGroup",value:function(t){var e=this.InsertDomain(t);return lp.PROCSERIES&&this.CheckCaretProcInfo(),e}},{key:"DeleteDeGroup",value:function(t){var e=this;if(""==t)return!1;var i=this.GetDataDeGroupItemNo(this.ActiveSection.Page,t,!1,0,-1);if(i.endNo>0){var n=this.ActiveSection.DataAction(this.ActiveSection.Page,(function(){e.FIgnoreAcceptAction=!0;try{e.ActiveSection.Page.DeleteDomainByItemNo(i.startNo,i.endNo)}finally{e.FIgnoreAcceptAction=!1}return!0}));return lp.PROCSERIES&&this.CheckCaretProcInfo(),n}return!1}},{key:"GetDeGroupItemNo",value:function(t){for(var e,i=new Ql,n=0;n<this.Sections.count;n++)if(e=this.Sections[n].Page,this.GetDataDeGroupTree(t,e,0,e.Items.count-1,i),i.Childs.count>0)return{result:!0,sectionIndex:n,data:i.Childs[0].Data,startNo:i.Childs[0].BeginNo,endNo:i.Childs[0].EndNo};return{result:!1,sectionIndex:-1,data:null,startNo:-1,endNo:-1}}},{key:"GetCaretDeGroupProperty",value:function(t,e){var i=this.ActiveSectionTopLevelData(),n=i.ActiveDomain;return n.BeginNo<0?"":t==Iv.Propertys?"json"==e?lp.GetPropertyJSON(i.Items[n.BeginNo].Propertys):lp.GetPropertyString(i.Items[n.BeginNo].Propertys):i.Items[n.BeginNo].GetValue(t)}},{key:"SetCaretDeGroupProperty",value:function(t,e){var i=this.ActiveSectionTopLevelData(),n=i.ActiveDomain;return n.EndNo>0&&(t==Iv.Propertys?"object"==OI(e)?(lp.SetPropertyJSON(i.Items[n.BeginNo].Propertys,e),lp.SetPropertyJSON(i.Items[n.EndNo].Propertys,e)):(lp.SetPropertyString(i.Items[n.BeginNo].Propertys,e),lp.SetPropertyString(i.Items[n.EndNo].Propertys,e)):(i.Items[n.BeginNo].SetValue(t,e),i.Items[n.EndNo].SetValue(t,e)),!0)}},{key:"GetCaretDeGroupText",value:function(){var t=this.ActiveSectionTopLevelData(),e=t.ActiveDomain;return e.BeginNo<0?"":this.GetDataDeGroupText(t,e.BeginNo,e.EndNo)}},{key:"SetCaretDeGroupByText",value:function(t){var e=this.ActiveSectionTopLevelData().ActiveDomain;e.EndNo>0&&(this.SetDataDeGroupText(e.Data,e.BeginNo,e.EndNo,t),this.FormatSection(this.ActiveSectionIndex))}},{key:"GetCaretDeGroupStream",value:function(){var t=this.ActiveSectionTopLevelData(),e=t.ActiveDomain;if(e.BeginNo<0)return null;this.GetDataDeGroupToStream(t,e.BeginNo,e.EndNo)}},{key:"SetCaretDeGroupByStream",value:function(t){var e=this.ActiveSectionTopLevelData().ActiveDomain;e.EndNo>0&&this.SetDataDeGroupFromStream(e.Data,e.BeginNo,e.EndNo,t)}},{key:"SetDeGroupProperty",value:function(t,e,i){var n=this.GetDeGroupItemNo(t);if(!n.result)return!1;n.data.Items[n.startNo].SetValue(e,i),n.data.Items[n.endNo].SetValue(e,i)}},{key:"GetDeGroupProperty",value:function(t,e){var i=this.GetDeGroupItemNo(t);return i.result?i.data.Items[i.startNo].GetValue(e):""}},{key:"InsertDeItem",value:function(t){return this.InsertItem(t)}},{key:"NewDeItem",value:function(t){var e=new ES(t);return e.StyleNo=this.Style.GetStyleNo(this.Style.DefaultTextStyle,!0),e.ParaNo=this.CurParaNo,e}},{key:"GetDeItemText",value:function(t){return this.GetDeItemProperty(t,"Text")}},{key:"GetDeItemProperty",value:function(t,e,i){var n=!1,o=new $l;o.Areas.add(dp.Header),o.Areas.add(dp.Page),o.Areas.add(dp.Footer);var r,s="";return o.Process=function(o,a,l,h,c){if((r=o.Items[a]).StyleNo>cs.Null&&r.GetValue(aS)==t){if("Text"==e)s=r.Text;else if("AllocValue"==e)s=r.AllocValue?"1":"0";else{if(e==Iv.Propertys)return"json"==i?lp.GetPropertyJSON(r.Propertys):lp.GetPropertyString(r.Propertys);s=r.GetValue(e)}return n=!0,!0}if(r.StyleNo==cs.Image&&r.GetValue(aS)==t){if("Base64"==e||"Graphic"==e)r.Text;else{if(e==Iv.Propertys)return"json"==i?lp.GetPropertyJSON(r.Propertys):lp.GetPropertyString(r.Propertys);s=r.GetValue(e)}return n=!0,!0}if(r.StyleNo==cs.Combobox&&r.GetValue(aS)==t){if("Text"==e)s=r.Text;else if("ItemValue"==e)s=r.ItemValues[r.ItemIndex];else{if(e==Iv.Propertys)return"json"==i?lp.GetPropertyJSON(r.Propertys):lp.GetPropertyString(r.Propertys);s=r.GetValue(e)}return n=!0,!0}},this.TraverseItem(o),n?{result:n,text:s}:{result:!1,text:""}}},{key:"GetDeGroupDeItemText",value:function(t,e){return this.GetDeGroupItemNo(t).result?this.GetDeItemProperty(e,"Text"):{result:!1,text:""}}},{key:"GetDeGroupDeItemProperty",value:function(t,e,i){return this.GetDeGroupItemNo(t).result?this.GetDeItemProperty(e,i):{result:!1,text:""}}},{key:"GetDeObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=new $l;o.Tag=0;var r=function(e,i,n,o,r){if(e.Items[i].StyleNo>cs.Null){if(t(e,i))return!0}else switch(e.Items[i].StyleNo){case cs.Table:case cs.Image:case cs.Edit:case cs.Combobox:case cs.Button:case cs.CheckBox:case cs.RadioGroup:case cs.DateTimePicker:if(t(e,i))return!0}};if(o.Process=r,null==e)o.Areas.add(dp.Page),this.TraverseItem(o);else if(i>=0)for(var s=i;s<=n;s++)o.Stop=o.Process(e,s,o.Tag,o.DomainStack,o.Stop),o.Stop||e.Items[s].StyleNo<cs.Null&&e.Items[s].TraverseItem(o)}},{key:"GetItemByIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=null,r=null;return this.GetDeObject((function(e,i){return((r=e.Items[i]).StyleNo>cs.Null&&r.GetValue(aS)==t||r.StyleNo==cs.Table&&r.GetValue(aS)==t||r.StyleNo==cs.Image&&r.GetValue(aS)==t||r.StyleNo==cs.Edit&&r.GetValue(aS)==t||r.StyleNo==cs.Combobox&&r.GetValue(aS)==t||r.StyleNo==cs.Button&&r.GetValue(aS)==t||r.StyleNo==cs.CheckBox&&r.GetValue(aS)==t||r.StyleNo==cs.RadioGroup&&r.GetValue(aS)==t||r.StyleNo==cs.DateTimePicker&&r.GetValue(aS)==t)&&(o=r,!0)}),e,i,n),o}},{key:"SetDeImage",value:function(t,e){return this.SetDeObjectProperty(t,"Propertys",e)}},{key:"SyncDeItemAfterRef",value:function(t,e){var i,n=!1,o=!1,r=new $l;r.Tag=0,r.Areas.add(dp.Page),r.Process=function(t,r,s,a,l){i=t.Items[r],n?i.StyleNo>cs.Null&&i.GetValue(aS)==e.GetValue(aS)&&(i.Text=e.Text,i.AllocValue=!0,i.SetValue(mS,e.GetValue(mS)),o=!0):i==e&&(n=!0)},this.TraverseItem(r),o&&this.FormatData()}},{key:"FindSameDeItem",value:function(t){var e=null,i=new $l;return i.Tag=0,i.Areas.add(dp.Page),i.Process=function(i,n,o,r,s){if(i.Items[n].StyleNo>cs.Null){var a=i.Items[n];if(a.GetValue(aS)==t.GetValue(aS)&&a.AllocValue)return e=a,!0}return!1},this.TraverseItem(i),e}},{key:"SetDeItemText",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.SetDeObjectProperty(t,"Text",e,i)}},{key:"SetDataDeObjectProperty",value:function(t,e,i,n){var o=this,r=!1;if(e.StyleNo>cs.Null)if("Text"==i)""!=n&&(e.Text=n,e.AllocValue=!0,t.Change(),t.isClass($y)&&t.OnFormatDirty()),r=!0;else if("Propertys"==i)if("object"==OI(n))for(var s in n)"Text"==s?(""!=n[s]&&(e.Text=n[s],e.AllocValue=!0,t.Change(),t.isClass($y)&&t.OnFormatDirty()),r=!0):e.SetValue(s,n[s]);else{var a=new z;lp.SetPropertyString(n,a);for(var l=0;l<a.count;l++)"Text"==a[l].key?(""!=a[l].val&&(e.Text=a[l].val,e.AllocValue=!0,t.isClass($y)&&t.OnFormatDirty(),t.Change()),r=!0):e.SetValue(a[l].key,a[l].val)}else e.SetValue(i,n);else if(e.StyleNo==cs.Table||e.StyleNo==cs.CheckBox||e.StyleNo==cs.Edit||e.StyleNo==cs.Combobox||e.StyleNo==cs.DateTimePicker||e.StyleNo==cs.RadioGroup)if("Text"==i)e.StyleNo!=cs.CheckBox&&e.StyleNo!=cs.Edit&&e.StyleNo!=cs.Combobox||(e.Text=n,t.Change(),t.isClass($y)&&t.OnFormatDirty(),r=!0);else if("Propertys"==i)if("object"==OI(n))for(var h in n)e.SetValue(h,n[h]);else{var c=new z;lp.SetPropertyString(n,c);for(var u=0;u<c.count;u++)"Text"==c[u].key?e.StyleNo!=cs.CheckBox&&e.StyleNo!=cs.Edit&&e.StyleNo!=cs.Combobox||(e.Text=c[u].val,t.Change(),t.isClass($y)&&t.OnFormatDirty(),r=!0):e.SetValue(c[u].key,c[u].val)}else e.SetValue(i,n);else e.StyleNo==cs.Image&&("Text"==i||("Base64"==i||"Graphic"==i?(n.Base64?e.LoadFromBase64(n.Base64,"png",(function(){o.FormatData()})):e.LoadFromBase64(n,"png",(function(){o.FormatData()})),r=!0):"Propertys"==i?function(){var t=e.Width,i=e.Height,r=!1;for(var s in n)"Text"==s||("Width"==s?(t=n[s],e.Width=t):"Height"==s?(i=n[s],e.Height=i):"AutoSize"==s?r=n[s]:"CanResize"==s?e.CanResize=n[s]:"Base64"==s?e.LoadFromBase64(n[s],"png",(function(){r||(e.Width=t,e.Height=i),o.FormatData(),n.LoadedEvent&&n.LoadedEvent()})):e.SetValue(s,n[s]))}():e.SetValue(i,n)));return r}},{key:"SetActiveDeObjectProperty",value:function(t,e){var i=this.ActiveSectionTopLevelData();if(!i.CanEdit())return!1;var n=i.GetActiveItem();return this.SetDataDeObjectProperty(i,n,t,e)&&this.FormatData(),!0}},{key:"SetDeObjectProperty",value:function(t,e,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=!1,s=!1,a=null,l=null,h=new $l;h.Areas.add(dp.Page);var c=function(h,c,u,f,d){return a!==h&&(a=h,!h.CanEdit())||(l=h.Items[c],!(!(r=n.DeItemIndexMatch(l,t))||(s=n.SetDataDeObjectProperty(h,l,e,i),0!=o))||void 0)};if(h.Process=c,lp.PROCSERIES&&this.FProcCount>0){if(""==this.FEditProcIndex)return!1;h.SectionIndex=this.FEditProcInfo.SectionIndex;for(var u,f=this.Sections[this.FEditProcInfo.SectionIndex].Page,d=this.FEditProcInfo.BeginNo;d<=this.FEditProcInfo.EndNo&&!h.Stop;d++)f.Items[d].isClass(za)&&(za.IsBeginMark(f.Items[d])?(u=new Ql,f.GetDomainFrom(d,lp.OffsetAfter,u),h.DomainStack.push(u)):h.DomainStack.pop()),h.Stop=h.Process(f,d,h.Tag,h.domainStack,h.Stop),h.Stop||f.Items[d].StyleNo<cs.Null&&f.Items[d].TraverseItem(h)}else this.TraverseItem(h);return r&&s&&this.FormatData(),r}},{key:"SetSectionHeaderDeObjectProperty",value:function(t,e,i,n){var o=this,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(this.Sections[t].Header.ReadOnly)return!1;var s=!1,a=!1,l=null,h=new $l;h.Areas.add(dp.Header);var c=function(t,h,c,u,f){if(l=t.Items[h],(s=o.DeItemIndexMatch(l,e))&&(a=o.SetDataDeObjectProperty(t,l,i,n),0==r))return!0};return h.Process=c,this.Sections[t].Header.TraverseItem(h),s&&a&&this.FormatData(),s}},{key:"SetSectionFooterDeObjectProperty",value:function(t,e,i,n){var o=this,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(this.Sections[t].Footer.ReadOnly)return!1;var s=!1,a=!1,l=null,h=new $l;h.Areas.add(dp.Footer);var c=function(t,h,c,u,f){if(l=t.Items[h],(s=o.DeItemIndexMatch(l,e))&&(a=o.SetDataDeObjectProperty(t,l,i,n),0==r))return!0};return h.Process=c,this.Sections[t].Footer.TraverseItem(h),s&&a&&this.FormatData(),s}},{key:"DeleteDeObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=!1,n=null,o=null,r=new $l;r.Areas.add(dp.Page),0!=e&&(r.ReverseOrder=!0);var s=function(r,s,a,l,h){if(n!==r&&(n=r,r.DisSelect(),!r.CanEdit()))return!0;if((o=r.Items[s]).StyleNo>cs.Null&&o.Index==t){if(r.DeleteItemDirect(s),i=!0,0==e||1==e)return!0}else if((o.StyleNo==cs.Image||o.StyleNo==cs.Table||o.StyleNo==cs.CheckBox||o.StyleNo==cs.Edit||o.StyleNo==cs.Combobox||o.StyleNo==cs.DateTimePicker||o.StyleNo==cs.RadioGroup)&&o.GetValue(aS)==t&&(r.DeleteItemDirect(s),i=!0,0==e||1==e))return!0};if(r.Process=s,lp.PROCSERIES&&this.FProcCount>0){if(""==this.FEditProcIndex)return;r.SectionIndex=this.FEditProcInfo.SectionIndex;for(var a,l=this.Sections[this.FEditProcInfo.SectionIndex].Page,h=this.FEditProcInfo.BeginNo;h<=this.FEditProcInfo.EndNo&&!r.Stop;h++)l.Items[h].isClass(za)&&(za.IsBeginMark(l.Items[h])?(a=new Ql,l.GetDomainFrom(h,lp.OffsetAfter,a),r.DomainStack.push(a)):r.DomainStack.pop()),r.Stop=r.Process(l,h,r.Tag,r.domainStack,r.Stop),r.Stop||l.Items[h].StyleNo<cs.Null&&l.Items[h].TraverseItem(r)}else this.TraverseItem(r);i&&(this.FormatData(),this.ClearUndo())}},{key:"GetDataDeGroupTree",value:function(t,e,i,n,o){var r=new W;r.push(o);var s,a=new $l;a.Process=function(e,i,n,o,a){e.Items[i].StyleNo==cs.Domain&&e.Items[i].Index==t&&(za.IsBeginMark(e.Items[i])?((s=(s=r.peek()).AppendChild()).Data=e,s.BeginNo=i,r.push(s)):(s=r.pop()).EndNo=i)};for(var l=i;l<=n;l++)a.Process(e,l,a.Tag,a.DomainStack,a.Stop),a.Stop||e.Items[l].StyleNo<cs.Null&&e.Items[l].TraverseItem(a)}},{key:"ActiveTableInsertRowContentAfter",value:function(t){if(!t.Rows)return!1;if(0==t.Rows.length)return!1;var e=this.ActiveSection.Page.GetActiveItem();if(!e||e.StyleNo!=cs.Table)return!1;var i=!1,n=e.SelectCellRang.StartRow+1;this.FIgnoreAcceptAction=!0;try{i=this.ActiveTableInsertRowAfter(t.Rows.length);for(var o=0;o<t.Rows.length;o++)if(t.Rows[o].Cells)for(var r=0;r<t.Rows[o].Cells.length;r++)t.Rows[o].Cells[r].Text&&e.Rows[n+o][r].CellData&&(e.Rows[n+o][r].CellData.Items[0].Text=t.Rows[o].Cells[r].Text);this.ActiveSection.ReFormatActiveItem()}finally{this.FIgnoreAcceptAction=!1}return i}},{key:"GetProcDeGroupItemNo",value:function(t,e){var i=this.GetProcItemNo(t);if(!i.result)return{result:!1,sectionIndex:-1,data:null,startNo:-1,endNo:-1};var n=new Ql,o=this.Sections[i.sectionIndex].Page;return this.GetDataDeGroupTree(e,o,i.startNo,i.endNo,n),0==n.Childs.count?{result:!1,sectionIndex:-1,data:null,startNo:-1,endNo:-1}:{result:!0,sectionIndex:i.sectionIndex,data:n.Childs[0].Data,startNo:n.Childs[0].BeginNo,endNo:n.Childs[0].EndNo}}},{key:"GetProcDeGroupAsText",value:function(t,e){var i=this.GetProcDeGroupItemNo(t,e);return i.result?this.GetDataDeGroupText(i.data,i.startNo,i.endNo):""}},{key:"GetAllProcIndex",value:function(){for(var t,e=new Array,i=0;i<this.Sections.count;i++){t=this.Sections[i].Page;for(var n=0;n<t.Items.count;n++)t.Items[n].isClass(wv)&&t.Items[n].IsProcBegin&&e.push(t.Items[n].Index)}return e}},{key:"GetAllProcInfo",value:function(){for(var t,e=new Array,i=0;i<this.Sections.count;i++){t=this.Sections[i].Page;for(var n=0;n<t.Items.count;n++)if(t.Items[n].isClass(wv)&&t.Items[n].IsProcBegin){var o=new Array;o.push(t.Items[n].Index),t.Items[n].Changed?o.push(lp.GetPropertyString(t.Items[n].Propertys)+"Changed=1"):o.push(lp.GetPropertyString(t.Items[n].Propertys)),e.push(o)}}return e}},{key:"InsertProc",value:function(t,e,i){var n,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""==t)return or.returnFalseLog("InsertProc方法的procIndex参数为空");if(""!=i){var r=this.GetProcItemNo(i);if(!r.result)return or.returnFalseLog("InsertProc方法的未找到Index为"+i+"的病程!");r.sectionIndex!=this.ActiveSectionIndex&&(this.ActiveSectionIndex=r.sectionIndex),(n=this.ActiveSection.Page).SetSelectBound(r.startNo,0,r.startNo,0)}else(n=this.ActiveSectionTopLevelData()).SelectLastItemAfterWithCaret();var s=!1;if(n==this.ActiveSection.Page){var a=new wv(n);if(a.SetValue(aS,t),a.SetValue(Iv.SubType,gv.Proc),""!=e)for(var l,h=e.split(lp.sLineBreak),c=0;c<h.length;c++)""!=h[c]&&""!=(l=h[c].split("="))[0]&&a.SetValue(l[0],l[1]);this.FIgnoreAcceptAction=!0;try{n.IsEmptyData()||(o?this.InsertPageBreak():this.InsertBreak()),""!=i&&n.SetSelectBound(n.SelectInfo.StartItemNo-1,0,n.SelectInfo.StartItemNo-1,0),this.ApplyParaAlignHorz(dr),s=this.InsertDeGroup(a);var u=n.SelectInfo.StartItemNo;n.SetSelectBound(u,0,u,0)}finally{this.FIgnoreAcceptAction=!1}this.CheckCaretProcInfo(),this.UpdateView()}else console.log("只能在正文中插入病程!");return s}},{key:"DeleteProc",value:function(t){if(""==t)return!1;var e=this.GetProcItemNo(t);if(e.result){this.BeginUpdate();try{var i=!1;this.FIgnoreAcceptAction=!0;try{var n=this.Sections[e.sectionIndex].Page;i=this.Sections[e.sectionIndex].DataAction(n,(function(){return n.DeleteItems(e.startNo,e.endNo,!1),!0}))}finally{this.FIgnoreAcceptAction=!1}return this.ClearUndo(),this.CheckCaretProcInfo(),this.CheckEditProcInfo(),i}finally{this.EndUpdate()}}return!1}},{key:"GetProcInfoAt",value:function(t,e,i,n){t.GetDomainFrom(e,i,n,(function(t){return t.IsProc})),n.EndNo>0&&(n.Index=t.Items[n.BeginNo].GetValue(Iv.Index))}},{key:"SetProcDeGroupByStream",value:function(t,e,i){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.GetProcItemNo(t);if(r.result){var s=new Ql;if(this.GetDataDeGroupTree(e,this.Sections[r.sectionIndex].Page,r.startNo,r.endNo,s),0==s.Childs.count)return!1;var a=!1;return this.DataLoadLiteStream(i,(function(t,e){a=n.SetDeGroupTreeByStream(s,i,e,t,o)})),this.ClearUndo(),this.FormatSection(r.sectionIndex),lp.PROCSERIES&&this.CheckCaretProcInfo(),a}return r.result}},{key:"SetProcDeGroupByText",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=this.GetProcItemNo(t);if(o.result){var r=new Ql;if(this.GetDataDeGroupTree(e,this.Sections[o.sectionIndex].Page,o.startNo,o.endNo,r),0==r.Childs.count)return!1;this.SetDeGroupTreeByText(r,i,n),this.ClearUndo(),this.FormatSection(o.sectionIndex),lp.PROCSERIES&&this.CheckCaretProcInfo()}return o.result}},{key:"GetCaretProcProperty",value:function(t,e){if(this.FCaretProcInfo.EndNo>0){if(t==Iv.Index)return this.FCaretProcInfo.Index;var i=this.ActiveSection.Page.Items[this.FCaretProcInfo.BeginNo];return t==Iv.Propertys?"json"==e?lp.GetPropertyJSON(i.Propertys):lp.GetPropertyString(i.Propertys):i.GetValue(t)}return""}},{key:"GetProcProperty",value:function(t,e,i){var n=this.GetProcItemNo(t);if(n.result){var o=this.Sections[n.sectionIndex].Page.Items[n.startNo];if(e==Iv.Propertys){if("json"==i){if(o.Changed){var r=lp.GetPropertyJSON(o.Propertys);return r.Changed="1",r}return lp.GetPropertyJSON(o.Propertys)}return o.Changed?lp.GetPropertyString(o.Propertys)+"Changed=1":lp.GetPropertyString(o.Propertys)}return"Changed"==e?o.Changed?"1":"0":o.GetValue(e)}return""}},{key:"SetProcProperty",value:function(t,e,i){var n=this.GetProcItemNo(t);if(n.result){var o=this.Sections[n.sectionIndex].Page.Items[n.startNo],r=this.Sections[n.sectionIndex].Page.Items[n.endNo];if(""!=e&&""!=i)o.SetValue(e,i),r.SetValue(e,i);else if(e==Iv.Propertys){var s,a=new z;lp.SetPropertyString(i,a);for(var l=0;l<a.count;l++)""!=(s=a[l]).key&&""!=s.val&&(o.SetValue(s.key,s.val),r.SetValue(s.key,s.val))}return!0}return!1}},{key:"GetProcAsText",value:function(t){var e=this.GetProcItemNo(t);return e.result?e.endNo==e.startNo+1?{result:!0,text:""}:{result:!0,text:this.GetDataDeGroupText(this.Sections[e.sectionIndex].Page,e.startNo,e.endNo)}:{result:!1,text:""}}},{key:"SetProcByText",value:function(t,e){if(this.CanNotEdit())return!1;var i=this.GetProcItemNo(t);if(i.result){this.BeginUpdate();try{this.UndoGroupBegin();try{var n=this.Sections[i.sectionIndex];n.Page.SetSelectBound(i.startNo,lp.OffsetAfter,i.endNo,lp.OffsetBefor),this.FIgnoreAcceptAction=!0;try{n.InsertText(e)}finally{this.FIgnoreAcceptAction=!1}return this.CheckCaretProcInfo(),!0}finally{this.UndoGroupEnd()}}finally{this.EndUpdate()}}return!1}},{key:"GetProcAsStream",value:function(t,e){var i=this,n=this.GetProcItemNo(t);return!!n.result&&(this.DataSaveLiteStream(e,(function(){var t=i.Sections[n.sectionIndex],o=t.Page.Items[n.startNo].ParaFirst;o||(t.Page.Items[n.startNo].ParaFirst=!0);try{t.Page.SaveItemToStream(e,n.startNo+1,0,n.endNo-1,t.Page.GetItemOffsetAfter(n.endNo-1))}finally{o||(t.Page.Items[n.startNo].ParaFirst=!1)}})),!0)}},{key:"SetProcByStream",value:function(t,e){var i=this;if(this.CanNotEdit())return!1;var n=this.GetProcItemNo(t);return!!n.result&&(this.DataLoadLiteStream(e,(function(t,o){i.BeginUpdate();try{i.UndoGroupBegin();try{var r=i.Sections[n.sectionIndex];r.Page.SetSelectBound(n.startNo,lp.OffsetAfter,n.endNo,lp.OffsetBefor),i.FIgnoreAcceptAction=!0;try{i.Style.States.Include(Ip.DomainWholeReplace);try{r.InsertStream(e,o,t)}finally{i.Style.States.Exclude(Ip.DomainWholeReplace)}}finally{i.FIgnoreAcceptAction=!1}}finally{i.UndoGroupEnd()}}finally{i.EndUpdate()}})),this.CheckCaretProcInfo(),!0)}},{key:"SetProcByFileSteam",value:function(t,e){if(this.CanNotEdit())return!1;var i=this.GetProcItemNo(t);if(i.result){this.ActiveSectionIndex!=i.sectionIndex&&(this.ActiveSectionIndex=i.sectionIndex),this.Sections[i.sectionIndex].Page.SetSelectBound(i.startNo,lp.OffsetAfter,i.endNo,lp.OffsetBefor),this.FIgnoreAcceptAction=!0;try{this.Style.States.Include(Ip.DomainWholeReplace);try{this.InsertStream(e)}finally{this.Style.States.Exclude(Ip.DomainWholeReplace)}}finally{this.FIgnoreAcceptAction=!1}return this.CheckCaretProcInfo(),!0}return!1}},{key:"ScrollToProc",value:function(t){if(""==t)return!1;var e=-1,i=-1;if(t==this.FEditProcIndex)e=this.FEditProcInfo.BeginNo,i=this.FEditProcInfo.SectionIndex;else{var n=this.GetProcItemNo(t);e=n.startNo,i=n.sectionIndex}if(e>=0){var o=this.Sections[i].Page,r=o.DrawItems[o.Items[e].FirstDItemNo].rect.top;return r=this.Sections[i].PageDataFormtToFilmCoord(r),r+=this.GetSectionTopFilm(i),this.VScrollBar.position=r,o.ItemSetCaretRequest(e,lp.OffsetAfter),!0}return!1}},{key:"ScrollToItem",value:function(t){var e=-1,i=-1,n=new $l;return n.Areas.add(dp.Page),n.Process=function(o,r,s,a,l){if(o.Items[r]===t)return e=o.GetDrawItemFormatTop(o.Items[r].FirstDItemNo),i=n.SectionIndex,!0},this.TraverseItem(n),e>=0&&(e=this.Sections[i].PageDataFormtToFilmCoord(e),e+=this.GetSectionTopFilm(i),this.VScrollBar.position=e,!0)}},{key:"DeleteAllProcMark",value:function(){var t=this.ActiveSection.Page;this.BeginUpdate();try{t.BeginFormat();try{for(var e,i=t.Items.count-1;i>=0;i--)t.Items[i].StyleNo==cs.Domain&&(e=t.Items[i]).IsProc&&(e.IsProcEnd||i<t.Items.count-1&&(t.Items[i+1].ParaFirst=!0),t.Items.delete(i))}finally{t.EndFormat(!1)}this.FormatData()}finally{this.EndUpdate()}}},{key:"SetEditProcIndex",value:function(t){this.FEditProcIndex!=t&&(this.FEditProcIndex=t,this.CheckEditProcInfo(),this.ClearUndo(),this.UpdateView())}},{key:"GetProcItemNo",value:function(t){for(var e,i=!1,n=-1,o=-1,r=-1,s=0;s<this.Sections.count&&!(n>=0);s++){e=this.Sections[s].Page;for(var a=0;a<e.Items.count;a++)if(e.Items[a].isClass(wv)&&e.Items[a].GetValue(aS)==t){n=s,o=a;break}}return o>=0&&(i=(r=e.GetDomainAnother(o))>=0),{sectionIndex:n,startNo:o,endNo:r,result:i}}},{key:"CheckCaretProcInfo",value:function(){this.GetSectionCaretProcInfo(this.ActiveSectionIndex,this.FCaretProcInfo),this.FCaretProcInfo.Index==this.FEditProcIndex&&this.FEditProcInfo.Assign(this.FCaretProcInfo)}},{key:"CheckEditProcInfo",value:function(){this.FEditProcInfo.Clear();var t=this.GetProcItemNo(this.FEditProcIndex);t.endNo>0&&(this.ActiveSectionIndex!=t.sectionIndex&&(this.ActiveSectionIndex=t.sectionIndex),this.FEditProcInfo.SectionIndex=t.sectionIndex,this.FEditProcInfo.Data=this.Sections[t.sectionIndex].Page,this.FEditProcInfo.BeginNo=t.startNo,this.FEditProcInfo.EndNo=t.endNo,this.FEditProcInfo.Index=this.FEditProcIndex)}},{key:"GetSectionCaretProcInfo",value:function(t,e){var i=this.Sections[t].Page;this.GetProcInfoAt(i,i.SelectInfo.StartItemNo,i.SelectInfo.StartItemOffset,e),e.SectionIndex=t}},{key:"SetActiveItemExtra",value:function(t){var e=this;this.DataLoadLiteStream(t,(function(i,n){e.BeginUpdate();try{e.UndoGroupBegin();try{var o=e.ActiveSectionTopLevelData();e.DeleteActiveDataItems(o.SelectInfo.StartItemNo),e.ActiveSection.InsertStream(t,n,i)}finally{e.UndoGroupEnd()}}finally{e.EndUpdate()}}))}},{key:"SetActiveTableRowReadOnly",value:function(t){var e=this.ActiveSection.ActiveData.GetActiveRectItem();if(null!=e&&e.StyleNo==cs.Table){var i=e.GetEditCellWith();i.row>=0&&e.SetRowReadOnly(i.row,t)}}},{key:"SetActiveTableCellReadOnly",value:function(t){var e=this.ActiveSection.ActiveData.GetActiveRectItem();if(null!=e&&e.StyleNo==cs.Table){var i=e.GetEditCellWith();i.row>=0&&e.SetCellReadOnly(i.row,i.col,t)}}},{key:"CheckDeGroupStart",value:function(t,e,i){var n=!1;if(t.Items[e].isClass(wv)){var o=t.Items[e];n=o.MarkType==Pp.Beg&&o.GetValue(aS)==i}return n}},{key:"CheckDeGroupEnd",value:function(t,e,i){var n=!1;if(t.Items[e].isClass(wv)){var o=t.Items[e];n=o.MarkType==Pp.End&&o.GetValue(aS)==i}return n}},{key:"GetDataDeGroupItemNo",value:function(t,e,i,n,o){o=-1;var r=-1,s=-1;if(n<0&&(n=0),i){for(var a=n;a>=0;a--)if(this.CheckDeGroupEnd(t,a,e)){s=a;break}if(s>=0)for(var l=s-1;l>=0;l--)if(this.CheckDeGroupStart(t,l,e)){r=l;break}}else{for(var h=n;h<t.Items.count;h++)if(this.CheckDeGroupStart(t,h,e)){r=h;break}if(r>=0)for(var c=r+1;c<t.Items.count;c++)if(this.CheckDeGroupEnd(t,c,e)){s=c;break}}return r>=0&&s>=0?(n=r,o=s):n=-1,{startNo:n,endNo:o}}},{key:"GetDataDeGroupText",value:function(t,e,i){for(var n="",o=e+1;o<i;o++)t.Items[o].Visible&&(null==t.OnSaveItem||t.OnSaveItem(t,o))&&(t.Items[o].StyleNo>cs.Null&&t.Items[o].TraceStyles.has(sS.Del)||(t.Items[o].ParaFirst?n=n+lp.sLineBreak+t.Items[o].Text:n+=t.Items[o].Text));return n}},{key:"GetDeGroupAsText",value:function(t){var e=this.GetDeGroupItemNo(t);return e.endNo>0?this.GetDataDeGroupText(e.data,e.startNo,e.endNo):""}},{key:"GetDeGroupAsStream",value:function(t){var e=this.GetDeGroupItemNo(t);return e.result?this.GetDataDeGroupToStream(e.data,e.startNo,e.endNo):null}},{key:"GetDataForwardDeGroupText",value:function(t,e){var i="",n=e,o=-1,r=t.Items[e].GetValue(aS),s=this.GetDataDeGroupItemNo(t,r,!0,n,o);return n=s.startNo,(o=s.endNo)>0&&(i=this.GetDataDeGroupText(t,n,o)),i}},{key:"SetDeGroupTreeByText",value:function(t,e,i){if(0==t.Childs.count)return!1;this.FIgnoreAcceptAction=!0;try{this.Style.States.Include(Ip.DomainWholeReplace);try{var n;if(0==i)(n=t.Childs[0]).Data.DisSelect(),n.Data.SetSelectBound(n.BeginNo,lp.OffsetAfter,n.EndNo,lp.OffsetBefor),n.Data.InsertText(e);else if(1==i)(n=t.Childs.last).Data.DisSelect(),n.Data.SetSelectBound(n.BeginNo,lp.OffsetAfter,n.EndNo,lp.OffsetBefor),n.Data.InsertText(e);else for(var o=t.Childs.count-1;o>=0;o--)(n=t.Childs[o]).Data.DisSelect(),n.Data.SetSelectBound(n.BeginNo,lp.OffsetAfter,n.EndNo,lp.OffsetBefor),n.Data.InsertText(e)}finally{this.Style.States.Exclude(Ip.DomainWholeReplace)}}finally{this.FIgnoreAcceptAction=!1}return!0}},{key:"SetDeGroupTreeByStream",value:function(t,e,i,n,o){if(0==t.Childs.count)return!1;this.FIgnoreAcceptAction=!0;try{this.Style.States.Include(Ip.DomainWholeReplace);try{var r;if(0==o)(r=t.Childs[0]).Data.DisSelect(),r.Data.SetSelectBound(r.BeginNo,lp.OffsetAfter,r.EndNo,lp.OffsetBefor),r.Data.InsertStream(e,i,n);else if(1==o)(r=t.Childs.last).Data.DisSelect(),r.Data.SetSelectBound(r.BeginNo,lp.OffsetAfter,r.EndNo,lp.OffsetBefor),r.Data.InsertStream(e,i,n);else for(var s=e.position,a=t.Childs.count-1;a>=0;a--)e.position=s,(r=t.Childs[a]).Data.DisSelect(),r.Data.SetSelectBound(r.BeginNo,lp.OffsetAfter,r.EndNo,lp.OffsetBefor),r.Data.InsertStream(e,i,n)}finally{this.Style.States.Exclude(Ip.DomainWholeReplace)}}finally{this.FIgnoreAcceptAction=!1}return!0}},{key:"SetDataDeGroupText",value:function(t,e,i,n){var o=-1,r=i;i<0&&(r=t.GetDomainAnother(e)),r>e?o=e:(o=r,r=e),t.DisSelect(),t.SetSelectBound(o,lp.OffsetAfter,r,lp.OffsetBefor),this.FIgnoreAcceptAction=!0;try{""!=n?t.InsertText(n):t.DeleteSelected()}finally{this.FIgnoreAcceptAction=!1}lp.PROCSERIES&&this.CheckCaretProcInfo()}},{key:"SetDeGroupByText",value:function(t,e,i,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=null;switch(e){case dp.Header:r=this.Sections[t].Header;break;case dp.Page:r=this.Sections[t].Page;break;case dp.Footer:r=this.Sections[t].Footer}var s=0,a=r.Items.count-1;if(lp.PROCSERIES&&this.FProcCount>0){if(""==this.FEditProcIndex)return;s=this.FEditProcInfo.BeginNo,a=this.FEditProcInfo.EndNo}var l=new Ql;this.GetDataDeGroupTree(i,r,s,a,l),0!=l.Childs.count&&(this.SetDeGroupTreeByText(l,n,o),this.ClearUndo(),this.FormatSection(t),lp.PROCSERIES&&this.CheckCaretProcInfo())}},{key:"SetActiveSectionDeGroupByStream",value:function(t,e,i){this.SetDeGroupByStream(this.ActiveSectionIndex,dp.Page,t,e,i)}},{key:"SetDeGroupByStream",value:function(t,e,i,n){var o=this,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=null;switch(e){case dp.Header:s=this.Sections[t].Header;break;case dp.Page:s=this.Sections[t].Page;break;case dp.Footer:s=this.Sections[t].Footer}var a=0,l=s.Items.count-1;if(lp.PROCSERIES&&this.FProcCount>0){if(""==this.FEditProcIndex)return;a=this.FEditProcInfo.BeginNo,l=this.FEditProcInfo.EndNo}var h=new Ql;this.GetDataDeGroupTree(i,s,a,l,h),0!=h.Childs.count&&(this.DataLoadLiteStream(n,(function(t,e){o.SetDeGroupTreeByStream(h,n,e,t,r)})),this.ClearUndo(),this.FormatSection(t),lp.PROCSERIES&&this.CheckCaretProcInfo())}},{key:"SetCaretToPageDeGroupStart",value:function(t){return this.SetCaretToDeGroupStart(t)}},{key:"SetCaretToDeGroupStart",value:function(t){var e=this.GetDeGroupItemNo(t);return e.result&&(e.data.ItemSetCaretRequest(e.startNo,lp.OffsetAfter),lp.PROCSERIES&&this.CheckCaretProcInfo()),e.result}},{key:"SetDeGroupByFileStream",value:function(t,e,i,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=new AI;r.LoadFromStream(n);var s=new K;lp._SaveFileFormatAndVersion(s),r.Style.SaveToStream(s),r.ActiveSection.Page.SaveItemToStream(s,0,0,r.ActiveSection.Page.Items.count-1,r.ActiveSection.Page.GetItemOffsetAfter(r.ActiveSection.Page.Items.count-1)),s.position=0,this.SetDeGroupByStream(t,e,i,s,o)}},{key:"GetDataDeGroupToStream",value:function(t,e,i){var n=new K;return this.DataSaveLiteStream(n,(function(){t.SaveItemToStream(n,e+1,0,i-1,t.Items[i-1].Length)})),n}},{key:"SetDataDeGroupFromStream",value:function(t,e,i,n){var o=this;this.DataLoadLiteStream(n,(function(r,s){o.FIgnoreAcceptAction=!0;try{o.BeginUpdate();try{t.BeginFormat();try{i-e>1?(t.DisSelect(),t.DeleteItems(e+1,i-1,!1)):t.SetSelectBound(e,lp.OffsetAfter,e,lp.OffsetAfter),t.InsertStream(n,s,r),t.isClass($y)&&t.OnFormatDirty()}finally{t.EndFormat(!1)}o.ClearUndo(),o.FormatData()}finally{o.EndUpdate()}}finally{o.FIgnoreAcceptAction=!1}})),lp.PROCSERIES&&this.CheckCaretProcInfo()}},{key:"SaveSelectToText",value:function(){return this.ActiveSectionTopLevelData().SaveSelectToText()}},{key:"SaveSelectToStream",value:function(t){var e=this;this.DataSaveLiteStream(t,(function(){e.Style.States.Include(Ip.Copying);try{e.ActiveSectionTopLevelData().SaveSelectToStream(t)}finally{e.Style.States.Exclude(Ip.Copying)}}))}},{key:"SaveToLiteStream",value:function(t){var e=this;this.DataSaveLiteStream(t,(function(){e.Style.States.Include(Ip.Copying);try{var i=e.ActiveSection.Page;i.SaveItemToStream(t,0,0,i.Items.count-1,i.GetItemOffsetAfter(i.Items.count-1))}finally{e.Style.States.Exclude(Ip.Copying)}}))}},{key:"SaveToStreamNoTrace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;or.emrCommon.G_SaveTrace=!1;try{this.SaveToStream(t,e,i)}finally{or.emrCommon.G_SaveTrace=!0}}},{key:"RemoveTrace",value:function(){var t=this,e=new $l;e.ReverseOrder=!0,e.Areas.add(dp.Page),e.Areas.add(dp.Header),e.Areas.add(dp.Footer),e.Process=function(e,i,n,o,r){if(e.Items[i].StyleNo>cs.Null){var s=e.Items[i];0!=s.TraceStyles.value&&(t.TraceInfoAnnotate&&t.AnnotatePre.RemoveDataAnnotate(null),s.TraceStyles.has(sS.Add)?(s.Reset(),s.DeleteProperty(vS),s.DeleteProperty(IS),s.DeleteProperty(pS),s.TraceStyles.value=0):s.TraceStyles.has(sS.Del)&&(1==e.Items.count&&0==i?(s.Reset(),s.DeleteProperty(SS),s.DeleteProperty(FS),s.DeleteProperty(pS),s.TraceStyles.value=0):e.Items.delete(i)))}else e.Items[i].isClass(al)&&e.Items[i].FormatDirty()},this.TraverseItem(e),this.ClearUndo(),this.FormatData()}},{key:"AcceptTrace",value:function(t,e){var i=this,n=null,o=new $l;if(o.ReverseOrder=!0,o.Areas.add(dp.Page),o.Areas.add(dp.Header),o.Areas.add(dp.Footer),o.Process=function(t,e,o,r,s){t.Items[e].StyleNo>cs.Null?0!=(n=t.Items[e]).TraceStyles.value&&(!0,i.TraceInfoAnnotate&&i.AnnotatePre.RemoveDataAnnotate(null),n.TraceStyles.has(sS.Add)?(n.DeleteProperty(vS),n.DeleteProperty(IS),n.DeleteProperty(pS),n.TraceStyles.value=0):n.TraceStyles.has(sS.Del)&&(1==t.Items.count&&0==e?(n.DeleteProperty(SS),n.DeleteProperty(FS),n.DeleteProperty(pS),n.TraceStyles.value=0):t.Items.delete(e))):t.Items[e].isClass(al)&&t.Items[e].FormatDirty()},lp.PROCSERIES&&this.FProcCount>0){if(""==this.FEditProcIndex)return;o.SectionIndex=this.FEditProcInfo.SectionIndex;for(var r=this.Sections[this.FEditProcInfo.SectionIndex].Page,s=this.FEditProcInfo.BeginNo;s<=this.FEditProcInfo.EndNo;s++)o.Stop=o.Process(r,s,o.Tag,o.domainStack,o.Stop),o.Stop||r.Items[s].StyleNo<cs.Null&&r.Items[s].TraverseItem(o)}else this.TraverseItem(o)}},{key:"SyntaxCheck",value:function(){var t=this;if(null!=this.OnSyntaxCheck){var e=new $l;e.Tag=0,e.Areas.add(dp.Page),e.Process=function(e,i,n,o,r){t.DoSyntaxCheck(e,i,n,o)},this.TraverseItem(e),this.UpdateView()}}},{key:"LoadFromStream",value:function(t){try{TI(UI(i.prototype),"LoadFromStream",this).call(this,t)}catch(t){alert("HCEmrView加载错误:"+t.message)}}},{key:"DesignModeEx",get:function(){return this.FDesignMode},set:function(t){this.FDesignMode=t}},{key:"HideTrace",get:function(){return this.FHideTrace},set:function(t){this.SetHideTrace(t)}},{key:"Trace",get:function(){return this.FTrace},set:function(t){this.FTrace=t}},{key:"TraceCount",get:function(){return this.FTraceCount}},{key:"ProcCount",get:function(){return this.FProcCount}},{key:"EditProcIndex",get:function(){return this.FEditProcIndex},set:function(t){this.SetEditProcIndex(t)}},{key:"ShowProcSplit",get:function(){return this.FShowProcSplit},set:function(t){this.FShowProcSplit=t}},{key:"UnEditProcBKColor",get:function(){return this.FUnEditProcBKColor},set:function(t){this.FUnEditProcBKColor=t}},{key:"PageBlankTip",get:function(){return this.FPageBlankTip},set:function(t){this.SetPageBlankTip(t)}},{key:"DeDoneColor",get:function(){return this.FDeDoneColor},set:function(t){this.FDeDoneColor=t}},{key:"DeUnDoneColor",get:function(){return this.FDeUnDoneColor},set:function(t){this.FDeUnDoneColor=t}},{key:"DeHotColor",get:function(){return this.FDeHotColor},set:function(t){this.FDeHotColor=t}},{key:"IgnoreAcceptAction",get:function(){return this.FIgnoreAcceptAction},set:function(t){this.FIgnoreAcceptAction=t}}]),i}(cI);function zI(t){return(zI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jI(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function XI(t,e){return(XI=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function KI(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=JI(t);if(e){var o=JI(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return YI(this,i)}}function YI(t,e){return!e||"object"!==zI(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function JI(t){return(JI=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ZI=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&XI(t,e)}(r,t);var e,i,n,o=KI(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,410,340)).caption="页面设置";var e=new en("纸张");e.left=23,e.top=21,e.width=30,t.cbbPaper=new Cn(""),t.cbbPaper.left=53,t.cbbPaper.top=16,t.cbbPaper.width=100,t.cbbPaper.static=!0,t.cbbPaper.onSelectedIndexChange=function(){var e=lp.GetPaperSizeByName(t.cbbPaper.text);if(e==kp.Custom)t.edtWidth.readOnly=!1,t.edtHeight.readOnly=!1;else{var i=lp.GetPaperSizeInfo(e);t.edtWidth.text=i.Width.toString(),t.edtHeight.text=i.Height.toString(),t.edtWidth.readOnly=!0,t.edtHeight.readOnly=!0}},t.cbbPaper.addItem("自定义"),t.cbbPaper.addItem("A3"),t.cbbPaper.addItem("A4"),t.cbbPaper.addItem("A5"),t.cbbPaper.addItem("B5"),t.cbbPaper.addItem("16K"),t.cbbPaper.itemIndex=-1;var i=new en("宽(毫米)");i.left=170,i.top=21,i.width=52,t.edtWidth=new pn,t.edtWidth.valueMask=mn,t.edtWidth.left=224,t.edtWidth.top=16,t.edtWidth.width=50;var n=new en("高(毫米)");n.left=287,n.top=21,n.width=52,t.edtHeight=new pn,t.edtHeight.valueMask=mn,t.edtHeight.left=340,t.edtHeight.top=16,t.edtHeight.width=50;var s=new en("边距(毫米)");s.left=23,s.top=48,s.width=72,t.chkSymmetryMargin=new un("对称边距显示"),t.chkSymmetryMargin.left=96,t.chkSymmetryMargin.top=47,t.chkSymmetryMargin.width=97,t.addControl(t.chkSymmetryMargin);var a=new en("上(毫米)");a.left=43,a.top=79,a.width=52,t.edtTop=new pn,t.edtTop.valueMask=mn,t.edtTop.left=100,t.edtTop.top=76,t.edtTop.width=50;var l=new en("下(毫米)");l.left=170,l.top=79,l.width=52,t.edtBottom=new pn,t.edtBottom.valueMask=mn,t.edtBottom.left=227,t.edtBottom.top=76,t.edtBottom.width=50;var h=new en("左(毫米)");h.left=43,h.top=109,h.width=52,t.edtLeft=new pn,t.edtLeft.valueMask=mn,t.edtLeft.left=100,t.edtLeft.top=106,t.edtLeft.width=50;var c=new en("右(毫米)");c.left=170,c.top=109,c.width=52,t.edtRight=new pn,t.edtRight.valueMask=mn,t.edtRight.left=227,t.edtRight.top=106,t.edtRight.width=50;var u=new en("方向");u.left=23,u.top=146,u.width=30,t.cbbPaperOrientation=new Cn(""),t.cbbPaperOrientation.left=53,t.cbbPaperOrientation.top=143,t.cbbPaperOrientation.width=100,t.cbbPaperOrientation.static=!0,t.cbbPaperOrientation.addItem("纵向"),t.cbbPaperOrientation.addItem("横向"),t.cbbPaperOrientation.itemIndex=0,t.chkPageNoVisible=new un("显示页码"),t.chkPageNoVisible.left=23,t.chkPageNoVisible.top=183;var f=new en("页码格式");f.left=125,f.top=186,f.width=52,t.cbbPageNoFmt=new Cn(""),t.cbbPageNoFmt.left=180,t.cbbPageNoFmt.top=183,t.cbbPageNoFmt.width=125,t.cbbPageNoFmt.dropDownWidth=t.cbbPageNoFmt.width,t.cbbPageNoFmt.addItem("{0}/{1}"),t.cbbPageNoFmt.addItem("{0}"),t.cbbPageNoFmt.addItem("第{0}页/共{1}页"),t.cbbPageNoFmt.addItem("第{0}页"),t.chkShowLineNo=new un("显示行号"),t.chkShowLineNo.left=23,t.chkShowLineNo.top=210,t.chkShowUnderLine=new un("显示下划线"),t.chkShowUnderLine.left=23,t.chkShowUnderLine.top=238,t.chkParaLastMark=new un("显示换行符"),t.chkParaLastMark.left=125,t.chkParaLastMark.top=210,t.chkShowLineActiveMark=new un("显示当前编辑行指示符"),t.chkShowLineActiveMark.left=125,t.chkShowLineActiveMark.top=238,t.btnOk=new nn("确定"),t.btnOk.onClick=function(){t.modalResult=no,t.close()},t.btnOk.left=Math.trunc((t.width-t.btnOk.width)/2),t.btnOk.top=t.clientArea.height-30,t.beginUpdate();try{t.addControl(e),t.addControl(t.cbbPaper),t.addControl(i),t.addControl(t.edtWidth),t.addControl(n),t.addControl(t.edtHeight),t.addControl(s),t.addControl(a),t.addControl(t.edtTop),t.addControl(l),t.addControl(t.edtBottom),t.addControl(h),t.addControl(t.edtLeft),t.addControl(c),t.addControl(t.edtRight),t.addControl(u),t.addControl(t.cbbPaperOrientation),t.addControl(t.chkPageNoVisible),t.addControl(f),t.addControl(t.cbbPageNoFmt),t.addControl(t.chkShowUnderLine),t.addControl(t.chkShowLineNo),t.addControl(t.chkParaLastMark),t.addControl(t.chkShowLineActiveMark),t.addControl(t.btnOk)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetView",value:function(t){var e=this;this.beginUpdate();try{this.cbbPaper.itemIndex=this.cbbPaper.itemIndexOf(lp.GetPaperSizeName(t.ActiveSection.PaperSize)),this.cbbPaper.itemIndex<0&&(this.cbbPaper.itemIndex=0),t.ActiveSection.PaperOrientation==hp?(this.cbbPaperOrientation.itemIndex=0,this.edtWidth.text=C.stringFormatFloat(1,t.ActiveSection.PaperWidth),this.edtHeight.text=C.stringFormatFloat(1,t.ActiveSection.PaperHeight)):(this.cbbPaperOrientation.itemIndex=1,this.edtWidth.text=C.stringFormatFloat(1,t.ActiveSection.PaperHeight),this.edtHeight.text=C.stringFormatFloat(1,t.ActiveSection.PaperWidth)),this.edtTop.text=C.stringFormatFloat(1,t.ActiveSection.PaperMarginTop),this.edtLeft.text=C.stringFormatFloat(1,t.ActiveSection.PaperMarginLeft),this.edtRight.text=C.stringFormatFloat(1,t.ActiveSection.PaperMarginRight),this.edtBottom.text=C.stringFormatFloat(1,t.ActiveSection.PaperMarginBottom),this.cbbPageNoFmt.text=t.PageNoFormat,this.chkSymmetryMargin.checked=t.ActiveSection.SymmetryMargin,this.chkPageNoVisible.checked=t.ActiveSection.PageNoVisible,this.chkParaLastMark.checked=t.Style.ShowParaLastMark,this.chkShowLineNo.checked=t.ShowLineNo,this.chkShowLineActiveMark.checked=t.ShowLineActiveMark,this.chkShowUnderLine.checked=t.ShowUnderLine,this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){t.BeginUpdate();try{var i=lp.GetPaperSizeByName(e.cbbPaper.text);if(t.ActiveSection.PaperSize=i,0==e.cbbPaperOrientation.itemIndex?t.ActiveSection.PaperOrientation=hp:t.ActiveSection.PaperOrientation=cp,i==kp.Custom)0==e.cbbPaperOrientation.itemIndex?(t.ActiveSection.PaperWidth=parseFloat(e.edtWidth.text),t.ActiveSection.PaperHeight=parseFloat(e.edtHeight.text)):(t.ActiveSection.PaperWidth=parseFloat(e.edtHeight.text),t.ActiveSection.PaperHeight=parseFloat(e.edtWidth.text));else{var n=lp.GetPaperSizeInfo(i);0==e.cbbPaperOrientation.itemIndex?(t.ActiveSection.PaperWidth=n.Width,t.ActiveSection.PaperHeight=n.Height):(t.ActiveSection.PaperWidth=n.Height,t.ActiveSection.PaperHeight=n.Width)}t.ActiveSection.PaperMarginTop=parseFloat(e.edtTop.text),t.ActiveSection.PaperMarginLeft=parseFloat(e.edtLeft.text),t.ActiveSection.PaperMarginRight=parseFloat(e.edtRight.text),t.ActiveSection.PaperMarginBottom=parseFloat(e.edtBottom.text),t.PageNoFormat=e.cbbPageNoFmt.text,t.ActiveSection.SymmetryMargin=e.chkSymmetryMargin.checked,t.ActiveSection.PageNoVisible=e.chkPageNoVisible.checked,t.Style.ShowParaLastMark=e.chkParaLastMark.checked,t.ShowLineNo=e.chkShowLineNo.checked,t.ShowLineActiveMark=e.chkShowLineActiveMark.checked,t.ShowUnderLine=e.chkShowUnderLine.checked,t.ResetActiveSectionMargin()}finally{t.EndUpdate()}}))}}])&&jI(e.prototype,i),n&&jI(e,n),r}(ro);function qI(t){return(qI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function QI(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $I(t,e){return($I=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function tg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=ig(t);if(e){var o=ig(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return eg(this,i)}}function eg(t,e){return!e||"object"!==qI(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ig(t){return(ig=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ng=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$I(t,e)}(r,t);var e,i,n,o=tg(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,320,240)).caption="段落属性设置",t.FLineSapceMinChanged=!1;var e=new en("行间距");e.left=28,e.top=16,e.width=40,t.cbbSpaceMode=new Cn(""),t.cbbSpaceMode.static=!0,t.cbbSpaceMode.left=70,t.cbbSpaceMode.top=13,t.cbbSpaceMode.width=77,t.cbbSpaceMode.addItem("单倍"),t.cbbSpaceMode.addItem("1.15倍"),t.cbbSpaceMode.addItem("1.5倍"),t.cbbSpaceMode.addItem("2倍"),t.cbbSpaceMode.addItem("最小值"),t.cbbSpaceMode.addItem("固定值"),t.cbbSpaceMode.addItem("多倍"),t.cbbSpaceMode.onSelectedIndexChange=function(){t._spaceModeChange()},t.edtLineSpace=new dn("10"),t.edtLineSpace.left=168,t.edtLineSpace.top=13,t.edtLineSpace.width=88,t.lblUnit=new en("磅"),t.lblUnit.left=262,t.lblUnit.top=16,t.lblUnit.width=12;var i=new en("水平对齐");i.left=16,i.top=43,i.width=52,t.cbbAlignHorz=new Cn(""),t.cbbAlignHorz.static=!0,t.cbbAlignHorz.left=70,t.cbbAlignHorz.top=40,t.cbbAlignHorz.width=77,t.cbbAlignHorz.addItem("左"),t.cbbAlignHorz.addItem("居中"),t.cbbAlignHorz.addItem("右"),t.cbbAlignHorz.addItem("两端"),t.cbbAlignHorz.addItem("分散");var n=new en("垂直对齐");n.left=165,n.top=43,n.width=52,t.cbbAlignVert=new Cn(""),t.cbbAlignVert.static=!0,t.cbbAlignVert.left=219,t.cbbAlignVert.top=40,t.cbbAlignVert.width=67,t.cbbAlignVert.addItem("上"),t.cbbAlignVert.addItem("居中"),t.cbbAlignVert.addItem("下");var s=new en("首行缩进");s.left=16,s.top=70,s.width=52,t.edtFirstIndent=new pn("8"),t.edtFirstIndent.valueMask=yn,t.edtFirstIndent.left=70,t.edtFirstIndent.top=67,t.edtFirstIndent.width=40;var a=new en("毫米");a.left=116,a.top=70,a.width=24;var l=new en("左缩进");l.left=28,l.top=97,l.width=40,t.edtLeftIndent=new pn("10"),t.edtLeftIndent.valueMask=yn,t.edtLeftIndent.left=70,t.edtLeftIndent.top=94,t.edtLeftIndent.width=40;var h=new en("毫米");h.left=116,h.top=97,h.width=24;var c=new en("右缩进");c.left=165,c.top=97,c.width=40,t.edtRightIndent=new pn("10"),t.edtRightIndent.valueMask=yn,t.edtRightIndent.left=207,t.edtRightIndent.top=94,t.edtRightIndent.width=40;var u=new en("毫米");u.left=253,u.top=97,u.width=24;var f=new en("全文非文本对象最小行间距(pix)");f.left=16,f.top=124,f.width=175,t.edtLineSpaceMin=new pn("8"),t.edtLineSpaceMin.valueMask=mn,t.edtLineSpaceMin.left=182,t.edtLineSpaceMin.top=120,t.edtLineSpaceMin.width=40,t.edtLineSpaceMin.onChange=function(){t.FLineSapceMinChanged=!0},t.chkBreakRough=new un("直观换行(换行时不判断相同类型字符同时换行)"),t.chkBreakRough.left=16,t.chkBreakRough.top=150,t.btnOk=new nn("确定"),t.btnOk.onClick=function(){t.modalResult=no,t.close()},t.btnOk.left=Math.trunc((t.width-t.btnOk.width)/2),t.btnOk.top=t.clientArea.height-30,t.beginUpdate();try{t.addControl(e),t.addControl(t.cbbSpaceMode),t.addControl(t.edtLineSpace),t.addControl(t.lblUnit),t.addControl(i),t.addControl(t.cbbAlignHorz),t.addControl(n),t.addControl(t.cbbAlignVert),t.addControl(s),t.addControl(t.edtFirstIndent),t.addControl(a),t.addControl(l),t.addControl(t.edtLeftIndent),t.addControl(h),t.addControl(c),t.addControl(t.edtRightIndent),t.addControl(u),t.addControl(t.chkBreakRough),t.addControl(f),t.addControl(t.edtLineSpaceMin),t.addControl(t.btnOk)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"_spaceModeChange",value:function(){5==this.cbbSpaceMode.itemIndex?(this.edtLineSpace.text="12",this.edtLineSpace.visible=!0,this.lblUnit.text="磅",this.lblUnit.visible=!0):6==this.cbbSpaceMode.itemIndex?(this.edtLineSpace.text="3",this.edtLineSpace.visible=!0,this.lblUnit.text="倍",this.lblUnit.visible=!0):(this.edtLineSpace.text="",this.edtLineSpace.visible=!1,this.lblUnit.visible=!1)}},{key:"SetView",value:function(t){var e=this;this.beginUpdate();try{switch(this.cbbSpaceMode.itemIndex=parseInt(t.Style.ParaStyles[t.CurParaNo].LineSpaceMode),this._spaceModeChange(),t.Style.ParaStyles[t.CurParaNo].LineSpaceMode){case gr.PLSFix:case gr.PLSMult:this.edtLineSpace.text=C.stringFormatFloat(1,t.Style.ParaStyles[t.CurParaNo].LineSpace)}this.cbbAlignHorz.itemIndex=parseInt(t.Style.ParaStyles[t.CurParaNo].AlignHorz),this.cbbAlignVert.itemIndex=parseInt(t.Style.ParaStyles[t.CurParaNo].AlignVert),this.edtFirstIndent.text=C.stringFormatFloat(1,t.Style.ParaStyles[t.CurParaNo].FirstIndent),this.edtLeftIndent.text=C.stringFormatFloat(1,t.Style.ParaStyles[t.CurParaNo].LeftIndent),this.edtRightIndent.text=C.stringFormatFloat(1,t.Style.ParaStyles[t.CurParaNo].RightIndent),this.edtLineSpaceMin.text=t.Style.LineSpaceMin.toString(),this.chkBreakRough.checked=t.Style.ParaStyles[t.CurParaNo].BreakRough,this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){t.BeginUpdate();try{var i=12;e.cbbSpaceMode.itemIndex>4&&(i=or.system.parseFloatDef(e.edtLineSpace.text,0)),t.ApplyParaLineSpace(e.cbbSpaceMode.itemIndex,i),t.ApplyParaAlignHorz(e.cbbAlignHorz.itemIndex),t.ApplyParaAlignVert(e.cbbAlignVert.itemIndex),t.ApplyParaFirstIndent(or.system.parseFloatDef(e.edtFirstIndent.text,0)),t.ApplyParaLeftIndent(or.system.parseFloatDef(e.edtLeftIndent.text,0)),t.ApplyParaRightIndent(or.system.parseFloatDef(e.edtRightIndent.text,0)),t.ApplyParaBreakRough(e.chkBreakRough.checked),e.FLineSapceMinChanged&&(t.Style.LineSpaceMin=e.edtLineSpaceMin.number,t.FormatData())}finally{t.EndUpdate()}}))}}])&&QI(e.prototype,i),n&&QI(e,n),r}(ro);function og(t){return(og="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sg(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ag(t,e){return(ag=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function lg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=cg(t);if(e){var o=cg(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return hg(this,i)}}function hg(t,e){return!e||"object"!==og(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function cg(t){return(cg=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ug=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ag(t,e)}(r,t);var e,i,n,o=lg(r);function r(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:320,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:246;rg(this,r),(t=o.call(this,e,i)).caption="属性",t.gridProperty=new Mn(1,2),t.gridProperty.marginLeft=5,t.gridProperty.marginRight=5,t.gridProperty.height=180,t.gridProperty.align=Xt,t.gridProperty.fixRowCount=1,t.gridProperty.rows[0][0].value="键",t.gridProperty.rows[0][1].value="值",t.gridProperty.setColWidth(0,100),t.gridProperty.setColWidth(1,180),t.pnlButton=new hn,t.pnlButton.height=40,t.pnlButton.borderVisible=!1,t.pnlButton.align=Xt;var n=new en("第一列为空时无效");n.left=2,n.top=10,n.font.color=at.OrangeRed,t.pnlButton.addControl(n);var s=new nn("新增行");s.left=n.right+5,s.top=5,s.width=55,s.onClick=function(){t.gridProperty.rowCount++,t.gridProperty.rows.last[0].value="",t.gridProperty.rows.last[1].value=""},t.pnlButton.addControl(s);var a=new nn("删除行");a.left=s.right+10,a.top=s.top,a.width=55,a.onClick=function(){t.gridProperty.deleteRow(t.gridProperty.row)},t.pnlButton.addControl(a);var l=new nn("保存");l.left=a.right+20,l.top=a.top,l.width=55,l.onClick=function(){t.modalResult=no,t.close()},t.pnlButton.addControl(l),t.beginUpdate();try{t.addControl(t.pnlButton),t.addControl(t.gridProperty),t.moveCenter()}finally{t.endUpdate()}return t}return e=r,(i=[{key:"getPropertys",value:function(t){this.gridProperty.rowCount=t.count+1;for(var e=1;e<=t.count;e++)this.gridProperty.rows[e][0].value=t[e-1].key,this.gridProperty.rows[e][1].value=t[e-1].val}},{key:"setPropertys",value:function(t){var e;t.clear();for(var i=1;i<this.gridProperty.rowCount;i++)""!=(e=lp.HCDeleteBreak(this.gridProperty.rows[i][0].value).trim())&&t.add(e,lp.HCDeleteBreak(this.gridProperty.rows[i][1].value))}}])&&sg(e.prototype,i),n&&sg(e,n),r}(ro);function fg(t){return(fg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dg(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function mg(t,e){return(mg=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function yg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Sg(t);if(e){var o=Sg(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return pg(this,i)}}function pg(t,e){return!e||"object"!==fg(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Sg(t){return(Sg=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var vg=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mg(t,e)}(r,t);var e,i,n,o=yg(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,360,440)).caption="DeRadioGroup属性",t.gridProperty.height=100,t.gridProperty.align=zt,t.pnlButton.align=zt,t.pnlProp=new hn,t.pnlProp.height=90,t.pnlProp.borderVisible=!1,t.pnlProp.align=zt,t.chkAutoSize=new un("自动计算宽高"),t.chkAutoSize.left=23,t.chkAutoSize.top=11,t.chkAutoSize.onSwitch=function(){t.edtWidth.enabled=!t.chkAutoSize.checked,t.edtHeight.enabled=!t.chkAutoSize.checked},t.pnlProp.addControl(t.chkAutoSize);var e=new en("宽(像素)");e.left=131,e.top=13,t.pnlProp.addControl(e),t.edtWidth=new pn,t.edtWidth.left=e.right+5,t.edtWidth.top=10,t.edtWidth.width=32,t.pnlProp.addControl(t.edtWidth);var i=new en("高(像素)");i.left=233,i.top=13,t.pnlProp.addControl(i),t.edtHeight=new pn,t.edtHeight.left=i.right+5,t.edtHeight.top=10,t.edtHeight.width=32,t.pnlProp.addControl(t.edtHeight);var n=new en("RadioItem样式");n.left=23,n.top=44,t.pnlProp.addControl(n),t.cbbStyle=new Cn(""),t.cbbStyle.static=!0,t.cbbStyle.left=115,t.cbbStyle.top=40,t.cbbStyle.width=88,t.cbbStyle.addItem("RadioButton"),t.cbbStyle.addItem("CheckBox"),t.pnlProp.addControl(t.cbbStyle),t.chkMulSelect=new un("多选"),t.chkMulSelect.left=209,t.chkMulSelect.top=42,t.pnlProp.addControl(t.chkMulSelect),t.chkDeleteAllow=new un("允许删除"),t.chkDeleteAllow.left=261,t.chkDeleteAllow.top=42,t.pnlProp.addControl(t.chkDeleteAllow);var s=new en("列");s.left=24,s.top=71,t.pnlProp.addControl(s),t.edtColumn=new pn,t.edtColumn.left=41,t.edtColumn.top=68,t.edtColumn.width=48,t.pnlProp.addControl(t.edtColumn),t.chkColumeAlign=new un("列自动对齐"),t.chkColumeAlign.left=t.cbbStyle.left,t.chkColumeAlign.top=70,t.pnlProp.addControl(t.chkColumeAlign),t.chkItemHit=new un("点击文本切换选中"),t.chkItemHit.left=209,t.chkItemHit.top=70,t.pnlProp.addControl(t.chkItemHit),t.gridItem=new Mn(1,2),t.gridItem.marginLeft=5,t.gridItem.marginRight=5,t.gridItem.height=130,t.gridItem.align=Kt,t.gridItem.fixRowCount=1,t.gridItem.rows[0][0].value="选项",t.gridItem.rows[0][1].value="选项值(可为空)",t.gridItem.setColWidth(0,100),t.gridItem.setColWidth(1,180),t.pnlItemButton=new hn,t.pnlItemButton.height=40,t.pnlItemButton.borderVisible=!1,t.pnlItemButton.align=Xt;var a=new nn("新增选项");a.left=5,a.top=5,a.width=60,a.onClick=function(){t.gridItem.rowCount++,t.gridItem.rows.last[0].value="",t.gridItem.rows.last[1].value=""},t.pnlItemButton.addControl(a);var l=new nn("删除选项");l.left=a.right+10,l.top=a.top,l.width=60,l.onClick=function(){t.gridItem.deleteRow(t.gridItem.row)},t.pnlItemButton.addControl(l);var h=new nn("保存");h.left=l.right+20,h.top=l.top,h.width=55,h.onClick=function(){t.modalResult=no,t.close()},t.pnlItemButton.addControl(h),t.beginUpdate();try{var c=[t.clientArea.controls[t.clientArea.controls.length-1],t.clientArea.controls[t.clientArea.controls.length-2]];t.clientArea.controls[t.clientArea.controls.length-2]=c[0],t.clientArea.controls[t.clientArea.controls.length-1]=c[1],t.clientArea.controls.insert(0,t.pnlProp),t.addControl(t.gridItem),t.addControl(t.pnlItemButton)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetView",value:function(t,e){var i=this;this.beginUpdate();try{this.chkAutoSize.checked=e.AutoSize,this.edtWidth.enabled=!this.chkAutoSize.checked,this.edtHeight.enabled=!this.chkAutoSize.checked,this.edtWidth.text=e.Width.toString(),this.edtHeight.text=e.Height.toString(),e.RadioStyle==jd?this.cbbStyle.itemIndex=0:this.cbbStyle.itemIndex=1,this.chkMulSelect.checked=e.MultSelect,this.chkDeleteAllow.checked=e.DeleteAllow,this.edtColumn.text=e.Columns.toString(),this.chkColumeAlign.checked=e.ColumnAlign,this.chkItemHit.checked=e.ItemHit,this.getPropertys(e.Propertys),this.gridItem.rowCount=e.Items.count+1;for(var n=1;n<=e.Items.count;n++)this.gridItem.rows[n][0].value=e.Items[n-1].Text,this.gridItem.rows[n][1].value=e.Items[n-1].TextValue;this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){e.AutoSize=i.chkAutoSize.checked,i.chkAutoSize.checked||(e.Width=or.system.parseIntDef(i.edtWidth.text,e.Width),e.Height=or.system.parseIntDef(i.edtHeight.text,e.Height)),0==i.cbbStyle.itemIndex?e.RadioStyle=jd:e.RadioStyle=Xd,e.MultSelect=i.chkMulSelect.checked,e.DeleteAllow=i.chkDeleteAllow.checked,e.ItemHit=i.chkItemHit.checked,e.BeginAdd();try{e.Columns=or.system.parseIntDef(i.edtColumn.text,e.Columns),e.ColumnAlign=i.chkColumeAlign.checked}finally{e.EndAdd()}i.setPropertys(e.Propertys),e.Items.clear();for(var n="",o=1;o<i.gridItem.rowCount;o++)""!=(n=lp.HCDeleteBreak(i.gridItem.rows[o][0].value).trim())&&e.AddItem(n,lp.HCDeleteBreak(i.gridItem.rows[o][1].value));t.BeginUpdate();try{t.ActiveSection.ReFormatActiveItem()}finally{t.EndUpdate()}}))}}])&&dg(e.prototype,i),n&&dg(e,n),r}(ug);function Fg(t){return(Fg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ig(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function gg(t,e){return(gg=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=kg(t);if(e){var o=kg(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Cg(this,i)}}function Cg(t,e){return!e||"object"!==Fg(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function kg(t){return(kg=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Pg=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&gg(t,e)}(r,t);var e,i,n,o=wg(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,or.width,or.height)).ProcIndex="",t.SectionIndex=-1,t.beginUpdate();try{t.caption="打印方式:",t.btnClose.text="关闭打印预览",t.chkPrintHideUnAlloc=new un("隐藏未填写的数据元"),t.chkPrintHideUnAlloc.onSwitch=function(){t.DoLoadFromView()},t.chkPrintHideUnAlloc.align=Wt,t.captionBar.addControl(t.chkPrintHideUnAlloc),t.captionBar.addSpliter(),t.captionBar.addButton("打印").onClick=function(){null!=t.OnPrint&&t.OnPrint(t.FEmrView)},t.captionBar.addButton("当前页").onClick=function(){null!=t.OnPrintCurPage&&t.OnPrintCurPage(t.FEmrView)},t.captionBar.addButton("奇数页").onClick=function(){null!=t.OnPrintOdd&&t.OnPrintOdd(t.FEmrView)},t.captionBar.addButton("偶数页").onClick=function(){null!=t.OnPrintEven&&t.OnPrintEven(t.FEmrView)},t.captionBar.addButton("当前行-当前页").onClick=function(){null!=t.OnPrintCurLine&&t.OnPrintCurLine(t.FEmrView)},t.captionBar.addButton("当前行-最后页").onClick=function(){null!=t.OnPrintCurLine&&t.OnPrintCurLine(t.FEmrView,t.FEmrView.PageCount)},t.FEmrView=new WI,t.FEmrView.DesignModeEx=!1,t.FEmrView.OnSectionPaintPaperBefor=function(t,e,i,n,o){n.brush.color=at.White,n.fillRect(i)},t.FEmrView.align=Kt,t.addControl(t.FEmrView)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"DoSectionItemInsert",value:function(t,e,i){i.isClass(ES)&&i.IsElement&&(i.AllocValue||(i.Visible=!1))}},{key:"DoLoadFromView",value:function(){this.FEmrView.BeginUpdate();try{this.FEmrView.ReadOnly=!1,this.FEmrView.Clear(),this.FEmrView.PrintHideUnAllocValue=this.chkPrintHideUnAlloc.checked,this.chkPrintHideUnAlloc.checked?this.FEmrView.OnSectionInsertItem=this.DoSectionItemInsert:this.FEmrView.OnSectionInsertItem=null;var t=new K;this.SectionIndex>=0&&""!=this.ProcIndex?(this.FEmrView.PrintProcIndex=this.ProcIndex,this.FFromView.ActiveSection.Header.SaveToStream(t),t.position=0,this.FEmrView.ActiveSection.Header.LoadFromStream(t,this.FFromView.Style,lp.HC_FileVersionInt),t.clear(),this.FFromView.ActiveSection.Footer.SaveToStream(t),t.position=0,this.FEmrView.ActiveSection.Footer.LoadFromStream(t,this.FFromView.Style,lp.HC_FileVersionInt),this.FEmrView.ActiveSection.AssignPaper(this.FFromView.Sections[this.SectionIndex]),t.clear(),this.FFromView.GetProcAsStream(this.ProcIndex,t),t.position=0,this.FEmrView.InsertLiteStream(t)):(this.FEmrView.PrintProcIndex="",this.FFromView.SaveToStream(t),t.position=0,this.FEmrView.LoadFromStream(t)),t=null,this.FEmrView.PrintView=!0,this.FEmrView.HideTrace=!0,this.FEmrView.ReadOnly=!0}finally{this.FEmrView.EndUpdate()}}},{key:"SetView",value:function(t,e,i){this.SectionIndex=e,this.ProcIndex=i,this.FFromView=t,this.DoLoadFromView(),this.showModal((function(){}))}}])&&Ig(e.prototype,i),n&&Ig(e,n),r}(ro);function Dg(t){return(Dg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bg(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Rg(t,e){return(Rg=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Ag(t);if(e){var o=Ag(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return xg(this,i)}}function xg(t,e){return!e||"object"!==Dg(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ag(t){return(Ag=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Tg=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Rg(t,e)}(r,t);var e,i,n,o=_g(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,320,310)).caption="DeItem数据元属性",t.chkCanEdit=new un("允许修改内容"),t.chkCanEdit.left=5,t.chkCanEdit.top=10,t.chkAllocOnly=new un("修改时整体赋值不允许部分修改"),t.chkAllocOnly.left=t.chkCanEdit.right+5,t.chkAllocOnly.top=10,t.chkCanCopy=new un("允许复制"),t.chkCanCopy.left=5,t.chkCanCopy.top=t.chkCanEdit.bottom+5,t.chkDeleteAllow=new un("允许删除"),t.chkDeleteAllow.left=t.chkCanCopy.right+5,t.chkDeleteAllow.top=t.chkCanCopy.top,t.chkAllocValue=new un("已填值"),t.chkAllocValue.left=t.chkDeleteAllow.right+5,t.chkAllocValue.top=t.chkDeleteAllow.top,t.gridProperty=new Mn(1,2),t.gridProperty.fixRowCount=1,t.gridProperty.rows[0][0].value="键",t.gridProperty.rows[0][1].value="值",t.gridProperty.setColWidth(0,100),t.gridProperty.setColWidth(1,180),t.gridProperty.left=5,t.gridProperty.top=t.chkDeleteAllow.bottom+5,t.gridProperty.width=t.width-10,t.gridProperty.height=190;var e=new nn("新增行");e.left=t.gridProperty.left,e.top=t.gridProperty.bottom+15,e.onClick=function(){t.gridProperty.rowCount++,t.gridProperty.rows.last[0].value="",t.gridProperty.rows.last[1].value=""};var i=new nn("删除行");i.left=e.right+10,i.top=e.top,i.onClick=function(){t.gridProperty.deleteRow(t.gridProperty.row)};var n=new nn("保存");n.left=i.right+20,n.top=i.top,n.onClick=function(){t.modalResult=no,t.close()},t.beginUpdate();try{t.addControl(t.chkCanEdit),t.addControl(t.chkCanCopy),t.addControl(t.chkDeleteAllow),t.addControl(t.chkAllocValue),t.addControl(t.chkAllocOnly),t.addControl(t.gridProperty),t.addControl(e),t.addControl(i),t.addControl(n),t.moveCenter()}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetView",value:function(t){var e=this,i=t.ActiveSectionTopLevelData().GetActiveItem();this.beginUpdate();try{this.gridProperty.rowCount=i.Propertys.count+1;for(var n=1;n<=i.Propertys.count;n++)this.gridProperty.rows[n][0].value=i.Propertys[n-1].key,this.gridProperty.rows[n][1].value=i.Propertys[n-1].val;this.chkCanEdit.checked=!i.EditProtect,this.chkCanCopy.checked=!i.CopyProtect,this.chkDeleteAllow.checked=i.DeleteAllow,this.chkAllocValue.checked=i.AllocValue,this.chkAllocOnly.checked=i.AllocOnly}finally{this.endUpdate()}this.showModal((function(){t.BeginUpdate();try{var n;i.Propertys.clear();for(var o=1;o<e.gridProperty.rowCount;o++)""!=(n=lp.HCDeleteBreak(e.gridProperty.rows[o][0].value).trim())&&i.Propertys.add(n,lp.HCDeleteBreak(e.gridProperty.rows[o][1].value));i.EditProtect=!e.chkCanEdit.checked,i.CopyProtect=!e.chkCanCopy.checked,i.DeleteAllow=e.chkDeleteAllow.checked,i.AllocValue=e.chkAllocValue.checked,i.AllocOnly=e.chkAllocOnly.checked}finally{t.EndUpdate()}}))}}])&&bg(e.prototype,i),n&&bg(e,n),r}(ro);function Og(t){return(Og="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ng(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Bg(t,e){return(Bg=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Eg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Lg(t);if(e){var o=Lg(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Mg(this,i)}}function Mg(t,e){return!e||"object"!==Og(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Lg(t){return(Lg=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Gg=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Bg(t,e)}(r,t);var e,i,n,o=Eg(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,260,160)).caption="横线属性";var e=new en("宽");e.left=34,e.top=10,t.edtWidth=new pn,t.edtWidth.left=e.right+5,t.edtWidth.top=e.top-4,t.edtWidth.width=64;var i=new en("高");i.left=t.edtWidth.right+30,i.top=e.top,t.edtHeight=new pn,t.edtHeight.left=i.right+5,t.edtHeight.top=i.top-4,t.edtHeight.width=64;var n=new en("线高");n.left=20,n.top=t.edtHeight.bottom+10,t.edtLineHeight=new pn,t.edtLineHeight.left=t.edtWidth.left,t.edtLineHeight.top=n.top-4,t.edtLineHeight.width=64;var s=new en("样式");s.left=134,s.top=n.top,t.cbbLineStyle=new Cn,t.cbbLineStyle.left=t.edtHeight.left,t.cbbLineStyle.top=s.top-4,t.cbbLineStyle.width=64,t.cbbLineStyle.static=!0,t.cbbLineStyle.addItem("实线"),t.cbbLineStyle.addItem("虚线"),t.cbbLineStyle.addItem("点线");var a=new nn("确定");a.onClick=function(){t.edtLineHeight.number>t.edtHeight.number?or.showMessage("线高度必需小于等于高度!"):(t.modalResult=no,t.close())},a.left=Math.trunc((t.width-a.width)/2),a.top=t.clientArea.height-30,t.beginUpdate();try{t.addControl(e),t.addControl(t.edtWidth),t.addControl(i),t.addControl(t.edtHeight),t.addControl(n),t.addControl(t.edtLineHeight),t.addControl(s),t.addControl(t.cbbLineStyle),t.addControl(a)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetView",value:function(t){var e=this,i=t.ActiveSectionTopLevelData().GetActiveItem();this.beginUpdate();try{switch(this.edtWidth.text=i.Width,this.edtHeight.text=i.Height,this.edtLineHeight.text=i.LineHeight,i.LineStyle){case pt.Solid:this.cbbLineStyle.itemIndex=0;break;case pt.Dash:this.cbbLineStyle.itemIndex=1;break;case pt.Dot:this.cbbLineStyle.itemIndex=2;break;case pt.DashDot:this.cbbLineStyle.itemIndex=3;break;case pt.DashDotDot:this.cbbLineStyle.itemIndex=4;break;default:this.cbbLineStyle.itemIndex=0}this.cbbLineStyle.itemIndex=i.LineStyle,this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){t.BeginUpdate();try{switch(i.Width=or.system.parseIntDef(e.edtWidth.text,i.Width),i.Height=or.system.parseIntDef(e.edtHeight.text,i.Height),i.LineHeight=or.system.parseIntDef(e.edtLineHeight.text,i.LineHeight),e.cbbLineStyle.itemIndex){case 0:i.LineStyle=pt.Solid;break;case 1:i.LineStyle=pt.Dash;break;case 2:i.LineStyle=pt.Dot;break;case 3:i.LineStyle=pt.DashDot;break;case 4:i.LineStyle=pt.DashDotDot;break;default:i.LineStyle=pt.Solid}t.ActiveSection.ReFormatActiveItem()}finally{t.EndUpdate()}}))}}])&&Ng(e.prototype,i),n&&Ng(e,n),r}(ro);function Hg(t){return(Hg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ug(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Vg(t,e){return(Vg=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Wg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=jg(t);if(e){var o=jg(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return zg(this,i)}}function zg(t,e){return!e||"object"!==Hg(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function jg(t){return(jg=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Xg=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Vg(t,e)}(r,t);var e,i,n,o=Wg(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,360,350)).caption="DeEdit属性",t.chkAutoSize=new un("自动计算宽高"),t.chkAutoSize.left=23,t.chkAutoSize.top=11,t.chkAutoSize.onSwitch=function(){t.edtWidth.enabled=!t.chkAutoSize.checked,t.edtHeight.enabled=!t.chkAutoSize.checked};var e=new en("宽(像素)");e.left=131,e.top=13,t.edtWidth=new pn,t.edtWidth.left=e.right+5,t.edtWidth.top=10,t.edtWidth.width=32;var i=new en("高(像素)");i.left=233,i.top=13,t.edtHeight=new pn,t.edtHeight.left=i.right+5,t.edtHeight.top=10,t.edtHeight.width=32;var n=new en("边框");n.left=t.chkAutoSize.left,n.top=t.edtWidth.bottom+6,t.chkBorderTop=new un("上"),t.chkBorderTop.left=n.right+10,t.chkBorderTop.top=t.edtWidth.bottom+5,t.chkBorderBottom=new un("下"),t.chkBorderBottom.left=t.chkBorderTop.right+10,t.chkBorderBottom.top=t.chkBorderTop.top,t.chkBorderLeft=new un("左"),t.chkBorderLeft.left=t.chkBorderBottom.right+10,t.chkBorderLeft.top=t.chkBorderBottom.top,t.chkBorderRight=new un("右"),t.chkBorderRight.left=t.chkBorderLeft.right+10,t.chkBorderRight.top=t.chkBorderLeft.top,t.edtText=new vn("文本",""),t.edtText.left=n.left-5,t.edtText.top=t.chkBorderRight.bottom+5,t.edtText.width=200,t.chkDeleteAllow=new un("允许删除"),t.chkDeleteAllow.left=t.chkAutoSize.left,t.chkDeleteAllow.top=t.edtText.bottom+5,t.chkPrintOnlyText=new un("打印时仅打印文本不打印边框"),t.chkPrintOnlyText.left=t.chkDeleteAllow.right+10,t.chkPrintOnlyText.top=t.chkDeleteAllow.top,t.beginUpdate();try{t.addControl(t.chkAutoSize),t.addControl(e),t.addControl(t.edtWidth),t.addControl(i),t.addControl(t.edtHeight),t.addControl(n),t.addControl(t.chkBorderTop),t.addControl(t.chkBorderBottom),t.addControl(t.chkBorderLeft),t.addControl(t.chkBorderRight),t.addControl(t.edtText),t.addControl(t.chkDeleteAllow),t.addControl(t.chkPrintOnlyText)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetView",value:function(t,e){var i=this;this.beginUpdate();try{""!=e.GetValue(hS)&&(this.caption+="["+e.GetValue(hS)+"]"),this.chkAutoSize.checked=e.AutoSize,this.edtWidth.enabled=!this.chkAutoSize.checked,this.edtHeight.enabled=!this.chkAutoSize.checked,this.edtWidth.text=e.Width.toString(),this.edtHeight.text=e.Height.toString(),this.edtText.text=e.Text,this.chkPrintOnlyText.checked=e.PrintOnlyText,this.chkDeleteAllow.checked=e.DeleteAllow,this.chkBorderLeft.checked=e.BorderSides.has(fp.Left),this.chkBorderTop.checked=e.BorderSides.has(fp.Top),this.chkBorderRight.checked=e.BorderSides.has(fp.Right),this.chkBorderBottom.checked=e.BorderSides.has(fp.Bottom),this.getPropertys(e.Propertys),this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){e.AutoSize=i.chkAutoSize.checked,i.chkAutoSize.checked||(e.Width=or.system.parseIntDef(i.edtWidth.text,e.width),e.Height=or.system.parseIntDef(i.edtHeight.text,e.Height)),e.Text=i.edtText.text,i.chkBorderLeft.checked?e.BorderSides.add(fp.Left):e.BorderSides.remove(fp.Left),i.chkBorderTop.checked?e.BorderSides.add(fp.Top):e.BorderSides.remove(fp.Top),i.chkBorderRight.checked?e.BorderSides.add(fp.Right):e.BorderSides.remove(fp.Right),i.chkBorderBottom.checked?e.BorderSides.add(fp.Bottom):e.BorderSides.remove(fp.Bottom),e.PrintOnlyText=i.chkPrintOnlyText.checked,e.DeleteAllow=i.chkDeleteAllow.checked,i.setPropertys(e.Propertys),t.BeginUpdate();try{t.ActiveSection.ReFormatActiveItem()}finally{t.EndUpdate()}}))}}])&&Ug(e.prototype,i),n&&Ug(e,n),r}(ug);function Kg(t){return(Kg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yg(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Jg(t,e){return(Jg=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Zg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Qg(t);if(e){var o=Qg(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return qg(this,i)}}function qg(t,e){return!e||"object"!==Kg(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Qg(t){return(Qg=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jg(t,e)}(r,t);var e,i,n,o=Zg(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,250,180)).caption="边框及背景",t.FTableItem=null;var e=new en("应用于");e.left=10,e.top=10,t.cbbRang=new Cn(""),t.cbbRang.addItem("单元格"),t.cbbRang.addItem("整个表格"),t.cbbRang.itemIndex=0,t.cbbRang.static=!0,t.cbbRang.left=e.right+5,t.cbbRang.top=8;var i=new en("边框");i.left=t.cbbRang.left,i.top=t.cbbRang.bottom+8,t.chkLeft=new un("左"),t.chkLeft.left=i.right+5,t.chkLeft.top=i.top-3,t.chkTop=new un("上"),t.chkTop.left=t.chkLeft.right+10,t.chkTop.top=t.chkLeft.top,t.chkRight=new un("右"),t.chkRight.left=t.chkTop.right+10,t.chkRight.top=t.chkLeft.top,t.chkBottom=new un("下"),t.chkBottom.left=t.chkRight.right+10,t.chkBottom.top=t.chkLeft.top,t.chkLTRB=new un("左上-右下斜线"),t.chkLTRB.left=t.chkLeft.left,t.chkLTRB.top=t.chkLeft.bottom+5,t.chkRTLB=new un("右上-左下斜线"),t.chkRTLB.left=t.chkLTRB.left,t.chkRTLB.top=t.chkLTRB.bottom+5;var n=new en("背景色");n.left=i.right-n.width,n.top=t.chkRTLB.bottom+8,t.cbbBackColor=new Rn,t.cbbBackColor.left=n.right+5,t.cbbBackColor.top=n.top-3,t.cbbBackColor.width=t.chkRTLB.width;var s=new nn("保存");s.left=Math.trunc((t.clientArea.width-s.width)/2),s.top=t.clientArea.height-s.height-5,s.onClick=function(){t.modalResult=no,t.close()},t.beginUpdate();try{t.addControl(e),t.addControl(t.cbbRang),t.addControl(i),t.addControl(t.chkLeft),t.addControl(t.chkTop),t.addControl(t.chkRight),t.addControl(t.chkBottom),t.addControl(t.chkLTRB),t.addControl(t.chkRTLB),t.addControl(n),t.addControl(t.cbbBackColor),t.addControl(s),t.moveCenter()}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetCellBorderBack",value:function(t,e){this.cbbBackColor.color==lp.HCTransparentColor?this.FTableItem.Rows[t][e].BackgroundColor=lp.HCTransparentColor:this.FTableItem.Rows[t][e].BackgroundColor=this.cbbBackColor.color;var i=this.FTableItem.Rows[t][e].BorderSides;this.chkLeft.checked?i.add(fp.Left):i.remove(fp.Left),this.chkTop.checked?i.add(fp.Top):i.remove(fp.Top),this.chkRight.checked?i.add(fp.Right):i.remove(fp.Right),this.chkBottom.checked?i.add(fp.Bottom):i.remove(fp.Bottom),this.chkLTRB.checked?i.add(fp.LTRB):i.remove(fp.LTRB),this.chkRTLB.checked?i.add(fp.RTLB):i.remove(fp.RTLB)}},{key:"ApplyAllTable",value:function(){for(var t=0;t<this.FTableItem.RowCount;t++)for(var e=0;e<this.FTableItem.ColCount;e++)this.SetCellBorderBack(t,e)}},{key:"SetView",value:function(t){var e,i=this;this.FTableItem=t.ActiveSection.ActiveData.GetActiveItem(),e=this.FTableItem.SelectCellRang.StartRow>=0?this.FTableItem.Rows[this.FTableItem.SelectCellRang.StartRow][this.FTableItem.SelectCellRang.StartCol]:this.FTableItem.Rows[0][0],this.beginUpdate();try{this.cbbBackColor.color=e.BackgroundColor,this.chkLeft.checked=e.BorderSides.has(fp.Left),this.chkTop.checked=e.BorderSides.has(fp.Top),this.chkRight.checked=e.BorderSides.has(fp.Right),this.chkBottom.checked=e.BorderSides.has(fp.Bottom),this.chkLTRB.checked=e.BorderSides.has(fp.LTRB),this.chkRTLB.checked=e.BorderSides.has(fp.RTLB)}finally{this.endUpdate()}this.showModal((function(){t.BeginUpdate();try{if(0==i.cbbRang.itemIndex)if(i.FTableItem.SelectCellRang.EditCell())i.SetCellBorderBack(i.FTableItem.SelectCellRang.StartRow,i.FTableItem.SelectCellRang.StartCol);else if(i.FTableItem.SelectCellRang.StartRow>=0)for(var e=i.FTableItem.SelectCellRang.StartRow;e<=i.FTableItem.SelectCellRang.EndRow;e++)for(var n=i.FTableItem.SelectCellRang.StartCol;n<=i.FTableItem.SelectCellRang.EndCol;n++)i.SetCellBorderBack(e,n);else i.ApplyAllTable();else i.ApplyAllTable();t.Style.UpdateInfoRePaint()}finally{t.EndUpdate()}}))}}])&&Yg(e.prototype,i),n&&Yg(e,n),r}(ro);function tw(t){return(tw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ew(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function iw(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function nw(t,e){return(nw=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ow(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=sw(t);if(e){var o=sw(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return rw(this,i)}}function rw(t,e){return!e||"object"!==tw(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function sw(t){return(sw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var aw=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&nw(t,e)}(r,t);var e,i,n,o=ow(r);function r(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:320,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:246;return ew(this,r),(t=o.call(this,e,i)).caption="数据组",t}return e=r,(i=[{key:"SetView",value:function(t){var e=this,i=t.ActiveSectionTopLevelData(),n=i.ActiveDomain;if(!(n.BeginNo<0)){var o=i.Items[n.BeginNo];this.beginUpdate();try{""!=o.GetValue(Iv.Name)&&(this.caption+="-"+o.GetValue(Iv.Name)),this.getPropertys(o.Propertys),this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){e.setPropertys(o.Propertys),o.CheckPropertys(),o=i.Items[n.EndNo],e.setPropertys(o.Propertys),o.CheckPropertys(),t.ActiveSection.ReFormatActiveItem()}))}}}])&&iw(e.prototype,i),n&&iw(e,n),r}(ug);function lw(t){return(lw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cw(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function uw(t,e){return(uw=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function fw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=mw(t);if(e){var o=mw(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return dw(this,i)}}function dw(t,e){return!e||"object"!==lw(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function mw(t){return(mw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var yw=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&uw(t,e)}(r,t);var e,i,n,o=fw(r);function r(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:225,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:160;hw(this,r),t=o.call(this,e,i);var n=new en("标题:");n.left=10,n.top=10,t.edtTitle=new dn(""),t.edtTitle.left=n.left,t.edtTitle.top=n.bottom+5,t.edtTitle.width=200;var s=new en("批注:");s.left=n.left,s.top=t.edtTitle.bottom+10,t.edtText=new dn(""),t.edtText.left=s.left,t.edtText.top=s.bottom+5,t.edtText.width=200,t.btnOK=new nn("确定"),t.btnOK.left=Math.trunc((t.width-t.btnOK.width)/2),t.btnOK.top=t.edtText.bottom+10,t.btnOK.onClick=function(){t.modalResult=no,t.close()},t.beginUpdate();try{t.addControl(n),t.addControl(t.edtTitle),t.addControl(s),t.addControl(t.edtText),t.addControl(t.btnOK),t.moveCenter()}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetAnnotate",value:function(t){null!=t?(this.btnOK.text="修改",this.edtTitle.text=t.Content.Title,this.edtText.text=t.Content.Text,this.caption="批注序号-"+t.ID.toString()):(this.btnOK.text="确定",this.caption="新建批注",this.edtTitle.clear(),this.edtText.clear())}}])&&cw(e.prototype,i),n&&cw(e,n),r}(ro);function pw(t){return(pw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sw(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function vw(t,e){return(vw=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Fw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=gw(t);if(e){var o=gw(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Iw(this,i)}}function Iw(t,e){return!e||"object"!==pw(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function gw(t){return(gw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ww=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&vw(t,e)}(r,t);var e,i,n,o=Fw(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,640,480)).caption="DeImage属性",t.FImageItem=null,t.FDrawRect=null,t.FPaintInfo=null;var e=t.captionBar.addButton("",!1,or.emrCommon.homePath+"image/nonetool.png");e.hint="不使用工具",e.group=1,e.onClick=function(){t.FImageItem.ShapeManager.OperStyle=Rc,e.checked=!0};var i=t.captionBar.addButton("直线",!1,or.emrCommon.homePath+"image/line.png");i.hint="直线",i.group=1,i.onClick=function(){t.FImageItem.ShapeManager.OperStyle=_c,i.checked=!0};var n=t.captionBar.addButton("矩形",!1,or.emrCommon.homePath+"image/rectangle.png");n.hint="矩形",n.group=1,n.onClick=function(){t.FImageItem.ShapeManager.OperStyle=xc,n.checked=!0};var s=t.captionBar.addButton("椭圆",!1,or.emrCommon.homePath+"image/ellipse.png");return s.hint="椭圆",s.group=1,s.onClick=function(){t.FImageItem.ShapeManager.OperStyle=Ac,s.checked=!0},t.paintBox=new ni,t.paintBox.canFocus=!0,t.paintBox.onPaint=function(e){e.drawImage(0,0,t.FImageItem.Image.image),t.FImageItem.ShapeManager.PaintTo(e,t.FDrawRect,t.FPaintInfo)},t.paintBox.onMouseDown=function(e){t.FImageItem.ShapeManager.MouseDown(e),t.update()},t.paintBox.onMouseMove=function(e){t.FImageItem.ShapeManager.MouseMove(e),t.update()},t.paintBox.onMouseUp=function(e){t.FImageItem.ShapeManager.MouseUp(e),t.update()},t.paintBox.onKeyDown=function(e){t.FImageItem.ShapeManager.KeyDown(e),t.update()},t.addControl(t.paintBox),t}return e=r,(i=[{key:"SetView",value:function(t,e){var i=this;this.FImageItem=e,this.FImageItem.ShapeManager.OperStyle=Rc,this.FDrawRect=U.Create(0,0,this.FImageItem.Width,this.FImageItem.Height),this.FPaintInfo=new Us,this.beginUpdate();try{this.paintBox.width=e.Width,this.paintBox.height=e.Height,this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){i.FImageItem.ShapeManager.ActiveIndex=-1,t.BeginUpdate();try{t.ActiveSection.ReFormatActiveItem()}finally{t.EndUpdate()}}))}}])&&Sw(e.prototype,i),n&&Sw(e,n),r}(ug);function Cw(t){return(Cw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kw(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Pw(t,e){return(Pw=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Dw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Rw(t);if(e){var o=Rw(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return bw(this,i)}}function bw(t,e){return!e||"object"!==Cw(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Rw(t){return(Rw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var _w=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pw(t,e)}(r,t);var e,i,n,o=Dw(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,360,350)).caption="DeCheckbox属性",t.chkAutoSize=new un("自动计算宽高"),t.chkAutoSize.left=23,t.chkAutoSize.top=11,t.chkAutoSize.onSwitch=function(){t.edtWidth.enabled=!t.chkAutoSize.checked,t.edtHeight.enabled=!t.chkAutoSize.checked};var e=new en("宽(像素)");e.left=131,e.top=13,t.edtWidth=new pn,t.edtWidth.left=e.right+5,t.edtWidth.top=10,t.edtWidth.width=32;var i=new en("高(像素)");i.left=233,i.top=13,t.edtHeight=new pn,t.edtHeight.left=i.right+5,t.edtHeight.top=10,t.edtHeight.width=32,t.edtText=new vn("文本",""),t.edtText.left=t.chkAutoSize.left-5,t.edtText.top=t.chkAutoSize.bottom+5,t.edtText.width=200,t.chkDeleteAllow=new un("允许删除"),t.chkDeleteAllow.left=t.chkAutoSize.left,t.chkDeleteAllow.top=t.edtText.bottom+5,t.beginUpdate();try{t.addControl(t.chkAutoSize),t.addControl(e),t.addControl(t.edtWidth),t.addControl(i),t.addControl(t.edtHeight),t.addControl(t.edtText),t.addControl(t.chkDeleteAllow)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetView",value:function(t,e){var i=this;this.beginUpdate();try{""!=e.GetValue(hS)&&(this.caption+="["+e.GetValue(hS)+"]"),this.chkAutoSize.checked=e.AutoSize,this.edtWidth.enabled=!this.chkAutoSize.checked,this.edtHeight.enabled=!this.chkAutoSize.checked,this.edtWidth.text=e.Width.toString(),this.edtHeight.text=e.Height.toString(),this.edtText.text=e.Text,this.chkDeleteAllow.checked=e.DeleteAllow,this.getPropertys(e.Propertys),this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){e.AutoSize=i.chkAutoSize.checked,i.chkAutoSize.checked||(e.Width=or.system.parseIntDef(i.edtWidth.text,e.width),e.Height=or.system.parseIntDef(i.edtHeight.text,e.Height)),e.Text=i.edtText.text,e.DeleteAllow=i.chkDeleteAllow.checked,i.setPropertys(e.Propertys),t.BeginUpdate();try{t.ActiveSection.ReFormatActiveItem()}finally{t.EndUpdate()}}))}}])&&kw(e.prototype,i),n&&kw(e,n),r}(ug);function xw(t){return(xw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Aw(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Tw(t,e,i){return(Tw="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Mw(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function Ow(t,e){return(Ow=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Nw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Mw(t);if(e){var o=Mw(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Bw(this,i)}}function Bw(t,e){return!e||"object"!==xw(e)&&"function"!=typeof e?Ew(t):e}function Ew(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Mw(t){return(Mw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Lw=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ow(t,e)}(r,t);var e,i,n,o=Nw(r);function r(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this)).color=at.rgbaToColor(82,89,107),t.canFocus=!0,t.cursor=ue,t._canvas=document.createElement("canvas"),t._context=t._canvas.getContext("2d"),t.FDataBmpCanvas=new Dt(t._context),sr.Initialization(),0==lp.HCExtFormat&&(lp.HCExtFormat=or.clipboard.registerFormat()),t.FUndoList=new Ta,t.FUndoList.OnUndo=function(e){t.DoUndo(e)},t.FUndoList.OnRedo=function(e){t.DoRedo(e)},t.FUndoList.OnUndoNew=function(){return t.DoUndoNew()},t.FUndoList.OnUndoGroupStart=function(e,i){return t.DoUndoGroupBegin(e,i)},t.FUndoList.OnUndoGroupEnd=function(e,i){return t.DoUndoGroupEnd(e,i)},t.FUpdateCount=0,t.FViewWidth=0,t.FViewHeight=0,t.FStyle=new cs(!0,!0),t.FStyle.OnInvalidateRect=function(e){t.DoStyleInvalidateRect(e)},t.FData=new jy(t.FStyle),t.FData.Width=200,t.FData.OnGetUndoList=function(){return t.DoGetUndoList()},t.FData.OnCreateItemByStyle=function(e,i){return t.DoDataCreateStyleItem(e,i)},t.FData.OnInsertItem=function(e,i){t.DoDataInsertItem(e,i)},t.FData.OnRemoveItem=function(e,i){t.DoDataRemoveItem(e,i)},t.FVScrollBar=new mi,t.FVScrollBar.orientation=Jt,t.FVScrollBar.align=Vt,t.FVScrollBar.onScroll=function(e,i,n){t.DoVerScroll(e,i,n)},t.FHScrollBar=new UF,t.FHScrollBar.orientation=Yt,t.FHScrollBar.addStatus(100),t.FHScrollBar.align=Vt,t.FHScrollBar.onScroll=function(e,i,n){t.DoVerScroll(e,i,n)},t.controls.add(t.FHScrollBar),t.controls.add(t.FVScrollBar),t.handle_=or.handleAllocate(),t.FCaret=new Rp,t.FCaret.control=Ew(t),t.imeMode=Mi,t.FChanged=!1,t.OnChange=null,t}return e=r,(i=[{key:"DoVerScroll",value:function(t,e,i){this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(!1),this.CheckUpdateInfo()}},{key:"GetViewWidth",value:function(){this.FVScrollBar.visible?this.FViewWidth=this.width-this.FVScrollBar.width:this.FViewWidth=this.width}},{key:"GetViewHeight",value:function(){this.FHScrollBar.visible?this.FViewHeight=this.height-this.FHScrollBar.height:this.FViewHeight=this.height}},{key:"GetCurStyleNo",value:function(){return this.FData.GetTopLevelData().CurParaNo}},{key:"GetCurParaNo",value:function(){return this.FData.GetTopLevelData().CurStyleNo}},{key:"ReBuildCaret",value:function(){if(null!=this.FCaret)if(!this.focused||!this.FStyle.UpdateInfo.DragingSelected&&this.FData.SelectExists())this.FCaret.Hide();else{var t=new bp;if(t.X=0,t.Y=0,t.Height=0,t.Visible=!0,this.FData.GetCaretInfo(this.FData.SelectInfo.StartItemNo,this.FData.SelectInfo.StartItemOffset,t),t.Visible){if(this.FCaret.X=t.X-this.FHScrollBar.position+this.paddingLeft,this.FCaret.Y=t.Y-this.FVScrollBar.position+this.paddingTop,this.FCaret.Height=t.Height,this.FStyle.UpdateInfo.ReScroll){if(this.FCaret.X<0||this.FCaret.X>this.FViewWidth)return void this.FCaret.Hide();if(this.FCaret.Y+this.FCaret.Height<0||this.FCaret.Y>this.FViewHeight)return void this.FCaret.Height}else if(this.FCaret.Height<this.FViewHeight){if(!this.FCaret.VScroll){this.FCaret.VScroll=!0;try{this.FCaret.Y<0?this.FVScrollBar.position+=this.FCaret.Y-this.paddingTop:this.FCaret.Y+this.FCaret.Height+this.paddingTop>this.FViewHeight&&(this.FVScrollBar.position+=this.FCaret.Y+this.FCaret.Height+this.paddingTop-this.FViewHeight)}finally{this.FCaret.VScroll=!1}}if(!this.FCaret.HScroll){this.FCaret.HScroll=!0;try{this.FCaret.X?this.FHScrollBar.position+=this.FCaret.X-this.paddingLeft:this.FCaret.X+this.paddingLeft>this.FViewWidth&&(this.FHScrollBar.position+=this.FCaret.X+this.paddingLeft-this.FViewWidth)}finally{this.FCaret.HScroll=!1}}}this.FCaret.VScroll||this.FCaret.HScroll||(this.FCaret.Y+this.FCaret.Height>this.FViewHeight&&(this.FCaret.Height=this.FViewHeight-this.FCaret.Y),this.FCaret.Show(),this.DoCaretChange())}else this.FCaret.Hide()}}},{key:"CheckUpdateInfo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null!=this.FCaret&&this.FStyle.UpdateInfo.ReCaret&&(this.FStyle.UpdateInfo.ReCaret=!1,this.FStyle.UpdateInfo.ReStyle=!1,this.FStyle.UpdateInfo.ReScroll=!1,this.ReBuildCaret(t)),this.FStyle.UpdateInfo.RePaint&&(this.FStyle.UpdateInfo.RePaint=!1,this.UpdateView())}},{key:"DoMapChanged",value:function(){0==this.FUpdateCount&&(this.CalcScrollRang(),this.CheckUpdateInfo())}},{key:"DoCaretChange",value:function(){null!=this.OnCaretChange&&this.OnCaretChange(this,null)}},{key:"DoDataCheckUpdateInfo",value:function(){0==this.FUpdateCount&&this.CheckUpdateInfo()}},{key:"DoChange",value:function(){this.FChanged=!0,this.DoMapChanged(),null!=this.OnChange&&this.OnChange(this,null)}},{key:"CalcScrollRang",value:function(){this.FHScrollBar.max=this.paddingLeft+this.paddingRight,this.FVScrollBar.max=this.FData.height+this.paddingTop+this.paddingBottom}},{key:"_DeleteUnUsedStyle",value:function(){this.FStyle.TextStyles[0].CheckSaveUsed=!0,this.FStyle.TextStyles[0].TempNo=0;for(var t=1;t<this.FStyle.TextStyles.count;t++)this.FStyle.TextStyles[t].CheckSaveUsed=!1,this.FStyle.TextStyles[t].TempNo=cs.Null;for(var e=0;e<this.FStyle.ParaStyles.count;e++)this.FStyle.ParaStyles[e].CheckSaveUsed=!1,this.FStyle.ParaStyles[e].TempNo=cs.Null;this.FData.MarkStyleUsed(!0);for(var i=0,n=1;n<this.FStyle.TextStyles.count;n++)this.FStyle.TextStyles[n].CheckSaveUsed?this.FStyle.TextStyles[n].TempNo=n-i:i++;i=0;for(var o=0;o<this.FStyle.ParaStyles.count;o++)this.FStyle.ParaStyles[o].CheckSaveUsed?this.FStyle.ParaStyles[o].TempNo=o-i:i++;this.FData.MarkStyleUsed(!1);for(var r=this.FStyle.TextStyles.count-1;r>=1;r--)this.FStyle.TextStyles[r].CheckSaveUsed||this.FStyle.TextStyles.removeAt(r);for(var s=this.FStyle.ParaStyles.count-1;s>=0;s--)this.FStyle.ParaStyles[s].CheckSaveUsed||this.FStyle.ParaStyles.removeAt(s)}},{key:"doPaint_",value:function(t){t.bitBlt(0,0,this.FViewWidth,this.FViewHeight,this.FDataBmpCanvas,0,0,this.FViewWidth,this.FViewHeight),t.brush.color=this.color,t.fillBounds(this.FVScrollBar.left,this.FHScrollBar.top,this.FVScrollBar.width,this.FHScrollBar.height),Tw(Mw(r.prototype),"doPaint_",this).call(this,t)}},{key:"doResize_",value:function(){Tw(Mw(r.prototype),"doResize_",this).call(this),this.GetViewWidth(),this.GetViewHeight(),this.FViewWidth>0&&this.FViewHeight>0&&(this._canvas.width=this.FViewWidth,this._canvas.height=this.FViewHeight,this._context=this._canvas.getContext("2d"),this.FDataBmpCanvas=new Dt(this._context),this.FDataBmpCanvas.prepareConext(or._scale)),this.FData.Width=this.FViewWidth-this.paddingLeft-this.paddingRight,this.FData.ReFormat(),this.FStyle.UpdateInfoRePaint(),null!=this.FCaret&&this.FStyle.UpdateInfoReCaret(!1),this.DoMapChanged()}},{key:"doSetBounds_",value:function(){this.FVScrollBar.left=this.width-this.FVScrollBar.width,this.FVScrollBar.height=this.height-this.FHScrollBar.height,this.FVScrollBar.pageSize=this.FVScrollBar.height,this.FHScrollBar.top=this.height-this.FHScrollBar.height,this.FHScrollBar.width=this.width-this.FVScrollBar.width,this.FHScrollBar.pageSize=this.FHScrollBar.width,Tw(Mw(r.prototype),"doSetBounds_",this).call(this)}},{key:"doSetFocus_",value:function(t){Tw(Mw(r.prototype),"doSetFocus_",this).call(this,t),this.focused&&this.imeMode==Mi&&or.ime.setControl(this)}},{key:"imeActive",value:function(){this.FCaret.Show()}},{key:"doMouseDown_",value:function(t){var e=new ei;e.assign(t),e.x=t.x-this.paddingLeft-this.FHScrollBar.position,e.y=t.y-this.paddingTop+this.FVScrollBar.position,this.FData.MouseDown(e),this.CheckUpdateInfo(),Tw(Mw(r.prototype),"doMouseDown_",this).call(this,t)}},{key:"doMouseMove_",value:function(t){Tw(Mw(r.prototype),"doMouseMove_",this).call(this,t),lp.GCursor=ue;var e=new ei;e.assign(t),e.x=t.x-this.paddingLeft-this.FHScrollBar.position,e.y=t.y-this.paddingTop+this.FVScrollBar.position,this.FData.MouseMove(e),this.cursor=lp.GCursor,this.CheckUpdateInfo()}},{key:"doMouseUp_",value:function(t){if(Tw(Mw(r.prototype),"doMouseUp_",this).call(this,t),this.imeMode==Mi&&or.ime.setControl(this),t.button!=ie){var e=new ei;e.assign(t),e.x=t.x-this.paddingLeft-this.FHScrollBar.position,e.y=t.y-this.paddingTop+this.FVScrollBar.position,this.FData.MouseUp(e),this.FStyle.UpdateInfo.DragingSelected&&(lp.GCursor=oe),this.cursor=lp.GCursor,this.CheckUpdateInfo(),this.FStyle.UpdateInfo.Selecting=!1,this.FStyle.UpdateInfo.DragingSelected=!1}}},{key:"doMouseWheel_",value:function(t){or.keyDownStates[_e]?this.FHScrollBar.position-=t.delta:this.FVScrollBar.position-=t.delta}},{key:"doKeyDown_",value:function(t){Tw(Mw(r.prototype),"doKeyDown_",this).call(this,t),or.keyDownStates[_e]&&t.keyCode==He?this.SelectAll():or.keyDownStates[_e]&&t.keyCode==je?this.Undo():or.keyDownStates[_e]&&t.keyCode==ze?this.Redo():(this.FData.KeyDown(t),lp.IsKeyDownEdit(t.keyCode)?this.DoChange():lp.IsDirectionKey(t.keyCode)&&this.DoDataCheckUpdateInfo()),this.CheckUpdateInfo()}},{key:"doKeyUp_",value:function(t){Tw(Mw(r.prototype),"doKeyUp_",this).call(this,t),this.FData.KeyUp(t)}},{key:"doKeyPress_",value:function(t){Tw(Mw(r.prototype),"onKeyPress",this).call(this,t),lp.IsKeyPressWant(t)&&(this.FData.KeyPress(t.keyCode),this.DoChange(),this.CheckUpdateInfo())}},{key:"imeInput",value:function(t){""!=t&&(this.FData.InsertText(t),this.FStyle.UpdateInfoRePaint(),this.FStyle.UpdateInfoReCaret(),this.CheckUpdateInfo())}},{key:"DoDrawItemPaintBefor",value:function(t,e,i,n,o,r,s,a,l,h,c,u){}},{key:"DoDataCreateStyleItem",value:function(t,e){return null!=this.FOnCreateStyleItem?this.FOnCreateStyleItem(t,e):null}},{key:"DoDataInsertItem",value:function(t,e){null!=this.OnInsertItem&&this.OnInsertItem(t,e)}},{key:"DoDataRemoveItem",value:function(t,e){null!=this.OnRemoveItem&&this.OnRemoveItem(t,e)}},{key:"DataSaveLiteStream",value:function(t,e){lp._SaveFileFormatAndVersion(t),this.FStyle.SaveToStream(t),e()}},{key:"DataLoadLiteStream",value:function(t,e){var i=lp._LoadFileFormatAndVersion(t),n=new cs;n.LoadFromStream(t,i.fileVersion),e(i.fileVersion,n)}},{key:"InsertLiteStream",value:function(t){var e=this,i=!1;return this.DataLoadLiteStream(t,(function(n,o){e.BeginUpdate();try{i=e.FData.GetTopLevelData().InsertStream(t,o,n)}finally{e.EndUpdate()}})),i}},{key:"DoCopyRequest",value:function(t){var e=this.FData.GetTopLevelItem();return e.StyleNo!=cs.Edit||!e.SelectTextExists()||t==Ao}},{key:"DoPasteRequest",value:function(t){return this.FData.GetTopLevelItem().StyleNo!=cs.Edit||t==Ao}},{key:"DoPasteFormatStream",value:function(t){return!0}},{key:"DoCopyAsStream",value:function(t){}},{key:"doCut_",value:function(t){this.doCopy_(t),this.FData.DeleteSelected(),this.CheckUpdateInfo()}},{key:"doCopy_",value:function(t){var e=this;if(this.FData.SelectExists()){this.FStyle.States.Include(Ip.Copying);try{if(this.DoCopyRequest(Ao)){var i=this.FData.SaveSelectToText();t.clipboardData.setData(I.TXT,i)}if(this.DoCopyRequest(lp.HCExtFormat)){var n=new K;this.DoCopyAsStream(n),this.DataSaveLiteStream(n,(function(){e.FData.GetTopLevelData().SaveSelectToStream(n)})),t.clipboardData.setData(lp.HC_EXT,n.toJSONString())}}finally{this.FStyle.States.Exclude(Ip.Copying)}}}},{key:"doPaste_",value:function(t){this.FStyle.States.Include(Ip.Pasting);try{if(t.clipboardData.types.indexOf(lp.HC_EXT)>-1&&this.DoPasteRequest(lp.HCExtFormat)){var e=new K;if(e.fromJSONString(t.clipboardData.getData(lp.HC_EXT)),!this.DoPasteFormatStream(e))return;this.InsertLiteStream(e)}else t.clipboardData.types.indexOf(I.TXT)>-1&&this.DoPasteRequest(Ao)&&(this.FData.InsertText(t.clipboardData.getData(I.TXT)),this.DoMapChanged())}finally{this.FStyle.States.Exclude(Ip.Pasting)}}},{key:"DataChangeByAction",value:function(t){var e=t();return this.DoChange(),e}},{key:"DoGetUndoList",value:function(){return this.FUndoList}},{key:"DoUndoNew",value:function(){var t=new ka;return t.HScrollPos=this.FHScrollBar.position,t.VScrollPos=this.FVScrollBar.position,t.Data=this.FData,t}},{key:"DoUndoGroupBegin",value:function(t,e){var i=new ba;return i.HScrollPos=this.FHScrollBar.position,i.VScrollPos=this.FVScrollBar.position,i.Data=this.FData,i.CaretDrawItemNo=this.FData.CaretDrawItemNo,i}},{key:"DoUndoGroupEnd",value:function(t,e){var i=new xa;return i.HScrollPos=this.FHScrollBar.position,i.VScrollPos=this.FVScrollBar.position,i.Data=this.FData,i.CaretDrawItemNo=this.FData.CaretDrawItemNo,i}},{key:"DoUndo",value:function(t){var e=this;(t.isClass(ka)||t.isClass(ba))&&(this.FHScrollBar.position=t.HScrollPos,this.FVScrollBar.position=t.VScrollPos),this.DoGetUndoList().GroupWorking?this.FData.Undo(t):this.DataChangeByAction((function(){return e.FData.Undo(t),!0}))}},{key:"DoRedo",value:function(t){var e=this;(t.isClass(ka)||t.isClass(ba))&&(this.FHScrollBar.position=t.HScrollPos,this.FVScrollBar.position=t.VScrollPos),this.DoGetUndoList().GroupWorking?this.FData.Redo(t):this.DataChangeByAction((function(){return e.FData.Redo(t),!0}))}},{key:"ApplyParaAlignHorz",value:function(t){this.FData.ApplyParaAlignHorz(t),this.CheckUpdateInfo()}},{key:"ApplyParaAlignVert",value:function(t){this.FData.ApplyParaAlignVert(t),this.CheckUpdateInfo()}},{key:"ApplyParaBackColor",value:function(t){this.FData.ApplyParaBackColor(t),this.CheckUpdateInfo()}},{key:"ApplyParaLineSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.FData.ApplyParaLineSpace(t,e),this.CheckUpdateInfo()}},{key:"ApplyTextStyle",value:function(t){this.FData.ApplyTextStyle(t),this.CheckUpdateInfo()}},{key:"ApplyTextFontName",value:function(t){this.FData.ApplyTextFontName(t),this.CheckUpdateInfo()}},{key:"ApplyTextFontSize",value:function(t){this.FData.ApplyTextFontSize(t),this.CheckUpdateInfo()}},{key:"ApplyTextColor",value:function(t){this.FData.ApplyTextColor(t),this.CheckUpdateInfo()}},{key:"ApplyTextBackColor",value:function(t){this.FData.ApplyTextBackColor(t),this.CheckUpdateInfo()}},{key:"InsertText",value:function(t){var e=this;return this.DataChangeByAction((function(){return e.FData.InsertText(t)}))}},{key:"InsertItem",value:function(t){var e=this;return this.DataChangeByAction((function(){return e.FData.InsertItem(t)}))}},{key:"InsertItemEx",value:function(t,e){var i=this;return this.DataChangeByAction((function(){return i.FData.InsertItemEx(t,e)}))}},{key:"InsertDomain",value:function(t){var e=this;return this.DataChangeByAction((function(){return e.FData.InsertDomain(t)}))}},{key:"InsertTable",value:function(t,e){var i=this;return this.DataChangeByAction((function(){return i.FData.GetTopLevelData().InsertTable(t,e)}))}},{key:"TopLevelData",value:function(){return this.FData.GetTopLevelData()}},{key:"SetActiveItemText",value:function(t){this.FData.SetActiveItemText(t),this.CheckUpdateInfo()}},{key:"SelectAll",value:function(){this.FData.SelectAll(),this.FStyle.UpdateInfoRePaint(),this.CheckUpdateInfo()}},{key:"SaveToFile",value:function(t){}},{key:"LoadFromFile",value:function(t){}},{key:"SaveToStream",value:function(t){lp._SaveFileFormatAndVersion(t),this._DeleteUnUsedStyle(),this.FStyle.SaveToStream(t),this.FData.SaveToStream(t)}},{key:"LoadFromStream",value:function(t){this.BeginUpdate();try{this.FUndoList.clear(),this.FUndoList.SaveState();try{this.FUndoList.Enable=!1,this.FData.Clear(),this.FStyle.Initialize(),t.position=0;var e=lp._LoadFileFormatAndVersion(t);e.fileExt!=lp.HC_EXT&&or.exception("加载失败,不是"+lp.HC_EXT+"文件!"),this.FStyle.LoadFromStream(t,e.fileVersion),this.FData.LoadFromStream(t,this.FStyle,e.fileVersion),this.DoMapChanged()}finally{this.FUndoList.RestoreState()}}finally{this.EndUpdate()}}},{key:"Clear",value:function(){this.FData.Clear()}},{key:"Undo",value:function(){if(this.FUndoList.Enable)try{this.FUndoList.Enable=!1,this.BeginUpdate();try{this.FUndoList.Undo()}finally{this.EndUpdate()}}finally{this.FUndoList.Enable=!0}}},{key:"Redo",value:function(){if(this.FUndoList.Enable)try{this.FUndoList.Enable=!1,this.BeginUpdate();try{this.FUndoList.Redo()}finally{this.EndUpdate()}}finally{this.FUndoList.Enable=!0}}},{key:"UndoGroupBegin",value:function(){this.FUndoList.Enable&&this.FUndoList.UndoGroupBegin(this.FData.SelectInfo.StartItemNo,this.FData.SelectInfo.StartItemOffset)}},{key:"UndoGroupEnd",value:function(){this.FUndoList.Enable&&this.FUndoList.UndoGroupEnd(this.FData.SelectInfo.StartItemNo,this.FData.SelectInfo.StartItemOffset)}},{key:"GetViewRect",value:function(){return U.CreateByBounds(this.paddingLeft,this.paddingTop,this.FViewWidth,this.FViewHeight)}},{key:"UpdateView",value:function(){this.UpdateViewRect(this.GetViewRect())}},{key:"UpdateViewRect",value:function(t){if(!this.FStyle.States.Contain(Ip.Destroying)&&0==this.FUpdateCount){this.FDataBmpCanvas.save();try{this.FDataBmpCanvas.clipRect(t),this.FDataBmpCanvas.brush.color=at.White,this.FDataBmpCanvas.fillRect(U.CreateByBounds(0,0,this.FViewWidth,this.FViewHeight));var e=new Us;this.FData.PaintData(this.paddingLeft-this.FHScrollBar.position,this.paddingTop,this.width-this.FHScrollBar.position-this.paddingRight,this.paddingTop+this.FData.height,this.paddingTop,this.height-this.FHScrollBar.height,this.FVScrollBar.position,this.FDataBmpCanvas,e);for(var i=0;i<e.topItems.count;i++)e.TopItems[i].PaintTop(this.FDataBmpCanvas);this.FDataBmpCanvas.pen.width=1,this.FDataBmpCanvas.pen.color=lp.clActiveBorder,this.FDataBmpCanvas.rectangle(0,0,this.width,this.height)}finally{this.FDataBmpCanvas.restore()}this.updateRect(t)}}},{key:"BeginUpdate",value:function(){this.FUpdateCount++}},{key:"EndUpdate",value:function(){this.FUpdateCount--,this.DoMapChanged()}},{key:"CurStyleNo",get:function(){return this.GetCurStyleNo()}},{key:"CurParaNo",get:function(){return this.GetCurParaNo()}},{key:"Data",get:function(){return this.FData}},{key:"Style",get:function(){return this.FStyle}},{key:"Changed",get:function(){return this.FChanged},set:function(t){this.FChanged=t}}])&&Aw(e.prototype,i),n&&Aw(e,n),r}(gi);function Gw(t){return(Gw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hw(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Uw(t,e){return(Uw=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=zw(t);if(e){var o=zw(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ww(this,i)}}function Ww(t,e){return!e||"object"!==Gw(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function zw(t){return(zw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var jw=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Uw(t,e)}(r,t);var e,i,n,o=Vw(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,360,400)).caption="表格属性(行、列序号均以0开始)",t.pgTable=new On,t.pgTable.showCloseButton=!1,t.pgTable.borderVisible=!1,t.pgTable.align=Kt;var e=t.pgTable.addPage();e.text="表格";var i=new en("单元格边距");i.left=14,i.top=10,e.addControl(i),t.edtCellHPadding=new vn("左右",""),t.edtCellHPadding.left=33,t.edtCellHPadding.top=28,t.edtCellHPadding.width=90,e.addControl(t.edtCellHPadding),(i=new en("毫米")).left=t.edtCellHPadding.right,i.top=t.edtCellHPadding.top+5,e.addControl(i),t.edtCellVPadding=new vn("上下",""),t.edtCellVPadding.left=189,t.edtCellVPadding.top=t.edtCellHPadding.top,t.edtCellVPadding.width=90,e.addControl(t.edtCellVPadding),(i=new en("毫米")).left=t.edtCellVPadding.right,i.top=t.edtCellVPadding.top+5,e.addControl(i),t.chkBorderVisible=new un("显示边框"),t.chkBorderVisible.left=14,t.chkBorderVisible.top=66,e.addControl(t.chkBorderVisible),t.edtBorderWidth=new vn("边框宽度(磅)",""),t.edtBorderWidth.left=t.chkBorderVisible.right+10,t.edtBorderWidth.top=t.chkBorderVisible.top-3,t.edtBorderWidth.width=120,e.addControl(t.edtBorderWidth);var n=new nn("边框及背景色");n.left=t.edtBorderWidth.right+5,n.top=t.edtBorderWidth.top,n.width=100,e.addControl(n),(i=new en("固定行")).left=14,i.top=98,e.addControl(i),t.edtFixRowFirst=new vn("从第",""),t.edtFixRowFirst.left=33,t.edtFixRowFirst.top=118,t.edtFixRowFirst.width=60,e.addControl(t.edtFixRowFirst),t.edtFixRowLast=new vn("行到第",""),t.edtFixRowLast.left=t.edtFixRowFirst.right+1,t.edtFixRowLast.top=t.edtFixRowFirst.top,t.edtFixRowLast.width=74,e.addControl(t.edtFixRowLast),(i=new en("固定列")).left=14,i.top=146,e.addControl(i),t.edtFixColFirst=new vn("从第",""),t.edtFixColFirst.left=33,t.edtFixColFirst.top=166,t.edtFixColFirst.width=60,e.addControl(t.edtFixColFirst),t.edtFixColLast=new vn("列到第",""),t.edtFixColLast.left=t.edtFixColFirst.right+1,t.edtFixColLast.top=t.edtFixColFirst.top,t.edtFixColLast.width=74,e.addControl(t.edtFixColLast),t.chkDeleteAllow=new un("允许删除此表格"),t.chkDeleteAllow.left=200,t.chkDeleteAllow.top=98,e.addControl(t.chkDeleteAllow),t.chkCanResize=new un("允许拖动改变大小"),t.chkCanResize.left=200,t.chkCanResize.top=118,e.addControl(t.chkCanResize),t.initTableProperty(e),t.pageRow=t.pgTable.addPage(""),t.initRowProperty(t.pageRow),t.pageCell=t.pgTable.addPage("单元格"),t.mmoScript=new Lw,t.mmoScript.left=10,t.mmoScript.top=10,t.mmoScript.width=t.width-20,t.mmoScript.height=180,t.mmoScript.Style.ParaStyles[0].AlignHorz=dr,t.mmoScript.Style.ParaStyles[0].LineSpaceMode=gr.PLS100,t.pageCell.addControl(t.mmoScript),t.initCellProperty(t.pageCell),t.pnlButton=new hn,t.pnlButton.height=40,t.pnlButton.borderVisible=!1,t.pnlButton.align=Xt;var s=new en("第一列为空时无效");s.left=2,s.top=10,s.font.color=at.OrangeRed,t.pnlButton.addControl(s);var a=new nn("新增行");a.left=s.right+5,a.top=5,a.width=55,a.onClick=function(){0===t.pgTable.pageIndex?(t.gridTableProperty.rowCount++,t.gridTableProperty.rows.last[0].value="",t.gridTableProperty.rows.last[1].value=""):1===t.pgTable.pageIndex?(t.gridRowProperty.rowCount++,t.gridRowProperty.rows.last[0].value="",t.gridRowProperty.rows.last[1].value=""):(t.gridCellProperty.rowCount++,t.gridCellProperty.rows.last[0].value="",t.gridCellProperty.rows.last[1].value="")},t.pnlButton.addControl(a);var l=new nn("删除选中行");l.left=a.right+10,l.top=a.top,l.width=75,l.onClick=function(){0===t.pgTable.pageIndex?t.gridTableProperty.deleteRow(t.gridTableProperty.row):1===t.pgTable.pageIndex?t.gridRowProperty.deleteRow(t.gridRowProperty.row):t.gridCellProperty.deleteRow(t.gridCellProperty.row)},t.pnlButton.addControl(l);var h=new nn("保存");h.left=l.right+20,h.top=l.top,h.width=55,h.onClick=function(){t.modalResult=no,t.close()},t.pnlButton.addControl(h),t.beginUpdate();try{t.pgTable.pageIndex=0,t.addControl(t.pgTable),t.addControl(t.pnlButton)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"initTableProperty",value:function(t){this.gridTableProperty=new Mn(1,2),this.gridTableProperty.marginLeft=5,this.gridTableProperty.marginRight=5,this.gridTableProperty.height=120,this.gridTableProperty.align=Xt,this.gridTableProperty.fixRowCount=1,this.gridTableProperty.rows[0][0].value="键",this.gridTableProperty.rows[0][1].value="值",this.gridTableProperty.setColWidth(0,100),this.gridTableProperty.setColWidth(1,180),t.addControl(this.gridTableProperty)}},{key:"initRowProperty",value:function(t){this.gridRowProperty=new Mn(1,2),this.gridRowProperty.marginLeft=5,this.gridRowProperty.marginRight=5,this.gridRowProperty.height=120,this.gridRowProperty.align=Xt,this.gridRowProperty.fixRowCount=1,this.gridRowProperty.rows[0][0].value="键",this.gridRowProperty.rows[0][1].value="值",this.gridRowProperty.setColWidth(0,100),this.gridRowProperty.setColWidth(1,180),t.addControl(this.gridRowProperty)}},{key:"initCellProperty",value:function(t){this.gridCellProperty=new Mn(1,2),this.gridCellProperty.marginLeft=5,this.gridCellProperty.marginRight=5,this.gridCellProperty.height=120,this.gridCellProperty.align=Xt,this.gridCellProperty.fixRowCount=1,this.gridCellProperty.rows[0][0].value="键",this.gridCellProperty.rows[0][1].value="值",this.gridCellProperty.setColWidth(0,100),this.gridCellProperty.setColWidth(1,180),t.addControl(this.gridCellProperty)}},{key:"getPropertys",value:function(t){this.gridTableProperty.rowCount=t.Propertys.count+1;for(var e=1;e<=t.Propertys.count;e++)this.gridTableProperty.rows[e][0].value=t.Propertys[e-1].key,this.gridTableProperty.rows[e][1].value=t.Propertys[e-1].val;var i=t.Rows[t.SelectCellRang.StartRow];this.gridRowProperty.rowCount=i.Propertys.count+1;for(var n=1;n<=i.Propertys.count;n++)this.gridRowProperty.rows[n][0].value=i.Propertys[n-1].key,this.gridRowProperty.rows[n][1].value=i.Propertys[n-1].val;var o=t.Rows[t.SelectCellRang.StartRow][t.SelectCellRang.StartCol];this.gridCellProperty.rowCount=o.Propertys.count+1;for(var r=1;r<=o.Propertys.count;r++)this.gridCellProperty.rows[r][0].value=o.Propertys[r-1].key,this.gridCellProperty.rows[r][1].value=o.Propertys[r-1].val}},{key:"setPropertys",value:function(t){var e;t.Propertys.clear();for(var i=1;i<this.gridTableProperty.rowCount;i++)""!=(e=lp.HCDeleteBreak(this.gridTableProperty.rows[i][0].value).trim())&&t.Propertys.add(e,lp.HCDeleteBreak(this.gridTableProperty.rows[i][1].value));var n=t.Rows[t.SelectCellRang.StartRow];n.Propertys.clear();for(var o=1;o<this.gridRowProperty.rowCount;o++)""!=(e=lp.HCDeleteBreak(this.gridRowProperty.rows[o][0].value).trim())&&n.Propertys.add(e,lp.HCDeleteBreak(this.gridRowProperty.rows[o][1].value));var r=t.Rows[t.SelectCellRang.StartRow][t.SelectCellRang.StartCol];r.Propertys.clear();for(var s=1;s<this.gridCellProperty.rowCount;s++)""!=(e=lp.HCDeleteBreak(this.gridCellProperty.rows[s][0].value).trim())&&r.Propertys.add(e,lp.HCDeleteBreak(this.gridCellProperty.rows[s][1].value))}},{key:"SetView",value:function(t){var e=this;this.FView=t;var i=t.ActiveSection.ActiveData.GetActiveItem();this.beginUpdate();try{this.edtCellHPadding.text=C.stringFormatFloat(1,i.CellHPaddingMM),this.edtCellVPadding.text=C.stringFormatFloat(1,i.CellVPaddingMM),this.chkBorderVisible.checked=i.BorderVisible,this.edtBorderWidth.text=C.stringFormatFloat(1,i.BorderWidthPt),this.edtFixRowFirst.text=i.FixRow.toString(),i.FixRowCount>0?this.edtFixRowLast.text=(i.FixRow+i.FixRowCount-1).toString():this.edtFixRowLast.text=this.edtFixRowFirst.text,this.edtFixColFirst.text=i.FixCol.toString(),i.FixColCount>0?this.edtFixColLast.text=(i.FixCol+i.FixColCount-1).toString():this.edtFixColLast.text=this.edtFixColFirst.text,this.chkDeleteAllow.checked=i.DeleteAllow,this.chkCanResize.checked=i.CanResize,this.pageRow.text="行("+i.SelectCellRang.StartRow.toString()+")",i.SelectCellRang.StartRow>=0&&i.SelectCellRang.StartCol>=0?i.SelectCellRang.EndRow>=0?(i.Rows[i.SelectCellRang.StartRow][i.SelectCellRang.StartCol].AlignVert,this.pageCell.text="单元格("+i.SelectCellRang.StartRow.toString()+","+i.SelectCellRang.StartCol.toString()+") - ("+i.SelectCellRang.EndRow.toString()+","+i.SelectCellRang.EndCol.toString()+")"):(i.GetEditCell().AlignVert,this.pageCell.text="单元格("+i.SelectCellRang.StartRow.toString()+","+i.SelectCellRang.StartCol.toString()+")",this.mmoScript.InsertText(i.GetEditCell().CellData.Script)):this.pageCell.visible=!1,this.getPropertys(i),this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){t.BeginUpdate();try{i.CellHPaddingMM=or.system.parseFloatDef(e.edtCellHPadding.text,.2),i.CellVPaddingMM=or.system.parseFloatDef(e.edtCellVPadding.text,0),i.BorderWidthPt=or.system.parseFloatDef(e.edtBorderWidth.text,.5),i.borderVisible=e.chkBorderVisible.checked,i.SetFixRowAndCount(or.system.parseIntDef(e.edtFixRowFirst.text,-1),or.system.parseIntDef(e.edtFixRowLast.text,-1)-or.system.parseIntDef(e.edtFixRowFirst.text,-1)+1),i.SetFixColAndCount(or.system.parseIntDef(e.edtFixColFirst.text,-1),or.system.parseIntDef(e.edtFixColLast.text,-1)-or.system.parseIntDef(e.edtFixColFirst.text,-1)+1),i.DeleteAllow=e.chkDeleteAllow.checked,i.CanResize=e.chkCanResize.checked,i.SelectCellRang.StartRow>=0&&i.SelectCellRang.StartCol>=0&&(i.SelectCellRang.EndCol>0||(i.GetEditCell().CellData.Script=e.mmoScript.Data.SaveToText())),e.setPropertys(i),i.PropertyChange(),i.Change(),t.ActiveSection.ReFormatActiveItem()}finally{t.EndUpdate()}}))}}])&&Hw(e.prototype,i),n&&Hw(e,n),r}(ro);function Xw(t){return(Xw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kw(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Yw(t,e){return(Yw=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Jw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=qw(t);if(e){var o=qw(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Zw(this,i)}}function Zw(t,e){return!e||"object"!==Xw(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function qw(t){return(qw=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Qw=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Yw(t,e)}(r,t);var e,i,n,o=Jw(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,360,480)).caption="DeCombobox属性",t.gridProperty.height=100,t.gridProperty.align=zt,t.pnlButton.align=zt,t.pnlProp=new hn,t.pnlProp.height=130,t.pnlProp.borderVisible=!1,t.pnlProp.align=zt,t.chkAutoSize=new un("自动计算宽高"),t.chkAutoSize.left=23,t.chkAutoSize.top=11,t.chkAutoSize.onSwitch=function(){t.edtWidth.enabled=!t.chkAutoSize.checked,t.edtHeight.enabled=!t.chkAutoSize.checked},t.pnlProp.addControl(t.chkAutoSize);var e=new en("宽(像素)");e.left=131,e.top=13,t.pnlProp.addControl(e),t.edtWidth=new pn,t.edtWidth.left=e.right+5,t.edtWidth.top=10,t.edtWidth.width=32,t.pnlProp.addControl(t.edtWidth);var i=new en("高(像素)");i.left=233,i.top=13,t.pnlProp.addControl(i),t.edtHeight=new pn,t.edtHeight.left=i.right+5,t.edtHeight.top=10,t.edtHeight.width=32,t.pnlProp.addControl(t.edtHeight);var n=new en("边框");n.left=t.chkAutoSize.left,n.top=t.edtWidth.bottom+6,t.pnlProp.addControl(n),t.chkBorderTop=new un("上"),t.chkBorderTop.left=n.right+10,t.chkBorderTop.top=t.edtWidth.bottom+5,t.pnlProp.addControl(t.chkBorderTop),t.chkBorderBottom=new un("下"),t.chkBorderBottom.left=t.chkBorderTop.right+10,t.chkBorderBottom.top=t.chkBorderTop.top,t.pnlProp.addControl(t.chkBorderBottom),t.chkBorderLeft=new un("左"),t.chkBorderLeft.left=t.chkBorderBottom.right+10,t.chkBorderLeft.top=t.chkBorderBottom.top,t.pnlProp.addControl(t.chkBorderLeft),t.chkBorderRight=new un("右"),t.chkBorderRight.left=t.chkBorderLeft.right+10,t.chkBorderRight.top=t.chkBorderLeft.top,t.pnlProp.addControl(t.chkBorderRight),t.edtText=new vn("文本",""),t.edtText.left=n.left-5,t.edtText.top=t.chkBorderRight.bottom+5,t.edtText.width=200,t.pnlProp.addControl(t.edtText),t.chkReadOnly=new un("只读"),t.chkReadOnly.left=t.chkAutoSize.left,t.chkReadOnly.top=t.edtText.bottom+5,t.pnlProp.addControl(t.chkReadOnly),t.chkStatic=new un("只能通过选项赋值"),t.chkStatic.left=t.chkReadOnly.right+10,t.chkStatic.top=t.chkReadOnly.top,t.pnlProp.addControl(t.chkStatic),t.chkDeleteAllow=new un("允许删除"),t.chkDeleteAllow.left=t.chkReadOnly.left,t.chkDeleteAllow.top=t.chkReadOnly.bottom+5,t.pnlProp.addControl(t.chkDeleteAllow),t.chkPrintOnlyText=new un("打印时仅打印文本不打印边框"),t.chkPrintOnlyText.left=t.chkDeleteAllow.right+10,t.chkPrintOnlyText.top=t.chkDeleteAllow.top,t.pnlProp.addControl(t.chkPrintOnlyText),t.chkSaveItem=new un("保存选项(第一列为空的选项无效)"),t.chkSaveItem.left=5,t.chkSaveItem.top=30,t.chkSaveItem.onSwitch=function(){t.gridItem.enabled=t.chkSaveItem.checked},t.pnlButton.height+=15,t.pnlButton.addControl(t.chkSaveItem),t.gridItem=new Mn(1,2),t.gridItem.marginLeft=5,t.gridItem.marginRight=5,t.gridItem.height=130,t.gridItem.align=Kt,t.gridItem.fixRowCount=1,t.gridItem.rows[0][0].value="选项",t.gridItem.rows[0][1].value="选项值(可为空)",t.gridItem.setColWidth(0,100),t.gridItem.setColWidth(1,180),t.pnlItemButton=new hn,t.pnlItemButton.height=40,t.pnlItemButton.borderVisible=!1,t.pnlItemButton.align=Xt;var s=new nn("新增选项");s.left=5,s.top=5,s.width=60,s.onClick=function(){t.gridItem.rowCount++,t.gridItem.rows.last[0].value="",t.gridItem.rows.last[1].value=""},t.pnlItemButton.addControl(s);var a=new nn("删除选项");a.left=s.right+10,a.top=s.top,a.width=60,a.onClick=function(){t.gridItem.deleteRow(t.gridItem.row)},t.pnlItemButton.addControl(a);var l=new nn("保存");l.left=a.right+20,l.top=a.top,l.width=55,l.onClick=function(){t.modalResult=no,t.close()},t.pnlItemButton.addControl(l),t.beginUpdate();try{var h=[t.clientArea.controls[t.clientArea.controls.length-1],t.clientArea.controls[t.clientArea.controls.length-2]];t.clientArea.controls[t.clientArea.controls.length-2]=h[0],t.clientArea.controls[t.clientArea.controls.length-1]=h[1],t.clientArea.controls.insert(0,t.pnlProp),t.addControl(t.gridItem),t.addControl(t.pnlItemButton)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetView",value:function(t,e){var i=this;this.beginUpdate();try{""!=e.GetValue(hS)&&(this.caption+="["+e.GetValue(hS)+"]"),this.chkAutoSize.checked=e.AutoSize,this.edtWidth.enabled=!this.chkAutoSize.checked,this.edtHeight.enabled=!this.chkAutoSize.checked,this.edtWidth.text=e.Width.toString(),this.edtHeight.text=e.Height.toString(),this.edtText.text=e.Text,this.chkPrintOnlyText.checked=e.PrintOnlyText,this.chkReadOnly.checked=e.ReadOnly,this.chkStatic.checked=e.Static,this.chkDeleteAllow.checked=e.DeleteAllow,this.chkBorderLeft.checked=e.BorderSides.has(fp.Left),this.chkBorderTop.checked=e.BorderSides.has(fp.Top),this.chkBorderRight.checked=e.BorderSides.has(fp.Right),this.chkBorderBottom.checked=e.BorderSides.has(fp.Bottom),this.getPropertys(e.Propertys),this.chkSaveItem.checked=e.SaveItem,this.gridItem.rowCount=e.Items.count+1;for(var n=1;n<=e.ItemValues.count;n++)this.gridItem.rows[n][0].value=e.Items[n-1].text,this.gridItem.rows[n][1].value=e.ItemValues[n-1];this.gridItem.enabled=this.chkSaveItem.checked,this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){if(e.AutoSize=i.chkAutoSize.checked,i.chkAutoSize.checked||(e.Width=or.system.parseIntDef(i.edtWidth.text,e.width),e.Height=or.system.parseIntDef(i.edtHeight.text,e.Height)),e.Text=i.edtText.text,i.chkBorderLeft.checked?e.BorderSides.add(fp.Left):e.BorderSides.remove(fp.Left),i.chkBorderTop.checked?e.BorderSides.add(fp.Top):e.BorderSides.remove(fp.Top),i.chkBorderRight.checked?e.BorderSides.add(fp.Right):e.BorderSides.remove(fp.Right),i.chkBorderBottom.checked?e.BorderSides.add(fp.Bottom):e.BorderSides.remove(fp.Bottom),e.PrintOnlyText=i.chkPrintOnlyText.checked,e.DeleteAllow=i.chkDeleteAllow.checked,e.ReadOnly=i.chkReadOnly.checked,e.Static=i.chkStatic.checked,i.setPropertys(e.Propertys),e.Items.clear(),e.ItemValues.clear(),e.SaveItem=i.chkSaveItem.checked,i.chkSaveItem.checked)for(var n,o=1;o<i.gridItem.rowCount;o++)""!=(n=lp.HCDeleteBreak(i.gridItem.rows[o][0].value).trim())&&(e.Items.add(n),e.ItemValues.add(lp.HCDeleteBreak(i.gridItem.rows[o][1].value)));t.BeginUpdate();try{t.ActiveSection.ReFormatActiveItem()}finally{t.EndUpdate()}}))}}])&&Kw(e.prototype,i),n&&Kw(e,n),r}(ug);function $w(t){return($w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tC(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function eC(t,e){return(eC=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function iC(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=oC(t);if(e){var o=oC(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return nC(this,i)}}function nC(t,e){return!e||"object"!==$w(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function oC(t){return(oC=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var rC=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&eC(t,e)}(r,t);var e,i,n,o=iC(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,360,320)).caption="DeDateTime属性",t.chkAutoSize=new un("自动计算宽高"),t.chkAutoSize.left=23,t.chkAutoSize.top=11,t.chkAutoSize.onSwitch=function(){t.edtWidth.enabled=!t.chkAutoSize.checked,t.edtHeight.enabled=!t.chkAutoSize.checked};var e=new en("宽(像素)");e.left=131,e.top=13,t.edtWidth=new pn,t.edtWidth.left=e.right+5,t.edtWidth.top=10,t.edtWidth.width=32;var i=new en("高(像素)");i.left=233,i.top=13,t.edtHeight=new pn,t.edtHeight.left=i.right+5,t.edtHeight.top=10,t.edtHeight.width=32;var n=new en("边框");n.left=t.chkAutoSize.left,n.top=t.edtWidth.bottom+6,t.chkBorderTop=new un("上"),t.chkBorderTop.left=n.right+10,t.chkBorderTop.top=t.edtWidth.bottom+5,t.chkBorderBottom=new un("下"),t.chkBorderBottom.left=t.chkBorderTop.right+10,t.chkBorderBottom.top=t.chkBorderTop.top,t.chkBorderLeft=new un("左"),t.chkBorderLeft.left=t.chkBorderBottom.right+10,t.chkBorderLeft.top=t.chkBorderBottom.top,t.chkBorderRight=new un("右"),t.chkBorderRight.left=t.chkBorderLeft.right+10,t.chkBorderRight.top=t.chkBorderLeft.top,t.chkDeleteAllow=new un("允许删除"),t.chkDeleteAllow.left=t.chkAutoSize.left,t.chkDeleteAllow.top=t.chkBorderRight.bottom+5,t.chkPrintOnlyText=new un("打印时仅打印文本不打印边框"),t.chkPrintOnlyText.left=t.chkDeleteAllow.right+10,t.chkPrintOnlyText.top=t.chkDeleteAllow.top,t.beginUpdate();try{t.addControl(t.chkAutoSize),t.addControl(e),t.addControl(t.edtWidth),t.addControl(i),t.addControl(t.edtHeight),t.addControl(n),t.addControl(t.chkBorderTop),t.addControl(t.chkBorderBottom),t.addControl(t.chkBorderLeft),t.addControl(t.chkBorderRight),t.addControl(t.chkDeleteAllow),t.addControl(t.chkPrintOnlyText)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetView",value:function(t,e){var i=this;this.beginUpdate();try{""!=e.GetValue(hS)&&(this.caption+="["+e.GetValue(hS)+"]"),this.chkAutoSize.checked=e.AutoSize,this.edtWidth.enabled=!this.chkAutoSize.checked,this.edtHeight.enabled=!this.chkAutoSize.checked,this.edtWidth.text=e.Width.toString(),this.edtHeight.text=e.Height.toString(),this.chkPrintOnlyText.checked=e.PrintOnlyText,this.chkDeleteAllow.checked=e.DeleteAllow,this.chkBorderLeft.checked=e.BorderSides.has(fp.Left),this.chkBorderTop.checked=e.BorderSides.has(fp.Top),this.chkBorderRight.checked=e.BorderSides.has(fp.Right),this.chkBorderBottom.checked=e.BorderSides.has(fp.Bottom),this.getPropertys(e.Propertys),this.moveCenter()}finally{this.endUpdate()}this.showModal((function(){e.AutoSize=i.chkAutoSize.checked,i.chkAutoSize.checked||(e.Width=or.system.parseIntDef(i.edtWidth.text,e.width),e.Height=or.system.parseIntDef(i.edtHeight.text,e.Height)),i.chkBorderLeft.checked?e.BorderSides.add(fp.Left):e.BorderSides.remove(fp.Left),i.chkBorderTop.checked?e.BorderSides.add(fp.Top):e.BorderSides.remove(fp.Top),i.chkBorderRight.checked?e.BorderSides.add(fp.Right):e.BorderSides.remove(fp.Right),i.chkBorderBottom.checked?e.BorderSides.add(fp.Bottom):e.BorderSides.remove(fp.Bottom),e.PrintOnlyText=i.chkPrintOnlyText.checked,e.DeleteAllow=i.chkDeleteAllow.checked,i.setPropertys(e.Propertys),t.BeginUpdate();try{t.ActiveSection.ReFormatActiveItem()}finally{t.EndUpdate()}}))}}])&&tC(e.prototype,i),n&&tC(e,n),r}(ug);function sC(t){return(sC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aC(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function lC(t,e){return(lC=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function hC(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=uC(t);if(e){var o=uC(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return cC(this,i)}}function cC(t,e){return!e||"object"!==sC(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function uC(t){return(uC=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var fC=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&lC(t,e)}(r,t);var e,i,n,o=hC(r);function r(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,300,400)).caption="文档结构",t.captionBar.transparent=!1,t.captionBar.color=at.LightGray,t.onPaintBackground=function(e){or.theme.drawShadow(e,U.CreateByBounds(0,0,t.width,t.height),!1)},t.btnRefresh=t.captionBar.addButton("刷新"),t.btnRefresh.align_=jt,t.btnRefresh.autoWidth=!0,t.btnRefresh._marginRight=5,t.btnRefresh.onClick=function(){t.RebuildDocTree()},t.FEmrView=null,t.FTree=new Gn,t.FTree.borderVisible_=!1,t.FTree.align=Kt,t.beginUpdate();try{t.addControl(t.FTree)}finally{t.endUpdate()}return t}return e=r,(i=[{key:"SetView",value:function(t){var e=this;this.FEmrView=t,this.RebuildDocTree(),this.FTree.onDblClick=function(t){e.FTree.selectNode&&e.FTree.selectNode.object&&e.FEmrView.ScrollToItem(e.FTree.selectNode.object)},this.moveCenter(),this.show()}},{key:"RebuildDocTree",value:function(){var t=this;this.FTree.nodes.clear();var e=new $l;e.Areas.add(dp.Page);var i=null,n=-1,o=null,r=new W;e.Process=function(s,a,l,h,c){if(e.SectionIndex!=n&&(n=e.SectionIndex,o=t.FTree.addNode("第"+(n+1).toString()+"节"),r.push(o)),(i=s.Items[a]).StyleNo>cs.Null)i.Index&&r.peek().addNode(i.Name+"("+i.Text+")",i);else if(i.StyleNo==cs.Domain)if(za.IsBeginMark(i)){var u=null;u=i.IsProcBegin?r.peek().addNode("[病程]"+i.Name,i):r.peek().addNode("[数据组]"+i.Name,i),r.push(u)}else r.pop();else i.StyleNo!=cs.Image&&i.StyleNo!=cs.Table&&i.StyleNo!=cs.CheckBox&&i.StyleNo!=cs.Edit&&i.StyleNo!=cs.Combobox&&i.StyleNo!=cs.DateTimePicker&&i.StyleNo!=cs.RadioGroup||i.Index&&(i.Name?r.peek().addNode(i.Name+"("+i.Text+")",i):r.peek().addNode("非文本("+i.Text+")",i))},this.FEmrView.TraverseItem(e),o.expand=!0}}])&&aC(e.prototype,i),n&&aC(e,n),r}(ro);function dC(t){return(dC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mC(t,e){return(mC=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function yC(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=SC(t);if(e){var o=SC(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return pC(this,i)}}function pC(t,e){return!e||"object"!==dC(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function SC(t){return(SC=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function vC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function FC(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function IC(t,e,i){return e&&FC(t.prototype,e),i&&FC(t,i),t}var gC=function(){function t(){vC(this,t)}return IC(t,[{key:"Contains",value:function(t,e){return(t&e)==e}}]),t}();gC.WriteTraceInfo=1,gC.HideTrace=2;var wC=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&mC(t,e)}(i,t);var e=yC(i);function i(t,n){var o;return vC(this,i),(o=e.call(this,t,n)).state_.add(vi.Creating),o.captionBar.captureParent=!1,o.captionBar.controls.clear(),o.UseAnnotate=!1,o.keyPreview=!0,o.FMouseInElementFire=!1,o.frmRecordPop=null,o.FEmrView=null,o.cbbFont=null,o.cbbFontSize=null,o.cbbFontColor=null,o.btnBold=null,o.btnItalic=null,o.btnUnderline=null,o.btnStrikeOut=null,o.btnSuperscript=null,o.btnSubscript=null,o.btnAlignLeft=null,o.btnAlignRight=null,o.btnAlignCenter=null,o.btnAlignJustify=null,o.btnAlignScatter=null,o.ObjectData=null,o.OnDeItemPopup=null,o.OnCaretChange=null,o.OnChangedSwitch=null,o.OnReadOnlySwitch=null,o.OnSetDeItemText=null,o.OnSave=null,o.OnPrint=null,o.OnPrintCurPage=null,o.OnPrintOdd=null,o.OnPrintEven=null,o.OnPrintCurLine=null,o.OnPrintSelect=null,o.OnDeItemGetSyncValue=null,o.OnSaveStructure=null,o.OnInsertDeItem=null,o.OnDeComboboxPopup=null,o.OnEmrViewKeyDown=null,o.OnMouseUpLib=null,o.OnViewMenuPopup=null,o.OnPopupFormClose=null,o.OnExternalDeItemPopupLib=null,o._initilization(),o.state_.delete(vi.Creating),o}return IC(i,[{key:"_openFileDialog",value:function(){var t=this;ao.execute(C.stringFormat("{0},{1},{2}",I.XML,I.DOCX,".hcf"),(function(e){t.FEmrView.LoadFromFile(e.firstFile)}))}},{key:"_initilization",value:function(){var t=this,e=new _n;e.dropDownStyle=!0,e.addItem("表格").onClick=function(){var e=new Jp;e.showModal((function(){var i=t.FEmrView.ActiveSectionTopLevelData(),n=new GS(i,e.edtRowCount.number,e.edtColCount.number,i.Width);t.FEmrView.InsertItem(n)}))},e.addItem("图片").onClick=function(){ao.execute(C.stringFormat("{0}",I.IMAGE),(function(e){var i=or.waitMessage("正在插入图片,请稍候...",(function(){t.enabled=!1;var n=t.FEmrView.ActiveSectionTopLevelData(),o=new YS(n);o.LoadGraphicFile(e.firstFile,(function(e){e&&(o.RestrainSize(n.Width,o.Height),t.FEmrView.InsertItem(o)),t.enabled=!0,or.endWaitMessage(i)}))}))}))};var i=e.addItem("医学公式");i.hint="插入各类医学公式",i.addItem("月经史").onClick=function(){t.InsertDeYueJingItem("12","5-6",X.Now().format("yyyy-M-d"),"28-30")},i.addItem("牙位").onClick=function(){t.InsertDeToothItem("XX","XX","XX","XX")},i.addItem("房角").onClick=function(){t.InsertDeFangJiaoItem("","","","")},i.addItem("中药").onClick=function(){t.InsertDeCnDrugItem("20g","先煎")},e.addItem("横线").onClick=function(){t.FEmrView.InsertLine(1)};var n=e.addItem("控件");n.hint="插入各类控件",n.addItem("CheckBox").onClick=function(){var e=new HS(t.FEmrView.ActiveSectionTopLevelData(),"勾选框",!1);t.FEmrView.InsertItem(e)},n.addItem("Combobox").onClick=function(){var e=new WS(t.FEmrView.ActiveSectionTopLevelData(),"下拉选择");e.Items.add("选项1"),e.Items.add("选项2"),e.Items.add("选项3"),e.Items.add("选项4"),e.Items.add("选项5"),e.Items.add("选项6"),t.FEmrView.InsertItem(e)},n.addItem("DateTimePicker").onClick=function(){var e=new zS(t.FEmrView.ActiveSectionTopLevelData(),X.Now());t.FEmrView.InsertItem(e)},n.addItem("RadioGroup").onClick=function(){var e=new jS(t.FEmrView.ActiveSectionTopLevelData());e.AddItem("选项1"),e.AddItem("选项2"),e.AddItem("选项3"),t.FEmrView.InsertItem(e)},n.addItem("Edit").onClick=function(){var e=new VS(t.FEmrView.ActiveSectionTopLevelData(),"文本框");t.FEmrView.InsertItem(e)},n.addItem("Button").onClick=function(){var e=new US(t.FEmrView.ActiveSectionTopLevelData(),"按钮");t.FEmrView.InsertItem(e)},e.addItem("分页").onClick=function(){t.FEmrView.InsertPageBreak()},e.addItem("分节").onClick=function(){t.FEmrView.InsertSectionBreak()},e.addItem("文档").onClick=function(){ao.execute(C.stringFormat("{0}",".hcf"),(function(e){K.loadFromFile(e.firstFile,(function(e){t.FEmrView.InsertStream(e)}))}))};var o=e.addItem("条码");o.addItem("一维码").onClick=function(){var e=new Dd(t.FEmrView.ActiveSectionTopLevelData(),"123");t.FEmrView.InsertItem(e)},o.addItem("二维码").onClick=function(){var e=new od(t.FEmrView.ActiveSectionTopLevelData(),"12Ab你好");t.FEmrView.InsertItem(e)};var r=e.addItem("浮动对象");r.addItem("直线").onClick=function(){var e=new Lm(t.FEmrView.ActiveSection.ActiveData);t.FEmrView.InsertFloatItem(e)},r.addItem("一维码").onClick=function(){var e=new XS(t.FEmrView.ActiveSection.ActiveData);t.FEmrView.InsertFloatItem(e)},r.addItem("二维码").onClick=function(){var e=new KS(t.FEmrView.ActiveSection.ActiveData);t.FEmrView.InsertFloatItem(e)};var s=new _n;s.dropDownStyle=!0,s.onPopup=function(){t.menuDeleteSection.visible=t.FEmrView.Sections.count>1};var a=s.addItem("打开");a.hint="打开本地文件",a.onClick=function(){t.PopupFormClose(),t._openFileDialog()},s.addItem("新建").onClick=function(){t.FEmrView.Clear()},s.addItem("另存为").onClick=function(){var e=new K;t.FEmrView.SaveToStream(e,!1);var i=new Uint8Array(e.buffer),n=new Blob([i],{type:"application/octet-stream"}),o=window.URL.createObjectURL(n),r=document.createElement("a");document.body.appendChild(r),r.href=o,r.download="HCView H5.hcf",r.click(),window.URL.revokeObjectURL(n),document.body.removeChild(r)},this.menuExportFile=s.addItem("导出"),this.menuExportFile.addItem("XML").onClick=function(){t.DoExportXML()},this.menuExportFile.addItem("文本").onClick=function(){t.DoExportTXT()},this.menuExportFile.addItem("HTML").onClick=function(){t.DoExportHTML()},this.menuExportFile.addItem("PDF").onClick=function(){t.DoExportPDF()},this.menuExportFile.visible=!1,this.menuImplortFile=s.addItem("导入"),this.menuImplortFile.addItem("XML").onClick=function(){t.DoImportXML()},this.menuImplortFile.addItem("文本").onClick=function(){t.DoImportTXT()},this.menuImplortFile.visible=!1,s.addItem("页面设置").onClick=function(){(new ZI).SetView(t.FEmrView)},this.menuDeleteSection=s.addItem("删除当前节"),this.menuDeleteSection.onClick=function(){t.FEmrView.DeleteActiveSection()},this.btnFile=new an("文件"),this.btnFile.image.src=or.emrCommon.homePath+"image/file.png",this.btnFile.textVisible=!0,this.btnFile.hint="文档处理",this.btnFile.dropDownMenu=s,this.captionBar.addControl(this.btnFile),this.btnSave=this.captionBar.addButton("保存",!0,or.emrCommon.homePath+"image/save.png"),this.btnSave.onClick=function(){t.DoSave()};var l=new _n;l.dropDownStyle=!0,l.addItem("全部").onClick=function(){t.Print()},l.addItem("当前页").onClick=function(){t.PrintCurPage()},l.addItem("指定页码或范围").onClick=function(){t.DoPrintPageRange(t.FEmrView)},l.addSpliter(),l.addItem("奇数页(顺序)").onClick=function(){t.DoPrintOdd(t.FEmrView,!1)},l.addItem("奇数页(倒序)").onClick=function(){t.DoPrintOdd(t.FEmrView,!0)},l.addSpliter(),l.addItem("偶数页(顺序)").onClick=function(){t.DoPrintEven(t.FEmrView,!1)},l.addItem("偶数页(倒序)").onClick=function(){t.DoPrintEven(t.FEmrView,!0)},l.addSpliter(),l.addItem("当前行-当前页").onClick=function(){t.DoPrintCurLine(t.FEmrView)},l.addItem("当前行-最后页").onClick=function(){t.DoPrintCurLine(t.FEmrView,t.FEmrView.PageCount)},l.addItem("当前页选中内容").onClick=function(){t.DoPrintSelect(t.FEmrView)};var h=l.addItem("预览");h.addItem("全部").onClick=function(){t.PrintView()};var c=h.addItem("当前病程");c.onClick=function(){t.PrintView(t.FEmrView.FCaretProcInfo.SectionIndex,t.FEmrView.FCaretProcInfo.Index)},l.onPopup=function(){c.enabled=""!=t.FEmrView.FCaretProcInfo.Index},this.btnPrint=new an("打印"),this.btnPrint.image.src=or.emrCommon.homePath+"image/print.png",this.btnPrint.textVisible=!0,this.btnPrint.hint="文档打印",this.btnPrint.dropDownMenu=l,this.captionBar.addControl(this.btnPrint),this.btnInsert=new an("插入"),this.btnInsert.textVisible=!0,this.btnInsert.hint="插入功能",this.btnInsert.dropDownMenu=e,this.captionBar.addControl(this.btnInsert),this.captionBar.addSpliter(),this.captionBar.addButton("撤销",!1,or.emrCommon.homePath+"image/undo.png").onClick=function(){t.FEmrView.Undo()},this.captionBar.addButton("恢复",!1,or.emrCommon.homePath+"image/redo.png").onClick=function(){t.FEmrView.Redo()},this.captionBar.addSpliter(),this.cbbZoom=new Cn("100%"),this.cbbZoom.align=Wt,this.cbbZoom.static=!0,this.cbbZoom.width=48,this.cbbZoom.dropDownWidth=this.cbbZoom.width+5,this.cbbZoom.addItem("25%"),this.cbbZoom.addItem("50%"),this.cbbZoom.addItem("75%"),this.cbbZoom.addItem("100%"),this.cbbZoom.addItem("125%"),this.cbbZoom.addItem("150%"),this.cbbZoom.addItem("200%"),this.cbbZoom.addItem("300%"),this.cbbZoom.addItem("500%"),this.cbbZoom.onSelectedIndexChange=function(){var e=t.cbbZoom.text.replace("%","");t.FEmrView.Zoom=e/100},this.captionBar.addControl(this.cbbZoom),this.cbbFont=new Dn(""),this.cbbFont.static=!0,this.cbbFont.width=56,this.cbbFont.align=Wt,(new ct).detect("Microsoft Himalaya")&&this.cbbFont.addItem("Microsoft Himalaya"),this.cbbFont.onSelectedIndexChange=function(){t.FEmrView.ApplyTextFontName(t.cbbFont.text)},this.captionBar.addControl(this.cbbFont),this.cbbFontSize=new Cn(""),this.cbbFontSize.static=!0,this.cbbFontSize.width=48,this.cbbFontSize.dropDownWidth=64,this.cbbFontSize.state=!0,this.cbbFontSize.align=Wt,this.cbbFontSize.addItem("初号"),this.cbbFontSize.addItem("小初"),this.cbbFontSize.addItem("一号"),this.cbbFontSize.addItem("小一"),this.cbbFontSize.addItem("二号"),this.cbbFontSize.addItem("小二"),this.cbbFontSize.addItem("三号"),this.cbbFontSize.addItem("小三"),this.cbbFontSize.addItem("四号"),this.cbbFontSize.addItem("小四"),this.cbbFontSize.addItem("五号"),this.cbbFontSize.addItem("小五"),this.cbbFontSize.addItem("10"),this.cbbFontSize.addItem("10.5"),this.cbbFontSize.addItem("11"),this.cbbFontSize.addItem("12"),this.cbbFontSize.addItem("14"),this.cbbFontSize.addItem("16"),this.cbbFontSize.addItem("18"),this.cbbFontSize.addItem("20"),this.cbbFontSize.addItem("22"),this.cbbFontSize.addItem("24"),this.cbbFontSize.addItem("26"),this.cbbFontSize.addItem("28"),this.cbbFontSize.addItem("36"),this.cbbFontSize.addItem("48"),this.cbbFontSize.addItem("72"),this.cbbFontSize.itemIndex=10,this.cbbFontSize.onSelectedIndexChange=function(){t.FEmrView.ApplyTextFontSize(mt.fontSizeToPt(t.cbbFontSize.text))},this.captionBar.addControl(this.cbbFontSize),this.cbbFontColor=new Rn,this.cbbFontColor.align=Wt,this.cbbFontColor.onSelectedIndexChange=function(){t.FEmrView.ApplyTextColor(t.cbbFontColor.color)},this.captionBar.addControl(this.cbbFontColor),this.captionBar.addSpliter(),this.btnBold=this.captionBar.addButton("加粗",!1,or.emrCommon.homePath+"image/bold.png"),this.btnBold.hint="加粗",this.btnBold.onClick=function(){t.FEmrView.ApplyTextStyle(_r)},this.btnItalic=this.captionBar.addButton("倾斜",!1,or.emrCommon.homePath+"image/italic.png"),this.btnItalic.hint="倾斜",this.btnItalic.onClick=function(){t.FEmrView.ApplyTextStyle(xr)},this.btnUnderline=this.captionBar.addButton("下划线",!1,or.emrCommon.homePath+"image/underline.png"),this.btnUnderline.hint="下划线",this.btnUnderline.onClick=function(){t.FEmrView.ApplyTextStyle(Ar)},this.btnStrikeOut=this.captionBar.addButton("中划线",!1,or.emrCommon.homePath+"image/strikeout.png"),this.btnStrikeOut.hint="中划线",this.btnStrikeOut.onClick=function(){t.FEmrView.ApplyTextStyle(Tr)},this.btnSuperscript=this.captionBar.addButton("上标",!1,or.emrCommon.homePath+"image/superscript.png"),this.btnSuperscript.hint="上标",this.btnSuperscript.onClick=function(){t.FEmrView.ApplyTextStyle(Or)},this.btnSubscript=this.captionBar.addButton("下标",!1,or.emrCommon.homePath+"image/subscript.png"),this.btnSubscript.hint="下标",this.btnSubscript.onClick=function(){t.FEmrView.ApplyTextStyle(Nr)},this.btnFormatBrush=this.captionBar.addButton("格式刷",!1,or.emrCommon.homePath+"image/formatbrush.png"),this.btnFormatBrush.visible=!1,this.btnFormatBrush.hint="格式刷",this.btnFormatBrush.onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData().CurStyleNo;e>cs.Null&&(t.FEmrView.Style.FormatBrushStyleNo=e,t.FEmrView.Style.States.Include(Ip.FormatBrushing))},this.captionBar.addSpliter();var u=this.captionBar.addButton("左缩进",!1,or.emrCommon.homePath+"image/rightindent.png");u.hint="增加左缩进",u.onClick=function(){t.FEmrView.ApplyParaLeftIndentAdd()};var f=this.captionBar.addButton("右缩进",!1,or.emrCommon.homePath+"image/leftindent.png");f.hint="减少左缩进",f.onClick=function(){t.FEmrView.ApplyParaLeftIndentAdd(!1)},this.btnAlignLeft=this.captionBar.addButton("居左",!1,or.emrCommon.homePath+"image/left.png"),this.btnAlignLeft.hint="左对齐",this.btnAlignLeft.onClick=function(){t.FEmrView.ApplyParaAlignHorz(dr)},this.btnAlignCenter=this.captionBar.addButton("居中",!1,or.emrCommon.homePath+"image/center.png"),this.btnAlignCenter.hint="居中对齐",this.btnAlignCenter.onClick=function(){t.FEmrView.ApplyParaAlignHorz(mr)},this.btnAlignRight=this.captionBar.addButton("居右",!1,or.emrCommon.homePath+"image/right.png"),this.btnAlignRight.hint="右对齐",this.btnAlignRight.onClick=function(){t.FEmrView.ApplyParaAlignHorz(yr)},this.btnAlignJustify=this.captionBar.addButton("两端",!1,or.emrCommon.homePath+"image/justify.png"),this.btnAlignJustify.hint="两端对齐",this.btnAlignJustify.onClick=function(){t.FEmrView.ApplyParaAlignHorz(pr)},this.btnAlignScatter=this.captionBar.addButton("分散",!1,or.emrCommon.homePath+"image/scatter.png"),this.btnAlignScatter.hint="分散对齐",this.btnAlignScatter.onClick=function(){t.FEmrView.ApplyParaAlignHorz(Sr)};var d=new _n;d.addItem("单倍").onClick=function(){t.FEmrView.ApplyParaLineSpace(gr.PLS100)},d.addItem("1.15倍").onClick=function(){t.FEmrView.ApplyParaLineSpace(gr.PLS115)},d.addItem("1.5倍").onClick=function(){t.FEmrView.ApplyParaLineSpace(gr.PLS150)},d.addItem("2倍").onClick=function(){t.FEmrView.ApplyParaLineSpace(gr.PLS200)};var m=new an("行间距");m.hint="行间距选项",m.image.src=or.emrCommon.homePath+"image/linespace.png",m.dropDownMenu=d,this.captionBar.addControl(m),this.FContextMenu=new _n,this.FContextMenu.onPopup=function(){null!=t.FEmrView.ActiveSectionTopLevelData().ActiveAnnotate?(Q.enabled=!0,$.enabled=!0):(Q.enabled=!1,$.enabled=!1);var e=t.FEmrView.ActiveSection.ActiveData,i=e.GetActiveFloatItem(),n=e.ReadOnly;if(null==i){j.visible=!1;for(var o=e.GetActiveItem(),r=null,s=o;null!=s&&s.isClass(Wa)&&null!=s.GetActiveData();)null!=r&&(e=r,o=s),r=s.GetActiveData(),s=r.GetActiveItem(),r.ReadOnly&&(n=!0);if(null==r&&(r=e),n){for(var a=0;a<t.FContextMenu.subItems.count;a++)t.FContextMenu.subItems[a].visible=!1;return p.visible=r.SelectExists(),p.enabled=p.visible,void(t.OnViewMenuPopup&&t.OnViewMenuPopup(t.FContextMenu.subItems))}if(F.visible=o.StyleNo==cs.Table,F.visible){var l=o;if(w.enabled=null!=l.GetEditCell(),k.enabled=w.enabled,P.enabled=w.enabled,D.enabled=w.enabled,_.enabled=w.enabled,x.enabled=w.enabled,l.SelectCellRang.EndRow>0){A.enabled=!0;for(var h=l.SelectCellRang.StartRow;h<=l.SelectCellRang.EndRow;h++)if(!l.RowCanDelete(h)){A.enabled=!1;break}}else A.enabled=l.CurRowCanDelete();T.enabled=l.CurColCanDelete(),b.enabled=l.SelectedCellCanMerge(),l.BorderVisible?O.text="隐藏边框":O.text="显示边框"}if(N.enabled=!n,N.visible=N.enabled,p.enabled=r.SelectExists(),p.visible=p.enabled,y.enabled=p.enabled&&!t.FEmrView.ActiveSection.ReadOnly,y.visible=y.enabled,S.enabled=!n&&(or.localStorage.hasKey(lp.HC_EXT)||or.localStorage.hasKey(g)),S.visible=S.enabled,v.enabled=!n&&or.localStorage.hasKey(g),v.visible=v.enabled,W.visible=!1,E.visible=!1,M.visible=!1,L.visible=!1,Y.visible=!1,J.visible=!1,G.visible=!1,U.visible=!1,V.visible=!1,B.visible=!1,z.visible=!1,!n){if(s.isClass(YS))W.visible=!r.ReadOnly&&s.Active,W.text="图片属性";else if(W.visible=!r.ReadOnly&&!r.SelectExists()&&s.isClass(Ja)&&s.Active,W.visible)switch(s.StyleNo){case cs.RadioGroup:W.text="DeRadioGroup属性";break;case cs.Edit:W.text="DeEdit属性";break;case cs.DateTimePicker:W.text="DeDateTiem属性";break;case cs.Combobox:W.text="DeCombobox属性";break;default:W.text="属性("+s.className+")"}s.isClass(ES)&&(s.IsElement&&(E.visible=!0,E.text=s.GetValue(hS)),t.FEmrView.DesignModeEx&&(M.visible=!0,L.visible=!0,r.SelectExists()?(Y.text="运行时禁止编辑",Y.visible=!0,J.text="运行时禁止复制",J.visible=!0):(s.EditProtect?Y.text="运行时允许编辑":Y.text="运行时禁止编辑",Y.visible=!0,s.CopyProtect?J.text="运行时允许复制":J.text="运行时禁止复制",J.visible=!0))),r.ActiveDomain.BeginNo>=0&&!r.Items[r.ActiveDomain.BeginNo].IsProc&&(G.visible=!0,G.text="["+r.Items[r.ActiveDomain.BeginNo].GetValue(hS)+"]",t.FEmrView.DesignModeEx&&(U.visible=!0,V.visible=!0)),s.StyleNo<cs.Null&&(F.visible||W.visible||s.StyleNo==cs.Line&&(z.visible=!0,z.text="横线属性")),B.visible=W.visible||E.visible||G.visible||z.visible,q.enabled=r.SelectExists(),Z.visible=t.UseAnnotate&&!n&&(q.enabled||$.enabled||Q.enabled);for(var c=0;c<t.FContextMenu.subItems.count;c++)1==t.FContextMenu.subItems[c].tag&&(t.FContextMenu.subItems[c].visible=!0);t.OnViewMenuPopup&&t.OnViewMenuPopup(t.FContextMenu.subItems)}}else{for(var u=0;u<t.FContextMenu.subItems.count;u++)t.FContextMenu.subItems[u].visible=!1;n||(j.visible=t.FEmrView.DesignModeEx,i.isClass(XS)&&(j.text="浮动条码"))}};var y=this.FContextMenu.addItem("剪切 Ctrl+X");y.onClick=function(){window.document.execCommand("cut")};var p=this.FContextMenu.addItem("复制 Ctrl+C");p.onClick=function(){window.document.execCommand("copy")};var S=this.FContextMenu.addItem("粘贴 Ctrl+V");S.onClick=function(){t.FEmrView.Paste()};var v=this.FContextMenu.addItem("粘贴为文本");v.onClick=function(){t.FEmrView.PasteAsText()};var F=this.FContextMenu.addItem("表格"),w=F.addItem("上方插入行");w.onClick=function(){t.FEmrView.ActiveTableInsertRowBefor(1)};var k=F.addItem("下方插入行");k.addItem("空行").onClick=function(){t.FEmrView.ActiveTableInsertRowAfter(1)},k.addItem("克隆当前行").onClick=function(){var e=t.FEmrView.ActiveSection.GetActiveRectItem();if(null!=e){var i=-1;if(e.StyleNo==cs.Table&&(i=e.SelectCellRang.StartRow,t.FEmrView.ActiveTableInsertRowAfter(1))){for(var n=0;n<e.ColCount;n++)null!=e.Rows[i][n].CellData&&e.Rows[i+1][n].CellData.Clone(e.Rows[i][n].CellData);t.FEmrView.ActiveSection.ReFormatActiveItem()}}},F.addSpliter();var P=F.addItem("左侧插入列");P.onClick=function(){t.FEmrView.ActiveTableInsertColBefor(1)};var D=F.addItem("右侧插入列");D.onClick=function(){t.FEmrView.ActiveTableInsertColAfter(1)},F.addSpliter();var b=F.addItem("合并单元格");b.onClick=function(){t.FEmrView.MergeTableSelectCells()};var R=F.addItem("对齐方式");R.addItem("顶部左").onClick=function(){t.FEmrView.ApplyTableCellAlign(yp.TopLeft)},R.addItem("顶部居中").onClick=function(){t.FEmrView.ApplyTableCellAlign(yp.TopCenter)},R.addItem("顶部右").onClick=function(){t.FEmrView.ApplyTableCellAlign(yp.TopRight)},R.addItem("居中左").onClick=function(){t.FEmrView.ApplyTableCellAlign(yp.CenterLeft)},R.addItem("居中居中").onClick=function(){t.FEmrView.ApplyTableCellAlign(yp.CenterCenter)},R.addItem("居中右").onClick=function(){t.FEmrView.ApplyTableCellAlign(yp.CenterRight)},R.addItem("底部左").onClick=function(){t.FEmrView.ApplyTableCellAlign(yp.BottomLeft)},R.addItem("底部居中").onClick=function(){t.FEmrView.ApplyTableCellAlign(yp.BottomCenter)},R.addItem("底部右").onClick=function(){t.FEmrView.ApplyTableCellAlign(yp.BottomRight)},F.addSpliter();var _=F.addItem("拆分行");_.onClick=function(){t.FEmrView.ActiveTableSplitCurRow()};var x=F.addItem("拆分列");x.onClick=function(){t.FEmrView.ActiveTableSplitCurCol()},F.addSpliter();var A=F.addItem("删除选中行");A.onClick=function(){var e=t.FEmrView.ActiveSection.ActiveData.GetActiveRectItem();e&&e.StyleNo==cs.Table&&e.SelectCellRang.EndRow>0?t.FEmrView.ActiveTableDeleteRowFrom(e.SelectCellRang.StartRow,e.SelectCellRang.EndRow):t.FEmrView.ActiveTableDeleteCurRow()};var T=F.addItem("删除当前列");T.onClick=function(){t.FEmrView.ActiveTableDeleteCurCol()},F.addSpliter(),F.addItem("边框及背景").onClick=function(){(new $g).SetView(t.FEmrView)};var O=F.addItem("显示/隐藏边框");O.onClick=function(){var e=t.FEmrView.ActiveSection.ActiveData.GetActiveItem();e.isClass(ic)&&(e.BorderVisible=!e.BorderVisible,t.FEmrView.UpdateView())},F.addItem("适应宽度").onClick=function(){var e=t.FEmrView.ActiveSection.ActiveData.GetActiveRectItem();null!=e&&e.AdjustWidth(!0)},F.addItem("属性").onClick=function(){t.DoTablePropertyClick()};var N=this.FContextMenu.addItem("段落");N.onClick=function(){(new ng).SetView(t.FEmrView)},this.FContextMenu.addItem("文档结构").onClick=function(){t.ShowDocTree()};var B=this.FContextMenu.addSpliter(),E=this.FContextMenu.addItem("数据元");E.addItem("重新选择").onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData();t.DoDeItemAutoComplate(e,e.GetActiveItemNo())},E.addItem("引用上文").onClick=function(){var e=t.EmrView.ActiveSectionTopLevelData().GetActiveItem();t.ActiveDeItemSync(e)},E.addItem("更新引用").onClick=function(){if(null!=t.OnDeItemGetSyncValue){var e=t.EmrView.ActiveSectionTopLevelData().GetActiveItem(),i=t.OnDeItemGetSyncValue(e);if(i&&""!=i){t.DoSetActiveDeItemText(e,i,!1)}}},E.addSpliter(),E.addItem("重置").onClick=function(){t.FEmrView.ActiveSectionTopLevelData().GetActiveItem().Reset(),t.FEmrView.ActiveSection.ReFormatActiveItem()};var M=E.addItem("删除");M.onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData();t.FEmrView.DeleteActiveDataItems(e.SelectInfo.StartItemNo)};var L=E.addItem("属性");L.onClick=function(){(new Tg).SetView(t.FEmrView)};var G=this.FContextMenu.addItem("数据组");G.addItem("重新选择").onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData(),i=e.ActiveDomain;t.DoDeGroupAutoComplate(e,i.BeginNo,i.EndNo)};var H=G.addItem("引用上文");H.addItem("引用为文本").onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData(),i=e.ActiveDomain,n=t.FEmrView.GetDeGroupAsText(e.Items[i.BeginNo].Index);n&&(t.FEmrView.SetDataDeGroupText(e,i.BeginNo,i.EndNo,n),t.FEmrView.FormatSection(t.FEmrView.ActiveSectionIndex))},H.addItem("带结构引用").onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData(),i=e.ActiveDomain,n=t.FEmrView.GetDeGroupAsStream(e.Items[i.BeginNo].Index);n&&(n.position=0,t.FEmrView.SetDataDeGroupFromStream(e,i.BeginNo,i.EndNo,n))},G.addSpliter();var U=G.addItem("删除");U.onClick=function(){t.FEmrView.DeleteActiveDomain()};var V=G.addItem("属性");V.onClick=function(){(new aw).SetView(t.FEmrView)};var W=this.FContextMenu.addItem("属性");W.onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData().GetActiveItem();if(e.StyleNo==cs.RadioGroup)(new vg).SetView(t.FEmrView,e);else if(e.StyleNo==cs.Edit){(new Xg).SetView(t.FEmrView,e)}else if(e.StyleNo==cs.DateTimePicker){(new rC).SetView(t.FEmrView,e)}else if(e.StyleNo==cs.Combobox){(new Qw).SetView(t.FEmrView,e)}else if(e.StyleNo==cs.CheckBox){(new _w).SetView(t.FEmrView,e)}else if(e.StyleNo==cs.Image){(new ww).SetView(t.FEmrView,e)}};var z=this.FContextMenu.addItem("RectItem属性");z.onClick=function(){(new Gg).SetView(t.FEmrView)};var j=this.FContextMenu.addItem("浮动对象属性");j.onClick=function(){};var Y=this.FContextMenu.addItem("运行时禁止编辑");Y.onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData();if(e.SelectExists()){for(var i=e.SelectInfo.StartItemNo;i<=e.SelectInfo.EndItemNo;i++)if(e.Items[i].StyleNo<cs.Null)return void or.showMessage("禁止编辑只能应用于文本内容,选中内容中存在非文本对象!");if(e.SelectInfo.StartItemNo==e.SelectInfo.EndItemNo&&0==e.SelectInfo.StartItemOffset&&e.SelectInfo.EndItemOffset==e.GetItemOffsetAfter(e.SelectInfo.StartItemNo))return void(e.Items[e.SelectInfo.StartItemNo].EditProtect=!0);for(var n=e.SelectInfo.StartItemNo;n<=e.SelectInfo.EndItemNo;n++)e.Items[n].EditProtect=!1;var o=e.GetSelectText();o=o.replace(/\r\n/g,"");var r=t.FEmrView.NewDeItem(o);r.EditProtect=!0,t.FEmrView.InsertDeItem(r)}else{var s=e.GetActiveItem();s.EditProtect=!s.EditProtect,t.FEmrView.ActiveItemReAdaptEnvironment()}};var J=this.FContextMenu.addItem("运行时禁止复制");J.onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData();if(e.SelectExists()){for(var i=e.SelectInfo.StartItemNo;i<=e.SelectInfo.EndItemNo;i++)if(e.Items[i].StyleNo<cs.Null)return void or.showMessage("禁止复制只能应用于文本内容,选中内容中存在非文本对象!");if(e.SelectInfo.StartItemNo==e.SelectInfo.EndItemNo&&0==e.SelectInfo.StartItemOffset&&e.SelectInfo.EndItemOffset==e.GetItemOffsetAfter(e.SelectInfo.StartItemNo))return void(e.Items[e.SelectInfo.StartItemNo].CopyProtect=!0);for(var n=e.SelectInfo.StartItemNo;n<=e.SelectInfo.EndItemNo;n++)e.Items[n].CopyProtect=!1;var o=e.GetSelectText();o=o.replace(/\r\n/g,"");var r=t.FEmrView.NewDeItem(o);r.CopyProtect=!0,t.FEmrView.InsertDeItem(r)}else{var s=e.GetActiveItem();s.CopyProtect=!s.CopyProtect,t.FEmrView.ActiveItemReAdaptEnvironment()}};var Z=this.FContextMenu.addItem("批注"),q=Z.addItem("添加");q.onClick=function(){if(t.FEmrView.ActiveSection.SelectExists()){var e=new yw;e.SetAnnotate(null),e.showModal((function(){t.FEmrView.InsertAnnotate(e.edtTitle.text,e.edtText.text)}))}};var Q=Z.addItem("修改");Q.onClick=function(){var e=t.FEmrView.ActiveSectionTopLevelData(),i=e.ActiveAnnotate;if(null!=i){var n=e.Items[i.EndNo],o=new yw;o.SetAnnotate(n),o.showModal((function(){n.Content.Title=o.edtTitle.text,n.Content.Text=o.edtText.text,(n=e.Items[i.BeginNo]).Content.Title=o.edtTitle.text,n.Content.Text=o.edtText.text}))}};var $=Z.addItem("删除");$.onClick=function(){t.FEmrView.DeleteActiveAnnotate()},this.FEmrView=new WI,this.FEmrView.align=Kt,this.FEmrView.popupMenu=this.FContextMenu,this.FEmrView.OnSectionInsertItem=function(e,i,n){t.DoInsertItem(e,i,n)},this.FEmrView.onMouseDown=function(e){t.DoEmrViewMouseDown()},this.FEmrView.onMouseUp=function(e){t.DoEmrViewMouseUp(e)},this.FEmrView.onKeyDown=function(e){t.DoEmrViewKeyDown(e)},this.FEmrView.OnSectionDrawItemMouseMove=function(e,i,n,o,r,s){t.DoSectionDrawItemMouseMove(i,n,r,s)},this.FEmrView.OnCaretChange=function(){t.DoCaretChange()},this.FEmrView.OnVerScroll=function(){t.DoVerScroll()},this.FEmrView.OnHorScroll=function(){t.DoVerScroll()},this.FEmrView.OnChangedSwitch=function(){t.DoChangedSwitch()},this.FEmrView.OnZoomChanged=function(){t.cbbZoom.text=100*t.FEmrView.Zoom+"%"},this.FEmrView.OnSectionPaintPaperBefor=function(e,i,n,o,r){t.DoPaintPaperBefor(e,i,n,o,r)},this.addControl(this.FEmrView)}},{key:"DoHideTraceTraverse",value:function(t,e,i){if(t.Items[e].isClass(ES)){var n=t.Items[e];n.TraceStyle==sS.Del&&(n.Visible=!(i==gC.HideTrace))}}},{key:"SetHideTrace",value:function(t){this.FEmrView.HideTrace!=t&&(this.FEmrView.HideTrace=t)}},{key:"DoCaretChange",value:function(){this.CurTextStyleChange(this.FEmrView.CurStyleNo),this.CurParaStyleChange(this.FEmrView.CurParaNo),this.OnCaretChange&&this.OnCaretChange()}},{key:"DoChangedSwitch",value:function(){this.btnSave.enabled=this.FEmrView.IsChanged,this.btnSave.enabled?this.btnSave.image.src=or.emrCommon.homePath+"image/save.png":this.btnSave.image.src=or.emrCommon.homePath+"image/savedis.png",null!=this.OnChangedSwitch&&this.OnChangedSwitch(this)}},{key:"DoCanNotEdit",value:function(){or.showMessage("当前位置只读、不可编辑!")}},{key:"DoReadOnlySwitch",value:function(t){null!=this.OnReadOnlySwitch&&this.OnReadOnlySwitch(t)}},{key:"DoVerScroll",value:function(){this.PopupFormClose()}},{key:"DoPaintPaperBefor",value:function(t,e,i,n,o){t.ReadOnly&&(n.font.size=24,n.font.color=at.Gray,n.font.name="隶书",n.textOut(i.left+10,i.top+10,"只读"))}},{key:"SetDeItemText_",value:function(t,e,i,n,o){this.FEmrView.UndoGroupBegin();try{this.FEmrView.SetActiveItemText(o),t.UndoItemMirror(e,i),n.HasProp(mS)&&n.SetValue(mS,""),n.AllocValue=!0}finally{this.FEmrView.UndoGroupEnd()}}},{key:"DoInsertTextBefor",value:function(t,e,i,n){var o=t.Items[e];return!(o.isClass(ES)&&o.IsElement&&!o.AllocValue&&o.IsSelectComplate)||(this.SetDeItemText_(t,e,i,o,n),!1)}},{key:"DoSyntaxPaint",value:function(t,e,i){t.Problem==OS?i.brush.color=at.Red:i.brush.color=at.Blue,i.fillRect(e)}},{key:"DoPasteRequest",value:function(){return!0}},{key:"DoSetActiveDeItemText",value:function(t,e){if(null!=this.OnSetDeItemText){var i=this.OnSetDeItemText(t,e);return i||this.FEmrView.SetActiveItemText(e),i}return this.FEmrView.SetActiveItemText(e),!1}},{key:"DoSetActiveDeItemExtra",value:function(t){this.FEmrView.SetActiveItemExtra(t)}},{key:"ActiveDeItemSync",value:function(t){var e=!1,i=this.FEmrView.FindSameDeItem(t);return null!=i&&(t.SetValue(mS,i.GetValue(mS)),this.FEmrView.SetActiveItemText(i.Text),e=!0),e}},{key:"RecordPop",value:function(){var t=this;return null==this.frmRecordPop&&(this.frmRecordPop=new ev,this.frmRecordPop.OnSetPopupItemText=function(e,i){return e.StyleNo<cs.Null?(t.FEmrView.InsertText(i),!1):t.DoSetActiveDeItemText(e,i)},this.frmRecordPop.OnSetActiveItemExtra=function(e,i){t.DoSetActiveDeItemExtra(i)},this.frmRecordPop.onHide=function(){t.FEmrView.setFocus(),t.FEmrView.Style.UpdateInfoReCaret(),t.FEmrView.Style.UpdateInfoRePaint(),t.FEmrView.MapChange()},this.addControl(this.frmRecordPop)),this.frmRecordPop}},{key:"DoDeComboboxPopupItem",value:function(t){if(null!=this.OnDeComboboxPopup)return this.OnDeComboboxPopup(t)}},{key:"CurTextStyleChange",value:function(t){if(t>=0){var e=this.FEmrView.Style.TextStyles[t];this.cbbFont.itemIndex=this.cbbFont.items.indexOf(e.Family),this.cbbFontSize.itemIndex=this.cbbFontSize.items.indexOf(mt.fontPtToSize(e.Size)),this.cbbFontColor.color=e.Color,this.btnBold.checked=e.FontStyles.has(ht.Bold),this.btnItalic.checked=e.FontStyles.has(ht.Italic),this.btnUnderline.checked=e.FontStyles.has(ht.Underline),this.btnStrikeOut.checked=e.FontStyles.has(ht.StrikeOut),this.btnSuperscript.checked=e.FontStyles.has(ht.SuperScript),this.btnSubscript.checked=e.FontStyles.has(ht.SubScript)}else this.btnBold.checked=!1,this.btnItalic.checked=!1,this.btnUnderline.checked=!1,this.btnStrikeOut.checked=!1,this.btnSuperscript.checked=!1,this.btnSubscript.checked=!1}},{key:"CurParaStyleChange",value:function(t){if(t>=0){var e=this.FEmrView.Style.ParaStyles[t].AlignHorz;this.btnAlignLeft.checked=e==dr,this.btnAlignRight.checked=e==yr,this.btnAlignCenter.checked=e==mr,this.btnAlignJustify.checked=e==pr,this.btnAlignScatter.checked=e==Sr}}},{key:"DoTablePropertyClick",value:function(){(new jw).SetView(this.FEmrView)}},{key:"PopupFormClose",value:function(){null!=this.frmRecordPop&&this.frmRecordPop.visible?this.frmRecordPop.visible=!1:null!=this.OnPopupFormClose&&this.OnPopupFormClose()}},{key:"DoDeItemPopup",value:function(t){return null==this.OnDeItemPopup||this.OnDeItemPopup(t)}},{key:"PopupDeCombobox",value:function(){}},{key:"DoSectionDrawItemMouseMove",value:function(t,e,i,n){if(this.FMouseInElementFire=!1,!(t.Items[e].StyleNo<cs.Null)&&t.Items[e].IsElement){var o=t.GetDrawItemText(i),r=o.length;if(1==r){var s=U.CreateByRect(t.DrawItems[i].rect);s.offset(-s.left,-s.top);var a=this.FEmrView.Style.TempCanvas.textWidth(o);n.x>a/3&&n.x<s.right-a/3&&(lp.GCursor=re,this.FMouseInElementFire=!0)}else if(r>1){var l=U.CreateByRect(t.DrawItems[i].rect);l.offset(-l.left,-l.top),this.FEmrView.Style.TextStyles[t.Items[e].StyleNo].ApplyStyle(this.FEmrView.Style.TempCanvas);var h=this.FEmrView.Style.TempCanvas.textWidth(o[0]),c=this.FEmrView.Style.TempCanvas.textWidth(o.charAt(r-1));n.x>h/2&&n.x<l.right-c/2&&(lp.GCursor=re,this.FMouseInElementFire=!0)}}}},{key:"DoEmrViewMouseDown",value:function(){this.PopupFormClose()}},{key:"DoEmrViewMouseUp",value:function(t){if(t.button!=ie){var e=this.FEmrView.ActiveSectionTopLevelData();if(e.CanEdit()){var i=e.GetActiveItem();if(null!=i&&!i.EditProtect&&(this.OnMouseUpLib&&e.SelectInfo.EndItemNo<0&&!e.SelectInfo.StartRestrain&&this.OnMouseUpLib(t,i),i.isClass(ES)))if(i.TraceStyle!=sS.None);else if(i.Active&&""!=i.Index&&!i.IsSelectComplate&&!i.IsSelectPart&&this.FMouseInElementFire){if(or.keyDownStates[_e]&&this.ActiveDeItemSync(i))return;if(lp.DEITEMINPUT)return;if("1"==i.GetValue(wS)&&i.Frmtp==kS&&i.AllocValue)return;var n=this.FEmrView.GetTopLevelDrawItemViewCoord(),o=this.FEmrView.GetTopLevelDrawItem();if(U.CreateByBounds(n.x,n.y,this.FEmrView.ZoomIn(o.rect.width),this.FEmrView.ZoomIn(o.rect.height)).pointInAt(t.x,t.y)&&this.DoDeItemPopup(i)){if(n.x+=this.FEmrView.left,n.y=n.y+this.FEmrView.top+this.FEmrView.ZoomIn(o.height),null!=this.OnExternalDeItemPopupLib&&this.OnExternalDeItemPopupLib(i,n.x,n.y+(this.captionBar.visible?this.captionBar.height:0)))return;if(!this.RecordPop().PopupDeItem(i,n)){if(e.SelectExists())return;i.AllocValue||e.SetSelectBound(e.SelectInfo.StartItemNo,0,e.SelectInfo.StartItemNo,e.GetItemOffsetAfter(e.SelectInfo.StartItemNo),!1)}}}}}}},{key:"DoEmrViewKeyDown",value:function(t){this.OnEmrViewKeyDown&&this.OnEmrViewKeyDown(t),t.keyCode==be&&this.ActiveDeItemAutoComplate()}},{key:"DoDeGroupAutoComplate",value:function(t,e,i){if(t.CanEdit()){var n=t.Items[e];if(this.DoDeItemPopup(n)){this.FEmrView.Style.UpdateInfoReCaret(!1),this.FEmrView.Style.UpdateInfoReScroll(),t.SetSelectBound(e,lp.OffsetAfter,i,lp.OffsetBefor,!1),this.FEmrView.MapChange();var o=this.FEmrView.GetTopLevelDrawItem(),r=this.FEmrView.GetTopLevelDrawItemViewCoord();r.x+=this.FEmrView.left,r.y=r.y+this.FEmrView.top+this.FEmrView.ZoomIn(o.height),this.RecordPop().PopupDeItem(n,r)||this.PopupFormClose()}else this.PopupFormClose()}}},{key:"DoDeItemAutoComplate",value:function(t,e){if(t.CanEdit()){var i=t.Items[e];if(i.IsElement&&!i.EditProtect)if(this.DoDeItemPopup(i)){this.FEmrView.Style.UpdateInfoReCaret(!1),this.FEmrView.Style.UpdateInfoReScroll(),t.SetSelectBound(e,0,e,0,!1),this.FEmrView.MapChange();var n=this.FEmrView.GetTopLevelDrawItem(),o=this.FEmrView.GetTopLevelDrawItemViewCoord();o.x+=this.FEmrView.left,o.y=o.y+this.FEmrView.top+this.FEmrView.ZoomIn(n.height),this.RecordPop().PopupDeItem(i,o)||this.PopupFormClose()}else this.PopupFormClose()}}},{key:"ActiveDeItemAutoComplate",value:function(){var t=this.FEmrView.ActiveSectionTopLevelData();if(t.CanEdit()){var e=t.GetActiveItemNo();t.Items[e].StyleNo>cs.Null&&t.Items[e].IsElement&&this.DoDeItemAutoComplate(t,e)}}},{key:"NextDeItemAutoComplate",value:function(){var t=this.FEmrView.ActiveSectionTopLevelData();if(t.CanEdit()){for(var e=t.GetActiveItemNo()+1;e<t.Items.count;e++)if(t.Items[e].StyleNo>cs.Null&&t.Items[e].IsElement)return void this.DoDeItemAutoComplate(t,e);this.PopupFormClose()}}},{key:"PrevDeItemAutoComplate",value:function(){var t=this.FEmrView.ActiveSectionTopLevelData();if(t.CanEdit()){for(var e=t.GetActiveItemNo()-1;e>=0;e--)if(t.Items[e].StyleNo>cs.Null&&t.Items[e].IsElement)return void this.DoDeItemAutoComplate(t,e);this.PopupFormClose()}}},{key:"DoInsertItem",value:function(t,e,i){var n=this;i.isClass(WS)&&(i.OnPopupItem=function(t){return n.DoDeComboboxPopupItem(t)}),null!=this.OnInsertDeItem&&this.OnInsertDeItem(t,e,i)}},{key:"DoSave",value:function(){null!=this.OnSave&&this.OnSave(this)}},{key:"DoImportXML",value:function(){null!=this.OnImportXML&&this.OnImportXML(this.FEmrView)}},{key:"DoImportTXT",value:function(){null!=this.OnImportTXT&&this.OnImportTXT(this.FEmrView)}},{key:"DoExportXML",value:function(){null!=this.OnExportXML&&this.OnExportXML(this.FEmrView)}},{key:"DoExportTXT",value:function(){null!=this.OnExportTXT&&this.OnExportTXT(this.FEmrView)}},{key:"DoExportHTML",value:function(){null!=this.OnExportHTML&&this.OnExportHTML(this.FEmrView)}},{key:"DoExportPDF",value:function(){null!=this.OnExportPDF&&this.OnExportPDF(this.FEmrView)}},{key:"DoPrint",value:function(t){null!=this.OnPrint&&this.OnPrint(t)}},{key:"DoPrintCurPage",value:function(t){null!=this.OnPrintCurPage&&this.OnPrintCurPage(t)}},{key:"DoPrintPageRange",value:function(t){null!=this.OnPrintPageRange&&this.OnPrintPageRange(t)}},{key:"DoPrintOdd",value:function(t,e){null!=this.OnPrintOdd&&this.OnPrintOdd(t,e)}},{key:"DoPrintEven",value:function(t,e){null!=this.OnPrintEven&&this.OnPrintEven(t,e)}},{key:"DoPrintCurLine",value:function(t,e){null!=this.OnPrintCurLine&&this.OnPrintCurLine(t,e)}},{key:"DoPrintSelect",value:function(t){null!=this.OnPrintSelect&&this.OnPrintSelect(t)}},{key:"DoSaveStructure",value:function(){null!=this.OnSaveStructure&&this.OnSaveStructure(this)}},{key:"PrintView",value:function(t,e){var i=this,n=new Pg;n.OnPrint=function(t){i.DoPrint(t)},n.OnPrintCurPage=function(t){i.DoPrintCurPage(t)},n.OnPrintOdd=function(t){i.DoPrintOdd(t,!1)},n.OnPrintEven=function(t){i.DoPrintEven(t,!1)},n.OnPrintCurLine=function(t,e){i.DoPrintCurLine(t,e)},n.OnPrintSelect=function(t){i.DoPrintSelect(t)},n.SetView(this.FEmrView,t,e)}},{key:"InsertDeItem",value:function(t,e,i){if(""==t||""==e)return or.showMessage("要插入的数据元索引和名称不能为空!"),null;var n=this.FEmrView.NewDeItem(e);return n.SetValue(aS,t),n.SetValue(hS,e),i.Text&&""!=i.Text.toString()&&(n.Text=i.Text.toString(),n.AllocValue=!0),i.Code&&n.SetValue(lS,i.Code),null!=i.AllocValue&&(!0===i.AllocValue||"1"===i.AllocValue?n.AllocValue=!0:n.AllocValue=!1),null!=i.AllocOnly&&(n.AllocOnly=i.AllocOnly),i.Frmtp&&n.SetValue(cS,i.Frmtp),i.Unit&&n.SetValue(uS,i.Unit),i.ItemMutex&&n.SetValue(xS,i.ItemMutex),i.MutexYes&&n.SetValue(AS,i.MutexYes),i.MutexNo&&n.SetValue(TS,i.MutexNo),i.CMV&&n.SetValue(dS,i.CMV),i.CMVVCode&&n.SetValue(mS,i.CMVVCode),null!=i.DeleteAllow&&(n.DeleteAllow=i.DeleteAllow),i.EditProtect&&(n.EditProtect=i.EditProtect),i.CopyProtect&&(n.CopyProtect=i.CopyProtect),i.OutOfRang&&(n.OutOfRang=i.OutOfRang),i.ItemEditValue&&n.SetValue(wS,i.ItemEditValue),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,n):lp.SetItemPropertyString(i.Propertys,n)),this.FEmrView.InsertDeItem(n),n}},{key:"InsertHyperLink",value:function(t){if(!t.Text||""==t.Text)return null;if(!t.HyperLink||""==t.HyperLink)return null;var e=this.FEmrView.ActiveSectionTopLevelData().CreateDefaultTextItem();return e.Text=t.Text,e.HyperLink=t.HyperLink,this.FEmrView.InsertItem(e),e}},{key:"InsertDeGroup",value:function(t,e,i){if(""!=t&&""!=e){var n=new wv(this.FEmrView.ActiveSectionTopLevelData());n.SetValue(aS,t),n.SetValue(hS,e),i.ReadOnly&&(n.ReadOnly=i.ReadOnly),i.Code&&n.SetValue(lS,i.Code),i.Frmtp&&n.SetValue(cS,i.Frmtp),i.CMV&&(i.Frmtp||n.SetValue(cS,CS),n.SetValue(dS,i.CMV)),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,n):lp.SetItemPropertyString(i.Propertys,n)),this.FEmrView.InsertDeGroup(n)}else or.showMessage("要插入的数据组索引和名称不能为空!")}},{key:"InsertDeEdit",value:function(t,e,i){if(""==t)return or.showMessage("要插入的Edit索引不能为空!"),null;var n="";i.Text?n=i.Text:e&&(n=e);var o=new VS(this.FEmrView.ActiveSectionTopLevelData(),n);return o.SetValue(aS,t),""!=e&&o.SetValue(hS,e),i.Code&&o.SetValue(lS,i.Code),i.DeleteAllow&&(o.DeleteAllow=i.DeleteAllow),i.EditProtect&&(o.EditProtect=i.EditProtect),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,o):lp.SetItemPropertyString(i.Propertys,o)),this.FEmrView.InsertItem(o),o}},{key:"InsertDeCombobox",value:function(t,e,i){var n=e;if(i.Text&&(n=i.Text),""==t)return or.showMessage("要插入的Combobox索引和名称不能为空!"),null;var o=new WS(this.FEmrView.ActiveSectionTopLevelData(),n);if(o.SetValue(aS,t),""!=e&&o.SetValue(hS,e),i.SaveItem?o.SaveItem=i.SaveItem:o.SaveItem=!1,i.Items)for(var r=0;r<i.Items.length;r++)o.AddItem(i.Items[r].Text,i.Items[r].TextValue);return i.Code&&o.SetValue(lS,i.Code),i.Static&&(o.Static=i.Static),i.PrintOnlyText&&(o.PrintOnlyText=i.PrintOnlyText),i.ReadOnly&&(o.ReadOnly=i.ReadOnly),i.DeleteAllow&&(o.DeleteAllow=i.DeleteAllow),i.EditProtect&&(o.EditProtect=i.EditProtect),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,o):lp.SetItemPropertyString(i.Propertys,o)),this.FEmrView.InsertItem(o),o}},{key:"InsertDeDateTime",value:function(t,e,i){if(""==t)return or.showMessage("要插入的DateTiem索引和名称不能为空!"),null;var n=new zS(this.FEmrView.ActiveSectionTopLevelData(),X.Now());return n.SetValue(aS,t),""!=e&&n.SetValue(hS,e),i.Code&&n.SetValue(lS,i.Code),i.DeleteAllow&&(n.DeleteAllow=i.DeleteAllow),i.EditProtect&&(n.EditProtect=i.EditProtect),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,n):lp.SetItemPropertyString(i.Propertys,n)),this.FEmrView.InsertItem(n),n}},{key:"InsertDeRadioGroup",value:function(t,e,i){if(""==t)return or.showMessage("要插入的RadioGroup索引不能为空!"),null;var n=new jS(this.FEmrView.ActiveSectionTopLevelData());if(n.SetValue(aS,t),""!=e&&n.SetValue(hS,e),i.Style&&"CheckBox"==i.Style&&(n.RadioStyle=Xd),i.MultSelect&&"1"==i.MultSelect&&(n.MultSelect=!0),i.Items)for(var o=0;o<i.Items.length;o++)n.AddItem(i.Items[o].Text,i.Items[o].TextValue,i.Items[o].Checked);else n.AddItem("选项1"),n.AddItem("选项2"),n.AddItem("选项3");return i.Code&&n.SetValue(lS,i.Code),i.AutoSize&&(n.AutoSize=i.AutoSize),i.Width&&(n.Width=i.Width),i.Height&&(n.Height=i.Height),i.Columes&&(n.Columns=parseInt(i.Columes)),i.ColumnAlign&&(n.ColumnAlign=i.ColumnAlign),i.ItemHit&&(n.ItemHit=i.ItemHit),i.DeleteAllow&&(n.DeleteAllow=i.DeleteAllow),i.EditProtect&&(n.EditProtect=i.EditProtect),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,n):lp.SetItemPropertyString(i.Propertys,n)),this.FEmrView.InsertItem(n),n}},{key:"InsertDeFloatBarCode",value:function(t,e,i){if(""==t)return or.showMessage("要插入的FloatBarCode索引不能为空!!"),null;var n=new XS(this.FEmrView.ActiveSection.ActiveData);return n.SetValue(aS,t),""!=e&&n.SetValue(hS,e),""!=i.Text&&(n.Text=i.Text),i.DeleteAllow&&(n.DeleteAllow=i.DeleteAllow),i.EditProtect&&(n.EditProtect=i.EditProtect),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,n):lp.SetItemPropertyString(i.Propertys,n)),this.FEmrView.InsertFloatItem(n),n}},{key:"InsertDeFloatQRCode",value:function(t,e,i){if(""==t)return or.showMessage("要插入的FloatBarCode索引不能为空!!"),null;var n=new KS(this.FEmrView.ActiveSection.ActiveData);return n.SetValue(aS,t),""!=e&&n.SetValue(hS,e),""!=i.Text&&(n.Text=i.Text),i.DeleteAllow&&(n.DeleteAllow=i.DeleteAllow),i.EditProtect&&(n.EditProtect=i.EditProtect),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,n):lp.SetItemPropertyString(i.Propertys,n)),this.FEmrView.InsertFloatItem(n),n}},{key:"InsertDeImage",value:function(t,e,i){var n=this;if(""==t)return or.showMessage("要插入的DeImage索引不能为空!!"),null;var o=this.FEmrView.ActiveSectionTopLevelData(),r=new YS(o);r.SetValue(aS,t),""!=e&&r.SetValue(hS,e),i.Code&&r.SetValue(lS,i.Code);var s=r.Width;i.Width&&(s=i.Width,r.Width=s);var a=r.Height;if(i.Height&&(a=i.Height,r.Height=a),null!=i.CanResize&&(r.CanResize=i.CanResize),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,r):lp.SetItemPropertyString(i.Propertys,r)),i.DeleteAllow?(r.DeleteAllow=i.DeleteAllow,console.log("11111")):(r.DeleteAllow=!1,console.log("2222")),!i.Base64)return this.FEmrView.InsertItem(r),r;r.LoadFromBase64(i.Base64,i.ImageType,(function(){return i.AutoSize||(r.Width=s,r.Height=a),r.RestrainSize(o.width,r.Height),n.FEmrView.InsertItem(r),i.LoadedEvent&&i.LoadedEvent(),r}))}},{key:"InsertDeCheckBox",value:function(t,e,i){var n=e;if(i.Text&&(n=i.Text),""==t)return or.showMessage("要插入的CheckBox索引不能为空!"),null;var o=new HS(this.FEmrView.ActiveSectionTopLevelData(),n,!1);return o.SetValue(aS,t),""!=e&&o.SetValue(hS,e),i.Code&&""!=i.Code&&o.SetValue(lS,i.Code),i.DeleteAllow&&(o.DeleteAllow=i.DeleteAllow),i.EditProtect&&(o.EditProtect=i.EditProtect),i.Propertys&&("object"==dC(i.Propertys)?lp.SetItemPropertyJSON(i.Propertys,o):lp.SetItemPropertyString(i.Propertys,o)),this.FEmrView.InsertItem(o),o}},{key:"InsertDeTable",value:function(t,e){if(""==t)return or.showMessage("要插入的Table属性Index不能为空!"),null;var i=this.FEmrView.ActiveSectionTopLevelData(),n=new GS(i,e.RowCount,e.ColCount,i.Width);if(n.SetValue(aS,t),""!=e.Name&&n.SetValue(hS,e.Name),null!=e.BorderVisible&&(n.BorderVisible=e.BorderVisible),e.ColWidths){for(var o,r=0,s=-1,a=i.Width,l=0;l<e.ColWidths.length;l++)(o=e.ColWidths[l].toString()).indexOf("%")>=0?(o=o.replace(/%/,""),(s=or.system.parseIntDef(o,-1))>0&&(s=Math.trunc(i.Width*s/100))):or.system.isNumber(e.ColWidths[l])&&(s=or.system.parseIntDef(e.ColWidths[l],-1)),s>0&&(n.FColWidths[r]=s,a=a-s-n.FBorderWidthPix),r++;for(a=Math.trunc(a/(e.ColCount-r))-n.FBorderWidthPix;r<e.ColCount;)n.FColWidths[r]=a,r++}if(e.Rows)for(var h=0;h<e.Rows.length;h++)if(e.Rows[h].Cells)for(var c=0;c<e.Rows[h].Cells.length;c++)e.Rows[h].Cells[c].Text&&(n.Rows[h][c].CellData.Items[0].Text=e.Rows[h].Cells[c].Text);return e.Propertys&&("object"==dC(e.Propertys)?lp.SetItemPropertyJSON(e.Propertys,n):lp.SetItemPropertyString(e.Propertys,n)),this.FEmrView.InsertItem(n),n}},{key:"InsertDeYueJingItem",value:function(t,e,i,n){var o=new SI(this.FEmrView.ActiveSectionTopLevelData(),t,e,i,n);this.FEmrView.InsertItem(o)}},{key:"InsertDeToothItem",value:function(t,e,i,n){var o=new Ev(this.FEmrView.ActiveSectionTopLevelData(),t,e,i,n);this.FEmrView.InsertItem(o)}},{key:"InsertDeFangJiaoItem",value:function(t,e,i,n){var o=new hv(this.FEmrView.ActiveSectionTopLevelData(),t,e,i,n);this.FEmrView.InsertItem(o)}},{key:"InsertDeCnDrugItem",value:function(t,e){var i=new im(this.FEmrView.ActiveSectionTopLevelData(),t,e);this.FEmrView.InsertItem(i)}},{key:"SetActiveDeItemDomain",value:function(t){this.RecordPop().IniDomainUIByJSON(t)}},{key:"TraverseElement",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!=t){var n=e;if(null==n){var o=new Set([]);o.add(dp.Header),o.add(dp.Footer),o.add(dp.Page)}else if(0==n.size)return;var r=new $l;r.Tag=i,r.Areas=n,r.Process=t,this.FEmrView.TraverseItem(r)}}},{key:"SaveToImage",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"PNG";this.FEmrView.SaveToImage(t,e,i)}},{key:"ShowDocTree",value:function(){(new fC).SetView(this.FEmrView)}},{key:"Print",value:function(){this.DoPrint(this.FEmrView)}},{key:"PrintCurPage",value:function(){this.DoPrintCurPage(this.FEmrView)}},{key:"EmrView",get:function(){return this.FEmrView}},{key:"OnCopyRequest",get:function(){return this.FEmrView.OnCopyRequest},set:function(t){this.FEmrView.OnCopyRequest=t}},{key:"OnPasteRequest",get:function(){return this.FEmrView.OnPasteRequest},set:function(t){this.FEmrView.OnPasteRequest=t}},{key:"OnCopyAsStream",get:function(){return this.FEmrView.OnCopyAsStream},set:function(t){this.FEmrView.OnCopyAsStream=t}},{key:"OnPasteFromStream",get:function(){return this.FEmrView.OnPasteFromStream},set:function(t){this.FEmrView.OnPasteFromStream=t}},{key:"PrintToolVisible",get:function(){return this.tlbPrint.visible},set:function(t){this.SetPrintToolVisible(t)}},{key:"OnSyntaxCheck",get:function(){return this.FEmrView.OnSyntaxCheck},set:function(t){this.FEmrView.OnSyntaxCheck=t}},{key:"OnSyntaxPaint",get:function(){return this.FEmrView.OnSyntaxPaint},set:function(t){this.FEmrView.OnSyntaxPaint=t}},{key:"ToolbarVisible",get:function(){return this.captionBar.visible},set:function(t){this.captionBar.visible=t}},{key:"HideTrace",get:function(){return this.FEmrView.HideTrace},set:function(t){this.SetHideTrace(t)}},{key:"ShowExportMenu",get:function(){return this.menuExportFile.visible},set:function(t){this.menuExportFile.visible=t}},{key:"ShowImportMenu",get:function(){return this.menuImplortFile.visible},set:function(t){this.menuImplortFile.visible=t}},{key:"MultItemSpliter",get:function(){return ev.MultItemSpliter},set:function(t){ev.MultItemSpliter=t}},{key:"DeMutexCheckState",get:function(){return this.RecordPop().chkItemMutex.useCheckState},set:function(t){this.RecordPop().chkItemMutex.useCheckState=t}},{key:"OnPopupGetDeItemInfoLib",get:function(){return this.RecordPop().OnPopupGetDeItemInfoLib},set:function(t){this.RecordPop().OnPopupGetDeItemInfoLib=t}},{key:"OnPopupGetDeItemDomainLib",get:function(){return this.RecordPop().OnPopupGetDeItemDomainLib},set:function(t){this.RecordPop().OnPopupGetDeItemDomainLib=t}},{key:"OnPopupGetDomainItemExtraLib",get:function(){return this.RecordPop().OnPopupGetDomainItemExtraLib},set:function(t){this.RecordPop().OnPopupGetDomainItemExtraLib=t}},{key:"OnItemPopupSetCloseLib",get:function(){return this.RecordPop().OnItemPopupSetCloseLib},set:function(t){this.RecordPop().OnItemPopupSetCloseLib=t}}]),i}(ro);function CC(t){return(CC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function PC(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function DC(t,e,i){return(DC="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=AC(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(i):o.value}})(t,e,i||t)}function bC(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&RC(t,e)}function RC(t,e){return(RC=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=AC(t);if(e){var o=AC(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return xC(this,i)}}function xC(t,e){return!e||"object"!==CC(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function AC(t){return(AC=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var TC=function(t){bC(r,t);var e,i,n,o=_C(r);function r(){return kC(this,r),o.call(this,"")}return e=r,(i=[{key:"doInsertText",value:function(t,e){","==e||","==e?DC(AC(r.prototype),"doInsertText",this).call(this,t,","):("-"==e||/^-?\d+$/.test(e))&&DC(AC(r.prototype),"doInsertText",this).call(this,t,e)}}])&&PC(e.prototype,i),n&&PC(e,n),r}(dn),OC=function(t){bC(i,t);var e=_C(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:150;kC(this,i),(t=e.call(this,n,o)).caption="指定页码";var r=new en("单页以英文逗号“,”分隔如:1,4,6,8");r.left=10,r.top=10;var s=new en("连续页以英文“-”分隔如:2-5");s.left=r.left,s.top=r.bottom+5;var a=new en("以上可同时使用如:1,3,5-7,9");a.left=r.left,a.top=s.bottom+5,t.edtPages=new TC(""),t.edtPages.imeMode=Ei,t.edtPages.left=a.left,t.edtPages.top=a.bottom+3,t.edtPages.width=225;var l=new nn("打印");l.left=Math.trunc((t.width-l.width)/2),l.top=t.edtPages.bottom+10,l.onClick=function(){t.modalResult=no,t.close()},t.beginUpdate();try{t.addControl(r),t.addControl(s),t.addControl(a),t.addControl(t.edtPages),t.addControl(l)}finally{t.endUpdate()}return t}return i}(ro);function NC(t){return(NC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function BC(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var EC=function(){function t(e){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.Version="1.57.156",this.CopyRight="",this.OnViewMenuPopup=null,this.RBWatermarking="",nr.createInstance(),or.meaChr=this.useMeaChar(),or.meaChr&&(or.localStorage.hasKey("hcf")?or.localStorage.hcf=JSON.parse(or.localStorage.getString("hcf")):(or.localStorage.setString("hcf",JSON.stringify({})),or.localStorage.hcf={})),or.emrCommon=new Wp,null!=e.debug&&(or.debug=e.debug),e.baseUrl?(or.homePath=e.baseUrl,or.emrCommon.homePath=e.baseUrl):(or.homePath="./",or.emrCommon.homePath="./"),e.dateFormatDef?or.emrCommon.dateFormatDef=e.dateFormatDef:or.emrCommon.dateFormatDef="yyyy-MM-dd",e.timeFormatDef?or.emrCommon.timeFormatDef=e.timeFormatDef:or.emrCommon.timeFormatDef="hh:mm",e.disPopupDateTimeFormat&&(or.emrCommon.disPopupDateTimeFormat=e.disPopupDateTimeFormat),null!=e.toHtmlUseTrace&&(or.emrCommon.ToHtmlUseTrace=e.toHtmlUseTrace),e.hcServer&&(this.HCServer=e.hcServer),null!=e.checkNullItem&&(lp.CHECKNULLITEM=e.checkNullItem),null!=e.useScript&&(lp.USESCRIPT=e.useScript),e.useSaveItemEvent&&(lp.USESAVEITEMEVENT=e.useSaveItemEvent);var n,o=document.getElementById(e.el);if(o?or.parentElement=o:or.log("参数的el属性为NULL,将使用body为编辑器父窗口"),or.application.icon.src=or.homePath+"image/hcview.png",this.FFrmRecord=new wC(or.width,or.height),this.FFrmRecord.EmrView.ShowCopyRight=function(){or.showMessage("程序版本:"+i.Version+"\r\n文件版本:"+lp.HC_FileVersion)},this.FrmRecord.OnViewMenuPopup=function(t){i.doViewMenuPopup(t)},this.FFrmRecord.OnExportXML=function(t){i.doExportXML(t)},this.FFrmRecord.OnExportHTML=function(t){i.doExportHTML(t)},this.FFrmRecord.OnExportTXT=function(t){i.doExportTXT(t)},this.FFrmRecord.OnExportPDF=function(t){i.doExportPDF(t)},this.FFrmRecord.OnImportXML=function(t){i.doImportXML(t)},this.FFrmRecord.OnImportTXT=function(t){i.doImportTXT(t)},this.FFrmRecord.OnPrint=function(t){null!=i.OnPrintProcess?i.OnPrintProcess(0,(function(){i.doPrint(t)}),t.PrintProcIndex):i.doPrint(t)},this.FFrmRecord.OnPrintCurPage=function(t){null!=i.OnPrintProcess?i.OnPrintProcess(0,(function(){i.doPrintCurPage(t)}),t.PrintProcIndex):i.doPrintCurPage(t)},this.FFrmRecord.OnPrintPageRange=function(t){null!=i.OnPrintProcess?i.OnPrintProcess(0,(function(){i.doPrintPageRange(t)}),t.PrintProcIndex):i.doPrintPageRange(t)},this.FFrmRecord.OnPrintOdd=function(t,e){null!=i.OnPrintProcess?i.OnPrintProcess(0,(function(){i.doPrintOdd(t,e)}),t.PrintProcIndex):i.doPrintOdd(t,e)},this.FFrmRecord.OnPrintEven=function(t,e){null!=i.OnPrintProcess?i.OnPrintProcess(0,(function(){i.doPrintEvent(t,e)}),t.PrintProcIndex):i.doPrintEvent(t,e)},this.FFrmRecord.OnPrintCurLine=function(t,e){null!=i.OnPrintProcess?i.OnPrintProcess(1,(function(){i.doPrintCurLine(t,e)}),t.PrintProcIndex):i.doPrintCurLine(t,e)},this.FFrmRecord.OnPrintSelect=function(t){null!=i.OnPrintProcess?i.OnPrintProcess(2,(function(){i.doPrintSelect(t)}),t.PrintProcIndex):i.doPrintSelect(t)},this.FFrmRecord.OnEmrViewKeyDown=function(t){i.OnEmrViewKeyDown&&i.OnEmrViewKeyDown(t)},this.FFrmRecord.onKeyDown=function(t){i.OnKeyDonw&&i.OnKeyDonw(t)},this.FFrmRecord.EmrView.OnStyleLoaded=function(t,e){for(var n=null,o=0;o<t.TextStyles.count;o++)n=t.TextStyles[o],or.meaChr&&null==or.localStorage.hcf[mt.getMeasureName(n.Family,n.Size,n.FontStyles.value)]&&i.getMeasure(n.Family,n.Size,n.FontStyles.value),ct.getFontIndex(n.Family)<1&&(e>56?i.getTextMetrics(n.Family,n.Size,n.FontStyles.value):console.log("无效的字体:"+n.Family))},this.FFrmRecord.EmrView.Style.FTextStyles.onAdded=function(t){or.meaChr&&null==or.localStorage.hcf[mt.getMeasureName(t.Family,t.Size,t.FontStyles.value)]&&i.getMeasure(t.Family,t.Size,t.FontStyles.value)},e.designMode&&(this.FFrmRecord.EmrView.DesignModeEx=e.designMode),e.deUnDoneColor&&(this.FFrmRecord.EmrView.DeUnDoneColor=e.deUnDoneColor),e.deDoneColor&&(this.FFrmRecord.EmrView.DeDoneColor=e.deDoneColor),e.deHotColor&&(this.FFrmRecord.EmrView.DeHotColor=e.deHotColor),e.defaultFontSize){this.FFrmRecord.EmrView.Style.DefaultTextStyle.Size=mt.fontSizeToPt(e.defaultFontSize);var r=this.FFrmRecord.cbbFontSize.itemIndexOf(e.defaultFontSize);r>=0&&(this.FFrmRecord.cbbFontSize.itemIndex=r)}if(e.defaultFontFamily){this.FFrmRecord.EmrView.Style.DefaultTextStyle.Family=e.defaultFontFamily;var s=this.FFrmRecord.cbbFont.itemIndexOf(e.defaultFontFamily);s>=0&&(this.FFrmRecord.cbbFont.itemIndex=s)}if(null!=e.paraLastMark&&(this.FFrmRecord.EmrView.Style.ShowParaLastMark=e.paraLastMark),e.multItemSpliter&&(this.FFrmRecord.MultItemSpliter=e.multItemSpliter),e.paperInfo)this.SetActiveSectionPaperInfo(e.paperInfo,!1);else{if(e.paperSize){var a=lp.GetPaperSizeByName(e.paperSize),l=lp.GetPaperSizeInfo(a);this.FFrmRecord.EmrView.ActiveSection.PaperSize=a,this.FFrmRecord.EmrView.ActiveSection.PaperOrientation==hp?(this.FFrmRecord.EmrView.ActiveSection.PaperWidth=l.Width,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=l.Height):(this.FFrmRecord.EmrView.ActiveSection.PaperWidth=l.Height,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=l.Width)}if(e.paperOrientation&&this.FFrmRecord.EmrView.ActiveSection.PaperOrientation!=e.paperOrientation){this.FFrmRecord.EmrView.ActiveSection.PaperOrientation=e.paperOrientation;var h=this.FFrmRecord.EmrView.ActiveSection.PaperWidth;this.FFrmRecord.EmrView.ActiveSection.PaperWidth=this.FFrmRecord.EmrView.ActiveSection.PaperHeight,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=h}}(null!=e.useAnnotate&&(this.FFrmRecord.UseAnnotate=e.useAnnotate),null!=e.unAllocWarning&&(this.FFrmRecord.EmrView.UnAllocWarning=e.unAllocWarning),null!=e.showExportMenu&&(this.FFrmRecord.ShowExportMenu=e.showExportMenu),null!=e.showImportMenu&&(this.FFrmRecord.ShowImportMenu=e.showImportMenu),this.FFrmRecord.EmrView.ResetActiveSectionMargin(),null!=e.traceInfoAnnotate&&(this.FFrmRecord.EmrView.TraceInfoAnnotate=e.traceInfoAnnotate),null!=e.deMutexCheckState&&(this.FFrmRecord.DeMutexCheckState=e.deMutexCheckState),null!=e.domainPopupGridItemColWidth&&(or.emrCommon.domainPopupGridItemColWidth=e.domainPopupGridItemColWidth),e.toolBar)&&(or.debugLog("初始化传递的工具栏控制!"+JSON.stringify(e.toolBar)),e.toolBar.height&&(this.FFrmRecord.captionBar.height=e.toolBar.height),null==e.toolBar.visible||e.toolBar.visible||(this.FFrmRecord.captionBar.visible=!1),e.toolBar.btnFile&&(null==(n=e.toolBar.btnFile).visible||n.visible||(this.FFrmRecord.btnFile.visible=!1),e.toolBar.btnFile.menu&&(n=e.toolBar.btnFile.menu,this.doSetToolMenu(this.FFrmRecord.btnFile.dropDownMenu,n))),e.toolBar.btnSave&&(null==(n=e.toolBar.btnSave).visible||n.visible||(this.FFrmRecord.btnSave.visible=!1)),e.toolBar.btnPrint&&(null==(n=e.toolBar.btnPrint).visible||n.visible||(this.FFrmRecord.btnPrint.visible=!1)),e.toolBar.btnInsert&&(null==(n=e.toolBar.btnInsert).visible||n.visible||(this.FFrmRecord.btnInsert.visible=!1),e.toolBar.btnInsert.menu&&(n=e.toolBar.btnInsert.menu,this.doSetToolMenu(this.FFrmRecord.btnInsert.dropDownMenu,n))),null!=e.toolBar.btnFormatBrush&&(this.FFrmRecord.btnFormatBrush.visible=e.toolBar.btnFormatBrush),e.toolBar.btnCustoms&&this.AddToolButton(e.toolBar.btnCustoms));e.event&&(or.debugLog("初始化传递的事件控制!"+JSON.stringify(e.event)),e.event.onCaretItemChanged&&(this.OnCaretItemChanged=e.event.onCaretItemChanged),e.event.onDomainSwitch&&(this.OnDomainSwitch=e.event.onDomainSwitch),e.event.onChangedSwitch&&(this.OnChangedSwitch=e.event.onChangedSwitch),e.event.onSave&&(this.OnSave=e.event.onSave),e.event.onExternalDeItemPopup&&(this.OnExternalDeItemPopup=e.event.onExternalDeItemPopup),e.event.onPopupGetDeItemInfo&&(this.OnPopupGetDeItemInfo=e.event.onPopupGetDeItemInfo),e.event.onPopupGetDeItemDomain&&(this.OnPopupGetDeItemDomain=e.event.onPopupGetDeItemDomain),e.event.onPopupGetDomainItemExtraLib&&(this.OnPopupGetDomainItemExtraLib=e.event.onPopupGetDomainItemExtraLib),e.event.onItemPopupSetClose&&(this.OnItemPopupSetClose=e.event.onItemPopupSetClose),e.event.onSectionInsertItem&&(this.OnSectionInsertItem=e.event.onSectionInsertItem),e.event.onInserItemSync&&(this.OnInserItemSync=e.event.onInserItemSync),e.event.onDeComboboxPopup&&(this.OnDeComboboxPopup=e.event.onDeComboboxPopup),e.event.onCanEdit&&(this.OnCanEdit=e.event.onCanEdit),e.event.onDeItemPopup&&(this.OnDeItemPopup=e.event.onDeItemPopup),e.event.onDeItemGetSyncValue&&(this.OnDeItemGetSyncValue=e.event.onDeItemGetSyncValue),e.event.onDrawTrace&&(this.OnDrawTrace=e.event.onDrawTrace),e.event.onEmrViewKeyDown&&(this.OnEmrViewKeyDown=e.event.onEmrViewKeyDown),e.event.onKeyDown&&(this.OnKeyDonw=e.event.onKeyDown),e.event.onPrintProcess&&(this.OnPrintProcess=e.event.onPrintProcess),e.event.onPrinted&&(this.OnPrinted=e.event.onPrinted),e.event.onMouseUp&&(this.OnMouseUp=e.event.onMouseUp),e.event.onPopupFormClose&&(this.OnPopupFormClose=e.event.onPopupFormClose),e.event.onChange&&(this.OnChange=e.event.onChange),e.event.onDblClick&&(this.OnDblClick=e.event.onDblClick),e.event.onViewMenuPopup&&(this.OnViewMenuPopup=e.event.onViewMenuPopup),e.event.onSetDeItemText&&(this.OnSetDeItemText=e.event.onSetDeItemText),e.event.onSaveItem&&(this.OnSaveItem=e.event.onSaveItem),e.event.onCopyAfter&&(this.OnCopyAfter=e.event.onCopyAfter),e.event.onCutAfter&&(this.OnCutAfter=e.event.onCutAfter),e.event.onPasteBefor&&(this.OnPasteBefor=e.event.onPasteBefor),e.event.onSyntaxCheck&&(this.OnSyntaxCheck=e.event.onSyntaxCheck),e.event.onSyntaxPaint&&(this.onSyntaxPaint=e.event.onSyntaxPaint)),e.contextMenu&&(or.debugLog("初始化传递的自定义右键菜单!"+JSON.stringify(e.contextMenu)),this.FFrmRecord.FContextMenu.addSpliter(),this.AddContextMenu(e.contextMenu)),or.application.addForm(this.FFrmRecord),or.application.run(),or.autoWidth=!0,at.colorToRGBA("black"),e.event&&e.event.onInitialization&&e.event.onInitialization()}var e,i,n;return e=t,(i=[{key:"useMeaChar",value:function(){var t=navigator.userAgent;if("Win32"==navigator.platform||"Windows"==navigator.platform){if(t.indexOf("Windows NT 5.0")>-1||t.indexOf("Windows 2000")>-1)return!1;if(t.indexOf("Windows NT 5.1")>-1||t.indexOf("Windows XP")>-1)return!1;if(t.indexOf("Windows NT 5.2")>-1||t.indexOf("Windows 2003")>-1)return!1;if((t.indexOf("Windows NT 6.0")>-1||t.indexOf("Windows Vista")>-1)&&(this.osVer="WinVista"),t.indexOf("Windows NT 6.1")>-1||t.indexOf("Windows 7")>-1)return!1}return!0}},{key:"getMeasure",value:function(t,e,i){var n=mt.getMeasureName(t,e,i);null==or.localStorage.hcf[n]&&Ni.get(this.FHCServer,{CMD:"1070",name:t,size:e,style:i},(function(t){var e=JSON.parse(t);or.localStorage.hcf[n]=e.arr,or.localStorage.setString("hcf",JSON.stringify(or.localStorage.hcf))}),!1)}},{key:"getTextMetrics",value:function(t,e,i){or.textMetricsIndexOf(t,e,i)>=0||Ni.get(this.FHCServer,{CMD:"1071",name:t,size:e,styles:i},(function(n){var o=JSON.parse(n),r={name:t,size:e,styles:i,trueType:o.trueType,CJK:o.CJK,advCharWidth:o.advCharWidth,height:o.height,ascent:o.ascent};or.textMetrics.add(r)}),!1)}},{key:"doSetToolMenu",value:function(t,e){for(var i=null,n=0;n<e.length;n++)null!=(i=t.subItemByText(e[n].text))&&(i.visible=e[n].visible)}},{key:"doViewMenuPopup",value:function(t){this.OnViewMenuPopup&&this.OnViewMenuPopup(t)}},{key:"doImportXML",value:function(t){ao.execute(C.stringFormat("{0}",I.XML,".xml"),(function(e){t.Clear();var i=new FileReader;i.onload=function(e){if(e.target.result){var i=new Qr;i.FromString(e.target.result),t.LoadFromXml(i),i=null}},i.readAsText(e.firstFile),i=null}))}},{key:"doImportTXT",value:function(t){ao.execute(C.stringFormat("{0}",I.TXT,".txt"),(function(e){t.Clear();var i=new FileReader;i.onload=function(e){e.target.result&&t.InsertText(e.target.result)},i.readAsText(e.firstFile),i=null}))}},{key:"doExportXML",value:function(t){var e=new Blob([t.SaveToXml()],{type:I.XML}),i=URL.createObjectURL(e),n=document.createElement("a");document.body.appendChild(n),n.href=i,n.download="HCView H5.xml",n.click(),window.URL.revokeObjectURL(t),document.body.removeChild(n)}},{key:"doExportHTML",value:function(t){var e=new Blob([t.SaveToHtml()],{type:I.HTML}),i=URL.createObjectURL(e),n=document.createElement("a");document.body.appendChild(n),n.href=i,n.download="HCView H5.html",n.click(),window.URL.revokeObjectURL(t),document.body.removeChild(n)}},{key:"doExportTXT",value:function(t){var e=new Blob([t.SaveToText()],{type:I.TXT}),i=URL.createObjectURL(e),n=document.createElement("a");document.body.appendChild(n),n.href=i,n.download="HCView H5.txt",n.click(),window.URL.revokeObjectURL(t),document.body.removeChild(n)}},{key:"doExportPDF",value:function(t){var e=this;if(this.FHCServer)var i=or.waitMessage("正在生成PDF文件...",(function(){var n=new K;t.SaveToStream(n,!1);var o=new Uint8Array(n.buffer);Ni.post(e.FHCServer,{CMD:"1068",data:o,first:"-1",last:"-1",isodd:"0",header:"1",footer:"1",pages:"",phuav:t.PrintHideUnAllocValue},(function(t){var e=JSON.parse(t);if(or.endWaitMessage(i),e.data.length>0){var n=new Uint8Array(e.data),o=new Blob([n],{type:I.PDF}),r=URL.createObjectURL(o),s=document.createElement("a");document.body.appendChild(s),s.href=r,s.download="HCView H5.pdf",s.click(),window.URL.revokeObjectURL(o),document.body.removeChild(s)}else console.log("警告,服务端生成的PDF文件大小为0!")}))}));else console.log("打印失败,未设置HC服务端地址!")}},{key:"doPrintExecute",value:function(t,e,i,n,o,r,s,a,l,h,c,u,f){var d=this,m=arguments.length>13&&void 0!==arguments[13]?arguments[13]:"";if(this.FHCServer)var y=or.waitMessage("正在打印...",(function(){var p=new K;t.PrintSave=!0;try{t.SaveToStream(p,!1)}finally{t.PrintSave=!1}var S=new Uint8Array(p.buffer);Ni.post(d.FHCServer,{CMD:"1068",data:S,first:e,last:i,isodd:n,header:o,footer:r,leftb:s,topb:a,hb:l,lefte:h,tope:c,he:u,pages:m,phuav:t.PrintHideUnAllocValue,revord:f,rbwm:d.RBWatermarking},(function(t){var e=JSON.parse(t);if(e.err)or.endWaitMessage(y),alert(e.err);else if(e.data.length>0){e.fontlose&&alert("生成打印PDF文件时服务器系统中缺少以下字体:"+e.fontlose);var i=document.getElementById("hclPrintFrame");null!=i&&(or.parentElement.removeChild(i),i=null),(i=document.createElement("iframe")).id="hclPrintFrame",i.style.display="none",or.parentElement.appendChild(i),i.onload=function(){i.contentWindow.print(),URL.revokeObjectURL(i.src),or.endWaitMessage(y),null!=d.OnPrinted&&(u&&u>0?d.OnPrinted(2):a&&a>0?d.OnPrinted(1):d.OnPrinted(0))};var n=new Uint8Array(e.data),o=new Blob([n],{type:I.PDF});i.src=URL.createObjectURL(o)}else or.endWaitMessage(y),console.log("警告,服务端生成的打印文件大小为0!")}))}));else console.log("打印失败,未设置HC服务端地址!")}},{key:"doPrint",value:function(t){this.doPrintExecute(t,-1,-1,0,1,1,-1,-1,-1,-1,-1,-1,0)}},{key:"doPrintCurPage",value:function(t){var e=t.GetActivePageIndex();this.doPrintExecute(t,e+1,e+1,0,1,1,-1,-1,-1,-1,-1,-1,0)}},{key:"doPrintPageRange",value:function(t){var e=this,i=new OC;i.moveCenter(),i.showModal((function(){e.doPrintExecute(t,-1,-1,3,1,1,-1,-1,-1,-1,-1,-1,0,i.edtPages.text)}))}},{key:"doPrintOdd",value:function(t,e){this.doPrintExecute(t,-1,-1,1,1,1,-1,-1,-1,-1,-1,-1,e?1:0)}},{key:"doPrintEvent",value:function(t,e){this.doPrintExecute(t,-1,-1,2,1,1,-1,-1,-1,-1,-1,-1,e?1:0)}},{key:"doPrintCurLine",value:function(t,e){var i=t.GetActivePageIndex(),n=t.ActiveSection.GetTopLevelDrawItemCoord();n.y=n.y-t.ActiveSection.GetPageDataFmtTop(i);var o=i+1,r=0,s=0;e&&(o=e,r=1,s=1),this.doPrintExecute(t,i+1,o,0,r,s,0,n.y,-1,-1,-1,-1,0)}},{key:"doPrintSelect",value:function(t){if(t.ActiveSection.ActiveData.SelectExists(!1)){var e=t.GetActivePageIndex(),i=t.ActiveSection.GetPageMarginLeftAndRight(e),n=t.ActiveSection.ActiveData,o=n.GetDrawItemNoByOffset(n.SelectInfo.StartItemNo,n.SelectInfo.StartItemOffset),r=n.DrawItems[o].rect.leftTop;r.x=i.left+r.x+n.GetDrawItemOffsetWidth(o,n.SelectInfo.StartItemOffset-n.DrawItems[o].CharOffs+1),r.y=r.y-t.ActiveSection.GetPageDataFmtTop(e);var s=n.GetDrawItemNoByOffset(n.SelectInfo.EndItemNo,n.SelectInfo.EndItemOffset),a=n.DrawItems[s].rect.leftTop;a.x=i.left+a.x+n.GetDrawItemOffsetWidth(s,n.SelectInfo.EndItemOffset-n.DrawItems[s].CharOffs+1),a.y=a.y-t.ActiveSection.GetPageDataFmtTop(e),this.doPrintExecute(t,e+1,e+1,0,0,0,r.x,r.y,n.DrawItems[o].rect.height,a.x,a.y,n.DrawItems[s].rect.height,0)}else console.log("打印选中内容时,未发现正文有选中内容!")}},{key:"Dispose",value:function(){nr.disposeInstance()}},{key:"AddToolButton",value:function(t){for(var e,i=this,n=function(n){if(t[n].menu){e=new an(t[n].text),null!=t[n].textVisible&&(e.textVisible=t[n].textVisible);var o=new _n;o.dropDownStyle=!0,i.AddContextMenu(t[n].menu,o),e.dropDownMenu=o,i.FFrmRecord.captionBar.addControl(e)}else e=i.FFrmRecord.captionBar.addButton(t[n].text),null!=t[n].textVisible&&(e.textVisible=t[n].textVisible),e.onClick=function(){t[n].exec()};t[n].image&&(e.image.src=t[n].image)},o=0;o<t.length;o++)n(o)}},{key:"AddContextMenu",value:function(t,e){var i,n=this;e||(e=this.FFrmRecord.FContextMenu);for(var o=function(o){(i=e.addItem(t[o].text)).tag=1,i.onClick=function(){t[o].exec()},t[o].subMenu&&n.AddContextMenu(t[o].subMenu,i)},r=0;r<t.length;r++)o(r)}},{key:"print",value:function(t,e,i,n,o){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.Print(t,e,i,n,o,r)}},{key:"Print",value:function(t,e,i,n,o,r){this.doPrintExecute(this.FFrmRecord.EmrView,t,e,i,n,o,-1,-1,-1,-1,-1,-1,r)}},{key:"PrintView",value:function(){this.FFrmRecord.PrintView()}},{key:"applyParaAlignHorz",value:function(t){this.ApplyParaAlignHorz(t)}},{key:"ApplyParaAlignHorz",value:function(t){this.FFrmRecord.EmrView.ApplyParaAlignHorz(t)}},{key:"applyTextStyle",value:function(t){this.ApplyTextStyle(t)}},{key:"ApplyTextStyle",value:function(t){this.FFrmRecord.EmrView.ApplyTextStyle(t)}},{key:"applyTextFontName",value:function(t){this.ApplyTextFontName(t)}},{key:"ApplyTextFontName",value:function(t){this.FFrmRecord.EmrView.ApplyTextFontName(t)}},{key:"applyTextFontSize",value:function(t){this.ApplyTextFontSize(t)}},{key:"ApplyTextFontSize",value:function(t){"string"==typeof t?this.FFrmRecord.EmrView.ApplyTextFontSize(mt.fontSizeToPt(t)):this.FFrmRecord.EmrView.ApplyTextFontSize(t)}},{key:"applyTextColor",value:function(t){this.ApplyTextColor(t)}},{key:"ApplyTextColor",value:function(t){this.FFrmRecord.EmrView.ApplyTextColor(t)}},{key:"applyTextBackColor",value:function(t){this.ApplyTextBackColor(t)}},{key:"ApplyTextBackColor",value:function(t){this.FFrmRecord.EmrView.ApplyTextBackColor(t)}},{key:"beginUpdate",value:function(){this.BeginUpdate()}},{key:"BeginUpdate",value:function(){this.FFrmRecord.EmrView.BeginUpdate()}},{key:"endUpdate",value:function(){this.EndUpdate()}},{key:"EndUpdate",value:function(){this.FFrmRecord.EmrView.EndUpdate()}},{key:"NextDeItemAutoComplate",value:function(){this.FFrmRecord.NextDeItemAutoComplate()}},{key:"PrevDeItemAutoComplate",value:function(){this.FFrmRecord.PrevDeItemAutoComplate()}},{key:"loadHeaderFromBytes",value:function(t,e){this.LoadHeaderFromBytes(t,e)}},{key:"LoadHeaderFromBytes",value:function(t,e){var i=new K;i.writeBuffer(t),i.position=0,this.LoadHeaderFromStream(i,e),i=null}},{key:"LoadHeaderFromStream",value:function(t,e){if(!this.FrmRecord.EmrView.LoadHeaderFromStream(t,e)){var i=new AI;i.LoadFromStream(t),t.clear(),i.Sections[0].Header.SaveToStream(t),t.position=0,this.FFrmRecord.EmrView.IgnoreAcceptAction=!0;try{this.FFrmRecord.EmrView.ActiveSection.Header.BeginFormat();try{this.FFrmRecord.EmrView.ActiveSection.Header.LoadFromStream(t,i.Style,lp.HC_FileVersionInt)}finally{this.FFrmRecord.EmrView.ActiveSection.Header.EndFormat(!1)}e?this.FFrmRecord.EmrView.ActiveSection.AssignPaper(i.Sections[0]):this.FFrmRecord.EmrView.ResetActiveSectionMargin()}finally{this.FFrmRecord.EmrView.IgnoreAcceptAction=!1}this.FFrmRecord.EmrView.IsChanged=!0,this.FFrmRecord.EmrView.UpdateView()}}},{key:"loadFooterFromBytes",value:function(t,e){this.LoadFooterFromBytes(t,e)}},{key:"LoadFooterFromBytes",value:function(t,e){var i=new K;i.writeBuffer(t),i.position=0,this.LoadFooterFromStream(i,e),i=null}},{key:"LoadFooterFromStream",value:function(t,e){if(!this.FrmRecord.EmrView.LoadFooterFromStream(t,e)){var i=new AI;i.LoadFromStream(t),t.clear(),i.Sections[0].Footer.SaveToStream(t),t.position=0,this.FFrmRecord.EmrView.IgnoreAcceptAction=!0;try{this.FFrmRecord.EmrView.ActiveSection.Footer.BeginFormat();try{this.FFrmRecord.EmrView.ActiveSection.Footer.LoadFromStream(t,i.Style,lp.HC_FileVersionInt)}finally{this.FFrmRecord.EmrView.ActiveSection.Footer.EndFormat(!1)}e?this.FFrmRecord.EmrView.ActiveSection.AssignPaper(i.Sections[0]):this.FFrmRecord.EmrView.ResetActiveSectionMargin()}finally{this.FFrmRecord.EmrView.IgnoreAcceptAction=!1}this.FFrmRecord.EmrView.IsChanged=!0,this.FFrmRecord.EmrView.UpdateView()}}},{key:"loadFromFile",value:function(t){this.LoadFromFile(t)}},{key:"LoadFromFile",value:function(t){this.FFrmRecord.PopupFormClose(),this.FFrmRecord.EmrView.LoadFromFile(t)}},{key:"LoadFromBytes",value:function(t){this.loadFromStream(t)}},{key:"loadFromStream",value:function(t){this.LoadFromStream(t)}},{key:"LoadFromStream",value:function(t){this.FFrmRecord.PopupFormClose();var e=new K;e.writeBuffer(t),e.position=0,this.FFrmRecord.EmrView.LoadFromStream(e),e=null}},{key:"SaveToBytes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.SaveToStream(t,e)}},{key:"saveToStream",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.SaveToStream(t,e)}},{key:"SaveToStream",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=new K;return this.FFrmRecord.EmrView.SaveToStream(i,t,e),i.buffer}},{key:"InsertBytes",value:function(t){var e=new K;e.writeBuffer(t),e.position=0,this.FFrmRecord.EmrView.InsertStream(e),e=null}},{key:"AppendBytes",value:function(t){var e=new K;e.writeBuffer(t),e.position=0,this.FFrmRecord.EmrView.AppendStream(e),e=null}},{key:"SaveToLiteBytes",value:function(){var t=new K;return this.FFrmRecord.EmrView.SaveToLiteStream(t),t.buffer}},{key:"InsertLiteBytes",value:function(t){var e=new K;e.writeBuffer(t),e.position=0,this.FFrmRecord.EmrView.InsertLiteStream(e),e=null}},{key:"saveToXml",value:function(){return this.SaveToXml()}},{key:"SaveToXml",value:function(){return this.FFrmRecord.EmrView.SaveToXml()}},{key:"saveToHtml",value:function(){return this.SaveToHtml()}},{key:"SaveToHtml",value:function(){return this.FFrmRecord.EmrView.SaveToHtml()}},{key:"SaveToText",value:function(){return this.FFrmRecord.EmrView.SaveToText()}},{key:"SaveSelectToText",value:function(){return this.FFrmRecord.EmrView.SaveSelectToText()}},{key:"SaveSelectToBytes",value:function(){var t=new K;return this.FFrmRecord.EmrView.SaveSelectToStream(t),t.buffer}},{key:"Resize",value:function(){or.resize()}},{key:"clear",value:function(){this.Clear()}},{key:"Clear",value:function(){this.FFrmRecord.EmrView.Clear()}},{key:"clearUndo",value:function(){this.ClearUndo()}},{key:"ClearUndo",value:function(){this.FFrmRecord.EmrView.ClearUndo()}},{key:"CanEdit",value:function(){return this.FFrmRecord.EmrView.CanEdit()}},{key:"UndoDisenable",value:function(){this.FFrmRecord.EmrView.FUndoList.Enable=!1}},{key:"UndoEnable",value:function(){this.FFrmRecord.EmrView.FUndoList.Enable=!0}},{key:"Search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.FFrmRecord.EmrView.Search(t,e,i)}},{key:"SyntaxCheck",value:function(){this.FFrmRecord.EmrView.SyntaxCheck()}},{key:"insertDeItem",value:function(t){return this.InsertDeItem(t)}},{key:"InsertDeItem",value:function(t){return this.FFrmRecord.InsertDeItem(t.Index,t.Name,t)}},{key:"InsertToothItem",value:function(t){var e=new Ev(this.FFrmRecord.EmrView.ActiveSectionTopLevelData(),t.LeftTop,t.RightTop,t.LeftBottom,t.RightBottom);this.FFrmRecord.EmrView.InsertItem(e)}},{key:"InsertHyperLink",value:function(t){return this.FFrmRecord.InsertHyperLink(t)}},{key:"getDeItemText",value:function(t){return this.GetDeItemText(t)}},{key:"GetDeItemText",value:function(t){return this.FFrmRecord.EmrView.GetDeItemText(t)}},{key:"getDeItemProperty",value:function(t,e,i){return this.GetDeItemProperty(t,e,i)}},{key:"GetDeItemProperty",value:function(t,e,i){return this.FFrmRecord.EmrView.GetDeItemProperty(t,e,i)}},{key:"SetDeItemText",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.FFrmRecord.EmrView.SetDeItemText(t,e,i)}},{key:"SetDeItemProperty",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.FFrmRecord.EmrView.SetDeObjectProperty(t,e,i,n)}},{key:"insertProc",value:function(t,e,i){return this.InsertProc(t,e,i)}},{key:"InsertProc",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.FFrmRecord.EmrView.InsertProc(t,e,i,n)}},{key:"DeleteProc",value:function(t){this.FFrmRecord.EmrView.DeleteProc(t)}},{key:"ScrollToProc",value:function(t){return this.FFrmRecord.EmrView.ScrollToProc(t)}},{key:"GetCaretProcProperty",value:function(t,e){return this.FFrmRecord.EmrView.GetCaretProcProperty(t,e)}},{key:"GetCaretDeGroupProperty",value:function(t,e){return this.FFrmRecord.EmrView.GetCaretDeGroupProperty(t,e)}},{key:"getProcProperty",value:function(t,e,i){return this.GetProcProperty(t,e,i)}},{key:"GetProcProperty",value:function(t,e,i){return this.FFrmRecord.EmrView.GetProcProperty(t,e,i)}},{key:"SetProcProperty",value:function(t,e,i){this.FFrmRecord.EmrView.SetProcProperty(t,e,i)}},{key:"setProcBytes",value:function(t,e){this.SetProcByFileSteam(t,e)}},{key:"SetProcBytes",value:function(t,e){this.SetProcByFileSteam(t,e)}},{key:"SetProcByFileSteam",value:function(t,e){var i=new K;i.writeBuffer(e),i.position=0,this.FFrmRecord.EmrView.SetProcByFileSteam(t,i),i=null}},{key:"getProcAsText",value:function(t){return this.GetProcAsText(t)}},{key:"GetProcAsText",value:function(t){var e=this.FFrmRecord.EmrView.GetProcAsText(t);return e.result?e.text:null}},{key:"getProcAsBytes",value:function(t){return this.GetProcAsBytes(t)}},{key:"GetProcAsBytes",value:function(t){var e=new K;return this.FFrmRecord.EmrView.GetProcAsStream(t,e)?e.buffer:[]}},{key:"SaveProcToBytes",value:function(t,e){var i=new AI,n=new K;return e&&(this.FFrmRecord.EmrView.ActiveSection.Header.SaveToStream(n),n.position=0,i.ActiveSection.Header.LoadFromStream(n,this.FFrmRecord.EmrView.Style,lp.HC_FileVersionInt),n.clear(),this.FFrmRecord.EmrView.ActiveSection.Footer.SaveToStream(n),n.position=0,i.ActiveSection.Footer.LoadFromStream(n,this.FFrmRecord.EmrView.Style,lp.HC_FileVersionInt)),i.ActiveSection.AssignPaper(this.FFrmRecord.EmrView.ActiveSection),n.clear(),this.FFrmRecord.EmrView.GetProcAsStream(t,n),n.position=0,i.InsertLiteStream(n),n.clear(),i.SaveToStream(n,!1),n.buffer}},{key:"SetProcByBytes",value:function(t,e){var i=new K;i.writeBuffer(e),i.position=0,this.FFrmRecord.EmrView.SetProcByStream(t,i),i=null}},{key:"SetProcByText",value:function(t,e){this.FFrmRecord.EmrView.SetProcByText(t,e)}},{key:"SetActiveItemExtraByBytes",value:function(t){this.SetPopupItemExtraByBytes(null,t)}},{key:"SetPopupItemExtraByBytes",value:function(t,e){var i=new K;i.writeBuffer(e),i.position=0,null==t||t.StyleNo>cs.Null?this.FFrmRecord.EmrView.SetActiveItemExtra(i):this.FFrmRecord.EmrView.InsertLiteStream(i),i=null}},{key:"SetActiveDeObjectProperty",value:function(t,e){this.FFrmRecord.EmrView.SetActiveDeObjectProperty(t,e)}},{key:"getProcAsHtml",value:function(t){return this.GetProcAsHtml(t)}},{key:"GetProcAsHtml",value:function(t){var e=this.FFrmRecord.EmrView.GetProcItemNo(t);if(e.result){var i=new j;return i.append("<!DOCTYPE HTML>"),i.append("<html>"),i.append("<head>"),i.append("<title>"),i.append("</title>"),i.append(this.FFrmRecord.EmrView.Style.ToCSS()),i.append("</head>"),i.append("<body>"),i.append(this.FFrmRecord.EmrView.Sections[e.sectionIndex].Page.ToHtml(e.startNo,e.endNo)),i.append("</body>"),i.append("</html>"),i.text}return""}},{key:"insertDeGroup",value:function(t){this.InsertDeGroup(t)}},{key:"InsertDeGroup",value:function(t){this.FFrmRecord.InsertDeGroup(t.Index,t.Name,t)}},{key:"DeleteDeGroup",value:function(t){this.FFrmRecord.EmrView.DeleteDeGroup(t)}},{key:"setDeGroupText",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.SetDeGroupByText(t,e,i)}},{key:"SetDeGroupText",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.SetDeGroupByText(t,e,i)}},{key:"SetDeGroupByText",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.FFrmRecord.EmrView.SetDeGroupByText(this.FFrmRecord.EmrView.ActiveSectionIndex,dp.Page,t,e,i)}},{key:"SetDeGroupProperty",value:function(t,e,i){this.SetDeGroupProperty(t,e,i)}},{key:"SetDeGroupProperty",value:function(t,e,i){this.FFrmRecord.EmrView.SetDeGroupProperty(t,e,i)}},{key:"getDeGroupText",value:function(t){return this.GetDeGroupAsText(t)}},{key:"GetDeGroupText",value:function(t){return this.GetDeGroupAsText(t)}},{key:"GetDeGroupAsText",value:function(t){return this.FFrmRecord.EmrView.GetDeGroupAsText(t)}},{key:"GetDeGroupAsBytes",value:function(t){var e=this.FFrmRecord.EmrView.GetDeGroupAsStream(t);return e?e.buffer:[]}},{key:"SetDeGroupByBytes",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=new K;n.writeBuffer(e),n.position=0,this.FFrmRecord.EmrView.SetActiveSectionDeGroupByStream(t,n,i),n=null}},{key:"SetProcDeGroupByText",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.FFrmRecord.EmrView.SetProcDeGroupByText(t,e,i,n)}},{key:"SetProcDeGroupByBytes",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=new K;o.writeBuffer(i),o.position=0,this.FFrmRecord.EmrView.SetProcDeGroupByStream(t,e,o,n),o=null}},{key:"SetCaretDeGroupByText",value:function(t){this.FFrmRecord.EmrView.SetCaretDeGroupByText(t)}},{key:"SetCaretDeGroupByBytes",value:function(t){var e=new K;e.writeBuffer(t),e.position=0,this.FFrmRecord.EmrView.SetCaretDeGroupByStream(e),e=null}},{key:"SetActiveDeItemDomain",value:function(t){this.FFrmRecord.SetActiveDeItemDomain(t)}},{key:"insertText",value:function(t,e){this.InsertText(t,e)}},{key:"InsertText",value:function(t,e){this.FFrmRecord.EmrView.InsertText(t)}},{key:"insertDeTable",value:function(t){return this.InsertDeTable(t)}},{key:"InsertDeTable",value:function(t){return this.FFrmRecord.InsertDeTable(t.Index,t)}},{key:"insertDeImage",value:function(t){return this.InsertDeImage(t)}},{key:"InsertDeImage",value:function(t){return this.FFrmRecord.InsertDeImage(t.Index,t.Name,t)}},{key:"setDeImage",value:function(t){this.SetDeImage(t)}},{key:"SetDeImage",value:function(t){this.FFrmRecord.EmrView.SetDeImage(t.Index,t)}},{key:"insertDeEdit",value:function(t){return this.InsertDeEdit(t)}},{key:"InsertDeEdit",value:function(t){return this.FFrmRecord.InsertDeEdit(t.Index,t.Name,t)}},{key:"insertDeCombobox",value:function(t){return this.InsertDeCombobox(t)}},{key:"InsertDeCombobox",value:function(t){return this.FFrmRecord.InsertDeCombobox(t.Index,t.Name,t)}},{key:"insertDeDateTime",value:function(t){return this.InsertDeDateTime(t)}},{key:"InsertDeDateTime",value:function(t){return this.FFrmRecord.InsertDeDateTime(t.Index,t.Name,t)}},{key:"insertDeRadioGroup",value:function(t){return this.InsertDeRadioGroup(t)}},{key:"InsertDeRadioGroup",value:function(t){return this.FFrmRecord.InsertDeRadioGroup(t.Index,t.Name,t)}},{key:"insertDeCheckBox",value:function(t){return this.InsertDeCheckBox(t)}},{key:"InsertDeCheckBox",value:function(t){return this.FFrmRecord.InsertDeCheckBox(t.Index,t.Name,t)}},{key:"insertDeFloatBarCode",value:function(t){return this.InsertDeFloatBarCode(t)}},{key:"InsertDeFloatBarCode",value:function(t){return this.FFrmRecord.InsertDeFloatBarCode(t.Index,t.Name,t)}},{key:"InsertDeFloatQRCode",value:function(t){return this.FFrmRecord.InsertDeFloatQRCode(t.Index,t.Name,t)}},{key:"InsertDeYueJingItem",value:function(t,e,i,n){this.FFrmRecord.InsertDeYueJingItem(t,e,i,n)}},{key:"InsertDeToothItem",value:function(t,e,i,n){this.FFrmRecord.InsertDeToothItem(t,e,i,n)}},{key:"InsertDeFangJiaoItem",value:function(t,e,i,n){this.FFrmRecord.InsertDeFangJiaoItem(t,e,i,n)}},{key:"InsertDeCnDrugItem",value:function(t,e){this.FFrmRecord.InsertDeCnDrugItem(t,e)}},{key:"GetActiveItem",value:function(){return this.FFrmRecord.EmrView.ActiveSectionTopLevelData().GetActiveItem()}},{key:"DeleteActiveItem",value:function(){var t=this.FFrmRecord.EmrView.ActiveSectionTopLevelData();this.FFrmRecord.EmrView.DeleteActiveDataItems(t.SelectInfo.StartItemNo)}},{key:"DeleteItem",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=this.FFrmRecord.EmrView.ActiveSection.Page,n=i.Items.count-1;n>=0&&(!(i.Items[n].StyleNo>cs.Null||i.Items[n].StyleNo==cs.Image)||i.Items[n].GetValue(aS)!=t||(i.Items.delete(n),2!=e));n--);this.FFrmRecord.EmrView.FormatData()}},{key:"ShowSearch",value:function(){this.FFrmRecord.EmrView.ShowSearchForm()}},{key:"traverseElement",value:function(t,e,i){this.TraverseElement(t,e,i)}},{key:"TraverseElement",value:function(t,e,i){this.FFrmRecord.TraverseElement(t,e,i)}},{key:"WaitMessage",value:function(t,e){return or.waitMessage(t,e)}},{key:"EndWaitMessage",value:function(t){or.endWaitMessage(t)}},{key:"CreateEmrViewLite",value:function(){return new AI}},{key:"SetActiveSectionPaperInfo",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.size)if("object"==NC(t.size))this.FFrmRecord.EmrView.ActiveSection.PaperWidth=t.size.width,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=t.size.height;else{var i=lp.GetPaperSizeByName(t.size),n=lp.GetPaperSizeInfo(i);this.FFrmRecord.EmrView.ActiveSection.PaperSize=i,this.FFrmRecord.EmrView.ActiveSection.PaperOrientation==hp?(this.FFrmRecord.EmrView.ActiveSection.PaperWidth=n.Width,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=n.Height):(this.FFrmRecord.EmrView.ActiveSection.PaperWidth=n.Height,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=n.Width)}if(t.margin&&(t.margin.left&&t.margin.left>=0&&(this.FrmRecord.EmrView.ActiveSection.PaperMarginLeft=t.margin.left),t.margin.top&&t.margin.top>=0&&(this.FrmRecord.EmrView.ActiveSection.PaperMarginTop=t.margin.top),t.margin.right&&t.margin.right>=0&&(this.FrmRecord.EmrView.ActiveSection.PaperMarginRight=t.margin.right),t.margin.bottom&&t.margin.bottom>=0&&(this.FrmRecord.EmrView.ActiveSection.PaperMarginBottom=t.margin.bottom)),t.orientation&&this.FFrmRecord.EmrView.ActiveSection.PaperOrientation!=t.orientation){this.FFrmRecord.EmrView.ActiveSection.PaperOrientation=t.orientation;var o=this.FFrmRecord.EmrView.ActiveSection.PaperWidth;this.FFrmRecord.EmrView.ActiveSection.PaperWidth=this.FFrmRecord.EmrView.ActiveSection.PaperHeight,this.FFrmRecord.EmrView.ActiveSection.PaperHeight=o}e&&this.FrmRecord.EmrView.ResetActiveSectionMargin()}},{key:"ExportPDF",value:function(){this.doExportPDF(this.FFrmRecord.EmrView)}},{key:"ExportTXT",value:function(){this.doExportTXT(this.FFrmRecord.EmrView)}},{key:"ImportTXT",value:function(){this.doImportTXT(this.FFrmRecord.EmrView)}},{key:"ImportXML",value:function(){this.doImportXML(this.FFrmRecord.EmrView)}},{key:"ExportXML",value:function(){this.doExportXML(this.FFrmRecord.EmrView)}},{key:"ExportHTML",value:function(){this.doExportHTML(this.FFrmRecord.EmrView)}},{key:"toolBar",get:function(){return this.ToolBar}},{key:"ToolBar",get:function(){return this.FFrmRecord.captionBar}},{key:"isChanged",get:function(){return this.IsChanged},set:function(t){this.IsChanged=t}},{key:"IsChanged",get:function(){return this.FFrmRecord.EmrView.IsChanged},set:function(t){this.FFrmRecord.EmrView.IsChanged=t}},{key:"designMode",get:function(){return this.DesignMode},set:function(t){this.DesignMode=t}},{key:"DesignMode",get:function(){return this.FFrmRecord.EmrView.DesignModeEx},set:function(t){this.FFrmRecord.EmrView.DesignModeEx=t}},{key:"procCount",get:function(){return this.ProcCount}},{key:"ProcCount",get:function(){return this.FFrmRecord.EmrView.ProcCount}},{key:"editProcIndex",get:function(){return this.EditProcIndex},set:function(t){this.EditProcIndex=t}},{key:"EditProcIndex",get:function(){return this.FFrmRecord.EmrView.EditProcIndex},set:function(t){this.FFrmRecord.EmrView.EditProcIndex=t}},{key:"CaretProcInfo",get:function(){return this.FFrmRecord.EmrView.FCaretProcInfo}},{key:"showProcSplit",get:function(){return this.ShowProcSplit},set:function(t){this.ShowProcSplit=t}},{key:"ShowProcSplit",get:function(){return this.FFrmRecord.EmrView.ShowProcSplit},set:function(t){this.FFrmRecord.EmrView.ShowProcSplit=t}},{key:"readOnly",get:function(){return this.ReadOnly},set:function(t){this.ReadOnly=t}},{key:"ReadOnly",get:function(){return this.FFrmRecord.EmrView.ReadOnly},set:function(t){this.FFrmRecord.EmrView.ReadOnly=t}},{key:"trace",get:function(){return this.Trace},set:function(t){this.Trace=t}},{key:"Trace",get:function(){return this.FFrmRecord.EmrView.Trace},set:function(t){this.FFrmRecord.EmrView.Trace=t}},{key:"secret",get:function(){return this.Secret},set:function(t){this.Secret=t}},{key:"Secret",get:function(){return this.FFrmRecord.EmrView.Secret},set:function(t){this.FFrmRecord.EmrView.Secret=t}},{key:"hideTrace",get:function(){return this.HideTrace},set:function(t){this.HideTrace=t}},{key:"HideTrace",get:function(){return this.FFrmRecord.EmrView.HideTrace},set:function(t){this.FFrmRecord.EmrView.HideTrace=t}},{key:"TraceInfoAnnotate",get:function(){return this.FFrmRecord.EmrView.TraceInfoAnnotate},set:function(t){this.FFrmRecord.EmrView.TraceInfoAnnotate=t}},{key:"UnAllocWarning",get:function(){return this.FFrmRecord.EmrView.UnAllocWarning},set:function(t){this.FFrmRecord.EmrView.UnAllocWarning=t}},{key:"FrmRecord",get:function(){return this.FFrmRecord}},{key:"InnerView",get:function(){return this.FFrmRecord.EmrView}},{key:"HCL",get:function(){return or}},{key:"HC",get:function(){return lp}},{key:"HCServer",get:function(){return this.FHCServer},set:function(t){var e=this;this.FHCServer=t,Ni.post(this.FHCServer,{CMD:"1000"},(function(t){var i=JSON.parse(t);e.CopyRight=i.comp+" "+i.hosp}))}},{key:"CheckNullItem",get:function(){return lp.CHECKNULLITEM},set:function(t){lp.CHECKNULLITEM=t}},{key:"OnCaretItemChanged",get:function(){return this.FFrmRecord.EmrView.OnSectionCaretItemChanged},set:function(t){this.FFrmRecord.EmrView.OnSectionCaretItemChanged=null!=t?function(){t()}:null}},{key:"OnDomainSwitch",get:function(){return this.FrmRecord.EmrView.OnSectionDataDomainSwitch},set:function(t){this.FFrmRecord.EmrView.OnSectionDataDomainSwitch=null!=t?function(e,i,n){t(e,i,n)}:null}},{key:"OnChangedSwitch",get:function(){return this.FFrmRecord.OnChangedSwitch},set:function(t){this.FFrmRecord.OnChangedSwitch=null!=t?function(){t()}:null}},{key:"OnSave",get:function(){return this.FFrmRecord.OnSave},set:function(t){this.FFrmRecord.OnSave=null!=t?function(){t()}:null}},{key:"OnExternalDeItemPopup",get:function(){return this.FFrmRecord.OnExternalDeItemPopupLib},set:function(t){this.FFrmRecord.OnExternalDeItemPopupLib=null!=t?function(e,i,n){return t(e,i,n)}:null}},{key:"OnPopupGetDeItemInfo",get:function(){return this.FFrmRecord.OnPopupGetDeItemInfoLib},set:function(t){this.FFrmRecord.OnPopupGetDeItemInfoLib=null!=t?function(e){return t(e)}:null}},{key:"OnItemPopupSetClose",get:function(){return this.FFrmRecord.OnItemPopupSetCloseLib},set:function(t){this.FFrmRecord.OnItemPopupSetCloseLib=null!=t?function(e){return t(e)}:null}},{key:"OnPopupGetDeItemDomain",get:function(){return this.FFrmRecord.OnPopupGetDeItemDomainLib},set:function(t){this.FFrmRecord.OnPopupGetDeItemDomainLib=null!=t?function(e){return t(e)}:null}},{key:"OnPopupGetDomainItemExtraLib",get:function(){return this.FFrmRecord.OnPopupGetDomainItemExtraLib},set:function(t){this.FFrmRecord.OnPopupGetDomainItemExtraLib=t}},{key:"OnSetDeItemText",get:function(){return this.FFrmRecord.OnSetDeItemText},set:function(t){this.FFrmRecord.OnSetDeItemText=null!=t?function(e,i){return t(e,i)}:null}},{key:"OnSaveItem",get:function(){return this.FFrmRecord.EmrView.OnSaveItem},set:function(t){this.FFrmRecord.EmrView.OnSaveItem=null!=t?function(e,i,n){t(e,i,n)}:null}},{key:"OnCutAfter",get:function(){return this.FrmRecord.EmrView.OnCutAfter},set:function(t){this.FFrmRecord.EmrView.OnCutAfter=null!=t?function(){t()}:null}},{key:"OnCopyAfter",get:function(){return this.FrmRecord.EmrView.OnCopyAfter},set:function(t){this.FFrmRecord.EmrView.OnCopyAfter=null!=t?function(){t()}:null}},{key:"OnPasteBefor",get:function(){return this.FrmRecord.EmrView.OnPasteBefor},set:function(t){this.FFrmRecord.EmrView.OnPasteBefor=null!=t?function(){return t()}:null}},{key:"OnSectionInsertItem",get:function(){return this.FFrmRecord.OnInsertDeItem},set:function(t){this.FFrmRecord.OnInsertDeItem=null!=t?function(e,i,n){t(e,i,n)}:null}},{key:"OnInserItemSync",get:function(){return this.FFrmRecord.EmrView.OnSyncDeItem},set:function(t){null!=t?this.FFrmRecord.EmrView.OnSyncDeItem=function(e,i,n){t(e,i,n)}:this.FrmRecord.EmrView.OnSyncDeItem=null}},{key:"OnDeComboboxPopup",get:function(){return this.FFrmRecord.OnDeComboboxPopup},set:function(t){this.FFrmRecord.OnDeComboboxPopup=null!=t?function(e){return t(e)}:null}},{key:"OnCanEdit",get:function(){return this.FFrmRecord.EmrView.OnSectionCanEdit},set:function(t){this.FFrmRecord.EmrView.OnSectionCanEdit=null!=t?function(e){return t(e)}:null}},{key:"OnDeItemPopup",get:function(){return this.FFrmRecord.OnDeItemPopup},set:function(t){this.FrmRecord.OnDeItemPopup=null!=t?function(e){return t(e)}:null}},{key:"OnMouseUp",get:function(){return this.FFrmRecord.OnMouseUpLib},set:function(t){this.FFrmRecord.OnMouseUpLib=null!=t?function(e,i){t(e,i)}:null}},{key:"OnPopupFormClose",get:function(){return this.FFrmRecord.OnPopupFormClose},set:function(t){this.FFrmRecord.OnPopupFormClose=null!=t?function(){t()}:null}},{key:"OnChange",get:function(){return this.FFrmRecord.EmrView.OnChange},set:function(t){this.FFrmRecord.EmrView.OnChange=null!=t?function(){t()}:null}},{key:"OnDblClick",get:function(){return this.FFrmRecord.EmrView.onDblClick},set:function(t){this.FrmRecord.EmrView.onDblClick=null!=t?function(e){t()}:null}},{key:"OnDeItemGetSyncValue",get:function(){return this.FFrmRecord.OnDeItemGetSyncValue},set:function(t){this.FFrmRecord.OnDeItemGetSyncValue=null!=t?function(e){return t(e)}:null}},{key:"OnDrawTrace",get:function(){return this.FFrmRecord.EmrView.OnDrawTrace},set:function(t){this.FFrmRecord.EmrView.OnDrawTrace=null!=t?function(e,i,n){t(e,i,n)}:null}},{key:"OnSyntaxCheck",get:function(){return this.FFrmRecord.OnSyntaxCheck},set:function(t){this.FFrmRecord.EmrView.OnSyntaxCheck=null!=t?function(e,i,n){t(e,i,n)}:null}},{key:"OnSyntaxPaint",get:function(){return this.FFrmRecord.OnSyntaxPaint},set:function(t){this.FFrmRecord.OnSyntaxPaint=null!=t?function(e,i,n,o,r,s){t(e,i,n,o,r,s)}:null}}])&&BC(e.prototype,i),n&&BC(e,n),t}();e.default=EC}]).default; |