| Current Path : /home/ataenra/www/administrator/components/com_sppagebuilder/assets/editor/dist/js/ |
| Current File : /home/ataenra/www/administrator/components/com_sppagebuilder/assets/editor/dist/js/547.min.js |
/*! For license information please see 547.min.js.LICENSE.txt */
"use strict";(self.webpackChunkreact_typescript_webpack_backend_editor=self.webpackChunkreact_typescript_webpack_backend_editor||[]).push([[547],{4547:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ao});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);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var b=function(e){return"object"===f(e)&&null!==e&&!("id"in e)&&"name"in e},v=n(1921),y=n(230),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(e){var t=e.content,n=(0,c.$)(),i=(0,s.x)((function(e){return e.addonStructure}));return t?(0,m.createPortal)((0,h.tZ)(l.y9,{dropAnimation:g,children:function(){if(b(t))return(0,h.BX)("div",{css:S.addonItem,children:[(0,h.tZ)("span",{dangerouslySetInnerHTML:{__html:t.icon}}),(0,h.tZ)("span",{children:t.title})]});if((0,u.$F)(t)&&t.type===r.Dw.SavedAddonElement)return(0,h.BX)("div",{css:S.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:(e=t,a=(0,y.Rx)(e.code).name,i[a].icon)}}),(0,h.tZ)("span",{"data-addon-title":!0,children:t.title})]});var e,a;if(t.type===r.Dw.SavedSectionElement)return(0,h.BX)("div",{css:S.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:t.title})]});if((0,p.L)(t)&&t.type===r.Dw.BlockElement)return(0,h.BX)("div",{css:S.sectionThumb,children:[(0,h.tZ)("div",{css:S.thumbImage,children:(0,h.tZ)("img",{src:t.thumb,alt:t.title,draggable:!1})}),(0,h.tZ)("div",{css:S.thumbFooter,children:t.title})]});if((0,y.r3)(I,t.type)){var l=t.type===r.t.NestedRow?"COM_SPPAGEBUILDER_EDITOR_OVERLAY_NESTED_ROW_TITLE":"COM_SPPAGEBUILDER_EDITOR_OVERLAY_SECTION_TITLE";return(0,h.BX)("div",{css:S.placedAddon(t.type),children:[(0,h.BX)("div",{css:S.iconAndTitle(t.type),children:[(0,h.tZ)(o.Z,{name:"dragger"}),(0,h.tZ)("span",{children:n(l)})]}),(0,h.tZ)("span",{css:S.settingsButton,children:(0,h.tZ)(o.Z,{name:"sliders"})})]})}return t.type===r.t.Column?(0,h.BX)("div",{css:S.placedAddon(t.type),children:[(0,h.BX)("div",{css:S.iconAndTitle(t.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:S.dragHandler(t.type),"data-addon-drag-handler":!0,children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})})]}):(0,h.BX)("div",{css:S.placedAddon(t.type),children:[(0,h.BX)("div",{css:S.iconAndTitle(t.type),children:[(0,h.tZ)("span",{dangerouslySetInnerHTML:{__html:t.icon}}),(0,h.tZ)("span",{children:t.title})]}),(0,h.tZ)("button",{type:"button",css:S.dragHandler(t.type),"data-addon-drag-handler":!0,children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})})]})}()}),document.body):null};var E={name:"ebhkkd-placedAddon",styles:"border-top-left-radius:0;label:placedAddon;"},S={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(),";",v.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(),";",v.iZ.textEllipsis,";color:",i.qo.text.default,";};label:savedAddon;"),placedAddon:function(e){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,y.r3)(I,e)&&E," ",(0,y.r3)(I,e)&&(0,d.iv)("width:100%;border-color:",i.qo.stroke.primary,";border-radius:",i.E0[6],";height:80px;;label:placedAddon;")," ",e===r.t.Column&&(0,d.iv)("border-color:",i.qo.stroke.primary,";height:42px;;label:placedAddon;")," ",e===r.t.Div&&(0,d.iv)("border-color:",i.qo.alternate.div,";;label:placedAddon;"),";;label:placedAddon;")},dragHandler:function(e){return(0,d.iv)(v.iZ.resetButton,";",v.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;",e===r.t.Column&&(0,d.iv)("background-color:",i.qo.stroke.primary,";;label:dragHandler;")," ",e===r.t.Div&&(0,d.iv)("background-color:",i.qo.alternate.div,";;label:dragHandler;"),";;label:dragHandler;")},iconAndTitle:function(e){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,y.r3)(I,e)&&(0,d.iv)(":first-of-type{color:",i.qo.icon.default,";height:32px;width:32px;};label:iconAndTitle;")," ",((0,y.r3)(I,e)||e===r.t.Column)&&(0,d.iv)("color:",i.qo.stroke.primary,";;label:iconAndTitle;")," ",e===r.t.Div&&(0,d.iv)("color:",i.qo.alternate.div,";;label:iconAndTitle;"),";}&>span{",a.c.caption(),";",(0,y.r3)(I,e)&&(0,d.iv)(a.c.heading5(),";;label:iconAndTitle;"),";};label:iconAndTitle;")},settingsButton:(0,d.iv)(v.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(6131),A=n(2238),_=n(4285),P=function(e){var t=e.disable,n=void 0!==t&&t,o=e.isDragging,r=e.transition,i=e.transform;return n?null:{transform:_.ux.Transform.toString(i),transition:r,opacity:o?.5:void 0}},C=n(7294);function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function L(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==j(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==j(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===j(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return B(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(e,t):void 0}}(e,t)||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 B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function j(e){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}var k=function(e){var t,n,o=e.active,i=e.over,a=null==o?void 0:o.data.current,l=null==i?void 0:i.data.current,d=null;if((null==l?void 0:l.type)===r.t.TableItem&&b(null==a?void 0:a.content)){var c,s=(null!==(c=null==a?void 0:a.content)&&void 0!==c?c:{}).name;if((0,y.r3)(["accordion","tab","table_advanced"],s))return!1}if((0,y.$K)(l)){var u=l.type;(0,y.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],u)&&(n=l.content,(0,y.Kn)(n)&&(0,y.nr)(n,"id")&&(0,y.nr)(n,"settings"))&&l.content.parent&&(u=r.t.EmptyDivChild),d=(0,y.r3)((0,y.zt)(r.Dw),null==a?void 0:a.type)?r.LP[u]:r.IR[u]}if(!(0,y.$K)(d))return!1;if(b(null==a?void 0:a.content)&&(0,A.K0)(null!==(t=null==a?void 0:a.content.name)&&void 0!==t?t:"")&&(null==l?void 0:l.type)!==r.t.CollectionItemAddon)return!1;var p=function(e){return"object"===j(e)&&null!==e&&"name"in e},f=d.accepted.length>0&&((0,y.r3)(d.accepted,null==a?void 0:a.type)||p(null==a?void 0:a.content)&&(0,y.r3)(d.accepted,null==a?void 0:a.content.name)),v=d.rejected.length>0&&!(0,y.r3)(d.rejected,null==a?void 0:a.type)&&(!p(null==a?void 0:a.content)||p(null==a?void 0:a.content)&&!(0,y.r3)(d.rejected,null==a?void 0:a.content.name));return f||v||r.Eb in d};const W=function(e){var t,n=e.id,o=e.data,r=e.disabled,i=void 0!==r&&r,a=e.isHidden,d=void 0!==a&&a,s=e.children,u=e.customStyle,p=(0,c.$)(),f=(0,l.Zj)({id:n,data:o,disabled:i}),b=f.setNodeRef,v=f.isOver,y=f.active,m=f.over,g=k({active:y,over:m});return(0,h.tZ)("div",{css:[u,U.container(v,d,g),";label:Droppable;"],ref:b,children:!g&&v?(0,h.tZ)("div",{css:U.notAllowed(null==m||null===(t=m.data.current)||void 0===t?void 0:t.type),children:(0,h.tZ)("span",{children:p("COM_SPPAGEBUILDER_EDITOR_ADDON_NOT_ALLOWED")})}):s})};var U={container:function(e,t,n){return(0,d.iv)(e&&!t&&n&&(0,d.iv)("background-color:",i.qo.base.surface,";;label:container;")," ",e&&!t&&!n&&(0,d.iv)("background-color:",i.qo.background.error,";;label:container;"),";;label:container;")},notAllowed:function(e){var t=e===r.t.TableItem?"40px":"100px";return(0,d.iv)("height:",t,";",v.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;")}},q=n(3871),N=n(1309),$=n(1709),M=n(802),G=n(1954),K=n(1073),V=n(7536),F=n(5350);function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){z(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function z(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==H(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==H(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===H(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var J=[{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 Q=function(e){var t=e.isOpen,n=e.defaultLayout,r=e.nestedRowData,i=e.handleClose,a=e.position,l=e.popoverRef,d=e.index,s=(0,c.$)(),u=(0,M.O)(),p=u.control,f=u.setValue,b=u.getValues,v=u.watch;(0,C.useEffect)((function(){(0,y.$K)(n)&&f("layout",n.replaceAll(",","+"))}),[n,f]);var m=(0,D.o)((function(e){return e.addNewSection})),g=v("layout"),I=(0,D.o)((function(e){return e.addNestedRow})),x=(0,D.o)((function(e){return e.updateSectionLayout})),E=(0,K.j)((function(e){return e.setActiveAction})),S=function(){f("layout",""),i()},O=function(e){(0,y.$K)(n)?x({index:d,layout:e}):(0,y.$K)(r)?I(Y(Y({},r),{},{layout:e,isTop:!1})):m({layout:e,index:d+1}),S()};return(0,h.tZ)(G.h,{isOpen:t,onClickOutside:S,children:(0,h.tZ)("div",{css:[ee.popoverWrapper,{left:a.left,top:a.top},";label:SectionPopover;"],ref:l,children:(0,h.BX)("div",{css:ee.wrapper,children:[(0,h.BX)("div",{css:ee.importLayout,children:[(0,h.BX)("div",{css:ee.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:ee.importLayoutText,children:s("COM_SPPAGEBUILDER_EDITOR_IMPORT_LAYOUT_DESCRIPTION")}),(0,h.tZ)(q.Z,{variant:"secondary",buttonCss:ee.importLayoutButton,onClick:function(){i(),E("section-library")},children:"Explore"})]}),(0,h.BX)("div",{css:ee.selectLayout,children:[(0,h.tZ)("button",{css:ee.closeButton,onClick:S,children:(0,h.tZ)(o.Z,{name:"cross",width:20,height:20})}),(0,h.tZ)("div",{css:ee.layoutOptions,children:J.map((function(e){return(0,h.BX)("button",{type:"button",css:ee.layoutButton,onClick:function(){O(e.size)},children:[(0,h.tZ)(o.Z,{name:e.icon,width:50,height:20}),(0,h.tZ)("div",{children:e.size})]},e.id)}))}),(0,h.BX)("div",{css:ee.generateLayout,children:[(0,h.tZ)("p",{css:ee.customRows,children:s("COM_SPPAGEBUILDER_EDITOR_CREATE_CUSTOM_LAYOUT")}),(0,h.BX)("div",{css:ee.generateForm,children:[(0,h.tZ)(V.Qr,{control:p,name:"layout",render:function(e){return(0,h.tZ)(F.Z,Y(Y({},e),{},{placeholder:"e.g. 8+4"}))}}),(0,h.tZ)(q.Z,{variant:"primary",disabled:!g,onClick:function(){var e=b("layout");O(e)},children:(0,y.$K)(n)?s("COM_SPPAGEBUILDER_EDITOR_UPDATE"):s("COM_SPPAGEBUILDER_EDITOR_GENERATE")})]})]})]})]})})})};var ee={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)(v.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)(v.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;")},te=n(9194);function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const oe=function(){var e,t,n=(0,C.useRef)(null),r=(0,c.$)(),i=(0,$.d)().showModal,l=(e=(0,C.useState)(!1),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ne(e,t):void 0}}(e,t)||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.")}()),d=l[0],s=l[1],u=(0,V.Gc)(),p=(0,te.HX)(),f=(0,G.l)({isOpen:d,isDropdown:!0,arrow:"middle"}),b=f.triggerRef,v=f.position,y=f.popoverRef;return(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{css:re.wrapper,ref:b,children:[(0,h.tZ)("h4",{css:[a.c.heading4("medium"),";label:EmptyLayout;"],children:r("COM_SPPAGEBUILDER_EDITOR_START_CREATING")}),(0,h.BX)("div",{css:re.buttonWrapper,children:[(0,h.tZ)(q.Z,{variant:"secondary",icon:(0,h.tZ)(o.Z,{name:"layout"}),onClick:function(){i({component:N.Z,props:{title:r("COM_SPPAGEBUILDER_EDITOR_LAYOUT_MODAL_LAYOUTS"),form:u},closeOnOutsideClick:!0})},children:r("COM_SPPAGEBUILDER_EDITOR_LAYOUT_BUNDLES")}),(0,h.tZ)(q.Z,{variant:"primary",icon:(0,h.tZ)(o.Z,{name:"plus"}),onClick:function(){return s(!0)},children:r("COM_SPPAGEBUILDER_EDITOR_ADD_NEW_SECTION")})]}),(0,h.BX)("p",{css:re.importLayout,children:[r("COM_SPPAGEBUILDER_EDITOR_OR"),(0,h.tZ)("button",{type:"button",onClick:function(){var e;return null===(e=n.current)||void 0===e?void 0:e.click()},children:r("COM_SPPAGEBUILDER_EDITOR_IMPORT_LAYOUT")}),(0,h.tZ)("input",{ref:n,type:"file",hidden:!0,onChange:function(e){e.target.files&&(p.mutate(e.target.files[0]),e.target.value="")}})]})]}),(0,h.tZ)(Q,{isOpen:d,handleClose:function(){return s(!1)},position:v,popoverRef:y,index:0})]})};var re={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{",v.iZ.resetButton,";color:",i.qo.action.primary.default,";padding:0;};label:importLayout;")},ie=n(8138),ae=n(2447),le=n(2328),de=n(7679);function ce(e){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ce(e)}function se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?se(Object(n),!0).forEach((function(t){pe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pe(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==ce(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==ce(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ce(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const be=function(){var e,t,n,i=(0,c.$)(),a=(0,V.Gc)(),l=(t=(0,C.useState)(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fe(e,t):void 0}}(t,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.")}()),d=l[0],s=l[1],u=a.getValues("title"),p=(0,ae.Z)(ie.F.PageEditor),f=p.id,b=p.type,v=(0,de.z1)(f),m=(0,le.v)((function(e){return e.appConfig}));(0,C.useEffect)((function(){var e;(null===(e=v.data)||void 0===e?void 0:e.extension)===r.HZ.extension&&s(!0)}),[v.data]);var g=(0,C.useMemo)((function(){return v.data?v.data.url:""}),[v.data]);return(0,h.BX)("div",{css:he.wrapper(d),children:[(0,h.BX)("div",{css:he.fieldAndButton(d),children:[(0,h.tZ)("div",{css:he.inputWrapper(d),children:(0,h.tZ)(V.Qr,{control:a.control,name:"title",render:function(e){return(0,h.tZ)(F.Z,ue(ue({},e),{},{label:i("COM_SPPAGEBUILDER_EDITOR_PAGE_NAME"),placeholder:i("COM_SPPAGEBUILDER_EDITOR_PAGE_NAME")}))}})}),d&&(0,h.tZ)("div",{css:he.pageName,children:u||i("COM_SPPAGEBUILDER_EDITOR_PAGE_NAME")}),!!m.enable_frontend_editing&&(0,h.BX)("a",{css:he.frontendEditorButton(d),href:(0,y.$K)(b)?"".concat(g,"&product=").concat(b):g,target:"_blank",rel:"noreferrer",children:[(0,h.tZ)(o.Z,{name:"parmaLink",width:16,height:16}),(0,h.tZ)("span",{children:i("COM_SPPAGEBUILDER_EDITOR_FRONTEND_EDITOR")})]})]}),r.HZ.extension!==(null===(e=v.data)||void 0===e?void 0:e.extension)&&(0,h.tZ)("button",{type:"button",css:he.drawerHook(d),onClick:function(){return s((function(e){return!e}))},"data-drawer":!0,children:(0,h.tZ)(o.Z,{name:"angleUp"})})]})};var ve={name:"g85fjd-drawerHook",styles:"svg{transform:rotate(-180deg);};label:drawerHook;"},ye={name:"1n6ug0d-fieldAndButton",styles:"align-items:center;label:fieldAndButton;"},me={name:"1dw40py-inputWrapper",styles:"overflow:hidden;opacity:0;width:0;height:0;label:inputWrapper;"},he={wrapper:function(e){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;",e&&(0,d.iv)("padding:",i.W0[6]," ",i.W0[36],";&:hover{&>[data-drawer]{bottom:0;}};label:wrapper;"),";;label:wrapper;")},inputWrapper:function(e){return(0,d.iv)("width:100%;opacity:1;transition:opacity 0.3s ease-in-out,height 0.3s ease-in-out;",e&&me,";;label:inputWrapper;")},pageName:(0,d.iv)(a.c.body("medium"),";width:100%;;label:pageName;"),fieldAndButton:function(e){return(0,d.iv)("width:100%;display:flex;gap:",i.W0[16],";align-items:end;",e&&ye,";;label:fieldAndButton;")},frontendEditorButton:function(e){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;}",!e&&(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(e){return(0,d.iv)(v.iZ.resetButton,";",v.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;",e&&(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;}",e&&ve,";;label:drawerHook;")}},ge=n(7025);function Ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xe(e,t):void 0}}(e,t)||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 xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const Ee=function(e){var t=e.text,n=e.updateAdminLabel,r=(0,c.$)(),i=Ie((0,C.useState)(!1),2),a=i[0],l=i[1],d=Ie((0,C.useState)(t),2),s=d[0],u=d[1],p=(0,O.T)().closeSettingPanel;return(0,h.tZ)("div",{css:Se.wrapper,children:a?(0,h.tZ)(h.HY,{children:(0,h.tZ)("div",{css:Se.textInputWrapper,children:(0,h.tZ)(ge.Z,{value:s,onChange:function(e){return u(e)},onKeyDown:function(e,t){t.stopPropagation(),"Escape"===e&&l(!1),"Enter"===e&&(n(s),p(),l(!1))},onBlur:function(){return l(!1)},focusOnMount:!0})})}):(0,h.BX)(h.HY,{children:[(0,h.tZ)("span",{children:t}),(0,h.tZ)(q.Z,{title:r("COM_SPPAGEBUILDER_EDITOR_CLICK_EDIT_NAME"),variant:"text",icon:(0,h.tZ)(o.Z,{name:"pencil",height:10,width:10}),onClick:function(e){e.stopPropagation(),l(!0)}})]})})};var Se={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;"}},Oe=n(1731),we=n(5587),De=n(9101),Ae=n(3722),_e=n(6680),Pe=n(1030);function Ce(e){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ce(e)}function Te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(n),!0).forEach((function(t){Le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Le(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Ce(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Ce(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ce(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ze(){Ze=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),l=new w(r||[]);return o(a,"_invoke",{value:x(e,n,l)}),a}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function p(){}function f(){}function b(){}var v={};d(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(D([])));m&&m!==t&&n.call(m,i)&&(v=m);var h=b.prototype=p.prototype=Object.create(v);function g(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function r(o,i,a,l){var d=s(e[o],e,i);if("throw"!==d.type){var c=d.arg,u=c.value;return u&&"object"==Ce(u)&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,l)}))}l(d.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function x(e,t,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=E(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(e,t,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 E(e,t){var n=t.method,o=e.iterator[n];if(void 0===o)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var r=s(o,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function D(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function t(){for(;++o<e.length;)if(n.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:A}}function A(){return{value:void 0,done:!0}}return f.prototype=b,o(h,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:f,configurable:!0}),f.displayName=d(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,d(e,l,"GeneratorFunction")),e.prototype=Object.create(h),e},e.awrap=function(e){return{__await:e}},g(I.prototype),d(I.prototype,a,(function(){return this})),e.AsyncIterator=I,e.async=function(t,n,o,r,i){void 0===i&&(i=Promise);var a=new I(c(t,n,o,r),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(h),d(h,l,"Generator"),d(h,i,(function(){return this})),d(h,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},e.values=D,w.prototype={constructor:w,reset:function(e){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),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function o(n,o){return a.type="throw",a.arg=e,t.next=n,o&&(t.method="next",t.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(e,t){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"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var r=o.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:D(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Be(e,t,n,o,r,i,a){try{var l=e[i](a),d=l.value}catch(e){return void n(e)}l.done?t(d):Promise.resolve(d).then(o,r)}var je=(0,C.forwardRef)((function(e,t){var n=e.type,r=e.dataToSave,i=e.closePopover,a=(0,c.$)(),l=(0,M.O)({defaultValues:{title:""}}),d=!!r,s=(0,G.l)({isOpen:d,triggerRef:t,arrow:"top"}),p=s.position,f=s.popoverRef,b=(0,u._s)(),m=(0,u.E4)(),g=(0,Ae.u)(),I="addon"===n&&"save_preset"===(null==r?void 0:r.action),x="addon"===n&&"save"===(null==r?void 0:r.action),E=function(){var e,t=(e=Ze().mark((function e(){var t,o;return Ze().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.getValues("title"),(0,y.$K)(r)&&(0,y.$K)(t)){e.next=3;break}return e.abrupt("return");case 3:if("addon"!==n||"save_preset"!==r.action){e.next=8;break}return e.next=6,g.mutateAsync({title:t,preset:r.data,addon_name:null!==(o=r.addonName)&&void 0!==o?o:""});case 6:e.next=15;break;case 8:if("addon"!==n){e.next=13;break}return e.next=11,b.mutateAsync({title:t,code:r.data});case 11:e.next=15;break;case 13:return e.next=15,m.mutateAsync({title:t,section:r.data});case 15:S();case 16:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(o,r){var i=e.apply(t,n);function a(e){Be(i,o,r,a,l,"next",e)}function l(e){Be(i,o,r,a,l,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}(),S=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)(G.h,{isOpen:d,children:(0,h.BX)("div",{css:[We.container,{position:"absolute",left:p.left,top:p.top},";label:SavePopover;"],ref:f,children:[(0,h.BX)("div",{css:We.header,children:[(0,h.tZ)("span",{children:O.title}),(0,h.tZ)("button",{type:"button",css:v.iZ.resetButton,onClick:S,children:(0,h.tZ)(o.Z,{name:"cross",height:24,width:24})})]}),(0,h.BX)("form",{css:We.wrapper,onSubmit:l.handleSubmit((0,_e.GI)(l,E)),children:[(0,h.tZ)("div",{css:We.fieldWrapper,children:(0,h.tZ)(V.Qr,{name:"title",control:l.control,rules:Re({},(0,Pe.n)()),render:function(e){return(0,h.tZ)(F.Z,Re(Re({},e),{},{label:O.label,hasAutoFocus:!0}))}})}),(0,h.BX)("div",{css:We.buttonWrapper,children:[(0,h.tZ)(q.Z,{variant:"secondary",onClick:S,children:a("COM_SPPAGEBUILDER_EDITOR_CREATE_PAGE_CANCEL")}),(0,h.tZ)(q.Z,{type:"submit",loading:b.isLoading||m.isLoading,children:O.button})]})]})]})})}));const ke=je;var We={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;")},Ue=n(2445),qe=function(e){var t,n,o,i,a,l,d,c=e.position,s=e.active,u=e.over,p=e.contentId,f=e.type,b=null==s?void 0:s.data.current,v=null==u?void 0:u.data.current;if((null==u?void 0:u.id)!==p||(null==v?void 0:v.type)!==f)return null;if(!c||!k({active:s,over:u}))return null;if((null==b?void 0:b.type)===r.t.Section&&b.type===v.type)return null;if(v.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(v.type)&&v.content.parent&&(0,y.r3)([r.Dw.RowElement,r.Dw.SavedSectionElement],null==b?void 0:b.type)||(0,y.r3)(m,null==b?void 0:b.type)&&(0,y.r3)(m,v.type)&&(null==b?void 0:b.sectionIndex)===v.sectionIndex&&b.columnIndex===v.columnIndex&&b.content.parent===v.content.parent||(null==b?void 0:b.type)===r.t.NestedRow&&(0,y.r3)(m,v.type)&&(null===(t=b.nestedRowData)||void 0===t?void 0:t.sectionIndex)===v.sectionIndex&&b.nestedRowData.columnIndex===v.columnIndex||v.type===r.t.NestedRow&&(0,y.r3)(m,null==b?void 0:b.type)&&(null==b?void 0:b.sectionIndex)===(null===(n=v.nestedRowData)||void 0===n?void 0:n.sectionIndex)&&(null==b?void 0:b.columnIndex)===(null===(o=v.nestedRowData)||void 0===o?void 0:o.columnIndex)||(null==b?void 0:b.type)===r.t.NestedRow&&v.type===r.t.NestedRow&&(null===(i=b.nestedRowData)||void 0===i?void 0:i.sectionIndex)===(null===(a=v.nestedRowData)||void 0===a?void 0:a.sectionIndex)&&(null===(l=b.nestedRowData)||void 0===l?void 0:l.columnIndex)===(null===(d=v.nestedRowData)||void 0===d?void 0:d.columnIndex)||(null==b?void 0:b.type)===r.t.CollectionItemAddon&&v.type===r.t.CollectionItemAddon&&(0,y.$K)(b.itemIndex)&&b.itemIndex===v.itemIndex&&b.content.parent===v.content.parent?null:Ne(c,f)},Ne=function(e,t){var n=i.W0[10];return t===r.t.Section&&(n=i.W0[16]),t===r.t.TableItem&&(n=i.W0[6]),(0,d.iv)("position:relative;&::after{content:'';background-color:",i.qo.background.placeholder,";position:absolute;",$e(e,t,n),";};label:styles;")},$e=function(e,t,n){return"column"===t?(0,d.iv)("top:0;bottom:0;width:2px;height:100%;",e.isLeft&&(0,d.iv)("left:-",n,";;label:positionStyle;")," ",!e.isLeft&&(0,d.iv)("right:-",n,";;label:positionStyle;"),";;label:positionStyle;"):(0,d.iv)("left:0;right:0;height:2px;width:100%;",e.isTop&&(0,d.iv)("top:-",n,";;label:positionStyle;")," ",!e.isTop&&(0,d.iv)("bottom:-",n,";;label:positionStyle;"),";;label:positionStyle;")},Me=n(4101),Ge=n(6651),Ke=n(6795);function Ve(e){return function(e){if(Array.isArray(e))return Fe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fe(e,t):void 0}}(e)||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 Fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var He=function(e){var t,n=e.addonName,o=e.copiedData,r=e.isTableItem,i=e.isProductList,a=e.isNotFoundAddon;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:"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===(t=o.addon)||void 0===t?void 0:t.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 Xe=function(e){var t=e.addonWidth,n=e.addonName,i=e.addonType,a=e.copiedData,l=e.handleActions,d=e.isNotFoundAddon,s=void 0!==d&&d,u=(0,c.$)();return(0,h.tZ)(De.Z,{actions:[].concat(Ve((0,y.$K)(t)&&t<=40?[{id:"settings",icon:"pencilOnBox",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_SETTINGS"}]:[]),Ve(He({addonName:n,copiedData:a,isTableItem:i===r.t.TableItem,isProductList:n===r.oA.productList,isNotFoundAddon:s}))),title:u("COM_SPPAGEBUILDER_EDITOR_ADDON_ACTIONS"),triggerButtonContent:(0,h.tZ)(o.Z,{name:"ellipsisY",width:16,height:16}),triggerButtonStyle:Ye.actionButton(),onSelect:l})};var Ye={actionButton:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,d.iv)(v.iZ.resetButton,";color:",i.qo.text.default,";display:flex;gap:",i.W0[8],";svg{color:",i.qo.icon.default,";}",!e&&(0,d.iv)(":hover{svg{color:",i.qo.icon.hover,";}};label:actionButton;"),";;label:actionButton;")}};const ze=function(e){var t=e.id,n=void 0===t?(0,y.x0)():t,r=e.setNodeRef,i=e.isHidden,a=e.disabled,l=e.colors,d=e.placeholderStyle,s=e.sortableStyle,u=e.addonWidth,p=e.addonType,f=e.addonName,b=e.copiedData,v=e.handleActions,m=(0,c.$)(),g=(0,C.useRef)(null);return(0,h.tZ)(h.HY,{children:(0,h.tZ)("div",{id:n.toString(),css:[tt.addon({isEditing:!1,isHidden:i,disabled:!0,colors:l}),d,s,";label:AddonNotFound;"],ref:r,children:(0,h.BX)("div",{css:tt.addonTitleWrapper(a,u),children:[(0,h.tZ)(o.Z,{name:"exclamationTriangle",style:tt.notFoundIcon}),(0,h.tZ)("span",{css:tt.addonTitle,"data-addon-title":!0,children:m("COM_SPPAGEBUILDER_EDITOR_ADDON_NOT_FOUND")}),(0,h.tZ)("div",{ref:g,css:tt.actionButtonWrapper(u),"data-action-button-wrapper":!0,children:(0,h.tZ)(Xe,{addonWidth:u,addonType:p,addonName:f,copiedData:b,handleActions:v,isNotFoundAddon:!0})})]})})})};var Je={name:"1f0vbk0-addonTitleWrapper",styles:"&>[data-addon-icon]{opacity:0;};label:addonTitleWrapper;"},Qe={name:"tm5uzc-addonTitleWrapper",styles:"&>[data-addon-title]{opacity:0;};label:addonTitleWrapper;"},et={name:"1dqdmrn-addon",styles:"border-top-left-radius:0;label:addon;"},tt={addon:function(e){var t=e.isEditing,n=e.isHidden,o=e.disabled,r=e.colors,a=e.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&&et," &>[data-addon-drag-handler]{opacity:1;}};label:addon;")," ",t&&(0,d.iv)("border:1px solid ",r.addon,";background-color:",(0,Me.m4)(r.background,.2),";;label:addon;"),";;label:addon;")},addonTitleWrapper:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=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,y.$K)(t)&&t<=40&&(0,d.iv)("justify-content:center;padding:",i.W0[10]," 0;[data-addon-title]{display:none;};label:addonTitleWrapper;")," ",!e&&(0,d.iv)(":hover,:focus-within{",(0,y.$K)(t)&&t<=220&&Qe," ",(0,y.$K)(t)&&t<=80&&Je,";&>[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(e){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,y.$K)(e)&&e<=220&&(0,d.iv)("right:",i.W0[8],";;label:actionButtonWrapper;")," ",(0,y.$K)(e)&&e<=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;")},nt=n(6248);function ot(e){return ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ot(e)}function rt(e){return function(e){if(Array.isArray(e))return ut(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||st(e)||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 it(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=st(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},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(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function at(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?at(Object(n),!0).forEach((function(t){dt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):at(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==ot(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==ot(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ot(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||st(e,t)||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 st(e,t){if(e){if("string"==typeof e)return ut(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ut(e,t):void 0}}function ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var pt=new Set(["advancedcolor","advancedslider","alignment","boxshadow","buttons","color","margin","fonts","fontstyle","gradient","padding","slider","select","typography","radio"]),ft=["h1","h2","h3","h4","h5","h6","p","div","span","br","section","strong"];function bt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var vt=function(e){var t,n,o=e.sectionIndex,r=e.columnIndex,i=(0,C.useRef)(null),a=(t=(0,C.useState)(),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return bt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bt(e,t):void 0}}(t,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,K.j)((function(e){return e.activeAction})),s=(0,D.o)((function(e){return e.page}))[o].columns[r];return(0,C.useEffect)((function(){setTimeout((function(){var e,t=null===(e=i.current)||void 0===e?void 0:e.getBoundingClientRect().width;d(t)}),300)}),[c,s.settings.width]),{addonWidth:l,addonTitleRef:i}};function yt(e){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yt(e)}function mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ht(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mt(Object(n),!0).forEach((function(t){gt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==yt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==yt(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===yt(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var xt=function(e){var t,n,o;return"div"===(null==e||null===(t=e.data.current)||void 0===t?void 0:t.type)||(null==e||null===(n=e.data.current)||void 0===n||null===(o=n.content)||void 0===o?void 0:o.name)===r.oA.productList};const Et=function(e){var t,n,a,l=e.children,d=e.content,u=e.sectionIndex,p=e.columnIndex,f=e.index,b=e.childIndex,v=e.placeholderPosition,m=e.disabled,g=e.tableItem,I=e.addonType,x=void 0===I?r.t.Addon:I,E=e.colors,S=void 0===E?{addon:i.qo.alternate.addon,background:i.qo.background.lightGreen}:E,_=e.isCollapsible,T=void 0!==_&&_,R=(0,c.$)(),L=(0,D.o)((function(e){return e.copiedData})),Z=(0,D.o)((function(e){return e.changeAddonVisibility})),B=(0,D.o)((function(e){return e.updateAdminLabel})),j=function(e){var t,n=e.content,o=e.parentVisibility,r=e.tableItem,i=e.sectionIndex,a=e.columnIndex,l=e.index,d=e.childIndex,u=(0,c.$)(),p=ct((0,C.useState)(null),2),f=p[0],b=p[1],v=(0,O.T)().closeSettingPanel,m=(0,Ue.F)((function(e){return{type:e.type,payload:e.payload}}),nt.X),h=m.type,g=m.payload,I=(0,Ue.F)((function(e){return e.setSettings})),x=(0,D.o)((function(e){return e.copyAddon})),E=(0,D.o)((function(e){return e.pasteOrInsertAddon})),S=(0,D.o)((function(e){return e.pasteAddonStyle})),_=(0,s.x)((function(e){return e.globalSettings})),P=(0,D.o)((function(e){return e.duplicateAddon})),T=(0,D.o)((function(e){return e.duplicateTableItemAddon})),R=(0,D.o)((function(e){return e.copiedData})),L=(0,D.o)((function(e){return e.deleteAddon})),Z=(0,D.o)((function(e){return e.deleteTableItemAddon})),B=(0,D.o)((function(e){return e.changeAddonVisibility})),j=(0,D.o)((function(e){return e.page})),k=(0,w._)(),W=k.getAddon,U=k.getTableItem,q=(0,V.Gc)(),N=(0,s.x)((function(e){return e.addonStructure})),$=(0,Oe.p)().showToast,M=(0,y.$K)(n.visibility)&&!n.visibility,G=o&&n.visibility,K="addon"===h&&g.sectionIndex===i&&g.columnIndex===a&&g.addonIndex===l&&(0,y.$K)(g.tableItem)===(0,y.$K)(r);(0,y.$K)(r)&&(K=K&&(null===(t=g.tableItem)||void 0===t?void 0:t.itemIdx)===r.itemIdx&&g.tableItem.rowItemIdx===r.rowItemIdx&&g.tableItem.contentItemIdx===r.contentItemIdx);var F=W({sectionIndex:i,columnIndex:a,addonIndex:l}),H=function(){var e,t,n;if("addon"!==h||g.sectionIndex!==i||g.columnIndex!==a||g.addonIndex!==l||(null===(e=g.tableItem)||void 0===e?void 0:e.itemIdx)!==(null==r?void 0:r.itemIdx)||(null===(t=g.tableItem)||void 0===t?void 0:t.rowItemIdx)!==(null==r?void 0:r.rowItemIdx)||(null===(n=g.tableItem)||void 0===n?void 0:n.contentItemIdx)!==(null==r?void 0:r.itemIdx)){var o,d;I("addon",{sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r}),(0,y.$K)(r)&&(o=null===(d=U({sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r}))||void 0===d?void 0:d.settings);var c=(0,y.$K)(o)?o:null==F?void 0:F.settings;q.reset(lt(lt({},q.getValues()),{},{settings:c||{}}))}};return{isEditing:K,isHidden:M,isVisible:G,addonDataToSave:f,resetAddonDataToSave:function(){return b(null)},handleActions:function(e){switch(e){case"settings":H();break;case"copy":x({sectionIndex:i,columnIndex:a,addonIndex:l}),$({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_COPIED_SUCCESSFULLY")});break;case"pasteAbove":v(),(0,y.$K)(R.addon)&&(E({addonData:R.addon,sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d,parentId:n.parent,isAbove:!0}),$({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}));break;case"pasteBelow":v(),(0,y.$K)(R.addon)&&(E({addonData:R.addon,sectionIndex:i,columnIndex:a,addonIndex:l,parentId:n.parent,childIndex:d}),$({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}));break;case"pasteStyle":var t,o;if(!(0,y.$K)(R.addon))return;var c=ct(R.addon.addons,1)[0],s=c.name,p=c.settings,f=N[s];if(n.name!==s||!(0,y.$K)(f)||!(0,y.$K)(p))return;var m=f.settings;if(!(0,y.$K)(m))return;var h=function e(t,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=it((0,y.zt)(t));try{for(l.s();!(r=l.n()).done;){var d,c=r.value.fields,s=it((0,y.J0)(c));try{var u=function(){var t=ct(d.value,2),r=t[0],l=t[1];if((0,y.$K)(o[r])&&!(0,y.r3)(ft,o[r])&&(pt.has(l.type)||i))a[r]=o[r];else if("repeatable"===l.type){var c=(0,y.kJ)(n[r])?n[r]:[],s=c.length,u=(0,y.kJ)(o[r])?o[r]:[],p=u.length;a[r]=u.slice(0,s).flatMap((function(t,n){var o;return lt(lt({},c[n]),e(null!==(o=l.attr)&&void 0!==o?o:{},c[n],t,!1,{}))})),s>p&&(a[r]=[].concat(rt(a[r]),rt(c.slice(p))))}};for(s.s();!(d=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}}}catch(e){l.e(e)}finally{l.f()}return a},g=h(m,null!==(t=n.settings)&&void 0!==t?t:{},p),I=h(_.style,null!==(o=n.settings)&&void 0!==o?o:{},p,!0);S({styleSettings:g,globalStyleSettings:I,sectionIndex:i,columnIndex:a,addonIndex:l}),v();break;case"hide":v(),B({sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r,visibility:!!n.visibility}),$({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_VISIBILITY_CHANGED_SUCCESSFULLY")});break;case"duplicate":(0,y.$K)(r)?T({sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r}):P({sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d}),$({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")});break;case"remove":v(),(0,y.$K)(r)?Z({sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r}):L({sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d}),$({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_REMOVED_SUCCESSFULLY")});break;case"save":var O=j[i],w=O.columns[a],D=w.addons,C=(0,A.DV)({sections:j,rowId:O.id,columnId:w.id,addonList:D,addon:n});(0,y.$K)(C)&&b({data:JSON.stringify((0,y.M9)(C)),action:"save"});break;case"save_preset":var k,W,U=j[i].columns[a].addons[l],q=null!==(W=(null!==(k=U.items)&&void 0!==k?k:[])[0])&&void 0!==W?W:[];b({action:"save_preset",addonName:U.name,data:JSON.stringify(q)})}},handleSetSettings:H}}(e),W=j.isEditing,U=j.isHidden,q=j.isVisible,N=j.handleActions,$=j.handleSetSettings,M=j.addonDataToSave,G=j.resetAddonDataToSave,K=(0,C.useRef)(null),F=(0,s.x)((function(e){return e.addonStructure})),H=(n=(0,C.useState)(!0),a=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(n,a)||function(e,t){if(e){if("string"==typeof e)return It(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?It(e,t):void 0}}(n,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.")}()),X=H[0],Y=H[1],z=(0,C.useRef)(X),J=vt({sectionIndex:u,columnIndex:p}),Q=J.addonWidth,ee=J.addonTitleRef,te=(0,we.nB)({id:d.id,data:{type:x,isVisible:q,sectionIndex:u,columnIndex:p,addonIndex:f,childIndex:b,tableItem:g,content:d}}),ne=te.attributes,oe=te.listeners,re=te.setNodeRef,ie=te.active,ae=te.over,le=te.isDragging,de=te.isOver,ce=te.transform,se=te.transition,ue=k({active:ie,over:ae}),pe=F[d.name],fe=qe({position:v,contentId:d.id,active:ie,over:ae,type:x}),be=P({disable:xt(ae),transform:ce,transition:se,isDragging:le});(0,C.useEffect)((function(){z.current&&Y(!le)}),[le]),(0,C.useEffect)((function(){Y(!U),z.current=!U}),[U]);var ve=x!==r.t.TableItem;if(!(0,y.$K)(pe))return(0,h.tZ)(ze,{id:d.id,setNodeRef:re,isHidden:U,disabled:m,colors:S,placeholderStyle:fe,sortableStyle:be,addonWidth:Q,addonType:x,addonName:d.name,copiedData:L,handleActions:N});var ye=(0,y.$K)(pe.title)?pe.title:"",me=(0,y.$K)(pe.icon)?pe.icon:"",he=(null===(t=d.settings)||void 0===t?void 0:t.admin_label)||ye,ge=m||le||de;return(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{id:d.id.toString(),css:[_t.addon({isEditing:W,isHidden:U,disabled:ge,colors:S,isTableItem:(0,y.$K)(g),droppable:!de||ue}),fe,be,";label:Addon;"],ref:re,children:[(0,h.BX)("div",ht(ht(ht({ref:ee,css:_t.addonTitleWrapper(m,Q,x,X),title:R("COM_SPPAGEBUILDER_EDITOR_ADDON_CLICK_TITLE"),onClick:function(){$()},onKeyDown:y.ZT},ne),x!==r.t.TableItem&&ht({},oe)),{},{role:"button",tabIndex:-1,children:[(0,h.tZ)("span",{css:_t.addonIcon,"data-addon-icon":!0,dangerouslySetInnerHTML:{__html:me}}),(0,h.tZ)("span",{css:_t.addonTitle,"data-addon-title":!0,children:(0,h.tZ)(Ee,{text:he,updateAdminLabel:function(e){(0,y.$K)(g)?B({label:e,tableAddonItem:ht({sectionIndex:u,columnIndex:p,addonIndex:f},g)}):B({label:e,addon:{sectionIndex:u,columnIndex:p,addonIndex:f}})}})}),(0,h.tZ)("div",{ref:K,css:_t.actionButtonWrapper(Q),"data-action-button-wrapper":!0,children:U?(0,h.BX)("button",{type:"button",css:_t.actionButton(),onClick:function(e){e.stopPropagation(),Z({sectionIndex:u,columnIndex:p,addonIndex:f,tableItem:g,visibility:d.visibility})},children:[(0,h.tZ)(o.Z,{name:"eyeSlash"}),(0,y.$K)(Q)&&Q>80&&R("COM_SPPAGEBUILDER_EDITOR_ACTION_VISIBILITY_SHOW")]}):(0,h.BX)(h.HY,{children:[T&&(0,h.tZ)("button",{type:"button",css:_t.toggleButton(X),title:R("COM_SPPAGEBUILDER_EDITOR_EXPAND"),onClick:function(e){e.stopPropagation(),Y((function(e){return!e})),z.current=!z.current},children:(0,h.tZ)(o.Z,{name:"angleUp",width:20,height:20})}),(0,y.$K)(Q)&&Q>40&&(0,h.tZ)("button",{type:"button",css:_t.actionButton(),children:(0,h.tZ)(o.Z,{name:"pencilOnBox"})}),(0,h.tZ)(Xe,{addonWidth:Q,addonType:x,addonName:d.name,copiedData:L,handleActions:N})]})})]})),(0,y.$K)(l)&&(0,h.tZ)("div",{css:_t.contents(X),children:l}),ve&&(0,h.tZ)("button",ht(ht(ht({type:"button",css:_t.addonDragHandler(S.addon),"data-addon-drag-handler":!0},ne),oe),{},{children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})}))]}),(0,h.tZ)(ke,{ref:K,type:"addon",dataToSave:M,closePopover:G})]})};var St={name:"sxudyk-contents",styles:"display:none;height:0;opacity:0;padding:0;overflow:hidden;label:contents;"},Ot={name:"1bpgz68-toggleButton",styles:"transform:rotate(-180deg);label:toggleButton;"},wt={name:"1f0vbk0-addonTitleWrapper",styles:"&>[data-addon-icon]{opacity:0;};label:addonTitleWrapper;"},Dt={name:"tm5uzc-addonTitleWrapper",styles:"&>[data-addon-title]{opacity:0;};label:addonTitleWrapper;"},At={name:"1dqdmrn-addon",styles:"border-top-left-radius:0;label:addon;"},_t={addon:function(e){var t=e.isEditing,n=e.isHidden,o=e.disabled,r=e.colors,a=e.isTableItem,l=e.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&&At," &>[data-addon-drag-handler]{opacity:1;}};label:addon;")," ",t&&(0,d.iv)("border:1px solid ",r.addon,";background-color:",(0,Me.m4)(r.background,.2),";;label:addon;"),";;label:addon;")},addonTitleWrapper:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=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,y.$K)(t)&&t<=40&&(0,d.iv)("justify-content:center;padding:",i.W0[10]," 0;[data-addon-title]{display:none;};label:addonTitleWrapper;")," ",!e&&(0,d.iv)(":hover,:focus-within{",(0,y.$K)(t)&&t<=220&&Dt," ",(0,y.$K)(t)&&t<=80&&wt,";&>[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(e){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,y.$K)(e)&&e<=220&&(0,d.iv)("right:",i.W0[8],";;label:actionButtonWrapper;")," ",(0,y.$K)(e)&&e<=80&&(0,d.iv)("gap:",i.W0[4],";right:50%;transform:translateY(-50%) translateX(50%);;label:actionButtonWrapper;"),";;label:actionButtonWrapper;")},actionButton:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,d.iv)(v.iZ.resetButton,";color:",i.qo.text.default,";display:flex;gap:",i.W0[8],";svg{color:",i.qo.icon.default,";}",!e&&(0,d.iv)(":hover{svg{color:",i.qo.icon.hover,";}};label:actionButton;"),";;label:actionButton;")},addonDragHandler:function(e){return(0,d.iv)(v.iZ.resetButton,";",v.iZ.flexCenter(),";border-top-left-radius:",i.E0[4],";border-bottom-left-radius:",i.E0[4],";background-color:",e,";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(e){return(0,d.iv)(v.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,";}}",!e&&Ot,";;label:toggleButton;")},contents:function(e){return(0,d.iv)(!e&&St,";;label:contents;")}},Pt=n(1245),Ct=n.n(Pt);function Tt(e){return Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tt(e)}function Rt(e){return function(e){if(Array.isArray(e))return Ut(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wt(e)||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 Lt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Wt(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},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(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Zt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zt(Object(n),!0).forEach((function(t){jt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Tt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Tt(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Tt(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||Wt(e,t)||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 Wt(e,t){if(e){if("string"==typeof e)return Ut(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ut(e,t):void 0}}function Ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var qt=new Set(["advancedcolor","advancedslider","alignment","boxshadow","buttons","color","margin","fonts","fontstyle","gradient","padding","slider","select","typography","radio"]),Nt=["h1","h2","h3","h4","h5","h6","p","div","span","br","section","strong"];function $t(e){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$t(e)}function Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(n),!0).forEach((function(t){Kt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Kt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==$t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==$t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===$t(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const Ft=function(e){var t,n,a,l,d=e.children,u=e.content,p=e.sectionIndex,f=e.columnIndex,b=e.index,v=e.collectionItem,m=e.childIndex,g=e.placeholderPosition,I=e.disabled,x=e.tableItem,E=e.addonType,S=void 0===E?r.t.CollectionItemAddon:E,_=e.colors,T=void 0===_?{addon:i.qo.alternate.addon,background:i.qo.background.lightGreen}:_,R=e.isCollapsible,L=void 0!==R&&R,Z=(0,c.$)(),B=(0,D.o)((function(e){return e.copiedData})),j=(0,D.o)((function(e){return e.changeCollectionItemAddonVisibility})),W=(0,D.o)((function(e){return e.updateAdminLabel})),U=function(e){var t,n=e.content,o=e.parentVisibility,r=e.sectionIndex,i=e.columnIndex,a=e.index,l=e.collectionItem,d=e.childIndex,u=(0,c.$)(),p=kt((0,C.useState)(null),2),f=p[0],b=p[1],v=(0,O.T)().closeSettingPanel,m=(0,Ue.F)((function(e){return{type:e.type,payload:e.payload}}),nt.X),h=m.type,g=m.payload,I=(0,Ue.F)((function(e){return e.setSettings})),x=(0,D.o)((function(e){return e.copyCollectionItemAddon})),E=(0,D.o)((function(e){return e.pasteOrInsertCollectionItemAddon})),S=(0,D.o)((function(e){return e.pasteCollectionItemAddonStyle})),_=(0,s.x)((function(e){return e.globalSettings})),P=(0,D.o)((function(e){return e.duplicateCollectionItemAddon})),T=(0,D.o)((function(e){return e.copiedData})),R=(0,D.o)((function(e){return e.deleteCollectionItemAddon})),L=(0,D.o)((function(e){return e.changeCollectionItemAddonVisibility})),Z=(0,D.o)((function(e){return e.page})),B=(0,w._)().getCollectionItemAddon,j=(0,V.Gc)(),k=(0,s.x)((function(e){return e.addonStructure})),W=(0,Oe.p)().showToast,U=(0,y.$K)(n.visibility)&&!n.visibility,q=o&&n.visibility,N="addon"===h&&g.sectionIndex===r&&g.columnIndex===i&&g.addonIndex===a&&(0,y.$K)(g.collectionItem)===(0,y.$K)(l);return(0,y.$K)(l)&&(N=N&&(null===(t=g.collectionItem)||void 0===t?void 0:t.itemIndex)===l.itemIndex&&g.collectionItem.itemAddonIndex===l.itemAddonIndex),{isEditing:N,isHidden:U,isVisible:q,addonDataToSave:f,resetAddonDataToSave:function(){return b(null)},handleActions:function(e){switch(e){case"copy":x(Bt({sectionIndex:r,columnIndex:i,addonIndex:a},l)),W({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_COPIED_SUCCESSFULLY")});break;case"pasteAbove":v(),(0,y.$K)(T.addon)&&(E(Bt(Bt({addonData:T.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":v(),(0,y.$K)(T.addon)&&(E(Bt(Bt({addonData:T.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 t,o;if(!(0,y.$K)(T.addon))return;var c=kt(T.addon.addons,1)[0],s=c.name,p=c.settings,f=k[s];if(n.name!==s||!(0,y.$K)(f)||!(0,y.$K)(p))return;var m=f.settings;if(!(0,y.$K)(m))return;var h=function e(t,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=Lt((0,y.zt)(t));try{for(l.s();!(r=l.n()).done;){var d,c=r.value.fields,s=Lt((0,y.J0)(c));try{var u=function(){var t=kt(d.value,2),r=t[0],l=t[1];if((0,y.$K)(o[r])&&!(0,y.r3)(Nt,o[r])&&(qt.has(l.type)||i))a[r]=o[r];else if("repeatable"===l.type){var c=(0,y.kJ)(n[r])?n[r]:[],s=c.length,u=(0,y.kJ)(o[r])?o[r]:[],p=u.length;a[r]=u.slice(0,s).flatMap((function(t,n){var o;return Bt(Bt({},c[n]),e(null!==(o=l.attr)&&void 0!==o?o:{},c[n],t,!1,{}))})),s>p&&(a[r]=[].concat(Rt(a[r]),Rt(c.slice(p))))}};for(s.s();!(d=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}}}catch(e){l.e(e)}finally{l.f()}return a},g=h(m,null!==(t=n.settings)&&void 0!==t?t:{},p),I=h(_.style,null!==(o=n.settings)&&void 0!==o?o:{},p,!0);S(Bt({styleSettings:g,globalStyleSettings:I,sectionIndex:r,columnIndex:i,addonIndex:a},l)),v();break;case"hide":v(),L(Bt(Bt({sectionIndex:r,columnIndex:i,addonIndex:a},l),{},{visibility:!!n.visibility})),W({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_VISIBILITY_CHANGED_SUCCESSFULLY")});break;case"duplicate":P(Bt({sectionIndex:r,columnIndex:i,addonIndex:a,childIndex:d},l)),W({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")});break;case"remove":v(),R(Bt({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=Z[r].columns[i].addons[a].items)&&void 0!==O?O:[])[l.itemIndex])&&void 0!==w?w:[],C=D[l.itemAddonIndex],B=null,j=Ct()(C);if("div"===C.name){var U=(0,A.vH)({addon:j,addonList:D}),q=U.divAddon,N=U.children;B={name:q.name,addons:[q].concat(Rt(N)),sections:[]}}else B={name:j.name,addons:[j],sections:[]};(0,y.$K)(B)&&b({action:"save",data:JSON.stringify((0,y.M9)(B))})}},handleSetSettings:function(){var e,t;if("addon"!==h||g.sectionIndex!==r||g.columnIndex!==i||g.addonIndex!==a||(null===(e=g.collectionItem)||void 0===e?void 0:e.itemIndex)!==l.itemIndex||g.collectionItem.itemAddonIndex!==l.itemAddonIndex){I("collection_item_addon",{sectionIndex:r,columnIndex:i,addonIndex:a,collectionItem:l});var n=null===(t=B({sectionIndex:r,columnIndex:i,addonIndex:a,collectionItem:l}))||void 0===t?void 0:t.settings;j.reset(Bt(Bt({},j.getValues()),{},{settings:n||{}}))}}}}(e),q=U.isEditing,N=U.isHidden,$=U.isVisible,M=U.handleActions,G=U.handleSetSettings,K=U.addonDataToSave,F=U.resetAddonDataToSave,H=(0,C.useRef)(null),X=(0,s.x)((function(e){return e.addonStructure})),Y=(a=(0,C.useState)(!0),l=2,function(e){if(Array.isArray(e))return e}(a)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(a,l)||function(e,t){if(e){if("string"==typeof e)return Vt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vt(e,t):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.")}()),z=Y[0],J=Y[1],Q=(0,C.useRef)(z),ee=vt({sectionIndex:p,columnIndex:f}),te=ee.addonWidth,ne=ee.addonTitleRef,oe=(0,we.nB)({id:u.id,data:{type:r.t.CollectionItemAddon,isVisible:$,sectionIndex:p,columnIndex:f,addonIndex:b,itemIndex:v.itemIndex,itemAddonIndex:v.itemAddonIndex,childIndex:m,content:u}}),re=oe.attributes,ie=oe.listeners,ae=oe.setNodeRef,le=oe.active,de=oe.over,ce=oe.isDragging,se=oe.isOver,ue=oe.transform,pe=oe.transition,fe=k({active:le,over:de}),be=X[u.name],ve=qe({position:g,contentId:u.id,active:le,over:de,type:S}),ye=P({disable:"div"===(null==de||null===(t=de.data.current)||void 0===t?void 0:t.type),transform:ue,transition:pe,isDragging:ce});(0,C.useEffect)((function(){Q.current&&J(!ce)}),[ce]),(0,C.useEffect)((function(){J(!N),Q.current=!N}),[N]);var me=S!==r.t.TableItem;if(!(0,y.$K)(be))return(0,h.tZ)(ze,{id:u.id,setNodeRef:ae,isHidden:N,disabled:I,colors:T,placeholderStyle:ve,sortableStyle:ye,addonWidth:te,addonType:S,addonName:u.name,copiedData:B,handleActions:M});var he=(0,y.$K)(be.title)?be.title:"",ge=(0,y.$K)(be.icon)?be.icon:"",Ie=(null===(n=u.settings)||void 0===n?void 0:n.admin_label)||he,xe=I||ce||se;return(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{id:u.id.toString(),css:[Qt.addon({isEditing:q,isHidden:N,disabled:xe,colors:T,isTableItem:(0,y.$K)(x),droppable:!se||fe}),ve,ye,";label:CollectionItemAddon;"],ref:ae,children:[(0,h.BX)("div",Gt(Gt(Gt({ref:ne,css:Qt.addonTitleWrapper(I,te,S,z),title:Z("COM_SPPAGEBUILDER_EDITOR_ADDON_CLICK_TITLE"),onClick:function(){G()},onKeyDown:y.ZT},re),S!==r.t.TableItem&&Gt({},ie)),{},{role:"button",tabIndex:-1,children:[(0,h.tZ)("span",{css:Qt.addonIcon,"data-addon-icon":!0,dangerouslySetInnerHTML:{__html:ge}}),(0,h.tZ)("span",{css:Qt.addonTitle,"data-addon-title":!0,children:(0,h.tZ)(Ee,{text:Ie,updateAdminLabel:function(e){W({label:e,collectionItemAddon:{sectionIndex:p,columnIndex:f,addonIndex:b,itemIndex:v.itemIndex,itemAddonIndex:v.itemAddonIndex,childIndex:m}})}})}),(0,h.tZ)("div",{ref:H,css:Qt.actionButtonWrapper(te),"data-action-button-wrapper":!0,children:N?(0,h.BX)("button",{type:"button",css:Qt.actionButton(),onClick:function(e){e.stopPropagation(),j(Gt(Gt({sectionIndex:p,columnIndex:f,addonIndex:b},v),{},{visibility:!!u.visibility}))},children:[(0,h.tZ)(o.Z,{name:"eyeSlash"}),(0,y.$K)(te)&&te>80&&Z("COM_SPPAGEBUILDER_EDITOR_ACTION_VISIBILITY_SHOW")]}):(0,h.BX)(h.HY,{children:[L&&(0,h.tZ)("button",{type:"button",css:Qt.toggleButton(z),title:Z("COM_SPPAGEBUILDER_EDITOR_EXPAND"),onClick:function(e){e.stopPropagation(),J((function(e){return!e})),Q.current=!Q.current},children:(0,h.tZ)(o.Z,{name:"angleUp",width:20,height:20})}),(0,y.$K)(te)&&te>40&&(0,h.tZ)("button",{type:"button",css:Qt.actionButton(),children:(0,h.tZ)(o.Z,{name:"pencilOnBox"})}),(0,h.tZ)(Xe,{addonWidth:te,addonType:S,addonName:u.name,copiedData:B,handleActions:M})]})})]})),(0,y.$K)(d)&&(0,h.tZ)("div",{css:Qt.contents(z),children:d}),me&&(0,h.tZ)("button",Gt(Gt(Gt({type:"button",css:Qt.addonDragHandler(T.addon),"data-addon-drag-handler":!0},re),ie),{},{children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})}))]}),(0,h.tZ)(ke,{ref:H,type:"addon",dataToSave:K,closePopover:F})]})};var Ht={name:"sxudyk-contents",styles:"display:none;height:0;opacity:0;padding:0;overflow:hidden;label:contents;"},Xt={name:"1bpgz68-toggleButton",styles:"transform:rotate(-180deg);label:toggleButton;"},Yt={name:"1f0vbk0-addonTitleWrapper",styles:"&>[data-addon-icon]{opacity:0;};label:addonTitleWrapper;"},zt={name:"tm5uzc-addonTitleWrapper",styles:"&>[data-addon-title]{opacity:0;};label:addonTitleWrapper;"},Jt={name:"1dqdmrn-addon",styles:"border-top-left-radius:0;label:addon;"},Qt={addon:function(e){var t=e.isEditing,n=e.isHidden,o=e.disabled,r=e.colors,a=e.isTableItem,l=e.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&&Jt," &>[data-addon-drag-handler]{opacity:1;}};label:addon;")," ",t&&(0,d.iv)("border:1px solid ",r.addon,";background-color:",(0,Me.m4)(r.background,.2),";;label:addon;"),";;label:addon;")},addonTitleWrapper:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=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,y.$K)(t)&&t<=40&&(0,d.iv)("justify-content:center;padding:",i.W0[10]," 0;[data-addon-title]{display:none;};label:addonTitleWrapper;")," ",!e&&(0,d.iv)(":hover,:focus-within{",(0,y.$K)(t)&&t<=220&&zt," ",(0,y.$K)(t)&&t<=80&&Yt,";&>[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(e){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,y.$K)(e)&&e<=220&&(0,d.iv)("right:",i.W0[8],";;label:actionButtonWrapper;")," ",(0,y.$K)(e)&&e<=80&&(0,d.iv)("gap:",i.W0[4],";right:50%;transform:translateY(-50%) translateX(50%);;label:actionButtonWrapper;"),";;label:actionButtonWrapper;")},actionButton:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,d.iv)(v.iZ.resetButton,";color:",i.qo.text.default,";display:flex;gap:",i.W0[8],";svg{color:",i.qo.icon.default,";}",!e&&(0,d.iv)(":hover{svg{color:",i.qo.icon.hover,";}};label:actionButton;"),";;label:actionButton;")},addonDragHandler:function(e){return(0,d.iv)(v.iZ.resetButton,";",v.iZ.flexCenter(),";border-top-left-radius:",i.E0[4],";border-bottom-left-radius:",i.E0[4],";background-color:",e,";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(e){return(0,d.iv)(v.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,";}}",!e&&Xt,";;label:toggleButton;")},contents:function(e){return(0,d.iv)(!e&&Ht,";;label:contents;")}},en=n(7273);function tn(e){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tn(e)}function nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function on(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nn(Object(n),!0).forEach((function(t){rn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function rn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==tn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==tn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===tn(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var an={addon:i.qo.alternate.div,background:i.qo.background.lightRoyalBlue};const ln=function e(t){var n=t.content,i=t.sectionIndex,a=t.columnIndex,l=t.index,d=t.collectionItem,s=t.placeholderPosition,u=t.disabled,p=t.parentVisibility,f=(0,c.$)(),b=(0,w._)().getCollectionItemAddonChildAddonById,v=(0,K.j)((function(e){return e.setActiveAction})),m=p&&n.visibility;return(0,h.tZ)(Ft,on(on({},t),{},{addonType:r.t.CollectionItemAddon,colors:an,isCollapsible:!0,children:(0,y.$K)(n)&&((0,y.$K)(n.children)&&n.children.length?(0,h.tZ)(we.Fo,{id:n.id.toString(),items:n.children,strategy:we.qw,children:(0,h.tZ)("div",{css:dn.childrenWrapper,children:n.children.map((function(t,o){var r=b({sectionIndex:i,columnIndex:a,addonIndex:l,collectionItem:d,itemAddonId:t}),c=r.index,f=r.content;return(0,y.$K)(f)?"div"===f.name?(0,h.tZ)(e,{content:f,sectionIndex:i,columnIndex:a,index:l,collectionItem:{itemIndex:d.itemIndex,itemAddonIndex:c},childIndex:o,placeholderPosition:s,disabled:!n.visibility||u,parentVisibility:p&&n.visibility},t):(0,h.tZ)(Ft,{content:f,sectionIndex:i,columnIndex:a,index:l,collectionItem:{itemIndex:d.itemIndex,itemAddonIndex:c},childIndex:o,placeholderPosition:s,disabled:!n.visibility||u,parentVisibility:p&&n.visibility},t):null}))})}):(0,h.tZ)(W,{id:"".concat(n.id,"-empty-child"),customStyle:dn.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:f("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(){return v("add-elements")},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})}))}))};var dn={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{",v.iZ.resetButton,";width:100%;height:100px;",v.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";};label:emptyChildren;")};function cn(e){return cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cn(e)}function sn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function un(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sn(Object(n),!0).forEach((function(t){pn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==cn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==cn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===cn(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fn(){fn=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),l=new w(r||[]);return o(a,"_invoke",{value:x(e,n,l)}),a}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function p(){}function f(){}function b(){}var v={};d(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(D([])));m&&m!==t&&n.call(m,i)&&(v=m);var h=b.prototype=p.prototype=Object.create(v);function g(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function r(o,i,a,l){var d=s(e[o],e,i);if("throw"!==d.type){var c=d.arg,u=c.value;return u&&"object"==cn(u)&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,l)}))}l(d.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function x(e,t,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=E(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(e,t,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 E(e,t){var n=t.method,o=e.iterator[n];if(void 0===o)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var r=s(o,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function D(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function t(){for(;++o<e.length;)if(n.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:A}}function A(){return{value:void 0,done:!0}}return f.prototype=b,o(h,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:f,configurable:!0}),f.displayName=d(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,d(e,l,"GeneratorFunction")),e.prototype=Object.create(h),e},e.awrap=function(e){return{__await:e}},g(I.prototype),d(I.prototype,a,(function(){return this})),e.AsyncIterator=I,e.async=function(t,n,o,r,i){void 0===i&&(i=Promise);var a=new I(c(t,n,o,r),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(h),d(h,l,"Generator"),d(h,i,(function(){return this})),d(h,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},e.values=D,w.prototype={constructor:w,reset:function(e){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),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function o(n,o){return a.type="throw",a.arg=e,t.next=n,o&&(t.method="next",t.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(e,t){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"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var r=o.arg;O(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:D(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function bn(e,t,n,o,r,i,a){try{var l=e[i](a),d=l.value}catch(e){return void n(e)}l.done?t(d):Promise.resolve(d).then(o,r)}var vn={addon:i.qo.alternate.div,background:i.qo.background.lightRoyalBlue};const yn=function(e){var t=e.content,n=e.sectionIndex,i=e.columnIndex,a=e.index,l=e.placeholderPosition,d=e.disabled,s=e.parentVisibility,u=(0,c.$)(),p=(0,K.j)((function(e){return e.setActiveAction})),f=s&&t.visibility,b=(0,D.o)((function(e){return e.addProductListItems})),v=(0,Ae.b)();(0,C.useEffect)((function(){var e;(e=fn().mark((function e(){var o,r,l,d;return fn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null===(o=t.settings)||void 0===o?void 0:o.presets,l=Number(r),!Number.isNaN(l)){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,v.mutateAsync(l);case 6:d=e.sent,(0,y.$K)(d)&&b({sectionIndex:n,columnIndex:i,addonIndex:a,preset:d.preset});case 8:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(o,r){var i=e.apply(t,n);function a(e){bn(i,o,r,a,l,"next",e)}function l(e){bn(i,o,r,a,l,"throw",e)}a(void 0)}))})()}),[i,a,n]);var m=function(e,c){return e.length?(0,h.tZ)(we.Fo,{id:t.id.toString(),items:e.filter((function(e){return!e.parent})),strategy:we.qw,children:(0,h.tZ)("div",{css:mn.childrenWrapper,children:e.map((function(e,o){return"parent"in e&&e.parent?null:"div"===e.name?(0,h.tZ)(ln,{content:e,sectionIndex:n,columnIndex:i,index:a,collectionItem:{itemIndex:c,itemAddonIndex:o},placeholderPosition:l,disabled:!t.visibility||d,parentVisibility:s&&t.visibility},e.id):(0,h.tZ)(Ft,{sectionIndex:n,columnIndex:i,index:a,collectionItem:{itemIndex:c,itemAddonIndex:o},content:e,placeholderPosition:l,disabled:!t.visibility||d,parentVisibility:s&&t.visibility,addonType:r.t.CollectionItemAddon},e.id)}))})},c):(0,h.tZ)(W,{id:"".concat(t.id,"-empty-child"),customStyle:mn.emptyChildren,isHidden:!f,data:{type:r.t.CollectionItemAddon,isVisible:f,sectionIndex:n,columnIndex:i,addonIndex:a,content:t},children:(0,h.tZ)("button",{disabled:!f,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)(Et,un(un({},e),{},{colors:vn,isCollapsible:!0,children:(0,y.$K)(t)&&function(){var e,n,o;if(!(0,y.$K)(t.items))return null;var i,a,l=Number(null===(e=t.settings)||void 0===e||null===(n=e.grid_columns)||void 0===n?void 0:n[r.zu])||4,d=(0,en.sw)(null===(o=t.settings)||void 0===o?void 0:o.enable_scroller)||!1,c=1;return t.items[0].length>0&&(c=d?Number(null===(i=t.settings)||void 0===i||null===(a=i.items_per_slide)||void 0===a?void 0:a[r.zu])||4:l),(0,h.tZ)("div",{css:mn.grid(c),children:t.items.slice(0,c).map((function(e,t){return(0,y.$K)(e)?m(e,t):null}))})}()}))};var mn={grid:function(e){return(0,d.iv)("display:",1===e?"block":"grid",";grid-template-columns:repeat(",e,", 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{",v.iZ.resetButton,";width:100%;height:100px;",v.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";};label:emptyChildren;")};function hn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const gn=function(e){var t,n,i,a,l=e.content,d=e.isVisible,c=e.placeholderPosition,s=(i=(0,C.useState)(0),a=2,function(e){if(Array.isArray(e))return e}(i)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(i,a)||function(e,t){if(e){if("string"==typeof e)return hn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hn(e,t):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],f=(0,w._)().getSectionById,b=null!==(t=null===(n=l.settings)||void 0===n?void 0:n[r.RI[l.name].key])&&void 0!==t?t:[],v=function(){if(!(0,y.$K)(u))return null;var e=b[u],t=(0,y.$K)(e)?e.content:[];return(0,h.tZ)("div",{css:xn.body(d),children:t.map((function(e){var t=f(e.id),n=t.index,o=t.content;return(0,y.$K)(o)?(0,h.tZ)(eo,{index:n,content:o,placeholderPosition:c,disabled:!d,parentVisibility:d,sectionType:r.t.DeepAddonRow},e.id):null}))})};return(0,h.tZ)("div",{css:xn.wrapper,children:b.map((function(e,t){return(0,h.BX)("div",{css:xn.accordionItem,children:[(0,h.BX)("button",{css:xn.navItem(u===t,d),onClick:function(){return p(u===t?null:t)},children:[(0,h.tZ)(o.Z,{name:"caretRight",height:16,width:16}),(0,h.tZ)("div",{css:xn.title,children:e.title})]}),u===t&&v()]},"".concat(e.title).concat(t))}))})};var In={name:"1jmy1n7-navItem",styles:"transform:rotate(90deg);label:navItem;"},xn={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(e,t){return(0,d.iv)("width:100%;display:flex;gap:",i.W0[12],";",v.iZ.resetButton," padding:",i.W0[16],";",e&&t&&(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;",e&&In,";};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(e){return(0,d.iv)("padding:0 ",i.W0[16]," ",i.W0[16],";",e&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:body;"),";;label:body;")}};function En(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const Sn=function(e){var t,n,o,i,a=e.content,l=e.isVisible,d=e.placeholderPosition,c=(o=(0,C.useState)(0),i=2,function(e){if(Array.isArray(e))return e}(o)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(o,i)||function(e,t){if(e){if("string"==typeof e)return En(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?En(e,t):void 0}}(o,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.")}()),s=c[0],u=c[1],p=(0,w._)().getSectionById,f=null!==(t=null===(n=a.settings)||void 0===n?void 0:n[r.RI[a.name].key])&&void 0!==t?t:[],b=f[s],v=(0,y.$K)(b)?b.content:[];return(0,h.BX)("div",{css:On.wrapper,children:[(0,h.tZ)("div",{css:On.nav,children:f.map((function(e,t){return(0,h.BX)("button",{css:On.navItem(s===t,l),onClick:function(){return u(t)},children:[(0,h.tZ)("div",{children:e.title}),e.subtitle&&(0,h.tZ)("span",{children:e.subtitle})]},"".concat(e.title).concat(t))}))}),(0,h.tZ)("div",{css:On.body(l),children:v.map((function(e){var t=p(e.id),n=t.index,o=t.content;return(0,y.$K)(o)?(0,h.tZ)(eo,{index:n,content:o,placeholderPosition:d,disabled:!l,parentVisibility:l,sectionType:r.t.DeepAddonRow},e.id):null}))})]})};var On={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:(0,d.iv)("display:flex;border-bottom:1px solid ",i.qo.stroke.neutral,";;label:nav;"),navItem:function(e,t){return(0,d.iv)(v.iZ.resetButton," font-size:",i.JB[14],";padding:",i.W0[16],";border-right:1px solid ",i.qo.stroke.neutral,";min-height:52px;position:relative;",e&&(0,d.iv)("color:",i.qo.text.primary,";",t&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:navItem;")," &::before{content:'';width:100%;height:1px;position:absolute;left:0;bottom:-1px;",t&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:navItem;"),";};label:navItem;"),";;label:navItem;")},body:function(e){return(0,d.iv)("padding:",i.W0[16],";",e&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:body;"),";;label:body;")}};const wn=function(e){var t,n,i,a,l,d,s=e.content,u=e.sectionIndex,p=e.columnIndex,f=e.index,b=e.isVisible,v=e.placeholderPosition,m=(0,K.j)((function(e){return e.setActiveAction})),g=(0,c.$)(),I=null!==(t=null===(n=s.settings)||void 0===n?void 0:n[r.pb.headerItemsKey])&&void 0!==t?t:[],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:Dn.wrapper,children:[!(0,y.$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:Dn.headerWrapper,children:I.map((function(e,t){if(0===e.content.length){var n="empty-table-header-item-".concat(t);return(0,h.tZ)(W,{id:n,customStyle:Dn.emptyItem,isHidden:!b,data:{type:r.t.TableItem,sectionIndex:u,columnIndex:p,addonIndex:f,tableItem:{itemIdx:t,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:Dn.headerItem,children:e.content.map((function(e,n){return(0,h.tZ)(Et,{content:e,sectionIndex:u,columnIndex:p,index:f,placeholderPosition:v,disabled:!b,parentVisibility:b,tableItem:{itemIdx:t,contentItemIdx:n},addonType:r.t.TableItem},e.id)}))},t)}))}),(0,h.tZ)("div",{css:Dn.bodyWrapper,children:x.map((function(e,t){return(0,h.tZ)("div",{css:Dn.bodyRowWrapper,children:e.table_advanced_item.map((function(e,n){if(0===e.content.length){var i="empty-table-body-item-".concat(t,"-").concat(n);return(0,h.tZ)(W,{id:i,customStyle:Dn.emptyItem,isHidden:!b,data:{type:r.t.TableItem,sectionIndex:u,columnIndex:p,addonIndex:f,tableItem:{itemIdx:t,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(e){e.stopPropagation(),m("add-elements")},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})},i)}return(0,h.tZ)("div",{css:Dn.bodyItem,children:e.content.map((function(e,o){return(0,h.tZ)(Et,{content:e,sectionIndex:u,columnIndex:p,index:f,placeholderPosition:v,disabled:!b,parentVisibility:b,tableItem:{itemIdx:t,rowItemIdx:n,contentItemIdx:o},addonType:r.t.TableItem},e.id)}))},n)}))},t)}))})]})};var Dn={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{",v.iZ.resetButton,";width:100%;height:40px;",v.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";width:",i.W0[24],";height:",i.W0[24],";};label:emptyItem;")};function An(e){return An="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},An(e)}function _n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_n(Object(n),!0).forEach((function(t){Cn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_n(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==An(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==An(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===An(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Tn={addon:i.qo.alternate.div,background:i.qo.background.white};const Rn=function(e){var t=e.content,n=e.sectionIndex,o=e.columnIndex,i=e.index,a=e.placeholderPosition,l=e.parentVisibility&&t.visibility;return(0,h.tZ)(Et,Pn(Pn({},e),{},{addonType:r.t.DeepAddon,colors:Tn,isCollapsible:!0,children:(0,y.$K)(t)&&(t.name===r.pb.name?(0,h.tZ)(wn,{content:t,sectionIndex:n,columnIndex:o,index:i,isVisible:l,placeholderPosition:a}):t.name===r.RI.accordion.name?(0,h.tZ)(gn,{content:t,placeholderPosition:a,isVisible:l}):t.name===r.RI.tab.name?(0,h.tZ)(Sn,{content:t,placeholderPosition:a,isVisible:l}):null)}))};function Ln(e){return Ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ln(e)}function Zn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Bn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zn(Object(n),!0).forEach((function(t){jn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Ln(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Ln(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ln(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kn={addon:i.qo.alternate.div,background:i.qo.background.lightRoyalBlue};const Wn=function e(t){var n=t.content,i=t.sectionIndex,a=t.columnIndex,l=t.index,d=t.childIndex,s=t.tableItem,u=t.placeholderPosition,p=t.disabled,f=t.parentVisibility,b=(0,c.$)(),v=(0,w._)().getChildAddonById,m=(0,K.j)((function(e){return e.setActiveAction})),g=f&&n.visibility;return(0,h.tZ)(Et,Bn(Bn({},t),{},{addonType:r.t.Div,colors:kn,isCollapsible:!0,children:(0,y.$K)(n)&&((0,y.$K)(n.children)&&n.children.length?(0,h.tZ)(we.Fo,{id:n.id.toString(),items:n.children,strategy:we.qw,children:(0,h.tZ)("div",{css:Un.childrenWrapper,children:n.children.map((function(t,o){var l=v({sectionIndex:i,columnIndex:a,id:t}),d=l.index,c=l.content;return(0,y.$K)(c)?"div"===c.name?(0,h.tZ)(e,{content:c,sectionIndex:i,columnIndex:a,index:d,childIndex:o,placeholderPosition:u,disabled:!n.visibility||p,parentVisibility:f&&n.visibility},t):Object.keys(r.RI).includes(c.name)||c.name===r.pb.name?(0,h.tZ)(Rn,{content:c,sectionIndex:i,columnIndex:a,index:d,childIndex:o,placeholderPosition:u,disabled:!n.visibility||p,parentVisibility:f&&n.visibility},c.id):c.name===r.oA.productList?(0,h.tZ)(yn,{content:c,sectionIndex:i,columnIndex:a,index:d,childIndex:o,placeholderPosition:u,disabled:!n.visibility||p,parentVisibility:f&&n.visibility},c.id):(0,h.tZ)(Et,{sectionIndex:i,columnIndex:a,content:c,index:d,childIndex:o,placeholderPosition:u,disabled:!n.visibility||p,parentVisibility:f&&n.visibility},t):null}))})}):(0,h.tZ)(W,{id:"".concat(n.id,"-empty-child"),customStyle:Un.emptyChildren,isHidden:!g,data:{type:r.t.EmptyDivChild,isVisible:g,sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d,tableItem:s,content:n},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 Un={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{",v.iZ.resetButton,";width:100%;height:100px;",v.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";};label:emptyChildren;")};function qn(e){return qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qn(e)}function Nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function $n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nn(Object(n),!0).forEach((function(t){Mn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==qn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==qn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===qn(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Gn=function(e){var t=e.isHidden,n=e.isDeepAddonColumn,o=e.totalColumns;return[{id:"settings",icon:"cog",title:"COM_SPPAGEBUILDER_EDITOR_COLUMN_SETTINGS",isDisabled:t},{id:"visibility",icon:"eyeSlash",title:"COM_SPPAGEBUILDER_EDITOR_ACTION_VISIBILITY_HIDE",isProFeature:!0},{id:"duplicate",icon:"cloneLine",title:"COM_SPPAGEBUILDER_EDITOR_COLUMN_DUPLICATE",isDisabled:t},{id:"remove",icon:"trash",title:"COM_SPPAGEBUILDER_EDITOR_COLUMN_REMOVE",variant:"critical",isDisabled:t,hide:n&&1===o}]};const Kn=function(e){var t=e.content,n=e.sectionIndex,i=e.index,a=e.placeholderPosition,l=e.parentVisibility,d=e.isDeepAddonColumn,s=void 0!==d&&d,u=e.totalColumns,p=(0,c.$)(),f=(0,D.o)((function(e){return e.changeColumnVisibility})),b=(0,D.o)((function(e){return e.duplicateColumn})),v=(0,D.o)((function(e){return e.deleteColumn})),m=(0,D.o)((function(e){return e.copiedData})),g=(0,D.o)((function(e){return e.pasteOrInsertAddon})),I=(0,D.o)((function(e){return e.page})),x=(0,Ge.y)((function(e){return e.activeColumn})),E=(0,Ge.y)((function(e){return e.setActiveColumn})),S=(0,C.useRef)({element:null}),A=(0,w._)().getNestedRowById,_=(0,K.j)((function(e){return e.setActiveAction})),T=(0,K.j)((function(e){return e.activeAction})),R=(0,Ue.F)((function(e){return{type:e.type,payload:e.payload,setSettings:e.setSettings}})),L=R.type,Z=R.payload,B=R.setSettings,j=l&&t.visibility,k=(0,we.nB)({id:t.id,data:{type:r.t.Column,isVisible:j,sectionIndex:n,columnIndex:i,content:t}}),W=k.attributes,U=k.listeners,q=k.setNodeRef,N=k.isDragging,$=k.active,M=k.over,G=k.isOver,F=k.transition,H=k.transform,X=function(e){e&&(q(e),S.current.element=e)},Y=(0,Oe.p)().showToast,z=!t.visibility,J=P({transform:H,transition:F,isDragging:N}),Q=qe({position:a,contentId:t.id,active:$,over:M,type:"column"}),ee=(0,O.T)().closeSettingPanel;(0,C.useEffect)((function(){T||E(null)}),[T,E]);var te=(0,V.Gc)(),ne=te.getValues,oe=te.reset,re=(0,w._)().getColumnSettings,ie=function(e){"settings"===e&&(oe($n($n({},ne()),{},{settings:re({sectionIndex:n,columnIndex:i})})),B("column",{sectionIndex:n,columnIndex:i,addonIndex:null})),"visibility"===e&&(ee(),f({sectionIndex:n,columnIndex:i,visibility:t.visibility}),Y({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_VISIBILITY_CHANGED_SUCCESSFULLY")})),"duplicate"===e&&(b({sectionIndex:n,columnIndex:i}),Y({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")})),"remove"===e&&(ee(),v({sectionIndex:n,columnIndex:i}),Y({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_REMOVED_SUCCESSFULLY")}))},ae="column"===L&&Z.sectionIndex===n&&Z.columnIndex===i,le=N||G,de=x==="".concat(n,"-").concat(i),ce=function(){return(0,h.BX)(h.HY,{children:[(0,h.tZ)(De.Z,{actions:Gn({isHidden:z,isDeepAddonColumn:s,totalColumns:u}),triggerButtonContent:(0,h.tZ)(o.Z,{name:"ellipsisX",width:10}),triggerButtonStyle:Vn.columnSettings,onSelect:ie,visibilityStatus:!z,title:p("COM_SPPAGEBUILDER_EDITOR_COLUMN_ACTIONS")}),(0,h.tZ)("button",$n($n($n({type:"button",css:Vn.columnDragHandler,"data-column-drag-handler":!0},W),U),{},{children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})})),!!m.addon&&j&&(0,h.tZ)("button",{type:"button",css:Vn.clipboardButton,"data-addon-paste-button":!0,title:p("COM_SPPAGEBUILDER_EDITOR_ADDON_PASTE"),onClick:function(e){if(e.stopPropagation(),(0,y.$K)(m.addon)){ee();var t=I[n].columns[i].addons.length;g({addonData:m.addon,sectionIndex:n,columnIndex:i,addonIndex:t}),Y({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")})}},children:(0,h.tZ)(o.Z,{name:"clipboard",height:16,width:16})})]})};return 0===t.addons.length?(0,h.tZ)("div",{css:Vn.columnWrap({width:t.settings.width}),children:(0,h.BX)("div",{css:[Vn.emptyColumnWrap({isOver:G,isEditing:ae,isHidden:z,hideOutline:le,isActiveColumn:de}),Q,J,";label:Column;"],ref:X,tabIndex:-1,role:"button",onKeyDown:function(){},title:p("COM_SPPAGEBUILDER_EDITOR_COLUMN_CLICK_TITLE"),onClick:function(e){e.target===S.current.element&&(B("column",{sectionIndex:n,columnIndex:i,addonIndex:null}),oe($n($n({},ne()),{},{settings:re({sectionIndex:n,columnIndex:i})})))},children:[(0,h.tZ)("button",{type:"button",id:t.id.toString(),css:Vn.emptyColumnButton({isActiveColumn:de}),disabled:!j,title:p("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(e){e.stopPropagation(),_(de?void 0:"add-elements"),E(de?null:"".concat(n,"-").concat(i))},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})}),ce()]})}):(0,h.tZ)(we.Fo,{id:t.id.toString(),items:t.addons.filter((function(e){return!e.parent})),strategy:we.qw,children:(0,h.tZ)("div",{css:Vn.columnWrap({width:t.settings.width}),tabIndex:-1,role:"button",onKeyDown:y.ZT,title:p("COM_SPPAGEBUILDER_EDITOR_COLUMN_CLICK_TITLE"),onClick:function(e){e.target===S.current.element&&(B("column",{sectionIndex:n,columnIndex:i,addonIndex:null}),oe($n($n({},ne()),{},{settings:re({sectionIndex:n,columnIndex:i})})))},children:(0,h.BX)("div",{id:t.id.toString(),css:[Vn.column({isEditing:ae,isHidden:!j,hideOutline:le}),Q,J,";label:Column;"],ref:X,children:[t.addons.map((function(e,o){if("parent"in e&&e.parent)return null;if((0,Ke.m5)(e)){var l=A({id:e.id,rowId:I[n].id,columnId:t.id}),d=l.index,c=l.content;return(0,y.$K)(c)?(0,h.tZ)(eo,{index:d,content:c,nestedRowData:{sectionIndex:n,columnIndex:i,addonIndex:o},placeholderPosition:a,disabled:z,parentVisibility:t.visibility,sectionType:r.t.NestedRow},e.id):null}return"div"===e.name?(0,h.tZ)(Wn,{content:e,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:z,parentVisibility:t.visibility},e.id):e.name===r.oA.productList?(0,h.tZ)(yn,{content:e,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:z,parentVisibility:t.visibility},e.id):Object.keys(r.RI).includes(e.name)||e.name===r.pb.name?(0,h.tZ)(Rn,{content:e,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:z,parentVisibility:t.visibility},e.id):(0,h.tZ)(Et,{content:e,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:z,parentVisibility:t.visibility},e.id)})),ce()]})})})};var Vn={columnWrap:function(e){var t=e.width;return(0,d.iv)("width:",t[r.zu],";height:100%;padding:",i.W0[8],";;label:columnWrap;")},column:function(e){var t=e.isEditing,n=e.isHidden,o=e.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;")," ",t&&(0,d.iv)("border:1px solid ",i.qo.base.primary,";background-color:",(0,Me.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(e){var t=e.isEditing,n=e.isHidden,o=e.hideOutline,r=e.isActiveColumn,a=e.isOver;return(0,d.iv)("position:relative;border:1px dashed ",i.qo.stroke.neutral,";border-radius:",i.E0[2],";",v.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;")," ",t&&(0,d.iv)("border:1px solid ",i.qo.base.primary,";background-color:",(0,Me.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(e){var t=e.isActiveColumn;return(0,d.iv)(v.iZ.resetButton,";position:absolute;inset:",i.W0[16],";",v.iZ.flexCenter(),";cursor:pointer;svg{color:",i.qo.icon.default,";}:hover{svg{color:",i.qo.icon.hover,";}}",t&&(0,d.iv)("svg{color:",i.qo.icon.default,";};label:emptyColumnButton;"),";;label:emptyColumnButton;")},columnSettings:(0,d.iv)(v.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)(v.iZ.resetButton,";",v.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)(v.iZ.resetButton,";",v.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 Fn(e){return Fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fn(e)}function Hn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Xn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hn(Object(n),!0).forEach((function(t){Yn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Yn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Fn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Fn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Fn(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Jn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jn(e,t):void 0}}(e,t)||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 Jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var Qn=function(e){var t=e.copiedData,n=e.isHidden,o=e.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:!t.section||n,isProFeature:!0},{id:"remove",icon:"trash",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_REMOVE",variant:"critical",isDisabled:n,hide:o}]};const eo=function(e){var t,n,i=e.content,l=e.index,d=e.placeholderPosition,s=e.nestedRowData,u=e.disabled,p=void 0!==u&&u,f=e.parentVisibility,b=void 0===f||f,v=e.sectionType,m=void 0===v?r.t.Section:v,g=(0,D.o)((function(e){return e.changeSectionVisibility})),I=(0,D.o)((function(e){return e.duplicateSection})),x=(0,D.o)((function(e){return e.duplicateNestedSection})),E=(0,D.o)((function(e){return e.copySection})),S=(0,D.o)((function(e){return e.pasteOrInsertSection})),_=(0,D.o)((function(e){return e.pasteOrInsertAsNestedSection})),T=(0,D.o)((function(e){return e.deleteSection})),R=(0,D.o)((function(e){return e.resetColumnWidth})),L=(0,D.o)((function(e){return e.deleteNestedSection})),Z=(0,D.o)((function(e){return e.updateAdminLabel})),B=(0,D.o)((function(e){return e.page})),j=(0,D.o)((function(e){return e.copiedData})),k=(0,O.T)().closeSettingPanel,W=(0,C.useRef)(null),U=(0,C.useRef)(null),N=(0,C.useRef)(null),$=zn((0,C.useState)(null),2),M=$[0],K=$[1],F=(0,c.$)(),H=(0,Ue.F)((function(e){return{type:e.type,payload:e.payload,setSettings:e.setSettings}})),X=H.type,Y=H.payload,z=H.setSettings,J=(0,w._)().getSectionSettings,ee=(0,V.Gc)(),te=ee.reset,ne=ee.getValues,oe=!!i.parent,re=b&&i.visibility,ie=m===r.t.DeepAddonRow,ae=(0,we.nB)({id:i.id,data:{type:m,isVisible:re,sectionIndex:l,content:i,nestedRowData:s},disabled:ie}),le=ae.attributes,de=ae.listeners,ce=ae.setNodeRef,se=ae.isDragging,ue=ae.isOver,pe=ae.transform,fe=ae.transition,be=ae.active,ve=ae.over,ye=zn((0,C.useState)(!0),2),me=ye[0],he=ye[1],ge=(0,C.useRef)(me),Ie=zn((0,C.useState)({isOpen:!1,reason:""}),2),xe=Ie[0],Se=Ie[1],Ae=(0,Oe.p)().showToast,_e=(0,G.l)({isOpen:xe.isOpen,isDropdown:!0,arrow:"bottom"}),Pe=_e.triggerRef,Ce=_e.position,Te=_e.popoverRef,Re=!re||p;(0,C.useEffect)((function(){ge.current&&he(!se)}),[se]),(0,C.useEffect)((function(){he(!Re),ge.current=!Re}),[Re]);var Le=function(){z("section",{sectionIndex:l,columnIndex:null,addonIndex:null});var e=J(l);te(Xn(Xn({},ne()),{},{settings:e}))},Ze=qe({position:d,contentId:i.id,active:be,over:ve,type:m}),Be=P({transform:pe,transition:fe,isDragging:se}),je="section"===X&&Y.sectionIndex===l,We=p||se||ue,Ne=(null==ve||null===(t=ve.data.current)||void 0===t?void 0:t.type)===r.t.Section&&(null==be||null===(n=be.data.current)||void 0===n?void 0:n.type)===r.t.NestedRow;return(0,h.BX)("div",{css:io.wrapper(je,We),children:[(0,h.BX)("div",{css:[io.section(je,Re,p),Ze,Ne?null:Be,";label:Section;"],ref:ce,children:[(0,h.BX)("div",Xn(Xn(Xn({css:io.actionBar(Re),ref:W,title:F("COM_SPPAGEBUILDER_EDITOR_SECTION_CLICK_TITLE"),onKeyDown:y.ZT,onClick:function(e){e.target===W.current&&Le()}},le),de),{},{role:"button",tabIndex:-1,children:[(0,h.BX)("div",{css:io.titleBar(ie),title:"",children:[!ie&&(0,h.tZ)(o.Z,{name:"dragger",width:32,height:32}),(0,h.tZ)("h5",{css:a.c.heading5(),children:(0,h.tZ)(Ee,{text:i.settings.admin_label||i.settings.title||(oe?"Row":"Section"),updateAdminLabel:function(e){Z({label:e,row:{sectionIndex:l}})}})})]}),(0,h.BX)("div",{ref:N,css:io.actionButtons,children:[(0,h.tZ)("button",{type:"button",css:io.toggleButton(me),title:F(me?"COM_SPPAGEBUILDER_EDITOR_COLLAPSE":"COM_SPPAGEBUILDER_EDITOR_EXPAND"),onClick:function(){he((function(e){return!e})),ge.current=!ge.current},children:(0,h.tZ)(o.Z,{name:"angleUp",width:28,height:28})}),(0,h.tZ)(De.Z,{actions:Qn({copiedData:j,isHidden:Re,isDeepAddonRow:ie}),triggerButtonContent:(0,h.tZ)("span",{css:io.settingsButton(p),title:F("COM_SPPAGEBUILDER_EDITOR_SECTION_SETTINGS"),children:(0,h.tZ)(o.Z,{name:"sliders"})}),onSelect:function(e){switch(e){case"settings":Le();break;case"visibility":k(),g({sectionIndex:l,visibility:i.visibility}),Ae({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_VISIBILITY_CHANGED_SUCCESSFULLY")});break;case"duplicate":(0,y.$K)(s)?x(Xn({nestedSectionIndex:l},s)):I({sectionIndex:l}),Ae({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")});break;case"copy":E({sectionIndex:l}),Ae({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_COPIED_SUCCESSFULLY")});break;case"paste":var t,n;k(),(0,y.$K)(s)?_(Xn(Xn({nestedSectionIndex:l},s),{},{sectionData:null!==(t=j.section)&&void 0!==t?t:[],replace:!0})):S({sectionIndex:l,sectionData:null!==(n=j.section)&&void 0!==n?n:[],replace:!0}),Ae({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")});break;case"reset":k(),R({sectionIndex:l});break;case"remove":k(),(0,y.$K)(s)?L(Xn({nestedSectionIndex:l},s)):T({sectionIndex:l}),Ae({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_REMOVED_SUCCESSFULLY")});break;case"save":var o=(0,A.Nk)({sections:B,sectionIndex:l});(0,y.$K)(o)&&K({action:"save",data:JSON.stringify(o)});break;case"columns":Se({isOpen:!0,reason:"update"})}},visibilityStatus:i.visibility,disabled:p})]})]})),(0,h.tZ)(we.Fo,{id:i.id.toString(),items:i.columns,strategy:we.PG,children:(0,h.tZ)("div",{css:io.contents(me),ref:U,title:F("COM_SPPAGEBUILDER_EDITOR_SECTION_CLICK_TITLE"),role:"button",tabIndex:-1,onKeyDown:y.ZT,onClick:function(e){e.target===U.current&&Le()},children:(0,h.tZ)("div",{title:"",children:i.columns.map((function(e,t){return(0,h.tZ)(Kn,{content:e,sectionIndex:l,index:t,totalColumns:i.columns.length,placeholderPosition:d,parentVisibility:re,isDeepAddonColumn:ie},e.id)}))})})})]}),(0,h.BX)("div",{css:io.bottomActionButtonsWrapper,"data-bottom-wrapper":!0,children:[ie&&oe&&(0,h.tZ)("span",{ref:Pe}),!ie&&(0,h.tZ)(q.Z,{ref:Pe,type:"button",onClick:function(){return Se({isOpen:!0,reason:"insert"})},icon:(0,h.tZ)(o.Z,{name:"plus"}),children:F(oe?"COM_SPPAGEBUILDER_EDITOR_ADD_ROW":"COM_SPPAGEBUILDER_EDITOR_ADD_SECTION")}),!oe&&!!j.section&&(0,h.tZ)(q.Z,{ref:Pe,type:"button",variant:"secondary",buttonCss:io.pasteSectionButton,onClick:function(){(0,y.$K)(j.section)&&(k(),S({sectionIndex:l,sectionData:j.section,replace:!1}),Ae({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}))},icon:(0,h.tZ)(o.Z,{name:"clipboard"}),children:F("COM_SPPAGEBUILDER_EDITOR_SECTION_PASTE_SECTION")})]}),(0,h.tZ)(Q,{isOpen:xe.isOpen,defaultLayout:"update"===xe.reason?i.layout:null,nestedRowData:s,handleClose:function(){return Se({isOpen:!1,reason:""})},position:Ce,popoverRef:Te,index:l}),(0,h.tZ)(ke,{ref:N,type:"section",dataToSave:M,closePopover:function(){return K(null)}})]})};var to={name:"sxudyk-contents",styles:"display:none;height:0;opacity:0;padding:0;overflow:hidden;label:contents;"},no={name:"1bpgz68-toggleButton",styles:"transform:rotate(-180deg);label:toggleButton;"},oo={name:"1nwp2q0-actionBar",styles:":hover{button:first-of-type{visibility:visible;opacity:1;}};label:actionBar;"},ro={name:"1o7rgfq-section",styles:"background-color:transparent;label:section;"},io={wrapper:function(e,t){return(0,d.iv)("width:100%;position:relative;border:1px solid transparent;border-radius:",i.E0[6],";transition:border 0.3s ease-in-out;",!t&&(0,d.iv)(":hover{border:1px solid ",i.qo.base.primary,";&>[data-bottom-wrapper]{opacity:1;}};label:wrapper;")," ",e&&(0,d.iv)("border:1px solid ",i.qo.base.primary,";;label:wrapper;"),";;label:wrapper;")},section:function(e,t,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,";",e&&(0,d.iv)("background-color:",(0,Me.m4)(i.qo.background.primary,.4),";;label:section;")," ",t&&!n&&(0,d.iv)("background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:section;")," ",n&&ro,";;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)(v.iZ.resetButton,";",v.iZ.flexCenter("row"),";",v.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(e){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;",!e&&oo,";;label:actionBar;")},titleBar:function(e){return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[4],";padding-left:",i.W0[2],";cursor:grab;",e&&(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(e){return(0,d.iv)(v.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,";}}",!e&&no,";;label:toggleButton;")},settingsButton:function(e){return(0,d.iv)(v.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;}",e&&(0,d.iv)("color:",i.qo.icon.disabled,";cursor:initial;;label:settingsButton;")," ",!e&&(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(e){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;}",!e&&to,";;label:contents;")}};const ao=function(){var e=(0,D.o)((function(e){return e.page})),t=(0,O.T)().closeSettingPanel,n=(0,K.j)((function(e){return e.activeAction})),i=(0,K.j)((function(e){return e.setActiveAction})),a=function(){var e=(0,D.o)((function(e){return e.addNewAddon})),t=(0,D.o)((function(e){return e.addNewTableItemAddon})),n=(0,D.o)((function(e){return e.pasteOrInsertAddon})),o=(0,D.o)((function(e){return e.pasteOrInsertSection})),i=(0,D.o)((function(e){return e.pasteOrInsertAsNestedSection})),a=(0,D.o)((function(e){return e.addNewSection})),d=(0,D.o)((function(e){return e.addNestedRow})),c=(0,D.o)((function(e){return e.addNewColumn})),f=(0,D.o)((function(e){return e.sortSection})),b=(0,D.o)((function(e){return e.sortColumn})),v=(0,D.o)((function(e){return e.sortAddon})),m=(0,D.o)((function(e){return e.sortCollectionItemAddon})),h=(0,D.o)((function(e){return e.sortAddonWithCollectionItemAddon})),g=(0,D.o)((function(e){return e.addNewCollectionItemAddon})),I=(0,s.x)((function(e){return e.addonGroups})),x=Z((0,C.useState)(null),2),E=x[0],S=x[1],A=Z((0,C.useState)(null),2),_=A[0],P=A[1],T=(0,w._)().getSectionById,L=(0,O.T)().closeSettingPanel,B=function(){S(null),P(null)};(0,l.IJ)({onDragStart:function(e){var t,n=e.active,o=null===(t=n.data.current)||void 0===t?void 0:t.content;if(n.data.current&&o){var r=Object.values(I).flat().find((function(e){return e.name===o.name}));S(R(R(R(R({},o),!("icon"in o)&&(0,y.$K)(r)&&{icon:r.icon}),!("title"in o)&&(0,y.$K)(r)&&{title:r.title}),{},{type:n.data.current.type}))}else S(null)},onDragMove:function(e){var t,n,o,r=e.over,i=e.active.rect.current.translated,a=null==r?void 0:r.rect;if(!i||!a||null===(t=r.data.current)||void 0===t||!t.isVisible||(n=i,(o=a).left>n.right||o.right<n.left||o.top>n.bottom||o.bottom<n.top))return P(null);var l=i.top+i.height/2<a.top+a.height/2,d=i.left+i.width/2<a.left+a.width/2;P({isTop:l,isLeft:d})},onDragEnd:function(e){var t=e.active,n=e.over,o=t.data.current,i=null==n?void 0:n.data.current;o&&i&&t.id!==(null==n?void 0:n.id)&&k({active:t,over:n})?((0,y.r3)((0,y.zt)(r.Dw),o.type)?W({activeCurrent:o,overCurrent:i}):j({activeCurrent:o,overCurrent:i}),B(),L()):B()},onDragCancel:function(){B()}});var j=function(e){var t=e.activeCurrent,n=e.overCurrent;switch(n.type){case r.t.NestedRow:var o,i=n.nestedRowData;if(!(0,y.$K)(i))return;if((0,y.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],t.type))v({sourceSectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,sourceAddonIndex:t.addonIndex,sourceChildIndex:t.childIndex,destinationSectionIndex:i.sectionIndex,destinationColumnIndex:i.columnIndex,destinationAddonIndex:i.addonIndex,isAbove:null!==(o=null==_?void 0:_.isTop)&&void 0!==o&&o});else if(r.t.NestedRow===t.type){var a,l=t.nestedRowData;if(!(0,y.$K)(l))return;v({sourceSectionIndex:l.sectionIndex,sourceColumnIndex:l.columnIndex,sourceAddonIndex:l.addonIndex,destinationSectionIndex:i.sectionIndex,destinationColumnIndex:i.columnIndex,destinationAddonIndex:i.addonIndex,isAbove:null!==(a=null==_?void 0:_.isTop)&&void 0!==a&&a})}break;case r.t.Section:t.type===r.t.Section&&f({sourceSectionIndex:t.sectionIndex,destinationSectionIndex:n.sectionIndex});break;case r.t.Column:if(t.type===r.t.Column)b({sectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,destinationColumnIndex:n.columnIndex});else if((0,y.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],t.type))v({sourceSectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,sourceAddonIndex:t.addonIndex,sourceChildIndex:t.childIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:0,isAbove:!0});else if(r.t.NestedRow===t.type){var d=t.nestedRowData;if(!(0,y.$K)(d))return;v({sourceSectionIndex:d.sectionIndex,sourceColumnIndex:d.columnIndex,sourceAddonIndex:d.addonIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:0,isAbove:!0})}break;case r.t.EmptyDivChild:var c;(0,y.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],t.type)&&v({sourceSectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,sourceAddonIndex:t.addonIndex,sourceChildIndex:t.childIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:n.addonIndex,emptyDivChild:!0,isAbove:null!==(c=null==_?void 0:_.isTop)&&void 0!==c&&c});break;case r.t.Addon:case r.t.DeepAddon:case r.t.Div:var s;if((0,y.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],t.type))v({sourceSectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,sourceAddonIndex:t.addonIndex,sourceChildIndex:t.childIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:n.addonIndex,destinationChildIndex:n.childIndex,isAbove:null!==(s=null==_?void 0:_.isTop)&&void 0!==s&&s});else if(r.t.NestedRow===t.type){var u,p=t.nestedRowData;if(!(0,y.$K)(p))return;v({sourceSectionIndex:p.sectionIndex,sourceColumnIndex:p.columnIndex,sourceAddonIndex:p.addonIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:n.addonIndex,isAbove:null!==(u=null==_?void 0:_.isTop)&&void 0!==u&&u})}break;case r.t.CollectionItemAddon:var g,I;if(t.type===r.t.Addon||t.type===r.t.Div)return void h({sourceSectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,sourceAddonIndex:t.addonIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:n.addonIndex,destinationItemAddonIndex:n.itemAddonIndex,isAbove:null!==(I=null==_?void 0:_.isTop)&&void 0!==I&&I});if(t.itemIndex!==n.itemIndex||!(0,y.$K)(t.itemAddonIndex)||!(0,y.$K)(n.itemAddonIndex))return;m({sourceSectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,sourceAddonIndex:t.addonIndex,sourceItemAddonIndex:t.itemAddonIndex,destinationItemAddonIndex:n.itemAddonIndex,sourceChildIndex:t.childIndex,destinationChildIndex:n.childIndex,isAbove:null!==(g=null==_?void 0:_.isTop)&&void 0!==g&&g,isEmptyChild:n.isEmptyChild})}},W=function(l){var s=l.activeCurrent,f=l.overCurrent;switch(f.type){case r.t.NestedRow:var b,v=f.nestedRowData;if(!(0,y.$K)(v))return;if((0,y.r3)([r.Dw.AddonElement,r.Dw.DivElement],s.type))e({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,addon:s.content,isAbove:null===(b=null==_?void 0:_.isTop)||void 0===b||b});else if((0,y.r3)([r.Dw.RowElement],s.type)){var m;d({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,isTop:null===(m=null==_?void 0:_.isTop)||void 0===m||m})}else if((0,y.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,y.Rx)(x)}if((0,p.L)(s.content)){var E=s.content.json;I=(0,y.Rx)(E)}if(!(0,y.$K)(I))return;var S=T(I[0].id).index;i({sectionData:I,sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,nestedSectionIndex:S,isAbove:null===(h=null==_?void 0:_.isTop)||void 0===h||h})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var O,w=s.content.code,D=(0,y.Rx)(w);if(!(0,y.$K)(D))return;var A=(0,y.gX)(D)?{name:D.name,sections:D.rows,addons:D.addon}:D;n({addonData:A,sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,isAbove:null===(O=null==_?void 0:_.isTop)||void 0===O||O})}break;case r.t.Section:if(r.Dw.RowElement===s.type){var P,C=null===(P=null==_?void 0:_.isTop)||void 0===P||P;a({layout:"6+6",index:C?f.sectionIndex:f.sectionIndex+1})}else if((0,y.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var R,L=null;if((0,u.fp)(s.content)){var Z=s.content.section;L=(0,y.Rx)(Z)}if((0,p.L)(s.content)){var B=s.content.json;L=(0,y.Rx)(B)}if(!(0,y.$K)(L))return;o({sectionData:L,sectionIndex:f.sectionIndex,isAbove:null===(R=null==_?void 0:_.isTop)||void 0===R||R})}break;case r.t.Column:if(r.Dw.ColumnsElement===s.type){var j,k=null===(j=null==_?void 0:_.isLeft)||void 0===j||j;c({sectionIndex:f.sectionIndex,index:k?f.columnIndex:f.columnIndex+1})}else if((0,y.r3)([r.Dw.RowElement],s.type))d({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:0,isTop:!0});else if((0,y.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var W,U=null;if((0,u.fp)(s.content)){var q=s.content.section;U=(0,y.Rx)(q)}if((0,p.L)(s.content)){var N=s.content.json;U=(0,y.Rx)(N)}if(!(0,y.$K)(U))return;var $=T(U[0].id).index;i({sectionData:U,sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:(0,y.$K)(f.addonIndex)?f.addonIndex:0,nestedSectionIndex:$,isAbove:null===(W=null==_?void 0:_.isTop)||void 0===W||W})}else if((0,y.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 M,G=s.content;e({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,childIndex:f.childIndex,addon:G,isAbove:null===(M=null==_?void 0:_.isTop)||void 0===M||M})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var K=s.content.code,V=(0,y.Rx)(K);if(!(0,y.$K)(V))return;var F=(0,y.gX)(V)?{name:V.name,sections:V.rows,addons:V.addon}:V;n({addonData:F,sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:0,isAbove:!0})}break;case r.t.EmptyDivChild:if((0,y.r3)([r.Dw.AddonElement,r.Dw.DivElement,r.Dw.ProductListAddonElement,r.Dw.SingleAddonElement],s.type)||[r.oA.filter,r.oA.productList,r.oA.pagination].includes(s.content.name)){var H=s.content;e({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,childIndex:0,emptyDivChild:!0,addon:H,isAbove:!0})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var X=s.content.code,Y=(0,y.Rx)(X);if(!(0,y.$K)(Y))return;var z={name:Y.name,sections:Y.rows,addons:Y.addon};n({addonData:z,sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,childIndex:0,parentId:f.content.id,isAbove:!0})}break;case r.t.Addon:case r.t.DeepAddon:case r.t.Div:var J;if((0,y.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))e({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,childIndex:f.childIndex,addon:s.content,isAbove:null===(J=null==_?void 0:_.isTop)||void 0===J||J});else if((0,y.r3)([r.Dw.RowElement],s.type)&&!f.content.parent){var Q;d({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,isTop:null===(Q=null==_?void 0:_.isTop)||void 0===Q||Q})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var ee,te=s.content.code,ne=(0,y.Rx)(te);if(!(0,y.$K)(ne))return;var oe={name:ne.name,sections:ne.rows,addons:ne.addon};n({addonData:oe,sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,childIndex:f.childIndex,isAbove:null===(ee=null==_?void 0:_.isTop)||void 0===ee||ee})}else if((0,y.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var re,ie=null;if((0,u.fp)(s.content)){var ae=s.content.section;ie=(0,y.Rx)(ae)}if((0,p.L)(s.content)){var le=s.content.json;ie=(0,y.Rx)(le)}if(!(0,y.$K)(ie))return;var de=T(ie[0].id).index;i({sectionData:ie,sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,nestedSectionIndex:de,isAbove:null===(re=null==_?void 0:_.isTop)||void 0===re||re})}break;case r.t.TableItem:if((0,y.r3)([r.Dw.AddonElement],s.type)&&(0,y.$K)(f.tableItem)){var ce,se=s.content;t({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,childIndex:f.childIndex,tableItem:f.tableItem,addon:se,isAbove:null===(ce=null==_?void 0:_.isTop)||void 0===ce||ce})}break;case r.t.CollectionItemAddon:var ue;g({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,itemAddonIndex:(0,y.$K)(f.itemAddonIndex)?f.itemAddonIndex:0,childIndex:f.childIndex,addon:s.content,isAbove:null===(ue=null==_?void 0:_.isTop)||void 0===ue||ue});break;case r.XA:if((0,y.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var pe,fe=null;if((0,u.fp)(s.content)){var be=s.content.section;fe=(0,y.Rx)(be)}if((0,p.L)(s.content)){var ve=s.content.json;fe=(0,y.Rx)(ve)}if(!(0,y.$K)(fe))return;o({sectionData:fe,sectionIndex:f.sectionIndex,isAbove:null===(pe=null==_?void 0:_.isTop)||void 0===pe||pe})}}};return{dragElement:E,placeholderPosition:_}}(),d=a.dragElement,c=a.placeholderPosition;return(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{css:lo.contentWrapper,children:[(0,h.tZ)(be,{}),(0,h.tZ)("div",{css:lo.content,children:e.length>0?(0,h.tZ)(we.Fo,{id:"page",items:e,strategy:we.qw,children:(0,h.tZ)("div",{css:lo.sectionWrapper,role:"button",tabIndex:-1,onKeyDown:y.ZT,onClick:function(e){e.currentTarget===e.target&&((0,y.$K)(n)?i(void 0):t())},children:e.map((function(e,t){return e.parent?null:(0,h.tZ)(eo,{content:e,index:t,placeholderPosition:c},e.id)}))})}):(0,h.tZ)("div",{css:lo.emptyLayoutWrapper,role:"button",tabIndex:-1,onKeyDown:y.ZT,onClick:function(e){e.currentTarget===e.target&&((0,y.$K)(n)?i(void 0):t())},children:!(0,y.$K)(d)||d.type!==r.Dw.BlockElement&&d.type!==r.Dw.SavedSectionElement?(0,h.tZ)(oe,{}):(0,h.tZ)(W,{id:(0,y.x0)(),customStyle:lo.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:d})]})};var lo={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{",v.iZ.resetButton,";width:100%;height:300px;",v.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";};label:emptyChildren;")}}}]);