!function($){var e=wp.customize;e.bind("pane-contents-reflowed",function(){var t=[];e.section.each(function(e){"adviso_section"===e.params.type&&"undefined"!=typeof e.params.section&&t.push(e)}),t.sort(e.utils.prioritySort).reverse(),$.each(t,function(e,t){var n=$("#sub-accordion-section-"+t.params.section);n.children(".section-meta").after(t.headContainer)});var n=[];e.panel.each(function(e){"adviso_panel"===e.params.type&&"undefined"!=typeof e.params.panel&&n.push(e)}),n.sort(e.utils.prioritySort).reverse(),$.each(n,function(e,t){var n=$("#sub-accordion-panel-"+t.params.panel);n.children(".panel-meta").after(t.headContainer)})});var t=wp.customize.Panel.prototype.embed,n=wp.customize.Panel.prototype.isContextuallyActive,a=wp.customize.Panel.prototype.attachEvents;wp.customize.Panel=wp.customize.Panel.extend({attachEvents:function(){if("adviso_panel"!==this.params.type||"undefined"==typeof this.params.panel)return void a.call(this);a.call(this);var t=this;t.expanded.bind(function(n){var a=e.panel(t.params.panel);n?a.contentContainer.addClass("current-panel-parent"):a.contentContainer.removeClass("current-panel-parent")}),t.container.find(".customize-panel-back").off("click keydown").on("click keydown",function(n){e.utils.isKeydownButNotEnterEvent(n)||(n.preventDefault(),t.expanded()&&e.panel(t.params.panel).expand())})},embed:function(){if("adviso_panel"!==this.params.type||"undefined"==typeof this.params.panel)return void t.call(this);t.call(this);var e=this,n=$("#sub-accordion-panel-"+this.params.panel);n.append(e.headContainer)},isContextuallyActive:function(){if("adviso_panel"!==this.params.type)return n.call(this);var t=this,a=this._children("panel","section");e.panel.each(function(e){e.params.panel&&e.params.panel===t.id&&a.push(e)}),a.sort(e.utils.prioritySort);var i=0;return _(a).each(function(e){e.active()&&e.isContextuallyActive()&&(i+=1)}),0!==i}});var i=wp.customize.Section.prototype.embed,o=wp.customize.Section.prototype.isContextuallyActive,s=wp.customize.Section.prototype.attachEvents;wp.customize.Section=wp.customize.Section.extend({attachEvents:function(){if("adviso_section"!==this.params.type||"undefined"==typeof this.params.section)return void s.call(this);s.call(this);var t=this;t.expanded.bind(function(n){var a=e.section(t.params.section);n?a.contentContainer.addClass("current-section-parent"):a.contentContainer.removeClass("current-section-parent")}),t.container.find(".customize-section-back").off("click keydown").on("click keydown",function(n){e.utils.isKeydownButNotEnterEvent(n)||(n.preventDefault(),t.expanded()&&e.section(t.params.section).expand())})},embed:function(){if("adviso_section"!==this.params.type||"undefined"==typeof this.params.section)return void i.call(this);i.call(this);var e=this,t=$("#sub-accordion-section-"+this.params.section);t.append(e.headContainer)},isContextuallyActive:function(){if("adviso_section"!==this.params.type)return o.call(this);var t=this,n=this._children("section","control");e.section.each(function(e){e.params.section&&e.params.section===t.id&&n.push(e)}),n.sort(e.utils.prioritySort);var a=0;return _(n).each(function(e){"undefined"!=typeof e.isContextuallyActive?e.active()&&e.isContextuallyActive()&&(a+=1):e.active()&&(a+=1)}),0!==a}})}(jQuery);