Your IP : 3.129.211.228


Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/ui/info-helper/dist/
Upload File :
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/ui/info-helper/dist/info-helper.bundle.js

this.BX=this.BX||{},function(e,t,s,a,r){"use strict";class i{static ClosePage(){BX.UI.InfoHelper.close()}static openPage(){window.location.href=BX.UI.InfoHelper.frameUrl}static openPageInNewTab(){window.open(BX.UI.InfoHelper.frameUrl,"_blank")}static reloadParent(){BX.UI.InfoHelper.reloadParent()}static openSlider(e){top.BX.SidePanel.Instance.open(e.url)}static openPriceTable(){i.openSlider({url:"/settings/license_all.php"})}static openChatWithHead(e){const t=top.BX.Messenger.Public.openChat(),s={tool:"InfoHelper",c_section:document.location.href,event:"create_chatforrequest"};e.toolId&&r.ajax.runAction("intranet.tools.tool.createHeadChat",{data:{toolId:e.toolId}}).then(r=>{t.then(()=>{top.BX.Messenger.Public.openChat("chat"+r.data.chatId)}),s.type=e.toolId,s.category="tool_off",a.sendData(s)}),e.featureCode&&r.ajax.runAction("bitrix24.license.upgraderequest.createHeadChat",{data:{code:e.featureCode}}).then(r=>{t.then(()=>{top.BX.Messenger.Public.openChat("chat"+r.data.chatId)}),s.type=e.featureCode,s.category="limit",a.sendData(s)})}static openCheckout(e){if(e.mpSubscribe&&r.Extension.getSettings("ui.info-helper").licenseType){const e=r.Uri.addParam("/settings/order/make.php",{product:r.Extension.getSettings("ui.info-helper").licenseType+"12",subscr:"o"});i.openSlider({url:e})}else if(e.tariff){const t=r.Uri.addParam("/settings/order/make.php",{product:e.period?e.tariff+e.period:e.tariff+"12",subscr:e.mpSubscribe?"o":null});i.openSlider({url:t})}}static openToolsSettings(){i.openSlider({url:"/settings/configs/?page=tools"})}static openInformer(e){top.BX.UI.InfoHelper.__showExternal(e.code,e.option)}static activateDemoSubscription(e){if("Y"===e.licenseAgreed){const e="/bitrix/tools/rest.php",t=e=>{var t;BX.SidePanel.Instance.getTopSlider()&&(null==(t=BX.UI.InfoHelper.sliderProviderForOldFormat)||t.getFrame().contentWindow.postMessage({action:"onActivateDemoSubscriptionResult",result:e},"*"))};BX.ajax({dataType:"json",method:"POST",url:e,data:{action:"activate_demo",sessid:BX.bitrix_sessid()},onsuccess:t,onfailure:function(e,s){t({error:e+(s?": "+s:"")})}})}}static activateDemoLicense(){r.ajax.runAction("ui.infoHelper.activateDemoLicense").then(e=>{var t;BX.SidePanel.Instance.getTopSlider()&&(null==(t=BX.UI.InfoHelper.sliderProviderForOldFormat)||t.getFrame().contentWindow.postMessage({action:"onActivateDemoLicenseResult",result:e},"*"));"Y"===e.data.success&&BX.onCustomEvent("BX.UI.InfoHelper:onActivateDemoLicenseSuccess",{result:e})})}static openBuySubscriptionPage(){r.ajax.runAction("ui.infoHelper.getBuySubscriptionUrl").then(e=>{e.data&&e.data.url&&("blank"===e.data.action?window.open(e.data.url,"_blank"):"redirect"===e.data.action&&(window.location.href=e.data.url))})}static activateTrialFeature(e){r.ajax.runAction("ui.infoHelper.activateTrialFeature",{data:{featureId:e.featureId}}).then(t=>{var s;BX.SidePanel.Instance.getTopSlider()&&(null==(s=BX.UI.InfoHelper.sliderProviderForOldFormat)||s.getFrame().contentWindow.postMessage({action:"onActivateTrialFeature",result:t},"*"));"Y"===t.data.success&&BX.onCustomEvent("BX.UI.InfoHelper:onActivateTrialFeatureSuccess",{result:t,featureId:e.featureId})})}}class l{}l.SLIDER="slider",l.POPUP="popup";var o=babelHelpers.classPrivateFieldLooseKey("type"),n=babelHelpers.classPrivateFieldLooseKey("code");class d{constructor(e,t=null){if(Object.defineProperty(this,o,{writable:!0,value:void 0}),Object.defineProperty(this,n,{writable:!0,value:void 0}),e!==l.SLIDER&&e!==l.POPUP)throw new Error("Invalid parameter 'type'");babelHelpers.classPrivateFieldLooseBase(this,o)[o]=e,babelHelpers.classPrivateFieldLooseBase(this,n)[n]=t}getRequest(){return r.ajax.runAction(d.controller,{data:{type:babelHelpers.classPrivateFieldLooseBase(this,o)[o],code:babelHelpers.classPrivateFieldLooseBase(this,n)[n],currentUrl:window.location.href}})}}d.controller="ui.infoHelper.getInitParams";class c{show(e,t){throw new Error("Must be implemented in a child class")}close(){throw new Error("Must be implemented in a child class")}}var p=babelHelpers.classPrivateFieldLooseKey("openSlider"),b=babelHelpers.classPrivateFieldLooseKey("buildUrl"),h=babelHelpers.classPrivateFieldLooseKey("createContainerNode"),u=babelHelpers.classPrivateFieldLooseKey("createFrameNode");class v extends c{constructor(e={}){super(),Object.defineProperty(this,u,{value:f}),Object.defineProperty(this,h,{value:F}),Object.defineProperty(this,b,{value:m}),Object.defineProperty(this,p,{value:P}),this.frameUrlTemplate=e.frameUrlTemplate||"",this.frameUrl=r.Type.isStringFilled(e.frameUrl)?e.frameUrl:"",this.width=r.Type.isNumber(e.width)?e.width:700,e.dataSource&&e.dataSource instanceof Promise?this.dataSource=e.dataSource:this.dataSource=new d(l.SLIDER).getRequest()}__showExternal(e,t){let s=700;const a=`${this.getId()}:${e}`,r=babelHelpers.classPrivateFieldLooseBase(this,u)[u]();t&&t.width&&t.width>0&&(s=t.width);babelHelpers.classPrivateFieldLooseBase(this,p)[p]({id:a,contentCallback:(t=>new Promise((t,s)=>{new d(l.SLIDER).getRequest().then(t=>(r.src=babelHelpers.classPrivateFieldLooseBase(this,b)[b](e),babelHelpers.classPrivateFieldLooseBase(this,h)[h](this.getLoader(),r))).then(e=>t(e))})).bind(this),width:s,events:{onLoad:()=>this.showFrame(r)}})}show(e,t){this.isOpen()||(r.Type.isPlainObject(t)||(t={}),e&&(this.contentCallback=s=>new Promise((s,a)=>{this.hasOpen?s(this.getContent()):this.dataSource.then(a=>{const{data:r}=a;return this.frameUrlTemplate=r.frameUrlTemplate,this.frameUrl=babelHelpers.classPrivateFieldLooseBase(this,b)[b](e,t,r),this.getFrame().src!==this.frameUrl&&(this.getFrame().src=this.frameUrl),this.bindEvent(r.availableDomainList),this.hasOpen=!0,s(this.getContent())})}),babelHelpers.classPrivateFieldLooseBase(this,p)[p]({id:this.getId(),contentCallback:this.contentCallback,width:this.width,events:{onLoad:()=>this.showFrame(),onClose:()=>{var e;(r.Event.unbindAll(window,"message"),this.frameNode)&&(null==(e=this.frameNode.contentWindow)||e.postMessage({action:"onCloseWidget"},"*"))}}})))}bindEvent(e){BX.bind(top.window,"message",BX.proxy((function(t){if(!t.origin||t.origin&&!e.includes(t.origin))return;if(!t.data||!r.Type.isObject(t.data))return;const s=i[t.data.action];r.Type.isFunction(s)&&s(t.data)}),this))}close(){const e=this.getSlider();e&&e.isOpen()&&e.close()}getContent(){return this.content||(this.content=babelHelpers.classPrivateFieldLooseBase(this,h)[h](this.getLoader(),this.getFrame())),this.content}getId(){return"ui:info_helper"}getFrame(){return this.frameNode||(this.frameNode=babelHelpers.classPrivateFieldLooseBase(this,u)[u]()),this.frameNode}hasFrameNode(){return r.Type.isElementNode(this.frameNode)}showFrame(e){e||(e=this.getFrame()),setTimeout(()=>{e.classList.add("info-helper-panel-iframe-show")},600)}getSlider(){return BX.SidePanel.Instance.getSlider(this.getId())}isOpen(){return this.getSlider()&&this.getSlider().isOpen()}getLoader(){if(this.popupLoader)return this.popupLoader;const e=new t.Loader({target:BX("info-helper-container"),size:100});return e.show(),this.popupLoader=e.data.container,this.popupLoader}}function P(e){BX.SidePanel.Instance.open(e.id,{contentCallback:e.contentCallback,width:e.width,loader:"default-loader",cacheable:!1,customRightBoundary:0,events:e.events})}function m(e,t={},s=null){let a=this.frameUrlTemplate.replace(/code/,e);return t.featureId&&r.Type.isArray(s.trialableFeatureList)&&(a=r.Uri.addParam(a,{featureId:t.featureId,trialableFeatureList:s.trialableFeatureList.join(",")})),a}function F(e,t){return BX.create("div",{attrs:{className:"info-helper-container",id:"info-helper-container"},children:[e,t]})}function f(){return BX.create("iframe",{attrs:{className:"info-helper-panel-iframe",src:"about:blank"}})}var L=babelHelpers.classPrivateFieldLooseKey("code"),B=babelHelpers.classPrivateFieldLooseKey("category");class g{constructor(e,t){Object.defineProperty(this,L,{writable:!0,value:void 0}),Object.defineProperty(this,B,{writable:!0,value:void 0}),babelHelpers.classPrivateFieldLooseBase(this,L)[L]=e,babelHelpers.classPrivateFieldLooseBase(this,B)[B]=t}sendByEventName(e,t=null){a.sendData({tool:"InfoHelper",category:babelHelpers.classPrivateFieldLooseBase(this,B)[B],type:babelHelpers.classPrivateFieldLooseBase(this,L)[L],event:e,c_section:document.location.href,p1:t})}}var H=babelHelpers.classPrivateFieldLooseKey("dataSource"),w=babelHelpers.classPrivateFieldLooseKey("bindElement"),y=babelHelpers.classPrivateFieldLooseKey("popup"),I=babelHelpers.classPrivateFieldLooseKey("code"),S=babelHelpers.classPrivateFieldLooseKey("analytics"),O=babelHelpers.classPrivateFieldLooseKey("getPopup");class E extends c{constructor(e){if(super(),Object.defineProperty(this,O,{value:U}),Object.defineProperty(this,H,{writable:!0,value:void 0}),Object.defineProperty(this,w,{writable:!0,value:void 0}),Object.defineProperty(this,y,{writable:!0,value:void 0}),Object.defineProperty(this,I,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:void 0}),!r.Type.isDomNode(e.bindElement))throw new Error("Invalid parameter 'bindElement'");if(babelHelpers.classPrivateFieldLooseBase(this,w)[w]=e.bindElement,!r.Type.isString(e.code))throw new Error("Invalid parameter 'code'");babelHelpers.classPrivateFieldLooseBase(this,I)[I]=e.code,e.dataSource&&e.dataSource instanceof Promise?babelHelpers.classPrivateFieldLooseBase(this,H)[H]=e.dataSource:babelHelpers.classPrivateFieldLooseBase(this,H)[H]=new d(l.POPUP,babelHelpers.classPrivateFieldLooseBase(this,I)[I]).getRequest(),babelHelpers.classPrivateFieldLooseBase(this,S)[S]=new g(babelHelpers.classPrivateFieldLooseBase(this,I)[I],l.POPUP)}show(e,t){babelHelpers.classPrivateFieldLooseBase(this,O)[O]().show(),babelHelpers.classPrivateFieldLooseBase(this,S)[S].sendByEventName("show")}close(){babelHelpers.classPrivateFieldLooseBase(this,O)[O]().close(),babelHelpers.classPrivateFieldLooseBase(this,S)[S].sendByEventName("close")}}function U(){return babelHelpers.classPrivateFieldLooseBase(this,y)[y]||(babelHelpers.classPrivateFieldLooseBase(this,y)[y]=new s.PopupWithHeader({target:babelHelpers.classPrivateFieldLooseBase(this,w)[w],id:"demo-popup-components-maker-"+Math.random(8),width:344,content:[],asyncData:babelHelpers.classPrivateFieldLooseBase(this,H)[H],template:new s.SaleTemplate,analyticsCallback:(e,t)=>{babelHelpers.classPrivateFieldLooseBase(this,S)[S]&&babelHelpers.classPrivateFieldLooseBase(this,S)[S].sendByEventName(e,t)}})),babelHelpers.classPrivateFieldLooseBase(this,y)[y]}var X=babelHelpers.classPrivateFieldLooseKey("code"),T=babelHelpers.classPrivateFieldLooseKey("provider"),j=babelHelpers.classPrivateFieldLooseKey("options");class C{constructor(e){var t;Object.defineProperty(this,X,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),babelHelpers.classPrivateFieldLooseBase(this,j)[j]=e;const s=r.Extension.getSettings("ui.info-helper");if(babelHelpers.classPrivateFieldLooseBase(this,j)[j].bindElement=null!=(t=e.bindElement)?t:null,babelHelpers.classPrivateFieldLooseBase(this,X)[X]=e.code,!e.code)throw new Error("'code' parameter is required.");r.Type.isObject(s)&&s.popupProviderEnabled&&r.Type.isDomNode(e.bindElement)?babelHelpers.classPrivateFieldLooseBase(this,T)[T]=new E({bindElement:e.bindElement,code:babelHelpers.classPrivateFieldLooseBase(this,X)[X]}):babelHelpers.classPrivateFieldLooseBase(this,T)[T]=new v}getOptions(){return babelHelpers.classPrivateFieldLooseBase(this,j)[j]}getProvider(){return babelHelpers.classPrivateFieldLooseBase(this,T)[T]}show(){return babelHelpers.classPrivateFieldLooseBase(this,T)[T].show(babelHelpers.classPrivateFieldLooseBase(this,X)[X],{})}close(){return babelHelpers.classPrivateFieldLooseBase(this,T)[T].close()}}var x=babelHelpers.classPrivateFieldLooseKey("promoters");class N{static register(e){N.exist(e)||babelHelpers.classPrivateFieldLooseBase(N,x)[x].push(e)}static exist(e){return babelHelpers.classPrivateFieldLooseBase(N,x)[x].find(t=>t===e)}static getPromoter(e){let t;return babelHelpers.classPrivateFieldLooseBase(N,x)[x].forEach(s=>{let a=!0;Object.keys(s.getOptions()).forEach(t=>{s.getOptions()[t]!==e[t]&&(a=!1)}),a&&(t=s)}),t instanceof C||(t=new C(e),N.register(t)),t}}Object.defineProperty(N,x,{writable:!0,value:[]});var K=babelHelpers.classPrivateFieldLooseKey("elements"),_=babelHelpers.classPrivateFieldLooseKey("isLaunch"),k=babelHelpers.classPrivateFieldLooseKey("attributeName");class D{static launch(){babelHelpers.classPrivateFieldLooseBase(D,_)[_]||(D.getElements().forEach(e=>{r.Event.bind(e,"click",t=>{var s,a,r;const i=null==(s=t.target)||null==(a=s.attributes)||null==(r=a.getNamedItem(babelHelpers.classPrivateFieldLooseBase(D,k)[k]))?void 0:r.value;i&&N.getPromoter({code:i,bindElement:e}).show()})}),babelHelpers.classPrivateFieldLooseBase(D,_)[_]=!0)}static getElements(){return babelHelpers.classPrivateFieldLooseBase(D,K)[K]||(babelHelpers.classPrivateFieldLooseBase(D,K)[K]=document.querySelectorAll(`[${babelHelpers.classPrivateFieldLooseBase(D,k)[k]}]`)),babelHelpers.classPrivateFieldLooseBase(D,K)[K]}}Object.defineProperty(D,K,{writable:!0,value:void 0}),Object.defineProperty(D,_,{writable:!0,value:void 0}),Object.defineProperty(D,k,{writable:!0,value:"data-feature-promoter"}),BX.ready(()=>{D.launch()}),e.InfoHelper=class{static init(e){this.sliderProviderForOldFormat=new v({width:700,frameUrlTemplate:e.frameUrlTemplate})}static __showExternal(e,t){var s;null==(s=this.sliderProviderForOldFormat)||s.__showExternal(e,t)}static show(e,t){var s;r.Type.isPlainObject(t)||(t={}),this.init({}),null==(s=this.sliderProviderForOldFormat)||s.show(e,t)}static close(){var e;null==(e=this.sliderProviderForOldFormat)||e.close()}static getContent(){var e;return null==(e=this.sliderProviderForOldFormat)?void 0:e.getContent()}static getFrame(){var e;return null==(e=this.sliderProviderForOldFormat)?void 0:e.getFrame()}static showFrame(e){var t;null==(t=this.sliderProviderForOldFormat)||t.showFrame(e)}static getLoader(){var e;return null==(e=this.sliderProviderForOldFormat)?void 0:e.getLoader()}static getSliderId(){var e;return null==(e=this.sliderProviderForOldFormat)?void 0:e.getId()}static getSlider(){var e;return null==(e=this.sliderProviderForOldFormat)?void 0:e.getSlider()}static reloadParent(){let e=!1;const t=BX.SidePanel.Instance.getTopSlider();t&&(e=BX.SidePanel.Instance.getPreviousSlider(t)),e?e.reload():window.location.reload()}static isOpen(){var e;return null==(e=this.sliderProviderForOldFormat)?void 0:e.isOpen()}static isInited(){return this.inited}},e.FeaturePromoter=C,e.FeaturePromotersRegistry=N}(this.BX.UI=this.BX.UI||{},BX,BX.UI,BX.UI.Analytics,BX);
//# sourceMappingURL=info-helper.bundle.js.map