Файловый менеджер - Редактировать - /home/lmsyaran/public_html/administrator/components/com_sppagebuilder/assets/editor/dist/js/970.min.js
Назад
/*! For license information please see 970.min.js.LICENSE.txt */ "use strict";(self.webpackChunkreact_typescript_webpack_backend_editor=self.webpackChunkreact_typescript_webpack_backend_editor||[]).push([[970],{8970:(e,t,n)=>{n.r(t),n.d(t,{default:()=>yn});var o=n(7264),r=n(3106),i=n(824),a=n(4185),l=n(9752),d=n(917),c=n(1234),s=n(7230),u=n(1518),p=n(2967);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var b=function(e){return"object"===f(e)&&null!==e&&!("id"in e)},v=n(1921),y=n(230),m=n(3935),h=n(5944),g={sideEffects:(0,l.Ai)({styles:{active:{opacity:"0.5"}}})},I=[r.t.Section,r.t.NestedRow];const x=function(e){var t=e.content,n=(0,c.$)(),i=(0,s.x)((function(e){return e.addonStructure})),a=function(e){var t=(0,y.Rx)(e.code).name;return i[t].icon};return t?(0,m.createPortal)((0,h.tZ)(l.y9,{dropAnimation:g,children:function(){if(b(t))return(0,h.BX)("div",{css:O.addonItem,children:[(0,h.tZ)("span",{dangerouslySetInnerHTML:{__html:t.icon}}),(0,h.tZ)("span",{children:t.title})]});if((0,u.$F)(t)&&t.type===r.Dw.SavedAddonElement)return(0,h.BX)("div",{css:O.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:a(t)}}),(0,h.tZ)("span",{"data-addon-title":!0,children:t.title})]});if(t.type===r.Dw.SavedSectionElement)return(0,h.BX)("div",{css:O.savedAddon,children:[(0,h.tZ)("span",{"data-drag-icon":!0,children:(0,h.tZ)(o.Z,{name:"dragger",height:24,width:24})}),(0,h.tZ)("span",{"data-addon-icon":!0,children:(0,h.tZ)(o.Z,{name:"blocksDuo"})}),(0,h.tZ)("span",{"data-addon-title":!0,children:t.title})]});if((0,p.L)(t)&&t.type===r.Dw.BlockElement)return(0,h.BX)("div",{css:O.sectionThumb,children:[(0,h.tZ)("div",{css:O.thumbImage,children:(0,h.tZ)("img",{src:t.thumb,alt:t.title,draggable:!1})}),(0,h.tZ)("div",{css:O.thumbFooter,children:t.title})]});if((0,y.r3)(I,t.type)){var e=t.type===r.t.NestedRow?"COM_SPPAGEBUILDER_EDITOR_OVERLAY_NESTED_ROW_TITLE":"COM_SPPAGEBUILDER_EDITOR_OVERLAY_SECTION_TITLE";return(0,h.BX)("div",{css:O.placedAddon(t.type),children:[(0,h.BX)("div",{css:O.iconAndTitle(t.type),children:[(0,h.tZ)(o.Z,{name:"dragger"}),(0,h.tZ)("span",{children:n(e)})]}),(0,h.tZ)("span",{css:O.settingsButton,children:(0,h.tZ)(o.Z,{name:"sliders"})})]})}return t.type===r.t.Column?(0,h.BX)("div",{css:O.placedAddon(t.type),children:[(0,h.BX)("div",{css:O.iconAndTitle(t.type),children:[(0,h.tZ)(o.Z,{name:"columnsAlt"}),(0,h.tZ)("span",{children:n("COM_SPPAGEBUILDER_EDITOR_OVERLAY_COLUMN_TITLE")})]}),(0,h.tZ)("button",{type:"button",css:O.dragHandler(t.type),"data-addon-drag-handler":!0,children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})})]}):(0,h.BX)("div",{css:O.placedAddon(t.type),children:[(0,h.BX)("div",{css:O.iconAndTitle(t.type),children:[(0,h.tZ)("span",{dangerouslySetInnerHTML:{__html:t.icon}}),(0,h.tZ)("span",{children:t.title})]}),(0,h.tZ)("button",{type:"button",css:O.dragHandler(t.type),"data-addon-drag-handler":!0,children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})})]})}()}),document.body):null};var E={name:"ebhkkd-placedAddon",styles:"border-top-left-radius:0;label:placedAddon;"},O={addonItem:(0,d.iv)("display:flex;align-items:center;background-color:",i.qo.base.white,";border-radius:",i.E0[5],";box-shadow:",i.AF.dropzone,";padding:",i.W0[8],";gap:",i.W0[8],";cursor:grab;&>span:first-of-type{svg,img{width:18px;height:18px;}}&>span:last-of-type{",a.c.caption(),";",v.iZ.textEllipsis,";};label:addonItem;"),savedAddon:(0,d.iv)("display:flex;align-items:center;background-color:",i.qo.base.white,";border-radius:",i.E0[5],";box-shadow:",i.AF.addon,";padding:",i.W0[6]," ",i.W0[6]," ",i.W0[6]," ",i.W0[24],";gap:",i.W0[8],";cursor:grab;position:relative;svg{color:",i.qo.icon.default,";}[data-addon-icon]{line-height:1;>svg{height:16px;width:16px;}}[data-drag-icon]{position:absolute;left:",i.W0[2],";top:0;height:100%;display:flex;align-items:center;}[data-addon-title]{",a.c.body(),";",v.iZ.textEllipsis,";color:",i.qo.text.default,";};label:savedAddon;"),placedAddon:function(e){return(0,d.iv)("width:250px;height:40px;background-color:",i.qo.base.white,";border:1px solid ",i.qo.stroke.success,";border-radius:",i.E0[2],";position:relative;padding:",i.W0[16],";box-shadow:",i.AF.dropzone,";display:flex;justify-content:space-between;align-items:center;",!(0,y.r3)(I,e)&&E," ",(0,y.r3)(I,e)&&(0,d.iv)("width:100%;border-color:",i.qo.stroke.primary,";border-radius:",i.E0[6],";height:80px;;label:placedAddon;")," ",e===r.t.Column&&(0,d.iv)("border-color:",i.qo.stroke.primary,";height:42px;;label:placedAddon;")," ",e===r.t.Div&&(0,d.iv)("border-color:",i.qo.alternate.div,";;label:placedAddon;"),";;label:placedAddon;")},dragHandler:function(e){return(0,d.iv)(v.iZ.resetButton,";",v.iZ.flexCenter(),";border-top-left-radius:",i.E0[4],";border-bottom-left-radius:",i.E0[4],";background-color:",i.qo.base.success,";color:",i.qo.base.white,";width:12px;height:18px;position:absolute;top:-1px;left:0;transform:translateX(-100%);cursor:grab!important;",e===r.t.Column&&(0,d.iv)("background-color:",i.qo.stroke.primary,";;label:dragHandler;")," ",e===r.t.Div&&(0,d.iv)("background-color:",i.qo.alternate.div,";;label:dragHandler;"),";;label:dragHandler;")},iconAndTitle:function(e){return(0,d.iv)("display:flex;gap:",i.W0[8],";width:100%;height:100%;align-items:center;cursor:grab;svg{width:18px;height:18px;color:",i.qo.stroke.success,";",(0,y.r3)(I,e)&&(0,d.iv)(":first-of-type{color:",i.qo.icon.default,";height:32px;width:32px;};label:iconAndTitle;")," ",((0,y.r3)(I,e)||e===r.t.Column)&&(0,d.iv)("color:",i.qo.stroke.primary,";;label:iconAndTitle;")," ",e===r.t.Div&&(0,d.iv)("color:",i.qo.alternate.div,";;label:iconAndTitle;"),";}&>span{",a.c.caption(),";",(0,y.r3)(I,e)&&(0,d.iv)(a.c.heading5(),";;label:iconAndTitle;"),";};label:iconAndTitle;")},settingsButton:(0,d.iv)(v.iZ.centeredFlex,";border:1px solid ",i.qo.stroke.neutral,";border-radius:",i.E0[6],";width:32px;height:32px;svg{color:",i.qo.icon.default,";transition:color 0.3s ease-in-out;};label:settingsButton;"),sectionThumb:(0,d.iv)("background-color:",i.qo.background.white,";border-radius:",i.E0[4],";box-shadow:",i.AF.addonHover,";cursor:grab;;label:sectionThumb;"),thumbImage:(0,d.iv)("height:80px;width:100%;background-color:",i.qo.background.neutral,";img{width:100%;height:100%;object-fit:contain;};label:thumbImage;"),thumbFooter:(0,d.iv)(a.c.tiny(),";padding:",i.W0[2]," ",i.W0[8],";;label:thumbFooter;")},S=n(2811),w=n(2739),D=n(3772),A=n(4285),_=function(e){var t=e.disable,n=void 0!==t&&t,o=e.isDragging,r=e.transition,i=e.transform;return n?null:{transform:A.ux.Transform.toString(i),transition:r,opacity:o?.5:void 0}},P=n(7294);function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach((function(t){Z(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Z(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==C(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==C(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===C(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var k=function(e){var t,n=e.active,o=e.over,i=null==n?void 0:n.data.current,a=null==o?void 0:o.data.current,l=null;if((null==a?void 0:a.type)===r.t.TableItem&&b(null==i?void 0:i.content)){var d,c=(null!==(d=null==i?void 0:i.content)&&void 0!==d?d:{}).name;if((0,y.r3)(["accordion","tab","table_advanced"],c))return!1}if((0,y.$K)(a)){var s=a.type;(0,y.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],s)&&(t=a.content,(0,y.Kn)(t)&&(0,y.nr)(t,"id")&&(0,y.nr)(t,"settings"))&&a.content.parent&&(s=r.t.EmptyDivChild),l=(0,y.r3)((0,y.zt)(r.Dw),null==i?void 0:i.type)?r.LP[s]:r.IR[s]}return(0,y.$K)(l)&&(l.accepted.length>0&&(0,y.r3)(l.accepted,null==i?void 0:i.type)||l.rejected.length>0&&!(0,y.r3)(l.rejected,null==i?void 0:i.type)||r.Eb in l)};const j=function(e){var t,n=e.id,o=e.data,r=e.disabled,i=void 0!==r&&r,a=e.isHidden,d=void 0!==a&&a,s=e.children,u=e.customStyle,p=(0,c.$)(),f=(0,l.Zj)({id:n,data:o,disabled:i}),b=f.setNodeRef,v=f.isOver,y=f.active,m=f.over,g=k({active:y,over:m});return(0,h.tZ)("div",{css:[u,W.container(v,d,g),";label:Droppable;"],ref:b,children:!g&&v?(0,h.tZ)("div",{css:W.notAllowed(null==m||null===(t=m.data.current)||void 0===t?void 0:t.type),children:(0,h.tZ)("span",{children:p("COM_SPPAGEBUILDER_EDITOR_ADDON_NOT_ALLOWED")})}):s})};var W={container:function(e,t,n){return(0,d.iv)(e&&!t&&n&&(0,d.iv)("background-color:",i.qo.base.surface,";;label:container;")," ",e&&!t&&!n&&(0,d.iv)("background-color:",i.qo.background.error,";;label:container;"),";;label:container;")},notAllowed:function(e){var t=e===r.t.TableItem?"40px":"100px";return(0,d.iv)("height:",t,";",v.iZ.flexCenter(),";span{",a.c.caption("medium")," padding:",i.W0[4]," ",i.W0[8],";background-color:",i.qo.base.error,";border-radius:",i.E0[2],";color:",i.qo.base.white,";};label:notAllowed;")}},q=n(3871),U=n(1309),N=n(1709),M=n(802),G=n(1954),$=n(1073),K=n(7536),F=n(5350);function V(e){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V(e)}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){Y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Y(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==V(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==V(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===V(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var z=[{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 J=function(e){var t=e.isOpen,n=e.defaultLayout,r=e.nestedRowData,i=e.handleClose,a=e.position,l=e.popoverRef,d=e.index,s=(0,c.$)(),u=(0,M.O)(),p=u.control,f=u.setValue,b=u.getValues,v=u.watch;(0,P.useEffect)((function(){(0,y.$K)(n)&&f("layout",n.replaceAll(",","+"))}),[n,f]);var m=(0,D.o)((function(e){return e.addNewSection})),g=v("layout"),I=(0,D.o)((function(e){return e.addNestedRow})),x=(0,D.o)((function(e){return e.updateSectionLayout})),E=(0,$.j)((function(e){return e.setActiveAction})),O=function(){f("layout",""),i()},S=function(e){(0,y.$K)(n)?x({index:d,layout:e}):(0,y.$K)(r)?I(H(H({},r),{},{layout:e,isTop:!1})):m({layout:e,index:d+1}),O()};return(0,h.tZ)(G.h,{isOpen:t,onClickOutside:O,children:(0,h.tZ)("div",{css:[Q.popoverWrapper,{left:a.left,top:a.top},";label:SectionPopover;"],ref:l,children:(0,h.BX)("div",{css:Q.wrapper,children:[(0,h.BX)("div",{css:Q.importLayout,children:[(0,h.BX)("div",{css:Q.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:Q.importLayoutText,children:s("COM_SPPAGEBUILDER_EDITOR_IMPORT_LAYOUT_DESCRIPTION")}),(0,h.tZ)(q.Z,{variant:"secondary",buttonCss:Q.importLayoutButton,onClick:function(){i(),E("section-library")},children:"Explore"})]}),(0,h.BX)("div",{css:Q.selectLayout,children:[(0,h.tZ)("button",{css:Q.closeButton,onClick:O,children:(0,h.tZ)(o.Z,{name:"cross",width:20,height:20})}),(0,h.tZ)("div",{css:Q.layoutOptions,children:z.map((function(e){return(0,h.BX)("button",{type:"button",css:Q.layoutButton,onClick:function(){S(e.size)},children:[(0,h.tZ)(o.Z,{name:e.icon,width:50,height:20}),(0,h.tZ)("div",{children:e.size})]},e.id)}))}),(0,h.BX)("div",{css:Q.generateLayout,children:[(0,h.tZ)("p",{css:Q.customRows,children:s("COM_SPPAGEBUILDER_EDITOR_CREATE_CUSTOM_LAYOUT")}),(0,h.BX)("div",{css:Q.generateForm,children:[(0,h.tZ)(K.Qr,{control:p,name:"layout",render:function(e){return(0,h.tZ)(F.Z,H(H({},e),{},{placeholder:"e.g. 8+4"}))}}),(0,h.tZ)(q.Z,{variant:"primary",disabled:!g,onClick:function(){var e=b("layout");S(e)},children:s("COM_SPPAGEBUILDER_EDITOR_GENERATE")})]})]})]})]})})})};var Q={popoverWrapper:{name:"127z30k-popoverWrapper",styles:"position:absolute;width:100%;max-width:622px;label:popoverWrapper;"},wrapper:(0,d.iv)("z-index:",i.W5.dropdown,";background-color:",i.qo.base.white,";box-shadow:",i.AF.popover,";border-radius:",i.E0[6],";display:grid;grid-template-columns:196px auto;;label:wrapper;"),importLayout:(0,d.iv)("border-right:1px solid ",i.qo.stroke.neutral,";display:flex;flex-direction:column;justify-content:center;align-items:center;padding:",i.W0[24],";;label:importLayout;"),importLayoutIcons:(0,d.iv)("display:flex;gap:",i.W0[16],";color:",i.qo.icon.default,";;label:importLayoutIcons;"),importLayoutText:(0,d.iv)("color:",i.qo.text.neutral,";font-size:",i.JB[12],";line-height:",i.Nv[18],";text-align:center;margin-top:",i.W0[16],";margin-bottom:",i.W0[24],";;label:importLayoutText;"),importLayoutButton:(0,d.iv)("svg{color:",i.qo.icon.default,";}&:hover{svg{color:",i.qo.icon.primary,";}};label:importLayoutButton;"),selectLayout:{name:"fgypav-selectLayout",styles:"position:relative;label:selectLayout;"},closeButton:(0,d.iv)(v.iZ.resetButton,";position:absolute;top:",i.W0[8],";right:",i.W0[8],";padding:",i.W0[2],";background-color:",i.qo.background.neutral,";color:",i.qo.icon.default,";border-radius:",i.E0[2],";;label:closeButton;"),layoutOptions:(0,d.iv)("display:grid;grid-template-columns:repeat(5, 1fr);padding:",i.W0[40]," ",i.W0[48]," ",i.W0[32]," ",i.W0[32],";gap:",i.W0[24],";;label:layoutOptions;"),layoutButton:(0,d.iv)(v.iZ.resetButton,";",a.c.caption(),";color:",i.qo.text.neutral,";display:flex;flex-direction:column;align-items:center;gap:",i.W0[8],";transition:color 0.3s ease-out;svg{color:",i.qo.icon.neutral,";transition:color 0.3s ease-out;}&:hover{color:",i.qo.text.primary,";svg{color:",i.qo.text.primary,";}};label:layoutButton;"),generateLayout:(0,d.iv)("border-top:1px solid ",i.qo.stroke.neutral,";position:relative;;label:generateLayout;"),customRows:(0,d.iv)("position:absolute;width:60%;top:0;left:50%;transform:translateX(-50%) translateY(-50%);background-color:",i.qo.background.white,";color:",i.qo.text.neutral,";font-size:",i.JB[12],";line-height:",i.Nv[18],";text-align:center;;label:customRows;"),generateForm:(0,d.iv)("display:flex;gap:",i.W0[16],";padding:",i.W0[28]," ",i.W0[32]," ",i.W0[24],";>div{flex:1;};label:generateForm;")},ee=n(9194);function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const ne=function(){var e,t,n=(0,P.useRef)(null),r=(0,c.$)(),i=(0,N.d)().showModal,l=(e=(0,P.useState)(!1),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=l[0],s=l[1],u=(0,K.Gc)(),p=(0,ee.HX)(),f=(0,G.l)({isOpen:d,isDropdown:!0,arrow:"middle"}),b=f.triggerRef,v=f.position,y=f.popoverRef;return(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{css:oe.wrapper,ref:b,children:[(0,h.tZ)("h4",{css:[a.c.heading4("medium"),";label:EmptyLayout;"],children:r("COM_SPPAGEBUILDER_EDITOR_START_CREATING")}),(0,h.BX)("div",{css:oe.buttonWrapper,children:[(0,h.tZ)(q.Z,{variant:"secondary",icon:(0,h.tZ)(o.Z,{name:"layout"}),onClick:function(){i({component:U.Z,props:{title:r("COM_SPPAGEBUILDER_EDITOR_LAYOUT_MODAL_LAYOUTS"),form:u},closeOnOutsideClick:!0})},children:r("COM_SPPAGEBUILDER_EDITOR_LAYOUT_BUNDLES")}),(0,h.tZ)(q.Z,{variant:"primary",icon:(0,h.tZ)(o.Z,{name:"plus"}),onClick:function(){return s(!0)},children:r("COM_SPPAGEBUILDER_EDITOR_ADD_NEW_SECTION")})]}),(0,h.BX)("p",{css:oe.importLayout,children:[r("COM_SPPAGEBUILDER_EDITOR_OR"),(0,h.tZ)("button",{type:"button",onClick:function(){var e;return null===(e=n.current)||void 0===e?void 0:e.click()},children:r("COM_SPPAGEBUILDER_EDITOR_IMPORT_LAYOUT")}),(0,h.tZ)("input",{ref:n,type:"file",hidden:!0,onChange:function(e){e.target.files&&(p.mutate(e.target.files[0]),e.target.value="")}})]})]}),(0,h.tZ)(J,{isOpen:d,handleClose:function(){return s(!1)},position:v,popoverRef:y,index:0})]})};var oe={wrapper:(0,d.iv)("background-color:",i.qo.background.white,";text-align:center;padding:",i.W0[72]," 0;border-radius:",i.E0[6],";position:relative;;label:wrapper;"),buttonWrapper:(0,d.iv)("display:flex;justify-content:center;gap:",i.W0[16],";margin-top:",i.W0[40],";margin-bottom:",i.W0[32],";;label:buttonWrapper;"),importLayout:(0,d.iv)(a.c.body(),";color:",i.qo.text.neutral,";button{",v.iZ.resetButton,";color:",i.qo.action.primary.default,";padding:0;};label:importLayout;")},re=n(8138),ie=n(2447),ae=n(2328),le=n(7679);function de(e){return de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},de(e)}function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(n),!0).forEach((function(t){ue(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ue(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==de(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==de(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===de(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const fe=function(){var e,t,n=(0,c.$)(),r=(0,K.Gc)(),i=(e=(0,P.useState)(!1),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],l=i[1],d=r.getValues("title"),s=(0,ie.Z)(re.F.PageEditor).id,u=(0,le.z1)(Number(s)),p=(0,ae.v)((function(e){return e.appConfig})),f=(0,P.useMemo)((function(){return u.data?u.data.url:""}),[u.data]);return(0,h.BX)("div",{css:me.wrapper(a),children:[(0,h.BX)("div",{css:me.fieldAndButton(a),children:[(0,h.tZ)("div",{css:me.inputWrapper(a),children:(0,h.tZ)(K.Qr,{control:r.control,name:"title",render:function(e){return(0,h.tZ)(F.Z,se(se({},e),{},{label:n("COM_SPPAGEBUILDER_EDITOR_PAGE_NAME"),placeholder:n("COM_SPPAGEBUILDER_EDITOR_PAGE_NAME")}))}})}),a&&(0,h.tZ)("div",{css:me.pageName,children:d||n("COM_SPPAGEBUILDER_EDITOR_PAGE_NAME")}),!!p.enable_frontend_editing&&(0,h.BX)("a",{css:me.frontendEditorButton(a),href:f,target:"_blank",rel:"noreferrer",children:[(0,h.tZ)(o.Z,{name:"parmaLink",width:16,height:16}),(0,h.tZ)("span",{children:n("COM_SPPAGEBUILDER_EDITOR_FRONTEND_EDITOR")})]})]}),(0,h.tZ)("button",{type:"button",css:me.drawerHook(a),onClick:function(){return l((function(e){return!e}))},"data-drawer":!0,children:(0,h.tZ)(o.Z,{name:"angleUp"})})]})};var be={name:"g85fjd-drawerHook",styles:"svg{transform:rotate(-180deg);};label:drawerHook;"},ve={name:"1n6ug0d-fieldAndButton",styles:"align-items:center;label:fieldAndButton;"},ye={name:"1dw40py-inputWrapper",styles:"overflow:hidden;opacity:0;width:0;height:0;label:inputWrapper;"},me={wrapper:function(e){return(0,d.iv)("background-color:",i.qo.base.surface,";padding:",i.W0[24]," ",i.W0[36],";border-bottom:1px solid ",i.qo.stroke.neutral,";position:relative;overflow:hidden;transition:padding 0.3s ease;",e&&(0,d.iv)("padding:",i.W0[6]," ",i.W0[36],";&:hover{&>[data-drawer]{bottom:0;}};label:wrapper;"),";;label:wrapper;")},inputWrapper:function(e){return(0,d.iv)("width:100%;opacity:1;transition:opacity 0.3s ease-in-out,height 0.3s ease-in-out;",e&&ye,";;label:inputWrapper;")},pageName:(0,d.iv)(a.c.body("medium"),";width:100%;;label:pageName;"),fieldAndButton:function(e){return(0,d.iv)("width:100%;display:flex;gap:",i.W0[16],";align-items:end;",e&&ve,";;label:fieldAndButton;")},frontendEditorButton:function(e){return(0,d.iv)(a.c.body(),";background-color:",i.qo.base.white,";border-radius:",i.E0[24],";padding:",i.W0[4]," ",i.W0[12],";display:flex;align-items:center;gap:",i.W0[8],";color:",i.qo.text.neutral,";flex-shrink:0;svg{fill:none;}",!e&&(0,d.iv)("margin-bottom:",i.W0[2],";;label:frontendEditorButton;")," &:hover{color:",i.qo.text.hover,";}&::before,&::after{content:''!important;all:unset!important;};label:frontendEditorButton;")},drawerHook:function(e){return(0,d.iv)(v.iZ.resetButton,";",v.iZ.centeredFlex,";width:64px;height:16px;background:#fff;position:absolute;bottom:0;left:50%;transform:translateX(-50%);border-top-left-radius:6px;border-top-right-radius:6px;transition:opacity 0.3s ease-in-out,bottom 0.3s ease-in-out;",e&&(0,d.iv)("&:not(:focus){bottom:-",i.W0[16],";}&:hover{bottom:0;};label:drawerHook;")," svg{color:",i.qo.icon.default,";transition:transform 0.3s ease-in-out;}",e&&be,";;label:drawerHook;")}},he=n(7025);function ge(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ie(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const xe=function(e){var t=e.text,n=e.updateAdminLabel,r=(0,c.$)(),i=ge((0,P.useState)(!1),2),a=i[0],l=i[1],d=ge((0,P.useState)(t),2),s=d[0],u=d[1];return(0,h.tZ)("div",{css:Ee.wrapper,children:a?(0,h.tZ)(h.HY,{children:(0,h.tZ)("div",{css:Ee.textInputWrapper,children:(0,h.tZ)(he.Z,{value:s,onChange:function(e){return u(e)},onKeyDown:function(e,t){t.stopPropagation(),"Escape"===e&&l(!1),"Enter"===e&&(n(s),l(!1))},onBlur:function(){return l(!1)},focusOnMount:!0})})}):(0,h.BX)(h.HY,{children:[(0,h.tZ)("span",{children:t}),(0,h.tZ)(q.Z,{title:r("COM_SPPAGEBUILDER_EDITOR_CLICK_EDIT_NAME"),variant:"text",icon:(0,h.tZ)(o.Z,{name:"pencil",height:10,width:10}),onClick:function(e){e.stopPropagation(),l(!0)}})]})})};var Ee={wrapper:(0,d.iv)("display:flex;justify-content:start;align-items:center;gap:",i.W0[10],";>button{padding:0;opacity:0;transition:opacity 0.3s ease;svg{color:",i.qo.icon.default,";transition:color 0.3s ease;}}:hover{>button{opacity:1;}};label:wrapper;"),textInputWrapper:{name:"ksdv16-textInputWrapper",styles:"max-width:150px;label:textInputWrapper;"},actionButton:{name:"5dhf19-actionButton",styles:"width:16px;height:16px;label:actionButton;"}},Oe=n(1731),Se=n(5587),we=n(9101),De=n(6680),Ae=n(1030);function _e(e){return _e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_e(e)}function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(n),!0).forEach((function(t){Te(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Te(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==_e(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==_e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===_e(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Re(){Re=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,a=Object.create(i.prototype),l=new w(r||[]);return o(a,"_invoke",{value:x(e,n,l)}),a}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function p(){}function f(){}function b(){}var v={};d(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(D([])));m&&m!==t&&n.call(m,i)&&(v=m);var h=b.prototype=p.prototype=Object.create(v);function g(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function r(o,i,a,l){var d=s(e[o],e,i);if("throw"!==d.type){var c=d.arg,u=c.value;return u&&"object"==_e(u)&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,l)}))}l(d.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function x(e,t,n){var o="suspendedStart";return function(r,i){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===r)throw i;return{value:void 0,done:!0}}for(n.method=r,n.arg=i;;){var a=n.delegate;if(a){var l=E(a,n);if(l){if(l===u)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===o)throw o="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o="executing";var d=s(e,t,n);if("normal"===d.type){if(o=n.done?"completed":"suspendedYield",d.arg===u)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o="completed",n.method="throw",n.arg=d.arg)}}}function E(e,t){var n=t.method,o=e.iterator[n];if(void 0===o)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var r=s(o,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function D(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function t(){for(;++o<e.length;)if(n.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:A}}function A(){return{value:void 0,done:!0}}return f.prototype=b,o(h,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:f,configurable:!0}),f.displayName=d(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,d(e,l,"GeneratorFunction")),e.prototype=Object.create(h),e},e.awrap=function(e){return{__await:e}},g(I.prototype),d(I.prototype,a,(function(){return this})),e.AsyncIterator=I,e.async=function(t,n,o,r,i){void 0===i&&(i=Promise);var a=new I(c(t,n,o,r),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(h),d(h,l,"Generator"),d(h,i,(function(){return this})),d(h,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},e.values=D,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function o(n,o){return a.type="throw",a.arg=e,t.next=n,o&&(t.method="next",t.arg=void 0),!!o}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),d=n.call(i,"finallyLoc");if(l&&d){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!d)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var r=o.arg;S(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:D(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Ze(e,t,n,o,r,i,a){try{var l=e[i](a),d=l.value}catch(e){return void n(e)}l.done?t(d):Promise.resolve(d).then(o,r)}var Be=(0,P.forwardRef)((function(e,t){var n=e.type,r=e.dataToSave,i=e.closePopover,a=(0,c.$)(),l=(0,M.O)({defaultValues:{title:""}}),d=!!r,s=(0,G.l)({isOpen:d,triggerRef:t,arrow:"top"}),p=s.position,f=s.popoverRef,b=(0,u._s)(),m=(0,u.E4)(),g=function(){var e,t=(e=Re().mark((function e(){var t;return Re().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.getValues("title"),(0,y.$K)(r)&&(0,y.$K)(t)){e.next=3;break}return e.abrupt("return");case 3:if("addon"!==n){e.next=8;break}return e.next=6,b.mutateAsync({title:t,code:r});case 6:e.next=10;break;case 8:return e.next=10,m.mutateAsync({title:t,section:r});case 10:I();case 11:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(o,r){var i=e.apply(t,n);function a(e){Ze(i,o,r,a,l,"next",e)}function l(e){Ze(i,o,r,a,l,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}(),I=function(){l.setValue("title",""),i()};return(0,h.tZ)(G.h,{isOpen:d,children:(0,h.BX)("div",{css:[ke.container,{position:"absolute",left:p.left,top:p.top},";label:SavePopover;"],ref:f,children:[(0,h.BX)("div",{css:ke.header,children:[(0,h.tZ)("span",{children:a("addon"===n?"COM_SPPAGEBUILDER_EDITOR_SAVE_ADDON_TITLE":"COM_SPPAGEBUILDER_EDITOR_SAVE_SECTION_TITLE")}),(0,h.tZ)("button",{type:"button",css:v.iZ.resetButton,onClick:I,children:(0,h.tZ)(o.Z,{name:"cross",height:24,width:24})})]}),(0,h.BX)("form",{css:ke.wrapper,onSubmit:l.handleSubmit((0,De.GI)(l,g)),children:[(0,h.tZ)("div",{css:ke.fieldWrapper,children:(0,h.tZ)(K.Qr,{name:"title",control:l.control,rules:Ce({},(0,Ae.n)()),render:function(e){return(0,h.tZ)(F.Z,Ce(Ce({},e),{},{label:a("addon"===n?"COM_SPPAGEBUILDER_EDITOR_ADDON_NAME":"COM_SPPAGEBUILDER_EDITOR_SECTION_NAME"),hasAutoFocus:!0}))}})}),(0,h.BX)("div",{css:ke.buttonWrapper,children:[(0,h.tZ)(q.Z,{variant:"secondary",onClick:I,children:a("COM_SPPAGEBUILDER_EDITOR_CREATE_PAGE_CANCEL")}),(0,h.tZ)(q.Z,{type:"submit",loading:b.isLoading||m.isLoading,children:a("addon"===n?"COM_SPPAGEBUILDER_EDITOR_SAVE_ADDON":"COM_SPPAGEBUILDER_EDITOR_SAVE_SECTION")})]})]})]})})}));const Le=Be;var ke={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;")},je=n(2445),We=n(2238),qe=function(e){var t,n,o,i,a,l,d,c=e.position,s=e.active,u=e.over,p=e.contentId,f=e.type,b=null==s?void 0:s.data.current,v=null==u?void 0:u.data.current;if((null==u?void 0:u.id)!==p||(null==v?void 0:v.type)!==f)return null;if(!c||!k({active:s,over:u}))return null;if((null==b?void 0:b.type)===r.t.Section&&b.type===v.type)return null;if(v.type===r.t.Column&&(null==b?void 0:b.type)!==r.Dw.ColumnsElement)return null;var m=[r.t.Addon,r.t.Div,r.t.DeepAddon];return m.includes(v.type)&&v.content.parent&&(0,y.r3)([r.Dw.RowElement,r.Dw.SavedSectionElement],null==b?void 0:b.type)||(0,y.r3)(m,null==b?void 0:b.type)&&(0,y.r3)(m,v.type)&&(null==b?void 0:b.sectionIndex)===v.sectionIndex&&b.columnIndex===v.columnIndex&&b.content.parent===v.content.parent||(null==b?void 0:b.type)===r.t.NestedRow&&(0,y.r3)(m,v.type)&&(null===(t=b.nestedRowData)||void 0===t?void 0:t.sectionIndex)===v.sectionIndex&&b.nestedRowData.columnIndex===v.columnIndex||v.type===r.t.NestedRow&&(0,y.r3)(m,null==b?void 0:b.type)&&(null==b?void 0:b.sectionIndex)===(null===(n=v.nestedRowData)||void 0===n?void 0:n.sectionIndex)&&(null==b?void 0:b.columnIndex)===(null===(o=v.nestedRowData)||void 0===o?void 0:o.columnIndex)||(null==b?void 0:b.type)===r.t.NestedRow&&v.type===r.t.NestedRow&&(null===(i=b.nestedRowData)||void 0===i?void 0:i.sectionIndex)===(null===(a=v.nestedRowData)||void 0===a?void 0:a.sectionIndex)&&(null===(l=b.nestedRowData)||void 0===l?void 0:l.columnIndex)===(null===(d=v.nestedRowData)||void 0===d?void 0:d.columnIndex)?null:Ue(c,f)},Ue=function(e,t){var n=i.W0[10];return t===r.t.Section&&(n=i.W0[16]),t===r.t.TableItem&&(n=i.W0[6]),(0,d.iv)("position:relative;&::after{content:'';background-color:",i.qo.background.placeholder,";position:absolute;",Ne(e,t,n),";};label:styles;")},Ne=function(e,t,n){return"column"===t?(0,d.iv)("top:0;bottom:0;width:2px;height:100%;",e.isLeft&&(0,d.iv)("left:-",n,";;label:positionStyle;")," ",!e.isLeft&&(0,d.iv)("right:-",n,";;label:positionStyle;"),";;label:positionStyle;"):(0,d.iv)("left:0;right:0;height:2px;width:100%;",e.isTop&&(0,d.iv)("top:-",n,";;label:positionStyle;")," ",!e.isTop&&(0,d.iv)("bottom:-",n,";;label:positionStyle;"),";;label:positionStyle;")},Me=n(4101),Ge=n(6651),$e=n(6795);function Ke(e){return function(e){if(Array.isArray(e))return Fe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fe(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var Ve=function(e){var t,n=e.addonName,o=e.copiedData,r=e.isTableItem,i=e.isNotFoundAddon;return[{id:"copy",icon:"copy",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_COPY",hide:r,isDisabled:i},{id:"pasteAbove",icon:"clipboardAbove",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_PASTE_ABOVE",isDisabled:!o.addon||i,hide:r},{id:"pasteBelow",icon:"clipboardBelow",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_PASTE_BELOW",isDisabled:!o.addon||i,hide:r},{id:"pasteStyle",icon:"clipboardBelow",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_STYLE_PASTE",isDisabled:!o.addon||i,hide:r||n!==(null===(t=o.addon)||void 0===t?void 0:t.name)},{id:"hide",icon:"eye",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_HIDE",isProFeature:!0,isDisabled:i},{id:"duplicate",icon:"clone",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_DUPLICATE",isDisabled:i},{id:"save",icon:"saveLine",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_SAVE",isProFeature:!0,hide:r,isDisabled:i},{id:"remove",icon:"trash",title:"COM_SPPAGEBUILDER_EDITOR_COLUMN_REMOVE",variant:"critical"}]};const Xe=function(e){var t=e.addonWidth,n=e.addonName,i=e.addonType,a=e.copiedData,l=e.handleActions,d=e.isNotFoundAddon,s=void 0!==d&&d,u=(0,c.$)();return(0,h.tZ)(we.Z,{actions:[].concat(Ke((0,y.$K)(t)&&t<=40?[{id:"settings",icon:"pencilOnBox",title:"COM_SPPAGEBUILDER_EDITOR_ADDON_SETTINGS"}]:[]),Ke(Ve({addonName:n,copiedData:a,isTableItem:i===r.t.TableItem,isNotFoundAddon:s}))),title:u("COM_SPPAGEBUILDER_EDITOR_ADDON_ACTIONS"),triggerButtonContent:(0,h.tZ)(o.Z,{name:"ellipsisY",width:16,height:16}),triggerButtonStyle:He.actionButton(),onSelect:l})};var He={actionButton:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,d.iv)(v.iZ.resetButton,";color:",i.qo.text.default,";display:flex;gap:",i.W0[8],";svg{color:",i.qo.icon.default,";}",!e&&(0,d.iv)(":hover{svg{color:",i.qo.icon.hover,";}};label:actionButton;"),";;label:actionButton;")}};const Ye=function(e){var t=e.id,n=void 0===t?(0,y.x0)():t,r=e.setNodeRef,i=e.isHidden,a=e.disabled,l=e.colors,d=e.placeholderStyle,s=e.sortableStyle,u=e.addonWidth,p=e.addonType,f=e.addonName,b=e.copiedData,v=e.handleActions,m=(0,c.$)(),g=(0,P.useRef)(null);return(0,h.tZ)(h.HY,{children:(0,h.tZ)("div",{id:n.toString(),css:[et.addon({isEditing:!1,isHidden:i,disabled:!0,colors:l}),d,s,";label:AddonNotFound;"],ref:r,children:(0,h.BX)("div",{css:et.addonTitleWrapper(a,u),children:[(0,h.tZ)(o.Z,{name:"exclamationTriangle",style:et.notFoundIcon}),(0,h.tZ)("span",{css:et.addonTitle,"data-addon-title":!0,children:m("COM_SPPAGEBUILDER_EDITOR_ADDON_NOT_FOUND")}),(0,h.tZ)("div",{ref:g,css:et.actionButtonWrapper(u),"data-action-button-wrapper":!0,children:(0,h.tZ)(Xe,{addonWidth:u,addonType:p,addonName:f,copiedData:b,handleActions:v,isNotFoundAddon:!0})})]})})})};var ze={name:"1f0vbk0-addonTitleWrapper",styles:"&>[data-addon-icon]{opacity:0;};label:addonTitleWrapper;"},Je={name:"tm5uzc-addonTitleWrapper",styles:"&>[data-addon-title]{opacity:0;};label:addonTitleWrapper;"},Qe={name:"1dqdmrn-addon",styles:"border-top-left-radius:0;label:addon;"},et={addon:function(e){var t=e.isEditing,n=e.isHidden,o=e.disabled,r=e.colors,a=e.isTableItem;return(0,d.iv)("border:1px solid ",i.qo.stroke.neutral,";border-radius:",i.E0[4],";width:100%;position:relative;z-index:",i.W5.dropdown,";",n&&(0,d.iv)("background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:addon;")," ",!o&&(0,d.iv)("background-color:",i.qo.base.white,";:hover{border:1px solid ",r.addon,";",!a&&Qe," &>[data-addon-drag-handler]{opacity:1;}};label:addon;")," ",t&&(0,d.iv)("border:1px solid ",r.addon,";background-color:",(0,Me.m4)(r.background,.2),";;label:addon;"),";;label:addon;")},addonTitleWrapper:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[8],";padding:",i.W0[10]," ",i.W0[12],";position:relative;overflow:hidden;cursor:pointer;",n===r.t.DeepAddon&&(0,d.iv)("padding:",i.W0[16],";;label:addonTitleWrapper;")," ",(0,y.$K)(t)&&t<=40&&(0,d.iv)("justify-content:center;padding:",i.W0[10]," 0;[data-addon-title]{display:none;};label:addonTitleWrapper;")," ",!e&&(0,d.iv)(":hover,:focus-within{",(0,y.$K)(t)&&t<=220&&Je," ",(0,y.$K)(t)&&t<=80&&ze,";&>[data-action-button-wrapper]{opacity:1;visibility:visible;}};label:addonTitleWrapper;"),";;label:addonTitleWrapper;")},addonTitle:(0,d.iv)(a.c.caption(),";white-space:nowrap;overflow:hidden;transition:opacity 0.3s ease-in-out;;label:addonTitle;"),actionButtonWrapper:function(e){return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[10],";position:absolute;right:",i.W0[16],";top:50%;transform:translateY(-50%);transition:opacity 0.3s ease-in-out;opacity:0;visibility:hidden;",(0,y.$K)(e)&&e<=220&&(0,d.iv)("right:",i.W0[8],";;label:actionButtonWrapper;")," ",(0,y.$K)(e)&&e<=80&&(0,d.iv)("gap:",i.W0[4],";right:50%;transform:translateY(-50%) translateX(50%);;label:actionButtonWrapper;"),";;label:actionButtonWrapper;")},notFoundIcon:(0,d.iv)("color:",i.qo.base.warning,";width:18px;height:18px;;label:notFoundIcon;")},tt=n(6248);function nt(e){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nt(e)}function ot(e){return function(e){if(Array.isArray(e))return st(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ct(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ct(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function it(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?it(Object(n),!0).forEach((function(t){lt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==nt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==nt(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===nt(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||ct(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ct(e,t){if(e){if("string"==typeof e)return st(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?st(e,t):void 0}}function st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var ut=new Set(["advancedcolor","advancedslider","alignment","boxshadow","buttons","color","margin","fonts","fontstyle","gradient","padding","slider","select","typography","radio"]),pt=["h1","h2","h3","h4","h5","h6","p","div","span","br","section","strong"],ft=function(e){var t,n=e.content,o=e.parentVisibility,r=e.tableItem,i=e.sectionIndex,a=e.columnIndex,l=e.index,d=e.childIndex,u=(0,c.$)(),p=dt((0,P.useState)(null),2),f=p[0],b=p[1],v=(0,S.T)().closeSettingPanel,m=(0,je.F)((function(e){return{type:e.type,payload:e.payload}}),tt.X),h=m.type,g=m.payload,I=(0,je.F)((function(e){return e.setSettings})),x=(0,D.o)((function(e){return e.copyAddon})),E=(0,D.o)((function(e){return e.pasteOrInsertAddon})),O=(0,D.o)((function(e){return e.pasteAddonStyle})),A=(0,s.x)((function(e){return e.globalSettings})),_=(0,D.o)((function(e){return e.duplicateAddon})),C=(0,D.o)((function(e){return e.duplicateTableItemAddon})),T=(0,D.o)((function(e){return e.copiedData})),R=(0,D.o)((function(e){return e.deleteAddon})),Z=(0,D.o)((function(e){return e.deleteTableItemAddon})),B=(0,D.o)((function(e){return e.changeAddonVisibility})),L=(0,D.o)((function(e){return e.page})),k=(0,w._)(),j=k.getAddon,W=k.getTableItem,q=(0,K.Gc)(),U=(0,s.x)((function(e){return e.addonStructure})),N=(0,Oe.p)().showToast,M=(0,y.$K)(n.visibility)&&!n.visibility,G=o&&n.visibility,$="addon"===h&&g.sectionIndex===i&&g.columnIndex===a&&g.addonIndex===l&&(0,y.$K)(g.tableItem)===(0,y.$K)(r);(0,y.$K)(r)&&($=$&&(null===(t=g.tableItem)||void 0===t?void 0:t.itemIdx)===r.itemIdx&&g.tableItem.rowItemIdx===r.rowItemIdx&&g.tableItem.contentItemIdx===r.contentItemIdx);var F=j({sectionIndex:i,columnIndex:a,addonIndex:l}),V=function(){var e,t,n;if("addon"!==h||g.sectionIndex!==i||g.columnIndex!==a||g.addonIndex!==l||(null===(e=g.tableItem)||void 0===e?void 0:e.itemIdx)!==(null==r?void 0:r.itemIdx)||(null===(t=g.tableItem)||void 0===t?void 0:t.rowItemIdx)!==(null==r?void 0:r.rowItemIdx)||(null===(n=g.tableItem)||void 0===n?void 0:n.contentItemIdx)!==(null==r?void 0:r.itemIdx)){var o,d;I("addon",{sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r}),(0,y.$K)(r)&&(o=null===(d=W({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(at(at({},q.getValues()),{},{settings:c||{}}))}};return{isEditing:$,isHidden:M,isVisible:G,addonDataToSave:f,resetAddonDataToSave:function(){return b(null)},handleActions:function(e){var t,o;switch(e){case"settings":V();break;case"copy":x({sectionIndex:i,columnIndex:a,addonIndex:l}),N({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_COPIED_SUCCESSFULLY")});break;case"pasteAbove":v(),(0,y.$K)(T.addon)&&(E({addonData:T.addon,sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d,parentId:n.parent,isAbove:!0}),N({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}));break;case"pasteBelow":v(),(0,y.$K)(T.addon)&&(E({addonData:T.addon,sectionIndex:i,columnIndex:a,addonIndex:l,parentId:n.parent,childIndex:d}),N({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}));break;case"pasteStyle":if(!(0,y.$K)(T.addon))return;var c=dt(T.addon.addons,1)[0],s=c.name,p=c.settings,f=U[s];if(n.name!==s||!(0,y.$K)(f)||!(0,y.$K)(p))return;var m=f.settings;if(!(0,y.$K)(m))return;var h=function e(t,n,o){var r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},l=rt((0,y.zt)(t));try{for(l.s();!(r=l.n()).done;){var d,c=r.value.fields,s=rt((0,y.J0)(c));try{var u=function(){var t=dt(d.value,2),r=t[0],l=t[1];if((0,y.$K)(o[r])&&!(0,y.r3)(pt,o[r])&&(ut.has(l.type)||i))a[r]=o[r];else if("repeatable"===l.type){var c=(0,y.kJ)(n[r])?n[r]:[],s=c.length,u=(0,y.kJ)(o[r])?o[r]:[],p=u.length;a[r]=u.slice(0,s).flatMap((function(t,n){var o;return at(at({},c[n]),e(null!==(o=l.attr)&&void 0!==o?o:{},c[n],t,!1,{}))})),s>p&&(a[r]=[].concat(ot(a[r]),ot(c.slice(p))))}};for(s.s();!(d=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}}}catch(e){l.e(e)}finally{l.f()}return a},g=h(m,null!==(t=n.settings)&&void 0!==t?t:{},p),I=h(A.style,null!==(o=n.settings)&&void 0!==o?o:{},p,!0);O({styleSettings:g,globalStyleSettings:I,sectionIndex:i,columnIndex:a,addonIndex:l}),v();break;case"hide":v(),B({sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r,visibility:!!n.visibility}),N({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}):_({sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d}),N({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")});break;case"remove":v(),(0,y.$K)(r)?Z({sectionIndex:i,columnIndex:a,addonIndex:l,tableItem:r}):R({sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d}),N({type:"success",message:u("COM_SPPAGEBUILDER_EDITOR_REMOVED_SUCCESSFULLY")});break;case"save":var S=L[i],w=S.columns[a],D=w.addons,P=(0,We.DV)({sections:L,rowId:S.id,columnId:w.id,addonList:D,addon:n});(0,y.$K)(P)&&b(JSON.stringify((0,y.M9)(P)))}},handleSetSettings:V}};function bt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function vt(e){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vt(e)}function yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function mt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yt(Object(n),!0).forEach((function(t){ht(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ht(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==vt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==vt(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===vt(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const It=function(e){var t,n,a,l,d=e.children,u=e.content,p=e.sectionIndex,f=e.columnIndex,b=e.index,v=e.childIndex,m=e.placeholderPosition,g=e.disabled,I=e.tableItem,x=e.addonType,E=void 0===x?r.t.Addon:x,O=e.colors,S=void 0===O?{addon:i.qo.alternate.addon,background:i.qo.background.lightGreen}:O,w=e.isCollapsible,A=void 0!==w&&w,C=(0,c.$)(),T=(0,D.o)((function(e){return e.copiedData})),R=(0,D.o)((function(e){return e.changeAddonVisibility})),Z=(0,D.o)((function(e){return e.updateAdminLabel})),B=ft(e),L=B.isEditing,j=B.isHidden,W=B.isVisible,q=B.handleActions,U=B.handleSetSettings,N=B.addonDataToSave,M=B.resetAddonDataToSave,G=(0,P.useRef)(null),K=(0,s.x)((function(e){return e.addonStructure})),F=(a=(0,P.useState)(!0),l=2,function(e){if(Array.isArray(e))return e}(a)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(a,l)||function(e,t){if(e){if("string"==typeof e)return gt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gt(e,t):void 0}}(a,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),V=F[0],X=F[1],H=(0,P.useRef)(V),Y=function(e){var t=e.sectionIndex,n=e.columnIndex,o=(0,P.useRef)(null),r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return bt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,P.useState)(),2),i=r[0],a=r[1],l=(0,$.j)((function(e){return e.activeAction})),d=(0,D.o)((function(e){return e.page}))[t].columns[n];return(0,P.useEffect)((function(){setTimeout((function(){var e,t=null===(e=o.current)||void 0===e?void 0:e.getBoundingClientRect().width;a(t)}),300)}),[l,d.settings.width]),{addonWidth:i,addonTitleRef:o}}({sectionIndex:p,columnIndex:f}),z=Y.addonWidth,J=Y.addonTitleRef,Q=(0,Se.nB)({id:u.id,data:{type:E,isVisible:W,sectionIndex:p,columnIndex:f,addonIndex:b,childIndex:v,tableItem:I,content:u}}),ee=Q.attributes,te=Q.listeners,ne=Q.setNodeRef,oe=Q.active,re=Q.over,ie=Q.isDragging,ae=Q.isOver,le=Q.transform,de=Q.transition,ce=k({active:oe,over:re}),se=K[u.name],ue=qe({position:m,contentId:u.id,active:oe,over:re,type:E}),pe=_({disable:"div"===(null==re||null===(t=re.data.current)||void 0===t?void 0:t.type),transform:le,transition:de,isDragging:ie});(0,P.useEffect)((function(){H.current&&X(!ie)}),[ie]),(0,P.useEffect)((function(){X(!j),H.current=!j}),[j]);var fe=E!==r.t.TableItem;if(!(0,y.$K)(se))return(0,h.tZ)(Ye,{id:u.id,setNodeRef:ne,isHidden:j,disabled:g,colors:S,placeholderStyle:ue,sortableStyle:pe,addonWidth:z,addonType:E,addonName:u.name,copiedData:T,handleActions:q});var be=(0,y.$K)(se.title)?se.title:"",ve=(0,y.$K)(se.icon)?se.icon:"",ye=(null===(n=u.settings)||void 0===n?void 0:n.admin_label)||be,me=g||ie||ae;return(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{id:u.id.toString(),css:[Dt.addon({isEditing:L,isHidden:j,disabled:me,colors:S,isTableItem:(0,y.$K)(I),droppable:!ae||ce}),ue,pe,";label:Addon;"],ref:ne,children:[(0,h.BX)("div",mt(mt(mt({ref:J,css:Dt.addonTitleWrapper(g,z,E,V),title:C("COM_SPPAGEBUILDER_EDITOR_ADDON_CLICK_TITLE"),onClick:function(){U()},onKeyDown:y.ZT},ee),E!==r.t.TableItem&&mt({},te)),{},{role:"button",tabIndex:-1,children:[(0,h.tZ)("span",{css:Dt.addonIcon,"data-addon-icon":!0,dangerouslySetInnerHTML:{__html:ve}}),(0,h.tZ)("span",{css:Dt.addonTitle,"data-addon-title":!0,children:(0,h.tZ)(xe,{text:ye,updateAdminLabel:function(e){(0,y.$K)(I)?Z({label:e,tableAddonItem:mt({sectionIndex:p,columnIndex:f,addonIndex:b},I)}):Z({label:e,addon:{sectionIndex:p,columnIndex:f,addonIndex:b}})}})}),(0,h.tZ)("div",{ref:G,css:Dt.actionButtonWrapper(z),"data-action-button-wrapper":!0,children:j?(0,h.BX)("button",{type:"button",css:Dt.actionButton(),onClick:function(e){e.stopPropagation(),R({sectionIndex:p,columnIndex:f,addonIndex:b,tableItem:I,visibility:u.visibility})},children:[(0,h.tZ)(o.Z,{name:"eyeSlash"}),(0,y.$K)(z)&&z>80&&C("COM_SPPAGEBUILDER_EDITOR_ACTION_VISIBILITY_SHOW")]}):(0,h.BX)(h.HY,{children:[A&&(0,h.tZ)("button",{type:"button",css:Dt.toggleButton(V),title:C("COM_SPPAGEBUILDER_EDITOR_EXPAND"),onClick:function(e){e.stopPropagation(),X((function(e){return!e})),H.current=!H.current},children:(0,h.tZ)(o.Z,{name:"angleUp",width:20,height:20})}),(0,y.$K)(z)&&z>40&&(0,h.tZ)("button",{type:"button",css:Dt.actionButton(),children:(0,h.tZ)(o.Z,{name:"pencilOnBox"})}),(0,h.tZ)(Xe,{addonWidth:z,addonType:E,addonName:u.name,copiedData:T,handleActions:q})]})})]})),(0,y.$K)(d)&&(0,h.tZ)("div",{css:Dt.contents(V),children:d}),fe&&(0,h.tZ)("button",mt(mt(mt({type:"button",css:Dt.addonDragHandler(S.addon),"data-addon-drag-handler":!0},ee),te),{},{children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})}))]}),(0,h.tZ)(Le,{ref:G,type:"addon",dataToSave:N,closePopover:M})]})};var xt={name:"sxudyk-contents",styles:"display:none;height:0;opacity:0;padding:0;overflow:hidden;label:contents;"},Et={name:"1bpgz68-toggleButton",styles:"transform:rotate(-180deg);label:toggleButton;"},Ot={name:"1f0vbk0-addonTitleWrapper",styles:"&>[data-addon-icon]{opacity:0;};label:addonTitleWrapper;"},St={name:"tm5uzc-addonTitleWrapper",styles:"&>[data-addon-title]{opacity:0;};label:addonTitleWrapper;"},wt={name:"1dqdmrn-addon",styles:"border-top-left-radius:0;label:addon;"},Dt={addon:function(e){var t=e.isEditing,n=e.isHidden,o=e.disabled,r=e.colors,a=e.isTableItem,l=e.droppable;return(0,d.iv)("border:1px solid ",l?i.qo.stroke.neutral:i.qo.stroke.error,";border-radius:",i.E0[4],";width:100%;position:relative;",n&&(0,d.iv)("background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:addon;")," ",!o&&(0,d.iv)("background-color:",i.qo.base.white,";:hover{border:1px solid ",r.addon,";",!a&&wt," &>[data-addon-drag-handler]{opacity:1;}};label:addon;")," ",t&&(0,d.iv)("border:1px solid ",r.addon,";background-color:",(0,Me.m4)(r.background,.2),";;label:addon;"),";;label:addon;")},addonTitleWrapper:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[8],";padding:",i.W0[10]," ",i.W0[12],";position:relative;overflow:hidden;cursor:pointer;",(n===r.t.DeepAddon||n===r.t.Div)&&o&&(0,d.iv)("padding:",i.W0[16],";;label:addonTitleWrapper;")," ",(0,y.$K)(t)&&t<=40&&(0,d.iv)("justify-content:center;padding:",i.W0[10]," 0;[data-addon-title]{display:none;};label:addonTitleWrapper;")," ",!e&&(0,d.iv)(":hover,:focus-within{",(0,y.$K)(t)&&t<=220&&St," ",(0,y.$K)(t)&&t<=80&&Ot,";&>[data-action-button-wrapper]{opacity:1;visibility:visible;}};label:addonTitleWrapper;"),";;label:addonTitleWrapper;")},addonIcon:(0,d.iv)("line-height:0;transition:opacity 0.3s ease-in-out;svg{width:20px;height:20px;color:",i.qo.icon.default,";}img{width:20px;height:20px;};label:addonIcon;"),addonTitle:(0,d.iv)(a.c.caption(),";white-space:nowrap;overflow:hidden;transition:opacity 0.3s ease-in-out;;label:addonTitle;"),actionButtonWrapper:function(e){return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[10],";position:absolute;right:",i.W0[16],";top:50%;transform:translateY(-50%);transition:opacity 0.3s ease-in-out;opacity:0;visibility:hidden;",(0,y.$K)(e)&&e<=220&&(0,d.iv)("right:",i.W0[8],";;label:actionButtonWrapper;")," ",(0,y.$K)(e)&&e<=80&&(0,d.iv)("gap:",i.W0[4],";right:50%;transform:translateY(-50%) translateX(50%);;label:actionButtonWrapper;"),";;label:actionButtonWrapper;")},actionButton:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,d.iv)(v.iZ.resetButton,";color:",i.qo.text.default,";display:flex;gap:",i.W0[8],";svg{color:",i.qo.icon.default,";}",!e&&(0,d.iv)(":hover{svg{color:",i.qo.icon.hover,";}};label:actionButton;"),";;label:actionButton;")},addonDragHandler:function(e){return(0,d.iv)(v.iZ.resetButton,";",v.iZ.flexCenter(),";border-top-left-radius:",i.E0[4],";border-bottom-left-radius:",i.E0[4],";background-color:",e,";color:",i.qo.base.white,";width:12px;height:18px;position:absolute;top:-1px;left:0;transform:translateX(-100%);opacity:0;cursor:grab!important;;label:addonDragHandler;")},notFoundIcon:(0,d.iv)("color:",i.qo.base.warning,";width:18px;height:18px;;label:notFoundIcon;"),toggleButton:function(e){return(0,d.iv)(v.iZ.resetButton,";padding:",i.W0[2],";transition:transform 0.3s ease,opacity 0.3s ease;svg{color:",i.qo.icon.default,";transition:color 0.3s ease-in-out;}:hover{svg{color:",i.qo.icon.hover,";border-color:",i.qo.stroke.hover,";}}:active{svg{color:",i.qo.icon.primary,";}}",!e&&Et,";;label:toggleButton;")},contents:function(e){return(0,d.iv)(!e&&xt,";;label:contents;")}};function At(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const _t=function(e){var t,n,i,a,l=e.content,d=e.isVisible,c=e.placeholderPosition,s=(i=(0,P.useState)(0),a=2,function(e){if(Array.isArray(e))return e}(i)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(i,a)||function(e,t){if(e){if("string"==typeof e)return At(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(e,t):void 0}}(i,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],p=s[1],f=(0,w._)().getSectionById,b=null!==(t=null===(n=l.settings)||void 0===n?void 0:n[r.RI[l.name].key])&&void 0!==t?t:[],v=function(){if(!(0,y.$K)(u))return null;var e=b[u],t=(0,y.$K)(e)?e.content:[];return(0,h.tZ)("div",{css:Ct.body(d),children:t.map((function(e){var t=f(e.id),n=t.index,o=t.content;return(0,y.$K)(o)?(0,h.tZ)(sn,{index:n,content:o,placeholderPosition:c,disabled:!d,parentVisibility:d,sectionType:r.t.DeepAddonRow},e.id):null}))})};return(0,h.tZ)("div",{css:Ct.wrapper,children:b.map((function(e,t){return(0,h.BX)("div",{css:Ct.accordionItem,children:[(0,h.BX)("button",{css:Ct.navItem(u===t,d),onClick:function(){return p(u===t?null:t)},children:[(0,h.tZ)(o.Z,{name:"caretRight",height:16,width:16}),(0,h.tZ)("div",{css:Ct.title,children:e.title})]}),u===t&&v()]},"".concat(e.title).concat(t))}))})};var Pt={name:"1jmy1n7-navItem",styles:"transform:rotate(90deg);label:navItem;"},Ct={wrapper:(0,d.iv)("margin:0 ",i.W0[16]," ",i.W0[16],";border-radius:",i.E0[2],";border:1px solid ",i.qo.stroke.neutral,";;label:wrapper;"),accordionItem:(0,d.iv)("&:not(:first-of-type){border-top:1px solid ",i.qo.stroke.neutral,";};label:accordionItem;"),navItem:function(e,t){return(0,d.iv)("width:100%;display:flex;gap:",i.W0[12],";",v.iZ.resetButton," padding:",i.W0[16],";",e&&t&&(0,d.iv)("color:",i.qo.text.primary,";background-color:",i.qo.background.primary,";;label:navItem;")," svg{color:",i.qo.icon.default,";transition:transform 0.3s ease-out;",e&&Pt,";};label:navItem;")},title:(0,d.iv)("font-family:",i.I8.sansSerif,";font-style:normal;font-weight:400;font-size:",i.JB[12],";line-height:",i.Nv[18],";text-align:justify;color:",i.qo.text.default,";;label:title;"),body:function(e){return(0,d.iv)("padding:0 ",i.W0[16]," ",i.W0[16],";",e&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:body;"),";;label:body;")}};function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}const Rt=function(e){var t,n,o,i,a=e.content,l=e.isVisible,d=e.placeholderPosition,c=(o=(0,P.useState)(0),i=2,function(e){if(Array.isArray(e))return e}(o)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(o,i)||function(e,t){if(e){if("string"==typeof e)return Tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(e,t):void 0}}(o,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=c[0],u=c[1],p=(0,w._)().getSectionById,f=null!==(t=null===(n=a.settings)||void 0===n?void 0:n[r.RI[a.name].key])&&void 0!==t?t:[],b=f[s],v=(0,y.$K)(b)?b.content:[];return(0,h.BX)("div",{css:Zt.wrapper,children:[(0,h.tZ)("div",{css:Zt.nav,children:f.map((function(e,t){return(0,h.BX)("button",{css:Zt.navItem(s===t,l),onClick:function(){return u(t)},children:[(0,h.tZ)("div",{children:e.title}),e.subtitle&&(0,h.tZ)("span",{children:e.subtitle})]},"".concat(e.title).concat(t))}))}),(0,h.tZ)("div",{css:Zt.body(l),children:v.map((function(e){var t=p(e.id),n=t.index,o=t.content;return(0,y.$K)(o)?(0,h.tZ)(sn,{index:n,content:o,placeholderPosition:d,disabled:!l,parentVisibility:l,sectionType:r.t.DeepAddonRow},e.id):null}))})]})};var Zt={wrapper:(0,d.iv)("display:flex;flex-direction:column;border:1px solid ",i.qo.stroke.neutral,";border-radius:",i.E0[4],";margin:0 ",i.W0[16]," ",i.W0[16],";overflow:hidden;;label:wrapper;"),nav:(0,d.iv)("display:flex;border-bottom:1px solid ",i.qo.stroke.neutral,";;label:nav;"),navItem:function(e,t){return(0,d.iv)(v.iZ.resetButton," font-size:",i.JB[14],";padding:",i.W0[16],";border-right:1px solid ",i.qo.stroke.neutral,";min-height:52px;position:relative;",e&&(0,d.iv)("color:",i.qo.text.primary,";",t&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:navItem;")," &::before{content:'';width:100%;height:1px;position:absolute;left:0;bottom:-1px;",t&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:navItem;"),";};label:navItem;"),";;label:navItem;")},body:function(e){return(0,d.iv)("padding:",i.W0[16],";",e&&(0,d.iv)("background-color:",i.qo.background.primary,";;label:body;"),";;label:body;")}};const Bt=function(e){var t,n,i,a,l,d,s=e.content,u=e.sectionIndex,p=e.columnIndex,f=e.index,b=e.isVisible,v=e.placeholderPosition,m=(0,$.j)((function(e){return e.setActiveAction})),g=(0,c.$)(),I=null!==(t=null===(n=s.settings)||void 0===n?void 0:n[r.pb.headerItemsKey])&&void 0!==t?t:[],x=null!==(i=null===(a=s.settings)||void 0===a?void 0:a[r.pb.bodyItemsKey])&&void 0!==i?i:[];return(0,h.BX)("div",{css:Lt.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:Lt.headerWrapper,children:I.map((function(e,t){if(0===e.content.length){var n="empty-table-header-item-".concat(t);return(0,h.tZ)(j,{id:n,customStyle:Lt.emptyItem,isHidden:!b,data:{type:r.t.TableItem,sectionIndex:u,columnIndex:p,addonIndex:f,tableItem:{itemIdx:t,contentItemIdx:0},content:s,isVisible:b},children:(0,h.tZ)("button",{disabled:!b,title:g("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(){return m("add-elements")},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})},n)}return(0,h.tZ)("div",{css:Lt.headerItem,children:e.content.map((function(e,n){return(0,h.tZ)(It,{content:e,sectionIndex:u,columnIndex:p,index:f,placeholderPosition:v,disabled:!b,parentVisibility:b,tableItem:{itemIdx:t,contentItemIdx:n},addonType:r.t.TableItem},e.id)}))},t)}))}),(0,h.tZ)("div",{css:Lt.bodyWrapper,children:x.map((function(e,t){return(0,h.tZ)("div",{css:Lt.bodyRowWrapper,children:e.table_advanced_item.map((function(e,n){if(0===e.content.length){var i="empty-table-body-item-".concat(t,"-").concat(n);return(0,h.tZ)(j,{id:i,customStyle:Lt.emptyItem,isHidden:!b,data:{type:r.t.TableItem,sectionIndex:u,columnIndex:p,addonIndex:f,tableItem:{itemIdx:t,rowItemIdx:n,contentItemIdx:0},content:s,isVisible:b},children:(0,h.tZ)("button",{disabled:!b,title:g("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(e){e.stopPropagation(),m("add-elements")},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})},i)}return(0,h.tZ)("div",{css:Lt.bodyItem,children:e.content.map((function(e,o){return(0,h.tZ)(It,{content:e,sectionIndex:u,columnIndex:p,index:f,placeholderPosition:v,disabled:!b,parentVisibility:b,tableItem:{itemIdx:t,rowItemIdx:n,contentItemIdx:o},addonType:r.t.TableItem},e.id)}))},n)}))},t)}))})]})};var Lt={wrapper:(0,d.iv)("margin:0 ",i.W0[16]," ",i.W0[16],";border-radius:",i.E0[2],";border:1px solid ",i.qo.stroke.neutral,";overflow-x:auto;;label:wrapper;"),headerWrapper:(0,d.iv)("display:flex;gap:",i.W0[6],";padding:",i.W0[6],";border-bottom:1px solid ",i.qo.stroke.neutral,";background-color:",i.qo.background.primary,";min-width:fit-content;;label:headerWrapper;"),bodyWrapper:(0,d.iv)("display:flex;flex-direction:column;gap:",i.W0[6],";padding:",i.W0[6],";min-width:fit-content;;label:bodyWrapper;"),headerItem:(0,d.iv)("width:100%;display:flex;flex-direction:column;gap:",i.W0[6],";;label:headerItem;"),bodyRowWrapper:(0,d.iv)("display:flex;gap:",i.W0[6],";;label:bodyRowWrapper;"),bodyItem:(0,d.iv)("width:100%;display:flex;flex-direction:column;gap:",i.W0[6],";;label:bodyItem;"),emptyItem:(0,d.iv)("width:100%;height:100%;border:1px dashed ",i.qo.stroke.neutral,";border-radius:0 0 ",i.E0[2],";button{",v.iZ.resetButton,";width:100%;height:40px;",v.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";width:",i.W0[24],";height:",i.W0[24],";};label:emptyItem;")};function kt(e){return kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kt(e)}function jt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jt(Object(n),!0).forEach((function(t){qt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==kt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==kt(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===kt(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ut={addon:i.qo.alternate.div,background:i.qo.background.white};const Nt=function(e){var t=e.content,n=e.sectionIndex,o=e.columnIndex,i=e.index,a=e.placeholderPosition,l=e.parentVisibility&&t.visibility;return(0,h.tZ)(It,Wt(Wt({},e),{},{addonType:r.t.DeepAddon,colors:Ut,isCollapsible:!0,children:(0,y.$K)(t)&&(t.name===r.pb.name?(0,h.tZ)(Bt,{content:t,sectionIndex:n,columnIndex:o,index:i,isVisible:l,placeholderPosition:a}):t.name===r.RI.accordion.name?(0,h.tZ)(_t,{content:t,placeholderPosition:a,isVisible:l}):t.name===r.RI.tab.name?(0,h.tZ)(Rt,{content:t,placeholderPosition:a,isVisible:l}):null)}))};function Mt(e){return Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mt(e)}function Gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function $t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gt(Object(n),!0).forEach((function(t){Kt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Kt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Mt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Mt(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Mt(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ft={addon:i.qo.alternate.div,background:i.qo.background.lightRoyalBlue};const Vt=function e(t){var n=t.content,i=t.sectionIndex,a=t.columnIndex,l=t.index,d=t.childIndex,s=t.tableItem,u=t.placeholderPosition,p=t.disabled,f=t.parentVisibility,b=(0,c.$)(),v=(0,w._)().getChildAddonById,m=(0,$.j)((function(e){return e.setActiveAction})),g=f&&n.visibility;return(0,h.tZ)(It,$t($t({},t),{},{addonType:r.t.Div,colors:Ft,isCollapsible:!0,children:(0,y.$K)(n)&&((0,y.$K)(n.children)&&n.children.length?(0,h.tZ)(Se.Fo,{id:n.id.toString(),items:n.children,strategy:Se.qw,children:(0,h.tZ)("div",{css:Xt.childrenWrapper,children:n.children.map((function(t,o){var l=v({sectionIndex:i,columnIndex:a,id:t}),d=l.index,c=l.content;return(0,y.$K)(c)?"div"===c.name?(0,h.tZ)(e,{content:c,sectionIndex:i,columnIndex:a,index:d,childIndex:o,placeholderPosition:u,disabled:!n.visibility||p,parentVisibility:f&&n.visibility},t):Object.keys(r.RI).includes(c.name)||c.name===r.pb.name?(0,h.tZ)(Nt,{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)(It,{sectionIndex:i,columnIndex:a,content:c,index:d,childIndex:o,placeholderPosition:u,disabled:!n.visibility||p,parentVisibility:f&&n.visibility},t):null}))})}):(0,h.tZ)(j,{id:"".concat(n.id,"-empty-child"),customStyle:Xt.emptyChildren,isHidden:!g,data:{type:r.t.EmptyDivChild,isVisible:g,sectionIndex:i,columnIndex:a,addonIndex:l,childIndex:d,tableItem:s,content:n},children:(0,h.tZ)("button",{disabled:!g,title:b("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(){return m("add-elements")},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})}))}))};var Xt={childrenWrapper:(0,d.iv)("display:flex;flex-direction:column;gap:",i.W0[16],";padding:",i.W0[16],";margin:0 ",i.W0[16]," ",i.W0[16],";border-radius:",i.E0[2],";border:1px solid ",i.qo.stroke.neutral,";;label:childrenWrapper;"),emptyChildren:(0,d.iv)("height:100%;border:1px dashed ",i.qo.stroke.neutral,";border-radius:0 0 ",i.E0[2],";margin:0 ",i.W0[16]," ",i.W0[16],";button{",v.iZ.resetButton,";width:100%;height:100px;",v.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";};label:emptyChildren;")};function Ht(e){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ht(e)}function Yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function zt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yt(Object(n),!0).forEach((function(t){Jt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Ht(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==Ht(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ht(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qt=function(e){var t=e.isHidden,n=e.isDeepAddonColumn,o=e.totalColumns;return[{id:"settings",icon:"cog",title:"COM_SPPAGEBUILDER_EDITOR_COLUMN_SETTINGS",isDisabled:t},{id:"visibility",icon:"eyeSlash",title:"COM_SPPAGEBUILDER_EDITOR_ACTION_VISIBILITY_HIDE",isProFeature:!0},{id:"duplicate",icon:"cloneLine",title:"COM_SPPAGEBUILDER_EDITOR_COLUMN_DUPLICATE",isDisabled:t},{id:"remove",icon:"trash",title:"COM_SPPAGEBUILDER_EDITOR_COLUMN_REMOVE",variant:"critical",isDisabled:t,hide:n&&1===o}]};const en=function(e){var t=e.content,n=e.sectionIndex,i=e.index,a=e.placeholderPosition,l=e.parentVisibility,d=e.isDeepAddonColumn,s=void 0!==d&&d,u=e.totalColumns,p=(0,c.$)(),f=(0,D.o)((function(e){return e.changeColumnVisibility})),b=(0,D.o)((function(e){return e.duplicateColumn})),v=(0,D.o)((function(e){return e.deleteColumn})),m=(0,D.o)((function(e){return e.copiedData})),g=(0,D.o)((function(e){return e.pasteOrInsertAddon})),I=(0,D.o)((function(e){return e.page})),x=(0,Ge.y)((function(e){return e.activeColumn})),E=(0,Ge.y)((function(e){return e.setActiveColumn})),O=(0,P.useRef)({element:null}),A=(0,w._)().getNestedRowById,C=(0,$.j)((function(e){return e.setActiveAction})),T=(0,$.j)((function(e){return e.activeAction})),R=(0,je.F)((function(e){return{type:e.type,payload:e.payload,setSettings:e.setSettings}})),Z=R.type,B=R.payload,L=R.setSettings,k=l&&t.visibility,j=(0,Se.nB)({id:t.id,data:{type:r.t.Column,isVisible:k,sectionIndex:n,columnIndex:i,content:t}}),W=j.attributes,q=j.listeners,U=j.setNodeRef,N=j.isDragging,M=j.active,G=j.over,F=j.isOver,V=j.transition,X=j.transform,H=function(e){e&&(U(e),O.current.element=e)},Y=(0,Oe.p)().showToast,z=!t.visibility,J=_({transform:X,transition:V,isDragging:N}),Q=qe({position:a,contentId:t.id,active:M,over:G,type:"column"}),ee=(0,S.T)().closeSettingPanel;(0,P.useEffect)((function(){T||E(null)}),[T,E]);var te=(0,K.Gc)(),ne=te.getValues,oe=te.reset,re=(0,w._)().getColumnSettings,ie=function(e){"settings"===e&&(oe(zt(zt({},ne()),{},{settings:re({sectionIndex:n,columnIndex:i})})),L("column",{sectionIndex:n,columnIndex:i,addonIndex:null})),"visibility"===e&&(ee(),f({sectionIndex:n,columnIndex:i,visibility:t.visibility}),Y({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_VISIBILITY_CHANGED_SUCCESSFULLY")})),"duplicate"===e&&(b({sectionIndex:n,columnIndex:i}),Y({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")})),"remove"===e&&(ee(),v({sectionIndex:n,columnIndex:i}),Y({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_REMOVED_SUCCESSFULLY")}))},ae="column"===Z&&B.sectionIndex===n&&B.columnIndex===i,le=N||F,de=x==="".concat(n,"-").concat(i),ce=function(){return(0,h.BX)(h.HY,{children:[(0,h.tZ)(we.Z,{actions:Qt({isHidden:z,isDeepAddonColumn:s,totalColumns:u}),triggerButtonContent:(0,h.tZ)(o.Z,{name:"ellipsisX",width:10}),triggerButtonStyle:tn.columnSettings,onSelect:ie,visibilityStatus:!z,title:p("COM_SPPAGEBUILDER_EDITOR_COLUMN_ACTIONS")}),(0,h.tZ)("button",zt(zt(zt({type:"button",css:tn.columnDragHandler,"data-column-drag-handler":!0},W),q),{},{children:(0,h.tZ)(o.Z,{name:"ellipsisDoubleY"})})),!!m.addon&&k&&(0,h.tZ)("button",{type:"button",css:tn.clipboardButton,"data-addon-paste-button":!0,title:p("COM_SPPAGEBUILDER_EDITOR_ADDON_PASTE"),onClick:function(e){if(e.stopPropagation(),(0,y.$K)(m.addon)){ee();var t=I[n].columns[i].addons.length;g({addonData:m.addon,sectionIndex:n,columnIndex:i,addonIndex:t}),Y({type:"success",message:p("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")})}},children:(0,h.tZ)(o.Z,{name:"clipboard",height:16,width:16})})]})};return 0===t.addons.length?(0,h.tZ)("div",{css:tn.columnWrap({width:t.settings.width}),children:(0,h.BX)("div",{css:[tn.emptyColumnWrap({isOver:F,isEditing:ae,isHidden:z,hideOutline:le,isActiveColumn:de}),Q,J,";label:Column;"],ref:H,tabIndex:-1,role:"button",onKeyDown:function(){},title:p("COM_SPPAGEBUILDER_EDITOR_COLUMN_CLICK_TITLE"),onClick:function(e){e.target===O.current.element&&(L("column",{sectionIndex:n,columnIndex:i,addonIndex:null}),oe(zt(zt({},ne()),{},{settings:re({sectionIndex:n,columnIndex:i})})))},children:[(0,h.tZ)("button",{type:"button",id:t.id.toString(),css:tn.emptyColumnButton({isActiveColumn:de}),disabled:!k,title:p("COM_SPPAGEBUILDER_EDITOR_ADDON_PLUS_ICON"),onClick:function(e){e.stopPropagation(),C(de?void 0:"add-elements"),E(de?null:"".concat(n,"-").concat(i))},children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})}),ce()]})}):(0,h.tZ)(Se.Fo,{id:t.id.toString(),items:t.addons.filter((function(e){return!e.parent})),strategy:Se.qw,children:(0,h.tZ)("div",{css:tn.columnWrap({width:t.settings.width}),tabIndex:-1,role:"button",onKeyDown:y.ZT,title:p("COM_SPPAGEBUILDER_EDITOR_COLUMN_CLICK_TITLE"),onClick:function(e){e.target===O.current.element&&(L("column",{sectionIndex:n,columnIndex:i,addonIndex:null}),oe(zt(zt({},ne()),{},{settings:re({sectionIndex:n,columnIndex:i})})))},children:(0,h.BX)("div",{id:t.id.toString(),css:[tn.column({isEditing:ae,isHidden:!k,hideOutline:le}),Q,J,";label:Column;"],ref:H,children:[t.addons.map((function(e,o){if("parent"in e&&e.parent)return null;if((0,$e.m5)(e)){var l=A({id:e.id,rowId:I[n].id,columnId:t.id}),d=l.index,c=l.content;return(0,y.$K)(c)?(0,h.tZ)(sn,{index:d,content:c,nestedRowData:{sectionIndex:n,columnIndex:i,addonIndex:o},placeholderPosition:a,disabled:z,parentVisibility:t.visibility,sectionType:r.t.NestedRow},e.id):null}return"div"===e.name?(0,h.tZ)(Vt,{content:e,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:z,parentVisibility:t.visibility},e.id):Object.keys(r.RI).includes(e.name)||e.name===r.pb.name?(0,h.tZ)(Nt,{content:e,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:z,parentVisibility:t.visibility},e.id):(0,h.tZ)(It,{content:e,sectionIndex:n,columnIndex:i,index:o,placeholderPosition:a,disabled:z,parentVisibility:t.visibility},e.id)})),ce()]})})})};var tn={columnWrap:function(e){var t=e.width;return(0,d.iv)("width:",t[r.zu],";height:100%;padding:",i.W0[8],";;label:columnWrap;")},column:function(e){var t=e.isEditing,n=e.isHidden,o=e.hideOutline;return(0,d.iv)("display:flex;flex-direction:column;align-items:center;gap:",i.W0[16],";padding:",i.W0[16],";background-color:",i.qo.base.white,";border-radius:",i.E0[2],";border:1px solid ",i.qo.stroke.neutral,";position:relative;",!o&&(0,d.iv)(":hover,:focus-within{border:1px solid ",i.qo.base.primary,";border-top-left-radius:0;border-top-right-radius:0;&>[data-column-drag-handler],&>[data-addon-paste-button]{opacity:1;}>button:first-of-type{opacity:1;}};label:column;")," ",t&&(0,d.iv)("border:1px solid ",i.qo.base.primary,";background-color:",(0,Me.m4)(i.qo.background.primary,.4),";;label:column;")," ",n&&(0,d.iv)("background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:column;"),";;label:column;")},emptyColumnWrap:function(e){var t=e.isEditing,n=e.isHidden,o=e.hideOutline,r=e.isActiveColumn,a=e.isOver;return(0,d.iv)("position:relative;border:1px dashed ",i.qo.stroke.neutral,";border-radius:",i.E0[2],";",v.iZ.flexCenter(),";min-height:144px;width:100%;cursor:pointer;",!o&&(0,d.iv)(":hover,:focus-within{border:1px solid ",i.qo.base.primary,";border-top-left-radius:0;border-top-right-radius:0;&>[data-column-drag-handler],&>[data-addon-paste-button]{opacity:1;}>button:nth-of-type(2){opacity:1;}};label:emptyColumnWrap;")," ",t&&(0,d.iv)("border:1px solid ",i.qo.base.primary,";background-color:",(0,Me.m4)(i.qo.background.primary,.4),";;label:emptyColumnWrap;")," ",n&&(0,d.iv)("background-color:",i.qo.base.surface,";background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:emptyColumnWrap;")," ",r&&(0,d.iv)("background-color:",i.qo.background.neutral,";;label:emptyColumnWrap;")," ",a&&(0,d.iv)("background-color:",i.qo.background.hover,";;label:emptyColumnWrap;"),";;label:emptyColumnWrap;")},emptyColumnButton:function(e){var t=e.isActiveColumn;return(0,d.iv)(v.iZ.resetButton,";position:absolute;inset:",i.W0[16],";",v.iZ.flexCenter(),";cursor:pointer;svg{color:",i.qo.icon.default,";}:hover{svg{color:",i.qo.icon.hover,";}}",t&&(0,d.iv)("svg{color:",i.qo.icon.default,";};label:emptyColumnButton;"),";;label:emptyColumnButton;")},columnSettings:(0,d.iv)(v.iZ.flexCenter(),";border-radius:",i.E0.circle,";width:16px;height:16px;background-color:",i.qo.base.primary,";color:",i.qo.base.white,";position:absolute;top:-8px;right:-8px;opacity:0;;label:columnSettings;"),clipboardButton:(0,d.iv)(v.iZ.resetButton,";",v.iZ.flexCenter(),";border-radius:",i.E0[4],";background-color:",i.qo.base.white,";padding:",i.W0[4],";position:absolute;top:-1px;left:50%;transform:translate(-50%, -50%);opacity:0;box-shadow:",i.AF.card,";z-index:",i.W5.modal,";svg{color:",i.qo.icon.default,";transition:color 0.3s ease;}:hover{svg{color:",i.qo.icon.primary,";}};label:clipboardButton;"),columnDragHandler:(0,d.iv)(v.iZ.resetButton,";",v.iZ.flexCenter(),";border-top-left-radius:",i.E0[4],";border-bottom-left-radius:",i.E0[4],";background-color:",i.qo.base.primary,";color:",i.qo.base.white,";width:12px;height:18px;position:absolute;top:-1px;left:0;transform:translateX(-100%);opacity:0;cursor:grab!important;;label:columnDragHandler;")};function nn(e){return nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nn(e)}function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function rn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach((function(t){an(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function an(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==nn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==nn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===nn(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ln(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;d=!1}else for(;!(d=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return dn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var cn=function(e){var t=e.copiedData,n=e.isHidden,o=e.isDeepAddonRow;return[{id:"settings",icon:"cog",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_SETTINGS",isDisabled:n},{id:"visibility",icon:"eyeSlash",title:"COM_SPPAGEBUILDER_EDITOR_ACTION_VISIBILITY_HIDE",isProFeature:!0},{id:"columns",icon:"verticalBars",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_COLUMNS_UPDATE",isDisabled:n},{id:"reset",icon:"update",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_RESET",isDisabled:n},{id:"save",icon:"saveLine",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_SAVE",isDisabled:n,isProFeature:!0},{id:"duplicate",icon:"cloneLine",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_DUPLICATE",isDisabled:n,hide:o},{id:"copy",icon:"copy",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_COPY",isDisabled:n,isProFeature:!0},{id:"paste",icon:"clipboard",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_PASTE_TO_REPLACE",isDisabled:!t.section||n,isProFeature:!0},{id:"remove",icon:"trash",title:"COM_SPPAGEBUILDER_EDITOR_SECTION_REMOVE",variant:"critical",isDisabled:n,hide:o}]};const sn=function(e){var t,n,i=e.content,l=e.index,d=e.placeholderPosition,s=e.nestedRowData,u=e.disabled,p=void 0!==u&&u,f=e.parentVisibility,b=void 0===f||f,v=e.sectionType,m=void 0===v?r.t.Section:v,g=(0,D.o)((function(e){return e.changeSectionVisibility})),I=(0,D.o)((function(e){return e.duplicateSection})),x=(0,D.o)((function(e){return e.duplicateNestedSection})),E=(0,D.o)((function(e){return e.copySection})),O=(0,D.o)((function(e){return e.pasteOrInsertSection})),A=(0,D.o)((function(e){return e.pasteOrInsertAsNestedSection})),C=(0,D.o)((function(e){return e.deleteSection})),T=(0,D.o)((function(e){return e.resetColumnWidth})),R=(0,D.o)((function(e){return e.deleteNestedSection})),Z=(0,D.o)((function(e){return e.updateAdminLabel})),B=(0,D.o)((function(e){return e.page})),L=(0,D.o)((function(e){return e.copiedData})),k=(0,S.T)().closeSettingPanel,j=(0,P.useRef)(null),W=(0,P.useRef)(null),U=(0,P.useRef)(null),N=ln((0,P.useState)(null),2),M=N[0],$=N[1],F=(0,c.$)(),V=(0,je.F)((function(e){return{type:e.type,payload:e.payload,setSettings:e.setSettings}})),X=V.type,H=V.payload,Y=V.setSettings,z=(0,w._)().getSectionSettings,Q=(0,K.Gc)(),ee=Q.reset,te=Q.getValues,ne=!!i.parent,oe=b&&i.visibility,re=m===r.t.DeepAddonRow,ie=(0,Se.nB)({id:i.id,data:{type:m,isVisible:oe,sectionIndex:l,content:i,nestedRowData:s},disabled:re}),ae=ie.attributes,le=ie.listeners,de=ie.setNodeRef,ce=ie.isDragging,se=ie.isOver,ue=ie.transform,pe=ie.transition,fe=ie.active,be=ie.over,ve=ln((0,P.useState)(!0),2),ye=ve[0],me=ve[1],he=(0,P.useRef)(ye),ge=ln((0,P.useState)({isOpen:!1,reason:""}),2),Ie=ge[0],Ee=ge[1],De=(0,Oe.p)().showToast,Ae=(0,G.l)({isOpen:Ie.isOpen,isDropdown:!0,arrow:"bottom"}),_e=Ae.triggerRef,Pe=Ae.position,Ce=Ae.popoverRef,Te=!oe||p;(0,P.useEffect)((function(){he.current&&me(!ce)}),[ce]),(0,P.useEffect)((function(){me(!Te),he.current=!Te}),[Te]);var Re=function(){Y("section",{sectionIndex:l,columnIndex:null,addonIndex:null});var e=z(l);ee(rn(rn({},te()),{},{settings:e}))},Ze=qe({position:d,contentId:i.id,active:fe,over:be,type:m}),Be=_({transform:ue,transition:pe,isDragging:ce}),ke="section"===X&&H.sectionIndex===l,Ue=p||ce||se,Ne=(null==be||null===(t=be.data.current)||void 0===t?void 0:t.type)===r.t.Section&&(null==fe||null===(n=fe.data.current)||void 0===n?void 0:n.type)===r.t.NestedRow;return(0,h.BX)("div",{css:vn.wrapper(ke,Ue),children:[(0,h.BX)("div",{css:[vn.section(ke,Te,p),Ze,Ne?null:Be,";label:Section;"],ref:de,children:[(0,h.BX)("div",rn(rn(rn({css:vn.actionBar(Te),ref:j,title:F("COM_SPPAGEBUILDER_EDITOR_SECTION_CLICK_TITLE"),onKeyDown:y.ZT,onClick:function(e){e.target===j.current&&Re()}},ae),le),{},{role:"button",tabIndex:-1,children:[(0,h.BX)("div",{css:vn.titleBar(re),title:"",children:[!re&&(0,h.tZ)(o.Z,{name:"dragger",width:32,height:32}),(0,h.tZ)("h5",{css:a.c.heading5(),children:(0,h.tZ)(xe,{text:i.settings.admin_label||i.settings.title||(ne?"Row":"Section"),updateAdminLabel:function(e){Z({label:e,row:{sectionIndex:l}})}})})]}),(0,h.BX)("div",{ref:U,css:vn.actionButtons,children:[(0,h.tZ)("button",{type:"button",css:vn.toggleButton(ye),title:F(ye?"COM_SPPAGEBUILDER_EDITOR_COLLAPSE":"COM_SPPAGEBUILDER_EDITOR_EXPAND"),onClick:function(){me((function(e){return!e})),he.current=!he.current},children:(0,h.tZ)(o.Z,{name:"angleUp",width:28,height:28})}),(0,h.tZ)(we.Z,{actions:cn({copiedData:L,isHidden:Te,isDeepAddonRow:re}),triggerButtonContent:(0,h.tZ)("span",{css:vn.settingsButton(p),title:F("COM_SPPAGEBUILDER_EDITOR_SECTION_SETTINGS"),children:(0,h.tZ)(o.Z,{name:"sliders"})}),onSelect:function(e){switch(e){case"settings":Re();break;case"visibility":k(),g({sectionIndex:l,visibility:i.visibility}),De({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_VISIBILITY_CHANGED_SUCCESSFULLY")});break;case"duplicate":(0,y.$K)(s)?x(rn({nestedSectionIndex:l},s)):I({sectionIndex:l}),De({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_DUPLICATED_SUCCESSFULLY")});break;case"copy":E({sectionIndex:l}),De({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_COPIED_SUCCESSFULLY")});break;case"paste":var t,n;k(),(0,y.$K)(s)?A(rn(rn({nestedSectionIndex:l},s),{},{sectionData:null!==(t=L.section)&&void 0!==t?t:[],replace:!0})):O({sectionIndex:l,sectionData:null!==(n=L.section)&&void 0!==n?n:[],replace:!0}),De({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")});break;case"reset":k(),T({sectionIndex:l});break;case"remove":k(),(0,y.$K)(s)?R(rn({nestedSectionIndex:l},s)):C({sectionIndex:l}),De({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_REMOVED_SUCCESSFULLY")});break;case"save":var o=(0,We.Nk)({sections:B,sectionIndex:l});(0,y.$K)(o)&&$(JSON.stringify(o));break;case"columns":Ee({isOpen:!0,reason:"update"})}},visibilityStatus:i.visibility,disabled:p})]})]})),(0,h.tZ)(Se.Fo,{id:i.id.toString(),items:i.columns,strategy:Se.PG,children:(0,h.tZ)("div",{css:vn.contents(ye),ref:W,title:F("COM_SPPAGEBUILDER_EDITOR_SECTION_CLICK_TITLE"),role:"button",tabIndex:-1,onKeyDown:y.ZT,onClick:function(e){e.target===W.current&&Re()},children:(0,h.tZ)("div",{title:"",children:i.columns.map((function(e,t){return(0,h.tZ)(en,{content:e,sectionIndex:l,index:t,totalColumns:i.columns.length,placeholderPosition:d,parentVisibility:oe,isDeepAddonColumn:re},e.id)}))})})})]}),(0,h.BX)("div",{css:vn.bottomActionButtonsWrapper,"data-bottom-wrapper":!0,children:[re&&ne&&(0,h.tZ)("span",{ref:_e}),!re&&(0,h.tZ)(q.Z,{ref:_e,type:"button",onClick:function(){return Ee({isOpen:!0,reason:"insert"})},icon:(0,h.tZ)(o.Z,{name:"plus"}),children:F(ne?"COM_SPPAGEBUILDER_EDITOR_ADD_ROW":"COM_SPPAGEBUILDER_EDITOR_ADD_SECTION")}),!ne&&!!L.section&&(0,h.tZ)(q.Z,{ref:_e,type:"button",variant:"secondary",buttonCss:vn.pasteSectionButton,onClick:function(){L.section&&(k(),O({sectionIndex:l,sectionData:L.section,replace:!1}),De({type:"success",message:F("COM_SPPAGEBUILDER_EDITOR_PASTED_SUCCESSFULLY")}))},icon:(0,h.tZ)(o.Z,{name:"clipboard"}),children:F("COM_SPPAGEBUILDER_EDITOR_SECTION_PASTE_SECTION")})]}),(0,h.tZ)(J,{isOpen:Ie.isOpen,defaultLayout:"update"===Ie.reason?i.layout:null,nestedRowData:s,handleClose:function(){return Ee({isOpen:!1,reason:""})},position:Pe,popoverRef:Ce,index:l}),(0,h.tZ)(Le,{ref:U,type:"section",dataToSave:M,closePopover:function(){return $(null)}})]})};var un={name:"sxudyk-contents",styles:"display:none;height:0;opacity:0;padding:0;overflow:hidden;label:contents;"},pn={name:"1bpgz68-toggleButton",styles:"transform:rotate(-180deg);label:toggleButton;"},fn={name:"1nwp2q0-actionBar",styles:":hover{button:first-of-type{visibility:visible;opacity:1;}};label:actionBar;"},bn={name:"1o7rgfq-section",styles:"background-color:transparent;label:section;"},vn={wrapper:function(e,t){return(0,d.iv)("width:100%;position:relative;border:1px solid transparent;border-radius:",i.E0[6],";transition:border 0.3s ease-in-out;",!t&&(0,d.iv)(":hover{border:1px solid ",i.qo.base.primary,";&>[data-bottom-wrapper]{opacity:1;}};label:wrapper;")," ",e&&(0,d.iv)("border:1px solid ",i.qo.base.primary,";;label:wrapper;"),";;label:wrapper;")},section:function(e,t,n){return(0,d.iv)("width:100%;border-radius:",i.E0[6],";background-color:",i.qo.base.white,";position:relative;box-shadow:",i.AF.card,";",e&&(0,d.iv)("background-color:",(0,Me.m4)(i.qo.background.primary,.4),";;label:section;")," ",t&&!n&&(0,d.iv)("background-image:repeating-linear-gradient(-45deg, transparent 0 4px, ",i.qo.stroke.disabled," 4px 5px);;label:section;")," ",n&&bn,";;label:section;")},bottomActionButtonsWrapper:(0,d.iv)("display:flex;justify-content:center;align-items:center;gap:",i.W0[8],";position:absolute;bottom:0;left:50%;transform:translate(-50%, 50%);opacity:0;transition:opacity 0.3s ease-in-out;;label:bottomActionButtonsWrapper;"),pasteSectionButton:(0,d.iv)("background-color:",i.qo.background.white,";svg{color:",i.qo.icon.default,";}:hover{svg{color:",i.qo.icon.primary,";}};label:pasteSectionButton;"),addSectionButton:(0,d.iv)(v.iZ.resetButton,";",v.iZ.flexCenter("row"),";",v.iZ.textEllipsis,";gap:",i.W0[8],";padding:",i.W0[6]," ",i.W0[16],";background-color:",i.qo.base.primary,";border-radius:",i.E0.button,";color:",i.qo.base.white,";line-height:",i.Nv[18],";;label:addSectionButton;"),actionBar:function(e){return(0,d.iv)("display:flex;justify-content:space-between;padding:",i.W0[24]," ",i.W0[24]," ",i.W0[24]," ",i.W0[12],";cursor:pointer;",!e&&fn,";;label:actionBar;")},titleBar:function(e){return(0,d.iv)("display:flex;align-items:center;gap:",i.W0[4],";padding-left:",i.W0[2],";cursor:grab;",e&&(0,d.iv)("padding-left:",i.W0[10],";cursor:initial;;label:titleBar;")," svg{color:",i.qo.icon.hints,";};label:titleBar;")},actionButtons:(0,d.iv)("display:flex;gap:",i.W0[16],";;label:actionButtons;"),toggleButton:function(e){return(0,d.iv)(v.iZ.resetButton,";padding:",i.W0[2],";transition:transform 0.3s ease,opacity 0.3s ease;visibility:hidden;opacity:0;svg{color:",i.qo.icon.default,";transition:color 0.3s ease-in-out;}:hover{svg{color:",i.qo.icon.hover,";border-color:",i.qo.stroke.hover,";}}:active{svg{color:",i.qo.icon.primary,";}}",!e&&pn,";;label:toggleButton;")},settingsButton:function(e){return(0,d.iv)(v.iZ.centeredFlex,";border:1px solid ",i.qo.stroke.neutral,";border-radius:",i.E0[6],";width:32px;height:32px;svg{color:",i.qo.icon.default,";transition:color 0.3s ease-in-out;}",e&&(0,d.iv)("color:",i.qo.icon.disabled,";cursor:initial;;label:settingsButton;")," ",!e&&(0,d.iv)("background-color:",i.qo.background.white,";:hover{svg{color:",i.qo.icon.hover,";border-color:",i.qo.stroke.hover,";}};label:settingsButton;")," :active{svg{color:",i.qo.icon.primary,";}};label:settingsButton;")},contents:function(e){return(0,d.iv)("padding:0 ",i.W0[24]," ",i.W0[24],";cursor:pointer;>div{display:flex;flex-wrap:wrap;margin:-",i.W0[8],";cursor:initial;}",!e&&un,";;label:contents;")}};const yn=function(){var e=(0,D.o)((function(e){return e.page})),t=(0,S.T)().closeSettingPanel,n=(0,$.j)((function(e){return e.activeAction})),i=(0,$.j)((function(e){return e.setActiveAction})),a=function(){var e=(0,D.o)((function(e){return e.addNewAddon})),t=(0,D.o)((function(e){return e.addNewTableItemAddon})),n=(0,D.o)((function(e){return e.pasteOrInsertAddon})),o=(0,D.o)((function(e){return e.pasteOrInsertSection})),i=(0,D.o)((function(e){return e.pasteOrInsertAsNestedSection})),a=(0,D.o)((function(e){return e.addNewSection})),d=(0,D.o)((function(e){return e.addNestedRow})),c=(0,D.o)((function(e){return e.addNewColumn})),f=(0,D.o)((function(e){return e.sortSection})),b=(0,D.o)((function(e){return e.sortColumn})),v=(0,D.o)((function(e){return e.sortAddon})),m=(0,s.x)((function(e){return e.addonGroups})),h=B((0,P.useState)(null),2),g=h[0],I=h[1],x=B((0,P.useState)(null),2),E=x[0],O=x[1],A=(0,w._)().getSectionById,_=(0,S.T)().closeSettingPanel,C=function(){I(null),O(null)};(0,l.IJ)({onDragStart:function(e){var t,n=e.active,o=null===(t=n.data.current)||void 0===t?void 0:t.content;if(n.data.current&&o){var r=Object.values(m).flat().find((function(e){return e.name===o.name}));I(R(R(R(R({},o),!("icon"in o)&&(0,y.$K)(r)&&{icon:r.icon}),!("title"in o)&&(0,y.$K)(r)&&{title:r.title}),{},{type:n.data.current.type}))}else I(null)},onDragMove:function(e){var t,n,o,r=e.over,i=e.active.rect.current.translated,a=null==r?void 0:r.rect;if(!i||!a||null===(t=r.data.current)||void 0===t||!t.isVisible||(n=i,(o=a).left>n.right||o.right<n.left||o.top>n.bottom||o.bottom<n.top))return O(null);var l=i.top+i.height/2<a.top+a.height/2,d=i.left+i.width/2<a.left+a.width/2;O({isTop:l,isLeft:d})},onDragEnd:function(e){var t=e.active,n=e.over,o=t.data.current,i=null==n?void 0:n.data.current;o&&i&&t.id!==(null==n?void 0:n.id)&&k({active:t,over:n})?((0,y.r3)((0,y.zt)(r.Dw),o.type)?Z({activeCurrent:o,overCurrent:i}):T({activeCurrent:o,overCurrent:i}),C(),_()):C()},onDragCancel:function(){C()}});var T=function(e){var t=e.activeCurrent,n=e.overCurrent;switch(n.type){case r.t.NestedRow:var o,i=n.nestedRowData;if(!(0,y.$K)(i))return;if((0,y.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],t.type))v({sourceSectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,sourceAddonIndex:t.addonIndex,sourceChildIndex:t.childIndex,destinationSectionIndex:i.sectionIndex,destinationColumnIndex:i.columnIndex,destinationAddonIndex:i.addonIndex,isAbove:null!==(o=null==E?void 0:E.isTop)&&void 0!==o&&o});else if(r.t.NestedRow===t.type){var a,l=t.nestedRowData;if(!(0,y.$K)(l))return;v({sourceSectionIndex:l.sectionIndex,sourceColumnIndex:l.columnIndex,sourceAddonIndex:l.addonIndex,destinationSectionIndex:i.sectionIndex,destinationColumnIndex:i.columnIndex,destinationAddonIndex:i.addonIndex,isAbove:null!==(a=null==E?void 0:E.isTop)&&void 0!==a&&a})}break;case r.t.Section:t.type===r.t.Section&&f({sourceSectionIndex:t.sectionIndex,destinationSectionIndex:n.sectionIndex});break;case r.t.Column:if(t.type===r.t.Column)b({sectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,destinationColumnIndex:n.columnIndex});else if((0,y.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],t.type))v({sourceSectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,sourceAddonIndex:t.addonIndex,sourceChildIndex:t.childIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:0,isAbove:!0});else if(r.t.NestedRow===t.type){var d=t.nestedRowData;if(!(0,y.$K)(d))return;v({sourceSectionIndex:d.sectionIndex,sourceColumnIndex:d.columnIndex,sourceAddonIndex:d.addonIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:0,isAbove:!0})}break;case r.t.EmptyDivChild:var c;(0,y.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],t.type)&&v({sourceSectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,sourceAddonIndex:t.addonIndex,sourceChildIndex:t.childIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:n.addonIndex,emptyDivChild:!0,isAbove:null!==(c=null==E?void 0:E.isTop)&&void 0!==c&&c});break;case r.t.Addon:case r.t.DeepAddon:case r.t.Div:var s;if((0,y.r3)([r.t.Addon,r.t.Div,r.t.DeepAddon],t.type))v({sourceSectionIndex:t.sectionIndex,sourceColumnIndex:t.columnIndex,sourceAddonIndex:t.addonIndex,sourceChildIndex:t.childIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:n.addonIndex,destinationChildIndex:n.childIndex,isAbove:null!==(s=null==E?void 0:E.isTop)&&void 0!==s&&s});else if(r.t.NestedRow===t.type){var u,p=t.nestedRowData;if(!(0,y.$K)(p))return;v({sourceSectionIndex:p.sectionIndex,sourceColumnIndex:p.columnIndex,sourceAddonIndex:p.addonIndex,destinationSectionIndex:n.sectionIndex,destinationColumnIndex:n.columnIndex,destinationAddonIndex:n.addonIndex,isAbove:null!==(u=null==E?void 0:E.isTop)&&void 0!==u&&u})}}},Z=function(l){var s=l.activeCurrent,f=l.overCurrent;switch(f.type){case r.t.NestedRow:var b,v=f.nestedRowData;if(!(0,y.$K)(v))return;if((0,y.r3)([r.Dw.AddonElement,r.Dw.DivElement],s.type))e({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,addon:s.content,isAbove:null===(b=null==E?void 0:E.isTop)||void 0===b||b});else if((0,y.r3)([r.Dw.RowElement],s.type)){var m;d({sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,isTop:null===(m=null==E?void 0:E.isTop)||void 0===m||m})}else if((0,y.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var h,g=null;if((0,u.fp)(s.content)){var I=s.content.section;g=(0,y.Rx)(I)}if((0,p.L)(s.content)){var x=s.content.json;g=(0,y.Rx)(x)}if(!(0,y.$K)(g))return;var O=A(g[0].id).index;i({sectionData:g,sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,nestedSectionIndex:O,isAbove:null===(h=null==E?void 0:E.isTop)||void 0===h||h})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var S,w=s.content.code,D=(0,y.Rx)(w);if(!(0,y.$K)(D))return;var _=(0,y.gX)(D)?{name:D.name,sections:D.rows,addons:D.addon}:D;n({addonData:_,sectionIndex:v.sectionIndex,columnIndex:v.columnIndex,addonIndex:v.addonIndex,isAbove:null===(S=null==E?void 0:E.isTop)||void 0===S||S})}break;case r.t.Section:if(r.Dw.RowElement===s.type){var P,C=null===(P=null==E?void 0:E.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,R=null;if((0,u.fp)(s.content)){var Z=s.content.section;R=(0,y.Rx)(Z)}if((0,p.L)(s.content)){var B=s.content.json;R=(0,y.Rx)(B)}if(!(0,y.$K)(R))return;o({sectionData:R,sectionIndex:f.sectionIndex,isAbove:null===(T=null==E?void 0:E.isTop)||void 0===T||T})}break;case r.t.Column:if(r.Dw.ColumnsElement===s.type){var L,k=null===(L=null==E?void 0:E.isLeft)||void 0===L||L;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 j,W=null;if((0,u.fp)(s.content)){var q=s.content.section;W=(0,y.Rx)(q)}if((0,p.L)(s.content)){var U=s.content.json;W=(0,y.Rx)(U)}if(!(0,y.$K)(W))return;var N=A(W[0].id).index;i({sectionData:W,sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:(0,y.$K)(f.addonIndex)?f.addonIndex:0,nestedSectionIndex:N,isAbove:null===(j=null==E?void 0:E.isTop)||void 0===j||j})}else if((0,y.r3)([r.Dw.AddonElement,r.Dw.DivElement],s.type)){var M,G=s.content;e({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,childIndex:f.childIndex,addon:G,isAbove:null===(M=null==E?void 0:E.isTop)||void 0===M||M})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var $=s.content.code,K=(0,y.Rx)($);if(!(0,y.$K)(K))return;var F=(0,y.gX)(K)?{name:K.name,sections:K.rows,addons:K.addon}:K;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],s.type)){var V=s.content;e({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,childIndex:0,emptyDivChild:!0,addon:V,isAbove:!0})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var X=s.content.code,H=(0,y.Rx)(X);if(!(0,y.$K)(H))return;var Y={name:H.name,sections:H.rows,addons:H.addon};n({addonData:Y,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 z;if((0,y.r3)([r.Dw.AddonElement,r.Dw.DivElement],s.type))e({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,childIndex:f.childIndex,addon:s.content,isAbove:null===(z=null==E?void 0:E.isTop)||void 0===z||z});else if((0,y.r3)([r.Dw.RowElement],s.type)&&!f.content.parent){var J;d({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,isTop:null===(J=null==E?void 0:E.isTop)||void 0===J||J})}else if(r.Dw.SavedAddonElement===s.type&&(0,u.$F)(s.content)){var Q,ee=s.content.code,te=(0,y.Rx)(ee);if(!(0,y.$K)(te))return;var ne={name:te.name,sections:te.rows,addons:te.addon};n({addonData:ne,sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,childIndex:f.childIndex,isAbove:null===(Q=null==E?void 0:E.isTop)||void 0===Q||Q})}else if((0,y.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var oe,re=null;if((0,u.fp)(s.content)){var ie=s.content.section;re=(0,y.Rx)(ie)}if((0,p.L)(s.content)){var ae=s.content.json;re=(0,y.Rx)(ae)}if(!(0,y.$K)(re))return;var le=A(re[0].id).index;i({sectionData:re,sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,nestedSectionIndex:le,isAbove:null===(oe=null==E?void 0:E.isTop)||void 0===oe||oe})}break;case r.t.TableItem:if((0,y.r3)([r.Dw.AddonElement],s.type)&&(0,y.$K)(f.tableItem)){var de,ce=s.content;t({sectionIndex:f.sectionIndex,columnIndex:f.columnIndex,addonIndex:f.addonIndex,childIndex:f.childIndex,tableItem:f.tableItem,addon:ce,isAbove:null===(de=null==E?void 0:E.isTop)||void 0===de||de})}break;case r.XA:if((0,y.r3)([r.Dw.BlockElement,r.Dw.SavedSectionElement],s.type)){var se,ue=null;if((0,u.fp)(s.content)){var pe=s.content.section;ue=(0,y.Rx)(pe)}if((0,p.L)(s.content)){var fe=s.content.json;ue=(0,y.Rx)(fe)}if(!(0,y.$K)(ue))return;o({sectionData:ue,sectionIndex:f.sectionIndex,isAbove:null===(se=null==E?void 0:E.isTop)||void 0===se||se})}}};return{dragElement:g,placeholderPosition:E}}(),d=a.dragElement,c=a.placeholderPosition;return(0,h.BX)(h.HY,{children:[(0,h.BX)("div",{css:mn.contentWrapper,children:[(0,h.tZ)(fe,{}),(0,h.tZ)("div",{css:mn.content,children:e.length>0?(0,h.tZ)(Se.Fo,{id:"page",items:e,strategy:Se.qw,children:(0,h.tZ)("div",{css:mn.sectionWrapper,role:"button",tabIndex:-1,onKeyDown:y.ZT,onClick:function(e){e.currentTarget===e.target&&((0,y.$K)(n)?i(void 0):t())},children:e.map((function(e,t){return e.parent?null:(0,h.tZ)(sn,{content:e,index:t,placeholderPosition:c},e.id)}))})}):(0,h.tZ)("div",{css:mn.emptyLayoutWrapper,role:"button",tabIndex:-1,onKeyDown:y.ZT,onClick:function(e){e.currentTarget===e.target&&((0,y.$K)(n)?i(void 0):t())},children:!(0,y.$K)(d)||d.type!==r.Dw.BlockElement&&d.type!==r.Dw.SavedSectionElement?(0,h.tZ)(ne,{}):(0,h.tZ)(j,{id:(0,y.x0)(),customStyle:mn.emptyChildren,data:{type:r.XA,isVisible:!0,sectionIndex:0},children:(0,h.tZ)("button",{children:(0,h.tZ)(o.Z,{name:"plus",width:32,height:32})})})})})]}),(0,h.tZ)(x,{content:d})]})};var mn={contentWrapper:{name:"4t0hh5-contentWrapper",styles:"height:100%;label:contentWrapper;"},content:{name:"tdw2b0-content",styles:"height:calc(100% - 101px);label:content;"},sectionWrapper:(0,d.iv)("height:100%;padding:",i.W0[32],";display:flex;flex-direction:column;gap:",i.W0[32],";position:relative;cursor:default;;label:sectionWrapper;"),emptyLayoutWrapper:(0,d.iv)("height:100%;padding:",i.W0[32],";cursor:default;;label:emptyLayoutWrapper;"),emptyChildren:(0,d.iv)("background-color:",i.qo.background.white,";border:1px dashed ",i.qo.stroke.neutral,";border-radius:",i.E0[6],";button{",v.iZ.resetButton,";width:100%;height:300px;",v.iZ.flexCenter(),";}svg{color:",i.qo.icon.default,";};label:emptyChildren;")}}}]);
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.09 |
proxy
|
phpinfo
|
Настройка