(()=>{var e={2485:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=o.apply(null,n);a&&e.push(a)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var l in n)r.call(n,l)&&n[l]&&e.push(l);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React;var t=n.n(e);const r=window.wp.element,o=window.wp.data,i=window.wp.i18n,a=window.wp.components;window.kadence.icons;const l=window.kadence.helpers,s=window.lodash,c=window.wp.primitives,d=(0,r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(c.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));function u({isVisible:t,setIsVisible:n}){return(0,e.createElement)(a.Button,{className:"kb-header-visual-builder-modal-close","aria-label":(0,i.__)("Close Modal","kadence-blocks"),onClick:()=>{n(!t)},variant:"secondary",icon:d,iconSize:18},(0,i.__)("Hide","kadence-blocks"))}const f=window.ReactDOM,v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function g(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function p(e){return"nodeType"in e}function h(e){var t,n;return e?g(e)?e:p(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function m(e){const{Document:t}=h(e);return e instanceof t}function b(e){return!g(e)&&e instanceof h(e).HTMLElement}function w(e){return e instanceof h(e).SVGElement}function y(e){return e?g(e)?e.document:p(e)?m(e)?e:b(e)||w(e)?e.ownerDocument:document:document:document}const k=v?e.useLayoutEffect:e.useEffect;function E(t){const n=(0,e.useRef)(t);return k((()=>{n.current=t})),(0,e.useCallback)((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}function x(t,n){void 0===n&&(n=[t]);const r=(0,e.useRef)(t);return k((()=>{r.current!==t&&(r.current=t)}),n),r}function C(t,n){const r=(0,e.useRef)();return(0,e.useMemo)((()=>{const e=t(r.current);return r.current=e,e}),[...n])}function D(t){const n=E(t),r=(0,e.useRef)(null),o=(0,e.useCallback)((e=>{e!==r.current&&(null==n||n(e,r.current)),r.current=e}),[]);return[r,o]}function I(t){const n=(0,e.useRef)();return(0,e.useEffect)((()=>{n.current=t}),[t]),n.current}let R={};function S(t,n){return(0,e.useMemo)((()=>{if(n)return n;const e=null==R[t]?0:R[t]+1;return R[t]=e,t+"-"+e}),[t,n])}function N(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const B=N(1),M=N(-1);function O(e){if(!e)return!1;const{KeyboardEvent:t}=h(e.target);return t&&e instanceof t}function T(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=h(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const _=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[_.Translate.toString(e),_.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),L="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function A(e){return e.matches(L)?e:e.querySelector(L)}const P={display:"none"};function z(e){let{id:n,value:r}=e;return t().createElement("div",{id:n,style:P},r)}function F(e){let{id:n,announcement:r,ariaLiveType:o="assertive"}=e;return t().createElement("div",{id:n,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":o,"aria-atomic":!0},r)}const j=(0,e.createContext)(null),Y={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},V={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function X(n){let{announcements:r=V,container:o,hiddenTextDescribedById:i,screenReaderInstructions:a=Y}=n;const{announce:l,announcement:s}=function(){const[t,n]=(0,e.useState)("");return{announce:(0,e.useCallback)((e=>{null!=e&&n(e)}),[]),announcement:t}}(),c=S("DndLiveRegion"),[d,u]=(0,e.useState)(!1);if((0,e.useEffect)((()=>{u(!0)}),[]),function(t){const n=(0,e.useContext)(j);(0,e.useEffect)((()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(t)}),[t,n])}((0,e.useMemo)((()=>({onDragStart(e){let{active:t}=e;l(r.onDragStart({active:t}))},onDragMove(e){let{active:t,over:n}=e;r.onDragMove&&l(r.onDragMove({active:t,over:n}))},onDragOver(e){let{active:t,over:n}=e;l(r.onDragOver({active:t,over:n}))},onDragEnd(e){let{active:t,over:n}=e;l(r.onDragEnd({active:t,over:n}))},onDragCancel(e){let{active:t,over:n}=e;l(r.onDragCancel({active:t,over:n}))}})),[l,r])),!d)return null;const v=t().createElement(t().Fragment,null,t().createElement(z,{id:i,value:a.draggable}),t().createElement(F,{id:c,announcement:s}));return o?(0,f.createPortal)(v,o):v}var H;function U(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(H||(H={}));const K=Object.freeze({x:0,y:0});function W(e,t){const n=T(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function $(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function J(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const q=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=J(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort($)};function G(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:K}function Q(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const Z=Q(1);function ee(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const te={ignoreTransform:!1};function ne(e,t){void 0===t&&(t=te);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=h(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=ee(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,s=e.left-a-(1-o)*parseFloat(n),c=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:s+d,bottom:c+u,left:s}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:s}}function re(e){return ne(e,{ignoreTransform:!0})}function oe(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(m(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!b(o)||w(o))return n;if(n.includes(o))return n;const i=h(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=h(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=h(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function ie(e){const[t]=oe(e,1);return null!=t?t:null}function ae(e){return v&&e?g(e)?e:p(e)?m(e)||e===y(e).scrollingElement?window:b(e)?e:null:null:null}function le(e){return g(e)?e.scrollX:e.scrollLeft}function se(e){return g(e)?e.scrollY:e.scrollTop}function ce(e){return{x:le(e),y:se(e)}}var de;function ue(e){return!(!v||!e)&&e===document.scrollingElement}function fe(e){const t={x:0,y:0},n=ue(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(de||(de={}));const ve={x:.2,y:.2};function ge(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=ve);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=fe(e),v={x:0,y:0},g={x:0,y:0},p=t.height*o.y,h=t.width*o.x;return!c&&i<=t.top+p?(v.y=de.Backward,g.y=r*Math.abs((t.top+p-i)/p)):!d&&s>=t.bottom-p&&(v.y=de.Forward,g.y=r*Math.abs((t.bottom-p-s)/p)),!f&&l>=t.right-h?(v.x=de.Forward,g.x=r*Math.abs((t.right-h-l)/h)):!u&&a<=t.left+h&&(v.x=de.Backward,g.x=r*Math.abs((t.left+h-a)/h)),{direction:v,speed:g}}function pe(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function he(e){return e.reduce(((e,t)=>B(e,ce(t))),K)}function me(e,t){if(void 0===t&&(t=ne),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);ie(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const be=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+le(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+se(t)),0)}]];class we{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=oe(t),r=he(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of be)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ye{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ke(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Ee,xe,Ce;function De(e){e.preventDefault()}function Ie(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Ee||(Ee={})),(Ce=xe||(xe={})).Space="Space",Ce.Down="ArrowDown",Ce.Right="ArrowRight",Ce.Left="ArrowLeft",Ce.Up="ArrowUp",Ce.Esc="Escape",Ce.Enter="Enter";const Re={start:[xe.Space,xe.Enter],cancel:[xe.Esc],end:[xe.Space,xe.Enter]},Se=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case xe.Right:return{...n,x:n.x+25};case xe.Left:return{...n,x:n.x-25};case xe.Down:return{...n,y:n.y+25};case xe.Up:return{...n,y:n.y-25}}};class Ne{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ye(y(t)),this.windowListeners=new ye(h(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ee.Resize,this.handleCancel),this.windowListeners.add(Ee.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(Ee.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&me(n),t(K)}handleKeyDown(e){if(O(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Re,coordinateGetter:i=Se,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:K;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=M(d,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:s,isBottom:c,maxScroll:u,minScroll:f}=fe(n),v=pe(n),g={x:Math.min(o===xe.Right?v.right-v.width/2:v.right,Math.max(o===xe.Right?v.left:v.left+v.width/2,d.x)),y:Math.min(o===xe.Down?v.bottom-v.height/2:v.bottom,Math.max(o===xe.Down?v.top:v.top+v.height/2,d.y))},p=o===xe.Right&&!l||o===xe.Left&&!s,h=o===xe.Down&&!c||o===xe.Up&&!i;if(p&&g.x!==d.x){const e=n.scrollLeft+t.x,i=o===xe.Right&&e<=u.x||o===xe.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===xe.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(h&&g.y!==d.y){const e=n.scrollTop+t.y,i=o===xe.Down&&e<=u.y||o===xe.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===xe.Down?n.scrollTop-u.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,B(M(d,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Be(e){return Boolean(e&&"distance"in e)}function Me(e){return Boolean(e&&"delay"in e)}Ne.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Re,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class Oe{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=h(e);return e instanceof t?e:y(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=y(i),this.documentListeners=new ye(this.document),this.listeners=new ye(n),this.windowListeners=new ye(h(i)),this.initialCoordinates=null!=(r=T(o))?r:K,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Ee.Resize,this.handleCancel),this.windowListeners.add(Ee.DragStart,De),this.windowListeners.add(Ee.VisibilityChange,this.handleCancel),this.windowListeners.add(Ee.ContextMenu,De),this.documentListeners.add(Ee.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Me(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(Be(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Ee.Click,Ie,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ee.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=T(e))?t:K,s=M(r,l);if(!n&&a){if(Be(a)){if(null!=a.tolerance&&ke(s,a.tolerance))return this.handleCancel();if(ke(s,a.distance))return this.handleStart()}return Me(a)&&ke(s,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===xe.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Te={move:{name:"pointermove"},end:{name:"pointerup"}};class _e extends Oe{constructor(e){const{event:t}=e,n=y(t.target);super(e,Te,n)}}_e.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const Le={move:{name:"mousemove"},end:{name:"mouseup"}};var Ae;!function(e){e[e.RightClick=2]="RightClick"}(Ae||(Ae={})),class extends Oe{constructor(e){super(e,Le,y(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Ae.RightClick&&(null==r||r({event:n}),!0)}}];const Pe={move:{name:"touchmove"},end:{name:"touchend"}};var ze,Fe;(class extends Oe{constructor(e){super(e,Pe)}static setup(){return window.addEventListener(Pe.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Pe.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(ze||(ze={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Fe||(Fe={}));const je={x:{[de.Backward]:!1,[de.Forward]:!1},y:{[de.Backward]:!1,[de.Forward]:!1}};var Ye,Ve;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Ye||(Ye={})),function(e){e.Optimized="optimized"}(Ve||(Ve={}));const Xe=new Map;function He(e,t){return C((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Ue(t){let{callback:n,disabled:r}=t;const o=E(n),i=(0,e.useMemo)((()=>{if(r||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[r]);return(0,e.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}function Ke(e){return new we(ne(e),e)}function We(t,n,r){void 0===n&&(n=Ke);const[o,i]=(0,e.useReducer)((function(e){if(!t)return null;var o;if(!1===t.isConnected)return null!=(o=null!=e?e:r)?o:null;const i=n(t);return JSON.stringify(e)===JSON.stringify(i)?e:i}),null),a=function(t){let{callback:n,disabled:r}=t;const o=E(n),i=(0,e.useMemo)((()=>{if(r||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,r]);return(0,e.useEffect)((()=>()=>null==i?void 0:i.disconnect()),[i]),i}({callback(e){if(t)for(const n of e){const{type:e,target:r}=n;if("childList"===e&&r instanceof HTMLElement&&r.contains(t)){i();break}}}}),l=Ue({callback:i});return k((()=>{i(),t?(null==l||l.observe(t),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==a||a.disconnect())}),[t]),o}const $e=[];function Je(t,n){void 0===n&&(n=[]);const r=(0,e.useRef)(null);return(0,e.useEffect)((()=>{r.current=null}),n),(0,e.useEffect)((()=>{const e=t!==K;e&&!r.current&&(r.current=t),!e&&r.current&&(r.current=null)}),[t]),r.current?M(t,r.current):K}function qe(t){return(0,e.useMemo)((()=>t?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(t):null),[t])}const Ge=[];function Qe(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return b(t)?t:e}const Ze=[{sensor:_e,options:{}},{sensor:Ne,options:{}}],et={current:{}},tt={draggable:{measure:re},droppable:{measure:re,strategy:Ye.WhileDragging,frequency:Ve.Optimized},dragOverlay:{measure:ne}};class nt extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const rt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new nt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:U},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:tt,measureDroppableContainers:U,windowRect:null,measuringScheduled:!1},ot={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:U,draggableNodes:new Map,over:null,measureDroppableContainers:U},it=(0,e.createContext)(ot),at=(0,e.createContext)(rt);function lt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new nt}}}function st(e,t){switch(t.type){case H.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case H.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case H.DragEnd:case H.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case H.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new nt(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case H.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new nt(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case H.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new nt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function ct(t){let{disabled:n}=t;const{active:r,activatorEvent:o,draggableNodes:i}=(0,e.useContext)(it),a=I(o),l=I(null==r?void 0:r.id);return(0,e.useEffect)((()=>{if(!n&&!o&&a&&null!=l){if(!O(a))return;if(document.activeElement===a.target)return;const e=i.get(l);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=A(e);if(t){t.focus();break}}}))}}),[o,n,i,l,a]),null}function dt(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}const ut=(0,e.createContext)({...K,scaleX:1,scaleY:1});var ft;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(ft||(ft={}));const vt=(0,e.memo)((function(n){var r,o,i,a;let{id:l,accessibility:s,autoScroll:c=!0,children:d,sensors:u=Ze,collisionDetection:g=q,measuring:p,modifiers:m,...w}=n;const y=(0,e.useReducer)(st,void 0,lt),[E,R]=y,[N,M]=function(){const[t]=(0,e.useState)((()=>new Set)),n=(0,e.useCallback)((e=>(t.add(e),()=>t.delete(e))),[t]);return[(0,e.useCallback)((e=>{let{type:n,event:r}=e;t.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[t]),n]}(),[O,_]=(0,e.useState)(ft.Uninitialized),L=O===ft.Initialized,{draggable:{active:A,nodes:P,translate:z},droppable:{containers:F}}=E,Y=A?P.get(A):null,V=(0,e.useRef)({initial:null,translated:null}),U=(0,e.useMemo)((()=>{var e;return null!=A?{id:A,data:null!=(e=null==Y?void 0:Y.data)?e:et,rect:V}:null}),[A,Y]),W=(0,e.useRef)(null),[$,J]=(0,e.useState)(null),[Q,ee]=(0,e.useState)(null),te=x(w,Object.values(w)),re=S("DndDescribedBy",l),le=(0,e.useMemo)((()=>F.getEnabled()),[F]),se=(fe=p,(0,e.useMemo)((()=>({draggable:{...tt.draggable,...null==fe?void 0:fe.draggable},droppable:{...tt.droppable,...null==fe?void 0:fe.droppable},dragOverlay:{...tt.dragOverlay,...null==fe?void 0:fe.dragOverlay}})),[null==fe?void 0:fe.draggable,null==fe?void 0:fe.droppable,null==fe?void 0:fe.dragOverlay]));var fe;const{droppableRects:ve,measureDroppableContainers:pe,measuringScheduled:me}=function(t,n){let{dragging:r,dependencies:o,config:i}=n;const[a,l]=(0,e.useState)(null),{frequency:s,measure:c,strategy:d}=i,u=(0,e.useRef)(t),f=function(){switch(d){case Ye.Always:return!1;case Ye.BeforeDragging:return r;default:return!r}}(),v=x(f),g=(0,e.useCallback)((function(e){void 0===e&&(e=[]),v.current||l((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[v]),p=(0,e.useRef)(null),h=C((e=>{if(f&&!r)return Xe;if(!e||e===Xe||u.current!==t||null!=a){const e=new Map;for(let n of t){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){e.set(n.id,n.rect.current);continue}const t=n.node.current,r=t?new we(c(t),t):null;n.rect.current=r,r&&e.set(n.id,r)}return e}return e}),[t,a,r,f,c]);return(0,e.useEffect)((()=>{u.current=t}),[t]),(0,e.useEffect)((()=>{f||g()}),[r,f]),(0,e.useEffect)((()=>{a&&a.length>0&&l(null)}),[JSON.stringify(a)]),(0,e.useEffect)((()=>{f||"number"!=typeof s||null!==p.current||(p.current=setTimeout((()=>{g(),p.current=null}),s))}),[s,f,g,...o]),{droppableRects:h,measureDroppableContainers:g,measuringScheduled:null!=a}}(le,{dragging:L,dependencies:[z.x,z.y],config:se.droppable}),be=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return C((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(P,A),ye=(0,e.useMemo)((()=>Q?T(Q):null),[Q]),ke=function(){const e=!1===(null==$?void 0:$.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,n=L&&!e&&!t;return"object"==typeof c?{...c,enabled:n}:{enabled:n}}(),Ee=function(e,t){return He(e,t)}(be,se.draggable.measure);!function(t){let{activeNode:n,measure:r,initialRect:o,config:i=!0}=t;const a=(0,e.useRef)(!1),{x:l,y:s}="boolean"==typeof i?{x:i,y:i}:i;k((()=>{if(!l&&!s||!n)return void(a.current=!1);if(a.current||!o)return;const e=null==n?void 0:n.node.current;if(!e||!1===e.isConnected)return;const t=G(r(e),o);if(l||(t.x=0),s||(t.y=0),a.current=!0,Math.abs(t.x)>0||Math.abs(t.y)>0){const n=ie(e);n&&n.scrollBy({top:t.y,left:t.x})}}),[n,l,s,o,r])}({activeNode:A?P.get(A):null,config:ke.layoutShiftCompensation,initialRect:Ee,measure:se.draggable.measure});const xe=We(be,se.draggable.measure,Ee),Ce=We(be?be.parentElement:null),De=(0,e.useRef)({activatorEvent:null,active:null,activeNode:be,collisionRect:null,collisions:null,droppableRects:ve,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ie=F.getNodeFor(null==(r=De.current.over)?void 0:r.id),Re=function(t){let{measure:n}=t;const[r,o]=(0,e.useState)(null),i=Ue({callback:(0,e.useCallback)((e=>{for(const{target:t}of e)if(b(t)){o((e=>{const r=n(t);return e?{...e,width:r.width,height:r.height}:r}));break}}),[n])}),a=(0,e.useCallback)((e=>{const t=Qe(e);null==i||i.disconnect(),t&&(null==i||i.observe(t)),o(t?n(t):null)}),[n,i]),[l,s]=D(a);return(0,e.useMemo)((()=>({nodeRef:l,rect:r,setRef:s})),[r,l,s])}({measure:se.dragOverlay.measure}),Se=null!=(o=Re.nodeRef.current)?o:be,Ne=L?null!=(i=Re.rect)?i:xe:null,Be=Boolean(Re.nodeRef.current&&Re.rect),Me=G(Oe=Be?null:xe,He(Oe));var Oe;const Te=qe(Se?h(Se):null),_e=function(t){const n=(0,e.useRef)(t),r=C((e=>t?e&&e!==$e&&t&&n.current&&t.parentNode===n.current.parentNode?e:oe(t):$e),[t]);return(0,e.useEffect)((()=>{n.current=t}),[t]),r}(L?null!=Ie?Ie:be:null),Le=function(t,n){void 0===n&&(n=ne);const[r]=t,o=qe(r?h(r):null),[i,a]=(0,e.useReducer)((function(){return t.length?t.map((e=>ue(e)?o:new we(n(e),e))):Ge}),Ge),l=Ue({callback:a});return t.length>0&&i===Ge&&a(),k((()=>{t.length?t.forEach((e=>null==l?void 0:l.observe(e))):(null==l||l.disconnect(),a())}),[t]),i}(_e),Ae=dt(m,{transform:{x:z.x-Me.x,y:z.y-Me.y,scaleX:1,scaleY:1},activatorEvent:Q,active:U,activeNodeRect:xe,containerNodeRect:Ce,draggingNodeRect:Ne,over:De.current.over,overlayNodeRect:Re.rect,scrollableAncestors:_e,scrollableAncestorRects:Le,windowRect:Te}),Pe=ye?B(ye,z):null,Ve=function(t){const[n,r]=(0,e.useState)(null),o=(0,e.useRef)(t),i=(0,e.useCallback)((e=>{const t=ae(e.target);t&&r((e=>e?(e.set(t,ce(t)),new Map(e)):null))}),[]);return(0,e.useEffect)((()=>{const e=o.current;if(t!==e){n(e);const a=t.map((e=>{const t=ae(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,ce(t)]):null})).filter((e=>null!=e));r(a.length?new Map(a):null),o.current=t}return()=>{n(t),n(e)};function n(e){e.forEach((e=>{const t=ae(e);null==t||t.removeEventListener("scroll",i)}))}}),[i,t]),(0,e.useMemo)((()=>t.length?n?Array.from(n.values()).reduce(((e,t)=>B(e,t)),K):he(t):K),[t,n])}(_e),Ke=Je(Ve),nt=Je(Ve,[xe]),rt=B(Ae,Ke),ot=Ne?Z(Ne,Ae):null,vt=U&&ot?g({active:U,collisionRect:ot,droppableRects:ve,droppableContainers:le,pointerCoordinates:Pe}):null,gt=function(e){if(!e||0===e.length)return null;const[t]=e;return t.id}(vt),[pt,ht]=(0,e.useState)(null),mt=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Be?Ae:B(Ae,nt),null!=(a=null==pt?void 0:pt.rect)?a:null,xe),bt=(0,e.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==W.current)return;const o=P.get(W.current);if(!o)return;const i=e.nativeEvent,a=new n({active:W.current,activeNode:o,event:i,options:r,context:De,onStart(e){const t=W.current;if(null==t)return;const n=P.get(t);if(!n)return;const{onDragStart:r}=te.current,o={active:{id:t,data:n.data,rect:V}};(0,f.unstable_batchedUpdates)((()=>{null==r||r(o),_(ft.Initializing),R({type:H.DragStart,initialCoordinates:e,active:t}),N({type:"onDragStart",event:o})}))},onMove(e){R({type:H.DragMove,coordinates:e})},onEnd:l(H.DragEnd),onCancel:l(H.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=De.current;let a=null;if(t&&o){const{cancelDrop:l}=te.current;a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===H.DragEnd&&"function"==typeof l&&await Promise.resolve(l(a))&&(e=H.DragCancel)}W.current=null,(0,f.unstable_batchedUpdates)((()=>{R({type:e}),_(ft.Uninitialized),ht(null),J(null),ee(null);const t=e===H.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=te.current[t];null==e||e(a),N({type:t,event:a})}}))}}(0,f.unstable_batchedUpdates)((()=>{J(a),ee(e.nativeEvent)}))}),[P]),wt=(0,e.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=P.get(r);if(null!==W.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},W.current=r,bt(n,t))}),[P,bt]),yt=function(t,n){return(0,e.useMemo)((()=>t.reduce(((e,t)=>{const{sensor:r}=t;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:n(e.handler,t)})))]}),[])),[t,n])}(u,wt);!function(t){(0,e.useEffect)((()=>{if(!v)return;const e=t.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const t of e)null==t||t()}}),t.map((e=>{let{sensor:t}=e;return t})))}(u),k((()=>{xe&&O===ft.Initializing&&_(ft.Initialized)}),[xe,O]),(0,e.useEffect)((()=>{const{onDragMove:e}=te.current,{active:t,activatorEvent:n,collisions:r,over:o}=De.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:rt.x,y:rt.y},over:o};(0,f.unstable_batchedUpdates)((()=>{null==e||e(i),N({type:"onDragMove",event:i})}))}),[rt.x,rt.y]),(0,e.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=De.current;if(!e||null==W.current||!t||!o)return;const{onDragOver:i}=te.current,a=r.get(gt),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};(0,f.unstable_batchedUpdates)((()=>{ht(l),null==i||i(s),N({type:"onDragOver",event:s})}))}),[gt]),k((()=>{De.current={activatorEvent:Q,active:U,activeNode:be,collisionRect:ot,collisions:vt,droppableRects:ve,draggableNodes:P,draggingNode:Se,draggingNodeRect:Ne,droppableContainers:F,over:pt,scrollableAncestors:_e,scrollAdjustedTranslate:rt},V.current={initial:Ne,translated:ot}}),[U,be,vt,ot,P,Se,Ne,ve,F,pt,_e,rt]),function(t){let{acceleration:n,activator:r=ze.Pointer,canScroll:o,draggingRect:i,enabled:a,interval:l=5,order:s=Fe.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:v}=t;const g=function(e){let{delta:t,disabled:n}=e;const r=I(t);return C((e=>{if(n||!r||!e)return je;const o=Math.sign(t.x-r.x),i=Math.sign(t.y-r.y);return{x:{[de.Backward]:e.x[de.Backward]||-1===o,[de.Forward]:e.x[de.Forward]||1===o},y:{[de.Backward]:e.y[de.Backward]||-1===i,[de.Forward]:e.y[de.Forward]||1===i}}}),[n,t,r])}({delta:f,disabled:!a}),[p,h]=function(){const t=(0,e.useRef)(null);return[(0,e.useCallback)(((e,n)=>{t.current=setInterval(e,n)}),[]),(0,e.useCallback)((()=>{null!==t.current&&(clearInterval(t.current),t.current=null)}),[])]}(),m=(0,e.useRef)({x:0,y:0}),b=(0,e.useRef)({x:0,y:0}),w=(0,e.useMemo)((()=>{switch(r){case ze.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ze.DraggableRect:return i}}),[r,i,c]),y=(0,e.useRef)(null),k=(0,e.useCallback)((()=>{const e=y.current;if(!e)return;const t=m.current.x*b.current.x,n=m.current.y*b.current.y;e.scrollBy(t,n)}),[]),E=(0,e.useMemo)((()=>s===Fe.TreeOrder?[...d].reverse():d),[s,d]);(0,e.useEffect)((()=>{if(a&&d.length&&w){for(const e of E){if(!1===(null==o?void 0:o(e)))continue;const t=d.indexOf(e),r=u[t];if(!r)continue;const{direction:i,speed:a}=ge(e,r,w,n,v);for(const e of["x","y"])g[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return h(),y.current=e,p(k,l),m.current=a,void(b.current=i)}m.current={x:0,y:0},b.current={x:0,y:0},h()}else h()}),[n,k,o,h,a,l,JSON.stringify(w),JSON.stringify(g),p,d,E,u,JSON.stringify(v)])}({...ke,delta:z,draggingRect:ot,pointerCoordinates:Pe,scrollableAncestors:_e,scrollableAncestorRects:Le});const kt=(0,e.useMemo)((()=>({active:U,activeNode:be,activeNodeRect:xe,activatorEvent:Q,collisions:vt,containerNodeRect:Ce,dragOverlay:Re,draggableNodes:P,droppableContainers:F,droppableRects:ve,over:pt,measureDroppableContainers:pe,scrollableAncestors:_e,scrollableAncestorRects:Le,measuringConfiguration:se,measuringScheduled:me,windowRect:Te})),[U,be,xe,Q,vt,Ce,Re,P,F,ve,pt,pe,_e,Le,se,me,Te]),Et=(0,e.useMemo)((()=>({activatorEvent:Q,activators:yt,active:U,activeNodeRect:xe,ariaDescribedById:{draggable:re},dispatch:R,draggableNodes:P,over:pt,measureDroppableContainers:pe})),[Q,yt,U,xe,R,re,P,pt,pe]);return t().createElement(j.Provider,{value:M},t().createElement(it.Provider,{value:Et},t().createElement(at.Provider,{value:kt},t().createElement(ut.Provider,{value:mt},d)),t().createElement(ct,{disabled:!1===(null==s?void 0:s.restoreFocus)})),t().createElement(X,{...s,hiddenTextDescribedById:re}))})),gt=(0,e.createContext)(null),pt="button";function ht(){return(0,e.useContext)(at)}const mt={timeout:25};function bt(t){let{data:n,disabled:r=!1,id:o,resizeObserverConfig:i}=t;const a=S("Droppable"),{active:l,dispatch:s,over:c,measureDroppableContainers:d}=(0,e.useContext)(it),u=(0,e.useRef)({disabled:r}),f=(0,e.useRef)(!1),v=(0,e.useRef)(null),g=(0,e.useRef)(null),{disabled:p,updateMeasurementsFor:h,timeout:m}={...mt,...i},b=x(null!=h?h:o),w=Ue({callback:(0,e.useCallback)((()=>{f.current?(null!=g.current&&clearTimeout(g.current),g.current=setTimeout((()=>{d(Array.isArray(b.current)?b.current:[b.current]),g.current=null}),m)):f.current=!0}),[m]),disabled:p||!l}),y=(0,e.useCallback)(((e,t)=>{w&&(t&&(w.unobserve(t),f.current=!1),e&&w.observe(e))}),[w]),[E,C]=D(y),I=x(n);return(0,e.useEffect)((()=>{w&&E.current&&(w.disconnect(),f.current=!1,w.observe(E.current))}),[E,w]),k((()=>(s({type:H.RegisterDroppable,element:{id:o,key:a,disabled:r,node:E,rect:v,data:I}}),()=>s({type:H.UnregisterDroppable,key:a,id:o}))),[o]),(0,e.useEffect)((()=>{r!==u.current.disabled&&(s({type:H.SetDroppableDisabled,id:o,key:a,disabled:r}),u.current.disabled=r)}),[o,a,r,s]),{active:l,rect:v,isOver:(null==c?void 0:c.id)===o,node:E,over:c,setNodeRef:C}}function wt(n){let{animation:r,children:o}=n;const[i,a]=(0,e.useState)(null),[l,s]=(0,e.useState)(null),c=I(o);return o||i||!c||a(c),k((()=>{if(!l)return;const e=null==i?void 0:i.key,t=null==i?void 0:i.props.id;null!=e&&null!=t?Promise.resolve(r(t,l)).then((()=>{a(null)})):a(null)}),[r,i,l]),t().createElement(t().Fragment,null,o,i?(0,e.cloneElement)(i,{ref:s}):null)}const yt={x:0,y:0,scaleX:1,scaleY:1};function kt(e){let{children:n}=e;return t().createElement(it.Provider,{value:ot},t().createElement(ut.Provider,{value:yt},n))}const Et={position:"fixed",touchAction:"none"},xt=e=>O(e)?"transform 250ms ease":void 0,Ct=(0,e.forwardRef)(((e,n)=>{let{as:r,activatorEvent:o,adjustScale:i,children:a,className:l,rect:s,style:c,transform:d,transition:u=xt}=e;if(!s)return null;const f=i?d:{...d,scaleX:1,scaleY:1},v={...Et,width:s.width,height:s.height,top:s.top,left:s.left,transform:_.Transform.toString(f),transformOrigin:i&&o?W(o,s):void 0,transition:"function"==typeof u?u(o):u,...c};return t().createElement(r,{className:l,style:v,ref:n},a)})),Dt=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:a}=e;if(null!=i&&i.active)for(const[e,t]of Object.entries(i.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=i&&i.dragOverlay)for(const[e,t]of Object.entries(i.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=a&&a.active&&n.node.classList.add(a.active),null!=a&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=a&&a.active&&n.node.classList.remove(a.active)}},It={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:_.Transform.toString(t)},{transform:_.Transform.toString(n)}]},sideEffects:Dt({styles:{active:{opacity:"0"}}})};let Rt=0;function St(t){return(0,e.useMemo)((()=>{if(null!=t)return Rt++,Rt}),[t])}const Nt=t().memo((n=>{let{adjustScale:r=!1,children:o,dropAnimation:i,style:a,transition:l,modifiers:s,wrapperElement:c="div",className:d,zIndex:u=999}=n;const{activatorEvent:f,active:v,activeNodeRect:g,containerNodeRect:p,draggableNodes:m,droppableContainers:b,dragOverlay:w,over:y,measuringConfiguration:k,scrollableAncestors:x,scrollableAncestorRects:C,windowRect:D}=ht(),I=(0,e.useContext)(ut),R=St(null==v?void 0:v.id),S=dt(s,{activatorEvent:f,active:v,activeNodeRect:g,containerNodeRect:p,draggingNodeRect:w.rect,over:y,overlayNodeRect:w.rect,scrollableAncestors:x,scrollableAncestorRects:C,transform:I,windowRect:D}),N=He(g),B=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return E(((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const l=a.node.current;if(!l)return;const s=Qe(i);if(!s)return;const{transform:c}=h(i).getComputedStyle(i),d=ee(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...It,...e};return e=>{let{active:i,dragOverlay:a,transform:l,...s}=e;if(!t)return;const c=a.rect.left-i.rect.left,d=a.rect.top-i.rect.top,u={scaleX:1!==l.scaleX?i.rect.width*l.scaleX/a.rect.width:1,scaleY:1!==l.scaleY?i.rect.height*l.scaleY/a.rect.height:1},f={x:l.x-c,y:l.y-d,...u},v=o({...s,active:i,dragOverlay:a,transform:{initial:l,final:f}}),[g]=v,p=v[v.length-1];if(JSON.stringify(g)===JSON.stringify(p))return;const h=null==r?void 0:r({active:i,dragOverlay:a,...s}),m=a.node.animate(v,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{m.onfinish=()=>{null==h||h(),e()}}))}}(t);return me(l,o.draggable.measure),u({active:{id:e,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(s)},droppableContainers:r,measuringConfiguration:o,transform:d})}))}({config:i,draggableNodes:m,droppableContainers:b,measuringConfiguration:k}),M=N?w.setRef:void 0;return t().createElement(kt,null,t().createElement(wt,{animation:B},v&&R?t().createElement(Ct,{key:R,id:v.id,ref:M,as:c,activatorEvent:f,adjustScale:r,className:d,transition:l,rect:N,style:{zIndex:u,...a},transform:S},o):null))}));function Bt({clientId:t}){const{selectedBlockClientId:n}=(0,o.useSelect)((e=>{const{getSelectedBlockClientId:t}=e("core/block-editor");return{selectedBlockClientId:t()}}));return(0,e.createElement)(a.Button,{className:"block-select",isPressed:n===t,icon:"admin-generic",iconSize:14,onClick:()=>{wp.data.dispatch("core/block-editor").selectBlock(t)}})}const Mt=window.wp.blockEditor;var Ot=n(2485),Tt=n.n(Ot);function _t({position:t,clientId:n,showMidColumns:r=!1}){const o=Tt()({"add-item":"off-canvas"!==t,[`add-item-${t}`]:!0,"add-item-has-mid-columns":r});function l({...n}){const{onToggle:r,disabled:l,isOpen:s,blockTitle:c,hasSingleBlockType:d}=n;return(0,e.createElement)(a.Button,{icon:"plus",disabled:l,onClick:r,className:o},"off-canvas"===t?(0,i.__)("Add Block","kadence-blocks"):"")}return(0,e.createElement)(Mt.Inserter,{renderToggle:t=>(0,e.createElement)(l,{...t}),rootClientId:n,position:"top center",isAppender:!0,__experimentalIsQuick:!0})}function Lt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function At(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function Pt(e){return null!==e&&e>=0}const zt={scaleX:1,scaleY:1},Ft=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:a}=e;const l=null!=(t=n[o])?t:r;if(!l)return null;const s=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r&&(o||i)?n<t?o?r.left-(o.left+o.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(o.left+o.width):0}(n,a,o);if(a===o){const e=n[i];return e?{x:o<i?e.left+e.width-(l.left+l.width):e.left-l.left,y:0,...zt}:null}return a>o&&a<=i?{x:-l.width-s,y:0,...zt}:a<o&&a>=i?{x:l.width+s,y:0,...zt}:{x:0,y:0,...zt}},jt=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Lt(t,r,n),a=t[o],l=i[o];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},Yt={scaleX:1,scaleY:1},Vt=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=null!=(t=i[n])?t:r;if(!l)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(l.top+l.height):e.top-l.top,...Yt}:null}const s=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}(i,o,n);return o>n&&o<=a?{x:0,y:-l.height-s,...Yt}:o<n&&o>=a?{x:0,y:l.height+s,...Yt}:{x:0,y:0,...Yt}},Xt="Sortable",Ht=t().createContext({activeIndex:-1,containerId:Xt,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:jt,disabled:{draggable:!1,droppable:!1}});function Ut(n){let{children:r,id:o,items:i,strategy:a=jt,disabled:l=!1}=n;const{active:s,dragOverlay:c,droppableRects:d,over:u,measureDroppableContainers:f}=ht(),v=S(Xt,o),g=Boolean(null!==c.rect),p=(0,e.useMemo)((()=>i.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[i]),h=null!=s,m=s?p.indexOf(s.id):-1,b=u?p.indexOf(u.id):-1,w=(0,e.useRef)(p),y=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(p,w.current),E=-1!==b&&-1===m||y,x=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(l);k((()=>{y&&h&&f(p)}),[y,p,h,f]),(0,e.useEffect)((()=>{w.current=p}),[p]);const C=(0,e.useMemo)((()=>({activeIndex:m,containerId:v,disabled:x,disableTransforms:E,items:p,overIndex:b,useDragOverlay:g,sortedRects:At(p,d),strategy:a})),[m,v,x.draggable,x.droppable,E,p,b,d,g,a]);return t().createElement(Ht.Provider,{value:C},r)}const Kt=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Lt(n,r,o).indexOf(t)},Wt=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:s,transition:c}=e;return!(!c||!r||l!==i&&o===a||!n&&(a===o||t!==s))},$t={duration:200,easing:"ease"},Jt="transform",qt=_.Transition.toString({property:Jt,duration:0,easing:"linear"}),Gt={roleDescription:"sortable"};function Qt(t){let{animateLayoutChanges:n=Wt,attributes:r,disabled:o,data:i,getNewIndex:a=Kt,id:l,strategy:s,resizeObserverConfig:c,transition:d=$t}=t;const{items:u,containerId:f,activeIndex:v,disabled:g,disableTransforms:p,sortedRects:h,overIndex:m,useDragOverlay:b,strategy:w}=(0,e.useContext)(Ht),y=function(e,t){var n,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(o,g),E=u.indexOf(l),C=(0,e.useMemo)((()=>({sortable:{containerId:f,index:E,items:u},...i})),[f,i,E,u]),I=(0,e.useMemo)((()=>u.slice(u.indexOf(l))),[u,l]),{rect:R,node:N,isOver:B,setNodeRef:M}=bt({id:l,data:C,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...c}}),{active:T,activatorEvent:L,activeNodeRect:A,attributes:P,setNodeRef:z,listeners:F,isDragging:j,over:Y,setActivatorNodeRef:V,transform:X}=function(t){let{id:n,data:r,disabled:o=!1,attributes:i}=t;const a=S("Droppable"),{activators:l,activatorEvent:s,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:v}=(0,e.useContext)(it),{role:g=pt,roleDescription:p="draggable",tabIndex:h=0}=null!=i?i:{},m=(null==c?void 0:c.id)===n,b=(0,e.useContext)(m?ut:gt),[w,y]=D(),[E,C]=D(),I=function(t,n){return(0,e.useMemo)((()=>t.reduce(((e,t)=>{let{eventName:r,handler:o}=t;return e[r]=e=>{o(e,n)},e}),{})),[t,n])}(l,n),R=x(r);return k((()=>(f.set(n,{id:n,key:a,node:w,activatorNode:E,data:R}),()=>{const e=f.get(n);e&&e.key===a&&f.delete(n)})),[f,n]),{active:c,activatorEvent:s,activeNodeRect:d,attributes:(0,e.useMemo)((()=>({role:g,tabIndex:h,"aria-disabled":o,"aria-pressed":!(!m||g!==pt)||void 0,"aria-roledescription":p,"aria-describedby":u.draggable})),[o,g,h,m,p,u.draggable]),isDragging:m,listeners:o?void 0:I,node:w,over:v,setNodeRef:y,setActivatorNodeRef:C,transform:b}}({id:l,data:C,attributes:{...Gt,...r},disabled:y.draggable}),H=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(0,e.useMemo)((()=>e=>{n.forEach((t=>t(e)))}),n)}(M,z),U=Boolean(T),K=U&&!p&&Pt(v)&&Pt(m),W=!b&&j,$=W&&K?X:null,J=K?null!=$?$:(null!=s?s:w)({rects:h,activeNodeRect:A,activeIndex:v,overIndex:m,index:E}):null,q=Pt(v)&&Pt(m)?a({id:l,items:u,activeIndex:v,overIndex:m}):E,G=null==T?void 0:T.id,Q=(0,e.useRef)({activeId:G,items:u,newIndex:q,containerId:f}),Z=u!==Q.current.items,ee=n({active:T,containerId:f,isDragging:j,isSorting:U,id:l,index:E,items:u,newIndex:Q.current.newIndex,previousItems:Q.current.items,previousContainerId:Q.current.containerId,transition:d,wasDragging:null!=Q.current.activeId}),te=function(t){let{disabled:n,index:r,node:o,rect:i}=t;const[a,l]=(0,e.useState)(null),s=(0,e.useRef)(r);return k((()=>{if(!n&&r!==s.current&&o.current){const e=i.current;if(e){const t=ne(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&l(n)}}r!==s.current&&(s.current=r)}),[n,r,o,i]),(0,e.useEffect)((()=>{a&&l(null)}),[a]),a}({disabled:!ee,index:E,node:N,rect:R});return(0,e.useEffect)((()=>{U&&Q.current.newIndex!==q&&(Q.current.newIndex=q),f!==Q.current.containerId&&(Q.current.containerId=f),u!==Q.current.items&&(Q.current.items=u)}),[U,q,f,u]),(0,e.useEffect)((()=>{if(G===Q.current.activeId)return;if(G&&!Q.current.activeId)return void(Q.current.activeId=G);const e=setTimeout((()=>{Q.current.activeId=G}),50);return()=>clearTimeout(e)}),[G]),{active:T,activeIndex:v,attributes:P,data:C,rect:R,index:E,newIndex:q,items:u,isOver:B,isSorting:U,isDragging:j,listeners:F,node:N,overIndex:m,over:Y,setNodeRef:H,setActivatorNodeRef:V,setDroppableNodeRef:M,setDraggableNodeRef:z,transform:null!=te?te:J,transition:te||Z&&Q.current.newIndex===E?qt:W&&!O(L)||!d?void 0:U||ee?_.Transition.toString({...d,property:Jt}):void 0}}function Zt({clientId:t}){const[n,o]=(0,r.useState)(!1),l=()=>o(!1);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Button,{className:"block-delete",icon:"no-alt",iconSize:14,isBusy:n,onClick:()=>o(!0)}),n&&(0,e.createElement)(a.Modal,{title:(0,i.__)("Delete block?"),onRequestClose:l},(0,i.__)("This will remove the block from the header."),(0,e.createElement)("div",{style:{marginTop:"20px"}},(0,e.createElement)(a.Button,{isSecondary:!0,onClick:l},(0,i.__)("Cancel")),(0,e.createElement)(a.Button,{isSecondary:!0,isDestructive:!0,onClick:()=>{wp.data.dispatch("core/block-editor").removeBlock(t),l()},style:{marginLeft:"15px"}},(0,i.__)("Confirm")))))}function en(t){return(0,e.createElement)("div",{className:"drag-handle",style:{cursor:"grab",marginRight:"5px"},...t},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18"},(0,e.createElement)("path",{d:"M13 8c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1zM5 6c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1zm0 4c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1zm8 0c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1zM9 6c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1zm0 4c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"})))}function tn({block:t,isPreview:n=!1}){const r={};let i={};const l=(0,o.useSelect)((e=>e("core/blocks").getBlockType(t.name)),[]);if(!n){const{attributes:e,listeners:n,setNodeRef:o,transform:a,transition:l}=Qt({id:t.clientId,data:{name:t.name,attributes:t.attributes}}),s=a?{transform:`translate3d(${a.x}px, ${a.y}px, 0)`}:void 0;r.ref=o,r.style=s,i={...n,...e}}const c=Tt()({"visual-inner-block":!0,"visual-inner-block__preview":n});return(0,e.createElement)("div",{className:c,...r},(0,e.createElement)("div",{className:"visual-inner-block__controls"},(0,e.createElement)(en,{...i}),(0,e.createElement)("div",null,(0,e.createElement)(Bt,{clientId:t.clientId}),(0,e.createElement)(Zt,{clientId:t.clientId}))),(0,e.createElement)("div",{className:"visual-inner-block__meta"},(0,e.createElement)(a.Icon,{size:16,className:"block-icon",icon:l?.icon?.src}),(0,e.createElement)("span",{className:"visual-inner-block__name"},(()=>{const e=(0,s.get)(t,["attributes","metadata","name"],"");return""!==e?e:l.title})())))}function nn(t){const{isOver:n,setNodeRef:r}=bt({id:t.clientId}),o={backgroundColor:n?"rgba(0, 124, 186, 0.05)":""},i=Tt()({[t.classNames]:!0,"visual-column-wrapper_is-dropping":n});return(0,e.createElement)("div",{className:i,ref:r,style:o},t.children)}function rn({blocks:t,className:n,clientId:o,showMidColumns:i=!0,type:a=""}){const l=Tt()({"visual-column-wrapper":!0,[`visual-column-wrapper-${n}`]:!0,"visual-column-wrapper-empty-center":!i&&"desktop"===a}),c=(0,r.useMemo)((()=>(0,s.map)(t,"clientId")),[t]);return(0,e.createElement)(Ut,{items:c,strategy:"off-canvas"===a?Vt:Ft},"off-canvas"!==a?(0,e.createElement)(nn,{clientId:o,classNames:l},t.map((t=>(0,e.createElement)(tn,{key:t.clientId,block:t})))):(0,e.createElement)(e.Fragment,null,t.map((t=>(0,e.createElement)(tn,{key:t.clientId,block:t})))))}function on({children:t,setActiveBlockData:n}){const r=e=>wp.data.select("core/block-editor").getBlockIndex(e);return(0,e.createElement)(vt,{onDragEnd:()=>n(null),onDragStart:e=>n(e.active),onDragOver:(0,s.debounce)((function(e){const{active:t,over:n}=e;if(n&&t){let e=n.id;const o=t.id,i=wp.data.select("core/block-editor").getBlockRootClientId(o),a=r(e),l=r(o),s=wp.data.select("core/block-editor").getBlockName(e);if(wp.data.select("core/block-editor").getBlockName(i),"kadence/header-column"!==s&&(e=i),e===i&&a===l)return;wp.data.dispatch("core/block-editor").moveBlockToPosition(o,i,e,a)}}),100)},t)}xe.Down,xe.Right,xe.Up,xe.Left;const an=["left","center-left","center","center-right","right"],ln=[["innerBlocks",0,"innerBlocks",0,"innerBlocks"],["innerBlocks",0,"innerBlocks",1,"innerBlocks"],["innerBlocks",1,"innerBlocks"],["innerBlocks",2,"innerBlocks",0,"innerBlocks"],["innerBlocks",2,"innerBlocks",1,"innerBlocks"]],sn=[["innerBlocks",0,"innerBlocks",0,"clientId"],["innerBlocks",0,"innerBlocks",1,"clientId"],["innerBlocks",1,"clientId"],["innerBlocks",2,"innerBlocks",0,"clientId"],["innerBlocks",2,"innerBlocks",1,"clientId"]],cn={top:0,middle:1,bottom:2},dn=["top","middle","bottom"],un=({position:t,blocks:n,activeBlockData:r})=>{const o=(0,s.get)(n,[cn[t]],[]),i=(e=>an.map(((t,n)=>({name:t,blocks:(0,s.get)(e,ln[n],[]),clientId:(0,s.get)(e,sn[n],[])}))))(o),a=0===i[2].blocks.length,l=0===i[1].blocks.length&&0===i[3].blocks.length,c=null!==r&&1===i[2].blocks.length&&r.id===i[2].blocks[0].clientId,d=!a&&!c||!l,u="single"===o?.attributes?.layoutConfig;return(0,e.createElement)("div",{className:"visual-row-wrapper",key:t},(0,e.createElement)(Bt,{clientId:o.clientId}),(0,e.createElement)("div",{className:`visual-desktop-row visual-desktop-row-${t}${u?" kb-single-column-header":""}`},(0,e.createElement)("div",{className:"visual-section-wrapper visual-section-wrapper-left"},(0,e.createElement)(rn,{blocks:i[0].blocks,position:t,className:"left",clientId:i[0].clientId,type:"desktop"}),(0,e.createElement)(_t,{position:"left",clientId:i[0].clientId,showMidColumns:d}),d&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(rn,{blocks:i[1].blocks,className:"center-left",showMidColumns:d,clientId:i[1].clientId,type:"desktop"}),(0,e.createElement)(_t,{position:"center-left",clientId:i[1].clientId}))),(0,e.createElement)("div",{className:"visual-section-wrapper visual-section-wrapper-center"},(0,e.createElement)(rn,{blocks:i[2].blocks,className:"center",clientId:i[2].clientId,type:"desktop"}),(0,e.createElement)(_t,{position:"center",clientId:i[2].clientId})),(0,e.createElement)("div",{className:"visual-section-wrapper visual-section-wrapper-right"},d&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(rn,{blocks:i[3].blocks,className:"center-right",showMidColumns:d,clientId:i[3].clientId,type:"desktop"}),(0,e.createElement)(_t,{position:"center-right",clientId:i[3].clientId})),(0,e.createElement)(rn,{blocks:i[4].blocks,className:"right",clientId:i[4].clientId,type:"desktop"}),(0,e.createElement)(_t,{position:"right",clientId:i[4].clientId,showMidColumns:d}))))};function fn({blocks:t}){const n=(0,r.useMemo)((()=>(0,s.get)(t,["innerBlocks"],[])),[t]),[o,i]=(0,r.useState)(null);return(0,e.createElement)("div",{className:"visual-desktop-container"},(0,e.createElement)(on,{setActiveBlockData:i},dn.map((t=>(0,e.createElement)(un,{key:t,position:t,blocks:n,activeBlockData:o}))),(0,e.createElement)(Nt,null,null!==o&&(0,e.createElement)(tn,{block:{...o.data.current,clientId:""},isPreview:!0}))))}const vn=["top","middle","bottom"],gn=({position:t,blocks:n})=>{const r=(0,s.get)(n,[cn[t]],[]),o="single"===r?.attributes?.layoutConfig;return(0,e.createElement)("div",{className:"visual-row-wrapper",key:t},(0,e.createElement)(Bt,{clientId:r.clientId}),(0,e.createElement)("div",{className:`visual-tablet-row visual-tablet-row-${t}${o?" kb-single-column-header":""}`},["left","center","right"].map(((t,n)=>(0,e.createElement)("div",{className:`visual-section-wrapper visual-section-wrapper-${t}`},(0,e.createElement)(rn,{blocks:(0,s.get)(r,["innerBlocks",n,"innerBlocks"],[]),className:t,clientId:(0,s.get)(r,["innerBlocks",n,"clientId"],[]),showMidColumns:!1,isTablet:!0}),(0,e.createElement)(_t,{position:t,clientId:(0,s.get)(r,["innerBlocks",n,"clientId"],[])}))))))};function pn({blocks:t}){const n=(0,r.useMemo)((()=>(0,s.get)(t,["innerBlocks"],[])),[t]),[o,i]=(0,r.useState)(null);return(0,e.createElement)("div",{className:"visual-desktop-container"},(0,e.createElement)(on,{setActiveBlockData:i},vn.map((t=>(0,e.createElement)(gn,{key:t,position:t,blocks:n}))),(0,e.createElement)(Nt,null,null!==o&&(0,e.createElement)(tn,{block:{...o.data.current,clientId:""},isPreview:!0}))))}const hn=({blocks:t,offCanvasClientId:n})=>(0,e.createElement)("div",{className:"visual-row-wrapper",key:"off-canvas"},(0,e.createElement)(Bt,{clientId:n}),(0,e.createElement)("div",{className:"visual-off-canvas-row"},(0,e.createElement)("div",{className:"visual-section-wrapper visual-section-wrapper-off-canvas"},(0,e.createElement)(rn,{blocks:t,className:"off-canvas",clientId:n,showMidColumns:!1,isTablet:!0,type:"off-canvas"}))),(0,e.createElement)(_t,{position:"off-canvas",clientId:n}));function mn({blocks:t,topLevelBlocks:n}){const[o,i]=(0,r.useState)(null),a=(0,r.useMemo)((()=>(0,s.get)(t,["innerBlocks"],[])),[t]),l=(0,s.get)(n,[2,"clientId"],"");return(0,e.createElement)("div",{className:"visual-off-canvas-container"},(0,e.createElement)(on,{setActiveBlockData:i},(0,e.createElement)(hn,{blocks:a,offCanvasClientId:l}),(0,e.createElement)(Nt,null,null!==o&&(0,e.createElement)(tn,{block:{...o.data.current,clientId:""},isPreview:!0}))))}const bn=(0,r.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(c.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),wn=(0,r.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(c.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function yn({position:t,setPosition:n}){const r="bottom"===t?(0,i.__)("Move to top","kadence-blocks"):(0,i.__)("Move to bottom","kadence-blocks");return(0,e.createElement)(a.Button,{className:"kb-header-visual-builder-modal-close","aria-label":r,onClick:()=>{n("bottom"===t?"top":"bottom")},variant:"secondary",icon:"bottom"===t?bn:wn,iconSize:18},r)}function kn({clientId:t,previewDevice:n,isSelected:c}){const[d,f]=(0,r.useState)(n),{setPreviewDeviceType:v,setHeaderVisualBuilderOpenId:g,setHeaderVisualBuilderOpenPosition:p,setOffCanvasOpenId:h}=(0,o.useDispatch)("kadenceblocks/data"),{selectBlock:m}=(0,o.useDispatch)("core/block-editor"),b=(e,t=null)=>{const n=(0,s.get)(t,"clientId");"off-canvas"!==e?(v((0,l.capitalizeFirstLetter)(e)),"off-canvas"===d&&(h(null),m(n))):"off-canvas"===e&&n&&(h(n),m(n)),f(e)},{topLevelBlocks:w,childSelected:y,isVisible:k,modalPosition:E}=(0,o.useSelect)((e=>{const{getBlockOrder:n,getBlock:r,hasSelectedInnerBlock:o}=e("core/block-editor");return{topLevelBlocks:n(t).map((e=>r(e))),childSelected:o(t,!0),isVisible:e("kadenceblocks/data").getOpenHeaderVisualBuilderId()===t,modalPosition:e("kadenceblocks/data").getOpenHeaderVisualBuilderPosition()}}),[t]),x=(0,o.useSelect)((e=>e("core/edit-post").isListViewOpened()),[]);(0,r.useEffect)((()=>{const e="Mobile"===n||"Tablet"===n?"Tablet":"Desktop";d!==e&&f(e)}),[k,n]);const C=()=>{g(k?null:t)},{desktopBlocks:D,tabletBlocks:I,offCanvasBlocks:R}=function(e){let t,n,r=null;return e.forEach((e=>{e.name.includes("desktop")?t=e:e.name.includes("tablet")?n=e:e.name.includes("off-canvas")&&(r=e)})),{desktopBlocks:t,tabletBlocks:n,offCanvasBlocks:r}}(w),S=(0,l.blockExists)(w,"kadence/off-canvas-trigger"),N=(0,r.useRef)(),B=(0,l.useEditorElement)(N,[n,d,x],"editor-visual-editor"),M=B?.clientWidth,O=B?.getBoundingClientRect().left,T=(0,r.useMemo)((()=>({width:M+"px",left:O+"px"})),[M,O]);return S||"off-canvas"!==d||b("Desktop",D),0===w.length?null:(0,e.createElement)(e.Fragment,null,k&&(0,e.createElement)("style",null,"top"===E&&(0,e.createElement)(e.Fragment,null,".kb-off-canvas-inner { margin-top: 310px; }")),(0,e.createElement)("div",{ref:N},!k&&(c||y)&&(0,e.createElement)("div",{class:"kb-header-visual-builder-teaser",style:T},(0,e.createElement)(a.Button,{isPrimary:!0,onClick:()=>C()},(0,i.__)("Open Visual Builder","kadence-blocks"))),k&&(0,e.createElement)("div",{class:"kb-header-visual-builder-modal kb-header-visual-builder-modal-"+E,style:T},(0,e.createElement)("div",{class:"tabs"},(0,e.createElement)(a.Button,{className:"kb-device-tab",isPressed:"Desktop"===d,disabled:null===D,onClick:()=>b("Desktop",D)},(0,i.__)("Desktop","kadence-blocks")),(0,e.createElement)(a.Button,{className:"kb-device-tab",isPressed:"Tablet"===d,disabled:null===I,onClick:()=>b("Tablet",I)},(0,i.__)("Tablet / Mobile","kadence-blocks")),S&&(0,e.createElement)(a.Button,{className:"kb-device-tab",isPressed:"off-canvas"===d,disabled:null===R,onClick:()=>b("off-canvas",R)},(0,i.__)("Off Canvas","kadence-blocks")),(0,e.createElement)("div",{className:"modal-settings"},(0,e.createElement)(yn,{position:E,setPosition:p}),(0,e.createElement)(u,{isVisible:k,setIsVisible:C}))),(0,e.createElement)("div",{class:"content"},"Desktop"===d&&(0,e.createElement)(fn,{blocks:D}),"Tablet"===d&&(0,e.createElement)(pn,{blocks:I}),"off-canvas"===d&&(0,e.createElement)(mn,{blocks:R,topLevelBlocks:w})))),(k||!k&&(c||y))&&(0,e.createElement)("style",null,`.edit-post-layout__metaboxes{display: none}.editor-styles-wrapper{ margin-${E}: ${"top"===E?"280":"315"}px;}.editor-visual-editor:not(.is-resizable) .block-editor-iframe__scale-container{\n\t\t\t\t\t\t\t${"top"===E?"":"margin-bottom: 250px;"}\n\t\t\t\t\t\t\t${"Desktop"!==n&&"bottom"===E?"height: 1224px;":""}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t`))}(0,i.__)("Introduction to your Header","kadence-blocks"),(0,i.__)("The Header (adv) Block has many options to customize and extend your header. Keep reading to learn more or close this to get started. You can always read the ","kadence-blocks"),(0,i.__)("documentation","kadence-blocks"),(0,i.__)(" later.","kadence-blocks"),(0,i.__)("Logo Image","kadence-blocks"),(0,i.__)("This header automatically displays your site logo. You can update it directly in the block settings.","kadence-blocks"),(0,i.__)("Manage Navigation","kadence-blocks"),(0,i.__)("You can use the Navigation (adv) block to build a new navigation or use an existing one.","kadence-blocks"),(0,i.__)("Customize CTAs","kadence-blocks"),(0,i.__)("Use Button blocks to add your Call to Actions and Social Links.","kadence-blocks"),(0,i.__)("Edit Appearance","kadence-blocks"),(0,i.__)("Customize your header's appearance by selecting the Header (adv) block and using the options in the sidebar.","kadence-blocks"),(0,i.__)("The Visual Builder","kadence-blocks"),(0,i.__)("Easily arrange the layout and content of your header with the Visual Builder. Look for it at the bottom of the editor.","kadence-blocks"),(0,i.__)("Off Canvas Trigger","kadence-blocks"),(0,i.__)("Your header has an off canvas area. The Off Canvas Trigger block in your header will open it on the live page.","kadence-blocks"),(0,i.__)("Manage Off Canvas Content","kadence-blocks"),(0,i.__)('To edit your off canvas content, select the "Off Canvas" tab from the visual builder.',"kadence-blocks");const En=()=>{const{previewDevice:t,visualBuilderClientId:n,modalPosition:r}=(0,o.useSelect)((e=>({previewDevice:e("kadenceblocks/data").getPreviewDeviceType(),visualBuilderClientId:e("kadenceblocks/data").getSelectedHeaderVisualBuilderId(),modalPosition:e("kadenceblocks/data").getOpenHeaderVisualBuilderPosition()})),[]);return n?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(kn,{clientId:n,previewDevice:t,isSelected:!0}),(0,e.createElement)("style",null,` .editor-visual-editor.is-iframed {\n\t\t\t\t${"top"===r?"margin-top: 290px;":""}\n\t\t\t\t\t}\n\n\t\t\t\t`)):null};document.addEventListener("DOMContentLoaded",(()=>{const t=document.createElement("div");t.id="kb-header-visual-builder",document.body.appendChild(t),(0,r.render)((0,e.createElement)(En,null),t)}))})(),(this.kadence=this.kadence||{})["header-visual-builder"]={}})();