/
home
/
assocoweys
/
sompe
/
administrator
/
components
/
com_sppagebuilder
/
assets
/
editor
/
dist
/
js
/
Upload File
HOME
/*! For license information please see 4.41283b9e8510c2315de0.min.js.LICENSE.txt */ "use strict";(self.webpackChunkreact_typescript_webpack_backend_editor=self.webpackChunkreact_typescript_webpack_backend_editor||[]).push([[4],{1004:(t,e,n)=>{n.r(e),n.d(e,{default:()=>zo});var o=n(7264),r=n(3106),i=n(824),a=n(4185),l=n(9752),d=n(917),c=n(1234),s=n(7230),u=n(1518),p=n(2967),f=n(7602);function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}var b=function(t){return"object"===v(t)&&null!==t&&!("id"in t)&&"name"in t},y=n(1921),m=n(3935),h=n(5944),g={sideEffects:(0,l.Ai)({styles:{active:{opacity:"0.5"}}})},I=[r.t.Section,r.t.NestedRow];const x=function(t){var e=t.content,n=(0,c.$)(),i=(0,s.x)((function(t){return t.addonStructure}));return e?(0,m.createPortal)((0,h.tZ)(l.y9,{dropAnimation:g,children:function(){if(b(e))return(0,h.BX)("div",{css:E.addonItem,children:[(0,h.tZ)("span",{dangerouslySetInnerHTML:{__html:e.icon}}),(0,h.tZ)("span",{children:e.title})]});if((0,u.$F)(e)&&e.type===r.Dw.SavedAddonElement)return(0,h.BX)("div",{css:E.savedAddon,children:[(0,h.tZ)("span",{"data-drag-icon":!0,children:(0,h.tZ)(o.Z,{name:"dragger",height:24,width:24})}),(0,h.tZ)("span",{"data-addon-icon":!0,dangerouslySetInnerHTML:{__html:(t=e,a=(0,f.Rx)(t.code).name,i[a].icon)}}),(0,h.tZ)("span",{"data-addon-title":!0,children:e.title})]});var t,a;if(e.type===r.Dw.SavedSectionElement)return(0,h.BX)("div",{css:E.savedAddon,children:[(0,h.tZ)("span",{"data-drag-icon":!0,children:(0,h.tZ)(o.Z,{name:"dragger",height:24,width:24})}),(0,h.tZ)("span",{"data-addon-icon":!0,children:(0,h.tZ)(o.Z,{name:"blocksDuo"})}),(0,h.tZ)("span",{"data-addon-title":!0,children:e.title})]});if((0,p.L)(e)&&e.type===r.Dw.BlockElement)return(0,h.BX)("div",{css:E.sectionThumb,children:[(0,h.tZ)("div",{css:E.thumbImage,children:(0,h.tZ)("img",{src:e.thumb,alt:e.title,draggable:!1})}),(0,h.tZ)("div",{css:E.thumbFooter,children:e.title})]});if((0,f.r3)(I,e.type)){var l=e.type===r.t.NestedRow?"COM_SPPAGEBUILDER_EDITOR_OVERLAY_NESTED_ROW_TITLE":"COM_SPPAGEBUILDER_EDITOR_OVERLAY_SECTION_TITLE";return(0,h.BX)("div",{css:E.placedAddon(e.type),children:[(0,h.BX)("div",{css:E.iconAndTitle(e.type),children:[(0,h.tZ)(o.Z,{name:"dragger"}),(0,h.tZ)("span",{children:n(l)})]}),(0,h.tZ)("span",{css:E.settingsButton,children:(0,h.tZ)(o.Z,{name:"sliders"})})]})}return e.type===r.t.Column?(0,h.BX)("div",{css:E.placedAddon(e.type),children:[(0,h.BX)("div",{css:E.iconAndTitle(e.type),children:[(0,h.tZ)(o.Z,{name:"columnsAlt"}),(0,h.tZ)("span",{children:n("COM_SPPAGEBUILDER_EDITOR_OVERLAY_COLUMN_TITLE")})]}),(0,h.tZ)("button",{type:"button",css:E.dragHandler(e.type),"data-addon-drag-handler":!0,children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})})]}):(0,h.BX)("div",{css:E.placedAddon(e.type),children:[(0,h.BX)("div",{css:E.iconAndTitle(e.type),children:[(0,h.tZ)("span",{dangerouslySetInnerHTML:{__html:e.icon}}),(0,h.tZ)("span",{children:e.title})]}),(0,h.tZ)("button",{type:"button",css:E.dragHandler(e.type),"data-addon-drag-handler":!0,children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})})]})}()}),document.body):null};var S={name:"ebhkkd-placedAddon",styles:"border-top-left-radius:0;label:placedAddon;"},E={addonItem:(0,d.iv)("display:flex;align-items:center;background-color:",i.qo.base.white,";border-radius:",i.E0[5],";box-shadow:",i.AF.dropzone,";padding:",i.W0[8],";gap:",i.W0[8],";cursor:grab;&>span:first-of-type{svg,img{width:18px;height:18px;}}&>span:last-of-type{",a.c.caption(),";",y.iZ.textEllipsis,";};label:addonItem;"),savedAddon:(0,d.iv)("display:flex;align-items:center;background-color:",i.qo.base.white,";border-radius:",i.E0[5],";box-shadow:",i.AF.addon,";padding:",i.W0[6]," ",i.W0[6]," ",i.W0[6]," ",i.W0[24],";gap:",i.W0[8],";cursor:grab;position:relative;svg{color:",i.qo.icon.default,";}[data-addon-icon]{line-height:1;>svg{height:16px;width:16px;}}[data-drag-icon]{position:absolute;left:",i.W0[2],";top:0;height:100%;display:flex;align-items:center;}[data-addon-title]{",a.c.body(),";",y.iZ.textEllipsis,";color:",i.qo.text.default,";};label:savedAddon;"),placedAddon:function(t){return(0,d.iv)("width:250px;height:40px;background-color:",i.qo.base.white,";border:1px solid ",i.qo.stroke.success,";border-radius:",i.E0[2],";position:relative;padding:",i.W0[16],";box-shadow:",i.AF.dropzone,";display:flex;justify-content:space-between;align-items:center;",!(0,f.r3)(I,t)&&S," ",(0,f.r3)(I,t)&&(0,d.iv)("width:100%;border-color:",i.qo.stroke.primary,";border-radius:",i.E0[6],";height:80px;;label:placedAddon;")," ",t===r.t.Column&&(0,d.iv)("border-color:",i.qo.stroke.primary,";height:42px;;label:placedAddon;")," ",t===r.t.Div&&(0,d.iv)("border-color:",i.qo.alternate.div,";;label:placedAddon;"),";;label:placedAddon;")},dragHandler:function(t){return(0,d.iv)(y.iZ.resetButton,";",y.iZ.flexCenter(),";border-top-left-radius:",i.E0[4],";border-bottom-left-radius:",i.E0[4],";background-color:",i.qo.base.success,";color:",i.qo.base.white,";width:12px;height:18px;position:absolute;top:-1px;left:0;transform:translateX(-100%);cursor:grab!important;",t===r.t.Column&&(0,d.iv)("background-color:",i.qo.stroke.primary,";;label:dragHandler;")," ",t===r.t.Div&&(0,d.iv)("background-color:",i.qo.alternate.div,";;label:dragHandler;"),";;label:dragHandler;")},iconAndTitle:function(t){return(0,d.iv)("display:flex;gap:",i.W0[8],";width:100%;height:100%;align-items:center;cursor:grab;svg{width:18px;height:18px;color:",i.qo.stroke.success,";",(0,f.r3)(I,t)&&(0,d.iv)(":first-of-type{color:",i.qo.icon.default,";height:32px;width:32px;};label:iconAndTitle;")," ",((0,f.r3)(I,t)||t===r.t.Column)&&(0,d.iv)("color:",i.qo.stroke.primary,";;label:iconAndTitle;")," ",t===r.t.Div&&(0,d.iv)("color:",i.qo.alternate.div,";;label:iconAndTitle;"),";}&>span{",a.c.caption(),";",(0,f.r3)(I,t)&&(0,d.iv)(a.c.heading5(),";;label:iconAndTitle;"),";};label:iconAndTitle;")},settingsButton:(0,d.iv)(y.iZ.centeredFlex,";border:1px solid ",i.qo.stroke.neutral,";border-radius:",i.E0[6],";width:32px;height:32px;svg{color:",i.qo.icon.default,";transition:color 0.3s ease-in-out;};label:settingsButton;"),sectionThumb:(0,d.iv)("background-color:",i.qo.background.white,";border-radius:",i.E0[4],";box-shadow:",i.AF.addonHover,";cursor:grab;;label:sectionThumb;"),thumbImage:(0,d.iv)("height:80px;width:100%;background-color:",i.qo.background.neutral,";img{width:100%;height:100%;object-fit:contain;};label:thumbImage;"),thumbFooter:(0,d.iv)(a.c.tiny(),";padding:",i.W0[2]," ",i.W0[8],";;label:thumbFooter;")},O=n(2811),w=n(2739),D=n(3896),A=n(2238),_=n(4285),C=function(t){var e=t.disable,n=void 0!==e&&e,o=t.isDragging,r=t.transition,i=t.transform;return n?null:{transform:_.ux.Transform.toString(i),transition:r,opacity:o?.5:void 0}},P=function(t){return(0,f.Kn)(t)&&(0,f.nr)(t,"id")&&(0,f.nr)(t,"settings")},T=n(7294);function L(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?L(Object(n),!0).forEach((function(e){B(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function B(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==k(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==k(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===k(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Z(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function k(t){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(t)}var W=function(t){var e,n,o,i,a,l,d,c,s,u,p=t.active,v=t.over,y=null==p?void 0:p.data.current,m=null==v?void 0:v.data.current,h=null;if([r.t.DCCollectionItemAddon,r.t.DCCollectionAddonEmptyChild].includes(null==m?void 0:m.type))return!(r.LP[r.t.DCCollectionItemAddon].rejected.includes(null==y||null===(d=y.content)||void 0===d?void 0:d.name)||r.LP[r.t.DCCollectionAddonEmptyChild].rejected.includes(null==y||null===(c=y.content)||void 0===c?void 0:c.name)||null!=y&&null!==(s=y.content)&&void 0!==s&&s.name.startsWith("easystore_"));if((null==m?void 0:m.type)===r.t.TableItem&&b(null==y?void 0:y.content)){var g,I=(null!==(g=null==y?void 0:y.content)&&void 0!==g?g:{}).name;if((0,f.r3)(["accordion","tab","table_advanced"],I))return!1}if(b(null==y?void 0:y.content)&&(u=null!==(e=null==y||null===(n=y.content)||void 0===n?void 0:n.name)&&void 0!==e?e:"",(0,f.$K)(u)&&u.startsWith(r.HZ.prefix))&&(null==m?void 0:m.type)===r.t.CollectionItemAddon){var x,S,E,O,w=D.o.getState().page,_=m.sectionIndex,C=m.columnIndex,T=m.addonIndex,L=null==w||null===(x=w[_])||void 0===x||null===(S=x.columns)||void 0===S||null===(E=S[C])||void 0===E||null===(O=E.addons)||void 0===O?void 0:O[T];return!!L&&L.name!==r.G2}if(b(null==y?void 0:y.content)&&function(t){return(0,f.$K)(t)&&t.startsWith(r.du.prefix)}(null!==(o=null==y||null===(i=y.content)||void 0===i?void 0:i.name)&&void 0!==o?o:"")&&(null==m?void 0:m.type)===r.t.CollectionItemAddon){var j,B,R,Z,W=D.o.getState().page,U=m.sectionIndex,q=m.columnIndex,N=m.addonIndex,$=null==W||null===(j=W[U])||void 0===j||null===(B=j.columns)||void 0===B||null===(R=B[q])||void 0===R||null===(Z=R.addons)||void 0===Z?void 0:Z[N];return!!$&&$.name!==r.oA.productList}if((0,f.$K)(m)){var M=m.type;(0,f.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],M)&&P(m.content)&&m.content.parent&&(M=r.t.EmptyDivChild),h=(0,f.r3)((0,f.zt)(r.Dw),null==y?void 0:y.type)?r.LP[M]:r.IR[M]}if(!(0,f.$K)(h))return!1;if(b(null==y?void 0:y.content)&&(0,A.a4)(null!==(a=null==y?void 0:y.content.name)&&void 0!==a?a:"")&&(null==m?void 0:m.type)===r.t.CollectionItemAddon)return!1;if(b(null==y?void 0:y.content)&&(0,A.K0)(null!==(l=null==y?void 0:y.content.name)&&void 0!==l?l:"")&&(null==m?void 0:m.type)!==r.t.CollectionItemAddon)return!1;var G=function(t){return"object"===k(t)&&null!==t&&"name"in t},K=h.accepted.length>0&&((0,f.r3)(h.accepted,null==y?void 0:y.type)||G(null==y?void 0:y.content)&&(0,f.r3)(h.accepted,null==y?void 0:y.content.name)),V=h.rejected.length>0&&!(0,f.r3)(h.rejected,null==y?void 0:y.type)&&(!G(null==y?void 0:y.content)||G(null==y?void 0:y.content)&&!(0,f.r3)(h.rejected,null==y?void 0:y.content.name));return K||V||r.Eb in h};const U=function(t){var e,n=t.id,o=t.data,r=t.disabled,i=void 0!==r&&r,a=t.isHidden,d=void 0!==a&&a,s=t.children,u=t.customStyle,p=(0,c.$)(),f=(0,l.Zj)({id:n,data:o,disabled:i}),v=f.setNodeRef,b=f.isOver,y=f.active,m=f.over,g=W({active:y,over:m});return(0,h.tZ)("div",{css:[u,q.container(b,d,g),";label:Droppable;"],ref:v,children:!g&&b?(0,h.tZ)("div",{css:q.notAllowed(null==m||null===(e=m.data.current)||void 0===e?void 0:e.type),children:(0,h.tZ)("span",{children:p("COM_SPPAGEBUILDER_EDITOR_ADDON_NOT_ALLOWED")})}):s})};var q={container:function(t,e,n){return(0,d.iv)(t&&!e&&n&&(0,d.iv)("background-color:",i.qo.base.surface,";;label:container;")," ",t&&!e&&!n&&(0,d.iv)("background-color:",i.qo.background.error,";;label:container;"),";;label:container;")},notAllowed:function(t){var e=t===r.t.TableItem?"40px":"100px";return(0,d.iv)("height:",e,";",y.iZ.flexCenter(),";span{",a.c.caption("medium")," padding:",i.W0[4]," ",i.W0[8],";background-color:",i.qo.base.error,";border-radius:",i.E0[2],";color:",i.qo.base.white,";};label:notAllowed;")}},N=n(3871),$=n(1731),M=n(7855),G=n(1593),K=n(1709),V=n(802),F=n(1954),H=n(1073),X=n(7536),Y=n(5350);function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function J(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Q(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?J(Object(n),!0).forEach((function(e){tt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function tt(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==z(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==z(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===z(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var et=[{id:0,size:"12",icon:"layoutDesign1"},{id:1,size:"6+6",icon:"layoutDesign2"},{id:2,size:"4+4+4",icon:"layoutDesign3"},{id:3,size:"3+3+3+3",icon:"layoutDesign4"},{id:4,size:"4+8",icon:"layoutDesign5"},{id:5,size:"3+9",icon:"layoutDesign6"},{id:6,size:"3+6+3",icon:"layoutDesign7"},{id:7,size:"2+6+4",icon:"layoutDesign8"},{id:8,size:"2+10",icon:"layoutDesign9"},{id:10,size:"2+3+7",icon:"layoutDesign10"}];const nt=function(t){var e=t.isOpen,n=t.defaultLayout,r=t.nestedRowData,i=t.handleClose,a=t.position,l=t.popoverRef,d=t.index,s=(0,c.$)(),u=(0,V.O)(),p=u.control,v=u.setValue,b=u.getValues,y=u.watch;(0,T.useEffect)((function(){(0,f.$K)(n)&&v("layout",n.replaceAll(",","+"))}),[n,v]);var m=(0,D.o)((function(t){return t.addNewSection})),g=y("layout"),I=(0,D.o)((function(t){return t.addNestedRow})),x=(0,D.o)((function(t){return t.updateSectionLayout})),S=(0,H.j)((function(t){return t.setActiveAction})),E=function(){v("layout",""),i()},O=function(t){(0,f.$K)(n)?x({index:d,layout:t}):(0,f.$K)(r)?I(Q(Q({},r),{},{layout:t,isTop:!1})):m({layout:t,index:d+1}),E()};return(0,h.tZ)(F.h,{isOpen:e,onClickOutside:E,children:(0,h.tZ)("div",{css:[ot.popoverWrapper,{left:a.left,top:a.top},";label:SectionPopover;"],ref:l,children:(0,h.BX)("div",{css:ot.wrapper,children:[(0,h.BX)("div",{css:ot.importLayout,children:[(0,h.BX)("div",{css:ot.importLayoutIcons,children:[(0,h.tZ)(o.Z,{name:"layoutsDuo"}),(0,h.tZ)(o.Z,{name:"blocksDuo"}),(0,h.tZ)(o.Z,{name:"cubeDuo"})]}),(0,h.tZ)("p",{css:ot.importLayoutText,children:s("COM_SPPAGEBUILDER_EDITOR_IMPORT_LAYOUT_DESCRIPTION")}),(0,h.tZ)(N.Z,{variant:"secondary",buttonCss:ot.importLayoutButton,onClick:function(){i(),S("section-library")},children:"Explore"})]}),(0,h.BX)("div",{css:ot.selectLayout,children:[(0,h.tZ)("button",{css:ot.closeButton,onClick:E,children:(0,h.tZ)(o.Z,{name:"cross",width:20,height:20})}),(0,h.tZ)("div",{css:ot.layoutOptions,children:et.map((function(t){return(0,h.BX)("button",{type:"button",css:ot.layoutButton,onClick:function(){O(t.size)},children:[(0,h.tZ)(o.Z,{name:t.icon,width:50,height:20}),(0,h.tZ)("div",{children:t.size})]},t.id)}))}),(0,h.BX)("div",{css:ot.generateLayout,children:[(0,h.tZ)("p",{css:ot.customRows,children:s("COM_SPPAGEBUILDER_EDITOR_CREATE_CUSTOM_LAYOUT")}),(0,h.BX)("div",{css:ot.generateForm,children:[(0,h.tZ)(X.Qr,{control:p,name:"layout",render:function(t){return(0,h.tZ)(Y.Z,Q(Q({},t),{},{placeholder:"e.g. 8+4"}))}}),(0,h.tZ)(N.Z,{variant:"primary",disabled:!g,onClick:function(){var t=b("layout");O(t)},children:(0,f.$K)(n)?s("COM_SPPAGEBUILDER_EDITOR_UPDATE"):s("COM_SPPAGEBUILDER_EDITOR_GENERATE")})]})]})]})]})})})};var ot={popoverWrapper:{name:"127z30k-popoverWrapper",styles:"position:absolute;width:100%;max-width:622px;label:popoverWrapper;"},wrapper:(0,d.iv)("z-index:",i.W5.dropdown,";background-color:",i.qo.base.white,";box-shadow:",i.AF.popover,";border-radius:",i.E0[6],";display:grid;grid-template-columns:196px auto;;label:wrapper;"),importLayout:(0,d.iv)("border-right:1px solid ",i.qo.stroke.neutral,";display:flex;flex-direction:column;justify-content:center;align-items:center;padding:",i.W0[24],";;label:importLayout;"),importLayoutIcons:(0,d.iv)("display:flex;gap:",i.W0[16],";color:",i.qo.icon.default,";;label:importLayoutIcons;"),importLayoutText:(0,d.iv)("color:",i.qo.text.neutral,";font-size:",i.JB[12],";line-height:",i.Nv[18],";text-align:center;margin-top:",i.W0[16],";margin-bottom:",i.W0[24],";;label:importLayoutText;"),importLayoutButton:(0,d.iv)("svg{color:",i.qo.icon.default,";}&:hover{svg{color:",i.qo.icon.primary,";}};label:importLayoutButton;"),selectLayout:{name:"fgypav-selectLayout",styles:"position:relative;label:selectLayout;"},closeButton:(0,d.iv)(y.iZ.resetButton,";position:absolute;top:",i.W0[8],";right:",i.W0[8],";padding:",i.W0[2],";background-color:",i.qo.background.neutral,";color:",i.qo.icon.default,";border-radius:",i.E0[2],";;label:closeButton;"),layoutOptions:(0,d.iv)("display:grid;grid-template-columns:repeat(5, 1fr);padding:",i.W0[40]," ",i.W0[48]," ",i.W0[32]," ",i.W0[32],";gap:",i.W0[24],";;label:layoutOptions;"),layoutButton:(0,d.iv)(y.iZ.resetButton,";",a.c.caption(),";color:",i.qo.text.neutral,";display:flex;flex-direction:column;align-items:center;gap:",i.W0[8],";transition:color 0.3s ease-out;svg{color:",i.qo.icon.neutral,";transition:color 0.3s ease-out;}&:hover{color:",i.qo.text.primary,";svg{color:",i.qo.text.primary,";}};label:layoutButton;"),generateLayout:(0,d.iv)("border-top:1px solid ",i.qo.stroke.neutral,";position:relative;;label:generateLayout;"),customRows:(0,d.iv)("position:absolute;width:60%;top:0;left:50%;transform:translateX(-50%) translateY(-50%);background-color:",i.qo.background.white,";color:",i.qo.text.neutral,";font-size:",i.JB[12],";line-height:",i.Nv[18],";text-align:center;;label:customRows;"),generateForm:(0,d.iv)("display:flex;gap:",i.W0[16],";padding:",i.W0[28]," ",i.W0[32]," ",i.W0[24],";>div{flex:1;};label:generateForm;")},rt=n(9194);function it(t){return it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},it(t)}function at(){at=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),l=new w(r||[]);return o(a,"_invoke",{value:x(t,n,l)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u={};function p(){}function f(){}function v(){}var b={};d(b,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(D([])));m&&m!==e&&n.call(m,i)&&(b=m);var h=v.prototype=p.prototype=Object.create(b);function g(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function I(t,e){function r(o,i,a,l){var d=s(t[o],t,i);if("throw"!==d.type){var c=d.arg,u=c.value;return u&&"object"==it(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,a,l)}),(function(t){r("throw",t,a,l)})):e.resolve(u).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,l)}))}l(d.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function x(t,e,n){var o="suspendedStart";return function(r,i){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===r)throw i;return{value:void 0,done:!0}}for(n.method=r,n.arg=i;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===u)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===o)throw o="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o="executing";var d=s(t,e,n);if("normal"===d.type){if(o=n.done?"completed":"suspendedYield",d.arg===u)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o="completed",n.method="throw",n.arg=d.arg)}}}function S(t,e){var n=e.method,o=t.iterator[n];if(void 0===o)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var r=s(o,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function D(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,r=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:A}}function A(){return{value:void 0,done:!0}}return f.prototype=v,o(h,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:f,configurable:!0}),f.displayName=d(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,d(t,l,"GeneratorFunction")),t.prototype=Object.create(h),t},t.awrap=function(t){return{__await:t}},g(I.prototype),d(I.prototype,a,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,o,r,i){void 0===i&&(i=Promise);var a=new I(c(e,n,o,r),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(h),d(h,l,"Generator"),d(h,i,(function(){return this})),d(h,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var o in e)n.push(o);return n.reverse(),function t(){for(;n.length;){var o=n.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},t.values=D,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(n,o){return a.type="throw",a.arg=t,e.next=n,o&&(e.method="next",e.arg=void 0),!!o}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),d=n.call(i,"finallyLoc");if(l&&d){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!d)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var o=n.completion;if("throw"===o.type){var r=o.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:D(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}function lt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function dt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lt(Object(n),!0).forEach((function(e){ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ct(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==it(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==it(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===it(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function st(t,e,n,o,r,i,a){try{var l=t[i](a),d=l.value}catch(t){return void n(t)}l.done?e(d):Promise.resolve(d).then(o,r)}function ut(t){return function(){var e=this,n=arguments;return new Promise((function(o,r){var i=t.apply(e,n);function a(t){st(i,o,r,a,l,"next",t)}function l(t){st(i,o,r,a,l,"throw",t)}a(void 0)}))}}function pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}const ft=function(t){var e,n,r=t.isPopup,i=(0,T.useRef)(null),l=(0,c.$)(),d=(0,K.d)().showModal,s=(e=(0,T.useState)(!1),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,n)||function(t,e){if(t){if("string"==typeof t)return pt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pt(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],p=s[1],v=(0,X.Gc)(),b=(0,X.Gc)(),y=(0,$.p)().showToast,m=(0,rt.HX)(),g=(0,F.l)({isOpen:u,isDropdown:!0,arrow:"middle"}),I=g.triggerRef,x=g.position,S=g.popoverRef;return(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{css:vt.wrapper,ref:I,children:[(0,h.tZ)("h4",{css:[a.c.heading4("medium"),";label:EmptyLayout;"],children:l(r?"COM_SPPAGEBUILDER_EDITOR_POPUP_START_CREATING":"COM_SPPAGEBUILDER_EDITOR_START_CREATING")}),(0,h.BX)("div",{css:vt.buttonWrapper,children:[(0,h.tZ)(N.Z,{variant:"secondary",icon:(0,h.tZ)(o.Z,{name:"layout"}),onClick:function(){d({component:r?G.Z:M.Z,props:{title:l("COM_SPPAGEBUILDER_EDITOR_LAYOUT_MODAL_LAYOUTS"),form:v},closeOnOutsideClick:!0})},children:l("COM_SPPAGEBUILDER_EDITOR_LAYOUT_BUNDLES")}),(0,h.tZ)(N.Z,{variant:"primary",icon:(0,h.tZ)(o.Z,{name:"plus"}),onClick:function(){return p(!0)},children:l("COM_SPPAGEBUILDER_EDITOR_ADD_NEW_SECTION")})]}),(0,h.BX)("p",{css:vt.importLayout,children:[l("COM_SPPAGEBUILDER_EDITOR_OR"),(0,h.tZ)("button",{type:"button",onClick:function(){var t;return null===(t=i.current)||void 0===t?void 0:t.click()},children:l("COM_SPPAGEBUILDER_EDITOR_IMPORT_LAYOUT")}),r?(0,h.tZ)("input",{ref:i,type:"file",hidden:!0,onChange:function(){var t=ut(at().mark((function t(e){var n,o,i;return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.target.files){t.next=11;break}return t.prev=1,t.next=4,m.mutateAsync(e.target.files[0]);case 4:n=t.sent,r?(i=JSON.parse(null!==(o=n.data.attribs)&&void 0!==o?o:""),(0,f.$K)(n.data)&&b.reset(dt(dt({},b.getValues()),{},{css:n.data.css,attribs:i}))):(0,f.$K)(n.data)&&v.reset(dt({},v.getValues())),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(1),(0,f.VZ)(t.t0)&&y({type:"danger",message:t.t0.message});case 11:e.target.value="";case 12:case"end":return t.stop()}}),t,null,[[1,8]])})));return function(e){return t.apply(this,arguments)}}()}):(0,h.tZ)("input",{ref:i,type:"file",hidden:!0,onChange:function(){var t=ut(at().mark((function t(e){var n,o,r,i,a,l,d,c,s,u,p,b,y,h,g,I,x,S,E,O;return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.target.files){t.next=8;break}return t.next=3,m.mutateAsync(e.target.files[0]);case 3:n=t.sent,o=JSON.parse(n.data.seo),r=o.meta_description,i=void 0===r?"":r,a=o.meta_keywords,l=void 0===a?"":a,d=o.og_type,c=void 0===d?"":d,s=o.robots,u=void 0===s?"":s,p=o.seo_spacer,b=void 0===p?"":p,y=o.og_title,h=void 0===y?"":y,g=o.og_description,I=void 0===g?"":g,x=o.og_image,S=void 0===x?"":x,E=o.author,O={attribs:{meta_description:i,meta_keywords:l,og_type:c,robots:u,seo_spacer:b,author:void 0===E?"":E},og_title:h,og_description:I,og_image:{src:S}},(0,f.$K)(n.data)&&v.reset(dt(dt({},v.getValues()),{},{css:n.data.css},O)),e.target.value="";case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})]})]}),(0,h.tZ)(nt,{isOpen:u,handleClose:function(){return p(!1)},position:x,popoverRef:S,index:0})]})};var vt={wrapper:(0,d.iv)("background-color:",i.qo.background.white,";text-align:center;padding:",i.W0[72]," 0;border-radius:",i.E0[6],";position:relative;;label:wrapper;"),buttonWrapper:(0,d.iv)("display:flex;justify-content:center;gap:",i.W0[16],";margin-top:",i.W0[40],";margin-bottom:",i.W0[32],";;label:buttonWrapper;"),importLayout:(0,d.iv)(a.c.body(),";color:",i.qo.text.neutral,";button{",y.iZ.resetButton,";color:",i.qo.action.primary.default,";padding:0;};label:importLayout;")},bt=n(8138),yt=n(2447),mt=n(2328),ht=n(7679);function gt(t){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(t)}function It(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function xt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?It(Object(n),!0).forEach((function(e){St(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):It(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function St(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==gt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==gt(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===gt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}const Ot=function(t){var e,n,i,a=t.isPopup,l=void 0!==a&&a,d=(0,c.$)(),s=(0,X.Gc)(),u=(n=(0,T.useState)(!1),i=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(n,i)||function(t,e){if(t){if("string"==typeof t)return Et(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Et(t,e):void 0}}(n,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=u[0],f=u[1],v=s.getValues("title"),b=(0,yt.Z)(bt.F.PageEditor).id,y=(0,ht.z1)(b,l?"popup":""),m=(0,mt.v)((function(t){return t.appConfig}));(0,T.useEffect)((function(){var t;(null===(t=y.data)||void 0===t?void 0:t.extension)===r.HZ.extension&&f(!0)}),[y.data]);var g=(0,T.useMemo)((function(){return y.data?y.data.url:""}),[y.data]);return(0,h.BX)("div",{css:_t.wrapper(p),children:[(0,h.BX)("div",{css:_t.fieldAndButton(p),children:[(0,h.tZ)("div",{css:_t.inputWrapper(p),children:(0,h.tZ)(X.Qr,{control:s.control,name:"title",render:function(t){return(0,h.tZ)(Y.Z,xt(xt({},t),{},{label:d("COM_SPPAGEBUILDER_EDITOR_PAGE_NAME"),placeholder:d("COM_SPPAGEBUILDER_EDITOR_PAGE_NAME")}))}})}),p&&(0,h.tZ)("div",{css:_t.pageName,children:v||d("COM_SPPAGEBUILDER_EDITOR_PAGE_NAME")}),!!m.enable_frontend_editing&&(0,h.BX)("a",{css:_t.frontendEditorButton(p),href:g,target:"_blank",rel:"noreferrer",children:[(0,h.tZ)(o.Z,{name:"parmaLink",width:16,height:16}),(0,h.tZ)("span",{children:d("COM_SPPAGEBUILDER_EDITOR_FRONTEND_EDITOR")})]})]}),r.HZ.extension!==(null===(e=y.data)||void 0===e?void 0:e.extension)&&(0,h.tZ)("button",{type:"button",css:_t.drawerHook(p),onClick:function(){return f((function(t){return!t}))},"data-drawer":!0,children:(0,h.tZ)(o.Z,{name:"angleUp"})})]})};var wt={name:"g85fjd-drawerHook",styles:"svg{transform:rotate(-180deg);};label:drawerHook;"},Dt={name:"1n6ug0d-fieldAndButton",styles:"align-items:center;label:fieldAndButton;"},At={name:"1dw40py-inputWrapper",styles:"overflow:hidden;opacity:0;width:0;height:0;label:inputWrapper;"},_t={wrapper:function(t){return(0,d.iv)("background-color:",i.qo.base.surface,";padding:",i.W0[24]," ",i.W0[36],";border-bottom:1px solid ",i.qo.stroke.neutral,";position:relative;overflow:hidden;transition:padding 0.3s ease;",t&&(0,d.iv)("padding:",i.W0[6]," ",i.W0[36],";&:hover{&>[data-drawer]{bottom:0;}};label:wrapper;"),";;label:wrapper;")},inputWrapper:function(t){return(0,d.iv)("width:100%;opacity:1;transition:opacity 0.3s ease-in-out,height 0.3s ease-in-out;",t&&At,";;label:inputWrapper;")},pageName:(0,d.iv)(a.c.body("medium"),";width:100%;;label:pageName;"),fieldAndButton:function(t){return(0,d.iv)("width:100%;display:flex;gap:",i.W0[16],";align-items:end;",t&&Dt,";;label:fieldAndButton;")},frontendEditorButton:function(t){return(0,d.iv)(a.c.body(),";background-color:",i.qo.base.white,";border-radius:",i.E0[24],";padding:",i.W0[4]," ",i.W0[12],";display:flex;align-items:center;gap:",i.W0[8],";color:",i.qo.text.neutral,";flex-shrink:0;svg{fill:none;}",!t&&(0,d.iv)("margin-bottom:",i.W0[2],";;label:frontendEditorButton;")," &:hover{color:",i.qo.text.hover,";}&::before,&::after{content:''!important;all:unset!important;};label:frontendEditorButton;")},drawerHook:function(t){return(0,d.iv)(y.iZ.resetButton,";",y.iZ.centeredFlex,";width:64px;height:16px;background:#fff;position:absolute;bottom:0;left:50%;transform:translateX(-50%);border-top-left-radius:6px;border-top-right-radius:6px;transition:opacity 0.3s ease-in-out,bottom 0.3s ease-in-out;",t&&(0,d.iv)("&:not(:focus){bottom:-",i.W0[16],";}&:hover{bottom:0;};label:drawerHook;")," svg{color:",i.qo.icon.default,";transition:transform 0.3s ease-in-out;}",t&&wt,";;label:drawerHook;")}},Ct=n(7025);function Pt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Tt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}const Lt=function(t){var e=t.text,n=t.updateAdminLabel,r=t.suffix,i=(0,c.$)(),a=Pt((0,T.useState)(!1),2),l=a[0],d=a[1],s=Pt((0,T.useState)(e),2),u=s[0],p=s[1],f=(0,O.T)().closeSettingPanel;return(0,h.tZ)("div",{css:jt.wrapper,children:l?(0,h.tZ)(h.HY,{children:(0,h.tZ)("div",{css:jt.textInputWrapper,children:(0,h.tZ)(Ct.Z,{value:u,onChange:function(t){return p(t)},onKeyDown:function(t,e){e.stopPropagation(),"Escape"===t&&d(!1),"Enter"===t&&(n(u),f(),d(!1))},onBlur:function(){return d(!1)},focusOnMount:!0})})}):(0,h.BX)(h.HY,{children:[(0,h.BX)("span",{children:[e,r&&(0,h.BX)("span",{css:jt.suffix,children:[" (",r,")"]})]}),(0,h.tZ)(N.Z,{title:i("COM_SPPAGEBUILDER_EDITOR_CLICK_EDIT_NAME"),variant:"text",icon:(0,h.tZ)(o.Z,{name:"pencil",height:10,width:10}),onClick:function(t){t.stopPropagation(),d(!0)}})]})})};var jt={wrapper:(0,d.iv)("display:flex;justify-content:start;align-items:center;gap:",i.W0[10],";>button{padding:0;opacity:0;transition:opacity 0.3s ease;svg{color:",i.qo.icon.default,";transition:color 0.3s ease;}}:hover{>button{opacity:1;}};label:wrapper;"),textInputWrapper:{name:"ksdv16-textInputWrapper",styles:"max-width:150px;label:textInputWrapper;"},actionButton:{name:"5dhf19-actionButton",styles:"width:16px;height:16px;label:actionButton;"},suffix:(0,d.iv)(a.c.caption("medium"),";color:",i.qo.text.default,";;label:suffix;")},Bt=n(5587),Rt=n(9101),Zt=n(3722),kt=n(6731),Wt=n(1030);function Ut(t){return Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ut(t)}function qt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Nt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qt(Object(n),!0).forEach((function(e){$t(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function $t(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Ut(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==Ut(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Ut(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mt(){Mt=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),l=new w(r||[]);return o(a,"_invoke",{value:x(t,n,l)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u={};function p(){}function f(){}function v(){}var b={};d(b,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(D([])));m&&m!==e&&n.call(m,i)&&(b=m);var h=v.prototype=p.prototype=Object.create(b);function g(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function I(t,e){function r(o,i,a,l){var d=s(t[o],t,i);if("throw"!==d.type){var c=d.arg,u=c.value;return u&&"object"==Ut(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,a,l)}),(function(t){r("throw",t,a,l)})):e.resolve(u).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,l)}))}l(d.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function x(t,e,n){var o="suspendedStart";return function(r,i){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===r)throw i;return{value:void 0,done:!0}}for(n.method=r,n.arg=i;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===u)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===o)throw o="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o="executing";var d=s(t,e,n);if("normal"===d.type){if(o=n.done?"completed":"suspendedYield",d.arg===u)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o="completed",n.method="throw",n.arg=d.arg)}}}function S(t,e){var n=e.method,o=t.iterator[n];if(void 0===o)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var r=s(o,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function D(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,r=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:A}}function A(){return{value:void 0,done:!0}}return f.prototype=v,o(h,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:f,configurable:!0}),f.displayName=d(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,d(t,l,"GeneratorFunction")),t.prototype=Object.create(h),t},t.awrap=function(t){return{__await:t}},g(I.prototype),d(I.prototype,a,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,o,r,i){void 0===i&&(i=Promise);var a=new I(c(e,n,o,r),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(h),d(h,l,"Generator"),d(h,i,(function(){return this})),d(h,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var o in e)n.push(o);return n.reverse(),function t(){for(;n.length;){var o=n.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},t.values=D,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(n,o){return a.type="throw",a.arg=t,e.next=n,o&&(e.method="next",e.arg=void 0),!!o}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),d=n.call(i,"finallyLoc");if(l&&d){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!d)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var o=n.completion;if("throw"===o.type){var r=o.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:D(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}function Gt(t,e,n,o,r,i,a){try{var l=t[i](a),d=l.value}catch(t){return void n(t)}l.done?e(d):Promise.resolve(d).then(o,r)}var Kt=(0,T.forwardRef)((function(t,e){var n=t.type,r=t.dataToSave,i=t.closePopover,a=(0,c.$)(),l=(0,V.O)({defaultValues:{title:""}}),d=!!r,s=(0,F.l)({isOpen:d,triggerRef:e,arrow:"top"}),p=s.position,v=s.popoverRef,b=(0,u._s)(),m=(0,u.E4)(),g=(0,Zt.u)(),I="addon"===n&&"save_preset"===(null==r?void 0:r.action),x="addon"===n&&"save"===(null==r?void 0:r.action),S=function(){var t,e=(t=Mt().mark((function t(){var e,o;return Mt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.getValues("title"),(0,f.$K)(r)&&(0,f.$K)(e)){t.next=3;break}return t.abrupt("return");case 3:if("addon"!==n||"save_preset"!==r.action){t.next=8;break}return t.next=6,g.mutateAsync({title:e,preset:r.data,addon_name:null!==(o=r.addonName)&&void 0!==o?o:""});case 6:t.next=15;break;case 8:if("addon"!==n){t.next=13;break}return t.next=11,b.mutateAsync({title:e,code:r.data});case 11:t.next=15;break;case 13:return t.next=15,m.mutateAsync({title:e,section:r.data});case 15:E();case 16:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(o,r){var i=t.apply(e,n);function a(t){Gt(i,o,r,a,l,"next",t)}function l(t){Gt(i,o,r,a,l,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}(),E=function(){l.setValue("title",""),i()},O=I?{title:a("COM_SPPAGEBUILDER_EDITOR_SAVE_PRESET_TITLE"),label:a("COM_SPPAGEBUILDER_EDITOR_SAVE_PRESET"),button:a("COM_SPPAGEBUILDER_EDITOR_SAVE_PRESET")}:x?{title:a("COM_SPPAGEBUILDER_EDITOR_SAVE_ADDON_TITLE"),label:a("COM_SPPAGEBUILDER_EDITOR_SAVE_ADDON"),button:a("COM_SPPAGEBUILDER_EDITOR_SAVE_ADDON")}:{title:a("COM_SPPAGEBUILDER_EDITOR_SAVE_SECTION_TITLE"),label:a("COM_SPPAGEBUILDER_EDITOR_SAVE_SECTION"),button:a("COM_SPPAGEBUILDER_EDITOR_SAVE_SECTION")};return(0,h.tZ)(F.h,{isOpen:d,children:(0,h.BX)("div",{css:[Ft.container,{position:"absolute",left:p.left,top:p.top},";label:SavePopover;"],ref:v,children:[(0,h.BX)("div",{css:Ft.header,children:[(0,h.tZ)("span",{children:O.title}),(0,h.tZ)("button",{type:"button",css:y.iZ.resetButton,onClick:E,children:(0,h.tZ)(o.Z,{name:"cross",height:24,width:24})})]}),(0,h.BX)("form",{css:Ft.wrapper,onSubmit:l.handleSubmit((0,kt.GI)(l,S)),children:[(0,h.tZ)("div",{css:Ft.fieldWrapper,children:(0,h.tZ)(X.Qr,{name:"title",control:l.control,rules:Nt({},(0,Wt.n)()),render:function(t){return(0,h.tZ)(Y.Z,Nt(Nt({},t),{},{label:O.label,hasAutoFocus:!0}))}})}),(0,h.BX)("div",{css:Ft.buttonWrapper,children:[(0,h.tZ)(N.Z,{variant:"secondary",onClick:E,children:a("COM_SPPAGEBUILDER_EDITOR_CREATE_PAGE_CANCEL")}),(0,h.tZ)(N.Z,{type:"submit",loading:b.isLoading||m.isLoading,children:O.button})]})]})]})})}));const Vt=Kt;var Ft={container:(0,d.iv)("display:flex;flex-direction:column;background-color:",i.qo.background.white,";border:1px solid ",i.qo.stroke.neutral,";border-radius:",i.E0[10],";box-shadow:",i.AF.popover,";;label:container;"),wrapper:{name:"if42pu-wrapper",styles:"width:400px;label:wrapper;"},fieldWrapper:(0,d.iv)("padding:",i.W0[20],";display:flex;flex-direction:column;gap:",i.W0[12],";background-color:",i.qo.base.white,";;label:fieldWrapper;"),header:(0,d.iv)("padding:",i.W0[12]," ",i.W0[16]," ",i.W0[12]," ",i.W0[24],";border-bottom:1px solid ",i.qo.stroke.neutral,";display:flex;justify-content:space-between;align-items:center;span{",a.c.heading5("medium"),";}button{color:",i.qo.icon.default,";&:hover{color:",i.qo.icon.hover,";}};label:header;"),buttonWrapper:(0,d.iv)("border-top:1px solid ",i.qo.stroke.neutral,";padding:",i.W0[12]," ",i.W0[16],";display:flex;justify-content:end;gap:",i.W0[8],";;label:buttonWrapper;")},Ht=n(2445),Xt=function(t){var e,n,o,i,a,l,d,c=t.position,s=t.active,u=t.over,p=t.contentId,v=t.type,b=null==s?void 0:s.data.current,y=null==u?void 0:u.data.current;if((null==u?void 0:u.id)!==p||(null==y?void 0:y.type)!==v)return null;if(!c||!W({active:s,over:u}))return null;if((null==b?void 0:b.type)===r.t.Section&&b.type===y.type)return null;if(y.type===r.t.Column&&(null==b?void 0:b.type)!==r.Dw.ColumnsElement)return null;var m=[r.t.Addon,r.t.Div,r.t.DeepAddon];return m.includes(y.type)&&y.content.parent&&(0,f.r3)([r.Dw.RowElement,r.Dw.SavedSectionElement],null==b?void 0:b.type)||(0,f.r3)(m,null==b?void 0:b.type)&&(0,f.r3)(m,y.type)&&(null==b?void 0:b.sectionIndex)===y.sectionIndex&&b.columnIndex===y.columnIndex&&b.content.parent===y.content.parent||(null==b?void 0:b.type)===r.t.NestedRow&&(0,f.r3)(m,y.type)&&(null===(e=b.nestedRowData)||void 0===e?void 0:e.sectionIndex)===y.sectionIndex&&b.nestedRowData.columnIndex===y.columnIndex||y.type===r.t.NestedRow&&(0,f.r3)(m,null==b?void 0:b.type)&&(null==b?void 0:b.sectionIndex)===(null===(n=y.nestedRowData)||void 0===n?void 0:n.sectionIndex)&&(null==b?void 0:b.columnIndex)===(null===(o=y.nestedRowData)||void 0===o?void 0:o.columnIndex)||(null==b?void 0:b.type)===r.t.NestedRow&&y.type===r.t.NestedRow&&(null===(i=b.nestedRowData)||void 0===i?void 0:i.sectionIndex)===(null===(a=y.nestedRowData)||void 0===a?void 0:a.sectionIndex)&&(null===(l=b.nestedRowData)||void 0===l?void 0:l.columnIndex)===(null===(d=y.nestedRowData)||void 0===d?void 0:d.columnIndex)||(null==b?void 0:b.type)===r.t.CollectionItemAddon&&y.type===r.t.CollectionItemAddon&&(0,f.$K)(b.itemIndex)&&b.itemIndex===y.itemIndex&&b.content.parent===y.content.parent?null:Yt(c,v)},Yt=function(t,e){var n=i.W0[10];return e===r.t.Section&&(n=i.W0[16]),e===r.t.TableItem&&(n=i.W0[6]),(0,d.iv)("position:relative;&::after{content:'';background-color:",i.qo.background.placeholder,";position:absolute;",zt(t,e,n),";};label:styles;")},zt=function(t,e,n){return"column"===e?(0,d.iv)("top:0;bottom:0;width:2px;height:100%;",t.isLeft&&(0,d.iv)("left:-",n,";;label:positionStyle;")," ",!t.isLeft&&(0,d.iv)("right:-",n,";;label:positionStyle;"),";;label:positionStyle;"):(0,d.iv)("left:0;right:0;height:2px;width:100%;",t.isTop&&(0,d.iv)("top:-",n,";;label:positionStyle;")," ",!t.isTop&&(0,d.iv)("bottom:-",n,";;label:positionStyle;"),";;label:positionStyle;")},Jt=n(4101),Qt=n(6651),te=n(6795),ee=n(1245),ne=n.n(ee),oe=n(6248),re=n(4999),ie=n(765);function ae(t){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ae(t)}function le(t){return function(t){if(Array.isArray(t))return ve(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||fe(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function de(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=fe(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function se(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ce(Object(n),!0).forEach((function(e){ue(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ue(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==ae(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==ae(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===ae(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(t,e)||fe(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fe(t,e){if(t){if("string"==typeof t)return ve(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ve(t,e):void 0}}function ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var be=new Set(["advancedcolor","advancedslider","alignment","boxshadow","buttons","color","margin","fonts","fontstyle","gradient","padding","slider","select","typography","radio"]),ye=["h1","h2","h3","h4","h5","h6","p","div","span","br","section","strong"],me=function(t){var e,n=t.content,o=t.parentVisibility,r=t.sectionIndex,i=t.columnIndex,a=t.index,l=(0,c.$)(),d=pe((0,T.useState)(null),2),u=d[0],p=d[1],v=(0,$.p)().showToast,b=(0,Ht.F)((function(t){return{type:t.type,payload:t.payload}}),oe.X),y=b.type,m=b.payload,h=(0,Ht.F)((function(t){return t.setSettings})),g=(0,O.T)().closeSettingPanel,I=(0,s.x)((function(t){return t.addonStructure})),x=(0,D.o)((function(t){return t.copiedData})),S=(0,s.x)((function(t){return t.globalSettings})),E=(0,D.o)((function(t){return t.deleteDynamicContentAddon})),w=(0,D.o)((function(t){return t.copyDynamicContentAddon})),A=(0,D.o)((function(t){return t.pasteOrInsertDynamicContentAddon})),_=(0,D.o)((function(t){return t.changeVisibilityOfDynamicContentAddon})),C=(0,D.o)((function(t){return t.duplicateDynamicContentAddon})),P=(0,ie.F)().getDynamicContentCollectionItemAddon,L=(0,X.Gc)(),j=(0,f.$K)(n.visibility)&&!n.visibility,B=o&&n.visibility;return{isEditing:"dynamic_content_collection_item_addon"===y&&(null==m||null===(e=m.addon)||void 0===e?void 0:e.id)===n.id,isHidden:j,isVisible:B,addonDataToSave:u,resetAddonDataToSave:function(){return p(null)},handleActions:function(t){switch(t){case"copy":w({sectionIndex:r,columnIndex:i,addon:n});break;case"pasteAbove":g(),A({sectionIndex:r,columnIndex:i,addon:n,isAbove:!0}),v({type:"success",message:l("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")});break;case"paste":g(),A({sectionIndex:r,columnIndex:i,addon:n,isAbove:!1,pasteInside:!0}),v({type:"success",message:l("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")});break;case"pasteBelow":g(),A({sectionIndex:r,columnIndex:i,addon:n,isAbove:!1}),v({type:"success",message:l("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")});break;case"pasteStyle":var e,o,a;if(g(),!(0,f.$K)(x.addon))return;var d=pe(x.addon.addons,1)[0],c=d.name,s=d.settings,u=I[c];if(n.name!==c||!(0,f.$K)(u)||!(0,f.$K)(s))return;var b=u.settings;if(!(0,f.$K)(b))return;var y=function t(e,n,o){var r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},l=de((0,f.zt)(e));try{for(l.s();!(r=l.n()).done;){var d,c=r.value.fields,s=de((0,f.J0)(c));try{var u=function(){var e=pe(d.value,2),r=e[0],l=e[1];if((0,f.$K)(o[r])&&!(0,f.r3)(ye,o[r])&&(be.has(l.type)||i))a[r]=o[r];else if("repeatable"===l.type){var c=(0,f.kJ)(n[r])?n[r]:[],s=c.length,u=(0,f.kJ)(o[r])?o[r]:[],p=u.length;a[r]=u.slice(0,s).flatMap((function(e,n){var o;return se(se({},c[n]),t(null!==(o=l.attr)&&void 0!==o?o:{},c[n],e,!1,{}))})),s>p&&(a[r]=[].concat(le(a[r]),le(c.slice(p))))}};for(s.s();!(d=s.n()).done;)u()}catch(t){s.e(t)}finally{s.f()}}}catch(t){l.e(t)}finally{l.f()}return a},m=y(b,null!==(e=n.settings)&&void 0!==e?e:{},s),h=y(S.style,null!==(o=n.settings)&&void 0!==o?o:{},s,!0);null!==(a=n.settings)&&void 0!==a||(n.settings={}),n.settings=se(se(se({},n.settings),m),h);case"hide":g(),_({sectionIndex:r,columnIndex:i,addon:n,visibility:!!n.visibility}),v({type:"success",message:l("COM_SPPAGEBUILDER_EDITOR_VISIBILITY_CHANGED_SUCCESSFULLY")});break;case"duplicate":C({sectionIndex:r,columnIndex:i,addon:n}),v({type:"success",message:l("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")});break;case"save":var O=ne()(n);(0,re.oY)(O,(function(t){t.id=(0,f.x0)()}));var D={name:O.name,addons:[O],sections:[]};p({action:"save",data:JSON.stringify((0,f.M9)(D))});break;case"remove":E({sectionIndex:r,columnIndex:i,addon:n})}},handleSetSettings:function(){var t;if("dynamic_content_collection_item_addon"!==y||(null==m||null===(t=m.addon)||void 0===t?void 0:t.id)!==n.id){h("dynamic_content_collection_item_addon",{sectionIndex:r,columnIndex:i,addonIndex:a,addon:n});var e=P({sectionIndex:r,columnIndex:i,addon:n}),o=(0,f.$K)(e)?e.settings:{};L.reset(se(se({},L.getValues()),{},{settings:null!=o?o:{}}))}}}},he=n(653);function ge(t){return function(t){if(Array.isArray(t))return Ie(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Ie(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ie(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var xe=function(t){var e,n=t.addonName,o=t.copiedData,r=t.isTableItem,i=t.isProductList,a=t.isNotFoundAddon,l=t.isEmptyParentAddon;return[{id:"copy",icon:"copy",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_COPY",hide:r,isDisabled:a},{id:"pasteAbove",icon:"clipboardAbove",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_PASTE_ABOVE",isDisabled:!o.addon||a,hide:r},{id:"paste",icon:"clipboard",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_PASTE_INSIDE",isDisabled:!o.addon||a,hide:!l},{id:"pasteBelow",icon:"clipboardBelow",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_PASTE_BELOW",isDisabled:!o.addon||a,hide:r},{id:"pasteStyle",icon:"clipboardBelow",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_STYLE_PASTE",isDisabled:!o.addon||a,hide:r||n!==(null===(e=o.addon)||void 0===e?void 0:e.name)},{id:"hide",icon:"eye",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_HIDE",isProFeature:!0,isDisabled:a},{id:"duplicate",icon:"clone",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_DUPLICATE",isDisabled:a},{id:"save",icon:"saveLine",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_SAVE",isProFeature:!0,hide:r,isDisabled:a},{id:"save_preset",icon:"saveLine",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_PRESET",isProFeature:!0,hide:!i,isDisabled:a},{id:"remove",icon:"trash",title:"COM_SPPAGEBUILDER_EDITOR_COLUMN_REMOVE",variant:"critical"}]};const Se=function(t){var e=t.addonWidth,n=t.addonName,i=t.addonType,a=t.copiedData,l=t.handleActions,d=t.isNotFoundAddon,s=void 0!==d&&d,u=t.isEmptyParentAddon,p=void 0!==u&&u,v=(0,c.$)();return(0,h.tZ)(Rt.Z,{actions:[].concat(ge((0,f.$K)(e)&&e<=40?[{id:"settings",icon:"pencilOnBox",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_SETTINGS"}]:[]),ge(xe({addonName:n,copiedData:a,isTableItem:i===r.t.TableItem,isProductList:n===r.oA.productList||n===r.oA.categoryList,isNotFoundAddon:s,isEmptyParentAddon:p}))),title:v("COM_SPPAGEBUILDER_EDITOR_ADDON_ACTIONS"),triggerButtonContent:(0,h.tZ)(o.Z,{name:"ellipsisY",width:16,height:16}),triggerButtonStyle:Ee.actionButton(),onSelect:l})};var Ee={actionButton:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,d.iv)(y.iZ.resetButton,";color:",i.qo.text.default,";display:flex;gap:",i.W0[8],";svg{color:",i.qo.icon.default,";}",!t&&(0,d.iv)(":hover{svg{color:",i.qo.icon.hover,";}};label:actionButton;"),";;label:actionButton;")}};const Oe=function(t){var e=t.id,n=void 0===e?(0,f.x0)():e,r=t.setNodeRef,i=t.isHidden,a=t.disabled,l=t.colors,d=t.placeholderStyle,s=t.sortableStyle,u=t.addonWidth,p=t.addonType,v=t.addonName,b=t.copiedData,y=t.handleActions,m=(0,c.$)(),g=(0,T.useRef)(null);return(0,h.tZ)(h.HY,{children:(0,h.tZ)("div",{id:n.toString(),css:[_e.addon({isEditing:!1,isHidden:i,disabled:!0,colors:l}),d,s,";label:AddonNotFound;"],ref:r,children:(0,h.BX)("div",{css:_e.addonTitleWrapper(a,u),children:[(0,h.tZ)(o.Z,{name:"exclamationTriangle",style:_e.notFoundIcon}),(0,h.tZ)("span",{css:_e.addonTitle,"data-addon-title":!0,children:m("COM_SPPAGEBUILDER_EDITOR_ADDON_NOT_FOUND")}),(0,h.tZ)("div",{ref:g,css:_e.actionButtonWrapper(u),"data-action-button-wrapper":!0,children:(0,h.tZ)(Se,{addonWidth:u,addonType:p,addonName:v,copiedData:b,handleActions:y,isNotFoundAddon:!0})})]})})})};var we={name:"1f0vbk0-addonTitleWrapper",styles:"&>[data-addon-icon]{opacity:0;};label:addonTitleWrapper;"},De={name:"tm5uzc-addonTitleWrapper",styles:"&>[data-addon-title]{opacity:0;};label:addonTitleWrapper;"},Ae={name:"1dqdmrn-addon",styles:"border-top-left-radius:0;label:addon;"},_e={addon:function(t){var e=t.isEditing,n=t.isHidden,o=t.disabled,r=t.colors,a=t.isTableItem;return(0,d.iv)("border:1px solid ",i.qo.stroke.neutral,";border-radius:",i.E0[4],";width:100%;position:relative;z-index:",i.W5.dropdown,";",n&&(0,d.iv)("background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:addon;")," ",!o&&(0,d.iv)("background-color:",i.qo.base.white,";:hover{border:1px solid ",r.addon,";",!a&&Ae," &>[data-addon-drag-handler]{opacity:1;}};label:addon;")," ",e&&(0,d.iv)("border:1px solid ",r.addon,";background-color:",(0,Jt.m4)(r.background,.2),";;label:addon;"),";;label:addon;")},addonTitleWrapper:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[8],";padding:",i.W0[10]," ",i.W0[12],";position:relative;overflow:hidden;cursor:pointer;",n===r.t.DeepAddon&&(0,d.iv)("padding:",i.W0[16],";;label:addonTitleWrapper;")," ",(0,f.$K)(e)&&e<=40&&(0,d.iv)("justify-content:center;padding:",i.W0[10]," 0;[data-addon-title]{display:none;};label:addonTitleWrapper;")," ",!t&&(0,d.iv)(":hover,:focus-within{",(0,f.$K)(e)&&e<=220&&De," ",(0,f.$K)(e)&&e<=80&&we,";&>[data-action-button-wrapper]{opacity:1;visibility:visible;}};label:addonTitleWrapper;"),";;label:addonTitleWrapper;")},addonTitle:(0,d.iv)(a.c.caption(),";white-space:nowrap;overflow:hidden;transition:opacity 0.3s ease-in-out;;label:addonTitle;"),actionButtonWrapper:function(t){return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[10],";position:absolute;right:",i.W0[16],";top:50%;transform:translateY(-50%);transition:opacity 0.3s ease-in-out;opacity:0;visibility:hidden;",(0,f.$K)(t)&&t<=220&&(0,d.iv)("right:",i.W0[8],";;label:actionButtonWrapper;")," ",(0,f.$K)(t)&&t<=80&&(0,d.iv)("gap:",i.W0[4],";right:50%;transform:translateY(-50%) translateX(50%);;label:actionButtonWrapper;"),";;label:actionButtonWrapper;")},notFoundIcon:(0,d.iv)("color:",i.qo.base.warning,";width:18px;height:18px;;label:notFoundIcon;")};function Ce(t){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(t)}function Pe(t){return function(t){if(Array.isArray(t))return ke(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ze(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ze(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Le(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function je(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Le(Object(n),!0).forEach((function(e){Be(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Be(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Ce(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==Ce(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Ce(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Re(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(t,e)||Ze(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ze(t,e){if(t){if("string"==typeof t)return ke(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ke(t,e):void 0}}function ke(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var We=new Set(["advancedcolor","advancedslider","alignment","boxshadow","buttons","color","margin","fonts","fontstyle","gradient","padding","slider","select","typography","radio"]),Ue=["h1","h2","h3","h4","h5","h6","p","div","span","br","section","strong"];function qe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var Ne=function(t){var e,n,o=t.sectionIndex,r=t.columnIndex,i=(0,T.useRef)(null),a=(e=(0,T.useState)(),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,n)||function(t,e){if(t){if("string"==typeof t)return qe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qe(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=a[0],d=a[1],c=(0,H.j)((function(t){return t.activeAction})),s=(0,D.o)((function(t){return t.page}))[o].columns[r];return(0,T.useEffect)((function(){setTimeout((function(){var t,e=null===(t=i.current)||void 0===t?void 0:t.getBoundingClientRect().width;d(e)}),300)}),[c,s.settings.width]),{addonWidth:l,addonTitleRef:i}};function $e(t){return $e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$e(t)}function Me(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Ge(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Me(Object(n),!0).forEach((function(e){Ke(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Me(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ke(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==$e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==$e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===$e(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var Fe=function(t){var e,n,o,i,a;return"div"===(null==t||null===(e=t.data.current)||void 0===e?void 0:e.type)||(null==t||null===(n=t.data.current)||void 0===n||null===(o=n.content)||void 0===o?void 0:o.name)===r.oA.productList||(null==t||null===(i=t.data.current)||void 0===i||null===(a=i.content)||void 0===a?void 0:a.name)===r.oA.categoryList};const He=function(t){var e,n,a,l,d,u=t.children,p=t.content,v=t.sectionIndex,b=t.columnIndex,y=t.index,m=t.childIndex,g=t.placeholderPosition,I=t.disabled,x=t.tableItem,S=t.addonType,E=void 0===S?r.t.Addon:S,_=t.colors,P=void 0===_?{addon:i.qo.alternate.addon,background:i.qo.background.lightGreen}:_,L=t.isCollapsible,j=void 0!==L&&L,B=t.isRegularDivChild,R=void 0!==B&&B,Z=t.isDynamicContentChild,k=void 0!==Z&&Z,U=(0,c.$)(),q=(0,D.o)((function(t){return t.copiedData})),N=(0,D.o)((function(t){return t.changeAddonVisibility})),M=(0,D.o)((function(t){return t.changeVisibilityOfDynamicContentAddon})),G=(0,D.o)((function(t){return t.updateAdminLabel})),K=function(t){var e,n=t.content,o=t.parentVisibility,r=t.tableItem,i=t.sectionIndex,a=t.columnIndex,l=t.index,d=t.childIndex,u=(0,c.$)(),p=Re((0,T.useState)(null),2),v=p[0],b=p[1],y=(0,O.T)().closeSettingPanel,m=(0,Ht.F)((function(t){return{type:t.type,payload:t.payload}}),oe.X),h=(m.type,m.payload),g=(0,Ht.F)((function(t){return t.setSettings})),I=(0,D.o)((function(t){return t.page})),x=(0,D.o)((function(t){return t.copyAddon})),S=(0,D.o)((function(t){return t.pasteOrInsertAddon})),E=(0,D.o)((function(t){return t.pasteAddonStyle})),_=(0,s.x)((function(t){return t.globalSettings})),C=(0,D.o)((function(t){return t.duplicateAddon})),P=(0,D.o)((function(t){return t.duplicateTableItemAddon})),L=(0,D.o)((function(t){return t.copiedData})),j=(0,D.o)((function(t){return t.deleteAddon})),B=(0,D.o)((function(t){return t.deleteTableItemAddon})),R=(0,D.o)((function(t){return t.changeAddonVisibility})),Z=(0,D.o)((function(t){return t.page})),k=(0,w._)(),W=k.getAddon,U=k.getTableItem,q=(0,X.Gc)(),N=(0,s.x)((function(t){return t.addonStructure})),M=(0,$.p)().showToast,G=(0,f.$K)(n.visibility)&&!n.visibility,K=o&&n.visibility,V=(null===(e=h.addon)||void 0===e?void 0:e.id)===n.id,F=W({sectionIndex:i,columnIndex:a,addonIndex:l}),H=function(){var t;if((null===(t=h.addon)||void 0===t?void 0:t.id)!==n.id){var e,o,d,c=I[i].columns[a].addons,s=(0,re.k3)(c,n),u=!!s&&"div"===n.name&&(0,re.X2)(s,(function(t){return"dynamic_content_collection"===t.name}));if(n&&((0,he.Lx)(n.name)||u))return g("dynamic_content_collection_item_addon",{sectionIndex:i,columnIndex:a,addonIndex:l,addon:n}),void q.reset(je(je({},q.getValues()),{},{settings:null!==(e=n.settings)&&void 0!==e?e:{}}));g("addon",{sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r,addon:n}),(0,f.$K)(r)&&(o=null===(d=U({sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r}))||void 0===d?void 0:d.settings);var p=(0,f.$K)(o)?o:null==F?void 0:F.settings;q.reset(je(je({},q.getValues()),{},{settings:p||{}}))}};return{isEditing:V,isHidden:G,isVisible:K,addonDataToSave:v,resetAddonDataToSave:function(){return b(null)},handleActions:function(t){switch(t){case"settings":H();break;case"copy":x({sectionIndex:i,columnIndex:a,addonIndex:l}),M({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_COPIED_SUCCESSFULLY")});break;case"pasteAbove":y(),(0,f.$K)(L.addon)&&(S({addonData:L.addon,sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d,parentId:n.parent,isAbove:!0}),M({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}));break;case"paste":y(),(0,f.$K)(L.addon)&&(S({addonData:L.addon,sectionIndex:i,columnIndex:a,addonIndex:0,childIndex:-1,parentId:n.id,isAbove:!1}),M({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}));break;case"pasteBelow":y(),(0,f.$K)(L.addon)&&(S({addonData:L.addon,sectionIndex:i,columnIndex:a,addonIndex:l,parentId:n.parent,childIndex:d}),M({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}));break;case"pasteStyle":var e,o;if(!(0,f.$K)(L.addon))return;var c=Re(L.addon.addons,1)[0],s=c.name,p=c.settings,v=N[s];if(n.name!==s||!(0,f.$K)(v)||!(0,f.$K)(p))return;var m=v.settings;if(!(0,f.$K)(m))return;var h=function t(e,n,o){var r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},l=Te((0,f.zt)(e));try{for(l.s();!(r=l.n()).done;){var d,c=r.value.fields,s=Te((0,f.J0)(c));try{var u=function(){var e=Re(d.value,2),r=e[0],l=e[1];if((0,f.$K)(o[r])&&!(0,f.r3)(Ue,o[r])&&(We.has(l.type)||i))a[r]=o[r];else if("repeatable"===l.type){var c=(0,f.kJ)(n[r])?n[r]:[],s=c.length,u=(0,f.kJ)(o[r])?o[r]:[],p=u.length;a[r]=u.slice(0,s).flatMap((function(e,n){var o;return je(je({},c[n]),t(null!==(o=l.attr)&&void 0!==o?o:{},c[n],e,!1,{}))})),s>p&&(a[r]=[].concat(Pe(a[r]),Pe(c.slice(p))))}};for(s.s();!(d=s.n()).done;)u()}catch(t){s.e(t)}finally{s.f()}}}catch(t){l.e(t)}finally{l.f()}return a},g=h(m,null!==(e=n.settings)&&void 0!==e?e:{},p),I=h(_.style,null!==(o=n.settings)&&void 0!==o?o:{},p,!0);E({styleSettings:g,globalStyleSettings:I,sectionIndex:i,columnIndex:a,addonIndex:l}),y();break;case"hide":y(),R({sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r,visibility:!!n.visibility}),M({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_VISIBILITY_CHANGED_SUCCESSFULLY")});break;case"duplicate":(0,f.$K)(r)?P({sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r}):C({sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d}),M({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")});break;case"remove":y(),(0,f.$K)(r)?B({sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r}):j({sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d}),M({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_REMOVED_SUCCESSFULLY")});break;case"save":var O=Z[i],w=O.columns[a],D=w.addons,T=(0,A.DV)({sections:Z,rowId:O.id,columnId:w.id,addonList:D,addon:n});(0,f.$K)(T)&&b({data:JSON.stringify((0,f.M9)(T)),action:"save"});break;case"save_preset":var k,W,U=Z[i].columns[a].addons[l],q={items:null!==(W=(null!==(k=U.items)&&void 0!==k?k:[])[0])&&void 0!==W?W:[],settings:U.settings};b({action:"save_preset",addonName:U.name,data:JSON.stringify(q)})}},handleSetSettings:H}}(t),V=K.isEditing,F=K.isHidden,H=K.isVisible,Y=K.handleActions,z=K.handleSetSettings,J=K.addonDataToSave,Q=K.resetAddonDataToSave,tt=me(t),et=tt.handleActions,nt=tt.addonDataToSave,ot=tt.resetAddonDataToSave,rt=(0,T.useRef)(null),it=(0,s.x)((function(t){return t.addonStructure})),at=(l=(0,T.useState)(!0),d=2,function(t){if(Array.isArray(t))return t}(l)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(l,d)||function(t,e){if(t){if("string"==typeof t)return Ve(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ve(t,e):void 0}}(l,d)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),lt=at[0],dt=at[1],ct=(0,T.useRef)(lt),st=(0,mt.v)((function(t){return t.appConfig})),ut=(0,T.useMemo)((function(){var t,e;if("dynamic_content_collection"!==p.name)return"";var n=null==p||null===(t=p.settings)||void 0===t?void 0:t.source;return(0,f.$K)(n)&&null!==(e=st.collections[n])&&void 0!==e?e:""}),[st,p.settings]),pt=Ne({sectionIndex:v,columnIndex:b}),ft=pt.addonWidth,vt=pt.addonTitleRef,bt=(0,Bt.nB)({id:p.id,data:{type:E,isVisible:H,sectionIndex:v,columnIndex:b,addonIndex:y,childIndex:m,tableItem:x,content:p,isRegularDivChild:R,isDynamicContentChild:k}}),yt=bt.attributes,ht=bt.listeners,gt=bt.setNodeRef,It=bt.active,xt=bt.over,St=bt.isDragging,Et=bt.isOver,Ot=bt.transform,wt=bt.transition,Dt=W({active:It,over:xt}),At=it[p.name],_t=Xt({position:g,contentId:p.id,active:It,over:xt,type:E}),Ct=C({disable:Fe(xt),transform:Ot,transition:wt,isDragging:St});(0,T.useEffect)((function(){ct.current&&dt(!St)}),[St]),(0,T.useEffect)((function(){dt(!F),ct.current=!F}),[F]);var Pt=E!==r.t.TableItem,Tt=(0,he.Lx)(p.name)||(0,he.dW)(p,v,b);if(!(0,f.$K)(At))return(0,h.tZ)(Oe,{id:p.id,setNodeRef:gt,isHidden:F,disabled:I,colors:P,placeholderStyle:_t,sortableStyle:Ct,addonWidth:ft,addonType:E,addonName:p.name,copiedData:q,handleActions:Tt?et:Y});var jt=(0,f.$K)(At.title)?At.title:"",Rt=(0,f.$K)(At.icon)?At.icon:"",Zt=(null===(e=p.settings)||void 0===e?void 0:e.admin_label)||jt,kt=I||St||Et,Wt=p.name===r.t.Div&&!(null!==(n=p.children)&&void 0!==n&&n.length),Ut=Tt&&!(null!==(a=p.child_nodes)&&void 0!==a&&a.length),qt=Y;return Tt&&!R&&(qt=et),(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{id:p.id.toString(),css:[tn.addon({isEditing:V,isHidden:F,disabled:kt,colors:P,isTableItem:(0,f.$K)(x),droppable:!Et||Dt}),_t,Ct,";label:Addon;"],ref:gt,children:[(0,h.BX)("div",Ge(Ge(Ge({ref:vt,css:tn.addonTitleWrapper(I,ft,E,lt),title:U("COM_SPPAGEBUILDER_EDITOR_ADDON_CLICK_TITLE"),onClick:function(){z()},onKeyDown:f.ZT},yt),E!==r.t.TableItem&&Ge({},ht)),{},{role:"button",tabIndex:-1,children:[(0,h.tZ)("span",{css:tn.addonIcon,"data-addon-icon":!0,dangerouslySetInnerHTML:{__html:Rt}}),(0,h.tZ)("span",{css:tn.addonTitle,"data-addon-title":!0,children:(0,h.tZ)(Lt,{text:Zt,suffix:ut,updateAdminLabel:function(t){(0,f.$K)(x)?G({label:t,tableAddonItem:Ge({sectionIndex:v,columnIndex:b,addonIndex:y},x)}):G(k?{label:t,dynamicCollectionItemAddon:{addon:p}}:{label:t,addon:{sectionIndex:v,columnIndex:b,addonIndex:y}})}})}),!1,(0,h.tZ)("div",{ref:rt,css:tn.actionButtonWrapper(ft),"data-action-button-wrapper":!0,children:F?(0,h.BX)("button",{type:"button",css:tn.actionButton(),onClick:function(t){t.stopPropagation(),Tt?M({sectionIndex:v,columnIndex:b,addon:p,visibility:!!p.visibility}):N({sectionIndex:v,columnIndex:b,addonIndex:y,tableItem:x,visibility:p.visibility})},children:[(0,h.tZ)(o.Z,{name:"eyeSlash"}),(0,f.$K)(ft)&&ft>80&&U("COM_SPPAGEBUILDER_EDITOR_ACTION_VISIBILITY_SHOW")]}):(0,h.BX)(h.HY,{children:[j&&(0,h.tZ)("button",{type:"button",css:tn.toggleButton(lt),title:U("COM_SPPAGEBUILDER_EDITOR_EXPAND"),onClick:function(t){t.stopPropagation(),dt((function(t){return!t})),ct.current=!ct.current},children:(0,h.tZ)(o.Z,{name:"angleUp",width:20,height:20})}),(0,f.$K)(ft)&&ft>40&&(0,h.tZ)("button",{type:"button",css:tn.actionButton(),children:(0,h.tZ)(o.Z,{name:"pencilOnBox"})}),(0,h.tZ)(Se,{addonWidth:ft,addonType:E,addonName:p.name,copiedData:q,handleActions:qt,isEmptyParentAddon:Wt||Ut})]})})]})),(0,f.$K)(u)&&(0,h.tZ)("div",{css:tn.contents(lt),children:u}),Pt&&(0,h.tZ)("button",Ge(Ge(Ge({type:"button",css:tn.addonDragHandler(P.addon),"data-addon-drag-handler":!0},yt),ht),{},{children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})}))]}),(0,h.tZ)(Vt,{ref:rt,type:"addon",dataToSave:Tt?nt:J,closePopover:Tt?ot:Q})]})};var Xe={name:"sxudyk-contents",styles:"display:none;height:0;opacity:0;padding:0;overflow:hidden;label:contents;"},Ye={name:"1bpgz68-toggleButton",styles:"transform:rotate(-180deg);label:toggleButton;"},ze={name:"1f0vbk0-addonTitleWrapper",styles:"&>[data-addon-icon]{opacity:0;};label:addonTitleWrapper;"},Je={name:"tm5uzc-addonTitleWrapper",styles:"&>[data-addon-title]{opacity:0;};label:addonTitleWrapper;"},Qe={name:"1dqdmrn-addon",styles:"border-top-left-radius:0;label:addon;"},tn={addon:function(t){var e=t.isEditing,n=t.isHidden,o=t.disabled,r=t.colors,a=t.isTableItem,l=t.droppable;return(0,d.iv)("border:1px solid ",l?i.qo.stroke.neutral:i.qo.stroke.error,";border-radius:",i.E0[4],";width:100%;position:relative;",n&&(0,d.iv)("background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:addon;")," ",!o&&(0,d.iv)("background-color:",i.qo.base.white,";:hover{border:1px solid ",r.addon,";",!a&&Qe," &>[data-addon-drag-handler]{opacity:1;}};label:addon;")," ",e&&(0,d.iv)("border:1px solid ",r.addon,";background-color:",(0,Jt.m4)(r.background,.2),";;label:addon;"),";;label:addon;")},addonTitleWrapper:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[8],";padding:",i.W0[10]," ",i.W0[12],";position:relative;overflow:hidden;cursor:pointer;",(n===r.t.DeepAddon||n===r.t.Div)&&o&&(0,d.iv)("padding:",i.W0[16],";;label:addonTitleWrapper;")," ",(0,f.$K)(e)&&e<=40&&(0,d.iv)("justify-content:center;padding:",i.W0[10]," 0;[data-addon-title]{display:none;};label:addonTitleWrapper;")," ",!t&&(0,d.iv)(":hover,:focus-within{",(0,f.$K)(e)&&e<=220&&Je," ",(0,f.$K)(e)&&e<=80&&ze,";&>[data-action-button-wrapper]{opacity:1;visibility:visible;}};label:addonTitleWrapper;"),";;label:addonTitleWrapper;")},addonIcon:(0,d.iv)("line-height:0;transition:opacity 0.3s ease-in-out;svg{width:20px;height:20px;color:",i.qo.icon.default,";}img{width:20px;height:20px;};label:addonIcon;"),addonTitle:(0,d.iv)(a.c.caption(),";white-space:nowrap;overflow:hidden;transition:opacity 0.3s ease-in-out;display:flex;align-items:center;;label:addonTitle;"),actionButtonWrapper:function(t){return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[10],";position:absolute;right:",i.W0[16],";top:50%;transform:translateY(-50%);transition:opacity 0.3s ease-in-out;opacity:0;visibility:hidden;",(0,f.$K)(t)&&t<=220&&(0,d.iv)("right:",i.W0[8],";;label:actionButtonWrapper;")," ",(0,f.$K)(t)&&t<=80&&(0,d.iv)("gap:",i.W0[4],";right:50%;transform:translateY(-50%) translateX(50%);;label:actionButtonWrapper;"),";;label:actionButtonWrapper;")},actionButton:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,d.iv)(y.iZ.resetButton,";color:",i.qo.text.default,";display:flex;gap:",i.W0[8],";svg{color:",i.qo.icon.default,";}",!t&&(0,d.iv)(":hover{svg{color:",i.qo.icon.hover,";}};label:actionButton;"),";;label:actionButton;")},addonDragHandler:function(t){return(0,d.iv)(y.iZ.resetButton,";",y.iZ.flexCenter(),";border-top-left-radius:",i.E0[4],";border-bottom-left-radius:",i.E0[4],";background-color:",t,";color:",i.qo.base.white,";width:12px;height:18px;position:absolute;top:-1px;left:0;transform:translateX(-100%);opacity:0;cursor:grab!important;;label:addonDragHandler;")},notFoundIcon:(0,d.iv)("color:",i.qo.base.warning,";width:18px;height:18px;;label:notFoundIcon;"),toggleButton:function(t){return(0,d.iv)(y.iZ.resetButton,";padding:",i.W0[2],";transition:transform 0.3s ease,opacity 0.3s ease;svg{color:",i.qo.icon.default,";transition:color 0.3s ease-in-out;}:hover{svg{color:",i.qo.icon.hover,";border-color:",i.qo.stroke.hover,";}}:active{svg{color:",i.qo.icon.primary,";}}",!t&&Ye,";;label:toggleButton;")},contents:function(t){return(0,d.iv)(!t&&Xe,";;label:contents;")}};function en(t){return en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},en(t)}function nn(t){return function(t){if(Array.isArray(t))return sn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||cn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function on(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=cn(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function rn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function an(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?rn(Object(n),!0).forEach((function(e){ln(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ln(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==en(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==en(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===en(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(t,e)||cn(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cn(t,e){if(t){if("string"==typeof t)return sn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sn(t,e):void 0}}function sn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var un=new Set(["advancedcolor","advancedslider","alignment","boxshadow","buttons","color","margin","fonts","fontstyle","gradient","padding","slider","select","typography","radio"]),pn=["h1","h2","h3","h4","h5","h6","p","div","span","br","section","strong"];function fn(t){return fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fn(t)}function vn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function bn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vn(Object(n),!0).forEach((function(e){yn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function yn(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==fn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==fn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===fn(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}const hn=function(t){var e,n,a,l,d=t.children,u=t.content,p=t.sectionIndex,v=t.columnIndex,b=t.index,y=t.collectionItem,m=t.childIndex,g=t.placeholderPosition,I=t.disabled,x=t.tableItem,S=t.addonType,E=void 0===S?r.t.CollectionItemAddon:S,_=t.colors,P=void 0===_?{addon:i.qo.alternate.addon,background:i.qo.background.lightGreen}:_,L=t.isCollapsible,j=void 0!==L&&L,B=(0,c.$)(),R=(0,D.o)((function(t){return t.copiedData})),Z=(0,D.o)((function(t){return t.changeCollectionItemAddonVisibility})),k=(0,D.o)((function(t){return t.updateAdminLabel})),U=function(t){var e,n=t.content,o=t.parentVisibility,r=t.sectionIndex,i=t.columnIndex,a=t.index,l=t.collectionItem,d=t.childIndex,u=(0,c.$)(),p=dn((0,T.useState)(null),2),v=p[0],b=p[1],y=(0,O.T)().closeSettingPanel,m=(0,Ht.F)((function(t){return{type:t.type,payload:t.payload}}),oe.X),h=m.type,g=m.payload,I=(0,Ht.F)((function(t){return t.setSettings})),x=(0,D.o)((function(t){return t.copyCollectionItemAddon})),S=(0,D.o)((function(t){return t.pasteOrInsertCollectionItemAddon})),E=(0,D.o)((function(t){return t.pasteCollectionItemAddonStyle})),_=(0,s.x)((function(t){return t.globalSettings})),C=(0,D.o)((function(t){return t.duplicateCollectionItemAddon})),P=(0,D.o)((function(t){return t.copiedData})),L=(0,D.o)((function(t){return t.deleteCollectionItemAddon})),j=(0,D.o)((function(t){return t.changeCollectionItemAddonVisibility})),B=(0,D.o)((function(t){return t.page})),R=(0,w._)().getCollectionItemAddon,Z=(0,X.Gc)(),k=(0,s.x)((function(t){return t.addonStructure})),W=(0,$.p)().showToast,U=(0,f.$K)(n.visibility)&&!n.visibility,q=o&&n.visibility,N="addon"===h&&g.sectionIndex===r&&g.columnIndex===i&&g.addonIndex===a&&(0,f.$K)(g.collectionItem)===(0,f.$K)(l);return(0,f.$K)(l)&&(N=N&&(null===(e=g.collectionItem)||void 0===e?void 0:e.itemIndex)===l.itemIndex&&g.collectionItem.itemAddonIndex===l.itemAddonIndex),{isEditing:N,isHidden:U,isVisible:q,addonDataToSave:v,resetAddonDataToSave:function(){return b(null)},handleActions:function(t){switch(t){case"copy":x(an({sectionIndex:r,columnIndex:i,addonIndex:a},l)),W({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_COPIED_SUCCESSFULLY")});break;case"pasteAbove":y(),(0,f.$K)(P.addon)&&(S(an(an({addonData:P.addon,sectionIndex:r,columnIndex:i,addonIndex:a},l),{},{childIndex:d,parentId:n.parent,isAbove:!0})),W({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}));break;case"pasteBelow":y(),(0,f.$K)(P.addon)&&(S(an(an({addonData:P.addon,sectionIndex:r,columnIndex:i,addonIndex:a},l),{},{childIndex:d,parentId:n.parent})),W({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}));break;case"pasteStyle":var e,o;if(!(0,f.$K)(P.addon))return;var c=dn(P.addon.addons,1)[0],s=c.name,p=c.settings,v=k[s];if(n.name!==s||!(0,f.$K)(v)||!(0,f.$K)(p))return;var m=v.settings;if(!(0,f.$K)(m))return;var h=function t(e,n,o){var r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},l=on((0,f.zt)(e));try{for(l.s();!(r=l.n()).done;){var d,c=r.value.fields,s=on((0,f.J0)(c));try{var u=function(){var e=dn(d.value,2),r=e[0],l=e[1];if((0,f.$K)(o[r])&&!(0,f.r3)(pn,o[r])&&(un.has(l.type)||i))a[r]=o[r];else if("repeatable"===l.type){var c=(0,f.kJ)(n[r])?n[r]:[],s=c.length,u=(0,f.kJ)(o[r])?o[r]:[],p=u.length;a[r]=u.slice(0,s).flatMap((function(e,n){var o;return an(an({},c[n]),t(null!==(o=l.attr)&&void 0!==o?o:{},c[n],e,!1,{}))})),s>p&&(a[r]=[].concat(nn(a[r]),nn(c.slice(p))))}};for(s.s();!(d=s.n()).done;)u()}catch(t){s.e(t)}finally{s.f()}}}catch(t){l.e(t)}finally{l.f()}return a},g=h(m,null!==(e=n.settings)&&void 0!==e?e:{},p),I=h(_.style,null!==(o=n.settings)&&void 0!==o?o:{},p,!0);E(an({styleSettings:g,globalStyleSettings:I,sectionIndex:r,columnIndex:i,addonIndex:a},l)),y();break;case"hide":y(),j(an(an({sectionIndex:r,columnIndex:i,addonIndex:a},l),{},{visibility:!!n.visibility})),W({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_VISIBILITY_CHANGED_SUCCESSFULLY")});break;case"duplicate":C(an({sectionIndex:r,columnIndex:i,addonIndex:a,childIndex:d},l)),W({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")});break;case"remove":y(),L(an({sectionIndex:r,columnIndex:i,addonIndex:a},l)),W({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_REMOVED_SUCCESSFULLY")});break;case"save":var O,w,D=null!==(w=(null!==(O=B[r].columns[i].addons[a].items)&&void 0!==O?O:[])[l.itemIndex])&&void 0!==w?w:[],T=D[l.itemAddonIndex],R=null,Z=ne()(T);if("div"===T.name){var U=(0,A.vH)({addon:Z,addonList:D}),q=U.divAddon,N=U.children;R={name:q.name,addons:[q].concat(nn(N)),sections:[]}}else R={name:Z.name,addons:[Z],sections:[]};(0,f.$K)(R)&&b({action:"save",data:JSON.stringify((0,f.M9)(R))})}},handleSetSettings:function(){var t,e;if("addon"!==h||g.sectionIndex!==r||g.columnIndex!==i||g.addonIndex!==a||(null===(t=g.collectionItem)||void 0===t?void 0:t.itemIndex)!==l.itemIndex||g.collectionItem.itemAddonIndex!==l.itemAddonIndex){I("collection_item_addon",{sectionIndex:r,columnIndex:i,addonIndex:a,collectionItem:l,addon:n});var o=null===(e=R({sectionIndex:r,columnIndex:i,addonIndex:a,collectionItem:l}))||void 0===e?void 0:e.settings;Z.reset(an(an({},Z.getValues()),{},{settings:o||{}}))}}}}(t),q=U.isEditing,N=U.isHidden,M=U.isVisible,G=U.handleActions,K=U.handleSetSettings,V=U.addonDataToSave,F=U.resetAddonDataToSave,H=(0,T.useRef)(null),Y=(0,s.x)((function(t){return t.addonStructure})),z=(a=(0,T.useState)(!0),l=2,function(t){if(Array.isArray(t))return t}(a)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(a,l)||function(t,e){if(t){if("string"==typeof t)return mn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mn(t,e):void 0}}(a,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),J=z[0],Q=z[1],tt=(0,T.useRef)(J),et=Ne({sectionIndex:p,columnIndex:v}),nt=et.addonWidth,ot=et.addonTitleRef,rt=(0,Bt.nB)({id:u.id,data:{type:r.t.CollectionItemAddon,isVisible:M,sectionIndex:p,columnIndex:v,addonIndex:b,itemIndex:y.itemIndex,itemAddonIndex:y.itemAddonIndex,childIndex:m,content:u}}),it=rt.attributes,at=rt.listeners,lt=rt.setNodeRef,dt=rt.active,ct=rt.over,st=rt.isDragging,ut=rt.isOver,pt=rt.transform,ft=rt.transition,vt=W({active:dt,over:ct}),bt=Y[u.name],yt=Xt({position:g,contentId:u.id,active:dt,over:ct,type:E}),mt=C({disable:"div"===(null==ct||null===(e=ct.data.current)||void 0===e?void 0:e.type),transform:pt,transition:ft,isDragging:st});(0,T.useEffect)((function(){tt.current&&Q(!st)}),[st]),(0,T.useEffect)((function(){Q(!N),tt.current=!N}),[N]);var ht=E!==r.t.TableItem;if(!(0,f.$K)(bt))return(0,h.tZ)(Oe,{id:u.id,setNodeRef:lt,isHidden:N,disabled:I,colors:P,placeholderStyle:yt,sortableStyle:mt,addonWidth:nt,addonType:E,addonName:u.name,copiedData:R,handleActions:G});var gt=(0,f.$K)(bt.title)?bt.title:"",It=(0,f.$K)(bt.icon)?bt.icon:"",xt=(null===(n=u.settings)||void 0===n?void 0:n.admin_label)||gt,St=I||st||ut;return(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{id:u.id.toString(),css:[On.addon({isEditing:q,isHidden:N,disabled:St,colors:P,isTableItem:(0,f.$K)(x),droppable:!ut||vt}),yt,mt,";label:CollectionItemAddon;"],ref:lt,children:[(0,h.BX)("div",bn(bn(bn({ref:ot,css:On.addonTitleWrapper(I,nt,E,J),title:B("COM_SPPAGEBUILDER_EDITOR_ADDON_CLICK_TITLE"),onClick:function(){K()},onKeyDown:f.ZT},it),E!==r.t.TableItem&&bn({},at)),{},{role:"button",tabIndex:-1,children:[(0,h.tZ)("span",{css:On.addonIcon,"data-addon-icon":!0,dangerouslySetInnerHTML:{__html:It}}),(0,h.tZ)("span",{css:On.addonTitle,"data-addon-title":!0,children:(0,h.tZ)(Lt,{text:xt,updateAdminLabel:function(t){k({label:t,collectionItemAddon:{sectionIndex:p,columnIndex:v,addonIndex:b,itemIndex:y.itemIndex,itemAddonIndex:y.itemAddonIndex,childIndex:m}})}})}),(0,h.tZ)("div",{ref:H,css:On.actionButtonWrapper(nt),"data-action-button-wrapper":!0,children:N?(0,h.BX)("button",{type:"button",css:On.actionButton(),onClick:function(t){t.stopPropagation(),Z(bn(bn({sectionIndex:p,columnIndex:v,addonIndex:b},y),{},{visibility:!!u.visibility}))},children:[(0,h.tZ)(o.Z,{name:"eyeSlash"}),(0,f.$K)(nt)&&nt>80&&B("COM_SPPAGEBUILDER_EDITOR_ACTION_VISIBILITY_SHOW")]}):(0,h.BX)(h.HY,{children:[j&&(0,h.tZ)("button",{type:"button",css:On.toggleButton(J),title:B("COM_SPPAGEBUILDER_EDITOR_EXPAND"),onClick:function(t){t.stopPropagation(),Q((function(t){return!t})),tt.current=!tt.current},children:(0,h.tZ)(o.Z,{name:"angleUp",width:20,height:20})}),(0,f.$K)(nt)&&nt>40&&(0,h.tZ)("button",{type:"button",css:On.actionButton(),children:(0,h.tZ)(o.Z,{name:"pencilOnBox"})}),(0,h.tZ)(Se,{addonWidth:nt,addonType:E,addonName:u.name,copiedData:R,handleActions:G})]})})]})),(0,f.$K)(d)&&(0,h.tZ)("div",{css:On.contents(J),children:d}),ht&&(0,h.tZ)("button",bn(bn(bn({type:"button",css:On.addonDragHandler(P.addon),"data-addon-drag-handler":!0},it),at),{},{children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})}))]}),(0,h.tZ)(Vt,{ref:H,type:"addon",dataToSave:V,closePopover:F})]})};var gn={name:"sxudyk-contents",styles:"display:none;height:0;opacity:0;padding:0;overflow:hidden;label:contents;"},In={name:"1bpgz68-toggleButton",styles:"transform:rotate(-180deg);label:toggleButton;"},xn={name:"1f0vbk0-addonTitleWrapper",styles:"&>[data-addon-icon]{opacity:0;};label:addonTitleWrapper;"},Sn={name:"tm5uzc-addonTitleWrapper",styles:"&>[data-addon-title]{opacity:0;};label:addonTitleWrapper;"},En={name:"1dqdmrn-addon",styles:"border-top-left-radius:0;label:addon;"},On={addon:function(t){var e=t.isEditing,n=t.isHidden,o=t.disabled,r=t.colors,a=t.isTableItem,l=t.droppable;return(0,d.iv)("border:1px solid ",l?i.qo.stroke.neutral:i.qo.stroke.error,";border-radius:",i.E0[4],";width:100%;position:relative;",n&&(0,d.iv)("background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:addon;")," ",!o&&(0,d.iv)("background-color:",i.qo.base.white,";:hover{border:1px solid ",r.addon,";",!a&&En," &>[data-addon-drag-handler]{opacity:1;}};label:addon;")," ",e&&(0,d.iv)("border:1px solid ",r.addon,";background-color:",(0,Jt.m4)(r.background,.2),";;label:addon;"),";;label:addon;")},addonTitleWrapper:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[8],";padding:",i.W0[10]," ",i.W0[12],";position:relative;overflow:hidden;cursor:pointer;",(n===r.t.DeepAddon||n===r.t.Div)&&o&&(0,d.iv)("padding:",i.W0[16],";;label:addonTitleWrapper;")," ",(0,f.$K)(e)&&e<=40&&(0,d.iv)("justify-content:center;padding:",i.W0[10]," 0;[data-addon-title]{display:none;};label:addonTitleWrapper;")," ",!t&&(0,d.iv)(":hover,:focus-within{",(0,f.$K)(e)&&e<=220&&Sn," ",(0,f.$K)(e)&&e<=80&&xn,";&>[data-action-button-wrapper]{opacity:1;visibility:visible;}};label:addonTitleWrapper;"),";;label:addonTitleWrapper;")},addonIcon:(0,d.iv)("line-height:0;transition:opacity 0.3s ease-in-out;svg{width:20px;height:20px;color:",i.qo.icon.default,";}img{width:20px;height:20px;};label:addonIcon;"),addonTitle:(0,d.iv)(a.c.caption(),";white-space:nowrap;overflow:hidden;transition:opacity 0.3s ease-in-out;;label:addonTitle;"),actionButtonWrapper:function(t){return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[10],";position:absolute;right:",i.W0[16],";top:50%;transform:translateY(-50%);transition:opacity 0.3s ease-in-out;opacity:0;visibility:hidden;",(0,f.$K)(t)&&t<=220&&(0,d.iv)("right:",i.W0[8],";;label:actionButtonWrapper;")," ",(0,f.$K)(t)&&t<=80&&(0,d.iv)("gap:",i.W0[4],";right:50%;transform:translateY(-50%) translateX(50%);;label:actionButtonWrapper;"),";;label:actionButtonWrapper;")},actionButton:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,d.iv)(y.iZ.resetButton,";color:",i.qo.text.default,";display:flex;gap:",i.W0[8],";svg{color:",i.qo.icon.default,";}",!t&&(0,d.iv)(":hover{svg{color:",i.qo.icon.hover,";}};label:actionButton;"),";;label:actionButton;")},addonDragHandler:function(t){return(0,d.iv)(y.iZ.resetButton,";",y.iZ.flexCenter(),";border-top-left-radius:",i.E0[4],";border-bottom-left-radius:",i.E0[4],";background-color:",t,";color:",i.qo.base.white,";width:12px;height:18px;position:absolute;top:-1px;left:0;transform:translateX(-100%);opacity:0;cursor:grab!important;;label:addonDragHandler;")},notFoundIcon:(0,d.iv)("color:",i.qo.base.warning,";width:18px;height:18px;;label:notFoundIcon;"),toggleButton:function(t){return(0,d.iv)(y.iZ.resetButton,";padding:",i.W0[2],";transition:transform 0.3s ease,opacity 0.3s ease;svg{color:",i.qo.icon.default,";transition:color 0.3s ease-in-out;}:hover{svg{color:",i.qo.icon.hover,";border-color:",i.qo.stroke.hover,";}}:active{svg{color:",i.qo.icon.primary,";}}",!t&&In,";;label:toggleButton;")},contents:function(t){return(0,d.iv)(!t&&gn,";;label:contents;")}};function wn(t){return wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wn(t)}function Dn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function An(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Dn(Object(n),!0).forEach((function(e){_n(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function _n(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==wn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==wn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===wn(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Cn={addon:i.qo.alternate.div,background:i.qo.background.lightRoyalBlue};const Pn=function t(e){var n=e.content,i=e.sectionIndex,a=e.columnIndex,l=e.index,d=e.collectionItem,s=e.placeholderPosition,u=e.disabled,p=e.parentVisibility,v=(0,c.$)(),b=(0,w._)().getCollectionItemAddonChildAddonById,y=(0,H.j)((function(t){return t.setActiveAction})),m=p&&n.visibility;return(0,h.tZ)(hn,An(An({},e),{},{addonType:r.t.CollectionItemAddon,colors:Cn,isCollapsible:!0,children:(0,f.$K)(n)&&((0,f.$K)(n.children)&&n.children.length?(0,h.tZ)(Bt.Fo,{id:n.id.toString(),items:n.children,strategy:Bt.qw,children:(0,h.tZ)("div",{css:Tn.childrenWrapper,children:n.children.map((function(e,o){var r=b({sectionIndex:i,columnIndex:a,addonIndex:l,collectionItem:d,itemAddonId:e}),c=r.index,v=r.content;return(0,f.$K)(v)?"div"===v.name?(0,h.tZ)(t,{content:v,sectionIndex:i,columnIndex:a,index:l,collectionItem:{itemIndex:d.itemIndex,itemAddonIndex:c},childIndex:o,placeholderPosition:s,disabled:!n.visibility||u,parentVisibility:p&&n.visibility},e):(0,h.tZ)(hn,{content:v,sectionIndex:i,columnIndex:a,index:l,collectionItem:{itemIndex:d.itemIndex,itemAddonIndex:c},childIndex:o,placeholderPosition:s,disabled:!n.visibility||u,parentVisibility:p&&n.visibility},e):null}))})}):(0,h.tZ)(U,{id:"".concat(n.id,"-empty-child"),customStyle:Tn.emptyChildren,isHidden:!m,data:{type:r.t.CollectionItemAddon,isVisible:m,sectionIndex:i,columnIndex:a,addonIndex:l,itemIndex:d.itemIndex,itemAddonIndex:d.itemAddonIndex,childIndex:0,content:n,isEmptyChild:!0},children:(0,h.tZ)("button",{disabled:!m,title:v("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(){return y("add-elements")},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})}))}))};var Tn={childrenWrapper:(0,d.iv)("display:flex;flex-direction:column;gap:",i.W0[16],";padding:",i.W0[16],";margin:0 ",i.W0[16]," ",i.W0[16],";border-radius:",i.E0[2],";border:1px solid ",i.qo.stroke.neutral,";;label:childrenWrapper;"),emptyChildren:(0,d.iv)("height:100%;border:1px dashed ",i.qo.stroke.neutral,";border-radius:0 0 ",i.E0[2],";margin:0 ",i.W0[16]," ",i.W0[16],";button{",y.iZ.resetButton,";width:100%;height:100px;",y.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";};label:emptyChildren;")};function Ln(t){return Ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ln(t)}function jn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Bn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jn(Object(n),!0).forEach((function(e){Rn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Rn(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Ln(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==Ln(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Ln(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zn(){Zn=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),l=new w(r||[]);return o(a,"_invoke",{value:x(t,n,l)}),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u={};function p(){}function f(){}function v(){}var b={};d(b,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(D([])));m&&m!==e&&n.call(m,i)&&(b=m);var h=v.prototype=p.prototype=Object.create(b);function g(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function I(t,e){function r(o,i,a,l){var d=s(t[o],t,i);if("throw"!==d.type){var c=d.arg,u=c.value;return u&&"object"==Ln(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,a,l)}),(function(t){r("throw",t,a,l)})):e.resolve(u).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,l)}))}l(d.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function x(t,e,n){var o="suspendedStart";return function(r,i){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===r)throw i;return{value:void 0,done:!0}}for(n.method=r,n.arg=i;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===u)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===o)throw o="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o="executing";var d=s(t,e,n);if("normal"===d.type){if(o=n.done?"completed":"suspendedYield",d.arg===u)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o="completed",n.method="throw",n.arg=d.arg)}}}function S(t,e){var n=e.method,o=t.iterator[n];if(void 0===o)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var r=s(o,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function D(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,r=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:A}}function A(){return{value:void 0,done:!0}}return f.prototype=v,o(h,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:f,configurable:!0}),f.displayName=d(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,d(t,l,"GeneratorFunction")),t.prototype=Object.create(h),t},t.awrap=function(t){return{__await:t}},g(I.prototype),d(I.prototype,a,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,o,r,i){void 0===i&&(i=Promise);var a=new I(c(e,n,o,r),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(h),d(h,l,"Generator"),d(h,i,(function(){return this})),d(h,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var o in e)n.push(o);return n.reverse(),function t(){for(;n.length;){var o=n.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},t.values=D,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(n,o){return a.type="throw",a.arg=t,e.next=n,o&&(e.method="next",e.arg=void 0),!!o}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),d=n.call(i,"finallyLoc");if(l&&d){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!d)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var o=n.completion;if("throw"===o.type){var r=o.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:D(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}function kn(t,e,n,o,r,i,a){try{var l=t[i](a),d=l.value}catch(t){return void n(t)}l.done?e(d):Promise.resolve(d).then(o,r)}var Wn={addon:i.qo.alternate.div,background:i.qo.background.lightRoyalBlue};const Un=function(t){var e=t.content,n=t.sectionIndex,i=t.columnIndex,a=t.index,l=t.placeholderPosition,d=t.disabled,s=t.parentVisibility,u=(0,c.$)(),p=(0,H.j)((function(t){return t.setActiveAction})),v=s&&e.visibility,b=(0,D.o)((function(t){return t.addCollectionItems})),y=(0,Zt.b)();(0,T.useEffect)((function(){var t;(t=Zn().mark((function t(){var o,r,l,d;return Zn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=null===(o=e.settings)||void 0===o?void 0:o.presets,l=Number(r),!Number.isNaN(l)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,y.mutateAsync(l);case 6:d=t.sent,(0,f.$K)(d)&&b({sectionIndex:n,columnIndex:i,addonIndex:a,preset:d.preset});case 8:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(o,r){var i=t.apply(e,n);function a(t){kn(i,o,r,a,l,"next",t)}function l(t){kn(i,o,r,a,l,"throw",t)}a(void 0)}))})()}),[i,a,n]);var m=function(t,c){return t.length?(0,h.tZ)(Bt.Fo,{id:e.id.toString(),items:t.filter((function(t){return!t.parent})),strategy:Bt.qw,children:(0,h.tZ)("div",{css:qn.childrenWrapper,children:t.map((function(t,o){return"parent"in t&&t.parent?null:"div"===t.name?(0,h.tZ)(Pn,{content:t,sectionIndex:n,columnIndex:i,index:a,collectionItem:{itemIndex:c,itemAddonIndex:o},placeholderPosition:l,disabled:!e.visibility||d,parentVisibility:s&&e.visibility},t.id):(0,h.tZ)(hn,{sectionIndex:n,columnIndex:i,index:a,collectionItem:{itemIndex:c,itemAddonIndex:o},content:t,placeholderPosition:l,disabled:!e.visibility||d,parentVisibility:s&&e.visibility,addonType:r.t.CollectionItemAddon},t.id)}))})},c):(0,h.tZ)(U,{id:"".concat(e.id,"-empty-child"),customStyle:qn.emptyChildren,isHidden:!v,data:{type:r.t.CollectionItemAddon,isVisible:v,sectionIndex:n,columnIndex:i,addonIndex:a,content:e},children:(0,h.tZ)("button",{disabled:!v,title:u("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(){return p("add-elements")},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})},c)};return(0,h.tZ)(He,Bn(Bn({},t),{},{colors:Wn,isCollapsible:!0,children:(0,f.$K)(e)&&((0,f.$K)(e.items)?(0,h.tZ)("div",{css:qn.grid(1),children:e.items.slice(0,1).map((function(t,e){return(0,f.$K)(t)?m(t,e):null}))}):null)}))};var qn={grid:function(t){return(0,d.iv)("display:",1===t?"block":"grid",";grid-template-columns:repeat(",t,", 1fr);grid-template-rows:auto;overflow-x:auto;;label:grid;")},childrenWrapper:(0,d.iv)("display:flex;flex-direction:column;gap:",i.W0[10],";padding:",i.W0[10],";margin:0 ",i.W0[12]," ",i.W0[12],";border-radius:",i.E0[2],";border:1px solid ",i.qo.stroke.neutral,";;label:childrenWrapper;"),emptyChildren:(0,d.iv)("height:100%;border:1px dashed ",i.qo.stroke.neutral,";border-radius:0 0 ",i.E0[2],";margin:0 ",i.W0[16]," ",i.W0[16],";button{",y.iZ.resetButton,";width:100%;height:100px;",y.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";};label:emptyChildren;")};function Nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}const $n=function(t){var e,n,i,a,l=t.content,d=t.isVisible,c=t.placeholderPosition,s=(i=(0,T.useState)(0),a=2,function(t){if(Array.isArray(t))return t}(i)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(i,a)||function(t,e){if(t){if("string"==typeof t)return Nn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nn(t,e):void 0}}(i,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],p=s[1],v=(0,w._)().getSectionById,b=null!==(e=null===(n=l.settings)||void 0===n?void 0:n[r.RI[l.name].key])&&void 0!==e?e:[],y=function(){if(!(0,f.$K)(u))return null;var t=b[u],e=(0,f.$K)(t)?t.content:[];return(0,h.tZ)("div",{css:Gn.body(d),children:e.map((function(t){var e=v(t.id),n=e.index,o=e.content;return(0,f.$K)(o)?(0,h.tZ)(Ko,{index:n,content:o,placeholderPosition:c,disabled:!d,parentVisibility:d,sectionType:r.t.DeepAddonRow},t.id):null}))})};return(0,h.tZ)("div",{css:Gn.wrapper,children:b.map((function(t,e){return(0,h.BX)("div",{css:Gn.accordionItem,children:[(0,h.BX)("button",{css:Gn.navItem(u===e,d),onClick:function(){return p(u===e?null:e)},children:[(0,h.tZ)(o.Z,{name:"caretRight",height:16,width:16}),(0,h.tZ)("div",{css:Gn.title,children:t.title})]}),u===e&&y()]},"".concat(t.title).concat(e))}))})};var Mn={name:"1jmy1n7-navItem",styles:"transform:rotate(90deg);label:navItem;"},Gn={wrapper:(0,d.iv)("margin:0 ",i.W0[16]," ",i.W0[16],";border-radius:",i.E0[2],";border:1px solid ",i.qo.stroke.neutral,";;label:wrapper;"),accordionItem:(0,d.iv)("&:not(:first-of-type){border-top:1px solid ",i.qo.stroke.neutral,";};label:accordionItem;"),navItem:function(t,e){return(0,d.iv)("width:100%;display:flex;gap:",i.W0[12],";",y.iZ.resetButton," padding:",i.W0[16],";",t&&e&&(0,d.iv)("color:",i.qo.text.primary,";background-color:",i.qo.background.primary,";;label:navItem;")," svg{color:",i.qo.icon.default,";transition:transform 0.3s ease-out;",t&&Mn,";};label:navItem;")},title:(0,d.iv)("font-family:",i.I8.sansSerif,";font-style:normal;font-weight:400;font-size:",i.JB[12],";line-height:",i.Nv[18],";text-align:justify;color:",i.qo.text.default,";;label:title;"),body:function(t){return(0,d.iv)("padding:0 ",i.W0[16]," ",i.W0[16],";",t&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:body;"),";;label:body;")}};function Kn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Vn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function Fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}const Hn=function(t){var e,n,i,a,l=t.content,d=t.isVisible,s=t.placeholderPosition,u=(0,c.$)(),p=(i=(0,T.useState)(0),a=2,function(t){if(Array.isArray(t))return t}(i)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(i,a)||function(t,e){if(t){if("string"==typeof t)return Fn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fn(t,e):void 0}}(i,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),v=p[0],b=p[1],y=(0,w._)().getSectionById,m=null!==(e=null===(n=l.settings)||void 0===n?void 0:n[r.RI[l.name].key])&&void 0!==e?e:[],g=m[v],I=(0,f.$K)(g)?g.content:[],x=function(t){var e=t.itemsLength,n=(0,T.useRef)(null),o=Kn((0,T.useState)(0),2),r=o[0],i=o[1],a=Kn((0,T.useState)(!1),2),l=a[0],d=a[1];return(0,T.useEffect)((function(){n.current&&n.current.addEventListener("scrollend",(function(){if(n.current){var t=Math.min(n.current.scrollLeft,n.current.scrollWidth-n.current.clientWidth);i(t),d(t===n.current.scrollWidth-n.current.clientWidth)}}))}),[]),(0,T.useEffect)((function(){n.current&&d(r===n.current.scrollWidth-n.current.clientWidth)}),[e]),{scrollContainerRef:n,handleScroll:function(t){var e=t.direction;if(n.current){var o=n.current.scrollWidth-n.current.clientWidth,r=Math.min(o,n.current.scrollLeft+100);"left"===e&&(r=Math.max(0,n.current.scrollLeft-100)),i(r),d(r===n.current.scrollWidth-n.current.clientWidth),n.current.scrollLeft=r}},scrollLeftAmount:r,isScrolledToEnd:l}}({itemsLength:m.length}),S=x.scrollContainerRef,E=x.scrollLeftAmount,O=x.isScrolledToEnd,D=x.handleScroll;return(0,h.BX)("div",{css:Xn.wrapper,children:[(0,h.BX)("div",{css:Xn.nav,children:[E>0&&(0,h.tZ)("div",{css:Xn.navButtonWrapper({direction:"left"}),children:(0,h.tZ)("button",{type:"button",css:Xn.navButtonStyle,onClick:function(){return D({direction:"left"})},children:(0,h.tZ)("span",{css:Xn.navButtonContentStyle,title:u("COM_SPPAGEBUILDER_EDITOR_SECTION_SETTINGS"),children:(0,h.tZ)(o.Z,{name:"chevronLeft",height:20,width:20})})})}),(0,h.tZ)("div",{ref:S,css:Xn.navItemsWrapper,children:m.map((function(t,e){return(0,h.BX)("button",{css:Xn.navItem(v===e,d),onClick:function(){return b(e)},children:[(0,h.tZ)("div",{children:t.title}),t.subtitle&&(0,h.tZ)("span",{children:t.subtitle})]},"".concat(t.title).concat(e))}))}),!O&&(0,h.tZ)("div",{css:Xn.navButtonWrapper({direction:"right"}),children:(0,h.tZ)("button",{type:"button",css:Xn.navButtonStyle,onClick:function(){return D({direction:"right"})},children:(0,h.tZ)("span",{css:Xn.navButtonContentStyle,title:u("COM_SPPAGEBUILDER_EDITOR_SECTION_SETTINGS"),children:(0,h.tZ)(o.Z,{name:"chevronRight",height:20,width:20})})})})]}),(0,h.tZ)("div",{css:Xn.body(d),children:I.map((function(t){var e=y(t.id),n=e.index,o=e.content;return(0,f.$K)(o)?(0,h.tZ)(Ko,{index:n,content:o,placeholderPosition:s,disabled:!d,parentVisibility:d,sectionType:r.t.DeepAddonRow},t.id):null}))})]})};var Xn={wrapper:(0,d.iv)("display:flex;flex-direction:column;border:1px solid ",i.qo.stroke.neutral,";border-radius:",i.E0[4],";margin:0 ",i.W0[16]," ",i.W0[16],";overflow:hidden;;label:wrapper;"),nav:{name:"1yhlv30-nav",styles:"display:flex;position:relative;label:nav;"},navItemsWrapper:function(){return(0,d.iv)("display:flex;border-bottom:1px solid ",i.qo.stroke.neutral,";overflow-x:auto;scroll-behavior:smooth;&::-webkit-scrollbar{display:none;}&{-ms-overflow-style:none;scrollbar-width:none;};label:navItemsWrapper;")},navItem:function(t,e){return(0,d.iv)(y.iZ.resetButton," font-size:",i.JB[14],";padding:",i.W0[16],";border-right:1px solid ",i.qo.stroke.neutral,";min-height:52px;max-width:160px;position:relative;>div{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;word-wrap:break-word;}",t&&(0,d.iv)("color:",i.qo.text.primary,";",e&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:navItem;")," &::before{content:'';width:100%;height:1px;position:absolute;left:0;bottom:-1px;",e&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:navItem;"),";};label:navItem;"),";;label:navItem;")},navButtonWrapper:function(t){var e=t.direction;return(0,d.iv)("height:100%;width:120px;padding:",i.W0[4],";display:flex;align-items:center;position:absolute;top:0;","left"===e&&(0,d.iv)("left:0;justify-content:left;background:linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, #fff 66.67%);padding-left:",i.W0[16],";z-index:",i.W5.positive,";;label:navButtonWrapper;")," ","right"===e&&(0,d.iv)("right:0;justify-content:right;background:linear-gradient(270deg, #fff 32.32%, rgba(255, 255, 255, 0) 100%);padding-right:",i.W0[16],";;label:navButtonWrapper;"),";;label:navButtonWrapper;")},navButtonStyle:(0,d.iv)(y.iZ.flexCenter(),";",y.iZ.resetButton,";border-radius:",i.E0.circle,";;label:navButtonStyle;"),navButtonContentStyle:(0,d.iv)(y.iZ.centeredFlex,";border:1px solid ",i.qo.stroke.neutral,";border-radius:",i.E0[6],";width:24px;height:24px;svg{color:",i.qo.icon.default,";transition:color 0.3s ease-in-out;};label:navButtonContentStyle;"),body:function(t){return(0,d.iv)("padding:",i.W0[16],";",t&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:body;"),";;label:body;")}};const Yn=function(t){var e,n,i,a,l,d,s=t.content,u=t.sectionIndex,p=t.columnIndex,v=t.index,b=t.isVisible,y=t.placeholderPosition,m=(0,H.j)((function(t){return t.setActiveAction})),g=(0,c.$)(),I=null!==(e=null===(n=s.settings)||void 0===n?void 0:n[r.pb.headerItemsKey])&&void 0!==e?e:[],x=null!==(i=null===(a=s.settings)||void 0===a?void 0:a[r.pb.bodyItemsKey])&&void 0!==i?i:[];return(0,h.BX)("div",{css:zn.wrapper,children:[!(0,f.$K)(null===(l=s.settings)||void 0===l?void 0:l.turn_off_heading)||!(null!==(d=s.settings)&&void 0!==d&&d.turn_off_heading)&&(0,h.tZ)("div",{css:zn.headerWrapper,children:I.map((function(t,e){if(0===t.content.length){var n="empty-table-header-item-".concat(e);return(0,h.tZ)(U,{id:n,customStyle:zn.emptyItem,isHidden:!b,data:{type:r.t.TableItem,sectionIndex:u,columnIndex:p,addonIndex:v,tableItem:{itemIdx:e,contentItemIdx:0},content:s,isVisible:b},children:(0,h.tZ)("button",{disabled:!b,title:g("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(){return m("add-elements")},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})},n)}return(0,h.tZ)("div",{css:zn.headerItem,children:t.content.map((function(t,n){return(0,h.tZ)(He,{content:t,sectionIndex:u,columnIndex:p,index:v,placeholderPosition:y,disabled:!b,parentVisibility:b,tableItem:{itemIdx:e,contentItemIdx:n},addonType:r.t.TableItem},t.id)}))},e)}))}),(0,h.tZ)("div",{css:zn.bodyWrapper,children:x.map((function(t,e){return(0,h.tZ)("div",{css:zn.bodyRowWrapper,children:(0,f.$K)(t.table_advanced_item)&&t.table_advanced_item.map((function(t,n){if(0===t.content.length){var i="empty-table-body-item-".concat(e,"-").concat(n);return(0,h.tZ)(U,{id:i,customStyle:zn.emptyItem,isHidden:!b,data:{type:r.t.TableItem,sectionIndex:u,columnIndex:p,addonIndex:v,tableItem:{itemIdx:e,rowItemIdx:n,contentItemIdx:0},content:s,isVisible:b},children:(0,h.tZ)("button",{disabled:!b,title:g("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(t){t.stopPropagation(),m("add-elements")},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})},i)}return(0,h.tZ)("div",{css:zn.bodyItem,children:t.content.map((function(t,o){return(0,h.tZ)(He,{content:t,sectionIndex:u,columnIndex:p,index:v,placeholderPosition:y,disabled:!b,parentVisibility:b,tableItem:{itemIdx:e,rowItemIdx:n,contentItemIdx:o},addonType:r.t.TableItem},t.id)}))},n)}))},e)}))})]})};var zn={wrapper:(0,d.iv)("margin:0 ",i.W0[16]," ",i.W0[16],";border-radius:",i.E0[2],";border:1px solid ",i.qo.stroke.neutral,";overflow-x:auto;;label:wrapper;"),headerWrapper:(0,d.iv)("display:flex;gap:",i.W0[6],";padding:",i.W0[6],";border-bottom:1px solid ",i.qo.stroke.neutral,";background-color:",i.qo.background.primary,";min-width:fit-content;;label:headerWrapper;"),bodyWrapper:(0,d.iv)("display:flex;flex-direction:column;gap:",i.W0[6],";padding:",i.W0[6],";min-width:fit-content;;label:bodyWrapper;"),headerItem:(0,d.iv)("width:100%;display:flex;flex-direction:column;gap:",i.W0[6],";;label:headerItem;"),bodyRowWrapper:(0,d.iv)("display:flex;gap:",i.W0[6],";;label:bodyRowWrapper;"),bodyItem:(0,d.iv)("width:100%;display:flex;flex-direction:column;gap:",i.W0[6],";;label:bodyItem;"),emptyItem:(0,d.iv)("width:100%;height:100%;border:1px dashed ",i.qo.stroke.neutral,";border-radius:0 0 ",i.E0[2],";button{",y.iZ.resetButton,";width:100%;height:40px;",y.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";width:",i.W0[24],";height:",i.W0[24],";};label:emptyItem;")};function Jn(t){return Jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jn(t)}function Qn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function to(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Qn(Object(n),!0).forEach((function(e){eo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function eo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Jn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==Jn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Jn(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var no={addon:i.qo.alternate.div,background:i.qo.background.white};const oo=function(t){var e=t.content,n=t.sectionIndex,o=t.columnIndex,i=t.index,a=t.placeholderPosition,l=t.parentVisibility&&e.visibility;return(0,h.tZ)(He,to(to({},t),{},{addonType:r.t.DeepAddon,colors:no,isCollapsible:!0,children:(0,f.$K)(e)&&(e.name===r.pb.name?(0,h.tZ)(Yn,{content:e,sectionIndex:n,columnIndex:o,index:i,isVisible:l,placeholderPosition:a}):e.name===r.RI.accordion.name?(0,h.tZ)($n,{content:e,placeholderPosition:a,isVisible:l}):e.name===r.RI.tab.name?(0,h.tZ)(Hn,{content:e,placeholderPosition:a,isVisible:l}):null)}))};function ro(t){return ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ro(t)}function io(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function ao(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?io(Object(n),!0).forEach((function(e){lo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):io(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function lo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==ro(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==ro(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===ro(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function co(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}const so=function(t){var e,n,a,l,d=t.children,u=t.content,p=t.sectionIndex,v=t.columnIndex,b=t.index,y=t.childIndex,m=t.placeholderPosition,g=t.disabled,I=t.addonType,x=void 0===I?r.t.CollectionItemAddon:I,S=t.colors,E=void 0===S?{addon:i.qo.alternate.addon,background:i.qo.background.lightGreen}:S,O=t.isCollapsible,w=void 0!==O&&O,A=t.isDynamicContentChild,_=void 0!==A&&A,P=(t.collectionItem,(0,c.$)()),L=(0,D.o)((function(t){return t.copiedData})),j=(0,D.o)((function(t){return t.changeVisibilityOfDynamicContentAddon})),B=(0,D.o)((function(t){return t.updateAdminLabel})),R=me(t),Z=R.isEditing,k=R.isHidden,U=R.isVisible,q=R.handleActions,N=R.handleSetSettings,$=R.addonDataToSave,M=R.resetAddonDataToSave,G=(0,T.useRef)(null),K=(0,s.x)((function(t){return t.addonStructure})),V=(a=(0,T.useState)(!0),l=2,function(t){if(Array.isArray(t))return t}(a)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(a,l)||function(t,e){if(t){if("string"==typeof t)return co(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?co(t,e):void 0}}(a,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),F=V[0],H=V[1],X=(0,T.useRef)(F),Y=Ne({sectionIndex:p,columnIndex:v}),z=Y.addonWidth,J=Y.addonTitleRef,Q=(0,Bt.nB)({id:u.id,data:{type:r.t.DCCollectionItemAddon,isVisible:U,sectionIndex:p,columnIndex:v,addonIndex:b,childIndex:y,content:u,isDynamicContentChild:_}}),tt=Q.attributes,et=Q.listeners,nt=Q.setNodeRef,ot=Q.active,rt=Q.over,it=Q.isDragging,at=Q.isOver,lt=Q.transform,dt=Q.transition,ct=W({active:ot,over:rt}),st=K[u.name],ut=Xt({position:m,contentId:u.id,active:ot,over:rt,type:x}),pt=C({disable:"div"===(null==rt||null===(e=rt.data.current)||void 0===e?void 0:e.type),transform:lt,transition:dt,isDragging:it});(0,T.useEffect)((function(){X.current&&H(!it)}),[it]),(0,T.useEffect)((function(){H(!k),X.current=!k}),[k]);var ft=x!==r.t.TableItem;if(!(0,f.$K)(st))return(0,h.tZ)(Oe,{id:u.id,setNodeRef:nt,isHidden:k,disabled:g,colors:E,placeholderStyle:ut,sortableStyle:pt,addonWidth:z,addonType:x,addonName:u.name,copiedData:L,handleActions:q});var vt=(0,f.$K)(st.title)?st.title:"",bt=(0,f.$K)(st.icon)?st.icon:"",yt=(null===(n=u.settings)||void 0===n?void 0:n.admin_label)||vt,mt=g||it||at;return(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{id:u.id.toString(),css:[yo.addon({isEditing:Z,isHidden:k,disabled:mt,colors:E,isTableItem:!1,droppable:!at||ct}),ut,pt,";label:DCCollectionItemAddon;"],ref:nt,children:[(0,h.BX)("div",ao(ao(ao({ref:J,css:yo.addonTitleWrapper(g,z,x,F),title:P("COM_SPPAGEBUILDER_EDITOR_ADDON_CLICK_TITLE"),onClick:function(){N()},onKeyDown:f.ZT},tt),x!==r.t.TableItem&&ao({},et)),{},{role:"button",tabIndex:-1,children:[(0,h.tZ)("span",{css:yo.addonIcon,"data-addon-icon":!0,dangerouslySetInnerHTML:{__html:bt}}),(0,h.tZ)("span",{css:yo.addonTitle,"data-addon-title":!0,children:(0,h.tZ)(Lt,{text:yt,updateAdminLabel:function(t){B({label:t,dynamicCollectionItemAddon:{addon:u}})}})}),!1,(0,h.tZ)("div",{ref:G,css:yo.actionButtonWrapper(z),"data-action-button-wrapper":!0,children:k?(0,h.BX)("button",{type:"button",css:yo.actionButton(),onClick:function(t){t.stopPropagation(),j({sectionIndex:p,columnIndex:v,addon:u,visibility:!!u.visibility})},children:[(0,h.tZ)(o.Z,{name:"eyeSlash"}),(0,f.$K)(z)&&z>80&&P("COM_SPPAGEBUILDER_EDITOR_ACTION_VISIBILITY_SHOW")]}):(0,h.BX)(h.HY,{children:[w&&(0,h.tZ)("button",{type:"button",css:yo.toggleButton(F),title:P("COM_SPPAGEBUILDER_EDITOR_EXPAND"),onClick:function(t){t.stopPropagation(),H((function(t){return!t})),X.current=!X.current},children:(0,h.tZ)(o.Z,{name:"angleUp",width:20,height:20})}),(0,f.$K)(z)&&z>40&&(0,h.tZ)("button",{type:"button",css:yo.actionButton(),children:(0,h.tZ)(o.Z,{name:"pencilOnBox"})}),(0,h.tZ)(Se,{addonWidth:z,addonType:x,addonName:u.name,copiedData:L,handleActions:q})]})})]})),(0,f.$K)(d)&&(0,h.tZ)("div",{css:yo.contents(F),children:d}),ft&&(0,h.tZ)("button",ao(ao(ao({type:"button",css:yo.addonDragHandler(E.addon),"data-addon-drag-handler":!0},tt),et),{},{children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})}))]}),(0,h.tZ)(Vt,{ref:G,type:"addon",dataToSave:$,closePopover:M})]})};var uo={name:"sxudyk-contents",styles:"display:none;height:0;opacity:0;padding:0;overflow:hidden;label:contents;"},po={name:"1bpgz68-toggleButton",styles:"transform:rotate(-180deg);label:toggleButton;"},fo={name:"1f0vbk0-addonTitleWrapper",styles:"&>[data-addon-icon]{opacity:0;};label:addonTitleWrapper;"},vo={name:"tm5uzc-addonTitleWrapper",styles:"&>[data-addon-title]{opacity:0;};label:addonTitleWrapper;"},bo={name:"1dqdmrn-addon",styles:"border-top-left-radius:0;label:addon;"},yo={addon:function(t){var e=t.isEditing,n=t.isHidden,o=t.disabled,r=t.colors,a=t.isTableItem,l=t.droppable;return(0,d.iv)("border:1px solid ",l?i.qo.stroke.neutral:i.qo.stroke.error,";border-radius:",i.E0[4],";width:100%;position:relative;",n&&(0,d.iv)("background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:addon;")," ",!o&&(0,d.iv)("background-color:",i.qo.base.white,";:hover{border:1px solid ",r.addon,";",!a&&bo," &>[data-addon-drag-handler]{opacity:1;}};label:addon;")," ",e&&(0,d.iv)("border:1px solid ",r.addon,";background-color:",(0,Jt.m4)(r.background,.2),";;label:addon;"),";;label:addon;")},addonTitleWrapper:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[8],";padding:",i.W0[10]," ",i.W0[12],";position:relative;overflow:hidden;cursor:pointer;",(n===r.t.DeepAddon||n===r.t.Div)&&o&&(0,d.iv)("padding:",i.W0[16],";;label:addonTitleWrapper;")," ",(0,f.$K)(e)&&e<=40&&(0,d.iv)("justify-content:center;padding:",i.W0[10]," 0;[data-addon-title]{display:none;};label:addonTitleWrapper;")," ",!t&&(0,d.iv)(":hover,:focus-within{",(0,f.$K)(e)&&e<=220&&vo," ",(0,f.$K)(e)&&e<=80&&fo,";&>[data-action-button-wrapper]{opacity:1;visibility:visible;}};label:addonTitleWrapper;"),";;label:addonTitleWrapper;")},addonIcon:(0,d.iv)("line-height:0;transition:opacity 0.3s ease-in-out;svg{width:20px;height:20px;color:",i.qo.icon.default,";}img{width:20px;height:20px;};label:addonIcon;"),addonTitle:(0,d.iv)(a.c.caption(),";white-space:nowrap;overflow:hidden;transition:opacity 0.3s ease-in-out;;label:addonTitle;"),actionButtonWrapper:function(t){return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[10],";position:absolute;right:",i.W0[16],";top:50%;transform:translateY(-50%);transition:opacity 0.3s ease-in-out;opacity:0;visibility:hidden;",(0,f.$K)(t)&&t<=220&&(0,d.iv)("right:",i.W0[8],";;label:actionButtonWrapper;")," ",(0,f.$K)(t)&&t<=80&&(0,d.iv)("gap:",i.W0[4],";right:50%;transform:translateY(-50%) translateX(50%);;label:actionButtonWrapper;"),";;label:actionButtonWrapper;")},actionButton:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,d.iv)(y.iZ.resetButton,";color:",i.qo.text.default,";display:flex;gap:",i.W0[8],";svg{color:",i.qo.icon.default,";}",!t&&(0,d.iv)(":hover{svg{color:",i.qo.icon.hover,";}};label:actionButton;"),";;label:actionButton;")},addonDragHandler:function(t){return(0,d.iv)(y.iZ.resetButton,";",y.iZ.flexCenter(),";border-top-left-radius:",i.E0[4],";border-bottom-left-radius:",i.E0[4],";background-color:",t,";color:",i.qo.base.white,";width:12px;height:18px;position:absolute;top:-1px;left:0;transform:translateX(-100%);opacity:0;cursor:grab!important;;label:addonDragHandler;")},notFoundIcon:(0,d.iv)("color:",i.qo.base.warning,";width:18px;height:18px;;label:notFoundIcon;"),toggleButton:function(t){return(0,d.iv)(y.iZ.resetButton,";padding:",i.W0[2],";transition:transform 0.3s ease,opacity 0.3s ease;svg{color:",i.qo.icon.default,";transition:color 0.3s ease-in-out;}:hover{svg{color:",i.qo.icon.hover,";border-color:",i.qo.stroke.hover,";}}:active{svg{color:",i.qo.icon.primary,";}}",!t&&po,";;label:toggleButton;")},contents:function(t){return(0,d.iv)(!t&&uo,";;label:contents;")}};function mo(t){return mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mo(t)}function ho(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function go(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ho(Object(n),!0).forEach((function(e){Io(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ho(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Io(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==mo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==mo(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===mo(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var xo={addon:i.qo.alternate.div,background:i.qo.background.lightRoyalBlue};const So=function t(e){var n,i,a=e.content,l=e.sectionIndex,d=e.columnIndex,s=e.index,u=(e.childIndex,e.placeholderPosition),p=e.disabled,v=e.parentVisibility,b=(e.isRegularDivChild,e.isDynamicContentChild,(0,c.$)()),y=(0,H.j)((function(t){return t.setActiveAction})),m=v&&a.visibility;return(0,h.tZ)(He,go(go({},e),{},{colors:xo,isCollapsible:!0,children:(0,f.$K)(a)&&(0,h.tZ)("div",{css:Eo.grid(1),children:(0,f.$K)(a.child_nodes)&&(n=a.child_nodes,i=s,n.length?(0,h.tZ)(Bt.Fo,{id:a.id.toString(),items:n,strategy:Bt.qw,children:(0,h.tZ)("div",{css:Eo.childrenWrapper,children:n.map((function(e,n){return(0,he.Lx)(e.name)||"div"===e.name?(0,h.tZ)(t,{content:e,sectionIndex:l,columnIndex:d,index:i,placeholderPosition:u,disabled:!a.visibility||p,parentVisibility:v&&a.visibility,addonType:r.t.DCCollectionItemAddon,isDynamicContentChild:!0},e.id):(0,h.tZ)(so,{sectionIndex:l,columnIndex:d,index:s,content:e,placeholderPosition:u,disabled:!a.visibility||p,parentVisibility:v&&a.visibility,addonType:r.t.DCCollectionItemAddon,isDynamicContentChild:!0,collectionItem:{itemIndex:i,itemAddonIndex:n}},e.id)}))})},i):(0,h.tZ)(U,{id:"".concat(a.id,"-empty-child"),customStyle:Eo.emptyChildren,isHidden:!m,data:{type:r.t.DCCollectionAddonEmptyChild,isVisible:m,sectionIndex:l,columnIndex:d,addonIndex:s,content:a,isRegularDivChild:!1,isDynamicContentChild:!0},children:(0,h.tZ)("button",{disabled:!m,title:b("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(){return y("add-elements")},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})},i))})}))};var Eo={grid:function(t){return(0,d.iv)("display:",1===t?"block":"grid",";grid-template-columns:repeat(",t,", 1fr);grid-template-rows:auto;overflow-x:auto;;label:grid;")},childrenWrapper:(0,d.iv)("display:flex;flex-direction:column;gap:",i.W0[10],";padding:",i.W0[10],";margin:0 ",i.W0[12]," ",i.W0[12],";border-radius:",i.E0[2],";border:1px solid ",i.qo.stroke.neutral,";;label:childrenWrapper;"),emptyChildren:(0,d.iv)("height:100%;border:1px dashed ",i.qo.stroke.neutral,";border-radius:0 0 ",i.E0[2],";margin:0 ",i.W0[16]," ",i.W0[16],";button{",y.iZ.resetButton,";width:100%;height:100px;",y.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";};label:emptyChildren;")};function Oo(t){return Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oo(t)}function wo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Do(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wo(Object(n),!0).forEach((function(e){Ao(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ao(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Oo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==Oo(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Oo(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var _o={addon:i.qo.alternate.div,background:i.qo.background.lightRoyalBlue};const Co=function t(e){var n=e.content,i=e.sectionIndex,a=e.columnIndex,l=e.index,d=e.childIndex,s=e.tableItem,u=e.placeholderPosition,p=e.disabled,v=e.parentVisibility,b=(e.isRegularDivChild,(0,c.$)()),y=(0,w._)().getChildAddonById,m=(0,H.j)((function(t){return t.setActiveAction})),g=v&&n.visibility;return(0,h.tZ)(He,Do(Do({},e),{},{addonType:r.t.Div,colors:_o,isCollapsible:!0,children:(0,f.$K)(n)&&((0,f.$K)(n.children)&&n.children.length?(0,h.tZ)(Bt.Fo,{id:n.id.toString(),items:n.children,strategy:Bt.qw,children:(0,h.tZ)("div",{css:Po.childrenWrapper,children:n.children.map((function(e,o){var l=y({sectionIndex:i,columnIndex:a,id:e}),d=l.index,c=l.content;return(0,f.$K)(c)?"div"===c.name?(0,h.tZ)(t,{content:c,sectionIndex:i,columnIndex:a,index:d,childIndex:o,placeholderPosition:u,disabled:!n.visibility||p,parentVisibility:v&&n.visibility,isRegularDivChild:!0},e):(0,he.Lx)(c.name)?(0,h.tZ)(So,{content:c,sectionIndex:i,columnIndex:a,index:d,childIndex:o,placeholderPosition:u,disabled:!n.visibility||p,parentVisibility:v&&n.visibility,addonType:r.t.DCCollectionItemAddon,isRegularDivChild:!0},c.id):Object.keys(r.RI).includes(c.name)||c.name===r.pb.name?(0,h.tZ)(oo,{content:c,sectionIndex:i,columnIndex:a,index:d,childIndex:o,placeholderPosition:u,disabled:!n.visibility||p,parentVisibility:v&&n.visibility,isRegularDivChild:!0},c.id):(0,f.dA)(c.name)?(0,h.tZ)(Un,{content:c,sectionIndex:i,columnIndex:a,index:d,childIndex:o,placeholderPosition:u,disabled:!n.visibility||p,parentVisibility:v&&n.visibility,isRegularDivChild:!0},c.id):(0,h.tZ)(He,{sectionIndex:i,columnIndex:a,content:c,index:d,childIndex:o,placeholderPosition:u,disabled:!n.visibility||p,parentVisibility:v&&n.visibility,isRegularDivChild:!0},e):null}))})}):(0,h.tZ)(U,{id:"".concat(n.id,"-empty-child"),customStyle:Po.emptyChildren,isHidden:!g,data:{type:r.t.EmptyDivChild,isVisible:g,sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d,tableItem:s,content:n,isRegularDivChild:!0},children:(0,h.tZ)("button",{disabled:!g,title:b("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(){return m("add-elements")},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})}))}))};var Po={childrenWrapper:(0,d.iv)("display:flex;flex-direction:column;gap:",i.W0[16],";padding:",i.W0[16],";margin:0 ",i.W0[16]," ",i.W0[16],";border-radius:",i.E0[2],";border:1px solid ",i.qo.stroke.neutral,";;label:childrenWrapper;"),emptyChildren:(0,d.iv)("height:100%;border:1px dashed ",i.qo.stroke.neutral,";border-radius:0 0 ",i.E0[2],";margin:0 ",i.W0[16]," ",i.W0[16],";button{",y.iZ.resetButton,";width:100%;height:100px;",y.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";};label:emptyChildren;")};function To(t){return To="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},To(t)}function Lo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function jo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Lo(Object(n),!0).forEach((function(e){Bo(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Bo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==To(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==To(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===To(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ro=function(t){var e=t.isHidden,n=t.isDeepAddonColumn,o=t.totalColumns;return[{id:"settings",icon:"cog",title:"COM_SPPAGEBUILDER_EDITOR_COLUMN_SETTINGS",isDisabled:e},{id:"visibility",icon:"eyeSlash",title:"COM_SPPAGEBUILDER_EDITOR_ACTION_VISIBILITY_HIDE",isProFeature:!0},{id:"duplicate",icon:"cloneLine",title:"COM_SPPAGEBUILDER_EDITOR_COLUMN_DUPLICATE",isDisabled:e},{id:"remove",icon:"trash",title:"COM_SPPAGEBUILDER_EDITOR_COLUMN_REMOVE",variant:"critical",isDisabled:e,hide:n&&1===o}]};const Zo=function(t){var e=t.content,n=t.sectionIndex,i=t.index,a=t.placeholderPosition,l=t.parentVisibility,d=t.isDeepAddonColumn,s=void 0!==d&&d,u=t.totalColumns,p=(0,c.$)(),v=(0,D.o)((function(t){return t.changeColumnVisibility})),b=(0,D.o)((function(t){return t.duplicateColumn})),y=(0,D.o)((function(t){return t.deleteColumn})),m=(0,D.o)((function(t){return t.copiedData})),g=(0,D.o)((function(t){return t.pasteOrInsertAddon})),I=(0,D.o)((function(t){return t.page})),x=(0,Qt.y)((function(t){return t.activeColumn})),S=(0,Qt.y)((function(t){return t.setActiveColumn})),E=(0,T.useRef)({element:null}),A=(0,w._)().getNestedRowById,_=(0,H.j)((function(t){return t.setActiveAction})),P=(0,H.j)((function(t){return t.activeAction})),L=(0,Ht.F)((function(t){return{type:t.type,payload:t.payload,setSettings:t.setSettings}})),j=L.type,B=L.payload,R=L.setSettings,Z=l&&e.visibility,k=(0,Bt.nB)({id:e.id,data:{type:r.t.Column,isVisible:Z,sectionIndex:n,columnIndex:i,content:e}}),W=k.attributes,U=k.listeners,q=k.setNodeRef,N=k.isDragging,M=k.active,G=k.over,K=k.isOver,V=k.transition,F=k.transform,Y=function(t){t&&(q(t),E.current.element=t)},z=(0,$.p)().showToast,J=!e.visibility,Q=C({transform:F,transition:V,isDragging:N}),tt=Xt({position:a,contentId:e.id,active:M,over:G,type:"column"}),et=(0,O.T)().closeSettingPanel;(0,T.useEffect)((function(){P||S(null)}),[P,S]);var nt=(0,X.Gc)(),ot=nt.getValues,rt=nt.reset,it=(0,w._)().getColumnSettings,at=function(t){"settings"===t&&(rt(jo(jo({},ot()),{},{settings:it({sectionIndex:n,columnIndex:i})})),R("column",{sectionIndex:n,columnIndex:i,addonIndex:null})),"visibility"===t&&(et(),v({sectionIndex:n,columnIndex:i,visibility:e.visibility}),z({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_VISIBILITY_CHANGED_SUCCESSFULLY")})),"duplicate"===t&&(b({sectionIndex:n,columnIndex:i}),z({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")})),"remove"===t&&(et(),y({sectionIndex:n,columnIndex:i}),z({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_REMOVED_SUCCESSFULLY")}))},lt="column"===j&&B.sectionIndex===n&&B.columnIndex===i,dt=N||K,ct=x==="".concat(n,"-").concat(i),st=function(){return(0,h.BX)(h.HY,{children:[(0,h.tZ)(Rt.Z,{actions:Ro({isHidden:J,isDeepAddonColumn:s,totalColumns:u}),triggerButtonContent:(0,h.tZ)(o.Z,{name:"ellipsisX",width:10}),triggerButtonStyle:ko.columnSettings,onSelect:at,visibilityStatus:!J,title:p("COM_SPPAGEBUILDER_EDITOR_COLUMN_ACTIONS")}),(0,h.tZ)("button",jo(jo(jo({type:"button",css:ko.columnDragHandler,"data-column-drag-handler":!0},W),U),{},{children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})})),!!m.addon&&Z&&(0,h.tZ)("button",{type:"button",css:ko.clipboardButton,"data-addon-paste-button":!0,title:p("COM_SPPAGEBUILDER_EDITOR_ADDON_PASTE"),onClick:function(t){if(t.stopPropagation(),(0,f.$K)(m.addon)){et();var e=I[n].columns[i].addons.length;g({addonData:m.addon,sectionIndex:n,columnIndex:i,addonIndex:e}),z({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")})}},children:(0,h.tZ)(o.Z,{name:"clipboard",height:16,width:16})})]})};return 0===e.addons.length?(0,h.tZ)("div",{css:ko.columnWrap({width:e.settings.width}),children:(0,h.BX)("div",{css:[ko.emptyColumnWrap({isOver:K,isEditing:lt,isHidden:J,hideOutline:dt,isActiveColumn:ct}),tt,Q,";label:Column;"],ref:Y,tabIndex:-1,role:"button",onKeyDown:function(){},title:p("COM_SPPAGEBUILDER_EDITOR_COLUMN_CLICK_TITLE"),onClick:function(t){t.target===E.current.element&&(R("column",{sectionIndex:n,columnIndex:i,addonIndex:null}),rt(jo(jo({},ot()),{},{settings:it({sectionIndex:n,columnIndex:i})})))},children:[(0,h.tZ)("button",{type:"button",id:e.id.toString(),css:ko.emptyColumnButton({isActiveColumn:ct}),disabled:!Z,title:p("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(t){t.stopPropagation(),_(ct?void 0:"add-elements"),S(ct?null:"".concat(n,"-").concat(i))},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})}),st()]})}):(0,h.tZ)(Bt.Fo,{id:e.id.toString(),items:e.addons.filter((function(t){return!t.parent})),strategy:Bt.qw,children:(0,h.tZ)("div",{css:ko.columnWrap({width:e.settings.width}),tabIndex:-1,role:"button",onKeyDown:f.ZT,title:p("COM_SPPAGEBUILDER_EDITOR_COLUMN_CLICK_TITLE"),onClick:function(t){t.target===E.current.element&&(R("column",{sectionIndex:n,columnIndex:i,addonIndex:null}),rt(jo(jo({},ot()),{},{settings:it({sectionIndex:n,columnIndex:i})})))},children:(0,h.BX)("div",{id:e.id.toString(),css:[ko.column({isEditing:lt,isHidden:!Z,hideOutline:dt}),tt,Q,";label:Column;"],ref:Y,children:[e.addons.map((function(t,o){if("parent"in t&&t.parent)return null;if((0,te.m5)(t)){var l=A({id:t.id,rowId:I[n].id,columnId:e.id}),d=l.index,c=l.content;return(0,f.$K)(c)?(0,h.tZ)(Ko,{index:d,content:c,nestedRowData:{sectionIndex:n,columnIndex:i,addonIndex:o},placeholderPosition:a,disabled:J,parentVisibility:e.visibility,sectionType:r.t.NestedRow},t.id):null}return"div"===t.name?(0,h.tZ)(Co,{content:t,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:J,parentVisibility:e.visibility},t.id):(0,f.dA)(t.name)?(0,h.tZ)(Un,{content:t,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:J,parentVisibility:e.visibility},t.id):(0,he.Lx)(t.name)?(0,h.tZ)(So,{content:t,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:J,parentVisibility:e.visibility},t.id):Object.keys(r.RI).includes(t.name)||t.name===r.pb.name?(0,h.tZ)(oo,{content:t,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:J,parentVisibility:e.visibility},t.id):(0,h.tZ)(He,{content:t,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:J,parentVisibility:e.visibility},t.id)})),st()]})})})};var ko={columnWrap:function(t){var e=t.width;return(0,d.iv)("width:",e[r.zu],";height:100%;padding:",i.W0[8],";;label:columnWrap;")},column:function(t){var e=t.isEditing,n=t.isHidden,o=t.hideOutline;return(0,d.iv)("display:flex;flex-direction:column;align-items:center;gap:",i.W0[16],";padding:",i.W0[16],";background-color:",i.qo.base.white,";border-radius:",i.E0[2],";border:1px solid ",i.qo.stroke.neutral,";position:relative;",!o&&(0,d.iv)(":hover,:focus-within{border:1px solid ",i.qo.base.primary,";border-top-left-radius:0;border-top-right-radius:0;&>[data-column-drag-handler],&>[data-addon-paste-button]{opacity:1;}>button:first-of-type{opacity:1;}};label:column;")," ",e&&(0,d.iv)("border:1px solid ",i.qo.base.primary,";background-color:",(0,Jt.m4)(i.qo.background.primary,.4),";;label:column;")," ",n&&(0,d.iv)("background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:column;"),";;label:column;")},emptyColumnWrap:function(t){var e=t.isEditing,n=t.isHidden,o=t.hideOutline,r=t.isActiveColumn,a=t.isOver;return(0,d.iv)("position:relative;border:1px dashed ",i.qo.stroke.neutral,";border-radius:",i.E0[2],";",y.iZ.flexCenter(),";min-height:144px;width:100%;cursor:pointer;",!o&&(0,d.iv)(":hover,:focus-within{border:1px solid ",i.qo.base.primary,";border-top-left-radius:0;border-top-right-radius:0;&>[data-column-drag-handler],&>[data-addon-paste-button]{opacity:1;}>button:nth-of-type(2){opacity:1;}};label:emptyColumnWrap;")," ",e&&(0,d.iv)("border:1px solid ",i.qo.base.primary,";background-color:",(0,Jt.m4)(i.qo.background.primary,.4),";;label:emptyColumnWrap;")," ",n&&(0,d.iv)("background-color:",i.qo.base.surface,";background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:emptyColumnWrap;")," ",r&&(0,d.iv)("background-color:",i.qo.background.neutral,";;label:emptyColumnWrap;")," ",a&&(0,d.iv)("background-color:",i.qo.background.hover,";;label:emptyColumnWrap;"),";;label:emptyColumnWrap;")},emptyColumnButton:function(t){var e=t.isActiveColumn;return(0,d.iv)(y.iZ.resetButton,";position:absolute;inset:",i.W0[16],";",y.iZ.flexCenter(),";cursor:pointer;svg{color:",i.qo.icon.default,";}:hover{svg{color:",i.qo.icon.hover,";}}",e&&(0,d.iv)("svg{color:",i.qo.icon.default,";};label:emptyColumnButton;"),";;label:emptyColumnButton;")},columnSettings:(0,d.iv)(y.iZ.flexCenter(),";border-radius:",i.E0.circle,";width:16px;height:16px;background-color:",i.qo.base.primary,";color:",i.qo.base.white,";position:absolute;top:-8px;right:-8px;opacity:0;;label:columnSettings;"),clipboardButton:(0,d.iv)(y.iZ.resetButton,";",y.iZ.flexCenter(),";border-radius:",i.E0[4],";background-color:",i.qo.base.white,";padding:",i.W0[4],";position:absolute;top:-1px;left:50%;transform:translate(-50%, -50%);opacity:0;box-shadow:",i.AF.card,";z-index:",i.W5.modal,";svg{color:",i.qo.icon.default,";transition:color 0.3s ease;}:hover{svg{color:",i.qo.icon.primary,";}};label:clipboardButton;"),columnDragHandler:(0,d.iv)(y.iZ.resetButton,";",y.iZ.flexCenter(),";border-top-left-radius:",i.E0[4],";border-bottom-left-radius:",i.E0[4],";background-color:",i.qo.base.primary,";color:",i.qo.base.white,";width:12px;height:18px;position:absolute;top:-1px;left:0;transform:translateX(-100%);opacity:0;cursor:grab!important;;label:columnDragHandler;")};function Wo(t){return Wo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wo(t)}function Uo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function qo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Uo(Object(n),!0).forEach((function(e){No(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Uo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function No(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==Wo(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!==Wo(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Wo(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);d=!0);}catch(t){c=!0,r=t}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Mo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mo(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var Go=function(t){var e=t.copiedData,n=t.isHidden,o=t.isDeepAddonRow;return[{id:"settings",icon:"cog",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_SETTINGS",isDisabled:n},{id:"visibility",icon:"eyeSlash",title:"COM_SPPAGEBUILDER_EDITOR_ACTION_VISIBILITY_HIDE",isProFeature:!0},{id:"columns",icon:"verticalBars",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_COLUMNS_UPDATE",isDisabled:n},{id:"reset",icon:"update",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_RESET",isDisabled:n},{id:"save",icon:"saveLine",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_SAVE",isDisabled:n,isProFeature:!0},{id:"duplicate",icon:"cloneLine",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_DUPLICATE",isDisabled:n,hide:o},{id:"copy",icon:"copy",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_COPY",isDisabled:n,isProFeature:!0},{id:"paste",icon:"clipboard",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_PASTE_TO_REPLACE",isDisabled:!e.section||n,isProFeature:!0},{id:"remove",icon:"trash",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_REMOVE",variant:"critical",isDisabled:n,hide:o}]};const Ko=function(t){var e,n,i=t.content,l=t.index,d=t.placeholderPosition,s=t.nestedRowData,u=t.disabled,p=void 0!==u&&u,v=t.parentVisibility,b=void 0===v||v,y=t.sectionType,m=void 0===y?r.t.Section:y,g=(0,D.o)((function(t){return t.changeSectionVisibility})),I=(0,D.o)((function(t){return t.duplicateSection})),x=(0,D.o)((function(t){return t.duplicateNestedSection})),S=(0,D.o)((function(t){return t.copySection})),E=(0,D.o)((function(t){return t.pasteOrInsertSection})),_=(0,D.o)((function(t){return t.pasteOrInsertAsNestedSection})),P=(0,D.o)((function(t){return t.deleteSection})),L=(0,D.o)((function(t){return t.resetColumnWidth})),j=(0,D.o)((function(t){return t.deleteNestedSection})),B=(0,D.o)((function(t){return t.updateAdminLabel})),R=(0,D.o)((function(t){return t.page})),Z=(0,D.o)((function(t){return t.copiedData})),k=(0,O.T)().closeSettingPanel,W=(0,T.useRef)(null),U=(0,T.useRef)(null),q=(0,T.useRef)(null),M=$o((0,T.useState)(null),2),G=M[0],K=M[1],V=(0,c.$)(),H=(0,Ht.F)((function(t){return{type:t.type,payload:t.payload,setSettings:t.setSettings}})),Y=H.type,z=H.payload,J=H.setSettings,Q=(0,w._)().getSectionSettings,tt=(0,X.Gc)(),et=tt.reset,ot=tt.getValues,rt=!!i.parent,it=b&&i.visibility,at=m===r.t.DeepAddonRow,lt=(0,Bt.nB)({id:i.id,data:{type:m,isVisible:it,sectionIndex:l,content:i,nestedRowData:s},disabled:at}),dt=lt.attributes,ct=lt.listeners,st=lt.setNodeRef,ut=lt.isDragging,pt=lt.isOver,ft=lt.transform,vt=lt.transition,bt=lt.active,yt=lt.over,mt=$o((0,T.useState)(!0),2),ht=mt[0],gt=mt[1],It=(0,T.useRef)(ht),xt=$o((0,T.useState)({isOpen:!1,reason:""}),2),St=xt[0],Et=xt[1],Ot=(0,$.p)().showToast,wt=(0,F.l)({isOpen:St.isOpen,isDropdown:!0,arrow:"bottom"}),Dt=wt.triggerRef,At=wt.position,_t=wt.popoverRef,Ct=!it||p;(0,T.useEffect)((function(){It.current&>(!ut)}),[ut]),(0,T.useEffect)((function(){gt(!Ct),It.current=!Ct}),[Ct]);var Pt=function(){J("section",{sectionIndex:l,columnIndex:null,addonIndex:null});var t=Q(l);et(qo(qo({},ot()),{},{settings:t}))},Tt=Xt({position:d,contentId:i.id,active:bt,over:yt,type:m}),jt=C({transform:ft,transition:vt,isDragging:ut}),Zt="section"===Y&&z.sectionIndex===l,kt=p||ut||pt,Wt=(null==yt||null===(e=yt.data.current)||void 0===e?void 0:e.type)===r.t.Section&&(null==bt||null===(n=bt.data.current)||void 0===n?void 0:n.type)===r.t.NestedRow;return(0,h.BX)("div",{css:Yo.wrapper(Zt,kt),children:[(0,h.BX)("div",{css:[Yo.section(Zt,Ct,p),Tt,Wt?null:jt,";label:Section;"],ref:st,children:[(0,h.BX)("div",qo(qo(qo({css:Yo.actionBar(Ct),ref:W,title:V("COM_SPPAGEBUILDER_EDITOR_SECTION_CLICK_TITLE"),onKeyDown:f.ZT,onClick:function(t){t.target===W.current&&Pt()}},dt),ct),{},{role:"button",tabIndex:-1,children:[(0,h.BX)("div",{css:Yo.titleBar(at),title:"",children:[!at&&(0,h.tZ)(o.Z,{name:"dragger",width:32,height:32}),(0,h.tZ)("h5",{css:a.c.heading5(),children:(0,h.tZ)(Lt,{text:i.settings.admin_label||i.settings.title||(rt?"Row":"Section"),updateAdminLabel:function(t){B({label:t,row:{sectionIndex:l}})}})})]}),(0,h.BX)("div",{ref:q,css:Yo.actionButtons,children:[(0,h.tZ)("button",{type:"button",css:Yo.toggleButton(ht),title:V(ht?"COM_SPPAGEBUILDER_EDITOR_COLLAPSE":"COM_SPPAGEBUILDER_EDITOR_EXPAND"),onClick:function(){gt((function(t){return!t})),It.current=!It.current},children:(0,h.tZ)(o.Z,{name:"angleUp",width:28,height:28})}),(0,h.tZ)(Rt.Z,{actions:Go({copiedData:Z,isHidden:Ct,isDeepAddonRow:at}),width:180,triggerButtonContent:(0,h.tZ)("span",{css:Yo.settingsButton(p),title:V("COM_SPPAGEBUILDER_EDITOR_SECTION_SETTINGS"),children:(0,h.tZ)(o.Z,{name:"sliders"})}),onSelect:function(t){switch(t){case"settings":Pt();break;case"visibility":k(),g({sectionIndex:l,visibility:i.visibility}),Ot({type:"success",message:V("COM_SPPAGEBUILDER_EDITOR_VISIBILITY_CHANGED_SUCCESSFULLY")});break;case"duplicate":(0,f.$K)(s)?x(qo({nestedSectionIndex:l},s)):I({sectionIndex:l}),Ot({type:"success",message:V("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")});break;case"copy":S({sectionIndex:l}),Ot({type:"success",message:V("COM_SPPAGEBUILDER_EDITOR_COPIED_SUCCESSFULLY")});break;case"paste":var e,n;k(),(0,f.$K)(s)?_(qo(qo({nestedSectionIndex:l},s),{},{sectionData:null!==(e=Z.section)&&void 0!==e?e:[],replace:!0})):E({sectionIndex:l,sectionData:null!==(n=Z.section)&&void 0!==n?n:[],replace:!0}),Ot({type:"success",message:V("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")});break;case"reset":k(),L({sectionIndex:l});break;case"remove":k(),(0,f.$K)(s)?j(qo({nestedSectionIndex:l},s)):P({sectionIndex:l}),Ot({type:"success",message:V("COM_SPPAGEBUILDER_EDITOR_REMOVED_SUCCESSFULLY")});break;case"save":var o=(0,A.Nk)({sections:R,sectionIndex:l});(0,f.$K)(o)&&K({action:"save",data:JSON.stringify(o)});break;case"columns":Et({isOpen:!0,reason:"update"})}},visibilityStatus:i.visibility,disabled:p})]})]})),(0,h.tZ)(Bt.Fo,{id:i.id.toString(),items:i.columns,strategy:Bt.PG,children:(0,h.tZ)("div",{css:Yo.contents(ht),ref:U,title:V("COM_SPPAGEBUILDER_EDITOR_SECTION_CLICK_TITLE"),role:"button",tabIndex:-1,onKeyDown:f.ZT,onClick:function(t){t.target===U.current&&Pt()},children:(0,h.tZ)("div",{title:"",children:i.columns.map((function(t,e){return(0,h.tZ)(Zo,{content:t,sectionIndex:l,index:e,totalColumns:i.columns.length,placeholderPosition:d,parentVisibility:it,isDeepAddonColumn:at},t.id)}))})})})]}),(0,h.BX)("div",{css:Yo.bottomActionButtonsWrapper,"data-bottom-wrapper":!0,children:[at&&rt&&(0,h.tZ)("span",{ref:Dt}),!at&&(0,h.tZ)(N.Z,{ref:Dt,type:"button",onClick:function(){return Et({isOpen:!0,reason:"insert"})},icon:(0,h.tZ)(o.Z,{name:"plus"}),children:V(rt?"COM_SPPAGEBUILDER_EDITOR_ADD_ROW":"COM_SPPAGEBUILDER_EDITOR_ADD_SECTION")}),!rt&&!!Z.section&&(0,h.tZ)(N.Z,{ref:Dt,type:"button",variant:"secondary",buttonCss:Yo.pasteSectionButton,onClick:function(){(0,f.$K)(Z.section)&&(k(),E({sectionIndex:l,sectionData:Z.section,replace:!1}),Ot({type:"success",message:V("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}))},icon:(0,h.tZ)(o.Z,{name:"clipboard"}),children:V("COM_SPPAGEBUILDER_EDITOR_SECTION_PASTE_SECTION")})]}),(0,h.tZ)(nt,{isOpen:St.isOpen,defaultLayout:"update"===St.reason?i.layout:null,nestedRowData:s,handleClose:function(){return Et({isOpen:!1,reason:""})},position:At,popoverRef:_t,index:l}),(0,h.tZ)(Vt,{ref:q,type:"section",dataToSave:G,closePopover:function(){return K(null)}})]})};var Vo={name:"sxudyk-contents",styles:"display:none;height:0;opacity:0;padding:0;overflow:hidden;label:contents;"},Fo={name:"1bpgz68-toggleButton",styles:"transform:rotate(-180deg);label:toggleButton;"},Ho={name:"1nwp2q0-actionBar",styles:":hover{button:first-of-type{visibility:visible;opacity:1;}};label:actionBar;"},Xo={name:"1o7rgfq-section",styles:"background-color:transparent;label:section;"},Yo={wrapper:function(t,e){return(0,d.iv)("width:100%;position:relative;border:1px solid transparent;border-radius:",i.E0[6],";transition:border 0.3s ease-in-out;",!e&&(0,d.iv)(":hover{border:1px solid ",i.qo.base.primary,";&>[data-bottom-wrapper]{opacity:1;}};label:wrapper;")," ",t&&(0,d.iv)("border:1px solid ",i.qo.base.primary,";;label:wrapper;"),";;label:wrapper;")},section:function(t,e,n){return(0,d.iv)("width:100%;border-radius:",i.E0[6],";background-color:",i.qo.base.white,";position:relative;box-shadow:",i.AF.card,";",t&&(0,d.iv)("background-color:",(0,Jt.m4)(i.qo.background.primary,.4),";;label:section;")," ",e&&!n&&(0,d.iv)("background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:section;")," ",n&&Xo,";;label:section;")},bottomActionButtonsWrapper:(0,d.iv)("display:flex;justify-content:center;align-items:center;gap:",i.W0[8],";position:absolute;bottom:0;left:50%;transform:translate(-50%, 50%);opacity:0;transition:opacity 0.3s ease-in-out;;label:bottomActionButtonsWrapper;"),pasteSectionButton:(0,d.iv)("background-color:",i.qo.background.white,";svg{color:",i.qo.icon.default,";}:hover{svg{color:",i.qo.icon.primary,";}};label:pasteSectionButton;"),addSectionButton:(0,d.iv)(y.iZ.resetButton,";",y.iZ.flexCenter("row"),";",y.iZ.textEllipsis,";gap:",i.W0[8],";padding:",i.W0[6]," ",i.W0[16],";background-color:",i.qo.base.primary,";border-radius:",i.E0.button,";color:",i.qo.base.white,";line-height:",i.Nv[18],";;label:addSectionButton;"),actionBar:function(t){return(0,d.iv)("display:flex;justify-content:space-between;padding:",i.W0[24]," ",i.W0[24]," ",i.W0[24]," ",i.W0[12],";cursor:pointer;",!t&&Ho,";;label:actionBar;")},titleBar:function(t){return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[4],";padding-left:",i.W0[2],";cursor:grab;",t&&(0,d.iv)("padding-left:",i.W0[10],";cursor:initial;;label:titleBar;")," svg{color:",i.qo.icon.hints,";};label:titleBar;")},actionButtons:(0,d.iv)("display:flex;gap:",i.W0[16],";;label:actionButtons;"),toggleButton:function(t){return(0,d.iv)(y.iZ.resetButton,";padding:",i.W0[2],";transition:transform 0.3s ease,opacity 0.3s ease;visibility:hidden;opacity:0;svg{color:",i.qo.icon.default,";transition:color 0.3s ease-in-out;}:hover{svg{color:",i.qo.icon.hover,";border-color:",i.qo.stroke.hover,";}}:active{svg{color:",i.qo.icon.primary,";}}",!t&&Fo,";;label:toggleButton;")},settingsButton:function(t){return(0,d.iv)(y.iZ.centeredFlex,";border:1px solid ",i.qo.stroke.neutral,";border-radius:",i.E0[6],";width:32px;height:32px;svg{color:",i.qo.icon.default,";transition:color 0.3s ease-in-out;}",t&&(0,d.iv)("color:",i.qo.icon.disabled,";cursor:initial;;label:settingsButton;")," ",!t&&(0,d.iv)("background-color:",i.qo.background.white,";:hover{svg{color:",i.qo.icon.hover,";border-color:",i.qo.stroke.hover,";}};label:settingsButton;")," :active{svg{color:",i.qo.icon.primary,";}};label:settingsButton;")},contents:function(t){return(0,d.iv)("padding:0 ",i.W0[24]," ",i.W0[24],";cursor:pointer;>div{display:flex;flex-wrap:wrap;margin:-",i.W0[8],";cursor:initial;}",!t&&Vo,";;label:contents;")}};const zo=function(t){var e=t.isPopup,n=void 0!==e&&e,i=(0,D.o)((function(t){return t.page})),a=(0,O.T)().closeSettingPanel,d=(0,H.j)((function(t){return t.activeAction})),c=(0,H.j)((function(t){return t.setActiveAction})),v=function(){var t=(0,D.o)((function(t){return t.addNewAddon})),e=(0,D.o)((function(t){return t.addNewTableItemAddon})),n=(0,D.o)((function(t){return t.pasteOrInsertAddon})),o=(0,D.o)((function(t){return t.pasteOrInsertSection})),i=(0,D.o)((function(t){return t.pasteOrInsertAsNestedSection})),a=(0,D.o)((function(t){return t.addNewSection})),d=(0,D.o)((function(t){return t.addNestedRow})),c=(0,D.o)((function(t){return t.addNewColumn})),v=(0,D.o)((function(t){return t.sortSection})),b=(0,D.o)((function(t){return t.sortColumn})),y=(0,D.o)((function(t){return t.sortAddon})),m=(0,D.o)((function(t){return t.sortCollectionItemAddon})),h=(0,D.o)((function(t){return t.sortAddonWithCollectionItemAddon})),g=(0,D.o)((function(t){return t.addNewCollectionItemAddon})),I=(0,s.x)((function(t){return t.addonGroups})),x=(0,D.o)((function(t){return t.sortDCCollectionItemAddon})),S=(0,D.o)((function(t){return t.addNewDCCollectionItemAddon})),E=R((0,T.useState)(null),2),A=E[0],_=E[1],C=R((0,T.useState)(null),2),L=C[0],B=C[1],Z=(0,w._)().getSectionById,k=(0,O.T)().closeSettingPanel,U=function(){_(null),B(null)};(0,l.IJ)({onDragStart:function(t){var e,n=t.active,o=null===(e=n.data.current)||void 0===e?void 0:e.content;if(n.data.current&&o){var r=Object.values(I).flat().find((function(t){return t.name===o.name}));_(j(j(j(j({},o),!("icon"in o)&&(0,f.$K)(r)&&{icon:r.icon}),!("title"in o)&&(0,f.$K)(r)&&{title:r.title}),{},{type:n.data.current.type}))}else _(null)},onDragMove:function(t){var e,n,o,r=t.over,i=t.active.rect.current.translated,a=null==r?void 0:r.rect;if(!i||!a||null===(e=r.data.current)||void 0===e||!e.isVisible||(n=i,(o=a).left>n.right||o.right<n.left||o.top>n.bottom||o.bottom<n.top))return B(null);var l=i.top+i.height/2<a.top+a.height/2,d=i.left+i.width/2<a.left+a.width/2;B({isTop:l,isLeft:d})},onDragEnd:function(t){var e=t.active,n=t.over,o=e.data.current,i=null==n?void 0:n.data.current;o&&i&&e.id!==(null==n?void 0:n.id)&&W({active:e,over:n})?((0,f.r3)((0,f.zt)(r.Dw),o.type)?N({activeCurrent:o,overCurrent:i}):q({activeCurrent:o,overCurrent:i}),U(),k()):U()},onDragCancel:function(){U()}});var q=function(t){var e=t.activeCurrent,n=t.overCurrent;switch(n.type){case r.t.NestedRow:var o,i=n.nestedRowData;if(!(0,f.$K)(i))return;if((0,f.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],e.type))y({sourceSectionIndex:e.sectionIndex,sourceColumnIndex:e.columnIndex,sourceAddonIndex:e.addonIndex,sourceChildIndex:e.childIndex,destinationSectionIndex:i.sectionIndex,destinationColumnIndex:i.columnIndex,destinationAddonIndex:i.addonIndex,isAbove:null!==(o=null==L?void 0:L.isTop)&&void 0!==o&&o});else if(r.t.NestedRow===e.type){var a,l=e.nestedRowData;if(!(0,f.$K)(l))return;y({sourceSectionIndex:l.sectionIndex,sourceColumnIndex:l.columnIndex,sourceAddonIndex:l.addonIndex,destinationSectionIndex:i.sectionIndex,destinationColumnIndex:i.columnIndex,destinationAddonIndex:i.addonIndex,isAbove:null!==(a=null==L?void 0:L.isTop)&&void 0!==a&&a})}break;case r.t.Section:e.type===r.t.Section&&v({sourceSectionIndex:e.sectionIndex,destinationSectionIndex:n.sectionIndex});break;case r.t.Column:if(e.type===r.t.Column)b({sectionIndex:e.sectionIndex,sourceColumnIndex:e.columnIndex,destinationColumnIndex:n.columnIndex});else if((0,f.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],e.type))y({sourceSectionIndex:e.sectionIndex,sourceColumnIndex:e.columnIndex,sourceAddonIndex:e.addonIndex,sourceChildIndex:e.childIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:0,isAbove:!0});else if(r.t.NestedRow===e.type){var d=e.nestedRowData;if(!(0,f.$K)(d))return;y({sourceSectionIndex:d.sectionIndex,sourceColumnIndex:d.columnIndex,sourceAddonIndex:d.addonIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:0,isAbove:!0})}break;case r.t.Addon:case r.t.DeepAddon:case r.t.Div:case r.t.DCCollectionItemAddon:case r.t.DCCollectionAddonEmptyChild:case r.t.EmptyDivChild:var c,s=e,u=n;if(s.isRegularDivChild&&u.isDynamicContentChild||s.isDynamicContentChild&&u.isRegularDivChild||s.isDynamicContentChild&&u.isDynamicContentChild){var p;x({source:s,destination:u,isAbove:null!==(p=null==L?void 0:L.isTop)&&void 0!==p&&p,isEmptyState:r.t.DCCollectionAddonEmptyChild===n.type||r.t.EmptyDivChild===n.type});break}if((0,f.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon,r.t.DCCollectionItemAddon],e.type))y({sourceSectionIndex:e.sectionIndex,sourceColumnIndex:e.columnIndex,sourceAddonIndex:e.addonIndex,sourceChildIndex:e.childIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:n.addonIndex,destinationChildIndex:n.childIndex,isAbove:null!==(c=null==L?void 0:L.isTop)&&void 0!==c&&c,emptyDivChild:r.t.EmptyDivChild===n.type});else if(r.t.NestedRow===e.type){var g,I=e.nestedRowData;if(!(0,f.$K)(I))return;y({sourceSectionIndex:I.sectionIndex,sourceColumnIndex:I.columnIndex,sourceAddonIndex:I.addonIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:n.addonIndex,isAbove:null!==(g=null==L?void 0:L.isTop)&&void 0!==g&&g})}break;case r.t.CollectionItemAddon:var S,E;if((!P(e.content)||!e.content.name.includes("_single_")&&!e.content.name.includes("_common_"))&&e.type===r.t.Addon||e.type===r.t.Div)return void h({sourceSectionIndex:e.sectionIndex,sourceColumnIndex:e.columnIndex,sourceAddonIndex:e.addonIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:n.addonIndex,destinationItemAddonIndex:n.itemAddonIndex,isAbove:null!==(E=null==L?void 0:L.isTop)&&void 0!==E&&E});if(e.itemIndex!==n.itemIndex||!(0,f.$K)(e.itemAddonIndex)||!(0,f.$K)(n.itemAddonIndex))return;m({sourceSectionIndex:e.sectionIndex,sourceColumnIndex:e.columnIndex,sourceAddonIndex:e.addonIndex,sourceItemAddonIndex:e.itemAddonIndex,destinationItemAddonIndex:n.itemAddonIndex,sourceChildIndex:e.childIndex,destinationChildIndex:n.childIndex,isAbove:null!==(S=null==L?void 0:L.isTop)&&void 0!==S&&S,isEmptyChild:n.isEmptyChild})}},N=function(l){var s=l.activeCurrent,v=l.overCurrent;switch(v.type){case r.t.NestedRow:var b,y=v.nestedRowData;if(!(0,f.$K)(y))return;if((0,f.r3)([r.Dw.AddonElement,r.Dw.DivElement],s.type))t({sectionIndex:y.sectionIndex,columnIndex:y.columnIndex,addonIndex:y.addonIndex,addon:s.content,isAbove:null===(b=null==L?void 0:L.isTop)||void 0===b||b});else if((0,f.r3)([r.Dw.RowElement],s.type)){var m;d({sectionIndex:y.sectionIndex,columnIndex:y.columnIndex,addonIndex:y.addonIndex,isTop:null===(m=null==L?void 0:L.isTop)||void 0===m||m})}else if((0,f.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var h,I=null;if((0,u.fp)(s.content)){var x=s.content.section;I=(0,f.Rx)(x)}if((0,p.L)(s.content)){var E=s.content.json;I=(0,f.Rx)(E)}if(!(0,f.$K)(I))return;var O=Z(I[0].id).index;i({sectionData:I,sectionIndex:y.sectionIndex,columnIndex:y.columnIndex,addonIndex:y.addonIndex,nestedSectionIndex:O,isAbove:null===(h=null==L?void 0:L.isTop)||void 0===h||h})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var w,D=s.content.code,A=(0,f.Rx)(D);if(!(0,f.$K)(A))return;var _=(0,f.gX)(A)?{name:A.name,sections:A.rows,addons:A.addon}:A;n({addonData:_,sectionIndex:y.sectionIndex,columnIndex:y.columnIndex,addonIndex:y.addonIndex,isAbove:null===(w=null==L?void 0:L.isTop)||void 0===w||w})}break;case r.t.Section:if(r.Dw.RowElement===s.type){var C,P=null===(C=null==L?void 0:L.isTop)||void 0===C||C;a({layout:"6+6",index:P?v.sectionIndex:v.sectionIndex+1})}else if((0,f.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var T,j=null;if((0,u.fp)(s.content)){var B=s.content.section;j=(0,f.Rx)(B)}if((0,p.L)(s.content)){var R=s.content.json;j=(0,f.Rx)(R)}if(!(0,f.$K)(j))return;o({sectionData:j,sectionIndex:v.sectionIndex,isAbove:null===(T=null==L?void 0:L.isTop)||void 0===T||T})}break;case r.t.Column:if(r.Dw.ColumnsElement===s.type){var k,W=null===(k=null==L?void 0:L.isLeft)||void 0===k||k;c({sectionIndex:v.sectionIndex,index:W?v.columnIndex:v.columnIndex+1})}else if((0,f.r3)([r.Dw.RowElement],s.type))d({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:0,isTop:!0});else if((0,f.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var U,q=null;if((0,u.fp)(s.content)){var N=s.content.section;q=(0,f.Rx)(N)}if((0,p.L)(s.content)){var $=s.content.json;q=(0,f.Rx)($)}if(!(0,f.$K)(q))return;var M=Z(q[0].id).index;i({sectionData:q,sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:(0,f.$K)(v.addonIndex)?v.addonIndex:0,nestedSectionIndex:M,isAbove:null===(U=null==L?void 0:L.isTop)||void 0===U||U})}else if((0,f.r3)([r.Dw.AddonElement,r.Dw.DivElement,r.Dw.CommonAddonElement,r.Dw.SingleAddonElement],s.type)||[r.oA.filter,r.oA.pagination].includes(s.content.name)){var G,K=s.content;t({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,childIndex:v.childIndex,addon:K,isAbove:null===(G=null==L?void 0:L.isTop)||void 0===G||G})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var V=s.content.code,F=(0,f.Rx)(V);if(!(0,f.$K)(F))return;var H=(0,f.gX)(F)?{name:F.name,sections:F.rows,addons:F.addon}:F;n({addonData:H,sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:0,isAbove:!0})}break;case r.t.EmptyDivChild:if((0,f.r3)([r.Dw.AddonElement,r.Dw.DivElement,r.Dw.ProductListAddonElement,r.Dw.CategoryListAddonElement,r.Dw.SingleAddonElement,r.Dw.CommonAddonElement],s.type)||[r.oA.filter,r.oA.productList,r.oA.categoryList,r.oA.pagination].includes(s.content.name)){var X=s.content;t({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,childIndex:0,emptyDivChild:!0,addon:X,isAbove:!0})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var Y=s.content.code,z=(0,f.Rx)(Y);if(!(0,f.$K)(z))return;var J={name:z.name,sections:z.rows,addons:z.addon};n({addonData:J,sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,childIndex:0,parentId:v.content.id,isAbove:!0})}break;case r.t.Addon:case r.t.DeepAddon:case r.t.Div:var Q;if((0,f.r3)([r.Dw.AddonElement,r.Dw.DivElement,r.Dw.SingleAddonElement,r.Dw.CommonAddonElement],s.type)||[r.oA.filter,r.oA.pagination].includes(s.content.name))t({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,childIndex:v.childIndex,addon:s.content,isAbove:null===(Q=null==L?void 0:L.isTop)||void 0===Q||Q});else if((0,f.r3)([r.Dw.RowElement],s.type)&&!v.content.parent){var tt;d({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,isTop:null===(tt=null==L?void 0:L.isTop)||void 0===tt||tt})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var et,nt=s.content.code,ot=(0,f.Rx)(nt);if(!(0,f.$K)(ot))return;var rt={name:ot.name,sections:ot.rows,addons:ot.addon};n({addonData:rt,sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,childIndex:v.childIndex,isAbove:null===(et=null==L?void 0:L.isTop)||void 0===et||et})}else if((0,f.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var it,at=null;if((0,u.fp)(s.content)){var lt=s.content.section;at=(0,f.Rx)(lt)}if((0,p.L)(s.content)){var dt=s.content.json;at=(0,f.Rx)(dt)}if(!(0,f.$K)(at))return;var ct=Z(at[0].id).index;i({sectionData:at,sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,nestedSectionIndex:ct,isAbove:null===(it=null==L?void 0:L.isTop)||void 0===it||it})}break;case r.t.TableItem:if((0,f.r3)([r.Dw.AddonElement],s.type)&&(0,f.$K)(v.tableItem)){var st,ut=s.content;e({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,childIndex:v.childIndex,tableItem:v.tableItem,addon:ut,isAbove:null===(st=null==L?void 0:L.isTop)||void 0===st||st})}break;case r.t.CollectionItemAddon:var pt;g({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,itemAddonIndex:(0,f.$K)(v.itemAddonIndex)?v.itemAddonIndex:0,childIndex:v.childIndex,addon:s.content,isAbove:null===(pt=null==L?void 0:L.isTop)||void 0===pt||pt});break;case r.t.DCCollectionAddonEmptyChild:case r.t.DCDivAddonEmptyChild:var ft;S({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addon:s.content,isAbove:null===(ft=null==L?void 0:L.isTop)||void 0===ft||ft,overItem:v.content,isEmptyState:[r.t.DCCollectionAddonEmptyChild,r.t.DCDivAddonEmptyChild].includes(v.type)});break;case r.t.DCCollectionItemAddon:var vt,bt;if(null!==(vt=v.content)&&void 0!==vt&&vt.parent){var yt;t({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,childIndex:v.childIndex,addon:s.content,isAbove:null===(yt=null==L?void 0:L.isTop)||void 0===yt||yt});break}S({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addon:s.content,isAbove:null===(bt=null==L?void 0:L.isTop)||void 0===bt||bt,overItem:v.content,isEmptyState:[r.t.DCCollectionAddonEmptyChild,r.t.DCDivAddonEmptyChild].includes(v.type)});break;case r.XA:if((0,f.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var mt,ht=null;if((0,u.fp)(s.content)){var gt=s.content.section;ht=(0,f.Rx)(gt)}if((0,p.L)(s.content)){var It=s.content.json;ht=(0,f.Rx)(It)}if(!(0,f.$K)(ht))return;o({sectionData:ht,sectionIndex:v.sectionIndex,isAbove:null===(mt=null==L?void 0:L.isTop)||void 0===mt||mt})}}};return{dragElement:A,placeholderPosition:L}}(),b=v.dragElement,y=v.placeholderPosition;return(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{css:Jo.contentWrapper,children:[(0,h.tZ)(Ot,{isPopup:n}),(0,h.tZ)("div",{css:Jo.content,children:i.length>0?(0,h.tZ)(Bt.Fo,{id:"page",items:i,strategy:Bt.qw,children:(0,h.tZ)("div",{css:Jo.sectionWrapper,role:"button",tabIndex:-1,onKeyDown:f.ZT,onClick:function(t){t.currentTarget===t.target&&((0,f.$K)(d)?c(void 0):a())},children:i.map((function(t,e){return t.parent?null:(0,h.tZ)(Ko,{content:t,index:e,placeholderPosition:y},t.id)}))})}):(0,h.tZ)("div",{css:Jo.emptyLayoutWrapper,role:"button",tabIndex:-1,onKeyDown:f.ZT,onClick:function(t){t.currentTarget===t.target&&((0,f.$K)(d)?c(void 0):a())},children:!(0,f.$K)(b)||b.type!==r.Dw.BlockElement&&b.type!==r.Dw.SavedSectionElement?(0,h.tZ)(ft,{isPopup:n}):(0,h.tZ)(U,{id:(0,f.x0)(),customStyle:Jo.emptyChildren,data:{type:r.XA,isVisible:!0,sectionIndex:0},children:(0,h.tZ)("button",{children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})})})})]}),(0,h.tZ)(x,{content:b})]})};var Jo={contentWrapper:{name:"4t0hh5-contentWrapper",styles:"height:100%;label:contentWrapper;"},content:{name:"tdw2b0-content",styles:"height:calc(100% - 101px);label:content;"},sectionWrapper:(0,d.iv)("height:100%;padding:",i.W0[32],";display:flex;flex-direction:column;gap:",i.W0[32],";position:relative;cursor:default;;label:sectionWrapper;"),emptyLayoutWrapper:(0,d.iv)("height:100%;padding:",i.W0[32],";cursor:default;;label:emptyLayoutWrapper;"),emptyChildren:(0,d.iv)("background-color:",i.qo.background.white,";border:1px dashed ",i.qo.stroke.neutral,";border-radius:",i.E0[6],";button{",y.iZ.resetButton,";width:100%;height:300px;",y.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";};label:emptyChildren;")}}}]);