title-switcher 2.1.16 → 2.1.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/browser/titleSwitcher.js +52 -8
- package/browser/titleSwitcher.min.js +1 -1
- package/dist/main.js +52 -8
- package/dist/main.min.js +1 -1
- package/package.json +1 -1
package/browser/titleSwitcher.js
CHANGED
|
@@ -256,10 +256,41 @@
|
|
|
256
256
|
return self
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
259
|
+
* Count how many typed "units" domObject's text takes to fully reveal via typedPartialHtml - one unit per
|
|
260
|
+
* non-whitespace character, but a whole run of consecutive whitespace (most often the newline and indentation
|
|
261
|
+
* left behind where a title's HTML source wraps onto a new line) counts as a single unit, matching how many
|
|
262
|
+
* steps typedPartialHtml actually needs to reveal it all. Typing through that whitespace one character at a
|
|
263
|
+
* time would type through several units a browser renders as a single collapsed space, with no visible change
|
|
264
|
+
* in between - not a slower typing speed, but a real stall followed by the next word suddenly catching up.
|
|
265
|
+
* @param domObject
|
|
266
|
+
*/
|
|
267
|
+
const typedLength = domObject => {
|
|
268
|
+
let length = 0
|
|
269
|
+
Array.prototype.forEach.call(domObject.childNodes, child => {
|
|
270
|
+
if (child.nodeType === 3) {
|
|
271
|
+
const text = child.textContent || ''
|
|
272
|
+
let position = 0
|
|
273
|
+
while (position < text.length) {
|
|
274
|
+
if (/\s/.test(text[position])) {
|
|
275
|
+
while (position < text.length && /\s/.test(text[position])) {
|
|
276
|
+
++position
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
++position
|
|
280
|
+
}
|
|
281
|
+
++length
|
|
282
|
+
}
|
|
283
|
+
} else if (child.nodeType === 1) {
|
|
284
|
+
length += typedLength(child)
|
|
285
|
+
}
|
|
286
|
+
})
|
|
287
|
+
return length
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Build the markup for the first `remaining` typed units of domObject's text (see typedLength), keeping
|
|
291
|
+
* whichever of its nested tags (em, strong, ...) that content falls under. This lets the typing effect reveal
|
|
292
|
+
* a title's formatting as each character is typed, instead of only applying it once the whole tag has been
|
|
293
|
+
* typed out.
|
|
263
294
|
* @param domObject
|
|
264
295
|
* @param remaining
|
|
265
296
|
*/
|
|
@@ -270,9 +301,22 @@
|
|
|
270
301
|
const child = children[i]
|
|
271
302
|
if (child.nodeType === 3) {
|
|
272
303
|
const text = child.textContent || ''
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
remaining
|
|
304
|
+
let position = 0
|
|
305
|
+
let taken = ''
|
|
306
|
+
while (position < text.length && remaining > 0) {
|
|
307
|
+
if (/\s/.test(text[position])) {
|
|
308
|
+
const runStart = position
|
|
309
|
+
while (position < text.length && /\s/.test(text[position])) {
|
|
310
|
+
++position
|
|
311
|
+
}
|
|
312
|
+
taken += text.slice(runStart, position)
|
|
313
|
+
} else {
|
|
314
|
+
taken += text[position]
|
|
315
|
+
++position
|
|
316
|
+
}
|
|
317
|
+
--remaining
|
|
318
|
+
}
|
|
319
|
+
html += taken
|
|
276
320
|
} else if (child.nodeType === 1) {
|
|
277
321
|
const result = typedPartialHtml(child, remaining)
|
|
278
322
|
if (result.html) {
|
|
@@ -331,7 +375,7 @@
|
|
|
331
375
|
self.typeSurface.innerHTML = ''
|
|
332
376
|
self.cursorBlink(true, self)
|
|
333
377
|
// Copy each letter from the current title, keeping whichever tags (em, strong, ...) it falls under
|
|
334
|
-
const totalLength = domObject
|
|
378
|
+
const totalLength = typedLength(domObject)
|
|
335
379
|
for (let i = 0; i < totalLength; ++i) {
|
|
336
380
|
setTimeout(() => {
|
|
337
381
|
// Reveal one more character, wrapped in whatever tags its position in the title falls under,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function t(e,n,r){function i(o,a){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!a&&l)return l(o,!0);if(s)return s(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};e[o][0].call(u.exports,(function(t){return i(e[o][1][t]||t)}),u,u.exports,t,e,n,r)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(t,e,n){"use strict";t("core-js/modules/esnext.weak-map.delete-all.js");const r=function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n},i=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)};let s,o,a,l,c,u,f,p,y,h;Object.defineProperty(n,"__esModule",{value:!0});class b{constructor(t="",e="typingEffect"){s.set(this,!1),o.set(this,"displayTitle"),a.set(this,0),l.set(this,200),c.set(this,400),u.set(this,!1),f.set(this,[]),p.set(this,""),y.set(this,void 0),h.set(this,void 0),r(this,o,"displayTitle","f"),r(this,y,"string"==typeof e?"function"==typeof this[e]?this[e]:this.typingEffect:e,"f"),r(this,p,t,"f"),r(this,f,[],"f");const n=t?document.querySelectorAll(t):[];n&&n[0]&&(r(this,p,n[0],"f"),r(this,f,n[0].children,"f"))}get active(){return i(this,s,"f")}get currentClass(){return i(this,o,"f")}get currentIndex(){return i(this,a,"f")}get delayEffect(){return i(this,l,"f")}get delaySwitch(){return i(this,c,"f")}get switchStyle(){return i(this,y,"f")}get titles(){return i(this,f,"f")}get typeSurface(){return i(this,h,"f")}startTitles({delaySwitch:t=400,delayEffect:e=200,isRandom:n=!1,immediatePause:b=!1}={}){const d="typeSurface";if(r(this,c,t,"f"),r(this,l,e,"f"),r(this,u,n,"f"),r(this,s,!b,"f"),i(this,a,"f")>=i(this,f,"f").length||"string"==typeof i(this,p,"f"))return r(this,s,!1,"f"),console.warn(`No titles found for '${i(this,p,"f")}'`),this;i(this,u,"f")&&r(this,a,Math.round(Math.random()*(i(this,f,"f").length-2))+1,"f");const m=i(this,f,"f")[i(this,a,"f")];m.classList?m.classList.add(i(this,o,"f")):m.className+=" "+i(this,o,"f");const v=i(this,f,"f")[0].cloneNode(!0);return v.classList?v.classList.add(d):v.className+=" "+d,v.classList?v.classList.remove(i(this,o,"f")):v.className=v.className.replace(new RegExp("(^|\\b)"+v.className.split(" ").join("|")+"(\\b|$)","gi")," "),i(this,p,"f").insertBefore(v,i(this,p,"f").firstChild),r(this,h,i(this,p,"f").querySelectorAll("."+d)[0],"f"),i(this,h,"f").innerHTML="",i(this,h,"f").style.display="block",Array.prototype.forEach.call(i(this,f,"f"),(function(t){t.style.display="none"})),this.switchTitle(m,i(this,y,"f"),this)}pause(){r(this,s,!1,"f")}resume(){i(this,s,"f")||(r(this,s,!0,"f"),this.switchTitle(i(this,f,"f")[i(this,a,"f")],i(this,y,"f"),this))}switchTitle(t,e,n,o=!1){let l=1;const c=i(n=n||this,f,"f").length;for(let e=1;e<c;++e)if(i(n,f,"f")[e]===t){l=e;break}if(!i(n,s,"f"))return r(n,a,l,"f"),n;const p=i(n,f,"f").length-1;let y=1;if(1===p)return e(t,o?()=>n:n.switchTitle,n,o);if(i(n,u,"f")){n.typeSurface.textContent.trim()||(l=-1);do{y=Math.round(Math.random()*(p-1))+1}while(y===l)}else n.typeSurface.textContent.trim()||(l=p),y=l<p?l+1:1;const h=i(n,f,"f")[y];return t.classList?t.classList.remove(n.currentClass):t.className=t.className.replace(new RegExp("(^|\\b)"+t.className.split(" ").join("|")+"(\\b|$)","gi")," "),h.classList?h.classList.add(n.currentClass):h.className+=" "+n.currentClass,e(h,o?()=>n:n.switchTitle,n,o)}}s=new WeakMap,o=new WeakMap,a=new WeakMap,l=new WeakMap,c=new WeakMap,u=new WeakMap,f=new WeakMap,p=new WeakMap,y=new WeakMap,h=new WeakMap,b.prototype.cursorBlink=(t,e)=>(e=e||void 0,t?(e.typeSurface.innerHTML=e.typeSurface.innerHTML.replace(/\|| *(<\/span>)?$/,"$1").trim(),e.typeSurface.innerHTML=e.typeSurface.innerHTML+'<span style="display: inline-block;font-weight: normal; color: black; text-decoration: none">|</span>'):e.typeSurface.innerHTML=e.typeSurface.innerHTML.replace(/\|(<\/span>)$/," $1"),e);const d=(t,e)=>{let n="";const r=Array.prototype.slice.call(t.childNodes);for(let t=0;t<r.length&&e>0;++t){const i=r[t];if(3===i.nodeType){const t=i.textContent||"",r=Math.min(e,t.length);n+=t.slice(0,r),e-=r}else if(1===i.nodeType){const t=d(i,e);if(t.html){const e=i.cloneNode(!1);e.innerHTML=t.html,n+=e.outerHTML}e=t.remaining}}return{html:n,remaining:e}};b.prototype.typingEffect=(t,e,n,r=!1)=>{const i=(n=n||void 0).titles.length;let s=0;for(let e=1;e<i;++e)if(n.titles[e]===t){s=e;break}t=t||n.titles[s+1];let o=!0;n.typeSurface.hasAttribute("style")&&n.typeSurface.removeAttribute("style"),t.hasAttribute("style")&&n.typeSurface.setAttribute("style",t.getAttribute("style")),n.typeSurface.innerHTML="",n.typeSurface.style.display="block";for(let t=0;t<4;++t)setTimeout((()=>{n.cursorBlink(o,n),o=!o}),t*n.delaySwitch);return setTimeout((()=>{n.typeSurface.innerHTML="",n.cursorBlink(!0,n);const i=t.textContent.length;for(let s=0;s<i;++s)setTimeout((()=>{if(n.typeSurface.innerHTML=d(t,s+1).html+'<span style="font-weight: normal; color: black; text-decoration: none">|</span>',t.textContent+"|"===n.typeSurface.textContent){n.typeSurface.innerHTML=t.innerHTML+'<span style="font-weight: normal; color: black; text-decoration: none">|</span>';for(let i=0;i<8;++i)setTimeout((()=>{--i,n.cursorBlink(o,n),0===i&&e(t,r?()=>n:n.switchStyle,n,r)}),i*n.delaySwitch)}}),s*n.delayEffect)}),4*n.delaySwitch),n},n.default=b,"undefined"!=typeof window&&(window.TitleSwitcher=b)},{"core-js/modules/esnext.weak-map.delete-all.js":69}],2:[function(t,e,n){"use strict";var r=t("../internals/is-callable"),i=t("../internals/try-to-string"),s=TypeError;e.exports=function(t){if(r(t))return t;throw new s(i(t)+" is not a function")}},{"../internals/is-callable":32,"../internals/try-to-string":62}],3:[function(t,e,n){"use strict";var r=t("../internals/weak-map-helpers").has;e.exports=function(t){return r(t),t}},{"../internals/weak-map-helpers":67}],4:[function(t,e,n){"use strict";var r=t("../internals/is-object"),i=String,s=TypeError;e.exports=function(t){if(r(t))return t;throw new s(i(t)+" is not an object")}},{"../internals/is-object":35}],5:[function(t,e,n){"use strict";var r=t("../internals/to-indexed-object"),i=t("../internals/to-absolute-index"),s=t("../internals/length-of-array-like"),o=function(t){return function(e,n,o){var a=r(e),l=s(a);if(0===l)return!t&&-1;var c,u=i(o,l);if(t&&n!=n){for(;l>u;)if((c=a[u++])!=c)return!0}else for(;l>u;u++)if((t||u in a)&&a[u]===n)return t||u||0;return!t&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},{"../internals/length-of-array-like":38,"../internals/to-absolute-index":55,"../internals/to-indexed-object":56}],6:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=r({}.toString),s=r("".slice);e.exports=function(t){return s(i(t),8,-1)}},{"../internals/function-uncurry-this":22}],7:[function(t,e,n){"use strict";var r=t("../internals/has-own-property"),i=t("../internals/own-keys"),s=t("../internals/object-get-own-property-descriptor"),o=t("../internals/object-define-property");e.exports=function(t,e,n){for(var a=i(e),l=o.f,c=s.f,u=0;u<a.length;u++){var f=a[u];r(t,f)||n&&r(n,f)||l(t,f,c(e,f))}}},{"../internals/has-own-property":26,"../internals/object-define-property":41,"../internals/object-get-own-property-descriptor":42,"../internals/own-keys":49}],8:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/object-define-property"),s=t("../internals/create-property-descriptor");e.exports=r?function(t,e,n){return i.f(t,e,s(1,n))}:function(t,e,n){return t[e]=n,t}},{"../internals/create-property-descriptor":9,"../internals/descriptors":12,"../internals/object-define-property":41}],9:[function(t,e,n){"use strict";e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},{}],10:[function(t,e,n){"use strict";var r=t("../internals/is-callable"),i=t("../internals/object-define-property"),s=t("../internals/make-built-in"),o=t("../internals/define-global-property");e.exports=function(t,e,n,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:e;if(r(n)&&s(n,c,a),a.global)l?t[e]=n:o(e,n);else{try{a.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=n:i.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},{"../internals/define-global-property":11,"../internals/is-callable":32,"../internals/make-built-in":39,"../internals/object-define-property":41}],11:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=Object.defineProperty;e.exports=function(t,e){try{i(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},{"../internals/global-this":25}],12:[function(t,e,n){"use strict";var r=t("../internals/fails");e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},{"../internals/fails":18}],13:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=t("../internals/is-object"),s=r.document,o=i(s)&&i(s.createElement);e.exports=function(t){return o?s.createElement(t):{}}},{"../internals/global-this":25,"../internals/is-object":35}],14:[function(t,e,n){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],15:[function(t,e,n){"use strict";var r=t("../internals/global-this").navigator,i=r&&r.userAgent;e.exports=i?String(i):""},{"../internals/global-this":25}],16:[function(t,e,n){"use strict";var r,i,s=t("../internals/global-this"),o=t("../internals/environment-user-agent"),a=s.process,l=s.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(i=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},{"../internals/environment-user-agent":15,"../internals/global-this":25}],17:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=t("../internals/object-get-own-property-descriptor").f,s=t("../internals/create-non-enumerable-property"),o=t("../internals/define-built-in"),a=t("../internals/define-global-property"),l=t("../internals/copy-constructor-properties"),c=t("../internals/is-forced");e.exports=function(t,e){var n,u,f,p,y,h=t.target,b=t.global,d=t.stat;if(n=b?r:d?r[h]||a(h,{}):r[h]&&r[h].prototype)for(u in e){if(p=e[u],f=t.dontCallGetSet?(y=i(n,u))&&y.value:n[u],!c(b?u:h+(d?".":"#")+u,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;l(p,f)}(t.sham||f&&f.sham)&&s(p,"sham",!0),o(n,u,p,t)}}},{"../internals/copy-constructor-properties":7,"../internals/create-non-enumerable-property":8,"../internals/define-built-in":10,"../internals/define-global-property":11,"../internals/global-this":25,"../internals/is-forced":33,"../internals/object-get-own-property-descriptor":42}],18:[function(t,e,n){"use strict";e.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],19:[function(t,e,n){"use strict";var r=t("../internals/fails");e.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},{"../internals/fails":18}],20:[function(t,e,n){"use strict";var r=t("../internals/function-bind-native"),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},{"../internals/function-bind-native":19}],21:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/has-own-property"),s=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,a=i(s,"name"),l=a&&"something"===function(){}.name,c=a&&(!r||r&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},{"../internals/descriptors":12,"../internals/has-own-property":26}],22:[function(t,e,n){"use strict";var r=t("../internals/function-bind-native"),i=Function.prototype,s=i.call,o=r&&i.bind.bind(s,s);e.exports=r?o:function(t){return function(){return s.apply(t,arguments)}}},{"../internals/function-bind-native":19}],23:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=t("../internals/is-callable");e.exports=function(t,e){return arguments.length<2?(n=r[t],i(n)?n:void 0):r[t]&&r[t][e];var n}},{"../internals/global-this":25,"../internals/is-callable":32}],24:[function(t,e,n){"use strict";var r=t("../internals/a-callable"),i=t("../internals/is-null-or-undefined");e.exports=function(t,e){var n=t[e];return i(n)?void 0:r(n)}},{"../internals/a-callable":2,"../internals/is-null-or-undefined":34}],25:[function(t,e,n){(function(t){(function(){"use strict";var n=function(t){return t&&t.Math===Math&&t};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],26:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=t("../internals/to-object"),s=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(t,e){return s(i(t),e)}},{"../internals/function-uncurry-this":22,"../internals/to-object":59}],27:[function(t,e,n){"use strict";e.exports={}},{}],28:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/fails"),s=t("../internals/document-create-element");e.exports=!r&&!i((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},{"../internals/descriptors":12,"../internals/document-create-element":13,"../internals/fails":18}],29:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=t("../internals/fails"),s=t("../internals/classof-raw"),o=Object,a=r("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(t){return"String"===s(t)?a(t,""):o(t)}:o},{"../internals/classof-raw":6,"../internals/fails":18,"../internals/function-uncurry-this":22}],30:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=t("../internals/is-callable"),s=t("../internals/shared-store"),o=r(Function.toString);i(s.inspectSource)||(s.inspectSource=function(t){return o(t)}),e.exports=s.inspectSource},{"../internals/function-uncurry-this":22,"../internals/is-callable":32,"../internals/shared-store":52}],31:[function(t,e,n){"use strict";var r,i,s,o=t("../internals/weak-map-basic-detection"),a=t("../internals/global-this"),l=t("../internals/is-object"),c=t("../internals/create-non-enumerable-property"),u=t("../internals/has-own-property"),f=t("../internals/shared-store"),p=t("../internals/shared-key"),y=t("../internals/hidden-keys"),h="Object already initialized",b=a.TypeError,d=a.WeakMap;if(o||f.state){var m=f.state||(f.state=new d);m.get=m.get,m.has=m.has,m.set=m.set,r=function(t,e){if(m.has(t))throw new b(h);return e.facade=t,m.set(t,e),e},i=function(t){return m.get(t)||{}},s=function(t){return m.has(t)}}else{var v=p("state");y[v]=!0,r=function(t,e){if(u(t,v))throw new b(h);return e.facade=t,c(t,v,e),e},i=function(t){return u(t,v)?t[v]:{}},s=function(t){return u(t,v)}}e.exports={set:r,get:i,has:s,enforce:function(t){return s(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=i(e)).type!==t)throw new b("Incompatible receiver, "+t+" required");return n}}}},{"../internals/create-non-enumerable-property":8,"../internals/global-this":25,"../internals/has-own-property":26,"../internals/hidden-keys":27,"../internals/is-object":35,"../internals/shared-key":51,"../internals/shared-store":52,"../internals/weak-map-basic-detection":66}],32:[function(t,e,n){"use strict";var r="object"==typeof document&&document.all;e.exports=void 0===r&&void 0!==r?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}},{}],33:[function(t,e,n){"use strict";var r=t("../internals/fails"),i=t("../internals/is-callable"),s=/#|\.prototype\./,o=function(t,e){var n=l[a(t)];return n===u||n!==c&&(i(e)?r(e):!!e)},a=o.normalize=function(t){return String(t).replace(s,".").toLowerCase()},l=o.data={},c=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},{"../internals/fails":18,"../internals/is-callable":32}],34:[function(t,e,n){"use strict";e.exports=function(t){return null==t}},{}],35:[function(t,e,n){"use strict";var r=t("../internals/is-callable");e.exports=function(t){return"object"==typeof t?null!==t:r(t)}},{"../internals/is-callable":32}],36:[function(t,e,n){"use strict";e.exports=!1},{}],37:[function(t,e,n){"use strict";var r=t("../internals/get-built-in"),i=t("../internals/is-callable"),s=t("../internals/object-is-prototype-of"),o=t("../internals/use-symbol-as-uid"),a=Object;e.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return i(e)&&s(e.prototype,a(t))}},{"../internals/get-built-in":23,"../internals/is-callable":32,"../internals/object-is-prototype-of":45,"../internals/use-symbol-as-uid":64}],38:[function(t,e,n){"use strict";var r=t("../internals/to-length");e.exports=function(t){return r(t.length)}},{"../internals/to-length":58}],39:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=t("../internals/fails"),s=t("../internals/is-callable"),o=t("../internals/has-own-property"),a=t("../internals/descriptors"),l=t("../internals/function-name").CONFIGURABLE,c=t("../internals/inspect-source"),u=t("../internals/internal-state"),f=u.enforce,p=u.get,y=String,h=Object.defineProperty,b=r("".slice),d=r("".replace),m=r([].join),v=a&&!i((function(){return 8!==h((function(){}),"length",{value:8}).length})),g=String(String).split("String"),w=e.exports=function(t,e,n){"Symbol("===b(y(e),0,7)&&(e="["+d(y(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!o(t,"name")||l&&t.name!==e)&&(a?h(t,"name",{value:e,configurable:!0}):t.name=e),v&&n&&o(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?a&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=f(t);return o(r,"source")||(r.source=m(g,"string"==typeof e?e:"")),t};Function.prototype.toString=w((function(){return s(this)&&p(this).source||c(this)}),"toString")},{"../internals/descriptors":12,"../internals/fails":18,"../internals/function-name":21,"../internals/function-uncurry-this":22,"../internals/has-own-property":26,"../internals/inspect-source":30,"../internals/internal-state":31,"../internals/is-callable":32}],40:[function(t,e,n){"use strict";var r=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(t){var e=+t;return(e>0?i:r)(e)}},{}],41:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/ie8-dom-define"),s=t("../internals/v8-prototype-define-bug"),o=t("../internals/an-object"),a=t("../internals/to-property-key"),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,f="enumerable",p="configurable",y="writable";n.f=r?s?function(t,e,n){if(o(t),e=a(e),o(n),"function"==typeof t&&"prototype"===e&&"value"in n&&y in n&&!n[y]){var r=u(t,e);r&&r[y]&&(t[e]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:f in n?n[f]:r[f],writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(o(t),e=a(e),o(n),i)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new l("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},{"../internals/an-object":4,"../internals/descriptors":12,"../internals/ie8-dom-define":28,"../internals/to-property-key":61,"../internals/v8-prototype-define-bug":65}],42:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/function-call"),s=t("../internals/object-property-is-enumerable"),o=t("../internals/create-property-descriptor"),a=t("../internals/to-indexed-object"),l=t("../internals/to-property-key"),c=t("../internals/has-own-property"),u=t("../internals/ie8-dom-define"),f=Object.getOwnPropertyDescriptor;n.f=r?f:function(t,e){if(t=a(t),e=l(e),u)try{return f(t,e)}catch(t){}if(c(t,e))return o(!i(s.f,t,e),t[e])}},{"../internals/create-property-descriptor":9,"../internals/descriptors":12,"../internals/function-call":20,"../internals/has-own-property":26,"../internals/ie8-dom-define":28,"../internals/object-property-is-enumerable":47,"../internals/to-indexed-object":56,"../internals/to-property-key":61}],43:[function(t,e,n){"use strict";var r=t("../internals/object-keys-internal"),i=t("../internals/enum-bug-keys").concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},{"../internals/enum-bug-keys":14,"../internals/object-keys-internal":46}],44:[function(t,e,n){"use strict";n.f=Object.getOwnPropertySymbols},{}],45:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this");e.exports=r({}.isPrototypeOf)},{"../internals/function-uncurry-this":22}],46:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=t("../internals/has-own-property"),s=t("../internals/to-indexed-object"),o=t("../internals/array-includes").indexOf,a=t("../internals/hidden-keys"),l=r([].push);e.exports=function(t,e){var n,r=s(t),c=0,u=[];for(n in r)!i(a,n)&&i(r,n)&&l(u,n);for(;e.length>c;)i(r,n=e[c++])&&(~o(u,n)||l(u,n));return u}},{"../internals/array-includes":5,"../internals/function-uncurry-this":22,"../internals/has-own-property":26,"../internals/hidden-keys":27,"../internals/to-indexed-object":56}],47:[function(t,e,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,s=i&&!r.call({1:2},1);n.f=s?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},{}],48:[function(t,e,n){"use strict";var r=t("../internals/function-call"),i=t("../internals/is-callable"),s=t("../internals/is-object"),o=TypeError;e.exports=function(t,e){var n,a;if("string"===e&&i(n=t.toString)&&!s(a=r(n,t)))return a;if(i(n=t.valueOf)&&!s(a=r(n,t)))return a;if("string"!==e&&i(n=t.toString)&&!s(a=r(n,t)))return a;throw new o("Can't convert object to primitive value")}},{"../internals/function-call":20,"../internals/is-callable":32,"../internals/is-object":35}],49:[function(t,e,n){"use strict";var r=t("../internals/get-built-in"),i=t("../internals/function-uncurry-this"),s=t("../internals/object-get-own-property-names"),o=t("../internals/object-get-own-property-symbols"),a=t("../internals/an-object"),l=i([].concat);e.exports=r("Reflect","ownKeys")||function(t){var e=s.f(a(t)),n=o.f;return n?l(e,n(t)):e}},{"../internals/an-object":4,"../internals/function-uncurry-this":22,"../internals/get-built-in":23,"../internals/object-get-own-property-names":43,"../internals/object-get-own-property-symbols":44}],50:[function(t,e,n){"use strict";var r=t("../internals/is-null-or-undefined"),i=TypeError;e.exports=function(t){if(r(t))throw new i("Can't call method on "+t);return t}},{"../internals/is-null-or-undefined":34}],51:[function(t,e,n){"use strict";var r=t("../internals/shared"),i=t("../internals/uid"),s=r("keys");e.exports=function(t){return s[t]||(s[t]=i(t))}},{"../internals/shared":53,"../internals/uid":63}],52:[function(t,e,n){"use strict";var r=t("../internals/is-pure"),i=t("../internals/global-this"),s=t("../internals/define-global-property"),o="__core-js_shared__",a=e.exports=i[o]||s(o,{});(a.versions||(a.versions=[])).push({version:"3.50.0",mode:r?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"})},{"../internals/define-global-property":11,"../internals/global-this":25,"../internals/is-pure":36}],53:[function(t,e,n){"use strict";var r=t("../internals/shared-store"),i=Object.create||Object;e.exports=function(t,e){return r[t]||(r[t]=e||i(null))}},{"../internals/shared-store":52}],54:[function(t,e,n){"use strict";var r=t("../internals/environment-v8-version"),i=t("../internals/fails"),s=t("../internals/global-this").String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},{"../internals/environment-v8-version":16,"../internals/fails":18,"../internals/global-this":25}],55:[function(t,e,n){"use strict";var r=t("../internals/to-integer-or-infinity"),i=Math.max,s=Math.min;e.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):s(n,e)}},{"../internals/to-integer-or-infinity":57}],56:[function(t,e,n){"use strict";var r=t("../internals/indexed-object"),i=t("../internals/require-object-coercible");e.exports=function(t){return r(i(t))}},{"../internals/indexed-object":29,"../internals/require-object-coercible":50}],57:[function(t,e,n){"use strict";var r=t("../internals/math-trunc");e.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},{"../internals/math-trunc":40}],58:[function(t,e,n){"use strict";var r=t("../internals/to-integer-or-infinity"),i=Math.min;e.exports=function(t){var e=r(t);return e>0?i(e,9007199254740991):0}},{"../internals/to-integer-or-infinity":57}],59:[function(t,e,n){"use strict";var r=t("../internals/require-object-coercible"),i=Object;e.exports=function(t){return i(r(t))}},{"../internals/require-object-coercible":50}],60:[function(t,e,n){"use strict";var r=t("../internals/function-call"),i=t("../internals/is-object"),s=t("../internals/is-symbol"),o=t("../internals/get-method"),a=t("../internals/ordinary-to-primitive"),l=t("../internals/well-known-symbol"),c=TypeError,u=l("toPrimitive");e.exports=function(t,e){if(!i(t)||s(t))return t;var n,l=o(t,u);if(l){if(void 0===e&&(e="default"),n=r(l,t,e),!i(n)||s(n))return n;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},{"../internals/function-call":20,"../internals/get-method":24,"../internals/is-object":35,"../internals/is-symbol":37,"../internals/ordinary-to-primitive":48,"../internals/well-known-symbol":68}],61:[function(t,e,n){"use strict";var r=t("../internals/to-primitive"),i=t("../internals/is-symbol");e.exports=function(t){var e=r(t,"string");return i(e)?e:e+""}},{"../internals/is-symbol":37,"../internals/to-primitive":60}],62:[function(t,e,n){"use strict";var r=String;e.exports=function(t){try{return r(t)}catch(t){return"Object"}}},{}],63:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=0,s=Math.random(),o=r(1.1.toString);e.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+o(++i+s,36)}},{"../internals/function-uncurry-this":22}],64:[function(t,e,n){"use strict";var r=t("../internals/symbol-constructor-detection");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/symbol-constructor-detection":54}],65:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/fails");e.exports=r&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},{"../internals/descriptors":12,"../internals/fails":18}],66:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=t("../internals/is-callable"),s=r.WeakMap;e.exports=i(s)&&/native code/.test(String(s))},{"../internals/global-this":25,"../internals/is-callable":32}],67:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=WeakMap.prototype;e.exports={WeakMap:WeakMap,set:r(i.set),get:r(i.get),has:r(i.has),remove:r(i.delete)}},{"../internals/function-uncurry-this":22}],68:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=t("../internals/shared"),s=t("../internals/has-own-property"),o=t("../internals/uid"),a=t("../internals/symbol-constructor-detection"),l=t("../internals/use-symbol-as-uid"),c=r.Symbol,u=i("wks"),f=l?c.for||c:c&&c.withoutSetter||o;e.exports=function(t){return s(u,t)||(u[t]=a&&s(c,t)?c[t]:f("Symbol."+t)),u[t]}},{"../internals/global-this":25,"../internals/has-own-property":26,"../internals/shared":53,"../internals/symbol-constructor-detection":54,"../internals/uid":63,"../internals/use-symbol-as-uid":64}],69:[function(t,e,n){"use strict";var r=t("../internals/export"),i=t("../internals/a-weak-map"),s=t("../internals/weak-map-helpers").remove;r({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=i(this),n=!0,r=0,o=arguments.length;r<o;r++)t=s(e,arguments[r]),n=n&&t;return!!n}})},{"../internals/a-weak-map":3,"../internals/export":17,"../internals/weak-map-helpers":67}]},{},[1]);
|
|
1
|
+
!function t(e,n,r){function i(o,a){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!a&&l)return l(o,!0);if(s)return s(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};e[o][0].call(u.exports,(function(t){return i(e[o][1][t]||t)}),u,u.exports,t,e,n,r)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(t,e,n){"use strict";t("core-js/modules/esnext.weak-map.delete-all.js");const r=function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n},i=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)};let s,o,a,l,c,u,f,p,y,h;Object.defineProperty(n,"__esModule",{value:!0});class b{constructor(t="",e="typingEffect"){s.set(this,!1),o.set(this,"displayTitle"),a.set(this,0),l.set(this,200),c.set(this,400),u.set(this,!1),f.set(this,[]),p.set(this,""),y.set(this,void 0),h.set(this,void 0),r(this,o,"displayTitle","f"),r(this,y,"string"==typeof e?"function"==typeof this[e]?this[e]:this.typingEffect:e,"f"),r(this,p,t,"f"),r(this,f,[],"f");const n=t?document.querySelectorAll(t):[];n&&n[0]&&(r(this,p,n[0],"f"),r(this,f,n[0].children,"f"))}get active(){return i(this,s,"f")}get currentClass(){return i(this,o,"f")}get currentIndex(){return i(this,a,"f")}get delayEffect(){return i(this,l,"f")}get delaySwitch(){return i(this,c,"f")}get switchStyle(){return i(this,y,"f")}get titles(){return i(this,f,"f")}get typeSurface(){return i(this,h,"f")}startTitles({delaySwitch:t=400,delayEffect:e=200,isRandom:n=!1,immediatePause:b=!1}={}){const d="typeSurface";if(r(this,c,t,"f"),r(this,l,e,"f"),r(this,u,n,"f"),r(this,s,!b,"f"),i(this,a,"f")>=i(this,f,"f").length||"string"==typeof i(this,p,"f"))return r(this,s,!1,"f"),console.warn(`No titles found for '${i(this,p,"f")}'`),this;i(this,u,"f")&&r(this,a,Math.round(Math.random()*(i(this,f,"f").length-2))+1,"f");const g=i(this,f,"f")[i(this,a,"f")];g.classList?g.classList.add(i(this,o,"f")):g.className+=" "+i(this,o,"f");const v=i(this,f,"f")[0].cloneNode(!0);return v.classList?v.classList.add(d):v.className+=" "+d,v.classList?v.classList.remove(i(this,o,"f")):v.className=v.className.replace(new RegExp("(^|\\b)"+v.className.split(" ").join("|")+"(\\b|$)","gi")," "),i(this,p,"f").insertBefore(v,i(this,p,"f").firstChild),r(this,h,i(this,p,"f").querySelectorAll("."+d)[0],"f"),i(this,h,"f").innerHTML="",i(this,h,"f").style.display="block",Array.prototype.forEach.call(i(this,f,"f"),(function(t){t.style.display="none"})),this.switchTitle(g,i(this,y,"f"),this)}pause(){r(this,s,!1,"f")}resume(){i(this,s,"f")||(r(this,s,!0,"f"),this.switchTitle(i(this,f,"f")[i(this,a,"f")],i(this,y,"f"),this))}switchTitle(t,e,n,o=!1){let l=1;const c=i(n=n||this,f,"f").length;for(let e=1;e<c;++e)if(i(n,f,"f")[e]===t){l=e;break}if(!i(n,s,"f"))return r(n,a,l,"f"),n;const p=i(n,f,"f").length-1;let y=1;if(1===p)return e(t,o?()=>n:n.switchTitle,n,o);if(i(n,u,"f")){n.typeSurface.textContent.trim()||(l=-1);do{y=Math.round(Math.random()*(p-1))+1}while(y===l)}else n.typeSurface.textContent.trim()||(l=p),y=l<p?l+1:1;const h=i(n,f,"f")[y];return t.classList?t.classList.remove(n.currentClass):t.className=t.className.replace(new RegExp("(^|\\b)"+t.className.split(" ").join("|")+"(\\b|$)","gi")," "),h.classList?h.classList.add(n.currentClass):h.className+=" "+n.currentClass,e(h,o?()=>n:n.switchTitle,n,o)}}s=new WeakMap,o=new WeakMap,a=new WeakMap,l=new WeakMap,c=new WeakMap,u=new WeakMap,f=new WeakMap,p=new WeakMap,y=new WeakMap,h=new WeakMap,b.prototype.cursorBlink=(t,e)=>(e=e||void 0,t?(e.typeSurface.innerHTML=e.typeSurface.innerHTML.replace(/\|| *(<\/span>)?$/,"$1").trim(),e.typeSurface.innerHTML=e.typeSurface.innerHTML+'<span style="display: inline-block;font-weight: normal; color: black; text-decoration: none">|</span>'):e.typeSurface.innerHTML=e.typeSurface.innerHTML.replace(/\|(<\/span>)$/," $1"),e);const d=t=>{let e=0;return Array.prototype.forEach.call(t.childNodes,(t=>{if(3===t.nodeType){const n=t.textContent||"";let r=0;for(;r<n.length;){if(/\s/.test(n[r]))for(;r<n.length&&/\s/.test(n[r]);)++r;else++r;++e}}else 1===t.nodeType&&(e+=d(t))})),e},g=(t,e)=>{let n="";const r=Array.prototype.slice.call(t.childNodes);for(let t=0;t<r.length&&e>0;++t){const i=r[t];if(3===i.nodeType){const t=i.textContent||"";let r=0,s="";for(;r<t.length&&e>0;){if(/\s/.test(t[r])){const e=r;for(;r<t.length&&/\s/.test(t[r]);)++r;s+=t.slice(e,r)}else s+=t[r],++r;--e}n+=s}else if(1===i.nodeType){const t=g(i,e);if(t.html){const e=i.cloneNode(!1);e.innerHTML=t.html,n+=e.outerHTML}e=t.remaining}}return{html:n,remaining:e}};b.prototype.typingEffect=(t,e,n,r=!1)=>{const i=(n=n||void 0).titles.length;let s=0;for(let e=1;e<i;++e)if(n.titles[e]===t){s=e;break}t=t||n.titles[s+1];let o=!0;n.typeSurface.hasAttribute("style")&&n.typeSurface.removeAttribute("style"),t.hasAttribute("style")&&n.typeSurface.setAttribute("style",t.getAttribute("style")),n.typeSurface.innerHTML="",n.typeSurface.style.display="block";for(let t=0;t<4;++t)setTimeout((()=>{n.cursorBlink(o,n),o=!o}),t*n.delaySwitch);return setTimeout((()=>{n.typeSurface.innerHTML="",n.cursorBlink(!0,n);const i=d(t);for(let s=0;s<i;++s)setTimeout((()=>{if(n.typeSurface.innerHTML=g(t,s+1).html+'<span style="font-weight: normal; color: black; text-decoration: none">|</span>',t.textContent+"|"===n.typeSurface.textContent){n.typeSurface.innerHTML=t.innerHTML+'<span style="font-weight: normal; color: black; text-decoration: none">|</span>';for(let i=0;i<8;++i)setTimeout((()=>{--i,n.cursorBlink(o,n),0===i&&e(t,r?()=>n:n.switchStyle,n,r)}),i*n.delaySwitch)}}),s*n.delayEffect)}),4*n.delaySwitch),n},n.default=b,"undefined"!=typeof window&&(window.TitleSwitcher=b)},{"core-js/modules/esnext.weak-map.delete-all.js":69}],2:[function(t,e,n){"use strict";var r=t("../internals/is-callable"),i=t("../internals/try-to-string"),s=TypeError;e.exports=function(t){if(r(t))return t;throw new s(i(t)+" is not a function")}},{"../internals/is-callable":32,"../internals/try-to-string":62}],3:[function(t,e,n){"use strict";var r=t("../internals/weak-map-helpers").has;e.exports=function(t){return r(t),t}},{"../internals/weak-map-helpers":67}],4:[function(t,e,n){"use strict";var r=t("../internals/is-object"),i=String,s=TypeError;e.exports=function(t){if(r(t))return t;throw new s(i(t)+" is not an object")}},{"../internals/is-object":35}],5:[function(t,e,n){"use strict";var r=t("../internals/to-indexed-object"),i=t("../internals/to-absolute-index"),s=t("../internals/length-of-array-like"),o=function(t){return function(e,n,o){var a=r(e),l=s(a);if(0===l)return!t&&-1;var c,u=i(o,l);if(t&&n!=n){for(;l>u;)if((c=a[u++])!=c)return!0}else for(;l>u;u++)if((t||u in a)&&a[u]===n)return t||u||0;return!t&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},{"../internals/length-of-array-like":38,"../internals/to-absolute-index":55,"../internals/to-indexed-object":56}],6:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=r({}.toString),s=r("".slice);e.exports=function(t){return s(i(t),8,-1)}},{"../internals/function-uncurry-this":22}],7:[function(t,e,n){"use strict";var r=t("../internals/has-own-property"),i=t("../internals/own-keys"),s=t("../internals/object-get-own-property-descriptor"),o=t("../internals/object-define-property");e.exports=function(t,e,n){for(var a=i(e),l=o.f,c=s.f,u=0;u<a.length;u++){var f=a[u];r(t,f)||n&&r(n,f)||l(t,f,c(e,f))}}},{"../internals/has-own-property":26,"../internals/object-define-property":41,"../internals/object-get-own-property-descriptor":42,"../internals/own-keys":49}],8:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/object-define-property"),s=t("../internals/create-property-descriptor");e.exports=r?function(t,e,n){return i.f(t,e,s(1,n))}:function(t,e,n){return t[e]=n,t}},{"../internals/create-property-descriptor":9,"../internals/descriptors":12,"../internals/object-define-property":41}],9:[function(t,e,n){"use strict";e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},{}],10:[function(t,e,n){"use strict";var r=t("../internals/is-callable"),i=t("../internals/object-define-property"),s=t("../internals/make-built-in"),o=t("../internals/define-global-property");e.exports=function(t,e,n,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:e;if(r(n)&&s(n,c,a),a.global)l?t[e]=n:o(e,n);else{try{a.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=n:i.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},{"../internals/define-global-property":11,"../internals/is-callable":32,"../internals/make-built-in":39,"../internals/object-define-property":41}],11:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=Object.defineProperty;e.exports=function(t,e){try{i(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},{"../internals/global-this":25}],12:[function(t,e,n){"use strict";var r=t("../internals/fails");e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},{"../internals/fails":18}],13:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=t("../internals/is-object"),s=r.document,o=i(s)&&i(s.createElement);e.exports=function(t){return o?s.createElement(t):{}}},{"../internals/global-this":25,"../internals/is-object":35}],14:[function(t,e,n){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],15:[function(t,e,n){"use strict";var r=t("../internals/global-this").navigator,i=r&&r.userAgent;e.exports=i?String(i):""},{"../internals/global-this":25}],16:[function(t,e,n){"use strict";var r,i,s=t("../internals/global-this"),o=t("../internals/environment-user-agent"),a=s.process,l=s.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(i=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},{"../internals/environment-user-agent":15,"../internals/global-this":25}],17:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=t("../internals/object-get-own-property-descriptor").f,s=t("../internals/create-non-enumerable-property"),o=t("../internals/define-built-in"),a=t("../internals/define-global-property"),l=t("../internals/copy-constructor-properties"),c=t("../internals/is-forced");e.exports=function(t,e){var n,u,f,p,y,h=t.target,b=t.global,d=t.stat;if(n=b?r:d?r[h]||a(h,{}):r[h]&&r[h].prototype)for(u in e){if(p=e[u],f=t.dontCallGetSet?(y=i(n,u))&&y.value:n[u],!c(b?u:h+(d?".":"#")+u,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;l(p,f)}(t.sham||f&&f.sham)&&s(p,"sham",!0),o(n,u,p,t)}}},{"../internals/copy-constructor-properties":7,"../internals/create-non-enumerable-property":8,"../internals/define-built-in":10,"../internals/define-global-property":11,"../internals/global-this":25,"../internals/is-forced":33,"../internals/object-get-own-property-descriptor":42}],18:[function(t,e,n){"use strict";e.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],19:[function(t,e,n){"use strict";var r=t("../internals/fails");e.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},{"../internals/fails":18}],20:[function(t,e,n){"use strict";var r=t("../internals/function-bind-native"),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},{"../internals/function-bind-native":19}],21:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/has-own-property"),s=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,a=i(s,"name"),l=a&&"something"===function(){}.name,c=a&&(!r||r&&o(s,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},{"../internals/descriptors":12,"../internals/has-own-property":26}],22:[function(t,e,n){"use strict";var r=t("../internals/function-bind-native"),i=Function.prototype,s=i.call,o=r&&i.bind.bind(s,s);e.exports=r?o:function(t){return function(){return s.apply(t,arguments)}}},{"../internals/function-bind-native":19}],23:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=t("../internals/is-callable");e.exports=function(t,e){return arguments.length<2?(n=r[t],i(n)?n:void 0):r[t]&&r[t][e];var n}},{"../internals/global-this":25,"../internals/is-callable":32}],24:[function(t,e,n){"use strict";var r=t("../internals/a-callable"),i=t("../internals/is-null-or-undefined");e.exports=function(t,e){var n=t[e];return i(n)?void 0:r(n)}},{"../internals/a-callable":2,"../internals/is-null-or-undefined":34}],25:[function(t,e,n){(function(t){(function(){"use strict";var n=function(t){return t&&t.Math===Math&&t};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],26:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=t("../internals/to-object"),s=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(t,e){return s(i(t),e)}},{"../internals/function-uncurry-this":22,"../internals/to-object":59}],27:[function(t,e,n){"use strict";e.exports={}},{}],28:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/fails"),s=t("../internals/document-create-element");e.exports=!r&&!i((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},{"../internals/descriptors":12,"../internals/document-create-element":13,"../internals/fails":18}],29:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=t("../internals/fails"),s=t("../internals/classof-raw"),o=Object,a=r("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(t){return"String"===s(t)?a(t,""):o(t)}:o},{"../internals/classof-raw":6,"../internals/fails":18,"../internals/function-uncurry-this":22}],30:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=t("../internals/is-callable"),s=t("../internals/shared-store"),o=r(Function.toString);i(s.inspectSource)||(s.inspectSource=function(t){return o(t)}),e.exports=s.inspectSource},{"../internals/function-uncurry-this":22,"../internals/is-callable":32,"../internals/shared-store":52}],31:[function(t,e,n){"use strict";var r,i,s,o=t("../internals/weak-map-basic-detection"),a=t("../internals/global-this"),l=t("../internals/is-object"),c=t("../internals/create-non-enumerable-property"),u=t("../internals/has-own-property"),f=t("../internals/shared-store"),p=t("../internals/shared-key"),y=t("../internals/hidden-keys"),h="Object already initialized",b=a.TypeError,d=a.WeakMap;if(o||f.state){var g=f.state||(f.state=new d);g.get=g.get,g.has=g.has,g.set=g.set,r=function(t,e){if(g.has(t))throw new b(h);return e.facade=t,g.set(t,e),e},i=function(t){return g.get(t)||{}},s=function(t){return g.has(t)}}else{var v=p("state");y[v]=!0,r=function(t,e){if(u(t,v))throw new b(h);return e.facade=t,c(t,v,e),e},i=function(t){return u(t,v)?t[v]:{}},s=function(t){return u(t,v)}}e.exports={set:r,get:i,has:s,enforce:function(t){return s(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=i(e)).type!==t)throw new b("Incompatible receiver, "+t+" required");return n}}}},{"../internals/create-non-enumerable-property":8,"../internals/global-this":25,"../internals/has-own-property":26,"../internals/hidden-keys":27,"../internals/is-object":35,"../internals/shared-key":51,"../internals/shared-store":52,"../internals/weak-map-basic-detection":66}],32:[function(t,e,n){"use strict";var r="object"==typeof document&&document.all;e.exports=void 0===r&&void 0!==r?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}},{}],33:[function(t,e,n){"use strict";var r=t("../internals/fails"),i=t("../internals/is-callable"),s=/#|\.prototype\./,o=function(t,e){var n=l[a(t)];return n===u||n!==c&&(i(e)?r(e):!!e)},a=o.normalize=function(t){return String(t).replace(s,".").toLowerCase()},l=o.data={},c=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},{"../internals/fails":18,"../internals/is-callable":32}],34:[function(t,e,n){"use strict";e.exports=function(t){return null==t}},{}],35:[function(t,e,n){"use strict";var r=t("../internals/is-callable");e.exports=function(t){return"object"==typeof t?null!==t:r(t)}},{"../internals/is-callable":32}],36:[function(t,e,n){"use strict";e.exports=!1},{}],37:[function(t,e,n){"use strict";var r=t("../internals/get-built-in"),i=t("../internals/is-callable"),s=t("../internals/object-is-prototype-of"),o=t("../internals/use-symbol-as-uid"),a=Object;e.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return i(e)&&s(e.prototype,a(t))}},{"../internals/get-built-in":23,"../internals/is-callable":32,"../internals/object-is-prototype-of":45,"../internals/use-symbol-as-uid":64}],38:[function(t,e,n){"use strict";var r=t("../internals/to-length");e.exports=function(t){return r(t.length)}},{"../internals/to-length":58}],39:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=t("../internals/fails"),s=t("../internals/is-callable"),o=t("../internals/has-own-property"),a=t("../internals/descriptors"),l=t("../internals/function-name").CONFIGURABLE,c=t("../internals/inspect-source"),u=t("../internals/internal-state"),f=u.enforce,p=u.get,y=String,h=Object.defineProperty,b=r("".slice),d=r("".replace),g=r([].join),v=a&&!i((function(){return 8!==h((function(){}),"length",{value:8}).length})),m=String(String).split("String"),w=e.exports=function(t,e,n){"Symbol("===b(y(e),0,7)&&(e="["+d(y(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!o(t,"name")||l&&t.name!==e)&&(a?h(t,"name",{value:e,configurable:!0}):t.name=e),v&&n&&o(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?a&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=f(t);return o(r,"source")||(r.source=g(m,"string"==typeof e?e:"")),t};Function.prototype.toString=w((function(){return s(this)&&p(this).source||c(this)}),"toString")},{"../internals/descriptors":12,"../internals/fails":18,"../internals/function-name":21,"../internals/function-uncurry-this":22,"../internals/has-own-property":26,"../internals/inspect-source":30,"../internals/internal-state":31,"../internals/is-callable":32}],40:[function(t,e,n){"use strict";var r=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(t){var e=+t;return(e>0?i:r)(e)}},{}],41:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/ie8-dom-define"),s=t("../internals/v8-prototype-define-bug"),o=t("../internals/an-object"),a=t("../internals/to-property-key"),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,f="enumerable",p="configurable",y="writable";n.f=r?s?function(t,e,n){if(o(t),e=a(e),o(n),"function"==typeof t&&"prototype"===e&&"value"in n&&y in n&&!n[y]){var r=u(t,e);r&&r[y]&&(t[e]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:f in n?n[f]:r[f],writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(o(t),e=a(e),o(n),i)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new l("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},{"../internals/an-object":4,"../internals/descriptors":12,"../internals/ie8-dom-define":28,"../internals/to-property-key":61,"../internals/v8-prototype-define-bug":65}],42:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/function-call"),s=t("../internals/object-property-is-enumerable"),o=t("../internals/create-property-descriptor"),a=t("../internals/to-indexed-object"),l=t("../internals/to-property-key"),c=t("../internals/has-own-property"),u=t("../internals/ie8-dom-define"),f=Object.getOwnPropertyDescriptor;n.f=r?f:function(t,e){if(t=a(t),e=l(e),u)try{return f(t,e)}catch(t){}if(c(t,e))return o(!i(s.f,t,e),t[e])}},{"../internals/create-property-descriptor":9,"../internals/descriptors":12,"../internals/function-call":20,"../internals/has-own-property":26,"../internals/ie8-dom-define":28,"../internals/object-property-is-enumerable":47,"../internals/to-indexed-object":56,"../internals/to-property-key":61}],43:[function(t,e,n){"use strict";var r=t("../internals/object-keys-internal"),i=t("../internals/enum-bug-keys").concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},{"../internals/enum-bug-keys":14,"../internals/object-keys-internal":46}],44:[function(t,e,n){"use strict";n.f=Object.getOwnPropertySymbols},{}],45:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this");e.exports=r({}.isPrototypeOf)},{"../internals/function-uncurry-this":22}],46:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=t("../internals/has-own-property"),s=t("../internals/to-indexed-object"),o=t("../internals/array-includes").indexOf,a=t("../internals/hidden-keys"),l=r([].push);e.exports=function(t,e){var n,r=s(t),c=0,u=[];for(n in r)!i(a,n)&&i(r,n)&&l(u,n);for(;e.length>c;)i(r,n=e[c++])&&(~o(u,n)||l(u,n));return u}},{"../internals/array-includes":5,"../internals/function-uncurry-this":22,"../internals/has-own-property":26,"../internals/hidden-keys":27,"../internals/to-indexed-object":56}],47:[function(t,e,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,s=i&&!r.call({1:2},1);n.f=s?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},{}],48:[function(t,e,n){"use strict";var r=t("../internals/function-call"),i=t("../internals/is-callable"),s=t("../internals/is-object"),o=TypeError;e.exports=function(t,e){var n,a;if("string"===e&&i(n=t.toString)&&!s(a=r(n,t)))return a;if(i(n=t.valueOf)&&!s(a=r(n,t)))return a;if("string"!==e&&i(n=t.toString)&&!s(a=r(n,t)))return a;throw new o("Can't convert object to primitive value")}},{"../internals/function-call":20,"../internals/is-callable":32,"../internals/is-object":35}],49:[function(t,e,n){"use strict";var r=t("../internals/get-built-in"),i=t("../internals/function-uncurry-this"),s=t("../internals/object-get-own-property-names"),o=t("../internals/object-get-own-property-symbols"),a=t("../internals/an-object"),l=i([].concat);e.exports=r("Reflect","ownKeys")||function(t){var e=s.f(a(t)),n=o.f;return n?l(e,n(t)):e}},{"../internals/an-object":4,"../internals/function-uncurry-this":22,"../internals/get-built-in":23,"../internals/object-get-own-property-names":43,"../internals/object-get-own-property-symbols":44}],50:[function(t,e,n){"use strict";var r=t("../internals/is-null-or-undefined"),i=TypeError;e.exports=function(t){if(r(t))throw new i("Can't call method on "+t);return t}},{"../internals/is-null-or-undefined":34}],51:[function(t,e,n){"use strict";var r=t("../internals/shared"),i=t("../internals/uid"),s=r("keys");e.exports=function(t){return s[t]||(s[t]=i(t))}},{"../internals/shared":53,"../internals/uid":63}],52:[function(t,e,n){"use strict";var r=t("../internals/is-pure"),i=t("../internals/global-this"),s=t("../internals/define-global-property"),o="__core-js_shared__",a=e.exports=i[o]||s(o,{});(a.versions||(a.versions=[])).push({version:"3.50.0",mode:r?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"})},{"../internals/define-global-property":11,"../internals/global-this":25,"../internals/is-pure":36}],53:[function(t,e,n){"use strict";var r=t("../internals/shared-store"),i=Object.create||Object;e.exports=function(t,e){return r[t]||(r[t]=e||i(null))}},{"../internals/shared-store":52}],54:[function(t,e,n){"use strict";var r=t("../internals/environment-v8-version"),i=t("../internals/fails"),s=t("../internals/global-this").String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},{"../internals/environment-v8-version":16,"../internals/fails":18,"../internals/global-this":25}],55:[function(t,e,n){"use strict";var r=t("../internals/to-integer-or-infinity"),i=Math.max,s=Math.min;e.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):s(n,e)}},{"../internals/to-integer-or-infinity":57}],56:[function(t,e,n){"use strict";var r=t("../internals/indexed-object"),i=t("../internals/require-object-coercible");e.exports=function(t){return r(i(t))}},{"../internals/indexed-object":29,"../internals/require-object-coercible":50}],57:[function(t,e,n){"use strict";var r=t("../internals/math-trunc");e.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},{"../internals/math-trunc":40}],58:[function(t,e,n){"use strict";var r=t("../internals/to-integer-or-infinity"),i=Math.min;e.exports=function(t){var e=r(t);return e>0?i(e,9007199254740991):0}},{"../internals/to-integer-or-infinity":57}],59:[function(t,e,n){"use strict";var r=t("../internals/require-object-coercible"),i=Object;e.exports=function(t){return i(r(t))}},{"../internals/require-object-coercible":50}],60:[function(t,e,n){"use strict";var r=t("../internals/function-call"),i=t("../internals/is-object"),s=t("../internals/is-symbol"),o=t("../internals/get-method"),a=t("../internals/ordinary-to-primitive"),l=t("../internals/well-known-symbol"),c=TypeError,u=l("toPrimitive");e.exports=function(t,e){if(!i(t)||s(t))return t;var n,l=o(t,u);if(l){if(void 0===e&&(e="default"),n=r(l,t,e),!i(n)||s(n))return n;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},{"../internals/function-call":20,"../internals/get-method":24,"../internals/is-object":35,"../internals/is-symbol":37,"../internals/ordinary-to-primitive":48,"../internals/well-known-symbol":68}],61:[function(t,e,n){"use strict";var r=t("../internals/to-primitive"),i=t("../internals/is-symbol");e.exports=function(t){var e=r(t,"string");return i(e)?e:e+""}},{"../internals/is-symbol":37,"../internals/to-primitive":60}],62:[function(t,e,n){"use strict";var r=String;e.exports=function(t){try{return r(t)}catch(t){return"Object"}}},{}],63:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=0,s=Math.random(),o=r(1.1.toString);e.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+o(++i+s,36)}},{"../internals/function-uncurry-this":22}],64:[function(t,e,n){"use strict";var r=t("../internals/symbol-constructor-detection");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/symbol-constructor-detection":54}],65:[function(t,e,n){"use strict";var r=t("../internals/descriptors"),i=t("../internals/fails");e.exports=r&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},{"../internals/descriptors":12,"../internals/fails":18}],66:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=t("../internals/is-callable"),s=r.WeakMap;e.exports=i(s)&&/native code/.test(String(s))},{"../internals/global-this":25,"../internals/is-callable":32}],67:[function(t,e,n){"use strict";var r=t("../internals/function-uncurry-this"),i=WeakMap.prototype;e.exports={WeakMap:WeakMap,set:r(i.set),get:r(i.get),has:r(i.has),remove:r(i.delete)}},{"../internals/function-uncurry-this":22}],68:[function(t,e,n){"use strict";var r=t("../internals/global-this"),i=t("../internals/shared"),s=t("../internals/has-own-property"),o=t("../internals/uid"),a=t("../internals/symbol-constructor-detection"),l=t("../internals/use-symbol-as-uid"),c=r.Symbol,u=i("wks"),f=l?c.for||c:c&&c.withoutSetter||o;e.exports=function(t){return s(u,t)||(u[t]=a&&s(c,t)?c[t]:f("Symbol."+t)),u[t]}},{"../internals/global-this":25,"../internals/has-own-property":26,"../internals/shared":53,"../internals/symbol-constructor-detection":54,"../internals/uid":63,"../internals/use-symbol-as-uid":64}],69:[function(t,e,n){"use strict";var r=t("../internals/export"),i=t("../internals/a-weak-map"),s=t("../internals/weak-map-helpers").remove;r({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=i(this),n=!0,r=0,o=arguments.length;r<o;r++)t=s(e,arguments[r]),n=n&&t;return!!n}})},{"../internals/a-weak-map":3,"../internals/export":17,"../internals/weak-map-helpers":67}]},{},[1]);
|
package/dist/main.js
CHANGED
|
@@ -254,10 +254,41 @@ TitleSwitcher.prototype.cursorBlink = (blinkOn, self) => {
|
|
|
254
254
|
return self
|
|
255
255
|
}
|
|
256
256
|
/**
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
257
|
+
* Count how many typed "units" domObject's text takes to fully reveal via typedPartialHtml - one unit per
|
|
258
|
+
* non-whitespace character, but a whole run of consecutive whitespace (most often the newline and indentation
|
|
259
|
+
* left behind where a title's HTML source wraps onto a new line) counts as a single unit, matching how many
|
|
260
|
+
* steps typedPartialHtml actually needs to reveal it all. Typing through that whitespace one character at a
|
|
261
|
+
* time would type through several units a browser renders as a single collapsed space, with no visible change
|
|
262
|
+
* in between - not a slower typing speed, but a real stall followed by the next word suddenly catching up.
|
|
263
|
+
* @param domObject
|
|
264
|
+
*/
|
|
265
|
+
const typedLength = domObject => {
|
|
266
|
+
let length = 0
|
|
267
|
+
Array.prototype.forEach.call(domObject.childNodes, child => {
|
|
268
|
+
if (child.nodeType === 3) {
|
|
269
|
+
const text = child.textContent || ''
|
|
270
|
+
let position = 0
|
|
271
|
+
while (position < text.length) {
|
|
272
|
+
if (/\s/.test(text[position])) {
|
|
273
|
+
while (position < text.length && /\s/.test(text[position])) {
|
|
274
|
+
++position
|
|
275
|
+
}
|
|
276
|
+
} else {
|
|
277
|
+
++position
|
|
278
|
+
}
|
|
279
|
+
++length
|
|
280
|
+
}
|
|
281
|
+
} else if (child.nodeType === 1) {
|
|
282
|
+
length += typedLength(child)
|
|
283
|
+
}
|
|
284
|
+
})
|
|
285
|
+
return length
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Build the markup for the first `remaining` typed units of domObject's text (see typedLength), keeping
|
|
289
|
+
* whichever of its nested tags (em, strong, ...) that content falls under. This lets the typing effect reveal
|
|
290
|
+
* a title's formatting as each character is typed, instead of only applying it once the whole tag has been
|
|
291
|
+
* typed out.
|
|
261
292
|
* @param domObject
|
|
262
293
|
* @param remaining
|
|
263
294
|
*/
|
|
@@ -268,9 +299,22 @@ const typedPartialHtml = (domObject, remaining) => {
|
|
|
268
299
|
const child = children[i]
|
|
269
300
|
if (child.nodeType === 3) {
|
|
270
301
|
const text = child.textContent || ''
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
remaining
|
|
302
|
+
let position = 0
|
|
303
|
+
let taken = ''
|
|
304
|
+
while (position < text.length && remaining > 0) {
|
|
305
|
+
if (/\s/.test(text[position])) {
|
|
306
|
+
const runStart = position
|
|
307
|
+
while (position < text.length && /\s/.test(text[position])) {
|
|
308
|
+
++position
|
|
309
|
+
}
|
|
310
|
+
taken += text.slice(runStart, position)
|
|
311
|
+
} else {
|
|
312
|
+
taken += text[position]
|
|
313
|
+
++position
|
|
314
|
+
}
|
|
315
|
+
--remaining
|
|
316
|
+
}
|
|
317
|
+
html += taken
|
|
274
318
|
} else if (child.nodeType === 1) {
|
|
275
319
|
const result = typedPartialHtml(child, remaining)
|
|
276
320
|
if (result.html) {
|
|
@@ -329,7 +373,7 @@ TitleSwitcher.prototype.typingEffect = (domObject, callBackFunction, self, runOn
|
|
|
329
373
|
self.typeSurface.innerHTML = ''
|
|
330
374
|
self.cursorBlink(true, self)
|
|
331
375
|
// Copy each letter from the current title, keeping whichever tags (em, strong, ...) it falls under
|
|
332
|
-
const totalLength = domObject
|
|
376
|
+
const totalLength = typedLength(domObject)
|
|
333
377
|
for (let i = 0; i < totalLength; ++i) {
|
|
334
378
|
setTimeout(() => {
|
|
335
379
|
// Reveal one more character, wrapped in whatever tags its position in the title falls under,
|
package/dist/main.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js");var _TitleSwitcher_active,_TitleSwitcher_currentClass,_TitleSwitcher_currentIndex,_TitleSwitcher_delayEffect,_TitleSwitcher_delaySwitch,_TitleSwitcher_isRandom,_TitleSwitcher_titles,_TitleSwitcher_titlesContainer,_TitleSwitcher_switchStyle,_TitleSwitcher_typeSurface,__classPrivateFieldSet=function(e,t,i,s,l){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!l:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?l.call(e,i):l?l.value=i:t.set(e,i),i},__classPrivateFieldGet=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};Object.defineProperty(exports,"__esModule",{value:!0});class TitleSwitcher{constructor(e="",t="typingEffect"){_TitleSwitcher_active.set(this,!1),_TitleSwitcher_currentClass.set(this,"displayTitle"),_TitleSwitcher_currentIndex.set(this,0),_TitleSwitcher_delayEffect.set(this,200),_TitleSwitcher_delaySwitch.set(this,400),_TitleSwitcher_isRandom.set(this,!1),_TitleSwitcher_titles.set(this,[]),_TitleSwitcher_titlesContainer.set(this,""),_TitleSwitcher_switchStyle.set(this,void 0),_TitleSwitcher_typeSurface.set(this,void 0),__classPrivateFieldSet(this,_TitleSwitcher_currentClass,"displayTitle","f"),__classPrivateFieldSet(this,_TitleSwitcher_switchStyle,"string"==typeof t?"function"==typeof this[t]?this[t]:this.typingEffect:t,"f"),__classPrivateFieldSet(this,_TitleSwitcher_titlesContainer,e,"f"),__classPrivateFieldSet(this,_TitleSwitcher_titles,[],"f");const i=e?document.querySelectorAll(e):[];i&&i[0]&&(__classPrivateFieldSet(this,_TitleSwitcher_titlesContainer,i[0],"f"),__classPrivateFieldSet(this,_TitleSwitcher_titles,i[0].children,"f"))}get active(){return __classPrivateFieldGet(this,_TitleSwitcher_active,"f")}get currentClass(){return __classPrivateFieldGet(this,_TitleSwitcher_currentClass,"f")}get currentIndex(){return __classPrivateFieldGet(this,_TitleSwitcher_currentIndex,"f")}get delayEffect(){return __classPrivateFieldGet(this,_TitleSwitcher_delayEffect,"f")}get delaySwitch(){return __classPrivateFieldGet(this,_TitleSwitcher_delaySwitch,"f")}get switchStyle(){return __classPrivateFieldGet(this,_TitleSwitcher_switchStyle,"f")}get titles(){return __classPrivateFieldGet(this,_TitleSwitcher_titles,"f")}get typeSurface(){return __classPrivateFieldGet(this,_TitleSwitcher_typeSurface,"f")}startTitles({delaySwitch:e=400,delayEffect:t=200,isRandom:i=!1,immediatePause:s=!1}={}){const l="typeSurface";if(__classPrivateFieldSet(this,_TitleSwitcher_delaySwitch,e,"f"),__classPrivateFieldSet(this,_TitleSwitcher_delayEffect,t,"f"),__classPrivateFieldSet(this,_TitleSwitcher_isRandom,i,"f"),__classPrivateFieldSet(this,_TitleSwitcher_active,!s,"f"),__classPrivateFieldGet(this,_TitleSwitcher_currentIndex,"f")>=__classPrivateFieldGet(this,_TitleSwitcher_titles,"f").length||"string"==typeof __classPrivateFieldGet(this,_TitleSwitcher_titlesContainer,"f"))return __classPrivateFieldSet(this,_TitleSwitcher_active,!1,"f"),console.warn(`No titles found for '${__classPrivateFieldGet(this,_TitleSwitcher_titlesContainer,"f")}'`),this;__classPrivateFieldGet(this,_TitleSwitcher_isRandom,"f")&&__classPrivateFieldSet(this,_TitleSwitcher_currentIndex,Math.round(Math.random()*(__classPrivateFieldGet(this,_TitleSwitcher_titles,"f").length-2))+1,"f");const r=__classPrivateFieldGet(this,_TitleSwitcher_titles,"f")[__classPrivateFieldGet(this,_TitleSwitcher_currentIndex,"f")];r.classList?r.classList.add(__classPrivateFieldGet(this,_TitleSwitcher_currentClass,"f")):r.className+=" "+__classPrivateFieldGet(this,_TitleSwitcher_currentClass,"f");const a=__classPrivateFieldGet(this,_TitleSwitcher_titles,"f")[0].cloneNode(!0);return a.classList?a.classList.add(l):a.className+=" "+l,a.classList?a.classList.remove(__classPrivateFieldGet(this,_TitleSwitcher_currentClass,"f")):a.className=a.className.replace(new RegExp("(^|\\b)"+a.className.split(" ").join("|")+"(\\b|$)","gi")," "),__classPrivateFieldGet(this,_TitleSwitcher_titlesContainer,"f").insertBefore(a,__classPrivateFieldGet(this,_TitleSwitcher_titlesContainer,"f").firstChild),__classPrivateFieldSet(this,_TitleSwitcher_typeSurface,__classPrivateFieldGet(this,_TitleSwitcher_titlesContainer,"f").querySelectorAll("."+l)[0],"f"),__classPrivateFieldGet(this,_TitleSwitcher_typeSurface,"f").innerHTML="",__classPrivateFieldGet(this,_TitleSwitcher_typeSurface,"f").style.display="block",Array.prototype.forEach.call(__classPrivateFieldGet(this,_TitleSwitcher_titles,"f"),(function(e){e.style.display="none"})),this.switchTitle(r,__classPrivateFieldGet(this,_TitleSwitcher_switchStyle,"f"),this)}pause(){__classPrivateFieldSet(this,_TitleSwitcher_active,!1,"f")}resume(){__classPrivateFieldGet(this,_TitleSwitcher_active,"f")||(__classPrivateFieldSet(this,_TitleSwitcher_active,!0,"f"),this.switchTitle(__classPrivateFieldGet(this,_TitleSwitcher_titles,"f")[__classPrivateFieldGet(this,_TitleSwitcher_currentIndex,"f")],__classPrivateFieldGet(this,_TitleSwitcher_switchStyle,"f"),this))}switchTitle(e,t,i,s=!1){let l=1;const r=__classPrivateFieldGet(i=i||this,_TitleSwitcher_titles,"f").length;for(let t=1;t<r;++t)if(__classPrivateFieldGet(i,_TitleSwitcher_titles,"f")[t]===e){l=t;break}if(!__classPrivateFieldGet(i,_TitleSwitcher_active,"f"))return __classPrivateFieldSet(i,_TitleSwitcher_currentIndex,l,"f"),i;const a=__classPrivateFieldGet(i,_TitleSwitcher_titles,"f").length-1;let c=1;if(1===a)return t(e,s?()=>i:i.switchTitle,i,s);if(__classPrivateFieldGet(i,_TitleSwitcher_isRandom,"f")){i.typeSurface.textContent.trim()||(l=-1);do{c=Math.round(Math.random()*(a-1))+1}while(c===l)}else i.typeSurface.textContent.trim()||(l=a),c=l<a?l+1:1;const _=__classPrivateFieldGet(i,_TitleSwitcher_titles,"f")[c];return e.classList?e.classList.remove(i.currentClass):e.className=e.className.replace(new RegExp("(^|\\b)"+e.className.split(" ").join("|")+"(\\b|$)","gi")," "),_.classList?_.classList.add(i.currentClass):_.className+=" "+i.currentClass,t(_,s?()=>i:i.switchTitle,i,s)}}_TitleSwitcher_active=new WeakMap,_TitleSwitcher_currentClass=new WeakMap,_TitleSwitcher_currentIndex=new WeakMap,_TitleSwitcher_delayEffect=new WeakMap,_TitleSwitcher_delaySwitch=new WeakMap,_TitleSwitcher_isRandom=new WeakMap,_TitleSwitcher_titles=new WeakMap,_TitleSwitcher_titlesContainer=new WeakMap,_TitleSwitcher_switchStyle=new WeakMap,_TitleSwitcher_typeSurface=new WeakMap,TitleSwitcher.prototype.cursorBlink=(e,t)=>(t=t||void 0,e?(t.typeSurface.innerHTML=t.typeSurface.innerHTML.replace(/\|| *(<\/span>)?$/,"$1").trim(),t.typeSurface.innerHTML=t.typeSurface.innerHTML+'<span style="display: inline-block;font-weight: normal; color: black; text-decoration: none">|</span>'):t.typeSurface.innerHTML=t.typeSurface.innerHTML.replace(/\|(<\/span>)$/," $1"),t);const typedPartialHtml=(e,t)=>{let i="";const s=Array.prototype.slice.call(e.childNodes);for(let e=0;e<s.length&&t>0;++e){const l=s[e];if(3===l.nodeType){const e=l.textContent||"",s
|
|
1
|
+
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js");var _TitleSwitcher_active,_TitleSwitcher_currentClass,_TitleSwitcher_currentIndex,_TitleSwitcher_delayEffect,_TitleSwitcher_delaySwitch,_TitleSwitcher_isRandom,_TitleSwitcher_titles,_TitleSwitcher_titlesContainer,_TitleSwitcher_switchStyle,_TitleSwitcher_typeSurface,__classPrivateFieldSet=function(e,t,i,s,l){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!l)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!l:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?l.call(e,i):l?l.value=i:t.set(e,i),i},__classPrivateFieldGet=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};Object.defineProperty(exports,"__esModule",{value:!0});class TitleSwitcher{constructor(e="",t="typingEffect"){_TitleSwitcher_active.set(this,!1),_TitleSwitcher_currentClass.set(this,"displayTitle"),_TitleSwitcher_currentIndex.set(this,0),_TitleSwitcher_delayEffect.set(this,200),_TitleSwitcher_delaySwitch.set(this,400),_TitleSwitcher_isRandom.set(this,!1),_TitleSwitcher_titles.set(this,[]),_TitleSwitcher_titlesContainer.set(this,""),_TitleSwitcher_switchStyle.set(this,void 0),_TitleSwitcher_typeSurface.set(this,void 0),__classPrivateFieldSet(this,_TitleSwitcher_currentClass,"displayTitle","f"),__classPrivateFieldSet(this,_TitleSwitcher_switchStyle,"string"==typeof t?"function"==typeof this[t]?this[t]:this.typingEffect:t,"f"),__classPrivateFieldSet(this,_TitleSwitcher_titlesContainer,e,"f"),__classPrivateFieldSet(this,_TitleSwitcher_titles,[],"f");const i=e?document.querySelectorAll(e):[];i&&i[0]&&(__classPrivateFieldSet(this,_TitleSwitcher_titlesContainer,i[0],"f"),__classPrivateFieldSet(this,_TitleSwitcher_titles,i[0].children,"f"))}get active(){return __classPrivateFieldGet(this,_TitleSwitcher_active,"f")}get currentClass(){return __classPrivateFieldGet(this,_TitleSwitcher_currentClass,"f")}get currentIndex(){return __classPrivateFieldGet(this,_TitleSwitcher_currentIndex,"f")}get delayEffect(){return __classPrivateFieldGet(this,_TitleSwitcher_delayEffect,"f")}get delaySwitch(){return __classPrivateFieldGet(this,_TitleSwitcher_delaySwitch,"f")}get switchStyle(){return __classPrivateFieldGet(this,_TitleSwitcher_switchStyle,"f")}get titles(){return __classPrivateFieldGet(this,_TitleSwitcher_titles,"f")}get typeSurface(){return __classPrivateFieldGet(this,_TitleSwitcher_typeSurface,"f")}startTitles({delaySwitch:e=400,delayEffect:t=200,isRandom:i=!1,immediatePause:s=!1}={}){const l="typeSurface";if(__classPrivateFieldSet(this,_TitleSwitcher_delaySwitch,e,"f"),__classPrivateFieldSet(this,_TitleSwitcher_delayEffect,t,"f"),__classPrivateFieldSet(this,_TitleSwitcher_isRandom,i,"f"),__classPrivateFieldSet(this,_TitleSwitcher_active,!s,"f"),__classPrivateFieldGet(this,_TitleSwitcher_currentIndex,"f")>=__classPrivateFieldGet(this,_TitleSwitcher_titles,"f").length||"string"==typeof __classPrivateFieldGet(this,_TitleSwitcher_titlesContainer,"f"))return __classPrivateFieldSet(this,_TitleSwitcher_active,!1,"f"),console.warn(`No titles found for '${__classPrivateFieldGet(this,_TitleSwitcher_titlesContainer,"f")}'`),this;__classPrivateFieldGet(this,_TitleSwitcher_isRandom,"f")&&__classPrivateFieldSet(this,_TitleSwitcher_currentIndex,Math.round(Math.random()*(__classPrivateFieldGet(this,_TitleSwitcher_titles,"f").length-2))+1,"f");const r=__classPrivateFieldGet(this,_TitleSwitcher_titles,"f")[__classPrivateFieldGet(this,_TitleSwitcher_currentIndex,"f")];r.classList?r.classList.add(__classPrivateFieldGet(this,_TitleSwitcher_currentClass,"f")):r.className+=" "+__classPrivateFieldGet(this,_TitleSwitcher_currentClass,"f");const a=__classPrivateFieldGet(this,_TitleSwitcher_titles,"f")[0].cloneNode(!0);return a.classList?a.classList.add(l):a.className+=" "+l,a.classList?a.classList.remove(__classPrivateFieldGet(this,_TitleSwitcher_currentClass,"f")):a.className=a.className.replace(new RegExp("(^|\\b)"+a.className.split(" ").join("|")+"(\\b|$)","gi")," "),__classPrivateFieldGet(this,_TitleSwitcher_titlesContainer,"f").insertBefore(a,__classPrivateFieldGet(this,_TitleSwitcher_titlesContainer,"f").firstChild),__classPrivateFieldSet(this,_TitleSwitcher_typeSurface,__classPrivateFieldGet(this,_TitleSwitcher_titlesContainer,"f").querySelectorAll("."+l)[0],"f"),__classPrivateFieldGet(this,_TitleSwitcher_typeSurface,"f").innerHTML="",__classPrivateFieldGet(this,_TitleSwitcher_typeSurface,"f").style.display="block",Array.prototype.forEach.call(__classPrivateFieldGet(this,_TitleSwitcher_titles,"f"),(function(e){e.style.display="none"})),this.switchTitle(r,__classPrivateFieldGet(this,_TitleSwitcher_switchStyle,"f"),this)}pause(){__classPrivateFieldSet(this,_TitleSwitcher_active,!1,"f")}resume(){__classPrivateFieldGet(this,_TitleSwitcher_active,"f")||(__classPrivateFieldSet(this,_TitleSwitcher_active,!0,"f"),this.switchTitle(__classPrivateFieldGet(this,_TitleSwitcher_titles,"f")[__classPrivateFieldGet(this,_TitleSwitcher_currentIndex,"f")],__classPrivateFieldGet(this,_TitleSwitcher_switchStyle,"f"),this))}switchTitle(e,t,i,s=!1){let l=1;const r=__classPrivateFieldGet(i=i||this,_TitleSwitcher_titles,"f").length;for(let t=1;t<r;++t)if(__classPrivateFieldGet(i,_TitleSwitcher_titles,"f")[t]===e){l=t;break}if(!__classPrivateFieldGet(i,_TitleSwitcher_active,"f"))return __classPrivateFieldSet(i,_TitleSwitcher_currentIndex,l,"f"),i;const a=__classPrivateFieldGet(i,_TitleSwitcher_titles,"f").length-1;let c=1;if(1===a)return t(e,s?()=>i:i.switchTitle,i,s);if(__classPrivateFieldGet(i,_TitleSwitcher_isRandom,"f")){i.typeSurface.textContent.trim()||(l=-1);do{c=Math.round(Math.random()*(a-1))+1}while(c===l)}else i.typeSurface.textContent.trim()||(l=a),c=l<a?l+1:1;const _=__classPrivateFieldGet(i,_TitleSwitcher_titles,"f")[c];return e.classList?e.classList.remove(i.currentClass):e.className=e.className.replace(new RegExp("(^|\\b)"+e.className.split(" ").join("|")+"(\\b|$)","gi")," "),_.classList?_.classList.add(i.currentClass):_.className+=" "+i.currentClass,t(_,s?()=>i:i.switchTitle,i,s)}}_TitleSwitcher_active=new WeakMap,_TitleSwitcher_currentClass=new WeakMap,_TitleSwitcher_currentIndex=new WeakMap,_TitleSwitcher_delayEffect=new WeakMap,_TitleSwitcher_delaySwitch=new WeakMap,_TitleSwitcher_isRandom=new WeakMap,_TitleSwitcher_titles=new WeakMap,_TitleSwitcher_titlesContainer=new WeakMap,_TitleSwitcher_switchStyle=new WeakMap,_TitleSwitcher_typeSurface=new WeakMap,TitleSwitcher.prototype.cursorBlink=(e,t)=>(t=t||void 0,e?(t.typeSurface.innerHTML=t.typeSurface.innerHTML.replace(/\|| *(<\/span>)?$/,"$1").trim(),t.typeSurface.innerHTML=t.typeSurface.innerHTML+'<span style="display: inline-block;font-weight: normal; color: black; text-decoration: none">|</span>'):t.typeSurface.innerHTML=t.typeSurface.innerHTML.replace(/\|(<\/span>)$/," $1"),t);const typedLength=e=>{let t=0;return Array.prototype.forEach.call(e.childNodes,(e=>{if(3===e.nodeType){const i=e.textContent||"";let s=0;for(;s<i.length;){if(/\s/.test(i[s]))for(;s<i.length&&/\s/.test(i[s]);)++s;else++s;++t}}else 1===e.nodeType&&(t+=typedLength(e))})),t},typedPartialHtml=(e,t)=>{let i="";const s=Array.prototype.slice.call(e.childNodes);for(let e=0;e<s.length&&t>0;++e){const l=s[e];if(3===l.nodeType){const e=l.textContent||"";let s=0,r="";for(;s<e.length&&t>0;){if(/\s/.test(e[s])){const t=s;for(;s<e.length&&/\s/.test(e[s]);)++s;r+=e.slice(t,s)}else r+=e[s],++s;--t}i+=r}else if(1===l.nodeType){const e=typedPartialHtml(l,t);if(e.html){const t=l.cloneNode(!1);t.innerHTML=e.html,i+=t.outerHTML}t=e.remaining}}return{html:i,remaining:t}};TitleSwitcher.prototype.typingEffect=(e,t,i,s=!1)=>{const l=(i=i||void 0).titles.length;let r=0;for(let t=1;t<l;++t)if(i.titles[t]===e){r=t;break}e=e||i.titles[r+1];let a=!0;i.typeSurface.hasAttribute("style")&&i.typeSurface.removeAttribute("style"),e.hasAttribute("style")&&i.typeSurface.setAttribute("style",e.getAttribute("style")),i.typeSurface.innerHTML="",i.typeSurface.style.display="block";for(let e=0;e<4;++e)setTimeout((()=>{i.cursorBlink(a,i),a=!a}),e*i.delaySwitch);return setTimeout((()=>{i.typeSurface.innerHTML="",i.cursorBlink(!0,i);const l=typedLength(e);for(let r=0;r<l;++r)setTimeout((()=>{if(i.typeSurface.innerHTML=typedPartialHtml(e,r+1).html+'<span style="font-weight: normal; color: black; text-decoration: none">|</span>',e.textContent+"|"===i.typeSurface.textContent){i.typeSurface.innerHTML=e.innerHTML+'<span style="font-weight: normal; color: black; text-decoration: none">|</span>';for(let l=0;l<8;++l)setTimeout((()=>{--l,i.cursorBlink(a,i),0===l&&t(e,s?()=>i:i.switchStyle,i,s)}),l*i.delaySwitch)}}),r*i.delayEffect)}),4*i.delaySwitch),i},exports.default=TitleSwitcher,"undefined"!=typeof window&&(window.TitleSwitcher=TitleSwitcher);
|