← Back
Editing: cta-admin.js
(()=>{"use strict";var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var r in a)t.o(a,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{ListBulkActionsRegistry:()=>$,ListConsumer:()=>z,ListFiltersRegistry:()=>at,ListOptionsRegistry:()=>nt,ListProvider:()=>H,ListQuickActionsRegistry:()=>X,getGlobalVars:()=>xt,getListBulkActions:()=>q,getListFilters:()=>it,getListOptions:()=>ht,getListQuickActions:()=>et,init:()=>Lt,registerListBulkAction:()=>J,registerListBulkActionGroup:()=>W,registerListFilter:()=>ot,registerListFilterGroup:()=>st,registerListOption:()=>ct,registerListOptionGroup:()=>pt,registerListQuickAction:()=>K,registerListQuickActionGroup:()=>tt,useList:()=>Q,useListBulkActions:()=>U,useListFilters:()=>rt,useListOptions:()=>lt,useListQuickActions:()=>Y});var a={};t.r(a),t.d(a,{deleteBulkAction:()=>bt,disableBulkAction:()=>wt,enableBulkAction:()=>_t,exportBulkAction:()=>yt,trashBulkAction:()=>ft});var r={};t.r(r),t.d(r,{statusFilter:()=>At,typeFilter:()=>Tt});var o={};t.r(o),t.d(o,{exportListOption:()=>Bt,importListOption:()=>Mt});var s={};t.r(s),t.d(s,{deleteQuickAction:()=>Ft,editQuickAction:()=>Rt,trashQuickAction:()=>Nt});const i=window.popupMaker.useQueryParams,n=window.wp.domReady;var l=t.n(n);const c=window.wp.hooks,p=window.wp.element,h=window.wp.data,u=window.popupMaker.data;function d(t){var e,a,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(a=d(t[e]))&&(r&&(r+=" "),r+=a)}else for(a in t)t[a]&&(r&&(r+=" "),r+=a);return r}const S=function(){for(var t,e,a=0,r="",o=arguments.length;a<o;a++)(t=arguments[a])&&(e=d(t))&&(r&&(r+=" "),r+=e);return r},P=window.popupMaker.i18n,m=window.wp.components,V=window.popupMaker.layout,G=((0,p.forwardRef)(({icon:t,size:e=24,...a},r)=>(0,p.cloneElement)(t,{width:e,height:e,...a,ref:r})),window.wp.primitives),g=window.ReactJSXRuntime,x=(G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.Circle,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,(0,g.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)(G.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm3.8 10.7-1.1 1.1-2.7-2.7-2.7 2.7-1.1-1.1 2.7-2.7-2.7-2.7 1.1-1.1 2.7 2.7 2.7-2.7 1.1 1.1-2.7 2.7 2.7 2.7Z"})})),v=(G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,(0,g.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)(G.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})})),k=(G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,(0,g.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)(G.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})})),j=(G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.Path,G.Circle,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.G,G.Path,G.Path,G.SVG,G.G,G.Path,G.Path,G.SVG,G.G,G.Path,G.Path,G.SVG,G.G,G.Path,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,(0,g.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(G.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"})}));G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path;const _=(0,g.jsx)(G.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})}),w=(G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,(0,g.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(G.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})})),f=(0,g.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(G.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})}),b=(G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,(0,g.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(G.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})})),y=(G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.Path,G.SVG,G.Path,G.Path,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,(0,g.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(G.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})})),C=(G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.Path,G.SVG,G.Path,G.Path,G.Path,G.SVG,G.Path,G.Path,G.SVG,G.Path,G.Path,G.SVG,G.Path,G.Path,G.SVG,G.Path,G.Path,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,(0,g.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(G.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})})),A=(G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,(0,g.jsx)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(G.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})})),T=(G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,G.SVG,G.Path,window.wp.htmlEntities),M=window.popupMaker.utils,B=window.popupMaker.icons,R=window.popupMaker.ctaEditor,N=window.popupMaker.components,F=window.popupMaker.coreData,L=()=>{},E={callToActions:[],filteredCallToActions:[],bulkSelection:[],setBulkSelection:()=>{},updateCallToAction:(t,e)=>Promise.resolve(!1),deleteCallToAction:(t,e=!1)=>Promise.resolve(!1),isLoading:!1,isDeleting:!1,filters:{status:"all",searchText:"",type:"all"},setFilters:L,sortConfig:{orderby:"id",order:N.SortDirection.ASC},setSortConfig:L},D=(0,p.createContext)(E),O=D,I=O.Provider,z=O.Consumer,H=({value:t={},children:e})=>{const[a,r]=(0,p.useState)([]),[o,s]=(0,i.useQueryParams)({orderby:(0,i.withDefault)(i.StringParam,"id"),order:(0,i.withDefault)(i.StringParam,N.SortDirection.ASC)}),[n,l]=(0,i.useQueryParams)({status:(0,i.withDefault)(i.StringParam,"all"),searchText:(0,i.withDefault)(i.StringParam,""),type:(0,i.withDefault)(i.StringParam,"all")}),c=()=>l({status:void 0,searchText:void 0,type:void 0});(0,p.useEffect)(()=>c,[]);const u=(0,h.useSelect)(t=>t(F.callToActionStore).getCallToActions(),[]),d=(0,h.useSelect)(t=>t(F.callToActionStore).isResolving("getCallToActions"),[]),S=(0,h.useSelect)(t=>t(F.callToActionStore).isResolving("deleteCallToAction"),[]),{updateCallToAction:P,deleteCallToAction:m}=(0,h.useDispatch)(F.callToActionStore),V=(0,p.useMemo)(()=>{if(!u)return[];const t=u.filter(t=>"all"===n.status||n.status===t.status).filter(t=>!n.searchText||!n.searchText.length||t.title.rendered.toLowerCase().indexOf(n.searchText.toLowerCase())>=0||t.excerpt.rendered&&t.excerpt.rendered.toLowerCase().indexOf(n.searchText.toLowerCase())>=0).filter(t=>"all"===n.type||n.type===t.settings.type);return null!==o&&t.sort((t,e)=>{const a=t=>{switch(o.orderby){case"id":return t.id;case"type":return t.settings.type;case"conversions":return t.stats?.conversions??0;default:return t.title.rendered.toLowerCase()}},r=a(t),s=a(e);return r<s?o.order===N.SortDirection.ASC?-1:1:r>s?o.order===N.SortDirection.ASC?1:-1:0}),t},[u,n,o]);return(0,g.jsx)(I,{value:{...t,bulkSelection:a,setBulkSelection:r,filters:n,setFilters:l,callToActions:u,filteredCallToActions:V,isLoading:d,isDeleting:S,updateCallToAction:P,deleteCallToAction:m,sortConfig:o,setSortConfig:s},children:e})},Q=()=>(0,p.useContext)(D),Z=window.popupMaker.registry,$=(0,Z.createRegistry)({name:"cta-editor/list-bulk-actions",groups:{status:{priority:10,label:"Status"},trash:{priority:20,label:"Trash"},export:{priority:30,label:"Export"}}}),U=()=>$.useItems(),J=$.register,W=$.registerGroup,q=()=>$.getItems(),X=(0,Z.createRegistry)({name:"cta-editor/list-quick-actions",groups:{general:{priority:10},trash:{priority:20}}}),Y=()=>X.useItems(),K=X.register,tt=X.registerGroup,et=()=>X.getItems(),at=(0,Z.createRegistry)({name:"cta-editor/list-filters",groups:{core:{priority:10,label:"Core"},advanced:{priority:20,label:"Advanced"}},defaultGroup:"core"}),rt=()=>at.useItems(),ot=at.register,st=at.registerGroup,it=()=>at.getItems(),nt=(0,Z.createRegistry)({name:"cta-editor/list-options",groups:{import:{priority:10,label:"Import"}}}),lt=()=>nt.useItems(),ct=nt.register,pt=nt.registerGroup,ht=()=>nt.getItems(),ut=()=>{const t=(0,p.useRef)(void 0),e=(0,p.useRef)(),[a,r]=(0,p.useState)(!1),o=U(),{bulkSelection:s=[]}=Q(),i={};if(0===s.length)return null;const n=({group:e})=>{if(!e||e===t.current)return null;const a=t.current;return t.current=e,a?(0,g.jsx)("hr",{}):null};return(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(m.Dropdown,{className:"list-table-bulk-actions",contentClassName:"list-table-bulk-actions__popover",placement:"bottom left",focusOnMount:"firstElement",open:a,popoverProps:{noArrow:!1,anchor:{getBoundingClientRect:()=>e.current?.getBoundingClientRect()||new DOMRect},onClose:()=>{r(!1)},onFocusOutside:()=>{r(!1)}},renderToggle:()=>(0,g.jsxs)(m.Flex,{children:[(0,g.jsx)("span",{className:"selected-items",children:(0,P.sprintf)( // translators: %d: number of items. // translators: %d: number of items. (0,P._n)("%d item selected","%d items selected",s.length,"popup-maker"),s.length)}),(0,g.jsxs)(m.Button,{className:"popover-toggle",ref:t=>{e.current=t},"aria-label":(0,P.__)("Bulk Actions","popup-maker"),variant:"secondary",onClick:()=>r(!a),"aria-expanded":a,icon:B.CheckAll,iconSize:20,children:[(0,P.__)("Bulk Actions","popup-maker"),(0,g.jsx)(m.Icon,{className:"toggle-icon",icon:a?k:v})]})]}),renderContent:({onClose:e})=>(t.current=void 0,(0,g.jsx)(m.NavigableMenu,{orientation:"vertical",children:o.map(({id:t,group:a,render:r})=>(0,g.jsxs)(p.Fragment,{children:[(0,g.jsx)(n,{group:a}),(0,g.jsx)(r,{...i,onClose:e})]},t))}))})})},dt=({values:t})=>{const e=(0,p.useRef)(void 0),a=Y(),r={values:t};if(0===a.length)return null;const o=({group:t})=>{if(!t||t===e.current)return null;const a=e.current;return e.current=t,a?(0,g.jsx)("span",{children:"|"}):null};return(0,g.jsx)("div",{className:"item-actions",children:(e.current=void 0,(0,g.jsx)(g.Fragment,{children:a.map(({id:t,group:e,render:a})=>(0,g.jsxs)(p.Fragment,{children:[(0,g.jsx)(o,{group:e}),(0,g.jsx)(a,{...r})]},t))}))})},St=()=>{const{filters:t={},setFilters:e,callToActions:a=[],filteredCallToActions:r=[]}=Q(),o=rt(),s=(0,p.useRef)(void 0),i=(0,p.useCallback)(({group:t})=>t&&t!==s.current?(s.current,s.current=t,null):null,[]),n=(0,p.useCallback)(()=>(s.current=void 0,(0,g.jsx)(g.Fragment,{children:o.map(({id:o,group:s,render:n})=>(0,g.jsxs)(p.Fragment,{children:[(0,g.jsx)(i,{group:s}),(0,g.jsx)(n,{filters:t,setFilters:e,onClose:()=>{},items:a,filteredItems:r})]},o))})),[o,t,e,a,r,i]);return 0===o.length?null:(0,g.jsx)("div",{className:"list-table-filters",children:n()})},Pt=()=>{const t=(0,p.useRef)(),e=(0,p.useRef)(void 0),[a,r]=(0,p.useState)(!1),o=lt(),s={};if(0===o.length)return null;const i=({group:t})=>{if(!t||t===e.current)return null;const a=e.current;return e.current=t,a?(0,g.jsx)("hr",{}):null};return(0,g.jsx)(m.Dropdown,{className:"list-table-options-menu",contentClassName:"list-table-options-menu__popover",placement:"bottom left",focusOnMount:"firstElement",open:a,popoverProps:{noArrow:!1,anchor:{getBoundingClientRect:()=>t.current?.getBoundingClientRect()||new DOMRect},onClose:()=>{r(!1)},onFocusOutside:()=>{r(!1)}},renderToggle:()=>(0,g.jsx)(m.Button,{className:"popover-toggle","aria-label":(0,P.__)("Additional options","popup-maker"),icon:b,onClick:()=>r(!a),"aria-expanded":a,ref:e=>{t.current=e}}),renderContent:({onClose:t})=>(e.current=void 0,(0,g.jsx)(m.NavigableMenu,{orientation:"vertical",children:o.map(({id:e,group:a,render:r})=>(0,g.jsxs)(p.Fragment,{children:[(0,g.jsx)(i,{group:a}),(0,g.jsx)(r,{...s,onClose:t})]},e))}))})},{cta_types:mt}=window.popupMakerCtaAdmin,Vt=()=>{const{setEditorId:t}=(0,R.useEditor)(),[e,a]=(0,p.useState)(!1),[r,o]=(0,p.useState)(),s=()=>o(void 0);return(0,g.jsx)(H,{children:(0,g.jsx)(z,{children:({isLoading:o,bulkSelection:i=[],setBulkSelection:n=M.noop,filteredCallToActions:l=[],updateCallToAction:c=M.noop,filters:{searchText:p=""},setFilters:h,sortConfig:u,setSortConfig:d})=>(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(N.ConfirmDialogue,{...r,onClose:s}),(0,g.jsxs)("div",{className:"list-table-container",children:[(0,g.jsxs)("div",{className:"list-table-header",children:[(0,g.jsxs)("div",{className:"list-search",children:[(0,g.jsx)(m.Icon,{icon:y}),(0,g.jsx)(m.TextControl,{placeholder:(0,P.__)("Search Calls to Action…","popup-maker"),value:p??"",onChange:t=>h({searchText:""!==t?t:void 0}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})]}),(0,g.jsx)(ut,{}),0===i.length&&(0,g.jsx)(m.Button,{className:"filters-toggle",variant:"secondary",onClick:()=>{a(!e)},"aria-expanded":e,icon:B.FilterLines,iconSize:20,text:e?(0,P.__)("Hide Filters","popup-maker"):(0,P.__)("Filters","popup-maker")}),(0,g.jsx)(Pt,{})]}),e&&(0,g.jsx)(St,{}),(0,g.jsx)(N.ListTable,{isLoading:o,selectedItems:i,onSelectItems:t=>n(t),items:o?[]:l,columns:{enabled:()=>(0,g.jsx)(m.Tooltip,{text:(0,P.__)("Enable or disable the call to action","popup-maker"),placement:"top-end",children:(0,g.jsx)("span",{children:(0,g.jsx)(m.Icon,{icon:_})})}),title:(0,P.__)("Name","popup-maker"),description:(0,P.__)("Description","popup-maker"),type:(0,P.__)("Type","popup-maker"),conversions:(0,P.__)("Conversions","popup-maker"),status:(0,P.__)("Status","popup-maker")},sortableColumns:["type","title","conversions"],onSort:(t,e)=>{d({orderby:t,order:e})},initialSort:u,rowClasses:t=>[`call-to-action-${t.id}`,`status-${t.status}`],renderCell:(e,a)=>{const r=a.status,o="trash"===r,s="publish"===r;switch(e){case"enabled":return(0,g.jsx)(m.ToggleControl,{label:"","aria-label":(0,P.__)("Enable or disable the call to action","popup-maker"),checked:s,disabled:o,onChange:t=>{c({id:a.id,status:t?"publish":"draft"})},__nextHasNoMarginBottom:!0});case"status":return o?(0,g.jsx)(m.Icon,{"aria-label":(0,P.__)("In Trash","popup-maker"),icon:C,size:20}):(0,g.jsx)("span",{children:s?(0,P.__)("Enabled","popup-maker"):(0,P.__)("Disabled","popup-maker")});case"title":return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(m.Button,{variant:"link",onClick:()=>t(a.id),children:(0,T.decodeEntities)(a.title.rendered)}),(0,g.jsx)(dt,{values:a})]});case"conversions":return a.stats?.conversions??0;case"type":return(t=>{const e=Object.values(mt).find(({key:e})=>e===t);return e?.label??""})(a.settings.type);case"description":return(0,T.decodeEntities)(a.excerpt?.raw||"");default:return a[e]??a.settings[e]??""}}})]})]})})})},Gt=()=>{const{setEditorId:t}=(0,R.useEditor)(),e=(0,h.useSelect)(t=>t(F.callToActionStore).getCallToActions(),[]),a=(0,h.useSelect)(t=>t(F.callToActionStore).isResolving("getCallToActions"),[]),r=e?.length??0;return(0,g.jsxs)("header",{className:"popup-maker-call-to-actions-view__header",children:[(0,g.jsx)("h1",{className:"view-title wp-heading-inline",children:(0,P.__)("Calls to Action","popup-maker")}),(0,g.jsx)("span",{className:"item-count",children:a?(0,g.jsx)(m.Spinner,{}):(0,P.sprintf)(/* translators: %d: number of items. */ /* translators: %d: number of items. */ (0,P._n)("%d item","%d items",r,"popup-maker"),r)}),(0,g.jsx)(m.Button,{className:"add-call-to-action",onClick:()=>{t("new")},variant:"primary",children:(0,P.__)("Add Call to Action","popup-maker")})]})},gt=()=>{const t=(0,p.useRef)({}),{notices:e,isEditorActive:a}=(0,h.useSelect)(t=>({notices:t(F.callToActionStore).getNotices(),isEditorActive:t(F.callToActionStore).isEditorActive()}),[]),{removeNotice:r}=(0,h.useDispatch)(F.callToActionStore),o=(0,p.useCallback)(e=>{t.current[e]&&(clearTimeout(t.current[e]),delete t.current[e]),r(e)},[r]);return(0,p.useLayoutEffect)(()=>{e.forEach(e=>{if(t.current[e.id])return;const a=e.id?.startsWith("field-error-");a||R.DEBUG_MODE||(t.current[e.id]=setTimeout(()=>{o(e.id)},3e3))})},[e,o]),!e.length||a?null:(0,g.jsx)("div",{className:"notices",children:e.map(t=>(0,g.jsx)(m.Notice,{status:t.status,isDismissible:t.isDismissible,onRemove:()=>o(t.id),children:t.content},t.id))})},xt=()=>"undefined"!=typeof window&&window.popupMaker.globalVars?window.popupMaker.globalVars:{version:"1.0.0",wpVersion:6.5,pluginUrl:"",assetsUrl:"",adminUrl:"",nonce:"",permissions:{edit_ctas:!1,edit_popups:!1,edit_popup_themes:!1,mange_settings:!1}},vt=(0,R.withQueryParams)((0,R.withModal)(R.Editor)),kt=()=>{const{permissions:t={edit_ctas:!1}}=xt(),{edit_ctas:e}=t;return e?(0,g.jsxs)("div",{className:"call-to-action-list",children:[(0,g.jsx)(gt,{}),(0,g.jsx)(Gt,{}),(0,g.jsx)(Vt,{}),(0,g.jsx)(vt,{})]}):(0,g.jsxs)("div",{className:"call-to-action-list permission-denied",children:[(0,g.jsx)(gt,{}),(0,g.jsx)("h3",{children:(0,P.__)("Permission Denied","popup-maker")}),(0,g.jsx)("p",{children:(0,g.jsx)("strong",{children:(0,P.__)("You do not have permission to manage Calls to Action.","popup-maker")})})]})},jt=()=>{const{permissions:t={edit_ctas:!1}}=xt(),{edit_ctas:e}=t,[{view:a="call-to-actions"},r]=(0,i.useQueryParams)({tab:i.StringParam,view:i.StringParam}),o=(0,p.useMemo)(()=>{let t=[];return e&&t.push({name:"call-to-actions",title:(0,P.__)("Calls to Action","popup-maker"),className:"call-to-actions",pageTitle:(0,P.__)("Popup Maker - Calls to Action","popup-maker"),heading:(0,P.__)("Popup Maker - Calls to Action","popup-maker"),comp:kt}),t=(0,c.applyFilters)("popupMaker.callToActionEditor.views",[...t],{view:a,setParams:r}),t},[a,r,e]),s=o.find(t=>t.name===a),n=s?.comp?s.comp:()=>(0,g.jsx)(g.Fragment,{});return(0,p.useEffect)(()=>{document.title=o.find(t=>t.name===a)?.pageTitle??(0,P.__)("Popup Maker","popup-maker")},[a,o]),(0,g.jsxs)(V.AppLayout,{className:S(["popup-maker-call-to-actions-page",`view-${a}`]),children:[(0,g.jsx)(V.AppHeader,{navTabId:"call-to-actions",tabs:o,currentTab:a??void 0,onTabChange:t=>r({view:t})}),(0,g.jsx)(V.AppContent,{children:(0,g.jsx)(n,{})}),(0,g.jsx)(m.Popover.Slot,{})]})},_t={id:"enable",group:"status",priority:5,render:()=>{const t=(0,h.useRegistry)(),{bulkSelection:e=[],setBulkSelection:a}=Q(),{getCallToAction:r}=(0,h.useSelect)(t=>({getCallToAction:t(F.callToActionStore).getCallToAction}),[]),{createNotice:o,updateCallToAction:s}=(0,h.useDispatch)(F.callToActionStore);return 0===e.length?null:e.some(t=>{const e=r(t);return"publish"!==e?.status})?(0,g.jsx)(m.Button,{icon:w,text:(0,P.__)("Enable","popup-maker"),onClick:()=>{t.batch(()=>{const t=e.length;e.forEach(t=>{const e=r(t);e?.id===t&&s({id:t,status:"publish"},!1,!1)}),a([]),o("success",(0,P.sprintf)( // translators: %d: number of items. // translators: %d: number of items. (0,P._n)("%d call to action enabled.","%d calls to action enabled.",t,"popup-maker"),t),{id:"bulk-enable"})})}}):null}},wt={id:"disable",group:"status",priority:6,render:()=>{const{bulkSelection:t=[],setBulkSelection:e}=Q(),a=(0,h.useRegistry)(),{getCallToAction:r}=(0,h.useSelect)(t=>({getCallToAction:t(F.callToActionStore).getCallToAction}),[]),{createNotice:o,updateCallToAction:s}=(0,h.useDispatch)(F.callToActionStore);return 0===t.length?null:t.some(t=>{const e=r(t);return"draft"!==e?.status})?(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(m.Button,{icon:f,text:(0,P.__)("Disable","popup-maker"),onClick:()=>{a.batch(()=>{const a=t.length;t.forEach(t=>{const e=r(t);e?.id===t&&s({id:t,status:"draft"},!1,!1)}),e([]),o("success",(0,P.sprintf)( // translators: %d: number of items. // translators: %d: number of items. (0,P._n)("%d call to action disabled.","%d calls to action disabled.",a,"popup-maker"),a),{id:"bulk-disable"})})}})}):null}},ft={id:"trash",group:"trash",priority:5,render:()=>{const[t,e]=(0,p.useState)(),{bulkSelection:a=[],setBulkSelection:r,deleteCallToAction:o}=Q(),s=(0,h.useRegistry)(),{getCallToAction:i}=(0,h.useSelect)(t=>({getCallToAction:t(F.callToActionStore).getCallToAction}),[]),{createNotice:n}=(0,h.useDispatch)(F.callToActionStore);return 0===a.length?null:a.some(t=>{const e=i(t);return"trash"!==e?.status})?(0,g.jsxs)(g.Fragment,{children:[t&&(0,g.jsx)(N.ConfirmDialogue,{...t,onClose:()=>e(void 0)}),(0,g.jsx)(m.Button,{text:(0,P.__)("Trash","popup-maker"),icon:C,onClick:()=>{e({isDestructive:!0,message:(0,P.sprintf)( // translators: %d: number of items. // translators: %d: number of items. (0,P.__)("Are you sure you want to trash %d items?","popup-maker"),a.length),callback:()=>{s.batch(()=>{const t=a.length;a.forEach(t=>o(t,!1,!1)),r([]),n("success",(0,P.sprintf)( // translators: %d: number of items. // translators: %d: number of items. (0,P._n)("%d call to action moved to trash.","%d calls to action moved to trash.",t,"popup-maker"),t),{id:"bulk-trash"})})}})}})]}):null}},bt={id:"delete",group:"trash",priority:6,render:()=>{const[t,e]=(0,p.useState)(),{bulkSelection:a=[],setBulkSelection:r}=Q(),o=(0,h.useRegistry)(),{createNotice:s,deleteCallToAction:i}=(0,h.useDispatch)(F.callToActionStore);return 0===a.length?null:(0,g.jsxs)(g.Fragment,{children:[t&&(0,g.jsx)(N.ConfirmDialogue,{...t,onClose:()=>e(void 0)}),(0,g.jsx)(m.Button,{text:(0,P.__)("Delete Permanently","popup-maker"),icon:x,isDestructive:!0,onClick:()=>{e({isDestructive:!0,message:(0,P.sprintf)( // translators: %d: number of items. // translators: %d: number of items. (0,P.__)("Are you sure you want to premanently delete %d items?","popup-maker"),a.length),callback:()=>{o.batch(()=>{const t=a.length;a.forEach(t=>i(t,!0,!1)),r([]),s("success",(0,P.sprintf)( // translators: %d: number of items. // translators: %d: number of items. (0,P._n)("%d call to action deleted.","%d calls to action deleted.",t,"popup-maker"),t),{id:"bulk-delete"})})}})}})]})}},yt={id:"export",group:"export",priority:5,render:()=>{const[t,e]=(0,p.useState)(!1),a=(0,p.useRef)(null);return(0,g.jsxs)(g.Fragment,{children:[t&&(0,g.jsx)(m.Popover,{anchor:a.current,onClose:()=>e(!1),children:(0,g.jsxs)(m.Flex,{direction:"column",gap:"16px",justify:"center",align:"center",className:"pmp-popover-content",style:{padding:"16px",minWidth:"350px"},children:[(0,g.jsx)(m.Icon,{icon:B.Mark,size:28}),(0,g.jsx)("h3",{style:{margin:0},children:(0,P.__)("Quick exports with Popup Maker Pro","popup-maker")}),(0,g.jsx)("p",{style:{margin:0},children:(0,P.__)("Popup Maker Pro gives you the power to import & export your calls to action to a JSON file in seconds.","popup-maker")}),(0,g.jsx)(m.Button,{variant:"primary",href:"https://wppopupmaker.com/pricing/?utm_source=popup-maker&utm_medium=cta-editor&utm_campaign=export-cta",target:"_blank",children:(0,P.__)("Learn more or upgrade today","popup-maker")})]})}),(0,g.jsxs)(m.Flex,{direction:"row",justify:"space-between",onMouseEnter:()=>e(!0),style:{cursor:"pointer",paddingRight:"10px",pointerEvents:"all"},children:[(0,g.jsx)(m.Button,{icon:j,text:(0,P.__)("Export","popup-maker"),disabled:!0,showTooltip:!0,label:(0,P.__)("Export is available with Popup Maker Pro","popup-maker"),ref:a}),(0,g.jsx)(m.Icon,{icon:B.Mark,size:14})]})]})}},Ct={all:(0,P.__)("All","popup-maker"),publish:(0,P.__)("Enabled","popup-maker"),draft:(0,P.__)("Disabled","popup-maker"),pending:(0,P.__)("Pending","popup-maker"),trash:(0,P.__)("Trash","popup-maker"),future:(0,P.__)("Future","popup-maker"),private:(0,P.__)("Private","popup-maker")},At={id:"status",priority:10,group:"core",render:({filters:t,setFilters:e,onClose:a,items:r,filteredItems:o})=>{const[s,i]=(0,p.useState)(!1),n=(0,p.useRef)(null),l=(0,p.useMemo)(()=>r.reduce((t,e)=>(t[e.status]=(t[e.status]??0)+1,t.all++,t),{all:0}),[r]),c=(0,p.useMemo)(()=>o.reduce((t,e)=>(t[e.status]=(t[e.status]??0)+1,t.all++,t),{all:0}),[o]),h=t?.status??"all";return(0,g.jsxs)("div",{className:S(["list-table-filter list-table-filter--status",s?"is-active":""]),children:[(0,g.jsxs)(m.Button,{className:"filter-button",onClick:()=>i(!s),ref:n,children:[(0,g.jsxs)("span",{className:"filter-label",children:[(0,P.__)("Status","popup-maker"),":"]})," ",(0,g.jsx)("span",{className:"filter-selection",children:Ct[h]}),(0,g.jsx)(m.Icon,{className:"filter-icon",icon:s?k:v})]}),s&&n.current&&(0,g.jsx)(m.Popover,{className:"list-table-filters__popover",anchor:n.current,onClose:()=>{i(!1),a()},position:"bottom right",onFocusOutside:()=>{i(!1),a()},children:(0,g.jsx)(m.RadioControl,{label:(0,P.__)("Status","popup-maker"),hideLabelFromVision:!0,selected:h,options:Object.entries(Ct).filter(([t])=>{return(l[h]??0)>0?(e=t,Boolean(c?.[e])):(l[t]??0)>0;var e}).map(([t,e])=>({label:`${e} (${c[t]??0})`,value:t})),onChange:t=>{e({status:t}),i(!1),a()}})})]})}},Tt={id:"type",group:"core",render:({filters:t,setFilters:e,onClose:a,items:r,filteredItems:o})=>{const[s,i]=(0,p.useState)(!1),n=(0,p.useRef)(null),l=(0,p.useMemo)(()=>{const{cta_types:t}=window.popupMakerCtaAdmin;return Object.values(t).reduce((t,{key:e,label:a})=>({...t,[e]:a}),{all:(0,P.__)("All","popup-maker")})},[]),c=(0,p.useMemo)(()=>r.reduce((t,e)=>{const a=e.settings.type;return t[a]=(t[a]??0)+1,t.all++,t},{all:0}),[r]),h=(0,p.useMemo)(()=>o.reduce((t,e)=>{const a=e.settings.type;return t[a]=(t[a]??0)+1,t.all++,t},{all:0}),[o]);return(0,g.jsxs)("div",{className:S(["list-table-filter list-table-filter--type",s?"is-active":""]),children:[(0,g.jsxs)(m.Button,{className:"filter-button",onClick:()=>i(!s),ref:n,children:[(0,g.jsxs)("span",{className:"filter-label",children:[(0,P.__)("Type","popup-maker"),":"]})," ",(0,g.jsx)("span",{className:"filter-selection",children:Object.prototype.hasOwnProperty.call(l,t?.type??"all")?l[t?.type??"all"]:l.all}),(0,g.jsx)(m.Icon,{className:"filter-icon",icon:s?k:v})]}),s&&n.current&&(0,g.jsx)(m.Popover,{className:"list-table-filters__popover",anchor:n.current,onClose:()=>{i(!1),a()},position:"bottom right",onFocusOutside:()=>{i(!1),a()},children:(0,g.jsx)(m.RadioControl,{label:(0,P.__)("Type","popup-maker"),hideLabelFromVision:!0,selected:t?.type??"all",options:Object.entries(l).filter(([e])=>(c[t?.type??"all"]??0)>0?(t=>Boolean(h?.[t]))(e):(c[e]??0)>0).map(([t,e])=>({label:`${e} (${h[t]??0})`,value:t})),onChange:t=>{e({type:"all"===t?void 0:t}),i(!1),a()}})})]})}},Mt={id:"import",group:"export",render:()=>{const[t,e]=(0,p.useState)(!1),a=(0,p.useRef)(null);return(0,g.jsxs)(g.Fragment,{children:[t&&(0,g.jsx)(m.Popover,{anchor:a.current,onClose:()=>e(!1),children:(0,g.jsxs)(m.Flex,{direction:"column",gap:"16px",justify:"center",align:"center",style:{padding:"16px",minWidth:"350px"},children:[(0,g.jsx)(m.Icon,{icon:B.Mark,size:28}),(0,g.jsx)("h3",{style:{margin:0},children:(0,P.__)("Quick imports with Popup Maker Pro","popup-maker")}),(0,g.jsx)("p",{style:{margin:0},children:(0,P.__)("Popup Maker Pro gives you the power to import your calls to action from a JSON file in seconds.","popup-maker")}),(0,g.jsx)(m.Button,{variant:"primary",href:"https://wppopupmaker.com/pricing/?utm_source=popup-maker&utm_medium=cta-editor&utm_campaign=import-cta",target:"_blank",children:(0,P.__)("Learn more or upgrade today","popup-maker")})]})}),(0,g.jsxs)(m.Flex,{direction:"row",justify:"space-between",onMouseEnter:()=>e(!0),style:{cursor:"pointer",paddingRight:"10px",pointerEvents:"all"},children:[(0,g.jsx)(m.Button,{icon:A,text:(0,P.__)("Import","popup-maker"),disabled:!0,showTooltip:!0,label:(0,P.__)("Import is available with Popup Maker Pro","popup-maker"),ref:a}),(0,g.jsx)(m.Icon,{icon:B.Mark,size:14})]})]})}},Bt={id:"export",group:"export",render:()=>{const[t,e]=(0,p.useState)(!1),a=(0,p.useRef)(null);return(0,g.jsxs)(g.Fragment,{children:[t&&(0,g.jsx)(m.Popover,{anchor:a.current,onClose:()=>e(!1),children:(0,g.jsxs)(m.Flex,{direction:"column",gap:"16px",justify:"center",align:"center",className:"pmp-popover-content",style:{padding:"16px",minWidth:"350px"},children:[(0,g.jsx)(m.Icon,{icon:B.Mark,size:28}),(0,g.jsx)("h3",{style:{margin:0},children:(0,P.__)("Quick exports with Popup Maker Pro","popup-maker")}),(0,g.jsx)("p",{style:{margin:0},children:(0,P.__)("Popup Maker Pro gives you the power to import & export your calls to action to a JSON file in seconds.","popup-maker")}),(0,g.jsx)(m.Button,{variant:"primary",href:"https://wppopupmaker.com/pricing/?utm_source=popup-maker&utm_medium=cta-editor&utm_campaign=export-cta",target:"_blank",children:(0,P.__)("Learn more or upgrade today","popup-maker")})]})}),(0,g.jsxs)(m.Flex,{direction:"row",justify:"space-between",onMouseEnter:()=>e(!0),style:{cursor:"pointer",paddingRight:"10px",pointerEvents:"all"},children:[(0,g.jsx)(m.Button,{icon:j,text:(0,P.__)("Export","popup-maker"),disabled:!0,showTooltip:!0,label:(0,P.__)("Export is available with Popup Maker Pro","popup-maker"),ref:a}),(0,g.jsx)(m.Icon,{icon:B.Mark,size:14})]})]})}},Rt={id:"edit",group:"general",priority:-1,render:({values:t})=>{const{setEditorId:e}=(0,R.useEditor)();return(0,g.jsxs)(g.Fragment,{children:[`${(0,P.__)("ID","popup-maker")}: ${t.id}`,(0,g.jsx)(m.Button,{text:(0,P.__)("Edit","popup-maker"),variant:"link",onClick:()=>e(t.id)})]})}},Nt={id:"trash",group:"trash",priority:11,render:({values:t})=>{const[e,a]=(0,p.useState)(),r=(0,h.useSelect)(t=>t(F.callToActionStore).isResolving("deleteCallToAction"),[]),{deleteCallToAction:o,updateCallToAction:s}=(0,h.useDispatch)(F.callToActionStore),i="trash"===t.status;return(0,g.jsxs)(g.Fragment,{children:[e&&(0,g.jsx)(N.ConfirmDialogue,{...e,onClose:()=>a(void 0)}),(0,g.jsx)(m.Button,{text:i?(0,P.__)("Untrash","popup-maker"):(0,P.__)("Trash","popup-maker"),variant:"link",isDestructive:!0,isBusy:!!r,onClick:()=>i?s({id:t.id,status:"draft"}):o(t.id)})]})}},Ft={id:"delete",group:"trash",priority:12,render:({values:t})=>{const[e,a]=(0,p.useState)(),r=(0,h.useSelect)(t=>t(F.callToActionStore).isResolving("deleteCallToAction"),[]),{deleteCallToAction:o}=(0,h.useDispatch)(F.callToActionStore);return"trash"===t.status?(0,g.jsxs)(g.Fragment,{children:[e&&(0,g.jsx)(N.ConfirmDialogue,{...e,onClose:()=>a(void 0)}),(0,g.jsx)(m.Button,{text:(0,P.__)("Delete Permanently","popup-maker"),variant:"link",isDestructive:!0,isBusy:!!r,onClick:()=>a({message:(0,P.__)("Are you sure you want to premanently delete this call to action?","popup-maker"),callback:()=>{o(t.id,!0)},isDestructive:!0})})]}):null}},Lt=()=>{const t=document.getElementById("popup-maker-call-to-actions-root-container");t&&(Object.values(a).forEach(t=>{J(t)}),Object.values(o).forEach(t=>{ct(t)}),Object.values(s).forEach(t=>{K(t)}),Object.values(r).forEach(t=>{ot(t)}),(0,c.doAction)("popupMaker.ctaAdmin.init"),(0,p.createRoot)(t).render((0,g.jsx)(i.BrowserRouter,{children:(0,g.jsx)(i.QueryParamProvider,{adapter:i.ReactRouter6Adapter,children:(0,g.jsx)(h.RegistryProvider,{value:u.registry,children:(0,g.jsx)(jt,{})})})})))};l()(Lt),(window.popupMaker=window.popupMaker||{}).ctaAdmin=e})();
Save File
Cancel