(()=>{"use strict";var e,t={877:()=>{const e=window.React,t=window.wp.i18n;function o(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=o(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}const r=function(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=o(e))&&(n&&(n+=" "),n+=t);return n},n=window.wp.blocks,a=window.wp.blockEditor,l=(window.wp.serverSideRender,window.wp.components),i=window.wp.element,{createBlock:c}=(window.lodash,wp.blocks),s={from:[{type:"block",blocks:["oik-block/contact-form"],transform:function(e){return c("oik/contact-form",{})}},{type:"shortcode",tag:"bw_contact_form",attributes:{user:{type:"string",shortcode:({named:{user:e}})=>e},contact:{type:"string",shortcode:({named:{contact:e}})=>e},email:{type:"string",shortcode:({named:{email:e}})=>e}}}]};(0,n.registerBlockType)("oik/contact-form",{example:{},transforms:s,edit:o=>{const{attributes:n,setAttributes:c,instanceId:s,focus:u,isSelected:d}=o,{textAlign:m,label:p}=o.attributes,f=(0,a.useBlockProps)({className:r({[`has-text-align-${m}`]:m})}),{email:b,contact:k}=n;if(void 0===b||""===b.trim()){const e=wp.data.select("core/blocks").getBlockType("oik/contact-form").attributes;o.setAttributes({email:e.email.default})}if(void 0===k||""===k.trim()){const e=wp.data.select("core/blocks").getBlockType("oik/contact-form").attributes;o.setAttributes({contact:e.contact.default})}return(0,e.createElement)(i.Fragment,null,(0,e.createElement)(a.InspectorControls,null,(0,e.createElement)(l.PanelBody,null,(0,e.createElement)(l.PanelRow,null,(0,e.createElement)(l.TextControl,{label:(0,t.__)("Email address","oik"),value:n.email,onChange:e=>{o.setAttributes({email:e})}})),(0,e.createElement)(l.PanelRow,null,(0,e.createElement)(l.TextControl,{label:(0,t.__)("Text for Submit button","oik"),value:n.contact,onChange:e=>{o.setAttributes({contact:e})}})))),(0,e.createElement)("div",{...f},!1,(0,e.createElement)(a.InnerBlocks,{template:[["oik/contact-field",{label:"Name",type:"text",required:!0,requiredIndicator:" *"}],["oik/contact-field",{label:"Email",type:"email",required:!0,requiredIndicator:" *"}],["oik/contact-field",{label:"Subject",type:"text",required:!1}],["oik/contact-field",{label:"Message",type:"textarea",required:!0,requiredIndicator:" *"}]],allowedBlocks:["oik/contact-field"]}),(0,e.createElement)("input",{type:"submit",value:o.attributes.contact})))},save(){const t=a.useBlockProps.save();return(0,e.createElement)("div",{...t},(0,e.createElement)(a.InnerBlocks.Content,null))}})}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.m=t,e=[],r.O=(t,o,n,a)=>{if(!o){var l=1/0;for(u=0;u<e.length;u++){for(var[o,n,a]=e[u],i=!0,c=0;c<o.length;c++)(!1&a||l>=a)&&Object.keys(r.O).every((e=>r.O[e](o[c])))?o.splice(c--,1):(i=!1,a<l&&(l=a));if(i){e.splice(u--,1);var s=n();void 0!==s&&(t=s)}}return t}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[o,n,a]},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={436:0,249:0};r.O.j=t=>0===e[t];var t=(t,o)=>{var n,a,[l,i,c]=o,s=0;if(l.some((t=>0!==e[t]))){for(n in i)r.o(i,n)&&(r.m[n]=i[n]);if(c)var u=c(r)}for(t&&t(o);s<l.length;s++)a=l[s],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return r.O(u)},o=globalThis.webpackChunkoik=globalThis.webpackChunkoik||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var n=r.O(void 0,[249],(()=>r(877)));n=r.O(n)})();