/*! Simple Calendar - 3.4.4
 * https://simplecalendar.io
 * Copyright (c) Xtendify Technologies 2024
 * Licensed GPLv2+ */

(()=>{var ct=Object.create;var it=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,ht=Object.prototype.hasOwnProperty;var Q=(a,$)=>()=>($||a(($={exports:{}}).exports,$),$.exports);var mt=(a,$,U,W)=>{if($&&typeof $=="object"||typeof $=="function")for(let D of lt($))!ht.call(a,D)&&D!==U&&it(a,D,{get:()=>$[D],enumerable:!(W=ft($,D))||W.enumerable});return a};var G=(a,$,U)=>(U=a!=null?ct(dt(a)):{},mt($||!a||!a.__esModule?it(U,"default",{value:a,enumerable:!0}):U,a));var at=Q((K,R)=>{(function(a,$){typeof K=="object"&&typeof R<"u"?R.exports=$():typeof define=="function"&&define.amd?define($):(a=typeof globalThis<"u"?globalThis:a||self).dayjs=$()})(K,function(){"use strict";var a=1e3,$=6e4,U=36e5,W="millisecond",D="second",x="minute",y="hour",S="day",v="week",f="month",l="quarter",d="year",o="date",t="Invalid Date",r=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(u){var n=["th","st","nd","rd"],e=u%100;return"["+u+(n[(e-20)%10]||n[e]||n[0])+"]"}},p=function(u,n,e){var s=String(u);return!s||s.length>=n?u:""+Array(n+1-s.length).join(e)+u},_={s:p,z:function(u){var n=-u.utcOffset(),e=Math.abs(n),s=Math.floor(e/60),i=e%60;return(n<=0?"+":"-")+p(s,2,"0")+":"+p(i,2,"0")},m:function u(n,e){if(n.date()<e.date())return-u(e,n);var s=12*(e.year()-n.year())+(e.month()-n.month()),i=n.clone().add(s,f),c=e-i<0,m=n.clone().add(s+(c?-1:1),f);return+(-(s+(e-i)/(c?i-m:m-i))||0)},a:function(u){return u<0?Math.ceil(u)||0:Math.floor(u)},p:function(u){return{M:f,y:d,w:v,d:S,D:o,h:y,m:x,s:D,ms:W,Q:l}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(u){return u===void 0}},h="en",z={};z[h]=T;var k="$isDayjsObject",M=function(u){return u instanceof j||!(!u||!u[k])},C=function u(n,e,s){var i;if(!n)return h;if(typeof n=="string"){var c=n.toLowerCase();z[c]&&(i=c),e&&(z[c]=e,i=c);var m=n.split("-");if(!i&&m.length>1)return u(m[0])}else{var O=n.name;z[O]=n,i=O}return!s&&i&&(h=i),i||!s&&h},b=function(u,n){if(M(u))return u.clone();var e=typeof n=="object"?n:{};return e.date=u,e.args=arguments,new j(e)},g=_;g.l=C,g.i=M,g.w=function(u,n){return b(u,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var j=function(){function u(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[k]=!0}var n=u.prototype;return n.parse=function(e){this.$d=function(s){var i=s.date,c=s.utc;if(i===null)return new Date(NaN);if(g.u(i))return new Date;if(i instanceof Date)return new Date(i);if(typeof i=="string"&&!/Z$/i.test(i)){var m=i.match(r);if(m){var O=m[2]-1||0,Y=(m[7]||"0").substring(0,3);return c?new Date(Date.UTC(m[1],O,m[3]||1,m[4]||0,m[5]||0,m[6]||0,Y)):new Date(m[1],O,m[3]||1,m[4]||0,m[5]||0,m[6]||0,Y)}}return new Date(i)}(e),this.init()},n.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},n.$utils=function(){return g},n.isValid=function(){return this.$d.toString()!==t},n.isSame=function(e,s){var i=b(e);return this.startOf(s)<=i&&i<=this.endOf(s)},n.isAfter=function(e,s){return b(e)<this.startOf(s)},n.isBefore=function(e,s){return this.endOf(s)<b(e)},n.$g=function(e,s,i){return g.u(e)?this[s]:this.set(i,e)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(e,s){var i=this,c=!!g.u(s)||s,m=g.p(e),O=function(B,N){var Z=g.w(i.$u?Date.UTC(i.$y,N,B):new Date(i.$y,N,B),i);return c?Z:Z.endOf(S)},Y=function(B,N){return g.w(i.toDate()[B].apply(i.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(N)),i)},H=this.$W,L=this.$M,I=this.$D,P="set"+(this.$u?"UTC":"");switch(m){case d:return c?O(1,0):O(31,11);case f:return c?O(1,L):O(0,L+1);case v:var F=this.$locale().weekStart||0,J=(H<F?H+7:H)-F;return O(c?I-J:I+(6-J),L);case S:case o:return Y(P+"Hours",0);case y:return Y(P+"Minutes",1);case x:return Y(P+"Seconds",2);case D:return Y(P+"Milliseconds",3);default:return this.clone()}},n.endOf=function(e){return this.startOf(e,!1)},n.$set=function(e,s){var i,c=g.p(e),m="set"+(this.$u?"UTC":""),O=(i={},i[S]=m+"Date",i[o]=m+"Date",i[f]=m+"Month",i[d]=m+"FullYear",i[y]=m+"Hours",i[x]=m+"Minutes",i[D]=m+"Seconds",i[W]=m+"Milliseconds",i)[c],Y=c===S?this.$D+(s-this.$W):s;if(c===f||c===d){var H=this.clone().set(o,1);H.$d[O](Y),H.init(),this.$d=H.set(o,Math.min(this.$D,H.daysInMonth())).$d}else O&&this.$d[O](Y);return this.init(),this},n.set=function(e,s){return this.clone().$set(e,s)},n.get=function(e){return this[g.p(e)]()},n.add=function(e,s){var i,c=this;e=Number(e);var m=g.p(s),O=function(L){var I=b(c);return g.w(I.date(I.date()+Math.round(L*e)),c)};if(m===f)return this.set(f,this.$M+e);if(m===d)return this.set(d,this.$y+e);if(m===S)return O(1);if(m===v)return O(7);var Y=(i={},i[x]=$,i[y]=U,i[D]=a,i)[m]||1,H=this.$d.getTime()+e*Y;return g.w(H,this)},n.subtract=function(e,s){return this.add(-1*e,s)},n.format=function(e){var s=this,i=this.$locale();if(!this.isValid())return i.invalidDate||t;var c=e||"YYYY-MM-DDTHH:mm:ssZ",m=g.z(this),O=this.$H,Y=this.$m,H=this.$M,L=i.weekdays,I=i.months,P=i.meridiem,F=function(N,Z,E,V){return N&&(N[Z]||N(s,c))||E[Z].slice(0,V)},J=function(N){return g.s(O%12||12,N,"0")},B=P||function(N,Z,E){var V=N<12?"AM":"PM";return E?V.toLowerCase():V};return c.replace(w,function(N,Z){return Z||function(E){switch(E){case"YY":return String(s.$y).slice(-2);case"YYYY":return g.s(s.$y,4,"0");case"M":return H+1;case"MM":return g.s(H+1,2,"0");case"MMM":return F(i.monthsShort,H,I,3);case"MMMM":return F(I,H);case"D":return s.$D;case"DD":return g.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return F(i.weekdaysMin,s.$W,L,2);case"ddd":return F(i.weekdaysShort,s.$W,L,3);case"dddd":return L[s.$W];case"H":return String(O);case"HH":return g.s(O,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return B(O,Y,!0);case"A":return B(O,Y,!1);case"m":return String(Y);case"mm":return g.s(Y,2,"0");case"s":return String(s.$s);case"ss":return g.s(s.$s,2,"0");case"SSS":return g.s(s.$ms,3,"0");case"Z":return m}return null}(N)||m.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(e,s,i){var c,m=this,O=g.p(s),Y=b(e),H=(Y.utcOffset()-this.utcOffset())*$,L=this-Y,I=function(){return g.m(m,Y)};switch(O){case d:c=I()/12;break;case f:c=I();break;case l:c=I()/3;break;case v:c=(L-H)/6048e5;break;case S:c=(L-H)/864e5;break;case y:c=L/U;break;case x:c=L/$;break;case D:c=L/a;break;default:c=L}return i?c:g.a(c)},n.daysInMonth=function(){return this.endOf(f).$D},n.$locale=function(){return z[this.$L]},n.locale=function(e,s){if(!e)return this.$L;var i=this.clone(),c=C(e,s,!0);return c&&(i.$L=c),i},n.clone=function(){return g.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},u}(),A=j.prototype;return b.prototype=A,[["$ms",W],["$s",D],["$m",x],["$H",y],["$W",S],["$M",f],["$y",d],["$D",o]].forEach(function(u){A[u[1]]=function(n){return this.$g(n,u[0],u[1])}}),b.extend=function(u,n){return u.$i||(u(n,j,b),u.$i=!0),b},b.locale=C,b.isDayjs=M,b.unix=function(u){return b(1e3*u)},b.en=z[h],b.Ls=z,b.p={},b})});var st=Q((X,tt)=>{(function(a,$){typeof X=="object"&&typeof tt<"u"?tt.exports=$():typeof define=="function"&&define.amd?define($):(a=typeof globalThis<"u"?globalThis:a||self).dayjs_plugin_utc=$()})(X,function(){"use strict";var a="minute",$=/[+-]\d\d(?::?\d\d)?/g,U=/([+-]|\d\d)/g;return function(W,D,x){var y=D.prototype;x.utc=function(t){var r={date:t,utc:!0,args:arguments};return new D(r)},y.utc=function(t){var r=x(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),a):r},y.local=function(){return x(this.toDate(),{locale:this.$L,utc:!1})};var S=y.parse;y.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),S.call(this,t)};var v=y.init;y.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else v.call(this)};var f=y.utcOffset;y.utcOffset=function(t,r){var w=this.$utils().u;if(w(t))return this.$u?0:w(this.$offset)?f.call(this):this.$offset;if(typeof t=="string"&&(t=function(h){h===void 0&&(h="");var z=h.match($);if(!z)return null;var k=(""+z[0]).match(U)||["-",0,0],M=k[0],C=60*+k[1]+ +k[2];return C===0?0:M==="+"?C:-C}(t),t===null))return this;var T=Math.abs(t)<=16?60*t:t,p=this;if(r)return p.$offset=T,p.$u=t===0,p;if(t!==0){var _=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(p=this.local().add(T+_,a)).$offset=T,p.$x.$localOffset=_}else p=this.utc();return p};var l=y.format;y.format=function(t){var r=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,r)},y.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},y.isUTC=function(){return!!this.$u},y.toISOString=function(){return this.toDate().toISOString()},y.toString=function(){return this.toDate().toUTCString()};var d=y.toDate;y.toDate=function(t){return t==="s"&&this.$offset?x(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var o=y.diff;y.diff=function(t,r,w){if(t&&this.$u===t.$u)return o.call(this,t,r,w);var T=this.local(),p=x(t).local();return o.call(T,p,r,w)}}})});var rt=Q((et,nt)=>{(function(a,$){typeof et=="object"&&typeof nt<"u"?nt.exports=$():typeof define=="function"&&define.amd?define($):(a=typeof globalThis<"u"?globalThis:a||self).dayjs_plugin_timezone=$()})(et,function(){"use strict";var a={year:0,month:1,day:2,hour:3,minute:4,second:5},$={};return function(U,W,D){var x,y=function(l,d,o){o===void 0&&(o={});var t=new Date(l),r=function(w,T){T===void 0&&(T={});var p=T.timeZoneName||"short",_=w+"|"+p,h=$[_];return h||(h=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:w,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:p}),$[_]=h),h}(d,o);return r.formatToParts(t)},S=function(l,d){for(var o=y(l,d),t=[],r=0;r<o.length;r+=1){var w=o[r],T=w.type,p=w.value,_=a[T];_>=0&&(t[_]=parseInt(p,10))}var h=t[3],z=h===24?0:h,k=t[0]+"-"+t[1]+"-"+t[2]+" "+z+":"+t[4]+":"+t[5]+":000",M=+l;return(D.utc(k).valueOf()-(M-=M%1e3))/6e4},v=W.prototype;v.tz=function(l,d){l===void 0&&(l=x);var o,t=this.utcOffset(),r=this.toDate(),w=r.toLocaleString("en-US",{timeZone:l}),T=Math.round((r-new Date(w))/1e3/60),p=15*-Math.round(r.getTimezoneOffset()/15)-T;if(!Number(p))o=this.utcOffset(0,d);else if(o=D(w,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(p,!0),d){var _=o.utcOffset();o=o.add(t-_,"minute")}return o.$x.$timezone=l,o},v.offsetName=function(l){var d=this.$x.$timezone||D.tz.guess(),o=y(this.valueOf(),d,{timeZoneName:l}).find(function(t){return t.type.toLowerCase()==="timezonename"});return o&&o.value};var f=v.startOf;v.startOf=function(l,d){if(!this.$x||!this.$x.$timezone)return f.call(this,l,d);var o=D(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return f.call(o,l,d).tz(this.$x.$timezone,!0)},D.tz=function(l,d,o){var t=o&&d,r=o||d||x,w=S(+D(),r);if(typeof l!="string")return D(l).tz(r);var T=function(z,k,M){var C=z-60*k*1e3,b=S(C,M);if(k===b)return[C,k];var g=S(C-=60*(b-k)*1e3,M);return b===g?[C,b]:[z-60*Math.min(b,g)*1e3,Math.max(b,g)]}(D.utc(l,t).valueOf(),w,r),p=T[0],_=T[1],h=D(p).utcOffset(_);return h.$x.$timezone=r,h},D.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},D.tz.setDefault=function(l){x=l}}})});var q=G(at()),ot=G(st()),ut=G(rt());q.default.extend(ot.default);q.default.extend(ut.default);jQuery(function(a){a(".simcal-default-calendar").each(function(S,v){var f=a(v),l=f.data("calendar-id"),d=f.data("offset"),o=f.data("events-first"),t=f.data("calendar-end"),r=f.find(".simcal-calendar-head"),w=r.find(".simcal-nav-button"),T=f.find(".simcal-ajax-loader"),p=r.find(".simcal-current"),_=p.data("calendar-current"),h=p.find("span.simcal-current-month"),z=p.find("span.simcal-current-year"),k=(0,q.default)(_*1e3).tz(f.data("timezone")),M,C;f.hasClass("simcal-default-calendar-grid")?(C="simcal_default_calendar_draw_grid",M=new Date(k.year(),k.month()),$(w,M.getTime()/1e3,o,t)):(C="simcal_default_calendar_draw_list",U(w,f,o,t,!1,_),W(f)),w.on("click",function(){var b=a(this).hasClass("simcal-next")?"next":"prev";if(C=="simcal_default_calendar_draw_grid"){var g=f.find(".simcal-month"),j,A,u;b=="prev"?j=new Date(M.setMonth(M.getMonth()-1,1)):(j=new Date(M.setMonth(M.getMonth()+2,1)),j.setDate(0),j.setHours(23),j.setMinutes(59),j.setSeconds(59)),A=j.getMonth(),u=j.getFullYear(),a.ajax({url:simcal_default_calendar.ajax_url,type:"POST",dataType:"json",cache:!1,data:{action:C,month:A+1,year:u,id:l},beforeSend:function(){T.fadeToggle()},success:function(c){h.text(simcal_default_calendar.months.full[A]),z.text(u),p.attr("data-calendar-current",j.getTime()/1e3+d+1),$(w,j.getTime()/1e3,o,t),T.fadeToggle(),M=j,g.replaceWith(c.data),x(f,n),y()},error:function(c){console.log(c)}})}else{var n=f.find(".simcal-events-list-container"),e=n.data("prev"),s=n.data("next"),i=b=="prev"?e:s;a.ajax({url:simcal_default_calendar.ajax_url,type:"POST",dataType:"json",cache:!1,data:{action:C,ts:i,id:l},beforeSend:function(){T.fadeToggle()},success:function(c){n.replaceWith(c.data),p.attr("data-calendar-current",i),W(f),U(w,f,o,t,b,i),T.fadeToggle(),y()},error:function(c){console.log(c)}})}})});function $(S,v,f,l){S.each(function(d,o){var t=a(o),r=new Date(v*1e3);t.hasClass("simcal-prev")?(r=new Date(r.setMonth(r.getMonth(),1)),r.setDate(0),r.getTime()/1e3<=f?t.attr("disabled","disabled"):t.removeAttr("disabled")):(r=new Date(r.setMonth(r.getMonth()+1,1)),r.setDate(0),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.getTime()/1e3>=l?t.attr("disabled","disabled"):t.removeAttr("disabled"))})}function U(S,v,f,l,d,o){var t=v.find(".simcal-events-list-container"),r=t.data("prev"),w=t.data("next"),T=t.find("li.simcal-event:last").data("start");S.each(function(p,_){var h=a(_);d?h.hasClass("simcal-prev")?d=="prev"?r<=f&&o<=f&&h.attr("disabled","disabled"):h.removeAttr("disabled"):h.hasClass("simcal-next")&&(d=="next"?(w>=l&&o>=l||T>=l)&&h.attr("disabled","disabled"):h.removeAttr("disabled")):h.hasClass("simcal-prev")?r<=f&&o<=f&&h.attr("disabled","disabled"):h.hasClass("simcal-next")&&(w>=l&&o>=l||T>=l)&&h.attr("disabled","disabled")})}function W(S){var v=a(S).find(".simcal-current"),f=a(S).find(".simcal-events-list-container"),l=f.data("heading-small"),d=f.data("heading-large"),o=a("<h3 />");S.width()<400?o.text(l):o.text(d),v.html(o)}var D=a(".simcal-default-calendar-grid");function x(S){var v=a(S).find("> table"),f=v.find("thead"),l=f.find("th.simcal-week-day"),d=v.find("td.simcal-day > div"),o=v.find("ul.simcal-events"),t=o.find("> li > .simcal-event-title"),r=v.find(".simcal-events-toggle"),w=v.find("span.simcal-events-dots"),T=v.find(".simcal-tooltip-content"),p=v.find(".simcal-event-toggled"),_=v.data("event-bubble-trigger"),h=d.first().width();if(h<60){l.each(function(k,M){a(M).text(a(M).data("screen-small"))}),o.hide(),t.hide(),r!="undefined"&&(r.hide(),p!="undefined"&&p.show()),w.show(),_="click";var z=h-10+"px";d.css("min-height",z),v.find("span.simcal-events-dots:not(:empty)").css("min-height",z)}else h<=240?l.each(function(k,M){a(M).text(a(M).data("screen-medium"))}):l.each(function(k,M){a(M).text(a(M).data("screen-large"))}),o.show(),t.show(),r!="undefined"&&(r.show(),p!="undefined"&&p.hide()),w.hide(),d.css("min-height",h+"px");d.each(function(k,M){var C=a(M).find("span.simcal-events-dots"),b=a(M).find(".simcal-tooltip"),g,j,A;h<60?(T.show(),g=C):(T.hide(),g=b),g.each(function(u,n){a(n).qtip({content:h<60?a(M).find("ul.simcal-events"):a(n).find("> .simcal-tooltip-content"),position:{my:"top center",at:"bottom center",target:a(n),viewport:h<60?a(window):!0,adjust:{method:"shift",scroll:!1}},style:{def:!1,classes:"simcal-default-calendar simcal-event-bubble"},show:{solo:!0,effect:!1,event:_=="hover"?"mouseenter":"click"},hide:{fixed:!0,effect:!1,event:_=="click"?"unfocus":"mouseleave",delay:100},events:{show:function(e,s){A&&A.id&&A.id!=s.id&&A.hide(),A=s}},overwrite:!1})})})}D.each(function(S,v){x(v),a(v).on("change",function(){x(this)})}),window.onresize=function(){D.each(function(S,v){x(v)})},a("#print-calendar-button").on("click",function(){var S=a(".simcal-calendar").clone(!0);a("body").children().hide(),a("body").append(S),a("body").addClass("simcal-print-calendar"),window.print(),a("body > .simcal-calendar").remove(),a("body").children().show(),a("body").removeClass("simcal-print-calendar")});function y(){a(".simcal-events-toggle").each(function(S,v){var f=a(v).prev(".simcal-events"),l=f.find(".simcal-event-toggled"),d=a(v).find("i");a(v).on("click",function(){d.toggleClass("simcal-icon-rotate-180"),l.slideToggle()})})}y()});})();
//# sourceMappingURL=default-calendar.min.js.map
;