Socket
Socket
Sign inDemoInstall

typeit

Package Overview
Dependencies
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeit - npm Package Compare versions

Comparing version 7.0.0-rc8 to 7.0.0-rc9

4

dist/typeit.es.min.js
/**
* TypeIt - The most versatile animated typing utility on the planet.
* Author: Alex MacArthur <alex@macarthur.me> (https://macarthur.me)
* Version: v7.0.0-rc8
* Version: v7.0.0-rc9
* License: GPL-2.0
* URL: https://typeitjs.com
*/
var e={strings:[],speed:100,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,lifeLike:!0,breakLines:!0,startDelay:250,startDelete:!1,nextStringDelay:750,loop:!1,loopDelay:750,html:!0,waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},t=e=>e.map(e=>(void 0===e[1]&&e.push(null),void 0===e[2]&&e.push({}),e)),n=(e,t)=>Object.assign({},e,t),r=e=>Array.isArray(e),i=(e,t)=>(e[2]=n(e[2],t)||t,e),o=(e,t)=>r(e[0])?e.map(e=>i(e,t)):i(e,t),a=(e,t,n,i)=>{i=i||!1,n=n||{};var a=!r(e),u=e.length;return(e=a?new Array(e).fill(0):e).map((e,r)=>{if(a)return t;var s=[t,e,n];return i&&(0===r&&(s=o(s,{isFirst:!0})),r+1===u&&(s=o(s,{isLast:!0}))),s})};function u(e){this.insert=function(e,t){n.splice(e,0,t)},this.add=function(e,t,i){return e=r(e)?e:[e,null],i=i||!1,t=t||1,r(e[0])||(e=a(t,e)),n=i?e.concat(n):n.concat(e),this},this.delete=function(e){return n.splice(e,1),this},this.reset=function(){return n=t(n).map(e=>(e[2].executed=!1,e)),this},this.getItems=function(){return t(n).filter(e=>!e.executed)};var n=[];e&&this.add(e)}var s=e=>Array.from(e),c=e=>{var t=[];return t.concat.apply(t,e)},l=e=>{var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body},f=e=>3===e.nodeType||"BR"===e.tagName,d=(e,t,n)=>{t=t||null,n=void 0!==n&&n;var r=s(e.childNodes).map(e=>f(e)?e:d(e));return r=c(r),t&&(r=r.filter(e=>!e.parentNode.isEqualNode(t))),n?r.reverse():r},h=e=>"BODY"===e.tagName,v=(e,t)=>{t=t||null;var n=e instanceof HTMLElement;return{node:t,isTopLevelText:(!t||h(t.parentNode))&&!n,isHTMLElement:n,content:e}};function p(e){var t,n=l(e);return t=d(n).map(e=>e.nodeValue?s(e.nodeValue).map(t=>v(t,e)):v(e)),c(t)}function m(e,t){return(t=void 0===t||t)?p(e):s(e).map(e=>v(e))}var y=e=>document.createElement(e),g=(e,t)=>{var n=y("style");n.id=t||"",n.appendChild(document.createTextNode(e)),document.head.appendChild(n)},b=e=>(r(e)||(e=[e/2,e/2]),{before:e[0],after:e[1],total:e[0]+e[1]}),S=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));var N=e=>["textarea","input"].indexOf(e.tagName.toLowerCase())>-1,T=(e,t)=>{var n=t.querySelectorAll("*");return[t].concat(s(n).reverse()).find(t=>t.cloneNode().outerHTML===e.outerHTML)},L=(e,t,n,r)=>{n=n||null;var i=t.isHTMLElement,o=i?t.content:document.createTextNode(t.content);if(N(e))e.value="".concat(e.value).concat(t.content);else{if(!t.isTopLevelText&&!i){var a=t.node.parentNode,u=T(a.cloneNode(),e);if(((e,t)=>{if(!e)return!1;var n=e.nextSibling;return!n||n.isEqualNode(t)})(u,n))e=u;else if((o=a.cloneNode()).innerText=t.content,!h(a.parentNode)){for(var s=a.parentNode,c=s.cloneNode(),l=T(c,e);!l&&!h(s);)c.innerHTML=o.outerHTML,o=c,c=s.parentNode.cloneNode(),s=s.parentNode,l=T(c,e);e=l||e}}var f=d(e,n,!0)[r-1],v=f?f.parentNode:e;v.insertBefore(o,v.contains(n)?n:null)}},x=e=>e&&e.parentNode.removeChild(e),w=e=>!e.firstChild&&!f(e),M=e=>e.some(e=>w(e));var D=(e,t,n)=>{var r,i="string"==typeof e,o=!1,a=-1*e;return i&&(a=(r="END"===e.toUpperCase())?-1:1,o=r?t+a>0:t+a<n.length),{isString:i,numberOfSteps:a,canKeepMoving:o}},E=e=>{var t,n=["font","lineHeight","color"],r=y("SPAN"),i=(t=e,window.getComputedStyle(t,null));for(var o in i)n.indexOf(o)>-1&&i[o]&&(r.style[o]=i[o]);return r.style.cssText};function C(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function H(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function P(){}function A(e,t){if(!t)return e&&e.then?e.then(P):Promise.resolve()}function k(e,t){var n=e();return n&&n.then?n.then(t):t(n)}function z(e,t,n){if(!e.s){if(n instanceof O){if(!n.s)return void(n.o=z.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(z.bind(null,e,t),z.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var O=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var o=1&i?t:n;if(o){try{z(r,1,o(this.v))}catch(e){z(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?z(r,1,t?t(i):i):n?z(r,1,n(i)):z(r,2,i)}catch(e){z(r,2,e)}},r},e}();function B(e,t){return e&&e.then?e.then(t):t(e)}export default function(t,i){var o=this;i=i||{};var c=e=>{var t=(e=e||{}).delay;t&&se.add([F,t])},f=(e,t,n)=>(e=r(e[0])?e:[e],se.add(e,t),c(n),this),h=e=>[[Y,e="object"==typeof e?e:{},{force:!0}],[Y,re,{force:!0}]],T=()=>Z?s(X.value):d(X,ce,!0),q=(e,t)=>{t=t||1;var n=re.nextStringDelay;se.insert(e,[F,n.before]),se.insert(e+t+1,[F,n.after])},I=H((function(){if(ce){var e="[data-typeit-id='".concat(ue,"'] .ti-cursor");return g("@keyframes blink-".concat(ue," { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ").concat(e," { animation: blink-").concat(ue," ").concat(re.cursorSpeed/1e3,"s infinite; } ").concat(e,".with-delay { animation-delay: 500ms; } ").concat(e,".disabled { animation: none; }"),ue),X.appendChild(ce),C(document.fonts.ready,(function(){var e=ce.getBoundingClientRect().width/2;ce.style.margin="0 -".concat(e+1,"px 0 -").concat(e-1,"px")}))}})),R=e=>{ce&&(ce.classList.toggle("disabled",e),ce.classList.toggle("with-delay",!e))},V=H((function(e,t){return _.push(setTimeout(e,t)),C()})),j=H((function(e){return k((function(){if(ee)return A(K(ee))}),(function(){se.reset().delete(0).add([F,e.before],!0),T().forEach(e=>{se.add([J,null,{isPhantom:!0}],1,!0)})}))})),U=H((function(){ne.started=!0;var e=se.getItems();return B(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return B(function(e,t,n){var r,i,o=-1;return function a(u){try{for(;++o<e.length&&(!n||!n());)if((u=t(o))&&u.then){if(!((s=u)instanceof O&&1&s.s))return void u.then(a,i||(i=z.bind(null,r=new O,2)));u=u.v}r?z(r,1,u):r=u}catch(e){z(r||(r=new O),2,e)}var s}(),r}(e,(function(t){if(ne.frozen||ne.destroyed)throw"";var n,r,i,a,u=e[t],s=u[2],c=[u,o];return s.freezeCursor&&R(!0),n=re.speed,r=re.deleteSpeed,i=re.lifeLike,a=(r=null!==r?r:n/3)/2,$=i?[S(n,n/2),S(r,a)]:[n,r],k((function(){var e;if(null==s?void 0:s.isFirst)return A((e=re).beforeString.apply(e,c))}),(function(){var e;return C((e=re).beforeStep.apply(e,c),(function(){return C(u[0].call(o,u[1],s),(function(){return k((function(){if(!s||!s.isPhantom)return k((function(){var e,t;if(null===(e=u[2])||void 0===e?void 0:e.isLast)return A((t=re).afterString.apply(t,c))}),(function(){var e;return C((e=re).afterStep.apply(e,c),(function(){u[2].executed=!0}))}))}),(function(){R(!1)}))}))}))}))}),(function(){return!1})),(function(e){return ne.completed=!0,C(re.afterComplete(o),(function(){if(re.loop){var e=re.loopDelay;V((function(){return C(j(e),(function(){U()}))}),e.after)}}))}))}),P),(function(e){return o}))})),F=e=>new Promise(t=>{V(()=>t(),e||0)}),K=e=>{var t=T(),n=D(e,ee,t);return ee+=n.numberOfSteps,new Promise(e=>{V(H((function(){return((e,t,n,r)=>{if(n){var i=r,o=t[(i=i>t.length?t.length:i)-1];(e=o?o.parentNode:e).insertBefore(n,o||null)}})(X,T(),ce,ee),k((function(){if(n.isString&&n.canKeepMoving)return A(K(n.numberOfSteps>0?"START":"END"))}),(function(){return e()}))})),$[0])})},Q=e=>new Promise(t=>{V(()=>(L(X,e,ce,ee),t()),$[0])}),Y=H((function(e){re=n(re,e)})),G=H((function(){Z?X.value="":T().forEach(e=>{x(e)})})),J=e=>(e=!0===e,new Promise(t=>{V(H((function(){var n=!1,r=T();return r.length&&(Z?X.value=X.value.slice(0,-1):x(r[ee])),(e=>{for(var t=s(e.querySelectorAll("*")),n=M(t);t.length&&n;){var r=!1;t.forEach(e=>{w(e)&&(x(e),r=!0)}),r&&(t=s(e.querySelectorAll("*"))),n=M(t)}})(X),k((function(){if(e&&r.length-1>0)return C(J(!0),(function(){return n=!0,t()}))}),(function(e){return n?e:t()}))})),$[1])}));this.break=function(e){return f([Q,v(y("BR"))],1,e)},this.delete=function(e,t){var n=h(t);return se.add(n[0]),se.add([J,!e,te],e||1),se.add(n[1]),c(t),this},this.empty=function(){return f(G,1,arguments)},this.exec=function(e,t){var n=h(t);return f([n[0],[e,null],n[1]],1,t)},this.move=function(e,t){var n=D(e,ee,T()),r=h(t);return se.add(r[0]),se.add([K,n.isString?e:Math.sign(e),te],Math.abs(e)),se.add(r[1]),c(t),this},this.options=function(e){return f([Y,e],1,e)},this.pause=function(e,t){return f([F,e],1,t)},this.type=function(e,t){var n=h(t),r=m(e,re.html),i=[n[0]].concat(a(r,Q,te,!0),[n[1]]);return f(i,1,t)},this.is=function(e){return ne[e]},this.destroy=function(e){e=void 0===e||e,_.forEach(e=>{clearTimeout(e)}),_=[],e&&x(ce),ne.destroyed=!0},this.freeze=function(){ne.frozen=!0},this.unfreeze=function(){ne.frozen=!1,!ne.frozen&&U()},this.reset=function(){for(var e in!this.is("destroyed")&&this.destroy(),se.reset(),ne)ne[e]=!1;return this},this.go=function(){return ne.started?this:(I(),re.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(X,U.bind(this)),this):(U(),this))},this.getQueue=function(){return se},this.getOptions=function(){return re},this.getElement=function(){return X};var W,X="string"==typeof(W=t)?document.querySelector(W):W,Z=N(X),$=[],_=[],ee=0,te={freezeCursor:!0},ne={started:!1,completed:!1,frozen:!1,destroyed:!1},re=n(e,i);re=n(re,{html:!Z&&re.html,nextStringDelay:b(re.nextStringDelay),loopDelay:b(re.loopDelay)});var ie,oe,ae,ue=Math.random().toString().substring(2,9),se=new u([F,re.startDelay]);X.setAttribute("data-typeit-id",ue),g("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}[data-typeit-id]"),re.strings=(ae=re.strings,ie=r(ae)?ae:[ae],(oe=(e=>e.innerHTML.replace(/<\!--.*?-->/g,"").trim())(X))?(X.innerHTML="",re.startDelete?(p(oe).forEach(e=>{L(X,e,ce,ee)}),se.add([J,!0]),q(1),ie):[oe.trim()].concat(ie)):ie);var ce=(()=>{if(Z||!re.cursor)return null;var e=y("span");return e.innerHTML=l(re.cursorChar).innerHTML,e.className="ti-cursor",e.style.cssText="display:inline;".concat(E(X)),e})();re.strings.length&&(()=>{var e=re.strings;e.forEach((t,n)=>{var r=m(t,re.html);se.add(a(r,Q,te,!0));var i=se.getItems().length;if(n+1!==e.length){if(re.breakLines){var o=v(y("BR"));return se.add([Q,o,te]),void q(i)}se.add(a(r,J,te)),q(i,t.length)}})})()}
var e={strings:[],speed:100,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,lifeLike:!0,breakLines:!0,startDelay:250,startDelete:!1,nextStringDelay:750,loop:!1,loopDelay:750,html:!0,waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},t=e=>e.map(e=>(void 0===e[1]&&e.push(null),void 0===e[2]&&e.push({}),e)),n=(e,t)=>Object.assign({},e,t),r=e=>Array.isArray(e),i=(e,t)=>(e[2]=n(e[2],t)||t,e),o=(e,t)=>r(e[0])?e.map(e=>i(e,t)):i(e,t),a=(e,t,n,i)=>{i=i||!1,n=n||{};var a=!r(e),u=e.length;return(e=a?new Array(e).fill(0):e).map((e,r)=>{if(a)return t;var c=[t,e,n];return i&&(0===r&&(c=o(c,{isFirst:!0})),r+1===u&&(c=o(c,{isLast:!0}))),c})};function u(e){this.insert=function(e,t){n.splice(e,0,t)},this.add=function(e,t,i){return e=r(e)?e:[e,null],i=i||!1,t=t||1,r(e[0])||(e=a(t,e)),n=i?e.concat(n):n.concat(e),this},this.delete=function(e){return n.splice(e,1),this},this.reset=function(){return n=t(n).map(e=>(e[2].executed=!1,e)),this},this.getItems=function(){return t(n).filter(e=>!e.executed)};var n=[];e&&this.add(e)}var c=e=>Array.from(e),s=e=>{var t=[];return t.concat.apply(t,e)},l=e=>{var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body},f=(e,t,n)=>{t=t||null,n=void 0!==n&&n;var r=c(e.childNodes).map(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:f(e);var t});return r=s(r),t&&(r=r.filter(e=>!e.parentNode.isEqualNode(t))),n?r.reverse():r},d=e=>"BODY"===e.tagName,h=(e,t)=>{t=t||null;var n=e instanceof HTMLElement;return{node:t,isTopLevelText:(!t||d(t.parentNode))&&!n,isHTMLElement:n,content:e}};function p(e){var t,n=l(e);return t=f(n).map(e=>e.nodeValue?c(e.nodeValue).map(t=>h(t,e)):h(e)),s(t)}function v(e,t){return(t=void 0===t||t)?p(e):c(e).map(e=>h(e))}var m=e=>document.createElement(e),y=(e,t)=>{var n=m("style");n.id=t||"",n.appendChild(document.createTextNode(e)),document.head.appendChild(n)},g=e=>(r(e)||(e=[e/2,e/2]),{before:e[0],after:e[1],total:e[0]+e[1]}),b=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));var N=e=>["textarea","input"].indexOf(e.tagName.toLowerCase())>-1,S=(e,t)=>{var n=t.querySelectorAll("*");return[t].concat(c(n).reverse()).find(t=>t.cloneNode().outerHTML===e.outerHTML)},T=(e,t,n,r)=>{n=n||null;var i=t.isHTMLElement,o=i?t.content:document.createTextNode(t.content);if(N(e))e.value="".concat(e.value).concat(t.content);else{if(!t.isTopLevelText&&!i){var a=t.node.parentNode,u=S(a.cloneNode(),e);if(((e,t)=>{if(!e)return!1;var n=e.nextSibling;return!n||n.isEqualNode(t)})(u,n))e=u;else if((o=a.cloneNode()).innerText=t.content,!d(a.parentNode)){for(var c=a.parentNode,s=c.cloneNode(),l=S(s,e);!l&&!d(c);)s.innerHTML=o.outerHTML,o=s,s=c.parentNode.cloneNode(),c=c.parentNode,l=S(s,e);e=l||e}}var h=f(e,n,!0)[r-1],p=h?h.parentNode:e;p.insertBefore(o,p.contains(n)?n:null)}},L=e=>e&&e.parentNode.removeChild(e);var x=(e,t,n)=>{var r,i="string"==typeof e,o=!1,a=-1*e;return i&&(a=(r="END"===e.toUpperCase())?-1:1,o=r?t+a>0:t+a<n.length),{isString:i,numberOfSteps:a,canKeepMoving:o}},M=e=>{var t,n=["font","lineHeight","color"],r=m("SPAN"),i=(t=e,window.getComputedStyle(t,null));for(var o in i)n.indexOf(o)>-1&&i[o]&&(r.style[o]=i[o]);return r.style.cssText};function w(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function E(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function D(){}function H(e,t){if(!t)return e&&e.then?e.then(D):Promise.resolve()}function C(e,t){var n=e();return n&&n.then?n.then(t):t(n)}function A(e,t,n){if(!e.s){if(n instanceof P){if(!n.s)return void(n.o=A.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(A.bind(null,e,t),A.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var P=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var o=1&i?t:n;if(o){try{A(r,1,o(this.v))}catch(e){A(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?A(r,1,t?t(i):i):n?A(r,1,n(i)):A(r,2,i)}catch(e){A(r,2,e)}},r},e}();function k(e,t){return e&&e.then?e.then(t):t(e)}export default function(t,i){var o=this;i=i||{};var s=(e,t,n)=>(e=r(e[0])?e:[e],oe.add(e,t),(e=>{var t=(e=e||{}).delay;t&&oe.add([V,t])})(n),this),d=e=>[[F,e="object"==typeof e?e:{},{force:!0}],[F,ee,{force:!0}]],S=()=>J?c(G.value):f(G,ae,!0),z=(e,t)=>{t=t||1;var n=ee.nextStringDelay;oe.insert(e,[V,n.before]),oe.insert(e+t+1,[V,n.after])},O=E((function(){if(ae){var e="[data-typeit-id='".concat(ie,"'] .ti-cursor");return y("@keyframes blink-".concat(ie," { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ").concat(e," { animation: blink-").concat(ie," ").concat(ee.cursorSpeed/1e3,"s infinite; } ").concat(e,".with-delay { animation-delay: 500ms; } ").concat(e,".disabled { animation: none; }"),ie),G.appendChild(ae),w(document.fonts.ready,(function(){var e=ae.getBoundingClientRect().width/2;ae.style.margin="0 -".concat(e+1,"px 0 -").concat(e-1,"px")}))}})),B=e=>{ae&&(ae.classList.toggle("disabled",e),ae.classList.toggle("with-delay",!e))},q=E((function(e,t){return X.push(setTimeout(e,t)),w()})),I=E((function(e){return C((function(){if(Z)return H(j(Z))}),(function(){oe.reset().delete(0).add([V,e.before],!0),S().forEach(e=>{oe.add([Q,null,{isPhantom:!0}],1,!0)})}))})),R=E((function(){_.started=!0;var e=oe.getItems();return k(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return k(function(e,t,n){var r,i,o=-1;return function a(u){try{for(;++o<e.length&&(!n||!n());)if((u=t(o))&&u.then){if(!((c=u)instanceof P&&1&c.s))return void u.then(a,i||(i=A.bind(null,r=new P,2)));u=u.v}r?A(r,1,u):r=u}catch(e){A(r||(r=new P),2,e)}var c}(),r}(e,(function(t){if(_.frozen||_.destroyed)throw"";var n,r,i,a,u=e[t],c=u[2],s=[u,o];return c.freezeCursor&&B(!0),n=ee.speed,r=ee.deleteSpeed,i=ee.lifeLike,a=(r=null!==r?r:n/3)/2,W=i?[b(n,n/2),b(r,a)]:[n,r],C((function(){var e;if(null==c?void 0:c.isFirst)return H((e=ee).beforeString.apply(e,s))}),(function(){var e;return w((e=ee).beforeStep.apply(e,s),(function(){return w(u[0].call(o,u[1],c),(function(){return C((function(){if(!c||!c.isPhantom)return C((function(){var e,t;if(null===(e=u[2])||void 0===e?void 0:e.isLast)return H((t=ee).afterString.apply(t,s))}),(function(){var e;return w((e=ee).afterStep.apply(e,s),(function(){u[2].executed=!0}))}))}),(function(){B(!1)}))}))}))}))}),(function(){return!1})),(function(e){return _.completed=!0,w(ee.afterComplete(o),(function(){if(ee.loop){var e=ee.loopDelay;q((function(){return w(I(e),(function(){R()}))}),e.after)}}))}))}),D),(function(e){return o}))})),V=e=>new Promise(t=>{q(()=>t(),e||0)}),j=e=>{var t=S(),n=x(e,Z,t);return Z+=n.numberOfSteps,new Promise(e=>{q(E((function(){return((e,t,n,r)=>{if(n){var i=r,o=t[(i=i>t.length?t.length:i)-1];(e=o?o.parentNode:e).insertBefore(n,o||null)}})(G,S(),ae,Z),C((function(){if(n.isString&&n.canKeepMoving)return H(j(n.numberOfSteps>0?"START":"END"))}),(function(){return e()}))})),W[0])})},U=e=>new Promise(t=>{q(()=>(T(G,e,ae,Z),t()),W[0])}),F=E((function(e){ee=n(ee,e)})),K=E((function(){J?G.value="":S().forEach(e=>{L(e)})})),Q=e=>(e=!0===e,new Promise(t=>{q(E((function(){var n=!1,r=S();return r.length&&(J?G.value=G.value.slice(0,-1):L(r[Z])),c(G.querySelectorAll("*")).forEach(e=>{if(!e.innerHTML){for(var t=e;1===t.parentNode.childNodes.length&&t.parentNode.childNodes[0].isEqualNode(t);)t=t.parentNode;L(t)}}),C((function(){if(e&&r.length-1>0)return w(Q(!0),(function(){return n=!0,t()}))}),(function(e){return n?e:t()}))})),W[1])}));this.break=function(e){return s([U,h(m("BR"))],1,e)},this.delete=function(e,t){var n=d(t);return s([n[0]].concat([].concat(Array(e||1)).map(()=>[Q,!e,$]),[n[1]]),1,t)},this.empty=function(){return s(K,1,arguments)},this.exec=function(e,t){var n=d(t);return s([n[0],[e,null],n[1]],1,t)},this.move=function(e,t){var n=x(e,Z,S()),r=d(t),i=n.isString?e:Math.sign(e);return s([r[0]].concat([].concat(Array(Math.abs(e)||1)).map(()=>[j,i,$]),[r[1]]),1,t)},this.options=function(e){return s([F,e],1,e)},this.pause=function(e,t){return s([V,e],1,t)},this.type=function(e,t){var n=d(t),r=v(e,ee.html),i=[n[0]].concat(a(r,U,$,!0),[n[1]]);return s(i,1,t)},this.is=function(e){return _[e]},this.destroy=function(e){e=void 0===e||e,X.forEach(e=>{clearTimeout(e)}),X=[],e&&L(ae),_.destroyed=!0},this.freeze=function(){_.frozen=!0},this.unfreeze=function(){_.frozen=!1,!_.frozen&&R()},this.reset=function(){for(var e in!this.is("destroyed")&&this.destroy(),oe.reset(),_)_[e]=!1;return this},this.go=function(){return _.started?this:(O(),ee.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(G,R.bind(this)),this):(R(),this))},this.getQueue=function(){return oe},this.getOptions=function(){return ee},this.getElement=function(){return G};var Y,G="string"==typeof(Y=t)?document.querySelector(Y):Y,J=N(G),W=[],X=[],Z=0,$={freezeCursor:!0},_={started:!1,completed:!1,frozen:!1,destroyed:!1},ee=n(e,i);ee=n(ee,{html:!J&&ee.html,nextStringDelay:g(ee.nextStringDelay),loopDelay:g(ee.loopDelay)});var te,ne,re,ie=Math.random().toString().substring(2,9),oe=new u([V,ee.startDelay]);G.setAttribute("data-typeit-id",ie),y("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}[data-typeit-id]"),ee.strings=(re=ee.strings,te=r(re)?re:[re],(ne=(e=>e.innerHTML.replace(/<\!--.*?-->/g,"").trim())(G))?(G.innerHTML="",ee.startDelete?(p(ne).forEach(e=>{T(G,e,ae,Z)}),oe.add([Q,!0]),z(1),te):[ne.trim()].concat(te)):te);var ae=(()=>{if(J||!ee.cursor)return null;var e=m("span");return e.innerHTML=l(ee.cursorChar).innerHTML,e.className="ti-cursor",e.style.cssText="display:inline;".concat(M(G)),e})();ee.strings.length&&(()=>{var e=ee.strings;e.forEach((t,n)=>{var r=v(t,ee.html);oe.add(a(r,U,$,!0));var i=oe.getItems().length;if(n+1!==e.length){if(ee.breakLines){var o=h(m("BR"));return oe.add([U,o,$]),void z(i)}oe.add(a(r,Q,$)),z(i,t.length)}})})()}
/**
* TypeIt - The most versatile animated typing utility on the planet.
* Author: Alex MacArthur <alex@macarthur.me> (https://macarthur.me)
* Version: v7.0.0-rc8
* Version: v7.0.0-rc9
* License: GPL-2.0
* URL: https://typeitjs.com
*/
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).TypeIt=t()}(this,(function(){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(t)}var t={strings:[],speed:100,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,lifeLike:!0,breakLines:!0,startDelay:250,startDelete:!1,nextStringDelay:750,loop:!1,loopDelay:750,html:!0,waitUntilVisible:!1,beforeString:function(){},afterString:function(){},beforeStep:function(){},afterStep:function(){},afterComplete:function(){}},e=function(n){return n.map((function(n){return void 0===n[1]&&n.push(null),void 0===n[2]&&n.push({}),n}))},r=function(n,t){return Object.assign({},n,t)},i=function(n){return Array.isArray(n)},o=function(n,t){return n[2]=r(n[2],t)||t,n},u=function(n,t){return i(n[0])?n.map((function(n){return o(n,t)})):o(n,t)},c=function(n,t,e,r){r=r||!1,e=e||{};var o=!i(n),c=n.length;return(n=o?new Array(n).fill(0):n).map((function(n,i){if(o)return t;var f=[t,n,e];return r&&(0===i&&(f=u(f,{isFirst:!0})),i+1===c&&(f=u(f,{isLast:!0}))),f}))};function f(n){this.insert=function(n,e){t.splice(n,0,e)},this.add=function(n,e,r){return n=i(n)?n:[n,null],r=r||!1,e=e||1,i(n[0])||(n=c(e,n)),t=r?n.concat(t):t.concat(n),this},this.delete=function(n){return t.splice(n,1),this},this.reset=function(){return t=e(t).map((function(n){return n[2].executed=!1,n})),this},this.getItems=function(){return e(t).filter((function(n){return!n.executed}))};var t=[];n&&this.add(n)}var a=function(n){return Array.from(n)},s=function(n){var t=[];return t.concat.apply(t,n)},l=function(n){var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=n,t.body},d=function(n){return 3===n.nodeType||"BR"===n.tagName},h=function n(t,e,r){e=e||null,r=void 0!==r&&r;var i=a(t.childNodes).map((function(t){return d(t)?t:n(t)}));return i=s(i),e&&(i=i.filter((function(n){return!n.parentNode.isEqualNode(e)}))),r?i.reverse():i},p=function(n){return"BODY"===n.tagName},v=function(n,t){t=t||null;var e=n instanceof HTMLElement;return{node:t,isTopLevelText:(!t||p(t.parentNode))&&!e,isHTMLElement:e,content:n}};function y(n){var t,e=l(n);return t=h(e).map((function(n){return n.nodeValue?a(n.nodeValue).map((function(t){return v(t,n)})):v(n)})),s(t)}function m(n,t){return(t=void 0===t||t)?y(n):a(n).map((function(n){return v(n)}))}var g=function(n){return document.createElement(n)},b=function(n,t){var e=g("style");e.id=t||"",e.appendChild(document.createTextNode(n)),document.head.appendChild(e)},S=function(n){return i(n)||(n=[n/2,n/2]),{before:n[0],after:n[1],total:n[0]+n[1]}},T=function(n,t){return Math.abs(Math.random()*(n+t-(n-t))+(n-t))};var N=function(n){return["textarea","input"].indexOf(n.tagName.toLowerCase())>-1},L=function(n,t){var e=t.querySelectorAll("*");return[t].concat(a(e).reverse()).find((function(t){return t.cloneNode().outerHTML===n.outerHTML}))},x=function(n,t,e,r){e=e||null;var i=t.isHTMLElement,o=i?t.content:document.createTextNode(t.content);if(N(n))n.value="".concat(n.value).concat(t.content);else{if(!t.isTopLevelText&&!i){var u=t.node.parentNode,c=L(u.cloneNode(),n);if(function(n,t){if(!n)return!1;var e=n.nextSibling;return!e||e.isEqualNode(t)}(c,e))n=c;else if((o=u.cloneNode()).innerText=t.content,!p(u.parentNode)){for(var f=u.parentNode,a=f.cloneNode(),s=L(a,n);!s&&!p(f);)a.innerHTML=o.outerHTML,o=a,a=f.parentNode.cloneNode(),f=f.parentNode,s=L(a,n);n=s||n}}var l=h(n,e,!0)[r-1],d=l?l.parentNode:n;d.insertBefore(o,d.contains(e)?e:null)}},w=function(n){return n&&n.parentNode.removeChild(n)},M=function(n){return!n.firstChild&&!d(n)},D=function(n){return n.some((function(n){return M(n)}))};var E=function(n,t,e){var r,i="string"==typeof n,o=!1,u=-1*n;return i&&(u=(r="END"===n.toUpperCase())?-1:1,o=r?t+u>0:t+u<e.length),{isString:i,numberOfSteps:u,canKeepMoving:o}},C=function(n){var t,e=["font","lineHeight","color"],r=g("SPAN"),i=(t=n,window.getComputedStyle(t,null));for(var o in i)e.indexOf(o)>-1&&i[o]&&(r.style[o]=i[o]);return r.style.cssText};function H(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}function P(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(n.apply(this,t))}catch(n){return Promise.reject(n)}}}function A(){}function k(n,t){if(!t)return n&&n.then?n.then(A):Promise.resolve()}function z(n,t){var e=n();return e&&e.then?e.then(t):t(e)}function O(n,t,e){if(!n.s){if(e instanceof B){if(!e.s)return void(e.o=O.bind(null,n,t));1&t&&(t=e.s),e=e.v}if(e&&e.then)return void e.then(O.bind(null,n,t),O.bind(null,n,2));n.s=t,n.v=e;var r=n.o;r&&r(n)}}var B=function(){function n(){}return n.prototype.then=function(t,e){var r=new n,i=this.s;if(i){var o=1&i?t:e;if(o){try{O(r,1,o(this.v))}catch(n){O(r,2,n)}return r}return this}return this.o=function(n){try{var i=n.v;1&n.s?O(r,1,t?t(i):i):e?O(r,1,e(i)):O(r,2,i)}catch(n){O(r,2,n)}},r},n}();function q(n,t){return n&&n.then?n.then(t):t(n)}return function(e,o){var u=this,s=this;o=o||{};var d=function(n){var t=(n=n||{}).delay;t&&ln.add([Q,t])},p=function(n,t,e){return n=i(n[0])?n:[n],ln.add(n,t),d(e),s},L=function(t){return t="object"===n(t)?t:{},[[J,t,{force:!0}],[J,un,{force:!0}]]},I=function(){return _?a($.value):h($,dn,!0)},R=function(n,t){t=t||1;var e=un.nextStringDelay;ln.insert(n,[Q,e.before]),ln.insert(n+t+1,[Q,e.after])},j=P((function(){if(dn){var n="[data-typeit-id='".concat(sn,"'] .ti-cursor");return b("@keyframes blink-".concat(sn," { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ").concat(n," { animation: blink-").concat(sn," ").concat(un.cursorSpeed/1e3,"s infinite; } ").concat(n,".with-delay { animation-delay: 500ms; } ").concat(n,".disabled { animation: none; }"),sn),$.appendChild(dn),H(document.fonts.ready,(function(){var n=dn.getBoundingClientRect().width/2;dn.style.margin="0 -".concat(n+1,"px 0 -").concat(n-1,"px")}))}})),V=function(n){dn&&(dn.classList.toggle("disabled",n),dn.classList.toggle("with-delay",!n))},U=P((function(n,t){return tn.push(setTimeout(n,t)),H()})),F=P((function(n){return z((function(){if(en)return k(Y(en))}),(function(){ln.reset().delete(0).add([Q,n.before],!0),I().forEach((function(n){ln.add([X,null,{isPhantom:!0}],1,!0)}))}))})),K=P((function(){on.started=!0;var n=ln.getItems();return q(function(n,t){try{var e=n()}catch(n){return t(n)}return e&&e.then?e.then(void 0,t):e}((function(){return q(function(n,t,e){var r,i,o=-1;return function u(c){try{for(;++o<n.length&&(!e||!e());)if((c=t(o))&&c.then){if(!((f=c)instanceof B&&1&f.s))return void c.then(u,i||(i=O.bind(null,r=new B,2)));c=c.v}r?O(r,1,c):r=c}catch(n){O(r||(r=new B),2,n)}var f}(),r}(n,(function(t){if(on.frozen||on.destroyed)throw"";var e,r,i,o,c=n[t],f=c[2],a=[c,u];return f.freezeCursor&&V(!0),e=un.speed,r=un.deleteSpeed,i=un.lifeLike,o=(r=null!==r?r:e/3)/2,nn=i?[T(e,e/2),T(r,o)]:[e,r],z((function(){var n;if(null==f?void 0:f.isFirst)return k((n=un).beforeString.apply(n,a))}),(function(){var n;return H((n=un).beforeStep.apply(n,a),(function(){return H(c[0].call(u,c[1],f),(function(){return z((function(){if(!f||!f.isPhantom)return z((function(){var n,t;if(null===(n=c[2])||void 0===n?void 0:n.isLast)return k((t=un).afterString.apply(t,a))}),(function(){var n;return H((n=un).afterStep.apply(n,a),(function(){c[2].executed=!0}))}))}),(function(){V(!1)}))}))}))}))}),(function(){return!1})),(function(n){return on.completed=!0,H(un.afterComplete(u),(function(){if(un.loop){var n=un.loopDelay;U((function(){return H(F(n),(function(){K()}))}),n.after)}}))}))}),A),(function(n){return u}))})),Q=function(n){return new Promise((function(t){U((function(){return t()}),n||0)}))},Y=function n(t){var e=I(),r=E(t,en,e);return en+=r.numberOfSteps,new Promise((function(t){U(P((function(){return function(n,t,e,r){if(e){var i=r,o=t[(i=i>t.length?t.length:i)-1];(n=o?o.parentNode:n).insertBefore(e,o||null)}}($,I(),dn,en),z((function(){if(r.isString&&r.canKeepMoving)return k(n(r.numberOfSteps>0?"START":"END"))}),(function(){return t()}))})),nn[0])}))},G=function(n){return new Promise((function(t){U((function(){return x($,n,dn,en),t()}),nn[0])}))},J=P((function(n){un=r(un,n)})),W=P((function(){_?$.value="":I().forEach((function(n){w(n)}))})),X=function n(t){return t=!0===t,new Promise((function(e){U(P((function(){var r=!1,i=I();return i.length&&(_?$.value=$.value.slice(0,-1):w(i[en])),function(n){for(var t=a(n.querySelectorAll("*")),e=D(t);t.length&&e;){var r=!1;t.forEach((function(n){M(n)&&(w(n),r=!0)})),r&&(t=a(n.querySelectorAll("*"))),e=D(t)}}($),z((function(){if(t&&i.length-1>0)return H(n(!0),(function(){return r=!0,e()}))}),(function(n){return r?n:e()}))})),nn[1])}))};this.break=function(n){return p([G,v(g("BR"))],1,n)},this.delete=function(n,t){var e=L(t);return ln.add(e[0]),ln.add([X,!n,rn],n||1),ln.add(e[1]),d(t),this},this.empty=function(){return p(W,1,arguments)},this.exec=function(n,t){var e=L(t);return p([e[0],[n,null],e[1]],1,t)},this.move=function(n,t){var e=E(n,en,I()),r=L(t);return ln.add(r[0]),ln.add([Y,e.isString?n:Math.sign(n),rn],Math.abs(n)),ln.add(r[1]),d(t),this},this.options=function(n){return p([J,n],1,n)},this.pause=function(n,t){return p([Q,n],1,t)},this.type=function(n,t){var e=L(t),r=m(n,un.html),i=[e[0]].concat(c(r,G,rn,!0),[e[1]]);return p(i,1,t)},this.is=function(n){return on[n]},this.destroy=function(n){n=void 0===n||n,tn.forEach((function(n){clearTimeout(n)})),tn=[],n&&w(dn),on.destroyed=!0},this.freeze=function(){on.frozen=!0},this.unfreeze=function(){on.frozen=!1,!on.frozen&&K()},this.reset=function(){for(var n in!this.is("destroyed")&&this.destroy(),ln.reset(),on)on[n]=!1;return this},this.go=function(){return on.started?this:(j(),un.waitUntilVisible?(function(n,t){new IntersectionObserver((function(e,r){e.forEach((function(e){e.isIntersecting&&(t(),r.unobserve(n))}))}),{threshold:1}).observe(n)}($,K.bind(this)),this):(K(),this))},this.getQueue=function(){return ln},this.getOptions=function(){return un},this.getElement=function(){return $};var Z,$="string"==typeof(Z=e)?document.querySelector(Z):Z,_=N($),nn=[],tn=[],en=0,rn={freezeCursor:!0},on={started:!1,completed:!1,frozen:!1,destroyed:!1},un=r(t,o);un=r(un,{html:!_&&un.html,nextStringDelay:S(un.nextStringDelay),loopDelay:S(un.loopDelay)});var cn,fn,an,sn=Math.random().toString().substring(2,9),ln=new f([Q,un.startDelay]);$.setAttribute("data-typeit-id",sn),b("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}[data-typeit-id]"),un.strings=(an=un.strings,cn=i(an)?an:[an],(fn=function(n){return n.innerHTML.replace(/<\!--.*?-->/g,"").trim()}($))?($.innerHTML="",un.startDelete?(y(fn).forEach((function(n){x($,n,dn,en)})),ln.add([X,!0]),R(1),cn):[fn.trim()].concat(cn)):cn);var dn=function(){if(_||!un.cursor)return null;var n=g("span");return n.innerHTML=l(un.cursorChar).innerHTML,n.className="ti-cursor",n.style.cssText="display:inline;".concat(C($)),n}();un.strings.length&&function(){var n=un.strings;n.forEach((function(t,e){var r=m(t,un.html);ln.add(c(r,G,rn,!0));var i=ln.getItems().length;if(e+1!==n.length){if(un.breakLines){var o=v(g("BR"));return ln.add([G,o,rn]),void R(i)}ln.add(c(r,X,rn)),R(i,t.length)}}))}()}}));
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).TypeIt=t()}(this,(function(){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(t)}var t={strings:[],speed:100,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,lifeLike:!0,breakLines:!0,startDelay:250,startDelete:!1,nextStringDelay:750,loop:!1,loopDelay:750,html:!0,waitUntilVisible:!1,beforeString:function(){},afterString:function(){},beforeStep:function(){},afterStep:function(){},afterComplete:function(){}},e=function(n){return n.map((function(n){return void 0===n[1]&&n.push(null),void 0===n[2]&&n.push({}),n}))},r=function(n,t){return Object.assign({},n,t)},i=function(n){return Array.isArray(n)},o=function(n,t){return n[2]=r(n[2],t)||t,n},u=function(n,t){return i(n[0])?n.map((function(n){return o(n,t)})):o(n,t)},c=function(n,t,e,r){r=r||!1,e=e||{};var o=!i(n),c=n.length;return(n=o?new Array(n).fill(0):n).map((function(n,i){if(o)return t;var a=[t,n,e];return r&&(0===i&&(a=u(a,{isFirst:!0})),i+1===c&&(a=u(a,{isLast:!0}))),a}))};function a(n){this.insert=function(n,e){t.splice(n,0,e)},this.add=function(n,e,r){return n=i(n)?n:[n,null],r=r||!1,e=e||1,i(n[0])||(n=c(e,n)),t=r?n.concat(t):t.concat(n),this},this.delete=function(n){return t.splice(n,1),this},this.reset=function(){return t=e(t).map((function(n){return n[2].executed=!1,n})),this},this.getItems=function(){return e(t).filter((function(n){return!n.executed}))};var t=[];n&&this.add(n)}var f=function(n){return Array.from(n)},s=function(n){var t=[];return t.concat.apply(t,n)},l=function(n){var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=n,t.body},d=function n(t,e,r){e=e||null,r=void 0!==r&&r;var i=f(t.childNodes).map((function(t){return 3===(e=t).nodeType||"BR"===e.tagName?t:n(t);var e}));return i=s(i),e&&(i=i.filter((function(n){return!n.parentNode.isEqualNode(e)}))),r?i.reverse():i},h=function(n){return"BODY"===n.tagName},p=function(n,t){t=t||null;var e=n instanceof HTMLElement;return{node:t,isTopLevelText:(!t||h(t.parentNode))&&!e,isHTMLElement:e,content:n}};function v(n){var t,e=l(n);return t=d(e).map((function(n){return n.nodeValue?f(n.nodeValue).map((function(t){return p(t,n)})):p(n)})),s(t)}function y(n,t){return(t=void 0===t||t)?v(n):f(n).map((function(n){return p(n)}))}var m=function(n){return document.createElement(n)},g=function(n,t){var e=m("style");e.id=t||"",e.appendChild(document.createTextNode(n)),document.head.appendChild(e)},b=function(n){return i(n)||(n=[n/2,n/2]),{before:n[0],after:n[1],total:n[0]+n[1]}},S=function(n,t){return Math.abs(Math.random()*(n+t-(n-t))+(n-t))};var N=function(n){return["textarea","input"].indexOf(n.tagName.toLowerCase())>-1},T=function(n,t){var e=t.querySelectorAll("*");return[t].concat(f(e).reverse()).find((function(t){return t.cloneNode().outerHTML===n.outerHTML}))},L=function(n,t,e,r){e=e||null;var i=t.isHTMLElement,o=i?t.content:document.createTextNode(t.content);if(N(n))n.value="".concat(n.value).concat(t.content);else{if(!t.isTopLevelText&&!i){var u=t.node.parentNode,c=T(u.cloneNode(),n);if(function(n,t){if(!n)return!1;var e=n.nextSibling;return!e||e.isEqualNode(t)}(c,e))n=c;else if((o=u.cloneNode()).innerText=t.content,!h(u.parentNode)){for(var a=u.parentNode,f=a.cloneNode(),s=T(f,n);!s&&!h(a);)f.innerHTML=o.outerHTML,o=f,f=a.parentNode.cloneNode(),a=a.parentNode,s=T(f,n);n=s||n}}var l=d(n,e,!0)[r-1],p=l?l.parentNode:n;p.insertBefore(o,p.contains(e)?e:null)}},x=function(n){return n&&n.parentNode.removeChild(n)};var M=function(n,t,e){var r,i="string"==typeof n,o=!1,u=-1*n;return i&&(u=(r="END"===n.toUpperCase())?-1:1,o=r?t+u>0:t+u<e.length),{isString:i,numberOfSteps:u,canKeepMoving:o}},w=function(n){var t,e=["font","lineHeight","color"],r=m("SPAN"),i=(t=n,window.getComputedStyle(t,null));for(var o in i)e.indexOf(o)>-1&&i[o]&&(r.style[o]=i[o]);return r.style.cssText};function E(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}function D(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(n.apply(this,t))}catch(n){return Promise.reject(n)}}}function H(){}function C(n,t){if(!t)return n&&n.then?n.then(H):Promise.resolve()}function A(n,t){var e=n();return e&&e.then?e.then(t):t(e)}function P(n,t,e){if(!n.s){if(e instanceof k){if(!e.s)return void(e.o=P.bind(null,n,t));1&t&&(t=e.s),e=e.v}if(e&&e.then)return void e.then(P.bind(null,n,t),P.bind(null,n,2));n.s=t,n.v=e;var r=n.o;r&&r(n)}}var k=function(){function n(){}return n.prototype.then=function(t,e){var r=new n,i=this.s;if(i){var o=1&i?t:e;if(o){try{P(r,1,o(this.v))}catch(n){P(r,2,n)}return r}return this}return this.o=function(n){try{var i=n.v;1&n.s?P(r,1,t?t(i):i):e?P(r,1,e(i)):P(r,2,i)}catch(n){P(r,2,n)}},r},n}();function z(n,t){return n&&n.then?n.then(t):t(n)}return function(e,o){var u=this,s=this;o=o||{};var h=function(n,t,e){return n=i(n[0])?n:[n],an.add(n,t),function(n){var t=(n=n||{}).delay;t&&an.add([U,t])}(e),s},T=function(t){return t="object"===n(t)?t:{},[[Q,t,{force:!0}],[Q,en,{force:!0}]]},O=function(){return X?f(W.value):d(W,fn,!0)},B=function(n,t){t=t||1;var e=en.nextStringDelay;an.insert(n,[U,e.before]),an.insert(n+t+1,[U,e.after])},q=D((function(){if(fn){var n="[data-typeit-id='".concat(cn,"'] .ti-cursor");return g("@keyframes blink-".concat(cn," { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ").concat(n," { animation: blink-").concat(cn," ").concat(en.cursorSpeed/1e3,"s infinite; } ").concat(n,".with-delay { animation-delay: 500ms; } ").concat(n,".disabled { animation: none; }"),cn),W.appendChild(fn),E(document.fonts.ready,(function(){var n=fn.getBoundingClientRect().width/2;fn.style.margin="0 -".concat(n+1,"px 0 -").concat(n-1,"px")}))}})),I=function(n){fn&&(fn.classList.toggle("disabled",n),fn.classList.toggle("with-delay",!n))},R=D((function(n,t){return $.push(setTimeout(n,t)),E()})),j=D((function(n){return A((function(){if(_)return C(F(_))}),(function(){an.reset().delete(0).add([U,n.before],!0),O().forEach((function(n){an.add([G,null,{isPhantom:!0}],1,!0)}))}))})),V=D((function(){tn.started=!0;var n=an.getItems();return z(function(n,t){try{var e=n()}catch(n){return t(n)}return e&&e.then?e.then(void 0,t):e}((function(){return z(function(n,t,e){var r,i,o=-1;return function u(c){try{for(;++o<n.length&&(!e||!e());)if((c=t(o))&&c.then){if(!((a=c)instanceof k&&1&a.s))return void c.then(u,i||(i=P.bind(null,r=new k,2)));c=c.v}r?P(r,1,c):r=c}catch(n){P(r||(r=new k),2,n)}var a}(),r}(n,(function(t){if(tn.frozen||tn.destroyed)throw"";var e,r,i,o,c=n[t],a=c[2],f=[c,u];return a.freezeCursor&&I(!0),e=en.speed,r=en.deleteSpeed,i=en.lifeLike,o=(r=null!==r?r:e/3)/2,Z=i?[S(e,e/2),S(r,o)]:[e,r],A((function(){var n;if(null==a?void 0:a.isFirst)return C((n=en).beforeString.apply(n,f))}),(function(){var n;return E((n=en).beforeStep.apply(n,f),(function(){return E(c[0].call(u,c[1],a),(function(){return A((function(){if(!a||!a.isPhantom)return A((function(){var n,t;if(null===(n=c[2])||void 0===n?void 0:n.isLast)return C((t=en).afterString.apply(t,f))}),(function(){var n;return E((n=en).afterStep.apply(n,f),(function(){c[2].executed=!0}))}))}),(function(){I(!1)}))}))}))}))}),(function(){return!1})),(function(n){return tn.completed=!0,E(en.afterComplete(u),(function(){if(en.loop){var n=en.loopDelay;R((function(){return E(j(n),(function(){V()}))}),n.after)}}))}))}),H),(function(n){return u}))})),U=function(n){return new Promise((function(t){R((function(){return t()}),n||0)}))},F=function n(t){var e=O(),r=M(t,_,e);return _+=r.numberOfSteps,new Promise((function(t){R(D((function(){return function(n,t,e,r){if(e){var i=r,o=t[(i=i>t.length?t.length:i)-1];(n=o?o.parentNode:n).insertBefore(e,o||null)}}(W,O(),fn,_),A((function(){if(r.isString&&r.canKeepMoving)return C(n(r.numberOfSteps>0?"START":"END"))}),(function(){return t()}))})),Z[0])}))},K=function(n){return new Promise((function(t){R((function(){return L(W,n,fn,_),t()}),Z[0])}))},Q=D((function(n){en=r(en,n)})),Y=D((function(){X?W.value="":O().forEach((function(n){x(n)}))})),G=function n(t){return t=!0===t,new Promise((function(e){R(D((function(){var r=!1,i=O();return i.length&&(X?W.value=W.value.slice(0,-1):x(i[_])),f(W.querySelectorAll("*")).forEach((function(n){if(!n.innerHTML){for(var t=n;1===t.parentNode.childNodes.length&&t.parentNode.childNodes[0].isEqualNode(t);)t=t.parentNode;x(t)}})),A((function(){if(t&&i.length-1>0)return E(n(!0),(function(){return r=!0,e()}))}),(function(n){return r?n:e()}))})),Z[1])}))};this.break=function(n){return h([K,p(m("BR"))],1,n)},this.delete=function(n,t){var e=T(t);return h([e[0]].concat([].concat(Array(n||1)).map((function(){return[G,!n,nn]})),[e[1]]),1,t)},this.empty=function(){return h(Y,1,arguments)},this.exec=function(n,t){var e=T(t);return h([e[0],[n,null],e[1]],1,t)},this.move=function(n,t){var e=M(n,_,O()),r=T(t),i=e.isString?n:Math.sign(n);return h([r[0]].concat([].concat(Array(Math.abs(n)||1)).map((function(){return[F,i,nn]})),[r[1]]),1,t)},this.options=function(n){return h([Q,n],1,n)},this.pause=function(n,t){return h([U,n],1,t)},this.type=function(n,t){var e=T(t),r=y(n,en.html),i=[e[0]].concat(c(r,K,nn,!0),[e[1]]);return h(i,1,t)},this.is=function(n){return tn[n]},this.destroy=function(n){n=void 0===n||n,$.forEach((function(n){clearTimeout(n)})),$=[],n&&x(fn),tn.destroyed=!0},this.freeze=function(){tn.frozen=!0},this.unfreeze=function(){tn.frozen=!1,!tn.frozen&&V()},this.reset=function(){for(var n in!this.is("destroyed")&&this.destroy(),an.reset(),tn)tn[n]=!1;return this},this.go=function(){return tn.started?this:(q(),en.waitUntilVisible?(function(n,t){new IntersectionObserver((function(e,r){e.forEach((function(e){e.isIntersecting&&(t(),r.unobserve(n))}))}),{threshold:1}).observe(n)}(W,V.bind(this)),this):(V(),this))},this.getQueue=function(){return an},this.getOptions=function(){return en},this.getElement=function(){return W};var J,W="string"==typeof(J=e)?document.querySelector(J):J,X=N(W),Z=[],$=[],_=0,nn={freezeCursor:!0},tn={started:!1,completed:!1,frozen:!1,destroyed:!1},en=r(t,o);en=r(en,{html:!X&&en.html,nextStringDelay:b(en.nextStringDelay),loopDelay:b(en.loopDelay)});var rn,on,un,cn=Math.random().toString().substring(2,9),an=new a([U,en.startDelay]);W.setAttribute("data-typeit-id",cn),g("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}[data-typeit-id]"),en.strings=(un=en.strings,rn=i(un)?un:[un],(on=function(n){return n.innerHTML.replace(/<\!--.*?-->/g,"").trim()}(W))?(W.innerHTML="",en.startDelete?(v(on).forEach((function(n){L(W,n,fn,_)})),an.add([G,!0]),B(1),rn):[on.trim()].concat(rn)):rn);var fn=function(){if(X||!en.cursor)return null;var n=m("span");return n.innerHTML=l(en.cursorChar).innerHTML,n.className="ti-cursor",n.style.cssText="display:inline;".concat(w(W)),n}();en.strings.length&&function(){var n=en.strings;n.forEach((function(t,e){var r=y(t,en.html);an.add(c(r,K,nn,!0));var i=an.getItems().length;if(e+1!==n.length){if(en.breakLines){var o=p(m("BR"));return an.add([K,o,nn]),void B(i)}an.add(c(r,G,nn)),B(i,t.length)}}))}()}}));
{
"name": "typeit",
"version": "7.0.0-rc8",
"version": "7.0.0-rc9",
"description": "The most versatile animated typing utility on the planet.",

@@ -41,5 +41,5 @@ "author": "Alex MacArthur <alex@macarthur.me> (https://macarthur.me)",

"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/core": "^7.8.7",
"@babel/plugin-transform-spread": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/preset-env": "^7.8.7",
"babel-jest": "^24.9.0",

@@ -56,7 +56,7 @@ "babel-loader": "^8.0.6",

"pretty-quick": "^2.0.1",
"rollup": "^1.27.12",
"rollup-plugin-babel": "^4.3.3",
"rollup": "^1.32.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-execute": "^1.1.1",
"rollup-plugin-prepack": "^1.1.1",
"rollup-plugin-terser": "^5.2.0"
"rollup-plugin-terser": "^5.3.0"
},

@@ -63,0 +63,0 @@ "jest": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc