/* * # Fomantic UI - 2.8.8 * https://github.com/fomantic/Fomantic-UI * http://fomantic-ui.com/ * * Copyright 2021 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT * */ !function(De,T,k,ve){"use strict";De.isFunction=De.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},T=void 0!==T&&T.Math==Math?T:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),De.fn.calendar=function(g){var D,e=De(this),v=e.selector||"",y=(new Date).getTime(),b=[],C=g,w="string"==typeof C,M=[].slice.call(arguments,1),x={5:{row:4,column:3},10:{row:3,column:2},15:{row:2,column:2},20:{row:3,column:1},30:{row:2,column:1}},ge=["","one","two","three","four","five","six","seven","eight"];return e.each(function(){var c,e,le,de=De.isPlainObject(g)?De.extend(!0,{},De.fn.calendar.settings,g):De.extend({},De.fn.calendar.settings),ue=de.className,t=de.namespace,o=de.selector,fe=de.formatter,a=de.parser,ce=de.metadata,pe=x[de.minTimeGap],s=de.error,n="."+t,r="module-"+t,l=De(this),d=l.find(o.input),me=l.find(o.popup),u=l.find(o.activator),f=this,p=l.data(r),m=!1,he=l.hasClass(ue.inverted),h=!1,i=!1;le={initialize:function(){le.debug("Initializing calendar for",f,l),c=le.get.isTouch(),le.setup.config(),le.setup.popup(),le.setup.inline(),le.setup.input(),le.setup.date(),le.create.calendar(),le.bind.events(),le.observeChanges(),le.instantiate()},instantiate:function(){le.verbose("Storing instance of calendar"),p=le,l.data(r,p)},destroy:function(){le.verbose("Destroying previous calendar for",f),l.removeData(r),le.unbind.events(),le.disconnect.classObserver()},setup:{config:function(){null!==le.get.minDate()&&le.set.minDate(l.data(ce.minDate)),null!==le.get.maxDate()&&le.set.maxDate(l.data(ce.maxDate)),le.setting("type",le.get.type()),le.setting("on",de.on||(d.length?"focus":"click"))},popup:function(){if(!de.inline&&(u.length||(u=l.children().first()).length))if(De.fn.popup!==ve){if(!me.length){var e=u.parent(),t=0!==e.closest(o.append).length?"appendTo":"prependTo";me=De("
").addClass(ue.popup)[t](e)}me.addClass(ue.calendar),he&&me.addClass(ue.inverted);var a=function(){return le.refreshTooltips(),de.onVisible.apply(me,arguments)},n=de.onHidden;d.length||(me.attr("tabindex","0"),a=function(){return le.refreshTooltips(),le.focus(),de.onVisible.apply(me,arguments)},n=function(){return le.blur(),de.onHidden.apply(me,arguments)});var r=le.setting("on"),i=De.extend({},de.popupOptions,{popup:me,on:r,hoverable:"hover"===r,closable:"click"===r,onShow:function(){return le.set.focusDate(le.get.date()),le.set.mode(le.get.validatedMode(de.startMode)),de.onShow.apply(me,arguments)},onVisible:a,onHide:de.onHide,onHidden:n});le.popup(i)}else le.error(s.popup)},inline:function(){u.length&&!de.inline||(de.inline=!0,me=De("
").addClass(ue.calendar).appendTo(l),d.length||me.attr("tabindex","0"))},input:function(){de.touchReadonly&&d.length&&c&&d.prop("readonly",!0),le.check.disabled()},date:function(){var e;de.initialDate?e=a.date(de.initialDate,de):l.data(ce.date)!==ve?e=a.date(l.data(ce.date),de):d.length&&(e=a.date(d.val(),de)),le.set.date(e,de.formatInput,!1),le.set.mode(le.get.mode(),!1)}},trigger:{change:function(){var e=d[0];if(e){var t=k.createEvent("HTMLEvents");le.verbose("Triggering native change event"),t.initEvent("change",!0,!1),e.dispatchEvent(t)}}},create:{calendar:function(){var e,t,a,n,r,i,o,s=le.get.mode(),l=new Date,d=le.get.date(),u=le.get.focusDate(),f=le.helper.dateInRange(u||d||de.initialDate||l);u||(u=f,le.set.focusDate(u,!1,!1));var c="year"===s,p="month"===s,m="day"===s,h="hour"===s,g="minute"===s,D="time"===de.type,v=Math.max(de.multiMonth,1),y=m?le.get.monthOffset():0,b=f.getMinutes(),C=f.getHours(),w=f.getDate(),M=f.getMonth()+y,x=f.getFullYear(),T=m?de.showWeekNumbers?8:7:h?4:pe.column,k=m||h?6:pe.row,O=m?v:1,F=me,N=F.hasClass("left")?"right center":"left center";for(F.empty(),1").addClass(ue.grid).appendTo(F)),n=0;n").addClass(ue.column).appendTo(o);var A=M+n,E=(new Date(x,A,1).getDay()-de.firstDayOfWeek%7+7)%7;if(!de.constantHeight&&m){var H=new Date(x,A+1,0).getDate()+E;k=Math.ceil(H/7)}var Y=c?10:p?1:0,I=m?1:0,j=h||g?1:0,S=h||g?w:1,q=new Date(x-Y,A-I,S-j,C),W=new Date(x+Y,A+I,S+j,C),R=c?new Date(10*Math.ceil(x/10)-9,0,0):p?new Date(x,0,0):m?new Date(x,A,0):new Date(x,A,w,-1),V=c?new Date(10*Math.ceil(x/10)+1,0,1):p?new Date(x+1,0,1):m?new Date(x,A+1,1):new Date(x,A,w+1),G=s;m&&de.showWeekNumbers&&(G+=" andweek");var P=De("").addClass(ue.table).addClass(G).addClass(ge[T]+" column").appendTo(F);he&&P.addClass(ue.inverted);var B=T;if(!D){var K=De("").appendTo(P);r=De("").appendTo(K),i=De("").appendTo(K),de.showWeekNumbers&&((i=De("").appendTo(P);for(e=c?10*Math.ceil(x/10)-9:m?1-E:0,t=0;t").appendTo(Q),m&&de.showWeekNumbers&&((i=De("").appendTo(Q),se=De("
").attr("colspan",""+T).appendTo(r);var U=c||p?new Date(x,0,1):m?new Date(x,A,1):new Date(x,A,w,C,b),J=De("").addClass(ue.link).appendTo(i);J.text(fe.header(U,s,de));var z=p?de.disableYear?"day":"year":m?de.disableMonth?"year":"month":"day";if(J.data(ce.mode,z),0===n){var L=De("").addClass(ue.prev).appendTo(i);L.data(ce.focusDate,q),L.toggleClass(ue.disabledCell,!le.helper.isDateInRange(R,s)),De("").addClass(ue.prevIcon).appendTo(L)}if(n===O-1){var $=De("").addClass(ue.next).appendTo(i);$.data(ce.focusDate,W),$.toggleClass(ue.disabledCell,!le.helper.isDateInRange(V,s)),De("").addClass(ue.nextIcon).appendTo($)}if(m)for(r=De("
").appendTo(r)).text(de.text.weekNo),i.addClass(ue.weekCell),B--),e=0;e").appendTo(r)).text(fe.dayColumnHeader((e+de.firstDayOfWeek)%7,de))}var Q=De("
").appendTo(r)).text(le.get.weekOfYear(x,A,e+1-de.firstDayOfWeek)),i.addClass(ue.weekCell)),a=0;a").addClass(ue.cell).appendTo(r)).text(X),i.data(ce.date,Z);var _,ee=m&&Z.getMonth()!==(A+12)%12,te=!de.selectAdjacentDays&&ee||!le.helper.isDateInRange(Z,s)||de.isDisabled(Z,s)||le.helper.isDisabled(Z,s)||!le.helper.isEnabled(Z,s);if(te){var ae=le.helper.findDayAsObject(Z,s,de.disabledDates);null!==ae&&ae[ce.message]&&(i.attr("data-tooltip",ae[ce.message]),i.attr("data-position",ae[ce.position]||N),(ae[ce.inverted]||he&&ae[ce.inverted]===ve)&&i.attr("data-inverted",""),ae[ce.variation]&&i.attr("data-variation",ae[ce.variation]))}else null!==(_=le.helper.findDayAsObject(Z,s,de.eventDates))&&(i.addClass(_[ce.class]||de.eventClass),_[ce.message]&&(i.attr("data-tooltip",_[ce.message]),i.attr("data-position",_[ce.position]||N),(_[ce.inverted]||he&&_[ce.inverted]===ve)&&i.attr("data-inverted",""),_[ce.variation]&&i.attr("data-variation",_[ce.variation])));var ne=le.helper.dateEqual(Z,d,s),re=le.helper.dateEqual(Z,l,s);i.toggleClass(ue.adjacentCell,ee&&!_),i.toggleClass(ue.disabledCell,te),i.toggleClass(ue.activeCell,ne&&!(ee&&te)),h||g||i.toggleClass(ue.todayCell,!ee&&re);var ie={mode:s,adjacent:ee,disabled:te,active:ne,today:re};fe.cell(i,Z,ie),le.helper.dateEqual(Z,u,s)&&le.set.focusDate(Z,!1,!1)}if(de.today){var oe=De("
").attr("colspan",""+T).addClass(ue.today).appendTo(oe);se.text(fe.today(de)),se.data(ce.date,l)}le.update.focus(!1,P),de.inline&&le.refreshTooltips()}}},update:{focus:function(e,t){t=t||me;var s=le.get.mode(),a=le.get.date(),l=le.get.focusDate(),d=le.get.startDate(),u=le.get.endDate(),f=(e?l:null)||a||(c?null:l);t.find("td").each(function(){var e=De(this),t=e.data(ce.date);if(t){var a=e.hasClass(ue.disabledCell),n=e.hasClass(ue.activeCell),r=e.hasClass(ue.adjacentCell),i=le.helper.dateEqual(t,l,s),o=!!f&&(!!d&&le.helper.isDateInRange(t,s,d,f)||!!u&&le.helper.isDateInRange(t,s,f,u));e.toggleClass(ue.focusCell,i&&(!c||m)&&(!r||de.selectAdjacentDays&&r)&&!a),le.helper.isTodayButton(e)||e.toggleClass(ue.rangeCell,o&&!n&&!a)}})}},refresh:function(){le.create.calendar()},refreshTooltips:function(){var r=De(T).width();me.find("td[data-position]").each(function(){var e=De(this),t=T.getComputedStyle(e[0],":after").width.replace(/[^0-9\.]/g,""),a=e.attr("data-position"),n=r-e.width()-(parseInt(t,10)||250)>e.offset().left?"right":"left";-1===a.indexOf(n)&&e.attr("data-position",a.replace(/(left|right)/,n))})},bind:{events:function(){le.debug("Binding events"),me.on("mousedown"+n,le.event.mousedown),me.on("touchstart"+n,le.event.mousedown),me.on("mouseup"+n,le.event.mouseup),me.on("touchend"+n,le.event.mouseup),me.on("mouseover"+n,le.event.mouseover),d.length?(d.on("input"+n,le.event.inputChange),d.on("focus"+n,le.event.inputFocus),d.on("blur"+n,le.event.inputBlur),d.on("keydown"+n,le.event.keydown)):me.on("keydown"+n,le.event.keydown)}},unbind:{events:function(){le.debug("Unbinding events"),me.off(n),d.length&&d.off(n)}},event:{mouseover:function(e){var t=De(e.target).data(ce.date),a=1===e.buttons;t&&le.set.focusDate(t,!1,!0,a)},mousedown:function(e){d.length&&e.preventDefault(),m=0<=e.type.indexOf("touch");var t=De(e.target).data(ce.date);t&&le.set.focusDate(t,!1,!0,!0)},mouseup:function(e){le.focus(),e.preventDefault(),e.stopPropagation(),m=!1;var t=De(e.target);if(!t.hasClass("disabled")){var a=t.parent();(a.data(ce.date)||a.data(ce.focusDate)||a.data(ce.mode))&&(t=a);var n=t.data(ce.date),r=t.data(ce.focusDate),i=t.data(ce.mode);if(n&&!1!==de.onSelect.call(f,n,le.get.mode())){var o=t.hasClass(ue.today);le.selectDate(n,o)}else r?le.set.focusDate(r):i&&le.set.mode(i)}},keydown:function(e){var t=e.which;if(27!==t&&9!==t||le.popup("hide"),le.popup("is visible"))if(37===t||38===t||39===t||40===t){var a="day"===(f=le.get.mode())?7:"hour"===f?4:"minute"===f?pe.column:3,n=37===t?-1:38===t?-a:39==t?1:a;n*="minute"===f?de.minTimeGap:1;var r=le.get.focusDate()||le.get.date()||new Date,i=r.getFullYear()+("year"===f?n:0),o=r.getMonth()+("month"===f?n:0),s=r.getDate()+("day"===f?n:0),l=r.getHours()+("hour"===f?n:0),d=r.getMinutes()+("minute"===f?n:0),u=new Date(i,o,s,l,d);"time"===de.type&&(u=le.helper.mergeDateTime(r,u)),le.helper.isDateInRange(u,f)&&le.set.focusDate(u)}else if(13===t){var f=le.get.mode(),c=le.get.focusDate();c&&!de.isDisabled(c,f)&&!le.helper.isDisabled(c,f)&&le.helper.isEnabled(c,f)&&le.selectDate(c),e.preventDefault(),e.stopPropagation()}38!==t&&40!==t||(e.preventDefault(),le.popup("show"))},inputChange:function(){var e=d.val(),t=a.date(e,de);le.set.date(t,!1)},inputFocus:function(){me.addClass(ue.active)},inputBlur:function(){if(me.removeClass(ue.active),de.formatInput){var e=le.get.date(),t=fe.datetime(e,de);d.val(t)}i&&(le.trigger.change(),i=!1)},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&le.check.disabled()})}}},observeChanges:function(){"MutationObserver"in T&&(e=new MutationObserver(le.event.class.mutation),le.debug("Setting up mutation observer",e),le.observe.class())},disconnect:{classObserver:function(){d.length&&e&&e.disconnect()}},observe:{class:function(){d.length&&e&&e.observe(l[0],{attributes:!0})}},is:{disabled:function(){return l.hasClass(ue.disabled)}},check:{disabled:function(){d.attr("tabindex",le.is.disabled()?-1:0)}},get:{weekOfYear:function(e,t,a){var n,r,i;return n=Date.UTC(e,t,a+3)/864e5,r=Math.floor(n/7),i=new Date(6048e5*r).getUTCFullYear(),r-Math.floor(Date.UTC(i,0,7)/6048e5)+1},date:function(){return le.helper.sanitiseDate(l.data(ce.date))||null},inputDate:function(){return d.val()},focusDate:function(){return l.data(ce.focusDate)||null},startDate:function(){var e=le.get.calendarModule(de.startCalendar);return(e?e.get.date():l.data(ce.startDate))||null},endDate:function(){var e=le.get.calendarModule(de.endCalendar);return(e?e.get.date():l.data(ce.endDate))||null},minDate:function(){return l.data(ce.minDate)||null},maxDate:function(){return l.data(ce.maxDate)||null},monthOffset:function(){return l.data(ce.monthOffset)||0},mode:function(){var e=l.data(ce.mode)||de.startMode;return le.get.validatedMode(e)},validatedMode:function(e){var t=le.get.validModes();return 0<=De.inArray(e,t)?e:"time"===de.type?"hour":"month"===de.type?"month":"year"===de.type?"year":"day"},type:function(){return l.data(ce.type)||de.type},validModes:function(){var e=[];return"time"!==de.type&&(de.disableYear&&"year"!==de.type||e.push("year"),(de.disableMonth||"year"===de.type)&&"month"!==de.type||e.push("month"),0<=de.type.indexOf("date")&&e.push("day")),0<=de.type.indexOf("time")&&(e.push("hour"),de.disableMinute||e.push("minute")),e},isTouch:function(){try{return k.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e instanceof De||(e=De(e).first()),e.data(r)):null}},set:{date:function(e,t,a){t=!1!==t,a=!1!==a,e=le.helper.sanitiseDate(e),e=le.helper.dateInRange(e);var n=le.get.mode(),r=fe.datetime(e,de);if(a&&!1===de.onBeforeChange.call(f,e,r,n))return!1;if(le.set.focusDate(e),de.isDisabled(e,n))return!1;var i=le.get.endDate();i&&e&&i=e?le.verbose("Unable to set maxDate variable lower that minDate variable",e,de.minDate):(le.setting("maxDate",e),le.set.dataKeyValue(ce.maxDate,e))},monthOffset:function(e,t){var a=Math.max(de.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),le.set.dataKeyValue(ce.monthOffset,e,t)},mode:function(e,t){le.set.dataKeyValue(ce.mode,e,t)},dataKeyValue:function(e,t,a){var n=l.data(e),r=n===t||n<=t&&t<=n;return t?l.data(e,t):l.removeData(e),(a=!1!==a&&!r)&&le.refresh(),!r}},selectDate:function(e,t){le.verbose("New date selection",e);var a=le.get.mode();if(t||"minute"===a||de.disableMinute&&"hour"===a||"date"===de.type&&"day"===a||"month"===de.type&&"month"===a||"year"===de.type&&"year"===a){if(!(!1===le.set.date(e))&&(i=!0,de.closable)){le.popup("hide");var n=le.get.calendarModule(de.endCalendar);n&&("focus"!==n.setting("on")&&n.popup("show"),n.focus())}}else{var r="year"===a?de.disableMonth?"day":"month":"month"===a?"day":"day"===a?"hour":"minute";le.set.mode(r),"hour"===a||"day"===a&&le.get.date()?le.set.date(e,!0,!1):le.set.focusDate(e)}},changeDate:function(e){le.set.date(e)},clear:function(){le.set.date(ve)},popup:function(){return u.popup.apply(u,arguments)},focus:function(){d.length?d.focus():me.focus()},blur:function(){d.length?d.blur():me.blur()},helper:{isDisabled:function(a,n){return("day"===n||"month"===n||"year"===n)&&("day"===n&&-1!==de.disabledDaysOfWeek.indexOf(a.getDay())||de.disabledDates.some(function(e){if("string"==typeof e&&(e=le.helper.sanitiseDate(e)),e instanceof Date)return le.helper.dateEqual(a,e,n);if(null!==e&&"object"==typeof e)if(e[ce.year]){if("number"==typeof e[ce.year])return a.getFullYear()==e[ce.year];if(Array.isArray(e[ce.year]))return-1=t.centuryBreak&&a===v.length-1){n<=99&&(n+=t.currentCentury-100),p=n,v.splice(a,1);break}if(c<0)for(a=0;a