"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});/*!
 * SplitText 3.13.0
 * https://gsap.com
 *
 * @license Copyright 2025, GreenSock. All rights reserved. Subject to the terms at https://gsap.com/standard-license.
 * @author: Jack Doyle
 */let D,M,G,ne=()=>G||Q.register(window.gsap),V=typeof Intl!="undefined"?new Intl.Segmenter:0,q=e=>typeof e=="string"?q(document.querySelectorAll(e)):"length"in e?Array.from(e):[e],X=e=>q(e).filter(t=>t instanceof HTMLElement),J=[],$=function(){},le=/\s+/g,Y=new 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"),Z={left:0,top:0,width:0,height:0},ee=(e,t)=>{if(t){let n=new Set(e.join("").match(t)||J),i=e.length,o,f,s,a;if(n.size)for(;--i>-1;){f=e[i];for(s of n)if(s.startsWith(f)&&s.length>f.length){for(o=0,a=f;s.startsWith(a+=e[i+ ++o])&&a.length<s.length;);if(o&&a.length===s.length){e[i]=s,e.splice(i+1,o);break}}}}return e},te=e=>window.getComputedStyle(e).display==="inline"&&(e.style.display="inline-block"),F=(e,t,n)=>t.insertBefore(typeof e=="string"?document.createTextNode(e):e,n),K=(e,t,n)=>{let i=t[e+"sClass"]||"",{tag:o="div",aria:f="auto",propIndex:s=!1}=t,a=e==="line"?"block":"inline-block",d=i.indexOf("++")>-1,b=S=>{let g=document.createElement(o),y=n.length+1;return i&&(g.className=i+(d?" "+i+y:"")),s&&g.style.setProperty("--"+e,y+""),f!=="none"&&g.setAttribute("aria-hidden","true"),o!=="span"&&(g.style.position="relative",g.style.display=a),g.textContent=S,n.push(g),g};return d&&(i=i.replace("++","")),b.collection=n,b},oe=(e,t,n,i)=>{let o=K("line",n,i),f=window.getComputedStyle(e).textAlign||"left";return(s,a)=>{let d=o("");for(d.style.textAlign=f,e.insertBefore(d,t[s]);s<a;s++)d.appendChild(t[s]);d.normalize()}},ie=(e,t,n,i,o,f,s,a,d,b)=>{var S;let g=Array.from(e.childNodes),y=0,{wordDelimiter:N,reduceWhiteSpace:R=!0,prepareText:P}=t,H=e.getBoundingClientRect(),k=H,z=!R&&window.getComputedStyle(e).whiteSpace.substring(0,3)==="pre",_=0,v=n.collection,l,c,I,r,m,x,O,h,u,A,C,W,T,L,w,p,B,E;for(typeof N=="object"?(I=N.delimiter||N,c=N.replaceWith||""):c=N===""?"":N||" ",l=c!==" ";y<g.length;y++)if(r=g[y],r.nodeType===3){for(w=r.textContent||"",R?w=w.replace(le," "):z&&(w=w.replace(/\n/g,c+`
