(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.wp.blocks,n=window.wp.serverSideRender;var a=t.n(n);const o=window.wp.blockEditor,c=window.wp.components,u=window.wp.element,i=window.ReactJSXRuntime;(0,e.registerBlockType)("um-block/um-account",{edit:function(t){const{attributes:e,setAttributes:n}=t,{tab:r}=e,s=(0,o.useBlockProps)(),l=(0,u.useMemo)(()=>{const t=[{label:wp.i18n.__("All","ultimate-member"),value:"all"}];for(const e in um_account_settings)um_account_settings.hasOwnProperty(e)&&um_account_settings[e].enabled&&t.push({label:um_account_settings[e].label,value:e});return t},[]),d=(0,u.useCallback)(t=>{n({tab:t}),n({content:`[ultimatemember_account${"all"!==t?` tab="${t}"`:""}]`})},[n]);return(0,i.jsxs)("div",{...s,children:[(0,i.jsx)(a(),{block:"um-block/um-account",attributes:e}),(0,i.jsx)(o.InspectorControls,{children:(0,i.jsx)(c.PanelBody,{title:wp.i18n.__("Account Tab","ultimate-member"),children:(0,i.jsx)(c.SelectControl,{label:wp.i18n.__("Select Tab","ultimate-member"),className:"um_select_account_tab",value:r,options:l,style:{height:"35px",lineHeight:"20px",padding:"0 7px"},onChange:d})})})]})},save:()=>null}),jQuery(window).on("load",function(t){new MutationObserver(function(t){t.forEach(function(t){jQuery(t.addedNodes).find(".um.um-account").each(function(){let t=jQuery(this).find(".um-account-main").attr("data-current_tab"),e=document.querySelector(".um-form");t&&(jQuery(this).find('.um-account-tab[data-tab="'+t+'"]').show(),jQuery(this).find(".um-account-tab:not(:visible)").find("input, select, textarea").not(":disabled").addClass("um_account_inactive").prop("disabled",!0).attr("disabled",!0),um_responsive()),e&&e.addEventListener("click",t=>{t.target!==e&&(t.preventDefault(),t.stopPropagation())})})})}).observe(document,{attributes:!1,childList:!0,characterData:!1,subtree:!0})})})();