View file File name : editor-editing-panel.min.js Content :!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.elementorV2.editorPanels,n=window.React,l=window.wp.i18n,r=window.elementorV2.editorV1Adapters,a=window.elementorV2.ui,o=window.elementorV2.editorResponsive,i=window.elementorV2.editor;function c(){const e=window;return(e.elementor?.selection?.getElements?.()??[]).reduce(((e,t)=>{const n=t.model.get("widgetType")||t.model.get("elType");return n&&e.push({id:t.model.get("id"),type:n}),e}),[])}function s(){const e=window;return e?.elementor?.widgetsCache||null}function m(e){return(0,r.__privateUseListenTo)((0,r.commandEndEvent)("editor/documents/load"),(()=>{if(!e)return null;const t=s(),n=t?.[e];return n?.atomic_controls?{key:e,controls:n.atomic_controls,title:n.title}:null}),[e])}var d=(0,n.createContext)(null);function u({children:e,element:t}){return n.createElement(d.Provider,{value:{element:t}},e)}function p(){const e=(0,n.useContext)(d);if(!e)throw new Error("useElementContext must be used within a ElementContextProvider");return e}var E=(0,n.createContext)(null);function v(e){const t=(0,n.useContext)(E);if(!t)throw new Error("useControl must be used within a ControlContext");return{...t,value:t.value??e}}function b(e){const t=window,n=t.elementor?.getContainer?.(e);return n??null}var g=({bind:e,children:t})=>{const{element:l}=p(),a=(({id:e,bind:t})=>(0,r.__privateUseListenTo)((0,r.commandEndEvent)("document/elements/settings"),(()=>{const n=b(e);return n?.settings?.get(t)??null}),[e,t]))({id:l.id,bind:e});return n.createElement(E.Provider,{value:{setValue:t=>{(({id:e,props:t})=>{const n=b(e);(0,r.__privateRunCommand)("document/elements/settings",{container:n,settings:{...t}})})({id:l.id,props:{[e]:t}})},value:a,bind:e}},t)},y=({children:e,bind:t})=>n.createElement(g,{bind:t},n.createElement(h,{gap:1,direction:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap"},e)),h=(0,a.styled)(a.Stack)` & > * { flex-grow: 1; } & > label { min-width: 50%; } `;y.Label=({children:e})=>n.createElement(a.Typography,{component:"label",variant:"caption",color:"text.secondary"},e);var w=({title:e,children:t})=>{const l=(0,n.useId)(),r=`label-${l}`,o=`content-${l}`;return n.createElement(a.Accordion,{disableGutters:!0,defaultExpanded:!0},n.createElement(a.AccordionSummary,{"aria-controls":o,id:r},n.createElement(a.AccordionSummaryText,{primaryTypographyProps:{variant:"caption"}},e)),n.createElement(a.AccordionDetails,{id:o,"aria-labelledby":r},n.createElement(a.Stack,{gap:2.5},t)))},_={select:({options:e})=>{const{value:t,setValue:l}=v();return n.createElement(a.Select,{size:"tiny",value:t??"",onChange:e=>{l(e.target.value)}},e.map((({label:e,...t})=>n.createElement(a.MenuItem,{key:t.value,...t},e))))},text:({placeholder:e})=>{const{value:t,setValue:l}=v("");return n.createElement(a.TextField,{type:"text",size:"tiny",value:t,onChange:e=>l(e.target.value),placeholder:e})},textarea:({placeholder:e})=>{const{value:t,setValue:l}=v("");return n.createElement(a.TextField,{size:"tiny",multiline:!0,fullWidth:!0,rows:5,value:t,onChange:e=>{l(e.target.value)},placeholder:e})}},f=()=>{const{element:e}=p(),t=m(e?.type);return t?n.createElement(a.Stack,null,t.controls.map((({type:e,value:t},l)=>"control"===e?n.createElement(x,{key:t.bind,control:t}):"section"===e?n.createElement(w,{key:e+"."+l,title:t.label},t.items?.map((e=>"control"===e.type?n.createElement(x,{key:e.value.bind,control:e.value}):null))):null))):null},x=({control:e})=>{const t=(l=e.type,_[l]??null);var l;return t?n.createElement(y,{bind:e.bind},n.createElement(y.Label,null,e.label),n.createElement(t,{...e.props})):null},S=(0,n.createContext)(null);function P({children:e,selectedStyleDef:t}){const l={breakpoint:(0,o.useActiveBreakpoint)(),state:null};return n.createElement(S.Provider,{value:{selectedStyleDef:t,selectedMeta:l}},e)}var C=e=>{const t=b(e);return t?.model.get("styles")||null},T=({bind:e,children:t})=>{const{element:l}=p(),{selectedStyleDef:a,selectedMeta:o}=function(){const e=(0,n.useContext)(S);if(!e)throw new Error("UseStyleContext must be used within a StyleContextProvider");return e}(),i=(({elementID:e,styleDefID:t,meta:n,propName:l})=>(0,r.__privateUseListenTo)((0,r.commandEndEvent)("document/atomic-widgets/styles"),(()=>{if(!t)return null;const r=C(e)?.[t];if(!r)return null;const a=function(e,t){return e.variants.find((e=>e.meta.breakpoint===t.breakpoint&&e.meta.state===t.state))}(r,n);return a?.props[l]??null}),[e,t,l,n]))({elementID:l.id,styleDefID:a?.id,meta:o,propName:e});return n.createElement(E.Provider,{value:{bind:e,value:i,setValue:t=>{(({elementID:e,styleDefID:t,meta:n,props:l,bind:a="classes"})=>{const o=b(e);(0,r.__privateRunCommand)("document/atomic-widgets/styles",{container:o,styleDefID:t,bind:a,meta:n,props:l})})({elementID:l.id,styleDefID:a?.id,props:{[e]:t},meta:o})}}},t)};T.Label=({children:e})=>n.createElement(a.Typography,{component:"label",variant:"caption",color:"text.secondary"},e);var k=({units:e,placeholder:t})=>{const{value:l,setValue:r}=v(D),o=l.value;return n.createElement(a.Stack,{direction:"row"},n.createElement(a.TextField,{size:"tiny",type:"number",value:o.size,onChange:e=>{const{valueAsNumber:t}=e.target;Number.isNaN(t)||r({$$type:"size",value:{...o,size:t}})},placeholder:t}),n.createElement(a.Select,{size:"tiny",value:o.unit,onChange:e=>{const t=e.target.value;r({$$type:"size",value:{...o,unit:t}})},MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}}},e.map((e=>n.createElement(a.MenuItem,{key:e,value:e},e.toUpperCase())))))},D={$$type:"size",value:{unit:"px",size:0}},z=()=>n.createElement(w,{title:(0,l.__)("Size","elementor")},n.createElement(a.Stack,{gap:1.5},n.createElement(a.Stack,{direction:"row",gap:2},n.createElement(V,{bind:"width",label:(0,l.__)("Width","elementor")}),n.createElement(V,{bind:"height",label:(0,l.__)("Height","elementor")})),n.createElement(a.Stack,{direction:"row",gap:2},n.createElement(V,{bind:"min-width",label:(0,l.__)("Min. Width","elementor")}),n.createElement(V,{bind:"min-height",label:(0,l.__)("Min. Height","elementor")})),n.createElement(a.Stack,{direction:"row",gap:2},n.createElement(V,{bind:"max-width",label:(0,l.__)("Max. Width","elementor")}),n.createElement(V,{bind:"max-height",label:(0,l.__)("Max. Height","elementor")})))),I=["px","%","em","rem","vw"],V=({label:e,bind:t})=>n.createElement(T,{bind:t},n.createElement(a.Stack,{gap:1,sx:{flex:"0 1 50%"}},n.createElement(T.Label,null,e),n.createElement(k,{units:I}))),L=()=>{const{element:e}=p(),t=(l=e.id,(0,r.__privateUseListenTo)((0,r.commandEndEvent)("document/atomic-widgets/styles"),(()=>C(l)),[l]));var l;const[o=null]=Object.values(t||{});return n.createElement(P,{selectedStyleDef:o},n.createElement(a.Stack,null,n.createElement(z,null)))},M=()=>{const{getTabProps:e,getTabPanelProps:t,getTabsProps:r}=(0,a.useTabs)("settings");return n.createElement(a.Stack,{direction:"column",sx:{width:"100%"}},n.createElement(a.Tabs,{variant:"fullWidth",indicatorColor:"secondary",textColor:"inherit",...r()},n.createElement(a.Tab,{label:(0,l.__)("General","elementor"),...e("settings")}),n.createElement(a.Tab,{label:(0,l.__)("Style","elementor"),...e("style")})),n.createElement(a.TabPanel,{...t("settings"),disablePadding:!0},n.createElement(f,null)),n.createElement(a.TabPanel,{...t("style"),disablePadding:!0},n.createElement(L,null)))},{panel:A,usePanelActions:$,usePanelStatus:U}=(0,t.__createPanel)({id:"editing-panel",component:()=>{const e=(0,r.__privateUseListenTo)([(0,r.commandEndEvent)("document/elements/select"),(0,r.commandEndEvent)("document/elements/deselect")],(()=>c())),[a]=e,o=m(a?.type);if(1!==e.length||!o)return null;const i=(0,l.__)("Edit %s","elementor").replace("%s",o.title);return n.createElement(t.Panel,null,n.createElement(t.PanelHeader,null,n.createElement(t.PanelHeaderTitle,null,i)),n.createElement(t.PanelBody,null,n.createElement(u,{element:a},n.createElement(M,null))))}}),N=()=>{const e=c(),t=s();return 1===e.length&&!!t?.[e[0].type]?.atomic_controls};(0,t.__registerPanel)(A),(0,r.__privateBlockDataCommand)({command:"panel/editor/open",condition:N}),(0,i.injectIntoLogic)({id:"editing-panel-hooks",component:()=>((()=>{const{open:e}=$();(0,n.useEffect)((()=>(0,r.__privateListenTo)((0,r.commandStartEvent)("panel/editor/open"),(()=>{N()&&e()}))),[])})(),null)}),(window.elementorV2=window.elementorV2||{}).editorEditingPanel=e}();