Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/calendar/util/dist/ |
Upload File : |
this.BX=this.BX||{};(function(t,e,a,i,n){"use strict";let r=t=>t,s,o;class c{static parseTime(t){const e=c.parseDate1(`${a.DateTimeFormat.format(c.getDateFormat(),new Date)} ${t}`,false);return e?{h:e.getHours(),m:e.getMinutes()}:e}static getTimeRounded(t){return Math.round(t.getTime()/6e4)*6e4}static parseDate(t,e,a,i){return BX.parseDate(t,e,a,i)}static parseDate1(t,a,i){let n;let r;let s;let o;if(!a){a=e.Loc.getMessage("FORMAT_DATETIME")}t=BX.util.trim(t);if(i!==false){a=a.replace(":SS","")}if(BX.type.isNotEmptyString(t)){o="";for(n=1;n<=12;n++){o=`${o}|${e.Loc.getMessage(`MON_${n}`)}`}const i=new RegExp(`([0-9]+|[a-z]+${o})`,"ig");const c=t.match(i);let l=e.Loc.getMessage("FORMAT_DATE").match(/(dd|mi|mmmm|mm|m|yyyy)/gi);const u=[];const m=[];const d={};if(!c){return null}if(c.length>l.length){l=a.match(/(dd|mi|mmmm|mm|m|yyyy|hh|h|ss|tt|t|gg|g)/gi)}for(n=0,r=c.length;n<r;n++){if(BX.util.trim(c[n])!==""){u[u.length]=c[n]}}for(n=0,r=l.length;n<r;n++){if(BX.util.trim(l[n])!=""){m[m.length]=l[n]}}let g=BX.util.array_search("MMMM",m);if(g>0){u[g]=BX.getNumMonth(u[g]);m[g]="MM"}else{g=BX.util.array_search("M",m);if(g>0){u[g]=BX.getNumMonth(u[g]);m[g]="MM"}}for(n=0,r=m.length;n<r;n++){s=m[n].toUpperCase();d[s]=s==="T"||s==="TT"?u[n]:parseInt(u[n],10)}if(d.DD>0&&d.MM>0&&d.YYYY>0){const t=new Date;{t.setDate(1);t.setFullYear(d.YYYY);t.setMonth(d.MM-1);t.setDate(d.DD);t.setHours(0,0,0)}if((!isNaN(d.HH)||!isNaN(d.GG)||!isNaN(d.H)||!isNaN(d.G))&&!isNaN(d.MI)){if(!isNaN(d.H)||!isNaN(d.G)){const t=(d.T||d.TT||"am").toUpperCase()=="PM";const e=parseInt(d.H||d.G||0,10);if(t){d.HH=e+(e==12?0:12)}else{d.HH=e<12?e:0}}else{d.HH=parseInt(d.HH||d.GG||0,10)}if(isNaN(d.SS)){d.SS=0}{t.setHours(d.HH,d.MI,d.SS)}}return t}}return null}static formatTime(t,i){let n;if(e.Type.isDate(t)){n=t}else{n=new Date;n.setHours(t,i,0)}return a.DateTimeFormat.format(c.getTimeFormatShort(),n.getTime()/1e3)}static formatDate(t){if(e.Type.isDate(t)){t=t.getTime()}return a.DateTimeFormat.format(c.getDateFormat(),t/1e3)}static formatDateTime(t){if(e.Type.isDate(t)){t=t.getTime()}return a.DateTimeFormat.format(c.getDateTimeFormat(),t/1e3)}static formatTimeInterval(t,e){const i=a.DateTimeFormat.format(c.getTimeFormatShort(),t.getTime()/1e3);const n=a.DateTimeFormat.format(c.getTimeFormatShort(),e.getTime()/1e3);return`${i} - ${n}`}static formatDuration(t){const e=Math.floor(t/60);const i=t%60;let n=a.DateTimeFormat.format("idiff",Date.now()/1e3-i*60);if(e>0){n=a.DateTimeFormat.format("Hdiff",Date.now()/1e3-e*60*60);if(i>0){n+=` ${a.DateTimeFormat.format("idiff",Date.now()/1e3-i*60)}`}}return n}static formatDateUsable(t,i=true,n=false){const r=e.Loc.getMessage("LANGUAGE_ID");let s=c.getDateFormat();if(r==="ru"||r==="ua"){s=n?"l, j F":"j F";if(t.getFullYear&&t.getFullYear()!==(new Date).getFullYear()&&i!==false){s+=" Y"}}return a.DateTimeFormat.format([["today","today"],["tommorow","tommorow"],["yesterday","yesterday"],["",s]],t)}static formatDayMonthShortTime(t){return`\n\t\t\t${a.DateTimeFormat.format(a.DateTimeFormat.getFormat("DAY_MONTH_FORMAT"),t)} \n\t\t\t${a.DateTimeFormat.format(a.DateTimeFormat.getFormat("SHORT_TIME_FORMAT"),t)}\n\t\t`}static getDayLength(){if(!c.DAY_LENGTH){c.DAY_LENGTH=864e5}return c.DAY_LENGTH}static getDefaultColorList(){return["#86b100","#0092cc","#00afc7","#e89b06","#00b38c","#de2b24","#bd7ac9","#838fa0","#c3612c","#e97090"]}static findTargetNode(t,e){let a=false;if(t){const i="data-bx-calendar";let n;if(t.attributes&&t.attributes.length>0){for(n=0;n<t.attributes.length;n++){if(t.attributes[n].name&&t.attributes[n].name.slice(0,i.length)===i){a=t;break}}}if(!a){a=BX.findParent(t,(t=>{let e;if(t.attributes&&t.attributes.length>0){for(e=0;e<t.attributes.length;e++){if(t.attributes[e].name&&t.attributes[e].name.slice(0,i.length)===i){return true}}}return false}),e)}}return a}static getFollowedUserList(t){return[]}static getWeekDayByInd(t){return["SU","MO","TU","WE","TH","FR","SA"][t]}static getIndByWeekDay(t){return new Object({SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6})[t]}static getWeekdaysLoc(t=false){const e=new Date;const i=[];const n=24*60*60*1e3;const r=t?"l":"D";for(let t=0;t<7;t++){i[(e.getDay()+t)%7]=a.DateTimeFormat.format(r,new Date(e.getTime()+n*t))}return i}static getLoader(t,a){return e.Tag.render(s||(s=r` <div class="${0}"> <svg class="calendar-loader-circular" style="width:${0}px; height:${0}px;" viewBox="25 25 50 50"> <circle class="calendar-loader-path" cx="50" cy="50" r="20" fill="none" stroke-miterlimit="10"/> <circle class="calendar-loader-inner-path" cx="50" cy="50" r="20" fill="none" stroke-miterlimit="10"/> </svg> </div> `),a||"calendar-loader",parseInt(t),parseInt(t))}static getDayCode(t){return`${t.getFullYear()}-${`0${Math.trunc(t.getMonth()+1)}`.slice(-2,-2+2)}-${`0${Math.trunc(t.getDate())}`.slice(-2,-2+2)}`}static getTextColor(t){if(!t){return false}if(t.charAt(0)==="#"){t=t.slice(1,7)}const e=parseInt(t.slice(0,2),16);const a=parseInt(t.slice(2,4),16);const i=parseInt(t.slice(4,6),16);const n=(e*.8+a+i*.2)/510*100;return n<50}static getKeyCode(t){if(!e.Type.isString(t)){return false}const a={backspace:8,enter:13,escape:27,space:32,delete:46,left:37,right:39,up:38,down:40,z:90,y:89,shift:16,ctrl:17,alt:18,cmd:91,cmdRight:93,pageUp:33,pageDown:34,d:68,w:87,m:77,a:65};return a[t.toLowerCase()]}static isAnyModifierKeyPressed(t=window.event){if(t){return t.altKey||t.shiftKey||t.ctrlKey||t.metaKey}return null}static getUsableDateTime(t,a){if(e.Type.isDate(t)){t=t.getTime()}const i=(a||10)*60*1e3;t=Math.ceil(t/i)*i;return new Date(t)}static showNotification(t,a=null){if(e.Type.isString(t)&&t!==""){BX.UI.Notification.Center.notify({content:t,actions:a})}}static showFieldError(t,a,i){if(e.Type.isDomNode(a)&&e.Type.isString(t)&&t!==""){e.Dom.remove(a.querySelector(".ui-alert"));const i=new BX.UI.Alert({color:BX.UI.Alert.Color.DANGER,icon:BX.UI.Alert.Icon.DANGER,text:t});const n=i.getContainer();a.appendChild(n);return n}}static getDateFormat(){if(!c.DATE_FORMAT){c.DATE_FORMAT=BX.Main.Date.convertBitrixFormat(e.Loc.getMessage("FORMAT_DATE"))}return c.DATE_FORMAT}static setDayMonthFormat(t){c.dayMonthFormat=t}static getDayMonthFormat(){return c.dayMonthFormat||"j F"}static setLongDateFormat(t){c.longDateFormat=t}static getLongDateFormat(){return c.longDateFormat||"j F Y"}static getDateTimeFormat(){if(!c.DATETIME_FORMAT){c.DATETIME_FORMAT=BX.Main.Date.convertBitrixFormat(e.Loc.getMessage("FORMAT_DATETIME"))}return c.DATETIME_FORMAT}static getTimeFormat(){if(!c.TIME_FORMAT){if(e.Loc.getMessage("FORMAT_DATETIME").slice(0,e.Loc.getMessage("FORMAT_DATE").length)===e.Loc.getMessage("FORMAT_DATE")){c.TIME_FORMAT=BX.util.trim(c.getDateTimeFormat().slice(c.getDateFormat().length));c.TIME_FORMAT_BX=BX.util.trim(e.Loc.getMessage("FORMAT_DATETIME").slice(e.Loc.getMessage("FORMAT_DATE").length))}else{c.TIME_FORMAT_BX=a.DateTimeFormat.isAmPmMode()?"H:MI:SS T":"HH:MI:SS";c.TIME_FORMAT=a.DateTimeFormat.convertBitrixFormat(BX.Main.DateTimeFormat.isAmPmMode()?"H:MI:SS T":"HH:MI:SS")}}return c.TIME_FORMAT}static getTimeFormatShort(){if(!c.TIME_FORMAT_SHORT){c.TIME_FORMAT_SHORT=c.getTimeFormat().replace(":s","");c.TIME_FORMAT_SHORT_BX=c.TIME_FORMAT_BX.replace(":SS","")}return c.TIME_FORMAT_SHORT}static getCurrentUserId(){if(!c.currentUserId){c.currentUserId=parseInt(e.Loc.getMessage("USER_ID"))}return c.currentUserId}static getTimeByInt(t){t=parseInt(t);const e=Math.floor(t/60);return{hour:e,min:t-e*60}}static preventSelection(t){t.ondrag=BX.False;t.ondragstart=BX.False;t.onselectstart=BX.False}static getBX(){return window.top.BX||window.BX}static closeAllPopups(){if(i.PopupManager.isAnyPopupShown()){for(let t=0,e=i.PopupManager._popups.length;t<e;t++){if(i.PopupManager._popups[t]&&i.PopupManager._popups[t].isShown()){i.PopupManager._popups[t].close()}}}}static showConfirmPopup(t,a,i={}){this.confirmPopup=new n.MessageBox({message:e.Tag.render(o||(o=r` <div class="calendar-list-slider-messagebox-text"> ${0} </div> `),a),minHeight:120,minWidth:280,maxWidth:300,buttons:BX.UI.Dialogs.MessageBoxButtons.OK_CANCEL,onOk:()=>{var e;t();(e=this.confirmPopup)==null?void 0:e.close()},onCancel:()=>{var t;(t=this.confirmPopup)==null?void 0:t.close()},popupOptions:{events:{onPopupClose:()=>{delete this.confirmPopup}},closeByEsc:false,padding:0,contentPadding:0,animation:"fading-slide"},...i});this.confirmPopup.show()}static sendAnalyticLabel(t){BX.ajax.runAction("calendar.api.calendarajax.sendAnalyticsLabel",{analyticsLabel:t})}static setOptions(t,e){c.config=t;c.additionalParams=e}static setUserSettings(t){c.userSettings=t}static getUserSettings(){return e.Type.isObjectLike(c.userSettings)?c.userSettings:{}}static setCalendarContext(t){c.calendarContext=t}static getCalendarContext(){return c.calendarContext||null}static getMeetingStatusList(){return["Y","N","Q","H"]}static getWorkTimeStart(){const t=this.config.work_time_start.split(".");if(t.length===1){return`${t[0]}.00`}return this.config.work_time_start}static getWorkTimeEnd(){const t=this.config.work_time_end.split(".");if(t.length===1){return`${t[0]}.00`}return this.config.work_time_end}static isReadOnlyMode(){var t;const e=(t=this.getCalendarContext().util)==null?void 0:t.config.readOnly;if(e===undefined){const t=this.getCalendarContext().sectionManager.getSectionListForEdit();if(!t||t.length===0){return true}}return Boolean(e)}static hasFullAccess(){var t,e,a;return Boolean((t=this.getCalendarContext().util)==null?void 0:(e=t.config)==null?void 0:(a=e.perm)==null?void 0:a.access)}static getSettings(){var t;return(t=this.getCalendarContext().util)==null?void 0:t.config.settings}static hasLocationAccess(){var t,e;return((t=this.getCalendarContext())==null?void 0:(e=t.util)==null?void 0:e.config.locationAccess)||false}static isCollabFeatureEnabled(){var t,e;return((t=this.getCalendarContext())==null?void 0:(e=t.util)==null?void 0:e.config.isCollabFeatureEnabled)||true}static userIsOwner(){var t;return(t=this.getCalendarContext().util)==null?void 0:t.userIsOwner()}static isExtranet(){var t;return(t=this.getCalendarContext().util)==null?void 0:t.isExtranetUser()}static checkEmailLimitationPopup(){return!this.getEventWithEmailGuestEnabled()}static isEventWithEmailGuestAllowed(){return this.getEventWithEmailGuestEnabled()}static setTimezoneList(t){c.timzezoneList=t}static getTimezoneList(){return c.timzezoneList}static setAbsenceAvailable(t){c.absenceAvailable=t}static getAbsenceAvailable(){return c.absenceAvailable}static setEventWithEmailGuestEnabled(t){c.eventWithEmailGuestEnabled=t}static getEventWithEmailGuestEnabled(){return c.eventWithEmailGuestEnabled}static setProjectFeatureEnabled(t){c.projectFeatureEnabled=t}static isProjectFeatureEnabled(){return c.projectFeatureEnabled}static setIsBitrix24Template(t){c.isBitrix24Template=t}static getIsBitrix24Template(){return c.isBitrix24Template}static setCurrentView(t=null){c.currentCalendarView=t}static getCurrentView(){return c.currentCalendarView||null}static adjustDateForTimezoneOffset(t,a=0,i=false){if(!e.Type.isDate(t)){throw new TypeError("Wrong type for date attribute. DateTime object expected.")}if(!parseInt(a)||i===true){return t}return new Date(t.getTime()-parseInt(a)*1e3)}static getFormattedTimezone(t){const e=this.getTimeZoneOffset(t);if(e===0){return`(UTC) ${t}`}const a=e>0?"-":"+";const i=`0${Math.floor(Math.abs(e)/60)}`.slice(-2);const n=`0${Math.abs(e)%60}`.slice(-2);return`(UTC ${a}${i}:${n}) ${t}`}static getTimezoneDateFromTimestampUTC(t,e){return new Date(t+this.getTimeZoneOffset()*60*1e3-this.getTimeZoneOffset(e)*60*1e3)}static getTimeZoneOffset(t,e=new Date){let a;try{a=new Date(e.toLocaleString("en-US",{timeZone:t})).getTime()}catch{return 0}const i=new Date(e.toLocaleString("en-US",{timeZone:"UTC"})).getTime();return parseInt((i-a)/6e4)}static randomInt(t,e){return Math.round(t-.5+Math.random()*(e-t+1))}static getRandomColor(){const t=c.getDefaultColorList();return t[c.randomInt(0,t.length-1)]}static setAccessNames(t={}){c.accessNames={};for(const e in t){if(t.hasOwnProperty(e)){c.setAccessName(e,t[e])}}}static getAccessName(t){return c.accessNames[t]||t}static setAccessName(t,e){c.accessNames[t]=e}static getRandomInt(t=6){return Math.round(Math.random()*10**t)}static displayError(t,a){if(e.Type.isArray(t)){let e="";for(const a of t){e+=`${a.message}\n`}t=e}setTimeout((()=>{alert(t||"[Bitrix Calendar] Request error");if(a){location.reload()}}),200)}static convertEntityToAccessCode(t){if(e.Type.isObjectLike(t)){if(t.entityId==="meta-user"&&t.id==="all-users"){return"UA"}if(t.entityId==="user"){return`U${t.id}`}if(t.entityId==="project"){return`SG${t.id}_K`}if(t.entityId==="department"){return`DR${t.id}`}if(t.entityId==="group"){return t.id}}}static extendPlannerWatches({entries:t,userId:e}){t.forEach((t=>{if(t.type==="user"&&parseInt(t.id,10)!==parseInt(e,10)){const e=c.PLANNER_PULL_TAG.replace("#USER_ID#",t.id);if(!c.PLANNER_WATCH_LIST.includes(e)){BX.PULL.extendWatch(e);c.PLANNER_WATCH_LIST.push(e)}}}))}static clearPlannerWatches(){c.PLANNER_WATCH_LIST.forEach((t=>{BX.PULL.clearWatch(t)}));c.PLANNER_WATCH_LIST=[]}static registerRequestId(){const t=BX.Calendar.Util.getRandomInt(8);c.REQUEST_ID_LIST.push(t);return t}static unregisterRequestId(t){c.REQUEST_ID_LIST=c.REQUEST_ID_LIST.filter((e=>e!==t))}static checkRequestId(t){t=parseInt(t);return!e.Type.isInteger(t)||!c.REQUEST_ID_LIST.includes(t)}static initHintNode(t){var a;const i=c.getBX();if(e.Type.isElementNode(t)&&i!=null&&(a=i.UI)!=null&&a.Hint){var n,r;if(i!=null&&(n=i.UI)!=null&&(r=n.Hint)!=null&&r.popup){i.UI.Hint.popup.destroy();i.UI.Hint.popup=null;i.UI.Hint.content=null}i.UI.Hint.initNode(t)}}static documentIsDisplayingNow(){return!document.hidden}static removeHash(){if("pushState"in history){history.pushState("",document.title,window.location.pathname+window.location.search)}else{const t=document.body.scrollTop;const e=document.body.scrollLeft;window.location.hash="";document.body.scrollTop=t;document.body.scrollLeft=e}}static setIphoneConnectionStatus(t){c.iphoneConnectionStatus=t}static isIphoneConnected(){return c.iphoneConnectionStatus}static setMacConnectionStatus(t){c.macConnectionStatus=t}static isMacConnected(){return c.macConnectionStatus}static setIcloudConnectionStatus(t){c.icloudConnectionStatus=t}static isIcloudConnected(){return c.icloudConnectionStatus}static setGoogleConnectionStatus(t){c.googleConnectionStatus=t}static isGoogleConnected(){return c.googleConnectionStatus}static setIsSharingFeatureEnabled(t){c.isSharingFeatureEnabled=t}static checkSharingFeatureEnabled(){return c.isSharingFeatureEnabled}static setSharingConfig(t){c.sharingConfig=t}static getSharingConfig(){return c.sharingConfig}static async downloadIcsFileByEventId(t,e="event"){const{status:a,data:i}=await c.getBX().ajax.runAction("calendar.api.calendarentryajax.getIcsContent",{data:{eventId:t}});if(a!=="success"){return}return c.downloadIcsFile(i,e)}static downloadIcsFile(t,e){const a=document.createElement("a");a.href=`data:text/calendar,${encodeURI(t)}`;a.download=e;a.click()}static filterSectionsByContext(t,{isCollabUser:a,calendarType:i,calendarOwnerId:n}){if(!e.Type.isArray(t)||!a){return t}const r=t=>e.Type.isFunction(t.isCollab)&&t.isCollab()||t.IS_COLLAB;switch(i){case"user":return t.filter((t=>r(t)));case"group":const a=t=>{const a=e.Type.isNumber(t.ownerId)&&t.ownerId||parseInt(t.OWNER_ID,10);return a===n};return t.filter((t=>r(t)&&a(t)));default:return t}}}c.PLANNER_PULL_TAG="calendar-planner-#USER_ID#";c.PLANNER_WATCH_LIST=[];c.REQUEST_ID_LIST=[];c.accessNames={};t.Util=c})(this.BX.Calendar=this.BX.Calendar||{},BX,BX.Main,BX.Main,BX.UI.Dialogs); //# sourceMappingURL=util.bundle.map.js