PageSourceSearch

https://wemicrocast.com/wp-content/themes/jevelin/js/typed.js?ver=1.0

js wemicrocast.com collected 2026-10-09 23:18:46 UTC 32,731 bytes, 1,052 lines download raw bytes

1/*!
2 *
3 *   typed.js - A JavaScript Typing Animation Library
4 *   Author: Matt Boldt <[email protected]>
5 *   Version: v2.0.4
6 *   Url: https://github.com/mattboldt/typed.js
7 *   License(s): MIT
8 *
9 */
10(function webpackUniversalModuleDefinition(root, factory) {
11	if(typeof exports === 'object' && typeof module === 'object')
12		module.exports = factory();
13	else if(typeof define === 'function' && define.amd)
14		define([], factory);
15	else if(typeof exports === 'object')
16		exports["Typed"] = factory();
17	else
18		root["Typed"] = factory();
19})(this, function() {
20return /******/ (function(modules) { // webpackBootstrap
21/******/ 	// The module cache
22/******/ 	var installedModules = {};
23/******/
24/******/ 	// The require function
25/******/ 	function __webpack_require__(moduleId) {
26/******/
27/******/ 		// Check if module is in cache
28/******/ 		if(installedModules[moduleId])
29/******/ 			return installedModules[moduleId].exports;
30/******/
31/******/ 		// Create a new module (and put it into the cache)
32/******/ 		var module = installedModules[moduleId] = {
33/******/ 			exports: {},
34/******/ 			id: moduleId,
35/******/ 			loaded: false
36/******/ 		};
37/******/
38/******/ 		// Execute the module function
39/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
40/******/
41/******/ 		// Flag the module as loaded
42/******/ 		module.loaded = true;
43/******/
44/******/ 		// Return the exports of the module
45/******/ 		return module.exports;
46/******/ 	}
47/******/
48/******/
49/******/ 	// expose the modules object (__webpack_modules__)
50/******/ 	__webpack_require__.m = modules;
51/******/
52/******/ 	// expose the module cache
53/******/ 	__webpack_require__.c = installedModules;
54/******/
55/******/ 	// __webpack_public_path__
56/******/ 	__webpack_require__.p = "";
57/******/
58/******/ 	// Load entry module and return exports
59/******/ 	return __webpack_require__(0);
60/******/ })
61/************************************************************************/
62/******/ ([
63/* 0 */
64/***/ (function(module, exports, __webpack_require__) {
65
66	'use strict';
67
68	Object.defineProperty(exports, '__esModule', {
69	  value: true
70	});
71
72	var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
73
74	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
75
76	var _initializerJs = __webpack_require__(1);
77
78	var _htmlParserJs = __webpack_require__(3);
79
80	/**
81	 * Welcome to Typed.js!
82	 * @param {string} elementId HTML element ID _OR_ HTML element
83	 * @param {object} options options object
84	 * @returns {object} a new Typed object
85	 */
86
87	var Typed = (function () {
88	  function Typed(elementId, options) {
89	    _classCallCheck(this, Typed);
90
91	    // Initialize it up
92	    _initializerJs.initializer.load(this, options, elementId);
93	    // All systems go!
94	    this.begin();
95	  }
96
97	  /**
98	   * Toggle start() and stop() of the Typed instance
99	   * @public
100	   */
101
102	  _createClass(Typed, [{
103	    key: 'toggle',
104	    value: function toggle() {
105	      this.pause.status ? this.start() : this.stop();
106	    }
107
108	    /**
109	     * Stop typing / backspacing and enable cursor blinking
110	     * @public
111	     */
112	  }, {
113	    key: 'stop',
114	    value: function stop() {
115	      if (this.typingComplete) return;
116	      if (this.pause.status) return;
117	      this.toggleBlinking(true);
118	      this.pause.status = true;
119	      this.options.onStop(this.arrayPos, this);
120	    }
121
122	    /**
123	     * Start typing / backspacing after being stopped
124	     * @public
125	     */
126	  }, {
127	    key: 'start',
128	    value: function start() {
129	      if (this.typingComplete) return;
130	      if (!this.pause.status) return;
131	      this.pause.status = false;
132	      if (this.pause.typewrite) {
133	        this.typewrite(this.pause.curString, this.pause.curStrPos);
134	      } else {
135	        this.backspace(this.pause.curString, this.pause.curStrPos);
136	      }
137	      this.options.onStart(this.arrayPos, this);
138	    }
139
140	    /**
141	     * Destroy this instance of Typed
142	     * @public
143	     */
144	  }, {
145	    key: 'destroy',
146	    value: function destroy() {
147	      this.reset(false);
148	      this.options.onDestroy(this);
149	    }
150
151	    /**
152	     * Reset Typed and optionally restarts
153	     * @param {boolean} restart
154	     * @public
155	     */
156	  }, {
157	    key: 'reset',
158	    value: function reset() {
159	      var restart = arguments.length <= 0 || arguments[0] === undefined ? true : arguments[0];
160
161	      clearInterval(this.timeout);
162	      this.replaceText('');
163	      if (this.cursor && this.cursor.parentNode) {
164	        this.cursor.parentNode.removeChild(this.cursor);
165	        this.cursor = null;
166	      }
167	      this.strPos = 0;
168	      this.arrayPos = 0;
169	      this.curLoop = 0;
170	      if (restart) {
171	        this.insertCursor();
172	        this.options.onReset(this);
173	        this.begin();
174	      }
175	    }
176
177	    /**
178	     * Begins the typing animation
179	     * @private
180	     */
181	  }, {
182	    key: 'begin',
183	    value: function begin() {
184	      var _this = this;
185
186	      this.typingComplete = false;
187	      this.shuffleStringsIfNeeded(this);
188	      this.insertCursor();
189	      if (this.bindInputFocusEvents) this.bindFocusEvents();
190	      this.timeout = setTimeout(function () {
191	        // Check if there is some text in the element, if yes start by backspacing the default message
192	        if (!_this.currentElContent || _this.currentElContent.length === 0) {
193	          _this.typewrite(_this.strings[_this.sequence[_this.arrayPos]], _this.strPos);
194	        } else {
195	          // Start typing
196	          _this.backspace(_this.currentElContent, _this.currentElContent.length);
197	        }
198	      }, this.startDelay);
199	    }
200
201	    /**
202	     * Called for each character typed
203	     * @param {string} curString the current string in the strings array
204	     * @param {number} curStrPos the current position in the curString
205	     * @private
206	     */
207	  }, {
208	    key: 'typewrite',
209	    value: function typewrite(curString, curStrPos) {
210	      var _this2 = this;
211
212	      if (this.fadeOut && this.el.classList.contains(this.fadeOutClass)) {
213	        this.el.classList.remove(this.fadeOutClass);
214	        if (this.cursor) this.cursor.classList.remove(this.fadeOutClass);
215	      }
216
217	      var humanize = this.humanizer(this.typeSpeed);
218	      var numChars = 1;
219
220	      if (this.pause.status === true) {
221	        this.setPauseStatus(curString, curStrPos, true);
222	        return;
223	      }
224
225	      // contain typing function in a timeout humanize'd delay
226	      this.timeout = setTimeout(function () {
227	        // skip over any HTML chars
228	        curStrPos = _htmlParserJs.htmlParser.typeHtmlChars(curString, curStrPos, _this2);
229
230	        var pauseTime = 0;
231	        var substr = curString.substr(curStrPos);
232	        // check for an escape character before a pause value
233	        // format: \^\d+ .. eg: ^1000 .. should be able to print the ^ too using ^^
234	        // single ^ are removed from string
235	        if (substr.charAt(0) === '^') {
236	          if (/^\^\d+/.test(substr)) {
237	            var skip = 1; // skip at least 1
238	            substr = /\d+/.exec(substr)[0];
239	            skip += substr.length;
240	            pauseTime = parseInt(substr);
241	            _this2.temporaryPause = true;
242	            _this2.options.onTypingPaused(_this2.arrayPos, _this2);
243	            // strip out the escape character and pause value so they're not printed
244	            curString = curString.substring(0, curStrPos) + curString.substring(curStrPos + skip);
245	            _this2.toggleBlinking(true);
246	          }
247	        }
248
249	        // check for skip characters formatted as
250	        // "this is a `string to print NOW` ..."
251	        if (substr.charAt(0) === '`') {
252	          while (curString.substr(curStrPos + numChars).charAt(0) !== '`') {
253	            numChars++;
254	            if (curStrPos + numChars > curString.length) break;
255	          }
256	          // strip out the escape characters and append all the string in between
257	          var stringBeforeSkip = curString.substring(0, curStrPos);
258	          var stringSkipped = curString.substring(stringBeforeSkip.length + 1, curStrPos + numChars);
259	          var stringAfterSkip = curString.substring(curStrPos + numChars + 1);
260	          curString = stringBeforeSkip + stringSkipped + stringAfterSkip;
261	          numChars--;
262	        }
263
264	        // timeout for any pause after a character
265	        _this2.timeout = setTimeout(function () {
266	          // Accounts for blinking while paused
267	          _this2.toggleBlinking(false);
268
269	          // We're done with this sentence!
270	          if (curStrPos === curString.length) {
271	            _this2.doneTyping(curString, curStrPos);
272	          } else {
273	            _this2.keepTyping(curString, curStrPos, numChars);
274	          }
275	          // end of character pause
276	          if (_this2.temporaryPause) {
277	            _this2.temporaryPause = false;
278	            _this2.options.onTypingResumed(_this2.arrayPos, _this2);
279	          }
280	        }, pauseTime);
281
282	        // humanized value for typing
283	      }, humanize);
284	    }
285
286	    /**
287	     * Continue to the next string & begin typing
288	     * @param {string} curString the current string in the strings array
289	     * @param {number} curStrPos the current position in the curString
290	     * @private
291	     */
292	  }, {
293	    key: 'keepTyping',
294	    value: function keepTyping(curString, curStrPos, numChars) {
295	      // call before functions if applicable
296	      if (curStrPos === 0) {
297	        this.toggleBlinking(false);
298	        this.options.preStringTyped(this.arrayPos, this);
299	      }
300	      // start typing each new char into existing string
301	      // curString: arg, this.el.html: original text inside element
302	      curStrPos += numChars;
303	      var nextString = curString.substr(0, curStrPos);
304	      this.replaceText(nextString);
305	      // loop the function
306	      this.typewrite(curString, curStrPos);
307	    }
308
309	    /**
310	     * We're done typing all strings
311	     * @param {string} curString the current string in the strings array
312	     * @param {number} curStrPos the current position in the curString
313	     * @private
314	     */
315	  }, {
316	    key: 'doneTyping',
317	    value: function doneTyping(curString, curStrPos) {
318	      var _this3 = this;
319
320	      // fires callback function
321	      this.options.onStringTyped(this.arrayPos, this);
322	      this.toggleBlinking(true);
323	      // is this the final string
324	      if (this.arrayPos === this.strings.length - 1) {
325	        // callback that occurs on the last typed string
326	        this.complete();
327	        // quit if we wont loop back
328	        if (this.loop === false || this.curLoop === this.loopCount) {
329	          return;
330	        }
331	      }
332	      this.timeout = setTimeout(function () {
333	        _this3.backspace(curString, curStrPos);
334	      }, this.backDelay);
335	    }
336
337	    /**
338	     * Backspaces 1 character at a time
339	     * @param {string} curString the current string in the strings array
340	     * @param {number} curStrPos the current position in the curString
341	     * @private
342	     */
343	  }, {
344	    key: 'backspace',
345	    value: function backspace(curString, curStrPos) {
346	      var _this4 = this;
347
348	      if (this.pause.status === true) {
349	        this.setPauseStatus(curString, curStrPos, true);
350	        return;
351	      }
352	      if (this.fadeOut) return this.initFadeOut();
353
354	      this.toggleBlinking(false);
355	      var humanize = this.humanizer(this.backSpeed);
356
357	      this.timeout = setTimeout(function () {
358	        curStrPos = _htmlParserJs.htmlParser.backSpaceHtmlChars(curString, curStrPos, _this4);
359	        // replace text with base text + typed characters
360	        var curStringAtPosition = curString.substr(0, curStrPos);
361	        _this4.replaceText(curStringAtPosition);
362
363	        // if smartBack is enabled
364	        if (_this4.smartBackspace) {
365	          // the remaining part of the current string is equal of the same part of the new string
366	          var nextString = _this4.strings[_this4.arrayPos + 1];
367	          if (nextString && curStringAtPosition === nextString.substr(0, curStrPos)) {
368	            _this4.stopNum = curStrPos;
369	          } else {
370	            _this4.stopNum = 0;
371	          }
372	        }
373
374	        // if the number (id of character in current string) is
375	        // less than the stop number, keep going
376	        if (curStrPos > _this4.stopNum) {
377	          // subtract characters one by one
378	          curStrPos--;
379	          // loop the function
380	          _this4.backspace(curString, curStrPos);
381	        } else if (curStrPos <= _this4.stopNum) {
382	          // if the stop number has been reached, increase
383	          // array position to next string
384	          _this4.arrayPos++;
385	          // When looping, begin at the beginning after backspace complete
386	          if (_this4.arrayPos === _this4.strings.length) {
387	            _this4.arrayPos = 0;
388	            _this4.options.onLastStringBackspaced();
389	            _this4.shuffleStringsIfNeeded();
390	            _this4.begin();
391	          } else {
392	            _this4.typewrite(_this4.strings[_this4.sequence[_this4.arrayPos
392]], curStrPos);
393	          }
394	        }
395	        // humanized value for typing
396	      }, humanize);
397	    }
398
399	    /**
400	     * Full animation is complete
401	     * @private
402	     */
403	  }, {
404	    key: 'complete',
405	    value: function complete() {
406	      this.options.onComplete(this);
407	      if (this.loop) {
408	        this.curLoop++;
409	      } else {
410	        this.typingComplete = true;
411	      }
412	    }
413
414	    /**
415	     * Has the typing been stopped
416	     * @param {string} curString the current string in the strings array
417	     * @param {number} curStrPos the current position in the curString
418	     * @param {boolean} isTyping
419	     * @private
420	     */
421	  }, {
422	    key: 'setPauseStatus',
423	    value: function setPauseStatus(curString, curStrPos, isTyping) {
424	      this.pause.typewrite = isTyping;
425	      this.pause.curString = curString;
426	      this.pause.curStrPos = curStrPos;
427	    }
428
429	    /**
430	     * Toggle the blinking cursor
431	     * @param {boolean} isBlinking
432	     * @private
433	     */
434	  }, {
435	    key: 'toggleBlinking',
436	    value: function toggleBlinking(isBlinking) {
437	      if (!this.cursor) return;
438	      // if in paused state, don't toggle blinking a 2nd time
439	      if (this.pause.status) return;
440	      if (this.cursorBlinking === isBlinking) return;
441	      this.cursorBlinking = isBlinking;
442	      var status = isBlinking ? 'infinite' : 0;
443	      this.cursor.style.animationIterationCount = status;
444	    }
445
446	    /**
447	     * Speed in MS to type
448	     * @param {number} speed
449	     * @private
450	     */
451	  }, {
452	    key: 'humanizer',
453	    value: function humanizer(speed) {
454	      return Math.round(Math.random() * speed / 2) + speed;
455	    }
456
457	    /**
458	     * Shuffle the sequence of the strings array
459	     * @private
460	     */
461	  }, {
462	    key: 'shuffleStringsIfNeeded',
463	    value: function shuffleStringsIfNeeded() {
464	      if (!this.shuffle) return;
465	      this.sequence = this.sequence.sort(function () {
466	        return Math.random() - 0.5;
467	      });
468	    }
469
470	    /**
471	     * Adds a CSS class to fade out current string
472	     * @private
473	     */
474	  }, {
475	    key: 'initFadeOut',
476	    value: function initFadeOut() {
477	      var _this5 = this;
478
479	      this.el.className += ' ' + this.fadeOutClass;
480	      if (this.cursor) this.cursor.className += ' ' + this.fadeOutClass;
481	      return setTimeout(function () {
482	        _this5.arrayPos++;
483	        _this5.replaceText('');
484
485	        // Resets current string if end of loop reached
486	        if (_this5.strings.length > _this5.arrayPos) {
487	          _this5.typewrite(_this5.strings[_this5.sequence[_this5.arrayPos]], 0);
488	        } else {
489	          _this5.typewrite(_this5.strings[0], 0);
490	          _this5.arrayPos = 0;
491	        }
492	      }, this.fadeOutDelay);
493	    }
494
495	    /**
496	     * Replaces current text in the HTML element
497	     * depending on element type
498	     * @param {string} str
499	     * @private
500	     */
501	  }, {
502	    key: 'replaceText',
503	    value: function replaceText(str) {
504	      if (this.attr) {
505	        this.el.setAttribute(this.attr, str);
506	      } else {
507	        if (this.isInput) {
508	          this.el.value = str;
509	        } else if (this.contentType === 'html') {
510	          this.el.innerHTML = str;
511	        } else {
512	          this.el.textContent = str;
513	        }
514	      }
515	    }
516
517	    /**
518	     * If using input elements, bind focus in order to
519	     * start and stop the animation
520	     * @private
521	     */
522	  }, {
523	    key: 'bindFocusEvents',
524	    value: function bindFocusEvents() {
525	      var _this6 = this;
526
527	      if (!this.isInput) return;
528	      this.el.addEventListener('focus', function (e) {
529	        _this6.stop();
530	      });
531	      this.el.addEventListener('blur', function (e) {
532	        if (_this6.el.value && _this6.el.value.length !== 0) {
533	          return;
534	        }
535	        _this6.start();
536	      });
537	    }
538
539	    /**
540	     * On init, insert the cursor element
541	     * @private
542	     */
543	  }, {
544	    key: 'insertCursor',
545	    value: function insertCursor() {
546	      if (!this.showCursor) return;
547	      if (this.cursor) return;
548	      this.cursor = document.createElement('span');
549	      this.cursor.className = 'typed-cursor';
550	      this.cursor.innerHTML = this.cursorChar;
551	      this.el.parentNode && this.el.parentNode.insertBefore(this.cursor, this.el.nextSibling);
552	    }
553	  }]);
554
555	  return Typed;
556	})();
557
558	exports['default'] = Typed;
559	module.exports = exports['default'];
560
561/***/ }),
562/* 1 */
563/***/ (function(module, exports, __webpack_require__) {
564
565	'use strict';
566
567	Object.defineProperty(exports, '__esModule', {
568	  value: true
569	});
570
571	var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
572
573	var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
574
575	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
576
577	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
578
579	var _defaultsJs = __webpack_require__(2);
580
581	var _defaultsJs2 = _interopRequireDefault(_defaultsJs);
582
583	/**
584	 * Initialize the Typed object
585	 */
586
587	var Initializer = (function () {
588	  function Initializer() {
589	    _classCallCheck(this, Initializer);
590	  }
591
592	  _createClass(Initializer, [{
593	    key: 'load',
594
595	    /**
596	     * Load up defaults & options on the Typed instance
597	     * @param {Typed} self instance of Typed
598	     * @param {object} options options object
599	     * @param {string} elementId HTML element ID _OR_ instance of HTML element
600	     * @private
601	     */
602
603	    value: function load(self, options, elementId) {
604	      // chosen element to manipulate text
605	      if (typeof elementId === 'string') {
606	        self.el = document.querySelector(elementId);
607	      } else {
608	        self.el = elementId;
609	      }
610
611	      self.options = _extends({}, _defaultsJs2['default'], options);
612
613	      // attribute to type into
614	      self.isInput = self.el.tagName.toLowerCase() === 'input';
615	      self.attr = self.options.attr;
616	      self.bindInputFocusEvents = self.options.bindInputFocusEvents;
617
618	      // show cursor
619	      self.showCursor = self.isInput ? false : self.options.showCursor;
620
621	      // custom cursor
622	      self.cursorChar = self.options.cursorChar;
623
624	      // Is the cursor blinking
625	      self.cursorBlinking = true;
626
627	      // text content of element
628	      self.elContent = self.attr ? self.el.getAttribute(self.attr) : self.el.textContent;
629
630	      // html or plain text
631	      self.contentType = self.options.contentType;
632
633	      // typing speed
634	      self.typeSpeed = self.options.typeSpeed;
635
636	      // add a delay before typing starts
637	      self.startDelay = self.options.startDelay;
638
639	      // backspacing speed
640	      self.backSpeed = self.options.backSpeed;
641
642	      // only backspace what doesn't match the previous string
643	      self.smartBackspace = self.options.smartBackspace;
644
645	      // amount of time to wait before backspacing
646	      self.backDelay = self.options.backDelay;
647
648	      // Fade out instead of backspace
649	      self.fadeOut = self.options.fadeOut;
650	      self.fadeOutClass = self.options.fadeOutClass;
651	      self.fadeOutDelay = self.options.fadeOutDelay;
652
653	      // variable to check whether typing is currently paused
654	      self.isPaused = false;
655
656	      // input strings of text
657	      self.strings = self.options.strings.map(function (s) {
658	        return s.trim();
659	      });
660
661	      // div containing strings
662	      if (typeof self.options.stringsElement === 'string') {
663	        self.stringsElement = document.querySelector(self.options.stringsElement);
664	      } else {
665	        self.stringsElement = self.options.stringsElement;
666	      }
667
668	      if (self.stringsElement) {
669	        self.strings = [];
670	        self.stringsElement.style.display = 'none';
671	        var strings = Array.prototype.slice.apply(self.stringsElement.children);
672	        var _iteratorNormalCompletion = true;
673	        var _didIteratorError = false;
674	        var _iteratorError = undefined;
675
676	        try {
677	          for (var _iterator = strings[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
678	            var s = _step.value;
679
680	            self.strings.push(s.innerHTML.trim());
681	          }
682	        } catch (err) {
683	          _didIteratorError = true;
684	          _iteratorError = err;
685	        } finally {
686	          try {
687	            if (!_iteratorNormalCompletion && _iterator['return']) {
688	              _iterator['return']();
689	            }
690	          } finally {
691	            if (_didIteratorError) {
692	              throw _iteratorError;
693	            }
694	          }
695	        }
696	      }
697
698	      // character number position of current string
699	      self.strPos = 0;
700
701	      // current array position
702	      self.arrayPos = 0;
703
704	      // index of string to stop backspacing on
705	      self.stopNum = 0;
706
707	      // Looping logic
708	      self.loop = self.options.loop;
709	      self.loopCount = self.options.loopCount;
710	      self.curLoop = 0;
711
712	      // shuffle the strings
713	      self.shuffle = self.options.shuffle;
714	      // the order of strings
715	      self.sequence = [];
716
717	      self.pause = {
718	        status: false,
719	        typewrite: true,
720	        curString: '',
721	        curStrPos: 0
722	      };
723
724	      // When the typing is complete (when not looped)
725	      self.typingComplete = false;
726
727	      // Set the order in which the strings are typed
728	      for (var i in self.strings) {
729	        self.sequence[i] = i;
730	      }
731
732	      // If there is some text in the element
733	      self.currentElContent = this.getCurrentElContent(self);
734
735	      self.autoInsertCss = self.options.autoInsertCss;
736
737	      this.appendAnimationCss(self);
738	    }
739	  }, {
740	    key: 'getCurrentElContent',
741	    value: function getCurrentElContent(self) {
742	      var elContent = '';
743	      if (self.attr) {
744	        elContent = self.el.getAttribute(self.attr);
745	      } else if (self.isInput) {
746	        elContent = self.el.value;
747	      } else if (self.contentType === 'html') {
748	        elContent = self.el.innerHTML;
749	      } else {
750	        elContent = self.el.textContent;
751	      }
752	      return elContent;
753	    }
754	  }, {
755	    key: 'appendAnimationCss',
756	    value: function appendAnimationCss(self) {
757	      if (!self.autoInsertCss) {
758	        return;
759	      }
760	      if (!self.showCursor || !self.fadeOut) {
761	        return;
762	      }
763
764	      var css = document.createElement('style');
765	      css.type = 'text/css';
766	      var innerCss = '';
767	      if (self.showCursor) {
768	        innerCss += '\n        .typed-cursor{\n          opacity: 1;\n          animation: typedjsBlink 0.7s infinite;\n          -webkit-animation: typedjsBlink 0.7s infinite;\n                  animation: typedjsBlink 0.7s infinite;\n        }\n        @keyframes typedjsBlink{\n          50% { opacity: 0.0; }\n        }\n        @-webkit-keyframes typedjsBlink{\n          0% { opacity: 1; }\n          50% { opacity: 0.0; }\n          100% { opacity: 1; }\n        }\n      ';
769	      }
770	      if (self.fadeOut) {
771	        innerCss += '\n        .typed-fade-out{\n          opacity: 0;\n          transition: opacity .25s;\n          -webkit-animation: 0;\n                  animation: 0;\n        }\n      ';
772	      }
773	      if (css.length === 0) {
774	        return;
775	      }
776	      css.innerHTML = innerCss;
777	      document.head.appendChild(css);
778	    }
779	  }]);
780
781	  return Initializer;
782	})();
783
784	exports['default'] = Initializer;
785	var initializer = new Initializer();
786	exports.initializer = initializer;
787
788/***/ }),
789/* 2 */
790/***/ (function(module, exports) {
791
792	/**
793	 * Defaults & options
794	 * @returns {object} Typed defaults & options
795	 * @public
796	 */
797
798	'use strict';
799
800	Object.defineProperty(exports, '__esModule', {
801	  value: true
802	});
803	var defaults = {
804	  /**
805	   * @property {array} strings strings to be typed
806	   * @property {string} stringsElement ID of element containing string children
807	   */
808	  strings: ['These are the default values...', 'You know what you should do?', 'Use your own!', 'Have a great day!'],
809	  stringsElement: null,
810
811	  /**
812	   * @property {number} typeSpeed type speed in milliseconds
813	   */
814	  typeSpeed: 0,
815
816	  /**
817	   * @property {number} startDelay time before typing starts in milliseconds
818	   */
819	  startDelay: 0,
820
821	  /**
822	   * @property {number} backSpeed backspacing speed in milliseconds
823	   */
824	  backSpeed: 0,
825
826	  /**
827	   * @property {boolean} smartBackspace only backspace what doesn't match the previous string
828	   */
829	  smartBackspace: true,
830
831	  /**
832	   * @property {boolean} shuffle shuffle the strings
833	   */
834	  shuffle: false,
835
836	  /**
837	   * @property {number} backDelay time before backspacing in milliseconds
838	   */
839	  backDelay: 700,
840
841	  /**
842	   * @property {boolean} fadeOut Fade out instead of backspace
843	   * @property {string} fadeOutClass css class for fade animation
844	   * @property {boolean} fadeOutDelay Fade out delay in milliseconds
845	   */
846	  fadeOut: false,
847	  fadeOutClass: 'typed-fade-out',
848	  fadeOutDelay: 500,
849
850	  /**
851	   * @property {boolean} loop loop strings
852	   * @property {number} loopCount amount of loops
853	   */
854	  loop: false,
855	  loopCount: Infinity,
856
857	  /**
858	   * @property {boolean} showCursor show cursor
859	   * @property {string} cursorChar character for cursor
860	   * @property {boolean} autoInsertCss insert CSS for cursor and fadeOut into HTML <head>
861	   */
862	  showCursor: true,
863	  cursorChar: '|',
864	  autoInsertCss: true,
865
866	  /**
867	   * @property {string} attr attribute for typing
868	   * Ex: input placeholder, value, or just HTML text
869	   */
870	  attr: null,
871
872	  /**
873	   * @property {boolean} bindInputFocusEvents bind to focus and blur if el is text input
874	   */
875	  bindInputFocusEvents: false,
876
877	  /**
878	   * @property {string} contentType 'html' or 'null' for plaintext
879	   */
880	  contentType: 'html',
881
882	  /**
883	   * All typing is complete
884	   * @param {Typed} self
885	   */
886	  onComplete: function onComplete(self) {},
887
888	  /**
889	   * Before each string is typed
890	   * @param {number} arrayPos
891	   * @param {Typed} self
892	   */
893	  preStringTyped: function preStringTyped(arrayPos, self) {},
894
895	  /**
896	   * After each string is typed
897	   * @param {number} arrayPos
898	   * @param {Typed} self
899	   */
900	  onStringTyped: function onStringTyped(arrayPos, self) {},
901
902	  /**
903	   * During looping, after last string is typed
904	   * @param {Typed} self
905	   */
906	  onLastStringBackspaced: function onLastStringBackspaced(self) {},
907
908	  /**
909	   * Typing has been stopped
910	   * @param {number} arrayPos
911	   * @param {Typed} self
912	   */
913	  onTypingPaused: function onTypingPaused(arrayPos, self) {},
914
915	  /**
916	   * Typing has been started after being stopped
917	   * @param {number} arrayPos
918	   * @param {Typed} self
919	   */
920	  onTypingResumed: function onTypingResumed(arrayPos, self) {},
921
922	  /**
923	   * After reset
924	   * @param {Typed} self
925	   */
926	  onReset: function onReset(self) {},
927
928	  /**
929	   * After stop
930	   * @param {number} arrayPos
931	   * @param {Typed} self
932	   */
933	  onStop: function onStop(arrayPos, self) {},
934
935	  /**
936	   * After start
937	   * @param {number} arrayPos
938	   * @param {Typed} self
939	   */
940	  onStart: function onStart(arrayPos, self) {},
941
942	  /**
943	   * After destroy
944	   * @param {Typed} self
945	   */
946	  onDestroy: function onDestroy(self) {}
947	};
948
949	exports['default'] = defaults;
950	module.exports = exports['default'];
951
952/***/ }),
953/* 3 */
954/***/ (function(module, exports) {
955
956
957	/**
958	 * TODO: These methods can probably be combined somehow
959	 * Parse HTML tags & HTML Characters
960	 */
961
962	'use strict';
963
964	Object.defineProperty(exports, '__esModule', {
965	  value: true
966	});
967
968	var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
969
970	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
971
972	var HTMLParser = (function () {
973	  function HTMLParser() {
974	    _classCallCheck(this, HTMLParser);
975	  }
976
977	  _createClass(HTMLParser, [{
978	    key: 'typeHtmlChars',
979
980	    /**
981	     * Type HTML tags & HTML Characters
982	     * @param {string} curString Current string
983	     * @param {number} curStrPos Position in current string
984	     * @param {Typed} self instance of Typed
985	     * @returns {number}
985 a new string position
986	     * @private
987	     */
988
989	    value: function typeHtmlChars(curString, curStrPos, self) {
990	      if (self.contentType !== 'html') return curStrPos;
991	      var curChar = curString.substr(curStrPos).charAt(0);
992	      if (curChar === '<' || curChar === '&') {
993	        var endTag = '';
994	        if (curChar === '<') {
995	          endTag = '>';
996	        } else {
997	          endTag = ';';
998	        }
999	        while (curString.substr(curStrPos + 1).charAt(0) !== endTag) {
1000	          curStrPos++;
1001	          if (curStrPos + 1 > curString.length) {
1002	            break;
1003	          }
1004	        }
1005	        curStrPos++;
1006	      }
1007	      return curStrPos;
1008	    }
1009
1010	    /**
1011	     * Backspace HTML tags and HTML Characters
1012	     * @param {string} curString Current string
1013	     * @param {number} curStrPos Position in current string
1014	     * @param {Typed} self instance of Typed
1015	     * @returns {number} a new string position
1016	     * @private
1017	     */
1018	  }, {
1019	    key: 'backSpaceHtmlChars',
1020	    value: function backSpaceHtmlChars(curString, curStrPos, self) {
1021	      if (self.contentType !== 'html') return curStrPos;
1022	      var curChar = curString.substr(curStrPos).charAt(0);
1023	      if (curChar === '>' || curChar === ';') {
1024	        var endTag = '';
1025	        if (curChar === '>') {
1026	          endTag = '<';
1027	        } else {
1028	          endTag = '&';
1029	        }
1030	        while (curString.substr(curStrPos - 1).charAt(0) !== endTag) {
1031	          curStrPos--;
1032	          if (curStrPos < 0) {
1033	            break;
1034	          }
1035	        }
1036	        curStrPos--;
1037	      }
1038	      return curStrPos;
1039	    }
1040	  }]);
1041
1042	  return HTMLParser;
1043	})();
1044
1045	exports['default'] = HTMLParser;
1046	var htmlParser = new HTMLParser();
1047	exports.htmlParser = htmlParser;
1048
1049/***/ })
1050/******/ ])
1051});
1052;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.