View file File name : editor-editing-panel.min.js Content :!function(){"use strict";var e={d:function(t,n){for(var l in n)e.o(n,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:n[l]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{replaceControl:function(){return E},useControl:function(){return v}});var n,l=window.React,a=window.elementorV2.editorPanels,r=window.wp.i18n,o=window.elementorV2.editorV1Adapters,c=window.elementorV2.ui,i=window.elementorV2.utils,m=window.elementorV2.icons,s=window.elementorV2.wpMedia,u=window.elementorV2.editorResponsive,d=window.elementorV2.editor,p=window.elementorV2.schema,E=({component:e,condition:t})=>{n={component:e,condition:t}},g=(0,l.createContext)(null);function v(e){const t=(0,l.useContext)(g);if(!t)throw new Error("useControl must be used within a ControlContext");return{...t,value:t.value??e}}function b(){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 h(){const e=window;return e?.elementor?.widgetsCache||null}var y=(0,l.createContext)(null);function _({children:e,element:t,elementType:n}){return l.createElement(y.Provider,{value:{element:t,elementType:n}},e)}function f(){const e=(0,l.useContext)(y);if(!e)throw new Error("useElementContext must be used within a ElementContextProvider");return e}function S(e){const t=window,n=t.elementor?.getContainer?.(e);return n??null}var w=({children:e})=>l.createElement(c.Typography,{component:"label",variant:"caption",color:"text.secondary"},e),I=(0,c.styled)(c.Stack)((({theme:e,gap:t,direction:n})=>({"> :only-child":{width:"100%"},"&:where( :has( > :nth-child( 2 ):last-child ) ) > :where( * )":{width:"column"===n?"100%":`calc( 50% - ${e.spacing(t/2)})`},"&:where( :has( > :nth-child( 3 ):last-child ) ) > :where( * )":{width:"column"===n?"100%":`calc( 33.3333% - ${e.spacing(2*t)} / 3)`}}))),x=e=>l.createElement(I,{gap:1,direction:"row",alignItems:"center",justifyContent:"space-between",...e}),C=({bind:e,children:t})=>{const{element:n,elementType:a}=f(),r=a.propsSchema[e]?.type.default,c=(({id:e,bind:t})=>(0,o.__privateUseListenTo)((0,o.commandEndEvent)("document/elements/settings"),(()=>{const n=S(e);return n?.settings?.get(t)??null}),[e,t]))({id:n.id,bind:e}),i=c??r??null;return l.createElement(g.Provider,{value:{setValue:t=>{(({id:e,props:t})=>{const n=S(e);(0,o.__privateRunCommand)("document/elements/settings",{container:n,settings:{...t}})})({id:n.id,props:{[e]:t}})},value:i,bind:e}},t)},k=({children:e,bind:t})=>l.createElement(C,{bind:t},l.createElement(x,{flexWrap:"wrap"},e));k.Label=w;var T=({title:e,children:t})=>{const n=(0,l.useId)(),a=`label-${n}`,r=`content-${n}`;return l.createElement(c.Accordion,{disableGutters:!0,defaultExpanded:!0},l.createElement(c.AccordionSummary,{"aria-controls":r,id:a},l.createElement(c.AccordionSummaryText,{primaryTypographyProps:{variant:"caption"}},e)),l.createElement(c.AccordionDetails,{id:r,"aria-labelledby":a},l.createElement(c.Stack,{gap:2.5},t)))},P=({placeholder:e,type:t,value:n,onChange:a,endAdornment:r,startAdornment:o})=>l.createElement(c.TextField,{size:"tiny",type:t,value:n,onChange:a,placeholder:e,InputProps:{endAdornment:r,startAdornment:o}}),z=({options:e,onClick:t,value:n})=>{const a=(0,c.usePopupState)({variant:"popover",popupId:(0,l.useId)()});return l.createElement(c.InputAdornment,{position:"end"},l.createElement(c.Button,{size:"small",color:"inherit",sx:{font:"inherit",minWidth:"initial"},...(0,c.bindTrigger)(a)},n.toUpperCase()),l.createElement(c.Menu,{MenuListProps:{dense:!0},...(0,c.bindMenu)(a)},e.map(((n,r)=>l.createElement(c.MenuItem,{key:n,onClick:()=>(n=>{t(e[n]),a.close()})(r)},n.toUpperCase())))))},L=["px","%","em","rem","vw"],V=({units:e=L,placeholder:t,startIcon:n})=>{const{value:a,setValue:r}=v(),[o,i]=(({external:e,setExternal:t,persistWhen:n,fallback:a})=>{function r(e,t){return e||a(t)}const[o,c]=(0,l.useState)(r(e,void 0));return(0,l.useEffect)((()=>{c((t=>r(e,t)))}),[e]),[o,e=>{const l=("function"==typeof e?e:()=>e)(o);c(l),t(function(e){if(n(e))return e}(l))}]})({external:a,setExternal:r,persistWhen:e=>!!e?.value.size||0===e?.value.size,fallback:e=>({$$type:"size",value:{unit:e?.value.unit||"px",size:NaN}})});return l.createElement(P,{endAdornment:l.createElement(z,{options:e,onClick:e=>{i((t=>({...t,value:{...t.value,unit:e}})))},value:o.value.unit}),placeholder:t,startAdornment:n??l.createElement(c.InputAdornment,{position:"start"},n),type:"number",value:Number.isNaN(o.value.size)?"":o.value.size,onChange:e=>{const{value:t}=e.target;i((e=>({...e,value:{...e.value,size:t||"0"===t?parseFloat(t):NaN}})))}})},D=({options:e})=>{const{value:t,setValue:n}=v();return l.createElement(c.Select,{size:"tiny",value:t??"",onChange:e=>{n(e.target.value)}},e.map((({label:e,...t})=>l.createElement(c.MenuItem,{key:t.value,...t},e))))},$={image:()=>{const{value:e,setValue:t}=v(),{data:n}=(0,s.useWpMediaAttachment)(e?.value?.attachmentId),a=n?.url??e?.value?.url,{open:o}=(0,s.useWpMediaFrame)({types:["image"],multiple:!1,selected:e?.value?.attachmentId,onSelect:e=>{t({$$type:"image",value:{attachmentId:e.id}})}});return l.createElement(c.Card,{variant:"outlined"},l.createElement(c.CardMedia,{image:a,sx:{height:150}}),l.createElement(c.CardOverlay,null,l.createElement(c.Button,{color:"inherit",size:"small",variant:"outlined",onClick:()=>{o({mode:"browse"})}},(0,r.__)("Select Image","elementor")),l.createElement(c.Button,{color:"inherit",size:"small",variant:"text",startIcon:l.createElement(m.UploadIcon,null),onClick:()=>{o({mode:"upload"})}},(0,r.__)("Upload Image","elementor"))))},text:({placeholder:e})=>{const{value:t,setValue:n}=v("");return l.createElement(c.TextField,{type:"text",size:"tiny",value:t,onChange:e=>n(e.target.value),placeholder:e})},textarea:({placeholder:e})=>{const{value:t,setValue:n}=v();return l.createElement(c.TextField,{size:"tiny",multiline:!0,fullWidth:!0,rows:5,value:t,onChange:e=>{n(e.target.value)},placeholder:e})},size:V,select:D},B=e=>$[e],A=(0,i.createError)({code:"CONTROL_TYPE_NOT_FOUND",message:"Control type not found."}),M=({props:e,type:t})=>{const{value:a}=v(),r=B(t);if(!r)throw new A({context:{type:t}});const o=(({value:e})=>{let t=!1;try{t=!!n?.condition({value:e})}catch{}return t?n?.component:void 0})({value:a})||r;return l.createElement(o,{...e})},N=()=>{const{elementType:e}=f();return l.createElement(c.Stack,null,e.controls.map((({type:e,value:t},n)=>"control"===e?l.createElement(O,{key:t.bind,control:t}):"section"===e?l.createElement(T,{key:e+"."+n,title:t.label},t.items?.map((e=>"control"===e.type?l.createElement(O,{key:e.value.bind,control:e.value}):null))):null)))},O=({control:e})=>B(e.type)?l.createElement(k,{bind:e.bind},e.label?l.createElement(k.Label,null,e.label):null,l.createElement(M,{type:e.type,props:e.props})):null,W=(0,l.createContext)(null);function j({children:e,selectedStyleDef:t,selectedClassesProp:n}){const a={breakpoint:(0,u.useActiveBreakpoint)(),state:null};return l.createElement(W.Provider,{value:{selectedStyleDef:t,selectedMeta:a,selectedClassesProp:n}},e)}var F=e=>{const t=S(e);return t?.model.get("styles")||null},U=e=>{const{element:t}=f(),{selectedStyleDef:n,selectedMeta:a,selectedClassesProp:r}=function(){const e=(0,l.useContext)(W);if(!e)throw new Error("UseStyleContext must be used within a StyleContextProvider");return e}(),c=(({elementID:e,styleDefID:t,meta:n,propName:l})=>(0,o.__privateUseListenTo)((0,o.commandEndEvent)("document/atomic-widgets/styles"),(()=>{if(!t)return null;const a=F(e)?.[t];if(!a)return null;const r=function(e,t){return e.variants.find((e=>e.meta.breakpoint===t.breakpoint&&e.meta.state===t.state))}(a,n);return r?.props[l]??null}),[e,t,l,n]))({elementID:t.id,styleDefID:n?.id,meta:a,propName:e});return[c,l=>{(({elementID:e,styleDefID:t,meta:n,props:l,bind:a})=>{const r=S(e);(0,o.__privateRunCommand)("document/atomic-widgets/styles",{container:r,styleDefID:t,bind:a,meta:n,props:l})})({elementID:t.id,styleDefID:n?.id,props:{[e]:l},meta:a,bind:r})}]},R=({bind:e,children:t})=>{const[n,a]=U(e);return l.createElement(g.Provider,{value:{bind:e,value:n,setValue:a}},t)};R.Label=w;var H=()=>l.createElement(T,{title:(0,r.__)("Size","elementor")},l.createElement(c.Stack,{gap:1.5},l.createElement(c.Stack,{direction:"row",gap:2},l.createElement(G,{bind:"width",label:(0,r.__)("Width","elementor")}),l.createElement(G,{bind:"height",label:(0,r.__)("Height","elementor")})),l.createElement(c.Stack,{gap:1.5,sx:{pt:1.5}},l.createElement(c.Stack,{direction:"row",gap:2},l.createElement(G,{bind:"minWidth",label:(0,r.__)("Min. Width","elementor")}),l.createElement(G,{bind:"minHeight",label:(0,r.__)("Min. Height","elementor")})),l.createElement(c.Stack,{direction:"row",gap:2},l.createElement(G,{bind:"maxWidth",label:(0,r.__)("Max. Width","elementor")}),l.createElement(G,{bind:"maxHeight",label:(0,r.__)("Max. Height","elementor")}))))),G=({label:e,bind:t})=>l.createElement(R,{bind:t},l.createElement(x,{direction:"column"},l.createElement(R.Label,null,e),l.createElement(M,{type:"size"}))),J="tiny",X=()=>{const[e,t]=U("fontStyle"),[n,a]=U("textDecoration"),o=[e,...(n||"").split(" ")];return l.createElement(x,null,l.createElement(w,null,(0,r.__)("Style","elementor")),l.createElement(c.ToggleButtonGroup,{value:o},l.createElement(Z,{value:"italic",onChange:n=>t(e===n?null:n),"aria-label":"italic",sx:{marginLeft:"auto"}},l.createElement(m.ItalicIcon,{fontSize:J})),l.createElement(Y,{value:"line-through",currentValues:n||"",updateValues:a,"aria-label":"line-through"},l.createElement(m.StrikethroughIcon,{fontSize:J})),l.createElement(Y,{value:"underline",currentValues:n||"",updateValues:a,"aria-label":"underline"},l.createElement(m.UnderlineIcon,{fontSize:J}))))},Y=({children:e,value:t,currentValues:n,updateValues:a,"aria-label":r})=>{const o=n.split(" ").filter(Boolean),c=o.includes(t);return l.createElement(Z,{value:t,onChange:e=>{a(c?o.filter((t=>t!==e)).join(" ")||null:[...o,e].join(" "))},selected:c,"aria-label":r},e)},Z=({onChange:e,...t})=>l.createElement(c.ToggleButton,{...t,onChange:(t,n)=>{e(n)},size:J}),q=()=>l.createElement(R,{bind:"font-size"},l.createElement(x,null,l.createElement(R.Label,null,(0,r.__)("Font Size","elementor")),l.createElement(V,null))),K=[{label:(0,r.__)("Light - 400","elementor"),value:400},{label:(0,r.__)("Regular - 500","elementor"),value:500},{label:(0,r.__)("Semi Bold - 600","elementor"),value:600},{label:(0,r.__)("Bold - 700","elementor"),value:700},{label:(0,r.__)("Black - 900","elementor"),value:900}],Q=()=>l.createElement(R,{bind:"fontWeight"},l.createElement(x,null,l.createElement(R.Label,null,(0,r.__)("Font Weight","elementor")),l.createElement(D,{options:K}))),ee=()=>{const{value:e,setValue:t}=v(),n=te((e=>{t(e)}));return l.createElement(c.UnstableColorPicker,{value:e,onChange:n})},te=(e,t=300)=>{let n;return(...l)=>{clearTimeout(n),n=setTimeout((()=>e(...l)),t)}},ne=()=>l.createElement(R,{bind:"color"},l.createElement(x,null,l.createElement(R.Label,null,(0,r.__)("Text Color","elementor")),l.createElement(ee,null))),le=()=>l.createElement(R,{bind:"letter-spacing"},l.createElement(x,null,l.createElement(R.Label,null,(0,r.__)("Letter Spacing","elementor")),l.createElement(V,null))),ae=()=>l.createElement(R,{bind:"word-spacing"},l.createElement(x,null,l.createElement(R.Label,null,(0,r.__)("Word Spacing","elementor")),l.createElement(V,null))),re=({children:e,defaultOpen:t=!1})=>{const[n,a]=(0,l.useState)(t);return l.createElement(c.Stack,{sx:{py:.5}},l.createElement(c.Button,{fullWidth:!0,size:"small",color:"secondary",variant:"outlined",onClick:()=>{a((e=>!e))},endIcon:l.createElement(oe,{open:n})},n?(0,r.__)("Show less","elementor"):(0,r.__)("Show more","elementor")),l.createElement(c.Collapse,{in:n,timeout:"auto"},e))},oe=(0,c.styled)(m.ChevronDownIcon,{shouldForwardProp:e=>"open"!==e})((({theme:e,open:t})=>({transform:t?"rotate(180deg)":"rotate(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.standard})}))),ce=(0,c.styled)(c.ToggleButtonGroup)` ${({justify:e})=>`justify-content: ${e};`} `,ie=({justify:e="end",size:t="tiny",value:n,onChange:a,items:r,exclusive:o=!1})=>l.createElement(ce,{justify:e,value:n,onChange:(e,t)=>{a(t)},exclusive:o},r.map((({label:e,value:n,icon:a})=>l.createElement(c.ToggleButton,{key:n,value:n,"aria-label":e,size:t},l.createElement(a,{fontSize:t}))))),me=({options:e})=>{const{value:t,setValue:n}=v();return l.createElement(ie,{items:e,value:t||null,onChange:e=>{n(e||void 0)},exclusive:!0})},se=[{value:"capitalize",label:(0,r.__)("Capitalize","elementor"),icon:m.LetterCaseIcon},{value:"uppercase",label:(0,r.__)("Uppercase","elementor"),icon:m.LetterCaseUpperIcon},{value:"lowercase",label:(0,r.__)("Lowercase","elementor"),icon:m.LetterCaseLowerIcon}],ue=()=>l.createElement(x,null,l.createElement(R.Label,null,(0,r.__)("Transform","elementor")),l.createElement(R,{bind:"text-transform"},l.createElement(me,{options:se}))),de=[{value:"left",label:(0,r.__)("Left","elementor"),icon:m.AlignLeftIcon},{value:"center",label:(0,r.__)("Center","elementor"),icon:m.AlignCenterIcon},{value:"right",label:(0,r.__)("Right","elementor"),icon:m.AlignRightIcon},{value:"justify",label:(0,r.__)("Justify","elementor"),icon:m.AlignJustifiedIcon}],pe=()=>l.createElement(x,null,l.createElement(R.Label,null,(0,r.__)("Alignment","elementor")),l.createElement(R,{bind:"text-align"},l.createElement(me,{options:de}))),Ee=()=>l.createElement(T,{title:(0,r.__)("Typography","elementor")},l.createElement(c.Stack,{gap:1.5},l.createElement(Q,null),l.createElement(q,null),l.createElement(c.Divider,null),l.createElement(ne,null),l.createElement(re,null,l.createElement(c.Stack,{gap:1.5,sx:{pt:1.5}},l.createElement(le,null),l.createElement(ae,null),l.createElement(c.Divider,null),l.createElement(pe,null),l.createElement(X,null),l.createElement(ue,null))))),ge=e=>void 0===e||""===e||Number.isNaN(Number(e)),ve=({placeholder:e})=>{const{value:t,setValue:n}=v();return l.createElement(c.TextField,{size:"tiny",type:"number",value:ge(t)?"":t,onChange:e=>{const t=e.target.value;n(ge(t)?void 0:Number(t))},placeholder:e})},be=()=>l.createElement(R,{bind:"zIndex"},l.createElement(x,null,l.createElement(R.Label,null,(0,r.__)("Z-Index","elementor")),l.createElement(ve,null))),he=()=>l.createElement(T,{title:(0,r.__)("Position","elementor")},l.createElement(c.Stack,{gap:1.5},l.createElement(be,null))),ye=({label:e})=>{const{value:t,setValue:n}=v(),{top:a,right:o,bottom:i,left:s,isLinked:u=!1}=t?.value||{},d=(e,t)=>{n({$$type:"linked-dimensions",value:{isLinked:u,top:u?t:a,right:u?t:o,bottom:u?t:i,left:u?t:s,[e]:t}})},p=u?m.LinkIcon:m.DetachIcon;return l.createElement(l.Fragment,null,l.createElement(c.Stack,{direction:"row",gap:2},l.createElement(w,null,e),l.createElement(c.ToggleButton,{"aria-label":(0,r.__)("Link Inputs","elementor"),size:"tiny",value:"check",selected:u,sx:{marginLeft:"auto"},onChange:()=>{n({$$type:"linked-dimensions",value:{isLinked:!u,top:a,right:u?o:a,bottom:u?i:a,left:u?s:a}})}},l.createElement(p,{fontSize:"tiny"}))),l.createElement(c.Stack,{direction:"row",gap:2},l.createElement(x,{direction:"column"},l.createElement(w,null,(0,r.__)("Top","elementor")),l.createElement(_e,{bind:"top",value:a,setValue:d,startIcon:l.createElement(m.SideTopIcon,{fontSize:"tiny"})})),l.createElement(x,{direction:"column"},l.createElement(w,null,(0,r.__)("Right","elementor")),l.createElement(_e,{bind:"right",value:o,setValue:d,startIcon:l.createElement(m.SideRightIcon,{fontSize:"tiny"})}))),l.createElement(c.Stack,{direction:"row",gap:2},l.createElement(x,{direction:"column"},l.createElement(w,null,(0,r.__)("Bottom","elementor")),l.createElement(_e,{bind:"bottom",value:i,setValue:d,startIcon:l.createElement(m.SideBottomIcon,{fontSize:"tiny"})})),l.createElement(x,{direction:"column"},l.createElement(w,null,(0,r.__)("Left","elementor")),l.createElement(_e,{bind:"left",value:s,setValue:d,startIcon:l.createElement(m.SideLeftIcon,{fontSize:"tiny"})}))))},_e=({bind:e,startIcon:t,value:n,setValue:a})=>l.createElement(g.Provider,{value:{bind:e,setValue:t=>a(e,t),value:n}},l.createElement(V,{startIcon:t})),fe=()=>l.createElement(T,{title:(0,r.__)("Spacing","elementor")},l.createElement(c.Stack,{gap:1.5},l.createElement(R,{bind:"padding"},l.createElement(ye,{label:(0,r.__)("Padding","elementor")})),l.createElement(c.Divider,null),l.createElement(R,{bind:"margin"},l.createElement(ye,{label:(0,r.__)("Margin","elementor")})))),Se=()=>{const e=function(){const{element:e}=f(),t=(n=e.id,(0,o.__privateUseListenTo)((0,o.commandEndEvent)("document/atomic-widgets/styles"),(()=>F(n)),[n]));var n;return Object.values(t||{})[0]??null}(),t=function(){const{elementType:e}=f(),t=Object.entries(e.propsSchema).find((([,{type:e}])=>"classes"===e.key));if(!t)throw new Error("Element does not have a classes prop");return t[0]}();return l.createElement(j,{selectedStyleDef:e,selectedClassesProp:t},l.createElement(c.Stack,null,l.createElement(H,null),l.createElement(he,null),l.createElement(Ee,null),l.createElement(fe,null)))},we=()=>{const{getTabProps:e,getTabPanelProps:t,getTabsProps:n}=(0,c.useTabs)("settings");return l.createElement(c.Stack,{direction:"column",sx:{width:"100%"}},l.createElement(c.Tabs,{variant:"fullWidth",indicatorColor:"secondary",textColor:"inherit",...n()},l.createElement(c.Tab,{label:(0,r.__)("General","elementor"),...e("settings")}),l.createElement(c.Tab,{label:(0,r.__)("Style","elementor"),...e("style")})),l.createElement(c.TabPanel,{...t("settings"),disablePadding:!0},l.createElement(N,null)),l.createElement(c.TabPanel,{...t("style"),disablePadding:!0},l.createElement(Se,null)))},{panel:Ie,usePanelActions:xe,usePanelStatus:Ce}=(0,a.__createPanel)({id:"editing-panel",component:()=>{const e=(0,o.__privateUseListenTo)([(0,o.commandEndEvent)("document/elements/select"),(0,o.commandEndEvent)("document/elements/deselect")],(()=>b())),[t]=e,n=(c=t?.type,(0,o.__privateUseListenTo)((0,o.commandEndEvent)("editor/documents/load"),(()=>{if(!c)return null;const e=h(),t=e?.[c];return t?.atomic_controls&&t?.atomic_props_schema?{key:c,controls:t.atomic_controls,propsSchema:t.atomic_props_schema,title:t.title}:null}),[c]));var c;if(1!==e.length||!n)return null;const i=(0,r.__)("Edit %s","elementor").replace("%s",n.title);return l.createElement(a.Panel,null,l.createElement(a.PanelHeader,null,l.createElement(a.PanelHeaderTitle,null,i)),l.createElement(a.PanelBody,null,l.createElement(_,{element:t,elementType:n},l.createElement(we,null))))}}),ke=()=>{const e=b(),t=h();return 1===e.length&&!!t?.[e[0].type]?.atomic_controls},Te=()=>{const{atomicDynamicTags:e}=(()=>{const e=window;return e.elementor?.config??{}})();return e?{tags:e.tags,groups:e.groups}:null},Pe=p.z.object({$$type:p.z.string(),value:p.z.any()}),ze=e=>"dynamic"===e.key,Le=e=>{return t=e,Pe.safeParse(t).success&&"dynamic"===e.$$type;var t},Ve=e=>{let t=[];const{elementType:n}=f(),a=n.propsSchema?.[e];if(a){const e=a.additional_types.find(ze);t=e?.settings.categories||[]}return(0,l.useMemo)((()=>De(t)),[t.join()])},De=e=>{const t=Te();if(!e.length||!t?.tags)return[];const n=new Set(e);return Object.values(t.tags).filter((e=>e.categories.some((e=>n.has(e)))))},$e=(e,t)=>{const n=Ve(e);return(0,l.useMemo)((()=>n.find((e=>e.name===t))??null),[n,t])},Be=({bind:e,children:t})=>{const{value:n,setValue:a,bind:r}=v(),{name:o="",settings:c}=n?.value??{},i=$e(r,o);if(!i)throw new Error(`Dynamic tag ${o} not found`);const m=i.props_schema[e]?.type.default,s=c?.[e]??m;return l.createElement(g.Provider,{value:{setValue:t=>{a({$$type:"dynamic",value:{name:o,settings:{...c,[e]:t}}})},value:s,bind:e}},t)},Ae="elementor/dynamic/non-dynamic-values-history",Me=e=>{const t=Ne(),{element:n}=f(),l=`${n.id}-${e}`;return[t[l]??null,e=>{Oe({...t,[l]:e})}]},Ne=()=>JSON.parse(sessionStorage.getItem(Ae)||"{}"),Oe=e=>{sessionStorage.setItem(Ae,JSON.stringify(e))},We="tiny",je=({onSelect:e})=>{const[t,n]=(0,l.useState)(""),{groups:a}=Te()||{},{bind:o,value:i,setValue:s}=v(),[,u]=Me(o),d=Le(i),p=Fe(o,t);return l.createElement(c.Stack,null,l.createElement(c.Box,{px:1.5,pb:1},l.createElement(c.TextField,{fullWidth:!0,size:We,value:t,onChange:e=>{n(e.target.value)},placeholder:(0,r.__)("Search dynamic tag","elementor"),InputProps:{startAdornment:l.createElement(c.InputAdornment,{position:"start"},l.createElement(m.SearchIcon,{fontSize:We}))}})),l.createElement(c.Divider,null),l.createElement(c.Box,{sx:{overflowY:"auto",height:260,width:220}},p.length>0?l.createElement(c.MenuList,{role:"listbox",tabIndex:0},p.map((([t,n],r)=>l.createElement(l.Fragment,{key:r},l.createElement(c.ListSubheader,{sx:{typography:"caption",color:"text.tertiary"}},a?.[t]?.title||t),n.map((({value:t,label:n})=>{const a=d&&t===i?.value?.name;return l.createElement(c.MenuItem,{key:t,selected:a,autoFocus:a,sx:{typography:"caption"},onClick:()=>(t=>{d||u(i),s({$$type:"dynamic",value:{name:t}}),e?.()})(t)},n)})))))):l.createElement(c.Stack,{alignItems:"center",p:2.5,gap:1.5},l.createElement(m.PhotoIcon,{fontSize:"large"}),l.createElement(c.Typography,{align:"center",variant:"caption",color:"text.secondary"},(0,r.__)("Sorry, nothing matched","elementor"),l.createElement("br",null),"“",t,"”."),l.createElement(c.Typography,{align:"center",variant:"caption",color:"text.secondary"},l.createElement(c.Link,{color:"secondary",variant:"caption",component:"button",onClick:()=>n("")},(0,r.__)("Clear the filters","elementor"))," ",(0,r.__)("and try again.","elementor")))))},Fe=(e,t)=>[...Ve(e).reduce(((e,{name:n,label:l,group:a})=>l.toLowerCase().includes(t.trim().toLowerCase())?(e.has(a)||e.set(a,[]),e.get(a)?.push({label:l,value:n}),e):e),new Map)],Ue="tiny",Re=({dynamicTag:e})=>{const t=(0,l.useId)(),n=(0,c.usePopupState)({variant:"popover",popupId:t});return e.atomic_controls.length?l.createElement(l.Fragment,null,l.createElement(c.IconButton,{size:Ue,...(0,c.bindTrigger)(n),"aria-label":(0,r.__)("Settings","elementor")},l.createElement(m.SettingsIcon,{fontSize:Ue})),l.createElement(c.Popover,{disableScrollLock:!0,anchorOrigin:{vertical:"bottom",horizontal:"center"},...(0,c.bindPopover)(n)},l.createElement(c.Paper,{component:c.Stack,sx:{minHeight:"300px",width:"220px"}},l.createElement(c.Stack,{direction:"row",alignItems:"center",px:1.5,pt:2,pb:1},l.createElement(m.DatabaseIcon,{fontSize:Ue,sx:{mr:.5}}),l.createElement(c.Typography,{variant:"subtitle2"},e.label),l.createElement(c.IconButton,{sx:{ml:"auto"},size:Ue,onClick:n.close},l.createElement(m.XIcon,{fontSize:Ue}))),l.createElement(He,{controls:e.atomic_controls})))):null},He=({controls:e})=>{const t=e.filter((({type:e})=>"section"===e)),{getTabsProps:n,getTabProps:a,getTabPanelProps:r}=(0,c.useTabs)(0);return t.length?l.createElement(l.Fragment,null,l.createElement(c.Tabs,{indicatorColor:"secondary",textColor:"secondary",...n()},t.map((({value:e},t)=>l.createElement(c.Tab,{key:t,label:e.label,sx:{px:1,py:.5},...a(t)})))),l.createElement(c.Divider,null),t.map((({value:e},t)=>l.createElement(c.TabPanel,{key:t,sx:{flexGrow:1},...r(t)},l.createElement(c.Stack,{gap:1,px:2},e.items.map((e=>"control"===e.type?l.createElement(Ge,{key:e.value.bind,control:e.value}):null))))))):null},Ge=({control:e})=>B(e.type)?l.createElement(Be,{bind:e.bind},e.label?l.createElement(w,null,e.label):null,l.createElement(M,{type:e.type,props:e.props})):null;(0,a.__registerPanel)(Ie),(0,o.__privateBlockDataCommand)({command:"panel/editor/open",condition:ke}),(0,d.injectIntoLogic)({id:"editing-panel-hooks",component:()=>((()=>{const{open:e}=xe();(0,l.useEffect)((()=>(0,o.__privateListenTo)((0,o.commandStartEvent)("panel/editor/open"),(()=>{ke()&&e()}))),[])})(),null)}),E({component:()=>{const{bind:e,value:t,setValue:n}=v(),[a]=Me(e),{name:o=""}=t?.value||{},i=(0,l.useId)(),s=(0,c.usePopupState)({variant:"popover",popupId:i}),u=$e(e,o);if(!u)throw new Error(`Dynamic tag ${o} not found`);return l.createElement(c.Box,{sx:{width:"100%"}},l.createElement(c.UnstableTag,{fullWidth:!0,showActionsOnHover:!0,label:u.label,startIcon:l.createElement(m.DatabaseIcon,{fontSize:Ue}),...(0,c.bindTrigger)(s),actions:l.createElement(l.Fragment,null,l.createElement(Re,{dynamicTag:u}),l.createElement(c.IconButton,{size:Ue,onClick:()=>{n(a??null)},"aria-label":(0,r.__)("Remove dynamic value","elementor")},l.createElement(m.XIcon,{fontSize:Ue})))}),l.createElement(c.Popover,{disablePortal:!0,disableScrollLock:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},...(0,c.bindPopover)(s)},l.createElement(c.Stack,null,l.createElement(c.Stack,{direction:"row",alignItems:"center",pl:1.5,pr:.5,py:1.5},l.createElement(m.DatabaseIcon,{fontSize:Ue,sx:{mr:.5}}),l.createElement(c.Typography,{variant:"subtitle2"},(0,r.__)("Dynamic Tags","elementor")),l.createElement(c.IconButton,{size:Ue,sx:{ml:"auto"},onClick:s.close},l.createElement(m.XIcon,{fontSize:Ue}))),l.createElement(je,{onSelect:s.close}))))},condition:({value:e})=>Le(e)}),(window.elementorV2=window.elementorV2||{}).editorEditingPanel=t}();