@webqit/oohtml 5.0.0 → 5.0.2
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/README.md +42 -35
- package/dist/bindings-api.js +1 -1
- package/dist/bindings-api.js.map +1 -1
- package/dist/context-api.js.map +1 -1
- package/dist/data-binding.js +14 -14
- package/dist/data-binding.js.map +2 -2
- package/dist/html-imports.js +1 -1
- package/dist/html-imports.js.map +2 -2
- package/dist/main.js +29 -29
- package/dist/main.js.map +2 -2
- package/dist/main.lite.js +50 -42
- package/dist/main.lite.js.map +3 -3
- package/dist/namespaced-html.js +1 -1
- package/dist/namespaced-html.js.map +2 -2
- package/dist/scoped-css.js +2 -2
- package/dist/scoped-css.js.map +2 -2
- package/dist/scoped-js.js.map +1 -1
- package/package.json +1 -1
- package/src/data-binding/index.js +6 -7
- package/src/html-imports/index.js +0 -1
- package/src/index.lite.js +1 -1
- package/src/namespaced-html/index.js +238 -219
- package/src/util.js +4 -4
- package/test/ii.html +0 -11
- package/test/ii2.html +0 -24
package/dist/scoped-css.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../node_modules/@webqit/util/js/isObject.js", "../node_modules/@webqit/util/js/isArray.js", "../node_modules/@webqit/util/js/isTypeFunction.js", "../node_modules/@webqit/util/js/isNull.js", "../node_modules/@webqit/util/js/isUndefined.js", "../node_modules/@webqit/util/js/isTypeObject.js", "../node_modules/@webqit/util/js/isEmpty.js", "../node_modules/@webqit/util/js/isFunction.js", "../node_modules/@webqit/util/js/isNumber.js", "../node_modules/@webqit/util/js/isNumeric.js", "../node_modules/@webqit/util/js/isString.js", "../node_modules/@webqit/util/js/isTypeArray.js", "../node_modules/@webqit/util/arr/pushUnique.js", "../node_modules/@webqit/util/obj/getPrototypeChain.js", "../node_modules/@webqit/util/obj/getAllPropertyNames.js", "../node_modules/@webqit/util/obj/mergeCallback.js", "../node_modules/@webqit/util/obj/merge.js", "../node_modules/@webqit/util/js/wq.js", "../node_modules/@webqit/util/arr/from.js", "../node_modules/@webqit/util/obj/get.js", "../node_modules/@webqit/util/obj/set.js", "../node_modules/@webqit/realdom/src/Scheduler.js", "../node_modules/@webqit/realdom/src/realtime/Util.js", "../node_modules/@webqit/realdom/src/realtime/DOMSpec.js", "../node_modules/@webqit/realdom/src/realtime/Realtime.js", "../node_modules/@webqit/realdom/src/realtime/AttrRealtime.js", "../node_modules/@webqit/realdom/src/realtime/DOMRealtime.js", "../node_modules/@webqit/realdom/src/polyfills.js", "../node_modules/@webqit/realdom/src/index.js", "../node_modules/@webqit/util/str/toTitle.js", "../src/util.js", "../src/context-api/_DOMContextRequestEvent.js", "../src/context-api/DOMContextResponse.js", "../src/context-api/DuplicateContextError.js", "../src/context-api/DOMContexts.js", "../src/context-api/DOMContext.js", "../src/namespaced-html/index.js", "../src/scoped-css/index.js", "../src/scoped-css/targets.browser.js"],
|
|
4
|
-
"sourcesContent": ["\n/**\n * Tells if val is pure object.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !Array.isArray(val) && typeof val === 'object' && val;\n};\n", "\n/**\n * Tells if val is of type \"array\".\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val);\n};\n", "\n/**\n * Tells if val is of type \"function\".\n * This holds true for both regular functions and classes.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn typeof val === 'function';\n};\n", "\n/**\n * Tells if val is undefined or is null.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val === null || val === '';\n};\n", "\n/**\n * Tells if val is undefined or is of type \"undefined\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn arguments.length && (val === undefined || typeof val === 'undefined');\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"object\".\n * This holds true for anything object, including built-ins.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val) || (typeof val === 'object' && val) || _isTypeFunction(val);\n};\n", "\n/**\n * @imports\n */\nimport _isNull from './isNull.js';\nimport _isUndefined from './isUndefined.js';\nimport _isTypeObject from './isTypeObject.js';\n\n/**\n * Tells if val is empty in its own type.\n * This holds true for NULLs, UNDEFINED, FALSE, 0,\n * objects without keys, empty arrays.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNull(val) || _isUndefined(val) || val === false || val === 0 \n\t\t|| (_isTypeObject(val) && !Object.keys(val).length);\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"function\".\n *\n * @param object \t\tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isTypeFunction(val) || (val && {}.toString.call(val) === '[object function]');\n};\n", "\n/**\n * Tells if val is of type \"number\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof Number || (typeof val === 'number');\n};\n", "\n/**\n * @imports\n */\nimport _isNumber from './isNumber.js';\n/**\n * Tells if val is of type \"string\" or a numeric string.\n * This holds true for both numbers and numeric strings.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNumber(val) || (val !== true && val !== false && val !== null && val !== '' && !isNaN(val * 1));\n};\n", "\n/**\n * Tells if val is of type \"string\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof String || (typeof val === 'string' && val !== null);\n};\n", "\n/**\n * @imports\n */\nimport _isString from './isString.js';\nimport _isUndefined from './isUndefined.js';\n\n/**\n * Tells if val is \"array-like\".\n * This holds true for anything that has a length property.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !_isString(val) && !_isUndefined(val.length);\n};\n", "\n/**\n * Adds an item if not already exist.\n *\n * @param array \tarr\n * @param array\t \t...itms\n *\n * @return array\n */\nexport default function(arr, ...items) {\n\titems.forEach(itm => {\n\t\tif (arr.indexOf(itm) < 0) {\n\t\t\tarr.push(itm);\n\t\t}\n\t});\n\treturn arr;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\n\n/**\n * Returns the prototype chain.\n *\n * @param object \t\tobj\n * @param object\t \tuntil\n *\n * @return bool\n */\nexport default function(obj, until) {\n\tuntil = until || Object.prototype;\n\tuntil = until && !_isArray(until) ? [until] : until;\n\t// We get the chain of inheritance\n\tvar prototypalChain = [];\n\tvar obj = obj;\n\twhile((obj && (!until || until.indexOf(obj) < 0) && obj.name !== 'default')) {\n\t\tprototypalChain.push(obj);\n\t\tobj = obj ? Object.getPrototypeOf(obj) : null;\n\t}\n\treturn prototypalChain;\n};\n", "\n/**\n * @imports\n */\nimport _pushUnique from '../arr/pushUnique.js';\nimport _getPrototypeChain from './getPrototypeChain.js';\n\n/**\n * Eagerly retrieves object members all down the prototype chain.\n *\n * @param object\t \tobj\n * @param object\t \tuntil\n *\n * @return array\n */\nexport default function(obj, until) {\n\tvar keysAll = [];\n\t_getPrototypeChain(obj, until).forEach(obj => {\n\t\t_pushUnique(keysAll, ...Object.getOwnPropertyNames(obj));\n\t});\n\treturn keysAll;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isObject from '../js/isObject.js';\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _getAllPropertyNames from './getAllPropertyNames.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function mergeCallback(objs, callback, deepProps = false, isReplace = false, withSymbols = false) {\n\tvar depth = 0;\n\tvar obj1 = objs.shift();\n\tif (_isNumeric(obj1) || obj1 === true || obj1 === false) {\n\t\tdepth = obj1;\n\t\tobj1 = objs.shift();\n\t}\n\tif (!objs.length) {\n\t\tthrow new Error('_merge() requires two or more array/objects.');\n\t}\n\tobjs.forEach((obj2, i) => {\n\t\tif (!_isTypeObject(obj2) && !_isFunction(obj2)) {\n\t\t\treturn;\n\t\t}\n\t\t(deepProps ? _getAllPropertyNames(obj2) : Object.keys(obj2)).forEach(key => {\n\t\t\tif (!callback(key, obj1, obj2, i)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valAtObj1 = obj1[key];\n\t\t\tvar valAtObj2 = obj2[key];\n\t\t\tif (((_isArray(valAtObj1) && _isArray(valAtObj2)) || (_isObject(valAtObj1) && _isObject(valAtObj2))) \n\t\t\t&& (depth === true || depth > 0)) {\n\t\t\t\t// RECURSE...\n\t\t\t\tobj1[key] = _isArray(valAtObj1) && _isArray(valAtObj2) ? [] : {};\n\t\t\t\tmergeCallback([_isNumeric(depth) ? depth - 1 : depth, obj1[key], valAtObj1, valAtObj2], callback, deepProps, isReplace, withSymbols);\n\t\t\t} else {\n\t\t\t\tif (_isArray(obj1) && _isArray(obj2)) {\n\t\t\t\t\tif (isReplace) {\n\t\t\t\t\t\tobj1[key] = valAtObj2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobj1.push(valAtObj2);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// In case we're setting a read-only property\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (withSymbols) {\n\t\t\t\t\t\t\tObject.defineProperty(obj1, key, Object.getOwnPropertyDescriptor(obj2, key));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tobj1[key] = obj2[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(e) {}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\treturn obj1;\n};\n", "\n/**\n * @imports\n */\nimport _mergeCallback from './mergeCallback.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function(...objs) {\n\treturn _mergeCallback(objs, (k, obj1, obj2) => {\n\t\treturn true;\n\t}, false/*deepProps*/, false/*isReplace*/, false/*withSymbols*/);\n};\n", "export default function wq(obj, ...namespaces) {\n if (!obj || !['object', 'function'].includes(typeof obj)) {\n throw new Error(`Argument #1 must be of type object`);\n }\n let wq = obj[Symbol.for('wq')];\n if (!wq) {\n wq = new WQInternals;\n Object.defineProperty(obj, Symbol.for('wq'), {\n value: wq,\n // Defaults, but to be explicit...\n enumerable: false,\n configurable: false,\n writable: false\n });\n }\n if (!namespaces.length) {\n return wq;\n }\n let _ns, _wq;\n while ((_ns = namespaces.shift())) {\n if ((_wq = wq) && !(wq = wq.get(_ns))) {\n wq = new WQInternals;\n _wq.set(_ns, wq);\n }\n }\n return wq;\n}\n\nclass WQInternals extends Map {}", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isTypeArray from '../js/isTypeArray.js';\nimport _isEmpty from '../js/isEmpty.js';\nimport _isObject from '../js/isObject.js';\n\n/**\n * Casts an array-like object to an array.\n *\n * @param mixed \tval\n * @param bool\t \tcastObject\n *\n * @return array\n */\nexport default function(val, castObject = true) {\n\tif (_isArray(val)) {\n\t\treturn val;\n\t};\n\tif (!castObject && _isObject(val)) {\n\t\treturn [val];\n\t};\n\tif (val !== false && val !== 0 && _isEmpty(val)) {\n\t\treturn [];\n\t};\n\tif (_isTypeArray(val)) {\n\t\treturn Array.prototype.slice.call(val);\n\t};\n\tif (_isObject(val)) {\n\t\treturn Object.values(val);\n\t};\n\treturn [val];\n};\n", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isUndefined from '../js/isUndefined.js';\nimport _isNull from '../js/isNull.js';\nimport _arrFrom from '../arr/from.js';\n\n/**\n * Retrieves the value at the given path.\n *\n * A return value of undefined is ambiguous, and can mean either that the\n * path does not exist, or that the path actually exists but with a value of undefined. If it is required to\n * know whether the path actually exists, pass an object as a third argument.\n * This object will have an \"exists\" key set to true/false.\n *\n * @param object \t\t\t\tctxt\n * @param array \t\t\t\tpath\n * @param object \t\t\t\ttrap\n * @param object \t\t\t\treciever\n *\n * @return mixed\n */\nexport default function(ctxt, path, trap = {}, reciever = {}) {\n\tpath = _arrFrom(path).slice();\n\tvar _ctxt = ctxt;\n\twhile(!_isUndefined(_ctxt) && !_isNull(_ctxt) && path.length) {\n\t\tvar _key = path.shift();\n\t\tif (!(trap.get ? trap.get(_ctxt, _key) : (_isTypeObject(_ctxt) ? _key in _ctxt : _ctxt[_key]))) {\n\t\t\treciever.exists = false;\n\t\t\treturn;\n\t\t}\n\t\t_ctxt = trap.get ? trap.get(_ctxt, _key) : _ctxt[_key];\n\t}\n\treciever.exists = true;\n\treturn _ctxt;\n};\n", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _isArray from '../js/isArray.js';\nimport _arrFrom from '../arr/from.js';\nimport _get from './get.js';\n\n/**\n * Sets a value to the given path.\n *\n * @param object \t\t\t\tobj\n * @param array \t\t\t\tpath\n * @param mixed \t\t\t\tval\n * @param object|function \t\tbuildTree\n * @param object \t\t\t\ttrap\n *\n * @return bool\n */\nexport default function(obj, path, val, buildTree = {}, trap = {}) {\n\tconst _set = (target, key, val) => {\n\t\tif (trap.set) {\n\t\t\treturn trap.set(target, key, val);\n\t\t} else {\n\t\t\tif (_isNumeric(path[i]) && _isArray(target)) {\n\t\t\t\ttarget.push(val);\n\t\t\t} else {\n\t\t\t\ttarget[key] = val;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t};\n\tpath = _arrFrom(path);\n\tvar target = obj;\n\tfor(var i = 0; i < path.length; i ++) {\n\t\tif (i < path.length - 1) {\n\t\t\tif (!target || (!_isTypeObject(target) && !_isFunction(target))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar branch = _get(target, path[i], trap);\n\t\t\tif (!_isTypeObject(branch)) {\n\t\t\t\tif (trap.buildTree === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbranch = _isFunction(trap.buildTree) ? trap.buildTree(i) : (_isNumeric(path[i + 1]) ? [] : {});\n\t\t\t\tvar branchSuccess = _set(target, path[i], branch);\n\t\t\t\tif (!branchSuccess) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttarget = branch;\n\t\t} else {\n\t\t\treturn _set(target, path[i], val);\n\t\t}\n\t}\n};\n", "\n/**\n * ---------------------------\n * Binds callbacks to requestAnimationFrame()\n * to create a central \"read/write\" phases for Ctxt access.\n * ---------------------------\n */\n\t\t\t\nexport default class Scheduler {\n\n\t/**\n\t * Starts the loop.\n\t *\n\t * @return this\n\t */\n\tconstructor( window, synthesis = false ) {\n\t\tObject.defineProperty( this, 'window', { value: window } );\n\t\tObject.defineProperty( this, 'readCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, 'writeCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, '_synthesis', { value: 0, writable: true } );\n\t\tif ( !synthesis && this.window.requestAnimationFrame ) {\n\t\t\tthis._loop();\n\t\t} else { this._synthesis ++; }\n\t}\n\n\tget synthesis() { return this._synthesis; }\n\n\tasync synthesizeWhile( callback ) {\n\t\tthis._synthesis ++;\n\t\tthis._fulfill();\n\t\tconst returnValue = await callback();\n\t\tthis._synthesis --;\n\t\treturn returnValue;\n\t}\n\n\t_fulfill() {\n\t\tfor ( const callback of this.readCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.readCallbacks.delete( callback );\n\t\t}\n\t\tfor ( const callback of this.writeCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.writeCallbacks.delete( callback );\n\t\t}\n\t}\n\n\t_loop() {\n\t\tthis.window.requestAnimationFrame( () => {\n\t\t\tthis._fulfill();\n\t\t\tthis._loop();\n\t\t} );\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"read\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonread( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.readCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.readCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"write\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonwrite( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.writeCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.writeCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * A special construct for Ctxt manipulations that span\n\t * one or more read/write cycles.\n\t *\n\t * @param function \tread\n\t * @param function \twrite\n\t * @param mixed\t\tprevTransaction\n\t *\n\t * @return void|mixed\n\t */\n\tcycle( onread, onwrite, prevTransaction ) {\n\t\tthis.onread( () => {\n\t\t\t// Record initial values\n\t\t\tconst readReturn = onread( prevTransaction );\n\t\t\t// Call erite, the transation\n\t\t\tconst callWrite = ( readReturn ) => {\n\t\t\t\tif ( readReturn === undefined ) return;\n\t\t\t\tthis.onwrite( () => {\n\t\t\t\t\tconst writeReturn = onwrite( readReturn, prevTransaction );\n\t\t\t\t\t// Repeat transaction\n\t\t\t\t\tconst repeatTransaction = ( writeReturn ) => {\n\t\t\t\t\t\tif ( writeReturn === undefined ) return;\n\t\t\t\t\t\tthis.cycle( onread, onwrite, writeReturn );\n\t\t\t\t\t};\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\t// If \"write\" returns a promise, we wait until it is resolved\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\tif ( writeReturn instanceof Promise ) {\n\t\t\t\t\t\twriteReturn.then( repeatTransaction );\n\t\t\t\t\t} else {\n\t\t\t\t\t\trepeatTransaction( writeReturn );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\t\t\t// ---------------------------------------\n\t\t\t// If \"read\" returns a promise, we wait until it is resolved\n\t\t\t// ---------------------------------------\n\t\t\tif ( readReturn instanceof Promise ) {\n\t\t\t\treadReturn.then( callWrite );\n\t\t\t} else {\n\t\t\t\tcallWrite( readReturn );\n\t\t\t}\n\t\t} );\n\t}\n\n}", "\n\nexport function isXpath( expr ) { return ( expr = expr.trim() ) && expr.startsWith( '(' ) && expr.endsWith( ')' ) }\n\nexport function xpathQuery( window, context, expr, subtree = true ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', subtree ? '(.//' : '(./' ) ).join( '|' );\n let nodes = [], node;\n try {\n // Throws in firefox and safari where context is a text node\n const result = window.document.evaluate( expr, context, null, window.XPathResult.ANY_TYPE );\n while ( node = result.iterateNext() ) nodes.push( node );\n } catch( e ) {}\n return nodes;\n}\n\nexport function xpathMatch( window, node, expr ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', '(self::' ) ).join( '|' );\n try {\n // Throws in firefox and safari where context is a text node and query isn't\n return window.document.evaluate( `${ expr }`, node, null, window.XPathResult.BOOLEAN_TYPE ).booleanValue;\n } catch( e ) {}\n}\n\nexport function containsNode( window, a, b, crossRoots = false, testCache = null ) {\n const prevTest = testCache?.get( a )?.get( b );\n if ( typeof prevTest !== 'undefined' ) return prevTest;\n const response = val => {\n if ( !testCache?.has( a ) ) testCache?.set( a, new WeakMap );\n testCache?.get( a )?.set( b, val );\n return val;\n };\n const rootNodeA = a.getRootNode();\n const rootNodeB = b.getRootNode();\n if ( rootNodeA === rootNodeB ) return response( a.contains( b ) );\n if ( crossRoots && rootNodeB instanceof window.ShadowRoot ) return response( containsNode( window, a, rootNodeB.host, crossRoots, testCache ) );\n return response( false );\n}\n\nexport function splitOuter( str, delim = '|' ) {\n return [ ...str ].reduce( ( [ quote, depth, splits, skip ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}", "\n/**\n * @imports\n */\nimport * as Util from './Util.js';\n\nexport default class DOMSpec {\n constructor( content ) {\n this.content = content;\n this.type = typeof content === 'string' ? 'selector' : 'instance';\n this.kind = this.type === 'instance' ? null : Util.isXpath( content ) ? 'xpath' : 'css';\n if ( this.kind === 'xpath' ) {\n this.isXpathAttr = Util.splitOuter( content.trim().slice( 1, -1 ), '@' ).length > 1;\n }\n }\n toString() { return this.content; }\n}", "\n/**\n * @imports\n */\nimport { _isFunction, _isObject, _wq } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport DOMSpec from './DOMSpec.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class Realtime\n */\nexport default class Realtime {\n\n\t/**\n\t * @constructor\n\t *\n\t * @param document|Element\tcontext\n\t */\n\tconstructor( context, namespace, window ) {\n\t\tthis.context = context;\n\t\tthis.namespace = namespace;\n\t\tthis.window = context.defaultView || context.ownerDocument?.defaultView || window;\n\t\tthis.document = this.window.document;\n\t\tthis.webqit = this.window.webqit;\n\t\tObject.defineProperty( this, '#', { value: {} } );\n\t}\n\t\n\t/**\n\t * Resolves arguments\n\t * \n\t * @param Array \t\t\targs \n\t * \n\t * @returns Array\n\t */\n\tresolveArgs( args ) {\n\t\tif ( _isFunction( args[ 0 ] ) ) { args = [ [], ...args ]; }\n\t\telse if ( _isObject( args[ 0 ] ) && !( args[ 0 ] instanceof DOMSpec ) && args.length === 1 ) {\n\t\t\targs = [ [], undefined, args[ 0 ] ];\n\t\t} else if ( _isObject( args[ 1 ] ) && args.length === 2 ) {\n\t\t\targs = [ _arrFrom( args[ 0 ], false/*castObject*/ ), undefined, args[ 1 ] ];\n\t\t} else { args[ 0 ] = _arrFrom( args[ 0 ], false/*castObject*/ ); }\n\t\tif ( args[ 0 ].filter( x => typeof x !== 'string' && !( x instanceof DOMSpec ) && !( x instanceof this.window.Node ) ).length ) {\n\t\t\tthrow new Error( `Argument #2 must be either a string or a Node object, or a list of those.` );\n\t\t}\n\t\targs[ 0 ] = args[ 0 ].map( s => s instanceof DOMSpec ? s : new DOMSpec( s ) );\n\t\treturn args;\n\t}\n\n\t/**\n\t * @registry\n\t *\n\t * @param Array\t\t\t\t...args\n\t * \n\t * @returns Map\n\t */\n\tregistry( ...args ) {\n\t\treturn _wq( this.window, 'realdom', this.namespace, ...args );\n\t}\n\t\t\n\t/**\n\t * @createSignalGenerator\n\t * \n\t * @param Object \t\t\tmo \n\t * \n\t * @returns Object\n\t */\n\tcreateSignalGenerator() {\n\t\treturn {\n\t\t\tgenerate() {\n\t\t\t\t// Abort previous\n\t\t\t\tthis.lastController?.abort();\n\t\t\t\tthis.lastController = new AbortController;\n\t\t\t\tconst flags = { signal: this.lastController.signal };\n\t\t\t\treturn flags;\n\t\t\t},\n\t\t\tdisconnect() { this.lastController?.abort(); }\n\t\t}\n\t}\n\t\t\n\t/**\n\t * Loops through registration objects whose contexts match the event context.\n\t * \n\t * @param String \t\tinterceptionTiming\n\t * @param Object|Array \trecord_s\n\t * @param Function \t\tcallback \n\t * \n\t * @returns void\n\t */\n\tforEachMatchingContext( interceptionTiming, record_s, callback ) {\n\t\tconst { window } = this, deferreds = new Set, testCache = new WeakMap;\n\t\tfor ( const [ registration, deferred ] of this.registry( interceptionTiming ) ) {\n\t\t\tlet $records = [].concat( record_s ).filter( record => Util.containsNode( window, registration.context, record.target, registration.params.subtree === 'cross-roots', testCache ) );\n\t\t\tif ( !$records.length ) continue;\n\t\t\tconst args = [ registration, Array.isArray( record_s ) ? $records : $records[ 0 ] ];\n\t\t\tif ( deferred ) deferreds.add( args ); else callback.call( window, ...args );\n\t\t}\n\t\tfor ( const args of deferreds ) callback.call( window, ...args );\n\t\tdeferreds.clear();\n\t}\n\n\t/**\n\t * @disconnectables\n\t * \n\t * @param AbortSignal \t\tsignal\n\t * @param Array \t\t\t...objects \n\t * \n\t * @returns Object\n\t */\n\tdisconnectables( signal, ...objects ) {\n\t\tconst disconnectable = { disconnect() {\n\t\t\tobjects.forEach( d => (\n\t\t\t\td && _isFunction( d.disconnect ) && d.disconnect() \n\t\t\t\t|| _isFunction( d ) && d() \n\t\t\t\t|| _isObject( d ) && ( d.disconnected = true )\n\t\t\t) );\n\t\t} };\n\t\tif ( signal ) signal.addEventListener( 'abort', () => disconnectable.disconnect() );\n\t\treturn disconnectable;\n\t}\n}\n", "\n/**\n * @imports\n */\nimport { _wq } from '@webqit/util/js/index.js';\nimport Realtime from './Realtime.js';\nimport DOMSpec from './DOMSpec.js';\n\n/**\n *\n * @class AttrRealtime\n */\nexport default class AttrRealtime extends Realtime {\n\n\ttype = 'attr';\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'attr', ...args );\n\t}\n\t\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tget( spec, callback = undefined, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// -------------\n\t\tconst records = attrIntersection( context, spec );\n\t\tif ( !callback ) return records;\n\t\tconst signalGenerator = params.lifecycleSignals && this.createSignalGenerator();\n\t\tif ( !originalFilterIsString ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( records, flags, context );\n\t\t} else {\n\t\t\tfor ( const record of records ) {\n\t\t\t\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\t\t\t\tcallback( record, flags, context );\n\t\t\t}\n\t\t}\n\t\t// -------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( originalFilterIsString ? spec[ 0 ] : spec, callback, { newValue: true, ...params } );\n\t\t\treturn this.disconnectables( params.signal, disconnectable_live );\n\t\t}\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( originalFilterIsString ? spec[ 0 ] : spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails && !webqit.realdom.attrInterceptionHooks?.intercepting ) {\n\t\t\tattrInterception.call( window, 'intercept', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => {\n\t\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\t\tdispatch.call( window, registration, records, context );\n\t\t} );\n\t\t// ------------------\n\t\tconst $params = { attributes: true, attributeOldValue: params.oldValue, subtree: params.subtree && true };\n\t\tif ( spec.length ) { $params.attributeFilter = spec.map( a => a + '' ); }\n\t\tdisconnectable.observe( context, $params );\n\t\t// -------------\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tattrInterception.call( window, interceptionTiming, records => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, records, dispatch );\n\t\t\t} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() { registry.delete( registration ); } };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n}\n\n/**\n * Deduplicates records.\n * \n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction dedupAndIgnoreInternals( records ) {\n\treturn records.reduce( ( rcds, rcd, i ) => {\n\t\tif ( rcds[ i - 1 ]?.attributeName === rcd.attributeName ) return rcds;\n\t\tif ( _wq( rcd.target, 'realdom', 'internalAttrInteractions' ).get( rcd.attributeName ) ) return rcds;\n\t\treturn rcds.concat( rcd );\n\t}, [] );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration\n * @param Array \t\t\trecords\n * \n * @returns Void\n */\nfunction dispatch( registration, records ) {\n\tconst { context, spec, callback, params, atomics, originalFilterIsString, signalGenerator } = registration;\n\tif (!params.subtree) {\n\t\trecords = records.filter((r) => {\n\t\t\treturn r.target === context;\n\t\t}); \n\t}\n\tif ( !records.length ) return;\n\tconst $spec = spec.map( a => a + '' );\n\tif ( params.atomic && !atomics.size ) {\n\t\trecords = attrIntersection( context, spec, records );\n\t} else if ( params.timing !== 'async' && spec.length ) {\n\t\trecords = records.filter( r => $spec.includes( r.name ) );\n\t}\n\tif ( !records.length ) return;\n\t// Should we care about old / new values being present?\n\tif ( !( params.newValue === null && params.oldValue === null && params.eventDetails ) ) {\n\t\trecords = records.map( rcd => {\n\t\t\tlet exclusion;\n\t\t\tif ( !params.eventDetails ) {\n\t\t\t\t( { event: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.oldValue && ( 'oldValue' in rcd ) ) {\n\t\t\t\t( { oldValue: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.newValue && ( 'value' in rcd ) ) {\n\t\t\t\t( { value: exclusion, ...rcd } = rcd );\n\t\t\t} else if ( params.newValue && typeof rcd.value === 'undefined' ) {\n\t\t\t\trcd = { ...rcd, value: internalAttrInteraction( rcd.target, rcd.name, () => rcd.target.getAttribute( rcd.name ) ) };\n\t\t\t}\n\t\t\treturn rcd;\n\t\t} );\n\t}\n\tif ( params.atomic ) {\n\t\trecords.forEach( record => atomics.set( record.name, record ) );\n\t\trecords = Array.from( atomics.entries() ).map( ( [ , value ] ) => value );\n\t}\n\tconst record_s = originalFilterIsString ? records[ 0 ] : records;\n\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\tcallback( record_s, flags, context );\n}\n\n/**\n */\nfunction internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = _wq( node, 'realdom', 'internalAttrInteractions' ).get( attrName );\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\n/**\n * Helper to determining which records to deliver.\n * \n * @param Object \t\t\tcontext\n * @param Array \t\t\tspec\n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction attrIntersection( context, spec, records = [] ) {\n\tconst _type = { event: null, type: 'attribute' };\n\tif ( spec.length ) {\n\t\treturn spec.map( attrName => {\n\t\t\tattrName = attrName + '';\n\t\t\treturn records.find( r => r.name === attrName ) || { target: context, name: attrName, value: internalAttrInteraction( context, attrName, () => context.getAttribute( attrName ) ), ..._type };\n\t\t} );\n\t}\n\tconst attrs = Array.from( context.attributes );\n\treturn attrs.map( attr => {\n\t\treturn records.find( r => r.name === attr.nodeName ) || { target: context, name: attr.nodeName, value: internalAttrInteraction( context, attr.nodeName, () => attr.nodeValue ), ..._type };\n\t} );\n}\n\n/**\n * Determines the event for an attr mutation record.\n * \n * @param MutationRecord \t{ target, attributeName }\n * \n * @returns Object\n */\nfunction withAttrEventDetails( { target, attributeName, value, oldValue } ) {\n\tconst window = this, registry = window.webqit.realdom.attrInterceptionRecords?.get( target ) || {};\n\tconst event = registry[ attributeName ]?.[ 0 ] || 'mutation';\n\tconst record = { target, name: attributeName, value, oldValue, type: 'observation', event };\n\treturn record;\n}\n\n/**\n * Attributes intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction attrInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Element } = window;\n\tif ( !webqit.realdom.attrInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'attrInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.attrInterceptionHooks.has( timing ) ) { webqit.realdom.attrInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.attrInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.attrInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.attrInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `Attr mutation APIs are now being intercepted.` );\n\twebqit.realdom.attrInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'attrInterceptionRecords', { value: new Map } );\n\n\t// Interception hooks\n\tconst attrIntercept = ( record, defaultAction ) => {\n\t\tif ( !webqit.realdom.attrInterceptionRecords.has( record.target ) ) { webqit.realdom.attrInterceptionRecords.set( record.target, {} ); }\n\t\tconst registry = webqit.realdom.attrInterceptionRecords.get( record.target );\n\t\t// ------------------\n\t\tregistry[ record.name ] = registry[ record.name ] || [];\n\t\tregistry[ record.name ].unshift( record.event );\n\t\tif ( _wq( record.target, 'realdom', 'internalAttrInteractions' ).get( record.name ) ) return defaultAction();\n\t\t// ------------------\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( [ record ] ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( [ record ] ) );\n\t\treturn returnValue;\n\t};\n\n\t// Interception observer WILL need to know non-API-based mutations\n\tconst mo = new window.MutationObserver( records => {\n\t\trecords = records.filter( rcd => {\n\t\t\tconst registry = window.webqit.realdom.attrInterceptionRecords?.get( rcd.target ) || {};\n\t\t\treturn !registry[ rcd.attributeName ]?.shift();\n\t\t} );\n\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\tif ( !records.length ) return;\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( records ) );\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( records ) );\n\t} );\n\tmo.observe( document, { attributes: true, subtree: true, attributeOldValue: true } );\n\n\t// Intercept DOM attr mutation methods\n\tconst originalApis = Object.create( null );\n\t[ 'setAttribute', 'removeAttribute', 'toggleAttribute', ].forEach( apiName => {\n\t\toriginalApis[ apiName ] = Element.prototype[ apiName ];\n\t\tElement.prototype[ apiName ] = function( ...args ) {\n\t\t\tlet value, oldValue = internalAttrInteraction( this, args[ 0 ], () => this.getAttribute( args[ 0 ] ) );\n\t\t\tif ( [ 'setAttribute', 'toggleAttribute' ].includes( apiName ) ) { value = args[ 1 ]; }\n\t\t\tif ( apiName === 'toggleAttribute' && value === undefined ) {\n\t\t\t\tvalue = oldValue === null ? true : false;\n\t\t\t}\n\t\t\tconst record = { target: this, name: args[ 0 ], value, oldValue, type: 'interception', event: [ this, apiName ] };\n\t\t\tconst exec = () => originalApis[ apiName ].call( this, ...args );\n\t\t\treturn attrIntercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\n/**\n * @imports\n */\nimport { _isObject } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport AttrRealtime from './AttrRealtime.js';\nimport Realtime from './Realtime.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class DOMRealtime\n */\nexport default class DOMRealtime extends Realtime {\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'tree', ...args );\n\t}\n\n\t/**\n\t * Alias for ( new AttrRealtime() ).all( ... )\n\t */\n\tattr( filter, callback = undefined, params = {} ) {\n\t\tconst { context, window } = this;\n\t\treturn ( new AttrRealtime( context, window ) ).get( ...arguments );\n\t}\n\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tquery( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// ------------------\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'query', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ------------------\n\t\tif ( !params.generation || params.generation === 'entrants' ) {\n\t\t\tif ( !spec.length ) {\n\t\t\t\t//if ( params.subtree ) throw new Error( `The subtree option requires a selector to work.` );\n\t\t\t\t[ ...context.children ].forEach( node => getRecord( context ).entrants.push( node ) );\n\t\t\t} else if ( spec.every( s => s.type === 'selector' ) ) {\n\t\t\t\tconst [ cssSelectors, xpathQueries ] = spec.reduce( ( [ css, xpath ], s ) => {\n\t\t\t\t\treturn s.kind === 'xpath' ? [ css, xpath.concat( s ) ] : [ css.concat( s ), xpath ];\n\t\t\t\t}, [ [], [] ] );\n\t\t\t\tconst matches = [];\n\t\t\t\tif ( params.subtree ) {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...context.querySelectorAll( cssSelectors.join( ',' ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries ) ); }\n\t\t\t\t} else {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...[ ...context.children ].filter( node => node.matches( cssSelectors ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries, false ) ); }\n\t\t\t\t}\n\t\t\t\tmatches.forEach( node => getRecord( node.parentNode || context ).entrants.push( node ) );\n\t\t\t}\n\t\t}\n\t\t// ------------------\n\t\tif ( !callback ) return records;\n\t\tconst disconnectable = { disconnected: false };\n\t\tconst signalGenerator = callback && params.lifecycleSignals && this.createSignalGenerator();\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tif ( disconnectable.disconnected ) break;\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t\t// ------------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( spec, callback, params );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, disconnectable_live );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: false } )\n\t */\n\tchildren( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: false } );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: true } )\n\t */\n\tsubtree( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: true } );\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit, document } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails ) { webqit.realdom.domInterceptionRecordsAlwaysOn = true; }\n\t\tif ( ( document.readyState === 'loading' || webqit.realdom.domInterceptionRecordsAlwaysOn ) && !webqit.realdom.domInterceptionHooks?.intercepting ) {\n\t\t\tdomInterception.call( window, 'sync', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tdispatch.call( window, registration, withEventDetails.call( window, record ), context );\n\t\t} ) );\n\t\tdisconnectable.observe( context, { childList: true, subtree: params.subtree && true, } );\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\t\t\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tdomInterception.call( window, interceptionTiming, record => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, record, dispatch );\n\t\t\t} );\n\t\t}\n\t\tconst mo = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tif ( Array.isArray( ( record = withEventDetails.call( window, record ) ).event ) ) return;\n\t\t\tdispatch.call( window, registration, record, context );\n\t\t} ) );\n\t\tmo.observe( context, { childList: true, subtree: params.subtree && true } );\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() {\n\t\t\tregistry.delete( registration );\n\t\t\tmo.disconnect();\n\t\t} };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Tracks the connectedness of element references.\n\t *\n\t * @param array|Element\t\t\t\telements\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable\n\t */\n\ttrack( elements, callback, params = {} ) {\n\t\tparams = { subtree: true, ...params };\n\t\treturn this.observe( elements, record => {\n\t\t\tif ( record.entrants.length ) callback( true, Array.isArray( elements ) ? record.entrants : record.entrants[ 0 ] );\n\t\t\tif ( record.exits.length ) callback( false, Array.isArray( elements ) ? record.exits : record.exits[ 0 ] );\n\t\t}, params );\n\t}\n}\n\n/**\n * Sensitivty for attribute changes for attribute spec.\n * \n * @param object registration\n * \n * @returns Disconnectable\n */\nfunction staticSensitivity( registration ) {\n\tconst window = this;\n\tconst { context, spec, callback, params, signalGenerator } = registration;\n\tconst cssSelectors = spec.filter( s => s.kind === 'css' );\n\tconst parseDot = selector => selector.match( /\\.([\\w-]+)/g )?.length ? [ 'class' ] : [];\n\tconst parseHash = selector => selector.match( /#([\\w-]+)/g )?.length ? [ 'id' ] : [];\n\tconst parse = selector => [ ...selector.matchAll( /\\[([^\\=\\]]+)(\\=[^\\]]+)?\\]/g ) ].map( x => x[ 1 ] ).concat( parseDot( selector ) ).concat( parseHash( selector ) );\n\tif ( !( registration.$attrs = Array.from( new Set( cssSelectors.filter( s => ( s + '' ).includes( '[' ) ).reduce( ( attrs, selector ) => attrs.concat( parse( selector + '' ) ), [] ) ) ) ).length ) return;\n\t// ---------\n\tconst entrants = new Set, exits = new Set;\n\tentrants.push = val => ( exits.delete( val ), entrants.add( val ) );\n\texits.push = val => ( entrants.delete( val ), exits.add( val ) );\n\tregistration.$deliveryCache = { entrants, exits };\n\t// ---------\n\treturn ( new AttrRealtime( context, window ) ).observe( registration.$attrs, _records => {\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'static', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ---------\n\t\tconst matchesCache = new WeakMap;\n\t\tconst matches = node => {\n\t\t\tif ( !matchesCache.has( node ) ) { matchesCache.set( node, cssSelectors.some( s => node.matches( s + '' ) ) ); }\n\t\t\treturn matchesCache.get( node );\n\t\t};\n\t\t// ---------\n\t\tfor ( const _record of _records ) {\n\t\t\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\t\t\tif ( params.generation && generation !== params.generation ) return;\n\t\t\t\tif ( registration.$deliveryCache[ generation ].has( _record.target ) || ( generation === 'entrants' ? !matches( _record.target ) : matches( _record.target ) ) ) return;\n\t\t\t\tregistration.$deliveryCache[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target )[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target ).event = _record.event;\n\t\t\t} );\n\t\t}\n\t\t// ---------\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t}, { subtree: params.subtree, timing: params.timing, eventDetails: params.eventDetails } );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration \n * @param Object \t\t\trecord \n * \n * @returns Void\n */\nfunction dispatch( registration, _record ) {\n\tconst { context, spec, callback, params, signalGenerator, $deliveryCache } = registration;\n\t// ---------\n\tconst record = { ..._record, entrants: [], exits: [] };\n\tif ( !params.eventDetails ) { delete record.event; }\n\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\tif ( params.generation && generation !== params.generation ) return;\n\t\tif ( spec.length ) {\n\t\t\trecord[ generation ] = nodesIntersection.call( this, spec, params.subtree === 'cross-roots', _record[ generation ], _record.event !== 'parse' );\n\t\t} else {\n\t\t\trecord[ generation ] = [ ..._record[ generation ] ];\n\t\t}\n\t\tif ( !$deliveryCache ) return;\n\t\tfor ( const node of record[ generation ] ) {\n\t\t\t$deliveryCache[ generation ].push( node );\n\t\t}\n\t} );\n\t// ---------\n\tif ( !record.entrants.length && !record.exits.length ) return;\n\tconst flags = signalGenerator?.generate() || {};\n\tcallback( record, flags, context );\n}\n\n/**\n * Aggregates instances of els in sources\n * \n * @param Array \t\t\tspec \n * @param Bool \t\t\t\tcrossRoots \n * @param Array \t\t\tsources \n * @param Bool \t\t\t\tdeepIntersect \n * \n * @returns \n */\nfunction nodesIntersection( spec, crossRoots, sources, deepIntersect ) {\n\tsources = Array.isArray( sources ) ? sources : [ ...sources ];\n\tconst match = ( sources, s ) => {\n\t\t// Filter out text nodes\n\t\tif ( s.type === 'selector' ) {\n\t\t\t// Is directly mutated...\n\t\t\tlet matches = s.isXpathAttr ? [] : sources.filter( source => s.kind === 'xpath' ? Util.xpathMatch( this, source, s + '' ) : source.matches && source.matches( s + '' ) );\n\t\t\t// Is contextly mutated...\n\t\t\tif ( deepIntersect || s.isXpathAttr ) {\n\t\t\t\tmatches = sources.reduce( ( collection, source ) => {\n\t\t\t\t\tif ( s.kind === 'xpath' ) { return [ ...collection, ...Util.xpathQuery( this, source, s, deepIntersect ) ]; }\n\t\t\t\t\treturn source.querySelectorAll ? [ ...collection, ...source.querySelectorAll( s + '' ) ] : collection;\n\t\t\t\t}, matches );\n\t\t\t}\n\t\t\tif ( matches.length ) return matches;\n\t\t} else {\n\t\t\t// Is directly mutated...\n\t\t\tif ( sources.includes( s.content ) || (\n\t\t\t\tdeepIntersect && sources.some( source => Util.containsNode( this/* window */, source, s.content, crossRoots ) )\n\t\t\t) ) { return [ s.content ]; }\n\t\t}\n\t};\n\t// Search can be expensive...\n\t// Multiple listeners searching the same thing in the same list?\n\tif ( !sources.$$searchCache ) { sources.$$searchCache = new Map; }\n\treturn spec.reduce( ( matches, s ) => {\n\t\tlet _matches;\n\t\tif ( sources.$$searchCache.has( s.content ) ) {\n\t\t\t_matches = sources.$$searchCache.get( s.content );\n\t\t} else {\n\t\t\t_matches = match( sources, s ) || [];\n\t\t\tif ( s.type === 'instance' ) {\n\t\t\t\tsources.$$searchCache.set( s.content, _matches );\n\t\t\t}\n\t\t}\n\t\treturn matches.concat( _matches );\n\t}, [] );\n}\n\n/**\n * Determines the event for a mutation record\n * \n * @param MutationRecord \t{ target, entrants, exits }\n * \n * @returns Object\n */\nfunction withEventDetails( { target, addedNodes, removedNodes } ) {\n\tlet window = this, event;\n\tevent = _arrFrom( addedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), null );\n\tevent = _arrFrom( removedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), event );\n\tevent = event || window.document.readyState === 'loading' && 'parse' || 'mutation';\n\treturn { target, entrants: addedNodes, exits: removedNodes, type: 'observation', event };\n}\n\n/**\n * DOM intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction domInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Node, CharacterData, Element, HTMLElement, HTMLTemplateElement, DocumentFragment } = window;\n\tif ( !webqit.realdom.domInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'domInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionNoRecurse ) { Object.defineProperty( webqit.realdom, 'domInterceptionNoRecurse', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionHooks.has( timing ) ) { webqit.realdom.domInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.domInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.domInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.domInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `DOM mutation APIs are now being intercepted.` );\n\twebqit.realdom.domInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'domInterceptionRecords', { value: new Map } );\n\n\t// No recursion helper\n\tconst noRecurse = ( node, method, callback ) => {\n\t\twebqit.realdom.domInterceptionNoRecurse.set( node, method );\n\t\tconst returnValue = callback();\n\t\twebqit.realdom.domInterceptionNoRecurse.delete( node );\n\t\treturn returnValue;\n\t};\n\n\t// Interception hooks\n\tconst intercept = ( record, defaultAction ) => {\n\t\trecord.entrants.concat( record.exits ).forEach( node => {\n\t\t\tclearTimeout( webqit.realdom.domInterceptionRecords.get( node )?.timeout ); // Clear any previous that's still active\n\t\t\twebqit.realdom.domInterceptionRecords.set( node, record.event ); // Main: set event details... and next to timeout details\n\t\t\tconst timeout = setTimeout( () => { webqit.realdom.domInterceptionRecords.delete( node ); }, 0 );\n\t\t\tObject.defineProperty( record.event, 'timeout', { value: timeout, configurable: true } );\n\t\t} );\n\t\twebqit.realdom.domInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( record ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.domInterceptionHooks.get( 'sync' )?.forEach( callback => callback( record ) );\n\t\treturn returnValue;\n\t};\n\n\t// Intercept DOM mutation methods\n\tconst _apiNames = {\n\t\t// Note the order\n\t\tShadowRoot: [ 'innerHTML', 'setHTMLUnsafe' ],\n\t\tDocumentFragment: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tDocument: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tHTMLElement: [ 'outerText', 'innerText' ],\n\t\tElement: [ 'append', 'prepend', 'before', 'after', 'insertAdjacentElement', 'insertAdjacentHTML', 'remove', 'replaceChildren', 'replaceWith', 'setHTMLUnsafe', 'innerHTML', 'outerHTML' ],\n\t\tCharacterData: [ 'before', 'after', 'remove', 'replaceWith' ],\n\t\tNode: [ 'insertBefore', 'replaceChild', 'removeChild', 'appendChild', 'textContent', 'nodeValue' ],\n\t};\n\tconst _apiOriginals = {\n\t\t// Note the order\n\t\tShadowRoot: Object.create( null ), // extends DocumentFragment\n\t\tDocumentFragment: Object.create( null ), // extends Node\n\t\tDocument: Object.create( null ), // extends Node\n\t\tHTMLElement: Object.create( null ), // extends Element,\n\t\tElement: Object.create( null ), // extends Node\n\t\tCharacterData: Object.create( null ), // extends Node\n\t\tNode: Object.create( null ),\n\t};\n\n\tconst _apiNamesUnique = new Set( Object.values( _apiNames ).reduce( ( all, apis ) => all.concat( apis ), [] ) );\n\t_apiNamesUnique.forEach( apiName => {\n\t\t\n\t\tObject.keys( _apiNames ).forEach( DOMClassName => {\n\t\t\tif ( !_apiNames[ DOMClassName ].includes( apiName ) ) return;\n\t\t\tconst _apiOriginal = Object.getOwnPropertyDescriptor( window[ DOMClassName ].prototype, apiName );\n\t\t\tif ( !_apiOriginal ) return; // Typically: Element:setHTMLUnsafe\n\t\t\tObject.defineProperty( window[ DOMClassName ].prototype, apiName, 'value' in _apiOriginal ? { ..._apiOriginal, value: method } : { ..._apiOriginal, set: setter } );\n\t\t\t_apiOriginals[ DOMClassName ][ apiName ] = _apiOriginal;\n\t\t} );\n\n\t\tfunction method( ...args ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\tif ( webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'insertBefore' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'insertAdjacentElement', 'insertAdjacentHTML' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 1 ] ];\n\t\t\t\tif ( [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t} else if ( [ 'setHTMLUnsafe', 'replaceChildren' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\tentrants = apiName === 'replaceChildren' ? [ ...args ] : [ args[ 0 ] ];\n\t\t\t} else if ( [ 'replaceWith', 'remove' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\tentrants = apiName === 'replaceWith' ? [ ...args ] : [];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else if ( [ 'replaceChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ args[ 1 ] ];\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'removeChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...args ];\n\t\t\t} else {\n\t\t\t\t// 'before', 'after', 'append', 'prepend', 'appendChild'\n\t\t\t\tentrants = [ ...args ];\n\t\t\t\tif ( [ 'before', 'after' ].includes( apiName ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to entrants\n\t\t\tlet apiNameFinal = apiName;\n\t\t\tif ( [ 'insertAdjacentHTML', 'setHTMLUnsafe' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'insertAdjacentHTML' && [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\t$apiOriginals.setHTMLUnsafe.value.call( temp, entrants[ 0 ], apiName === 'setHTMLUnsafe' ? args[ 1 ] : {} );\n\t\t\t\tentrants = [ ...temp.childNodes ];\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'insertAdjacentHTML' ) {\n\t\t\t\t\tapiNameFinal = 'insertAdjacentElement';\n\t\t\t\t\targs[ 1 ] = new DocumentFragment;\n\t\t\t\t\tnoRecurse( args[ 1 ], 'append', () => args[ 1 ].append( ...temp.childNodes ) );\n\t\t\t\t} else {\n\t\t\t\t\tapiNameFinal = 'replaceChildren';\n\t\t\t\t\targs = [ ...temp.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tif ( !target ) return exec();\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, () => {\n\t\t\t\treturn $apiOriginals[ apiNameFinal ].value.call( this, ...args );\n\t\t\t} );\n\t\t}\n\n\t\tfunction setter( value ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].set.call( this, value );\n\t\t\tif ( this instanceof HTMLScriptElement || webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'outerHTML', 'outerText' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else {\n\t\t\t\t// 'innerHTML', 'innerText', 'textContent', 'nodeValue'\n\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\ttarget = this.content;\n\t\t\t\t\texits = [ ...this.content.childNodes ];\n\t\t\t\t} else {\n\t\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to nodes\n\t\t\tif ( [ 'outerHTML', 'innerHTML' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return exec();\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\tnoRecurse( temp, apiName, () => temp[ apiName ] = value );\n\t\t\t\tentrants = this instanceof HTMLTemplateElement ? [ ...temp.content.childNodes ] : [ ...temp.childNodes ];\n\t\t\t\tif ( ( this instanceof HTMLTemplateElement && this.hasAttribute( 'src' ) ) || this instanceof ShadowRoot ) {\n\t\t\t\t\tconst getScripts = nodes => nodes.reduce( ( scripts, el ) => {\n\t\t\t\t\t\tif ( el instanceof HTMLScriptElement ) return scripts.concat( el );\n\t\t\t\t\t\tif ( el instanceof HTMLTemplateElement ) return scripts.concat( getScripts( [ el.content ] ) );\n\t\t\t\t\t\tscripts = scripts.concat( getScripts( [ ...( el.querySelectorAll?.( 'template' ) || [] ) ].map( t => t.content ) ) );\n\t\t\t\t\t\treturn scripts.concat( ...( el.querySelectorAll?.( 'script' ) || [] ) );\n\t\t\t\t\t}, [] );\n\t\t\t\t\tfor ( const script of getScripts( entrants ) ) {\n\t\t\t\t\t\tif (this instanceof ShadowRoot) {\n\t\t\t\t\t\t\tscript.setAttribute('data-handling', 'manual');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst $script = document.createElement( 'script' );\n\t\t\t\t\t\t[ ...script.attributes ].forEach( attr => $script.setAttribute( attr.name, attr.value ) );\n\t\t\t\t\t\t$script.textContent = script.textContent;\n\t\t\t\t\t\tnoRecurse( script, 'replaceWith', () => script.replaceWith( $script ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\tvalue = new DocumentFragment;\n\t\t\t\t\tnoRecurse( value, 'append', () => value.append( ...entrants ) );\n\t\t\t\t\texec = () => noRecurse( this, 'replaceWith', () => Element.prototype.replaceWith.call( this, value ) );\n\t\t\t\t} else {\n\t\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\t\texec = () => noRecurse( this.content, 'replaceChildren', () => this.content.replaceChildren( ...entrants ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\texec = () => noRecurse( this, 'replaceChildren', () => Element.prototype.replaceChildren.call( this, ...entrants ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\r\n/**\r\n * Applies all supported polyfills\r\n */\r\nexport default function() {\r\n CSS_escape.call( this );\r\n Node_isConnected.call( this );\r\n Element_matches.call( this );\r\n}\r\n\r\n/**\r\n * Polyfills the window.CSS object.\r\n * \r\n * @return void\r\n */\r\nexport function CSS_escape() {\r\n const window = this;\r\n if ( !window.CSS ) { window.CSS = {} }\r\n if ( !window.CSS.escape ) {\r\n /**\r\n * Polyfills the window.CSS.escape() function.\r\n * \r\n * @param string str \r\n * \r\n * @return string\r\n */\r\n window.CSS.escape = str => str.replace( /([\\:@\\~\\$\\&])/g, '\\\\$1' );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Node.prototype.isConnected property\r\n * \r\n * @see MDN\r\n * \r\n * @return bool\r\n*/\r\nexport function Node_isConnected() {\r\n const window = this;\r\n if ( !( 'isConnected' in window.Node.prototype ) ) {\r\n Object.defineProperty( window.Node.prototype, 'isConnected', { get: function() {\r\n return !this.ownerDocument || !(\r\n this.ownerDocument.compareDocumentPosition( this )\r\n & this.DOCUMENT_POSITION_DISCONNECTED);\r\n } } );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Element.prototype.matches() method\r\n * \r\n * @see MDN\r\n * \r\n * @return void\r\n*/\r\nexport function Element_matches() {\r\n const window = this;\r\n if ( !window.Element.prototype.matches ) {\r\n window.Element.prototype.matches = \r\n window.Element.prototype.matchesSelector || \r\n window.Element.prototype.mozMatchesSelector ||\r\n window.Element.prototype.msMatchesSelector || \r\n window.Element.prototype.oMatchesSelector || \r\n window.Element.prototype.webkitMatchesSelector ||\r\n function( s ) {\r\n var matches = ( this.document || this.ownerDocument ).querySelectorAll( s ),\r\n i = matches.length;\r\n while ( --i >= 0 && matches.item( i ) !== this ) {}\r\n return i > -1; \r\n }\r\n }\r\n}", "\r\n/**\r\n * @imports\r\n */\r\nimport { _isNumeric, _isString, _isFunction } from '@webqit/util/js/index.js';\r\nimport { _set } from '@webqit/util/obj/index.js';\r\nimport Scheduler from './Scheduler.js';\r\nimport DOMRealtime from './realtime/DOMRealtime.js';\r\nimport AttrRealtime from './realtime/AttrRealtime.js';\r\nimport polyfill from './polyfills.js';\r\n\r\nexport default function() {\r\n const window = this;\r\n if ( !window.webqit ) window.webqit = {};\r\n if ( window.webqit.realdom ) return window.webqit.realdom;\r\n window.webqit.realdom = {};\r\n polyfill.call( window );\r\n // ------\r\n window.webqit.realdom.meta = ( ...args ) => meta.call( window, ...args );\r\n window.webqit.realdom.ready = ( ...args ) => ready.call( window, ...args );\r\n // ------\r\n window.webqit.realdom.realtime = ( context, namespace = 'dom' ) => {\r\n if ( namespace === 'dom' ) return new DOMRealtime( context, window );\r\n if ( namespace === 'attr' ) return new AttrRealtime( context, window );\r\n };\r\n // ------\r\n const scheduler = new Scheduler( window );\r\n window.webqit.realdom.schedule = ( type, ...args ) => {\r\n return scheduler[ `on${ type }` ]( ...args );\r\n };\r\n window.webqit.realdom.synthesizeWhile = ( ...args ) => {\r\n return scheduler.synthesizeWhile( ...args );\r\n };\r\n // ------\r\n return window.webqit.realdom;\r\n}\r\n\r\n\r\n/**\r\n * DOM-ready listeners.\r\n * \r\n * @param Function\t \t\tcallback\r\n * \r\n * @return void\r\n */\r\nfunction ready( ...args ) {\r\n let timing = 'interactive', callback;\r\n if ( _isString( args[ 0 ] ) ) {\r\n timing = args[ 0 ];\r\n if ( _isFunction( args[ 1 ] ) ) { callback = args[ 1 ]; }\r\n } else if ( _isFunction( args[ 0 ] ) ) { callback = args[ 0 ]; }\r\n // --------------\r\n const timings = { interactive: [ 'interactive', 'complete' ], complete: [ 'complete' ], };\r\n if ( !timings[ timing ] ) throw new Error( `Invalid ready-state timing: ${ timing }.` );\r\n\tconst window = this;\r\n // --------------\r\n if ( !callback ) {\r\n if ( !window.webqit.realdom.readyStatePromises ) {\r\n window.webqit.realdom.readyStatePromises = {\r\n interactive: new Promise( res => ready.call( this, 'interactive', res ) ),\r\n complete: new Promise( res => ready.call( this, 'complete', res ) ),\r\n };\r\n }\r\n return window.webqit.realdom.readyStatePromises[ timing ];\r\n }\r\n // --------------\r\n\tif ( timings[ timing ].includes( window.document.readyState ) ) return callback( window );\r\n if ( !window.webqit.realdom.readyStateCallbacks ) {\r\n window.webqit.realdom.readyStateCallbacks = { interactive: [], complete: [] };\r\n window.document.addEventListener( 'readystatechange', () => {\r\n const state = window.document.readyState;\r\n for ( const callback of window.webqit.realdom.readyStateCallbacks[ state ].splice( 0 ) ) {\r\n callback( window );\r\n }\r\n }, false );\r\n }\r\n window.webqit.realdom.readyStateCallbacks[ timing ].push( callback );\r\n}\r\n\r\n/**\r\n * A webqit's meta tag props reader.\r\n * \r\n * @param String name\r\n * \r\n * @return Object\r\n */\r\nfunction meta( name ) {\r\n const window = this;\r\n let _content = {}, _el;\r\n if ( _el = window.document.querySelector( `meta[name=\"${ name }\"]` ) ) {\r\n _content = ( _el.content || '' ).split( ';' ).filter( v => v ).reduce( ( _metaVars, directive ) => {\r\n const directiveSplit = directive.split( '=' ).map( d => d.trim() );\r\n _set( _metaVars, directiveSplit[ 0 ].split( '.' ), directiveSplit[ 1 ] === 'true' ? true : (directiveSplit[ 1 ] === 'false' ? false : (\r\n _isNumeric( directiveSplit[ 1 ] ) ? parseInt( directiveSplit[ 1 ] ) : directiveSplit[ 1 ]\r\n ) )\r\n );\r\n return _metaVars;\r\n }, {} );\r\n }\r\n return { get name() { return name; }, get content() { return _el.content; }, json() {\r\n\t\treturn JSON.parse( JSON.stringify( _content ) );\r\n } };\r\n}", "\n/**\n * Converts a string to title case.\n *\n * @param string \tstr\n * @param bool \t\tstrict\n *\n * @return string\n */\nexport default function(str, strict) {\n\tif (typeof str !== 'string') {\n\t\treturn str;\n\t}\n\treturn str.replace(/\\w\\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + ((typeof strict !== undefined && strict) ? txt.substr(1).toLowerCase() : txt.substr(1)); })\n};\n", "\n/**\n * @imports\n */\nimport realdomInit from '@webqit/realdom';\nimport { _wq as __wq } from '@webqit/util/js/index.js';\nimport { _merge } from '@webqit/util/obj/index.js';\nimport { _toTitle } from '@webqit/util/str/index.js';\n\nexport const _wq = ( target, ...args ) => __wq( target, 'oohtml', ...args );\n\nexport const env = {};\n\nexport function _init( name, $config, $defaults ) {\n const window = this, realdom = realdomInit.call( window );\n env.window = window;\n if ( !window.webqitConfig ) {\n window.webqitConfig = realdom.meta( 'webqit' ).json();\n }\n window.webqit || ( window.webqit = {} );\n window.webqit.oohtml || ( window.webqit.oohtml = {} );\n window.webqit.oohtml.configs || ( window.webqit.oohtml.configs = {} );\n // ---------------------\n const configKey = name.toUpperCase().replace( '-', '_' );\n if ( !window.webqit.oohtml.configs[ configKey ] ) {\n window.webqit.oohtml.configs[ configKey ] = {};\n const config = window.webqit.oohtml.configs[ configKey ];\n _merge( 2, config, $defaults, $config, realdom.meta( name ).json() );\n if ( window.webqitConfig.prefix ) {\n Object.keys( config ).forEach( main => {\n Object.keys( config[ main ] ).forEach( key => {\n if ( main === 'api' && typeof config[ main ][ key ] === 'string' ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }${ _toTitle( config[ main ][ key ] ) }`\n } else if ( [ 'attr', 'elements' ].includes( main ) && config[ main ][ key ]?.startsWith( 'data-' ) === false ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }-${ config[ main ][ key ] }`\n }\n } );\n } );\n }\n }\n // ---------------------\n return { config: window.webqit.oohtml.configs[ configKey ], realdom, window };\n}\n\nexport function getInternalAttrInteraction( node, attrName ) {\n\treturn _wq( node, 'internalAttrInteractions' ).get( attrName );\n}\nexport function internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = _wq( node, 'internalAttrInteractions' ).get( attrName );\n\t_wq( node, 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t_wq( node, 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\nexport function _compare( a, b, depth = 1, objectSizing = false ) {\n if ( depth && typeof a === 'object' && a && typeof b === 'object' && b && ( !objectSizing || Object.keys( a ).length === Object.keys( b ).length ) ) {\n for ( let key in a ) {\n if ( !_compare( a[ key ], b[ key ], depth - 1, objectSizing ) ) return false;\n }\n return true;\n }\n if ( Array.isArray( a ) && Array.isArray( b ) && a.length === b.length ) {\n return ( b = b.slice( 0 ).sort() ) && a.slice( 0 ).sort().every( ( valueA, i ) => valueA === b[ i ] );\n }\n return a === b;\n}\n\nexport function _splitOuter( str, delim ) {\n return [ ...str ].reduce( ( [ quote, depth, splits ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}\n\n// Unique ID generator\nexport const _uniqId = () => ( 0 | Math.random() * 9e6 ).toString( 36 );\n\n// Hash of anything generator\nconst hashTable = new Map;\nexport function _toHash( val ) {\n let hash;\n if ( !( hash = hashTable.get( val ) ) ) {\n hash = _uniqId();\n hashTable.set( val, hash );\n }\n return hash;\n}\n\n// Value of any hash\nexport function _fromHash( hash ) {\n let val;\n hashTable.forEach( ( _hash, _val ) => {\n if ( _hash === hash ) val = _val;\n } );\n return val;\n}", "\n/**\n * @imports\n */\nimport { env } from '../util.js';\n\nexport default function() {\n const { window } = env, { webqit } = window;\n if ( webqit.DOMContextRequestEvent ) return webqit.DOMContextRequestEvent;\n class DOMContextRequestEvent extends window.Event {\n /**\n * @constructor\n */\n constructor( ...args ) {\n const callback = args.pop();\n if ( typeof callback !== 'function' ) throw new Error( `Callback must be provided.` );\n const options = args.pop();\n if ( !options?.kind ) throw new Error( `\"options.kind\" must be specified.` );\n const eventNames = [ 'contextrequest', 'contextclaim' ];\n const type = args.pop() || eventNames[ 0 ];\n if ( !eventNames.includes( type ) ) throw new Error( `Invalid event type. Must be one of: ${ eventNames.join( ',' ) }` );\n // -------------\n const { kind, detail, targetContext, live, signal, diff, ...otherOpts } = options;\n super( type, { ...otherOpts, bubbles: otherOpts.bubbles !== false } );\n // -------------\n Object.defineProperty( this, 'callback', { get: () => callback } );\n Object.defineProperty( this, 'kind', { get: () => kind } );\n Object.defineProperty( this, 'targetContext', { get: () => targetContext } );\n Object.defineProperty( this, 'detail', { get: () => detail } );\n Object.defineProperty( this, 'live', { get: () => live } );\n Object.defineProperty( this, 'signal', { get: () => signal } );\n Object.defineProperty( this, 'diff', { get: () => diff } );\n Object.defineProperty( this, 'options', { get: () => otherOpts } );\n Object.defineProperty( this, 'meta', { value: {} } );\n }\n\n get target() { return super.target || this.meta.target; }\n get answered() { return this.meta.answered || false; }\n\n /**\n * @respondWith\n */\n respondWith( response ) {\n this.meta.answered = true;\n if ( this.diff ) {\n if ( '_prevValue' in this && this._prevValue === response ) return;\n Object.defineProperty( this, '_prevValue', { value: response, configurable: true } );\n }\n return this.callback( response );\n }\n }\n webqit.DOMContextRequestEvent = DOMContextRequestEvent;\n return DOMContextRequestEvent;\n}", "\n/**\n * @imports\n */\nimport { env } from '../util.js';\n\nexport default class DOMContextResponse extends AbortController {\n constructor( callback ) {\n super();\n callback( response => {\n const { window: { webqit: { Observer } } } = env;\n Observer.defineProperty( this, 'value', { value: response, configurable: true, enumerable: true } );\n }, this );\n }\n}", "\nexport default class DuplicateContextError extends Error {}", "\n/**\n * @imports\n */\nimport _DOMContextRequestEvent from './_DOMContextRequestEvent.js';\nimport DOMContextResponse from './DOMContextResponse.js';\nimport DOMContext from './DOMContext.js';\nimport DuplicateContextError from './DuplicateContextError.js';\nimport { _wq } from '../util.js';\n\nconst waitListMappings = new Map;\nexport default class DOMContexts {\n\n /**\n * @instance\n */\n static instance( host ) {\n return _wq( host ).get( 'contexts::instance' ) || new this( host );;\n }\n\n /**\n * @constructor\n */\n constructor( host ) {\n _wq( host ).get( `contexts::instance` )?.dispose();\n _wq( host ).set( `contexts::instance`, this );\n const priv = { host, contexts: new Set };\n Object.defineProperty( this, '#', { get: () => priv } );\n }\n\n /**\n * @Symbol.iterator\n */\n [ Symbol.iterator ] () { return this[ '#' ].contexts[ Symbol.iterator ](); }\n\n /**\n * @length\n */\n get length() { return this[ '#' ].contexts.size; }\n\n /**\n * @find()\n */\n find( ...args ) {\n return [ ...this[ '#' ].contexts ].find( ctx => {\n if ( typeof args[ 0 ] === 'function' ) return args[ 0 ]( ctx );\n return ctx.constructor.kind === args[ 0 ] && ( !args[ 1 ] || ctx.detail === args[ 1 ] );\n } );\n }\n\n /**\n * @attach()\n */\n attach( ctx ) {\n if ( !( ctx instanceof DOMContext) ) throw new TypeError( `Context is not a valid DOMContext instance.` );\n if ( this.find( ctx.constructor.kind, ctx.detail ) ) {\n throw new DuplicateContextError( `Context of same kind \"${ ctx.constructor.kind }\"${ ctx.detail ? ` and detail \"${ ctx.detail }\"` : '' } already exists.` );\n }\n this[ '#' ].contexts.add( ctx );\n ctx.initialize( this[ '#' ].host );\n }\n\n /**\n * @detach()\n */\n detach( ctx ) {\n ctx.dispose( this[ '#' ].host );\n this[ '#' ].contexts.delete( ctx );\n }\n\n /**\n * @request()\n */\n request( ...args ) {\n return new DOMContextResponse( ( emitter, responseInstance ) => {\n if ( typeof args[ args.length - 1 ] !== 'function' ) {\n if ( !args[ args.length - 1 ] ) { args[ args.length - 1 ] = emitter; }\n else { args.push( emitter ); }\n }\n\n let options;\n if ( ( options = args.find( arg => typeof arg === 'object' && arg ) ) && options.live ) {\n if ( options.signal ) options.signal.addEventListener( 'abort', () => responseInstance.abort() );\n args[ args.indexOf( options ) ] = { ...options, signal: responseInstance.signal };\n }\n const event = new ( _DOMContextRequestEvent() )( ...args );\n this[ '#' ].host.dispatchEvent( event );\n } );\n }\n\n}", "\n/**\n * @imports\n */\nimport DOMContexts from './DOMContexts.js';\nimport { env } from '../util.js';\n\nexport default class DOMContext {\n\n /**\n * To be implemented by subclasses\n */\n static kind;\n\n /**\n * @createRequest\n */\n static createRequest() { return { kind: this.kind }; }\n \n /**\n * @constructor\n */\n constructor( detail = null ) {\n Object.defineProperty( this, 'detail', { get: () => detail } );\n Object.defineProperty( this, 'subscriptions', { value: new Set } );\n }\n\n /**\n * @configs\n */\n get configs() {\n const { window: { webqit: { oohtml: { configs } } } } = env;\n return configs;\n }\n\n /**\n * @name\n */\n get name() { return [ env.window.Document, env.window.ShadowRoot ].some( x => this.host instanceof x ) ? Infinity : this.host.getAttribute( this.configs.CONTEXT_API.attr.contextname ); }\n\n /**\n * @subscribed()\n */\n subscribed( event ) {}\n\n /**\n * @handle()\n */\n handle( event ) {}\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) {}\n\n /**\n * @matchEvent\n */\n matchEvent( event ) {\n return event.kind === this.constructor.kind\n && ( !event.targetContext || event.targetContext === this.name );\n }\n\n /**\n * @handleEvent()\n */\n handleEvent( event ) {\n if ( this.disposed || typeof event.respondWith !== 'function' ) return;\n if ( event.type === 'contextclaim' ) {\n if ( !( event.detail instanceof DOMContext ) || event.target === this.host ) return;\n const claims = new Set;\n this.subscriptions.forEach( subscriptionEvent => {\n if ( !event.target.contains( subscriptionEvent.target ) || !event.detail.matchEvent( subscriptionEvent ) ) return;\n this.subscriptions.delete( subscriptionEvent );\n this.unsubscribed( subscriptionEvent );\n claims.add( subscriptionEvent );\n } );\n if ( claims.size ) { return event.respondWith( claims ); }\n }\n if ( event.type === 'contextrequest' ) {\n if ( !this.matchEvent( event ) ) return;\n if ( event.live ) {\n this.subscriptions.add( event );\n this.subscribed( event );\n event.signal?.addEventListener( 'abort', () => {\n this.subscriptions.delete( event );\n this.unsubscribed( event );\n } );\n }\n event.stopPropagation();\n return this.handle( event );\n }\n }\n\n /**\n * @initialize()\n */\n initialize( host ) {\n this.host = host;\n this.disposed = false;\n host.addEventListener( 'contextrequest', this );\n host.addEventListener( 'contextclaim', this );\n const { value: claims } = DOMContexts.instance( host ).request( 'contextclaim', { kind: this.constructor.kind, detail: this } );\n claims?.forEach( subscriptionEvent => {\n this.subscriptions.add( subscriptionEvent );\n this.subscribed( subscriptionEvent );\n this.handle( subscriptionEvent );\n } );\n return this;\n }\n \n /**\n * @dispose()\n */\n dispose( host ) {\n this.disposed = true;\n host.removeEventListener( 'contextrequest', this );\n host.removeEventListener( 'contextclaim', this );\n this.subscriptions.forEach( subscriptionEvent => {\n this.subscriptions.delete( subscriptionEvent );\n this.unsubscribed( subscriptionEvent );\n const { target } = subscriptionEvent;\n subscriptionEvent.meta.answered = false;\n target.dispatchEvent( subscriptionEvent );\n } );\n return this;\n }\n\n}", "\n/**\n * @imports\n */\nimport DOMNamingContext from './DOMNamingContext.js';\nimport { _wq, _init, _splitOuter, _fromHash, _toHash, getInternalAttrInteraction, internalAttrInteraction } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init( $config = {} ) {\n const { config, window } = _init.call( this, 'namespaced-html', $config, {\n\t\tattr: { namespace: 'namespace', lid: 'id', },\n\t\tapi: { namespace: 'namespace', },\n\t\ttokens: { lidrefPrefix: '~', lidrefSeparator: ':' },\n\t\ttarget: { className: ':target', eventName: ':target', scrolling: true },\n } );\n\tconfig.lidSelector = `[${ window.CSS.escape( config.attr.lid ) }]`;\n\tconfig.namespaceSelector = `[${ window.CSS.escape( config.attr.namespace ) }]`;\n window.webqit.DOMNamingContext = DOMNamingContext;\n exposeAPIs.call( window, config );\n realtime.call( window, config );\n}\n\n/**\n * @init\n * \n * @param Object config\n * \n * @return String\n */\nfunction lidUtil( config ) {\n\tconst { lidrefPrefix, lidrefSeparator, } = config.tokens;\n\treturn {\n\t\tescape( str, mode = 1 ) { return [ ...str ].map( x => !/\\w/.test( x ) ? ( mode === 2 ? `\\\\\\\\${ x }` : `\\\\${ x }` ) : x ).join( '' ); },\n\t\tlidrefPrefix( escapeMode = 0 ) { return escapeMode ? this.escape( lidrefPrefix, escapeMode ) : lidrefPrefix; },\n\t\tlidrefSeparator( escapeMode = 0 ) { return escapeMode ? this.escape( lidrefSeparator, escapeMode ) : lidrefSeparator; },\n\t\tisUuid( str, escapeMode = 0 ) { return str.startsWith( this.lidrefPrefix( escapeMode ) ) && str.includes( this.lidrefSeparator( escapeMode ) ); },\n\t\t//isLidref( str, escapeMode = 0 ) { return str.startsWith( this.lidrefPrefix( escapeMode ) ) && !str.includes( this.lidrefSeparator( escapeMode ) ); },\n\t\ttoUuid( hash, lid, escapeMode = 0 ) { return hash.endsWith( '-root' ) ? lid : `${ this.lidrefPrefix( escapeMode ) }${ hash }${ this.lidrefSeparator( escapeMode ) }${ lid }`; },\n\t\tuuidToId( str, escapeMode = 0 ) { return this.isUuid( str ) ? str.split( this.lidrefSeparator( escapeMode ) )[ 1 ] : str; },\n\t\tuuidToLidref( str, escapeMode = 0 ) { return this.isUuid( str ) ? `${ this.lidrefPrefix( escapeMode ) }${ str.split( this.lidrefSeparator( escapeMode ) )[ 1 ] }` : str; },\n\t}\n}\n\n/**\n * @rewriteSelector\n * \n * @param String selectorText\n * @param String namespaceUUID\n * @param String scopeSelector\n * @param Bool escapeMode\n * \n * @return String\n */\nexport function rewriteSelector( selectorText, namespaceUUID, scopeSelector = null, escapeMode = 0 ) {\n\tconst window = this, { webqit: { oohtml: { configs: { NAMESPACED_HTML: config } } } } = window;\n\tconst $lidUtil = lidUtil( config );\n\t// Match :scope and relative ID selector\n\tconst regex = new RegExp( `${ scopeSelector ? `:scope|` : '' }#(${ $lidUtil.lidrefPrefix( escapeMode + 1 ) })?([\\\\w]+${ $lidUtil.lidrefSeparator( escapeMode + 1 ) })?((?:[\\\\w-]|\\\\\\\\.)+)`, 'g' );\n\t// Parse potentially combined selectors individually and categorise into categories per whether they have :scope or not\n\tconst [ cat1, cat2 ] = _splitOuter( selectorText, ',' ).reduce( ( [ cat1, cat2 ], selector ) => {\n\t\t// The deal: match and replace\n\t\tlet quotesMatch, hadScopeSelector;\n\t\tselector = selector.replace( regex, ( match, lidrefPrefixMatch, lidrefSeparatorMatch, id, index ) => {\n\t\t\tif ( !quotesMatch ) { // Lazy: stuff\n\t\t\t\t// Match strings between quotes (single or double) and use that qualify matches above\n\t\t\t\t// The string: String.raw`She said, \"Hello, John. I\\\"m your friend.\" or \"you're he're\" 'f\\'\"j\\'\"f'jfjf`;\n\t\t\t\t// Should yield: `\"Hello, John. I\\\\\"m your friend.\"`, `\"you're he're\"`, `'f\\\\'\"j\\\\'\"f'`\n\t\t\t\tquotesMatch = [ ...selector.matchAll( /([\"'])(?:(?=(\\\\?))\\2.)*?\\1/g ) ];\n\t\t\t}\n\t\t\t// Qualify match\n\t\t\tif ( quotesMatch.some( q => index > q.index && index + match.length < q.index + q[ 0 ].length ) ) return match;\n\t\t\t// Replace :scope\n\t\t\tif ( match === ':scope' ) {\n\t\t\t\thadScopeSelector = true;\n\t\t\t\treturn scopeSelector;\n\t\t\t}\n\t\t\tconst isLidref = lidrefPrefixMatch && !lidrefSeparatorMatch;\n\t\t\tconst isUuid = lidrefPrefixMatch && lidrefSeparatorMatch;\t\t\t\n\t\t\tif ( isUuid ) {\n\t\t\t\treturn `#${ $lidUtil.escape( match.replace( '#', '' ), 1 ) }`;\n\t\t\t}\n\t\t\t// Rewrite relative ID selector\n\t\t\tif ( isLidref ) {\n\t\t\t\tif ( config.attr.lid === 'id' && namespaceUUID && !namespaceUUID.endsWith( '-root' ) ) {\n\t\t\t\t\treturn `#${ $lidUtil.toUuid( namespaceUUID, id, 1 ) }`;\n\t\t\t\t}\n\t\t\t\t// Fallback to attr-based\n\t\t\t}\n\t\t\t// Rewrite absolute ID selector\n\t\t\tlet rewrite;\n\t\t\tif ( config.attr.lid === 'id' ) {\n\t\t\t\trewrite = `:is(#${ id },[id^=\"${ $lidUtil.lidrefPrefix( escapeMode ) }\"][id$=\"${ $lidUtil.lidrefSeparator( escapeMode ) }${ id }\"])`;\n\t\t\t} else {\n\t\t\t\trewrite = `:is(#${ id },[${ window.CSS.escape( config.attr.lid ) }=\"${ id }\"])`;\n\t\t\t}\n\t\t\treturn isLidref ? `:is(${ rewrite }):not(${ scopeSelector ? scopeSelector + ' ' : '' }${ config.namespaceSelector } *)` : rewrite;\n\t\t} );\n\t\t// Category 2 has :scope and category 1 does not\n\t\treturn hadScopeSelector ? [ cat1, cat2.concat( selector ) ] : [ cat1.concat( selector ), cat2 ];\n\t}, [ [], [] ] );\n\t// Do the upgrade\n\tlet newSelectorText;\n\tif ( scopeSelector && cat1.length ) {\n\t\tnewSelectorText = [ cat1.length > 1 ? `${ scopeSelector } :is(${ cat1.join( ', ' ) })` : `${ scopeSelector } ${ cat1[ 0 ] }`, cat2.join( ', ' ) ].filter( x => x ).join( ', ' );\n\t} else {\n\t\tnewSelectorText = [ ...cat1, ...cat2 ].join( ', ' );\n\t}\n\treturn newSelectorText;\n}\n\n/**\n * @param Element node\n *\n * @return Object\n */\nexport function getOwnNamespaceObject( node ) {\n\tconst window = this;\n\tif ( !_wq( node ).has( 'namespace' ) ) {\n\t\tconst namespaceObj = Object.create( null );\n\t\t_wq( node ).set( 'namespace', namespaceObj );\n\t\tconst isDocumentRoot = [ window.Document, window.ShadowRoot ].some( x => node instanceof x );\n\t\tObject.defineProperty( namespaceObj, Symbol.toStringTag, { get() {\n\t\t\treturn isDocumentRoot ? 'RootNamespaceRegistry' : 'NamespaceRegistry';\n\t\t} } );\n\t}\n\treturn _wq( node ).get( 'namespace' );\n}\n\n/**\n * @param Element node\n * @param Bool forID\n *\n * @return Object\n */\nexport function getOwnerNamespaceObject( node, forID = false ) {\n\tconst window = this, { webqit: { oohtml: { configs: { NAMESPACED_HTML: config } } } } = window;\n\tconst isDocumentRoot = [ window.Document, window.ShadowRoot ].some( x => node instanceof x );\n\treturn getOwnNamespaceObject.call( window, isDocumentRoot ? node : ( ( forID ? node.parentNode : node )?.closest/*can be documentFragment when Shadow DOM*/?.( config.namespaceSelector ) || node.getRootNode() ) );\n}\n\n/**\n * @param Object namespaceObj\n *\n * @return String\n */\nexport function getNamespaceUUID( namespaceObj ) {\n\tconst isDocumentRoot = Object.prototype.toString.call( namespaceObj ) === '[object RootNamespaceRegistry]';\n return ( _fromHash( namespaceObj ) || _toHash( namespaceObj ) ) + ( isDocumentRoot ? '-root' : '' );\n}\n\n/**\n * Exposes Namespaced HTML with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n const window = this, { webqit: { Observer } } = window;\n // The Namespace API\n [ window.Document.prototype, window.Element.prototype, window.ShadowRoot.prototype ].forEach( prototype => {\n // No-conflict assertions\n const type = prototype === window.Document.prototype ? 'Document' : ( prototype === window.ShadowRoot.prototype ? 'ShadowRoot' : 'Element' );\n if ( config.api.namespace in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.namespace }\" API!` ); }\n // Definitions\n Object.defineProperty( prototype, config.api.namespace, { get: function() {\n\t\t\treturn Observer.proxy( getOwnNamespaceObject.call( window, this ) );\n\t\t} } );\n } );\n}\n\n/**\n * Performs realtime capture of elements and builds their relationships.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const window = this, { webqit: { Observer, realdom, oohtml: { configs }, DOMNamingContext } } = window;\n\t\n\t// ------------\n\t// APIS\n // ------------\n\t// See https://wicg.github.io/aom/aria-reflection-explainer.html & https://github.com/whatwg/html/issues/3515 for the ARIA refelction properties idea\n\t// See https://www.w3.org/TR/wai-aria-1.1/#attrs_relationships for the relational ARIA attributes\n\tconst idRefsAttrs = [ 'aria-owns', 'aria-controls', 'aria-labelledby', 'aria-describedby', 'aria-flowto', ];\n\tconst idRefAttrs = [ 'for', 'list', 'form', 'aria-activedescendant', 'aria-details', 'aria-errormessage', ];\n\tconst attrList = [ config.attr.lid, ...idRefsAttrs, ...idRefAttrs ];\n\tconst relMap = { id: 'id'/* just in case it's in attrList */, for: 'htmlFor', 'aria-owns': 'ariaOwns', 'aria-controls': 'ariaControls', 'aria-labelledby': 'ariaLabelledBy', 'aria-describedby': 'ariaDescribedBy', 'aria-flowto': 'ariaFlowto', 'aria-activedescendant': 'ariaActiveDescendant', 'aria-details': 'ariaDetails', 'aria-errormessage': 'ariaErrorMessage' };\n\tconst $lidUtil = lidUtil( config );\n\tconst uuidsToLidrefs = ( node, attrName, getter ) => {\n\t\tif ( !getInternalAttrInteraction( node, attrName ) && _wq( node, 'attrOriginals' ).has( attrName ) ) {\n\t\t\treturn _wq( node, 'attrOriginals' ).get( attrName );\n\t\t}\n\t\tconst value = getter();\n\t\tif ( getInternalAttrInteraction( node, attrName ) ) return value;\n\t\treturn value && value.split( ' ' ).map( x => ( x = x.trim() ) && ( attrName === config.attr.lid ? $lidUtil.uuidToId : $lidUtil.uuidToLidref ).call( $lidUtil, x ) ).join( ' ' );\n\t};\n\n\t// Intercept getElementById()\n\tconst getElementByIdDescr = Object.getOwnPropertyDescriptor( window.Document.prototype, 'getElementById' );\n\tObject.defineProperty( window.Document.prototype, 'getElementById', { ...getElementByIdDescr, value( id ) {\n\t\treturn this.querySelector( `#${ id }` ); // To be rewritten at querySelector()\n\t} } );\n\t// Intercept querySelector() and querySelectorAll()\n\tfor ( const queryApi of [ 'querySelector', 'querySelectorAll' ] ) {\n\t\tfor ( const nodeApi of [ window.Document, window.Element ] ) {\n\t\t\tconst querySelectorDescr = Object.getOwnPropertyDescriptor( nodeApi.prototype, queryApi );\n\t\t\tObject.defineProperty( nodeApi.prototype, queryApi, { ...querySelectorDescr, value( selector ) {\n\t\t\t\treturn querySelectorDescr.value.call( this, rewriteSelector.call( window, selector, getNamespaceUUID( getOwnNamespaceObject.call( window, this ) ) ) );\n\t\t\t} } );\n\t\t}\n\t}\n\t// Intercept getAttribute()\n\tconst getAttributeDescr = Object.getOwnPropertyDescriptor( window.Element.prototype, 'getAttribute' );\n\tObject.defineProperty( window.Element.prototype, 'getAttribute', { ...getAttributeDescr, value( attrName ) {\n\t\tconst getter = () => getAttributeDescr.value.call( this, attrName );\n\t\treturn attrList.includes( attrName ) && !_wq( this, 'lock' ).get( attrName ) ? uuidsToLidrefs( this, attrName, getter ) : getter();\n\t} } );\n\t// Hide implementation details on the Attr node too.\n\tconst propertyDescr = Object.getOwnPropertyDescriptor( window.Attr.prototype, 'value' );\n\tObject.defineProperty( window.Attr.prototype, 'value', { ...propertyDescr, get() {\n\t\tconst getter = () => propertyDescr.get.call( this );\n\t\treturn attrList.includes( this.name ) ? uuidsToLidrefs( this.ownerElement, this.name, getter ) : getter();\n\t} } );\n\tconst propertyDescr2 = Object.getOwnPropertyDescriptor( window.Node.prototype, 'nodeValue' );\n\tObject.defineProperty( window.Node.prototype, 'nodeValue', { ...propertyDescr2, get() {\n\t\tconst getter = () => propertyDescr2.get.call( this );\n\t\treturn this instanceof window.Attr && attrList.includes( this.name ) ? uuidsToLidrefs( this.ownerElement, this.name, getter ) : getter();\n\t} } );\n\t// These APIs should return LIDREFS minus the hash part\n\tfor ( const attrName of attrList ) {\n\t\tif ( !( attrName in relMap ) ) continue;\n\t\tconst domApis = attrName === 'for' ? [ window.HTMLLabelElement, window.HTMLOutputElement ] : [ window.Element ];\n\t\tfor ( const domApi of domApis ) {\n\t\t\tconst propertyDescr = Object.getOwnPropertyDescriptor( domApi.prototype, relMap[ attrName ] );\n\t\t\tif ( !propertyDescr ) continue;\n\t\t\tObject.defineProperty( domApi.prototype, relMap[ attrName ], { ...propertyDescr, get() {\n\t\t\t\tconst getter = () => propertyDescr.get.call( this, attrName );\n\t\t\t\treturn uuidsToLidrefs( this, attrName, getter );\n\t\t\t} } );\n\t\t}\n\t}\n\tif ( config.attr.lid !== 'id' ) {\n\t\t// Reflect the custom [config.attr.lid] attribute\n\t\tObject.defineProperty( window.Element.prototype, config.attr.lid, { configurable: true, enumerable: true, get() {\n\t\t\treturn this.getAttribute( config.attr.lid );\n\t\t}, set( value ) {\n\t\t\treturn this.setAttribute( config.attr.lid, value );\n\t\t} } );\n\t}\n\n\t// ------------\n // LOCAL IDS & IDREFS\n // ------------\n\tconst attrChange = ( entry, attrName, value, callback ) => {\n\t\treturn internalAttrInteraction( entry, attrName, () => {\n\t\t\tif ( typeof value === 'function' ) value = value();\n\t\t\treturn callback( value );\n\t\t} );\n\t};\n\tconst setupBinding = ( entry, attrName, value, newNamespaceObj = null ) => {\n\t\tattrChange( entry, attrName, value, value => {\n\t\t\tconst isLidAttr = attrName === config.attr.lid;\n\t\t\tconst namespaceObj = newNamespaceObj || getOwnerNamespaceObject.call( window, entry, isLidAttr );\n\t\t\tconst namespaceUUID = getNamespaceUUID( namespaceObj );\n\t\t\tif ( isLidAttr ) {\n\t\t\t\tconst id = $lidUtil.uuidToId( value );\n\t\t\t\tif ( Observer.get( namespaceObj, id ) !== entry ) {\n\t\t\t\t\tconst uuid = $lidUtil.toUuid( namespaceUUID, id );\n\t\t\t\t\tif ( uuid !== value ) { entry.setAttribute( 'id', uuid ); }\n\t\t\t\t\tObserver.set( namespaceObj, id, entry );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t_wq( entry, 'attrOriginals' ).set( attrName, value ); // Save original before rewrite\n\t\t\t\tconst newAttrValue = value.split( ' ' ).map( idref => ( idref = idref.trim() ) && $lidUtil.isUuid( idref ) ? idref : $lidUtil.toUuid( namespaceUUID, idref ) ).join( ' ' );\n\t\t\t\tentry.setAttribute( attrName, newAttrValue );\n\t\t\t\t_wq( namespaceObj ).set( 'idrefs', _wq( namespaceObj ).get( 'idrefs' ) || new Set );\n\t\t\t\t_wq( namespaceObj ).get( 'idrefs' ).add( entry );\n\t\t\t}\n\t\t} );\n\t};\n\tconst cleanupBinding = ( entry, attrName, oldValue, prevNamespaceObj = null ) => {\n\t\tattrChange( entry, attrName, oldValue, oldValue => {\n\t\t\tconst isLidAttr = attrName === config.attr.lid;\n\t\t\tconst namespaceObj = prevNamespaceObj || getOwnerNamespaceObject.call( window, entry, isLidAttr );\n\t\t\tif ( isLidAttr ) {\n\t\t\t\tconst id = $lidUtil.uuidToId( oldValue );\n\t\t\t\tif ( Observer.get( namespaceObj, id ) === entry ) {\n\t\t\t\t\tObserver.deleteProperty( namespaceObj, id );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst newAttrValue = _wq( entry, 'attrOriginals' ).get( attrName );// oldValue.split( ' ' ).map( lid => ( lid = lid.trim() ) && $lidUtil.uuidToLidref( lid ) ).join( ' ' );\n\t\t\t\tif ( entry.hasAttribute( attrName ) ) entry.setAttribute( attrName, newAttrValue );\n\t\t\t\t_wq( namespaceObj ).get( 'idrefs' )?.delete( entry );\n\t\t\t}\n\t\t} );\n\t};\n\n // ------------\n // NAMESPACE\n // ------------\n realdom.realtime( window.document ).query( config.namespaceSelector, record => {\n\t\tconst reAssociate = ( entry, attrName, oldNamespaceObj, newNamespaceObj ) => {\n\t\t\tif ( !entry.hasAttribute( attrName ) ) return;\n\t\t\tconst attrValue = () => entry.getAttribute( attrName );\n\t\t\tcleanupBinding( entry, attrName, attrValue/* Current resolved value as-is */, oldNamespaceObj );\n\t\t\tif ( entry.isConnected ) { setupBinding( entry, attrName, _wq( entry, 'attrOriginals' ).get( attrName )/* Saved original value */ || attrValue/* Lest it's ID */, newNamespaceObj ); }\n\t\t};\n record.exits.forEach( entry => {\n\t\t\tif ( entry.isConnected ) {\n\t\t\t\tconst namespaceObj = getOwnNamespaceObject.call( window, entry );\n\t\t\t\t// Detach ID and IDREF associations\n\t\t\t\tfor ( const node of new Set( [ ...Object.values( namespaceObj ), ...( _wq( namespaceObj ).get( 'idrefs' ) || [] ) ] ) ) {\n\t\t\t\t\tfor ( const attrName of attrList ) { reAssociate( node, attrName, namespaceObj ); }\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Detach ID associations\n\t\t\tconst contextsApi = entry[ configs.CONTEXT_API.api.contexts ];\n\t\t\tconst ctx = contextsApi.find( DOMNamingContext.kind );\n\t\t\t// Detach namespace instance\n\t\t\tif ( ctx ) { contextsApi.detach( ctx ); }\n } );\n record.entrants.forEach( entry => {\n\t\t\t// Claim ID and IDREF associations\n\t\t\tlet newSuperNamespaceObj;\n\t\t\tconst superNamespaceObj = getOwnerNamespaceObject.call( window, entry, true );\n\t\t\tfor ( const node of new Set( [ ...Object.values( superNamespaceObj ), ...( _wq( superNamespaceObj ).get( 'idrefs' ) || [] ) ] ) ) {\n\t\t\t\tif ( ( newSuperNamespaceObj = getOwnerNamespaceObject.call( window, node, true ) ) === superNamespaceObj ) continue;\n\t\t\t\tfor ( const attrName of attrList ) { reAssociate( node, attrName, superNamespaceObj, newSuperNamespaceObj ); }\n\t\t\t}\n\t\t\t// Attach namespace instance\n\t\t\tconst contextsApi = entry[ configs.CONTEXT_API.api.contexts ];\n\t\t\tif ( !contextsApi.find( DOMNamingContext.kind ) ) { contextsApi.attach( new DOMNamingContext ); }\n } );\n }, { id: 'namespace-html:namespace', live: true, subtree: 'cross-roots', timing: 'sync', staticSensitivity: true, eventDetails: true } );\n\n\t// DOM realtime\n\trealdom.realtime( window.document ).query( `[${ attrList.map( attrName => window.CSS.escape( attrName ) ).join( '],[' ) }]`, record => {\n\t\t// We do some caching to prevent redundanct lookups\n\t\tconst namespaceNodesToTest = { forID: new Map, forOther: new Map, };\n\t\tfor ( const attrName of attrList ) {\n\t\t\t// Point to the right cache\n\t\t\tconst _namespaceNodesToTest = attrName === config.attr.lid ? namespaceNodesToTest.forID : namespaceNodesToTest.forOther;\n\t\t\trecord.exits.forEach( entry => {\n\t\t\t\tif ( !entry.hasAttribute( attrName ) ) return;\n\t\t\t\t// Point to the right namespace node\n\t\t\t\tlet namespaceNodeToTest = _namespaceNodesToTest.get( entry );\n\t\t\t\tif ( typeof namespaceNodeToTest === 'undefined' ) {\n\t\t\t\t\tnamespaceNodeToTest = ( attrName === config.attr.lid ? entry.parentNode : entry )?.closest/*can be documentFragment when Shadow DOM*/?.( config.namespaceSelector ) || entry.getRootNode().host;\n\t\t\t\t\t_namespaceNodesToTest.set( entry, namespaceNodeToTest );\n\t\t\t\t}\n\t\t\t\tif ( namespaceNodeToTest && !namespaceNodeToTest.isConnected ) return;\n\t\t\t\tcleanupBinding( entry, attrName, () => entry.getAttribute( attrName )/* Current resolved value as-is */ );\n\t\t\t} );\n\t\t\trecord.entrants.forEach( entry => {\n\t\t\t\tif ( !entry.hasAttribute( attrName ) ) return;\n\t\t\t\tsetupBinding( entry, attrName, () => entry.getAttribute( attrName )/* Raw value (as-is) that will be saved as original */ );\n\t\t\t} );\n\t\t}\n\t\tnamespaceNodesToTest.forID.clear();\n\t\tnamespaceNodesToTest.forOther.clear();\n\t}, { id: 'namespace-html:attrs', live: true, subtree: 'cross-roots', timing: 'sync' } );\n\t// Attr realtime\n\trealdom.realtime( window.document, 'attr' ).observe( attrList, records => {\n\t\tfor ( const record of records ) {\n\t\t\tif ( record.oldValue && record.value !== record.oldValue ) {\n\t\t\t\tcleanupBinding( record.target, record.name, record.oldValue/* Current resolved value as-is */ );\n\t\t\t}\n\t\t\tif ( record.value && record.value !== record.oldValue ) {\n\t\t\t\tsetupBinding( record.target, record.name, record.value/* Raw value (as-is) that will be saved as original */ );\n\t\t\t}\n\t\t}\n\t}, { id: 'namespace-html:attr(attrs)', subtree: 'cross-roots', timing: 'sync', newValue: true, oldValue: true } );\n\n // ------------\n\t// TARGETS\n // ------------\n\tlet prevTarget;\n\tconst activateTarget = () => {\n\t\tif ( !window.location.hash?.startsWith( `#${ $lidUtil.lidrefPrefix() }` ) ) return;\n\t\tconst path = window.location.hash?.substring( `#${ $lidUtil.lidrefPrefix() }`.length ).split( '/' ).map( s => s.trim() ).filter( s => s ) || [];\n\t\tconst currTarget = path.reduce( ( prev, segment ) => prev && prev[ config.api.namespace ][ segment ], window.document );\n\t\tif ( prevTarget && config.target.className ) { prevTarget.classList.toggle( config.target.className, false ); }\n\t\tif ( currTarget && currTarget !== window.document ) {\n\t\t\tif ( config.target.className ) { currTarget.classList.toggle( config.target.className, true ); }\n\t\t\tif ( config.target.eventName ) { currTarget.dispatchEvent( new window.CustomEvent( config.target.eventName ) ); }\n\t\t\tif ( config.target.scrolling && path.length > 1 ) { currTarget.scrollIntoView(); }\n\t\t\tprevTarget = currTarget;\n\t\t}\n\t};\n\t// \"hash\" realtime\n\twindow.addEventListener( 'hashchange', activateTarget );\n\trealdom.ready( activateTarget );\n\t// ----------------\n}\n", "\n/**\n * @imports\n */\nimport { rewriteSelector, getOwnerNamespaceObject, getNamespaceUUID } from '../namespaced-html/index.js';\nimport { _init, _toHash } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init({ advanced = {}, ...$config }) {\n const { config, window } = _init.call( this, 'scoped-css', $config, {\n api: { styleSheets: 'styleSheets' },\n style: { retention: 'retain', mimeTypes: 'text/css', strategy: null },\n } );\n config.styleSelector = (Array.isArray( config.style.mimeTypes ) ? config.style.mimeTypes : config.style.mimeTypes.split( '|' ) ).concat( '' ).reduce( ( selector, mm ) => {\n const qualifier = mm ? `[type=\"${ window.CSS.escape( mm ) }\"]` : ':not([type])';\n return selector.concat( `style${ qualifier }` );\n }, [] ).join( ',' );\n window.webqit.oohtml.Style = {\n compileCache: new Map,\n };\n exposeAPIs.call( window, config );\n realtime.call( window, config );\n}\n\n/**\n * Exposes Bindings with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n const window = this, styleSheetsMap = new Map;\n // The \"styleSheets\" API\n [ window.Element.prototype ].forEach( prototype => {\n // No-conflict assertions\n const type = 'Element';\n if ( config.api.styleSheets in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.styleSheets }\" API!` ); }\n // Definitions\n Object.defineProperty( prototype, config.api.styleSheets, { get: function() {\n if ( !styleSheetsMap.has( this ) ) { styleSheetsMap.set( this, [] ); }\n return styleSheetsMap.get( this );\n }, } );\n } );\n // The HTMLStyleElement \"scoped\" property\n Object.defineProperty( window.HTMLStyleElement.prototype, 'scoped', {\n configurable: true,\n get() { return this.hasAttribute( 'scoped' ); },\n set( value ) { this.toggleAttribute( 'scoped', value ); },\n } );\n}\n\n/**\n * Performs realtime capture of elements and builds their relationships.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const window = this, { webqit: { oohtml, realdom } } = window;\n const inBrowser = Object.getOwnPropertyDescriptor( globalThis, 'window' )?.get?.toString().includes( '[native code]' ) ?? false;\n if ( !window.CSS.supports ) { window.CSS.supports = () => false; }\n const handled = new WeakSet;\n realdom.realtime( window.document ).query( config.styleSelector, record => {\n record.entrants.forEach( style => {\n if ( handled.has( style ) ) return;\n handled.add( style );\n // Do compilation\n const sourceHash = _toHash( style.textContent );\n const supportsHAS = CSS.supports( 'selector(:has(a,b))' );\n const scopeSelector = style.scoped && ( supportsHAS ? `:has(> style[rand-${ sourceHash }])` : `[rand-${ sourceHash }]` );\n const supportsScope = style.scoped && window.CSSScopeRule && false/* Disabled for buggy behaviour: rewriting selectorText within an @scope block invalidates the scoping */;\n const scopeRoot = style.scoped && style.parentNode || style.getRootNode();\n if ( scopeRoot instanceof window.Element ) {\n scopeRoot[ config.api.styleSheets ].push( style );\n if ( !inBrowser ) return;\n ( supportsHAS ? style : scopeRoot ).toggleAttribute( `rand-${ sourceHash }`, true );\n }\n if ( !inBrowser ) return;\n if ( style.scoped && style.hasAttribute( 'shared' ) ) {\n let compiledSheet;\n if ( !( compiledSheet = oohtml.Style.compileCache.get( sourceHash ) ) ) {\n compiledSheet = createAdoptableStylesheet.call( window, style, null, supportsScope, scopeSelector );\n oohtml.Style.compileCache.set( sourceHash, compiledSheet );\n }\n // Run now!!!\n Object.defineProperty( style, 'sheet', { value: compiledSheet, configurable: true } );\n style.textContent = '\\n/*[ Shared style sheet ]*/\\n';\n } else {\n const transform = () => {\n const namespaceUUID = getNamespaceUUID( getOwnerNamespaceObject.call( window, scopeRoot ) );\n upgradeSheet.call( this, style.sheet, namespaceUUID, !supportsScope && scopeSelector );\n };\n if ( style.isConnected ) { transform(); }\n else { setTimeout( () => { transform(); }, 0 ); }\n }\n } );\n }, { id: 'scoped-css', live: true, subtree: 'cross-roots', timing: 'intercept', generation: 'entrants' } );\n // ---\n}\n\nfunction createAdoptableStylesheet( style, namespaceUUID, supportsScope, scopeSelector ) {\n const window = this, textContent = style.textContent;\n let styleSheet, cssText = supportsScope && scopeSelector ? `@scope (${ scopeSelector }) {\\n${ textContent.trim() }\\n}` : textContent.trim();\n try {\n styleSheet = new window.CSSStyleSheet;\n styleSheet.replaceSync( cssText );\n upgradeSheet.call( this, styleSheet, namespaceUUID, !supportsScope && scopeSelector );\n const adopt = () => style.getRootNode().adoptedStyleSheets.push( styleSheet );\n if ( style.isConnected ) { adopt(); }\n else { setTimeout( () => { adopt(); }, 0 ); }\n } catch( e ) {\n const styleCopy = window.document.createElement( 'style' );\n style.after( styleCopy );\n styleCopy.textContent = cssText;\n styleSheet = styleCopy.sheet;\n upgradeSheet.call( this, styleSheet, namespaceUUID, !supportsScope && scopeSelector );\n }\n return styleSheet;\n}\n\nfunction upgradeSheet( styleSheet, namespaceUUID, scopeSelector = null ) {\n const l = styleSheet?.cssRules.length || -1;\n for ( let i = 0; i < l; ++i ) {\n const cssRule = styleSheet.cssRules[ i ];\n if ( cssRule instanceof CSSImportRule ) {\n // Handle imported stylesheets\n //upgradeSheet( cssRule.styleSheet, namespaceUUID, scopeSelector );\n continue;\n }\n upgradeRule.call( this, cssRule, namespaceUUID, scopeSelector );\n }\n}\n\nfunction upgradeRule( cssRule, namespaceUUID, scopeSelector = null ) {\n if ( cssRule instanceof CSSStyleRule ) {\n // Resolve relative IDs and scoping (for non-@scope browsers)\n upgradeSelector.call( this, cssRule, namespaceUUID, scopeSelector );\n return;\n }\n if ( [ window.CSSScopeRule, window.CSSMediaRule, window.CSSContainerRule, window.CSSSupportsRule, window.CSSLayerBlockRule ].some( type => type && cssRule instanceof type ) ) {\n // Parse @rule blocks\n const l = cssRule.cssRules.length;\n for ( let i = 0; i < l; ++i ) {\n upgradeRule.call( this, cssRule.cssRules[ i ], namespaceUUID, scopeSelector );\n }\n }\n}\n\nfunction upgradeSelector( cssRule, namespaceUUID, scopeSelector = null ) {\n const newSelectorText = rewriteSelector.call( this, cssRule.selectorText, namespaceUUID, scopeSelector, 1 );\n cssRule.selectorText = newSelectorText;\n // Parse nested blocks. (CSS nesting)\n if ( cssRule.cssRules ) {\n const l = cssRule.cssRules.length;\n for ( let i = 0; i < l; ++i ) {\n upgradeSelector.call( this, cssRule.cssRules[ i ], namespaceUUID, /* Nesting has nothing to do with scopeSelector */ );\n }\n }\n}", "\n/**\n * @imports\n */\nimport init from './index.js';\n\n/**\n * @init\n */\nin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AAK,EAAe,CAAc,CAEpF,CACJ,CAEA,YAA0B,EAAS,EAAe,EAAgB,KAAO,CACrE,GAAM,GAAkB,GAAgB,KAAM,KAAM,EAAQ,aAAc,EAAe,EAAe,CAAE,EAG1G,GAFA,EAAQ,aAAe,EAElB,EAAQ,SAAW,CACpB,GAAM,GAAI,EAAQ,SAAS,OAC3B,OAAU,GAAI,EAAG,EAAI,EAAG,EAAE,EACtB,GAAgB,KAAM,KAAM,EAAQ,SAAU,GAAK,CAAkE,CAE7H,CACJ,CC3JA,GAAK,KAAM,MAAO",
|
|
4
|
+
"sourcesContent": ["\n/**\n * Tells if val is pure object.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !Array.isArray(val) && typeof val === 'object' && val;\n};\n", "\n/**\n * Tells if val is of type \"array\".\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val);\n};\n", "\n/**\n * Tells if val is of type \"function\".\n * This holds true for both regular functions and classes.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn typeof val === 'function';\n};\n", "\n/**\n * Tells if val is undefined or is null.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val === null || val === '';\n};\n", "\n/**\n * Tells if val is undefined or is of type \"undefined\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn arguments.length && (val === undefined || typeof val === 'undefined');\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"object\".\n * This holds true for anything object, including built-ins.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn Array.isArray(val) || (typeof val === 'object' && val) || _isTypeFunction(val);\n};\n", "\n/**\n * @imports\n */\nimport _isNull from './isNull.js';\nimport _isUndefined from './isUndefined.js';\nimport _isTypeObject from './isTypeObject.js';\n\n/**\n * Tells if val is empty in its own type.\n * This holds true for NULLs, UNDEFINED, FALSE, 0,\n * objects without keys, empty arrays.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNull(val) || _isUndefined(val) || val === false || val === 0 \n\t\t|| (_isTypeObject(val) && !Object.keys(val).length);\n};\n", "\n/**\n * @imports\n */\nimport _isTypeFunction from './isTypeFunction.js';\n\n/**\n * Tells if val is of type \"function\".\n *\n * @param object \t\tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isTypeFunction(val) || (val && {}.toString.call(val) === '[object function]');\n};\n", "\n/**\n * Tells if val is of type \"number\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof Number || (typeof val === 'number');\n};\n", "\n/**\n * @imports\n */\nimport _isNumber from './isNumber.js';\n/**\n * Tells if val is of type \"string\" or a numeric string.\n * This holds true for both numbers and numeric strings.\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn _isNumber(val) || (val !== true && val !== false && val !== null && val !== '' && !isNaN(val * 1));\n};\n", "\n/**\n * Tells if val is of type \"string\".\n *\n * @param string \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn val instanceof String || (typeof val === 'string' && val !== null);\n};\n", "\n/**\n * @imports\n */\nimport _isString from './isString.js';\nimport _isUndefined from './isUndefined.js';\n\n/**\n * Tells if val is \"array-like\".\n * This holds true for anything that has a length property.\n *\n * @param object\t \tval\n *\n * @return bool\n */\nexport default function(val) {\n\treturn !_isString(val) && !_isUndefined(val.length);\n};\n", "\n/**\n * Adds an item if not already exist.\n *\n * @param array \tarr\n * @param array\t \t...itms\n *\n * @return array\n */\nexport default function(arr, ...items) {\n\titems.forEach(itm => {\n\t\tif (arr.indexOf(itm) < 0) {\n\t\t\tarr.push(itm);\n\t\t}\n\t});\n\treturn arr;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\n\n/**\n * Returns the prototype chain.\n *\n * @param object \t\tobj\n * @param object\t \tuntil\n *\n * @return bool\n */\nexport default function(obj, until) {\n\tuntil = until || Object.prototype;\n\tuntil = until && !_isArray(until) ? [until] : until;\n\t// We get the chain of inheritance\n\tvar prototypalChain = [];\n\tvar obj = obj;\n\twhile((obj && (!until || until.indexOf(obj) < 0) && obj.name !== 'default')) {\n\t\tprototypalChain.push(obj);\n\t\tobj = obj ? Object.getPrototypeOf(obj) : null;\n\t}\n\treturn prototypalChain;\n};\n", "\n/**\n * @imports\n */\nimport _pushUnique from '../arr/pushUnique.js';\nimport _getPrototypeChain from './getPrototypeChain.js';\n\n/**\n * Eagerly retrieves object members all down the prototype chain.\n *\n * @param object\t \tobj\n * @param object\t \tuntil\n *\n * @return array\n */\nexport default function(obj, until) {\n\tvar keysAll = [];\n\t_getPrototypeChain(obj, until).forEach(obj => {\n\t\t_pushUnique(keysAll, ...Object.getOwnPropertyNames(obj));\n\t});\n\treturn keysAll;\n};\n", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isObject from '../js/isObject.js';\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _getAllPropertyNames from './getAllPropertyNames.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function mergeCallback(objs, callback, deepProps = false, isReplace = false, withSymbols = false) {\n\tvar depth = 0;\n\tvar obj1 = objs.shift();\n\tif (_isNumeric(obj1) || obj1 === true || obj1 === false) {\n\t\tdepth = obj1;\n\t\tobj1 = objs.shift();\n\t}\n\tif (!objs.length) {\n\t\tthrow new Error('_merge() requires two or more array/objects.');\n\t}\n\tobjs.forEach((obj2, i) => {\n\t\tif (!_isTypeObject(obj2) && !_isFunction(obj2)) {\n\t\t\treturn;\n\t\t}\n\t\t(deepProps ? _getAllPropertyNames(obj2) : Object.keys(obj2)).forEach(key => {\n\t\t\tif (!callback(key, obj1, obj2, i)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar valAtObj1 = obj1[key];\n\t\t\tvar valAtObj2 = obj2[key];\n\t\t\tif (((_isArray(valAtObj1) && _isArray(valAtObj2)) || (_isObject(valAtObj1) && _isObject(valAtObj2))) \n\t\t\t&& (depth === true || depth > 0)) {\n\t\t\t\t// RECURSE...\n\t\t\t\tobj1[key] = _isArray(valAtObj1) && _isArray(valAtObj2) ? [] : {};\n\t\t\t\tmergeCallback([_isNumeric(depth) ? depth - 1 : depth, obj1[key], valAtObj1, valAtObj2], callback, deepProps, isReplace, withSymbols);\n\t\t\t} else {\n\t\t\t\tif (_isArray(obj1) && _isArray(obj2)) {\n\t\t\t\t\tif (isReplace) {\n\t\t\t\t\t\tobj1[key] = valAtObj2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tobj1.push(valAtObj2);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// In case we're setting a read-only property\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (withSymbols) {\n\t\t\t\t\t\t\tObject.defineProperty(obj1, key, Object.getOwnPropertyDescriptor(obj2, key));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tobj1[key] = obj2[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(e) {}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\treturn obj1;\n};\n", "\n/**\n * @imports\n */\nimport _mergeCallback from './mergeCallback.js';\n\n/**\n * Merges values from subsequent arrays/objects first array/object;\n * optionally recursive\n *\n * @param array ...objs\n *\n * @return void\n */\nexport default function(...objs) {\n\treturn _mergeCallback(objs, (k, obj1, obj2) => {\n\t\treturn true;\n\t}, false/*deepProps*/, false/*isReplace*/, false/*withSymbols*/);\n};\n", "export default function wq(obj, ...namespaces) {\n if (!obj || !['object', 'function'].includes(typeof obj)) {\n throw new Error(`Argument #1 must be of type object`);\n }\n let wq = obj[Symbol.for('wq')];\n if (!wq) {\n wq = new WQInternals;\n Object.defineProperty(obj, Symbol.for('wq'), {\n value: wq,\n // Defaults, but to be explicit...\n enumerable: false,\n configurable: false,\n writable: false\n });\n }\n if (!namespaces.length) {\n return wq;\n }\n let _ns, _wq;\n while ((_ns = namespaces.shift())) {\n if ((_wq = wq) && !(wq = wq.get(_ns))) {\n wq = new WQInternals;\n _wq.set(_ns, wq);\n }\n }\n return wq;\n}\n\nclass WQInternals extends Map {}", "\n/**\n * @imports\n */\nimport _isArray from '../js/isArray.js';\nimport _isTypeArray from '../js/isTypeArray.js';\nimport _isEmpty from '../js/isEmpty.js';\nimport _isObject from '../js/isObject.js';\n\n/**\n * Casts an array-like object to an array.\n *\n * @param mixed \tval\n * @param bool\t \tcastObject\n *\n * @return array\n */\nexport default function(val, castObject = true) {\n\tif (_isArray(val)) {\n\t\treturn val;\n\t};\n\tif (!castObject && _isObject(val)) {\n\t\treturn [val];\n\t};\n\tif (val !== false && val !== 0 && _isEmpty(val)) {\n\t\treturn [];\n\t};\n\tif (_isTypeArray(val)) {\n\t\treturn Array.prototype.slice.call(val);\n\t};\n\tif (_isObject(val)) {\n\t\treturn Object.values(val);\n\t};\n\treturn [val];\n};\n", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isUndefined from '../js/isUndefined.js';\nimport _isNull from '../js/isNull.js';\nimport _arrFrom from '../arr/from.js';\n\n/**\n * Retrieves the value at the given path.\n *\n * A return value of undefined is ambiguous, and can mean either that the\n * path does not exist, or that the path actually exists but with a value of undefined. If it is required to\n * know whether the path actually exists, pass an object as a third argument.\n * This object will have an \"exists\" key set to true/false.\n *\n * @param object \t\t\t\tctxt\n * @param array \t\t\t\tpath\n * @param object \t\t\t\ttrap\n * @param object \t\t\t\treciever\n *\n * @return mixed\n */\nexport default function(ctxt, path, trap = {}, reciever = {}) {\n\tpath = _arrFrom(path).slice();\n\tvar _ctxt = ctxt;\n\twhile(!_isUndefined(_ctxt) && !_isNull(_ctxt) && path.length) {\n\t\tvar _key = path.shift();\n\t\tif (!(trap.get ? trap.get(_ctxt, _key) : (_isTypeObject(_ctxt) ? _key in _ctxt : _ctxt[_key]))) {\n\t\t\treciever.exists = false;\n\t\t\treturn;\n\t\t}\n\t\t_ctxt = trap.get ? trap.get(_ctxt, _key) : _ctxt[_key];\n\t}\n\treciever.exists = true;\n\treturn _ctxt;\n};\n", "\n/**\n * @imports\n */\nimport _isTypeObject from '../js/isTypeObject.js';\nimport _isFunction from '../js/isFunction.js';\nimport _isNumeric from '../js/isNumeric.js';\nimport _isArray from '../js/isArray.js';\nimport _arrFrom from '../arr/from.js';\nimport _get from './get.js';\n\n/**\n * Sets a value to the given path.\n *\n * @param object \t\t\t\tobj\n * @param array \t\t\t\tpath\n * @param mixed \t\t\t\tval\n * @param object|function \t\tbuildTree\n * @param object \t\t\t\ttrap\n *\n * @return bool\n */\nexport default function(obj, path, val, buildTree = {}, trap = {}) {\n\tconst _set = (target, key, val) => {\n\t\tif (trap.set) {\n\t\t\treturn trap.set(target, key, val);\n\t\t} else {\n\t\t\tif (_isNumeric(path[i]) && _isArray(target)) {\n\t\t\t\ttarget.push(val);\n\t\t\t} else {\n\t\t\t\ttarget[key] = val;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t};\n\tpath = _arrFrom(path);\n\tvar target = obj;\n\tfor(var i = 0; i < path.length; i ++) {\n\t\tif (i < path.length - 1) {\n\t\t\tif (!target || (!_isTypeObject(target) && !_isFunction(target))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar branch = _get(target, path[i], trap);\n\t\t\tif (!_isTypeObject(branch)) {\n\t\t\t\tif (trap.buildTree === false) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbranch = _isFunction(trap.buildTree) ? trap.buildTree(i) : (_isNumeric(path[i + 1]) ? [] : {});\n\t\t\t\tvar branchSuccess = _set(target, path[i], branch);\n\t\t\t\tif (!branchSuccess) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttarget = branch;\n\t\t} else {\n\t\t\treturn _set(target, path[i], val);\n\t\t}\n\t}\n};\n", "\n/**\n * ---------------------------\n * Binds callbacks to requestAnimationFrame()\n * to create a central \"read/write\" phases for Ctxt access.\n * ---------------------------\n */\n\t\t\t\nexport default class Scheduler {\n\n\t/**\n\t * Starts the loop.\n\t *\n\t * @return this\n\t */\n\tconstructor( window, synthesis = false ) {\n\t\tObject.defineProperty( this, 'window', { value: window } );\n\t\tObject.defineProperty( this, 'readCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, 'writeCallbacks', { value: new Set } );\n\t\tObject.defineProperty( this, '_synthesis', { value: 0, writable: true } );\n\t\tif ( !synthesis && this.window.requestAnimationFrame ) {\n\t\t\tthis._loop();\n\t\t} else { this._synthesis ++; }\n\t}\n\n\tget synthesis() { return this._synthesis; }\n\n\tasync synthesizeWhile( callback ) {\n\t\tthis._synthesis ++;\n\t\tthis._fulfill();\n\t\tconst returnValue = await callback();\n\t\tthis._synthesis --;\n\t\treturn returnValue;\n\t}\n\n\t_fulfill() {\n\t\tfor ( const callback of this.readCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.readCallbacks.delete( callback );\n\t\t}\n\t\tfor ( const callback of this.writeCallbacks ) {\n\t\t\tcallback();\n\t\t\tthis.writeCallbacks.delete( callback );\n\t\t}\n\t}\n\n\t_loop() {\n\t\tthis.window.requestAnimationFrame( () => {\n\t\t\tthis._fulfill();\n\t\t\tthis._loop();\n\t\t} );\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"read\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonread( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.readCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.readCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * Binds a callback to the \"write\" phase.\n\t *\n\t * @param function \tcallback\n\t * @param bool\t\twithPromise\n\t *\n\t * @return void\n\t */\n\tonwrite( callback, withPromise = false ) {\n\t\tif ( withPromise ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tif ( this.synthesis ) {\n\t\t\t\t\tresolve( callback() );\n\t\t\t\t} else {\n\t\t\t\t\tthis.writeCallbacks.add( () => {\n\t\t\t\t\t\tresolve( callback() );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tif ( this.synthesis ) {\n\t\t\tPromise.resolve().then( callback );\n\t\t} else {\n\t\t\tthis.writeCallbacks.add( callback );\n\t\t}\n\t}\n\t\n\t/**\n\t * A special construct for Ctxt manipulations that span\n\t * one or more read/write cycles.\n\t *\n\t * @param function \tread\n\t * @param function \twrite\n\t * @param mixed\t\tprevTransaction\n\t *\n\t * @return void|mixed\n\t */\n\tcycle( onread, onwrite, prevTransaction ) {\n\t\tthis.onread( () => {\n\t\t\t// Record initial values\n\t\t\tconst readReturn = onread( prevTransaction );\n\t\t\t// Call erite, the transation\n\t\t\tconst callWrite = ( readReturn ) => {\n\t\t\t\tif ( readReturn === undefined ) return;\n\t\t\t\tthis.onwrite( () => {\n\t\t\t\t\tconst writeReturn = onwrite( readReturn, prevTransaction );\n\t\t\t\t\t// Repeat transaction\n\t\t\t\t\tconst repeatTransaction = ( writeReturn ) => {\n\t\t\t\t\t\tif ( writeReturn === undefined ) return;\n\t\t\t\t\t\tthis.cycle( onread, onwrite, writeReturn );\n\t\t\t\t\t};\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\t// If \"write\" returns a promise, we wait until it is resolved\n\t\t\t\t\t// ---------------------------------------\n\t\t\t\t\tif ( writeReturn instanceof Promise ) {\n\t\t\t\t\t\twriteReturn.then( repeatTransaction );\n\t\t\t\t\t} else {\n\t\t\t\t\t\trepeatTransaction( writeReturn );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t};\n\t\t\t// ---------------------------------------\n\t\t\t// If \"read\" returns a promise, we wait until it is resolved\n\t\t\t// ---------------------------------------\n\t\t\tif ( readReturn instanceof Promise ) {\n\t\t\t\treadReturn.then( callWrite );\n\t\t\t} else {\n\t\t\t\tcallWrite( readReturn );\n\t\t\t}\n\t\t} );\n\t}\n\n}", "\n\nexport function isXpath( expr ) { return ( expr = expr.trim() ) && expr.startsWith( '(' ) && expr.endsWith( ')' ) }\n\nexport function xpathQuery( window, context, expr, subtree = true ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', subtree ? '(.//' : '(./' ) ).join( '|' );\n let nodes = [], node;\n try {\n // Throws in firefox and safari where context is a text node\n const result = window.document.evaluate( expr, context, null, window.XPathResult.ANY_TYPE );\n while ( node = result.iterateNext() ) nodes.push( node );\n } catch( e ) {}\n return nodes;\n}\n\nexport function xpathMatch( window, node, expr ) {\n expr = ( Array.isArray( expr ) ? expr : [ expr ] ).map( x => ( x + '' ).replace( '(', '(self::' ) ).join( '|' );\n try {\n // Throws in firefox and safari where context is a text node and query isn't\n return window.document.evaluate( `${ expr }`, node, null, window.XPathResult.BOOLEAN_TYPE ).booleanValue;\n } catch( e ) {}\n}\n\nexport function containsNode( window, a, b, crossRoots = false, testCache = null ) {\n const prevTest = testCache?.get( a )?.get( b );\n if ( typeof prevTest !== 'undefined' ) return prevTest;\n const response = val => {\n if ( !testCache?.has( a ) ) testCache?.set( a, new WeakMap );\n testCache?.get( a )?.set( b, val );\n return val;\n };\n const rootNodeA = a.getRootNode();\n const rootNodeB = b.getRootNode();\n if ( rootNodeA === rootNodeB ) return response( a.contains( b ) );\n if ( crossRoots && rootNodeB instanceof window.ShadowRoot ) return response( containsNode( window, a, rootNodeB.host, crossRoots, testCache ) );\n return response( false );\n}\n\nexport function splitOuter( str, delim = '|' ) {\n return [ ...str ].reduce( ( [ quote, depth, splits, skip ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}", "\n/**\n * @imports\n */\nimport * as Util from './Util.js';\n\nexport default class DOMSpec {\n constructor( content ) {\n this.content = content;\n this.type = typeof content === 'string' ? 'selector' : 'instance';\n this.kind = this.type === 'instance' ? null : Util.isXpath( content ) ? 'xpath' : 'css';\n if ( this.kind === 'xpath' ) {\n this.isXpathAttr = Util.splitOuter( content.trim().slice( 1, -1 ), '@' ).length > 1;\n }\n }\n toString() { return this.content; }\n}", "\n/**\n * @imports\n */\nimport { _isFunction, _isObject, _wq } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport DOMSpec from './DOMSpec.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class Realtime\n */\nexport default class Realtime {\n\n\t/**\n\t * @constructor\n\t *\n\t * @param document|Element\tcontext\n\t */\n\tconstructor( context, namespace, window ) {\n\t\tthis.context = context;\n\t\tthis.namespace = namespace;\n\t\tthis.window = context.defaultView || context.ownerDocument?.defaultView || window;\n\t\tthis.document = this.window.document;\n\t\tthis.webqit = this.window.webqit;\n\t\tObject.defineProperty( this, '#', { value: {} } );\n\t}\n\t\n\t/**\n\t * Resolves arguments\n\t * \n\t * @param Array \t\t\targs \n\t * \n\t * @returns Array\n\t */\n\tresolveArgs( args ) {\n\t\tif ( _isFunction( args[ 0 ] ) ) { args = [ [], ...args ]; }\n\t\telse if ( _isObject( args[ 0 ] ) && !( args[ 0 ] instanceof DOMSpec ) && args.length === 1 ) {\n\t\t\targs = [ [], undefined, args[ 0 ] ];\n\t\t} else if ( _isObject( args[ 1 ] ) && args.length === 2 ) {\n\t\t\targs = [ _arrFrom( args[ 0 ], false/*castObject*/ ), undefined, args[ 1 ] ];\n\t\t} else { args[ 0 ] = _arrFrom( args[ 0 ], false/*castObject*/ ); }\n\t\tif ( args[ 0 ].filter( x => typeof x !== 'string' && !( x instanceof DOMSpec ) && !( x instanceof this.window.Node ) ).length ) {\n\t\t\tthrow new Error( `Argument #2 must be either a string or a Node object, or a list of those.` );\n\t\t}\n\t\targs[ 0 ] = args[ 0 ].map( s => s instanceof DOMSpec ? s : new DOMSpec( s ) );\n\t\treturn args;\n\t}\n\n\t/**\n\t * @registry\n\t *\n\t * @param Array\t\t\t\t...args\n\t * \n\t * @returns Map\n\t */\n\tregistry( ...args ) {\n\t\treturn _wq( this.window, 'realdom', this.namespace, ...args );\n\t}\n\t\t\n\t/**\n\t * @createSignalGenerator\n\t * \n\t * @param Object \t\t\tmo \n\t * \n\t * @returns Object\n\t */\n\tcreateSignalGenerator() {\n\t\treturn {\n\t\t\tgenerate() {\n\t\t\t\t// Abort previous\n\t\t\t\tthis.lastController?.abort();\n\t\t\t\tthis.lastController = new AbortController;\n\t\t\t\tconst flags = { signal: this.lastController.signal };\n\t\t\t\treturn flags;\n\t\t\t},\n\t\t\tdisconnect() { this.lastController?.abort(); }\n\t\t}\n\t}\n\t\t\n\t/**\n\t * Loops through registration objects whose contexts match the event context.\n\t * \n\t * @param String \t\tinterceptionTiming\n\t * @param Object|Array \trecord_s\n\t * @param Function \t\tcallback \n\t * \n\t * @returns void\n\t */\n\tforEachMatchingContext( interceptionTiming, record_s, callback ) {\n\t\tconst { window } = this, deferreds = new Set, testCache = new WeakMap;\n\t\tfor ( const [ registration, deferred ] of this.registry( interceptionTiming ) ) {\n\t\t\tlet $records = [].concat( record_s ).filter( record => Util.containsNode( window, registration.context, record.target, registration.params.subtree === 'cross-roots', testCache ) );\n\t\t\tif ( !$records.length ) continue;\n\t\t\tconst args = [ registration, Array.isArray( record_s ) ? $records : $records[ 0 ] ];\n\t\t\tif ( deferred ) deferreds.add( args ); else callback.call( window, ...args );\n\t\t}\n\t\tfor ( const args of deferreds ) callback.call( window, ...args );\n\t\tdeferreds.clear();\n\t}\n\n\t/**\n\t * @disconnectables\n\t * \n\t * @param AbortSignal \t\tsignal\n\t * @param Array \t\t\t...objects \n\t * \n\t * @returns Object\n\t */\n\tdisconnectables( signal, ...objects ) {\n\t\tconst disconnectable = { disconnect() {\n\t\t\tobjects.forEach( d => (\n\t\t\t\td && _isFunction( d.disconnect ) && d.disconnect() \n\t\t\t\t|| _isFunction( d ) && d() \n\t\t\t\t|| _isObject( d ) && ( d.disconnected = true )\n\t\t\t) );\n\t\t} };\n\t\tif ( signal ) signal.addEventListener( 'abort', () => disconnectable.disconnect() );\n\t\treturn disconnectable;\n\t}\n}\n", "\n/**\n * @imports\n */\nimport { _wq } from '@webqit/util/js/index.js';\nimport Realtime from './Realtime.js';\nimport DOMSpec from './DOMSpec.js';\n\n/**\n *\n * @class AttrRealtime\n */\nexport default class AttrRealtime extends Realtime {\n\n\ttype = 'attr';\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'attr', ...args );\n\t}\n\t\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tget( spec, callback = undefined, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// -------------\n\t\tconst records = attrIntersection( context, spec );\n\t\tif ( !callback ) return records;\n\t\tconst signalGenerator = params.lifecycleSignals && this.createSignalGenerator();\n\t\tif ( !originalFilterIsString ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( records, flags, context );\n\t\t} else {\n\t\t\tfor ( const record of records ) {\n\t\t\t\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\t\t\t\tcallback( record, flags, context );\n\t\t\t}\n\t\t}\n\t\t// -------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( originalFilterIsString ? spec[ 0 ] : spec, callback, { newValue: true, ...params } );\n\t\t\treturn this.disconnectables( params.signal, disconnectable_live );\n\t\t}\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec = [], callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( originalFilterIsString ? spec[ 0 ] : spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails && !webqit.realdom.attrInterceptionHooks?.intercepting ) {\n\t\t\tattrInterception.call( window, 'intercept', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => {\n\t\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\t\tdispatch.call( window, registration, records, context );\n\t\t} );\n\t\t// ------------------\n\t\tconst $params = { attributes: true, attributeOldValue: params.oldValue, subtree: params.subtree && true };\n\t\tif ( spec.length ) { $params.attributeFilter = spec.map( a => a + '' ); }\n\t\tdisconnectable.observe( context, $params );\n\t\t// -------------\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|string\t\t\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof spec === 'string' || spec instanceof DOMSpec;\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tattrInterception.call( window, interceptionTiming, records => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, records, dispatch );\n\t\t\t} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() { registry.delete( registration ); } };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n}\n\n/**\n * Deduplicates records.\n * \n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction dedupAndIgnoreInternals( records ) {\n\treturn records.reduce( ( rcds, rcd, i ) => {\n\t\tif ( rcds[ i - 1 ]?.attributeName === rcd.attributeName ) return rcds;\n\t\tif ( _wq( rcd.target, 'realdom', 'internalAttrInteractions' ).get( rcd.attributeName ) ) return rcds;\n\t\treturn rcds.concat( rcd );\n\t}, [] );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration\n * @param Array \t\t\trecords\n * \n * @returns Void\n */\nfunction dispatch( registration, records ) {\n\tconst { context, spec, callback, params, atomics, originalFilterIsString, signalGenerator } = registration;\n\tif (!params.subtree) {\n\t\trecords = records.filter((r) => {\n\t\t\treturn r.target === context;\n\t\t}); \n\t}\n\tif ( !records.length ) return;\n\tconst $spec = spec.map( a => a + '' );\n\tif ( params.atomic && !atomics.size ) {\n\t\trecords = attrIntersection( context, spec, records );\n\t} else if ( params.timing !== 'async' && spec.length ) {\n\t\trecords = records.filter( r => $spec.includes( r.name ) );\n\t}\n\tif ( !records.length ) return;\n\t// Should we care about old / new values being present?\n\tif ( !( params.newValue === null && params.oldValue === null && params.eventDetails ) ) {\n\t\trecords = records.map( rcd => {\n\t\t\tlet exclusion;\n\t\t\tif ( !params.eventDetails ) {\n\t\t\t\t( { event: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.oldValue && ( 'oldValue' in rcd ) ) {\n\t\t\t\t( { oldValue: exclusion, ...rcd } = rcd );\n\t\t\t}\n\t\t\tif ( !params.newValue && ( 'value' in rcd ) ) {\n\t\t\t\t( { value: exclusion, ...rcd } = rcd );\n\t\t\t} else if ( params.newValue && typeof rcd.value === 'undefined' ) {\n\t\t\t\trcd = { ...rcd, value: internalAttrInteraction( rcd.target, rcd.name, () => rcd.target.getAttribute( rcd.name ) ) };\n\t\t\t}\n\t\t\treturn rcd;\n\t\t} );\n\t}\n\tif ( params.atomic ) {\n\t\trecords.forEach( record => atomics.set( record.name, record ) );\n\t\trecords = Array.from( atomics.entries() ).map( ( [ , value ] ) => value );\n\t}\n\tconst record_s = originalFilterIsString ? records[ 0 ] : records;\n\tconst flags = signalGenerator ? signalGenerator.generate() : {};\n\tcallback( record_s, flags, context );\n}\n\n/**\n */\nfunction internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = _wq( node, 'realdom', 'internalAttrInteractions' ).get( attrName );\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t_wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\n/**\n * Helper to determining which records to deliver.\n * \n * @param Object \t\t\tcontext\n * @param Array \t\t\tspec\n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction attrIntersection( context, spec, records = [] ) {\n\tconst _type = { event: null, type: 'attribute' };\n\tif ( spec.length ) {\n\t\treturn spec.map( attrName => {\n\t\t\tattrName = attrName + '';\n\t\t\treturn records.find( r => r.name === attrName ) || { target: context, name: attrName, value: internalAttrInteraction( context, attrName, () => context.getAttribute( attrName ) ), ..._type };\n\t\t} );\n\t}\n\tconst attrs = Array.from( context.attributes );\n\treturn attrs.map( attr => {\n\t\treturn records.find( r => r.name === attr.nodeName ) || { target: context, name: attr.nodeName, value: internalAttrInteraction( context, attr.nodeName, () => attr.nodeValue ), ..._type };\n\t} );\n}\n\n/**\n * Determines the event for an attr mutation record.\n * \n * @param MutationRecord \t{ target, attributeName }\n * \n * @returns Object\n */\nfunction withAttrEventDetails( { target, attributeName, value, oldValue } ) {\n\tconst window = this, registry = window.webqit.realdom.attrInterceptionRecords?.get( target ) || {};\n\tconst event = registry[ attributeName ]?.[ 0 ] || 'mutation';\n\tconst record = { target, name: attributeName, value, oldValue, type: 'observation', event };\n\treturn record;\n}\n\n/**\n * Attributes intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction attrInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Element } = window;\n\tif ( !webqit.realdom.attrInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'attrInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.attrInterceptionHooks.has( timing ) ) { webqit.realdom.attrInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.attrInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.attrInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.attrInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `Attr mutation APIs are now being intercepted.` );\n\twebqit.realdom.attrInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'attrInterceptionRecords', { value: new Map } );\n\n\t// Interception hooks\n\tconst attrIntercept = ( record, defaultAction ) => {\n\t\tif ( !webqit.realdom.attrInterceptionRecords.has( record.target ) ) { webqit.realdom.attrInterceptionRecords.set( record.target, {} ); }\n\t\tconst registry = webqit.realdom.attrInterceptionRecords.get( record.target );\n\t\t// ------------------\n\t\tregistry[ record.name ] = registry[ record.name ] || [];\n\t\tregistry[ record.name ].unshift( record.event );\n\t\tif ( _wq( record.target, 'realdom', 'internalAttrInteractions' ).get( record.name ) ) return defaultAction();\n\t\t// ------------------\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( [ record ] ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( [ record ] ) );\n\t\treturn returnValue;\n\t};\n\n\t// Interception observer WILL need to know non-API-based mutations\n\tconst mo = new window.MutationObserver( records => {\n\t\trecords = records.filter( rcd => {\n\t\t\tconst registry = window.webqit.realdom.attrInterceptionRecords?.get( rcd.target ) || {};\n\t\t\treturn !registry[ rcd.attributeName ]?.shift();\n\t\t} );\n\t\trecords = dedupAndIgnoreInternals( records ).map( rcd => withAttrEventDetails.call( window, rcd ) );\n\t\tif ( !records.length ) return;\n\t\twebqit.realdom.attrInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( records ) );\n\t\twebqit.realdom.attrInterceptionHooks.get( 'sync' )?.forEach( callback => callback( records ) );\n\t} );\n\tmo.observe( document, { attributes: true, subtree: true, attributeOldValue: true } );\n\n\t// Intercept DOM attr mutation methods\n\tconst originalApis = Object.create( null );\n\t[ 'setAttribute', 'removeAttribute', 'toggleAttribute', ].forEach( apiName => {\n\t\toriginalApis[ apiName ] = Element.prototype[ apiName ];\n\t\tElement.prototype[ apiName ] = function( ...args ) {\n\t\t\tlet value, oldValue = internalAttrInteraction( this, args[ 0 ], () => this.getAttribute( args[ 0 ] ) );\n\t\t\tif ( [ 'setAttribute', 'toggleAttribute' ].includes( apiName ) ) { value = args[ 1 ]; }\n\t\t\tif ( apiName === 'toggleAttribute' && value === undefined ) {\n\t\t\t\tvalue = oldValue === null ? true : false;\n\t\t\t}\n\t\t\tconst record = { target: this, name: args[ 0 ], value, oldValue, type: 'interception', event: [ this, apiName ] };\n\t\t\tconst exec = () => originalApis[ apiName ].call( this, ...args );\n\t\t\treturn attrIntercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\n/**\n * @imports\n */\nimport { _isObject } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport AttrRealtime from './AttrRealtime.js';\nimport Realtime from './Realtime.js';\nimport * as Util from './Util.js';\n\n/**\n *\n * @class DOMRealtime\n */\nexport default class DOMRealtime extends Realtime {\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( context, ...args ) {\n\t\tsuper( context, 'tree', ...args );\n\t}\n\n\t/**\n\t * Alias for ( new AttrRealtime() ).all( ... )\n\t */\n\tattr( filter, callback = undefined, params = {} ) {\n\t\tconst { context, window } = this;\n\t\treturn ( new AttrRealtime( context, window ) ).get( ...arguments );\n\t}\n\n\t/**\n\t * Runs a query.\n\t *\n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable|Void\n\t */\n\tquery( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// ------------------\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'query', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ------------------\n\t\tif ( !params.generation || params.generation === 'entrants' ) {\n\t\t\tif ( !spec.length ) {\n\t\t\t\t//if ( params.subtree ) throw new Error( `The subtree option requires a selector to work.` );\n\t\t\t\t[ ...context.children ].forEach( node => getRecord( context ).entrants.push( node ) );\n\t\t\t} else if ( spec.every( s => s.type === 'selector' ) ) {\n\t\t\t\tconst [ cssSelectors, xpathQueries ] = spec.reduce( ( [ css, xpath ], s ) => {\n\t\t\t\t\treturn s.kind === 'xpath' ? [ css, xpath.concat( s ) ] : [ css.concat( s ), xpath ];\n\t\t\t\t}, [ [], [] ] );\n\t\t\t\tconst matches = [];\n\t\t\t\tif ( params.subtree ) {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...context.querySelectorAll( cssSelectors.join( ',' ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries ) ); }\n\t\t\t\t} else {\n\t\t\t\t\tif ( cssSelectors.length ) { matches.push( ...[ ...context.children ].filter( node => node.matches( cssSelectors ) ) ); }\n\t\t\t\t\tif ( xpathQueries.length ) { matches.push( ...Util.xpathQuery( this.window, context, xpathQueries, false ) ); }\n\t\t\t\t}\n\t\t\t\tmatches.forEach( node => getRecord( node.parentNode || context ).entrants.push( node ) );\n\t\t\t}\n\t\t}\n\t\t// ------------------\n\t\tif ( !callback ) return records;\n\t\tconst disconnectable = { disconnected: false };\n\t\tconst signalGenerator = callback && params.lifecycleSignals && this.createSignalGenerator();\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tif ( disconnectable.disconnected ) break;\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t\t// ------------------\n\t\tif ( params.live ) {\n\t\t\tif ( signalGenerator ) { params = { ...params, signalGenerator }; }\n\t\t\tconst disconnectable_live = this.observe( spec, callback, params );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, disconnectable_live );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: false } )\n\t */\n\tchildren( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: false } );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: true } )\n\t */\n\tsubtree( spec, callback = undefined, params = {} ) {\n\t\t[ spec, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( spec, callback, { ...params, subtree: true } );\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserve( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( spec, callback, params );\n\t\tif ( params.timing && params.timing !== 'async' ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\t// ------------------------\n\t\tconst { context, window, webqit, document } = this;\n\t\t// ------------------\n\t\tif ( params.eventDetails ) { webqit.realdom.domInterceptionRecordsAlwaysOn = true; }\n\t\tif ( ( document.readyState === 'loading' || webqit.realdom.domInterceptionRecordsAlwaysOn ) && !webqit.realdom.domInterceptionHooks?.intercepting ) {\n\t\t\tdomInterception.call( window, 'sync', () => {} );\n\t\t}\n\t\t// -------------\n\t\tconst disconnectable = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tdispatch.call( window, registration, withEventDetails.call( window, record ), context );\n\t\t} ) );\n\t\tdisconnectable.observe( context, { childList: true, subtree: params.subtree && true, } );\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\t\n\t/**\n\t * Mutation Interceptor\n\t * \n\t * @param array|Element|string\t\tspec\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t * \n\t * @returns Disconnectable\n\t */\n\tobserveSync( spec, callback, params = {} ) {\n\t\t[ spec, callback, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context, window } = this;\t\t\n\t\t// -------------\n\t\tif ( params.timing && ![ 'sync', 'intercept' ].includes( params.timing ) ) throw new Error( `Timing option \"${ params.timing }\" invalid.` );\n\t\tconst interceptionTiming = params.timing === 'intercept' ? 'intercept' : 'sync';\n\t\tif ( !this.registry( interceptionTiming ).size ) {\n\t\t\t// One handler per intercept/sync registry\n\t\t\tdomInterception.call( window, interceptionTiming, record => {\n\t\t\t\tthis.forEachMatchingContext( interceptionTiming, record, dispatch );\n\t\t\t} );\n\t\t}\n\t\tconst mo = new window.MutationObserver( records => records.forEach( record => {\n\t\t\tif ( Array.isArray( ( record = withEventDetails.call( window, record ) ).event ) ) return;\n\t\t\tdispatch.call( window, registration, record, context );\n\t\t} ) );\n\t\tmo.observe( context, { childList: true, subtree: params.subtree && true } );\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() {\n\t\t\tregistry.delete( registration );\n\t\t\tmo.disconnect();\n\t\t} };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, spec, callback, params, signalGenerator, disconnectable };\n\t\tconst registry = this.registry( interceptionTiming );\n\t\tregistry.set( registration, !!registration.params.deferred );\n\t\t// -------------\n\t\tif ( params.staticSensitivity ) {\n\t\t\tconst disconnectable_attr = staticSensitivity.call( window, registration );\n\t\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator, disconnectable_attr );\n\t\t}\n\t\treturn this.disconnectables( params.signal, disconnectable, signalGenerator );\n\t}\n\n\t/**\n\t * Tracks the connectedness of element references.\n\t *\n\t * @param array|Element\t\t\t\telements\n\t * @param function\t\t\t\t\tcallback\n\t * @param object\t\t\t\t\tparams\n\t *\n\t * @return Disconnectable\n\t */\n\ttrack( elements, callback, params = {} ) {\n\t\tparams = { subtree: true, ...params };\n\t\treturn this.observe( elements, record => {\n\t\t\tif ( record.entrants.length ) callback( true, Array.isArray( elements ) ? record.entrants : record.entrants[ 0 ] );\n\t\t\tif ( record.exits.length ) callback( false, Array.isArray( elements ) ? record.exits : record.exits[ 0 ] );\n\t\t}, params );\n\t}\n}\n\n/**\n * Sensitivty for attribute changes for attribute spec.\n * \n * @param object registration\n * \n * @returns Disconnectable\n */\nfunction staticSensitivity( registration ) {\n\tconst window = this;\n\tconst { context, spec, callback, params, signalGenerator } = registration;\n\tconst cssSelectors = spec.filter( s => s.kind === 'css' );\n\tconst parseDot = selector => selector.match( /\\.([\\w-]+)/g )?.length ? [ 'class' ] : [];\n\tconst parseHash = selector => selector.match( /#([\\w-]+)/g )?.length ? [ 'id' ] : [];\n\tconst parse = selector => [ ...selector.matchAll( /\\[([^\\=\\]]+)(\\=[^\\]]+)?\\]/g ) ].map( x => x[ 1 ] ).concat( parseDot( selector ) ).concat( parseHash( selector ) );\n\tif ( !( registration.$attrs = Array.from( new Set( cssSelectors.filter( s => ( s + '' ).includes( '[' ) ).reduce( ( attrs, selector ) => attrs.concat( parse( selector + '' ) ), [] ) ) ) ).length ) return;\n\t// ---------\n\tconst entrants = new Set, exits = new Set;\n\tentrants.push = val => ( exits.delete( val ), entrants.add( val ) );\n\texits.push = val => ( entrants.delete( val ), exits.add( val ) );\n\tregistration.$deliveryCache = { entrants, exits };\n\t// ---------\n\treturn ( new AttrRealtime( context, window ) ).observe( registration.$attrs, _records => {\n\t\tconst records = new Map, getRecord = target => {\n\t\t\tif ( !records.has( target ) ) { records.set( target, { target, entrants: [], exits: [], type: 'static', event: null } ); }\n\t\t\treturn records.get( target );\n\t\t};\n\t\t// ---------\n\t\tconst matchesCache = new WeakMap;\n\t\tconst matches = node => {\n\t\t\tif ( !matchesCache.has( node ) ) { matchesCache.set( node, cssSelectors.some( s => node.matches( s + '' ) ) ); }\n\t\t\treturn matchesCache.get( node );\n\t\t};\n\t\t// ---------\n\t\tfor ( const _record of _records ) {\n\t\t\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\t\t\tif ( params.generation && generation !== params.generation ) return;\n\t\t\t\tif ( registration.$deliveryCache[ generation ].has( _record.target ) || ( generation === 'entrants' ? !matches( _record.target ) : matches( _record.target ) ) ) return;\n\t\t\t\tregistration.$deliveryCache[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target )[ generation ].push( _record.target );\n\t\t\t\tgetRecord( _record.target ).event = _record.event;\n\t\t\t} );\n\t\t}\n\t\t// ---------\n\t\tfor ( const [ , record ] of records ) {\n\t\t\tconst flags = signalGenerator?.generate() || {};\n\t\t\tcallback( record, flags, context );\n\t\t}\n\t}, { subtree: params.subtree, timing: params.timing, eventDetails: params.eventDetails } );\n}\n\n/**\n * Dispatches a mutation record if it matches the observed.\n * \n * @param Object \t\t\tregistration \n * @param Object \t\t\trecord \n * \n * @returns Void\n */\nfunction dispatch( registration, _record ) {\n\tconst { context, spec, callback, params, signalGenerator, $deliveryCache } = registration;\n\t// ---------\n\tconst record = { ..._record, entrants: [], exits: [] };\n\tif ( !params.eventDetails ) { delete record.event; }\n\t[ 'entrants', 'exits' ].forEach( generation => {\n\t\tif ( params.generation && generation !== params.generation ) return;\n\t\tif ( spec.length ) {\n\t\t\trecord[ generation ] = nodesIntersection.call( this, spec, params.subtree === 'cross-roots', _record[ generation ], _record.event !== 'parse' );\n\t\t} else {\n\t\t\trecord[ generation ] = [ ..._record[ generation ] ];\n\t\t}\n\t\tif ( !$deliveryCache ) return;\n\t\tfor ( const node of record[ generation ] ) {\n\t\t\t$deliveryCache[ generation ].push( node );\n\t\t}\n\t} );\n\t// ---------\n\tif ( !record.entrants.length && !record.exits.length ) return;\n\tconst flags = signalGenerator?.generate() || {};\n\tcallback( record, flags, context );\n}\n\n/**\n * Aggregates instances of els in sources\n * \n * @param Array \t\t\tspec \n * @param Bool \t\t\t\tcrossRoots \n * @param Array \t\t\tsources \n * @param Bool \t\t\t\tdeepIntersect \n * \n * @returns \n */\nfunction nodesIntersection( spec, crossRoots, sources, deepIntersect ) {\n\tsources = Array.isArray( sources ) ? sources : [ ...sources ];\n\tconst match = ( sources, s ) => {\n\t\t// Filter out text nodes\n\t\tif ( s.type === 'selector' ) {\n\t\t\t// Is directly mutated...\n\t\t\tlet matches = s.isXpathAttr ? [] : sources.filter( source => s.kind === 'xpath' ? Util.xpathMatch( this, source, s + '' ) : source.matches && source.matches( s + '' ) );\n\t\t\t// Is contextly mutated...\n\t\t\tif ( deepIntersect || s.isXpathAttr ) {\n\t\t\t\tmatches = sources.reduce( ( collection, source ) => {\n\t\t\t\t\tif ( s.kind === 'xpath' ) { return [ ...collection, ...Util.xpathQuery( this, source, s, deepIntersect ) ]; }\n\t\t\t\t\treturn source.querySelectorAll ? [ ...collection, ...source.querySelectorAll( s + '' ) ] : collection;\n\t\t\t\t}, matches );\n\t\t\t}\n\t\t\tif ( matches.length ) return matches;\n\t\t} else {\n\t\t\t// Is directly mutated...\n\t\t\tif ( sources.includes( s.content ) || (\n\t\t\t\tdeepIntersect && sources.some( source => Util.containsNode( this/* window */, source, s.content, crossRoots ) )\n\t\t\t) ) { return [ s.content ]; }\n\t\t}\n\t};\n\t// Search can be expensive...\n\t// Multiple listeners searching the same thing in the same list?\n\tif ( !sources.$$searchCache ) { sources.$$searchCache = new Map; }\n\treturn spec.reduce( ( matches, s ) => {\n\t\tlet _matches;\n\t\tif ( sources.$$searchCache.has( s.content ) ) {\n\t\t\t_matches = sources.$$searchCache.get( s.content );\n\t\t} else {\n\t\t\t_matches = match( sources, s ) || [];\n\t\t\tif ( s.type === 'instance' ) {\n\t\t\t\tsources.$$searchCache.set( s.content, _matches );\n\t\t\t}\n\t\t}\n\t\treturn matches.concat( _matches );\n\t}, [] );\n}\n\n/**\n * Determines the event for a mutation record\n * \n * @param MutationRecord \t{ target, entrants, exits }\n * \n * @returns Object\n */\nfunction withEventDetails( { target, addedNodes, removedNodes } ) {\n\tlet window = this, event;\n\tevent = _arrFrom( addedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), null );\n\tevent = _arrFrom( removedNodes ).reduce( ( prev, node ) => prev || window.webqit.realdom.domInterceptionRecords?.get( node ), event );\n\tevent = event || window.document.readyState === 'loading' && 'parse' || 'mutation';\n\treturn { target, entrants: addedNodes, exits: removedNodes, type: 'observation', event };\n}\n\n/**\n * DOM intersection engine.\n * \n * @param String \t\t\ttiming \n * @param Function \t\t\tcallback \n * \n * @returns \n */\nfunction domInterception( timing, callback ) {\n\tconst window = this;\n\tconst { webqit, document, Node, CharacterData, Element, HTMLElement, HTMLTemplateElement, DocumentFragment } = window;\n\tif ( !webqit.realdom.domInterceptionHooks ) { Object.defineProperty( webqit.realdom, 'domInterceptionHooks', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionNoRecurse ) { Object.defineProperty( webqit.realdom, 'domInterceptionNoRecurse', { value: new Map } ); }\n\tif ( !webqit.realdom.domInterceptionHooks.has( timing ) ) { webqit.realdom.domInterceptionHooks.set( timing, new Set ); }\n\twebqit.realdom.domInterceptionHooks.get( timing ).add( callback );\n\tconst rm = () => webqit.realdom.domInterceptionHooks.get( timing ).delete( callback );\n\tif ( webqit.realdom.domInterceptionHooks?.intercepting ) return rm;\n\tconsole.warn( `DOM mutation APIs are now being intercepted.` );\n\twebqit.realdom.domInterceptionHooks.intercepting = true;\n\tObject.defineProperty( webqit.realdom, 'domInterceptionRecords', { value: new Map } );\n\n\t// No recursion helper\n\tconst noRecurse = ( node, method, callback ) => {\n\t\twebqit.realdom.domInterceptionNoRecurse.set( node, method );\n\t\tconst returnValue = callback();\n\t\twebqit.realdom.domInterceptionNoRecurse.delete( node );\n\t\treturn returnValue;\n\t};\n\n\t// Interception hooks\n\tconst intercept = ( record, defaultAction ) => {\n\t\trecord.entrants.concat( record.exits ).forEach( node => {\n\t\t\tclearTimeout( webqit.realdom.domInterceptionRecords.get( node )?.timeout ); // Clear any previous that's still active\n\t\t\twebqit.realdom.domInterceptionRecords.set( node, record.event ); // Main: set event details... and next to timeout details\n\t\t\tconst timeout = setTimeout( () => { webqit.realdom.domInterceptionRecords.delete( node ); }, 0 );\n\t\t\tObject.defineProperty( record.event, 'timeout', { value: timeout, configurable: true } );\n\t\t} );\n\t\twebqit.realdom.domInterceptionHooks.get( 'intercept' )?.forEach( callback => callback( record ) );\n\t\tconst returnValue = defaultAction();\n\t\twebqit.realdom.domInterceptionHooks.get( 'sync' )?.forEach( callback => callback( record ) );\n\t\treturn returnValue;\n\t};\n\n\t// Intercept DOM mutation methods\n\tconst _apiNames = {\n\t\t// Note the order\n\t\tShadowRoot: [ 'innerHTML', 'setHTMLUnsafe' ],\n\t\tDocumentFragment: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tDocument: [ 'replaceChildren', 'append', 'prepend' ],\n\t\tHTMLElement: [ 'outerText', 'innerText' ],\n\t\tElement: [ 'append', 'prepend', 'before', 'after', 'insertAdjacentElement', 'insertAdjacentHTML', 'remove', 'replaceChildren', 'replaceWith', 'setHTMLUnsafe', 'innerHTML', 'outerHTML' ],\n\t\tCharacterData: [ 'before', 'after', 'remove', 'replaceWith' ],\n\t\tNode: [ 'insertBefore', 'replaceChild', 'removeChild', 'appendChild', 'textContent', 'nodeValue' ],\n\t};\n\tconst _apiOriginals = {\n\t\t// Note the order\n\t\tShadowRoot: Object.create( null ), // extends DocumentFragment\n\t\tDocumentFragment: Object.create( null ), // extends Node\n\t\tDocument: Object.create( null ), // extends Node\n\t\tHTMLElement: Object.create( null ), // extends Element,\n\t\tElement: Object.create( null ), // extends Node\n\t\tCharacterData: Object.create( null ), // extends Node\n\t\tNode: Object.create( null ),\n\t};\n\n\tconst _apiNamesUnique = new Set( Object.values( _apiNames ).reduce( ( all, apis ) => all.concat( apis ), [] ) );\n\t_apiNamesUnique.forEach( apiName => {\n\t\t\n\t\tObject.keys( _apiNames ).forEach( DOMClassName => {\n\t\t\tif ( !_apiNames[ DOMClassName ].includes( apiName ) ) return;\n\t\t\tconst _apiOriginal = Object.getOwnPropertyDescriptor( window[ DOMClassName ].prototype, apiName );\n\t\t\tif ( !_apiOriginal ) return; // Typically: Element:setHTMLUnsafe\n\t\t\tObject.defineProperty( window[ DOMClassName ].prototype, apiName, 'value' in _apiOriginal ? { ..._apiOriginal, value: method } : { ..._apiOriginal, set: setter } );\n\t\t\t_apiOriginals[ DOMClassName ][ apiName ] = _apiOriginal;\n\t\t} );\n\n\t\tfunction method( ...args ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\tif ( webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'insertBefore' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'insertAdjacentElement', 'insertAdjacentHTML' ].includes( apiName ) ) {\n\t\t\t\tentrants = [ args[ 1 ] ];\n\t\t\t\tif ( [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t} else if ( [ 'setHTMLUnsafe', 'replaceChildren' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\tentrants = apiName === 'replaceChildren' ? [ ...args ] : [ args[ 0 ] ];\n\t\t\t} else if ( [ 'replaceWith', 'remove' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\tentrants = apiName === 'replaceWith' ? [ ...args ] : [];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else if ( [ 'replaceChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ args[ 1 ] ];\n\t\t\t\tentrants = [ args[ 0 ] ];\n\t\t\t} else if ( [ 'removeChild' ].includes( apiName ) ) {\n\t\t\t\texits = [ ...args ];\n\t\t\t} else {\n\t\t\t\t// 'before', 'after', 'append', 'prepend', 'appendChild'\n\t\t\t\tentrants = [ ...args ];\n\t\t\t\tif ( [ 'before', 'after' ].includes( apiName ) ) {\n\t\t\t\t\ttarget = this.parentNode;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to entrants\n\t\t\tlet apiNameFinal = apiName;\n\t\t\tif ( [ 'insertAdjacentHTML', 'setHTMLUnsafe' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'insertAdjacentHTML' && [ 'beforebegin', 'afterend' ].includes( args[ 0 ] ) ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return $apiOriginals[ apiName ].value.call( this, ...args );\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\t$apiOriginals.setHTMLUnsafe.value.call( temp, entrants[ 0 ], apiName === 'setHTMLUnsafe' ? args[ 1 ] : {} );\n\t\t\t\tentrants = [ ...temp.childNodes ];\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'insertAdjacentHTML' ) {\n\t\t\t\t\tapiNameFinal = 'insertAdjacentElement';\n\t\t\t\t\targs[ 1 ] = new DocumentFragment;\n\t\t\t\t\tnoRecurse( args[ 1 ], 'append', () => args[ 1 ].append( ...temp.childNodes ) );\n\t\t\t\t} else {\n\t\t\t\t\tapiNameFinal = 'replaceChildren';\n\t\t\t\t\targs = [ ...temp.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tif ( !target ) return exec();\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, () => {\n\t\t\t\treturn $apiOriginals[ apiNameFinal ].value.call( this, ...args );\n\t\t\t} );\n\t\t}\n\n\t\tfunction setter( value ) {\n\t\t\tconst DOMClassName = Object.keys( _apiOriginals ).find( name => this instanceof window[ name ] && ( apiName in _apiOriginals[ name ] ) );\n\t\t\tconst $apiOriginals = _apiOriginals[ DOMClassName ];\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tlet exec = () => $apiOriginals[ apiName ].set.call( this, value );\n\t\t\tif ( this instanceof HTMLScriptElement || webqit.realdom.domInterceptionNoRecurse.get( this ) === apiName ) return exec();\n\t\t\t// --------------\n\t\t\t// Obtain exits and entrants\n\t\t\tlet exits = [], entrants = [], target = this;\n\t\t\tif ( [ 'outerHTML', 'outerText' ].includes( apiName ) ) {\n\t\t\t\texits = [ this ];\n\t\t\t\ttarget = this.parentNode;\n\t\t\t} else {\n\t\t\t\t// 'innerHTML', 'innerText', 'textContent', 'nodeValue'\n\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\ttarget = this.content;\n\t\t\t\t\texits = [ ...this.content.childNodes ];\n\t\t\t\t} else {\n\t\t\t\t\texits = [ ...this.childNodes ];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\t// Parse HTML to nodes\n\t\t\tif ( [ 'outerHTML', 'innerHTML' ].includes( apiName ) ) {\n\t\t\t\tlet tempNodeName = this.nodeName;\n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\t// We can't handle this... and this is going to throw afterall\n\t\t\t\t\tif ( !this.parentNode ) return exec();\n\t\t\t\t\ttempNodeName = this.parentNode.nodeName;\n\t\t\t\t}\n\t\t\t\tconst temp = document.createElement( tempNodeName.includes( '-' )/* custom-element | #document-fragment */ ? 'div' : tempNodeName );\n\t\t\t\tnoRecurse( temp, apiName, () => temp[ apiName ] = value );\n\t\t\t\tentrants = this instanceof HTMLTemplateElement ? [ ...temp.content.childNodes ] : [ ...temp.childNodes ];\n\t\t\t\tif ( ( this instanceof HTMLTemplateElement && this.hasAttribute( 'src' ) ) || this instanceof ShadowRoot ) {\n\t\t\t\t\tconst getScripts = nodes => nodes.reduce( ( scripts, el ) => {\n\t\t\t\t\t\tif ( el instanceof HTMLScriptElement ) return scripts.concat( el );\n\t\t\t\t\t\tif ( el instanceof HTMLTemplateElement ) return scripts.concat( getScripts( [ el.content ] ) );\n\t\t\t\t\t\tscripts = scripts.concat( getScripts( [ ...( el.querySelectorAll?.( 'template' ) || [] ) ].map( t => t.content ) ) );\n\t\t\t\t\t\treturn scripts.concat( ...( el.querySelectorAll?.( 'script' ) || [] ) );\n\t\t\t\t\t}, [] );\n\t\t\t\t\tfor ( const script of getScripts( entrants ) ) {\n\t\t\t\t\t\tif (this instanceof ShadowRoot) {\n\t\t\t\t\t\t\tscript.setAttribute('data-handling', 'manual');\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst $script = document.createElement( 'script' );\n\t\t\t\t\t\t[ ...script.attributes ].forEach( attr => $script.setAttribute( attr.name, attr.value ) );\n\t\t\t\t\t\t$script.textContent = script.textContent;\n\t\t\t\t\t\tnoRecurse( script, 'replaceWith', () => script.replaceWith( $script ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// -------------- \n\t\t\t\tif ( apiName === 'outerHTML' ) {\n\t\t\t\t\tvalue = new DocumentFragment;\n\t\t\t\t\tnoRecurse( value, 'append', () => value.append( ...entrants ) );\n\t\t\t\t\texec = () => noRecurse( this, 'replaceWith', () => Element.prototype.replaceWith.call( this, value ) );\n\t\t\t\t} else {\n\t\t\t\t\tif ( this instanceof HTMLTemplateElement ) {\n\t\t\t\t\t\texec = () => noRecurse( this.content, 'replaceChildren', () => this.content.replaceChildren( ...entrants ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\texec = () => noRecurse( this, 'replaceChildren', () => Element.prototype.replaceChildren.call( this, ...entrants ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// --------------\n\t\t\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, exec );\n\t\t}\n\t} );\n\n\treturn rm;\n}\n", "\r\n/**\r\n * Applies all supported polyfills\r\n */\r\nexport default function() {\r\n CSS_escape.call( this );\r\n Node_isConnected.call( this );\r\n Element_matches.call( this );\r\n}\r\n\r\n/**\r\n * Polyfills the window.CSS object.\r\n * \r\n * @return void\r\n */\r\nexport function CSS_escape() {\r\n const window = this;\r\n if ( !window.CSS ) { window.CSS = {} }\r\n if ( !window.CSS.escape ) {\r\n /**\r\n * Polyfills the window.CSS.escape() function.\r\n * \r\n * @param string str \r\n * \r\n * @return string\r\n */\r\n window.CSS.escape = str => str.replace( /([\\:@\\~\\$\\&])/g, '\\\\$1' );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Node.prototype.isConnected property\r\n * \r\n * @see MDN\r\n * \r\n * @return bool\r\n*/\r\nexport function Node_isConnected() {\r\n const window = this;\r\n if ( !( 'isConnected' in window.Node.prototype ) ) {\r\n Object.defineProperty( window.Node.prototype, 'isConnected', { get: function() {\r\n return !this.ownerDocument || !(\r\n this.ownerDocument.compareDocumentPosition( this )\r\n & this.DOCUMENT_POSITION_DISCONNECTED);\r\n } } );\r\n }\r\n}\r\n\r\n/**\r\n * Polyfills the Element.prototype.matches() method\r\n * \r\n * @see MDN\r\n * \r\n * @return void\r\n*/\r\nexport function Element_matches() {\r\n const window = this;\r\n if ( !window.Element.prototype.matches ) {\r\n window.Element.prototype.matches = \r\n window.Element.prototype.matchesSelector || \r\n window.Element.prototype.mozMatchesSelector ||\r\n window.Element.prototype.msMatchesSelector || \r\n window.Element.prototype.oMatchesSelector || \r\n window.Element.prototype.webkitMatchesSelector ||\r\n function( s ) {\r\n var matches = ( this.document || this.ownerDocument ).querySelectorAll( s ),\r\n i = matches.length;\r\n while ( --i >= 0 && matches.item( i ) !== this ) {}\r\n return i > -1; \r\n }\r\n }\r\n}", "\r\n/**\r\n * @imports\r\n */\r\nimport { _isNumeric, _isString, _isFunction } from '@webqit/util/js/index.js';\r\nimport { _set } from '@webqit/util/obj/index.js';\r\nimport Scheduler from './Scheduler.js';\r\nimport DOMRealtime from './realtime/DOMRealtime.js';\r\nimport AttrRealtime from './realtime/AttrRealtime.js';\r\nimport polyfill from './polyfills.js';\r\n\r\nexport default function() {\r\n const window = this;\r\n if ( !window.webqit ) window.webqit = {};\r\n if ( window.webqit.realdom ) return window.webqit.realdom;\r\n window.webqit.realdom = {};\r\n polyfill.call( window );\r\n // ------\r\n window.webqit.realdom.meta = ( ...args ) => meta.call( window, ...args );\r\n window.webqit.realdom.ready = ( ...args ) => ready.call( window, ...args );\r\n // ------\r\n window.webqit.realdom.realtime = ( context, namespace = 'dom' ) => {\r\n if ( namespace === 'dom' ) return new DOMRealtime( context, window );\r\n if ( namespace === 'attr' ) return new AttrRealtime( context, window );\r\n };\r\n // ------\r\n const scheduler = new Scheduler( window );\r\n window.webqit.realdom.schedule = ( type, ...args ) => {\r\n return scheduler[ `on${ type }` ]( ...args );\r\n };\r\n window.webqit.realdom.synthesizeWhile = ( ...args ) => {\r\n return scheduler.synthesizeWhile( ...args );\r\n };\r\n // ------\r\n return window.webqit.realdom;\r\n}\r\n\r\n\r\n/**\r\n * DOM-ready listeners.\r\n * \r\n * @param Function\t \t\tcallback\r\n * \r\n * @return void\r\n */\r\nfunction ready( ...args ) {\r\n let timing = 'interactive', callback;\r\n if ( _isString( args[ 0 ] ) ) {\r\n timing = args[ 0 ];\r\n if ( _isFunction( args[ 1 ] ) ) { callback = args[ 1 ]; }\r\n } else if ( _isFunction( args[ 0 ] ) ) { callback = args[ 0 ]; }\r\n // --------------\r\n const timings = { interactive: [ 'interactive', 'complete' ], complete: [ 'complete' ], };\r\n if ( !timings[ timing ] ) throw new Error( `Invalid ready-state timing: ${ timing }.` );\r\n\tconst window = this;\r\n // --------------\r\n if ( !callback ) {\r\n if ( !window.webqit.realdom.readyStatePromises ) {\r\n window.webqit.realdom.readyStatePromises = {\r\n interactive: new Promise( res => ready.call( this, 'interactive', res ) ),\r\n complete: new Promise( res => ready.call( this, 'complete', res ) ),\r\n };\r\n }\r\n return window.webqit.realdom.readyStatePromises[ timing ];\r\n }\r\n // --------------\r\n\tif ( timings[ timing ].includes( window.document.readyState ) ) return callback( window );\r\n if ( !window.webqit.realdom.readyStateCallbacks ) {\r\n window.webqit.realdom.readyStateCallbacks = { interactive: [], complete: [] };\r\n window.document.addEventListener( 'readystatechange', () => {\r\n const state = window.document.readyState;\r\n for ( const callback of window.webqit.realdom.readyStateCallbacks[ state ].splice( 0 ) ) {\r\n callback( window );\r\n }\r\n }, false );\r\n }\r\n window.webqit.realdom.readyStateCallbacks[ timing ].push( callback );\r\n}\r\n\r\n/**\r\n * A webqit's meta tag props reader.\r\n * \r\n * @param String name\r\n * \r\n * @return Object\r\n */\r\nfunction meta( name ) {\r\n const window = this;\r\n let _content = {}, _el;\r\n if ( _el = window.document.querySelector( `meta[name=\"${ name }\"]` ) ) {\r\n _content = ( _el.content || '' ).split( ';' ).filter( v => v ).reduce( ( _metaVars, directive ) => {\r\n const directiveSplit = directive.split( '=' ).map( d => d.trim() );\r\n _set( _metaVars, directiveSplit[ 0 ].split( '.' ), directiveSplit[ 1 ] === 'true' ? true : (directiveSplit[ 1 ] === 'false' ? false : (\r\n _isNumeric( directiveSplit[ 1 ] ) ? parseInt( directiveSplit[ 1 ] ) : directiveSplit[ 1 ]\r\n ) )\r\n );\r\n return _metaVars;\r\n }, {} );\r\n }\r\n return { get name() { return name; }, get content() { return _el.content; }, json() {\r\n\t\treturn JSON.parse( JSON.stringify( _content ) );\r\n } };\r\n}", "\n/**\n * Converts a string to title case.\n *\n * @param string \tstr\n * @param bool \t\tstrict\n *\n * @return string\n */\nexport default function(str, strict) {\n\tif (typeof str !== 'string') {\n\t\treturn str;\n\t}\n\treturn str.replace(/\\w\\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + ((typeof strict !== undefined && strict) ? txt.substr(1).toLowerCase() : txt.substr(1)); })\n};\n", "\n/**\n * @imports\n */\nimport realdomInit from '@webqit/realdom';\nimport { _wq as __wq } from '@webqit/util/js/index.js';\nimport { _merge } from '@webqit/util/obj/index.js';\nimport { _toTitle } from '@webqit/util/str/index.js';\n\nexport const _wq = ( target, ...args ) => __wq( target, 'oohtml', ...args );\n\nexport const env = {};\n\nexport function _init( name, $config, $defaults ) {\n const window = this, realdom = realdomInit.call( window );\n env.window = window;\n if ( !window.webqitConfig ) {\n window.webqitConfig = realdom.meta( 'webqit' ).json();\n }\n window.webqit || ( window.webqit = {} );\n window.webqit.oohtml || ( window.webqit.oohtml = {} );\n window.webqit.oohtml.configs || ( window.webqit.oohtml.configs = {} );\n // ---------------------\n const configKey = name.toUpperCase().replace( '-', '_' );\n if ( !window.webqit.oohtml.configs[ configKey ] ) {\n window.webqit.oohtml.configs[ configKey ] = {};\n const config = window.webqit.oohtml.configs[ configKey ];\n _merge( 2, config, $defaults, $config, realdom.meta( name ).json() );\n if ( window.webqitConfig.prefix ) {\n Object.keys( config ).forEach( main => {\n Object.keys( config[ main ] ).forEach( key => {\n if ( main === 'api' && typeof config[ main ][ key ] === 'string' ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }${ _toTitle( config[ main ][ key ] ) }`\n } else if ( [ 'attr', 'elements' ].includes( main ) && config[ main ][ key ]?.startsWith( 'data-' ) === false ) {\n config[ main ][ key ] = `${ window.webqitConfig.prefix }-${ config[ main ][ key ] }`\n }\n } );\n } );\n }\n }\n // ---------------------\n return { config: window.webqit.oohtml.configs[ configKey ], realdom, window };\n}\n\nexport function getInternalAttrInteraction( node, attrName ) {\n\treturn __wq( node, 'realdom', 'internalAttrInteractions' ).get( attrName );\n}\nexport function internalAttrInteraction( node, attrName, callback ) {\n\tconst savedAttrLocking = __wq( node, 'realdom', 'internalAttrInteractions' ).get( attrName );\n\t__wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, true );\n\tconst value = callback();\n\t__wq( node, 'realdom', 'internalAttrInteractions' ).set( attrName, savedAttrLocking );\n\treturn value;\n}\n\nexport function _compare( a, b, depth = 1, objectSizing = false ) {\n if ( depth && typeof a === 'object' && a && typeof b === 'object' && b && ( !objectSizing || Object.keys( a ).length === Object.keys( b ).length ) ) {\n for ( let key in a ) {\n if ( !_compare( a[ key ], b[ key ], depth - 1, objectSizing ) ) return false;\n }\n return true;\n }\n if ( Array.isArray( a ) && Array.isArray( b ) && a.length === b.length ) {\n return ( b = b.slice( 0 ).sort() ) && a.slice( 0 ).sort().every( ( valueA, i ) => valueA === b[ i ] );\n }\n return a === b;\n}\n\nexport function _splitOuter( str, delim ) {\n return [ ...str ].reduce( ( [ quote, depth, splits ], x ) => {\n if ( !quote && depth === 0 && ( Array.isArray( delim ) ? delim : [ delim ] ).includes( x ) ) {\n return [ quote, depth, [ '' ].concat( splits ) ];\n }\n if ( !quote && [ '(', '[', '{' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth++;\n if ( !quote && [ ')', ']', '}' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) depth--;\n if ( [ '\"', \"'\", '`' ].includes( x ) && !splits[ 0 ].endsWith( '\\\\' ) ) {\n quote = quote === x ? null : ( quote || x );\n }\n splits[ 0 ] += x;\n return [ quote, depth, splits ]\n }, [ null, 0, [ '' ] ] )[ 2 ].reverse();\n}\n\n// Unique ID generator\nexport const _uniqId = () => ( 0 | Math.random() * 9e6 ).toString( 36 );\n\n// Hash of anything generator\nconst hashTable = new Map;\nexport function _toHash( val ) {\n let hash;\n if ( !( hash = hashTable.get( val ) ) ) {\n hash = _uniqId();\n hashTable.set( val, hash );\n }\n return hash;\n}\n\n// Value of any hash\nexport function _fromHash( hash ) {\n let val;\n hashTable.forEach( ( _hash, _val ) => {\n if ( _hash === hash ) val = _val;\n } );\n return val;\n}", "\n/**\n * @imports\n */\nimport { env } from '../util.js';\n\nexport default function() {\n const { window } = env, { webqit } = window;\n if ( webqit.DOMContextRequestEvent ) return webqit.DOMContextRequestEvent;\n class DOMContextRequestEvent extends window.Event {\n /**\n * @constructor\n */\n constructor( ...args ) {\n const callback = args.pop();\n if ( typeof callback !== 'function' ) throw new Error( `Callback must be provided.` );\n const options = args.pop();\n if ( !options?.kind ) throw new Error( `\"options.kind\" must be specified.` );\n const eventNames = [ 'contextrequest', 'contextclaim' ];\n const type = args.pop() || eventNames[ 0 ];\n if ( !eventNames.includes( type ) ) throw new Error( `Invalid event type. Must be one of: ${ eventNames.join( ',' ) }` );\n // -------------\n const { kind, detail, targetContext, live, signal, diff, ...otherOpts } = options;\n super( type, { ...otherOpts, bubbles: otherOpts.bubbles !== false } );\n // -------------\n Object.defineProperty( this, 'callback', { get: () => callback } );\n Object.defineProperty( this, 'kind', { get: () => kind } );\n Object.defineProperty( this, 'targetContext', { get: () => targetContext } );\n Object.defineProperty( this, 'detail', { get: () => detail } );\n Object.defineProperty( this, 'live', { get: () => live } );\n Object.defineProperty( this, 'signal', { get: () => signal } );\n Object.defineProperty( this, 'diff', { get: () => diff } );\n Object.defineProperty( this, 'options', { get: () => otherOpts } );\n Object.defineProperty( this, 'meta', { value: {} } );\n }\n\n get target() { return super.target || this.meta.target; }\n get answered() { return this.meta.answered || false; }\n\n /**\n * @respondWith\n */\n respondWith( response ) {\n this.meta.answered = true;\n if ( this.diff ) {\n if ( '_prevValue' in this && this._prevValue === response ) return;\n Object.defineProperty( this, '_prevValue', { value: response, configurable: true } );\n }\n return this.callback( response );\n }\n }\n webqit.DOMContextRequestEvent = DOMContextRequestEvent;\n return DOMContextRequestEvent;\n}", "\n/**\n * @imports\n */\nimport { env } from '../util.js';\n\nexport default class DOMContextResponse extends AbortController {\n constructor( callback ) {\n super();\n callback( response => {\n const { window: { webqit: { Observer } } } = env;\n Observer.defineProperty( this, 'value', { value: response, configurable: true, enumerable: true } );\n }, this );\n }\n}", "\nexport default class DuplicateContextError extends Error {}", "\n/**\n * @imports\n */\nimport _DOMContextRequestEvent from './_DOMContextRequestEvent.js';\nimport DOMContextResponse from './DOMContextResponse.js';\nimport DOMContext from './DOMContext.js';\nimport DuplicateContextError from './DuplicateContextError.js';\nimport { _wq } from '../util.js';\n\nconst waitListMappings = new Map;\nexport default class DOMContexts {\n\n /**\n * @instance\n */\n static instance( host ) {\n return _wq( host ).get( 'contexts::instance' ) || new this( host );;\n }\n\n /**\n * @constructor\n */\n constructor( host ) {\n _wq( host ).get( `contexts::instance` )?.dispose();\n _wq( host ).set( `contexts::instance`, this );\n const priv = { host, contexts: new Set };\n Object.defineProperty( this, '#', { get: () => priv } );\n }\n\n /**\n * @Symbol.iterator\n */\n [ Symbol.iterator ] () { return this[ '#' ].contexts[ Symbol.iterator ](); }\n\n /**\n * @length\n */\n get length() { return this[ '#' ].contexts.size; }\n\n /**\n * @find()\n */\n find( ...args ) {\n return [ ...this[ '#' ].contexts ].find( ctx => {\n if ( typeof args[ 0 ] === 'function' ) return args[ 0 ]( ctx );\n return ctx.constructor.kind === args[ 0 ] && ( !args[ 1 ] || ctx.detail === args[ 1 ] );\n } );\n }\n\n /**\n * @attach()\n */\n attach( ctx ) {\n if ( !( ctx instanceof DOMContext) ) throw new TypeError( `Context is not a valid DOMContext instance.` );\n if ( this.find( ctx.constructor.kind, ctx.detail ) ) {\n throw new DuplicateContextError( `Context of same kind \"${ ctx.constructor.kind }\"${ ctx.detail ? ` and detail \"${ ctx.detail }\"` : '' } already exists.` );\n }\n this[ '#' ].contexts.add( ctx );\n ctx.initialize( this[ '#' ].host );\n }\n\n /**\n * @detach()\n */\n detach( ctx ) {\n ctx.dispose( this[ '#' ].host );\n this[ '#' ].contexts.delete( ctx );\n }\n\n /**\n * @request()\n */\n request( ...args ) {\n return new DOMContextResponse( ( emitter, responseInstance ) => {\n if ( typeof args[ args.length - 1 ] !== 'function' ) {\n if ( !args[ args.length - 1 ] ) { args[ args.length - 1 ] = emitter; }\n else { args.push( emitter ); }\n }\n\n let options;\n if ( ( options = args.find( arg => typeof arg === 'object' && arg ) ) && options.live ) {\n if ( options.signal ) options.signal.addEventListener( 'abort', () => responseInstance.abort() );\n args[ args.indexOf( options ) ] = { ...options, signal: responseInstance.signal };\n }\n const event = new ( _DOMContextRequestEvent() )( ...args );\n this[ '#' ].host.dispatchEvent( event );\n } );\n }\n\n}", "\n/**\n * @imports\n */\nimport DOMContexts from './DOMContexts.js';\nimport { env } from '../util.js';\n\nexport default class DOMContext {\n\n /**\n * To be implemented by subclasses\n */\n static kind;\n\n /**\n * @createRequest\n */\n static createRequest() { return { kind: this.kind }; }\n \n /**\n * @constructor\n */\n constructor( detail = null ) {\n Object.defineProperty( this, 'detail', { get: () => detail } );\n Object.defineProperty( this, 'subscriptions', { value: new Set } );\n }\n\n /**\n * @configs\n */\n get configs() {\n const { window: { webqit: { oohtml: { configs } } } } = env;\n return configs;\n }\n\n /**\n * @name\n */\n get name() { return [ env.window.Document, env.window.ShadowRoot ].some( x => this.host instanceof x ) ? Infinity : this.host.getAttribute( this.configs.CONTEXT_API.attr.contextname ); }\n\n /**\n * @subscribed()\n */\n subscribed( event ) {}\n\n /**\n * @handle()\n */\n handle( event ) {}\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) {}\n\n /**\n * @matchEvent\n */\n matchEvent( event ) {\n return event.kind === this.constructor.kind\n && ( !event.targetContext || event.targetContext === this.name );\n }\n\n /**\n * @handleEvent()\n */\n handleEvent( event ) {\n if ( this.disposed || typeof event.respondWith !== 'function' ) return;\n if ( event.type === 'contextclaim' ) {\n if ( !( event.detail instanceof DOMContext ) || event.target === this.host ) return;\n const claims = new Set;\n this.subscriptions.forEach( subscriptionEvent => {\n if ( !event.target.contains( subscriptionEvent.target ) || !event.detail.matchEvent( subscriptionEvent ) ) return;\n this.subscriptions.delete( subscriptionEvent );\n this.unsubscribed( subscriptionEvent );\n claims.add( subscriptionEvent );\n } );\n if ( claims.size ) { return event.respondWith( claims ); }\n }\n if ( event.type === 'contextrequest' ) {\n if ( !this.matchEvent( event ) ) return;\n if ( event.live ) {\n this.subscriptions.add( event );\n this.subscribed( event );\n event.signal?.addEventListener( 'abort', () => {\n this.subscriptions.delete( event );\n this.unsubscribed( event );\n } );\n }\n event.stopPropagation();\n return this.handle( event );\n }\n }\n\n /**\n * @initialize()\n */\n initialize( host ) {\n this.host = host;\n this.disposed = false;\n host.addEventListener( 'contextrequest', this );\n host.addEventListener( 'contextclaim', this );\n const { value: claims } = DOMContexts.instance( host ).request( 'contextclaim', { kind: this.constructor.kind, detail: this } );\n claims?.forEach( subscriptionEvent => {\n this.subscriptions.add( subscriptionEvent );\n this.subscribed( subscriptionEvent );\n this.handle( subscriptionEvent );\n } );\n return this;\n }\n \n /**\n * @dispose()\n */\n dispose( host ) {\n this.disposed = true;\n host.removeEventListener( 'contextrequest', this );\n host.removeEventListener( 'contextclaim', this );\n this.subscriptions.forEach( subscriptionEvent => {\n this.subscriptions.delete( subscriptionEvent );\n this.unsubscribed( subscriptionEvent );\n const { target } = subscriptionEvent;\n subscriptionEvent.meta.answered = false;\n target.dispatchEvent( subscriptionEvent );\n } );\n return this;\n }\n\n}", "\n/**\n * @imports\n */\nimport DOMNamingContext from './DOMNamingContext.js';\nimport { _wq, _init, _splitOuter, _fromHash, _toHash, getInternalAttrInteraction, internalAttrInteraction } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init($config = {}) {\n\tconst { config, window } = _init.call(this, 'namespaced-html', $config, {\n\t\tattr: { namespace: 'namespace', lid: 'id', },\n\t\tapi: { namespace: 'namespace', },\n\t\ttokens: { lidrefPrefix: '~', lidrefSeparator: ':' },\n\t\ttarget: { className: ':target', eventName: ':target', scrolling: true },\n\t});\n\tconfig.lidSelector = `[${window.CSS.escape(config.attr.lid)}]`;\n\tconfig.namespaceSelector = `[${window.CSS.escape(config.attr.namespace)}]`;\n\twindow.webqit.DOMNamingContext = DOMNamingContext;\n\texposeAPIs.call(window, config);\n\trealtime.call(window, config);\n}\n\n/**\n * @init\n * \n * @param Object config\n * \n * @return String\n */\nfunction lidUtil(config) {\n\tconst { lidrefPrefix, lidrefSeparator, } = config.tokens;\n\treturn {\n\t\tescape(str, mode = 1) { return [...str].map(x => !/\\w/.test(x) ? (mode === 2 ? `\\\\\\\\${x}` : `\\\\${x}`) : x).join(''); },\n\t\tlidrefPrefix(escapeMode = 0) { return escapeMode ? this.escape(lidrefPrefix, escapeMode) : lidrefPrefix; },\n\t\tlidrefSeparator(escapeMode = 0) { return escapeMode ? this.escape(lidrefSeparator, escapeMode) : lidrefSeparator; },\n\t\tisUuid(str, escapeMode = 0) { return str.startsWith(this.lidrefPrefix(escapeMode)) && str.includes(this.lidrefSeparator(escapeMode)); },\n\t\t//isLidref( str, escapeMode = 0 ) { return str.startsWith( this.lidrefPrefix( escapeMode ) ) && !str.includes( this.lidrefSeparator( escapeMode ) ); },\n\t\ttoUuid(hash, lid, escapeMode = 0) { return hash.endsWith('-root') ? lid : `${this.lidrefPrefix(escapeMode)}${hash}${this.lidrefSeparator(escapeMode)}${lid}`; },\n\t\tuuidToId(str, escapeMode = 0) { return this.isUuid(str) ? str.split(this.lidrefSeparator(escapeMode))[1] : str; },\n\t\tuuidToLidref(str, escapeMode = 0) { return this.isUuid(str) ? `${this.lidrefPrefix(escapeMode)}${str.split(this.lidrefSeparator(escapeMode))[1]}` : str; },\n\t}\n}\n\n/**\n * @rewriteSelector\n * \n * @param String selectorText\n * @param String namespaceUUID\n * @param String scopeSelector\n * @param Bool escapeMode\n * \n * @return String\n */\nexport function rewriteSelector(selectorText, namespaceUUID, scopeSelector = null, escapeMode = 0) {\n\tconst window = this, { webqit: { oohtml: { configs: { NAMESPACED_HTML: config } } } } = window;\n\tconst $lidUtil = lidUtil(config);\n\t// Match :scope and relative ID selector\n\tconst regex = new RegExp(`${scopeSelector ? `:scope|` : ''}#(${$lidUtil.lidrefPrefix(escapeMode + 1)})?([\\\\w]+${$lidUtil.lidrefSeparator(escapeMode + 1)})?((?:[\\\\w-]|\\\\\\\\.)+)`, 'g');\n\t// Parse potentially combined selectors individually and categorise into categories per whether they have :scope or not\n\tconst [cat1, cat2] = _splitOuter(selectorText, ',').reduce(([cat1, cat2], selector) => {\n\t\t// The deal: match and replace\n\t\tlet quotesMatch, hadScopeSelector;\n\t\tselector = selector.replace(regex, (match, lidrefPrefixMatch, lidrefSeparatorMatch, id, index) => {\n\t\t\tif (!quotesMatch) { // Lazy: stuff\n\t\t\t\t// Match strings between quotes (single or double) and use that qualify matches above\n\t\t\t\t// The string: String.raw`She said, \"Hello, John. I\\\"m your friend.\" or \"you're he're\" 'f\\'\"j\\'\"f'jfjf`;\n\t\t\t\t// Should yield: `\"Hello, John. I\\\\\"m your friend.\"`, `\"you're he're\"`, `'f\\\\'\"j\\\\'\"f'`\n\t\t\t\tquotesMatch = [...selector.matchAll(/([\"'])(?:(?=(\\\\?))\\2.)*?\\1/g)];\n\t\t\t}\n\t\t\t// Qualify match\n\t\t\tif (quotesMatch.some(q => index > q.index && index + match.length < q.index + q[0].length)) return match;\n\t\t\t// Replace :scope\n\t\t\tif (match === ':scope') {\n\t\t\t\thadScopeSelector = true;\n\t\t\t\treturn scopeSelector;\n\t\t\t}\n\t\t\tconst isLidref = lidrefPrefixMatch && !lidrefSeparatorMatch;\n\t\t\tconst isUuid = lidrefPrefixMatch && lidrefSeparatorMatch;\n\t\t\tif (isUuid) {\n\t\t\t\treturn `#${$lidUtil.escape(match.replace('#', ''), 1)}`;\n\t\t\t}\n\t\t\t// Rewrite relative ID selector\n\t\t\tif (isLidref) {\n\t\t\t\tif (config.attr.lid === 'id' && namespaceUUID && !namespaceUUID.endsWith('-root')) {\n\t\t\t\t\treturn `#${$lidUtil.toUuid(namespaceUUID, id, 1)}`;\n\t\t\t\t}\n\t\t\t\t// Fallback to attr-based\n\t\t\t}\n\t\t\t// Rewrite absolute ID selector\n\t\t\tlet rewrite;\n\t\t\tif (config.attr.lid === 'id') {\n\t\t\t\trewrite = `:is(#${id},[id^=\"${$lidUtil.lidrefPrefix(escapeMode)}\"][id$=\"${$lidUtil.lidrefSeparator(escapeMode)}${id}\"])`;\n\t\t\t} else {\n\t\t\t\trewrite = `:is(#${id},[${window.CSS.escape(config.attr.lid)}=\"${id}\"])`;\n\t\t\t}\n\t\t\treturn isLidref ? `:is(${rewrite}):not(${scopeSelector ? scopeSelector + ' ' : ''}${config.namespaceSelector} *)` : rewrite;\n\t\t});\n\t\t// Category 2 has :scope and category 1 does not\n\t\treturn hadScopeSelector ? [cat1, cat2.concat(selector)] : [cat1.concat(selector), cat2];\n\t}, [[], []]);\n\t// Do the upgrade\n\tlet newSelectorText;\n\tif (scopeSelector && cat1.length) {\n\t\tnewSelectorText = [cat1.length > 1 ? `${scopeSelector} :is(${cat1.join(', ')})` : `${scopeSelector} ${cat1[0]}`, cat2.join(', ')].filter(x => x).join(', ');\n\t} else {\n\t\tnewSelectorText = [...cat1, ...cat2].join(', ');\n\t}\n\treturn newSelectorText;\n}\n\n/**\n * @param Element node\n *\n * @return Object\n */\nexport function getOwnNamespaceObject(node) {\n\tconst window = this;\n\tif (!_wq(node).has('namespace')) {\n\t\tconst namespaceObj = Object.create(null);\n\t\t_wq(node).set('namespace', namespaceObj);\n\t\tconst isDocumentRoot = [window.Document, window.ShadowRoot].some(x => node instanceof x);\n\t\tObject.defineProperty(namespaceObj, Symbol.toStringTag, {\n\t\t\tget() {\n\t\t\t\treturn isDocumentRoot ? 'RootNamespaceRegistry' : 'NamespaceRegistry';\n\t\t\t}\n\t\t});\n\t}\n\treturn _wq(node).get('namespace');\n}\n\n/**\n * @param Element node\n * @param Bool forID\n *\n * @return Object\n */\nexport function getOwnerNamespaceObject(node, forID = false) {\n\tconst window = this, { webqit: { oohtml: { configs: { NAMESPACED_HTML: config } } } } = window;\n\tconst isDocumentRoot = [window.Document, window.ShadowRoot].some(x => node instanceof x);\n\treturn getOwnNamespaceObject.call(window, isDocumentRoot ? node : ((forID ? node.parentNode : node)?.closest/*can be documentFragment when Shadow DOM*/?.(config.namespaceSelector) || node.getRootNode()));\n}\n\n/**\n * @param Object namespaceObj\n *\n * @return String\n */\nexport function getNamespaceUUID(namespaceObj) {\n\tconst isDocumentRoot = Object.prototype.toString.call(namespaceObj) === '[object RootNamespaceRegistry]';\n\treturn (_fromHash(namespaceObj) || _toHash(namespaceObj)) + (isDocumentRoot ? '-root' : '');\n}\n\n/**\n * Exposes Namespaced HTML with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs(config) {\n\tconst window = this, { webqit: { Observer } } = window;\n\t// The Namespace API\n\t[window.Document.prototype, window.Element.prototype, window.ShadowRoot.prototype].forEach(prototype => {\n\t\t// No-conflict assertions\n\t\tconst type = prototype === window.Document.prototype ? 'Document' : (prototype === window.ShadowRoot.prototype ? 'ShadowRoot' : 'Element');\n\t\tif (config.api.namespace in prototype) { throw new Error(`The ${type} prototype already has a \"${config.api.namespace}\" API!`); }\n\t\t// Definitions\n\t\tObject.defineProperty(prototype, config.api.namespace, {\n\t\t\tget: function () {\n\t\t\t\treturn Observer.proxy(getOwnNamespaceObject.call(window, this));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Performs realtime capture of elements and builds their relationships.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime(config) {\n\tconst window = this, { webqit: { Observer, realdom, oohtml: { configs }, DOMNamingContext } } = window;\n\n\t// ------------\n\t// APIS\n\t// ------------\n\t// See https://wicg.github.io/aom/aria-reflection-explainer.html & https://github.com/whatwg/html/issues/3515 for the ARIA refelction properties idea\n\t// See https://www.w3.org/TR/wai-aria-1.1/#attrs_relationships for the relational ARIA attributes\n\tconst idRefsAttrs = ['aria-owns', 'aria-controls', 'aria-labelledby', 'aria-describedby', 'aria-flowto',];\n\tconst idRefAttrs = ['for', 'list', 'form', 'aria-activedescendant', 'aria-details', 'aria-errormessage', 'popovertarget'];\n\tconst attrList = [config.attr.lid, ...idRefsAttrs, ...idRefAttrs];\n\tconst relMap = { id: 'id'/* just in case it's in attrList */, for: 'htmlFor', 'aria-owns': 'ariaOwns', 'aria-controls': 'ariaControls', 'aria-labelledby': 'ariaLabelledBy', 'aria-describedby': 'ariaDescribedBy', 'aria-flowto': 'ariaFlowto', 'aria-activedescendant': 'ariaActiveDescendant', 'aria-details': 'ariaDetails', 'aria-errormessage': 'ariaErrorMessage', 'popovertarget': 'popoverTargetElement' };\n\tconst $lidUtil = lidUtil(config);\n\tconst uuidsToLidrefs = (node, attrName, getter) => {\n\t\tif (!getInternalAttrInteraction(node, attrName) && _wq(node, 'attrOriginals').has(attrName)) {\n\t\t\treturn _wq(node, 'attrOriginals').get(attrName);\n\t\t}\n\t\tconst value = getter();\n\t\tif (getInternalAttrInteraction(node, attrName)) return value;\n\t\treturn value && value.split(' ').map(x => (x = x.trim()) && (attrName === config.attr.lid ? $lidUtil.uuidToId : $lidUtil.uuidToLidref).call($lidUtil, x)).join(' ');\n\t};\n\n\t// Intercept getElementById()\n\tconst getElementByIdDescr = Object.getOwnPropertyDescriptor(window.Document.prototype, 'getElementById');\n\tObject.defineProperty(window.Document.prototype, 'getElementById', {\n\t\t...getElementByIdDescr, value(id) {\n\t\t\treturn this.querySelector(`#${id}`); // To be rewritten at querySelector()\n\t\t}\n\t});\n\t// Intercept querySelector() and querySelectorAll()\n\tfor (const queryApi of ['querySelector', 'querySelectorAll']) {\n\t\tfor (const nodeApi of [window.Document, window.Element]) {\n\t\t\tconst querySelectorDescr = Object.getOwnPropertyDescriptor(nodeApi.prototype, queryApi);\n\t\t\tObject.defineProperty(nodeApi.prototype, queryApi, {\n\t\t\t\t...querySelectorDescr, value(selector) {\n\t\t\t\t\treturn querySelectorDescr.value.call(this, rewriteSelector.call(window, selector, getNamespaceUUID(getOwnNamespaceObject.call(window, this))));\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\t// Intercept getAttribute()\n\tconst getAttributeDescr = Object.getOwnPropertyDescriptor(window.Element.prototype, 'getAttribute');\n\tObject.defineProperty(window.Element.prototype, 'getAttribute', {\n\t\t...getAttributeDescr, value(attrName) {\n\t\t\tconst getter = () => getAttributeDescr.value.call(this, attrName);\n\t\t\treturn attrList.includes(attrName) && !_wq(this, 'lock').get(attrName) ? uuidsToLidrefs(this, attrName, getter) : getter();\n\t\t}\n\t});\n\t// Hide implementation details on the Attr node too.\n\tconst propertyDescr = Object.getOwnPropertyDescriptor(window.Attr.prototype, 'value');\n\tObject.defineProperty(window.Attr.prototype, 'value', {\n\t\t...propertyDescr, get() {\n\t\t\tconst getter = () => propertyDescr.get.call(this);\n\t\t\treturn attrList.includes(this.name) ? uuidsToLidrefs(this.ownerElement, this.name, getter) : getter();\n\t\t}\n\t});\n\tconst propertyDescr2 = Object.getOwnPropertyDescriptor(window.Node.prototype, 'nodeValue');\n\tObject.defineProperty(window.Node.prototype, 'nodeValue', {\n\t\t...propertyDescr2, get() {\n\t\t\tconst getter = () => propertyDescr2.get.call(this);\n\t\t\treturn this instanceof window.Attr && attrList.includes(this.name) ? uuidsToLidrefs(this.ownerElement, this.name, getter) : getter();\n\t\t}\n\t});\n\t// These APIs should return LIDREFS minus the hash part\n\tfor (const attrName of attrList) {\n\t\tif (!(attrName in relMap)) continue;\n\t\tconst domApis = attrName === 'for' ? [window.HTMLLabelElement, window.HTMLOutputElement]\n\t\t\t: (attrName === 'popovertarget' ? [window.HTMLButtonElement, window.HTMLInputElement] : [window.Element]);\n\t\tfor (const domApi of domApis) {\n\t\t\tconst propertyDescr = Object.getOwnPropertyDescriptor(domApi.prototype, relMap[attrName]);\n\t\t\tif (!propertyDescr) continue;\n\t\t\tObject.defineProperty(domApi.prototype, relMap[attrName], {\n\t\t\t\t...propertyDescr, get() {\n\t\t\t\t\tconst getter = () => propertyDescr.get.call(this, attrName);\n\t\t\t\t\treturn uuidsToLidrefs(this, attrName, getter);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tif (config.attr.lid !== 'id') {\n\t\t// Reflect the custom [config.attr.lid] attribute\n\t\tObject.defineProperty(window.Element.prototype, config.attr.lid, {\n\t\t\tconfigurable: true, enumerable: true, get() {\n\t\t\t\treturn this.getAttribute(config.attr.lid);\n\t\t\t}, set(value) {\n\t\t\t\treturn this.setAttribute(config.attr.lid, value);\n\t\t\t}\n\t\t});\n\t}\n\n\t// ------------\n\t// LOCAL IDS & IDREFS\n\t// ------------\n\tconst attrChange = (entry, attrName, value, callback) => {\n\t\treturn internalAttrInteraction(entry, attrName, () => {\n\t\t\tif (typeof value === 'function') value = value();\n\t\t\treturn callback(value);\n\t\t});\n\t};\n\tconst setupBinding = (entry, attrName, value, newNamespaceObj = null) => {\n\t\tattrChange(entry, attrName, value, value => {\n\t\t\tconst isLidAttr = attrName === config.attr.lid;\n\t\t\tconst namespaceObj = newNamespaceObj || getOwnerNamespaceObject.call(window, entry, isLidAttr);\n\t\t\tconst namespaceUUID = getNamespaceUUID(namespaceObj);\n\t\t\tif (isLidAttr) {\n\t\t\t\tconst id = $lidUtil.uuidToId(value);\n\t\t\t\tif (Observer.get(namespaceObj, id) !== entry) {\n\t\t\t\t\tconst uuid = $lidUtil.toUuid(namespaceUUID, id);\n\t\t\t\t\tif (uuid !== value) { entry.setAttribute('id', uuid); }\n\t\t\t\t\tObserver.set(namespaceObj, id, entry);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t_wq(entry, 'attrOriginals').set(attrName, value); // Save original before rewrite\n\t\t\t\tconst newAttrValue = value.split(' ').map(idref => (idref = idref.trim()) && $lidUtil.isUuid(idref) ? idref : $lidUtil.toUuid(namespaceUUID, idref)).join(' ');\n\t\t\t\tentry.setAttribute(attrName, newAttrValue);\n\t\t\t\t_wq(namespaceObj).set('idrefs', _wq(namespaceObj).get('idrefs') || new Set);\n\t\t\t\t_wq(namespaceObj).get('idrefs').add(entry);\n\t\t\t}\n\t\t});\n\t};\n\tconst cleanupBinding = (entry, attrName, oldValue, prevNamespaceObj = null) => {\n\t\tattrChange(entry, attrName, oldValue, oldValue => {\n\t\t\tconst isLidAttr = attrName === config.attr.lid;\n\t\t\tconst namespaceObj = prevNamespaceObj || getOwnerNamespaceObject.call(window, entry, isLidAttr);\n\t\t\tif (isLidAttr) {\n\t\t\t\tconst id = $lidUtil.uuidToId(oldValue);\n\t\t\t\tif (Observer.get(namespaceObj, id) === entry) {\n\t\t\t\t\tObserver.deleteProperty(namespaceObj, id);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst newAttrValue = _wq(entry, 'attrOriginals').get(attrName);// oldValue.split( ' ' ).map( lid => ( lid = lid.trim() ) && $lidUtil.uuidToLidref( lid ) ).join( ' ' );\n\t\t\t\tif (entry.hasAttribute(attrName)) entry.setAttribute(attrName, newAttrValue);\n\t\t\t\t_wq(namespaceObj).get('idrefs')?.delete(entry);\n\t\t\t}\n\t\t});\n\t};\n\n\t// ------------\n\t// NAMESPACE\n\t// ------------\n\trealdom.realtime(window.document).query(config.namespaceSelector, record => {\n\t\tconst reAssociate = (entry, attrName, oldNamespaceObj, newNamespaceObj) => {\n\t\t\tif (!entry.hasAttribute(attrName)) return;\n\t\t\tconst attrValue = () => entry.getAttribute(attrName);\n\t\t\tcleanupBinding(entry, attrName, attrValue/* Current resolved value as-is */, oldNamespaceObj);\n\t\t\tif (entry.isConnected) { setupBinding(entry, attrName, _wq(entry, 'attrOriginals').get(attrName)/* Saved original value */ || attrValue/* Lest it's ID */, newNamespaceObj); }\n\t\t};\n\t\trecord.exits.forEach(entry => {\n\t\t\tif (entry.isConnected) {\n\t\t\t\tconst namespaceObj = getOwnNamespaceObject.call(window, entry);\n\t\t\t\t// Detach ID and IDREF associations\n\t\t\t\tfor (const node of new Set([...Object.values(namespaceObj), ...(_wq(namespaceObj).get('idrefs') || [])])) {\n\t\t\t\t\tfor (const attrName of attrList) { reAssociate(node, attrName, namespaceObj); }\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Detach ID associations\n\t\t\tconst contextsApi = entry[configs.CONTEXT_API.api.contexts];\n\t\t\tconst ctx = contextsApi.find(DOMNamingContext.kind);\n\t\t\t// Detach namespace instance\n\t\t\tif (ctx) { contextsApi.detach(ctx); }\n\t\t});\n\t\trecord.entrants.forEach(entry => {\n\t\t\t// Claim ID and IDREF associations\n\t\t\tlet newSuperNamespaceObj;\n\t\t\tconst superNamespaceObj = getOwnerNamespaceObject.call(window, entry, true);\n\t\t\tfor (const node of new Set([...Object.values(superNamespaceObj), ...(_wq(superNamespaceObj).get('idrefs') || [])])) {\n\t\t\t\tif ((newSuperNamespaceObj = getOwnerNamespaceObject.call(window, node, true)) === superNamespaceObj) continue;\n\t\t\t\tfor (const attrName of attrList) { reAssociate(node, attrName, superNamespaceObj, newSuperNamespaceObj); }\n\t\t\t}\n\t\t\t// Attach namespace instance\n\t\t\tconst contextsApi = entry[configs.CONTEXT_API.api.contexts];\n\t\t\tif (!contextsApi.find(DOMNamingContext.kind)) { contextsApi.attach(new DOMNamingContext); }\n\t\t});\n\t}, { id: 'namespace-html:namespace', live: true, subtree: 'cross-roots', timing: 'sync', staticSensitivity: true, eventDetails: true });\n\n\t// DOM realtime\n\trealdom.realtime(window.document).query(`[${attrList.map(attrName => window.CSS.escape(attrName)).join('],[')}]`, record => {\n\t\t// We do some caching to prevent redundanct lookups\n\t\tconst namespaceNodesToTest = { forID: new Map, forOther: new Map, };\n\t\tfor (const attrName of attrList) {\n\t\t\t// Point to the right cache\n\t\t\tconst _namespaceNodesToTest = attrName === config.attr.lid ? namespaceNodesToTest.forID : namespaceNodesToTest.forOther;\n\t\t\trecord.exits.forEach(entry => {\n\t\t\t\tif (!entry.hasAttribute(attrName)) return;\n\t\t\t\t// Point to the right namespace node\n\t\t\t\tlet namespaceNodeToTest = _namespaceNodesToTest.get(entry);\n\t\t\t\tif (typeof namespaceNodeToTest === 'undefined') {\n\t\t\t\t\tnamespaceNodeToTest = (attrName === config.attr.lid ? entry.parentNode : entry)?.closest/*can be documentFragment when Shadow DOM*/?.(config.namespaceSelector) || entry.getRootNode().host;\n\t\t\t\t\t_namespaceNodesToTest.set(entry, namespaceNodeToTest);\n\t\t\t\t}\n\t\t\t\tif (namespaceNodeToTest && !namespaceNodeToTest.isConnected) return;\n\t\t\t\tcleanupBinding(entry, attrName, () => entry.getAttribute(attrName)/* Current resolved value as-is */);\n\t\t\t});\n\t\t\trecord.entrants.forEach(entry => {\n\t\t\t\tif (!entry.hasAttribute(attrName)) return;\n\t\t\t\tsetupBinding(entry, attrName, () => entry.getAttribute(attrName)/* Raw value (as-is) that will be saved as original */);\n\t\t\t});\n\t\t}\n\t\tnamespaceNodesToTest.forID.clear();\n\t\tnamespaceNodesToTest.forOther.clear();\n\t}, { id: 'namespace-html:attrs', live: true, subtree: 'cross-roots', timing: 'sync' });\n\t// Attr realtime\n\trealdom.realtime(window.document, 'attr').observe(attrList, records => {\n\t\tfor (const record of records) {\n\t\t\tif (record.oldValue && record.value !== record.oldValue) {\n\t\t\t\tcleanupBinding(record.target, record.name, record.oldValue/* Current resolved value as-is */);\n\t\t\t}\n\t\t\tif (record.value && record.value !== record.oldValue) {\n\t\t\t\tsetupBinding(record.target, record.name, record.value/* Raw value (as-is) that will be saved as original */);\n\t\t\t}\n\t\t}\n\t}, { id: 'namespace-html:attr(attrs)', subtree: 'cross-roots', timing: 'sync', newValue: true, oldValue: true });\n\n\t// ------------\n\t// TARGETS\n\t// ------------\n\tlet prevTarget;\n\tconst activateTarget = () => {\n\t\tif (!window.location.hash?.startsWith(`#${$lidUtil.lidrefPrefix()}`)) return;\n\t\tconst path = window.location.hash?.substring(`#${$lidUtil.lidrefPrefix()}`.length).split('/').map(s => s.trim()).filter(s => s) || [];\n\t\tconst currTarget = path.reduce((prev, segment) => prev && prev[config.api.namespace][segment], window.document);\n\t\tif (prevTarget && config.target.className) { prevTarget.classList.toggle(config.target.className, false); }\n\t\tif (currTarget && currTarget !== window.document) {\n\t\t\tif (config.target.className) { currTarget.classList.toggle(config.target.className, true); }\n\t\t\tif (config.target.eventName) { currTarget.dispatchEvent(new window.CustomEvent(config.target.eventName)); }\n\t\t\tif (config.target.scrolling && path.length > 1) { currTarget.scrollIntoView(); }\n\t\t\tprevTarget = currTarget;\n\t\t}\n\t};\n\t// \"hash\" realtime\n\twindow.addEventListener('hashchange', activateTarget);\n\trealdom.ready(activateTarget);\n\t// ----------------\n}\n", "\n/**\n * @imports\n */\nimport { rewriteSelector, getOwnerNamespaceObject, getNamespaceUUID } from '../namespaced-html/index.js';\nimport { _init, _toHash } from '../util.js';\n\n/**\n * @init\n * \n * @param Object $config\n */\nexport default function init({ advanced = {}, ...$config }) {\n const { config, window } = _init.call( this, 'scoped-css', $config, {\n api: { styleSheets: 'styleSheets' },\n style: { retention: 'retain', mimeTypes: 'text/css', strategy: null },\n } );\n config.styleSelector = (Array.isArray( config.style.mimeTypes ) ? config.style.mimeTypes : config.style.mimeTypes.split( '|' ) ).concat( '' ).reduce( ( selector, mm ) => {\n const qualifier = mm ? `[type=\"${ window.CSS.escape( mm ) }\"]` : ':not([type])';\n return selector.concat( `style${ qualifier }` );\n }, [] ).join( ',' );\n window.webqit.oohtml.Style = {\n compileCache: new Map,\n };\n exposeAPIs.call( window, config );\n realtime.call( window, config );\n}\n\n/**\n * Exposes Bindings with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs( config ) {\n const window = this, styleSheetsMap = new Map;\n // The \"styleSheets\" API\n [ window.Element.prototype ].forEach( prototype => {\n // No-conflict assertions\n const type = 'Element';\n if ( config.api.styleSheets in prototype ) { throw new Error( `The ${ type } prototype already has a \"${ config.api.styleSheets }\" API!` ); }\n // Definitions\n Object.defineProperty( prototype, config.api.styleSheets, { get: function() {\n if ( !styleSheetsMap.has( this ) ) { styleSheetsMap.set( this, [] ); }\n return styleSheetsMap.get( this );\n }, } );\n } );\n // The HTMLStyleElement \"scoped\" property\n Object.defineProperty( window.HTMLStyleElement.prototype, 'scoped', {\n configurable: true,\n get() { return this.hasAttribute( 'scoped' ); },\n set( value ) { this.toggleAttribute( 'scoped', value ); },\n } );\n}\n\n/**\n * Performs realtime capture of elements and builds their relationships.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime( config ) {\n const window = this, { webqit: { oohtml, realdom } } = window;\n const inBrowser = Object.getOwnPropertyDescriptor( globalThis, 'window' )?.get?.toString().includes( '[native code]' ) ?? false;\n if ( !window.CSS.supports ) { window.CSS.supports = () => false; }\n const handled = new WeakSet;\n realdom.realtime( window.document ).query( config.styleSelector, record => {\n record.entrants.forEach( style => {\n if ( handled.has( style ) ) return;\n handled.add( style );\n // Do compilation\n const sourceHash = _toHash( style.textContent );\n const supportsHAS = CSS.supports( 'selector(:has(a,b))' );\n const scopeSelector = style.scoped && ( supportsHAS ? `:has(> style[rand-${ sourceHash }])` : `[rand-${ sourceHash }]` );\n const supportsScope = style.scoped && window.CSSScopeRule && false/* Disabled for buggy behaviour: rewriting selectorText within an @scope block invalidates the scoping */;\n const scopeRoot = style.scoped && style.parentNode || style.getRootNode();\n if ( scopeRoot instanceof window.Element ) {\n scopeRoot[ config.api.styleSheets ].push( style );\n if ( !inBrowser ) return;\n ( supportsHAS ? style : scopeRoot ).toggleAttribute( `rand-${ sourceHash }`, true );\n }\n if ( !inBrowser ) return;\n if ( style.scoped && style.hasAttribute( 'shared' ) ) {\n let compiledSheet;\n if ( !( compiledSheet = oohtml.Style.compileCache.get( sourceHash ) ) ) {\n compiledSheet = createAdoptableStylesheet.call( window, style, null, supportsScope, scopeSelector );\n oohtml.Style.compileCache.set( sourceHash, compiledSheet );\n }\n // Run now!!!\n Object.defineProperty( style, 'sheet', { value: compiledSheet, configurable: true } );\n style.textContent = '\\n/*[ Shared style sheet ]*/\\n';\n } else {\n const transform = () => {\n const namespaceUUID = getNamespaceUUID( getOwnerNamespaceObject.call( window, scopeRoot ) );\n upgradeSheet.call( this, style.sheet, namespaceUUID, !supportsScope && scopeSelector );\n };\n if ( style.isConnected ) { transform(); }\n else { setTimeout( () => { transform(); }, 0 ); }\n }\n } );\n }, { id: 'scoped-css', live: true, subtree: 'cross-roots', timing: 'intercept', generation: 'entrants' } );\n // ---\n}\n\nfunction createAdoptableStylesheet( style, namespaceUUID, supportsScope, scopeSelector ) {\n const window = this, textContent = style.textContent;\n let styleSheet, cssText = supportsScope && scopeSelector ? `@scope (${ scopeSelector }) {\\n${ textContent.trim() }\\n}` : textContent.trim();\n try {\n styleSheet = new window.CSSStyleSheet;\n styleSheet.replaceSync( cssText );\n upgradeSheet.call( this, styleSheet, namespaceUUID, !supportsScope && scopeSelector );\n const adopt = () => style.getRootNode().adoptedStyleSheets.push( styleSheet );\n if ( style.isConnected ) { adopt(); }\n else { setTimeout( () => { adopt(); }, 0 ); }\n } catch( e ) {\n const styleCopy = window.document.createElement( 'style' );\n style.after( styleCopy );\n styleCopy.textContent = cssText;\n styleSheet = styleCopy.sheet;\n upgradeSheet.call( this, styleSheet, namespaceUUID, !supportsScope && scopeSelector );\n }\n return styleSheet;\n}\n\nfunction upgradeSheet( styleSheet, namespaceUUID, scopeSelector = null ) {\n const l = styleSheet?.cssRules.length || -1;\n for ( let i = 0; i < l; ++i ) {\n const cssRule = styleSheet.cssRules[ i ];\n if ( cssRule instanceof CSSImportRule ) {\n // Handle imported stylesheets\n //upgradeSheet( cssRule.styleSheet, namespaceUUID, scopeSelector );\n continue;\n }\n upgradeRule.call( this, cssRule, namespaceUUID, scopeSelector );\n }\n}\n\nfunction upgradeRule( cssRule, namespaceUUID, scopeSelector = null ) {\n if ( cssRule instanceof CSSStyleRule ) {\n // Resolve relative IDs and scoping (for non-@scope browsers)\n upgradeSelector.call( this, cssRule, namespaceUUID, scopeSelector );\n return;\n }\n if ( [ window.CSSScopeRule, window.CSSMediaRule, window.CSSContainerRule, window.CSSSupportsRule, window.CSSLayerBlockRule ].some( type => type && cssRule instanceof type ) ) {\n // Parse @rule blocks\n const l = cssRule.cssRules.length;\n for ( let i = 0; i < l; ++i ) {\n upgradeRule.call( this, cssRule.cssRules[ i ], namespaceUUID, scopeSelector );\n }\n }\n}\n\nfunction upgradeSelector( cssRule, namespaceUUID, scopeSelector = null ) {\n const newSelectorText = rewriteSelector.call( this, cssRule.selectorText, namespaceUUID, scopeSelector, 1 );\n cssRule.selectorText = newSelectorText;\n // Parse nested blocks. (CSS nesting)\n if ( cssRule.cssRules ) {\n const l = cssRule.cssRules.length;\n for ( let i = 0; i < l; ++i ) {\n upgradeSelector.call( this, cssRule.cssRules[ i ], namespaceUUID, /* Nesting has nothing to do with scopeSelector */ );\n }\n }\n}", "\n/**\n * @imports\n */\nimport init from './index.js';\n\n/**\n * @init\n */\ninit.call( window );\n"],
|
|
5
|
+
"mappings": "6KAQe,WAAS,EAAK,CAC5B,MAAO,CAAC,MAAM,QAAQ,CAAG,GAAK,MAAO,IAAQ,UAAY,CAC1D,CCFe,WAAS,EAAK,CAC5B,MAAO,OAAM,QAAQ,CAAG,CACzB,CCDe,WAAS,EAAK,CAC5B,MAAO,OAAO,IAAQ,UACvB,CCHe,WAAS,EAAK,CAC5B,MAAO,KAAQ,MAAQ,IAAQ,EAChC,CCFe,WAAS,EAAK,CAC5B,MAAO,WAAU,QAAW,KAAQ,QAAa,MAAO,GAAQ,IACjE,CCIe,WAAS,EAAK,CAC5B,MAAO,OAAM,QAAQ,CAAG,GAAM,MAAO,IAAQ,UAAY,GAAQ,EAAgB,CAAG,CACrF,CCCe,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