"use strict";(self.webpackChunk_flagship_io_js_sdk=self.webpackChunk_flagship_io_js_sdk||[]).push([[499],{6499:(e,t,s)=>{s.r(t),s.d(t,{CATEGORY_ERROR:()=>c,ERROR_MESSAGE:()=>l,Event:()=>h,VALUE_FIELD_ERROR:()=>u});var i=s(3641),a=s(1417),r=s(1358),o=s(2032),n=s(8068);const l="event category and event action are required",c="The category value must be either EventCategory::ACTION_TRACKING or EventCategory::ACTION_TRACKING",u="value must be an integer and be >= 0";class h extends n.HitAbstract{get category(){return this._category}set category(e){Object.values(o.EventCategory).includes(e)?this._category=e:(0,r.logError)(this.config,c,"category")}get action(){return this._action}set action(e){this.isNotEmptyString(e,"action")&&(this._action=e)}get label(){return this._label}set label(e){this.isNotEmptyString(e,"label")&&(this._label=e)}get value(){return this._value}set value(e){!Number.isInteger(e)||e<0?(0,r.logError)(this.config,u,"value"):this._value=e}constructor(e){super({type:a.HitType.EVENT,userIp:e.userIp,screenResolution:e.screenResolution,locale:e.locale,sessionNumber:e.sessionNumber,visitorId:e.visitorId,anonymousId:e.anonymousId,qaMode:e.qaMode,isActionTrackingHit:e.isActionTrackingHit});const{category:t,action:s,label:i,value:r}=e;this.category=t,this.action=s,i&&(this.label=i),r&&(this.value=r)}toApiKeys(){const e=super.toApiKeys();return e[i.EVENT_CATEGORY_API_ITEM]=this.category,e[i.EVENT_ACTION_API_ITEM]=this.action,this.label&&(e[i.EVENT_LABEL_API_ITEM]=this.label),this.value&&(e[i.EVENT_VALUE_API_ITEM]=this.value),e}toObject(){return{...super.toObject(),category:this.category,action:this.action,label:this.label,value:this.value}}isReady(){return!((!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&!super.isReady()||!this.category||!this.action)}getErrorMessage(){return l}}}}]);
//# sourceMappingURL=499.49b0b3df516d808304a2.js.map