File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/js/socialnetwork/livefeed/dist/livefeed.bundle.min.js
Back
this.BX=this.BX||{};(function(e,t,n,a,s,i){"use strict";var o=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"setStyle",value:function e(t,n){Object.entries(n).forEach((function(e){var n=babelHelpers.slicedToArray(e,2),a=n[0],s=n[1];t.style[a]=s}))}}]);return e}();var l;function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){babelHelpers.defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=function(){function e(){var t=this;babelHelpers.classCallCheck(this,e);this["class"]={pin:"feed-post-pin",post:"feed-item-wrap",postHide:"feed-item-wrap-hide",postComments:"feed-comments-block",postPinned:"feed-post-block-pinned",postPinnedHide:"feed-post-block-pinned-hide",postPinActive:"feed-post-block-pin-active",postUnfollowed:"feed-post-block-unfollowed",postExpanding:"feed-post-block-expand",panelCollapsed:"feed-pinned-panel-collapsed",panelNonEmpty:"feed-pinned-panel-nonempty",panelPosts:"feed-pinned-panel-posts",collapsedPanel:"feed-post-collapsed-panel",collapsedPanelExpand:"feed-post-collapsed-panel-right",collapsedPanelCounterPostsValue:"feed-post-collapsed-panel-count-posts",collapsedPanelCounterComments:"feed-post-collapsed-panel-box-comments",collapsedPanelCounterCommentsValue:"feed-post-collapsed-panel-count-comments-value",collapsedPanelCounterCommentsShown:"feed-post-collapsed-panel-box-shown",collapsedPanelCounterCommentsValueNew:"feed-inform-comments-pinned-new",collapsedPanelCounterCommentsValueNewValue:"feed-inform-comments-pinned-new-value",collapsedPanelCounterCommentsValueNewActive:"feed-inform-comments-pinned-new-active",collapsedPanelCounterCommentsValueOld:"feed-inform-comments-pinned-old",collapsedPanelCounterCommentsValueAll:"feed-inform-comments-pinned-all",collapsedPanelShow:"feed-post-collapsed-panel--show",collapsedPanelHide:"feed-post-collapsed-panel--hide",cancelPanel:"feed-post-cancel-pinned-panel",cancelPanelButton:"feed-post-cancel-pinned-btn",cancelPanelLabel:"feed-post-cancel-pinned-label"};this.panelInitialized=false;this.postsInitialized=false;this.handlePostClick=this.handlePostClick.bind(this);this.options={};a.Event.ready((function(){t.initPosts()}))}babelHelpers.createClass(e,[{key:"resetFlags",value:function e(){this.panelInitialized=false;this.postsInitialized=false}},{key:"init",value:function e(){this.initPanel();this.initPosts();this.initEvents()}},{key:"setOptions",value:function e(t){this.options=c(c({},this.options),t)}},{key:"getOption",value:function e(t){return this.options[t]}},{key:"initPanel",value:function e(){var t=this;if(this.panelInitialized){return}var i=this.getPanelNode();if(!i){return}this.panelInitialized=true;this.adjustCollapsedPostsPanel();a.Event.bind(this.getCollapsedPanelNode(),"click",(function(){var e=t.getPanelNode();if(!e){return}var n=e.offsetHeight;o.setStyle(e,{height:n+"px",transition:"height .5s"});setTimeout((function(){e.style=""}),550);t.hideCollapsedPanel()}));a.Event.bind(i,"click",(function(e){var i=e.target.classList.contains("feed-inform-ilike")||e.target.closest(".feed-inform-ilike")!==null;var o=e.target.classList.contains("feed-inform-follow")||e.target.closest(".feed-inform-follow")!==null;var l=e.target.classList.contains("feed-post-more-link")||e.target.closest(".feed-post-more-link")!==null||e.target.classList.contains("feed-post-right-top-menu");var r=e.target.classList.contains("feed-inform-contentview")||e.target.closest(".feed-inform-contentview")!==null;var c=e.target.classList.contains("".concat(t["class"].pin))||e.target.closest(".".concat(t["class"].pin))!==null;var d=e.target.classList.contains("feed-post-pinned-link-collapse");var u=e.target.classList.contains("feed-inform-comments-pinned")||e.target.closest(".feed-inform-comments-pinned")!==null;var p=null;if(e.target.classList.contains("feed-post-block")){p=e.target}else{p=e.target.closest(".feed-post-block")}if(!p){return}if(p.classList.contains("".concat(t["class"].postPinned))){if(!i&&!o&&!l&&!r&&!c){p.classList.remove("".concat(t["class"].postPinned));var f=p.getAttribute("data-menu-id");if(f){n.MenuManager.destroy(f)}var m=new s.BaseEvent({compatData:[{rootNode:p}],data:{rootNode:p}});s.EventEmitter.emit("BX.Livefeed:recalculateComments",m)}if(u){var g=p.querySelector(".".concat(t["class"].postComments," a[name=comments]"));if(g){var h=a.Dom.getPosition(g);window.scrollTo(0,h.top-200)}}e.stopPropagation();e.preventDefault()}else if(d){p.classList.add("".concat(t["class"].postPinned));e.stopPropagation();e.preventDefault()}}))}},{key:"initPosts",value:function e(){var t=this;if(this.postsInitialized){return}var n=document.querySelectorAll("[data-livefeed-post-pinned]");if(n.length>0){this.postsInitialized=true}Array.from(n).forEach((function(e){a.Event.unbind(e,"click",t.handlePostClick);a.Event.bind(e,"click",t.handlePostClick)}))}},{key:"handlePostClick",value:function e(t){if(!t.target.classList.contains("".concat(this["class"].pin))){return}var n=t.target.closest("[data-livefeed-id]");if(!n){return}var a=n.getAttribute("data-livefeed-post-pinned")==="Y"?"N":"Y";var s=parseInt(n.getAttribute("data-livefeed-id"));if(s<=0){return}this.changePinned({logId:s,newState:a,event:t}).then((function(){}))}},{key:"initEvents",value:function e(){var t=this;s.EventEmitter.subscribe("OnUCCommentWasRead",(function(e){var n=e.getData(),s=babelHelpers.slicedToArray(n,3),i=s[0],o=s[1],l=s[2];var r=t.getCommentsData(i),c=r.oldValue,d=r.newValue;if(!!l["new"]){t.setCommentsData(i,{newValue:a.Type.isInteger(d)?d-1:0,oldValue:a.Type.isInteger(c)?c+1:1})}}));s.EventEmitter.incrementMaxListeners("OnUCCommentWasPulled");s.EventEmitter.subscribe("OnUCCommentWasPulled",(function(e){var n=e.getData(),s=babelHelpers.slicedToArray(n,3),i=s[0],o=s[1],l=s[2];var r=babelHelpers.slicedToArray(i,2),c=r[0],d=r[1];var u=t.getCommentsData(c),p=u.newValue,f=u.oldValue,m=u.allValue,g=u.follow;var h={allValue:a.Type.isInteger(m)?m+1:1};if(parseInt(l.AUTHOR.ID)!==parseInt(BX.message("USER_ID"))){h.newValue=a.Type.isInteger(p)?p+1:1}else{h.oldValue=a.Type.isInteger(f)?f+1:1}t.setCommentsData(c,h)}));s.EventEmitter.subscribe("OnUCommentWasDeleted",(function(e){var n=e.getData(),s=babelHelpers.slicedToArray(n,3),i=s[0],o=s[1],l=s[2];var r=t.getCommentsData(i),c=r.oldValue,d=r.allValue;t.setCommentsData(i,{allValue:a.Type.isInteger(d)?d-1:0,oldValue:a.Type.isInteger(c)?c-1:0})}))}},{key:"changePinned",value:function e(t){var n=this;var s=t.logId?parseInt(t.logId):0;var i=t.event?t.event:null;var o=t.node?t.node:null;var l=t.newState?t.newState:null;var r=this.getPanelNode();if(!o&&!i&&s>0&&r){o=r.querySelector(".".concat(this["class"].post,' > [data-livefeed-id="').concat(s,'"]'))}if(!o&&i){o=i.target}return new Promise((function(e,t){if(!!n.getOption("pinBlocked")||!o||!l){return e()}n.setPostState({node:o,state:l});var i=l==="Y"?"socialnetwork.api.livefeed.logentry.pin":"socialnetwork.api.livefeed.logentry.unpin";a.ajax.runAction(i,{data:{params:{logId:s}},analyticsLabel:{b24statAction:l==="Y"?"pinLivefeedEntry":"unpinLivefeedEntry"}}).then((function(t){if(!t.data.success){n.setPostState({node:o,state:l==="Y"?"N":"Y"});return e()}else{n.movePost({node:o,state:l}).then((function(){return e()}))}}),(function(t){n.setPostState({node:o,state:l==="Y"?"N":"Y"});return e()}))}))}},{key:"setPostState",value:function e(t){var n=t.state?t.state:null;var s=t.node?t.node:null;if(!s||!["Y","N"].includes(n)){return}var i=s.closest("[data-livefeed-post-pinned]");if(!i){return}i.setAttribute("data-livefeed-post-pinned",n);if(n==="Y"){i.classList.add("".concat(this["class"].postPinActive))}else{i.classList.remove("".concat(this["class"].postPinActive))}var o=i.querySelector(".".concat(this["class"].pin));if(o){o.setAttribute("title",a.Loc.getMessage("SONET_EXT_LIVEFEED_PIN_TITLE_".concat(n)))}}},{key:"getPanelNode",value:function e(){return document.querySelector("[data-livefeed-pinned-panel]")}},{key:"getPinnedData",value:function e(t){var n=t.logId?parseInt(t.logId):0;if(n<=0){return Promise.reject()}return new Promise((function(e,s){a.ajax.runAction("socialnetwork.api.livefeed.logentry.getPinData",{data:{params:{logId:n}},headers:[{name:a.Loc.getMessage("SONET_EXT_LIVEFEED_AJAX_ENTITY_HEADER_NAME"),value:t.entityValue||""},{name:a.Loc.getMessage("SONET_EXT_LIVEFEED_AJAX_TOKEN_HEADER_NAME"),value:t.tokenValue||""}]}).then((function(t){return e(t.data)}),(function(e){return s()}))}))}},{key:"movePost",value:function e(t){var n=this;var s=t.state?t.state:null;var i=t.node?t.node:null;return new Promise((function(e,t){if(!i||!["Y","N"].includes(s)){return e()}var l=i.closest("[data-livefeed-post-pinned]");if(!l){return e()}var r=parseInt(l.getAttribute("data-livefeed-id"));if(!r){return e()}var c=n.getPanelNode();if(!c){return e()}var d=l.parentNode.classList.contains("".concat(n["class"].post))?l.parentNode:l;var u=l.getAttribute("data-security-entity-pin");var p=l.getAttribute("data-security-token-pin");if(s==="Y"){var f=d.offsetHeight;d.setAttribute("bx-data-height",f);n.getPinnedData({logId:r,entityValue:u,tokenValue:p}).then((function(t){var s=l.querySelector(".feed-post-pinned-title");var i=l.querySelector(".feed-post-pinned-desc");var u=l.querySelector(".".concat(n["class"].pin));if(s){s.innerHTML=t.TITLE}if(i){i.innerHTML=t.DESCRIPTION}if(u){u.title=a.Loc.getMessage("SONET_EXT_LIVEFEED_PIN_TITLE_Y")}l.classList.add("".concat(n["class"].postPinnedHide));var p=n.getCancelPinnedPanel({logId:r});var m=d.nextSibling;m.parentNode.insertBefore(p,m);n.centerCancelPinnedPanelElements({cancelPinnedPanel:p});p.setAttribute("bx-data-height",f);var g=p.getAttribute("bx-data-height");o.setStyle(p,{height:g+"px"});o.setStyle(d,{position:"absolute",width:"100%",height:f+"px",backgroundColor:"transparent",opacity:0});var h=n.getPanelNode();if(h){n.setOptions({panelHeight:h.offsetHeight})}setTimeout((function(){d.classList.add("".concat(n["class"].postHide));o.setStyle(p,{height:"53px"});o.setStyle(d,{height:0,opacity:0});n.setOptions({pinBlocked:true})}),100);a.Event.unbindAll(d,"transitionend");a.Event.bind(d,"transitionend",(function(e){if(!n.checkTransitionProperty(e,"height")){return}a.Event.unbindAll(d,"transitionend");var t=c.querySelector(".".concat(n["class"].panelPosts));t.insertBefore(d,t.firstChild);n.adjustCollapsedPostsPanel();d.classList.remove("".concat(n["class"].postHide));l.classList.remove("".concat(n["class"].postPinnedHide));n.adjustPanel();n.showCollapsedPostsPanel();setTimeout((function(){l.classList.add("".concat(n["class"].postPinned));o.setStyle(d,{position:"",width:"",height:"80px",backgroundColor:"",opacity:1});n.setOptions({pinBlocked:false});setTimeout((function(){d.classList.remove("".concat(n["class"].postHide));o.setStyle(d,{position:"",width:"",height:"",backgroundColor:"",opacity:""})}),600)}),300)}));return e()}))}else{var m=d.getAttribute("bx-data-height");var g=d.scrollHeight;o.setStyle(d,{transition:""});var h=document.querySelector(".".concat(n["class"].cancelPanel,'[bx-data-log-id="').concat(r,'"]'));if(a.Type.isDomNode(h)){o.setStyle(d,{height:g+"px"});requestAnimationFrame((function(){d.classList.add("".concat(n["class"].postExpanding));h.classList.add("".concat(n["class"].postExpanding));o.setStyle(d,{opacity:0,height:0});o.setStyle(h,{opacity:0,height:0})}));var v=c.classList.contains("".concat(n["class"].panelCollapsed));if(v){h.parentNode.insertBefore(d,h.nextSibling);n.adjustCollapsedPostsPanel();n.adjustPanel()}var y=n.getCollapsedPanelNode().classList.contains("".concat(n["class"].collapsedPanelShow));if(y){n.hideCollapsedPostsPanel();a.Event.unbindAll(h,"transitionend");a.Event.bind(h,"transitionend",(function(e){if(!n.checkTransitionProperty(e,"height")){return}o.setStyle(d,{transform:"",display:"block"});n.animateCancel({post:l,postToMove:d,cancelPinnedPanel:h,height:m})}))}a.Event.unbindAll(d,"transitionend");a.Event.bind(d,"transitionend",(function(e){if(!n.checkTransitionProperty(e,"opacity")){return}if(!v){h.parentNode.insertBefore(d,h.nextSibling);n.adjustCollapsedPostsPanel();n.adjustPanel()}n.animateCancel({post:l,postToMove:d,cancelPinnedPanel:h,height:m})}))}else{l.classList.remove("".concat(n["class"].postPinned));c.parentNode.insertBefore(d,c.nextSibling);n.adjustPanel();var E=d.scrollHeight;d.setAttribute("bx-data-height",E);o.setStyle(d,{opacity:0,height:"80px"});setTimeout((function(){o.setStyle(d,{opacity:1,height:E+"px"})}),100);a.Event.unbindAll(d,"transitionend");a.Event.bind(d,"transitionend",(function(e){if(!n.checkTransitionProperty(e,"height")){return}o.setStyle(d,{height:""})}))}return e()}}))}},{key:"animateCancel",value:function e(t){var n=this;var s=t.post,i=t.postToMove,l=t.cancelPinnedPanel,r=t.height;s.classList.remove("".concat(this["class"].postPinned));setTimeout((function(){o.setStyle(i,{opacity:1,height:r+"px"});o.setStyle(l,{height:0});setTimeout((function(){l.remove()}),100)}),100);a.Event.unbindAll(i,"transitionend");a.Event.bind(i,"transitionend",(function(e){if(!n.checkTransitionProperty(e,"height")){return}s.classList.remove("".concat(n["class"].postPinnedHide));o.setStyle(i,{marginBottom:"",height:""});o.setStyle(l,{marginBottom:"",height:""});i.classList.remove("".concat(n["class"].postExpanding));l.classList.remove("".concat(n["class"].postExpanding))}))}},{key:"getCancelPinnedPanel",value:function e(t){var n=this;var s=t.logId?parseInt(t.logId):0;if(s<=0){return null}var i=document.querySelector(".".concat(this["class"].cancelPanel,'[bx-data-log-id="').concat(s,'"]'));if(!a.Type.isDomNode(i)){i=a.Tag.render(l||(l=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="','" bx-data-log-id="','">\n\t\t\t\t\t<div class="feed-post-cancel-pinned-panel-inner">\n\t\t\t\t\t\t<div class="feed-post-cancel-pinned-content">\n\t\t\t\t\t\t\t<span class="','">','</span>\n\t\t\t\t\t\t\t<span class="feed-post-cancel-pinned-text">','</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button class="ui-btn ui-btn-light-border ui-btn-round ui-btn-sm ','">',"</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\t\n\t\t\t\t"])),this["class"].cancelPanel,s,this["class"].cancelPanelLabel,a.Loc.getMessage("SONET_EXT_LIVEFEED_PINNED_CANCEL_TITLE"),a.Loc.getMessage("SONET_EXT_LIVEFEED_PINNED_CANCEL_DESCRIPTION"),this["class"].cancelPanelButton,a.Loc.getMessage("SONET_EXT_LIVEFEED_PINNED_CANCEL_BUTTON"));a.Event.bind(i.querySelector(".".concat(this["class"].cancelPanelButton)),"click",(function(){n.changePinned({logId:s,newState:"N"}).then((function(){o.setStyle(i,{opacity:0,height:0})}))}))}return i}},{key:"centerCancelPinnedPanelElements",value:function e(t){var n=t.cancelPinnedPanel;if(!a.Type.isDomNode(n)){return}setTimeout((function(){o.setStyle(n,{opacity:1})}),100);o.setStyle(n.querySelector(".".concat(this["class"].cancelPanelLabel)),{marginLeft:n.querySelector(".".concat(this["class"].cancelPanelButton)).getBoundingClientRect().width+"px"})}},{key:"getPostsCount",value:function e(){var t=this.getPanelNode();return t?Array.from(t.getElementsByClassName("".concat(this["class"].post))).length:0}},{key:"hidePinnedItems",value:function e(){var t=this;var n=this.getPanelNode();if(!n){return}o.setStyle(n,{height:parseInt(this.getOption("panelHeight"))+"px"});Array.from(n.getElementsByClassName("".concat(this["class"].post))).reduce((function(e,s){e+=s.offsetHeight;o.setStyle(s,{transition:"opacity .1s linear, transform .2s .1s linear, height .5s linear"});o.setStyle(n,{transition:"height .5s .1s linear"});requestAnimationFrame((function(){o.setStyle(s,{opacity:"0!important",transform:"translateY(-".concat(e,"px)")});o.setStyle(n,{height:"58px"})}));a.Event.unbindAll(s,"transitionend");a.Event.bind(s,"transitionend",(function(e){if(!t.checkTransitionProperty(e,"transform")){return}o.setStyle(s,{display:"none",opacity:"",transform:"",transition:""});o.setStyle(n,{transition:""})}));return e}),0)}},{key:"showPinnedItems",value:function e(){var t=this;var n=this.getPanelNode();if(!n){return}Array.from(n.getElementsByClassName("".concat(this["class"].post))).map((function(e,s,i){o.setStyle(e,{display:"block",opacity:0});requestAnimationFrame((function(){o.setStyle(n,{height:84*(s+1)-4+"px"});o.setStyle(e,{transform:"translateY(".concat(0,"px)"),opacity:1})}));a.Event.unbindAll(e,"transitionend");a.Event.bind(e,"transitionend",(function(a){if(!t.checkTransitionProperty(a,"transform")){return}o.setStyle(e,{display:"block",height:"",transform:""});o.setStyle(n,{height:""});if(s+1===i.length){o.setStyle(n,{transition:"",height:""})}}))}))}},{key:"animateCollapsedPanel",value:function e(){var t=this;requestAnimationFrame((function(){var e=t.getCollapsedPanelNode();o.setStyle(e,{position:"absolute",top:0,width:"100%",opacity:0});e.classList.remove("".concat(t["class"].collapsedPanelHide));e.classList.add("".concat(t["class"].collapsedPanelShow));requestAnimationFrame((function(){o.setStyle(e,{position:"relative",opacity:1})}))}))}},{key:"adjustCollapsedPostsPanel",value:function e(){var t=this;var n=this.getPostsCount();var a=this.getCollapsedPanelNode().querySelector(".".concat(this["class"].collapsedPanelCounterPostsValue));if(a){a.innerHTML=parseInt(n)}var s=this.getCollapsedPanelNode().querySelector(".".concat(this["class"].collapsedPanelCounterComments));var i=this.getCollapsedPanelNode().querySelector(".".concat(this["class"].collapsedPanelCounterCommentsValue));var o=this.getPanelNode();if(s&&i&&o){var l=Array.from(o.querySelectorAll(".".concat(this["class"].collapsedPanelCounterCommentsValueNewValue))).reduce((function(e,n){return e+(n.closest(".".concat(t["class"].postUnfollowed))?0:parseInt(n.innerHTML))}),0);i.innerHTML=l;if(l>0){s.classList.add("".concat(this["class"].collapsedPanelCounterCommentsShown))}else{s.classList.remove("".concat(this["class"].collapsedPanelCounterCommentsShown))}}}},{key:"adjustPanel",value:function e(){var t=this;var n=this.getPanelNode();if(!n){return}setTimeout((function(){if(t.getPostsCount()>0){n.classList.add("".concat(t["class"].panelNonEmpty))}else{n.classList.remove("".concat(t["class"].panelNonEmpty))}}),0)}},{key:"showCollapsedPostsPanel",value:function e(){if(this.getPostsCount()>=a.Loc.getMessage("SONET_EXT_LIVEFEED_COLLAPSED_PINNED_PANEL_ITEMS_LIMIT")){this.showCollapsedPanel();this.hidePinnedItems()}}},{key:"hideCollapsedPostsPanel",value:function e(){if(this.getPostsCount()<a.Loc.getMessage("SONET_EXT_LIVEFEED_COLLAPSED_PINNED_PANEL_ITEMS_LIMIT")){this.getPanelNode().classList.remove("".concat(this["class"].panelCollapsed));this.removeCollapsedPanel();this.showPinnedItems()}}},{key:"showCollapsedPanel",value:function e(){this.getPanelNode().classList.add("".concat(this["class"].panelCollapsed));this.animateCollapsedPanel()}},{key:"hideCollapsedPanel",value:function e(){this.getPanelNode().classList.remove("".concat(this["class"].panelCollapsed));this.showPinnedItems();this.removeCollapsedPanel()}},{key:"removeCollapsedPanel",value:function e(){var t=this.getCollapsedPanelNode();o.setStyle(t,{position:"absolute",top:0,width:"100%"});t.classList.remove("".concat(this["class"].collapsedPanelShow));t.classList.add("".concat(this["class"].collapsedPanelHide))}},{key:"getCommentsNodes",value:function e(t){var n={follow:true,newNode:null,newValueNode:null,oldNode:null,allNode:null};if(!a.Type.isStringFilled(t)){return n}var s=document.querySelector(".".concat(this["class"].postComments,'[data-bx-comments-entity-xml-id="').concat(t,'"]'));if(!s){return n}var i=s.closest(".".concat(this["class"].postPinActive));if(!i){return n}var o=i.querySelector(".".concat(this["class"].collapsedPanelCounterCommentsValueNew));var l=i.querySelector(".".concat(this["class"].collapsedPanelCounterCommentsValueNewValue));var r=i.querySelector(".".concat(this["class"].collapsedPanelCounterCommentsValueOld));var c=i.querySelector(".".concat(this["class"].collapsedPanelCounterCommentsValueAll));if(!o||!l||!r||!c){return n}n.newNode=o;n.newValueNode=l;n.oldNode=r;n.allNode=c;n.follow=s.getAttribute("data-bx-follow")!=="N";return n}},{key:"getCommentsData",value:function e(t){var n={newValue:null,oldValue:null,allValue:null};if(!a.Type.isStringFilled(t)){return n}var s=this.getCommentsNodes(t),i=s.newValueNode,o=s.oldNode,l=s.allNode,r=s.follow;n.follow=r;if(!a.Type.isDomNode(i)||!a.Type.isDomNode(o)){return n}var c=0;var d=0;var u=0;var p=i.innerHTML.match(/(\d+)/);if(p){c=parseInt(p[1])}p=o.innerHTML.match(/(\d+)/);if(p){d=parseInt(p[1])}p=l.innerHTML.match(/(\d+)/);if(p){u=parseInt(p[1])}n.oldValue=d;n.newValue=c;n.allValue=u;return n}},{key:"setCommentsData",value:function e(t,n){if(!a.Type.isStringFilled(t)){return}var s=this.getCommentsNodes(t),i=s.newNode,o=s.newValueNode,l=s.oldNode,r=s.allNode;if(!a.Type.isDomNode(i)||!a.Type.isDomNode(o)||!a.Type.isDomNode(l)||!a.Type.isDomNode(r)){return}if(a.Type.isInteger(n.newValue)){o.innerHTML="".concat(n.newValue);if(n.newValue>0&&!i.classList.contains("".concat(this["class"].collapsedPanelCounterCommentsValueNewActive))){i.classList.add("".concat(this["class"].collapsedPanelCounterCommentsValueNewActive))}else if(n.newValue<=0&&i.classList.contains("".concat(this["class"].collapsedPanelCounterCommentsValueNewActive))){i.classList.remove("".concat(this["class"].collapsedPanelCounterCommentsValueNewActive))}}if(a.Type.isInteger(n.oldValue)){l.innerHTML=n.oldValue}if(a.Type.isInteger(n.allValue)){r.innerHTML=n.allValue}this.adjustCollapsedPostsPanel()}},{key:"getCollapsedPanelNode",value:function e(){return this.getPanelNode().querySelector(".".concat(this["class"].collapsedPanel))}},{key:"checkTransitionProperty",value:function e(t,n){return t.propertyName===n}}]);return e}();var u,p,f;var m=function(){function e(){babelHelpers.classCallCheck(this,e);this.initEvents()}babelHelpers.createClass(e,[{key:"initEvents",value:function t(){s.EventEmitter.subscribe("tasksTaskEvent",(function(t){var n=t.getCompatData(),s=babelHelpers.slicedToArray(n,2),i=s[0],o=s[1];if(i!=="ADD"||!a.Type.isPlainObject(o.options)||!a.Type.isBoolean(o.options.STAY_AT_PAGE)||o.options.STAY_AT_PAGE){return}e.signedFiles=null}));s.EventEmitter.subscribe("SidePanel.Slider:onCloseComplete",(function(t){var n=t.getTarget();if(!n){return}var s=n.getUrl();if(!a.Type.isStringFilled(s)||s!==e.sliderUrl||!a.Type.isStringFilled(e.signedFiles)){return}a.ajax.runAction("intranet.controlbutton.clearNewTaskFiles",{data:{signedFiles:e.signedFiles}}).then((function(){e.signedFiles=null}))}))}}],[{key:"create",value:function e(t){var s=this;if(a.Loc.getMessage("SONET_EXT_LIVEFEED_INTRANET_INSTALLED")==="Y"){a.ajax.runAction("intranet.controlbutton.getTaskLink",{data:{entityType:t.entityType,entityId:t.entityId,postEntityType:a.Type.isStringFilled(t.postEntityType)?t.postEntityType:t.entityType,entityData:{}}}).then((function(e){if(!a.Type.isStringFilled(e.data.SUFFIX)){e.data.SUFFIX=""}var n=e.data;n.DESCRIPTION=s.formatTaskDescription(n.DESCRIPTION,n.URL,t.entityType,n.SUFFIX);if(parseInt(t.parentTaskId)>0){n.PARENT_ID=parseInt(t.parentTaskId)}if(a.Type.isStringFilled(n.UF_TASK_WEBDAV_FILES_SIGN)){s.signedFiles=n.UF_TASK_WEBDAV_FILES_SIGN}s.sliderUrl=e.data.link;BX.SidePanel.Instance.open(e.data.link,{requestMethod:"post",requestParams:n,cacheable:false})}))}else{this.createTaskPopup=new n.Popup("BXCTP",null,{autoHide:false,zIndex:0,offsetLeft:0,offsetTop:0,overlay:false,lightShadow:true,closeIcon:{right:"12px",top:"10px"},draggable:{restrict:true},closeByEsc:false,contentColor:"white",contentNoPaddings:true,buttons:[],content:a.Tag.render(u||(u=babelHelpers.taggedTemplateLiteral(['<div id="BXCTP_content" class="','"></div>'])),this.cssClass.popupContent),events:{onAfterPopupShow:function e(){s.createTaskSetContent(a.Tag.render(p||(p=babelHelpers.taggedTemplateLiteral(['<div class="','">',"</div>"])),s.cssClass.popupTitle,a.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_WAIT")));a.ajax.runAction("socialnetwork.api.livefeed.getRawEntryData",{data:{params:{entityType:t.entityType,entityId:t.entityId,logId:a.Type.isNumber(t.logId)?t.logId:null,additionalParams:{getSonetGroupAvailable:"Y",getLivefeedUrl:"Y",checkPermissions:{feature:"tasks",operation:"create_tasks"}}}}}).then((function(e){var n=a.Type.isStringFilled(e.data.TITLE)?e.data.TITLE:"";var i=a.Type.isStringFilled(e.data.DESCRIPTION)?e.data.DESCRIPTION:"";var o=a.Type.isPlainObject(e.data.DISK_OBJECTS)?e.data.DISK_OBJECTS:[];var l=a.Type.isStringFilled(e.data.LIVEFEED_URL)?e.data.LIVEFEED_URL:"";var r=a.Type.isStringFilled(e.data.SUFFIX)?e.data.SUFFIX:"";var c=a.Type.isPlainObject(e.data.GROUPS_AVAILABLE)?e.data.GROUPS_AVAILABLE:[];var d=!a.Type.isUndefined(e.data.LOG_ID)?parseInt(e.data.LOG_ID):0;if((a.Type.isStringFilled(n)||a.Type.isStringFilled(i))&&a.Type.isStringFilled(l)){var u=s.formatTaskDescription(i,l,t.entityType,r);var p={TITLE:n,DESCRIPTION:u,RESPONSIBLE_ID:a.Loc.getMessage("USER_ID"),CREATED_BY:a.Loc.getMessage("USER_ID"),UF_TASK_WEBDAV_FILES:o};var f=[];for(var m=0,g=Object.entries(c);m<g.length;m++){var h=babelHelpers.slicedToArray(g[m],2),v=h[0],y=h[1];f.push(y)}if(f.length==1){p.GROUP_ID=parseInt(f[0])}if(parseInt(t.entityType)>0){p.PARENT_ID=parseInt(t.entityType)}a.ajax.runComponentAction("bitrix:tasks.task","legacyAdd",{mode:"class",data:{data:p}}).then((function(e){var n=e.data;s.createTaskSetContentSuccess(n.DATA.ID);a.ajax.runAction("socialnetwork.api.livefeed.createEntityComment",{data:{params:{postEntityType:a.Type.isStringFilled(t.postEntityType)?t.postEntityType:t.entityType,sourceEntityType:t.entityType,sourceEntityId:t.entityId,entityType:"TASK",entityId:n.DATA.ID,logId:a.Type.isNumber(t.logId)?t.logId:d>0?d:null}}}).then((function(){}),(function(){}))}),(function(e){if(e.errors&&e.errors.length){var t=[];e.errors.forEach((function(e){t.push(e.message)}));s.createTaskSetContentFailure(t)}}))}else{s.createTaskSetContentFailure([a.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_ERROR_GET_DATA")])}}),(function(){s.createTaskSetContentFailure([a.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_ERROR_GET_DATA")])}))},onPopupClose:function e(){s.createTaskPopup.destroy()}}});this.createTaskPopup.show()}}},{key:"createTaskSetContentSuccess",value:function e(t){var n=a.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_PATH").replace("#user_id#",a.Loc.getMessage("USER_ID")).replace("#task_id#",t);this.createTaskPopup.destroy();window.top.BX.UI.Notification.Center.notify({content:a.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_SUCCESS_TITLE"),actions:[{title:a.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_VIEW"),events:{click:function e(t,a,s){a.close();window.top.BX.SidePanel.Instance.open(n)}}}]})}},{key:"createTaskSetContentFailure",value:function e(t){this.createTaskSetContent(a.Tag.render(f||(f=babelHelpers.taggedTemplateLiteral(['<div>\n\t\t\t<div class="','">','</div>\n\t\t\t<div class="','">',"</div>\n\t\t</div>"])),this.cssClass.popupTitle,a.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_FAILURE_TITLE"),this.cssClass.popupDescription,t.join("<br>")))}},{key:"createTaskSetContent",value:function e(t){var n=document.getElementById("BXCTP_content");if(!n){return}a.Dom.clean(n);n.appendChild(t)}},{key:"formatTaskDescription",value:function e(t,n,s,i){var o=t;i=a.Type.isStringFilled(i)?"_".concat(i):"";if(!!n&&!!s&&n.length>0){o+="\n\n"+a.Loc.getMessage("SONET_EXT_COMMENTAUX_CREATE_TASK_".concat(s).concat(i)).replace("#A_BEGIN#","[URL=".concat(n,"]")).replace("#A_END#","[/URL]")}return o}}]);return e}();babelHelpers.defineProperty(m,"createTaskPopup",null);babelHelpers.defineProperty(m,"cssClass",{popupContent:"feed-create-task-popup-content",popupTitle:"feed-create-task-popup-title",popupDescription:"feed-create-task-popup-description"});babelHelpers.defineProperty(m,"signedFiles",null);babelHelpers.defineProperty(m,"sliderUrl","");var g;var h=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"showBackgroundWarning",value:function e(s){var i=s.urlToEdit,o=s.menuPopupWindow;var l=a.Tag.render(g||(g=babelHelpers.taggedTemplateLiteral(["<div>","</div>"])),a.Loc.getMessage("SONET_EXT_LIVEFEED_POST_BACKGROUND_EDIT_WARNING_DESCRIPTION"));var r=new n.Popup("backgroundWarning",null,{autoHide:true,closeByEsc:true,offsetLeft:0,offsetTop:0,draggable:true,bindOnResize:false,titleBar:a.Loc.getMessage("SONET_EXT_LIVEFEED_POST_BACKGROUND_EDIT_WARNING_TITLE"),closeIcon:true,className:"sonet-livefeed-popup-warning",content:l,events:{},cacheable:false,buttons:[new t.Button({text:a.Loc.getMessage("SONET_EXT_LIVEFEED_POST_BACKGROUND_EDIT_WARNING_BUTTON_SUBMIT"),className:"ui-btn ui-btn-primary",events:{click:function e(){window.location=i;r.close();if(o){o.close()}}}}),new t.Button({text:a.Loc.getMessage("SONET_EXT_LIVEFEED_POST_BACKGROUND_EDIT_WARNING_BUTTON_CANCEL"),className:"ui-btn ui-btn-light",events:{click:function e(){r.close();if(o){o.close()}}}})]});r.show();return false}},{key:"showMenu",value:function e(t){var s=this;if(!a.Type.isPlainObject(t)){t={}}var i=t.menuElement;var o=t.ind;var l=this.getMenuId(o);n.MenuManager.destroy(l);var r=!a.Type.isUndefined(t.log_id)?parseInt(t.log_id):0;if(r<=0){r=parseInt(i.getAttribute("data-log-entry-log-id"))}if(r<=0){return false}var c=t.bFavorites;if(a.Type.isUndefined(c)){c=i.getAttribute("data-log-entry-favorites")==="Y"}var d=t.arMenuItemsAdditional;if(a.Type.isUndefined(d)){d=i.getAttribute("data-bx-items");try{d=JSON.parse(d);if(!a.Type.isPlainObject(d)){d={}}}catch(e){d={}}}var u=t.bindElement;var p=null;var f=u.closest("[data-livefeed-post-pinned]");if(f){var g=f.getAttribute("data-livefeed-post-pinned")==="Y";p={text:g?a.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_PINNED_Y"):a.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_PINNED_N"),className:"menu-popup-no-icon",onclick:function e(t){D.changePinned({logId:r,newState:g?"N":"Y",event:t,node:u});n.MenuManager.getMenuById(s.getMenuId(o)).popupWindow.close();t.preventDefault()}}}var h=a.Loc.getMessage("sonetLbUseFavorites")!=="N"?{text:c?a.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_Y"):a.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_N"),className:"menu-popup-no-icon",onclick:function e(t){__logChangeFavorites(r,"log_entry_favorites_".concat(r),c?"N":"Y",true,t);t.preventDefault();t.stopPropagation()}}:null;var v=[p,h,a.Type.isStringFilled(i.getAttribute("data-log-entry-url"))?{html:'<span id="'.concat(l,'-href-text">').concat(a.Loc.getMessage("sonetLMenuHref"),"</span>"),className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-href",href:i.getAttribute("data-log-entry-url")}:null,a.Type.isStringFilled(i.getAttribute("data-log-entry-url"))?{html:'<span id="'.concat(l,'-link-text">').concat(a.Loc.getMessage("sonetLMenuLink"),"</span>")+'<span id="'.concat(l,'-link-icon-animate" class="post-menu-link-icon-wrap">')+'<span class="post-menu-link-icon" id="'.concat(l,'-link-icon-done" style="display: none;">')+"</span>"+"</span>",className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-link",onclick:function e(t){var n=document.getElementById("".concat(l,"-link-text"));var s=document.getElementById("".concat(l,"-link-icon-done"));if(BX.clipboard.isCopySupported()){if(n&&n.getAttribute("data-block-click")==="Y"){return}BX.clipboard.copy(i.getAttribute("data-log-entry-url"));if(n&&s){s.style.display="inline-block";document.getElementById("".concat(l,"-link-icon-animate")).classList.remove("post-menu-link-icon-animate");a.Dom.adjust(document.getElementById("".concat(l,"-link-text")),{attrs:{"data-block-click":"Y"}});setTimeout((function(){document.getElementById("".concat(l,"-link-icon-animate")).classList.add("post-menu-link-icon-animate")}),1);setTimeout((function(){a.Dom.adjust(document.getElementById("".concat(l,"-link-text")),{attrs:{"data-block-click":"N"}})}),500)}return}var o=t.currentTarget;var r=parseInt(!!o.getAttribute("bx-height")?o.getAttribute("bx-height"):o.offsetHeight);if(o.getAttribute("bx-status")!=="shown"){o.setAttribute("bx-status","shown");var c=document.getElementById("".concat(l,"-link-text"));if(!document.getElementById("".concat(l,"-link"))&&!!c){var d=BX.pos(c);var u=BX.pos(c.parentNode);var p=BX.pos(c.closest(".menu-popup-item"));d.height=u.height-1;a.Dom.adjust(o,{attrs:{"bx-height":o.offsetHeight},style:{overflow:"hidden",display:"block"},children:[a.Dom.create("BR"),a.Dom.create("DIV",{attrs:{id:"".concat(l,"-link")},children:[a.Dom.create("SPAN",{attrs:{className:"menu-popup-item-left"}}),a.Dom.create("SPAN",{attrs:{className:"menu-popup-item-icon"}}),a.Dom.create("SPAN",{attrs:{className:"menu-popup-item-text"},children:[a.Dom.create("INPUT",{attrs:{id:"".concat(l,"-link-input"),type:"text",value:i.getAttribute("data-log-entry-url")},style:{height:"".concat(d.height,"px"),width:"".concat(p.width-21,"px")},events:{click:function e(t){t.currentTarget.select();t.stopPropagation();t.preventDefault()}}})]})]}),a.Dom.create("SPAN",{attrs:{className:"menu-popup-item-right"}})]});Event.bind(document.getElementById("".concat(l,"-link-input")),"click",(function(e){e.currentTarget.select();e.preventDefault();e.stopPropagation()}))}new BX.fx({time:.2,step:.05,type:"linear",start:r,finish:r*2,callback:function(e){this.style.height="".concat(e,"px")}.bind(o)}).start();BX.fx.show(document.getElementById("".concat(l,"-link")),.2);document.getElementById("".concat(l,"-link-input")).select()}else{o.setAttribute("bx-status","hidden");new BX.fx({time:.2,step:.05,type:"linear",start:o.offsetHeight,finish:r,callback:function(e){this.style.height="".concat(e,"px")}.bind(o)}).start();BX.fx.hide(document.getElementById("".concat(l,"-link")),.2)}}}:null,a.Loc.getMessage("sonetLCanDelete")==="Y"?{text:a.Loc.getMessage("sonetLMenuDelete"),className:"menu-popup-no-icon",onclick:function e(t){if(confirm(a.Loc.getMessage("sonetLMenuDeleteConfirm"))){w["delete"]({logId:r,nodeId:"log-entry-".concat(r),ind:o})}t.stopPropagation();t.preventDefault()}}:null,i.getAttribute("data-log-entry-createtask")==="Y"?{text:a.Loc.getMessage("sonetLMenuCreateTask"),className:"menu-popup-no-icon",onclick:function e(t){m.create({entryEntityType:i.getAttribute("data-log-entry-entity-type"),entityType:i.getAttribute("data-log-entry-entity-type"),entityId:i.getAttribute("data-log-entry-entity-id"),logId:parseInt(i.getAttribute("data-log-entry-log-id"))});n.MenuManager.getMenuById(s.getMenuId(o)).popupWindow.close();return t.preventDefault()}}:null,i.getAttribute("data-log-entry-createtask")==="Y"&&i.getAttribute("data-log-entry-entity-type")==="TASK"?{text:a.Loc.getMessage("sonetLMenuCreateSubTask"),className:"menu-popup-no-icon",onclick:function e(t){m.create({entryEntityType:i.getAttribute("data-log-entry-entity-type"),entityType:i.getAttribute("data-log-entry-entity-type"),entityId:i.getAttribute("data-log-entry-entity-id"),logId:parseInt(i.getAttribute("data-log-entry-log-id")),parentTaskId:parseInt(i.getAttribute("data-log-entry-entity-id"))});n.MenuManager.getMenuById(s.getMenuId(o)).popupWindow.close();return t.preventDefault()}}:null];if(!!d&&a.Type.isArray(d)){d.forEach((function(e){if(a.Type.isUndefined(e.className)){e.className="menu-popup-no-icon"}}));v=v.concat(d)}var y={offsetLeft:-14,offsetTop:4,lightShadow:false,angle:{position:"top",offset:50},events:{onPopupShow:function e(t){if(document.getElementById("log_entry_favorites_".concat(r))){var n=null;var s=t.contentContainer.querySelectorAll(".menu-popup-item-text");s.forEach((function(e){if(e.innerHTML===a.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_Y")||e.innerHTML===a.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_N")){n=e}}));if(a.Type.isDomNode(n)){n.innerHTML=document.getElementById("log_entry_favorites_".concat(r)).classList.contains("feed-post-important-switch-active")?a.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_Y"):a.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_N")}}if(document.getElementById("".concat(l,"-link"))){var i=t.popupContainer.querySelector(".feed-entry-popup-menu-link");if(i){var o=parseInt(!!i.getAttribute("bx-height")?i.getAttribute("bx-height"):0);if(o>0){document.getElementById("".concat(l,"-link")).style.display="none";i.setAttribute("bx-status","hidden");i.style.height="".concat(o,"px")}}}}}};n.MenuManager.show(this.getMenuId(o),u,v,y)}},{key:"getMenuId",value:function e(t){return"post-menu-".concat(t)}}]);return e}();var v=function(){function e(){babelHelpers.classCallCheck(this,e);this.container=null;this.wrap=null;this.plus=null;this.value=null;this.currentSiteId=null;this.currentCounterType=null;this.counterDecrementStack=0;this.counterValue=0;this.lockCounterAnimation=null;this["class"]={informerFixed:"feed-new-message-informer-fixed",informerAnimation:"feed-new-message-informer-anim",informerFixedAnimation:"feed-new-message-informer-fix-anim",counterText:"feed-new-message-inf-text",counterContainer:"feed-new-message-inf-text-counter",reloadContainer:"feed-new-message-inf-text-reload",icon:"feed-new-message-icon",iconRotating:"new-message-balloon-icon-rotating",plusHidden:"feed-new-message-informer-counter-plus-hidden"}}babelHelpers.createClass(e,[{key:"init",value:function e(){this.initNodes();this.initEvents()}},{key:"initNodes",value:function e(){this.currentCounterType=a.Loc.getMessage("sonetLCounterType")?a.Loc.getMessage("sonetLCounterType"):"**";this.currentSiteId=a.Loc.getMessage("SITE_ID");this.container=document.getElementById("sonet_log_counter_2_container");if(this.container){this.container.addEventListener("click",this.showReloadAnimation.bind(this))}this.wrap=document.getElementById("sonet_log_counter_2_wrap");this.plus=document.getElementById("sonet_log_counter_2_plus");this.value=document.getElementById("sonet_log_counter_2")}},{key:"initEvents",value:function e(){var t=this;s.EventEmitter.subscribe("onGoUp",(function(e){t.unfixWrap()}));s.EventEmitter.subscribe("onPullEvent-main",(function(e){var n=e.getData(),s=babelHelpers.slicedToArray(n,2),i=s[0],o=s[1];if(i!=="user_counter"||!o[t.currentSiteId]||!o[t.currentSiteId][t.currentCounterType]){return}t.changeCounter(a.Runtime.clone(o[t.currentSiteId][t.currentCounterType]))}));s.EventEmitter.subscribe("onImUpdateCounter",(function(e){var n=e.getData(),s=babelHelpers.slicedToArray(n,1),i=s[0];if(!a.Type.isObjectLike(i)||a.Type.isUndefined(i[t.currentCounterType])){return}t.changeCounter(i[t.currentCounterType])}));s.EventEmitter.subscribe("OnUCCommentWasRead",(function(e){var n=e.getData(),i=babelHelpers.slicedToArray(n,3),o=i[0],l=i[1],r=i[2];if(!a.Type.isObjectLike(r)||!r.live||!r["new"]){return}s.EventEmitter.emit("onCounterDecrement",new s.BaseEvent({compatData:[1]}));t.decrementCounter(1)}))}},{key:"changeCounter",value:function e(t){this.counterValue=parseInt(t);if(this.counterValue<=0){this.counterDecrementStack=0}var n=this.counterValue-this.counterDecrementStack;this.changeAnimate({show:n>0,counter:n,zeroCounterFromDb:n<=0})}},{key:"changeAnimate",value:function e(t){var n=this;var a=!!t.show;var s=parseInt(t.counter);var i=!!t.zeroCounterFromDb;if(!this.container){return}var o=this.container.querySelector("span.".concat(this["class"].counterText));var l=this.container.querySelector("span.".concat(this["class"].reloadContainer));if(this.lockCounterAnimation){setTimeout((function(){n.changeAnimate({show:a,counter:s})}),200);return false}if(a){if(this.value){this.value.innerHTML=s}this.showWrapAnimation();if(this.plus&&l&&!l.classList.contains("--hidden")&&o){l.classList.add("--hidden");o.classList.remove("--hidden");this.plus.classList.remove("".concat(this["class"].plusHidden))}}else if(this.wrap){if(i&&this.wrap.classList.contains("".concat(this["class"].informerAnimation))){if(o&&l){o.classList.add("--hidden");l.classList.remove("--hidden");this.hideReloadAnimation()}}else{setTimeout((function(){n.hideWrapAnimation()}),400)}}}},{key:"showWrapAnimation",value:function e(){if(!this.wrap){return}this.wrap.style.visibility="visible";this.wrap.classList.add("".concat(this["class"].informerAnimation))}},{key:"hideWrapAnimation",value:function e(){if(!this.wrap){return}this.wrap.classList.remove("".concat(this["class"].informerAnimation));this.wrap.style.visibility="hidden"}},{key:"showReloadAnimation",value:function e(){if(!this.container){return}var t=this.container.querySelector("span.".concat(this["class"].icon));if(t){t.classList.add(this["class"].iconRotating)}}},{key:"hideReloadAnimation",value:function e(){if(!this.container){return}var t=this.container.querySelector("span.".concat(this["class"].icon));if(t){t.classList.remove(this["class"].iconRotating)}}},{key:"onFeedScroll",value:function e(){if(!this.container||!this.wrap){return}var t=this.wrap.parentNode.getBoundingClientRect().top;if(t<=53){this.fixWrap()}else{this.unfixWrap()}}},{key:"fixWrap",value:function e(){if(!this.wrap){return}this.wrap.classList.add("".concat(this["class"].informerFixed),"".concat(this["class"].informerFixedAnimation))}},{key:"unfixWrap",value:function e(){if(!this.wrap){return}this.wrap.classList.remove("".concat(this["class"].informerFixed),"".concat(this["class"].informerFixedAnimation))}},{key:"recover",value:function e(){if(!this.container){return}var t=this.container.querySelector("span.".concat(this["class"].counterContainer));if(!t){return}t.classList.remove("--hidden");this.hideReloadNode();if(this.plus){this.plus.classList.add("".concat(this["class"].plusHidden))}}},{key:"hideReloadNode",value:function e(){if(!this.container){return}var t=this.container.querySelector("span.".concat(this["class"].reloadContainer));if(!t){return}t.classList.add("--hidden")}},{key:"decrementCounter",value:function e(t){this.counterDecrementStack+=parseInt(t);if(!this.value){return}var n=this.counterValue-this.counterDecrementStack;if(n>0){this.value.innerHTML=n}else{this.changeAnimate({show:false,counter:0})}}},{key:"getWrap",value:function e(){return this.wrap}}]);return e}();var y=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"showRefreshFade",value:function e(){var t=this;var n=document.getElementById("log_internal_container");if(n){n.classList.add(this.cssClass.feedMask);n.classList.remove(this.cssClass.feedNoMask)}var a=document.getElementById("feed-loader-container");if(a){a.style.display="block";a.classList.remove(this.cssClass.hideLoader);setTimeout((function(){a.classList.add(t.cssClass.showLoader)}),0)}}},{key:"hideRefreshFade",value:function e(){var t=document.getElementById("log_internal_container");if(t){t.classList.remove(this.cssClass.feedMask);t.classList.add(this.cssClass.feedNoMask)}var n=document.getElementById("feed-loader-container");if(n){n.classList.remove(this.cssClass.showLoader);n.classList.add(this.cssClass.hideLoader)}}}]);return e}();babelHelpers.defineProperty(y,"cssClass",{feedMask:"log-internal-mask",feedNoMask:"log-internal-nomask",showLoader:"livefeed-show-loader",hideLoader:"livefeed-hide-loader"});babelHelpers.defineProperty(y,"onAnimationEnd",(function(e){if("animationName"in e&&e.animationName&&e.animationName==="hideLoader"){var t=document.getElementById("feed-loader-container");if(!t){return}t.classList.remove(y.cssClass.showLoader);t.classList.remove(y.cssClass.hideLoader);t.style.display=""}}));var E=function(){function e(){babelHelpers.classCallCheck(this,e);s.EventEmitter.subscribe("BX.Livefeed:recalculateComments",this.onRecalculateLivefeedComments.bind(this))}babelHelpers.createClass(e,[{key:"onRecalculateLivefeedComments",value:function t(n){var s=n.getCompatData(),i=babelHelpers.slicedToArray(s,1),o=i[0];if(!a.Type.isDomNode(o.rootNode)){return}var l=o.rootNode;var r=l.querySelector(".".concat(e.cssClass.more));if(r){l.classList.remove(e.cssClass.postSeparator)}e.recalcPost({arPos:{height:o.rootNode.offsetHeight+o.rootNode.offsetTop},informerBlock:l})}}],[{key:"recalcPost",value:function e(t){if(!a.Type.isDomNode(t.informerBlock)){return}var n=!a.Type.isUndefined(t.arPos)?t.arPos.height:t.bodyBlock.offsetHeight;var s=t.informerBlock.closest(".".concat(this.cssClass.post));if(!s){return}if(n<=284){s.classList.add(this.cssClass.postShort);s.classList.add(this.cssClass.postSeparator)}else{s.classList.remove(this.cssClass.postShort)}}},{key:"recalcPostsList",value:function e(){var t=this;var n=w.getMoreButtons();n.forEach((function(e,s){if(!a.Type.isPlainObject(e)||!a.Type.isStringFilled(e.bodyBlockID)){return}var i=document.getElementById(e.bodyBlockID);if(!i){return}if(a.Type.isStringFilled(e.outerBlockID)){var o=document.getElementById(e.outerBlockID);if(o){if(o.offsetWidth<i.offsetWidth){var l=o.querySelector("div.".concat(t.cssClass.postTextInner));l.style.overflowX="scroll"}var r=o.querySelector(".".concat(t.cssClass.more));if(r){a.Event.unbindAll(r,"click");a.Event.bind(r,"click",(function(e){BX.UI.Animations.expand({moreButtonNode:e.currentTarget,type:"post",classBlock:t.cssClass.postText,classOuter:t.cssClass.postTextInner,classInner:t.cssClass.postTextInnerInner,heightLimit:300,callback:function e(n){t.expand(n)}})}))}}}t.recalcPost({arPos:{height:i.offsetHeight+i.offsetTop},informerBlock:a.Type.isStringFilled(e.informerBlockID)?document.getElementById(e.informerBlockID):null});n["delete"](s)}));w.setMoreButtons(n);var s=document.getElementById("log_internal_container");if(!s){return}var i=s.querySelectorAll('[data-bx-onload="Y"]');i.forEach((function(e){e.addEventListener("load",(function(e){var n=e.currentTarget.closest(".".concat(t.cssClass.comment));if(!n){n=e.currentTarget.closest(".".concat(t.cssClass.post));if(n){var a=n.querySelector(".".concat(t.cssClass.postTextInnerInner));if(a){t.recalcPost({bodyBlock:a,informerBlock:n.querySelector(".".concat(t.cssClass.more))})}}}e.currentTarget.setAttribute("data-bx-onload","N")}))}))}},{key:"recalcCommentsList",value:function e(){s.EventEmitter.emit("OnUCMoreButtonListRecalc",new s.BaseEvent({compatData:[]}))}},{key:"clearCommentsList",value:function e(){s.EventEmitter.emit("OnUCMoreButtonListClear",new s.BaseEvent({compatData:[]}))}},{key:"expand",value:function e(t){if(!a.Type.isDomNode(t)){return}var n=t.closest(".".concat(this.cssClass.post));if(!n){return}n.classList.add(this.cssClass.postShort);n.classList.add(this.cssClass.postSeparator)}},{key:"lazyLoadCheckVisibility",value:function e(t){if(!a.Type.isPlainObject(t)||!a.Type.isDomNode(t.node)){return true}var n=t.node;var s="comment";var i=n.closest(".".concat(this.cssClass.comment));if(!i){s="post";i=n.closest(".".concat(this.cssClass.postText))}if(!i){return true}var o=i.querySelector("div.".concat(this.cssClass.more));if(!o||o.style.display==="none"){return true}return n.parentNode.parentNode.offsetTop<(s==="comment"?220:270)}}]);return e}();babelHelpers.defineProperty(E,"cssClass",{post:"feed-post-block",postShort:"feed-post-block-short",postSeparator:"feed-post-block-separator",postText:"feed-post-text-block",postTextInner:"feed-post-text-block-inner",postTextInnerInner:"feed-post-text-block-inner-inner",more:"feed-post-text-more",comment:"feed-com-text"});var T=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"processSpoilerToggle",value:function e(t){var n=t.getCompatData(),s=babelHelpers.slicedToArray(n,1),i=s[0];if(!a.Type.isPlainObject(i)){i={}}if(!a.Type.isDomNode(i.node)){return}var o=i.node.closest(".feed-post-block");if(!o){return}var l=o.querySelector(".feed-post-text-block-inner-inner");if(!l){return}var r=o.querySelector(".feed-post-text-more");E.recalcPost({bodyBlock:l,informerBlock:r})}}]);return e}();babelHelpers.defineProperty(T,"cssClass",{});var I=function(){function e(){babelHelpers.classCallCheck(this,e);this.filterId="";this.filterApi=null}babelHelpers.createClass(e,[{key:"init",value:function e(t){if(!a.Type.isPlainObject(t)){t={}}if(a.Type.isStringFilled(t.filterId)&&!a.Type.isUndefined(BX.Main)&&!a.Type.isUndefined(BX.Main.filterManager)){var n=BX.Main.filterManager.getById(t.filterId);this.filterId=t.filterId;if(n){this.filterApi=n.getApi()}}this.initEvents()}},{key:"initEvents",value:function e(){s.EventEmitter.subscribe("BX.Livefeed.Filter:beforeApply",(function(e){y.showRefreshFade()}));s.EventEmitter.subscribe("BX.Livefeed.Filter:apply",(function(e){var t=e.getCompatData(),n=babelHelpers.slicedToArray(t,3),a=n[0],s=n[1],i=n[2];if(typeof i!="undefined"){i.autoResolve=false}B.refresh({useBXMainFilter:"Y"},s)}));s.EventEmitter.subscribe("BX.Livefeed.Filter:searchInput",(function(e){var t=e.getCompatData(),n=babelHelpers.slicedToArray(t,1),s=n[0];if(a.Type.isStringFilled(s)){y.showRefreshFade()}else{y.hideRefreshFade()}}))}},{key:"initEventsCrm",value:function e(){s.EventEmitter.subscribe("BX.Livefeed.Filter:searchInput",(function(){B.refresh()}))}},{key:"clickTag",value:function e(t){if(!a.Type.isStringFilled(t)||!this.filterApi){return false}this.filterApi.setFields({TAG:t});this.filterApi.apply();if(a.Type.isStringFilled(this.filterId)&&!a.Type.isUndefined(BX.Main)&&!a.Type.isUndefined(BX.Main.filterManager)){var n=document.getElementById("".concat(this.filterId,"_filter_container"));if(n&&BX.Main.filterManager.getById(this.filterId)&&(BX.Main.filterManager.getById(this.filterId).getSearch().getSquares().length>0||BX.Main.filterManager.getById(this.filterId).getSearch().getSearchString().length>0)){var s=n.closest(".pagetitle-wrap");if(s){s.classList.add("pagetitle-wrap-filter-opened")}}}new BX.easing({duration:500,start:{scroll:window.pageYOffset},finish:{scroll:0},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function e(t){window.scrollTo(0,t.scroll)},complete:function e(){}}).animate();return true}}]);return e}();var b=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"registerAreaList",value:function e(){var t=BX("log_internal_container"),n=null;if(t){var a=BX.findChildren(t,{tag:"div",className:"feed-post-contentview"},true);for(var s=0,i=a.length;s<i;s++){if(a[s].id.length>0){n=BX.findChild(a[s],{tag:"div",className:"feed-post-text-block-inner-inner"});BX.UserContentView.registerViewArea(a[s].id,n?n:null)}}}}}]);return e}();var _,L;var C=function(){function e(){var t=this;babelHelpers.classCallCheck(this,e);this.loadStarted=null;this.stopTrackNextPage=null;this.requestMode=null;this.nextPageFirst=null;this.nextPageUrl=null;this.scrollInitialized=null;this.firstPageLastTS=0;this.firstPageLastId=0;this.useBXMainFilter="N";this.commentFormUID="";this.blogCommentFormUID="";this.signedParameters="";this.componentName="";this["class"]={};a.Event.ready((function(){t.init()}))}babelHelpers.createClass(e,[{key:"init",value:function e(){this.loadStarted=false;this.stopTrackNextPage=false;this.requestMode=false;this.nextPageFirst=true;this.nextPageUrl=false;this.scrollInitialized=false}},{key:"refresh",value:function e(t,n){var i=this;if(this.loadStarted){return}this.setRequestModeNew();t=a.Type.isPlainObject(t)?t:{};t.siteTemplateId=a.Loc.getMessage("SONET_EXT_LIVEFEED_SITE_TEMPLATE_ID");t.assetsCheckSum=a.Loc.getMessage("sonetLAssetsCheckSum");this.loadStarted=true;y.showRefreshFade();E.clearCommentsList();w.clearMoreButtons();if(a.Type.isStringFilled(this.commentFormUID)){t.commentFormUID=this.commentFormUID}if(!a.Type.isStringFilled(t.useBXMainFilter)||t.useBXMainFilter!=="Y"){s.EventEmitter.emit("BX.Livefeed:refresh",new s.BaseEvent({compatData:[]}))}F.hideReloadNode();F.lockCounterAnimation=true;this.loadStarted=false;a.ajax.runAction("socialnetwork.api.livefeed.refresh",{signedParameters:this.getSignedParameters(),data:{c:this.getComponentName(),logajax:"Y",RELOAD:"Y",params:t}}).then((function(e){var t=a.Type.isPlainObject(e.data)?e.data:{};i.loadStarted=false;y.hideRefreshFade();if(n){n.fulfill()}var o=a.Type.isPlainObject(t.componentResult)&&a.Type.isStringFilled(t.componentResult.EMPTY)?t.componentResult.EMPTY:"N";var l=a.Type.isPlainObject(t.componentResult)&&a.Type.isStringFilled(t.componentResult.FORCE_PAGE_REFRESH)?t.componentResult.FORCE_PAGE_REFRESH:"N";var r=a.Type.isPlainObject(t.componentResult)&&a.Type.isStringFilled(t.componentResult.FILTER_USED)&&t.componentResult.FILTER_USED==="Y";if(l==="Y"){top.window.location.reload();return}var c=document.getElementById("feed-loader-container");F.lockCounterAnimation=false;var d=document.getElementById("log_internal_container");if(!d){return}a.Dom.clean(d);var u=document.getElementById("feed-empty-wrap");if(u){if(o==="Y"){u.style.display="block";var p=u.querySelector(".feed-wrap-empty");if(p){p.innerHTML=r?a.Loc.getMessage("SONET_C30_T_EMPTY_SEARCH"):a.Loc.getMessage("SONET_C30_T_EMPTY")}}else{u.style.display="none"}}if(c){d.appendChild(c)}if(t.html.length>0){i.clearContainerExternal();BX.LazyLoad.clearImages();var f=a.Tag.render(_||(_=babelHelpers.taggedTemplateLiteral(['<div id="content_block_','" class="feed-wrap" style="display: block;"></div>'])),Math.floor(Math.random()*1e3));d.appendChild(f);a.Runtime.html(f,t.html).then((function(){E.recalcPostsList();E.recalcCommentsList();b.registerAreaList();D.resetFlags();D.initPanel();D.initPosts()}));i.stopTrackNextPage=false;E.clearCommentsList();var m=F.getWrap();if(m&&m.classList.contains(F["class"].informerFixed)){new BX.easing({duration:500,start:{scroll:window.pageYOffset},finish:{scroll:0},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function e(t){window.scrollTo(0,t.scroll)},complete:function e(){s.EventEmitter.emit("onGoUp",[])}}).animate()}}}),(function(){i.loadStarted=false;if(n){n.reject()}y.hideRefreshFade();i.showRefreshError()}));return false}},{key:"getNextPage",value:function e(){var t=this;var n=document.getElementById("feed-new-message-inf-wrap");var i=document.getElementById("feed-new-message-inf-wrap-first");if(this.loadStarted){return false}this.setRequestModeMore();this.loadStarted=true;F.lockCounterAnimation=true;w.clearMoreButtons();if(!this.nextPageFirst&&n){n.style.display="block"}else if(this.nextPageFirst&&i){i.classList.add("feed-new-message-inf-wrap-first-visible")}var o=new a.Uri(this.getNextPageUrl()).getQueryParams();var l=1;var r="";var c=0;var d="N";Object.entries(o).forEach((function(e){var t=babelHelpers.slicedToArray(e,2),n=t[0],a=t[1];if(n.match(/^PAGEN_(\d+)$/i)){l=parseInt(a)}else if(n==="pplogid"){r=decodeURI(a)}else if(n==="ts"){c=a}else if(n==="noblog"){d=a}}));var u={PAGE_NUMBER:l,LAST_LOG_TIMESTAMP:c,PREV_PAGE_LOG_ID:r,siteTemplateId:a.Loc.getMessage("SONET_EXT_LIVEFEED_SITE_TEMPLATE_ID"),useBXMainFilter:this.useBXMainFilter,preset_filter_top_id:a.Type.isStringFilled(o.preset_filter_top_id)&&o.preset_filter_top_id!=="0"?o.preset_filter_top_id:"",preset_filter_id:a.Type.isStringFilled(o.preset_filter_id)&&o.preset_filter_id!=="0"?o.preset_filter_id:""};if(a.Type.isStringFilled(this.commentFormUID)){u.commentFormUID=this.commentFormUID}if(a.Type.isStringFilled(this.blogCommentFormUID)){u.blogCommentFormUID=this.blogCommentFormUID}var p={c:this.getComponentName(),logajax:"Y",noblog:d,params:u};if(!a.Type.isUndefined(o.CREATED_BY_ID)){p.flt_created_by_id=parseInt(o.CREATED_BY_ID)}if(!a.Type.isUndefined(o.flt_date_datesel)){p.flt_date_datesel=o.flt_date_datesel}if(!a.Type.isUndefined(o.flt_date_from)){p.flt_date_from=decodeURIComponent(o.flt_date_from)}if(!a.Type.isUndefined(o.flt_date_to)){p.flt_date_to=decodeURIComponent(o.flt_date_to)}a.ajax.runAction("socialnetwork.api.livefeed.getNextPage",{signedParameters:this.getSignedParameters(),data:p}).then((function(e){var n=a.Type.isPlainObject(e.data)?e.data:{};t.loadStarted=false;var o=document.getElementById("feed-new-message-inf-wrap");if(o){a.Dom.clean(o);a.Dom.remove(o)}F.lockCounterAnimation=false;var r=a.Type.isPlainObject(n.componentResult)&&!a.Type.isUndefined(n.componentResult.LAST_TS)?parseInt(n.componentResult.LAST_TS):0;var c=a.Type.isPlainObject(n.componentResult)&&!a.Type.isUndefined(n.componentResult.LAST_ID)?parseInt(n.componentResult.LAST_ID):null;if(n.html.length>0&&r>0&&(parseInt(t.firstPageLastTS)<=0||r<parseInt(t.firstPageLastTS)||r==parseInt(t.firstPageLastTS)&&!a.Type.isNull(c)&&c<parseInt(t.firstPageLastId))){E.clearCommentsList();var d="content_block_".concat(Math.floor(Math.random()*1e3));var u=a.Tag.render(L||(L=babelHelpers.taggedTemplateLiteral(['<div id="','" class="feed-wrap" style="display:',';"></div>'])),d,t.nextPageFirst?"none":"block");var p=document.getElementById("log_internal_container");if(!p){return}p.appendChild(u);a.Runtime.html(u,n.html).then((function(){if(l>2){t.stopTrackNextPage=false;E.recalcPostsList();b.registerAreaList();E.recalcCommentsList();D.resetFlags();D.initPosts()}}));t.clearContainerExternal();if(l===2){document.getElementById("feed-new-message-inf-text-first").style.display="block";document.getElementById("feed-new-message-inf-loader-first").style.display="none";i.classList.add("feed-new-message-inf-wrap-first-active");var f=function e(){t.stopTrackNextPage=false;if(u){u.style.display="block"}a.Event.unbind(document.getElementById("sonet_log_more_container_first"),"click",e);i.style.display="none";E.recalcPostsList();b.registerAreaList();E.recalcCommentsList();s.EventEmitter.emit("BX.Livefeed:recalculateComments",new s.BaseEvent({compatData:[{rootNode:u}]}));D.resetFlags();D.initPosts()};a.Event.bind(document.getElementById("sonet_log_more_container_first"),"click",f)}else{if(u){u.style.display="block"}}t.nextPageFirst=false}else if(document.getElementById("feed-new-message-inf-wrap-first")){document.getElementById("feed-new-message-inf-wrap-first").style.display="none"}}),(function(){t.loadStarted=false;t.stopTrackNextPage=false;var e=document.getElementById("feed-new-message-inf-wrap");if(e){e.style.display="none"}F.lockCounterAnimation=false;t.clearContainerExternal()}));return false}},{key:"clearContainerExternal",value:function e(){if(this.requestMode==="new"){F.hideWrapAnimation();F.recover()}F.hideReloadAnimation();var t=document.getElementById("sonet_log_counter_preset");if(t&&this.requestMode==="new"){t.style.display="none"}}},{key:"setRequestModeNew",value:function e(){this.requestMode="new"}},{key:"setRequestModeMore",value:function e(){this.requestMode="more"}},{key:"showRefreshError",value:function e(){F.lockCounterAnimation=false;this.clearContainerExternal()}},{key:"setSignedParameters",value:function e(t){this.signedParameters=t}},{key:"getSignedParameters",value:function e(){return this.signedParameters}},{key:"setComponentName",value:function e(t){this.componentName=t}},{key:"getComponentName",value:function e(){return this.componentName}},{key:"setNextPageUrl",value:function e(t){this.nextPageUrl=t}},{key:"getNextPageUrl",value:function e(){return this.nextPageUrl}},{key:"initScroll",value:function e(){if(this.scrollInitialized){return}this.scrollInitialized=true;document.addEventListener("scroll",this.onFeedScroll.bind(this))}},{key:"onFeedScroll",value:function e(){if(!this.stopTrackNextPage){var t=document.documentElement.scrollHeight-window.innerHeight-500;if(window.pageYOffset>=t&&this.getNextPageUrl()){this.stopTrackNextPage=true;this.getNextPage()}}F.onFeedScroll()}}]);return e}();var k;var P=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"appendResultFieldTaskIds",value:function e(t){if(!a.Type.isArray(t)){return}t=t.map((function(e){return parseInt(e)}));this.resultFieldTaskIdList=[].concat(babelHelpers.toConsumableArray(this.resultFieldTaskIdList),babelHelpers.toConsumableArray(t))}},{key:"appendTaskResultComments",value:function e(t){if(a.Type.isUndefined(i.ResultManager)){return}this.taskResultCommentsData=Object.assign(this.taskResultCommentsData,t);Object.entries(this.taskResultCommentsData).forEach((function(e){var t=babelHelpers.slicedToArray(e,2),n=t[0],a=t[1];i.ResultManager.getInstance().initResult({context:"task",taskId:parseInt(n),comments:a})}))}},{key:"onAfterShow",value:function e(t,n,i){if(!a.Type.isPlainObject(i)){i={}}s.EventEmitter.emit("OnBeforeSocialnetworkCommentShowedUp",new s.BaseEvent({compatData:["socialnetwork"]}));var o={ENTITY_XML_ID:t.currentEntity.ENTITY_XML_ID,ENTITY_TYPE:t.currentEntity.ENTITY_XML_ID.split("_")[0],ENTITY_ID:t.currentEntity.ENTITY_XML_ID.split("_")[1],parentId:t.id[1],comment_post_id:t.currentEntity.ENTITY_XML_ID.split("_")[1],edit_id:t.id[1],act:t.id[1]>0?"edit":"add"};Object.entries(o).forEach((function(e){var n=babelHelpers.slicedToArray(e,2),s=n[0],i=n[1];if(!t.form[s]){t.form.appendChild(a.Tag.render(k||(k=babelHelpers.taggedTemplateLiteral(['<input type="hidden" name="','">'])),s))}t.form[s].value=i}));this.onLightEditorShow(n,i);if(!BX.Type.isUndefined(BX.Tasks)){var l=t.currentEntity.ENTITY_XML_ID.match(/^TASK_(\d+)$/i);if(l&&this.resultFieldTaskIdList.includes(parseInt(l[1]))){BX.Tasks.ResultManager.showField()}else{BX.Tasks.ResultManager.hideField()}}}},{key:"onLightEditorShow",value:function e(t,n){if(!a.Type.isPlainObject(n)){n={}}var s={};if(a.Type.isPlainObject(n.UF)){s=n.UF}else{if(n.arFiles){var i={};n.arFiles.forEach((function(e,t){var n=document.getElementById("wdif-doc-".concat(e));var a=n.querySelector(".feed-com-file-name");var s=n.querySelector(".feed-con-file-size");i["F".concat(t)]={FILE_ID:e,FILE_NAME:a?a.innerHTML:"noname",FILE_SIZE:s?s.innerHTML:"unknown",CONTENT_TYPE:"notimage/xyz"}}));s.UF_SONET_COM_DOC={USER_TYPE_ID:"file",FIELD_NAME:"UF_SONET_COM_FILE[]",VALUE:i}}if(n.arDocs){s.UF_SONET_COM_FILE={USER_TYPE_ID:"webdav_element",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:a.Runtime.clone(n.arDocs)}}if(n.arDFiles){s.UF_SONET_COM_FILE={USER_TYPE_ID:"disk_file",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:a.Runtime.clone(n.arDFiles)}}}LHEPostForm.reinitData(window.SLEC.editorId,t,s)}}]);return e}();babelHelpers.defineProperty(P,"resultFieldTaskIdList",[]);babelHelpers.defineProperty(P,"taskResultCommentsData",{});var S,N;var A=function(){function e(){babelHelpers.classCallCheck(this,e);this.entryData={};this.feedInitialized=false;this.moreButtonDataList=new Map}babelHelpers.createClass(e,[{key:"initOnce",value:function e(t){var n=document.getElementById("feed-loader-container");if(!a.Type.isPlainObject(t)){t={}}if(a.Type.isStringFilled(t.signedParameters)){B.setSignedParameters(t.signedParameters)}if(a.Type.isStringFilled(t.componentName)){B.setComponentName(t.componentName)}if(a.Type.isStringFilled(t.commentFormUID)){B.commentFormUID=t.commentFormUID}if(n){a.Event.bind(n,"animationend",y.onAnimationEnd);a.Event.bind(n,"webkitAnimationEnd",y.onAnimationEnd);a.Event.bind(n,"oanimationend",y.onAnimationEnd);a.Event.bind(n,"MSAnimationEnd",y.onAnimationEnd)}s.EventEmitter.subscribe("BX.Forum.Spoiler:toggle",T.processSpoilerToggle);M.init({filterId:t.filterId});if(a.Type.isStringFilled(t.crmEntityTypeName)&&!a.Type.isUndefined(t.crmEntityId)&&parseInt(t.crmEntityId)>0){M.initEventsCrm()}BX.UserContentView.init();document.getElementById("log_internal_container").addEventListener("click",(function(e){var t=e.target.getAttribute("bx-tag-value");if(!a.Type.isStringFilled(t)){return}if(M.clickTag(t)){e.preventDefault();e.stopPropagation()}}),true);var i=document.getElementById("feed-notification-notasks-close-btn");var o=document.getElementById("feed-notification-notasks-read-btn");if(i){a.Event.bind(i,"click",this.setNoTasksNotificationRead.bind(this))}if(o){a.Event.bind(o,"click",this.setNoTasksNotificationRead.bind(this))}}},{key:"init",value:function e(){if(this.feedInitialized){return}D.init();F.init();this.feedInitialized=true}},{key:"changeFollow",value:function e(t){var n=this;var s=t.logId?parseInt(t.logId):0;if(!s){return false}var i=document.getElementById("log_entry_follow_"+s);var o=i&&i.getAttribute("data-follow")==="Y"?"Y":"N";var l=o==="Y"?"N":"Y";this.renderFollow({logId:s,value:l});a.ajax.runAction("socialnetwork.api.livefeed.changeFollow",{data:{logId:s,value:l},analyticsLabel:{b24statAction:l==="Y"?"setFollow":"setUnfollow"}}).then((function(e){if(!e.data.success){n.renderFollow({logId:s,value:o})}}),(function(){n.renderFollow({logId:s,value:o})}));return false}},{key:"renderFollow",value:function e(t){var n=t.logId?parseInt(t.logId):0;if(!n){return}var s=document.getElementById("log_entry_follow_"+n);var i=t.value&&t.value==="Y"?"Y":"N";if(s){s.setAttribute("data-follow",i)}var o=s?s.querySelector("a"):null;if(o){o.innerHTML=a.Loc.getMessage("SONET_EXT_LIVEFEED_FOLLOW_TITLE_"+i)}var l=s?s.closest(".feed-post-block"):null;if(l){if(i==="N"){l.classList.add("feed-post-block-unfollowed")}else if(i==="Y"){l.classList.remove("feed-post-block-unfollowed")}}}},{key:"changeFavorites",value:function e(t){var n=this;var s=t.logId?parseInt(t.logId):0;var i=t.event?t.event:null;var o=t.node?t.node:null;var l=t.newState?t.newState:null;if(a.Type.isStringFilled(o)){o=document.getElementById(o)}if(!s){return}var r=null;if(i){r=i.target;if(!r.classList.contains("menu-popup-item-text")){r=r.querySelector(".menu-popup-item-text")}}var c=null;if(a.Type.isDomNode(o)){c=o.classList.contains("feed-post-important-switch")?o:o.querySelector(".feed-post-important-switch")}if(typeof this.entryData[s]=="undefined"){this.entryData[s]={}}if(typeof this.entryData[s].favorites!="undefined"){l=this.entryData[s].favorites?"N":"Y";this.entryData[s].favorites=!this.entryData[s].favorites}else if(c){l=c.classList.contains("feed-post-important-switch-active")?"N":"Y";this.entryData[s].favorites=l=="Y"}if(!l){return}this.adjustFavoritesControlItem(c,l);this.adjustFavoritesMenuItem(r,l);a.ajax.runAction("socialnetwork.api.livefeed.changeFavorites",{data:{logId:s,value:l},analyticsLabel:{b24statAction:l=="Y"?"addFavorites":"removeFavorites"}}).then((function(e){if(a.Type.isStringFilled(e.data.newValue)&&["Y","N"].includes(e.data.newValue)){n.entryData[s].favorites=e.data.newValue=="Y"}n.adjustFavoritesControlItem(c,e.data.newValue);n.adjustFavoritesMenuItem(r,e.data.newValue)}),(function(){n.entryData[s].favorites=!n.entryData[s].favorites}))}},{key:"adjustFavoritesMenuItem",value:function e(t,n){if(!a.Type.isDomNode(t)||!["Y","N"].includes(n)){return}t.innerHTML=this.getMenuTitle(n==="Y")}},{key:"adjustFavoritesControlItem",value:function e(t,n){if(!a.Type.isDomNode(t)||!["Y","N"].includes(n)){return}t.title=this.getMenuTitle(n==="Y");if(n=="Y"){t.classList.add("feed-post-important-switch-active")}else{t.classList.remove("feed-post-important-switch-active")}}},{key:"getMenuTitle",value:function e(t){return a.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_".concat(t?"Y":"N"))}},{key:"delete",value:function e(t){var s=this;var i=t.logId?parseInt(t.logId):0;var o=a.Type.isStringFilled(t.nodeId)?document.getElementById(t.nodeId):null;var l=t.ind?t.ind:"";if(i<=0||!o){return}a.ajax.runAction("socialnetwork.api.livefeed.deleteEntry",{data:{logId:i},analyticsLabel:{b24statAction:"deleteLogEntry"}}).then((function(e){if(e.data.success){if(!a.Type.isUndefined(l)){n.MenuManager.destroy(h.getMenuId(l))}s.deleteSuccess(o)}else{s.deleteFailure(o)}}),(function(){s.deleteFailure(o)}))}},{key:"deleteSuccess",value:function e(t){if(!a.Type.isDomNode(t)){return}new BX.fx({time:.5,step:.05,type:"linear",start:t.offsetHeight,finish:56,callback:function e(n){t.style.height="".concat(n,"px")},callback_start:function e(){t.style.overflow="hidden";t.style.minHeight=0},callback_complete:function e(){t.style.marginBottom=0;a.Dom.clean(t);t.classList.add("feed-post-block-deleted");t.appendChild(a.Tag.render(S||(S=babelHelpers.taggedTemplateLiteral(['<div class="feed-add-successfully"><span class="feed-add-info-text"><span class="feed-add-info-icon"></span><span>',"</span></span></span></div>"])),a.Loc.getMessage("SONET_EXT_LIVEFEED_DELETE_SUCCESS")))}}).start()}},{key:"deleteFailure",value:function e(t){if(!a.Type.isDomNode(t)){return}t.insertBefore(a.Tag.render(N||(N=babelHelpers.taggedTemplateLiteral(['<div class="feed-add-error" style="margin: 18px 37px 4px 84px;"><span class="feed-add-info-text"><span class="feed-add-info-icon"></span><span>',"</span></span></div>"])),a.Loc.getMessage("sonetLMenuDeleteFailure")),t.firstChild)}},{key:"setMoreButtons",value:function e(t){this.moreButtonDataList=t}},{key:"getMoreButtons",value:function e(){return this.moreButtonDataList}},{key:"clearMoreButtons",value:function e(){this.moreButtonDataList.clear()}},{key:"addMoreButton",value:function e(t,n){this.moreButtonDataList.set(t,n)}},{key:"setNoTasksNotificationRead",value:function e(t){var n=t.currentTarget.closest(".feed-notification-container");if(!n){return}a.ajax.runAction("socialnetwork.api.livefeed.readNoTasksNotification",{data:{}}).then((function(e){if(!e.data.success){return}n.style.height=n.offsetHeight+"px";setTimeout((function(){n.classList.add("feed-notification-container-collapsed")}),10);setTimeout((function(){n.parentNode.removeChild(n)}),250)}),(function(){}))}}]);return e}();var w=new A;var D=new d;var F=new v;var M=new I;var B=new C;var x=new E;new m;e.FeedInstance=w;e.PinnedPanelInstance=D;e.InformerInstance=F;e.FilterInstance=M;e.PageInstance=B;e.MoreButtonInstance=x;e.Post=h;e.TaskCreator=m;e.Loader=y;e.MoreButton=E;e.ContentView=b;e.CommentForm=P})(this.BX.Livefeed=this.BX.Livefeed||{},BX.UI,BX.Main,BX,BX.Event,BX.Tasks); //# sourceMappingURL=livefeed.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings