(()=>{"use strict";const e=window.wp.blocks,o=JSON.parse('{"apiVersion":3,"name":"jobus/shortcode-company-archive","title":"Company Archive Shortcode (Jobus)","category":"jobus-blocks","icon":"dashicons dashicons-shortcode","description":"Display the Company Archive posts on the website frontend","supports":{"html":false,"anchor":true},"attributes":{"company_layout":{"type":"string","default":"1"},"preview":{"type":"boolean","default":false}},"example":{"attributes":{"preview":true}},"keywords":["jobus","Shortcode","Company Archive"],"textdomain":"jobus","editorScript":"file:./index.js","editorStyle":"file:./editor.css"}'),t=window.wp.i18n,s=window.wp.blockEditor,i=window.wp.components,a=window.React,l=window.wp.element,r=window.ReactJSXRuntime,n=()=>(0,r.jsxs)("h3",{children:["Here is a set of ",(0,r.jsx)("strong",{children:"job archive layout"})," shortcodes for your block widgets. These shortcodes are designed specifically to display job archive layouts"]});(0,e.registerBlockType)(o,{edit:function({attributes:e,setAttributes:o}){const{company_layout:c,preview:u}=e,p=(0,s.useBlockProps)(),d=jobus_block_params.jobus_is_premium,[b,y]=(0,a.useState)(null),[m,h]=(0,a.useState)({top:0,left:0}),j=(0,a.useRef)({}),_=[{label:(0,t.__)("Sidebar Filter Layout","jobus"),value:"1",img:jobus_block_params.jobus_image_dir+"/layout/company/archive-layout-1.png",pro:!1},{label:(0,t.__)("Grid Layout","jobus"),value:"2",img:jobus_block_params.jobus_image_dir+"/layout/company/archive-layout-2.png",pro:!0}];return u?(0,r.jsx)("div",{className:"block-preview",children:(0,r.jsx)(n,{})}):(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsx)(i.PanelBody,{title:(0,t.__)("Company Archive Layout","jobus"),initialOpen:!0,children:(0,r.jsx)(i.BaseControl,{label:(0,t.__)("Select Layout","jobus"),children:(0,r.jsx)("div",{className:"jbs-layout-options",style:{display:"flex",gap:"1rem",position:"relative"},children:_.map((e=>(0,r.jsxs)("div",{ref:o=>j.current[e.value]=o,className:`layout-option ${c===e.value?"active":""} ${e.pro&&!d?"locked":""}`,onClick:()=>(e=>{if(!e.pro||d)o({company_layout:e.value}),y(null);else if(j.current[e.value]){const o=j.current[e.value].getBoundingClientRect();h({top:o.top,left:o.left-280}),y(e.value)}})(e),style:{position:"relative",cursor:e.pro&&!d?"not-allowed":"pointer"},children:[(0,r.jsx)("img",{src:e.img,alt:e.label}),(0,r.jsx)("span",{className:"layout-label",style:{display:"block",textAlign:"center"},children:e.label})]},e.value)))})})})}),(0,r.jsx)("div",{...p,children:"[jobus_company_archive]"}),b&&j.current[b]&&(0,l.createPortal)((0,r.jsx)("div",{style:{position:"fixed",top:m.top+"px",left:m.left+"px",width:"280px",zIndex:99999},children:(0,r.jsxs)(i.Notice,{status:"info",isDismissible:!0,onRemove:()=>y(null),className:"jbs-pro-notice",children:[(0,r.jsxs)("h4",{style:{margin:"0 0 0.5rem 0",fontWeight:"bold"},children:[(0,t.__)("Pro Feature","jobus")," 🔒"]}),(0,r.jsx)("p",{style:{marginBottom:"0.5rem"},children:(0,t.__)("This company layout is part of Jobus Pro. Unlock this design and advanced customization options by upgrading today!","jobus")}),(0,r.jsx)(i.Button,{isPrimary:!0,href:jobus_block_params.jobus_upgrade_url,target:"_blank",style:{marginTop:"0.25rem"},className:"jobus-upgrade-button",children:(0,t.__)("Upgrade Now","jobus")})]})}),document.body)]})},save:function(e){const{company_layout:o}=e.attributes,t=s.useBlockProps.save(),i=`[jobus_company_archive company_layout="${o}"]`;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{...t,children:i})})}})})();
//# sourceMappingURL=index.js.map