window.tec=window.tec||{},tec.classicEditorEventsState=tec.classicEditorEventsState||{},function(t,e){"use strict";const n=t(document);e.initialState={},e.getFieldValue=function(t){return t.val()},e.getFieldAttribute=function(t){return function(e){return e.attr(t)}},e.getFieldCountGtZero=function(t){return t.length>0},e.concatFieldValues=function(t){let e="";return t.not(":disabled").each((function(t,n){e+=n.value})),e},e.fieldsMap={startDate:{selector:"input#EventStartDate",valueGetter:e.getFieldValue},startTime:{selector:"input#EventStartTime",valueGetter:e.getFieldValue},endDate:{selector:"input#EventEndDate",valueGetter:e.getFieldValue},endTime:{selector:"input#EventEndTime",valueGetter:e.getFieldValue},timezone:{selector:"select#event-timezone",valueGetter:e.getFieldAttribute("data-timezone-value")},isRecurring:{selector:'[name="is_recurring[]"]',valueGetter:e.getFieldCountGtZero},recurrence:{selector:'.recurrence-row [name^="recurrence[rules]["]',valueGetter:e.concatFieldValues},exclusion:{selector:'.recurrence-row [name^="recurrence[exclusions]["]',valueGetter:e.concatFieldValues}},e.getCurrentState=function(){const n={};for(const r in e.fieldsMap){const i=e.fieldsMap[r].selector,a=e.fieldsMap[r].valueGetter;n[r]=a(t(i))}return n},e.isStateKeyDirty=function(t){if(!Object.prototype.hasOwnProperty.call(e.initialState,t))return!1;const n=e.getCurrentState();return e.initialState[t]!==n[t]},e.isAllStateKeysDirty=function(t){if(!Array.isArray(t))return!1;const n=e.getCurrentState();return t.reduce((function(t,r){return t&&Object.prototype.hasOwnProperty.call(e.initialState,r)?e.initialState[r]!==n[r]:t}),!0)},e.isOneOfStateKeysDirty=function(t){if(!Array.isArray(t))return!1;const n=e.getCurrentState();return t.reduce((function(t,r){return t||(Object.prototype.hasOwnProperty.call(e.initialState,r)?e.initialState[r]!==n[r]:t)}),!1)},e.isEventStateDirty=function(){const t=e.getCurrentState();return Object.keys(e.initialState).reduce((function(n,r){return n||e.initialState[r]!==t[r]}),!1)},e.setupInitialState=function(){e.initialState=e.getCurrentState()},e.ready=function(){n.on("TECClassicEditorEventsReady",e.setupInitialState)},t(e.ready)}(jQuery,tec.classicEditorEventsState),window.tec=window.tec||{},window.tec.eventsPro=window.tec.eventsPro||{},window.tec.eventsPro.customTablesV1=window.tec.eventsPro.customTablesV1||{},window.tec.eventsPro.customTablesV1.classicEditorEventsState={};