this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(t,i,e,n){"use strict";function a(){var t=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="landing-ui-field-accordion-item landing-ui-field-accordion-item-active" data-id="','">\n\t\t\t\t<div class="landing-ui-field-accordion-item-header">\n\t\t\t\t\t<div class="landing-ui-field-accordion-item-header-icon" style="background-image: url(',')"></div>\n\t\t\t\t\t<div \n\t\t\t\t\t\tclass="landing-ui-field-accordion-item-header-title"\n\t\t\t\t\t\tonclick="','"\n\t\t\t\t\t>','</div>\n\t\t\t\t\t<div \n\t\t\t\t\t\tclass="landing-ui-field-accordion-item-header-switch"\n\t\t\t\t\t\tstyle="','"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class="landing-ui-field-accordion-item-header-switch-link"></div>\n\t\t\t\t\t\t','\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="landing-ui-field-accordion-item-body">\n\t\t\t\t\t',"\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t"]);a=function i(){return t};return t}function d(){var t=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-ui-field-accordion-items-container"></div>\n\t\t\t']);d=function i(){return t};return t}var l=function(t){babelHelpers.inherits(i,t);function i(t){var n;babelHelpers.classCallCheck(this,i);n=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).call(this,t));n.setEventNamespace("BX.Landing.UI.Field.AccordionField");e.Dom.addClass(n.layout,"landing-ui-field-accordion");e.Dom.replace(n.input,n.getItemsContainer());n.items=[];t.items.forEach(function(t){n.addItem(t)});return n}babelHelpers.createClass(i,[{key:"getItemsContainer",value:function t(){return this.cache.remember("itemsContainer",function(){return e.Tag.render(d())})}},{key:"onTitleClick",value:function t(i){i.preventDefault();var n=i.currentTarget.closest(".landing-ui-field-accordion-item");if(e.Dom.hasClass(n,"landing-ui-field-accordion-item-active")){e.Dom.toggleClass(n,"landing-ui-field-accordion-item-opened")}}},{key:"createItem",value:function t(i){var d=new n.SmallSwitch({value:e.Text.toBoolean(i.checked),onValueChange:function t(){var i=d.layout.closest(".landing-ui-field-accordion-item");if(d.getValue()){e.Dom.addClass(i,"landing-ui-field-accordion-item-active")}else{e.Dom.removeClass(i,"landing-ui-field-accordion-item-active");e.Dom.removeClass(i,"landing-ui-field-accordion-item-opened")}}});return e.Tag.render(a(),i.id,i.icon,this.onTitleClick.bind(this),i.title,i.switcher===false?"display: none;":"",d.layout,i.content)}},{key:"addItem",value:function t(i){var n=this.createItem(i);e.Dom.append(n,this.getItemsContainer())}}]);return i}(i.BaseField);t.AccordionField=l})(this.BX.Landing.UI.Field=this.BX.Landing.UI.Field||{},BX.Landing.UI.Field,BX,BX.Landing.UI.Field);
//# sourceMappingURL=accordionfield.bundle.map.js