Your IP : 3.135.218.63


Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/aspro.allcorp3/
Upload File :
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/aspro.allcorp3/notice.min.js

if(void 0===window.JNotice){let svgError='<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg">\n      <path d="M40.7071 19.2929C41.0976 19.6834 41.0976 20.3166 40.7071 20.7071L31.4142 30L40.7071 39.2929C41.0976 39.6834 41.0976 40.3166 40.7071 40.7071C40.3166 41.0976 39.6834 41.0976 39.2929 40.7071L30 31.4142L20.7071 40.7071C20.3166 41.0976 19.6834 41.0976 19.2929 40.7071C18.9024 40.3166 18.9024 39.6834 19.2929 39.2929L28.5858 30L19.2929 20.7071C18.9024 20.3166 18.9024 19.6834 19.2929 19.2929C19.6834 18.9024 20.3166 18.9024 20.7071 19.2929L30 28.5858L39.2929 19.2929C39.6834 18.9024 40.3166 18.9024 40.7071 19.2929Z"/>\n      <path fill-rule="evenodd" clip-rule="evenodd" d="M0 30C0 13.4315 13.4315 0 30 0C46.5685 0 60 13.4315 60 30C60 46.5685 46.5685 60 30 60C13.4315 60 0 46.5685 0 30ZM30 2C14.536 2 2 14.536 2 30C2 45.464 14.536 58 30 58C45.464 58 58 45.464 58 30C58 14.536 45.464 2 30 2Z"/>\n      </svg>',svgAuth='<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg">\n    <path fill-rule="evenodd" clip-rule="evenodd" d="M30 14C22.8203 14 17 19.8203 17 27C17 34.1797 22.8203 40 30 40C37.1797 40 43 34.1797 43 27C43 19.8203 37.1797 14 30 14ZM19 27C19 20.9249 23.9249 16 30 16C36.0751 16 41 20.9249 41 27C41 33.0751 36.0751 38 30 38C23.9249 38 19 33.0751 19 27Z"/>\n    <path fill-rule="evenodd" clip-rule="evenodd" d="M0 30C0 13.4315 13.4315 0 30 0C46.5685 0 60 13.4315 60 30C60 46.5685 46.5685 60 30 60C13.4315 60 0 46.5685 0 30ZM30 2C14.536 2 2 14.536 2 30C2 38.8944 6.14718 46.8202 12.6133 51.9492C17.5183 48.4552 23.5206 46.4 30 46.4C36.4794 46.4 42.4817 48.4552 47.3866 51.9492C53.8528 46.8202 58 38.8944 58 30C58 14.536 45.464 2 30 2ZM30 58C24.1894 58 18.7922 56.2301 14.3182 53.1999C18.792 50.1697 24.188 48.4 30 48.4C35.812 48.4 41.208 50.1698 45.6818 53.1999C41.2077 56.2301 35.8106 58 30 58Z"/>\n    <g opacity="0.1">\n    <path d="M31.5 39C36.7467 39 41 34.9706 41 30C41 25.0294 36.7467 21 31.5 21C26.2533 21 22 25.0294 22 30C22 34.9706 26.2533 39 31.5 39Z"/>\n    <path d="M18 55.8C19.9882 54.4667 25.3811 51 32.5385 51C39.6959 51 43.6154 52.6 45 53.4C42.9231 55.8 38.1834 59 32.2189 59C26.2544 59 20.7692 57.4 18 55.8Z"/>\n    </g>\n    </svg>';window.JNoticeSurface=function(config){var _private={inited:!1};Object.defineProperties(this,{inited:{get:function(){return _private.inited},set:function(value){value&&(_private.inited=!0)}}}),this.config=function(key){if("object"==typeof config&&void 0!==key&&Object.keys(config).indexOf(key)>-1)return config[key]},this.init()},window.JNoticeSurface.prototype={node:null,inner:null,notices:[],bUseJquery:!1,get side(){var side;return"left"===this.config("side")?"left":"right"},get reverse(){return Boolean(this.config("reverse"))},get classname(){return"notice-surface--"+this.side+(this.reverse?" notice-surface--reverse":"")},init:function(){this.inited||(this.inited=!0,this.node=BX.create({tag:"div",attrs:{class:"notice-surface "+this.classname},html:'<div class="notice-surface__inner"></div>'}),this.node.noticeSurface=this,this.inner=this.node.querySelector(".notice-surface__inner"),this.bUseJquery="function"==typeof jQuery,BX.ready(BX.delegate((function(){BX.append(this.node,document.body)}),this)))},search:function(notice){if(void 0!==notice&&notice instanceof window.JNotice)for(var i in this.notices)if(this.notices[i]===notice)return i;return!1},create:function(config){var notice=new JNotice(config);return notice.appendTo(this),notice},append:function(notice){if(void 0!==notice&&notice instanceof window.JNotice){if(notice.removed||notice.inserted&&notice.surface!==this)return!1;var index=this.search(notice);return index||(this.notices.push(notice),index=this.notices.length-1,BX.prepend(notice.node,this.inner)),notice.inserted||notice.appendTo(this),index}return!1},remove:function(index){if(void 0!==index&&void 0!==this.notices[index]){var notice=this.notices[index];delete this.notices[index],this.notices.splice(index,1),BX.remove(notice.node),notice.remove()}},clear:function(){for(i in this.notices)void 0!==this.notices[i]&&this.notices[i].remove();this.notices=[]},getItemName:function(options){let item=options.item,name="",detail=item.querySelector(".js-popup-title");if(detail&&(name=detail.textContent),!1!==options.useDataItem){var data=item.querySelector("[data-item]");if(data&&(data=this.bUseJquery?jQuery(data).data("item"):BX.data(data,"item"))){if(!this.bUseJquery)try{"object"==typeof(data=JSON.parse(data.toString()))&&data||(data={})}catch(e){data={}}data&&(name=data.NAME)}}return name},getItemImg:function(options){let item=options.item,src="",image=item.querySelector(".detail-info__image");if(image){let dataSrc=this.bUseJquery?jQuery(image).data("src"):BX.data(image,"src");dataSrc&&(src=dataSrc)}else if(image=item.querySelector("meta[itemprop=image]"))src=image.getAttribute("content");else if(image=item.querySelector(".image-list__link link[itemprop=image]"))src=image.getAttribute("href");else if(image=item.querySelector(".image-list-wrapper img")){src=image.getAttribute("src");let dataSrc=this.bUseJquery?jQuery(image).data("src"):BX.data(image,"src");dataSrc&&!BX.hasClass(image,"lazyloaded")&&(src=dataSrc)}return src},getMoreContent:function(items){let moreText="";if(items.length>1){var cntMore=items.length-1,titles=[BX.message("NOTICE_PRODUCT1"),BX.message("NOTICE_PRODUCT2"),BX.message("NOTICE_PRODUCT0")],cases=[2,0,1,1,1,2];moreText='<div class="notice__detail__more font_bold">'+BX.message("NOTICE_MORE").replace("#COUNT#",cntMore).replace("#PRODUCTS#",titles[cntMore%100>4&&cntMore%100<20?2:cases[Math.min(cntMore%10,5)]])+"</div>"}return moreText},onRequestError:function(xhr){var content={title:BX.message("NOTICE_REQUEST_ERROR"),detail:xhr.status+" "+xhr.statusText,image:svgError};return this.create({closeable:!0,autoclose:3e3,type:"requesterror",content:content})},onResultError:function(response){var content={title:BX.message("NOTICE_ERROR"),detail:response.error,image:svgError};return this.create({closeable:!0,autoclose:3e3,type:"resulterror",content:content})},onAuth:function(user){if("object"==typeof user&&user&&BX.message("USER_ID")){var content={title:BX.message("NOTICE_AUTHORIZED"),detail:user.login?user.login:user.fullname,image:user.image?user.image:svgAuth};return this.create({closeable:!0,autoclose:3e3,type:"auth",content:content,link:arAsproOptions.THEME.PERSONAL_PAGE_URL})}},onAdd2cart:function(items){if("object"==typeof items&&items.length)for(i in items){var item=items[i];if(item instanceof Node&&(item=item.closest(".js-popup-block"))){var content={title:BX.message("NOTICE_ADDED2CART"),detail:this.getItemName({item:item}),image:this.getItemImg({item:item})};return content.detail+=this.getMoreContent(items),this.create({closeable:!0,autoclose:3e3,type:"add2cart",link:arAsproOptions.THEME.BASKET_PAGE_URL,content:content})}}},onAdd2Compare:function(items){if("object"==typeof items&&items.length)for(i in items){var item=items[i];if(item instanceof Node&&(item=item.closest(".js-popup-block"))){var content={title:BX.message("NOTICE_ADDED2COMPARE"),detail:this.getItemName({item:item,useDataItem:!1}),image:this.getItemImg({item:item,useDataItem:!1})};return content.detail+=this.getMoreContent(items),this.create({closeable:!0,autoclose:3e3,type:"add2compare",link:arAsproOptions.THEME.COMPARE_PAGE_URL,content:content})}}}},window.JNoticeSurface.get=function(config){var side,reverse,classname=".notice-surface.notice-surface--"+("left"===(config="object"==typeof config?config:{}).side?"left":"right")+(Boolean(config.reverse)?".notice-surface--reverse":":not(.notice-surface--reverse)"),surface=document.querySelector(classname);return surface=surface?surface.noticeSurface:new window.JNoticeSurface(config)},window.JNotice=function(config){var _private={surface:!1,inited:!1,removed:!1};Object.defineProperties(this,{surface:{get:function(){return _private.surface},set:function(value){void 0!==value&&value instanceof window.JNoticeSurface&&!this.inserted&&!this.removed&&(_private.surface=value,value.append(this),this.show(),BX.onCustomEvent("onAppendNotice",{notice:this}))}},inserted:{get:function(){return _private.surface instanceof window.JNoticeSurface}},inited:{get:function(){return _private.inited},set:function(value){value&&(_private.inited=!0)}},removed:{get:function(){return _private.removed},set:function(value){value&&(_private.removed=!0)}}}),this.config=function(key){if("object"==typeof config&&void 0!==key&&Object.keys(config).indexOf(key)>-1)return config[key]},this.init()},window.JNotice.prototype={node:null,inner:null,closer:null,handlers:{onClickNode:function(event){event||(event=window.event);var target=event.target||event.srcElement;if(void 0!==target&&target&&!target.closest("a")&&!target.closest(".notice__closer")){BX.PreventDefault(event);var notice=target.closest(".notice");notice&&(notice=notice.notice).link.length&&(location.href=notice.link)}},onMouseEnterNode:function(event){event||(event=window.event);var target=event.target||event.srcElement;if(void 0!==target&&target){var notice=target.closest(".notice");notice&&(notice=notice.notice).autoclose&&(notice.closed||notice.stopAutoClose())}},onMouseLeaveNode:function(event){event||(event=window.event);var target=event.target||event.srcElement;if(void 0!==target&&target){var notice=target.closest(".notice");notice&&(notice=notice.notice,BX.removeClass(notice.node,"animate--notice-click"),notice.closed||notice.startAutoClose())}},onMouseDownNode:function(event){event||(event=window.event);var target=event.target||event.srcElement;if(void 0!==target&&target){var notice=target.closest(".notice");notice&&(notice=notice.notice,BX.addClass(notice.node,"animate--notice-click"))}},onMouseUpNode:function(event){event||(event=window.event);var target=event.target||event.srcElement;if(void 0!==target&&target){var notice=target.closest(".notice");notice&&(notice=notice.notice,BX.removeClass(notice.node,"animate--notice-click"))}},onClickCloser:function(event){event||(event=window.event);var target=event.target||event.srcElement;if(void 0!==target&&target){for(var notice=null,parent=target;parent;){if(parent.matches(".notice")){notice=parent;break}parent=parent.parentElement||parent.parentNode}notice&&(notice=notice.notice,BX.addClass(notice.node,"notice--closed"),notice.remove())}}},get visible(){return!BX.hasClass(this.node,"notice--hidden")&&this.inserted},get closed(){return BX.hasClass(this.node,"notice--closed")},get closeable(){return Boolean(this.config("closeable"))},get autoclose(){var autoclose=parseInt(this.config("autoclose"));return autoclose||0},get classname(){var classname=this.config("classname");return"string"==typeof classname?classname:""},get type(){var type=this.config("type");return"string"==typeof type?type:""},get link(){var link=this.config("link");return"string"==typeof link?link:""},get content(){var content=this.config("content");if("function"==typeof content&&(content=content()),"object"==typeof content){var title=void 0!==content.title&&content.title?"function"==typeof content.title?content.title():content.title.toString():"",detail=void 0!==content.detail&&content.detail?"function"==typeof content.detail?content.detail():content.detail.toString():"",image=void 0!==content.image&&content.image?"function"==typeof content.image?content.image():content.image.toString():"",image_link=void 0!==content.image_link&&content.image_link?"function"==typeof content.image_link?content.image_link():content.image_link.toString():"",bSvgImage=image.match(/^<svg[\s>]/);(title.length||detail.length||image.length)&&(content='<div class="line-block line-block--20 line-block--align-flex-start">',image&&(content+='<div class="line-block__item"><div class="notice__image'+(bSvgImage?" notice__image--svg":"")+'">'+(image_link?'<a href="'+image_link+'">':"")+(bSvgImage?'<i class="svg inline colored" aria-hidden="true">'+image+"</i>":'<img src="'+image+'" />')+(image_link?"</a>":"")+"</div></div>"),(title||detail)&&(content+='<div class="line-block__item">',title&&(content+='<div class="notice__title switcher-title font_bold">'+title+"</div>"),detail&&(content+='<div class="notice__detail font_14">'+detail+"</div>"),content+="</div>"),content+="</div>")}return void 0===content?"":content.toString()},init:function(){if(!this.inited){this.inited=!0;var closer=this.closeable?'<span class="notice__closer stroke-theme-hover" title="'+BX.message("NOTICE_CLOSE")+'"><i class="svg inline  svg-inline-" aria-hidden="true"><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 1L1 13M1 1L13 13" stroke="#999999" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></i></span>':"";this.node=BX.create({tag:"div",attrs:{class:"notice notice--hidden"+(this.classname.length?" "+this.classname:"")+(this.link.length?" notice--link":"")},dataset:{type:this.type},html:closer+'<div class="notice__inner">'+this.content+"</div>"}),this.node.notice=this,this.inner=this.node.querySelector(".notice__inner"),this.closeable&&(this.closer=this.node.querySelector(".notice__closer")),this.bindEvents(),BX.onCustomEvent("onInitNotice",{notice:this})}},bindEvents:function(){this.node&&("function"==typeof this.handlers.onClickNode&&this.node.addEventListener("click",this.handlers.onClickNode),"function"==typeof this.handlers.onMouseEnterNode&&this.node.addEventListener("mouseenter",this.handlers.onMouseEnterNode),"function"==typeof this.handlers.onMouseLeaveNode&&this.node.addEventListener("mouseleave",this.handlers.onMouseLeaveNode),"function"==typeof this.handlers.onMouseEnterNode&&this.node.addEventListener("mousedown",this.handlers.onMouseDownNode),"function"==typeof this.handlers.onMouseLeaveNode&&this.node.addEventListener("mouseup",this.handlers.onMouseUpNode)),this.closeable&&this.closer&&"function"==typeof this.handlers.onClickCloser&&this.closer.addEventListener("click",this.handlers.onClickCloser)},unbindEvents:function(){this.node&&("function"==typeof this.handlers.onClickNode&&this.node.removeEventListener("click",this.handlers.onClickNode),"function"==typeof this.handlers.onMouseEnterNode&&this.node.removeEventListener("mouseenter",this.handlers.onMouseEnterNode),"function"==typeof this.handlers.onMouseLeaveNode&&this.node.removeEventListener("mouseleave",this.handlers.onMouseLeaveNode),"function"==typeof this.handlers.onMouseEnterNode&&this.node.removeEventListener("mousedown",this.handlers.onMouseDownNode),"function"==typeof this.handlers.onMouseLeaveNode&&this.node.removeEventListener("mouseup",this.handlers.onMouseUpNode)),this.closer&&"function"==typeof this.handlers.onClickCloser&&this.closer.removeEventListener("click",this.handlers.onClickCloser)},callback:function(callback){"function"==typeof callback&&callback()},appendTo:function(surface){this.surface=surface},show:function(callback){this.visible?this.callback(callback):(BX.addClass(this.node,"animate--notice-show"),BX.removeClass(this.node,"notice--hidden"),setTimeout(BX.delegate((function(){BX.removeClass(this.node,"animate--notice-show"),this.startAutoClose(),this.callback(callback)}),this),600),BX.onCustomEvent("onShowNotice",{notice:this}))},hide:function(callback){if(this.visible){var that=this;setTimeout((function(){that.node.style.height=that.node.getBoundingClientRect().height+"px",that.node.style.opacity=1,setTimeout((function(){BX.addClass(that.node,"animate--notice-hide"),setTimeout((function(){BX.addClass(that.node,"notice--hidden"),BX.removeClass(that.node,"animate--notice-hide"),that.callback(callback)}),700)}),25),BX.onCustomEvent("onHideNotice",{notice:that})}),100)}else this.callback(callback)},remove:function(){this.removed||(this.removed=!0,this.hide(BX.delegate((function(){this.unbindEvents(),this.inserted&&this.surface.remove(this.surface.search(this)),BX.onCustomEvent("onRemoveNotice",{notice:this})}),this)))},startAutoClose:function(){this.stopAutoClose(),this.autoclose&&(this.autocloseTimer=setTimeout(BX.delegate((function(){this.remove()}),this),this.autoclose))},stopAutoClose:function(){void 0!==this.autocloseTimer&&this.autocloseTimer&&(clearTimeout(this.autocloseTimer),this.autocloseTimer=!1)}}}
//# sourceMappingURL=notice.min.js.map