(()=>{"use strict";var e={1669(e){e.exports=jQuery}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,o),r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n=o(1669),i=o.n(n);function r(e=document){try{if("editor-canvas"===window.frameElement?.getAttribute?.("name"))return!0}catch(e){}const t=e?.body;return!!t&&(!!t.classList.contains("wp-admin")||(!!t.classList.contains("block-editor-iframe__body")||!!t.classList.contains("editor-styles-wrapper")))}document.addEventListener("DOMContentLoaded",function(){s.init()}),window.addEventListener("resize",function(){s.init()});const s={init:function(e){this.holder=document.querySelectorAll(".qi-block-timeline"),this.holder.length&&[...this.holder].map(t=>{s.initItem(t,e)})},getRealCurrentItem:function(e){return"string"==typeof e&&""!==e&&(e=qiBlocksEditor.qodefGetCurrentBlockElement.get(e)),e},initItem:function(e,t){if(!(e=s.getRealCurrentItem(e)))return;const o="object"!=typeof qiBlocksEditor?qiBlocks:qiBlocksEditor;t&&e.classList.remove("qodef--appeared"),o.qodefWaitForImages.check(e,function(){setTimeout(()=>{s.initLogic(e),"mount"===t&&setTimeout(()=>{qiBlocksEditor.qodefGetCurrentBlockElement.getCurrentDocument().body.addEventListener("qi_frame_resized",()=>{s.initLogic(e)})},600),o.qodefIsInViewport.check(e,function(){e.classList.add("qodef--appeared")})},t?800:0)})},initLogic:function(e){const t=e.querySelector(".qodef-timeline-inner");if(e.classList.contains("qodef-timeline--horizontal")){let o=(r()?qiBlocksEditor.qodefGetCurrentBlockElement.getCurrentDocument():document).body,n=e.querySelectorAll(".qodef-e-item"),i=parseInt(e.offsetWidth,10),l=n?n.length:0,a=0,c=0,d=JSON.parse(e.getAttribute("data-options"));l>1&&(a=e.classList.contains("qodef-responsive--predefined")?i/parseInt(d.colNum,10):r()?o.classList.contains("qi-preview-screen-tablet")?i/parseInt(d.colNum1024,10):o.classList.contains("qi-preview-screen-mobile")?i/parseInt(d.colNum480,10):i/parseInt(d.colNum,10):qiBlocks.windowWidth>1440?i/parseInt(d.colNum,10):qiBlocks.windowWidth>1366?i/parseInt(d.colNum1440,10):qiBlocks.windowWidth>1024?i/parseInt(d.colNum1366,10):qiBlocks.windowWidth>768?i/parseInt(d.colNum1024,10):qiBlocks.windowWidth>680?i/parseInt(d.colNum768,10):qiBlocks.windowWidth>480?i/parseInt(d.colNum680,10):i/parseInt(d.colNum480,10),c=a*l,e.setAttribute("data-movement",a),e.setAttribute("data-moved",0),t.style.width=c+"px",t.style.transform="translateX(0)",s.initHeight(e),s.initMovement(e))}else t.style.width="auto",t.style.transform="none",s.initHeight(e)},initMovement:function(e){let t=parseInt(e.getAttribute("data-movement"),10),o=e.querySelector(".qodef-timeline-inner"),n=parseInt(e.offsetWidth,10),r=o?parseInt(o.clientWidth,10):0,s=e.querySelector(".qodef-nav-prev"),l=e.querySelector(".qodef-nav-next");i()(s).off().on("click",n=>{n.preventDefault();const i=parseFloat(e.getAttribute("data-moved"));if(i<-1){const n=i+t;o.style.transform="translateX( "+n+"px)",e.setAttribute("data-moved",n)}}),i()(l).off().on("click",i=>{i.preventDefault();const s=parseFloat(e.getAttribute("data-moved"));if(r-n+1>-s+t){const n=s-t;o.style.transform="translateX( "+n+"px)",e.setAttribute("data-moved",n)}})},initHeight:function(e){let t=e.querySelectorAll(".qodef-e-item"),o=0,n=0;if(t.length&&(t.forEach(t=>{const i=t.querySelector(".qodef-e-content-holder"),r=t.querySelector(".qodef-e-top-holder");r&&i&&(i.style.height="auto",r.style.height="auto");let s=i?parseInt(window.getComputedStyle(i).getPropertyValue("height"),10):0,l=r?parseInt(window.getComputedStyle(r).getPropertyValue("height"),10):0;e.classList.contains("qodef-timeline-layout--horizontal-standard")?(l>o&&(o=l),s>n&&(n=s)):e.classList.contains("qodef-timeline-layout--horizontal-alternating")&&(s<l&&(s=l),s>n&&(n=s))}),t.forEach(t=>{let i=t.querySelector(".qodef-e-content-holder"),r=t.querySelector(".qodef-e-top-holder"),s=t.querySelector(".qodef-e-line-holder");e.classList.contains("qodef-timeline-layout--horizontal-standard")?(r&&(r.style.height=o+"px"),i&&(i.style.height=n+"px"),s&&(s.style.top=o+"px")):e.classList.contains("qodef-timeline-layout--horizontal-alternating")&&(r&&(r.style.height=n+"px"),i&&(i.style.height=n+"px"))})),e.classList.contains("qodef-timeline-layout--horizontal-standard")){let t=e.querySelector(".qodef-nav-prev"),n=e.querySelector(".qodef-nav-next");t&&(t.style.top=o+"px"),n&&(n.style.top=o+"px")}}}})();