!function(){"use strict";var e={};(function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);var t=window.wp.blocks,n=window.wp.element,o=window.wp.primitives,i=(0,n.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(o.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})),s=window.React,r=window.wp.i18n,c=window.wp.htmlEntities,l=window.wp.blockEditor,d=window.wp.data,a=window.nisje.components,w=window.nisje.icons,v=window.nisje.fullSiteEditing;const m="dekode-event";(0,t.registerBlockType)("nisje/card-event",{icon:i,edit:function(e){let{attributes:t,setAttributes:o}=e;const{postId:i}=t,[p,u]=(0,s.useState)(!1),h=(0,l.useBlockProps)({className:"editor-event-post"}),E=(0,d.useSelect)((e=>{if(0===i)return(0,r.__)("Currently showing latest event","nisje");const t=e("core").getEntityRecord("postType",m,i);return(null==t?void 0:t.title.rendered)||"..."}),[i]),S=0!==i;return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(v.PostSelectorPanel,{hasSelected:S,onOpen:()=>u(!0),onRemove:()=>o({postId:0})}),(0,n.createElement)(a.BaseCard,h,(0,n.createElement)("div",null,(0,n.createElement)(w.Icon,{icon:w.calendar,size:40}),(0,n.createElement)(a.TextDeprecated,{as:"h2",variant:"title-medium"},(0,r.__)("Event","nisje")),(0,n.createElement)(a.TextDeprecated,{as:"p"},(0,c.decodeEntities)(E)))),p&&(0,n.createElement)(v.PostSelector,{onRequestClose:()=>u(!1),onSelect:e=>o({postId:e}),postType:m}))}}),(window.nisje=window.nisje||{}).pluginEventsAdmin=e}();