/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../chunks/_rollupPluginBabelHelpers","../chunks/tslib.es6","../Color","../core/lang","../core/screenUtils","../core/accessorSupport/decorators/property","../core/accessorSupport/decorators/cast","../core/accessorSupport/decorators/enumeration","../core/accessorSupport/decorators/subclass","../core/accessorSupport/decorators/writer","./Font","./Symbol","./support/textUtils"],(function(t,e,o,r,i,n,l,s,p,h,a,c,d){"use strict";var y;let u=y=function(e){function o(...t){var o;return(o=e.call(this,...t)||this).backgroundColor=null,o.borderLineColor=null,o.borderLineSize=null,o.font=new a,o.horizontalAlignment="center",o.kerning=!0,o.haloColor=null,o.haloSize=null,o.rightToLeft=null,o.rotated=!1,o.text="",o.type="text",o.verticalAlignment="baseline",o.xoffset=0,o.yoffset=0,o.angle=0,o.width=null,o.lineWidth=192,o.lineHeight=1,o}t._inheritsLoose(o,e);var n=o.prototype;return n.normalizeCtorArgs=function(t,e,o){if(t&&"string"!=typeof t)return t;const r={};return t&&(r.text=t),e&&(r.font=e),o&&(r.color=o),r},n.writeLineWidth=function(t,e,o,r){r&&"string"!=typeof r?r.origin:e[o]=t},n.castLineWidth=function(t){return i.toPt(t)},n.writeLineHeight=function(t,e,o,r){r&&"string"!=typeof r?r.origin:e[o]=t},n.clone=function(){return new y({angle:this.angle,backgroundColor:r.clone(this.backgroundColor),borderLineColor:r.clone(this.borderLineColor),borderLineSize:this.borderLineSize,color:r.clone(this.color),font:this.font&&this.font.clone(),haloColor:r.clone(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})},n.hash=function(){return`${this.backgroundColor&&this.backgroundColor.hash()}.${this.borderLineColor}.${this.borderLineSize}.${this.color.hash()}.${this.font&&this.font.hash()}.${this.haloColor&&this.haloColor.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`},o}(c);e.__decorate([n.property({type:o,json:{write:!0}})],u.prototype,"backgroundColor",void 0),e.__decorate([n.property({type:o,json:{write:!0}})],u.prototype,"borderLineColor",void 0),e.__decorate([n.property({type:Number,json:{write:!0}})],u.prototype,"borderLineSize",void 0),e.__decorate([n.property({type:a,json:{write:!0}})],u.prototype,"font",void 0),e.__decorate([n.property({...d.horizontalAlignmentProperty,json:{write:!0}})],u.prototype,"horizontalAlignment",void 0),e.__decorate([n.property({type:Boolean,json:{write:!0}})],u.prototype,"kerning",void 0),e.__decorate([n.property({type:o,json:{write:!0}})],u.prototype,"haloColor",void 0),e.__decorate([n.property({type:Number,cast:i.toPt,json:{write:!0}})],u.prototype,"haloSize",void 0),e.__decorate([n.property({type:Boolean,json:{write:!0}})],u.prototype,"rightToLeft",void 0),e.__decorate([n.property({type:Boolean,json:{write:!0}})],u.prototype,"rotated",void 0),e.__decorate([n.property({type:String,json:{write:!0}})],u.prototype,"text",void 0),e.__decorate([s.enumeration({esriTS:"text"},{readOnly:!0})],u.prototype,"type",void 0),e.__decorate([n.property({...d.verticalAlignmentProperty,json:{write:!0}})],u.prototype,"verticalAlignment",void 0),e.__decorate([n.property({type:Number,cast:i.toPt,json:{write:!0}})],u.prototype,"xoffset",void 0),e.__decorate([n.property({type:Number,cast:i.toPt,json:{write:!0}})],u.prototype,"yoffset",void 0),e.__decorate([n.property({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],u.prototype,"angle",void 0),e.__decorate([n.property({type:Number,json:{write:!0}})],u.prototype,"width",void 0),e.__decorate([n.property({type:Number})],u.prototype,"lineWidth",void 0),e.__decorate([h.writer("lineWidth")],u.prototype,"writeLineWidth",null),e.__decorate([l.cast("lineWidth")],u.prototype,"castLineWidth",null),e.__decorate([n.property(d.lineHeightProperty)],u.prototype,"lineHeight",void 0),e.__decorate([h.writer("lineHeight")],u.prototype,"writeLineHeight",null),u=y=e.__decorate([p.subclass("esri.symbols.TextSymbol")],u);return u}));
