"use strict";(self.webpackChunkneve=self.webpackChunkneve||[]).push([[637],{971:function(e,l,t){t.r(l);var i=t(307),n=t(941),o=t(184),a=t.n(o),s=t(697),r=t.n(s),c=t(736),m=t(609);const g=()=>(0,i.createElement)(m.Tooltip,{text:(0,c.__)("Drag to Reorder","neve")},(0,i.createElement)("button",{"aria-label":(0,c.__)("Drag to Reorder","neve"),className:"handle",onClick:e=>{e.preventDefault()}},(0,i.createElement)(m.Icon,{icon:"menu"}))),b=({item:e,onToggle:l,components:t,allowsToggle:n=!0})=>{const o=t[e.id];return(0,i.createElement)("div",{className:a()({"neve-sortable-item":!0,"no-toggle":!n,visible:e.visible,disabled:!e.visible})},n&&(0,i.createElement)(m.Tooltip,{text:(0,c.__)("Toggle Visibility","neve")},(0,i.createElement)("button",{"aria-label":(0,c.__)("Toggle Visibility","neve"),className:"toggle",onClick:t=>{t.preventDefault(),t.stopPropagation(),l(e.id)}},(0,i.createElement)(m.Icon,{icon:"visibility"}))),(0,i.createElement)("span",{className:"label"},o),e.visible&&(0,i.createElement)(g,null))};b.propTypes={item:r().object.isRequired,onToggle:r().func.isRequired,allowsToggle:r().bool.isRequired,className:r().string,disabled:r().bool};const u=({label:e,onUpdate:l,value:t,components:o,allowsToggle:a=!0})=>{const s=e=>{const l=t.map((l=>(l.id===e&&(l.visible=!l.visible),l)));r(l)},r=e=>{const t=e.sort(((e,l)=>e.visible===l.visible?0:e.visible?-1:1));l(t)};return t=t.filter((e=>o.hasOwnProperty(e.id))),(0,i.createElement)(i.Fragment,null,e&&(0,i.createElement)("label",{className:"customize-control-title"},e),(0,i.createElement)(n._O,{className:"items-list",list:t,setList:r,animation:300,handle:".handle"},t.filter((e=>o.hasOwnProperty(e.id))).map(((e,l)=>(0,i.createElement)(b,{key:"ordering-element-"+l,item:e,onToggle:s,allowsToggle:a,components:o})))))};u.propTypes={label:r().string.isRequired,onUpdate:r().func.isRequired,value:r().array.isRequired,allowsToggle:r().bool,components:r().object.isRequired},l.default=u}}]);