module.exports = "(function(t,e,E){var n=E(5894),i=E(3219),s=E(8465).getFieldValue,S=E(9976);function I(t,e,E,s,S){this[i.FIELDS.NAME]=t,this[i.FIELDS.TYPE]=e,n.isString(E)&&E.trim().length>0&&(this[i.FIELDS.CATEGORY]=E),s&&n.keys(s).length>0&&(this[i.FIELDS.OPTIONS]=s),n.isUndefined(S)||(this[i.FIELDS.REVENUE]=S)}function r(t,e,E,s){this.eventBase=t,this[i.FIELDS.TIME]=e,n.isUndefined(E)||(this[i.FIELDS.SESSION_ID]=E),n.isUndefined(s)||(this[i.FIELDS.SESSION_INDEX]=s)}e._=I,I.prototype.digest=function(){var t=function(t,e){return encodeURIComponent(t)+\"=\"+encodeURIComponent(e)},e=[];if(e.push(t(i.FIELDS.NAME,this[i.FIELDS.NAME])),e.push(t(i.FIELDS.TYPE,this[i.FIELDS.TYPE])),this[i.FIELDS.CATEGORY]&&e.push(t(i.FIELDS.CATEGORY,this[i.FIELDS.CATEGORY])),this[i.FIELDS.REVENUE]&&e.push(t(i.FIELDS.REVENUE,this[i.FIELDS.REVENUE])),!this[i.FIELDS.OPTIONS])return e.join(\"&\");var E=this[i.FIELDS.OPTIONS]||{},s=n.filter(n.keys(E),(function(t){return E.hasOwnProperty(t)}));s=s.sort();for(var S=0;S<s.length;S++)e.push(t(s[S],E[s[S]]));return e.join(\"&\")},I.prototype.hash=function(){return this.hash_||(this.hash_=S.hashToHex(S.toByteString(this.digest()),S.Seed.BEHAVIOR_EVENT)),this.hash_},I.prototype.setHash=function(t){this.hash_=t},I.prototype.reHash=function(){this.hash_=null,this.hash()},I.prototype.equals=function(t){if(this.hash()!==t.hash()||this[i.FIELDS.NAME]!==t[i.FIELDS.NAME]||this[i.FIELDS.TYPE]!==t[i.FIELDS.TYPE]||this[i.FIELDS.CATEGORY]!==t[i.FIELDS.CATEGORY]||this[i.FIELDS.REVENUE]!==t[i.FIELDS.REVENUE])return!1;var e=this[i.FIELDS.OPTIONS]||{},E=t[i.FIELDS.OPTIONS]||{},s=n.filter(n.keys(e),(function(t){return e.hasOwnProperty(t)})),S=n.filter(n.keys(E),(function(t){return E.hasOwnProperty(t)}));if(s.length!==S.length)return!1;for(var I=0;I<s.length;I++){var r=s[I];if(!E.hasOwnProperty(r)||e[r]!==E[r])return!1}return!0},I.prototype.getValueOrDefault=function(t,e){var E=s(this,t);return n.isUndefined(E)?e:E},I.prototype.setFieldValue=function(t,e){t!==i.FIELDS.NAME&&t!==i.FIELDS.TYPE&&t!==i.FIELDS.CATEGORY&&t!==i.FIELDS.REVENUE&&t!==i.FIELDS.OPTIONS||(this[t]=e,this.reHash())},e.J=r,r.prototype.getValueOrDefault=function(t,e){if(0===t.length)return this;var E={};E[i.FIELDS.TIME]=this[i.FIELDS.TIME],E[i.FIELDS.SESSION_ID]=this[i.FIELDS.SESSION_ID],E[i.FIELDS.SESSION_INDEX]=this[i.FIELDS.SESSION_INDEX];var S=s(E,t);return n.isUndefined(S)?this.eventBase.getValueOrDefault(t,e):S},r.prototype.setFieldValue=function(t,e){t===i.FIELDS.TIME||t===i.FIELDS.SESSION_ID||t===i.FIELDS.SESSION_INDEX?this[t]=e:this.eventBase.setFieldValue(t,e)};var h={n:\"name\",y:\"type\",c:\"category\",r:\"revenue\",s:\"session_id\",o:\"tags\",si:\"session_index\"};r.prototype.readableEvent=function(){var t,e,E=function(t){return n.isString(t)?'\"'+t+'\"':t},s=this,S=[];n.each([i.FIELDS.NAME,i.FIELDS.TYPE,i.FIELDS.CATEGORY,i.FIELDS.REVENUE,i.FIELDS.SESSION_ID],(function(i){t=h[i],e=s.getValueOrDefault([i]),n.isUndefined(e)||S.push(t+\": \"+E(e))}));var I=[];if(t=h[i.FIELDS.OPTIONS],e=s.getValueOrDefault([i.FIELDS.OPTIONS]),n.isUndefined(e)||(n.each(e,(function(t,e){I.push(e+\": \"+String(E(t)))})),S.push(t+\": {\\n\\t\\t\"+I.join(\",\\n\\t\\t\")+\"\\n\\t}\")),e=s.getValueOrDefault([i.FIELDS.TIME]),n.isNumber(e)&&(e=E(new Date(e).toString())),!n.isUndefined(e)){S.push(\"timestamp: \"+e)}return\"{\\n\\t\"+S.join(\",\\n\\t\")+\"\\n}\"},r.prototype.toObject=function(t){var e,E,s={},S=this;n.each([i.FIELDS.NAME,i.FIELDS.TYPE,i.FIELDS.CATEGORY,i.FIELDS.REVENUE,i.FIELDS.OPTIONS,i.FIELDS.SESSION_INDEX],(function(t){e=h[t],E=S.getValueOrDefault([t],t===i.FIELDS.OPTIONS?{}:void 0),n.isUndefined(E)||(s[e]=E)}));var I=h[i.FIELDS.OPTIONS],r=h[i.FIELDS.REVENUE];if(t&&t.revenueAsTag&&s[r]&&(s[I]=s[I]||{},s[I][r]=s[r],delete s[r]),E=S.getValueOrDefault([i.FIELDS.TIME]),n.isNumber(E))if(t&&t.timeAsTimestamp){s.timestamp=new Date(E)}else{s.time=E}return s}})";