(()=>{"use strict";const e=window.wp.data,t=window.lodash,r={previewDevice:"Desktop",uniqueIDs:{},stashes:{},uniquePanes:{},webFonts:{},imagePickerQuery:"",imagePickerSelection:0,imagePickerMultiSelection:[],imagePickerResults:{},imagePickerDownloadedImages:[]},n={*setPreviewDeviceType(e){if(!(yield{type:"SET_PREVIEW_DEVICE_TYPE_FOR_CORE",deviceType:e}))return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}},*setHeaderVisualBuilderOpenId(e=null){return{type:"SET_OPEN_HEADER_VISUAL_BUILDER_ID",clientId:e}},*setHeaderVisualBuilderSelectedId(e=null){return{type:"SET_SELECTED_HEADER_VISUAL_BUILDER_ID",clientId:e}},*setHeaderVisualBuilderOpenPosition(e="bottom"){return{type:"SET_OPEN_HEADER_VISUAL_BUILDER_POSITION",position:e}},*setOffCanvasOpenId(e=null){return{type:"SET_OPEN_OFF_CANVAS_ID",clientId:e}},*toggleEditorPanelOpened(e,t){return{type:"TOGGLE_EDITOR_PANEL_OPENED",panelName:e,defaultValue:t}},*switchEditorTabOpened(e,t){return{type:"SWITCH_EDITOR_TAB_OPENED",tabName:e,key:t}},addUniqueID:(e,t)=>({type:"ADD_UNIQUE_ID",uniqueID:e,clientID:t}),addStash:(e,t)=>({type:"ADD_STASH",key:e,stashContents:t}),addUniquePane:(e,t,r)=>({type:"ADD_UNIQUE_PANE",uniqueID:e,clientID:t,rootID:r}),addWebFont:(e,t)=>({type:"ADD_WEBFONT",font:e,frame:t}),setImagePickerQuery:e=>({type:"SET_IMAGE_PICKER_QUERY",query:e}),setImagePickerSelection:e=>({type:"SET_IMAGE_PICKER_SELECTION",index:e}),setImagePickerMultiSelection:e=>({type:"SET_IMAGE_PICKER_MULTI_SELECTION",selection:e}),setImagePickerResults:e=>({type:"SET_IMAGE_PICKER_RESULTS",results:e}),setImagePickerDownloadedImages:e=>({type:"SET_IMAGE_PICKER_DOWNLOADED_IMAGES",images:e})},i={SET_PREVIEW_DEVICE_TYPE_FOR_CORE:(0,e.createRegistryControl)((e=>function({deviceType:t}){const r=e.dispatch("core/edit-post");if(r)return r.__experimentalSetPreviewDeviceType(t),!0;const n=e.dispatch("core/edit-site");return!!n&&(n.__experimentalSetPreviewDeviceType(t),!0)}))},s=(0,e.createRegistrySelector)((e=>t=>{const r=e("core/editor");if(r&&r?.getDeviceType)return r.getDeviceType();const n=e("core/edit-post");if(n)return n.__experimentalGetPreviewDeviceType();const i=e("core/edit-site");return i?i.__experimentalGetPreviewDeviceType():t.previewDevice})),a=(0,e.createReduxStore)("kadenceblocks/data",{reducer(e=r,n){switch(n.type){case"SET_OPEN_HEADER_VISUAL_BUILDER_ID":return{...e,headerVisualBuilder:{...e.headerVisualBuilder,open:n.clientId}};case"SET_SELECTED_HEADER_VISUAL_BUILDER_ID":return{...e,headerVisualBuilder:{...e.headerVisualBuilder,selected:n.clientId}};case"SET_OPEN_HEADER_VISUAL_BUILDER_POSITION":return{...e,headerVisualBuilder:{...e.headerVisualBuilder,position:n.position}};case"SET_OPEN_OFF_CANVAS_ID":return{...e,offCanvas:{...e.offCanvas,open:n.clientId}};case"TOGGLE_EDITOR_PANEL_OPENED":const{panelName:r,defaultValue:i}=n,s=!0===e[r]||(0,t.get)(e,["editorPanels",r,"opened"],i);return{...e,editorPanels:{...e.editorPanels,[r]:{...e[r],opened:!s}}};case"SWITCH_EDITOR_TAB_OPENED":const{tabName:a,key:o}=n;return{...e,editorTabs:{...e.editorPanels,[a]:o}};case"SET_PREVIEW_DEVICE_TYPE":return{...e,previewDevice:n.deviceType};case"ADD_UNIQUE_ID":const u=e.uniqueIDs;return Object.assign(u,{[n.uniqueID]:n.clientID}),{...e,uniqueIDs:u};case"ADD_STASH":const c=e.stashes;return Object.assign(c,{[n.key]:n.stashContents}),{...e,stashes:c};case"ADD_UNIQUE_PANE":const E=e.uniquePanes;return E.hasOwnProperty(n.rootID)?Object.assign(E[n.rootID],{[n.uniqueID.toString()]:n.clientID}):(E[n.rootID]={},Object.assign(E[n.rootID],{[n.uniqueID.toString()]:n.clientID})),{...e,uniquePanes:E};case"ADD_WEBFONT":const l=e.webFonts;return l.hasOwnProperty(n.frame)?Object.assign(l[n.frame],{[n.font.toString()]:"loaded"}):(l[n.frame]={},Object.assign(l[n.frame],{[n.font.toString()]:"loaded"})),{...e,webFonts:l};case"SET_IMAGE_PICKER_QUERY":return{...e,imagePickerQuery:n.query};case"SET_IMAGE_PICKER_SELECTION":return{...e,imagePickerSelection:n.index};case"SET_IMAGE_PICKER_MULTI_SELECTION":return{...e,imagePickerMultiSelection:n.selection};case"SET_IMAGE_PICKER_RESULTS":return{...e,imagePickerResults:n.results};case"SET_IMAGE_PICKER_DOWNLOADED_IMAGES":return{...e,imagePickerDownloadedImages:n.images};default:return e}},actions:n,controls:i,selectors:{getPreviewDeviceType:s,getUniqueIDs(e){const{uniqueIDs:t}=e;return t},getStashes(e){const{stashes:t}=e;return t},getStash(e,t){const{stashes:r}=e;let n=null;return r.hasOwnProperty(t)&&(n=r[t]),n},isUniqueID(e,t){const{uniqueIDs:r}=e;let n=!0;return r.hasOwnProperty(t)&&(n=!1),n},isUniqueBlock(e,t,r){const{uniqueIDs:n}=e;let i=!1;return n.hasOwnProperty(t)&&n[t]===r&&(i=!0),i},isUniquePane(e,t,r){const{uniquePanes:n}=e;let i=!0;return n.hasOwnProperty(r)&&n[r].hasOwnProperty(t.toString())&&(i=!1),i},isUniquePaneBlock(e,t,r,n){const{uniquePanes:i}=e;let s=!1;return i.hasOwnProperty(n)&&i[n].hasOwnProperty(t.toString())&&i[n][t.toString()]===r&&(s=!0),s},isUniqueFont(e,t,r){const{webFonts:n}=e;let i=!0;return n.hasOwnProperty(r)&&n[r].hasOwnProperty(t.toString())&&(i=!1),i},getOpenHeaderVisualBuilderId:e=>(0,t.get)(e,["headerVisualBuilder","open"],null),getSelectedHeaderVisualBuilderId:e=>(0,t.get)(e,["headerVisualBuilder","selected"],null),getOpenHeaderVisualBuilderPosition:e=>(0,t.get)(e,["headerVisualBuilder","position"],"bottom"),getOpenOffCanvasId:e=>(0,t.get)(e,["offCanvas","open"],null),isEditorPanelOpened(e,r,n){const i=(0,t.get)(e,["editorPanels"],{});return!0===(0,t.get)(i,[r])||!0===(0,t.get)(i,[r,"opened"],n)},getOpenSidebarTabKey(e,r,n){const i=(0,t.get)(e,["editorTabs"],{});return(0,t.get)(i,[r],n)},getImagePickerQuery(e){const{imagePickerQuery:t}=e;return t},getImagePickerSelection(e){const{imagePickerSelection:t}=e;return t},getImagePickerMultiSelection(e){const{imagePickerMultiSelection:t}=e;return t},getImagePickerResults(e){const{imagePickerResults:t}=e;return t},getImagePickerDownloadedImages(e){const{imagePickerDownloadedImages:t}=e;return t}}});(0,e.register)(a),(this.kadence=this.kadence||{})["extension-stores"]={}})();