postscribe 2.0.4 → 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/.npmignore +1 -0
- package/LICENSE +2 -1
- package/README.md +17 -4
- package/dist/postscribe.js +493 -470
- package/dist/postscribe.js.map +1 -0
- package/dist/postscribe.max.js +493 -470
- package/dist/postscribe.min.js +2 -2
- package/package.json +37 -40
- package/bower.json +0 -20
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/base.css +0 -212
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/index.html +0 -97
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/prettify.css +0 -1
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/prettify.js +0 -1
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/sort-arrow-sprite.png +0 -0
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/sorter.js +0 -158
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/src/index.html +0 -123
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/src/postscribe.js.html +0 -666
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/src/utils.js.html +0 -453
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/src/write-stream.js.html +0 -1896
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov.info +0 -649
@@ -0,0 +1 @@
|
|
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;;;A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CAAuC,uCAAuC,kBAAkB;;AAEhG,yCAAwC,6BAA6B,YAAY,EAAE,OAAO,iBAAiB,mBAAmB,uBAAuB,4EAA4E,EAAE,EAAE,yBAAyB,eAAe,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;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;;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OAAO3C,QAAQ4J,GAAR,CAAP,CAAL,EAA2B;AACzB5J,eAAQ4J,GAAR,IAAenH,GAAf;AACD;AACF,IAJD;AAKA,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"," \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":""}
|