(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[31],{940:function(t,e,n){"use strict";n.r(e),n.d(e,"AuWidgetHelp",function(){return a}),n.d(e,"widget",function(){return a});var s=n(0),i=n(160),o=n(2),r=n(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(s.d)(e,t),e.prototype.connectedCallback=function(){return Object(s.b)(this,void 0,void 0,function(){var e=this;return Object(s.e)(this,function(n){switch(n.label){case 0:return t.prototype.connectedCallback.call(this),this.stepSubscription=this.observe(r.a.STEP_CHANGED).subscribe(function(t){return e._stepChangeCallback(t)}),[4,this._getHelpButton()];case 1:return n.sent(),[2]}})})},e.prototype._stepChangeCallback=function(t){return Object(s.b)(this,void 0,void 0,function(){return Object(s.e)(this,function(e){return this.currentStep=t.data.step,this._handleParams(),[2]})})},e.prototype.updateParams=function(t){this._handleParams()},e.prototype._handleParams=function(){if(this.params&&this.currentStep)if(this.params.steps){var t=this.params.steps[this.currentStep.index]||this.params.steps[this.currentStep.title];t?(this.helpButton.style.display="block",this._applyConfig(t)):this.helpButton.style.display="none"}else this.params.base&&(this.helpButton.style.display="block",this._applyConfig(this.params.base))},e.prototype._applyConfig=function(t){var e=this;this.helpButton.onclick=function(){return Object(s.b)(e,void 0,void 0,function(){return Object(s.e)(this,function(e){switch(e.label){case 0:switch(t.type){case"modal":return[3,1];case"page":return[3,3]}return[3,4];case 1:return[4,this.auWizard.showModal(t.content)];case 2:return e.sent(),[3,5];case 3:return this._openTab(t.content),[3,5];case 4:console.warn("Type ".concat(t.type," is not supported.")),e.label=5;case 5:return[2]}})})}},e.prototype._openTab=function(t){window.open(t,"_blank")},e.prototype._getHelpButton=function(){return Object(s.b)(this,void 0,void 0,function(){var t;return Object(s.e)(this,function(e){switch(e.label){case 0:return t=this,[4,this.publishData({selector:"paper-button#helpTopBtn"},r.a.GET_ELEMENT_FROM_AU_WIZARD)];case 1:return t.helpButton=e.sent(),[2]}})})},e.prototype.disconnectedCallback=function(){t.prototype.disconnectedCallback.call(this),this.stepSubscription.unsubscribe()},e=Object(s.c)([Object(o.a)("au-widget-help")],e)}(i.a)}}]);