(()=>{"use strict";var e={790(e){e.exports=window.ReactJSXRuntime},715(e){e.exports=window.wp.blockEditor},997(e){e.exports=window.wp.blocks},427(e){e.exports=window.wp.components},582(e){e.exports=window.wp.coreData},87(e){e.exports=window.wp.element},723(e){e.exports=window.wp.i18n},573(e){e.exports=window.wp.primitives}},o={};function t(l){var n=o[l];if(void 0!==n)return n.exports;var r=o[l]={exports:{}};return e[l](r,r.exports,t),r.exports}t.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},t.d=(e,o)=>{for(var l in o)t.o(o,l)&&!t.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:o[l]})},t.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o);var l=t(997),n=t(723),r=t(715),s=t(427);const p=window.wp.serverSideRender;var a=t.n(p),i=t(573),c=t(790);const d=(0,c.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(i.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),h=(0,c.jsx)(i.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)(i.Path,{d:"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"})});var u=t(87),w=t(582);const _=[{name:(0,n.__)("Small","peeps-people-directory"),value:"has-small-icon-size"},{name:(0,n.__)("Normal","peeps-people-directory"),value:"has-normal-icon-size"},{name:(0,n.__)("Large","peeps-people-directory"),value:"has-large-icon-size"},{name:(0,n.__)("Huge","peeps-people-directory"),value:"has-huge-icon-size"}],x=JSON.parse('{"UU":"ph-peeps/social-links"}');(0,l.registerBlockType)(x.UU,{edit:function({attributes:e,setAttributes:o}){const{iconColorValue:t,iconBackgroundColorValue:l,size:p="has-normal-icon-size",openInNewTab:i,showLabels:x}=e,y=(0,r.useBlockProps)(),[v,g]=(0,u.useState)(0),[b]=(0,w.useEntityProp)("postType","ph_peeps_people","meta"),m=JSON.stringify(b?.ph_peeps_social_links),j=(0,u.useRef)(m);return(0,u.useEffect)((()=>{j.current!==m&&(g((e=>e+1)),j.current=m)}),[m]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(r.BlockControls,{children:[(0,c.jsx)(s.ToolbarGroup,{children:(0,c.jsx)(s.ToolbarButton,{icon:d,label:(0,n.__)("Change layout","peeps-people-directory"),onClick:()=>{const t="horizontal"===e.layout?.orientation?"vertical":"horizontal";o({layout:{...e.layout,orientation:t}})}})}),(0,c.jsx)(r.JustifyContentControl,{value:e.layout?.justifyContent,onChange:t=>o({layout:{...e.layout,justifyContent:t}}),allowedControls:["left","center","right","space-between"]})]}),(0,c.jsxs)(r.InspectorControls,{children:[(0,c.jsxs)(s.PanelBody,{title:(0,n.__)("Settings","peeps-people-directory"),children:[(0,c.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Show labels","peeps-people-directory"),checked:x,onChange:()=>o({showLabels:!x})}),(0,c.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,n.__)("Open links in new tab","peeps-people-directory"),checked:i,onChange:()=>o({openInNewTab:!i})})]}),(0,c.jsx)(s.PanelBody,{title:(0,n.__)("Styles","peeps-people-directory"),children:(0,c.jsx)(s.SelectControl,{label:(0,n.__)("Size","peeps-people-directory"),value:p,options:_.map((({name:e,value:o})=>({label:e,value:o}))),onChange:e=>o({size:e})})}),(0,c.jsx)(r.PanelColorSettings,{title:(0,n.__)("Color settings","peeps-people-directory"),colorSettings:[{value:t,onChange:e=>{o({iconColorValue:e})},label:(0,n.__)("Icon color","peeps-people-directory")},{value:l,onChange:e=>{o({iconBackgroundColorValue:e})},label:(0,n.__)("Icon background","peeps-people-directory")}]})]}),(0,c.jsx)("div",{...y,children:(0,c.jsx)(a(),{block:"ph-peeps/social-links",attributes:e,EmptyResponsePlaceholder:()=>(0,c.jsx)(s.Placeholder,{icon:h,label:(0,n.__)("Social Links","peeps-people-directory"),instructions:(0,n.__)("Add social links in the Person settings to display them here.","peeps-people-directory")}),LoadingResponsePlaceholder:()=>(0,c.jsx)(s.Placeholder,{icon:h,label:(0,n.__)("Social Links","peeps-people-directory"),children:(0,c.jsx)(s.Spinner,{})})},v)})]})}})})();