`)),P&&(w=P(w,e)),r.textContent=w,m=c||I?w.split(I||c):w.match(a)||J,B=m[m.length-1],h=l?B.slice(-1)===" ":!B,B||m.pop(),k=H,O=l?m[0].charAt(0)===" ":!m[0],O&&F(" ",e,r),m[0]||m.shift(),ee(m,d),f&&b||(r.textContent=""),u=1;u<=m.length;u++)if(p=m[u-1],!R&&z&&p.charAt(0)===`
`&&((S=r.previousSibling)==null||S.remove(),F(document.createElement("br"),e,r),p=p.slice(1)),!R&&p==="")F(c,e,r);else if(p===" ")e.insertBefore(document.createTextNode(" "),r);else{if(l&&p.charAt(0)===" "&&F(" ",e,r),_&&u===1&&!O&&v.indexOf(_.parentNode)>-1?(x=v[v.length-1],x.appendChild(document.createTextNode(i?"":p))):(x=n(i?"":p),F(x,e,r),_&&u===1&&!O&&x.insertBefore(_,x.firstChild)),i)for(C=V?ee([...V.segment(p)].map(j=>j.segment),d):p.match(a)||J,E=0;E<C.length;E++)x.appendChild(C[E]===" "?document.createTextNode(" "):i(C[E]));if(f&&b){if(w=r.textContent=w.substring(p.length+1,w.length),A=x.getBoundingClientRect(),A.top>k.top&&A.left<=k.left){for(W=e.cloneNode(),T=e.childNodes[0];T&&T!==x;)L=T,T=T.nextSibling,W.appendChild(L);e.parentNode.insertBefore(W,e),o&&te(W)}k=A}(u<m.length||h)&&F(u>=m.length?" ":l&&p.slice(-1)===" "?" "+c:c,e,r)}e.removeChild(r),_=0}else r.nodeType===1&&(s&&s.indexOf(r)>-1?(v.indexOf(r.previousSibling)>-1&&v[v.length-1].appendChild(r),_=r):(ie(r,t,n,i,o,f,s,a,d,!0),_=0),o&&te(r))};const se=class re{constructor(t,n){this.isSplit=!1,ne(),this.elements=X(t),this.chars=[],this.words=[],this.lines=[],this.masks=[],this.vars=n,this._split=()=>this.isSplit&&this.split(this.vars);let i=[],o,f=()=>{let s=i.length,a;for(;s--;){a=i[s];let d=a.element.offsetWidth;if(d!==a.width){a.width=d,this._split();return}}};this._data={orig:i,obs:typeof ResizeObserver!="undefined"&&new ResizeObserver(()=>{clearTimeout(o),o=setTimeout(f,200)})},$(this),this.split(n)}split(t){this.isSplit&&this.revert(),this.vars=t=t||this.vars||{};let{type:n="chars,words,lines",aria:i="auto",deepSlice:o=!0,smartWrap:f,onSplit:s,autoSplit:a=!1,specialChars:d,mask:b}=this.vars,S=n.indexOf("lines")>-1,g=n.indexOf("chars")>-1,y=n.indexOf("words")>-1,N=g&&!y&&!S,R=d&&("push"in d?new RegExp("(?:"+d.join("|")+")","gu"):d),P=R?new RegExp(R.source+"|"+Y.source,"gu"):Y,H=!!t.ignore&&X(t.ignore),{orig:k,animTime:z,obs:_}=this._data,v;return(g||y||S)&&(this.elements.forEach((l,c)=>{k[c]={element:l,html:l.innerHTML,ariaL:l.getAttribute("aria-label"),ariaH:l.getAttribute("aria-hidden")},i==="auto"?l.setAttribute("aria-label",(l.textContent||"").trim()):i==="hidden"&&l.setAttribute("aria-hidden","true");let I=[],r=[],m=[],x=g?K("char",t,I):null,O=K("word",t,r),h,u,A,C;if(ie(l,t,O,x,N,o&&(S||N),H,P,R,!1),S){let W=q(l.childNodes),T=oe(l,W,t,m),L,w=[],p=0,B=W.map(j=>j.nodeType===1?j.getBoundingClientRect():Z),E=Z;for(h=0;h<W.length;h++)L=W[h],L.nodeType===1&&(L.nodeName==="BR"?(w.push(L),T(p,h+1),p=h+1,E=B[p]):(h&&B[h].top>E.top&&B[h].left<=E.left&&(T(p,h),p=h),E=B[h]));p<h&&T(p,h),w.forEach(j=>{var U;return(U=j.parentNode)==null?void 0:U.removeChild(j)})}if(!y){for(h=0;h<r.length;h++)if(u=r[h],g||!u.nextSibling||u.nextSibling.nodeType!==3)if(f&&!S){for(A=document.createElement("span"),A.style.whiteSpace="nowrap";u.firstChild;)A.appendChild(u.firstChild);u.replaceWith(A)}else u.replaceWith(...u.childNodes);else C=u.nextSibling,C&&C.nodeType===3&&(C.textContent=(u.textContent||"")+(C.textContent||""),u.remove());r.length=0,l.normalize()}this.lines.push(...m),this.words.push(...r),this.chars.push(...I)}),b&&this[b]&&this.masks.push(...this[b].map(l=>{let c=l.cloneNode();return l.replaceWith(c),c.appendChild(l),l.className&&(c.className=l.className.replace(/(\b\w+\b)/g,"$1-mask")),c.style.overflow="clip",c}))),this.isSplit=!0,M&&(a?M.addEventListener("loadingdone",this._split):M.status==="loading"&&console.warn("SplitText called before fonts loaded")),(v=s&&s(this))&&v.totalTime&&(this._data.anim=z?v.totalTime(z):v),S&&a&&this.elements.forEach((l,c)=>{k[c].width=l.offsetWidth,_&&_.observe(l)}),this}revert(){var t,n;let{orig:i,anim:o,obs:f}=this._data;return f&&f.disconnect(),i.forEach(({element:s,html:a,ariaL:d,ariaH:b})=>{s.innerHTML=a,d?s.setAttribute("aria-label",d):s.removeAttribute("aria-label"),b?s.setAttribute("aria-hidden",b):s.removeAttribute("aria-hidden")}),this.chars.length=this.words.length=this.lines.length=i.length=this.masks.length=0,this.isSplit=!1,M==null||M.removeEventListener("loadingdone",this._split),o&&(this._data.animTime=o.totalTime(),o.revert()),(n=(t=this.vars).onRevert)==null||n.call(t,this),this}static create(t,n){return new re(t,n)}static register(t){D=D||t||window.gsap,D&&(q=D.utils.toArray,$=D.core.context||$),!G&&window.innerWidth>0&&(M=document.fonts,G=!0)}};se.version="3.13.0";let Q=se;exports.SplitText=Q;exports.default=Q;
