postscribe 2.0.7 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/postscribe.js +10 -18
- package/dist/postscribe.js.map +1 -1
- package/dist/postscribe.max.js +10 -18
- package/dist/postscribe.min.js +2 -2
- package/package.json +4 -4
package/dist/postscribe.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* @file postscribe
|
3
3
|
* @description Asynchronously write javascript, even with document.write.
|
4
|
-
* @version
|
4
|
+
* @version v2.0.8
|
5
5
|
* @see {@link https://krux.github.io/postscribe}
|
6
6
|
* @license MIT
|
7
7
|
* @author Derek Brans
|
@@ -383,7 +383,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
383
383
|
* @param {null|*} value The attribute value.
|
384
384
|
*/
|
385
385
|
function setData(el, name) {
|
386
|
-
var value = arguments.length
|
386
|
+
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
387
387
|
|
388
388
|
var attr = BASEATTR + name;
|
389
389
|
|
@@ -426,7 +426,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
426
426
|
* @param {?Object} options The options
|
427
427
|
*/
|
428
428
|
function WriteStream(root) {
|
429
|
-
var options = arguments.length
|
429
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
430
430
|
|
431
431
|
_classCallCheck(this, WriteStream);
|
432
432
|
|
@@ -998,7 +998,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
998
998
|
/**
|
999
999
|
* @file prescribe
|
1000
1000
|
* @description Tiny, forgiving HTML parser
|
1001
|
-
* @version
|
1001
|
+
* @version vundefined
|
1002
1002
|
* @see {@link https://github.com/krux/prescribe/}
|
1003
1003
|
* @license MIT
|
1004
1004
|
* @author Derek Brans
|
@@ -1127,12 +1127,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1127
1127
|
* @param {Object} options The options
|
1128
1128
|
* @param {boolean} options.autoFix Set to true to automatically fix errors
|
1129
1129
|
*/
|
1130
|
-
|
1131
1130
|
function HtmlParser() {
|
1132
1131
|
var _this = this;
|
1133
1132
|
|
1134
|
-
var stream = arguments.length
|
1135
|
-
var options = arguments.length
|
1133
|
+
var stream = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
1134
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1136
1135
|
|
1137
1136
|
_classCallCheck(this, HtmlParser);
|
1138
1137
|
|
@@ -1364,7 +1363,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1364
1363
|
|
1365
1364
|
exports.__esModule = true;
|
1366
1365
|
|
1367
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
1366
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
1368
1367
|
|
1369
1368
|
exports.comment = comment;
|
1370
1369
|
exports.chars = chars;
|
@@ -1500,7 +1499,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1500
1499
|
* Token is a base class for all token types parsed. Note we don't actually
|
1501
1500
|
* use intheritance due to IE8's non-existent ES5 support.
|
1502
1501
|
*/
|
1503
|
-
|
1504
1502
|
var Token =
|
1505
1503
|
/**
|
1506
1504
|
* Constructor.
|
@@ -1528,7 +1526,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1528
1526
|
* @param {string} content The content of the comment
|
1529
1527
|
* @param {Number} length The length of the Token text.
|
1530
1528
|
*/
|
1531
|
-
|
1532
1529
|
function CommentToken(content, length) {
|
1533
1530
|
_classCallCheck(this, CommentToken);
|
1534
1531
|
|
@@ -1556,7 +1553,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1556
1553
|
*
|
1557
1554
|
* @param {Number} length The length of the Token text.
|
1558
1555
|
*/
|
1559
|
-
|
1560
1556
|
function CharsToken(length) {
|
1561
1557
|
_classCallCheck(this, CharsToken);
|
1562
1558
|
|
@@ -1588,7 +1584,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1588
1584
|
* @param {Object} booleanAttrs If an entry has 'true' then the attribute
|
1589
1585
|
* is a boolean attribute
|
1590
1586
|
*/
|
1591
|
-
|
1592
1587
|
function TagToken(type, tagName, length, attrs, booleanAttrs) {
|
1593
1588
|
_classCallCheck(this, TagToken);
|
1594
1589
|
|
@@ -1612,7 +1607,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1612
1607
|
|
1613
1608
|
|
1614
1609
|
TagToken.formatTag = function formatTag(tok) {
|
1615
|
-
var content = arguments.length
|
1610
|
+
var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
1616
1611
|
|
1617
1612
|
var str = '<' + tok.tagName;
|
1618
1613
|
for (var key in tok.attrs) {
|
@@ -1663,7 +1658,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1663
1658
|
* @param {boolean} unary True if the tag is a unary tag
|
1664
1659
|
* @param {string} rest The rest of the content.
|
1665
1660
|
*/
|
1666
|
-
|
1667
1661
|
function StartTagToken(tagName, length, attrs, booleanAttrs, unary, rest) {
|
1668
1662
|
_classCallCheck(this, StartTagToken);
|
1669
1663
|
|
@@ -1701,7 +1695,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1701
1695
|
* is a boolean attribute
|
1702
1696
|
* @param {string} content The content of the tag.
|
1703
1697
|
*/
|
1704
|
-
|
1705
1698
|
function AtomicTagToken(tagName, length, attrs, booleanAttrs, content) {
|
1706
1699
|
_classCallCheck(this, AtomicTagToken);
|
1707
1700
|
|
@@ -1735,7 +1728,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1735
1728
|
* @param {string} tagName The name of the tag.
|
1736
1729
|
* @param {Number} length The length of the tag text.
|
1737
1730
|
*/
|
1738
|
-
|
1739
1731
|
function EndTagToken(tagName, length) {
|
1740
1732
|
_classCallCheck(this, EndTagToken);
|
1741
1733
|
|
@@ -1769,7 +1761,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1769
1761
|
* @returns {string}
|
1770
1762
|
*/
|
1771
1763
|
function escapeQuotes(value) {
|
1772
|
-
var defaultValue = arguments.length
|
1764
|
+
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
1773
1765
|
|
1774
1766
|
// There's no lookback in JS, so /(^|[^\\])"/ only matches the first of two `"`s.
|
1775
1767
|
// Instead, just match anything before a double-quote and escape if it's not already escaped.
|
@@ -1945,7 +1937,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1945
1937
|
|
1946
1938
|
exports.__esModule = true;
|
1947
1939
|
|
1948
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
1940
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
1949
1941
|
|
1950
1942
|
exports.existy = existy;
|
1951
1943
|
exports.isFunction = isFunction;
|
package/dist/postscribe.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap eac4a69ab885dd6dbc3d","webpack:///./src/main.js","webpack:///./src/postscribe.js","webpack:///./src/write-stream.js","webpack:///./~/prescribe/dist/prescribe.js","webpack:///./src/utils.js"],"names":["module","exports","postscribe","utils","doNothing","OPTIONS","afterAsync","afterDequeue","afterStreamStart","afterWrite","autoFix","beforeEnqueue","beforeWriteToken","tok","beforeWrite","str","done","error","e","Error","msg","releaseAsync","nextId","queue","active","nextStream","args","shift","options","last","stream","runStream","el","html","id","name","streams","doc","ownerDocument","stash","close","open","write","writeln","join","oldOnError","win","onerror","url","line","apply","isFunction","defaults","test","window","document","getElementById","substr","jquery","cancel","abort","push","WriteStream","DEBUG_CHUNK","BASEATTR","PROXY_STYLE","PROXY_SCRIPT","getData","attr","val","getAttribute","existy","String","setData","value","setAttribute","removeAttribute","root","defaultView","parentWindow","parser","actuals","proxyHistory","proxyRoot","createElement","nodeName","scriptStack","writeQueue","deferredRemote","length","arg","_callFunction","_writeImpl","fn","type","toString","_onScriptStart","call","_onScriptDone","append","script","style","tokens","readToken","isScript","isStyle","_writeStaticTokens","_handleScriptToken","_handleStyleToken","chunk","_buildChunk","actual","proxy","innerHTML","proxyInnerHTML","_walkChunk","actualInnerHTML","raw","len","i","tokenRaw","attrs","tagName","replace","unary","node","stack","isElement","nodeType","isProxy","parentIsProxyOf","parentNode","appendChild","unshift","toArray","childNodes","remainder","clear","src","SRC","_writeScriptToken","TYPE","_writeStyleToken","_buildStyle","_insertCursor","content","styleSheet","sheet","cssText","createTextNode","eachKey","which","cursor","replaceChild","outerWrites","_buildScript","asyncRelease","_shouldRelease","_scriptLoadHandler","text","cleanup","onload","onreadystatechange","success","failure","err","reattachEventListener","evt","handler","_onload","Array","prototype","slice","arguments","_onerror","readyState","hasAttribute","each","isTag","thing","x","arr","target","obj","key","hasOwnProperty","_defaults","ret","array","tag","toLowerCase","indexOf"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;ACtCA;;;;;;AAEAA,QAAOC,OAAP,2B;;;;;;;;;;;;sBCmJwBC,U;;AArJxB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,EAAE;;AAE/Q,mDAAkD,0CAA0C,0DAA0D,EAAE;;AAExJ;AACA;AACA;AACA;AACA;;AAEA,YAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,QAAQ;AACtB;;AAEA;AACA;;AAEA;AACA,4EAA2E;;AAE3E;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAAiD;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,SAAQ;AACR,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAgB;AAChB;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAgB,OAAO;AACvB;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAgB,OAAO;AACvB;;;AAGA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;;AAEA;AACA;AACA;AACA,GAAE;AACF;AACA;;AAEA;;AAEA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;;AAEA,sGAAqG,mBAAmB,EAAE,mBAAmB,kGAAkG;;AAE/O;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA,aAAY;AACZ;AACA;;AAEA;AACA,WAAU;;AAEV;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,mDAAkD,0CAA0C,0DAA0D,EAAE;;AAExJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAY,OAAO;AACnB,aAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,SAAS;AACvB,eAAc,QAAQ;AACtB,iBAAgB,OAAO;AACvB;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAE;;AAEF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB;AACA,eAAc,QAAQ;AACtB,eAAc,OAAO;AACrB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB;AACA,eAAc,OAAO;AACrB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW;AACX;AACA;;AAEA;AACA;AACA;AACA,YAAW;AACX;AACA;;AAEA;AACA;AACA;AACA,aAAY,MAAM;AAClB,eAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,WAAW;AACvB,aAAY,SAAS;AACrB,eAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,WAAW;AACvB,aAAY,aAAa;AACzB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB,eAAe;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAY,WAAW;AACvB,aAAY,OAAO;AACnB,aAAY,QAAQ;AACpB,aAAY,QAAQ;AACpB,aAAY,SAAS;AACrB,eAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAC;AACD,E;;;;;;;;;;;;SCt6BgBS,M,GAAAA,M;SAUApB,U,GAAAA,U;SAWA8H,I,GAAAA,I;SAeA3B,O,GAAAA,O;SAe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AKA,UAAOzC,OAAP;AACD;;AAED;;;;;;AAMO,UAAS0G,OAAT,CAAiBiD,GAAjB,EAAsB;AAC3B,OAAI;AACF,YAAOb,MAAMC,SAAN,CAAgBC,KAAhB,CAAsB3E,IAAtB,CAA2BsF,GAA3B,CAAP;AACD,IAFD,CAEE,OAAOrK,CAAP,EAAU;AAAA;AACV,WAAMyK,MAAM,EAAZ;AACAV,YAAKM,GAAL,EAAU,UAASlH,GAAT,EAAc;AACtBsH,aAAI9H,IAAJ,CAASQ,GAAT;AACD,QAFD;AAGA;AAAA,YAAOsH;AAAP;AALU;;AAAA;AAMX;AACF;;AAED;;;;;;AAMO,UAAS9J,IAAT,CAAc+J,KAAd,EAAqB;AAC1B,UAAOA,MAAMA,MAAMnG,MAAN,GAAe,CAArB,CAAP;AACD;;AAED;;;;;;;AAOO,UAASyF,KAAT,CAAerK,GAAf,EAAoBgL,GAApB,EAAyB;AAC9B,UAAO,CAAChL,GAAD,IACL,EAAEA,IAAIiF,IAAJ,KAAa,UAAb,IAA2BjF,IAAIiF,IAAJ,KAAa,WAA1C,CADK,IAEL,EAAE,aAAajF,GAAf,CAFK,GAEiB,CAAC,CAFlB,GAEsB,CAAC,CAAC,CAACA,IAAI6G,OAAJ,CAAYoE,WAAZ,GAA0BC,OAA1B,CAAkCF,GAAlC,CAFhC;AAGD;;AAED;;;;;;AAMO,UAASrF,QAAT,CAAkB3F,GAAlB,EAAuB;AAC5B,UAAOqK,MAAMrK,GAAN,EAAW,QAAX,CAAP;AACD;;AAED;;;;;;AAMO,UAAS4F,OAAT,CAAiB5F,GAAjB,EAAsB;AAC3B,UAAOqK,MAAMrK,GAAN,EAAW,OAAX,CAAP;AACD,E","file":"postscribe.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"postscribe\"] = factory();\n\telse\n\t\troot[\"postscribe\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap eac4a69ab885dd6dbc3d\n **/","import postscribe from './postscribe';\n\nmodule.exports = postscribe;\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main.js\n **/","import WriteStream from './write-stream';\nimport * as utils from './utils';\n\n/**\n * A function that intentionally does nothing.\n */\nfunction doNothing() {\n}\n\n/**\n * Available options and defaults.\n *\n * @type {Object}\n */\nconst OPTIONS = {\n /**\n * Called when an async script has loaded.\n */\n afterAsync: doNothing,\n\n /**\n * Called immediately before removing from the write queue.\n */\n afterDequeue: doNothing,\n\n /**\n * Called sync after a stream's first thread release.\n */\n afterStreamStart: doNothing,\n\n /**\n * Called after writing buffered document.write calls.\n */\n afterWrite: doNothing,\n\n /**\n * Allows disabling the autoFix feature of prescribe\n */\n autoFix: true,\n\n /**\n * Called immediately before adding to the write queue.\n */\n beforeEnqueue: doNothing,\n\n /**\n * Called before writing a token.\n *\n * @param {Object} tok The token\n */\n beforeWriteToken: tok => tok,\n\n /**\n * Called before writing buffered document.write calls.\n *\n * @param {String} str The string\n */\n beforeWrite: str => str,\n\n /**\n * Called when evaluation is finished.\n */\n done: doNothing,\n\n /**\n * Called when a write results in an error.\n *\n * @param {Error} e The error\n */\n error(e) { throw new Error(e.msg); },\n\n /**\n * Whether to let scripts w/ async attribute set fall out of the queue.\n */\n releaseAsync: false\n};\n\nlet nextId = 0;\nlet queue = [];\nlet active = null;\n\nfunction nextStream() {\n const args = queue.shift();\n if (args) {\n const options = utils.last(args);\n\n options.afterDequeue();\n args.stream = runStream(...args);\n options.afterStreamStart();\n }\n}\n\nfunction runStream(el, html, options) {\n active = new WriteStream(el, options);\n\n // Identify this stream.\n active.id = nextId++;\n active.name = options.name || active.id;\n postscribe.streams[active.name] = active;\n\n // Override document.write.\n const doc = el.ownerDocument;\n\n const stash = {\n close: doc.close,\n open: doc.open,\n write: doc.write,\n writeln: doc.writeln\n };\n\n function write(str) {\n str = options.beforeWrite(str);\n active.write(str);\n options.afterWrite(str);\n }\n\n Object.assign(doc, {\n close: doNothing,\n open: doNothing,\n write: (...str) => write(str.join('')),\n writeln: (...str) => write(str.join('') + '\\n')\n });\n\n // Override window.onerror\n const oldOnError = active.win.onerror || doNothing;\n\n // This works together with the try/catch around WriteStream::insertScript\n // In modern browsers, exceptions in tag scripts go directly to top level\n active.win.onerror = (msg, url, line) => {\n options.error({msg: `${msg} - ${url}: ${line}`});\n oldOnError.apply(active.win, [msg, url, line]);\n };\n\n // Write to the stream\n active.write(html, () => {\n // restore document.write\n Object.assign(doc, stash);\n\n // restore window.onerror\n active.win.onerror = oldOnError;\n\n options.done();\n active = null;\n nextStream();\n });\n\n return active;\n}\n\nexport default function postscribe(el, html, options) {\n if (utils.isFunction(options)) {\n options = {done: options};\n } else if (options === 'clear') {\n queue = [];\n active = null;\n nextId = 0;\n return;\n }\n\n options = utils.defaults(options, OPTIONS);\n\n // id selector\n if ((/^#/).test(el)) {\n el = window.document.getElementById(el.substr(1));\n } else {\n el = el.jquery ? el[0] : el;\n }\n\n const args = [el, html, options];\n\n el.postscribe = {\n cancel: () => {\n if (args.stream) {\n args.stream.abort();\n } else {\n args[1] = doNothing;\n }\n }\n };\n\n options.beforeEnqueue(args);\n queue.push(args);\n\n if (!active) {\n nextStream();\n }\n\n return el.postscribe;\n}\n\nObject.assign(postscribe, {\n // Streams by name.\n streams: {},\n // Queue of streams.\n queue,\n // Expose internal classes.\n WriteStream\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/postscribe.js\n **/","import HtmlParser from 'prescribe';\nimport * as utils from './utils';\n\n/**\n * Turn on to debug how each chunk affected the DOM.\n * @type {boolean}\n */\nconst DEBUG_CHUNK = false;\n\n/**\n * Prefix for data attributes on DOM elements.\n * @type {string}\n */\nconst BASEATTR = 'data-ps-';\n\n/**\n * ID for the style proxy\n * @type {string}\n */\nconst PROXY_STYLE = 'ps-style';\n\n/**\n * ID for the script proxy\n * @type {string}\n */\nconst PROXY_SCRIPT = 'ps-script';\n\n/**\n * Get data attributes\n *\n * @param {Object} el The DOM element.\n * @param {String} name The attribute name.\n * @returns {String}\n */\nfunction getData(el, name) {\n const attr = BASEATTR + name;\n\n const val = el.getAttribute(attr);\n\n // IE 8 returns a number if it's a number\n return !utils.existy(val) ? val : String(val);\n}\n\n/**\n * Set data attributes\n *\n * @param {Object} el The DOM element.\n * @param {String} name The attribute name.\n * @param {null|*} value The attribute value.\n */\nfunction setData(el, name, value = null) {\n const attr = BASEATTR + name;\n\n if (utils.existy(value) && value !== '') {\n el.setAttribute(attr, value);\n } else {\n el.removeAttribute(attr);\n }\n}\n\n/**\n * Stream static html to an element, where \"static html\" denotes \"html\n * without scripts\".\n *\n * This class maintains a *history of writes devoid of any attributes* or\n * \"proxy history\".\n *\n * Injecting the proxy history into a temporary div has no side-effects,\n * other than to create proxy elements for previously written elements.\n *\n * Given the `staticHtml` of a new write, a `tempDiv`'s innerHTML is set to\n * `proxy_history + staticHtml`.\n * The *structure* of `tempDiv`'s contents, (i.e., the placement of new nodes\n * beside or inside of proxy elements), reflects the DOM structure that would\n * have resulted if all writes had been squashed into a single write.\n *\n * For each descendent `node` of `tempDiv` whose parentNode is a *proxy*,\n * `node` is appended to the corresponding *real* element within the DOM.\n *\n * Proxy elements are mapped to *actual* elements in the DOM by injecting a\n * `data-id` attribute into each start tag in `staticHtml`.\n *\n */\nexport default class WriteStream {\n /**\n * Constructor.\n *\n * @param {Object} root The root element\n * @param {?Object} options The options\n */\n constructor(root, options = {}) {\n this.root = root;\n this.options = options;\n this.doc = root.ownerDocument;\n this.win = this.doc.defaultView || this.doc.parentWindow;\n this.parser = new HtmlParser('', {autoFix: options.autoFix});\n\n // Actual elements by id.\n this.actuals = [root];\n\n // Embodies the \"structure\" of what's been written so far,\n // devoid of attributes.\n this.proxyHistory = '';\n\n // Create a proxy of the root element.\n this.proxyRoot = this.doc.createElement(root.nodeName);\n\n this.scriptStack = [];\n this.writeQueue = [];\n\n setData(this.proxyRoot, 'proxyof', 0);\n }\n\n /**\n * Writes the given strings.\n *\n * @param {...String} str The strings to write\n */\n write(...str) {\n this.writeQueue.push(...str);\n\n // Process writes\n // When new script gets pushed or pending this will stop\n // because new writeQueue gets pushed\n while (!this.deferredRemote && this.writeQueue.length) {\n const arg = this.writeQueue.shift();\n\n if (utils.isFunction(arg)) {\n this._callFunction(arg);\n } else {\n this._writeImpl(arg);\n }\n }\n }\n\n /**\n * Calls the given function.\n *\n * @param {Function} fn The function to call\n * @private\n */\n _callFunction(fn) {\n const tok = {type: 'function', value: fn.name || fn.toString()};\n this._onScriptStart(tok);\n fn.call(this.win, this.doc);\n this._onScriptDone(tok);\n }\n\n /**\n * The write implementation\n *\n * @param {String} html The HTML to write.\n * @private\n */\n _writeImpl(html) {\n this.parser.append(html);\n\n let tok;\n let script;\n let style;\n const tokens = [];\n\n // stop if we see a script token\n while ((tok = this.parser.readToken()) &&\n !(script = utils.isScript(tok)) &&\n !(style = utils.isStyle(tok))) {\n tok = this.options.beforeWriteToken(tok);\n\n if (tok) {\n tokens.push(tok);\n }\n }\n\n if (tokens.length > 0) {\n this._writeStaticTokens(tokens);\n }\n\n if (script) {\n this._handleScriptToken(tok);\n }\n\n if (style) {\n this._handleStyleToken(tok);\n }\n }\n\n /**\n * Write contiguous non-script tokens (a chunk)\n *\n * @param {Array<Object>} tokens The tokens\n * @returns {{tokens, raw, actual, proxy}|null}\n * @private\n */\n _writeStaticTokens(tokens) {\n const chunk = this._buildChunk(tokens);\n\n if (!chunk.actual) {\n // e.g., no tokens, or a noscript that got ignored\n return null;\n }\n\n chunk.html = this.proxyHistory + chunk.actual;\n this.proxyHistory += chunk.proxy;\n this.proxyRoot.innerHTML = chunk.html;\n\n if (DEBUG_CHUNK) {\n chunk.proxyInnerHTML = this.proxyRoot.innerHTML;\n }\n\n this._walkChunk();\n\n if (DEBUG_CHUNK) {\n chunk.actualInnerHTML = this.root.innerHTML;\n }\n\n return chunk;\n }\n\n /**\n * Build a chunk.\n *\n * @param {Array<Object>} tokens The tokens to use.\n * @returns {{tokens: *, raw: string, actual: string, proxy: string}}\n * @private\n */\n _buildChunk(tokens) {\n let nextId = this.actuals.length;\n\n // The raw html of this chunk.\n const raw = [];\n\n // The html to create the nodes in the tokens (with id's injected).\n const actual = [];\n\n // Html that can later be used to proxy the nodes in the tokens.\n const proxy = [];\n\n const len = tokens.length;\n for (let i = 0; i < len; i++) {\n const tok = tokens[i];\n const tokenRaw = tok.toString();\n\n raw.push(tokenRaw);\n\n if (tok.attrs) { // tok.attrs <==> startTag or atomicTag or cursor\n // Ignore noscript tags. They are atomic, so we don't have to worry about children.\n if (!(/^noscript$/i).test(tok.tagName)) {\n const id = nextId++;\n\n // Actual: inject id attribute: replace '>' at end of start tag with id attribute + '>'\n actual.push(tokenRaw.replace(/(\\/?>)/, ` ${BASEATTR}id=${id} $1`));\n\n // Don't proxy scripts: they have no bearing on DOM structure.\n if (tok.attrs.id !== PROXY_SCRIPT && tok.attrs.id !== PROXY_STYLE) {\n // Proxy: strip all attributes and inject proxyof attribute\n proxy.push(\n // ignore atomic tags (e.g., style): they have no \"structural\" effect\n tok.type === 'atomicTag' ? '' :\n `<${tok.tagName} ${BASEATTR}proxyof=${id}` + (tok.unary ? ' />' : '>')\n );\n }\n }\n } else {\n // Visit any other type of token\n // Actual: append.\n actual.push(tokenRaw);\n\n // Proxy: append endTags. Ignore everything else.\n proxy.push(tok.type === 'endTag' ? tokenRaw : '');\n }\n }\n\n return {\n tokens,\n raw: raw.join(''),\n actual: actual.join(''),\n proxy: proxy.join('')\n };\n }\n\n /**\n * Walk the chunks.\n *\n * @private\n */\n _walkChunk() {\n let node;\n const stack = [this.proxyRoot];\n\n // use shift/unshift so that children are walked in document order\n while (utils.existy(node = stack.shift())) {\n const isElement = node.nodeType === 1;\n const isProxy = isElement && getData(node, 'proxyof');\n\n // Ignore proxies\n if (!isProxy) {\n if (isElement) {\n // New actual element: register it and remove the the id attr.\n this.actuals[getData(node, 'id')] = node;\n setData(node, 'id');\n }\n\n // Is node's parent a proxy?\n const parentIsProxyOf = node.parentNode &&\n getData(node.parentNode, 'proxyof');\n if (parentIsProxyOf) {\n // Move node under actual parent.\n this.actuals[parentIsProxyOf].appendChild(node);\n }\n }\n\n // prepend childNodes to stack\n stack.unshift.apply(stack, utils.toArray(node.childNodes));\n }\n }\n\n /**\n * Handles Script tokens\n *\n * @param {Object} tok The token\n */\n _handleScriptToken(tok) {\n const remainder = this.parser.clear();\n\n if (remainder) {\n // Write remainder immediately behind this script.\n this.writeQueue.unshift(remainder);\n }\n\n tok.src = tok.attrs.src || tok.attrs.SRC;\n\n tok = this.options.beforeWriteToken(tok);\n if (!tok) {\n // User has removed this token\n return;\n }\n\n if (tok.src && this.scriptStack.length) {\n // Defer this script until scriptStack is empty.\n // Assumption 1: This script will not start executing until\n // scriptStack is empty.\n this.deferredRemote = tok;\n } else {\n this._onScriptStart(tok);\n }\n\n // Put the script node in the DOM.\n this._writeScriptToken(tok, () => {\n this._onScriptDone(tok);\n });\n }\n\n /**\n * Handles style tokens\n *\n * @param {Object} tok The token\n */\n _handleStyleToken(tok) {\n const remainder = this.parser.clear();\n\n if (remainder) {\n // Write remainder immediately behind this style.\n this.writeQueue.unshift(remainder);\n }\n\n tok.type = tok.attrs.type || tok.attrs.TYPE || 'text/css';\n\n tok = this.options.beforeWriteToken(tok);\n\n if (tok) {\n // Put the style node in the DOM.\n this._writeStyleToken(tok);\n }\n\n if (remainder) {\n this.write();\n }\n }\n\n /**\n * Build a style and insert it into the DOM.\n *\n * @param {Object} tok The token\n */\n _writeStyleToken(tok) {\n const el = this._buildStyle(tok);\n\n this._insertCursor(el, PROXY_STYLE);\n\n // Set content\n if (tok.content) {\n if (el.styleSheet && !el.sheet) {\n el.styleSheet.cssText = tok.content;\n } else {\n el.appendChild(this.doc.createTextNode(tok.content));\n }\n }\n }\n\n /**\n * Build a style element from an atomic style token.\n *\n * @param {Object} tok The token\n * @returns {Element}\n */\n _buildStyle(tok) {\n const el = this.doc.createElement(tok.tagName);\n\n el.setAttribute('type', tok.type);\n\n // Set attributes\n utils.eachKey(tok.attrs, (name, value) => {\n el.setAttribute(name, value);\n });\n\n return el;\n }\n\n /**\n * Append a span to the stream. That span will act as a cursor\n * (i.e. insertion point) for the element.\n *\n * @param {Object} el The element\n * @param {string} which The type of proxy element\n */\n _insertCursor(el, which) {\n this._writeImpl(`<span id=\"${which}\"/>`);\n\n const cursor = this.doc.getElementById(which);\n\n if (cursor) {\n cursor.parentNode.replaceChild(el, cursor);\n }\n }\n\n /**\n * Called when a script is started.\n *\n * @param {Object} tok The token\n * @private\n */\n _onScriptStart(tok) {\n tok.outerWrites = this.writeQueue;\n this.writeQueue = [];\n this.scriptStack.unshift(tok);\n }\n\n /**\n * Called when a script is done.\n *\n * @param {Object} tok The token\n * @private\n */\n _onScriptDone(tok) {\n // Pop script and check nesting.\n if (tok !== this.scriptStack[0]) {\n this.options.error({msg: 'Bad script nesting or script finished twice'});\n return;\n }\n\n this.scriptStack.shift();\n\n // Append outer writes to queue and process them.\n this.write.apply(this, tok.outerWrites);\n\n // Check for pending remote\n\n // Assumption 2: if remote_script1 writes remote_script2 then\n // the we notice remote_script1 finishes before remote_script2 starts.\n // I think this is equivalent to assumption 1\n if (!this.scriptStack.length && this.deferredRemote) {\n this._onScriptStart(this.deferredRemote);\n this.deferredRemote = null;\n }\n }\n\n /**\n * Build a script and insert it into the DOM.\n * Done is called once script has executed.\n *\n * @param {Object} tok The token\n * @param {Function} done The callback when complete\n */\n _writeScriptToken(tok, done) {\n const el = this._buildScript(tok);\n const asyncRelease = this._shouldRelease(el);\n const afterAsync = this.options.afterAsync;\n\n if (tok.src) {\n // Fix for attribute \"SRC\" (capitalized). IE does not recognize it.\n el.src = tok.src;\n this._scriptLoadHandler(el, !asyncRelease ? () => {\n done();\n afterAsync();\n } : afterAsync);\n }\n\n try {\n this._insertCursor(el, PROXY_SCRIPT);\n if (!el.src || asyncRelease) {\n done();\n }\n } catch (e) {\n this.options.error(e);\n done();\n }\n }\n\n /**\n * Build a script element from an atomic script token.\n *\n * @param {Object} tok The token\n * @returns {Element}\n */\n _buildScript(tok) {\n const el = this.doc.createElement(tok.tagName);\n\n // Set attributes\n utils.eachKey(tok.attrs, (name, value) => {\n el.setAttribute(name, value);\n });\n\n // Set content\n if (tok.content) {\n el.text = tok.content;\n }\n\n return el;\n }\n\n /**\n * Setup the script load handler on an element.\n *\n * @param {Object} el The element\n * @param {Function} done The callback\n * @private\n */\n _scriptLoadHandler(el, done) {\n function cleanup() {\n el = el.onload = el.onreadystatechange = el.onerror = null;\n }\n\n const error = this.options.error;\n\n function success() {\n cleanup();\n if (done != null) {\n done();\n }\n done = null;\n }\n\n function failure(err) {\n cleanup();\n error(err);\n if (done != null) {\n done();\n }\n done = null;\n }\n\n function reattachEventListener(el, evt) {\n const handler = el[`on${evt}`];\n if (handler != null) {\n el[`_on${evt}`] = handler;\n }\n }\n\n reattachEventListener(el, 'load');\n reattachEventListener(el, 'error');\n\n Object.assign(el, {\n onload() {\n if (el._onload) {\n try {\n el._onload.apply(this, Array.prototype.slice.call(arguments, 0));\n } catch (err) {\n failure({msg: `onload handler failed ${err} @ ${el.src}`});\n }\n }\n success();\n },\n\n onerror() {\n if (el._onerror) {\n try {\n el._onerror.apply(this, Array.prototype.slice.call(arguments, 0));\n } catch (err) {\n failure({msg: `onerror handler failed ${err} @ ${el.src}`});\n return;\n }\n }\n failure({msg: `remote script failed ${el.src}`});\n },\n\n onreadystatechange() {\n if (/^(loaded|complete)$/.test(el.readyState)) {\n success();\n }\n }\n });\n }\n\n /**\n * Determines whether to release.\n *\n * @param {Object} el The element\n * @returns {boolean}\n * @private\n */\n _shouldRelease(el) {\n const isScript = (/^script$/i).test(el.nodeName);\n return !isScript || !!(this.options.releaseAsync && el.src && el.hasAttribute('async'));\n }\n\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/write-stream.js\n **/","/**\n * @file prescribe\n * @description Tiny, forgiving HTML parser\n * @version v1.1.1\n * @see {@link https://github.com/krux/prescribe/}\n * @license MIT\n * @author Derek Brans\n * @copyright 2016 Krux Digital, Inc\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Prescribe\"] = factory();\n\telse\n\t\troot[\"Prescribe\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _HtmlParser = __webpack_require__(1);\n\n\tvar _HtmlParser2 = _interopRequireDefault(_HtmlParser);\n\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n\tmodule.exports = _HtmlParser2['default'];\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\n\tvar _supports = __webpack_require__(2);\n\n\tvar supports = _interopRequireWildcard(_supports);\n\n\tvar _streamReaders = __webpack_require__(3);\n\n\tvar streamReaders = _interopRequireWildcard(_streamReaders);\n\n\tvar _fixedReadTokenFactory = __webpack_require__(6);\n\n\tvar _fixedReadTokenFactory2 = _interopRequireDefault(_fixedReadTokenFactory);\n\n\tvar _utils = __webpack_require__(5);\n\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }\n\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\t/**\n\t * Detection regular expressions.\n\t *\n\t * Order of detection matters: detection of one can only\n\t * succeed if detection of previous didn't\n\n\t * @type {Object}\n\t */\n\tvar detect = {\n\t comment: /^<!--/,\n\t endTag: /^<\\//,\n\t atomicTag: /^<\\s*(script|style|noscript|iframe|textarea)[\\s\\/>]/i,\n\t startTag: /^</,\n\t chars: /^[^<]/\n\t};\n\n\t/**\n\t * HtmlParser provides the capability to parse HTML and return tokens\n\t * representing the tags and content.\n\t */\n\n\tvar HtmlParser = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} stream The initial parse stream contents.\n\t * @param {Object} options The options\n\t * @param {boolean} options.autoFix Set to true to automatically fix errors\n\t */\n\n\t function HtmlParser() {\n\t var _this = this;\n\n\t var stream = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0];\n\t var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t _classCallCheck(this, HtmlParser);\n\n\t this.stream = stream;\n\n\t var fix = false;\n\t var fixedTokenOptions = {};\n\n\t for (var key in supports) {\n\t if (supports.hasOwnProperty(key)) {\n\t if (options.autoFix) {\n\t fixedTokenOptions[key + 'Fix'] = true; // !supports[key];\n\t }\n\t fix = fix || fixedTokenOptions[key + 'Fix'];\n\t }\n\t }\n\n\t if (fix) {\n\t this._readToken = (0, _fixedReadTokenFactory2['default'])(this, fixedTokenOptions, function () {\n\t return _this._readTokenImpl();\n\t });\n\t this._peekToken = (0, _fixedReadTokenFactory2['default'])(this, fixedTokenOptions, function () {\n\t return _this._peekTokenImpl();\n\t });\n\t } else {\n\t this._readToken = this._readTokenImpl;\n\t this._peekToken = this._peekTokenImpl;\n\t }\n\t }\n\n\t /**\n\t * Appends the given string to the parse stream.\n\t *\n\t * @param {string} str The string to append\n\t */\n\n\n\t HtmlParser.prototype.append = function append(str) {\n\t this.stream += str;\n\t };\n\n\t /**\n\t * Prepends the given string to the parse stream.\n\t *\n\t * @param {string} str The string to prepend\n\t */\n\n\n\t HtmlParser.prototype.prepend = function prepend(str) {\n\t this.stream = str + this.stream;\n\t };\n\n\t /**\n\t * The implementation of the token reading.\n\t *\n\t * @private\n\t * @returns {?Token}\n\t */\n\n\n\t HtmlParser.prototype._readTokenImpl = function _readTokenImpl() {\n\t var token = this._peekTokenImpl();\n\t if (token) {\n\t this.stream = this.stream.slice(token.length);\n\t return token;\n\t }\n\t };\n\n\t /**\n\t * The implementation of token peeking.\n\t *\n\t * @returns {?Token}\n\t */\n\n\n\t HtmlParser.prototype._peekTokenImpl = function _peekTokenImpl() {\n\t for (var type in detect) {\n\t if (detect.hasOwnProperty(type)) {\n\t if (detect[type].test(this.stream)) {\n\t var token = streamReaders[type](this.stream);\n\n\t if (token) {\n\t if (token.type === 'startTag' && /script|style/i.test(token.tagName)) {\n\t return null;\n\t } else {\n\t token.text = this.stream.substr(0, token.length);\n\t return token;\n\t }\n\t }\n\t }\n\t }\n\t }\n\t };\n\n\t /**\n\t * The public token peeking interface. Delegates to the basic token peeking\n\t * or a version that performs fixups depending on the `autoFix` setting in\n\t * options.\n\t *\n\t * @returns {object}\n\t */\n\n\n\t HtmlParser.prototype.peekToken = function peekToken() {\n\t return this._peekToken();\n\t };\n\n\t /**\n\t * The public token reading interface. Delegates to the basic token reading\n\t * or a version that performs fixups depending on the `autoFix` setting in\n\t * options.\n\t *\n\t * @returns {object}\n\t */\n\n\n\t HtmlParser.prototype.readToken = function readToken() {\n\t return this._readToken();\n\t };\n\n\t /**\n\t * Read tokens and hand to the given handlers.\n\t *\n\t * @param {Object} handlers The handlers to use for the different tokens.\n\t */\n\n\n\t HtmlParser.prototype.readTokens = function readTokens(handlers) {\n\t var tok = void 0;\n\t while (tok = this.readToken()) {\n\t // continue until we get an explicit \"false\" return\n\t if (handlers[tok.type] && handlers[tok.type](tok) === false) {\n\t return;\n\t }\n\t }\n\t };\n\n\t /**\n\t * Clears the parse stream.\n\t *\n\t * @returns {string} The contents of the parse stream before clearing.\n\t */\n\n\n\t HtmlParser.prototype.clear = function clear() {\n\t var rest = this.stream;\n\t this.stream = '';\n\t return rest;\n\t };\n\n\t /**\n\t * Returns the rest of the parse stream.\n\t *\n\t * @returns {string} The contents of the parse stream.\n\t */\n\n\n\t HtmlParser.prototype.rest = function rest() {\n\t return this.stream;\n\t };\n\n\t return HtmlParser;\n\t}();\n\n\texports['default'] = HtmlParser;\n\n\n\tHtmlParser.tokenToString = function (tok) {\n\t return tok.toString();\n\t};\n\n\tHtmlParser.escapeAttributes = function (attrs) {\n\t var escapedAttrs = {};\n\n\t for (var name in attrs) {\n\t if (attrs.hasOwnProperty(name)) {\n\t escapedAttrs[name] = (0, _utils.escapeQuotes)(attrs[name], null);\n\t }\n\t }\n\n\t return escapedAttrs;\n\t};\n\n\tHtmlParser.supports = supports;\n\n\tfor (var key in supports) {\n\t if (supports.hasOwnProperty(key)) {\n\t HtmlParser.browserHasFlaw = HtmlParser.browserHasFlaw || !supports[key] && key;\n\t }\n\t}\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\tvar tagSoup = false;\n\tvar selfClose = false;\n\n\tvar work = window.document.createElement('div');\n\n\ttry {\n\t var html = '<P><I></P></I>';\n\t work.innerHTML = html;\n\t exports.tagSoup = tagSoup = work.innerHTML !== html;\n\t} catch (e) {\n\t exports.tagSoup = tagSoup = false;\n\t}\n\n\ttry {\n\t work.innerHTML = '<P><i><P></P></i></P>';\n\t exports.selfClose = selfClose = work.childNodes.length === 2;\n\t} catch (e) {\n\t exports.selfClose = selfClose = false;\n\t}\n\n\twork = null;\n\n\texports.tagSoup = tagSoup;\n\texports.selfClose = selfClose;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\n\texports.comment = comment;\n\texports.chars = chars;\n\texports.startTag = startTag;\n\texports.atomicTag = atomicTag;\n\texports.endTag = endTag;\n\n\tvar _tokens = __webpack_require__(4);\n\n\t/**\n\t * Regular Expressions for parsing tags and attributes\n\t *\n\t * @type {Object}\n\t */\n\tvar REGEXES = {\n\t startTag: /^<([\\-A-Za-z0-9_]+)((?:\\s+[\\w\\-]+(?:\\s*=?\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*(\\/?)>/,\n\t endTag: /^<\\/([\\-A-Za-z0-9_]+)[^>]*>/,\n\t attr: /(?:([\\-A-Za-z0-9_]+)\\s*=\\s*(?:(?:\"((?:\\\\.|[^\"])*)\")|(?:'((?:\\\\.|[^'])*)')|([^>\\s]+)))|(?:([\\-A-Za-z0-9_]+)(\\s|$)+)/g,\n\t fillAttr: /^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noresize|noshade|nowrap|readonly|selected)$/i\n\t};\n\n\t/**\n\t * Reads a comment token\n\t *\n\t * @param {string} stream The input stream\n\t * @returns {CommentToken}\n\t */\n\tfunction comment(stream) {\n\t var index = stream.indexOf('-->');\n\t if (index >= 0) {\n\t return new _tokens.CommentToken(stream.substr(4, index - 1), index + 3);\n\t }\n\t}\n\n\t/**\n\t * Reads non-tag characters.\n\t *\n\t * @param {string} stream The input stream\n\t * @returns {CharsToken}\n\t */\n\tfunction chars(stream) {\n\t var index = stream.indexOf('<');\n\t return new _tokens.CharsToken(index >= 0 ? index : stream.length);\n\t}\n\n\t/**\n\t * Reads start tag token.\n\t *\n\t * @param {string} stream The input stream\n\t * @returns {StartTagToken}\n\t */\n\tfunction startTag(stream) {\n\t var endTagIndex = stream.indexOf('>');\n\t if (endTagIndex !== -1) {\n\t var match = stream.match(REGEXES.startTag);\n\t if (match) {\n\t var _ret = function () {\n\t var attrs = {};\n\t var booleanAttrs = {};\n\t var rest = match[2];\n\n\t match[2].replace(REGEXES.attr, function (match, name) {\n\t if (!(arguments[2] || arguments[3] || arguments[4] || arguments[5])) {\n\t attrs[name] = '';\n\t } else if (arguments[5]) {\n\t attrs[arguments[5]] = '';\n\t booleanAttrs[arguments[5]] = true;\n\t } else {\n\t attrs[name] = arguments[2] || arguments[3] || arguments[4] || REGEXES.fillAttr.test(name) && name || '';\n\t }\n\n\t rest = rest.replace(match, '');\n\t });\n\n\t return {\n\t v: new _tokens.StartTagToken(match[1], match[0].length, attrs, booleanAttrs, !!match[3], rest.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, ''))\n\t };\n\t }();\n\n\t if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n\t }\n\t }\n\t}\n\n\t/**\n\t * Reads atomic tag token.\n\t *\n\t * @param {string} stream The input stream\n\t * @returns {AtomicTagToken}\n\t */\n\tfunction atomicTag(stream) {\n\t var start = startTag(stream);\n\t if (start) {\n\t var rest = stream.slice(start.length);\n\t // for optimization, we check first just for the end tag\n\t if (rest.match(new RegExp('<\\/\\\\s*' + start.tagName + '\\\\s*>', 'i'))) {\n\t // capturing the content is inefficient, so we do it inside the if\n\t var match = rest.match(new RegExp('([\\\\s\\\\S]*?)<\\/\\\\s*' + start.tagName + '\\\\s*>', 'i'));\n\t if (match) {\n\t return new _tokens.AtomicTagToken(start.tagName, match[0].length + start.length, start.attrs, start.booleanAttrs, match[1]);\n\t }\n\t }\n\t }\n\t}\n\n\t/**\n\t * Reads an end tag token.\n\t *\n\t * @param {string} stream The input stream\n\t * @returns {EndTagToken}\n\t */\n\tfunction endTag(stream) {\n\t var match = stream.match(REGEXES.endTag);\n\t if (match) {\n\t return new _tokens.EndTagToken(match[1], match[0].length);\n\t }\n\t}\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\texports.EndTagToken = exports.AtomicTagToken = exports.StartTagToken = exports.TagToken = exports.CharsToken = exports.CommentToken = exports.Token = undefined;\n\n\tvar _utils = __webpack_require__(5);\n\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\t/**\n\t * Token is a base class for all token types parsed. Note we don't actually\n\t * use intheritance due to IE8's non-existent ES5 support.\n\t */\n\n\tvar Token =\n\t/**\n\t * Constructor.\n\t *\n\t * @param {string} type The type of the Token.\n\t * @param {Number} length The length of the Token text.\n\t */\n\texports.Token = function Token(type, length) {\n\t _classCallCheck(this, Token);\n\n\t this.type = type;\n\t this.length = length;\n\t this.text = '';\n\t};\n\n\t/**\n\t * CommentToken represents comment tags.\n\t */\n\n\n\tvar CommentToken = exports.CommentToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} content The content of the comment\n\t * @param {Number} length The length of the Token text.\n\t */\n\n\t function CommentToken(content, length) {\n\t _classCallCheck(this, CommentToken);\n\n\t this.type = 'comment';\n\t this.length = length || (content ? content.length : 0);\n\t this.text = '';\n\t this.content = content;\n\t }\n\n\t CommentToken.prototype.toString = function toString() {\n\t return '<!--' + this.content;\n\t };\n\n\t return CommentToken;\n\t}();\n\n\t/**\n\t * CharsToken represents non-tag characters.\n\t */\n\n\n\tvar CharsToken = exports.CharsToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {Number} length The length of the Token text.\n\t */\n\n\t function CharsToken(length) {\n\t _classCallCheck(this, CharsToken);\n\n\t this.type = 'chars';\n\t this.length = length;\n\t this.text = '';\n\t }\n\n\t CharsToken.prototype.toString = function toString() {\n\t return this.text;\n\t };\n\n\t return CharsToken;\n\t}();\n\n\t/**\n\t * TagToken is a base class for all tag-based Tokens.\n\t */\n\n\n\tvar TagToken = exports.TagToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} type The type of the token.\n\t * @param {string} tagName The tag name.\n\t * @param {Number} length The length of the Token text.\n\t * @param {Object} attrs The dictionary of attributes and values\n\t * @param {Object} booleanAttrs If an entry has 'true' then the attribute\n\t * is a boolean attribute\n\t */\n\n\t function TagToken(type, tagName, length, attrs, booleanAttrs) {\n\t _classCallCheck(this, TagToken);\n\n\t this.type = type;\n\t this.length = length;\n\t this.text = '';\n\t this.tagName = tagName;\n\t this.attrs = attrs;\n\t this.booleanAttrs = booleanAttrs;\n\t this.unary = false;\n\t this.html5Unary = false;\n\t }\n\n\t /**\n\t * Formats the given token tag.\n\t *\n\t * @param {TagToken} tok The TagToken to format.\n\t * @param {?string} [content=null] The content of the token.\n\t * @returns {string} The formatted tag.\n\t */\n\n\n\t TagToken.formatTag = function formatTag(tok) {\n\t var content = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n\t var str = '<' + tok.tagName;\n\t for (var key in tok.attrs) {\n\t if (tok.attrs.hasOwnProperty(key)) {\n\t str += ' ' + key;\n\n\t var val = tok.attrs[key];\n\t if (typeof tok.booleanAttrs === 'undefined' || typeof tok.booleanAttrs[key] === 'undefined') {\n\t str += '=\"' + (0, _utils.escapeQuotes)(val) + '\"';\n\t }\n\t }\n\t }\n\n\t if (tok.rest) {\n\t str += ' ' + tok.rest;\n\t }\n\n\t if (tok.unary && !tok.html5Unary) {\n\t str += '/>';\n\t } else {\n\t str += '>';\n\t }\n\n\t if (content !== undefined && content !== null) {\n\t str += content + '</' + tok.tagName + '>';\n\t }\n\n\t return str;\n\t };\n\n\t return TagToken;\n\t}();\n\n\t/**\n\t * StartTagToken represents a start token.\n\t */\n\n\n\tvar StartTagToken = exports.StartTagToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} tagName The tag name.\n\t * @param {Number} length The length of the Token text\n\t * @param {Object} attrs The dictionary of attributes and values\n\t * @param {Object} booleanAttrs If an entry has 'true' then the attribute\n\t * is a boolean attribute\n\t * @param {boolean} unary True if the tag is a unary tag\n\t * @param {string} rest The rest of the content.\n\t */\n\n\t function StartTagToken(tagName, length, attrs, booleanAttrs, unary, rest) {\n\t _classCallCheck(this, StartTagToken);\n\n\t this.type = 'startTag';\n\t this.length = length;\n\t this.text = '';\n\t this.tagName = tagName;\n\t this.attrs = attrs;\n\t this.booleanAttrs = booleanAttrs;\n\t this.html5Unary = false;\n\t this.unary = unary;\n\t this.rest = rest;\n\t }\n\n\t StartTagToken.prototype.toString = function toString() {\n\t return TagToken.formatTag(this);\n\t };\n\n\t return StartTagToken;\n\t}();\n\n\t/**\n\t * AtomicTagToken represents an atomic tag.\n\t */\n\n\n\tvar AtomicTagToken = exports.AtomicTagToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} tagName The name of the tag.\n\t * @param {Number} length The length of the tag text.\n\t * @param {Object} attrs The attributes.\n\t * @param {Object} booleanAttrs If an entry has 'true' then the attribute\n\t * is a boolean attribute\n\t * @param {string} content The content of the tag.\n\t */\n\n\t function AtomicTagToken(tagName, length, attrs, booleanAttrs, content) {\n\t _classCallCheck(this, AtomicTagToken);\n\n\t this.type = 'atomicTag';\n\t this.length = length;\n\t this.text = '';\n\t this.tagName = tagName;\n\t this.attrs = attrs;\n\t this.booleanAttrs = booleanAttrs;\n\t this.unary = false;\n\t this.html5Unary = false;\n\t this.content = content;\n\t }\n\n\t AtomicTagToken.prototype.toString = function toString() {\n\t return TagToken.formatTag(this, this.content);\n\t };\n\n\t return AtomicTagToken;\n\t}();\n\n\t/**\n\t * EndTagToken represents an end tag.\n\t */\n\n\n\tvar EndTagToken = exports.EndTagToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} tagName The name of the tag.\n\t * @param {Number} length The length of the tag text.\n\t */\n\n\t function EndTagToken(tagName, length) {\n\t _classCallCheck(this, EndTagToken);\n\n\t this.type = 'endTag';\n\t this.length = length;\n\t this.text = '';\n\t this.tagName = tagName;\n\t }\n\n\t EndTagToken.prototype.toString = function toString() {\n\t return '</' + this.tagName + '>';\n\t };\n\n\t return EndTagToken;\n\t}();\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\texports.escapeQuotes = escapeQuotes;\n\n\t/**\n\t * Escape quotes in the given value.\n\t *\n\t * @param {string} value The value to escape.\n\t * @param {string} [defaultValue=''] The default value to return if value is falsy.\n\t * @returns {string}\n\t */\n\tfunction escapeQuotes(value) {\n\t var defaultValue = arguments.length <= 1 || arguments[1] === undefined ? '' : arguments[1];\n\n\t // There's no lookback in JS, so /(^|[^\\\\])\"/ only matches the first of two `\"`s.\n\t // Instead, just match anything before a double-quote and escape if it's not already escaped.\n\t return !value ? defaultValue : value.replace(/([^\"]*)\"/g, function (_, prefix) {\n\t return (/\\\\/.test(prefix) ? prefix + '\"' : prefix + '\\\\\"'\n\t );\n\t });\n\t}\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\texports['default'] = fixedReadTokenFactory;\n\t/**\n\t * Empty Elements - HTML 4.01\n\t *\n\t * @type {RegExp}\n\t */\n\tvar EMPTY = /^(AREA|BASE|BASEFONT|BR|COL|FRAME|HR|IMG|INPUT|ISINDEX|LINK|META|PARAM|EMBED)$/i;\n\n\t/**\n\t * Elements that you can intentionally leave open (and which close themselves)\n\t *\n\t * @type {RegExp}\n\t */\n\tvar CLOSESELF = /^(COLGROUP|DD|DT|LI|OPTIONS|P|TD|TFOOT|TH|THEAD|TR)$/i;\n\n\t/**\n\t * Corrects a token.\n\t *\n\t * @param {Token} tok The token to correct\n\t * @returns {Token} The corrected token\n\t */\n\tfunction correct(tok) {\n\t if (tok && tok.type === 'startTag') {\n\t tok.unary = EMPTY.test(tok.tagName) || tok.unary;\n\t tok.html5Unary = !/\\/>$/.test(tok.text);\n\t }\n\t return tok;\n\t}\n\n\t/**\n\t * Peeks at the next token in the parser.\n\t *\n\t * @param {HtmlParser} parser The parser\n\t * @param {Function} readTokenImpl The underlying readToken implementation\n\t * @returns {Token} The next token\n\t */\n\tfunction peekToken(parser, readTokenImpl) {\n\t var tmp = parser.stream;\n\t var tok = correct(readTokenImpl());\n\t parser.stream = tmp;\n\t return tok;\n\t}\n\n\t/**\n\t * Closes the last token.\n\t *\n\t * @param {HtmlParser} parser The parser\n\t * @param {Array<Token>} stack The stack\n\t */\n\tfunction closeLast(parser, stack) {\n\t var tok = stack.pop();\n\n\t // prepend close tag to stream.\n\t parser.prepend('</' + tok.tagName + '>');\n\t}\n\n\t/**\n\t * Create a new token stack.\n\t *\n\t * @returns {Array<Token>}\n\t */\n\tfunction newStack() {\n\t var stack = [];\n\n\t stack.last = function () {\n\t return this[this.length - 1];\n\t };\n\n\t stack.lastTagNameEq = function (tagName) {\n\t var last = this.last();\n\t return last && last.tagName && last.tagName.toUpperCase() === tagName.toUpperCase();\n\t };\n\n\t stack.containsTagName = function (tagName) {\n\t for (var i = 0, tok; tok = this[i]; i++) {\n\t if (tok.tagName === tagName) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t };\n\n\t return stack;\n\t}\n\n\t/**\n\t * Return a readToken implementation that fixes input.\n\t *\n\t * @param {HtmlParser} parser The parser\n\t * @param {Object} options Options for fixing\n\t * @param {boolean} options.tagSoupFix True to fix tag soup scenarios\n\t * @param {boolean} options.selfCloseFix True to fix self-closing tags\n\t * @param {Function} readTokenImpl The underlying readToken implementation\n\t * @returns {Function}\n\t */\n\tfunction fixedReadTokenFactory(parser, options, readTokenImpl) {\n\t var stack = newStack();\n\n\t var handlers = {\n\t startTag: function startTag(tok) {\n\t var tagName = tok.tagName;\n\n\t if (tagName.toUpperCase() === 'TR' && stack.lastTagNameEq('TABLE')) {\n\t parser.prepend('<TBODY>');\n\t prepareNextToken();\n\t } else if (options.selfCloseFix && CLOSESELF.test(tagName) && stack.containsTagName(tagName)) {\n\t if (stack.lastTagNameEq(tagName)) {\n\t closeLast(parser, stack);\n\t } else {\n\t parser.prepend('</' + tok.tagName + '>');\n\t prepareNextToken();\n\t }\n\t } else if (!tok.unary) {\n\t stack.push(tok);\n\t }\n\t },\n\t endTag: function endTag(tok) {\n\t var last = stack.last();\n\t if (last) {\n\t if (options.tagSoupFix && !stack.lastTagNameEq(tok.tagName)) {\n\t // cleanup tag soup\n\t closeLast(parser, stack);\n\t } else {\n\t stack.pop();\n\t }\n\t } else if (options.tagSoupFix) {\n\t // cleanup tag soup part 2: skip this token\n\t readTokenImpl();\n\t prepareNextToken();\n\t }\n\t }\n\t };\n\n\t function prepareNextToken() {\n\t var tok = peekToken(parser, readTokenImpl);\n\t if (tok && handlers[tok.type]) {\n\t handlers[tok.type](tok);\n\t }\n\t }\n\n\t return function fixedReadToken() {\n\t prepareNextToken();\n\t return correct(readTokenImpl());\n\t };\n\t}\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/prescribe/dist/prescribe.js\n ** module id = 3\n ** module chunks = 0\n **/","/**\n * Determine if the thing is not undefined and not null.\n *\n * @param {*} thing The thing to test\n * @returns {boolean} True if the thing is not undefined and not null.\n */\nexport function existy(thing) {\n return thing !== void 0 && thing !== null;\n}\n\n/**\n * Is this a function?\n *\n * @param {*} x The variable to test\n * @returns {boolean} True if the variable is a function\n */\nexport function isFunction(x) {\n return 'function' === typeof x;\n}\n\n/**\n * Loop over each item in an array-like value.\n *\n * @param {Array<*>} arr The array to loop over\n * @param {Function} fn The function to call\n * @param {?Object} target The object to bind to the function\n */\nexport function each(arr, fn, target) {\n let i;\n const len = (arr && arr.length) || 0;\n for (i = 0; i < len; i++) {\n fn.call(target, arr[i], i);\n }\n}\n\n/**\n * Loop over each key/value pair in a hash.\n *\n * @param {Object} obj The object\n * @param {Function} fn The function to call\n * @param {?Object} target The object to bind to the function\n */\nexport function eachKey(obj, fn, target) {\n for (let key in obj) {\n if (obj.hasOwnProperty(key)) {\n fn.call(target, key, obj[key]);\n }\n }\n}\n\n/**\n * Set default options where some option was not specified.\n *\n * @param {Object} options The destination\n * @param {Object} _defaults The defaults\n * @returns {Object}\n */\nexport function defaults(options, _defaults) {\n options = options || {};\n eachKey(_defaults, function(key, val) {\n if (!existy(options[key])) {\n options[key] = val;\n }\n });\n return options;\n}\n\n/**\n * Convert value (e.g., a NodeList) to an array.\n *\n * @param {*} obj The object\n * @returns {Array<*>}\n */\nexport function toArray(obj) {\n try {\n return Array.prototype.slice.call(obj);\n } catch (e) {\n const ret = [];\n each(obj, function(val) {\n ret.push(val);\n });\n return ret;\n }\n}\n\n/**\n * Get the last item in an array\n *\n * @param {Array<*>} array The array\n * @returns {*} The last item in the array\n */\nexport function last(array) {\n return array[array.length - 1];\n}\n\n/**\n * Test if token is a script tag.\n *\n * @param {Object} tok The token\n * @param {String} tag The tag name\n * @returns {boolean} True if the token is a script tag\n */\nexport function isTag(tok, tag) {\n return !tok ||\n !(tok.type === 'startTag' || tok.type === 'atomicTag') ||\n !('tagName' in tok) ? !1 : !!~tok.tagName.toLowerCase().indexOf(tag);\n}\n\n/**\n * Test if token is a script tag.\n *\n * @param {Object} tok The token\n * @returns {boolean} True if the token is a script tag\n */\nexport function isScript(tok) {\n return isTag(tok, 'script');\n}\n\n/**\n * Test if token is a style tag.\n *\n * @param {Object} tok The token\n * @returns {boolean} True if the token is a style tag\n */\nexport function isStyle(tok) {\n return isTag(tok, 'style');\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/utils.js\n **/"],"sourceRoot":""}
|
1
|
+
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap c9988e4825e1b6d62704","webpack:///./src/main.js","webpack:///./src/postscribe.js","webpack:///./src/write-stream.js","webpack:///./~/prescribe/dist/prescribe.js","webpack:///./src/utils.js"],"names":["module","exports","postscribe","utils","doNothing","OPTIONS","afterAsync","afterDequeue","afterStreamStart","afterWrite","autoFix","beforeEnqueue","beforeWriteToken","tok","beforeWrite","str","done","error","e","Error","msg","releaseAsync","nextId","queue","active","nextStream","args","shift","options","last","stream","runStream","el","html","id","name","streams","doc","ownerDocument","stash","close","open","write","writeln","join","oldOnError","win","onerror","url","line","apply","isFunction","defaults","test","window","document","getElementById","substr","jquery","cancel","abort","push","WriteStream","DEBUG_CHUNK","BASEATTR","PROXY_STYLE","PROXY_SCRIPT","getData","attr","val","getAttribute","existy","String","setData","value","setAttribute","removeAttribute","root","defaultView","parentWindow","parser","actuals","proxyHistory","proxyRoot","createElement","nodeName","scriptStack","writeQueue","deferredRemote","length","arg","_callFunction","_writeImpl","fn","type","toString","_onScriptStart","call","_onScriptDone","append","script","style","tokens","readToken","isScript","isStyle","_writeStaticTokens","_handleScriptToken","_handleStyleToken","chunk","_buildChunk","actual","proxy","innerHTML","proxyInnerHTML","_walkChunk","actualInnerHTML","raw","len","i","tokenRaw","attrs","tagName","replace","unary","node","stack","isElement","nodeType","isProxy","parentIsProxyOf","parentNode","appendChild","unshift","toArray","childNodes","remainder","clear","src","SRC","_writeScriptToken","TYPE","_writeStyleToken","_buildStyle","_insertCursor","content","styleSheet","sheet","cssText","createTextNode","eachKey","which","cursor","replaceChild","outerWrites","_buildScript","asyncRelease","_shouldRelease","_scriptLoadHandler","text","cleanup","onload","onreadystatechange","success","failure","err","reattachEventListener","evt","handler","_onload","Array","prototype","slice","arguments","_onerror","readyState","hasAttribute","each","isTag","thing","x","arr","target","obj","key","hasOwnProperty","_defaults","ret","array","tag","toLowerCase","indexOf"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;ACtCA;;;;;;AAEAA,QAAOC,OAAP,2B;;;;;;;;;;;;sBCmJwBC,U;;AArJxB;;;;AACA;;KAAYC,K;;;;;;AAEZ;;;AAGA,UAASC,SAAT,GAAqB,CACpB;;AAED;;;;;AAKA,KAAMC,UAAU;AACd;;;A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A;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,QAAQ;AACtB;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAAiD;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,SAAQ;AACR,OAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAgB;AAChB;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAgB;AAChB;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAgB,OAAO;AACvB;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAgB,OAAO;AACvB;;;AAGA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;;AAEA;AACA;AACA;AACA,GAAE;AACF;AACA;;AAEA;;AAEA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;;AAEA,sGAAqG,mBAAmB,EAAE,mBAAmB,8HAA8H;;AAE3Q;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY;AACZ;AACA;AACA,aAAY;AACZ;AACA;;AAEA;AACA,WAAU;;AAEV;AACA;AACA;AACA,SAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,mDAAkD,0CAA0C,0DAA0D,EAAE;;AAExJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAY,OAAO;AACnB,aAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,SAAS;AACvB,eAAc,QAAQ;AACtB,iBAAgB,OAAO;AACvB;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAM;AACN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAE;;AAEF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB;AACA,eAAc,QAAQ;AACtB,eAAc,OAAO;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB;AACA,eAAc,OAAO;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,OAAO;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,GAAE;;AAEF,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAY,OAAO;AACnB,aAAY,OAAO;AACnB,eAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;;AAEA,QAAO;AACP;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW;AACX;AACA;;AAEA;AACA;AACA;AACA,YAAW;AACX;AACA;;AAEA;AACA;AACA;AACA,aAAY,MAAM;AAClB,eAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,WAAW;AACvB,aAAY,SAAS;AACrB,eAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAY,WAAW;AACvB,aAAY,aAAa;AACzB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0BAAyB,eAAe;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,aAAY,WAAW;AACvB,aAAY,OAAO;AACnB,aAAY,QAAQ;AACpB,aAAY,QAAQ;AACpB,aAAY,SAAS;AACrB,eAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,SAAQ;AACR;AACA;AACA,OAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV;AACA;AACA,SAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAC;AACD,E;;;;;;;;;;;;SC95BgBS,M,GAAAA,M;SAUApB,U,GAAAA,U;SAWA8H,I,GAAAA,I;SAeA3B,O,GAAAA,O;SAeAlG,Q,GAAAA,Q;SAgBAkF,O,GAAAA,O;SAkBAzG,I,GAAAA,I;SAWAqJ,K,GAAAA,K;SAYA1E,Q,GAAAA,Q;SAUAC,O,GAAAA,O;AA5HhB;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CAAsB3E,IAAtB,CAA2BsF,GAA3B,CAAP;AACD,IAFD,CAEE,OAAOrK,CAAP,EAAU;AAAA;AACV,WAAMyK,MAAM,EAAZ;AACAV,YAAKM,GAAL,EAAU,UAASlH,GAAT,EAAc;AACtBsH,aAAI9H,IAAJ,CAASQ,GAAT;AACD,QAFD;AAGA;AAAA,YAAOsH;AAAP;AALU;;AAAA;AAMX;AACF;;AAED;;;;;;AAMO,UAAS9J,IAAT,CAAc+J,KAAd,EAAqB;AAC1B,UAAOA,MAAMA,MAAMnG,MAAN,GAAe,CAArB,CAAP;AACD;;AAED;;;;;;;AAOO,UAASyF,KAAT,CAAerK,GAAf,EAAoBgL,GAApB,EAAyB;AAC9B,UAAO,CAAChL,GAAD,IACL,EAAEA,IAAIiF,IAAJ,KAAa,UAAb,IAA2BjF,IAAIiF,IAAJ,KAAa,WAA1C,CADK,IAEL,EAAE,aAAajF,GAAf,CAFK,GAEiB,CAAC,CAFlB,GAEsB,CAAC,CAAC,CAACA,IAAI6G,OAAJ,CAAYoE,WAAZ,GAA0BC,OAA1B,CAAkCF,GAAlC,CAFhC;AAGD;;AAED;;;;;;AAMO,UAASrF,QAAT,CAAkB3F,GAAlB,EAAuB;AAC5B,UAAOqK,MAAMrK,GAAN,EAAW,QAAX,CAAP;AACD;;AAED;;;;;;AAMO,UAAS4F,OAAT,CAAiB5F,GAAjB,EAAsB;AAC3B,UAAOqK,MAAMrK,GAAN,EAAW,OAAX,CAAP;AACD,E","file":"postscribe.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"postscribe\"] = factory();\n\telse\n\t\troot[\"postscribe\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap c9988e4825e1b6d62704","import postscribe from './postscribe';\n\nmodule.exports = postscribe;\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js","import WriteStream from './write-stream';\nimport * as utils from './utils';\n\n/**\n * A function that intentionally does nothing.\n */\nfunction doNothing() {\n}\n\n/**\n * Available options and defaults.\n *\n * @type {Object}\n */\nconst OPTIONS = {\n /**\n * Called when an async script has loaded.\n */\n afterAsync: doNothing,\n\n /**\n * Called immediately before removing from the write queue.\n */\n afterDequeue: doNothing,\n\n /**\n * Called sync after a stream's first thread release.\n */\n afterStreamStart: doNothing,\n\n /**\n * Called after writing buffered document.write calls.\n */\n afterWrite: doNothing,\n\n /**\n * Allows disabling the autoFix feature of prescribe\n */\n autoFix: true,\n\n /**\n * Called immediately before adding to the write queue.\n */\n beforeEnqueue: doNothing,\n\n /**\n * Called before writing a token.\n *\n * @param {Object} tok The token\n */\n beforeWriteToken: tok => tok,\n\n /**\n * Called before writing buffered document.write calls.\n *\n * @param {String} str The string\n */\n beforeWrite: str => str,\n\n /**\n * Called when evaluation is finished.\n */\n done: doNothing,\n\n /**\n * Called when a write results in an error.\n *\n * @param {Error} e The error\n */\n error(e) { throw new Error(e.msg); },\n\n /**\n * Whether to let scripts w/ async attribute set fall out of the queue.\n */\n releaseAsync: false\n};\n\nlet nextId = 0;\nlet queue = [];\nlet active = null;\n\nfunction nextStream() {\n const args = queue.shift();\n if (args) {\n const options = utils.last(args);\n\n options.afterDequeue();\n args.stream = runStream(...args);\n options.afterStreamStart();\n }\n}\n\nfunction runStream(el, html, options) {\n active = new WriteStream(el, options);\n\n // Identify this stream.\n active.id = nextId++;\n active.name = options.name || active.id;\n postscribe.streams[active.name] = active;\n\n // Override document.write.\n const doc = el.ownerDocument;\n\n const stash = {\n close: doc.close,\n open: doc.open,\n write: doc.write,\n writeln: doc.writeln\n };\n\n function write(str) {\n str = options.beforeWrite(str);\n active.write(str);\n options.afterWrite(str);\n }\n\n Object.assign(doc, {\n close: doNothing,\n open: doNothing,\n write: (...str) => write(str.join('')),\n writeln: (...str) => write(str.join('') + '\\n')\n });\n\n // Override window.onerror\n const oldOnError = active.win.onerror || doNothing;\n\n // This works together with the try/catch around WriteStream::insertScript\n // In modern browsers, exceptions in tag scripts go directly to top level\n active.win.onerror = (msg, url, line) => {\n options.error({msg: `${msg} - ${url}: ${line}`});\n oldOnError.apply(active.win, [msg, url, line]);\n };\n\n // Write to the stream\n active.write(html, () => {\n // restore document.write\n Object.assign(doc, stash);\n\n // restore window.onerror\n active.win.onerror = oldOnError;\n\n options.done();\n active = null;\n nextStream();\n });\n\n return active;\n}\n\nexport default function postscribe(el, html, options) {\n if (utils.isFunction(options)) {\n options = {done: options};\n } else if (options === 'clear') {\n queue = [];\n active = null;\n nextId = 0;\n return;\n }\n\n options = utils.defaults(options, OPTIONS);\n\n // id selector\n if ((/^#/).test(el)) {\n el = window.document.getElementById(el.substr(1));\n } else {\n el = el.jquery ? el[0] : el;\n }\n\n const args = [el, html, options];\n\n el.postscribe = {\n cancel: () => {\n if (args.stream) {\n args.stream.abort();\n } else {\n args[1] = doNothing;\n }\n }\n };\n\n options.beforeEnqueue(args);\n queue.push(args);\n\n if (!active) {\n nextStream();\n }\n\n return el.postscribe;\n}\n\nObject.assign(postscribe, {\n // Streams by name.\n streams: {},\n // Queue of streams.\n queue,\n // Expose internal classes.\n WriteStream\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/postscribe.js","import HtmlParser from 'prescribe';\nimport * as utils from './utils';\n\n/**\n * Turn on to debug how each chunk affected the DOM.\n * @type {boolean}\n */\nconst DEBUG_CHUNK = false;\n\n/**\n * Prefix for data attributes on DOM elements.\n * @type {string}\n */\nconst BASEATTR = 'data-ps-';\n\n/**\n * ID for the style proxy\n * @type {string}\n */\nconst PROXY_STYLE = 'ps-style';\n\n/**\n * ID for the script proxy\n * @type {string}\n */\nconst PROXY_SCRIPT = 'ps-script';\n\n/**\n * Get data attributes\n *\n * @param {Object} el The DOM element.\n * @param {String} name The attribute name.\n * @returns {String}\n */\nfunction getData(el, name) {\n const attr = BASEATTR + name;\n\n const val = el.getAttribute(attr);\n\n // IE 8 returns a number if it's a number\n return !utils.existy(val) ? val : String(val);\n}\n\n/**\n * Set data attributes\n *\n * @param {Object} el The DOM element.\n * @param {String} name The attribute name.\n * @param {null|*} value The attribute value.\n */\nfunction setData(el, name, value = null) {\n const attr = BASEATTR + name;\n\n if (utils.existy(value) && value !== '') {\n el.setAttribute(attr, value);\n } else {\n el.removeAttribute(attr);\n }\n}\n\n/**\n * Stream static html to an element, where \"static html\" denotes \"html\n * without scripts\".\n *\n * This class maintains a *history of writes devoid of any attributes* or\n * \"proxy history\".\n *\n * Injecting the proxy history into a temporary div has no side-effects,\n * other than to create proxy elements for previously written elements.\n *\n * Given the `staticHtml` of a new write, a `tempDiv`'s innerHTML is set to\n * `proxy_history + staticHtml`.\n * The *structure* of `tempDiv`'s contents, (i.e., the placement of new nodes\n * beside or inside of proxy elements), reflects the DOM structure that would\n * have resulted if all writes had been squashed into a single write.\n *\n * For each descendent `node` of `tempDiv` whose parentNode is a *proxy*,\n * `node` is appended to the corresponding *real* element within the DOM.\n *\n * Proxy elements are mapped to *actual* elements in the DOM by injecting a\n * `data-id` attribute into each start tag in `staticHtml`.\n *\n */\nexport default class WriteStream {\n /**\n * Constructor.\n *\n * @param {Object} root The root element\n * @param {?Object} options The options\n */\n constructor(root, options = {}) {\n this.root = root;\n this.options = options;\n this.doc = root.ownerDocument;\n this.win = this.doc.defaultView || this.doc.parentWindow;\n this.parser = new HtmlParser('', {autoFix: options.autoFix});\n\n // Actual elements by id.\n this.actuals = [root];\n\n // Embodies the \"structure\" of what's been written so far,\n // devoid of attributes.\n this.proxyHistory = '';\n\n // Create a proxy of the root element.\n this.proxyRoot = this.doc.createElement(root.nodeName);\n\n this.scriptStack = [];\n this.writeQueue = [];\n\n setData(this.proxyRoot, 'proxyof', 0);\n }\n\n /**\n * Writes the given strings.\n *\n * @param {...String} str The strings to write\n */\n write(...str) {\n this.writeQueue.push(...str);\n\n // Process writes\n // When new script gets pushed or pending this will stop\n // because new writeQueue gets pushed\n while (!this.deferredRemote && this.writeQueue.length) {\n const arg = this.writeQueue.shift();\n\n if (utils.isFunction(arg)) {\n this._callFunction(arg);\n } else {\n this._writeImpl(arg);\n }\n }\n }\n\n /**\n * Calls the given function.\n *\n * @param {Function} fn The function to call\n * @private\n */\n _callFunction(fn) {\n const tok = {type: 'function', value: fn.name || fn.toString()};\n this._onScriptStart(tok);\n fn.call(this.win, this.doc);\n this._onScriptDone(tok);\n }\n\n /**\n * The write implementation\n *\n * @param {String} html The HTML to write.\n * @private\n */\n _writeImpl(html) {\n this.parser.append(html);\n\n let tok;\n let script;\n let style;\n const tokens = [];\n\n // stop if we see a script token\n while ((tok = this.parser.readToken()) &&\n !(script = utils.isScript(tok)) &&\n !(style = utils.isStyle(tok))) {\n tok = this.options.beforeWriteToken(tok);\n\n if (tok) {\n tokens.push(tok);\n }\n }\n\n if (tokens.length > 0) {\n this._writeStaticTokens(tokens);\n }\n\n if (script) {\n this._handleScriptToken(tok);\n }\n\n if (style) {\n this._handleStyleToken(tok);\n }\n }\n\n /**\n * Write contiguous non-script tokens (a chunk)\n *\n * @param {Array<Object>} tokens The tokens\n * @returns {{tokens, raw, actual, proxy}|null}\n * @private\n */\n _writeStaticTokens(tokens) {\n const chunk = this._buildChunk(tokens);\n\n if (!chunk.actual) {\n // e.g., no tokens, or a noscript that got ignored\n return null;\n }\n\n chunk.html = this.proxyHistory + chunk.actual;\n this.proxyHistory += chunk.proxy;\n this.proxyRoot.innerHTML = chunk.html;\n\n if (DEBUG_CHUNK) {\n chunk.proxyInnerHTML = this.proxyRoot.innerHTML;\n }\n\n this._walkChunk();\n\n if (DEBUG_CHUNK) {\n chunk.actualInnerHTML = this.root.innerHTML;\n }\n\n return chunk;\n }\n\n /**\n * Build a chunk.\n *\n * @param {Array<Object>} tokens The tokens to use.\n * @returns {{tokens: *, raw: string, actual: string, proxy: string}}\n * @private\n */\n _buildChunk(tokens) {\n let nextId = this.actuals.length;\n\n // The raw html of this chunk.\n const raw = [];\n\n // The html to create the nodes in the tokens (with id's injected).\n const actual = [];\n\n // Html that can later be used to proxy the nodes in the tokens.\n const proxy = [];\n\n const len = tokens.length;\n for (let i = 0; i < len; i++) {\n const tok = tokens[i];\n const tokenRaw = tok.toString();\n\n raw.push(tokenRaw);\n\n if (tok.attrs) { // tok.attrs <==> startTag or atomicTag or cursor\n // Ignore noscript tags. They are atomic, so we don't have to worry about children.\n if (!(/^noscript$/i).test(tok.tagName)) {\n const id = nextId++;\n\n // Actual: inject id attribute: replace '>' at end of start tag with id attribute + '>'\n actual.push(tokenRaw.replace(/(\\/?>)/, ` ${BASEATTR}id=${id} $1`));\n\n // Don't proxy scripts: they have no bearing on DOM structure.\n if (tok.attrs.id !== PROXY_SCRIPT && tok.attrs.id !== PROXY_STYLE) {\n // Proxy: strip all attributes and inject proxyof attribute\n proxy.push(\n // ignore atomic tags (e.g., style): they have no \"structural\" effect\n tok.type === 'atomicTag' ? '' :\n `<${tok.tagName} ${BASEATTR}proxyof=${id}` + (tok.unary ? ' />' : '>')\n );\n }\n }\n } else {\n // Visit any other type of token\n // Actual: append.\n actual.push(tokenRaw);\n\n // Proxy: append endTags. Ignore everything else.\n proxy.push(tok.type === 'endTag' ? tokenRaw : '');\n }\n }\n\n return {\n tokens,\n raw: raw.join(''),\n actual: actual.join(''),\n proxy: proxy.join('')\n };\n }\n\n /**\n * Walk the chunks.\n *\n * @private\n */\n _walkChunk() {\n let node;\n const stack = [this.proxyRoot];\n\n // use shift/unshift so that children are walked in document order\n while (utils.existy(node = stack.shift())) {\n const isElement = node.nodeType === 1;\n const isProxy = isElement && getData(node, 'proxyof');\n\n // Ignore proxies\n if (!isProxy) {\n if (isElement) {\n // New actual element: register it and remove the the id attr.\n this.actuals[getData(node, 'id')] = node;\n setData(node, 'id');\n }\n\n // Is node's parent a proxy?\n const parentIsProxyOf = node.parentNode &&\n getData(node.parentNode, 'proxyof');\n if (parentIsProxyOf) {\n // Move node under actual parent.\n this.actuals[parentIsProxyOf].appendChild(node);\n }\n }\n\n // prepend childNodes to stack\n stack.unshift.apply(stack, utils.toArray(node.childNodes));\n }\n }\n\n /**\n * Handles Script tokens\n *\n * @param {Object} tok The token\n */\n _handleScriptToken(tok) {\n const remainder = this.parser.clear();\n\n if (remainder) {\n // Write remainder immediately behind this script.\n this.writeQueue.unshift(remainder);\n }\n\n tok.src = tok.attrs.src || tok.attrs.SRC;\n\n tok = this.options.beforeWriteToken(tok);\n if (!tok) {\n // User has removed this token\n return;\n }\n\n if (tok.src && this.scriptStack.length) {\n // Defer this script until scriptStack is empty.\n // Assumption 1: This script will not start executing until\n // scriptStack is empty.\n this.deferredRemote = tok;\n } else {\n this._onScriptStart(tok);\n }\n\n // Put the script node in the DOM.\n this._writeScriptToken(tok, () => {\n this._onScriptDone(tok);\n });\n }\n\n /**\n * Handles style tokens\n *\n * @param {Object} tok The token\n */\n _handleStyleToken(tok) {\n const remainder = this.parser.clear();\n\n if (remainder) {\n // Write remainder immediately behind this style.\n this.writeQueue.unshift(remainder);\n }\n\n tok.type = tok.attrs.type || tok.attrs.TYPE || 'text/css';\n\n tok = this.options.beforeWriteToken(tok);\n\n if (tok) {\n // Put the style node in the DOM.\n this._writeStyleToken(tok);\n }\n\n if (remainder) {\n this.write();\n }\n }\n\n /**\n * Build a style and insert it into the DOM.\n *\n * @param {Object} tok The token\n */\n _writeStyleToken(tok) {\n const el = this._buildStyle(tok);\n\n this._insertCursor(el, PROXY_STYLE);\n\n // Set content\n if (tok.content) {\n if (el.styleSheet && !el.sheet) {\n el.styleSheet.cssText = tok.content;\n } else {\n el.appendChild(this.doc.createTextNode(tok.content));\n }\n }\n }\n\n /**\n * Build a style element from an atomic style token.\n *\n * @param {Object} tok The token\n * @returns {Element}\n */\n _buildStyle(tok) {\n const el = this.doc.createElement(tok.tagName);\n\n el.setAttribute('type', tok.type);\n\n // Set attributes\n utils.eachKey(tok.attrs, (name, value) => {\n el.setAttribute(name, value);\n });\n\n return el;\n }\n\n /**\n * Append a span to the stream. That span will act as a cursor\n * (i.e. insertion point) for the element.\n *\n * @param {Object} el The element\n * @param {string} which The type of proxy element\n */\n _insertCursor(el, which) {\n this._writeImpl(`<span id=\"${which}\"/>`);\n\n const cursor = this.doc.getElementById(which);\n\n if (cursor) {\n cursor.parentNode.replaceChild(el, cursor);\n }\n }\n\n /**\n * Called when a script is started.\n *\n * @param {Object} tok The token\n * @private\n */\n _onScriptStart(tok) {\n tok.outerWrites = this.writeQueue;\n this.writeQueue = [];\n this.scriptStack.unshift(tok);\n }\n\n /**\n * Called when a script is done.\n *\n * @param {Object} tok The token\n * @private\n */\n _onScriptDone(tok) {\n // Pop script and check nesting.\n if (tok !== this.scriptStack[0]) {\n this.options.error({msg: 'Bad script nesting or script finished twice'});\n return;\n }\n\n this.scriptStack.shift();\n\n // Append outer writes to queue and process them.\n this.write.apply(this, tok.outerWrites);\n\n // Check for pending remote\n\n // Assumption 2: if remote_script1 writes remote_script2 then\n // the we notice remote_script1 finishes before remote_script2 starts.\n // I think this is equivalent to assumption 1\n if (!this.scriptStack.length && this.deferredRemote) {\n this._onScriptStart(this.deferredRemote);\n this.deferredRemote = null;\n }\n }\n\n /**\n * Build a script and insert it into the DOM.\n * Done is called once script has executed.\n *\n * @param {Object} tok The token\n * @param {Function} done The callback when complete\n */\n _writeScriptToken(tok, done) {\n const el = this._buildScript(tok);\n const asyncRelease = this._shouldRelease(el);\n const afterAsync = this.options.afterAsync;\n\n if (tok.src) {\n // Fix for attribute \"SRC\" (capitalized). IE does not recognize it.\n el.src = tok.src;\n this._scriptLoadHandler(el, !asyncRelease ? () => {\n done();\n afterAsync();\n } : afterAsync);\n }\n\n try {\n this._insertCursor(el, PROXY_SCRIPT);\n if (!el.src || asyncRelease) {\n done();\n }\n } catch (e) {\n this.options.error(e);\n done();\n }\n }\n\n /**\n * Build a script element from an atomic script token.\n *\n * @param {Object} tok The token\n * @returns {Element}\n */\n _buildScript(tok) {\n const el = this.doc.createElement(tok.tagName);\n\n // Set attributes\n utils.eachKey(tok.attrs, (name, value) => {\n el.setAttribute(name, value);\n });\n\n // Set content\n if (tok.content) {\n el.text = tok.content;\n }\n\n return el;\n }\n\n /**\n * Setup the script load handler on an element.\n *\n * @param {Object} el The element\n * @param {Function} done The callback\n * @private\n */\n _scriptLoadHandler(el, done) {\n function cleanup() {\n el = el.onload = el.onreadystatechange = el.onerror = null;\n }\n\n const error = this.options.error;\n\n function success() {\n cleanup();\n if (done != null) {\n done();\n }\n done = null;\n }\n\n function failure(err) {\n cleanup();\n error(err);\n if (done != null) {\n done();\n }\n done = null;\n }\n\n function reattachEventListener(el, evt) {\n const handler = el[`on${evt}`];\n if (handler != null) {\n el[`_on${evt}`] = handler;\n }\n }\n\n reattachEventListener(el, 'load');\n reattachEventListener(el, 'error');\n\n Object.assign(el, {\n onload() {\n if (el._onload) {\n try {\n el._onload.apply(this, Array.prototype.slice.call(arguments, 0));\n } catch (err) {\n failure({msg: `onload handler failed ${err} @ ${el.src}`});\n }\n }\n success();\n },\n\n onerror() {\n if (el._onerror) {\n try {\n el._onerror.apply(this, Array.prototype.slice.call(arguments, 0));\n } catch (err) {\n failure({msg: `onerror handler failed ${err} @ ${el.src}`});\n return;\n }\n }\n failure({msg: `remote script failed ${el.src}`});\n },\n\n onreadystatechange() {\n if (/^(loaded|complete)$/.test(el.readyState)) {\n success();\n }\n }\n });\n }\n\n /**\n * Determines whether to release.\n *\n * @param {Object} el The element\n * @returns {boolean}\n * @private\n */\n _shouldRelease(el) {\n const isScript = (/^script$/i).test(el.nodeName);\n return !isScript || !!(this.options.releaseAsync && el.src && el.hasAttribute('async'));\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/write-stream.js","/**\n * @file prescribe\n * @description Tiny, forgiving HTML parser\n * @version vundefined\n * @see {@link https://github.com/krux/prescribe/}\n * @license MIT\n * @author Derek Brans\n * @copyright 2016 Krux Digital, Inc\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Prescribe\"] = factory();\n\telse\n\t\troot[\"Prescribe\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar _HtmlParser = __webpack_require__(1);\n\n\tvar _HtmlParser2 = _interopRequireDefault(_HtmlParser);\n\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n\tmodule.exports = _HtmlParser2['default'];\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\n\tvar _supports = __webpack_require__(2);\n\n\tvar supports = _interopRequireWildcard(_supports);\n\n\tvar _streamReaders = __webpack_require__(3);\n\n\tvar streamReaders = _interopRequireWildcard(_streamReaders);\n\n\tvar _fixedReadTokenFactory = __webpack_require__(6);\n\n\tvar _fixedReadTokenFactory2 = _interopRequireDefault(_fixedReadTokenFactory);\n\n\tvar _utils = __webpack_require__(5);\n\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n\tfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }\n\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\t/**\n\t * Detection regular expressions.\n\t *\n\t * Order of detection matters: detection of one can only\n\t * succeed if detection of previous didn't\n\n\t * @type {Object}\n\t */\n\tvar detect = {\n\t comment: /^<!--/,\n\t endTag: /^<\\//,\n\t atomicTag: /^<\\s*(script|style|noscript|iframe|textarea)[\\s\\/>]/i,\n\t startTag: /^</,\n\t chars: /^[^<]/\n\t};\n\n\t/**\n\t * HtmlParser provides the capability to parse HTML and return tokens\n\t * representing the tags and content.\n\t */\n\n\tvar HtmlParser = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} stream The initial parse stream contents.\n\t * @param {Object} options The options\n\t * @param {boolean} options.autoFix Set to true to automatically fix errors\n\t */\n\t function HtmlParser() {\n\t var _this = this;\n\n\t var stream = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\t var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t _classCallCheck(this, HtmlParser);\n\n\t this.stream = stream;\n\n\t var fix = false;\n\t var fixedTokenOptions = {};\n\n\t for (var key in supports) {\n\t if (supports.hasOwnProperty(key)) {\n\t if (options.autoFix) {\n\t fixedTokenOptions[key + 'Fix'] = true; // !supports[key];\n\t }\n\t fix = fix || fixedTokenOptions[key + 'Fix'];\n\t }\n\t }\n\n\t if (fix) {\n\t this._readToken = (0, _fixedReadTokenFactory2['default'])(this, fixedTokenOptions, function () {\n\t return _this._readTokenImpl();\n\t });\n\t this._peekToken = (0, _fixedReadTokenFactory2['default'])(this, fixedTokenOptions, function () {\n\t return _this._peekTokenImpl();\n\t });\n\t } else {\n\t this._readToken = this._readTokenImpl;\n\t this._peekToken = this._peekTokenImpl;\n\t }\n\t }\n\n\t /**\n\t * Appends the given string to the parse stream.\n\t *\n\t * @param {string} str The string to append\n\t */\n\n\n\t HtmlParser.prototype.append = function append(str) {\n\t this.stream += str;\n\t };\n\n\t /**\n\t * Prepends the given string to the parse stream.\n\t *\n\t * @param {string} str The string to prepend\n\t */\n\n\n\t HtmlParser.prototype.prepend = function prepend(str) {\n\t this.stream = str + this.stream;\n\t };\n\n\t /**\n\t * The implementation of the token reading.\n\t *\n\t * @private\n\t * @returns {?Token}\n\t */\n\n\n\t HtmlParser.prototype._readTokenImpl = function _readTokenImpl() {\n\t var token = this._peekTokenImpl();\n\t if (token) {\n\t this.stream = this.stream.slice(token.length);\n\t return token;\n\t }\n\t };\n\n\t /**\n\t * The implementation of token peeking.\n\t *\n\t * @returns {?Token}\n\t */\n\n\n\t HtmlParser.prototype._peekTokenImpl = function _peekTokenImpl() {\n\t for (var type in detect) {\n\t if (detect.hasOwnProperty(type)) {\n\t if (detect[type].test(this.stream)) {\n\t var token = streamReaders[type](this.stream);\n\n\t if (token) {\n\t if (token.type === 'startTag' && /script|style/i.test(token.tagName)) {\n\t return null;\n\t } else {\n\t token.text = this.stream.substr(0, token.length);\n\t return token;\n\t }\n\t }\n\t }\n\t }\n\t }\n\t };\n\n\t /**\n\t * The public token peeking interface. Delegates to the basic token peeking\n\t * or a version that performs fixups depending on the `autoFix` setting in\n\t * options.\n\t *\n\t * @returns {object}\n\t */\n\n\n\t HtmlParser.prototype.peekToken = function peekToken() {\n\t return this._peekToken();\n\t };\n\n\t /**\n\t * The public token reading interface. Delegates to the basic token reading\n\t * or a version that performs fixups depending on the `autoFix` setting in\n\t * options.\n\t *\n\t * @returns {object}\n\t */\n\n\n\t HtmlParser.prototype.readToken = function readToken() {\n\t return this._readToken();\n\t };\n\n\t /**\n\t * Read tokens and hand to the given handlers.\n\t *\n\t * @param {Object} handlers The handlers to use for the different tokens.\n\t */\n\n\n\t HtmlParser.prototype.readTokens = function readTokens(handlers) {\n\t var tok = void 0;\n\t while (tok = this.readToken()) {\n\t // continue until we get an explicit \"false\" return\n\t if (handlers[tok.type] && handlers[tok.type](tok) === false) {\n\t return;\n\t }\n\t }\n\t };\n\n\t /**\n\t * Clears the parse stream.\n\t *\n\t * @returns {string} The contents of the parse stream before clearing.\n\t */\n\n\n\t HtmlParser.prototype.clear = function clear() {\n\t var rest = this.stream;\n\t this.stream = '';\n\t return rest;\n\t };\n\n\t /**\n\t * Returns the rest of the parse stream.\n\t *\n\t * @returns {string} The contents of the parse stream.\n\t */\n\n\n\t HtmlParser.prototype.rest = function rest() {\n\t return this.stream;\n\t };\n\n\t return HtmlParser;\n\t}();\n\n\texports['default'] = HtmlParser;\n\n\n\tHtmlParser.tokenToString = function (tok) {\n\t return tok.toString();\n\t};\n\n\tHtmlParser.escapeAttributes = function (attrs) {\n\t var escapedAttrs = {};\n\n\t for (var name in attrs) {\n\t if (attrs.hasOwnProperty(name)) {\n\t escapedAttrs[name] = (0, _utils.escapeQuotes)(attrs[name], null);\n\t }\n\t }\n\n\t return escapedAttrs;\n\t};\n\n\tHtmlParser.supports = supports;\n\n\tfor (var key in supports) {\n\t if (supports.hasOwnProperty(key)) {\n\t HtmlParser.browserHasFlaw = HtmlParser.browserHasFlaw || !supports[key] && key;\n\t }\n\t}\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\tvar tagSoup = false;\n\tvar selfClose = false;\n\n\tvar work = window.document.createElement('div');\n\n\ttry {\n\t var html = '<P><I></P></I>';\n\t work.innerHTML = html;\n\t exports.tagSoup = tagSoup = work.innerHTML !== html;\n\t} catch (e) {\n\t exports.tagSoup = tagSoup = false;\n\t}\n\n\ttry {\n\t work.innerHTML = '<P><i><P></P></i></P>';\n\t exports.selfClose = selfClose = work.childNodes.length === 2;\n\t} catch (e) {\n\t exports.selfClose = selfClose = false;\n\t}\n\n\twork = null;\n\n\texports.tagSoup = tagSoup;\n\texports.selfClose = selfClose;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n\texports.comment = comment;\n\texports.chars = chars;\n\texports.startTag = startTag;\n\texports.atomicTag = atomicTag;\n\texports.endTag = endTag;\n\n\tvar _tokens = __webpack_require__(4);\n\n\t/**\n\t * Regular Expressions for parsing tags and attributes\n\t *\n\t * @type {Object}\n\t */\n\tvar REGEXES = {\n\t startTag: /^<([\\-A-Za-z0-9_]+)((?:\\s+[\\w\\-]+(?:\\s*=?\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*(\\/?)>/,\n\t endTag: /^<\\/([\\-A-Za-z0-9_]+)[^>]*>/,\n\t attr: /(?:([\\-A-Za-z0-9_]+)\\s*=\\s*(?:(?:\"((?:\\\\.|[^\"])*)\")|(?:'((?:\\\\.|[^'])*)')|([^>\\s]+)))|(?:([\\-A-Za-z0-9_]+)(\\s|$)+)/g,\n\t fillAttr: /^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noresize|noshade|nowrap|readonly|selected)$/i\n\t};\n\n\t/**\n\t * Reads a comment token\n\t *\n\t * @param {string} stream The input stream\n\t * @returns {CommentToken}\n\t */\n\tfunction comment(stream) {\n\t var index = stream.indexOf('-->');\n\t if (index >= 0) {\n\t return new _tokens.CommentToken(stream.substr(4, index - 1), index + 3);\n\t }\n\t}\n\n\t/**\n\t * Reads non-tag characters.\n\t *\n\t * @param {string} stream The input stream\n\t * @returns {CharsToken}\n\t */\n\tfunction chars(stream) {\n\t var index = stream.indexOf('<');\n\t return new _tokens.CharsToken(index >= 0 ? index : stream.length);\n\t}\n\n\t/**\n\t * Reads start tag token.\n\t *\n\t * @param {string} stream The input stream\n\t * @returns {StartTagToken}\n\t */\n\tfunction startTag(stream) {\n\t var endTagIndex = stream.indexOf('>');\n\t if (endTagIndex !== -1) {\n\t var match = stream.match(REGEXES.startTag);\n\t if (match) {\n\t var _ret = function () {\n\t var attrs = {};\n\t var booleanAttrs = {};\n\t var rest = match[2];\n\n\t match[2].replace(REGEXES.attr, function (match, name) {\n\t if (!(arguments[2] || arguments[3] || arguments[4] || arguments[5])) {\n\t attrs[name] = '';\n\t } else if (arguments[5]) {\n\t attrs[arguments[5]] = '';\n\t booleanAttrs[arguments[5]] = true;\n\t } else {\n\t attrs[name] = arguments[2] || arguments[3] || arguments[4] || REGEXES.fillAttr.test(name) && name || '';\n\t }\n\n\t rest = rest.replace(match, '');\n\t });\n\n\t return {\n\t v: new _tokens.StartTagToken(match[1], match[0].length, attrs, booleanAttrs, !!match[3], rest.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, ''))\n\t };\n\t }();\n\n\t if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n\t }\n\t }\n\t}\n\n\t/**\n\t * Reads atomic tag token.\n\t *\n\t * @param {string} stream The input stream\n\t * @returns {AtomicTagToken}\n\t */\n\tfunction atomicTag(stream) {\n\t var start = startTag(stream);\n\t if (start) {\n\t var rest = stream.slice(start.length);\n\t // for optimization, we check first just for the end tag\n\t if (rest.match(new RegExp('<\\/\\\\s*' + start.tagName + '\\\\s*>', 'i'))) {\n\t // capturing the content is inefficient, so we do it inside the if\n\t var match = rest.match(new RegExp('([\\\\s\\\\S]*?)<\\/\\\\s*' + start.tagName + '\\\\s*>', 'i'));\n\t if (match) {\n\t return new _tokens.AtomicTagToken(start.tagName, match[0].length + start.length, start.attrs, start.booleanAttrs, match[1]);\n\t }\n\t }\n\t }\n\t}\n\n\t/**\n\t * Reads an end tag token.\n\t *\n\t * @param {string} stream The input stream\n\t * @returns {EndTagToken}\n\t */\n\tfunction endTag(stream) {\n\t var match = stream.match(REGEXES.endTag);\n\t if (match) {\n\t return new _tokens.EndTagToken(match[1], match[0].length);\n\t }\n\t}\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\texports.EndTagToken = exports.AtomicTagToken = exports.StartTagToken = exports.TagToken = exports.CharsToken = exports.CommentToken = exports.Token = undefined;\n\n\tvar _utils = __webpack_require__(5);\n\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\t/**\n\t * Token is a base class for all token types parsed. Note we don't actually\n\t * use intheritance due to IE8's non-existent ES5 support.\n\t */\n\tvar Token =\n\t/**\n\t * Constructor.\n\t *\n\t * @param {string} type The type of the Token.\n\t * @param {Number} length The length of the Token text.\n\t */\n\texports.Token = function Token(type, length) {\n\t _classCallCheck(this, Token);\n\n\t this.type = type;\n\t this.length = length;\n\t this.text = '';\n\t};\n\n\t/**\n\t * CommentToken represents comment tags.\n\t */\n\n\n\tvar CommentToken = exports.CommentToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} content The content of the comment\n\t * @param {Number} length The length of the Token text.\n\t */\n\t function CommentToken(content, length) {\n\t _classCallCheck(this, CommentToken);\n\n\t this.type = 'comment';\n\t this.length = length || (content ? content.length : 0);\n\t this.text = '';\n\t this.content = content;\n\t }\n\n\t CommentToken.prototype.toString = function toString() {\n\t return '<!--' + this.content;\n\t };\n\n\t return CommentToken;\n\t}();\n\n\t/**\n\t * CharsToken represents non-tag characters.\n\t */\n\n\n\tvar CharsToken = exports.CharsToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {Number} length The length of the Token text.\n\t */\n\t function CharsToken(length) {\n\t _classCallCheck(this, CharsToken);\n\n\t this.type = 'chars';\n\t this.length = length;\n\t this.text = '';\n\t }\n\n\t CharsToken.prototype.toString = function toString() {\n\t return this.text;\n\t };\n\n\t return CharsToken;\n\t}();\n\n\t/**\n\t * TagToken is a base class for all tag-based Tokens.\n\t */\n\n\n\tvar TagToken = exports.TagToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} type The type of the token.\n\t * @param {string} tagName The tag name.\n\t * @param {Number} length The length of the Token text.\n\t * @param {Object} attrs The dictionary of attributes and values\n\t * @param {Object} booleanAttrs If an entry has 'true' then the attribute\n\t * is a boolean attribute\n\t */\n\t function TagToken(type, tagName, length, attrs, booleanAttrs) {\n\t _classCallCheck(this, TagToken);\n\n\t this.type = type;\n\t this.length = length;\n\t this.text = '';\n\t this.tagName = tagName;\n\t this.attrs = attrs;\n\t this.booleanAttrs = booleanAttrs;\n\t this.unary = false;\n\t this.html5Unary = false;\n\t }\n\n\t /**\n\t * Formats the given token tag.\n\t *\n\t * @param {TagToken} tok The TagToken to format.\n\t * @param {?string} [content=null] The content of the token.\n\t * @returns {string} The formatted tag.\n\t */\n\n\n\t TagToken.formatTag = function formatTag(tok) {\n\t var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n\t var str = '<' + tok.tagName;\n\t for (var key in tok.attrs) {\n\t if (tok.attrs.hasOwnProperty(key)) {\n\t str += ' ' + key;\n\n\t var val = tok.attrs[key];\n\t if (typeof tok.booleanAttrs === 'undefined' || typeof tok.booleanAttrs[key] === 'undefined') {\n\t str += '=\"' + (0, _utils.escapeQuotes)(val) + '\"';\n\t }\n\t }\n\t }\n\n\t if (tok.rest) {\n\t str += ' ' + tok.rest;\n\t }\n\n\t if (tok.unary && !tok.html5Unary) {\n\t str += '/>';\n\t } else {\n\t str += '>';\n\t }\n\n\t if (content !== undefined && content !== null) {\n\t str += content + '</' + tok.tagName + '>';\n\t }\n\n\t return str;\n\t };\n\n\t return TagToken;\n\t}();\n\n\t/**\n\t * StartTagToken represents a start token.\n\t */\n\n\n\tvar StartTagToken = exports.StartTagToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} tagName The tag name.\n\t * @param {Number} length The length of the Token text\n\t * @param {Object} attrs The dictionary of attributes and values\n\t * @param {Object} booleanAttrs If an entry has 'true' then the attribute\n\t * is a boolean attribute\n\t * @param {boolean} unary True if the tag is a unary tag\n\t * @param {string} rest The rest of the content.\n\t */\n\t function StartTagToken(tagName, length, attrs, booleanAttrs, unary, rest) {\n\t _classCallCheck(this, StartTagToken);\n\n\t this.type = 'startTag';\n\t this.length = length;\n\t this.text = '';\n\t this.tagName = tagName;\n\t this.attrs = attrs;\n\t this.booleanAttrs = booleanAttrs;\n\t this.html5Unary = false;\n\t this.unary = unary;\n\t this.rest = rest;\n\t }\n\n\t StartTagToken.prototype.toString = function toString() {\n\t return TagToken.formatTag(this);\n\t };\n\n\t return StartTagToken;\n\t}();\n\n\t/**\n\t * AtomicTagToken represents an atomic tag.\n\t */\n\n\n\tvar AtomicTagToken = exports.AtomicTagToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} tagName The name of the tag.\n\t * @param {Number} length The length of the tag text.\n\t * @param {Object} attrs The attributes.\n\t * @param {Object} booleanAttrs If an entry has 'true' then the attribute\n\t * is a boolean attribute\n\t * @param {string} content The content of the tag.\n\t */\n\t function AtomicTagToken(tagName, length, attrs, booleanAttrs, content) {\n\t _classCallCheck(this, AtomicTagToken);\n\n\t this.type = 'atomicTag';\n\t this.length = length;\n\t this.text = '';\n\t this.tagName = tagName;\n\t this.attrs = attrs;\n\t this.booleanAttrs = booleanAttrs;\n\t this.unary = false;\n\t this.html5Unary = false;\n\t this.content = content;\n\t }\n\n\t AtomicTagToken.prototype.toString = function toString() {\n\t return TagToken.formatTag(this, this.content);\n\t };\n\n\t return AtomicTagToken;\n\t}();\n\n\t/**\n\t * EndTagToken represents an end tag.\n\t */\n\n\n\tvar EndTagToken = exports.EndTagToken = function () {\n\t /**\n\t * Constructor.\n\t *\n\t * @param {string} tagName The name of the tag.\n\t * @param {Number} length The length of the tag text.\n\t */\n\t function EndTagToken(tagName, length) {\n\t _classCallCheck(this, EndTagToken);\n\n\t this.type = 'endTag';\n\t this.length = length;\n\t this.text = '';\n\t this.tagName = tagName;\n\t }\n\n\t EndTagToken.prototype.toString = function toString() {\n\t return '</' + this.tagName + '>';\n\t };\n\n\t return EndTagToken;\n\t}();\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\texports.escapeQuotes = escapeQuotes;\n\n\t/**\n\t * Escape quotes in the given value.\n\t *\n\t * @param {string} value The value to escape.\n\t * @param {string} [defaultValue=''] The default value to return if value is falsy.\n\t * @returns {string}\n\t */\n\tfunction escapeQuotes(value) {\n\t var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n\t // There's no lookback in JS, so /(^|[^\\\\])\"/ only matches the first of two `\"`s.\n\t // Instead, just match anything before a double-quote and escape if it's not already escaped.\n\t return !value ? defaultValue : value.replace(/([^\"]*)\"/g, function (_, prefix) {\n\t return (/\\\\/.test(prefix) ? prefix + '\"' : prefix + '\\\\\"'\n\t );\n\t });\n\t}\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\n\texports.__esModule = true;\n\texports['default'] = fixedReadTokenFactory;\n\t/**\n\t * Empty Elements - HTML 4.01\n\t *\n\t * @type {RegExp}\n\t */\n\tvar EMPTY = /^(AREA|BASE|BASEFONT|BR|COL|FRAME|HR|IMG|INPUT|ISINDEX|LINK|META|PARAM|EMBED)$/i;\n\n\t/**\n\t * Elements that you can intentionally leave open (and which close themselves)\n\t *\n\t * @type {RegExp}\n\t */\n\tvar CLOSESELF = /^(COLGROUP|DD|DT|LI|OPTIONS|P|TD|TFOOT|TH|THEAD|TR)$/i;\n\n\t/**\n\t * Corrects a token.\n\t *\n\t * @param {Token} tok The token to correct\n\t * @returns {Token} The corrected token\n\t */\n\tfunction correct(tok) {\n\t if (tok && tok.type === 'startTag') {\n\t tok.unary = EMPTY.test(tok.tagName) || tok.unary;\n\t tok.html5Unary = !/\\/>$/.test(tok.text);\n\t }\n\t return tok;\n\t}\n\n\t/**\n\t * Peeks at the next token in the parser.\n\t *\n\t * @param {HtmlParser} parser The parser\n\t * @param {Function} readTokenImpl The underlying readToken implementation\n\t * @returns {Token} The next token\n\t */\n\tfunction peekToken(parser, readTokenImpl) {\n\t var tmp = parser.stream;\n\t var tok = correct(readTokenImpl());\n\t parser.stream = tmp;\n\t return tok;\n\t}\n\n\t/**\n\t * Closes the last token.\n\t *\n\t * @param {HtmlParser} parser The parser\n\t * @param {Array<Token>} stack The stack\n\t */\n\tfunction closeLast(parser, stack) {\n\t var tok = stack.pop();\n\n\t // prepend close tag to stream.\n\t parser.prepend('</' + tok.tagName + '>');\n\t}\n\n\t/**\n\t * Create a new token stack.\n\t *\n\t * @returns {Array<Token>}\n\t */\n\tfunction newStack() {\n\t var stack = [];\n\n\t stack.last = function () {\n\t return this[this.length - 1];\n\t };\n\n\t stack.lastTagNameEq = function (tagName) {\n\t var last = this.last();\n\t return last && last.tagName && last.tagName.toUpperCase() === tagName.toUpperCase();\n\t };\n\n\t stack.containsTagName = function (tagName) {\n\t for (var i = 0, tok; tok = this[i]; i++) {\n\t if (tok.tagName === tagName) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t };\n\n\t return stack;\n\t}\n\n\t/**\n\t * Return a readToken implementation that fixes input.\n\t *\n\t * @param {HtmlParser} parser The parser\n\t * @param {Object} options Options for fixing\n\t * @param {boolean} options.tagSoupFix True to fix tag soup scenarios\n\t * @param {boolean} options.selfCloseFix True to fix self-closing tags\n\t * @param {Function} readTokenImpl The underlying readToken implementation\n\t * @returns {Function}\n\t */\n\tfunction fixedReadTokenFactory(parser, options, readTokenImpl) {\n\t var stack = newStack();\n\n\t var handlers = {\n\t startTag: function startTag(tok) {\n\t var tagName = tok.tagName;\n\n\t if (tagName.toUpperCase() === 'TR' && stack.lastTagNameEq('TABLE')) {\n\t parser.prepend('<TBODY>');\n\t prepareNextToken();\n\t } else if (options.selfCloseFix && CLOSESELF.test(tagName) && stack.containsTagName(tagName)) {\n\t if (stack.lastTagNameEq(tagName)) {\n\t closeLast(parser, stack);\n\t } else {\n\t parser.prepend('</' + tok.tagName + '>');\n\t prepareNextToken();\n\t }\n\t } else if (!tok.unary) {\n\t stack.push(tok);\n\t }\n\t },\n\t endTag: function endTag(tok) {\n\t var last = stack.last();\n\t if (last) {\n\t if (options.tagSoupFix && !stack.lastTagNameEq(tok.tagName)) {\n\t // cleanup tag soup\n\t closeLast(parser, stack);\n\t } else {\n\t stack.pop();\n\t }\n\t } else if (options.tagSoupFix) {\n\t // cleanup tag soup part 2: skip this token\n\t readTokenImpl();\n\t prepareNextToken();\n\t }\n\t }\n\t };\n\n\t function prepareNextToken() {\n\t var tok = peekToken(parser, readTokenImpl);\n\t if (tok && handlers[tok.type]) {\n\t handlers[tok.type](tok);\n\t }\n\t }\n\n\t return function fixedReadToken() {\n\t prepareNextToken();\n\t return correct(readTokenImpl());\n\t };\n\t}\n\n/***/ }\n/******/ ])\n});\n;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prescribe/dist/prescribe.js\n// module id = 3\n// module chunks = 0","/**\n * Determine if the thing is not undefined and not null.\n *\n * @param {*} thing The thing to test\n * @returns {boolean} True if the thing is not undefined and not null.\n */\nexport function existy(thing) {\n return thing !== void 0 && thing !== null;\n}\n\n/**\n * Is this a function?\n *\n * @param {*} x The variable to test\n * @returns {boolean} True if the variable is a function\n */\nexport function isFunction(x) {\n return 'function' === typeof x;\n}\n\n/**\n * Loop over each item in an array-like value.\n *\n * @param {Array<*>} arr The array to loop over\n * @param {Function} fn The function to call\n * @param {?Object} target The object to bind to the function\n */\nexport function each(arr, fn, target) {\n let i;\n const len = (arr && arr.length) || 0;\n for (i = 0; i < len; i++) {\n fn.call(target, arr[i], i);\n }\n}\n\n/**\n * Loop over each key/value pair in a hash.\n *\n * @param {Object} obj The object\n * @param {Function} fn The function to call\n * @param {?Object} target The object to bind to the function\n */\nexport function eachKey(obj, fn, target) {\n for (let key in obj) {\n if (obj.hasOwnProperty(key)) {\n fn.call(target, key, obj[key]);\n }\n }\n}\n\n/**\n * Set default options where some option was not specified.\n *\n * @param {Object} options The destination\n * @param {Object} _defaults The defaults\n * @returns {Object}\n */\nexport function defaults(options, _defaults) {\n options = options || {};\n eachKey(_defaults, function(key, val) {\n if (!existy(options[key])) {\n options[key] = val;\n }\n });\n return options;\n}\n\n/**\n * Convert value (e.g., a NodeList) to an array.\n *\n * @param {*} obj The object\n * @returns {Array<*>}\n */\nexport function toArray(obj) {\n try {\n return Array.prototype.slice.call(obj);\n } catch (e) {\n const ret = [];\n each(obj, function(val) {\n ret.push(val);\n });\n return ret;\n }\n}\n\n/**\n * Get the last item in an array\n *\n * @param {Array<*>} array The array\n * @returns {*} The last item in the array\n */\nexport function last(array) {\n return array[array.length - 1];\n}\n\n/**\n * Test if token is a script tag.\n *\n * @param {Object} tok The token\n * @param {String} tag The tag name\n * @returns {boolean} True if the token is a script tag\n */\nexport function isTag(tok, tag) {\n return !tok ||\n !(tok.type === 'startTag' || tok.type === 'atomicTag') ||\n !('tagName' in tok) ? !1 : !!~tok.tagName.toLowerCase().indexOf(tag);\n}\n\n/**\n * Test if token is a script tag.\n *\n * @param {Object} tok The token\n * @returns {boolean} True if the token is a script tag\n */\nexport function isScript(tok) {\n return isTag(tok, 'script');\n}\n\n/**\n * Test if token is a style tag.\n *\n * @param {Object} tok The token\n * @returns {boolean} True if the token is a style tag\n */\nexport function isStyle(tok) {\n return isTag(tok, 'style');\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js"],"sourceRoot":""}
|
package/dist/postscribe.max.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* @file postscribe
|
3
3
|
* @description Asynchronously write javascript, even with document.write.
|
4
|
-
* @version
|
4
|
+
* @version v2.0.8
|
5
5
|
* @see {@link https://krux.github.io/postscribe}
|
6
6
|
* @license MIT
|
7
7
|
* @author Derek Brans
|
@@ -383,7 +383,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
383
383
|
* @param {null|*} value The attribute value.
|
384
384
|
*/
|
385
385
|
function setData(el, name) {
|
386
|
-
var value = arguments.length
|
386
|
+
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
387
387
|
|
388
388
|
var attr = BASEATTR + name;
|
389
389
|
|
@@ -426,7 +426,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
426
426
|
* @param {?Object} options The options
|
427
427
|
*/
|
428
428
|
function WriteStream(root) {
|
429
|
-
var options = arguments.length
|
429
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
430
430
|
|
431
431
|
_classCallCheck(this, WriteStream);
|
432
432
|
|
@@ -998,7 +998,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
998
998
|
/**
|
999
999
|
* @file prescribe
|
1000
1000
|
* @description Tiny, forgiving HTML parser
|
1001
|
-
* @version
|
1001
|
+
* @version vundefined
|
1002
1002
|
* @see {@link https://github.com/krux/prescribe/}
|
1003
1003
|
* @license MIT
|
1004
1004
|
* @author Derek Brans
|
@@ -1127,12 +1127,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1127
1127
|
* @param {Object} options The options
|
1128
1128
|
* @param {boolean} options.autoFix Set to true to automatically fix errors
|
1129
1129
|
*/
|
1130
|
-
|
1131
1130
|
function HtmlParser() {
|
1132
1131
|
var _this = this;
|
1133
1132
|
|
1134
|
-
var stream = arguments.length
|
1135
|
-
var options = arguments.length
|
1133
|
+
var stream = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
1134
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1136
1135
|
|
1137
1136
|
_classCallCheck(this, HtmlParser);
|
1138
1137
|
|
@@ -1364,7 +1363,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1364
1363
|
|
1365
1364
|
exports.__esModule = true;
|
1366
1365
|
|
1367
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
1366
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
1368
1367
|
|
1369
1368
|
exports.comment = comment;
|
1370
1369
|
exports.chars = chars;
|
@@ -1500,7 +1499,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1500
1499
|
* Token is a base class for all token types parsed. Note we don't actually
|
1501
1500
|
* use intheritance due to IE8's non-existent ES5 support.
|
1502
1501
|
*/
|
1503
|
-
|
1504
1502
|
var Token =
|
1505
1503
|
/**
|
1506
1504
|
* Constructor.
|
@@ -1528,7 +1526,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1528
1526
|
* @param {string} content The content of the comment
|
1529
1527
|
* @param {Number} length The length of the Token text.
|
1530
1528
|
*/
|
1531
|
-
|
1532
1529
|
function CommentToken(content, length) {
|
1533
1530
|
_classCallCheck(this, CommentToken);
|
1534
1531
|
|
@@ -1556,7 +1553,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1556
1553
|
*
|
1557
1554
|
* @param {Number} length The length of the Token text.
|
1558
1555
|
*/
|
1559
|
-
|
1560
1556
|
function CharsToken(length) {
|
1561
1557
|
_classCallCheck(this, CharsToken);
|
1562
1558
|
|
@@ -1588,7 +1584,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1588
1584
|
* @param {Object} booleanAttrs If an entry has 'true' then the attribute
|
1589
1585
|
* is a boolean attribute
|
1590
1586
|
*/
|
1591
|
-
|
1592
1587
|
function TagToken(type, tagName, length, attrs, booleanAttrs) {
|
1593
1588
|
_classCallCheck(this, TagToken);
|
1594
1589
|
|
@@ -1612,7 +1607,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1612
1607
|
|
1613
1608
|
|
1614
1609
|
TagToken.formatTag = function formatTag(tok) {
|
1615
|
-
var content = arguments.length
|
1610
|
+
var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
1616
1611
|
|
1617
1612
|
var str = '<' + tok.tagName;
|
1618
1613
|
for (var key in tok.attrs) {
|
@@ -1663,7 +1658,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1663
1658
|
* @param {boolean} unary True if the tag is a unary tag
|
1664
1659
|
* @param {string} rest The rest of the content.
|
1665
1660
|
*/
|
1666
|
-
|
1667
1661
|
function StartTagToken(tagName, length, attrs, booleanAttrs, unary, rest) {
|
1668
1662
|
_classCallCheck(this, StartTagToken);
|
1669
1663
|
|
@@ -1701,7 +1695,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1701
1695
|
* is a boolean attribute
|
1702
1696
|
* @param {string} content The content of the tag.
|
1703
1697
|
*/
|
1704
|
-
|
1705
1698
|
function AtomicTagToken(tagName, length, attrs, booleanAttrs, content) {
|
1706
1699
|
_classCallCheck(this, AtomicTagToken);
|
1707
1700
|
|
@@ -1735,7 +1728,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1735
1728
|
* @param {string} tagName The name of the tag.
|
1736
1729
|
* @param {Number} length The length of the tag text.
|
1737
1730
|
*/
|
1738
|
-
|
1739
1731
|
function EndTagToken(tagName, length) {
|
1740
1732
|
_classCallCheck(this, EndTagToken);
|
1741
1733
|
|
@@ -1769,7 +1761,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1769
1761
|
* @returns {string}
|
1770
1762
|
*/
|
1771
1763
|
function escapeQuotes(value) {
|
1772
|
-
var defaultValue = arguments.length
|
1764
|
+
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
1773
1765
|
|
1774
1766
|
// There's no lookback in JS, so /(^|[^\\])"/ only matches the first of two `"`s.
|
1775
1767
|
// Instead, just match anything before a double-quote and escape if it's not already escaped.
|
@@ -1945,7 +1937,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
1945
1937
|
|
1946
1938
|
exports.__esModule = true;
|
1947
1939
|
|
1948
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
1940
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
1949
1941
|
|
1950
1942
|
exports.existy = existy;
|
1951
1943
|
exports.isFunction = isFunction;
|
package/dist/postscribe.min.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
/**
|
2
2
|
* @file postscribe
|
3
3
|
* @description Asynchronously write javascript, even with document.write.
|
4
|
-
* @version
|
4
|
+
* @version v2.0.8
|
5
5
|
* @see {@link https://krux.github.io/postscribe}
|
6
6
|
* @license MIT
|
7
7
|
* @author Derek Brans
|
8
8
|
* @copyright 2016 Krux Digital, Inc
|
9
9
|
*/
|
10
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.postscribe=e():t.postscribe=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}var o=r(1),i=n(o);t.exports=i.default},function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function o(t){return t&&t.__esModule?t:{default:t}}function i(){}function a(){var t=m.shift();if(t){var e=h.last(t);e.afterDequeue(),t.stream=s.apply(void 0,t),e.afterStreamStart()}}function s(t,e,r){function n(t){t=r.beforeWrite(t),g.write(t),r.afterWrite(t)}g=new f.default(t,r),g.id=y++,g.name=r.name||g.id,u.streams[g.name]=g;var o=t.ownerDocument,s={close:o.close,open:o.open,write:o.write,writeln:o.writeln};c(o,{close:i,open:i,write:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return n(e.join(""))},writeln:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return n(e.join("")+"\n")}});var l=g.win.onerror||i;return g.win.onerror=function(t,e,n){r.error({msg:t+" - "+e+": "+n}),l.apply(g.win,[t,e,n])},g.write(e,function(){c(o,s),g.win.onerror=l,r.done(),g=null,a()}),g}function u(t,e,r){if(h.isFunction(r))r={done:r};else if("clear"===r)return m=[],g=null,void(y=0);r=h.defaults(r,d),t=/^#/.test(t)?window.document.getElementById(t.substr(1)):t.jquery?t[0]:t;var n=[t,e,r];return t.postscribe={cancel:function(){n.stream?n.stream.abort():n[1]=i}},r.beforeEnqueue(n),m.push(n),g||a(),t.postscribe}e.__esModule=!0;var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};e.default=u;var l=r(2),f=o(l),p=r(4),h=n(p),d={afterAsync:i,afterDequeue:i,afterStreamStart:i,afterWrite:i,autoFix:!0,beforeEnqueue:i,beforeWriteToken:function(t){return t},beforeWrite:function(t){return t},done:i,error:function(t){throw new Error(t.msg)},releaseAsync:!1},y=0,m=[],g=null;c(u,{streams:{},queue:m,WriteStream:f.default})},function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function o(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){var r=d+e,n=t.getAttribute(r);return p.existy(n)?String(n):n}function s(t,e){var r=arguments.length<=2||void 0===arguments[2]?null:arguments[2],n=d+e;p.existy(r)&&""!==r?t.setAttribute(n,r):t.removeAttribute(n)}e.__esModule=!0;var u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},c=r(3),l=o(c),f=r(4),p=n(f),h=!1,d="data-ps-",y="ps-style",m="ps-script",g=function(){function t(e){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];i(this,t),this.root=e,this.options=r,this.doc=e.ownerDocument,this.win=this.doc.defaultView||this.doc.parentWindow,this.parser=new l.default("",{autoFix:r.autoFix}),this.actuals=[e],this.proxyHistory="",this.proxyRoot=this.doc.createElement(e.nodeName),this.scriptStack=[],this.writeQueue=[],s(this.proxyRoot,"proxyof",0)}return t.prototype.write=function(){var t;for((t=this.writeQueue).push.apply(t,arguments);!this.deferredRemote&&this.writeQueue.length;){var e=this.writeQueue.shift();p.isFunction(e)?this._callFunction(e):this._writeImpl(e)}},t.prototype._callFunction=function(t){var e={type:"function",value:t.name||t.toString()};this._onScriptStart(e),t.call(this.win,this.doc),this._onScriptDone(e)},t.prototype._writeImpl=function(t){this.parser.append(t);for(var e=void 0,r=void 0,n=void 0,o=[];(e=this.parser.readToken())&&!(r=p.isScript(e))&&!(n=p.isStyle(e));)e=this.options.beforeWriteToken(e),e&&o.push(e);o.length>0&&this._writeStaticTokens(o),r&&this._handleScriptToken(e),n&&this._handleStyleToken(e)},t.prototype._writeStaticTokens=function(t){var e=this._buildChunk(t);return e.actual?(e.html=this.proxyHistory+e.actual,this.proxyHistory+=e.proxy,this.proxyRoot.innerHTML=e.html,h&&(e.proxyInnerHTML=this.proxyRoot.innerHTML),this._walkChunk(),h&&(e.actualInnerHTML=this.root.innerHTML),e):null},t.prototype._buildChunk=function(t){for(var e=this.actuals.length,r=[],n=[],o=[],i=t.length,a=0;a<i;a++){var s=t[a],u=s.toString();if(r.push(u),s.attrs){if(!/^noscript$/i.test(s.tagName)){var c=e++;n.push(u.replace(/(\/?>)/," "+d+"id="+c+" $1")),s.attrs.id!==m&&s.attrs.id!==y&&o.push("atomicTag"===s.type?"":"<"+s.tagName+" "+d+"proxyof="+c+(s.unary?" />":">"))}}else n.push(u),o.push("endTag"===s.type?u:"")}return{tokens:t,raw:r.join(""),actual:n.join(""),proxy:o.join("")}},t.prototype._walkChunk=function(){for(var t=void 0,e=[this.proxyRoot];p.existy(t=e.shift());){var r=1===t.nodeType,n=r&&a(t,"proxyof");if(!n){r&&(this.actuals[a(t,"id")]=t,s(t,"id"));var o=t.parentNode&&a(t.parentNode,"proxyof");o&&this.actuals[o].appendChild(t)}e.unshift.apply(e,p.toArray(t.childNodes))}},t.prototype._handleScriptToken=function(t){var e=this,r=this.parser.clear();r&&this.writeQueue.unshift(r),t.src=t.attrs.src||t.attrs.SRC,t=this.options.beforeWriteToken(t),t&&(t.src&&this.scriptStack.length?this.deferredRemote=t:this._onScriptStart(t),this._writeScriptToken(t,function(){e._onScriptDone(t)}))},t.prototype._handleStyleToken=function(t){var e=this.parser.clear();e&&this.writeQueue.unshift(e),t.type=t.attrs.type||t.attrs.TYPE||"text/css",t=this.options.beforeWriteToken(t),t&&this._writeStyleToken(t),e&&this.write()},t.prototype._writeStyleToken=function(t){var e=this._buildStyle(t);this._insertCursor(e,y),t.content&&(e.styleSheet&&!e.sheet?e.styleSheet.cssText=t.content:e.appendChild(this.doc.createTextNode(t.content)))},t.prototype._buildStyle=function(t){var e=this.doc.createElement(t.tagName);return e.setAttribute("type",t.type),p.eachKey(t.attrs,function(t,r){e.setAttribute(t,r)}),e},t.prototype._insertCursor=function(t,e){this._writeImpl('<span id="'+e+'"/>');var r=this.doc.getElementById(e);r&&r.parentNode.replaceChild(t,r)},t.prototype._onScriptStart=function(t){t.outerWrites=this.writeQueue,this.writeQueue=[],this.scriptStack.unshift(t)},t.prototype._onScriptDone=function(t){return t!==this.scriptStack[0]?void this.options.error({msg:"Bad script nesting or script finished twice"}):(this.scriptStack.shift(),this.write.apply(this,t.outerWrites),void(!this.scriptStack.length&&this.deferredRemote&&(this._onScriptStart(this.deferredRemote),this.deferredRemote=null)))},t.prototype._writeScriptToken=function(t,e){var r=this._buildScript(t),n=this._shouldRelease(r),o=this.options.afterAsync;t.src&&(r.src=t.src,this._scriptLoadHandler(r,n?o:function(){e(),o()}));try{this._insertCursor(r,m),r.src&&!n||e()}catch(t){this.options.error(t),e()}},t.prototype._buildScript=function(t){var e=this.doc.createElement(t.tagName);return p.eachKey(t.attrs,function(t,r){e.setAttribute(t,r)}),t.content&&(e.text=t.content),e},t.prototype._scriptLoadHandler=function(t,e){function r(){t=t.onload=t.onreadystatechange=t.onerror=null}function n(){r(),null!=e&&e(),e=null}function o(t){r(),a(t),null!=e&&e(),e=null}function i(t,e){var r=t["on"+e];null!=r&&(t["_on"+e]=r)}var a=this.options.error;i(t,"load"),i(t,"error"),u(t,{onload:function(){if(t._onload)try{t._onload.apply(this,Array.prototype.slice.call(arguments,0))}catch(e){o({msg:"onload handler failed "+e+" @ "+t.src})}n()},onerror:function(){if(t._onerror)try{t._onerror.apply(this,Array.prototype.slice.call(arguments,0))}catch(e){return void o({msg:"onerror handler failed "+e+" @ "+t.src})}o({msg:"remote script failed "+t.src})},onreadystatechange:function(){/^(loaded|complete)$/.test(t.readyState)&&n()}})},t.prototype._shouldRelease=function(t){var e=/^script$/i.test(t.nodeName);return!e||!!(this.options.releaseAsync&&t.src&&t.hasAttribute("async"))},t}();e.default=g},function(t,e,r){!function(e,r){t.exports=r()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}var o=r(1),i=n(o);t.exports=i.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var a=r(2),s=o(a),u=r(3),c=o(u),l=r(6),f=n(l),p=r(5),h={comment:/^<!--/,endTag:/^<\//,atomicTag:/^<\s*(script|style|noscript|iframe|textarea)[\s\/>]/i,startTag:/^</,chars:/^[^<]/},d=function(){function t(){var e=this,r=arguments.length<=0||void 0===arguments[0]?"":arguments[0],n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];i(this,t),this.stream=r;var o=!1,a={};for(var u in s)s.hasOwnProperty(u)&&(n.autoFix&&(a[u+"Fix"]=!0),o=o||a[u+"Fix"]);o?(this._readToken=(0,f.default)(this,a,function(){return e._readTokenImpl()}),this._peekToken=(0,f.default)(this,a,function(){return e._peekTokenImpl()})):(this._readToken=this._readTokenImpl,this._peekToken=this._peekTokenImpl)}return t.prototype.append=function(t){this.stream+=t},t.prototype.prepend=function(t){this.stream=t+this.stream},t.prototype._readTokenImpl=function(){var t=this._peekTokenImpl();if(t)return this.stream=this.stream.slice(t.length),t},t.prototype._peekTokenImpl=function(){for(var t in h)if(h.hasOwnProperty(t)&&h[t].test(this.stream)){var e=c[t](this.stream);if(e)return"startTag"===e.type&&/script|style/i.test(e.tagName)?null:(e.text=this.stream.substr(0,e.length),e)}},t.prototype.peekToken=function(){return this._peekToken()},t.prototype.readToken=function(){return this._readToken()},t.prototype.readTokens=function(t){for(var e=void 0;e=this.readToken();)if(t[e.type]&&t[e.type](e)===!1)return},t.prototype.clear=function(){var t=this.stream;return this.stream="",t},t.prototype.rest=function(){return this.stream},t}();e.default=d,d.tokenToString=function(t){return t.toString()},d.escapeAttributes=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=(0,p.escapeQuotes)(t[r],null));return e},d.supports=s;for(var y in s)s.hasOwnProperty(y)&&(d.browserHasFlaw=d.browserHasFlaw||!s[y]&&y)},function(t,e){"use strict";e.__esModule=!0;var r=!1,n=!1,o=window.document.createElement("div");try{var i="<P><I></P></I>";o.innerHTML=i,e.tagSoup=r=o.innerHTML!==i}catch(t){e.tagSoup=r=!1}try{o.innerHTML="<P><i><P></P></i></P>",e.selfClose=n=2===o.childNodes.length}catch(t){e.selfClose=n=!1}o=null,e.tagSoup=r,e.selfClose=n},function(t,e,r){"use strict";function n(t){var e=t.indexOf("-->");if(e>=0)return new c.CommentToken(t.substr(4,e-1),e+3)}function o(t){var e=t.indexOf("<");return new c.CharsToken(e>=0?e:t.length)}function i(t){var e=t.indexOf(">");if(e!==-1){var r=t.match(l.startTag);if(r){var n=function(){var t={},e={},n=r[2];return r[2].replace(l.attr,function(r,o){arguments[2]||arguments[3]||arguments[4]||arguments[5]?arguments[5]?(t[arguments[5]]="",e[arguments[5]]=!0):t[o]=arguments[2]||arguments[3]||arguments[4]||l.fillAttr.test(o)&&o||"":t[o]="",n=n.replace(r,"")}),{v:new c.StartTagToken(r[1],r[0].length,t,e,(!!r[3]),n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""))}}();if("object"===("undefined"==typeof n?"undefined":u(n)))return n.v}}}function a(t){var e=i(t);if(e){var r=t.slice(e.length);if(r.match(new RegExp("</\\s*"+e.tagName+"\\s*>","i"))){var n=r.match(new RegExp("([\\s\\S]*?)</\\s*"+e.tagName+"\\s*>","i"));if(n)return new c.AtomicTagToken(e.tagName,n[0].length+e.length,e.attrs,e.booleanAttrs,n[1])}}}function s(t){var e=t.match(l.endTag);if(e)return new c.EndTagToken(e[1],e[0].length)}e.__esModule=!0;var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.comment=n,e.chars=o,e.startTag=i,e.atomicTag=a,e.endTag=s;var c=r(4),l={startTag:/^<([\-A-Za-z0-9_]+)((?:\s+[\w\-]+(?:\s*=?\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,endTag:/^<\/([\-A-Za-z0-9_]+)[^>]*>/,attr:/(?:([\-A-Za-z0-9_]+)\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))|(?:([\-A-Za-z0-9_]+)(\s|$)+)/g,fillAttr:/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noresize|noshade|nowrap|readonly|selected)$/i}},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0,e.EndTagToken=e.AtomicTagToken=e.StartTagToken=e.TagToken=e.CharsToken=e.CommentToken=e.Token=void 0;var o=r(5),i=(e.Token=function t(e,r){n(this,t),this.type=e,this.length=r,this.text=""},e.CommentToken=function(){function t(e,r){n(this,t),this.type="comment",this.length=r||(e?e.length:0),this.text="",this.content=e}return t.prototype.toString=function(){return"<!--"+this.content},t}(),e.CharsToken=function(){function t(e){n(this,t),this.type="chars",this.length=e,this.text=""}return t.prototype.toString=function(){return this.text},t}(),e.TagToken=function(){function t(e,r,o,i,a){n(this,t),this.type=e,this.length=o,this.text="",this.tagName=r,this.attrs=i,this.booleanAttrs=a,this.unary=!1,this.html5Unary=!1}return t.formatTag=function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1],r="<"+t.tagName;for(var n in t.attrs)if(t.attrs.hasOwnProperty(n)){r+=" "+n;var i=t.attrs[n];"undefined"!=typeof t.booleanAttrs&&"undefined"!=typeof t.booleanAttrs[n]||(r+='="'+(0,o.escapeQuotes)(i)+'"')}return t.rest&&(r+=" "+t.rest),r+=t.unary&&!t.html5Unary?"/>":">",void 0!==e&&null!==e&&(r+=e+"</"+t.tagName+">"),r},t}());e.StartTagToken=function(){function t(e,r,o,i,a,s){n(this,t),this.type="startTag",this.length=r,this.text="",this.tagName=e,this.attrs=o,this.booleanAttrs=i,this.html5Unary=!1,this.unary=a,this.rest=s}return t.prototype.toString=function(){return i.formatTag(this)},t}(),e.AtomicTagToken=function(){function t(e,r,o,i,a){n(this,t),this.type="atomicTag",this.length=r,this.text="",this.tagName=e,this.attrs=o,this.booleanAttrs=i,this.unary=!1,this.html5Unary=!1,this.content=a}return t.prototype.toString=function(){return i.formatTag(this,this.content)},t}(),e.EndTagToken=function(){function t(e,r){n(this,t),this.type="endTag",this.length=r,this.text="",this.tagName=e}return t.prototype.toString=function(){return"</"+this.tagName+">"},t}()},function(t,e){"use strict";function r(t){var e=arguments.length<=1||void 0===arguments[1]?"":arguments[1];return t?t.replace(/([^"]*)"/g,function(t,e){return/\\/.test(e)?e+'"':e+'\\"'}):e}e.__esModule=!0,e.escapeQuotes=r},function(t,e){"use strict";function r(t){return t&&"startTag"===t.type&&(t.unary=s.test(t.tagName)||t.unary,t.html5Unary=!/\/>$/.test(t.text)),t}function n(t,e){var n=t.stream,o=r(e());return t.stream=n,o}function o(t,e){var r=e.pop();t.prepend("</"+r.tagName+">")}function i(){var t=[];return t.last=function(){return this[this.length-1]},t.lastTagNameEq=function(t){var e=this.last();return e&&e.tagName&&e.tagName.toUpperCase()===t.toUpperCase()},t.containsTagName=function(t){for(var e,r=0;e=this[r];r++)if(e.tagName===t)return!0;return!1},t}function a(t,e,a){function s(){var e=n(t,a);e&&l[e.type]&&l[e.type](e)}var c=i(),l={startTag:function(r){var n=r.tagName;"TR"===n.toUpperCase()&&c.lastTagNameEq("TABLE")?(t.prepend("<TBODY>"),s()):e.selfCloseFix&&u.test(n)&&c.containsTagName(n)?c.lastTagNameEq(n)?o(t,c):(t.prepend("</"+r.tagName+">"),s()):r.unary||c.push(r)},endTag:function(r){var n=c.last();n?e.tagSoupFix&&!c.lastTagNameEq(r.tagName)?o(t,c):c.pop():e.tagSoupFix&&(a(),s())}};return function(){return s(),r(a())}}e.__esModule=!0,e.default=a;var s=/^(AREA|BASE|BASEFONT|BR|COL|FRAME|HR|IMG|INPUT|ISINDEX|LINK|META|PARAM|EMBED)$/i,u=/^(COLGROUP|DD|DT|LI|OPTIONS|P|TD|TFOOT|TH|THEAD|TR)$/i}])})},function(t,e){"use strict";function r(t){return void 0!==t&&null!==t}function n(t){return"function"==typeof t}function o(t,e,r){var n=void 0,o=t&&t.length||0;for(n=0;n<o;n++)e.call(r,t[n],n)}function i(t,e,r){for(var n in t)t.hasOwnProperty(n)&&e.call(r,n,t[n])}function a(t,e){return t=t||{},i(e,function(e,n){r(t[e])||(t[e]=n)}),t}function s(t){try{return Array.prototype.slice.call(t)}catch(r){var e=function(){var e=[];return o(t,function(t){e.push(t)}),{v:e}}();if("object"===("undefined"==typeof e?"undefined":p(e)))return e.v}}function u(t){return t[t.length-1]}function c(t,e){return!(!t||"startTag"!==t.type&&"atomicTag"!==t.type||!("tagName"in t))&&!!~t.tagName.toLowerCase().indexOf(e)}function l(t){return c(t,"script")}function f(t){return c(t,"style")}e.__esModule=!0;var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.existy=r,e.isFunction=n,e.each=o,e.eachKey=i,e.defaults=a,e.toArray=s,e.last=u,e.isTag=c,e.isScript=l,e.isStyle=f}])});
|
10
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["postscribe"]=e():t["postscribe"]=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={"exports":{},"id":n,"loaded":!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var o=r(1),i=n(o);t.exports=i["default"]},function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}function i(){}function a(){var t=m.shift();if(t){var e=h.last(t);e.afterDequeue(),t.stream=s.apply(void 0,t),e.afterStreamStart()}}function s(t,e,r){function n(t){t=r.beforeWrite(t),g.write(t),r.afterWrite(t)}g=new p["default"](t,r),g.id=y++,g.name=r.name||g.id,u.streams[g.name]=g;var o=t.ownerDocument,s={"close":o.close,"open":o.open,"write":o.write,"writeln":o.writeln};c(o,{"close":i,"open":i,"write":function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return n(e.join(""))},"writeln":function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return n(e.join("")+"\n")}});var l=g.win.onerror||i;return g.win.onerror=function(t,e,n){r.error({"msg":t+" - "+e+": "+n}),l.apply(g.win,[t,e,n])},g.write(e,function(){c(o,s),g.win.onerror=l,r.done(),g=null,a()}),g}function u(t,e,r){if(h.isFunction(r))r={"done":r};else if("clear"===r)return m=[],g=null,void(y=0);r=h.defaults(r,d),t=/^#/.test(t)?window.document.getElementById(t.substr(1)):t.jquery?t[0]:t;var n=[t,e,r];return t.postscribe={"cancel":function(){n.stream?n.stream.abort():n[1]=i}},r.beforeEnqueue(n),m.push(n),g||a(),t.postscribe}e.__esModule=!0;var c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};e["default"]=u;var l=r(2),p=o(l),f=r(4),h=n(f),d={"afterAsync":i,"afterDequeue":i,"afterStreamStart":i,"afterWrite":i,"autoFix":!0,"beforeEnqueue":i,"beforeWriteToken":function(t){return t},"beforeWrite":function(t){return t},"done":i,"error":function(t){throw new Error(t.msg)},"releaseAsync":!1},y=0,m=[],g=null;c(u,{"streams":{},"queue":m,"WriteStream":p["default"]})},function(t,e,r){"use strict";function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){var r=d+e,n=t.getAttribute(r);return f.existy(n)?String(n):n}function s(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=d+e;f.existy(r)&&""!==r?t.setAttribute(n,r):t.removeAttribute(n)}e.__esModule=!0;var u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},c=r(3),l=o(c),p=r(4),f=n(p),h=!1,d="data-ps-",y="ps-style",m="ps-script",g=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this.root=e,this.options=r,this.doc=e.ownerDocument,this.win=this.doc.defaultView||this.doc.parentWindow,this.parser=new l["default"]("",{"autoFix":r.autoFix}),this.actuals=[e],this.proxyHistory="",this.proxyRoot=this.doc.createElement(e.nodeName),this.scriptStack=[],this.writeQueue=[],s(this.proxyRoot,"proxyof",0)}return t.prototype.write=function(){var t;for((t=this.writeQueue).push.apply(t,arguments);!this.deferredRemote&&this.writeQueue.length;){var e=this.writeQueue.shift();f.isFunction(e)?this._callFunction(e):this._writeImpl(e)}},t.prototype._callFunction=function(t){var e={"type":"function","value":t.name||t.toString()};this._onScriptStart(e),t.call(this.win,this.doc),this._onScriptDone(e)},t.prototype._writeImpl=function(t){this.parser.append(t);for(var e=void 0,r=void 0,n=void 0,o=[];(e=this.parser.readToken())&&!(r=f.isScript(e))&&!(n=f.isStyle(e));)e=this.options.beforeWriteToken(e),e&&o.push(e);o.length>0&&this._writeStaticTokens(o),r&&this._handleScriptToken(e),n&&this._handleStyleToken(e)},t.prototype._writeStaticTokens=function(t){var e=this._buildChunk(t);return e.actual?(e.html=this.proxyHistory+e.actual,this.proxyHistory+=e.proxy,this.proxyRoot.innerHTML=e.html,h&&(e.proxyInnerHTML=this.proxyRoot.innerHTML),this._walkChunk(),h&&(e.actualInnerHTML=this.root.innerHTML),e):null},t.prototype._buildChunk=function(t){for(var e=this.actuals.length,r=[],n=[],o=[],i=t.length,a=0;a<i;a++){var s=t[a],u=s.toString();if(r.push(u),s.attrs){if(!/^noscript$/i.test(s.tagName)){var c=e++;n.push(u.replace(/(\/?>)/," "+d+"id="+c+" $1")),s.attrs.id!==m&&s.attrs.id!==y&&o.push("atomicTag"===s.type?"":"<"+s.tagName+" "+d+"proxyof="+c+(s.unary?" />":">"))}}else n.push(u),o.push("endTag"===s.type?u:"")}return{"tokens":t,"raw":r.join(""),"actual":n.join(""),"proxy":o.join("")}},t.prototype._walkChunk=function(){for(var t=void 0,e=[this.proxyRoot];f.existy(t=e.shift());){var r=1===t.nodeType,n=r&&a(t,"proxyof");if(!n){r&&(this.actuals[a(t,"id")]=t,s(t,"id"));var o=t.parentNode&&a(t.parentNode,"proxyof");o&&this.actuals[o].appendChild(t)}e.unshift.apply(e,f.toArray(t.childNodes))}},t.prototype._handleScriptToken=function(t){var e=this,r=this.parser.clear();r&&this.writeQueue.unshift(r),t.src=t.attrs.src||t.attrs.SRC,t=this.options.beforeWriteToken(t),t&&(t.src&&this.scriptStack.length?this.deferredRemote=t:this._onScriptStart(t),this._writeScriptToken(t,function(){e._onScriptDone(t)}))},t.prototype._handleStyleToken=function(t){var e=this.parser.clear();e&&this.writeQueue.unshift(e),t.type=t.attrs.type||t.attrs.TYPE||"text/css",t=this.options.beforeWriteToken(t),t&&this._writeStyleToken(t),e&&this.write()},t.prototype._writeStyleToken=function(t){var e=this._buildStyle(t);this._insertCursor(e,y),t.content&&(e.styleSheet&&!e.sheet?e.styleSheet.cssText=t.content:e.appendChild(this.doc.createTextNode(t.content)))},t.prototype._buildStyle=function(t){var e=this.doc.createElement(t.tagName);return e.setAttribute("type",t.type),f.eachKey(t.attrs,function(t,r){e.setAttribute(t,r)}),e},t.prototype._insertCursor=function(t,e){this._writeImpl('<span id="'+e+'"/>');var r=this.doc.getElementById(e);r&&r.parentNode.replaceChild(t,r)},t.prototype._onScriptStart=function(t){t.outerWrites=this.writeQueue,this.writeQueue=[],this.scriptStack.unshift(t)},t.prototype._onScriptDone=function(t){return t!==this.scriptStack[0]?void this.options.error({"msg":"Bad script nesting or script finished twice"}):(this.scriptStack.shift(),this.write.apply(this,t.outerWrites),void(!this.scriptStack.length&&this.deferredRemote&&(this._onScriptStart(this.deferredRemote),this.deferredRemote=null)))},t.prototype._writeScriptToken=function(t,e){var r=this._buildScript(t),n=this._shouldRelease(r),o=this.options.afterAsync;t.src&&(r.src=t.src,this._scriptLoadHandler(r,n?o:function(){e(),o()}));try{this._insertCursor(r,m),r.src&&!n||e()}catch(t){this.options.error(t),e()}},t.prototype._buildScript=function(t){var e=this.doc.createElement(t.tagName);return f.eachKey(t.attrs,function(t,r){e.setAttribute(t,r)}),t.content&&(e.text=t.content),e},t.prototype._scriptLoadHandler=function(t,e){function r(){t=t.onload=t.onreadystatechange=t.onerror=null}function n(){r(),null!=e&&e(),e=null}function o(t){r(),a(t),null!=e&&e(),e=null}function i(t,e){var r=t["on"+e];null!=r&&(t["_on"+e]=r)}var a=this.options.error;i(t,"load"),i(t,"error"),u(t,{"onload":function(){if(t._onload)try{t._onload.apply(this,Array.prototype.slice.call(arguments,0))}catch(e){o({"msg":"onload handler failed "+e+" @ "+t.src})}n()},"onerror":function(){if(t._onerror)try{t._onerror.apply(this,Array.prototype.slice.call(arguments,0))}catch(e){return void o({"msg":"onerror handler failed "+e+" @ "+t.src})}o({"msg":"remote script failed "+t.src})},"onreadystatechange":function(){/^(loaded|complete)$/.test(t.readyState)&&n()}})},t.prototype._shouldRelease=function(t){var e=/^script$/i.test(t.nodeName);return!e||!!(this.options.releaseAsync&&t.src&&t.hasAttribute("async"))},t}();e["default"]=g},function(t,e,r){!function(e,r){t.exports=r()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={"exports":{},"id":n,"loaded":!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var o=r(1),i=n(o);t.exports=i["default"]},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e["default"]=t,e}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var a=r(2),s=o(a),u=r(3),c=o(u),l=r(6),p=n(l),f=r(5),h={"comment":/^<!--/,"endTag":/^<\//,"atomicTag":/^<\s*(script|style|noscript|iframe|textarea)[\s\/>]/i,"startTag":/^</,"chars":/^[^<]/},d=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,t),this.stream=r;var o=!1,a={};for(var u in s)s.hasOwnProperty(u)&&(n.autoFix&&(a[u+"Fix"]=!0),o=o||a[u+"Fix"]);o?(this._readToken=(0,p["default"])(this,a,function(){return e._readTokenImpl()}),this._peekToken=(0,p["default"])(this,a,function(){return e._peekTokenImpl()})):(this._readToken=this._readTokenImpl,this._peekToken=this._peekTokenImpl)}return t.prototype.append=function(t){this.stream+=t},t.prototype.prepend=function(t){this.stream=t+this.stream},t.prototype._readTokenImpl=function(){var t=this._peekTokenImpl();if(t)return this.stream=this.stream.slice(t.length),t},t.prototype._peekTokenImpl=function(){for(var t in h)if(h.hasOwnProperty(t)&&h[t].test(this.stream)){var e=c[t](this.stream);if(e)return"startTag"===e.type&&/script|style/i.test(e.tagName)?null:(e.text=this.stream.substr(0,e.length),e)}},t.prototype.peekToken=function(){return this._peekToken()},t.prototype.readToken=function(){return this._readToken()},t.prototype.readTokens=function(t){for(var e=void 0;e=this.readToken();)if(t[e.type]&&t[e.type](e)===!1)return},t.prototype.clear=function(){var t=this.stream;return this.stream="",t},t.prototype.rest=function(){return this.stream},t}();e["default"]=d,d.tokenToString=function(t){return t.toString()},d.escapeAttributes=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=(0,f.escapeQuotes)(t[r],null));return e},d.supports=s;for(var y in s)s.hasOwnProperty(y)&&(d.browserHasFlaw=d.browserHasFlaw||!s[y]&&y)},function(t,e){"use strict";e.__esModule=!0;var r=!1,n=!1,o=window.document.createElement("div");try{var i="<P><I></P></I>";o.innerHTML=i,e.tagSoup=r=o.innerHTML!==i}catch(t){e.tagSoup=r=!1}try{o.innerHTML="<P><i><P></P></i></P>",e.selfClose=n=2===o.childNodes.length}catch(t){e.selfClose=n=!1}o=null,e.tagSoup=r,e.selfClose=n},function(t,e,r){"use strict";function n(t){var e=t.indexOf("-->");if(e>=0)return new c.CommentToken(t.substr(4,e-1),e+3)}function o(t){var e=t.indexOf("<");return new c.CharsToken(e>=0?e:t.length)}function i(t){var e=t.indexOf(">");if(e!==-1){var r=t.match(l.startTag);if(r){var n=function(){var t={},e={},n=r[2];return r[2].replace(l.attr,function(r,o){arguments[2]||arguments[3]||arguments[4]||arguments[5]?arguments[5]?(t[arguments[5]]="",e[arguments[5]]=!0):t[o]=arguments[2]||arguments[3]||arguments[4]||l.fillAttr.test(o)&&o||"":t[o]="",n=n.replace(r,"")}),{"v":new c.StartTagToken(r[1],r[0].length,t,e,(!!r[3]),n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""))}}();if("object"===("undefined"==typeof n?"undefined":u(n)))return n.v}}}function a(t){var e=i(t);if(e){var r=t.slice(e.length);if(r.match(new RegExp("</\\s*"+e.tagName+"\\s*>","i"))){var n=r.match(new RegExp("([\\s\\S]*?)</\\s*"+e.tagName+"\\s*>","i"));if(n)return new c.AtomicTagToken(e.tagName,n[0].length+e.length,e.attrs,e.booleanAttrs,n[1])}}}function s(t){var e=t.match(l.endTag);if(e)return new c.EndTagToken(e[1],e[0].length)}e.__esModule=!0;var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.comment=n,e.chars=o,e.startTag=i,e.atomicTag=a,e.endTag=s;var c=r(4),l={"startTag":/^<([\-A-Za-z0-9_]+)((?:\s+[\w\-]+(?:\s*=?\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,"endTag":/^<\/([\-A-Za-z0-9_]+)[^>]*>/,"attr":/(?:([\-A-Za-z0-9_]+)\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))|(?:([\-A-Za-z0-9_]+)(\s|$)+)/g,"fillAttr":/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noresize|noshade|nowrap|readonly|selected)$/i}},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0,e.EndTagToken=e.AtomicTagToken=e.StartTagToken=e.TagToken=e.CharsToken=e.CommentToken=e.Token=void 0;var o=r(5),i=(e.Token=function t(e,r){n(this,t),this.type=e,this.length=r,this.text=""},e.CommentToken=function(){function t(e,r){n(this,t),this.type="comment",this.length=r||(e?e.length:0),this.text="",this.content=e}return t.prototype.toString=function(){return"<!--"+this.content},t}(),e.CharsToken=function(){function t(e){n(this,t),this.type="chars",this.length=e,this.text=""}return t.prototype.toString=function(){return this.text},t}(),e.TagToken=function(){function t(e,r,o,i,a){n(this,t),this.type=e,this.length=o,this.text="",this.tagName=r,this.attrs=i,this.booleanAttrs=a,this.unary=!1,this.html5Unary=!1}return t.formatTag=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r="<"+t.tagName;for(var n in t.attrs)if(t.attrs.hasOwnProperty(n)){r+=" "+n;var i=t.attrs[n];"undefined"!=typeof t.booleanAttrs&&"undefined"!=typeof t.booleanAttrs[n]||(r+='="'+(0,o.escapeQuotes)(i)+'"')}return t.rest&&(r+=" "+t.rest),r+=t.unary&&!t.html5Unary?"/>":">",void 0!==e&&null!==e&&(r+=e+"</"+t.tagName+">"),r},t}());e.StartTagToken=function(){function t(e,r,o,i,a,s){n(this,t),this.type="startTag",this.length=r,this.text="",this.tagName=e,this.attrs=o,this.booleanAttrs=i,this.html5Unary=!1,this.unary=a,this.rest=s}return t.prototype.toString=function(){return i.formatTag(this)},t}(),e.AtomicTagToken=function(){function t(e,r,o,i,a){n(this,t),this.type="atomicTag",this.length=r,this.text="",this.tagName=e,this.attrs=o,this.booleanAttrs=i,this.unary=!1,this.html5Unary=!1,this.content=a}return t.prototype.toString=function(){return i.formatTag(this,this.content)},t}(),e.EndTagToken=function(){function t(e,r){n(this,t),this.type="endTag",this.length=r,this.text="",this.tagName=e}return t.prototype.toString=function(){return"</"+this.tagName+">"},t}()},function(t,e){"use strict";function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t?t.replace(/([^"]*)"/g,function(t,e){return/\\/.test(e)?e+'"':e+'\\"'}):e}e.__esModule=!0,e.escapeQuotes=r},function(t,e){"use strict";function r(t){return t&&"startTag"===t.type&&(t.unary=s.test(t.tagName)||t.unary,t.html5Unary=!/\/>$/.test(t.text)),t}function n(t,e){var n=t.stream,o=r(e());return t.stream=n,o}function o(t,e){var r=e.pop();t.prepend("</"+r.tagName+">")}function i(){var t=[];return t.last=function(){return this[this.length-1]},t.lastTagNameEq=function(t){var e=this.last();return e&&e.tagName&&e.tagName.toUpperCase()===t.toUpperCase()},t.containsTagName=function(t){for(var e,r=0;e=this[r];r++)if(e.tagName===t)return!0;return!1},t}function a(t,e,a){function s(){var e=n(t,a);e&&l[e.type]&&l[e.type](e)}var c=i(),l={"startTag":function(r){var n=r.tagName;"TR"===n.toUpperCase()&&c.lastTagNameEq("TABLE")?(t.prepend("<TBODY>"),s()):e.selfCloseFix&&u.test(n)&&c.containsTagName(n)?c.lastTagNameEq(n)?o(t,c):(t.prepend("</"+r.tagName+">"),s()):r.unary||c.push(r)},"endTag":function(r){var n=c.last();n?e.tagSoupFix&&!c.lastTagNameEq(r.tagName)?o(t,c):c.pop():e.tagSoupFix&&(a(),s())}};return function(){return s(),r(a())}}e.__esModule=!0,e["default"]=a;var s=/^(AREA|BASE|BASEFONT|BR|COL|FRAME|HR|IMG|INPUT|ISINDEX|LINK|META|PARAM|EMBED)$/i,u=/^(COLGROUP|DD|DT|LI|OPTIONS|P|TD|TFOOT|TH|THEAD|TR)$/i}])})},function(t,e){"use strict";function r(t){return void 0!==t&&null!==t}function n(t){return"function"==typeof t}function o(t,e,r){var n=void 0,o=t&&t.length||0;for(n=0;n<o;n++)e.call(r,t[n],n)}function i(t,e,r){for(var n in t)t.hasOwnProperty(n)&&e.call(r,n,t[n])}function a(t,e){return t=t||{},i(e,function(e,n){r(t[e])||(t[e]=n)}),t}function s(t){try{return Array.prototype.slice.call(t)}catch(r){var e=function(){var e=[];return o(t,function(t){e.push(t)}),{"v":e}}();if("object"===("undefined"==typeof e?"undefined":f(e)))return e.v}}function u(t){return t[t.length-1]}function c(t,e){return!(!t||"startTag"!==t.type&&"atomicTag"!==t.type||!("tagName"in t))&&!!~t.tagName.toLowerCase().indexOf(e)}function l(t){return c(t,"script")}function p(t){return c(t,"style")}e.__esModule=!0;var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.existy=r,e.isFunction=n,e.each=o,e.eachKey=i,e.defaults=a,e.toArray=s,e.last=u,e.isTag=c,e.isScript=l,e.isStyle=p}])});
|
package/package.json
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
"homepage": "https://krux.github.io/postscribe",
|
5
5
|
"bugs": "https://github.com/krux/postscribe/issues",
|
6
6
|
"license": "MIT",
|
7
|
-
"version": "2.0.7",
|
8
7
|
"repository": {
|
9
8
|
"type": "git",
|
10
9
|
"url": "git://github.com/krux/postscribe.git"
|
@@ -29,7 +28,7 @@
|
|
29
28
|
"main": "dist/postscribe.js",
|
30
29
|
"browser": "dist/postscribe.js",
|
31
30
|
"dependencies": {
|
32
|
-
"prescribe": ">=1.1.
|
31
|
+
"prescribe": ">=1.1.2"
|
33
32
|
},
|
34
33
|
"devDependencies": {
|
35
34
|
"babel-core": "6.18.2",
|
@@ -116,5 +115,6 @@
|
|
116
115
|
"test:cross-browser": "gulp test:cross-browser",
|
117
116
|
"test:debug": "gulp test:debug",
|
118
117
|
"test:nocoverage": "gulp test:nocoverage"
|
119
|
-
}
|
120
|
-
|
118
|
+
},
|
119
|
+
"version": "2.0.8"
|
120
|
+
}
|