File: /home/slyfwmm/laretediclo/wp-content/plugins/kadence-blocks/dist/header-visual-builder.js
(()=>{var e={4184:(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),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r);const e=window.React;var t=n.n(e);const o=window.wp.element,i=window.wp.data,a=window.wp.i18n,l=window.wp.components;window.kadence.icons;const s=window.kadence.helpers,c=window.lodash,d=window.wp.primitives,u=(0,o.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(d.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 f({isVisible:t,setIsVisible:n}){return(0,e.createElement)(l.Button,{className:"kb-header-visual-builder-modal-close","aria-label":(0,a.__)("Close Modal","kadence-blocks"),onClick:()=>{n(!t)},variant:"secondary",icon:u,iconSize:18},(0,a.__)("Hide","kadence-blocks"))}const v=window.ReactDOM,g="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function p(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function h(e){return"nodeType"in e}function m(e){var t,n;return e?p(e)?e:h(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function b(e){const{Document:t}=m(e);return e instanceof t}function y(e){return!p(e)&&e instanceof m(e).HTMLElement}function w(e){return e instanceof m(e).SVGElement}function k(e){return e?p(e)?e.document:h(e)?b(e)?e:y(e)||w(e)?e.ownerDocument:document:document:document}const E=g?e.useLayoutEffect:e.useEffect;function x(t){const n=(0,e.useRef)(t);return E((()=>{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 C(t,n){void 0===n&&(n=[t]);const r=(0,e.useRef)(t);return E((()=>{r.current!==t&&(r.current=t)}),n),r}function D(t,n){const r=(0,e.useRef)();return(0,e.useMemo)((()=>{const e=t(r.current);return r.current=e,e}),[...n])}function I(t){const n=x(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 R(t){const n=(0,e.useRef)();return(0,e.useEffect)((()=>{n.current=t}),[t]),n.current}let S={};function N(t,n){return(0,e.useMemo)((()=>{if(n)return n;const e=null==S[t]?0:S[t]+1;return S[t]=e,t+"-"+e}),[t,n])}function B(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 M=B(1),O=B(-1);function T(e){if(!e)return!1;const{KeyboardEvent:t}=m(e.target);return t&&e instanceof t}function _(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=m(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 L=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[L.Translate.toString(e),L.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),A="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function P(e){return e.matches(A)?e:e.querySelector(A)}const z={display:"none"};function j(e){let{id:n,value:r}=e;return t().createElement("div",{id:n,style:z},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 Y=(0,e.createContext)(null),V={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 "},X={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 H(n){let{announcements:r=X,container:o,hiddenTextDescribedById:i,screenReaderInstructions:a=V}=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=N("DndLiveRegion"),[d,u]=(0,e.useState)(!1);if((0,e.useEffect)((()=>{u(!0)}),[]),function(t){const n=(0,e.useContext)(Y);(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 f=t().createElement(t().Fragment,null,t().createElement(j,{id:i,value:a.draggable}),t().createElement(F,{id:c,announcement:s}));return o?(0,v.createPortal)(f,o):f}var U;function K(){}!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"}(U||(U={}));const W=Object.freeze({x:0,y:0});function $(e,t){const n=_(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function J(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function q(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 G=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=q(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(J)};function Q(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:W}function Z(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 ee=Z(1);function te(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 ne={ignoreTransform:!1};function re(e,t){void 0===t&&(t=ne);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=m(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=te(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 oe(e){return re(e,{ignoreTransform:!0})}function ie(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(b(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!y(o)||w(o))return n;if(n.includes(o))return n;const i=m(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=m(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=m(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function ae(e){const[t]=ie(e,1);return null!=t?t:null}function le(e){return g&&e?p(e)?e:h(e)?b(e)||e===k(e).scrollingElement?window:y(e)?e:null:null:null}function se(e){return p(e)?e.scrollX:e.scrollLeft}function ce(e){return p(e)?e.scrollY:e.scrollTop}function de(e){return{x:se(e),y:ce(e)}}var ue;function fe(e){return!(!g||!e)&&e===document.scrollingElement}function ve(e){const t={x:0,y:0},n=fe(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"}(ue||(ue={}));const ge={x:.2,y:.2};function pe(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=ge);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=ve(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=ue.Backward,g.y=r*Math.abs((t.top+p-i)/p)):!d&&s>=t.bottom-p&&(v.y=ue.Forward,g.y=r*Math.abs((t.bottom-p-s)/p)),!f&&l>=t.right-h?(v.x=ue.Forward,g.x=r*Math.abs((t.right-h-l)/h)):!u&&a<=t.left+h&&(v.x=ue.Backward,g.x=r*Math.abs((t.left+h-a)/h)),{direction:v,speed:g}}function he(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 me(e){return e.reduce(((e,t)=>M(e,de(t))),W)}function be(e,t){if(void 0===t&&(t=re),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);ae(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ye=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+se(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+ce(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=ie(t),r=me(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of ye)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 ke{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 Ee(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 xe,Ce,De;function Ie(e){e.preventDefault()}function Re(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"}(xe||(xe={})),(De=Ce||(Ce={})).Space="Space",De.Down="ArrowDown",De.Right="ArrowRight",De.Left="ArrowLeft",De.Up="ArrowUp",De.Esc="Escape",De.Enter="Enter";const Se={start:[Ce.Space,Ce.Enter],cancel:[Ce.Esc],end:[Ce.Space,Ce.Enter]},Ne=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ce.Right:return{...n,x:n.x+25};case Ce.Left:return{...n,x:n.x-25};case Ce.Down:return{...n,y:n.y+25};case Ce.Up:return{...n,y:n.y-25}}};class Be{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 ke(k(t)),this.windowListeners=new ke(m(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xe.Resize,this.handleCancel),this.windowListeners.add(xe.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(xe.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&be(n),t(W)}handleKeyDown(e){if(T(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Se,coordinateGetter:i=Ne,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}:W;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=O(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}=ve(n),v=he(n),g={x:Math.min(o===Ce.Right?v.right-v.width/2:v.right,Math.max(o===Ce.Right?v.left:v.left+v.width/2,d.x)),y:Math.min(o===Ce.Down?v.bottom-v.height/2:v.bottom,Math.max(o===Ce.Down?v.top:v.top+v.height/2,d.y))},p=o===Ce.Right&&!l||o===Ce.Left&&!s,h=o===Ce.Down&&!c||o===Ce.Up&&!i;if(p&&g.x!==d.x){const e=n.scrollLeft+t.x,i=o===Ce.Right&&e<=u.x||o===Ce.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Ce.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===Ce.Down&&e<=u.y||o===Ce.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Ce.Down?n.scrollTop-u.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,M(O(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 Me(e){return Boolean(e&&"distance"in e)}function Oe(e){return Boolean(e&&"delay"in e)}Be.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Se,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 Te{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=m(e);return e instanceof t?e:k(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=k(i),this.documentListeners=new ke(this.document),this.listeners=new ke(n),this.windowListeners=new ke(m(i)),this.initialCoordinates=null!=(r=_(o))?r:W,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(xe.Resize,this.handleCancel),this.windowListeners.add(xe.DragStart,Ie),this.windowListeners.add(xe.VisibilityChange,this.handleCancel),this.windowListeners.add(xe.ContextMenu,Ie),this.documentListeners.add(xe.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Oe(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(Me(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(xe.Click,Re,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xe.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=_(e))?t:W,s=O(r,l);if(!n&&a){if(Me(a)){if(null!=a.tolerance&&Ee(s,a.tolerance))return this.handleCancel();if(Ee(s,a.distance))return this.handleStart()}return Oe(a)&&Ee(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===Ce.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const _e={move:{name:"pointermove"},end:{name:"pointerup"}};class Le extends Te{constructor(e){const{event:t}=e,n=k(t.target);super(e,_e,n)}}Le.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 Ae={move:{name:"mousemove"},end:{name:"mouseup"}};var Pe;!function(e){e[e.RightClick=2]="RightClick"}(Pe||(Pe={})),class extends Te{constructor(e){super(e,Ae,k(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Pe.RightClick&&(null==r||r({event:n}),!0)}}];const ze={move:{name:"touchmove"},end:{name:"touchend"}};var je,Fe;(class extends Te{constructor(e){super(e,ze)}static setup(){return window.addEventListener(ze.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ze.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"}(je||(je={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Fe||(Fe={}));const Ye={x:{[ue.Backward]:!1,[ue.Forward]:!1},y:{[ue.Backward]:!1,[ue.Forward]:!1}};var Ve,Xe;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Ve||(Ve={})),function(e){e.Optimized="optimized"}(Xe||(Xe={}));const He=new Map;function Ue(e,t){return D((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function Ke(t){let{callback:n,disabled:r}=t;const o=x(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 We(e){return new we(re(e),e)}function $e(t,n,r){void 0===n&&(n=We);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=x(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=Ke({callback:i});return E((()=>{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 Je=[];function qe(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!==W;e&&!r.current&&(r.current=t),!e&&r.current&&(r.current=null)}),[t]),r.current?O(t,r.current):W}function Ge(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 Qe=[];function Ze(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return y(t)?t:e}const et=[{sensor:Le,options:{}},{sensor:Be,options:{}}],tt={current:{}},nt={draggable:{measure:oe},droppable:{measure:oe,strategy:Ve.WhileDragging,frequency:Xe.Optimized},dragOverlay:{measure:re}};class rt 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 ot={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new rt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:K},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:nt,measureDroppableContainers:K,windowRect:null,measuringScheduled:!1},it={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:K,draggableNodes:new Map,over:null,measureDroppableContainers:K},at=(0,e.createContext)(it),lt=(0,e.createContext)(ot);function st(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new rt}}}function ct(e,t){switch(t.type){case U.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case U.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 U.DragEnd:case U.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case U.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new rt(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case U.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 rt(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case U.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new rt(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function dt(t){let{disabled:n}=t;const{active:r,activatorEvent:o,draggableNodes:i}=(0,e.useContext)(at),a=R(o),l=R(null==r?void 0:r.id);return(0,e.useEffect)((()=>{if(!n&&!o&&a&&null!=l){if(!T(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=P(e);if(t){t.focus();break}}}))}}),[o,n,i,l,a]),null}function ut(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}const ft=(0,e.createContext)({...W,scaleX:1,scaleY:1});var vt;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(vt||(vt={}));const gt=(0,e.memo)((function(n){var r,o,i,a;let{id:l,accessibility:s,autoScroll:c=!0,children:d,sensors:u=et,collisionDetection:f=G,measuring:p,modifiers:h,...b}=n;const w=(0,e.useReducer)(ct,void 0,st),[k,x]=w,[S,B]=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,T]=(0,e.useState)(vt.Uninitialized),L=O===vt.Initialized,{draggable:{active:A,nodes:P,translate:z},droppable:{containers:j}}=k,F=A?P.get(A):null,V=(0,e.useRef)({initial:null,translated:null}),X=(0,e.useMemo)((()=>{var e;return null!=A?{id:A,data:null!=(e=null==F?void 0:F.data)?e:tt,rect:V}:null}),[A,F]),K=(0,e.useRef)(null),[$,J]=(0,e.useState)(null),[q,Z]=(0,e.useState)(null),te=C(b,Object.values(b)),ne=N("DndDescribedBy",l),oe=(0,e.useMemo)((()=>j.getEnabled()),[j]),se=(ce=p,(0,e.useMemo)((()=>({draggable:{...nt.draggable,...null==ce?void 0:ce.draggable},droppable:{...nt.droppable,...null==ce?void 0:ce.droppable},dragOverlay:{...nt.dragOverlay,...null==ce?void 0:ce.dragOverlay}})),[null==ce?void 0:ce.draggable,null==ce?void 0:ce.droppable,null==ce?void 0:ce.dragOverlay]));var ce;const{droppableRects:ve,measureDroppableContainers:ge,measuringScheduled:he}=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 Ve.Always:return!1;case Ve.BeforeDragging:return r;default:return!r}}(),v=C(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=D((e=>{if(f&&!r)return He;if(!e||e===He||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}}(oe,{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 D((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(P,A),ye=(0,e.useMemo)((()=>q?_(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 Ue(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;E((()=>{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=Q(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=ae(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=$e(be,se.draggable.measure,Ee),Ce=$e(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:j,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ie=j.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=Ke({callback:(0,e.useCallback)((e=>{for(const{target:t}of e)if(y(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=Ze(e);null==i||i.disconnect(),t&&(null==i||i.observe(t)),o(t?n(t):null)}),[n,i]),[l,s]=I(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=Q(Oe=Be?null:xe,Ue(Oe));var Oe;const Te=Ge(Se?m(Se):null),_e=function(t){const n=(0,e.useRef)(t),r=D((e=>t?e&&e!==Je&&t&&n.current&&t.parentNode===n.current.parentNode?e:ie(t):Je),[t]);return(0,e.useEffect)((()=>{n.current=t}),[t]),r}(L?null!=Ie?Ie:be:null),Le=function(t,n){void 0===n&&(n=re);const[r]=t,o=Ge(r?m(r):null),[i,a]=(0,e.useReducer)((function(){return t.length?t.map((e=>fe(e)?o:new we(n(e),e))):Qe}),Qe),l=Ke({callback:a});return t.length>0&&i===Qe&&a(),E((()=>{t.length?t.forEach((e=>null==l?void 0:l.observe(e))):(null==l||l.disconnect(),a())}),[t]),i}(_e),Ae=ut(h,{transform:{x:z.x-Me.x,y:z.y-Me.y,scaleX:1,scaleY:1},activatorEvent:q,active:X,activeNodeRect:xe,containerNodeRect:Ce,draggingNodeRect:Ne,over:De.current.over,overlayNodeRect:Re.rect,scrollableAncestors:_e,scrollableAncestorRects:Le,windowRect:Te}),Pe=ye?M(ye,z):null,ze=function(t){const[n,r]=(0,e.useState)(null),o=(0,e.useRef)(t),i=(0,e.useCallback)((e=>{const t=le(e.target);t&&r((e=>e?(e.set(t,de(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=le(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,de(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=le(e);null==t||t.removeEventListener("scroll",i)}))}}),[i,t]),(0,e.useMemo)((()=>t.length?n?Array.from(n.values()).reduce(((e,t)=>M(e,t)),W):me(t):W),[t,n])}(_e),Xe=qe(ze),We=qe(ze,[xe]),rt=M(Ae,Xe),ot=Ne?ee(Ne,Ae):null,it=X&&ot?f({active:X,collisionRect:ot,droppableRects:ve,droppableContainers:oe,pointerCoordinates:Pe}):null,gt=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n.id}(it),[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:M(Ae,We),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==K.current)return;const o=P.get(K.current);if(!o)return;const i=e.nativeEvent,a=new n({active:K.current,activeNode:o,event:i,options:r,context:De,onStart(e){const t=K.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,v.unstable_batchedUpdates)((()=>{null==r||r(o),T(vt.Initializing),x({type:U.DragStart,initialCoordinates:e,active:t}),S({type:"onDragStart",event:o})}))},onMove(e){x({type:U.DragMove,coordinates:e})},onEnd:l(U.DragEnd),onCancel:l(U.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===U.DragEnd&&"function"==typeof l&&await Promise.resolve(l(a))&&(e=U.DragCancel)}K.current=null,(0,v.unstable_batchedUpdates)((()=>{x({type:e}),T(vt.Uninitialized),ht(null),J(null),Z(null);const t=e===U.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=te.current[t];null==e||e(a),S({type:t,event:a})}}))}}(0,v.unstable_batchedUpdates)((()=>{J(a),Z(e.nativeEvent)}))}),[P]),yt=(0,e.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=P.get(r);if(null!==K.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},K.current=r,bt(n,t))}),[P,bt]),wt=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,yt);!function(t){(0,e.useEffect)((()=>{if(!g)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),E((()=>{xe&&O===vt.Initializing&&T(vt.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,v.unstable_batchedUpdates)((()=>{null==e||e(i),S({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==K.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,v.unstable_batchedUpdates)((()=>{ht(l),null==i||i(s),S({type:"onDragOver",event:s})}))}),[gt]),E((()=>{De.current={activatorEvent:q,active:X,activeNode:be,collisionRect:ot,collisions:it,droppableRects:ve,draggableNodes:P,draggingNode:Se,draggingNodeRect:Ne,droppableContainers:j,over:pt,scrollableAncestors:_e,scrollAdjustedTranslate:rt},V.current={initial:Ne,translated:ot}}),[X,be,it,ot,P,Se,Ne,ve,j,pt,_e,rt]),function(t){let{acceleration:n,activator:r=je.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=R(t);return D((e=>{if(n||!r||!e)return Ye;const o=Math.sign(t.x-r.x),i=Math.sign(t.y-r.y);return{x:{[ue.Backward]:e.x[ue.Backward]||-1===o,[ue.Forward]:e.x[ue.Forward]||1===o},y:{[ue.Backward]:e.y[ue.Backward]||-1===i,[ue.Forward]:e.y[ue.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}),y=(0,e.useMemo)((()=>{switch(r){case je.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case je.DraggableRect:return i}}),[r,i,c]),w=(0,e.useRef)(null),k=(0,e.useCallback)((()=>{const e=w.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&&y){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}=pe(e,r,y,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(),w.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(y),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:X,activeNode:be,activeNodeRect:xe,activatorEvent:q,collisions:it,containerNodeRect:Ce,dragOverlay:Re,draggableNodes:P,droppableContainers:j,droppableRects:ve,over:pt,measureDroppableContainers:ge,scrollableAncestors:_e,scrollableAncestorRects:Le,measuringConfiguration:se,measuringScheduled:he,windowRect:Te})),[X,be,xe,q,it,Ce,Re,P,j,ve,pt,ge,_e,Le,se,he,Te]),Et=(0,e.useMemo)((()=>({activatorEvent:q,activators:wt,active:X,activeNodeRect:xe,ariaDescribedById:{draggable:ne},dispatch:x,draggableNodes:P,over:pt,measureDroppableContainers:ge})),[q,wt,X,xe,x,ne,P,pt,ge]);return t().createElement(Y.Provider,{value:B},t().createElement(at.Provider,{value:Et},t().createElement(lt.Provider,{value:kt},t().createElement(ft.Provider,{value:mt},d)),t().createElement(dt,{disabled:!1===(null==s?void 0:s.restoreFocus)})),t().createElement(H,{...s,hiddenTextDescribedById:ne}))})),pt=(0,e.createContext)(null),ht="button",mt="Droppable";function bt(){return(0,e.useContext)(lt)}const yt="Droppable",wt={timeout:25};function kt(t){let{data:n,disabled:r=!1,id:o,resizeObserverConfig:i}=t;const a=N(yt),{active:l,dispatch:s,over:c,measureDroppableContainers:d}=(0,e.useContext)(at),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}={...wt,...i},b=C(null!=h?h:o),y=Ke({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}),w=(0,e.useCallback)(((e,t)=>{y&&(t&&(y.unobserve(t),f.current=!1),e&&y.observe(e))}),[y]),[k,x]=I(w),D=C(n);return(0,e.useEffect)((()=>{y&&k.current&&(y.disconnect(),f.current=!1,y.observe(k.current))}),[k,y]),E((()=>(s({type:U.RegisterDroppable,element:{id:o,key:a,disabled:r,node:k,rect:v,data:D}}),()=>s({type:U.UnregisterDroppable,key:a,id:o}))),[o]),(0,e.useEffect)((()=>{r!==u.current.disabled&&(s({type:U.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:k,over:c,setNodeRef:x}}function Et(n){let{animation:r,children:o}=n;const[i,a]=(0,e.useState)(null),[l,s]=(0,e.useState)(null),c=R(o);return o||i||!c||a(c),E((()=>{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 xt={x:0,y:0,scaleX:1,scaleY:1};function Ct(e){let{children:n}=e;return t().createElement(at.Provider,{value:it},t().createElement(ft.Provider,{value:xt},n))}const Dt={position:"fixed",touchAction:"none"},It=e=>T(e)?"transform 250ms ease":void 0,Rt=(0,e.forwardRef)(((e,n)=>{let{as:r,activatorEvent:o,adjustScale:i,children:a,className:l,rect:s,style:c,transform:d,transition:u=It}=e;if(!s)return null;const f=i?d:{...d,scaleX:1,scaleY:1},v={...Dt,width:s.width,height:s.height,top:s.top,left:s.left,transform:L.Transform.toString(f),transformOrigin:i&&o?$(o,s):void 0,transition:"function"==typeof u?u(o):u,...c};return t().createElement(r,{className:l,style:v,ref:n},a)})),St=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)}},Nt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:L.Transform.toString(t)},{transform:L.Transform.toString(n)}]},sideEffects:St({styles:{active:{opacity:"0"}}})};let Bt=0;function Mt(t){return(0,e.useMemo)((()=>{if(null!=t)return Bt++,Bt}),[t])}const Ot=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:h,droppableContainers:b,dragOverlay:y,over:w,measuringConfiguration:k,scrollableAncestors:E,scrollableAncestorRects:C,windowRect:D}=bt(),I=(0,e.useContext)(ft),R=Mt(null==v?void 0:v.id),S=ut(s,{activatorEvent:f,active:v,activeNodeRect:g,containerNodeRect:p,draggingNodeRect:y.rect,over:w,overlayNodeRect:y.rect,scrollableAncestors:E,scrollableAncestorRects:C,transform:I,windowRect:D}),N=Ue(g),B=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return x(((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const l=a.node.current;if(!l)return;const s=Ze(i);if(!s)return;const{transform:c}=m(i).getComputedStyle(i),d=te(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Nt,...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 be(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:h,droppableContainers:b,measuringConfiguration:k}),M=N?y.setRef:void 0;return t().createElement(Ct,null,t().createElement(Et,{animation:B},v&&R?t().createElement(Rt,{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 Tt({clientId:t}){const{selectedBlockClientId:n}=(0,i.useSelect)((e=>{const{getSelectedBlockClientId:t}=e("core/block-editor");return{selectedBlockClientId:t()}}));return(0,e.createElement)(l.Button,{className:"block-select",isPressed:n===t,icon:"admin-generic",iconSize:14,onClick:()=>{wp.data.dispatch("core/block-editor").selectBlock(t)}})}const _t=window.wp.blockEditor;var Lt=n(4184),At=n.n(Lt);function Pt({position:t,clientId:n,showMidColumns:r=!1}){const o=At()({"add-item":"off-canvas"!==t,[`add-item-${t}`]:!0,"add-item-has-mid-columns":r});function i({...n}){const{onToggle:r,disabled:i,isOpen:s,blockTitle:c,hasSingleBlockType:d}=n;return(0,e.createElement)(l.Button,{icon:"plus",disabled:i,onClick:r,className:o},"off-canvas"===t?(0,a.__)("Add Block","kadence-blocks"):"")}return(0,e.createElement)(_t.Inserter,{renderToggle:t=>(0,e.createElement)(i,{...t}),rootClientId:n,position:"top center",isAppender:!0,__experimentalIsQuick:!0})}function zt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function jt(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function Ft(e){return null!==e&&e>=0}const Yt={scaleX:1,scaleY:1},Vt=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,...Yt}:null}return a>o&&a<=i?{x:-l.width-s,y:0,...Yt}:a<o&&a>=i?{x:l.width+s,y:0,...Yt}:{x:0,y:0,...Yt}},Xt=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=zt(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},Ht={scaleX:1,scaleY:1},Ut=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,...Ht}: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,...Ht}:o<n&&o>=a?{x:0,y:l.height+s,...Ht}:{x:0,y:0,...Ht}},Kt="Sortable",Wt=t().createContext({activeIndex:-1,containerId:Kt,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Xt,disabled:{draggable:!1,droppable:!1}});function $t(n){let{children:r,id:o,items:i,strategy:a=Xt,disabled:l=!1}=n;const{active:s,dragOverlay:c,droppableRects:d,over:u,measureDroppableContainers:f}=bt(),v=N(Kt,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,y=(0,e.useRef)(p),w=!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,y.current),k=-1!==b&&-1===m||w,x=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(l);E((()=>{w&&h&&f(p)}),[w,p,h,f]),(0,e.useEffect)((()=>{y.current=p}),[p]);const C=(0,e.useMemo)((()=>({activeIndex:m,containerId:v,disabled:x,disableTransforms:k,items:p,overIndex:b,useDragOverlay:g,sortedRects:jt(p,d),strategy:a})),[m,v,x.draggable,x.droppable,k,p,b,d,g,a]);return t().createElement(Wt.Provider,{value:C},r)}const Jt=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return zt(n,r,o).indexOf(t)},qt=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))},Gt={duration:200,easing:"ease"},Qt="transform",Zt=L.Transition.toString({property:Qt,duration:0,easing:"linear"}),en={roleDescription:"sortable"};function tn(t){let{animateLayoutChanges:n=qt,attributes:r,disabled:o,data:i,getNewIndex:a=Jt,id:l,strategy:s,resizeObserverConfig:c,transition:d=Gt}=t;const{items:u,containerId:f,activeIndex:v,disabled:g,disableTransforms:p,sortedRects:h,overIndex:m,useDragOverlay:b,strategy:y}=(0,e.useContext)(Wt),w=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),k=u.indexOf(l),x=(0,e.useMemo)((()=>({sortable:{containerId:f,index:k,items:u},...i})),[f,i,k,u]),D=(0,e.useMemo)((()=>u.slice(u.indexOf(l))),[u,l]),{rect:R,node:S,isOver:B,setNodeRef:M}=kt({id:l,data:x,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...c}}),{active:O,activatorEvent:_,activeNodeRect:A,attributes:P,setNodeRef:z,listeners:j,isDragging:F,over:Y,setActivatorNodeRef:V,transform:X}=function(t){let{id:n,data:r,disabled:o=!1,attributes:i}=t;const a=N(mt),{activators:l,activatorEvent:s,active:c,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:v}=(0,e.useContext)(at),{role:g=ht,roleDescription:p="draggable",tabIndex:h=0}=null!=i?i:{},m=(null==c?void 0:c.id)===n,b=(0,e.useContext)(m?ft:pt),[y,w]=I(),[k,x]=I(),D=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=C(r);return E((()=>(f.set(n,{id:n,key:a,node:y,activatorNode:k,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!==ht)||void 0,"aria-roledescription":p,"aria-describedby":u.draggable})),[o,g,h,m,p,u.draggable]),isDragging:m,listeners:o?void 0:D,node:y,over:v,setNodeRef:w,setActivatorNodeRef:x,transform:b}}({id:l,data:x,attributes:{...en,...r},disabled:w.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(O),K=U&&!p&&Ft(v)&&Ft(m),W=!b&&F,$=W&&K?X:null,J=K?null!=$?$:(null!=s?s:y)({rects:h,activeNodeRect:A,activeIndex:v,overIndex:m,index:k}):null,q=Ft(v)&&Ft(m)?a({id:l,items:u,activeIndex:v,overIndex:m}):k,G=null==O?void 0:O.id,Q=(0,e.useRef)({activeId:G,items:u,newIndex:q,containerId:f}),Z=u!==Q.current.items,ee=n({active:O,containerId:f,isDragging:F,isSorting:U,id:l,index:k,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 E((()=>{if(!n&&r!==s.current&&o.current){const e=i.current;if(e){const t=re(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:k,node:S,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:O,activeIndex:v,attributes:P,data:x,rect:R,index:k,newIndex:q,items:u,isOver:B,isSorting:U,isDragging:F,listeners:j,node:S,overIndex:m,over:Y,setNodeRef:H,setActivatorNodeRef:V,setDroppableNodeRef:M,setDraggableNodeRef:z,transform:null!=te?te:J,transition:te||Z&&Q.current.newIndex===k?Zt:W&&!T(_)||!d?void 0:U||ee?L.Transition.toString({...d,property:Qt}):void 0}}function nn({clientId:t}){const[n,r]=(0,o.useState)(!1),i=()=>r(!1);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(l.Button,{className:"block-delete",icon:"no-alt",iconSize:14,isBusy:n,onClick:()=>r(!0)}),n&&(0,e.createElement)(l.Modal,{title:(0,a.__)("Delete block?"),onRequestClose:i},(0,a.__)("This will remove the block from the header."),(0,e.createElement)("div",{style:{marginTop:"20px"}},(0,e.createElement)(l.Button,{isSecondary:!0,onClick:i},(0,a.__)("Cancel")),(0,e.createElement)(l.Button,{isSecondary:!0,isDestructive:!0,onClick:()=>{wp.data.dispatch("core/block-editor").removeBlock(t),i()},style:{marginLeft:"15px"}},(0,a.__)("Confirm")))))}function rn(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 on({block:t,isPreview:n=!1}){const r={};let o={};const a=(0,i.useSelect)((e=>e("core/blocks").getBlockType(t.name)),[]);if(!n){const{attributes:e,listeners:n,setNodeRef:i,transform:a,transition:l}=tn({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=i,r.style=s,o={...n,...e}}const s=At()({"visual-inner-block":!0,"visual-inner-block__preview":n});return(0,e.createElement)("div",{className:s,...r},(0,e.createElement)("div",{className:"visual-inner-block__controls"},(0,e.createElement)(rn,{...o}),(0,e.createElement)("div",null,(0,e.createElement)(Tt,{clientId:t.clientId}),(0,e.createElement)(nn,{clientId:t.clientId}))),(0,e.createElement)("div",{className:"visual-inner-block__meta"},(0,e.createElement)(l.Icon,{size:16,className:"block-icon",icon:a?.icon?.src}),(0,e.createElement)("span",{className:"visual-inner-block__name"},(()=>{const e=(0,c.get)(t,["attributes","metadata","name"],"");return""!==e?e:a.title})())))}function an(t){const{isOver:n,setNodeRef:r}=kt({id:t.clientId}),o={backgroundColor:n?"rgba(0, 124, 186, 0.05)":""},i=At()({[t.classNames]:!0,"visual-column-wrapper_is-dropping":n});return(0,e.createElement)("div",{className:i,ref:r,style:o},t.children)}function ln({blocks:t,className:n,clientId:r,showMidColumns:i=!0,type:a=""}){const l=At()({"visual-column-wrapper":!0,[`visual-column-wrapper-${n}`]:!0,"visual-column-wrapper-empty-center":!i&&"desktop"===a}),s=(0,o.useMemo)((()=>(0,c.map)(t,"clientId")),[t]);return(0,e.createElement)($t,{items:s,strategy:"off-canvas"===a?Ut:Vt},"off-canvas"!==a?(0,e.createElement)(an,{clientId:r,classNames:l},t.map((t=>(0,e.createElement)(on,{key:t.clientId,block:t})))):(0,e.createElement)(e.Fragment,null,t.map((t=>(0,e.createElement)(on,{key:t.clientId,block:t})))))}function sn({children:t,setActiveBlockData:n}){const r=e=>wp.data.select("core/block-editor").getBlockIndex(e);return(0,e.createElement)(gt,{onDragEnd:()=>n(null),onDragStart:e=>n(e.active),onDragOver:(0,c.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)}Ce.Down,Ce.Right,Ce.Up,Ce.Left;const cn=["left","center-left","center","center-right","right"],dn=[["innerBlocks",0,"innerBlocks",0,"innerBlocks"],["innerBlocks",0,"innerBlocks",1,"innerBlocks"],["innerBlocks",1,"innerBlocks"],["innerBlocks",2,"innerBlocks",0,"innerBlocks"],["innerBlocks",2,"innerBlocks",1,"innerBlocks"]],un=[["innerBlocks",0,"innerBlocks",0,"clientId"],["innerBlocks",0,"innerBlocks",1,"clientId"],["innerBlocks",1,"clientId"],["innerBlocks",2,"innerBlocks",0,"clientId"],["innerBlocks",2,"innerBlocks",1,"clientId"]],fn={top:0,middle:1,bottom:2},vn=["top","middle","bottom"],gn=({position:t,blocks:n,activeBlockData:r})=>{const o=(0,c.get)(n,[fn[t]],[]),i=(e=>cn.map(((t,n)=>({name:t,blocks:(0,c.get)(e,dn[n],[]),clientId:(0,c.get)(e,un[n],[])}))))(o),a=0===i[2].blocks.length,l=0===i[1].blocks.length&&0===i[3].blocks.length,s=null!==r&&1===i[2].blocks.length&&r.id===i[2].blocks[0].clientId,d=!a&&!s||!l,u="single"===o?.attributes?.layoutConfig;return(0,e.createElement)("div",{className:"visual-row-wrapper",key:t},(0,e.createElement)(Tt,{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)(ln,{blocks:i[0].blocks,position:t,className:"left",clientId:i[0].clientId,type:"desktop"}),(0,e.createElement)(Pt,{position:"left",clientId:i[0].clientId,showMidColumns:d}),d&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(ln,{blocks:i[1].blocks,className:"center-left",showMidColumns:d,clientId:i[1].clientId,type:"desktop"}),(0,e.createElement)(Pt,{position:"center-left",clientId:i[1].clientId}))),(0,e.createElement)("div",{className:"visual-section-wrapper visual-section-wrapper-center"},(0,e.createElement)(ln,{blocks:i[2].blocks,className:"center",clientId:i[2].clientId,type:"desktop"}),(0,e.createElement)(Pt,{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)(ln,{blocks:i[3].blocks,className:"center-right",showMidColumns:d,clientId:i[3].clientId,type:"desktop"}),(0,e.createElement)(Pt,{position:"center-right",clientId:i[3].clientId})),(0,e.createElement)(ln,{blocks:i[4].blocks,className:"right",clientId:i[4].clientId,type:"desktop"}),(0,e.createElement)(Pt,{position:"right",clientId:i[4].clientId,showMidColumns:d}))))};function pn({blocks:t}){const n=(0,o.useMemo)((()=>(0,c.get)(t,["innerBlocks"],[])),[t]),[r,i]=(0,o.useState)(null);return(0,e.createElement)("div",{className:"visual-desktop-container"},(0,e.createElement)(sn,{setActiveBlockData:i},vn.map((t=>(0,e.createElement)(gn,{key:t,position:t,blocks:n,activeBlockData:r}))),(0,e.createElement)(Ot,null,null!==r&&(0,e.createElement)(on,{block:{...r.data.current,clientId:""},isPreview:!0}))))}const hn=["top","middle","bottom"],mn=({position:t,blocks:n})=>{const r=(0,c.get)(n,[fn[t]],[]),o="single"===r?.attributes?.layoutConfig;return(0,e.createElement)("div",{className:"visual-row-wrapper",key:t},(0,e.createElement)(Tt,{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)(ln,{blocks:(0,c.get)(r,["innerBlocks",n,"innerBlocks"],[]),className:t,clientId:(0,c.get)(r,["innerBlocks",n,"clientId"],[]),showMidColumns:!1,isTablet:!0}),(0,e.createElement)(Pt,{position:t,clientId:(0,c.get)(r,["innerBlocks",n,"clientId"],[])}))))))};function bn({blocks:t}){const n=(0,o.useMemo)((()=>(0,c.get)(t,["innerBlocks"],[])),[t]),[r,i]=(0,o.useState)(null);return(0,e.createElement)("div",{className:"visual-desktop-container"},(0,e.createElement)(sn,{setActiveBlockData:i},hn.map((t=>(0,e.createElement)(mn,{key:t,position:t,blocks:n}))),(0,e.createElement)(Ot,null,null!==r&&(0,e.createElement)(on,{block:{...r.data.current,clientId:""},isPreview:!0}))))}const yn=({blocks:t,offCanvasClientId:n})=>(0,e.createElement)("div",{className:"visual-row-wrapper",key:"off-canvas"},(0,e.createElement)(Tt,{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)(ln,{blocks:t,className:"off-canvas",clientId:n,showMidColumns:!1,isTablet:!0,type:"off-canvas"}))),(0,e.createElement)(Pt,{position:"off-canvas",clientId:n}));function wn({blocks:t,topLevelBlocks:n}){const[r,i]=(0,o.useState)(null),a=(0,o.useMemo)((()=>(0,c.get)(t,["innerBlocks"],[])),[t]),l=(0,c.get)(n,[2,"clientId"],"");return(0,e.createElement)("div",{className:"visual-off-canvas-container"},(0,e.createElement)(sn,{setActiveBlockData:i},(0,e.createElement)(yn,{blocks:a,offCanvasClientId:l}),(0,e.createElement)(Ot,null,null!==r&&(0,e.createElement)(on,{block:{...r.data.current,clientId:""},isPreview:!0}))))}const kn=(0,o.createElement)(d.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(d.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),En=(0,o.createElement)(d.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(d.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function xn({position:t,setPosition:n}){const r="bottom"===t?(0,a.__)("Move to top","kadence-blocks"):(0,a.__)("Move to bottom","kadence-blocks");return(0,e.createElement)(l.Button,{className:"kb-header-visual-builder-modal-close","aria-label":r,onClick:()=>{n("bottom"===t?"top":"bottom")},variant:"secondary",icon:"bottom"===t?kn:En,iconSize:18},r)}function Cn({clientId:t,previewDevice:n,isSelected:r}){const[d,u]=(0,o.useState)(n),{setPreviewDeviceType:v,setHeaderVisualBuilderOpenId:g,setHeaderVisualBuilderOpenPosition:p,setOffCanvasOpenId:h}=(0,i.useDispatch)("kadenceblocks/data"),{selectBlock:m}=(0,i.useDispatch)("core/block-editor"),b=(e,t=null)=>{const n=(0,c.get)(t,"clientId");"off-canvas"!==e?(v((0,s.capitalizeFirstLetter)(e)),"off-canvas"===d&&(h(null),m(n))):"off-canvas"===e&&n&&(h(n),m(n)),u(e)},{topLevelBlocks:y,childSelected:w,isVisible:k,modalPosition:E}=(0,i.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,i.useSelect)((e=>e("core/edit-post").isListViewOpened()),[]);(0,o.useEffect)((()=>{const e="Mobile"===n||"Tablet"===n?"Tablet":"Desktop";d!==e&&u(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}}(y),S=(0,s.blockExists)(y,"kadence/off-canvas-trigger"),N=(0,o.useRef)(),B=(0,s.useEditorElement)(N,[n,d,x],"editor-visual-editor"),M=B?.clientWidth,O=B?.getBoundingClientRect().left,T=(0,o.useMemo)((()=>({width:M+"px",left:O+"px"})),[M,O]);return S||"off-canvas"!==d||b("Desktop",D),0===y.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&&(r||w)&&(0,e.createElement)("div",{class:"kb-header-visual-builder-teaser",style:T},(0,e.createElement)(l.Button,{isPrimary:!0,onClick:()=>C()},(0,a.__)("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)(l.Button,{className:"kb-device-tab",isPressed:"Desktop"===d,disabled:null===D,onClick:()=>b("Desktop",D)},(0,a.__)("Desktop","kadence-blocks")),(0,e.createElement)(l.Button,{className:"kb-device-tab",isPressed:"Tablet"===d,disabled:null===I,onClick:()=>b("Tablet",I)},(0,a.__)("Tablet / Mobile","kadence-blocks")),S&&(0,e.createElement)(l.Button,{className:"kb-device-tab",isPressed:"off-canvas"===d,disabled:null===R,onClick:()=>b("off-canvas",R)},(0,a.__)("Off Canvas","kadence-blocks")),(0,e.createElement)("div",{className:"modal-settings"},(0,e.createElement)(xn,{position:E,setPosition:p}),(0,e.createElement)(f,{isVisible:k,setIsVisible:C}))),(0,e.createElement)("div",{class:"content"},"Desktop"===d&&(0,e.createElement)(pn,{blocks:D}),"Tablet"===d&&(0,e.createElement)(bn,{blocks:I}),"off-canvas"===d&&(0,e.createElement)(wn,{blocks:R,topLevelBlocks:y})))),(k||!k&&(r||w))&&(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,a.__)("Introduction to your Header","kadence-blocks"),(0,a.__)("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,a.__)("documentation","kadence-blocks"),(0,a.__)(" later.","kadence-blocks"),(0,a.__)("Logo Image","kadence-blocks"),(0,a.__)("This header automatically displays your site logo. You can update it directly in the block settings.","kadence-blocks"),(0,a.__)("Manage Navigation","kadence-blocks"),(0,a.__)("You can use the Navigation (adv) block to build a new navigation or use an existing one.","kadence-blocks"),(0,a.__)("Customize CTAs","kadence-blocks"),(0,a.__)("Use Button blocks to add your Call to Actions and Social Links.","kadence-blocks"),(0,a.__)("Edit Appearance","kadence-blocks"),(0,a.__)("Customize your header's appearance by selecting the Header (adv) block and using the options in the sidebar.","kadence-blocks"),(0,a.__)("The Visual Builder","kadence-blocks"),(0,a.__)("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,a.__)("Off Canvas Trigger","kadence-blocks"),(0,a.__)("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,a.__)("Manage Off Canvas Content","kadence-blocks"),(0,a.__)('To edit your off canvas content, select the "Off Canvas" tab from the visual builder.',"kadence-blocks");const Dn=()=>{const{previewDevice:t,visualBuilderClientId:n,modalPosition:r}=(0,i.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)(Cn,{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,o.render)((0,e.createElement)(Dn,null),t)}))})(),(this.kadence=this.kadence||{})["header-visual-builder"]=r})();