@leemeyer/nth-letter 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nth-letter.es.js +1 -1
- package/dist/nth-letter.umd.js +1 -1
- package/package.json +1 -1
package/dist/nth-letter.es.js
CHANGED
|
@@ -310,7 +310,7 @@ t({ onComplete(e, t, n) {
|
|
|
310
310
|
let t = e.attachShadow({ mode: "closed" });
|
|
311
311
|
e.setAttribute("data-nth-letter", "attached");
|
|
312
312
|
let n = document.createElement("span");
|
|
313
|
-
n.innerHTML = e.innerHTML, t.appendChild(n), new D(n, {
|
|
313
|
+
n.setAttribute("aria-hidden", "true"), n.innerHTML = e.innerHTML, t.appendChild(n), new D(n, {
|
|
314
314
|
type: "chars",
|
|
315
315
|
charsClass: "char"
|
|
316
316
|
}), i.forEach((e, t) => {
|
package/dist/nth-letter.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(function(e){typeof define==`function`&&define.amd?define([],e):e()})(function(){function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={mimeType:t.mimeType||null,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete||Function.prototype},r=Array.isArray(e)?e:[e],i=Array.apply(null,Array(r.length)).map((function(e){return null}));function a(e){var t=typeof e==`string`,n=t&&e.trim().charAt(0)===`<`;return t&&!n}function o(e,t){n.onError(e,r[t],t)}function s(e,t){var a=n.onSuccess(e,r[t],t);e=a===!1?``:a||e,i[t]=e,i.indexOf(null)===-1&&n.onComplete(i)}var c=document.createElement(`a`);r.forEach((function(e,t){if(c.setAttribute(`href`,e),c.href=String(c.href),document.all&&!window.atob&&c.host.split(`:`)[0]!==location.host.split(`:`)[0])if(c.protocol===location.protocol){var r=new XDomainRequest;r.open(`GET`,e),r.timeout=0,r.onprogress=Function.prototype,r.ontimeout=Function.prototype,r.onload=function(){var e=r.responseText;a(e)?s(e,t):o(r,t)},r.onerror=function(e){o(r,t)},setTimeout((function(){r.send()}),0)}else console.warn(`Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (${e})`),o(null,t);else{var i=new XMLHttpRequest;i.open(`GET`,e),n.mimeType&&i.overrideMimeType&&i.overrideMimeType(n.mimeType),n.onBeforeSend(i,e,t),i.onreadystatechange=function(){if(i.readyState===4){var e=i.responseText;i.status<400&&a(e)||i.status===0&&a(e)?s(e,t):o(i,t)}},i.send()}}))}function t(t){var i={cssComments:/\/\*[\s\S]+?\*\//g,cssImports:/(?:@import\s*)(?:url\(\s*)?(?:['"])([^'"]*)(?:['"])(?:\s*\))?(?:[^;]*;)/g},a={rootElement:t.rootElement||document,include:t.include||`style,link[rel="stylesheet"]`,exclude:t.exclude||null,filter:t.filter||null,skipDisabled:t.skipDisabled!==!1,useCSSOM:t.useCSSOM||!1,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete||Function.prototype},o=Array.apply(null,a.rootElement.querySelectorAll(a.include)).filter((function(e){return!r(e,a.exclude)})),s=Array.apply(null,Array(o.length)).map((function(e){return null}));function c(){if(s.indexOf(null)===-1){s.reduce((function(e,t,n){return t===``&&e.push(n),e}),[]).reverse().forEach((function(e){return[o,s].forEach((function(t){return t.splice(e,1)}))}));var e=s.join(``);a.onComplete(e,s,o)}}function l(e,t,n,r){var i=a.onSuccess(e,n,r);e=i!==void 0&&!i?``:i||e,d(e,n,r,(function(e,r){s[t]===null&&(r.forEach((function(e){return a.onError(e.xhr,n,e.url)})),!a.filter||a.filter.test(e)?s[t]=e:s[t]=``,c())}))}function u(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a={};return a.rules=(e.replace(i.cssComments,``).match(i.cssImports)||[]).filter((function(e){return r.indexOf(e)===-1})),a.urls=a.rules.map((function(e){return e.replace(i.cssImports,`$1`)})),a.absoluteUrls=a.urls.map((function(e){return n(e,t)})),a.absoluteRules=a.rules.map((function(e,r){var i=a.urls[r],o=n(a.absoluteUrls[r],t);return e.replace(i,o)})),a}function d(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],c=u(t,r,s);c.rules.length?e(c.absoluteUrls,{onBeforeSend:function(e,t,r){a.onBeforeSend(e,n,t)},onSuccess:function(e,t,r){var i=a.onSuccess(e,n,t);e=i===!1?``:i||e;var o=u(e,t,s);return o.rules.forEach((function(t,n){e=e.replace(t,o.absoluteRules[n])})),e},onError:function(e,a,l){o.push({xhr:e,url:a}),s.push(c.rules[l]),d(t,n,r,i,o,s)},onComplete:function(e){e.forEach((function(e,n){t=t.replace(c.rules[n],e)})),d(t,n,r,i,o,s)}}):i(t,o)}o.length?o.forEach((function(t,r){var i=t.getAttribute(`href`),o=t.getAttribute(`rel`),u=t.nodeName.toLowerCase()===`link`&&i&&o&&o.toLowerCase().indexOf(`stylesheet`)!==-1,d=a.skipDisabled===!1?!1:t.disabled,f=t.nodeName.toLowerCase()===`style`;if(u&&!d)if(i.indexOf(`data:text/css`)!==-1){var p=decodeURIComponent(i.substring(i.indexOf(`,`)+1));a.useCSSOM&&(p=Array.apply(null,t.sheet.cssRules).map((function(e){return e.cssText})).join(``)),l(p,r,t,location.href)}else e(i,{mimeType:`text/css`,onBeforeSend:function(e,n,r){a.onBeforeSend(e,t,n)},onSuccess:function(e,a,o){l(e,r,t,n(i))},onError:function(e,n,i){s[r]=``,a.onError(e,t,n),c()}});else if(f&&!d){var m=t.textContent;a.useCSSOM&&(m=Array.apply(null,t.sheet.cssRules).map((function(e){return e.cssText})).join(``)),l(m,r,t,location.href)}else s[r]=``,c()})):a.onComplete(``,[])}function n(e,t){var n=document.implementation.createHTMLDocument(``),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),r.href=t||document.baseURI||(document.querySelector(`base`)||{}).href||location.href,i.href=e,i.href}function r(e,t){return(e.matches||e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector).call(e,t)}var i,a,o=typeof Symbol==`function`?Symbol():`_split`,s,c=()=>s||D.register(window.gsap),l=typeof Intl<`u`&&`Segmenter`in Intl?new Intl.Segmenter:0,u=e=>typeof e==`string`?u(document.querySelectorAll(e)):`length`in e?Array.from(e).reduce((e,t)=>(typeof t==`string`?e.push(...u(t)):e.push(t),e),[]):[e],d=e=>u(e).filter(e=>e instanceof HTMLElement),f=[],p=function(){},m={add:e=>e()},h=/\s+/g,g=RegExp(`\\p{RI}\\p{RI}|\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?(\\u{200D}\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?)*|.`,`gu`),_={left:0,top:0,width:0,height:0},v=(e,t)=>{for(;++t<e.length&&e[t]===_;);return e[t]||_},y=({element:e,html:t,ariaL:n,ariaH:r})=>{e.innerHTML=t,n?e.setAttribute(`aria-label`,n):e.removeAttribute(`aria-label`),r?e.setAttribute(`aria-hidden`,r):e.removeAttribute(`aria-hidden`)},b=(e,t)=>{if(t){let n=new Set(e.join(``).match(t)||f),r=e.length,i,a,o,s;if(n.size)for(;--r>-1;){a=e[r];for(o of n)if(o.startsWith(a)&&o.length>a.length){for(i=0,s=a;o.startsWith(s+=e[r+ ++i])&&s.length<o.length;);if(i&&s.length===o.length){e[r]=o,e.splice(r+1,i);break}}}}return e},x=e=>window.getComputedStyle(e).display===`inline`&&(e.style.display=`inline-block`),S=(e,t,n)=>t.insertBefore(typeof e==`string`?document.createTextNode(e):e,n),C=(e,t,n)=>{let r=t[e+`sClass`]||``,{tag:i=`div`,aria:a=`auto`,propIndex:o=!1}=t,s=e===`line`?`block`:`inline-block`,c=r.indexOf(`++`)>-1,l=t=>{let l=document.createElement(i),u=n.length+1;return r&&(l.className=r+(c?` `+r+u:``)),o&&l.style.setProperty(`--`+e,u+``),a!==`none`&&l.setAttribute(`aria-hidden`,`true`),i!==`span`&&(l.style.position=`relative`,l.style.display=s),l.textContent=t,n.push(l),l};return c&&(r=r.replace(`++`,``)),l.collection=n,l},w=(e,t,n,r)=>{let i=C(`line`,n,r),a=window.getComputedStyle(e).textAlign||`left`;return(n,r)=>{let o=i(``);for(o.style.textAlign=a,e.insertBefore(o,t[n]);n<r;n++)o.appendChild(t[n]);o.normalize()}},T=(e,t,n,r,i,a,o,s,c,u)=>{var d;let p=Array.from(e.childNodes),m=0,{wordDelimiter:g,reduceWhiteSpace:_=!0,prepareText:v}=t,y=e.getBoundingClientRect(),C=y,w=!_&&window.getComputedStyle(e).whiteSpace.substring(0,3)===`pre`,E=0,D=n.collection,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G;for(typeof g==`object`?(A=g.delimiter||g,k=g.replaceWith||``):k=g===``?``:g||` `,O=k!==` `;m<p.length;m++)if(j=p[m],j.nodeType===3){for(H=j.textContent||``,_?H=H.replace(h,` `):w&&(H=H.replace(/\n/g,k+`
|
|
2
2
|
`)),v&&(H=v(H,e)),j.textContent=H,M=k||A?H.split(A||k):H.match(s)||f,W=M[M.length-1],F=O?W.slice(-1)===` `:!W,W||M.pop(),C=y,P=O?M[0].charAt(0)===` `:!M[0],P&&S(` `,e,j),M[0]||M.shift(),b(M,c),a&&u||(j.textContent=``),I=1;I<=M.length;I++)if(U=M[I-1],!_&&w&&U.charAt(0)===`
|
|
3
|
-
`&&((d=j.previousSibling)==null||d.remove(),S(document.createElement(`br`),e,j),U=U.slice(1)),!_&&U===``)S(k,e,j);else if(U===` `)e.insertBefore(document.createTextNode(` `),j);else{if(O&&U.charAt(0)===` `&&S(` `,e,j),E&&I===1&&!P&&D.indexOf(E.parentNode)>-1?(N=D[D.length-1],N.appendChild(document.createTextNode(r?``:U))):(N=n(r?``:U),S(N,e,j),E&&I===1&&!P&&N.insertBefore(E,N.firstChild)),r)for(R=l?b([...l.segment(U)].map(e=>e.segment),c):U.match(s)||f,G=0;G<R.length;G++)N.appendChild(R[G]===` `?document.createTextNode(` `):r(R[G]));if(a&&u){if(H=j.textContent=H.substring(U.length+1,H.length),L=N.getBoundingClientRect(),L.top>C.top&&L.left<=C.left){for(z=e.cloneNode(),B=e.childNodes[0];B&&B!==N;)V=B,B=B.nextSibling,z.appendChild(V);e.parentNode.insertBefore(z,e),i&&x(z)}C=L}(I<M.length||F)&&S(I>=M.length?` `:O&&U.slice(-1)===` `?` `+k:k,e,j)}e.removeChild(j),E=0}else j.nodeType===1&&(o&&o.indexOf(j)>-1?(D.indexOf(j.previousSibling)>-1&&D[D.length-1].appendChild(j),E=j):(T(j,t,n,r,i,a,o,s,c,!0),E=0),i&&x(j))},E=class e{constructor(e,t){this.isSplit=!1,c(),this.elements=d(e),this.chars=[],this.words=[],this.lines=[],this.masks=[],this.vars=t,this.elements.forEach(e=>{var n;t.overwrite!==!1&&((n=e[o])==null||n._data.orig.filter(({element:t})=>t===e).forEach(y)),e[o]=this}),this._split=()=>this.isSplit&&this.split(this.vars);let n=[],r,i=()=>{let e=n.length,t;for(;e--;){t=n[e];let r=t.element.offsetWidth;if(r!==t.width){t.width=r,this._split();return}}};this._data={orig:n,obs:typeof ResizeObserver<`u`&&new ResizeObserver(()=>{clearTimeout(r),r=setTimeout(i,200)})},p(this),this.split(t)}split(e){return(this._ctx||m).add(()=>{this.isSplit&&this.revert(),this.vars=e=e||this.vars||{};let{type:t=`chars,words,lines`,aria:n=`auto`,deepSlice:r=!0,smartWrap:i,onSplit:o,autoSplit:s=!1,specialChars:c,mask:l}=this.vars,f=t.indexOf(`lines`)>-1,p=t.indexOf(`chars`)>-1,m=t.indexOf(`words`)>-1,h=p&&!m&&!f,y=c&&(`push`in c?RegExp(`(?:`+c.join(`|`)+`)`,`gu`):c),b=y?RegExp(y.source+`|`+g.source,`gu`):g,x=!!e.ignore&&d(e.ignore),{orig:S,animTime:E,obs:D}=this._data,O;(p||m||f)&&(this.elements.forEach((t,a)=>{S[a]={element:t,html:t.innerHTML,ariaL:t.getAttribute(`aria-label`),ariaH:t.getAttribute(`aria-hidden`)},n===`auto`?t.setAttribute(`aria-label`,(t.textContent||``).trim()):n===`hidden`&&t.setAttribute(`aria-hidden`,`true`);let o=[],s=[],c=[],l=p?C(`char`,e,o):null,d=C(`word`,e,s),g,E,D,O;if(T(t,e,d,l,h,r&&(f||h),x,b,y,!1),f){let n=u(t.childNodes),r=w(t,n,e,c),i,a=[],o=0,s=n.map(e=>e.nodeType===1?e.getBoundingClientRect():_),l=_,d;for(g=0;g<n.length;g++)i=n[g],i.nodeType===1&&(i.nodeName===`BR`?((!g||n[g-1].nodeName!==`BR`)&&(a.push(i),r(o,g+1)),o=g+1,l=v(s,g)):(d=s[g],g&&d.top>l.top&&d.left<l.left+l.width-1&&(r(o,g),o=g),l=d));o<g&&r(o,g),a.forEach(e=>e.parentNode?.removeChild(e))}if(!m){for(g=0;g<s.length;g++)if(E=s[g],p||!E.nextSibling||E.nextSibling.nodeType!==3)if(i&&!f){for(D=document.createElement(`span`),D.style.whiteSpace=`nowrap`;E.firstChild;)D.appendChild(E.firstChild);E.replaceWith(D)}else E.replaceWith(...E.childNodes);else O=E.nextSibling,O&&O.nodeType===3&&(O.textContent=(E.textContent||``)+(O.textContent||``),E.remove());s.length=0,t.normalize()}this.lines.push(...c),this.words.push(...s),this.chars.push(...o)}),l&&this[l]&&this.masks.push(...this[l].map(e=>{let t=e.cloneNode();return e.replaceWith(t),t.appendChild(e),e.className&&(t.className=e.className.trim()+`-mask`),t.style.overflow=`clip`,t}))),this.isSplit=!0,a&&f&&(s?a.addEventListener(`loadingdone`,this._split):a.status===`loading`&&console.warn(`SplitText called before fonts loaded`)),(O=o&&o(this))&&O.totalTime&&(this._data.anim=E?O.totalTime(E):O),f&&s&&this.elements.forEach((e,t)=>{S[t].width=e.offsetWidth,D&&D.observe(e)})}),this}kill(){let{obs:e}=this._data;e&&e.disconnect(),a?.removeEventListener(`loadingdone`,this._split)}revert(){var e,t;if(this.isSplit){let{orig:n,anim:r}=this._data;this.kill(),n.forEach(y),this.chars.length=this.words.length=this.lines.length=n.length=this.masks.length=0,this.isSplit=!1,r&&(this._data.animTime=r.totalTime(),r.revert()),(t=(e=this.vars).onRevert)==null||t.call(e,this)}return this}static create(t,n){return new e(t,n)}static register(e){i=i||e||window.gsap,i&&(u=i.utils.toArray,p=i.core.context||p),!s&&window.innerWidth>0&&(a=document.fonts,s=!0)}};E.version=`3.14.2`;var D=E;t({onComplete(e,t,n){n.forEach(e=>e.remove());let r=new Set,i=new Set;e=e.replace(/\/\*[\s\S]*?\*\//g,``);let a=e.replace(/([^,{\r\n]+?)::?nth-letter[ \t]*\(([^\n)]*)\)/gi,(e,t,n)=>(t=t.trim(),r.add(t),i.add(n),`${t}::part(nth-child\\(${CSS.escape(n)}\\))`));document.head.insertAdjacentHTML(`beforeend`,`<style>${a}</style>`),r.forEach(e=>{document.querySelectorAll(e).forEach(e=>{if(e.shadowRoot||e.hasAttribute(`data-nth-letter`))return;let t=e.attachShadow({mode:`closed`});e.setAttribute(`data-nth-letter`,`attached`);let n=document.createElement(`span`);n.innerHTML=e.innerHTML,t.appendChild(n),new D(n,{type:`chars`,charsClass:`char`}),i.forEach((e,t)=>{n.querySelectorAll(`.char:nth-child(${e})`).forEach(t=>{let n=t.part||``;t.part=(n?n+` `:``)+`nth-child(${e})`})})})})}})});
|
|
3
|
+
`&&((d=j.previousSibling)==null||d.remove(),S(document.createElement(`br`),e,j),U=U.slice(1)),!_&&U===``)S(k,e,j);else if(U===` `)e.insertBefore(document.createTextNode(` `),j);else{if(O&&U.charAt(0)===` `&&S(` `,e,j),E&&I===1&&!P&&D.indexOf(E.parentNode)>-1?(N=D[D.length-1],N.appendChild(document.createTextNode(r?``:U))):(N=n(r?``:U),S(N,e,j),E&&I===1&&!P&&N.insertBefore(E,N.firstChild)),r)for(R=l?b([...l.segment(U)].map(e=>e.segment),c):U.match(s)||f,G=0;G<R.length;G++)N.appendChild(R[G]===` `?document.createTextNode(` `):r(R[G]));if(a&&u){if(H=j.textContent=H.substring(U.length+1,H.length),L=N.getBoundingClientRect(),L.top>C.top&&L.left<=C.left){for(z=e.cloneNode(),B=e.childNodes[0];B&&B!==N;)V=B,B=B.nextSibling,z.appendChild(V);e.parentNode.insertBefore(z,e),i&&x(z)}C=L}(I<M.length||F)&&S(I>=M.length?` `:O&&U.slice(-1)===` `?` `+k:k,e,j)}e.removeChild(j),E=0}else j.nodeType===1&&(o&&o.indexOf(j)>-1?(D.indexOf(j.previousSibling)>-1&&D[D.length-1].appendChild(j),E=j):(T(j,t,n,r,i,a,o,s,c,!0),E=0),i&&x(j))},E=class e{constructor(e,t){this.isSplit=!1,c(),this.elements=d(e),this.chars=[],this.words=[],this.lines=[],this.masks=[],this.vars=t,this.elements.forEach(e=>{var n;t.overwrite!==!1&&((n=e[o])==null||n._data.orig.filter(({element:t})=>t===e).forEach(y)),e[o]=this}),this._split=()=>this.isSplit&&this.split(this.vars);let n=[],r,i=()=>{let e=n.length,t;for(;e--;){t=n[e];let r=t.element.offsetWidth;if(r!==t.width){t.width=r,this._split();return}}};this._data={orig:n,obs:typeof ResizeObserver<`u`&&new ResizeObserver(()=>{clearTimeout(r),r=setTimeout(i,200)})},p(this),this.split(t)}split(e){return(this._ctx||m).add(()=>{this.isSplit&&this.revert(),this.vars=e=e||this.vars||{};let{type:t=`chars,words,lines`,aria:n=`auto`,deepSlice:r=!0,smartWrap:i,onSplit:o,autoSplit:s=!1,specialChars:c,mask:l}=this.vars,f=t.indexOf(`lines`)>-1,p=t.indexOf(`chars`)>-1,m=t.indexOf(`words`)>-1,h=p&&!m&&!f,y=c&&(`push`in c?RegExp(`(?:`+c.join(`|`)+`)`,`gu`):c),b=y?RegExp(y.source+`|`+g.source,`gu`):g,x=!!e.ignore&&d(e.ignore),{orig:S,animTime:E,obs:D}=this._data,O;(p||m||f)&&(this.elements.forEach((t,a)=>{S[a]={element:t,html:t.innerHTML,ariaL:t.getAttribute(`aria-label`),ariaH:t.getAttribute(`aria-hidden`)},n===`auto`?t.setAttribute(`aria-label`,(t.textContent||``).trim()):n===`hidden`&&t.setAttribute(`aria-hidden`,`true`);let o=[],s=[],c=[],l=p?C(`char`,e,o):null,d=C(`word`,e,s),g,E,D,O;if(T(t,e,d,l,h,r&&(f||h),x,b,y,!1),f){let n=u(t.childNodes),r=w(t,n,e,c),i,a=[],o=0,s=n.map(e=>e.nodeType===1?e.getBoundingClientRect():_),l=_,d;for(g=0;g<n.length;g++)i=n[g],i.nodeType===1&&(i.nodeName===`BR`?((!g||n[g-1].nodeName!==`BR`)&&(a.push(i),r(o,g+1)),o=g+1,l=v(s,g)):(d=s[g],g&&d.top>l.top&&d.left<l.left+l.width-1&&(r(o,g),o=g),l=d));o<g&&r(o,g),a.forEach(e=>e.parentNode?.removeChild(e))}if(!m){for(g=0;g<s.length;g++)if(E=s[g],p||!E.nextSibling||E.nextSibling.nodeType!==3)if(i&&!f){for(D=document.createElement(`span`),D.style.whiteSpace=`nowrap`;E.firstChild;)D.appendChild(E.firstChild);E.replaceWith(D)}else E.replaceWith(...E.childNodes);else O=E.nextSibling,O&&O.nodeType===3&&(O.textContent=(E.textContent||``)+(O.textContent||``),E.remove());s.length=0,t.normalize()}this.lines.push(...c),this.words.push(...s),this.chars.push(...o)}),l&&this[l]&&this.masks.push(...this[l].map(e=>{let t=e.cloneNode();return e.replaceWith(t),t.appendChild(e),e.className&&(t.className=e.className.trim()+`-mask`),t.style.overflow=`clip`,t}))),this.isSplit=!0,a&&f&&(s?a.addEventListener(`loadingdone`,this._split):a.status===`loading`&&console.warn(`SplitText called before fonts loaded`)),(O=o&&o(this))&&O.totalTime&&(this._data.anim=E?O.totalTime(E):O),f&&s&&this.elements.forEach((e,t)=>{S[t].width=e.offsetWidth,D&&D.observe(e)})}),this}kill(){let{obs:e}=this._data;e&&e.disconnect(),a?.removeEventListener(`loadingdone`,this._split)}revert(){var e,t;if(this.isSplit){let{orig:n,anim:r}=this._data;this.kill(),n.forEach(y),this.chars.length=this.words.length=this.lines.length=n.length=this.masks.length=0,this.isSplit=!1,r&&(this._data.animTime=r.totalTime(),r.revert()),(t=(e=this.vars).onRevert)==null||t.call(e,this)}return this}static create(t,n){return new e(t,n)}static register(e){i=i||e||window.gsap,i&&(u=i.utils.toArray,p=i.core.context||p),!s&&window.innerWidth>0&&(a=document.fonts,s=!0)}};E.version=`3.14.2`;var D=E;t({onComplete(e,t,n){n.forEach(e=>e.remove());let r=new Set,i=new Set;e=e.replace(/\/\*[\s\S]*?\*\//g,``);let a=e.replace(/([^,{\r\n]+?)::?nth-letter[ \t]*\(([^\n)]*)\)/gi,(e,t,n)=>(t=t.trim(),r.add(t),i.add(n),`${t}::part(nth-child\\(${CSS.escape(n)}\\))`));document.head.insertAdjacentHTML(`beforeend`,`<style>${a}</style>`),r.forEach(e=>{document.querySelectorAll(e).forEach(e=>{if(e.shadowRoot||e.hasAttribute(`data-nth-letter`))return;let t=e.attachShadow({mode:`closed`});e.setAttribute(`data-nth-letter`,`attached`);let n=document.createElement(`span`);n.setAttribute(`aria-hidden`,`true`),n.innerHTML=e.innerHTML,t.appendChild(n),new D(n,{type:`chars`,charsClass:`char`}),i.forEach((e,t)=>{n.querySelectorAll(`.char:nth-child(${e})`).forEach(t=>{let n=t.part||``;t.part=(n?n+` `:``)+`nth-child(${e})`})})})})}})});
|