@aurigma/ui-framework
Version:
A platform which allows building print product personalization editors based on Aurigma's Customer's Canvas.
9 lines • 1.32 MB
JavaScript
(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[54],Array(406).concat([function(t,e,n){"use strict";n.r(e),n.d(e,"getOrientedSquare",(function(){return r.h})),n.d(e,"getBounds",(function(){return r.f})),n.d(e,"getTriangleAngle",(function(){return r.l})),n.d(e,"normalizeAngle",(function(){return r.m})),n.d(e,"getScalarProduct",(function(){return r.i})),n.d(e,"getSquareDistanceToSegment",(function(){return r.k})),n.d(e,"getSquareDistanceToPoint",(function(){return r.j})),n.d(e,"getLineWidth",(function(){return r.g})),n.d(e,"ConvertDegreeToRadian",(function(){return r.c})),n.d(e,"ConvertRadianToDegree",(function(){return r.d})),n.d(e,"Clamp",(function(){return r.a})),n.d(e,"EqualsOfFloatNumbers",(function(){return r.e})),n.d(e,"CompareRectangels",(function(){return r.b})),n.d(e,"Matrix",(function(){return i.a})),n.d(e,"PathSegment",(function(){return o.b})),n.d(e,"Path",(function(){return o.a})),n.d(e,"PointF",(function(){return a.a})),n.d(e,"RectangleF",(function(){return s.a})),n.d(e,"RotatedRectangleF",(function(){return c})),n.d(e,"SizeF",(function(){return h})),n.d(e,"Transform",(function(){return l.a}));var r=n(422),i=n(471),o=n(448),a=n(431),s=n(428),l=n(449),u=n(407),c=function(){function t(t,e,n,r,i){this.centerX=t||0,this.centerY=e||0,this.width=n||0===n?n:2,this.height=r||0===r?r:2,this.angle=i||0}return t.prototype.getSimplifiedObject=function(){return{centerX:this.centerX,centerY:this.centerY,width:this.width,height:this.height,angle:this.angle}},t.prototype.clone=function(){return new t(this.centerX,this.centerY,this.width,this.height,this.angle)},Object.defineProperty(t.prototype,"bounds",{get:function(){for(var t=new a.a(this.centerX,this.centerY),e=this.width,n=this.height,r=[new a.a(-e/2,-n/2),new a.a(-e/2,n/2),new a.a(e/2,-n/2),new a.a(e/2,n/2)],i=0,o=0,l=0,u=0,c=0;c<4;c++)r[c].rotate(this.angle),(r[c].x<i||0===c)&&(i=r[c].x),(r[c].y<o||0===c)&&(o=r[c].y),(r[c].x>l||0===c)&&(l=r[c].x),(r[c].y>u||0===c)&&(u=r[c].y);return new s.a(i+t.x,o+t.y,l-i,u-o)},enumerable:!0,configurable:!0}),t.prototype.equals=function(t,e){return null!=t&&Object(r.e)(this.centerX,t.centerX,e)&&Object(r.e)(this.centerY,t.centerY,e)&&Object(r.e)(this.width,t.width,e)&&Object(r.e)(this.height,t.height,e)&&Object(r.e)(this.angle,t.angle,e)},t.prototype.getUpperLeftCorner=function(){var t=new a.a(-this.width/2,-this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getUpperCenterPoint=function(){var t=new a.a(0,-this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getLeftCenterPoint=function(){var t=new a.a(-this.width/2,0);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getRightCenterPoint=function(){var t=new a.a(this.width/2,0);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getUpperRightCorner=function(){var t=new a.a(this.width/2,-this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getBottomRightCorner=function(){var t=new a.a(this.width/2,this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getBottomLeftCorner=function(){var t=new a.a(-this.width/2,this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype.getBottomCenterPoint=function(){var t=new a.a(0,this.height/2);return(t=t.rotate(this.angle)).translate(this.centerX,this.centerY)},t.prototype._checkProjectionIntersection=function(t,e){var n=this._getProjections(t),r=this._getProjections(e);return n.left<=r.right&&n.right>=r.left&&n.top<=r.bottom&&n.bottom>=r.top},t.prototype._getProjections=function(t){var e,n,r,i;e=n=t[0].x,r=i=t[0].y;for(var o=1;o<t.length;o++)e=Math.min(e,t[o].x),n=Math.max(n,t[o].x),r=Math.min(r,t[o].y),i=Math.max(i,t[o].y);return{left:e,right:n,top:r,bottom:i}},t.prototype.intersectsWith=function(t){var e=this.clone(),n=t.clone();if(!Object(r.e)(this.angle,0)){var i=e.angle;e.angle=0,(o=n.center).rotateAt(-i,e.center),n.center=o,n.angle-=i}var o,a=[e.getUpperLeftCorner(),e.getUpperRightCorner(),e.getBottomRightCorner(),e.getBottomLeftCorner()],s=[n.getUpperLeftCorner(),n.getUpperRightCorner(),n.getBottomRightCorner(),n.getBottomLeftCorner()],l=this._checkProjectionIntersection(a,s),u=!0;l&&!Object(r.e)(this.angle,t.angle)&&(e=this.clone(),i=(n=t.clone()).angle,n.angle=0,(o=e.center).rotateAt(-i,n.center),e.center=o,e.angle-=i,a=[e.getUpperLeftCorner(),e.getUpperRightCorner(),e.getBottomRightCorner(),e.getBottomLeftCorner()],s=[n.getUpperLeftCorner(),n.getUpperRightCorner(),n.getBottomRightCorner(),n.getBottomLeftCorner()],u=this._checkProjectionIntersection(a,s));return l&&u},Object.defineProperty(t.prototype,"location",{get:function(){return this.getUpperLeftCorner()},set:function(t){var e=this.getUpperLeftCorner();this.centerX=this.centerX+(t.x-e.x),this.centerY=this.centerY+(t.y-e.y)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return new a.a(this.centerX,this.centerY)},set:function(t){this.centerX=t.x,this.centerY=t.y},enumerable:!0,configurable:!0}),t.prototype.rotateAt=function(t,e){var n=this.center;return n.rotateAt(t,e),this.center=n,this.angle+=t,this},t.prototype.translate=function(t,e){this.centerX+=t,this.centerY+=e},t.prototype.setTransform=function(t){null==t||t.equals(new l.a)||(this.width*=t.scaleX,this.height*=t.scaleY,this.angle+=t.angle,this.centerX+=t.translateX,this.centerY+=t.translateY)},t.prototype.getTransform=function(t){if(null==t||this.equals(t))return new l.a;var e=0===t.width?0:this.width/t.width,n=0===t.height?0:this.height/t.height,r=this.angle-t.angle,i=t.center,o=this.centerX-i.x,a=this.centerY-i.y;return new l.a(e,n,o,a,r)},t.prototype.transform=function(t,e){this.rotateAt(t.angle,e),t.setAngle(0),this.setTransform(t)},t.prototype.toString=function(){return[this.centerX,this.centerY,this.width,this.height,this.angle].join(",")},t.prototype.toRectangleF=function(){return new s.a(this.centerX-this.width/2,this.centerY-this.height/2,this.width,this.height)},t.prototype.contains=function(t){var e=this.clone();e.angle=0;var n=t.clone();return n.rotateAt(-this.angle,this.center),e.bounds.contains(n)},t.prototype.getCornerByIndex=function(t){switch(t){case 0:return this.getUpperLeftCorner();case 1:return this.getUpperRightCorner();case 2:return this.getBottomRightCorner();case 3:return this.getBottomLeftCorner();default:return null}},t.prototype.transformByMatrix=function(e,n){void 0===n&&(n=null);var i=[this.center.clone(),this.getUpperLeftCorner(),this.getUpperRightCorner(),this.getBottomRightCorner(),this.getBottomLeftCorner()].map((function(t){return e.transformPoint(t)})),o=Object(r.m)(null!=n?this.angle+n:this.angle),a=i[0],s=i.slice(1,5).map((function(t){return t.rotateAt(-o,a)}));if(!Object(r.e)(s[0].x,s[3].x,.01)||!Object(r.e)(s[0].y,s[1].y,.01))throw new u.a("RotatedRectangle: Scew is not supported");var l=Math.abs(s[1].x-s[0].x),c=Math.abs(s[2].y-s[1].y);return new t(a.x,a.y,l,c,o)},t.prototype.withoutAngle=function(){return new t(this.centerX,this.centerY,this.width,this.height,0)},t.union=function(e,n){var r=e.clone(),i=n.clone(),o=r.angle,l=r.center;r.angle=0,i.rotateAt(-o,l);var u=s.a.union(r.bounds,i.bounds),c=new a.a(u.left+u.width/2,u.top+u.height/2),h=new t;h.center=c;var p=-1===Math.sign(e.width)||-1===Math.sign(n.width)?-1:1,f=-1===Math.sign(e.height)||-1===Math.sign(n.height)?-1:1;return h.width=u.width*p,h.height=u.height*f,h.rotateAt(o,l),h},t.fromRectangleF=function(e,n){return new t(e.left+e.width/2,e.top+e.height/2,e.width,e.height,"number"==typeof n?n:0)},t.FromLTRB=function(e,n,r,i){return t.fromRectangleF(s.a.FromLTRB(e,n,r,i))},t.getRectWithOffset=function(t,e){if(null==t)throw new u.a("RotatedRectangleF.getRectWithOffset: rectangle cannot be null!");return null==e||e.isOrigin()?t.clone():t.transformByMatrix((new i.a).translate(e.x,e.y))},t}(),h=function(){function t(t,e){this.width=0,this.height=0,this.width=t,this.height=e}return t.prototype.clone=function(){return new t(this.width,this.height)},t.prototype.toString=function(){return[this.width,this.height].join(",")},t.prototype.updateByMatrix=function(t){return t.updateObjectByMatrix(this,"width","height"),this},t}()},function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"f",(function(){return c})),n.d(e,"d",(function(){return h}));var r,i,o=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(n){var r=t.call(this,n)||this;return r.name="CustomersCanvasException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e.prototype.toString=function(){return this.name+": "+this.message},e.prototype.toJSON=function(){return{name:this.name,innerException:this.innerException,message:this.message}},e}(Error),s=function(t){function e(n){var r=t.call(this,n)||this;return r.name="NotImplementedException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e}(a),l=function(t){function e(n){var r=t.call(this,n)||this;return r.name="ArgumentException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e}(a),u=function(t){function e(n){var r=t.call(this,n)||this;return r.name="ArgumentNullException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e}(l),c=function(t){function e(n){var r=t.call(this,n)||this;return r.name="OutOfRangeException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e}(a),h=function(t){function e(n){var r=t.call(this,n)||this;return r.name="InvalidOperationException",Object.setPrototypeOf(r,e.prototype),r}return o(e,t),e}(a);o((function t(e){var n=i.call(this,e)||this;return n.name="UnexpectedDataException",Object.setPrototypeOf(n,t.prototype),n}),i=a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return c}));var r,i=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},a=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t},s=function(){function t(){this._listeners=[]}return t.prototype.add=function(t){this._listeners.includes(t)||this._listeners.push(t)},t.prototype.remove=function(t){this._listeners=this._listeners.filter((function(e){return e!==t}))},t.prototype.listenersCount=function(){return this._listeners.length},t.prototype.notify=function(){for(var t,e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{for(var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this._listeners),o=i.next();!o.done;o=i.next())o.value.apply(void 0,a(n))}catch(s){t={error:s}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},t}(),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.add=function(e){t.prototype.add.call(this,e)},e.prototype.remove=function(e){t.prototype.remove.call(this,e)},e.prototype.notify=function(e){t.prototype.notify.call(this,e)},e.prototype.fire=function(t){this.notify(t)},e}(s),u=function(t){function e(e){var n=t.call(this)||this;return n._sender=e,n}return i(e,t),e.prototype.add=function(e){t.prototype.add.call(this,e)},e.prototype.remove=function(e){t.prototype.remove.call(this,e)},e.prototype.notify=function(e){t.prototype.notify.call(this,this._sender,e)},e.prototype.fire=function(t){this.notify(t)},e}(s),c=function(t){function e(e){void 0===e&&(e=null);var n=t.call(this)||this;return n._sender=e,n}return i(e,t),e.prototype.add=function(e){t.prototype.add.call(this,e)},e.prototype.remove=function(e){t.prototype.remove.call(this,e)},e.prototype.notify=function(e,n){t.prototype.notify.call(this,e,n)},e}(s)},function(t,e,n){"use strict";n.d(e,"p",(function(){return h})),n.d(e,"g",(function(){return p})),n.d(e,"c",(function(){return f})),n.d(e,"d",(function(){return d})),n.d(e,"l",(function(){return g})),n.d(e,"m",(function(){return m})),n.d(e,"k",(function(){return v})),n.d(e,"h",(function(){return b})),n.d(e,"i",(function(){return w})),n.d(e,"e",(function(){return C})),n.d(e,"f",(function(){return P})),n.d(e,"n",(function(){return S})),n.d(e,"j",(function(){return x})),n.d(e,"q",(function(){return I})),n.d(e,"a",(function(){return O})),n.d(e,"b",(function(){return T})),n.d(e,"o",(function(){return L}));var r=n(407),i=(n(489),n(416)),o=n(425),a=n(534),s=n(406),l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},u=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},c=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t};function h(t,e,n){var r=!1;return null!=n&&(r="boolean"==typeof n?n:n.ignoreCase),(t=r?t.toLowerCase():t)===(r?e.toLowerCase():e)}function p(t,e){if(null==t&&null==e)return!0;if(null==t&&null!=e||null!=t&&null==e)return!1;var n,r=typeof t;if(r!==typeof e)return!1;if("string"===r||"boolean"===r)return t===e;if("number"===r)return Object(s.EqualsOfFloatNumbers)(t,e);if(Array.isArray(t)&&Array.isArray(e))return t.length===e.length&&f(t,e);var i=e;return n="function"==typeof t.equals&&"function"==typeof i.equals?function(t,e){return t.equals(e)}:function(t,e){return t==e},n(t,e)}function f(t,e){return null==t&&null==e||null!=t&&null!=e&&t.length===e.length&&t.reduce((function(t,n,r){return t&&p(n,e[r])}),!0)}function d(t,e){return(null==t?void 0:t.length)===(null==e?void 0:e.length)&&t.reduce((function(t,n,r){return t&&n==e[r]}),!0)}function g(t){return null==t||""===t.trim()}function m(t,e){return void 0===e&&(e=!0),!(g(t)||!t.startsWith("<"))&&(e&&(t=y(t)),null==(new DOMParser).parseFromString("<root>"+t+"</root>","application/xml").querySelector("parsererror"))}function y(t){if(g(t)||!t.startsWith("<"))return t;for(var e=[t];;){var n=e.pop(),r=n.indexOf("&");if(-1===r){e.push(n);break}e.push(n.substring(0,r));var i=_(n,r);null!=i?(e.push(i.entity),e.push(n.substring(r+i.length))):(e.push("&"),e.push(n.substring(r+1)))}return e.join("")}function _(t,e){var n=t.substring(e,e+4).toLowerCase();if("<"==n)return{entity:"<",length:4};if(">"==n)return{entity:">",length:4};if("&"==t.substring(e,e+5).toLowerCase())return{entity:"&",length:5};var r=t.substring(e,e+6).toLowerCase();if("'"==r)return{entity:"'",length:6};if("""==r)return{entity:""",length:6};var i=t.substring(e,e+7).toLowerCase();if(i.match(/^&#[\\d]{4};$$/))return{entity:i,length:7};var o=t.substring(e,e+8);return o.toLowerCase().match(/^&#x[\\dabcdef]{4};$/)?{entity:o,length:8}:null}function v(t,e){var n,r,o,a;void 0===e&&(e=" ");var s=new DOMParser;t=y(t);var u=s.parseFromString("<root>"+t+"</root>","application/xml"),c=u.querySelector("parsererror");if(null==c){try{for(var h=l(Array.from(u.querySelectorAll("br"))),p=h.next();!p.done;p=h.next())p.value.textContent=e}catch(b){n={error:b}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var f=Array.from(u.querySelectorAll("p, li"));if(f.length>1){var d=i.n(f,f[f.length-1]);try{for(var g=l(d),m=g.next();!m.done;m=g.next()){var _=m.value,v=document.createElementNS("application/xml","span");v.textContent=e,_.appendChild(v)}}catch(w){o={error:w}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}return u.querySelector("root").textContent}return console.warn("Bad value xmlObject",u,c.innerHTML),function(t){var e=(new DOMParser).parseFromString("<span></span>","application/xml");e.querySelector("span").textContent=t;var n=(new XMLSerializer).serializeToString(e);return n.replace("<span>","").replace("</span>","").replace("<span/>","").replace("<span />","")}(t)}function b(t){var e,n,r=[];if(t instanceof Array)try{for(var i=l(t),o=i.next();!o.done;o=i.next()){var a=o.value;r.push.apply(r,c(a))}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function w(t){var e=[];if(m(t=y(t),!1))try{null!=t&&function(t,n){var r=(new DOMParser).parseFromString("<body>"+t+"</body>","application/xml"),i={acceptNode:function(t){var e=t.nodeName.toLowerCase();return n.includes(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}};o.a.IsIE()&&(i=function(t){return t.acceptNode}(i));for(var a,s,u=document.createTreeWalker(r.childNodes[0],NodeFilter.SHOW_ELEMENT,i,!1);u.nextNode();)a=u.currentNode,s=void 0,s=function(t){var e,n,r=t.attributes.getNamedItem("style");if(null==r||null==r.value)return null;var i=r.value.split(";"),o=new Map;try{for(var a=l(i),s=a.next();!s.done;s=a.next()){var u=s.value;if(null!=(u=u.trim())&&""!==u){var c=u.split(":"),h=c[0].trim(),p=c[1].trim();o.set(h,p)}}}catch(f){e={error:f}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return o}(a),null!=s&&s.has("font-name")&&e.push(s.get("font-name"))}(t,["span","ol","ul"])}catch(n){console.error("Unexpected exception while parsing item text"),console.error(n)}return i.m(e)}function C(t,e,n){if((s=n,null==s&&(s={}),i.b(s,{deep:!1,ignoreNull:!0}),n=s).ignoreNull)for(var r=0;r<e.length;r++){var o=Object(a.a)(e[r]);u(o),e[r]=o}var s;return n.deep?function t(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(var i=e,o=c(n),a=function(e){for(var n in e)e.hasOwnProperty(n)&&("object"==typeof e[n]&&null!=i[n]?"object"==typeof i[n]?i[n]=t(i[n],e[n]):i=e[n]:i[n]=e[n])},s=0;s<o.length;s++)a(o[s]);return i}.apply(void 0,c([t],e)):Object.assign.apply(Object,c([t],e));function u(t){var e,n;try{for(var r=l(Object.keys(t)),i=r.next();!i.done;i=r.next()){var o=i.value,a=t[o];null===a?t.hasOwnProperty(o)?delete t[o]:t[o]=void 0:"object"==typeof a&&u(a)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}}function P(t,e){return C(t,[e],{deep:!0})}function S(t,e){return null==t&&(t={}),i.b(t,e),t}function x(t,e){var n=Object.getOwnPropertyNames(t);return n[n.map((function(e){return t[e].toString().toLowerCase()})).indexOf(e.toLowerCase())]}function I(t,e){null==e?e=[]:"string"==typeof e&&(e=[e]);var n=[];for(var r in t)n.push(r);var i=n.filter((function(n){var r,i;try{for(var o=l(["_","$$"]),a=o.next();!a.done;a=o.next()){var s=a.value;if(n.startsWith(s))return!1}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return!e.some((function(t){return t===n}))&&"function"!=typeof t[n]}));return i.reduce((function(e,n){return e[n]=t[n],e}),{})}function O(t,e){return null!=e?e:t}function T(t,e){return void 0!==e?e:t}function L(t,e){var n=null;if("number"!=typeof(n="string"==typeof t&&/%$/.test(t)?e*Number(t.split(/%/)[0])/100:Number(t))||isNaN(n))throw new r.a("'"+t+"' is not a number or percent string");return n}new Map},function(t,e,n){"use strict";n.d(e,"n",(function(){return o.a})),n.d(e,"ob",(function(){return u})),n.d(e,"N",(function(){return c.a})),n.d(e,"kb",(function(){return h.a})),n.d(e,"u",(function(){return p.a})),n.d(e,"o",(function(){return f.a})),n.d(e,"p",(function(){return d.a})),n.d(e,"g",(function(){return g.a})),n.d(e,"k",(function(){return N})),n.d(e,"B",(function(){return k})),n.d(e,"j",(function(){return b.a})),n.d(e,"m",(function(){return i})),n.d(e,"ub",(function(){return S})),n.d(e,"i",(function(){return x})),n.d(e,"l",(function(){return m.a})),n.d(e,"q",(function(){return A.a})),n.d(e,"r",(function(){return F.a})),n.d(e,"s",(function(){return F.b})),n.d(e,"t",(function(){return F.c})),n.d(e,"O",(function(){return F.d})),n.d(e,"v",(function(){return B.a})),n.d(e,"x",(function(){return M.a})),n.d(e,"y",(function(){return G})),n.d(e,"A",(function(){return Y})),n.d(e,"E",(function(){return J.a})),n.d(e,"G",(function(){return Z.a})),n.d(e,"F",(function(){return et})),n.d(e,"I",(function(){return nt.a})),n.d(e,"J",(function(){return rt.a})),n.d(e,"K",(function(){return it.a})),n.d(e,"L",(function(){return ot.a})),n.d(e,"M",(function(){return lt})),n.d(e,"P",(function(){return ut.a})),n.d(e,"Q",(function(){return ct.a})),n.d(e,"R",(function(){return ht.g})),n.d(e,"S",(function(){return ht.h})),n.d(e,"b",(function(){return ht.a})),n.d(e,"e",(function(){return ht.d})),n.d(e,"d",(function(){return ht.c})),n.d(e,"c",(function(){return ht.b})),n.d(e,"z",(function(){return ht.f})),n.d(e,"f",(function(){return ht.e})),n.d(e,"T",(function(){return V})),n.d(e,"V",(function(){return H})),n.d(e,"W",(function(){return pt.a})),n.d(e,"Y",(function(){return ft.a})),n.d(e,"Z",(function(){return dt.a})),n.d(e,"ab",(function(){return bt})),n.d(e,"bb",(function(){return mt})),n.d(e,"vb",(function(){return wt.d})),n.d(e,"H",(function(){return wt.a})),n.d(e,"ib",(function(){return wt.c})),n.d(e,"cb",(function(){return wt.b})),n.d(e,"db",(function(){return Ct.a})),n.d(e,"eb",(function(){return Pt.a})),n.d(e,"fb",(function(){return xt})),n.d(e,"gb",(function(){return It.a})),n.d(e,"hb",(function(){return _.a})),n.d(e,"a",(function(){return Rt})),n.d(e,"jb",(function(){return Et.a})),n.d(e,"lb",(function(){return jt.a})),n.d(e,"nb",(function(){return Nt.a})),n.d(e,"U",(function(){return kt.a})),n.d(e,"pb",(function(){return kt.b})),n.d(e,"D",(function(){return yt.d})),n.d(e,"mb",(function(){return yt.f})),n.d(e,"X",(function(){return yt.e})),n.d(e,"qb",(function(){return yt.g})),n.d(e,"sb",(function(){return yt.h})),n.d(e,"C",(function(){return yt.c})),n.d(e,"h",(function(){return yt.a})),n.d(e,"w",(function(){return yt.b})),n.d(e,"rb",(function(){return At.a})),n.d(e,"tb",(function(){return Ft.a})),n.d(e,"wb",(function(){return Bt.a})),n.d(e,"xb",(function(){return Q.a}));var r,i,o=n(492),a=n(416),s=n(409),l=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n}return l(e,t),e.prototype._copy=function(e,n,r,i){return t.prototype._copy.call(this,e,n,r,i),n.sourceDpi=e.sourceDpi,n.smartObjectDpi=e.smartObjectDpi,n.smartObjectRectangle=e.smartObjectRectangle,n.smartObjectSize=e.smartObjectSize,n.smartObjectStorageId=e.smartObjectStorageId,null!=e.warpControlPoints&&(n.warpControlPoints=e.warpControlPoints.map((function(t){return t}))),null!=e.projectiveTransform&&(n.projectiveTransform=e.projectiveTransform.map((function(t){return t}))),null!=e.vectorMask&&(n.vectorMask=e.vectorMask.map((function(t){return t}))),n},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this.sourceDpi,e.sourceDpi)&&Object(s.g)(this.smartObjectDpi,e.smartObjectDpi)&&a.h(this.smartObjectRectangle,e.smartObjectRectangle)&&a.h(this.smartObjectSize,e.smartObjectSize)&&Object(s.g)(this.smartObjectStorageId,e.smartObjectStorageId)&&Object(s.d)(this.warpControlPoints,e.warpControlPoints)&&Object(s.d)(this.projectiveTransform,e.projectiveTransform)&&Object(s.d)(this.vectorMask,e.vectorMask)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="SmartItem",e}(o.a),c=n(451),h=n(462),p=n(498),f=n(435),d=n(461),g=n(555),m=n(502),y=n(407),_=n(438),v=n(411),b=n(473);!function(t){t.None="None",t.VCard="VCard",t.Phone="Phone",t.Url="Url",t.Data="Data"}(i||(i={}));var w,C=n(861),P=n(556);!function(t){t[t.none=0]="none",t[t.dom=1]="dom",t[t.intl=2]="intl",t[t.postal=4]="postal",t[t.parcel=8]="parcel",t[t.home=16]="home",t[t.work=32]="work",t[t.pref=64]="pref"}(w||(w={}));var S=function(){function t(t){void 0===t&&(t={}),this.type=[w.none],Object.assign(this,t)}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return!(this.POBox||this.extendedAddress||this.address||this.locality||this.state||this.zipCode||this.country)},enumerable:!0,configurable:!0}),t.prototype.equals=function(t){return this.POBox===t.POBox&&this.extendedAddress===t.extendedAddress&&this.address===t.address&&this.locality===t.locality&&this.state===t.state&&this.zipCode===t.zipCode&&this.country===t.country},t.prototype.toVCardValue=function(){return[this.POBox,this.extendedAddress,this.address,this.locality,this.state,this.zipCode,this.country]},t.fromVCardValue=function(e,n){var r=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(e,7),i=r[0],o=r[1],a=r[2],s=r[3];return new t({POBox:i,extendedAddress:o,address:a,state:r[4],zipCode:r[5],locality:s,country:r[6],type:Object.keys(n).map((function(t){return w[t]}))})},t}(),x=function(){function t(t){if(this.barcodeFormat=b.a.QR_CODE,this.barcodeSubType=i.None,this.addresses=[],"string"==typeof t)try{t=JSON.parse(t)}catch(e){console.warn("Unable to parse BarcodeData from string ",t,e),t=null}"object"==typeof t&&null!=t&&(Object.assign(this,t),this.addresses=Array.isArray(t.addresses)?t.addresses.map((function(t){return new S(t)})):[])}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return a.g(this.firstName)&&a.g(this.lastName)&&a.g(this.organization)&&a.g(this.position)&&a.g(this.email)&&a.g(this.mobilePhone)&&a.g(this.url)&&a.g(this.phone)&&a.g(this.data)&&a.g(this.barcodeValue)&&a.g(this.fax)&&(null==this.addresses||0===this.addresses.length)},enumerable:!0,configurable:!0}),t.prototype.equals=function(t){return null!=t&&this.barcodeFormat===t.barcodeFormat&&this.barcodeSubType===t.barcodeSubType&&this.firstName===t.firstName&&this.lastName===t.lastName&&this.organization===t.organization&&this.position===t.position&&this.email===t.email&&this.mobilePhone===t.mobilePhone&&this.url===t.url&&this.data===t.data&&this.phone===t.phone&&this.barcodeValue===t.barcodeValue&&this.fax===t.fax&&Object(P.a)(this.addresses,t.addresses)},t.prototype.toVCardString=function(){var t={n:[{value:[this.lastName,this.firstName,"","",""]}],"email;internet":[{value:this.email}],org:[{value:this.organization}],"tel;cell":[{value:this.mobilePhone}],"tel;work":[{value:this.phone}],"tel;fax":[{value:this.fax}],title:[{value:this.position}],url:[{value:this.url}]};return this.addresses.forEach((function(e){var n=e.type.map((function(t){return w[t]})).join(";");t["adr;"+n]=[{value:e.toVCardValue()}]})),C.generate(t)},t.fromVCardString=function(e){var n,r,o,a,s,l,u,c,h,p,f,d,g,m,y,_,v,w,P,x,I=null!=e?C.parse(e):{},O=new t;return O.barcodeFormat=b.a.QR_CODE,O.barcodeSubType=i.VCard,O.email=null===(r=null===(n=I.email)||void 0===n?void 0:n[0])||void 0===r?void 0:r.value,O.lastName=null===(a=null===(o=I.n)||void 0===o?void 0:o[0])||void 0===a?void 0:a.value[0],O.firstName=null===(l=null===(s=I.n)||void 0===s?void 0:s[0])||void 0===l?void 0:l.value[1],O.organization=null===(c=null===(u=I.org)||void 0===u?void 0:u[0])||void 0===c?void 0:c.value,O.mobilePhone=null===(p=null===(h=I.tel)||void 0===h?void 0:h.find((function(t){var e;return null===(e=null==t?void 0:t.meta)||void 0===e?void 0:e.cell})))||void 0===p?void 0:p.value,O.phone=null===(d=null===(f=I.tel)||void 0===f?void 0:f.find((function(t){var e;return null===(e=null==t?void 0:t.meta)||void 0===e?void 0:e.work})))||void 0===d?void 0:d.value,O.fax=null===(m=null===(g=I.tel)||void 0===g?void 0:g.find((function(t){var e;return null===(e=null==t?void 0:t.meta)||void 0===e?void 0:e.fax})))||void 0===m?void 0:m.value,O.position=null===(_=null===(y=I.title)||void 0===y?void 0:y[0])||void 0===_?void 0:_.value,O.url=null===(w=null===(v=I.url)||void 0===v?void 0:v[0])||void 0===w?void 0:w.value,O.addresses=null!==(x=null===(P=I.adr)||void 0===P?void 0:P.map((function(t){return S.fromVCardValue(t.value,t.meta)})))&&void 0!==x?x:[],O},t}(),I=n(415),O=n(423),T=n(434),L=n(437),R=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},j=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},N=function(t){function e(n,r,o,a){var s=t.call(this)||this;return s._barcodeContent="",s._barcodeFormat=b.a.QR_CODE,s._barcodeOptions=new k,s._barcodeSubType=i.Url,s._color=v.RgbColors.black,s.type=e.type,s._onOptionsPropertyChanged=function(t,e){s._propertyChanged.notify(s,"barcodeOptions")},s._barcodePermissions=new m.a,s._barcodeOptions.pureBarcode=!0,s._ignorePermissionsChange=!0,s.manipulationPermissions.resizeGrips=new _.a(!0,!1),s.itemPermissions.itemToolbarPermissions.showEditButton=!0,s.shapePermissions.allowChangeFillColor=!0,s.barcodePermissions.allowChangeBarcodeType=!1,s.barcodePermissions.allowChangeBarcodeColor=!0,s.barcodePermissions.allowChangeBarcodeContent=!0,s._ignorePermissionsChange=!1,s.fillColor=v.RgbColors.white,null!=n&&(s._barcodeFormat=n),null!=r&&(s._barcodeContent=r),null!=o&&(s._barcodeOptions=o),s._subscribeOptionsPropertyChanged(),null!=a&&(s.sourceRectangle=a),s.applyPermissionsConstrain(),s}return R(e,t),Object.defineProperty(e.prototype,"barcodePermissions",{get:function(){return this._barcodePermissions},set:function(t){if(null==t)throw new y.a("barcodePermissions cannot be null");Object(s.g)(this._barcodePermissions,t)||(this._barcodePermissions.propertyChanged.remove(this._onPermissionsChanged),this._barcodePermissions=t,this._barcodePermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"barcodeContent",{get:function(){return this._barcodeContent},set:function(t){this._barcodeContent!==t&&(this._barcodeContent=t,this._propertyChanged.notify(this,"barcodeContent"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"barcodeFormat",{get:function(){return this._barcodeFormat},set:function(t){this._barcodeFormat!==t&&(this._barcodeFormat=t,this._propertyChanged.notify(this,"barcodeFormat"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"barcodeSubType",{get:function(){return this._barcodeSubType},set:function(t){this._barcodeSubType!==t&&(this._barcodeSubType=t,this._propertyChanged.notify(this,"barcodeSubType"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){this._color.equals(t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"barcodeOptions",{get:function(){return this._barcodeOptions},set:function(t){JSON.stringify(this._barcodeOptions)!==JSON.stringify(t)&&(this._unsubscribeOptionsPropertyChanged(),this._barcodeOptions=t,this._subscribeOptionsPropertyChanged(),this._propertyChanged.notify(this,"barcodeOptions"))},enumerable:!0,configurable:!0}),e.prototype._subscribeOptionsPropertyChanged=function(){null!=this._barcodeOptions&&this._barcodeOptions.addPropertyChanged(this._onOptionsPropertyChanged)},e.prototype._unsubscribeOptionsPropertyChanged=function(){null!=this._barcodeOptions&&this._barcodeOptions.removePropertyChanged(this._onOptionsPropertyChanged)},Object.defineProperty(e.prototype,"isQrCode",{get:function(){return this.barcodeFormat===b.a.QR_CODE},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSquareCode",{get:function(){return this.barcodeFormat===b.a.QR_CODE||this.barcodeFormat===b.a.DATA_MATRIX},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLinearBarcode",{get:function(){return this.barcodeFormat===b.a.EAN_13||this.barcodeFormat===b.a.EAN_8||this.barcodeFormat==b.a.CODE_128||this.barcodeFormat===b.a.UPC_A||this.barcodeFormat===b.a.UPC_E},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.barcodePermissions=e.barcodePermissions.clone(),n.barcodeContent=e.barcodeContent,n.barcodeFormat=e.barcodeFormat,n.barcodeSubType=e.barcodeSubType,n.color=e.color.clone(),n.barcodeOptions=new k,n.barcodeOptions.width=e.barcodeOptions.width,n.barcodeOptions.height=e.barcodeOptions.height,n.barcodeOptions.margin=e.barcodeOptions.margin,n.barcodeOptions.pureBarcode=e.barcodeOptions.pureBarcode,n.barcodeOptions.errorCorrection=e.barcodeOptions.errorCorrection,n.barcodeOptions.characterSet=e.barcodeOptions.characterSet,n.barcodeOptions.pdf417Compact=e.barcodeOptions.pdf417Compact,n.barcodeOptions.pdf417Compaction=e.barcodeOptions.pdf417Compaction,n.barcodeOptions.pdf417Dimensions=e.barcodeOptions.pdf417Dimensions,n.barcodeOptions.disableEci=e.barcodeOptions.disableEci,n.barcodeOptions.code128ForceCodesetB=e.barcodeOptions.code128ForceCodesetB,n.barcodeOptions.aztecLayers=e.barcodeOptions.aztecLayers,n.barcodeOptions.qrVersion=e.barcodeOptions.qrVersion,n.barcodeOptions.xDimension=e.barcodeOptions.xDimension,n.barcodeOptions.databarExpandedSegments=e.barcodeOptions.databarExpandedSegments},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._barcodePermissions,e._barcodePermissions)&&Object(s.g)(this._barcodeContent,e._barcodeContent)&&Object(s.g)(this._barcodeFormat,e._barcodeFormat)&&Object(s.g)(this._barcodeSubType,e._barcodeSubType)&&Object(s.g)(this._color,e._color)&&Object(s.g)(this._barcodeOptions,e._barcodeOptions)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.prototype.getSimplifiedObject=function(e){a.f(e)||a.k(e)||(e=[]);var n=t.prototype.getSimplifiedObject.call(this,["barcodePermissions","isQrCode","isLinearBarcode","isSquareCode","barcodeData"].concat(e));return n.barcodePermissions=this.barcodePermissions.getSimplifiedObject(),n},e.prototype.applyPermissionsConstrain=function(){null!=this.itemPermissions&&null!=this.itemPermissions.itemToolbarPermissions&&(null==this.barcodePermissions||this.barcodePermissions.allowChangeBarcodeContent?this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=null:this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=this.barcodePermissions.allowChangeBarcodeContent,this.itemPermissions.itemToolbarPermissions.showSelectButton=!1)},Object.defineProperty(e.prototype,"barcodeData",{get:function(){var t=new x;if(t.barcodeSubType=this.barcodeSubType,t.barcodeFormat=this.barcodeFormat,t.barcodeFormat===b.a.QR_CODE)switch(this.barcodeSubType){case i.Phone:t.phone=this.barcodeContent;break;case i.Url:t.url=this.barcodeContent;break;case i.Data:t.data=this.barcodeContent;break;case i.VCard:return x.fromVCardString(this.barcodeContent)}else t.barcodeValue=this.barcodeContent;return t},enumerable:!0,configurable:!0}),e.prototype.applyBarcodeData=function(t){this.barcodeFormat=t.barcodeFormat,this.barcodeSubType=null!=t.barcodeSubType?t.barcodeSubType:this.barcodeFormat===b.a.QR_CODE?i.Phone:i.None;var e="";if(this.barcodeFormat===b.a.QR_CODE)switch(this.barcodeSubType){case i.Phone:e=t.phone;break;case i.Data:e=t.data;break;case i.None:case i.Url:e=t.url;break;case i.VCard:e=t.toVCardString()}else e=t.barcodeValue;this.barcodeContent=e},e.type="BarcodeItem",E([Object(I.a)({factory:new L.d("")}),j("design:type",String),j("design:paramtypes",[String])],e.prototype,"barcodeContent",null),E([Object(I.a)({enumObject:b.a}),j("design:type",String),j("design:paramtypes",[String])],e.prototype,"barcodeFormat",null),E([Object(I.a)({enumObject:i}),j("design:type",String),j("design:paramtypes",[String])],e.prototype,"barcodeSubType",null),e}(p.a),k=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return R(e,t),e.prototype.equals=function(t){return null!=t&&Object(s.g)(this.width,t.width)&&Object(s.g)(this.height,t.height)&&Object(s.g)(this.margin,t.margin)&&Object(s.g)(this.pureBarcode,t.pureBarcode)&&Object(s.g)(this.errorCorrection,t.errorCorrection)&&Object(s.g)(this.characterSet,t.characterSet)&&Object(s.g)(this.pdf417Compact,t.pdf417Compact)&&Object(s.g)(this.pdf417Compaction,t.pdf417Compaction)&&a.h(this.pdf417Dimensions,t.pdf417Dimensions)&&Object(s.g)(this.disableEci,t.disableEci)&&Object(s.g)(this.code128ForceCodesetB,t.code128ForceCodesetB)&&Object(s.g)(this.aztecLayers,t.aztecLayers)&&Object(s.g)(this.qrVersion,t.qrVersion)&&Object(s.g)(this.xDimension,t.xDimension&&Object(s.g)(this.databarExpandedSegments,t.databarExpandedSegments))},e.type="EncodingOptions",E([Object(T.a)(),Object(I.a)({factory:new L.d(0)}),j("design:type",Number)],e.prototype,"width",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d(0)}),j("design:type",Number)],e.prototype,"height",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d(0)}),j("design:type",Number)],e.prototype,"margin",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d(!0)}),j("design:type",Boolean)],e.prototype,"pureBarcode",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d("")}),j("design:type",String)],e.prototype,"errorCorrection",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d("")}),j("design:type",String)],e.prototype,"characterSet",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d(!1)}),j("design:type",Boolean)],e.prototype,"pdf417Compact",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d("")}),j("design:type",String)],e.prototype,"pdf417Compaction",void 0),E([Object(T.a)(),Object(I.a)({ignore:!0}),j("design:type",Object)],e.prototype,"pdf417Dimensions",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d(!1)}),j("design:type",Boolean)],e.prototype,"disableEci",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d(!1)}),j("design:type",Boolean)],e.prototype,"code128ForceCodesetB",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d(0)}),j("design:type",Number)],e.prototype,"aztecLayers",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d(0)}),j("design:type",Number)],e.prototype,"qrVersion",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d(0)}),j("design:type",Number)],e.prototype,"xDimension",void 0),E([Object(T.a)(),Object(I.a)({factory:new L.d(0)}),j("design:type",Number)],e.prototype,"databarExpandedSegments",void 0),e}(O.a),A=n(557),F=n(558),B=n(559),M=n(560),z=n(431),D=n(408),H=function(){function t(t){this._allowChangeLineWidth=!0,this._allowChangeLineColor=!0,this.propertyChanged=new D.a,null==t&&(t=!0),this.allowChangeLineWidth=t,this.allowChangeLineColor=t}return Object.defineProperty(t.prototype,"allowChangeLineWidth",{get:function(){return this._allowChangeLineWidth},set:function(t){this._allowChangeLineWidth!==t&&(this._allowChangeLineWidth=t,this.propertyChanged.notify("allowChangeLineWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowChangeLineColor",{get:function(){return this._allowChangeLineColor},set:function(t){this._allowChangeLineColor!==t&&(this._allowChangeLineColor=t,this.propertyChanged.notify("allowChangeLineColor"))},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeLineWidth=this.allowChangeLineWidth,t.allowChangeLineColor=this.allowChangeLineColor,t},t.prototype.clone=function(){var e=new t;return e.allowChangeLineWidth=this.allowChangeLineWidth,e.allowChangeLineColor=this.allowChangeLineColor,e},t.prototype.equals=function(t){return this.allowChangeLineColor===t.allowChangeLineColor&&this.allowChangeLineWidth===t.allowChangeLineWidth},t}(),U=n(422),W=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),V=function(t){function e(n,r){var i=t.call(this)||this;return i._width=4,i._color=v.RgbColors.black,i._sourcePoint0=new z.a,i._sourcePoint1=new z.a,i._fixedWidth=!1,i._overprintStroke=!1,i.lineColorForAbnormalRendering=v.RgbColors.black,i.type=e.type,i._sourcePoint0=null!=n?n:new z.a,i._sourcePoint1=null!=r?r:new z.a,i._linePermissions=new H,i._linePermissions.propertyChanged.add(i._onPermissionsChanged),i._ignorePermissionsChange=!0,i.itemPermissions.itemToolbarPermissions.showEditButton=!1,i.itemPermissions.itemToolbarPermissions.showSelectButton=!1,i._ignorePermissionsChange=!1,i}return W(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){U.e(this._width,t)||(this._width=t,this._propertyChanged.notify(this,"width"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){v.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourcePoint0",{get:function(){return this._sourcePoint0},set:function(t){z.a.isEqual(this._sourcePoint0,t)||(this._sourcePoint0=t,this._propertyChanged.notify(this,"sourcePoint0"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourcePoint1",{get:function(){return this._sourcePoint1},set:function(t){z.a.isEqual(this._sourcePoint1,t)||(this._sourcePoint1=t,this._propertyChanged.notify(this,"sourcePoint1"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fixedWidth",{get:function(){return this._fixedWidth},set:function(t){this._fixedWidth!==t&&(this._fixedWidth=t,this._propertyChanged.notify(this,"fixedWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"linePermissions",{get:function(){return this._linePermissions},set:function(t){if(null==t)throw new y.a("linePermissions cannot be null");Object(s.g)(this._linePermissions,t)||(this._linePermissions.propertyChanged.remove(this._onPermissionsChanged),this._linePermissions=t,this._linePermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overprintStroke",{get:function(){return this._overprintStroke},set:function(t){t!=this._overprintStroke&&(this._overprintStroke=t,this._propertyChanged.notify(this,"overprintStroke"))},enumerable:!0,configurable:!0}),e.prototype._subscribeToPermissionChanged=function(){this._linePermissions.propertyChanged.add(this._onPermissionsChanged)},e.prototype._unsubscribeFromPermissionChanged=function(){this._linePermissions.propertyChanged.remove(this._onPermissionsChanged)},e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),this.itemPermissions.itemToolbarPermissions.showEditButton=!1,this.itemPermissions.itemToolbarPermissions.showSelectButton=!1,this.isRenderTypeIsNormal||(this.linePermissions.allowChangeLineColor=!1)},e.prototype.getSimplifiedObject=function(e){var n=t.prototype.getSimplifiedObject.call(this,["linePermissions"].concat(e));return n.linePermissions=this.linePermissions.getSimplifiedObject(),n},e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.width=e.width,n.color=e.color.clone(),n.sourcePoint0=e.sourcePoint0.clone(),n.sourcePoint1=e.sourcePoint1.clone(),n.fixedWidth=e.fixedWidth,n.linePermissions=null!=e._linePermissions?e._linePermissions.clone():null,n.overprintStroke=e.overprintStroke},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._width,e._width)&&Object(s.g)(this._color,e._color)&&Object(s.g)(this._sourcePoint0,e._sourcePoint0)&&Object(s.g)(this._sourcePoint1,e._sourcePoint1)&&Object(s.g)(this._fixedWidth,e._fixedWidth)&&Object(s.g)(this._linePermissions,e._linePermissions)&&Object(s.g)(this._overprintStroke,e._overprintStroke)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="LineItem",e}(c.a),q=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),G=function(t){function e(n,r){var i=t.call(this,n,r)||this;return i._dashWidth=3,i._altDashWidth=3,i._altColor=v.RgbColors.transparent,i.type=e.type,i}return q(e,t),Object.defineProperty(e.prototype,"dashWidth",{get:function(){return this._dashWidth},set:function(t){U.e(this._dashWidth,t)||(this._dashWidth=t,this._propertyChanged.notify(this,"dashWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"altDashWidth",{get:function(){return this._altDashWidth},set:function(t){U.e(this._altDashWidth,t)||(this._altDashWidth=t,this._propertyChanged.notify(this,"altDashWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"altColor",{get:function(){return this._altColor},set:function(t){v.Color.equals(this._altColor,t)||(this._altColor=t,this._propertyChanged.notify(this,"altColor"))},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.dashWidth=e.dashWidth,n.altDashWidth=e.altDashWidth,n.altColor=e.altColor.clone()},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._dashWidth,e._dashWidth)&&Object(s.g)(this._altDashWidth,e._altDashWidth)&&Object(s.g)(this._altColor,e._altColor)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="DashedLineItem",e}(V),$=n(428),X=n(448),K=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Y=function(t){function e(n){void 0===n&&(n=new $.a(0,0,10,10));var r=t.call(this,X.a.ellipse(n.left,n.top,n.width,n.height))||this;return r.type=e.type,r.sourceRectangle=n,r.manipulationPermissions.resizeGrips=new _.a(!0,!0),r}return K(e,t),e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="EllipseItem",e}(h.a),J=n(550),Z=n(504),Q=n(460),tt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),et=function(t){function e(n,r,i,o,a,s){var l=t.call(this)||this;return l.type=e.type,l._location=new z.a(n,r),l._cols=i,l._rows=o,l._stepX=a,l._stepY=s,l._horizontalLineColor=v.RgbColors.black,l._verticalLineColor=v.RgbColors.black,l._lineWidth=1,l._fixedLineWidth=!0,l.textWrappingMode=Q.a.None,l}return tt(e,t),Object.defineProperty(e.prototype,"location",{get:function(){return this._location},set:function(t){z.a.isEqual(this._location,t)||(this._location=t,this._propertyChanged.notify(this,"location"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._cols},set:function(t){U.e(this._cols,t)||(this._cols=t,this._propertyChanged.notify(this,"cols"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._rows},set:function(t){U.e(this._rows,t)||(this._rows=t,this._propertyChanged.notify(this,"rows"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepX",{get:function(){return this._stepX},set:function(t){U.e(this._stepX,t)||(this._stepX=t,this._propertyChanged.notify(this,"stepX"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepY",{get:function(){return this._stepY},set:function(t){U.e(this._stepY,t)||(this._stepY=t,this._propertyChanged.notify(this,"stepY"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{get:function(){return this._lineWidth},set:function(t){U.e(this._lineWidth,t)||(this._lineWidth=t,this._propertyChanged.notify(this,"lineWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fixedLineWidth",{get:function(){return this._fixedLineWidth},set:function(t){this._fixedLineWidth!==t&&(this._fixedLineWidth=t,this._propertyChanged.notify(this,"fixedLineWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalLineColor",{get:function(){return this._verticalLineColor},set:function(t){v.Color.equals(this._verticalLineColor,t)||(this._verticalLineColor=t,this._propertyChanged.notify(this,"verticalLineColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalLineColor",{get:function(){return this._horizontalLineColor},set:function(t){v.Color.equals(this._horizontalLineColor,t)||(this._horizontalLineColor=t,this._propertyChanged.notify(this,"horizontalLineColor"))},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.location=e.location.clone(),n.cols=e.cols,n.rows=e.rows,n.stepX=e.stepX,n.stepY=e.stepY,n.lineWidth=e.lineWidth,n.fixedLineWidth=e.fixedLineWidth,n.verticalLineColor=e.verticalLineColor.clone(),n.horizontalLineColor=e.horizontalLineColor.clone()},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._location,e._location)&&Object(s.g)(this._rows,e._rows)&&Object(s.g)(this._cols,e._cols)&&Object(s.g)(this._stepX,e._stepX)&&Object(s.g)(this._stepY,e._stepY)&&Object(s.g)(this._lineWidth,e._lineWidth)&&Object(s.g)(this._fixedLineWidth,e._fixedLineWidth)&&Object(s.g)(this._verticalLineColor,e._verticalLineColor)&&Object(s.g)(this._horizontalLineColor,e._horizontalLineColor)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e(this.location.x,this.location.y,this.cols,this.rows,this.stepX,this.stepY);return this._copy(this,r,t,n),r},e.type="GridItem",e}(c.a),nt=n(463),rt=n(475),it=n(506),ot=n(505),at=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),st=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},lt=function(t){function e(e,n,r,i,o){var a=t.call(this)||this;return a.id=e,a._name=n,a._mask=r,a._value=i,a._values=o,a}return at(e,t),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){t!=this._mask&&(this._mask=t,this._propertyChanged.notify(this,"mask"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(t){t!=this._value&&(this._value=t,this._propertyChanged.notify(this,"value"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this._values},set:function(t){t!=this._values&&(this._values=t,this._propertyChanged.notify(this,"values"))},enumerable:!0,configurable:!0}),e.prototype.generateNewIds=function(){this._generateNewId()},e.prototype._copy=function(e,n,r){return t.prototype._copy.call(this,e,n,!1),n.mask=e.mask,n.value=e.value,n.values=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(st(arguments[e]));return t}(e.values),n},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this.mask,e.mask)&&Object(s.g)(this.value,e.value)&&Object(s.c)(this.values,e.values)},e.prototype.getSimplifiedObject=function(){return{id:this.id,mask:this.mask,value:this.value,values:this.values,name:this.name}},e}(O.a),ut=n(548),ct=n(549),ht=n(565),pt=n(545),ft=n(476),dt=n(474),gt=n(406),mt=function(){function t(t){this.propertyChanged=new D.a,null==t&&(t=!0),this.allowChangeColumnCount=t}return Object.defineProperty(t.prototype,"allowChangeColumnCount",{get:function(){return this._allowChangeColumnCount},set:function(t){this._allowChangeColumnCount!==t&&(this._allowChangeColumnCount=t,this.propertyChanged.notify("allowChangeColumnCount"))},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeColumnCount=this.allowChangeColumnCount,t},t.prototype.clone=function(){var e=new t;return e.allowChangeColumnCount=this.allowChangeColumnCount,e},t.prototype.equals=function(t){return this.allowChangeColumnCount===t.allowChangeColumnCount},t}(),yt=n(472),_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vt=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bt=function(t){function e(n,r,i,o){var a=t.call(this,n,i,o)||this;return a._boundingPaths=[],a._wrappingMargin=7,a._wrappingPath=null,a._paragraphSettings=new dt.a,a._isVertical=!1,a._firstBaselineOffset=yt.c.Ascent,a._firstBaselineMinOffset=0,a.type=e.type,null!=r&&(a.boundingPaths=r),a._pathBoundedTextPermissions=new mt,a._pathBoundedTextPermissions.propertyChanged.add(a._onPermissionsChanged),a}return _t(e,t),Object.defineProperty(e.prototype,"boundingPaths",{get:function(){return this._boundingPaths},set:function(t){t.length===this.boundingPaths.length&&this.boundingPaths.every((function(e,n){return e.isEqual(t[n])}))||(this._boundingPaths=t,this._propertyChanged.notify(this,"boundingPaths"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrappingPath",{get:function(){return this._wrappingPath},set:function(t){null==this._wrappingPath&&null==t||null!=this._wrappingPath&&this._wrappingPath.isEqual(t)||(this._wrappingPath=t,this._propertyChanged.notify(this,"wrappingPath"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrappingMargin",{get:function(){return this._wrappingMargin},set:function(t){Object(gt.EqualsOfFloatNumbers)(this._wrappingMargin,t)||(this._wrappingMargin=t,this._propertyChanged.notify(this,"wrappingMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphSettings",{get:function(){return this._paragraphSettings},set:function(t){dt.a.equals(this._paragraphSettings,t)||(this._paragraphSettings=t,this._propertyChanged.notify(this,"paragraphSettings"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._propertyChanged.notify(this,"isVertical"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pathBoundedTextPermissions",{get:function(){return this._pathBoundedTextPermissions},set:function(t){if(null==t)throw new y.a("pathBoundedTextPermissions cannot be null");Object(s.g)(this._pathBoundedTextPermissions,t)||(this._pathBoundedTextPermissions.propertyChanged.remove(this._onPermissionsChanged),this._pathBoundedTextPermissions=t,this._pathBoundedTextPermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstBaselineOffset",{get:function(){return this._firstBaselineOffset},set:function(t){this._firstBaselineOffset!==t&&(this._firstBaselineOffset=t,null!=t&&this._propertyChanged.notify(this,"firstBaselineOffset"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstBaselineMinOffset",{get:function(){return this._firstBaselineMinOffset},set:function(t){Object(gt.EqualsOfFloatNumbers)(this._firstBaselineMinOffset,t)||(this._firstBaselineMinOffset=t,null!=t&&this._propertyChanged.notify(this,"firstBaselineMinOffset"))},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(e){var n=t.prototype.getSimplifiedObject.call(this,["pathBoundedTextPermissions"].concat(e));return n.pathBoundedTextPermissions=this.pathBoundedTextPermissions.getSimplifiedObject(),n},e.prototype._copy=function(n,r,i,o){t.prototype._copy.call(this,n,r,i,o),"AutoScaledTextItem"!=r.type&&"BoundedTextItem"!=r.type&&"PathBoundedTextItem"!=r.type&&"PlainTextItem"!=r.type||(r.isVertical=n.isVertical),"PathBoundedTextItem"!=r.type&&"BoundedTextItem"!=r.type||(r.wrappingMargin=n.wrappingMargin,r.paragraphSettings=n.paragraphSettings.clone(),r.wrappingPath=null!=n.wrappingPath?n.wrappingPath.clone():null,r.firstBaselineOffset=n.firstBaselineOffset,r.firstBaselineMinOffset=n.firstBaselineMinOffset),r instanceof e&&(r.boundingPaths=n.boundingPaths.map((function(t){return t.clone()})),r.pathBoundedTextPermissions=n.pathBoundedTextPermissions.clone())},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.c)(this._boundingPaths,e._boundingPaths)&&Object(s.g)(this._wrappingMargin,e._wrappingMargin)&&Object(s.g)(this._paragraphSettings,e._paragraphSettings)&&Object(s.g)(this._isVertical,e._isVertical)&&Object(s.g)(this._pathBoundedTextPermissions,e._pathBoundedTextPermissions)&&Object(s.g)(this._wrappingPath,e._wrappingPath)&&Object(s.g)(this.firstBaselineOffset,e.firstBaselineOffset)&&Object(s.g)(this.firstBaselineMinOffset,e.firstBaselineMinOffset)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="PathBoundedTextItem",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(I.a)({enumObject:yt.c}),vt("design:type",Number),vt("design:paramtypes",[Number])],e.prototype,"firstBaselineOffset",null),e}(f.a),wt=n(507),Ct=n(566),Pt=n(567),St=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xt=function(t){function e(n){var r=t.call(this)||this;if(r._width=20,r._color=new v.RgbColor(255,255,61,255),r._points=[],r.type=e.type,r._points=[],n&&n.length&&n.length>0)for(var i=0;i<n.length;i++)n[i]instanceof z.a&&r._points.push(n[i]);return r.textWrappingMode=Q.a.None,r}return St(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){U.e(this._width,t)||(this._width=t,this._propertyChanged.notify(this,"width"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){v.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourcePoints",{get:function(){return this._points},set:function(t){this._points=t,this._propertyChanged.notify(this,"sourcePoints")},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.width=e.width,n.color=e.color.clone(),n.sourcePoints=e.sourcePoints.map((function(t){return t.clone()}))},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._width,e._width)&&Object(s.g)(this._color,e._color)&&Object(s.c)(this._points,e._points)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="PolylineItem",e}(c.a),It=n(499),Ot=n(568),Tt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lt=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rt=function(t){function e(n,r,i,o){var a=t.call(this,n,i,o)||this;return a._center=new gt.PointF,a.type=e.type,null!=r&&(a._center=r),a._ignorePermissionsChange=!0,a.manipulationPermissions.resizeGrips.setCornerArbitrary(!1),a.manipulationPermissions.resizeGrips.edge=!1,a.textPermissions.allowChangeTextAlignment=!1,a.textPermissions.allowChangeLeading=!1,a._ignorePermissionsChange=!1,a}return Tt(e,t),e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),null!=this.manipulationPermissions&&null!=this.manipulationPermissions.resizeGrips&&(this.manipulationPermissions.resizeGrips.setCornerArbitraryConstraint(!1),this.manipulationPermissions.resizeGrips.edgeConstraint=!1),null!=this.textPermissions&&(this.textPermissions.allowChangeLeading=!1,this.textPermissions.allowChangeTextAlignment=!1)},Object.defineProperty(e.prototype,"center",{get:function(){return this._center},set:function(t){gt.PointF.isEqual(this._center,t)||(this._center=t,this._propertyChanged.notify(this,"center"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bend",{get:function(){return this._bend},set:function(t){Object(gt.EqualsOfFloatNumbers)(this._bend,t)||(this._bend=t,this._propertyChanged.notify(this,"bend"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"warp",{get:function(){return this._warp},set:function(t){this._warp!==t&&(this._warp=t,this._propertyChanged.notify(this,"warp"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLineCount",{get:function(){return 1},set:function(t){throw console.error("ArchedText set maxLineCount",t),new y.d("Max Line Count of ArchedTextItem can not be redefined!")},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(e){return t.prototype.getSimplifiedObject.call(this,["maxLineCount"].concat(e))},e.prototype._copy=function(n,r,i,o){t.prototype._copy.call(this,n,r,i,o),r instanceof e&&(r.center=n.center,r.bend=n.bend,r.warp=n.warp)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._center,e._center)&&Object(s.g)(this._bend,e._bend)&&Object(s.g)(this._warp,e._warp)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="ArchedTextItem",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(Ot.b)({type:"boolean"}),Lt("design:type",Boolean),Lt("design:paramtypes",[Boolean])],e.prototype,"warp",null),e}(f.a),Et=n(501),jt=n(553),Nt=n(477),kt=n(500),At=n(554),Ft=n(551),Bt=n(547)},function(t,e,n){"use strict";var r;n.r(e),n.d(e,"CmykColor",(function(){return f})),n.d(e,"Color",(function(){return i.a})),n.d(e,"ColorSpace",(function(){return r})),n.d(e,"GrayscaleColor",(function(){return g})),n.d(e,"HsbColor",(function(){return v})),n.d(e,"Ink",(function(){return b})),n.d(e,"LabColor",(function(){return B})),n.d(e,"Palette",(function(){return M.a})),n.d(e,"ProcessColor",(function(){return h})),n.d(e,"RgbColor",(function(){return y})),n.d(e,"RgbColors",(function(){return z})),n.d(e,"SpotColor",(function(){return H})),n.d(e,"Swatch",(function(){return U.a})),function(t){t[t.Rgb=0]="Rgb",t[t.Cmyk=1]="Cmyk",t[t.Grayscale=2]="Grayscale",t[t.Lab=3]="Lab",t[t.Spot=4]="Spot"}(r||(r={}));var i=n(450),o=n(407),a=n(409);function s(t){if(Object(a.l)(t))throw new o.a("Value must be a non-empty string");return t}function l(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=255),"number"!=typeof t)throw new o.a("Value must be a number");if(t<e||t>n)throw new o.a("Value must be in range ["+e+", "+n+"]");return t}var u,c=(u=function(t,e){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},u(t,e)},function(t,e){function n(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e,n){void 0===n&&(n=null);var r=t.call(this)||this;return r._alpha=l(e),r._profile=r._validateProfile(n),r}return c(e,t),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"profile",{get:function(){return this._profile},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isTransparent",{get:function(){return 0===this.alpha},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){if(!t.prototype.equals.call(this,e))return!1;var n=e;return this.profile===n.profile&&this.alpha===n.alpha},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.profile=this.profile,e.alpha=this.alpha,e},e.prototype._validateProfile=function(t){return null!=t?s(t):null},e}(i.a),p=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=function(t){function e(e,n,i,o,a,s){void 0===s&&(s=null);var u=t.call(this,a,s)||this;return u._colorSpace=r.Cmyk,u._c=l(e),u._m=l(n),u._y=l(i),u._k=l(o),u}return p(e,t),Object.defineProperty(e.prototype,"c",{get:function(){return this._c},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"m",{get:function(){return this._m},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"k",{get:function(){return this._k},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){var n=e;return t.prototype.equals.call(this,e)&&this.c===n.c&&this.m===n.m&&this.y===n.y&&this.k===n.k},e.prototype.clone=function(){return new e(this.c,this.m,this.y,this.k,this.alpha,this.profile)},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.c=this.c,e.m=this.m,e.y=this.y,e.k=this.k,e},e.prototype.toString=function(){return"cmyk(".concat(this._toRelative(this.c)+",",this._toRelative(this.m)+",",this._toRelative(this.y)+",",this._toRelative(this.k)+",",this._toRelative(this.alpha)+")")},e.prototype._toRelative=function(t){return(t/255).toFixed(7)},e}(h),d=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(e,n,i){void 0===i&&(i=null);var o=t.call(this,n,i)||this;return o._colorSpace=r.Grayscale,o._l=l(e),o}return d(e,t),Object.defineProperty(e.prototype,"l",{get:function(){return this._l},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){var n=e;return t.prototype.equals.call(this,e)&&this.l===n.l},e.prototype.clone=function(){return new e(this.l,this.alpha,this.profile)},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.l=this.l,e},e.prototype.toString=function(){if(255===this.alpha)return"rgb("+this.l+","+this.l+","+this.l+")";var t=(this.alpha/255).toFixed(7);return"rgba("+this.l+","+this.l+","+this.l+","+t+")"},e}(h),m=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),y=function(t){function e(e,n,i,o,a){void 0===a&&(a=null);var s=t.call(this,o,a)||this;return s._colorSpace=r.Rgb,s._r=l(e),s._g=l(n),s._b=l(i),s}return m(e,t),Object.defineProperty(e.prototype,"r",{get:function(){return this._r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._g},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this._b},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){var n=e;return t.prototype.equals.call(this,e)&&this.r===n.r&&this.g===n.g&&this.b===n.b},e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha,this.profile)},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.r=this.r,e.g=this.g,e.b=this.b,e},e.prototype.toString=function(){if(255===this.alpha)return"rgb("+this.r+","+this.g+","+this.b+")";var t=(this.alpha/255).toFixed(7);return"rgba("+this.r+","+this.g+","+this.b+","+t+")"},e}(h),_=n(406),v=function(){function t(t,e,n,r){this._h=l(t,0,1),this._s=l(e,0,1),this._b=l(n,0,1),this._alpha=l(r)}return Object.defineProperty(t.prototype,"h",{get:function(){return this._h},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"s",{get:function(){return this._s},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._b},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this._alpha},enumerable:!0,configurable:!0}),t.fromRgb=function(e){var n=e.r/255,r=e.g/255,i=e.b/255,o=Math.max(n,r,i),a=Math.min(n,r,i),s=o,l=o,u=o-a,c=0===o?0:u/o;if(o===a)s=0;else{switch(o){case n:s=(r-i)/u+(r<i?6:0);break;case r:s=(i-n)/u+2;break;case i:s=(n-r)/u+4}s/=6}return new t(s,c,l,e.alpha)},t.prototype.toRgb=function(){var t=6*this.h,e=Math.floor(t),n=t-e,r=this.b*(1-this.s),i=this.b*(1-n*this.s),o=this.b*(1-(1-n)*this.s),a=e%6,s=Math.round(255*[this.b,i,r,r,o,this.b][a]),l=Math.round(255*[o,this.b,this.b,i,r,r][a]),u=Math.round(255*[r,r,o,this.b,this.b,i][a]);return new y(s,l,u,this.alpha)},t.prototype.clone=function(){return new t(this.h,this.s,this.b,this.alpha)},t.prototype.decreaseHue=function(t){var e=this.clone();return e._h=Object(_.Clamp)(0,e.h-t,1),e},t.prototype.increaseHue=function(t){var e=this.clone();return e._h=Object(_.Clamp)(0,e.h+t,1),e},t.prototype.desaturate=function(t){var e=this.clone();return e._s=Object(_.Clamp)(0,e.s-t,1),e},t.prototype.saturate=function(t){var e=this.clone();return e._s=Object(_.Clamp)(0,e.s+t,1),e},t.prototype.darken=function(t){var e=this.clone();return e._b=Object(_.Clamp)(0,e.b-t,1),e},t.prototype.lighten=function(t){var e=this.clone();return e._b=Object(_.Clamp)(0,e.b+t,1),e},t.prototype.decreaseAlpha=function(t){var e=this.clone();return e._alpha=Object(_.Clamp)(0,e.alpha-t,255),e},t.prototype.increaseAlpha=function(t){var e=this.clone();return e._alpha=Object(_.Clamp)(0,e.alpha+t,255),e},t}(),b=function(){function t(t,e,n){void 0===n&&(n=1),this._name=s(t),this._alternativeColor=e,this._solidity=l(n,0,1)}return Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternativeColor",{get:function(){return this._alternativeColor},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"solidity",{get:function(){return this._solidity},enumerable:!0,configurable:!0}),t.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.equals=function(t){return this.name===t.name&&this.solidity===t.solidity&&i.a.equals(this.alternativeColor,t.alternativeColor)},t.prototype.clone=function(){return new t(this.name,this.alternativeColor,this.solidity)},t.prototype.getData=function(){var t;return{name:this.name,alternativeColor:null===(t=this.alternativeColor)||void 0===t?void 0:t.getData(),solidity:this.solidity}},t}(),w=function(){function t(t){this._previewFromServer=!1,this.preview=null,this.profileId=null,null!=t&&(a.l(t.preview)||(this._previewFromServer=!0),"string"!=typeof t&&this._init(t))}return Object.defineProperty(t.prototype,"previewFromServer",{get:function(){return this._previewFromServer},enumerable:!0,configurable:!0}),t.prototype.needUpdate=function(t){var e="RgbColor"===this.type,n=e&&null!=this.profileId&&this.profileId!==t;return(!e||n)&&!this.previewFromServer},t.prototype.equals=function(t,e){return void 0===e&&(e=!1),t.profileId===this.profileId&&(e||t.preview===this.preview)},t.prototype.getData=function(){return{preview:this.preview,profileId:this.profileId,type:this.type}},t.prototype._init=function(t){a.l(t.preview)||(this.preview=t.preview),a.l(t.profileId)||(this.profileId=t.profileId)},t.prototype._validateString=function(t){if(a.l(t))throw new o.a("Value must be a non-empty string")},t.prototype._validateNumber=function(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=255),"number"!=typeof t)throw new o.a("Value must be a number");if(t<e||t>n)throw new o.a("Value must be in range ["+e+", "+n+"]")},t.equals=function(t,e){return null==t&&null==e||null!=t&&t.equals(e)},t}(),C=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),P=function(t){function e(e){var n=t.call(this,e)||this;if(n._r=0,n._g=0,n._b=0,n._a=0,null==e)return n;var r="Incorrect RgbColor format: "+JSON.stringify(e);if("string"==typeof e){var i=e;if(0!==e.indexOf("#")&&0!==e.indexOf("rgb")&&null==(i=n._parseNamedColor(e))&&console.warn("Unknown rgb color name: "+e),n._tryInitFromRgba(i))return n;if(n._tryInitFromRgb(i))return n;n._tryInitFromHex(i)||console.warn(r)}else try{n._init(e)}catch(o){console.warn(r)}return n}return C(e,t),e.prototype._parseNamedColor=function(t){if(window.getComputedStyle){var e=document.createElement("div");e.style.color=t,document.body.appendChild(e);var n=window.getComputedStyle(e).color;return document.body.removeChild(e),n}return console.warn("Unable to parse rgb color string "+t),null},e.prototype._tryInitFromRgba=function(t){var n=e.matchRgba(t);if(null!=n&&6===n.length){var r=parseInt((255*parseFloat(n[4])).toFixed(0));return r=Math.max(r,0),r=Math.min(r,255),this._init({r:+n[1],g:+n[2],b:+n[3],a:r}),!0}return!1},e.prototype._tryInitFromRgb=function(t){var n=e.matchRgb(t);return null!=n&&4===n.length&&(this._init({r:+n[1],g:+n[2],b:+n[3],a:255}),!0)},e.prototype._tryInitFromHex=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return null!=e&&4===e.length&&(this._init({r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16),a:255}),!0)},Object.defineProperty(e.prototype,"type",{get:function(){return"RgbColor"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"r",{get:function(){return this._r},set:function(t){this._r=t,this._updatePreview()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._g},set:function(t){this._g=t,this._updatePreview()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this._b},set:function(t){this._b=t,this._updatePreview()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this._a},set:function(t){this._a=t,this._updatePreview()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.a},enumerable:!0,configurable:!0}),e.matchRgba=function(t){return e._rgba.lastIndex=0,e._rgba.exec(t)},e.matchRgb=function(t){return e._rgb.lastIndex=0,e._rgb.exec(t)},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.r=this.r,e.g=this.g,e.b=this.b,e.a=this.a,e},e.prototype.clone=function(){return new e(this)},e.prototype.toString=function(){return this._getPreview()},e.prototype.equals=function(n){return n instanceof e&&t.prototype.equals.call(this,n)},e.prototype._getPreview=function(){if(255===this.a)return"rgb("+this.r+","+this.g+","+this.b+")";var t=(this.a/255).toFixed(7);return"rgba("+this.r+","+this.g+","+this.b+","+t+")"},e.prototype._init=function(e){t.prototype._init.call(this,e),e.a=null!=e.a?e.a:255,this._validateNumber(e.r),this._validateNumber(e.g),this._validateNumber(e.b),this._validateNumber(e.a),this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._updatePreview()},e.prototype._updatePreview=function(){this.preview=this._getPreview()},e._rgba=/^\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\,\s*(\d{1,}(\.\d{1,})?)\s*\)\s*;{0,1}\s*$/g,e._rgb=/^\s*rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)\s*;{0,1}\s*$/g,e}(w),S=function(){function t(){}return t.isValidRgbColor=function(t){return!a.l(t)&&(null!=P.matchRgb(t)||null!=P.matchRgba(t))},t.convertPercentToByte=function(t){return Object(_.Clamp)(0,parseInt((255*parseFloat(t)/100).toFixed(0)),255)},t.convertByteToPercent=function(t){return(t/255*100).toFixed(0)+"%"},t}(),x=function(){function t(t,e,n){this._sourceString=t,this._regexArray=e,this._maxValue=n}return t.prototype.validate=function(){var t=function(t,e){return"ComponentName - "+t+", Value - "+e+"; "},e="";if(this._validate(this._regexArray[1])||(e=e.concat(t("C",this._regexArray[1]))),this._validate(this._regexArray[2])||(e=e.concat(t("M",this._regexArray[2]))),this._validate(this._regexArray[3])||(e=e.concat(t("Y",this._regexArray[3]))),this._validate(this._regexArray[4])||(e=e.concat(t("K",this._regexArray[4]))),null==this._regexArray[5]||this._validate(this._regexArray[5])||(e=e.concat(t("A",this._regexArray[5]))),e.length>0){var n=e.length-2;e=e.substring(0,n),console.warn("Invalid value of CMYK components. SourceString: "+this._sourceString+"; InvalidComponents: "+e+".")}},t.prototype._validate=function(t){var e=parseFloat(t);return e>=0&&e<=this._maxValue},t}(),I=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),O=function(t){function e(e){var n=t.call(this,e)||this;if(n.c=255,n.m=255,n.y=255,n.k=255,n.a=255,null==e)return n;var r="Incorrect CmykColor format: "+JSON.stringify(e);if("string"==typeof e)n._tryInitFromPercentCmyk(e)||n._tryInitFromRelativeCmyk(e)||n._tryInitFromDeviceCmyk(e)?n._previewFromServer=S.isValidRgbColor(n.preview):console.warn(r);else try{n._init(e)}catch(i){console.warn(r)}return n}return I(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"CmykColor"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.a},enumerable:!0,configurable:!0}),e.prototype._tryInitFromDeviceCmyk=function(t){var e=/^\s*device-cmyk\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*(\,\s*(\d{1,}(\.\d{1,})?))?\s*(\,\s*(.*)\s*)?\)\s*;{0,1}\s*$/g.exec(t);if(null!=e&&10===e.length){var n={c:+e[1],m:+e[2],y:+e[3],k:+e[4],preview:e[9]};return null!=e[6]&&(n.a=this._convertRelativeToByte(e[6])),this._init(n),!0}return!1},e.prototype._tryInitFromPercentCmyk=function(t){var e=/^\s*cmyk\(\s*(\d{1,3}(?:\.\d{1,})?)%\s*,\s*(\d{1,3}(?:\.\d{1,})?)%\s*,\s*(\d{1,3}(?:\.\d{1,})?)%\s*,\s*(\d{1,3}(?:\.\d{1,})?)%\s*(?:\,\s*(\d{1,3}(?:\.\d{1,})?)%)?\s*(?:\,\s*(.*)\s*)?\);{0,1}\s*$/g.exec(t);if(null!=e&&7===e.length){new x(t,e,100).validate();var n={c:S.convertPercentToByte(e[1]),m:S.convertPercentToByte(e[2]),y:S.convertPercentToByte(e[3]),k:S.convertPercentToByte(e[4]),preview:e[6]};return null!=e[5]&&(n.a=S.convertPercentToByte(e[5])),this._init(n),!0}return!1},e.prototype._tryInitFromRelativeCmyk=function(t){var e=/^\s*cmyk\(\s*(\d{1,3}(?:\.\d{1,})?)\s*,\s*(\d{1,3}(?:\.\d{1,})?)\s*,\s*(\d{1,3}(?:\.\d{1,})?)\s*,\s*(\d{1,3}(?:\.\d{1,})?)\s*(?:\,\s*(\d{1,3}(?:\.\d{1,})?))?\s*(?:\,\s*(.*)\s*)?\);{0,1}\s*$/g.exec(t);if(null!=e&&7===e.length){new x(t,e,1).validate();var n={c:this._convertRelativeToByte(e[1]),m:this._convertRelativeToByte(e[2]),y:this._convertRelativeToByte(e[3]),k:this._convertRelativeToByte(e[4]),preview:e[6]};return null!=e[5]&&(n.a=this._convertAlpha(e[5])),this._init(n),!0}return!1},e.prototype._convertRelativeToByte=function(t){return Object(_.Clamp)(0,parseInt((255*parseFloat(t)).toFixed(0)),255)},e.prototype._convertAlpha=function(t){return Object(_.Clamp)(parseInt((255*parseFloat(t)).toFixed(0)),0,255)},e.prototype.clone=function(){return new e(this)},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.c=this.c,e.m=this.m,e.y=this.y,e.k=this.k,e.a=this.a,e},e.prototype.equals=function(n,r){return void 0===r&&(r=!1),n instanceof e&&t.prototype.equals.call(this,n,r)&&n instanceof e&&this.c===n.c&&this.m===n.m&&this.y===n.y&&this.k===n.k&&this.a===n.a},e.prototype.toString=function(){var t="cmyk("+this._toRelative(this.c)+","+this._toRelative(this.m)+","+this._toRelative(this.y)+","+this._toRelative(this.k)+","+this._toRelative(this.a);return null!=this.preview&&(t+=","+this.preview),t+")"},e.prototype._toRelative=function(t){return(t/255).toFixed(7)},e.prototype._getPreview=function(){return this.preview},e.prototype._init=function(e){t.prototype._init.call(this,e),e.a=null!=e.a?e.a:255,this._validateNumber(e.c),this._validateNumber(e.m),this._validateNumber(e.y),this._validateNumber(e.k),this._validateNumber(e.a),this.c=e.c,this.m=e.m,this.y=e.y,this.k=e.k,this.a=e.a},e}(w),T=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),L=function(t){function e(e){var n=t.call(this,e)||this;if(n.l=0,n.a=255,null==e)return n;try{n._init(e)}catch(r){console.warn("Incorrect GrayscaleColor format: "+JSON.stringify(e))}return n}return T(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"GrayscaleColor"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.a},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return new e(this)},e.prototype.equals=function(n){return n instanceof e&&t.prototype.equals.call(this,n)&&n instanceof e&&this.l===n.l&&this.a===n.a},e.prototype.toString=function(){return this._getPreview()},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.l=this.l,e.a=this.a,e},e.prototype._getPreview=function(){if(255===this.a)return"rgb("+this.l+","+this.l+","+this.l+")";var t=(this.a/255).toFixed(7);return"rgba("+this.l+","+this.l+","+this.l+","+t+")"},e.prototype._init=function(e){t.prototype._init.call(this,e),e.a=null!=e.a?e.a:255,this._validateNumber(e.l),this._validateNumber(e.a),this.l=e.l,this.a=e.a,null==this.preview&&(this.preview=this._getPreview())},e}(w),R=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(t){function e(e){var n=t.call(this,e)||this;if(n.l=0,n.a=-128,n.b=-128,n.alpha=0,null==e)return n;var r="Incorrect LabColor format: "+JSON.stringify(e);if("string"==typeof e)n._tryInitFromString(e)?n._previewFromServer=S.isValidRgbColor(n.preview):console.warn(r);else try{n._init(e)}catch(i){console.warn(r)}return n}return R(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"LabColor"},enumerable:!0,configurable:!0}),e.prototype._tryInitFromString=function(t){e._lab.lastIndex=0;var n=e._lab.exec(t);return null!=n&&8===n.length&&(this._init({l:+n[1],a:+n[2],b:+n[3],alpha:null!=n[5]?S.convertPercentToByte(n[5]):255,preview:null!=n[7]?n[7]:null}),!0)},e.prototype.clone=function(){return new e(this)},e.prototype.equals=function(n){return n instanceof e&&t.prototype.equals.call(this,n)&&n instanceof e&&this.l===n.l&&this.a===n.a&&this.b===n.b&&this.alpha===n.alpha},e.prototype.toString=function(){var t="lab("+this.l+","+this.a+","+this.b+","+S.convertByteToPercent(this.alpha);return null!=this.preview&&(t+=","+this.preview),t+")"},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.l=this.l,e.a=this.a,e.b=this.b,e.alpha=this.alpha,e},e.prototype._getPreview=function(){return this.preview},e.prototype._init=function(e){t.prototype._init.call(this,e),e.alpha=null!=e.alpha?e.alpha:255,this._validateNumber(e.l),this._validateNumber(e.a,-128,127),this._validateNumber(e.b,-128,127),this._validateNumber(e.alpha),this.l=e.l,this.a=e.a,this.b=e.b,this.alpha=e.alpha},e._lab=/^\s*lab\(\s*(\d{1,3})\s*,\s*(-*\d{1,3})\s*,\s*(-*\d{1,3})\s*(,\s*(\d{1,3})%)?\s*(\,\s*(.*)\s*)?\)\s*;{0,1}\s*$/g,e}(w),j=n(416),N=function(){function t(){}return t.registerColor=function(e,n,r){e&&(t._createFunctionByType[e]=r),n&&(t._createFunctionByName[n]=r)},Object.defineProperty(t,"rgbColorProfileId",{set:function(e){t._rgbColorProfileId=e},enumerable:!0,configurable:!0}),t._updateRgbColor=function(e){return j.g(null==e?void 0:e.profileId)&&(e.profileId=t._rgbColorProfileId),e},t.createColor=function(e,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);try{return e instanceof w?e:"string"==typeof e?0===e.indexOf("device-cmyk")||0===e.indexOf("cmyk")?new O(e):0===e.indexOf("lab")?new E(e):0===e.indexOf("spot")?t._createColorByName("spot",e):r?t._updateRgbColor(new P(e)):new P(e):t._fromData(e,r)}catch(i){if(!1!==n)throw i;return console.warn("Unable to create color from value "+JSON.stringify(e)+". Error: "+i),new P("rgba(0,0,0,1)")}},t._createColorByName=function(e,n){if(!t._createFunctionByName[e])throw"Color with name '"+e+"' was not registered in ColorFactory";return new(0,t._createFunctionByName[e])(n)},t._createColorByType=function(e,n){if(!t._createFunctionByType[e])throw"Color with type name '"+e+"' was not registered in ColorFactory";return new(0,t._createFunctionByType[e])(n)},t._fromData=function(e,n){if(void 0===n&&(n=!1),null==e)throw"Value cannot be null";var r=e.type;if("RgbColor"===r)return n?t._updateRgbColor(new P(e)):new P(e);if("CmykColor"===r)return new O(e);if("GrayscaleColor"===r)return new L(e);if("LabColor"===r)return new E(e);if("SpotColor"===r)return t._createColorByType("SpotColor",e);throw"Unsupported color type "+r},t._createFunctionByType={},t._createFunctionByName={},t}(),k=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),A=function(t){function e(e){var n=t.call(this,e)||this;if(null==e)return n;var r="Incorrect SpotColor format: "+JSON.stringify(e);if("string"==typeof e)n._tryInitFromString(e)?n._previewFromServer=S.isValidRgbColor(n.preview):console.warn(r);else try{n._init(e)}catch(i){console.warn(r)}return n}return k(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"SpotColor"},enumerable:!0,configurable:!0}),e.prototype._tryInitFromString=function(t){e._spot.lastIndex=0;var n=e._spot.exec(t);return null!=n&&10===n.length&&(this._init({inkName:n[1].replace(/'/g,"").replace(/\"/g,""),inkColor:N.createColor(n[2]),inkSolidity:null!=n[4]?+n[4]:1,tint:null!=n[7]?S.convertPercentToByte(n[7]):255,preview:null!=n[9]?n[9]:null}),!0)},e.prototype.toString=function(){var t=this.inkColor.clone();return t.preview=null,"spot('"+this.inkName+"',"+t.toString()+","+this.inkSolidity+","+S.convertByteToPercent(this.tint)+","+this.preview+")"},e.prototype.clone=function(){return new e(this)},e.prototype.equals=function(n){return n instanceof e&&t.prototype.equals.call(this,n)&&n instanceof e&&this.inkName===n.inkName&&this.inkColor.equals(n.inkColor)&&this.inkSolidity===n.inkSolidity&&this.alpha===n.alpha&&this.tint===n.tint},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.inkName=this.inkName,e.inkColor=this.inkColor.getData(),e.inkSolidity=this.inkSolidity,e.alpha=this.alpha,e.tint=this.tint,e},e.prototype._getPreview=function(){return this.preview},e.prototype._init=function(e){t.prototype._init.call(this,e),e.alpha=null!=e.alpha?e.alpha:255,e.tint=null!=e.tint?e.tint:255;var n=N.createColor(e.inkColor,!0);this._validateString(e.inkName),this._validateNumber(e.inkSolidity,0,1),this._validateNumber(e.alpha),this._validateNumber(e.tint),this.inkName=e.inkName,this.inkColor=n,this.inkSolidity=e.inkSolidity,this.alpha=e.alpha,this.tint=e.tint},e._spot=/^\s*spot\(\s*([^()]*)\s*,\s*(.{3,4}\([^()]*\))\s*(,\s*(\d{1}(\.\d{1,})?))?\s*(,\s*(\d{1,3})%)?\s*(,\s*(.*)\s*)?\)\s*;{0,1}\s*$/g,e}(w);N.registerColor("SpotColor","spot",A);var F=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),B=function(t){function e(e,n,i,o,a){void 0===a&&(a=null);var s=t.call(this,o,a)||this;return s._colorSpace=r.Lab,s._l=l(e),s._a=l(n,-128,127),s._b=l(i,-128,127),s}return F(e,t),Object.defineProperty(e.prototype,"l",{get:function(){return this._l},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this._a},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this._b},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return new e(this.l,this.a,this.b,this.alpha,this.profile)},e.prototype.equals=function(e){var n=e;return t.prototype.equals.call(this,e)&&n.l===this.l&&n.a===this.a&&n.b===this.b},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.l=this.l,e.a=this.a,e.b=this.b,e},e.prototype.toString=function(){return"lab("+this.l+","+this.a+","+this.b+","+S.convertByteToPercent(this.alpha)+")"},e}(h),M=n(490),z=function(){function t(){}return Object.defineProperty(t,"transparent",{get:function(){return new y(0,0,0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"black",{get:function(){return new y(0,0,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"white",{get:function(){return new y(255,255,255,255)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"red",{get:function(){return new y(255,0,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"green",{get:function(){return new y(0,255,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"blue",{get:function(){return new y(0,0,255,255)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"cyan",{get:function(){return new y(0,255,255,255)},enumerable:!0,configurable:!0}),t}(),D=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),H=function(t){function e(e,n,i){void 0===i&&(i=255);var o=t.call(this)||this;return o._colorSpace=r.Spot,o._ink=e,o._tint=l(n),o._alpha=l(i),o}return D(e,t),Object.defineProperty(e.prototype,"ink",{get:function(){return this._ink},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isTransparent",{get:function(){return 0===this.alpha},enumerable:!0,configurable:!0}),e.prototype.equals=function(e){var n=e;return t.prototype.equals.call(this,e)&&b.equals(this.ink,n.ink)&&this.tint===n.tint&&this.alpha===n.alpha},e.prototype.clone=function(){return new e(this.ink.clone(),this.tint,this.alpha)},e.prototype.getData=function(){var e=t.prototype.getData.call(this);return e.ink=this.ink.getData(),e.tint=this.tint,e.alpha=this.alpha,e},e.prototype.toString=function(){var t=this.ink.alternativeColor.toString(),e=S.convertByteToPercent(this.tint);return"spot('"+this.ink.name+"',"+t+","+this.ink.solidity+","+e+")"},e}(i.a),U=n(544)},,function(t,e,n){"use strict";(function(t){n.d(e,"e",(function(){return r})),n.d(e,"p",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"o",(function(){return l})),n.d(e,"q",(function(){return u})),n.d(e,"t",(function(){return c})),n.d(e,"i",(function(){return h})),n.d(e,"r",(function(){return p})),n.d(e,"s",(function(){return f})),n.d(e,"k",(function(){return d})),n.d(e,"m",(function(){return g})),n.d(e,"j",(function(){return m})),n.d(e,"l",(function(){return y})),n.d(e,"g",(function(){return _})),n.d(e,"f",(function(){return v})),n.d(e,"h",(function(){return b})),n.d(e,"n",(function(){return w})),n.d(e,"b",(function(){return C}));var r="1.13.6",i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||Function("return this")()||{},o=Array.prototype,a=Object.prototype,s="undefined"!=typeof Symbol?Symbol.prototype:null,l=o.push,u=o.slice,c=a.toString,h=a.hasOwnProperty,p="undefined"!=typeof ArrayBuffer,f="undefined"!=typeof DataView,d=Array.isArray,g=Object.keys,m=Object.create,y=p&&ArrayBuffer.isView,_=isNaN,v=isFinite,b=!{toString:null}.propertyIsEnumerable("toString"),w=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],C=Math.pow(2,53)-1}).call(this,n(53))},function(t,e,n){"use strict";(function(t){n.d(e,"e",(function(){return r})),n.d(e,"p",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"o",(function(){return l})),n.d(e,"q",(function(){return u})),n.d(e,"t",(function(){return c})),n.d(e,"i",(function(){return h})),n.d(e,"r",(function(){return p})),n.d(e,"s",(function(){return f})),n.d(e,"k",(function(){return d})),n.d(e,"m",(function(){return g})),n.d(e,"j",(function(){return m})),n.d(e,"l",(function(){return y})),n.d(e,"g",(function(){return _})),n.d(e,"f",(function(){return v})),n.d(e,"h",(function(){return b})),n.d(e,"n",(function(){return w})),n.d(e,"b",(function(){return C}));var r="1.13.6",i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||Function("return this")()||{},o=Array.prototype,a=Object.prototype,s="undefined"!=typeof Symbol?Symbol.prototype:null,l=o.push,u=o.slice,c=a.toString,h=a.hasOwnProperty,p="undefined"!=typeof ArrayBuffer,f="undefined"!=typeof DataView,d=Array.isArray,g=Object.keys,m=Object.create,y=p&&ArrayBuffer.isView,_=isNaN,v=isFinite,b=!{toString:null}.propertyIsEnumerable("toString"),w=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],C=Math.pow(2,53)-1}).call(this,n(53))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n(546);function i(t){return function(e,n){var i=e.constructor.type;null==r.b.data[i]&&(r.b.data[i]={});var a=r.b.data[i];null==a[n]&&(a[n]={type:o(t,e,n),displayName:null!=t&&null!=t.displayName?t.displayName:n,propertyFactory:t.factory,values:null!=t.enumObject?Object.keys(t.enumObject).map((function(e){return t.enumObject[e]})).filter((function(t){return"string"==typeof t})):null,ignore:null==t.ignore||t.ignore})}}var o=function(t,e,n){return null!=t.type?t.type:null!=t.enumObject?"enum":null!=t.factory?t.factory.type:typeof e[n]}},function(t,e,n){"use strict";n.d(e,"j",(function(){return a})),n.d(e,"k",(function(){return p})),n.d(e,"i",(function(){return f})),n.d(e,"f",(function(){return O})),n.d(e,"g",(function(){return W})),n.d(e,"h",(function(){return Y})),n.d(e,"c",(function(){return dt})),n.d(e,"b",(function(){return mt})),n.d(e,"a",(function(){return vt})),n.d(e,"d",(function(){return Ie})),n.d(e,"l",(function(){return sn})),n.d(e,"e",(function(){return un})),n.d(e,"n",(function(){return hn})),n.d(e,"m",(function(){return pn}));var r={};n.r(r),n.d(r,"VERSION",(function(){return i.e})),n.d(r,"restArguments",(function(){return o})),n.d(r,"isObject",(function(){return a})),n.d(r,"isNull",(function(){return s})),n.d(r,"isUndefined",(function(){return l})),n.d(r,"isBoolean",(function(){return u})),n.d(r,"isElement",(function(){return c})),n.d(r,"isString",(function(){return p})),n.d(r,"isNumber",(function(){return f})),n.d(r,"isDate",(function(){return d})),n.d(r,"isRegExp",(function(){return g})),n.d(r,"isError",(function(){return m})),n.d(r,"isSymbol",(function(){return y})),n.d(r,"isArrayBuffer",(function(){return _})),n.d(r,"isDataView",(function(){return I})),n.d(r,"isArray",(function(){return O})),n.d(r,"isFunction",(function(){return w})),n.d(r,"isArguments",(function(){return R})),n.d(r,"isFinite",(function(){return E})),n.d(r,"isNaN",(function(){return j})),n.d(r,"isTypedArray",(function(){return z})),n.d(r,"isEmpty",(function(){return W})),n.d(r,"isMatch",(function(){return V})),n.d(r,"isEqual",(function(){return Y})),n.d(r,"isMap",(function(){return ot})),n.d(r,"isWeakMap",(function(){return at})),n.d(r,"isSet",(function(){return st})),n.d(r,"isWeakSet",(function(){return lt})),n.d(r,"keys",(function(){return U})),n.d(r,"allKeys",(function(){return J})),n.d(r,"values",(function(){return ut})),n.d(r,"pairs",(function(){return ct})),n.d(r,"invert",(function(){return ht})),n.d(r,"functions",(function(){return pt})),n.d(r,"methods",(function(){return pt})),n.d(r,"extend",(function(){return dt})),n.d(r,"extendOwn",(function(){return gt})),n.d(r,"assign",(function(){return gt})),n.d(r,"defaults",(function(){return mt})),n.d(r,"create",(function(){return _t})),n.d(r,"clone",(function(){return vt})),n.d(r,"tap",(function(){return bt})),n.d(r,"get",(function(){return St})),n.d(r,"has",(function(){return xt})),n.d(r,"mapObject",(function(){return Nt})),n.d(r,"identity",(function(){return It})),n.d(r,"constant",(function(){return N})),n.d(r,"noop",(function(){return kt})),n.d(r,"toPath",(function(){return wt})),n.d(r,"property",(function(){return Tt})),n.d(r,"propertyOf",(function(){return At})),n.d(r,"matcher",(function(){return Ot})),n.d(r,"matches",(function(){return Ot})),n.d(r,"times",(function(){return Ft})),n.d(r,"random",(function(){return Bt})),n.d(r,"now",(function(){return Mt})),n.d(r,"escape",(function(){return Ht})),n.d(r,"unescape",(function(){return Ut})),n.d(r,"templateSettings",(function(){return Wt})),n.d(r,"template",(function(){return Kt})),n.d(r,"result",(function(){return Yt})),n.d(r,"uniqueId",(function(){return Zt})),n.d(r,"chain",(function(){return Qt})),n.d(r,"iteratee",(function(){return Et})),n.d(r,"partial",(function(){return ne})),n.d(r,"bind",(function(){return re})),n.d(r,"bindAll",(function(){return ae})),n.d(r,"memoize",(function(){return se})),n.d(r,"delay",(function(){return le})),n.d(r,"defer",(function(){return ue})),n.d(r,"throttle",(function(){return ce})),n.d(r,"debounce",(function(){return he})),n.d(r,"wrap",(function(){return pe})),n.d(r,"negate",(function(){return fe})),n.d(r,"compose",(function(){return de})),n.d(r,"after",(function(){return ge})),n.d(r,"before",(function(){return me})),n.d(r,"once",(function(){return ye})),n.d(r,"findKey",(function(){return _e})),n.d(r,"findIndex",(function(){return be})),n.d(r,"findLastIndex",(function(){return we})),n.d(r,"sortedIndex",(function(){return Ce})),n.d(r,"indexOf",(function(){return Se})),n.d(r,"lastIndexOf",(function(){return xe})),n.d(r,"find",(function(){return Ie})),n.d(r,"detect",(function(){return Ie})),n.d(r,"findWhere",(function(){return Oe})),n.d(r,"each",(function(){return Te})),n.d(r,"forEach",(function(){return Te})),n.d(r,"map",(function(){return Le})),n.d(r,"collect",(function(){return Le})),n.d(r,"reduce",(function(){return Ee})),n.d(r,"foldl",(function(){return Ee})),n.d(r,"inject",(function(){return Ee})),n.d(r,"reduceRight",(function(){return je})),n.d(r,"foldr",(function(){return je})),n.d(r,"filter",(function(){return Ne})),n.d(r,"select",(function(){return Ne})),n.d(r,"reject",(function(){return ke})),n.d(r,"every",(function(){return Ae})),n.d(r,"all",(function(){return Ae})),n.d(r,"some",(function(){return Fe})),n.d(r,"any",(function(){return Fe})),n.d(r,"contains",(function(){return Be})),n.d(r,"includes",(function(){return Be})),n.d(r,"include",(function(){return Be})),n.d(r,"invoke",(function(){return Me})),n.d(r,"pluck",(function(){return ze})),n.d(r,"where",(function(){return De})),n.d(r,"max",(function(){return He})),n.d(r,"min",(function(){return Ue})),n.d(r,"shuffle",(function(){return Ge})),n.d(r,"sample",(function(){return qe})),n.d(r,"sortBy",(function(){return $e})),n.d(r,"groupBy",(function(){return Ke})),n.d(r,"indexBy",(function(){return Ye})),n.d(r,"countBy",(function(){return Je})),n.d(r,"partition",(function(){return Ze})),n.d(r,"toArray",(function(){return Ve})),n.d(r,"size",(function(){return Qe})),n.d(r,"pick",(function(){return en})),n.d(r,"omit",(function(){return nn})),n.d(r,"first",(function(){return on})),n.d(r,"head",(function(){return on})),n.d(r,"take",(function(){return on})),n.d(r,"initial",(function(){return rn})),n.d(r,"last",(function(){return sn})),n.d(r,"rest",(function(){return an})),n.d(r,"tail",(function(){return an})),n.d(r,"drop",(function(){return an})),n.d(r,"compact",(function(){return ln})),n.d(r,"flatten",(function(){return un})),n.d(r,"without",(function(){return hn})),n.d(r,"uniq",(function(){return pn})),n.d(r,"unique",(function(){return pn})),n.d(r,"union",(function(){return fn})),n.d(r,"intersection",(function(){return dn})),n.d(r,"difference",(function(){return cn})),n.d(r,"unzip",(function(){return gn})),n.d(r,"transpose",(function(){return gn})),n.d(r,"zip",(function(){return mn})),n.d(r,"object",(function(){return yn})),n.d(r,"range",(function(){return _n})),n.d(r,"chunk",(function(){return vn})),n.d(r,"mixin",(function(){return wn})),n.d(r,"default",(function(){return Cn}));var i=n(413);function o(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}}function a(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function s(t){return null===t}function l(t){return void 0===t}function u(t){return!0===t||!1===t||"[object Boolean]"===i.t.call(t)}function c(t){return!(!t||1!==t.nodeType)}function h(t){var e="[object "+t+"]";return function(t){return i.t.call(t)===e}}var p=h("String"),f=h("Number"),d=h("Date"),g=h("RegExp"),m=h("Error"),y=h("Symbol"),_=h("ArrayBuffer"),v=h("Function"),b=i.p.document&&i.p.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof b&&(v=function(t){return"function"==typeof t||!1});var w=v,C=h("Object"),P=i.s&&C(new DataView(new ArrayBuffer(8))),S="undefined"!=typeof Map&&C(new Map),x=h("DataView"),I=P?function(t){return null!=t&&w(t.getInt8)&&_(t.buffer)}:x,O=i.k||h("Array");function T(t,e){return null!=t&&i.i.call(t,e)}var L=h("Arguments");!function(){L(arguments)||(L=function(t){return T(t,"callee")})}();var R=L;function E(t){return!y(t)&&Object(i.f)(t)&&!isNaN(parseFloat(t))}function j(t){return f(t)&&Object(i.g)(t)}function N(t){return function(){return t}}function k(t){return function(e){var n=t(e);return"number"==typeof n&&n>=0&&n<=i.b}}function A(t){return function(e){return null==e?void 0:e[t]}}var F=A("byteLength"),B=k(F),M=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,z=i.r?function(t){return i.l?Object(i.l)(t)&&!I(t):B(t)&&M.test(i.t.call(t))}:N(!1),D=A("length");function H(t,e){e=function(t){for(var e={},n=t.length,r=0;r<n;++r)e[t[r]]=!0;return{contains:function(t){return!0===e[t]},push:function(n){return e[n]=!0,t.push(n)}}}(e);var n=i.n.length,r=t.constructor,o=w(r)&&r.prototype||i.c,a="constructor";for(T(t,a)&&!e.contains(a)&&e.push(a);n--;)(a=i.n[n])in t&&t[a]!==o[a]&&!e.contains(a)&&e.push(a)}function U(t){if(!a(t))return[];if(i.m)return Object(i.m)(t);var e=[];for(var n in t)T(t,n)&&e.push(n);return i.h&&H(t,e),e}function W(t){if(null==t)return!0;var e=D(t);return"number"==typeof e&&(O(t)||p(t)||R(t))?0===e:0===D(U(t))}function V(t,e){var n=U(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0}function q(t){return t instanceof q?t:this instanceof q?void(this._wrapped=t):new q(t)}function G(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,F(t))}q.VERSION=i.e,q.prototype.value=function(){return this._wrapped},q.prototype.valueOf=q.prototype.toJSON=q.prototype.value,q.prototype.toString=function(){return String(this._wrapped)};var $="[object DataView]";function X(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&K(t,e,n,r)}function K(t,e,n,r){t instanceof q&&(t=t._wrapped),e instanceof q&&(e=e._wrapped);var o=i.t.call(t);if(o!==i.t.call(e))return!1;if(P&&"[object Object]"==o&&I(t)){if(!I(e))return!1;o=$}switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return i.d.valueOf.call(t)===i.d.valueOf.call(e);case"[object ArrayBuffer]":case $:return K(G(t),G(e),n,r)}var a="[object Array]"===o;if(!a&&z(t)){if(F(t)!==F(e))return!1;if(t.buffer===e.buffer&&t.byteOffset===e.byteOffset)return!0;a=!0}if(!a){if("object"!=typeof t||"object"!=typeof e)return!1;var s=t.constructor,l=e.constructor;if(s!==l&&!(w(s)&&s instanceof s&&w(l)&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===t)return r[u]===e;if(n.push(t),r.push(e),a){if((u=t.length)!==e.length)return!1;for(;u--;)if(!X(t[u],e[u],n,r))return!1}else{var c,h=U(t);if(u=h.length,U(e).length!==u)return!1;for(;u--;)if(!T(e,c=h[u])||!X(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0}function Y(t,e){return X(t,e)}function J(t){if(!a(t))return[];var e=[];for(var n in t)e.push(n);return i.h&&H(t,e),e}function Z(t){var e=D(t);return function(n){if(null==n)return!1;var r=J(n);if(D(r))return!1;for(var i=0;i<e;i++)if(!w(n[t[i]]))return!1;return t!==rt||!w(n[Q])}}var Q="forEach",tt=["clear","delete"],et=["get","has","set"],nt=tt.concat(Q,et),rt=tt.concat(et),it=["add"].concat(tt,Q,"has"),ot=S?Z(nt):h("Map"),at=S?Z(rt):h("WeakMap"),st=S?Z(it):h("Set"),lt=h("WeakSet");function ut(t){for(var e=U(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r}function ct(t){for(var e=U(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r}function ht(t){for(var e={},n=U(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e}function pt(t){var e=[];for(var n in t)w(t[n])&&e.push(n);return e.sort()}function ft(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,l=0;l<s;l++){var u=a[l];e&&void 0!==n[u]||(n[u]=o[u])}return n}}var dt=ft(J),gt=ft(U),mt=ft(J,!0);function yt(t){if(!a(t))return{};if(i.j)return Object(i.j)(t);var e=function(){};e.prototype=t;var n=new e;return e.prototype=null,n}function _t(t,e){var n=yt(t);return e&>(n,e),n}function vt(t){return a(t)?O(t)?t.slice():dt({},t):t}function bt(t,e){return e(t),t}function wt(t){return O(t)?t:[t]}function Ct(t){return q.toPath(t)}function Pt(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function St(t,e,n){var r=Pt(t,Ct(e));return l(r)?n:r}function xt(t,e){for(var n=(e=Ct(e)).length,r=0;r<n;r++){var i=e[r];if(!T(t,i))return!1;t=t[i]}return!!n}function It(t){return t}function Ot(t){return t=gt({},t),function(e){return V(e,t)}}function Tt(t){return t=Ct(t),function(e){return Pt(e,t)}}function Lt(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}}function Rt(t,e,n){return null==t?It:w(t)?Lt(t,e,n):a(t)&&!O(t)?Ot(t):Tt(t)}function Et(t,e){return Rt(t,e,1/0)}function jt(t,e,n){return q.iteratee!==Et?q.iteratee(t,e):Rt(t,e,n)}function Nt(t,e,n){e=jt(e,n);for(var r=U(t),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=e(t[s],s,t)}return o}function kt(){}function At(t){return null==t?kt:function(e){return St(t,e)}}function Ft(t,e,n){var r=Array(Math.max(0,t));e=Lt(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r}function Bt(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}q.toPath=wt,q.iteratee=Et;var Mt=Date.now||function(){return(new Date).getTime()};function zt(t){var e=function(e){return t[e]},n="(?:"+U(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}}var Dt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ht=zt(Dt),Ut=zt(ht(Dt)),Wt=q.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Vt=/(.)^/,qt={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Gt=/\\|'|\r|\n|\u2028|\u2029/g;function $t(t){return"\\"+qt[t]}var Xt=/^\s*(\w|\$)+\s*$/;function Kt(t,e,n){!e&&n&&(e=n),e=mt({},e,q.templateSettings);var r=RegExp([(e.escape||Vt).source,(e.interpolate||Vt).source,(e.evaluate||Vt).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,(function(e,n,r,a,s){return o+=t.slice(i,s).replace(Gt,$t),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e})),o+="';\n";var a,s=e.variable;if(s){if(!Xt.test(s))throw new Error("variable is not a bare identifier: "+s)}else o="with(obj||{}){\n"+o+"}\n",s="obj";o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{a=new Function(s,"_",o)}catch(u){throw u.source=o,u}var l=function(t){return a.call(this,t,q)};return l.source="function("+s+"){\n"+o+"}",l}function Yt(t,e,n){var r=(e=Ct(e)).length;if(!r)return w(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=w(o)?o.call(t):o}return t}var Jt=0;function Zt(t){var e=++Jt+"";return t?t+e:e}function Qt(t){var e=q(t);return e._chain=!0,e}function te(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=yt(t.prototype),s=t.apply(o,i);return a(s)?s:o}var ee=o((function(t,e){var n=ee.placeholder,r=function(){for(var i=0,o=e.length,a=Array(o),s=0;s<o;s++)a[s]=e[s]===n?arguments[i++]:e[s];for(;i<arguments.length;)a.push(arguments[i++]);return te(t,r,this,this,a)};return r}));ee.placeholder=q;var ne=ee,re=o((function(t,e,n){if(!w(t))throw new TypeError("Bind must be called on a function");var r=o((function(i){return te(t,r,e,this,n.concat(i))}));return r})),ie=k(D);function oe(t,e,n,r){if(r=r||[],e||0===e){if(e<=0)return r.concat(t)}else e=1/0;for(var i=r.length,o=0,a=D(t);o<a;o++){var s=t[o];if(ie(s)&&(O(s)||R(s)))if(e>1)oe(s,e-1,n,r),i=r.length;else for(var l=0,u=s.length;l<u;)r[i++]=s[l++];else n||(r[i++]=s)}return r}var ae=o((function(t,e){var n=(e=oe(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=re(t[r],t)}return t}));function se(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return T(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n}var le=o((function(t,e,n){return setTimeout((function(){return t.apply(null,n)}),e)})),ue=ne(le,q,1);function ce(t,e,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:Mt(),r=null,a=t.apply(i,o),r||(i=o=null)},u=function(){var u=Mt();s||!1!==n.leading||(s=u);var c=e-(u-s);return i=this,o=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),s=u,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,c)),a};return u.cancel=function(){clearTimeout(r),s=0,r=i=o=null},u}function he(t,e,n){var r,i,a,s,l,u=function(){var o=Mt()-i;e>o?r=setTimeout(u,e-o):(r=null,n||(s=t.apply(l,a)),r||(a=l=null))},c=o((function(o){return l=this,a=o,i=Mt(),r||(r=setTimeout(u,e),n&&(s=t.apply(l,a))),s}));return c.cancel=function(){clearTimeout(r),r=a=l=null},c}function pe(t,e){return ne(e,t)}function fe(t){return function(){return!t.apply(this,arguments)}}function de(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function ge(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function me(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}var ye=ne(me,2);function _e(t,e,n){e=jt(e,n);for(var r,i=U(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r}function ve(t){return function(e,n,r){n=jt(n,r);for(var i=D(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}}var be=ve(1),we=ve(-1);function Ce(t,e,n,r){for(var i=(n=jt(n,r,1))(e),o=0,a=D(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o}function Pe(t,e,n){return function(r,o,a){var s=0,l=D(r);if("number"==typeof a)t>0?s=a>=0?a:Math.max(a+l,s):l=a>=0?Math.min(a+1,l):a+l+1;else if(n&&a&&l)return r[a=n(r,o)]===o?a:-1;if(o!=o)return(a=e(i.q.call(r,s,l),j))>=0?a+s:-1;for(a=t>0?s:l-1;a>=0&&a<l;a+=t)if(r[a]===o)return a;return-1}}var Se=Pe(1,be,Ce),xe=Pe(-1,we);function Ie(t,e,n){var r=(ie(t)?be:_e)(t,e,n);if(void 0!==r&&-1!==r)return t[r]}function Oe(t,e){return Ie(t,Ot(e))}function Te(t,e,n){var r,i;if(e=Lt(e,n),ie(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=U(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t}function Le(t,e,n){e=jt(e,n);for(var r=!ie(t)&&U(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o}function Re(t){return function(e,n,r,i){var o=arguments.length>=3;return function(e,n,r,i){var o=!ie(e)&&U(e),a=(o||e).length,s=t>0?0:a-1;for(i||(r=e[o?o[s]:s],s+=t);s>=0&&s<a;s+=t){var l=o?o[s]:s;r=n(r,e[l],l,e)}return r}(e,Lt(n,i,4),r,o)}}var Ee=Re(1),je=Re(-1);function Ne(t,e,n){var r=[];return e=jt(e,n),Te(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function ke(t,e,n){return Ne(t,fe(jt(e)),n)}function Ae(t,e,n){e=jt(e,n);for(var r=!ie(t)&&U(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0}function Fe(t,e,n){e=jt(e,n);for(var r=!ie(t)&&U(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1}function Be(t,e,n,r){return ie(t)||(t=ut(t)),("number"!=typeof n||r)&&(n=0),Se(t,e,n)>=0}var Me=o((function(t,e,n){var r,i;return w(e)?i=e:(e=Ct(e),r=e.slice(0,-1),e=e[e.length-1]),Le(t,(function(t){var o=i;if(!o){if(r&&r.length&&(t=Pt(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)}))}));function ze(t,e){return Le(t,Tt(e))}function De(t,e){return Ne(t,Ot(e))}function He(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=ie(t)?t:ut(t)).length;s<l;s++)null!=(r=t[s])&&r>o&&(o=r);else e=jt(e,n),Te(t,(function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o}function Ue(t,e,n){var r,i,o=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=ie(t)?t:ut(t)).length;s<l;s++)null!=(r=t[s])&&r<o&&(o=r);else e=jt(e,n),Te(t,(function(t,n,r){((i=e(t,n,r))<a||i===1/0&&o===1/0)&&(o=t,a=i)}));return o}var We=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Ve(t){return t?O(t)?i.q.call(t):p(t)?t.match(We):ie(t)?Le(t,It):ut(t):[]}function qe(t,e,n){if(null==e||n)return ie(t)||(t=ut(t)),t[Bt(t.length-1)];var r=Ve(t),i=D(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a<e;a++){var s=Bt(a,o),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,e)}function Ge(t){return qe(t,1/0)}function $e(t,e,n){var r=0;return e=jt(e,n),ze(Le(t,(function(t,n,i){return{value:t,index:r++,criteria:e(t,n,i)}})).sort((function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index})),"value")}function Xe(t,e){return function(n,r,i){var o=e?[[],[]]:{};return r=jt(r,i),Te(n,(function(e,i){var a=r(e,i,n);t(o,e,a)})),o}}var Ke=Xe((function(t,e,n){T(t,n)?t[n].push(e):t[n]=[e]})),Ye=Xe((function(t,e,n){t[n]=e})),Je=Xe((function(t,e,n){T(t,n)?t[n]++:t[n]=1})),Ze=Xe((function(t,e,n){t[n?0:1].push(e)}),!0);function Qe(t){return null==t?0:ie(t)?t.length:U(t).length}function tn(t,e,n){return e in n}var en=o((function(t,e){var n={},r=e[0];if(null==t)return n;w(r)?(e.length>1&&(r=Lt(r,e[1])),e=J(t)):(r=tn,e=oe(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var a=e[i],s=t[a];r(s,a,t)&&(n[a]=s)}return n})),nn=o((function(t,e){var n,r=e[0];return w(r)?(r=fe(r),e.length>1&&(n=e[1])):(e=Le(oe(e,!1,!1),String),r=function(t,n){return!Be(e,n)}),en(t,r,n)}));function rn(t,e,n){return i.q.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function on(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:rn(t,t.length-e)}function an(t,e,n){return i.q.call(t,null==e||n?1:e)}function sn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:an(t,Math.max(0,t.length-e))}function ln(t){return Ne(t,Boolean)}function un(t,e){return oe(t,e,!1)}var cn=o((function(t,e){return e=oe(e,!0,!0),Ne(t,(function(t){return!Be(e,t)}))})),hn=o((function(t,e){return cn(t,e)}));function pn(t,e,n,r){u(e)||(r=n,n=e,e=!1),null!=n&&(n=jt(n,r));for(var i=[],o=[],a=0,s=D(t);a<s;a++){var l=t[a],c=n?n(l,a,t):l;e&&!n?(a&&o===c||i.push(l),o=c):n?Be(o,c)||(o.push(c),i.push(l)):Be(i,l)||i.push(l)}return i}var fn=o((function(t){return pn(oe(t,!0,!0))}));function dn(t){for(var e=[],n=arguments.length,r=0,i=D(t);r<i;r++){var o=t[r];if(!Be(e,o)){var a;for(a=1;a<n&&Be(arguments[a],o);a++);a===n&&e.push(o)}}return e}function gn(t){for(var e=t&&He(t,D).length||0,n=Array(e),r=0;r<e;r++)n[r]=ze(t,r);return n}var mn=o(gn);function yn(t,e){for(var n={},r=0,i=D(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n}function _n(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i}function vn(t,e){if(null==e||e<1)return[];for(var n=[],r=0,o=t.length;r<o;)n.push(i.q.call(t,r,r+=e));return n}function bn(t,e){return t._chain?q(e).chain():e}function wn(t){return Te(pt(t),(function(e){var n=q[e]=t[e];q.prototype[e]=function(){var t=[this._wrapped];return i.o.apply(t,arguments),bn(this,n.apply(q,t))}})),q}Te(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=i.a[t];q.prototype[t]=function(){var n=this._wrapped;return null!=n&&(e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),bn(this,n)}})),Te(["concat","join","slice"],(function(t){var e=i.a[t];q.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),bn(this,t)}}));var Cn=q,Pn=wn(r);Pn._=Pn},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(406),i=n(407),o=n(509),a=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},s=function(){function t(){}return t.drawCross=function(e,n,i,o,a,s){var l=new r.RotatedRectangleF(n,i,o,o).toRectangleF();t.drawLine(e,l.left,l.top,l.right,l.bottom,a,s),t.drawLine(e,l.left,l.bottom,l.right,l.top,a,s)},t.drawLine=function(e,n,r,i,o,a,s,l,u){if(void 0===l&&(l=1),void 0===u&&(u=null),!(t.isFullTransparentColor(s)||a<=0||null==l||l<=0)){e.save();try{l&&(e.globalAlpha=e.globalAlpha*l),e.lineWidth=a,e.strokeStyle=s,u&&e.setLineDash(u),e.beginPath(),e.moveTo(n,r),e.lineTo(i,o),e.stroke()}finally{e.restore()}}},t.drawDashedLine=function(e,n,r,i,o,a,s,l,u,c,h){if(void 0===h&&(h=1),a>0&&u>0&&c>0&&(null==h||h>0)){if(e.save(),h&&(e.globalAlpha=e.globalAlpha*h),e.lineWidth=a,i<n){var p=n;n=i,i=p,p=r,r=o,o=p}var f,d=i-n,g=o-r,m=u+c,y=Math.sqrt(d*d+g*g),_=Math.floor(y/m),v=(d/=y/m)*(u/m),b=d*(c/m),w=(g/=y/m)*(u/m),C=g*(c/m),P=n,S=r;if(!t.isFullTransparentColor(s)){for(e.strokeStyle=s,e.beginPath(),e.moveTo(P,S),f=0;f<_;f++)P+=v,S+=w,e.lineTo(P,S),P+=b,S+=C,f+1<_&&e.moveTo(P,S);P+v<=i&&S+w<=o?(e.moveTo(P,S),e.lineTo(P+v,S+w)):(e.moveTo(P,S),e.lineTo(i,o)),e.closePath(),e.stroke()}if(P=n+v,S=r+w,!t.isFullTransparentColor(l)){for(e.strokeStyle=l,e.beginPath(),e.moveTo(P,S),f=0;f<_;f++)P+=b,S+=C,e.lineTo(P,S),P+=v,S+=w,f+1<_&&e.moveTo(P,S);P<i&&S<o&&(e.moveTo(P,S),e.lineTo(i,o)),e.closePath(),e.stroke()}e.restore()}},t.drawPolyline=function(e,n,r,i,o){if(!t.isFullTransparentColor(i)&&r>0&&(null==o||o>0)&&n&&n.length>1){e.save(),o&&(e.globalAlpha=e.globalAlpha*o),e.lineWidth=r,e.strokeStyle=i,e.beginPath(),e.moveTo(n[0].x,n[0].y);for(var a=1,s=n.length;a<s;++a){var l=n[a];e.lineTo(l.x,l.y)}e.stroke(),e.restore()}},t.drawPath=function(e,n,r,i,o,a,s,l,u){void 0===l&&(l=[]),void 0===u&&(u=null),t.path(e,n,r,i,null,o,a,s,l,u)},t.fillPath=function(e,n,r,i,o,a){t.path(e,n,r,i,o,0,null,a,[])},t.drawStroke=function(e,n,r,i,o,a,s,l,u){if(!(o<=0)&&(t.path(e,n,r,i,null,o,a,l,u),null!=s&&null!=u&&u.length>0)){var c=u.slice(0);c.unshift(0),c.push(0),t.path(e,n,r,i,null,o,s,l,c)}},t.path=function(e,n,i,o,s,l,u,c,h,p){void 0===p&&(p=null);var f=null!=u&&!t.isFullTransparentColor(u)&&l>0,d=null!=s&&!t.isFullTransparentColor(s);if((f||d)&&(null==c||c>0)){e.save(),c&&(e.globalAlpha=e.globalAlpha*c);var g=o.toMatrix();if(e.translate(i.x,i.y),e.transform(g.m00,g.m10,g.m01,g.m11,g.m02,g.m12),e.translate(-i.x,-i.y),n instanceof r.Path?n.draw(e):"function"==typeof n.addToContext&&n.addToContext(e),d&&(e.fillStyle=s,e.fill()),f){if(n instanceof r.Path&&!Object(r.EqualsOfFloatNumbers)(o.scaleX,o.scaleY)){e.restore(),e.save(),c&&(e.globalAlpha=c);var m=n.clone();m.transform(o,i),m.draw(e)}else if(l/=o.scaleX,h&&h.length>0)for(var y=0;y<h.length;y++)h[y]/=o.scaleX;if(e.lineWidth=l,e.strokeStyle=u,e.setLineDash(h),e.stroke(),null!=h&&h.length>0&&p){var _=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t}([0],h,[0]);e.setLineDash(_),e.strokeStyle=p,e.stroke()}}e.restore()}},t.clipPath=function(t,e){e.draw(t),t.clip()},t.drawImage=function(e,n,i,o,a,s,l,u,c,h){if(void 0===s&&(s=!1),void 0===l&&(l=null),void 0===u&&(u=1),void 0===c&&(c=null),void 0===h&&(h=0),null==u||u>0){if(e.save(),u&&(e.globalAlpha=e.globalAlpha*u),e.translate(i.centerX,i.centerY),e.rotate(Object(r.ConvertDegreeToRadian)(i.angle)),h){var p=h/o,f=h/a;i.width+=2*p,i.height+=2*f}var d=void 0,g=void 0;null!=c?(d=c.width,g=c.height):(d=n.naturalWidth?n.naturalWidth:n.width?n.width:e.canvas.width,g=n.naturalHeight?n.naturalHeight:n.height?n.height:e.canvas.height);var m=null!=o&&0!==o&&null!=a&&0!==a&&Math.abs(d-i.width*o)<1&&Math.abs(g-i.height*a)<1;s||(s=(e.imageSmoothingEnabled||!0===e.msImageSmoothingEnabled)&&Math.abs(i.angle)%90<.01&&m),s&&(e.imageSmoothingEnabled=!1,e.msImageSmoothingEnabled=!1);try{m?(e.scale(1/o,1/a),null!=c?e.drawImage(n,c.left,c.top,c.width,c.height,-i.width*o/2,-i.height*a/2,d,g):e.drawImage(n,-i.width*o/2,-i.height*a/2,d,g),e.scale(o,a)):null!=c?e.drawImage(n,c.left,c.top,c.width,c.height,-i.width/2,-i.height/2,i.width,i.height):e.drawImage(n,-i.width/2,-i.height/2,i.width,i.height),l&&!t.isFullTransparentColor(l)&&(e.fillStyle=l,e.fillRect(-i.width/2,-i.height/2,i.width,i.height))}catch(y){}s&&(e.imageSmoothingEnabled=!0,e.msImageSmoothingEnabled=!0),e.restore()}},t.drawRectangle=function(e,n,r,i,o){t.rectangle(e,n,r,i,null,o)},t.fillRectangle=function(e,n,r,i){t.rectangle(e,n,0,null,r,i)},t.rectangle=function(e,n,i,o,a,s,l){void 0===a&&(a=null),void 0===s&&(s=1),void 0===l&&(l=null);var u=o&&!t.isFullTransparentColor(o)&&i>0,c=a&&!t.isFullTransparentColor(a);(u||c)&&(null==s||s>0)&&(e.save(),s&&(e.globalAlpha=e.globalAlpha*s),e.translate(n.centerX,n.centerY),e.rotate(Object(r.ConvertDegreeToRadian)(n.angle)),c&&(e.fillStyle=a,e.fillRect(-n.width/2,-n.height/2,n.width,n.height)),u&&(null!=l&&e.setLineDash(l),e.lineWidth=i,e.strokeStyle=o,e.strokeRect(-n.width/2,-n.height/2,n.width,n.height)),e.restore())},t.measureText=function(e,n,i,o,a,s,l){void 0===a&&(a=null),void 0===s&&(s=null),void 0===l&&(l=0);var u=s&&!t.isFullTransparentColor(s),c=a&&!t.isFullTransparentColor(a);if(null==u&&null==c)return null;e.save();try{return e.font=o,e.translate(i.x,i.y),e.rotate(Object(r.ConvertDegreeToRadian)(l)),c&&(e.fillStyle=a),u&&(e.strokeStyle=s),e.measureText(n)}finally{e.restore()}},t._drawTextBackground=function(e,n,i,o,a,s,l,u,c,h){var p=i-n,f=a-o,d=null;if(h>0){var g=new r.SizeF(h,h);d=[g,g,g,g]}var m=r.Path.roundedRectangle(n-c.left,o-c.top,p+c.left+c.right,f+c.top+c.bottom,d);t.path(e,m,new r.PointF,new r.Transform,s,u,l,1,[])},t.text=function(e,n,a,s,l,u,c,h,p,f,d,g,m,y,_){if(void 0===l&&(l=null),void 0===u&&(u=null),void 0===c&&(c=0),void 0===h&&(h=null),void 0===p&&(p="left"),void 0===f&&(f="alphabetic"),void 0===d&&(d=null),void 0===g&&(g=null),void 0===m&&(m=0),void 0===y&&(y=new o.a(0)),void 0===_&&(_=0),null!=d&&"bottom"!=f&&"middle"!=f)throw new i.e("textBaseline = "+f+" is not supported yet");var v=u&&!t.isFullTransparentColor(u),b=l&&!t.isFullTransparentColor(l);if(v||b){e.save(),e.font=s,e.translate(a.x,a.y),e.rotate(Object(r.ConvertDegreeToRadian)(c)),e.textAlign=p,e.textBaseline=f,b&&(e.fillStyle=l),v&&(e.strokeStyle=u);var w=Math.floor(h/e.measureText("x").width),C=this._splitTextToLines(n,w);if(C.length>1&&"bottom"!=f)throw new i.e("textBaseline = "+f+" is not supported yet");var P=e.measureText(""),S=0,x=0;C.forEach((function(t){var n=e.measureText(t);S+=n.actualBoundingBoxAscent,x+=n.actualBoundingBoxDescent,n.width>P.width&&(P=n)}));var I=s.match(/\d+(px|pt)/),O=0;if(I.length>0){var T=Number.parseFloat(I[0].substring(0,I[0].length-2));O="px"==I[1]?T:1.33*T}var L=O>0?O:P.actualBoundingBoxAscent+P.actualBoundingBoxDescent,R=10*L/7,E=L+R*(C.length-1),j=0;"bottom"===f&&(x=-R/40,S=E-P.actualBoundingBoxDescent,j=-R*(C.length-1)),(d||null!=g&&m>0)&&this._drawTextBackground(e,-P.actualBoundingBoxLeft,P.actualBoundingBoxRight,-S,x,d,g,m,y,_),C.forEach((function(t,n){b&&e.fillText(t,0,j+n*R),v&&e.strokeText(t,0,j+n*R)})),e.restore()}},t._splitTextToLines=function(t,e){void 0===e&&(e=null);var n=null;if(e){var r=new RegExp("(?![^\\n]{1,"+e+"}$)([^\\n]{1,"+e+"})\\s","g");n=t.replace(r,"$1\n").split("\n");for(var i=0;i<n.length;i++)if(n[i].length>e){var o=n[i].substring(e);n[i]=n[i].substring(0,e),n.splice(i+1,0,o)}}else n=t.split("\n");return n},t.isFullTransparentColor=function(t){if(!t)return!1;var e=t.A||t.a;return 0===e||!("string"!=typeof t||!(e=/^\s*rgba\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\,\s*(\d{1,}(\.\d{1,})?)\s*\)\s*;{0,1}\s*$/i.exec(t)))&&0===parseFloat(e[1])},t.clearCanvas=function(t,e){void 0===e&&(e=!1),e&&(t.save(),t.setTransform(1,0,0,1,0,0)),t.clearRect(0,0,t.canvas.width,t.canvas.height),e&&t.restore()},t.drawRoundedRectangle=function(t,e,n){t.roundedRectangle(e.left,e.top,e.width,e.height,n)},t}();CanvasRenderingContext2D.prototype.roundedRectangle=function(t,e,n,r,i){var o=2*Math.PI/2,a=2*Math.PI/4;this.beginPath(),this.arc(i+t,i+e,i,-a,o,!0),this.lineTo(t,e+r-i),this.arc(i+t,r-i+e,i,o,a,!0),this.lineTo(t+n-i,e+r),this.arc(t+n-i,e+r-i,i,a,0,!0),this.lineTo(t+n,e+i),this.arc(t+n-i,e+i,i,0,-a,!0),this.lineTo(t+i,e),this.stroke(),this.fill(),this.closePath()}},function(t,e,n){"use strict";(function(t){var r=n(813);const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,a=(t=>e=>{const n=i.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),s=t=>(t=t.toLowerCase(),e=>a(e)===t),l=t=>e=>typeof e===t,{isArray:u}=Array,c=l("undefined"),h=s("ArrayBuffer"),p=l("string"),f=l("function"),d=l("number"),g=t=>null!==t&&"object"==typeof t,m=t=>{if("object"!==a(t))return!1;const e=o(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},y=s("Date"),_=s("File"),v=s("Blob"),b=s("FileList"),w=s("URLSearchParams");function C(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,i;if("object"!=typeof t&&(t=[t]),u(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(r=0;r<o;r++)a=i[r],e.call(null,t[a],a,t)}}function P(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,i=n.length;for(;i-- >0;)if(r=n[i],e===r.toLowerCase())return r;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:t,x=t=>!c(t)&&t!==S,I=(t=>e=>t&&e instanceof t)("undefined"!=typeof Uint8Array&&o(Uint8Array)),O=s("HTMLFormElement"),T=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),L=s("RegExp"),R=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};C(n,((n,i)=>{!1!==e(n,i,t)&&(r[i]=n)})),Object.defineProperties(t,r)},E="abcdefghijklmnopqrstuvwxyz",j="0123456789",N={DIGIT:j,ALPHA:E,ALPHA_DIGIT:E+E.toUpperCase()+j};e.a={isArray:u,isArrayBuffer:h,isBuffer:function(t){return null!==t&&!c(t)&&null!==t.constructor&&!c(t.constructor)&&f(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||i.call(t)===e||f(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&h(t.buffer),e},isString:p,isNumber:d,isBoolean:t=>!0===t||!1===t,isObject:g,isPlainObject:m,isUndefined:c,isDate:y,isFile:_,isBlob:v,isRegExp:L,isFunction:f,isStream:t=>g(t)&&f(t.pipe),isURLSearchParams:w,isTypedArray:I,isFileList:b,forEach:C,merge:function t(){const{caseless:e}=x(this)&&this||{},n={},r=(r,i)=>{const o=e&&P(n,i)||i;m(n[o])&&m(r)?n[o]=t(n[o],r):m(r)?n[o]=t({},r):u(r)?n[o]=r.slice():n[o]=r};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&C(arguments[i],r);return n},extend:(t,e,n,{allOwnKeys:i}={})=>(C(e,((e,i)=>{n&&f(e)?t[i]=Object(r.a)(e,n):t[i]=e}),{allOwnKeys:i}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let i,a,s;const l={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),a=i.length;a-- >0;)s=i[a],r&&!r(s,t,e)||l[s]||(e[s]=t[s],l[s]=!0);t=!1!==n&&o(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:a,kindOfTest:s,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(u(t))return t;let e=t.length;if(!d(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:O,hasOwnProperty:T,hasOwnProp:T,reduceDescriptors:R,freezeMethods:t=>{R(t,((e,n)=>{if(f(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];f(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return u(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:P,global:S,isContextDefined:x,ALPHABET:N,generateString:(t=16,e=N.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&f(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(g(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const i=u(t)?[]:{};return C(t,((t,e)=>{const o=n(t,r+1);!c(o)&&(i[e]=o)})),e[r]=void 0,i}}return t};return n(t,0)}}}).call(this,n(53))},,function(t,e,n){"use strict";var r=n(480);n.d(e,"BlockElement",(function(){return r.a}));var i=n(520);n.d(e,"InlineElement",(function(){return i.a}));var o=n(748);n.d(e,"Br",(function(){return o.a})),n.d(e,"InlineText",(function(){return o.b}));var a=n(749);n.d(e,"ListStyleType",(function(){return a.a})),n.d(e,"NumberFormatType",(function(){return a.b})),n.d(e,"NumberMode",(function(){return a.c})),n.d(e,"ParagraphListStyle",(function(){return a.d})),n.d(e,"ParagraphMetadata",(function(){return a.e}));var s=n(582);n.d(e,"NumericValue",(function(){return s.a})),n.d(e,"Units",(function(){return s.b}));var l=n(750);n.d(e,"Paragraph",(function(){return l.a})),n.d(e,"ParagraphAlignment",(function(){return l.b})),n.d(e,"ParagraphStyle",(function(){return l.c}));var u=n(521);n.d(e,"OpenTypeFeature",(function(){return u.a})),n.d(e,"Span",(function(){return u.b})),n.d(e,"SpanStyle",(function(){return u.c}));var c=n(751);n.d(e,"Text",(function(){return c.a})),n(752)},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r,i=n(408),o=n(491),a=n(543),s=n.n(a),l=(n(860),n(407));!function(t){t.Move="Move",t.Add="Add",t.Remove="Remove"}(r||(r={}));var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},c=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},h=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t},p=null;!function(t){p=s.a.from;try{t.from=function(t){return t instanceof f?t:p(t)}}catch(e){console.error("unable to patch Enumerable",e)}}(s.a);var f=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n;this._collection=[],this.constructor=function(t){throw new l.e},this._itemAddedEvent=new i.a,this._itemRemovedEvent=new i.a,this._itemMovedEvent=new i.a,this._enumerable=(n=this._collection)instanceof f?n:p?p(n):s.a.from(n),0!==t.length&&this.setRange(t)}return t.prototype.setRange=function(t){this.clear(),this.addRange(t)},t.prototype.addRange=function(e){var n;e instanceof t&&(e=e._collection),"getEnumerator"in(n=e)&&"toArray"in n&&(e=e.toArray());for(var r=0;r<e.length;r++)this.add(e[r])},t.prototype.add=function(){for(var t,e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{for(var i=u(n),o=i.next();!o.done;o=i.next()){var a=o.value;this.insertAt(this._collection.length,a)}}catch(s){t={error:s}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},t.prototype.push=function(t){return this.add(t),this.length},t.prototype.insertAt=function(t,e){var n,r,i;Array.isArray(e)||(e=[e]);try{for(var o=u(e),a=o.next();!a.done;a=o.next()){var s=a.value;this._checkIfItemExists(s)}}catch(p){n={error:p}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(t<0||t>this._collection.length)throw new l.f;(i=this._collection).splice.apply(i,h([t,0],e));for(var c=0;c<e.length;c++)s=e[c],this._onItemAdded(this._collection.indexOf(s),s)},t.prototype.remove=function(t){if(!this.contains(t))throw new l.a(o.c);return this.removeAt(this.indexOf(t))},t.prototype.removeAt=function(t){if(t<0||t>this._collection.length-1)throw new l.f;var e=this._collection[t];return this._collection.splice(t,1),this._onItemRemoved(t,e),e},t.prototype.removeRange=function(t,e){for(var n=this._collection.slice(),r=this._collection.splice(t,e-t+1),i=0;i<r.length;i++){var o=r[i];this._onItemRemoved(n.indexOf(o),o)}return r},t.prototype.move=function(t,e,n){"boolean"!=typeof n&&(n=!1);var r=this._collection[t];return r&&t>=0&&e>=0&&t!=e&&(this._collection.splice(t,1),this._collection.splice(e,0,r),n||this._onItemMoved(t,e)),r},t.prototype.clear=function(){for(;this.length>0;)this.removeAt(this.length-1)},t.prototype.replaceAt=function(t,e){if(e<0||e>this._collection.length-1)throw new l.f;this._onItemRemoved(e,this._collection[e]),this._collection[e]=t,this._onItemAdded(e,this._collection[e])},Object.defineProperty(t.prototype,"length",{get:function(){return this._collection.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){return this.getItem(t)},t.prototype.set=function(t,e){throw new l.e},t.prototype.getItem=function(t){return this._collection[t]},t.prototype._checkIfItemExists=function(t){if(this.contains(t))throw new l.a(o.b)},t.prototype._onItemAdded=function(t,e){this._itemAddedEvent.notify({item:e,index:t,type:r.Add})},t.prototype.add_itemAdded=function(t){this._itemAddedEvent.add(t)},t.prototype.remove_itemAdded=function(t){this._itemAddedEvent.remove(t)},t.prototype._onItemRemoved=function(t,e){this._itemRemovedEvent.notify({item:e,index:t,type:r.Remove})},t.prototype.add_itemRemoved=function(t){this._itemRemovedEvent.add(t)},t.prototype.remove_itemRemoved=function(t){this._itemRemovedEvent.remove(t)},t.prototype._onItemMoved=function(t,e){this._itemMovedEvent.notify({oldIndex:t,newIndex:e,type:r.Move})},t.prototype.add_itemMoved=function(t){this._itemMovedEvent.add(t)},t.prototype.remove_itemMoved=function(t){this._itemMovedEvent.remove(t)},t.prototype.add_collectionChanged=function(t){this.add_itemMoved(t),this.add_itemRemoved(t),this.add_itemAdded(t)},t.prototype.remove_collectionChanged=function(t){this.remove_itemMoved(t),this.remove_itemRemoved(t),this.remove_itemAdded(t)},t.prototype[Symbol.iterator]=function(){return this._collection.values()},t.prototype.toArray=function(){return this._collection.slice()},t.prototype.getEnumerator=function(){return this._enumerable.getEnumerator()},t.prototype.traverseBreadthFirst=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).traverseBreadthFirst.apply(t,h(e))},t.prototype.traverseDepthFirst=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).traverseDepthFirst.apply(t,h(e))},t.prototype.flatten=function(){return this._enumerable.flatten()},t.prototype.pairwise=function(t){return this._enumerable.pairwise(t)},t.prototype.scan=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).scan.apply(t,h(e))},t.prototype.select=function(t){return this._enumerable.select(t)},t.prototype.selectMany=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).selectMany.apply(t,h(e))},t.prototype.where=function(t){return this._enumerable.where(t)},t.prototype.choose=function(t){return this._enumerable.choose(t)},t.prototype.ofType=function(t){return this._enumerable.ofType(t)},t.prototype.zip=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).zip.apply(t,h(e))},t.prototype.merge=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).merge.apply(t,h(e))},t.prototype.join=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).join.apply(t,h(e))},t.prototype.groupJoin=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).groupJoin.apply(t,h(e))},t.prototype.all=function(t){return this._enumerable.all(t)},t.prototype.any=function(t){return this._enumerable.any(t)},t.prototype.isEmpty=function(){return this._enumerable.isEmpty()},t.prototype.concat=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).concat.apply(t,h(e))},t.prototype.alternate=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).alternate.apply(t,h(e))},t.prototype.defaultIfEmpty=function(t){return this._enumerable.defaultIfEmpty(t)},t.prototype.distinct=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).distinct.apply(t,h(e))},t.prototype.distinctUntilChanged=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).distinctUntilChanged.apply(t,h(e))},t.prototype.except=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).except.apply(t,h(e))},t.prototype.intersect=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).intersect.apply(t,h(e))},t.prototype.union=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).union.apply(t,h(e))},t.prototype.sequenceEqual=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).sequenceEqual.apply(t,h(e))},t.prototype.orderBy=function(t){return this._enumerable.orderBy(t)},t.prototype.orderByDescending=function(t){return this._enumerable.orderByDescending(t)},t.prototype.reverse=function(){return this._enumerable.reverse()},t.prototype.shuffle=function(){return this._enumerable.shuffle()},t.prototype.weightedSample=function(t){return this._enumerable.weightedSample(t)},t.prototype.groupBy=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).groupBy.apply(t,h(e))},t.prototype.partitionBy=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).partitionBy.apply(t,h(e))},t.prototype.buffer=function(t){return this._enumerable.buffer(t)},t.prototype.aggregate=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).aggregate.apply(t,h(e))},t.prototype.average=function(t){return this._enumerable.average(t)},t.prototype.count=function(t){return this._enumerable.count(t)},t.prototype.max=function(t){return this._enumerable.max(t)},t.prototype.min=function(t){return this._enumerable.min(t)},t.prototype.maxBy=function(t){return this._enumerable.maxBy(t)},t.prototype.minBy=function(t){return this._enumerable.minBy(t)},t.prototype.sum=function(t){return this._enumerable.sum(t)},t.prototype.elementAt=function(t){return this._enumerable.elementAt(t)},t.prototype.elementAtOrDefault=function(t,e){return this._enumerable.elementAtOrDefault(t,e)},t.prototype.first=function(t){return this._enumerable.first(t)},t.prototype.firstOrDefault=function(t,e){return"function"==typeof t?this._enumerable.firstOrDefault(t,e):this._enumerable.firstOrDefault(e)},t.prototype.last=function(t){return this._enumerable.last(t)},t.prototype.lastOrDefault=function(t,e){return"function"==typeof t?this._enumerable.lastOrDefault(t,e):this._enumerable.lastOrDefault(e)},t.prototype.single=function(t){return this._enumerable.single(t)},t.prototype.singleOrDefault=function(t,e){return this._enumerable.singleOrDefault(t,e)},t.prototype.skip=function(t){return this._enumerable.skip(t)},t.prototype.skipWhile=function(t){return this._enumerable.skipWhile(t)},t.prototype.take=function(t){return this._enumerable.take(t)},t.prototype.takeWhile=function(t){return this._enumerable.takeWhile(t)},t.prototype.takeExceptLast=function(t){return this._enumerable.takeExceptLast(t)},t.prototype.takeFromLast=function(t){return this._enumerable.takeFromLast(t)},t.prototype.indexOf=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).indexOf.apply(t,h(e))},t.prototype.lastIndexOf=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).lastIndexOf.apply(t,h(e))},t.prototype.asEnumerable=function(){return this._enumerable},t.prototype.cast=function(){return this._enumerable.cast()},t.prototype.toLookup=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).toLookup.apply(t,h(e))},t.prototype.toObject=function(t,e){return this._enumerable.toObject(t,e)},t.prototype.toDictionary=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).toDictionary.apply(t,h(e))},t.prototype.toJSONString=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).toJSONString.apply(t,h(e))},t.prototype.toJoinedString=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).toJoinedString.apply(t,h(e))},t.prototype.doAction=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).doAction.apply(t,h(e))},t.prototype.forEach=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).forEach.apply(t,h(e))},t.prototype.write=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).write.apply(t,h(e))},t.prototype.writeLine=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).writeLine.apply(t,h(e))},t.prototype.force=function(){return this._enumerable.force()},t.prototype.letBind=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).letBind.apply(t,h(e))},t.prototype.share=function(){return this._enumerable.share()},t.prototype.memoize=function(){return this._enumerable.memoize()},t.prototype.catchError=function(t){return this._enumerable.catchError(t)},t.prototype.finallyAction=function(t){return this._enumerable.finallyAction(t)},t.prototype.log=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).log.apply(t,h(e))},t.prototype.trace=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).trace.apply(t,h(e))},t.prototype.insert=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).insert.apply(t,h(e))},t.prototype.contains=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._enumerable).contains.apply(t,h(e))},t}()},function(t,e,n){"use strict";n.d(e,"h",(function(){return o})),n.d(e,"f",(function(){return a})),n.d(e,"l",(function(){return s})),n.d(e,"m",(function(){return l})),n.d(e,"i",(function(){return u})),n.d(e,"k",(function(){return c})),n.d(e,"j",(function(){return h})),n.d(e,"g",(function(){return p})),n.d(e,"c",(function(){return f})),n.d(e,"d",(function(){return d})),n.d(e,"a",(function(){return g})),n.d(e,"e",(function(){return m})),n.d(e,"b",(function(){return y}));var r=n(428),i=n(431),o=function(t,e,n){return t.x*e.y+t.y*n.x+e.x*n.y-(n.x*e.y+e.x*t.y+n.y*t.x)},a=function(t){if(0==t.length)return new r.a(0,0,0,0);for(var e=t[0],n=e.x,i=e.x,o=e.y,a=e.y,s=1,l=t.length;s<l;++s)e=t[s],n=Math.min(n,e.x),i=Math.max(i,e.x),o=Math.min(o,e.y),a=Math.max(a,e.y);return new r.a(n,o,i-n,a-o)},s=function(t,e,n){var r=Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2),i=Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2),a=Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2),s=0;a*i!=0&&(s=g(-1,(-r+a+i)/(2*Math.sqrt(a)*Math.sqrt(i)),1));var l=o(t,e,n),u=Math.acos(s);return l>0&&(u=-u),d(u)},l=function(t){return(t%=360)<0&&(t+=360),t},u=function(t,e){return t.x*e.x+t.y*e.y},c=function(t,e,n){var r=new i.a(n.x-e.x,n.y-e.y),o=new i.a(t.x-e.x,t.y-e.y),a=u(o,r);if(a<=0)return h(t,e);var s=u(r,r);if(s<a)return h(t,n);var l=a/s,c=new i.a(e.x+r.x*l,e.y+r.y*l);return h(t,c)},h=function(t,e){return(e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y)},p=function(t,e,n,r,i){function o(t,e,n,r){var i=Math.pow(e-r,2),o=Math.pow(t-n,2);return Math.sqrt(i*o/(o+i))}if(t.x==e.x)return n*r;if(t.y==e.y)return n*i;var a=o(t.x,t.y,e.x,e.y);return n*o(t.x*r,t.y*i,e.x*r,e.y*i)/a},f=function(t){return Math.PI*t/180},d=function(t){return 180*t/Math.PI},g=function(t,e,n){return Math.max(t,Math.min(n,e))},m=function(t,e,n){return"number"==typeof t&&"number"==typeof e&&("number"!=typeof n&&(n=1e-4),0!=n?Math.abs(t-e)<=n:t==e)},y=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++){for(var r=t[n],i=!1,o=0;o<e.length;o++)if(r.isEqual(e[o])){i=!0;break}if(!i)return!1}return!0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(407),i=n(743),o=n(489),a=n(408),s=n(409),l=n(416),u=function(){function t(t,e){void 0===e&&(e=""),this._name="",this._propertyChanged=new a.c,this.id=null!=t?t:(new o.a).toString(),this.name=e,null==this._tags&&(this._tags={})}return Object.defineProperty(t.prototype,"version",{get:function(){return i.a},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){this._name!==t&&(this._name=t,this._propertyChanged.notify(this,"name"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tags",{get:function(){return this._tags},set:function(t){if(null==t)throw new r.a("value is null!");this._tags=t},enumerable:!0,configurable:!0}),t.prototype._copy=function(t,e,n,r){if(void 0===n&&(n=!1),void 0===r&&(r=!1),e.name=t.name,n?e.generateNewIds():e.id=t.id,null!=t.tags)for(var i in e.tags={},t.tags)e.tags[i]=l.a(t.tags[i])},t.prototype.getSimplifiedObject=function(t){var e=s.q(this,t);return e.tags=this.tags,e.id=this.id.toString(),e},t.prototype.generateNewIds=function(){this._generateNewId()},t.prototype._generateNewId=function(){this.id=(new o.a).toString()},t.prototype.toString=function(){return this.name},t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t.prototype.equals=function(t){return this.name===t.name&&this.version===t.version},t}()},,function(t,e,n){"use strict";var r={IsIos:function(){return(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!window.MSStream},GetIosVersion:function(){if(null==navigator.appVersion||!r.IsIos())return[];var t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return null==t?[]:t.slice(1).map((function(t){return parseInt(t,10)})).map((function(t){return isNaN(t)?null:t}))},IosMajorVersion:function(){var t=navigator.userAgent,e=t.indexOf("OS ");if(e>-1)return Number(t.substr(e+3,3).replace("_",".").charAt(0))},IsAndroid:function(){return!!navigator.userAgent.toLowerCase().match(/(android)/)},IsTouchDevice:function(){return r.IsIos()||r.IsAndroid()||r.IsTouchIE()},IsNativeAndroidBrowser:function(){var t=navigator.userAgent;return t.indexOf("Mozilla/5.0")>-1&&t.indexOf("Android ")>-1&&t.indexOf("AppleWebKit")>-1&&!(t.indexOf("Chrome")>-1)},IsGoogleChrome:function(){return"object"==typeof window.chrome},IsSafari:function(){return-1!==navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")},IsSafariOrSafariWebView:function(){return r.IsSafari()||r.IsIos()},IsFirefox:function(){return-1!==navigator.userAgent.indexOf("Firefox")&&-1===navigator.userAgent.indexOf("Seamonkey")},IsTouchIE:function(){return-1!==navigator.userAgent.indexOf("Trident")&&-1!==navigator.userAgent.indexOf("Touch")},IsIE:function(){return-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0},IsEdge:function(){return-1!=navigator.userAgent.indexOf("Edge")},GetEdgeHtmlVersion:function(){return r.IsEdge()?navigator.userAgent.match(/Edge\/(\d+).(\d+)/).slice(1).map((function(t){return parseInt(t,10)})).map((function(t){return isNaN(t)?null:t})):[]},get devicePixelRatio(){return null!=window.devicePixelRatio?window.devicePixelRatio:1},get screenDpi(){return 96*r.devicePixelRatio},IsSmallScreen:function(){return window.innerWidth<=500}};e.a=r},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a}));var r=n(522);function i(t){return null==t||""===t.trim()}function o(t){const e={};if(i(t))return e;const n=t.split(";");for(let i of n){const t=i.split(":");if(2!==t.length)continue;const n=t[0].trim();let o=t[1].trim();n===r.a.openType&&e.hasOwnProperty(n)&&(o=`${e[n]};${o}`),e[n]=o}return e}function a(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(n===r.a.openType?t[n].split(",").forEach((t=>{if(i(t))return;const r=t.trim().split(" "),o=`${r[0].toLowerCase()},${2===r.length?r[1]:"1"}`;e+=`${n}: ${o}; `})):e+=`${n}: ${t[n]}; `);return e.trim()}},function(t,e,n){"use strict";var r,i,o,a,s;n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"f",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"j",(function(){return p.a})),n.d(e,"d",(function(){return l})),n.d(e,"h",(function(){return u})),n.d(e,"i",(function(){return c})),n.d(e,"a",(function(){return h})),function(t){t[t.undo=0]="undo",t[t.redo=1]="redo",t[t.setCursor=2]="setCursor",t[t.moveCursor=3]="moveCursor",t[t.moveCursorWithSelection=4]="moveCursorWithSelection",t[t.setSelection=5]="setSelection",t[t.selectCurrentWord=6]="selectCurrentWord",t[t.selectCurrentParagraph=7]="selectCurrentParagraph",t[t.selectAll=8]="selectAll",t[t.insertNewLine=9]="insertNewLine",t[t.insertLineBreak=10]="insertLineBreak",t[t.insertTab=11]="insertTab",t[t.insertChar=12]="insertChar",t[t.deleteToLeft=13]="deleteToLeft",t[t.deleteLeftWord=14]="deleteLeftWord",t[t.deleteToRight=15]="deleteToRight",t[t.deleteRightWord=16]="deleteRightWord",t[t.copyToClipboard=17]="copyToClipboard",t[t.pasteFromClipboard=18]="pasteFromClipboard",t[t.clearFormatting=19]="clearFormatting",t[t.setFontBold=20]="setFontBold",t[t.setFontItalic=21]="setFontItalic",t[t.setFontUnderline=22]="setFontUnderline",t[t.setCapitalLetters=23]="setCapitalLetters",t[t.setSubscriptLetters=24]="setSubscriptLetters",t[t.setSuperscriptLetters=25]="setSuperscriptLetters",t[t.increaseFontSize=26]="increaseFontSize",t[t.decreaseFontSize=27]="decreaseFontSize",t[t.setLeftAlignment=28]="setLeftAlignment",t[t.setRightAlignment=29]="setRightAlignment",t[t.setCenterAlignment=30]="setCenterAlignment",t[t.createBulletedListItem=31]="createBulletedListItem",t[t.createNumberedListItem=32]="createNumberedListItem",t[t.createBulletedListItemWithSpace=33]="createBulletedListItemWithSpace",t[t.createNumberedListItemWithSpace=34]="createNumberedListItemWithSpace",t[t.addListItemWithSpace=35]="addListItemWithSpace",t[t.addListItemWithNewLine=36]="addListItemWithNewLine",t[t.deleteListItem=37]="deleteListItem",t[t.increaseListItemIndent=38]="increaseListItemIndent",t[t.decreaseListItemIndent=39]="decreaseListItemIndent"}(r||(r={})),function(t){t.Left="ArrowLeft",t.Up="ArrowUp",t.Right="ArrowRight",t.Down="ArrowDown",t.Home="Home",t.End="End",t.Enter="Enter",t.Tab="Tab",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.Space="Space",t.KeyA="KeyA",t.KeyB="KeyB",t.KeyI="KeyI",t.KeyU="KeyU",t.KeyL="KeyL",t.KeyR="KeyR",t.KeyE="KeyE",t.KeyC="KeyC",t.KeyV="KeyV",t.KeyZ="KeyZ",t.KeyY="KeyY",t.KeyPeriod="Period",t.KeyComma="Comma",t.KeyEqual="Equal"}(i||(i={})),function(t){t[t.dblclick=0]="dblclick",t[t.mousedown=1]="mousedown",t[t.mousemove=2]="mousemove",t[t.mouseup=3]="mouseup"}(o||(o={})),function(t){t[t.left=0]="left",t[t.right=1]="right",t[t.up=2]="up",t[t.down=3]="down",t[t.lineStart=4]="lineStart",t[t.lineEnd=5]="lineEnd",t[t.textStart=6]="textStart",t[t.textEnd=7]="textEnd",t[t.leftWord=8]="leftWord",t[t.rightWord=9]="rightWord"}(a||(a={})),function(t){t[t.toTheLeft=0]="toTheLeft",t[t.toTheRight=1]="toTheRight"}(s||(s={}));var l,u,c,h,p=n(469);!function(t){t[t.none=0]="none",t[t.bullets=1]="bullets",t[t.numbers=2]="numbers"}(l||(l={})),function(t){t[t.none=0]="none",t[t.number=1]="number",t[t.lowerLetter=2]="lowerLetter",t[t.upperLetter=3]="upperLetter",t[t.lowerRoman=4]="lowerRoman",t[t.upperRoman=5]="upperRoman"}(u||(u={})),function(t){t[t.continueFromPrevious=0]="continueFromPrevious",t[t.startAt=1]="startAt"}(c||(c={})),function(t){t[t.undo=0]="undo",t[t.redo=1]="redo",t[t.setCursor=2]="setCursor",t[t.moveCursor=3]="moveCursor",t[t.setSelection=4]="setSelection",t[t.selectWord=5]="selectWord",t[t.selectParagraph=6]="selectParagraph",t[t.selectAllText=7]="selectAllText",t[t.insertNewLine=8]="insertNewLine",t[t.insertLineBrake=9]="insertLineBrake",t[t.insertTab=10]="insertTab",t[t.insertText=11]="insertText",t[t.deleteText=12]="deleteText",t[t.copyToClipboard=13]="copyToClipboard",t[t.clearFormatting=14]="clearFormatting",t[t.setFontBold=15]="setFontBold",t[t.setFontItalic=16]="setFontItalic",t[t.setFontUnderline=17]="setFontUnderline",t[t.setCapitalLetters=18]="setCapitalLetters",t[t.setSubscriptLetters=19]="setSubscriptLetters",t[t.setSuperscriptLetters=20]="setSuperscriptLetters",t[t.setCharStyle=21]="setCharStyle",t[t.setParagraphStyle=22]="setParagraphStyle",t[t.increaseFontSize=23]="increaseFontSize",t[t.decreaseFontSize=24]="decreaseFontSize",t[t.setAlignment=25]="setAlignment",t[t.addListItem=26]="addListItem",t[t.creteBulletedListItem=27]="creteBulletedListItem",t[t.creteNumberedListItem=28]="creteNumberedListItem",t[t.deleteListItem=29]="deleteListItem",t[t.applyListItem=30]="applyListItem",t[t.increaseListItemIndent=31]="increaseListItemIndent",t[t.decreaseListItemIndent=32]="decreaseListItemIndent"}(h||(h={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(431),i=n(422),o=n(471),a=n(407),s=n(416),l=n(408),u=function(){function t(t,e,n,r){this._propertyChanged=new l.c,this._left="number"==typeof t?t:0,this._top="number"==typeof e?e:0,this._width="number"==typeof n?n:2,this._height="number"==typeof r?r:2,this._id=Math.random().toString()}return t.prototype.toJSON=function(){return{left:this.left,top:this.top,width:this.width,height:this.height,id:this._id}},Object.defineProperty(t.prototype,"left",{get:function(){return this._left},set:function(e){Object(i.e)(e,this._left,t._tolerance)||(this._left=e,this._propertyChanged.notify(this,"left"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this._top},set:function(e){Object(i.e)(e,this._top,t._tolerance)||(this._top=e,this._propertyChanged.notify(this,"top"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){Object(i.e)(e,this._width,t._tolerance)||(this._width=e,this._propertyChanged.notify(this,"width"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){Object(i.e)(e,this._height,t._tolerance)||(this._height=e,this._propertyChanged.notify(this,"height"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.FromLTRB=function(e,n,r,i){var o=Math.abs(r-e),a=Math.abs(i-n);return new t(Math.min(e,r),Math.min(n,i),o,a)},t.fromLtrbObject=function(e){return t.FromLTRB(e.left,e.top,e.right,e.bottom)},t.FromObject=function(e){return new t(e.left,e.top,e.width,e.height)},t.intersect=function(e,n){var r=Math.max(e.left,n.left),i=Math.min(e.right,n.right),o=Math.max(e.top,n.top),a=Math.min(e.bottom,n.bottom);return i>=r&&a>=o?new t(r,o,i-r,a-o):t.empty},t.union=function(e,n){var r=Math.min(e.left,n.left),i=Math.max(e.left+e.width,n.left+n.width),o=Math.min(e.top,n.top);return new t(r,o,i-r,Math.max(e.top+e.height,n.top+n.height)-o)},Object.defineProperty(t,"empty",{get:function(){return new t(0,0,-1,-1)},enumerable:!0,configurable:!0}),t.prototype.equals=function(e){return t.isEqual(this,e)},t.isEqual=function(t,e,n){return void 0===n&&(n=1e-4),null==t&&null==e||null!=t&&null!=e&&Object(i.e)(t.left,e.left,n)&&Object(i.e)(t.top,e.top,n)&&Object(i.e)(t.width,e.width,n)&&Object(i.e)(t.height,e.height,n)},t.prototype.contains=function(t,e,n){if(null==e&&(e=!1),e){"number"!=typeof n&&(n=1e-4);var r=this.left,o=this.top,a=this.left+this.width,s=this.top+this.height;return(t.x>r||Object(i.e)(t.x,r,n))&&(t.y>o||Object(i.e)(t.y,o,n))&&(t.x<a||Object(i.e)(t.x,a,n))&&(t.y<s||Object(i.e)(t.y,s,n))}return t.x>this.left&&t.y>this.top&&t.x<this.left+this.width&&t.y<this.top+this.height},t.prototype.containsRectangle=function(t){var e=new r.a(t.left,t.top),n=new r.a(t.right,t.bottom);return this.contains(e,!0)&&this.contains(n,!0)},t.prototype.clone=function(){return new t(this.left,this.top,this.width,this.height)},t.prototype.isEmpty=function(){return this.width<=0||this.height<=0},t.prototype.inflate=function(t){this.left-=t,this.top-=t,this.width+=2*t,this.height+=2*t},t.prototype.intersectsWith=function(t){return t.left<this.right&&this.left<t.right&&t.top<this.bottom&&this.top<t.bottom},t.prototype.updateByMatrix=function(t){var e=Math.abs(t.angle%90);if(!Object(i.e)(e,0)&&!Object(i.e)(e,90))throw new a.a("RectangleF cannot be transformed by angle ("+t.angle+"!");var n=new r.a(this.left,this.top),o=new r.a(this.right,this.bottom),s=t.transformPoint(n),l=t.transformPoint(o),u=this.clone();return this._left=s.x,this._top=s.y,this._width=l.x-this._left,this._height=l.y-this._top,u.equals(this)||this._propertyChanged.notify(this),this},t.prototype.getExpanded=function(e){return t.FromLTRB(this.left-e.left,this.top-e.top,this.right+e.right,this.bottom+e.bottom)},t.prototype.toString=function(){return[this.left,this.top,this.width,this.height].join(",")},t.fromString=function(e){var n=e.replace(", ",",").split(",");return new t(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]))},t.fromPoints=function(e,n){return t.FromLTRB(Math.min(e.x,n.x),Math.min(e.y,n.y),Math.max(e.x,n.x),Math.max(e.y,n.y))},t.getMatrix=function(t,e){var n=new o.a,r=t.center,i=e.center;return n.scaleRelativeToPoint(e.width/t.width,e.height/t.height,r),n.translate((i.x-r.x)/n.scaleX,(i.y-r.y)/n.scaleY),n},t.getOverallBounds=function(e){return s.g(e)?t.empty:e.reduce((function(e,n){return null==e?n.clone():t.union(e,n)}))},Object.defineProperty(t.prototype,"right",{get:function(){return this.left+this.width},set:function(t){this.width=t-this.left},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.top+this.height},set:function(t){this.height=t-this.top},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return new r.a(this.left+this.width/2,this.top+this.height/2)},enumerable:!0,configurable:!0}),t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t._tolerance=1e-6,t}()},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i.a}));class r extends Error{constructor(t){super(t)}}var i=n(523)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(422),i=function(){function t(t,e){this.x=0,this.y=0,this.x=t||0,this.y=e||0}return t.prototype.rotate=function(e){return this.rotateAt(e,new t(0,0))},t.prototype.rotateAt=function(e,n){n||(n=new t(0,0));var i=Object(r.c)(e),o=Math.cos(i)*(this.x-n.x)-Math.sin(i)*(this.y-n.y)+n.x,a=Math.sin(i)*(this.x-n.x)+Math.cos(i)*(this.y-n.y)+n.y;return this.x=o,this.y=a,this},t.prototype.translate=function(t,e){return this.x=this.x+t,this.y=this.y+e,this},t.prototype.scale=function(t,e){return this.x=this.x*t,this.y=this.y*e,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.equals=function(t,e){return null!=t&&Object(r.e)(this.x,t.x,e)&&Object(r.e)(this.y,t.y,e)},t.isEqual=function(t,e,n){return void 0===n&&(n=1e-4),null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.distance=function(t){return Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))},t.prototype.transform=function(e,n){return null==n&&(n=new t),this.translate(-n.x,-n.y),this.scale(e.scaleX,e.scaleY),this.rotate(e.angle),this.translate(e.translateX,e.translateY),this.translate(n.x,n.y),this},t.prototype.toString=function(){return[this.x.toFixed(2),this.y.toFixed(2)].join(",")},t.prototype.toIPoint=function(){return{x:this.x,y:this.y}},t.fromIPoint=function(e){return new t(e.x,e.y)},t.prototype.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},t.prototype.isOrigin=function(){return 0===this.x&&0===this.y},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return g}));var r,i=n(410),o=n(464),a=n(517),s=n(465),l=n(417),u=n(747),c=n(409),h=n(440),p=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},d=function(t){function e(e,n,r,i){void 0===n&&(n=null);var o=t.call(this,e,n,r,i)||this;return o._defaultWidth=10,o._currentTextImage=null,o._onCanvasChangedDelegate=null,o._updatedFromServer=!1,o._isLegacyTextEditor=!1,o._isUpdatingAfterResize=!1,o._height=0,o._updateTextsFunc=function(){null!=o.canvas&&o.canvas.updateTexts()},o._imageContainer=new s.a(o._onImageLoaded.bind(o)),o._allowNegativeResize=!1,o}return p(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLegacyTextEditor",{get:function(){return this._isLegacyTextEditor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTextImage",{get:function(){return null!=this._currentTextImage?this._currentTextImage:this._currentTextImage=new g},set:function(t){var e,n,r,i=null===(e=this._currentTextImage)||void 0===e?void 0:e.cacheFileId,o=null==t?void 0:t.cacheFileId;i&&i!=o&&(null===(n=this.imageLoaderService)||void 0===n||n.releaseImageContainerFor(i,this.uniqueId)),this._currentTextImage=t,o&&i!=o&&(null===(r=this.imageLoaderService)||void 0===r||r.lockImageContainerFor(o,this.uniqueId)),this._height=this.rectangle.height},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textCropped",{get:function(){return this.item.checkTextCrop?null!=this.currentTextImage&&this.currentTextImage.textCropped:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isUpdatingAfterResize",{get:function(){return this._isUpdatingAfterResize},set:function(t){this._isUpdatingAfterResize=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorSettings",{get:function(){var t,e,n,r,i,o,a,s;return{rgbColorProfileName:null!==(e=null===(t=this.canvas)||void 0===t?void 0:t.renderingConfigProvider.getRgbColorProfileName())&&void 0!==e?e:"",cmykColorProfileName:null!==(r=null===(n=this.canvas)||void 0===n?void 0:n.renderingConfigProvider.getCmykColorProfileName())&&void 0!==r?r:"",grayscaleColorProfileName:null!==(o=null===(i=this.canvas)||void 0===i?void 0:i.renderingConfigProvider.getGrayscaleColorProfileName())&&void 0!==o?o:"",hiResDestinationColorProfileName:null!==(s=null===(a=this.canvas)||void 0===a?void 0:a.renderingConfigProvider.getHiResDestinationColorProfileName())&&void 0!==s?s:""}},enumerable:!0,configurable:!0}),e.prototype.isEmptyTextPlaceholder=function(){return this.item.isTextPlaceholder&&""===this.item.text},e.prototype._cropTextLimits=function(){var t,e,n=this._getText(),r=n,i=null!==(t=this.item.maxLineCount)&&void 0!==t?t:0,o=null!==(e=this.item.maxLineLength)&&void 0!==e?e:0;if(i>0||o>0){c.m(r)&&(r=c.k(n,"\n"));var a=r.split("\n");if(i>0&&a.length>i&&(a=a.splice(0,i)),o>0)for(var s=0;s<a.length;s++)a[s].length>o&&(a[s]=a[s].substr(0,o));var l=a.join("\n");n!=l&&(this.item.text=l)}},e.prototype.drawItemHandler=function(t){if(null!=t&&null!=this.canvas&&""!==this._getText())if(this._isReadyToDraw){this._hasVectorMask()&&(t.save(),this._clip(t));var e=this.item,n=this.rectangle,r=this.isEmptyTextPlaceholder()?.5:1,i=this._getItemColorPreviews(),o=i.fillColorPreview,a=i.borderColorPreview,s=i.altBorderColorPreview;if(l.a.fillRectangle(t,n,null==o?void 0:o.toString(),e.opacity*r),!0===this._updatedFromServer)try{var c=this.canvas.service.imageLoaderService.getImageContainerFor(this.currentTextImage.cacheFileId);if(null!=c){var p=this.canvas.service.imageLoaderService.getImageContainerRectangleFor(this.currentTextImage.cacheFileId);u.a.renderTextImage(this,c,p,t,r,0)}else u.a.renderTextImage(this,this._imageContainer,null,t,r,0)}catch(g){console.error(g),this.update()}var f=this._getActualBorderWidth();if(f>0){n.width+=f,n.height+=f;var d=h.e.rotatedRectangle(n);l.a.drawStroke(t,d,n.center,new h.g,f,null==a?void 0:a.toString(),null==s?void 0:s.toString(),e.opacity*r,e.dash)}this._hasVectorMask()&&t.restore()}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.onResized=function(){return null!=this.canvas&&(this.isUpdatingAfterResize=!0),t.prototype.onResized.call(this)},e.prototype.isEmpty=function(){return this.item.isEmpty()},e.prototype.isVisible=function(){var e=null==this.item.parentGroupItem||this.item.parentGroupItem.isChildVisible(this.item);return t.prototype.isVisible.call(this)&&e},e.prototype.quickUpdate=function(){this._updateImageUrl(),this.isVisible()&&!this._imageContainer.source&&this.canvas&&!this.canvas.service.imageLoaderService.hasImageContainerFor(this.currentTextImage.cacheFileId)&&this.update()},e.prototype.transformChanged=function(){var e=this;if(t.prototype.transformChanged.call(this),this.isUpdating&&this._callbacks){var n=this.item.transform.clone();this._callbacks.push((function(){e.item.setTransform(n,!0)}))}},e.prototype._endTransform=function(e,n){t.prototype._endTransform.call(this,e,n),e&&n&&this.update()},e.prototype._getColors=function(){var e;return function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}([this.item.color],null===(e=this.item.colorPalette)||void 0===e?void 0:e.toArray(),t.prototype._getColors.call(this))},e.prototype.dispose=function(){this._imageContainer.dispose(),null!=this._onCanvasChangedDelegate&&(null!=this.canvas&&this.canvas.remove_zoomChanged(this._onCanvasChangedDelegate),delete this._onCanvasChangedDelegate),this.currentTextImage=null,t.prototype.dispose.call(this)},e.prototype._isReady=function(){return t.prototype._isReady.call(this)&&this._imageContainer.isLoaded},e.prototype._updateImpl=function(t,e){return n=this,r=void 0,o=function(){var n,r=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){return this.isVisible()?(n=function(){r._afterUpdate(e)},this._update(null,t,n)):"function"==typeof t&&t(),[2]}))},new((i=void 0)||(i=Promise))((function(t,e){function a(t){try{l(o.next(t))}catch(n){e(n)}}function s(t){try{l(o.throw(t))}catch(n){e(n)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(a,s)}l((o=o.apply(n,r||[])).next())}));var n,r,i,o},e.prototype._validateBeforeCallService=function(){return""!==this._getText()},e.prototype._onValidateBeforeCallServiceFailed=function(){this._getSrc()?this._setDefaultTextControlPoints():this._updateEmptyTextControlPoints()},e.prototype._updateEmptyTextControlPoints=function(){var e,n=this,r=this._createDataInstance(this),i=JSON.parse(this._getDataItem());e=i.text,i.text="a";var o=[JSON.stringify(r),i,this.colorSettings];t.prototype._callService.call(this,"Update"+this.getTypeName(),o,(function(t){if(null!=n.item){var r=null;"object"==typeof t&&(r=t.item,t=t.itemHandlerData),null!=r&&(r.text=e,n._applyDataItem(r,t)),n.setData(t);var i=n.canvas;null!=i&&(i.updateSelection(),i.redraw()),n.onSuccessResponse(),n._setIsImageLoaded(!0)}}),(function(t){n.onErrorResponse(t)}),null)},e.prototype._setDefaultTextControlPoints=function(){var t=this.item.alignment;t===i.qb.Center?this._controlPoints[0].x+=(this._controlPoints[1].x-this._controlPoints[0].x)/2-this._defaultWidth/2:t===i.qb.Right&&(this._controlPoints[0].x=this._controlPoints[1].x-this._defaultWidth),this._controlPoints[1].x=this._controlPoints[0].x+this._defaultWidth,this.raiseChanged();var e=this.canvas;null!=e&&(e.updateSelection(),e.redraw()),this.onSuccessResponse()},e.prototype._isLoadingImage=function(){return this._imageContainer.isLoading},e.prototype._setIsLoadingImage=function(t){this._imageContainer.isLoading=t},e.prototype._setIsImageLoaded=function(t){this._imageContainer.isLoaded=t},e.prototype._getBoundsMargin=function(){return 2*this._getActualBorderWidth()},e.prototype._createDataInstance=function(t){return new a.a(t)},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"text":this._isLegacyTextEditor&&this._cropTextLimits(),this.update(null,this._updateTextsFunc);break;case"font":this.update(null,this._updateTextsFunc);break;case"underline":case"color":case"alignment":case"leading":case"tracking":case"verticalScale":case"horizontalScale":case"previewScale":case"stroke":case"shadow":case"baselineShift":case"overlapLinesEnabled":case"characterLimit":case"maxLineCount":case"maxLineLength":this.update();break;case"checkTextCrop":e.checkTextCrop&&this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.text=e.text,this.item.font=e.font,this.item.leading=e.leading,this.item.color=e.color,this.item.stroke=e.stroke,this.item.shadow=e.shadow,this.item.verticalScale=e.verticalScale,this.item.horizontalScale=e.horizontalScale,this.item.previewScale=e.previewScale,this.item.mask=e.mask,this.item.baselineShift=e.baselineShift,this._updateVectorMaskCenter()},e.prototype._getSrc=function(){var t=this._imageContainer.source;return c.l(t)?this._createImageUrl():t},e.prototype._onAddedOnCanvas=function(e,n){t.prototype._onAddedOnCanvas.call(this,e,n),null==e.textEditor&&(this._isLegacyTextEditor=!0,this._cropTextLimits()),null==this.canvas||this._onCanvasChangedDelegate||(this._onCanvasChangedDelegate=this._onCanvasChanged.bind(this),this.canvas.add_zoomChanged(this._onCanvasChangedDelegate))},e.prototype._onRemovedFromCanvas=function(e){t.prototype._onRemovedFromCanvas.call(this,e),e&&null!=this._onCanvasChangedDelegate&&(e.remove_zoomChanged(this._onCanvasChangedDelegate),delete this._onCanvasChangedDelegate)},e.prototype._getText=function(){var t=this.isEmptyTextPlaceholder()?this.item.originalText:this.item.text;return c.m(t)?this._xmlToHtml(t).textContent.trim():t.trim()},e.prototype._createImageUrl=function(){return null==this.canvas||this.canvas.service.imageLoaderService.hasImageContainerFor(this.currentTextImage.cacheFileId)?null:null!=this.currentTextImage.cacheFileId&&0!==this.currentTextImage.cacheFileId.length||null!=this.currentTextImage.base64Image&&0!==this.currentTextImage.base64Image.length?this.currentTextImage&&this.currentTextImage.base64Image?"data:image/png;base64,"+this.currentTextImage.base64Image:this._apiClient.serviceEndpoint+"/txt?f="+encodeURIComponent(this.currentTextImage.cacheFileId):null},e.prototype._updateImageUrl=function(){if(""!==this._getText()&&this.isVisible()){var t=this.canvas;if(null!=t&&t.isInitialized){var e=this._createImageUrl();null==this._imageContainer.source||e!==this._imageContainer.source?null===e?(this._imageContainer.clear(),t.redraw()):this._imageContainer.updateUrl(e):!0===this.isUpdatingAfterResize&&(this.isUpdatingAfterResize=!1,t.redraw())}}},e.prototype._afterUpdate=function(t){var e;"function"==typeof t&&t(),this._updatedFromServer||null===(e=this.canvas)||void 0===e||e.updateViolationContainerPosition(this),this._updatedFromServer=!0,null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.redrawDesign())},e.prototype._xmlToHtml=function(t){return(new DOMParser).parseFromString("<body>"+t+"</body>","text/html").getElementsByTagName("body")[0]},e.prototype._onImageLoaded=function(){this.isUpdatingAfterResize=!1,this._height=this.rectangle.height,null!=this.canvas&&this.canvas.redraw(),this._dispatchReadyEvent()},e.prototype._onCanvasChanged=function(t){t.fullUpdate&&this.update()},Object.defineProperty(e.prototype,"imageLoaderService",{get:function(){var t,e;return null===(e=null===(t=this.canvas)||void 0===t?void 0:t.service)||void 0===e?void 0:e.imageLoaderService},enumerable:!0,configurable:!0}),e.typeName="BaseTextItemHandler",e}(o.a),g=function(){this.cacheFileId=null,this.base64Image=null,this.textCropped=null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return p})),n.d(e,"f",(function(){return f})),n.d(e,"g",(function(){return d.a})),n.d(e,"h",(function(){return g.a})),n.d(e,"i",(function(){return m.a})),n.d(e,"j",(function(){return y.a})),n.d(e,"e",(function(){return v}));var r=n(411),i=n(420);class o{constructor(t,e,n){this._textWhizz=t,this._colorPalette=e,n&&(this.font=n.font,this.color=n.color,this.underline=n.underline,this.leading=n.leading,this.tracking=n.tracking,this.stroke=n.stroke,this.openType=n.openType,this.subscript=n.subscript,this.subscriptSize=n.subscriptSize,this.superscript=n.superscript,this.superscriptSize=n.superscriptSize,this.baselineShift=n.baselineShift,this.verticalScale=n.verticalScale,this.horizontalScale=n.horizontalScale)}setEntry(t){t&&(this.font={postScriptName:t.fontName,size:t.fontSize,fauxBold:t.fauxBold,fauxItalic:t.fauxItalic,allCaps:t.allCaps,smallCaps:t.smallCaps},this.color=this._colorPalette.getPaletteColorAt(t.fillColor.index),this.underline=t.underline,this.leading=t.leading,this.tracking=t.tracking,this.superscript=t.superscript,this.superscriptSize=t.superscriptSize,this.subscript=t.subscript,this.subscriptSize=t.subscriptSize,this.baselineShift=t.baselineShift,this.verticalScale=t.vertScale,this.horizontalScale=t.horzScale,this.openType=Object.keys(this._textWhizz.OpenTypeFeature).filter((e=>1===t.openType.get(this._textWhizz.OpenTypeFeature[e]))).map((t=>new i.OpenTypeFeature(t,1))),this.stroke={color:this._colorPalette.getPaletteColorAt(t.strokeColor.index),size:t.strokeWidth,enabled:this._isStrokeEnabled(t)})}patchToEntry(t){const e=this;if(this._isSet(e.font)){const n=e.font;this._isSet(n.postScriptName)&&(t.fontName=n.postScriptName),this._isSet(n.size)&&(t.fontSize=n.size),this._isSet(n.fauxBold)&&(t.fauxBold=n.fauxBold),this._isSet(n.fauxItalic)&&(t.fauxItalic=n.fauxItalic),this._isSet(n.allCaps)&&(t.allCaps=n.allCaps),this._isSet(n.smallCaps)&&(t.smallCaps=n.smallCaps)}return this._isSet(e.color)&&(t.fillColor=this._colorPalette.addColorToPalette(e.color)),this._isSet(e.underline)&&(t.underline=e.underline),this._isSet(e.leading)&&(t.leading=e.leading),this._isSet(e.tracking)&&(t.tracking=e.tracking),Array.isArray(e.openType)&&e.openType.length&&e.openType.forEach((e=>t.openType.set(this._textWhizz.OpenTypeFeature[e.tag],e.value))),this._isSet(e.subscript)&&(t.subscript=e.subscript),this._isSet(e.subscriptSize)&&(t.subscriptSize=e.subscriptSize),this._isSet(e.superscript)&&(t.superscript=e.superscript),this._isSet(e.superscriptSize)&&(t.superscriptSize=e.superscriptSize),this._isSet(e.baselineShift)&&(t.baselineShift=e.baselineShift),this._isSet(e.verticalScale)&&(t.vertScale=e.verticalScale),this._isSet(e.horizontalScale)&&(t.horzScale=e.horizontalScale),this._isSet(e.stroke)&&(e.stroke.enabled?(this._isSet(e.stroke.color)&&(t.strokeColor=this._colorPalette.addColorToPalette(e.stroke.color)),this._isSet(e.stroke.size)&&(t.strokeWidth=e.stroke.size)):(t.strokeColor=this._colorPalette.addColorToPalette({color:r.RgbColors.transparent,preview:r.RgbColors.transparent}),t.strokeWidth=0)),t}_isSet(t){return!(null==t)}_isStrokeEnabled(t){const e=t.strokeColor;return t.strokeWidth>0||e.getType()===this._textWhizz.ColorType.rgb&&e.A>0||e.getType()===this._textWhizz.ColorType.indexed&&!this._colorPalette.getPaletteColorAt(e.index).color.isTransparent}}class a{constructor(t,e){this._tw=t,this._colorPalette=e,this._initializeTextWhizz(this._colorPalette.select((t=>t.preview)))}getPaletteColors(){return[...this._colorPalette]}getPaletteColorAt(t){return this._colorPalette.get(t)}addColorToPalette(t){const e=this.addColorToPaletteReturnIndex(t);return this._getColorFromTextWhizz(e)}addColorToPaletteReturnIndex(t){let e=this._colorPalette.indexOf((e=>e.color.equals(t.color)));return-1!==e?e:(this._colorPalette.add(t),this._addColorToTextWhizz(t.preview))}_initializeTextWhizz(t){for(let e of t)this._addColorToTextWhizz(e)}_getColorFromTextWhizz(t){const e=this._tw.engine.ColorType.indexed,n=[t];return new this._tw.engine.Color(e,n)}_addColorToTextWhizz(t){const e=this._tw.engine.ColorType.rgb,n=[t.b,t.g,t.r,t.alpha],r=new this._tw.engine.Color(e,n),i=this._tw.engineHandler.getColorPalette();return i.add(r),i.getSize()-1}}var s=n(410),l=n(427);class u{constructor(t){this._textWhizz=t}convertAlignmentFromTextWhizz(t){return t===this._textWhizz.TextAlignment.center?s.qb.Center:t===this._textWhizz.TextAlignment.right?s.qb.Right:t===this._textWhizz.TextAlignment.justification?s.qb.Justify:t===this._textWhizz.TextAlignment.justificationLastLeft?s.qb.LastLeft:t===this._textWhizz.TextAlignment.justificationLastCenter?s.qb.LastCenter:t===this._textWhizz.TextAlignment.justificationLastRight?s.qb.LastRight:s.qb.Left}convertListStyleTypeFromTextWhizz(t){return t===this._textWhizz.ListStyleType.none?l.d.none:t===this._textWhizz.ListStyleType.bullets?l.d.bullets:t===this._textWhizz.ListStyleType.numbers?l.d.numbers:void 0}convertListStyleTypeToTextWhizz(t){switch(t){case l.d.none:return this._textWhizz.ListStyleType.none;case l.d.bullets:return this._textWhizz.ListStyleType.bullets;case l.d.numbers:return this._textWhizz.ListStyleType.numbers}}convertListNumberFormatTypeFromTextWhizz(t){return t===this._textWhizz.NumberFormatType.none?l.h.none:t===this._textWhizz.NumberFormatType.number?l.h.number:t===this._textWhizz.NumberFormatType.lowerLetter?l.h.lowerLetter:t===this._textWhizz.NumberFormatType.upperLetter?l.h.upperLetter:t===this._textWhizz.NumberFormatType.lowerRoman?l.h.lowerRoman:t===this._textWhizz.NumberFormatType.upperRoman?l.h.upperRoman:void 0}convertListNumberFormatTypeToTextWhizz(t){switch(t){case l.h.none:return this._textWhizz.NumberFormatType.none;case l.h.number:return this._textWhizz.NumberFormatType.number;case l.h.lowerLetter:return this._textWhizz.NumberFormatType.lowerLetter;case l.h.upperLetter:return this._textWhizz.NumberFormatType.upperLetter;case l.h.lowerRoman:return this._textWhizz.NumberFormatType.lowerRoman;case l.h.upperRoman:return this._textWhizz.NumberFormatType.upperRoman}}convertListNumberModeFromTextWhizz(t){return t===this._textWhizz.NumberMode.continueFromPrevious?l.i.continueFromPrevious:t===this._textWhizz.NumberMode.startAt?l.i.startAt:void 0}convertListNumberModeToTextWhizz(t){switch(t){case l.i.continueFromPrevious:return this._textWhizz.NumberMode.continueFromPrevious;case l.i.startAt:return this._textWhizz.NumberMode.startAt}}convertAlignmentToTextWhizz(t){switch(t){case s.qb.Center:return this._textWhizz.TextAlignment.center;case s.qb.Right:return this._textWhizz.TextAlignment.right;case s.qb.Justify:return this._textWhizz.TextAlignment.justification;case s.qb.LastLeft:return this._textWhizz.TextAlignment.justificationLastLeft;case s.qb.LastCenter:return this._textWhizz.TextAlignment.justificationLastCenter;case s.qb.LastRight:return this._textWhizz.TextAlignment.justificationLastRight;case s.qb.Left:default:return this._textWhizz.TextAlignment.left}}convertMoveDirectionToTextWhizz(t){switch(t){case l.f.up:return this._textWhizz.MoveDirection.up;case l.f.down:return this._textWhizz.MoveDirection.down;case l.f.lineStart:return this._textWhizz.MoveDirection.lineStart;case l.f.lineEnd:return this._textWhizz.MoveDirection.lineEnd;case l.f.textStart:return this._textWhizz.MoveDirection.textStart;case l.f.textEnd:return this._textWhizz.MoveDirection.textEnd;case l.f.leftWord:return this._textWhizz.MoveDirection.leftWord;case l.f.rightWord:return this._textWhizz.MoveDirection.rightWord;case l.f.left:return this._textWhizz.MoveDirection.left;case l.f.right:return this._textWhizz.MoveDirection.right;default:return null}}convertFirstBaselineOffsetToTextWhizz(t){switch(t){case s.C.Ascent:return this._textWhizz.FirstBaselineOffset.ascent;case s.C.CapHeight:return this._textWhizz.FirstBaselineOffset.capHeight;case s.C.Leading:return this._textWhizz.FirstBaselineOffset.leading;case s.C.XHeight:return this._textWhizz.FirstBaselineOffset.xHeight;case s.C.Fixed:return this._textWhizz.FirstBaselineOffset.fixed;case s.C.EmboxHeight:return this._textWhizz.FirstBaselineOffset.emBox}}convertAutoSizeModeToTextWhizz(t){switch(t){case s.h.Off:return this._textWhizz.AutoSizeMode.off;case s.h.WidthOnly:return this._textWhizz.AutoSizeMode.widthOnly;case s.h.HeightOnly:return this._textWhizz.AutoSizeMode.heightOnly;case s.h.WidthHeight:return this._textWhizz.AutoSizeMode.widthHeight}}convertVerticalAlignmentToTextWhizz(t){switch(t){case s.sb.Top:return this._textWhizz.VerticalAlignment.top;case s.sb.Center:return this._textWhizz.VerticalAlignment.center;case s.sb.Bottom:return this._textWhizz.VerticalAlignment.bottom;default:return this._textWhizz.VerticalAlignment.top}}mapAlignmentAndVerticalAlignmentToTextWhizzAutoSizeAnchor(t,e){switch(e){case s.sb.Top:return t==s.qb.Right?this._textWhizz.AutoSizeAnchor.topRight:t==s.qb.Center?this._textWhizz.AutoSizeAnchor.topCenter:(s.qb.Left,this._textWhizz.AutoSizeAnchor.topLeft);case s.sb.Center:return t==s.qb.Right?this._textWhizz.AutoSizeAnchor.centerRight:t==s.qb.Center?this._textWhizz.AutoSizeAnchor.center:(s.qb.Left,this._textWhizz.AutoSizeAnchor.centerLeft);case s.sb.Bottom:return t==s.qb.Right?this._textWhizz.AutoSizeAnchor.bottomRight:t==s.qb.Center?this._textWhizz.AutoSizeAnchor.bottomCenter:(s.qb.Left,this._textWhizz.AutoSizeAnchor.bottomLeft);default:return this._textWhizz.AutoSizeAnchor.topLeft}}}var c=n(406),h=n(444);class p{constructor(t,e,n,r,i){switch(this._tw=t,this._textMeasurerHolder=e,this._converter=new u(t.engine),n){case l.j.pointTextFrame:this._textFrame=this._getPointTextFrame(r);break;case l.j.pathTextFrame:this._textFrame=this._getPathTextFrame(r);break;case l.j.shapeTextFrame:this._textFrame=this._getShapeTextFrame(r,i);break;case l.j.archedTextFrame:this._textFrame=this._getArchedTextFrame(r)}}get(){return this._textFrame}_getArchedTextFrame(t){const e=new this._tw.engine.ArchedTextFrame,n=this._tw.initData.previewScale;return Object(c.EqualsOfFloatNumbers)(n,1)||t.point.scale(1/n,1/n),e.center=t.point,e.bend=t.bend,e}_getPointTextFrame(t){const e=new this._tw.engine.PointTextFrame,n=this._tw.initData.previewScale;return Object(c.EqualsOfFloatNumbers)(n,1)||t.scale(1/n,1/n),e.point=t,e.textOrientation=this._tw.initData.isTextVertical?this._tw.engine.TextOrientation.vertical:this._tw.engine.TextOrientation.horizontal,e}_getPathTextFrame(t){const e=new this._tw.engine.PathTextFrame,n=this._tw.initData.previewScale,r=Object(h.d)(this._tw.engine,t);return Object(c.EqualsOfFloatNumbers)(n,1)||r.scale(1/n,1/n),e.baseline=r,e.start=this._tw.initData.start,e.end=this._tw.initData.end,this._tw.initData.isFitToPath&&(e.copyFittingMode=this._tw.engine.CopyFittingMode.fitToWidth),e}_getShapeTextFrame(t,e){var n;const r=this._tw.initData.firstBaselineOffset,i=this._tw.initData.firstBaselineMinOffset,o=this._tw.initData.isTextBounded,a=this._tw.initData.overflowStrategy,l=this._tw.initData.verticalAlignment,u=null===(n=this._tw.initData.defaultParagraphStyle)||void 0===n?void 0:n.alignment,p=this._tw.initData.previewScale,f=new this._tw.engine.ShapeTextFrame;return f.shape=Object(h.d)(this._tw.engine,t),null!=r&&(f.firstBaselineOffset=this._converter.convertFirstBaselineOffsetToTextWhizz(r)),null!=i&&(f.firstBaselineMinOffset=i),o&&(a===s.X.ExpandBox?!e&&this._isAllTextVisible()||!e?f.verticalAlignment=this._converter.convertVerticalAlignmentToTextWhizz(l):(f.autoSizeAnchor=this._converter.mapAlignmentAndVerticalAlignmentToTextWhizzAutoSizeAnchor(u,l),f.autoSizeMode=this._tw.engine.AutoSizeMode.heightOnly):f.verticalAlignment=this._converter.convertVerticalAlignmentToTextWhizz(l),a===s.X.FitToBox&&(f.copyFittingMode=this._tw.engine.CopyFittingMode.fitToBox),a===s.X.FitToWidth&&(f.copyFittingMode=this._tw.engine.CopyFittingMode.fitToWidth)),Object(c.EqualsOfFloatNumbers)(p,1)||f.shape.scale(1/p,1/p),f.textOrientation=this._tw.initData.isTextVertical?this._tw.engine.TextOrientation.vertical:this._tw.engine.TextOrientation.horizontal,f}_isAllTextVisible(){const t=this._tw.initData.rectangle;return this._textMeasurerHolder.textMeasurer.measureTextFrame(!1).height<t.height}}n(528);class f{constructor(t,e){this._textWhizz=t,this._converter=new u(t),e&&(this.alignment=e.alignment,this.firstLineIndent=e.firstLineIndent,this.leftIndent=e.leftIndent,this.rightIndent=e.rightIndent,this.spaceAfter=e.spaceAfter,this.spaceBefore=e.spaceBefore,this.listType=e.listType,this.level=e.level,this.tabOffset=e.tabOffset,this.numberingFormat=e.numberingFormat,this.numberingMode=e.numberingMode,this.startNumber=e.startNumber,this.bulletCharCode=e.bulletCharCode)}setEntry(t){t&&(this.alignment=this._converter.convertAlignmentFromTextWhizz(t.alignment),this.firstLineIndent=t.firstLineIndent,this.spaceBefore=t.spaceBefore,this.spaceAfter=t.spaceAfter,this.leftIndent=t.leftIndent,this.rightIndent=t.rightIndent,this.listType=this._converter.convertListStyleTypeFromTextWhizz(t.type),this.level=t.level,this.numberingFormat=this._converter.convertListNumberFormatTypeFromTextWhizz(t.formatType),this.numberingMode=this._converter.convertListNumberModeFromTextWhizz(t.mode),this.startNumber=t.startAt,this.bulletCharCode=t.bulletChar,this.tabOffset=t.tabPosition)}patchToEntry(t){const e=this;return this._isSet(e.alignment)&&(t.alignment=this._converter.convertAlignmentToTextWhizz(e.alignment)),this._isSet(e.firstLineIndent)&&(t.firstLineIndent=e.firstLineIndent),this._isSet(e.leftIndent)&&(t.leftIndent=e.leftIndent),this._isSet(e.rightIndent)&&(t.rightIndent=e.rightIndent),this._isSet(e.spaceAfter)&&(t.spaceAfter=e.spaceAfter),this._isSet(e.spaceBefore)&&(t.spaceBefore=e.spaceBefore),this._isSet(e.listType)&&(t.type=this._converter.convertListStyleTypeToTextWhizz(e.listType)),this._isSet(e.level)&&(t.level=e.level),this._isSet(e.numberingFormat)&&(t.formatType=this._converter.convertListNumberFormatTypeToTextWhizz(e.numberingFormat)),this._isSet(e.numberingMode)&&(t.mode=this._converter.convertListNumberModeToTextWhizz(e.numberingMode)),this._isSet(e.startNumber)&&(t.startAt=e.startNumber),this._isSet(e.bulletCharCode)&&(t.bulletChar=e.bulletCharCode),this._isSet(e.tabOffset)&&(t.tabPosition=e.tabOffset),t}_isSet(t){return!(null==t)}}var d=n(529),g=n(613),m=n(482),y=n(590);class _{constructor(t,e){this._name=t,this.value=e}get name(){return this._name}getEntry(){return{key:this.name,value:this.value}}}class v{constructor(t,e){this._tw=t,this._properties=[],e&&e.forEach((t=>this.setProperty(t.name,t.value)))}isPropertyExists(t){return null!=this.getProperty(t)}getProperty(t){const e=this._properties.filter((e=>e.name===t));return(null==e?void 0:e.length)>0?e[0]:null}getPropertiesCount(){return this._properties.length}getProperties(){return this._properties}setProperty(t,e){const n=this.getProperty(t);if(n)return void(n.value=e);const r=new _(t,e);this._properties.push(r)}deleteProperty(t){const e=this.getProperty(t);if(e){const t=this._properties.indexOf(e,0);return t>-1&&this._properties.splice(t,1),!0}return!1}getEntry(){const t=new this._tw.StringMap;return this._properties.forEach((e=>t.set(e.name,e.value))),t}setEntry(t){const e=t.keys(),n=e.size();if(0!==n)for(let r=0;r<n;r++){const n=e.get(r),i=t.get(n);this.setProperty(n,i)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(407),i=n(409);function o(){return function(t,e){var n="_"+e;Object.defineProperty(t,e,{get:function(){return this[n]},set:function(t){var o,a=typeof t;if(null!=t&&"boolean"!==a&&"number"!==a&&"string"!==a&&("object"!==a||"function"!=typeof t.equals))throw new r.a("PropertyChanged decorator works only for simple types or objects with equals method");Object(i.g)(this[n],t)||(this[n]=t,(null!==(o=this._propertyChanged)&&void 0!==o?o:this.propertyChanged).notify(this,e))},configurable:!0,enumerable:!0})}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return P}));var r,i=n(499),o=n(411),a=n(500),s=n(501),l=n(554),u=n(407),c=n(409),h=n(416),p=n(406),f=n(472),d=n(408),g=n(421),m=n(415),y=n(437),_=n(423),v=n(744),b=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),w=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},C=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},P=function(t){function e(n,r,i){var a=t.call(this)||this;a._text="",a._originalText="",a._underline=!1,a._color=o.RgbColors.black,a._alignment=f.g.Left,a._tracking=0,a._leading=0,a._checkTextCrop=!0,a._overlapLinesEnabled=!1,a._verticalScale=1,a._horizontalScale=1,a._stroke=null,a._shadow=null,a._previewScale=1,a._placeholders=new g.a,a._displayText=null,a._colorPalette=new g.a,a._baselineShift=0,a._overprintText=!1,a.values=[],a._characterLimit=null,a._maxLineLength=null,a._maxLineCount=null,a.isTextPlaceholder=!1,a.textColorForAbnormalRendering=o.RgbColors.black,a.type=e.type,a._onFontPropertyChanged=function(t,e){a._propertyChanged.notify(a,"font")},a._onShadowPropertyChanged=function(t,e){a._propertyChanged.notify(a,"shadow")},a._onStrokePropertyChanged=function(t,e){a._propertyChanged.notify(a,"stroke")},a.borderWidth=0,a.fillColor=o.RgbColors.transparent,a.text=null!=n?n:"",a._font=new e.FontSettings(r,null!=i?i:10),a._subscribeFontPropertyChanged(),a.textPermissions=new l.a,a._setViolationSettings(new v.a,!0);var s=function(){a._displayText=null,a._propertyChanged.notify(a,"text")};return a._placeholders.add_itemAdded((function(t){return t.item.addPropertyChanged(s)})),a._placeholders.add_itemRemoved((function(t){return t.item.removePropertyChanged(s)})),a._ignorePermissionsChange=!0,a.itemPermissions.allowRemoveOnLayoutChange=!0,a.itemPermissions.itemToolbarPermissions.showEditButton=!0,a._ignorePermissionsChange=!1,a}return b(e,t),Object.defineProperty(e.prototype,"characterLimit",{get:function(){return this._characterLimit},set:function(t){p.EqualsOfFloatNumbers(this._characterLimit,t)||(this._characterLimit=t,null!=t&&this._propertyChanged.notify(this,"characterLimit"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLineCount",{get:function(){return this._maxLineCount},set:function(t){this._maxLineCount!==t&&(this._maxLineCount=t,this._displayText=null,this._propertyChanged.notify(this,"maxLineCount"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLineLength",{get:function(){return this._maxLineLength},set:function(t){this._maxLineLength!==t&&(this._maxLineLength=t,this._displayText=null,this._propertyChanged.notify(this,"maxLineLength"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previewScale",{get:function(){return this._previewScale},set:function(t){p.EqualsOfFloatNumbers(this._previewScale,t)||(this._previewScale=t,this._propertyChanged.notify(this,"previewScale"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stroke",{get:function(){return this._stroke},set:function(t){a.b.equals(this._stroke,t)||(this._unsubscribeStrokePropertyChanged(),this._stroke=t,this._subscribeStrokePropertyChanged(),this._propertyChanged.notify(this,"stroke"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shadow",{get:function(){return this._shadow},set:function(t){null==this._shadow&&null==t||null!=t&&t.equals(this._shadow)||(this._unsubscribeShadowPropertyChanged(),this._shadow=t,this._subscribeShadowPropertyChanged(),this._propertyChanged.notify(this,"shadow"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalScale",{get:function(){return this._horizontalScale},set:function(t){p.EqualsOfFloatNumbers(this._horizontalScale,t)||(this._horizontalScale=t,this._propertyChanged.notify(this,"horizontalScale"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalScale",{get:function(){return this._verticalScale},set:function(t){p.EqualsOfFloatNumbers(this._verticalScale,t)||(this._verticalScale=t,this._propertyChanged.notify(this,"verticalScale"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkTextCrop",{get:function(){return this._checkTextCrop},set:function(t){this._checkTextCrop!==t&&(this._checkTextCrop=t,this._propertyChanged.notify(this,"checkTextCrop"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overlapLinesEnabled",{get:function(){return this._overlapLinesEnabled},set:function(t){this._overlapLinesEnabled!==t&&(this._overlapLinesEnabled=t,this._propertyChanged.notify(this,"overlapLinesEnabled"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignment",{get:function(){return this._alignment},set:function(t){this._alignment!==t&&(this._alignment=t,this._propertyChanged.notify(this,"alignment"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tracking",{get:function(){return this._tracking},set:function(t){p.EqualsOfFloatNumbers(this._tracking,t)||(this._tracking=t,this._propertyChanged.notify(this,"tracking"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leading",{get:function(){return this._leading},set:function(t){p.EqualsOfFloatNumbers(this._leading,t)||(this._leading=t,this._propertyChanged.notify(this,"leading"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalText",{get:function(){return null!=this._originalText?this._originalText:""},set:function(t){this._originalText=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"underline",{get:function(){return this._underline},set:function(t){this._underline!==t&&(this._underline=t,this._propertyChanged.notify(this,"underline"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this._font},set:function(t){e.FontSettings.equals(this._font,t)||(this._unsubscribeFontPropertyChanged(),this._font=t,this._subscribeFontPropertyChanged(),this._propertyChanged.notify(this,"font"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return null==this._displayText&&(this._displayText=this.getUpdatedText(this._text)),this._text=this._displayText,this._text},set:function(t){this._text!==t&&(this._text=t,this._displayText=null,this._propertyChanged.notify(this,"text"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){o.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"baselineShift",{get:function(){return this._baselineShift},set:function(t){p.EqualsOfFloatNumbers(this._baselineShift,t)||(this._baselineShift=t,this._propertyChanged.notify(this,"baselineShift"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overprintText",{get:function(){return this._overprintText},set:function(t){t!=this._overprintText&&(this._overprintText=t,this._propertyChanged.notify(this,"overprintText"))},enumerable:!0,configurable:!0}),e.prototype.getUpdatedText=function(t){var e=t;return this.placeholders.length>0&&(e=this._replaceInStringPlaceholders()),e},Object.defineProperty(e.prototype,"placeholders",{get:function(){return this._placeholders},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorPalette",{get:function(){return this._colorPalette},enumerable:!0,configurable:!0}),e.prototype._canSetIsVariable=function(){return!0},Object.defineProperty(e.prototype,"previewFontSize",{get:function(){return this.font.size*this.previewScale},set:function(t){this.font.size=t/this.previewScale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previewLeading",{get:function(){return this.leading*this.previewScale},set:function(t){this.leading=t/this.previewScale},enumerable:!0,configurable:!0}),e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),this.itemPermissions.itemToolbarPermissions.showSelectButton=!1,null==this.textPermissions||this.textPermissions.allowChangeText?this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=null:this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=!1,this.isRenderTypeIsNormal||(this.textPermissions.allowChangeFontColor=!1,this.textPermissions.allowChangeShadow=!1,this.textPermissions.allowChangeStroke=!1)},Object.defineProperty(e.prototype,"textPermissions",{get:function(){return this._textPermissions},set:function(t){if(null==t)throw new u.a("textPermissions cannot be null");Object(c.g)(this._textPermissions,t)||(null!=this._textPermissions&&this._textPermissions.propertyChanged.remove(this._onPermissionsChanged),this._textPermissions=t,this.applyPermissionsConstrain(),this._textPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"textPermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"violationSettings",{get:function(){return this._violationSettings},set:function(t){this._setViolationSettings(t)},enumerable:!0,configurable:!0}),e.prototype._setViolationSettings=function(e,n){if(void 0===n&&(n=!1),!(n||e instanceof v.a))throw new u.a("Shape ViolationSettings property must has TextViolationSettings type!");t.prototype._setViolationSettings.call(this,e,n)},e.prototype._subscribeFontPropertyChanged=function(){null!=this._font&&this._font.addPropertyChanged(this._onFontPropertyChanged)},e.prototype._unsubscribeFontPropertyChanged=function(){null!=this._font&&this._font.removePropertyChanged(this._onFontPropertyChanged)},e.prototype._subscribeShadowPropertyChanged=function(){null!=this._shadow&&this._shadow.addPropertyChanged(this._onShadowPropertyChanged)},e.prototype._unsubscribeShadowPropertyChanged=function(){null!=this._shadow&&this._shadow.removePropertyChanged(this._onShadowPropertyChanged)},e.prototype._subscribeStrokePropertyChanged=function(){null!=this._stroke&&this._stroke.addPropertyChanged(this._onStrokePropertyChanged)},e.prototype._unsubscribeStrokePropertyChanged=function(){null!=this._stroke&&this._stroke.removePropertyChanged(this._onStrokePropertyChanged)},e.prototype.getSimplifiedObject=function(e){var n=t.prototype.getSimplifiedObject.call(this,["_placeholders","currentTextImage","textPermissions","textForTextWhizz","shadow","stroke"].concat(e));return n.placeholders=this.placeholders.toArray(),n.textPermissions=this.textPermissions.getSimplifiedObject(),n.font=this.font.getSimplifiedObject(),n.shadow=null!=this.shadow?this.shadow.getSimplifiedObject():null,n.stroke=null!=this.stroke?this.stroke.getSimplifiedObject():null,n},e.prototype._replaceInStringPlaceholders=function(){return c.m(this.originalText)?this._replaceInStringPlaceholdersValueInRichText():this._replaceInStringPlaceholdersValueInPlainText()},e.prototype._replaceInStringPlaceholdersValueInPlainText=function(){var t=this.originalText;return this.placeholders.forEach((function(e){t=t.replace(e.id,""===e.value?e.name:e.value)})),t},e.prototype._replaceInStringPlaceholdersValueInRichText=function(){if(null==this._originalTextDom){var t=new DOMParser;this._originalTextDom=t.parseFromString("<xml>"+this.originalText+"</xml>","text/xml")}var e=this._originalTextDom.cloneNode(!0),n=e.getElementsByTagName("span");this.placeholders.forEach((function(t){if(null!=n&&n.length)for(var e=0;e<n.length;e++){var r=n[e];null!=r.textContent&&(r.textContent=r.textContent.replace(t.id,""===t.value?t.name:t.value))}}));var r=(new XMLSerializer).serializeToString(e);return r.substr(0,r.length-6).substr(5)},e.prototype._copy=function(e,n,r,i){var o,a;if(t.prototype._copy.call(this,e,n,r,i),n.textPermissions=e._textPermissions.clone(),n.placeholders.setRange(e.placeholders.toArray().map((function(t){return t.clone()}))),n.color=e._color.clone(),n.text=e._text,n.font=e._font.clone(),n.underline=e._underline,n.originalText=e._originalText,n.leading=e._leading,n.tracking=e._tracking,n.alignment=e._alignment,n.checkTextCrop=e._checkTextCrop,n.verticalScale=e._verticalScale,n.horizontalScale=e._horizontalScale,n.shadow=null!=e._shadow?e._shadow.clone():null,n.stroke=null!=e._stroke?e._stroke.clone():null,n.previewScale=e._previewScale,n._maxLineCount=e._maxLineCount,n.isTextPlaceholder=e.isTextPlaceholder,n.maxLineLength=e.maxLineLength,n.overlapLinesEnabled=e.overlapLinesEnabled,n.colorPalette.setRange(e.colorPalette.toArray().map((function(t){return t.clone()}))),n.baselineShift=e.baselineShift,n.overprintText=e.overprintText,n.listStyles=e.listStyles,n.characterLimit=e.characterLimit,null!=e.values){n.values=[];try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e.values),l=s.next();!l.done;l=s.next()){var u=l.value;n.values.push(u.clone())}}catch(c){o={error:c}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}}},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(c.g)(this._textPermissions,e._textPermissions),i=Object(c.c)(this._placeholders.toArray(),e._placeholders.toArray()),o=Object(c.g)(this._color,e._color),a=Object(c.g)(this._text,e._text),s=Object(c.g)(this._font,e._font),l=Object(c.g)(this._underline,e._underline),u=Object(c.g)(this._originalText,e._originalText),h=Object(c.g)(this._leading,e._leading),p=Object(c.g)(this._tracking,e._tracking),f=Object(c.g)(this._alignment,e._alignment),d=Object(c.g)(this._checkTextCrop,e._checkTextCrop),g=Object(c.g)(this._verticalScale,e._verticalScale),m=Object(c.g)(this._previewScale,e._previewScale),y=Object(c.g)(this._maxLineCount,e._maxLineCount),_=Object(c.g)(this.isTextPlaceholder,e.isTextPlaceholder),v=Object(c.g)(this._maxLineLength,e._maxLineLength),b=Object(c.g)(this._overlapLinesEnabled,e._overlapLinesEnabled),w=Object(c.g)(this._stroke,e._stroke),C=Object(c.c)(this.values,e.values),P=Object(c.c)(this._colorPalette.toArray(),e._colorPalette.toArray()),S=Object(c.g)(this._baselineShift,e._baselineShift),x=Object(c.g)(this._overprintText,e._overprintText),I=Object(c.g)(this.listStyles,e.listStyles),O=Object(c.g)(this.characterLimit,e.characterLimit);return n&&r&&i&&o&&a&&s&&l&&u&&h&&p&&f&&d&&g&&m&&y&&_&&v&&b&&w&&C&&P&&S&&x&&I&&O},e.prototype.isEmptyText=function(){return""===this.text},e.prototype.isEmptyXmlText=function(){return"<p></p>"===this.text||"<p><span></span></p>"===this.text},e.prototype.isEmpty=function(){return!this.isTextPlaceholder&&(this.isEmptyText()||this.isEmptyXmlText())},e.type="baseText",w([Object(m.a)({factory:new y.d(50),displayName:"Character Limit"}),C("design:type",Number),C("design:paramtypes",[Number])],e.prototype,"characterLimit",null),w([Object(m.a)({factory:new y.d(1),displayName:"Max line count"}),C("design:type",Number),C("design:paramtypes",[Number])],e.prototype,"maxLineCount",null),w([Object(m.a)({factory:new y.d(50),displayName:"Max line length"}),C("design:type",Number),C("design:paramtypes",[Number])],e.prototype,"maxLineLength",null),w([Object(m.a)({factory:new y.c(a.b),displayName:"Stroke"}),C("design:type",a.b),C("design:paramtypes",[a.b])],e.prototype,"stroke",null),w([Object(m.a)({factory:new y.c(s.a),displayName:"Shadow"}),C("design:type",s.a),C("design:paramtypes",[s.a])],e.prototype,"shadow",null),w([Object(m.a)({enumObject:f.g}),C("design:type",Number),C("design:paramtypes",[Number])],e.prototype,"alignment",null),w([Object(m.a)({type:"string"}),C("design:type",String)],e.prototype,"listStyles",void 0),e}(i.a);!function(t){var e=function(t){function e(e,n){void 0===n&&(n=10);var r=t.call(this)||this;return r._fauxBold=!1,r._fauxItalic=!1,r._allCaps=!1,r._openTypeFeatures=[],r.$_propertyChanged=new d.c,r._postScriptName=e,r._size=n,r}return b(e,t),e.prototype.clone=function(){var t=new e(this._postScriptName,this._size);return t._openTypeFeatures=h.a(this._openTypeFeatures),t.allCaps=this._allCaps,t.fauxItalic=this._fauxItalic,t.fauxBold=this._fauxBold,t},Object.defineProperty(e.prototype,"fauxBold",{get:function(){return this._fauxBold},set:function(t){this._fauxBold!==t&&(this._fauxBold=t,this.$_propertyChanged.notify(this,"fauxBold"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fauxItalic",{get:function(){return this._fauxItalic},set:function(t){this._fauxItalic!==t&&(this._fauxItalic=t,this.$_propertyChanged.notify(this,"fauxItalic"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allCaps",{get:function(){return this._allCaps},set:function(t){this._allCaps!==t&&(this._allCaps=t,this.$_propertyChanged.notify(this,"allCaps"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"openTypeFeatures",{get:function(){return this._openTypeFeatures},set:function(t){this._openTypeFeatures!==t&&(this._openTypeFeatures=t,this.$_propertyChanged.notify(this,"openTypeFeatures"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"postScriptName",{get:function(){return this._postScriptName},set:function(t){this._postScriptName!==t&&(this._postScriptName=t,this.$_propertyChanged.notify(this,"postScriptName"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(t){p.EqualsOfFloatNumbers(this._size,t)||(this._size=t,this.$_propertyChanged.notify(this,"size"))},enumerable:!0,configurable:!0}),e.prototype.addPropertyChanged=function(t){this.$_propertyChanged.add(t)},e.prototype.removePropertyChanged=function(t){this.$_propertyChanged.remove(t)},e.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},e.prototype.equals=function(t){return this.postScriptName===t.postScriptName&&this.size===t.size&&this.fauxBold===t.fauxBold&&this.fauxItalic===t.fauxItalic&&this.allCaps===t.allCaps&&h.h(this.openTypeFeatures,t.openTypeFeatures)},e.prototype.getSimplifiedObject=function(){return{allCaps:this.allCaps,fauxBold:this.fauxBold,fauxItalic:this.fauxItalic,openTypeFeatures:this.openTypeFeatures,postScriptName:this.postScriptName,size:this.size}},e}(_.a);t.FontSettings=e;var n=function(){function t(t,e){this.name=t,this.text=e}return t.prototype.equals=function(t){return null!=t&&Object(c.g)(this.name,t.name)&&Object(c.g)(this.text,t.text)},t.prototype.clone=function(){return new t(this.name,this.text)},t}();t.BaseTextValue=n}(P||(P={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"j",(function(){return u})),n.d(e,"d",(function(){return c})),n.d(e,"b",(function(){return h})),n.d(e,"c",(function(){return f})),n.d(e,"g",(function(){return d})),n.d(e,"i",(function(){return g})),n.d(e,"e",(function(){return m})),n.d(e,"h",(function(){return y})),n.d(e,"f",(function(){return _})),n(428);var r,i=n(406),o=n(440),a=n(470),s=function(){return s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)},l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function u(t,e,n){return Object(i.EqualsOfFloatNumbers)(t.left,e.left,n)&&Object(i.EqualsOfFloatNumbers)(t.top,e.top,n)&&Object(i.EqualsOfFloatNumbers)(t.width,e.width,n)&&Object(i.EqualsOfFloatNumbers)(t.height,e.height,n)}function c(t,e,n){if(void 0===n&&(n=a.c.Fit),t.width===e.width&&t.height===e.height)return t;if(n===a.c.Original)return s({},t);if(n===a.c.Arbitrary)return s({},e);var r=n===a.c.Fit?Math.min(e.width/t.width,e.height/t.height):Math.max(e.width/t.width,e.height/t.height);return{width:t.width*r,height:t.height*r}}function h(t,e,n,r){t.angle=e.angle;var i=p(e,n,r),o=p(t,n,r),a=t.clone();return a.centerX+=i.x-o.x,a.centerY+=i.y-o.y,a}function p(t,e,n){var r=0,o=0;switch(e){case a.b.Left:r=-t.width/2;break;case a.b.Right:r=t.width/2}switch(n){case a.b.Top:o=-t.height/2;break;case a.b.Bottom:o=t.height/2}var s=new i.PointF(r,o);return(s=s.rotate(t.angle)).translate(t.centerX,t.centerY)}function f(t,e,n){return null!=n&&(t=Math.min(t,n)),null!=e&&(t=Math.max(e,t)),t}function d(t,e){return new i.Transform(1,1,e.x-t.x,e.y-t.y,0)}function g(){for(var t,e,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=Number.POSITIVE_INFINITY;try{for(var a=l(r),s=a.next();!s.done;s=a.next()){var u=s.value,c=Math.abs(u);c<o&&(o=c,n=u)}}catch(h){t={error:h}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return n}function m(t,e,n){return Math.abs(t*e/n)}function y(t,e,n,r,i){if(e>=n)throw new o.a("oldMin must be less than oldMax");if(r>=i)throw new o.a("newMin must be less than newMax");return r+(t-e)*(i-r)/(n-e)}function _(t,e){if(null==t||null==e)return null;var n=t.center,r=t.angle;t.angle=0;var o=t.bounds,a=i.RotatedRectangleF.FromLTRB(o.left-e.left,o.top-e.top,o.right+e.right,o.bottom+e.bottom);return a.width*=Math.sign(t.width),a.height*=Math.sign(t.height),a.rotateAt(r,n),t.angle=r,a}!function(t){t.from=function(t){return{width:t.width,height:t.height}}}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return p})),n.d(e,"d",(function(){return f}));var r,i=n(407),o=function(){function t(t,e){this._abstractObjectClass=t,this._derivedClassesData=e}return Object.defineProperty(t.prototype,"factoryClass",{get:function(){return this._abstractObjectClass},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"derivedTypes",{get:function(){return this._derivedClassesData.map((function(t){return t.type}))},enumerable:!0,configurable:!0}),t.prototype.getDefaultValue=function(t){var e=this._derivedClassesData.find((function(e){return e.type===t}));if(null==e)throw new i.c("Type "+t+" is not defined! Try on of these values: "+this.derivedTypes.join(", ")+".");return e.getDefaultValue()},t}(),a=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},s=function(){function t(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this._collectionConstructor=t,this._args=e}return Object.defineProperty(t.prototype,"type",{get:function(){return"collection"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"factoryClass",{get:function(){return this._collectionConstructor},enumerable:!0,configurable:!0}),t.prototype.getDefaultValue=function(){var t;return new((t=this._collectionConstructor).bind.apply(t,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t}([void 0],this._args)))},t}(),l=n(411),u=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(){return t.call(this,l.Color,[{type:"cmyk",getDefaultValue:function(){return new l.CmykColor(0,0,0,100,255)}},{type:"rgb",getDefaultValue:function(){return l.RgbColors.black}},{type:"spot",getDefaultValue:function(){return new l.SpotColor(new l.Ink("inkName",new l.CmykColor(0,0,0,100,255),1),255,255)}},{type:"grayscale",getDefaultValue:function(){return new l.GrayscaleColor(0,255)}},{type:"lab",getDefaultValue:function(){return new l.LabColor(0,0,0,255)}}])||this}return u(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"color"},enumerable:!0,configurable:!0}),e}(o),h=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},p=function(){function t(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this._objectConstructor=t,this._args=e}return Object.defineProperty(t.prototype,"type",{get:function(){return"object"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"factoryClass",{get:function(){return this._objectConstructor},enumerable:!0,configurable:!0}),t.prototype.getDefaultValue=function(){var t;return new((t=this._objectConstructor).bind.apply(t,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h(arguments[e]));return t}([void 0],this._args)))},t}(),f=function(){function t(t){this._defaultValue=t}return Object.defineProperty(t.prototype,"factoryClass",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return typeof this._defaultValue},enumerable:!0,configurable:!0}),t.prototype.getDefaultValue=function(){return this._defaultValue},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(407),i=n(408),o=n(416),a=n(415),s=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},l=function(){function t(e,n,r){void 0===r&&(r=!0),this._edgeConstraint=null,this._cornerArbitraryConstraint=null,this.propertyChanged=new i.a,this.type=t.type,this.edge=n,this._setCornerValues(e,n,r)}return Object.defineProperty(t.prototype,"edgeConstraint",{set:function(t){var e=this.edge;this._edgeConstraint=t,this.edge!==e&&this.propertyChanged.notify()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return null!=this._edgeConstraint?this._edgeConstraint:this._edge},set:function(t){this._edge!==t&&(this._edge=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"corner",{get:function(){return this._corner},set:function(t){if(null==t)throw new r.b("corner cannot be null");this._corner!==t&&(this._corner=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype._setCornerValues=function(e,n,r){this.corner=e&&n?r?[t.arbitrary,t.proportional]:[t.proportional,t.arbitrary]:e?[t.proportional]:n?[t.arbitrary]:[]},t.prototype.getCornerProportional=function(){return this.corner.includes(t.proportional)},t.prototype.getCornerArbitrary=function(){return null!=this._cornerArbitraryConstraint?this._cornerArbitraryConstraint:this.corner.includes(t.arbitrary)},t.prototype.setCornerProportional=function(t){var e=this.getCornerArbitrary();this._setCornerValues(t,e,!0)},t.prototype.setCornerArbitrary=function(t){var e=this.getCornerProportional();this._setCornerValues(e,t,!0)},t.prototype.setCornerArbitraryConstraint=function(t){var e=this.getCornerArbitrary();this._cornerArbitraryConstraint=t,this.getCornerArbitrary()!==e&&this.propertyChanged.notify()},t.prototype.clone=function(){var e=new t(!0,!0);return e.edge=this.edge,e.corner=this.corner.slice(),e},t.prototype.equals=function(t){return this.edge===t.edge&&o.h(this.corner,t.corner)},Object.defineProperty(t.prototype,"data",{get:function(){return{Edge:this.edge,Corner:this.corner}},enumerable:!0,configurable:!0}),t._fromData=function(e){if(null==e)return new t(!1,!1);var n=new t(!0,!0);return n.corner=e.Corner,n.edge=e.Edge,n},t.prototype.getSimplifiedObject=function(){var t={};return t.edge=this.edge,t.corner=this.corner,t},t.arbitrary="Arbitrary",t.proportional="Proportional",t.type="ResizeGripsPermissions",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(a.a)({ignore:!0}),s("design:type",Boolean),s("design:paramtypes",[Boolean])],t.prototype,"edgeConstraint",null),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r,i=n(442),o=n(406),a=n(478),s=n(746),l=n(417),u=n(411),c=n(408),h=n(581),p=n(410),f=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},g=function(t){function e(n,r,i,o){void 0===r&&(r=null);var a=t.call(this,e._getItemPath(n),n,r,i,o)||this;return a._previousRectangle=null,a._isEditingChangedEvent=new c.a,a._selectButtonClickEvent=new c.c,a._content=null,a._topFrames=[],a._bottomFrames=[],a._editing=!1,a._showMaskedContent=!0,a._isContentUpdating=!1,a._placeholderButtonGroup=null,a._editButtonGroup=null,a._doneButtonGroup=null,a._selectButton=null,a._doneButton=null,a._handleButton=null,a._qualityChangeContainer=null,a._qualityChangeScaleBar=null,a._qualityChangeInfoBar=null,a._forceQualityChangeInfoBar=!1,a._emptyPlaceholderBorderColor=new u.RgbColor(204,204,204,255),a._emptyPlaceholderBorderWidth=1,a._imageIsLoading=!1,a.onHandleButtonClick=function(){var t;a.editing=!0,null===(t=a.canvas)||void 0===t||t.updatePlaceholderButtonGroup(a)},a.onDoneButtonClick=function(){var t;a.editing=!1,null===(t=a.canvas)||void 0===t||t.setSelectedItemHandlers([a])},a._onContentReady=function(){a._dispatchReadyEvent()},a._selectButtonClickHandler=a._onSelectButtonClick.bind(a),a}return f(e,t),e.prototype.isHighlightNeeded=function(){return this.editing},Object.defineProperty(e.prototype,"imageIsLoading",{get:function(){return this._imageIsLoading},set:function(t){this._imageIsLoading=t,this._onImageIsLoadingChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousRectangle",{get:function(){return this._previousRectangle},set:function(t){this._previousRectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this._content},set:function(t){var e=this.canvas;null==e||this.isStubOrEmpty()||e.removeViolationContainer(this._content);var n=this._content;if(null==n||n.removeReady(this._onContentReady),this._content=t,null!=this._content&&(this._content.layer=this.layer,this._content.parentPlaceholder=this,this._content.contentType=a.a.PlaceholderContent,this._content.addReady(this._onContentReady)),null!=e){if(this._reloadPlaceholderButtons(),null==this._content)return;this._content.canvas=e,n&&n!=this._content&&this.canvas.deleteItemHandler(n)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topFrames",{get:function(){return this._topFrames},set:function(t){var e=this;this._topFrames=t,this._updateTopFrames((function(t){t.contentType=a.a.TopFrame,t.layer=e.layer,t.parentPlaceholder=e,t.canvas=e.canvas}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomFrames",{get:function(){return this._bottomFrames},set:function(t){var e=this;this._bottomFrames=t,this._updateBottomFrames((function(t){t.contentType=a.a.BottomFrame,t.layer=e.layer,t.parentPlaceholder=e,t.canvas=e.canvas}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"editing",{get:function(){return!this.isStubOrEmpty()&&this._editing},set:function(t){this._editing!==t&&(t&&!this.getPermissions().allowEditContent&&this.isStubOrEmpty()||(this._editing=t,this.raiseChanged(),this._isEditingChangedEvent.notify(this),null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.updatePlaceholderButtonGroup(this),this.canvas.redraw())))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showMaskedContent",{get:function(){return this._showMaskedContent},set:function(t){this._showMaskedContent=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isQualityChangeBarEmpty",{get:function(){var t=this.canvas;return null==this._qualityChangeScaleBar||null==t||this._qualityChangeScaleBar.className===this.canvas.qualityChangeScaleBarCssClass},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeScaleBar",{get:function(){return this._qualityChangeScaleBar},set:function(t){this._qualityChangeScaleBar=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeInfoBar",{get:function(){return this._qualityChangeInfoBar},set:function(t){this._qualityChangeInfoBar=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeContainer",{get:function(){return this._qualityChangeContainer},set:function(t){this._qualityChangeContainer=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"forceQualityChangeInfoBar",{get:function(){return this._forceQualityChangeInfoBar},set:function(t){this._forceQualityChangeInfoBar=t;var e=this.canvas;null!=e&&e.updateViolationContainer(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholderButtonGroup",{get:function(){return this._placeholderButtonGroup},set:function(t){this._placeholderButtonGroup=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"doneButtonGroup",{get:function(){return this._doneButtonGroup},set:function(t){this._doneButtonGroup=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectButton",{get:function(){return this._selectButton},set:function(t){this._selectButton=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"doneButton",{get:function(){return this._doneButton},set:function(t){this._doneButton=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"handleButton",{get:function(){return this._handleButton},set:function(t){this._handleButton=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectButtonClickHandler",{get:function(){return this._selectButtonClickHandler},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"editButtonGroup",{get:function(){return this._editButtonGroup},set:function(t){this._editButtonGroup=t},enumerable:!0,configurable:!0}),e.prototype.addIsEditingChanged=function(t){this._isEditingChangedEvent.add(t)},e.prototype.removeIsEditingChanged=function(t){this._isEditingChangedEvent.remove(t)},e.prototype.quickUpdate=function(){this.isVisible()&&this.update(),null!=this.canvas&&this.canvas.updatePlaceholderButtonGroup(this)},e.prototype.getContentScale=function(){if(this.isStubOrEmpty())return null;var t=this.getTransformedRectangle(!1),e=this.content.getTransformedRectangle(!1),n=90===Object(o.normalizeAngle)(t.angle-e.angle)||270===Object(o.normalizeAngle)(t.angle-e.angle),r=n?e.height/t.width:e.width/t.width,i=n?e.width/t.height:e.height/t.height;return this.item.contentResizeMode===p.ib.Fit?100*Math.max(r,i):100*Math.min(r,i)},e.prototype.setContentScale=function(t){if(!this.isStubOrEmpty()){var e=this.content.getTransformedRectangle(!1),n=t/this.getContentScale();this.content.setTransformedRectangle(new o.RotatedRectangleF(e.centerX,e.centerY,e.width*n,e.height*n,e.angle)),this.raiseChanging(this.item),this.canvas.redraw()}},e.prototype.resetContent=function(){if(!this.isStubOrEmpty()){var t=this.getTransformedRectangle(!1),e=this.content.getTransformedRectangle(!1),n=100/this.getContentScale(),r=90===Object(o.normalizeAngle)(t.angle-e.angle)||270===Object(o.normalizeAngle)(t.angle-e.angle),i=this.content.item,a=r?e.height/e.width:e.width/e.height,s=i.ratioWidthToHeight||i.sourceRectangle.width/i.sourceRectangle.height,l=a<s?n*(s/a):n,u=a>s?n*(a/s):n,c=r?e.height*l:e.width*l,h=r?e.width*u:e.height*u,f=this.item.contentResizeMode===p.ib.Fit?Math.min(t.width/c,t.height/h):Math.max(t.width/c,t.height/h);this.content.setTransformedRectangle(new o.RotatedRectangleF(t.centerX,t.centerY,c*f,h*f,t.angle)),this.content.item.getItemChangedEvent().notify(),this.canvas.redraw()}},e.prototype.getSelectToolbarButtonClickEvent=function(){return this._selectButtonClickEvent},e.prototype.getTopFrame=function(t){return null!=this._topFrames?this._topFrames[t]:null},e.prototype.setTopFrame=function(t,e){e._contentType=a.a.TopFrame,e._layer=this.layer,e._parentPlaceholder=this,e.canvas=this.canvas,this._topFrames[t]=e},e.prototype.getBottomFrame=function(t){return null!=this._bottomFrames?this._bottomFrames[t]:null},e.prototype.setBottomFrame=function(t,e){e._contentType=a.a.BottomFrame,e._layer=this.layer,e._parentPlaceholder=this,e.canvas=this.canvas,this._bottomFrames[t]=e},e.prototype.isEmptyContent=function(){return null==this._content},e.prototype.isStubOrEmpty=function(){return this.item.isStubContent||this.isEmptyContent()},e.prototype.isCoverMode=function(){return this.item.isCoverMode},e.prototype.showEditButton=function(){var e=t.prototype.showEditToolbarButton,n=!!this.isStubOrEmpty()||!this.item.imageContent.source.isVector;return e&&n},e.prototype.showHandleToolbarButton=function(){var t=this.getPermissions();return t.allowEditContent&&t.showHandleToolbarButton&&!this.isStubOrEmpty()},e.prototype.getPermissions=function(e){if(!this.editing||null!=e&&e)return t.prototype.getPermissions.call(this);if(!this.isEmptyContent()){var n=this._content.getPermissions().clone();return n.allowDelete=!1,n}return new s.a({},!1)},e.prototype.setBadToWarningChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityBadToWarningChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityWarningToGoodChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityBadToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.setWarningToGoodChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityWarningToGoodChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityBadToWarningChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityBadToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.setBadToGoodChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityBadToGoodChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityBadToWarningChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityWarningToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.rotateContentLeft=function(){this._rotateContent(-90)},e.prototype.rotateContentRight=function(){this._rotateContent(90)},e.prototype.setRectangle=function(e,n,r){this._previousRectangle=n?this.rectangle.clone():null,!this.editing||r?t.prototype.setRectangle.call(this,e,n):this._content.setRectangle(e,n)},e.prototype.drawItemHandler=function(e){if(null!=e){var n=function(t){t.drawItemHandler(e)},r=this.editing&&this.showMaskedContent;r||this._updateBottomFrames(n);var i=l.a,a=this.originalPath,s=this.getControlCenter(),c=this.item.transform;if(this.isEmptyContent())this.imageIsLoading?this.canvas.drawWaitClock(e,this.bounds.center):t.prototype.drawItemHandler.call(this,e),Object(o.EqualsOfFloatNumbers)(0,this.item.borderWidth)&&i.drawPath(e,a,s,c,this._emptyPlaceholderBorderWidth,this._emptyPlaceholderBorderColor.toString(),1);else if(this._areColorPreviewsReady){r&&this._content.drawMaskedContent(e);var h=this.isNormalRenderingType?this.item.opacity:1;e.save();var p=this._getTransformedPath();if(i.clipPath(e,p),null!=this.item.mask&&null!=this.item.mask.vectorMask){var f=this._getTransformedClippingPath();i.clipPath(e,f)}if(null!=a){var d=this._getItemColorPreviews().fillColorPreview;i.fillPath(e,a,s,c,null==d?void 0:d.toString(),h)}this.imageIsLoading?this.canvas.drawWaitClock(e,this.bounds.center):this._content.drawItemHandler(e),this.canvas.isDragSource(this)&&(e.globalCompositeOperation="destination-out",i.fillRectangle(e,this.rectangle,u.RgbColors.black,.3),e.globalCompositeOperation="source-over"),e.restore();var g=this._getItemColorPreviews(),m=g.borderColorPreview,y=g.altBorderColorPreview;i.drawStroke(e,a,s,c,this._getActualBorderWidth(),null==m?void 0:m.toString(),null==y?void 0:y.toString(),h,this.item.dash)}else this.canvas.drawWaitClock(e,this.rectangle.center);if(r){if(e.globalCompositeOperation="destination-over",null!=this._bottomFrames)for(var _=this._bottomFrames.length-1;_>=0;_--)n(this._bottomFrames[_]);e.globalCompositeOperation="source-over"}this.canvas.isDragTarget(this)&&this.isNormalRenderingType&&i.fillRectangle(e,this.rectangle,u.RgbColors.black,.5),this._updateTopFrames(n)}},e.prototype.getSelectionRectangle=function(){return this.editing?this._content.getSelectionRectangle():t.prototype.getSelectionRectangle.call(this)},e.prototype.getBorderMargin=function(){return this.editing?this._content.getBorderMargin():t.prototype.getBorderMargin.call(this)},e.prototype.addSelectButtonClick=function(t){this._selectButtonClickEvent.add(t)},e.prototype.removeSelectButtonClick=function(t){this._selectButtonClickEvent.remove(t)},e.prototype.getChangeContentButtonClickEvent=function(){return this._selectButtonClickEvent},e.prototype.startTransform=function(e){t.prototype.startTransform.call(this,e),this.editing&&(this._startRectangle=this._content.rectangle),this.updateContentAndFrames((function(t){t._startRectangle=t.rectangle}))},e.prototype.endTransform=function(t,e){this._endTransform(t,e)},e.prototype.transformChanged=function(){t.prototype.transformChanged.call(this);var e=this.canvas;null!=e&&e.updatePlaceholderButtonGroupPosition(this)},e.prototype.onResized=function(){return this.updateContentAndFrames((function(t){t.onResized()})),t.prototype.onResized.call(this)},e.prototype.showSelectButton=function(){return this.isStubOrEmpty()&&this.getPermissions().showSelectButton},e.prototype.showSelectToolbarButton=function(){return this.getPermissions().showSelectToolbarButton&&!this.isStubOrEmpty()},e.prototype.showHandleButton=function(){var t=this.item.contentResizeMode===p.ib.Fit;return!this.isStubOrEmpty()&&this.getPermissions().allowEditContent&&this.getPermissions().showHandleButton&&!this._editing&&!t},e.prototype.setContentUpdating=function(t){this._isContentUpdating=t},e.prototype.isContentUpdating=function(){return this._isContentUpdating},e.prototype.updateContentAndFrames=function(t){this._updateContent(t),this._updateFrames(t)},e.prototype.getBoundsIncludingFrames=function(){var t=this.bounds;return this._updateFrames((function(e){t=o.RectangleF.union(t,e.bounds)})),t},e.prototype.getRectangleIncludingFrames=function(){var t=this.rectangle;return this._updateFrames((function(e){t=o.RotatedRectangleF.union(e.rectangle,t)})),t},e.prototype.setQualityChangeScaleBarWidth=function(t){null!=this._qualityChangeScaleBar&&(t=Math.max(0,t),t=Math.min(100,t),this._qualityChangeScaleBar.style.width=t+"%")},e.prototype.setQualityChangeInfoBarText=function(t){null!=this._qualityChangeInfoBar&&(this._qualityChangeInfoBar.innerText=t)},e.prototype._isReady=function(){return t.prototype._isReady.call(this)&&(this.isEmptyContent()||this.content.ready)},e.prototype._getColors=function(){var e,n;return function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t}(null!==(n=null===(e=this.content)||void 0===e?void 0:e.getColors())&&void 0!==n?n:[],t.prototype._getColors.call(this))},e.prototype._updateImpl=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){return this.updateContentAndFrames((function(t){t.update()})),null!=this.canvas&&this.canvas.updatePlaceholderButtonGroup(this),[2]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype._onAddedOnCanvas=function(e){var n=this;t.prototype._onAddedOnCanvas.call(this,e),this.updateContentAndFrames((function(t){t.layer=n.layer,t.parentPlaceholder=n,t.canvas=e})),null!=e&&null==this.placeholderButtonGroup&&e.addPlaceholderButtonGroup(this),null!=this.content&&(this.content.canvas=e)},e.prototype._onRemovedFromCanvas=function(e){t.prototype._onRemovedFromCanvas.call(this,e),this.editing=!1,this.updateContentAndFrames((function(t){t._onRemovedFromCanvas(e)})),null!=e&&e.removePlaceholderButtonGroup(this)},e.prototype._onTransformRectangle=function(e,n,r){if(this._previousRectangle=this.rectangle,t.prototype._onTransformRectangle.call(this,e,n,r),!this.isEmptyContent()&&null!=this.content.startRectangle)if(this.item.isStubContent&&this.item.fixedStubContentSize&&!this.editing){var i=n.clone();i.Width=e.Width,i.Height=e.Height,this.content.transformRectangle(e,i)}else this.content.transformRectangle(e,n);this.editing||this._updateFrames((function(t){null!=t.startRectangle&&t.transformRectangle(e,n)})),this._previousRectangle=null;var o=this.canvas;null!=o&&o.updatePlaceholderButtonGroupPosition(this)},e.prototype._endTransform=function(t,e,n){void 0===n&&(n=!1),t&&(e||null!=this._startRectangle)&&(this.updateContentAndFrames((function(n){return n._endTransform(t,e,!0)})),n||this._itemPropertyChangedEvent.notify(this,"transform")),t&&e||(delete this._startRectangle,this.updateContentAndFrames((function(t){delete t._startRectangle}))),null!=this.canvas&&this.canvas.updateViolationContainer(this,!0)},e.prototype._getHighlightRectangle=function(){return this.editing?this.rectangle:t.prototype._getHighlightRectangle.call(this)},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips=new p.hb(!0,!0,!1),e},e.prototype._getItemPermissions=function(){var e=t.prototype._getItemPermissions.call(this);return e.placeholder=this.item.placeholderPermissions,e},e.prototype._onItemPropertyChanged=function(e,n){var r,i=this;switch(n){case"content":this.content=null!=e.content&&null!=this.canvas?this.canvas.getItemHandler(e.content):null,this.update();break;case"topFrames":null!=this.canvas&&(this.topFrames=e.topFrames.map((function(t){return i.canvas.getItemHandler(t)}))),this.update();break;case"bottomFrames":null!=this.canvas&&(this.bottomFrames=e.bottomFrames.map((function(t){return i.canvas.getItemHandler(t)}))),this.update();break;case"locked":null===(r=this.canvas)||void 0===r||r.updatePlaceholderButtonGroup(this);break;case"isStubContent":this._reloadPlaceholderButtons();break;case"isCoverMode":null!=this._content&&this.item.isCoverMode&&this._content.setRectangle(this._content.rectangle);break;case"contentOverlayEffect":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._onItemVisibilityChanged=function(){var e;t.prototype._onItemVisibilityChanged.call(this),null===(e=this.canvas)||void 0===e||e.updatePlaceholderButtonGroup(this)},e.prototype._refreshState=function(){var e;t.prototype._refreshState.call(this),this._isIgnorePermissionsMode()&&(null===(e=this.canvas)||void 0===e||e.updatePlaceholderButtonGroup(this))},e.prototype._createDataInstance=function(t){return new h.a(t)},e.prototype._updateFrames=function(t){this._updateTopFrames(t),this._updateBottomFrames(t)},e.prototype._updateTopFrames=function(t,e){if(null!=this._topFrames)for(var n=0;n<this._topFrames.length;n++)t(this._topFrames[n],null!=e?e[n]:null)},e.prototype._updateBottomFrames=function(t,e){if(null!=this._bottomFrames)for(var n=0;n<this._bottomFrames.length;n++)t(this._bottomFrames[n],null!=e?e[n]:null)},e.prototype._updateContent=function(t){this.isEmptyContent()||t(this._content)},e.prototype._onSelectButtonClick=function(){this._selectButtonClickEvent.notify(this)},e.prototype._onImageIsLoadingChanged=function(){var t,e,n;this.imageIsLoading?null===(t=this.canvas)||void 0===t||t.removePlaceholderButtonGroup(this):null===(e=this.canvas)||void 0===e||e.addPlaceholderButtonGroup(this),null===(n=this.canvas)||void 0===n||n.redraw()},e.prototype._rotateContent=function(t){if(!this.isStubOrEmpty()){var e=this.content.getTransformedRectangle(!1);e.angle=Object(o.normalizeAngle)((e.angle+t)%360),this.content.setTransformedRectangle(e),this.canvas.redraw()}},e.prototype._reloadPlaceholderButtons=function(){var t=this.canvas;null!=t&&(t.removePlaceholderButtonGroup(this),t.addPlaceholderButtonGroup(this),this.isStubOrEmpty()?t.removeViolationContainer(this._content):t.addViolationContainer(this._content))},e._getItemPath=function(t){return null==t?null:null!=t.sourcePath?t.sourcePath:null!=t.sourceRectangle?o.Path.rectangle(t.sourceRectangle.left,t.sourceRectangle.top,t.sourceRectangle.width,t.sourceRectangle.height):null},e.typeName="PlaceholderItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r.a})),n.d(e,"b",(function(){return r.b})),n.d(e,"f",(function(){return i.RgbColors})),n.d(e,"e",(function(){return o.Path})),n.d(e,"g",(function(){return o.Transform})),n.d(e,"d",(function(){return a.ImageEffect})),n.d(e,"c",(function(){return a.ColorLessContainer})),n.d(e,"i",(function(){return s.c})),n.d(e,"h",(function(){return s.b})),n(421),n(459),n(408);var r=n(407),i=n(411),o=(n(575),n(406)),a=n(457),s=n(556),l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(){function t(t){this._dictionary=new Map(t)}t.prototype.hasEqual=function(t){return this.tryGetKeyEqualTo(t).hasKey},t.prototype.tryGetKeyEqualTo=function(t){var e,n;if(this.has(t))return{hasKey:!0,key:t};try{for(var r=l(this.keys()),i=r.next();!i.done;i=r.next()){var o=i.value;if(o.equals(t))return{hasKey:!0,key:o}}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return{hasKey:!1,key:null}},t.prototype.tryGetValueOf=function(t){var e=this.tryGetKeyEqualTo(t),n=e.hasKey,r=e.key;return{hasValue:n,value:null!=r?this.get(r):null}},t.prototype.clear=function(){this._dictionary.clear()},t.prototype.delete=function(t){return this._dictionary.delete(t)},t.prototype.forEach=function(t,e){this._dictionary.forEach(t,e)},t.prototype.get=function(t){return this._dictionary.get(t)},t.prototype.has=function(t){return this._dictionary.has(t)},t.prototype.set=function(t,e){return this._dictionary.set(t,e),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._dictionary.size},enumerable:!0,configurable:!0}),t.prototype.entries=function(){return this._dictionary.entries()},t.prototype.keys=function(){return this._dictionary.keys()},t.prototype.values=function(){return this._dictionary.values()},t.prototype[Symbol.iterator]=function(){var t,e,n,r,i;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,7]),t=l(this._dictionary),e=t.next(),o.label=1;case 1:return e.done?[3,4]:[4,e.value];case 2:o.sent(),o.label=3;case 3:return e=t.next(),[3,1];case 4:return[3,7];case 5:return n=o.sent(),r={error:n},[3,7];case 6:try{e&&!e.done&&(i=t.return)&&i.call(t)}finally{if(r)throw r.error}return[7];case 7:return[2]}}))}}()},,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var r,i=n(408),o=n(443),a=n(406),s=n(417),l=n(453),u=n(410),c=n(479),h=n(578),p=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},d=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},g=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},m=function(t){function e(e,n,r,o,s){void 0===r&&(r=null),void 0===o&&(o=null),void 0===s&&(s=null);var l=t.call(this,null,null,null,null,n,r,s)||this;return l._apiClient=o,l._originalPathId=null,l._isLoadingPath=!1,l._isLoadedPath=!1,l.originalPath=null!=e?e:new a.Path(""),l._addedOnCanvasEvent=new i.a,null!=n&&null!=n.sourcePathId&&l.setOriginalPathId(n.sourcePathId),l._allowNegativeResize=!1,l._updateControlPointsSync(),l}return p(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return t.prototype._getItem.call(this)},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalPath",{get:function(){return this.item.sourcePath},set:function(t){this.item.sourcePath=t,this._isLoadedPath=!0},enumerable:!0,configurable:!0}),e.prototype.getOriginalPathId=function(){return this._originalPathId},e.prototype.setOriginalPathId=function(t){return f(this,void 0,void 0,(function(){var e,n,r,i;return d(this,(function(o){switch(o.label){case 0:return this._handlerUpdated=new h.a,this._originalPathId=t,null==this._originalPathId?[2]:(this._isLoadingPath=!0,this._isLoadedPath=!1,[4,this._waitAddOnCanvas()]);case 1:if(o.sent(),null==this.canvas)return[2];o.label=2;case 2:return o.trys.push([2,4,5,6]),e=this._apiClient.getContentPath(this._originalPathId),r=a.Path.bind,[4,e];case 3:return n=new(r.apply(a.Path,[void 0,o.sent()])),this.item.sourcePathLoaded=!0,this.originalPath=n,this._updateControlPoints(),this._isLoadedPath=!0,this._handlerUpdated.resolve(),[3,6];case 4:return i=o.sent(),console.error("Unable to load content path. Reason: "+i),this._isLoadedPath=!1,this._handlerUpdated.reject(i),[3,6];case 5:return this._isLoadingPath=!1,this.item.sourcePathLoaded=!1,this.item.getPathLoadedEvent().notify(),[7];case 6:return this.canvas.redraw(),[2]}}))}))},e.prototype.drawItemHandler=function(t){if(null!=t)if(this._isReadyToDraw){this._hasVectorMask()&&(t.save(),this._clip(t));var e=this._getItemColorPreviews(),n=e.fillColorPreview,r=e.borderColorPreview,i=e.altBorderColorPreview;s.a.path(t,this.item.sourcePath,this.getControlCenter(),this.item.transform,null==n?void 0:n.toString(),0,null,this.item.opacity,null);var o=this._getActualDash();s.a.drawStroke(t,this.item.sourcePath,this.getControlCenter(),this.item.transform,this._getActualBorderWidth(),null==r?void 0:r.toString(),null==i?void 0:i.toString(),this.item.opacity,o),this._hasVectorMask()&&t.restore()}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.onTextWhizzInit=function(){t.prototype.onTextWhizzInit.call(this),this._updateControlPoints()},e.prototype.getTextWrappingPath=function(){return this.item.textWrappingMode===u.xb.Tight?this._getTransformedPath():t.prototype.getTextWrappingPath.call(this)},e.prototype._getColors=function(){return function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(g(arguments[e]));return t}([this.item.fillColor,this.item.borderColor,this.item.altBorderColor],t.prototype._getColors.call(this))},e.prototype._updateImpl=function(e,n){return f(this,void 0,void 0,(function(){return d(this,(function(r){return"function"!=typeof e||(this.isVisible()?t.prototype._update.call(this,null,e,n):e()),[2]}))}))},Object.defineProperty(e.prototype,"_areColorPreviewsReady",{get:function(){var t=this._getItemColorPreviews(),e=t.fillColorPreview,n=t.borderColorPreview,r=t.altBorderColorPreview;return!(null!=this.item.fillColor&&null==e||null!=this.item.borderColor&&null==n||null!=this.item.altBorderColor&&null==r)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return!this._isLoadingPath&&this._isLoadedPath&&this._areColorPreviewsReady},enumerable:!0,configurable:!0}),e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.fillColor=e.fillColor,this.item.borderColor=e.borderColor,this.item.sourcePath=e.sourcePath,this.item.altBorderColor=e.altBorderColor,this.item.borderWidth=e.borderWidth,this.item.dash=e.dash,this.item.fixedBorderWidth=e.fixedBorderWidth},e.prototype._onItemPropertyChanged=function(e,n){var r=this.canvas;switch(n){case"fillColor":case"borderColor":case"altBorderColor":this.item.parentGroupItem instanceof u.r||(this.update(),null!=this.canvas&&this.canvas.redraw());break;case"fixedBorderWidth":case"borderWidth":null!=r&&(r.updateSelection(),r.redraw());break;case"sourceRectangle":this.originalPath=a.Path.rectangle(this.item.sourceRectangle.left,this.item.sourceRectangle.top,this.item.sourceRectangle.width,this.item.sourceRectangle.height),this._controlPoints=[new a.PointF(this.item.sourceRectangle.left,this.item.sourceRectangle.top),new a.PointF(this.item.sourceRectangle.right,this.item.sourceRectangle.bottom)]}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getActualBorderWidth=function(){var t=this.item.borderWidth,e=this.canvas;return this.item.fixedBorderWidth&&null!=e&&(t/=e.zoom),t},e.prototype._getBoundsMargin=function(){return this._getActualBorderWidth()},e.prototype._getTransformedPath=function(){var t=this.getControlCenter(),e=this.item.sourcePath.clone();return e.transform(this.item.transform,t),e},e.prototype._createDataInstance=function(t){return new l.a(t)},e.prototype._getItemColorPreviews=function(){var t=[this.item.fillColor,this.item.borderColor,this.item.altBorderColor],e=this._colorPreviewService.getPreviews(t),n=null;null!=this.item.fillColor&&(n=e[0],null!=this.item.fillColor&&null==n&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.fillColor,this._onColorPreviewLoaded));var r=null;null!=this.item.borderColor&&(r=e[1],null!=this.item.borderColor&&null==r&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.borderColor,this._onColorPreviewLoaded));var i=null;return null!=this.item.altBorderColor&&(i=e[2],null!=this.item.altBorderColor&&null==i&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.altBorderColor,this._onColorPreviewLoaded)),{fillColorPreview:n,borderColorPreview:r,altBorderColorPreview:i}},e.prototype._onAddedOnCanvas=function(e,n){t.prototype._onAddedOnCanvas.call(this,e,n),this._apiClient=e.designAtomsApiClient,this._addedOnCanvasEvent.notify(),this._updateControlPoints()},e.prototype._updateControlPoints=function(){return f(this,void 0,void 0,(function(){var t;return d(this,(function(e){switch(e.label){case 0:return null==this.item.sourcePath?[2]:[4,c.a.getBounds(this.item.sourcePath)];case 1:return t=e.sent(),this.controlPoints=[new a.PointF(t.left,t.top),new a.PointF(t.right,t.bottom)],[2]}}))}))},e.prototype._updateControlPointsSync=function(){if(null!=this.item.sourcePath){var t=c.a.getBoundsSync(this.item.sourcePath);null!=t&&(this.controlPoints=[new a.PointF(t.left,t.top),new a.PointF(t.right,t.bottom)])}},e.prototype._waitAddOnCanvas=function(){return f(this,void 0,void 0,(function(){var t=this;return d(this,(function(e){switch(e.label){case 0:return null!=this.canvas?[2]:[4,new Promise((function(e){var n=function(){e(),t._addedOnCanvasEvent.remove(n)};t._addedOnCanvasEvent.add(n)}))];case 1:return e.sent(),[2]}}))}))},e.prototype._getActualDash=function(){var t=this.item.dash;if(null==t)return t;var e=this.canvas,n=t.slice(0);if(n.length>0&&this.item.fixedBorderWidth&&null!=e)for(var r=0;r<n.length;r++)n[r]/=e.zoom;return n},e.typeName="ShapeItemHandler",e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r,i=n(408),o=n(569),a=n(478),s=n(417),l=n(410),u=n(406),c=n(479),h=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},f=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},d=function(t){function e(e,n,r,o,a,s,l){void 0===s&&(s=null);var c=t.call(this,a)||this;c._textWhizz=s,c._transformChanging=new i.b(c),c._violationWarningButtonClickEvent=new i.c,c._violationWarningButtonClick=new i.c,c._doubleClickEvent=new i.c,c._clickEvent=new i.c,c._onColorPreviewLoaded=function(t){var e;c._colorPreviewService.unsubscribeFromPreviewLoaded(t.color,c._onColorPreviewLoaded),null===(e=c.canvas)||void 0===e||e.redraw(),c._dispatchReadyEvent()},c._applyMatrix=function(t,e,n){void 0===n&&(n=null),c.setRectangle(c.rectangle.transformByMatrix(t,n),!e)};var h=e||0,p=n||0,f=r||0,d=o||0;return c._controlPoints=[new u.PointF(h,p),new u.PointF(h+f,p+d)],c._allowNegativeResize=!1,c._selectionTolerance=0,c._violationWarningButton=null,c._violationWarningButtonClickHandler=c._onViolationWarningButtonClick.bind(c),c._colorPreviewService=l,c._violationContainer=null,c._updateVectorMaskCenterSync(),c}return h(e,t),Object.defineProperty(e.prototype,"allowNegativeResize",{get:function(){return this._allowNegativeResize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transformChanging",{get:function(){return this._transformChanging},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rectangle",{get:function(){return this._getRectangle()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){var t=this.rectangle,e=this._getBoundsMargin();return t.width+=t.width>0?e:-e,t.height+=t.height>0?e:-e,t.bounds},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drawingRectangle",{get:function(){return this.rectangle},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.item.transform.angle},set:function(t){this.item.transform.setAngle(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.rectangle.height},set:function(t){var e=this.rectangle;e.height=t,this.setRectangle(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.rectangle.width},set:function(t){var e=this.rectangle;e.width=t,this.setRectangle(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startRectangle",{get:function(){return null!=this._startRectangle?this._startRectangle:null},enumerable:!0,configurable:!0}),e.transformRectangleByTwoRectanglesDiff=function(t,e,n){var r=n.getTransform(e),i=r.angle,o=r.scaleX,a=r.scaleY;if(Object(u.EqualsOfFloatNumbers)(n.angle,0)||t.rotateAt(-n.angle,e.center),Object(u.EqualsOfFloatNumbers)(o,1)&&Object(u.EqualsOfFloatNumbers)(a,1)?(t.centerX+=r.translateX,t.centerY+=r.translateY):(t.width=t.width*o,t.height=t.height*a,t.centerX=n.centerX+(t.centerX-e.centerX)*o,t.centerY=n.centerY+(t.centerY-e.centerY)*a),Object(u.EqualsOfFloatNumbers)(n.angle,0)||t.rotateAt(n.angle,n.center),!Object(u.EqualsOfFloatNumbers)(i,0)){var s=t.center;s.rotateAt(i,e.center),t.angle=t.angle+i,t.center=s}return t},e.prototype.setRectangle=function(t,e){var n=u.RotatedRectangleF.fromRectangleF(this.getControlBounds()),r=t.getTransform(n);this.item.setTransform(r,e)},e.prototype.getControlBounds=function(){var t=Math.max(this._controlPoints[0].x,this._controlPoints[1].x),e=Math.max(this._controlPoints[0].y,this._controlPoints[1].y),n=Math.min(this._controlPoints[0].x,this._controlPoints[1].x),r=Math.min(this._controlPoints[0].y,this._controlPoints[1].y),i=t-n,o=e-r;return new u.RectangleF(n,r,i,o)},e.prototype.getControlCenter=function(){var t=this.getControlBounds(),e=t.left+t.width/2,n=t.top+t.height/2;return new u.PointF(e,n)},e.prototype.transformByMatrix=function(t,e,n){if(void 0===n&&(n=null),e||null!=this._startRectangle||this.startTransform(),this._applyMatrix(t,e,n),this.transformChanged(),e&&null!=this._startRectangle){var r=this.rectangle,i=!r.equals(this._startRectangle),o=!Object(u.EqualsOfFloatNumbers)(r.width,this._startRectangle.width)||!Object(u.EqualsOfFloatNumbers)(r.height,this._startRectangle.height);o&&this.onResized(),this._endTransform(i,o,!0),this._startRectangle=null}var a=this.canvas;null!=a&&(this.updateViolationContainerPosition(),a.redraw()),null!=this.item.parentGroupItem?this.raiseChanging(this.item):this._throttleSizeChanging()},e.prototype.getTransformedRectangle=function(t,e){void 0===t&&(t=!0);var n=this.rectangle,r=this._getPrintAreaBounds();if(null!=r&&t&&(n.location=n.location.translate(-r.left,-r.top)),e){var i=this.getBorderMargin();n.width+=2*i,n.height+=2*i}return n},e.prototype.setTransformedRectangle=function(t,e){this.setRectangle(t,e)},e.prototype.getTextWrappingPath=function(){return this.item.textWrappingMode!==l.xb.None?u.Path.rotatedRectangle(this.rectangle):null},e.prototype.setLocation=function(t){var e=this.rectangle;e.location=t,this.setRectangle(e)},e.prototype.onTextWhizzInit=function(){this._updateVectorMaskCenter()},e.prototype.hitTest=function(t){return this.canvas.hitTestManager.hitTestSelection(this._getHighlightRectangle(),t)},e.prototype.addViolationWarningButtonClick=function(t){this._violationWarningButtonClick.add(t)},e.prototype.removeViolationWarningButtonClick=function(t){this._violationWarningButtonClick.remove(t)},e.prototype.getViolationWarningButton=function(){return this._violationWarningButton},e.prototype.setViolationWarningButton=function(t){this._violationWarningButton=t},e.prototype.getViolationWarningButtonClickHandler=function(){return this._violationWarningButtonClickHandler},e.prototype.getViolationContainer=function(){return this._violationContainer},e.prototype.setViolationContainer=function(t){this._violationContainer=t},e.prototype.getViolationWarningButtonElement=function(){return this._violationWarningButton},e.prototype.transformRectangle=function(t,e,n){void 0===n&&(n=!1),this._onTransformRectangle(t,e,n),this.updateViolationContainerPosition(),null!=this.item.parentGroupItem?this.raiseChanging(this.item):this._throttleSizeChanging()},e.prototype.startTransform=function(e){t.prototype.startTransform.call(this,e),this._startRectangle=this.rectangle,null!=this.canvas&&this.canvas.updateViolationContainer(this,!1)},e.prototype.endTransform=function(e,n,r){void 0===r&&(r=!1),t.prototype.endTransform.call(this,e,n,r),this._endTransform(e,n,r)},e.prototype.transformChanged=function(){t.prototype.transformChanged.call(this),this.updateViolationContainerPosition()},e.prototype.onResized=function(){return delete this._startRectangle,!0},e.prototype.dispatchDoubleClickEvent=function(t){this._doubleClickEvent.notify(this,t)},e.prototype.addDoubleClick=function(t){this._doubleClickEvent.add(t)},e.prototype.removeDoubleClick=function(t){this._doubleClickEvent.remove(t)},e.prototype.dispatchClickEvent=function(t){this._clickEvent.notify(t)},e.prototype.addClick=function(t){this._clickEvent.add(t)},e.prototype.removeClick=function(t){this._clickEvent.remove(t)},e.prototype.getHighlightRectangles=function(t){return void 0===t&&(t={includeChildren:!0,includeParent:!0}),[this._getHighlightRectangle()]},e.prototype.getSelectionRectangle=function(){return this.isVisible()?this.rectangle:null},e.prototype.getBorderMargin=function(){return this._getBoundsMargin()/2},e.prototype.getSelectionTolerance=function(){return this._selectionTolerance},e.prototype.showDeleteToolbarButton=function(){return this.getPermissions().allowDelete&&this.getPermissions().showDeleteToolbarButton},e.prototype.showHandleToolbarButton=function(){return!1},e.prototype.showEditToolbarButton=function(){return this.getPermissions().showEditToolbarButton},e.prototype.showSelectToolbarButton=function(){return this.getPermissions().showSelectToolbarButton},e.prototype.updateViolationContainerPosition=function(){var t;null===(t=this.canvas)||void 0===t||t.updateViolationContainerPosition(this)},e.prototype.isGoodViolationIcon=function(){if(null==this._violationWarningButton)return!1;var t=this.canvas.goodViolationIconCssClass;return this._violationWarningButton.classList.contains(t)},e.prototype.setGoodViolationIcon=function(t){if(null==this._violationWarningButton)return!1;if(this._showViolationButton(),null!=t&&(this._violationWarningButton.title=t),!this.isGoodViolationIcon()){var e=this.canvas,n=e.goodViolationIconCssClass,r=e.warningViolationIconCssClass,i=e.badViolationIconCssClass;this._violationWarningButton.classList.remove(r),this._violationWarningButton.classList.remove(i),this._violationWarningButton.classList.add(n),this._violationWarningButton.classList.toggle("active",e.isOnlyThisItemHandlerSelected(this))}},e.prototype.isWarningViolationIcon=function(){if(null==this._violationWarningButton)return!1;var t=this.canvas.warningViolationIconCssClass;return this._violationWarningButton.classList.contains(t)},e.prototype.setWarningViolationIcon=function(t){if(null!=this._violationWarningButton&&(this._showViolationButton(),null!=t&&(this._violationWarningButton.title=t),!this.isWarningViolationIcon())){var e=this.canvas,n=e.goodViolationIconCssClass,r=e.warningViolationIconCssClass,i=e.badViolationIconCssClass;this._violationWarningButton.classList.remove(n),this._violationWarningButton.classList.remove(i),this._violationWarningButton.classList.add(r),this._violationWarningButton.classList.toggle("active",e.isOnlyThisItemHandlerSelected(this))}},e.prototype.isBadViolationIcon=function(){if(null==this._violationWarningButton)return!1;var t=this.canvas.badViolationIconCssClass;return this._violationWarningButton.classList.contains(t)},e.prototype.setBadViolationIcon=function(t){if(null!=this._violationWarningButton&&(this._showViolationButton(),null!=t&&(this._violationWarningButton.title=t),!this.isBadViolationIcon())){var e=this.canvas,n=e.goodViolationIconCssClass,r=e.warningViolationIconCssClass,i=e.badViolationIconCssClass;this._violationWarningButton.classList.remove(n),this._violationWarningButton.classList.remove(r),this._violationWarningButton.classList.add(i),this._violationWarningButton.classList.toggle("active",e.isOnlyThisItemHandlerSelected(this))}},e.prototype.isNoneViolationIcon=function(){if(null==this._violationWarningButton)return!1;var t=this.canvas,e=t.goodViolationIconCssClass,n=t.warningViolationIconCssClass,r=t.badViolationIconCssClass,i=this._violationWarningButton.classList.contains(e)||this._violationWarningButton.classList.contains(n)||this._violationWarningButton.classList.contains(r);return"hidden"===this._violationWarningButton.style.visibility||!i},e.prototype.setNoneViolationIcon=function(){if(null!=this._violationWarningButton){var t=this.canvas,e=t.goodViolationIconCssClass,n=t.warningViolationIconCssClass,r=t.badViolationIconCssClass;this._violationWarningButton.classList.remove(e),this._violationWarningButton.classList.remove(n),this._violationWarningButton.classList.remove(r),this._violationWarningButton.style.visibility="hidden"}},e.prototype._isReady=function(){return this._areColorPreviewsReady},Object.defineProperty(e.prototype,"_areColorPreviewsReady",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype._updateImpl=function(t,e){return p(this,void 0,void 0,(function(){return f(this,(function(t){return this._updateViolationContainersVisibility(),[2]}))}))},e.prototype._getItemColorPreviews=function(){return{}},e.prototype._getHighlightRectangle=function(){var t=this.rectangle,e=parseInt(this._getBoundsMargin().toString());return t.width+=t.width>=0?e:-e,t.height+=t.height>=0?e:-e,t},e.prototype._updateVisibility=function(){this._updateViolationContainersVisibility()},e.prototype._onViolationWarningButtonClick=function(t){this._violationWarningButtonClick.notify(this,t),t.preventDefault()},e.prototype._updateViolationContainersVisibility=function(){var t;null===(t=this.canvas)||void 0===t||t.updateViolationContainer(this,!1)},e.prototype._endTransform=function(t,e,n){void 0===n&&(n=!1),n||!t||!e&&null==this._startRectangle||this._itemPropertyChangedEvent.notify(this,"transform"),t&&e||delete this._startRectangle;var r=this.canvas;null!=r&&r.updateViolationContainer(this,!0)},e.prototype._calculateTransformedRectangle=function(t,n){var r;if(this._startRectangle.equals(t))r=n.clone();else{var i=this._startRectangle.clone();r=e.transformRectangleByTwoRectanglesDiff(i,t,n)}return r},e.prototype._onTransformRectangle=function(t,e,n){if(null!=t&&null!=e&&null!=this._startRectangle){var r=this._calculateTransformedRectangle(t,e);this.setRectangle(r,!0)}},e.prototype._onAddedOnCanvas=function(e,n){t.prototype._onAddedOnCanvas.call(this,e,n),null!=e&&(null!=this._contentType&&this._contentType!==a.a.NotContent||e.addViolationContainer(this),this._updateVectorMaskCenter())},e.prototype._onRemovedFromCanvas=function(e){t.prototype._onRemovedFromCanvas.call(this,e),null!=e&&e.removeViolationContainer(this)},e.prototype._getRectangle=function(){var t=u.RotatedRectangleF.fromRectangleF(this.getControlBounds());return t.setTransform(this.item.transform),t},e.prototype._getBoundsMargin=function(){return 0},e.prototype._clip=function(t){if(this._hasVectorMask()){var e=this._getTransformedClippingPath();null!=e&&s.a.clipPath(t,e)}},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"opacity":case"transform":break;case"locked":this._updateVisibility();break;case"textWrappingMode":null!=this.canvas&&this.canvas.updateTexts();break;case"mask":this._updateVectorMaskCenter();break;case"violationSettings":this.canvas.updateViolationContainer(this)}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._onItemVisibilityChanged=function(){t.prototype._onItemVisibilityChanged.call(this),this._updateVisibility()},e.prototype._updateVectorMaskCenter=function(){return p(this,void 0,void 0,(function(){var t;return f(this,(function(e){switch(e.label){case 0:return this._hasVectorMask()?[4,c.a.getBounds(this.item.mask.vectorMask)]:[3,2];case 1:return t=e.sent(),this._vectorMaskCenter=u.RotatedRectangleF.fromRectangleF(t).center,[3,3];case 2:this._vectorMaskCenter=null,e.label=3;case 3:return[2]}}))}))},e.prototype._updateVectorMaskCenterSync=function(){if(this._hasVectorMask()){var t=c.a.getBoundsSync(this.item.mask.vectorMask);if(null==t)return;this._vectorMaskCenter=u.RotatedRectangleF.fromRectangleF(t).center}else this._vectorMaskCenter=null},e.prototype._getTransformedClippingPath=function(t){if(!this._hasVectorMask()||null==this._vectorMaskCenter)return null;null==t&&(t=this.item.transform.clone());var e=this.item.mask.vectorMask.clone(),n=this._vectorMaskCenter,r=this.getControlCenter();if(0!==t.angle&&(e.rotateAt(t.angle,r),t.setAngle(0,!0)),!Object(u.EqualsOfFloatNumbers)(t.scaleX,1)||!Object(u.EqualsOfFloatNumbers)(t.scaleY,1)){var i=n.x-r.x,o=n.y-r.y;r.translate(t.translateX,t.translateY),t.setTranslateX(r.x+i*t.scaleX-n.x),t.setTranslateY(r.y+o*t.scaleY-n.y)}return e.transform(t,n),e},e.prototype._hasVectorMask=function(){return null!=this.item.mask&&null!=this.item.mask.vectorMask},e.prototype._refreshState=function(){t.prototype._refreshState.call(this),this._isIgnorePermissionsMode()&&null!=this.canvas&&(this.visible&&!this.locked||this.canvas.removeSelectedItemHandler(this),this.canvas.updateViolationContainer(this,!0),this.canvas.redraw())},e.prototype._showViolationButton=function(){var t,e=this.isVisible()&&1!=(null===(t=this.canvas)||void 0===t?void 0:t.previewMode);this._violationWarningButton.style.visibility=e?"visible":"hidden"},e.prototype._getPrintAreaBounds=function(){if(null==this.layer||null==this.layer.container.parentComponent)return null;var t=this.layer.container.parentComponent;return null==t.printAreas||t.printAreas.length<1?null:t.printAreas.get(0).bounds},e.typeName="BaseRectangleItemHandler",e}(o.a)},function(t,e,n){"use strict";n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return l}));var r=n(448);class i{constructor(){this._path=new r.a}moveTo(t,e){this._path.moveTo(t,e)}lineTo(t,e){this._path.lineTo(t,e)}quadraticCurveTo(t,e,n,r){this._path.quadraticTo(t,e,n,r)}bezierCurveTo(t,e,n,r,i,o){this._path.cubicTo(t,e,n,r,i,o)}closePath(){this._path.close()}get path(){return this._path}}function o(t,e){const n=new t.Path;for(let r of e.segments)switch(r.name){case"Z":n.close();break;case"M":n.moveTo(r.getPoint(0).x,r.getPoint(0).y);break;case"L":n.lineTo(r.getPoint(0).x,r.getPoint(0).y);break;case"Q":n.curveTo3(r.getPoint(0).x,r.getPoint(0).y,r.getPoint(1).x,r.getPoint(1).y);break;case"C":n.curveTo4(r.getPoint(0).x,r.getPoint(0).y,r.getPoint(1).x,r.getPoint(1).y,r.getPoint(2).x,r.getPoint(2).y)}return n}function a(t){let e=new i;return t.parse(e),e.path}function s(t){return t.segments[0].getPoint(0)}function l(t){let e=t.segments[t.segments.length-1];return"Z"==e.name&&(e=t.segments[t.segments.length-2]),e.getPoint(e.length-1)}},function(t,e,n){"use strict";var r=n(418);function i(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}r.a.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r.a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const o=i.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{a[t]={value:t}})),Object.defineProperties(i,a),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=(t,e,n,a,s,l)=>{const u=Object.create(o);return r.a.toFlatObject(t,u,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),i.call(u,t.message,e,n,a,s),u.cause=t,u.name=t.name,l&&Object.assign(u,l),u},e.a=i},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return h}));class r{constructor(t){this._textManager=t}getSelectionRightParagraphLength(){const t=this.getSelection();if(null==t)return-1;const e=t.getRightPosition();return this.getParagraphLength(e.getParagraphIndex())}getSelectionRightParagraphIndex(){const t=this.getSelection();return null==t?-1:t.getRightPosition().getParagraphIndex()}getSelectionLeftParagraphIndex(){const t=this.getSelection();return null==t?-1:t.getLeftPosition().getParagraphIndex()}getSelectionLeftParagraphLength(){const t=this.getSelection();if(null==t)return-1;const e=t.getLeftPosition();return this.getParagraphLength(e.getParagraphIndex())}getSelectionRightParagraphOffset(){const t=this.getSelection();return null==t?-1:t.getRightPosition().getOffset()}getSelectionLeftParagraphOffset(){const t=this.getSelection();return null==t?-1:t.getLeftPosition().getOffset()}get isCursorAtTheBeginningOfParagraph(){var t;const e=this.getCursorPosition(),n=this.getParagraphIndex(),r=null===(t=this._textManager.getParagraphText(n))||void 0===t?void 0:t.getStartPosition();return e.getOffset()===r.getOffset()&&e.getLineIndex()===r.getLineIndex()}get isCaretAtTheEndOfParagraph(){return this._textManager.isCaretOnEndOfParagraph()}get isParagraphEmpty(){var t;return 0===(null===(t=this.getParagraphText().getPlainText())||void 0===t?void 0:t.length)}get isParagraphAListItem(){const t=this.getSelection();if(null==t||t.isEmpty)return this._textManager.isParagraphAListItem(this.getParagraphIndex());const e=this.getSelection().getParagraphIndexes()[0];return this._textManager.isParagraphAListItem(e)}get isSelectionCollapsed(){return this._textManager.isSelectionCollapsed()}get isSelectionMultiline(){const t=this._textManager.getSelectedTextRange();if(null==t)return!1;const e=t.getLeftPosition(),n=t.getRightPosition();return e.getParagraphIndex()!=n.getParagraphIndex()}getParagraphIndex(){return this._textManager.getCurrentParagraphIndex()}getParagraphText(){return this._textManager.getParagraphText(this.getParagraphIndex())}getTextFromStartOfParagraph(){const t=this.getParagraphText().getStartPosition(),e=this._textManager.getCurrentPosition();return this._textManager.getTextRangeByPositions(t,e)}getCursorPosition(){return this._textManager.getCurrentPosition()}getSelection(){return this._textManager.getSelectedTextRange()}getTextMetrics(){return{textLength:this._textManager.getTextLength(),currentLineLength:this._textManager.getCurrentParagraphLength(),linesCount:this._textManager.getParagraphCount()}}getParagraphLength(t){return this._textManager.getParagraphLength(t)}getNextParagraphLength(){const t=this._textManager.getCurrentParagraphIndex()+1;return this._textManager.getParagraphLength(t)}getPreviousParagraphLength(){const t=this._textManager.getCurrentParagraphIndex()-1;return this._textManager.getParagraphLength(t)}getListItemLevel(){var t;return null===(t=this._textManager.getListItemStyle(this.getParagraphIndex()))||void 0===t?void 0:t.level}findItemToContinueBulletedList(t){return this._textManager.findItemToContinueBulletedList(this.getParagraphIndex(),t)}findItemToContinueNumberedList(t,e){return this._textManager.findItemToContinueNumberedList(this.getParagraphIndex(),t,e)}}var i=n(427);class o{constructor(t,e){this.limitsViolated=t,this.pastedLimitsViolated=e}get isViolated(){return this.limitsViolated||this.pastedLimitsViolated}}class a{constructor(t){this._limits=null,this._currentTextInfo=null,this._currentTextInfo=t}setLimits(t){this._limits=t}validateInput(t){if(null==this._limits||null==t)return new o(!1,!1);const{characterLimit:e,maxLineCount:n,maxLineLength:r}=this._limits,{textLength:a,currentLineLength:s,linesCount:l}=this._currentTextInfo.getTextMetrics(),{isSelectionCollapsed:u,isSelectionMultiline:c,selectionEndParagraphOffset:h,selectionStartParagraphOffset:p,selectionEndParagraphLength:f,isCursorAtTheBeginningOfParagraph:d,isCursorAtTheEndOfParagraph:g,previousParagraphLength:m,nextParagraphLength:y}=this._getTextInfo();if(t.type===i.b.pasteFromClipboard)return this.validatePastedText(t.initData);switch(t.type){case i.b.insertChar:if(u){if(e&&a&&a>=e)return new o(!0,!1);if(r&&s&&s>=r)return new o(!0,!1)}else if(c&&r&&p+f-h+1>r)return new o(!0,!1);break;case i.b.insertTab:if(u&&(e&&a&&a>=e-3||r&&s&&s>=r-3))return new o(!0,!1);break;case i.b.insertNewLine:case i.b.insertLineBreak:if(u&&e&&a&&a>=e)return new o(!0,!1);if(n&&l&&l>=n)return new o(!0,!1);break;case i.b.deleteToLeft:if(u){if(r&&d&&s>0&&s+m>r&&m>0)return new o(!0,!1)}else if(c&&r&&p+f-h>r)return new o(!0,!1);break;case i.b.deleteToRight:if(u){if(r&&g&&s>0&&s+y>r&&y>0)return new o(!0,!1)}else if(c&&r&&p+f-h>r)return new o(!0,!1)}return new o(!1,!1)}validatePastedText(t){if(null==this._limits)return new o(!1,!1);if(null==t)return new o(!1,!1);const e=this._isPastedTextInLimits(t);return new o(!1,!e)}_isPastedTextInLimits(t){const{maxLineLength:e,characterLimit:n,maxLineCount:r}=this._limits,i=t.split(/\r?\n/);return!(n&&!this._validateInsertedTextForCharacterCount(i)||e&&!this._validateInsertedTextForMaxLineLength(i)||r&&!this._validateInsertedTextForMaxLineCount(i))}_validateInsertedTextForMaxLineCount(t){if(1==t.length)return!0;const{maxLineCount:e}=this._limits,{linesCount:n}=this._currentTextInfo.getTextMetrics(),{selectionEndParagraphIndex:r,selectionStartParagraphIndex:i}=this._getTextInfo();return!(n-(r-i-1)+(t.length-2)>e)}_validateInsertedTextForMaxLineLength(t){const{maxLineLength:e}=this._limits,{currentLineLength:n}=this._currentTextInfo.getTextMetrics(),{selectionEndParagraphOffset:r,selectionStartParagraphOffset:i,selectionEndParagraphLength:o}=this._getTextInfo();if(1==t.length){if(n-(r-i)+t[0].length>e)return!1}else{if(t[0].length+i>e)return!1;for(let n=1;n<t.length-1;n++)if(t[n].length>e)return!1;if(t[t.length-1].length+(o-r)>e)return!1}return!0}_validateInsertedTextForCharacterCount(t){const{characterLimit:e}=this._limits,{textLength:n}=this._currentTextInfo.getTextMetrics(),{isSelectionCollapsed:r,isSelectionMultiline:i,selectionEndParagraphIndex:o,selectionStartParagraphIndex:a,selectionEndParagraphOffset:s,selectionStartParagraphOffset:l,selectionStartParagraphLength:u}=this._getTextInfo();let c=0;if(!r)if(i){c+=u-l;for(var h=a+1;h<o;h++)c+=this._currentTextInfo.getParagraphLength(h);c+=s}else c=s-l;let p=0;return t.forEach((t=>p+=t.length)),!(n-c+p>e)}_getTextInfo(){return{isSelectionCollapsed:this._currentTextInfo.isSelectionCollapsed,isSelectionMultiline:this._currentTextInfo.isSelectionMultiline,selectionStartParagraphOffset:this._currentTextInfo.getSelectionLeftParagraphOffset(),selectionEndParagraphOffset:this._currentTextInfo.getSelectionRightParagraphOffset(),selectionStartParagraphLength:this._currentTextInfo.getSelectionLeftParagraphLength(),selectionEndParagraphLength:this._currentTextInfo.getSelectionRightParagraphLength(),selectionStartParagraphIndex:this._currentTextInfo.getSelectionLeftParagraphIndex(),selectionEndParagraphIndex:this._currentTextInfo.getSelectionRightParagraphIndex(),isCursorAtTheBeginningOfParagraph:this._currentTextInfo.isCursorAtTheBeginningOfParagraph,isCursorAtTheEndOfParagraph:this._currentTextInfo.isCaretAtTheEndOfParagraph,previousParagraphLength:this._currentTextInfo.getPreviousParagraphLength(),nextParagraphLength:this._currentTextInfo.getNextParagraphLength()}}}var s=n(407);class l{constructor(){this._isInitialized=!1}get isInitialized(){return this._isInitialized}initialize(t){if(t.textEngineWrapper&&t.styleManager){this._isInitialized=!0;const e=t.textEngineWrapper;this._textHandler=e.textHandler,this._styleHandler=e.styleHandler,this._metadataHandler=e.metadataHandler,this._listStyleSheetManager=t.styleManager;const n=this._listStyleSheetManager.getListSetting();this._styleNameKey=n.styleNameKey,this._maxNestingListLevel=n.maxNestingListLevel,this._defaultBulletCharCode=n.defUnorderedListStyle.bulletCharCode}else this._isInitialized=!1}actualizeStyleManager(){this._checkInitialization("Failed to actualize style manager!");const t=this._listStyleSheetManager.getAllStyleSheets().map((t=>t.name));for(let e of t){const t=this._listStyleSheetManager.getStyleSheet(e),n=this._getAllListItemIndexesByName(e),r=this._getListStylesForLevels(n);for(let e of r){const n=e.level;t.setListStyle(n,e)}}}isParagraphAListItem(t){return this._checkInitialization("Failed to check if paragraph is a list!"),this._isParagraphAListItem(t)}isParagraphsTheSameList(t){return this._checkInitialization("Failed to check if paragraphs are the same list!"),this._isParagraphsTheSameList(t)}findItemToContinueBulletedList(t,e){const n="Failed to find the previous list item to continue bulleted list!";return this._checkInitialization(n),this._checkParagraphIndexesExistence([t],n),this._findItemToContinueBulletedList(t,e)}findItemToContinueNumberedList(t,e,n){const r="Failed to find the previous list item to continue bulleted list!";return this._checkInitialization(r),this._checkParagraphIndexesExistence([t],r),this._findItemToContinueNumberedList(t,e,n)}getListItemStyle(t){const e="Failed to get the style of the list item!";return this._checkInitialization(e),this._checkParagraphIndexesExistence([t],e),this._getListStyleByIndex(t)}applyListType(t,e){const n="Failed to apply a list type to paragraphs!";return this._checkInitialization(n),this._checkParagraphIndexesExistence(t,n),e===i.d.none&&this._throwException(n,"The list type is not specified!"),this._applyListType(t,e)}createBulletedListItem(t,e){const n="Failed to create bulleted list item!";this._checkInitialization(n),this._checkParagraphIndexesExistence([t],n),this._isParagraphAListItem(t)&&this._throwException(n,"The paragraph is already a list item!"),this._createBulletedListItem(t,e)}createNumberedListItem(t,e){const n="Failed to create numbered list item!";this._checkInitialization(n),this._checkParagraphIndexesExistence([t],n),this._isParagraphAListItem(t)&&this._throwException(n,"The paragraph is already a list item!"),this._createNumberedListItem(t,e)}addListItem(t,e){const n="Failed to add an item to an existing list!";this._checkInitialization(n),this._checkParagraphIndexesExistence([t,e],n),this._isParagraphAListItem(e)||this._throwException(n,"It's not a list!"),this._isParagraphAListItem(t)&&this._throwException(n,"The paragraph being added is already a list item!"),this._addListItem(t,e)}deleteListItem(t){const e="Failed to delete delete an existing list item!";this._checkInitialization(e),this._checkParagraphIndexesExistence([t],e),this._isParagraphAListItem(t)||this._throwException(e,"It's not a list!"),this._deleteListItem(t)}increaseListItemIndent(t){const e="Failed to increases the nesting level of the list item!";this._checkInitialization(e),this._checkParagraphIndexesExistence([t],e),this._isParagraphAListItem(t)||this._throwException(e,"It's not a list!"),this._increaseListItemIndent(t)}decreaseListItemIndent(t){const e="Failed to decrease the nesting level of the list item!";this._checkInitialization(e),this._checkParagraphIndexesExistence([t],e),this._isParagraphAListItem(t)||this._throwException(e,"It's not a list!"),this._decreaseListItemIndent(t)}_isParagraphAListItem(t){return null!=this._getListStyleNameByIndex(t)}_isParagraphsTheSameList(t){let e=null;for(let n of t){if(!this._isParagraphAListItem(n))return!1;const t=this._getListStyleNameByIndex(n);if(null!=e){if(t!==e)return!1}else e=t}return!0}_isParagraphsAreListItems(t){for(let e of t)if(!this._isParagraphAListItem(e))return!1;return!0}_isParagraphsHaveTheSameListType(t,e){var n;for(let r of t)if((null===(n=this._getListStyleByIndex(r))||void 0===n?void 0:n.type)!==e)return!1;return!0}_findItemToContinueBulletedList(t,e){if(0===t)return null;const n=t-1;if(!this._isParagraphAListItem(n))return null;const r=this._getListStyleByIndex(n);return r.type!==i.d.bullets||r.bulletCharCode!==e?null:n}_findItemToContinueNumberedList(t,e,n){if(0===t)return null;const r=this._findPreviousListItemIndex(t);if(null==r)return null;const o=this._getListStyleByIndex(r);return o.type!==i.d.numbers||o.numberingFormat!==e||o.itemNumber!==n-1?null:r}_findPreviousListItemIndex(t){for(let e=t-1;e>=0;e--)if(this._isParagraphAListItem(e))return e;return null}_findPreviousRelatedListItemIndex(t,e,n){for(let r=e-1;r>=0;r--){if(!this._isParagraphAListItem(r)||this._getListStyleNameByIndex(r)!==t)continue;if(null==n)return r;const e=this._getListItemLevelByIndex(r);if(e<n)return null;if(e===n)return r}return null}_findNextRelatedListItemIndex(t,e,n){const r=this._textHandler.getParagraphCount()-1;for(let i=e+1;i<=r;i++){if(!this._isParagraphAListItem(i)||this._getListStyleNameByIndex(i)!==t)continue;if(null==n)return i;const e=this._getListItemLevelByIndex(i);if(e<n)return null;if(e===n)return i}return null}_getListItemLevelByIndex(t){const e=this._getListStyleByIndex(t);return null==e?void 0:e.level}_getAllListItemIndexesByName(t){const e=[],n=this._textHandler.getParagraphCount();for(let r=0;r<n;r++)this._getListStyleNameByIndex(r)===t&&e.push(r);return e}_getAllLevelsOfListItems(t,e){let n=[];for(let r of t){const t=this._getListStyleByIndex(r);-1===n.indexOf(t.level)&&(e?e===t.type&&n.push(t.level):n.push(t.level))}return n.sort(((t,e)=>t-e))}_createBulletedListItem(t,e){const n=this._listStyleSheetManager.createDefaultBulletedStyleSheet(e),r=this._getListStyleFromManager(n.name,t,i.d.bullets,0);this._setListStyleAndName(t,n.name,r)}_createNumberedListItem(t,e){const n=this._listStyleSheetManager.createDefaultNumberedStyleSheet(e),r=this._getListStyleFromManager(n.name,t,i.d.numbers,0);this._setListStyleAndName(t,n.name,r)}_addListItem(t,e){const n=this._getListStyleNameByIndex(e),r=this._getListStyleByIndex(e);if(this._findPreviousRelatedListItemIndex(n,t)!==e)throw new s.c("Failed to add an item to an existing list! An existing list item is not a previous item of the same list!");if(r.type===i.d.numbers&&r.itemNumber++,this._setListStyleAndName(t,n,r),r.type===i.d.numbers){const e=t+1,i=r.itemNumber+1;this._recountListItemsStartingAt(n,e,i,r.level)}}_deleteListItem(t){const e=this._getListStyleNameByIndex(t),n=this._getListStyleByIndex(t);this._deleteListStyleAndName(t),this._recountListItemsAfterDeletingItem(t,e,n)}_recountListItemsAfterDeletingItem(t,e,n){n.type===i.d.numbers&&this._recountListItemsOfCurrentLevelAfterDeletingItem(t,e,n);const r=n.level+1;if(r<=this._maxNestingListLevel){const n=this._getListStyleByNameAndLevel(e,r);(null==n?void 0:n.type)===i.d.numbers&&this._recountListItemsOfNextLevelAfterDeletingItem(t,e,r)}}_recountListItemsOfCurrentLevelAfterDeletingItem(t,e,n){this._recountListItemsStartingAt(e,t,n.itemNumber,n.level)}_recountListItemsOfNextLevelAfterDeletingItem(t,e,n){const r=this._findPreviousRelatedListItemIndex(e,t),i=this._findNextRelatedListItemIndex(e,t);if(null!=r&&null!=i){const t=this._getListStyleByIndex(r),o=this._getListStyleByIndex(i);t.level===n&&o.level===n&&this._recountListItemsStartingAt(e,i,t.itemNumber+1,n)}}_applyListType(t,e){const n=this._isParagraphsTheSameList(t)&&!this._isParagraphsHaveTheSameListType(t,e),r=this._isParagraphsAreListItems(t)&&this._isParagraphsHaveTheSameListType(t,e),i=!this._isParagraphsTheSameList(t)&&!this._isParagraphsHaveTheSameListType(t,e);if(r)this._applyListTypeRemoving(t);else if(n)this._applyListTypeChanging(t,e);else if(i){if(!this._isParagraphsAreListItems(t)&&this._tryToApplyListTypeJoining(t,e))return;this._applyListTypeCreating(t,e)}}_applyListTypeRemoving(t){t.forEach((t=>this._deleteListItem(t)))}_applyListTypeChanging(t,e){const n=this._getListStyleNameByIndex(t[0]),r=this._getAllLevelsOfListItems(t);for(let o of r)e===i.d.numbers?this._changeListTypeToNumbers(n,o):this._changeListTypeToBullets(n,o)}_changeListTypeToNumbers(t,e){const n=this._listStyleSheetManager.getDefaultListStyle(i.d.numbers,e),r=this._getAllListItemIndexesByName(t);let o=0;for(let a of r){const r=this._getListStyleByIndex(a);r.level<e?o=0:r.level===e&&(0===o&&(o=this._canBecomeTheFirstListItem(a,t,r.level)?1:2),r.type=i.d.numbers,r.numberingFormat=n.numberingFormat,r.itemNumber=o,this._setListStyleByIndex(a,r),o++)}}_changeListTypeToBullets(t,e){const n=this._listStyleSheetManager.getDefaultListStyle(i.d.bullets,e),r=this._getAllListItemIndexesByName(t);for(let o of r){const t=this._getListStyleByIndex(o);t.level===e&&(t.type=i.d.bullets,t.bulletCharCode=n.bulletCharCode,this._setListStyleByIndex(o,t))}}_applyListTypeCreating(t,e){const n=this._getListStylesForLevels(t,e),r=this._listStyleSheetManager.createStyleSheet(n);for(let i of t){const t=this._isParagraphAListItem(i)?this._getListItemLevelByIndex(i):0,n=this._getListStyleFromManager(r.name,i,e,t);this._isParagraphAListItem(i)&&this._deleteListItem(i),this._setListStyleAndName(i,r.name,n)}if(e===i.d.numbers){const e=this._getAllLevelsOfListItems(t,i.d.numbers);for(let t of e)this._recountAllListItemsOfRequiredLevel(r.name,t)}}_tryToApplyListTypeJoining(t,e){const n=t[0];if(0===n)return!1;if(!this._isParagraphAListItem(n)&&this._isParagraphAListItem(n-1))return this._tryToApplyListTypeJoiningWithShiftLevel(t,e);const r=this._getListStyleByIndex(n);return!(!this._isParagraphAListItem(n)||r.type!==e)&&this._tryToApplyListTypeJoiningWithSaveLevel(t,e)}_tryToApplyListTypeJoiningWithShiftLevel(t,e){let n,r=0;const i=t[0]-1,o=this._getListStyleByIndex(i),a=this._getListStyleNameByIndex(i);if(o.type===e)n=i,r=o.level;else{const t=this._getAllListItemIndexesByName(a).filter((t=>t<i));if(r=this._getAllLevelsOfListItems(t,e)[0],!r)return!1;for(let e of t.sort(((t,e)=>e-t)))if(this._getListStyleByIndex(e).level===r){n=e;break}}return this._applyListTypeJoining(t,e,n,r),!0}_tryToApplyListTypeJoiningWithSaveLevel(t,e){const n=t[0];return this._applyListTypeJoining(t,e,n,0),!0}_applyListTypeJoining(t,e,n,r){var o;const a=this._getListStyleNameByIndex(n);for(let i of t){let t;if(this._isParagraphAListItem(i)){const e=this._getListItemLevelByIndex(i)+r;t=e<=this._maxNestingListLevel-1?e:this._maxNestingListLevel-1}else t=r;let n=null!==(o=this._getListStyleByNameAndLevel(a,t))&&void 0!==o?o:this._getListStyleFromManager(a,i,e,t);this._isParagraphAListItem(i)&&this._deleteListItem(i),this._setListStyleAndName(i,a,n)}if(e===i.d.numbers){const e=this._getAllLevelsOfListItems(t,i.d.numbers);for(let t of e)this._recountAllListItemsOfRequiredLevel(a,t)}}_increaseListItemIndent(t){const e=this._getListItemLevelByIndex(t)+1;e>this._maxNestingListLevel-1||this._changeListItemIndent(t,e,!0)}_decreaseListItemIndent(t){const e=this._getListItemLevelByIndex(t)-1;e<0||this._changeListItemIndent(t,e,!1)}_changeListItemIndent(t,e,n){var r;const o=this._getListStyleNameByIndex(t),a=this._getListStyleByIndex(t),s=null!==(r=this._getListStyleByNameAndLevel(o,e))&&void 0!==r?r:this._getListStyleFromManager(o,t,a.type,e);s.type===i.d.numbers&&(s.itemNumber=this._getListItemNumberOfNewLevelAfterChangeIndent(t,o,s),this._recountListItemsOfNewLevelAfterChangeIndent(t,o,s)),this._setListStyleByIndex(t,s),a.type===i.d.numbers&&this._recountListItemsOfCurrentLevelAfterChangeIndent(t,o,a,n)}_recountListItemsOfCurrentLevelAfterChangeIndent(t,e,n,r){const i=t+1,o=r?n.itemNumber:1;this._recountListItemsStartingAt(e,i,o,n.level)}_recountListItemsOfNewLevelAfterChangeIndent(t,e,n){if(null!=this._findNextRelatedListItemIndex(e,t,n.level)){const r=t+1,i=n.itemNumber+1;this._recountListItemsStartingAt(e,r,i,n.level)}}_getListItemNumberOfNewLevelAfterChangeIndent(t,e,n){const r=this._findPreviousRelatedListItemIndex(e,t,n.level);return null!=r?this._getListStyleByIndex(r).itemNumber+1:1}_recountListItemsStartingAt(t,e,n,r){const i=this._getAllListItemIndexesByName(t).filter((t=>t>=e));let o=!1,a=n;for(let s of i){const e=this._getListItemLevelByIndex(s);if(e===r)o=!0,1===a&&(a=this._canBecomeTheFirstListItem(s,t,e)?1:2),this._setListStyleByIndex(s,{itemNumber:a}),a++;else if(o&&e<r)return}}_recountAllListItemsOfRequiredLevel(t,e){let n=0;const r=this._getAllListItemIndexesByName(t);for(let i of r){const r=this._getListStyleByIndex(i);r.level<e?n=0:r.level===e&&(0===n&&(n=this._canBecomeTheFirstListItem(i,t,r.level)?1:2),r.itemNumber=n,this._setListStyleByIndex(i,r),n++)}}_canBecomeTheFirstListItem(t,e,n){if(0===t)return!0;const r=this._findPreviousRelatedListItemIndex(e,t);return null==r||this._getListItemLevelByIndex(r)<n}_getListStyleNameByIndex(t){var e;const n=this._metadataHandler.getMetadata(t);return(null===(e=null==n?void 0:n.getProperty(this._styleNameKey))||void 0===e?void 0:e.value)||null}_getListStyleByIndex(t){if(!this._isParagraphAListItem(t))return null;const e=this._styleHandler.getParagraphStyleByIndex(t);return null==e?null:this._convertFromParagraphStyle(e)}_getListStyleByNameAndLevel(t,e){const n=this._getAllListItemIndexesByName(t);for(let r of n){const t=this._getListStyleByIndex(r);if(t.level===e)return t}return null}_getListStylesForLevels(t,e){let n=[],r=[];for(let i of t){const t=this._getListStyleByIndex(i);null!=t&&-1===n.indexOf(t.level)&&(e&&e!==t.type||(n.push(t.level),r.push(t)))}return r.sort(((t,e)=>t.level>e.level?1:0))}_setListStyleAndName(t,e,n){this._setListStyleNameByIndex(t,e),this._setListStyleByIndex(t,n)}_setListStyleNameByIndex(t,e){const n=[{name:this._styleNameKey,value:e}],r=this._metadataHandler.createMetadata(n);this._metadataHandler.setMetadata(t,r)}_setListStyleByIndex(t,e){this._styleHandler.setParagraphStyleByIndex(t,this._convertToParagraphStyle(e))}_deleteListStyleAndName(t){this._deleteListStyleNameByIndex(t),this._clearListStyleByIndex(t)}_deleteListStyleNameByIndex(t){this._metadataHandler.deleteMetadata(t)}_clearListStyleByIndex(t){this._styleHandler.setParagraphStyleByIndex(t,{listType:i.d.none,level:0,bulletCharCode:this._defaultBulletCharCode,numberingFormat:i.h.none,startNumber:0,firstLineIndent:0,leftIndent:0,tabOffset:0})}_getListStyleFromManager(t,e,n,r){var o;const a=this._listStyleSheetManager.getStyleSheet(t),s=null!==(o=null==a?void 0:a.getListStyle(r))&&void 0!==o?o:this._getDefaultListStyleFromManager(e,n,r);return n===i.d.numbers&&(s.itemNumber=1),s}_getDefaultListStyleFromManager(t,e,n){const r=this._listStyleSheetManager.getDefaultListStyle(e,n),i=this._isParagraphAListItem(t)?this._getListStyleByIndex(t):null;return(null==i?void 0:i.bulletCharCode)&&(r.bulletCharCode=i.bulletCharCode),(null==i?void 0:i.numberingFormat)&&(r.numberingFormat=i.numberingFormat),r}_checkInitialization(t){if(!this._isInitialized)throw new s.c(`${t} The list service is not initialized!`)}_checkParagraphIndexesExistence(t,e){if(0===t.length)throw new s.c(`${e} Paragraph indexes are not specified!`);const n=this._textHandler.getParagraphCount();for(let r of t)if(r>=n)throw new s.c(`${e} Invalid paragraph index!`)}_throwException(t,e){throw new s.c(`${t} ${e}`)}_convertFromParagraphStyle(t){return{type:t.listType,level:t.level,tabOffset:t.tabOffset,firstLineIndent:t.firstLineIndent,leftIndent:t.leftIndent,numberingFormat:t.numberingFormat,itemNumber:t.startNumber,bulletCharCode:t.bulletCharCode}}_convertToParagraphStyle(t){return{listType:t.type,level:t.level,tabOffset:t.tabOffset,firstLineIndent:t.firstLineIndent,leftIndent:t.leftIndent,numberingFormat:t.numberingFormat,numberingMode:i.i.startAt,startNumber:t.itemNumber,bulletCharCode:t.bulletCharCode}}}class u{constructor(t){if(!t.name)throw new s.c("List stylesheet name cannot be null or undefined");this._name=t.name,this._listStyles=[],t.listLevelsStyles&&t.listLevelsStyles.forEach((t=>this.setListStyle(t.level,t)))}get name(){return this._name}setListStyle(t,e){let n=this.getListStyle(t);n?(n.type=e.type,n.tabOffset=e.tabOffset,n.numberingFormat=e.numberingFormat,n.itemNumber=e.itemNumber,n.bulletCharCode=e.bulletCharCode,n.firstLineIndent=e.firstLineIndent,n.leftIndent=e.leftIndent):(e.level=t,this._listStyles.push(e))}getListStyle(t){const e=this._listStyles.filter((e=>e.level===t));return e.length>0?e[0]:null}getAllListStyles(){return this._listStyles}getListStyleSheet(){return{name:this._name,listLevelsStyles:this._listStyles}}}class c{constructor(t){this._styleNameKey=t.styleNameKey,this._styleNamePrefix=t.styleNamePrefix,this._maxNestingListLevel=t.maxNestingListLevel,this._defOrderedListLevelGap=t.defOrderedListLevelGap,this._defUnorderedListLevelGap=t.defUnorderedListLevelGap,this._defOrderedListStyle={type:i.d.numbers,tabOffset:t.defOrderedListStyle.tabOffset,firstLineIndent:t.defOrderedListStyle.firstLineIndent,leftIndent:t.defOrderedListStyle.leftIndent,numberingFormat:t.defOrderedListStyle.numberingFormat},this._defUnorderedListStyle={type:i.d.bullets,tabOffset:t.defUnorderedListStyle.tabOffset,firstLineIndent:t.defUnorderedListStyle.firstLineIndent,leftIndent:t.defUnorderedListStyle.leftIndent,bulletCharCode:t.defUnorderedListStyle.bulletCharCode},this.clearAllStyleSheets(),this._styleSheetTemplates=t.styleSheetTemplates?t.styleSheetTemplates.map((t=>new u(t))):[]}initialize(t){this.clearAllStyleSheets(),t&&(t.forEach((t=>{this.isStyleSheetExists(t.name)||this._styleSheets.push(new u(t))})),this._lastStyleNumber=this._getLastStyleNumber())}getListSetting(){var t;return{styleNameKey:this._styleNameKey,styleNamePrefix:this._styleNameKey,maxNestingListLevel:this._maxNestingListLevel,defOrderedListStyle:this._defOrderedListStyle,defUnorderedListStyle:this._defUnorderedListStyle,defOrderedListLevelGap:this._defOrderedListLevelGap,defUnorderedListLevelGap:this._defUnorderedListLevelGap,styleSheetTemplates:null===(t=this._styleSheetTemplates)||void 0===t?void 0:t.map((t=>t.getListStyleSheet()))}}isStyleSheetExists(t){return null!=this.getStyleSheet(t)}getStyleSheet(t){const e=this._styleSheets.filter((e=>e.name===t));return(null==e?void 0:e.length)>0?e[0]:null}getStyleSheetsCount(){return this._styleSheets.length}getAllStyleSheets(){return this._styleSheets}clearAllStyleSheets(){this._styleSheets=[],this._lastStyleNumber=0}createStyleSheet(t){return this._createListStyleSheet(t)}createEmptyStyleSheet(){return this._createEmptyListStyleSheet()}createDefaultBulletedStyleSheet(t){let e=this._findUnorderedListStyleTemplate(t);if(e)return this._createListStyleSheetFromTemplate(e);const n=this.getDefaultListStyle(i.d.bullets,0);return n.bulletCharCode=t,this._createDefaultListStyleSheet(n)}createDefaultNumberedStyleSheet(t){let e=this._findOrderedListStyleTemplate(t);if(e)return this._createListStyleSheetFromTemplate(e);const n=this.getDefaultListStyle(i.d.numbers,0);return n.numberingFormat=t,this._createDefaultListStyleSheet(n)}getDefaultListStyle(t,e){switch(t){case i.d.none:return null;case i.d.bullets:return this._createListStyle(this._getDefUnorderedListStyle(e));case i.d.numbers:return this._createListStyle(this._getDefOrderedListStyle(e))}}getDefaultListLevelGap(t){switch(t){case i.d.none:return 0;case i.d.bullets:return this._defOrderedListLevelGap;case i.d.numbers:return this._defUnorderedListLevelGap}}_getDefUnorderedListStyle(t){const e=this._defUnorderedListStyle.leftIndent+t*this._defUnorderedListLevelGap;return{type:i.d.bullets,level:t,tabOffset:this._defUnorderedListStyle.tabOffset,firstLineIndent:this._defUnorderedListStyle.firstLineIndent,leftIndent:e,bulletCharCode:this._defUnorderedListStyle.bulletCharCode}}_getDefOrderedListStyle(t){const e=this._defOrderedListStyle.leftIndent+t*this._defOrderedListLevelGap;return{type:i.d.numbers,level:t,tabOffset:this._defOrderedListStyle.tabOffset,firstLineIndent:this._defOrderedListStyle.firstLineIndent,leftIndent:e,numberingFormat:this._defOrderedListStyle.numberingFormat}}_getNextStyleName(){return this._lastStyleNumber++,this._styleNamePrefix+this._lastStyleNumber}_getLastStyleNumber(){let t=0;return this._styleSheets.forEach((e=>{const n=this._parseStyleName(e.name);null!=n&&n>t&&(t=n)})),t}_parseStyleName(t){if(!t.startsWith(this._styleNamePrefix))return null;const e=parseInt(t.replace(this._styleNamePrefix,""));return isNaN(e)?null:e}_createListStyleSheet(t){const e={name:this._getNextStyleName(),listLevelsStyles:t},n=new u(e);return this._styleSheets.push(n),n}_createEmptyListStyleSheet(){return this._createListStyleSheet()}_createDefaultListStyleSheet(t){return t.level=0,this._createListStyleSheet([t])}_createListStyleSheetFromTemplate(t){const e=[];return t.getAllListStyles().forEach((t=>e.push(this._createListStyle(t)))),this._createListStyleSheet(e)}_findOrderedListStyleTemplate(t){for(let e of this._styleSheetTemplates){const n=e.getAllListStyles().filter((e=>e.type===i.d.numbers&&0===e.level&&e.numberingFormat===t));if((null==n?void 0:n.length)>0)return e}return null}_findUnorderedListStyleTemplate(t){for(let e of this._styleSheetTemplates){const n=e.getAllListStyles().filter((e=>e.type===i.d.bullets&&0===e.level&&e.bulletCharCode===t));if((null==n?void 0:n.length)>0)return e}return null}_createListStyle(t){return{type:t.type,level:t.level,tabOffset:t.tabOffset,firstLineIndent:t.firstLineIndent,leftIndent:t.leftIndent,numberingFormat:t.numberingFormat,itemNumber:t.itemNumber,bulletCharCode:t.bulletCharCode}}}class h{constructor(t){var e,n,r,i;this._listSetting=t,this._styleNameKey="stylename",this._styleNamePrefix="style",this._defOrderedListStyle=null!==(e=null==t?void 0:t.defOrderedListStyle)&&void 0!==e?e:this._getDefaultOrderedListStyle(),this._defUnorderedListStyle=null!==(n=null==t?void 0:t.defUnorderedListStyle)&&void 0!==n?n:this._getDefaultUnorderedListStyle(),this._defOrderedListLevelGap=null!==(r=null==t?void 0:t.defOrderedListLevelGap)&&void 0!==r?r:30,this._defUnorderedListLevelGap=null!==(i=null==t?void 0:t.defUnorderedListLevelGap)&&void 0!==i?i:30,null!=(null==t?void 0:t.maxNestingListLevel)?this._maxNestingListLevel=t.maxNestingListLevel>3?3:t.maxNestingListLevel:this._maxNestingListLevel=3,null!=(null==t?void 0:t.styleSheetTemplates)?this._styleSheetTemplates=t.styleSheetTemplates.map((t=>new u(t))):this._styleSheetTemplates=this._getStyleSheetTemplates()}create(){const t={styleNameKey:this._styleNameKey,styleNamePrefix:this._styleNamePrefix,maxNestingListLevel:this._maxNestingListLevel,defOrderedListStyle:this._defOrderedListStyle,defUnorderedListStyle:this._defUnorderedListStyle,defOrderedListLevelGap:this._defOrderedListLevelGap,defUnorderedListLevelGap:this._defUnorderedListLevelGap,styleSheetTemplates:this._styleSheetTemplates.map((t=>t.getListStyleSheet()))};return new c(t)}_getDefaultOrderedListStyle(){return{numberingFormat:i.h.number,firstLineIndent:-20,leftIndent:30,tabOffset:30}}_getDefaultUnorderedListStyle(){return{bulletCharCode:8226,firstLineIndent:-20,leftIndent:30,tabOffset:30}}_getStyleSheetTemplates(){let t=[];const e={name:"template0",listLevelsStyles:[{level:0,type:i.d.bullets,bulletCharCode:8226,firstLineIndent:this._defUnorderedListStyle.firstLineIndent,leftIndent:this._defUnorderedListStyle.leftIndent,tabOffset:this._defUnorderedListStyle.tabOffset},{level:1,type:i.d.bullets,bulletCharCode:8226,firstLineIndent:this._defUnorderedListStyle.firstLineIndent,leftIndent:this._defUnorderedListStyle.leftIndent+this._defUnorderedListLevelGap,tabOffset:this._defUnorderedListStyle.tabOffset},{level:2,type:i.d.bullets,bulletCharCode:8226,firstLineIndent:this._defUnorderedListStyle.firstLineIndent,leftIndent:this._defUnorderedListStyle.leftIndent+2*this._defUnorderedListLevelGap,tabOffset:this._defUnorderedListStyle.tabOffset}]},n={name:"template0",listLevelsStyles:[{level:0,type:i.d.numbers,numberingFormat:i.h.number,firstLineIndent:this._defOrderedListStyle.firstLineIndent,leftIndent:this._defOrderedListStyle.leftIndent,tabOffset:this._defOrderedListStyle.tabOffset},{level:1,type:i.d.numbers,numberingFormat:i.h.lowerRoman,firstLineIndent:this._defOrderedListStyle.firstLineIndent,leftIndent:this._defOrderedListStyle.leftIndent+this._defOrderedListLevelGap,tabOffset:this._defOrderedListStyle.tabOffset},{level:2,type:i.d.numbers,numberingFormat:i.h.lowerLetter,firstLineIndent:this._defOrderedListStyle.firstLineIndent,leftIndent:this._defOrderedListStyle.leftIndent+2*this._defOrderedListLevelGap,tabOffset:this._defOrderedListStyle.tabOffset}]},r=new u(e),o=new u(n);return t.push(r),t.push(o),t}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s}));var r=n(431),i=n(408),o=n(422),a=function(){function t(t,e){this._name="",this._points=[],this._name=t?t.toUpperCase():"",this._points=e||[]}return Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.getPoint=function(t){return this._points[t]},Object.defineProperty(t.prototype,"length",{get:function(){return this._points.length},enumerable:!0,configurable:!0}),t.prototype.transform=function(t,e){for(var n=0;n<this.length;n++)this.getPoint(n).transform(t,e)},t.prototype.rotateAt=function(t,e){for(var n=0;n<this.length;n++)this.getPoint(n).rotateAt(t,e)},t.prototype.translate=function(t,e){for(var n=0;n<this.length;n++)this.getPoint(n).translate(t,e)},t.prototype.scale=function(t,e){for(var n=0;n<this.length;n++)this.getPoint(n).scale(t,e)},t.prototype.draw=function(t){switch(this.name){case"Z":t.closePath();break;case"M":t.moveTo(this.getPoint(0).x,this.getPoint(0).y);break;case"L":t.lineTo(this.getPoint(0).x,this.getPoint(0).y);break;case"Q":t.quadraticCurveTo(this.getPoint(0).x,this.getPoint(0).y,this.getPoint(1).x,this.getPoint(1).y);break;case"C":t.bezierCurveTo(this.getPoint(0).x,this.getPoint(0).y,this.getPoint(1).x,this.getPoint(1).y,this.getPoint(2).x,this.getPoint(2).y)}},t.prototype.toString=function(){for(var t=this.name,e=0;e<this.length;e++)t+=" "+this.getPoint(e).x+" "+this.getPoint(e).y;return t},t.prototype.clone=function(){return new t(this.name,this._points.map((function(t){return t.clone()})))},t}(),s=function(){function t(t){this._pathChangedEvent=new i.a,this._segments=[],null!=t&&this._fromString(t)}return Object.defineProperty(t.prototype,"length",{get:function(){return this._segments.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"segments",{get:function(){return this._segments},enumerable:!0,configurable:!0}),t.prototype.addPathChanged=function(t){this._pathChangedEvent.add(t)},t.prototype.removePathChanged=function(t){this._pathChangedEvent.remove(t)},t.prototype.moveTo=function(t,e){this._segments.push(new a("M",[new r.a(t,e)])),this._onPathChanged()},t.prototype.lineTo=function(t,e){this._segments.push(new a("L",[new r.a(t,e)])),this._onPathChanged()},t.prototype.quadraticTo=function(t,e,n,i){this._segments.push(new a("Q",[new r.a(t,e),new r.a(n,i)])),this._onPathChanged()},t.prototype.cubicTo=function(t,e,n,i,o,s){this._segments.push(new a("C",[new r.a(t,e),new r.a(n,i),new r.a(o,s)])),this._onPathChanged()},t.prototype.close=function(){this._segments.push(new a("Z")),this._onPathChanged()},t.prototype._onPathChanged=function(){this._pathChangedEvent.notify()},t.prototype.transform=function(t,e){for(var n=0;n<this.length;n++)this._segments[n].transform(t,e)},t.prototype.rotateAt=function(t,e){for(var n=0;n<this.length;n++)this._segments[n].rotateAt(t,e)},t.prototype.translate=function(t,e){for(var n=0;n<this.length;n++)this._segments[n].translate(t,e)},t.prototype.scale=function(t,e){for(var n=0;n<this.length;n++)this._segments[n].scale(t,e)},t.prototype.draw=function(t){if(t){t.beginPath();for(var e=0;e<this.length;e++)this._segments[e].draw(t)}},t.prototype.toString=function(){for(var t="",e=0;e<this.length;e++)t+=this._segments[e].toString(),e<this._segments.length-1&&(t+=" ");return t},t.prototype.clone=function(){return new t(this.toString())},t.prototype.equals=function(t){return this.isEqual(t)},t.prototype.isEqual=function(t){return null!=t&&this.toString()===t.toString()},t.prototype.addPath=function(t){var e,n;try{for(var r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t._segments),i=r.next();!i.done;i=r.next()){var o=i.value;this._segments.push(o.clone())}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype._fromString=function(t){for(var e=t.split(" "),n=0;n<e.length;){for(var i=e[n],o=n+1,s=[];o<e.length;){var l=parseFloat(e[o]);if(isNaN(l)||!isFinite(l))break;s.push(l),o++}for(var u=0,c=[];u<s.length;)c.push(new r.a(s[u],s[u+1])),u+=2;var h=new a(i,c);this._segments.push(h),n=o}},t.rectangle=function(e,n,r,i){var o=new t;return o.moveTo(e,n),o.lineTo(e+r,n),o.lineTo(e+r,n+i),o.lineTo(e,n+i),o.lineTo(e,n),o.close(),o},t.ellipse=function(e,n,r,i){var o=.5517,a=r/2,s=i/2,l=new t;return l.moveTo(e,n+s),l.cubicTo(e,n+s-s*o,e+a-a*o,n,e+a,n),l.cubicTo(e+a+a*o,n,e+r,n+s-s*o,e+r,n+s),l.cubicTo(e+r,n+s+s*o,e+a+a*o,n+i,e+a,n+i),l.cubicTo(e+a-a*o,n+i,e,n+s+s*o,e,n+s),l.close(),l},t.roundedRectangle=function(e,n,r,i,a){if(null==a)return t.rectangle(e,n,r,i);var s=.5517,l=new t,u=e,c=n,h=a[0].width,p=a[0].height,f=a[1].width,d=a[1].height,g=a[2].width,m=a[2].height,y=a[3].width,_=a[3].height;return(Object(o.e)(h,0)||Object(o.e)(p,0))&&(h=p=0),(Object(o.e)(f,0)||Object(o.e)(d,0))&&(f=d=0),(Object(o.e)(g,0)||Object(o.e)(m,0))&&(g=m=0),(Object(o.e)(y,0)||Object(o.e)(_,0))&&(y=_=0),l.moveTo(u+h,c),Object(o.e)(h+f,r)||l.lineTo(u+r-f,c),Object(o.e)(f,0)||Object(o.e)(d,0)||l.cubicTo(u+r-f*(1-s),c,u+r,c+d*(1-s),u+r,c+d),Object(o.e)(d+m,i)||l.lineTo(u+r,c+i-m),Object(o.e)(g,0)||Object(o.e)(m,0)||l.cubicTo(u+r,c+i-m*(1-s),u+r-g*(1-s),c+i,u+r-g,c+i),Object(o.e)(g+y,r)||l.lineTo(u+y,c+i),Object(o.e)(y,0)||Object(o.e)(_,0)||l.cubicTo(u+y*(1-s),c+i,u,c+i-_*(1-s),u,c+i-_),Object(o.e)(_+p,i)||l.lineTo(u,c+p),Object(o.e)(h,0)||Object(o.e)(p,0)||l.cubicTo(u,c+p*(1-s),u+h*(1-s),c,u+h,c),l.close(),l},t.rotatedRectangle=function(e){var n=e.getUpperLeftCorner(),r=e.getUpperRightCorner(),i=e.getBottomRightCorner(),o=e.getBottomLeftCorner(),a=new t;return a.moveTo(n.x,n.y),a.lineTo(r.x,r.y),a.lineTo(i.x,i.y),a.lineTo(o.x,o.y),a.lineTo(n.x,n.y),a.close(),a},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(408),i=n(422),o=n(471),a=function(){function t(t,e,n,i,o){this._angle=0,this._scaleX=0,this._scaleY=0,this._translateX=0,this._translateY=0,this._transformChangedEvent=new r.a,this._angle=o||0,this._scaleX=t||0===t?t:1,this._scaleY=e||0===t?e:1,this._translateX=n||0,this._translateY=i||0}return t.prototype.addTransformChanged=function(t){this._transformChangedEvent.add(t)},t.prototype.removeTransformChanged=function(t){this._transformChangedEvent.remove(t)},t.prototype._setProperty=function(t,e,n){void 0===n&&(n=!1);var r="_"+t;this[r]!==e&&(this[r]=e,n||this._transformChangedEvent.notify())},Object.defineProperty(t.prototype,"angle",{get:function(){return this._angle},enumerable:!0,configurable:!0}),t.prototype.setAngle=function(t,e){this._setProperty("angle",t,e)},Object.defineProperty(t.prototype,"scaleX",{get:function(){return this._scaleX},enumerable:!0,configurable:!0}),t.prototype.setScaleX=function(t,e){this._setProperty("scaleX",t,e)},Object.defineProperty(t.prototype,"scaleY",{get:function(){return this._scaleY},enumerable:!0,configurable:!0}),t.prototype.setScaleY=function(t,e){this._setProperty("scaleY",t,e)},Object.defineProperty(t.prototype,"translateX",{get:function(){return this._translateX},enumerable:!0,configurable:!0}),t.prototype.setTranslateX=function(t,e){this._setProperty("translateX",t,e)},Object.defineProperty(t.prototype,"translateY",{get:function(){return this._translateY},enumerable:!0,configurable:!0}),t.prototype.setTranslateY=function(t,e){this._setProperty("translateY",t,e)},t.prototype.move=function(t,e){var n=this.clone();null!=t&&this.setTranslateX(this._translateX+t,!0),null!=e&&this.setTranslateY(this._translateY+e,!0),n.equals(this)||this._transformChangedEvent.notify()},t.prototype.rotate=function(t){null==t||Object(i.e)(t,0)||(this._angle+=t,this._transformChangedEvent.notify())},t.prototype.clone=function(){return new t(this._scaleX,this._scaleY,this._translateX,this._translateY,this._angle)},t.prototype.equals=function(t,e){return null!=t&&Object(i.e)(this._scaleX,t._scaleX,e)&&Object(i.e)(this._scaleY,t._scaleY,e)&&Object(i.e)(this._translateX,t._translateX,e)&&Object(i.e)(this._translateY,t._translateY,e)&&Object(i.e)(this._angle,t._angle,e)},t.isEqual=function(t,e,n){return void 0===n&&(n=1e-4),null==t&&null==e||null!=t&&null!=e&&t.equals(e,n)},t.prototype.toMatrix=function(){var t=this._angle,e=Math.sin(Object(i.c)(t)),n=Math.cos(Object(i.c)(t));return new o.a(n*this._scaleX,e*this._scaleX,-e*this._scaleY,n*this._scaleY,this._translateX,this._translateY)},t.prototype.clear=function(t){var e=void 0===t?{}:t,n=e.keepAngle,r=void 0!==n&&n,i=e.supressOnChanged,o=void 0!==i&&i;this._scaleX=1,this._scaleY=1,this._translateX=0,this._translateY=0,r||(this._angle=0),o||this._transformChangedEvent.notify()},t.prototype.applyMatrix=function(t,e){if(void 0===e&&(e=!1),!t.isIdentity){var n=this.toMatrix().concatenate(t);this._angle=n.angle,this._scaleX=n.scaleX,this._scaleY=n.scaleY,this._translateX=n.translateX,this._translateY=n.translateY,e||this._transformChangedEvent.notify()}},Object.defineProperty(t.prototype,"isEmpty",{get:function(){return Object(i.e)(this._scaleX,1)&&Object(i.e)(this._scaleY,1)&&Object(i.e)(this._translateX,0)&&Object(i.e)(this._translateY,0)&&Object(i.e)(this._angle,0)},enumerable:!0,configurable:!0}),t.prototype.toString=function(){var t=[this.translateX,this.translateY,this.scaleX,this.scaleY,this.angle].map((function(t){return t.toFixed(2)}));return"{ tx: "+t[0]+", ty: "+t[1]+", sx: "+t[2]+", sy: "+t[3]+", a: "+t[4]+"}"},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){}return Object.defineProperty(t.prototype,"colorSpace",{get:function(){return this._colorSpace},enumerable:!0,configurable:!0}),t.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.equals=function(t){return t.colorSpace===this.colorSpace},t.prototype.getData=function(){return{colorSpace:this.colorSpace}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r,i=n(492),o=n(458),a=n(545),s=n(547),l=n(548),u=n(550),c=n(407),h=n(408),p=n(406),f=n(449),d=n(460),g=n(551),m=n(416),y=n(493),_=n(461),v=n(496),b=n(409),w=n(415),C=n(552),P=n(437),S=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},I=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},O=function(t){function e(){var n=t.call(this)||this;n._visible=!0,n._locked=!1,n._opacity=1,n._fromLayout=!1,n._textWrappingMode=d.a.None,n._isVariable=!1,n._blendMode=_.a.Normal,n._ignorePermissionsChange=!1,n._mask=null,n._class=null,n._onPermissionsChanged=function(){n._ignorePermissionsChange||(n._ignorePermissionsChange=!0,n.applyPermissionsConstrain(),n._ignorePermissionsChange=!1,n._propertyChanged.notify(n,"permissions"))},n._parentGroupItem=null,n.themeBinding=new g.a,n._onTransformChanged=function(t){n._propertyChanged.notify(n,"transform")},n._onMaskChanged=function(t){n._propertyChanged.notify(n,"mask")},n._changedEvent=new h.b(n),n._changingEvent=new h.a,n.type=e.type;var r=new l.a;return r.allowRemoveOnLayoutChange=!1,n.itemPermissions=r,n.setManipulationPermissions(new a.a),n.visualizationPermissions=new s.a,n.frontendPermissions=new u.a,n._setViolationSettings(new C.a,!0),n.setTransform(new f.a),n}return S(e,t),e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.itemPermissions=e._itemPermissions.clone(),n.visible=e._visible,n.locked=e._locked,n.opacity=e._opacity,n.isVariable=e._isVariable,n.textWrappingMode=e._textWrappingMode,n.setManipulationPermissions(e._manipulationPermissions.clone()),n.visualizationPermissions=e._visualizationPermissions.clone(),n.frontendPermissions=e._frontendPermissions.clone(),n.violationSettings=e._violationSettings.clone(),n.transform=e._transform.clone(),n.containerName=e.containerName,n.themeBinding=e.themeBinding.clone(),n.mask=null!=e.mask?e.mask.clone():null,n.blendMode=e.blendMode,n.class=e.class},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(b.g)(this._itemPermissions,e._itemPermissions),i=Object(b.g)(this._visible,e._visible),o=Object(b.g)(this._locked,e._locked),a=Object(b.g)(this._opacity,e._opacity),s=Object(b.g)(this._isVariable,e._isVariable),l=Object(b.g)(this._textWrappingMode,e._textWrappingMode),u=Object(b.g)(this._manipulationPermissions,e._manipulationPermissions),c=Object(b.g)(this._visualizationPermissions,e._visualizationPermissions),h=Object(b.g)(this._frontendPermissions,e._frontendPermissions),p=Object(b.g)(this._transform,e._transform),f=Object(b.g)(this._violationSettings,e._violationSettings),d=Object(b.g)(this.containerName,e.containerName),g=Object(b.g)(this.themeBinding,e.themeBinding),m=Object(b.g)(this._mask,e._mask),y=Object(b.g)(this.blendMode,e.blendMode),_=Object(b.g)(this.class,e.class);return n&&r&&i&&o&&a&&s&&l&&u&&c&&h&&p&&f&&d&&g&&m&&y&&_},Object.defineProperty(e.prototype,"class",{get:function(){return this._class},set:function(t){this._class!=t&&(this._class=t,this._propertyChanged.notify(this,"class"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"manipulationPermissions",{get:function(){return this.getManipulationPermissions()},set:function(t){this.setManipulationPermissions(t)},enumerable:!0,configurable:!0}),e.prototype.getManipulationPermissions=function(){return this._manipulationPermissions},e.prototype.setManipulationPermissions=function(t){if(null==t)throw new c.a("manipulationPermissions cannot be null");Object(b.g)(this._manipulationPermissions,t)||(null!=this._manipulationPermissions&&this._manipulationPermissions.propertyChanged.remove(this._onPermissionsChanged),this._manipulationPermissions=t,this.applyPermissionsConstrain(),this._manipulationPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"manipulationPermissions"))},Object.defineProperty(e.prototype,"visualizationPermissions",{get:function(){return this._visualizationPermissions},set:function(t){if(null==t)throw new c.a("visualizationPermissions cannot be null");Object(b.g)(this._visualizationPermissions,t)||(null!=this._visualizationPermissions&&this._visualizationPermissions.propertyChanged.remove(this._onPermissionsChanged),this._visualizationPermissions=t,this.applyPermissionsConstrain(),this._visualizationPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"visualizationPermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemPermissions",{get:function(){return this._itemPermissions},set:function(t){if(null==t)throw new c.a("itemPermissions cannot be null");Object(b.g)(this._itemPermissions,t)||(null!=this._itemPermissions&&this._itemPermissions.propertyChanged.remove(this._onPermissionsChanged),this._itemPermissions=t,this.applyPermissionsConstrain(),this._itemPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"itemPermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frontendPermissions",{get:function(){return this._frontendPermissions},set:function(t){if(null==t)throw new c.a("frontendPermissions cannot be null");Object(b.g)(this._frontendPermissions,t)||(null!=this._frontendPermissions&&this._frontendPermissions.propertyChanged.remove(this._onPermissionsChanged),this._frontendPermissions=t,this.applyPermissionsConstrain(),this._frontendPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"frontendPermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"violationSettings",{get:function(){return this._violationSettings},set:function(t){this._setViolationSettings(t)},enumerable:!0,configurable:!0}),e.prototype._setViolationSettings=function(t,e){if(void 0===e&&(e=!1),null==t)throw new c.a("violationSettings cannot be null");Object(b.g)(this._violationSettings,t)||(null!=this._violationSettings&&this._violationSettings.removePropertyChanged(this._onPermissionsChanged),this._violationSettings=t,this.applyPermissionsConstrain(),this._violationSettings.addPropertyChanged(this._onPermissionsChanged),this._propertyChanged.notify(this,"violationSettings"))},e.prototype.applyPermissionsConstrain=function(){this.isRenderTypeIsNormal||(this.itemPermissions.allowOpacityChange=!1)},e.prototype._onContainerChanged=function(){t.prototype._onContainerChanged.call(this),this.applyPermissionsConstrain()},Object.defineProperty(e.prototype,"parentGroupItem",{get:function(){return this._parentGroupItem},set:function(t){this._parentGroupItem=t,null!=t&&(this.parentContainer=this._parentGroupItem.parentContainer)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this._blendMode!==t&&(this._blendMode=t,this._propertyChanged.notify(this,"blendMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transform",{get:function(){return this._transform},set:function(t){this.setTransform(t)},enumerable:!0,configurable:!0}),e.prototype.setTransform=function(t,e){void 0===e&&(e=!1),this._transform&&this._transform.removeTransformChanged(this._onTransformChanged);var n=!1;f.a.isEqual(this._transform,t)||(this._transform=t,n=!0),this._transform&&this._transform.addTransformChanged(this._onTransformChanged),!e&&n&&this._propertyChanged.notify(this,"transform")},Object.defineProperty(e.prototype,"textWrappingMode",{get:function(){return this._textWrappingMode},set:function(t){this._textWrappingMode!==t&&(this._textWrappingMode=t,this._propertyChanged.notify(this,"textWrappingMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locked",{get:function(){return this._locked},set:function(t){this._locked!==t&&(this._locked=t,this._propertyChanged.notify(this,"locked"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){Object(b.g)(this.mask,t)||(null!=this._mask&&this._mask.removeMaskChanged(this._onMaskChanged),this._mask=t,null!=this._mask&&this._mask.addMaskChanged(this._onMaskChanged),this._propertyChanged.notify(this,"mask"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,this._propertyChanged.notify(this,"visible"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"opacity",{get:function(){return this._opacity},set:function(t){p.EqualsOfFloatNumbers(this._opacity,t)||(this._opacity=t,this._propertyChanged.notify(this,"opacity"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVariable",{get:function(){return this._isVariable},set:function(t){if(this._isVariable!==t){if(!this._canSetIsVariable())throw new c.d("Unable to set isVariable on item of type '"+this.type+"'");this._isVariable=t,this._propertyChanged.notify(this,"isVariable")}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fromLayout",{get:function(){return this._fromLayout},set:function(t){this._fromLayout!==t&&(this._fromLayout=t,this._propertyChanged.notify(this,"fromLayout"))},enumerable:!0,configurable:!0}),e.prototype.canSetIsVariable=function(){return this._canSetIsVariable()},e.prototype._canSetIsVariable=function(){return!1},e.prototype._getParentContainer=function(){return null!=this.parentContainer?this.parentContainer:null},e.prototype.getSimplifiedObject=function(e){m.f(e)||m.k(e)||(e=[]);var n=t.prototype.getSimplifiedObject.call(this,["_changedEvent","_changingEvent","manipulationPermissions","itemPermissions","visualizationPermissions","frontendPermissions","renderingType","isRenderTypeIsNormal","parentGroupItem"].concat(e));return n.manipulationPermissions=this.manipulationPermissions.getSimplifiedObject(),n.itemPermissions=this.itemPermissions.getSimplifiedObject(),n.visualizationPermissions=this.visualizationPermissions.getSimplifiedObject(),n.frontendPermissions=this.frontendPermissions.getSimplifiedObject(),n.mask=null!=this.mask?this.mask.getSimplifiedObject():null,n},e.prototype.getItemChangedEvent=function(){return this._changedEvent},e.prototype.getItemChangingEvent=function(){return this._changingEvent},e.prototype._getThemeBinding=function(t){return null!=t?t:this.themeBinding},e.prototype._applyThemeColor=function(t,e,n){throw new c.e},Object.defineProperty(e.prototype,"isRenderTypeIsNormal",{get:function(){return this.renderingType===y.a.Normal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderingType",{get:function(){return this.parentContainer instanceof o.g?this.parentContainer.renderingType:y.a.Normal},enumerable:!0,configurable:!0}),e.type="item",x([Object(w.a)({displayName:"Class"}),I("design:type",String),I("design:paramtypes",[String])],e.prototype,"class",null),x([Object(w.a)({enumObject:_.a,displayName:"Blend mode"}),I("design:type",String),I("design:paramtypes",[String])],e.prototype,"blendMode",null),x([Object(w.a)({enumObject:d.a}),I("design:type",Number),I("design:paramtypes",[Number])],e.prototype,"textWrappingMode",null),x([Object(w.a)({displayName:"Locked"}),I("design:type",Boolean),I("design:paramtypes",[Boolean])],e.prototype,"locked",null),x([Object(w.a)({factory:new P.c(v.a)}),I("design:type",v.a),I("design:paramtypes",[v.a])],e.prototype,"mask",null),e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return g}));var r=n(408),i=n(508),o=n(579),a=n(410);n.d(e,"a",(function(){return a.I}));var s,l=n(609),u=n(425),c=n(440),h=n(580),p=(s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},s(t,e)},function(t,e){function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},d=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},g=function(t){function e(e,n,i,o){void 0===n&&(n=null);var s=t.call(this,e,n,i,o)||this;return s._maxImageSize=4e6,s._imageResizedEvent=new r.c,s._qualityChangeContainer=null,s._qualityChangeScaleBar=null,s._qualityChangeInfoBar=null,s.item.source.type===a.J.ImageSourceType.Url&&s.loadImage(null,{downloadToServerCache:!0,actualSize:s.item.source.actualSize,saveAspectRatio:s.item.source.saveAspectRatio}),s}return p(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"needToDownloadImage",{get:function(){return this._needToDownloadImage},set:function(t){this._needToDownloadImage=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"takeIntoAccountImageDpi",{get:function(){return this._takeIntoAccountImageDpi},set:function(t){this._takeIntoAccountImageDpi=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourceImageHorizontalResolution",{get:function(){return this._sourceImageHorizontalResolution},set:function(t){this._sourceImageHorizontalResolution=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourceImageVerticalResolution",{get:function(){return this._sourceImageVerticalResolution},set:function(t){this._sourceImageVerticalResolution=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeScaleBar",{get:function(){return this._qualityChangeScaleBar},set:function(t){this._qualityChangeScaleBar=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeInfoBar",{get:function(){return this._qualityChangeInfoBar},set:function(t){this._qualityChangeInfoBar=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"qualityChangeContainer",{get:function(){return this._qualityChangeContainer},set:function(t){this._qualityChangeContainer=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isQualityChangeBarEmpty",{get:function(){var t=this.canvas;return null==this._qualityChangeScaleBar||null==t||this._qualityChangeScaleBar.className===this.canvas.qualityChangeScaleBarCssClass},enumerable:!0,configurable:!0}),e.prototype.loadImage=function(t,e){return void 0===e&&(e={}),f(this,void 0,void 0,(function(){var n=this;return d(this,(function(r){switch(r.label){case 0:return"string"!=typeof t&&this.item.source.type!==a.J.ImageSourceType.Url&&console.error("Invalid sourceUrl: "+t),e.downloadToServerCache?(this._needToDownloadImage=!0,this._actualSize=null!=e.actualSize&&e.actualSize,this._saveAspectRatio=null==e.saveAspectRatio||e.saveAspectRatio,this._sourceUrl=t,null==t&&(this._sourceUrl=this.item.source.url),[4,new Promise((function(t){return n.update(null,t)}))]):[3,2];case 1:return r.sent(),[3,3];case 2:this._needToDownloadImage=!1,this._setSrc(t),r.label=3;case 3:return[2,this.item.source.id]}}))}))},e.prototype.loadImageFromRemoteUrl=function(t,e){return void 0===e&&(e=void 0),f(this,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return[4,this._apiClient.getImageMetaDataFromRemoteUrl(t,e)];case 1:return n=r.sent(),this.item.source.id=n.storageId,this.item.source.width=n.size.width,this.item.source.height=n.size.height,this.item.source.isVector=n.isVector,this.item.name=n.name,this.item.sourceRectangle.width=this.item.source.width,this.item.sourceRectangle.height=this.item.source.height,[2]}}))}))},e.prototype.showEditButton=function(){return t.prototype.showEditToolbarButton.call(this)&&!this.item.source.isVector},e.prototype.addImageResized=function(t){this._imageResizedEvent.add(t)},e.prototype.removeImageResized=function(t){this._imageResizedEvent.remove(t)},e.prototype.onResized=function(){var e=this.rectangle;return this._imageResizedEvent.notify(this,{Width:e.width,Height:e.height}),this.update(),t.prototype.onResized.call(this)},e.prototype.setQualityChangeScaleBarWidth=function(t){null!=this._qualityChangeScaleBar&&(t=Math.max(0,t),t=Math.min(100,t),this._qualityChangeScaleBar.style.width=t+"%")},e.prototype.setQualityChangeInfoBarText=function(t){null!=this._qualityChangeInfoBar&&(this._qualityChangeInfoBar.innerText=t)},e.prototype.setBadToWarningChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityBadToWarningChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityWarningToGoodChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityBadToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.setWarningToGoodChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityWarningToGoodChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityBadToWarningChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityBadToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.setBadToGoodChangeScaleBarClass=function(){var t=this.canvas;if(null!=this._qualityChangeScaleBar&&null!=t){var e=this._qualityChangeScaleBar.getAttribute("class"),n=t.qualityBadToGoodChangeScaleBarCssClass;null!=n&&""!==n&&this._qualityChangeScaleBar.classList.toggle(n,!0);var r=t.qualityBadToWarningChangeScaleBarCssClass;null!=r&&""!==r&&this._qualityChangeScaleBar.classList.toggle(r,!1);var i=t.qualityWarningToGoodChangeScaleBarCssClass;null!=i&&""!==i&&this._qualityChangeScaleBar.classList.toggle(i,!1);var o=t.qualityNoAnimationChangeScaleBarCssClass;null!=o&&""!==o&&this._qualityChangeScaleBar.classList.toggle(o,this._qualityChangeScaleBar.getAttribute("class")!==e),this.canvas.updateViolationContainer(this)}},e.prototype.updateRectangle=function(e,n,r,i){t.prototype.updateRectangle.call(this,e,n,r,this.item.source.width,this.item.source.height,i)},e.prototype._updateImpl=function(t,e){return f(this,void 0,void 0,(function(){var n,r=this;return d(this,(function(i){return null!=this._sourceUrl&&null!=this._sourceUrl?(this._update([this._actualSize,this._saveAspectRatio,this._sourceUrl],t,e),null==this.item.source.id&&null!=this.item.source.url&&this.updateRectangle(!1,null!=this.item.parentPlaceholder?this.item.parentPlaceholder.contentResizeMode:null,this.parentPlaceholder)):this.item.source.type===a.J.ImageSourceType.Url?this.loadImage(null,{downloadToServerCache:!0,actualSize:this.item.source.actualSize,saveAspectRatio:this.item.source.saveAspectRatio}).then((function(){null!=r.canvas&&r.canvas.updateSelection()})):(this.quickUpdate(),null!=(n=this.canvas)&&n.updateSelection()),[2]}))}))},e.prototype._getDrawingFillColor=function(){return this.item.effect===a.I.Colorize?c.f.transparent:this.item.fillColor},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n);var r=null==this.item.source.id&&null!=this.item.source.url;this.item.source.id=e.source.id,this.item.source.width=e.source.width,this.item.source.height=e.source.height,this.item.source.isVector=e.source.isVector,this.item.source.pageIndex=e.source.pageIndex,this.item.source.url=e.source.url,r&&(this.updateRectangle(!1,null!=this.item.parentPlaceholder?this.item.parentPlaceholder.contentResizeMode:null,this.parentPlaceholder),this.update())},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"source":this._sourceUrl=null,this.update(),null==this.item.source.id&&null!=this.item.source.url&&this.updateRectangle(!1,null!=this.item.parentPlaceholder?this.item.parentPlaceholder.contentResizeMode:null,this.parentPlaceholder);break;case"fillColor":this.item.effect===a.I.Colorize&&this.update();break;case"effect":case"overlayEffect":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips=new a.hb(!0,!1),e},e.prototype._createDataInstance=function(t){return new o.a(t)},e.prototype._updateImageUrl=function(){var e=this,n=this.canvas;if(null!=n&&this.isVisible()){if(null==this.item.source.id||null!=this.item.source.width&&null!=this.item.source.height)return void t.prototype._updateImageUrl.call(this);n.service.GetImageSize(this.item.source.id,this.item.source.pageIndex,(function(n){if(e.item.source.width=n.width,e.item.source.height=n.height,e._saveAspectRatio){var r=e.item.source.width/e.item.source.height;e.width<e.height?e.height=e.width/r:e.width=e.height*r}t.prototype._updateImageUrl.call(e)}),(function(t){window.console&&(console.error("Unable GetimageSize of image with id "+e.item.source.id),console.error(t))}))}},e.prototype._createImageUrl=function(){var t,e,n=this.item.source.id;if(null==n)return null;if(null==this.canvas)return null;var r=this.canvas.zoom,i=r*u.a.screenDpi/72,o=r*u.a.screenDpi/72,a=this.rectangle;t=a.width*i,e=a.height*o;var s=h.a.isUpscaleRequired(this.item.effect),c=h.a.isBackendEffect(this.item.effect),p=this.item.source.id.includes(".pdf")||this.item.source.id.includes(".ai");if(!this.item.source.isVector&&!p)if(s){var f=300*a.width/72,d=300*a.height/72;(t>f||e>d)&&(t=Math.min(t,f),e=Math.min(e,d))}else t=Math.min(t,this.item.source.width),e=Math.min(e,this.item.source.height);var g=this._maxImageSize/t/e;g<1&&(t*=g=Math.sqrt(g),e*=g),t=Math.max(1,Math.round(t)),e=Math.max(1,Math.round(e)),this._pixelWidth=t,this._pixelHeight=e;var m=this._getDitherSettings(),y=m.ditherType,_=m.ditherAmount;return l.a.getImageUrl(this.canvas.renderingConfigProvider,this.canvas.designAtomsApiClient,n,t,e,!1,this.item.effect,!1,this.item.overlayEffect,this.item.source.pageIndex,!this.isNormalRenderingType,this.item.fillColor,c,a.width,a.height,y,_)},e.prototype._getColorLessContainer=function(){var t;return this.item.parentContainer instanceof c.c?this.item.parentContainer:(null===(t=this.item.parentPlaceholder)||void 0===t?void 0:t.parentContainer)instanceof c.c?this.item.parentPlaceholder.parentContainer:null},e.prototype._getDitherSettings=function(){var t=this._getColorLessContainer();return t?{ditherType:null!=t.dither?t.dither.toString():null,ditherAmount:null!=t.amount?t.amount:null}:{ditherType:null,ditherAmount:null}},e.typeName="ImageItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(513),o=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=t.call(this,e)||this;return n.__type="ShapeHandlerData",n}return o(e,t),e.prototype.applyState=function(e,n){t.prototype.applyState.call(this,e,n)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s}));var r,i=n(480),o=n(583);!function(t){t[t.numbers=0]="numbers",t[t.lowerLetter=1]="lowerLetter",t[t.upperLetter=2]="upperLetter",t[t.lowerRoman=3]="lowerRoman",t[t.upperRoman=4]="upperRoman"}(r||(r={}));class a extends o.a{isMatch(t){return t instanceof a&&!!super.isMatch(t)&&this.type===t.type}}class s extends i.a{constructor(){super(...arguments),this.items=[]}}},,function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return Sn})),n.d(e,"VERSION",(function(){return i.e})),n.d(e,"restArguments",(function(){return o})),n.d(e,"isObject",(function(){return a})),n.d(e,"isNull",(function(){return s})),n.d(e,"isUndefined",(function(){return l})),n.d(e,"isBoolean",(function(){return u})),n.d(e,"isElement",(function(){return c})),n.d(e,"isString",(function(){return p})),n.d(e,"isNumber",(function(){return f})),n.d(e,"isDate",(function(){return d})),n.d(e,"isRegExp",(function(){return g})),n.d(e,"isError",(function(){return m})),n.d(e,"isSymbol",(function(){return y})),n.d(e,"isArrayBuffer",(function(){return _})),n.d(e,"isDataView",(function(){return I})),n.d(e,"isArray",(function(){return O})),n.d(e,"isFunction",(function(){return w})),n.d(e,"isArguments",(function(){return R})),n.d(e,"isFinite",(function(){return E})),n.d(e,"isNaN",(function(){return j})),n.d(e,"isTypedArray",(function(){return z})),n.d(e,"isEmpty",(function(){return W})),n.d(e,"isMatch",(function(){return V})),n.d(e,"isEqual",(function(){return Y})),n.d(e,"isMap",(function(){return ot})),n.d(e,"isWeakMap",(function(){return at})),n.d(e,"isSet",(function(){return st})),n.d(e,"isWeakSet",(function(){return lt})),n.d(e,"keys",(function(){return U})),n.d(e,"allKeys",(function(){return J})),n.d(e,"values",(function(){return ut})),n.d(e,"pairs",(function(){return ct})),n.d(e,"invert",(function(){return ht})),n.d(e,"functions",(function(){return pt})),n.d(e,"methods",(function(){return pt})),n.d(e,"extend",(function(){return dt})),n.d(e,"extendOwn",(function(){return gt})),n.d(e,"assign",(function(){return gt})),n.d(e,"defaults",(function(){return mt})),n.d(e,"create",(function(){return _t})),n.d(e,"clone",(function(){return vt})),n.d(e,"tap",(function(){return bt})),n.d(e,"get",(function(){return St})),n.d(e,"has",(function(){return xt})),n.d(e,"mapObject",(function(){return Nt})),n.d(e,"identity",(function(){return It})),n.d(e,"constant",(function(){return N})),n.d(e,"noop",(function(){return kt})),n.d(e,"toPath",(function(){return wt})),n.d(e,"property",(function(){return Tt})),n.d(e,"propertyOf",(function(){return At})),n.d(e,"matcher",(function(){return Ot})),n.d(e,"matches",(function(){return Ot})),n.d(e,"times",(function(){return Ft})),n.d(e,"random",(function(){return Bt})),n.d(e,"now",(function(){return Mt})),n.d(e,"escape",(function(){return Ht})),n.d(e,"unescape",(function(){return Ut})),n.d(e,"templateSettings",(function(){return Wt})),n.d(e,"template",(function(){return Kt})),n.d(e,"result",(function(){return Yt})),n.d(e,"uniqueId",(function(){return Zt})),n.d(e,"chain",(function(){return Qt})),n.d(e,"iteratee",(function(){return Et})),n.d(e,"partial",(function(){return ne})),n.d(e,"bind",(function(){return re})),n.d(e,"bindAll",(function(){return ae})),n.d(e,"memoize",(function(){return se})),n.d(e,"delay",(function(){return le})),n.d(e,"defer",(function(){return ue})),n.d(e,"throttle",(function(){return ce})),n.d(e,"debounce",(function(){return he})),n.d(e,"wrap",(function(){return pe})),n.d(e,"negate",(function(){return fe})),n.d(e,"compose",(function(){return de})),n.d(e,"after",(function(){return ge})),n.d(e,"before",(function(){return me})),n.d(e,"once",(function(){return ye})),n.d(e,"findKey",(function(){return _e})),n.d(e,"findIndex",(function(){return be})),n.d(e,"findLastIndex",(function(){return we})),n.d(e,"sortedIndex",(function(){return Ce})),n.d(e,"indexOf",(function(){return Se})),n.d(e,"lastIndexOf",(function(){return xe})),n.d(e,"find",(function(){return Ie})),n.d(e,"detect",(function(){return Ie})),n.d(e,"findWhere",(function(){return Oe})),n.d(e,"each",(function(){return Te})),n.d(e,"forEach",(function(){return Te})),n.d(e,"map",(function(){return Le})),n.d(e,"collect",(function(){return Le})),n.d(e,"reduce",(function(){return Ee})),n.d(e,"foldl",(function(){return Ee})),n.d(e,"inject",(function(){return Ee})),n.d(e,"reduceRight",(function(){return je})),n.d(e,"foldr",(function(){return je})),n.d(e,"filter",(function(){return Ne})),n.d(e,"select",(function(){return Ne})),n.d(e,"reject",(function(){return ke})),n.d(e,"every",(function(){return Ae})),n.d(e,"all",(function(){return Ae})),n.d(e,"some",(function(){return Fe})),n.d(e,"any",(function(){return Fe})),n.d(e,"contains",(function(){return Be})),n.d(e,"includes",(function(){return Be})),n.d(e,"include",(function(){return Be})),n.d(e,"invoke",(function(){return Me})),n.d(e,"pluck",(function(){return ze})),n.d(e,"where",(function(){return De})),n.d(e,"max",(function(){return He})),n.d(e,"min",(function(){return Ue})),n.d(e,"shuffle",(function(){return Ge})),n.d(e,"sample",(function(){return qe})),n.d(e,"sortBy",(function(){return $e})),n.d(e,"groupBy",(function(){return Ke})),n.d(e,"indexBy",(function(){return Ye})),n.d(e,"countBy",(function(){return Je})),n.d(e,"partition",(function(){return Ze})),n.d(e,"toArray",(function(){return Ve})),n.d(e,"size",(function(){return Qe})),n.d(e,"pick",(function(){return en})),n.d(e,"omit",(function(){return nn})),n.d(e,"first",(function(){return on})),n.d(e,"head",(function(){return on})),n.d(e,"take",(function(){return on})),n.d(e,"initial",(function(){return rn})),n.d(e,"last",(function(){return sn})),n.d(e,"rest",(function(){return an})),n.d(e,"tail",(function(){return an})),n.d(e,"drop",(function(){return an})),n.d(e,"compact",(function(){return ln})),n.d(e,"flatten",(function(){return un})),n.d(e,"without",(function(){return hn})),n.d(e,"uniq",(function(){return pn})),n.d(e,"unique",(function(){return pn})),n.d(e,"union",(function(){return fn})),n.d(e,"intersection",(function(){return dn})),n.d(e,"difference",(function(){return cn})),n.d(e,"unzip",(function(){return gn})),n.d(e,"transpose",(function(){return gn})),n.d(e,"zip",(function(){return mn})),n.d(e,"object",(function(){return yn})),n.d(e,"range",(function(){return _n})),n.d(e,"chunk",(function(){return vn})),n.d(e,"mixin",(function(){return wn}));var r={};n.r(r),n.d(r,"VERSION",(function(){return i.e})),n.d(r,"restArguments",(function(){return o})),n.d(r,"isObject",(function(){return a})),n.d(r,"isNull",(function(){return s})),n.d(r,"isUndefined",(function(){return l})),n.d(r,"isBoolean",(function(){return u})),n.d(r,"isElement",(function(){return c})),n.d(r,"isString",(function(){return p})),n.d(r,"isNumber",(function(){return f})),n.d(r,"isDate",(function(){return d})),n.d(r,"isRegExp",(function(){return g})),n.d(r,"isError",(function(){return m})),n.d(r,"isSymbol",(function(){return y})),n.d(r,"isArrayBuffer",(function(){return _})),n.d(r,"isDataView",(function(){return I})),n.d(r,"isArray",(function(){return O})),n.d(r,"isFunction",(function(){return w})),n.d(r,"isArguments",(function(){return R})),n.d(r,"isFinite",(function(){return E})),n.d(r,"isNaN",(function(){return j})),n.d(r,"isTypedArray",(function(){return z})),n.d(r,"isEmpty",(function(){return W})),n.d(r,"isMatch",(function(){return V})),n.d(r,"isEqual",(function(){return Y})),n.d(r,"isMap",(function(){return ot})),n.d(r,"isWeakMap",(function(){return at})),n.d(r,"isSet",(function(){return st})),n.d(r,"isWeakSet",(function(){return lt})),n.d(r,"keys",(function(){return U})),n.d(r,"allKeys",(function(){return J})),n.d(r,"values",(function(){return ut})),n.d(r,"pairs",(function(){return ct})),n.d(r,"invert",(function(){return ht})),n.d(r,"functions",(function(){return pt})),n.d(r,"methods",(function(){return pt})),n.d(r,"extend",(function(){return dt})),n.d(r,"extendOwn",(function(){return gt})),n.d(r,"assign",(function(){return gt})),n.d(r,"defaults",(function(){return mt})),n.d(r,"create",(function(){return _t})),n.d(r,"clone",(function(){return vt})),n.d(r,"tap",(function(){return bt})),n.d(r,"get",(function(){return St})),n.d(r,"has",(function(){return xt})),n.d(r,"mapObject",(function(){return Nt})),n.d(r,"identity",(function(){return It})),n.d(r,"constant",(function(){return N})),n.d(r,"noop",(function(){return kt})),n.d(r,"toPath",(function(){return wt})),n.d(r,"property",(function(){return Tt})),n.d(r,"propertyOf",(function(){return At})),n.d(r,"matcher",(function(){return Ot})),n.d(r,"matches",(function(){return Ot})),n.d(r,"times",(function(){return Ft})),n.d(r,"random",(function(){return Bt})),n.d(r,"now",(function(){return Mt})),n.d(r,"escape",(function(){return Ht})),n.d(r,"unescape",(function(){return Ut})),n.d(r,"templateSettings",(function(){return Wt})),n.d(r,"template",(function(){return Kt})),n.d(r,"result",(function(){return Yt})),n.d(r,"uniqueId",(function(){return Zt})),n.d(r,"chain",(function(){return Qt})),n.d(r,"iteratee",(function(){return Et})),n.d(r,"partial",(function(){return ne})),n.d(r,"bind",(function(){return re})),n.d(r,"bindAll",(function(){return ae})),n.d(r,"memoize",(function(){return se})),n.d(r,"delay",(function(){return le})),n.d(r,"defer",(function(){return ue})),n.d(r,"throttle",(function(){return ce})),n.d(r,"debounce",(function(){return he})),n.d(r,"wrap",(function(){return pe})),n.d(r,"negate",(function(){return fe})),n.d(r,"compose",(function(){return de})),n.d(r,"after",(function(){return ge})),n.d(r,"before",(function(){return me})),n.d(r,"once",(function(){return ye})),n.d(r,"findKey",(function(){return _e})),n.d(r,"findIndex",(function(){return be})),n.d(r,"findLastIndex",(function(){return we})),n.d(r,"sortedIndex",(function(){return Ce})),n.d(r,"indexOf",(function(){return Se})),n.d(r,"lastIndexOf",(function(){return xe})),n.d(r,"find",(function(){return Ie})),n.d(r,"detect",(function(){return Ie})),n.d(r,"findWhere",(function(){return Oe})),n.d(r,"each",(function(){return Te})),n.d(r,"forEach",(function(){return Te})),n.d(r,"map",(function(){return Le})),n.d(r,"collect",(function(){return Le})),n.d(r,"reduce",(function(){return Ee})),n.d(r,"foldl",(function(){return Ee})),n.d(r,"inject",(function(){return Ee})),n.d(r,"reduceRight",(function(){return je})),n.d(r,"foldr",(function(){return je})),n.d(r,"filter",(function(){return Ne})),n.d(r,"select",(function(){return Ne})),n.d(r,"reject",(function(){return ke})),n.d(r,"every",(function(){return Ae})),n.d(r,"all",(function(){return Ae})),n.d(r,"some",(function(){return Fe})),n.d(r,"any",(function(){return Fe})),n.d(r,"contains",(function(){return Be})),n.d(r,"includes",(function(){return Be})),n.d(r,"include",(function(){return Be})),n.d(r,"invoke",(function(){return Me})),n.d(r,"pluck",(function(){return ze})),n.d(r,"where",(function(){return De})),n.d(r,"max",(function(){return He})),n.d(r,"min",(function(){return Ue})),n.d(r,"shuffle",(function(){return Ge})),n.d(r,"sample",(function(){return qe})),n.d(r,"sortBy",(function(){return $e})),n.d(r,"groupBy",(function(){return Ke})),n.d(r,"indexBy",(function(){return Ye})),n.d(r,"countBy",(function(){return Je})),n.d(r,"partition",(function(){return Ze})),n.d(r,"toArray",(function(){return Ve})),n.d(r,"size",(function(){return Qe})),n.d(r,"pick",(function(){return en})),n.d(r,"omit",(function(){return nn})),n.d(r,"first",(function(){return on})),n.d(r,"head",(function(){return on})),n.d(r,"take",(function(){return on})),n.d(r,"initial",(function(){return rn})),n.d(r,"last",(function(){return sn})),n.d(r,"rest",(function(){return an})),n.d(r,"tail",(function(){return an})),n.d(r,"drop",(function(){return an})),n.d(r,"compact",(function(){return ln})),n.d(r,"flatten",(function(){return un})),n.d(r,"without",(function(){return hn})),n.d(r,"uniq",(function(){return pn})),n.d(r,"unique",(function(){return pn})),n.d(r,"union",(function(){return fn})),n.d(r,"intersection",(function(){return dn})),n.d(r,"difference",(function(){return cn})),n.d(r,"unzip",(function(){return gn})),n.d(r,"transpose",(function(){return gn})),n.d(r,"zip",(function(){return mn})),n.d(r,"object",(function(){return yn})),n.d(r,"range",(function(){return _n})),n.d(r,"chunk",(function(){return vn})),n.d(r,"mixin",(function(){return wn})),n.d(r,"default",(function(){return Cn}));var i=n(414);function o(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}}function a(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function s(t){return null===t}function l(t){return void 0===t}function u(t){return!0===t||!1===t||"[object Boolean]"===i.t.call(t)}function c(t){return!(!t||1!==t.nodeType)}function h(t){var e="[object "+t+"]";return function(t){return i.t.call(t)===e}}var p=h("String"),f=h("Number"),d=h("Date"),g=h("RegExp"),m=h("Error"),y=h("Symbol"),_=h("ArrayBuffer"),v=h("Function"),b=i.p.document&&i.p.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof b&&(v=function(t){return"function"==typeof t||!1});var w=v,C=h("Object"),P=i.s&&C(new DataView(new ArrayBuffer(8))),S="undefined"!=typeof Map&&C(new Map),x=h("DataView"),I=P?function(t){return null!=t&&w(t.getInt8)&&_(t.buffer)}:x,O=i.k||h("Array");function T(t,e){return null!=t&&i.i.call(t,e)}var L=h("Arguments");!function(){L(arguments)||(L=function(t){return T(t,"callee")})}();var R=L;function E(t){return!y(t)&&Object(i.f)(t)&&!isNaN(parseFloat(t))}function j(t){return f(t)&&Object(i.g)(t)}function N(t){return function(){return t}}function k(t){return function(e){var n=t(e);return"number"==typeof n&&n>=0&&n<=i.b}}function A(t){return function(e){return null==e?void 0:e[t]}}var F=A("byteLength"),B=k(F),M=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,z=i.r?function(t){return i.l?Object(i.l)(t)&&!I(t):B(t)&&M.test(i.t.call(t))}:N(!1),D=A("length");function H(t,e){e=function(t){for(var e={},n=t.length,r=0;r<n;++r)e[t[r]]=!0;return{contains:function(t){return!0===e[t]},push:function(n){return e[n]=!0,t.push(n)}}}(e);var n=i.n.length,r=t.constructor,o=w(r)&&r.prototype||i.c,a="constructor";for(T(t,a)&&!e.contains(a)&&e.push(a);n--;)(a=i.n[n])in t&&t[a]!==o[a]&&!e.contains(a)&&e.push(a)}function U(t){if(!a(t))return[];if(i.m)return Object(i.m)(t);var e=[];for(var n in t)T(t,n)&&e.push(n);return i.h&&H(t,e),e}function W(t){if(null==t)return!0;var e=D(t);return"number"==typeof e&&(O(t)||p(t)||R(t))?0===e:0===D(U(t))}function V(t,e){var n=U(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0}function q(t){return t instanceof q?t:this instanceof q?void(this._wrapped=t):new q(t)}function G(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,F(t))}q.VERSION=i.e,q.prototype.value=function(){return this._wrapped},q.prototype.valueOf=q.prototype.toJSON=q.prototype.value,q.prototype.toString=function(){return String(this._wrapped)};var $="[object DataView]";function X(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&K(t,e,n,r)}function K(t,e,n,r){t instanceof q&&(t=t._wrapped),e instanceof q&&(e=e._wrapped);var o=i.t.call(t);if(o!==i.t.call(e))return!1;if(P&&"[object Object]"==o&&I(t)){if(!I(e))return!1;o=$}switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return i.d.valueOf.call(t)===i.d.valueOf.call(e);case"[object ArrayBuffer]":case $:return K(G(t),G(e),n,r)}var a="[object Array]"===o;if(!a&&z(t)){if(F(t)!==F(e))return!1;if(t.buffer===e.buffer&&t.byteOffset===e.byteOffset)return!0;a=!0}if(!a){if("object"!=typeof t||"object"!=typeof e)return!1;var s=t.constructor,l=e.constructor;if(s!==l&&!(w(s)&&s instanceof s&&w(l)&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===t)return r[u]===e;if(n.push(t),r.push(e),a){if((u=t.length)!==e.length)return!1;for(;u--;)if(!X(t[u],e[u],n,r))return!1}else{var c,h=U(t);if(u=h.length,U(e).length!==u)return!1;for(;u--;)if(!T(e,c=h[u])||!X(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0}function Y(t,e){return X(t,e)}function J(t){if(!a(t))return[];var e=[];for(var n in t)e.push(n);return i.h&&H(t,e),e}function Z(t){var e=D(t);return function(n){if(null==n)return!1;var r=J(n);if(D(r))return!1;for(var i=0;i<e;i++)if(!w(n[t[i]]))return!1;return t!==rt||!w(n[Q])}}var Q="forEach",tt=["clear","delete"],et=["get","has","set"],nt=tt.concat(Q,et),rt=tt.concat(et),it=["add"].concat(tt,Q,"has"),ot=S?Z(nt):h("Map"),at=S?Z(rt):h("WeakMap"),st=S?Z(it):h("Set"),lt=h("WeakSet");function ut(t){for(var e=U(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r}function ct(t){for(var e=U(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r}function ht(t){for(var e={},n=U(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e}function pt(t){var e=[];for(var n in t)w(t[n])&&e.push(n);return e.sort()}function ft(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,l=0;l<s;l++){var u=a[l];e&&void 0!==n[u]||(n[u]=o[u])}return n}}var dt=ft(J),gt=ft(U),mt=ft(J,!0);function yt(t){if(!a(t))return{};if(i.j)return Object(i.j)(t);var e=function(){};e.prototype=t;var n=new e;return e.prototype=null,n}function _t(t,e){var n=yt(t);return e&>(n,e),n}function vt(t){return a(t)?O(t)?t.slice():dt({},t):t}function bt(t,e){return e(t),t}function wt(t){return O(t)?t:[t]}function Ct(t){return q.toPath(t)}function Pt(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function St(t,e,n){var r=Pt(t,Ct(e));return l(r)?n:r}function xt(t,e){for(var n=(e=Ct(e)).length,r=0;r<n;r++){var i=e[r];if(!T(t,i))return!1;t=t[i]}return!!n}function It(t){return t}function Ot(t){return t=gt({},t),function(e){return V(e,t)}}function Tt(t){return t=Ct(t),function(e){return Pt(e,t)}}function Lt(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}}function Rt(t,e,n){return null==t?It:w(t)?Lt(t,e,n):a(t)&&!O(t)?Ot(t):Tt(t)}function Et(t,e){return Rt(t,e,1/0)}function jt(t,e,n){return q.iteratee!==Et?q.iteratee(t,e):Rt(t,e,n)}function Nt(t,e,n){e=jt(e,n);for(var r=U(t),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=e(t[s],s,t)}return o}function kt(){}function At(t){return null==t?kt:function(e){return St(t,e)}}function Ft(t,e,n){var r=Array(Math.max(0,t));e=Lt(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r}function Bt(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}q.toPath=wt,q.iteratee=Et;var Mt=Date.now||function(){return(new Date).getTime()};function zt(t){var e=function(e){return t[e]},n="(?:"+U(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}}var Dt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ht=zt(Dt),Ut=zt(ht(Dt)),Wt=q.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Vt=/(.)^/,qt={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Gt=/\\|'|\r|\n|\u2028|\u2029/g;function $t(t){return"\\"+qt[t]}var Xt=/^\s*(\w|\$)+\s*$/;function Kt(t,e,n){!e&&n&&(e=n),e=mt({},e,q.templateSettings);var r=RegExp([(e.escape||Vt).source,(e.interpolate||Vt).source,(e.evaluate||Vt).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,(function(e,n,r,a,s){return o+=t.slice(i,s).replace(Gt,$t),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e})),o+="';\n";var a,s=e.variable;if(s){if(!Xt.test(s))throw new Error("variable is not a bare identifier: "+s)}else o="with(obj||{}){\n"+o+"}\n",s="obj";o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{a=new Function(s,"_",o)}catch(u){throw u.source=o,u}var l=function(t){return a.call(this,t,q)};return l.source="function("+s+"){\n"+o+"}",l}function Yt(t,e,n){var r=(e=Ct(e)).length;if(!r)return w(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=w(o)?o.call(t):o}return t}var Jt=0;function Zt(t){var e=++Jt+"";return t?t+e:e}function Qt(t){var e=q(t);return e._chain=!0,e}function te(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=yt(t.prototype),s=t.apply(o,i);return a(s)?s:o}var ee=o((function(t,e){var n=ee.placeholder,r=function(){for(var i=0,o=e.length,a=Array(o),s=0;s<o;s++)a[s]=e[s]===n?arguments[i++]:e[s];for(;i<arguments.length;)a.push(arguments[i++]);return te(t,r,this,this,a)};return r}));ee.placeholder=q;var ne=ee,re=o((function(t,e,n){if(!w(t))throw new TypeError("Bind must be called on a function");var r=o((function(i){return te(t,r,e,this,n.concat(i))}));return r})),ie=k(D);function oe(t,e,n,r){if(r=r||[],e||0===e){if(e<=0)return r.concat(t)}else e=1/0;for(var i=r.length,o=0,a=D(t);o<a;o++){var s=t[o];if(ie(s)&&(O(s)||R(s)))if(e>1)oe(s,e-1,n,r),i=r.length;else for(var l=0,u=s.length;l<u;)r[i++]=s[l++];else n||(r[i++]=s)}return r}var ae=o((function(t,e){var n=(e=oe(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=re(t[r],t)}return t}));function se(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return T(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n}var le=o((function(t,e,n){return setTimeout((function(){return t.apply(null,n)}),e)})),ue=ne(le,q,1);function ce(t,e,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:Mt(),r=null,a=t.apply(i,o),r||(i=o=null)},u=function(){var u=Mt();s||!1!==n.leading||(s=u);var c=e-(u-s);return i=this,o=arguments,c<=0||c>e?(r&&(clearTimeout(r),r=null),s=u,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,c)),a};return u.cancel=function(){clearTimeout(r),s=0,r=i=o=null},u}function he(t,e,n){var r,i,a,s,l,u=function(){var o=Mt()-i;e>o?r=setTimeout(u,e-o):(r=null,n||(s=t.apply(l,a)),r||(a=l=null))},c=o((function(o){return l=this,a=o,i=Mt(),r||(r=setTimeout(u,e),n&&(s=t.apply(l,a))),s}));return c.cancel=function(){clearTimeout(r),r=a=l=null},c}function pe(t,e){return ne(e,t)}function fe(t){return function(){return!t.apply(this,arguments)}}function de(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function ge(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function me(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}var ye=ne(me,2);function _e(t,e,n){e=jt(e,n);for(var r,i=U(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r}function ve(t){return function(e,n,r){n=jt(n,r);for(var i=D(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}}var be=ve(1),we=ve(-1);function Ce(t,e,n,r){for(var i=(n=jt(n,r,1))(e),o=0,a=D(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o}function Pe(t,e,n){return function(r,o,a){var s=0,l=D(r);if("number"==typeof a)t>0?s=a>=0?a:Math.max(a+l,s):l=a>=0?Math.min(a+1,l):a+l+1;else if(n&&a&&l)return r[a=n(r,o)]===o?a:-1;if(o!=o)return(a=e(i.q.call(r,s,l),j))>=0?a+s:-1;for(a=t>0?s:l-1;a>=0&&a<l;a+=t)if(r[a]===o)return a;return-1}}var Se=Pe(1,be,Ce),xe=Pe(-1,we);function Ie(t,e,n){var r=(ie(t)?be:_e)(t,e,n);if(void 0!==r&&-1!==r)return t[r]}function Oe(t,e){return Ie(t,Ot(e))}function Te(t,e,n){var r,i;if(e=Lt(e,n),ie(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=U(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t}function Le(t,e,n){e=jt(e,n);for(var r=!ie(t)&&U(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o}function Re(t){return function(e,n,r,i){var o=arguments.length>=3;return function(e,n,r,i){var o=!ie(e)&&U(e),a=(o||e).length,s=t>0?0:a-1;for(i||(r=e[o?o[s]:s],s+=t);s>=0&&s<a;s+=t){var l=o?o[s]:s;r=n(r,e[l],l,e)}return r}(e,Lt(n,i,4),r,o)}}var Ee=Re(1),je=Re(-1);function Ne(t,e,n){var r=[];return e=jt(e,n),Te(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function ke(t,e,n){return Ne(t,fe(jt(e)),n)}function Ae(t,e,n){e=jt(e,n);for(var r=!ie(t)&&U(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0}function Fe(t,e,n){e=jt(e,n);for(var r=!ie(t)&&U(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1}function Be(t,e,n,r){return ie(t)||(t=ut(t)),("number"!=typeof n||r)&&(n=0),Se(t,e,n)>=0}var Me=o((function(t,e,n){var r,i;return w(e)?i=e:(e=Ct(e),r=e.slice(0,-1),e=e[e.length-1]),Le(t,(function(t){var o=i;if(!o){if(r&&r.length&&(t=Pt(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)}))}));function ze(t,e){return Le(t,Tt(e))}function De(t,e){return Ne(t,Ot(e))}function He(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=ie(t)?t:ut(t)).length;s<l;s++)null!=(r=t[s])&&r>o&&(o=r);else e=jt(e,n),Te(t,(function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o}function Ue(t,e,n){var r,i,o=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=ie(t)?t:ut(t)).length;s<l;s++)null!=(r=t[s])&&r<o&&(o=r);else e=jt(e,n),Te(t,(function(t,n,r){((i=e(t,n,r))<a||i===1/0&&o===1/0)&&(o=t,a=i)}));return o}var We=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Ve(t){return t?O(t)?i.q.call(t):p(t)?t.match(We):ie(t)?Le(t,It):ut(t):[]}function qe(t,e,n){if(null==e||n)return ie(t)||(t=ut(t)),t[Bt(t.length-1)];var r=Ve(t),i=D(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a<e;a++){var s=Bt(a,o),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,e)}function Ge(t){return qe(t,1/0)}function $e(t,e,n){var r=0;return e=jt(e,n),ze(Le(t,(function(t,n,i){return{value:t,index:r++,criteria:e(t,n,i)}})).sort((function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index})),"value")}function Xe(t,e){return function(n,r,i){var o=e?[[],[]]:{};return r=jt(r,i),Te(n,(function(e,i){var a=r(e,i,n);t(o,e,a)})),o}}var Ke=Xe((function(t,e,n){T(t,n)?t[n].push(e):t[n]=[e]})),Ye=Xe((function(t,e,n){t[n]=e})),Je=Xe((function(t,e,n){T(t,n)?t[n]++:t[n]=1})),Ze=Xe((function(t,e,n){t[n?0:1].push(e)}),!0);function Qe(t){return null==t?0:ie(t)?t.length:U(t).length}function tn(t,e,n){return e in n}var en=o((function(t,e){var n={},r=e[0];if(null==t)return n;w(r)?(e.length>1&&(r=Lt(r,e[1])),e=J(t)):(r=tn,e=oe(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var a=e[i],s=t[a];r(s,a,t)&&(n[a]=s)}return n})),nn=o((function(t,e){var n,r=e[0];return w(r)?(r=fe(r),e.length>1&&(n=e[1])):(e=Le(oe(e,!1,!1),String),r=function(t,n){return!Be(e,n)}),en(t,r,n)}));function rn(t,e,n){return i.q.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function on(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:rn(t,t.length-e)}function an(t,e,n){return i.q.call(t,null==e||n?1:e)}function sn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:an(t,Math.max(0,t.length-e))}function ln(t){return Ne(t,Boolean)}function un(t,e){return oe(t,e,!1)}var cn=o((function(t,e){return e=oe(e,!0,!0),Ne(t,(function(t){return!Be(e,t)}))})),hn=o((function(t,e){return cn(t,e)}));function pn(t,e,n,r){u(e)||(r=n,n=e,e=!1),null!=n&&(n=jt(n,r));for(var i=[],o=[],a=0,s=D(t);a<s;a++){var l=t[a],c=n?n(l,a,t):l;e&&!n?(a&&o===c||i.push(l),o=c):n?Be(o,c)||(o.push(c),i.push(l)):Be(i,l)||i.push(l)}return i}var fn=o((function(t){return pn(oe(t,!0,!0))}));function dn(t){for(var e=[],n=arguments.length,r=0,i=D(t);r<i;r++){var o=t[r];if(!Be(e,o)){var a;for(a=1;a<n&&Be(arguments[a],o);a++);a===n&&e.push(o)}}return e}function gn(t){for(var e=t&&He(t,D).length||0,n=Array(e),r=0;r<e;r++)n[r]=ze(t,r);return n}var mn=o(gn);function yn(t,e){for(var n={},r=0,i=D(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n}function _n(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i}function vn(t,e){if(null==e||e<1)return[];for(var n=[],r=0,o=t.length;r<o;)n.push(i.q.call(t,r,r+=e));return n}function bn(t,e){return t._chain?q(e).chain():e}function wn(t){return Te(pt(t),(function(e){var n=q[e]=t[e];q.prototype[e]=function(){var t=[this._wrapped];return i.o.apply(t,arguments),bn(this,n.apply(q,t))}})),q}Te(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=i.a[t];q.prototype[t]=function(){var n=this._wrapped;return null!=n&&(e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),bn(this,n)}})),Te(["concat","join","slice"],(function(t){var e=i.a[t];q.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),bn(this,t)}}));var Cn=q,Pn=wn(r);Pn._=Pn;var Sn=Pn},function(t,e,n){"use strict";n.r(e),n.d(e,"InteractiveZone",(function(){return l})),n.d(e,"CornerRadiusConverter",(function(){return u.a})),n.d(e,"ItemsMetadata",(function(){return c.a})),n.d(e,"itemsMetadata",(function(){return c.e})),n.d(e,"Property",(function(){return c.b})),n.d(e,"checkType",(function(){return c.d})),n.d(e,"PropertyChanged",(function(){return c.c})),n.d(e,"IPdfFormat",(function(){return i})),n.d(e,"BaseItem",(function(){return h.n})),n.d(e,"SmartItem",(function(){return h.ob})),n.d(e,"Item",(function(){return h.N})),n.d(e,"ShapeItem",(function(){return h.kb})),n.d(e,"ContentItem",(function(){return h.u})),n.d(e,"BaseTextItem",(function(){return h.o})),n.d(e,"BlendMode",(function(){return h.p})),n.d(e,"AutoScaledTextItem",(function(){return h.g})),n.d(e,"BarcodeItem",(function(){return h.k})),n.d(e,"EncodingOptions",(function(){return h.B})),n.d(e,"BarcodeFormat",(function(){return h.j})),n.d(e,"BarcodeSubType",(function(){return h.m})),n.d(e,"VCardAddress",(function(){return h.ub})),n.d(e,"BarcodeData",(function(){return h.i})),n.d(e,"BarcodePermissions",(function(){return h.l})),n.d(e,"BoundedTextItem",(function(){return h.q})),n.d(e,"ClipartItem",(function(){return h.r})),n.d(e,"ColorGroup",(function(){return h.s})),n.d(e,"ColorGroupTarget",(function(){return h.t})),n.d(e,"ItemColorProperty",(function(){return h.O})),n.d(e,"ContentPermissions",(function(){return h.v})),n.d(e,"CurvedTextItem",(function(){return h.x})),n.d(e,"DashedLineItem",(function(){return h.y})),n.d(e,"EllipseItem",(function(){return h.A})),n.d(e,"FrontendPermissions",(function(){return h.E})),n.d(e,"GroupItem",(function(){return h.G})),n.d(e,"GridItem",(function(){return h.F})),n.d(e,"ImageEffect",(function(){return h.I})),n.d(e,"ImageItem",(function(){return h.J})),n.d(e,"ImageMetaData",(function(){return h.K})),n.d(e,"ImagePermissions",(function(){return h.L})),n.d(e,"InStringPlaceholder",(function(){return h.M})),n.d(e,"ItemPermissions",(function(){return h.P})),n.d(e,"ItemToolbarPermissions",(function(){return h.Q})),n.d(e,"LayoutItem",(function(){return h.R})),n.d(e,"LayoutType",(function(){return h.S})),n.d(e,"AutoLayoutAlignItems",(function(){return h.b})),n.d(e,"AutoLayoutOrientation",(function(){return h.e})),n.d(e,"AutoLayoutJustifyContent",(function(){return h.d})),n.d(e,"AutoLayoutAnchorPoint",(function(){return h.c})),n.d(e,"DefaultLayoutSettings",(function(){return h.z})),n.d(e,"AutoLayoutSettings",(function(){return h.f})),n.d(e,"LineItem",(function(){return h.T})),n.d(e,"LinePermissions",(function(){return h.V})),n.d(e,"ManipulationPermissions",(function(){return h.W})),n.d(e,"OverlayEffect",(function(){return h.Y})),n.d(e,"ParagraphSettings",(function(){return h.Z})),n.d(e,"PathBoundedTextItem",(function(){return h.ab})),n.d(e,"PathBoundedTextPermissions",(function(){return h.bb})),n.d(e,"VerticalContentAlignment",(function(){return h.vb})),n.d(e,"HorizontalContentAlignment",(function(){return h.H})),n.d(e,"ResizeMode",(function(){return h.ib})),n.d(e,"PlaceholderItem",(function(){return h.cb})),n.d(e,"PlaceholderPermissions",(function(){return h.db})),n.d(e,"PlainTextItem",(function(){return h.eb})),n.d(e,"PolylineItem",(function(){return h.fb})),n.d(e,"RectangleItem",(function(){return h.gb})),n.d(e,"ResizeGripsPermissions",(function(){return h.hb})),n.d(e,"ArchedTextItem",(function(){return h.a})),n.d(e,"ShadowSettings",(function(){return h.jb})),n.d(e,"ShapePermissions",(function(){return h.lb})),n.d(e,"Size",(function(){return h.nb})),n.d(e,"LineJoin",(function(){return h.U})),n.d(e,"StrokeSettings",(function(){return h.pb})),n.d(e,"FitMode",(function(){return h.D})),n.d(e,"ShrinkMode",(function(){return h.mb})),n.d(e,"OverflowStrategy",(function(){return h.X})),n.d(e,"TextAlignment",(function(){return h.qb})),n.d(e,"TextVerticalAlignment",(function(){return h.sb})),n.d(e,"FirstBaselineOffset",(function(){return h.C})),n.d(e,"AutoSizeMode",(function(){return h.h})),n.d(e,"CopyFittingMode",(function(){return h.w})),n.d(e,"TextPermissions",(function(){return h.rb})),n.d(e,"ThemeBinding",(function(){return h.tb})),n.d(e,"VisualizationPermissions",(function(){return h.wb})),n.d(e,"WrappingMode",(function(){return h.xb})),n.d(e,"FontSettingsData",(function(){return p})),n.d(e,"ShadowSettingsData",(function(){return f})),n.d(e,"StrokeSettingsData",(function(){return d})),n.d(e,"ItemData",(function(){return g})),n.d(e,"Container",(function(){return m.b})),n.d(e,"MockupContainer",(function(){return m.e})),n.d(e,"SurfaceContainer",(function(){return m.g})),n.d(e,"ColorLessContainer",(function(){return m.a})),n.d(e,"LimitedColorContainer",(function(){return m.d})),n.d(e,"FullColorContainer",(function(){return m.c})),n.d(e,"SpotColorContainer",(function(){return m.f})),n.d(e,"TextureContainer",(function(){return m.h})),n.d(e,"CropMark",(function(){return y.a})),n.d(e,"CropMarkTextAlignment",(function(){return y.c})),n.d(e,"CropMarkText",(function(){return y.b})),n.d(e,"ItemMask",(function(){return _.a})),n.d(e,"ModelComponent",(function(){return o.a})),n.d(e,"PrintArea",(function(){return v.a})),n.d(e,"PrintAreaBoundsType",(function(){return b.a})),n.d(e,"Product",(function(){return w.a})),n.d(e,"RenderingType",(function(){return C.a})),n.d(e,"PdfBox",(function(){return P.a})),n.d(e,"SafetyLine",(function(){return P.b})),n.d(e,"Surface",(function(){return S.a})),n.d(e,"SurfaceMockup",(function(){return x.a})),n.d(e,"Uuid",(function(){return I.a})),n.d(e,"Watermark",(function(){return O})),n.d(e,"ContainerVisualization",(function(){return T.b})),n.d(e,"ColorContainerVisualization",(function(){return T.a})),n.d(e,"TextureContainerVisualization",(function(){return T.c})),n.d(e,"PrintingTechniqueConstraints",(function(){return L.a}));var r,i,o=n(423),a=n(409),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),Object.defineProperty(e.prototype,"styleKey",{get:function(){return this._styleKey},set:function(t){Object(a.g)(this._styleKey,t)||(this._styleKey=t,this._propertyChanged.notify(this,"styleKey"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"snappingEnabled",{get:function(){return this._snappingEnabled},set:function(t){this._snappingEnabled!==t&&(this._snappingEnabled=t,this._propertyChanged.notify(this,"snappingEnabled"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._path},set:function(t){Object(a.g)(this._path,t)||(this._path=t,this._propertyChanged.notify(this,"path"))},enumerable:!0,configurable:!0}),e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype._copy=function(e,n,r){var i;t.prototype._copy.call(this,e,n,r),n.snappingEnabled=e.snappingEnabled,n.path=null===(i=e.path)||void 0===i?void 0:i.clone(),n.styleKey=e.styleKey},e}(o.a),u=n(571),c=n(568);!function(t){t[t.Default=0]="Default",t[t.X4=1]="X4"}(i||(i={}));var h=n(410),p=function(){},f=function(){},d=function(){},g=function(){},m=n(458),y=n(572),_=n(496),v=n(573),b=n(488),w=n(574),C=n(493),P=n(512),S=n(510),x=n(511),I=n(489),O=function(){function t(){}return t.prototype.clone=function(){var e=new t;return e.storageId=this.storageId,e.width=this.width,e.height=this.height,e},t}(),T=n(494),L=n(495)},function(t,e,n){"use strict";n.d(e,"b",(function(){return d})),n.d(e,"e",(function(){return g})),n.d(e,"g",(function(){return m})),n.d(e,"a",(function(){return y})),n.d(e,"d",(function(){return _})),n.d(e,"c",(function(){return v})),n.d(e,"f",(function(){return b})),n.d(e,"h",(function(){return w}));var r,i,o=n(423),a=n(416),s=n(421),l=n(493),u=n(494),c=n(495);!function(t){t[t.OneBit=0]="OneBit",t[t.Grayscale=1]="Grayscale",t[t.Vector=2]="Vector"}(r||(r={})),function(t){t[t.None=0]="None",t[t.Diffusion=1]="Diffusion",t[t.Pattern=2]="Pattern",t[t.Noise=3]="Noise"}(i||(i={}));var h,p=(h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},h(t,e)},function(t,e){function n(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(){return f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},f.apply(this,arguments)},d=function(t){function e(n,r){var i=t.call(this)||this;return i.type=e.type,i.parentComponent=null,i._locked=!1,i._items=new s.a,i._visible=!0,i._region=null,i._onItemAdded=function(t){t.item.parentContainer=i},i._onItemRemoved=function(t){var e=t.item;e.parentContainer==i&&(e.parentContainer=null)},i._onRegionChanged=function(t,e){"left"!==e&&"top"!==e&&"width"!==e&&"height"!==e||i._propertyChanged.notify(i,"region")},i._items=new s.a,i._items.add_itemAdded(i._onItemAdded),i._items.add_itemRemoved(i._onItemRemoved),null!=n&&i.items.setRange(n),null!=r&&(i.name=r),i}return p(e,t),Object.defineProperty(e.prototype,"renderingType",{get:function(){return l.a.Normal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"region",{get:function(){return this._region},set:function(t){this._region!==t&&(null!=this._region&&this._region.removePropertyChanged(this._onRegionChanged),this._region=t,this._propertyChanged.notify(this,"region"),null!=this._region&&this._region.addPropertyChanged(this._onRegionChanged))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible!==t&&(this._visible=t,this._propertyChanged.notify(this,"visible"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locked",{get:function(){return this._locked},set:function(t){this._locked!==t&&(this._locked=t,this._propertyChanged.notify(this,"locked"))},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(){var e=t.prototype.getSimplifiedObject.call(this,["parentComponent","version"]);return e.version=this.version,e},e.prototype.generateNewIds=function(){this._generateNewId(),this._items.forEach((function(t){return t.generateNewIds()}))},e.prototype._copy=function(e,n,r){t.prototype._copy.call(this,e,n,r),n.items.addRange(e.items.toArray().map((function(t){return t.clone(r)}))),n.locked=e.locked,n.visible=e.visible,n.translationKey=e.translationKey,n.region=null!=e.region?e.region.clone():null},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.type="Container",e}(o.a),g=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.noPrint=!1,r.noShow=!1,r.size=null,r._locked=!0,r}return p(e,t),e.prototype._copy=function(e,n,r){t.prototype._copy.call(this,e,n,r),n.noPrint=e.noPrint,n.noShow=e.noShow,n.size=null!=e.size?e.size.clone():null},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e}(d),m=function(t){function e(n,r){var i=t.call(this,n,r)||this;return i.type=e.type,i._locked=!1,i.printingTechniqueConstraints=new c.a,i}return p(e,t),e.prototype._copy=function(e,n,r){t.prototype._copy.call(this,e,n,r),n.printingTechniqueConstraints=e.printingTechniqueConstraints.clone(r)},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.getSimplifiedObject=function(){var e=t.prototype.getSimplifiedObject.call(this);return f(f({},e),{printingTechniqueConstraints:this.printingTechniqueConstraints.toJSON()})},e.type="SurfaceContainer",e}(d),y=function(t){function e(n,o){var a=t.call(this,n,o)||this;return a.type=e.type,a._format=r.OneBit,a._dither=i.Diffusion,a._amount=.7,a._locked=!1,a}return p(e,t),Object.defineProperty(e.prototype,"format",{get:function(){return this._format},set:function(t){this._format!==t&&(this._format=t,this._propertyChanged.notify(this,"format"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dither",{get:function(){return this._dither},set:function(t){this._dither!==t&&(this._dither=t,this._propertyChanged.notify(this,"dither"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"amount",{get:function(){return this._amount},set:function(t){this._amount!==t&&(this._amount=t,this._propertyChanged.notify(this,"amount"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"renderingType",{get:function(){return null===this.visualization?null:this.visualization instanceof u.c?l.a.Solid:this.visualization instanceof u.a?l.a.Grayscale:null},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r){var i,o;t.prototype._copy.call(this,e,n,r),n.outputColor=null===(i=e.outputColor)||void 0===i?void 0:i.clone(),n.opaque=e.opaque,n.dpi=e.dpi,n.visualization=null===(o=e.visualization)||void 0===o?void 0:o.clone(),n.format=e.format,n.dither=e.dither,n.amount=e.amount},e.prototype.getSimplifiedObject=function(){var e=t.prototype.getSimplifiedObject.call(this);return f(f({},e),{outputColor:this.outputColor.getData(),opaque:this.opaque,dpi:this.dpi,visualization:this.visualization.toJSON(),format:this.format,dither:this.dither,amount:this.amount})},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.type="ColorLessContainer",e}(m),_=function(t){function e(n,r){var i=t.call(this,n,r)||this;return i.type=e.type,i._locked=!1,i}return p(e,t),Object.defineProperty(e.prototype,"renderingType",{get:function(){return l.a.Normal},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r){t.prototype._copy.call(this,e,n,r),n.maxColorNumber=e.maxColorNumber,n.paletteUId=e.paletteUId},e.prototype.getSimplifiedObject=function(){var e=t.prototype.getSimplifiedObject.call(this);return f(f({},e),{maxColorNumber:this.maxColorNumber,paletteUId:this.paletteUId})},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.type="LimitedColorContainer",e}(m),v=function(t){function e(n,r){var i=t.call(this,n,r)||this;return i.type=e.type,i._locked=!1,i}return p(e,t),Object.defineProperty(e.prototype,"renderingType",{get:function(){return l.a.Normal},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r){t.prototype._copy.call(this,e,n,r),n.colorSpace=e.colorSpace,n.colorProfile=e.colorProfile},e.prototype.getSimplifiedObject=function(){var e=t.prototype.getSimplifiedObject.call(this);return f(f({},e),{colorSpace:this.colorSpace,colorProfile:this.colorProfile})},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.type="FullColorContainer",e}(m),b=function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n}return p(e,t),Object.defineProperty(e.prototype,"renderingType",{get:function(){return l.a.Grayscale},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r){var i;t.prototype._copy.call(this,e,n,r),n.previewColor=e.previewColor,n.outputColor=null===(i=e.outputColor)||void 0===i?void 0:i.clone()},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.type="SpotColorContainer",e}(m),w=function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n}return p(e,t),Object.defineProperty(e.prototype,"renderingType",{get:function(){return l.a.Grayscale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previewTextureSource",{get:function(){return this._previewTextureSource},set:function(t){t!==this._previewTextureSource&&(this._previewTextureSource=t,this._propertyChanged.notify(this,"previewTextureSource"))},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r){var i;return t.prototype._copy.call(this,e,n,r),n.previewTextureSource=null!=e.previewTextureSource?e.previewTextureSource.clone():null,n.previewTextureName=e.previewTextureName,n.outputColor=null===(i=e.outputColor)||void 0===i?void 0:i.clone(),n},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.getSimplifiedObject=function(e){a.f(e)||a.k(e)||(e=[]);var n=t.prototype.getSimplifiedObject.call(this);return n.previewTextureSource={id:this.previewTextureSource.id,width:this.previewTextureSource.width,height:this.previewTextureSource.height,isVector:this.previewTextureSource.isVector,pageIndex:this.previewTextureSource.pageIndex,url:this.previewTextureSource.url,actualSize:this.previewTextureSource.actualSize,saveAspectRatio:this.previewTextureSource.saveAspectRatio,origin:this.previewTextureSource.origin},n},e.type="TextureContainer",e}(m)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){}return t.MAIN_CONTAINER_NAME="Main",t.BG_CONTAINER_NAME="Background",t.FG_CONTAINER_NAME="Foreground",t.BG_SOLIDCOLOR="solidColor",t.SPINE_AND_FOLDING_CONTAINER_NAME="Spine&Folding",t}()},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.None=0]="None",t[t.Square=1]="Square",t[t.Tight=2]="Tight"}(r||(r={}))},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.Normal="Normal",t.Multiply="Multiply",t.Screen="Screen",t.Overlay="Overlay",t.Darken="Darken",t.Lighten="Lighten",t.ColorDodge="ColorDodge",t.ColorBurn="ColorBurn",t.HardLight="HardLight",t.SoftLight="SoftLight",t.Difference="Difference",t.Exclusion="Exclusion",t.None="None"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r,i=n(451),o=n(448),a=n(428),s=n(553),l=n(438),u=n(411),c=n(408),h=n(407),p=n(416),f=n(409),d=n(415),g=n(497),m=n(437),y=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},v=function(t){function e(n){var r=t.call(this)||this;return r._borderWidth=1,r._fillColor=new u.RgbColor(112,112,112,255),r._borderColor=u.RgbColors.black,r._altBorderColor=null,r._dash=[],r._fixedBorderWidth=!1,r._overprintStroke=!1,r._overprintFill=!1,r.sourcePathId=null,r.sourcePathLoaded=!1,r._stubPath=null,r._pathLoadedEvent=new c.a,r.type=e.type,r.sourcePath=null!=n?n:new o.a(""),r.sourceRectangle=new a.a(0,0,10,10),r.shapePermissions=new s.a,r._setViolationSettings(new g.a,!0),r._ignorePermissionsChange=!0,r.manipulationPermissions.resizeGrips=new l.a(!0,!0),r.itemPermissions.itemToolbarPermissions.showEditButton=!1,r.itemPermissions.itemToolbarPermissions.showSelectButton=!1,r._ignorePermissionsChange=!1,r}return y(e,t),Object.defineProperty(e.prototype,"fixedBorderWidth",{get:function(){return this._fixedBorderWidth},set:function(t){this._fixedBorderWidth!==t&&(this._fixedBorderWidth=t,this._propertyChanged.notify(this,"fixedBorderWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"borderWidth",{get:function(){return this._borderWidth},set:function(t){this._borderWidth!==t&&(this._borderWidth=t,this._propertyChanged.notify(this,"borderWidth"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourcePath",{get:function(){return this._sourcePath},set:function(t){Object(f.g)(this._sourcePath,t)||(this._sourcePath=t,!0!==this.sourcePathLoaded&&this._propertyChanged.notify(this,"sourcePath"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourceRectangle",{get:function(){return this._sourceRectangle},set:function(t){a.a.isEqual(this._sourceRectangle,t)||(this._sourceRectangle=t,this._propertyChanged.notify(this,"sourceRectangle"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"borderColor",{get:function(){return this._borderColor},set:function(t){u.Color.equals(this._borderColor,t)||(this._borderColor=t,this._propertyChanged.notify(this,"borderColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overprintStroke",{get:function(){return this._overprintStroke},set:function(t){this._overprintStroke!==t&&(this._overprintStroke=t,this._propertyChanged.notify(this,"overprintStroke"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillColor",{get:function(){return this._fillColor},set:function(t){u.Color.equals(this._fillColor,t)||(this._fillColor=t,this._propertyChanged.notify(this,"fillColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overprintFill",{get:function(){return this._overprintFill},set:function(t){this._overprintFill!==t&&(this._overprintFill=t,this._propertyChanged.notify(this,"overprintFill"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"altBorderColor",{get:function(){return this._altBorderColor},set:function(t){u.Color.equals(this._altBorderColor,t)||(this._altBorderColor=t,this._propertyChanged.notify(this,"altBorderColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dash",{get:function(){return this._dash},set:function(t){p.h(this._dash,t)||(this._dash=t,this._propertyChanged.notify(this,"dash"))},enumerable:!0,configurable:!0}),e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=!1,this.itemPermissions.itemToolbarPermissions.showSelectButtonConstraint=!1,this.isRenderTypeIsNormal||(this.shapePermissions.allowChangeBorderColor=!1,this.shapePermissions.allowChangeFillColor=!1)},Object.defineProperty(e.prototype,"shapePermissions",{get:function(){return this._shapePermissions},set:function(t){if(null==t)throw new h.a("shapePermissions cannot be null");Object(f.g)(this._shapePermissions,t)||(null!=this._shapePermissions&&this._shapePermissions.propertyChanged.remove(this._onPermissionsChanged),this._shapePermissions=t,this.applyPermissionsConstrain(),this._shapePermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"shapePermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"violationSettings",{get:function(){return this._violationSettings},set:function(t){this._setViolationSettings(t)},enumerable:!0,configurable:!0}),e.prototype._setViolationSettings=function(e,n){if(void 0===n&&(n=!1),!(n||e instanceof g.a))throw new h.a("Shape ViolationSettings property must has ShapeViolationSettings type!");t.prototype._setViolationSettings.call(this,e,n)},e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n.shapePermissions=null!=e._shapePermissions?e._shapePermissions.clone():null,n._stubPath=null!=e._stubPath?e._stubPath.clone():null,n.dash=p.a(e._dash),n.altBorderColor=null!=e._altBorderColor?e._altBorderColor.clone():null,n.fillColor=null!=e._fillColor?e._fillColor.clone():null,n.borderColor=null!=e._borderColor?e._borderColor.clone():null,n.sourceRectangle=null!=e._sourceRectangle?e._sourceRectangle.clone():null,null!=e.sourcePathId?n.sourcePathId=e.sourcePathId:n.sourcePath=null!=e._sourcePath?e._sourcePath.clone():null,n.borderWidth=e._borderWidth,n.fixedBorderWidth=e.fixedBorderWidth,n.overprintStroke=e.overprintStroke,n.overprintFill=e.overprintFill},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(f.g)(this._shapePermissions,e._shapePermissions),i=Object(f.g)(this._stubPath,e._stubPath),o=Object(f.g)(this._dash,e._dash),a=Object(f.g)(this._altBorderColor,e._altBorderColor),s=Object(f.g)(this._fillColor,e._fillColor),l=Object(f.g)(this._borderColor,e._borderColor),u=Object(f.g)(this._sourceRectangle,e._sourceRectangle),c=Object(f.g)(this.sourcePathId,e.sourcePathId),h=Object(f.g)(this._sourcePath,e._sourcePath),p=Object(f.g)(this._borderWidth,e._borderWidth),d=Object(f.g)(this._fixedBorderWidth,e._fixedBorderWidth),g=Object(f.g)(this._overprintStroke,e._overprintStroke),m=Object(f.g)(this._overprintFill,e._overprintFill);return n&&r&&i&&o&&a&&s&&l&&u&&c&&h&&p&&d&&g&&m},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.prototype.getSimplifiedObject=function(e){var n=t.prototype.getSimplifiedObject.call(this,["shapePermissions"].concat(e));return n.shapePermissions=this.shapePermissions.getSimplifiedObject(),null==this.sourcePathId?n.sourcePath=null!=this.sourcePath?this.sourcePath.toString():null:n.sourcePath=null,n},e.prototype._onPathLoaded=function(){this._pathLoadedEvent.notify(this)},e.prototype.getPathLoadedEvent=function(){return this._pathLoadedEvent},e.type="ShapeItem",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(d.a)({factory:new m.b,displayName:"Alternative border color"}),_("design:type",u.Color),_("design:paramtypes",[u.Color])],e.prototype,"altBorderColor",null),e}(i.a)},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.None=0]="None",t[t.BlackAndWhite=1]="BlackAndWhite",t[t.FlipVertical=2]="FlipVertical",t[t.FlipHorizontal=3]="FlipHorizontal",t[t.Colorize=4]="Colorize",t[t.Grayscale=5]="Grayscale",t[t.BlackAndTransparent=6]="BlackAndTransparent"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r,i=n(442),o=n(406),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e,n,r,i){void 0===n&&(n=null);var a=this;return null!=e?(a=t.call(this,o.Path.rectangle(e.sourceRectangle.left,e.sourceRectangle.top,e.sourceRectangle.width,e.sourceRectangle.height),e,n,r,i)||this)._controlPoints=[new o.PointF(e.sourceRectangle.left,e.sourceRectangle.top),new o.PointF(e.sourceRectangle.right,e.sourceRectangle.bottom)]:a=t.call(this,null,e,n)||this,a._allowNegativeResize=!0,a}return a(e,t),e.prototype.setRectangle=function(e,n){e.width=Math.abs(e.width),e.height=Math.abs(e.height),t.prototype.setRectangle.call(this,e,n)},Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return this._areColorPreviewsReady},enumerable:!0,configurable:!0}),e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.sourceRectangle=e.sourceRectangle},e.typeName="RectangleItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(t){var e=this;this._isDisposed=!1,this._src=null,this._canvas=null,this._onLoadedDelegate=function(n){if(!n.target)throw new Error('"e.target" is null.');e._onLoaded(n.target),t()},this._image=this._createImageObject(this._onLoadedDelegate),this._tmpImage=this._createImageObject(this._onLoadedDelegate)}return Object.defineProperty(t.prototype,"isLoaded",{get:function(){return this._loaded},set:function(t){this._loaded=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLoading",{get:function(){return this._loading},set:function(t){this._loading=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"image",{get:function(){return this._image},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this._canvas},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return this._src},set:function(t){this._src===t||this._isDisposed||(this._loaded=!1,this._src=t,this._image.src=null==this._src?"":t)},enumerable:!0,configurable:!0}),t.prototype.updateCanvas=function(t){this._isDisposed||(this._clearCanvas(),this._canvas=t,this._onLoadedDelegate({target:this._canvas}))},t.prototype.updateUrl=function(t){this._loaded=!1,this._isDisposed||(this._tmpImage.src!==t?(this._loading=!0,this._tmpImage.src=t,this._src=t):this._onLoadedDelegate({target:this._tmpImage}))},t.prototype.clear=function(){this._clearCanvas(),this.source=null},t.prototype.dispose=function(){this._tmpImage.removeEventListener("load",this._onLoadedDelegate),this._tmpImage=null,this._image.removeEventListener("load",this._onLoadedDelegate),this._image=null,this._isDisposed=!0,this._clearCanvas()},t.prototype._clearCanvas=function(){this._canvas&&(this._canvas.parentNode.removeChild(this._canvas),this._canvas=null)},t.prototype._onLoaded=function(t){t===this._tmpImage&&(this._tmpImage=this._image,this._image=t,this._src=t.src),this._loaded=!0,this._loading=!1},t.prototype._createImageObject=function(t){var e=new Image;return e.crossOrigin="anonymous","function"==typeof t&&e.addEventListener("load",t),e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var r=n(420),i=n(426),o=n(523),a=n(522),s=n(524),l=n(753),u=n(584),c=n(754),h=n.n(c),p=n(454),f=n(467),d=n(603),g=n(481);class m{constructor(t){this._colorParser=t,this._colorConverter=null,this._existingStyles=[]}parse(t,e,n,r){const i=this._parse(t);return this._colorConverter=new g.a(e,this._colorParser),this._convert(i,n,r)}_isAccepted(t){const e=this.getNodeName(t);return"body"==e||"p"===e||"ol"===e||"li"===e||"ul"===e||"br"===e||"span"===e||"#text"===e}getNodeName(t){return t.nodeName.toLowerCase()}_dbgGetNodeContent(t){return"#text"==t.nodeName.toLowerCase()?t.textContent:""}_convertNode(t,e,n,r){const i=this.getNodeName(t);switch(i){case"body":return this._convertBody(t,e);case"p":return this._convertParagraph(t,e);case"span":return this._convertSpan(t,e);case"ol":return this._convertOrderedList(t,e,n,r);case"ul":return this._convertUnorderedList(t,e,n,r);case"li":return this._convertListItem(t,e);case"br":return this._convertBr(t,e);case"#text":return this._convertText(t);default:throw this._notImplemented(`_convertNode for ${i}`)}}_convertCommonListStyleToParagraphStyle(t,e,n,i,a){var s,l,u,c;if(!a)throw new o.a("listStyleSheetManager must be provided.");const h=new r.ParagraphListStyle;h.tabPosition=null===(s=null==n?void 0:n.textIndent)||void 0===s?void 0:s.value,h.level=null===(l=null==n?void 0:n.levelIndent)||void 0===l?void 0:l.value,t.listStyle=h,t.style=null!==(u=t.style)&&void 0!==u?u:new r.ParagraphStyle,(null==n?void 0:n.levelIndent)&&(t.style.leftIndent=n.levelIndent),(null==n?void 0:n.leftIndent)&&(t.style.leftIndent=n.leftIndent),(null==n?void 0:n.firstLineIndent)&&(t.style.firstLineIndent=n.firstLineIndent),t.listStyle.tabPosition=null!==(c=null==n?void 0:n.tabPosition)&&void 0!==c?c:this._calculateTabPosition(e,i),t.metadata||(t.metadata=new r.ParagraphMetadata);var p=this._findListStyle(a,t,n);const f=a.getListSetting().styleNameKey;t.metadata.set(f,p)}_convertOListItemToParagraph(t,e,n,i,o){var a;const s=new r.Paragraph;s.inlineElements=[...t.content],this._convertCommonListStyleToParagraphStyle(s,t.style,e.style,i,o),s.listStyle.type=r.ListStyleType.numbers;let l=p.c.numbers;return(null===(a=e.style)||void 0===a?void 0:a.type)&&(l=e.style.type),s.listStyle.formatType=d.f.fromListType(l),null!=n&&(s.listStyle.startAt=n,s.listStyle.mode=r.NumberMode.startAt),s}_convertUListItemToParagraph(t,e,n,i){var o,a;const s=new r.Paragraph;return s.inlineElements=[...t.content],this._convertCommonListStyleToParagraphStyle(s,t.style,e.style,n,i),s.listStyle.type=r.ListStyleType.bullets,s.listStyle.bulletChar=null===(a=this._convertUnorderedListBullet(null===(o=null==e?void 0:e.style)||void 0===o?void 0:o.type))||void 0===a?void 0:a.charCodeAt(0),s}_convertUnorderedListLevelIndent(t){return t?t.value:null}_convertUnorderedListBullet(t){if(t instanceof f.d)return String.fromCharCode(parseInt(t.value.substring(1)));switch(t){case f.c.minus:return"-";case f.c.bullet:default:return"•"}}_parse(t){var e=`<body>${t.replace(/ /g," ")}</body>`;const n=new h.a.DOMParser;try{return n.parseFromString(e,"text/html").getElementsByTagName("body")[0]}catch(r){throw console.error("_parse error",r),console.error(`xml: \n\r${e}`),r}}_convert(t,e,n){let r=[];if(t.childNodes)for(let i=0;i<t.childNodes.length;++i){const o=t.childNodes[i];if(this._isAccepted(o)){let t=this._convert(o,e,n);r.push(t)}}return this._convertNode(t,r,e,n)}_convertBr(t,e){return new r.Br}_convertText(t){const e=new r.InlineText;return e.value=t.textContent.replace(/</g,"<").replace(/>/g,">"),e}_convertBody(t,e){const n=new r.Text;let i=null;for(var o of e)if(o instanceof f.a)n.blocks.push(...o.items),i=n.blocks[n.blocks.length-1];else if(o instanceof p.a)n.blocks.push(...o.items),i=n.blocks[n.blocks.length-1];else if(o instanceof r.BlockElement)n.blocks.push(o),i=o;else if(o instanceof r.InlineElement){if(i||(i=new r.Paragraph,n.blocks.push(i)),!(i instanceof r.Paragraph))throw this._notImplemented("Inserting inline element into block element that is not paragraph");i.inlineElements.push(o)}return n}_convertParagraph(t,e){const n=new r.Paragraph;null!=e&&e.length>0&&n.inlineElements.push(...e);const i=t.getAttributeNode("style");let o=this._convertParagraphStyles(null==i?void 0:i.value);n.style=o.style,n.listStyle=o.listStyle;const a=t.getAttributeNode("metadata");return n.metadata=this._convertParagraphMetadata(null==a?void 0:a.value),n}_convertParagraphMetadata(t){if(Object(i.a)(t))return null;const e=Object(i.b)(t),n=new r.ParagraphMetadata;for(let r in e)n.set(r,e[r]);return n}_convertParagraphStyles(t){if(Object(i.a)(t))return{style:new r.ParagraphStyle,listStyle:null};const e=Object(i.b)(t);return{style:this._convertParagraphStyle(e),listStyle:this._convertParagraphListStyles(e)}}_convertParagraphListStyles(t){let e=new r.ParagraphListStyle;const n=t[s.a.type];null!=n&&(e.type=d.e.parse(n));const i=t[s.a.bulletChar];null!==i&&(e.bulletChar=d.a.parse(i));const o=t[s.a.bulletNumberTabPosition];null!=o&&(e.tabPosition=d.h.parseNumber(o));const a=t[s.a.numberMode];null!==a&&(e.mode=d.g.parse(a));const l=t[s.a.level];null!=l&&(e.level=d.h.parseNumber(l));const u=t[s.a.startAt];null!=u&&(e.startAt=d.h.parseNumber(u));const c=t[s.a.numberFormat];return null!=c&&(e.formatType=d.f.parse(c)),e}_convertParagraphStyle(t){let e=new r.ParagraphStyle;const n=t[s.b.alignment];null!=n&&(e.alignment=d.k.parse(n));const i=t[s.b.firstLineIndent];null!=i&&(e.firstLineIndent=d.h.parse(i));const o=t[s.b.spaceBefore];null!=o&&(e.spaceBefore=d.h.parse(o));const a=t[s.b.spaceAfter];null!=a&&(e.spaceAfter=d.h.parse(a));const l=t[s.b.leftIndent];null!=l&&(e.leftIndent=d.h.parse(l));const u=t[s.b.rightIndent];return null!=u&&(e.rightIndent=d.h.parse(u)),this._checkUnsupportedStyles([s.b,s.a],t,"paragraph"),e}_convertOrderedList(t,e,n,r){var i,o,a;let s=new p.a;const u=t.getAttributeNode("style");null!=u&&(s.style=this._convertOrderedListStyles(u.value));let c=null!==(o=null===(i=s.style)||void 0===i?void 0:i.start)&&void 0!==o?o:1;return(null===(a=s.style)||void 0===a?void 0:a.start)&&(c=s.style.start),s.items=[],null!=e&&e.length>0&&e.forEach((t=>{if(t instanceof l.a){let e=this._convertOListItemToParagraph(t,s,c,n,r);s.items.push(e),null!=c&&c++}})),s}_convertUnorderedList(t,e,n,r){let i=new f.a;const o=t.getAttributeNode("style");return null!=o&&(i.style=this._convertUnorderedListStyles(null==o?void 0:o.value)),i.items=[],null!=e&&e.length>0&&e.forEach((t=>{if(t instanceof l.a){let e=this._convertUListItemToParagraph(t,i,n,r);i.items.push(e)}})),i}_isListStylesMatch(t,e,n,r){return!(!t||!t.isMatch(e))}_findListStyle(t,e,n){for(let i of this._existingStyles)if(this._isListStylesMatch(i.style,n,i.lastParagraph,e))return i.lastParagraph=e,i.name;var r={style:n,name:t.createEmptyStyleSheet().name,lastParagraph:e};return this._existingStyles.push(r),r.name}_calculateTabPosition(t,e){return(null==t?void 0:t.fontSize)?2.5*t.fontSize.value:2.5*e}_convertListItem(t,e){const n=new l.a,r=t.getAttributeNode("style");return null!=r&&(n.style=this._convertListItemStyles(r.value)),null!=e&&e.length>0&&n.content.push(...e),n}_convertUbi(t,e){const n=new r.Span;null!=e&&e.length>0&&e.forEach((t=>n.content.push(t))),n.style=new r.SpanStyle;const i=this.getNodeName(t);switch(i){case"u":n.style.underline=!0;break;case"b":n.style.bold=!0;break;case"i":n.style.italic=!0;break;default:throw new o.a(`Unexpected node name ${i} while parsing UBI.`)}return n}_convertSpan(t,e){const n=new r.Span;null!=e&&e.length>0&&e.forEach((t=>n.content.push(t)));const i=t.getAttributeNode("style");return n.style=this._convertSpanStyles(null==i?void 0:i.value),n}_convertBaseListStyles(t,e){const n=e[u.a.levelIndent];null!=n&&(t.levelIndent=d.h.parse(n));const r=e[u.a.textIndent];null!=r&&(t.textIndent=d.h.parse(r));const i=e[u.a.leftIndent];null!=i&&(t.leftIndent=d.h.parse(i));const o=e[u.a.firstLineIndent];null!=i&&(t.firstLineIndent=d.h.parse(o))}_convertListItemStyles(t){let e=new l.b;const n=Object(i.b)(t)[u.b.fontSize];return null!=n&&(e.fontSize=d.h.parse(n)),e}_convertOrderedListStyles(t){let e=new p.b;const n=Object(i.b)(t);this._convertBaseListStyles(e,n);const r=n[u.c.start];null!=r&&(e.start=d.h.parseNumber(r));const o=n[u.c.type];return null!=o&&(e.type=d.j.parse(o)),e}_convertUnorderedListStyles(t){let e=new f.b;const n=Object(i.b)(t);this._convertBaseListStyles(e,n);const r=n[u.d.type];return null!=r&&(e.type=d.l.parse(r)),e}_convertSpanStyles(t){if(null==t)return null;const e=new r.SpanStyle,n=Object(i.b)(t),o=n[a.a.fontName];o&&(e.fontName=o);const s=n[a.a.underline];null!=s&&(e.underline=this._parseBool(s));const l=n[a.a.bold];null!=l&&(e.bold=this._parseBool(l));const u=n[a.a.italic];null!=u&&(e.italic=this._parseBool(u));const c=n[a.a.fontSize];null!=c&&(e.fontSize=d.h.parse(c));const h=n[a.a.leading];null!=h&&(e.leading=d.h.parse(h));const p=n[a.a.tracking];null!=p&&(e.tracking=d.h.parseNumber(p));const f=n[a.a.sup];null!=f&&(e.sup=this._parseBool(f));const g=n[a.a.supSize];null!=g&&(e.supSize=d.h.parseNumber(g));const m=n[a.a.sub];null!=m&&(e.sub=this._parseBool(m));const y=n[a.a.subSize];null!=y&&(e.subSize=d.h.parseNumber(y));const _=n[a.a.color];null!=_&&(e.color=this._colorConverter.parse(_));const v=n[a.a.penColor];null!=v&&(e.penColor=this._colorConverter.parse(v));const b=n[a.a.penWidth];null!=b&&(e.penWidth=d.h.parse(b));const w=n[a.a.allCaps];null!=w&&(e.allCaps=this._parseBool(w));const C=n[a.a.smallCaps];null!=C&&(e.smallCaps=this._parseBool(C));const P=n[a.a.openType];null!=P&&(e.openTypeFeatures=d.i.parse(P));const S=n[a.a.horizontalScale];null!=S&&(e.horizontalScale=d.h.parseNumber(S));const x=n[a.a.verticalScale];return null!=x&&(e.verticalScale=d.h.parseNumber(x)),this._checkUnsupportedStyles([a.a],n,"span"),e}_checkUnsupportedStyles(t,e,n){const r={};for(let a of t)for(let t in a)r[a[t]]=1;const i=[];for(let a in e)r[a]||i.push(a);const o=i.join(", ");i.length>0&&console.warn(`GmXmlParser: unsupported ${n} styles: ${o}`)}_parseBool(t){return Object(i.a)(t)?null:"true"==t.toLowerCase()}_notImplemented(t=null){return new Error(`not implemented: ${t}`)}}},function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return l}));var r,i=n(480),o=n(583);!function(t){t[t.none=0]="none",t[t.bullet=1]="bullet",t[t.minus=2]="minus"}(r||(r={}));class a{}class s extends o.a{isMatch(t){return t instanceof s&&!!super.isMatch(t)&&this.type===t.type}}class l extends i.a{constructor(){super(...arguments),this.items=[]}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r=n(430),i=n(420),o=n(585),a=n(481),s=n(586),l=n(587),u=n(588),c=n(454),h=n(467);class p{constructor(t){this._colorParser=t}serialize(t,e){if(null==t)throw new r.b("Text must be not null");return this._colorConverter=new a.a(e,this._colorParser),this._serializeBlocks(t.blocks)}_serializeBlocks(t){if(null==t)return"";let e="";for(let n of t)e+=this._serializeBlock(n);return e}_serializeBlock(t){if(t instanceof i.Paragraph)return this._serializeParagraph(t);if(t instanceof c.a)return this._serializeOrderedList(t);if(t instanceof h.a)return this._serializeUnorderedList(t);throw console.error("Unknown block type, serialization not implemented",t),new r.a("Unknown block type ")}_serializeParagraph(t){let e=this._serializeParagraphStyle(t.style,t.listStyle),n=this._serializeParagraphMetadata(t.metadata),r=[];n&&r.push(n),e&&r.push(e);let i="";if(t.inlineElements)for(let o of t.inlineElements)i+=this._serializeInlineElement(o);return this._buildTag("p",r,i)}_serializeParagraphMetadata(t){const e=[];if(t)for(let[n,r]of t)this._isEmpty(r)||e.push(`${n}: ${r}`);return e.length>0?this._buildAttribute("metadata",e):null}_serializeParagraphStyle(t,e){let n=[];return t&&(this._isEmpty(t.alignment)||n.push(`alignment: ${t.alignment}`),this._isEmpty(t.firstLineIndent)||n.push(`first-line-indent: ${t.firstLineIndent}`),this._isEmpty(t.spaceBefore)||n.push(`space-before: ${t.spaceBefore}`),this._isEmpty(t.spaceAfter)||n.push(`space-after: ${t.spaceAfter}`),this._isEmpty(t.leftIndent)||n.push(`left-indent: ${t.leftIndent}`),this._isEmpty(t.rightIndent)||n.push(`right-indent: ${t.rightIndent}`)),e&&(this._isEmpty(e.type)||n.push(`list-type: ${s.a.serialize(e.type)}`),this._isEmpty(e.mode)||n.push(`number-mode: ${u.a.serialize(e.mode)}`),this._isEmpty(e.bulletChar)||n.push(`bullet-char: ${o.a.serialize(e.bulletChar)}`),this._isEmpty(e.level)||n.push(`level: ${e.level}`),this._isEmpty(e.formatType)||n.push(`number-format: ${l.a.serialize(e.formatType)}`),this._isEmpty(e.startAt)||n.push(`number-start-at: ${e.startAt}`),this._isEmpty(e.tabPosition)||n.push(`bullet-number-tab-position: ${e.tabPosition}`)),n.length>0?this._buildAttribute("style",n):null}_serializeInlineText(t){return t.value}_serializeInlineElement(t){return t instanceof i.Span?this._serializeSpan(t):t instanceof i.InlineText?this._serializeInlineText(t):t instanceof i.Br?this._serializeBr(t):void 0}_serializeBr(t){return"<br />"}_serializeSpan(t){let e=t.style?this._serializeSpanStyle(t.style):null,n=e?`<span ${e}>`:"<span>",r="";return null!=t.content&&t.content.forEach((t=>{r+=this._serializeInlineElement(t)})),`${n}${r}</span>`}_serializeSpanStyle(t){let e=[];if(this._isEmpty(t.underline)||e.push(`underline: ${t.underline}`),this._isEmpty(t.bold)||e.push(`bold: ${t.bold}`),this._isEmpty(t.italic)||e.push(`italic: ${t.italic}`),this._isEmpty(t.fontName)||e.push(`font-name: ${t.fontName}`),this._isEmpty(t.fontSize)||e.push(`font-size: ${t.fontSize}`),this._isEmpty(t.leading)||e.push(`leading: ${t.leading}`),this._isEmpty(t.tracking)||e.push(`tracking: ${t.tracking}`),this._isEmpty(t.color)||e.push(`color: ${this._colorConverter.serialize(t.color)}`),this._isEmpty(t.penColor)||e.push(`pen-color: ${this._colorConverter.serialize(t.penColor)}`),this._isEmpty(t.penWidth)||e.push(`pen-width: ${t.penWidth}`),this._isEmpty(t.sub)||e.push(`sub: ${t.sub}`),this._isEmpty(t.subSize)||e.push(`sub-size: ${t.subSize}`),this._isEmpty(t.sup)||e.push(`sup: ${t.sup}`),this._isEmpty(t.supSize)||e.push(`sup-size: ${t.supSize}`),this._isEmpty(t.allCaps)||e.push(`all-caps: ${t.allCaps}`),this._isEmpty(t.smallCaps)||e.push(`small-caps: ${t.smallCaps}`),this._isEmpty(t.horizontalScale)||e.push(`horz-scale: ${t.horizontalScale}`),this._isEmpty(t.verticalScale)||e.push(`vert-scale: ${t.verticalScale}`),t.openTypeFeatures)for(let n of t.openTypeFeatures)e.push(`ot: ${n.tag},${n.value}`);return e.length>0?this._buildAttribute("style",e):null}_serializeOrderedList(t){let e=t.style?this._serializeOrderedListStyle(t.style):null,n=e?`<ol ${e}>`:"<ol>";return 0==t.items.length?`${n}</ol>`:`${n}${t.items.reduce(((t,e)=>t+this._serializeListItem(e)),"")}</ol>`}_serializeOrderedListStyle(t){let e=[];return this._isEmpty(t.start)||e.push(`start: ${t.start}`),this._isEmpty(t.levelIndent)||e.push(`level-indent: ${t.levelIndent}`),this._isEmpty(t.textIndent)||e.push(`text-indent: ${t.textIndent}`),this._isEmpty(t.type)||e.push(`type: ${c.c[t.type]}`),e.length>0?this._buildAttribute("style",e):null}_serializeUnorderedList(t){let e=t.style?this._serializeUnorderedListStyle(t.style):null,n=e?`<ul ${e}>`:"<ul>";return 0==t.items.length?`${n}</ul>`:`${n}${t.items.reduce(((t,e)=>t+this._serializeListItem(e)),"")}</ul>`}_serializeUnorderedListStyle(t){let e=[];return this._isEmpty(t.levelIndent)||e.push(`level-indent: ${t.levelIndent}`),this._isEmpty(t.textIndent)||e.push(`text-indent: ${t.textIndent}`),this._isEmpty(t.type)||(t.type instanceof h.d?e.push(`type: ${t.type.value}`):e.push(`type: ${h.c[t.type]}`)),e.length>0?this._buildAttribute("style",e):null}_serializeListItem(t){if(t instanceof i.Paragraph)return this._serializeParagraph(t);throw new Error("not implemented")}_buildTag(t,e,n){let r=`<${t}`;return e.forEach((t=>{r+=` ${t}`})),r+=">",n&&(r+=n),r+=`</${t}>`,r}_buildAttribute(t,e){return`${t}="${e.join("; ")}"`}_isEmpty(t){return null==t}}},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.pointTextFrame=0]="pointTextFrame",t[t.pathTextFrame=1]="pathTextFrame",t[t.shapeTextFrame=2]="shapeTextFrame",t[t.archedTextFrame=3]="archedTextFrame"}(r||(r={}))},function(t,e,n){"use strict";var r,i,o,a,s,l,u,c,h,p,f,d,g,m,y;n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return g})),n.d(e,"c",(function(){return m})),function(t){t.deleteItems="deleteItems",t.cloneItems="cloneItems",t.addContent="addContent",t.alignItems="alignItems",t.groupAlign="groupAlign",t.bringItems="bringItems",t.moveItem="moveItem",t.createItem="createItem",t.editItems="editItems",t.setImageMetadata="setImageMetadata",t.setImageItem="setImageItem",t.placeholderContentScale="placeholderContentScale",t.placeholderContentReset="placeholderContentReset",t.placeholderContentRotate="placeholderContentRotate",t.changeBarcodeFormat="changeBarcodeFormat",t.changeColumnCount="changeColumnCount",t.insertItemsIntoArea="insertItemsIntoArea",t.changeLayout="changeLayout",t.groupItems="groupItems",t.ungroupItems="ungroupItems",t.replaceGroupItemContent="replaceGroupItemContent",t.changeClipartItemColor="changeClipartItemColor",t.convertGroupIntoLayout="convertGroupIntoLayout",t.convertLayoutIntoGroup="convertLayoutIntoGroup",t.translateItems="translateItems",t.convertItemToPlaceholder="itemToPlaceholder",t.convertPlaceholderToItem="placeholderToItem",t.placeItemsToArea="placeItemsToArea",t.convertTextItem="convertTextItem",t.transformItems="transformItems",t.rotateItems="rotateItems",t.fixUnsupportedText="fixUnsupportedText",t.replaceItemCommand="replaceItemCommand",t.editPlaceholder="editPlaceholder",t.distributeItems="distributeItems",t.newTranslateItems="newTranslateItems",t.resizeItems="resizeItems"}(r||(r={})),n(604),function(t){t[t.None=0]="None",t[t.Add=1]="Add",t[t.Invert=2]="Invert"}(i||(i={})),function(t){t.clearSelection="clearSelection",t.selectFirst="selectFirst",t.selectItems="selectItems",t.selectItemsByRect="selectItemsByRect",t.selectAll="selectAll"}(o||(o={})),function(t){t.addItems="addItems",t.setBleed="setBleed",t.setSlug="setSlug"}(a||(a={})),function(t){t.switchToSurface="switchToSurface",t.getNextSurface="getNextSurface",t.switchToNextSurface="switchToNextSurface",t.switchSurfaceForward="switchSurfaceForward",t.switchSurfaceBackward="switchSurfaceBackward"}(s||(s={})),function(t){t.moveViewPort="moveViewPort"}(l||(l={})),function(t){t.zoomToItems="zoomToItems",t.zoomToSafetyLine="zoomToSafetyLine",t.zoomToSelection="zoomToSelection",t.setZoom="setZoom"}(u||(u={})),function(t){t.parseColor="parseColor"}(c||(c={})),function(t){t[t.NotUpdate=0]="NotUpdate",t[t.Update=1]="Update",t[t.ForceUpdate=2]="ForceUpdate"}(h||(h={})),function(t){t.Normal="Normal",t.Multiply="Multiply",t.Screen="Screen",t.Overlay="Overlay",t.Darken="Darken",t.Lighten="Lighten",t.ColorDodge="ColorDodge",t.ColorBurn="ColorBurn",t.HardLight="HardLight",t.SoftLight="SoftLight",t.Difference="Difference",t.Exclusion="Exclusion",t.None="None"}(p||(p={})),function(t){t.vertical="vertical",t.horizontal="horizontal"}(f||(f={})),function(t){t[t.AutoScaledTextItem=0]="AutoScaledTextItem",t[t.BarcodeItem=1]="BarcodeItem",t[t.BoundedTextItem=2]="BoundedTextItem",t[t.CurvedTextItem=3]="CurvedTextItem",t[t.EllipseItem=4]="EllipseItem",t[t.ImageItem=5]="ImageItem",t[t.LineItem=6]="LineItem",t[t.PathBoundedTextItem=7]="PathBoundedTextItem",t[t.PlaceholderItem=8]="PlaceholderItem",t[t.PlainTextItem=9]="PlainTextItem",t[t.RectangleItem=10]="RectangleItem",t[t.ArchedTextItem=11]="ArchedTextItem",t[t.ShapeItem=12]="ShapeItem",t[t.GroupItem=13]="GroupItem",t[t.LayoutItem=14]="LayoutItem",t[t.ClipartItem=15]="ClipartItem"}(d||(d={})),function(t){t.Left="left",t.Right="right",t.Top="top",t.Bottom="bottom",t.Center="center"}(g||(g={})),function(t){t[t.Fit=0]="Fit",t[t.Fill=1]="Fill",t[t.Arbitrary=2]="Arbitrary",t[t.Original=3]="Original"}(m||(m={})),function(t){t[t.None=0]="None",t[t.Rotate90=90]="Rotate90",t[t.Rotate180=180]="Rotate180",t[t.Rotate270=270]="Rotate270",t[t.Auto=-1]="Auto"}(y||(y={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(431),i=n(422),o=n(416),a=n(407),s=function(){function t(t,e,n,r,i,o){if(this._equalityTolerance=1e-6,6==arguments.length)this.setTransform(t,e,n,r,i,o);else{if(0!=arguments.length)throw new Error("Arguments error");this.setTransform(1,0,0,1,0,0)}}return Object.defineProperty(t.prototype,"angle",{get:function(){return Object(i.d)(Math.atan(-this.m01/this.m00))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleX",{get:function(){return Math.sqrt(this.m00*this.m00+this.m10*this.m10)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scaleY",{get:function(){return Math.sqrt(this.m01*this.m01+this.m11*this.m11)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"translateX",{get:function(){return this.m02},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"translateY",{get:function(){return this.m12},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isIdentity",{get:function(){return Object(i.e)(this.m00,1,this._equalityTolerance)&&Object(i.e)(this.m01,0,this._equalityTolerance)&&Object(i.e)(this.m02,0,this._equalityTolerance)&&Object(i.e)(this.m10,0,this._equalityTolerance)&&Object(i.e)(this.m11,1,this._equalityTolerance)&&Object(i.e)(this.m12,0,this._equalityTolerance)},enumerable:!0,configurable:!0}),t.prototype.setTransform=function(t,e,n,r,i,o){this.m00=t,this.m10=e,this.m01=n,this.m11=r,this.m02=i,this.m12=o},t.prototype.transformPoint=function(t,e){void 0===e&&(e=!1);var n=e?new r.a:t,i=t.x,o=t.y;return n.x=i*this.m00+o*this.m01+this.m02,n.y=i*this.m10+o*this.m11+this.m12,n},t.prototype.concatenate=function(t){var e=this.m00,n=this.m01;this.m00=e*t.m00+n*t.m10,this.m01=e*t.m01+n*t.m11,this.m02=e*t.m02+n*t.m12+this.m02;var r=this.m10,i=this.m11;return this.m10=r*t.m00+i*t.m10,this.m11=r*t.m01+i*t.m11,this.m12=r*t.m02+i*t.m12+this.m12,this},t.prototype.rotate=function(e){e=Object(i.c)(e);var n=Math.cos(e),r=Math.sin(e);return this.concatenate(new t(n,r,-r,n,0,0))},t.prototype.rotateAt=function(t,e,n){return this.translate(e,n),this.rotate(t),this.translate(-e,-n),this},t.prototype.scale=function(e,n){return this.concatenate(new t(e,0,0,n,0,0))},t.prototype.scaleRelativeToPoint=function(e,n,r){return this.concatenate(new t(e,0,0,n,r.x*(1-e),r.y*(1-n)))},t.prototype.translate=function(e,n){return this.concatenate(new t(1,0,0,1,e,n))},t.prototype.clone=function(){return new t(this.m00,this.m10,this.m01,this.m11,this.m02,this.m12)},t.prototype.updateObjectByMatrix=function(t,e,n){if(null==t)throw new a.a("object cannot be null");if(!o.i(t[e])||!o.i(t[n]))throw new a.a("object members by given keys nust be a numbers!");var i=this.transformPoint(new r.a(t[e],t[n]));return t[e]=i.x,t[n]=i.y,t},t.prototype.getInversed=function(){var e=this._determinant;return new t(this.m11/e,-this.m10/e,-this.m01/e,this.m00/e,(this.m01*this.m12-this.m11*this.m02)/e,(this.m10*this.m02-this.m00*this.m12)/e)},t.prototype.equals=function(t){return Object(i.e)(this.m00,t.m00,this._equalityTolerance)&&Object(i.e)(this.m01,t.m01,this._equalityTolerance)&&Object(i.e)(this.m02,t.m02,this._equalityTolerance)&&Object(i.e)(this.m10,t.m10,this._equalityTolerance)&&Object(i.e)(this.m11,t.m11,this._equalityTolerance)&&Object(i.e)(this.m12,t.m12,this._equalityTolerance)},Object.defineProperty(t.prototype,"_determinant",{get:function(){return this.m00*this.m11-this.m01*this.m10},enumerable:!0,configurable:!0}),t}()},function(t,e,n){"use strict";var r,i,o,a,s,l,u,c;n.d(e,"d",(function(){return r})),n.d(e,"f",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"g",(function(){return a})),n.d(e,"h",(function(){return s})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return c})),function(t){t[t.ShrinkToContentWidth=0]="ShrinkToContentWidth",t[t.StretchToContentWidth=1]="StretchToContentWidth",t[t.ShrinkOrStretchToContentWidth=2]="ShrinkOrStretchToContentWidth",t[t.ShrinkToContentHeight=3]="ShrinkToContentHeight",t[t.StretchToContentHeight=4]="StretchToContentHeight",t[t.ShrinkOrStretchToContentHeight=5]="ShrinkOrStretchToContentHeight",t[t.ShrinkToContent=6]="ShrinkToContent",t[t.StretchToContent=7]="StretchToContent",t[t.ShrinkOrStretchToContent=8]="ShrinkOrStretchToContent"}(r||(r={})),function(t){t[t.Size=0]="Size",t[t.Scale=1]="Scale"}(i||(i={})),function(t){t[t.Clip=0]="Clip",t[t.FitToWidth=1]="FitToWidth",t[t.FitToBox=2]="FitToBox",t[t.ExpandBox=3]="ExpandBox"}(o||(o={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Justify=3]="Justify",t[t.LastLeft=4]="LastLeft",t[t.LastRight=5]="LastRight",t[t.LastCenter=6]="LastCenter"}(a||(a={})),function(t){t[t.Top=0]="Top",t[t.Center=1]="Center",t[t.Bottom=2]="Bottom"}(s||(s={})),function(t){t[t.Ascent=0]="Ascent",t[t.CapHeight=1]="CapHeight",t[t.Leading=2]="Leading",t[t.XHeight=3]="XHeight",t[t.Fixed=4]="Fixed",t[t.EmboxHeight=5]="EmboxHeight"}(l||(l={})),function(t){t[t.Off=0]="Off",t[t.WidthOnly=1]="WidthOnly",t[t.HeightOnly=2]="HeightOnly",t[t.WidthHeight=3]="WidthHeight"}(u||(u={})),function(t){t[t.Off=0]="Off",t[t.FitToBox=1]="FitToBox",t[t.FitToWidth=2]="FitToWidth",t[t.Fill=3]="Fill"}(c||(c={}))},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.AZTEC="AZTEC",t.CODABAR="CODABAR",t.CODE_39="CODE_39",t.CODE_93="CODE_93",t.CODE_128="CODE_128",t.DATA_MATRIX="DATA_MATRIX",t.EAN_8="EAN_8",t.EAN_13="EAN_13",t.ITF="ITF",t.PDF_417="PDF_417",t.QR_CODE="QR_CODE",t.UPC_A="UPC_A",t.UPC_E="UPC_E",t.MSI="MSI",t.PLESSEY="PLESSEY",t.IMB="IMB",t.DATABAR_EXPANDED_STACKED="DATABAR_EXPANDED_STACKED"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(422),i=function(){function t(t){this.FirstLineIndent=0,this.SpaceAfter=0,this.SpaceBefore=0,this.LeftIndent=0,this.RightIndent=0,null!=t&&(this.FirstLineIndent="number"==typeof t.FirstLineIndent?t.FirstLineIndent:0,this.SpaceAfter="number"==typeof t.SpaceAfter?t.SpaceAfter:0,this.SpaceBefore="number"==typeof t.SpaceBefore?t.SpaceBefore:0,this.LeftIndent="number"==typeof t.LeftIndent?t.LeftIndent:0,this.RightIndent="number"==typeof t.RightIndent?t.RightIndent:0)}return t.prototype.equals=function(e){return e instanceof t&&Object(r.e)(this.FirstLineIndent,e.FirstLineIndent)&&Object(r.e)(this.SpaceAfter,e.SpaceAfter)&&Object(r.e)(this.SpaceBefore,e.SpaceBefore)&&Object(r.e)(this.LeftIndent,e.LeftIndent)&&Object(r.e)(this.RightIndent,e.RightIndent)},t.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.clone=function(){return new t(this)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return x}));var r,i=n(498),o=n(505),a=n(438),s=n(428),l=n(407),u=n(408),c=n(416),h=n(463),p=n(503),f=n(476),d=n(409),g=n(477),m=n(415),y=n(461),_=n(411),v=n(561),b=n(437),w=n(562),C=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),P=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},S=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},x=function(t){function e(n,r,i,l,u){var c=t.call(this)||this;return c.ndEffects=new w.a,c._effect=h.a.None,c._overlayEffect=null,c.type=e.type,c.mviKeepTemplateTransform=!1,c.values=[],c.allowedSubfolder=null,c.allowedTabs=null,c.ratioWidthToHeight=null,c.isUserImage=!1,c.unconvertedSource=null,c._onSourcePropertyChanged=function(t,e){switch(e){case"url":case"id":case"pageIndex":c._propertyChanged.notify(c,"source");break;case"isVector":c.applyPermissionsConstrain(),c._propertyChanged.notify(c,"source")}},c._onOverlayEffectPropertyChanged=function(t,e){c._propertyChanged.notify(c,"overlayEffect")},c.imagePermissions=new o.a,c._setViolationSettings(new v.a,!0),c.manipulationPermissions.resizeGrips=new a.a(!0,!1),c.shapePermissions.allowChangeFillColor=!1,c.imagePermissions.allowKeepOverlayColor=!1,c.itemPermissions.itemToolbarPermissions.showSelectButton=!0,c.source=null!=n?new e.ImageSource(n):new e.ImageSource,null!=u&&(c.ratioWidthToHeight=u),null!=i&&null!=l?c.sourceRectangle=new s.a(0,0,i,l):(null!=i&&c.SetWidth(i),null!=l&&c.SetHeight(l)),null!=r&&(c.sourceRectangle.left=r.x,c.sourceRectangle.top=r.y),c}return C(e,t),e.prototype._copy=function(e,n,r,i){var o,a,s;if(t.prototype._copy.call(this,e,n,r,i),n.imagePermissions=null!=e._imagePermissions?e._imagePermissions.clone():null,n.effect=e._effect,n.overlayEffect=null!=e.overlayEffect?e.overlayEffect.clone():null,n.source=e._source.clone(),n.unconvertedSource=null!=e.unconvertedSource?e.unconvertedSource.clone():null,n.mviKeepTemplateTransform=e.mviKeepTemplateTransform,null!=e.values){n.values=[];try{for(var l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(e.values),u=l.next();!u.done;u=l.next()){var h=u.value;n.values.push(h.clone())}}catch(p){o={error:p}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}}n.originalImageSource=null===(s=e.originalImageSource)||void 0===s?void 0:s.clone(),n.ndEffects=e.ndEffects.clone(),n.allowedSubfolder=e.allowedSubfolder,n.allowedTabs=c.a(e.allowedTabs),n.ratioWidthToHeight=e.ratioWidthToHeight,n.isUserImage=e.isUserImage,n.displayName=e.displayName},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(d.g)(this._imagePermissions,e._imagePermissions)&&Object(d.g)(this._effect,e._effect)&&Object(d.g)(this.unconvertedSource,e.unconvertedSource)&&Object(d.g)(this._source,e._source)&&Object(d.g)(this.mviKeepTemplateTransform,e.mviKeepTemplateTransform)&&Object(d.g)(this.overlayEffect,e.overlayEffect)&&Object(d.c)(this.values,e.values)&&Object(d.g)(this.allowedSubfolder,e.allowedSubfolder)&&Object(d.c)(this.allowedTabs,e.allowedTabs)&&Object(d.g)(this.ratioWidthToHeight,e.ratioWidthToHeight)&&Object(d.g)(this.isUserImage,e.isUserImage)&&Object(d.g)(this.originalImageSource,e.originalImageSource)&&Object(d.g)(this.ndEffects,e.ndEffects)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},Object.defineProperty(e.prototype,"imagePermissions",{get:function(){return this._imagePermissions},set:function(t){if(null==t)throw new l.a("imagePermissions cannot be null");Object(d.g)(this._imagePermissions,t)||(null!=this._imagePermissions&&this._imagePermissions.propertyChanged.remove(this._onPermissionsChanged),this._imagePermissions=t,this.applyPermissionsConstrain(),this._imagePermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"imagePermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"violationSettings",{get:function(){return this._violationSettings},set:function(t){this._setViolationSettings(t)},enumerable:!0,configurable:!0}),e.prototype._setViolationSettings=function(e,n){if(void 0===n&&(n=!1),!(n||e instanceof v.a))throw new l.a("Shape ViolationSettings property must has ImageViolationSettings type!");t.prototype._setViolationSettings.call(this,e,n)},e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),null==this.imagePermissions||this.imagePermissions.allowEditImage?null!=this.source&&this.source.isVector?this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=!1:this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=null:this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint=!1,null==this.imagePermissions||this.imagePermissions.allowChangeImage?this.itemPermissions.itemToolbarPermissions.showSelectButtonConstraint=null:this.itemPermissions.itemToolbarPermissions.showSelectButtonConstraint=!1},Object.defineProperty(e.prototype,"displayName",{get:function(){var t=this;if(null==this._displayName&&null!=this.values&&this.values.length>0){var e=this.values.find((function(e){return e.value.id===t.source.id}));null!=e&&(this.displayName=e.name)}return this._displayName},set:function(t){t!=this._displayName&&(this._displayName=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"source",{get:function(){return this._source},set:function(t){this._source===t||null!=this._source&&this._source.equals(t)||(null!=this._source&&this._source.removePropertyChanged(this._onSourcePropertyChanged),this._source=t,null!=this._source&&this._source.addPropertyChanged(this._onSourcePropertyChanged),this._propertyChanged.notify(this,"source"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"effect",{get:function(){return this._effect},set:function(t){this._effect!==t&&(this._effect=t,this._propertyChanged.notify(this,"effect"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overlayEffect",{get:function(){return this._overlayEffect},set:function(t){f.a.equals(this.overlayEffect,t)||(this._unsubscribeOverlayEffectPropertyChanged(),this._overlayEffect=t,this._subscribeOverlayEffectPropertyChanged(),this._propertyChanged.notify(this,"overlayEffect"))},enumerable:!0,configurable:!0}),e.prototype._subscribeOverlayEffectPropertyChanged=function(){null!=this.overlayEffect&&this.overlayEffect.addPropertyChanged(this._onOverlayEffectPropertyChanged)},e.prototype._unsubscribeOverlayEffectPropertyChanged=function(){null!=this.overlayEffect&&this.overlayEffect.removePropertyChanged(this._onOverlayEffectPropertyChanged)},e.prototype.SetWidth=function(t,e){this.sourceRectangle.width=t,null!=e&&(e=!0),null!=this.source.id&&e&&(this.sourceRectangle.height=this._calculateHeight(t))},e.prototype.SetHeight=function(t,e){this.sourceRectangle.height=t,null!=e&&(e=!0),null!=this.source.id&&e&&(this.sourceRectangle.width=this._calculateWidth(t))},e.prototype.getSource=function(){throw new l.e},e.prototype._calculateHeight=function(t){if(null==this.ratioWidthToHeight)throw new l.c("Field ratioWidthToHeight is not set!");return t/this.ratioWidthToHeight},e.prototype._calculateWidth=function(t){if(null==this.ratioWidthToHeight)throw new l.c("Field ratioWidthToHeight is not set!");return t*this.ratioWidthToHeight},e.prototype.getSimplifiedObject=function(e){var n,r;c.f(e)||c.k(e)||(e=[]);var i=t.prototype.getSimplifiedObject.call(this,["imagePermissions"].concat(e));return i.source=this.source.toJSON(),i.originalImageSource=null===(n=this.originalImageSource)||void 0===n?void 0:n.toJSON(),i.unconvertedSource=null===(r=this.unconvertedSource)||void 0===r?void 0:r.toJSON(),i.ndEffects=this.ndEffects.toJSON(),i.imagePermissions=this.imagePermissions.getSimplifiedObject(),i},e.prototype.getOriginalImageSize=function(){return{width:Object(p.a)(this.source.width,this.source.dpiX||72),height:Object(p.a)(this.source.height,this.source.dpiY||72)}},e.type="ImageItem",P([Object(m.a)({factory:new b.d("subfolder"),displayName:"Allowed subfolder"}),S("design:type",String)],e.prototype,"allowedSubfolder",void 0),P([Object(m.a)({factory:new b.a(Array),displayName:"Allowed tabs"}),S("design:type",Array)],e.prototype,"allowedTabs",void 0),P([Object(m.a)({factory:new b.d("Image"),displayName:"Display name"}),S("design:type",Object),S("design:paramtypes",[Object])],e.prototype,"displayName",null),P([Object(m.a)({ignore:!0}),S("design:type",e.ImageSource)],e.prototype,"unconvertedSource",void 0),P([Object(m.a)({enumObject:h.a}),S("design:type",Number),S("design:paramtypes",[Number])],e.prototype,"effect",null),P([Object(m.a)({factory:new b.c(f.a,{color:new _.CmykColor(0,0,0,0,255),opacity:1,blendMode:y.a.Normal}),displayName:"Overlay effect"}),S("design:type",f.a),S("design:paramtypes",[f.a])],e.prototype,"overlayEffect",null),e}(i.a);!function(t){var e=function(){function t(t){c.c(this,t)}return t.prototype.clone=function(){return new t(this)},t.prototype.equals=function(t){return null!=t&&Object(d.g)(this.id,t.id)&&Object(d.g)(this.width,t.width)&&Object(d.g)(this.height,t.height)&&Object(d.g)(this.isVector,t.isVector)},t}();t.ImageMetaData=e;var n,r=function(){function t(t,e,n){this.name=t,this.value=e,this.transformedRectangle=n}return t.prototype.clone=function(){return new t(this.name,this.value.clone(),this.transformedRectangle.clone())},t.prototype.equals=function(t){return null!=t&&Object(d.g)(this.name,t.name)&&Object(d.g)(this.value,t.value)&&Object(d.g)(this.transformedRectangle,t.transformedRectangle)},t}();t.ImageItemValue=r,function(t){t[t.None=0]="None",t[t.File=1]="File",t[t.StorageId=3]="StorageId",t[t.Url=4]="Url",t[t.PublicImage=5]="PublicImage",t[t.UserImage=6]="UserImage"}(n=t.ImageSourceType||(t.ImageSourceType={}));var i=function(){function t(t,e,r,i,o,a){void 0===r&&(r=0),void 0===i&&(i=!1),void 0===o&&(o=!0),this._storageId=null,this._url=null,this._type=n.None,this._isVector=!1,this._pageIndex=0,this._origin=null,this._actualSize=!1,this._saveAspectRatio=!0,this._dpiX=72,this._dpiY=72,this._propertyChanged=new u.c,this._storageId=t,null!=t&&(this._type=n.StorageId,this._origin=a),this._url=e,null!=e&&(this._type=n.Url,this._actualSize=i,this._saveAspectRatio=o)}return t.prototype.clone=function(){var e=new t;return e.id=this.id,e.url=this.url,e._type=this._type,e._width=this._width,e._height=this._height,e._isVector=this._isVector,e._pageIndex=this._pageIndex,e._origin=null!=this._origin?this._origin.clone():null,e._actualSize=this._actualSize,e._saveAspectRatio=this._saveAspectRatio,e._dpiX=this._dpiX,e._dpiY=this._dpiY,e},t.prototype.equals=function(t){return Object(d.g)(this.id,t.id)&&Object(d.g)(this.url,t.url)&&Object(d.g)(this._type,t._type)&&Object(d.g)(this._width,t._width)&&Object(d.g)(this._height,t._height)&&Object(d.g)(this._origin,t._origin)&&Object(d.g)(this._saveAspectRatio,t._saveAspectRatio)&&t._pageIndex===this._pageIndex&&JSON.stringify(t._origin)===JSON.stringify(this._origin)&&t._actualSize===this._actualSize&&t._saveAspectRatio===this._saveAspectRatio},Object.defineProperty(t.prototype,"id",{get:function(){return this._storageId},set:function(t){this._storageId!==t&&(this._storageId=t,this._propertyChanged.notify(this,"id"))},enumerable:!0,configurable:!0}),t.prototype.setIdWithOrigin=function(t,e){this.id=t,this._setOrigin(e)},Object.defineProperty(t.prototype,"url",{get:function(){return this._url},set:function(t){this._url!==t&&(this._url=t,this._propertyChanged.notify(this,"url"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(t){this._width!==t&&(this._width=t,this._propertyChanged.notify(this,"width"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(t){this._height!==t&&(this._height=t,this._propertyChanged.notify(this,"height"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVector",{get:function(){return this._isVector},set:function(t){this._isVector!==t&&(this._isVector=t,this._propertyChanged.notify(this,"isVector"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageIndex",{get:function(){return this._pageIndex},set:function(t){t!==this._pageIndex&&(this._pageIndex=t,this._propertyChanged.notify(this,"pageIndex"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"origin",{get:function(){return this._origin},enumerable:!0,configurable:!0}),t.prototype._setOrigin=function(t){t!==this._origin&&(this._origin=t,this._propertyChanged.notify(this,"origin"))},Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actualSize",{get:function(){return this._actualSize},set:function(t){this._actualSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"saveAspectRatio",{get:function(){return this._saveAspectRatio},set:function(t){this._saveAspectRatio=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dpiX",{get:function(){return this._dpiX},set:function(t){t>0&&(this._dpiX=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dpiY",{get:function(){return this._dpiY},set:function(t){t>0&&(this._dpiY=t)},enumerable:!0,configurable:!0}),t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t.prototype.toJSON=function(){return{id:this.id,width:this.width,height:this.height,isVector:this.isVector,pageIndex:this.pageIndex,url:this.url,actualSize:this.actualSize,saveAspectRatio:this.saveAspectRatio,origin:this.origin}},t}();t.ImageSource=i,function(t){var e=function(){function t(t){c.c(this,t||{}),null!=t&&null!=t.originalSize&&(this.originalSize=new g.a(t.originalSize.width,t.originalSize.height))}return t.prototype.equals=function(t){return null==t&&Object(d.g)(this.type,t.type)&&Object(d.g)(this.data,t.data)&&Object(d.g)(this.originalSize,t.originalSize)},t.prototype.clone=function(){return new t(this)},t}();t.Origin=e}(i=t.ImageSource||(t.ImageSource={}))}(x||(x={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(411),i=n(406),o=n(408),a=n(415),s=n(461),l=n(437),u=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},c=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},h=function(){function t(e){if(this._color=null,this._opacity=null,this._blendMode=null,this.$_propertyChanged=new o.c,this.type=t.type,null!=e){var n=e.color,i=e.opacity,a=e.blendMode;this.color=n instanceof r.Color?n:null,this.blendMode="string"==typeof a?a:null,this.opacity="number"==typeof i?i:null}}return t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e.color,o=e.opacity,a=e.blendMode;return r.Color.equals(n,this.color)&&(null==o&&null==this.opacity||Object(i.EqualsOfFloatNumbers)(o,this.opacity))&&(null==a&&null==this.blendMode||a===this.blendMode)},t.prototype.getSimplifiedObject=function(){return{color:this.color,blendMode:this.blendMode,opacity:this.opacity}},t.equals=function(t,e){return null==t&&null==e||null!=t&&t.equals(e)},t.prototype.clone=function(){return new t({blendMode:this.blendMode,color:null!=this.color?this.color.clone():null,opacity:this.opacity})},Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(t){r.Color.equals(this.color,t)||(this._color=t,this.$_propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blendMode!==t&&(this._blendMode=t,this.$_propertyChanged.notify(this,"blendMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"opacity",{get:function(){return this._opacity},set:function(t){this.opacity!==t&&(this._opacity=t,this.$_propertyChanged.notify(this,"opacity"))},enumerable:!0,configurable:!0}),t.prototype.addPropertyChanged=function(t){this.$_propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this.$_propertyChanged.remove(t)},t.type="OverlayEffect",u([Object(a.a)({factory:new l.b}),c("design:type",Object),c("design:paramtypes",[Object])],t.prototype,"color",null),u([Object(a.a)({enumObject:s.a}),c("design:type",Object),c("design:paramtypes",[Object])],t.prototype,"blendMode",null),u([Object(a.a)({factory:new l.d(0)}),c("design:type",Object),c("design:paramtypes",[Object])],t.prototype,"opacity",null),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(409),i=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.width=t,this.height=e}return t.prototype.equals=function(t){return null!=t&&Object(r.g)(this.width,t.width)&&Object(r.g)(this.height,t.height)},t.prototype.clone=function(){return new t(this.width,this.height)},t}()},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.NotContent=0]="NotContent",t[t.PlaceholderContent=1]="PlaceholderContent",t[t.TopFrame=2]="TopFrame",t[t.BottomFrame=3]="BottomFrame"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(406),i=n(444),o=function(){function t(){}return Object.defineProperty(t,"textWhizz",{set:function(t){this._textWhizz=t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"designAtomsApiClient",{set:function(t){this._designAtomsApiClient=t},enumerable:!0,configurable:!0}),t.getBounds=function(t){var e,n,r,i,o,a;return r=this,i=void 0,a=function(){var r;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){switch(i.label){case 0:return null===(e=this.getBoundsSync(t))||void 0===e?[3,1]:(r=e,[3,3]);case 1:return[4,null===(n=this._designAtomsApiClient)||void 0===n?void 0:n.getPathBoundsFromServer(t)];case 2:r=i.sent(),i.label=3;case 3:return[2,r]}}))},new((o=void 0)||(o=Promise))((function(t,e){function n(t){try{l(a.next(t))}catch(n){e(n)}}function s(t){try{l(a.throw(t))}catch(n){e(n)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof o?r:new o((function(t){t(r)}))).then(n,s)}l((a=a.apply(r,i||[])).next())}))},t.getBoundsSync=function(t){if(null!=this._textWhizz){var e=Object(i.d)(this._textWhizz,t).getBounds();return new r.RectangleF(e.x,e.y,e.width,e.height)}return this._isDomBoundsEnabled?this._getDOMBounds(t):null},Object.defineProperty(t,"_isDomBoundsEnabled",{get:function(){return!this._getDOMBounds(this._testRectangle).isEmpty()},enumerable:!0,configurable:!0}),t._getDOMBounds=function(t){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.style.position="absolute",e.style.visibility="hidden";var n=document.createElementNS("http://www.w3.org/2000/svg","path");e.appendChild(n),n.setAttribute("d",t.toString());var i=document.querySelector("body");i.appendChild(e);var o=n.getBBox(),a=new r.RectangleF(o.x,o.y,o.width,o.height);return i.removeChild(e),a},t._testRectangle=r.Path.rectangle(0,0,10,10),t._textWhizz=null,t._designAtomsApiClient=null,t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(430);class i{constructor(t,e){this._colorPalette=t,this._colorParser=e}serialize(t){if(null==t)throw new r.b("Color must not be null");const e=this.getColorIndex(t.color);return e>-1?e:this._colorPalette.addColorToPaletteReturnIndex(t)}getColorIndex(t){return this._colorPalette.getPaletteColors().findIndex((e=>{e.color.equals(t)}))}containsColor(t){return this._colorPalette.getPaletteColors().some((e=>{e.color.equals(t)}))}parse(t){if((t=t.trim()).match(/^\d+$/)){const e=parseInt(t),n=this._colorPalette.getPaletteColorAt(e);if(!n)throw new r.b(`ColorPalette does not contain color with index ${e}.`);return n}return{color:this._colorParser.parse(t)}}containsColorWithIndex(t){return this._colorPalette.getPaletteColorAt(t)>t}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(407),i=n(613),o=n(529),a=n(590);class s{static getTextRange(t){if(t instanceof i.a)return t;this.throwException("range")}static getPosition(t){if(t instanceof o.a)return t;this.throwException("position")}static getEngine(t){if(t instanceof a.a)return t;this.throwException("engine")}static throwException(t){throw new r.c(`Fail to unwrap TextWhizz ${t}!`)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(407);class i{constructor(t){this._colors=null!=t?[...t]:[]}getPaletteColors(){return this._colors}getColorByIndex(t){return this.containsColorWithIndex(t)?this._colors[t]:null}getPaletteColorAt(t){return this.getColorByIndex(t)}containsColor(t){return-1!==this.getIndex(t)}containsColorWithIndex(t){return this._colors.length>t}getIndex(t){if(null==t)throw new r.b("Color must not be null");if(0==this._colors.length)return-1;for(let e=0;e<this._colors.length;e++){let n=this._colors[e];if(t.equals(n.color))return e}return-1}addColor(t){if(null==t)throw new r.b("Color must not be null");const e=this.getIndex(t.color);return-1!==e?e:(this._colors.push(t),this._colors.length-1)}addColorToPaletteReturnIndex(t){return this.addColor(t)}}},,,,,function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.Trim=0]="Trim",t[t.Bleed=1]="Bleed",t[t.Total=2]="Total"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(407),i=function(){function t(t){this._value="00000000-0000-0000-0000-000000000000",null!=t?this.value=t:this.generateNewGuid()}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){if(!this.isValid(t))throw new r.c(t+"is incorrect uuid!");this._value=t},enumerable:!0,configurable:!0}),t.prototype.isValid=function(t){return t=t.toUpperCase(),null!=new RegExp("\\b(?:[A-F0-9]{8})(?:-[A-F0-9]{4}){3}-(?:[A-F0-9]{12})\\b").exec(t)},t.prototype.generateNewGuid=function(){var t=(new Date).getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:7&n|8).toString(16)}));this.value=e},t.prototype.toString=function(){return this._value},t.prototype.equals=function(t){return t._value===this._value},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(421),o=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return s}));var r="The item already belongs to this collection, or to another collection.",i="The item was not found in this collection.",o="setPoint: Index out of range.",a="addPoint: Index out of range.",s="removePoint: Index out of range."},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(423),o=n(416),a=n(407),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return s(e,t),Object.defineProperty(e.prototype,"parentContainer",{get:function(){return this._parentContainer},set:function(t){this._parentContainer=t,this._onContainerChanged()},enumerable:!0,configurable:!0}),e.prototype._onContainerChanged=function(){},e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r),i&&(n.parentContainer=e.parentContainer)},e.prototype.clone=function(t,n){if(void 0===t&&(t=!1),void 0===n&&(n=!1),this.type!==e.type)throw new a.e(".clone() method must be overridden in "+this.type+" class");var r=new e;return this._copy(this,r,t,n),r},e.prototype.copyTo=function(t){this._copy(this,t,!0,!0)},e.prototype.update=function(t){this._copy(t,this,!0,!1)},e.prototype.getSimplifiedObject=function(e){o.f(e)||o.k(e)||(e=[]);var n=t.prototype.getSimplifiedObject.call(this,["parentContainer"].concat(e));return n.$type=this.type,n},e.type="base",e}(i.a)},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.Normal=0]="Normal",t[t.Grayscale=1]="Grayscale",t[t.Solid=2]="Solid"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return s}));var r,i=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=function(){function t(){}return t.prototype._copy=function(t,e){},t}(),a=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return i(e,t),e.prototype._copy=function(e,n){t.prototype._copy.call(this,e,n),n.color=e.color.clone(),n.opacity=e.opacity,n.enableGlareEffect=e.enableGlareEffect},e.prototype.toJSON=function(){return{type:this.type,color:this.color.getData(),opacity:this.opacity,enableGlareEffect:this.enableGlareEffect}},e.prototype.clone=function(){var t=new e;return this._copy(this,t),t},e.type="ColorVisualization",e}(o),s=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return i(e,t),e.prototype._copy=function(e,n){var r;t.prototype._copy.call(this,e,n),n.textureSource=null===(r=e.textureSource)||void 0===r?void 0:r.clone(),n.textureName=e.textureName,n.opacity=e.opacity,n.enableGlareEffect=e.enableGlareEffect},e.prototype.toJSON=function(){var t;return{type:this.type,textureSource:null===(t=this.textureSource)||void 0===t?void 0:t.toJSON(),textureName:this.textureName,opacity:this.opacity,enableGlareEffect:this.enableGlareEffect}},e.prototype.clone=function(){var t=new e;return this._copy(this,t),t},e.type="TextureVisualization",e}(o)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){this.allowRasterElements=!0}return t.prototype._copy=function(t,e,n){e.allowRasterElements=null!=t.allowRasterElements?t.allowRasterElements:null,e.minWidth=null!=t.minWidth?t.minWidth:null,e.minFontSize=null!=t.minFontSize?t.minFontSize:null,e.targetDpi=null!=t.targetDpi?t.targetDpi:null},t.prototype.clone=function(e){void 0===e&&(e=!1);var n=new t;return this._copy(this,n,e),n},t.prototype.toJSON=function(){return{allowRasterElements:this.allowRasterElements,minWidth:this.minWidth,minFontSize:this.minFontSize,targetDpi:this.targetDpi}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(408),i=n(409),o=function(){function t(){this._vectorMask=null,this._maskChangedEvent=new r.a}return Object.defineProperty(t.prototype,"vectorMask",{get:function(){return this._vectorMask},set:function(t){this._vectorMask=t,this._maskChangedEvent.notify(this)},enumerable:!0,configurable:!0}),t.prototype.addMaskChanged=function(t){this._maskChangedEvent.add(t)},t.prototype.removeMaskChanged=function(t){this._maskChangedEvent.remove(t)},t.prototype.clone=function(){var e=new t;return e.vectorMask=null!=this.vectorMask?this.vectorMask.clone():null,e},t.prototype.equals=function(t){return Object(i.g)(this.vectorMask,t.vectorMask)},t.prototype.getSimplifiedObject=function(){var t={};return t.vectorMask=null!=this.vectorMask?this.vectorMask.toString():null,t},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(552),o=n(434),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},l=function(t){function e(n){var r=t.call(this,n)||this;return r.type=e.type,null==n&&(n=!0),r._allowShape=n,r}return a(e,t),e.prototype.clone=function(n){void 0===n&&(n=null);var r=null!=n?n:new e;return r.allowShape=this.allowShape,t.prototype.clone.call(this,r)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&this.allowShape===e.allowShape},e.type="ShapeViolationSettings",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(o.a)(),s("design:type",Boolean)],e.prototype,"allowShape",void 0),e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r,i=n(411),o=n(499),a=n(458),s=n(406),l=n(416),u=n(409),c=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(){var n=t.call(this)||this;return n._maskOpacity=.45,n._parentPlaceholder=null,n.type=e.type,n.borderWidth=0,n.fillColor=i.RgbColors.transparent,n._ignorePermissionsChange=!0,n.itemPermissions.itemToolbarPermissions.showEditButton=!0,n._ignorePermissionsChange=!1,n}return c(e,t),Object.defineProperty(e.prototype,"maskOpacity",{get:function(){return this._maskOpacity},set:function(t){s.EqualsOfFloatNumbers(this._maskOpacity,t)||(this._maskOpacity=t,this._propertyChanged.notify(this,"maskOpacity"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentPlaceholder",{get:function(){return this._parentPlaceholder},set:function(t){this._parentPlaceholder=t,this._propertyChanged.notify(this,"parentPlaceholder")},enumerable:!0,configurable:!0}),e.prototype.applyPermissionsConstrain=function(){null!=this.parentPlaceholder&&(this.parentPlaceholder.isCoverMode?(this.manipulationPermissions.resizeGrips.edgeConstraint=!1,this.manipulationPermissions.resizeGrips.setCornerArbitraryConstraint(!1),this.manipulationPermissions.allowRotateConstraint=!1):(this.manipulationPermissions.resizeGrips.edgeConstraint=null,this.manipulationPermissions.resizeGrips.setCornerArbitraryConstraint(null),this.manipulationPermissions.allowRotateConstraint=null),this.parentPlaceholder.applyPermissionsConstrain()),this.isRenderTypeIsNormal||(this.itemPermissions.allowOpacityChange=!1,this.shapePermissions.allowChangeBorderColor=!1,this.shapePermissions.allowChangeFillColor=!1)},e.prototype.getSimplifiedObject=function(e){return l.f(e)||l.k(e)||(e=[]),t.prototype.getSimplifiedObject.call(this,["parentPlaceholder"].concat(e))},e.prototype._canSetIsVariable=function(){return!0},e.prototype._getPrintAreaBounds=function(){var t=null!=this.parentContainer?this.parentContainer:null!=this.parentPlaceholder?this.parentPlaceholder.parentContainer:null;return t instanceof a.g?t.parentComponent.bounds:null},e.prototype._getParentContainer=function(){return null!=this.parentPlaceholder?this.parentPlaceholder.parentContainer:null},e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i),n._maskOpacity=e._maskOpacity,n.isVariable=e.isVariable},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(u.g)(this._maskOpacity,e._maskOpacity)&&Object(u.g)(this.isVariable,e.isVariable)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="ContentItem",e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(462),o=n(428),a=n(448),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(n){void 0===n&&(n=new o.a(0,0,10,10));var r=t.call(this,a.a.rectangle(n.left,n.top,n.width,n.height))||this;return r.type=e.type,r.sourceRectangle=n,r}return s(e,t),e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="RectangleItem",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return u}));var r,i=n(411),o=n(422),a=n(408),s=n(415),l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};!function(t){t.Miter="Miter",t.Round="Round",t.Bevel="Bevel"}(r||(r={}));var u=function(){function t(e){this._color=i.RgbColors.black,this._size=0,this._lineJoin=r.Miter,this.type=t.type,this._propertyChanged=new a.c,null!=e&&(this.color=null!=e.color?e.color:i.RgbColors.black,this.size=null!=e.size?e.size:0,this.lineJoin=null!=e.lineJoin?e.lineJoin:r.Miter)}return Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(t){i.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},set:function(t){this._size!==t&&(this._size=t,this._propertyChanged.notify(this,"size"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this._propertyChanged.notify(this,"lineJoin"))},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return new t(this)},t.prototype.equals=function(e){return e instanceof t&&this.color.equals(e.color)&&Object(o.e)(this.size,e.size)&&this.lineJoin==e.lineJoin},t.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.getSimplifiedObject=function(){return{color:this.color.getData(),size:this.size,lineJoin:this.lineJoin}},t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t.type="StrokeSettings",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(s.a)({enumObject:r}),l("design:type",String),l("design:paramtypes",[String])],t.prototype,"lineJoin",null),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(411),i=n(422),o=n(408),a=function(){function t(t){this._color=r.RgbColors.black,this._angle=0,this._distance=0,this._size=0,this._propertyChanged=new o.c,null!=t&&(this.color=null!=t.color?t.color:r.RgbColors.black,this.angle=null!=t.angle?t.angle:0,this.distance=null!=t.distance?t.distance:0,this.size=null!=t.size?t.size:0)}return Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(t){r.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle!==t&&(this._angle=t,this._propertyChanged.notify(this,"angle"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"distance",{get:function(){return this._distance},set:function(t){this._distance!==t&&(this._distance=t,this._propertyChanged.notify(this,"distance"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},set:function(t){this._size!==t&&(this._size=t,this._propertyChanged.notify(this,"size"))},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return new t(this)},t.prototype.equals=function(e){return e instanceof t&&this.color.equals(e.color)&&Object(i.e)(this.angle,e.angle)&&Object(i.e)(this.distance,e.distance)&&Object(i.e)(this.size,e.size)},t.equals=function(t,e){return null==t&&null==e||null!=t&&null!=e&&t.equals(e)},t.prototype.getSimplifiedObject=function(){return{color:this.color.getData(),angle:this.angle,distance:this.distance,size:this.size}},t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(408),i=function(){function t(){this._allowChangeBarcodeType=!0,this._allowChangeBarcodeContent=!0,this._allowChangeBarcodeColor=!0,this.propertyChanged=new r.a}return Object.defineProperty(t.prototype,"allowChangeBarcodeType",{get:function(){return this._allowChangeBarcodeType},set:function(t){this._allowChangeBarcodeType!==t&&(this._allowChangeBarcodeType=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowChangeBarcodeContent",{get:function(){return this._allowChangeBarcodeContent},set:function(t){this._allowChangeBarcodeContent!==t&&(this._allowChangeBarcodeContent=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowChangeBarcodeColor",{get:function(){return this._allowChangeBarcodeColor},set:function(t){this._allowChangeBarcodeColor!==t&&(this._allowChangeBarcodeColor=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeBarcodeType=this.allowChangeBarcodeType,t.allowChangeBarcodeContent=this.allowChangeBarcodeContent,t.allowChangeBarcodeColor=this.allowChangeBarcodeColor,t},t.prototype.clone=function(){var e=new t;return e.allowChangeBarcodeType=this.allowChangeBarcodeType,e.allowChangeBarcodeContent=this.allowChangeBarcodeContent,e.allowChangeBarcodeColor=this.allowChangeBarcodeColor,e},t.prototype.equals=function(t){return this.allowChangeBarcodeColor===t.allowChangeBarcodeColor&&this.allowChangeBarcodeContent===t.allowChangeBarcodeContent&&this.allowChangeBarcodeType===t.allowChangeBarcodeType},t}()},function(t,e,n){"use strict";function r(t,e){return t/e*72}n.d(e,"a",(function(){return r})),n(406),n(407),n(425)},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r,i=n(451),o=n(421),a=n(745),s=n(407),l=n(409),u=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},h=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t},p=function(t){function e(n){var r=t.call(this)||this;return r.items=new o.a,r.type=e.type,r.groupItemPermissions=new a.a,r._ignorePermissionsChange=!0,r._groupItemPermissions.allowReplaceContent=!1,r._ignorePermissionsChange=!1,r.items.add_itemAdded((function(t){t.item.parentGroupItem=r,r._propertyChanged.notify(r,"items")})),r.items.add_itemRemoved((function(t){t.item.parentGroupItem=null,r._propertyChanged.notify(r,"items")})),null!=n&&r.items.addRange(n),r}return u(e,t),Object.defineProperty(e.prototype,"groupItemPermissions",{get:function(){return this._groupItemPermissions},set:function(t){if(null==t)throw new s.a("groupItemPermissions cannot be null");Object(l.g)(this._groupItemPermissions,t)||(null!=this._groupItemPermissions&&this._groupItemPermissions.propertyChanged.remove(this._onPermissionsChanged),this._groupItemPermissions=t,this._groupItemPermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged())},enumerable:!0,configurable:!0}),e.prototype.addItems=function(t,e){var n;null!=e&&(t=t.reverse()),null!=t&&0!==t.length&&(null!=e&&e>-1?this.items.insertAt(e,t):(n=this.items).add.apply(n,h(t)))},e.prototype._onContainerChanged=function(){var t=this;this.applyToItems((function(e){e.parentContainer=t.parentContainer}))},e.prototype.addItem=function(t,e){null!=e&&e>-1?this.items.insertAt(e,t):this.items.add(t)},e.prototype.removeItems=function(t){var e,n;if(null!=t&&t.length>0)try{for(var r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),i=r.next();!i.done;i=r.next()){var o=i.value;this.items.remove(o)}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e.prototype.getNestedItems=function(t){void 0===t&&(t=!1);for(var n=[],r=h(this.items);r.length>0;){var i=r.shift();i instanceof e&&(r.splice.apply(r,h([r.indexOf(i),0],i.items)),t)||n.push(i)}return n},e.prototype.getSimplifiedObject=function(e){void 0===e&&(e=[]);var n=t.prototype.getSimplifiedObject.call(this,["groupManipulationPermissions","itemRemovedEvent","groupItemPermissions","items"].concat(e));return n.items=this.items.toArray().map((function(t){return t.getSimplifiedObject()})),n.groupItemPermissions=this.groupItemPermissions.getSimplifiedObject(),n},e.prototype._copy=function(e,n,r,i){if(t.prototype._copy.call(this,e,n,r,i),!(e.items.length<=0)){var o=e.items.toArray().map((function(t){return t.clone(r,i)}));n.items.clear(),n.items.addRange(o),n.groupItemPermissions=e.groupItemPermissions.clone()}},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),this.itemPermissions.itemToolbarPermissions.showEditButton=!1,this.itemPermissions.itemToolbarPermissions.showSelectButton=!1},e.prototype.applyToItems=function(t){this.items.forEach(t)},Object.defineProperty(e.prototype,"manipulationPermissions",{get:function(){if(0===this.items.length)return this.groupManipulationPermissions;var t=this.groupManipulationPermissions.clone();return this.getNestedItems(!0).forEach((function(e){t.allowDelete=t.allowDelete&&e.manipulationPermissions.allowDelete})),Object.freeze(t),t},set:function(t){throw new Error("You cannot use ManipulationPermissions setter with GroupItem. Use groupManipulationPermissions setter instead")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"groupManipulationPermissions",{get:function(){return t.prototype.getManipulationPermissions.call(this)},set:function(e){t.prototype.setManipulationPermissions.call(this,e)},enumerable:!0,configurable:!0}),e.prototype.isChildVisible=function(t){return!0},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(l.g)(this.groupItemPermissions,e.groupItemPermissions),i=Object(l.c)(h(this.items),h(e.items));return n&&r&&i},e.type="GroupItem",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(408),i=n(415),o=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},a=function(){function t(t){this._allowChangeImage=!0,this.allowEditImageConstraint=null,this._allowEditImage=!0,this._allowKeepOverlayColor=!1,this.propertyChanged=new r.a,null==t&&(t=!0),this.allowChangeImage=t,this.allowEditImage=t,this.allowKeepOverlayColor=t}return Object.defineProperty(t.prototype,"allowChangeImage",{get:function(){return this._allowChangeImage},set:function(t){this._allowChangeImage!==t&&(this._allowChangeImage=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowEditImage",{get:function(){return null!=this.allowEditImageConstraint?this.allowEditImageConstraint:this._allowEditImage},set:function(t){this._allowEditImage!==t&&(this._allowEditImage=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowKeepOverlayColor",{get:function(){return this._allowKeepOverlayColor},set:function(t){this._allowKeepOverlayColor!==t&&(this._allowKeepOverlayColor=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.allowChangeImage=this.allowChangeImage,e.allowEditImage=this.allowEditImage,e.allowKeepOverlayColor=this.allowKeepOverlayColor,e},t.prototype.equals=function(t){return this.allowChangeImage===t.allowChangeImage&&this.allowEditImage===t.allowEditImage&&this.allowKeepOverlayColor===t.allowKeepOverlayColor},t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeImage=this.allowChangeImage,t.allowEditImage=this.allowEditImage,t.allowKeepOverlayColor=this.allowKeepOverlayColor,t},function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(i.a)({ignore:!0}),o("design:type",Boolean)],t.prototype,"allowEditImageConstraint",void 0),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(416),i=n(409),o=n(477),a=function(){function t(t){if(this.storageId=null,this.size=new o.a,this.name=null,this.isUserImage=!1,this.isVector=!1,this.pageIndex=0,"string"==typeof t)try{t=JSON.parse(t)}catch(e){console.warn("Unable to parse ImageMetaData from string ",t,e),t=null}r.j(t)&&r.c(this,t)}return t.fromInterface=function(e,n){var r=new t;return r.storageId=e.id,r.size=new o.a(e.width,e.height),r.name=void 0!==n?n:null,null!=e.isVector&&(r.isVector=e.isVector),r},t.prototype.clone=function(){return new t(this)},t.prototype.equals=function(t){return this.storageId===t.storageId&&Object(i.g)(this.size,t.size)&&Object(i.g)(this.name,t.name)&&Object(i.g)(this.isUserImage,t.isUserImage)&&Object(i.g)(this.isVector,t.isVector)&&Object(i.g)(this.pageIndex,t.pageIndex)},t}()},function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return R}));var r,i,o,a,s=n(462),l=n(475),u=n(506),c=n(411),h=n(566),p=n(438),f=n(559),d=n(428),g=n(448),m=n(407),y=n(473),_=n(409),v=n(476),b=n(415),w=n(461),C=n(463),P=n(561),S=n(437),x=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),I=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},O=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},T=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},L=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(T(arguments[e]));return t};!function(t){t[t.None=0]="None",t[t.Center=1]="Center",t[t.Top=2]="Top",t[t.Bottom=3]="Bottom"}(i||(i={})),function(t){t[t.None=0]="None",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Left=3]="Left"}(o||(o={})),function(t){t[t.Fit=0]="Fit",t[t.Fill=1]="Fill",t[t.Original=2]="Original"}(a||(a={}));var R=function(t){function e(n){var r=t.call(this,null!=n?g.a.rectangle(n.left,n.top,n.width,n.height):null)||this;return r._isStubContent=!1,r._isCoverMode=!1,r._contentResizeMode=a.Fill,r._contentEffect=C.a.None,r._contentFillColor=null,r._contentOverlayEffect=null,r.stubStorageMeta=null,r.linkId=null,r.allowedSubfolder=null,r.allowedTabs=null,r.contentVerticalAlignment=i.None,r.contentHorizontalAlignment=o.None,r.type=e.type,r._content=null,r._topFrames=[],r._bottomFrames=[],r._onContentOverlayEffectPropertyChanged=function(t,e){r._propertyChanged.notify(r,"contentOverlayEffect")},r.fixedStubContentSize=!1,r.sourceRectangle=null!=n?n:new d.a(0,0,10,10),r.fillColor=c.RgbColors.transparent,r.borderWidth=0,r.placeholderPermissions=new h.a,r._contentPermissions=new f.a,r._contentPermissions.propertyChanged.add(r._onPermissionsChanged),r._setViolationSettings(new P.a,!0),r._ignorePermissionsChange=!0,r.manipulationPermissions.resizeGrips=new p.a(!0,!0,!1),r.shapePermissions.allowChangeFillColor=!1,r.itemPermissions.allowRemoveOnLayoutChange=!0,r.itemPermissions.itemToolbarPermissions.showEditButton=!0,r.itemPermissions.itemToolbarPermissions.showSelectButtonConstraint=null,r.itemPermissions.itemToolbarPermissions.showSelectButton=!0,r.contentPermissions.imagePermissions.allowKeepOverlayColor=!1,r._ignorePermissionsChange=!1,r}return x(e,t),Object.defineProperty(e.prototype,"contentEffect",{get:function(){return this._contentEffect},set:function(t){this._contentEffect!==t&&(this._contentEffect=t,this._propertyChanged.notify(this,"contentEffect"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentFillColor",{get:function(){return this._contentFillColor},set:function(t){this._contentFillColor!==t&&(this._contentFillColor=t,this._propertyChanged.notify(this,"contentFillColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isStubContent",{get:function(){return this._isStubContent},set:function(t){this._isStubContent!==t&&(this._isStubContent=t,this._setStubStorageMeta(),this.applyPermissionsConstrain(),this._propertyChanged.notify(this,"isStubContent"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentResizeMode",{get:function(){return this.isCoverMode?a.Fill:this.isBarcodePlaceholder?a.Fit:this._contentResizeMode},set:function(t){this._contentResizeMode!==t&&(this._contentResizeMode=t,this._propertyChanged.notify(this,"contentResizeMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentOverlayEffect",{get:function(){return this._contentOverlayEffect},set:function(t){v.a.equals(this.contentOverlayEffect,t)||(this._unsubscribeContentOverlayEffectPropertyChanged(),this._contentOverlayEffect=t,this._subscribeContentOverlayEffectPropertyChanged(),this._propertyChanged.notify(this,"contentOverlayEffect"))},enumerable:!0,configurable:!0}),e.prototype._subscribeContentOverlayEffectPropertyChanged=function(){null!=this.contentOverlayEffect&&this.contentOverlayEffect.addPropertyChanged(this._onContentOverlayEffectPropertyChanged)},e.prototype._unsubscribeContentOverlayEffectPropertyChanged=function(){null!=this.contentOverlayEffect&&this.contentOverlayEffect.removePropertyChanged(this._onContentOverlayEffectPropertyChanged)},Object.defineProperty(e.prototype,"isCoverMode",{get:function(){return null==this.barcodeFormat&&this._isCoverMode},set:function(t){this._isCoverMode!==t&&(this._isCoverMode=t,this.isEmptyContent||this.content.applyPermissionsConstrain(),this._propertyChanged.notify(this,"isCoverMode"))},enumerable:!0,configurable:!0}),e.prototype.getImagePermissions=function(){return null!=this.contentPermissions?this.contentPermissions.imagePermissions:this.content instanceof l.a?this.content.imagePermissions:null},e.prototype.applyPermissionsConstrain=function(){var t=this.itemPermissions.itemToolbarPermissions,e=this.getImagePermissions(),n=null==e||e.allowChangeImage,r=null!=e&&e.allowEditImage,i=null!=this.content&&this.content instanceof l.a&&null!=this.content.source&&this.content.source.isVector;this.isStubOrEmpty||!r||i?t.showEditButtonConstraint=!1:t.showEditButtonConstraint=null,t.showSelectButtonConstraint=!(!n||this.isStubOrEmpty)&&null,null!=this.placeholderPermissions&&(this.placeholderPermissions.showSelectButtonConstraint=!!n&&null),null!=this.contentPermissions&&null!=this.contentPermissions.imagePermissions&&(null!=this.barcodeFormat?this.contentPermissions.imagePermissions.allowEditImageConstraint=!1:this.contentPermissions.imagePermissions.allowEditImageConstraint=null),this.isBarcodePlaceholder&&(null!=this.manipulationPermissions&&(this.manipulationPermissions.resizeGrips.edge=!1,this.manipulationPermissions.resizeGrips.setCornerArbitrary(!1)),null!=this.itemPermissions&&null!=t&&(t.showSelectButton=!1,t.showEditButtonConstraint=null),null!=this.placeholderPermissions&&(this.placeholderPermissions.allowEditContent=!1,this.placeholderPermissions.showHandleButton=!1),null!=this.contentPermissions&&null!=this.contentPermissions.barcodePermissions&&(this.contentPermissions.barcodePermissions.allowChangeBarcodeContent?this.placeholderPermissions.showSelectButtonConstraint=null:(this.placeholderPermissions.showSelectButtonConstraint=!1,t.showEditButtonConstraint=this.contentPermissions.barcodePermissions.allowChangeBarcodeContent)))},Object.defineProperty(e.prototype,"contentPermissions",{get:function(){return this._contentPermissions},set:function(t){if(null==t)throw new m.a("ContentPermissions cannot be null");Object(_.g)(this._contentPermissions,t)||(this._contentPermissions.propertyChanged.remove(this._onPermissionsChanged),this._contentPermissions=t,this._contentPermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholderPermissions",{get:function(){return this._placeholderPermissions},set:function(t){if(null==t)throw new m.a("placeholderPermissions cannot be null");Object(_.g)(this._placeholderPermissions,t)||(null!=this._placeholderPermissions&&this._placeholderPermissions.propertyChanged.remove(this._onPermissionsChanged),this._placeholderPermissions=t,this.applyPermissionsConstrain(),this._placeholderPermissions.propertyChanged.add(this._onPermissionsChanged),this._propertyChanged.notify(this,"placeholderPermissions"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"violationSettings",{get:function(){return this._violationSettings},set:function(t){this._setViolationSettings(t)},enumerable:!0,configurable:!0}),e.prototype._setViolationSettings=function(e,n){if(void 0===n&&(n=!1),!(n||e instanceof P.a))throw new m.a("Shape ViolationSettings property must has ImageViolationSettings type!");t.prototype._setViolationSettings.call(this,e,n)},Object.defineProperty(e.prototype,"isFrame",{get:function(){return null!=this._topFrames&&this._topFrames.length>0||null!=this._bottomFrames&&this._bottomFrames.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this._content},set:function(t){this._content=t,this.isEmptyContent||(this._content.parentPlaceholder=this,this._content.parentContainer=null,this._content.applyPermissionsConstrain()),this.applyPermissionsConstrain(),this._setStubStorageMeta(),this._propertyChanged.notify(this,"content")},enumerable:!0,configurable:!0}),e.prototype._setStubStorageMeta=function(){this.isStubContent&&this._content instanceof l.a?this.stubStorageMeta=new u.a({isUserImage:this._content.isUserImage,isVector:this._content.source.isVector,name:"Stub content",size:{width:this._content.source.width,height:this._content.source.height},storageId:this._content.source.id,origin:this._content.source.origin}):this.stubStorageMeta=null},Object.defineProperty(e.prototype,"topFrames",{get:function(){return this._topFrames},set:function(t){var e=this;if(null==t)throw new m.a;this._topFrames=t,this._topFrames.forEach((function(t){t.parentPlaceholder=e,t.parentContainer=null}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottomFrames",{get:function(){return this._bottomFrames},set:function(t){var e=this;if(null==t)throw new m.a;this._bottomFrames=t,this._bottomFrames.forEach((function(t){t.parentPlaceholder=e,t.parentContainer=null}))},enumerable:!0,configurable:!0}),e.prototype.updateContentAndFrames=function(t){null!=this.content&&t(this.content),null!=this.topFrames&&this.topFrames.forEach((function(e){t(e)})),null!=this.bottomFrames&&this.bottomFrames.forEach((function(e){t(e)}))},Object.defineProperty(e.prototype,"imageContent",{get:function(){return!this.isEmptyContent&&this.content instanceof l.a?this._content:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEmptyContent",{get:function(){return null==this._content},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isStubOrEmpty",{get:function(){return this.isStubContent||this.isEmptyContent},enumerable:!0,configurable:!0}),e.prototype._canSetIsVariable=function(){return!0},Object.defineProperty(e.prototype,"isBarcodePlaceholder",{get:function(){return null!=this.barcodeFormat},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(){var e=t.prototype.getSimplifiedObject.call(this,["_content","imageContent","placeholderPermissions","contentPermissions","isFrame","isEmptyContent","isStubOrEmpty","isBarcodePlaceholder"]);return e.content=null!=this.content?this.content.getSimplifiedObject():null,e.placeholderPermissions=this.placeholderPermissions.getSimplifiedObject(),e.contentPermissions=this.contentPermissions.getSimplifiedObject(),e},e.prototype._copy=function(e,n,r,i){if(t.prototype._copy.call(this,e,n,r,i),n.linkId=e.linkId,n.allowedSubfolder=e.allowedSubfolder,n.allowedTabs=null!=e.allowedTabs?e.allowedTabs.map((function(t){return t})):null,n.contentVerticalAlignment=e.contentVerticalAlignment,n.contentHorizontalAlignment=e.contentHorizontalAlignment,n.placeholderPermissions=e.placeholderPermissions.clone(),null!=e.content?(null==n.content?n.content=e.content.clone(r,i):n.content.update(e.content),n.content.parentPlaceholder=n):n.content=null,e.topFrames.length===n.topFrames.length)for(var o=0;o<e.topFrames.length;o++)n.topFrames[o].update(e.topFrames[o]),n.topFrames[o].parentPlaceholder=n;else n.topFrames=e.topFrames.map((function(t){var e=t.clone(r,i);return e.parentPlaceholder=n,e}));if(e.bottomFrames.length===n.bottomFrames.length)for(o=0;o<e.bottomFrames.length;o++)n.bottomFrames[o].update(e.bottomFrames[o]),n.bottomFrames[o].parentPlaceholder=n;else n.bottomFrames=e.bottomFrames.map((function(t){var e=t.clone(r,i);return e.parentPlaceholder=n,e}));n.stubStorageMeta=null!=e.stubStorageMeta?e.stubStorageMeta.clone():null,n.isStubContent=e.isStubContent,n.isCoverMode=e.isCoverMode,n.contentResizeMode=e.contentResizeMode,n.contentEffect=e.contentEffect,n.contentFillColor=null!=e._contentFillColor?e._contentFillColor.clone():null,n.contentOverlayEffect=null!=e.contentOverlayEffect?e.contentOverlayEffect.clone():null,n.barcodeFormat=e.barcodeFormat,n.contentPermissions=e.contentPermissions.clone(),n.isVariable=e.isVariable},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(_.c)(L([this._content],this._topFrames,this._bottomFrames),L([e._content],e._topFrames,e._bottomFrames))&&Object(_.g)(this.linkId,e.linkId)&&Object(_.g)(this.allowedSubfolder,e.allowedSubfolder)&&Object(_.c)(this.allowedTabs,e.allowedTabs)&&Object(_.g)(this.contentVerticalAlignment,e.contentVerticalAlignment)&&Object(_.g)(this.contentHorizontalAlignment,e.contentHorizontalAlignment)&&Object(_.g)(this._placeholderPermissions,e._placeholderPermissions)&&Object(_.g)(this.stubStorageMeta,e.stubStorageMeta)&&Object(_.g)(this._isStubContent,e._isStubContent)&&Object(_.g)(this._isCoverMode,e._isCoverMode)&&Object(_.g)(this._contentResizeMode,e._contentResizeMode)&&Object(_.g)(this._contentEffect,e._contentEffect)&&Object(_.g)(this.barcodeFormat,e.barcodeFormat)&&Object(_.g)(this._contentPermissions,e._contentPermissions)&&Object(_.g)(this.isVariable,e.isVariable)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="PlaceholderItem",I([Object(b.a)({factory:new S.c(u.a),displayName:"Stub storage meta"}),O("design:type",u.a)],e.prototype,"stubStorageMeta",void 0),I([Object(b.a)({type:"string"}),O("design:type",String)],e.prototype,"linkId",void 0),I([Object(b.a)({factory:new S.d("subfolder"),displayName:"Allowed subfolder"}),O("design:type",String)],e.prototype,"allowedSubfolder",void 0),I([Object(b.a)({factory:new S.a(Array),displayName:"Allowed tabs"}),O("design:type",Array)],e.prototype,"allowedTabs",void 0),I([Object(b.a)({enumObject:i}),O("design:type",Object)],e.prototype,"contentVerticalAlignment",void 0),I([Object(b.a)({enumObject:o}),O("design:type",Object)],e.prototype,"contentHorizontalAlignment",void 0),I([Object(b.a)({enumObject:C.a}),O("design:type",Number),O("design:paramtypes",[Number])],e.prototype,"contentEffect",null),I([Object(b.a)({factory:new S.b,displayName:"Content fill color"}),O("design:type",c.Color),O("design:paramtypes",[c.Color])],e.prototype,"contentFillColor",null),I([Object(b.a)({enumObject:a}),O("design:type",Object),O("design:paramtypes",[Object])],e.prototype,"contentResizeMode",null),I([Object(b.a)({enumObject:y.a,factory:new S.d(y.a.QR_CODE),displayName:"Barcode format"}),O("design:type",String)],e.prototype,"barcodeFormat",void 0),I([Object(b.a)({factory:new S.c(v.a,{color:new c.CmykColor(0,0,0,0,255),opacity:1,blendMode:w.a.Normal}),displayName:"Content overlay effect"}),O("design:type",Object),O("design:paramtypes",[Object])],e.prototype,"contentOverlayEffect",null),I([Object(b.a)({type:"item"}),O("design:type",Object),O("design:paramtypes",[Object])],e.prototype,"content",null),e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r,i=n(464),o=n(478),a=n(406),s=n(417),l=n(465),u=n(409),c=n(410),h=n(425),p=n(411),f=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n,r,i){void 0===n&&(n=null);var a=t.call(this,e,n,r,i)||this;return a._onCanvasChangedDelegate=null,a._contentType=o.a.NotContent,a._parentPlaceholder=null,a._pixelWidth=0,a._pixelHeight=0,a._needToDownloadImage=!1,a._imageContainer=new l.a(a._onImageLoaded.bind(a)),a}return f(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentPlaceholder",{get:function(){return this._parentPlaceholder},set:function(t){this._parentPlaceholder=t},enumerable:!0,configurable:!0}),e.prototype._getLayer=function(){return null!=this.parentPlaceholder?this.parentPlaceholder.layer:t.prototype._getLayer.call(this)},Object.defineProperty(e.prototype,"contentType",{get:function(){return this._contentType},set:function(t){this._contentType=t},enumerable:!0,configurable:!0}),e.prototype.isVisible=function(){return null!=this._parentPlaceholder?this._parentPlaceholder.isVisible():t.prototype.isVisible.call(this)},e.prototype.quickUpdate=function(){this._updateImageUrl()},e.prototype._getScaleMultiplier=function(){var t=this._parentPlaceholder,e=t.rectangle,n=this.rectangle,r=t.previousRectangle.width/t.previousRectangle.height,i=e.width/e.height,o=n.width/n.height,a=i>o!=r>o;return i>o?a?e.width/o/t.previousRectangle.height:e.width/t.previousRectangle.width:a?e.height*o/t.previousRectangle.width:e.height/t.previousRectangle.height},e.prototype.setRectangle=function(e,n){var r,i=this._parentPlaceholder,s=this._contentType===o.a.TopFrame||this._contentType===o.a.BottomFrame;if(null!=i&&i.item.isCoverMode&&!i.item.isStubContent&&!s){var l=i.rectangle,u=e.clone(),h=Object(a.EqualsOfFloatNumbers)(Object(a.normalizeAngle)(u.angle-l.angle)%180,90),p=this.rectangle;if(null!=p&&null!=i.previousRectangle&&!i.editing){var f=this._getScaleMultiplier();u.width=p.width*f,u.height=p.height*f,u.center=l.center;var d=u.angle;u.angle=0;var g=(i.previousRectangle.centerX-p.centerX+p.width/2)*f-u.width/2,m=(i.previousRectangle.centerY-p.centerY+p.height/2)*f-u.height/2;(r=new a.PointF(-g,-m)).rotateAt(l.angle-i.previousRectangle.angle),u.centerX=l.centerX+r.x,u.centerY=l.centerY+r.y,u.rotateAt(d,u.center)}var y=h?u.height:u.width,_=h?u.width:u.height;if(y<l.width||_<l.height){var v=Math.max(l.width/y,l.height/_);u.width*=v,u.height*=v}var b=l.angle;l.angle=0;var w=l.bounds,C=u.clone();C.rotateAt(-b,l.center);var P=C.bounds;return(r=new a.PointF(0,0)).x=w.left<P.left?w.left-P.left:0,r.x=w.right>P.right?w.right-P.right:r.x,r.y=w.top<P.top?w.top-P.top:0,r.y=w.bottom>P.bottom?w.bottom-P.bottom:r.y,r.rotate(b),u.centerX+=r.x,u.centerY+=r.y,void t.prototype.setRectangle.call(this,u,n)}if((null==i?void 0:i.item.contentResizeMode)===c.ib.Fit&&!i.editing){var S=i.rectangle,x=this.rectangle.clone().rotateAt(-this.rectangle.angle,S.center),I=S.width/x.width,O=S.height/x.height,T=Math.min(I,O);return x.width=x.width*T,x.height=x.height*T,x.bounds.left=(S.width-x.width)/2+S.bounds.left,x.bounds.top=(S.height-x.height)/2+S.bounds.top,this._updatePosition(x,i),void t.prototype.setRectangle.call(this,x,n)}t.prototype.setRectangle.call(this,e,n)},e.prototype.updateRectangle=function(t,e,n,r,i,o){null==e&&(e=c.ib.Fit),null==t&&(t=!1);var a=this.getTransformedRectangle(!1);if(r=null!=r?r:this.bounds.width,i=null!=i?i:this.bounds.height,t){var s=r/i,l=a.location;a.width=a.height*s,a.location=l}else if(null!=this.parentPlaceholder&&(a=this.parentPlaceholder.getTransformedRectangle(!1)),e===c.ib.Original&&this.item instanceof c.J){var u=this.item.getOriginalImageSize(),h=null!=o?this.item.source.dpiX/o:1;a.width=u.width*h,a.height=u.height*h}else h=1,e===c.ib.Fit?h=Math.min(a.width/r,a.height/i):e===c.ib.Fill&&(h=Math.max(a.width/r,a.height/i)),a.width=r*h,a.height=i*h;this._updatePosition(a,n),this.setTransformedRectangle(a)},e.prototype._updatePosition=function(t,e){if(null!=e){var n=e.getTransformedRectangle(!1);switch(e.item.contentVerticalAlignment){case c.vb.Top:t.centerY=n.centerY-(n.height-t.height)/2;break;case c.vb.Center:case c.vb.None:t.centerY=n.centerY;break;case c.vb.Bottom:t.centerY=n.centerY+(n.height-t.height)/2}switch(e.item.contentHorizontalAlignment){case c.H.Left:t.centerX=n.centerX-(n.width-t.width)/2;break;case c.H.Center:case c.H.None:t.centerX=n.centerX;break;case c.H.Right:t.centerX=n.centerX+(n.width-t.width)/2}}},e.prototype.drawItemHandler=function(t,e){if(null!=t&&null!=this.canvas)if(this._isReadyToDraw){var n=null!=this._parentPlaceholder?this._parentPlaceholder.rectangle:this.rectangle,r=this.rectangle,i=this._getItemColorPreviews(),o=i.fillColorPreview,l=i.borderColorPreview,u=i.altBorderColorPreview;this._hasVectorMask()&&(t.save(),this._clip(t));var c=this.isNormalRenderingType?this.item.opacity:1;s.a.fillRectangle(t,r,null==o?void 0:o.toString(),c),this._imageContainer.isLoaded?this._drawImage(t,this.canvas.disableSmoothing):this._imageContainer.isLoading&&this.canvas.drawWaitClock(null!=e?e:t,new a.PointF(n.centerX,n.centerY));var h=this._getActualBorderWidth();r.width+=h,r.height+=h,s.a.drawStroke(t,a.Path.rotatedRectangle(r),r.center,new a.Transform,h,null==l?void 0:l.toString(),null==u?void 0:u.toString(),this.item.opacity,this.item.dash),this._hasVectorMask()&&t.restore()}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.drawMaskedContent=function(t){if(this._drawImage(t,this.canvas.disableSmoothing,this.item.maskOpacity),null!=this._parentPlaceholder){t.globalCompositeOperation="destination-out";var e=this._parentPlaceholder;s.a.fillPath(t,e.originalPath,e.getControlCenter(),e.item.transform,"#fff"),t.globalCompositeOperation="source-over"}},e.prototype.transformByMatrix=function(e,n,r){var i;void 0===r&&(r=null),(null===(i=this.parentPlaceholder)||void 0===i?void 0:i.editing)&&this.parentPlaceholder.setContentUpdating(!n),t.prototype.transformByMatrix.call(this,e,n,r)},e.prototype.dispose=function(){if(this._imageContainer.dispose(),this._onCanvasChangedDelegate){var e=this.canvas;e&&e.remove_zoomChanged(this._onCanvasChangedDelegate),delete this._onCanvasChangedDelegate}t.prototype.dispose.call(this)},e.prototype._isReady=function(){return t.prototype._isReady.call(this)&&(u.l(this._imageContainer.source)||this._imageContainer.isLoaded)},e.prototype._getDrawingFillColor=function(){return this.item.fillColor},e.prototype._isLoadingImage=function(){return this._imageContainer.isLoading},e.prototype._setIsLoadingImage=function(t){this._imageContainer.isLoading=t},e.prototype._onItemPropertyChanged=function(e,n){var r;switch(n){case"maskOpacity":break;case"parentPlaceholder":this.parentPlaceholder=null!=e.parentPlaceholder?null===(r=this.canvas)||void 0===r?void 0:r.getItemHandler(e.parentPlaceholder):null}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getSrc=function(){var t=this._imageContainer.source;return u.l(t)?this._createImageUrl():t},e.prototype._setSrc=function(t){this._imageContainer.source=t},e.prototype._onImageLoaded=function(t,e){try{null!=this.canvas&&this.canvas.redraw(),this.isLoadingImage=!1,this._dispatchReadyEvent()}catch(n){throw console.error("Exception in ["+this.getTypeName()+"#"+this.name+"]._onImageLoaded",n),n}},e.prototype._createImageUrl=function(){return null},e.prototype._updateImageUrl=function(){if(this.isVisible()){var t=this.canvas;if(null!=t&&t.isInitialized){var e=this._createImageUrl();e!==this._imageContainer.source&&(null==e?(this._imageContainer.clear(),t.redraw()):this._imageContainer.updateUrl(e))}}},e.prototype._onCanvasChanged=function(t){t.fullUpdate&&this._updateImageUrl()},e.prototype._getItemColorPreviews=function(){var e=t.prototype._getItemColorPreviews.call(this),n=e.borderColorPreview,r=e.altBorderColorPreview;return{fillColorPreview:this._getFillColorPreview(),borderColorPreview:n,altBorderColorPreview:r}},e.prototype._drawImage=function(t,e,n,r){var i=this.canvas,o=h.a.screenDpi*i.zoom/72,a=h.a.screenDpi*i.zoom/72,l=this.isNormalRenderingType?this.item.opacity:1,u=null!=n?l*n:l;s.a.drawImage(t,null!=r?r:this._imageContainer.image,this.rectangle,o,a,e,null,u)},e.prototype._getBoundsMargin=function(){return 2*this._getActualBorderWidth()},e.prototype._onAddedOnCanvas=function(e,n){if(t.prototype._onAddedOnCanvas.call(this,e,n||null!=this.parentPlaceholder),this._updateImageUrl(),!this._onCanvasChangedDelegate){var r=this.canvas;r&&(this._onCanvasChangedDelegate=this._onCanvasChanged.bind(this),r.add_zoomChanged(this._onCanvasChangedDelegate),this._needToDownloadImage&&this.update())}},e.prototype._onRemovedFromCanvas=function(e){t.prototype._onRemovedFromCanvas.call(this,e),e&&null!=this._onCanvasChangedDelegate&&(e.remove_zoomChanged(this._onCanvasChangedDelegate),delete this._onCanvasChangedDelegate)},e.prototype._getFillColorPreview=function(){var t=this._getDrawingFillColor(),e=this.isNormalRenderingType||(null==t?void 0:t.isTransparent)?t:p.RgbColors.black,n=this._colorPreviewService.getPreviews([e])[0];return null!=this.item.fillColor&&null==n&&this._colorPreviewService.subscribeToPreviewLoaded(e,this._onColorPreviewLoaded),n},e.typeName="ContentItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(422),o=n(408),a=n(423),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n,r,i,a,s,l,u,c,h,p,f,d,g=t.call(this)||this;g._propertyChanged=new o.c;var m=e;return g._left=null!==(i=null!==(r=null!==(n=null==m?void 0:m.left)&&void 0!==n?n:null==m?void 0:m.horizontal)&&void 0!==r?r:m)&&void 0!==i?i:0,g._top=null!==(l=null!==(s=null!==(a=null==m?void 0:m.top)&&void 0!==a?a:null==m?void 0:m.vertical)&&void 0!==s?s:m)&&void 0!==l?l:0,g._right=null!==(h=null!==(c=null!==(u=null==m?void 0:m.right)&&void 0!==u?u:null==m?void 0:m.horizontal)&&void 0!==c?c:m)&&void 0!==h?h:0,g._bottom=null!==(d=null!==(f=null!==(p=null==m?void 0:m.bottom)&&void 0!==p?p:null==m?void 0:m.vertical)&&void 0!==f?f:m)&&void 0!==d?d:0,g}return s(e,t),Object.defineProperty(e.prototype,"left",{get:function(){return this._left},set:function(t){Object(i.e)(t,this._left)||(this._left=t,this._propertyChanged.notify(this,"left"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this._top},set:function(t){Object(i.e)(t,this._top)||(this._top=t,this._propertyChanged.notify(this,"top"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this._right},set:function(t){Object(i.e)(t,this._right)||(this._right=t,this._propertyChanged.notify(this,"right"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this._bottom},set:function(t){Object(i.e)(t,this._bottom)||(this._bottom=t,this._propertyChanged.notify(this,"bottom"))},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return new e({left:this.left,top:this.top,right:this.right,bottom:this.bottom})},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this._left&&0===this._top&&0===this._right&&0===this._bottom},enumerable:!0,configurable:!0}),e.prototype.equals=function(t){return this.left===t.left&&this.top===t.top&&this.right===t.right&&this.bottom===t.bottom},e.prototype.getSimplifiedObject=function(){return{left:this.left,top:this.top,right:this.right,bottom:this.bottom}},e.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},e.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return _}));var r,i=n(423),o=n(457),a=n(459),s=n(416),l=n(410),u=n(511),c=n(407),h=n(421),p=n(458),f=n(408),d=n(406),g=n(543),m=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_=function(t){function e(e,n,r,i,o,s,l){void 0===i&&(i=[]);var c=t.call(this,o,s)||this;if(c._rotateAngle=0,c._mockup=new u.a,c._printAreas=new h.a,c._previewMockups=new h.a,c._interactiveZones=new h.a,c._printAreasCollectionChangedEvent=new f.c,c._printAreaAddedEvent=new f.c,c._printAreaRemovedEvent=new f.c,c._activityZoneChangedEvent=new f.c,c._onContainersItemAdded=function(t){t.item.parentComponent=c},c._onContainersItemRemoved=function(t){t.item.parentComponent=null},c.watermark=null,c._containers=new h.a,c._onPrintAreaAdded=function(t){var e=t.item;e.parentSurface=c,c._printAreaAddedEvent.notify(c,e)},c._onPrintAreaRemoved=function(t){var e=t.item;e.parentSurface=null,c._printAreaRemovedEvent.notify(c,e)},c._onInteractiveZoneCollectionChanged=function(t){c._propertyChanged.notify(c,"interactiveZones")},c.width=null!=e?e:100,c.height=null!=n?n:100,c.parentProduct=null,c.mockup=null!=r?r:new u.a,c.printAreas.add_itemAdded(c._onPrintAreaAdded),c.printAreas.add_itemRemoved(c._onPrintAreaRemoved),c.printAreas.setRange(i),c._containers.add_itemAdded(c._onContainersItemAdded),c._containers.add_itemRemoved(c._onContainersItemRemoved),c._subscribeInteractiveZonesEvents(),l){var d=new p.g;d.name=a.a.BG_CONTAINER_NAME,c.containers.push(d);var g=new p.g;g.name=a.a.MAIN_CONTAINER_NAME,c.containers.push(g);var m=new p.g;m.name=a.a.FG_CONTAINER_NAME,c.containers.push(m)}return c}return m(e,t),Object.defineProperty(e.prototype,"rotateAngle",{get:function(){return this._rotateAngle},set:function(t){var e=Object(d.normalizeAngle)(t);e!==this._rotateAngle&&(this._rotateAngle=e,this._propertyChanged.notify(this,"rotateAngle"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){t!==this._width&&(this._width=t,this._propertyChanged.notify(this,"width"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){t!==this._height&&(this._height=t,this._propertyChanged.notify(this,"height"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mockup",{get:function(){return this._mockup},set:function(t){if(null==t)throw new c.a("mockup can`t be null");t!==this._mockup&&(this._mockup=t,null!=this._mockup&&(this._mockup.parentSurface=this),this._propertyChanged.notify(this,"mockup"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previewMockups",{get:function(){return this._previewMockups},set:function(t){var e,n;if(null!=this._previewMockups)try{for(var r=y(this._previewMockups),i=r.next();!i.done;i=r.next())i.value.parentSurface=null}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}if(this._previewMockups=t,null!=this._previewMockups)for(var o=0;o<this._previewMockups.length;++o)this._previewMockups.get(o).parentSurface=this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"containers",{get:function(){return this._containers},set:function(t){if(null!=t&&t!==this._containers){null!=this._containers&&(this._containers.clear(),this._containers.remove_itemAdded(this._onContainersItemAdded),this._containers.remove_itemRemoved(this._onContainersItemRemoved)),this._containers=t;for(var e=0;e<this._containers.length;e++)this._onContainersItemAdded({index:e,item:this._containers.get(e)});this._containers.add_itemAdded(this._onContainersItemAdded),this._containers.add_itemRemoved(this._onContainersItemRemoved)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"printAreas",{get:function(){return this._printAreas},set:function(t){var e,n;if(null!=t&&t!==this._printAreas){null!=this._printAreas&&(this._printAreas.clear(),this._printAreas.remove_itemAdded(this._onPrintAreaAdded),this._printAreas.remove_itemRemoved(this._onPrintAreaRemoved)),this._printAreas=t;try{for(var r=y(this._printAreas),i=r.next();!i.done;i=r.next()){var o=i.value;this._onPrintAreaAdded({item:o})}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}this._printAreas.add_itemAdded(this._onPrintAreaAdded),this._printAreas.add_itemRemoved(this._onPrintAreaRemoved)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"interactiveZones",{get:function(){return this._interactiveZones},set:function(t){null!=t&&t!==this._interactiveZones&&(this._unsubscribeInteractiveZonesEvents(),this._interactiveZones=t,this._subscribeInteractiveZonesEvents(),this._propertyChanged.notify(this,"interactiveZones"))},enumerable:!0,configurable:!0}),e.prototype.add_printAreaAdded=function(t){this._printAreaAddedEvent.add(t)},e.prototype.remove_printAreaAdded=function(t){this._printAreaAddedEvent.remove(t)},e.prototype.add_printAreaRemoved=function(t){this._printAreaRemovedEvent.add(t)},e.prototype.remove_printAreaRemoved=function(t){this._printAreaRemovedEvent.remove(t)},e.prototype.getSimplifiedObject=function(){return t.prototype.getSimplifiedObject.call(this,["parentProduct","nonChannelContainerItems"])},e.prototype.getAllItems=function(t){void 0===t&&(t={ignoreMockups:!1});var e=t.ignoreMockups?g.from(this.containers):g.empty().concat(this.mockup.underContainers.cast(),this.containers.cast(),this.mockup.overContainers.cast());null!=t.containerFilterFunc&&(e=e.where(t.containerFilterFunc));var n=e.selectMany((function(t){return t.items.cast()}));return(t.flatGroupItems||t.includePlaceholderContents)&&(n=n.aggregate(new h.a,(function(e,n){return n instanceof l.G?(e.addRange(n.getNestedItems()),t.excludeGroupItems||e.add(n)):e.add(n),t.includePlaceholderContents&&n instanceof l.cb&&(null!=n.content&&e.add(n.content),n.topFrames.concat(n.bottomFrames).forEach((function(t){return e.add(t)}))),e}))),n},e.getItems=function(t,e){return t instanceof Array&&(t=g.from(t)),t.selectMany((function(t){return t.getAllItems(e)})).toArray()},e.prototype.getBackgroundItem=function(){var t=this.containers.firstOrDefault((function(t){return t.name===a.a.BG_CONTAINER_NAME}));return null!=t?t.items.get(0):null},e.prototype._copy=function(e,n,r){if(t.prototype._copy.call(this,e,n,r),n.width=e.width,n.height=e.height,n.rotateAngle=e.rotateAngle,n.mockup=e.mockup.clone(r),n.previewMockups.addRange(e.previewMockups.toArray().map((function(t){return t.clone(r)}))),n.printAreas.addRange(e.printAreas.toArray().map((function(t){return t.clone(r)}))),n.containers.addRange(e.containers.toArray().map((function(t){return t.clone(r)}))),n.watermark=null!=e.watermark?e.watermark.clone():null,e.interactiveZones){var i=e.interactiveZones.toArray().map((function(t){return t.clone(r)}));n.interactiveZones=new h.a(i)}},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.generateNewIds=function(){this._generateNewId(),this._mockup.generateNewIds(),this._previewMockups.forEach((function(t){return t.generateNewIds()})),this._printAreas.forEach((function(t){return t.generateNewIds()})),this._containers.forEach((function(t){return t.generateNewIds()})),this._interactiveZones.forEach((function(t){return t.generateNewIds()}))},e.getAllItems=function(t,e){return void 0===e&&(e={ignoreMockups:!1}),t instanceof Array&&(t=g.from(t)),t.selectMany((function(t){return t.getAllItems(e)}))},Object.defineProperty(e.prototype,"nonChannelContainerItems",{get:function(){return s.e(this._containers.toArray().filter((function(t){return t.renderingType===o.RenderingType.Normal})).map((function(t){return t.items.toArray()})))},enumerable:!0,configurable:!0}),e.prototype._subscribeInteractiveZonesEvents=function(){var t;null===(t=this._interactiveZones)||void 0===t||t.add_collectionChanged(this._onInteractiveZoneCollectionChanged)},e.prototype._unsubscribeInteractiveZonesEvents=function(){var t;null===(t=this._interactiveZones)||void 0===t||t.remove_collectionChanged(this._onInteractiveZoneCollectionChanged)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r,i=n(423),o=n(421),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e,n){void 0===e&&(e=[]),void 0===n&&(n=[]);var r=t.call(this)||this;return r.parentSurface=null,r._underContainers=new o.a,r._overContainers=new o.a,r._onContainerAdded=function(t){t.item.parentComponent=r},r.underContainers.add_itemAdded(r._onContainerAdded),r.underContainers.setRange(e),r.overContainers.add_itemAdded(r._onContainerAdded),r.overContainers.setRange(n),r}return a(e,t),e.prototype.isEmpty=function(){return this.underContainers.concat(this.overContainers).all((function(t){return t.items.empty}))},Object.defineProperty(e.prototype,"underContainers",{get:function(){return this._underContainers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overContainers",{get:function(){return this._overContainers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allContainers",{get:function(){return this._overContainers.concat(this._underContainers)},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(){return t.prototype.getSimplifiedObject.call(this,["parentSurface","allContainers"])},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.generateNewIds=function(){this._generateNewId(),this._underContainers.forEach((function(t){return t.generateNewIds()})),this._overContainers.forEach((function(t){return t.generateNewIds()}))},e.prototype._copy=function(e,n,r){t.prototype._copy.call(this,e,n,r),n.underContainers.addRange(e.underContainers.toArray().map((function(t){return t.clone(r)}))),n.overContainers.addRange(e.overContainers.toArray().map((function(t){return t.clone(r)})))},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return c}));var r,i=n(428),o=n(411),a=n(571),s=n(408),l=n(406),u=n(509);!function(t){t.Crop="Crop",t.Trim="Trim",t.Bleed="Bleed"}(r||(r={}));var c=function(){function t(t){this._propertyChanged=new s.c,this._name="bleed",this._widthPx=1,this._color=o.RgbColors.white,this._altColor=o.RgbColors.black,this._stepPx=10,this._margin=new u.a(10),this._borderRadius=null,this._pdfBox=null,null!=t&&Object.assign(this,t)}return Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){this._name!==t&&(this._name=t,this._propertyChanged.notify(this,"name"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widthPx",{get:function(){return this._widthPx},set:function(t){l.EqualsOfFloatNumbers(this._widthPx,t)||(this._widthPx=t,this._propertyChanged.notify(this,"widthPx"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(t){o.Color.equals(this._color,t)||(this._color=t,this._propertyChanged.notify(this,"color"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"altColor",{get:function(){return this._altColor},set:function(t){o.Color.equals(this._altColor,t)||(this._altColor=t,this._propertyChanged.notify(this,"altColor"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"margin",{get:function(){return this._margin},set:function(t){"number"==typeof t&&(t=new u.a(t)),this._margin=t,this._propertyChanged.notify(this,"margin")},enumerable:!0,configurable:!0}),t.prototype.getMargin=function(){return this._margin},Object.defineProperty(t.prototype,"stepPx",{get:function(){return this._stepPx},set:function(t){l.EqualsOfFloatNumbers(this._stepPx,t)||(this._stepPx=t,this._propertyChanged.notify(this,"stepPx"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"borderRadius",{get:function(){return this._borderRadius},set:function(t){this._borderRadius!==t&&(this._borderRadius=t,this._propertyChanged.notify(this,"borderRadius"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pdfBox",{get:function(){return this._pdfBox},set:function(t){this._pdfBox!==t&&(this._pdfBox=t,this._propertyChanged.notify(this,"pdfBox"))},enumerable:!0,configurable:!0}),t.prototype.getRectangle=function(t){var e=this.getMargin();return i.a.FromLTRB(t.left+e.left,t.top+e.top,t.right-e.right,t.bottom-e.bottom)},t.prototype.getCornerRadiuses=function(t){return null==this.borderRadius?null:new a.a(this.getRectangle(t),72).convert(this.borderRadius)},t.prototype.addPropertyChanged=function(t){this._propertyChanged.add(t)},t.prototype.removePropertyChanged=function(t){this._propertyChanged.remove(t)},t.prototype.clone=function(){var e,n=new t;return n.name=this.name,n.widthPx=this.widthPx,n.color=this.color.clone(),n.altColor=this.altColor.clone(),n.stepPx=this.stepPx,n.borderRadius=this.borderRadius,n.pdfBox=this.pdfBox,n.margin=null===(e=this._margin)||void 0===e?void 0:e.clone(),n},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(t){this.__type="ItemHandlerData",this.P=[],this.Tg=null,this.ID="vo"+(new Date).getTime()+Math.round(1e3*Math.random()),t&&(this.P=t.controlPoints,this.Tg=t.tag,this.ID=t.uniqueId)}return t.prototype.applyState=function(t,e){e&&(e.beginUpdate(),e.controlPoints=t.P,e.tag=t.Tg,e.uniqueId=t.ID,e.endUpdate())},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(456),i=n(611),o=n(423),a=n(411),s=n(450),l=n(449),u=n(406),c=n(512),h=n(421),p=n(476),f=function(){function t(t){this._additionalConverters=r.isArray(t)?t:[],this.productParser=new i.a(t)}return t.prototype.deserialize=function(t){var e=t;return"string"==typeof t&&(e=JSON.parse(t)),r.isObject(e)?this.productParser.parseProduct(e):null},t.prototype.serialize=function(t,e){return this.serializeModelComponent(t,e)},t.prototype.serializeModelComponent=function(t,e){var n=this;return null==e&&(e=!1),JSON.stringify(t,(function(t,e){if(e instanceof o.a)return e.getSimplifiedObject();if(e instanceof a.Color)return e.getData();if(e instanceof s.a)return e.getData();if(e instanceof l.a)return{scaleX:e.scaleX,scaleY:e.scaleY,translateX:e.translateX,translateY:e.translateY,angle:e.angle};if(e instanceof c.b)return{name:e.name,altColor:e.altColor,color:e.color,margin:e.margin,stepPx:e.stepPx,widthPx:e.widthPx,borderRadius:e.borderRadius,pdfBox:e.pdfBox};if(e instanceof u.SizeF)return e.width+", "+e.height;if(e instanceof u.Path)return e.toString();if(e instanceof h.a)return e.toArray();if(e instanceof p.a)return e.getSimplifiedObject();var i=r.find(n._additionalConverters,(function(t){return e instanceof t.typeCtor}));return null!=i&&((e=r.clone(e)).$type=i.type),e}),2)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(411),o=n(407),a=function(){function t(){}return t.parse=function(e){if(null==e)return null;if(null==e.colorSpace)throw new o.c("Unable to parse color, data colorSpace is not set");var n=i.ColorSpace[e.colorSpace.toString()];if(null==n)throw new o.c("Unable to parse color, unknown data colorSpace: '"+e.colorSpace+"'");var r=t._mappedParsers[i.ColorSpace[n]];if(null==r)throw new o.c("Unable to parse color, color space '"+n+"' is not supported");return r(e)},t.parseRgbColor=function(t){return new i.RgbColor(t.r,t.g,t.b,t.alpha,t.profile)},t._parseCmykColor=function(t){return new i.CmykColor(t.c,t.m,t.y,t.k,t.alpha,t.profile)},t._parseGrayscaleColor=function(t){return new i.GrayscaleColor(t.l,t.alpha,t.profile)},t._parseLabColor=function(t){return new i.LabColor(t.l,t.a,t.b,t.alpha,t.profile)},t._parseSpotColor=function(e){var n=t._parseInk(e.ink);return new i.SpotColor(n,e.tint,e.alpha)},t._parseInk=function(e){var n=t.parse(e.alternativeColor);return new i.Ink(e.name,n,e.solidity)},t._mappedParsers=((r={})[i.ColorSpace.Rgb]=t.parseRgbColor,r[i.ColorSpace.Cmyk]=t._parseCmykColor,r[i.ColorSpace.Grayscale]=t._parseGrayscaleColor,r[i.ColorSpace.Lab]=t._parseLabColor,r[i.ColorSpace.Spot]=t._parseSpotColor,r),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(432),o=n(406),a=n(417),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e,n,r,i){return void 0===n&&(n=null),t.call(this,e,n,r,i)||this}return s(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(e){if(t.prototype.drawItemHandler.call(this,e),!0===window.__$abl$){var n=this._getBaselineLocation(),r=new o.RotatedRectangleF(n.x,n.y,6,6,0);a.a.fillRectangle(e,r,"red")}},e.prototype.onResized=function(){if(null!=this.canvas){var e=this.rectangle.height/this._height,n=parseFloat((this.item.font.size*e).toFixed(1)),r=parseFloat((this.item.leading*e).toFixed(1)),i=this.canvas,a=i.minFontSize;n="number"==typeof a?Math.max(n,a):n;var s=i.maxFontSize;if(n="number"==typeof s?Math.min(n,s):n,0!==r){var l=i.minLeading;r="number"==typeof l?Math.max(r,l):r;var u=i.maxLeading;r="number"==typeof u?Math.min(r,u):r}return Object(o.EqualsOfFloatNumbers)(n,this.item.font.size,.01)&&Object(o.EqualsOfFloatNumbers)(r,this.item.leading,.01)?(null!=this._startRectangle?(this.setRectangle(this._startRectangle),i.updateSelection(),delete this._startRectangle):this.update(null,null),!1):t.prototype.onResized.call(this)}},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.baselineLocation=e.baselineLocation},e.prototype._onItemPropertyChanged=function(e,n){var r=this;switch(n){case"baselineLocation":case"isVertical":this.update();break;case"alignment":var i=this.rectangle.location,o=this.canvas.history;null!=o&&o.pause(),this.update(null,(function(){var t=r.rectangle.location,e=i.x-t.x,n=i.y-t.y;r.item.transform.move(e,n),null!=o&&o.resume()}))}"alignment"!==n&&t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips.setCornerArbitrary(!1),e.manipulation.resizeGrips.edge=!1,e},e.prototype._getBaselineLocation=function(){var t=this.getControlCenter(),e=this.item.baselineLocation.clone();return e.transform(this.item.transform.clone(),t),e},e.typeName="PlainTextItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r,i=n(432),o=n(453),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=t.call(this,e)||this;return n.__type="BaseTextHandlerData",n}return a(e,t),e.prototype.applyState=function(e,n){n&&(n.beginUpdate(),null!=e.currentTextImage?n.currentTextImage=Object.assign(new i.b,e.currentTextImage):n.currentTextImage=null),t.prototype.applyState.call(this,e,n)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r,i=n(432),o=n(406),a=n(417),s=n(410),l=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e,n,r,i){void 0===n&&(n=null),void 0===r&&(r=null);var o=t.call(this,e,n,r,i)||this;return o._lastRectangle=null,o._textAutoFitted=null,o._updateEmptyTextControlPoints(),o}return l(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drawingRectangle",{get:function(){return this.canvas.isItemHandlerSelected(this)&&this.canvas.isSelectionResizing&&null!=this.startRectangle?this.startRectangle:this.rectangle},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastRectangle",{get:function(){return this._lastRectangle},set:function(t){this._lastRectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textAutoFitted",{get:function(){var t;return null==this._textAutoFitted&&(this._textAutoFitted=(t=this.item).overflowStrategy!==s.X.Clip&&(t.shrinkMode===s.mb.Scale||t.shrinkMode===s.mb.Size)&&(t.originalVerticalScale<t.verticalScale||t.originalHorizontalScale<t.horizontalScale)),this._textAutoFitted},enumerable:!0,configurable:!0}),e.prototype.getTextWrappingPath=function(){return this.item.textWrappingMode!==s.xb.None?o.Path.rotatedRectangle(this.getTextRectangle()):null},e.prototype.drawItemHandler=function(e){t.prototype.drawItemHandler.call(this,e),!0===window.__$abl$&&a.a.drawRectangle(e,this.getTextRectangle(),1,"red",1)},e.prototype.getTextRectangle=function(){var t=this.getControlCenter(),e=o.RotatedRectangleF.fromRectangleF(this.item.textRectangle);return e.transform(this.item.transform.clone(),t),e},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this._textAutoFitted=null,this.item.scheduledFitMode=null,this.item.textRectangle=e.textRectangle,this.item.firstBaselineOffset=e.firstBaselineOffset,this.item.firstBaselineMinOffset=e.firstBaselineMinOffset},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"textRectangle":case"verticalAlignment":case"isVertical":case"paragraphSettings":case"wrappingMargin":case"scheduledFitMode":case"shrinkMode":case"overflowStrategy":case"wrappingPath":case"firstBaselineOffset":case"firstBaselineMinOffset":case"characterLimit":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._updateEmptyTextControlPoints=function(){var t=this.item.textRectangle;this._controlPoints[0].x=t.left,this._controlPoints[0].y=t.top,this._controlPoints[1].x=t.right,this._controlPoints[1].y=t.bottom;var e=this.canvas;null!=e&&e.redraw(),this.onSuccessResponse(),this._setIsImageLoaded(!0)},e.prototype._setDefaultTextControlPoints=function(){},e.typeName="BoundedTextItemHandler",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r,i=n(406),o=n(410),a=n(432),s=n(417),l=n(479),u=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e,n,r,i){void 0===n&&(n=null);var o=t.call(this,e,n,r,i)||this;return o._lastRectangle=null,o._lastRectangle=null,o}return u(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"boundingPaths",{get:function(){var t=[],e=this.getControlCenter(),n=this.item.transform.clone();return this.originalBoundingPaths.forEach((function(r){var i=r.clone();i.transform(n,e),t.push(i)})),t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalBoundingPaths",{get:function(){return this.item.boundingPaths},set:function(t){this.item.boundingPaths=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastRectangle",{get:function(){return this._lastRectangle},set:function(t){this._lastRectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrappingMargin",{get:function(){return this.item.wrappingMargin},set:function(t){this.item.wrappingMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphSettings",{get:function(){return this.item.paragraphSettings},set:function(t){t instanceof o.Z||(t=new o.Z(t)),this.item.paragraphSettings=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this.item.isVertical},set:function(t){this.item.isVertical=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drawingRectangle",{get:function(){return this.canvas.isItemHandlerSelected(this)&&this.canvas.isSelectionResizing&&null!=this.startRectangle?this.startRectangle:this.rectangle},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(e){if(t.prototype.drawItemHandler.call(this,e),!0===window.__$abl$){var n=this.getControlCenter(),r=new i.Transform;this.boundingPaths.forEach((function(t){s.a.drawPath(e,t,n,r,1,"red",1)}))}},e.prototype.getBoundingPathsBounds=function(){return t=this,e=void 0,r=function(){var t,e,n,r;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){switch(o.label){case 0:return t=this.item.boundingPaths,[4,Promise.all(t.map((function(t){return l.a.getBounds(t)})))];case 1:return e=o.sent(),n=i.RectangleF.getOverallBounds(e),(r=i.RotatedRectangleF.fromRectangleF(n)).transform(this.item.transform.clone(),this.getControlCenter()),[2,r.toRectangleF()]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.boundingPaths=e.boundingPaths,this.item.wrappingMargin=e.wrappingMargin,this.item.characterLimit=e.characterLimit,this.item.paragraphSettings=e.paragraphSettings,this.item.isVertical=e.isVertical,this.item.firstBaselineOffset=e.firstBaselineOffset,this.item.firstBaselineMinOffset=e.firstBaselineMinOffset},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"boundingPaths":case"wrappingPath":case"wrappingMargin":case"paragraphSettings":case"isVertical":case"firstBaselineOffset":case"firstBaselineMinOffset":case"characterLimit":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDefaultTextControlPoints=function(){},e.typeName="PathBoundedTextItemHandler",e}(a.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n(520);class i{constructor(t,e){this.tag=t,this.value=e}equals(t){return this.tag===t.tag&&this.value==t.value}}class o{}class a extends r.a{constructor(){super(...arguments),this.content=[]}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{}r.fontName="font-name",r.fontSize="font-size",r.color="color",r.bold="bold",r.italic="italic",r.underline="underline",r.penColor="pen-color",r.penWidth="pen-width",r.tracking="tracking",r.leading="leading",r.sub="sub",r.sup="sup",r.allCaps="all-caps",r.smallCaps="small-caps",r.fontFamily="font-family",r.fontStyle="font-style",r.wordSpacingScale="word-spacing-scale",r.supSize="sup-size",r.supPosition="sup-position",r.subSize="sub-size",r.subPosition="sub-position",r.digitType="digit-type",r.openType="ot",r.baselineShift="baseline-shift",r.inkName="ink-name",r.inkSolidity="ink-solidity",r.inkColor="ink-color",r.penInkName="pen-ink-name",r.penInkSolidity="pen-ink-solidity",r.penInkColor="pen-ink-color",r.horizontalScale="horz-scale",r.verticalScale="vert-scale"},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r extends Error{constructor(t){super(t)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));class r{}r.alignment="alignment",r.firstLineIndent="first-line-indent",r.spaceAfter="space-after",r.spaceBefore="space-before",r.leftIndent="left-indent",r.rightIndent="right-indent",r.listType="list-type";class i{}i.type="list-type",i.bulletChar="bullet-char",i.bulletNumberTabPosition="bullet-number-tab-position",i.numberFormat="number-format",i.numberMode="number-mode",i.level="level",i.startAt="number-start-at"},function(t,e,n){"use strict";function r(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.freeze?e.freeze(t):t}var i=r({HTML:"text/html",isHTML:function(t){return t===i.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),o=r({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(t){return t===o.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});e.freeze=r,e.MIME_TYPE=i,e.NAMESPACE=o},function(t,e,n){var r;(function(){var n=this,i=n._,o=Array.prototype,a=Object.prototype,s=Function.prototype,l=o.push,u=o.slice,c=a.toString,h=a.hasOwnProperty,p=Array.isArray,f=Object.keys,d=s.bind,g=Object.create,m=function(){},y=function(t){return t instanceof y?t:this instanceof y?void(this._wrapped=t):new y(t)};t.exports&&(e=t.exports=y),e._=y,y.VERSION="1.8.3";var _=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},v=function(t,e,n){return null==t?y.identity:y.isFunction(t)?_(t,e,n):y.isObject(t)?y.matcher(t):y.property(t)};y.iteratee=function(t,e){return v(t,e,1/0)};var b=function(t,e){return function(n){var r=arguments.length;if(r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,l=0;l<s;l++){var u=a[l];e&&void 0!==n[u]||(n[u]=o[u])}return n}},w=function(t){if(!y.isObject(t))return{};if(g)return g(t);m.prototype=t;var e=new m;return m.prototype=null,e},C=function(t){return function(e){return null==e?void 0:e[t]}},P=Math.pow(2,53)-1,S=C("length"),x=function(t){var e=S(t);return"number"==typeof e&&e>=0&&e<=P};function I(t){return function(e,n,r,i){n=_(n,i,4);var o=!x(e)&&y.keys(e),a=(o||e).length,s=t>0?0:a-1;return arguments.length<3&&(r=e[o?o[s]:s],s+=t),function(e,n,r,i,o,a){for(;o>=0&&o<a;o+=t){var s=i?i[o]:o;r=n(r,e[s],s,e)}return r}(e,n,r,o,s,a)}}y.each=y.forEach=function(t,e,n){var r,i;if(e=_(e,n),x(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=y.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},y.map=y.collect=function(t,e,n){e=v(e,n);for(var r=!x(t)&&y.keys(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o},y.reduce=y.foldl=y.inject=I(1),y.reduceRight=y.foldr=I(-1),y.find=y.detect=function(t,e,n){var r;if(void 0!==(r=x(t)?y.findIndex(t,e,n):y.findKey(t,e,n))&&-1!==r)return t[r]},y.filter=y.select=function(t,e,n){var r=[];return e=v(e,n),y.each(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r},y.reject=function(t,e,n){return y.filter(t,y.negate(v(e)),n)},y.every=y.all=function(t,e,n){e=v(e,n);for(var r=!x(t)&&y.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},y.some=y.any=function(t,e,n){e=v(e,n);for(var r=!x(t)&&y.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},y.contains=y.includes=y.include=function(t,e,n,r){return x(t)||(t=y.values(t)),("number"!=typeof n||r)&&(n=0),y.indexOf(t,e,n)>=0},y.invoke=function(t,e){var n=u.call(arguments,2),r=y.isFunction(e);return y.map(t,(function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)}))},y.pluck=function(t,e){return y.map(t,y.property(e))},y.where=function(t,e){return y.filter(t,y.matcher(e))},y.findWhere=function(t,e){return y.find(t,y.matcher(e))},y.max=function(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e&&null!=t)for(var s=0,l=(t=x(t)?t:y.values(t)).length;s<l;s++)(r=t[s])>o&&(o=r);else e=v(e,n),y.each(t,(function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o},y.min=function(t,e,n){var r,i,o=1/0,a=1/0;if(null==e&&null!=t)for(var s=0,l=(t=x(t)?t:y.values(t)).length;s<l;s++)(r=t[s])<o&&(o=r);else e=v(e,n),y.each(t,(function(t,n,r){((i=e(t,n,r))<a||i===1/0&&o===1/0)&&(o=t,a=i)}));return o},y.shuffle=function(t){for(var e,n=x(t)?t:y.values(t),r=n.length,i=Array(r),o=0;o<r;o++)(e=y.random(0,o))!==o&&(i[o]=i[e]),i[e]=n[o];return i},y.sample=function(t,e,n){return null==e||n?(x(t)||(t=y.values(t)),t[y.random(t.length-1)]):y.shuffle(t).slice(0,Math.max(0,e))},y.sortBy=function(t,e,n){return e=v(e,n),y.pluck(y.map(t,(function(t,n,r){return{value:t,index:n,criteria:e(t,n,r)}})).sort((function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index})),"value")};var O=function(t){return function(e,n,r){var i={};return n=v(n,r),y.each(e,(function(r,o){var a=n(r,o,e);t(i,r,a)})),i}};y.groupBy=O((function(t,e,n){y.has(t,n)?t[n].push(e):t[n]=[e]})),y.indexBy=O((function(t,e,n){t[n]=e})),y.countBy=O((function(t,e,n){y.has(t,n)?t[n]++:t[n]=1})),y.toArray=function(t){return t?y.isArray(t)?u.call(t):x(t)?y.map(t,y.identity):y.values(t):[]},y.size=function(t){return null==t?0:x(t)?t.length:y.keys(t).length},y.partition=function(t,e,n){e=v(e,n);var r=[],i=[];return y.each(t,(function(t,n,o){(e(t,n,o)?r:i).push(t)})),[r,i]},y.first=y.head=y.take=function(t,e,n){if(null!=t)return null==e||n?t[0]:y.initial(t,t.length-e)},y.initial=function(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},y.last=function(t,e,n){if(null!=t)return null==e||n?t[t.length-1]:y.rest(t,Math.max(0,t.length-e))},y.rest=y.tail=y.drop=function(t,e,n){return u.call(t,null==e||n?1:e)},y.compact=function(t){return y.filter(t,y.identity)};var T=function(t,e,n,r){for(var i=[],o=0,a=r||0,s=S(t);a<s;a++){var l=t[a];if(x(l)&&(y.isArray(l)||y.isArguments(l))){e||(l=T(l,e,n));var u=0,c=l.length;for(i.length+=c;u<c;)i[o++]=l[u++]}else n||(i[o++]=l)}return i};function L(t){return function(e,n,r){n=v(n,r);for(var i=S(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}}function R(t,e,n){return function(r,i,o){var a=0,s=S(r);if("number"==typeof o)t>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=e(u.call(r,a,s),y.isNaN))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o<s;o+=t)if(r[o]===i)return o;return-1}}y.flatten=function(t,e){return T(t,e,!1)},y.without=function(t){return y.difference(t,u.call(arguments,1))},y.uniq=y.unique=function(t,e,n,r){y.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=v(n,r));for(var i=[],o=[],a=0,s=S(t);a<s;a++){var l=t[a],u=n?n(l,a,t):l;e?(a&&o===u||i.push(l),o=u):n?y.contains(o,u)||(o.push(u),i.push(l)):y.contains(i,l)||i.push(l)}return i},y.union=function(){return y.uniq(T(arguments,!0,!0))},y.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=S(t);r<i;r++){var o=t[r];if(!y.contains(e,o)){for(var a=1;a<n&&y.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},y.difference=function(t){var e=T(arguments,!0,!0,1);return y.filter(t,(function(t){return!y.contains(e,t)}))},y.zip=function(){return y.unzip(arguments)},y.unzip=function(t){for(var e=t&&y.max(t,S).length||0,n=Array(e),r=0;r<e;r++)n[r]=y.pluck(t,r);return n},y.object=function(t,e){for(var n={},r=0,i=S(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},y.findIndex=L(1),y.findLastIndex=L(-1),y.sortedIndex=function(t,e,n,r){for(var i=(n=v(n,r,1))(e),o=0,a=S(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o},y.indexOf=R(1,y.findIndex,y.sortedIndex),y.lastIndexOf=R(-1,y.findLastIndex),y.range=function(t,e,n){null==e&&(e=t||0,t=0),n=n||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i};var E=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=w(t.prototype),a=t.apply(o,i);return y.isObject(a)?a:o};y.bind=function(t,e){if(d&&t.bind===d)return d.apply(t,u.call(arguments,1));if(!y.isFunction(t))throw new TypeError("Bind must be called on a function");var n=u.call(arguments,2),r=function(){return E(t,r,e,this,n.concat(u.call(arguments)))};return r},y.partial=function(t){var e=u.call(arguments,1),n=function(){for(var r=0,i=e.length,o=Array(i),a=0;a<i;a++)o[a]=e[a]===y?arguments[r++]:e[a];for(;r<arguments.length;)o.push(arguments[r++]);return E(t,n,this,this,o)};return n},y.bindAll=function(t){var e,n,r=arguments.length;if(r<=1)throw new Error("bindAll must be passed function names");for(e=1;e<r;e++)t[n=arguments[e]]=y.bind(t[n],t);return t},y.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return y.has(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},y.delay=function(t,e){var n=u.call(arguments,2);return setTimeout((function(){return t.apply(null,n)}),e)},y.defer=y.partial(y.delay,y,1),y.throttle=function(t,e,n){var r,i,o,a=null,s=0;n||(n={});var l=function(){s=!1===n.leading?0:y.now(),a=null,o=t.apply(r,i),a||(r=i=null)};return function(){var u=y.now();s||!1!==n.leading||(s=u);var c=e-(u-s);return r=this,i=arguments,c<=0||c>e?(a&&(clearTimeout(a),a=null),s=u,o=t.apply(r,i),a||(r=i=null)):a||!1===n.trailing||(a=setTimeout(l,c)),o}},y.debounce=function(t,e,n){var r,i,o,a,s,l=function(){var u=y.now()-a;u<e&&u>=0?r=setTimeout(l,e-u):(r=null,n||(s=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=y.now();var u=n&&!r;return r||(r=setTimeout(l,e)),u&&(s=t.apply(o,i),o=i=null),s}},y.wrap=function(t,e){return y.partial(e,t)},y.negate=function(t){return function(){return!t.apply(this,arguments)}},y.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},y.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},y.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},y.once=y.partial(y.before,2);var j=!{toString:null}.propertyIsEnumerable("toString"),N=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function k(t,e){var n=N.length,r=t.constructor,i=y.isFunction(r)&&r.prototype||a,o="constructor";for(y.has(t,o)&&!y.contains(e,o)&&e.push(o);n--;)(o=N[n])in t&&t[o]!==i[o]&&!y.contains(e,o)&&e.push(o)}y.keys=function(t){if(!y.isObject(t))return[];if(f)return f(t);var e=[];for(var n in t)y.has(t,n)&&e.push(n);return j&&k(t,e),e},y.allKeys=function(t){if(!y.isObject(t))return[];var e=[];for(var n in t)e.push(n);return j&&k(t,e),e},y.values=function(t){for(var e=y.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},y.mapObject=function(t,e,n){e=v(e,n);for(var r,i=y.keys(t),o=i.length,a={},s=0;s<o;s++)a[r=i[s]]=e(t[r],r,t);return a},y.pairs=function(t){for(var e=y.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},y.invert=function(t){for(var e={},n=y.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},y.functions=y.methods=function(t){var e=[];for(var n in t)y.isFunction(t[n])&&e.push(n);return e.sort()},y.extend=b(y.allKeys),y.extendOwn=y.assign=b(y.keys),y.findKey=function(t,e,n){e=v(e,n);for(var r,i=y.keys(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r},y.pick=function(t,e,n){var r,i,o={},a=t;if(null==a)return o;y.isFunction(e)?(i=y.allKeys(a),r=_(e,n)):(i=T(arguments,!1,!1,1),r=function(t,e,n){return e in n},a=Object(a));for(var s=0,l=i.length;s<l;s++){var u=i[s],c=a[u];r(c,u,a)&&(o[u]=c)}return o},y.omit=function(t,e,n){if(y.isFunction(e))e=y.negate(e);else{var r=y.map(T(arguments,!1,!1,1),String);e=function(t,e){return!y.contains(r,e)}}return y.pick(t,e,n)},y.defaults=b(y.allKeys,!0),y.create=function(t,e){var n=w(t);return e&&y.extendOwn(n,e),n},y.clone=function(t){return y.isObject(t)?y.isArray(t)?t.slice():y.extend({},t):t},y.tap=function(t,e){return e(t),t},y.isMatch=function(t,e){var n=y.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0};var A=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof y&&(t=t._wrapped),e instanceof y&&(e=e._wrapped);var i=c.call(t);if(i!==c.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(y.isFunction(a)&&a instanceof a&&y.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var l=(n=n||[]).length;l--;)if(n[l]===t)return r[l]===e;if(n.push(t),r.push(e),o){if((l=t.length)!==e.length)return!1;for(;l--;)if(!A(t[l],e[l],n,r))return!1}else{var u,h=y.keys(t);if(l=h.length,y.keys(e).length!==l)return!1;for(;l--;)if(u=h[l],!y.has(e,u)||!A(t[u],e[u],n,r))return!1}return n.pop(),r.pop(),!0};y.isEqual=function(t,e){return A(t,e)},y.isEmpty=function(t){return null==t||(x(t)&&(y.isArray(t)||y.isString(t)||y.isArguments(t))?0===t.length:0===y.keys(t).length)},y.isElement=function(t){return!(!t||1!==t.nodeType)},y.isArray=p||function(t){return"[object Array]"===c.call(t)},y.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},y.each(["Arguments","Function","String","Number","Date","RegExp","Error"],(function(t){y["is"+t]=function(e){return c.call(e)==="[object "+t+"]"}})),y.isArguments(arguments)||(y.isArguments=function(t){return y.has(t,"callee")}),"object"!=typeof Int8Array&&(y.isFunction=function(t){return"function"==typeof t||!1}),y.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},y.isNaN=function(t){return y.isNumber(t)&&t!==+t},y.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===c.call(t)},y.isNull=function(t){return null===t},y.isUndefined=function(t){return void 0===t},y.has=function(t,e){return null!=t&&h.call(t,e)},y.noConflict=function(){return n._=i,this},y.identity=function(t){return t},y.constant=function(t){return function(){return t}},y.noop=function(){},y.property=C,y.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},y.matcher=y.matches=function(t){return t=y.extendOwn({},t),function(e){return y.isMatch(e,t)}},y.times=function(t,e,n){var r=Array(Math.max(0,t));e=_(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},y.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},y.now=Date.now||function(){return(new Date).getTime()};var F={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},B=y.invert(F),M=function(t){var e=function(e){return t[e]},n="(?:"+y.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};y.escape=M(F),y.unescape=M(B),y.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),y.isFunction(r)?r.call(t):r};var z=0;y.uniqueId=function(t){var e=++z+"";return t?t+e:e},y.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},U=/\\|'|\r|\n|\u2028|\u2029/g,W=function(t){return"\\"+H[t]};y.template=function(t,e,n){!e&&n&&(e=n),e=y.defaults({},e,y.templateSettings);var r=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,(function(e,n,r,a,s){return o+=t.slice(i,s).replace(U,W),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e})),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var s=function(t){return a.call(this,t,y)},l=e.variable||"obj";return s.source="function("+l+"){\n"+o+"}",s},y.chain=function(t){var e=y(t);return e._chain=!0,e};var V=function(t,e){return t._chain?y(e).chain():e};y.mixin=function(t){y.each(y.functions(t),(function(e){var n=y[e]=t[e];y.prototype[e]=function(){var t=[this._wrapped];return l.apply(t,arguments),V(this,n.apply(y,t))}}))},y.mixin(y),y.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=o[t];y.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],V(this,n)}})),y.each(["concat","join","slice"],(function(t){var e=o[t];y.prototype[t]=function(){return V(this,e.apply(this._wrapped,arguments))}})),y.prototype.value=function(){return this._wrapped},y.prototype.valueOf=y.prototype.toJSON=y.prototype.value,y.prototype.toString=function(){return""+this._wrapped},void 0===(r=function(){return y}.apply(e,[]))||(t.exports=r)}).call(this)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{static containsRtlChars(t){return new RegExp("^[^"+this._rtlChars+"]*?["+this._rtlChars+"]").test(t)}static insert(t,e,n){if(null==t)throw new Error("input string must not be null");if(e<0)throw new Error("index must be positive number");if(e>t.length)throw new console.error("index must not be greater than string length");return t.substring(0,e)+n+t.substring(e)}}r._rtlChars="֑-߿יִ-﷽ﹰ-ﻼ"},function(t,e,n){"use strict";function r(t,e){return null==t&&null==e||null!=t&&null!=e&&t.isEqual(e)}function i(t,e){if(null==t&&null==e)return!0;if(null==t||null==e)return!1;const n=r(t.getStart(),e.getStart())&&r(t.getEnd(),e.getEnd()),i=r(t.getStart(),e.getEnd())&&r(t.getEnd(),e.getStart());return n||i}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(407),i=n(528),o=n(482);class a{constructor(t){if(this._textPosition=null,!t)throw new r.c("Text position cannot be null or undefined");this._textPosition=t}getLineIndex(){return this._textPosition.getLineIndex()}getOffset(){return this._textPosition.getOffset()}getParagraphIndex(){return this._textPosition.getParagraphIndex()}isEqualTo(t){const e=this.getEntry();return Object(i.a)(e,o.a.getPosition(t).getEntry())}getEntry(){return this._textPosition}}},function(t,e,n){"use strict";(function(t){var r=n(418),i=n(445),o=n(814);function a(t){return r.a.isPlainObject(t)||r.a.isArray(t)}function s(t){return r.a.endsWith(t,"[]")?t.slice(0,-2):t}function l(t,e,n){return t?t.concat(e).map((function(t,e){return t=s(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const u=r.a.toFlatObject(r.a,{},null,(function(t){return/^is[A-Z]/.test(t)}));e.a=function(e,n,c){if(!r.a.isObject(e))throw new TypeError("target must be an object");n=n||new(o.a||FormData);const h=(c=r.a.toFlatObject(c,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!r.a.isUndefined(e[t])}))).metaTokens,p=c.visitor||y,f=c.dots,d=c.indexes,g=(c.Blob||"undefined"!=typeof Blob&&Blob)&&r.a.isSpecCompliantForm(n);if(!r.a.isFunction(p))throw new TypeError("visitor must be a function");function m(e){if(null===e)return"";if(r.a.isDate(e))return e.toISOString();if(!g&&r.a.isBlob(e))throw new i.a("Blob is not supported. Use a Buffer instead.");return r.a.isArrayBuffer(e)||r.a.isTypedArray(e)?g&&"function"==typeof Blob?new Blob([e]):t.from(e):e}function y(t,e,i){let o=t;if(t&&!i&&"object"==typeof t)if(r.a.endsWith(e,"{}"))e=h?e:e.slice(0,-2),t=JSON.stringify(t);else if(r.a.isArray(t)&&function(t){return r.a.isArray(t)&&!t.some(a)}(t)||(r.a.isFileList(t)||r.a.endsWith(e,"[]"))&&(o=r.a.toArray(t)))return e=s(e),o.forEach((function(t,i){!r.a.isUndefined(t)&&null!==t&&n.append(!0===d?l([e],i,f):null===d?e:e+"[]",m(t))})),!1;return!!a(t)||(n.append(l(i,e,f),m(t)),!1)}const _=[],v=Object.assign(u,{defaultVisitor:y,convertValue:m,isVisitable:a});if(!r.a.isObject(e))throw new TypeError("data must be an object");return function t(e,i){if(!r.a.isUndefined(e)){if(-1!==_.indexOf(e))throw Error("Circular reference detected in "+i.join("."));_.push(e),r.a.forEach(e,(function(e,o){!0===(!(r.a.isUndefined(e)||null===e)&&p.call(n,e,r.a.isString(o)?o.trim():o,i,v))&&t(e,i?i.concat(o):[o])})),_.pop()}}(e),n}}).call(this,n(197).Buffer)},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return Z})),n.d(e,"f",(function(){return h})),n.d(e,"g",(function(){return O})),n.d(e,"h",(function(){return x})),n.d(e,"i",(function(){return g})),n.d(e,"k",(function(){return w})),n.d(e,"l",(function(){return Y})),n.d(e,"m",(function(){return W})),n.d(e,"n",(function(){return H})),n.d(e,"o",(function(){return v})),n.d(e,"p",(function(){return P})),n.d(e,"c",(function(){return Q})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return G})),n.d(e,"e",(function(){return X})),n.d(e,"j",(function(){return i}));var r=n(427);class i{}class o{constructor(t){this.previousListItemIndex=t}}class a extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){const t=this._initData.previousListItemIndex;if(!this._textManager.isParagraphAListItem(t))return!1;const e=this._textManager.getCurrentParagraphIndex(),n=this._textManager.getCurrentCharStyle();return this._textManager.addListItem(e,t),this._deleteTextFromStartOfParagraphToCurrentPosition(e),this._textManager.setCurrentCharStyle(n),!0}_deleteTextFromStartOfParagraphToCurrentPosition(t){const e=this._textManager.getParagraphText(t).getStartPosition(),n=this._textManager.getCurrentPosition();if(e.isEqualTo(n))return;const r=this._textManager.getTextRangeByPositions(e,n),i=this._textManager.deleteTextByRange(r);this._textManager.setCursorToPosition(i)}}class s extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){var t;if(null===(t=this._initData)||void 0===t?void 0:t.paragraphIndex)this._textManager.deleteListItem(this._initData.paragraphIndex);else{const t=this._textManager.getCurrentCharStyle(),e=this._textManager.getCurrentParagraphIndex();this._textManager.deleteListItem(e),this._textManager.setCurrentCharStyle(t)}return!0}}class l extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){var t,e;let n=null!==(e=null===(t=this._initData)||void 0===t?void 0:t.paragraphIndexes)&&void 0!==e?e:this._textManager.getSelectedParagraphIndexes();return!!this._textManager.isParagraphsTheSameList(n)&&(n.forEach((t=>this._textManager.increaseListItemIndent(t))),!0)}}class u extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){var t,e;let n=null!==(e=null===(t=this._initData)||void 0===t?void 0:t.paragraphIndexes)&&void 0!==e?e:this._textManager.getSelectedParagraphIndexes();return!!this._textManager.isParagraphsTheSameList(n)&&(n.forEach((t=>this._textManager.decreaseListItemIndent(t))),!0)}}class c{constructor(t,e){this._textManager=t,this._initData=e}execute(){var t;const e=this._initData.listType,n=null!==(t=this._initData.paragraphIndexes)&&void 0!==t?t:this._textManager.getSelectedParagraphIndexes();return this._textManager.applyListType(n,e),!0}}class h{constructor(t){this.direction=t}}class p{constructor(t,e){this._textManager=t,this._initData=e}execute(){const t=this._initData.direction;return this._tryToDeleteNextListItem(t),this._textManager.deleteTextToDirection(t),!0}_tryToDeleteNextListItem(t){if(null==this._textManager.getSelectedTextRange()&&this._isDeletionToTheRight(t)){const t=this._textManager.getCurrentParagraphIndex()+1;this._textManager.isParagraphAListItem(t)&&this._isCursorAtTheEndOfParagraph()&&this._textManager.deleteListItem(t)}}_isCursorAtTheEndOfParagraph(){var t;const e=this._textManager.getCurrentParagraphIndex(),n=this._textManager.getCurrentPosition(),r=null===(t=this._textManager.getParagraphText(e))||void 0===t?void 0:t.getEndPosition();return n.getOffset()===r.getOffset()&&n.getLineIndex()===r.getLineIndex()}_isDeletionToTheRight(t){return t===r.f.right||t===r.f.rightWord||t===r.f.textEnd||t===r.f.lineEnd||t===r.f.down}}class f{constructor(t){this._textManager=t}execute(){return!1!==this._textManager.canRedo&&(this._textManager.redo(),!0)}}class d{constructor(t){this._textManager=t}execute(){return!1!==this._textManager.canUndo&&(this._textManager.undo(),!0)}}class g{constructor(t,e){this.text=t,this.isNewLineEnabled=e}}class m{constructor(t,e){this._textManager=t,this._initData=e}get text(){return this._initData.text}execute(){let t=this._initData.text;return this._initData.isNewLineEnabled||(-1!==t.search("\n")||-1!==t.search("\r"))&&(t=t.replace("\r",""),t=t.replace("\n","")),this._textManager.insertPlainText(t),!0}}class y{constructor(t,e,n){this._textManager=t,this._fontRegistry=e,this._initData=n}execute(){var t;const e=this._initData.style;if(!e)return!1;const n=null===(t=e.font)||void 0===t?void 0:t.postScriptName;return null==n||this._fontRegistry.containsFonts([n])?this._textManager.setCurrentCharStyle(e):this._fontRegistry.loadFonts([n]).then((t=>this._textManager.setCurrentCharStyle(e))),!0}}class _{constructor(t,e){this._textManager=t,this._initData=e}execute(){const t=this._initData.style;return!!t&&(this._textManager.setCurrentParagraphStyle(t),!0)}}class v{constructor(t){this.point=t}}class b{constructor(t,e){this._textManager=t,this._initData=e}execute(){return this._textManager.setCursorToPoint(this._initData.point),!0}}class w{constructor(t,e){this.direction=t,this.withSelection=e}}class C{constructor(t,e){this._textManager=t,this._initData=e}execute(){const t=this._initData.direction,e=this._initData.withSelection;return this._textManager.moveCursorToDirection(t,e),!0}}class P{constructor(t,e){this.startPoint=t,this.endPoint=e}}class S{constructor(t,e){this._textManager=t,this._initData=e}execute(){return this._textManager.setSelection(this._initData.startPoint,this._initData.endPoint),!0}}class x{constructor(t){this.isNewLineEnabled=t}}class I{constructor(t,e){this._textManager=t,this._initData=e}execute(){if(!this._initData.isNewLineEnabled)return!1;const t=this._textManager.getCurrentParagraphIndex(),e=this._textManager.getCurrentParagraphStyle(),n=this._textManager.getCurrentCharStyle();return this._textManager.insertNewLine(),this._textManager.getParagraphText(t+1).isEmpty&&(this._textManager.setCurrentCharStyle(n),this._textManager.setCurrentParagraphStyle(e)),!0}}class O{constructor(t){this.isNewLineEnabled=t}}class T{constructor(t,e){this._textManager=t,this._initData=e}execute(){return!!this._initData.isNewLineEnabled&&(this._textManager.insertPlainText("\n"),!0)}}class L{constructor(t){this._textManager=t}execute(){return this._textManager.insertPlainText("\t"),!0}}var R=n(409);class E{constructor(t,e){this._textManager=t,this._clipboard=e}execute(){const t=this._textManager.getSelectedTextRange();return!(null==t||!t.isValid||(this._clipboard.write(R.k(t.getFormattedText(),"\n")),0))}}class j{constructor(t){this._textManager=t}execute(){return this._textManager.clearCurrentFormatting(),!0}}class N{constructor(t){this._textManager=t}execute(){const t=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({font:{allCaps:!t.font.allCaps}}),!0}}class k{constructor(t){this._textManager=t}execute(){const t=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({font:{fauxBold:!t.font.fauxBold}}),!0}}class A{constructor(t){this._textManager=t}execute(){const t=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({font:{fauxItalic:!t.font.fauxItalic}}),!0}}class F{constructor(t){this._textManager=t}execute(){const t=!this._textManager.getCurrentCharStyle().superscript;return this._textManager.setCurrentCharStyle({superscript:t,subscript:!t&&void 0}),!0}}class B{constructor(t){this._textManager=t}execute(){const t=!this._textManager.getCurrentCharStyle().subscript;return this._textManager.setCurrentCharStyle({subscript:t,superscript:!t&&void 0}),!0}}class M{constructor(t){this._textManager=t}execute(){const t=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({underline:!t.underline}),!0}}class z{constructor(t,e){this._textManager=t,this._initData=e}execute(){var t;const e=null!==(t=this._initData.value)&&void 0!==t?t:1,n=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({font:{size:n.font.size+e}}),!0}}class D{constructor(t,e){this._textManager=t,this._initData=e}execute(){var t;const e=null!==(t=this._initData.value)&&void 0!==t?t:1,n=this._textManager.getCurrentCharStyle();return this._textManager.setCurrentCharStyle({font:{size:n.font.size-e}}),!0}}class H{constructor(t){this.alignment=t}}class U{constructor(t,e){this._textManager=t,this._initData=e}execute(){return this._textManager.setCurrentParagraphStyle({alignment:this._initData.alignment}),!0}}class W{constructor(t){this.point=t}}class V{constructor(t,e){this._textManager=t,this._initData=e}execute(){return this._textManager.setCursorToPoint(this._initData.point),this._textManager.selectCurrentWord(),!0}}class q{constructor(t){this._textManager=t}execute(){return this._textManager.selectAllText(),!0}}class G{constructor(t,e){this.paragraphIndex=t,this.bulletCharCode=e}}class $ extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){const t=this._initData.paragraphIndex,e=this._textManager.getCurrentCharStyle();return this._deleteTextFromStartOfParagraphToCurrentPosition(t),this._textManager.createBulletedListItem(t,this._initData.bulletCharCode),this._textManager.setCurrentCharStyle(e),!0}_deleteTextFromStartOfParagraphToCurrentPosition(t){const e=this._textManager.getParagraphText(t).getStartPosition(),n=this._textManager.getCurrentPosition(),r=this._textManager.getTextRangeByPositions(e,n),i=this._textManager.deleteTextByRange(r);this._textManager.setCursorToPosition(i)}}class X{constructor(t,e){this.paragraphIndex=t,this.numberingFormat=e}}class K extends i{constructor(t,e){super(),this._textManager=t,this._initData=e}execute(){const t=this._initData.paragraphIndex,e=this._textManager.getCurrentCharStyle();return this._deleteTextFromStartOfParagraphToCurrentPosition(t),this._textManager.createNumberedListItem(t,this._initData.numberingFormat),this._textManager.setCurrentCharStyle(e),!0}_deleteTextFromStartOfParagraphToCurrentPosition(t){const e=this._textManager.getParagraphText(t).getStartPosition(),n=this._textManager.getCurrentPosition(),r=this._textManager.getTextRangeByPositions(e,n),i=this._textManager.deleteTextByRange(r);this._textManager.setCursorToPosition(i)}}class Y{constructor(t){this.point=t}}class J{constructor(t,e){this._textManager=t,this._initData=e}execute(){return this._textManager.setCursorToPoint(this._initData.point),this._textManager.selectCurrentParagraph(),!0}}class Z{constructor(t,e,n){this._textManager=t,this._fontRegistry=e,this._clipboard=n}setFontRegistry(t){this._fontRegistry=t}create(t,e){switch(t){case r.a.undo:return new d(this._textManager);case r.a.redo:return new f(this._textManager);case r.a.setCursor:return new b(this._textManager,e);case r.a.moveCursor:return new C(this._textManager,e);case r.a.setSelection:return new S(this._textManager,e);case r.a.selectWord:return new V(this._textManager,e);case r.a.selectParagraph:return new J(this._textManager,e);case r.a.selectAllText:return new q(this._textManager);case r.a.insertNewLine:return new I(this._textManager,e);case r.a.insertLineBrake:return new T(this._textManager,e);case r.a.insertTab:return new L(this._textManager);case r.a.insertText:return new m(this._textManager,e);case r.a.deleteText:return new p(this._textManager,e);case r.a.copyToClipboard:return new E(this._textManager,this._clipboard);case r.a.clearFormatting:return new j(this._textManager);case r.a.setCharStyle:return new y(this._textManager,this._fontRegistry,e);case r.a.setParagraphStyle:return new _(this._textManager,e);case r.a.setCapitalLetters:return new N(this._textManager);case r.a.setFontBold:return new k(this._textManager);case r.a.setFontItalic:return new A(this._textManager);case r.a.setSuperscriptLetters:return new F(this._textManager);case r.a.setSubscriptLetters:return new B(this._textManager);case r.a.setFontUnderline:return new M(this._textManager);case r.a.increaseFontSize:return new z(this._textManager,e);case r.a.decreaseFontSize:return new D(this._textManager,e);case r.a.setAlignment:return new U(this._textManager,e);case r.a.addListItem:return new a(this._textManager,e);case r.a.creteBulletedListItem:return new $(this._textManager,e);case r.a.creteNumberedListItem:return new K(this._textManager,e);case r.a.deleteListItem:return new s(this._textManager,e);case r.a.increaseListItemIndent:return new l(this._textManager,e);case r.a.decreaseListItemIndent:return new u(this._textManager,e);case r.a.applyListItem:return new c(this._textManager,e)}}}class Q{constructor(t){this._defaultQueueSize=5,this._queue=[],this._queueSize=t||this._defaultQueueSize}getCommandsCount(){return this._queue.length}clearHistory(){this._queue=[]}addCommand(t){this._queue.push(t),this._isOverflow()&&this._queue.shift()}getLastCommand(t){return t?this._getLastCommand(t):this._getLastCommand(0)}_isOverflow(){return this.getCommandsCount()>this._queueSize}_getLastCommand(t){if(this.getCommandsCount()<=t)return null;const e=this.getCommandsCount()-1-t;return this._queue[e]}}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(26),i=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return Object(r.a)(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(n(127).a)},,,,,function(t,e,n){var r,i;
/**
* Monet.js 0.9.3
*
* (c) 2012-2021 Chris Myers
* @license Monet.js may be freely distributed under the MIT license.
* For all details and documentation:
* https://monet.github.io/monet.js/
*/"undefined"!=typeof self&&self,r=function(){"use strict";var t={apply2:I,assign:b(Object.assign)?Object.assign:function(t,e){for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&(t[n]=e[n]);return t},compose:v,curry:_(x(_),[])([]),idFunction:w,isFunction:b,noop:y,swap:x},e="@@type",n="monet.js",r="Identity",i="Maybe",o="Either",a="Validation",s="List",l="NEL",u="IO",c="MonadT",h="Reader",p="Free";function f(t,r){t[e]=n+"/"+r}function d(t){return function(r){return(r[e]||r.constructor[e])===n+"/"+t}}function g(t){return function(n){var r=n[e]||n.constructor&&n.constructor[e];return Boolean(r)&&r.length>=t.length&&r.indexOf(t)===r.length-t.length}}function m(t){return null==t}function y(){}function _(t,e){return function(){var n=e.concat(function(t){return Array.prototype.slice.call(t)}(arguments));return n.length>=t.length?t.apply(null,n.slice(0,n.length)):_(t,n)}}function v(t,e){return function(n){return t(e(n))}}function b(t){return Boolean(t&&t.constructor&&t.call&&t.apply)}function w(t){return t}function C(t,e){return t===e||t!=t&&e!=e||!(!t||!e)&&!(!b(t.equals)||!b(e.equals))&&t.equals(e)}function P(t){return function(e){return C(t,e)}}function S(){return!1}function x(t){return function(e,n){return t(n,e)}}function I(t,e,n){return e.ap(t.map(_(n,[])))}function O(t,e){for(var n=t,r=e;!n.isNil&&!r.isNil;){if(!P(n.head())(r.head()))return!1;n=n.tail(),r=r.tail()}return n.isNil&&r.isNil}function T(t,e){return e.isNil?lt(e):st((function(){return T(t,e.tail())})).map(_(A,[])(t(e.head())))}function L(t,e){return T(t,e).run()}function R(t,e){return t.foldRight(B)((function(t,n){return e(t)?A(t,n):n}))}function E(t,e){if(t.isNil)return lt(K());var n=t.head();return e(n)?lt(X(n)):st((function(){return E(t.tail(),e)}))}function j(t,e){return E(t,e).run()}function N(t,e){return t.isNil?lt(!1):C(t.head(),e)?lt(!0):st((function(){return N(t.tail(),e)}))}function k(t,e){return N(t,e).run()}function A(t,e){return e.cons(t)}function F(){switch(arguments.length){case 0:return new F.fn.init;case 1:return new F.fn.init(arguments[0]);default:return new F.fn.init(arguments[0],arguments[1])}}t.List=F;var B,M=function(t,e){e.isNil||(t(e.head()),M(t,e.tail()))},z=function(t,e,n){return function e(n,r){return r.isNil?lt(n):st((function(){return e(t(n,r.head()),r.tail())}))}(e,n).run()},D=function(t,e,n){return function e(n,r){return n.isNil?lt(r):st((function(){return e(n.tail(),r)})).map((function(e){return t(n.head(),e)}))}(e,n).run()},H=function(t,e){return function t(e,n){return e.isNil?lt(n):st((function(){return t(e.tail(),n).map((function(t){return t.cons(e.head())}))}))}(t,e).run()},U=function(t,e){return t.foldRight(e.of(B))(e.map2(A))},W=function(t){return t.foldLeft(B)(x(A))},V=function(t,e){return t.bind((function(t){return e.map((function(e){return e(t)}))}))};function q(t){return new Error("Cannot create an empty Non-Empty List. Passed head is "+t+".")}function G(t,e){if(m(t))throw q(t);return new G.fn.init(t,e)}F.fn=F.prototype={init:function(){var t=arguments[0],e=arguments[1];0===arguments.length?(this.isNil=!0,this.size_=0):(this.isNil=!1,this.head_=t,this.tail_=e||B,this.size_=this.tail_.size()+1),f(this,s)},of:function(t){return new F(t)},size:function(){return this.size_},equals:function(t){return(F.isOfType(t)||G.isOfType(t))&&O(this,t)},cons:function(t){return F(t,this)},snoc:function(t){return this.concat(F(t))},map:function(t){return L(t,this)},toArray:function(){return z((function(t,e){return t.push(e),t}),[],this)},toSet:function(){return new Set(this)},foldLeft:function(t){var e=this;return function(n){return z(n,t,e)}},foldRight:function(t){var e=this;return function(n){return D(n,e,t)}},append:function(t){return H(this,t)},filter:function(t){return R(this,t)},find:function(t){return j(this,t)},flatten:function(){return D(H,this,B)},flattenMaybe:function(){return this.flatMap($.toList)},reverse:function(){return W(this)},bind:function(t){return this.map(t).flatten()},forEach:function(t){M(t,this)},contains:function(t){return k(this,t)},sequenceMaybe:function(){return U(this,$)},sequenceValidation:function(){return this.foldLeft(J(B))((function(t,e){return t.ap(e.map((function(t){return function(e){return A(t,e)}})))})).map(W)},sequenceEither:function(){return U(this,nt)},sequenceIO:function(){return U(this,et)},sequenceReader:function(){return U(this,ot)},sequence:function(t){return U(this,t)},head:function(){return this.head_},headMaybe:function(){return this.isNil?K():X(this.head_)},lookup:function(t){return this.isNil||t>=this.size()?K():$.fromNull(this.toArray()[t])},nth:function(t){return this.isNil||t>=this.size()?void 0:this.toArray()[t]},tail:function(){return this.isNil?B:this.tail_},tails:function(){return this.isNil?F(B,B):this.tail().tails().cons(this)},ap:function(t){return V(this,t)},apTo:function(t){return V(t,this)},isNEL:S,toString:function(){return this.isNil?"Nil":"List("+this.toArray().join(", ")+")"},inspect:function(){return this.toString()}},F.fn.init.prototype=F.fn,f(F,s),f(F.fn.init,s),F.isInstance=d(s),F.isOfType=g(s),F.prototype.empty=function(){return B},F.fromArray=function(t){return t.reduceRight((function(t,e){return t.cons(e)}),B)},F.from=function(t){return F.fromArray(Array.from(t))},F.of=function(t){return new F(t,B)},F.prototype.each=F.prototype.forEach,B=t.Nil=new F.fn.init,t.NEL=t.NonEmptyList=G,G.of=function(t){return G(t,B)},G.fn=G.prototype={init:function(t,e){if(m(t))throw q(t);this.isNil=!1,this.head_=t,this.tail_=m(e)?B:e,this.size_=this.tail_.size()+1,f(this,l)},equals:function(t){return F.isOfType(t)||G.isOfType(t)&&O(this,t)},cons:function(t){return G(t,this.toList())},snoc:function(t){return this.concat(G(t))},map:function(t){return G(t(this.head_),L(t,this.tail_))},bind:function(t){var e=t(this.head_);if(!e.isNEL())throw new Error("NEL.fn.bind: Passed function must return a NonEmptyList.");var n=this.tail().foldLeft(B.snoc(e.head()).append(e.tail()))((function(e,n){var r=t(n).toList();return e.snoc(r.head()).append(r.tail())}));return new G(n.head(),n.tail())},head:function(){return this.head_},lookup:function(t){return t>=this.size()?K():$.fromNull(this.toArray()[t])},nth:function(t){return t>=this.size()?void 0:this.toArray()[t]},tail:function(){return this.tail_},tails:function(){var t=this.toList().tails().map(G.fromList).flattenMaybe();return G(t.head(),t.tail())},toList:function(){return F(this.head_,this.tail_)},reverse:function(){if(this.tail().isNil)return this;var t=this.tail().reverse();return G(t.head(),t.tail().append(F(this.head())))},foldLeft:function(t){return this.toList().foldLeft(t)},foldRight:function(t){return this.toList().foldRight(t)},reduceLeft:function(t){return this.tail().foldLeft(this.head())(t)},filter:function(t){return R(this.toList(),t)},find:function(t){return j(this.toList(),t)},flatten:function(){return D(H,this.toList().map((function(t){return t.isNEL()?t.toList():t})),B)},flattenMaybe:function(){return this.toList().flatMap($.toList)},contains:function(t){return k(this.toList(),t)},append:function(t){return G.fromList(this.toList().append(t.toList())).some()},cobind:function(t){return this.cojoin().map(t)},size:function(){return this.size_},forEach:function(t){return this.toList().forEach(t)},isNEL:function(){return!0},toString:function(){return"NEL("+this.toArray().join(", ")+")"},inspect:function(){return this.toString()}},G.fromList=function(t){return t.isNil?K():X(G(t.head(),t.tail()))},G.fromArray=function(t){return G.fromList(F.fromArray(t))},G.from=function(t){return G.fromList(F.from(t))},G.fn.init.prototype=G.fn,f(G,l),f(G.fn.init,l),G.isInstance=d(l),G.isOfType=g(l),G.prototype.toArray=F.prototype.toArray,G.prototype.toSet=F.prototype.toSet,G.prototype.extract=G.prototype.copure=G.prototype.head,G.prototype.cojoin=G.prototype.tails,G.prototype.coflatMap=G.prototype.mapTails=G.prototype.cobind,G.prototype.ap=F.prototype.ap,G.prototype.apTo=F.prototype.apTo;var $=t.Maybe={};$.fromFalsy=function(t){return t?$.Some(t):$.None()},$.fromNull=function(t){return m(t)?$.None():$.Some(t)},$.fromUndefined=function(t){return void 0===t?$.None():$.Some(t)},$.fromEmpty=function(t){return m(e=t)||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length?$.None():$.Some(t);var e},$.of=function(t){return X(t)};var X=$.Just=$.Some=$.some=t.Some=t.Just=function(t){return new $.fn.init(!0,t)},K=$.Nothing=$.None=$.none=t.None=t.Nothing=function(){return new $.fn.init(!1,null)};$.toList=function(t){return t.toList()},$.fn=$.prototype={init:function(t,e){if(this.isValue=t,t&&m(e))throw new Error("Can not create Some with illegal value: "+e+".");this.val=e,f(this,i)},isSome:function(){return this.isValue},isNone:function(){return!this.isSome()},bind:function(t){return this.isValue?t(this.val):this},some:function(){if(this.isValue)return this.val;throw new Error("Cannot call .some() on a None.")},orSome:function(t){return this.isValue?this.val:t},orLazy:function(t){return this.cata(t,w)},orNull:function(){return this.orSome(null)},orUndefined:function(){return this.orSome(void 0)},orElse:function(t){return this.catchMap((function(){return t}))},ap:function(t){var e=this.val;return this.isValue?t.map((function(t){return t(e)})):this},apTo:function(t){return t.ap(this)},equals:function(t){return $.isOfType(t)&&this.cata((function(){return t.isNone()}),(function(e){return t.fold(!1)(P(e))}))},toArray:function(){return this.map((function(t){return[t]})).orLazy((function(){return[]}))},toSet:function(){return new Set(this)},toList:function(){return this.map(F).orLazy((function(){return B}))},toEither:function(t){return this.isSome()?rt(this.val):it(t)},toValidation:function(t){return this.isSome()?J(this.val):Z(t)},fold:function(t){var e=this;return function(n){return e.isSome()?n(e.val):t}},foldLeft:function(t){return this.toList().foldLeft(t)},foldRight:function(t){return this.toList().foldRight(t)},cata:function(t,e){return this.isSome()?e(this.val):t()},catchMap:function(t){return this.isSome()?this:t()},filter:function(t){var e=this;return e.flatMap((function(n){return t(n)?e:K()}))},orNoneIf:function(t){return t?K():this},contains:function(t){return!!this.isSome()&&C(this.val,t)},forEach:function(t){this.cata(y,t)},orElseRun:function(t){this.cata(t,y)},toString:function(){return this.isSome()?"Just("+this.val+")":"Nothing"},inspect:function(){return this.toString()}},$.prototype.orJust=$.prototype.getOrElse=$.prototype.orSome,$.prototype.just=$.prototype.some,$.prototype.isJust=$.prototype.isSome,$.prototype.isNothing=$.prototype.isNone,$.prototype.orNothingIf=$.prototype.orNoneIf,$.fn.init.prototype=$.fn,f($,i),f($.fn.init,i),$.isInstance=d(i),$.isOfType=g(i);var Y=t.Validation={},J=Y.Success=Y.success=t.Success=function(t){return new Y.fn.init(t,!0)},Z=Y.Fail=Y.fail=t.Fail=function(t){return new Y.fn.init(t,!1)};Y.of=function(t){return J(t)},Y.fn=Y.prototype={init:function(t,e){this.val=t,this.isSuccessValue=e,f(this,a)},success:function(){if(this.isSuccess())return this.val;throw new Error("Cannot call success() on a Fail.")},isSuccess:function(){return this.isSuccessValue},isFail:function(){return!this.isSuccessValue},fail:function(){if(this.isSuccess())throw new Error("Cannot call fail() on a Success.");return this.val},bind:function(t){return this.isSuccess()?t(this.val):this},ap:function(t){var e=this.val;return this.isSuccess()?t.map((function(t){return t(e)})):t.isFail()?Y.Fail(Q.append(e,t.fail())):this},apTo:function(t){return t.ap(this)},acc:function(){var t=function(){return t};return this.isSuccessValue?Y.success(t):this},foldLeft:function(t){return this.toMaybe().toList().foldLeft(t)},foldRight:function(t){return this.toMaybe().toList().foldRight(t)},cata:function(t,e){return this.isSuccessValue?e(this.val):t(this.val)},catchMap:function(t){return this.isSuccess()?this:t(this.val)},swap:function(){return this.isSuccess()?Z(this.val):J(this.val)},failMap:function(t){return this.isFail()?Z(t(this.val)):this},bimap:function(t,e){return this.isSuccessValue?this.map(e):this.failMap(t)},forEach:function(t){this.cata(y,t)},forEachFail:function(t){this.cata(t,y)},equals:function(t){return Y.isOfType(t)&&this.cata((function(e){return t.cata(P(e),S)}),(function(e){return t.cata(S,P(e))}))},toMaybe:function(){return this.isSuccess()?X(this.val):K()},toEither:function(){return(this.isSuccess()?rt:it)(this.val)},toString:function(){return(this.isSuccess()?"Success(":"Fail(")+this.val+")"},inspect:function(){return this.toString()}},Y.prototype.fold=Y.prototype.cata,Y.fn.init.prototype=Y.fn,f(Y,a),f(Y.fn.init,a),Y.isInstance=d(a),Y.isOfType=g(a);var Q=t.Semigroup={append:function(t,e){if(b(t.concat))return t.concat(e);throw new Error("Couldn't find a semigroup appender in the environment, please specify your own append function")}},tt=t.monadTransformer=t.MonadT=t.monadT=function(t){return new tt.fn.init(t)};tt.of=function(t){return tt(t)},tt.fn=tt.prototype={init:function(t){this.monad=t,f(Y,c)},map:function(t){return tt(this.monad.map((function(e){return e.map(t)})))},bind:function(t){return tt(this.monad.map((function(e){return e.flatMap(t)})))},ap:function(t){return tt(this.monad.flatMap((function(e){return t.perform().map((function(t){return e.ap(t)}))})))},perform:function(){return this.monad}},tt.fn.init.prototype=tt.fn;var et=t.IO=t.io=function(t){return new et.fn.init(t)};et.of=function(t){return et((function(){return t}))},et.fn=et.prototype={init:function(t){if(!b(t))throw new Error("IO requires a function.");this.effectFn=t,f(this,u)},map:function(t){var e=this;return et((function(){return t(e.effectFn())}))},bind:function(t){var e=this;return et((function(){return t(e.effectFn()).run()}))},ap:function(t){var e=this;return t.map((function(t){return t(e.effectFn())}))},apTo:function(t){return t.ap(this)},run:function(){return this.effectFn()}},et.fn.init.prototype=et.fn,f(et,u),f(et.fn.init,u),et.isInstance=d(u),et.isOfType=g(u),et.prototype.perform=et.prototype.performUnsafeIO=et.prototype.run;var nt=t.Either={};nt.of=function(t){return rt(t)},nt.fromTry=function(t){try{return nt.right(t())}catch(e){return nt.left(e)}},nt.fromPromise=function(t){return t.then(nt.Right,nt.Left)};var rt=nt.Right=nt.right=t.Right=function(t){return new nt.fn.init(t,!0)},it=nt.Left=nt.left=t.Left=function(t){return new nt.fn.init(t,!1)};nt.fn=nt.prototype={init:function(t,e){this.isRightValue=e,this.value=t,f(this,o)},bind:function(t){return this.isRightValue?t(this.value):this},ap:function(t){var e=this;return this.isRightValue?t.map((function(t){return t(e.value)})):this},apTo:function(t){return t.ap(this)},leftMap:function(t){return this.isLeft()?it(t(this.value)):this},isRight:function(){return this.isRightValue},isLeft:function(){return!this.isRight()},right:function(){if(this.isRightValue)return this.value;throw new Error("Cannot call right() on a Left.")},left:function(){if(this.isRightValue)throw new Error("Cannot call left() on a Right.");return this.value},foldLeft:function(t){return this.toMaybe().toList().foldLeft(t)},foldRight:function(t){return this.toMaybe().toList().foldRight(t)},cata:function(t,e){return this.isRightValue?e(this.value):t(this.value)},catchMap:function(t){return this.isRight()?this:t(this.value)},swap:function(){return this.isRight()?it(this.value):rt(this.value)},forEach:function(t){this.cata(y,t)},forEachLeft:function(t){this.cata(t,y)},equals:function(t){return nt.isOfType(t)&&this.cata((function(e){return t.cata(P(e),S)}),(function(e){return t.cata(S,P(e))}))},bimap:function(t,e){return this.isRightValue?this.map(e):this.leftMap(t)},toMaybe:function(){return this.isRight()?X(this.value):K()},toValidation:function(){return this.isRight()?J(this.value):Z(this.value)},toString:function(){return this.cata((function(t){return"Left("+t+")"}),(function(t){return"Right("+t+")"}))},toPromise:function(){return this.cata((function(t){return Promise.reject(t)}),(function(t){return Promise.resolve(t)}))},inspect:function(){return this.toString()}},nt.prototype.fold=nt.prototype.cata,nt.fn.init.prototype=nt.fn,f(nt,o),f(nt.fn.init,o),nt.isInstance=d(o),nt.isOfType=g(o);var ot=t.Reader=function(t){return new ot.fn.init(t)};ot.of=function(t){return ot((function(e){return t}))},ot.ask=function(){return ot(w)},ot.fn=ot.prototype={init:function(t){this.f=t,f(this,h)},run:function(t){return this.f(t)},bind:function(t){var e=this;return ot((function(n){return t(e.run(n)).run(n)}))},ap:function(t){var e=this;return t.bind((function(t){return ot((function(n){return t(e.run(n))}))}))},apTo:function(t){return t.ap(this)},map:function(t){var e=this;return ot((function(n){return t(e.run(n))}))},local:function(t){var e=this;return ot((function(n){return e.run(t(n))}))}},ot.fn.init.prototype=ot.fn,f(ot,h),f(ot.fn.init,h),ot.isInstance=d(h),ot.isOfType=g(h);var at=t.Free={},st=at.Suspend=t.Suspend=function(t){return new at.fn.init(t,!0)},lt=at.Return=t.Return=function(t){return new at.fn.init(t,!1)};function ut(t){return new ut.fn.init(t)}function ct(t){(function(t){t.prototype.flatMap=t.prototype.chain=t.prototype.bind,t.pure=t.unit=t.of,t.prototype.of=t.of,b(t.prototype.append)&&(t.prototype.concat=t.prototype.append),t.prototype.point=t.prototype.pure=t.prototype.unit=t.prototype.of})(t),function(t){b(t.prototype.filter)&&(t.prototype.filterNot=function(t){return this.filter((function(e){return!t(e)}))})}(t),function(t){t.prototype.join=function(){return this.flatMap(w)},t.map2=function(t){return function(e,n){return e.flatMap((function(e){return n.map((function(n){return t(e,n)}))}))}}}(t),function(t){b(t.prototype.map)||(t.prototype.map=function(t){return this.bind(v(this.of,t))})}(t),function(t){t.prototype.takeLeft=function(t){return I(this,t,(function(t,e){return t}))},t.prototype.takeRight=function(t){return I(this,t,(function(t,e){return e}))}}(t),function(t){b(t.prototype.toArray)&&(t.prototype.every=t.prototype.forall=function(t){return this.toArray().every(t)},t.prototype.exists=function(t){return this.toArray().some(t)})}(t),function(t){["equals","map","ap","chain"].filter((function(e){return b(t.prototype[e])})).forEach((function(e){t.prototype["fantasy-land/"+e]=t.prototype[e]}))}(t),function(t){b(t.prototype.toArray)&&(t.prototype[Symbol.iterator]=function(){return this.toArray()[Symbol.iterator]()})}(t),function(t){b(t.prototype.toArray)&&(t.prototype.to=function(t){return t(this)})}(t)}return at.of=function(t){return lt(t)},at.liftF=function(t){return b(t)?st(v(lt,t)):st(t.map(lt))},at.fn=at.prototype={init:function(t,e){this.isSuspend=e,e?this.functor=t:this.val=t,f(this,p)},run:function(){return this.go((function(t){return t()}))},bind:function(t){return this.isSuspend?b(this.functor)?st(v((function(e){return e.bind(t)}),this.functor)):st(this.functor.map((function(e){return e.bind(t)}))):t(this.val)},ap:function(t){return this.bind((function(e){return t.map((function(t){return t(e)}))}))},apTo:function(t){return t.ap(this)},resume:function(){return this.isSuspend?it(this.functor):rt(this.val)},go1:function(t){return function e(n){return n.resume().cata((function(n){return e(t(n))}),w)}(this)},go:function(t){for(var e=this.resume();e.isLeft();){var n=t(e.left());e=n.resume()}return e.right()}},at.fn.init.prototype=at.fn,f(at,p),f(at.fn.init,p),at.isInstance=d(p),at.isOfType=g(p),t.Identity=ut,ut.of=function(t){return new ut(t)},ut.fn=ut.prototype={init:function(t){this.val=t,f(this,r)},bind:function(t){return t(this.val)},get:function(){return this.val},forEach:function(t){t(this.val)},equals:function(t){return ut.isOfType(t)&&P(this.get())(t.get())},contains:function(t){return C(this.val,t)},toString:function(){return"Identity("+this.val+")"},inspect:function(){return this.toString()},ap:function(t){var e=this.val;return t.map((function(t){return t(e)}))},apTo:function(t){return t.ap(this)},toArray:function(){return[this.get()]},toList:function(){return F(this.get(),B)},toSet:function(){return new Set(this)}},ut.fn.init.prototype=ut.fn,f(ut,r),f(ut.fn.init,r),ut.isInstance=d(r),ut.isOfType=g(r),ct(tt),ct(nt),ct($),ct(et),ct(G),ct(F),ct(Y),ct(ot),ct(at),ct(ut),t},void 0===(i=r.call(e,n,e,t))||(t.exports=i)},function(t,e,n){var r;!function(i,o){var a={Identity:function(t){return t},True:function(){return!0},Blank:function(){}},s="boolean",l="number",u="string",c=typeof o,h="function",p={"":a.Identity},f={createLambda:function(t){if(null==t)return a.Identity;if(typeof t===u){var e=p[t];if(null!=e)return e;if(-1===t.indexOf("=>")){for(var n,r=new RegExp("[$]+","g"),i=0;null!=(n=r.exec(t));){var o=n[0].length;o>i&&(i=o)}for(var s=[],l=1;l<=i;l++){for(var c="",h=0;h<l;h++)c+="$";s.push(c)}var f=Array.prototype.join.call(s,",");return e=new Function(f,"return "+t),p[t]=e,e}var d=t.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/);return e=new Function(d[1],"return "+d[2]),p[t]=e,e}return t},isIEnumerable:function(t){if(typeof Enumerator!==c)try{return new Enumerator(t),!0}catch(e){}return!1},defineProperty:null!=Object.defineProperties?function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!0,value:n})}:function(t,e,n){t[e]=n},compare:function(t,e){return t===e?0:t>e?1:-1},dispose:function(t){null!=t&&t.dispose()},hasNativeIteratorSupport:function(){return"undefined"!=typeof Symbol&&void 0!==Symbol.iterator}},d=function(t,e,n){var r=new g,i=0;this.current=r.current,this.moveNext=function(){try{switch(i){case 0:i=1,t();case 1:return!!e.apply(r)||(this.dispose(),!1);case 2:return!1}}catch(n){throw this.dispose(),n}},this.dispose=function(){if(1==i)try{n()}finally{i=2}}},g=function(){var t=null;this.current=function(){return t},this.yieldReturn=function(e){return t=e,!0},this.yieldBreak=function(){return!1}},m=function(t){this.getEnumerator=t};(m.Utils={}).createLambda=function(t){return f.createLambda(t)},m.Utils.createEnumerable=function(t){return new m(t)},m.Utils.createEnumerator=function(t,e,n){return new d(t,e,n)},m.Utils.extendTo=function(t){var e,n=t.prototype;for(var r in t===Array?(e=b.prototype,f.defineProperty(n,"getSource",(function(){return this}))):(e=m.prototype,f.defineProperty(n,"getEnumerator",(function(){return m.from(this).getEnumerator()}))),e){var i=e[r];n[r]!=i&&(null!=n[r]&&n[r+="ByLinq"]==i||i instanceof Function&&f.defineProperty(n,r,i))}},m.choice=function(){var t=arguments;return new m((function(){return new d((function(){t=t[0]instanceof Array?t[0]:null!=t[0].getEnumerator?t[0].toArray():t}),(function(){return this.yieldReturn(t[Math.floor(Math.random()*t.length)])}),a.Blank)}))},m.cycle=function(){var t=arguments;return new m((function(){var e=0;return new d((function(){t=t[0]instanceof Array?t[0]:null!=t[0].getEnumerator?t[0].toArray():t}),(function(){return e>=t.length&&(e=0),this.yieldReturn(t[e++])}),a.Blank)}))},m.empty=function(){return new m((function(){return new d(a.Blank,(function(){return!1}),a.Blank)}))},m.from=function(t){if(null==t)return m.empty();if(t instanceof m)return t;if(typeof t==l||typeof t==s)return m.repeat(t,1);if(typeof t==u)return new m((function(){var e=0;return new d(a.Blank,(function(){return e<t.length&&this.yieldReturn(t.charAt(e++))}),a.Blank)}));if(typeof t!=h){if(typeof t.length==l)return new b(t);if("undefined"!=typeof Symbol&&void 0!==t[Symbol.iterator])return new m((function(){return new d(a.Blank,(function(){var e=t.next();return!e.done&&this.yieldReturn(e.value)}),a.Blank)}));if(!(t instanceof Object)&&f.isIEnumerable(t))return new m((function(){var e,n=!0;return new d((function(){e=new Enumerator(t)}),(function(){return n?n=!1:e.moveNext(),!e.atEnd()&&this.yieldReturn(e.item())}),a.Blank)}));if("object"==typeof Windows&&typeof t.first===h)return new m((function(){var e,n=!0;return new d((function(){e=t.first()}),(function(){return n?n=!1:e.moveNext(),e.hasCurrent?this.yieldReturn(e.current):this.yieldBreak()}),a.Blank)}))}return new m((function(){var e=[],n=0;return new d((function(){for(var n in t){var r=t[n];r instanceof Function||!Object.prototype.hasOwnProperty.call(t,n)||e.push({key:n,value:r})}}),(function(){return n<e.length&&this.yieldReturn(e[n++])}),a.Blank)}))},m.make=function(t){return m.repeat(t,1)},m.matches=function(t,e,n){return null==n&&(n=""),e instanceof RegExp&&(n+=e.ignoreCase?"i":"",n+=e.multiline?"m":"",e=e.source),-1===n.indexOf("g")&&(n+="g"),new m((function(){var r;return new d((function(){r=new RegExp(e,n)}),(function(){var e=r.exec(t);return!!e&&this.yieldReturn(e)}),a.Blank)}))},m.range=function(t,e,n){return null==n&&(n=1),new m((function(){var r,i=0;return new d((function(){r=t-n}),(function(){return i++<e?this.yieldReturn(r+=n):this.yieldBreak()}),a.Blank)}))},m.rangeDown=function(t,e,n){return null==n&&(n=1),new m((function(){var r,i=0;return new d((function(){r=t+n}),(function(){return i++<e?this.yieldReturn(r-=n):this.yieldBreak()}),a.Blank)}))},m.rangeTo=function(t,e,n){return null==n&&(n=1),new m(t<e?function(){var r;return new d((function(){r=t-n}),(function(){var t=r+=n;return t<=e?this.yieldReturn(t):this.yieldBreak()}),a.Blank)}:function(){var r;return new d((function(){r=t+n}),(function(){var t=r-=n;return t>=e?this.yieldReturn(t):this.yieldBreak()}),a.Blank)})},m.repeat=function(t,e){return null!=e?m.repeat(t).take(e):new m((function(){return new d(a.Blank,(function(){return this.yieldReturn(t)}),a.Blank)}))},m.repeatWithFinalize=function(t,e){return t=f.createLambda(t),e=f.createLambda(e),new m((function(){var n;return new d((function(){n=t()}),(function(){return this.yieldReturn(n)}),(function(){null!=n&&(e(n),n=null)}))}))},m.generate=function(t,e){return null!=e?m.generate(t).take(e):(t=f.createLambda(t),new m((function(){return new d(a.Blank,(function(){return this.yieldReturn(t())}),a.Blank)})))},m.toInfinity=function(t,e){return null==t&&(t=0),null==e&&(e=1),new m((function(){var n;return new d((function(){n=t-e}),(function(){return this.yieldReturn(n+=e)}),a.Blank)}))},m.toNegativeInfinity=function(t,e){return null==t&&(t=0),null==e&&(e=1),new m((function(){var n;return new d((function(){n=t+e}),(function(){return this.yieldReturn(n-=e)}),a.Blank)}))},m.unfold=function(t,e){return e=f.createLambda(e),new m((function(){var n,r=!0;return new d(a.Blank,(function(){return r?(r=!1,n=t,this.yieldReturn(n)):(n=e(n),this.yieldReturn(n))}),a.Blank)}))},m.defer=function(t){return new m((function(){var e;return new d((function(){e=m.from(t()).getEnumerator()}),(function(){return e.moveNext()?this.yieldReturn(e.current()):this.yieldBreak()}),(function(){f.dispose(e)}))}))},m.prototype.traverseBreadthFirst=function(t,e){var n=this;return t=f.createLambda(t),e=f.createLambda(e),new m((function(){var r,i=0,o=[];return new d((function(){r=n.getEnumerator()}),(function(){for(;;){if(r.moveNext())return o.push(r.current()),this.yieldReturn(e(r.current(),i));var n=m.from(o).selectMany((function(e){return t(e)}));if(!n.any())return!1;i++,o=[],f.dispose(r),r=n.getEnumerator()}}),(function(){f.dispose(r)}))}))},m.prototype.traverseDepthFirst=function(t,e){var n=this;return t=f.createLambda(t),e=f.createLambda(e),new m((function(){var r,i=[];return new d((function(){r=n.getEnumerator()}),(function(){for(;;){if(r.moveNext()){var n=e(r.current(),i.length);return i.push(r),r=m.from(t(r.current())).getEnumerator(),this.yieldReturn(n)}if(i.length<=0)return!1;f.dispose(r),r=i.pop()}}),(function(){try{f.dispose(r)}finally{m.from(i).forEach((function(t){t.dispose()}))}}))}))},m.prototype.flatten=function(){var t=this;return new m((function(){var e,n=null;return new d((function(){e=t.getEnumerator()}),(function(){for(;;){if(null!=n){if(n.moveNext())return this.yieldReturn(n.current());n=null}if(e.moveNext()){if(e.current()instanceof Array){f.dispose(n),n=m.from(e.current()).selectMany(a.Identity).flatten().getEnumerator();continue}return this.yieldReturn(e.current())}return!1}}),(function(){try{f.dispose(e)}finally{f.dispose(n)}}))}))},m.prototype.pairwise=function(t){var e=this;return t=f.createLambda(t),new m((function(){var n;return new d((function(){(n=e.getEnumerator()).moveNext()}),(function(){var e=n.current();return!!n.moveNext()&&this.yieldReturn(t(e,n.current()))}),(function(){f.dispose(n)}))}))},m.prototype.scan=function(t,e){var n;null==e?(e=f.createLambda(t),n=!1):(e=f.createLambda(e),n=!0);var r=this;return new m((function(){var i,o,a=!0;return new d((function(){i=r.getEnumerator()}),(function(){if(a){if(a=!1,n)return this.yieldReturn(o=t);if(i.moveNext())return this.yieldReturn(o=i.current())}return!!i.moveNext()&&this.yieldReturn(o=e(o,i.current()))}),(function(){f.dispose(i)}))}))},m.prototype.select=function(t){if((t=f.createLambda(t)).length<=1)return new C(this,null,t);var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(t(n.current(),r++))}),(function(){f.dispose(n)}))}))},m.prototype.selectMany=function(t,e){var n=this;return t=f.createLambda(t),null==e&&(e=function(t,e){return e}),e=f.createLambda(e),new m((function(){var r,i=o,a=0;return new d((function(){r=n.getEnumerator()}),(function(){if(i===o&&!r.moveNext())return!1;do{if(null==i){var n=t(r.current(),a++);i=m.from(n).getEnumerator()}if(i.moveNext())return this.yieldReturn(e(r.current(),i.current()));f.dispose(i),i=null}while(r.moveNext());return!1}),(function(){try{f.dispose(r)}finally{f.dispose(i)}}))}))},m.prototype.where=function(t){if((t=f.createLambda(t)).length<=1)return new w(this,t);var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();)if(t(n.current(),r++))return this.yieldReturn(n.current());return!1}),(function(){f.dispose(n)}))}))},m.prototype.choose=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();){var e=t(n.current(),r++);if(null!=e)return this.yieldReturn(e)}return this.yieldBreak()}),(function(){f.dispose(n)}))}))},m.prototype.ofType=function(t){var e;switch(t){case Number:e=l;break;case String:e=u;break;case Boolean:e=s;break;case Function:e=h;break;default:e=null}return null===e?this.where((function(e){return e instanceof t})):this.where((function(t){return typeof t===e}))},m.prototype.zip=function(){var t=arguments,e=f.createLambda(arguments[arguments.length-1]),n=this;if(2==arguments.length){var r=arguments[0];return new m((function(){var t,i,o=0;return new d((function(){t=n.getEnumerator(),i=m.from(r).getEnumerator()}),(function(){return!(!t.moveNext()||!i.moveNext())&&this.yieldReturn(e(t.current(),i.current(),o++))}),(function(){try{f.dispose(t)}finally{f.dispose(i)}}))}))}return new m((function(){var r,i=0;return new d((function(){var e=m.make(n).concat(m.from(t).takeExceptLast().select(m.from)).select((function(t){return t.getEnumerator()})).toArray();r=m.from(e)}),(function(){if(r.all((function(t){return t.moveNext()}))){var t=r.select((function(t){return t.current()})).toArray();return t.push(i++),this.yieldReturn(e.apply(null,t))}return this.yieldBreak()}),(function(){m.from(r).forEach(f.dispose)}))}))},m.prototype.merge=function(){var t=arguments,e=this;return new m((function(){var n,r=-1;return new d((function(){n=m.make(e).concat(m.from(t).select(m.from)).select((function(t){return t.getEnumerator()})).toArray()}),(function(){for(;n.length>0;){r=r>=n.length-1?0:r+1;var t=n[r];if(t.moveNext())return this.yieldReturn(t.current());t.dispose(),n.splice(r--,1)}return this.yieldBreak()}),(function(){m.from(n).forEach(f.dispose)}))}))},m.prototype.join=function(t,e,n,r,i){e=f.createLambda(e),n=f.createLambda(n),r=f.createLambda(r),i=f.createLambda(i);var s=this;return new m((function(){var l,u,c=null,h=0;return new d((function(){l=s.getEnumerator(),u=m.from(t).toLookup(n,a.Identity,i)}),(function(){for(;;){if(null!=c){var t=c[h++];if(t!==o)return this.yieldReturn(r(l.current(),t));t=null,h=0}if(!l.moveNext())return!1;var n=e(l.current());c=u.get(n).toArray()}}),(function(){f.dispose(l)}))}))},m.prototype.groupJoin=function(t,e,n,r,i){e=f.createLambda(e),n=f.createLambda(n),r=f.createLambda(r),i=f.createLambda(i);var o=this;return new m((function(){var s=o.getEnumerator(),l=null;return new d((function(){s=o.getEnumerator(),l=m.from(t).toLookup(n,a.Identity,i)}),(function(){if(s.moveNext()){var t=l.get(e(s.current()));return this.yieldReturn(r(s.current(),t))}return!1}),(function(){f.dispose(s)}))}))},m.prototype.all=function(t){t=f.createLambda(t);var e=!0;return this.forEach((function(n){if(!t(n))return e=!1,!1})),e},m.prototype.any=function(t){t=f.createLambda(t);var e=this.getEnumerator();try{if(0==arguments.length)return e.moveNext();for(;e.moveNext();)if(t(e.current()))return!0;return!1}finally{f.dispose(e)}},m.prototype.isEmpty=function(){return!this.any()},m.prototype.concat=function(){var t=this;if(1==arguments.length){var e=arguments[0];return new m((function(){var n,r;return new d((function(){n=t.getEnumerator()}),(function(){if(null==r){if(n.moveNext())return this.yieldReturn(n.current());r=m.from(e).getEnumerator()}return!!r.moveNext()&&this.yieldReturn(r.current())}),(function(){try{f.dispose(n)}finally{f.dispose(r)}}))}))}var n=arguments;return new m((function(){var e;return new d((function(){e=m.make(t).concat(m.from(n).select(m.from)).select((function(t){return t.getEnumerator()})).toArray()}),(function(){for(;e.length>0;){var t=e[0];if(t.moveNext())return this.yieldReturn(t.current());t.dispose(),e.splice(0,1)}return this.yieldBreak()}),(function(){m.from(e).forEach(f.dispose)}))}))},m.prototype.insert=function(t,e){var n=this;return new m((function(){var r,i,o=0,a=!1;return new d((function(){r=n.getEnumerator(),i=m.from(e).getEnumerator()}),(function(){return o==t&&i.moveNext()?(a=!0,this.yieldReturn(i.current())):r.moveNext()?(o++,this.yieldReturn(r.current())):!(a||!i.moveNext())&&this.yieldReturn(i.current())}),(function(){try{f.dispose(r)}finally{f.dispose(i)}}))}))},m.prototype.alternate=function(t){var e=this;return new m((function(){var n,r,i,o;return new d((function(){i=t instanceof Array||null!=t.getEnumerator?m.from(m.from(t).toArray()):m.make(t),(r=e.getEnumerator()).moveNext()&&(n=r.current())}),(function(){for(;;){if(null!=o){if(o.moveNext())return this.yieldReturn(o.current());o=null}if(null!=n||!r.moveNext()){if(null!=n){var t=n;return n=null,this.yieldReturn(t)}return this.yieldBreak()}n=r.current(),o=i.getEnumerator()}}),(function(){try{f.dispose(r)}finally{f.dispose(o)}}))}))},m.prototype.contains=function(t,e){e=f.createLambda(e);var n=this.getEnumerator();try{for(;n.moveNext();)if(e(n.current())===t)return!0;return!1}finally{f.dispose(n)}},m.prototype.defaultIfEmpty=function(t){var e=this;return t===o&&(t=null),new m((function(){var n,r=!0;return new d((function(){n=e.getEnumerator()}),(function(){return n.moveNext()?(r=!1,this.yieldReturn(n.current())):!!r&&(r=!1,this.yieldReturn(t))}),(function(){f.dispose(n)}))}))},m.prototype.distinct=function(t){return this.except(m.empty(),t)},m.prototype.distinctUntilChanged=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n,r,i;return new d((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();){var e=t(n.current());if(i)return i=!1,r=e,this.yieldReturn(n.current());if(r!==e)return r=e,this.yieldReturn(n.current())}return this.yieldBreak()}),(function(){f.dispose(n)}))}))},m.prototype.except=function(t,e){e=f.createLambda(e);var n=this;return new m((function(){var r,i;return new d((function(){r=n.getEnumerator(),i=new P(e),m.from(t).forEach((function(t){i.add(t)}))}),(function(){for(;r.moveNext();){var t=r.current();if(!i.contains(t))return i.add(t),this.yieldReturn(t)}return!1}),(function(){f.dispose(r)}))}))},m.prototype.intersect=function(t,e){e=f.createLambda(e);var n=this;return new m((function(){var r,i,o;return new d((function(){r=n.getEnumerator(),i=new P(e),m.from(t).forEach((function(t){i.add(t)})),o=new P(e)}),(function(){for(;r.moveNext();){var t=r.current();if(!o.contains(t)&&i.contains(t))return o.add(t),this.yieldReturn(t)}return!1}),(function(){f.dispose(r)}))}))},m.prototype.sequenceEqual=function(t,e){e=f.createLambda(e);var n=this.getEnumerator();try{var r=m.from(t).getEnumerator();try{for(;n.moveNext();)if(!r.moveNext()||e(n.current())!==e(r.current()))return!1;return!r.moveNext()}finally{f.dispose(r)}}finally{f.dispose(n)}},m.prototype.union=function(t,e){e=f.createLambda(e);var n=this;return new m((function(){var r,i,a;return new d((function(){r=n.getEnumerator(),a=new P(e)}),(function(){var e;if(i===o){for(;r.moveNext();)if(e=r.current(),!a.contains(e))return a.add(e),this.yieldReturn(e);i=m.from(t).getEnumerator()}for(;i.moveNext();)if(e=i.current(),!a.contains(e))return a.add(e),this.yieldReturn(e);return!1}),(function(){try{f.dispose(r)}finally{f.dispose(i)}}))}))},m.prototype.orderBy=function(t){return new y(this,t,!1)},m.prototype.orderByDescending=function(t){return new y(this,t,!0)},m.prototype.reverse=function(){var t=this;return new m((function(){var e,n;return new d((function(){e=t.toArray(),n=e.length}),(function(){return n>0&&this.yieldReturn(e[--n])}),a.Blank)}))},m.prototype.shuffle=function(){var t=this;return new m((function(){var e;return new d((function(){e=t.toArray()}),(function(){if(e.length>0){var t=Math.floor(Math.random()*e.length);return this.yieldReturn(e.splice(t,1)[0])}return!1}),a.Blank)}))},m.prototype.weightedSample=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.choose((function(e){var n=t(e);return n<=0?null:{value:e,bound:r+=n}})).toArray()}),(function(){if(n.length>0){for(var t=Math.floor(Math.random()*r)+1,e=-1,i=n.length;i-e>1;){var o=Math.floor((e+i)/2);n[o].bound>=t?i=o:e=o}return this.yieldReturn(n[i].value)}return this.yieldBreak()}),a.Blank)}))},m.prototype.groupBy=function(t,e,n,r){var i=this;return t=f.createLambda(t),e=f.createLambda(e),null!=n&&(n=f.createLambda(n)),r=f.createLambda(r),new m((function(){var o;return new d((function(){o=i.toLookup(t,e,r).toEnumerable().getEnumerator()}),(function(){for(;o.moveNext();)return null==n?this.yieldReturn(o.current()):this.yieldReturn(n(o.current().key(),o.current()));return!1}),(function(){f.dispose(o)}))}))},m.prototype.partitionBy=function(t,e,n,r){var i,o=this;return t=f.createLambda(t),e=f.createLambda(e),r=f.createLambda(r),null==n?(i=!1,n=function(t,e){return new x(t,e)}):(i=!0,n=f.createLambda(n)),new m((function(){var a,s,l,u=[];return new d((function(){(a=o.getEnumerator()).moveNext()&&(s=t(a.current()),l=r(s),u.push(e(a.current())))}),(function(){for(var o;1==(o=a.moveNext())&&l===r(t(a.current()));)u.push(e(a.current()));if(u.length>0){var c=n(s,i?m.from(u):u);return o?(s=t(a.current()),l=r(s),u=[e(a.current())]):u=[],this.yieldReturn(c)}return!1}),(function(){f.dispose(a)}))}))},m.prototype.buffer=function(t){var e=this;return new m((function(){var n;return new d((function(){n=e.getEnumerator()}),(function(){for(var e=[],r=0;n.moveNext();)if(e.push(n.current()),++r>=t)return this.yieldReturn(e);return e.length>0&&this.yieldReturn(e)}),(function(){f.dispose(n)}))}))},m.prototype.aggregate=function(t,e,n){return(n=f.createLambda(n))(this.scan(t,e,n).last())},m.prototype.average=function(t){t=f.createLambda(t);var e=0,n=0;return this.forEach((function(r){e+=t(r),++n})),e/n},m.prototype.count=function(t){t=null==t?a.True:f.createLambda(t);var e=0;return this.forEach((function(n,r){t(n,r)&&++e})),e},m.prototype.max=function(t){return null==t&&(t=a.Identity),this.select(t).aggregate((function(t,e){return t>e?t:e}))},m.prototype.min=function(t){return null==t&&(t=a.Identity),this.select(t).aggregate((function(t,e){return t<e?t:e}))},m.prototype.maxBy=function(t){return t=f.createLambda(t),this.aggregate((function(e,n){return t(e)>t(n)?e:n}))},m.prototype.minBy=function(t){return t=f.createLambda(t),this.aggregate((function(e,n){return t(e)<t(n)?e:n}))},m.prototype.sum=function(t){return null==t&&(t=a.Identity),this.select(t).aggregate(0,(function(t,e){return t+e}))},m.prototype.elementAt=function(t){var e,n=!1;if(this.forEach((function(r,i){if(i==t)return e=r,n=!0,!1})),!n)throw new Error("index is less than 0 or greater than or equal to the number of elements in source.");return e},m.prototype.elementAtOrDefault=function(t,e){var n;e===o&&(e=null);var r=!1;return this.forEach((function(e,i){if(i==t)return n=e,r=!0,!1})),r?n:e},m.prototype.first=function(t){if(null!=t)return this.where(t).first();var e,n=!1;if(this.forEach((function(t){return e=t,n=!0,!1})),!n)throw new Error("first:No element satisfies the condition.");return e},m.prototype.firstOrDefault=function(t,e){if(t!==o){if(typeof t===h||typeof f.createLambda(t)===h)return this.where(t).firstOrDefault(o,e);e=t}var n,r=!1;return this.forEach((function(t){return n=t,r=!0,!1})),r?n:e},m.prototype.last=function(t){if(null!=t)return this.where(t).last();var e,n=!1;if(this.forEach((function(t){n=!0,e=t})),!n)throw new Error("last:No element satisfies the condition.");return e},m.prototype.lastOrDefault=function(t,e){if(t!==o){if(typeof t===h||typeof f.createLambda(t)===h)return this.where(t).lastOrDefault(o,e);e=t}var n,r=!1;return this.forEach((function(t){r=!0,n=t})),r?n:e},m.prototype.single=function(t){if(null!=t)return this.where(t).single();var e,n=!1;if(this.forEach((function(t){if(n)throw new Error("single:sequence contains more than one element.");n=!0,e=t})),!n)throw new Error("single:No element satisfies the condition.");return e},m.prototype.singleOrDefault=function(t,e){if(e===o&&(e=null),null!=t)return this.where(t).singleOrDefault(null,e);var n,r=!1;return this.forEach((function(t){if(r)throw new Error("single:sequence contains more than one element.");r=!0,n=t})),r?n:e},m.prototype.skip=function(t){var e=this;return new m((function(){var n,r=0;return new d((function(){for(n=e.getEnumerator();r++<t&&n.moveNext(););}),(function(){return!!n.moveNext()&&this.yieldReturn(n.current())}),(function(){f.dispose(n)}))}))},m.prototype.skipWhile=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n,r=0,i=!1;return new d((function(){n=e.getEnumerator()}),(function(){for(;!i;){if(!n.moveNext())return!1;if(!t(n.current(),r++))return i=!0,this.yieldReturn(n.current())}return!!n.moveNext()&&this.yieldReturn(n.current())}),(function(){f.dispose(n)}))}))},m.prototype.take=function(t){var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){return!!(r++<t&&n.moveNext())&&this.yieldReturn(n.current())}),(function(){f.dispose(n)}))}))},m.prototype.takeWhile=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){return!(!n.moveNext()||!t(n.current(),r++))&&this.yieldReturn(n.current())}),(function(){f.dispose(n)}))}))},m.prototype.takeExceptLast=function(t){null==t&&(t=1);var e=this;return new m((function(){if(t<=0)return e.getEnumerator();var n,r=[];return new d((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();){if(r.length==t)return r.push(n.current()),this.yieldReturn(r.shift());r.push(n.current())}return!1}),(function(){f.dispose(n)}))}))},m.prototype.takeFromLast=function(t){if(t<=0||null==t)return m.empty();var e=this;return new m((function(){var n,r,i=[];return new d((function(){n=e.getEnumerator()}),(function(){for(;n.moveNext();)i.length==t&&i.shift(),i.push(n.current());return null==r&&(r=m.from(i).getEnumerator()),!!r.moveNext()&&this.yieldReturn(r.current())}),(function(){f.dispose(r)}))}))},m.prototype.indexOf=function(t){var e=null;return typeof t===h?this.forEach((function(n,r){if(t(n,r))return e=r,!1})):this.forEach((function(n,r){if(n===t)return e=r,!1})),null!==e?e:-1},m.prototype.lastIndexOf=function(t){var e=-1;return typeof t===h?this.forEach((function(n,r){t(n,r)&&(e=r)})):this.forEach((function(n,r){n===t&&(e=r)})),e},m.prototype.cast=function(){return this},m.prototype.asEnumerable=function(){return m.from(this)},m.prototype.toArray=function(){var t=[];return this.forEach((function(e){t.push(e)})),t},m.prototype.toLookup=function(t,e,n){t=f.createLambda(t),e=f.createLambda(e),n=f.createLambda(n);var r=new P(n);return this.forEach((function(n){var i=t(n),a=e(n),s=r.get(i);s!==o?s.push(a):r.add(i,[a])})),new S(r)},m.prototype.toObject=function(t,e){t=f.createLambda(t),e=f.createLambda(e);var n={};return this.forEach((function(r){n[t(r)]=e(r)})),n},m.prototype.toDictionary=function(t,e,n){t=f.createLambda(t),e=f.createLambda(e),n=f.createLambda(n);var r=new P(n);return this.forEach((function(n){r.add(t(n),e(n))})),r},m.prototype.toJSONString=function(t,e){if(typeof JSON===c||null==JSON.stringify)throw new Error("toJSONString can't find JSON.stringify. This works native JSON support Browser or include json2.js");return JSON.stringify(this.toArray(),t,e)},m.prototype.toJoinedString=function(t,e){return null==t&&(t=""),null==e&&(e=a.Identity),this.select(e).toArray().join(t)},m.prototype.doAction=function(t){var e=this;return t=f.createLambda(t),new m((function(){var n,r=0;return new d((function(){n=e.getEnumerator()}),(function(){return!!n.moveNext()&&(t(n.current(),r++),this.yieldReturn(n.current()))}),(function(){f.dispose(n)}))}))},m.prototype.forEach=function(t){t=f.createLambda(t);var e=0,n=this.getEnumerator();try{for(;n.moveNext()&&!1!==t(n.current(),e++););}finally{f.dispose(n)}},m.prototype.write=function(t,e){null==t&&(t=""),e=f.createLambda(e);var n=!0;this.forEach((function(r){n?n=!1:document.write(t),document.write(e(r))}))},m.prototype.writeLine=function(t){t=f.createLambda(t),this.forEach((function(e){document.writeln(t(e)+"<br />")}))},m.prototype.force=function(){var t=this.getEnumerator();try{for(;t.moveNext(););}finally{f.dispose(t)}},m.prototype.letBind=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n;return new d((function(){n=m.from(t(e)).getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(n.current())}),(function(){f.dispose(n)}))}))},m.prototype.share=function(){var t,e=this,n=!1;return new v((function(){return new d((function(){null==t&&(t=e.getEnumerator())}),(function(){if(n)throw new Error("enumerator is disposed");return!!t.moveNext()&&this.yieldReturn(t.current())}),a.Blank)}),(function(){n=!0,f.dispose(t)}))},m.prototype.memoize=function(){var t,e,n=this,r=!1;return new v((function(){var i=-1;return new d((function(){null==e&&(e=n.getEnumerator(),t=[])}),(function(){if(r)throw new Error("enumerator is disposed");return i++,t.length<=i?!!e.moveNext()&&this.yieldReturn(t[i]=e.current()):this.yieldReturn(t[i])}),a.Blank)}),(function(){r=!0,f.dispose(e),t=null}))},f.hasNativeIteratorSupport()&&(m.prototype[Symbol.iterator]=function(){return{enumerator:this.getEnumerator(),next:function(){return this.enumerator.moveNext()?{done:!1,value:this.enumerator.current()}:{done:!0}}}}),m.prototype.catchError=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n;return new d((function(){n=e.getEnumerator()}),(function(){try{return!!n.moveNext()&&this.yieldReturn(n.current())}catch(e){return t(e),!1}}),(function(){f.dispose(n)}))}))},m.prototype.finallyAction=function(t){t=f.createLambda(t);var e=this;return new m((function(){var n;return new d((function(){n=e.getEnumerator()}),(function(){return!!n.moveNext()&&this.yieldReturn(n.current())}),(function(){try{f.dispose(n)}finally{t()}}))}))},m.prototype.log=function(t){return t=f.createLambda(t),this.doAction((function(e){typeof console!==c&&console.log(t(e))}))},m.prototype.trace=function(t,e){return null==t&&(t="Trace"),e=f.createLambda(e),this.doAction((function(n){typeof console!==c&&console.log(t,e(n))}))};var y=function(t,e,n,r){this.source=t,this.keySelector=f.createLambda(e),this.descending=n,this.parent=r};y.prototype=new m,y.prototype.createOrderedEnumerable=function(t,e){return new y(this.source,t,e,this)},y.prototype.thenBy=function(t){return this.createOrderedEnumerable(t,!1)},y.prototype.thenByDescending=function(t){return this.createOrderedEnumerable(t,!0)},y.prototype.getEnumerator=function(){var t,e,n=this,r=0;return new d((function(){t=[],e=[],n.source.forEach((function(n,r){t.push(n),e.push(r)}));var r=_.create(n,null);r.GenerateKeys(t),e.sort((function(t,e){return r.compare(t,e)}))}),(function(){return r<e.length&&this.yieldReturn(t[e[r++]])}),a.Blank)};var _=function(t,e,n){this.keySelector=t,this.descending=e,this.child=n,this.keys=null};_.create=function(t,e){var n=new _(t.keySelector,t.descending,e);return null!=t.parent?_.create(t.parent,n):n},_.prototype.GenerateKeys=function(t){for(var e=t.length,n=this.keySelector,r=new Array(e),i=0;i<e;i++)r[i]=n(t[i]);this.keys=r,null!=this.child&&this.child.GenerateKeys(t)},_.prototype.compare=function(t,e){var n=f.compare(this.keys[t],this.keys[e]);return 0==n?null!=this.child?this.child.compare(t,e):f.compare(t,e):this.descending?-n:n};var v=function(t,e){this.dispose=e,m.call(this,t)};v.prototype=new m;var b=function(t){this.getSource=function(){return t}};b.prototype=new m,b.prototype.any=function(t){return null==t?this.getSource().length>0:m.prototype.any.apply(this,arguments)},b.prototype.count=function(t){return null==t?this.getSource().length:m.prototype.count.apply(this,arguments)},b.prototype.elementAt=function(t){var e=this.getSource();return 0<=t&&t<e.length?e[t]:m.prototype.elementAt.apply(this,arguments)},b.prototype.elementAtOrDefault=function(t,e){e===o&&(e=null);var n=this.getSource();return 0<=t&&t<n.length?n[t]:e},b.prototype.first=function(t){var e=this.getSource();return null==t&&e.length>0?e[0]:m.prototype.first.apply(this,arguments)},b.prototype.firstOrDefault=function(t,e){if(t!==o)return m.prototype.firstOrDefault.apply(this,arguments);e=t;var n=this.getSource();return n.length>0?n[0]:e},b.prototype.last=function(t){var e=this.getSource();return null==t&&e.length>0?e[e.length-1]:m.prototype.last.apply(this,arguments)},b.prototype.lastOrDefault=function(t,e){if(t!==o)return m.prototype.lastOrDefault.apply(this,arguments);e=t;var n=this.getSource();return n.length>0?n[n.length-1]:e},b.prototype.skip=function(t){var e=this.getSource();return new m((function(){var n;return new d((function(){n=t<0?0:t}),(function(){return n<e.length&&this.yieldReturn(e[n++])}),a.Blank)}))},b.prototype.takeExceptLast=function(t){return null==t&&(t=1),this.take(this.getSource().length-t)},b.prototype.takeFromLast=function(t){return this.skip(this.getSource().length-t)},b.prototype.reverse=function(){var t=this.getSource();return new m((function(){var e;return new d((function(){e=t.length}),(function(){return e>0&&this.yieldReturn(t[--e])}),a.Blank)}))},b.prototype.sequenceEqual=function(t,e){return(!(t instanceof b||t instanceof Array)||null!=e||m.from(t).count()==this.count())&&m.prototype.sequenceEqual.apply(this,arguments)},b.prototype.toJoinedString=function(t,e){var n=this.getSource();return null==e&&n instanceof Array?(null==t&&(t=""),n.join(t)):m.prototype.toJoinedString.apply(this,arguments)},b.prototype.getEnumerator=function(){var t=this.getSource(),e=-1;return{current:function(){return t[e]},moveNext:function(){return++e<t.length},dispose:a.Blank}};var w=function(t,e){this.prevSource=t,this.prevPredicate=e};w.prototype=new m,w.prototype.where=function(t){if((t=f.createLambda(t)).length<=1){var e=this.prevPredicate;return new w(this.prevSource,(function(n){return e(n)&&t(n)}))}return m.prototype.where.call(this,t)},w.prototype.select=function(t){return(t=f.createLambda(t)).length<=1?new C(this.prevSource,this.prevPredicate,t):m.prototype.select.call(this,t)},w.prototype.getEnumerator=function(){var t,e=this.prevPredicate,n=this.prevSource;return new d((function(){t=n.getEnumerator()}),(function(){for(;t.moveNext();)if(e(t.current()))return this.yieldReturn(t.current());return!1}),(function(){f.dispose(t)}))};var C=function(t,e,n){this.prevSource=t,this.prevPredicate=e,this.prevSelector=n};C.prototype=new m,C.prototype.where=function(t){return(t=f.createLambda(t)).length<=1?new w(this,t):m.prototype.where.call(this,t)},C.prototype.select=function(t){if((t=f.createLambda(t)).length<=1){var e=this.prevSelector;return new C(this.prevSource,this.prevPredicate,(function(n){return t(e(n))}))}return m.prototype.select.call(this,t)},C.prototype.getEnumerator=function(){var t,e=this.prevPredicate,n=this.prevSelector,r=this.prevSource;return new d((function(){t=r.getEnumerator()}),(function(){for(;t.moveNext();)if(null==e||e(t.current()))return this.yieldReturn(n(t.current()));return!1}),(function(){f.dispose(t)}))};var P=function(){var t=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e=function(t){return null===t?"null":t===o?"undefined":typeof t.toString===h?t.toString():Object.prototype.toString.call(t)},n=function(t,e){this.key=t,this.value=e,this.prev=null,this.next=null},r=function(){this.first=null,this.last=null};r.prototype={addLast:function(t){null!=this.last?(this.last.next=t,t.prev=this.last,this.last=t):this.first=this.last=t},replace:function(t,e){null!=t.prev?(t.prev.next=e,e.prev=t.prev):this.first=e,null!=t.next?(t.next.prev=e,e.next=t.next):this.last=e},remove:function(t){null!=t.prev?t.prev.next=t.next:this.first=t.next,null!=t.next?t.next.prev=t.prev:this.last=t.prev}};var i=function(t){this.countField=0,this.entryList=new r,this.buckets={},this.compareSelector=null==t?a.Identity:t};return i.prototype={add:function(r,i){var o=this.compareSelector(r),a=e(o),s=new n(r,i);if(t(this.buckets,a)){for(var l=this.buckets[a],u=0;u<l.length;u++)if(this.compareSelector(l[u].key)===o)return this.entryList.replace(l[u],s),void(l[u]=s);l.push(s)}else this.buckets[a]=[s];this.countField++,this.entryList.addLast(s)},get:function(n){var r=this.compareSelector(n),i=e(r);if(!t(this.buckets,i))return o;for(var a=this.buckets[i],s=0;s<a.length;s++){var l=a[s];if(this.compareSelector(l.key)===r)return l.value}return o},set:function(r,i){var o=this.compareSelector(r),a=e(o);if(t(this.buckets,a))for(var s=this.buckets[a],l=0;l<s.length;l++)if(this.compareSelector(s[l].key)===o){var u=new n(r,i);return this.entryList.replace(s[l],u),s[l]=u,!0}return!1},contains:function(n){var r=this.compareSelector(n),i=e(r);if(!t(this.buckets,i))return!1;for(var o=this.buckets[i],a=0;a<o.length;a++)if(this.compareSelector(o[a].key)===r)return!0;return!1},clear:function(){this.countField=0,this.buckets={},this.entryList=new r},remove:function(n){var r=this.compareSelector(n),i=e(r);if(t(this.buckets,i))for(var o=this.buckets[i],a=0;a<o.length;a++)if(this.compareSelector(o[a].key)===r)return this.entryList.remove(o[a]),o.splice(a,1),0==o.length&&delete this.buckets[i],void this.countField--},count:function(){return this.countField},toEnumerable:function(){var t=this;return new m((function(){var e;return new d((function(){e=t.entryList.first}),(function(){if(null!=e){var t={key:e.key,value:e.value};return e=e.next,this.yieldReturn(t)}return!1}),a.Blank)}))}},i}(),S=function(t){this.count=function(){return t.count()},this.get=function(e){return m.from(t.get(e))},this.contains=function(e){return t.contains(e)},this.toEnumerable=function(){return t.toEnumerable().select((function(t){return new x(t.key,t.value)}))}},x=function(t,e){this.key=function(){return t},b.call(this,e)};x.prototype=new b,n(859)?(r=function(){return m}.apply(e,[]))===o||(t.exports=r):typeof t!==c&&t.exports?t.exports=m:i.Enumerable=m}(this)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r,i=n(423),o=n(450),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(t){this._color=t},enumerable:!0,configurable:!0}),e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.equals=function(e){return!!t.prototype.equals.call(this,e)&&o.a.equals(this.color,e.color)},e.prototype._copy=function(e,n,r){var i;t.prototype._copy.call(this,e,n,r),n.color=null===(i=e.color)||void 0===i?void 0:i.clone()},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(408),i=n(438),o=n(416),a=n(409),s=n(415),l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(){function t(e){var n=this;void 0===e&&(e=!0),this._allowRotateConstraint=null,this.propertyChanged=new r.a,this._firePropertyChanged=function(){return n.propertyChanged.notify()},this.type=t.type,this.allowDelete=e,this.allowMoveHorizontal=e,this.allowMoveVertical=e,this.allowRotate=e,this.allowDragAndDrop=e,this.resizeGrips=new i.a(e,e)}return Object.defineProperty(t.prototype,"allowDelete",{get:function(){return this._allowDelete},set:function(t){this._allowDelete!==t&&(this._allowDelete=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowMoveHorizontal",{get:function(){return this._allowMoveHorizontal},set:function(t){this._allowMoveHorizontal!==t&&(this._allowMoveHorizontal=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowMoveVertical",{get:function(){return this._allowMoveVertical},set:function(t){this._allowMoveVertical!==t&&(this._allowMoveVertical=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowMove",{get:function(){return this.allowMoveVertical||this.allowMoveHorizontal},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowRotateConstraint",{set:function(t){var e=this.allowRotate;this._allowRotateConstraint=t,this.allowRotate!==e&&this.propertyChanged.notify()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowRotate",{get:function(){return null!=this._allowRotateConstraint?this._allowRotateConstraint:this._allowRotate},set:function(t){this._allowRotate!==t&&(this._allowRotate=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowDragAndDrop",{get:function(){return this._allowDragAndDrop},set:function(t){this._allowDragAndDrop!==t&&(this._allowDragAndDrop=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"resizeGrips",{get:function(){return this._resizeGrips},set:function(t){null!=this.resizeGrips&&null!=this.resizeGrips.propertyChanged&&this.resizeGrips.propertyChanged.remove(this._firePropertyChanged),this._resizeGrips=t,null!=this.resizeGrips.propertyChanged&&this.resizeGrips.propertyChanged.add(this._firePropertyChanged),this.propertyChanged.notify()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowResize",{get:function(){return this.resizeGrips.edge||this.resizeGrips.corner.length>0},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.allowDelete=this.allowDelete,e.allowDragAndDrop=this.allowDragAndDrop,e.allowMoveHorizontal=this.allowMoveHorizontal,e.allowMoveVertical=this.allowMoveVertical,e.allowRotate=this.allowRotate,e.allowRotateConstraint=this.allowRotateConstraint,e.resizeGrips=this.resizeGrips.clone(),e},t.prototype.equals=function(t){return this.allowDelete===t.allowDelete&&this.allowDragAndDrop===t.allowDragAndDrop&&this.allowMoveHorizontal===t.allowMoveHorizontal&&this.allowMoveVertical===t.allowMoveVertical&&this.allowRotate===t.allowRotate&&this.allowRotateConstraint===t.allowRotateConstraint&&Object(a.g)(this.resizeGrips,t.resizeGrips)},t.prototype.getSimplifiedObject=function(){var t={};return t.allowDelete=this.allowDelete,t.resizeGrips=this.resizeGrips.getSimplifiedObject(),t.allowMoveHorizontal=this.allowMoveHorizontal,t.allowMoveVertical=this.allowMoveVertical,t.allowRotate=this.allowRotate,t.allowDragAndDrop=this.allowDragAndDrop,t},t.CreateFromRaw=function(e){var n=o.c(new i.a(!0,!0),e.resizeGrips),r=o.c(new t,e);return r.resizeGrips=n,r},t.type="ManipulationPermissions",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(s.a)({ignore:!0}),l("design:type",Boolean),l("design:paramtypes",[Boolean])],t.prototype,"allowRotateConstraint",null),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r=function(){function t(){this.data={},this._typeDictionary={}}return t.prototype.getPropertyMetadata=function(t,e){var n=t.type;if(null==n)return null;if(null==this._typeDictionary[n]){this._typeDictionary[n]=[];for(var r=t;null!=r.constructor.type;)this._typeDictionary[n].push(r.constructor.type),r=Object.getPrototypeOf(r)}for(var i=0;i<this._typeDictionary[n].length;i++){var o=this._typeDictionary[n][i];if(null!=this.data[o]){var a=this.data[o][e];if(null!=a)return a}}return null},t}(),i=new r},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(408),i=function(){function t(){this._noPrint=!1,this._noShow=!1,this.propertyChanged=new r.a}return Object.defineProperty(t.prototype,"noPrint",{get:function(){return this._noPrint},set:function(t){this._noPrint!==t&&(this._noPrint=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"noShow",{get:function(){return this._noShow},set:function(t){this._noShow!==t&&(this._noShow=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.noShow=this.noShow,e.noPrint=this.noPrint,e},t.prototype.equals=function(t){return this.noShow===t.noShow&&this.noPrint===t.noPrint},t.prototype.getSimplifiedObject=function(){var t={};return t.noPrint=this.noPrint,t.noShow=this.noShow,t},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(408),i=n(549),o=n(409),a=function(){function t(t){var e=this;this._allowZOrderChange=!0,this._allowOpacityChange=!0,this._allowRemoveOnLayoutChange=!0,this._firePropertyChanged=function(){return e.propertyChanged.fire()},this.propertyChanged=new r.a,null==t&&(t=!0),this.allowZOrderChange=t,this.allowOpacityChange=t,this.allowRemoveOnLayoutChange=t,this.itemToolbarPermissions=new i.a(t)}return Object.defineProperty(t.prototype,"allowZOrderChange",{get:function(){return this._allowZOrderChange},set:function(t){this._allowZOrderChange!==t&&(this._allowZOrderChange=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowOpacityChange",{get:function(){return this._allowOpacityChange},set:function(t){this._allowOpacityChange!==t&&(this._allowOpacityChange=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowRemoveOnLayoutChange",{get:function(){return this._allowRemoveOnLayoutChange},set:function(t){this._allowRemoveOnLayoutChange!==t&&(this._allowRemoveOnLayoutChange=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemToolbarPermissions",{get:function(){return this._itemToolbarPermissions},set:function(t){Object(o.g)(this,t)||(null!=this.itemToolbarPermissions&&null!=this.itemToolbarPermissions.propertyChanged&&this.itemToolbarPermissions.propertyChanged.remove(this._firePropertyChanged),this._itemToolbarPermissions=t,null!=this.itemToolbarPermissions.propertyChanged&&this.itemToolbarPermissions.propertyChanged.add(this._firePropertyChanged),this.propertyChanged.fire())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.allowZOrderChange=this.allowZOrderChange,t.allowOpacityChange=this.allowOpacityChange,t.allowRemoveOnLayoutChange=this.allowRemoveOnLayoutChange,t.itemToolbarPermissions=this.itemToolbarPermissions.getSimplifiedObject(),t},t.prototype.clone=function(){var e=new t;return e.allowZOrderChange=this.allowZOrderChange,e.allowOpacityChange=this.allowOpacityChange,e.allowRemoveOnLayoutChange=this.allowRemoveOnLayoutChange,e.itemToolbarPermissions=this.itemToolbarPermissions.clone(),e},t.prototype.equals=function(t){return this.allowZOrderChange===t.allowZOrderChange&&this.allowOpacityChange===t.allowOpacityChange&&this.allowRemoveOnLayoutChange===t.allowRemoveOnLayoutChange&&Object(o.g)(this.itemToolbarPermissions,t.itemToolbarPermissions)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(408),i=n(415),o=n(434),a=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},s=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},l=function(){function t(e){void 0===e&&(e=!0),this._showDeleteButton=!0,this._showEditButton=!0,this._showSelectButton=!0,this._showEditButtonConstraint=null,this._showHandleButton=!0,this.propertyChanged=new r.a,this.showSelectButtonConstraint=null,this.type=t.type,this.showDeleteButton=e,this.showEditButton=e,this.showSelectButton=e,this.showHandleButton=e}return Object.defineProperty(t.prototype,"showDeleteButton",{get:function(){return this._showDeleteButton},set:function(t){this._showDeleteButton!==t&&(this._showDeleteButton=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showEditButton",{get:function(){return null!=this.showEditButtonConstraint?this.showEditButtonConstraint:this._showEditButton},set:function(t){this._showEditButton!==t&&(this._showEditButton=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showEditButtonConstraint",{get:function(){return this._showEditButtonConstraint},set:function(t){this.showEditButtonConstraint!==t&&(this._showEditButtonConstraint=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showSelectButton",{get:function(){return null!=this.showSelectButtonConstraint?this.showSelectButtonConstraint:this._showSelectButton},set:function(t){this._showSelectButton!==t&&(this._showSelectButton=t,this.propertyChanged.fire())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.showDeleteButton=this.showDeleteButton,t.showEditButton=this.showEditButton,t.showSelectButton=this.showSelectButton,t.showEditButtonConstraint=this.showEditButtonConstraint,t.showSelectButtonConstraint=this.showSelectButtonConstraint,t.showHandleButton=this.showHandleButton,t},t.prototype.clone=function(){var e=new t;return e.showDeleteButton=this._showDeleteButton,e.showEditButton=this._showEditButton,e.showEditButtonConstraint=this.showEditButtonConstraint,e.showSelectButton=this._showSelectButton,e.showSelectButtonConstraint=this.showSelectButtonConstraint,e.showHandleButton=this._showHandleButton,e},t.prototype.equals=function(t){return this.showDeleteButton==t.showDeleteButton&&this.showEditButton===t.showEditButton&&this.showEditButtonConstraint===t.showEditButtonConstraint&&this.showSelectButton===t.showSelectButton&&this.showSelectButtonConstraint===t.showSelectButtonConstraint&&this.showHandleButton===t.showHandleButton},t.type="ItemToolbarPermissions",a([Object(i.a)({ignore:!0,type:"boolean"}),s("design:type",Boolean)],t.prototype,"showSelectButtonConstraint",void 0),a([Object(i.a)({ignore:!0}),s("design:type",Boolean),s("design:paramtypes",[Boolean])],t.prototype,"showEditButtonConstraint",null),a([Object(o.a)(),s("design:type",Boolean)],t.prototype,"showHandleButton",void 0),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(408),i=function(){function t(){this._displayInObjectInspector=!0,this.propertyChanged=new r.a}return Object.defineProperty(t.prototype,"displayInObjectInspector",{get:function(){return this._displayInObjectInspector},set:function(t){this._displayInObjectInspector!==t&&(this._displayInObjectInspector=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.displayInObjectInspector=this.displayInObjectInspector,t},t.prototype.clone=function(){var e=new t;return e.displayInObjectInspector=this.displayInObjectInspector,e},t.prototype.equals=function(t){return this.displayInObjectInspector===t.displayInObjectInspector},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(409),i=function(){function t(){this.styles=[],this.clipartColors=[]}return t.fromRaw=function(e){var n=new t;return n.text=e.text,n.stroke=e.stroke,n.shadow=e.shadow,n.img=e.img,n.border=e.border,n.fill=e.fill,n.textFill=e.textFill,n.line=e.line,n.altline=e.altline,n.horizontal=e.horizontal,n.vertical=e.vertical,n.barcode=e.barcode,n.styles=null!=e.styles?e.styles.slice(0):null,n.clipartColors=null!=e.clipartColors?e.clipartColors.slice(0):null,n},t.prototype.clone=function(){var e=new t;return e.text=this.text,e.stroke=this.stroke,e.shadow=this.shadow,e.img=this.img,e.border=this.border,e.fill=this.fill,e.textFill=this.textFill,e.line=this.line,e.altline=this.altline,e.horizontal=this.horizontal,e.vertical=this.vertical,e.barcode=this.barcode,e.styles=null!=this.styles?this.styles.slice(0):null,e.clipartColors=null!=this.clipartColors?this.clipartColors.slice(0):null,e},t.prototype.equals=function(t){return this.text===t.text&&this.stroke===t.stroke&&this.shadow===t.shadow&&this.img===t.img&&this.border===t.border&&this.fill===t.fill&&this.textFill===t.textFill&&this.line===t.line&&this.altline===t.altline&&this.horizontal===t.horizontal&&this.vertical===t.vertical&&this.barcode===t.barcode&&Object(r.c)(this.styles,t.styles)&&Object(r.c)(this.clipartColors,t.clipartColors)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r,i=n(434),o=n(423),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(t){function e(n){var r=t.call(this)||this;return r.type=e.type,null==n&&(n=!0),r._allowSafetyLines=n,r._allowRegion=n,r._allowBleedArea=n,r}return a(e,t),e.prototype.clone=function(t){void 0===t&&(t=null);var n=null!=t?t:new e;return n.allowSafetyLines=this.allowSafetyLines,n.allowRegion=this.allowRegion,n.allowBleedArea=this.allowBleedArea,n},e.prototype.equals=function(t){return this.type===t.type&&this.allowSafetyLines===t.allowSafetyLines&&this.allowRegion===t.allowRegion&&this.allowBleedArea===t.allowBleedArea},e.type="ViolationSettings",s([Object(i.a)(),l("design:type",Boolean)],e.prototype,"allowSafetyLines",void 0),s([Object(i.a)(),l("design:type",Boolean)],e.prototype,"allowRegion",void 0),s([Object(i.a)(),l("design:type",Boolean)],e.prototype,"allowBleedArea",void 0),e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(408),i=function(){function t(t){this._allowChangeBorderWidth=!0,this._allowChangeFillColor=!0,this._allowChangeBorderColor=!0,this.propertyChanged=new r.a,null==t&&(t=!0),this.allowChangeBorderWidth=t,this.allowChangeFillColor=t,this.allowChangeBorderColor=t}return Object.defineProperty(t.prototype,"allowChangeBorderWidth",{get:function(){return this._allowChangeBorderWidth},set:function(t){this._allowChangeBorderWidth!==t&&(this._allowChangeBorderWidth=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowChangeFillColor",{get:function(){return this._allowChangeFillColor},set:function(t){this._allowChangeFillColor!==t&&(this._allowChangeFillColor=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowChangeBorderColor",{get:function(){return this._allowChangeBorderColor},set:function(t){this._allowChangeBorderColor!==t&&(this._allowChangeBorderColor=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.allowChangeBorderColor=this.allowChangeBorderColor,e.allowChangeBorderWidth=this.allowChangeBorderWidth,e.allowChangeFillColor=this.allowChangeFillColor,e},t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeBorderWidth=this.allowChangeBorderWidth,t.allowChangeFillColor=this.allowChangeFillColor,t.allowChangeBorderColor=this.allowChangeBorderColor,t},t.prototype.equals=function(t){return this.allowChangeBorderColor===t.allowChangeBorderColor&&this.allowChangeFillColor===t.allowChangeFillColor&&this.allowChangeBorderWidth===t.allowChangeBorderWidth},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(408),i=n(437),o=n(415),a=n(434),s=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(){function t(t){this.propertyChanged=new r.a,null==t&&(t=!0),this.allowChangeText=t,this.allowChangeFont=t,this.allowChangeFontSize=t,this.allowChangeFontColor=t,this.allowChangeTextAlignment=t,this.allowChangeTextBIU=t,this.allowChangeShadow=t,this.allowChangeStroke=t,this.allowChangeLeading=t,this.allowTextFormatting=null,this.allowChangeStrokeColor=t}return t.prototype.clone=function(){var e=new t;return e.allowChangeFont=this.allowChangeFont,e.allowChangeFontColor=this.allowChangeFontColor,e.allowChangeFontSize=this.allowChangeFontSize,e.allowChangeShadow=this.allowChangeShadow,e.allowChangeStroke=this.allowChangeStroke,e.allowChangeText=this.allowChangeText,e.allowChangeTextAlignment=this.allowChangeTextAlignment,e.allowChangeTextBIU=this.allowChangeTextBIU,e.allowChangeLeading=this.allowChangeLeading,e.allowTextFormatting=this.allowTextFormatting,e.allowChangeStrokeColor=this.allowChangeStrokeColor,e},t.prototype.equals=function(t){return this.allowChangeFont===t.allowChangeFont&&this.allowChangeFontColor===t.allowChangeFontColor&&this.allowChangeFontSize===t.allowChangeFontSize&&this.allowChangeShadow===t.allowChangeShadow&&this.allowChangeStroke===t.allowChangeStroke&&this.allowChangeText===t.allowChangeText&&this.allowChangeTextAlignment===t.allowChangeTextAlignment&&this.allowChangeTextBIU===t.allowChangeTextBIU&&this.allowChangeLeading===t.allowChangeLeading&&this.allowTextFormatting===t.allowTextFormatting&&this.allowChangeStrokeColor===t.allowChangeStrokeColor},t.prototype.getSimplifiedObject=function(){var t={};return t.allowChangeText=this.allowChangeText,t.allowChangeFont=this.allowChangeFont,t.allowChangeFontSize=this.allowChangeFontSize,t.allowChangeFontColor=this.allowChangeFontColor,t.allowChangeTextAlignment=this.allowChangeTextAlignment,t.allowChangeTextBIU=this.allowChangeTextBIU,t.allowChangeShadow=this.allowChangeShadow,t.allowChangeStroke=this.allowChangeStroke,t.allowChangeLeading=this.allowChangeLeading,t.allowTextFormatting=this.allowTextFormatting,t.allowChangeStrokeColor=this.allowChangeStrokeColor,t},s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeText",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeFont",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeFontSize",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeFontColor",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeTextAlignment",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeTextBIU",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeShadow",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeStroke",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeStrokeColor",void 0),s([Object(a.a)(),l("design:type",Boolean)],t.prototype,"allowChangeLeading",void 0),s([Object(a.a)(),Object(o.a)({factory:new i.d(!0)}),l("design:type",Boolean)],t.prototype,"allowTextFormatting",void 0),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(435),o=n(406),a=n(409),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(n,r,i,a){var s=t.call(this,n,i,a)||this;return s._isVertical=!1,s.type=e.type,s._textRectangle=null!=r?r:new o.RectangleF,s}return s(e,t),Object.defineProperty(e.prototype,"textRectangle",{get:function(){return this._textRectangle},set:function(t){o.RectangleF.isEqual(this._textRectangle,t)||(this._textRectangle=t,this._propertyChanged.notify(this,"textRectangle"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._propertyChanged.notify(this,"isVertical"))},enumerable:!0,configurable:!0}),e.prototype._copy=function(n,r,i,o){t.prototype._copy.call(this,n,r,i,o),"AutoScaledTextItem"!=r.type&&"BoundedTextItem"!=r.type&&"PathBoundedTextItem"!=r.type&&"PlainTextItem"!=r.type||(r.isVertical=n.isVertical),r instanceof e&&(r.textRectangle=n.textRectangle)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(a.g)(this._isVertical,e._isVertical)&&Object(a.g)(this._textRectangle,e._textRectangle)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="AutoScaledTextItem",e}(i.a)},function(t,e,n){"use strict";var r=n(503);n.d(e,"c",(function(){return r.a})),n(425),n(491);var i=n(409);n.d(e,"a",(function(){return i.c})),n.d(e,"b",(function(){return i.h}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r,i=n(435),o=n(406),a=n(474),s=n(472),l=n(409),u=n(415),c=n(437),h=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},f=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},d=function(t){function e(n,r,i,l){var u=t.call(this,n,i,l)||this;return u._textRectangle=new o.RectangleF,u._verticalAlignment=s.h.Top,u._isVertical=!1,u._paragraphSettings=new a.a,u._wrappingPath=null,u._wrappingMargin=7,u._scheduledFitMode=null,u._shrinkMode=s.f.Size,u._overflowStrategy=s.e.Clip,u._originalVerticalScale=1,u._originalHorizontalScale=1,u._firstBaselineOffset=s.c.Ascent,u._firstBaselineMinOffset=0,u.type=e.type,null!=r&&(u.textRectangle=r,u.sourcePath=o.Path.rectangle(r.left,r.top,r.width,r.height)),u}return h(e,t),Object.defineProperty(e.prototype,"textRectangle",{get:function(){return this._textRectangle},set:function(t){o.RectangleF.isEqual(this._textRectangle,t)||(this._textRectangle=t,this._propertyChanged.notify(this,"textRectangle"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalAlignment",{get:function(){return this._verticalAlignment},set:function(t){this._verticalAlignment!==t&&(this._verticalAlignment=t,this._propertyChanged.notify(this,"verticalAlignment"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._propertyChanged.notify(this,"isVertical"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paragraphSettings",{get:function(){return this._paragraphSettings},set:function(t){this._paragraphSettings.equals(t)||(this._paragraphSettings=t,this._propertyChanged.notify(this,"paragraphSettings"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrappingPath",{get:function(){return this._wrappingPath},set:function(t){null==this._wrappingPath&&null==t||null!=this._wrappingPath&&this._wrappingPath.isEqual(t)||(this._wrappingPath=t,this._propertyChanged.notify(this,"wrappingPath"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrappingMargin",{get:function(){return this._wrappingMargin},set:function(t){this._wrappingMargin!==t&&(this._wrappingMargin=t,this._propertyChanged.notify(this,"wrappingMargin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scheduledFitMode",{get:function(){return this._scheduledFitMode},set:function(t){this._scheduledFitMode!==t&&(this._scheduledFitMode=t,null!=t&&this._propertyChanged.notify(this,"scheduledFitMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shrinkMode",{get:function(){return this._shrinkMode},set:function(t){this._shrinkMode!==t&&(this._shrinkMode=t,null!=t&&this._propertyChanged.notify(this,"shrinkMode"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overflowStrategy",{get:function(){return this._overflowStrategy},set:function(t){this._overflowStrategy!==t&&(this._overflowStrategy=t,null!=t&&this._propertyChanged.notify(this,"overflowStrategy"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalVerticalScale",{get:function(){return this._originalVerticalScale},set:function(t){this._originalVerticalScale!==t&&(this._originalVerticalScale=t,null!=t&&this._propertyChanged.notify(this,"originalVerticalScale"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalHorizontalScale",{get:function(){return this._originalHorizontalScale},set:function(t){this._originalHorizontalScale!==t&&(this._originalHorizontalScale=t,null!=t&&this._propertyChanged.notify(this,"originalHorizontalScale"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstBaselineOffset",{get:function(){return this._firstBaselineOffset},set:function(t){this._firstBaselineOffset!==t&&(this._firstBaselineOffset=t,null!=t&&this._propertyChanged.notify(this,"firstBaselineOffset"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstBaselineMinOffset",{get:function(){return this._firstBaselineMinOffset},set:function(t){Object(o.EqualsOfFloatNumbers)(this._firstBaselineMinOffset,t)||(this._firstBaselineMinOffset=t,null!=t&&this._propertyChanged.notify(this,"firstBaselineMinOffset"))},enumerable:!0,configurable:!0}),e.prototype._copy=function(n,r,i,o){t.prototype._copy.call(this,n,r,i,o),"AutoScaledTextItem"!=r.type&&"BoundedTextItem"!=r.type&&"PathBoundedTextItem"!=r.type&&"PlainTextItem"!=r.type||(r.isVertical=n.isVertical),"BoundedTextItem"!=r.type&&"PathBoundedTextItem"!=r.type||(r.paragraphSettings=n.paragraphSettings.clone(),r.wrappingPath=null!=n.wrappingPath?n.wrappingPath.clone():null,r.wrappingMargin=n.wrappingMargin,r.firstBaselineOffset=n.firstBaselineOffset,r.firstBaselineMinOffset=n.firstBaselineMinOffset),r instanceof e&&(r.textRectangle=n.textRectangle.clone(),r.verticalAlignment=n.verticalAlignment,r.scheduledFitMode=n.scheduledFitMode,r.shrinkMode=n.shrinkMode,r.overflowStrategy=n.overflowStrategy,r.originalVerticalScale=n.originalVerticalScale,r.originalHorizontalScale=n.originalHorizontalScale)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(l.g)(this._isVertical,e._isVertical)&&Object(l.g)(this._textRectangle,e._textRectangle)&&Object(l.g)(this._verticalAlignment,e._verticalAlignment)&&Object(l.g)(this._paragraphSettings,e._paragraphSettings)&&Object(l.g)(this._wrappingPath,e._wrappingPath)&&Object(l.g)(this._wrappingMargin,e._wrappingMargin)&&Object(l.g)(this._scheduledFitMode,e._scheduledFitMode)&&Object(l.g)(this._shrinkMode,e._shrinkMode)&&Object(l.g)(this._overflowStrategy,e._overflowStrategy)&&Object(l.g)(this._originalVerticalScale,e._originalVerticalScale)&&Object(l.g)(this._originalHorizontalScale,e._originalHorizontalScale)&&Object(l.g)(this.firstBaselineOffset,e.firstBaselineOffset)&&Object(l.g)(this.firstBaselineMinOffset,e.firstBaselineMinOffset)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="BoundedTextItem",p([Object(u.a)({enumObject:s.h}),f("design:type",Number),f("design:paramtypes",[Number])],e.prototype,"verticalAlignment",null),p([Object(u.a)({factory:new c.c(o.Path),displayName:"Wrapping path"}),f("design:type",o.Path),f("design:paramtypes",[o.Path])],e.prototype,"wrappingPath",null),p([Object(u.a)({enumObject:s.d}),f("design:type",Number),f("design:paramtypes",[Number])],e.prototype,"scheduledFitMode",null),p([Object(u.a)({enumObject:s.f}),f("design:type",Number),f("design:paramtypes",[Number])],e.prototype,"shrinkMode",null),p([Object(u.a)({enumObject:s.e}),f("design:type",Number),f("design:paramtypes",[Number])],e.prototype,"overflowStrategy",null),p([Object(u.a)({enumObject:s.c}),f("design:type",Number),f("design:paramtypes",[Number])],e.prototype,"firstBaselineOffset",null),e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return d})),n.d(e,"d",(function(){return i}));var r,i,o=n(504),a=n(411),s=n(462),l=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(){return u=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u.apply(this,arguments)},c=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},h=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t},p=function(t){function e(n,r){void 0===r&&(r=null);var i=t.call(this,n)||this;return i.type=e.type,i._colorGroups=[],i._onItemAdded=function(t){e._generateColorGroups([t.item]).forEach((function(t){var e;if(t.targets=t.targets.filter((function(t){return!i.colorGroups.some((function(e){return e.targets.some((function(e){var n=e.itemId,r=e.prop;return n===t.itemId&&r===t.prop}))}))})),!(t.targets.length<1)){var n=i.colorGroups.find((function(e){return e.color.equals(t.color)}));null!=n?(e=n.targets).push.apply(e,h(t.targets)):(null==i.themeBinding.clipartColors&&(i.themeBinding.clipartColors=new Array(i.colorGroups.length).fill(null)),i.colorGroups.push(t),i.themeBinding.clipartColors.push(null))}}))},i._onItemRemoved=function(t){var e=t.item.id;i.colorGroups.forEach((function(t){t.targets.some((function(t){return t.itemId===e}))&&(t.targets=t.targets.filter((function(t){return t.itemId!==e})))})),i.colorGroups.some((function(t){return 0===t.targets.length}))&&i.colorGroups.filter((function(t){return 0===t.targets.length})).map((function(t){return i.colorGroups.indexOf(t)})).forEach((function(t){i.colorGroups.splice(t,1),null!=i.themeBinding.clipartColors&&i.themeBinding.clipartColors.splice(t,1)}))},i._ignorePermissionsChange=!0,i.groupItemPermissions.allowSelectNestedItems=!1,i.groupItemPermissions.allowUngroup=!1,i._ignorePermissionsChange=!1,i.colorGroups=null!=r?r:e._generateColorGroups(i.items.toArray()),i.items.add_itemAdded(i._onItemAdded),i.items.add_itemRemoved(i._onItemRemoved),i}return l(e,t),e.prototype.getSimplifiedObject=function(e){return void 0===e&&(e=[]),t.prototype.getSimplifiedObject.call(this,e)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),null!=this.groupItemPermissions&&(this.groupItemPermissions.allowSelectNestedItemsContraint=!1,this.groupItemPermissions.allowUngroupContraint=!1)},Object.defineProperty(e.prototype,"colorGroups",{get:function(){return this._colorGroups},set:function(t){this._colorGroups=t},enumerable:!0,configurable:!0}),e.prototype.setColor=function(t,e){var n=this;if(!this.colorGroups.includes(t))throw Error("Unexpected colorgroup");var r=e instanceof a.Color?e:e.color;t.color.equals(r)||(e instanceof a.Color||(null==this.themeBinding.clipartColors&&(this.themeBinding.clipartColors=new Array(this.colorGroups.length).fill(null)),this.themeBinding.clipartColors[this.colorGroups.indexOf(t)]=e.title),t.targets.forEach((function(t){var e=t.prop,i=t.itemId,o=n.items.first((function(t){return t.id===i}));if(!(o instanceof s.a))throw new Error("Unexpected item in colorgroup");n._setShapeItemColor(e,o,r.clone())})),t.color=r.clone(),this._propertyChanged.notify(this,"colorGroups"))},e.prototype._copy=function(e,n,r,i){t.prototype._copy.call(this,e,n,r,i);var o=e.colorGroups.map((function(t){return t.clone()}));if(r){var a=n.items.toArray().map((function(t){return t.id})),s=e.items.toArray().map((function(t){return t.id})),l=o.reduce((function(t,e){return h(t,e.targets)}),[]);a.forEach((function(t,e){return l.filter((function(t){return t.itemId===s[e]})).forEach((function(e){return e.itemId=t}))}))}n.colorGroups=o},e._generateColorGroups=function(t){return t.filter((function(t){return t instanceof s.a})).reduce((function(t,e){var n=t.find((function(t){return t.color.equals(e.fillColor)}));if(null==n&&(n=new f(e.fillColor),t.push(n)),n.targets.push({itemId:e.id,prop:i.FillColor}),e.borderWidth>0){var r=t.find((function(t){return t.color.equals(e.borderColor)}));null==r&&(r=new f(e.borderColor),t.push(r)),r.targets.push({itemId:e.id,prop:i.BorderColor})}return t}),[])},e.prototype._setShapeItemColor=function(t,e,n){switch(t){case i.BorderColor:e.borderColor=n;break;case i.FillColor:e.fillColor=n}},e.type="ClipartItem",e}(o.a),f=function(){function t(t,e){void 0===e&&(e=[]),this.color=t,this.targets=e}return t.prototype.clone=function(){return new t(this.color.clone(),h(this.targets.map((function(t){return u({},t)}))))},t}(),d=function(){};!function(t){t[t.BorderColor=0]="BorderColor",t[t.FillColor=1]="FillColor"}(i||(i={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(408),i=n(505),o=n(502),a=n(407),s=n(409),l=function(){function t(){var t=this;this._onPermissionsChanged=function(){t.propertyChanged.notify()},this.propertyChanged=new r.a,this._imagePermissions=new i.a,this._barcodePermissions=new o.a,this._imagePermissions.propertyChanged.add(this._onPermissionsChanged),this._barcodePermissions.propertyChanged.add(this._onPermissionsChanged)}return Object.defineProperty(t.prototype,"barcodePermissions",{get:function(){return this._barcodePermissions},set:function(t){if(null==t)throw new a.a("barcodePermissions cannot be null");this._barcodePermissions.propertyChanged.remove(this._onPermissionsChanged),this._barcodePermissions=t,this._barcodePermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imagePermissions",{get:function(){return this._imagePermissions},set:function(t){if(null==t)throw new a.a("imagePermissions cannot be null");this._imagePermissions.propertyChanged.remove(this._onPermissionsChanged),this._imagePermissions=t,this._imagePermissions.propertyChanged.add(this._onPermissionsChanged),this._onPermissionsChanged()},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){return{imagePermissions:this.imagePermissions.getSimplifiedObject(),barcodePermissions:this.barcodePermissions.getSimplifiedObject()}},t.prototype.clone=function(){var e=new t;return e.barcodePermissions=this.barcodePermissions.clone(),e.imagePermissions=this.imagePermissions.clone(),e},t.prototype.equals=function(t){return Object(s.g)(this.barcodePermissions,t.barcodePermissions)&&Object(s.g)(this.imagePermissions,t.imagePermissions)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r,i=n(435),o=n(406),a=n(407),s=n(409),l=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(n,r,i,a){var s=t.call(this,n,i,a)||this;return s._textPath=new o.Path,s._fitToPath=!1,s._stretch=!1,s._originalFontSize=0,s._fitToPathStep=1,s._start=0,s.type=e.type,null!=r&&(s.textPath=r),s._ignorePermissionsChange=!0,s.manipulationPermissions.resizeGrips.setCornerArbitrary(!1),s.manipulationPermissions.resizeGrips.edge=!1,s._ignorePermissionsChange=!1,s}return l(e,t),Object.defineProperty(e.prototype,"textPath",{get:function(){return this._textPath},set:function(t){this.setTextPath(t)},enumerable:!0,configurable:!0}),e.prototype.setTextPath=function(t,e){void 0===e&&(e=!1),this._textPath.equals(t)||(this._textPath=t,e||this._propertyChanged.notify(this,"textPath"))},Object.defineProperty(e.prototype,"fitToPath",{get:function(){return this._fitToPath},set:function(t){this._fitToPath!==t&&(this._fitToPath=t,this._propertyChanged.notify(this,"fitToPath"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stretch",{get:function(){return this._stretch},set:function(t){this._stretch!==t&&(this._stretch=t,this._propertyChanged.notify(this,"stretch"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this._start},set:function(t){this._start!==t&&(this._start=t,this._propertyChanged.notify(this,"start"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},set:function(t){this._end!==t&&(this._end=t,this._propertyChanged.notify(this,"end"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalFontSize",{get:function(){return this._originalFontSize},set:function(t){Object(o.EqualsOfFloatNumbers)(this._originalFontSize,t)||(this._originalFontSize=t,this._propertyChanged.notify(this,"originalFontSize"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fitToPathStep",{get:function(){return this._fitToPathStep},set:function(t){Object(o.EqualsOfFloatNumbers)(this._fitToPathStep,t)||(this._fitToPathStep=t,this._propertyChanged.notify(this,"fitToPathStep"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLineCount",{get:function(){return 1},set:function(t){throw new a.d("Max Line Count of Curved Text can not be redefined!")},enumerable:!0,configurable:!0}),e.prototype.getSimplifiedObject=function(e){return t.prototype.getSimplifiedObject.call(this,["maxLineCount"].concat(e))},e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),null!=this.manipulationPermissions&&(this.manipulationPermissions.resizeGrips.setCornerArbitrary(!1),this.manipulationPermissions.resizeGrips.edge=!1)},e.prototype._copy=function(n,r,i,o){t.prototype._copy.call(this,n,r,i,o),r instanceof e&&(r.textPath=n.textPath.clone(),r.fitToPath=n.fitToPath,r.stretch=n.stretch,r.originalFontSize=n.originalFontSize,r.fitToPathStep=n.fitToPathStep,r.start=n.start,r.end=n.end)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(s.g)(this._textPath,e._textPath)&&Object(s.g)(this._fitToPath,e._fitToPath)&&Object(s.g)(this._stretch,e._stretch)&&Object(s.g)(this._originalFontSize,e._originalFontSize)&&Object(s.g)(this._fitToPathStep,e._fitToPathStep)&&Object(s.g)(this._start,e._start)&&Object(s.g)(this._end,e._end)&&Object(s.g)(this._textPath,e._textPath)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="CurvedTextItem",e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(434),o=n(497),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},l=function(t){function e(n){var r=t.call(this,n)||this;return r.type=e.type,null==n&&(n=!0),r._allowImageQuality=n,r}return a(e,t),e.prototype.clone=function(){var n=new e;return n.allowImageQuality=this.allowImageQuality,t.prototype.clone.call(this,n)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&this.allowImageQuality===e.allowImageQuality},e.type="ImageViolationSettings",function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(i.a)(),s("design:type",Boolean)],e.prototype,"allowImageQuality",void 0),e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r,i,o=n(563),a=n(610),s=function(){function t(){this[r]=null,this[i]=new a.a}return Object.defineProperty(t.prototype,"recolorEffect",{get:function(){return this[o.a.Recolor]},set:function(t){this[o.a.Recolor]=t},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return null!=this[o.a.None]&&(e[o.a.None]={}),null!=this[o.a.Recolor]&&(e.recolorEffect=this.recolorEffect.clone()),e},t.prototype.equals=function(t){return null!=t&&t.recolorEffect.equals(this.recolorEffect)},t.prototype.toJSON=function(){var t,e;return(t={})[o.a.None]={},t[o.a.Recolor]=null===(e=this.recolorEffect)||void 0===e?void 0:e.toJSON(),t},t}();r=o.a.None,i=o.a.Recolor},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.None="None",t.Recolor="Recolor"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){}},function(t,e,n){"use strict";n.d(e,"g",(function(){return w})),n.d(e,"h",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"f",(function(){return C})),n.d(e,"e",(function(){return P}));var r,i,o,a,s,l,u=n(504),c=n(408),h=n(406),p=n(410),f=n(415),d=n(409),g=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),m=function(){return m=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},m.apply(this,arguments)},y=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},v=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},b=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(v(arguments[e]));return t},w=function(t){function e(n,r){var i=t.call(this,n)||this;return i.type=e.type,i._onLayoutSettingsChanged=function(t){i._propertyChanged.notify(i,t)},i.layoutSettings=null!=r?r:new C,i}return g(e,t),e.prototype.getSimplifiedObject=function(e){var n,r;void 0===e&&(e=[]);var i=t.prototype.getSimplifiedObject.call(this,["layoutSettings"].concat(e));return i.layoutSettings=null===(n=this.layoutSettings)||void 0===n?void 0:n.getSimplifiedObject(),i.sourceRectangle=null===(r=this.sourceRectangle)||void 0===r?void 0:r.toJSON(),i},e.prototype._copy=function(e,n,r,i){var o;t.prototype._copy.call(this,e,n,r,i),r&&this._copyItemsOrder(e,n),n.layoutSettings=e.layoutSettings.clone(),n.sourceRectangle=null===(o=e.sourceRectangle)||void 0===o?void 0:o.clone()},e.prototype._copyItemsOrder=function(t,e){var n=t.getItemsOrder();if(n){var r=n.map((function(n){var r=t.items.indexOf((function(t){return t.id==n}));return e.items.get(r).id}));e.setItemsOrder(r)}},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},Object.defineProperty(e.prototype,"layoutSettings",{get:function(){return this._layoutSettings},set:function(t){if(null==t)throw new Error("LayoutSettings can't be null");null!=this._layoutSettings&&this._layoutSettings.propertyChanged.remove(this._onLayoutSettingsChanged),this._layoutSettings=t,this._layoutSettings.propertyChanged.add(this._onLayoutSettingsChanged),this._onLayoutSettingsChanged("layoutSettings")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sourceRectangle",{get:function(){return this._sourceRectangle},set:function(t){if(null!=this._sourceRectangle&&null==t)throw new Error("LayoutItem.sourceRectangle can't be null");null!=t&&t.equals(this._sourceRectangle)||(this._unsubscribeSourceRectangle(),this._sourceRectangle=t,this._subscribeSourceRectangle(),this._propertyChanged.notify(this,"sourceRectangle"))},enumerable:!0,configurable:!0}),e.prototype._subscribeSourceRectangle=function(){this._sourceRectangle},e.prototype._unsubscribeSourceRectangle=function(){this._sourceRectangle},e.prototype.addItems=function(n,r,i){var o=this.getItemsOrder();if(o){if(!Number.isInteger(i))throw new Error("orderIndex must not be null");o=e._insertToOrder(o,n.map((function(t){return t.id})),i),this.setItemsOrder(o)}t.prototype.addItems.call(this,n,r)},e.prototype.removeItems=function(e){var n=this.getItemsOrder();n&&(e.forEach((function(t){return n=n.filter((function(e){return e!==t.id}))})),this.setItemsOrder(n)),t.prototype.removeItems.call(this,e)},e.prototype.addItem=function(n,r,i){var o=this.getItemsOrder();null!=o&&(o=e._insertToOrder(o,[n.id],i),this.setItemsOrder(o)),t.prototype.addItem.call(this,n,r)},e._insertToOrder=function(t,e,n){var r=t.slice(0,n),i=t.slice(n);return r.concat(e,i)},e.prototype.setItemsOrder=function(t){this.tags[e._layoutItemsOrderTagKey]=t},e.prototype.getItemsOrder=function(){var t=this.tags[e._layoutItemsOrderTagKey];return null==t?null:t instanceof Array?t:null},e.prototype.getSortedItems=function(){var t=this.getItemsOrder(),e=this.items.toArray();return null!=t&&null!=e?t.map((function(t){return e.find((function(e){return e.id===t}))})):null},e.prototype.getItemOrderIndex=function(t){if(this.items.indexOf(t)<0)return-1;var e=this.getItemsOrder();return null==e?void 0:e.indexOf(t.id)},e.generateAutoLayoutSettings=function(t,e,n,r,i){var l=new P,u=t.map((function(t){return t.left})),c=t.map((function(t){return t.right})),p=t.map((function(t){return t.top})),f=t.map((function(t){return t.bottom})),d=t.map((function(t){return t.center.x})),g=t.map((function(t){return t.center.y}));if(null==n&&(n=Math.max.apply(Math,b(d))-Math.min.apply(Math,b(d))>Math.max.apply(Math,b(g))-Math.min.apply(Math,b(g))?a.horizontal:a.vertical),l.orientation=n,null==e)switch(l.orientation){case a.horizontal:e=Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,b(p)),Math.min.apply(Math,b(p)),5)?o.start:Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,b(g)),Math.min.apply(Math,b(g)),5)?o.center:Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,b(f)),Math.min.apply(Math,b(f)),5)?o.end:o.none;break;case a.vertical:e=Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,b(u)),Math.min.apply(Math,b(u)),5)?o.start:Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,b(d)),Math.min.apply(Math,b(d)),5)?o.center:Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,b(c)),Math.min.apply(Math,b(c)),5)?o.end:o.none}l.alignItems=e;for(var m=l.orientation===a.horizontal?t.sort((function(t,e){return t.left-e.left})):t.sort((function(t,e){return t.top-e.top})),y=[],_=1;_<m.length;_++){var v=m[_-1],w=m[_];y.push(l.orientation===a.horizontal?w.left-v.right:w.top-v.bottom)}return null==r&&(r=y.length>0?Math.max(0,Math.min.apply(Math,b(y.map(Math.round)))):0),l.margin=r,null==i&&(i=Object(h.EqualsOfFloatNumbers)(Math.max.apply(Math,b(y)),Math.min.apply(Math,b(y)),2)?s.stretch:s.spaceBetween),l.justifyContent=i,l},e.prototype.isChildVisible=function(t){return!(t instanceof p.o&&t.isEmpty())},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(d.g)(this.sourceRectangle,e.sourceRectangle),i=Object(d.g)(this.layoutSettings,e.layoutSettings);return n&&r&&i},e._layoutItemsOrderTagKey="$layoutItemsOrder",e.type="LayoutItem",e}(u.a);!function(t){t[t.default=0]="default",t[t.auto=1]="auto"}(i||(i={})),function(t){t[t.none=0]="none",t[t.center=1]="center",t[t.start=2]="start",t[t.end=3]="end"}(o||(o={})),function(t){t[t.vertical=0]="vertical",t[t.horizontal=1]="horizontal"}(a||(a={})),function(t){t[t.stretch=0]="stretch",t[t.spaceBetween=1]="spaceBetween"}(s||(s={})),function(t){t[t.start=0]="start",t[t.center=1]="center",t[t.end=2]="end"}(l||(l={}));var C=function(){function t(){this.type=t.type,this.propertyChanged=new c.a}return t.prototype.clone=function(){return new t},t.prototype.getSimplifiedObject=function(){var e={};return e.type=t.type,e},t.prototype.equals=function(t){return Object(d.g)(this.type,t.type)},t.type="DefaultLayoutSettings",t}(),P=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._margin=0,n._orientation=a.vertical,n._alignItems=o.none,n._anchorPoint=l.start,n._justifyContent=s.stretch,n}return g(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this._margin},set:function(t){if(null==t)throw new Error("Margin can't be null");t!==this.margin&&(this._margin=t,this.propertyChanged.notify("margin"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(t){if(null==t)throw Error("Orientation can't be null");t!==this.orientation&&(this._orientation=t,this.propertyChanged.notify("orientation"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alignItems",{get:function(){return this._alignItems},set:function(t){if(null==t)throw new Error("alignItems can't be null");t!==this.alignItems&&(this._alignItems=t,this.propertyChanged.notify("alignItems"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"justifyContent",{get:function(){return this._justifyContent},set:function(t){if(null==t)throw new Error("JustifyContent can't be null");t!==this.justifyContent&&(this._justifyContent=t,this.propertyChanged.notify("justifyContent"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"anchorPoint",{get:function(){return this._anchorPoint},set:function(t){if(null==t)throw new Error("anchorPoint can't be null");t!==this._anchorPoint&&(this._anchorPoint=t,this.propertyChanged.notify("anchorPoint"))},enumerable:!0,configurable:!0}),e.prototype.clone=function(){var t=new e;return t.orientation=this.orientation,t.alignItems=this.alignItems,t.justifyContent=this.justifyContent,t.margin=this.margin,t.anchorPoint=this.anchorPoint,t},e.prototype.getSimplifiedObject=function(){var n=t.prototype.getSimplifiedObject.call(this);return n.type=e.type,n.orientation=this.orientation,n.alignItems=this.alignItems,n.justifyContent=this.justifyContent,n.margin=this.margin,n.anchorPoint=this.anchorPoint,n},e.prototype.equals=function(e){var n=t.prototype.equals.call(this,e),r=Object(d.g)(this.orientation,e.orientation),i=Object(d.g)(this.alignItems,e.alignItems),o=Object(d.g)(this.margin,e.margin),a=Object(d.g)(this.anchorPoint,e.anchorPoint);return n&&r&&i&&o&&a},e.type="AutoLayoutSettings",y([Object(f.a)({ignore:!0}),_("design:type",Object)],e.prototype,"type",void 0),y([Object(f.a)({enumObject:m({},a)}),_("design:type",Object),_("design:paramtypes",[Object])],e.prototype,"orientation",null),y([Object(f.a)({enumObject:o}),_("design:type",Object),_("design:paramtypes",[Object])],e.prototype,"alignItems",null),y([Object(f.a)({enumObject:s}),_("design:type",Object),_("design:paramtypes",[Object])],e.prototype,"justifyContent",null),y([Object(f.a)({enumObject:l}),_("design:type",Number),_("design:paramtypes",[Number])],e.prototype,"anchorPoint",null),e}(C)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(408),i=n(437),o=n(415),a=n(434),s=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(){function t(){this._allowEditContent=!0,this.showSelectButtonConstraint=null,this._showSelectButton=!0,this.propertyChanged=new r.a}return Object.defineProperty(t.prototype,"allowEditContent",{get:function(){return this._allowEditContent},set:function(t){this._allowEditContent!==t&&(this._allowEditContent=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showSelectButton",{get:function(){return null!=this.showSelectButtonConstraint?this.showSelectButtonConstraint:this._showSelectButton},set:function(t){this._showSelectButton!==t&&(this._showSelectButton=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t={};return t.allowEditContent=this.allowEditContent,t.showSelectButton=this.showSelectButton,t.showHandleButton=this.showHandleButton,t.showSelectButtonConstraint=this.showSelectButtonConstraint,t},t.prototype.clone=function(){var e=new t;return e.allowEditContent=this._allowEditContent,e.showSelectButton=this._showSelectButton,e.showSelectButtonConstraint=this.showSelectButtonConstraint,e.showHandleButton=this.showHandleButton,e},t.prototype.equals=function(t){return this.allowEditContent===t.allowEditContent&&this.showSelectButton===t.showSelectButton&&this.showSelectButtonConstraint===t.showSelectButtonConstraint&&this.showHandleButton===t.showHandleButton},s([Object(o.a)({ignore:!0,type:"boolean"}),l("design:type",Boolean)],t.prototype,"showSelectButtonConstraint",void 0),s([Object(a.a)(),Object(o.a)({factory:new i.d(!0)}),l("design:type",Boolean)],t.prototype,"showHandleButton",void 0),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r,i=n(435),o=n(431),a=n(409),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(n,r,i,a){var s=t.call(this,n,i,a)||this;return s._baselineLocation=new o.a,s._isVertical=!1,s.type=e.type,null!=r&&(s.baselineLocation=r),s._ignorePermissionsChange=!0,s.manipulationPermissions.resizeGrips.setCornerArbitrary(!1),s.manipulationPermissions.resizeGrips.edge=!1,s._ignorePermissionsChange=!1,s}return s(e,t),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this._isVertical},set:function(t){this._isVertical!==t&&(this._isVertical=t,this._propertyChanged.notify(this,"isVertical"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"baselineLocation",{get:function(){return this._baselineLocation},set:function(t){this.setBaselineLocation(t)},enumerable:!0,configurable:!0}),e.prototype.setBaselineLocation=function(t,e){void 0===e&&(e=!1),o.a.isEqual(this._baselineLocation,t)||(this._baselineLocation=t,e||this._propertyChanged.notify(this,"baselineLocation"))},e.prototype.applyPermissionsConstrain=function(){t.prototype.applyPermissionsConstrain.call(this),null!=this.manipulationPermissions&&null!=this.manipulationPermissions.resizeGrips&&(this.manipulationPermissions.resizeGrips.setCornerArbitrary(!1),this.manipulationPermissions.resizeGrips.edgeConstraint=!1)},e.prototype.getSimplifiedObject=function(e){void 0===e&&(e=[]);var n=t.prototype.getSimplifiedObject.call(this,["_placeholders","currentTextImage","sourcePath","sourceRectangle"].concat(e));return n.placeholders=this.placeholders.toArray(),n},e.prototype._copy=function(n,r,i,o){return t.prototype._copy.call(this,n,r,i,o),"AutoScaledTextItem"!=r.type&&"BoundedTextItem"!=r.type&&"PathBoundedTextItem"!=r.type&&"PlainTextItem"!=r.type||(r.isVertical=n.isVertical),r instanceof e&&(r.baselineLocation=n.baselineLocation),r},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&Object(a.g)(this._isVertical,e._isVertical)&&Object(a.g)(this._baselineLocation,e._baselineLocation)},e.prototype.clone=function(t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=new e;return this._copy(this,r,t,n),r},e.type="PlainTextItem",e}(i.a)},function(t,e,n){"use strict";var r=n(546);n.d(e,"a",(function(){return r.a})),n.d(e,"e",(function(){return r.b}));var i=n(415);n.d(e,"b",(function(){return i.a})),n.d(e,"d",(function(){return i.b}));var o=n(434);n.d(e,"c",(function(){return o.a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return P}));var r,i=n(570),o=n(408),a=n(746),s=n(406),l=n(513),u=n(410),c=n(514),h=n(407),p=n(457),f=n(417),d=n(577),g=n(578),m=n(425),y=n(456),_=n(436),v=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},b=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},w=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},C=((r={})[u.p.Normal]="normal",r[u.p.Multiply]="multiply",r[u.p.Screen]="screen",r[u.p.Overlay]="overlay",r[u.p.Darken]="darken",r[u.p.Lighten]="lighten",r[u.p.ColorDodge]="color-dodge",r[u.p.ColorBurn]="color-burn",r[u.p.HardLight]="hard-light",r[u.p.SoftLight]="soft-light",r[u.p.Difference]="difference",r[u.p.Exclusion]="exclusion",r[u.p.None]="none",r),P=function(){function t(t){var e=this;this._afterUpdateCallbacks=[],this._modelItem=null,this._skipPropertyChanged=!1,this._skippedPropertyName=null,this._visible=!0,this._locked=!1,this._updating=!1,this._isCurrentWebServiceCallForAll=null,this._changeItemOnUpdate=!0,this._readyEvent=new o.c,this._changedEvent=new o.a,this._changingEvent=new o.a,this._itemPropertyChangedEvent=new o.c,this._isDisposed=!1,this._tag=null,this._transformOperation=null,this._baseOnItemPropertyChanged=function(t,n){e._skipPropertyChanged?e._skippedPropertyName=n:e._onItemPropertyChanged(t,n)},this._setItem(t),this._controlPoints=[],this._layer=null,this._tag=null,this._uniqueId=this._createUniqueID(),this._callbacks=[],this._renderState=d.a.Hidden,this._throttleSizeChanging=y.throttle((function(){this.raiseChanging()}),100)}return Object.defineProperty(t.prototype,"item",{get:function(){return this._modelItem},set:function(t){this._setItem(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){return this._isReady()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLoadingImage",{get:function(){return this._isLoadingImage()},set:function(t){this.isLoadingImage!==t&&this._setIsLoadingImage(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"uniqueId",{get:function(){return this._uniqueId},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderState",{get:function(){return this._renderState},set:function(t){this._renderState=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentGroupItemHandler",{get:function(){return null!=this.item.parentGroupItem&&null!=this.canvas?this.canvas.getItemHandler(this.item.parentGroupItem):null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.item.blendMode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controlPoints",{get:function(){return this._controlPoints},set:function(t){this._controlPoints=t,this.raiseChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tag",{get:function(){return this._tag},set:function(t){this._tag=t,this.raiseChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this._canvas},set:function(t){if(t!==this._canvas){var e=this._canvas;this._canvas=t,null!=this._canvas?this._onAddedOnCanvas(t):this._onRemovedFromCanvas(e)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layer",{get:function(){return this._getLayer()},set:function(t){this._layer=t,this.quickUpdate()},enumerable:!0,configurable:!0}),t.prototype._getLayer=function(){return this._layer},Object.defineProperty(t.prototype,"index",{get:function(){return null!=this._layer?this._layer.flatItemHandlers.indexOf(this):-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return new s.RectangleF(0,0,0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.item.name},set:function(t){this.item.name=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this._isIgnorePermissionsMode()?this._visible:this.item.visible},set:function(t){this._visible!==t&&(this._visible=t,this._refreshState(),t&&this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locked",{get:function(){return this._isIgnorePermissionsMode()?this._locked:this.item.locked},set:function(t){this._locked!==t&&(this._locked=t,this._refreshState())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isNormalRenderingType",{get:function(){return null==this.layer||this.layer.renderingType===p.RenderingType.Normal},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isUpdating",{get:function(){return this._updating},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"changeItemOnUpdate",{get:function(){return this._changeItemOnUpdate},set:function(t){this._changeItemOnUpdate=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_colorSettings",{get:function(){var t,e,n,r,i,o,a,s;return{rgbColorProfileName:null!==(e=null===(t=this.canvas)||void 0===t?void 0:t.renderingConfigProvider.getRgbColorProfileName())&&void 0!==e?e:"",cmykColorProfileName:null!==(r=null===(n=this.canvas)||void 0===n?void 0:n.renderingConfigProvider.getCmykColorProfileName())&&void 0!==r?r:"",grayscaleColorProfileName:null!==(o=null===(i=this.canvas)||void 0===i?void 0:i.renderingConfigProvider.getGrayscaleColorProfileName())&&void 0!==o?o:"",hiResDestinationColorProfileName:null!==(s=null===(a=this.canvas)||void 0===a?void 0:a.renderingConfigProvider.getHiResDestinationColorProfileName())&&void 0!==s?s:""}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasLayoutAncestor",{get:function(){for(var t=this;t&&t.parentGroupItemHandler;){if("LayoutItemHandler"===t.parentGroupItemHandler.getTypeName())return!0;t=t.parentGroupItemHandler}return!1},enumerable:!0,configurable:!0}),t.isGroupHandler=function(t){return t._isGroupHandler()},t.prototype.isHighlightNeeded=function(){return!1},t.prototype.hasBlendMode=function(){return null!=this.item.blendMode&&this.item.blendMode!=u.p.None&&this.item.blendMode!=u.p.Normal},t.prototype.getPermissions=function(){return null==this._permissions&&(this._permissions=this._createItemHandlerPermissions()),this._permissions},t.prototype.resetPermissions=function(){this._permissions=null},t.prototype.getTypeName=function(){return this.constructor.typeName},t.prototype.getData=function(t){var e=this._createDataInstance(this);return"asObject"===t?e:JSON.stringify(e)},t.prototype.updateItem=function(t){this._skippedPropertyName=null,this._modifyItem((function(e){e.update(t)})),null!=this._skippedPropertyName&&(this._onItemPropertyChanged(this.item,this._skippedPropertyName),null!=this.canvas&&this.canvas.updateSelection())},t.prototype.setData=function(t){var e;t&&""!==t&&(e="string"==typeof t?JSON.parse(t):t,this._createDataInstance().applyState(e,this))},t.prototype.isVisible=function(){var e=this,n=function(r){var i,o=r.parentGroupItem;if(null==o)return!1;if(!o.visible||o.visualizationPermissions.noShow)return!0;var a=null===(i=e.canvas)||void 0===i?void 0:i.getItemHandler(o);return!(!a||a.isVisible())||!(!a||!t.isGroupHandler(a)||a.isChildVisible(e))||n(o)};return this.visible&&!this.getPermissions().noShow&&(null==this.layer||this.layer.visible)&&!n(this.item)},t.prototype.isEmpty=function(){return!1},t.prototype.isLocked=function(){return this.locked||null!=this.layer&&this.layer.locked},t.prototype.processEvent=function(t){},t.prototype.hitTest=function(t){throw new Error("Not implemented")},t.prototype.draw=function(t,e,n,r,i,o,a,s){if(null!=t&&null!=this.canvas&&null!=this.layer){var l=t.globalCompositeOperation,u=this.hasBlendMode()?this._convertBlendModeToGlobalOperation(this.blendMode):l;t.globalAlpha=s?.2:1,this.isNormalRenderingType?(null!=e&&(t.save(),f.a.clipPath(t,e)),this.hasBlendMode()&&(t.globalCompositeOperation=u),this.drawItemHandler(t),this.hasBlendMode()&&(t.globalCompositeOperation=l)):this._drawTexture(t,n,r,i,o,a,s,e),null!=e&&t.restore()}},t.prototype._drawTexture=function(e,n,r,i,o,a,l,u){var c,h,p,d,g,y,v=m.a.screenDpi*this.canvas.zoom/72,b=m.a.screenDpi*this.canvas.zoom/72,w=e.canvas.width,C=e.canvas.height,P=this.layer.textureImage;if(null!=P){var S=new s.RotatedRectangleF(this.canvas.workspaceWidth/2,this.canvas.workspaceHeight/2,this.canvas.workspaceWidth,this.canvas.workspaceHeight);f.a.drawImage(r,P,S,v,b,this.canvas.disableSmoothing),null!=u&&(o.save(),f.a.clipPath(o,u)),this.drawItemHandler(o,e),r.restore(),r.globalCompositeOperation="destination-in",r.drawImage(i,0,0,w,C);var x=1,I=null!==(p=null===(h=null===(c=this._canvas)||void 0===c?void 0:c.viewerConfiguration)||void 0===h?void 0:h.inactiveContainerTransparencyEnabled)&&void 0!==p?p:t.DEFAULT_CONTAINER_TRANSPARENCY_ENABLED,O=null!==(y=null===(g=null===(d=this._canvas)||void 0===d?void 0:d.viewerConfiguration)||void 0===g?void 0:g.inactiveContainerTransparencyLevel)&&void 0!==y?y:t.DEFAULT_CONTAINER_TRANSPARENCY_LEVEL;I&&"number"==typeof O&&(x=1-Object(_.c)(O,0,1)),e.restore(),e.globalAlpha=l&&I?x:1,e.drawImage(n,0,0,w,C),a.applyContextScale(e,this._canvas.workspace,this._canvas.offset)}else this.canvas.drawWaitClock(e,this.bounds.center)},t.prototype.drawItemHandler=function(t,e){},t.prototype.quickUpdate=function(){},t.prototype.update=function(t,e){this._updateImpl(t,e)},t.prototype.updateAsync=function(t,e){return v(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return[4,this._updateImpl(t,e)];case 1:return n.sent(),[2]}}))}))},t.prototype.updateForExternalCanvas=function(t){this._serverSideUpdate(null,null,null,t)},t.prototype.updateActiveColorWebServiceCall=function(t,e){return v(this,void 0,void 0,(function(){return b(this,(function(n){switch(n.label){case 0:return null==this._activeWebServiceCall?[3,2]:[4,this._activeWebServiceCall];case 1:n.sent(),n.label=2;case 2:return null!=this._activeColorWebServiceCall&&(this._activeColorWebServiceCall.cancel(),this._isCurrentWebServiceCallForAll&&!e)?(t.cancel(),this._isCurrentWebServiceCallForAll=e,this._activeColorWebServiceCall=null,[2]):(null==this._handlerUpdated&&(this._handlerUpdated=new g.a),this._activeColorWebServiceCall=t,this._isCurrentWebServiceCallForAll=e,[2])}}))}))},t.prototype.startTransform=function(t){this._transformOperation=t,this._cancelWebServiceCall()},t.prototype.endTransform=function(t,e,n){void 0===n&&(n=!1),this._transformOperation=null},t.prototype.waitUpdate=function(){return v(this,void 0,void 0,(function(){return b(this,(function(t){switch(t.label){case 0:return null==this._handlerUpdated?[3,2]:[4,this._handlerUpdated.promise];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.beginUpdate=function(){this._updating=!0},t.prototype.endUpdate=function(){this._updating=!1,this.updated();for(var t=!1;this._callbacks.length>0;){var e=this._callbacks.shift();"function"==typeof e&&(e(),t=!0)}t&&this.update()},t.prototype.updated=function(){this.raiseChanged()},t.prototype.addReady=function(t){this._readyEvent.add(t)},t.prototype.removeReady=function(t){this._readyEvent.remove(t)},t.prototype.addChanging=function(t){this._changingEvent.add(t)},t.prototype.removeChanging=function(t){this._changingEvent.remove(t)},t.prototype.raiseChanging=function(t){var e;t=null!=t?t:this.item,this._changingEvent.notify(t),this.item.getItemChangingEvent().notify(this.item),null===(e=this._canvas)||void 0===e||e.redraw()},t.prototype.getChangingEvent=function(){return this._changingEvent},t.prototype.addChanged=function(t){this._changedEvent.add(t)},t.prototype.removeChanged=function(t){this._changedEvent.remove(t)},t.prototype.raiseChanged=function(){this.isUpdating||this._changedEvent.notify(this)},t.prototype.getChangedEvent=function(){return this._changedEvent},t.prototype.addItemPropertyChanged=function(t){this._itemPropertyChangedEvent.add(t)},t.prototype.removeItemPropertyChanged=function(t){this._itemPropertyChangedEvent.remove(t)},t.prototype.initialize=function(){},t.prototype.onSuccessResponse=function(t){void 0===t&&(t=i.b.Item),t==i.b.Item?this._activeWebServiceCall=null:t==i.b.Color&&(this._activeColorWebServiceCall=null),null==this._activeWebServiceCall&&null==this._activeColorWebServiceCall&&null!=this._handlerUpdated&&(this._handlerUpdated.resolve(),this._handlerUpdated=null)},t.prototype.onErrorResponse=function(t,e){void 0===e&&(e=i.b.Item),e==i.b.Item?this._activeWebServiceCall=null:e==i.b.Color&&(this._activeColorWebServiceCall=null),this._afterUpdateCallbacks=[],null==this._activeWebServiceCall&&null==this._activeColorWebServiceCall&&null!=this._handlerUpdated&&(this._handlerUpdated.reject(t),this._handlerUpdated=null)},t.prototype.validateActiveColorWebServiceCall=function(){null!=this._activeColorWebServiceCall?(this._activeColorWebServiceCall=null,null==this._activeWebServiceCall&&(this._handlerUpdated=null)):null==this._activeWebServiceCall&&(this._handlerUpdated=null)},t.prototype.getColors=function(){return this._getColors().filter((function(t){return null!==t}))},t.prototype.dispose=function(){var t;this._unsubscribeItemEvents(),this._cancelWebServiceCall(),null===(t=this._activeColorWebServiceCall)||void 0===t||t.cancel(),this._activeColorWebServiceCall=null,this._isDisposed=!0},t.prototype._isReady=function(){return!0},t.prototype._getColors=function(){return[]},t.prototype._updateImpl=function(t,e){return v(this,void 0,void 0,(function(){return b(this,(function(t){return[2]}))}))},t.prototype.transformChanged=function(){this.raiseChanged()},t.prototype._createDataInstance=function(t){return new l.a(t)},t.prototype._getDataItem=function(){return(new c.a).serializeModelComponent(this.item)},t.prototype._applyDataItem=function(t,e){var n=this,r=(new c.a).productParser.parseItem(t);this._modifyItem((function(){n._setDataItem(r,e)}))},t.prototype._setDataItem=function(t,e){this.item.transform=t.transform.clone(),this.setData(e)},t.prototype._modifyItem=function(t){if("function"==typeof t){this._skipPropertyChanged=!0;try{t(this.item)}finally{this._skipPropertyChanged=!1}}},t.prototype._refreshState=function(){},t.prototype._onAddedOnCanvas=function(t,e){null!=t&&(t.updateTexts(),e||this.update())},t.prototype._onRemovedFromCanvas=function(t){this._canvas=null},t.prototype._validateBeforeCallService=function(){return!0},t.prototype._update=function(t,e,n){this._serverSideUpdate(t,e,n,null)},t.prototype._callService=function(t,e,n,r,i){var o=null!=i?i:this.canvas;if(null!=o&&o.isInitialized&&!o.initialization){var a=this.isNormalRenderingType||null==this.layer?null:this.layer.uniqueId,s=this._getCallService(t,e,n,r,a,o);this._updateActiveWebServiceCall(s)}else this._handlerUpdated=null},t.prototype._updateActiveWebServiceCall=function(t){return v(this,void 0,void 0,(function(){return b(this,(function(e){switch(e.label){case 0:return this._cancelWebServiceCall(),this._activeWebServiceCall=t,null==this._activeColorWebServiceCall?[2]:(this._activeColorWebServiceCall.cancel(),this._activeColorWebServiceCall=null,[4,this._handlerUpdated.promise]);case 1:return e.sent(),[2]}}))}))},t.prototype._getDefaultPermissions=function(){return{manipulation:new u.W,visualization:new u.wb,item:new u.P,placeholder:new u.db}},t.prototype._getItemPermissions=function(){return{manipulation:this.item.manipulationPermissions,visualization:this.item.visualizationPermissions,item:this.item.itemPermissions,placeholder:new u.db}},t.prototype._isIgnorePermissionsMode=function(){var t,e;return null!==(e=null===(t=this.canvas)||void 0===t?void 0:t.ignorePermissionsMode)&&void 0!==e&&e},t.prototype._isLoadingImage=function(){return!1},t.prototype._setIsLoadingImage=function(t){throw new h.e},t.prototype._dispatchReadyEvent=function(){this.ready&&this._readyEvent.notify(this)},t.prototype._updateVisibility=function(){},t.prototype._subscribeItemEvents=function(){null!=this._modelItem&&this._modelItem.addPropertyChanged(this._baseOnItemPropertyChanged)},t.prototype._unsubscribeItemEvents=function(){null!=this._modelItem&&this._modelItem.removePropertyChanged(this._baseOnItemPropertyChanged)},t.prototype._onItemPropertyChanged=function(t,e){switch(e){case"locked":case"opacity":case"blendMode":null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.redraw()),this.raiseChanged();break;case"transform":null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.redraw()),this.transformChanged();break;case"visible":this._onItemVisibilityChanged();break;case"manipulationPermissions":case"visualizationPermissions":case"itemPermissions":case"permissions":this._permissions=null,this.quickUpdate(),this.canvas&&this.canvas.redraw(),this.raiseChanged(),this._updateVisibility()}this._itemPropertyChangedEvent.notify(this,e)},t.prototype._onItemVisibilityChanged=function(){this.quickUpdate(),null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.redraw()),this.raiseChanged()},t.prototype._getItem=function(){return this._modelItem},t.prototype._setItem=function(t){this._unsubscribeItemEvents(),this._modelItem=t,this._subscribeItemEvents()},t.prototype._onValidateBeforeCallServiceFailed=function(){this._handlerUpdated.resolve(),this._handlerUpdated=null},t.prototype._isGroupHandler=function(){return!0},t.prototype._serverSideUpdate=function(t,e,n,r){var i=this;if(this.isUpdating)this._callbacks.push(e);else{"function"==typeof e&&e(),null!=n&&this._afterUpdateCallbacks.push(n);var o=this._createDataInstance(this),a=[JSON.stringify(o),JSON.parse(this._getDataItem()),this._colorSettings];null!=t&&(a=a.concat(t)),null==this._handlerUpdated&&(this._handlerUpdated=new g.a),this._validateBeforeCallService()?this._callService("Update"+this.getTypeName(),a,(function(t){if(null!=i.item){var e=null;"object"==typeof t&&(e=t.item,t=t.itemHandlerData),null!=e&&i.changeItemOnUpdate&&i._applyDataItem(e,t),i.setData(t),0===i._afterUpdateCallbacks.length?i.quickUpdate():(i._afterUpdateCallbacks.forEach((function(t){return t.apply(i)})),i._afterUpdateCallbacks=[],i.quickUpdate(),i.raiseChanged()),i.onSuccessResponse(),i.item.getItemChangedEvent().notify()}}),(function(t){i.onErrorResponse(t)}),r):this._onValidateBeforeCallServiceFailed()}},t.prototype._convertBlendModeToGlobalOperation=function(t){var e=C[t];return null!=e?e:"none"},t.prototype._cancelWebServiceCall=function(){null!=this._activeWebServiceCall&&(this._activeWebServiceCall.cancel(),this._activeWebServiceCall=null)},t.prototype._createItemHandlerPermissions=function(){var t=this._isIgnorePermissionsMode()?this._getDefaultPermissions():this._getItemPermissions(),e={AllowDelete:t.manipulation.allowDelete,AllowMoveHorizontal:t.manipulation.allowMoveHorizontal,AllowMoveVertical:t.manipulation.allowMoveVertical,AllowRotate:t.manipulation.allowRotate,ResizeGrips:null!=t.manipulation.resizeGrips?{Edge:t.manipulation.resizeGrips.edge,Corner:t.manipulation.resizeGrips.corner}:null,AllowDragAndDrop:t.manipulation.allowDragAndDrop,NoPrint:t.visualization.noPrint,NoShow:t.visualization.noShow,ShowDeleteToolbarButton:t.item.itemToolbarPermissions.showDeleteButton,ShowEditToolbarButton:t.item.itemToolbarPermissions.showEditButton,ShowHandleToolbarButton:t.item.itemToolbarPermissions.showHandleButton,ShowSelectToolbarButton:t.item.itemToolbarPermissions.showSelectButton,AllowEditContent:t.placeholder.allowEditContent,ShowSelectButton:t.placeholder.showSelectButton,ShowHandleButton:t.placeholder.showHandleButton};return new a.a(e,!0)},t.prototype._createUniqueID=function(){return"vo"+(new Date).getTime()+Math.round(1e3*Math.random())},t.prototype._getCallService=function(t,e,n,r,o,a){void 0===o&&(o=null);var s=i.a.makeCancelable(new Promise((function(n,r){var i,s=[JSON.stringify(a.getData(!0,o))];null!=e&&(s=s.concat(e)),s=s.concat(n,(function(t,e,n){r({error:t,userContext:e,methodName:n})})),(i=a.service)[t].apply(i,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(w(arguments[e]));return t}(s))})));return s.promise.then((function(t){"function"==typeof n&&n(t)})).catch((function(t){if(t instanceof h.c)console.error("Exception of type "+t.name+": "+t.message);else if(!t.isCanceled){var e=t.error;"function"==typeof r&&r(e)}})),s},t.DEFAULT_CONTAINER_TRANSPARENCY_ENABLED=!0,t.DEFAULT_CONTAINER_TRANSPARENCY_LEVEL=.8,t.typeName="ItemHandler",t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return a}));var r,i,o,a,s=n(457),l=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};!function(t){var e;t.round3=function(t){return Math.round(1e3*t)/1e3},t.createBoundedWrapper=function(t,e,n){return null==n?e.bind(t):Function.prototype.bind.apply(e,[t].concat(n))},t.cursorToCss=function(t){var n=e;return null==n&&(e=n=["default","nw-resize","ne-resize","sw-resize","se-resize","n-resize","s-resize","w-resize","e-resize","move","crosshair","pointer","ew-resize","ns-resize","nesw-resize","nwse-resize","text","grab","grabbing"]),n[t]},t.makeSingle=function(t){var e;return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))}(this,void 0,void 0,(function(){var r,i,o,a;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(s){switch(s.label){case 0:r=e=new Object,i=t.apply(void 0,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}(n)),s.label=1;case 1:return(a=i.next(o)).done?[2,a.value]:[4,a.value];case 2:if(o=s.sent(),r!==e)return[2];s.label=3;case 3:return[3,1];case 4:return[2]}}))}))}},t.makeCancelable=function(t){var e=!1;return{promise:new Promise((function(n,r){t.then((function(t){return e?r({isCanceled:!0}):n(t)})),t.catch((function(t){return r(e?{isCanceled:!0}:t)}))})),id:(new s.Uuid).toString(),cancel:function(){e=!0}}},t.getEventPath=function(t){if(null==t.view||!(t instanceof t.view.UIEvent))throw new Error("Unexpected event type");if(null!=t.path)return(Array.isArray(t.path)?t.path:Array.prototype.slice.call(t.path)).filter((function(t){return t instanceof Element}));var e=[],n=t.target;n instanceof t.view.Element||null==console||console.log("unexpected event target",n);do{e.push(n),n=n.parentElement}while(null!=n&&n!==t.currentTarget);return e},t.isEventPathContainsClass=function(e,n){var r;if(e instanceof UIEvent)r=e;else{if(!(e.originalEvent instanceof UIEvent))throw new Error("Unexpected event type");r=e.originalEvent}return!!t.getEventPath(r).some((function(t){return t.classList.contains(n)}))},t.getListSettingFromConfig=function(t){return t?{maxNestingListLevel:t.maxLevel,defOrderedListLevelGap:t.levelIndent,defUnorderedListLevelGap:t.levelIndent,defOrderedListStyle:{firstLineIndent:t.firstLineIndent,leftIndent:t.listIndent,tabOffset:t.tabOffset,numberingFormat:t.numberingFormat},defUnorderedListStyle:{firstLineIndent:t.firstLineIndent,leftIndent:t.listIndent,tabOffset:t.tabOffset,bulletCharCode:t.bulletChar?t.bulletChar.charCodeAt(0):null},styleNameKey:"",styleNamePrefix:""}:null}}(r||(r={})),function(t){t[t.defaultCursor=0]="defaultCursor",t[t.sizeNW=1]="sizeNW",t[t.sizeNE=2]="sizeNE",t[t.sizeSW=3]="sizeSW",t[t.sizeSE=4]="sizeSE",t[t.sizeN=5]="sizeN",t[t.sizeS=6]="sizeS",t[t.sizeW=7]="sizeW",t[t.sizeE=8]="sizeE",t[t.move=9]="move",t[t.cross=10]="cross",t[t.pointer=11]="pointer",t[t.sizeEW=12]="sizeEW",t[t.sizeNS=13]="sizeNS",t[t.sizeNESW=14]="sizeNESW",t[t.sizeNWSE=15]="sizeNWSE",t[t.text=16]="text",t[t.grab=17]="grab",t[t.grabbing=18]="grabbing"}(i||(i={})),function(t){t[t.rgb=16777216]="rgb",t[t.cmyk=335544320]="cmyk",t[t.grayScale=301989888]="grayScale",t[t.unknown=0]="unknown"}(o||(o={})),function(t){t[t.Item=0]="Item",t[t.Color=1]="Color"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(406),o=n(503);!function(t){t[t.Point=0]="Point",t[t.Percent=1]="Percent",t[t.Pixel=2]="Pixel"}(r||(r={}));var a=function(){function t(t,e){this._rectangle=t,this._dpi=e}return t.prototype.convert=function(t){if(-1===t.indexOf("/"))return this._normalize(this._combineRadiuses(this._getRadiuses(t,!0),this._getRadiuses(t,!1)));var e=t.split("/");return this._normalize(this._combineRadiuses(this._getRadiuses(e[0].trim(),!0),this._getRadiuses(e[1].trim(),!1)))},t.prototype._normalize=function(t){if(null==t)return t;var e=t,n=(e[0].width+e[1].width)/this._rectangle.width,r=(e[2].width+e[3].width)/this._rectangle.width,i=(e[0].height+e[3].height)/this._rectangle.height,o=(e[1].height+e[2].height)/this._rectangle.height;return n>1&&(e[0].width=e[0].width/n,e[1].width=e[1].width/n),r>1&&(e[2].width=e[2].width/r,e[3].width=e[3].width/r),o>1&&(e[1].height=e[1].height/o,e[2].height=e[2].height/o),i>1&&(e[3].height=e[3].height/i,e[0].height=e[0].height/i),t},t.prototype._combineRadiuses=function(t,e){return null==t||4!==t.length||null==e||4!==e.length?null:[new i.SizeF(t[0],e[0]),new i.SizeF(t[1],e[1]),new i.SizeF(t[2],e[2]),new i.SizeF(t[3],e[3])]},t.prototype._getRadiuses=function(t,e){if(null==t)return null;var n=t.split(" ").filter((function(t){return null!=t&&t.length>0}));if(n.length<1)return null;if(n.length>4)return null;for(var r=[],i=0;i<n.length;i++){var o=this._tryParseNumberPart(n[i]);if(null==o)return null;r.push(this._toPoints(o,e))}switch(r.length){case 1:return[r[0],r[0],r[0],r[0]];case 2:return[r[0],r[1],r[0],r[1]];case 3:return[r[0],r[1],r[2],r[1]];default:return r}},t.prototype._tryParseNumberPart=function(t){if(t.endsWith("%")){var e=parseFloat(t);return isNaN(e)?null:{value:e,measureType:r.Percent}}if(t.toLowerCase().endsWith("px")){var n=parseFloat(t);return isNaN(n)?null:{value:n,measureType:r.Pixel}}var i=parseFloat(t);return isNaN(i)?null:{value:i,measureType:r.Point}},t.prototype._toPoints=function(t,e){switch(t.measureType){case r.Percent:return(e?this._rectangle.width:this._rectangle.height)*t.value/100;case r.Pixel:return o.a(t.value,this._dpi);default:return t.value}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return r})),n.d(e,"b",(function(){return a}));var r,i=n(411),o=function(){function t(){this.name="cropmark",this.margin=10,this.color=i.RgbColors.black,this.widthPx=1,this.length=8,this.leftNotes=null,this.topNotes=null,this.rightNotes=null,this.bottomNotes=null}return Object.defineProperty(t.prototype,"margins",{get:function(){return"number"==typeof this.margin?{horizontal:this.margin,vertical:this.margin}:this.margin},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lengths",{get:function(){return"number"==typeof this.length?{horizontal:this.length,vertical:this.length}:this.length},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new t;return e.name=this.name,e.margin=this.margin,e.color=this.color,e.widthPx=this.widthPx,e.length=this.length,e.leftNotes=null!=this.leftNotes?this.leftNotes.map((function(t){return t.clone()})):null,e.topNotes=null!=this.topNotes?this.topNotes.map((function(t){return t.clone()})):null,e.rightNotes=null!=this.rightNotes?this.rightNotes.map((function(t){return t.clone()})):null,e.bottomNotes=null!=this.bottomNotes?this.bottomNotes.map((function(t){return t.clone()})):null,e},t}();!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"}(r||(r={}));var a=function(){function t(){this.alignment=r.Left,this.fontSize=3,this.edgeMargin=.3,this.markMargin=.3}return t.prototype.clone=function(){var e=new t;return e.alignment=this.alignment,e.fontSize=this.fontSize,e.text=this.text,e.edgeMargin=this.edgeMargin,e.markMargin=this.markMargin,e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r,i=n(423),o=n(428),a=n(421),s=n(509),l=n(488),u=n(407),c=n(409),h=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parentSurface=null,i._safetyLines=new a.a,i._cropMarks=new a.a,i._onBoundsPropertyChanged=function(t,e){i._propertyChanged.notify(i,"bounds")},i._onBleedPropertyChanged=function(t,e){i._validateMargin(i.bleed,"bleed"),i._propertyChanged.notify(i,"bleed")},i._onSlugPropertyChanged=function(t,e){i._validateMargin(i.slug,"slug"),i._propertyChanged.notify(i,"slug")},i._validateMargin(n,"bleed"),i._validateMargin(r,"slug"),i._bounds=null!=e?e:new o.a,i.bleed=null!=n?n:new s.a,i.slug=null!=r?r:new s.a,i}return h(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this._bounds},set:function(t){this._bounds.equals(t)||(this._unsubscribeBoundsPropertyChanged(),this._bounds=t,this._subscribeBoundsPropertyChanged(),this._propertyChanged.notify(this,"bounds"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"safetyLines",{get:function(){return this._safetyLines},set:function(t){this._safetyLines!==t&&(this._safetyLines=t,this._propertyChanged.notify(this,"safetyLines"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cropMarks",{get:function(){return this._cropMarks},set:function(t){this._cropMarks!==t&&(this._cropMarks=t,this._propertyChanged.notify(this,"cropMarks"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bleed",{get:function(){return this._bleed},set:function(t){Object(c.g)(t,this._bleed)||(this._validateMargin(t,"bleed"),this._unsubscribeBleedPropertyChanged(),this._bleed=t,this._subscribeBleedPropertyChanged(),this._propertyChanged.notify(this,"bleed"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"slug",{get:function(){return this._slug},set:function(t){Object(c.g)(t,this._slug)||(this._validateMargin(t,"slug"),this._unsubscribeSlugPropertyChanged(),this._slug=t,this._subscribeSlugPropertyChanged(),this._propertyChanged.notify(this,"slug"))},enumerable:!0,configurable:!0}),e.prototype.getBounds=function(t){switch(t){case l.a.Bleed:return this.bounds.getExpanded(this.bleed);case l.a.Total:return this.bounds.getExpanded(new s.a({left:this.bleed.left+this.slug.left,top:this.bleed.top+this.slug.top,right:this.bleed.right+this.slug.right,bottom:this.bleed.bottom+this.slug.bottom}));default:return this.bounds.clone()}},e.prototype._subscribeBoundsPropertyChanged=function(){null!=this._bounds&&this._bounds.addPropertyChanged(this._onBoundsPropertyChanged)},e.prototype._unsubscribeBoundsPropertyChanged=function(){null!=this._bounds&&this._bounds.removePropertyChanged(this._onBoundsPropertyChanged)},e.prototype._subscribeBleedPropertyChanged=function(){null!=this._bleed&&this._bleed.addPropertyChanged(this._onBleedPropertyChanged)},e.prototype._unsubscribeBleedPropertyChanged=function(){null!=this._bleed&&this._bleed.removePropertyChanged(this._onBleedPropertyChanged)},e.prototype._subscribeSlugPropertyChanged=function(){null!=this._slug&&this._slug.addPropertyChanged(this._onSlugPropertyChanged)},e.prototype._unsubscribeSlugPropertyChanged=function(){null!=this._slug&&this._slug.removePropertyChanged(this._onSlugPropertyChanged)},e.prototype._validateMargin=function(t,e){if(null!=t&&(t.left<0||t.top<0||t.right<0||t.bottom<0))throw new u.a("PrintArea.ts: "+e+" margin members cannot be negative!")},e.prototype.getSimplifiedObject=function(){return t.prototype.getSimplifiedObject.call(this,["parentSurface","boundsWithMargins","boundsWithBleed"])},e.prototype._copy=function(e,n,r){var i,o;t.prototype._copy.call(this,e,n,r),n.bounds=null!=e.bounds?e.bounds.clone():null,n.safetyLines.addRange(e.safetyLines.toArray().map((function(t){return t.clone()}))),n.cropMarks.addRange(e.cropMarks.toArray().map((function(t){return t.clone()}))),n.bleed=null===(i=e.bleed)||void 0===i?void 0:i.clone(),n.slug=null===(o=e.slug)||void 0===o?void 0:o.clone()},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.generateNewIds=function(){this._generateNewId()},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r,i=n(423),o=n(510),a=n(416),s=n(421),l=n(406),u=n(490),c=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e){void 0===e&&(e=[]);var n=t.call(this)||this;return n.defaultDesignLocation=new l.PointF,n._defaultSafetyLines=new s.a,n._defaultCropMarks=new s.a,n._surfaces=new s.a,n._preferredFonts=[],n._onSurfacesAdd=function(t){t.item.parentProduct=n},n.surfaces.add_collectionChanged(n._onSurfacesAdd),n.surfaces.setRange(e),n.palette=new u.a,n}return c(e,t),Object.defineProperty(e.prototype,"surfaces",{get:function(){return this._surfaces},set:function(t){this.surfaces.setRange(t)},enumerable:!0,configurable:!0}),e.prototype.serialize=function(t,e){return t.serialize(this,e)},Object.defineProperty(e.prototype,"defaultSafetyLines",{get:function(){return this._defaultSafetyLines},set:function(t){this._defaultSafetyLines!==t&&(this._defaultSafetyLines=t,this._propertyChanged.notify(this,"defaultSafetyLines"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultCropMarks",{get:function(){return this._defaultCropMarks},set:function(t){this._defaultCropMarks!==t&&(this._defaultCropMarks=t,this._propertyChanged.notify(this,"defaultCropMarks"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preferredFonts",{get:function(){return this._preferredFonts},set:function(t){this._preferredFonts=t,this._propertyChanged.notify(this,"preferredFonts")},enumerable:!0,configurable:!0}),e.prototype._copy=function(e,n,r){var i;t.prototype._copy.call(this,e,n,r),n.surfaces.addRange(e.surfaces.toArray().map((function(t){return t.clone(r)}))),n.watermarkConfig=null!=e.watermarkConfig?e.watermarkConfig.clone():null,n.defaultCropMarks.addRange(e.defaultCropMarks.toArray().map((function(t){return t.clone()}))),n.defaultSafetyLines.addRange(e.defaultSafetyLines.toArray().map((function(t){return t.clone()}))),n.defaultDesignLocation=e.defaultDesignLocation.clone(),n.palette.addRange(e.palette.select((function(t){return t.clone(r)}))),n.preferredFonts=null===(i=e.preferredFonts)||void 0===i?void 0:i.slice()},e.prototype.clone=function(t){void 0===t&&(t=!1);var n=new e;return this._copy(this,n,t),n},e.prototype.getAllItems=function(t){return void 0===t&&(t={ignoreMockups:!1}),o.a.getItems(this.surfaces,t)},e.prototype.generateNewIds=function(){this._generateNewId(),this._surfaces.forEach((function(t){return t.generateNewIds()}))},e.prototype.getSurface=function(t){var e=this.surfaces.toArray(),n=parseInt(t);return!Number.isNaN(n)&&n>=0&&e.length>n?e[n]:a.d(e,(function(e){return e.name===t}))},e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return a}));var r=function(){function t(){}return t.prototype.clone=function(){var e=new t;return e.name=this.name,e.storageId=this.storageId,e.staticStorageId=this.staticStorageId,e.repeat=this.repeat,e.opacity=this.opacity,e},t}(),i=function(){function t(){}return t.prototype.clone=function(){var e=new t;return e.text=this.text,e.fontSettings=null!=this.fontSettings?this.fontSettings.clone():null,e.scale=this.scale,e.opacity=this.opacity,e},t}(),o=function(){function t(){}return t.prototype.clone=function(){var e=new t;return e.canvas=this.canvas,e.proof=this.proof,e},t}(),a=function(){function t(){}return t.prototype.clone=function(){var e=new t;return e.text=null!=this.text?this.text.clone():null,e.image=null!=this.image?this.image.clone():null,e.visibility=null!=this.visibility?this.visibility.clone():null,e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(407),i=function(){function t(t,e,n){this._major=t,this._minor=e,this._patch=n}return t.fromString=function(e){if(null==e)throw new r.c("componentVersion must not be null.");var n=e.match(/^(\d+).(\d+).(\d+)/);if(null==n)throw new r.c("Source string '"+e+"' does not contains version.");return new t(Number.parseInt(n[1]),Number.parseInt(n[2]),Number.parseInt(n[3]))},t.prototype.isCompatibleTo=function(t){return this._major===t._major&&this._minor===t._minor&&this._isDevVersion()==t._isDevVersion()},t.prototype._isDevVersion=function(){return this._patch>=100},t}()},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t[t.Hidden=0]="Hidden",t[t.Bottom=1]="Bottom",t[t.Active=2]="Active",t[t.Top=3]="Top"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){var t=this;this._promise=new Promise((function(e,n){t._resolve=e,t._reject=n}))}return Object.defineProperty(t.prototype,"promise",{get:function(){return this._promise},enumerable:!0,configurable:!0}),t.prototype.resolve=function(t){null==this||this._resolve(t)},t.prototype.reject=function(t){null==this||this._reject(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r,i=n(453),o=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=t.call(this,e)||this;return n.__type="ImageHandlerData",e&&(n.DI=e.needToDownloadImage,n.SAS=e.takeIntoAccountImageDpi,n.HR=e.sourceImageHorizontalResolution,n.VR=e.sourceImageVerticalResolution),n}return o(e,t),e.prototype.applyState=function(e,n){n&&(n.beginUpdate(),n.sourceImageHorizontalResolution=e.HR,n.sourceImageVerticalResolution=e.VR,n.needToDownloadImage=e.DI,n.takeIntoAccountImageDpi=e.SAS,t.prototype.applyState.call(this,e,n))},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(440),i=function(){function t(){}return t.isBackendEffect=function(t){return t===r.d.BlackAndWhite||t===r.d.BlackAndTransparent},t.isUpscaleRequired=function(t){return t===r.d.BlackAndWhite||t===r.d.BlackAndTransparent},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r,i=n(453),o=n(612),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=this,r=e._editing;if(r&&(e._editing=!1),n=t.call(this,e)||this,e._editing=r,n.__type="PlaceholderHandlerData",e){e.isEmptyContent()?n.CT=null:n.CT=e.getTypeName();var i=e.topFrames;if(null!=i){n.TFCT=[],n.TFCD=[];for(var o=0;o<i.length;o++)n.TFCD.push(i[o].getData()),n.TFCT.push(i[o].getTypeName())}var a=e.bottomFrames;if(null!=a)for(n.BFCT=[],n.BFCD=[],o=0;o<a.length;o++)n.BFCD.push(a[o].getData()),n.BFCT.push(a[o].getTypeName());n.SMC=e.showMaskedContent}return n}return a(e,t),e.prototype.applyState=function(e,n){if(n){if(n.beginUpdate(),null!=e.TFCD&&0!==e.TFCD.length){for(var r=[],i=0;i<e.TFCD.length;i++)if(null!=e.TFCT[i]){var a=(new o.a).create(e.TFCT[i]);a.setData(e.TFCD[i]),r.push(a)}n.topFrames=r}if(null!=e.BFCD&&0!==e.BFCD.length){var s=[];for(i=0;i<e.BFCD.length;i++)if(null!=e.BFCT[i]){var l=(new o.a).create(e.BFCT[i]);l.setData(e.BFCD[i]),s.push(l)}n.bottomFrames=s}n.showMaskedContent=e.SMC,t.prototype.applyState.call(this,e,n)}},e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o}));var r,i=n(406);!function(t){t.point="pt",t.pixel="px"}(r||(r={}));class o{constructor(t,e){this.value=null!=t?t:0,this.unit=null!=e?e:r.point}equals(t,e){if(null==t)return!1;const n=Object(i.EqualsOfFloatNumbers)(this.value,t.value,e),r=this.unit===t.unit;return n&&r}static equals(t,e,n){return null==t&&null==e||null!=t&&null!=e&&t.equals(e,n)}toString(){return`${this.value}${this.unit}`}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(582);class i{isMatch(t){const e=r.a.equals(this.leftIndent,t.leftIndent),n=r.a.equals(this.firstLineIndent,t.firstLineIndent),i=r.a.equals(this.levelIndent,t.levelIndent),o=r.a.equals(this.textIndent,t.textIndent);return e&&n&&i&&o}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a}));class r{}r.levelIndent="level-indent",r.textIndent="text-indent",r.leftIndent="left-indent",r.firstLineIndent="first-line-indent";class i{}i.fontSize="font-size";class o extends r{}o.start="start",o.type="type";class a extends r{}a.type="type"},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(430);class i{static serialize(t){return`#${t}`}static parse(t){if(!t)return null;const e=t.trim();if(e.match(/^#(\d+)$/))return parseInt(e.substring(1));throw new r.b(`Unable to parse bullet-char value from string '${e}'`)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(430),i=n(420),o=n(426);class a{static serialize(t){switch(t){case i.ListStyleType.bullets:return"bullets";case i.ListStyleType.numbers:return"numbers";case i.ListStyleType.none:return"none";default:throw new r.b(`Unable to serialize list style type from value '${t}'`)}}static parse(t){if(Object(o.a)(t))return null;switch(t.toLowerCase()){case"bullets":return i.ListStyleType.bullets;case"numbers":return i.ListStyleType.numbers;case"none":return i.ListStyleType.none;default:throw new r.b(`Unable to parse list-type value from string '${t}'`)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(430),i=n(420),o=n(426),a=n(454);class s{static serialize(t){switch(t){case i.NumberFormatType.lowerLetter:return"lower-letter";case i.NumberFormatType.lowerRoman:return"lower-roman";case i.NumberFormatType.none:return"none";case i.NumberFormatType.number:return"number";case i.NumberFormatType.upperLetter:return"upper-letter";case i.NumberFormatType.upperRoman:return"upper-roman";default:throw new r.b(`Unable to serialize format-type value from value '${t}'`)}}static parse(t){if(Object(o.a)(t))return null;switch(t.toLowerCase()){case"lower-letter":return i.NumberFormatType.lowerLetter;case"lower-roman":return i.NumberFormatType.lowerRoman;case"none":return i.NumberFormatType.none;case"number":return i.NumberFormatType.number;case"upper-letter":return i.NumberFormatType.upperLetter;case"upper-roman":return i.NumberFormatType.upperRoman;default:throw new r.b(`Unable to parse format-type value from string '${t}'`)}}static fromListType(t){switch(t){case a.c.lowerLetter:return i.NumberFormatType.lowerLetter;case a.c.lowerRoman:return i.NumberFormatType.lowerRoman;case a.c.numbers:return i.NumberFormatType.number;case a.c.upperLetter:return i.NumberFormatType.upperLetter;case a.c.upperRoman:return i.NumberFormatType.upperRoman}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(430),i=n(420),o=n(426);class a{static serialize(t){switch(t){case i.NumberMode.startAt:return"start-at";case i.NumberMode.continueFromPrevious:return"continue-from-previous";default:throw new r.b(`Unable to serialize number-mode value from value '${t}'`)}}static parse(t){if(Object(o.a)(t))return null;switch(t.toLowerCase()){case"start-at":return i.NumberMode.startAt;case"continue-from-previous":return i.NumberMode.continueFromPrevious;default:throw new r.b(`Unable to parse number-mode value from string '${t}'`)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(430),i=n(420),o=n(454),a=n(467),s=n(426);class l{static serializeComplex(t,e,n){let o=null;switch(t){case i.ListStyleType.numbers:switch(e){case i.NumberFormatType.number:case i.NumberFormatType.none:case null:o="decimal";break;case i.NumberFormatType.lowerRoman:o="lower-roman";break;case i.NumberFormatType.upperRoman:o="upper-roman";break;case i.NumberFormatType.lowerLetter:o="lower-alpha";break;case i.NumberFormatType.upperLetter:o="upper-alpha";break;default:o="decimal"}break;case i.ListStyleType.bullets:if(n)if("number"==typeof n)switch(n){case i.NumberFormatType.number:case 8226:o="disc";break;case 9642:o="square";break;default:o=`'${String.fromCharCode(n)}'`}else"string"==typeof n&&(o="•"==n?"disc":"▪"==n?"square":1==n.length?`'${n}'`:3==n.length&&n.match(/('|").('|")/g)?`'${n[1]}'`:"disc");else o="disc";break;case i.ListStyleType.none:o="none";break;default:throw new r.b(`Unable to serialize list style type from value '${t}'`)}return o}static parseNumberModeStartAt(t){return Number.isInteger(t)?{numberMode:i.NumberMode.startAt,startAt:t}:{numberMode:i.NumberMode.continueFromPrevious,startAt:null}}static parseComplex(t){var e,n;if(Object(s.a)(t))return null;const o=t.toLowerCase();switch(o){case"disc":case"circle":return{listStyleType:i.ListStyleType.bullets,numberFormatType:null,bulletChar:8226};case"square":return{listStyleType:i.ListStyleType.bullets,numberFormatType:null,bulletChar:9642};case null===(e=o.match(/('|").('|")/))||void 0===e?void 0:e.input:return{listStyleType:i.ListStyleType.bullets,numberFormatType:null,bulletChar:o.charCodeAt(1)};case null===(n=o.match(/&#\d+/))||void 0===n?void 0:n.input:return{listStyleType:i.ListStyleType.bullets,numberFormatType:null,bulletChar:parseInt(o.replace(/[^0-9]/g,""))};case"decimal":return{listStyleType:i.ListStyleType.numbers,numberFormatType:i.NumberFormatType.number,bulletChar:null};case"lower-alpha":return{listStyleType:i.ListStyleType.numbers,numberFormatType:i.NumberFormatType.lowerLetter,bulletChar:null};case"upper-alpha":return{listStyleType:i.ListStyleType.numbers,numberFormatType:i.NumberFormatType.upperLetter,bulletChar:null};case"lower-roman":return{listStyleType:i.ListStyleType.numbers,numberFormatType:i.NumberFormatType.lowerRoman,bulletChar:null};case"upper-roman":return{listStyleType:i.ListStyleType.numbers,numberFormatType:i.NumberFormatType.upperRoman,bulletChar:null};case"none":return{listStyleType:i.ListStyleType.none,numberFormatType:null,bulletChar:null};default:throw new r.b(` parseComplex Unable to parse list-type value from string '${t}'`)}}static parseOltype(t){if(Object(s.a)(t))return null;switch(t.toLowerCase()){case"decimal":return o.c.numbers;case"lower-alpha":return o.c.lowerLetter;case"upper-alpha":return o.c.upperLetter;case"lower-roman":return o.c.lowerRoman;case"upper-roman":return o.c.upperRoman;default:throw new r.b(` parseOltype Unable to parse list-type value from string '${t}'`)}}static parseUltype(t){if(Object(s.a)(t))return null;let e=new a.d;if(1==t.length)return e.value=t,e;switch(t.toLowerCase()){case"disc":case"circle":return a.c.bullet;case"-":case"—":return a.c.minus;case"none":return a.c.none;case"square":return e.value="▪",e;default:if(t.match(/('|").('|")/g))return e.value=String.fromCharCode(t.replace(/('|")/g,"").charCodeAt(0)),e;if(t.match(/&#\d+/g))return e.value=String.fromCharCode(parseInt(t.replace(/[^0-9]/g,""))),e;throw new r.b(`parseUltype Unable to parse list-type value from string '${t}'`)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(407),i=n(411),o=n(420),a=n(591),s=n(602),l=n(483);class u{constructor(t,e,n,i,o,a=72){if(this._engine=t,this._fontRegistry=e,this._listStyleSheetManager=n,this._colorPreviewService=i,this._colorParser=o,this._dpi=a,this._initData=null,this._engineHandler=null,null==t)throw new r.b("TextWhizzWrapper: engine parameter must not be null.");this._cursorHandler=new s.a(this),this._textHandler=new s.e(this,this,this._colorParser),this._styleHandler=new s.d(this,this._colorPreviewService),this._selectionHandler=new s.c(this),this._undoRedoHandler=new s.g(this),this._metadataHandler=new s.b(this),this._textMeasurer=new s.f(this)}get isInitialized(){return null!=this._engineHandler}initialize(t){this._initialize(t,!1)}get cursorHandler(){return this._cursorHandler}get textHandler(){return this._textHandler}get styleHandler(){return this._styleHandler}get selectionHandler(){return this._selectionHandler}get undoRedoHandler(){return this._undoRedoHandler}get metadataHandler(){return this._metadataHandler}get colorPalette(){var t;return null===(t=this._styleHandler)||void 0===t?void 0:t.colorPalette}get textMeasurer(){return this._textMeasurer}get engine(){return this._engine}get engineHandler(){return this._engineHandler}get initData(){return this._initData}clone(t){const e=this._initData.getActualFrames(),n=new u(this._engine,this._fontRegistry,this._listStyleSheetManager,this._colorPreviewService,this._colorParser,this._dpi);return n._initialize(this._initData,!0,t),n.textHandler.setTextFrames(e,!0),n}static createException(t,e){if("number"!=typeof e)throw e;const n=t.getExceptionMessage(e),i=t.getExceptionName(e);return new r.c(`${i}: ${n}`)}_initialize(t,e,n){try{this._initData=t,this._engineHandler=new this._engine.TextHandler(this._fontRegistry,this._dpi),this._initStyles(t),this._initText(t,e,n),this._initUndoRedo(),this._initCursor()}catch(r){throw u.createException(this._engine,r)}}_initStyles(t){t.colorPalette&&this._styleHandler.initialize(t.colorPalette),t.defaultCharStyle&&this._styleHandler.setDefaultCharStyle(t.defaultCharStyle),t.defaultParagraphStyle&&this._styleHandler.setDefaultParagraphStyle(t.defaultParagraphStyle)}_initText(t,e,n){if(this._textHandler.setTextFrames(t.frames,e),t.wrappingPath&&this._textHandler.setWrappingPath(t.wrappingPath),n)return void this._textHandler.insertFormattedText(n);let r,s;const u=new l.a(this.colorPalette.getPaletteColors());if(t.text instanceof o.Text)s=t.text;else{const e=this.colorPalette.getPaletteColors(),n=new l.a(e),r=this._styleHandler.getDefaultCharStyle().font.size;s=new a.GmXmlParser(this._colorParser).parse(t.text,n,r,this._listStyleSheetManager)}r=new a.GmXmlSerializer(this._colorParser).serialize(s,u);let c=0;for(;u.containsColorWithIndex(c);){let t=u.getColorByIndex(c),e=this.colorPalette.getPaletteColorAt(c);null==e?this.colorPalette.addColorToPalette(t):i.Color.equals(e.color,t.color)||console.warn(`differentColors: existingColor ${e}; paletteColor ${t}`),c++}this._textHandler.insertFormattedText(r)}_initUndoRedo(){this._engineHandler.clearUndoRedo()}_initCursor(){this._engineHandler.getCursor().set(this.engineHandler.getFirstPosition())}}},function(t,e,n){"use strict";var r=n(466);n.d(e,"GmXmlParser",(function(){return r.a}));var i=n(468);n.d(e,"GmXmlSerializer",(function(){return i.a})),n(756)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{static isTextEmpty(t){return"<p></p>"===t||"<p><span></span></p>"===t||""===t}static correctPlainMultilineText(t){return/^<p><span>.*<\/span><\/p>$/m.test(t)?t:t.split("\n").map((t=>`<p><span>${t}</span></p>`)).join("")}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(406),i=n(410),o=n(427),a=n(533),s=n(408),l=n(447);class u{constructor(t,e,n,r){this._commandFactory=t,this._currentTextInfo=e,this._clipboard=n,this._inputTextValidator=r,this._isMouseSelectionActive=!1,this._mouseSelectionStart=null,this._mouseSelectionEnd=null,this._textLimitsViolationEvent=new s.a,this._limitsInputValidator=new l.b(e)}initialize(t,e,n=null){this._isTextFormattingEnabled=t,this._isNewLineEnabled=e,this._limitsInputValidator.setLimits(n),this._clipboard.init()}processMouseEvent(t){const e=new r.PointF(t.x,t.y),n=this._getMouseInputCommandType(t,e);if(null==n)return[];switch(n){case o.b.setCursor:return[this._createCmd(o.a.setCursor,new a.o(e))];case o.b.setSelection:{let t=this._mouseSelectionStart.toIPoint(),e=this._mouseSelectionEnd.toIPoint();return[this._createCmd(o.a.setSelection,new a.p(t,e))]}case o.b.selectCurrentParagraph:return[this._createCmd(o.a.selectParagraph,new a.l(e))];case o.b.selectCurrentWord:return[this._createCmd(o.a.selectWord,new a.m(e))];default:return[]}}async processKeyboardEvent(t){const e=await this._getKeyboardInputCommandType(t);if(null==e)return[];if(!await this._validateKeyboardCommand(e))return[];switch(e.type){case o.b.moveCursor:return[this._createCmd(o.a.moveCursor,new a.k(this._convertKeyEventToDirection(t),!1))];case o.b.moveCursorWithSelection:return[this._createCmd(o.a.moveCursor,new a.k(this._convertKeyEventToDirection(t),!0))];case o.b.insertNewLine:return[this._createCmd(o.a.insertNewLine,new a.h(this._isNewLineEnabled))];case o.b.insertLineBreak:return[this._createCmd(o.a.insertLineBrake,new a.g(this._isNewLineEnabled))];case o.b.insertTab:return[this._createCmd(o.a.insertTab)];case o.b.deleteToLeft:return[this._createCmd(o.a.deleteText,new a.f(o.f.left))];case o.b.deleteLeftWord:return[this._createCmd(o.a.deleteText,new a.f(o.f.leftWord))];case o.b.deleteToRight:return[this._createCmd(o.a.deleteText,new a.f(o.f.right))];case o.b.deleteRightWord:return[this._createCmd(o.a.deleteText,new a.f(o.f.rightWord))];case o.b.insertChar:return this._processInsertChar(t);case o.b.undo:return[this._createCmd(o.a.undo)];case o.b.redo:return[this._createCmd(o.a.redo)];case o.b.clearFormatting:return[this._createCmd(o.a.clearFormatting)];case o.b.selectAll:return[this._createCmd(o.a.selectAllText)];case o.b.copyToClipboard:return[this._createCmd(o.a.copyToClipboard)];case o.b.pasteFromClipboard:{const t={text:e.initData,isNewLineEnabled:this._isNewLineEnabled};return[this._createCmd(o.a.insertText,t)]}case o.b.setCapitalLetters:return[this._createCmd(o.a.setCapitalLetters)];case o.b.setFontBold:return[this._createCmd(o.a.setFontBold)];case o.b.setFontItalic:return[this._createCmd(o.a.setFontItalic)];case o.b.setSuperscriptLetters:return[this._createCmd(o.a.setSuperscriptLetters)];case o.b.setSubscriptLetters:return[this._createCmd(o.a.setSubscriptLetters)];case o.b.setFontUnderline:return[this._createCmd(o.a.setFontUnderline)];case o.b.increaseFontSize:return[this._createCmd(o.a.increaseFontSize)];case o.b.decreaseFontSize:return[this._createCmd(o.a.decreaseFontSize)];case o.b.setLeftAlignment:return[this._createCmd(o.a.setAlignment,new a.n(i.qb.Left))];case o.b.setRightAlignment:return[this._createCmd(o.a.setAlignment,new a.n(i.qb.Right))];case o.b.setCenterAlignment:return[this._createCmd(o.a.setAlignment,new a.n(i.qb.Center))];case o.b.createBulletedListItem:return[this._createCmd(o.a.creteBulletedListItem,e.initData)];case o.b.createNumberedListItem:return[this._createCmd(o.a.creteNumberedListItem,e.initData)];case o.b.createBulletedListItemWithSpace:return[this._createCmd(o.a.insertText,new a.i(" ",this._isNewLineEnabled)),this._createCmd(o.a.creteBulletedListItem,e.initData)];case o.b.createNumberedListItemWithSpace:return[this._createCmd(o.a.insertText,new a.i(" ",this._isNewLineEnabled)),this._createCmd(o.a.creteNumberedListItem,e.initData)];case o.b.addListItemWithNewLine:return[this._createCmd(o.a.insertNewLine,new a.h(this._isNewLineEnabled)),this._createCmd(o.a.addListItem,e.initData)];case o.b.addListItemWithSpace:return[this._createCmd(o.a.insertText,new a.i(" ",this._isNewLineEnabled)),this._createCmd(o.a.addListItem,e.initData)];case o.b.deleteListItem:return[this._createCmd(o.a.deleteListItem)];case o.b.increaseListItemIndent:return[this._createCmd(o.a.increaseListItemIndent)];case o.b.decreaseListItemIndent:return[this._createCmd(o.a.decreaseListItemIndent)];default:return[]}}get textLimitsViolationEvent(){return this._textLimitsViolationEvent}async _processInsertChar(t){const e=t.key;if(await this._validateInputText(e)){const t={text:e,isNewLineEnabled:this._isNewLineEnabled};return[this._createCmd(o.a.insertText,t)]}return[]}_createCmd(t,e){return this._commandFactory.create(t,e)}_getMouseInputCommandType(t,e){const n=t.type===o.e.mousedown,r=t.type===o.e.mouseup,i=t.type===o.e.mousemove&&!0===this._isMouseSelectionActive;if(n)return this._isMouseSelectionActive=!0,this._mouseSelectionStart=e,this._mouseSelectionEnd=null,o.b.setCursor;if(r){if(this._isMouseSelectionActive=!1,t.isClick)return 1==t.clickCount?o.b.setCursor:t.clickCount%2==1?o.b.selectCurrentParagraph:o.b.selectCurrentWord;this._mouseSelectionEnd=e,this._isMouseSelectionChanged()?o.b.setSelection:o.b.setCursor}return i&&this._isMouseSelectionActive?(this._mouseSelectionEnd=e,o.b.setSelection):null}async _validateKeyboardCommand(t){const e=this._limitsInputValidator.validateInput(t);if(e.limitsViolated||e.pastedLimitsViolated){const t={isLimitsBroken:e.limitsViolated,isPastePrevented:e.pastedLimitsViolated};return this._textLimitsViolationEvent.notify(t),!1}return t.type!=o.b.pasteFromClipboard||await this._validateInputText(t.initData)}async _getKeyboardInputCommandType(t){const e=t.code===o.c.Tab,n=t.code===o.c.Space,r=t.code===o.c.Enter,i=!0===t.shiftKey,a=!0===t.ctrlKey||!0===t.metaKey,s=t.code===o.c.Backspace,l=t.code===o.c.Delete;return null!=this._convertKeyEventToDirection(t)?i?{type:o.b.moveCursorWithSelection}:{type:o.b.moveCursor}:n&&!a?this._handlePressSpace():s?this._handlePressBackspace(a):l?a?{type:o.b.deleteRightWord}:{type:o.b.deleteToRight}:a?await this._getHotkeyInputCommandType(t):r?this._handlePressEnter(i):e?this._handlePressTab(i):1===t.key.length?{type:o.b.insertChar}:null}_handlePressEnter(t){if(!t&&this._currentTextInfo.isParagraphAListItem){if(this._currentTextInfo.isParagraphEmpty)return 0===this._currentTextInfo.getListItemLevel()?{type:o.b.deleteListItem}:{type:o.b.decreaseListItemIndent};let t;const e=this._currentTextInfo.getSelection();t=null==e||e.isEmpty?this._currentTextInfo.getParagraphIndex():e.getParagraphIndexes()[0];const n={previousListItemIndex:t};return{type:o.b.addListItemWithNewLine,initData:n}}return t?{type:o.b.insertLineBreak}:{type:o.b.insertNewLine}}_handlePressBackspace(t){return this._currentTextInfo.isParagraphAListItem&&this._currentTextInfo.isCursorAtTheBeginningOfParagraph&&null==this._currentTextInfo.getSelection()?{type:o.b.deleteListItem}:t?{type:o.b.deleteLeftWord}:{type:o.b.deleteToLeft}}_handlePressTab(t){let e;const n=this._currentTextInfo.getSelection();return e=null!=n?n.getParagraphIndexes().length>1?t?o.b.decreaseListItemIndent:o.b.increaseListItemIndent:o.b.insertTab:this._currentTextInfo.isParagraphAListItem&&this._currentTextInfo.isCursorAtTheBeginningOfParagraph?t?o.b.decreaseListItemIndent:o.b.increaseListItemIndent:o.b.insertTab,{type:e}}_handlePressSpace(){var t;if(!this._currentTextInfo.isParagraphAListItem){const e=null!==(t=this._tryToGetCreationBulletedListItemType())&&void 0!==t?t:this._tryToGetCreationNumberedListItemType();if(e)return e}return{type:o.b.insertChar}}async _getHotkeyInputCommandType(t){const e=t.shiftKey,n=t.code;if(n===o.c.Space)return{type:o.b.clearFormatting};if(n===o.c.KeyA&&!e)return{type:o.b.selectAll};if(n===o.c.KeyC)return{type:o.b.copyToClipboard};if(n===o.c.KeyV){const t=await this._clipboard.read();return{type:o.b.pasteFromClipboard,initData:t}}return n===o.c.KeyZ?{type:o.b.undo}:n===o.c.KeyY?{type:o.b.redo}:this._isTextFormattingEnabled?n===o.c.KeyA&&e?{type:o.b.setCapitalLetters}:n===o.c.KeyB?{type:o.b.setFontBold}:n===o.c.KeyI?{type:o.b.setFontItalic}:n===o.c.KeyU?{type:o.b.setFontUnderline}:n===o.c.KeyPeriod&&e?{type:o.b.increaseFontSize}:n===o.c.KeyComma&&e?{type:o.b.decreaseFontSize}:n===o.c.KeyEqual&&e||n===o.c.KeyPeriod?{type:o.b.setSuperscriptLetters}:n===o.c.KeyEqual||n===o.c.KeyComma?{type:o.b.setSubscriptLetters}:n===o.c.KeyL?{type:o.b.setLeftAlignment}:n===o.c.KeyR?{type:o.b.setRightAlignment}:n===o.c.KeyE?{type:o.b.setCenterAlignment}:null:null}_isMouseSelectionChanged(){const t=this._mouseSelectionStart,e=this._mouseSelectionEnd;return!Object(r.EqualsOfFloatNumbers)(t.x,e.x)||!Object(r.EqualsOfFloatNumbers)(t.y,e.y)}_tryToGetCreationBulletedListItemType(){let t,e;const n=this._getBulletedListInfo();if(null==n)return null;const r=this._currentTextInfo.findItemToContinueBulletedList(n.charCode);return null!=r?(t=o.b.addListItemWithSpace,e=new a.a(r)):(t=o.b.createBulletedListItemWithSpace,e=new a.d(this._currentTextInfo.getParagraphIndex(),n.charCode)),{type:t,initData:e}}_tryToGetCreationNumberedListItemType(){let t,e,n;const r=this._getNumberedListInfo();if(null===r)return null;if(1===r.itemNumber)t=!0,e=o.b.createNumberedListItemWithSpace,n=new a.e(this._currentTextInfo.getParagraphIndex(),r.format);else{const i=this._currentTextInfo.findItemToContinueNumberedList(r.format,r.itemNumber);null==i?t=!1:(t=!0,e=o.b.addListItemWithSpace,n=new a.a(i))}return t?{type:e,initData:n}:null}_getBulletedListInfo(){if(1!==this._currentTextInfo.getCursorPosition().getOffset())return null;const t=this._currentTextInfo.getTextFromStartOfParagraph().getPlainText();return"*"!==t&&"-"!==t&&"+"!==t?null:{charCode:"*"===t?8226:t.charCodeAt(0)}}_getNumberedListInfo(){if(this._currentTextInfo.getCursorPosition().getOffset()>8)return null;const t=this._currentTextInfo.getTextFromStartOfParagraph().getPlainText();return this._tryToGetNumberingFormat(t)}_tryToGetNumberingFormat(t){var e,n;if("."!==t.slice(-1))return null;const r=t.slice(0,-1);return null!==(n=null!==(e=this._tryToGetNumericFormat(r))&&void 0!==e?e:this._tryToGetRomanFormat(r))&&void 0!==n?n:this._tryToGetLetterFormat(r)}_tryToGetNumericFormat(t){if(!/^\d+$/.test(t))return null;const e=parseInt(t);return isNaN(e)?null:{itemNumber:e,format:o.h.number}}_tryToGetRomanFormat(t){const e=this._parseRomanToNumber(t);return isNaN(e)?null:this._isUpperCase(t)?{itemNumber:e,format:o.h.upperRoman}:this._isLowerCase(t)?{itemNumber:e,format:o.h.lowerRoman}:null}_tryToGetLetterFormat(t){const e=this._parseLetterToNumber(t);return isNaN(e)||e>100?null:this._isUpperCase(t)?{itemNumber:e,format:o.h.upperLetter}:this._isLowerCase(t)?{itemNumber:e,format:o.h.lowerLetter}:null}_parseRomanToNumber(t){const e=new Map([["I",1],["V",5],["X",10],["i",1],["v",5],["x",10]]);let n=0,r=0,i=0;for(const o of t.split("").reverse())r=e.get(o),r>=i?n+=r:n-=r,i=r;return n>0?n:NaN}_parseLetterToNumber(t){let e=t.toUpperCase(),n=0,r=e.length;for(let i=0;i<r;i++)n+=(e.charCodeAt(i)-64)*Math.pow(26,r-i-1);return n}_isUpperCase(t){return t===t.toUpperCase()}_isLowerCase(t){return t===t.toLowerCase()}_convertKeyEventToDirection(t){const e=t.ctrlKey||t.metaKey;switch(t.code){case o.c.Left:return e?o.f.leftWord:o.f.left;case o.c.Right:return e?o.f.rightWord:o.f.right;case o.c.Up:return o.f.up;case o.c.Down:return o.f.down;case o.c.Home:return e?o.f.textStart:o.f.lineStart;case o.c.End:return e?o.f.textEnd:o.f.lineEnd}return null}async _validateInputText(t){const e=await this._inputTextValidator.validateWithConfirmation(t);return e.isTextValid||e.isInputConfirmed}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(408),i=n(447);class o{constructor(){this._cursorHandler=null,this._textHandler=null,this._styleHandler=null,this._selectionHandler=null,this._undoRedoHandler=null,this._metadataHandler=null,this._textMeasurer=null,this._onTextChanged=()=>{this._textChangedEvent.notify()},this._onCursorChanged=t=>{this._cursorChangedEvent.notify(t)},this._onStyleChanged=()=>{this._styleChangedEvent.notify(),this._updateCursor()},this._onSelectionChanged=t=>{this._selectionChangedEvent.notify(t),this._updateCursor()},this._cursorChangedEvent=new r.a,this._textChangedEvent=new r.a,this._styleChangedEvent=new r.a,this._selectionChangedEvent=new r.a,this._listService=new i.c,this._isInitialized=!1}get isInitialized(){return this._isInitialized}initialize(t){const e=t.textEngineWrapper;this._cursorHandler=e.cursorHandler,this._textHandler=e.textHandler,this._styleHandler=e.styleHandler,this._selectionHandler=e.selectionHandler,this._undoRedoHandler=e.undoRedoHandler,this._metadataHandler=e.metadataHandler,this._textMeasurer=e.textMeasurer,this._listService.initialize({textEngineWrapper:t.textEngineWrapper,styleManager:t.listStyleSheetManager}),this._bindToHandlers(),this._isInitialized=!0}detach(){this._unbindFromHandlers(),this._listService.actualizeStyleManager()}get cursorChangedEvent(){return this._cursorChangedEvent}getFirstPosition(){return this._cursorHandler.getFirstPosition()}getCurrentPosition(){return this._cursorHandler.getCurrentPosition()}getCurrentParagraphIndex(){return this._cursorHandler.getCurrentParagraphIndex()}isSelectionCollapsed(){const t=this.getSelectedTextRange();return!t||t.isEmpty}isCaretOnTheBeginingOfParagraph(){return this.isSelectionCollapsed()&&0==this._cursorHandler.getCurrentPosition().getOffset()}isCaretOnEndOfParagraph(){return this.isSelectionCollapsed()&&this._cursorHandler.getCurrentPosition().getOffset()==this.getCurrentParagraphLength()}setCursorToPosition(t){this._cursorHandler.setToPosition(t),this._resetSelection(t)}setCursorToPoint(t){this._cursorHandler.setToPoint(t),this._resetSelection(this._cursorHandler.getPositionByPoint(t))}moveCursorToDirection(t,e){this._cursorHandler.moveToDirection(t),e?this._updateSelection():this._resetSelection()}get textChangedEvent(){return this._textChangedEvent}getParagraphCount(){return this._textHandler.getParagraphCount()}getParagraphText(t){return this._textHandler.getParagraphText(t)}getTextRangeByPositions(t,e){return this._textHandler.getTextRangeByPositions(t,e)}getTextModel(){return this._textHandler.getTextModel()}setTextModel(t){this._textHandler.setTextModel(t);const e=this._cursorHandler.getFirstPosition();this._cursorHandler.setToPosition(e),this._resetSelection(e)}getFormattedText(){return this._textHandler.getFormattedText()}insertPlainText(t){this._deleteSelection(),this._textHandler.insertPlainText(t),this._updateCursor(),this._resetSelection()}insertFormattedText(t){this._deleteSelection(),this._textHandler.insertFormattedText(t),this._updateCursor(),this._resetSelection()}insertNewLine(){this._deleteSelection(),this._textHandler.insertNewLine(),this._resetSelection(),this._updateCursor()}deleteTextToDirection(t){const e=null==this._selectionHandler.getSelectionRange()?this._deleteTextToDirection(t):this._deleteSelection();e&&this._cursorHandler.setToPosition(e),this.resetSelection()}deleteTextByRange(t){return this._textHandler.deleteTextByRange(t)}deleteAllText(){this._textHandler.deleteAllText()}setWrappingPath(t){this._textHandler.setWrappingPath(t)}measureText(t,e=!1){return this._textMeasurer.measureText(t,e)}measureTextFrame(t){return this._textMeasurer.measureTextFrame(t)}getTextLength(){return this._textHandler.getAllText().getPlainText().replace(/\n/g,"").length}getCurrentParagraphLength(){const t=this.getCurrentParagraphIndex();return this.getParagraphLength(t)}getParagraphLength(t){return t<0||t>=this.getParagraphCount()?0:this.getParagraphText(t).getPlainText().length}get styleChangedEvent(){return this._styleChangedEvent}clearCurrentFormatting(){const t=this._selectionHandler.getSelectionRange();null!=t?this._styleHandler.clearFormatForRange(t):this._styleHandler.clearFormatForCurrentPosition()}getCharStyleForPosition(t){return this._styleHandler.getCharStyleForPosition(t)}setCharStyleForPosition(t,e){this._styleHandler.setCharStyleForPosition(t,e)}getCurrentCharStyle(){const t=this._selectionHandler.getSelectionRange();return null!=t?this._styleHandler.getCharStyleForRange(t):this._styleHandler.getCharStyleForCurrentPosition()}setCurrentCharStyle(t){const e=this._selectionHandler.getSelectionRange();null!=e?this._styleHandler.setCharStyleForRange(t,e):this._styleHandler.setCharStyleForCurrentPosition(t)}getCurrentParagraphStyle(){const t=this._selectionHandler.getSelectionRange();return null!=t?this._styleHandler.getParagraphStyleForRange(t):this._styleHandler.getParagraphStyleForCurrentPosition()}getParagraphStyleByIndex(t){return this._styleHandler.getParagraphStyleByIndex(t)}setCurrentParagraphStyle(t){const e=this._selectionHandler.getSelectionRange();null!=e?this._styleHandler.setParagraphStyleForRange(t,e):this._styleHandler.setParagraphStyleForCurrentPosition(t)}setParagraphStyleByIndex(t,e){this._styleHandler.setParagraphStyleByIndex(t,e)}get selectionChangedEvent(){return this._selectionChangedEvent}getSelectedParagraphIndexes(){var t,e;return null!==(e=null===(t=this.getSelectedTextRange())||void 0===t?void 0:t.getParagraphIndexes())&&void 0!==e?e:[this.getCurrentParagraphIndex()]}getSelectedTextRange(){return this._selectionHandler.getSelectionRange()}setSelection(t,e){this._selectionHandler.setSelectionByPoints(t,e),this._cursorHandler.setToPoint(e)}selectCurrentWord(){const t=this._cursorHandler.getCurrentWord();this._selectionHandler.setSelectionByRange(t),this._cursorHandler.setToPosition(t.getEndPosition())}selectCurrentParagraph(){const t=this._cursorHandler.getCurrentParagraphIndex(),e=this._textHandler.getParagraphText(t);this._selectionHandler.setSelectionByRange(e)}selectAllText(){const t=this._textHandler.getAllText();this._selectionHandler.setSelectionByRange(t)}resetSelection(){this._resetSelection()}isParagraphAListItem(t){return this._listService.isParagraphAListItem(t)}isParagraphsTheSameList(t){return this._listService.isParagraphsTheSameList(t)}actualizeStyleManager(){this._listService.actualizeStyleManager()}applyListType(t,e){this._listService.applyListType(t,e)}findItemToContinueBulletedList(t,e){return this._listService.findItemToContinueBulletedList(t,e)}findItemToContinueNumberedList(t,e,n){return this._listService.findItemToContinueNumberedList(t,e,n)}getListItemStyle(t){return this._listService.getListItemStyle(t)}createBulletedListItem(t,e){this._listService.createBulletedListItem(t,e)}createNumberedListItem(t,e){this._listService.createNumberedListItem(t,e)}addListItem(t,e){this._listService.addListItem(t,e)}deleteListItem(t){this._listService.deleteListItem(t)}increaseListItemIndent(t){this._listService.increaseListItemIndent(t)}decreaseListItemIndent(t){this._listService.decreaseListItemIndent(t)}get canRedo(){return this._undoRedoHandler.canRedo}get canUndo(){return this._undoRedoHandler.canUndo}redo(){this._undoRedoHandler.redo(),this._updateUndoRedoSelection(),this._textChangedEvent.notify()}undo(){this._undoRedoHandler.undo(),this._updateUndoRedoSelection(),this._textChangedEvent.notify()}pauseUndoRedo(){this._undoRedoHandler.pause()}resumeUndoRedo(){this._undoRedoHandler.resume()}_updateCursor(){const t=this._cursorHandler.getCurrentPosition();this._cursorChangedEvent.notify(t)}_bindToHandlers(){this._cursorHandler.cursorChangeEvent.add(this._onCursorChanged),this._textHandler.textChangeEvent.add(this._onTextChanged),this._styleHandler.styleChangeEvent.add(this._onStyleChanged),this._selectionHandler.selectionChangeEvent.add(this._onSelectionChanged)}_unbindFromHandlers(){this._cursorHandler.cursorChangeEvent.remove(this._onCursorChanged),this._textHandler.textChangeEvent.remove(this._onTextChanged),this._styleHandler.styleChangeEvent.remove(this._onStyleChanged),this._selectionHandler.selectionChangeEvent.remove(this._onSelectionChanged)}_resetSelection(t){this._selectionHandler.resetSelection(null!=t?t:this._cursorHandler.getCurrentPosition())}_updateSelection(){const t=this._cursorHandler.getCurrentPosition();this._selectionHandler.setSelectionToPosition(t)}_deleteSelection(){const t=this._selectionHandler.getSelectionRange();if(null==t)return null;const e=this._deleteTextRange(t);return e&&this._cursorHandler.setToPosition(e),e}_isTextRangeContainsListItems(t){return t.getParagraphIndexes().some((t=>this.isParagraphAListItem(t)))}_deleteTextRange(t){return this._isTextRangeContainsListItems(t)?this._deleteTextRangeWithLists(t):this._deletePlainTextRange(t)}_deletePlainTextRange(t){return this._textHandler.deleteTextByRange(t)}_deleteTextRangeWithLists(t){const e=t.getParagraphIndexes(),n=e[0],r=this._styleHandler.getCharStyleForPosition(t.getLeftPosition());for(let o of e)o!==n&&this._listService.isParagraphAListItem(o)&&this._listService.deleteListItem(o);const i=this._deletePlainTextRange(t);return this._textHandler.getParagraphText(n).isEmpty&&(this._cursorHandler.setToPosition(i),this._styleHandler.setCharStyleForCurrentPosition(r)),i}_deleteTextToDirection(t){return this.isParagraphAListItem(this.getCurrentParagraphIndex())?this._deleteTextToDirectionInListItem(t):this._textHandler.deleteTextToDirection(t)}_deleteTextToDirectionInListItem(t){const e=this._styleHandler.getCharStyleForCurrentPosition(),n=this._deletePlainTextToDirection(t);return this._textHandler.getParagraphText(this.getCurrentParagraphIndex()).isEmpty&&this.setCurrentCharStyle(e),n}_deletePlainTextToDirection(t){return this._textHandler.deleteTextToDirection(t)}_updateUndoRedoSelection(){const t=this._undoRedoHandler.getSelection();if(t.isValid){const e=t.getStartPosition(),n=t.getEndPosition();e.isEqualTo(n)?this._cursorHandler.setToPosition(e):this._selectionHandler.setSelectionByRange(t)}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(406),i=n(433);class o{constructor(){this._isCursorBlink=!0,this._previewScale=null,this._tw=null}initialize(t,e,n){this._tw=i.i.getEngine(t),this._textRenderer=e,this._previewScale=n}drawCursor(t,e=!1){this._isCursorBlink=e||!this._isCursorBlink,this._isCursorBlink&&!t?this._textRenderer.drawCursor((t=>{this._addContextToPath(t,this._previewScale)})):this._textRenderer.clearCursor()}clearCursor(){this._textRenderer.clearCursor()}drawSelection(t){this._textRenderer.drawSelection(this._tw.engineHandler,i.i.getTextRange(t).getEntry())}drawText(){this._textRenderer.drawText(this._tw.engineHandler)}_addContextToPath(t,e){const n=this._tw.engineHandler.getCursor().getPath();Object(r.EqualsOfFloatNumbers)(e,1)||n.scale(e,e),n.addToContext(t)}}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return xn}));var r,i,o=n(407),a=function(){function t(t){this._args=t}return t.prototype.execute=function(){throw new o.e},t}(),s=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e,n){var r=t.call(this,e)||this;return r._historyArgs=n,null==r._historyArgs&&(r._historyArgs={}),r._historyUpdateMode=null!=r._historyArgs.historyUpdateMode?r._historyArgs.historyUpdateMode:i.Update,r}return s(e,t),e.prototype.execute=function(){return t=this,e=void 0,r=function(){var t;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(e){switch(e.label){case 0:return null!=this._historyArgs.history&&this._historyArgs.history.pause(),[4,this._executeCommandBody()];case 1:return t=e.sent(),null!=this._historyArgs.history&&this._historyArgs.history.resume(this._historyUpdateMode!==i.NotUpdate,this._historyArgs.historyUpdateMode===i.ForceUpdate),[2,t]}}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype._executeCommandBody=function(){throw new o.e},e.prototype.redo=function(){throw new o.e},e.prototype.undo=function(){throw new o.e},e}(a);!function(t){t[t.NotUpdate=0]="NotUpdate",t[t.Update=1]="Update",t[t.ForceUpdate=2]="ForceUpdate"}(i||(i={}));var u,c,h,p,f,d,g,m,y=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(t){function e(e,n,r){var i=t.call(this,r,n)||this;return i._productHandler=e,i}return y(e,t),e.prototype._getTargetItems=function(t,e,n){return null!=t?t:null!=e?this._productHandler.queryItems(e,n):null},e}(l),v=n(410),b=n(409),w=n(507),C=n(475),P=n(435),S=n(506),x=n(459),I=n(458),O=n(456),T=n(425),L=function(){},R=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(){},j=(R((function(t){var e=m.call(this)||this;return e.points=[],e.__type="AutoEraseEffect",e.points=O.map(t,(function(t){return O.extend(new E,t)})),e}),m=L),function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),N=(function(t){j((function(e,n,r,i){var o=t.call(this)||this;return o.__type="CropEffect",o.x=e,o.y=n,o.width=r,o.height=i,o}),t)}(L),function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),k=(function(t){N((function(e,n,r,i,o,a){var s=t.call(this)||this;return s.brightness=0,s.contrast=0,s.hue=0,s.saturation=0,s.grayscale=!1,s.sepia=!1,s.__type="FiltersEffect",s.brightness=e,s.contrast=n,s.hue=r,s.saturation=i,s.grayscale=o,s.sepia=a,s}),t)}(L),n(432)),A=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),F=function(t){function e(e,n,r,i){return void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,e,n,r,i)||this}return A(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"center":case"bend":case"warp":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.center=e.center,this.item.bend=e.bend,this.item.warp=e.warp},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips.setCornerArbitrary(!1),e.manipulation.resizeGrips.edge=!1,e},e.typeName="ArchedTextItemHandler",e}(k.a),B=n(406),M=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),z=function(t){function e(e,n,r,i){return void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,e,n,r,i)||this}return M(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalTextRectangle",{get:function(){return this.item.textRectangle},set:function(t){this.item.textRectangle=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalScale",{get:function(){return this.item.verticalScale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalScale",{get:function(){return this.item.horizontalScale},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVertical",{get:function(){return this.item.isVertical},set:function(t){this.item.isVertical=t},enumerable:!0,configurable:!0}),e.prototype.getTextRectangle=function(){var t=this.getControlCenter(),e=B.RotatedRectangleF.fromRectangleF(this.item.textRectangle);return e.transform(this.item.transform.clone(),t),e.toRectangleF()},e.prototype._onItemPropertyChanged=function(e,n){"isVertical"===n&&this.update(),t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.textRectangle=e.textRectangle,this.item.isVertical=e.isVertical},e.prototype._updateEmptyTextControlPoints=function(){var t=this.item.textRectangle;this._controlPoints[0].x=t.left,this._controlPoints[0].y=t.top,this._controlPoints[1].x=t.right,this._controlPoints[1].y=t.bottom;var e=this.canvas;null!=e&&e.redraw()},e.prototype._setDefaultTextControlPoints=function(){},e.typeName="AutoScaledTextItemHandler",e}(k.a),D=n(453),H=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),U=function(t){function e(e){var n,r,i=t.call(this,e)||this;if(i.__type="BarcodeHandlerData",null==e||null==e.canvas)return i;if(e.canvas.viewerConfiguration&&e.canvas.viewerConfiguration.stubImages&&e.canvas.viewerConfiguration.stubImages.barcode){var o=e.canvas.viewerConfiguration.stubImages.barcode;i.stubText=o.text,i.errorText=o.errorText,i.stubPostScriptName=o.postScriptName}var a=(null!=e.item.parentPlaceholder?e.item.parentPlaceholder.parentContainer.parentComponent:e.item.parentContainer.parentComponent).printAreas.getItem(0);return i.dpi=null!==(r=null===(n=e.canvas.renderingConfigProvider.getHiResRendering(a))||void 0===n?void 0:n.dpi)&&void 0!==r?r:72,i.size=Math.round(Math.max(a.bounds.width,a.bounds.height)/2),i}return H(e,t),e.prototype.applyState=function(e,n){n&&(n.beginUpdate(),n.currentFileId=e.currentFileId,n.stubTextImageFileId=e.stubTextImageFileId,n.errorTextImageFileId=e.errorTextImageFileId,n.errorMessage=e.errorMessage),t.prototype.applyState.call(this,e,n)},e}(D.a),W=n(508),V=n(609),q=n(465),G=n(417),$=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),X=function(t){function e(e,n,r,i){void 0===n&&(n=null);var o=t.call(this,e,n,r,i)||this;return o._currentFileId=null,o._stubTextImageFileId=null,o._errorTextImageFileId=null,o._errorMessage=null,o._maxImageSize=4e6,o._fallbackFileId=null,o._stubImageContainer=new q.a(o._onStubImageLoaded.bind(o)),o}return $(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentFileId",{get:function(){return this._currentFileId},set:function(t){this._currentFileId=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stubTextImageFileId",{get:function(){return this._stubTextImageFileId},set:function(t){this._stubTextImageFileId=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorTextImageFileId",{get:function(){return this._errorTextImageFileId},set:function(t){this._errorTextImageFileId=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorMessage",{get:function(){return this._errorMessage},set:function(t){this._errorMessage=t},enumerable:!0,configurable:!0}),e.prototype.quickUpdate=function(){this.isVisible()&&this.canvas&&!this.canvas.service.imageLoaderService.hasImageContainerFor(this._fileId)&&t.prototype.quickUpdate.call(this)},e.prototype.drawItemHandler=function(t){if(null!=t)if(this._isReadyToDraw){var e=null!=this.parentPlaceholder?this.parentPlaceholder.rectangle:this.rectangle,n=this.rectangle,r=this.isNormalRenderingType?this.item.opacity:1,i=this._getItemColorPreviews(),o=i.fillColorPreview,a=i.borderColorPreview,s=i.altBorderColorPreview;G.a.fillRectangle(t,n,null==o?void 0:o.toString(),r),this._imageContainer.isLoaded&&this._drawImage(t,this.canvas.disableSmoothing),this._stubImageContainer.isLoaded&&this._drawImage(t,this.canvas.disableSmoothing,1,this._stubImageContainer.image),(this._imageContainer.isLoading||this._stubImageContainer.isLoading)&&this.canvas.drawWaitClock(t,new B.PointF(e.centerX,e.centerY));var l=this._getActualBorderWidth();n.width+=l,n.height+=l;var u=B.Path.rotatedRectangle(n);G.a.drawStroke(t,u,n.center,new B.Transform,l,null==a?void 0:a.toString(),null==s?void 0:s.toString(),this.item.opacity,this.item.dash)}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.onResized=function(){return this.update(),t.prototype.onResized.call(this)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._stubImageContainer.dispose()},e.prototype._isReady=function(){return t.prototype._isReady.call(this)&&!(this._showStubImage&&!this._stubImageContainer.isLoaded)},e.prototype._updateImpl=function(e,n){return r=this,i=void 0,a=function(){var r,i=this;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){return this.isVisible()?(null==this.currentFileId&&null==this.errorMessage||!this._isSquareBarcodeFormat()&&!1===this.item.barcodeOptions.pureBarcode?(r=function(){var t;"function"==typeof n&&n(),null===(t=i.canvas)||void 0===t||t.updateSelection()},t.prototype._update.call(this,null,e,r)):this.quickUpdate(),[2]):[2]}))},new((o=void 0)||(o=Promise))((function(t,e){function n(t){try{l(a.next(t))}catch(n){e(n)}}function s(t){try{l(a.throw(t))}catch(n){e(n)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof o?r:new o((function(t){t(r)}))).then(n,s)}l((a=a.apply(r,i||[])).next())}));var r,i,o,a},e.prototype._createDataInstance=function(t){return new U(t)},e.prototype._onItemPropertyChanged=function(e,n){var r=this;switch(this._fallbackFileId=this._fileId,n){case"barcodeFormat":case"barcodeOptions":case"barcodeContent":case"color":"barcodeFormat"!=n&&"barcodeOptions"!=n||(this._fallbackFileId=null),this.currentFileId=null,this.stubTextImageFileId=null,this.errorTextImageFileId=null,this.errorMessage=null,this.update(null,(function(){null==r.errorMessage&&(r._fallbackFileId=null)}))}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips.setCornerArbitrary(!1),e.manipulation.resizeGrips.edge=!1,e},e.prototype._createImageUrl=function(){if(null==this._fileId||null==this.canvas)return null;var t,e,n=this.canvas.zoom,r=n*T.a.screenDpi/72,i=n*T.a.screenDpi/72;t=this.rectangle.width*r,e=this.rectangle.height*i;var o=this._maxImageSize/t/e;return o<1&&(t*=o=Math.sqrt(o),e*=o),t=Math.round(t),e=Math.round(e),this._pixelWidth=t,this._pixelHeight=e,V.a.getImageUrl(this.canvas.renderingConfigProvider,this.canvas.designAtomsApiClient,this._fileId,this._pixelWidth,this._pixelHeight,!1)},e.prototype._isLoadingImage=function(){return this._imageContainer.isLoading||!(this._showStubImage&&!this._stubImageContainer.isLoading)},e.prototype._setIsLoadingImage=function(t){this._imageContainer.isLoading=t,this._showStubImage&&(this._stubImageContainer.isLoading=t)},e.prototype._updateImageUrl=function(){t.prototype._updateImageUrl.call(this),this._updateStubImageUrl()},e.prototype._updateStubImageUrl=function(){if(this.isVisible()){var t=this.canvas;if(null!=t&&t.isInitialized){var e=this._createStubImageUrl();e!==this._stubImageContainer.source&&(null==e?(this._stubImageContainer.clear(),t.redraw()):this._stubImageContainer.updateUrl(e))}}},e.prototype._onImageLoaded=function(t,e){this._imageContainer.isLoading=!1,this._stubImageContainer.isLoading||(null!=this.canvas&&(this.canvas.redraw(),this.canvas.updateSelection()),this._dispatchReadyEvent())},Object.defineProperty(e.prototype,"_fileId",{get:function(){var t;return null!==(t=this.currentFileId)&&void 0!==t?t:this._fallbackFileId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_showStubImage",{get:function(){return this.item.barcodeData.isEmpty||null!=this.errorMessage},enumerable:!0,configurable:!0}),e.prototype._createStubImageUrl=function(){var t=this.item.barcodeData.isEmpty?this.stubTextImageFileId:this.errorTextImageFileId;if(null!=t)return V.a.getImageUrl(this.canvas.renderingConfigProvider,this.canvas.designAtomsApiClient,t,this._pixelWidth,this._pixelHeight,!1)},e.prototype._onStubImageLoaded=function(t,e){this._stubImageContainer.isLoading=!1,this._imageContainer.isLoading||(null!=this.canvas&&(this.canvas.redraw(),this.canvas.updateSelection()),this._dispatchReadyEvent())},e.prototype._isSquareBarcodeFormat=function(){var t=this.item.barcodeFormat;return t==v.j.QR_CODE||t==v.j.AZTEC||t==v.j.DATA_MATRIX},e.typeName="BarcodeItemHandler",e}(W.a),K=n(443),Y=n(517),J=n(518),Z=n(439),Q=n(421);!function(t){t[t.outside=0]="outside",t[t.inside=1]="inside"}(u||(u={})),function(t){t.Overlay="Overlay",t.Normal="Normal"}(c||(c={})),function(t){t.Mm="Mm",t.Inch="Inch",t.Cm="Cm",t.Point="Point",t.Custom="Custom"}(h||(h={})),function(t){t[t.Default=0]="Default",t[t.Html=1]="Html",t[t.None=2]="None"}(p||(p={})),function(t){t.InsideAll="InsideAll",t.PartiallyInsideAny="PartiallyInsideAny",t.InsideAny="InsideAny"}(f||(f={})),function(t){t.Warning="Warning",t.Error="Error"}(d||(d={})),function(t){t.Items="items",t.PrintArea="printArea",t.SafetyLines="safetyLines",t.Region="region",t.Grid="grid",t.InteractiveZones="interactiveZones"}(g||(g={}));var tt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),et=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},nt=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},rt=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(nt(arguments[e]));return t},it=function(t){function e(e,n,r){void 0===r&&(r=null);var i=t.call(this,null,null,null,null,e,r)||this;return i._itemHandlers=new Q.a,i._onChildItemHandlerChanging=function(t){return i.raiseChanging(i.item)},Array.isArray(n)&&(i.itemHandlers=new Q.a(n)),i.item.items.add_itemAdded(i._onItemAdded.bind(i)),i.item.items.add_itemRemoved(i._onItemRemoved.bind(i)),i._subscribeItemHandlers(),i}return tt(e,t),e.prototype.isHighlightNeeded=function(){return!0},e.prototype._getColors=function(){var e,n,r=[];if(null!=this.itemHandlers)try{for(var i=et(this.itemHandlers),o=i.next();!o.done;o=i.next()){var a=o.value;r.push.apply(r,rt(a.getColors()))}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r.push.apply(r,rt(t.prototype._getColors.call(this))),r},e.prototype._unsubscribeItemHandlers=function(){var t=this;null!=this.itemHandlers&&(this.itemHandlers.remove_itemAdded(this._onItemHandlerAdded.bind(this)),this.itemHandlers.remove_itemRemoved(this._onItemHandlerRemoved.bind(this)),this.itemHandlers.forEach((function(e){return e.getChangingEvent().remove(t._onChildItemHandlerChanging)})))},e.prototype._subscribeItemHandlers=function(){var t=this;null!=this.itemHandlers&&(this.itemHandlers.add_itemAdded(this._onItemHandlerAdded.bind(this)),this.itemHandlers.add_itemRemoved(this._onItemHandlerRemoved.bind(this)),this.itemHandlers.forEach((function(e){return e.getChangingEvent().add(t._onChildItemHandlerChanging)})))},e.prototype.setItemHandlers=function(t){this._unsubscribeItemHandlers(),Array.isArray(t)&&(this.itemHandlers=new Q.a(t)),this._subscribeItemEvents()},Object.defineProperty(e.prototype,"itemHandlers",{get:function(){return this._itemHandlers},set:function(t){if(null==t)throw new Error("ItemHandlers can't be null");this._itemHandlers.clear(),this._itemHandlers.addRange(t)},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(t){var e=this;this.getNestedItemHandlers(!0,!1,!0).forEach((function(n){var r,i,o=(null===(i=null===(r=e.canvas.viewerConfiguration)||void 0===r?void 0:r.handlers)||void 0===i?void 0:i.placeholderEditingViewMode)===c.Normal;null==n.canvas||!o&&n instanceof Z.a&&n.editing||n.drawItemHandler(t)}))},e.prototype._getChildrenHighlights=function(){var t=[];return this.itemHandlers.where((function(t){return t.isVisible()})).forEach((function(e){var n=e.getHighlightRectangles();t.push.apply(t,rt(n))})),t},e.prototype.getHighlightRectangles=function(e){void 0===e&&(e={includeChildren:!0,includeParent:!1});var n=[];return e.includeChildren&&(n=rt(this._getChildrenHighlights())),e.includeParent&&this.item.groupItemPermissions&&n.push.apply(n,rt(t.prototype.getHighlightRectangles.call(this,e))),n},e.prototype.getOrderedItems=function(){return this.item.items.toArray()},e.prototype._onItemPropertyChanged=function(e,n){if("opacity"===n){var r=e.opacity;this.item.applyToItems((function(t){Object(B.EqualsOfFloatNumbers)(t.opacity,r)||(t.opacity=r),t instanceof v.cb&&!Object(B.EqualsOfFloatNumbers)(t.content.opacity,r)&&t.updateContentAndFrames((function(t){return t.opacity=r}))}))}this._isPermissionsProperty(n)&&this._resetPermissionsCache(),t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._onItemAdded=function(t){var e=t.item,n=t.index;e.addPropertyChanged(this._onChildItemPropertyChanged.bind(this)),null!=this.canvas&&(null!=n?this.itemHandlers.insertAt(n,this.canvas.getItemHandler(e)):this.itemHandlers.add(this.canvas.getItemHandler(e)))},e.prototype._onItemRemoved=function(t){if(null!=this.canvas){var e=this.itemHandlers.firstOrDefault((function(e){return e.item==t.item}));this.canvas.isItemHandlerSelected(e)&&this.canvas.removeSelectedItemHandler(e),this.itemHandlers.remove(e)}},e.prototype._isPermissionsProperty=function(t){switch(t){case"itemPermissions":case"manipulationPermissions":case"visualizationPermissions":case"placeholderPermissions":return!0;default:return!1}},e.prototype._onChildItemPropertyChanged=function(t,e){this._isPermissionsProperty(e)&&this._resetPermissionsCache()},e.prototype._onItemHandlerAdded=function(t){var n=this,r=t.item;r.getChangingEvent().add(this._onChildItemHandlerChanging);var i=function(t){t.layer=n.layer,t.canvas=n.canvas,t instanceof e&&t.applyToItems((function(t){return i(t)}))};i(r),this._resetPermissionsCache()},e.prototype._onItemHandlerRemoved=function(t){var e=t.item;e.getChangingEvent().remove(this._onChildItemHandlerChanging),this.canvas.isItemHandlerSelected(t.item)&&this.canvas.removeSelectedItemHandler(t.item),e.canvas=null,e.layer=null,e.item.parentContainer=null,this._resetPermissionsCache()},e.prototype.replaceItemHandler=function(t,e){var n=this.itemHandlers.indexOf(t);if(-1==n)throw new o.c("ItemHandler not found");this.itemHandlers.replaceAt(e,n),e.layer=this.layer,this._onItemHandlerRemoved({item:t,index:n}),this._onItemHandlerAdded({item:e,index:n})},e.prototype.getNestedItemHandlers=function(t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1),void 0===r&&(r=!1);for(var i=[],o=n?this.itemHandlers.toArray().slice().reverse():this.itemHandlers.toArray().slice();o.length>0;){var a=o.shift();if(!r||a.isVisible()&&!a.getPermissions().noShow){if(a instanceof e){var s=n?a.itemHandlers.toArray().slice().reverse():a.itemHandlers.toArray();if(o.unshift.apply(o,rt(s)),t)continue}i.push(a)}}return i},e.prototype.updateNestedItemHandlers=function(t){var e,n,r=!1;try{for(var i=et(this.itemHandlers),o=i.next();!o.done;o=i.next()){var a=o.value,s=t(a);r=r||s,"updateNestedItemHandlers"in a&&(s=a.updateNestedItemHandlers(t),r=r||s)}}catch(l){e={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},e.prototype._onTransformRectangle=function(e,n,r){t.prototype._onTransformRectangle.call(this,e,n,r),this.itemHandlers.forEach((function(t){return t.transformRectangle(e,n,r)}))},e.prototype._updateImpl=function(){return e=this,n=void 0,i=function(){var e,n,r,i,o,a;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(s){switch(s.label){case 0:if(e=[],null!=this.itemHandlers)try{for(n=et(this.itemHandlers),r=n.next();!r.done;r=n.next())i=r.value,e.push(i.updateAsync())}catch(l){o={error:l}}finally{try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(o)throw o.error}}return[4,Promise.all(e)];case 1:return s.sent(),[4,t.prototype._updateImpl.call(this)];case 2:return s.sent(),[2]}}))},new((r=void 0)||(r=Promise))((function(t,o){function a(t){try{l(i.next(t))}catch(e){o(e)}}function s(t){try{l(i.throw(t))}catch(e){o(e)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(a,s)}l((i=i.apply(e,n||[])).next())}));var e,n,r,i},e.prototype.quickUpdate=function(){this.applyToItems((function(t){return t.quickUpdate()})),t.prototype.quickUpdate.call(this)},e.prototype.onResized=function(){return this.applyToItems((function(t){return t.onResized()})),t.prototype.onResized.call(this)},e.prototype.startTransform=function(e){this.applyToItems((function(t){return t.startTransform(e)})),t.prototype.startTransform.call(this,e)},e.prototype._endTransform=function(e,n,r){void 0===r&&(r=!1),this.applyToItems((function(t){return t.endTransform(e,n,!0)})),t.prototype._endTransform.call(this,e,n,r)},e.prototype.transformChanged=function(){t.prototype.transformChanged.call(this),this.applyToItems((function(t){return t.transformChanged()}))},e.prototype.setRectangle=function(e,n){var r=e.getTransform(this.rectangle),i=r.translateX,o=r.translateY,a=r.scaleX,s=r.scaleY,l=r.angle,u=function(t){var n=t.rectangle;n.translate(i,o),n.rotateAt(l,e.center),t.setRectangle(n,!0),t instanceof Z.a&&t.updateContentAndFrames(u)};this.itemHandlers.forEach(u);var c=this.rectangle,h=function(t){var e=t.rectangle,n=e.centerX-c.centerX,r=e.centerY-c.centerY;e.setTransform(new B.Transform(a,s,n*(a-1),r*(s-1))),t.setRectangle(e,!0),t instanceof Z.a&&t.updateContentAndFrames(h)};this.itemHandlers.forEach(h),t.prototype.setRectangle.call(this,e,n)},Object.defineProperty(e.prototype,"_calculateRectangleFromChild",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype._getRectangle=function(){return this._calculateRectangleFromChild?this._getRectangleFromChildren():t.prototype._getRectangle.call(this)},e.prototype._getRectangleFromChildren=function(){var t=this.itemHandlers.where((function(t){return t.isVisible()})).toArray().map((function(t){return t.getTransformedRectangle(!1,!0)}));if(t.length<1)return null!=t[0]?t[0]:new B.RotatedRectangleF;var e=this.item.transform.angle,n=t.reduce((function(t,e){return B.RotatedRectangleF.union(t,e)})).center,r=t.map((function(t){return t.rotateAt(-e,n).bounds})).reduce((function(t,e){return{left:Math.min(t.left,e.left),top:Math.min(t.top,e.top),right:Math.max(t.right,e.right),bottom:Math.max(t.bottom,e.bottom)}})),i=r.left,o=r.top,a=r.bottom,s=r.right;return B.RotatedRectangleF.FromLTRB(i,o,s,a).rotateAt(e,n)},e.prototype._onAddedOnCanvas=function(e){t.prototype._onAddedOnCanvas.call(this,e),this.applyToItems((function(t){return t.canvas=e}))},e.prototype._onRemovedFromCanvas=function(e){t.prototype._onRemovedFromCanvas.call(this,e),this.applyToItems((function(t){return t.canvas=null}))},e.prototype.applyToItems=function(t){if(null!=this.itemHandlers)for(var e=0;e<this.itemHandlers.length;e++)t(this.itemHandlers.getItem([e]))},e.prototype.getPermissions=function(){var e,n;if(null!=this._cachedPermissions)return this._cachedPermissions;var r=t.prototype.getPermissions.call(this).clone();try{for(var i=et(this.itemHandlers),o=i.next();!o.done;o=i.next()){var a=o.value,s=a.getPermissions();s.allowMoveHorizontal||(r.allowMoveHorizontal=!1),s.allowMoveVertical||(r.allowMoveVertical=!1),s.allowRotate||(r.allowRotate=!1),s.resizeGrips.edge||(r.resizeGrips.edge=!1),s.resizeGrips.getCornerProportional()||r.resizeGrips.setCornerProportional(!1),s.resizeGrips.getCornerArbitrary()||r.resizeGrips.setCornerArbitrary(!1),(this.item.transform.angle-a.angle)%90!=0&&(r.resizeGrips.edge=!1,r.resizeGrips.setCornerArbitrary(!1))}}catch(l){e={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r.showSelectToolbarButton=this.item.groupItemPermissions.allowReplaceContent,this._cachedPermissions=r,r},e.prototype.resetPermissions=function(){var e,n;t.prototype.resetPermissions.call(this);try{for(var r=et(this.itemHandlers),i=r.next();!i.done;i=r.next())i.value.resetPermissions()}catch(o){e={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}this._resetPermissionsCache()},e.prototype.isChildVisible=function(t){return!0},Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),e.prototype._resetPermissionsCache=function(){this._cachedPermissions=null},e.typeName="GroupItemHandler",e}(K.a),ot=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ot(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),e.prototype._onItemPropertyChanged=function(e,n){"colorGroups"===n&&null!=this.canvas&&(this.update(),this.canvas.redraw()),t.prototype._onItemPropertyChanged.call(this,e,n)},e}(it),st=(n(478),function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),lt=function(t){function e(e){var n=t.call(this,e)||this;return n.__type="CurvedTextHandlerData",null==e||(n.firstUpdateIsComplete=e.firstUpdateIsComplete),n}return st(e,t),e.prototype.applyState=function(e,n){t.prototype.applyState.call(this,e,n),null!=n&&(n.firstUpdateIsComplete=e.firstUpdateIsComplete)},e}(Y.a),ut=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ct=function(t){function e(e,n,r,i){return void 0===n&&(n=null),t.call(this,e,n,r,i)||this}return ut(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstUpdateIsComplete",{get:function(){return this._firstUpdateIsComplete},set:function(t){this._firstUpdateIsComplete=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textPath",{get:function(){var t=this.getControlCenter(),e=this.item.textPath.clone(),n=this.item.transform.clone();return e.transform(n,t),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalTextPath",{get:function(){return this.item.textPath},set:function(t){this.item.textPath=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fitToPath",{get:function(){return this.item.fitToPath},set:function(t){this.item.fitToPath=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stretch",{get:function(){return this.item.stretch},set:function(t){this.item.stretch=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"originalFontSize",{get:function(){return this.item.originalFontSize},set:function(t){this.item.originalFontSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fitToPathStep",{get:function(){return this.item.fitToPathStep},set:function(t){this.item.fitToPathStep=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this.item.start},set:function(t){this.item.start=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.item.end},set:function(t){this.item.end=t},enumerable:!0,configurable:!0}),e.prototype.onResized=function(){var e=this.rectangle.height/this._height,n=parseFloat((this.item.font.size*e).toFixed(1)),r=this.canvas;if(null!=r){var i=r.minFontSize;n="number"==typeof i?Math.max(n,i):n;var o=r.maxFontSize;n="number"==typeof o?Math.min(n,o):n}return Object(B.EqualsOfFloatNumbers)(n,this.item.font.size,.01)?(null!=this._startRectangle?(this.setRectangle(this._startRectangle),r.updateSelection(),delete this._startRectangle):this.update(),!1):t.prototype.onResized.call(this)},e.prototype.drawItemHandler=function(e){t.prototype.drawItemHandler.call(this,e),!0===window.__$abl$&&G.a.drawPath(e,this.item.textPath,this.getControlCenter(),this.item.transform,1,"red",1)},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.textPath=e.textPath,this.item.fitToPath=e.fitToPath,this.item.fitToPathStep=e.fitToPathStep,this.item.stretch=e.stretch,this.item.originalFontSize=e.originalFontSize,this.item.start=e.start,this.item.end=e.end},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"textPath":case"fitToPath":case"fitToPathStep":case"stretch":case"originalFontSize":case"start":case"end":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDefaultTextControlPoints=function(){this._updateEmptyTextControlPoints()},e.prototype._createDataInstance=function(t){return new lt(t)},e.typeName="CurvedTextItemHandler",e}(k.a),ht=function(){function t(){}return t.workspaceToContentPoint=function(e,n){return t.controlToContentPoint(t.workspaceToControlPoint(e,n),n)},t.controlToContentPoint=function(t,e){var n=e.getViewportLocation(),r=e.getActualScrollPosition(),i=new B.PointF(0,0),o=t.x,a=t.y;return i.x=o-n.x+r.x,i.y=a-n.y+r.y,i.round()},t.controlToPagePoint=function(t,e){var n=this.getElementPageCoord(e),r=t.x,i=t.y,o=r+n.left,a=i+n.top;return new B.PointF(Math.round(o),Math.round(a))},t.contentToControlPoint=function(t,e){var n=e.getViewportLocation(),r=e.getActualScrollPosition(),i=new B.PointF(0,0);return i.x=t.x+n.x-r.x,i.y=t.y+n.y-r.y,i.round()},t.controlToContentRectangle=function(e,n){var r=new B.PointF(e.left,e.top),i=new B.PointF(e.left+e.width,e.top+e.height);return r=t.controlToContentPoint(r,n),i=t.controlToContentPoint(i,n),new B.RectangleF(r.x,r.y,i.x-r.x,i.y-r.y)},t.contentToControlRectangle=function(e,n){var r=new B.PointF(e.left,e.top),i=new B.PointF(e.left+e.width,e.top+e.height);return r=t.contentToControlPoint(r,n),i=t.contentToControlPoint(i,n),new B.RectangleF(r.x,r.y,i.x-r.x,i.y-r.y)},t.workspaceToControlPoint=function(e,n){var r=n.zoom,i=e.x,o=e.y,a=new B.PointF(Math.round(i*r*n.screenXDpi/72),Math.round(o*r*n.screenYDpi/72));return t.contentToControlPoint(a,n).round()},t.productToControlPoint=function(t,e,n){var r=this.productToWorkspace(t,n);return this.workspaceToControlPoint(r,e)},t.workspaceToWhiteSpacePoint=function(e,n){var r=t.workspaceToContentPoint(e,n),i=n.rulerEnabled?n.rulerWidth:0,o=n.getViewportLocation();return new B.PointF(r.x-i+o.x,r.y-i+o.y)},t.workspaceToWhiteSpacePointCorrect=function(e,n){var r=this._transformByContentAngleWsToPage(e,n);return t.workspaceToWhiteSpacePoint(r,n)},t.whitespaceToWorkspacePoint=function(e,n){var r=n.rulerEnabled?n.rulerWidth:0,i=n.getViewportLocation();return t.controlToWorkspacePoint(this.contentToControlPoint(new B.PointF(e.x-i.x+r,e.y-i.y+r),n),n)},t.whitespaceToWorkspacePointCorrect=function(e,n){var r=n.rulerEnabled?n.rulerWidth:0,i=n.getViewportLocation(),o=t.controlToWorkspacePoint(this.contentToControlPoint(new B.PointF(e.x-i.x+r,e.y-i.y+r),n),n);return this._transformByContentAnglePageToWs(o,n)},t.controlToWorkspacePoint=function(e,n){var r=n.zoom,i=t.controlToContentPoint(e,n);return new B.PointF(i.x/(r*n.screenXDpi/72),i.y/(r*n.screenYDpi/72))},t.controlToWorkspacePointCorrect=function(e,n){var r=n.zoom,i=t.controlToContentPoint(e,n);return i=new B.PointF(i.x/(r*n.screenXDpi/72),i.y/(r*n.screenYDpi/72)),this._transformByContentAnglePageToWs(i,n)},t.workspaceToControlRectangle=function(e,n){var r=n.zoom,i=n.screenXDpi/72*r,o=n.screenYDpi/72*r,a=new B.RectangleF(Math.round(e.left*i),Math.round(e.top*o),Math.round(e.width*i),Math.round(e.height*o));return t.contentToControlRectangle(a,n)},t.pageToControlPoint=function(t,e){var n=this.getElementPageCoord(e.element),r=t.x-n.left,i=t.y-n.top;return new B.PointF(Math.round(r),Math.round(i))},t.pageToWorkspacePoint=function(e,n,r){void 0===r&&(r=!1);var i=t.controlToWorkspacePoint(this.pageToControlPoint(e,n),n),o=new B.PointF(i.x,i.y);return!0!==r&&(o=this._transformByContentAnglePageToWs(o,n)),o},t.pageToWhitespace=function(t,e){var n=this.pageToWorkspacePoint(t,e,!0);return this.workspaceToWhiteSpacePoint(n,e)},t.workspaceToPagePoint=function(t,e){var n=this.workspaceToControlPointCorrect(t,e);return this.controlToPagePoint(n,e.element)},t._transformByContentAnglePageToWs=function(t,e){var n=new B.PointF(t.x,t.y),r=e.contentAngle;return r>0&&(n.rotate(-r),90===r?n.translate(0,e.workspaceHeight):180===r?n.translate(e.workspaceWidth,e.workspaceHeight):270===r&&n.translate(e.workspaceWidth,0)),n},t._transformByContentAngleWsToPage=function(t,e){var n=new B.PointF(t.x,t.y),r=e.contentAngle;if(r>0){switch(r){case 0:break;case 90:n.translate(0,-e.workspaceHeight);break;case 180:n.translate(-e.workspaceWidth,-e.workspaceHeight);break;case 270:n.translate(-e.workspaceWidth,0);break;default:throw new Error("Unexpected content angle: "+r)}n.rotate(r)}return n},t.workspaceToControlPointCorrect=function(t,e){var n=this._transformByContentAngleWsToPage(t,e);return this.workspaceToControlPoint(n,e)},t.controlToWorkspaceRectangle=function(e,n){var r=n.zoom,i=1/(r*n.screenXDpi/72),o=1/(r*n.screenYDpi/72),a=t.controlToContentRectangle(e,n);return new B.RectangleF(a.left*i,a.top*o,a.width*i,a.height*o)},t.contentToWhitespaceRectangle=function(t,e){var n=e.rulerEnabled?e.rulerWidth:0,r=e.getViewportLocation();return new B.RectangleF(t.left+r.x-n,t.top+r.y-n,t.width,t.height)},t.workspaceToProduct=function(t,e){return null==e||e.isOrigin()?t.clone():new B.PointF(t.x-e.x,t.y-e.y)},t.productToWorkspace=function(t,e){return null==e||e.isOrigin()?t.clone():new B.PointF(t.x+e.x,t.y+e.y)},t.getElementPageCoord=function(t){var e=t.getBoundingClientRect();return{left:e.left,top:e.top}},t}(),pt=n(411),ft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dt=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},gt=function(t){function e(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null);var i=t.call(this,0,0,0,0,e,n,r)||this;return i._selectionTolerance=15,i._controlPoints=[new B.PointF(e.sourcePoint0.x?e.sourcePoint0.x:0,e.sourcePoint0.y?e.sourcePoint0.y:0),new B.PointF(e.sourcePoint1.x?e.sourcePoint1.x:0,e.sourcePoint1.y?e.sourcePoint1.y:0)],i._makeLineHorizontalWithAngle(),i}return ft(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controlPoints",{set:function(t){this._controlPoints=new Array(new B.PointF(t[0].x,t[0].y),new B.PointF(t[1].x,t[1].y)),this.item.sourcePoint0=this._controlPoints[0],this.item.sourcePoint1=this._controlPoints[1],this._makeLineHorizontalWithAngle(),this.raiseChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.item.width},set:function(t){this.item.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this.item.color},set:function(t){this.item.color=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fixedWidth",{get:function(){return this.item.fixedWidth},set:function(t){this.item.fixedWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"point0",{get:function(){return this._getActualPoint(this._controlPoints[0])},set:function(t){var e=this.getControlBounds();if(0===e.width||0===e.height){var n=this._getActualPoint(this._controlPoints[1]);this._controlPoints=[t.clone(),n],this.item.transform=new B.Transform}else this._makeLineHorizontalWithAngle(),this._setTransformByPoints(this._controlPoints[0],t,this._controlPoints[1])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"point1",{get:function(){return this._getActualPoint(this._controlPoints[1])},set:function(t){var e=this.getControlBounds();if(0===e.width||0===e.height){var n=this._getActualPoint(this._controlPoints[0]);this._controlPoints=[n,t.clone()],this.item.transform=new B.Transform}else this._makeLineHorizontalWithAngle(),this._setTransformByPoints(this._controlPoints[1],t,this._controlPoints[0])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rectangle",{get:function(){var e=t.prototype._getRectangle.call(this);return e.height=this._getActualWidth(),e},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(t){var e=this._getActualWidth();if(!(null==t||e<=0))if(this._isReadyToDraw){var n=this._getItemColorPreviews().colorPreview,r=this.point0,i=this.point1,o=this.isNormalRenderingType?this.item.opacity:1;G.a.drawLine(t,r.x,r.y,i.x,i.y,e,null==n?void 0:n.toString(),o)}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.hitTest=function(e,n){var r=t.prototype.hitTest.call(this,e.clone()),i=ht.workspaceToProduct(e,this.canvas.offset),o=this.canvas.zoom*T.a.screenDpi/72,a=this.rectangle,s=!!n&&a.toRectangleF().contains(e),l=this._getActualWidth(),u=(this._selectionTolerance/o-l)/2,c=this._belongToPiece(this.point0,this.point1,i,l,u<0?0:u);return r.body=!(!s&&!c),r},e.prototype.transformByMatrix=function(t,e,n){void 0===n&&(n=null);var r=this.point0,i=this.point1;this.item.transform=new B.Transform;var o=t.transformPoint(r),a=t.transformPoint(i);this.item.sourcePoint0=o,this.item.sourcePoint1=a,this._controlPoints=[o,a],this._makeLineHorizontalWithAngle(),null!=this.item.parentGroupItem?this.raiseChanging(this.item):this._throttleSizeChanging(),1===t.scaleX&&1===t.scaleY||this.onResized();var s=this.canvas;null!=s&&(this.updateViolationContainerPosition(),this.canvas.updateSelection(),s.redraw())},e.prototype._getColors=function(){return function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(dt(arguments[e]));return t}([this.color],t.prototype._getColors.call(this))},Object.defineProperty(e.prototype,"_areColorPreviewsReady",{get:function(){var t=this._getItemColorPreviews().colorPreview;return null==this.item.color||null!=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return this._areColorPreviewsReady},enumerable:!0,configurable:!0}),e.prototype._getItemColorPreviews=function(){var t=this.isNormalRenderingType?this.item.color:pt.RgbColors.black,e=this._colorPreviewService.getPreview(t);return null!=this.item.color&&null==e&&this._colorPreviewService.subscribeToPreviewLoaded(t,this._onColorPreviewLoaded),{colorPreview:e}},e.prototype._getActualWidth=function(){var t=this.width,e=this.canvas;return this.fixedWidth&&null!=e&&(t/=e.zoom),t},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"width":var r=this.canvas;null!=r&&r.updateSelection();break;case"color":case"fixedWidth":this.canvas.redraw()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._getActualPoint=function(t){var e=new B.PointF(t.x,t.y),n=this.getControlCenter();e.translate(-n.x,-n.y);var r=this.item.transform;return e.scale(r.scaleX,r.scaleY),e.rotate(r.angle),e.translate(r.translateX,r.translateY),e.translate(n.x,n.y),e},e.prototype._setTransformByPoints=function(t,e,n){var r=this.getControlCenter(),i=this._getActualPoint(n),o=new B.PointF((i.x+e.x)/2,(i.y+e.y)/2),a=o.x-r.x,s=o.y-r.y,l=new B.PointF(t.x,t.y).translate(-r.x,-r.y),u=new B.PointF(e.x,e.y).translate(-a,-s).translate(-r.x,-r.y),c=(l.x*u.x+l.y*u.y)/Math.sqrt((l.x*l.x+l.y*l.y)*(u.x*u.x+u.y*u.y));c=B.Clamp(-1,c,1);var h=B.ConvertRadianToDegree(Math.acos(c));u=u.rotate(-h),this.item.transform=new B.Transform(u.x/l.x,u.y/l.y,a,s,h)},e.prototype._belongToPiece=function(t,e,n,r,i){var o=r/2+i;return B.getSquareDistanceToSegment(n,t,e)<=o*o},e.prototype._makeLineHorizontalWithAngle=function(){var t=this._controlPoints[0],e=this._controlPoints[1],n=B.getTriangleAngle(t,new B.PointF(t.x,e.y),e);if(0!==n){var r=(t.x+e.x)/2,i=(t.y+e.y)/2,o=t.distance(e);this._controlPoints[0]=new B.PointF(r-o/2,i),this.item.sourcePoint0=this._controlPoints[0],this._controlPoints[1]=new B.PointF(r+o/2,i),this.item.sourcePoint1=this._controlPoints[1],this.angle=n}},e}(K.a),mt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yt=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},_t=function(t){function e(e,n,r){return void 0===n&&(n=null),t.call(this,e,n,r)||this}return mt(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dashWidth",{get:function(){return this.item.dashWidth},set:function(t){this.item.dashWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"altDashWidth",{get:function(){return this.item.altDashWidth},set:function(t){this.item.altDashWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"altColor",{get:function(){return this.item.altColor},set:function(t){this.item.altColor=t},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(t){var e=this._getActualWidth();if(!(null==t||e<=0))if(this._isReadyToDraw){var n=this._getItemColorPreviews(),r=n.colorPreview,i=n.altColorPreview,o=this.point0,a=this.point1,s=this.dashWidth,l=this.altDashWidth;if(this.fixedWidth){var u=this.canvas.zoom;s/=u,l/=u}G.a.drawDashedLine(t,o.x,o.y,a.x,a.y,e,null==r?void 0:r.toString(),null==i?void 0:i.toString(),s,l,this.item.opacity)}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype._getColors=function(){return function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(yt(arguments[e]));return t}([this.color,this.altColor],t.prototype._getColors.call(this))},e.prototype._getItemColorPreviews=function(){var e=t.prototype._getItemColorPreviews.call(this).colorPreview,n=this._colorPreviewService.getPreview(this.item.altColor);return null!=this.item.altColor&&null==n&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.altColor,this._onColorPreviewLoaded),{colorPreview:e,altColorPreview:n}},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"altColor":case"dashWidth":case"altDashWidth":this.canvas.redraw()}t.prototype._onItemPropertyChanged.call(this,e,n)},e}(gt),vt=(n(580),n(442)),bt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wt=function(t){function e(e,n,r){void 0===n&&(n=null);var i=this;return null!=e?(i=t.call(this,B.Path.ellipse(e.sourceRectangle.left,e.sourceRectangle.top,e.sourceRectangle.width,e.sourceRectangle.height),e,n,null,r)||this)._controlPoints=[new B.PointF(e.sourceRectangle.left,e.sourceRectangle.top),new B.PointF(e.sourceRectangle.right,e.sourceRectangle.bottom)]:i=t.call(this,null,e,n,null,r)||this,i._allowNegativeResize=!1,i}return bt(e,t),e.prototype.hitTest=function(e,n){var r=t.prototype.hitTest.call(this,e.clone()),i=this._getRectangle(),o=e.clone();o.translate(-i.centerX,-i.centerY),o.rotate(-i.angle),o.scale(2/i.width,2/i.height);var a=o.x*o.x+o.y*o.y<1,s=!!n&&i.toRectangleF().contains(e);return r.body=a||s,r},e}(vt.a),Ct=n(464),Pt=n(452),St=n(519),xt=n(491),It=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ot=function(t){function e(e,n,r){return void 0===n&&(n=null),t.call(this,0,0,0,0,e,n,r)||this}return It(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),e.prototype.drawItemHandler=function(t){if(!(null==t||this.item.width<=0))if(this._isReadyToDraw){var e=this.getActualPoints(),n=this._getItemColorPreviews().colorPreview;G.a.drawPolyline(t,e,this.item.width,null==n?void 0:n.toString(),this.item.opacity)}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.hitTest=function(e,n){var r=t.prototype.hitTest.call(this,e.clone()),i=this.canvas.zoom*T.a.screenDpi/72,o=this._getRectangle(),a=!!n&&o.toRectangleF().contains(e),s=this._belongToLine(e,2/i);return r.body=a||s,r},e.prototype.getControlBounds=function(){var t=0,e=0,n=0,r=0,i=this.item.sourcePoints,o=i.length;o>0&&(t=i[0].x,n=i[0].x,e=i[0].y,r=i[0].y);for(var a=1;a<o;a++)t=Math.min(i[a].x,t),n=Math.max(i[a].x,n),e=Math.min(i[a].y,e),r=Math.max(i[a].y,r);var s=n-t,l=r-e;return new B.RectangleF(t,e,s,l)},e.prototype._belongToLine=function(t,e){for(var n=this.getActualPoints(),r=!1,i=this.item.width/2+e,o=i*i,a=1;a<n.length;a++)if(Object(B.getSquareDistanceToSegment)(t,n[a-1],n[a])<=o){r=!0;break}return r},e.prototype.getActualPoints=function(){for(var t=[],e=this.getControlCenter(),n=0;n<this.item.sourcePoints.length;n++)t.push(this._getActualPointFromControlPoint(this.item.sourcePoints[n],e));return t},e.prototype._getActualPointFromControlPoint=function(t,e){var n=new B.PointF(t.x,t.y);n.translate(-e.x,-e.y);var r=this.item.transform;return n.scale(r.scaleX,r.scaleY),n.rotate(r.angle),n.translate(r.translateX,r.translateY),n.translate(e.x,e.y),n},e.prototype.addPoint=function(t){this.insertPoint(t,this.item.sourcePoints.length)},e.prototype.insertPoint=function(t,e){if(e<0||e>this.item.sourcePoints.length)throw new o.f(xt.a);var n=this.getActualPoints();n.splice(e,0,t),this.item.sourcePoints=n,this.item.transform=new B.Transform},e.prototype.setPoint=function(t,e){if(e<0||e>=this.item.sourcePoints.length)throw new o.f(xt.e);var n=this.getActualPoints();n[e]=t,this.item.sourcePoints=n,this.item.transform=new B.Transform,this.raiseChanged()},e.prototype.getPointsCount=function(){return this.item.sourcePoints.length},e.prototype.getPoint=function(t){if(t<0||t>=this.item.sourcePoints.length)throw new o.f(xt.e);return this._getActualPointFromControlPoint(this.item.sourcePoints[t],this.getControlCenter())},e.prototype.removePoint=function(t){if(t<0||t>=this.item.sourcePoints.length)throw new o.f(xt.d);var e=this.item.sourcePoints;e.splice(t,1),this.item.sourcePoints=e},Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return this._areColorPreviewsReady},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_areColorPreviewsReady",{get:function(){var t=this._getItemColorPreviews().colorPreview;return null==this.item.color||null!=t},enumerable:!0,configurable:!0}),e.prototype._getItemColorPreviews=function(){var t=this._colorPreviewService.getPreview(this.item.color);return null!=this.item.color&&null==t&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.color,this._onColorPreviewLoaded),{colorPreview:t}},e.prototype._onItemPropertyChanged=function(t,e){},e.prototype._getBoundsMargin=function(){return this.item.width},e.prototype._addPoint=function(t){var e=this.canvas,n=-1;e&&(n=T.a.screenDpi/72*e.zoom);var r=this.item.sourcePoints;if(r.length>0){var i=r[r.length-1].distance(t);(-1===n||i*n>30)&&r.push(t)}else r.push(t)},e.typeName="PolylineItemHandler",e}(K.a),Tt=n(516),Lt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rt=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Et=function(t){function e(e,n,r){return void 0===n&&(n=null),t.call(this,0,0,0,0,e,n,r)||this}return Lt(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locked",{get:function(){return this.item.locked},set:function(t){this.item.locked=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this.item.cols},set:function(t){this.item.cols=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this.item.rows},set:function(t){this.item.rows=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepX",{get:function(){return this.item.stepX},set:function(t){this.item.stepX=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stepY",{get:function(){return this.item.stepY},set:function(t){this.item.stepY=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalLineColor",{get:function(){return this.item.horizontalLineColor},set:function(t){this.item.horizontalLineColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalLineColor",{get:function(){return this.item.verticalLineColor},set:function(t){this.item.verticalLineColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{get:function(){return this.item.lineWidth},set:function(t){this.item.lineWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fixedLineWidth",{get:function(){return this.item.fixedLineWidth},set:function(t){this.item.fixedLineWidth=t},enumerable:!0,configurable:!0}),e.prototype.getControlBounds=function(){var t=this.item.cols*this.stepX,e=this.item.rows*this.stepY;return new B.RectangleF(this.item.location.x,this.item.location.y,t,e)},e.prototype.drawItemHandler=function(t){if(null!=t)if(this._isReadyToDraw){t.save();var e=this.item.location,n=this.getControlCenter(),r=this._getItemColorPreviews(),i=r.horizontalLineColorPreview,o=r.verticalLineColorPreview,a=this.lineWidth;this.fixedLineWidth&&(a/=this.canvas.zoom);for(var s=a/2/this.item.transform.scaleX,l=a/2/this.item.transform.scaleY,u=this.stepX*this.cols,c=this.stepY*this.rows,h=0;h<=this.rows;h++){var p=e.x-s,f=e.x+u+s,d=e.y+h*this.stepY,g=new B.PointF(p,d).transform(this.item.transform,n),m=new B.PointF(f,d).transform(this.item.transform,n);G.a.drawLine(t,g.x,g.y,m.x,m.y,a,null==i?void 0:i.toString(),this.item.opacity)}for(h=0;h<=this.cols;h++){var y=e.x+h*this.stepX,_=e.y-l,v=e.y+c+l;g=new B.PointF(y,_).transform(this.item.transform,n),m=new B.PointF(y,v).transform(this.item.transform,n),G.a.drawLine(t,g.x,g.y,m.x,m.y,a,null==o?void 0:o.toString(),this.item.opacity)}t.restore()}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype._getColors=function(){return function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Rt(arguments[e]));return t}([this.item.horizontalLineColor,this.item.verticalLineColor],t.prototype._getColors.call(this))},Object.defineProperty(e.prototype,"_areColorPreviewsReady",{get:function(){var t=this._getItemColorPreviews(),e=t.horizontalLineColorPreview,n=t.verticalLineColorPreview;return!(null!=this.item.horizontalLineColor&&null==e||null!=this.item.verticalLineColor&&null==n)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isReadyToDraw",{get:function(){return this._areColorPreviewsReady},enumerable:!0,configurable:!0}),e.prototype._getItemColorPreviews=function(){var t=this._colorPreviewService.getPreview(this.item.horizontalLineColor);null!=this.item.horizontalLineColor&&null==t&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.horizontalLineColor,this._onColorPreviewLoaded);var e=this._colorPreviewService.getPreview(this.item.verticalLineColor);return null!=this.item.verticalLineColor&&null==e&&this._colorPreviewService.subscribeToPreviewLoaded(this.item.verticalLineColor,this._onColorPreviewLoaded),{horizontalLineColorPreview:t,verticalLineColorPreview:e}},e.prototype._onItemPropertyChanged=function(t,e){},e.prototype._getBoundsMargin=function(){var t=this.lineWidth;return this.fixedLineWidth&&(t/=this.canvas.zoom),t},e}(K.a),jt=n(600),Nt=n(747),kt=n(578),At=n(408);function Ft(t,e){void 0!==t&&null!=t&&e(t)}var Bt,Mt,zt,Dt,Ht=n(444);!function(t){t[t.MouseDown=0]="MouseDown",t[t.MouseUp=1]="MouseUp",t[t.MouseMove=2]="MouseMove",t[t.TouchStart=3]="TouchStart",t[t.TouchEnd=4]="TouchEnd",t[t.TouchMove=5]="TouchMove",t[t.KeyDown=6]="KeyDown",t[t.KeyUp=7]="KeyUp",t[t.Wheel=8]="Wheel"}(Bt||(Bt={})),function(t){t.Click="Click",t.Transform="Transform",t.PointerDown="PointerDown",t.Move="Move",t.LongTap="LongTap",t.Key="Key",t.Wheel="Wheel",t.Hover="Hover"}(Mt||(Mt={})),function(t){t.None="None",t.Primary="Primary",t.Secondary="Secondary",t.Tertiary="Tertiary"}(zt||(zt={})),function(t){t.Started="Started",t.InProgress="InProgress",t.Finished="Finished"}(Dt||(Dt={}));var Ut,Wt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Wt(e,t),e}((function(){})),qt=function(){function t(){}return t.getExecutionToken=function(){return new Vt},t.executeSingle=function(t,e,n){var r=this;if(void 0===n&&(n=null),!(t instanceof Vt))throw new Error("token must be acquired using method getExecutionToken");return null!=t.currentExecutionPromise||(t.getContinueTask=n,t.currentExecutionPromise=new Promise((function(n,i){return o=r,a=void 0,l=function(){var r;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,5,6]),[4,e()];case 1:return o.sent(),t.getContinueTask?[4,t.getContinueTask()]:[3,3];case 2:o.sent(),o.label=3;case 3:return n(),[3,6];case 4:return r=o.sent(),i(r),[3,6];case 5:return t.currentExecutionPromise=null,[7];case 6:return[2]}}))},new((s=void 0)||(s=Promise))((function(t,e){function n(t){try{i(l.next(t))}catch(n){e(n)}}function r(t){try{i(l.throw(t))}catch(n){e(n)}}function i(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(n,r)}i((l=l.apply(o,a||[])).next())}));var o,a,s,l}))),t.currentExecutionPromise},t}();!function(t){t[t.idle=0]="idle",t[t.edit=1]="edit",t[t.select=2]="select",t[t.hover=3]="hover",t[t.move=4]="move",t[t.resize=5]="resize",t[t.rotate=6]="rotate"}(Ut||(Ut={})),n(527);var Gt,$t=n(592),Xt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Yt=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Jt=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Zt=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Jt(arguments[e]));return t},Qt=function(t){function e(e,n,r,i,o,a,s){void 0===i&&(i=null);var l=t.call(this,null,r,i,o,a)||this;l._fontRegistryUpdated=null,l._waitLoadFontsDef=null,l._waitLoadFontsLastInnerUpdate=null,l._frontEndUpdateExecutionToken=qt.getExecutionToken(),l._initFrontEndRenderingDef=null,l._staticTextRect=null,l._exitedEditModeEvent=new At.c,l._enteredEditModeEvent=new At.c,l._onStaticTextImageChanged=function(t){var e;null==t.canvas?(l._imageContainer.clear(),null===(e=l.canvas)||void 0===e||e.redraw()):(l._staticTextRect=t.rect,l._imageContainer.updateCanvas(t.canvas))},l._fontRegistry=e,l._textEditorControllerFactory=n,l._colorParser=s;var u=null!=l.item?l.item.sourceRectangle:null;return(null==u||u.isEmpty())&&(u=new B.RectangleF(0,0,10,10)),l.originalPath=B.Path.rectangle(u.left,u.top,u.width,u.height),l.controlPoints=[new B.PointF(u.left,u.top),new B.PointF(u.right,u.bottom)],l._imageContainer=new q.a((function(){return Kt(l,void 0,void 0,(function(){var t,e,n;return Yt(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),null==this.canvas?[2]:(null===(e=this.canvas)||void 0===e||e.redraw(),[4,this.waitUpdate()]);case 1:return r.sent(),null===(n=this.canvas)||void 0===n||n.redraw(),[3,3];case 2:throw t=r.sent(),console.warn("Error in [NewBaseTextItemHandler].ctor ImageContainer loaded",t),t;case 3:return[2]}}))}))})),l._allowNegativeResize=!1,l}return Xt(e,t),e.prototype.isHighlightNeeded=function(){return this.editing},Object.defineProperty(e.prototype,"textEditorController",{get:function(){return this._textEditorController},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isInEdit",{get:function(){var t;return null===(t=this._textEditorController)||void 0===t?void 0:t.isInEdit},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textEditor",{get:function(){var t;return null===(t=this._textEditorController)||void 0===t?void 0:t.activeTextEditor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"editing",{get:function(){return null!=this.textEditor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textCropped",{get:function(){return this.item.checkTextCrop?!(!this.ready||!this.frontEndRenderingReady)&&this._textEditorController.isCropped:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frontEndRenderingReady",{get:function(){var t=null!=this._textWhizz,e=null!=this._textEditorController&&!this._textEditorController.failed,n=null!=this._fontRegistry&&this._fontRegistry.ready&&this._fontRegistry.containsFonts(this.getFonts());return t&&e&&n},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inPlaceEditingEnabled",{get:function(){return this.frontEndRenderingReady&&0==this.item.placeholders.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"exitedEditModeEvent",{get:function(){return this._exitedEditModeEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enteredEditModeEvent",{get:function(){return this._enteredEditModeEvent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorPreviewService",{get:function(){return this._colorPreviewService},enumerable:!0,configurable:!0}),e.prototype.updateText=function(t){this._modifyItem((function(e){e.text=t}))},e.prototype.applyInlineStyle=function(t){var e=this;t&&(Ft(t.color,(function(t){return e.item.color=t})),Ft(t.font,(function(t){Ft(t.postScriptName,(function(t){return e.item.font.postScriptName=t})),Ft(t.allCaps,(function(t){return e.item.font.allCaps=t})),Ft(t.fauxBold,(function(t){return e.item.font.fauxBold=t})),Ft(t.fauxItalic,(function(t){return e.item.font.fauxItalic=t})),Ft(t.size,(function(t){return e.item.font.size=t}))})),Ft(t.leading,(function(t){return e.item.leading=t})),Ft(t.openType,(function(t){return e.item.font.openTypeFeatures=t})),Ft(t.stroke,(function(t){null==e.item.stroke&&(e.item.stroke=new v.pb),Ft(t.color,(function(t){return e.item.stroke.color=t})),Ft(t.size,(function(t){return e.item.stroke.size=t}))})),Ft(t.tracking,(function(t){return e.item.tracking=t})),Ft(t.underline,(function(t){return e.item.underline=t})))},e.prototype.applyParagraphStyle=function(t){var e=this;Ft(t.alignment,(function(t){return e.item.alignment=t}))},e.prototype.isEmpty=function(){var t;return this.item.isEmpty()&&!(null===(t=this._textEditorController)||void 0===t?void 0:t.isInEdit)},e.prototype.isEmptyTextPlaceholder=function(){return this.item.isTextPlaceholder&&$t.a.isTextEmpty(this.item.text)},e.prototype.setTextWhizzModule=function(t,e){this._textWhizz=t,this._fontRegistry=e,null!=this._fontRegistryUpdated&&this._fontRegistryUpdated.resolve()},e.prototype.onTextWhizzInit=function(){t.prototype.onTextWhizzInit.call(this),this.update()},e.prototype.waitUpdate=function(){return Kt(this,void 0,void 0,(function(){var e;return Yt(this,(function(n){switch(n.label){case 0:return this._isDisposed?[2]:(e=[],this.frontEndRenderingReady||(e.push(this.waitInitFrontEndRendering()),this.update()),this.textEditorController&&e.push(this.textEditorController.waitUpdate()),e.push(t.prototype.waitUpdate.call(this)),[4,Promise.all(e)]);case 1:return n.sent(),[2]}}))}))},e.prototype.frontEndUpdate=function(t,e,n){return Kt(this,void 0,void 0,(function(){var r=this;return Yt(this,(function(i){switch(i.label){case 0:return this._isDisposed||null==this._fontRegistry&&null==this.canvas?[2]:(null==this._handlerUpdated&&(this._handlerUpdated=new kt.a),this._isFrontEndRenderingInitialized()?[3,2]:[4,qt.executeSingle(this._frontEndUpdateExecutionToken,(function(){return Kt(r,void 0,void 0,(function(){return Yt(this,(function(t){switch(t.label){case 0:return[4,this.waitInitFrontEndRendering()];case 1:return t.sent(),[2]}}))}))}),(function(){return Kt(r,void 0,void 0,(function(){return Yt(this,(function(r){switch(r.label){case 0:return[4,this._doFrontEndUpdate(t,e,n)];case 1:return r.sent(),[2]}}))}))}))]);case 1:return i.sent(),[3,4];case 2:return[4,this._doFrontEndUpdate(t,e,n)];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))},e.prototype.update=function(t,e,n){this._updateImpl(t,e,n)},e.prototype.updateAsync=function(t,e,n){return Kt(this,void 0,void 0,(function(){return Yt(this,(function(r){switch(r.label){case 0:return[4,this._updateImpl(t,e,n)];case 1:return r.sent(),[2]}}))}))},e.prototype.quickUpdate=function(){this.isVisible()&&this.canvas&&!this.frontEndRenderingReady&&this.update()},e.prototype.setRectangle=function(t,e){var n,r=B.RotatedRectangleF.fromRectangleF(this.getControlBounds()),i=t.getTransform(r);i.equals(this.item.transform)||(this.item.setTransform(i,e),(null===(n=this._textEditorController)||void 0===n?void 0:n.isActive)&&this._transformText(i))},e.prototype.updateRectangle=function(t,e){var n=!1;if(this._modifyItem((function(e){(n=!B.RectangleF.isEqual(e.sourceRectangle,t))&&(e.sourceRectangle=t,e.sourcePath=B.Path.rectangle(t.left,t.top,t.width,t.height))})),null==this.controlPoints||0==this.controlPoints.length)n=!0;else{var r=this.controlPoints[0],i=this.controlPoints[1];B.RectangleF.FromLTRB(r.x,r.y,i.x,i.y).equals(t)||(n=!0)}n&&(this.controlPoints=[new B.PointF(t.left,t.top),new B.PointF(t.right,t.bottom)],this.item.getItemChangedEvent().fire())},e.prototype.redrawActiveText=function(){null!=this.canvas&&null!=this._textEditorController&&this._textEditorController.redrawActiveText()},e.prototype.drawItemHandler=function(t){var e,n;if(null!=t&&null!=this.canvas&&null!=this._textWhizz)if(this._isReadyToDraw){var r=this.ready&&!(null===(e=this._textEditorController)||void 0===e?void 0:e.isStatic)&&this.canvas.isSelectionLocked;if(this._hasVectorMask()&&!r&&(t.save(),this._clip(t)),!this._isMobileTextEditorActive||r){var i=this.isEmptyTextPlaceholder()?.5:1;if(this.renderFill(t,i),!this.ready||(null===(n=this._textEditorController)||void 0===n?void 0:n.isStatic)||r)try{Nt.a.renderTextImage(this,this._imageContainer,null,t,i,Nt.a.staticCanvasMargin)}catch(o){console.error(o)}this.renderStroke(t,i)}this._hasVectorMask()&&!r&&t.restore(),this._drawHandlerEffects(t)}else this.canvas.drawWaitClock(t,this.rectangle.center)},e.prototype.clearImageContainer=function(){this._imageContainer.clear()},e.prototype._endTransform=function(e,n){t.prototype._endTransform.call(this,e,n),e&&n&&this.frontEndRenderingReady&&this.update(null,null,this._getEndTransformTrigger(n))},e.prototype.processInPlaceEditingMouseEvent=function(t,e){return Kt(this,void 0,void 0,(function(){return Yt(this,(function(n){switch(n.label){case 0:if(!this.inPlaceEditingEnabled)throw new o.c("Inplace is not enabled for this item!");return[4,this._textEditorController.processMouseEvent(t,e)];case 1:return[2,n.sent()]}}))}))},e.prototype.processInPlaceEditingKeyEvent=function(t){return Kt(this,void 0,void 0,(function(){return Yt(this,(function(e){switch(e.label){case 0:if(!this.inPlaceEditingEnabled)throw new o.c("Inplace is not enabled for this item!");return t.preventDefault(),t.state===Dt.Finished?[3,2]:[4,this._textEditorController.processKeyEvent(t)];case 1:return[2,e.sent()];case 2:return[2,!0]}}))}))},e.prototype.enterEditMode=function(){if(!this.inPlaceEditingEnabled)throw new o.c("Inplace is not enabled for this item!");return this._textEditorController.enterEditMode(0,0)},e.prototype.exitEditMode=function(t){if(void 0===t&&(t=!1),!this.inPlaceEditingEnabled)throw new o.c("Inplace is not enabled for this item!");return this._textEditorController.exitEditMode(t)},e.prototype.getTextForRendering=function(){return this.isEmptyTextPlaceholder()?this.item.originalText:this.item.text},e.prototype.dispose=function(){var e,n,r;null===(e=this._textEditorController)||void 0===e||e.exitedEditModeEvent.remove(this._onTextManagerExitedEditMode),null===(n=this._textEditorController)||void 0===n||n.enteredEditModeEvent.remove(this._onTextManagerEnteredEditMode),null===(r=this._textEditorController)||void 0===r||r.dispose(),this._textEditorController=null,this._imageContainer.dispose(),t.prototype.dispose.call(this)},e.prototype.getFonts=function(){return Zt([this.item.font.postScriptName],b.i(this.item.text),b.i(this.item.originalText))},e.prototype._isReady=function(){var e;return t.prototype._isReady.call(this)&&(null===(e=this._textEditorController)||void 0===e?void 0:e.ready)},e.prototype._drawHandlerEffects=function(t){},e.prototype._getColors=function(){var e;return Zt([this.item.color],null===(e=this.item.colorPalette)||void 0===e?void 0:e.toArray(),t.prototype._getColors.call(this))},e.prototype._updateImpl=function(t,e,n){return Kt(this,void 0,void 0,(function(){var r,i=this;return Yt(this,(function(o){switch(o.label){case 0:return this.isVisible()||"text"==n?(r=function(){var t,n;"function"==typeof e&&e(),null===(t=i.canvas)||void 0===t||t.updateSelection(!0),null===(n=i.canvas)||void 0===n||n.redrawDesign()},[4,this.frontEndUpdate(t,r,n)]):[3,2];case 1:return o.sent(),[3,3];case 2:"function"==typeof t&&t(),o.label=3;case 3:return[2]}}))}))},e.prototype._onItemPropertyChanged=function(e,n){var r;switch(n){case"text":null===(r=this.textEditorController)||void 0===r||r.initialize(),this.update(null,null,"text");break;case"font":case"underline":case"color":case"alignment":case"leading":case"tracking":case"verticalScale":case"horizontalScale":case"previewScale":case"stroke":case"shadow":case"baselineShift":case"overlapLinesEnabled":case"maxLineCount":case"maxLineLength":this.update();break;case"checkTextCrop":!this.frontEndRenderingReady&&e.checkTextCrop&&this.update()}"checkTextCrop"!==n&&t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._onItemVisibilityChanged=function(){var e,n,r;t.prototype._onItemVisibilityChanged.call(this),(null===(e=this.canvas)||void 0===e?void 0:e.isItemHandlerSelected(this))&&(this.isVisible()?null===(n=this._textEditorController)||void 0===n||n.updateItemHandler():null===(r=this._textEditorController)||void 0===r||r.clearText())},e.prototype._setDataItem=function(t,e){throw new o.e("NewBaseTextItemHandler._setDataItem")},e.prototype._createDataInstance=function(t){throw new o.e("NewBaseTextItemHandler._createDataInstance")},e.prototype._onAddedOnCanvas=function(e){var n;this._textWhizz=e.textWhizz,t.prototype._onAddedOnCanvas.call(this,e),null===(n=this._textEditorController)||void 0===n||n.bindToCanvas(e)},e.prototype._onRemovedFromCanvas=function(e){var n;t.prototype._onRemovedFromCanvas.call(this,e),null===(n=this._textEditorController)||void 0===n||n.unbindFromCanvas()},e.prototype._transformText=function(t){this._textEditorController.transformText(t)},e.prototype._getBoundsMargin=function(){return 2*this._getActualBorderWidth()},e.prototype.renderFill=function(t,e){var n=this.item,r=this.rectangle,i=this._getItemColorPreviews().fillColorPreview;G.a.fillRectangle(t,r,null==i?void 0:i.toString(),n.opacity*e)},e.prototype.renderStroke=function(t,e){var n=this._getActualBorderWidth();if(!(n<=0)){var r=this.item,i=this.rectangle;i.width+=n,i.height+=n;var o=B.Path.rotatedRectangle(i),a=this._getItemColorPreviews(),s=a.borderColorPreview,l=a.altBorderColorPreview;G.a.drawStroke(t,o,i.center,new B.Transform,n,s.toString(),null==l?void 0:l.toString(),r.opacity*e,r.dash)}},e.prototype._getEndTransformTrigger=function(t){return"frame"},e.prototype._onFrontEndRenderingInitialized=function(){},e.prototype._initFrontEndRendering=function(){return Kt(this,void 0,void 0,(function(){return Yt(this,(function(t){switch(t.label){case 0:return this._textEditorController=this._textEditorControllerFactory.create(this,this._textWhizz),[4,this._textEditorController.initialize()];case 1:return t.sent(),this._textEditorController.add_staticTextImageChanged(this._onStaticTextImageChanged),this._textEditorController.exitedEditModeEvent.add(this._onTextManagerExitedEditMode.bind(this)),this._textEditorController.enteredEditModeEvent.add(this._onTextManagerEnteredEditMode.bind(this)),this._textEditorController.bindToCanvas(this.canvas),this._onFrontEndRenderingInitialized(),[2]}}))}))},e.prototype._onTextManagerEnteredEditMode=function(){this._enteredEditModeEvent.notify(this),this.canvas.redrawActiveTexts()},e.prototype._onTextManagerExitedEditMode=function(){this._exitedEditModeEvent.notify(this)},e.prototype._getPreviewScaleLimits=function(){var t=null,e=null;return null==this.canvas||null==this.canvas.maxFontSize||isNaN(this.canvas.maxFontSize)||(t=this.canvas.maxFontSize/this.item.font.size),null==this.canvas||null==this.canvas.minFontSize||isNaN(this.canvas.minFontSize)||(e=this.canvas.minFontSize/this.item.font.size),{min:e,max:t}},e.prototype.waitInitFrontEndRendering=function(){return Kt(this,void 0,void 0,(function(){var t,e,n,r,i,o;return Yt(this,(function(a){switch(a.label){case 0:return null!=this._fontRegistry&&null!=this._textEditorController?[2]:null!=this._initFrontEndRenderingDef?[2,this._initFrontEndRenderingDef.promise]:(this._initFrontEndRenderingDef=new kt.a,[4,this._waitFontRegistryInitialized()]);case 1:a.sent(),a.label=2;case 2:a.trys.push([2,7,8,9]),t=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.getFonts()),e=t.next(),a.label=3;case 3:return e.done?[3,6]:(n=e.value,this._fontRegistry.containsFonts([n])?[3,5]:[4,this._fontRegistry.loadFonts([n])]);case 4:a.sent(),a.label=5;case 5:return e=t.next(),[3,3];case 6:return[3,9];case 7:return r=a.sent(),i={error:r},[3,9];case 8:try{e&&!e.done&&(o=t.return)&&o.call(t)}finally{if(i)throw i.error}return[7];case 9:return[4,this._initFrontEndRendering()];case 10:return a.sent(),this._initFrontEndRenderingDef.resolve(),this._initFrontEndRenderingDef=null,[2]}}))}))},e.prototype._waitFontRegistryInitialized=function(){return null!=this._fontRegistry?Promise.resolve():(null==this._fontRegistryUpdated&&(this._fontRegistryUpdated=new kt.a),this._fontRegistryUpdated.promise)},e.prototype._pathToTextWhizzPath=function(t){return Object(Ht.d)(this._textWhizz,t)},Object.defineProperty(e.prototype,"_isMobileTextEditorActive",{get:function(){return this.textEditor instanceof jt.a},enumerable:!0,configurable:!0}),e.prototype._beforeFrontEndUpdate=function(){var t=this;if(!this.item.transform.isEmpty){var e=this.getControlCenter(),n=this.item.transform.clone();n.setAngle(0),this._modifyItem((function(r){var i;t._applyTransform(r,n,e),null!=(null===(i=r.mask)||void 0===i?void 0:i.vectorMask)&&(r.mask.vectorMask=t._getTransformedClippingPath(n)),r.transform.clear({keepAngle:!0,supressOnChanged:!0})}))}},e.prototype._isFrontEndRenderingInitialized=function(){return null!=this._textEditorController&&null!=this._fontRegistry},e.prototype._doFrontEndUpdate=function(t,e,n){return Kt(this,void 0,void 0,(function(){var r,i=this;return Yt(this,(function(o){switch(o.label){case 0:return this._isDisposed||null==this.canvas?(null!=this._handlerUpdated&&(this._handlerUpdated.resolve(),this._handlerUpdated=null),[2]):(r=function(){return Kt(i,void 0,void 0,(function(){var r;return Yt(this,(function(i){switch(i.label){case 0:"function"==typeof t&&t(),this._beforeFrontEndUpdate(),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._textEditorController.updateText(n)];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),console.log(this._textWhizz.getExceptionMessage(r)),console.log(this._textWhizz.getExceptionName(r)),r;case 4:return"function"==typeof e&&e(),null!=this._handlerUpdated&&(this._handlerUpdated.resolve(),this._handlerUpdated=null),[2]}}))}))},this.frontEndRenderingReady?[4,r()]:[3,2]);case 1:return o.sent(),[3,4];case 2:return[4,this._waitLoadFonts(r)];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},e.prototype._waitLoadFonts=function(t){var e=this;if(this._waitLoadFontsLastInnerUpdate=t,null!=this._waitLoadFontsDef)return this._waitLoadFontsDef.promise;this._waitLoadFontsDef=new kt.a;var n=new Array;return n.push(this._fontRegistry.loadFonts(this.getFonts())),Promise.all(n).then((function(){e._waitLoadFontsLastInnerUpdate&&e._waitLoadFontsLastInnerUpdate(),e._waitLoadFontsDef.resolve(),e._waitLoadFontsDef=null})).catch((function(t){e._waitLoadFontsDef.reject(t),e._waitLoadFontsDef=null})),this._waitLoadFontsDef.promise},e.prototype._needToDrawBaseline=function(){if(this.isInEdit&&this.textEditor.disableDrawBaseline)return!1;var t=this._getBaselineDrawStates(),e=this._getCurrentState();return!!t.includes(e)||void 0},e.prototype._getBaselineDrawStates=function(){return[]},e.prototype._getCurrentState=function(){return this.isInEdit?Ut.edit:this.canvas.isItemHandlerSelected(this)?this.canvas.isSelectionResizing?Ut.resize:this.canvas.isSelectionDragging?Ut.move:this.canvas.isSelectionRotating?Ut.rotate:Ut.select:this.canvas.hoverHandler.currentHandler==this?Ut.hover:Ut.idle},e.typeName="NewBaseTextItemHandler",e}(vt.a),te=n(469),ee=function(){function t(t){var e=this;void 0===t&&(t=null),this._selectionModifier=t,this._cumulativeDelta=new B.PointF(0,0),this._resizeIndex=null,this._resizeOrigin=null,this._allowNegativeResize=null,this._itemHandlerResizeStartRects=null,this._state=ye.Idle,this.startMovingByPoint=function(t,n){e._checkStartArguments("startMovingByPoint"),e._setStartParams(n,t),e._setState(ye.Drag)},this.updateMovingByPoint=function(t){var n,r,i,o,a;e._checkUpdateArguments("updateMove",ye.Drag,t.finished);var s=t.point,l=t.finished,u=null!==(n=e._lastPoint)&&void 0!==n?n:e._startPoint,c=new B.PointF(s.x-e._startPoint.x,s.y-e._startPoint.y);if(null!=(null===(r=e._selectionModifier)||void 0===r?void 0:r.beforeMovePerformed)){var h={delta:c,momentDelta:new B.PointF(s.x-u.x,s.y-u.y),startPoint:e._startPoint,startRectangle:e._startRectangle};c=null===(i=e._selectionModifier)||void 0===i?void 0:i.beforeMovePerformed(h)}var p=new B.PointF(e._startPoint.x+c.x-u.x,e._startPoint.y+c.y-u.y);null===(o=t.allowMoveHorizontal)||void 0===o||o||(p.x=0),null===(a=t.allowMoveVertical)||void 0===a||a||(p.y=0),e._lastPoint=new B.PointF(u.x+p.x,u.y+p.y);var f=e._rectangle.clone();f.centerX=e._rectangle.centerX+p.x,f.centerY=e._rectangle.centerY+p.y,e._updateRectangle(f,l),e._rectangleCenterChanged.notify({delta:p.clone(),finished:l})},this.startResizingByPoint=function(t,n,r,i,a){if(e._checkStartArguments("startResizingByPoint"),null==r||null==i)throw e._reset(),new o.a("SelectionRectangleHandler.startResize: resizeIndex and allowNegativeResize cannot be null!");e._resizeIndex=r,e._allowNegativeResize=i,e._setStartParams(n,t),e._setState(ye.Resize);var s=new B.PointF(e._startRectangle.center.x-Ce.cw[e._resizeIndex]*e._startRectangle.width/2,e._startRectangle.center.y-Ce.ch[e._resizeIndex]*e._startRectangle.height/2);e._resizeOrigin=s.rotateAt(e._startRectangle.angle,e._startRectangle.center),e._itemHandlerResizeStartRects=e._getItemHandlersRects(a)},this._setState=function(t){e._state!==t&&(e._state=t,e._stateChanged.notify(t))},this._reset=function(){e._lastPoint=null,e._startPoint=null,e._startRectangle=null,e._resizeIndex=null,e._resizeOrigin=null,e._cumulativeDelta.x=0,e._cumulativeDelta.y=0,e._setState(ye.Idle)},this._rectangleChanged=new At.a,this._rectangleAngleChanged=new At.a,this._rectangleResized=new At.a,this._rectangleCenterChanged=new At.a,this._stateChanged=new At.a,this._checkStartArguments=function(t){try{if(e._state!==ye.Idle)throw new o.a("SelectionRectangleHandler."+t+": cannot start operation because "+ye[e._state]+" operation is in progress!")}catch(n){throw e._reset(),n}},this._checkUpdateArguments=function(t,n,r){try{if(null==e._rectangle)throw new o.a("SelectionRectangleHandler."+t+": rectangle must be defined");if(null==e._startRectangle||e._state!==n)throw new o.a("SelectionRectangleHandler."+t+": "+ye[e._state]+" operation haven't started");if(r&&e._state===ye.Idle)throw new o.a("SelectionRectangleHandler."+t+": "+ye[ye.Idle]+" cannot be finished")}catch(i){throw e._reset(),i}}}return Object.defineProperty(t.prototype,"rectangle",{get:function(){return this._rectangle},enumerable:!0,configurable:!0}),t.prototype.startRotatingByPoint=function(t,e){this._checkStartArguments("startRotatingByPoint"),this._setStartParams(e,t),this._setState(ye.Rotate)},t.prototype.updateRotatingByPoint=function(t){var e;this._checkUpdateArguments("updateRotation",ye.Rotate,t.finished);var n=t.point,r=t.tolerance,i=t.rotationStep,o=t.finished,a=n.clone(),s=this._startPoint.clone(),l=this._rectangle.clone(),u=new B.PointF(l.centerX,l.centerY),c=Object(B.getTriangleAngle)(a,s,u);if(!Object(B.EqualsOfFloatNumbers)(c,0)){var h=c=Object(B.normalizeAngle)(this._startRectangle.angle+c),p=c%i;if(p<r?h=i*Math.floor(c/i):p>i-r&&(h=i*Math.floor(c/i+1)),l.angle=Object(B.normalizeAngle)(h),null!=(null===(e=this._selectionModifier)||void 0===e?void 0:e.beforeRotatePerformed)){var f={currentRect:l,previousRectangle:this._rectangle};l=this._selectionModifier.beforeRotatePerformed(f)}var d={angle:l.angle-this._rectangle.angle,origin:l.center,finished:o};this._updateRectangle(l,o),this._rectangleAngleChanged.notify(d)}},t.prototype._getItemHandlersRects=function(t){var e=[],n=function(t){e.push({itemType:t.item.type,startRectangle:t.rectangle})};return t.forEach((function(t){t instanceof it?t.getNestedItemHandlers(!0).forEach(n):n(t)})),e},t.prototype.updateResizingByPoint=function(t,e){var n;void 0===e&&(e=null),this._checkUpdateArguments("updateResize",ye.Resize,t.finished);var r=t.point,i=t.arbitraryResize,o=t.finished;null==r&&(r=this._lastPoint),this._lastPoint=r;var a,s=this._startRectangle,l=this._rectangle.clone(),u=new B.PointF(r.x-s.centerX,r.y-s.centerY);u.rotate(-l.angle);var c=new B.PointF(this._startPoint.x-s.centerX,this._startPoint.y-s.centerY);c.rotate(-l.angle);var h=u.translate(-c.x,-c.y),p=1,f=1;if(i)l.width=s.width+h.x*Ce.cw[this._resizeIndex],l.height=s.height+h.y*Ce.ch[this._resizeIndex],6!==this._resizeIndex&&5!==this._resizeIndex||(p=-1,f=-1),1===this._resizeIndex&&(p=-1,f=-1),2===this._resizeIndex&&(p=1,f=-1),4===this._resizeIndex&&(p=-1,f=1);else{var d=h.x*Ce.cw[this._resizeIndex]/s.width,g=h.y*Ce.ch[this._resizeIndex]/s.height,m=d<g?d:g;h.x=s.width*m,h.y=s.height*m,l.width=s.width+h.x,l.height=s.height+h.y}if(this._allowNegativeResize||l.width>=0&&l.height>=0){if((a=new B.PointF(h.x/2*Ce.cw[this._resizeIndex],h.y/2*Ce.ch[this._resizeIndex])).rotate(l.angle),l.centerX=s.centerX+a.x*p,l.centerY=s.centerY+a.y*f,i){var y=a=new B.PointF(s.centerX,s.centerY);y.rotate(-l.angle),y.x=y.x+h.x/2*Ce.cw[this._resizeIndex]*Ce.cw[this._resizeIndex],y.y=y.y+h.y/2*Ce.ch[this._resizeIndex]*Ce.ch[this._resizeIndex],y.rotate(l.angle),l.centerX=y.x,l.centerY=y.y}}else{var _=new B.PointF(-Ce.cw[this._resizeIndex]*this._rectangle.width/2,-Ce.ch[this._resizeIndex]*this._rectangle.height/2);if(_.rotate(this._rectangle.angle),_.translate(this._rectangle.centerX,this._rectangle.centerY),l.center=_,i)l.width=Math.max(l.width,1),l.height=Math.max(l.height,1);else{var v=s.width/s.height;v>=1?(l.width=Math.max(l.width,1*v),l.height=Math.max(l.height,1)):(l.width=Math.max(l.width,1),l.height=Math.max(l.height,1/v))}var b=new B.PointF(Ce.cw[this._resizeIndex]*l.width/2,Ce.ch[this._resizeIndex]*l.height/2);b.rotate(l.angle),l.centerX+=b.x,l.centerY+=b.y}if(null!=(null===(n=this._selectionModifier)||void 0===n?void 0:n.beforeResizePerformed)){var w={arbitraryResize:t.arbitraryResize,currentRect:l,previousRectangle:this._rectangle,resizeIndex:t.resizeIndex,startRectangle:this._startRectangle,startItemHandlersRects:this._itemHandlerResizeStartRects,rectangleItemHandlers:e};l=this._selectionModifier.beforeResizePerformed(w)}Object(B.EqualsOfFloatNumbers)(l.width,0)&&(l.width=1),Object(B.EqualsOfFloatNumbers)(l.height,0)&&(l.height=1);var C=l.width/this._rectangle.width,P=l.height/this._rectangle.height,S={finished:o,origin:this._resizeOrigin,scaleX:C,scaleY:P,angle:l.angle};this._updateRectangle(l,o),this._rectangleResized.notify(S)},t.prototype.startMove=function(t){this._checkStartArguments("startMove"),this._setStartParams(t,null),this._setState(ye.Drag)},t.prototype.move=function(t){var e,n,r,i;if(this._checkUpdateArguments("move",ye.Drag,t.finished),this._cumulativeDelta.x+=t.delta.x,this._cumulativeDelta.y+=t.delta.y,null!=(null===(e=this._selectionModifier)||void 0===e?void 0:e.beforeMovePerformed)){var o={delta:this._cumulativeDelta,momentDelta:t.delta,startPoint:this._startPoint,startRectangle:this._startRectangle};this._cumulativeDelta=null===(n=this._selectionModifier)||void 0===n?void 0:n.beforeMovePerformed(o)}null===(r=t.allowMoveHorizontal)||void 0===r||r||(this._cumulativeDelta.x=0),null===(i=t.allowMoveVertical)||void 0===i||i||(this._cumulativeDelta.y=0);var a=this._rectangle.clone();t.finished||(a.centerX=this._startRectangle.centerX+this._cumulativeDelta.x,a.centerY=this._startRectangle.centerY+this._cumulativeDelta.y);var s=new B.PointF(a.centerX-this._rectangle.centerX,a.centerY-this._rectangle.centerY);this._updateRectangle(a,t.finished),this._rectangleCenterChanged.notify({delta:s,finished:t.finished})},t.prototype._updateRectangle=function(t,e){this._rectangle=t;var n={rectangle:t,finished:e};this._rectangleChanged.notify(n),e&&this._reset()},t.prototype.addRectangleChanged=function(t){this._rectangleChanged.add(t)},t.prototype.removeRectangleChanged=function(t){this._rectangleChanged.remove(t)},t.prototype.addRectangleAngleChanged=function(t){this._rectangleAngleChanged.add(t)},t.prototype.removeRectangleAngleChanged=function(t){this._rectangleAngleChanged.remove(t)},t.prototype.addRectangleResized=function(t){this._rectangleResized.add(t)},t.prototype.removeRectangleResized=function(t){this._rectangleResized.remove(t)},t.prototype.addRectangleMoved=function(t){this._rectangleCenterChanged.add(t)},t.prototype.removeRectangleMoved=function(t){this._rectangleCenterChanged.remove(t)},t.prototype.addStateChanged=function(t){this._stateChanged.add(t)},t.prototype.removeStateChanged=function(t){this._stateChanged.remove(t)},t.prototype._setStartParams=function(t,e){this._rectangle=t,this._startRectangle=t,null!=e&&(this._startPoint=e)},t}();!function(t){t[t.page=0]="page",t[t.workspace=1]="workspace"}(Gt||(Gt={}));var ne=function(){function t(t,e){this._selectionHandler=t,this._hitTestManager=e}return t.prototype.hitTest=function(t){var e;if(!this._selectionHandler.enabled)return{};var n,r,i=this._selectionHandler.visibleRectangle,o=this._hitTestManager.getItemHandlersByHitTest(t,Gt.workspace);if(null==i)return{selection:0===o.length};var a=this._selectionHandler.selectedItemHandlers;n=a.length>1?a.toArray().reduce((function(t,e){return Math.min(t,e.getSelectionTolerance())}),a.getItem(0).getSelectionTolerance()):null!==(e=null==(r=a.getItem(0))?void 0:r.getSelectionTolerance())&&void 0!==e?e:0;var s=1===a.length&&this._selectionHandler.currentItemHandler instanceof gt,l=this._hitTestManager.hitTestSelection(i,t,s,n),u=!1;if(r instanceof Z.a){var c=r;if(r.editing&&o[0]==r&&(l.selection=!1),c.isContentUpdating()&&l.body&&!l.resize)return l.drag=!0,l;u=r.editing&&r.isCoverMode()}r instanceof Qt&&r.isInEdit&&(l.resize=!1,l.rotate=!1,l.body=!1);var h=this._selectionHandler.manipulationPermissions;if(l.rotate=l.rotate&&h.allowRotate&&!u&&this._selectionHandler.allowManipulation,l.resize){var p=l.resizeIndex,f=Se.isEdgeResizeGrip(p)&&this._getEdgeResize(h,r),d=Se.isCornerResizeGrip(p)&&this._getCornerResize(h,r,!1,v.hb.arbitrary),g=Se.isCornerResizeGrip(p)&&this._getCornerResize(h,r,!0,v.hb.arbitrary),m=Se.isCornerResizeGrip(p)&&this._getCornerResize(h,r,!1,v.hb.proportional),y=Se.isCornerResizeGrip(p)&&this._getCornerResize(h,r,!0,v.hb.proportional);l.arbitraryResize=f||d,l.cornerArbitraryResize=d||g,l.cornerProportionalResize=m||y,l.proportionalResize=m&&!s,l.resize=l.arbitraryResize||l.proportionalResize}return l.dragX=l.body&&h.allowMoveHorizontal&&this._selectionHandler.allowManipulation,l.dragY=l.body&&h.allowMoveVertical&&this._selectionHandler.allowManipulation,l.drag=l.dragX||l.dragY,l},t.prototype._getEdgeResize=function(t,e){return!(null!=e&&"PlainTextItemHandler"===e.getTypeName()||!this._selectionHandler.allowManipulation)&&t.resizeGrips.edge},t.prototype._getCornerResize=function(t,e,n,r){if(r===v.hb.arbitrary&&null!=e&&"PlainTextItemHandler"===e.getTypeName()||!this._selectionHandler.allowManipulation)return!1;var i=t.resizeGrips;return null!=i.corner&&0!==i.corner.length&&(n&&i.corner.length>1?i.corner[1]:i.corner[0])===r},t}(),re=n(436),ie=n(440);function oe(t){return t instanceof Pt.b&&!t.item.source.isVector}function ae(t){return t instanceof Z.a?t.content:t}function se(t){return t instanceof it?t.getNestedItemHandlers():[t]}function le(t,e){var n,r,i,o;return{width:null!==(r=t.startRectangle.width/(null===(n=e.startRectangle)||void 0===n?void 0:n.width))&&void 0!==r?r:e.rectangle.width,height:null!==(o=t.startRectangle.height/(null===(i=e.startRectangle)||void 0===i?void 0:i.height))&&void 0!==o?o:e.rectangle.height}}var ue,ce,he,pe=function(){function t(t,e){this._length=t,this._center=e}return Object.defineProperty(t.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0}),t.fromAxisX=function(e){return new t(e.width,e.centerX)},t.fromAxisY=function(e){return new t(e.height,e.centerY)},t}(),fe=function(){function t(t,e){this._start=t,this._target=e}return Object.defineProperty(t.prototype,"start",{get:function(){return this._start},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),t.fromAxisX=function(t,e){return{start:pe.fromAxisX(t.startRectangle),target:pe.fromAxisX(e)}},t.fromAxisY=function(t,e){return{start:pe.fromAxisY(t.startRectangle),target:pe.fromAxisY(e)}},t}(),de=function(){function t(){}return t.prototype.applyTo=function(t,e,n){var r=t.clone();if(null==e.rectangleItemHandlers||!function(t,e){var n=t.height-e.previousRectangle.height,r=t.width-e.previousRectangle.width,i=Math.sign(r*t.width);return Math.sign(n*t.height)>0||i>0}(t,e))return r;var i=this._getHandlersToConstrain(e.rectangleItemHandlers);return 0==i.length?r:(r=this._applyToX(t,e,i,n),r=this._applyToY(r,e,i,n))},t.prototype._applyToX=function(t,e,n,r){return this._applyToAxis(t,e,n,r,(function(t){return t.width}),(function(t){return t.dpiX}),fe.fromAxisX,pe.fromAxisX,(function(t,e){t.width=e.length,t.centerX=e.center}))},t.prototype._applyToY=function(t,e,n,r){return this._applyToAxis(t,e,n,r,(function(t){return t.height}),(function(t){return t.dpiY}),fe.fromAxisY,pe.fromAxisY,(function(t,e){t.height=e.length,t.centerY=e.center}))},t.prototype._applyToAxis=function(t,e,n,r,i,o,a,s,l){var u=t.clone(),c=this._getMinDpiAfterResizeImageInfo(n,i(t),e,i,o),h=c.handler,p=c.dpi,f=c.sizeRatioToSelection;if(null==h.startRectangle)return u;var d=h.item.source,g=i(Cn.getImageSizeInPoints(d)),m=Object(re.e)(g,o(d),i(e.startRectangle)/f);return p<r&&l(u,this._constrainAxis(a(e,t),s(h.startRectangle),{length:g,dpi:o(d),lengthRatioToSelection:f},m,r)),u},t.prototype._constrainAxis=function(t,e,n,r,i){var o=t.target,a=Math.abs(t.target.length)<Math.abs(t.start.length);if(r<i)return a||(o=new pe(t.start.length*Math.sign(t.target.length),t.start.center*Math.sign(t.target.length))),o;var s=n.length*n.lengthRatioToSelection*Math.sign(t.target.length)*n.dpi/i,l=Math.sign(t.target.center-e.center);return new pe(Object(re.i)(s,t.target.length),e.center+(s-e.length)/2*l)},t.prototype._getMinDpiAfterResizeImageInfo=function(t,e,n,r,i){var o,a,s={handler:t[0],dpi:1/0,sizeRatioToSelection:0};try{for(var l=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),u=l.next();!u.done;u=l.next()){var c=u.value,h=r(le(n,c)),p=e/h,f=c.item.source,d=r(Cn.getImageSizeInPoints(f)),g=Object(re.e)(d,i(f),p);g<s.dpi&&(s.handler=c,s.dpi=g,s.sizeRatioToSelection=h)}}catch(m){o={error:m}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}return s},t.prototype._getHandlersToConstrain=function(t){return Object(ie.h)(t.map(se)).map(ae).filter(oe).map((function(t){return t}))},t}(),ge=function(){function t(t,e,n){this._selectionHandler=t,this._canvas=e,this._snapLinesHandler=n,this._minDpiResizeConstraint=new de}return Object.defineProperty(t.prototype,"ignoreSnapLines",{set:function(t){this._ignoreSnapLines=t},enumerable:!0,configurable:!0}),t.prototype.beforeMovePerformed=function(t){var e,n=this._canvas.contentEditingPlaceholderItemHandler,r=t.delta;if(this._ignoreSnapLines)this._snapLinesHandler.resetActiveLines();else if(null==this._canvas.contentEditingPlaceholderItemHandler){var i=this._selectionHandler.manipulationPermissions;t.border=this._selectionHandler.border,r=this._snapLinesHandler.constrainMoveDataToSnapLines(t,this._canvas,i.allowMoveHorizontal,i.allowMoveVertical)}var o=this.getRectWithFrames(t.startRectangle);return null==n?r=this._constrainMoveDataToRegion(o.bounds,r):n.item.isCoverMode&&(r=this._constrainMoveDataToPlaceholderCover(t.startRectangle,n.rectangle,r)),null!==(e=null!=r?r:t.delta)&&void 0!==e?e:t.momentDelta},t.prototype.beforeResizePerformed=function(t){var e,n,r=null,i=this._canvas.contentEditingPlaceholderItemHandler;null!=i&&i.item.isCoverMode&&(r=this._constrainResizeDataToPlaceholderCover(t.currentRect,t.startRectangle,i.rectangle,t.resizeIndex));var o=this._getMinSizeConstraintConfiguration(t.startRectangle,t.startItemHandlersRects),a=o.minWidth,s=o.minHeight;r=this._constrainResizeDataToMinSize(t.startRectangle,null!=r?r:t.currentRect,t.arbitraryResize,t.resizeIndex,a,s),null==this._canvas.contentEditingPlaceholderItemHandler&&(r=this._constrainResizeDataToSnapLines(t,null!=r?r:t.currentRect));var l=null===(n=null===(e=this._canvas.viewer.configuration)||void 0===e?void 0:e.handlers)||void 0===n?void 0:n.imageMinDpi;return null!=l&&(r=this._minDpiResizeConstraint.applyTo(null!=r?r:t.currentRect,t,l)),r=null!=r?r:t.currentRect,this._validateRectRelativeToRegion(r)?r:t.previousRectangle},t.prototype.beforeRotatePerformed=function(t){return this._validateRectRelativeToRegion(t.currentRect)?t.currentRect:t.previousRectangle},t.prototype.getRectWithFrames=function(t){for(var e=this._selectionHandler.selectedItemHandlers,n=this.getRectangleWithBorder(t),r=0;r<e.length;r++){var i=e.getItem(r);if(null!=i&&i instanceof Z.a){var o=i.getRectangleIncludingFrames(),a=K.a.transformRectangleByTwoRectanglesDiff(o,this._selectionHandler.rectangle,t);n=B.RotatedRectangleF.union(a,n)}}return n},t.prototype.getRectangleWithBorder=function(t){var e=this._selectionHandler.border;return Object(re.f)(t,e)},Object.defineProperty(t.prototype,"_region",{get:function(){return this._selectionHandler.region},enumerable:!0,configurable:!0}),t.prototype._validateRectRelativeToRegion=function(t){if(!this._canvas.suppressOutOfRegionManipulation||null!=this._canvas.contentEditingPlaceholderItemHandler||null==this._region)return!0;var e=this.getRectWithFrames(t).bounds;return this._region.containsRectangle(e)},t.prototype._constrainMoveDataToRegion=function(t,e){return this._canvas.suppressOutOfRegionManipulation&&null!=this._region?(t.left+e.x<this._region.left&&(e.x=this._region.left-t.left),t.top+e.y<this._region.top&&(e.y=this._region.top-t.top),t.right+e.x>this._region.left+this._region.width&&(e.x=this._region.left+this._region.width-t.right),t.bottom+e.y>this._region.top+this._region.height&&(e.y=this._region.top+this._region.height-t.bottom),e):e},t.prototype._constrainMoveDataToPlaceholderCover=function(t,e,n){var r=e.angle;e.angle=0;var i=e.bounds,o=t.clone();o.rotateAt(-r,e.center);var a=o.bounds;return n.rotate(-r),a.left+n.x>i.left&&(n.x=i.left-a.left),a.top+n.y>i.top&&(n.y=i.top-a.top),a.right+n.x<i.left+i.width&&(n.x=i.left+i.width-a.right),a.bottom+n.y<i.top+i.height&&(n.y=i.top+i.height-a.bottom),n.rotate(r),n},t.prototype._constrainResizeDataToPlaceholderCover=function(t,e,n,r){var i=t.angle,o=n.angle,a=Object(B.EqualsOfFloatNumbers)(90,Object(B.normalizeAngle)(i-o)%180);n.angle=0;var s=n.bounds;t.rotateAt(-o,n.center);var l=t.bounds,u=Math.min(l.left,s.left),c=Math.min(l.top,s.top),h=Math.max(l.right,s.right),p=Math.max(l.bottom,s.bottom),f=h-u,d=p-c,g=a?e.height/e.width:e.width/e.height,m=f/d,y=(r-1+Math.round(Object(B.normalizeAngle)(i-o)/90))%4+1;if(m>g){var _=Math.abs(f/g-f/m);1===y||2===y?c-=_:p+=_}if(m<g){var v=Math.abs(d*g-d*m);2===y||3===y?h+=v:u-=v}var b=new B.RectangleF(u,c,h-u,p-c);if(!Object(B.EqualsOfFloatNumbers)(0,i-o%360)){var w=B.RotatedRectangleF.fromRectangleF(b);w.rotateAt(o-i,n.center),b=w.bounds}var C=B.RotatedRectangleF.fromRectangleF(b);return C.rotateAt(i,n.center),C},t.prototype._getMinSizeConstraintConfiguration=function(t,e){var n=this,r=null,i=null;return e.forEach((function(e){var o=function(t){var e,r,i=null===(r=null===(e=n._canvas.viewer.configuration)||void 0===e?void 0:e.handlers)||void 0===r?void 0:r.resizeLimits;if(i)for(var o in i)if((o+"Item").toLowerCase()==t.itemType.toLowerCase())return i[o];return null!=(null==i?void 0:i.common)?i.common:new B.SizeF(null,null)}(e),a=(e.startRectangle.angle-t.angle)%180,s=Object(B.ConvertDegreeToRadian)(a),l=function(t,e){var n=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e));return{projectedWidth:n*t.width,projectedHeight:r*t.width,cos:n,sin:r}}(e.startRectangle,s);if(!Object(B.EqualsOfFloatNumbers)(l.cos,0)&&null!==o.width){var u=l.cos*o.width*t.width/l.projectedWidth;(null==r||r<u)&&(r=u)}if(!Object(B.EqualsOfFloatNumbers)(l.sin,0)&&null!==o.width){var c=o.width*l.sin*t.height/l.projectedHeight;(null==r||r<c)&&(i=c)}var h=function(t,e){var n=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),i=n*t.height;return{projectedWidth:r*t.height,projectedHeight:i,cos:n,sin:r}}(e.startRectangle,s);Object(B.EqualsOfFloatNumbers)(h.cos,0)||null===o.height||(c=o.height*h.cos*t.height/h.projectedHeight,(null==i||i<c)&&(i=c)),Object(B.EqualsOfFloatNumbers)(h.sin,0)||null===o.height||(u=o.height*h.sin*t.width/h.projectedWidth,(null==i||i<u)&&(i=u))})),{minWidth:r,minHeight:i}},t.prototype._constrainResizeDataToMinSize=function(t,e,n,r,i,o){i=Math.min(i,t.width),o=Math.min(o,t.height);var a=e.clone(),s=!1,l=!1;a.width<0&&(s=!0),a.height<0&&(l=!0);var u=t.width/t.height,c=this._calculateMinWidthAndHeight(Math.abs(e.width),Math.abs(e.height),i,o,u,n),h=c.resultWidth,p=c.resultHeight;return c.isChanged&&(a.width=s?-h:h,a.height=l?-p:p,this._alignRectangleWithStartRectangle(t,a,r)),a},t.prototype._calculateMinWidthAndHeight=function(t,e,n,r,i,o){var a=t,s=e,l=!1,u=!1;a<n&&(a=n,l=!0),s<r&&(s=r,u=!0);var c=u||l;if(c&&!o){var h=function(t){return t*i},p=function(t){return t*(1/i)};l?(s=p(a))<r&&(a=h(s=r)):u&&(a=h(s))<n&&(s=p(a=n))}return{resultWidth:a,resultHeight:s,isChanged:c}},t.prototype._alignRectangleWithStartRectangle=function(t,e,n){var r,i;switch(n){case 1:r=t.getBottomRightCorner(),i=e.getBottomRightCorner();break;case 2:r=t.getBottomLeftCorner(),i=e.getBottomLeftCorner();break;case 3:r=t.getUpperLeftCorner(),i=e.getUpperLeftCorner();break;case 4:r=t.getUpperRightCorner(),i=e.getUpperRightCorner();break;case 5:r=t.getRightCenterPoint(),i=e.getRightCenterPoint();break;case 6:r=t.getBottomCenterPoint(),i=e.getBottomCenterPoint();break;case 7:r=t.getLeftCenterPoint(),i=e.getLeftCenterPoint();break;case 8:r=t.getUpperCenterPoint(),i=e.getUpperCenterPoint()}var o=new B.PointF(r.x-i.x,r.y-i.y);e.translate(o.x,o.y)},t.prototype._constrainResizeDataToSnapLines=function(t,e){return this._snapLinesHandler.constrainRectangleToSnapLines(e,this.getRectangleWithBorder(t.previousRectangle),t.arbitraryResize,t.resizeIndex,this.getRectWithFrames(e),this.getRectangleWithBorder(e),this._canvas,this._selectionHandler.border)},t}(),me=function(){function t(){}return Object.defineProperty(t,"debug",{set:function(t){if(this._debug=t,t&&null==document.getElementById("deLogger")){var e=document.createElement("div");e.id="deLogger",e.style.position="fixed",e.style.border="solid 1px black",e.style.width="800px",e.style.height="100px",e.style.top="calc(100% - 200px)",e.style.left="0",e.style.display="flex",e.style.zIndex="100",e.style.flexDirection="column",e.style.userSelect="none";var n=document.createElement("div");n.id="deLoggerWindow",n.style.flex="1",n.style.backgroundColor="rgba(0, 0, 0, 0.5)",n.style.border="solid 1px black",n.style.overflow="auto",n.style.display="flex",n.style.fontSize="14px",n.style.fontWeight="500",n.style.flexDirection="column";var r=document.createElement("div");r.id="loggerHeader",r.style.height="40px",r.style.width="100%",r.style.backgroundColor="white",r.style.height="auto",r.style.padding="4px";var i=document.createElement("input");i.type="button",i.value="Clear",i.onclick=function(){n.innerHTML=""},r.appendChild(i),e.appendChild(r),e.appendChild(n),document.documentElement.appendChild(e),this._debugTimeStart=Date.now()}},enumerable:!0,configurable:!0}),t.debugLog=function(e,n,r){if(void 0===r&&(r=ue.Log),this._debug&&(null==t.sources||null==n||t.sources.includes(n))){var i='<span style="color: rgb(255, 0, 255)">'+(Date.now()-this._debugTimeStart)+":</span> "+e,o=document.createElement("span");o.innerHTML=i,o.style.color=t._getMessageColor(r);var a=document.getElementById("deLoggerWindow");a.appendChild(o),a.scrollTop=a.scrollHeight}},t.extendNativeLog=function(e){var n=console[e];console[e]=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=r.join(" ");n(o),t.debugLog(o,ce.System,e)}},t._getMessageColor=function(t){return t===ue.Error?"#dc3545":t===ue.Warning?"#ffc107":t===ue.Trace?"#17a2b8":"black"},t._debug=!1,t.init=function(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null),t.debug=e,t.sources=r,e&&(null==n?void 0:n.length)>0&&n.forEach((function(e){t.extendNativeLog(e)}))},t}();window.___$setDaLoggerEnabled=me.init,function(t){t.Trace="trace",t.Log="log",t.Warning="warn",t.Error="error"}(ue||(ue={})),function(t){t.ViolationService="ViolationService",t.InputManager="InputManager",t.System="System",t.Common="Common",t.SelectionHandler="SelectionHandler",t.CommandManager="CommandManager"}(ce||(ce={})),function(t){t.red=function(t){return'<span style="color: rgb(255, 0, 0)">'+t+"</span>"},t.green=function(t){return'<span style="color: rgb(0, 255, 0)">'+t+"</span>"},t.blue=function(t){return'<span style="color: rgb(0, 0, 255)">'+t+"</span>"},t.white=function(t){return'<span style="color: rgb(255, 255, 255)">'+t+"</span>"},t.cyan=function(t){return'<span style="color: rgb(0, 255, 255)">'+t+"</span>"},t.magenta=function(t){return'<span style="color: rgb(255, 0, 255)">'+t+"</span>"},t.yellow=function(t){return'<span style="color: rgb(0, 255, 255)">'+t+"</span>"}}(he||(he={}));var ye,_e=n(470),ve=function(){return ve=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ve.apply(this,arguments)},be=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},we=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(be(arguments[e]));return t},Ce=function(){function t(t,e,n,r){var i=this;this._canvas=e,this._snapLinesHandler=n,this._interactiveZonesHandler=r,this._itemHandlers=new Q.a,this._parentSelectionRectangle=null,this._multipleSelectionEnabled=!0,this._enabled=!0,this._skipUpdate=!1,this._locked=!1,this._state=ye.Idle,this._ignoreSimpleMode=!1,this._manipulationPermissions=new v.W,this._resizeIndex=null,this._setRectangle=function(t){i._rectangle=t},this._updatePermissions=function(){var t=new v.W;null!=i._canvas.contentEditingPlaceholderItemHandler?i._manipulationPermissions=i._canvas.contentEditingPlaceholderItemHandler.content.item.manipulationPermissions:i._ignoreSimpleMode||!i._canvas.simpleMode?(i._itemHandlers.selectMany((function(t){return t instanceof it?t.getNestedItemHandlers(!1,!1,!0):[t]})).ofType(K.a).forEach((function(e){var n,r,o,a,s=e.item.manipulationPermissions;t.allowDelete=t.allowDelete&&s.allowDelete,t.allowDragAndDrop=t.allowDragAndDrop&&s.allowDragAndDrop,t.allowMoveHorizontal=t.allowMoveHorizontal&&s.allowMoveHorizontal,t.allowMoveVertical=t.allowMoveVertical&&s.allowMoveVertical,t.allowRotate=t.allowRotate&&s.allowRotate,t.resizeGrips.edge=t.resizeGrips.edge&&s.resizeGrips.edge,t.resizeGrips.corner=O.intersection(s.resizeGrips.corner,t.resizeGrips.corner);var l=null!==(a=null!==(r=null===(n=i._rectangle)||void 0===n?void 0:n.angle)&&void 0!==r?r:null===(o=i._parentSelectionRectangle)||void 0===o?void 0:o.angle)&&void 0!==a?a:0;0==Object(B.EqualsOfFloatNumbers)((l-e.angle)%90,0)&&(t.resizeGrips.edge=!1,t.resizeGrips.setCornerArbitrary(!1))})),i._manipulationPermissions=t):i._manipulationPermissions=new v.W(!1)},this._selectionChanged=new At.a,this._onSelectionItemHandlersChanged=function(){var t;i._itemHandlers.contains(i._currentItemHandler)||(i._currentItemHandler instanceof Z.a&&i._currentItemHandler.removeIsEditingChanged(i._updatePermissions),i._currentItemHandler=i._itemHandlers.lastOrDefault(),i._updateParentItemHandler(null===(t=i._currentItemHandler)||void 0===t?void 0:t.parentGroupItemHandler),i._currentItemHandler instanceof Z.a&&i._currentItemHandler.addIsEditingChanged(i._updatePermissions),i._currentItemChangedEvent.notify(i._currentItemHandler)),i._update(),i._updatePermissions(),i._selectionChanged.notify()},this._onParentHandlerPropertyChanged=function(t,e){"sourceRectangle"==e&&i._updateParentSelectionRectangle()},this._selectionRectangleChanged=function(t){me.debugLog("Selection changed: "+t.rectangle.toString()+" is"+(t.finished?"":" not")+" finished.",ce.SelectionHandler),i._rectangle=t.rectangle,i._rectangleSigns={x:t.rectangle.width<0?-1:1,y:t.rectangle.height<0?-1:1},t.finished&&(i._rectangle.width=Math.abs(i._rectangle.width),i._rectangle.height=Math.abs(i._rectangle.height),i._canvas.updateTexts()),i._updateParentSelectionRectangle(),i._selectionChanged.notify()},this._selectionStateChanged=function(t){i._state=t},this._selectionAngleChanged=function(t){var e=ve(ve({},t),{items:i._items,finished:t.finished});i._canvas.viewer.commandManager.execute(_e.a.rotateItems,e,i._getHistoryUpdateMode(t.finished))},this._selectionMoved=function(t){var e={delta:t.delta,items:i._items,finished:t.finished};i._canvas.viewer.commandManager.execute(_e.a.newTranslateItems,e,i._getHistoryUpdateMode(t.finished))},this._selectionResized=function(t){var e=ve({items:i._items,finished:t.finished},t);i._canvas.viewer.commandManager.execute(_e.a.resizeItems,e,i._getHistoryUpdateMode(t.finished))},this._onItemHandlersItemAdded=function(t){t.item.addChanged(i._onSelectedItemHandlerChanged)},this._onItemHandlersItemRemoved=function(t){t.item.removeChanged(i._onSelectedItemHandlerChanged)},this._onSelectedItemHandlerChanged=function(t){i._updatePermissions(),i._update()},this.addSelectedItemHandlersChanged=function(t){i._itemHandlers.add_collectionChanged(t)},this.removeSelectedItemHandlersChanged=function(t){i._itemHandlers.remove_collectionChanged(t)},this._currentItemChangedEvent=new At.a,this._selectionHitTestManager=new ne(this,t),this._selectionProcessModifier=new ge(this,e,n),this._selectionRectangleHandler=new ee(this._selectionProcessModifier),this._itemHandlers.add_collectionChanged(this._onSelectionItemHandlersChanged),this._itemHandlers.add_itemAdded(this._onItemHandlersItemAdded),this._itemHandlers.add_itemRemoved(this._onItemHandlersItemRemoved),this._selectionRectangleHandler.addRectangleChanged(this._selectionRectangleChanged),this._selectionRectangleHandler.addRectangleAngleChanged(this._selectionAngleChanged),this._selectionRectangleHandler.addRectangleMoved(this._selectionMoved),this._selectionRectangleHandler.addRectangleResized(this._selectionResized),this._selectionRectangleHandler.addStateChanged(this._selectionStateChanged)}return Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectedItemHandlers",{get:function(){return this._itemHandlers},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentItemHandler",{get:function(){return this._currentItemHandler},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionHitTestManager",{get:function(){return this._selectionHitTestManager},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"locked",{get:function(){return this._locked},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"border",{get:function(){return this._border},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rectangle",{get:function(){return this._rectangle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentRectangle",{get:function(){return this._parentSelectionRectangle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"region",{get:function(){return this._region},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"resizeIndex",{get:function(){return this._resizeIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ignoreSimpleMode",{set:function(t){this._ignoreSimpleMode!==t&&(this._ignoreSimpleMode=t,this._updatePermissions())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"multipleSelectionEnabled",{get:function(){return this._multipleSelectionEnabled&&!this.selectedItemHandlers.any((function(t){return t.item.parentGroupItem instanceof v.R}))},set:function(t){this._multipleSelectionEnabled=t},enumerable:!0,configurable:!0}),t.prototype.lock=function(t){void 0===t&&(t=!1),this._locked=!0,t||this._itemHandlers.clear(),this._canvas.onSelectionLocked(),this._canvas.redraw()},t.prototype.unlock=function(){this._locked=!1,this._canvas.redraw()},t.prototype.enable=function(){this._update(),this._enabled=!0},t.prototype.disable=function(){this._enabled=!1},t.prototype.rotateByPoint=function(t,e,n){if(void 0===n&&(n=null),this.manipulationPermissions.allowRotate){if(e===Dt.Started){if(null==n)throw new o.a("SelectionHandler.updateRotation: startPoint cannot be null!");this._selectionProcessModifier.ignoreSnapLines=!1,this._selectionRectangleHandler.startRotatingByPoint(n,this.rectangle)}try{this._selectionRectangleHandler.updateRotatingByPoint(t)}finally{e===Dt.Finished&&this._notifyItemHandlersChanged()}}},t.prototype.moveByPoint=function(t,e,n,r){var i;void 0===r&&(r=null);var a=this.manipulationPermissions;if(a.allowMove){if(null==t.allowMoveHorizontal&&(t.allowMoveHorizontal=a.allowMoveHorizontal),null==t.allowMoveVertical&&(t.allowMoveVertical=a.allowMoveVertical),e===Dt.Started){if(null==r)throw new o.a("SelectionHandler.updateMoving: startPoint cannot be null!");this._selectionProcessModifier.ignoreSnapLines=n,this._selectionRectangleHandler.startMovingByPoint(r,this.rectangle),n||this._fillSnapData()}try{this._selectionRectangleHandler.updateMovingByPoint(t)}finally{e===Dt.Finished&&(this._notifyItemHandlersChanged(),this._snapLinesHandler.clearSnapData(),null===(i=this._canvas)||void 0===i||i.redraw())}}},t.prototype.resizeByPoint=function(t,e,n){var r;if(void 0===n&&(n=null),this.manipulationPermissions.allowResize){if(e===Dt.Started){if(null==n)throw new o.a("SelectionHandler.updateResizing: startPoint cannot be null!");this._resizeIndex=t.resizeIndex,this._selectionProcessModifier.ignoreSnapLines=!1,this._selectionRectangleHandler.startResizingByPoint(n,this.rectangle,t.resizeIndex,this._allowNegativeResize,this.selectedItemHandlers.toArray()),this._fillSnapData()}try{this._selectionRectangleHandler.updateResizingByPoint(t,this._itemHandlers.toArray())}finally{e===Dt.Finished&&(this._resizeIndex=null,this._notifyItemHandlersChanged(),this._snapLinesHandler.clearSnapData(),null===(r=this._canvas)||void 0===r||r.redraw())}}},t.prototype._notifyItemHandlersChanged=function(){this._itemHandlers.forEach((function(t){return t.item.getItemChangedEvent().fire()}))},t.prototype.move=function(t,e){var n=this.manipulationPermissions;n.allowMove&&(null==t.allowMoveHorizontal&&(t.allowMoveHorizontal=n.allowMoveHorizontal),null==t.allowMoveVertical&&(t.allowMoveVertical=n.allowMoveVertical),e===Dt.Started&&this._state===ye.Idle&&(this._selectionProcessModifier.ignoreSnapLines=!0,this._selectionRectangleHandler.startMove(this.rectangle)),this._selectionRectangleHandler.move(t))},t.prototype.isItemHandlerSelected=function(t){return this._itemHandlers.contains(t)},t.prototype.isOnlyThisItemHandlerSelected=function(t){return this.isItemHandlerSelected(t)&&1===this._itemHandlers.length},t.prototype.setSelectedItemHandlers=function(t,e){void 0===e&&(e=!1),!O.isArray(t)||this._locked||Object(b.d)(t,this._itemHandlers.toArray())||(e||this.clearSelectedItemHandlers(),this._cancelEditMode(),this.multipleSelectionEnabled||(t=[t[0]]),this._itemHandlers.addRange(t))},t.prototype._cancelEditMode=function(){var t;null===(t=this._itemHandlers)||void 0===t||t.ofType(Z.a).forEach((function(t){return t.editing=!1}))},t.prototype.clearSelectedItemHandlers=function(){this._cancelEditMode(),this._itemHandlers.clear(),this._updateParentSelectionRectangle()},t.prototype.addSelectedItemHandler=function(t){!this.multipleSelectionEnabled&&this._itemHandlers.length>0&&this._itemHandlers.clear(),this.setSelectedItemHandlers([t],!0)},t.prototype.removeSelectedItemHandler=function(t){this._itemHandlers.contains(t)&&this._itemHandlers.remove(t)},t.prototype.update=function(t){void 0===t&&(t=!1),(t||this._state===ye.Idle)&&this._update()},t.prototype._update=function(){if(!this._skipUpdate){if(0===this._itemHandlers.length)return this._setRectangle(null),this._border=null,void(this._region=null);var t=this._itemHandlers.getItem(0),e=t.getBorderMargin();if(1===this._itemHandlers.length)this._setRectangle(this._itemHandlers.get(0).getSelectionRectangle()),this._border={left:e,top:e,right:e,bottom:e};else{for(var n=t.getSelectionRectangle().bounds,r=n.left,i=n.top,o=n.right,a=n.bottom,s={left:e,top:e,right:e,bottom:e},l=1;l<this._itemHandlers.length;l++)e=(t=this._itemHandlers.getItem(l)).getBorderMargin(),(n=t.getSelectionRectangle().bounds).left-e<r-s.left&&(r=n.left,s.left=e),n.top-e<i-s.top&&(i=n.top,s.top=e),n.right+e>o+s.right&&(o=n.right,s.right=e),n.bottom+e>a+s.bottom&&(a=n.bottom,s.bottom=e);this._setRectangle(B.RotatedRectangleF.FromLTRB(r,i,o,a)),this._border=s}this._updateParentSelectionRectangle(),this._region=this._getRegion(),this._canvas.redraw()}},t.prototype._updateParentSelectionRectangle=function(){var t,e,n=null;if((null===(t=this._itemHandlers)||void 0===t?void 0:t.any())&&(e=(n=this._itemHandlers.getItem(0).item.parentGroupItem)&&this._canvas.handlerFactory.get(n)),null==n||null==e||e.isEmpty())this._parentSelectionRectangle=null;else{var r=e.getSelectionRectangle();this._parentSelectionRectangle=r}},t.prototype._getRegion=function(){var t=null;if(this._canvas.constrainedMarginEnabled&&this._canvas.margin>0){var e=this._canvas.margin;t=new B.RectangleF(e,e,this._canvas.workspaceWidth-e,this._canvas.workspaceHeight-e)}return this._itemHandlers.where((function(t){var e;return null!=(null===(e=t.layer)||void 0===e?void 0:e.region)})).select((function(t){return t.layer.region})).distinct().forEach((function(e){t=null!=t?B.RectangleF.intersect(t,e):e})),t},t.prototype.getSelectionDrawingParams=function(){var t,e,n=!1,r=!1,i=!1,o=null;1===this._itemHandlers.length?(n=(o=this._itemHandlers.getItem(0))instanceof gt,i=o instanceof Z.a&&o.editing):r=this._itemHandlers.any((function(t){return t instanceof gt}));var a=i&&o.item.isCoverMode,s=!!o&&o.item.contentResizeMode===v.ib.Fit,l=o instanceof Qt&&o.isInEdit,u=this.manipulationPermissions;return{rotate:this.allowManipulation&&u.allowRotate&&!a&&!l&&!s,resize:this.allowManipulation&&null!==(e=null===(t=u.resizeGrips.corner)||void 0===t?void 0:t[0])&&void 0!==e&&e&&!n&&!l,arbitraryWidthResize:this.allowManipulation&&u.resizeGrips.edge&&!r&&!a&&!l,arbitraryHeightResize:this.allowManipulation&&u.resizeGrips.edge&&!n&&!r&&!a&&!l}},t.prototype.getHighlightRectangles=function(){var t,e=[];if(null==this._itemHandlers||0==this._itemHandlers.length)return e;var n={includeChildren:!0,includeParent:!1};if(this._itemHandlers.length>1)this._itemHandlers.forEach((function(t){return e.push.apply(e,we(t.getHighlightRectangles(n)))}));else{var r=this._itemHandlers.get(0);(r instanceof Qt?r.isHighlightNeeded()&&(null===(t=this._canvas.textEditor)||void 0===t?void 0:t.highlightInEditingModeEnabled):r.isHighlightNeeded())&&(n.includeParent=!1,e.push.apply(e,we(r.getHighlightRectangles(n))))}return e},Object.defineProperty(t.prototype,"visibleRectangle",{get:function(){return this._getVisibleSelectionRectangle(this._rectangle)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rectangleSigns",{get:function(){return this._rectangleSigns},enumerable:!0,configurable:!0}),t.prototype._getVisibleSelectionRectangle=function(t){if(null==t)return null;var e=t.clone();if(e.width=Math.abs(e.width),e.height=Math.abs(e.height),null!=this._border){var n=e.angle;(e=B.RotatedRectangleF.fromRectangleF(e.toRectangleF().getExpanded(this._border))).angle=n}return e},Object.defineProperty(t.prototype,"manipulationPermissions",{get:function(){return this._manipulationPermissions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowManipulation",{get:function(){return null!=this._canvas&&(!this._canvas.simpleMode||null!=this._canvas.contentEditingPlaceholderItemHandler)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowMove",{get:function(){return this.manipulationPermissions.allowMove&&this.allowManipulation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_allowNegativeResize",{get:function(){return!this._itemHandlers.any((function(t){return!t.allowNegativeResize}))},enumerable:!0,configurable:!0}),t.prototype.addOnSelectionChanged=function(t){this._selectionChanged.add(t)},t.prototype.removeOnSelectionChanged=function(t){this._selectionChanged.remove(t)},t.prototype._updateParentItemHandler=function(t){this._parentItemHandler!=t&&(null!=this._parentItemHandler&&this._parentItemHandler.item.removePropertyChanged(this._onParentHandlerPropertyChanged),this._parentItemHandler=t,null!=this._parentItemHandler&&this._parentItemHandler.item.addPropertyChanged(this._onParentHandlerPropertyChanged))},t.prototype._getHistoryUpdateMode=function(t){return t?i.ForceUpdate:i.NotUpdate},Object.defineProperty(t.prototype,"_items",{get:function(){return null!=this._canvas.contentEditingPlaceholderItemHandler?[this._canvas.contentEditingPlaceholderItemHandler.item.content]:this._itemHandlers.select((function(t){return t.item})).toArray()},enumerable:!0,configurable:!0}),t.prototype._fillSnapData=function(){var t=this._interactiveZonesHandler.getSnapLines(),e=Object(re.f)(this.rectangle,this.border);this._snapLinesHandler.fillSnapData(this.rectangle,this._selectionProcessModifier.getRectWithFrames(this.rectangle),null!=e?e.bounds:null,this._region,t,this._canvas,this._state===ye.Drag)},t.prototype.dispose=function(){this._itemHandlers.remove_collectionChanged(this._onSelectionItemHandlersChanged),this._currentItemHandler instanceof Z.a&&this._currentItemHandler.removeIsEditingChanged(this._updatePermissions)},t.prototype.addCurrentItemChanged=function(t){this._currentItemChangedEvent.add(t)},t.prototype.removeCurrentItemChanged=function(t){this._currentItemChangedEvent.remove(t)},Object.defineProperty(t.prototype,"isIdle",{get:function(){return this._state===ye.Idle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isResizing",{get:function(){return this._state===ye.Resize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRotating",{get:function(){return this._state===ye.Rotate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDragging",{get:function(){return this._state===ye.Drag},enumerable:!0,configurable:!0}),t.cw=[0,-1,1,1,-1,-1,0,1,0],t.ch=[0,-1,-1,1,1,0,-1,0,1],t}();!function(t){t[t.Idle=0]="Idle",t[t.Select=1]="Select",t[t.Drag=2]="Drag",t[t.Resize=3]="Resize",t[t.Rotate=4]="Rotate"}(ye||(ye={}));var Pe,Se=function(){function t(){}return t.isLeftResizeGrip=function(t){return 1===t||4===t||5===t},t.isTopResizeGrip=function(t){return 1===t||2===t||6===t},t.isRightResizeGrip=function(t){return 2===t||3===t||7===t},t.isBottomResizeGrip=function(t){return 3===t||4===t||8===t},t.isCornerResizeGrip=function(t){return 1===t||2===t||3===t||4===t},t.isEdgeResizeGrip=function(t){return 5===t||6===t||7===t||8===t},t}(),xe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ie=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Oe=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Te=function(t){function e(e,n,r,i,o,a,s){void 0===i&&(i=null);var l=t.call(this,e,n,r,i,o,a,s)||this;return l.lastRectangle=null,l}return xe(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"drawingRectangle",{get:function(){var t=this.canvas.isItemHandlerSelected(this)&&this.canvas.isSelectionResizing;if(null==this._staticTextRect)return t&&null!=this.startRectangle?this.startRectangle:this.rectangle;var e=B.RotatedRectangleF.fromRectangleF(this._staticTextRect),n=t&&null!=this.startRectangle?this.startRectangle.getTransform(B.RotatedRectangleF.fromRectangleF(this.getControlBounds())):this.item.transform.clone();return e.transform(n,this.getControlCenter()),e},enumerable:!0,configurable:!0}),e.prototype.setTextWhizzWrappingPath=function(t){var e=this.item,n=null;if(null!=e.wrappingPath){if(Object(B.EqualsOfFloatNumbers)(0,this.item.transform.angle))n=Object(Ht.d)(this._textWhizz,e.wrappingPath);else{var r=e.wrappingPath.clone();r.rotateAt(-this.item.transform.angle,this.getControlCenter()),n=Object(Ht.d)(this._textWhizz,r)}n.offsetContour(e.wrappingMargin)}else n=new this._textWhizz.Path;t.setWrappingPath(n)},e.prototype.getWrappingPathData=function(){if(null!=this.item.wrappingPath){var t=null;if(Object(B.EqualsOfFloatNumbers)(0,this.item.transform.angle))t=this.item.wrappingPath;else{var e=this.item.wrappingPath.clone();e.rotateAt(-this.item.transform.angle,this.getControlCenter()),t=e}return{path:t,wrappingMargin:this.item.wrappingMargin}}return{isEmptyPath:!0}},e.prototype.getFramesData=function(){return{type:te.a.shapeTextFrame,frames:this._getFrames()}},e.prototype.getTextWrappingPath=function(){var e=this;if(this.item instanceof v.ab&&this.item.textWrappingMode===v.xb.Tight){var n=this._getFrames(),r=function(t){var n=t.clone();return n.transform(e.item.transform,e.getControlCenter()),n};if(1==n.length)return r(n[0]);for(var i=r(n[0]),o=Object(Ht.d)(this._textWhizz,i),a=1;a<n.length;a++){var s=r(n[a]),l=Object(Ht.d)(this._textWhizz,s);o=this._textWhizz.Path.union(o,l)}return Object(Ht.a)(o)}return t.prototype.getTextWrappingPath.call(this)},e.prototype._endTransform=function(e,n){t.prototype._endTransform.call(this,e,n),this.setRectangleValidated()},e.prototype.setRectangleValidated=function(t){void 0===t&&(t=null),null==t&&(t=this.rectangle),this._validateRectAndSet(t,!0)},e.prototype.getTextRectangle=function(){var t,e=this.getControlCenter();return(t=this._textEditorController.ready?B.RotatedRectangleF.fromRectangleF(this._textEditorController.measureText()):B.RotatedRectangleF.fromRectangleF(this.item.sourceRectangle)).transform(this.item.transform.clone(),e),t},e.prototype._onFrontEndRenderingInitialized=function(){t.prototype._onFrontEndRenderingInitialized.call(this),this.setRectangleValidated()},e.prototype._onTransformRectangle=function(t,e,n){var r;if(null!=t&&null!=e&&null!=this._startRectangle){var i=this._calculateTransformedRectangle(t,e);this.setRectangle(i,!0),null===(r=this.canvas)||void 0===r||r.redraw()}},e.prototype._onItemPropertyChanged=function(e,n){var r;return Ie(this,void 0,void 0,(function(){return Oe(this,(function(i){switch(i.label){case 0:switch(n){case"textRectangle":case"boundingPaths":case"firstBaselineOffset":case"firstBaselineMinOffset":return[3,1];case"wrappingPath":case"wrappingMargin":return[3,2];case"verticalAlignment":case"isVertical":case"shrinkMode":case"scheduledFitMode":case"paragraphSettings":case"characterLimit":return[3,3];case"text":case"overflowStrategy":return[3,4]}return[3,6];case 1:return this.update(null,null,"frame"),[3,6];case 2:return this.update(null,null,this.item.transform.isEmpty?"wrappingPath":null),[3,6];case 3:return this.update(),[3,6];case 4:return[4,null===(r=this.textEditorController)||void 0===r?void 0:r.initialize()];case 5:return i.sent(),this.item instanceof v.q&&this.item.overflowStrategy!=v.X.Clip&&this.setRectangleValidated(),[3,6];case 6:return t.prototype._onItemPropertyChanged.call(this,e,n),[2]}}))}))},e.prototype._transformText=function(e){this.canvas.isSelectionResizing||null!=this.item.wrappingPath?this.update(null,null,"frame"):t.prototype._transformText.call(this,e)},e.prototype.renderFill=function(t){var e=this.item,n=this.getControlCenter(),r=this.item.transform,i=this._getItemColorPreviews().fillColorPreview;this._getFrames().forEach((function(o){G.a.fillPath(t,o,n,r,null==i?void 0:i.toString(),e.opacity)}))},e.prototype.renderStroke=function(t){var e=this,n=this._getActualBorderWidth();if(!(n<=0)){var r=this.item,i=this.getControlCenter(),o=this.item.transform,a=this._getItemColorPreviews(),s=a.borderColorPreview,l=a.altBorderColorPreview;this._getFrames().forEach((function(a){var u=Object(Ht.d)(e._textWhizz,a);u.offsetContour(n/2),G.a.drawStroke(t,u,i,o,n,null==s?void 0:s.toString(),null==l?void 0:l.toString(),r.opacity,r.dash)}))}},e.prototype._onTextManagerExitedEditMode=function(){t.prototype._onTextManagerExitedEditMode.call(this),this.setRectangleValidated()},e.prototype._applyTransform=function(t,e,n){var r,i;if(t instanceof v.q){var o=B.RotatedRectangleF.fromRectangleF(t.textRectangle);o.setTransform(e);var a=o.toRectangleF();t.textRectangle=a,this.controlPoints=[new B.PointF(a.left,a.top),new B.PointF(a.right,a.bottom)]}if(t instanceof v.ab)try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t.boundingPaths),l=s.next();!l.done;l=s.next())l.value.transform(e,n)}catch(u){r={error:u}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}},e.prototype._validateRect=function(t){var e;return Ie(this,void 0,void 0,(function(){var n,r,i;return Oe(this,(function(o){switch(o.label){case 0:return null===this._textEditorController?[2,null]:this.item instanceof v.q&&this.item.overflowStrategy==v.X.ExpandBox?[4,this._textEditorController.measureTextFrame()]:[3,2];case 1:if((n=o.sent()).height>t.height)return r=n.height-t.height,Object(B.EqualsOfFloatNumbers)(r,0)?[2,null]:(i=t.clone(),(null===(e=this._transformOperation)||void 0===e?void 0:e.resize)&&Se.isTopResizeGrip(this._transformOperation.resizeIndex)&&(r*=-1),i.centerY+=r/2,i.height=n.height,[2,i]);o.label=2;case 2:return[2,null]}}))}))},e.prototype._validateRectAndSet=function(e,n){var r=this;this._validateRect(e).then((function(i){null!=i?(t.prototype.setRectangle.call(r,i,n),r.update()):t.prototype.setRectangle.call(r,e,n)}))},e.prototype._getFrames=function(){var t;if(this.item instanceof v.q){var e;return e=(null===(t=this._textEditorController)||void 0===t?void 0:t.isInEdit)?this.rectangle.toRectangleF():this.item.textRectangle,[B.Path.rectangle(e.left,e.top,e.width,e.height)]}return this.item.boundingPaths},e.prototype._firstBaselineOffsetToTextWhizz=function(t){switch(t){case v.C.Ascent:return this._textWhizz.FirstBaselineOffset.ascent;case v.C.CapHeight:return this._textWhizz.FirstBaselineOffset.capHeight;case v.C.Leading:return this._textWhizz.FirstBaselineOffset.leading;case v.C.XHeight:return this._textWhizz.FirstBaselineOffset.xHeight;case v.C.Fixed:return this._textWhizz.FirstBaselineOffset.fixed;case v.C.EmboxHeight:return this._textWhizz.FirstBaselineOffset.emBox}},e.typeName="NewBoundedTextItemHandler",e}(Qt),Le=n(447),Re=n(466),Ee=n(468),je=n(483),Ne=n(420),ke=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ae=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Fe=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Be=function(t){function e(e,n,r,i,o,a,s){return void 0===i&&(i=null),t.call(this,e,n,r,i,o,a,s)||this}return ke(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),e.prototype.getFramesData=function(){var t=[];return t.push(this.item.textPath),{type:te.a.pathTextFrame,frames:t}},e.prototype.updateTextWhizzFrames=function(t){t.replaceFrame(this._createTextWhizzFrame(),0)},e.prototype.setTextWhizzWrappingPath=function(t){},e.prototype.getWrappingPathData=function(){return{}},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"textPath":case"start":case"end":this.update(null,null,"frame");break;case"fitToPath":case"fitToPathStep":case"stretch":case"originalFontSize":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._addTextWhizzFrames=function(t){t.addFrame(this._createTextWhizzFrame())},e.prototype._getEndTransformTrigger=function(t){return t?null:"frame"},e.prototype.waitInitFrontEndRendering=function(){return Ae(this,void 0,void 0,(function(){return Fe(this,(function(e){switch(e.label){case 0:return[4,t.prototype.waitInitFrontEndRendering.call(this)];case 1:return e.sent(),[4,this._resetPreviewScale(this.item)];case 2:return e.sent(),[2]}}))}))},e.prototype._applyTransform=function(t,e,n){var r,i;return Ae(this,void 0,void 0,(function(){var o,a,s;return Fe(this,(function(l){switch(l.label){case 0:return t instanceof v.x?(o=this._getPreviewScaleLimits(),a=e.scaleY,a=Math.min(null!==(r=o.max)&&void 0!==r?r:Number.MAX_VALUE,a),a=Math.max(null!==(i=o.min)&&void 0!==i?i:Number.MIN_VALUE,a),[4,this._scaleFontSizes(t,a)]):[2];case 1:return l.sent(),[4,this._updateRectangleAfterTextScale(t,e)];case 2:return l.sent(),(s=t.textPath.clone()).transform(e,n),t.textPath=s,this.textEditorController.updateText("frame",!0),[2]}}))}))},e.prototype._updateRectangleAfterTextScale=function(t,e){return Ae(this,void 0,void 0,(function(){var n,r;return Fe(this,(function(i){switch(i.label){case 0:return[4,this.textEditorController.waitUpdate()];case 1:return i.sent(),(n=t.sourceRectangle).updateByMatrix(e.toMatrix()),r=new B.RectangleF(n.left,n.top,n.width,n.height),this.updateRectangle(r,!1),[2]}}))}))},e.prototype._scaleFontSizes=function(t,e){return Ae(this,void 0,void 0,(function(){return Fe(this,(function(n){switch(n.label){case 0:return[4,this._scaleFontSizesInItem(t,e)];case 1:return n.sent(),[4,this._scaleFontSizesInMarkup(t,e)];case 2:return n.sent(),[4,this.textEditorController.waitUpdate()];case 3:return n.sent(),[2]}}))}))},e.prototype._scaleFontSizesInItem=function(t,e){return Ae(this,void 0,void 0,(function(){return Fe(this,(function(n){return t.font.size*=e,t.leading*=e,[2]}))}))},e.prototype._scaleFontSizesInMarkup=function(t,e){return Ae(this,void 0,void 0,(function(){var n,r,i,o,a,s,l,u;return Fe(this,(function(c){switch(c.label){case 0:return n=new Re.a(this._colorParser),r=new Ee.a(this._colorParser),i=new Le.d,(o=i.create()).initialize(),s=je.a.bind,[4,Cn.getColorPalette(t,this._colorPreviewService)];case 1:return a=new(s.apply(je.a,[void 0,c.sent()])),l=n.parse(t.text,a,t.font.size,o),this._scaleTextModelStyles(l,e),u=r.serialize(l,a),t.text=u,[2]}}))}))},e.prototype._scaleTextModelStyles=function(t,e){t.blocks.forEach((function(t){t instanceof Ne.Paragraph&&t.inlineElements.forEach((function(t){if(t instanceof Ne.Span){var n=t.style;(null==n?void 0:n.fontSize)&&(n.fontSize.value*=e)}}))}))},e.prototype._resetPreviewScale=function(t){return Ae(this,void 0,void 0,(function(){var e;return Fe(this,(function(n){switch(n.label){case 0:return e=this.item.previewScale,Math.abs(e-1)>1e-7?(this.item.previewScale=1,[4,this._scaleFontSizes(t,e)]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},e.prototype._createTextWhizzFrame=function(){var t=Object(Ht.d)(this._textWhizz,this.item.textPath),e=this.item.previewScale;Object(B.EqualsOfFloatNumbers)(e,1)||t.scale(1/e,1/e);var n=new this._textWhizz.PathTextFrame;return n.baseline=t,n.start=this.item.start,n.end=this.item.end,this.item.fitToPath&&(n.copyFittingMode=this._textWhizz.CopyFittingMode.fitToWidth),n},e.prototype.updateRectangle=function(e,n){return Ae(this,void 0,void 0,(function(){var r,i,o,a,s,l;return Fe(this,(function(u){switch(u.label){case 0:return n?(r=e.clone(),i=B.RotatedRectangleF.fromRectangleF(e),o=this.item.transform.angle,a=this.rectangle.center,s=e.clone().center,(l=this.item.textPath.clone()).rotateAt(o,a),i.rotateAt(o,a),s.rotateAt(this.item.transform.angle,a),l.rotateAt(-o,s),i.rotateAt(-o,s),this.item.setTextPath(l,!0),e=i.toRectangleF(),t.prototype.updateRectangle.call(this,e,n),this.hasLayoutAncestor?[2]:Object(re.j)(r,e)||null!=this.textEditor?[3,2]:[4,this.textEditorController.waitUpdate()]):[2,t.prototype.updateRectangle.call(this,e,n)];case 1:u.sent(),this.textEditorController.updateText("text",!0),u.label=2;case 2:return[2]}}))}))},e.prototype._drawHandlerEffects=function(t){this._needToDrawBaseline()&&this._drawBaseline(t)},e.prototype._getBaselineDrawStates=function(){var t;return null!==(t=this.canvas.viewerConfiguration.curvedTextBaselineDrawStates)&&void 0!==t?t:[Ut.edit,Ut.select,Ut.hover,Ut.move,Ut.resize,Ut.rotate]},e.prototype._drawBaseline=function(t){var e;try{var n=T.a.screenDpi*this.canvas.workspace.zoom/72,r=this.item.transform.clone(),i=this.item.textPath,o=this.getControlCenter(),a=null===(e=this.canvas.style)||void 0===e?void 0:e.baselineColor;G.a.drawPath(t,i,o,r,1/n,a,1);var s=Object(Ht.b)(i).clone(),l=Object(Ht.c)(i).clone();s.transform(r,o),l.transform(r,o),G.a.drawCross(t,s.x,s.y,4/n,1/n,a),G.a.drawCross(t,l.x,l.y,4/n,1/n,a)}catch(u){console.error("Error in _drawBaseline",u)}},e.typeName="NewCurvedTextItemHandler",e}(Qt),Me=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},ze=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},De=function(){function t(t,e,n,r){var i=this;this._item=t,this._itemHandlers=e,this._itemHandler=n,this._history=r,this._layoutEvent=new At.a,this._orderedItemHandlers=null,this._initialized=!1,this._disposed=!1,this._onChildItemHandlerChanging=function(t){i.applyLayout()},this._onChildItemHandlerPropertyChanged=function(t,e){return Me(i,void 0,void 0,(function(){return ze(this,(function(n){switch(n.label){case 0:switch(e){case"font":case"text":case"tracking":case"leading":case"shadow":case"stroke":case"underline":case"sourceRectangle":case"borderWidth":case"transform":return[3,1]}return[3,3];case 1:return[4,t.waitUpdate()];case 2:return n.sent(),this.applyLayout(),[3,3];case 3:return[2]}}))}))},this._onItemPropertyChanged=function(t,e){switch(e){case"layoutSettings":i._orderedItemHandlers=null,i._updateItemsOrder(),i.applyLayout();break;case"margin":case"alignItems":case"justifyContent":i.applyLayout();break;case"orientation":i.applyLayout(!0)}},this._ignoreLayoutApply=!1,this._filterHiddenItems=function(t){return!((t instanceof k.a||t instanceof Qt||t instanceof qe)&&t.isEmpty())},this._item.addPropertyChanged(this._onItemPropertyChanged),this._itemHandlers.add_itemAdded(this._onItemHandlerAdded.bind(this)),this._itemHandlers.add_itemRemoved(this._onItemHandlerRemoved.bind(this)),this._itemHandlers.forEach((function(t){return t.addItemPropertyChanged(i._onChildItemHandlerPropertyChanged)})),this._init()}return t.prototype.dispose=function(){var t=this;this._disposed=!0,this._item.removePropertyChanged(this._onItemPropertyChanged),this._itemHandlers.remove_itemAdded(this._onItemHandlerAdded.bind(this)),this._itemHandlers.remove_itemRemoved(this._onItemHandlerRemoved.bind(this)),this._itemHandlers.forEach((function(e){return e.removeItemPropertyChanged(t._onChildItemHandlerPropertyChanged)}))},t.prototype.getLayoutEvent=function(){return this._layoutEvent},t.prototype.onItemRemoved=function(t){this._updateItemsOrder({removedItem:t.item}),this.applyLayout()},t.prototype.onItemHandlersCollectionChanged=function(){this._orderedItemHandlers=null},t.prototype._init=function(){return Me(this,void 0,void 0,(function(){var t;return ze(this,(function(e){switch(e.label){case 0:return this._initialized?[2]:(t=this._item.getItemsOrder(),[4,this._itemHandler.waitUpdate()]);case 1:return e.sent(),t||this._updateItemsOrder(),this._initialized=!0,this.applyLayout(),[2]}}))}))},t.prototype._onItemHandlerAdded=function(t){t.item.addItemPropertyChanged(this._onChildItemHandlerPropertyChanged),this._orderedItemHandlers=null},t.prototype._onItemHandlerRemoved=function(t){t.item.removeItemPropertyChanged(this._onChildItemHandlerPropertyChanged),this._orderedItemHandlers=null},t.prototype._updateItemsOrder=function(t){if(this._item.layoutSettings instanceof v.f){if(this._validateItemsOrder())return;if(null==this._item.getItemsOrder()){this._initSortedItemHandlers();var e=this._getSortedItemHandlers().map((function(t){return t.item.id}));this._item.setItemsOrder(e)}}},t.prototype._initSortedItemHandlers=function(){var t=this._itemHandler.getTransformedRectangle(!1,!0).center,e=this._item.transform.angle,n=this._item.layoutSettings.orientation;return this._orderedItemHandlers=this._itemHandlers.toArray().sort((function(r,i){return function(t,e){return n===v.e.horizontal?t.bounds.left-e.bounds.left:t.bounds.top-e.bounds.top}(r.getTransformedRectangle(!1,!0).rotateAt(-e,t),i.getTransformedRectangle(!1,!0).rotateAt(-e,t))})),this._orderedItemHandlers},t.prototype._validateItemsOrder=function(){var t=this._item.getItemsOrder();if(null==t)return!1;if(t.length!==this._item.items.length)return!1;var e=this._item.items.select((function(t){return t.id})).toArray();return t.every((function(t){return e.includes(t)}))},t.prototype._getSortedItemHandlers=function(){if(null!=this._orderedItemHandlers)return this._orderedItemHandlers;var t=this._item.getItemsOrder();if(!t)return null;var e=[],n=this._itemHandlers.toArray();if(n.length!=t.length)throw new Error("itemsOrder length does not match itemHandlers length");return t.forEach((function(t){var r=n.findIndex((function(e){return e.item.id==t}));if(-1==r)throw new Error("itemsOrder: Element with id "+t+" was not found in itemHandlers");e.push(n[r]),n.splice(r,1)})),this._orderedItemHandlers=e,this._orderedItemHandlers},t.prototype.getOrderedItems=function(){var t=this._item.getItemsOrder();if(t){var e=this._item.items.toArray();return e.sort((function(e,n){return t.indexOf(e.id)-t.indexOf(n.id)})),e}return null},Object.defineProperty(t.prototype,"ignoreLayoutApply",{set:function(t){this._ignoreLayoutApply=t},enumerable:!0,configurable:!0}),t.prototype.applyLayout=function(t){var e,n,r,i,o,a;if(void 0===t&&(t=!1),!this._disposed&&this._initialized&&!this._ignoreLayoutApply){this._ignoreLayoutApply=!0;try{var s=!(null===(e=this._history)||void 0===e?void 0:e.isPaused());s&&(null===(n=this._history)||void 0===n||n.pause()),null===(r=this._itemHandler.canvas)||void 0===r||r.pauseRedraw();var l=this._applyLayoutImpl(t);null===(i=this._itemHandler.canvas)||void 0===i||i.continueRedraw(),s&&(l?null===(o=this._history)||void 0===o||o.resume(!0,!1,!0):null===(a=this._history)||void 0===a||a.resume(!1,!1,!0)),this._layoutEvent.notify(l)}finally{this._ignoreLayoutApply=!1}}},t.prototype._applyLayoutImpl=function(t){var e,n=this;void 0===t&&(t=!1);var r=this._getSortedItemHandlers();if(null!=r&&0!=r.length){var i=this._itemHandler.rectangle,o=i.center,a=this._item.layoutSettings,s=a.alignItems,l=a.orientation,u=a.margin,c=a.anchorPoint,h=(this._item.transform.angle,i.toRectangleF()),p=this._getAnchorPoint(h,c,l),f=this._getOriginalPoint(h,s,l);r=r.filter((function(t){return n._filterHiddenItems(t)}));var d=[];r.forEach((function(t){var e=n._getItemHandlerPositionRect(t,i,f,s,l),r=n._getPositionRectOffset(l,h,e)+u;f=n._getOriginalPoint(h,s,l,r),d.push(e)})),d=this._applyAnchor(d,h,c,l);var g=!1;r.forEach((function(t){var e=d.shift(),r=n._setItemHandlerPosition(t,i,e);g=g||r}));var m=this._itemHandlers.cast().where(this._filterHiddenItems),y=!1;if(m.any()){var _=m.select((function(t){return t.getTransformedRectangle(!1,!0)})).aggregate((function(t,e){return B.RotatedRectangleF.union(t,e)})),v=this._getSourceRectangleByAnchorPoint(_,p,l,c);if(t){var b=Object(re.g)(v.center,o);v.setTransform(b)}this._itemHandler.setSourceRectangle(v),y=!i.equals(v,.01)}var w=g||y;return w&&(null===(e=this._itemHandler.canvas)||void 0===e||e.updateTexts()),w}},t.prototype._getSourceRectangleByAnchorPoint=function(t,e,n,r){var i=t.angle,o=t.toRectangleF();if(n==v.e.horizontal)if(r==v.c.start)o.left=e.x;else if(r==v.c.center){var a=o.center.x-e.x;o.left-=a}else o.right=e.x;else if(r==v.c.start)o.top=e.y;else if(r==v.c.center){var s=o.center.y-e.y;o.top-=s}else o.bottom=e.y;return B.RotatedRectangleF.fromRectangleF(o,i)},t.prototype._getAnchorPoint=function(t,e,n){if(n==v.e.horizontal){var r=t.center.y;switch(e){case v.c.start:return new B.PointF(t.left,r);case v.c.center:return new B.PointF(t.center.x,r);case v.c.end:return new B.PointF(t.right,r)}}else{var i=t.center.x;switch(e){case v.c.start:return new B.PointF(i,t.top);case v.c.center:return new B.PointF(i,t.center.y);case v.c.end:return new B.PointF(i,t.bottom)}}},t.prototype._applyAnchor=function(t,e,n,r){if(0==t.length)return t;if(n==v.c.start)return t;var i=function(t){var i=0,o=0,a=t.reduce((function(t,e){return B.RectangleF.union(t,e)}));if(r==v.e.horizontal)if(n==v.c.center)i=a.center.x-e.center.x;else{if(n!=v.c.end)throw new Error("Invalid _applyAnchor operation. Orientation: '"+r+"' AnchorPoint: '"+n+"'");i=a.right-e.right}else if(n==v.c.center)o=a.center.y-e.center.y;else{if(n!=v.c.end)throw new Error("Invalid _applyAnchor operation. Orientation: '"+r+"' AnchorPoint: '"+n+"'");o=a.bottom-e.bottom}return new B.PointF(i,o)}(t);return t.map((function(t){return new B.RectangleF(t.left-i.x,t.top-i.y,t.width,t.height)}))},t.prototype._setItemHandlerPosition=function(t,e,n){var r=this,i=function(t){var o=t.getTransformedRectangle(!1,!0),a=o.clone();o.rotateAt(-e.angle,e.center);var s=o.bounds,l=n.left-s.left,u=n.top-s.top;return o.translate(l,u),o.rotateAt(e.angle,e.center),!a.equals(o)&&(r._setItemHandlerRectangle(t,o,i),!0)};return i(t)},t.prototype._setItemHandlerRectangle=function(t,e,n){var r=t.getBorderMargin();e.width-=2*r,e.height-=2*r,t instanceof qe?t.setRectangle(e,!0,!0):(t.setRectangle(e),t instanceof Z.a&&t.updateContentAndFrames(n),t instanceof it&&t.getNestedItemHandlers(!0).forEach((function(t){n(t)})))},t.prototype._getPositionRectOffset=function(t,e,n){return t==v.e.vertical?n.bottom-e.top:n.right-e.left},t.prototype._getItemHandlerPositionRect=function(t,e,n,r,i){var o=t.getTransformedRectangle(!1,!0);o.angle-=e.angle;var a=o.bounds,s=this._getOriginalPoint(a,r,i),l=n.x-s.x,u=n.y-s.y;return r===v.b.none&&i!==v.e.horizontal||(a.left+=l),r===v.b.none&&i!==v.e.vertical||(a.top+=u),a},t.prototype._getOriginalPoint=function(t,e,n,r){var i;return void 0===r&&(r=0),n==v.e.vertical?(i=e==v.b.start||e==v.b.none?new B.PointF(t.left,t.top):e==v.b.center?new B.PointF(t.center.x,t.top):new B.PointF(t.right,t.top)).y+=r:(i=e==v.b.start||e==v.b.none?new B.PointF(t.left,t.top):e==v.b.center?new B.PointF(t.left,t.center.y):new B.PointF(t.left,t.bottom)).x+=r,i},t}(),He=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ue=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},We=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Ve=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},qe=function(t){function e(n,r,i,o){void 0===o&&(o=null);var a=t.call(this,n,r,o)||this;return a._history=i,a._layoutEvent=new At.a,a._visibilityState=null,a._visibilityStateChangedEvent=new At.a,a._isEmpty=null,a._disableApplyLayout=!1,a._rectMap={},a._onChildItemChanged=function(t){var e=a.canvas.getItemHandler(t),n=e.rectangle;n.equals(a._rectMap[e.uniqueId])||(a._rectMap[e.uniqueId]=n,a.applyLayout())},a._onChildItemHandlerVisibilityChanged=function(){a._updateVisibilityState(),a.applyLayout()},a._onChildItemHandlerLayout=function(t){t&&(a._updateVisibilityState(),a.applyLayout())},a._onChildItemHandlerChanging=function(t){null!=a._layoutHandler&&a._layoutHandler instanceof De||a._resetSourceRectangle(),a.raiseChanging(a.item)},a._transformStarted=!1,a._transformedRectangle=null,a._applyMatrix=function(t,n,r){void 0===r&&(r=null);var i=function(e){return e.setRectangle(e.rectangle.transformByMatrix(t,r),!n)};if(i(a),a._transformStarted)for(var o=[a];o.length>0;)o.shift().itemHandlers.ofType(K.a).forEach((function(t){i(t),t instanceof e&&o.push(t),t instanceof Z.a&&null!=t.content&&i(t.content)}))},a._onItemHandlerExitedEditMode=function(t){a._updateVisibilityState(),a.applyLayout(t)},a._onItemHandlerEnteredEditMode=function(t){a._updateVisibilityState()},a._onChildGroupItemsChanged=function(t,e){"items"==e&&a._subscribeChildItemChanges(t)},a._subscribeChildItemHandlers(),a}return He(e,t),e.prototype.getSelectionRectangle=function(){return this._getRectangleFromChildren()},e.prototype._getHighlightRectangle=function(){return this._getRectangleFromChildren()},e.prototype.setItemHandlers=function(e){var n=this;this._unsubscribeChildItemHandlers(),this._disableApplyLayout=!0,t.prototype.setItemHandlers.call(this,e),this._disableApplyLayout=!1,this._initSourceRectangle().then((function(){n._initLayoutHandler(),n.applyLayout(null)})),this._subscribeChildItemHandlers()},e.prototype._isGroupHandler=function(){return!0},e.prototype._onItemPropertyChanged=function(t,e){"layoutSettings"===e&&this._initLayoutHandler()},e.prototype._initLayoutHandler=function(){this.item.layoutSettings instanceof v.f?this._layoutHandler instanceof De?this._layoutHandler._init():(this._layoutHandler=new De(this.item,this.itemHandlers,this,this._history),this._layoutHandler.getLayoutEvent().add(this._onLayoutHandlerLayoutEvent.bind(this))):(null!=this._layoutHandler&&this._layoutHandler.dispose(),this._layoutHandler=null)},e.prototype.getVisibilityStateChangedEvent=function(){return this._visibilityStateChangedEvent},e.prototype.getLayoutEvent=function(){return this._layoutEvent},e.prototype._onLayoutHandlerLayoutEvent=function(t){null!=this.canvas&&(this.canvas.updateSelection(),this.canvas.updateButtonGroups({placeholderHandler:this,placeholderHandlerPosition:!0,violationContainerHandler:this,violationContainerHandlerPosition:!0}),this.getChangingEvent().notify(this.item),this.canvas.redraw()),this._layoutEvent.notify(t)},e.prototype._initSourceRectangle=function(){return Ue(this,void 0,void 0,(function(){return We(this,(function(t){switch(t.label){case 0:return this.item.sourceRectangle&&!this.item.sourceRectangle.isEmpty()?[2]:[4,this._resetSourceRectangle()];case 1:return t.sent(),[2]}}))}))},e.prototype._resetSourceRectangle=function(){return Ue(this,void 0,void 0,(function(){var t;return We(this,(function(e){switch(e.label){case 0:return[4,this.waitUpdate()];case 1:return e.sent(),this.itemHandlers.any()&&(t=this.itemHandlers.cast().select((function(t){return t.rectangle})).aggregate((function(t,e){return B.RotatedRectangleF.union(t,e)})),this.setSourceRectangle(t)),[2]}}))}))},e.prototype.waitUpdate=function(){return Ue(this,void 0,void 0,(function(){return We(this,(function(t){switch(t.label){case 0:return[4,Promise.all(this.itemHandlers.toArray().map((function(t){return t.waitUpdate()})))];case 1:return t.sent(),[2]}}))}))},e.prototype.startTransform=function(e){this._originalHeight=this.height,this._transformStarted=!0,this._layoutHandler&&(this._layoutHandler.ignoreLayoutApply=!0),t.prototype.startTransform.call(this,e)},e.prototype.onResized=function(){var e=this.height/this._originalHeight;return null!=this.item.layoutSettings&&this.item.layoutSettings instanceof v.f&&(this.item.layoutSettings.margin*=e),t.prototype.onResized.call(this)},e.prototype._endTransform=function(e,n,r){var i,o,a,s;if(t.prototype._endTransform.call(this,e,n,r),null==this._transformedRectangle)return this._transformStarted=!1,void(this._layoutHandler&&(this._layoutHandler.ignoreLayoutApply=!1));null===(i=this.canvas)||void 0===i||i.pauseRedraw();var l=this._transformedRectangle;this._transformedRectangle=null,this._transformStarted=!1,null===(o=this._history)||void 0===o||o.pause(),this.setSourceRectangle(l),this._layoutHandler&&(this._layoutHandler.ignoreLayoutApply=!1),this.applyLayout(null),null===(a=this._history)||void 0===a||a.resume(!0,!1,!0),null===(s=this.canvas)||void 0===s||s.continueRedraw()},e.prototype._getChildrenHighlights=function(){var t=this;if(null==this._layoutHandler)return[];var e=[];return this.itemHandlers.toArray().filter((function(e){return t._layoutHandler._filterHiddenItems(e)})).forEach((function(t){return e.push.apply(e,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Ve(arguments[e]));return t}(t.getHighlightRectangles()))})),e},Object.defineProperty(e.prototype,"_calculateRectangleFromChild",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype._getRectangle=function(){return this._transformedRectangle?this._transformedRectangle:t.prototype._getRectangle.call(this)},e.prototype.isEmpty=function(){var t=this._calculateIsEmpty();return this._updateIsEmpty(t),t},e.prototype.isVisible=function(){return t.prototype.isVisible.call(this)&&!this.isEmpty()},e.prototype.applyLayout=function(t){return Ue(this,void 0,void 0,(function(){return We(this,(function(e){switch(e.label){case 0:return this._disableApplyLayout||t instanceof Z.a&&t.editing?[2]:[4,this.waitUpdate()];case 1:return e.sent(),this.item.layoutSettings instanceof v.f&&this._layoutHandler?this._layoutHandler.applyLayout():(this._resetSourceRectangle(),this._onLayoutHandlerLayoutEvent(!1)),[2]}}))}))},e.prototype.getControlBounds=function(){return this.item.sourceRectangle?this.item.sourceRectangle:new B.RectangleF},e.prototype.setRectangle=function(e,n,r){if(void 0===r&&(r=!0),this._transformStarted)return this._transformedRectangle=e.clone(),void(r&&t.prototype.setRectangle.call(this,e,n));r&&t.prototype.setRectangle.call(this,e,n),this.setSourceRectangle(e)},e.prototype.setSourceRectangle=function(t){this.item.sourceRectangle=t.toRectangleF(),this.item.transform=new B.Transform(1,1,0,0,t.angle)},e.prototype.getOrderedItems=function(){return this.item.layoutSettings instanceof v.f&&null!=this._layoutHandler?this._layoutHandler.getOrderedItems():t.prototype.getOrderedItems.call(this)},e.prototype.generateAndApplyAutolayoutSettings=function(t,e,n,r){this.item.layoutSettings=v.R.generateAutoLayoutSettings(this.itemHandlers.toArray().map((function(t){return t.getTransformedRectangle(!1,!0).bounds})),t,e,n,r)},e.prototype._onItemAdded=function(e){return Ue(this,void 0,void 0,(function(){return We(this,(function(n){switch(n.label){case 0:return t.prototype._onItemAdded.call(this,e),e.item instanceof v.o?[4,Cn.waitForItemsUpdated([e.item],this.canvas)]:[3,2];case 1:n.sent(),n.label=2;case 2:return this._subscribeChildItemChanges(e.item),this.applyLayout(this.itemHandlers.first((function(t){return t.item===e.item}))),[2]}}))}))},e.prototype._onItemRemoved=function(e){t.prototype._onItemRemoved.call(this,e),this._unsubscribeChildItemChanges(e.item),this._layoutHandler?this._layoutHandler.onItemRemoved(e):this._resetSourceRectangle()},e.prototype._onItemHandlerAdded=function(e){return Ue(this,void 0,void 0,(function(){return We(this,(function(n){return t.prototype._onItemHandlerAdded.call(this,e),this._layoutHandler instanceof De&&this._layoutHandler.onItemHandlersCollectionChanged(),this.applyLayout(),[2]}))}))},e.prototype._updateVisibilityState=function(){var t=this.isVisible();t!==this._visibilityState&&(this._visibilityState=t,this._onVisibilityStateChanged())},e.prototype._onVisibilityStateChanged=function(){this.applyLayout(),this._visibilityStateChangedEvent.notify()},e.prototype._onItemHandlerRemoved=function(e){t.prototype._onItemHandlerRemoved.call(this,e),this._layoutHandler instanceof De&&this._layoutHandler.onItemHandlersCollectionChanged()},e.prototype._subscribeChildItemHandlers=function(){var t,e=this;null===(t=this.itemHandlers)||void 0===t||t.forEach((function(t){return e._subscribeChildItemHandler(t)}))},e.prototype._unsubscribeChildItemHandlers=function(){var t=this;this.itemHandlers.forEach((function(e){return t._unsubscribeChildItemHandler(e)}))},e.prototype._subscribeChildItemHandler=function(t){t.getChangingEvent().add(this._onChildItemHandlerChanging),t instanceof Qt&&(t.exitedEditModeEvent.add(this._onItemHandlerExitedEditMode),t.enteredEditModeEvent.add(this._onItemHandlerEnteredEditMode)),t instanceof e&&(t.getLayoutEvent().add(this._onChildItemHandlerLayout),t.getVisibilityStateChangedEvent().add(this._onChildItemHandlerVisibilityChanged))},e.prototype._unsubscribeChildItemHandler=function(t){t.getChangingEvent().remove(this._onChildItemHandlerChanging),t instanceof Qt&&(t.exitedEditModeEvent.remove(this._onItemHandlerExitedEditMode),t.enteredEditModeEvent.remove(this._onItemHandlerEnteredEditMode)),t instanceof e&&(t.getLayoutEvent().remove(this._onChildItemHandlerLayout),t.getVisibilityStateChangedEvent().remove(this._onChildItemHandlerVisibilityChanged))},e.prototype._unsubscribeChildItems=function(){var t=this;this.item.items.forEach((function(e){return t._unsubscribeChildItemChanges(e)}))},e.prototype._subscribeChildItems=function(){var t=this;this.item.items.forEach((function(e){return t._subscribeChildItemChanges(e)}))},e.prototype._unsubscribeChildItemChanges=function(t){var e=this;t instanceof v.G&&(t.applyToItems((function(t){return e._unsubscribeChildItemChanges(t)})),t.removePropertyChanged(this._onChildGroupItemsChanged)),t.getItemChangedEvent().remove(this._onChildItemChanged)},e.prototype._subscribeChildItemChanges=function(t){var e=this;t instanceof v.G&&(t.applyToItems((function(t){return e._subscribeChildItemChanges(t)})),t.addPropertyChanged(this._onChildGroupItemsChanged)),t.getItemChangedEvent().add(this._onChildItemChanged)},e.prototype._onRemovedFromCanvas=function(e){return Ue(this,void 0,void 0,(function(){return We(this,(function(n){return this._unsubscribeChildItems(),this._unsubscribeChildItemHandlers(),t.prototype._onRemovedFromCanvas.call(this,e),[2]}))}))},e.prototype._onAddedOnCanvas=function(e){return Ue(this,void 0,void 0,(function(){return We(this,(function(n){switch(n.label){case 0:return t.prototype._onAddedOnCanvas.call(this,e),this._subscribeChildItems(),this._initLayoutHandler(),[4,this._initSourceRectangle()];case 1:return n.sent(),[2]}}))}))},e.prototype.drawItemHandler=function(e){this.isEmpty()||t.prototype.drawItemHandler.call(this,e)},Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},enumerable:!0,configurable:!0}),e.prototype.isChildVisible=function(t){return!(t instanceof k.a||t instanceof Qt)||!t.isEmpty()},e.prototype._calculateIsEmpty=function(){var t=this.itemHandlers.where((function(t){var n=!1;return((t instanceof k.a||t instanceof Qt)&&!t.isLocked()||t instanceof e)&&(n=!0),n}));return!!t.any()&&!t.any((function(t){return!t.isEmpty()}))},e.prototype._updateIsEmpty=function(t){t!==this._isEmpty&&(this._isEmpty=t,this._onEmptyStateChanged())},e.prototype._onEmptyStateChanged=function(){this.itemHandlers.forEach((function(t){return t.update()}))},e.typeName="LayoutItemHandler",e}(it),Ge=function(){function t(){}return t.insert=function(t,e,n){if(null==t)throw new Error("input string must not be null");if(e<0)throw new Error("index must be positive number");if(e>t.length)throw new console.error("index must not be greater than string length");return t.substring(0,e)+n+t.substring(e)},t.containsRtlChars=function(t){return new RegExp("^[^"+this._rtlChars+"]*?["+this._rtlChars+"]").test(t)},t.removeRtlChars=function(t){var e=new RegExp("["+this._rtlChars+"]","g");return null==t?void 0:t.replace(e,"")},t.toSingleLine=function(t){return null==t?void 0:t.replace(/[\r\n]/g," ")},t._rtlChars="֑-߿יִ-﷽ﹰ-ﻼ",t}(),$e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xe=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},Ke=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Ye=function(t){function e(e,n,r,i,o,a,s){return void 0===i&&(i=null),t.call(this,e,n,r,i,o,a,s)||this}return $e(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),e.prototype.isHighlightNeeded=function(){return!0},e.prototype.getFramesData=function(){var t={point:this.item.center.clone(),bend:this.isInEdit?0:this.item.bend};return{type:te.a.archedTextFrame,frames:[t]}},e.prototype.getWrappingPathData=function(){return{}},e.prototype.setTextWhizzWrappingPath=function(t){},e.prototype._onItemPropertyChanged=function(e,n){switch(n){case"center":case"bend":case"warp":this.update()}t.prototype._onItemPropertyChanged.call(this,e,n)},e.prototype._setDataItem=function(e,n){t.prototype._setDataItem.call(this,e,n),this.item.center=e.center,this.item.bend=e.bend,this.item.warp=e.warp},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips.setCornerArbitrary(!1),e.manipulation.resizeGrips.edge=!1,e},e.prototype._applyTransform=function(t,e,n){var r,i;return Xe(this,void 0,void 0,(function(){var o,a,s;return Ke(this,(function(l){switch(l.label){case 0:return t instanceof v.a?(t.center.clone(),(o=t.center.clone()).transform(e,n),t.center=o,a=this._getPreviewScaleLimits(),s=this.item.previewScale*e.scaleX,s=Math.min(null!==(r=a.max)&&void 0!==r?r:Number.MAX_VALUE,s),s=Math.max(null!==(i=a.min)&&void 0!==i?i:Number.MIN_VALUE,s),t.font.size=t.font.size*s,[4,this._scaleFontSizes(t,s)]):[2];case 1:return l.sent(),[4,this._updateRectangleAfterTextScale(t)];case 2:return l.sent(),this.textEditorController.updateText("frame",!0),[2]}}))}))},e.prototype._scaleFontSizes=function(t,e){return Xe(this,void 0,void 0,(function(){var n,r,i,o,a,s,l,u;return Ke(this,(function(c){switch(c.label){case 0:return n=new Re.a(this._colorParser),r=new Ee.a(this._colorParser),i=new Le.d,(o=i.create()).initialize(),s=je.a.bind,[4,Cn.getColorPalette(t,this._colorPreviewService)];case 1:return a=new(s.apply(je.a,[void 0,c.sent()])),l=n.parse(t.text,a,t.font.size,o),this._scaleTextModelStyles(l,e),u=r.serialize(l,a),t.text=u,[2]}}))}))},e.prototype._scaleTextModelStyles=function(t,e){t.blocks.forEach((function(t){t instanceof Ne.Paragraph&&t.inlineElements.forEach((function(t){if(t instanceof Ne.Span){var n=t.style;(null==n?void 0:n.fontSize)&&(n.fontSize.value*=e)}}))}))},e.prototype._updateRectangleAfterTextScale=function(t){return Xe(this,void 0,void 0,(function(){var e,n;return Ke(this,(function(r){switch(r.label){case 0:return[4,this.textEditorController.waitUpdate()];case 1:return r.sent(),e=t.sourceRectangle,n=new B.RectangleF(e.left,e.top,e.width,e.height),this.updateRectangle(n,!1),[2]}}))}))},e.typeName="NewArchedTextItemHandler",e}(Qt),Je=(function(){function t(t,e,n,r){var i=this;this._handlers=new Map,this._beforeReplaceItemHandlerEvent=new At.a,this._afterReplaceItemHandlerEvent=new At.a,this.get=function(t){var e;if(!i._handlers.has(t)){var n=i._createItemHandler(t);i._handlers.set(t,n),i._initItemHandler(n)}var r=i._handlers.get(t);return(null===(e=i._canvas)||void 0===e?void 0:e.doesContainItem(t))&&r.canvas!=i._canvas&&(r.canvas=i._canvas),r},this._canvas=t,this._fontRegistry=t.fontRegistry,this._textEditorControllerFactory=e,this._colorPreviewService=n,this._colorParser=r}Object.defineProperty(t.prototype,"beforeReplaceItemHandlerEvent",{get:function(){return this._beforeReplaceItemHandlerEvent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"afterReplaceItemHandlerEvent",{get:function(){return this._afterReplaceItemHandlerEvent},enumerable:!0,configurable:!0}),t.prototype.delete=function(t){var e=this;t instanceof it&&t.itemHandlers.forEach((function(t){return e.delete(t)})),t instanceof Z.a&&(t.content&&this.delete(t.content),t.topFrames&&t.topFrames.forEach((function(t){return e.delete(t)})),t.bottomFrames&&t.bottomFrames.forEach((function(t){return e.delete(t)}))),this._handlers.has(t.item)&&(this._handlers.delete(t.item),t.dispose())},t.prototype.clear=function(){var t,e;try{for(var n=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this._handlers.values()),r=n.next();!r.done;r=n.next()){var i=r.value;this.delete(i)}}catch(o){t={error:o}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t.prototype.replaceItemHandler=function(t,e){this._canvas.pauseUpdateTexts();var n=this.get(t),r=this._canvas.isItemHandlerSelected(n);this._beforeReplaceItemHandlerEvent.notify(n),this._handlers.delete(t);var i=this.get(null!=e?e:t),o=n.parentGroupItemHandler;if(null!=o)o.replaceItemHandler(n,i);else{var a=n.layer.itemHandlers,s=a.indexOf(n);a.remove(n),a.insertAt(s,i)}n.dispose(),n.item=null,this._canvas.resumeUpdateTexts(),this._afterReplaceItemHandlerEvent.notify(i),r&&this._canvas.addSelectedItemHandler(i)},t.prototype.replaceTextItemHandler=function(t){if(t instanceof v.o){var e=this._useOldItemHandler(t,!1),n=this.get(t);(e&&n instanceof Qt||!e&&n instanceof k.a)&&this.replaceItemHandler(t)}},t.prototype.setFontRegistry=function(t){this._fontRegistry=t},t.prototype._initItemHandler=function(t){var e=this;if(t instanceof qe){this._canvas.pauseUpdateTexts();var n=t.item.items.select((function(t){return e.get(t)}));t.setItemHandlers(n.toArray()),this._canvas.resumeUpdateTexts()}},t.prototype._createItemHandler=function(t){var e,n,r,i,a,s,l,u,c,h,p,f,d,g,m,y,_,b,w,C,P,S,x,I,O,T,L,R=this,E=null===(e=this._canvas)||void 0===e?void 0:e.designAtomsApiClient;if(t.type===v.gb.type)return new Ct.a(t,null===(n=this._canvas)||void 0===n?void 0:n.textWhizz,E,this._colorPreviewService);if((null==(L=t)?void 0:L.type)===v.J.type)return new Pt.b(t,null===(r=this._canvas)||void 0===r?void 0:r.textWhizz,E,this._colorPreviewService);if(function(t){return t.type===v.k.type}(t))return new X(t,null===(i=this._canvas)||void 0===i?void 0:i.textWhizz,E,this._colorPreviewService);if(function(t){return t.type===v.cb.type}(t)){var j=new Z.a(t,null===(a=this._canvas)||void 0===a?void 0:a.textWhizz,E,this._colorPreviewService);return null!=t.content&&(j.content=this.get(t.content)),j.bottomFrames=t.bottomFrames.map((function(t){return R.get(t)})),j.topFrames=t.topFrames.map((function(t){return R.get(t)})),j}if(t instanceof v.o)if(this._useOldItemHandler(t,!(null===(s=this._canvas)||void 0===s?void 0:s.frontEndTextRenderingEnabled))){if(N(t))return new J.a(t,null===(l=this._canvas)||void 0===l?void 0:l.textWhizz,E,this._colorPreviewService);if(B(t))return new St.a(t,null===(u=this._canvas)||void 0===u?void 0:u.textWhizz,E,this._colorPreviewService);if(k(t))return new ct(t,null===(c=this._canvas)||void 0===c?void 0:c.textWhizz,E,this._colorPreviewService);if(A(t))return new Tt.a(t,null===(h=this._canvas)||void 0===h?void 0:h.textWhizz,E,this._colorPreviewService);if(function(t){return t.type===v.g.type}(t))return new z(t,null===(p=this._canvas)||void 0===p?void 0:p.textWhizz,E,this._colorPreviewService);if(M(t))return new F(t,null===(f=this._canvas)||void 0===f?void 0:f.textWhizz,E,this._colorPreviewService)}else{if(N(t)||B(t))return new Te(this._fontRegistry,this._textEditorControllerFactory,t,null===(d=this._canvas)||void 0===d?void 0:d.textWhizz,E,this._colorPreviewService,this._colorParser);if(k(t))return new Be(this._fontRegistry,this._textEditorControllerFactory,t,null===(g=this._canvas)||void 0===g?void 0:g.textWhizz,E,this._colorPreviewService,this._colorParser);if(A(t))return new en(this._fontRegistry,this._textEditorControllerFactory,t,null===(m=this._canvas)||void 0===m?void 0:m.textWhizz,E,this._colorPreviewService,this._colorParser);if(M(t))return new Ye(this._fontRegistry,this._textEditorControllerFactory,t,null===(y=this._canvas)||void 0===y?void 0:y.textWhizz,E,this._colorPreviewService,this._colorParser)}if(function(t){return t.type===v.T.type}(t))return new gt(t,null===(_=this._canvas)||void 0===_?void 0:_.textWhizz,this._colorPreviewService);if(function(t){return t.type===v.y.type}(t))return new _t(t,null===(b=this._canvas)||void 0===b?void 0:b.textWhizz,this._colorPreviewService);if(function(t){return t.type===v.kb.type}(t))return new vt.a(t.sourcePath,t,null===(w=this._canvas)||void 0===w?void 0:w.textWhizz,E,this._colorPreviewService);if(function(t){return t.type===v.fb.type}(t))return new Ot(t,null===(C=this._canvas)||void 0===C?void 0:C.textWhizz,this._colorPreviewService);if(function(t){return t.type===v.F.type}(t))return new Et(t,null===(P=this._canvas)||void 0===P?void 0:P.textWhizz,this._colorPreviewService);if(function(t){return t.type===v.A.type}(t))return new wt(t,null===(S=this._canvas)||void 0===S?void 0:S.textWhizz,this._colorPreviewService);if(function(t){return t.type===v.G.type}(t))return new it(t,t.items.toArray().map((function(t){return R.get(t)})),null===(x=this._canvas)||void 0===x?void 0:x.textWhizz);if(function(t){return t.type===v.r.type}(t))return new at(t,t.items.toArray().map((function(t){return R.get(t)})),null===(I=this._canvas)||void 0===I?void 0:I.textWhizz);if(function(t){return t.type===v.R.type}(t))return new qe(t,null,null===(O=this._canvas)||void 0===O?void 0:O.history,null===(T=this._canvas)||void 0===T?void 0:T.textWhizz);throw new o.e("Item of type "+t.type+" not supported");function N(t){return t.type===v.q.type}function k(t){return t.type===v.x.type}function A(t){return t.type===v.eb.type}function B(t){return t.type===v.ab.type}function M(t){return t.type===v.a.type}},Object.defineProperty(t.prototype,"_debugWarnEnabled",{get:function(){return void 0===window.$DesignAtoms$WarnOnLegacyItemHandlers&&(window.$DesignAtoms$WarnOnLegacyItemHandlers=!1),window.$DesignAtoms$WarnOnLegacyItemHandlers},enumerable:!0,configurable:!0}),t.prototype._logUseOldItemHandler=function(t,e){this._debugWarnEnabled&&console.warn("Legacy text item handler created for item ["+t.type+"#"+t.name+"] reason: "+e+".")},t.getUseLegacyTextReasons=function(t){var e=[];return Ge.containsRtlChars(t.text)&&e.push("RTL text"),t instanceof v.g&&e.push("auto-scaled text"),null!=t.shadow&&e.push("shadow"),t.overlapLinesEnabled&&e.push("overlap lines enabled"),t instanceof v.q&&null!=t.scheduledFitMode&&e.push("scheduledFitMode = "+t.scheduledFitMode),e},t.prototype._useOldItemHandler=function(e,n){if(!0===n)return!0;var r=t.getUseLegacyTextReasons(e);return r.length>0&&(this._logUseOldItemHandler(e,r.join(", ")),!0)}}(),n(612),n(579),n(569),n(513),function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Ze=(function(t){function e(e){var n=t.call(this)||this;if(n._applyLayerAndCanvas=function(t){t.layer=n._layer;var e=n._layer.canvas;e&&(t.canvas=e),t instanceof it&&t.applyToItems(n._applyLayerAndCanvas)},!e)throw new o.b("layer");return n._layer=e,n}Je(e,t),e.prototype.insertAt=function(e,n){t.prototype.insertAt.call(this,e,n),this._onHandlerAdded(n)},e.prototype.move=function(e,n){return t.prototype.move.call(this,e,n)},e.prototype.removeAt=function(e){var n=t.prototype.removeAt.call(this,e);return n&&this._onHandlerRemoved(n),n},e.prototype.clear=function(){for(var e=0;e<this.length;e++)this.getItem(e).layer=null;t.prototype.clear.call(this)},e.prototype._onHandlerAdded=function(t){this._applyLayerAndCanvas(t)},e.prototype._onHandlerRemoved=function(t){var e=this._layer.canvas;e&&e.isItemHandlerSelected(t)&&e.removeSelectedItemHandler(t),t.layer=null,e&&(t.canvas=null)}}(Q.a),function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Qe=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},tn=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},en=function(t){function e(e,n,r,i,o,a,s){return void 0===i&&(i=null),t.call(this,e,n,r,i,o,a,s)||this}return Ze(e,t),Object.defineProperty(e.prototype,"item",{get:function(){return this._getItem()},set:function(e){t.prototype._setItem.call(this,e)},enumerable:!0,configurable:!0}),e.prototype.getFramesData=function(){var t=[];return t.push(this.item.baselineLocation.clone()),{type:te.a.pointTextFrame,frames:t}},e.prototype.setTextWhizzWrappingPath=function(t){},e.prototype.getWrappingPathData=function(){return{}},e.prototype.updateTextWhizzFrames=function(t){t.replaceFrame(this._createTextWhizzFrame(),0)},e.prototype._addTextWhizzFrames=function(t){t.addFrame(this._createTextWhizzFrame())},e.prototype._onItemPropertyChanged=function(e,n){return Qe(this,void 0,void 0,(function(){var r;return tn(this,(function(i){switch(i.label){case 0:switch(n){case"baselineLocation":return[3,1];case"isVertical":return[3,2];case"alignment":return[3,3]}return[3,5];case 1:return this.update(null,null,"frame"),[3,5];case 2:this.update(),i.label=3;case 3:return r=this._calculateTransformedRect(),this.update(),[4,this._correctBaselineLocation(r)];case 4:i.sent(),i.label=5;case 5:return t.prototype._onItemPropertyChanged.call(this,e,n),[2]}}))}))},e.prototype.waitInitFrontEndRendering=function(){return Qe(this,void 0,void 0,(function(){return tn(this,(function(e){switch(e.label){case 0:return[4,t.prototype.waitInitFrontEndRendering.call(this)];case 1:return e.sent(),[4,this._resetPreviewScale(this.item)];case 2:return e.sent(),[2]}}))}))},e.prototype._getDefaultPermissions=function(){var e=t.prototype._getDefaultPermissions.call(this);return e.manipulation.resizeGrips.setCornerArbitrary(!1),e.manipulation.resizeGrips.edge=!1,e},e.prototype._getEndTransformTrigger=function(t){return t?null:"frame"},e.prototype._applyTransform=function(t,e,n){var r,i;return Qe(this,void 0,void 0,(function(){var o,a,s;return tn(this,(function(l){switch(l.label){case 0:return t instanceof v.eb?((o=t.baselineLocation.clone()).transform(e,n),t.baselineLocation=o,a=this._getPreviewScaleLimits(),s=e.scaleY,s=Math.min(null!==(r=a.max)&&void 0!==r?r:Number.MAX_VALUE,s),s=Math.max(null!==(i=a.min)&&void 0!==i?i:Number.MIN_VALUE,s),[4,this._scaleFontSizes(t,s)]):[2];case 1:return l.sent(),[4,this._updateRectangleAfterTextScale(t,e)];case 2:return l.sent(),this.textEditorController.updateText("frame",!0),[2]}}))}))},e.prototype._updateRectangleAfterTextScale=function(t,e){return Qe(this,void 0,void 0,(function(){var n,r;return tn(this,(function(i){switch(i.label){case 0:return[4,this.textEditorController.waitUpdate()];case 1:return i.sent(),(n=t.sourceRectangle).updateByMatrix(e.toMatrix()),r=new B.RectangleF(n.left,n.top,n.width,n.height),this.updateRectangle(r,!1),[2]}}))}))},e.prototype._getPreviewScaleLimits=function(){var e,n,r=t.prototype._getPreviewScaleLimits.call(this);return this.item.leading>0&&(null==this.canvas.maxLeading||isNaN(this.canvas.maxLeading)||(r.max=Math.min(null!==(e=r.max)&&void 0!==e?e:Number.MAX_VALUE,this.canvas.maxLeading/this.item.leading)),null==this.canvas.minLeading||isNaN(this.canvas.minLeading)||(r.min=Math.max(null!==(n=r.min)&&void 0!==n?n:Number.MIN_VALUE,this.canvas.minLeading/this.item.leading))),r},e.prototype._calculateTransformedRect=function(){var t=B.RotatedRectangleF.fromRectangleF(this.item.sourceRectangle),e=this.item.transform;return t.setTransform(e),t.toRectangleF()},e.prototype._correctBaselineLocation=function(t){return Qe(this,void 0,void 0,(function(){var e,n,r;return tn(this,(function(i){switch(i.label){case 0:return[4,this._textEditorController.waitUpdate()];case 1:return i.sent(),e=this.item.baselineLocation.clone(),n=this.item.sourceRectangle,r=t.left-n.left,e.x+=r,this.item.baselineLocation=e,[2]}}))}))},e.prototype._resetPreviewScale=function(t){return Qe(this,void 0,void 0,(function(){var e;return tn(this,(function(n){switch(n.label){case 0:return e=this.item.previewScale,Math.abs(e-1)>1e-7?(this.item.previewScale=1,[4,this._scaleFontSizes(t,e)]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},e.prototype._scaleFontSizes=function(t,e){return Qe(this,void 0,void 0,(function(){return tn(this,(function(n){switch(n.label){case 0:return[4,this._scaleFontSizesInItem(t,e)];case 1:return n.sent(),[4,this._scaleFontSizesInMarkup(t,e)];case 2:return n.sent(),[4,this.textEditorController.waitUpdate()];case 3:return n.sent(),[2]}}))}))},e.prototype._scaleFontSizesInMarkup=function(t,e){return Qe(this,void 0,void 0,(function(){var n,r,i,o,a,s,l,u;return tn(this,(function(c){switch(c.label){case 0:return n=new Re.a(this._colorParser),r=new Ee.a(this._colorParser),i=new Le.d,(o=i.create()).initialize(),s=je.a.bind,[4,Cn.getColorPalette(t,this._colorPreviewService)];case 1:return a=new(s.apply(je.a,[void 0,c.sent()])),l=n.parse(t.text,a,t.font.size,o),this._scaleTextModelStyles(l,e),u=r.serialize(l,a),t.text=u,[2]}}))}))},e.prototype._scaleFontSizesInItem=function(t,e){return Qe(this,void 0,void 0,(function(){return tn(this,(function(n){return t.font.size*=e,t.leading*=e,[2]}))}))},e.prototype._scaleTextModelStyles=function(t,e){t.blocks.forEach((function(t){t instanceof Ne.Paragraph&&t.inlineElements.forEach((function(t){if(t instanceof Ne.Span){var n=t.style;(null==n?void 0:n.fontSize)&&(n.fontSize.value*=e),(null==n?void 0:n.leading)&&"pt"===n.leading.unit&&(n.leading.value*=e)}}))}))},e.prototype._createTextWhizzFrame=function(){var t=this.item.baselineLocation.clone(),e=this.item.previewScale;Object(B.EqualsOfFloatNumbers)(e,1)||t.scale(1/e,1/e);var n=new this._textWhizz.PointTextFrame;return n.point=t,n.textOrientation=this.item.isVertical?this._textWhizz.TextOrientation.vertical:this._textWhizz.TextOrientation.horizontal,n},e.prototype.updateRectangle=function(e,n){return Qe(this,void 0,void 0,(function(){var r,i,o,a,s,l;return tn(this,(function(u){switch(u.label){case 0:return n?(r=e.clone(),i=B.RotatedRectangleF.fromRectangleF(e),o=this.item.transform.angle,a=this.rectangle.center,s=e.clone().center,(l=this.item.baselineLocation.clone()).rotateAt(o,a),i.rotateAt(o,a),s.rotateAt(this.item.transform.angle,a),l.rotateAt(-o,s),i.rotateAt(-o,s),this.item.setBaselineLocation(l,!0),e=i.toRectangleF(),t.prototype.updateRectangle.call(this,e,n),this.hasLayoutAncestor?[2]:Object(re.j)(r,e)||null!=this.textEditor?[3,2]:[4,this.textEditorController.waitUpdate()]):[2,t.prototype.updateRectangle.call(this,e,n)];case 1:u.sent(),this.textEditorController.updateText("text",!0),u.label=2;case 2:return[2]}}))}))},e.typeName="NewPlainTextItemHandler",e}(Qt),nn=(n(479),n(581),n(577),n(460)),rn=n(463),on=n(477),an=n(449),sn=n(515),ln=n(570),un=n(591),cn=function(){return cn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},cn.apply(this,arguments)},hn=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},pn=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},fn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},dn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},gn=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(dn(arguments[e]));return t},mn=function(){function t(t,e,n){var r=this;this._productHandler=t,this._canvas=e,this._productThemeManager=n,this._applyImagePermissions=function(t,e){null!=t&&(e.allowChangeImage=b.a(e.allowChangeImage,t.allowChangeImage),e.allowEditImage=b.a(e.allowEditImage,t.allowEditImage),e.allowKeepOverlayColor=b.a(e.allowKeepOverlayColor,t.allowKeepOverlayColor))},this._applyBarcodePermissions=function(t,e){null!=t&&(e.allowChangeBarcodeType=b.a(e.allowChangeBarcodeType,t.allowChangeBarcodeType),e.allowChangeBarcodeContent=b.a(e.allowChangeBarcodeContent,t.allowChangeBarcodeContent),e.allowChangeBarcodeColor=b.a(e.allowChangeBarcodeColor,t.allowChangeBarcodeColor))},this._updateThemeForItem=function(t){return hn(r,void 0,void 0,(function(){return pn(this,(function(e){switch(e.label){case 0:return[4,this._productThemeManager.applyToItem(t,this._productThemeManager.currentProductTheme)];case 1:return e.sent(),[2]}}))}))},this._colorParser=this._canvas.viewer.colorParser,this._listStyleSheetManagerFactory=new Le.d(ln.a.getListSettingFromConfig(e.viewerConfiguration.listSettings))}return t.prototype.applyToItem=function(t,e,n){return void 0===n&&(n=null),hn(this,void 0,void 0,(function(){var r,i,o;return pn(this,(function(a){switch(a.label){case 0:return null==e?[2]:(r=Object.assign({ignorePermissions:!0,changePosition:!1,relativeToPrintArea:!0},n||{}),i=!1,o=function(){return i=!0},t.addPropertyChanged(o),t instanceof v.cb?[4,this._applyToPlaceholderItem(t,e,r)]:[3,2]);case 1:return a.sent(),[3,20];case 2:return t instanceof v.J?[4,this._applyToImage(t,e,r)]:[3,4];case 3:return a.sent(),[3,20];case 4:return t instanceof v.o?[4,this._applyToText(t,e,r)]:[3,6];case 5:return a.sent(),[3,20];case 6:return t instanceof v.k?[4,this._applyToBarcode(t,e,r)]:[3,8];case 7:return a.sent(),[3,20];case 8:return t instanceof v.A?[4,this._applyToEllipse(t,e,r)]:[3,10];case 9:return a.sent(),[3,20];case 10:return t instanceof v.gb?[4,this._applyToRectangle(t,e,r)]:[3,12];case 11:return a.sent(),[3,20];case 12:return t instanceof v.kb?[4,this._applyToShapeItem(t,e,r)]:[3,14];case 13:return a.sent(),[3,20];case 14:return t instanceof v.T?[4,this._applyToLineItem(t,e,r)]:[3,16];case 15:return a.sent(),[3,20];case 16:return t instanceof v.r?[4,this._applyToClipartItem(t,e,r)]:[3,18];case 17:return a.sent(),[3,20];case 18:return t instanceof v.G?[4,this._applyToGroupItem(t,e,r)]:[3,20];case 19:a.sent(),a.label=20;case 20:return t.removePropertyChanged(o),i&&null!=this._productHandler.product&&this._productHandler.product.getAllItems().includes(t)?[4,this._productHandler.getHandler(t).updateAsync()]:[3,22];case 21:a.sent(),this._canvas.redraw(),this._canvas.updateSelection(),a.label=22;case 22:return[2,i]}}))}))},t.prototype._applyToText=function(t,e,n){var r;return hn(this,void 0,void 0,(function(){var i;return pn(this,(function(o){switch(o.label){case 0:return null==e?[3,3]:(null!=e.textPermissions&&(t.textPermissions.allowChangeText=b.a(t.textPermissions.allowChangeText,e.textPermissions.allowChangeText),t.textPermissions.allowChangeFont=b.a(t.textPermissions.allowChangeFont,e.textPermissions.allowChangeFont),t.textPermissions.allowChangeFontSize=b.a(t.textPermissions.allowChangeFontSize,e.textPermissions.allowChangeFontSize),t.textPermissions.allowChangeFontColor=b.a(t.textPermissions.allowChangeFontColor,e.textPermissions.allowChangeFontColor),t.textPermissions.allowChangeTextAlignment=b.a(t.textPermissions.allowChangeTextAlignment,e.textPermissions.allowChangeTextAlignment),t.textPermissions.allowChangeTextBIU=b.a(t.textPermissions.allowChangeTextBIU,e.textPermissions.allowChangeTextBIU),t.textPermissions.allowChangeShadow=b.a(t.textPermissions.allowChangeShadow,e.textPermissions.allowChangeShadow),t.textPermissions.allowChangeStroke=b.a(t.textPermissions.allowChangeStroke,e.textPermissions.allowChangeStroke),t.textPermissions.allowTextFormatting=b.a(t.textPermissions.allowTextFormatting,e.textPermissions.allowTextFormatting),t.textPermissions.allowChangeStrokeColor=null!==(r=e.textPermissions.allowChangeStrokeColor)&&void 0!==r?r:t.textPermissions.allowChangeStrokeColor),(t instanceof v.eb||t instanceof v.q||t instanceof v.ab)&&(t.isVertical=b.a(t.isVertical,e.isVertical)),t instanceof v.x||t instanceof v.a||(t.maxLineCount=b.a(t.maxLineCount,e.maxLineCount)),t.maxLineLength=b.a(t.maxLineLength,e.maxLineLength),t instanceof v.q||t instanceof v.ab?(t.wrappingMargin=b.a(t.wrappingMargin,e.wrappingMargin),t.characterLimit=b.a(t.characterLimit,e.characterLimit),null==e.paragraphSettings?[3,2]:((i=new v.Z(t.paragraphSettings)).FirstLineIndent=b.a(i.FirstLineIndent,e.paragraphSettings.firstLineIndent),i.SpaceBefore=b.a(i.SpaceBefore,e.paragraphSettings.spaceBefore),i.SpaceAfter=b.a(i.SpaceAfter,e.paragraphSettings.spaceAfter),i.LeftIndent=b.a(i.LeftIndent,e.paragraphSettings.leftIndent),i.RightIndent=b.a(i.RightIndent,e.paragraphSettings.rightIndent),t.paragraphSettings=i,n.applyPropertiesDeep?[4,this._removeParagraphStyleFromText(t,e)]:[3,2])):[3,2]);case 1:o.sent(),o.label=2;case 2:if(t instanceof v.q){if(null!=e.verticalAlignment)if("string"==typeof e.verticalAlignment)switch(e.verticalAlignment.toLowerCase()){case"top":t.verticalAlignment=v.sb.Top;break;case"center":t.verticalAlignment=v.sb.Center;break;case"bottom":t.verticalAlignment=v.sb.Bottom}else t.verticalAlignment=e.verticalAlignment;t.shrinkMode=b.a(t.shrinkMode,this._convertShrinkMode(e.textShrinkMode))}t instanceof v.a&&(t.bend=b.a(t.bend,e.bend),t.warp=b.a(t.warp,e.warp)),o.label=3;case 3:return[4,this._applyToBaseTextItem(t,e,n)];case 4:return o.sent(),t instanceof v.q&&(t.overflowStrategy=b.a(t.overflowStrategy,this._convertOverflowStrategy(null==e?void 0:e.overflowStrategy))),[2]}}))}))},t.prototype._convertShrinkMode=function(t){if(null==t)return null;if("number"==typeof t)return t;switch(t){case"scale":return v.mb.Scale;case"size":return v.mb.Size;default:throw new o.a("Invalid shrink mode.")}},t.prototype._convertOverflowStrategy=function(t){if(null==t)return null;if("number"==typeof t)return t;switch(t){case"clip":return v.X.Clip;case"fitToWidth":return v.X.FitToWidth;case"fitToBox":return v.X.FitToBox;case"expandBox":return v.X.ExpandBox;default:throw new o.a("Invalid overflow strategy.")}},t.prototype._applyToLineItem=function(t,e,n){return hn(this,void 0,void 0,(function(){var r,i,o,a,s,l,u,c,h,p,f,d,g,m,y,_,w;return pn(this,(function(C){switch(C.label){case 0:return null!=e.linePermissions&&(t.linePermissions.allowChangeLineColor=b.a(t.linePermissions.allowChangeLineColor,e.linePermissions.allowChangeLineColor),t.linePermissions.allowChangeLineWidth=b.a(t.linePermissions.allowChangeLineWidth,e.linePermissions.allowChangeLineWidth)),r=this._productHandler.userEditContainer,i=this._productHandler.userEditPrintArea,o=null!=i?i.bounds.center:new B.PointF(50,50),a=null!=r?.4*this._productHandler.getPrintAreaVisualSize(r).width:10,(n.ignorePermissions||t.linePermissions.allowChangeLineWidth)&&(s=b.a(t.width,e.width),null!=r&&null!=r.region&&this._productHandler.suppressOutOfRegionManipulation?(l=this._calcNewGroupBounds(this._productHandler.selectedItems,s),Object(re.j)(B.RectangleF.intersect(r.region,l),l)&&(t.width=s)):t.width=s,t.fixedWidth=b.a(t.fixedWidth,e.fixedWidth)),n.changePosition&&(null!=e.point0?(t.sourcePoint0.x=b.a(t.sourcePoint0.x,e.point0.x),t.sourcePoint0.y=b.a(t.sourcePoint0.y,e.point0.y)):t.sourcePoint0=new B.PointF(o.x-a/2,o.y),null!=e.point1?(t.sourcePoint1.x=b.a(t.sourcePoint1.x,e.point1.x),t.sourcePoint1.y=b.a(t.sourcePoint1.y,e.point1.y)):t.sourcePoint1=new B.PointF(o.x+a/2,o.y)),null!=e.color&&(n.ignorePermissions||t.linePermissions.allowChangeLineColor)&&(u=this._colorParser.parse(e.color),t.color=b.a(t.color,u)),null!=e.overprintStroke&&(t.overprintStroke=e.overprintStroke),(c=this._productHandler.contentAngle)>0&&t.transform.rotate(-c),h=t.width+.01,null!=(p=null!=r?this._getRotatedRegion(r):null)&&(p.width-=h,p.height-=h,f=1,d=this._productHandler.getHandler(t),((g=t instanceof v.cb?d.getBoundsIncludingFrames():d.bounds).width>p.width||g.height>p.height)&&((m=Object(re.d)(re.a.from(g),re.a.from(p))).width*=.9,m.height*=.9,f=m.width/g.width),y=new B.PointF(g.left+g.width/2,g.top+g.height/2),_=y.x-p.left-p.width/2,w=y.y-p.top-p.height/2,t.transform.setScaleX(f*t.transform.scaleX),t.transform.setScaleY(f*t.transform.scaleY),t.transform.setTranslateX(t.transform.translateX-_-(d.getTransformedRectangle().centerX-y.x)*(1-f)),t.transform.setTranslateY(t.transform.translateY-w-(d.getTransformedRectangle().centerY-y.y)*(1-f))),[4,this._applyToItem(t,e,n)];case 1:return C.sent(),[2]}}))}))},t.prototype._applyToRectangle=function(t,e,n){return hn(this,void 0,void 0,(function(){return pn(this,(function(r){switch(r.label){case 0:return[4,this._applyToShapeItem(t,e,n)];case 1:return r.sent(),[2]}}))}))},t.prototype._applyToGroupItem=function(t,e,n){return hn(this,void 0,void 0,(function(){return pn(this,(function(r){switch(r.label){case 0:return[4,this._applyToItem(t,e,n)];case 1:return r.sent(),[2]}}))}))},t.prototype._applyToEllipse=function(t,e,n){return hn(this,void 0,void 0,(function(){return pn(this,(function(r){switch(r.label){case 0:return[4,this._applyToShapeItem(t,e,n)];case 1:return r.sent(),[2]}}))}))},t.prototype._applyToClipartItem=function(t,e,n){return hn(this,void 0,void 0,(function(){return pn(this,(function(r){switch(r.label){case 0:return[4,this._applyToItem(t,e,n)];case 1:return r.sent(),[2]}}))}))},t.prototype._applyToBarcode=function(t,e,n){return hn(this,void 0,void 0,(function(){var r;return pn(this,(function(i){switch(i.label){case 0:return this._applyBarcodePermissions(e.barcodePermissions,t.barcodePermissions),this._applyBarcodeOptions(t.barcodeOptions,e.barcodeOptions),null==e.barcodeContent||!t.barcodePermissions.allowChangeBarcodeContent&&n.ignorePermissions||!t.barcodeData.isEmpty||(r=new v.i(e.barcodeContent),t.barcodePermissions.allowChangeBarcodeType&&!n.ignorePermissions&&(r.barcodeFormat=t.barcodeFormat),r.barcodeFormat===v.j.QR_CODE&&r.barcodeSubType===v.m.None&&(r.barcodeSubType=v.m.Url),t.applyBarcodeData(r)),null!=e.color&&(n.ignorePermissions||t.barcodePermissions.allowChangeBarcodeColor)&&(t.color=this._colorParser.parse(e.color)),[4,this._applyToContentItem(t,e,n)];case 1:return[2,i.sent()]}}))}))},t.prototype._applyBarcodeOptions=function(t,e){var n,r,i,o,a,s,l,u,c,h,p,f;null!=e&&(t.margin=null!==(n=e.margin)&&void 0!==n?n:t.margin,t.pureBarcode=null!==(r=e.pureBarcode)&&void 0!==r?r:t.pureBarcode,t.errorCorrection=null!==(i=e.errorCorrection)&&void 0!==i?i:t.errorCorrection,t.characterSet=null!==(o=e.characterSet)&&void 0!==o?o:t.characterSet,t.pdf417Compact=null!==(a=e.pdf417Compact)&&void 0!==a?a:t.pdf417Compact,t.pdf417Compaction=null!==(s=e.pdf417Compaction)&&void 0!==s?s:t.pdf417Compaction,null!=e.pdf417Dimensions&&(t.pdf417Dimensions=cn({},e.pdf417Dimensions)),t.disableEci=null!==(l=e.disableEci)&&void 0!==l?l:t.disableEci,t.code128ForceCodesetB=null!==(u=e.code128ForceCodesetB)&&void 0!==u?u:t.code128ForceCodesetB,t.aztecLayers=null!==(c=e.aztecLayers)&&void 0!==c?c:t.aztecLayers,t.qrVersion=null!==(h=e.qrVersion)&&void 0!==h?h:t.qrVersion,t.xDimension=null!==(p=e.xDimension)&&void 0!==p?p:t.xDimension,t.databarExpandedSegments=null!==(f=e.databarExpandedSegments)&&void 0!==f?f:t.databarExpandedSegments)},t.prototype._applyToPlaceholderItem=function(e,n,r){var i,o,a,s,l,u,c,h,p,f;return hn(this,void 0,void 0,(function(){var d,g,m,y,_,w,C,P,S,x,I,T;return pn(this,(function(L){switch(L.label){case 0:if(null!=n.placeholderPermissions&&(e.placeholderPermissions.allowEditContent=b.a(e.placeholderPermissions.allowEditContent,n.placeholderPermissions.allowEditContent),e.placeholderPermissions.showSelectButton=b.a(e.placeholderPermissions.showSelectButton,n.placeholderPermissions.showSelectButton),e.placeholderPermissions.showHandleButton=b.a(e.placeholderPermissions.showHandleButton,n.placeholderPermissions.showHandleButton)),n.contentFillColor&&(e.contentFillColor=this._colorParser.parse(n.contentFillColor),e.content&&e.content.type==v.J.type&&e.content.effect===v.I.Colorize&&(e.content.fillColor=this._colorParser.parse(n.contentFillColor))),null!=(d=n.contentPermissions)&&(null!=(g=d.barcodePermissions)&&((m=e.contentPermissions.barcodePermissions).allowChangeBarcodeColor=null!==(i=g.allowChangeBarcodeColor)&&void 0!==i?i:m.allowChangeBarcodeColor,m.allowChangeBarcodeContent=null!==(o=g.allowChangeBarcodeContent)&&void 0!==o?o:m.allowChangeBarcodeContent,m.allowChangeBarcodeType=null!==(a=g.allowChangeBarcodeType)&&void 0!==a?a:m.allowChangeBarcodeType),null!=(y=d.imagePermissions)&&((_=e.contentPermissions.imagePermissions).allowChangeImage=null!==(s=y.allowChangeImage)&&void 0!==s?s:_.allowChangeImage,_.allowEditImage=null!==(l=y.allowEditImage)&&void 0!==l?l:_.allowEditImage,_.allowKeepOverlayColor=null!==(u=y.allowKeepOverlayColor)&&void 0!==u?u:_.allowKeepOverlayColor)),e.violationSettings.allowImageQuality=null!==(h=null===(c=n.violationSettings)||void 0===c?void 0:c.allowImageQuality)&&void 0!==h?h:e.violationSettings.allowImageQuality,null!=n.contentResizeMode)switch(n.contentResizeMode.toLowerCase()){case"original":e.contentResizeMode=v.ib.Original;break;case"fill":e.contentResizeMode=v.ib.Fill;break;case"fit":e.contentResizeMode=v.ib.Fit}return e.isStubContent=b.a(e.isStubContent,n.isStubContent),e.allowedSubfolder=b.a(e.allowedSubfolder,n.allowedSubfolder),e.allowedTabs=b.a(e.allowedTabs,n.allowedTabs),e.isVariable=b.a(e.isVariable,n.isVariable),e.isCoverMode=b.a(e.isCoverMode,n.isCoverMode),e.fixedStubContentSize=b.a(e.fixedStubContentSize,n.fixedStubContentSize),w=null!==(p=n.barcodeFormat)&&void 0!==p?p:null===(f=n.barcodeContent)||void 0===f?void 0:f.barcodeFormat,e.barcodeFormat=b.a(e.barcodeFormat,w),null==e.content&&(C=void 0,null!=n.contentImageUrl?C=new v.J:e.isBarcodePlaceholder&&(P=t.getBarcodeRatio(e.barcodeFormat),C=new v.k(null,null,null,new B.RectangleF(0,0,P.width,P.height))),e.content=C),null==e.content?[3,5]:((S=O.clone(r)).changePosition=!1,null!=n.contentOverlayEffect&&Cn.applyOverlayEffect(e,n.contentOverlayEffect),e.content instanceof v.J?(x={imageUrl:n.contentImageUrl,imagePermissions:e.contentPermissions.imagePermissions,overlayEffect:n.contentOverlayEffect},[4,this._applyToImage(e.content,x,S)]):[3,2]);case 1:return L.sent(),[3,4];case 2:return e.content instanceof v.k?[4,this._applyToBarcode(e.content,{barcodeContent:n.barcodeContent||{barcodeFormat:e.barcodeFormat,barcodeValue:""},barcodePermissions:e.contentPermissions.barcodePermissions,barcodeOptions:n.contentBarcodeOptions,color:n.contentBarcodeColor},S)]:[3,4];case 3:L.sent(),e.barcodeFormat=e.content.barcodeFormat,e.shapePermissions.allowChangeFillColor=!0,L.label=4;case 4:null==e.barcodeFormat&&(e.imageContent.allowedSubfolder=e.allowedSubfolder,e.imageContent.allowedTabs=e.allowedTabs),L.label=5;case 5:return[4,this._applyToShapeItem(e,n,r)];case 6:return L.sent(),null==n.contentImageUrl&&null==e.barcodeFormat?[2]:[4,(I=this._productHandler.getHandler(e.content)).waitUpdate()];case 7:return L.sent(),T=this._productHandler.getHandler(e),I.updateRectangle(!1,e.contentResizeMode,T),[2]}}))}))},t.prototype._applyToImage=function(t,e,n){var r,i;return hn(this,void 0,void 0,(function(){var o;return pn(this,(function(a){switch(a.label){case 0:return null==e?[3,3]:(this._applyImagePermissions(e.imagePermissions,t.imagePermissions),t.violationSettings.allowImageQuality=null!==(i=null===(r=e.violationSettings)||void 0===r?void 0:r.allowImageQuality)&&void 0!==i?i:t.violationSettings.allowImageQuality,null==e.imageUrl||!n.ignorePermissions&&!t.imagePermissions.allowChangeImage?[3,2]:((o=this._productHandler.getHandler(t)).canvas=this._canvas,[4,o.loadImage(e.imageUrl,{downloadToServerCache:!0,actualSize:!1,saveAspectRatio:!0})]));case 1:a.sent(),a.label=2;case 2:if(null!=e.overlayEffect&&Cn.applyOverlayEffect(t,e.overlayEffect),null!=e.overlayColor&&(Cn.setOverlayEffectColor(t,this._colorParser.parse(e.overlayColor)),console.warn("IImageItemData.overlayColor is deprecated. Use IImageItemData.overlayEffect instead.")),null!=e.effect)switch(e.effect.toLowerCase()){case"none":t.effect=v.I.None;break;case"blackandwhite":t.effect=v.I.BlackAndWhite;break;case"grayscale":t.effect=v.I.Grayscale;break;case"flipvertical":t.effect=v.I.FlipVertical;break;case"fliphorizontal":t.effect=v.I.FlipHorizontal;break;case"colorize":t.effect=v.I.Colorize;break;case"blackandtransparent":t.effect=v.I.BlackAndTransparent;break;default:console.error("Unknown image effect:",e.effect)}a.label=3;case 3:return[4,this._applyToContentItem(t,e,n)];case 4:return[2,a.sent()]}}))}))},t.prototype._applyToContentItem=function(t,e,n){return hn(this,void 0,void 0,(function(){return pn(this,(function(r){switch(r.label){case 0:return null!=e&&(t.isVariable=b.a(t.isVariable,e.isVariable),t.maskOpacity=b.a(t.maskOpacity,e.maskOpacity)),[4,this._applyToShapeItem(t,e,n)];case 1:return[2,r.sent()]}}))}))},t.prototype._applyToShapeItem=function(t,e,n){var r,i;return void 0===e&&(e=null),hn(this,void 0,void 0,(function(){var o,a,s,l;return pn(this,(function(u){switch(u.label){case 0:return null!=e&&(null!=e.shapePermissions&&(t.shapePermissions.allowChangeBorderColor=b.a(t.shapePermissions.allowChangeBorderColor,e.shapePermissions.allowChangeBorderColor),t.shapePermissions.allowChangeBorderWidth=b.a(t.shapePermissions.allowChangeBorderWidth,e.shapePermissions.allowChangeBorderWidth),t.shapePermissions.allowChangeFillColor=b.a(t.shapePermissions.allowChangeFillColor,e.shapePermissions.allowChangeFillColor)),t.violationSettings.allowShape=null!==(i=null===(r=e.violationSettings)||void 0===r?void 0:r.allowShape)&&void 0!==i?i:t.violationSettings.allowShape,(n.ignorePermissions||t.shapePermissions.allowChangeBorderWidth)&&(o=null!=t.parentContainer?t.parentContainer:this._productHandler.userEditContainer,a=b.a(t.borderWidth,e.borderWidth),null!=o&&null!=o.region&&this._productHandler.suppressOutOfRegionManipulation?(s=this._calcNewGroupBounds(this._productHandler.selectedItems,a),Object(re.j)(B.RectangleF.intersect(o.region,s),s)&&(t.borderWidth=a)):t.borderWidth=a),null!=e.borderColor&&(n.ignorePermissions||t.shapePermissions.allowChangeBorderColor)&&(t.borderColor=this._colorParser.parse(e.borderColor)),null!=e.fillColor&&(n.ignorePermissions||t.shapePermissions.allowChangeFillColor)&&(l=this._colorParser.parse(e.fillColor),t instanceof v.cb&&t.isBarcodePlaceholder?t.content.fillColor=l:t.fillColor=l),null!=e.overprintFill&&(t.overprintFill=e.overprintFill),null!=e.overprintStroke&&(t.overprintStroke=e.overprintStroke)),[4,this._applyToItem(t,e,n)];case 1:return u.sent(),[2]}}))}))},t.prototype._applyToBaseTextItem=function(e,n,r){var i,o,a,s,l,u,c,h,p,f;return hn(this,void 0,void 0,(function(){var d,g,m,y,_,w,C,P,S,x=this;return pn(this,(function(I){switch(I.label){case 0:return null==n?[3,3]:((r.ignorePermissions||e.textPermissions.allowChangeText)&&(e.text=b.a(e.text,n.text)),(r.ignorePermissions||e.textPermissions.allowChangeTextBIU)&&(e.underline=b.a(e.underline,n.underline)),e.violationSettings.allowTextCrop=null!==(o=null===(i=n.violationSettings)||void 0===i?void 0:i.allowTextCrop)&&void 0!==o?o:e.violationSettings.allowTextCrop,e.violationSettings.allowInPlaceText=null!==(s=null===(a=n.violationSettings)||void 0===a?void 0:a.allowInPlaceText)&&void 0!==s?s:e.violationSettings.allowInPlaceText,e.tracking=b.a(e.tracking,n.tracking),null!=n.previewLeading?e.previewLeading=b.a(e.previewLeading,n.previewLeading):e.leading=b.a(e.leading,n.leading),(r.ignorePermissions||e.textPermissions.allowChangeTextAlignment)&&(e.alignment=b.a(e.alignment,n.alignment)),e.horizontalScale=b.a(e.horizontalScale,n.horizontalScale),e.verticalScale=b.a(e.verticalScale,n.verticalScale),e.previewScale=b.a(e.previewScale,n.previewScale),e.overlapLinesEnabled=b.a(e.overlapLinesEnabled,n.overlapLinesEnabled),e.checkTextCrop=b.a(e.checkTextCrop,n.checkTextCrop),e.isVariable=null!==(l=n.isVariable)&&void 0!==l?l:e.isVariable,null!=n.color&&(r.ignorePermissions||e.textPermissions.allowChangeFontColor)&&(S=this._colorParser.parse(n.color),e.color=b.a(e.color,S)),null==n.font?[3,2]:((r.ignorePermissions||e.textPermissions.allowChangeTextBIU)&&(e.font.fauxBold=b.a(e.font.fauxBold,n.font.fauxBold),e.font.fauxItalic=b.a(e.font.fauxItalic,n.font.fauxItalic)),(r.ignorePermissions||e.textPermissions.allowChangeFont)&&(e.font.postScriptName=b.a(e.font.postScriptName,n.font.postScriptName)),(r.ignorePermissions||e.textPermissions.allowChangeFontSize)&&(null!=n.font.previewSize?(d=t.parseItemsDataValueRelativeToHeight(n.font.previewSize,this._productHandler,r.relativeToPrintArea),g=b.a(e.previewFontSize,d),m=e.previewFontSize,e.previewFontSize=g,e instanceof v.x&&(y=this._productHandler.getHandler(e),_=y.getTransformedRectangle().location,w=g/m,C=new an.a(w,w,0,0,0),e.textPath.transform(C,_))):null!=(null===(u=n.font)||void 0===u?void 0:u.size)&&(P=t.parseItemsDataValueRelativeToHeight(n.font.size,this._productHandler,r.relativeToPrintArea),e.font.size=b.a(e.font.size,P))),e.font.allCaps=b.a(e.font.allCaps,n.font.allCaps),void 0===(null===(c=n.font)||void 0===c?void 0:c.smallCaps)?[3,2]:[4,this._editText(e,(function(t){var e,r;try{for(var i=fn(t.blocks),o=i.next();!o.done;o=i.next()){var a=o.value;a instanceof Ne.Paragraph&&(a.inlineElements=a.inlineElements.map((function(t){var e;return x._applySmallCaps(t,!!(null===(e=n.font)||void 0===e?void 0:e.smallCaps))})))}}catch(s){e={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}))]));case 1:I.sent(),I.label=2;case 2:void 0!==n.stroke&&(r.ignorePermissions||e.textPermissions.allowChangeStroke)&&(null==n.stroke?e.stroke=null:(null==e.stroke&&(e.stroke=new v.pb),e.stroke.size=null!==(h=n.stroke.size)&&void 0!==h?h:e.stroke.size,(r.ignorePermissions||e.textPermissions.allowChangeStrokeColor)&&(S=null!==(p=this._parseColor(n.stroke.color))&&void 0!==p?p:ie.f.cyan,e.stroke.color=S))),void 0!==n.shadow&&(r.ignorePermissions||e.textPermissions.allowChangeShadow)&&(null==n.shadow?e.shadow=null:(S=null!==(f=this._parseColor(n.shadow.color))&&void 0!==f?f:ie.f.cyan,e.shadow=new v.jb({size:n.shadow.size,distance:n.shadow.distance,angle:n.shadow.angle,color:S}))),null!=n.overprintText&&(e.overprintText=n.overprintText),r.applyPropertiesDeep&&this._removeInlineStyleFromText(e,n,r),I.label=3;case 3:return[4,this._applyToShapeItem(e,n,r)];case 4:return I.sent(),[2]}}))}))},t.prototype._applySmallCaps=function(t,e){if(t instanceof Ne.Span)return t.style||(t.style=new Ne.SpanStyle),t.style.smallCaps=e,t;if(e){var n=new Ne.Span;return n.content.push(t),n.style=new Ne.SpanStyle,n.style.smallCaps=!0,n}return t},t.prototype._removeInlineStyleFromText=function(t,e,n){return hn(this,void 0,void 0,(function(){var r=this;return pn(this,(function(i){switch(i.label){case 0:return[4,this._editText(t,(function(i){null!=e.color&&(n.ignorePermissions||t.textPermissions.allowChangeFontColor)&&r._removeColorFromText(i),null!=e.font&&(null!=e.font.postScriptName&&(n.ignorePermissions||t.textPermissions.allowChangeFont)&&r._removeFontNameFromText(i),(n.ignorePermissions||t.textPermissions.allowChangeFontSize)&&r._removeFontSizeFromText(i),(n.ignorePermissions||t.textPermissions.allowChangeTextBIU)&&(null!=e.font.fauxBold&&r._removeBoldFromText(i),null!=e.font.fauxItalic&&r._removeItalicFromText(i),null!=e.underline&&r._removeUnderlineFromText(i))),null!=e.stroke&&(n.ignorePermissions||t.textPermissions.allowChangeStroke)&&(null!=e.stroke.size&&r._removePenWidthFromText(i),null!=e.stroke.color&&(n.ignorePermissions||t.textPermissions.allowChangeStrokeColor)&&r._removePenColorFromText(i)),null!=e.previewLeading&&(n.ignorePermissions||t.textPermissions.allowChangeLeading)&&r._removeLeadingFromText(i),null!=e.tracking&&r._removeTrackingFromText(i),null!=e.alignment&&(n.ignorePermissions||t.textPermissions.allowChangeTextAlignment)&&r._removeAlignmentFromText(i)}))];case 1:return i.sent(),[2]}}))}))},t.prototype._removeParagraphStyleFromText=function(t,e){return hn(this,void 0,void 0,(function(){var n=this;return pn(this,(function(r){switch(r.label){case 0:return[4,this._editText(t,(function(t){null!=e.paragraphSettings&&(null!=e.paragraphSettings.firstLineIndent&&n._removeFirstLineIndentFromText(t),null!=e.paragraphSettings.leftIndent&&n._removeLeftIndentFromText(t),null!=e.paragraphSettings.rightIndent&&n._removeRightIndentFromText(t),null!=e.paragraphSettings.spaceAfter&&n._removeSpaceAfterFromText(t),null!=e.paragraphSettings.spaceBefore&&n._removeSpaceBeforeFromText(t))}))];case 1:return r.sent(),[2]}}))}))},t.prototype._editText=function(t,e){return hn(this,void 0,void 0,(function(){var n,r,i,o,a,s,l;return pn(this,(function(u){switch(u.label){case 0:return n=new un.GmXmlParser(this._colorParser),r=new un.GmXmlSerializer(this._colorParser),o=je.a.bind,[4,Cn.getColorPalette(t,this._canvas.viewer.colorPreviewService)];case 1:return i=new(o.apply(je.a,[void 0,u.sent()])),a=this._listStyleSheetManagerFactory.create(),s=n.parse(t.text,i,t.font.size,a),e(s),l=r.serialize(s,i),t.text=l,[2]}}))}))},t.prototype._removeColorFromText=function(t){this._editSpanStyles(t,(function(t){return t.color=null}))},t.prototype._removeFontNameFromText=function(t){this._editSpanStyles(t,(function(t){return t.fontName=null}))},t.prototype._removeFontSizeFromText=function(t){this._editSpanStyles(t,(function(t){return t.fontSize=null}))},t.prototype._removeBoldFromText=function(t){this._editSpanStyles(t,(function(t){return t.bold=null}))},t.prototype._removeItalicFromText=function(t){this._editSpanStyles(t,(function(t){return t.italic=null}))},t.prototype._removeUnderlineFromText=function(t){this._editSpanStyles(t,(function(t){return t.underline=null}))},t.prototype._removeLeadingFromText=function(t){this._editSpanStyles(t,(function(t){return t.leading=null}))},t.prototype._removeTrackingFromText=function(t){this._editSpanStyles(t,(function(t){return t.tracking=null}))},t.prototype._removePenColorFromText=function(t){this._editSpanStyles(t,(function(t){return t.penColor=null}))},t.prototype._removePenWidthFromText=function(t){this._editSpanStyles(t,(function(t){return t.penWidth=null}))},t.prototype._removeAlignmentFromText=function(t){this._editParagraphStyles(t,(function(t){return t.alignment=null}))},t.prototype._removeFirstLineIndentFromText=function(t){this._editParagraphStyles(t,(function(t){return t.firstLineIndent=null}))},t.prototype._removeLeftIndentFromText=function(t){this._editParagraphStyles(t,(function(t){return t.leftIndent=null}))},t.prototype._removeRightIndentFromText=function(t){this._editParagraphStyles(t,(function(t){return t.rightIndent=null}))},t.prototype._removeSpaceAfterFromText=function(t){this._editParagraphStyles(t,(function(t){return t.spaceAfter=null}))},t.prototype._removeSpaceBeforeFromText=function(t){this._editParagraphStyles(t,(function(t){return t.spaceBefore=null}))},t.prototype._editSpanStyles=function(t,e){var n,r,i,o;try{for(var a=fn(t.blocks),s=a.next();!s.done;s=a.next()){var l=s.value;if(l instanceof Ne.Paragraph)try{for(var u=(i=void 0,fn(l.inlineElements)),c=u.next();!c.done;c=u.next()){var h=c.value;h instanceof Ne.Span&&null!=h.style&&e(h.style)}}catch(p){i={error:p}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}}catch(f){n={error:f}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},t.prototype._editParagraphStyles=function(t,e){var n,r;try{for(var i=fn(t.blocks),o=i.next();!o.done;o=i.next()){var a=o.value;a instanceof Ne.Paragraph&&null!=a.style&&e(a.style)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},t.prototype._applyToItem=function(t,e,n){var r,i,o,a,s,l,u,c,h,p,f,d,g;return hn(this,void 0,void 0,(function(){var m,y,_,w,C,P,S,x;return pn(this,(function(I){switch(I.label){case 0:if(null==e)return[3,2];if(null!=e.manipulationPermissions&&(m=e.manipulationPermissions,(y=t.manipulationPermissions).resizeGrips.corner=b.a(y.resizeGrips.corner,null===(r=m.resizeGrips)||void 0===r?void 0:r.corner),y.resizeGrips.edge=b.a(y.resizeGrips.edge,null===(i=m.resizeGrips)||void 0===i?void 0:i.edge),y.allowDelete=b.a(y.allowDelete,m.allowDelete),y.allowMoveHorizontal=b.a(y.allowMoveHorizontal,m.allowMoveHorizontal),y.allowMoveVertical=b.a(y.allowMoveVertical,m.allowMoveVertical),y.allowRotate=b.a(y.allowRotate,m.allowRotate),y.allowDragAndDrop=b.a(y.allowDragAndDrop,m.allowDragAndDrop)),null!=e.visualizationPermissions&&(t.visualizationPermissions.noPrint=b.a(t.visualizationPermissions.noPrint,e.visualizationPermissions.noPrint),t.visualizationPermissions.noShow=b.a(t.visualizationPermissions.noShow,e.visualizationPermissions.noShow)),null!=(_=e.itemPermissions)&&(t.itemPermissions.allowOpacityChange=b.a(t.itemPermissions.allowOpacityChange,_.allowOpacityChange),t.itemPermissions.allowZOrderChange=b.a(t.itemPermissions.allowZOrderChange,_.allowZOrderChange),null!=(w=_.itemToolbarPermissions)&&((C=t.itemPermissions.itemToolbarPermissions).showHandleButton=null!==(o=w.showHandleButton)&&void 0!==o?o:C.showHandleButton,C.showEditButton=null!==(a=w.showEditButton)&&void 0!==a?a:C.showEditButton,C.showSelectButton=null!==(s=w.showSelectButton)&&void 0!==s?s:C.showSelectButton,C.showDeleteButton=null!==(l=w.showDeleteButton)&&void 0!==l?l:C.showDeleteButton),t.itemPermissions.allowRemoveOnLayoutChange=b.a(t.itemPermissions.allowRemoveOnLayoutChange,_.allowRemoveOnLayoutChange)),t.violationSettings.allowBleedArea=null!==(c=null===(u=e.violationSettings)||void 0===u?void 0:u.allowBleedArea)&&void 0!==c?c:t.violationSettings.allowBleedArea,t.violationSettings.allowRegion=null!==(p=null===(h=e.violationSettings)||void 0===h?void 0:h.allowRegion)&&void 0!==p?p:t.violationSettings.allowRegion,t.violationSettings.allowSafetyLines=null!==(d=null===(f=e.violationSettings)||void 0===f?void 0:f.allowSafetyLines)&&void 0!==d?d:t.violationSettings.allowSafetyLines,null!=e.textWrappingMode)switch(e.textWrappingMode.toLowerCase()){case"none":t.textWrappingMode=v.xb.None;break;case"square":t.textWrappingMode=v.xb.Square;break;case"tight":t.textWrappingMode=v.xb.Tight;break;default:console.error("Unknown textWrappingMode:",e.textWrappingMode)}return(n.ignorePermissions||t.itemPermissions.allowOpacityChange)&&(t.opacity=b.a(t.opacity,e.opacity),t instanceof v.cb&&t.updateContentAndFrames((function(t){return t.opacity=b.a(t.opacity,e.opacity)}))),t.name=b.a(t.name,e.name),null!=e.blendMode&&(P=null!==(g=b.j(v.p,e.blendMode))&&void 0!==g?g:v.p.Normal,t.blendMode=P),null==e.themeBinding?[3,2]:(t.themeBinding.text=b.b(t.themeBinding.text,e.themeBinding.text),t.themeBinding.stroke=b.b(t.themeBinding.stroke,e.themeBinding.stroke),t.themeBinding.shadow=b.b(t.themeBinding.shadow,e.themeBinding.shadow),t.themeBinding.img=b.b(t.themeBinding.img,e.themeBinding.img),t.themeBinding.border=b.b(t.themeBinding.border,e.themeBinding.border),t.themeBinding.fill=b.b(t.themeBinding.fill,e.themeBinding.fill),t.themeBinding.textFill=b.b(t.themeBinding.textFill,e.themeBinding.textFill),t.themeBinding.barcode=b.b(t.themeBinding.barcode,e.themeBinding.barcode),t.themeBinding.line=b.b(t.themeBinding.line,e.themeBinding.line),null!=e.themeBinding.styles&&(t.themeBinding.styles=gn(t.themeBinding.styles||[],e.themeBinding.styles)),[4,this._updateThemeForItem(t)]);case 1:I.sent(),I.label=2;case 2:return!n.changePosition||t instanceof v.u&&null!=t.parentPlaceholder?[2]:[4,(S=this._productHandler.getHandler(t)).waitUpdate()];case 3:return I.sent(),t instanceof v.q&&""!==t.text.trim()?(null==(x=e).width&&null==x.height?t.scheduledFitMode=v.D.ShrinkOrStretchToContent:null==x.height?t.scheduledFitMode=v.D.ShrinkOrStretchToContentHeight:null==x.width&&(t.scheduledFitMode=v.D.ShrinkOrStretchToContentWidth),[4,S.waitUpdate()]):[3,5];case 4:I.sent(),I.label=5;case 5:return this._applyPositionAndSize(t,e,n.relativeToPrintArea),[2]}}))}))},t.prototype._applyPositionAndSize=function(e,n,r){var i;return hn(this,void 0,void 0,(function(){var o,a,s,l,u,c,h,p,f,d,g,m,y,_,w,C,P,S,x,I,O,T,L,R,E,j,N,k,A,F;return pn(this,(function(M){switch(M.label){case 0:return e instanceof v.T?[2]:(o=t._getTargetBounds(this._productHandler,r),a=t._getVisualSize(this._productHandler,o),s=this._productHandler.contentAngle,l=b.o(null!=n&&null!=n.width?n.width:"50%",a.width),u=b.o(null!=n&&null!=n.height?n.height:"50%",a.height),c=this._productHandler.getHandler(e),h=c.getTransformedRectangle(!1),p=h.angle-s+(null!==(i=n.angle)&&void 0!==i?i:0),e instanceof v.eb||e instanceof v.a?[4,c.waitUpdate()]:[3,2]);case 1:return M.sent(),g=c.bounds,f=g.width,d=g.height,[3,3];case 2:e.type===v.kb.type?h.width<a.width&&h.height<a.height?(f=h.width,d=h.height):(m=2*c.getBorderMargin(),S=window.Math.min(a.width/(h.width+m),a.height/(h.height+m)),f=h.width*S,d=h.height*S):e instanceof v.q?(f=null!=n&&null!=n.width?l:h.width,d=null!=n&&null!=n.height?u:h.height):(f=!1===n.adjustSize?a.width:l,d=!1===n.adjustSize?a.height:u),M.label=3;case 3:switch(null!=this._productHandler.regionForCurrentContainer&&(S=window.Math.min(a.width/f,a.height/d))<1&&(f*=S,d*=S),e instanceof v.k&&e.barcodeFormat!==v.j.DATABAR_EXPANDED_STACKED?(y=Object(re.d)(t.getBarcodeRatio(e.barcodeFormat),new v.nb(l,u)),f=y.width,d=y.height):e instanceof v.J||e instanceof v.cb&&!e.isEmptyContent&&null==e.barcodeFormat?(null!=n.width||null!=n.height||e instanceof v.k||(C=this._getOriginalImageSize(e),_=C.width<a.width&&C.height<a.height,f=_?C.width:a.width,d=_?C.height:a.height),w=this._getImageSource(e),S=Math.min(f/w.width,d/w.height),f=w.width*S,d=w.height*S,!1===n.adjustSize&&(w.dpiX=this._canvas.targetDpi,w.dpiY=this._canvas.targetDpi,C=this._getOriginalImageSize(e),f=C.width,d=C.height)):e instanceof v.G&&(P=c.rectangle,S=Math.min(f/P.width,d/P.height),f=P.width*S,d=P.height*S),x=o.width/2,I=o.height/2,O=null!=n&&null!=n.location&&null!=n.location.x?n.location.x:x,T=null!=n&&null!=n.location&&null!=n.location.y?n.location.y:I,L=b.o(O,o.width),R=b.o(T,o.height),90!==s&&180!==s||(R=o.height-R),180!==s&&270!==s||(L=o.width-L),E=(null!=n&&null!=n.location?n.location.originX:null)||_e.b.Center,j=(null!=n&&null!=n.location?n.location.originY:null)||_e.b.Center,E.toLowerCase()){case _e.b.Left:x=L;break;case _e.b.Right:0===s?x=L-f:90===s?x=L-d:180===s?x=L+f:270===s&&(x=L+d);break;case _e.b.Center:0===s?x=L-f/2:90===s?x=L-d/2:180===s?x=L+f/2:270===s&&(x=L+d/2)}switch(j.toLowerCase()){case _e.b.Top:I=R;break;case _e.b.Bottom:0===s?I=R-d:90===s?I=R+f:180===s?I=R+d:270===s&&(I=R-f);break;case _e.b.Center:0===s?I=R-d/2:90===s?I=R+f/2:180===s?I=R+d/2:270===s&&(I=R-f/2)}return x+=o.left,I+=o.top,(N=new B.RotatedRectangleF(0,0,f,d)).angle=p,N.location=new B.PointF(x,I),e instanceof v.o?(e instanceof v.q&&null!=n&&e.overflowStrategy===v.X.Clip&&(null==n.width&&null==n.height?e.scheduledFitMode=v.D.ShrinkOrStretchToContent:null==n.height?e.scheduledFitMode=v.D.ShrinkOrStretchToContentHeight:null==n.width&&(e.scheduledFitMode=v.D.ShrinkOrStretchToContentWidth)),e instanceof v.q||e instanceof v.ab?(k=N.toRectangleF(),A=B.Path.rectangle(k.left,k.top,k.width,k.height),e.sourcePath=A,e.sourceRectangle=k.clone(),e instanceof v.q?e.textRectangle=k:e.boundingPaths=[A]):c.setTransformedRectangle(N)):((e instanceof v.cb||e instanceof v.u)&&(F=N.toRectangleF(),e.sourceRectangle=F,e.sourcePath=B.Path.rectangle(F.left,F.top,F.width,F.height)),c.setTransformedRectangle(N)),this._productHandler.getHandler(e).update(),[2]}}))}))},t.prototype._getOriginalImageSize=function(t){return t instanceof v.J?t.getOriginalImageSize():null!=t.content&&t.content instanceof v.J?t.content.getOriginalImageSize():null},t._getTargetBounds=function(t,e){return e?t.getPrintAreaBounds():new B.RectangleF(0,0,t.currentSurface.width,t.currentSurface.height)},t._getVisualSize=function(t,e){return t.getVisualSize(e)},t.prototype._getImageSource=function(t){return t instanceof v.J?t.source:t.content.source},t.prototype._getRotatedRegion=function(t){if(null==t.region)return null;var e=this._productHandler.userEditPrintArea.bounds,n=B.RectangleF.FromObject(t.region),r=this._productHandler.contentAngle;if(r>0){var i=B.RotatedRectangleF.fromRectangleF(n),o=e.center;i.rotateAt(r,o),n=i.bounds}return n},t.prototype._calcNewGroupBounds=function(t,e){var n,r,i=this,o=t.map((function(t){return t.clone()})).map((function(t){return i._productHandler.getHandler(t)}));try{for(var a=fn(o),s=a.next();!s.done;s=a.next()){var l=s.value;l instanceof vt.a?l.item.borderWidth=e:l.width=e}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}var u=o.map((function(t){return t.bounds}));return B.RectangleF.FromLTRB(Math.min.apply(Math,gn(u.map((function(t){return t.left})))),Math.min.apply(Math,gn(u.map((function(t){return t.top})))),Math.max.apply(Math,gn(u.map((function(t){return t.right})))),Math.max.apply(Math,gn(u.map((function(t){return t.bottom})))))},t.getBarcodeRatio=function(t){return t===v.j.IMB?new v.nb(744,49):t===v.j.QR_CODE||t===v.j.AZTEC||t===v.j.DATA_MATRIX?new v.nb(1,1):new v.nb(2.5,1)},t.prototype._parseColor=function(t){return"string"==typeof t?this._colorParser.parse(t):sn.a.parse(t)},t.parseItemsDataValueRelativeToHeight=function(e,n,r){if("number"==typeof e)return e;var i=t._getTargetBounds(n,r),o=t._getVisualSize(n,i);return b.o(e,o.height)},t}(),yn=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},_n=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},vn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},bn=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(vn(arguments[e]));return t},wn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Cn=function(){function t(){}return Object.defineProperty(t,"designAtomsApiClient",{set:function(t){this._designAtomsApiClient=t},enumerable:!0,configurable:!0}),t.isBgContainerItem=function(t){if(t.parentContainer instanceof I.g)return t.parentContainer instanceof I.g&&b.p(t.parentContainer.name,x.a.BG_CONTAINER_NAME,!0)},t.isFgContainerItem=function(t){return t.parentContainer instanceof I.g&&b.p(t.parentContainer.name,x.a.FG_CONTAINER_NAME,!0)},t.isImage=function(e){return(e instanceof C.a||e instanceof w.b)&&!t.isBgContainerItem(e)},t.isEmptyPlaceholder=function(t){return t instanceof w.b&&t.isStubOrEmpty},t.isDataMatrixBarcode=function(t){return t instanceof v.k&&t.barcodeFormat===v.j.DATA_MATRIX||t instanceof w.b&&t.barcodeFormat==v.j.DATA_MATRIX},t.isQrCode=function(t){return t instanceof v.k&&t.isQrCode||t instanceof w.b&&t.barcodeFormat==v.j.QR_CODE},t.isLinearBarcode=function(t){return t instanceof v.k&&t.isLinearBarcode||t instanceof w.b&&(t.barcodeFormat==v.j.EAN_13||t.barcodeFormat==v.j.EAN_8||t.barcodeFormat==v.j.UPC_A||t.barcodeFormat==v.j.UPC_E||t.barcodeFormat==v.j.CODE_128)},t.isVariableItem=function(t){return t.canSetIsVariable()},t.isMultiValueItem=function(t){return(t instanceof C.a||t instanceof P.a)&&0!==t.values.length},t.isTextType=function(t){return t===P.a||P.a.prototype.isPrototypeOf(t.prototype)},t.getAllowTextFormatting=function(t,e){var n,r,i;return!(null!=t&&t instanceof v.q&&t.overflowStrategy!==v.X.Clip&&t.overflowStrategy!==v.X.ExpandBox)&&(null!==(i=null!==(r=null===(n=null==t?void 0:t.textPermissions)||void 0===n?void 0:n.allowTextFormatting)&&void 0!==r?r:e)&&void 0!==i?i:t instanceof v.q||t instanceof v.ab)},t.allowMoveHorizontal=function(t){return!t.locked&&(!t.manipulationPermissions||t.manipulationPermissions.allowMoveHorizontal)},t.allowMoveVertical=function(t){return!t.locked&&(!t.manipulationPermissions||t.manipulationPermissions.allowMoveVertical)},t.allowManipulate=function(t){return!t.locked&&(!t.manipulationPermissions||t.manipulationPermissions.allowMoveVertical||t.manipulationPermissions.allowMoveHorizontal||t.manipulationPermissions.allowDelete||t.manipulationPermissions.allowRotate)},t.clearImageContent=function(t){if(null!=t){var e=t.content;delete e.tags.sourceData,delete e.tags.sourceType,e instanceof C.a&&(e.source.setIdWithOrigin(null,null),e.source.width=null,e.source.height=null,e.isUserImage=!1,e.fillColor=pt.RgbColors.transparent)}},t.getImageItem=function(t){if(null==t)return null;if(t instanceof C.a)return t;var e=t.content;if(e instanceof C.a)return e;if(null==e||e instanceof v.k)return null;throw new o.c("Wrong placeholder content!")},t.getImagePermissions=function(t){return null==t?null:t instanceof C.a?t.imagePermissions:t.getImagePermissions()},t.getImageSizeInPoints=function(t){var e,n,r,i,o,a;return{width:Object(ie.i)(null!==(r=null===(n=null===(e=null==t?void 0:t.origin)||void 0===e?void 0:e.originalSize)||void 0===n?void 0:n.width)&&void 0!==r?r:t.width,t.dpiX||72),height:Object(ie.i)(null!==(a=null===(o=null===(i=null==t?void 0:t.origin)||void 0===i?void 0:i.originalSize)||void 0===o?void 0:o.height)&&void 0!==a?a:t.height,t.dpiY||72)}},t.getContentEffect=function(t){return t.content instanceof C.a?t.content.effect:t.contentEffect},t.getAllowChangeContent=function(e){if(e instanceof v.k||e instanceof w.b&&e.isBarcodePlaceholder)return t.getBarcodePermissions(e).allowChangeBarcodeContent;var n=t.getImagePermissions(e),r=null==n||n.allowChangeImage,i=t.getImageItem(e);return r&&(null==i||0===i.values.length)},t.getImageMetaDataFromFile=function(t,e,n){return void 0===t&&(t=void 0),void 0===n&&(n=null),yn(this,void 0,void 0,(function(){return _n(this,(function(r){return[2,this._designAtomsApiClient.getImageMetaDataFromFile(e,n,t)]}))}))},t.getImageMetaDataFromDesignImage=function(t,e){return void 0===t&&(t=void 0),yn(this,void 0,void 0,(function(){return _n(this,(function(n){return[2,this._designAtomsApiClient.getImageMetaDataFromDesignImage(e,t)]}))}))},t.getImageMetadataFromRemoteFile=function(t,e){return void 0===t&&(t=void 0),yn(this,void 0,void 0,(function(){return _n(this,(function(n){return[2,this._designAtomsApiClient.getImageMetadataFromRemoteFile(e,t)]}))}))},t.getTextFromRichTextItem=function(t){return b.k(t.text)},t.getMaxFontSize=function(t){if(null==t||!(t instanceof P.a))return null;if(!b.m(t.text))return t.font.size;var e=[t.font.size];try{null!=t.text&&function(t,n){var r=(new DOMParser).parseFromString("<body>"+t+"</body>","application/xml"),i={acceptNode:function(t){var e=t.nodeName.toLowerCase();return n.includes(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}};T.a.IsIE()&&(i=function(t){return t.acceptNode}(i));for(var o,a,s=document.createTreeWalker(r.childNodes[0],NodeFilter.SHOW_ELEMENT,i,!1);s.nextNode();)o=s.currentNode,a=void 0,a=function(t){var e,n,r=t.attributes.getNamedItem("style");if(null==r||null==r.value)return null;var i=r.value.split(";"),o=new Map;try{for(var a=wn(i),s=a.next();!s.done;s=a.next()){var l=s.value;if(null!=(l=l.trim())&&""!==l){var u=l.split(":"),c=u[0].trim(),h=u[1].trim();o.set(c,h)}}}catch(p){e={error:p}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return o}(o),null!=a&&a.has("font-size")&&e.push(parseFloat(a.get("font-size")))}(t.text,["span","ol","ul"])}catch(n){console.error("Unexpected exception while parsing item text"),console.error(n)}return Math.max.apply(Math,bn(e))},t.getBarcodeItem=function(t){if(null==t)return null;if(t instanceof v.k)return t;var e=t.content;if(e instanceof v.k)return e;if(null==e)return null;throw new o.c("Wrong placeholder content!")},t.getBarcodePermissions=function(t){if(null==t)return null;if(t instanceof v.k)return t.barcodePermissions;if(null!=t.contentPermissions)return t.contentPermissions.barcodePermissions;var e=t.content;return e instanceof v.k?e.barcodePermissions:null},t.getImageUrlFromImageMetadata=function(t,e,n,r,i){var o=null!=n?n:t.size.width,a=null!=r?r:t.size.height,s=null!=i&&i;return V.a.getImageUrl(e.renderingConfigProvider,e.viewer.designAtomsApiClient,t.storageId,o,a,null,null,s,null,t.pageIndex)},t.updateItems=function(t,e,n,r){var i,o;if(r=b.n(r,{addToHistory:!0,updatePhase:Pe.Final,redraw:!0}),0!==t.length){try{for(var a=wn(t),s=a.next();!s.done;s=a.next()){var l=s.value;this._updateItem(e,l,r,n)}}catch(u){i={error:u}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}r.redraw&&e.redraw()}},t._updateItem=function(t,e,n,r){var i=t.getHandler(e);null!=i&&null!=i.layer&&(e instanceof C.a?this._updateImageItem(e,i,n,r):e instanceof w.b&&this._updatePlaceholderItem(e,i,n,r))},t._updateImageItem=function(t,e,n,r){e.quickUpdate(),n.updatePhase===Pe.Final&&(t.getItemChangedEvent().fire(),e.update(),r.updateTexts())},t._updatePlaceholderItem=function(t,e,n,r){null!=t.content&&this._updateImageItem(t.content,e.content,n,r),this._hidePlaceholderButtonWhileImageLoad(e)||e.update()},t._hidePlaceholderButtonWhileImageLoad=function(t){if(t.isEmptyContent()||!t.getPermissions().showSelectButton&&!t.getPermissions().showHandleButton)return!1;var e=function(n){n.removeReady(e),t.getPermissions().showSelectButton=!0,t.update()};return t.content.addReady(e),t.getPermissions().showSelectButton=!1,t.update(),!0},t.getItemBoundsForViolationCheck=function(t){return t instanceof Z.a?t.getBoundsIncludingFrames():t.bounds},t.createCloneName=function(t,e,n){var r;"string"!=typeof(r="string"==typeof t?t:e.getRealItemName(t))&&(r="");var i=n.currentSurface.getAllItems({ignoreMockups:!1,excludeGroupItems:!0,flatGroupItems:!0}).toArray(),o=function(t){return i.some((function(n){return e.getRealItemName(n)===t}))};if(!o(r))return r;var a=0,s=r.match(/_(\d+)$/);if(null!=s&&r.length>=2){r=r.substr(0,r.length-s[0].length);var l=parseInt(s[1]);l>0&&(a=l)}var u,c=1;do{if(!o(u=r+"_"+(a+c).toString()))break;c++}while(c<=1e4);return"string"==typeof t?u:e.createNewItemName(t,u)},t.createImageContentForPlaceholder=function(e,n,r,i){var o;if(e.isBarcodePlaceholder!==n instanceof v.i)return null;var a,s=r.getHandler(e),l=s.getTransformedRectangle(!1);l.angle=0;var u=e.content,c=e.contentPermissions;if(e.isBarcodePlaceholder&&n instanceof v.i){var h=l.clone(),p=Object(re.d)(mn.getBarcodeRatio(n.barcodeFormat),new on.a(l.width,l.height));h.width=p.width,h.height=p.height;var f=void 0;null!=u.barcodeOptions?f=u.barcodeOptions:(f=new v.B).pureBarcode=!1,(a=new v.k(n.barcodeFormat,null,f,h.toRectangleF())).applyBarcodeData(n),e.barcodeFormat=n.barcodeFormat}else n instanceof S.a&&(a=new C.a(n.storageId,l.location,l.width,l.height,n.size.width/n.size.height));a instanceof C.a&&n instanceof S.a&&(xn.setDataToImage(n,a),a.effect=e.contentEffect,a.imagePermissions=c.imagePermissions.clone(),a.effect==rn.a.Colorize&&null!=e.contentFillColor&&(a.fillColor=e.contentFillColor),null!=e.contentOverlayEffect&&(a.overlayEffect=e.contentOverlayEffect.clone())),a.transform.setAngle(e.transform.angle),r.getHandler(a).updateRectangle(null,e.contentResizeMode,s,i),a.textWrappingMode=nn.a.Square,a.isVariable=null!=u&&u.isVariable,a instanceof v.k&&(a.barcodePermissions=c.barcodePermissions.clone());var d=e.contentPermissions.imagePermissions.allowKeepOverlayColor;return null==u?(a instanceof C.a&&(a.allowedSubfolder=e.allowedSubfolder,a.allowedTabs=e.allowedTabs),a.opacity=e.opacity):(u instanceof C.a&&a instanceof C.a&&(a.allowedSubfolder=u.allowedSubfolder,a.allowedTabs=u.allowedTabs,a.imagePermissions=u.imagePermissions.clone(),d&&(null===(o=u.overlayEffect)||void 0===o?void 0:o.color)&&t.setOverlayEffectColor(a,u.overlayEffect.color)),a.manipulationPermissions=u.manipulationPermissions.clone(),a.opacity=e.content.opacity,a.fillColor=u.fillColor.clone(),a instanceof v.k&&u instanceof v.k&&(a.barcodePermissions=u.barcodePermissions.clone())),a},t.positionItemInArea=function(e,n,r,i,o,a,s,l){if(void 0===o&&(o=!0),void 0===a&&(a=null),void 0===s&&(s=null),void 0===l&&(l=!0),n instanceof v.G)return n.getNestedItems(!0).forEach((function(n){return t.positionItemInArea(e,n,r,i,o,a,s,l)}));var u=e.userEditContainer,c=null!=a?a.toRectangleF():u.region,h=null!=c,p=u.parentComponent.printAreas.getItem(0).bounds,f=h?c:p,d=f.center,g=o?re.a.from(f):e.getVisualSize(re.a.from(f)),m=Math.min(g.width/r,g.height/i),y=null!=s?s:new B.PointF(r/2,i/2),_=function(t){var n=d;if(t instanceof v.q||t instanceof v.g)t.textRectangle.width*=m,t.textRectangle.height*=m,t.textRectangle.left=n.x+m*(t.textRectangle.left-y.x)-0,t.textRectangle.top=n.y+m*(t.textRectangle.top-y.y)-0;else if(t instanceof v.eb){var r=n.x+m*(t.baselineLocation.x-y.x),i=n.y+m*(t.baselineLocation.y-y.y);t.baselineLocation.x=r,t.baselineLocation.y=i}else{var o=e.getHandler(t).getTransformedRectangle(l),a=n.x+m*(o.centerX-y.x),s=n.y+m*(o.centerY-y.y);t.transform.setScaleX(m),t.transform.setScaleY(m),t.transform.move(a-o.centerX,s-o.centerY)}};_(n),n instanceof w.b&&n.updateContentAndFrames(_),n instanceof P.a&&(n.font.size*=m)},t.rotateItems=function(t,e,n,r){var i=function(e){if(e instanceof v.G)return e.applyToItems(i);var o=t.getHandler(e),a=o.getTransformedRectangle(!1);a.rotateAt(r,n);var s=a.getTransform(o.getTransformedRectangle(!1));e.transform.move(s.translateX,s.translateY),e.transform.rotate(s.angle),e instanceof w.b&&e.updateContentAndFrames(i)};e.forEach((function(t){return i(t)}))},t.changeItemsContent=function(t,e,n,r,i,o){var a,s,l,u,c,h,p=this,f=r.map((function(t){return t.clone()})),d=f.filter((function(t){return t instanceof v.G})),g=i.filter((function(t){return t instanceof v.G}));this._replaceContentFromOldToNewItems(d,g,(function(r,i){return p.changeItemsContent(t,e,n,i.items.toArray(),r.items.toArray(),o)}),o);var m=f.filter((function(t){return t instanceof P.a})),y=i.filter((function(t){return t instanceof P.a})),_=t.getAllItems({ignoreMockups:!1,flatGroupItems:!0}),b=_.filter((function(t){return t instanceof P.a}));b=O.without.apply(O,bn([b],y));try{for(var x=wn(y),I=x.next();!I.done;I=x.next()){var T=I.value;if(0!==T.placeholders.length){var L=function(t){var e=b.filter((function(e){return null!=e.placeholders.toArray().find((function(e){return e.name===t.name}))}));if(0===e.length)return"continue";t.value=e[0].placeholders.toArray().find((function(e){return e.name===t.name})).value};try{for(var R=(l=void 0,wn(T.placeholders.toArray())),E=R.next();!E.done;E=R.next())L(E.value)}catch(U){l={error:U}}finally{try{E&&!E.done&&(u=R.return)&&u.call(R)}finally{if(l)throw l.error}}}}}catch(W){a={error:W}}finally{try{I&&!I.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}this._replaceContentFromOldToNewItems(m,y,(function(t,e){t.text=e.text,null!=e.tags&&(t.tags=e.tags)}),o);var j=function(t,e){var r=new S.a;r.size=new on.a(e.imageContent.source.width,e.imageContent.source.height),r.storageId=e.imageContent.source.id,r.name=e.imageContent.name,r.origin=e.imageContent.source.origin,r.isVector=e.imageContent.source.isVector,r.pageIndex=e.imageContent.source.pageIndex,n.execute(_e.a.setImageMetadata,{dataList:[{item:t,imageData:r,tags:e.tags}]}),e.isEmptyContent||t.isEmptyContent||null==e.content.tags||(t.content.tags=e.content.tags)},N=function(t){return t instanceof w.b&&!t.isStubOrEmpty&&t.content instanceof C.a},k=f.filter(N),A=i.filter((function(t){return t instanceof w.b})),F=_.filter(N);F=O.without.apply(O,bn([F],A));var B=A.filter((function(t){return null!=t.linkId}));if(0!==B.length){var M=new Set,z=function(t){var e=F.find((function(e){return e.linkId===t.linkId&&!e.isStubOrEmpty&&e.content instanceof C.a}));if(null==e)return"continue";M.add(e.linkId),j(t,e),A=O.without(A,t)};try{for(var D=wn(B),H=D.next();!H.done;H=D.next())z(H.value)}catch(V){c={error:V}}finally{try{H&&!H.done&&(h=D.return)&&h.call(D)}finally{if(c)throw c.error}}k=k.filter((function(t){return!M.has(t.linkId)}))}this._replaceContentFromOldToNewItems(k,A,j,o)},t._replaceContentFromOldToNewItems=function(t,e,n,r){for(var i=t.map((function(t){return t.name})),o=[],a=function(t){i.find((function(n){return n===e[t].name}))&&(i.splice(i.indexOf(e[t].name),1),o.push(t))},s=0;s<e.length;s++)a(s);var l,u=function(a){var s=e[a],u=void 0;o.includes(a)?u=t.find((function(t){return t.name===s.name})):r&&0!==i.length&&(l=i.shift(),u=t.find((function(t){return t.name===l}))),null!=u&&(n(s,u.clone()),t.splice(t.indexOf(u),1))};for(s=0;s<e.length;s++)u(s)},t.getEmptyPlaceholdersFromProduct=function(t,e){void 0===e&&(e=!1);var n=[];return t.getAllItems({flatGroupItems:!0,ignoreMockups:!0}).filter((function(t){if(!(t instanceof w.b&&t.isStubOrEmpty&&null!=t.parentContainer&&t.parentContainer.name===x.a.MAIN_CONTAINER_NAME))return!1;if(e)return!0;if(null!=t.linkId){if(n.includes(t.linkId))return!1;n.push(t.linkId)}return!0}))},t.waitForItemsUpdated=function(t,e){return yn(this,void 0,void 0,(function(){var n,r;return _n(this,(function(i){switch(i.label){case 0:return n=t.filter((function(t){return t instanceof v.G})).map((function(t){return t.getNestedItems(!0)})).reduce((function(t,e){return bn(t,e)}),[]),r=t.concat(n).map((function(t){return e.getItemHandler(t)})),[4,e.waitUpdate(r)];case 1:return i.sent(),[2]}}))}))},t.isTextItemHandlerReady=function(t,e){if(t instanceof P.a){var n=e.getHandler(t);if(n instanceof k.a&&null==n.currentTextImage.cacheFileId)return!1;if(n instanceof Qt&&!n.ready)return!1}return!0},t.alignHandlerToRect=function(t,e,n){var r=n instanceof P.a?n.alignment:v.qb.Left,i=n instanceof v.q?n.verticalAlignment:v.sb.Top,o=_e.b.Center,a=_e.b.Center;switch(r){case v.qb.Left:case v.qb.LastLeft:case v.qb.Justify:o=_e.b.Left;break;case v.qb.Right:case v.qb.LastRight:o=_e.b.Right}switch(i){case v.sb.Top:a=_e.b.Top;break;case v.sb.Bottom:a=_e.b.Bottom}var s=t.rectangle;t.angle=e.angle;var l=Object(re.b)(s,e,o,a);t.setRectangle(l)},t.isRotated=function(t,e){return!Object(B.EqualsOfFloatNumbers)(Object(B.normalizeAngle)(Math.round(t.transform.angle+e)),0)},t.getColorPalette=function(t,e){return yn(this,void 0,void 0,(function(){var n,r=this;return _n(this,(function(i){switch(i.label){case 0:return n=t.colorPalette.select((function(t){return yn(r,void 0,void 0,(function(){var n;return _n(this,(function(r){switch(r.label){case 0:return n={color:t},[4,e.getPreviewAsync(t)];case 1:return[2,(n.preview=r.sent(),n)]}}))}))})).toArray(),[4,Promise.all(n)];case 1:return[2,i.sent()]}}))}))},t._designAtomsApiClient=null,t.setOverlayEffectColor=function(e,n){null!=e&&(t._getItemOverlayEffect(e).color=n)},t.applyOverlayEffect=function(e,n){if(null!=e&&null!=n){var r=t._getItemOverlayEffect(e);r.color=n.color,r.opacity=n.opacity}},t._getItemOverlayEffect=function(t){return t instanceof C.a?(t.overlayEffect=null!=t.overlayEffect?t.overlayEffect:new v.Y,t.overlayEffect):(t.contentOverlayEffect=null!=t.contentOverlayEffect?t.contentOverlayEffect:new v.Y,t.contentOverlayEffect)},t}();!function(t){t[t.InProgress=0]="InProgress",t[t.Final=1]="Final"}(Pe||(Pe={}));var Pn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},xn=function(t){function e(e,n,r,i,o,a){var s=t.call(this,e,n,r)||this;return s._variableItemHelper=i,s._commandManager=o,s._eventManager=a,s}return Pn(e,t),e.prototype._executeCommandBody=function(){return t=this,e=void 0,r=function(){return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){return[2,this._setImageDataList(this._args.dataList,this._args.keepLocation)]}))},new((n=void 0)||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(e){o(e)}}function s(t){try{l(r.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}));var t,e,n,r},e.prototype._setImageDataList=function(t,n){var r,o;this._normalizeDataList(t);try{for(var a=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=l.item,c=l.imageData,h=l.tags,p=l.rotatedRectangle;if(u instanceof v.cb){u.contentPermissions.imagePermissions.allowKeepOverlayColor||Cn.applyOverlayEffect(u,new v.Y);var f=Cn.createImageContentForPlaceholder(u,c,this._productHandler,this._args.dpi);f instanceof v.J&&this._ensureImageItemName(f),u.isStubContent=!1,null!=f&&null!=h&&(f.tags=h),this._commandManager.execute(_e.a.addContent,{placeholder:u,content:f},i.NotUpdate)}else{var d=Cn.getImageItem(u),g=this._productHandler.getHandler(d);d.effect!==Pt.a.Colorize&&(d.fillColor=ie.f.transparent),d.imagePermissions.allowKeepOverlayColor||Cn.applyOverlayEffect(d,new v.Y),e.setDataToImage(c,d),null!=h&&(d.tags=h),null!=p?g.setTransformedRectangle(p):g.updateRectangle(n),g.quickUpdate(),this._ensureImageItemName(d)}this._eventManager.imageContentChangedEvent.notify(u)}}catch(m){r={error:m}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}this._productHandler.updateSelection()},e.prototype._ensureImageItemName=function(t){t.isVariable&&(t.isVariable=!1,this._variableItemHelper.setVariableValue(t,!0,!0))},e.prototype._normalizeDataList=function(t){for(var e=[],n=t.length,r=function(n){var r=t[n].item;if(r instanceof v.cb&&null!=r.linkId&&-1===e.indexOf(r.linkId)){var o=i._productHandler.product.getAllItems({ignoreMockups:!1,flatGroupItems:!0}).filter((function(t){return t instanceof v.cb&&t.linkId===r.linkId}));t.push.apply(t,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Sn(arguments[e]));return t}(o.map((function(e){return{item:e,imageData:t[n].imageData,tags:t[n].tags}})))),e.push(r.linkId)}},i=this,o=0;o<n;o++)r(o)},e.prototype.redo=function(){throw new o.e},e.prototype.undo=function(){throw new o.e},e.setDataToImage=function(t,e){null!=t.name&&(e.displayName=t.name),e.isUserImage=t.isUserImage,e.source.setIdWithOrigin(t.storageId,t.origin),e.source.pageIndex=t.pageIndex,e.source.width=t.size.width,e.source.height=t.size.height,e.source.isVector=t.isVector},e}(_)},function(t,e,n){"use strict";n.d(e,"a",(function(){return U}));var r=n(411),i=n(408),o=n(409),a=n(466),s=n(468),l=n(420),u=n(426),c=n(523);class h{}h.fontFeatureSettings="font-feature-settings",h.fontFamily="font-family",h.fontSize="font-size",h.color="color",h.colorIndex="color-index",h.fontWeight="font-weight",h.fontStyle="font-style",h.textDecoration="text-decoration",h.webkitTextStroke="-webkit-text-stroke",h.penColor="-webkit-text-stroke-color",h.penColorIndex="pen-color-index",h.penWidth="-webkit-text-stroke-width",h.letterSpacing="letter-spacing",h.lineHeight="line-height",h.sub="sub",h.verticalAlign="vertical-align",h.textTransform="text-transform",h.fontVariantCaps="font-variant-caps",h.verticalScale="transform",h.paddingLeft="padding-left";class p{}p.textAlign="text-align",p.textIndent="text-indent",p.paddingBottom="padding-bottom",p.paddingTop="padding-top",p.marginLeft="margin-left",p.marginRight="margin-right",p.listStyleType="list-style-type";class f{}f.listStyleType="list-style-type",f.value="value",f.level="level",f.bulletNumberTabPosition="bullet-number-tab-position";var d=n(753);class g{}g.levelIndent="level-indent",g.textIndent="text-indent",g.textIndentCroppedPart="text-indent-cropped-part",g.leftIndent="left-indent",g.firstLineIndent="first-line-indent",g.marginLeft="margin-left",g.fontSize="font-size",g.listStyleType="list-style-type",g.bulletNumberTabPosition="bullet-number-tab-position";class m extends g{}m.textAlign="text-align";class y extends g{}y.start="start",y.type="type";class _ extends g{}_.type="type";var v=n(754),b=n.n(v),w=n(454),C=n(467),P=n(526),S=n(603),x=n(481);class I{}I.fontName="font-name",I.fontSize="font-size",I.color="color",I.bold="bold",I.italic="italic",I.underline="underline",I.penColor="pen-color",I.penWidth="pen-width",I.tracking="tracking",I.leading="leading",I.sub="sub",I.sup="sup",I.allCaps="all-caps",I.smallCaps="small-caps",I.fontFamily="font-family",I.fontStyle="font-style",I.wordSpacingScale="word-spacing-scale",I.supSize="sup-size",I.supPosition="sup-position",I.subSize="sub-size",I.subPosition="sub-position",I.digitType="digit-type",I.openType="ot",I.baselineShift="baseline-shift",I.inkName="ink-name",I.inkSolidity="ink-solidity",I.inkColor="ink-color",I.penInkName="pen-ink-name",I.penInkSolidity="pen-ink-solidity",I.penInkColor="pen-ink-color";var O=n(406),T=n(521),L=n(410);class R{constructor(t,e,n,r,i){this._colorPaletteManager=t,this._fontService=e,this._useSimpleFontList=n,this._colorParser=r,this._colorPreviewService=i,this._colorConverter=null}set colorPalette(t){this._colorPaletteManager=t}static getTrackingValue(t){const e=t["letter-spacing"];return null==e?null:R.letterSpacingToTracking(e)}static letterSpacingToTracking(t){const e=1e3*+t.replace("em;","").replace("em","");return isNaN(e)?0:e}static getLeadingValue(t,e=1){const n=t["line-height"];return null==n?null:"normal"===n?0:R.stringToNumber(n,"pt")/e}static getAllCapsValue(t){const e=t["text-transform"];return null==e?null:"uppercase"===e}static getSmallCapsValue(t){const e=t["font-variant-caps"];return null==e?null:"all-small-caps"===e}static getSupValue(t){const e=t["vertical-align"];return null==e?null:"super"===e}static getSubValue(t){const e=t["vertical-align"];return null==e?null:"sub"===e}static getOpenTypeValue(t){const e=t["font-feature-settings"];return this.parseOpenTypeFromStyle(e)}static getOpenTypeStringValue(t){const e=t["font-feature-settings"];return null!=e?e.replace(/("|')/g,""):null}static parseOpenTypeFromStyle(t){return null!=t?t.split(",").map((t=>{var e;const n=t.trim().split(" ");return new T.a(n[0].replace(/"/g,""),R.stringToNumber(null!==(e=n[1])&&void 0!==e?e:"1"))})):null}static stringToNumber(t,e="",n=0){if(null==t)return null;const r=o.l(e)?+t:+t.replace(e,"");return isNaN(r)?n:r}static getElementFontValue(t,e,n){const r=null!=n?P.clone(n):{},i=t=>{var n,a,s;if(null!=t.parentElement&&t!=e&&i(t.parentElement),t.style){const e=null===(n=t.style)||void 0===n?void 0:n.fontFamily,i=null===(a=t.style)||void 0===a?void 0:a.fontWeight,l=null===(s=t.style)||void 0===s?void 0:s.fontStyle;o.l(e)||(r.family=e),o.l(i)||(r.bold="bold"===i),o.l(l)||(r.italic="italic"===l)}};return i(t),r.family===(null==n?void 0:n.family)&&delete r.family,r.bold===(null==n?void 0:n.bold)&&delete r.bold,r.italic===(null==n?void 0:n.italic)&&delete r.italic,r}static getAlignmentValue(t){const e=t["text-align"];return null==e?null:R.stringToTextAlignment(e)}static stringToTextAlignment(t){switch(t.toLocaleLowerCase()){case"left":default:return L.qb.Left;case"center":return L.qb.Center;case"right":return L.qb.Right;case"justify":case"justify-all":case"justification":return L.qb.Justify;case"justification-last-left":return L.qb.LastLeft;case"justification-last-center":return L.qb.LastCenter;case"justification-last-right":return L.qb.LastRight}}static getFirstLineIndentValue(t,e=1){const n=t["text-indent"];return null==n?null:R.stringToNumber(n,"pt")/e}static getSpaceAfterValue(t,e=1){const n=t["padding-bottom"];return null==n?null:R.stringToNumber(n,"pt")/e}static getSpaceBeforeValue(t,e=1){const n=t["padding-top"];return null==n?null:R.stringToNumber(n,"pt")/e}static getLeftIndentValue(t,e=1){const n=t["margin-left"];return null==n?null:R.stringToNumber(n,"pt")/e}static getRightIndentValue(t,e=1){const n=t["margin-right"];return null==n?null:R.stringToNumber(n,"pt")/e}static getFontValue(t){const e=t["font-weight"],n=t["font-style"],r=t["font-family"];if(null==r&&null==e&&null==n)return null;const i={};return o.l(r)||(i.family=r),null!=e&&(i.bold="bold"===e),null!=n&&(i.italic="italic"===n),i}static getFontSettings(t,e,n){if(n){if(null==t.family)return{};const n=this._deserializeCssEscapedString(t.family).replace(/"/g,"").replace(/'/g,"");return e.findSuitableFontParams(e.findOriginalFamilyName(n.replace("_cc_family_","")),t.bold,t.italic)}{const n={};if(null!=t.family){const r=e.findOriginalPsName(t.family.replace("_cc_psname_",""));n.postScriptName=r}return null!=t.bold&&(n.fauxBold=t.bold),null!=t.italic&&(n.fauxItalic=t.italic),n}}static setFontValue(t,e,n,r){const i=R.getFontSettings(e,n,r);null!=i.postScriptName&&(t[I.fontName]=i.postScriptName),null!=i.fauxBold&&(t[I.bold]=`${i.fauxBold}`),null!=i.fauxItalic&&(t[I.italic]=`${i.fauxItalic}`)}static getBoldValue(t){const e=t["font-weight"];return null==e?null:"bold"===e}static getItalicValue(t){const e=t["font-style"];return null==e?null:"italic"===e}static getUnderlineValue(t){const e=t["text-decoration"]||t["text-decoration-line"];return null==e?null:"underline"===e}static getFontSizeValue(t,e=1){const n=t["font-size"];if(null==n||"super"===t["vertical-align"]||"sub"===t["vertical-align"])return null;let r=12;return n.endsWith("pt")?r=R.stringToNumber(n,"pt"):n.endsWith("px")?r=.75*R.stringToNumber(n,"px"):"x-small"==n?r=7.5:"small"==n?r=.8*12:"medium"==n?r=12:"large"==n?r=13.5:"x-large"==n?r=18:"xx-large"==n?r=24:"xxx-large"==n&&(r=36),+(r/e).toFixed(2)}async parse(t,e,n){const r=this._parse(t);return this._colorConverter=new x.a(e,this._colorParser),await this._convert(r,n)}async getColorValue(t,e,n){const r=t.color;if(null==r)return null;const i=await this._convertColor(r,e["color-index"],n);return null!=i?i:void 0}async getStrokeValue(t,e,n,r=1){let i=null,o=null,a=t["-webkit-text-stroke"];if(null!=a?(i=a.substring(0,a.indexOf(" ")),o=a.substring(a.indexOf(" ")+1)):(i=t["-webkit-text-stroke-width"],o=t["-webkit-text-stroke-color"]),null==o&&null==i)return null;const s={};if(null!=i&&(s.size=R.stringToNumber(i,"pt")/r),null!=o){const t=await this._convertColor(o,e["pen-color-index"],n);null!=t&&(s.colorIndex=t)}return s}processEmptyLines(t){return t.replace(/<p><span><br\s*\/?><\/span><\/p>/g,"<p></p>").replace(/<p><br\s*\/?><\/p>/g,"<p></p>").replace(/<\/span><br\s*\/?><\/p>/g,"</span></p>").replace(/<\/span><br\s*\/?><\/li>/g,"</span></li>").replace(/<li><span><br\s*\/?><\/span><\/li>/g,"<li></li>").replace(/<span(| style=('|")padding-left: \d*pt(|; )('|"))><br\s*\/?><\/span>/g,(function(t,e){return"<span"+e+"></span>"})).replace(/<li><br\s*\/?><\/li>/g,"<li></li>").replace(/<\/span><br\s*\/?><\/li>/g,"</span></li>")}_parse(t){var e=`<body>${t.replace(/ /g," ")}</body>`;e=this.processEmptyLines(e);const n=new b.a.DOMParser;try{return n.parseFromString(e,"text/html").getElementsByTagName("body")[0]}catch(r){throw console.error("_parse error",r),console.error(`html: \n\r${e}`),r}}_isAccepted(t){const e=this.getNodeName(t);return"body"==e||"p"===e||"ol"===e||"li"===e||"ul"===e||"br"===e||"span"===e||"#text"===e}getNodeName(t){return t.nodeName.toLowerCase()}_dbgGetNodeContent(t){return"#text"==t.nodeName.toLowerCase()?t.textContent:""}async _convertNode(t,e,n){const r=this.getNodeName(t);switch(r){case"body":return this._convertBody(t,e);case"p":return this._convertParagraph(t,e,n);case"span":return await this._convertSpan(t,e,n);case"u":case"b":case"i":return this._convertUbi(t,e);case"ol":return this._convertOrderedList(t,e);case"ul":return this._convertUnorderedList(t,e);case"li":return this._convertListItem(t,e,n);case"br":return this._convertBr();case"#text":return this._convertText(t);default:throw this._notImplemented(`_convertNode for ${r}`)}}_convertCommonListStyleToParagraphStyle(t,e,n){var r,i,o,a,s,u,c,h,p;const f=.75;t.listStyle=new l.ParagraphListStyle,t.style=null!==(r=t.style)&&void 0!==r?r:new l.ParagraphStyle;const d=null==e?void 0:e.alignment;d&&(t.style.alignment=d);const g=new l.NumericValue;g.value=null!==(o=null===(i=null==e?void 0:e.leftIndent)||void 0===i?void 0:i.value)&&void 0!==o?o:0,g.unit=null!==(s=null===(a=null==e?void 0:e.leftIndent)||void 0===a?void 0:a.unit)&&void 0!==s?s:l.Units.point,(null==e?void 0:e.leftIndent)?("pt"==g.unit?g.value+=30:"px"==g.unit&&(g.value+=40),t.style.leftIndent=g):t.style.leftIndent=S.h.parse("30pt");let m=null==n?void 0:n.leftIndent;if(null==n?void 0:n.leftIndent)if(m.unit==t.style.leftIndent.unit)t.style.leftIndent.value+=m.value;else if("px"==m.unit)t.style.leftIndent.value+=m.value*f;else{if("pt"!=m.unit)throw this._notImplemented(`NumericValue.unit ${m.unit} is not supported`);t.style.leftIndent.value+=m.value/f}const y=new l.NumericValue;y.value=null!==(c=null===(u=null==n?void 0:n.firstLineIndent)||void 0===u?void 0:u.value)&&void 0!==c?c:0,y.unit=null!==(p=null===(h=null==n?void 0:n.firstLineIndent)||void 0===h?void 0:h.unit)&&void 0!==p?p:l.Units.point,(null==n?void 0:n.firstLineIndent)?t.style.firstLineIndent=y:t.style.firstLineIndent=S.h.parse("0pt");const _=null==e?void 0:e.firstLineIndent;if(_)if(_.unit==t.style.firstLineIndent.unit)t.style.firstLineIndent.value+=_.value;else if("px"==_.unit)t.style.firstLineIndent.value+=_.value*f;else{if("pt"!=_.unit)throw this._notImplemented(`NumericValue.unit ${_.unit} is not supported`);t.style.firstLineIndent.value+=_.value/f}0===t.style.firstLineIndent.value&&(t.style.firstLineIndent=null);const v=null==e?void 0:e.tabPosition;v&&(t.listStyle.tabPosition=v);const b=null==n?void 0:n.tabPosition;b&&(t.listStyle.tabPosition+=b)}_convertOListItemToParagraph(t,e,n){var r,i;const o=new l.Paragraph;o.inlineElements=[...t.content],this._convertCommonListStyleToParagraphStyle(o,t.style,e.style),o.listStyle.type=l.ListStyleType.numbers;const a=null===(r=null==e?void 0:e.style)||void 0===r?void 0:r.type;return o.listStyle.formatType=S.f.fromListType(a||w.c.numbers),"number"==typeof(null===(i=null==t?void 0:t.style)||void 0===i?void 0:i.start)?(o.listStyle.startAt=t.style.start,o.listStyle.mode=l.NumberMode.startAt):null!==n?(o.listStyle.startAt=n,o.listStyle.mode=l.NumberMode.startAt):o.listStyle.mode=l.NumberMode.continueFromPrevious,o}_convertUListItemToParagraph(t,e){var n,r;const i=new l.Paragraph;return i.inlineElements=[...t.content],this._convertCommonListStyleToParagraphStyle(i,t.style,e.style),i.listStyle.type=l.ListStyleType.bullets,i.listStyle.bulletChar=null===(r=this._convertUnorderedListBullet(null===(n=null==e?void 0:e.style)||void 0===n?void 0:n.type))||void 0===r?void 0:r.charCodeAt(0),i}_convertUnorderedListLevelIndent(t){return t?t.value:null}_convertUnorderedListBullet(t){if(t instanceof C.d)return String.fromCharCode(t.value.charCodeAt(0));switch(t){case C.c.minus:return"-";case C.c.bullet:default:return"•"}}static _getSupSubSize(t){const e=t["font-size"];if(null==e)return null;const n=R.stringToNumber(e.replace("%",""));if(null==n)return null;const r=n/100;return Object(O.EqualsOfFloatNumbers)(R._defaultSupSubSize,r)?null:(+r.toFixed(3)).toString()}static _deserializeCssEscapedString(t){let e=t;return"'"===e[0]&&(e=e.slice(1)),"'"===e[e.length-1]&&(e=e.slice(0,e.length-1)),e}async _convert(t,e){var n,r;let i=[],o=[];if(t.childNodes)for(let s=0;s<t.childNodes.length;++s){const a=t.childNodes[s];if(this._isAccepted(a)){const s=this.getNodeName(a),l=this.getNodeName(a.parentNode);if("ol"!=s&&"ul"!==s&&"p"!==s||"p"!==l&&"span"!==l){if("br"!=s||"p"!==l&&"li"!==l&&("span"!==l||"p"!==this.getNodeName(null===(n=a.parentNode)||void 0===n?void 0:n.parentNode)&&"li"!==this.getNodeName(null===(r=a.parentNode)||void 0===r?void 0:r.parentNode))||1!=t.childNodes.length){let t=await this._convert(a,e);if(Array.isArray(t))for(let e=0;e<t.length;++e)i.push(t[e]);else i.push(t)}}else{if(1==t.childNodes.length)return await this._convert(a,e);{const t=await this._convert(a,e);o.push(t)}}}}const a=await this._convertNode(t,i,e);return 0==o.length?a:(0!==i.length&&o.push(a),o)}_convertBr(){return new l.Br}_convertText(t){const e=new l.InlineText;return e.value=t.textContent.replace(/</g,"<").replace(/>/g,">"),e}_convertBody(t,e){const n=new l.Text;let r=null;for(var i of e)if(i instanceof C.a)n.blocks.push(...i.items),r=n.blocks[n.blocks.length-1];else if(i instanceof w.a)n.blocks.push(...i.items),r=n.blocks[n.blocks.length-1];else if(i instanceof l.BlockElement)n.blocks.push(i),r=i;else if(i instanceof d.a)n.blocks.push(i),r=i;else if(i instanceof l.InlineElement){if(r||(r=new l.Paragraph,n.blocks.push(r)),!(r instanceof l.Paragraph))throw this._notImplemented("Inserting inline element into block element that is not paragraph");r.inlineElements.push(i)}return n}_convertParagraph(t,e,n){const r=new l.Paragraph;null!=e&&e.length>0&&r.inlineElements.push(...e);let i=t.getAttributeNode("style");const o=t.getAttributeNode("value");o&&i&&(i.value+=`; value: ${o.value}; `),"li"==this.getNodeName(t)&&(i?i.value.includes(f.listStyleType)||(i.value+="; list-style-type: disc;"):i={value:"list-style-type: disc;",name:"style"});let a=this._convertParagraphStyles(null==i?void 0:i.value,n);r.style=a.style,r.listStyle=a.listStyle;const s=t.getAttributeNode("metadata");return r.metadata=this._convertParagraphMetadata(null==s?void 0:s.value),r}_convertParagraphMetadata(t){if(Object(u.a)(t))return null;const e=Object(u.b)(t),n=new l.ParagraphMetadata;for(let r in e)n.set(r,e[r]);return n}_convertParagraphStyles(t,e){if(Object(u.a)(t))return{style:new l.ParagraphStyle,listStyle:null};const n=Object(u.b)(t);return{style:this._convertParagraphStyle(n,e),listStyle:this._convertParagraphListStyles(n)}}_convertParagraphListStyles(t){let e=new l.ParagraphListStyle;const n=t[f.listStyleType];let r;null!=n&&(r=S.c.parseComplex(n),e.type=r.listStyleType,null!==r.numberFormatType&&void 0!==r.numberFormatType&&(e.formatType=r.numberFormatType),null!==r.bulletChar&&void 0!==r.bulletChar&&(e.bulletChar=r.bulletChar));const i=parseInt(t[f.value]);let o;e.type==l.ListStyleType.numbers&&(o=S.c.parseNumberModeStartAt(i),e.mode=o.numberMode,null!==o.startAt&&void 0!==o.startAt&&(e.startAt=o.startAt));const a=t[f.bulletNumberTabPosition];return null!=a&&(e.tabPosition=S.h.parseNumber(a)),e}_convertParagraphStyle(t,e=1){let n=new l.ParagraphStyle;const r=t[p.textAlign];null!=r&&(n.alignment=S.d.parse(r));const i=t[p.textIndent];null!=i&&(n.firstLineIndent=S.h.parse(i),n.firstLineIndent.value=n.firstLineIndent.value/e);const o=t[p.paddingTop];null!=o&&(n.spaceBefore=S.h.parse(o),n.spaceBefore.value=n.spaceBefore.value/e);const a=t[p.paddingBottom];null!=a&&(n.spaceAfter=S.h.parse(a),n.spaceAfter.value=n.spaceAfter.value/e);const s=t[p.marginLeft];null!=s&&(n.leftIndent=S.h.parse(s),n.leftIndent.value=n.leftIndent.value/e);const u=t[p.marginRight];return null!=u&&(n.rightIndent=S.h.parse(u),n.rightIndent.value=n.rightIndent.value/e),this._checkUnsupportedStyles([p,f],t,"paragraph"),n}_convertOrderedList(t,e){let n=new w.a;const r=t.getAttributeNode("style");null!=r&&(n.style=this._convertOrderedListStyles(r.value));let i=n.style.start;return n.items=[],null!=e&&e.length>0&&e.forEach((t=>{var e;if(t instanceof d.a){i=(null===(e=null==t?void 0:t.style)||void 0===e?void 0:e.start)?t.style.start:null;let r=this._convertOListItemToParagraph(t,n,i);n.items.push(r),null!=i&&i++}})),n}_convertUnorderedList(t,e){let n=new C.a;const r=t.getAttributeNode("style");return null!=r&&(n.style=this._convertUnorderedListStyles(null==r?void 0:r.value)),n.items=[],null!=e&&e.length>0&&e.forEach((t=>{if(t instanceof d.a){let e=this._convertUListItemToParagraph(t,n);n.items.push(e)}})),n}_convertListItem(t,e,n){const r=this.getNodeName(t.parentNode);if("ol"==r||"ul"==r){const n=new d.a,r=t.getAttributeNode("style");if(null!=r){n.style=this._convertListItemStyles(r.value);const t=Object(u.b)(r.value);this._convertBaseListStyles(n.style,t)}const i=t.getAttributeNode("value");return null!=i&&(n.style||(n.style=new d.b),n.style.start=parseInt(i.value)),null!=e&&e.length>0&&(1==e.length&&e[0]instanceof l.Span?function(t){const n=e[0];n.style&&0===Object.keys(n.style).length&&Object.getPrototypeOf(n.style)===Object.prototype?t.content.push(...n.content):t.content.push(...e)}(n):n.content.push(...e)),n}return this._convertParagraph(t,e,n)}_convertUbi(t,e){const n=new l.Span;null!=e&&e.length>0&&e.forEach((t=>n.content.push(t))),n.style=new l.SpanStyle;const r=this.getNodeName(t);switch(r){case"u":n.style.underline=!0;break;case"b":n.style.bold=!0;break;case"i":n.style.italic=!0;break;default:throw new c.a(`Unexpected node name ${r} while parsing UBI.`)}return n}async _convertSpan(t,e,n){const r=new l.Span;return null!=e&&e.length>0&&e.forEach((t=>r.content.push(t))),r.style=await this._convertSpanStyles(t,n),r}_convertBaseListStyles(t,e){const n=e[g.marginLeft];null!=n&&(t.leftIndent=S.h.parse(n));const r=e[g.textIndent];if(null!=r){let n=S.h.parse(r);const i=e[g.textIndentCroppedPart];if(i){const t=S.h.parse(i);n.value+=t.value}t.firstLineIndent=n}const i=e[g.levelIndent];null!=i&&(t.levelIndent=S.h.parse(i));const o=e[g.bulletNumberTabPosition];null!=o&&(t.tabPosition=parseInt(o))}_convertListItemStyles(t){let e=new d.b;const n=Object(u.b)(t),r=n[m.textAlign];null!=r&&(e.alignment=S.d.parse(r));const i=n[m.fontSize];return null!=i&&(e.fontSize=S.h.parse(i)),e}_convertOrderedListStyles(t){let e=new w.b;const n=Object(u.b)(t);this._convertBaseListStyles(e,n);const r=n[y.listStyleType];null!=r&&(e.type=S.c.parseOltype(r));const i=n[y.start];return null!=i&&(e.start=S.h.parseNumber(i)),e}_convertUnorderedListStyles(t){let e=new C.b;const n=Object(u.b)(t);this._convertBaseListStyles(e,n);const r=n[_.listStyleType];return null!=r&&(e.type=S.c.parseUltype(r)),e}async _convertSpanStyles(t,e){var n,r;const i=null===(n=t.getAttributeNode("style"))||void 0===n?void 0:n.value,o=null===(r=t.getAttributeNode("colordata"))||void 0===r?void 0:r.value,a=Object(u.b)(i),s=Object(u.b)(o),c=new l.SpanStyle,p=R.getFontValue(a);if(null!=p){const t=R.getFontSettings(p,this._fontService,this._useSimpleFontList),e=t.postScriptName;e&&(c.fontName=e);const n=t.fauxBold;null!=n&&(c.bold=this._parseBool(`${n}`));const r=t.fauxItalic;null!=r&&(c.italic=this._parseBool(`${r}`))}const f=R.getUnderlineValue(a);null!=f&&(c.underline=this._parseBool(`${f}`));const d=R.getFontSizeValue(a,e);null!=d&&(c.fontSize=S.h.parse(`${d}pt`));const g=await this.getColorValue(a,s,this._colorPaletteManager);if(null!=g){const t=g.toString();null!=t&&(c.color=this._colorConverter.parse(t))}const m=await this.getStrokeValue(a,s,this._colorPaletteManager,e);if(null!=m){if(null!=m.size){const t=`${m.size}pt`;null!=t&&(c.penWidth=S.h.parse(t))}if(null!=m.colorIndex){const t=m.colorIndex.toString();null!=t&&(c.penColor=this._colorConverter.parse(t))}}const y=R.getTrackingValue(a);null!=y&&(c.tracking=S.h.parseNumber(y.toString()));const _=R.getLeadingValue(a,e);null!=_&&(c.leading=S.h.parse(`${_}pt`));const v=R.getAllCapsValue(a);null!=v&&(c.allCaps=this._parseBool(`${v}`));const b=R.getSmallCapsValue(a);if(null!=b&&(c.smallCaps=this._parseBool(`${b}`)),!0===R.getSupValue(a)){c.sup=!0;const t=R._getSupSubSize(a);t&&(c.supSize=S.h.parseNumber(t))}if(!0===R.getSubValue(a)){c.sub=!0;const t=R._getSupSubSize(a);t&&(c.subSize=S.h.parseNumber(t))}const w=R.getOpenTypeStringValue(a);null!=w&&(c.openTypeFeatures=S.i.parseHtml(w));const C=a.transform;if(null!=C){let t=C.replace(/[^0-9,.]/g,"").split(",");t&&2===t.length&&(c.horizontalScale=S.h.parseNumber(t[0]),c.verticalScale=S.h.parseNumber(t[1]))}return this._checkUnsupportedStyles([h],a,"span"),c}async _convertColor(t,e,n){let r;if(null!=e){if(r=+e,isNaN(r))return console.warn(`HtmlToXml: invalid color index: ${e}`),null}else{const e=this._colorParser.parse(t),i=await this._colorPreviewService.getPreviewAsync(e);r=n.addColorToPaletteReturnIndex({color:e,preview:i})}return r}_checkUnsupportedStyles(t,e,n){const r={};for(let a of t)for(let t in a)r[a[t]]=1;const i=[];for(let a in e)r[a]||i.push(a);const o=i.join(", ");i.length>0&&console.warn(`HtmlParser: unsupported ${n} styles: ${o}`)}_parseBool(t){return Object(u.a)(t)?null:"true"==t.toLowerCase()}_notImplemented(t=null){return new Error(`not implemented: ${t}`)}}R._defaultSupSubSize=.583;var E,j=n(430);!function(t){t[t.Regular=0]="Regular",t[t.Bold=1]="Bold",t[t.Italic=2]="Italic",t[t.BoldItalic=3]="BoldItalic",t[t.Other=4]="Other"}(E||(E={}));class N{constructor(t,e,n,r){this._fontService=t,this._colorPreviewSrvice=e,this._colorParser=n,this._useSimpleFontList=r}async serialize(t,e,n){if(null==t)throw new j.b("Text must be not null");this._colorConverter=new S.b(e,this._colorParser);let r=await this._serializeBlocks(t.blocks,n);return r=r.replace(/<p><\/p>/g,"<p><span><br /></span></p>").replace(/<p><span> <\/span><\/p>/g,"<p><span><br /></span></p>").replace(/<li><span> <\/span><\/li>/g,"<li><span><br /></span></li>").replace(/<li><\/li>/g,"<li><span><br /></span></li>").replace(/<span(| style=('|")padding-left: \d*pt('|"))><\/span>/g,(function(t,e){return"<span"+e+"><br /></span>"})),r}async _serializeBlocks(t,e){var n,r;if(null==t)return"";let i="",o="",a=null,s=null;for(let[u,c]of t.entries())if(c instanceof l.Paragraph&&((null===(n=null==c?void 0:c.listStyle)||void 0===n?void 0:n.type)===l.ListStyleType.bullets||(null===(r=null==c?void 0:c.listStyle)||void 0===r?void 0:r.type)===l.ListStyleType.numbers)){const n=this._serializeListStyle(c.listStyle);n!==a?(""!==o&&(s==l.ListStyleType.bullets?i+=this._buildTag("ul",[a],o):i+=this._buildTag("ol",[a],o)),s=c.listStyle.type,a=n,o="",o+=await this._serializeParagraph(c,e)):s==l.ListStyleType.numbers&&u>0&&this._changeStartAtToContinuefromPreviousIfRequared(c,t[u-1])?o+=await this._serializeParagraph(c,e,!0):o+=await this._serializeParagraph(c,e)}else""!==o&&(s==l.ListStyleType.bullets?i+=this._buildTag("ul",[a],o):i+=this._buildTag("ol",[a],o),o=""),i+=await this._serializeBlock(c,e);return""!==o&&(s==l.ListStyleType.bullets?i+=this._buildTag("ul",[a],o):i+=this._buildTag("ol",[a],o)),i}_changeStartAtToContinuefromPreviousIfRequared(t,e){var n,r;return(null===(n=null==t?void 0:t.listStyle)||void 0===n?void 0:n.startAt)==(null===(r=null==e?void 0:e.listStyle)||void 0===r?void 0:r.startAt)+1}async _serializeBlock(t,e){if(t instanceof l.Paragraph)return await this._serializeParagraph(t,e);if(t instanceof w.a)return await this._serializeOrderedList(t,e);if(t instanceof C.a)return await this._serializeUnorderedList(t,e);throw console.error("Unknown block type, serialization not implemented",t),new j.a("Unknown block type ")}async _serializeParagraph(t,e,n=!1){var r,i,o;let a=this._serializeParagraphStyle(t.style,t.listStyle,e),s=this._serializeParagraphMetadata(t.metadata),u=[];s&&u.push(s),a&&u.push(a),(null===(r=null==t?void 0:t.listStyle)||void 0===r?void 0:r.startAt)&&!n&&u.push(this._buildAttribute("value",[`${t.listStyle.startAt}`]));let c,h="";if(this._isEmpty(null===(i=null==t?void 0:t.listStyle)||void 0===i?void 0:i.type)||(null===(o=null==t?void 0:t.listStyle)||void 0===o?void 0:o.type)===l.ListStyleType.none){if(t.inlineElements)for(let n of t.inlineElements)h+=await this._serializeInlineElement(n,e);c=this._buildTag("p",u,h)}else{let n=this._getLiInnerSpanPadding(t.style,t.listStyle,e);if(t.inlineElements[0]instanceof l.Span){if(h+=await this._serializeSpan(t.inlineElements[0],e,n),t.inlineElements.shift(),t.inlineElements)for(let r of t.inlineElements)h+=await this._serializeInlineElement(r,e)}else{if(n&&(h+=`<span style="${n}">`),t.inlineElements)for(let n of t.inlineElements)h+=await this._serializeInlineElement(n,e);n&&(h+="</span>")}c=this._buildTag("li",u,h)}return c}_serializeParagraphMetadata(t){const e=[];if(t)for(let[n,r]of t)this._isEmpty(r)||e.push(`${n}: ${r}`);return e.length>0?this._buildAttribute("metadata",e):null}_serializeListStyle(t){let e=[];return e.push("margin-bottom: 0pt"),this._isEmpty(t.type)||e.push(`list-style-type: ${S.c.serializeComplex(t.type,t.formatType,t.bulletChar)}`),e.length>0?this._buildAttribute("style",e):null}_getLiInnerSpanPadding(t,e,n){let r=null;const i=this._isEmpty(null==t?void 0:t.firstLineIndent)?0:t.firstLineIndent.value,o=this._isEmpty(null==t?void 0:t.leftIndent)?N._listsLeftIndentEqualsToModelZero:t.leftIndent.value,a=this._isEmpty(null==e?void 0:e.tabPosition)?0:e.tabPosition,s=e&&e.type&&(e.formatType||e.bulletChar)?S.c.serializeComplex(e.type,e.formatType,e.bulletChar):"";let l=N.getCorrectpaddingLeftValue(i,o,a,s);return 0!=l&&(r=`padding-left: ${N.setValueInPoints(l,n)}`),r}static getCorrectTextIndentValue(t,e){let n=t;return t<-e&&(n=-e),n}static getCorrectpaddingLeftValue(t=0,e=N._listsLeftIndentEqualsToModelZero,n=0,r){let i=0;if(t<0)i-=N.getCorrectTextIndentValue(t,e)+17;else{let e=n-t+i,r=0;r=n-t>12?-17:n-t>-32?-17+n:62,e+=r,e>i&&(i=e)}return r.match(/('|").('|")/)?i+=5:r.match(/(disc|circle|square)/)&&(i-=3),i}_serializeParagraphStyle(t,e,n){let r=[];if(t){if(this._isEmpty(t.alignment)||r.push(`text-align: ${N.setAlignment(t.alignment)}`),!this._isEmpty(t.firstLineIndent))if((null==e?void 0:e.type)==l.ListStyleType.bullets||(null==e?void 0:e.type)==l.ListStyleType.numbers){const e=t.firstLineIndent.value,i=N.getCorrectTextIndentValue(e,this._isEmpty(t.leftIndent)?N._listsLeftIndentEqualsToModelZero:t.leftIndent.value);r.push(`text-indent: ${N.setValueInPoints(i,n)}`),i!=e&&r.push(`text-indent-cropped-part: ${N.setValueInPoints(-i+e,n)}`)}else r.push(`text-indent: ${N.setValueInPoints(t.firstLineIndent.value,n)}`);this._isEmpty(t.spaceBefore)||r.push(`padding-top: ${N.setValueInPoints(t.spaceBefore.value,n)}`),this._isEmpty(t.spaceAfter)||r.push(`padding-bottom: ${N.setValueInPoints(t.spaceAfter.value,n)}`),this._isEmpty(t.leftIndent)||(this._isEmpty(null==e?void 0:e.type)?r.push(`margin-left: ${N.setValueInPoints(t.leftIndent.value,n)}`):r.push(`margin-left: ${N.setCorrectedForListsLeftIndentValue(t.leftIndent.value,n)}`)),this._isEmpty(t.rightIndent)||r.push(`margin-right: ${N.setValueInPoints(t.rightIndent.value,n)}`)}return e&&(this._isEmpty(e.tabPosition)||r.push(`bullet-number-tab-position: ${N.setBulletTabPosition(e.tabPosition,n)}`),this._isEmpty(e.level)||r.push(`level: ${e.level}`),this._isEmpty(e.type)||r.push("list-style-position: inside")),r.length>0?this._buildAttribute("style",r):null}static setAlignment(t){const e="string"==typeof t?N.stringToTextAlignmentForHtml(t):t;return N.textAlignmentToHtmlString(e)}static stringToTextAlignmentForHtml(t){switch(t.toLocaleLowerCase()){case"left":default:return L.qb.Left;case"center":return L.qb.Center;case"right":return L.qb.Right;case"justify":case"justify-all":case"justification":case"justification-last-left":case"justification-last-center":case"justification-last-right":return L.qb.Justify}}static textAlignmentToHtmlString(t){switch(t){case L.qb.Left:return"left";case L.qb.Center:return"center";case L.qb.Right:return"right";case L.qb.Justify:return"justify"}}static setValueInPoints(t,e=1){return("number"==typeof t?t:N.stringToNumber(t,"pt"))*e+"pt"}static setBulletTabPosition(t,e=1){return""+("number"==typeof t?t:N.stringToNumber(t,"pt"))*e}static setCorrectedForListsLeftIndentValue(t,e=1){let n="number"==typeof t?t:N.stringToNumber(t,"pt");return n-=N._listsLeftIndentEqualsToModelZero,n*e+"pt"}static stringToNumber(t,e="",n=0){if(null==t)return null;const r=N.isNullOrEmptyOrWhiteSpace(e)?+t:+t.replace(e,"");return isNaN(r)?n:r}static isNullOrEmptyOrWhiteSpace(t){return null==t||""===t.trim()}_serializeInlineText(t){return t.value.replace(/\n\r/gm,"<br />").replace(/\n/gm,"<br />")}async _serializeInlineElement(t,e){return t instanceof l.Span?await this._serializeSpan(t,e):t instanceof l.InlineText?this._serializeInlineText(t):t instanceof l.Br?this._serializeBr(t):void 0}_serializeBr(t){return"<br />"}async _serializeSpan(t,e,n=null){let r=t.style||n?await this._serializeSpanStyle(t,e,n):null,i=r?`<span ${r}>`:"<span>",o="";if(null!=t.content)for(let a of t.content)o+=await this._serializeInlineElement(a,e);else o+="<br>";return`${i}${o}</span>`}async _serializeSpanStyle(t,e,n=null){const r=t.style;let i=[],o=[];if(n&&i.push(n),r){this._isEmpty(r.underline)||i.push("text-decoration: "+(r.underline?"underline":"none"));const t=N.getFontValue(r,this._fontService,this._useSimpleFontList);if(null!=t&&(this._isEmpty(t.family)||i.push(`font-family: ${t.family}`)),this._isEmpty(r.bold)&&!(null==t?void 0:t.bold)||i.push("font-weight: "+(r.bold||(null==t?void 0:t.bold)?"bold":"normal")),this._isEmpty(r.italic)&&!(null==t?void 0:t.italic)||i.push("font-style: "+(r.italic||(null==t?void 0:t.italic)?"italic":"normal")),this._isEmpty(r.fontSize)||i.push(`font-size: ${N.setValueInPoints(r.fontSize.value,e)}`),this._isEmpty(r.leading)||i.push("line-height: "+(0===r.leading.value?"normal":`${N.setValueInPoints(r.leading.value,e)}`)),this._isEmpty(r.tracking)||i.push(`letter-spacing: ${N.trackingToLetterSpacing(r.tracking)}`),!this._isEmpty(r.color)){const t=await this._colorPreviewSrvice.getPreviewAsync(r.color.color);i.push(`color: ${t.toString()}`),o.push(`color-index: ${this._colorConverter.serialize(r.color)}`)}if(!this._isEmpty(r.penColor)&&!this._isEmpty(r.penWidth)){const t=await this._colorPreviewSrvice.getPreviewAsync(r.penColor.color);i.push(`-webkit-text-stroke: ${N.setValueInPoints(r.penWidth.value,e)} ${t}`),o.push(`pen-color-index: ${this._colorConverter.serialize(r.penColor)}`)}if(!this._isEmpty(r.sub)){i.push("vertical-align: sub");let t=r.subSize;this._isEmpty(t)&&(t=N._defaultSupSubSize),i.push(`font-size: ${100*t}%`)}if(!this._isEmpty(r.sup)){i.push("vertical-align: super");let t=r.supSize;this._isEmpty(t)&&(t=N._defaultSupSubSize),i.push(`font-size: ${100*t}%`)}if(this._isEmpty(r.allCaps)||i.push("text-transform: "+(r.allCaps?"uppercase":"none")),this._isEmpty(r.smallCaps)||i.push("font-variant-caps: "+(r.smallCaps?"all-small-caps":"none")),(!this._isEmpty(r.horizontalScale)&&1!==r.horizontalScale||!this._isEmpty(r.verticalScale)&&1!==r.verticalScale)&&(this._isEmpty(r.horizontalScale)&&(r.horizontalScale=1),this._isEmpty(r.verticalScale)&&(r.verticalScale=1),i.push(`transform:scale(${r.horizontalScale},${r.verticalScale})`)),!this._isEmpty(r.openTypeFeatures)){let t="";for(let e of r.openTypeFeatures)null!=e.tag&&null!=e.tag&&(t+=`'${e.tag}' ${null!=e.value&&null!=e.value?e.value:""},`);t=t.slice(0,-1),i.push(`font-feature-settings: ${t}`)}}let a="";return o.length>0&&(a+=this._buildAttribute("colordata",o),a+=" "),i.length>0&&(a+=this._buildAttribute("style",i)),""!==a?a:null}static setStrokeValue(t,e,n,r=1){var i,o;const a=t.attributes.colordata,s=null!=a?Object(u.b)(a.value):{};e.enabled?(t.style.webkitTextStrokeWidth=e.size*r+"pt",e.color&&(t.style.webkitTextStrokeColor=null===(o=null===(i=e.color)||void 0===i?void 0:i.preview)||void 0===o?void 0:o.toString(),s["pen-color-index"]=n.addColorToPaletteReturnIndex(e.color).toString())):(N.isNullOrEmptyOrWhiteSpace(t.style.webkitTextStrokeWidth)&&N.isNullOrEmptyOrWhiteSpace(t.style.webkitTextStrokeColor)&&N.isNullOrEmptyOrWhiteSpace(t.style.webkitTextStroke)?(t.style.webkitTextStrokeWidth="0pt",t.style.webkitTextStrokeColor="rgba(0,0,0,0)"):(t.style.webkitTextStrokeWidth=null,t.style.webkitTextStrokeColor=null,t.style.webkitTextStroke=null),delete s["pen-color-index"]),P.isEmpty(s)?t.removeAttribute("colordata"):t.setAttribute("colordata",Object(u.c)(s))}static getFontValue(t,e,n){const r=t.fontName,i=t.bold,o=t.italic;if(null==r&&null==i&&null==o)return null;const a={postScriptName:N.isNullOrEmptyOrWhiteSpace(r)?null:r,fauxBold:i||null,fauxItalic:o||null};return N.fontSettingsToHtmlValue(a,e,n)}static fontSettingsToHtmlValue(t,e,n){if(null==t)return null;const r=t.postScriptName,i=t.fauxBold,o=t.fauxItalic;if(null==r&&null==i&&null==o)return null;const a={};if(n){if(!N.isNullOrEmptyOrWhiteSpace(r)){a.family=e.getCssFontFamily(e.availableFontsByPsName[r.toLowerCase()].family);const t=e.recognizeStyleByPsName(r);a.bold=t===E.Bold||t===E.BoldItalic,a.italic=t===E.Italic||t===E.BoldItalic}}else a.family=null!=r?e.getCssPsName(r):null,a.bold=i,a.italic=o;return a}static setAlignmentValue(t,e){const n="string"==typeof e?N.stringToTextAlignmentForHtml(e):e;t.style.textAlign=N.textAlignmentToHtmlString(n)}static setFirstLineIndentValue(t,e,n=1){const r="number"==typeof e?e:N.stringToNumber(e,"pt");t.style.textIndent=r*n+"pt"}static setSpaceAfterValue(t,e,n=1){const r="number"==typeof e?e:N.stringToNumber(e,"pt");t.style.paddingBottom=r*n+"pt"}static setSpaceBeforeValue(t,e,n=1){const r="number"==typeof e?e:N.stringToNumber(e,"pt");t.style.paddingTop=r*n+"pt"}static setRightIndentValue(t,e,n=1){const r="number"==typeof e?e:N.stringToNumber(e,"pt");t.style.marginRight=r*n+"pt"}static setLeftIndentValue(t,e,n=1){const r="number"==typeof e?e:N.stringToNumber(e,"pt");t.style.marginLeft=r*n+"pt"}static setFontValue(t,e){null!=e.family&&(t.style.fontFamily=e.family),null!=e.bold&&(t.style.fontWeight=!0===e.bold?"bold":"normal"),null!=e.italic&&(t.style.fontStyle=!0===e.italic?"italic":"normal")}static setBoldValue(t,e){t.style.fontWeight=!0===e||"true"===e?"bold":"normal"}static setItalicValue(t,e){t.style.fontStyle=!0===e||"true"===e?"italic":"normal"}static setUnderlineValue(t,e){t.style.textDecoration=!0===e||"true"===e?"underline":"none"}static setFontSizeValue(t,e,n=1){const r="number"==typeof e?e:N.stringToNumber(e,"pt");t.style.fontSize=r*n+"pt"}static setFontNameValue(t,e){t.style.fontFamily=e}static setLeadingValue(t,e,n=1){const r="number"==typeof e?e:N.stringToNumber(e,"pt");t.style.lineHeight=0===r?"normal":r*n+"pt"}static setTrackingValue(t,e){t.style.letterSpacing=N.trackingToLetterSpacing(e)}static trackingToLetterSpacing(t){return(isNaN(t)?0:t/1e3)+"em"}static setColorValue(t,e,n,r){t.style.color=n.toString();const i=r.addColorToPaletteReturnIndex({color:e,preview:n});N.setColorIndex(t,i)}static setColorIndex(t,e){const n=t.attributes.colordata,r=null!=n?Object(u.b)(n.value):{};r["color-index"]=e.toString(),t.setAttribute("colordata",Object(u.c)(r))}static setSupValue(t,e,n){!0!==e&&"true"!==e||(t.style.verticalAlign="super",null==n&&(n=N._defaultSupSubSize),t.style.fontSize=100*n+"%")}static setSubValue(t,e,n){!0!==e&&"true"!==e||(t.style.verticalAlign="sub",null==n&&(n=N._defaultSupSubSize),t.style.fontSize=100*n+"%")}static setAllCapsValue(t,e){t.style.textTransform=!0===e||"true"===e?"uppercase":"none"}static setSmallCapsValue(t,e){t.style.fontVariantCaps=!0===e||"true"===e?"all-small-caps":"none"}static setOpenTypeValue(t,e){null!=e&&0!=e.length&&(t.style.fontFeatureSettings=e.map((t=>`"${t.tag.toLowerCase()}" ${t.value}`)).join(", "))}static setOpenTypeStringValue(t,e){let n=null;e.split(";").forEach((t=>{if(N.isNullOrEmptyOrWhiteSpace(t))return;const e=t.split(","),r=e[0],i=2===e.length?e[1]:null;null==n?n="":n+=", ",n+=`"${r.toLowerCase()}"`,null!=i&&(n+=` ${i}`)})),null!=n&&(t.style.fontFeatureSettings=n)}static parseOpenTypeFeaturesFromGmXml(t){if(N.isNullOrEmptyOrWhiteSpace(t))return null;const e=[];return t.split(";").forEach((t=>{if(N.isNullOrEmptyOrWhiteSpace(t))return;const n=t.split(","),r=n[0].toLowerCase(),i=2===n.length?n[1]:null,o=new T.a(r,N.stringToNumber(null!=i?i:"1"));e.push(o)})),e}async _serializeOrderedList(t,e){let n=t.style?this._serializeOrderedListStyle(t.style):null,r=n?`<ol ${n}>`:"<ol>";if(0==t.items.length)return`${r}</ol>`;let i="";for(let o of t.items)i+=await this._serializeListItem(o,e);return`${r}${i}</ol>`}_serializeOrderedListStyle(t){let e=[];return this._isEmpty(t.start)||e.push(`start: ${t.start}`),this._isEmpty(t.levelIndent)||e.push(`level-indent: ${t.levelIndent}`),this._isEmpty(t.textIndent)||e.push(`text-indent: ${t.textIndent}`),this._isEmpty(t.type)||e.push(`type: ${w.c[t.type]}`),e.length>0?this._buildAttribute("style",e):null}async _serializeUnorderedList(t,e){let n=t.style?this._serializeUnorderedListStyle(t.style):null,r=n?`<ul ${n}>`:"<ul>";if(0==t.items.length)return`${r}</ul>`;let i="";for(let o of t.items)i+=await this._serializeListItem(o,e);return`${r}${i}</ul>`}_serializeUnorderedListStyle(t){let e=[];return this._isEmpty(t.levelIndent)||e.push(`level-indent: ${t.levelIndent}`),this._isEmpty(t.textIndent)||e.push(`text-indent: ${t.textIndent}`),this._isEmpty(t.type)||(t.type instanceof C.d?e.push(`type: ${t.type.value}`):e.push(`type: ${C.c[t.type]}`)),e.length>0?this._buildAttribute("style",e):null}async _serializeListItem(t,e){if(t instanceof l.Paragraph)return await this._serializeParagraph(t,e);throw new Error("not implemented")}_buildTag(t,e,n){let r=`<${t}`;return e.forEach((t=>{r+=` ${t}`})),r+=">",n&&(r+=n),r+=`</${t}>`,r}_buildAttribute(t,e){return`${t}="${e.join("; ")}"`}_isEmpty(t){return null==t}}N._defaultSupSubSize=.583,N._listsLeftIndentEqualsToModelZero=30;var k=n(527),A=n(865),F=n(589);class B{}B.fontName="fontName",B.bold="bold",B.italic="italic",B.underline="underline",B.subscript="subscript",B.superscript="superscript",B.color="color",B.justifyCenter="justifyCenter",B.justifyFull="justifyFull",B.justifyLeft="justifyLeft",B.justifyRight="justifyRight",B.documentCommands=P.values([B.fontName,B.bold,B.italic,B.underline,B.color,B.justifyCenter,B.justifyFull,B.justifyLeft,B.justifyRight,B.subscript,B.superscript]),B.verticalAlignmentTop="verticalAlignmentTop",B.verticalAlignmentCenter="verticalAlignmentCenter",B.verticalAlignmentBottom="verticalAlignmentBottom",B.alignment="alignment",B.firstLineIndent="first-line-indent",B.spaceAfter="space-after",B.spaceBefore="space-before",B.leftIndent="left-indent",B.rightIndent="right-indent",B.verticalAlignment="vertical-alignment",B.fontSize="fontSize",B.stroke="stroke",B.tracking="tracking",B.leading="leading",B.allCaps="all-caps",B.smallCaps="small-caps",B.openType="open-type";class M{constructor(){}static setInitData(t){this._initData=t}static setPreviewScale(t){this._previewScale=t}static _getListStyle(t){let e="";return e+="margin-bottom: 0pt; ",e+=`list-style-type: ${F.a.serializeComplex(t,this._initData.listSettings.numberingFormat,this._initData.listSettings.bulletChar)}`,e}static _getListItemStyle(){let t="",e=this._initData.listSettings.firstLineIndent,n=N.getCorrectTextIndentValue(e,this._initData.listSettings.listIndent);return t+=`text-indent: ${N.setValueInPoints(n,this._previewScale)}; `,n!=e&&(t+=`text-indent-cropped-part: ${N.setValueInPoints(-n+e,this._previewScale)}; `),t+=`margin-left: ${N.setCorrectedForListsLeftIndentValue(this._initData.listSettings.listIndent,this._previewScale)}; `,t+=`bullet-number-tab-position: ${this._initData.listSettings.tabOffset}; `,t+="list-style-position: inside",t}static _getInnerSpanStyle(t){let e="";const n=F.a.serializeComplex(t,this._initData.listSettings.numberingFormat,this._initData.listSettings.bulletChar);return e+=`padding-left: ${N.getCorrectpaddingLeftValue(this._initData.listSettings.firstLineIndent,this._initData.listSettings.listIndent,this._initData.listSettings.tabOffset,n)}pt; `,e}static _nextNode(t){if(t.hasChildNodes())return t.firstChild;for(;t&&!t.nextSibling;)t=t.parentNode;return t?t.nextSibling:null}static _getRangeSelectedNodes(t){let e=t.startContainer,n=t.endContainer;if(e==n)return[e];let r=[];for(;e&&e!=n;)r.push(e=this._nextNode(e));for(e=t.startContainer;e&&e!=t.commonAncestorContainer;)r.unshift(e),e=e.parentNode;return r}static _getSelectedNodes(){if(document.getSelection){let t=document.getSelection();return this._getRangeSelectedNodes(t.getRangeAt(0))}return[]}static _findLi(t=null){let e;for(e=t||document.getSelection().anchorNode;e;){if(M.isListItem(e))return e;e=e.parentNode}return null}static _findParagraph(t=null){let e;for(e=t||document.getSelection().anchorNode;e;){if(M.isParagraph(e))return e;e=e.parentNode}return null}static findAllSelectedLis(){let t=[];return M._getSelectedNodes().forEach((e=>{const n=M._findLi(e);n&&t.push(n)})),t}static isBr(t){return"br"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isListItem(t){return"li"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isBulletedList(t){return"ul"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isNumberedList(t){return"ol"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isAnyList(t){return M.isBulletedList(t)||M.isNumberedList(t)}static getDefaultFontValue(t){const e={};return e.family=null==t?void 0:t.postScriptName,e.bold=null==t?void 0:t.fauxBold,e.italic=null==t?void 0:t.fauxItalic,e}static paragraphStyleToCommands(t,e=!0){const n=[];if(null!=t.alignment)if(e&&P.isEmpty(P.omit(t,B.alignment)))switch(t.alignment){case L.qb.Left:n.push({key:B.justifyLeft});break;case L.qb.Center:n.push({key:B.justifyCenter});break;case L.qb.Right:n.push({key:B.justifyRight});break;case L.qb.Justify:case L.qb.LastLeft:n.push({key:B.justifyFull})}else t.alignment==L.qb.LastLeft&&(t.alignment=L.qb.Justify),n.push({key:B.alignment,value:t.alignment});return null!=t.firstLineIndent&&n.push({key:B.firstLineIndent,value:t.firstLineIndent}),null!=t.leftIndent&&n.push({key:B.leftIndent,value:t.leftIndent}),null!=t.rightIndent&&n.push({key:B.rightIndent,value:t.rightIndent}),null!=t.spaceAfter&&n.push({key:B.spaceAfter,value:t.spaceAfter}),null!=t.spaceBefore&&n.push({key:B.spaceBefore,value:t.spaceBefore}),n}static isSpan(t){return"span"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isParagraph(t){return"p"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static isText(t){return"#text"===(null==t?void 0:t.nodeName.toLocaleLowerCase())}static _findEmptyNodeInside(t=null){let e=t;for(;e;){if(M.isBr(e))return e.parentNode;if(1!=e.childNodes.length)return null;e=e.childNodes[0]}return null}static saveSelection(t,e=0){let n=window.getSelection(),r=n.getRangeAt(0),i=r.toString().length,o=M._findEmptyNodeInside(r.startContainer),a=M._findEmptyNodeInside(r.endContainer),s=o||0!=r.startOffset?null:r.startContainer,l=a||0!=r.endOffset||n.isCollapsed?null:r.endContainer;(a&&a!==o||l&&l!==s)&&(i+=1),r.setStart(t,0);let u=r.toString().length;u=u-i+e,(o||s)&&(u+=1),(a&&a!==o||l&&l!==s)&&(u+=1);const c=u;return function(){const e=NodeFilter.SHOW_TEXT;o&&(o.innerHTML="​"),a&&(a.innerHTML="​"),s&&(s.textContent=""+s.textContent),l&&(l.textContent=""+l.textContent);let r=document.createTreeWalker(t,e,(function(t){return u>t.textContent.length?(u-=t.textContent.length,NodeFilter.FILTER_REJECT):NodeFilter.FILTER_ACCEPT}));const h=r.currentNode;let p=r.nextNode();const f=u;u=c+i,r.currentNode=h;let d=r.nextNode(),g={startNode:p||t,startPosition:f,endNode:d||t,endPosition:u};u=c,s&&(s.textContent=s.textContent.substring(1),g.startPosition-=1,g.endPosition-=1),n.removeAllRanges();let m=new Range;m.setStart(g.startNode,g.startPosition),m.setEnd(g.endNode,g.endPosition),n.addRange(m)}}static getCorrectLinesCount(t){let e=0;const n=NodeFilter.SHOW_ALL;return document.createTreeWalker(t,n,(function(t){return"p"!==t.nodeName.toLowerCase()&&"li"!==t.nodeName.toLowerCase()||e++,NodeFilter.FILTER_REJECT})).nextNode(),e}static getDefaultInlineStyle(t){var e,n,r,i,o,a;return{font:{postScriptName:t.font.postScriptName,fauxBold:t.font.fauxBold,fauxItalic:t.font.fauxItalic,size:t.font.size},underline:t.underline,leading:t.leading,tracking:t.tracking,color:{color:null===(e=t.color)||void 0===e?void 0:e.color.clone(),preview:null===(r=null===(n=t.color)||void 0===n?void 0:n.preview)||void 0===r?void 0:r.clone()},stroke:{enabled:t.stroke.enabled,size:t.stroke.size,color:{color:null===(i=t.stroke.color)||void 0===i?void 0:i.color.clone(),preview:null===(a=null===(o=t.stroke.color)||void 0===o?void 0:o.preview)||void 0===a?void 0:a.clone()}},openType:t.openType}}static insertTextAtCaret(t){let e,n;window.getSelection&&(e=window.getSelection(),e.getRangeAt&&e.rangeCount&&(n=e.getRangeAt(0),n.deleteContents(),n.insertNode(document.createTextNode(t))))}static setListStyle(t,e){t[0].parentElement.setAttribute("style",M._getListStyle(e));const n=M._getInnerSpanStyle(e);t.forEach((t=>{let e;t.setAttribute("style",M._getListItemStyle());let r=t.childNodes[0];if(M.isSpan(r)){const t=r.getAttribute("style");e=t?t.includes("padding-left")?t.replace(/padding-left:(| )\d*(pt|px)(;|)( |)/,n):n+t:n,r.setAttribute("style",e)}else t.innerHTML="<span style='"+e+"'>"+t.innerHTML+"</span>"}))}static getAdjacentLi(t){const e=t[0].previousElementSibling;if(M.isListItem(e))return e;const n=t[t.length-1].nextElementSibling;return M.isListItem(n)?n:null}static setAdjacentLiStyle(t,e){const n=e.getAttribute("style"),r=e.childNodes[0],i=null==r?void 0:r.getAttribute("style");t.forEach((t=>{let e;if(t.setAttribute("style",null!=n?n:""),i){let n=t.childNodes[0];if(M.isSpan(n)){const t=n.getAttribute("style");e=t?t.includes("padding-left")?t.replace(/(;|; |)padding-left:(| )\d*(pt|px)(;|)( |)/,`;${i};`):i+"; "+t:i,n.setAttribute("style",e)}else t.innerHTML="<span style='"+e+"'>"+t.innerHTML+"</span>"}}))}static wrapSpansWithP(){const t=M._getSelectedNodes();0!==t.length&&(1==t.length&&t.push(t[0].parentNode),t.forEach((t=>{if(M.isSpan(t)&&!M.isParagraph(t.parentNode)){let e=t.nextSibling;M.isBr(e)&&e.remove(),t.outerHTML="<p>"+t.outerHTML+"</p>"}})))}static processEnterOnEmptyListItem(t,e){const n=M._findLi();if(n&&n.innerHTML.match(/<span(| style=('|").*('|"))>(|<span(| style=('|").*('|"))>)<br>(|<\/span>)<\/span>/)){t.preventDefault();const r=M.saveSelection(e);n.setAttribute("replace","here");const i=n.parentElement,o=i.nodeName.toLowerCase(),a=i.getAttribute("style");i.outerHTML=i.outerHTML.replace(n.outerHTML,`</${o}><p><span>​</span></p><${o} style="${a}">`),r()}}static getParagraphIndex(t){let e=t;for(;e&&!M.isListItem(e)&&!M.isParagraph(e);)e=e.parentNode;const n=e,r=e.parentNode;for(var i=0;i<r.childNodes.length;i++)if(r.childNodes[i]==n)return i;return console.error("unable to get paragraph index"),-1}static getParagraphByIndex(t){if(t<0)return null;const e=window.getSelection().getRangeAt(0).startContainer.parentElement;return t>=e.children.length?null:e.children[t]}static getParagraphLengthByIndex(t){const e=this.getParagraphByIndex(t);return null==e?0:this.getParagraphLength(e)}static getParagraphLength(t){return null==t?0:t.textContent.length}static getCurrentParagraphLength(t=0){let e=window.getSelection().getRangeAt(0).startContainer;for(;e&&!M.isListItem(e)&&!M.isParagraph(e);)e=e.parentNode;if(t<0)for(let n=t;n<0;n++)e=e.previousSibling;if(t>0)for(let n=t;n>0;n--)e=e.nextSibling;return e&&e.textContent?e.textContent.length:0}static getEveryLineLength(t){let e=[];const n=NodeFilter.SHOW_ELEMENT;return document.createTreeWalker(t,n,(function(t){return t.textContent&&e.push(t.textContent.length),NodeFilter.FILTER_REJECT})).nextNode(),e}static isCaretOnTheBeginingOfListItem(){const t=window.getSelection();if(t.isCollapsed&&0==t.anchorOffset&&M._findLi())return!0}static isCaretOnTheBeginingOfParagraph(){const t=window.getSelection();if(t.isCollapsed&&0==t.anchorOffset&&M._findParagraph())return!0}static isCaretOnEndOfParagraph(t){const e=window.getSelection();if(e.isCollapsed&&e.anchorOffset==t&&M._findParagraph())return!0}static async applyCommands(t,e,n,r){for(let i of e){const e=i.key,o=i.value;switch(e){case B.fontName:N.setFontNameValue(t,o);break;case B.fontSize:N.setFontSizeValue(t,o,this._previewScale);break;case B.bold:N.setBoldValue(t,o);break;case B.italic:N.setItalicValue(t,o);break;case B.allCaps:N.setAllCapsValue(t,o);break;case B.underline:N.setUnderlineValue(t,o);break;case B.leading:N.setLeadingValue(t,o,this._previewScale);break;case B.tracking:N.setTrackingValue(t,o);break;case B.color:{const e=await r.getPreviewAsync(o.color);N.setColorValue(t,o.color,e,n)}break;case B.stroke:{const e=o;e.color.preview=await r.getPreviewAsync(e.color.color),N.setStrokeValue(t,e,n,this._previewScale)}break;case B.openType:N.setOpenTypeValue(t,o);break;case B.subscript:N.setSubValue(t,o);break;case B.superscript:N.setSupValue(t,o);break;case B.alignment:N.setAlignmentValue(t,o);break;case B.firstLineIndent:N.setFirstLineIndentValue(t,o,this._previewScale);break;case B.spaceAfter:N.setSpaceAfterValue(t,o,this._previewScale);break;case B.spaceBefore:N.setSpaceBeforeValue(t,o,this._previewScale);break;case B.leftIndent:N.setLeftIndentValue(t,o,this._previewScale);break;case B.rightIndent:N.setRightIndentValue(t,o,this._previewScale)}}}static async customInlineCommand(t,e,n,r,i){if(null==e||e.collapsed)return;const o=document.getSelection(),a=n.cloneNode(),s=t=>{if(o.containsNode(t,!1)||!t.hasChildNodes())return!0;let n=!0,r=!0;return M.isSpan(t.firstChild)?n=s(t.firstChild):M.isText(t.firstChild)&&(n=t.firstChild.isSameNode(e.startContainer)&&0==e.startOffset),M.isSpan(t.lastChild)?r=s(t.lastChild):M.isText(t.lastChild)&&(r=t.lastChild.isSameNode(e.endContainer)&&e.endOffset==t.lastChild.length),e.startContainer.isSameNode(e.endContainer)?n&&r:n||r},l=async(n,a)=>{for(let u=0;u<n.childNodes.length;u++){const c=n.childNodes.item(u);if(o.containsNode(c,!0))if(M.isText(c)){let n=c.cloneNode(!1),o=null,s=0;c.isSameNode(e.startContainer)&&(s=e.startOffset,o=n.splitText(s),a.appendChild(n),n=o,o=null),c.isSameNode(e.endContainer)&&(o=n.splitText(e.endOffset-s));const l=document.createElement("span");await M.applyCommands(l,t,r,i),l.textContent=n.textContent,a.appendChild(l),null!=o&&a.appendChild(o)}else if(M.isSpan(c)&&s(c)){const e=c.cloneNode(!0);await M.applyCommands(e,t,r,i),a.appendChild(e)}else{const t=c.cloneNode(!1);await l(c,t),a.appendChild(t)}else a.appendChild(c.cloneNode(!0))}};for(let u=0;u<n.childNodes.length;u++){const t=n.childNodes.item(u);if(o.containsNode(t,!0)){const e=t.cloneNode(!1);await l(t,e),a.appendChild(e)}else a.appendChild(t.cloneNode(!0))}n.focus(),document.execCommand("selectAll"),document.execCommand("insertHTML",!1,a.innerHTML)}}M._previewScale=1;var z=n(447);class D{constructor(t){this._rootElement=t}updateTextMetrics(t){this._textMetrics=t}updateSelection(t){this._range=t.getRangeAt(0),this._isSelectionCollapsed=t.isCollapsed}getTextMetrics(){return this._textMetrics}getSelectionRightParagraphLength(){return M.getParagraphLength(this._range.endContainer)}getSelectionRightParagraphIndex(){return M.getParagraphIndex(this._range.endContainer)}getSelectionLeftParagraphIndex(){return M.getParagraphIndex(this._range.startContainer)}getSelectionLeftParagraphLength(){return M.getParagraphLength(this._range.startContainer)}getSelectionRightParagraphOffset(){return this._range.endOffset}getSelectionLeftParagraphOffset(){return this._range.startOffset}get isSelectionCollapsed(){return this._isSelectionCollapsed}get isSelectionMultiline(){return this._range.startContainer!=this._range.endContainer}get isCursorAtTheBeginningOfParagraph(){return M.isCaretOnTheBeginingOfParagraph()}get isCaretAtTheEndOfParagraph(){return M.isCaretOnEndOfParagraph(this._textMetrics.currentLineLength)}getNextParagraphLength(){return M.getCurrentParagraphLength(1)}getPreviousParagraphLength(){return M.getCurrentParagraphLength(-1)}getParagraphIndex(){throw new Error("Method not implemented.")}getParagraphText(){throw new Error("Method not implemented.")}getTextFromStartOfParagraph(){throw new Error("Method not implemented.")}getCursorPosition(){throw new Error("Method not implemented.")}getSelection(){throw new Error("Method not implemented.")}getParagraphLength(t){throw new Error("Method not implemented.")}getListItemLevel(){throw new Error("Method not implemented.")}findItemToContinueBulletedList(t){throw new Error("Method not implemented.")}findItemToContinueNumberedList(t,e){throw new Error("Method not implemented.")}}class H{constructor(){this.textLength=null,this.currentLineLength=null,this.linesCount=null}update(t,e,n){return(t!==this.textLength||e!==this.currentLineLength||n!==this.linesCount)&&(this.textLength=t,this.currentLineLength=e,this.linesCount=n,!0)}}class U{constructor(t,e,n,r,o,l,u,c){this._inputTextValidator=r,this._listStyleSheetManager=null,this._colorPalette=null,this._fontService=null,this._useSimpleFontList=!1,this._range=null,this._inlineStyle=null,this._defaultInlineStyle=null,this._paragraphStyle=null,this._defaultParagraphStyle=null,this._usedColors=[],this._previewScale=1,this.styleChanged=new i.a,this.editorInitialized=new i.a,this._ready=!1,this._textMetrics=null,this._textLimits=null,this._limitsInputValidator=null,this._currentTextInfo=null,this._elementHandler=t,this._invalidCharEntered=new i.a,this._isActive=!1,this._frameChangedEvent=new i.a,this._textLimitsViolationEvent=new i.a,this._textMetricsChangedEvent=new i.a,this._designAtomsApiClient=o,this._colorPreviewService=l,this._rgbColorParser=c,this._colorParser=u,document.onselectionchange=async t=>{await this._onSelectionChange()},this._fontService=e,this._useSimpleFontList=n,e.waitInit().then((()=>this._designAtomsApiClient.getFontsCSS(Object.keys(e.availableFontsByPsName),!this._useSimpleFontList))).then((t=>{this._elementHandler.addTextEditorStyles(t),this._ready=!0,this.editorInitialized.fire()})).catch((t=>console.error(`Unable to get FontsCss. Reason: ${t}`))),this._htmlSerializer=new N(this._fontService,this._colorPreviewService,this._colorParser,this._useSimpleFontList),this._gmXmlParser=new a.a(this._colorParser),this._htmlParser=new R(this._colorPalette,this._fontService,this._useSimpleFontList,this._colorParser,this._colorPreviewService),this._GmXmlSerializer=new s.a(this._colorParser)}get disableDrawBaseline(){return!0}get highlightInEditingModeEnabled(){return!1}get redrawActiveTextInEditMode(){return!1}get frameChanged(){return this._frameChangedEvent}get invalidCharEntered(){return this._invalidCharEntered}get textMetrics(){return this._textMetrics}get textLimits(){return this._textLimits}get canUndo(){return document.queryCommandEnabled("undo")}get canRedo(){return document.queryCommandEnabled("redo")}get isActive(){return this._isActive}get isReady(){return this._ready}get textMetricsChangedEvent(){return this._textMetricsChangedEvent}get textLimitsViolationEvent(){return this._textLimitsViolationEvent}get _div(){return this._elementHandler.textEditorDiv}get _innerDiv(){return this._elementHandler.textEditorInnerDiv}isApplyingListsEnabled(){return!0}executeCommand(t,e){if(29!==t)throw new Error("Method not implemented.");{const t=M.saveSelection(this._innerDiv);t(),1===(null==e?void 0:e.listType)&&document.execCommand("insertUnorderedList"),2===(null==e?void 0:e.listType)&&document.execCommand("insertOrderedList");let n=M.findAllSelectedLis();if(0!==n.length&&M.isAnyList(n[0].parentElement)){const t=M.getAdjacentLi(n);t?M.setAdjacentLiStyle(n,t):M.setListStyle(n,null==e?void 0:e.listType)}else M.wrapSpansWithP();t()}}getTextModel(){throw new Error("Method not implemented.")}initialize(t,e,n){this._initData=t,M.setInitData(t),this._colorPalette=e,this._htmlParser.colorPalette=e,this._listStyleSheetManager=n}isBulletedList(){let t=document.getSelection().anchorNode;for(;t;){if(M.isBulletedList(t))return!0;t=t.parentNode}return!1}isNumberedList(){let t=document.getSelection().anchorNode;for(;t;){if(M.isNumberedList(t))return!0;t=t.parentNode}return!1}getTextMetrics(){return this._textMetrics}getParagraphLength(t){return M.getParagraphLengthByIndex(t)}isIndentationEnabled(){return!1}isIndentationHidden(){return!0}async enterEditMode(t){var e,n,r,i,o,a;this._isActive=!0,this._initData.point=t;const s=this._initData;this._previewScale=null!==(e=s.previewScale)&&void 0!==e?e:1,M.setPreviewScale(this._previewScale);const l=null===(n=s.textFormattingEnabled)||void 0===n||n,u=this._gmXmlParser.parse(s.text,this._colorPalette,null,this._listStyleSheetManager),c=await this._htmlSerializer.serialize(u,this._colorPalette,this._previewScale);this._elementHandler.showTextEditor(s.rectangle,s.textAlignment,c,s.borderWidth,s.borderColor,s.fillColor,s.opacity,s.textVerticalAlignment,s.isVertical),await this._setDefaultStyles(s.defaultInlineStyle,s.defaultParagraphStyle),this._currentTextInfo=new D(this._elementHandler.textEditorInnerDiv),this._limitsInputValidator=new z.b(this._currentTextInfo),this._limitsInputValidator.setLimits(this._initData.limits),this._textLimits={characterLimit:null===(r=this._initData.limits)||void 0===r?void 0:r.characterLimit,maxLineCount:null===(i=this._initData.limits)||void 0===i?void 0:i.maxLineCount,maxLineLength:null===(o=this._initData.limits)||void 0===o?void 0:o.maxLineLength,isSingleLineText:null===(a=this._initData.limits)||void 0===a?void 0:a.isSingleLineText},null===this._textMetrics&&(this._textMetrics=new H),this._innerDiv.addEventListener("mousedown",(()=>{this._updateTextMetrics()})),this._innerDiv.addEventListener("keydown",(t=>{const e=this._convertInputEventToKeyboardCommand(t),n=this._limitsInputValidator.validateInput(e);if(n.isViolated&&(t.preventDefault(),this._updateLimitsEvent(n.limitsViolated,n.pastedLimitsViolated)),"Enter"===t.key&&M.processEnterOnEmptyListItem(t,this._innerDiv),"Backspace"===t.key&&M.isCaretOnTheBeginingOfListItem()){t.preventDefault();const e={listType:this.isBulletedList()?1:2};this.executeCommand(29,e)}if(k.a.containsRtlChars(t.key)){t.preventDefault();const e=t.key;this._validateInputText(e,(()=>{M.insertTextAtCaret(e)}))}})),this._innerDiv.addEventListener("input",(t=>{this._updateTextMetrics(),/^<(p|ul|ol)/.test(this._innerDiv.innerHTML)||(document.execCommand("selectAll"),document.execCommand("formatblock",!1,"p")),"historyUndo"!==t.inputType&&"historyRedo"!==t.inputType||document.getSelection().collapseToEnd()})),this._innerDiv.addEventListener("keyup",(()=>{this._updateTextMetrics()})),this._innerDiv.addEventListener("mouseup",(()=>{this._updateTextMetrics()})),l||this._div.addEventListener("beforeinput",(t=>{["formatBold","formatItalic","formatUnderline","formatSuperscript","formatSubscript","formatJustifyFull","formatJustifyCenter","formatJustifyRight","formatJustifyLeft","formatFontColor","formatFontName"].includes(t.inputType)&&t.preventDefault()})),this._innerDiv.addEventListener("paste",(t=>{t.preventDefault();const e=t.clipboardData.getData("text/plain").replace(/\r\n/g,"\n");this._limitsInputValidator.validatePastedText(e).pastedLimitsViolated?this._updateLimitsEvent(!0,!0):this._validateInputText(e,(()=>{document.execCommand("insertText",!1,e)}))})),this._innerDiv.addEventListener("copy",(t=>{const e=document.getSelection().toString().replace(/\n\n/g,"\n");t.clipboardData.setData("text/plain",e),t.preventDefault()})),this._usedColors=[]}exitEditMode(){this._isActive=!1,this._colorPalette=null,this._elementHandler.hideTextEditor()}ensureFocus(){this._innerDiv.focus()}async getFormattedText(){this._updateColors();const t=this._elementHandler.getTextEditorFormattedText(),e=await this._htmlParser.parse(t,this._colorPalette,this._previewScale);return this._GmXmlSerializer.serialize(e,this._colorPalette)}undo(){document.execCommand("undo")}redo(){document.execCommand("redo")}processMouseEvent(t){}async processKeyEvent(t){return!0}async processZoomChangedEvent(){return!1}redraw(){}setFontRegistry(t){}dispose(){}getInlineStyle(){return this.isActive?this._inlineStyle:null}async setInlineStyle(t){if(!this.isActive)return;if(this._removeCurrentStyles(t,this._inlineStyle),P.isEmpty(t))return;const e=this._inlineStyleToCommands(t);if(0==e.length)return;this._focusOnDiv();const n=e[0];if(1==e.length&&B.documentCommands.includes(n.key))if(n.key==B.color){const t=n.value;if(null!=t){const e=await this._colorPreviewService.getPreviewAsync(t.color);document.execCommand("foreColor",!1,e.toString()),this._usedColors.push({preview:e.toString(),color:t.color})}else console.warn("Incorrect color value")}else document.execCommand(n.key,!1,n.value);else await M.customInlineCommand(e,this._range,this._innerDiv,this._colorPalette,this._colorPreviewService);null==this._range||this._range.collapsed||await this._onSelectionChange(!1),await this._updateStyles()}getParagraphStyle(){return this.isActive?this._paragraphStyle:null}async setParagraphStyle(t){if(!this.isActive)return;if(this._removeCurrentStyles(t,this._paragraphStyle),P.isEmpty(t))return;const e=M.paragraphStyleToCommands(t);if(0==e.length)return;const n=e[0];1==e.length&&B.documentCommands.includes(n.key)?(this._innerDiv.focus(),document.execCommand(n.key,!1,n.value)):await this._customParagraphCommand(e),await this._updateStyles()}_validateInputText(t,e){this._inputTextValidator.validateWithConfirmation(t).then((t=>{t.isTextValid?e():!0===t.isInputConfirmed&&(this.ensureFocus(),e(),this._invalidCharEntered.notify())}))}_convertInputEventToKeyboardCommand(t){return"ArrowLeft"===t.key||"ArrowRight"===t.key||"ArrowUp"===t.key||"ArrowDown"===t.key||"Shift"===t.key||"Alt"===t.key||"Control"===t.key||"Windows"===t.key||"CapsLock"===t.key||"NumLock"===t.key||"Clear"===t.key||"Home"===t.key||"PageUp"===t.key||"PageDown"===t.key||"End"===t.key||"NumLock"===t.key||"Insert"===t.key||"ScrollLock"===t.key||"Pause"===t.key||"F1"===t.key||"F2"===t.key||"F3"===t.key||"F4"===t.key||"F5"===t.key||"F6"===t.key||"F7"===t.key||"F8"===t.key||"F9"===t.key||"F10"===t.key||"F11"===t.key||"F12"===t.key||"Escape"===t.key||"ContextMenu"===t.key||"Meta"===t.key||"Tab"===t.key?null:"Backspace"==t.key?{type:A.InputCommandType.deleteToLeft}:"Delete"==t.key?{type:A.InputCommandType.deleteToRight}:"Enter"==t.key?{type:A.InputCommandType.insertNewLine}:t.ctrlKey?null:{type:A.InputCommandType.insertChar}}_updateTextMetrics(){if(!this._isActive)return;const t=this._textMetrics.update(this._innerDiv.textContent.length,M.getCurrentParagraphLength(),M.getCorrectLinesCount(this._innerDiv));this._currentTextInfo.updateTextMetrics(this._textMetrics),t&&this._textMetricsChangedEvent.notify(this._textMetrics)}_updateColors(){const t=this._innerDiv.querySelectorAll("span[style*=color]");for(let e=0;e<t.length;e++){const n=t.item(e);if(o.l(n.style.color))return;const r=this._rgbColorParser.parse(n.style.color),i=this._findUsedColor(r);if(null==i)return;const a=this._colorPalette.addColorToPaletteReturnIndex({color:i,preview:r});N.setColorIndex(n,a)}}_findUsedColor(t){if(null==t)return null;const e=this._usedColors.find((e=>this._colorParser.parse(e.preview).equals(t)));return null!=e?e.color:null}_focusOnDiv(){const t=document.getSelection(),e=t.rangeCount>0?t.getRangeAt(0):null;null!=e&&this._innerDiv.contains(e.commonAncestorContainer)||(this._innerDiv.focus(),t.removeAllRanges(),t.addRange(this._range))}async _onSelectionChange(t=!0){if(null==this._innerDiv)return;const e=document.getSelection(),n=e.rangeCount>0?e.getRangeAt(0):null;null!=n&&this._innerDiv.contains(n.commonAncestorContainer)&&(this._range=n,this._currentTextInfo.updateSelection(e),this._updateTextMetrics(),t&&await this._updateStyles())}async _updateStyles(){if(!this.isActive)return;const t=await this._updateInlineStyles(),e=this._updateParagraphStyles();(t||e)&&this.styleChanged.fire()}async _updateInlineStyles(){if(null==this._range||this._range.startContainer==this._innerDiv)return!1;const t=M.getDefaultInlineStyle(this._defaultInlineStyle),e=async n=>{if(n&&(M.isParagraph(n)||await e(n.parentNode),M.isSpan(n))){const e=n.attributes.style,r=Object(u.b)(null!=e?e.value:null),i=n.attributes.colordata,o=Object(u.b)(null!=i?i.value:null),a=R.getElementFontValue(n,this._innerDiv);if(null!=a){const e=R.getFontSettings(a,this._fontService,this._useSimpleFontList);null!=e.postScriptName&&(t.font.postScriptName=e.postScriptName),null!=e.fauxBold&&(t.font.fauxBold=e.fauxBold),null!=e.fauxItalic&&(t.font.fauxItalic=e.fauxItalic)}const s=R.getFontSizeValue(r,this._previewScale);null!=s&&(t.font.size=s);const l=R.getUnderlineValue(r);null!=l&&(t.underline=l);const c=R.getAllCapsValue(r);null!=c&&(t.font.allCaps=c);const h=R.getLeadingValue(r,this._previewScale);null!=h&&(t.leading=h);const p=R.getTrackingValue(r);null!=p&&(t.tracking=p);const f=R.getSubValue(r);null!=f&&(t.subscript=f);const d=R.getSupValue(r);null!=d&&(t.superscript=d);const g=R.getOpenTypeValue(r);null!=g&&(t.openType=g);const m=null!=r.color?this._rgbColorParser.parse(r.color):null,y=this._findUsedColor(m);if(null!=y)t.color={color:y,preview:m};else{const e=await this._htmlParser.getColorValue(r,o,this._colorPalette);null!=e&&(t.color=this._colorPalette.getPaletteColorAt(e))}const _=await this._htmlParser.getStrokeValue(r,o,this._colorPalette,this._previewScale);if(null!=_){let e=!1;t.stroke={},null!=_.size&&(t.stroke.size=_.size,e=t.stroke.size>0),null!=_.colorIndex&&(t.stroke.color=this._colorPalette.getPaletteColorAt(_.colorIndex),e=e||!t.stroke.color.color.isTransparent),t.stroke.enabled=e}}};return await e(this._range.startContainer),!P.isEqual(this._inlineStyle,t)&&(this._inlineStyle=t,!0)}_updateParagraphStyles(){if(null==this._range||this._range.startContainer==this._innerDiv)return!1;const t=this._getDefaultParagraphStyle(),e=n=>{if(M.isParagraph(n)||M.isListItem(n)){const e=n.attributes.style,r=Object(u.b)(null!=e?e.value:null),i=R.getAlignmentValue(r);null!=i&&(t.alignment=i);const o=R.getFirstLineIndentValue(r,this._previewScale);null!=o&&(t.firstLineIndent=o);const a=R.getSpaceAfterValue(r,this._previewScale);null!=a&&(t.spaceAfter=a);const s=R.getSpaceBeforeValue(r,this._previewScale);null!=s&&(t.spaceBefore=s);const l=R.getLeftIndentValue(r,this._previewScale);null!=l&&(t.leftIndent=l);const c=R.getRightIndentValue(r,this._previewScale);null!=c&&(t.rightIndent=c)}else n&&e(n.parentNode)};return e(this._range.startContainer),!P.isEqual(this._paragraphStyle,t)&&(this._paragraphStyle=t,!0)}_removeCurrentStyles(t,e){P.keys(t).forEach((n=>{const i=e[n],o=t[n];null!=i?"stroke"===n?(P.isEqual(o,i)||o.enabled===i.enabled&&o.size===i.size&&o.color instanceof r.Color&&o.color.equals(i.color))&&delete t[n]:"openType"===n||(o instanceof r.Color?o.equals(i)&&delete t[n]:o instanceof Object?this._removeCurrentStyles(o,i):o===i&&delete t[n]):console.warn(`_removeCurrentStyles: Incorrect current value state: key ${n} not found`)}))}_inlineStyleToCommands(t){const e=[];if(null!=t.font){const n=N.fontSettingsToHtmlValue(t.font,this._fontService,this._useSimpleFontList);if(null!=n){if(null!=this._inlineStyle){const t=N.fontSettingsToHtmlValue(this._inlineStyle.font,this._fontService,this._useSimpleFontList);this._removeCurrentStyles(n,t)}null!=n.family&&e.push({key:B.fontName,value:n.family}),null!=n.bold&&e.push({key:B.bold,value:n.bold}),null!=n.italic&&e.push({key:B.italic,value:n.italic})}null!=t.font.size&&e.push({key:B.fontSize,value:t.font.size}),null!=t.font.allCaps&&e.push({key:B.allCaps,value:t.font.allCaps})}return null!=t.underline&&e.push({key:B.underline,value:t.underline}),null!=t.leading&&e.push({key:B.leading,value:t.leading}),null!=t.tracking&&e.push({key:B.tracking,value:t.tracking}),null!=t.color&&e.push({key:B.color,value:t.color}),null!=t.stroke&&e.push({key:B.stroke,value:t.stroke}),null!=t.subscript&&e.push({key:B.subscript,value:t.subscript}),null!=t.superscript&&e.push({key:B.superscript,value:t.superscript}),null!=t.openType&&e.push({key:B.openType,value:t.openType}),e}async _customParagraphCommand(t){if(null==this._range)return;const e=document.getSelection(),n=this._div.cloneNode();for(let r=0;r<this._innerDiv.childNodes.length;r++){const i=this._innerDiv.childNodes.item(r);if(!M.isParagraph(i))return;const o=i.cloneNode(!0);e.containsNode(i,!0)&&await M.applyCommands(o,t,this._colorPalette,this._colorPreviewService),n.appendChild(o)}this._innerDiv.focus(),document.execCommand("selectAll"),document.execCommand("insertHTML",!1,n.innerHTML),await this._onSelectionChange(!1)}async _setDefaultStyles(t,e){this._inlineStyle=null,this._defaultInlineStyle=t,this._paragraphStyle=null,this._defaultParagraphStyle=e;const n=this._inlineStyleToCommands(t),r=M.paragraphStyleToCommands(e,!1);await M.applyCommands(this._innerDiv,[...n,...r],this._colorPalette,this._colorPreviewService)}_getDefaultParagraphStyle(){return P.clone(this._defaultParagraphStyle)}_updateLimitsEvent(t=!1,e=!1){const n={isLimitsBroken:t,isPastePrevented:e};this._textLimitsViolationEvent.notify(n)}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return l})),n.d(e,"e",(function(){return p})),n.d(e,"f",(function(){return m})),n.d(e,"g",(function(){return y})),n.d(e,"b",(function(){return _}));var r=n(408),i=n(433);class o{constructor(t){this._tw=t,this._converter=new i.c(this._tw.engine),this._cursorChangeEvent=new r.a}get cursorChangeEvent(){return this._cursorChangeEvent}getFirstPosition(){return new i.g(this._tw.engineHandler.getFirstPosition())}getPositionByPoint(t){return this._getPositionByPoint(t)}getCurrentPosition(){return new i.g(this._getCurrentPosition())}getCurrentParagraphIndex(){return this._getCurrentPosition().getParagraphIndex()}getCurrentWord(){return new i.h(this._getCurrentPosition().getWord())}setToPoint(t){const e=this._getPositionByPoint(t);this._setPosition(e)}setToPosition(t){const e=i.i.getPosition(t);this._setPosition(e)}moveToDirection(t){const e=this._converter.convertMoveDirectionToTextWhizz(t);return!!this._cursor.move(e,!1)&&(this._cursorChangeEvent.notify(this.getCurrentPosition()),!0)}get _cursor(){return this._tw.engineHandler.getCursor()}_getCurrentPosition(){return this._cursor.getPosition()}_getPositionByPoint(t){const e=this._tw.engineHandler.getPosition(t.x,t.y,!1);return new i.g(e)}_setPosition(t){this._cursor.set(t.getEntry()),this._cursorChangeEvent.notify(t)}}var a=n(482);class s{constructor(t){this._tw=t,this._selection=null,this._anchor=null,this._selectionChangeEvent=new r.a}get selectionChangeEvent(){return this._selectionChangeEvent}getSelectionRange(){return this._selection}setSelectionByRange(t){this._setSelectionByRange(a.a.getTextRange(t))}setSelectionByPoints(t,e){const n=this._getPositionByPoint(t),r=this._getPositionByPoint(e),i=this._createRange(n,r);this._setSelectionByRange(i)}setSelectionByPositions(t,e){const n=this._createRange(a.a.getPosition(t),a.a.getPosition(e));this._setSelectionByRange(n)}setSelectionToPosition(t){const e=this._anchor,n=a.a.getPosition(t),r=this._createRange(e,n);this._setSelectionByRange(r)}resetSelection(t){this._setSelection(null),this._setAnchor(t)}_createRange(t,e){return i.h.createEntry(this._tw.engine,t.getEntry(),e.getEntry())}_setSelectionByRange(t){const e=this._selection;(null==e||!t.isEqualTo(e))&&this._setSelection(t)}_setSelection(t){const e=this._selection;null!=t?(this._setAnchor(t.getStartPosition()),this._selection=new i.h(t.getEntry()),this._selectionChangeEvent.notify(t)):null!=e&&(this._selection=null,this._selectionChangeEvent.notify(null))}_setAnchor(t){this._anchor=t?a.a.getPosition(t):null}_getPositionByPoint(t){const e=this._tw.engineHandler.getPosition(t.x,t.y,!1);return new i.g(e)}}class l{constructor(t,e){this._tw=t,this._styleChangeEvent=new r.a,this._isInitialized=!1,this._colorPalette=null,this._colorPreviewService=e}get colorPalette(){return this._colorPalette}get isInitialized(){return this._isInitialized}initialize(t){this._colorPalette=new i.b(this._tw,t),this._isInitialized=!0}get styleChangeEvent(){return this._styleChangeEvent}getDefaultCharStyle(){if(!this.isInitialized)return null;const t=new i.a(this._tw.engine,this._colorPalette);return t.setEntry(this._getDefaultCharStyle()),t}setDefaultCharStyle(t){if(!this.isInitialized)return;const e=this._getDefaultCharStyle(),n=new i.a(this._tw.engine,this._colorPalette,t);this._tw.engineHandler.setDefaultCharStyle(n.patchToEntry(e))}clearFormatForRange(t){const e=this.getDefaultCharStyle();this.setCharStyleForRange(e,t),this._styleChangeEvent.notify()}clearFormatForCurrentPosition(){const t=this.getDefaultCharStyle();this.setCharStyleForCurrentPosition(t),this._styleChangeEvent.notify()}getCharStyleForPosition(t){const e=i.i.getPosition(t).getEntry().getCharStyle();return this._convertCharStyleFromTw(e)}setCharStyleForPosition(t,e){const n=i.i.getPosition(t).getEntry(),r=i.h.createEntry(this._tw.engine,n,n);this.setCharStyleForRange(e,r)}getCharStyleForCurrentPosition(){if(!this.isInitialized)return null;const t=this._getCharStyleForCurrentPosition();return this._convertCharStyleFromTw(t)}getCharStyleForRange(t){if(!this.isInitialized||!t.isValid)return null;const e=i.i.getTextRange(t).getEntry().getStart().getCharStyle();if(e){const t=new i.a(this._tw.engine,this._colorPalette);return t.setEntry(e),t}return null}setCharStyleForCurrentPosition(t){if(!this.isInitialized)return;const e=new i.a(this._tw.engine,this._colorPalette,t),n=this._getCharStyleForCurrentPosition();this._tw.engineHandler.getCursor().setCharStyle(e.patchToEntry(n)),this._styleChangeEvent.notify()}setCharStyleForRange(t,e){if(!this.isInitialized||!e.isValid)return;const n=new i.a(this._tw.engine,this._colorPalette,t);i.i.getTextRange(e).getEntry().updateCharStyles((t=>n.patchToEntry(t))),this._styleChangeEvent.notify()}getDefaultParagraphStyle(){if(!this.isInitialized)return null;const t=new i.f(this._tw.engine);return t.setEntry(this._getDefaultParagraphStyle()),t}setDefaultParagraphStyle(t){if(!this.isInitialized)return;const e=this._getDefaultParagraphStyle(),n=new i.f(this._tw.engine,t);this._tw.engineHandler.setDefaultParagraphStyle(n.patchToEntry(e))}getParagraphStyleForCurrentPosition(){if(!this.isInitialized)return null;const t=new i.f(this._tw.engine);return t.setEntry(this._getParagraphStyleForCurrentPosition()),t}setParagraphStyleForCurrentPosition(t){if(!this.isInitialized)return;const e=new i.f(this._tw.engine,t),n=this._getParagraphStyleForCurrentPosition();this._tw.engineHandler.getCursor().setParagraphStyle(e.patchToEntry(n)),this._styleChangeEvent.notify()}getParagraphStyleByIndex(t){if(!this.isInitialized||!this._isParagraphIndexValid(t))return null;const e=new i.f(this._tw.engine);return e.setEntry(this._tw.engineHandler.getParagraphStyle(t)),e}setParagraphStyleByIndex(t,e){if(!this.isInitialized||!this._isParagraphIndexValid(t))return null;const n=new i.f(this._tw.engine,e),r=this._tw.engineHandler.getParagraphStyle(t);this._tw.engineHandler.setParagraphStyle(t,n.patchToEntry(r)),this._styleChangeEvent.notify()}getParagraphStyleForRange(t){if(!this.isInitialized||!t.isValid)return null;const e=i.i.getTextRange(t).getEntry().getParagraphStyles();if(e.size()>0){const t=e.get(0),n=new i.f(this._tw.engine);return n.setEntry(t),n}return null}setParagraphStyleForRange(t,e){if(!e.isValid)return;const n=new i.f(this._tw.engine,t);i.i.getTextRange(e).getEntry().updateParagraphStyles((t=>n.patchToEntry(t))),this._styleChangeEvent.notify()}_convertCharStyleFromTw(t){const e=new i.a(this._tw.engine,this._colorPalette);return e.setEntry(t),e}_getDefaultCharStyle(){return this._tw.engineHandler.getDefaultCharStyle()}_getCharStyleForCurrentPosition(){return this._tw.engineHandler.getCursor().getCharStyle()}_getDefaultParagraphStyle(){return this._tw.engineHandler.getDefaultParagraphStyle()}_getParagraphStyleForCurrentPosition(){return this._tw.engineHandler.getCursor().getParagraphStyle()}_isParagraphIndexValid(t){return t<=this._tw.engineHandler.getParagraphCount()-1}}var u=n(444),c=n(591),h=n(427);class p{constructor(t,e,n){this._tw=t,this._textMeasurerHolder=e,this._converter=new i.c(this._tw.engine),this._textParser=new c.GmXmlParser(n),this._textSerializer=new c.GmXmlSerializer(n),this._textChangeEvent=new r.a}get textChangeEvent(){return this._textChangeEvent}setTextFrames(t,e){const n=this._tw.engineHandler.getFrameCount(),r=t.frames.length,o=t.frames,a=t.type;let s=0;for(;s<r;s++){const t=new i.d(this._tw,this._textMeasurerHolder,a,o[s],e);s<n?this._tw.engineHandler.replaceFrame(t.get(),s):this._tw.engineHandler.addFrame(t.get())}if(n>r){const t=s;for(;s<n;s++)this._tw.engineHandler.removeFrame(t)}}setWrappingPath(t){if(!t)return;let e=null;t.isEmptyPath?e=new this._tw.engine.Path:t.path&&(e=Object(u.d)(this._tw.engine,t.path)),e&&(t.wrappingMargin&&e.offsetContour(t.wrappingMargin),this._tw.engineHandler.setWrappingPath(e))}getTextRangeByPositions(t,e){const n=i.i.getPosition(t),r=i.i.getPosition(e);return this._createRange(n,r)}getTextModel(){return this._textParser.parse(this._getFormattedText(),null,0,null)}setTextModel(t){this.deleteAllText();const e=this._textSerializer.serialize(t,null);this.insertFormattedText(e)}getParagraphCount(){return this._tw.engineHandler.getParagraphCount()}getParagraphText(t){return new i.h(this._tw.engineHandler.getParagraphTextRange(t))}getAllText(){return new i.h(this._getAllText())}deleteAllText(){const t=new i.h(this._getAllText());return this._deleteTextByRange(t)}deleteTextByRange(t){const e=i.i.getTextRange(t);return this._deleteTextByRange(e)}deleteTextToDirection(t){const e=this._cursor.getPosition();if(!this._cursor.move(this._converter.convertMoveDirectionToTextWhizz(t),!1))return null;const n=this._cursor.getPosition(),r=this._getMovementSide(t),o=r===h.g.toTheLeft,a=o?n:e,s=o?e:n,l=i.h.createEntry(this._tw.engine,a,s),u=this._deleteTextByRange(l,r);return this._textChangeEvent.notify(),u}getFormattedText(){return this._getFormattedText()}insertPlainText(t){this._cursor.insertPlainText(t),this._textChangeEvent.notify()}insertFormattedText(t){this._cursor.insertText(t),this._textChangeEvent.notify()}insertNewLine(){this._cursor.insertLine(),this._textChangeEvent.notify()}get _cursor(){return this._tw.engineHandler.getCursor()}_createRange(t,e){return i.h.createEntry(this._tw.engine,t.getEntry(),e.getEntry())}_getFormattedText(){return this._tw.engineHandler.getTextRange().getFormattedTextForDefaults()}_getAllText(){return this._tw.engineHandler.getTextRange()}_deleteTextByRange(t,e){let n;n=null!=e&&e===h.g.toTheLeft?this._tw.engine.RangeCursorPos.right:this._tw.engine.RangeCursorPos.left;const r=t.getEntry().delete(n);return this._textChangeEvent.notify(),new i.g(r)}_getMovementSide(t){return t===h.f.left||t===h.f.leftWord||t===h.f.textStart||t===h.f.lineStart||t===h.f.up?h.g.toTheLeft:h.g.toTheRight}}var f=n(406),d=n(527),g=n(592);class m{constructor(t){this._tw=t}isTextCropped(){if(g.a.isTextEmpty(this._getFormattedText()))return!1;const t=new i.h(this._getAllText()),e=new i.h(this._tw.engineHandler.getVisibleTextRange());if(!t.isEqualTo(e))return!0;const n=this._getTextBounds(),r=Object(f.EqualsOfFloatNumbers)(0,n.width),o=Object(f.EqualsOfFloatNumbers)(0,n.height);return r||o}measureText(t,e=!1){var n;let r=this._getTextBounds();const i=this._tw.engineHandler.getFrameCount()>0&&this._tw.engineHandler.getFrame(0)instanceof this._tw.engine.ShapeTextFrame,o=Object(f.EqualsOfFloatNumbers)(0,r.width)&&Object(f.EqualsOfFloatNumbers)(0,r.height)&&g.a.isTextEmpty(this._getFormattedText());if(i){let t=this._getFrameShape(0);for(let e=1;e<this._tw.engineHandler.getFrameCount();e++)t=this._tw.engine.Path.union(t,this._getFrameShape(e));if(e){const e=new this._tw.engine.Path;e.rect(r.x,r.y,r.width,r.height),t=this._tw.engine.Path.union(t,e)}r=t.getBounds()}else o&&(r=null===(n=this._tw.clone("X").engineHandler.getVisibleTextRange().getArea())||void 0===n?void 0:n.getBounds());return new f.RectangleF(r.x*t,r.y*t,r.width*t,r.height*t)}measureTextFrame(t){const e=this._tw.initData.text,n=t?this._getFormattedText():this._getTextForFrameMeasure(e),r=this._tw.clone(n).engineHandler.getVisibleTextRange().getArea().getBounds();return new f.RectangleF(r.x,r.y,r.width,r.height)}_getFormattedText(){return this._tw.engineHandler.getTextRange().getFormattedTextForDefaults()}_getAllText(){return this._tw.engineHandler.getTextRange()}_getTextBounds(){return this._tw.engineHandler.getVisibleTextRange().getArea().getBounds()}_getFrameShape(t){const e=this._tw.engineHandler.getFrame(t);if(e instanceof this._tw.engine.ShapeTextFrame)return e.shape}_getTextForFrameMeasure(t){return""===t||null==t?"X":(this._isEmptyFirstLine(t)&&(t=this._insertIntoFirstLine(t,"X")),this._isEmptyLastLine(t)&&(t=this._insertIntoLastLine(t,"X")),t)}_isEmptyFirstLine(t){return!!(t=this._normalizeTags(t)).startsWith("<p></p>")||!!t.startsWith("<p><span><br/>")||!!t.startsWith("<p><br/>")}_insertIntoFirstLine(t,e){return t.startsWith("<p></p>")||t.startsWith("<p><br/>")?d.a.insert(t,3,"X"):t.startsWith("<p><span>")?d.a.insert(t,9,"X"):t}_isEmptyLastLine(t){return!!(t=this._normalizeTags(t)).endsWith("<p></p>")||!!t.endsWith("<p><span><br/></span></p>")||!!t.endsWith("<p><br/></p>")}_insertIntoLastLine(t,e){const n=t.lastIndexOf("<p>");return t.substring(0,n)+"<p><span>X</span></p>"}_normalizeTags(t){return t.replace("<br />","<br/>").replace("<br>","<br/>").replace("<br >","<br/>")}}class y{constructor(t){this._tw=t}get canRedo(){const t=this._tw.engineHandler.getUndoInfo();return t.count>1&&t.index<t.count-1}get canUndo(){const t=this._tw.engineHandler.getUndoInfo();return t.count>1&&t.index>0}redo(){this._executeWithTry("redo",(()=>this._tw.engineHandler.redo()))}undo(){this._executeWithTry("undo",(()=>this._tw.engineHandler.undo()))}pause(){this._executeWithTry("pause",(()=>this._tw.engineHandler.pauseUndoRedo()))}resume(){this._executeWithTry("resume",(()=>this._tw.engineHandler.resumeUndoRedo()))}clear(){this._executeWithTry("clear",(()=>this._tw.engineHandler.clearUndoRedo()))}getSelection(){const t=this._tw.engineHandler.getUndoInfo(),e=this._tw.engineHandler.getUndoRedoCursorOrSelection(t.index);return new i.h(e)}_executeWithTry(t,e){try{e()}catch(n){throw console.log(`UndoRedoHandler. Failed to call ${t}().`),i.j.createException(this._tw.engine,n)}}}class _{constructor(t){this._tw=t}isMetadataExists(t){return null!=this.getMetadata(t)}createMetadata(t){return new i.e(this._tw.engine,t)}getMetadata(t){if(!this._isParagraphIndexValid(t))return null;const e=new i.e(this._tw.engine);return e.setEntry(this._getTwMetadata(t)),0===e.getPropertiesCount()?null:e}setMetadata(t,e){if(this._isParagraphIndexValid(t))if(e instanceof i.e)this._setTwMetadata(t,e.getEntry());else{const n=new i.e(this._tw.engine,e.getProperties());this._setTwMetadata(t,n.getEntry())}}deleteMetadata(t){const e=new i.e(this._tw.engine);this.setMetadata(t,e)}_isParagraphIndexValid(t){return t<=this._tw.engineHandler.getParagraphCount()-1}_getTwMetadata(t){return this._tw.engineHandler.getParagraphMetadata(t)}_setTwMetadata(t,e){this._tw.engineHandler.setParagraphMetadata(t,e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r.a})),n.d(e,"e",(function(){return i.a})),n.d(e,"f",(function(){return o.a})),n.d(e,"g",(function(){return a.a})),n.d(e,"h",(function(){return c})),n.d(e,"i",(function(){return h})),n.d(e,"j",(function(){return f})),n.d(e,"k",(function(){return d})),n.d(e,"l",(function(){return m})),n.d(e,"c",(function(){return y.a})),n.d(e,"d",(function(){return _})),n.d(e,"b",(function(){return v.a}));var r=n(585),i=n(586),o=n(587),a=n(588),s=n(430),l=n(420),u=n(426);class c{static serialize(t){if(null==t)throw new s.b("NumericValue must not be null.")}static parse(t){if(Object(u.a)(t))return null;if((t=t.trim()).length<3)throw new s.b(`Unable to parse NumericValue from string '${t}'`);var e=t.substr(0,t.length-2),n=t.substr(t.length-2);const r=c.parseNumber(e),i=c._parseUnit(n);return new l.NumericValue(r,i)}static parseNumber(t){try{t=t.trim();var e=parseFloat(t);if(isNaN(e))throw new s.b(`Unable to parse number value from string '${t}'`);return e}catch(n){throw new s.b(`Unable to parse number value from string '${t}'`)}}static _parseUnit(t){switch(t.toLowerCase()){case"pt":return l.Units.point;case"px":return l.Units.pixel;default:throw new s.b(`Wrong unit type '${t}'`)}}}class h{static capitalizeFirstLetter(t){return t.charAt(0).toUpperCase()+t.slice(1)}static parse(t){if(Object(u.a)(t))return null;const e=[];return t.split(";").forEach((t=>{if(Object(u.a)(t))return;const n=t.split(","),r=this.capitalizeFirstLetter(n[0]),i=2===n.length?n[1]:"1",o=c.parseNumber(i),a=new l.OpenTypeFeature(r,o);e.push(a)})),e}static parseHtml(t){if(Object(u.a)(t))return null;const e=[];return t.split(",").forEach((t=>{var n;if(Object(u.a)(t))return;const r=t.split(" ");""===r[0]&&(r[0]=r[1],r[1]=null!==(n=r[2])&&void 0!==n?n:"1");const i=this.capitalizeFirstLetter(r[0]),o=2===r.length?r[1]:"1",a=c.parseNumber(o),s=new l.OpenTypeFeature(i,a);e.push(s)})),e}}var p=n(454);class f{static parse(t){if(Object(u.a)(t))return null;switch(t.toLowerCase()){case"number":return p.c.numbers;case"lowerletter":return p.c.lowerLetter;case"upperletter":return p.c.upperLetter;case"lowerroman":return p.c.lowerRoman;case"upperroman":return p.c.upperRoman;default:throw new s.b(`Unable to parse ordered list type: ${t}`)}}}class d{static serialize(t){return`${t}`}static parse(t){if(Object(u.a)(t))return null;switch(t.toLowerCase()){case"left":return l.ParagraphAlignment.left;case"center":return l.ParagraphAlignment.center;case"right":return l.ParagraphAlignment.right;case"justification":return l.ParagraphAlignment.justification;case"justification-last-left":return l.ParagraphAlignment.lastLeft;case"justification-last-center":return l.ParagraphAlignment.lastCenter;case"justification-last-right":return l.ParagraphAlignment.lastRight;default:throw new s.b(`Unable to parse alignment: ${t}`)}}}var g=n(467);class m{static parse(t){if(Object(u.a)(t))return null;switch(t.toLowerCase()){case"none":return g.c.none;case"bullet":return g.c.bullet;case"minus":return g.c.minus;default:let e=new g.d;return e.value=t,e}}}n(584),n(524),n(522);var y=n(589);class _{static serialize(t){return`${t}`}static parse(t){if(Object(u.a)(t))return null;switch(t.toLowerCase()){case"left":return l.ParagraphAlignment.left;case"center":return l.ParagraphAlignment.center;case"right":return l.ParagraphAlignment.right;case"justify":case"justify-all":case"justification":case"justification-last-left":return l.ParagraphAlignment.lastLeft;case"justification-last-center":return l.ParagraphAlignment.lastCenter;case"justification-last-right":return l.ParagraphAlignment.lastRight;default:throw new s.b(`Unable to parse alignment: ${t}`)}}static serializexml(t){return`${t}`}static parsexml(t){if(Object(u.a)(t))return null;switch(t.toLowerCase()){case"left":return l.ParagraphAlignment.left;case"center":return l.ParagraphAlignment.center;case"right":return l.ParagraphAlignment.right;case"justification":return l.ParagraphAlignment.justification;case"justification-last-left":return l.ParagraphAlignment.lastLeft;case"justification-last-center":return l.ParagraphAlignment.lastCenter;case"justification-last-right":return l.ParagraphAlignment.lastRight;default:throw new s.b(`Unable to parse alignment: ${t}`)}}}var v=n(481)},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.rotateProduct="rotateProduct",t.replaceInterpolationPlaceholders="replaceInterpolationPlaceholders",t.changeBackground="changeBackground",t.applyProductTheme="applyProductTheme",t.fillPlaceholders="fillPlaceholders",t.resize="resize"}(r||(r={}))},function(t,e,n){"use strict";var r=n(606),i=n(209),o=function(t,e){return!(null==t||!t.length)&&Object(i.a)(t,e,0)>-1},a=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1},s=n(205),l=n(198),u=n(538),c=n(207),h=n(203),p=Object(c.a)((function(t,e){return Object(h.a)(t)?function(t,e,n,i){var c=-1,h=o,p=!0,f=t.length,d=[],g=e.length;if(!f)return d;n&&(e=Object(s.a)(e,Object(l.a)(n))),i?(h=a,p=!1):e.length>=200&&(h=u.a,p=!1,e=new r.a(e));t:for(;++c<f;){var m=t[c],y=null==n?m:n(m);if(m=i||0!==m?m:0,p&&y==y){for(var _=g;_--;)if(e[_]===y)continue t;d.push(m)}else h(e,y,i)||d.push(m)}return d}(t,e):[]}));e.a=p},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=new(n(161).a)((function(t){return t.complete()})),i=n(122),o=n(123);function a(t){return t<=0?function(){return r}:Object(i.a)((function(e,n){var r=0;e.subscribe(new o.a(n,(function(e){++r<=t&&(n.next(e),t<=r&&n.complete())})))}))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r,i,o=n(407),a=n(425),s=n(463),l=n(436),u=n(411),c=n(440),h=function(){function t(){}return t.getUniqueColors=function(t){var e,n;if(null==t)return t;t=t.filter((function(t){return null!=t}));var r=[],i=function(t){-1==r.findIndex((function(e){return e.equals(t)}))&&r.push(t)};try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),a=o.next();!a.done;a=o.next())i(a.value)}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r},t.toUriComponent=function(e){if(null==e)throw new c.b("color");var n=t._mappedConverters[e.colorSpace];if(null==n)throw new c.a("Could not convert recieved color, colorSpace "+e.colorSpace+" is not supproted");return n(e)},t._rgbToUriComponent=function(t){return t.toString()},t._cmykToUriComponent=function(e){return("cmyk("+t._prepareColorComponent(e.c)+",").concat(t._prepareColorComponent(e.m)+",").concat(t._prepareColorComponent(e.y)+",").concat(t._prepareColorComponent(e.k)+",").concat(t._prepareColorComponent(e.alpha)+")")},t._grayscaleToUriComponent=function(e){if(255===e.alpha)return"rgb("+e.l+","+e.l+","+e.l+")";var n=t._prepareColorComponent(e.alpha);return"rgba("+e.l+","+e.l+","+e.l+","+n+")"},t._labToUriComponent=function(e){return"lab("+e.l+","+e.a+","+e.b+","+t._convertByteToPercent(e.alpha)},t._spotToUriComponent=function(e){var n=e.ink;return"spot('"+n.name+"',"+t.toUriComponent(n.alternativeColor)+","+n.solidity+","+t._convertByteToPercent(e.tint)+")"},t._prepareColorComponent=function(t){return l.h(t,0,255,0,1).toFixed(7)},t._convertByteToPercent=function(t){return(t/255*100).toFixed(0)+"%"},t._mappedConverters=((r={})[u.ColorSpace.Rgb]=t._rgbToUriComponent,r[u.ColorSpace.Cmyk]=t._cmykToUriComponent,r[u.ColorSpace.Grayscale]=t._grayscaleToUriComponent,r[u.ColorSpace.Lab]=t._labToUriComponent,r[u.ColorSpace.Spot]=t._spotToUriComponent,r),t}();!function(t){t[t.none=0]="none",t[t.anonymous=1]="anonymous"}(i||(i={}));var p=function(){function t(){}return t.getImageUrl=function(e,n,r,i,l,u,c,p,f,d,g,m,y,_,v,b,w){if(!Number.isInteger(i)||!Number.isInteger(l))throw new o.a('Wrong "'+(Number.isInteger(i)?l:i)+'" type!');var C="/img";!r.endsWith(".svg")||u||a.a.IsFirefox()||a.a.IsIE()||y||(C="/svg");var P=n.serviceEndpoint+C+"?f="+encodeURIComponent(r)+"&w="+encodeURIComponent(i.toString())+"&h="+encodeURIComponent(l.toString());if(P=t._addColorSettings(P,e),null!=u&&u&&(P+="&sq=true"),null!=c&&(c!==s.a.None&&(P+="&effect="+encodeURIComponent(c.toString())),c===s.a.Colorize&&null!=m&&(P+="&colorizeColor="+encodeURIComponent(h.toUriComponent(m)))),null!=p&&p&&(P+="&kp="+encodeURIComponent(p.toString())),null!=f){var S=f.color,x=f.blendMode,I=f.opacity;null!=S&&(P+="&color="+encodeURIComponent(h.toUriComponent(S))),null!=x&&(P+="&obm="+encodeURIComponent(x.toString())),null!=I&&(P+="&oo="+encodeURIComponent(I.toString()))}return null!=d&&parseInt(d.toString())>0&&(P+="&page="+encodeURIComponent(d.toString())),null!=g&&g&&(P+="&alphaMask="+encodeURIComponent(g.toString())),_&&v&&(P+="&rw="+encodeURIComponent(_.toFixed(2))+"&rh="+encodeURIComponent(v.toFixed(2))),null!=b&&(P+="&dt="+encodeURIComponent(b)),null!=w&&(P+="&da="+encodeURIComponent(w.toString())),P},t.getImageSizeByUrl=function(t,e){return n=this,r=void 0,a=function(){var n;return function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(r){switch(r.label){case 0:return[4,(o=t,new Promise((function(t,n){var r=new Image;return e==i.anonymous&&(r.crossOrigin="anonymous"),r.src=o,r.onload=function(){return t(r)},r.onerror=function(e){return t(null)},r})))];case 1:return[2,{width:(n=r.sent()).width,height:n.height}]}var o}))},new((o=void 0)||(o=Promise))((function(t,e){function i(t){try{l(a.next(t))}catch(n){e(n)}}function s(t){try{l(a.throw(t))}catch(n){e(n)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(i,s)}l((a=a.apply(n,r||[])).next())}));var n,r,o,a},t._addColorSettings=function(t,e){return e.cmykModeEnabled()&&(null!=e.getRgbColorProfileName()&&(t+="&rgb="+e.getRgbColorProfileName()),null!=e.getCmykColorProfileName()&&(t+="&cmyk="+e.getCmykColorProfileName()),null!=e.getGrayscaleColorProfileName()&&(t+="&grayscale="+e.getGrayscaleColorProfileName()),t+="&target="+e.getHiResDestinationColorProfileName()),t},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r,i=n(407),o=n(564),a=n(421),s=function(t,e){this.keyColor=t.getData(),this.valueColor=e.getData()},l=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.defaultColorReplacements=new Map,e.currentColorReplacements=new Map,e}return l(e,t),Object.defineProperty(e.prototype,"defaultColorReplacementValues",{get:function(){return Array.from(this.defaultColorReplacements.values())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultColorReplacementKeys",{get:function(){return Array.from(this.defaultColorReplacements.keys())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentColorReplacementValues",{get:function(){return Array.from(this.currentColorReplacements.values())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentColorReplacementKeys",{get:function(){return Array.from(this.currentColorReplacements.keys())},enumerable:!0,configurable:!0}),e.prototype.setReplacementColor=function(t,e){var n=this.currentColorReplacementValues[e];if(null==n)throw new i.c("Key with index: "+e+" not found in colorReplacementDictionary!");this.currentColorReplacements.set(n,t)},e.prototype.equals=function(t){var e,n=this;if(null==t)return!1;var r=t.currentColorReplacementKeys.every((function(t,e){return t.equals(n.currentColorReplacementKeys[e])})),i=t.currentColorReplacementValues.every((function(t,e){return t.equals(n.currentColorReplacementValues[e])})),o=t.defaultColorReplacementKeys.every((function(t,e){return t.equals(n.defaultColorReplacementKeys[e])})),a=t.defaultColorReplacementValues.every((function(t,e){return t.equals(n.defaultColorReplacementValues[e])})),s=null===(e=this.reducedColorImageSource)||void 0===e?void 0:e.equals(t.reducedColorImageSource);return r&&i&&o&&a&&s},e.prototype.toJSON=function(){var t;return{defaultColorReplacements:this._dictionaryToEntriesJSON(this.defaultColorReplacements),currentColorReplacements:this._dictionaryToEntriesJSON(this.currentColorReplacements),reducedColorImageSource:null===(t=this.reducedColorImageSource)||void 0===t?void 0:t.toJSON()}},e.prototype._dictionaryToEntriesJSON=function(t){var e=new a.a;return t.forEach((function(t,n){return e.add(new s(n,t))})),e},e.prototype.clone=function(){var t,n=new e,r=new Map;this.defaultColorReplacements.forEach((function(t,e){return r.set(t.clone(),e.clone())}));var i=new Map;return this.currentColorReplacements.forEach((function(t,e){return i.set(t.clone(),e.clone())})),n.currentColorReplacements=r,n.currentColorReplacements=i,n.reducedColorImageSource=null===(t=this.reducedColorImageSource)||void 0===t?void 0:t.clone(),n},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return W}));var r=n(574),i=n(510),o=n(511),a=n(456),s=n(458),l=n(494),u=n(406),c=n(512),h=n(572),p=n(573),f=n(496),d=n(410),g=n(407),m=n(449),y=n(474),_=n(500),v=n(501),b=n(743),w=n(421),C=n(575),P=n(457),S=n(745),x=n(558),I=n(509),O=n(565),T=n(552),L=n(497),R=n(561),E=n(744),j=n(490),N=n(544),k=n(515),A=n(576),F=(n(564),n(563)),B=n(562),M=n(610),z=n(495),D=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},H=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(D(arguments[e]));return t},U=A.a.fromString(b.a),W=function(){function t(t){var e=this;this.parsePalette=function(t){var n=new j.a;return e.parseCollection(t,e.parseSwatch,n),n},this.parseSwatch=function(t){var n=new N.a;return e._parseModelComponent(t,n,[new V("color",e.parseColor)]),n},this.parseSurface=function(t){var n=new i.a;return e._parseModelComponent(t,n,[new V("mockup",e.parseMockup.bind(e)),new V("printAreas",(function(t){return e.parseCollection(t,e.parsePrintArea,n.printAreas)}),!0),new V("containers",(function(t){return e.parseCollection(t,e.parseSurfaceContainer,n.containers)}),!0),new V("previewMockups",(function(t){return e.parseCollection(t,e.parseMockup.bind(e),n.previewMockups)}),!0),new V("interactiveZones",(function(t){return e.parseCollection(t,e.parseInteractiveZone.bind(e),n.interactiveZones)}),!0),new V("watermark",e.parseWatermark.bind(e))]),n},this.parseMockupContainer=function(t){var n=new s.e;return e.parseContainer(t,n),n},this.parseInteractiveZone=function(t){var n=new P.InteractiveZone,r=[new V("path",e.parsePath.bind(e))];return delete t.version,e._parseObject(t,n,r),n},this.parseSurfaceContainer=function(t){var n=new V("printingTechniqueConstraints",e._parsePrintingTechniqueConstraints),r=t.type;switch(delete t.type,delete t.renderingType,r){case s.f.type:var i=[n,new V("outputColor",e.parseColor.bind(e)),new V("previewColor",e.parseRgbColor.bind(e)),new V("renderingType",(function(){}),!0)],o=new s.f;return e.parseContainer(t,o,i),delete t.previewColor,delete t.outputColor,delete t.version,delete t.items,delete t.region,delete t.printingTechniqueConstraints,Object.assign(o,t),o;case s.h.type:return o=new s.h,i=[n,new V("outputColor",e.parseColor.bind(e)),new V("renderingType",(function(){}),!0)],e.parseContainer(t,o,i),o.previewTextureSource=e.parseImageSource(t.previewTextureSource),delete t.previewTextureSource,delete t.outputColor,delete t.version,delete t.items,delete t.region,delete t.printingTechniqueConstraints,Object.assign(o,t),o;case s.c.type:return(o=new s.c).colorSpace=t.colorSpace,o.colorProfile=t.colorProfile,e.parseContainer(t,o,[n]),o;case s.a.type:return(o=new s.a).opaque=t.opaque,o.dpi=t.dpi,o.format=t.format,o.dither=t.dither,o.amount=t.amount,e.parseContainer(t,o,[new V("outputColor",e.parseColor.bind(e)),n,new V("visualization",e._parseVisualization)]),o;case s.d.type:return(o=new s.d).maxColorNumber=t.maxColorNumber,o.paletteUId=t.paletteUId,e.parseContainer(t,o,[n]),o;default:return o=new s.g,e.parseContainer(t,o,[n]),o}},this._parseVisualization=function(t){return t.type===l.c.type?e._parseTextureContainerVisualization(t):t.type===l.a.type?e._parseColorContainerVisualization(t):void 0},this._parseTextureContainerVisualization=function(t){var n=new l.c;return n.textureName=t.textureName,n.opacity=t.opacity,n.enableGlareEffect=t.enableGlareEffect,n.textureSource=e.parseImageSource(t.textureSource),n},this._parseColorContainerVisualization=function(t){var n=new l.a;return n.color=e.parseColor(t.color),n.opacity=t.opacity,n.enableGlareEffect=t.enableGlareEffect,n},this._parsePrintingTechniqueConstraints=function(t){var e=new z.a;return e.allowRasterElements=t.allowRasterElements,e.minWidth=t.minWidth,e.minFontSize=t.minFontSize,e.targetDpi=t.targetDpi,e},this.parseContainer=function(t,n,r){return void 0===n&&(n=new s.b),void 0===r&&(r=[]),e._parseModelComponent(t,n,H([new V("region",e.parseRectangleF.bind(e)),new V("size",e.parseSizeF.bind(e)),new V("items",(function(t){return e.parseCollection(t,e.parseItem,n.items)}),!0),new V("renderingType",(function(){}),!0)],r)),n},this.parseSafetyLine=function(t){var n=new c.b,r=[new V("color",e.parseColor.bind(e)),new V("altColor",e.parseColor.bind(e)),new V("margin",e._parseMargin)];return e._parseObject(t,n,r),n},this.parseCropMark=function(t){var n=new h.a,r=[new V("color",e.parseColor.bind(e)),new V("leftNotes",e._setConvertedArray.bind(e,e.parseCropMarkText,(function(t){n.leftNotes=t})),!0),new V("rightNotes",e._setConvertedArray.bind(e,e.parseCropMarkText,(function(t){n.rightNotes=t})),!0),new V("topNotes",e._setConvertedArray.bind(e,e.parseCropMarkText,(function(t){n.topNotes=t})),!0),new V("bottomNotes",e._setConvertedArray.bind(e,e.parseCropMarkText,(function(t){n.bottomNotes=t})),!0)];return e._parseObject(t,n,r),n},this.parseCropMarkText=function(t){var n=new h.b;return e._parseObject(t,n,[]),n},this.parsePrintArea=function(t){var n=new p.a;return e._parseModelComponent(t,n,[new V("bounds",e.parseRectangleF.bind(e)),new V("safetyLines",(function(t){return e.parseCollection(t,e.parseSafetyLine,n.safetyLines)}),!0),new V("cropMarks",(function(t){return new w.a(t.map(e.parseCropMark))})),new V("slug",e._parseMargin),new V("bleed",e._parseMargin)]),n},this._parseMargin=function(t){return null==t?new I.a(0):new I.a({left:t.left,top:t.top,right:t.right,bottom:t.bottom})},this.parseItem=function(t){if(null==t)return null;var n=t.$type;delete t.$type;var r=[new V("pathBoundedTextPermissions",e.parsePathBoundedTextPermissions.bind(e)),new V("manipulationPermissions",e.parseManipulationPermissions.bind(e)),new V("frontendPermissions",e.parseFrontendPermissions.bind(e)),new V("visualizationPermissions",e.parseVisualizationPermissions.bind(e)),new V("violationSettings",e.parseViolationSettings),new V("itemPermissions",e.parseItemPermissions.bind(e)),new V("transform",e.parseTransform.bind(e)),new V("color",e.parseColor.bind(e)),new V("themeBinding",e.parseThemeBinding.bind(e)),new V("mask",e.parseMask.bind(e))],i=null,o=r.concat([new V("textPermissions",e.parseTextPermissions.bind(e)),new V("font",e.parseFontSettings.bind(e),!0),new V("stroke",e.parseStrokeSettings.bind(e)),new V("shadow",e.parseShadowSettings.bind(e))]);if(null==n)throw new g.c("Serialized data seems to be corrupted.");switch(n){case d.ob.type:i=e.parseSmartItem(t);break;case d.gb.type:i=e.parseRectangleItem(t,r);break;case d.kb.type:i=e.parseShapeItem(t,r);break;case d.T.type:i=e.parseLineItem(t,r);break;case d.y.type:i=e.parseDashedLineItem(t,r);break;case d.A.type:i=e.parseEllipseItem(t,r);break;case d.J.type:i=e.parseImageItem(t,r);break;case d.k.type:i=e.parseBarcodeItem(t,r);break;case d.eb.type:i=e.parsePlainTextItem(t,o);break;case d.q.type:i=e.parseBoundedTextItem(t,o);break;case d.ab.type:i=e.parsePathBoundedTextItem(t,o);break;case d.x.type:i=e.parseCurvedTextItem(t,o);break;case d.g.type:i=e.parseAutoScaledTextItem(t,o);break;case d.a.type:i=e.parseArchedTextItem(t,o);break;case d.cb.type:i=e.parsePlaceholderItem(t,r);break;case d.G.type:i=e.parseGroupItem(t,r);break;case x.a.type:i=e.parseClipartItem(t,r);break;case d.R.type:i=e.parseLayoutItem(t,r);break;default:throw new g.e("Deserializing of item with type - "+n+" is not implemented")}return i},this.parseNDEffects=function(t){var n=new B.a;return Object.keys(t).forEach((function(r){switch(r){case F.a.None:n[r]={};break;case F.a.Recolor:var i=new M.a,o=t[r];i.reducedColorImageSource=e.parseImageSource(o.reducedColorImageSource),i.defaultColorReplacements=e.parseColorEntries(o.defaultColorReplacements),i.currentColorReplacements=e.parseColorEntries(o.currentColorReplacements),n[r]=i;break;default:console.warn("Unknown NDEffectType!")}})),n},this.parseEncodingOptions=function(t){var n=new d.B;return e._parseModelComponent(t,n,[]),n},this.parseLineItem=function(t,n){var r=new d.T,i=H(n,e._getLineConverters());return e._parseModelComponent(t,r,i),r},this.parseRotatedRectangle=function(t){return new u.RotatedRectangleF(t.centerX,t.centerY,t.width,t.height,t.angle)},this.parseViolationSettings=function(t){switch(delete t.version,t.type){case T.a.type:return Object.assign(new T.a,t);case L.a.type:return Object.assign(new L.a,t);case R.a.type:return Object.assign(new R.a,t);case E.a.type:return Object.assign(new E.a,t);default:throw new g.e("Deserializing of item with type - "+t.type+" is not implemented")}},this.parsePlaceholderPermissions=function(t){return Object.assign(new d.db,t)},this.parseLayoutSettings=function(t){var e;return e=t.type===O.e.type?new O.e:new O.f,Object.assign(e,t)},this.parseGroupItemPermissions=function(t){return Object.assign(new S.a,t)},this.parseLinePermissions=function(t){return Object.assign(new d.V,t)},this.parseBarcodePermissions=function(t){return Object.assign(new d.l,t)},this._parseOverlayEffect=function(t){if(null!=t)return new d.Y({color:null!=t.color?e.parseColor(t.color):null,opacity:null!=t.opacity?t.opacity:null,blendMode:null!=t.blendMode?t.blendMode:null})},this._parseImageItemValue=function(t){return new d.J.ImageItemValue(t.name,new d.J.ImageMetaData(t.value),e.parseRotatedRectangle(t.transformedRectangle))},this._parseTextItemValue=function(t){return new d.o.BaseTextValue(t.name,t.text)},this._parseObject=function(t,n,r){for(var i in t)if(t.hasOwnProperty(i)){var o=r.find((function(t){return t.property===i})),s=t[i];if(null!=o)if(o.setByConverter)try{o.convert(s,n)}catch(c){throw console.error("Error while parsing property "+i+" with converter ",o,c),c}else{if("manipulationPermissions"===i&&n instanceof d.G){n.groupManipulationPermissions=o.convert(s);continue}n[i]=o.convert(s)}else{if(a.isObject(s)){var l=s.$type;if(delete s.$type,a.isString(l)){var u=a.find(e._additionalConverters,(function(t){return t.type===l}));if(null!=u){n[i]=u.parseRawValue(s);continue}console.warn("Unknown type "+l)}}n[i]=s}}},this._additionalConverters=null!=t?t:[]}return t.prototype.parseProduct=function(t){var e=this,n=new r.a,i=[new V("surfaces",(function(t){return e.parseCollection(t,e.parseSurface,n.surfaces)}),!0),new V("watermarkConfig",this.parseWatermarkConfig.bind(this)),new V("defaultSafetyLines",(function(t){return e.parseCollection(t,e.parseSafetyLine,n.defaultSafetyLines)}),!0),new V("defaultCropMarks",(function(t){return e.parseCollection(t,e.parseCropMark,n.defaultCropMarks)}),!0),new V("defaultDesignLocation",this.parsePointF.bind(this)),new V("palette",(function(t){return e.parsePalette(t)}))];return this._parseModelComponent(t,n,i),n},t.prototype.parseColor=function(t){return k.a.parse(t)},t.prototype.parseRgbColor=function(t){return k.a.parseRgbColor(t)},t.prototype.parseWatermarkConfig=function(t){var e=this;if(null==t)return null;var n=new C.a,r=new V("fontSettings",(function(t){if(null==t)return null;var n=new d.o.FontSettings(null);return e._parseObject(t,n,[]),n})),i=new V("text",(function(t){if(null==t)return null;var n=new C.c;return e._parseObject(t,n,[r]),n})),o=new V("image",(function(t){if(null==t)return null;var n=new C.b;return e._parseObject(t,n,[]),n})),a=new V("visibility",(function(t){if(null==t)return null;var n=new C.d;return e._parseObject(t,n,[]),n}));return this._parseObject(t,n,[i,o,a]),n},t.prototype.parseWatermark=function(t){if(null==t)return null;var e=new P.Watermark;return this._parseObject(t,e,[]),e},t.prototype.parseMockup=function(t){var e=this,n=new o.a;return this._parseModelComponent(t,n,[new V("underContainers",(function(t){return e.parseCollection(t,e.parseMockupContainer,n.underContainers)}),!0),new V("overContainers",(function(t){return e.parseCollection(t,e.parseMockupContainer,n.overContainers)}),!0)]),n},t.prototype.parseCollection=function(t,e,n){null!=t&&n.setRange(t.map((function(t){return e(t)})))},t.prototype.parseRectangleF=function(t){return null==t?null:new u.RectangleF(t.left,t.top,t.width,t.height)},t.prototype.parsePointF=function(t){if(null==t)return null;var e=new u.PointF;return Object.assign(e,t),e},t.prototype.parseSizeF=function(t){if(null==t)return null;if(a.isString(t)){var e=t.split(",");return new u.SizeF(parseFloat(e[0].trim()),parseFloat(e[1].trim()))}return a.extend(new u.SizeF,t)},t.prototype.parsePath=function(t){return null==t?null:"string"==typeof t?new u.Path(t):new u.Path(t.path)},t.prototype.parsePaths=function(t){var e=this;if(null==t||!a.isArray(t))return null;var n=[];return a.toArray(t).forEach((function(t){n.push(e.parsePath(t))})),n},t.prototype.parseSmartItem=function(t){var e=new d.ob;return this._parseModelComponent(t,e,[]),e},t.prototype.parsePlainTextItem=function(t,e){var n=new d.eb,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new V("baselineLocation",this.parsePointF.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype.parseArchedTextItem=function(t,e){var n=new d.a,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new V("center",this.parsePointF.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype.parseAutoScaledTextItem=function(t,e){var n=new d.g,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new V("textRectangle",this.parseRectangleF.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype.parseBoundedTextItem=function(t,e){var n=new d.q,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new V("paragraphSettings",this.parseParagraphSettings.bind(this)),new V("textRectangle",this.parseRectangleF.bind(this)),new V("wrappingPath",this.parsePath.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype.parsePathBoundedTextItem=function(t,e){var n=new d.ab,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new V("pathBoundedTextPermissions",this.parsePathBoundedTextPermissions.bind(this)),new V("boundingPaths",this.parsePaths.bind(this)),new V("paragraphSettings",this.parseParagraphSettings.bind(this)),new V("wrappingPath",this.parsePath.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype.parseCurvedTextItem=function(t,e){var n=new d.x,r=e.concat(this._getShapeConverters(),this._getBaseTextItemConverters(n),[new V("textPath",this.parsePath.bind(this))]);return this._parseModelComponent(t,n,r),n},t.prototype._getBaseTextItemConverters=function(t){var e=this;return[new V("values",this._setConvertedArray.bind(this,this._parseTextItemValue,(function(e){t.values=e})),!0),new V("placeholders",(function(n){return e.parseCollection(n,e.parseInStringPlaceholder,t.placeholders)}),!0),new V("colorPalette",(function(n){return e.parseCollection(n,e.parseColor,t.colorPalette)}),!0)]},t.prototype.parseImageItem=function(t,e){var n=new d.J,r=e.concat(this._getShapeConverters(),this._getImageConverters(n));return this._parseModelComponent(t,n,r),n},t.prototype.parseColorEntries=function(t){var e=this,n=new Map;return t?(t.forEach((function(t){var r=e.parseColor(t.keyColor),i=e.parseColor(t.valueColor);n.set(r,i)})),n):n},t.prototype.parseBarcodeItem=function(t,e){var n=new d.k,r=e.concat(this._getShapeConverters(),this._getImageConverters(n),[new V("barcodePermissions",this.parseBarcodePermissions.bind(this)),new V("color",this.parseColor.bind(this)),new V("barcodeOptions",this.parseEncodingOptions)]);return this._parseModelComponent(t,n,r),n},t.prototype.parsePlaceholderItem=function(t,e){var n=this,r=new d.cb,i=H(e,this._getShapeConverters(),[new V("placeholderPermissions",this.parsePlaceholderPermissions),new V("contentPermissions",this.parseContentPermissions.bind(this)),new V("content",this.parseItem),new V("topFrames",o),new V("bottomFrames",o),new V("stubStorageMeta",(function(t){return new d.K(t)})),new V("contentFillColor",this.parseColor.bind(this)),new V("contentOverlayEffect",this._parseOverlayEffect.bind(this))]);return this._parseModelComponent(t,r,i),r;function o(t){return t.map(n.parseItem)}},t.prototype.parseGroupItem=function(t,e){var n=new d.G,r=H(e,this._getShapeConverters(),this._getGroupConverters(n));return this._parseModelComponent(t,n,r),n},t.prototype.parseClipartItem=function(t,e){var n=new x.a,r=H(e,this._getShapeConverters(),this._getGroupConverters(n),[new V("colorGroups",this._setConvertedArray.bind(this,this.parseColorGroup.bind(this),(function(t){return n.colorGroups=t})),!0)]);return this._parseModelComponent(t,n,r),n},t.prototype.parseLayoutItem=function(t,e){var n=new d.R,r=H(e,this._getShapeConverters(),this._getGroupConverters(n),[new V("layoutSettings",this.parseLayoutSettings),new V("sourceRectangle",this.parseRotatedRectangle)]);return this._parseModelComponent(t,n,r),n},t.prototype.parseContentPermissions=function(t,e){var n=new d.v;return n.barcodePermissions=this.parseBarcodePermissions(t.barcodePermissions),n.imagePermissions=this.parseImagePermissions(t.imagePermissions),n},t.prototype.parseEllipseItem=function(t,e){var n=new d.A,r=e.concat(this._getShapeConverters());return this._parseModelComponent(t,n,r),n},t.prototype.parseRectangleItem=function(t,e){var n=new d.gb,r=e.concat(this._getShapeConverters());return this._parseModelComponent(t,n,r),n},t.prototype.parseShapeItem=function(t,e){var n=new d.kb,r=e.concat(this._getShapeConverters());return this._parseModelComponent(t,n,r),n},t.prototype.parseDashedLineItem=function(t,e){var n=new d.y,r=H(e,this._getLineConverters(),this._getDashedLineConverters());return this._parseModelComponent(t,n,r),n},t.prototype.parseThemeBinding=function(t){return null!=t?d.tb.fromRaw(t):null},t.prototype.parseMask=function(t){if(null==t)return null;var e=new f.a;return null!=t.vectorMask&&(e.vectorMask=this.parsePath(t.vectorMask)),e},t.prototype.parseTransform=function(t){return new m.a(t.scaleX,t.scaleY,t.translateX,t.translateY,t.angle)},t.prototype.parseFontSettings=function(t,e){var n=new d.o.FontSettings(null);return Object.assign(n,t),e.font=n,e.font},t.prototype.parseManipulationPermissions=function(t){var e=Object.assign(new d.W,t);return e.resizeGrips=Object.assign(new d.hb(!1,!1),t.resizeGrips),e},t.prototype.parseFrontendPermissions=function(t){return Object.assign(new d.E,t)},t.prototype.parseVisualizationPermissions=function(t){return Object.assign(new d.wb,t)},t.prototype.parseColorGroup=function(t){return new x.b(this.parseColor(t.color),t.targets)},t.prototype.parseItemPermissions=function(t){var e=Object.assign(new d.P,t);return e.itemToolbarPermissions=Object.assign(new d.Q(!1),t.itemToolbarPermissions),e},t.prototype.parseTextPermissions=function(t){return Object.assign(new d.rb,t)},t.prototype.parsePathBoundedTextPermissions=function(t){return Object.assign(new d.bb,t)},t.prototype.parseShapePermissions=function(t){return Object.assign(new d.lb,t)},t.prototype.parseImagePermissions=function(t){return Object.assign(new d.L,t)},t.prototype.parseImageSource=function(t){if(null==t)return null;var e=[d.J.ImageSourceType.PublicImage,d.J.ImageSourceType.UserImage,d.J.ImageSourceType.File],n=t.type;if(e.includes(n))throw new Error("ImageSource type "+n+" is not supported. Type "+n+" corresponds to "+this.getTypeName(n)+".");var r=null;return null!=t.origin&&(r=new d.J.ImageSource.Origin(t.origin)),void 0!==t.origin&&delete t.origin,Object.assign(new d.J.ImageSource(t.id,t.url,0,!1,!0,r),t)},t.prototype.parseParagraphSettings=function(t){return new y.a(t)},t.prototype.parseStrokeSettings=function(t){return null==t?null:new _.b({color:k.a.parse(t.color),size:"number"==typeof t.size?t.size:0,lineJoin:"string"==typeof t.lineJoin?_.a[t.lineJoin]:_.a.Miter})},t.prototype.parseShadowSettings=function(t){return null==t?null:new v.a({color:k.a.parse(t.color),angle:"number"==typeof t.angle?t.angle:0,distance:"number"==typeof t.distance?t.distance:0,size:"number"==typeof t.size?t.size:0})},t.prototype.parseInStringPlaceholder=function(t){return new d.M(t.id,t.name,t.mask,t.value,t.values)},t.prototype._setConvertedArray=function(t,e,n){a.isArray(n)&&e(a.map(n,(function(e){return t(e)})))},t.prototype._getImageConverters=function(t){return[new V("source",this.parseImageSource.bind(this)),new V("originalImageSource",this.parseImageSource.bind(this)),new V("unconvertedSource",this.parseImageSource.bind(this)),new V("imagePermissions",this.parseImagePermissions.bind(this)),new V("values",this._setConvertedArray.bind(this,this._parseImageItemValue,(function(e){t.values=e})),!0),new V("ndEffects",this.parseNDEffects),new V("overlayEffect",this._parseOverlayEffect.bind(this))]},t.prototype._getShapeConverters=function(){return[new V("fillColor",this.parseColor.bind(this)),new V("borderColor",this.parseColor.bind(this)),new V("altBorderColor",this.parseColor.bind(this)),new V("sourceRectangle",this.parseRectangleF.bind(this)),new V("sourcePath",this.parsePath.bind(this)),new V("shapePermissions",this.parseShapePermissions.bind(this))]},t.prototype._getGroupConverters=function(t){return[new V("items",this._setConvertedArray.bind(this,this.parseItem,(function(e){return t.items.addRange(e)})),!0),new V("groupItemPermissions",this.parseGroupItemPermissions)]},t.prototype._getLineConverters=function(){return[new V("color",this.parseColor.bind(this)),new V("sourcePoint0",this.parsePointF.bind(this)),new V("sourcePoint1",this.parsePointF.bind(this)),new V("linePermissions",this.parseLinePermissions)]},t.prototype._getDashedLineConverters=function(){return[new V("altColor",this.parseColor.bind(this))]},t.prototype._parseModelComponent=function(t,e,n){if(0==this._doesVersionMatch(t.version))throw new g.c("Version of serialized model component ("+t.version+") does not match the editor's version ("+b.a+").");n=n.concat([new V("tags",(function(t,e){e._tags=t}),!0),new V("version",(function(t,e){}),!0)]),this._parseObject(t,e,n)},t.prototype._doesVersionMatch=function(t){var e=A.a.fromString(t);return U.isCompatibleTo(e)},t.prototype.getTypeName=function(t){return d.J.ImageSourceType[t]||"Unknown"},t}(),V=function(t,e,n){void 0===n&&(n=!1),this.property=t,this.convert=e,this.setByConverter=n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r,i=n(442),o=n(464),a=n(452),s=n(439),l=n(516),u=n(518),c=n(519),h=n(407),p=function(){function t(t){var e=t.map((function(t){return[t.typeName,t]}));this._dict=new Map(e)}return t.prototype.create=function(t){var e=this._dict.get(t);if(null!=e)return new e;throw new h.e("Unknown vo type "+t)},t}(),f=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){return t.call(this,[i.a,o.a,a.b,s.a,l.a,c.a,u.a])||this}return f(e,t),e}(p)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(407),i=n(528),o=n(529),a=n(482);class s{constructor(t){if(!t)throw new r.c("Text range cannot be null or undefined");this._textRange=t}get isValid(){return this._textRange.isValid()}get isEmpty(){return this.getStartPosition().isEqualTo(this.getEndPosition())}isEqualTo(t){const e=this.getEntry();return Object(i.b)(e,a.a.getTextRange(t).getEntry())}getStartPosition(){return new o.a(this.getEntry().getStart())}getEndPosition(){return new o.a(this.getEntry().getEnd())}getLeftPosition(){const t=this._textRange.getStart(),e=t.getParagraphIndex(),n=this._textRange.getEnd(),r=e<=n.getParagraphIndex()?t:n;return new o.a(r)}getRightPosition(){const t=this._textRange.getStart(),e=t.getParagraphIndex(),n=this._textRange.getEnd(),r=n.getParagraphIndex()>=e?n:t;return new o.a(r)}getFormattedText(){return this.getEntry().getFormattedTextForDefaults()}getPlainText(){return this.getEntry().getChars()}getParagraphIndexes(){const t=this._textRange.getStart().getParagraphIndex(),e=this._textRange.getEnd().getParagraphIndex();return function(t,e){for(var n=[],r=t;r<=e;r++)n.push(r);return n}(t<=e?t:e,e>=t?e:t)}getEntry(){return this._textRange}static createEntry(t,e,n){const r=new t.TextRange(e,n);return new s(r)}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r="7.0.29"},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r,i=n(434),o=n(497),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(t){function e(n){var r=t.call(this,n)||this;return r.type=e.type,null==n&&(n=!0),r._allowTextCrop=n,r._allowInPlaceText=n,r}return a(e,t),e.prototype.clone=function(){var n=new e;return n.allowTextCrop=this.allowTextCrop,n.allowInPlaceText=this.allowInPlaceText,t.prototype.clone.call(this,n)},e.prototype.equals=function(e){return t.prototype.equals.call(this,e)&&this.allowTextCrop===e.allowTextCrop&&this.allowInPlaceText===e.allowInPlaceText},e.type="TextViolationSettings",s([Object(i.a)(),l("design:type",Boolean)],e.prototype,"allowTextCrop",void 0),s([Object(i.a)(),l("design:type",Boolean)],e.prototype,"allowInPlaceText",void 0),e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(408),i=n(415),o=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},a=function(){function t(){this.propertyChanged=new r.a,this.allowReplaceContentConstraint=null,this._allowReplaceContent=!0,this.allowUngroupContraint=null,this._allowUngroup=!0,this.allowSelectNestedItemsContraint=null,this._allowSelectNestedItems=!0}return Object.defineProperty(t.prototype,"allowReplaceContent",{get:function(){return null!=this.allowReplaceContentConstraint?this.allowReplaceContentConstraint:this._allowReplaceContent},set:function(t){this._allowReplaceContent!==t&&(this._allowReplaceContent=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowUngroup",{get:function(){return null!=this.allowUngroupContraint?this.allowUngroupContraint:this._allowUngroup},set:function(t){this._allowUngroup!==t&&(this._allowUngroup=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowSelectNestedItems",{get:function(){return null!=this.allowSelectNestedItemsContraint?this.allowSelectNestedItemsContraint:this._allowSelectNestedItems},set:function(t){this._allowSelectNestedItems!==t&&(this._allowSelectNestedItems=t,this.propertyChanged.notify())},enumerable:!0,configurable:!0}),t.prototype.getSimplifiedObject=function(){var t=this;return{allowReplaceContent:t._allowReplaceContent,allowSelectNestedItems:t._allowSelectNestedItems,allowUngroup:t._allowUngroup}},t.prototype.clone=function(){var e=new t;return e.allowReplaceContent=this._allowReplaceContent,e.allowReplaceContentConstraint=this.allowReplaceContentConstraint,e.allowSelectNestedItems=this._allowSelectNestedItems,e.allowSelectNestedItemsContraint=this.allowSelectNestedItemsContraint,e.allowUngroup=this._allowUngroup,e.allowUngroupContraint=this.allowUngroupContraint,e},t.prototype.equals=function(t){return this.allowReplaceContent===t.allowReplaceContent&&this.allowReplaceContentConstraint===t.allowReplaceContentConstraint&&this.allowSelectNestedItems===t.allowSelectNestedItems&&this.allowSelectNestedItemsContraint===t.allowSelectNestedItemsContraint&&this.allowUngroup===t.allowUngroup&&this.allowUngroupContraint===t.allowUngroupContraint},function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);o>3&&a&&Object.defineProperty(e,n,a)}([Object(i.a)({ignore:!0}),o("design:type",Boolean)],t.prototype,"allowReplaceContentConstraint",void 0),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(438),i=function(){function t(t,e){var n,i,o,a,s,l,u,c,h,p,f,d,g,m;null==t&&(t={}),null==e&&(e=!0),this.noPrint=null!==(n=t.NoPrint)&&void 0!==n?n:e,this.noShow=null!==(i=t.NoShow)&&void 0!==i?i:e,this.allowDelete=null!==(o=t.AllowDelete)&&void 0!==o?o:e,this.allowMoveHorizontal=null!==(a=t.AllowMoveHorizontal)&&void 0!==a?a:e,this.allowMoveVertical=null!==(s=t.AllowMoveVertical)&&void 0!==s?s:e,this.allowRotate=null!==(l=t.AllowRotate)&&void 0!==l?l:e,this.resizeGrips=null==t.ResizeGrips?new r.a(e,e):r.a._fromData(t.ResizeGrips),this.allowEditContent=null!==(u=t.AllowEditContent)&&void 0!==u?u:e,this.showSelectButton=null!==(c=t.ShowSelectButton)&&void 0!==c?c:e,this.showHandleButton=null!==(h=t.ShowHandleButton)&&void 0!==h?h:e,this.showDoneButton=null!==(p=t.ShowDoneButton)&&void 0!==p?p:e,this.showDeleteToolbarButton=null!==(f=t.ShowDeleteToolbarButton)&&void 0!==f?f:e,this.showEditToolbarButton=null!==(d=t.ShowEditToolbarButton)&&void 0!==d?d:e,this.showSelectToolbarButton=null!==(g=t.ShowSelectToolbarButton)&&void 0!==g?g:e,this.showHandleToolbarButton=null!==(m=t.ShowHandleToolbarButton)&&void 0!==m?m:e,this.allowDragAndDrop=null==t.AllowDragAndDrop?e:!!t.AllowDragAndDrop}return t.prototype.clone=function(){var e=new t;for(var n in this)this.hasOwnProperty(n)&&("resizeGrips"!==n?e[n]=this[n]:e.resizeGrips=null!=this.resizeGrips?this.resizeGrips.clone():null);return e},Object.defineProperty(t.prototype,"allowProportionalResize",{get:function(){return this.resizeGrips.getCornerProportional()},set:function(t){this.resizeGrips.setCornerProportional(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowArbitraryResize",{get:function(){return!!this.resizeGrips&&(this.resizeGrips.getCornerArbitrary()||this.resizeGrips.edge)},set:function(t){this.resizeGrips.setCornerArbitrary(t),this.resizeGrips.edge=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowResize",{get:function(){return this.allowProportionalResize||this.allowArbitraryResize},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowFreeMove",{get:function(){return this.allowMoveHorizontal&&this.allowMoveVertical},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowMove",{get:function(){return this.allowMoveHorizontal||this.allowMoveVertical},enumerable:!0,configurable:!0}),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(406),i=n(432),o=n(417),a=n(425),s=function(){function t(t,e,n,r,i,o,a,s,l){this._staticCanvas=t,this._activeCanvas=e,this._textWhizz=n,this._zoom=r,this._offset=i,this._viewportHandler=o,this._selectionStyle=a,this._rgbColorParser=s,this._canvasFactory=l,this._workspaceWidth=null,this._workspaceHeight=null}return t.prototype.setWorkspaceSize=function(t,e){this._workspaceWidth=t,this._workspaceHeight=e},t.prototype.setZoom=function(t){this._zoom=t},Object.defineProperty(t.prototype,"offset",{get:function(){return this._offset},set:function(t){this._offset=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scale",{get:function(){return a.a.screenDpi*this._zoom/72},enumerable:!0,configurable:!0}),t.prototype._getScaledBounds=function(t){var e=this._scale,n=Math.floor(t.left*e),i=Math.floor(t.top*e),o=Math.ceil(t.width*e),a=Math.ceil(t.height*e);return new r.RectangleF(n,i,o,a)},t.prototype._getScaledBoundsWithoutRound=function(t){var e=this._scale,n=t.left*e,i=t.top*e,o=t.width*e,a=t.height*e;return new r.RectangleF(n,i,o,a)},t.prototype._colorToTextWhizz=function(t){return new this._textWhizz.Color(this._textWhizz.ColorType.rgb,[t.b,t.g,t.r,t.alpha])},t.renderTextImage=function(t,e,n,r,i,o){e.isLoaded?this._drawImage(t,e,n,r,i,o):!e.isLoading&&t.ready||this._drawWaitClock(t,r)},t.prototype._createCanvas=function(t){return this._canvasFactory.createCanvas(t)},t.prototype._copyCanvas=function(t,e){var n=this._canvasFactory.createCanvas(e);return n.getContext("2d").drawImage(t,0,0),n},t._drawWaitClock=function(t,e){var n=t.rectangle;t.canvas.drawWaitClock(e,new r.PointF(n.centerX,n.centerY))},t._isUpdatingAfterResize=function(t){return t instanceof i.a&&("BoundedTextItemHandler"===t.getTypeName()||"PathBoundedTextItemHandler"===t.getTypeName())&&t.isUpdatingAfterResize},t._drawImage=function(t,e,n,r,i,s){var l,u=t.canvas,c=t.item,h=u.disableSmoothing,p=a.a.screenDpi*u.zoom/72;if(!this._isUpdatingAfterResize(t)){var f=null!==(l=e.canvas)&&void 0!==l?l:e.image;o.a.drawImage(r,f,t.drawingRectangle,p,p,h,null,c.opacity*i,n,s)}},t.staticCanvasMargin=10,t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r=n(520);class i extends r.a{constructor(){super(...arguments),this.__type="InlineText"}}class o extends r.a{constructor(){super(...arguments),this.__type="<br>"}}},function(t,e,n){"use strict";var r,i,o;n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"e",(function(){return s})),function(t){t[t.none=0]="none",t[t.bullets=1]="bullets",t[t.numbers=2]="numbers"}(r||(r={})),function(t){t[t.none=0]="none",t[t.number=1]="number",t[t.lowerLetter=2]="lowerLetter",t[t.upperLetter=3]="upperLetter",t[t.lowerRoman=4]="lowerRoman",t[t.upperRoman=5]="upperRoman"}(i||(i={})),function(t){t[t.continueFromPrevious=0]="continueFromPrevious",t[t.startAt=1]="startAt"}(o||(o={}));class a{}class s extends Map{}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a}));var r,i=n(480);!function(t){t.left="left",t.center="center",t.right="right",t.justification="justification",t.lastLeft="justification-last-left",t.lastCenter="justification-last-center",t.lastRight="justification-last-right"}(r||(r={}));class o{}class a extends i.a{constructor(){super(...arguments),this.inlineElements=[]}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));class r{constructor(){this.blocks=[]}}},function(t,e){},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r=n(583);class i extends r.a{}class o{constructor(){this.content=[]}}},function(t,e,n){var r=n(755);e.DOMImplementation=r.DOMImplementation,e.XMLSerializer=r.XMLSerializer,e.DOMParser=n(862).DOMParser},function(t,e,n){var r=n(525).NAMESPACE;function i(t){return""!==t}function o(t,e){return t.hasOwnProperty(e)||(t[e]=!0),t}function a(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(i):[]}(t);return Object.keys(e.reduce(o,{}))}function s(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}function l(t,e){var n=t.prototype;if(!(n instanceof e)){function r(){}r.prototype=e.prototype,s(n,r=new r),t.prototype=n=r}n.constructor!=t&&("function"!=typeof t&&console.error("unknown Class:"+t),n.constructor=t)}var u={},c=u.ELEMENT_NODE=1,h=u.ATTRIBUTE_NODE=2,p=u.TEXT_NODE=3,f=u.CDATA_SECTION_NODE=4,d=u.ENTITY_REFERENCE_NODE=5,g=u.ENTITY_NODE=6,m=u.PROCESSING_INSTRUCTION_NODE=7,y=u.COMMENT_NODE=8,_=u.DOCUMENT_NODE=9,v=u.DOCUMENT_TYPE_NODE=10,b=u.DOCUMENT_FRAGMENT_NODE=11,w=u.NOTATION_NODE=12,C={},P={},S=(C.INDEX_SIZE_ERR=(P[1]="Index size error",1),C.DOMSTRING_SIZE_ERR=(P[2]="DOMString size error",2),C.HIERARCHY_REQUEST_ERR=(P[3]="Hierarchy request error",3)),x=(C.WRONG_DOCUMENT_ERR=(P[4]="Wrong document",4),C.INVALID_CHARACTER_ERR=(P[5]="Invalid character",5),C.NO_DATA_ALLOWED_ERR=(P[6]="No data allowed",6),C.NO_MODIFICATION_ALLOWED_ERR=(P[7]="No modification allowed",7),C.NOT_FOUND_ERR=(P[8]="Not found",8)),I=(C.NOT_SUPPORTED_ERR=(P[9]="Not supported",9),C.INUSE_ATTRIBUTE_ERR=(P[10]="Attribute in use",10));function O(t,e){if(e instanceof Error)var n=e;else n=this,Error.call(this,P[t]),this.message=P[t],Error.captureStackTrace&&Error.captureStackTrace(this,O);return n.code=t,e&&(this.message=this.message+": "+e),n}function T(){}function L(t,e){this._node=t,this._refresh=e,R(this)}function R(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var n=t._refresh(t._node);ft(t,"length",n.length),s(n,t),t._inc=e}}function E(){}function j(t,e){for(var n=t.length;n--;)if(t[n]===e)return n}function N(t,e,n,i){if(i?e[j(e,i)]=n:e[e.length++]=n,t){n.ownerElement=t;var o=t.ownerDocument;o&&(i&&D(o,t,i),function(t,e,n){t&&t._inc++,n.namespaceURI===r.XMLNS&&(e._nsMap[n.prefix?n.localName:""]=n.value)}(o,t,n))}}function k(t,e,n){var r=j(e,n);if(!(r>=0))throw new O(x,new Error(t.tagName+"@"+n));for(var i=e.length-1;r<i;)e[r]=e[++r];if(e.length=i,t){var o=t.ownerDocument;o&&(D(o,t,n),n.ownerElement=null)}}function A(){}function F(){}function B(t){return("<"==t?"<":">"==t&&">")||"&"==t&&"&"||'"'==t&&"""||"&#"+t.charCodeAt()+";"}function M(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(M(t,e))return!0}while(t=t.nextSibling)}function z(){}function D(t,e,n,i){t&&t._inc++,n.namespaceURI===r.XMLNS&&delete e._nsMap[n.prefix?n.localName:""]}function H(t,e,n){if(t&&t._inc){t._inc++;var r=e.childNodes;if(n)r[r.length++]=n;else{for(var i=e.firstChild,o=0;i;)r[o++]=i,i=i.nextSibling;r.length=o}}}function U(t,e){var n=e.previousSibling,r=e.nextSibling;return n?n.nextSibling=r:t.firstChild=r,r?r.previousSibling=n:t.lastChild=n,H(t.ownerDocument,t),e}function W(t){return t&&t.nodeType===F.DOCUMENT_TYPE_NODE}function V(t){return t&&t.nodeType===F.ELEMENT_NODE}function q(t){return t&&t.nodeType===F.TEXT_NODE}function G(t,e){var n=t.childNodes||[];if(n.find(V)||W(e))return!1;var r=n.find(W);return!(e&&r&&n.indexOf(r)>n.indexOf(e))}function $(t,e,n){if(!function(t){return t&&(t.nodeType===F.DOCUMENT_NODE||t.nodeType===F.DOCUMENT_FRAGMENT_NODE||t.nodeType===F.ELEMENT_NODE)}(t))throw new O(S,"Unexpected parent node type "+t.nodeType);if(n&&n.parentNode!==t)throw new O(x,"child not in parent");if(!function(t){return t&&(V(t)||q(t)||W(t)||t.nodeType===F.DOCUMENT_FRAGMENT_NODE||t.nodeType===F.COMMENT_NODE||t.nodeType===F.PROCESSING_INSTRUCTION_NODE)}(e)||W(e)&&t.nodeType!==F.DOCUMENT_NODE)throw new O(S,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType);var r=t.childNodes||[],i=e.childNodes||[];if(t.nodeType===F.DOCUMENT_NODE){if(e.nodeType===F.DOCUMENT_FRAGMENT_NODE){let e=i.filter(V);if(e.length>1||i.find(q))throw new O(S,"More than one element or text in fragment");if(1===e.length&&!G(t,n))throw new O(S,"Element in fragment can not be inserted before doctype")}if(V(e)&&(r.find(V)||!G(t,n)))throw new O(S,"Only one element can be added and only after doctype");if(W(e)){if(r.find(W))throw new O(S,"Only one doctype is allowed");let t=r.find(V);if(n&&r.indexOf(t)<r.indexOf(n))throw new O(S,"Doctype can only be inserted before an element");if(!n&&t)throw new O(S,"Doctype can not be appended since element is present")}}var o=e.parentNode;if(o&&o.removeChild(e),e.nodeType===b){var a=e.firstChild;if(null==a)return e;var s=e.lastChild}else a=s=e;var l=n?n.previousSibling:t.lastChild;a.previousSibling=l,s.nextSibling=n,l?l.nextSibling=a:t.firstChild=a,null==n?t.lastChild=s:n.previousSibling=s;do{a.parentNode=t}while(a!==s&&(a=a.nextSibling));return H(t.ownerDocument||t,t),e.nodeType==b&&(e.firstChild=e.lastChild=null),e}function X(){this._nsMap={}}function K(){}function Y(){}function J(){}function Z(){}function Q(){}function tt(){}function et(){}function nt(){}function rt(){}function it(){}function ot(){}function at(){}function st(t,e){var n=[],r=9==this.nodeType&&this.documentElement||this,i=r.prefix,o=r.namespaceURI;if(o&&null==i&&null==(i=r.lookupPrefix(o)))var a=[{namespace:o,prefix:null}];return ct(this,n,t,e,a),n.join("")}function lt(t,e,n){var i=t.prefix||"",o=t.namespaceURI;if(!o)return!1;if("xml"===i&&o===r.XML||o===r.XMLNS)return!1;for(var a=n.length;a--;){var s=n[a];if(s.prefix===i)return s.namespace!==o}return!0}function ut(t,e,n){t.push(" ",e,'="',n.replace(/[<&"]/g,B),'"')}function ct(t,e,n,i,o){if(o||(o=[]),i){if(!(t=i(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case c:var a=t.attributes,s=a.length,l=t.firstChild,u=t.tagName,g=u;if(!(n=r.isHTML(t.namespaceURI)||n)&&!t.prefix&&t.namespaceURI){for(var w,C=0;C<a.length;C++)if("xmlns"===a.item(C).name){w=a.item(C).value;break}if(!w)for(var P=o.length-1;P>=0;P--)if(""===(S=o[P]).prefix&&S.namespace===t.namespaceURI){w=S.namespace;break}if(w!==t.namespaceURI)for(P=o.length-1;P>=0;P--){var S;if((S=o[P]).namespace===t.namespaceURI){S.prefix&&(g=S.prefix+":"+u);break}}}e.push("<",g);for(var x=0;x<s;x++)"xmlns"==(I=a.item(x)).prefix?o.push({prefix:I.localName,namespace:I.value}):"xmlns"==I.nodeName&&o.push({prefix:"",namespace:I.value});for(x=0;x<s;x++){var I,O,T;lt(I=a.item(x),0,o)&&(ut(e,(O=I.prefix||"")?"xmlns:"+O:"xmlns",T=I.namespaceURI),o.push({prefix:O,namespace:T})),ct(I,e,n,i,o)}if(u===g&<(t,0,o)&&(ut(e,(O=t.prefix||"")?"xmlns:"+O:"xmlns",T=t.namespaceURI),o.push({prefix:O,namespace:T})),l||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(e.push(">"),n&&/^script$/i.test(u))for(;l;)l.data?e.push(l.data):ct(l,e,n,i,o.slice()),l=l.nextSibling;else for(;l;)ct(l,e,n,i,o.slice()),l=l.nextSibling;e.push("</",g,">")}else e.push("/>");return;case _:case b:for(l=t.firstChild;l;)ct(l,e,n,i,o.slice()),l=l.nextSibling;return;case h:return ut(e,t.name,t.value);case p:return e.push(t.data.replace(/[<&]/g,B).replace(/]]>/g,"]]>"));case f:return e.push("<![CDATA[",t.data,"]]>");case y:return e.push("\x3c!--",t.data,"--\x3e");case v:var L=t.publicId,R=t.systemId;if(e.push("<!DOCTYPE ",t.name),L)e.push(" PUBLIC ",L),R&&"."!=R&&e.push(" ",R),e.push(">");else if(R&&"."!=R)e.push(" SYSTEM ",R,">");else{var E=t.internalSubset;E&&e.push(" [",E,"]"),e.push(">")}return;case m:return e.push("<?",t.target," ",t.data,"?>");case d:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function ht(t,e,n){var r;switch(e.nodeType){case c:(r=e.cloneNode(!1)).ownerDocument=t;case b:break;case h:n=!0}if(r||(r=e.cloneNode(!1)),r.ownerDocument=t,r.parentNode=null,n)for(var i=e.firstChild;i;)r.appendChild(ht(t,i,n)),i=i.nextSibling;return r}function pt(t,e,n){var r=new e.constructor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=e[i];"object"!=typeof o&&o!=r[i]&&(r[i]=o)}switch(e.childNodes&&(r.childNodes=new T),r.ownerDocument=t,r.nodeType){case c:var a=e.attributes,s=r.attributes=new E,l=a.length;s._ownerElement=r;for(var u=0;u<l;u++)r.setAttributeNode(pt(t,a.item(u),!0));break;case h:n=!0}if(n)for(var p=e.firstChild;p;)r.appendChild(pt(t,p,n)),p=p.nextSibling;return r}function ft(t,e,n){t[e]=n}C.INVALID_STATE_ERR=(P[11]="Invalid state",11),C.SYNTAX_ERR=(P[12]="Syntax error",12),C.INVALID_MODIFICATION_ERR=(P[13]="Invalid modification",13),C.NAMESPACE_ERR=(P[14]="Invalid namespace",14),C.INVALID_ACCESS_ERR=(P[15]="Invalid access",15),O.prototype=Error.prototype,s(C,O),T.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var n=[],r=0;r<this.length;r++)ct(this[r],n,t,e);return n.join("")},find:function(t){return Array.prototype.find.call(this,t)},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},L.prototype.item=function(t){return R(this),this[t]},l(L,T),E.prototype={length:0,item:T.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var n=this[e];if(n.nodeName==t)return n}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new O(I);var n=this.getNamedItem(t.nodeName);return N(this._ownerElement,this,t,n),n},setNamedItemNS:function(t){var e,n=t.ownerElement;if(n&&n!=this._ownerElement)throw new O(I);return e=this.getNamedItemNS(t.namespaceURI,t.localName),N(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return k(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var n=this.getNamedItemNS(t,e);return k(this._ownerElement,this,n),n},getNamedItemNS:function(t,e){for(var n=this.length;n--;){var r=this[n];if(r.localName==e&&r.namespaceURI==t)return r}return null}},A.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,n){var r=new z;if(r.implementation=this,r.childNodes=new T,r.doctype=n||null,n&&r.appendChild(n),e){var i=r.createElementNS(t,e);r.appendChild(i)}return r},createDocumentType:function(t,e,n){var r=new tt;return r.name=t,r.nodeName=t,r.publicId=e||"",r.systemId=n||"",r}},F.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(t,e){return $(this,t,e)},replaceChild:function(t,e){this.insertBefore(t,e),e&&this.removeChild(e)},removeChild:function(t){return U(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return pt(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==p&&t.nodeType==p?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var n=e._nsMap;if(n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&n[r]===t)return r;e=e.nodeType==h?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var n=e._nsMap;if(n&&t in n&&Object.prototype.hasOwnProperty.call(n,t))return n[t];e=e.nodeType==h?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},s(u,F),s(u,F.prototype),z.prototype={nodeName:"#document",nodeType:_,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==b){for(var n=t.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,e),n=r}return t}return $(this,t,e),t.ownerDocument=this,null===this.documentElement&&t.nodeType===c&&(this.documentElement=t),t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),U(this,t)},importNode:function(t,e){return ht(this,t,e)},getElementById:function(t){var e=null;return M(this.documentElement,(function(n){if(n.nodeType==c&&n.getAttribute("id")==t)return e=n,!0})),e},getElementsByClassName:function(t){var e=a(t);return new L(this,(function(n){var r=[];return e.length>0&&M(n.documentElement,(function(i){if(i!==n&&i.nodeType===c){var o=i.getAttribute("class");if(o){var s=t===o;if(!s){var l=a(o);s=e.every((u=l,function(t){return u&&-1!==u.indexOf(t)}))}s&&r.push(i)}}var u})),r}))},createElement:function(t){var e=new X;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new T,(e.attributes=new E)._ownerElement=e,e},createDocumentFragment:function(){var t=new it;return t.ownerDocument=this,t.childNodes=new T,t},createTextNode:function(t){var e=new J;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new Z;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new Q;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var n=new ot;return n.ownerDocument=this,n.tagName=n.target=t,n.nodeValue=n.data=e,n},createAttribute:function(t){var e=new K;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new rt;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var n=new X,r=e.split(":"),i=n.attributes=new E;return n.childNodes=new T,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=e,i._ownerElement=n,n},createAttributeNS:function(t,e){var n=new K,r=e.split(":");return n.ownerDocument=this,n.nodeName=e,n.name=e,n.namespaceURI=t,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=e,n}},l(z,F),X.prototype={nodeType:c,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var n=this.ownerDocument.createAttribute(t);n.value=n.nodeValue=""+e,this.setAttributeNode(n)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===b?this.insertBefore(t,null):function(t,e){var n=e.parentNode;if(n){var r=t.lastChild;n.removeChild(e),r=t.lastChild}return r=t.lastChild,e.parentNode=t,e.previousSibling=r,e.nextSibling=null,r?r.nextSibling=e:t.firstChild=e,t.lastChild=e,H(t.ownerDocument,t,e),e}(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);n&&this.removeAttributeNode(n)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);return n&&n.value||""},setAttributeNS:function(t,e,n){var r=this.ownerDocument.createAttributeNS(t,e);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new L(this,(function(e){var n=[];return M(e,(function(r){r===e||r.nodeType!=c||"*"!==t&&r.tagName!=t||n.push(r)})),n}))},getElementsByTagNameNS:function(t,e){return new L(this,(function(n){var r=[];return M(n,(function(i){i===n||i.nodeType!==c||"*"!==t&&i.namespaceURI!==t||"*"!==e&&i.localName!=e||r.push(i)})),r}))}},z.prototype.getElementsByTagName=X.prototype.getElementsByTagName,z.prototype.getElementsByTagNameNS=X.prototype.getElementsByTagNameNS,l(X,F),K.prototype.nodeType=h,l(K,F),Y.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(P[S])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,n){n=this.data.substring(0,t)+n+this.data.substring(t+e),this.nodeValue=this.data=n,this.length=n.length}},l(Y,F),J.prototype={nodeName:"#text",nodeType:p,splitText:function(t){var e=this.data,n=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},l(J,Y),Z.prototype={nodeName:"#comment",nodeType:y},l(Z,Y),Q.prototype={nodeName:"#cdata-section",nodeType:f},l(Q,Y),tt.prototype.nodeType=v,l(tt,F),et.prototype.nodeType=w,l(et,F),nt.prototype.nodeType=g,l(nt,F),rt.prototype.nodeType=d,l(rt,F),it.prototype.nodeName="#document-fragment",it.prototype.nodeType=b,l(it,F),ot.prototype.nodeType=m,l(ot,F),at.prototype.serializeToString=function(t,e,n){return st.call(t,e,n)},F.prototype.toString=st;try{if(Object.defineProperty){function dt(t){switch(t.nodeType){case c:case b:var e=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&e.push(dt(t)),t=t.nextSibling;return e.join("");default:return t.nodeValue}}Object.defineProperty(L.prototype,"length",{get:function(){return R(this),this.$$length}}),Object.defineProperty(F.prototype,"textContent",{get:function(){return dt(this)},set:function(t){switch(this.nodeType){case c:case b:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),ft=function(t,e,n){t["$$"+e]=n}}}catch(gt){}e.DocumentType=tt,e.DOMException=O,e.DOMImplementation=A,e.Element=X,e.Node=F,e.NodeList=T,e.XMLSerializer=at},function(t,e,n){"use strict";n(757),n(758),n(759),n(760),n(761)},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){"use strict";n(763),n(764),n(765),n(766),n(767),n(768),n(769),n(770),n(771),n(772),n(773),n(774),n(775),n(776),n(777),n(778),n(779),n(780),n(781),n(782),n(783),n(784),n(785),n(786),n(787),n(788),n(789),n(790),n(791),n(792),n(793),n(794),n(795),n(796),n(797),n(798),n(799),n(800),n(801),n(802),n(803),n(804),n(805),n(806),n(807),n(808),n(809),n(810),n(811)},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){"use strict";n(408),n(410),n(406),n(427),n(594),n(593),n(595),n(533),n(447)},function(t,e,n){"use strict";function r(t,e){return function(){return t.apply(e,arguments)}}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";e.a=null},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return r.a})),n.d(e,"b",(function(){return i.a}));var r=n(515),i=n(514);n(611),function(){function t(){}t.getProductSerializer=function(){return null!=t.jsonProductSerializerFactory?t.jsonProductSerializerFactory():t._defaultJsonProductSerializerFactory()},t._defaultJsonProductSerializerFactory=function(){return new i.a},t.jsonProductSerializerFactory=null}(),n(576)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){var r=n(543);r.prototype[Symbol.iterator]||(r.prototype[Symbol.iterator]=function(){var t=this.getEnumerator();return{next:function(){return t.moveNext()?{done:!1,value:t.current()}:{done:!0}}}});var i=!0;r.extendArray=function(){i&&(i=!1,Object.keys(r.prototype).forEach((function(t){Array.prototype[t]||(Array.prototype[t]=function(){var e=r.from(this);return e[t].apply(e,arguments)})})))},t.exports=r},function(t,e){var n="BEGIN:VCARD",r="END:VCARD",i=/[^\\];|^;/,o=/[^\\],|^,/;function a(t){return t.match(i)?s(t=t.replace(/\\,/g,","),";"):t.match(o)?s(t=t.replace(/\\;/g,";"),","):t.replace(/\\,/g,",").replace(/\\;/g,";")}function s(t,e){var n=new RegExp(e),r=new RegExp("\\\\"+e,"g");return(t=t.replace(r,"ΩΩΩ")).match(n)?(t=t.split(e)).map((function(t){return t.replace(/ΩΩΩ/g,e)})):t.replace(/ΩΩΩ/g,e)}var l=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return function(){return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}}(),u=["nickname","related","categories","pid"],c=["fn"];t.exports={parse:function(t){for(var e,i,o,s,l,u={},c=t.split(/\r\n|\r|\n/),h=c.length,p=0;p<h;p++)if(""!==c[p]&&c[p].toUpperCase()!==n&&c[p].toUpperCase()!==r){var f=c[p],d=function(t){return t+1<h&&(" "===c[t+1][0]||"\t"===c[t+1][0])};if(d(p))for(;d(p);)f+=c[p+1].trim(),p++;if(i=(e=f.split(":")).shift(),o=e.join(":"),l=!1,s={},i.match(/;/)){var g=(i=i.replace(/\\;/g,"ΩΩΩ").replace(/\\,/,",")).split(";").map((function(t){return t.replace(/ΩΩΩ/g,";")}));i=g.shift(),g.forEach((function(t){var e=t.split("=");e[0]=e[0].toLowerCase(),0!==e[0].length&&(s[e[0]]?s[e[0]].push(e[1]):s[e[0]]=[e[1]])}))}if(o=a(o=o.replace(/\\n/g,"\n")),i.match(/\./)){var m=i.split(".");i=m[1],l=m[0]}var y={value:o};Object.keys(s).length&&(y.meta=s),l&&(y.namespace=l),0!==i.indexOf("X-")&&(i=i.toLowerCase()),void 0===u[i]?u[i]=[y]:u[i].push(y)}return u},generate:function(t,e){var i=[n],o="";e&&!t.version&&(t.version=[{value:"3.0"}]),e&&!t.uid&&(t.uid=[{value:l()}]);var a=function(t){return void 0===t?"":t.replace(/\n/g,"\\n").replace(/;/g,"\\;").replace(/,/g,"\\,")};return Object.keys(t).forEach((function(e){t[e]&&"function"==typeof t[e].forEach&&t[e].forEach((function(t){if(void 0!==t.value&&(""!==t.value||-1!==c.indexOf(e))){if(t.value instanceof Array){for(var n=!0,r=0;r<t.value.length;r++)if(void 0!==t.value[r]&&""!==t.value[r]){n=!1;break}if(n)return}if(o="",t.namespace&&(o+=t.namespace+"."),o+=0===e.indexOf("X-")?e:e.toUpperCase(),"object"==typeof t.meta&&Object.keys(t.meta).forEach((function(e){"function"==typeof t.meta[e].forEach&&t.meta[e].forEach((function(t){var n;e.length>0&&("TYPE"===e.toUpperCase()?o+=";"+a(e.toUpperCase())+"="+(void 0===(n=t)?"":n.replace(/\n/g,"\\n").replace(/;/g,"\\;")):o+=";"+a(e.toUpperCase())+"="+a(t))}))})),o+=":","string"==typeof t.value)o+=a(t.value);else{var s=-1!==u.indexOf(e)?",":";";o+=t.value.map((function(t){return a(t)})).join(s)}if(o.length>75){var l=o.substr(0,75),h=o.substr(75).match(/.{1,74}/g);i.push(l),h.forEach((function(t){i.push(" "+t)}))}else i.push(o)}}))})),i.push(r),i.join("\r\n")}}},function(t,e,n){var r=n(525),i=n(755),o=n(863),a=n(864),s=i.DOMImplementation,l=r.NAMESPACE,u=a.ParseError,c=a.XMLReader;function h(t){this.options=t||{locator:{}}}function p(){this.cdata=!1}function f(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function d(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function g(t,e,n){return"string"==typeof t?t.substr(e,n):t.length>=e+n||e?new java.lang.String(t,e,n)+"":t}function m(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}h.prototype.parseFromString=function(t,e){var n=this.options,r=new c,i=n.domBuilder||new p,a=n.errorHandler,s=n.locator,u=n.xmlns||{},h=/\/x?html?$/.test(e),f=h?o.HTML_ENTITIES:o.XML_ENTITIES;return s&&i.setDocumentLocator(s),r.errorHandler=function(t,e,n){if(!t){if(e instanceof p)return e;t=e}var r={},i=t instanceof Function;function o(e){var o=t[e];!o&&i&&(o=2==t.length?function(n){t(e,n)}:t),r[e]=o&&function(t){o("[xmldom "+e+"]\t"+t+d(n))}||function(){}}return n=n||{},o("warning"),o("error"),o("fatalError"),r}(a,i,s),r.domBuilder=n.domBuilder||i,h&&(u[""]=l.HTML),u.xml=u.xml||l.XML,t&&"string"==typeof t?r.parse(t,u,f):r.errorHandler.error("invalid doc source"),i.doc},p.prototype={startDocument:function(){this.doc=(new s).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,r){var i=this.doc,o=i.createElementNS(t,n||e),a=r.length;m(this,o),this.currentElement=o,this.locator&&f(this.locator,o);for(var s=0;s<a;s++){t=r.getURI(s);var l=r.getValue(s),u=(n=r.getQName(s),i.createAttributeNS(t,n));this.locator&&f(r.getLocator(s),u),u.value=u.nodeValue=l,o.setAttributeNode(u)}},endElement:function(t,e,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var n=this.doc.createProcessingInstruction(t,e);this.locator&&f(this.locator,n),m(this,n)},ignorableWhitespace:function(t,e,n){},characters:function(t,e,n){if(t=g.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(t);else r=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(t)&&this.doc.appendChild(r),this.locator&&f(this.locator,r)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,n){t=g.apply(this,arguments);var r=this.doc.createComment(t);this.locator&&f(this.locator,r),m(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(t,e,n);this.locator&&f(this.locator,i),m(this,i),this.doc.doctype=i}},warning:function(t){console.warn("[xmldom warning]\t"+t,d(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,d(this.locator))},fatalError:function(t){throw new u(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){p.prototype[t]=function(){return null}})),e.__DOMHandler=p,e.DOMParser=h,e.DOMImplementation=i.DOMImplementation,e.XMLSerializer=i.XMLSerializer},function(t,e,n){var r=n(525).freeze;e.XML_ENTITIES=r({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=r({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),e.entityMap=e.HTML_ENTITIES},function(t,e,n){var r=n(525).NAMESPACE,i=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,o=new RegExp("[\\-\\.0-9"+i.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),a=new RegExp("^"+i.source+o.source+"*(?::"+i.source+o.source+"*)?$");function s(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,s)}function l(){}function u(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function c(t,e,n,i,o,a){function s(t,e,r){n.attributeNames.hasOwnProperty(t)&&a.fatalError("Attribute "+t+" redefined"),n.addValue(t,e,r)}for(var l,u=++e,c=0;;){var h=t.charAt(u);switch(h){case"=":if(1===c)l=t.slice(e,u),c=3;else{if(2!==c)throw new Error("attribute equal must after attrName");c=3}break;case"'":case'"':if(3===c||1===c){if(1===c&&(a.warning('attribute value must after "="'),l=t.slice(e,u)),e=u+1,!((u=t.indexOf(h,e))>0))throw new Error("attribute value no end '"+h+"' match");s(l,p=t.slice(e,u).replace(/&#?\w+;/g,o),e-1),c=5}else{if(4!=c)throw new Error('attribute value must after "="');s(l,p=t.slice(e,u).replace(/&#?\w+;/g,o),e),a.warning('attribute "'+l+'" missed start quot('+h+")!!"),e=u+1,c=5}break;case"/":switch(c){case 0:n.setTagName(t.slice(e,u));case 5:case 6:case 7:c=7,n.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==c&&n.setTagName(t.slice(e,u)),u;case">":switch(c){case 0:n.setTagName(t.slice(e,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(p=t.slice(e,u)).slice(-1)&&(n.closed=!0,p=p.slice(0,-1));case 2:2===c&&(p=l),4==c?(a.warning('attribute "'+p+'" missed quot(")!'),s(l,p.replace(/&#?\w+;/g,o),e)):(r.isHTML(i[""])&&p.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+p+'" missed value!! "'+p+'" instead!!'),s(p,p,e));break;case 3:throw new Error("attribute value missed!!")}return u;case"":h=" ";default:if(h<=" ")switch(c){case 0:n.setTagName(t.slice(e,u)),c=6;break;case 1:l=t.slice(e,u),c=2;break;case 4:var p=t.slice(e,u).replace(/&#?\w+;/g,o);a.warning('attribute "'+p+'" missed quot(")!!'),s(l,p,e);case 5:c=6}else switch(c){case 2:n.tagName,r.isHTML(i[""])&&l.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),s(l,l,e),e=u,c=1;break;case 5:a.warning('attribute space is required"'+l+'"!!');case 6:c=1,e=u;break;case 3:c=4,e=u;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function h(t,e,n){for(var i=t.tagName,o=null,a=t.length;a--;){var s=t[a],l=s.qName,u=s.value;if((f=l.indexOf(":"))>0)var c=s.prefix=l.slice(0,f),h=l.slice(f+1),p="xmlns"===c&&h;else h=l,c=null,p="xmlns"===l&&"";s.localName=h,!1!==p&&(null==o&&(o={},d(n,n={})),n[p]=o[p]=u,s.uri=r.XMLNS,e.startPrefixMapping(p,u))}for(a=t.length;a--;)(c=(s=t[a]).prefix)&&("xml"===c&&(s.uri=r.XML),"xmlns"!==c&&(s.uri=n[c||""]));var f;(f=i.indexOf(":"))>0?(c=t.prefix=i.slice(0,f),h=t.localName=i.slice(f+1)):(c=null,h=t.localName=i);var g=t.uri=n[c||""];if(e.startElement(g,h,i,t),!t.closed)return t.currentNSMap=n,t.localNSMap=o,!0;if(e.endElement(g,h,i),o)for(c in o)Object.prototype.hasOwnProperty.call(o,c)&&e.endPrefixMapping(c)}function p(t,e,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var o=t.indexOf("</"+n+">",e),a=t.substring(e+1,o);if(/[&<]/.test(a))return/^script$/i.test(n)?(i.characters(a,0,a.length),o):(a=a.replace(/&#?\w+;/g,r),i.characters(a,0,a.length),o)}return e+1}function f(t,e,n,r){var i=r[n];return null==i&&((i=t.lastIndexOf("</"+n+">"))<e&&(i=t.lastIndexOf("</"+n)),r[n]=i),i<e}function d(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}function g(t,e,n,r){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(i=t.indexOf("--\x3e",e+4))>e?(n.comment(t,e+4,i-e-4),i+3):(r.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var i=t.indexOf("]]>",e+9);return n.startCDATA(),n.characters(t,e+9,i-e-9),n.endCDATA(),i+3}var o=function(t,e){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=e,i.exec(t);n=i.exec(t);)if(r.push(n),n[1])return r}(t,e),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],l=!1,u=!1;a>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],u=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(u=o[3][0]));var c=o[a-1];return n.startDTD(s,l,u),n.endDTD(),c.index+c[0].length}return-1}function m(t,e,n){var r=t.indexOf("?>",e);if(r){var i=t.substring(e,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function y(){this.attributeNames={}}s.prototype=new Error,s.prototype.name=s.name,l.prototype={parse:function(t,e,n){var i=this.domBuilder;i.startDocument(),d(e,e={}),function(t,e,n,i,o){function a(t){var e=t.slice(1,-1);return e in n?n[e]:"#"===e.charAt(0)?function(t){if(t>65535){var e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}(parseInt(e.substr(1).replace("x","0x"))):(o.error("entity not found:"+t),t)}function l(e){if(e>S){var n=t.substring(S,e).replace(/&#?\w+;/g,a);w&&d(S),i.characters(n,0,e-S),S=e}}function d(e,n){for(;e>=v&&(n=b.exec(t));)_=n.index,v=_+n[0].length,w.lineNumber++;w.columnNumber=e-_+1}for(var _=0,v=0,b=/.*(?:\r\n?|\n)|.*$/g,w=i.locator,C=[{currentNSMap:e}],P={},S=0;;){try{var x=t.indexOf("<",S);if(x<0){if(!t.substr(S).match(/^\s*$/)){var I=i.doc,O=I.createTextNode(t.substr(S));I.appendChild(O),i.currentElement=O}return}switch(x>S&&l(x),t.charAt(x+1)){case"/":var T=t.indexOf(">",x+3),L=t.substring(x+2,T).replace(/[ \t\n\r]+$/g,""),R=C.pop();T<0?(L=t.substring(x+2).replace(/[\s<].*/,""),o.error("end tag name: "+L+" is not complete:"+R.tagName),T=x+1+L.length):L.match(/\s</)&&(L=L.replace(/[\s<].*/,""),o.error("end tag name: "+L+" maybe not complete"),T=x+1+L.length);var E=R.localNSMap,j=R.tagName==L;if(j||R.tagName&&R.tagName.toLowerCase()==L.toLowerCase()){if(i.endElement(R.uri,R.localName,L),E)for(var N in E)Object.prototype.hasOwnProperty.call(E,N)&&i.endPrefixMapping(N);j||o.fatalError("end tag name: "+L+" is not match the current start tagName:"+R.tagName)}else C.push(R);T++;break;case"?":w&&d(x),T=m(t,x,i);break;case"!":w&&d(x),T=g(t,x,i,o);break;default:w&&d(x);var k=new y,A=C[C.length-1].currentNSMap,F=(T=c(t,x,k,A,a,o),k.length);if(!k.closed&&f(t,T,k.tagName,P)&&(k.closed=!0,n.nbsp||o.warning("unclosed xml attribute")),w&&F){for(var B=u(w,{}),M=0;M<F;M++){var z=k[M];d(z.offset),z.locator=u(w,{})}i.locator=B,h(k,i,A)&&C.push(k),i.locator=w}else h(k,i,A)&&C.push(k);r.isHTML(k.uri)&&!k.closed?T=p(t,T,k.tagName,a,i):T++}}catch(D){if(D instanceof s)throw D;o.error("element parse error: "+D),T=-1}T>S?S=T:l(Math.max(x,S)+1)}}(t,e,n,i,this.errorHandler),i.endDocument()}},y.prototype={setTagName:function(t){if(!a.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,n){if(!a.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},e.XMLReader=l,e.ParseError=s},function(t,e,n){"use strict";n(533);var r=n(427);n.d(e,"InputCommandType",(function(){return r.b})),n(602),n(762),n(433),n(593),n(812),n(600),n(594),n(595)},,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";function r(){let t=0,e=0;for(let r=0;r<28;r+=7){let n=this.buf[this.pos++];if(t|=(127&n)<<r,!(128&n))return this.assertBounds(),[t,e]}let n=this.buf[this.pos++];if(t|=(15&n)<<28,e=(112&n)>>4,!(128&n))return this.assertBounds(),[t,e];for(let r=3;r<=31;r+=7){let n=this.buf[this.pos++];if(e|=(127&n)<<r,!(128&n))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function i(t,e,n){for(let o=0;o<28;o+=7){const r=t>>>o,i=!(r>>>7==0&&0==e),a=255&(i?128|r:r);if(n.push(a),!i)return}const r=t>>>28&15|(7&e)<<4,i=!!(e>>3);if(n.push(255&(i?128|r:r)),i){for(let t=3;t<31;t+=7){const r=e>>>t,i=!(r>>>7==0),o=255&(i?128|r:r);if(n.push(o),!i)return}n.push(e>>>31&1)}}n.d(e,"a",(function(){return ve}));const o=4294967296;function a(t){let e="-"==t[0];e&&(t=t.slice(1));const n=1e6;let r=0,i=0;function a(e,a){const s=Number(t.slice(e,a));i*=n,r=r*n+s,r>=o&&(i+=r/o|0,r%=o)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),[e,r,i]}function s(t,e){if(e<=2097151)return""+(o*e+t);let n=(t>>>24|e<<8)>>>0&16777215,r=e>>16&65535,i=(16777215&t)+6777216*n+6710656*r,a=n+8147497*r,s=2*r,l=1e7;function u(t,e){let n=t?String(t):"";return e?"0000000".slice(n.length)+n:n}return i>=l&&(a+=Math.floor(i/l),i%=l),a>=l&&(s+=Math.floor(a/l),a%=l),u(s,0)+u(a,s)+u(i,1)}function l(t,e){if(t>=0){for(;t>127;)e.push(127&t|128),t>>>=7;e.push(t)}else{for(let n=0;n<9;n++)e.push(127&t|128),t>>=7;e.push(1)}}function u(){let t=this.buf[this.pos++],e=127&t;if(!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<7,!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<14,!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<21,!(128&t))return this.assertBounds(),e;t=this.buf[this.pos++],e|=(15&t)<<28;for(let n=5;128&t&&n<10;n++)t=this.buf[this.pos++];if(128&t)throw new Error("invalid varint");return this.assertBounds(),e>>>0}const c=function(){const t=new DataView(new ArrayBuffer(8));return void 0!==globalThis.BigInt&&"function"==typeof t.getBigInt64&&"function"==typeof t.getBigUint64&&"function"==typeof t.setBigInt64&&"function"==typeof t.setBigUint64?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:t}:void 0}();function h(t){if(!t)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const p=/^-?[0-9]+$/,f=4294967296;class d{constructor(t,e){this.lo=0|t,this.hi=0|e}isZero(){return 0==this.lo&&0==this.hi}toNumber(){let t=this.hi*f+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class g extends d{static from(t){if(c)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=c.C(t);case"number":if(0===t)return this.ZERO;t=c.C(t);case"bigint":if(!t)return this.ZERO;if(t<c.UMIN)throw new Error("signed value for ulong");if(t>c.UMAX)throw new Error("ulong too large");return c.V.setBigUint64(0,t,!0),new g(c.V.getInt32(0,!0),c.V.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!p.test(t))throw new Error("string is no integer");let[e,n,r]=a(t);if(e)throw new Error("signed value");return new g(n,r);case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new g(t,t/f)}throw new Error("unknown value "+typeof t)}toString(){return c?this.toBigInt().toString():s(this.lo,this.hi)}toBigInt(){return h(c),c.V.setInt32(0,this.lo,!0),c.V.setInt32(4,this.hi,!0),c.V.getBigUint64(0,!0)}}g.ZERO=new g(0,0);class m extends d{static from(t){if(c)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=c.C(t);case"number":if(0===t)return this.ZERO;t=c.C(t);case"bigint":if(!t)return this.ZERO;if(t<c.MIN)throw new Error("ulong too small");if(t>c.MAX)throw new Error("ulong too large");return c.V.setBigInt64(0,t,!0),new m(c.V.getInt32(0,!0),c.V.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!p.test(t))throw new Error("string is no integer");let[e,n,r]=a(t),i=new m(n,r);return e?i.negate():i;case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new m(t,t/f):new m(-t,-t/f).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return!!(2147483648&this.hi)}negate(){let t=~this.hi,e=this.lo;return e?e=1+~e:t+=1,new m(e,t)}toString(){if(c)return this.toBigInt().toString();if(this.isNegative()){let t=this.negate();return"-"+s(t.lo,t.hi)}return s(this.lo,this.hi)}toBigInt(){return h(c),c.V.setInt32(0,this.lo,!0),c.V.setInt32(4,this.hi,!0),c.V.getBigInt64(0,!0)}}m.ZERO=new m(0,0);const y=t=>String.fromCharCode.apply(String,t);class _{constructor(t){this.varint64=r,this.uint32=u,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),e=t>>>3,n=7&t;if(e<=0||n<0||n>5)throw new Error("illegal tag: field no "+e+" wire type "+n);return[e,n]}skip(t){let e=this.pos;switch(t){case O.Bit64:this.pos+=4;case O.Bit32:this.pos+=4;break;case O.LengthDelimited:let t=this.uint32();this.pos+=t;break;case O.Varint:for(;128&this.buf[this.pos++];);}return this.assertBounds(),this.buf.slice(e,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let t=this.uint32();return t>>>1^-(1&t)}int64(){return new m(...this.varint64())}uint64(){return new g(...this.varint64())}sint64(){let[t,e]=this.varint64(),n=-(1&t);return t=(t>>>1|(1&e)<<31)^n,e=e>>>1^n,new m(t,e)}bool(){let[t,e]=this.varint64();return 0!==t||0!==e}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new g(this.sfixed32(),this.sfixed32())}sfixed64(){return new m(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),e=this.pos;return this.pos+=t,this.assertBounds(),this.buf.slice(e,this.pos)}string(){return function(t){if(t.length<1)return"";let e,n=0,r=[],i=[],o=0,a=t.length;for(;n<a;)e=t[n++],e<128?i[o++]=e:e>191&&e<224?i[o++]=(31&e)<<6|63&t[n++]:e>239&&e<365?(e=((7&e)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,i[o++]=55296+(e>>10),i[o++]=56320+(1023&e)):i[o++]=(15&e)<<12|(63&t[n++])<<6|63&t[n++],o>8191&&(r.push(y(i)),o=0);return r.length?(o&&r.push(y(i.slice(0,o))),r.join("")):y(i.slice(0,o))}(this.bytes())}}function v(t,e){if(!t)throw new Error(e)}function b(t){if("number"!=typeof t)throw new Error("invalid int 32: "+typeof t);if(!Number.isInteger(t)||t>2147483647||t<-2147483648)throw new Error("invalid int 32: "+t)}function w(t){if("number"!=typeof t)throw new Error("invalid uint 32: "+typeof t);if(!Number.isInteger(t)||t>4294967295||t<0)throw new Error("invalid uint 32: "+t)}function C(t){if("number"!=typeof t)throw new Error("invalid float 32: "+typeof t);if(Number.isFinite(t)&&(t>34028234663852886e22||t<-34028234663852886e22))throw new Error("invalid float 32: "+t)}class P{constructor(t){this.stack=[],this.textEncoder=null!=t?t:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let r=0;r<this.chunks.length;r++)t+=this.chunks[r].length;let e=new Uint8Array(t),n=0;for(let r=0;r<this.chunks.length;r++)e.set(this.chunks[r],n),n+=this.chunks[r].length;return this.chunks=[],e}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),e=this.stack.pop();if(!e)throw new Error("invalid state, fork stack empty");return this.chunks=e.chunks,this.buf=e.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,e){return this.uint32((t<<3|e)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(w(t);t>127;)this.buf.push(127&t|128),t>>>=7;return this.buf.push(t),this}int32(t){return b(t),l(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let e=this.textEncoder.encode(t);return this.uint32(e.byteLength),this.raw(e)}float(t){C(t);let e=new Uint8Array(4);return new DataView(e.buffer).setFloat32(0,t,!0),this.raw(e)}double(t){let e=new Uint8Array(8);return new DataView(e.buffer).setFloat64(0,t,!0),this.raw(e)}fixed32(t){w(t);let e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,t,!0),this.raw(e)}sfixed32(t){b(t);let e=new Uint8Array(4);return new DataView(e.buffer).setInt32(0,t,!0),this.raw(e)}sint32(t){return b(t),l(t=(t<<1^t>>31)>>>0,this.buf),this}sfixed64(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=m.from(t);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(e)}fixed64(t){let e=new Uint8Array(8),n=new DataView(e.buffer),r=g.from(t);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(e)}int64(t){let e=m.from(t);return i(e.lo,e.hi,this.buf),this}sint64(t){let e=m.from(t),n=e.hi>>31;return i(e.lo<<1^n,(e.hi<<1|e.lo>>>31)^n,this.buf),this}uint64(t){let e=g.from(t);return i(e.lo,e.hi,this.buf),this}}var S;!function(t){t.symbol=Symbol("protobuf-ts/unknown"),t.onRead=(n,r,i,o,a)=>{(e(r)?r[t.symbol]:r[t.symbol]=[]).push({no:i,wireType:o,data:a})},t.onWrite=(e,n,r)=>{for(let{no:i,wireType:o,data:a}of t.list(n))r.tag(i,o).raw(a)},t.list=(n,r)=>{if(e(n)){let e=n[t.symbol];return r?e.filter((t=>t.no==r)):e}return[]},t.last=(e,n)=>t.list(e,n).slice(-1)[0];const e=e=>e&&Array.isArray(e[t.symbol])}(S||(S={}));const x={readUnknownField:!0,readerFactory:t=>new _(t)},I={writeUnknownFields:!0,writerFactory:()=>new P};var O,T,L,R;function E(t,e,n){let r,i,o=n;for(let a of t.fields){let t=a.localName;if(a.oneof){const n=o[a.oneof];if(void 0===n)continue;if(r=n[t],i=e[a.oneof],i.oneofKind=n.oneofKind,void 0===r){delete i[t];continue}}else if(r=o[t],i=e,void 0===r)continue;switch(a.kind){case"scalar":case"enum":a.repeat?i[t]=r.concat():i[t]=r;break;case"message":let e=a.T();if(a.repeat)for(let n=0;n<r.length;n++)i[t][n]=e.create(r[n]);else void 0===i[t]?i[t]=e.create(r):e.mergePartial(i[t],r);break;case"map":switch(a.V.kind){case"scalar":case"enum":Object.assign(i[t],r);break;case"message":let e=a.V.T();for(let n of Object.keys(r))i[t][n]=e.create(r[n])}}}}function j(t){let e=!1;const n=[];for(let r=0;r<t.length;r++){let i=t.charAt(r);"_"==i?e=!0:/\d/.test(i)?(n.push(i),e=!0):e?(n.push(i.toUpperCase()),e=!1):0==r?n.push(i.toLowerCase()):n.push(i)}return n.join("")}function N(t){var e,n,r,i;return t.localName=null!==(e=t.localName)&&void 0!==e?e:j(t.name),t.jsonName=null!==(n=t.jsonName)&&void 0!==n?n:j(t.name),t.repeat=null!==(r=t.repeat)&&void 0!==r?r:R.NO,t.opt=null!==(i=t.opt)&&void 0!==i?i:!t.repeat&&!t.oneof&&"message"==t.kind,t}function k(t){if("object"!=typeof t||null===t||!t.hasOwnProperty("oneofKind"))return!1;switch(typeof t.oneofKind){case"string":return void 0!==t[t.oneofKind]&&2==Object.keys(t).length;case"undefined":return 1==Object.keys(t).length;default:return!1}}!function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"}(O||(O={})),function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"}(T||(T={})),function(t){t[t.BIGINT=0]="BIGINT",t[t.STRING=1]="STRING",t[t.NUMBER=2]="NUMBER"}(L||(L={})),function(t){t[t.NO=0]="NO",t[t.PACKED=1]="PACKED",t[t.UNPACKED=2]="UNPACKED"}(R||(R={}));class A{constructor(t){this.info=t}prepare(){if(this.data)return;const t=[],e=[],n=[];for(let r of this.info.fields)if(r.oneof)n.includes(r.oneof)||(n.push(r.oneof),t.push(r.oneof),e.push(r.oneof));else switch(e.push(r.localName),r.kind){case"scalar":case"enum":r.opt&&!r.repeat||t.push(r.localName);break;case"message":r.repeat&&t.push(r.localName);break;case"map":t.push(r.localName)}this.data={req:t,known:e,oneofs:Object.values(n)}}is(t,e,n=!1){if(e<0)return!0;if(null==t||"object"!=typeof t)return!1;this.prepare();let r=Object.keys(t),i=this.data;if(r.length<i.req.length||i.req.some((t=>!r.includes(t))))return!1;if(!n&&r.some((t=>!i.known.includes(t))))return!1;if(e<1)return!0;for(const o of i.oneofs){const r=t[o];if(!k(r))return!1;if(void 0===r.oneofKind)continue;const i=this.info.fields.find((t=>t.localName===r.oneofKind));if(!i)return!1;if(!this.field(r[r.oneofKind],i,n,e))return!1}for(const o of this.info.fields)if(void 0===o.oneof&&!this.field(t[o.localName],o,n,e))return!1;return!0}field(t,e,n,r){let i=e.repeat;switch(e.kind){case"scalar":return void 0===t?e.opt:i?this.scalars(t,e.T,r,e.L):this.scalar(t,e.T,e.L);case"enum":return void 0===t?e.opt:i?this.scalars(t,T.INT32,r):this.scalar(t,T.INT32);case"message":return void 0===t||(i?this.messages(t,e.T(),n,r):this.message(t,e.T(),n,r));case"map":if("object"!=typeof t||null===t)return!1;if(r<2)return!0;if(!this.mapKeys(t,e.K,r))return!1;switch(e.V.kind){case"scalar":return this.scalars(Object.values(t),e.V.T,r,e.V.L);case"enum":return this.scalars(Object.values(t),T.INT32,r);case"message":return this.messages(Object.values(t),e.V.T(),n,r)}}return!0}message(t,e,n,r){return n?e.isAssignable(t,r):e.is(t,r)}messages(t,e,n,r){if(!Array.isArray(t))return!1;if(r<2)return!0;if(n){for(let i=0;i<t.length&&i<r;i++)if(!e.isAssignable(t[i],r-1))return!1}else for(let i=0;i<t.length&&i<r;i++)if(!e.is(t[i],r-1))return!1;return!0}scalar(t,e,n){let r=typeof t;switch(e){case T.UINT64:case T.FIXED64:case T.INT64:case T.SFIXED64:case T.SINT64:switch(n){case L.BIGINT:return"bigint"==r;case L.NUMBER:return"number"==r&&!isNaN(t);default:return"string"==r}case T.BOOL:return"boolean"==r;case T.STRING:return"string"==r;case T.BYTES:return t instanceof Uint8Array;case T.DOUBLE:case T.FLOAT:return"number"==r&&!isNaN(t);default:return"number"==r&&Number.isInteger(t)}}scalars(t,e,n,r){if(!Array.isArray(t))return!1;if(n<2)return!0;if(Array.isArray(t))for(let i=0;i<t.length&&i<n;i++)if(!this.scalar(t[i],e,r))return!1;return!0}mapKeys(t,e,n){let r=Object.keys(t);switch(e){case T.INT32:case T.FIXED32:case T.SFIXED32:case T.SINT32:case T.UINT32:return this.scalars(r.slice(0,n).map((t=>parseInt(t))),e,n);case T.BOOL:return this.scalars(r.slice(0,n).map((t=>"true"==t||"false"!=t&&t)),e,n);default:return this.scalars(r,e,n,L.STRING)}}}function F(t){let e=typeof t;if("object"==e){if(Array.isArray(t))return"array";if(null===t)return"null"}return e}let B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),M=[];for(let Pe=0;Pe<B.length;Pe++)M[B[Pe].charCodeAt(0)]=Pe;function z(t,e){switch(e){case L.BIGINT:return t.toBigInt();case L.NUMBER:return t.toNumber();default:return t.toString()}}M["-".charCodeAt(0)]=B.indexOf("+"),M["_".charCodeAt(0)]=B.indexOf("/");class D{constructor(t){this.info=t}prepare(){if(void 0===this.fMap){this.fMap={};for(const t of this.info.fields)this.fMap[t.name]=t,this.fMap[t.jsonName]=t,this.fMap[t.localName]=t}}assert(t,e,n){if(!t){let t=F(n);throw"number"!=t&&"boolean"!=t||(t=n.toString()),new Error(`Cannot parse JSON ${t} for ${this.info.typeName}#${e}`)}}read(t,e,n){this.prepare();const r=[];for(const[o,a]of Object.entries(t)){const t=this.fMap[o];if(!t){if(!n.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${o}`);continue}const s=t.localName;let l;if(t.oneof){if(r.includes(t.oneof))throw new Error(`Multiple members of the oneof group "${t.oneof}" of ${this.info.typeName} are present in JSON.`);r.push(t.oneof),l=e[t.oneof]={oneofKind:s}}else l=e;if("map"==t.kind){if(null===a)continue;this.assert(null!==(i=a)&&"object"==typeof i&&!Array.isArray(i),t.name,a);const e=l[s];for(const[r,i]of Object.entries(a)){let o;switch(this.assert(null!==i,t.name+" map value",null),t.V.kind){case"message":o=t.V.T().internalJsonRead(i,n);break;case"enum":o=this.enum(t.V.T(),i,t.name);break;case"scalar":o=this.scalar(i,t.V.T,t.V.L,t.name)}this.assert(void 0!==o,t.name+" map value",i);let a=r;t.K==T.BOOL&&(a="true"==a||"false"!=a&&a),a=this.scalar(a,t.K,L.STRING,t.name).toString(),e[a]=o}}else if(t.repeat){if(null===a)continue;this.assert(Array.isArray(a),t.name,a);const e=l[s];for(const r of a){let i;switch(this.assert(null!==r,t.name,null),t.kind){case"message":i=t.T().internalJsonRead(r,n);break;case"enum":i=this.enum(t.T(),r,t.name);break;case"scalar":i=this.scalar(r,t.T,t.L,t.name)}this.assert(void 0!==i,t.name,a),e.push(i)}}else switch(t.kind){case"message":if(null===a&&"google.protobuf.Value"!=t.T().typeName){this.assert(void 0===t.oneof,t.name+" (oneof member)",null);continue}l[s]=t.T().internalJsonRead(a,n,l[s]);break;case"enum":l[s]=this.enum(t.T(),a,t.name);break;case"scalar":l[s]=this.scalar(a,t.T,t.L,t.name)}}var i}enum(t,e,n){if("google.protobuf.NullValue"==t[0]&&v(null===e,`Unable to parse field ${this.info.typeName}#${n}, enum ${t[0]} only accepts null.`),null===e)return 0;switch(typeof e){case"number":return v(Number.isInteger(e),`Unable to parse field ${this.info.typeName}#${n}, enum can only be integral number, got ${e}.`),e;case"string":let r=e;t[2]&&e.substring(0,t[2].length)===t[2]&&(r=e.substring(t[2].length));let i=t[1][r];return v("number"==typeof i,`Unable to parse field ${this.info.typeName}#${n}, enum ${t[0]} has no value for "${e}".`),i}v(!1,`Unable to parse field ${this.info.typeName}#${n}, cannot parse enum value from ${typeof e}".`)}scalar(t,e,n,r){let i;try{switch(e){case T.DOUBLE:case T.FLOAT:if(null===t)return 0;if("NaN"===t)return Number.NaN;if("Infinity"===t)return Number.POSITIVE_INFINITY;if("-Infinity"===t)return Number.NEGATIVE_INFINITY;if(""===t){i="empty string";break}if("string"==typeof t&&t.trim().length!==t.length){i="extra whitespace";break}if("string"!=typeof t&&"number"!=typeof t)break;let r=Number(t);if(Number.isNaN(r)){i="not a number";break}if(!Number.isFinite(r)){i="too large or small";break}return e==T.FLOAT&&C(r),r;case T.INT32:case T.FIXED32:case T.SFIXED32:case T.SINT32:case T.UINT32:if(null===t)return 0;let o;if("number"==typeof t?o=t:""===t?i="empty string":"string"==typeof t&&(t.trim().length!==t.length?i="extra whitespace":o=Number(t)),void 0===o)break;return e==T.UINT32?w(o):b(o),o;case T.INT64:case T.SFIXED64:case T.SINT64:if(null===t)return z(m.ZERO,n);if("number"!=typeof t&&"string"!=typeof t)break;return z(m.from(t),n);case T.FIXED64:case T.UINT64:if(null===t)return z(g.ZERO,n);if("number"!=typeof t&&"string"!=typeof t)break;return z(g.from(t),n);case T.BOOL:if(null===t)return!1;if("boolean"!=typeof t)break;return t;case T.STRING:if(null===t)return"";if("string"!=typeof t){i="extra whitespace";break}try{encodeURIComponent(t)}catch(i){i="invalid UTF8";break}return t;case T.BYTES:if(null===t||""===t)return new Uint8Array(0);if("string"!=typeof t)break;return function(t){let e=3*t.length/4;"="==t[t.length-2]?e-=2:"="==t[t.length-1]&&(e-=1);let n,r=new Uint8Array(e),i=0,o=0,a=0;for(let s=0;s<t.length;s++){if(n=M[t.charCodeAt(s)],void 0===n)switch(t[s]){case"=":o=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string.")}switch(o){case 0:a=n,o=1;break;case 1:r[i++]=a<<2|(48&n)>>4,a=n,o=2;break;case 2:r[i++]=(15&a)<<4|(60&n)>>2,a=n,o=3;break;case 3:r[i++]=(3&a)<<6|n,o=0}}if(1==o)throw Error("invalid base64 string.");return r.subarray(0,i)}(t)}}catch(o){i=o.message}this.assert(!1,r+(i?" - "+i:""),t)}}class H{constructor(t){this.info=t}write(t,e){const n={},r=t;for(const i of this.info.fields.filter((t=>!t.oneof))){let t=this.field(i,r[i.localName],e);void 0!==t&&(n[e.useProtoFieldName?i.name:i.jsonName]=t)}for(const i of this.info.fields){if(!i.oneof)continue;const t=r[i.oneof];if(t.oneofKind!==i.localName)continue;let o;o="scalar"==i.kind||"enum"==i.kind?this.field(i,t[i.localName],{enumAsInteger:e.enumAsInteger,useProtoFieldName:e.useProtoFieldName,emitDefaultValues:!0}):this.field(i,t[i.localName],e),v(void 0!==o),n[e.useProtoFieldName?i.name:i.jsonName]=o}return n}field(t,e,n){let r;if("map"==t.kind){v("object"==typeof e&&null!==e);const i={};switch(t.V.kind){case"scalar":for(const[n,a]of Object.entries(e)){const e=this.scalar(t.V.T,a,t.name,!1,!0);v(void 0!==e),i[n.toString()]=e}break;case"message":const r=t.V.T();for(const[a,s]of Object.entries(e)){const e=this.message(r,s,t.name,n);v(void 0!==e),i[a.toString()]=e}break;case"enum":const o=t.V.T();for(const[a,s]of Object.entries(e)){v(void 0===s||"number"==typeof s);const e=this.enum(o,s,t.name,!1,!0,n.enumAsInteger);v(void 0!==e),i[a.toString()]=e}}(n.emitDefaultValues||Object.keys(i).length>0)&&(r=i)}else if(t.repeat){v(Array.isArray(e));const i=[];switch(t.kind){case"scalar":for(let n=0;n<e.length;n++){const r=this.scalar(t.T,e[n],t.name,t.opt,!0);v(void 0!==r),i.push(r)}break;case"enum":const r=t.T();for(let a=0;a<e.length;a++){v(void 0===e[a]||"number"==typeof e[a]);const o=this.enum(r,e[a],t.name,t.opt,!0,n.enumAsInteger);v(void 0!==o),i.push(o)}break;case"message":const o=t.T();for(let a=0;a<e.length;a++){const r=this.message(o,e[a],t.name,n);v(void 0!==r),i.push(r)}}(n.emitDefaultValues||i.length>0||n.emitDefaultValues)&&(r=i)}else switch(t.kind){case"scalar":r=this.scalar(t.T,e,t.name,t.opt,n.emitDefaultValues);break;case"enum":r=this.enum(t.T(),e,t.name,t.opt,n.emitDefaultValues,n.enumAsInteger);break;case"message":r=this.message(t.T(),e,t.name,n)}return r}enum(t,e,n,r,i,o){if("google.protobuf.NullValue"==t[0])return null;if(void 0!==e){if(0!==e||i||r)return v("number"==typeof e),v(Number.isInteger(e)),o||!t[1].hasOwnProperty(e)?e:t[2]?t[2]+t[1][e]:t[1][e]}else v(r)}message(t,e,n,r){return void 0===e?r.emitDefaultValues?null:void 0:t.internalJsonWrite(e,r)}scalar(t,e,n,r,i){if(void 0===e)return void v(r);const o=i||r;switch(t){case T.INT32:case T.SFIXED32:case T.SINT32:return 0===e?o?0:void 0:(b(e),e);case T.FIXED32:case T.UINT32:return 0===e?o?0:void 0:(w(e),e);case T.FLOAT:C(e);case T.DOUBLE:return 0===e?o?0:void 0:(v("number"==typeof e),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e);case T.STRING:return""===e?o?"":void 0:(v("string"==typeof e),e);case T.BOOL:return!1===e?!o&&void 0:(v("boolean"==typeof e),e);case T.UINT64:case T.FIXED64:v("number"==typeof e||"string"==typeof e||"bigint"==typeof e);let t=g.from(e);if(t.isZero()&&!o)return;return t.toString();case T.INT64:case T.SFIXED64:case T.SINT64:v("number"==typeof e||"string"==typeof e||"bigint"==typeof e);let n=m.from(e);if(n.isZero()&&!o)return;return n.toString();case T.BYTES:return v(e instanceof Uint8Array),e.byteLength?function(t){let e,n="",r=0,i=0;for(let o=0;o<t.length;o++)switch(e=t[o],r){case 0:n+=B[e>>2],i=(3&e)<<4,r=1;break;case 1:n+=B[i|e>>4],i=(15&e)<<2,r=2;break;case 2:n+=B[i|e>>6],n+=B[63&e],r=0}return r&&(n+=B[i],n+="=",1==r&&(n+="=")),n}(e):o?"":void 0}}}function U(t,e=L.STRING){switch(t){case T.BOOL:return!1;case T.UINT64:case T.FIXED64:return z(g.ZERO,e);case T.INT64:case T.SFIXED64:case T.SINT64:return z(m.ZERO,e);case T.DOUBLE:case T.FLOAT:return 0;case T.BYTES:return new Uint8Array(0);case T.STRING:return"";default:return 0}}class W{constructor(t){this.info=t}prepare(){this.fieldNoToField||(this.fieldNoToField=new Map(this.info.fields.map((t=>[t.no,t]))))}read(t,e,n,r){this.prepare();const i=void 0===r?t.len:t.pos+r;for(;t.pos<i;){const[r,i]=t.tag(),o=this.fieldNoToField.get(r);if(!o){let o=n.readUnknownField;if("throw"==o)throw new Error(`Unknown field ${r} (wire type ${i}) for ${this.info.typeName}`);let a=t.skip(i);!1!==o&&(!0===o?S.onRead:o)(this.info.typeName,e,r,i,a);continue}let a=e,s=o.repeat,l=o.localName;switch(o.oneof&&(a=a[o.oneof],a.oneofKind!==l&&(a=e[o.oneof]={oneofKind:l})),o.kind){case"scalar":case"enum":let e="enum"==o.kind?T.INT32:o.T,r="scalar"==o.kind?o.L:void 0;if(s){let n=a[l];if(i==O.LengthDelimited&&e!=T.STRING&&e!=T.BYTES){let i=t.uint32()+t.pos;for(;t.pos<i;)n.push(this.scalar(t,e,r))}else n.push(this.scalar(t,e,r))}else a[l]=this.scalar(t,e,r);break;case"message":if(s){let e=a[l],r=o.T().internalBinaryRead(t,t.uint32(),n);e.push(r)}else a[l]=o.T().internalBinaryRead(t,t.uint32(),n,a[l]);break;case"map":let[u,c]=this.mapEntry(o,t,n);a[l][u]=c}}}mapEntry(t,e,n){let r,i,o=e.uint32(),a=e.pos+o;for(;e.pos<a;){let[o,a]=e.tag();switch(o){case 1:r=t.K==T.BOOL?e.bool().toString():this.scalar(e,t.K,L.STRING);break;case 2:switch(t.V.kind){case"scalar":i=this.scalar(e,t.V.T,t.V.L);break;case"enum":i=e.int32();break;case"message":i=t.V.T().internalBinaryRead(e,e.uint32(),n)}break;default:throw new Error(`Unknown field ${o} (wire type ${a}) in map entry for ${this.info.typeName}#${t.name}`)}}if(void 0===r){let e=U(t.K);r=t.K==T.BOOL?e.toString():e}if(void 0===i)switch(t.V.kind){case"scalar":i=U(t.V.T,t.V.L);break;case"enum":i=0;break;case"message":i=t.V.T().create()}return[r,i]}scalar(t,e,n){switch(e){case T.INT32:return t.int32();case T.STRING:return t.string();case T.BOOL:return t.bool();case T.DOUBLE:return t.double();case T.FLOAT:return t.float();case T.INT64:return z(t.int64(),n);case T.UINT64:return z(t.uint64(),n);case T.FIXED64:return z(t.fixed64(),n);case T.FIXED32:return t.fixed32();case T.BYTES:return t.bytes();case T.UINT32:return t.uint32();case T.SFIXED32:return t.sfixed32();case T.SFIXED64:return z(t.sfixed64(),n);case T.SINT32:return t.sint32();case T.SINT64:return z(t.sint64(),n)}}}class V{constructor(t){this.info=t}prepare(){this.fields||(this.fields=this.info.fields.concat().sort(((t,e)=>t.no-e.no)))}write(t,e,n){this.prepare();for(const i of this.fields){let r,o,a=i.repeat,s=i.localName;if(i.oneof){const e=t[i.oneof];if(e.oneofKind!==s)continue;r=e[s],o=!0}else r=t[s],o=!1;switch(i.kind){case"scalar":case"enum":let t="enum"==i.kind?T.INT32:i.T;if(a)if(v(Array.isArray(r)),a==R.PACKED)this.packed(e,t,i.no,r);else for(const n of r)this.scalar(e,t,i.no,n,!0);else void 0===r?v(i.opt):this.scalar(e,t,i.no,r,o||i.opt);break;case"message":if(a){v(Array.isArray(r));for(const t of r)this.message(e,n,i.T(),i.no,t)}else this.message(e,n,i.T(),i.no,r);break;case"map":v("object"==typeof r&&null!==r);for(const[o,a]of Object.entries(r))this.mapEntry(e,n,i,o,a)}}let r=n.writeUnknownFields;!1!==r&&(!0===r?S.onWrite:r)(this.info.typeName,t,e)}mapEntry(t,e,n,r,i){t.tag(n.no,O.LengthDelimited),t.fork();let o=r;switch(n.K){case T.INT32:case T.FIXED32:case T.UINT32:case T.SFIXED32:case T.SINT32:o=Number.parseInt(r);break;case T.BOOL:v("true"==r||"false"==r),o="true"==r}switch(this.scalar(t,n.K,1,o,!0),n.V.kind){case"scalar":this.scalar(t,n.V.T,2,i,!0);break;case"enum":this.scalar(t,T.INT32,2,i,!0);break;case"message":this.message(t,e,n.V.T(),2,i)}t.join()}message(t,e,n,r,i){void 0!==i&&(n.internalBinaryWrite(i,t.tag(r,O.LengthDelimited).fork(),e),t.join())}scalar(t,e,n,r,i){let[o,a,s]=this.scalarInfo(e,r);s&&!i||(t.tag(n,o),t[a](r))}packed(t,e,n,r){if(!r.length)return;v(e!==T.BYTES&&e!==T.STRING),t.tag(n,O.LengthDelimited),t.fork();let[,i]=this.scalarInfo(e);for(let o=0;o<r.length;o++)t[i](r[o]);t.join()}scalarInfo(t,e){let n,r=O.Varint,i=void 0===e,o=0===e;switch(t){case T.INT32:n="int32";break;case T.STRING:o=i||!e.length,r=O.LengthDelimited,n="string";break;case T.BOOL:o=!1===e,n="bool";break;case T.UINT32:n="uint32";break;case T.DOUBLE:r=O.Bit64,n="double";break;case T.FLOAT:r=O.Bit32,n="float";break;case T.INT64:o=i||m.from(e).isZero(),n="int64";break;case T.UINT64:o=i||g.from(e).isZero(),n="uint64";break;case T.FIXED64:o=i||g.from(e).isZero(),r=O.Bit64,n="fixed64";break;case T.BYTES:o=i||!e.byteLength,r=O.LengthDelimited,n="bytes";break;case T.FIXED32:r=O.Bit32,n="fixed32";break;case T.SFIXED32:r=O.Bit32,n="sfixed32";break;case T.SFIXED64:o=i||m.from(e).isZero(),r=O.Bit64,n="sfixed64";break;case T.SINT32:n="sint32";break;case T.SINT64:o=i||m.from(e).isZero(),n="sint64"}return[r,n,i||o]}}const q={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},G={ignoreUnknownFields:!1},$=Object.values;function X(t,e,n){if(e===n)return!0;if(t!==T.BYTES)return!1;let r=e,i=n;if(r.length!==i.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!=i[o])return!1;return!0}function K(t,e,n){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!X(t,e[r],n[r]))return!1;return!0}function Y(t,e,n){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!t.equals(e[r],n[r]))return!1;return!0}class J{constructor(t,e){this.defaultCheckDepth=16,this.typeName=t,this.fields=e.map(N),this.refTypeCheck=new A(this),this.refJsonReader=new D(this),this.refJsonWriter=new H(this),this.refBinReader=new W(this),this.refBinWriter=new V(this)}create(t){let e=function(t){let e={};for(let n of t.fields){let t=n.localName;if(!n.opt)if(n.oneof)e[n.oneof]={oneofKind:void 0};else if(n.repeat)e[t]=[];else switch(n.kind){case"scalar":e[t]=U(n.T,n.L);break;case"enum":e[t]=0;break;case"map":e[t]={}}}return e}(this);return void 0!==t&&E(this,e,t),e}clone(t){let e=this.create();return E(this,e,t),e}equals(t,e){return function(t,e,n){if(e===n)return!0;if(!e||!n)return!1;for(let r of t.fields){let t=r.localName,i=r.oneof?e[r.oneof][t]:e[t],o=r.oneof?n[r.oneof][t]:n[t];switch(r.kind){case"enum":case"scalar":let t="enum"==r.kind?T.INT32:r.T;if(!(r.repeat?K(t,i,o):X(t,i,o)))return!1;break;case"map":if(!("message"==r.V.kind?Y(r.V.T(),$(i),$(o)):K("enum"==r.V.kind?T.INT32:r.V.T,$(i),$(o))))return!1;break;case"message":let e=r.T();if(!(r.repeat?Y(e,i,o):e.equals(i,o)))return!1}}return!0}(this,t,e)}is(t,e=this.defaultCheckDepth){return this.refTypeCheck.is(t,e,!1)}isAssignable(t,e=this.defaultCheckDepth){return this.refTypeCheck.is(t,e,!0)}mergePartial(t,e){E(this,t,e)}fromBinary(t,e){let n=function(t){return t?Object.assign(Object.assign({},x),t):x}(e);return this.internalBinaryRead(n.readerFactory(t),t.byteLength,n)}fromJson(t,e){return this.internalJsonRead(t,function(t){return t?Object.assign(Object.assign({},G),t):G}(e))}fromJsonString(t,e){let n=JSON.parse(t);return this.fromJson(n,e)}toJson(t,e){return this.internalJsonWrite(t,function(t){return t?Object.assign(Object.assign({},q),t):q}(e))}toJsonString(t,e){var n;let r=this.toJson(t,e);return JSON.stringify(r,null,null!==(n=null==e?void 0:e.prettySpaces)&&void 0!==n?n:0)}toBinary(t,e){let n=function(t){return t?Object.assign(Object.assign({},I),t):I}(e);return this.internalBinaryWrite(t,n.writerFactory(),n).finish()}internalJsonRead(t,e,n){if(null!==t&&"object"==typeof t&&!Array.isArray(t)){let r=null!=n?n:this.create();return this.refJsonReader.read(t,r,e),r}throw new Error(`Unable to parse message ${this.typeName} from JSON ${F(t)}.`)}internalJsonWrite(t,e){return this.refJsonWriter.write(t,e)}internalBinaryWrite(t,e,n){return this.refBinWriter.write(t,e,n),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create();return this.refBinReader.read(t,i,n,e),i}}var Z;!function(t){t[t.ID_00=0]="ID_00",t[t.ID_01=1]="ID_01",t[t.ID_10=10]="ID_10",t[t.ID_13=13]="ID_13",t[t.ID_90=90]="ID_90"}(Z||(Z={}));const Q=new class extends J{constructor(){super("GS1Config",[{no:1,name:"ais",kind:"message",repeat:1,T:()=>tt},{no:2,name:"reason",kind:"scalar",opt:!0,T:9}])}create(t){const e={ais:[]};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.ais.push(tt.internalBinaryRead(t,t.uint32(),n));break;case 2:i.reason=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){for(let i=0;i<t.ais.length;i++)tt.internalBinaryWrite(t.ais[i],e.tag(1,O.LengthDelimited).fork(),n).join();void 0!==t.reason&&e.tag(2,O.LengthDelimited).string(t.reason);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},tt=new class extends J{constructor(){super("ApplicationIdentifier",[{no:1,name:"id",kind:"enum",T:()=>["ApplicationIdentifier.ID",Z]},{no:2,name:"maxLength",kind:"scalar",opt:!0,T:13},{no:3,name:"readOnly",kind:"scalar",opt:!0,T:8}])}create(t){const e={id:0};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.id=t.int32();break;case 2:i.maxLength=t.uint32();break;case 3:i.readOnly=t.bool();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.id&&e.tag(1,O.Varint).int32(t.id),void 0!==t.maxLength&&e.tag(2,O.Varint).uint32(t.maxLength),void 0!==t.readOnly&&e.tag(3,O.Varint).bool(t.readOnly);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}};var et;!function(t){t[t.ASSETS=0]="ASSETS",t[t.UPLOADS=1]="UPLOADS",t[t.ANY=2]="ANY"}(et||(et={}));const nt=new class extends J{constructor(){super("ImageConfig",[{no:1,name:"root",kind:"scalar",opt:!0,T:9},{no:2,name:"reason",kind:"scalar",opt:!0,T:9},{no:3,name:"sources",kind:"enum",opt:!0,T:()=>["ImageConfig.Sources",et]}])}create(t){const e={};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.root=t.string();break;case 2:i.reason=t.string();break;case 3:i.sources=t.int32();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){void 0!==t.root&&e.tag(1,O.LengthDelimited).string(t.root),void 0!==t.reason&&e.tag(2,O.LengthDelimited).string(t.reason),void 0!==t.sources&&e.tag(3,O.Varint).int32(t.sources);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},rt=new class extends J{constructor(){super("NumberConfig",[{no:1,name:"constraints",kind:"message",repeat:1,T:()=>it},{no:2,name:"format",kind:"scalar",opt:!0,T:9}])}create(t){const e={constraints:[]};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.constraints.push(it.internalBinaryRead(t,t.uint32(),n));break;case 2:i.format=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){for(let i=0;i<t.constraints.length;i++)it.internalBinaryWrite(t.constraints[i],e.tag(1,O.LengthDelimited).fork(),n).join();void 0!==t.format&&e.tag(2,O.LengthDelimited).string(t.format);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},it=new class extends J{constructor(){super("NumberConstraint",[{no:1,name:"reason",kind:"scalar",opt:!0,T:9},{no:2,name:"min",kind:"message",oneof:"rule",T:()=>ot},{no:3,name:"max",kind:"message",oneof:"rule",T:()=>at},{no:4,name:"isInteger",kind:"message",oneof:"rule",T:()=>st}])}create(t){const e={rule:{oneofKind:void 0}};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.reason=t.string();break;case 2:i.rule={oneofKind:"min",min:ot.internalBinaryRead(t,t.uint32(),n,i.rule.min)};break;case 3:i.rule={oneofKind:"max",max:at.internalBinaryRead(t,t.uint32(),n,i.rule.max)};break;case 4:i.rule={oneofKind:"isInteger",isInteger:st.internalBinaryRead(t,t.uint32(),n,i.rule.isInteger)};break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){void 0!==t.reason&&e.tag(1,O.LengthDelimited).string(t.reason),"min"===t.rule.oneofKind&&ot.internalBinaryWrite(t.rule.min,e.tag(2,O.LengthDelimited).fork(),n).join(),"max"===t.rule.oneofKind&&at.internalBinaryWrite(t.rule.max,e.tag(3,O.LengthDelimited).fork(),n).join(),"isInteger"===t.rule.oneofKind&&st.internalBinaryWrite(t.rule.isInteger,e.tag(4,O.LengthDelimited).fork(),n).join();let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},ot=new class extends J{constructor(){super("NumberMinRule",[{no:1,name:"value",kind:"scalar",T:1}])}create(t){const e={value:0};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.double();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Bit64).double(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},at=new class extends J{constructor(){super("NumberMaxRule",[{no:1,name:"value",kind:"scalar",T:1}])}create(t){const e={value:0};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.double();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Bit64).double(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},st=new class extends J{constructor(){super("NumberIsIntegerRule",[{no:1,name:"value",kind:"scalar",T:8}])}create(t){const e={value:!1};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.bool();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){!1!==t.value&&e.tag(1,O.Varint).bool(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},lt=new class extends J{constructor(){super("StringConfig",[{no:1,name:"constraints",kind:"message",repeat:1,T:()=>ut}])}create(t){const e={constraints:[]};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.constraints.push(ut.internalBinaryRead(t,t.uint32(),n));else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){for(let i=0;i<t.constraints.length;i++)ut.internalBinaryWrite(t.constraints[i],e.tag(1,O.LengthDelimited).fork(),n).join();let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},ut=new class extends J{constructor(){super("StringConstraint",[{no:1,name:"reason",kind:"scalar",opt:!0,T:9},{no:2,name:"pattern",kind:"message",oneof:"rule",T:()=>ct},{no:3,name:"minLength",kind:"message",oneof:"rule",T:()=>ht},{no:4,name:"maxLength",kind:"message",oneof:"rule",T:()=>pt},{no:5,name:"minLines",kind:"message",oneof:"rule",T:()=>ft},{no:6,name:"maxLines",kind:"message",oneof:"rule",T:()=>dt},{no:7,name:"minLengthPerLine",kind:"message",oneof:"rule",T:()=>gt},{no:8,name:"maxLengthPerLine",kind:"message",oneof:"rule",T:()=>mt}])}create(t){const e={rule:{oneofKind:void 0}};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.reason=t.string();break;case 2:i.rule={oneofKind:"pattern",pattern:ct.internalBinaryRead(t,t.uint32(),n,i.rule.pattern)};break;case 3:i.rule={oneofKind:"minLength",minLength:ht.internalBinaryRead(t,t.uint32(),n,i.rule.minLength)};break;case 4:i.rule={oneofKind:"maxLength",maxLength:pt.internalBinaryRead(t,t.uint32(),n,i.rule.maxLength)};break;case 5:i.rule={oneofKind:"minLines",minLines:ft.internalBinaryRead(t,t.uint32(),n,i.rule.minLines)};break;case 6:i.rule={oneofKind:"maxLines",maxLines:dt.internalBinaryRead(t,t.uint32(),n,i.rule.maxLines)};break;case 7:i.rule={oneofKind:"minLengthPerLine",minLengthPerLine:gt.internalBinaryRead(t,t.uint32(),n,i.rule.minLengthPerLine)};break;case 8:i.rule={oneofKind:"maxLengthPerLine",maxLengthPerLine:mt.internalBinaryRead(t,t.uint32(),n,i.rule.maxLengthPerLine)};break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){void 0!==t.reason&&e.tag(1,O.LengthDelimited).string(t.reason),"pattern"===t.rule.oneofKind&&ct.internalBinaryWrite(t.rule.pattern,e.tag(2,O.LengthDelimited).fork(),n).join(),"minLength"===t.rule.oneofKind&&ht.internalBinaryWrite(t.rule.minLength,e.tag(3,O.LengthDelimited).fork(),n).join(),"maxLength"===t.rule.oneofKind&&pt.internalBinaryWrite(t.rule.maxLength,e.tag(4,O.LengthDelimited).fork(),n).join(),"minLines"===t.rule.oneofKind&&ft.internalBinaryWrite(t.rule.minLines,e.tag(5,O.LengthDelimited).fork(),n).join(),"maxLines"===t.rule.oneofKind&&dt.internalBinaryWrite(t.rule.maxLines,e.tag(6,O.LengthDelimited).fork(),n).join(),"minLengthPerLine"===t.rule.oneofKind&>.internalBinaryWrite(t.rule.minLengthPerLine,e.tag(7,O.LengthDelimited).fork(),n).join(),"maxLengthPerLine"===t.rule.oneofKind&&mt.internalBinaryWrite(t.rule.maxLengthPerLine,e.tag(8,O.LengthDelimited).fork(),n).join();let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},ct=new class extends J{constructor(){super("StringPatternRule",[{no:1,name:"value",kind:"scalar",T:9}])}create(t){const e={value:""};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.string();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){""!==t.value&&e.tag(1,O.LengthDelimited).string(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},ht=new class extends J{constructor(){super("StringMinLengthRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},pt=new class extends J{constructor(){super("StringMaxLengthRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},ft=new class extends J{constructor(){super("StringMinLinesRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},dt=new class extends J{constructor(){super("StringMaxLinesRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},gt=new class extends J{constructor(){super("StringMinLengthPerLineRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},mt=new class extends J{constructor(){super("StringMaxLengthPerLineRule",[{no:1,name:"value",kind:"scalar",T:13}])}create(t){const e={value:0};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)i.value=t.uint32();else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){0!==t.value&&e.tag(1,O.Varint).uint32(t.value);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},yt=new class extends J{constructor(){super("VariantConfig",[{no:1,name:"variants",kind:"message",repeat:1,T:()=>_t},{no:2,name:"reason",kind:"scalar",opt:!0,T:9}])}create(t){const e={variants:[]};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.variants.push(_t.internalBinaryRead(t,t.uint32(),n));break;case 2:i.reason=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){for(let i=0;i<t.variants.length;i++)_t.internalBinaryWrite(t.variants[i],e.tag(1,O.LengthDelimited).fork(),n).join();void 0!==t.reason&&e.tag(2,O.LengthDelimited).string(t.reason);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},_t=new class extends J{constructor(){super("Variant",[{no:1,name:"value",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9}])}create(t){const e={value:""};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.value=t.string();break;case 2:i.title=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){""!==t.value&&e.tag(1,O.LengthDelimited).string(t.value),void 0!==t.title&&e.tag(2,O.LengthDelimited).string(t.title);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}};class vt{static getFieldConfig(t){if(null==t.config)return null;switch(t.config.oneofKind){case"string":return t.config.string;case"number":return t.config.number;case"variant":return t.config.variant;case"image":return t.config.image;case"gs1":return t.config.gs1;default:throw new Error(`The field config type ${t.config.oneofKind} is not supported.`)}}static getStringConfig(t){return"string"==t.config.oneofKind?t.config.string:null}static getNumberConfig(t){return"number"==t.config.oneofKind?t.config.number:null}static getVariantConfig(t){return"variant"==t.config.oneofKind?t.config.variant:null}static getImageConfig(t){return"image"==t.config.oneofKind?t.config.image:null}static getGS1Config(t){return"gs1"==t.config.oneofKind?t.config.gs1:null}static getStringRule(t){if(null==t.rule)return null;switch(t.rule.oneofKind){case"pattern":return t.rule.pattern;case"minLength":return t.rule.minLength;case"maxLength":return t.rule.maxLength;case"minLines":return t.rule.minLines;case"maxLines":return t.rule.maxLines;case"minLengthPerLine":return t.rule.minLengthPerLine;case"maxLengthPerLine":return t.rule.maxLengthPerLine;default:throw new Error(`The string rule type ${t.rule.oneofKind} is not supported.`)}}static getNumberRule(t){if(null==t.rule)return null;switch(t.rule.oneofKind){case"min":return t.rule.min;case"max":return t.rule.max;case"isInteger":return t.rule.isInteger;default:throw new Error(`The number rule type ${t.rule.oneofKind} is not supported.`)}}static getConstraintRuleDisplayName(t){if(null==(null==t?void 0:t.rule))return null;switch(t.rule.oneofKind){case"pattern":return"Pattern";case"minLength":return"Min characters";case"maxLength":return"Max characters";case"minLines":return"Min number of lines";case"maxLines":return"Max number of lines";case"minLengthPerLine":return"Min characters per line";case"maxLengthPerLine":return"Max characters per line";case"min":return"Min value";case"max":return"Max value";case"isInteger":return"Only integer";default:throw new Error(`The rule type ${t.rule.oneofKind} is not supported.`)}}static getSupportedRuleTypes(t){if(null==t)return;const e="string"==typeof t?t:t.oneofKind;return"string"==e?this.supportedStringRuleTypes.slice():"number"==e?this.supportedNumberRuleTypes.slice():"variant"==e?["variants"]:"image"==e?["root"]:"gs1"==e?["gs1"]:void 0}static createConfig(t,e){switch(t){case"number":return this._buildOneofItem(t,rt.create({constraints:this._createNumberConstraints(e)}));case"variant":return this._buildOneofItem(t,yt.create(this._createVariantConfig(e[0])));case"string":return this._buildOneofItem(t,lt.create({constraints:this._createStringConstraints(e)}));case"image":return this._buildOneofItem(t,nt.create(this._createImageConfig(e[0])));case"gs1":return this._buildOneofItem(t,Q.create(this._createGS1Config(e[0])));case void 0:return;default:throw new Error(`Unknown config type: ${t}`)}}static _buildOneofItem(t,e){const n={oneofKind:t};return n[t]=e,n}static _createNumberConstraints(t){const e=[];for(let n of t){let t={};switch(n.ruleType){case"isInteger":t.rule=this._buildOneofItem(n.ruleType,st.create({value:this.toBool(n.value)}));break;case"min":t.rule=this._buildOneofItem(n.ruleType,ot.create({value:this.toNumber(n.value)}));break;case"max":t.rule=this._buildOneofItem(n.ruleType,at.create({value:this.toNumber(n.value)}));break;default:continue}null!=n.reason&&(t.reason=n.reason),e.push(t)}return e}static _createVariantConfig(t){return null==t?{}:{variants:t.variants,reason:t.reason}}static _createImageConfig(t){return null==t?{}:{root:t.value,reason:t.reason,sources:(()=>{switch(t.sources){case"Assets":case 0:return et.ASSETS;case"Uploads":case 1:return et.UPLOADS;default:return et.ANY}})()}}static _createGS1Config(t){if(null==(null==t?void 0:t.ais)||0==t.ais.length)return{};const e=t=>{switch(t){case"01":case"ID_01":case 1:return Z.ID_01;case"10":case"ID_10":case 10:return Z.ID_10;case"13":case"ID_13":case 13:return Z.ID_13;case"90":case"ID_90":case 90:return Z.ID_90;default:throw new Error(`The GS1 application identifier ${t} is not supported.`)}},n=[];for(let r of t.ais)n.push({id:e(r.id),maxLength:r.maxLength,readOnly:r.readOnly});return{ais:n}}static _createStringConstraints(t){const e=[];for(let n of t){const t={};switch(n.ruleType){case"minLength":t.rule=this._buildOneofItem(n.ruleType,ht.create({value:this.toNumber(n.value)}));break;case"maxLength":t.rule=this._buildOneofItem(n.ruleType,pt.create({value:this.toNumber(n.value)}));break;case"minLengthPerLine":t.rule=this._buildOneofItem(n.ruleType,gt.create({value:this.toNumber(n.value)}));break;case"maxLengthPerLine":t.rule=this._buildOneofItem(n.ruleType,mt.create({value:this.toNumber(n.value)}));break;case"minLines":t.rule=this._buildOneofItem(n.ruleType,ft.create({value:this.toNumber(n.value)}));break;case"maxLines":t.rule=this._buildOneofItem(n.ruleType,dt.create({value:this.toNumber(n.value)}));break;case"pattern":t.rule=this._buildOneofItem(n.ruleType,ct.create({value:n.value}));break;default:continue}null!=n.reason&&(t.reason=n.reason),e.push(t)}return e}static toNumber(t){if(void 0!==t){const e=Number(t);if(isNaN(e))throw new Error(`A ${t} is not a number. Ensure that you did not mistype in a feature file.`);return e}return t}static toBool(t){return void 0!==t?"boolean"==typeof t?t:"true"===t.toLowerCase():t}}vt.supportedStringRuleTypes=["pattern","minLength","maxLength","minLines","maxLines","minLengthPerLine","maxLengthPerLine"],vt.supportedNumberRuleTypes=["min","max","isInteger"];var bt,wt=n(542);!function(t){t.ok="ok",t.missing="missing",t.required="required",t.stringPattern="stringPattern",t.stringMinLength="stringMinLength",t.stringMaxLength="stringMaxLength",t.stringMinLengthPerLine="stringMinLengthPerLine",t.stringMaxLengthPerLine="stringMaxLengthPerLine",t.stringMinLines="stringMinLines",t.stringMaxLines="stringMaxLines",t.variantNotInList="variantNotInList",t.numberIsNumber="numberIsNumber",t.numberMin="numberMin",t.numberMax="numberMax",t.numberIsInteger="numberIsInteger",t.imageRoot="imageRoot",t.noSuchField="noSuchField",t.gs1Invalid="gs1Invalid"}(bt||(bt={}));class Ct{static fromField(t,e,n,r,i){var o,a;switch(null===(o=t.config)||void 0===o?void 0:o.oneofKind){case"number":return new xt(t,e,n,r);case"string":return new St(t,e,n,r);case"variant":return new It(t,e,n);case"image":return new Ot(t,e,n);case"gs1":return new Tt(t,e,n,null!=i?i:[]);default:throw new Error(`Cannot create validation problem for the field of type ${null===(a=t.config)||void 0===a?void 0:a.oneofKind} because it is not supported.`)}}}class Pt{constructor(t,e,n){this.fieldName=t,this.reason=n,this.rule=e}static processReason(t,e,n){let r=t.replace("{value}",e);return void 0!==n&&(r=r.replace("{constraint}",n)),r}}class St extends Pt{static getRuleByConstraint(t){switch(t.rule.oneofKind){case"maxLength":return bt.stringMaxLength;case"minLength":return bt.stringMinLength;case"maxLengthPerLine":return bt.stringMaxLengthPerLine;case"minLengthPerLine":return bt.stringMinLengthPerLine;case"maxLines":return bt.stringMaxLines;case"minLines":return bt.stringMinLines;case"pattern":return bt.stringPattern;default:throw new Error(`String validation problem rule for ${t.rule.oneofKind} is not defined.`)}}static getDefaultReason(t,e,n){switch(e.rule.oneofKind){case"maxLength":return`The ${t.name} field length is greater than ${e.rule.maxLength.value}`;case"minLength":return`The ${t.name} field length is less than ${e.rule.minLength.value}`;case"maxLengthPerLine":return`The length of the longest line in ${t.name} field is greater than ${e.rule.maxLengthPerLine.value}`;case"minLengthPerLine":return`The length of the shortest line in ${t.name} field is less than ${e.rule.minLengthPerLine.value}`;case"maxLines":return`The number of lines in ${t.name} is greater than ${e.rule.maxLines.value}`;case"minLines":return`The number of lines in ${t.name} is less than ${e.rule.minLines.value}`;case"pattern":return`The ${t.name} field is ${n} but it does not match a specified pattern /${e.rule.pattern.value}/`;default:throw new Error(`String validation problem rule for ${e.rule.oneofKind} is not defined.`)}}constructor(t,e,n,r){var i;super(t.name,St.getRuleByConstraint(e),Pt.processReason(null!==(i=e.reason)&&void 0!==i?i:St.getDefaultReason(t,e,n),n,r))}}class xt extends Pt{static getRuleByConstraint(t){switch(t.rule.oneofKind){case"isInteger":return bt.numberIsInteger;case"min":return bt.numberMin;case"max":return bt.numberMax;default:throw new Error(`Number validation problem rule for ${t.rule.oneofKind} is not defined.`)}}static getDefaultReason(t,e,n){switch(e.rule.oneofKind){case"max":return`The ${t.name} field is ${n} but it should be not greater than ${e.rule.max.value}.`;case"min":return`The ${t.name} field is ${n} but it should be not less than ${e.rule.min.value}.`;case"isInteger":return`The ${t.name} field is ${n} but it must be an integer number.`;default:throw new Error(`Number validation problem rule for ${e.rule.oneofKind} is not defined.`)}}constructor(t,e,n,r){var i;super(t.name,xt.getRuleByConstraint(e),Pt.processReason(null!==(i=e.reason)&&void 0!==i?i:xt.getDefaultReason(t,e,n),n,r))}}class It extends Pt{constructor(t,e,n){var r;super(t.name,bt.variantNotInList,Pt.processReason(null!==(r=e.reason)&&void 0!==r?r:`The value ${n} of ${t.name} must be one of ${e.variants.map((t=>t.value)).join(", ")}`,n))}}class Ot extends Pt{constructor(t,e,n){var r;super(t.name,bt.imageRoot,Pt.processReason(null!==(r=e.reason)&&void 0!==r?r:`The image ${n} in the ${t.name} field must be located in the ${e.root} folder`,n))}}class Tt extends Pt{constructor(t,e,n,r){var i;super(t.name,bt.gs1Invalid,Pt.processReason(null!==(i=e.reason)&&void 0!==i?i:`The GS1 ${n} in the ${t.name} doesn't meet GS1 Standard: ${r.join(", ")}`,n))}}class Lt extends Pt{constructor(t){super(t,bt.ok,"")}}function Rt(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function Et(t){return function e(n){return 0===arguments.length||Rt(n)?e:t.apply(this,arguments)}}var jt=Et((function(t){return null==t}));function Nt(t,e){return Object.prototype.hasOwnProperty.call(e,t)}var kt=Object.prototype.toString,At=function(){return"[object Arguments]"===kt.call(arguments)?function(t){return"[object Arguments]"===kt.call(t)}:function(t){return Nt("callee",t)}}(),Ft=At,Bt=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)},Mt=Et((function(t){return null!=t&&"function"==typeof t["fantasy-land/empty"]?t["fantasy-land/empty"]():null!=t&&null!=t.constructor&&"function"==typeof t.constructor["fantasy-land/empty"]?t.constructor["fantasy-land/empty"]():null!=t&&"function"==typeof t.empty?t.empty():null!=t&&null!=t.constructor&&"function"==typeof t.constructor.empty?t.constructor.empty():Bt(t)?[]:function(t){return"[object String]"===Object.prototype.toString.call(t)}(t)?"":function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t)?{}:Ft(t)?function(){return arguments}():void 0})),zt=Mt;function Dt(t){return function e(n,r){switch(arguments.length){case 0:return e;case 1:return Rt(n)?e:Et((function(e){return t(n,e)}));default:return Rt(n)&&Rt(r)?e:Rt(n)?Et((function(e){return t(e,r)})):Rt(r)?Et((function(e){return t(n,e)})):t(n,r)}}}function Ht(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}function Ut(t,e,n){for(var r=0,i=n.length;r<i;){if(t(e,n[r]))return!0;r+=1}return!1}var Wt="function"==typeof Object.is?Object.is:function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e},Vt=!{toString:null}.propertyIsEnumerable("toString"),qt=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Gt=function(){return arguments.propertyIsEnumerable("length")}(),$t=function(t,e){for(var n=0;n<t.length;){if(t[n]===e)return!0;n+=1}return!1},Xt="function"!=typeof Object.keys||Gt?Et((function(t){if(Object(t)!==t)return[];var e,n,r=[],i=Gt&&Ft(t);for(e in t)!Nt(e,t)||i&&"length"===e||(r[r.length]=e);if(Vt)for(n=qt.length-1;n>=0;)Nt(e=qt[n],t)&&!$t(r,e)&&(r[r.length]=e),n-=1;return r})):Et((function(t){return Object(t)!==t?[]:Object.keys(t)})),Kt=Et((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function Yt(t,e,n,r){var i=Ht(t);function o(t,e){return Jt(t,e,n.slice(),r.slice())}return!Ut((function(t,e){return!Ut(o,e,t)}),Ht(e),i)}function Jt(t,e,n,r){if(Wt(t,e))return!0;var i,o,a=Kt(t);if(a!==Kt(e))return!1;if(null==t||null==e)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof e["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e)&&"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof e.equals)return"function"==typeof t.equals&&t.equals(e)&&"function"==typeof e.equals&&e.equals(t);switch(a){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===(i=t.constructor,null==(o=String(i).match(/^function (\w*)/))?"":o[1]))return t===e;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof e||!Wt(t.valueOf(),e.valueOf()))return!1;break;case"Date":if(!Wt(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(t.source!==e.source||t.global!==e.global||t.ignoreCase!==e.ignoreCase||t.multiline!==e.multiline||t.sticky!==e.sticky||t.unicode!==e.unicode)return!1}for(var s=n.length-1;s>=0;){if(n[s]===t)return r[s]===e;s-=1}switch(a){case"Map":return t.size===e.size&&Yt(t.entries(),e.entries(),n.concat([t]),r.concat([e]));case"Set":return t.size===e.size&&Yt(t.values(),e.values(),n.concat([t]),r.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var l=Xt(t);if(l.length!==Xt(e).length)return!1;var u=n.concat([t]),c=r.concat([e]);for(s=l.length-1;s>=0;){var h=l[s];if(!Nt(h,e)||!Jt(e[h],t[h],u,c))return!1;s-=1}return!0}var Zt=Dt((function(t,e){return Jt(t,e,[],[])})),Qt=Et((function(t){return null!=t&&Zt(t,zt(t))}));function te(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(t){return e.apply(this,arguments)};case 2:return function(t,n){return e.apply(this,arguments)};case 3:return function(t,n,r){return e.apply(this,arguments)};case 4:return function(t,n,r,i){return e.apply(this,arguments)};case 5:return function(t,n,r,i,o){return e.apply(this,arguments)};case 6:return function(t,n,r,i,o,a){return e.apply(this,arguments)};case 7:return function(t,n,r,i,o,a,s){return e.apply(this,arguments)};case 8:return function(t,n,r,i,o,a,s,l){return e.apply(this,arguments)};case 9:return function(t,n,r,i,o,a,s,l,u){return e.apply(this,arguments)};case 10:return function(t,n,r,i,o,a,s,l,u,c){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function ee(t,e,n){return function(){for(var r=[],i=0,o=t,a=0;a<e.length||i<arguments.length;){var s;a<e.length&&(!Rt(e[a])||i>=arguments.length)?s=e[a]:(s=arguments[i],i+=1),r[a]=s,Rt(s)||(o-=1),a+=1}return o<=0?n.apply(this,r):te(o,ee(t,r,n))}}var ne=Dt((function(t,e){return 1===t?Et(e):te(t,ee(t,[],e))})),re=Et((function(t){return ne(t.length,t)})),ie=Dt((function(t,e){return e<t?e:t})),oe=Dt((function(t,e){return e>t?e:t})),ae=Dt((function(t,e){return t<e})),se=Dt((function(t,e){return t>e}));class le{static getAITitle(t){switch(t){case 1:return"GTIN";case 13:return"Packaging date";case 10:return"Batch or lot number";case 90:return"Information mutually agreed between trading partners";default:throw new Error(this.getAINotSupportedMessage(t))}}static getAIValueLengthLimits(t){switch(t){case 1:return{min:14,max:14};case 13:return{min:6,max:6};case 10:return{min:1,max:20};case 90:return{min:1,max:30};default:throw new Error(this.getAINotSupportedMessage(t))}}static getAIValueType(t){return 13===t?"date":"string"}static getAIValueRegex(t){switch(t){case 1:case 13:return this._numberRegex;case 10:case 90:return this._iso646Regex;default:throw new Error(this.getAINotSupportedMessage(t))}}static getMinDate(){const t=(new Date).getFullYear(),e=new Date;return e.setFullYear(t-49),e}static getMaxDate(){const t=(new Date).getFullYear(),e=new Date;return e.setFullYear(t+50),e}static dateToGs1(t){const e=new Date(t),n=e.getFullYear().toString().slice(2,4),r=e.getMonth();return`${n}${Number(r+1).toString().padStart(2,"0")}${e.getDate().toString().padStart(2,"0")}`}static gs1DateToDate(t){var e;if(null==t||0==t.length)throw Error("GS1 date parsing error: date cannot be null or empty string");const[n,r,i]=null!==(e=t.match(/.{1,2}/g))&&void 0!==e?e:[],o=new Date;o.setDate(Number(i)),o.setMonth(Number(r)-1);const a=o.getFullYear(),s=Number((a-49).toString().slice(2,4));if(Number(n)<s?o.setFullYear(Number(`20${n}`)):o.setFullYear(Number(`19${n}`)),isNaN(o.getTime()))throw Error("GS1 date parsing error: date is invalid");return o}}le._numberRegex=/^\d+$/,le._iso646Regex=/^[\x21-\x22\x25-\x2F\x30-\x39\x3A-\x3F\x41-\x5A\x5F\x61-\x7A]+$/,le.supportedAIs=[1,13,10,90],le.getAINotSupportedMessage=t=>`Application Identifier ${t} is not supported`,le.idToString=t=>t.toString().padStart(2,"0");class ue{constructor(t){this.ais=null!=t?t:[]}static parse(t){if(null==t||0==t.length)throw Error("GS1 data parsing error: value cannot be null or empty");if(!t.startsWith("["))throw Error("GS1 data parsing error: value must start with application identifier");if(!this._gs1Regex.test(t))throw Error("GS1 data parsing error: value doesn't match the GS1 regex");this._gs1Regex.lastIndex=0;const e=new ue;let n;for(;null!==(n=this._gs1Regex.exec(t));){if(3!=n.length)throw Error("GS1 data parsing error: value doesn't match the GS1 regex");const t=+n[1],r=n[2];if(e.ais.find((e=>e.id==t)))throw Error("GS1 data parsing error: value must not contain duplicate application identifiers");e.ais.push({id:t,value:r})}return e}encode(){let t="";for(let e=0;e<this.ais.length;e++){const n=this.ais[e];t+=`[${n.id.toString().padStart(2,"0")}]${n.value}`}return t}validate(t){const e=this.ais.map((e=>ue.validateAI(e,t))).map((t=>t.cata((t=>t),(t=>"")))).filter((t=>""!=t));return 0==e.length?Object(wt.Right)(""):Object(wt.Left)(e)}getAIValue(t){const e=this.ais.find((e=>e.id===t));return null==e?void 0:e.value}setAIValue(t,e){const n=this.ais.find((e=>e.id===t));n&&("date"===le.getAIValueType(n.id)?n.value=e instanceof Date?le.dateToGs1(e):e:n.value=e)}static validateAI(t,e){return new ce(e).validate(t)}}ue._gs1Regex=/\[(\d{2,4})\]([^\[\]]+)/g;class ce{constructor(t){this._config=t}validate(t){return this._checkIsSupported(t).chain(this._checkIsDataValid.bind(this))}_checkIsSupported(t){return le.supportedAIs.includes(t.id)?Object(wt.Right)(t):Object(wt.Left)(le.getAINotSupportedMessage(t.id))}_checkIsDataValid(t){var e;const n=null===(e=this._config)||void 0===e?void 0:e.ais.find((e=>e.id==t.id));let r=null==n?void 0:n.maxLength;const i=t.id,o=t.value,a=le.getAIValueLengthLimits(i),s=le.getAIValueRegex(i);return null!=r&&(r<a.min||r>a.max)&&(r=void 0),o.length<a.min||o.length>(null!=r?r:a.max)?Object(wt.Left)(`Invalid data length for Application Identifier ${le.idToString(i)}`):s.test(o)?Object(wt.Right)(t):Object(wt.Left)(`Invalid Application Identifier ${le.idToString(i)} value`)}}class he{constructor(t){this.checkMissing=t=>t.hasOwnProperty(this.field.name)?Object(wt.Right)(t[this.field.name]):Object(wt.Left)(new Pt(this.field.name,bt.missing,`Data must contain ${he.getFieldDisplayName(this.field)} field.`)),this.checkRequired=t=>this.field.required&&this.isOmitted(t)?Object(wt.Left)(new Pt(this.field.name,bt.required,`The ${he.getFieldDisplayName(this.field)} field cannot be empty.`)):this.getOptionalFieldResult(t),this.getOptionalFieldResult=t=>this.isOmitted(t)?Object(wt.Left)(new Lt(this.field.name)):Object(wt.Right)(t),this.checkConfig=t=>wt.Maybe.fromUndefined(pe.Build(this.field)).map((e=>e.validate(t))).getOrElse(Object(wt.Right)(t)),this.field=t}validate(t){return this.checkMissing(t).chain(this.checkRequired).chain(this.checkConfig)}isOmitted(t){return jt(t)||Qt(t)}static getFieldDisplayName(t){return null!=t.title&&""!=t.title.trim()?t.title:t.name}}class pe{static Build(t){switch(t.config.oneofKind){case"string":return new de(t);case"number":return new ge(t);case"variant":return new me(t);case"image":return new ye(t);case"gs1":return new _e(t);default:return}}}class fe{constructor(t){this._field=t}validate(t){return Object(wt.Right)(t)}checkConstraint(t,e){return re(this.checkIfRuleIsSet)(t,wt.Maybe.fromUndefined(this.findConstraintByRuleName(t)),e,((e,n)=>Ct.fromField(this._field,this.findConstraintByRuleName(t),n,e)))}checkIfRuleIsSet(t,e,n,r,i){return e.cata((()=>Object(wt.Right)(i)),(e=>n(i,e.rule[t].value)?Object(wt.Left)(r(e.rule[t].value,i)):Object(wt.Right)(i)))}}class de extends fe{constructor(t){super(t),this._config=vt.getStringConfig(t)}findConstraintByRuleName(t){var e,n;return(null!==(n=null===(e=this._config)||void 0===e?void 0:e.constraints)&&void 0!==n?n:[]).find((e=>e.rule.oneofKind==t))}validate(t){return super.validate(t).chain(this.checkConstraint("pattern",((t,e)=>!RegExp(e).test(t)))).chain(this.checkConstraint("minLength",((t,e)=>t.length<e))).chain(this.checkConstraint("maxLength",((t,e)=>t.length>e))).chain(this.checkConstraint("minLines",((t,e)=>de.getLines(t).length<e))).chain(this.checkConstraint("maxLines",((t,e)=>de.getLines(t).length>e))).chain(this.checkConstraint("minLengthPerLine",((t,e)=>de.getLineLengthBy(ie,t)<e))).chain(this.checkConstraint("maxLengthPerLine",((t,e)=>de.getLineLengthBy(oe,t)>e)))}}de.getLines=t=>t.split(/(\r\n|\r|\n)/).filter((t=>"\n"!==t)),de.getLineLengthBy=(t,e)=>de.getLines(e).map((t=>t.length)).reduce(t);class ge extends fe{constructor(t){super(t),this.validate=t=>super.validate(t).chain(this.checkIsNumber).chain(this.checkConstraint("isInteger",((t,e)=>e&&!Number.isInteger(t)))).chain(this.checkConstraint("min",ae)).chain(this.checkConstraint("max",se)),this.checkIsNumber=t=>isNaN(Number(t))?Object(wt.Left)(new Pt(this._field.name,bt.numberIsNumber,`The ${he.getFieldDisplayName(this._field)} field value ${t} is not a number.`)):Object(wt.Right)(Number(t)),this._config=vt.getNumberConfig(t)}findConstraintByRuleName(t){var e,n;return(null!==(n=null===(e=this._config)||void 0===e?void 0:e.constraints)&&void 0!==n?n:[]).find((e=>e.rule.oneofKind==t))}}class me{constructor(t){this._config=vt.getVariantConfig(t),this._field=t}validate(t){var e;return(null===(e=this._config)||void 0===e?void 0:e.variants.every((e=>e.value!=t)))?Object(wt.Left)(Ct.fromField(this._field,this._config,t,null)):Object(wt.Right)(t)}}class ye{constructor(t){this._config=vt.getImageConfig(t),this._field=t}validate(t){var e,n;let r=null!==(n=null===(e=this._config)||void 0===e?void 0:e.root)&&void 0!==n?n:"/";return r.startsWith("/")||(r=`/${r}`),t.startsWith(r)?Object(wt.Right)(t):Object(wt.Left)(Ct.fromField(this._field,this._config,t,null))}}class _e{constructor(t){this._config=vt.getGS1Config(t),this._field=t}validate(t){try{return ue.parse(t).validate(this._config).cata((e=>Object(wt.Left)(Ct.fromField(this._field,this._config,t,null,e))),(e=>Object(wt.Right)(t)))}catch(e){return Object(wt.Left)(Ct.fromField(this._field,this._config,t,null,[e]))}}}class ve{constructor(t){this.interpolateString=(t,e)=>t.replace(/{([^}]+)}/g,((t,n)=>{var r;return null!==(r=e[n])&&void 0!==r?r:""})),this.schema=t}validateValue(t,e){return this.findFieldByName(t).map((t=>new he(t))).toEither(new Pt(t,bt.noSuchField,`The ${t} field does not exist in a schema.`)).bind((n=>n.validate({[t]:e}))).cata((t=>t),(e=>new Lt(t)))}validate(t){var e;return(null!==(e=this.schema.fields)&&void 0!==e?e:[]).map((e=>new he(e).validate(t))).map((t=>t.cata((t=>t),(t=>new Lt(t)))))}buildTitle(t){return this.interpolateString(this.schema.titleTemplate,t)}findFieldByName(t){return wt.Maybe.fromNull(this.schema.fields.find((e=>e.name===t)))}}const be=new class extends J{constructor(){super("Schema",[{no:2,name:"titleTemplate",kind:"scalar",T:9},{no:3,name:"fields",kind:"message",repeat:1,T:()=>we}])}create(t){const e={titleTemplate:"",fields:[]};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 2:i.titleTemplate=t.string();break;case 3:i.fields.push(we.internalBinaryRead(t,t.uint32(),n));break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){""!==t.titleTemplate&&e.tag(2,O.LengthDelimited).string(t.titleTemplate);for(let i=0;i<t.fields.length;i++)we.internalBinaryWrite(t.fields[i],e.tag(3,O.LengthDelimited).fork(),n).join();let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}},we=new class extends J{constructor(){super("Field",[{no:1,name:"name",kind:"scalar",T:9},{no:2,name:"required",kind:"scalar",opt:!0,T:8},{no:3,name:"string",kind:"message",oneof:"config",T:()=>lt},{no:4,name:"variant",kind:"message",oneof:"config",T:()=>yt},{no:5,name:"number",kind:"message",oneof:"config",T:()=>rt},{no:9,name:"image",kind:"message",oneof:"config",T:()=>nt},{no:10,name:"gs1",kind:"message",oneof:"config",T:()=>Q},{no:6,name:"title",kind:"scalar",opt:!0,T:9},{no:7,name:"prompt",kind:"scalar",opt:!0,T:9},{no:8,name:"description",kind:"scalar",opt:!0,T:9}])}create(t){const e={name:"",config:{oneofKind:void 0}};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.name=t.string();break;case 2:i.required=t.bool();break;case 3:i.config={oneofKind:"string",string:lt.internalBinaryRead(t,t.uint32(),n,i.config.string)};break;case 4:i.config={oneofKind:"variant",variant:yt.internalBinaryRead(t,t.uint32(),n,i.config.variant)};break;case 5:i.config={oneofKind:"number",number:rt.internalBinaryRead(t,t.uint32(),n,i.config.number)};break;case 9:i.config={oneofKind:"image",image:nt.internalBinaryRead(t,t.uint32(),n,i.config.image)};break;case 10:i.config={oneofKind:"gs1",gs1:Q.internalBinaryRead(t,t.uint32(),n,i.config.gs1)};break;case 6:i.title=t.string();break;case 7:i.prompt=t.string();break;case 8:i.description=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){""!==t.name&&e.tag(1,O.LengthDelimited).string(t.name),void 0!==t.required&&e.tag(2,O.Varint).bool(t.required),"string"===t.config.oneofKind&<.internalBinaryWrite(t.config.string,e.tag(3,O.LengthDelimited).fork(),n).join(),"variant"===t.config.oneofKind&&yt.internalBinaryWrite(t.config.variant,e.tag(4,O.LengthDelimited).fork(),n).join(),"number"===t.config.oneofKind&&rt.internalBinaryWrite(t.config.number,e.tag(5,O.LengthDelimited).fork(),n).join(),"image"===t.config.oneofKind&&nt.internalBinaryWrite(t.config.image,e.tag(9,O.LengthDelimited).fork(),n).join(),"gs1"===t.config.oneofKind&&Q.internalBinaryWrite(t.config.gs1,e.tag(10,O.LengthDelimited).fork(),n).join(),void 0!==t.title&&e.tag(6,O.LengthDelimited).string(t.title),void 0!==t.prompt&&e.tag(7,O.LengthDelimited).string(t.prompt),void 0!==t.description&&e.tag(8,O.LengthDelimited).string(t.description);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}};new class extends J{constructor(){super("DataSet",[{no:1,name:"embedded",kind:"message",oneof:"schema",T:()=>be},{no:3,name:"linked",kind:"scalar",oneof:"schema",T:9},{no:2,name:"rows",kind:"message",repeat:1,T:()=>Ce},{no:4,name:"schemaName",kind:"scalar",opt:!0,T:9}])}create(t){const e={schema:{oneofKind:void 0},rows:[]};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();switch(e){case 1:i.schema={oneofKind:"embedded",embedded:be.internalBinaryRead(t,t.uint32(),n,i.schema.embedded)};break;case 3:i.schema={oneofKind:"linked",linked:t.string()};break;case 2:i.rows.push(Ce.internalBinaryRead(t,t.uint32(),n));break;case 4:i.schemaName=t.string();break;default:let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}internalBinaryWrite(t,e,n){"embedded"===t.schema.oneofKind&&be.internalBinaryWrite(t.schema.embedded,e.tag(1,O.LengthDelimited).fork(),n).join(),"linked"===t.schema.oneofKind&&e.tag(3,O.LengthDelimited).string(t.schema.linked);for(let i=0;i<t.rows.length;i++)Ce.internalBinaryWrite(t.rows[i],e.tag(2,O.LengthDelimited).fork(),n).join();void 0!==t.schemaName&&e.tag(4,O.LengthDelimited).string(t.schemaName);let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}};const Ce=new class extends J{constructor(){super("Row",[{no:1,name:"cells",kind:"map",K:9,V:{kind:"scalar",T:9}}])}create(t){const e={cells:{}};return void 0!==t&&E(this,e,t),e}internalBinaryRead(t,e,n,r){let i=null!=r?r:this.create(),o=t.pos+e;for(;t.pos<o;){let[e,r]=t.tag();if(1===e)this.binaryReadMap1(i.cells,t,n);else{let o=n.readUnknownField;if("throw"===o)throw new globalThis.Error(`Unknown field ${e} (wire type ${r}) for ${this.typeName}`);let a=t.skip(r);!1!==o&&(!0===o?S.onRead:o)(this.typeName,i,e,r,a)}}return i}binaryReadMap1(t,e,n){let r,i,o=e.uint32(),a=e.pos+o;for(;e.pos<a;){let[t,n]=e.tag();switch(t){case 1:r=e.string();break;case 2:i=e.string();break;default:throw new globalThis.Error("unknown map entry field for field Row.cells")}}t[null!=r?r:""]=null!=i?i:""}internalBinaryWrite(t,e,n){for(let i of Object.keys(t.cells))e.tag(1,O.LengthDelimited).fork().tag(1,O.LengthDelimited).string(i).tag(2,O.LengthDelimited).string(t.cells[i]).join();let r=n.writeUnknownFields;return!1!==r&&(1==r?S.onWrite:r)(this.typeName,t,e),e}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return Ht})),n.d(e,"b",(function(){return Wt}));var r=n(418),i=n(813),o=n(530);function a(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function s(t,e){this._pairs=[],t&&Object(o.a)(t,this,e)}const l=s.prototype;l.append=function(t,e){this._pairs.push([t,e])},l.toString=function(t){const e=t?function(e){return t.call(this,e,a)}:a;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var u=s;function c(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function h(t,e,n){if(!e)return t;const i=n&&n.encode||c,o=n&&n.serialize;let a;if(a=o?o(e,n):r.a.isURLSearchParams(e)?e.toString():new u(e,n).toString(i),a){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+a}return t}var p=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){r.a.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},f=n(445),d={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},g={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:u,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},m=function(t){function e(t,n,i,o){let a=t[o++];const s=Number.isFinite(+a),l=o>=t.length;return a=!a&&r.a.isArray(i)?i.length:a,l?(r.a.hasOwnProp(i,a)?i[a]=[i[a],n]:i[a]=n,!s):(i[a]&&r.a.isObject(i[a])||(i[a]=[]),e(t,n,i[a],o)&&r.a.isArray(i[a])&&(i[a]=function(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}(i[a])),!s)}if(r.a.isFormData(t)&&r.a.isFunction(t.entries)){const n={};return r.a.forEachEntry(t,((t,i)=>{e(function(t){return r.a.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),i,n,0)})),n}return null};const y={"Content-Type":void 0},_={transitional:d,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",i=n.indexOf("application/json")>-1,a=r.a.isObject(t);if(a&&r.a.isHTMLForm(t)&&(t=new FormData(t)),r.a.isFormData(t))return i&&i?JSON.stringify(m(t)):t;if(r.a.isArrayBuffer(t)||r.a.isBuffer(t)||r.a.isStream(t)||r.a.isFile(t)||r.a.isBlob(t))return t;if(r.a.isArrayBufferView(t))return t.buffer;if(r.a.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Object(o.a)(t,new g.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,i){return g.isNode&&r.a.isBuffer(t)?(this.append(e,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((s=r.a.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Object(o.a)(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return a||i?(e.setContentType("application/json",!1),function(t){if(r.a.isString(t))try{return(0,JSON.parse)(t),r.a.trim(t)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||_.transitional,n=e&&e.forcedJSONParsing,i="json"===this.responseType;if(t&&r.a.isString(t)&&(n&&!this.responseType||i)){const n=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(n){if("SyntaxError"===o.name)throw f.a.from(o,f.a.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:g.classes.FormData,Blob:g.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.a.forEach(["delete","get","head"],(function(t){_.headers[t]={}})),r.a.forEach(["post","put","patch"],(function(t){_.headers[t]=r.a.merge(y)}));var v=_;const b=r.a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),w=Symbol("internals");function C(t){return t&&String(t).trim().toLowerCase()}function P(t){return!1===t||null==t?t:r.a.isArray(t)?t.map(P):String(t)}function S(t,e,n,i,o){return r.a.isFunction(i)?i.call(this,e,n):(o&&(e=n),r.a.isString(e)?r.a.isString(i)?-1!==e.indexOf(i):r.a.isRegExp(i)?i.test(e):void 0:void 0)}class x{constructor(t){t&&this.set(t)}set(t,e,n){const i=this;function o(t,e,n){const o=C(e);if(!o)throw new Error("header name must be a non-empty string");const a=r.a.findKey(i,o);(!a||void 0===i[a]||!0===n||void 0===n&&!1!==i[a])&&(i[a||e]=P(t))}const a=(t,e)=>r.a.forEach(t,((t,n)=>o(t,n,e)));return r.a.isPlainObject(t)||t instanceof this.constructor?a(t,e):r.a.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z]+$/.test(t.trim())?a((t=>{const e={};let n,r,i;return t&&t.split("\n").forEach((function(t){i=t.indexOf(":"),n=t.substring(0,i).trim().toLowerCase(),r=t.substring(i+1).trim(),!n||e[n]&&b[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e):null!=t&&o(e,t,n),this}get(t,e){if(t=C(t)){const n=r.a.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(r.a.isFunction(e))return e.call(this,t,n);if(r.a.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=C(t)){const n=r.a.findKey(this,t);return!(!n||void 0===this[n]||e&&!S(0,this[n],n,e))}return!1}delete(t,e){const n=this;let i=!1;function o(t){if(t=C(t)){const o=r.a.findKey(n,t);!o||e&&!S(0,n[o],o,e)||(delete n[o],i=!0)}}return r.a.isArray(t)?t.forEach(o):o(t),i}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const i=e[n];t&&!S(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}normalize(t){const e=this,n={};return r.a.forEach(this,((i,o)=>{const a=r.a.findKey(n,o);if(a)return e[a]=P(i),void delete e[o];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete e[o],e[s]=P(i),n[s]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return r.a.forEach(this,((n,i)=>{null!=n&&!1!==n&&(e[i]=t&&r.a.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[w]=this[w]={accessors:{}}).accessors,n=this.prototype;function i(t){const i=C(t);e[i]||(function(t,e){const n=r.a.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[i]=!0)}return r.a.isArray(t)?t.forEach(i):i(t),this}}x.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),r.a.freezeMethods(x.prototype),r.a.freezeMethods(x);var I=x;function O(t,e){const n=this||v,i=e||n,o=I.from(i.headers);let a=i.data;return r.a.forEach(t,(function(t){a=t.call(n,a,o.normalize(),e?e.status:void 0)})),o.normalize(),a}function T(t){return!(!t||!t.__CANCEL__)}function L(t,e,n){f.a.call(this,null==t?"canceled":t,f.a.ERR_CANCELED,e,n),this.name="CanceledError"}r.a.inherits(L,f.a,{__CANCEL__:!0});var R=L,E=n(814),j=g.isStandardBrowserEnv?function(){return{write:function(t,e,n,i,o,a){const s=[];s.push(t+"="+encodeURIComponent(e)),r.a.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.a.isString(i)&&s.push("path="+i),r.a.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function N(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}var k=g.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function i(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=i(window.location.href),function(t){const e=r.a.isString(t)?i(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return function(){return!0}}();function A(t,e){let n=0;const r=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i,o=0,a=0;return e=void 0!==e?e:1e3,function(s){const l=Date.now(),u=r[a];i||(i=l),n[o]=s,r[o]=l;let c=a,h=0;for(;c!==o;)h+=n[c++],c%=t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),l-i<e)return;const p=u&&l-u;return p?Math.round(1e3*h/p):void 0}}(50,250);return i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-n,l=r(s);n=o;const u={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&o<=a?(a-o)/l:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}var F="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){let i=t.data;const o=I.from(t.headers).normalize(),a=t.responseType;let s;function l(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}r.a.isFormData(i)&&(g.isStandardBrowserEnv||g.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let u=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",n=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+n))}const c=N(t.baseURL,t.url);function p(){if(!u)return;const r=I.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new f.a("Request failed with status code "+n.status,[f.a.ERR_BAD_REQUEST,f.a.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}((function(t){e(t),l()}),(function(t){n(t),l()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:t,request:u}),u=null}if(u.open(t.method.toUpperCase(),h(c,t.params,t.paramsSerializer),!0),u.timeout=t.timeout,"onloadend"in u?u.onloadend=p:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(p)},u.onabort=function(){u&&(n(new f.a("Request aborted",f.a.ECONNABORTED,t,u)),u=null)},u.onerror=function(){n(new f.a("Network Error",f.a.ERR_NETWORK,t,u)),u=null},u.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||d;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new f.a(e,r.clarifyTimeoutError?f.a.ETIMEDOUT:f.a.ECONNABORTED,t,u)),u=null},g.isStandardBrowserEnv){const e=(t.withCredentials||k(c))&&t.xsrfCookieName&&j.read(t.xsrfCookieName);e&&o.set(t.xsrfHeaderName,e)}void 0===i&&o.setContentType(null),"setRequestHeader"in u&&r.a.forEach(o.toJSON(),(function(t,e){u.setRequestHeader(e,t)})),r.a.isUndefined(t.withCredentials)||(u.withCredentials=!!t.withCredentials),a&&"json"!==a&&(u.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&u.addEventListener("progress",A(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",A(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=e=>{u&&(n(!e||e.type?new R(null,t,u):e),u.abort(),u=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));const m=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(c);m&&-1===g.protocols.indexOf(m)?n(new f.a("Unsupported protocol "+m+":",f.a.ERR_BAD_REQUEST,t)):u.send(i||null)}))};const B={http:E.a,xhr:F};r.a.forEach(B,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(n){}Object.defineProperty(t,"adapterName",{value:e})}}));function M(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new R(null,t)}function z(t){return M(t),t.headers=I.from(t.headers),t.data=O.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),(t=>{t=r.a.isArray(t)?t:[t];const{length:e}=t;let n,i;for(let o=0;o<e&&(n=t[o],!(i=r.a.isString(n)?B[n.toLowerCase()]:n));o++);if(!i){if(!1===i)throw new f.a(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(r.a.hasOwnProp(B,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!r.a.isFunction(i))throw new TypeError("adapter is not a function");return i})(t.adapter||v.adapter)(t).then((function(e){return M(t),e.data=O.call(t,t.transformResponse,e),e.headers=I.from(e.headers),e}),(function(e){return T(e)||(M(t),e&&e.response&&(e.response.data=O.call(t,t.transformResponse,e.response),e.response.headers=I.from(e.response.headers))),Promise.reject(e)}))}const D=t=>t instanceof I?t.toJSON():t;function H(t,e){e=e||{};const n={};function i(t,e,n){return r.a.isPlainObject(t)&&r.a.isPlainObject(e)?r.a.merge.call({caseless:n},t,e):r.a.isPlainObject(e)?r.a.merge({},e):r.a.isArray(e)?e.slice():e}function o(t,e,n){return r.a.isUndefined(e)?r.a.isUndefined(t)?void 0:i(void 0,t,n):i(t,e,n)}function a(t,e){if(!r.a.isUndefined(e))return i(void 0,e)}function s(t,e){return r.a.isUndefined(e)?r.a.isUndefined(t)?void 0:i(void 0,t):i(void 0,e)}function l(n,r,o){return o in e?i(n,r):o in t?i(void 0,n):void 0}const u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(t,e)=>o(D(t),D(e),!0)};return r.a.forEach(Object.keys(t).concat(Object.keys(e)),(function(i){const a=u[i]||o,s=a(t[i],e[i],i);r.a.isUndefined(s)&&a!==l||(n[i]=s)})),n}const U={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{U[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const W={};U.transitional=function(t,e,n){function r(t,e){return"[Axios v1.3.4] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,i,o)=>{if(!1===t)throw new f.a(r(i," has been removed"+(e?" in "+e:"")),f.a.ERR_DEPRECATED);return e&&!W[i]&&(W[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,o)}};var V={assertOptions:function(t,e,n){if("object"!=typeof t)throw new f.a("options must be an object",f.a.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],a=e[o];if(a){const e=t[o],n=void 0===e||a(e,o,t);if(!0!==n)throw new f.a("option "+o+" must be "+n,f.a.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new f.a("Unknown option "+o,f.a.ERR_BAD_OPTION)}},validators:U};const q=V.validators;class G{constructor(t){this.defaults=t,this.interceptors={request:new p,response:new p}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=H(this.defaults,e);const{transitional:n,paramsSerializer:i,headers:o}=e;let a;void 0!==n&&V.assertOptions(n,{silentJSONParsing:q.transitional(q.boolean),forcedJSONParsing:q.transitional(q.boolean),clarifyTimeoutError:q.transitional(q.boolean)},!1),void 0!==i&&V.assertOptions(i,{encode:q.function,serialize:q.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),a=o&&r.a.merge(o.common,o[e.method]),a&&r.a.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=I.concat(a,o);const s=[];let l=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(l=l&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let h,p=0;if(!l){const t=[z.bind(this),void 0];for(t.unshift.apply(t,s),t.push.apply(t,u),h=t.length,c=Promise.resolve(e);p<h;)c=c.then(t[p++],t[p++]);return c}h=s.length;let f=e;for(p=0;p<h;){const t=s[p++],e=s[p++];try{f=t(f)}catch(d){e.call(this,d);break}}try{c=z.call(this,f)}catch(d){return Promise.reject(d)}for(p=0,h=u.length;p<h;)c=c.then(u[p++],u[p++]);return c}getUri(t){return h(N((t=H(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}r.a.forEach(["delete","get","head","options"],(function(t){G.prototype[t]=function(e,n){return this.request(H(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.a.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request(H(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}G.prototype[t]=e(),G.prototype[t+"Form"]=e(!0)}));var $=G;class X{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,i){n.reason||(n.reason=new R(t,r,i),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new X((function(e){t=e})),cancel:t}}}var K=X;const Y={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Y).forEach((([t,e])=>{Y[e]=t}));var J=Y;const Z=function t(e){const n=new $(e),o=Object(i.a)($.prototype.request,n);return r.a.extend(o,$.prototype,n,{allOwnKeys:!0}),r.a.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return t(H(e,n))},o}(v);Z.Axios=$,Z.CanceledError=R,Z.CancelToken=K,Z.isCancel=T,Z.VERSION="1.3.4",Z.toFormData=o.a,Z.AxiosError=f.a,Z.Cancel=Z.CanceledError,Z.all=function(t){return Promise.all(t)},Z.spread=function(t){return function(e){return t.apply(null,e)}},Z.isAxiosError=function(t){return r.a.isObject(t)&&!0===t.isAxiosError},Z.mergeConfig=H,Z.AxiosHeaders=I,Z.formToJSON=t=>m(r.a.isHTMLForm(t)?new FormData(t):t),Z.HttpStatusCode=J,Z.default=Z;var Q,tt,et,nt,rt,it,ot,at,st,lt,ut,ct,ht,pt,ft,dt,gt,mt,yt,_t,vt,bt,wt,Ct,Pt,St,xt,It,Ot,Tt,Lt=Z,Rt=Object.defineProperty,Et=Object.defineProperties,jt=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,Ft=(t,e,n)=>e in t?Rt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Bt=(t,e)=>{for(var n in e||(e={}))kt.call(e,n)&&Ft(t,n,e[n]);if(Nt)for(var n of Nt(e))At.call(e,n)&&Ft(t,n,e[n]);return t},Mt=(t,e)=>Et(t,jt(e)),zt=(t,e,n)=>Ft(t,"symbol"!=typeof e?e+"":e,n),Dt=(t,e,n)=>new Promise(((r,i)=>{var o=t=>{try{s(n.next(t))}catch(e){i(e)}},a=t=>{try{s(n.throw(t))}catch(e){i(e)}},s=t=>t.done?r(t.value):Promise.resolve(t.value).then(o,a);s((n=n.apply(t,e)).next())}));class Ht{constructor(){zt(this,"apiUrl"),zt(this,"apiKey",""),zt(this,"authorizationToken",null)}getAuthorizationToken(){return Dt(this,null,(function*(){return this.authorizationToken}))}setAuthorizationToken(t){this.authorizationToken=t}}class Ut{constructor(t){zt(this,"configuration"),this.configuration=t}transformOptions(t){return Dt(this,null,(function*(){const e=yield this.configuration.getAuthorizationToken();return t.headers=Mt(Bt({},t.headers),null!=e?{authorization:" Bearer "+e}:{"X-API-Key":this.configuration.apiKey}),(t=Mt(Bt({},t),{transformResponse:t=>t})).responseType||(t.responseType="json"),"blob"==t.responseType&&(t.responseType="arraybuffer"),t}))}getBaseUrl(t){return this.configuration.apiUrl.endsWith("/")?this.configuration.apiUrl.slice(0,-1):this.configuration.apiUrl}transformResult(t,e,n){return n(e)}}class Wt extends Ut{constructor(t,e,n){super(t),zt(this,"instance"),zt(this,"baseUrl"),zt(this,"jsonParseReviver"),this.instance=n||Lt.create(),this.baseUrl=null!=e?e:this.getBaseUrl("")}check(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/{id}/check?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(i=i.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(i+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(i+="ownerId="+encodeURIComponent(""+n)+"&"),i=i.replace(/[?&]$/,"");let o={method:"POST",url:i,headers:{Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processCheck(t)))))}processCheck(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}getDepositPhotos(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/{id}/depositphotos?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(i=i.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(i+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(i+="ownerId="+encodeURIComponent(""+n)+"&"),i=i.replace(/[?&]$/,"");let o={method:"POST",url:i,headers:{Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processGetDepositPhotos(t)))))}processGetDepositPhotos(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}exportDesign(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/{id}/export?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(i=i.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(i+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(i+="ownerId="+encodeURIComponent(""+n)+"&"),i=i.replace(/[?&]$/,"");let o={method:"GET",url:i,headers:{},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processExportDesign(t)))))}processExportDesign(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e)return t.data,Promise.resolve(null);if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}preparePreview(t,e,n,r,i,o,a,s,l,u,c,h){let p=this.baseUrl+"/api/processor/v1/private-designs/{id}/preview/{namespace}/{name}/{width}x{height}?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(p=p.replace("{id}",encodeURIComponent(""+t)),null==e)throw new Error("The parameter 'namespace' must be defined.");if(p=p.replace("{namespace}",encodeURIComponent(""+e)),null==n)throw new Error("The parameter 'name' must be defined.");if(p=p.replace("{name}",encodeURIComponent(""+n)),null==r)throw new Error("The parameter 'width' must be defined.");if(p=p.replace("{width}",encodeURIComponent(""+r)),null==i)throw new Error("The parameter 'height' must be defined.");if(p=p.replace("{height}",encodeURIComponent(""+i)),null!=o&&(p+="surfaceIndex="+encodeURIComponent(""+o)+"&"),null!=a&&(p+="stub="+encodeURIComponent(""+a)+"&"),null!=s&&(p+="format="+encodeURIComponent(""+s)+"&"),null===l)throw new Error("The parameter 'force' cannot be null.");if(void 0!==l&&(p+="force="+encodeURIComponent(""+l)+"&"),null===u)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==u&&(p+="tenantId="+encodeURIComponent(""+u)+"&"),null!=c&&(p+="ownerId="+encodeURIComponent(""+c)+"&"),p=p.replace(/[?&]$/,"");let f={responseType:"blob",method:"GET",url:p,headers:{Accept:"application/octet-stream"},cancelToken:h};return this.transformOptions(f).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(p,t,(t=>this.processPreparePreview(t)))))}processPreparePreview(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e||206===e){const r=t.headers?t.headers["content-disposition"]:void 0,i=r?/filename="?([^"]*?)"?(;|$)/g.exec(r):void 0,o=i&&i.length>1?i[1]:void 0;return Promise.resolve({fileName:o,status:e,data:new Blob([t.data]),headers:n})}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}preparePreviewUrl(t,e,n,r,i,o,a,s,l,u,c,h){let p=this.baseUrl+"/api/processor/v1/private-designs/{id}/preview/{namespace}/{name}/{width}x{height}/url?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(p=p.replace("{id}",encodeURIComponent(""+t)),null==e)throw new Error("The parameter 'namespace' must be defined.");if(p=p.replace("{namespace}",encodeURIComponent(""+e)),null==n)throw new Error("The parameter 'name' must be defined.");if(p=p.replace("{name}",encodeURIComponent(""+n)),null==r)throw new Error("The parameter 'width' must be defined.");if(p=p.replace("{width}",encodeURIComponent(""+r)),null==i)throw new Error("The parameter 'height' must be defined.");if(p=p.replace("{height}",encodeURIComponent(""+i)),null!=o&&(p+="surfaceIndex="+encodeURIComponent(""+o)+"&"),null!=a&&(p+="stub="+encodeURIComponent(""+a)+"&"),null!=s&&(p+="format="+encodeURIComponent(""+s)+"&"),null===l)throw new Error("The parameter 'force' cannot be null.");if(void 0!==l&&(p+="force="+encodeURIComponent(""+l)+"&"),null===u)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==u&&(p+="tenantId="+encodeURIComponent(""+u)+"&"),null!=c&&(p+="ownerId="+encodeURIComponent(""+c)+"&"),p=p.replace(/[?&]$/,"");let f={method:"GET",url:p,headers:{Accept:"application/json"},cancelToken:h};return this.transformOptions(f).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(p,t,(t=>this.processPreparePreviewUrl(t)))))}processPreparePreviewUrl(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}reimportDesign(t,e,n,r,i,o){let a=this.baseUrl+"/api/processor/v1/private-designs/{id}/re-import?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(a=a.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(a+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(a+="ownerId="+encodeURIComponent(""+n)+"&"),a=a.replace(/[?&]$/,"");const s=new FormData;if(null==r)throw new Error("The parameter 'sourceFile' cannot be null.");s.append("sourceFile",r.data,r.fileName?r.fileName:"sourceFile"),null!=i&&s.append("markerShortcutsFile",i.data,i.fileName?i.fileName:"markerShortcutsFile");let l={data:s,method:"POST",url:a,headers:{},cancelToken:o};return this.transformOptions(l).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(a,t,(t=>this.processReimportDesign(t)))))}processReimportDesign(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}embedDataSchema(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/{id}/schema/embed?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(i=i.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(i+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(i+="ownerId="+encodeURIComponent(""+n)+"&"),i=i.replace(/[?&]$/,"");let o={method:"POST",url:i,headers:{Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processEmbedDataSchema(t)))))}processEmbedDataSchema(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}extractDataSchema(t,e,n,r,i){let o=this.baseUrl+"/api/processor/v1/private-designs/{id}/schema/extract?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(o=o.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(o+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(o+="ownerId="+encodeURIComponent(""+n)+"&"),o=o.replace(/[?&]$/,"");let a={data:JSON.stringify(r),method:"POST",url:o,headers:{"Content-Type":"application/json"},cancelToken:i};return this.transformOptions(a).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(o,t,(t=>this.processExtractDataSchema(t)))))}processExtractDataSchema(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e)return t.data,Promise.resolve(null);if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}linkDataSchema(t,e,n,r,i){let o=this.baseUrl+"/api/processor/v1/private-designs/{id}/schema/link?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(o=o.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(o+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(o+="ownerId="+encodeURIComponent(""+n)+"&"),o=o.replace(/[?&]$/,"");let a={data:JSON.stringify(r),method:"POST",url:o,headers:{"Content-Type":"application/json",Accept:"application/json"},cancelToken:i};return this.transformOptions(a).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(o,t,(t=>this.processLinkDataSchema(t)))))}processLinkDataSchema(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}removeDataSchema(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/{id}/schema/remove?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(i=i.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(i+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(i+="ownerId="+encodeURIComponent(""+n)+"&"),i=i.replace(/[?&]$/,"");let o={method:"POST",url:i,headers:{Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processRemoveDataSchema(t)))))}processRemoveDataSchema(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}update(t,e,n,r,i,o,a,s){let l=this.baseUrl+"/api/processor/v1/private-designs/{id}/update?";if(null==t)throw new Error("The parameter 'id' must be defined.");if(l=l.replace("{id}",encodeURIComponent(""+t)),null===e)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==e&&(l+="tenantId="+encodeURIComponent(""+e)+"&"),null!=n&&(l+="ownerId="+encodeURIComponent(""+n)+"&"),l=l.replace(/[?&]$/,"");const u=new FormData;null!=r&&u.append("designParams.name",r.toString()),null!=i&&u.append("designParams.path",i.toString()),null!=o&&u.append("designParams.customFields",JSON.stringify(o)),null!=a&&u.append("file",a.data,a.fileName?a.fileName:"file");let c={data:u,method:"POST",url:l,headers:{Accept:"application/json"},cancelToken:s};return this.transformOptions(c).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(l,t,(t=>this.processUpdate(t)))))}processUpdate(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}createBlankDesign(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/blank?";if(null===t)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==t&&(i+="tenantId="+encodeURIComponent(""+t)+"&"),null!=e&&(i+="ownerId="+encodeURIComponent(""+e)+"&"),i=i.replace(/[?&]$/,"");let o={data:JSON.stringify(n),method:"POST",url:i,headers:{"Content-Type":"application/json",Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processCreateBlankDesign(t)))))}processCreateBlankDesign(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(201===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}copyDesignFromPublicDesign(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/from-design?";if(null===t)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==t&&(i+="tenantId="+encodeURIComponent(""+t)+"&"),null!=e&&(i+="ownerId="+encodeURIComponent(""+e)+"&"),i=i.replace(/[?&]$/,"");let o={data:JSON.stringify(n),method:"POST",url:i,headers:{"Content-Type":"application/json",Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processCopyDesignFromPublicDesign(t)))))}processCopyDesignFromPublicDesign(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(201===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}copyDesignFromPublicResource(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/from-resource?";if(null===t)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==t&&(i+="tenantId="+encodeURIComponent(""+t)+"&"),null!=e&&(i+="ownerId="+encodeURIComponent(""+e)+"&"),i=i.replace(/[?&]$/,"");let o={data:JSON.stringify(n),method:"POST",url:i,headers:{"Content-Type":"application/json",Accept:"application/json"},cancelToken:r};return this.transformOptions(o).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processCopyDesignFromPublicResource(t)))))}processCopyDesignFromPublicResource(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(201===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(404===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Not Found",e,r,n,i)}if(422===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Client Error",e,r,n,i)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}importDesign(t,e,n,r,i,o,a,s,l,u,c,h,p,f,d){let g=this.baseUrl+"/api/processor/v1/private-designs/import?";if(null===t)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==t&&(g+="tenantId="+encodeURIComponent(""+t)+"&"),null!=e&&(g+="ownerId="+encodeURIComponent(""+e)+"&"),g=g.replace(/[?&]$/,"");const m=new FormData;if(null!=n&&m.append("designParams.name",n.toString()),null!=r&&m.append("designParams.path",r.toString()),null!=i&&m.append("designParams.customFields",JSON.stringify(i)),null!=o&&m.append("previewSettings.makePreview",o.toString()),null!=a&&m.append("previewSettings.namespace",a.toString()),null!=s&&m.append("previewSettings.name",s.toString()),null!=l&&m.append("previewSettings.width",l.toString()),null!=u&&m.append("previewSettings.height",u.toString()),null!=c&&m.append("previewSettings.stub",c.toString()),null!=h&&m.append("previewSettings.format",h.toString()),null==p)throw new Error("The parameter 'sourceFile' cannot be null.");m.append("sourceFile",p.data,p.fileName?p.fileName:"sourceFile"),null!=f&&m.append("markerShortcutsFile",f.data,f.fileName?f.fileName:"markerShortcutsFile");let y={data:m,method:"POST",url:g,headers:{Accept:"application/json"},cancelToken:d};return this.transformOptions(y).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(g,t,(t=>this.processImportDesign(t)))))}processImportDesign(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(201===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}if(409===e){const r=t.data;let i=null,o=r;return i=JSON.parse(o),qt("Conflict",e,r,n,i)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}validateDesignImportSettings(t,e,n,r){let i=this.baseUrl+"/api/processor/v1/private-designs/validate-import-settings?";if(null===t)throw new Error("The parameter 'tenantId' cannot be null.");void 0!==t&&(i+="tenantId="+encodeURIComponent(""+t)+"&"),null!=e&&(i+="ownerId="+encodeURIComponent(""+e)+"&"),i=i.replace(/[?&]$/,"");const o=new FormData;null!=n&&o.append("markerShortcutsFile",n.data,n.fileName?n.fileName:"markerShortcutsFile");let a={data:o,method:"POST",url:i,headers:{Accept:"application/json"},cancelToken:r};return this.transformOptions(a).then((t=>this.instance.request(t))).catch((t=>{if(Gt(t)&&t.response)return t.response;throw t})).then((t=>this.transformResult(i,t,(t=>this.processValidateDesignImportSettings(t)))))}processValidateDesignImportSettings(t){const e=t.status;let n={};if(t.headers&&"object"==typeof t.headers)for(let r in t.headers)t.headers.hasOwnProperty(r)&&(n[r]=t.headers[r]);if(200===e){let e=null,n=t.data;return e=JSON.parse(n),Promise.resolve(e)}return 401===e?qt("Unauthorized",e,t.data,n):403===e?qt("Forbidden",e,t.data,n):200!==e&&204!==e?qt("An unexpected server error occurred.",e,t.data,n):Promise.resolve(null)}}(tt=Q||(Q={})).Unknown="Unknown",tt.Rgb="Rgb",tt.Grayscale="Grayscale",tt.Cmyk="Cmyk",tt.Lab="Lab",tt.Spot="Spot",(nt=et||(et={})).Unknown="Unknown",nt.Abstract="Abstract",nt.Link="Link",nt.Display="Display",nt.NamedColor="NamedColor",nt.Output="Output",nt.Input="Input",nt.ColorSpace="ColorSpace",(it=rt||(rt={})).Name="Name",it.FolderOverwrite="FolderOverwrite",(at=ot||(ot={})).Ok="Ok",at.Missing="Missing",at.Required="Required",at.NoSuchField="NoSuchField",at.StringPattern="StringPattern",at.StringMinLength="StringMinLength",at.StringMaxLength="StringMaxLength",at.StringMinLengthPerLine="StringMinLengthPerLine",at.StringMaxLengthPerLine="StringMaxLengthPerLine",at.StringMinLines="StringMinLines",at.StringMaxLines="StringMaxLines",at.NumberIsNumber="NumberIsNumber",at.NumberMin="NumberMin",at.NumberMax="NumberMax",at.NumberIsInteger="NumberIsInteger",at.VariantNotInList="VariantNotInList",at.ImageRoot="ImageRoot",at.ImageNotFound="ImageNotFound",(lt=st||(st={})).Jpeg="Jpeg",lt.Png="Png",(ct=ut||(ut={})).Png="Png",ct.Svg="Svg",(pt=ht||(ht={})).None="None",pt.Left="Left",pt.Center="Center",pt.Right="Right",pt.JustifyAll="JustifyAll",pt.JustifyLeft="JustifyLeft",pt.JustifyCenter="JustifyCenter",pt.JustifyRight="JustifyRight",(dt=ft||(ft={})).Top="Top",dt.Center="Center",dt.Baseline="Baseline",dt.Bottom="Bottom",(mt=gt||(gt={})).Fit="Fit",mt.Shrink="Shrink",mt.Resize="Resize",mt.Fill="Fill",(_t=yt||(yt={})).High="High",_t.Medium="Medium",_t.Low="Low",_t.NearestNeighbour="NearestNeighbour",_t.Linear="Linear",_t.Cubic="Cubic",_t.Supersampling="Supersampling",_t.Lanczos="Lanczos",_t.Anisotropic4="Anisotropic4",_t.Anisotropic9="Anisotropic9",_t.Lanczos3="Lanczos3",(bt=vt||(vt={})).Fit="Fit",bt.Shrink="Shrink",bt.Resize="Resize",bt.Fill="Fill",(Ct=wt||(wt={})).High="High",Ct.Medium="Medium",Ct.Low="Low",Ct.NearestNeighbour="NearestNeighbour",Ct.Linear="Linear",Ct.Cubic="Cubic",Ct.Supersampling="Supersampling",Ct.Lanczos="Lanczos",Ct.Anisotropic4="Anisotropic4",Ct.Anisotropic9="Anisotropic9",Ct.Lanczos3="Lanczos3",(St=Pt||(Pt={})).Psd="Psd",St.M3d="M3d",(It=xt||(xt={})).Mockup2D="Mockup2D",It.Mockup3D="Mockup3D",(Tt=Ot||(Ot={})).Mockup2D="Mockup2D",Tt.Mockup3D="Mockup3D";class Vt extends Error{constructor(t,e,n,r,i){super(),zt(this,"message"),zt(this,"status"),zt(this,"response"),zt(this,"headers"),zt(this,"result"),zt(this,"isApiException",!0),this.message=t,this.status=e,this.response=n,this.headers=r,this.result=i}static isApiException(t){return!0===t.isApiException}}function qt(t,e,n,r,i){throw null!=i?i:new Vt(t,e,n,r,null)}function Gt(t){return t&&!0===t.isAxiosError}},,function(t,e,n){"use strict";var r,i;n.d(e,"a",(function(){return a})),function(t){t[t.ModalOpen=0]="ModalOpen",t[t.ModalClose=1]="ModalClose",t[t.FullScreen=2]="FullScreen",t[t.FullWindow=3]="FullWindow",t[t.OriginalSize=4]="OriginalSize",t[t.AssetManagerOpened=5]="AssetManagerOpened",t[t.AssetManagerClosed=6]="AssetManagerClosed",t[t.RevertProduct=7]="RevertProduct",t[t.ObjectInspectorVisibilityChange=8]="ObjectInspectorVisibilityChange",t[t.OnSurfaceChanged=9]="OnSurfaceChanged",t[t.CanRedoChanged=10]="CanRedoChanged",t[t.CanUndoChanged=11]="CanUndoChanged",t[t.OnImageDpiChanged=12]="OnImageDpiChanged",t[t.PopupOpen=13]="PopupOpen",t[t.PrintAreaBoundsChanged=14]="PrintAreaBoundsChanged",t[t.UndoProduct=15]="UndoProduct",t[t.RedoProduct=16]="RedoProduct",t[t.UIElementStateChange=17]="UIElementStateChange",t[t.CustomButtonClicked=18]="CustomButtonClicked"}(r||(r={})),function(t){t[t.FullScreen=0]="FullScreen",t[t.FullWindow=1]="FullWindow",t[t.OriginalSize=2]="OriginalSize"}(i||(i={}));var o,a=function(){function t(){}return t.ModalOpen=r[r.ModalOpen],t.ModalClose=r[r.ModalClose],t.FullWindow=r[r.FullWindow],t.FullScreen=r[r.FullScreen],t.OriginalSize=r[r.OriginalSize],t.AssetManagerOpened=r[r.AssetManagerOpened],t.AssetManagerClosed=r[r.AssetManagerClosed],t.RevertProduct=r[r.RevertProduct],t.OnSurfaceChanged=r[r.OnSurfaceChanged],t.CanUndoChanged=r[r.CanUndoChanged],t.CanRedoChanged=r[r.CanRedoChanged],t.OnImageDpiChanged=r[r.OnImageDpiChanged],t.PopupOpen=r[r.PopupOpen],t.PrintAreaBoundsChanged=r[r.PrintAreaBoundsChanged],t.UndoProduct=r[r.UndoProduct],t.RedoProduct=r[r.RedoProduct],t.BoundsNotification="BoundsNotification",t.ItemChanged="ItemChanged",t.ItemAdded="ItemAdded",t.ItemRemoved="ItemRemoved",t.SelectedItemsChanged="SelectedItemsChanged",t.UIElementStateChange=r[r.UIElementStateChange],t.CustomButtonClicked=r[r.CustomButtonClicked],t}();!function(t){t[t.Event=0]="Event",t[t.ProcedureResponse=1]="ProcedureResponse"}(o||(o={}))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let i;const o=new Uint8Array(16);function a(){if(!i&&(i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!i))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(o)}const s=[];for(let l=0;l<256;++l)s.push((l+256).toString(16).slice(1));e.a=function(t,e,n){if(r.randomUUID&&!e&&!t)return r.randomUUID();const i=(t=t||{}).random||(t.rng||a)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=i[t];return e}return function(t,e=0){return(s[t[e+0]]+s[t[e+1]]+s[t[e+2]]+s[t[e+3]]+"-"+s[t[e+4]]+s[t[e+5]]+"-"+s[t[e+6]]+s[t[e+7]]+"-"+s[t[e+8]]+s[t[e+9]]+"-"+s[t[e+10]]+s[t[e+11]]+s[t[e+12]]+s[t[e+13]]+s[t[e+14]]+s[t[e+15]]).toLowerCase()}(i)}}])]);