Your IP : 172.71.120.4


Current Path : /var/www/element/data/www/revenuestory.ru/bitrix/js/ui/qrauthorization/dist/
Upload File :
Current File : /var/www/element/data/www/revenuestory.ru/bitrix/js/ui/qrauthorization/dist/bundle.min.js

this.BX=this.BX||{};(function(t,e,i,o,s){"use strict";var n,a,u;var r=function(){function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,t);this.title=e.title||null;this.content=e.content||null;this.helpLink=e.helpLink||null;this.popup=null;this.loader=null;this.qrNode=null;this.successNode=null;this.loadingNode=null;this.isSubscribe=false}babelHelpers.createClass(t,[{key:"createQrCodeImage",value:function t(){var i=this;e.Dom.clean(this.getQrNode());this.loading();e.ajax.runAction("mobile.deeplink.get",{data:{intent:"calendar"}}).then((function(t){var e;var o=(e=t.data)===null||e===void 0?void 0:e.link;if(o){i.clean();new QRCode(i.getQrNode(),{text:o,width:180,height:180});if(!i.isSubscribe){i.isSubscribe=true;i.subscribe()}}}))["catch"]((function(){}))}},{key:"subscribe",value:function t(){var e=this;if(s.PULL){s.PULL.subscribe({type:"BX.PullClient.SubscriptionType.Server",moduleId:"mobile",command:"onDeeplinkShouldRefresh",callback:function t(i){e.success()}})}}},{key:"getQrNode",value:function t(){if(!this.qrNode){this.qrNode=e.Tag.render(n||(n=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-qr-authorization__popup-qr"></div>\n\t\t\t'])))}return this.qrNode}},{key:"getPopup",value:function t(){var o=this;if(!this.popup){var s='\n\t\t\t\t<div class="ui-qr-authorization__popup-wrapper">\n\t\t\t\t\t<div class="ui-qr-authorization__popup-top">\n\t\t\t\t\t\t<div class="ui-qr-authorization__popup-left '.concat(!this.title?"--flex":"",'"">\n\t\t\t\t\t\t\t').concat(this.title?'<div class="ui-qr-authorization__popup-title">'+this.title+"</div>":"","\n\t\t\t\t\t\t\t").concat(this.content?'<div class="ui-qr-authorization__popup-text">'+this.content+"</div>":"",'\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ui-qr-authorization__popup-right ').concat(!this.title?"--no-margin":"",'" data-role="ui-qr-authorization__qr-node"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ui-qr-authorization__popup-bottom">\n\t\t\t\t\t\t<div class="ui-qr-authorization__popup-bottom--title">').concat(e.Loc.getMessage("UI_QR_AUTHORIZE_TAKE_CODE"),"</div>\n\t\t\t\t\t\t").concat(this.helpLink?'<a href="'+this.helpLink+'" class="ui-qr-authorization__popup-bottom--link">'+e.Loc.getMessage("UI_QR_AUTHORIZE_HELP")+"</a>":"","\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t");this.popup=new i.Popup({className:"ui-qr-authorization__popup ui-qr-authorization__popup-scope",width:this.title&&this.content?710:null,content:s,closeByEsc:true,closeIcon:{top:"14px",right:"15px"},events:{onPopupShow:function t(){o.createQrCodeImage();var e=o.getPopup().getContentContainer().querySelector('[data-role="ui-qr-authorization__qr-node"]');if(e){e.appendChild(o.getQrNode())}}},padding:0,animation:"fading-slide"})}return this.popup}},{key:"success",value:function t(){this.clean();this.getQrNode().classList.add("--success");this.getQrNode().appendChild(this.getSuccessNode())}},{key:"getSuccessNode",value:function t(){if(!this.successNode){this.successNode=e.Tag.render(a||(a=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-qr-authorization__popup-qr-success"></div>\n\t\t\t'])))}return this.successNode}},{key:"loading",value:function t(){this.clean();this.getQrNode().classList.add("--loading");this.getQrNode().appendChild(this.getLoadingNode());this.showLoader()}},{key:"getLoadingNode",value:function t(){if(!this.loadingNode){this.loadingNode=e.Tag.render(u||(u=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-qr-authorization__popup-qr-loading"></div>\n\t\t\t'])))}return this.loadingNode}},{key:"getLoader",value:function t(){if(!this.loader){this.loader=new o.Loader({target:this.getLoadingNode(),size:150})}return this.loader}},{key:"showLoader",value:function t(){void this.getLoader().show()}},{key:"hideLoader",value:function t(){void this.getLoader().hide()}},{key:"clean",value:function t(){this.getQrNode().classList.remove("--loading");this.getQrNode().classList.remove("--success");e.Dom.remove(this.getLoadingNode());e.Dom.remove(this.getSuccessNode());this.hideLoader()}},{key:"show",value:function t(){if(!this.getPopup().isShown()){this.loading();this.getPopup().show()}}},{key:"close",value:function t(){if(this.getPopup().isShown()){this.clean();this.getPopup().close()}}}]);return t}();t.QrAuthorization=r})(this.BX.UI=this.BX.UI||{},BX,BX.Main,BX,BX);
//# sourceMappingURL=bundle.map.js