(()=>{"use strict";const e=window.wp.i18n,t=(window.wp.compose,window.wp.data),i=window.wp.coreData,s=window.wp.editor,n=window.wp.components,o=window.wp.element,a=window.wp.plugins,l=window.ReactJSXRuntime,r=(0,l.jsx)("svg",{version:"1.0",xmlns:"http://www.w3.org/2000/svg",width:"20.000000pt",height:"20.000000pt",viewBox:"0 0 20.000000 20.000000",preserveAspectRatio:"xMidYMid meet",children:(0,l.jsx)("g",{transform:"translate(0.000000,20.000000) scale(0.100000,-0.100000)",fill:"#000000",stroke:"none",children:(0,l.jsx)("path",{d:"M10 100 c0 -47 4 -80 10 -80 6 0 10 33 10 80 0 47 -4 80 -10 80 -6 0 -10 -33 -10 -80zM50 170 c0 -5 23 -10 50 -10 28 0 50 5 50 10 0 6 -22 10 -50 10 -27 0 -50 -4 -50 -10zM170 100 c0 -47 4 -80 10 -80 6 0 10 33 10 80 0 47 -4 80 -10 80 -6 0 -10 -33 -10 -80zM50 110 c0 -29 1 -30 50 -30 49 0 50 1 50 30 0 29 -1 30 -50 30 -49 0 -50 -1 -50 -30zM50 35 c0 -11 12 -15 50 -15 38 0 50 4 50 15 0 11 -12 15 -50 15 -38 0 -50 -4 -50 -15z"})})}),d=e=>(0,o.RawHTML)({children:e});(0,a.registerPlugin)("widget-sidebar-options",{render:()=>{const o=(0,t.useSelect)(e=>e("core/editor").getCurrentPostType());if("post"!==o&&"page"!==o)return null;const[a,_]=(0,i.useEntityProp)("postType",o,"meta");function m(e){const t=u(e.value);_({[t]:""})}function u(e){return"_"+e+"_widget"}const p=()=>(0,l.jsx)(n.SelectControl,{label:(0,e.__)("Display items in widget","lumiere-movies"),className:"lum_form_type_query",value:a._lum_form_type_query,onChange:e=>{_({_lum_form_type_query:e})},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,options:lumiere_admin_vars.select_type_search}),c=(0,n.withFocusReturn)(()=>{const t=u(a._lum_form_type_query||"lum_movie_id");return(0,l.jsx)(n.TextControl,{label:"Tite/name/IMDb ID",value:a[t],className:"lum_widget_text",help:d((0,e.sprintf)((0,e.__)("You can get the IMDb ID number by %1$ssearching in the popup%2$s and then copy the ID found here.","lumiere-movies"),'<a data-lumiere_admin_search_popup="noInfoNeeded" class="link-imdblt-highslidepeople" target="_blank">',"</a>")),onChange:e=>{lumiere_admin_vars.select_type_search.forEach(m),_({[t]:e})},autoFocus:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}),w=()=>{const t=lumiere_admin_vars.auto_title_field_name,i=d((0,e.sprintf)((0,e.__)("%1$sAuto title widget%2$s is unactive, related options are hidden","lumiere-movies"),'<a id="link_to_imdbautopostwidget" href="'+lumiere_admin_vars.wordpress_path+'/wp-admin/admin.php?page=lumiere_options&subsection=advanced#imdbautopostwidget">',"</a>"));return"0"===lumiere_admin_vars.auto_title_activated?(0,l.jsx)(n.PanelRow,{children:(0,l.jsx)("div",{className:"lum_widget_options_subtitle",children:i})}):(0,l.jsx)(n.ToggleControl,{label:(0,e.__)("Deactivate Auto Title Widget for this post","lumiere-movies"),help:d((0,e.sprintf)((0,e.__)("Will prevent %1$sAuto Title Widget%2$s to be displayed on this post","lumiere-movies"),'<a id="link_to_imdbautopostwidget" href="'+lumiere_admin_vars.wordpress_path+'/wp-admin/admin.php?page=lumiere_options&subsection=advanced#imdbautopostwidget">',"</a>")),value:a[t],onChange:e=>_({[t]:e}),checked:a[t],__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},h=d((0,e.sprintf)((0,e.__)("Theses features are functional only if you added a %1$sLumiere widget%2$s","lumiere-movies"),'<a href="'+lumiere_admin_vars.wordpress_path+'/wp-admin/widgets.php" target="_blank">',"</a>"));return(0,l.jsxs)(s.PluginDocumentSettingPanel,{title:(0,e.__)("Lumière widget settings","lumiere-movies"),className:"lum_widget_options_title",icon:r,initialOpen:!0,name:"lumiere-widget-sidebar-options",children:[(0,l.jsx)(n.PanelRow,{children:(0,l.jsx)("div",{className:"lum_widget_options_subtitle",children:h})}),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.PanelRow,{className:"lum_sidebar_options_select",children:(0,l.jsx)(p,{})}),(0,l.jsx)(n.PanelRow,{className:"lum_sidebar_options_text",children:(0,l.jsx)(c,{})})]}),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.PanelRow,{children:(0,l.jsx)("div",{className:"lum_widget_options_subtitle",children:"Auto title widget options"})}),(0,l.jsx)(n.PanelRow,{children:(0,l.jsx)(w,{})})]})]})}})})();