File: /home/bigisxfd/public_html/old/wp-content/plugins/otter-blocks/build/animation/index.js
!function(){var e={967:function(e,t){var n;!function(){"use strict";var a={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,l(n)))}return e}function l(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)a.call(e,n)&&e[n]&&(t=i(t,n));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var l=t[a]={exports:{}};return e[a](l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var a=t.getElementsByTagName("script");if(a.length)for(var o=a.length-1;o>-1&&!e;)e=a[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e}(),function(){"use strict";var e=window.React,t=window.wp.i18n,a=window.wp.blocks,o=window.wp.blockEditor,l=window.wp.components,i=window.wp.compose,s=window.wp.element,c=window.wp.hooks,r=window.wp.data;const m=[{label:(0,t.__)("None","blocks-animation"),value:"none"},{label:(0,t.__)("Back In Down","blocks-animation"),value:"backInDown"},{label:(0,t.__)("Back In Left","blocks-animation"),value:"backInLeft"},{label:(0,t.__)("Back In Right","blocks-animation"),value:"backInRight"},{label:(0,t.__)("Back In Up","blocks-animation"),value:"backInUp"},{label:(0,t.__)("Bounce","blocks-animation"),value:"bounce"},{label:(0,t.__)("Bounce In","blocks-animation"),value:"bounceIn"},{label:(0,t.__)("Bounce In Down","blocks-animation"),value:"bounceInDown"},{label:(0,t.__)("Bounce In Left","blocks-animation"),value:"bounceInLeft"},{label:(0,t.__)("Bounce In Right","blocks-animation"),value:"bounceInRight"},{label:(0,t.__)("Bounce In Up","blocks-animation"),value:"bounceInUp"},{label:(0,t.__)("Fade In","blocks-animation"),value:"fadeIn"},{label:(0,t.__)("Fade In Down","blocks-animation"),value:"fadeInDown"},{label:(0,t.__)("Fade In Down Big","blocks-animation"),value:"fadeInDownBig"},{label:(0,t.__)("Fade In Left","blocks-animation"),value:"fadeInLeft"},{label:(0,t.__)("Fade In Left Big","blocks-animation"),value:"fadeInLeftBig"},{label:(0,t.__)("Fade In Right","blocks-animation"),value:"fadeInRight"},{label:(0,t.__)("Fade In Right Big","blocks-animation"),value:"fadeInRightBig"},{label:(0,t.__)("Fade In Up","blocks-animation"),value:"fadeInUp"},{label:(0,t.__)("Fade In Top Left","blocks-animation"),value:"fadeInTopLeft"},{label:(0,t.__)("Fade In Top Right","blocks-animation"),value:"fadeInTopRight"},{label:(0,t.__)("Fade In Bottom Left","blocks-animation"),value:"fadeInBottomLeft"},{label:(0,t.__)("Fade In Bottom Right","blocks-animation"),value:"fadeInBottomRight"},{label:(0,t.__)("Flip","blocks-animation"),value:"flip"},{label:(0,t.__)("Flip In X","blocks-animation"),value:"flipInX"},{label:(0,t.__)("Flip In Y","blocks-animation"),value:"flipInY"},{label:(0,t.__)("Rotate In","blocks-animation"),value:"rotateIn"},{label:(0,t.__)("Rotate In Down Left","blocks-animation"),value:"rotateInDownLeft"},{label:(0,t.__)("Rotate In Down Right","blocks-animation"),value:"rotateInDownRight"},{label:(0,t.__)("Rotate In Up Left","blocks-animation"),value:"rotateInUpLeft"},{label:(0,t.__)("Rotate In Up Right","blocks-animation"),value:"rotateInUpRight"},{label:(0,t.__)("Slide In Down","blocks-animation"),value:"slideInDown"},{label:(0,t.__)("Slide In Left","blocks-animation"),value:"slideInLeft"},{label:(0,t.__)("Slide In Right","blocks-animation"),value:"slideInRight"},{label:(0,t.__)("Slide In Up","blocks-animation"),value:"slideInUp"},{label:(0,t.__)("Zoom In","blocks-animation"),value:"zoomIn"},{label:(0,t.__)("Zoom In Down","blocks-animation"),value:"zoomInDown"},{label:(0,t.__)("Zoom In Left","blocks-animation"),value:"zoomInLeft"},{label:(0,t.__)("Zoom In Right","blocks-animation"),value:"zoomInRight"},{label:(0,t.__)("Zoom In Up","blocks-animation"),value:"zoomInUp"},{label:(0,t.__)("Roll In","blocks-animation"),value:"rollIn"},{label:(0,t.__)("Light Speed In Right","blocks-animation"),value:"lightSpeedInRight"},{label:(0,t.__)("Light Speed In Left","blocks-animation"),value:"lightSpeedInLeft"},{label:(0,t.__)("Flash","blocks-animation"),value:"flash"},{label:(0,t.__)("Pulse","blocks-animation"),value:"pulse"},{label:(0,t.__)("Rubber Band","blocks-animation"),value:"rubberBand"},{label:(0,t.__)("Shake X","blocks-animation"),value:"shakeX"},{label:(0,t.__)("Shake Y","blocks-animation"),value:"shakeY"},{label:(0,t.__)("Head Shake","blocks-animation"),value:"headShake"},{label:(0,t.__)("Swing","blocks-animation"),value:"swing"},{label:(0,t.__)("TaDa","blocks-animation"),value:"tada"},{label:(0,t.__)("Wobble","blocks-animation"),value:"wobble"},{label:(0,t.__)("Jello","blocks-animation"),value:"jello"},{label:(0,t.__)("Heart Beat","blocks-animation"),value:"heartBeat"},{label:(0,t.__)("Hinge","blocks-animation"),value:"hinge"},{label:(0,t.__)("Jack In The Box","blocks-animation"),value:"jackInTheBox"}],u=[{label:(0,t.__)("Backing","blocks-animation"),value:"backInDown"},{label:(0,t.__)("Bouncing","blocks-animation"),value:"bounce"},{label:(0,t.__)("Fading","blocks-animation"),value:"fadeIn"},{label:(0,t.__)("Flipping","blocks-animation"),value:"flip"},{label:(0,t.__)("Rotating","blocks-animation"),value:"rotateIn"},{label:(0,t.__)("Sliding","blocks-animation"),value:"slideInDown"},{label:(0,t.__)("Zooming","blocks-animation"),value:"zoomIn"},{label:(0,t.__)("Rolling","blocks-animation"),value:"rollIn"},{label:(0,t.__)("Light Speed","blocks-animation"),value:"lightSpeedInRight"},{label:(0,t.__)("Other","blocks-animation"),value:"flash"}],d=["backOutDown","backOutLeft","backOutRight","backOutUp","bounceOut","bounceOutDown","bounceOutLeft","bounceOutRight","bounceOutUp","fadeOut","fadeOutDown","fadeOutDownBig","fadeOutLeft","fadeOutLeftBig","fadeOutRight","fadeOutRightBig","fadeOutUp","fadeOutUpBig","fadeOutTopLeft","fadeOutTopRight","fadeOutBottomRight","fadeOutBottomLeft","flipOutX","flipOutY","lightSpeedOutRight","lightSpeedOutLeft","rotateOut","rotateOutDownLeft","rotateOutDownRight","rotateOutUpLeft","rotateOutUpRight","slideOutDown","slideOutLeft","slideOutRight","slideOutUp","zoomOut","zoomOutDown","zoomOutLeft","zoomOutRight","zoomOutUp","rollOut"],b=[{label:(0,t.__)("None","blocks-animation"),value:"none"},{label:(0,t.__)("100 Milliseconds","blocks-animation"),value:"delay-100ms"},{label:(0,t.__)("200 Milliseconds","blocks-animation"),value:"delay-200ms"},{label:(0,t.__)("500 Milliseconds","blocks-animation"),value:"delay-500ms"},{label:(0,t.__)("One Second","blocks-animation"),value:"delay-1s"},{label:(0,t.__)("Two Second","blocks-animation"),value:"delay-2s"},{label:(0,t.__)("Three Second","blocks-animation"),value:"delay-3s"},{label:(0,t.__)("Four Second","blocks-animation"),value:"delay-4s"},{label:(0,t.__)("Five Second","blocks-animation"),value:"delay-5s"},{label:(0,t.__)("Custom","blocks-animation"),value:"o-anim-custom-delay"}],p=[{label:(0,t.__)("Slow","blocks-animation"),value:"slow"},{label:(0,t.__)("Slower","blocks-animation"),value:"slower"},{label:(0,t.__)("Default","blocks-animation"),value:"none"},{label:(0,t.__)("Fast","blocks-animation"),value:"fast"},{label:(0,t.__)("Faster","blocks-animation"),value:"faster"},{label:(0,t.__)("Custom","blocks-animation"),value:"o-anim-custom-speed"}];var _=function n({animationsList:a,updateAnimation:o,currentAnimationLabel:c,setCurrentAnimationLabel:r}){const m=(0,i.useInstanceId)(n),[d,b]=(0,s.useState)(""),[p,_]=(0,s.useState)(!1),f=`inspector-o-animations-control-${m}`;return(0,e.createElement)(l.BaseControl,{label:(0,t.__)("Animation","blocks-animation"),id:f},(0,e.createElement)(l.Dropdown,{contentClassName:"o-animations-control__popover",position:"bottom center",renderToggle:({isOpen:t,onToggle:n})=>(0,e.createElement)(l.Button,{className:"o-animations-control__button",id:f,onClick:n,"aria-expanded":t},c),renderContent:({onToggle:n})=>(0,e.createElement)(l.MenuGroup,{label:(0,t.__)("Animations","blocks-animation")},(0,e.createElement)(l.TextControl,{placeholder:(0,t.__)("Search","blocks-animation"),value:d,onChange:e=>{b(e),_(!1)}}),(0,e.createElement)("div",{className:"components-popover__items"},a.map(((t,a)=>(0,e.createElement)(s.Fragment,{key:a},""===d&&u.map(((n,a)=>n.value===t.value?(0,e.createElement)("div",{key:a,className:"o-animations-control__category"},n.label):"")),((t,n)=>{let a=!0;return d&&d.toLowerCase().split(" ").forEach((e=>{t.label.toLowerCase().includes(e)||(a=!1)})),a&&!p&&_(!0),a&&(0,e.createElement)(l.MenuItem,{className:c===t.label?"is-selected":"",onClick:()=>{r(t.label),o(t.value),n()}},t.label)})(t,n)))),!p&&(0,e.createElement)("div",null,(0,t.__)("Nothing found. Try searching for something else!","blocks-animation"))))}))},f=n(967),v=n.n(f),g=(0,s.forwardRef)((function({icon:e,size:t=24,...n},a){return(0,s.cloneElement)(e,{width:t,height:t,...n,ref:a})})),k=window.wp.primitives,h=(0,e.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(k.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"})),w=(0,e.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(k.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,e.createElement)(k.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"}));const I=({label:n,attributes:a,setAttributes:o,resetValues:c,onClick:r,children:m})=>{(0,s.useEffect)((()=>{for(const e in c){if(c[e]!==a[e])return b(!0);b(!1)}}),[a]);const u=(0,i.useInstanceId)(I),[d,b]=(0,s.useState)(!1),p=`inspector-control-panel-control-${u}`;return(0,e.createElement)("div",{className:"o-control-panel-control"},(0,e.createElement)("div",{className:"components-base-control__field"},(0,e.createElement)("div",{className:"components-base-control__title"},(0,e.createElement)("label",{className:"components-base-control__label",htmlFor:p},n),(0,e.createElement)("div",{className:"floating-controls"},(0,e.createElement)(l.Dropdown,{position:"top left",headerTitle:n,expandOnMobile:!0,renderToggle:({isOpen:a,onToggle:i})=>(0,e.createElement)(s.Fragment,null,d&&(0,e.createElement)(l.Button,{icon:(0,e.createElement)(g,{icon:h}),label:(0,t.__)("Reset to default","blocks-animation"),showTooltip:!0,isTertiary:!0,onClick:()=>o({...c})}),(0,e.createElement)(l.Button,{id:p,icon:w,label:n,showTooltip:!0,onClick:()=>{i(),r&&r()},"aria-expanded":a,className:v()({"is-active":d})})),renderContent:()=>(0,e.createElement)("div",{className:"otter-popover-settings"},m)})))))};var y=I,E=n.p+"images/count-animation.1151d25d.png",S=n.p+"images/typing-animation.d84cccd1.png",B={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let R;const N=new Uint8Array(16);function C(){if(!R&&(R="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!R))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return R(N)}const O=[];for(let e=0;e<256;++e)O.push((e+256).toString(16).slice(1));var A,T,L,D,x=function(e,t,n){if(B.randomUUID&&!t&&!e)return B.randomUUID();const a=(e=e||{}).random||(e.rng||C)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=a[e];return t}return function(e,t=0){return O[e[t+0]]+O[e[t+1]]+O[e[t+2]]+O[e[t+3]]+"-"+O[e[t+4]]+O[e[t+5]]+"-"+O[e[t+6]]+O[e[t+7]]+"-"+O[e[t+8]]+O[e[t+9]]+"-"+O[e[t+10]]+O[e[t+11]]+O[e[t+12]]+O[e[t+13]]+O[e[t+14]]+O[e[t+15]]}(a)},F=window.lodash;null!==(T=(A=window).themeisleGutenberg)&&void 0!==T||(A.themeisleGutenberg={}),null!==(D=(L=window.themeisleGutenberg).blockIDs)&&void 0!==D||(L.blockIDs=[]);const{getBlock:U}=(0,r.select)("core/block-editor"),{getBlockParents:$}=(0,r.select)("core/block-editor"),{updateBlockAttributes:z}=(0,r.dispatch)("core/block-editor"),{getSelectedBlockClientId:M}=(0,r.select)("core/block-editor"),P="default",j=(e,t,n,a,o,l)=>{var i;let s;switch(e){case"count":s="o-count-";break;case"typing":s="o-typing-";break;case P:s=""}null!==(i=t)&&void 0!==i||(t="");const c=s+t,r="none"!==n?s+n:"";let m;if(o.className){m=o.className,m=m.split(" ");const e=m.find((e=>e===c));if((t.startsWith("o-anim-value-delay-")||t.startsWith("o-anim-value-speed-")||t.startsWith("o-anim-offset-"))&&(m=m.filter((e=>!e.includes(t)))),"o-anim-custom-delay"===t||"o-anim-custom-speed"===t){const e="o-anim-custom-delay"===t?"o-anim-value-delay-":"o-anim-value-speed-";m=m.filter((t=>!t.includes(e)))}e?m=m.join(" ").replace(c,r):(m.push(r),m=m.join(" ").trim())}else m=r;m=m.replace(/\s+/g," "),""===m&&(m=void 0),l({className:m}),a?.()};var V=(0,s.memo)((function({clientId:n,attributes:a,setAttributes:o}){const[i,r]=(0,s.useState)("none"),[u,f]=(0,s.useState)("none"),[v,g]=(0,s.useState)("none"),[k,h]=(0,s.useState)((0,t.__)("None","blocks-animation")),[w,I]=(0,s.useState)(0),[B,R]=(0,s.useState)(0),[N,C]=(0,s.useState)(!1),[O,A]=(0,s.useState)(""),[T,L]=(0,s.useState)("0px"),[D,U]=((e={})=>{const[t,n]=(0,s.useState)({css:[],media:[]}),[a,o]=(0,s.useState)({node:null,cssNodeName:""});return(0,s.useEffect)((()=>{var t;let n;const a=document.createElement("style");return a.type="text/css",a.setAttribute("data-generator","otter-blocks"),setTimeout((()=>{n=parent.document.querySelector('iframe[name="editor-canvas"]')?.contentWindow.document.head||document.head,n?.appendChild(a)}),500),o({node:a,cssNodeName:null!==(t=e?.selector)&&void 0!==t?t:`o-node-${x()}`}),()=>{n?.removeChild(a)}}),[]),(0,s.useEffect)((()=>{if(a.node&&a.cssNodeName&&void 0!==t.media){const n=(0,F.zip)(t.css,t.media).map((t=>{const[n,o]=t;return o?`${o} { \n\t .${a.cssNodeName}${e?.appendToRoot?"":" "}${n} }`:`.${a.cssNodeName}${e?.appendToRoot?"":" "}${n}`})).join("\n")||"";a.node.textContent=n}}),[t.css,t.media,a.node,a.cssNodeName]),[a.cssNodeName,(e=[],t=[])=>{n({css:e,media:t})},o]})({selector:"animated",appendToRoot:!0}),$=e=>{let t;const l="none"!==e?e:"";if(a.className){t=a.className,t=t.split(" ");const e=t.find((e=>e===i));t.find((e=>"animated"===e))||t.push("animated"),e?t=t.join(" ").replace(i,l):(t.push(l),t=t.join(" "))}else t=`animated ${l}`;"none"===e&&(t=t.replace("animated","").replace(u,"").replace(v,""),f("none"),g("none")),t=t.replace(/\s+/g," ").trim(),""===t&&(t=void 0),r(e),o({className:t});const s=document.querySelector(`#block-${n} .animated`)||document.querySelector(`#block-${n}.animated`);s&&d.forEach((e=>{s.className.includes(e)&&s.addEventListener("animationend",(()=>{s.classList.remove(e),s.addEventListener("animationstart",(()=>{s.classList.remove(e)}))}))}))};return(0,s.useEffect)((()=>{void 0!==window?.blocksAnimation&&(window.blocksAnimation.removeAnimation=()=>$("none"))}),[]),(0,s.useEffect)((()=>{var e;U(null!==(e=a.className?.split(" ").map((e=>e.includes("o-anim-value-delay-")?`.${e} { animation-delay: ${e.replace("o-anim-value-delay-","")}; --webkit-animation-delay: ${e.replace("o-anim-value-delay-","")}; }`:e.includes("o-anim-value-speed-")?`.${e} { animation-duration: ${e.replace("o-anim-value-speed-","")}; --webkit-animation-duration: ${e.replace("o-anim-value-speed-","")}; }`:"")).filter((e=>e)))&&void 0!==e?e:"")}),[a.className]),(0,s.useEffect)((()=>{let e;if(a.className){e=a.className,e=e.split(" ");const t=Array.from(m).find((t=>e.find((e=>e===t.value)))),n=Array.from(b).find((t=>e.find((e=>e===t.value)))),o=Array.from(p).find((t=>e.find((e=>e===t.value))));let l=e.find((e=>e.includes("o-anim-value-delay")));l&&(l=l.replace("o-anim-value-delay-",""),l.match(/^[0-9]+(ms|s)$/)||(l=void 0));let i=e.find((e=>e.includes("o-anim-value-speed")));i&&(i=i.replace("o-anim-value-speed-",""),i.match(/^[0-9]+(ms|s)$/)||(i=void 0));let s=e.find((e=>e.includes("o-anim-offset-")));s&&(s=s.replace("o-anim-offset-",""),s.match(/^[0-9]+(px|%)$/)||(s="0px"));const c=e.find((e=>e.includes("o-anim-hover")));r(t?t.value:"none"),f(n?n.value:"none"),g(o?o.value:"none"),I(l||0),R(i||0),C(!!c),h(t?t.label:"none"),A(s?`o-anim-offset-${s}`:""),L(s||"0px")}}),[]),(0,s.useEffect)((()=>{O&&T&&O!==`o-anim-offset-${T}`&&j(P,"o-anim-offset-",T?`o-anim-offset-${T}`:"",(()=>A(`o-anim-offset-${T}`)),a,o)}),[T,O]),(0,e.createElement)(l.PanelBody,{title:(0,t.__)("Animations","blocks-animation"),initialOpen:!1},(0,e.createElement)("div",{className:"o-animations-control"},(0,e.createElement)(_,{animationsList:m,updateAnimation:$,currentAnimationLabel:k,setCurrentAnimationLabel:h}),"none"!==i&&(0,e.createElement)(s.Fragment,null,(0,e.createElement)(l.SelectControl,{label:(0,t.__)("Delay","blocks-animation"),value:u||"none",options:b,onChange:e=>j(P,u,e,(()=>f(e)),a,o)}),"o-anim-custom-delay"===u&&(0,e.createElement)(l.__experimentalUnitControl,{label:(0,t.__)("Value","blocks-animation"),value:w,onChange:e=>j(P,"o-anim-value-delay-",e?`o-anim-value-delay-${e}`:void 0,(()=>I(e)),a,o),min:0,step:.1,allowReset:!0,units:[{label:(0,t.__)("S","blocks-animation"),value:"s"},{label:(0,t.__)("MS","blocks-animation"),value:"ms"}]}),(0,e.createElement)(l.SelectControl,{label:(0,t.__)("Speed","blocks-animation"),value:v||"none",options:p,onChange:e=>j(P,v,e,(()=>g(e)),a,o)}),"o-anim-custom-speed"===v&&(0,e.createElement)(l.__experimentalUnitControl,{label:(0,t.__)("Value","blocks-animation"),value:B,onChange:e=>j(P,"o-anim-value-speed-",`o-anim-value-speed-${e}`,(()=>R(e)),a,o),min:0,step:.1,allowReset:!0,units:[{label:(0,t.__)("S","blocks-animation"),value:"s"},{label:(0,t.__)("MS","blocks-animation"),value:"ms"}]}),(0,e.createElement)(l.ToggleControl,{label:(0,t.__)("Play on Hover","blocks-animation"),checked:N,onChange:e=>j(P,"o-anim-hover",e?"o-anim-hover":"",(()=>C(e)),a,o)}),(0,e.createElement)(l.ToggleControl,{label:(0,t.__)("Trigger Offset","blocks-animation"),checked:Boolean(O),onChange:e=>j(P,"o-anim-offset-0px",e?"o-anim-offset-0px":"",(()=>{A(e?"o-anim-offset-0px":""),L(e?"o-anim-offset-0px":"")}),a,o),help:(0,t.__)("This will offset the trigger of animation relative to the screen.","blocks-animation")}),Boolean(O)&&(0,e.createElement)(l.__experimentalUnitControl,{label:(0,t.__)("Height Trigger Offset","blocks-animation"),value:T,onChange:L,step:.1,allowReset:!0,units:[{label:(0,t.__)("px","blocks-animation"),value:"px"},{label:(0,t.__)("%","blocks-animation"),value:"%"}],help:T?.endsWith("%")?(0,t.__)("Is the percentage of the screen height. E.g: with 50% the animation will trigger after passing the middle of screen.","blocks-animation"):""}),(0,e.createElement)(l.Button,{variant:"secondary",onClick:()=>{let e=a.className;e=e.replace(i,"o-replay"),o({className:e}),setTimeout((()=>o({className:e.replace("o-replay",i)})),100)}},(0,t.__)("Replay Animation","blocks-animation")))),(0,e.createElement)(y,{label:(0,t.__)("Count Animations","blocks-animation")},(0,e.createElement)("img",{src:S,alt:(0,t.__)("Using Count Animation in the Block Editor","blocks-animation"),className:"otter-animations-count-image"}),(0,e.createElement)("p",null,(0,t.__)("You can add counting animation from the format toolbar of this block.","blocks-animation")),(0,e.createElement)("p",null,(0,t.__)("Note: This feature is not available in all the blocks.","blocks-animation"))),(0,e.createElement)(y,{label:(0,t.__)("Typing Animations","blocks-animation")},(0,e.createElement)("img",{src:E,alt:(0,t.__)("Using Typing Animation in the Block Editor","blocks-animation"),className:"otter-animations-count-image"}),(0,e.createElement)("p",null,(0,t.__)("You can add typing animation from the format toolbar of this block.","blocks-animation")),(0,e.createElement)("p",null,(0,t.__)("Note: This feature is not available in all the blocks.","blocks-animation"))),(0,e.createElement)("div",{className:"o-fp-wrap"},(0,c.applyFilters)("otter.feedback","","animations"),(0,c.applyFilters)("otter.poweredBy","")))})),H=(0,e.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(k.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})),G=window.wp.richText;const Y=b.filter((e=>"o-anim-custom-delay"!==e.value)),W=p.filter((e=>"o-anim-custom-speed"!==e.value));var Z=({value:n,contentRef:a})=>{(0,s.useEffect)((()=>{let e;if(i.className){e=i.className,e=e.split(" ");const t=Array.from(Y).find((t=>e.find((e=>e===`o-count-${t.value}`)))),n=Array.from(W).find((t=>e.find((e=>e===`o-count-${t.value}`))));b(t?t.value:"none"),_(n?n.value:"none")}}),[]);const{clientId:o,attributes:i}=(0,r.useSelect)((e=>{const{getSelectedBlock:t}=e("core/block-editor"),n=t();return{clientId:n?.clientId,attributes:n?.attributes}}),[]),{updateBlockAttributes:m}=(0,r.useDispatch)("core/block-editor"),u=e=>m(o,e),[d,b]=(0,s.useState)("none"),[p,_]=(0,s.useState)("none"),f=(0,G.useAnchorRef)({ref:a,value:n,settings:q});return(0,e.createElement)(l.Popover,{position:"bottom center right",placement:"bottom",noArrow:!1,anchor:f,anchorRef:f,focusOnMount:!1,className:"o-animation-popover"},(0,e.createElement)(l.__experimentalHeading,{level:4},(0,t.__)("Count Animation","blocks-animation")),(0,e.createElement)(l.SelectControl,{label:(0,t.__)("Delay","blocks-animation"),value:d||"none",options:Y,onChange:e=>j("count",d,e,(()=>b(e)),i,u)}),(0,e.createElement)(l.SelectControl,{label:(0,t.__)("Speed","blocks-animation"),value:p||"none",options:W,onChange:e=>j("count",p,e,(()=>_(e)),i,u)}),(0,c.applyFilters)("otter.poweredBy",""))};const X="themeisle-blocks/count-animation",q={name:X,title:(0,t.__)("Count Animation","blocks-animation"),tagName:"o-anim-count",className:null,edit:({isActive:n,value:a,onChange:l,contentRef:i})=>{const c=/^\$?[\d,]+(\.\d*)?$/;return(0,e.createElement)(s.Fragment,null,(0,e.createElement)(o.RichTextToolbarButton,{icon:H,title:(0,t.__)("Count Animation","blocks-animation"),isDisabled:!n&&null===c.exec(a.text.substring(a.start,a.end)),onClick:()=>{(n||!n&&null!==c.exec(a.text.substring(a.start,a.end)))&&l((0,G.toggleFormat)(a,{type:X}))},isActive:n}),n&&(0,e.createElement)(Z,{value:a,contentRef:i}))}};(0,G.registerFormatType)(X,q);const J=b.filter((e=>"o-anim-custom-delay"!==e.value)),K=p.filter((e=>"o-anim-custom-speed"!==e.value));var Q=({value:n,contentRef:a})=>{(0,s.useEffect)((()=>{let e;if(i.className){e=i.className,e=e.split(" ");const t=Array.from(J).find((t=>e.find((e=>e===`o-typing-${t.value}`)))),n=Array.from(K).find((t=>e.find((e=>e===`o-typing-${t.value}`))));b(t?t.value:"none"),_(n?n.value:"none")}}),[]);const{clientId:o,attributes:i}=(0,r.useSelect)((e=>{const{getSelectedBlock:t}=e("core/block-editor"),n=t();return{clientId:n?.clientId,attributes:n?.attributes}}),[]),{updateBlockAttributes:m}=(0,r.useDispatch)("core/block-editor"),u=e=>m(o,e),[d,b]=(0,s.useState)("none"),[p,_]=(0,s.useState)("none"),f=(0,G.useAnchorRef)({ref:a,value:n,settings:te});return(0,e.createElement)(l.Popover,{position:"bottom center right",placement:"bottom",noArrow:!1,anchor:f,anchorRef:f,focusOnMount:!1,className:"o-animation-popover"},(0,e.createElement)(l.__experimentalHeading,{level:4},(0,t.__)("Typing Animation","blocks-animation")),(0,e.createElement)(l.SelectControl,{label:(0,t.__)("Delay","blocks-animation"),value:d||"none",options:J,onChange:e=>j("typing",d,e,(()=>b(e)),i,u)}),(0,e.createElement)(l.SelectControl,{label:(0,t.__)("Speed","blocks-animation"),value:p||"none",options:K,onChange:e=>j("typing",p,e,(()=>_(e)),i,u)}),(0,c.applyFilters)("otter.poweredBy",""))};const ee="themeisle-blocks/typing-animation",te={name:ee,title:(0,t.__)("Typing Animation","blocks-animation"),tagName:"o-anim-typing",className:null,edit:({isActive:n,value:a,onChange:l,contentRef:i})=>(0,e.createElement)(s.Fragment,null,(0,e.createElement)(o.RichTextToolbarButton,{icon:H,title:(0,t.__)("Typing Animation","blocks-animation"),onClick:()=>{l((0,G.toggleFormat)(a,{type:ee}))},isActive:n}),n&&(0,e.createElement)(Q,{value:a,contentRef:i}))};(0,G.registerFormatType)(ee,te);const ne=["themeisle-blocks/popup"],ae=(0,i.createHigherOrderComponent)((t=>n=>(0,a.hasBlockSupport)(n.name,"customClassName",!0)&&n.isSelected&&!ne.includes(n.name)?(0,e.createElement)(s.Fragment,null,(0,e.createElement)(t,{...n}),(0,e.createElement)(o.InspectorControls,null,(0,e.createElement)(V,{...n}))):(0,e.createElement)(t,{...n})),"withInspectorControl");Boolean(window?.blocksAnimation?.hasOtter)?(0,c.addFilter)("otter.blockTools","themeisle-animations/with-inspector-controls",((n,o)=>{if((0,a.hasBlockSupport)(o.name,"customClassName",!0)&&!ne.includes(o.name)){var i;const a=Boolean(null===(i=(0,r.select)("core/preferences")?.get("themeisle/otter-blocks","show-animations"))||void 0===i||i);return(0,e.createElement)(s.Fragment,null,n,(0,e.createElement)(l.__experimentalToolsPanelItem,{hasValue:()=>Boolean(o?.attributes?.className?.includes("animated")),label:(0,t.__)("Animations","blocks-animation"),onDeselect:()=>window?.blocksAnimation?.removeAnimation(),isShownByDefault:a},(0,e.createElement)(V,{...o})))}return n}),1):(0,c.addFilter)("editor.BlockEdit","themeisle-animations/with-inspector-controls",ae)}()}();