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