class LiquidTypewriterBehavior extends LiquidBehavior{static behaviorName="liquidTypewriter";options(){return{loop:!1,delay:"natural",deleteSpeed:"natural",actions:[]}}get ui(){return{writer:".lqd-tw-writer"}}initialize(){this.isDestroyed||(this.buildTypewriter(),this.addTypewriterActions(),this.buildIO())}buildTypewriter(){this.typewriter=new Typewriter(this.getUI("writer")[0],{wrapperClassName:"lqd-tw-wrapper",cursorClassName:"lqd-tw-cursor inline-block",delay:this.getOption("delay"),deleteSpeed:this.getOption("deleteSpeed"),loop:this.getOption("loop")})}addTypewriterActions(){this.getOption("actions").forEach(i=>{this.typewriter[i[0]](i[1])})}buildIO(){this.IO=new IntersectionObserver(([e])=>{this.isDestroyed||(e.isIntersecting?this.typewriter.start():this.typewriter.stop())}),this.IO.observe(this.view.el)}destroy(){this.IO&&this.IO.disconnect(),super.destroy()}}typeof window<"u"&&(window.liquid?.app?window.liquid?.app?.model?.set("loadedBehaviors",[...window.liquid.app.model.get("loadedBehaviors"),LiquidTypewriterBehavior]):window.liquid?.loadedBehaviors?.push(LiquidTypewriterBehavior));
