(()=>{"use strict";var e,l={862:(e,l,t)=>{const r=window.React,a=window.wp.blocks,o=window.wp.blockEditor,n=window.wp.i18n,i=window.wp.element,s=window.wp.components,d=window.wp.serverSideRender;var p=t.n(d);const c=window.wp.apiFetch;var f=t.n(c);const u=JSON.parse('{"UU":"shared-files/files-default"}');(0,a.registerBlockType)(u.UU,{edit:({attributes:e,setAttributes:l})=>{const{fileId:t,fileUpload:a}=e,d=(0,o.useBlockProps)(),[c,u]=(0,i.useState)([]),[h,b]=(0,i.useState)(!0);return(0,i.useEffect)((()=>{f()({path:"/wp/v2/shared_file?per_page=100"}).then((e=>{u(e.map((e=>({label:e.title.rendered,value:e.id})))),b(!1)}))}),[]),(0,r.createElement)("div",{...d},(0,r.createElement)(o.InspectorControls,null,(0,r.createElement)(s.PanelBody,{title:(0,n.__)("Select Options","shared-files")},(0,r.createElement)(s.CheckboxControl,{label:(0,n.__)("Enable File Upload","shared-files"),checked:a,onChange:e=>l({fileUpload:e})}),!h&&(0,r.createElement)(s.ComboboxControl,{label:(0,n.__)("File","shared-files"),value:t,options:[{label:(0,n.__)("Select a file","shared-files"),value:0},...c],onChange:e=>{l({fileId:e?parseInt(e,10):0})},disabled:a}))),(0,r.createElement)(s.Disabled,null,(0,r.createElement)(p(),{block:"shared-files/files-default",attributes:{fileId:t,fileUpload:a}})))},save:()=>null})}},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var o=t[e]={exports:{}};return l[e](o,o.exports,r),o.exports}r.m=l,e=[],r.O=(l,t,a,o)=>{if(!t){var n=1/0;for(p=0;p<e.length;p++){for(var[t,a,o]=e[p],i=!0,s=0;s<t.length;s++)(!1&o||n>=o)&&Object.keys(r.O).every((e=>r.O[e](t[s])))?t.splice(s--,1):(i=!1,o<n&&(n=o));if(i){e.splice(p--,1);var d=a();void 0!==d&&(l=d)}}return l}o=o||0;for(var p=e.length;p>0&&e[p-1][2]>o;p--)e[p]=e[p-1];e[p]=[t,a,o]},r.n=e=>{var l=e&&e.__esModule?()=>e.default:()=>e;return r.d(l,{a:l}),l},r.d=(e,l)=>{for(var t in l)r.o(l,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:l[t]})},r.o=(e,l)=>Object.prototype.hasOwnProperty.call(e,l),(()=>{var e={57:0,350:0};r.O.j=l=>0===e[l];var l=(l,t)=>{var a,o,[n,i,s]=t,d=0;if(n.some((l=>0!==e[l]))){for(a in i)r.o(i,a)&&(r.m[a]=i[a]);if(s)var p=s(r)}for(l&&l(t);d<n.length;d++)o=n[d],r.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return r.O(p)},t=globalThis.webpackChunkshared_files=globalThis.webpackChunkshared_files||[];t.forEach(l.bind(null,0)),t.push=l.bind(null,t.push.bind(t))})();var a=r.O(void 0,[350],(()=>r(862)));a=r.O(a)})();