(()=>{"use strict";var e,t={7407:()=>{const e=window.React,t=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"plover-kit/code-snippet","title":"Plover: Code Snippet","category":"plover-blocks","description":"Insert code snippets to current post","keywords":["code","snippet"],"textdomain":"plover-kit","version":"1.0.0","attributes":{"snippet":{"type":"number"}},"editorScript":"file:./index.js","editorStyle":"file:./index.min.css","style":"file:./style-index.min.css","render":"file:./render.php"}'),o=window.wp.blockEditor,r=window.wp.components,n=window.wp.i18n,l=window.wp.coreData,i=window.ploverKit.dashboard,a=window.plover.utils,s=window.plover.components;function p(t){return(0,e.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...t},(0,e.createElement)(r.Path,{fillRule:"evenodd",d:"M14.447 3.026a.75.75 0 0 1 .527.921l-4.5 16.5a.75.75 0 0 1-1.448-.394l4.5-16.5a.75.75 0 0 1 .921-.527ZM16.72 6.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L21.44 12l-4.72-4.72a.75.75 0 0 1 0-1.06Zm-9.44 0a.75.75 0 0 1 0 1.06L2.56 12l4.72 4.72a.75.75 0 0 1-1.06 1.06L.97 12.53a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const c=window.wp.blocks,{name:d}=t;!function(e){if(!e)return;const{metadata:t,settings:o,name:r}=e;(0,c.registerBlockType)({name:r,...t},o)}({name:d,metadata:t,settings:{icon:(0,e.createElement)(p,null),example:{},edit:function({attributes:t,setAttributes:c}){const d=(0,o.useBlockProps)();let m=(0,e.createElement)("p",null,(0,e.createElement)("span",{dangerouslySetInnerHTML:{__html:(0,n.sprintf)(/* translators: %s is the premium text and link. */ /* translators: %s is the premium text and link. */
(0,n.__)("Upgrade to %s to access this block.","plover-kit"),'<a href="'+(0,a.upsell_url)()+'" target="_blank">'+(0,n.__)("Premium","plover-kit")+"</a>")}}),(0,e.createElement)("a",{href:"https://wpplover.com/docs/plover-kit/modules/code-snippets/#code-snippet-block",target:"_blank",style:{padding:"0 4px"}},(0,n.__)("Learn More ↗","plover-kit")));if((0,a.is_premium)()){m=(0,e.createElement)(r.Spinner,null);const{records:o,hasResolved:n}=(0,l.useEntityRecords)("postType","plover_code_snippet",{status:"draft,publish",per_page:-1});if(n){const r=[{value:"",label:""},...(o||[]).map((({id:e,title:t})=>({value:e,label:t.raw})))];m=(0,e.createElement)(i.Select,{label:null,value:t?.snippet,options:r,onChange:e=>{e=Number.parseInt(e),c({snippet:isNaN(e)?"":e})},__nextHasNoMarginBottom:!0})}}return(0,e.createElement)("div",{...d},(0,e.createElement)(o.InspectorControls,null,(0,e.createElement)(s.DocLink,{borderTop:!0,link:"https://wpplover.com/docs/plover-kit/modules/code-snippets/",text:(0,n.__)("Read Documentation ↗","plover-kit")})),(0,e.createElement)(r.Placeholder,{icon:(0,e.createElement)(p,{width:20}),label:(0,e.createElement)("span",{style:{padding:"0 6px"}},(0,n.__)("Plover: Code Snippet","plover-kit")),className:"plover-code-snippet-block-placeholder"},m))}}})}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var l=o[e]={exports:{}};return t[e](l,l.exports,r),l.exports}r.m=t,e=[],r.O=(t,o,n,l)=>{if(!o){var i=1/0;for(c=0;c<e.length;c++){for(var[o,n,l]=e[c],a=!0,s=0;s<o.length;s++)(!1&l||i>=l)&&Object.keys(r.O).every((e=>r.O[e](o[s])))?o.splice(s--,1):(a=!1,l<i&&(i=l));if(a){e.splice(c--,1);var p=n();void 0!==p&&(t=p)}}return t}l=l||0;for(var c=e.length;c>0&&e[c-1][2]>l;c--)e[c]=e[c-1];e[c]=[o,n,l]},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={169:0,1581:0};r.O.j=t=>0===e[t];var t=(t,o)=>{var n,l,[i,a,s]=o,p=0;if(i.some((t=>0!==e[t]))){for(n in a)r.o(a,n)&&(r.m[n]=a[n]);if(s)var c=s(r)}for(t&&t(o);p<i.length;p++)l=i[p],r.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return r.O(c)},o=globalThis.webpackChunkplover_kit=globalThis.webpackChunkplover_kit||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var n=r.O(void 0,[1581],(()=>r(7407)));n=r.O(n)})();