File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/js/im/v2/lib/utils/dist/utils.bundle.min.js
Back
this.BX=this.BX||{};this.BX.Messenger=this.BX.Messenger||{};this.BX.Messenger.v2=this.BX.Messenger.v2||{};(function(e,t,s,i){"use strict";const r=navigator.userAgent.toLowerCase();const n={isChrome(){return s.Browser.isChrome()},isFirefox(){return s.Browser.isFirefox()},isIe(){return s.Browser.isIE()},isSafari(){if(this.isChrome()){return false}if(!r.includes("safari")){return false}return!this.isSafariBased()},isSafariBased(){if(!r.includes("applewebkit")){return false}return r.includes("yabrowser")||r.includes("yaapp_ios_browser")||r.includes("crios")},findParent(e,t){const i=t instanceof HTMLElement;if(!t||!s.Type.isString(t)&&!i){return null}for(;e&&e!==document;e=e.parentNode){if(s.Type.isString(t)){if(s.Dom.hasClass(t)){return e}}else if(i&&e===t){return e}}return null}};const a={getFormatType(e=i.DateFormat.default){let t=[];if(e===i.DateFormat.groupTitle){t=[["tommorow","tommorow"],["today","today"],["yesterday","yesterday"],["",s.Loc.getMessage("IM_UTILS_FORMAT_DATE")]]}else if(e===i.DateFormat.message){t=[["",s.Loc.getMessage("IM_UTILS_FORMAT_TIME")]]}else if(e===i.DateFormat.recentTitle){t=[["tommorow","today"],["today","today"],["yesterday","yesterday"],["",s.Loc.getMessage("IM_UTILS_FORMAT_DATE_RECENT")]]}else if(e===i.DateFormat.recentLinesTitle){t=[["tommorow","tommorow"],["today","today"],["yesterday","yesterday"],["",s.Loc.getMessage("IM_UTILS_FORMAT_DATE_RECENT")]]}else if(e===i.DateFormat.readedTitle){t=[["tommorow","tommorow, "+s.Loc.getMessage("IM_UTILS_FORMAT_TIME")],["today","today, "+s.Loc.getMessage("IM_UTILS_FORMAT_TIME")],["yesterday","yesterday, "+s.Loc.getMessage("IM_UTILS_FORMAT_TIME")],["",s.Loc.getMessage("IM_UTILS_FORMAT_READED")]]}else if(e===i.DateFormat.vacationTitle){t=[["",s.Loc.getMessage("IM_UTILS_FORMAT_DATE_SHORT")]]}else{t=[["tommorow","tommorow, "+s.Loc.getMessage("IM_UTILS_FORMAT_TIME")],["today","today, "+s.Loc.getMessage("IM_UTILS_FORMAT_TIME")],["yesterday","yesterday, "+s.Loc.getMessage("IM_UTILS_FORMAT_TIME")],["",s.Loc.getMessage("IM_UTILS_FORMAT_DATE_TIME")]]}return t},getDateFunction(e=null){if(this.dateFormatFunction){return this.dateFormatFunction}this.dateFormatFunction=Object.create(BX.Main.Date);if(e){this.dateFormatFunction._getMessage=t=>e[t]}return this.dateFormatFunction},format(e,t=null,s=null){if(!t){t=this.getFormatType(i.DateFormat.default,s)}return this.getDateFunction(s).format(t,e)},cast(e,t=new Date){let i=t;if(e instanceof Date){i=e}else if(s.Type.isString(e)){i=new Date(e)}else if(s.Type.isNumber(e)){i=new Date(e*1e3)}if(i instanceof Date&&Number.isNaN(i.getTime())){i=t}return i},getTimeToNextMidnight(){const e=new Date((new Date).setHours(24,0,0)).getTime();return e-Date.now()},getStartOfTheDay(){return new Date((new Date).setHours(0,0))},isToday(e){return this.cast(e).toDateString()===(new Date).toDateString()}};const o=navigator.userAgent.toLowerCase();const c={isDesktop(){return!this.isMobile()},isMobile(){if(!s.Type.isUndefined(this.isMobileStatic)){return this.isMobileStatic}this.isMobileStatic=o.includes("android")||o.includes("webos")||o.includes("iphone")||o.includes("ipad")||o.includes("ipod")||o.includes("blackberry")||o.includes("windows phone");return this.isMobileStatic},orientationHorizontal:"horizontal",orientationPortrait:"portrait",getOrientation(){if(!this.isMobile()){return this.orientationHorizontal}return Math.abs(window.orientation)===0?this.orientationPortrait:this.orientationHorizontal}};const l=navigator.userAgent.toLowerCase();const u={isMac(){return s.Browser.isMac()},isLinux(){return s.Browser.isLinux()},isWindows(){return s.Browser.isWin()||!this.isMac()&&!this.isLinux()},isBitrixMobile(){return l.includes("bitrixmobile")},isBitrixDesktop(){return l.includes("bitrixdesktop")},getDesktopVersion(){if(!s.Type.isUndefined(this.getDesktopVersionStatic)){return this.getDesktopVersionStatic}if(s.Type.isUndefined(window.BXDesktopSystem)){return 0}const e=window.BXDesktopSystem.GetProperty("versionParts");this.getDesktopVersionStatic=e[3];return this.getDesktopVersionStatic},isDesktopFeatureEnabled(e){if(!this.isBitrixDesktop()||!s.Type.isFunction(BXDesktopSystem.FeatureEnabled)){return false}return!!BXDesktopSystem.FeatureEnabled(e)},isMobile(){return this.isAndroid()||this.isIos()||this.isBitrixMobile()},isIos(){return s.Browser.isIOS()},getIosVersion(){if(!this.isIos()){return null}const e=l.match(/(iphone|ipad)(.+)(OS\s([0-9]+)([_.]([0-9]+))?)/i);if(!e||!e[4]){return null}return parseFloat(e[4]+"."+(e[6]?e[6]:0))},isAndroid(){return s.Browser.isAndroid()},openNewPage(e){if(!e){return false}if(this.isBitrixMobile()){const t=window.BX.MobileTools;if(s.Type.isUndefined()){const s=t.resolveOpenFunction(e);if(s){s();return true}}window.app.openNewPage(e);return true}window.open(e,"_blank");return true}};const p={getLogTrackingParams(e={}){const t=[];let{name:i="tracking",data:r=[]}=e;const{dialog:n=null,message:a=null,files:o=null}=e;i=encodeURIComponent(i);if(s.Type.isPlainObject(r)){const e=[];for(const t in r){if(r.hasOwnProperty(t)){e.push(encodeURIComponent(t)+"="+encodeURIComponent(r[t]))}}r=e}else if(!s.Type.isArray(r)){r=[]}if(s.Type.isObjectLike(n)){t.push("timType="+n.type);if(n.type==="lines"){t.push("timLinesType="+n.entityId.split("|")[0])}}if(!s.Type.isNull(o)){let e="file";if(s.Type.isArray(o)&&o[0]){e=o[0].type}else if(s.Type.isObjectLike(o)){e=o.type}t.push("timMessageType="+e)}else if(!s.Type.isNull(a)){t.push("timMessageType=text")}if(u.isBitrixMobile()){t.push("timDevice=bitrixMobile")}else if(u.isBitrixDesktop()){t.push("timDevice=bitrixDesktop")}else if(u.isIos()||u.isAndroid()){t.push("timDevice=mobile")}else{t.push("timDevice=web")}return i+(r.length?"&"+r.join("&"):"")+(t.length?"&"+t.join("&"):"")}};const g={convertHtmlEntities(e){return s.Dom.create({tag:"span",html:e}).innerText},convertSnakeToCamelCase(e){return e.replace(/(_[a-z])/gi,(e=>e.toUpperCase().replace("_","")))},escapeRegex(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},getLocalizeForNumber(e,t,i="en"){let r=1;t=parseInt(t);if(t<0){t=t*-1}if(i){switch(i){case"de":case"en":r=t!==1?1:0;break;case"ru":case"ua":r=t%10===1&&t%100!==11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2;break}}return s.Loc.getMessage(e+"_PLURAL_"+r)},getFirstLetters(e){const t=/[\p{L}\p{N} ]/u;const s=e.split(/[\s,]/).filter((e=>{const s=e.charAt(0);return t.test(s)}));if(s.length===0){return""}if(s.length>1){return s[0].charAt(0)+s[1].charAt(0)}return s[0].charAt(0)},insertUnseenWhitespace(e,t){if(e.length<=t){return e}const s="\u200b";let i=e.slice(0,t+1);const r=e.slice(t+1);const n=/\s/.test(i);const a=/\[user=(\d+)(\s)?(replace)?](.*?)\[\/user]/gi.test(e);if(i.length===t+1&&!n&&!a){i+=s}return i+r},isUuidV4(e){if(!s.Type.isString(e)){return false}const t=new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);return e.search(t)===0},checkUrl(e){const t=["http:","https:","ftp:","file:","tel:","callto:","mailto:","skype:","viber:"];const i=["/",...t].find((t=>e.startsWith(t)));if(!i){return false}const r=s.Dom.create({tag:"a",attrs:{href:e}});return t.indexOf(r.protocol)>-1},htmlspecialchars(e){return s.Text.encode(e)},htmlspecialcharsback(e){return s.Text.decode(e)}};const d=s.Extension.getSettings("im.v2.lib.utils");const T={getLastDateText(e={}){if(e.bot||e.network||!e.lastActivityDate){return""}const t=this.isOnline(e.lastActivityDate);const r=this.isMobileOnline(e.lastActivityDate,e.mobileLastDate);let n="";if(t&&e.idle&&!r){n=s.Loc.getMessage("IM_STATUS_AWAY_TITLE").replace("#TIME#",this.getIdleText(e.idle))}const o=this.getLastSeenText(e.lastActivityDate);if(t&&!o){n=this.getStatusTextForLastDate(e.status)}if(o){const t=`IM_LAST_SEEN_${e.gender}`;n=s.Loc.getMessage(t).replace("#POSITION#. ","").replace("#LAST_SEEN#",o)}if(e.absent){const t=a.getDateFunction();const r=a.getFormatType(i.DateFormat.vacationTitle);const o=s.Loc.getMessage("IM_STATUS_VACATION_TITLE").replace("#DATE#",t.format(r,e.absent.getTime()/1e3));n=n?`${n}. ${o}`:o}return n},getIdleText(e=""){if(!e){return""}return a.getDateFunction().format([["s60","sdiff"],["i60","idiff"],["H24","Hdiff"],["","ddiff"]],e)},isOnline(e){if(!e){return false}return Date.now()-e.getTime()<=this.getOnlineLimit()*1e3},isMobileOnline(e,t){if(!e||!t){return false}const s=5*60*1e3;return Date.now()-t.getTime()<this.getOnlineLimit()*1e3&&e-t<s},getStatusTextForLastDate(e){var t;e=e.toUpperCase();return(t=s.Loc.getMessage(`IM_STATUS_${e}`))!=null?t:e},getStatusText(e){var t;e=e.toUpperCase();return(t=s.Loc.getMessage(`IM_STATUS_TEXT_${e}`))!=null?t:e},getLastSeenText(e){if(!e){return""}const t=5*60*1e3;if(Date.now()-e.getTime()>t){return a.getDateFunction().formatLastActivityDate(e)}return""},isBirthdayToday(e){return e===a.format(new Date,"d-m")},getOnlineLimit(){const e=d.get("limitOnline",false);const t=15*60;return e?Number.parseInt(e,10):t},getProfileLink(e){if(s.Type.isString(e)){e=Number.parseInt(e,10)}return`/company/personal/user/${e}/`},getCalendarLink(e){if(s.Type.isString(e)){e=Number.parseInt(e,10)}return`/company/personal/user/${e}/calendar/`},getMentionBbCode(e,t){if(s.Type.isString(e)){e=Number.parseInt(e,10)}return`[USER=${e}]${t}[/USER]`}};const f={getFileExtension(e){return e.split(".").splice(-1)[0]},getIconTypeByFilename(e){const t=this.getFileExtension(e);return this.getIconTypeByExtension(t)},getIconTypeByExtension(e){let t="empty";switch(e.toString()){case"png":case"jpe":case"jpg":case"jpeg":case"gif":case"heic":case"bmp":case"webp":t="img";break;case"mp4":case"mkv":case"webm":case"mpeg":case"hevc":case"avi":case"3gp":case"flv":case"m4v":case"ogg":case"wmv":case"mov":t="mov";break;case"txt":t="txt";break;case"doc":case"docx":t="doc";break;case"xls":case"xlsx":t="xls";break;case"php":t="php";break;case"pdf":t="pdf";break;case"ppt":case"pptx":t="ppt";break;case"rar":t="rar";break;case"zip":case"7z":case"tar":case"gz":case"gzip":t="zip";break;case"set":t="set";break;case"conf":case"ini":case"plist":t="set";break}return t},getFileTypeByExtension(e){let t=i.FileType.file;switch(e){case"png":case"jpe":case"jpg":case"jpeg":case"gif":case"heic":case"bmp":case"webp":t=i.FileType.image;break;case"mp4":case"mkv":case"webm":case"mpeg":case"hevc":case"avi":case"3gp":case"flv":case"m4v":case"ogg":case"wmv":case"mov":t=i.FileType.video;break;case"mp3":t=i.FileType.audio;break}return t},formatFileSize(e){if(!e||e<=0){e=0}const t=["BYTE","KB","MB","GB","TB"];const i=1024;let r=0;while(e>=i&&r<t.length-1){e/=i;r++}const n=s.Loc.getMessage(`IM_UTILS_FILE_SIZE_${t[r]}`);const a=Math.round(e);return`${a} ${n}`},getShortFileName(e,t){if(!e||e.length<t){return e}const s=1;const i=10;const r=this.getFileExtension(e);const n=r.length+s+i;const a=e.slice(-n);const o=e.slice(0,t-a.length-s*3);return`${o.trim()}...${a.trim()}`},getViewerDataAttributes(e){if(!e){return{}}return{"data-viewer":true,"data-viewer-type":e.viewerType,"data-object-id":e.objectId,"data-src":e.src,"data-viewer-group-by":e.viewerGroupBy,"data-title":e.title,"data-actions":e.actions}}};const m={browser:n,date:a,device:c,platform:u,rest:p,text:g,user:T,file:f};e.Utils=m})(this.BX.Messenger.v2.Lib=this.BX.Messenger.v2.Lib||{},BX.Main,BX,BX.Messenger.v2.Const); //# sourceMappingURL=utils.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.24 |
proxy
|
phpinfo
|
Settings