@webqit/oohtml 4.5.6 → 4.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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/html-imports/HTMLModule.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/html-imports/HTMLImportsContext.js", "../src/html-imports/_HTMLImportElement.js", "../src/html-imports/index.js", "../src/html-imports/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 { getDefs } from './index.js';\nimport { _wq, env } from '../util.js';\n\nexport default class HTMLModule {\n\n /**\n * @instance\n */\n static instance( host ) {\n return _wq( host ).get( 'defsmanager::instance' ) || new this( host );\n }\n\n /**\n * @constructor\n */\n constructor( host, parent = null, level = 0 ) {\n const { window } = env, { webqit: { realdom, oohtml: { configs } } } = window;\n _wq( host ).get( `defsmanager::instance` )?.dispose();\n _wq( host ).set( `defsmanager::instance`, this );\n this.window = window;\n this.host = host;\n this.config = configs.HTML_IMPORTS;\n this.parent = parent;\n this.level = level;\n this.defs = getDefs( this.host );\n this.defId = ( this.host.getAttribute( this.config.attr.def ) || '' ).trim();\n this.validateDefId( this.defId );\n // ----------\n this.realtimeA = realdom.realtime( this.host.content ).children( record => {\n this.expose( record.entrants, true );\n this.expose( record.exits, false );\n }, { live: true, timing: 'sync' } );\n // ----------\n this.realtimeB = realdom.realtime( this.host ).attr( [ 'src', 'loading' ], ( ...args ) => this.evaluateLoading( ...args ), {\n live: true,\n atomic: true,\n timing: 'sync',\n lifecycleSignals: true\n } );\n // ----------\n this.realtimeC = this.evalInheritance();\n // ----------\n }\n\n /**\n * Validates export ID.\n * \n * @param String defId\n *\n * @returns Void\n */\n validateDefId( defId ) {\n if ( [ '@', '/', '*', '#' ].some( token => defId.includes( token ) ) ) {\n throw new Error( `The export ID \"${ defId }\" contains an invalid character.` );\n }\n }\n\n /**\n * Maps module contents as defs.\n * \n * @param Array entries\n * @param Bool isConnected\n *\n * @returns Void\n */\n expose( entries, isConnected ) {\n const { window } = env, { webqit: { Observer } } = window;\n let dirty, allFragments = this.defs[ '#' ] || [];\n entries.forEach( entry => {\n if ( entry.nodeType !== 1 ) return;\n const isTemplate = entry.matches( this.config.templateSelector );\n const defId = ( entry.getAttribute( isTemplate ? this.config.attr.def : this.config.attr.fragmentdef ) || '' ).trim();\n if ( isConnected ) {\n if ( isTemplate && defId ) {\n new HTMLModule( entry, this.host, this.level + 1 );\n } else {\n allFragments.push( entry );\n dirty = true;\n if ( typeof requestIdleCallback === 'function' ) {\n requestIdleCallback( () => {\n this.config.idleCompilers?.forEach( callback => callback.call( this.window, entry ) );\n } );\n }\n }\n if ( defId ) {\n this.validateDefId( defId );\n Observer.set( this.defs, ( !isTemplate && '#' || '' ) + defId, entry );\n }\n } else {\n if ( isTemplate && defId ) { HTMLModule.instance( entry ).dispose(); }\n else {\n allFragments = allFragments.filter( x => x !== entry );\n dirty = true;\n }\n if ( defId ) Observer.deleteProperty( this.defs, ( !isTemplate && '#' || '' ) + defId );\n }\n } );\n if ( dirty ) Observer.set( this.defs, '#', allFragments );\n }\n\n /**\n * Evaluates remote content loading.\n *\n * @param AbortSignal signal\n * \n * @returns Void\n */\n evaluateLoading( [ record1, record2 ], { signal } ) {\n const { window: { webqit: { Observer } } } = env;\n const src = ( record1.value || '' ).trim();\n if ( !src ) return;\n let $loadingPromise, loadingPromise = promise => {\n if ( !promise ) return $loadingPromise; // Get\n $loadingPromise = promise.then( () => interception.remove() ); // Set\n };\n const loading = ( record2.value || '' ).trim();\n const interception = Observer.intercept( this.defs, 'get', async ( descriptor, recieved, next ) => {\n if ( loading === 'lazy' ) { loadingPromise( this.load( src, true ) ); }\n await loadingPromise();\n return next();\n }, { signal } );\n if ( loading !== 'lazy' ) { loadingPromise( this.load( src ) ); }\n }\n \n /**\n * Fetches a module's \"src\".\n *\n * @param String src\n *\n * @return Promise\n */\n load( src ) {\n const { window } = env;\n if ( this.host.content.children.length ) return Promise.resolve();\n // Ongoing request?\n if ( this.fetchInFlight?.src === src ) return this.fetchInFlight.request;\n this.fetchInFlight?.controller.abort();\n\n // The promise\n const controller = new AbortController();\n const fire = ( type, detail ) => this.host.dispatchEvent( new window.CustomEvent( type, { detail } ) );\n const request = window.fetch( src, { signal: controller.signal, element: this.host } ).then( response => {\n return response.ok ? response.text() : Promise.reject( response.statusText );\n } ).then( content => {\n this.host.innerHTML = content.trim(); // IMPORTANT: .trim()\n fire( 'load' );\n return this.host;\n } ).catch( e => {\n console.error( `Error fetching the bundle at \"${ src }\": ${ e.message }` );\n this.fetchInFlight = null;\n fire( 'loaderror' );\n return this.host;\n } );\n this.fetchInFlight = { src, request, controller };\n return request;\n }\n\n /**\n * Evaluates module inheritance.\n *\n * @returns Void|AbortController\n */\n evalInheritance( ) {\n if ( !this.parent ) return [];\n const { window: { webqit: { Observer } } } = env;\n let extendedId = ( this.host.getAttribute( this.config.attr.extends ) || '' ).trim();\n let inheritedIds = ( this.host.getAttribute( this.config.attr.inherits ) || '' ).trim().split( ' ' ).map( id => id.trim() ).filter( x => x );\n const handleInherited = records => {\n records.forEach( record => {\n if ( Observer.get( this.defs, record.key ) !== record.oldValue ) return;\n if ( [ 'get'/*initial get*/, 'set', 'def' ].includes( record.type ) ) {\n Observer[ record.type.replace( 'get', 'set' ) ]( this.defs, record.key, record.value );\n } else if ( record.type === 'delete' ) {\n Observer.deleteProperty( this.defs, record.key );\n }\n } );\n };\n const realtimes = [];\n const parentDefsObj = getDefs( this.parent );\n if ( extendedId ) {\n realtimes.push( Observer.reduce( parentDefsObj, [ extendedId, this.config.api.defs, Infinity ], Observer.get, handleInherited, { live: true } ) );\n }\n if ( inheritedIds.length ) {\n realtimes.push( Observer.get( parentDefsObj, inheritedIds.includes( '*' ) ? Infinity : inheritedIds, handleInherited, { live: true } ) );\n }\n return realtimes;\n }\n \n /**\n * Disposes the instance and its processes.\n *\n * @returns Void\n */\n dispose() {\n this.realtimeA.disconnect();\n this.realtimeB.disconnect();\n this.realtimeC.forEach( r => ( r instanceof Promise ? r.then( r => r.abort() ) : r.abort() ) );\n Object.entries( this.defs ).forEach( ( [ key, entry ] ) => {\n if ( key.startsWith( '#' ) ) return;\n HTMLModule.instance( entry ).dispose();\n } );\n }\n}\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 DOMContext from '../context-api/DOMContext.js';\nimport { getDefs } from './index.js';\nimport { env } from '../util.js';\n\nexport default class HTMLImportsContext extends DOMContext {\n\n /**\n * @kind\n */\n static kind = 'html-imports';\n\n /**\n * @createRequest\n */\n static createRequest( detail = null ) {\n const request = super.createRequest();\n if ( detail?.startsWith( '/' ) ) {\n request.detail = detail;\n request.targetContext = Infinity;\n } else if ( detail?.startsWith( '@' ) ) {\n const [ targetContext, ..._detail ] = detail.slice( 1 ).split( /(?<=\\w)(?=\\/|#)/ ).map( s => s.trim() );\n request.targetContext = targetContext;\n request.detail = _detail.join( '' );\n } else { request.detail = detail; }\n return request;\n }\n \n /**\n * @localModules\n */\n get localModules() { return getDefs( this.host ); }\n get inheritedModules() { return this.#inheritedModules; }\n #inheritedModules = {};\n\n /**\n * @handle()\n */\n \n handle( event ) {\n const { window: { webqit: { Observer } } } = env;\n // Any existing event.meta.controller? Abort!\n event.meta.controller?.abort();\n // Parse and translate detail\n let path = ( event.detail || '' ).split( /\\/|(?<=\\w)(?=#)/g ).map( x => x.trim() ).filter( x => x );\n if ( !path.length ) return event.respondWith();\n path = path.join( `/${ this.configs.HTML_IMPORTS.api.defs }/` )?.split( '/' ).map( x => x === '*' ? Infinity : x ) || [];\n // We'll now fulfill request\n const options = { live: event.live, signal: event.signal, descripted: true };\n event.meta.controller = Observer.reduce( this.#modules, path, Observer.get, ( m ) => {\n if ( Array.isArray( m ) ) {\n if ( !m.length ) {\n event.respondWith();\n return;\n }\n // Paths with wildcard\n for ( const n of m ) {\n event.respondWith( n );\n }\n } else {\n event.respondWith( m.value );\n }\n }, options );\n }\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) { event.meta.controller?.abort(); }\n\n /**\n * @initialize()\n */\n #modules;\n #controller1;\n #controller2;\n initialize( host ) {\n this.host = host;\n const { window: { webqit: { Observer } } } = env;\n // ----------------\n // Resolve\n const resolve = () => {\n for (const key of new Set([...Object.keys(this.localModules), ...Object.keys(this.inheritedModules), ...Object.keys(this.#modules)])) {\n if ( !Observer.has( this.localModules, key ) && !Observer.has( this.inheritedModules, key ) ) {\n Observer.deleteProperty( this.#modules, key );\n } else if (key === '#' && Observer.has( this.localModules, key ) && Observer.has( this.inheritedModules, key ) ) {\n Observer.set( this.#modules, key, [...Observer.get( this.localModules, key ), ...Observer.get( this.inheritedModules, key )] );\n } else {\n const _module = Observer.get( this.localModules, key ) || Observer.get( this.inheritedModules, key );\n if ( Observer.get( this.#modules, key ) !== _module ) {\n Observer.set( this.#modules, key, _module );\n }\n }\n }\n };\n // ----------------\n // Observe local\n this.#modules = { ...this.localModules };\n this.#controller1?.abort();\n this.#controller1 = Observer.observe( this.localModules, () => resolve('local'), { timing: 'sync' } );\n // ----------------\n // If host has importscontext attr, compute that\n const $config = this.configs.HTML_IMPORTS;\n if ( this.host.matches && $config.attr.importscontext ) {\n const realdom = this.host.ownerDocument.defaultView.webqit.realdom;\n let prevRef;\n this.#controller2?.disconnect();\n this.#controller2 = realdom.realtime( this.host ).attr( $config.attr.importscontext, ( record, { signal } ) => { \n const moduleRef = ( record.value || '' ).trim();\n if ( moduleRef === prevRef ) return;\n prevRef = moduleRef;\n // This superModules contextrequest is automatically aborted by the injected signal below\n this.#inheritedModules = {};\n const request = { ...this.constructor.createRequest( moduleRef ? `${moduleRef}/*` : '*' ), live: true, signal, diff: true };\n this.host.parentNode[ this.configs.CONTEXT_API.api.contexts ].request( request, ( m ) => {\n if ( !m ) {\n this.#inheritedModules = {};\n resolve('inherited');\n } else if ( m.type === 'delete' ) {\n delete this.#inheritedModules[m.key];\n if ( !Reflect.has( this.localModules, m.key ) ) {\n Observer.deleteProperty( this.#modules, m.key );\n }\n } else {\n this.#inheritedModules[m.key] = m.value;\n if ( !Reflect.has( this.localModules, m.key ) && Reflect.get( this.#modules, m.key ) !== m.value ) {\n Observer.set( this.#modules, m.key, m.value );\n }\n }\n } );\n resolve('inherited');\n }, { live: true, timing: 'sync', oldValue: true, lifecycleSignals: true } );\n }\n // ----------------\n return super.initialize( host );\n }\n \n /**\n * @dispose()\n */\n dispose( host ) {\n // Stop listening for sources\n this.#controller1?.abort();\n this.#controller2?.disconnect();\n // Now, stop listening for contextrequest and contextclaim events\n // And relinquish own subscribers to owner context\n return super.dispose( host );\n }\n}\n", "\n/**\n * @imports\n */\nimport HTMLImportsContext from './HTMLImportsContext.js';\nimport { _wq, env } from '../util.js';\n\n/**\n * Creates the HTMLImportElement class.\n * \n * @param Object config \n * \n * @return HTMLImportElement\n */\nexport default function() {\n const { window } = env, { webqit } = window, { realdom, oohtml: { configs } } = webqit;\n if ( webqit.HTMLImportElement ) return webqit.HTMLImportElement;\n const BaseElement = configs.HTML_IMPORTS.elements.import.includes( '-' ) ? window.HTMLElement : class {};\n class HTMLImportElement extends BaseElement {\n \n /**\n * @instance\n * \n * @param HTMLElement node\n * \n * @returns \n */\n static instance( node ) {\n if ( configs.HTML_IMPORTS.elements.import.includes( '-' ) && ( node instanceof this ) ) return node;\n return _wq( node ).get( 'import::instance' ) || new this( node );\n }\n\n /**\n * @constructor\n */\n constructor( ...args ) {\n super();\n // --------\n const el = args[ 0 ] || this;\n _wq( el ).set( 'import::instance', this );\n Object.defineProperty( this, 'el', { get: () => el, configurable: false } );\n\n const priv = {};\n Object.defineProperty( this, '#', { get: () => priv, configurable: false } );\n priv.slottedElements = new Set;\n\n priv.setAnchorNode = anchorNode => {\n priv.anchorNode = anchorNode;\n return anchorNode;\n };\n\n priv.live = callback => {\n if ( priv.liveImportsRealtime ) throw new Error(`Import element already in live mode.`);\n const parentNode = this.el.isConnected ? this.el.parentNode : priv.anchorNode.parentNode;\n priv.liveImportsRealtime = realdom.realtime( this.el ).attr( configs.HTML_IMPORTS.attr.ref, ( record, { signal } ) => {\n priv.moduleRef = record.value;\n const moduleRef = priv.moduleRef.includes( '#' ) ? priv.moduleRef : `${ priv.moduleRef }#`/* for live children */;\n const request = { ...HTMLImportsContext.createRequest( moduleRef ), live: signal && true, signal, diff: !moduleRef.endsWith('#') };\n parentNode[ configs.CONTEXT_API.api.contexts ].request( request, response => {\n callback( ( response instanceof window.HTMLTemplateElement ? [ ...response.content.children ] : (\n Array.isArray( response ) ? response : response && [ response ]\n ) ) || [] );\n } );\n }, { live: true, timing: 'sync', lifecycleSignals: true } );\n priv.autoDestroyRealtime = realdom.realtime( window.document ).track( parentNode, () => {\n priv.die();\n }, { subtree: 'cross-roots', timing: 'sync', generation: 'exits' } );\n };\n\n priv.die = () => {\n priv.autoDestroyRealtime?.disconnect();\n priv.liveImportsRealtime?.disconnect();\n priv.liveImportsRealtime = null;\n };\n\n priv.hydrate = ( anchorNode, slottedElements ) => {\n anchorNode.replaceWith( priv.setAnchorNode( this.createAnchorNode() ) );\n priv.live( fragments => {\n // The default action\n if ( priv.originalsRemapped ) return this.fill( fragments );\n // Initial remap action\n const identifiersMap = fragments.map( ( fragment, i ) => ( { el: fragment, fragmentDef: fragment.getAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) || '', tagName: fragment.tagName, i } ) );\n slottedElements.forEach( ( slottedElement, i ) => {\n const tagName = slottedElement.tagName, fragmentDef = slottedElement.getAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) || '';\n const originalsMatch = ( i ++, identifiersMap.find( fragmentIdentifiers => fragmentIdentifiers.tagName === tagName && fragmentIdentifiers.fragmentDef === fragmentDef && fragmentIdentifiers.i === i ) );\n if ( originalsMatch ) _wq( slottedElement ).set( 'original@imports', originalsMatch.el ); // Or should we throw integrity error here?\n _wq( slottedElement ).set( 'slot@imports', this.el );\n priv.slottedElements.add( slottedElement );\n } );\n priv.originalsRemapped = true;\n });\n };\n\n priv.autoRestore = ( callback = null ) => {\n priv.autoRestoreRealtime?.disconnect();\n if ( callback ) callback();\n const restore = () => {\n if (this.el.isConnected) return;\n this.el.setAttribute( 'data-nodecount', 0 );\n priv.internalMutation = true;\n priv.anchorNode.replaceWith( this.el );\n priv.internalMutation = false;\n priv.setAnchorNode( null );\n };\n if ( !priv.slottedElements.size ) return restore();\n const autoRestoreRealtime = realdom.realtime( priv.anchorNode.parentNode ).observe( [ ...priv.slottedElements ], record => {\n record.exits.forEach( outgoingNode => {\n _wq( outgoingNode ).delete( 'slot@imports' );\n priv.slottedElements.delete( outgoingNode );\n } );\n if ( !priv.slottedElements.size ) {\n autoRestoreRealtime.disconnect();\n // At this point, ignore if this is a removal involving the whole parent node\n if ( !record.target.isConnected ) return;\n restore();\n }\n }, { subtree: 'cross-roots', timing: 'sync', generation: 'exits' } );\n priv.autoRestoreRealtime = autoRestoreRealtime;\n };\n\n priv.connectedCallback = () => {\n if ( priv.internalMutation ) return;\n priv.live( fragments => this.fill( fragments ) );\n };\n\n priv.disconnectedCallback = () => {\n if ( priv.internalMutation ) return;\n priv.die();\n };\n }\n\n /**\n * Creates the slot's anchor node.\n *\n * @return Element\n */\n createAnchorNode() {\n if ( window.webqit.env !== 'server' ) { return window.document.createTextNode( '' ) }\n const escapeElement = window.document.createElement( 'div' );\n escapeElement.textContent = this.el.outerHTML;\n const anchorNode = window.document.createComment( escapeElement.innerHTML );\n _wq( anchorNode ).set( 'isAnchorNode', true );\n return anchorNode;\n }\n\n /**\n * Fills the slot with slottableElements\n *\n * @param Iterable slottableElements\n *\n * @return void\n */\n fill( slottableElements, r ) {\n if (!this.el.isConnected && (!this[ '#' ].anchorNode || !this[ '#' ].anchorNode.isConnected)) {\n // LiveImports must be responding to an event that just removed the subtree from DOM\n return;\n }\n if ( Array.isArray( slottableElements ) ) { slottableElements = new Set( slottableElements ) }\n // This state must be set before the diffing below and the serialization done at createAnchorNode()\n this.el.setAttribute( 'data-nodecount', slottableElements.size );\n this[ '#' ].autoRestore( () => {\n this[ '#' ].slottedElements.forEach( slottedElement => {\n const slottedElementOriginal = _wq( slottedElement ).get( 'original@imports' );\n // If still available in source, simply leave unchanged\n // otherwise remove it from slot... to reflect this change\n if ( slottableElements.has( slottedElementOriginal ) ) {\n slottableElements.delete( slottedElementOriginal );\n } else {\n this[ '#' ].slottedElements.delete( slottedElement );\n // This removal will not be caught\n slottedElement.remove();\n }\n } );\n // Make sure anchor node is what's in place...\n // not the import element itslef - but all only when we have slottableElements.size\n if ( slottableElements.size && this.el.isConnected ) {\n const newAnchorNode = this[ '#' ].setAnchorNode( this.createAnchorNode() );\n this[ '#' ].internalMutation = true;\n this.el.replaceWith( newAnchorNode );\n this[ '#' ].internalMutation = false;\n }\n // Insert slottables now\n slottableElements.forEach( slottableElement => {\n // Clone each slottable element and give it a reference to its original\n const slottableElementClone = slottableElement.cloneNode( true );\n // The folllowing references must be set before adding to DODM\n if ( !slottableElementClone.hasAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) ) {\n slottableElementClone.toggleAttribute( configs.HTML_IMPORTS.attr.fragmentdef, true );\n }\n _wq( slottableElementClone ).set( 'original@imports', slottableElement );\n _wq( slottableElementClone ).set( 'slot@imports', this.el );\n this[ '#' ].slottedElements.add( slottableElementClone );\n this[ '#' ].anchorNode.before( slottableElementClone );\n } );\n } );\n }\n\n /**\n * Empty slot.\n *\n * @return void\n */\n empty() { this[ '#' ].slottedElements.forEach( slottedElement => slottedElement.remove() ); }\n\n /**\n * Returns the slot's anchorNode.\n *\n * @return array\n */\n get anchorNode() { return this[ '#' ].anchorNode; }\n\n /**\n * Returns the slot's module reference, if any.\n *\n * @return string\n */\n get moduleRef() { return this[ '#' ].moduleRef; }\n\n /**\n * Returns the slot's slotted elements.\n *\n * @return array\n */\n get slottedElements() { return this[ '#' ].slottedElements; }\n }\n if ( configs.HTML_IMPORTS.elements.import.includes( '-' ) ) { customElements.define( configs.HTML_IMPORTS.elements.import, HTMLImportElement ); }\n webqit.HTMLImportElement = HTMLImportElement;\n return HTMLImportElement;\n}", "\n/**\n * @imports\n */\nimport HTMLModule from './HTMLModule.js';\nimport HTMLImportsContext from './HTMLImportsContext.js';\nimport _HTMLImportElement from './_HTMLImportElement.js';\nimport { _wq, _init } from '../util.js';\n\n/**\n * Initializes HTML Modules.\n * \n * @param $config Object\n *\n * @return Void\n */\nexport default function init($config = {}) {\n const { config, window } = _init.call(this, 'html-imports', $config, {\n elements: { import: 'import', },\n attr: { def: 'def', extends: 'extends', inherits: 'inherits', ref: 'ref', importscontext: 'importscontext', },\n api: { def: 'def', defs: 'defs', import: 'import' },\n });\n if (!config.attr.fragmentdef) { config.attr.fragmentdef = config.attr.def; }\n config.templateSelector = `template[${window.CSS.escape(config.attr.def)}]`;\n config.importsContextSelector = `[${window.CSS.escape(config.attr.importscontext)}]`;\n config.slottedElementsSelector = `[${window.CSS.escape(config.attr.fragmentdef)}]:not(template)`;\n const anchorNodeMatch = (start, end) => {\n const starting = `starts-with(., \"${start}\")`;\n const ending = `substring(., string-length(.) - string-length(\"${end}\") + 1) = \"${end}\"`;\n return `${starting} and ${ending}`;\n }\n config.anchorNodeSelector = `comment()[${anchorNodeMatch(`&lt;${config.elements.import}`, `&lt;/${config.elements.import}&gt;`)}]`;\n window.webqit.HTMLImportsContext = HTMLImportsContext;\n window.webqit.HTMLImportElement = _HTMLImportElement();\n exposeAPIs.call(window, config);\n realtime.call(window, config);\n}\n\n/**\n * Returns the \"defs\" object associated with the given node.\n *\n * @param Element node\n * @param Bool autoCreate\n *\n * @return Object\n */\nexport function getDefs(node, autoCreate = true) {\n if (!_wq(node).has('defs') && autoCreate) {\n const defs = Object.create(null);\n _wq(node).set('defs', defs);\n }\n return _wq(node).get('defs');\n}\n\n/**\n * Exposes HTML Modules with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs(config) {\n const window = this, { webqit: { oohtml: { configs } } } = window;\n // The \"def\" & \"defs\" properties\n if (config.api.def in window.HTMLTemplateElement.prototype) { throw new Error(`The \"HTMLTemplateElement\" prototype already has a \"${config.api.def}\" API!`); }\n if (config.api.defs in window.HTMLTemplateElement.prototype) { throw new Error(`The \"HTMLTemplateElement\" prototype already has a \"${config.api.defs}\" API!`); }\n // No-conflict assertions\n Object.defineProperty(window.HTMLTemplateElement.prototype, config.api.def, {\n get: function () {\n return this.getAttribute(config.attr.def);\n }\n });\n Object.defineProperty(window.HTMLTemplateElement.prototype, config.api.defs, {\n get: function () {\n return getDefs(this);\n }\n });\n // The \"scoped\" property\n Object.defineProperty(window.HTMLTemplateElement.prototype, 'scoped', {\n configurable: true,\n get() { return this.hasAttribute('scoped'); },\n set(value) { this.toggleAttribute('scoped', value); },\n });\n // The Import 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.import in prototype) { throw new Error(`The ${type} prototype already has a \"${config.api.import}\" API!`); }\n // Definitions\n Object.defineProperty(prototype, config.api.import, {\n value: function (ref, live = false, callback = null) {\n return importRequest(this, ...arguments);\n }\n });\n });\n function importRequest(context, ref, live = false, callback = null) {\n let options = {};\n if (typeof live === 'function') {\n callback = live;\n live = false;\n } else if (typeof live === 'object' && live) {\n options = { ...live, ...options };\n } else { options = { live }; }\n const request = { ...HTMLImportsContext.createRequest(ref), ...options };\n return context[configs.CONTEXT_API.api.contexts].request(request, callback);\n }\n}\n\n/**\n * Performs realtime capture of elements and their attributes\n * and their module query results; then resolves the respective import elements.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime(config) {\n const window = this, { webqit: { Observer, realdom, oohtml: { configs }, HTMLImportElement, HTMLImportsContext } } = window;\n\n // ------------\n // MODULES\n // ------------\n const attachImportsContext = host => {\n const contextsApi = host[configs.CONTEXT_API.api.contexts];\n if (!contextsApi.find(HTMLImportsContext.kind)) {\n contextsApi.attach(new HTMLImportsContext);\n }\n };\n const detachImportsContext = host => {\n const contextsApi = host[configs.CONTEXT_API.api.contexts];\n const ctx = contextsApi.find(HTMLImportsContext.kind);\n if (ctx && ( /* disconnect? */!host.isConnected || /* not inheriting && no localModules? */(\n !host.matches?.(config.importsContextSelector) && !Object.keys(ctx.localModules).length\n ))) {\n contextsApi.detach(ctx);\n }\n };\n // ------------\n realdom.realtime(window.document).query([config.templateSelector, config.importsContextSelector], record => {\n record.entrants.forEach(entry => {\n if (entry.matches(config.templateSelector)) {\n const htmlModule = HTMLModule.instance(entry);\n htmlModule.ownerContext = entry.scoped ? entry.parentNode : entry.getRootNode();\n const ownerContextModulesObj = getDefs(htmlModule.ownerContext);\n if (htmlModule.defId) { Observer.set(ownerContextModulesObj, htmlModule.defId, entry); }\n // The ownerContext's defs - ownerContextModulesObj - has to be populated\n // Before attaching a context instance to it, to give the just created context something to use for\n // fullfiling reclaimed requests.\n attachImportsContext(htmlModule.ownerContext);\n } else {\n attachImportsContext(entry);\n }\n });\n record.exits.forEach(entry => {\n if (entry.matches(config.templateSelector)) {\n const htmlModule = HTMLModule.instance(entry);\n //if (!htmlModule.ownerContext) return; // JSDOM sometimes\n const ownerContextModulesObj = getDefs(htmlModule.ownerContext);\n if (htmlModule.defId && htmlModule.ownerContext.isConnected) { Observer.deleteProperty(ownerContextModulesObj, htmlModule.defId); }\n detachImportsContext(htmlModule.ownerContext);\n } else {\n detachImportsContext(entry);\n }\n });\n }, { id: 'imports:template/importscontext', live: true, subtree: 'cross-roots', timing: 'sync', staticSensitivity: true, eventDetails: true });\n\n // ------------\n // IMPORTS\n // ------------\n realdom.realtime(window.document).query(config.elements.import, record => {\n record.entrants.forEach(node => handleRealtime(node, true, record));\n record.exits.forEach(node => handleRealtime(node, false, record));\n }, { id: 'imports:import', live: true, subtree: 'cross-roots', timing: 'sync', deferred: true });\n function handleRealtime(entry, connectedState) {\n const elInstance = HTMLImportElement.instance(entry);\n if (connectedState) { elInstance['#'].connectedCallback(); }\n else { elInstance['#'].disconnectedCallback(); }\n }\n // Hydration\n if (window.webqit.env === 'server') return;\n realdom.realtime(window.document).query(`(${config.anchorNodeSelector})`, record => {\n record.entrants.forEach(anchorNode => {\n if (_wq(anchorNode).get('isAnchorNode')) return; // Doubling up on the early return above! Ignoring every just created anchorNode\n const reviver = window.document.createElement('div');\n reviver.innerHTML = anchorNode.nodeValue;\n reviver.innerHTML = reviver.firstChild.textContent;\n const importEl = reviver.firstChild;\n let nodecount = parseInt(importEl.getAttribute('data-nodecount'));\n const slottedElements = new Set;\n let slottedElement = anchorNode;\n while ((slottedElement = slottedElement.previousElementSibling) && slottedElement.matches(config.slottedElementsSelector) && nodecount--) {\n slottedElements.add(slottedElement);\n }\n HTMLImportElement.instance(importEl)['#'].hydrate(anchorNode, slottedElements);\n });\n }, { id: 'imports:hydration', live: true, subtree: 'cross-roots', timing: 'sync' });\n}", "\n/**\n * @imports\n */\nimport init from './index.js';\n\n/**\n * @init\n */\ninit.call( window );"],
5
- "mappings": "ugBAQe,WAAS,EAAK,CAC5B,MAAO,CAAC,MAAM,QAAQ,CAAG,GAAK,MAAO,IAAQ,UAAY,CAC1D,CCFe,WAAS,EAAK,CAC5B,MAAO,OAAM,QAAQ,CA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export 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 { getDefs } from './index.js';\nimport { _wq, env } from '../util.js';\n\nexport default class HTMLModule {\n\n /**\n * @instance\n */\n static instance( host ) {\n return _wq( host ).get( 'defsmanager::instance' ) || new this( host );\n }\n\n /**\n * @constructor\n */\n constructor( host, parent = null, level = 0 ) {\n const { window } = env, { webqit: { realdom, oohtml: { configs } } } = window;\n _wq( host ).get( `defsmanager::instance` )?.dispose();\n _wq( host ).set( `defsmanager::instance`, this );\n this.window = window;\n this.host = host;\n this.config = configs.HTML_IMPORTS;\n this.parent = parent;\n this.level = level;\n this.defs = getDefs( this.host );\n this.defId = ( this.host.getAttribute( this.config.attr.def ) || '' ).trim();\n this.validateDefId( this.defId );\n // ----------\n this.realtimeA = realdom.realtime( this.host.content ).children( record => {\n this.expose( record.entrants, true );\n this.expose( record.exits, false );\n }, { live: true, timing: 'sync' } );\n // ----------\n this.realtimeB = realdom.realtime( this.host ).attr( [ 'src', 'loading' ], ( ...args ) => this.evaluateLoading( ...args ), {\n live: true,\n atomic: true,\n timing: 'sync',\n lifecycleSignals: true\n } );\n // ----------\n this.realtimeC = this.evalInheritance();\n // ----------\n }\n\n /**\n * Validates export ID.\n * \n * @param String defId\n *\n * @returns Void\n */\n validateDefId( defId ) {\n if ( [ '@', '/', '*', '#' ].some( token => defId.includes( token ) ) ) {\n throw new Error( `The export ID \"${ defId }\" contains an invalid character.` );\n }\n }\n\n /**\n * Maps module contents as defs.\n * \n * @param Array entries\n * @param Bool isConnected\n *\n * @returns Void\n */\n expose( entries, isConnected ) {\n const { window } = env, { webqit: { Observer } } = window;\n let dirty, allFragments = this.defs[ '#' ] || [];\n entries.forEach( entry => {\n if ( !entry || entry.nodeType !== 1 ) return;\n const isTemplate = entry.matches( this.config.templateSelector );\n const defId = ( entry.getAttribute( isTemplate ? this.config.attr.def : this.config.attr.fragmentdef ) || '' ).trim();\n if ( isConnected ) {\n if ( isTemplate && defId ) {\n new HTMLModule( entry, this.host, this.level + 1 );\n } else {\n allFragments.push( entry );\n dirty = true;\n if ( typeof requestIdleCallback === 'function' ) {\n requestIdleCallback( () => {\n this.config.idleCompilers?.forEach( callback => callback.call( this.window, entry ) );\n } );\n }\n }\n if ( defId ) {\n this.validateDefId( defId );\n Observer.set( this.defs, ( !isTemplate && '#' || '' ) + defId, entry );\n }\n } else {\n if ( isTemplate && defId ) { HTMLModule.instance( entry ).dispose(); }\n else {\n allFragments = allFragments.filter( x => x !== entry );\n dirty = true;\n }\n if ( defId ) Observer.deleteProperty( this.defs, ( !isTemplate && '#' || '' ) + defId );\n }\n } );\n if ( dirty ) Observer.set( this.defs, '#', allFragments );\n }\n\n /**\n * Evaluates remote content loading.\n *\n * @param AbortSignal signal\n * \n * @returns Void\n */\n evaluateLoading( [ record1, record2 ], { signal } ) {\n const { window: { webqit: { Observer } } } = env;\n const src = ( record1.value || '' ).trim();\n if ( !src ) return;\n let $loadingPromise, loadingPromise = promise => {\n if ( !promise ) return $loadingPromise; // Get\n $loadingPromise = promise.then( () => interception.remove() ); // Set\n };\n const loading = ( record2.value || '' ).trim();\n const interception = Observer.intercept( this.defs, 'get', async ( descriptor, recieved, next ) => {\n if ( loading === 'lazy' ) { loadingPromise( this.load( src, true ) ); }\n await loadingPromise();\n return next();\n }, { signal } );\n if ( loading !== 'lazy' ) { loadingPromise( this.load( src ) ); }\n }\n \n /**\n * Fetches a module's \"src\".\n *\n * @param String src\n *\n * @return Promise\n */\n #fetchedURLs = new Set;\n #fetchInFlight;\n load( src ) {\n const { window } = env;\n if ( this.#fetchedURLs.has( src ) ) {\n // Cache busting is needed to \n return Promise.resolve();\n }\n this.#fetchedURLs.add( src );\n if ( this.#fetchedURLs.size === 1 && this.host.content.children.length ) {\n return Promise.resolve();\n }\n // Ongoing request?\n this.#fetchInFlight?.controller.abort();\n // The promise\n const controller = new AbortController();\n const fire = ( type, detail ) => this.host.dispatchEvent( new window.CustomEvent( type, { detail } ) );\n const request = window.fetch( src, { signal: controller.signal, element: this.host } ).then( response => {\n return response.ok ? response.text() : Promise.reject( response.statusText );\n } ).then( content => {\n this.host.innerHTML = content.trim(); // IMPORTANT: .trim()\n fire( 'load' );\n return this.host;\n } ).catch( e => {\n console.error( `Error fetching the bundle at \"${ src }\": ${ e.message }` );\n this.#fetchInFlight = null;\n fire( 'loaderror' );\n return this.host;\n } );\n this.#fetchInFlight = { request, controller };\n return request;\n }\n\n /**\n * Evaluates module inheritance.\n *\n * @returns Void|AbortController\n */\n evalInheritance( ) {\n if ( !this.parent ) return [];\n const { window: { webqit: { Observer } } } = env;\n let extendedId = ( this.host.getAttribute( this.config.attr.extends ) || '' ).trim();\n let inheritedIds = ( this.host.getAttribute( this.config.attr.inherits ) || '' ).trim().split( ' ' ).map( id => id.trim() ).filter( x => x );\n const handleInherited = records => {\n records.forEach( record => {\n if ( Observer.get( this.defs, record.key ) !== record.oldValue ) return;\n if ( [ 'get'/*initial get*/, 'set', 'def' ].includes( record.type ) ) {\n Observer[ record.type.replace( 'get', 'set' ) ]( this.defs, record.key, record.value );\n } else if ( record.type === 'delete' ) {\n Observer.deleteProperty( this.defs, record.key );\n }\n } );\n };\n const realtimes = [];\n const parentDefsObj = getDefs( this.parent );\n if ( extendedId ) {\n realtimes.push( Observer.reduce( parentDefsObj, [ extendedId, this.config.api.defs, Infinity ], Observer.get, handleInherited, { live: true } ) );\n }\n if ( inheritedIds.length ) {\n realtimes.push( Observer.get( parentDefsObj, inheritedIds.includes( '*' ) ? Infinity : inheritedIds, handleInherited, { live: true } ) );\n }\n return realtimes;\n }\n \n /**\n * Disposes the instance and its processes.\n *\n * @returns Void\n */\n dispose() {\n this.realtimeA.disconnect();\n this.realtimeB.disconnect();\n this.realtimeC.forEach( r => ( r instanceof Promise ? r.then( r => r.abort() ) : r.abort() ) );\n Object.entries( this.defs ).forEach( ( [ key, entry ] ) => {\n if ( key.startsWith( '#' ) ) return;\n HTMLModule.instance( entry ).dispose();\n } );\n }\n}\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 DOMContext from '../context-api/DOMContext.js';\nimport { getDefs } from './index.js';\nimport { env } from '../util.js';\n\nexport default class HTMLImportsContext extends DOMContext {\n\n /**\n * @kind\n */\n static kind = 'html-imports';\n\n /**\n * @createRequest\n */\n static createRequest( detail = null ) {\n const request = super.createRequest();\n if ( detail?.startsWith( '/' ) ) {\n request.detail = detail;\n request.targetContext = Infinity;\n } else if ( detail?.startsWith( '@' ) ) {\n const [ targetContext, ..._detail ] = detail.slice( 1 ).split( /(?<=\\w)(?=\\/|#)/ ).map( s => s.trim() );\n request.targetContext = targetContext;\n request.detail = _detail.join( '' );\n } else { request.detail = detail; }\n return request;\n }\n \n /**\n * @localModules\n */\n get localModules() { return getDefs( this.host ); }\n get inheritedModules() { return this.#inheritedModules; }\n #inheritedModules = {};\n\n /**\n * @handle()\n */\n \n handle( event ) {\n const { window: { webqit: { Observer } } } = env;\n // Any existing event.meta.controller? Abort!\n event.meta.controller?.abort();\n // Parse and translate detail\n let path = ( event.detail || '' ).split( /\\/|(?<=\\w)(?=#)/g ).map( x => x.trim() ).filter( x => x );\n if ( !path.length ) return event.respondWith();\n path = path.join( `/${ this.configs.HTML_IMPORTS.api.defs }/` )?.split( '/' ).map( x => x === '*' ? Infinity : x ) || [];\n // We'll now fulfill request\n const options = { live: event.live, signal: event.signal, descripted: true };\n event.meta.controller = Observer.reduce( this.#modules, path, Observer.get, ( m ) => {\n if ( Array.isArray( m ) ) {\n if ( !m.length ) {\n event.respondWith();\n return;\n }\n // Paths with wildcard\n for ( const n of m ) {\n event.respondWith( n );\n }\n } else {\n event.respondWith( m.value );\n }\n }, options );\n }\n\n /**\n * @unsubscribed()\n */\n unsubscribed( event ) { event.meta.controller?.abort(); }\n\n /**\n * @initialize()\n */\n #modules;\n #controller1;\n #controller2;\n initialize( host ) {\n this.host = host;\n const { window: { webqit: { Observer } } } = env;\n // ----------------\n // Resolve\n const resolve = () => {\n for (const key of new Set([...Object.keys(this.localModules), ...Object.keys(this.inheritedModules), ...Object.keys(this.#modules)])) {\n if ( !Observer.has( this.localModules, key ) && !Observer.has( this.inheritedModules, key ) ) {\n Observer.deleteProperty( this.#modules, key );\n } else if (key === '#' && Observer.has( this.localModules, key ) && Observer.has( this.inheritedModules, key ) ) {\n Observer.set( this.#modules, key, [...Observer.get( this.localModules, key ), ...Observer.get( this.inheritedModules, key )] );\n } else {\n const _module = Observer.get( this.localModules, key ) || Observer.get( this.inheritedModules, key );\n if ( Observer.get( this.#modules, key ) !== _module ) {\n Observer.set( this.#modules, key, _module );\n }\n }\n }\n };\n // ----------------\n // Observe local\n this.#modules = { ...this.localModules };\n this.#controller1?.abort();\n this.#controller1 = Observer.observe( this.localModules, () => resolve('local'), { timing: 'sync' } );\n // ----------------\n // If host has importscontext attr, compute that\n const $config = this.configs.HTML_IMPORTS;\n if ( this.host.matches && $config.attr.importscontext ) {\n const realdom = this.host.ownerDocument.defaultView.webqit.realdom;\n let prevRef;\n this.#controller2?.disconnect();\n this.#controller2 = realdom.realtime( this.host ).attr( $config.attr.importscontext, ( record, { signal } ) => { \n const moduleRef = ( record.value || '' ).trim();\n if ( moduleRef === prevRef ) return;\n prevRef = moduleRef;\n // This superModules contextrequest is automatically aborted by the injected signal below\n this.#inheritedModules = {};\n const request = { ...this.constructor.createRequest( moduleRef ? `${moduleRef}/*` : '*' ), live: true, signal, diff: true };\n this.host.parentNode[ this.configs.CONTEXT_API.api.contexts ].request( request, ( m ) => {\n if ( !m ) {\n this.#inheritedModules = {};\n resolve('inherited');\n } else if ( m.type === 'delete' ) {\n delete this.#inheritedModules[m.key];\n if ( !Reflect.has( this.localModules, m.key ) ) {\n Observer.deleteProperty( this.#modules, m.key );\n }\n } else {\n this.#inheritedModules[m.key] = m.value;\n if ( !Reflect.has( this.localModules, m.key ) && Reflect.get( this.#modules, m.key ) !== m.value ) {\n Observer.set( this.#modules, m.key, m.value );\n }\n }\n } );\n resolve('inherited');\n }, { live: true, timing: 'sync', oldValue: true, lifecycleSignals: true } );\n }\n // ----------------\n return super.initialize( host );\n }\n \n /**\n * @dispose()\n */\n dispose( host ) {\n // Stop listening for sources\n this.#controller1?.abort();\n this.#controller2?.disconnect();\n // Now, stop listening for contextrequest and contextclaim events\n // And relinquish own subscribers to owner context\n return super.dispose( host );\n }\n}\n", "\n/**\n * @imports\n */\nimport HTMLImportsContext from './HTMLImportsContext.js';\nimport { _wq, env } from '../util.js';\n\n/**\n * Creates the HTMLImportElement class.\n * \n * @param Object config \n * \n * @return HTMLImportElement\n */\nexport default function() {\n const { window } = env, { webqit } = window, { realdom, oohtml: { configs } } = webqit;\n if ( webqit.HTMLImportElement ) return webqit.HTMLImportElement;\n const BaseElement = configs.HTML_IMPORTS.elements.import.includes( '-' ) ? window.HTMLElement : class {};\n class HTMLImportElement extends BaseElement {\n \n /**\n * @instance\n * \n * @param HTMLElement node\n * \n * @returns \n */\n static instance( node ) {\n if ( configs.HTML_IMPORTS.elements.import.includes( '-' ) && ( node instanceof this ) ) return node;\n return _wq( node ).get( 'import::instance' ) || new this( node );\n }\n\n /**\n * @constructor\n */\n constructor( ...args ) {\n super();\n // --------\n const el = args[ 0 ] || this;\n _wq( el ).set( 'import::instance', this );\n Object.defineProperty( this, 'el', { get: () => el, configurable: false } );\n\n const priv = {};\n Object.defineProperty( this, '#', { get: () => priv, configurable: false } );\n priv.slottedElements = new Set;\n\n priv.setAnchorNode = anchorNode => {\n priv.anchorNode = anchorNode;\n return anchorNode;\n };\n\n priv.live = callback => {\n if ( priv.liveImportsRealtime ) throw new Error(`Import element already in live mode.`);\n const parentNode = this.el.isConnected ? this.el.parentNode : priv.anchorNode.parentNode;\n priv.liveImportsRealtime = realdom.realtime( this.el ).attr( configs.HTML_IMPORTS.attr.ref, ( record, { signal } ) => {\n priv.moduleRef = record.value;\n const moduleRef = priv.moduleRef.includes( '#' ) ? priv.moduleRef : `${ priv.moduleRef }#`/* for live children */;\n const request = { ...HTMLImportsContext.createRequest( moduleRef ), live: signal && true, signal, diff: !moduleRef.endsWith('#') };\n parentNode[ configs.CONTEXT_API.api.contexts ].request( request, response => {\n callback( ( response instanceof window.HTMLTemplateElement ? [ ...response.content.children ] : (\n Array.isArray( response ) ? response : response && [ response ]\n ) ) || [] );\n } );\n }, { live: true, timing: 'sync', lifecycleSignals: true } );\n priv.autoDestroyRealtime = realdom.realtime( window.document ).track( parentNode, () => {\n priv.die();\n }, { subtree: 'cross-roots', timing: 'sync', generation: 'exits' } );\n };\n\n priv.die = () => {\n priv.autoDestroyRealtime?.disconnect();\n priv.liveImportsRealtime?.disconnect();\n priv.liveImportsRealtime = null;\n };\n\n priv.hydrate = ( anchorNode, slottedElements ) => {\n anchorNode.replaceWith( priv.setAnchorNode( this.createAnchorNode() ) );\n priv.live( fragments => {\n // The default action\n if ( priv.originalsRemapped ) return this.fill( fragments );\n // Initial remap action\n const identifiersMap = fragments.map( ( fragment, i ) => ( { el: fragment, fragmentDef: fragment.getAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) || '', tagName: fragment.tagName, i } ) );\n slottedElements.forEach( ( slottedElement, i ) => {\n const tagName = slottedElement.tagName, fragmentDef = slottedElement.getAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) || '';\n const originalsMatch = ( i ++, identifiersMap.find( fragmentIdentifiers => fragmentIdentifiers.tagName === tagName && fragmentIdentifiers.fragmentDef === fragmentDef && fragmentIdentifiers.i === i ) );\n if ( originalsMatch ) _wq( slottedElement ).set( 'original@imports', originalsMatch.el ); // Or should we throw integrity error here?\n _wq( slottedElement ).set( 'slot@imports', this.el );\n priv.slottedElements.add( slottedElement );\n } );\n priv.originalsRemapped = true;\n });\n };\n\n priv.autoRestore = ( callback = null ) => {\n priv.autoRestoreRealtime?.disconnect();\n if ( callback ) callback();\n const restore = () => {\n if (this.el.isConnected) return;\n this.el.setAttribute( 'data-nodecount', 0 );\n priv.internalMutation = true;\n priv.anchorNode.replaceWith( this.el );\n priv.internalMutation = false;\n priv.setAnchorNode( null );\n };\n if ( !priv.slottedElements.size ) return restore();\n const autoRestoreRealtime = realdom.realtime( priv.anchorNode.parentNode ).observe( [ ...priv.slottedElements ], record => {\n record.exits.forEach( outgoingNode => {\n _wq( outgoingNode ).delete( 'slot@imports' );\n priv.slottedElements.delete( outgoingNode );\n } );\n if ( !priv.slottedElements.size ) {\n autoRestoreRealtime.disconnect();\n // At this point, ignore if this is a removal involving the whole parent node\n if ( !record.target.isConnected ) return;\n restore();\n }\n }, { subtree: 'cross-roots', timing: 'sync', generation: 'exits' } );\n priv.autoRestoreRealtime = autoRestoreRealtime;\n };\n\n priv.connectedCallback = () => {\n if ( priv.internalMutation ) return;\n priv.live( fragments => this.fill( fragments ) );\n };\n\n priv.disconnectedCallback = () => {\n if ( priv.internalMutation ) return;\n priv.die();\n };\n }\n\n /**\n * Creates the slot's anchor node.\n *\n * @return Element\n */\n createAnchorNode() {\n if ( window.webqit.env !== 'server' ) { return window.document.createTextNode( '' ) }\n const escapeElement = window.document.createElement( 'div' );\n escapeElement.textContent = this.el.outerHTML;\n const anchorNode = window.document.createComment( escapeElement.innerHTML );\n _wq( anchorNode ).set( 'isAnchorNode', true );\n return anchorNode;\n }\n\n /**\n * Fills the slot with slottableElements\n *\n * @param Iterable slottableElements\n *\n * @return void\n */\n fill( slottableElements, r ) {\n if (!this.el.isConnected && (!this[ '#' ].anchorNode || !this[ '#' ].anchorNode.isConnected)) {\n // LiveImports must be responding to an event that just removed the subtree from DOM\n return;\n }\n if ( Array.isArray( slottableElements ) ) { slottableElements = new Set( slottableElements ) }\n // This state must be set before the diffing below and the serialization done at createAnchorNode()\n this.el.setAttribute( 'data-nodecount', slottableElements.size );\n this[ '#' ].autoRestore( () => {\n this[ '#' ].slottedElements.forEach( slottedElement => {\n const slottedElementOriginal = _wq( slottedElement ).get( 'original@imports' );\n // If still available in source, simply leave unchanged\n // otherwise remove it from slot... to reflect this change\n if ( slottableElements.has( slottedElementOriginal ) ) {\n slottableElements.delete( slottedElementOriginal );\n } else {\n this[ '#' ].slottedElements.delete( slottedElement );\n // This removal will not be caught\n slottedElement.remove();\n }\n } );\n // Make sure anchor node is what's in place...\n // not the import element itslef - but all only when we have slottableElements.size\n if ( slottableElements.size && this.el.isConnected ) {\n const newAnchorNode = this[ '#' ].setAnchorNode( this.createAnchorNode() );\n this[ '#' ].internalMutation = true;\n this.el.replaceWith( newAnchorNode );\n this[ '#' ].internalMutation = false;\n }\n // Insert slottables now\n slottableElements.forEach( slottableElement => {\n // Clone each slottable element and give it a reference to its original\n const slottableElementClone = slottableElement.cloneNode( true );\n // The folllowing references must be set before adding to DODM\n if ( !slottableElementClone.hasAttribute( configs.HTML_IMPORTS.attr.fragmentdef ) ) {\n slottableElementClone.toggleAttribute( configs.HTML_IMPORTS.attr.fragmentdef, true );\n }\n _wq( slottableElementClone ).set( 'original@imports', slottableElement );\n _wq( slottableElementClone ).set( 'slot@imports', this.el );\n this[ '#' ].slottedElements.add( slottableElementClone );\n this[ '#' ].anchorNode.before( slottableElementClone );\n } );\n } );\n }\n\n /**\n * Empty slot.\n *\n * @return void\n */\n empty() { this[ '#' ].slottedElements.forEach( slottedElement => slottedElement.remove() ); }\n\n /**\n * Returns the slot's anchorNode.\n *\n * @return array\n */\n get anchorNode() { return this[ '#' ].anchorNode; }\n\n /**\n * Returns the slot's module reference, if any.\n *\n * @return string\n */\n get moduleRef() { return this[ '#' ].moduleRef; }\n\n /**\n * Returns the slot's slotted elements.\n *\n * @return array\n */\n get slottedElements() { return this[ '#' ].slottedElements; }\n }\n if ( configs.HTML_IMPORTS.elements.import.includes( '-' ) ) { customElements.define( configs.HTML_IMPORTS.elements.import, HTMLImportElement ); }\n webqit.HTMLImportElement = HTMLImportElement;\n return HTMLImportElement;\n}", "\n/**\n * @imports\n */\nimport HTMLModule from './HTMLModule.js';\nimport HTMLImportsContext from './HTMLImportsContext.js';\nimport _HTMLImportElement from './_HTMLImportElement.js';\nimport { _wq, _init } from '../util.js';\n\n/**\n * Initializes HTML Modules.\n * \n * @param $config Object\n *\n * @return Void\n */\nexport default function init($config = {}) {\n const { config, window } = _init.call(this, 'html-imports', $config, {\n elements: { import: 'import', },\n attr: { def: 'def', extends: 'extends', inherits: 'inherits', ref: 'ref', importscontext: 'importscontext', },\n api: { def: 'def', defs: 'defs', import: 'import' },\n });\n if (!config.attr.fragmentdef) { config.attr.fragmentdef = config.attr.def; }\n config.templateSelector = `template[${window.CSS.escape(config.attr.def)}]`;\n config.importsContextSelector = `[${window.CSS.escape(config.attr.importscontext)}]`;\n config.slottedElementsSelector = `[${window.CSS.escape(config.attr.fragmentdef)}]:not(template)`;\n const anchorNodeMatch = (start, end) => {\n const starting = `starts-with(., \"${start}\")`;\n const ending = `substring(., string-length(.) - string-length(\"${end}\") + 1) = \"${end}\"`;\n return `${starting} and ${ending}`;\n }\n config.anchorNodeSelector = `comment()[${anchorNodeMatch(`&lt;${config.elements.import}`, `&lt;/${config.elements.import}&gt;`)}]`;\n window.webqit.HTMLImportsContext = HTMLImportsContext;\n window.webqit.HTMLImportElement = _HTMLImportElement();\n exposeAPIs.call(window, config);\n realtime.call(window, config);\n}\n\n/**\n * Returns the \"defs\" object associated with the given node.\n *\n * @param Element node\n * @param Bool autoCreate\n *\n * @return Object\n */\nexport function getDefs(node, autoCreate = true) {\n if (!_wq(node).has('defs') && autoCreate) {\n const defs = Object.create(null);\n _wq(node).set('defs', defs);\n }\n return _wq(node).get('defs');\n}\n\n/**\n * Exposes HTML Modules with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeAPIs(config) {\n const window = this, { webqit: { oohtml: { configs } } } = window;\n // The \"def\" & \"defs\" properties\n if (config.api.def in window.HTMLTemplateElement.prototype) { throw new Error(`The \"HTMLTemplateElement\" prototype already has a \"${config.api.def}\" API!`); }\n if (config.api.defs in window.HTMLTemplateElement.prototype) { throw new Error(`The \"HTMLTemplateElement\" prototype already has a \"${config.api.defs}\" API!`); }\n // No-conflict assertions\n Object.defineProperty(window.HTMLTemplateElement.prototype, config.api.def, {\n get: function () {\n return this.getAttribute(config.attr.def);\n }\n });\n Object.defineProperty(window.HTMLTemplateElement.prototype, config.api.defs, {\n get: function () {\n return getDefs(this);\n }\n });\n // The \"scoped\" property\n Object.defineProperty(window.HTMLTemplateElement.prototype, 'scoped', {\n configurable: true,\n get() { return this.hasAttribute('scoped'); },\n set(value) { this.toggleAttribute('scoped', value); },\n });\n // The Import 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.import in prototype) { throw new Error(`The ${type} prototype already has a \"${config.api.import}\" API!`); }\n // Definitions\n Object.defineProperty(prototype, config.api.import, {\n value: function (ref, live = false, callback = null) {\n return importRequest(this, ...arguments);\n }\n });\n });\n function importRequest(context, ref, live = false, callback = null) {\n let options = {};\n if (typeof live === 'function') {\n callback = live;\n live = false;\n } else if (typeof live === 'object' && live) {\n options = { ...live, ...options };\n } else { options = { live }; }\n const request = { ...HTMLImportsContext.createRequest(ref), ...options };\n return context[configs.CONTEXT_API.api.contexts].request(request, callback);\n }\n}\n\n/**\n * Performs realtime capture of elements and their attributes\n * and their module query results; then resolves the respective import elements.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction realtime(config) {\n const window = this, { webqit: { Observer, realdom, oohtml: { configs }, HTMLImportElement, HTMLImportsContext } } = window;\n\n // ------------\n // MODULES\n // ------------\n const attachImportsContext = host => {\n const contextsApi = host[configs.CONTEXT_API.api.contexts];\n if (!contextsApi.find(HTMLImportsContext.kind)) {\n contextsApi.attach(new HTMLImportsContext);\n }\n };\n const detachImportsContext = host => {\n const contextsApi = host[configs.CONTEXT_API.api.contexts];\n const ctx = contextsApi.find(HTMLImportsContext.kind);\n if (ctx && ( /* disconnect? */!host.isConnected || /* not inheriting && no localModules? */(\n !host.matches?.(config.importsContextSelector) && !Object.keys(ctx.localModules).length\n ))) {\n contextsApi.detach(ctx);\n }\n };\n // ------------\n realdom.realtime(window.document).query([config.templateSelector, config.importsContextSelector], record => {\n record.entrants.forEach(entry => {\n if (entry.matches(config.templateSelector)) {\n const htmlModule = HTMLModule.instance(entry);\n htmlModule.ownerContext = entry.scoped ? entry.parentNode : entry.getRootNode();\n const ownerContextModulesObj = getDefs(htmlModule.ownerContext);\n if (htmlModule.defId) { Observer.set(ownerContextModulesObj, htmlModule.defId, entry); }\n // The ownerContext's defs - ownerContextModulesObj - has to be populated\n // Before attaching a context instance to it, to give the just created context something to use for\n // fullfiling reclaimed requests.\n attachImportsContext(htmlModule.ownerContext);\n } else {\n attachImportsContext(entry);\n }\n });\n record.exits.forEach(entry => {\n if (entry.matches(config.templateSelector)) {\n const htmlModule = HTMLModule.instance(entry);\n //if (!htmlModule.ownerContext) return; // JSDOM sometimes\n const ownerContextModulesObj = getDefs(htmlModule.ownerContext);\n if (htmlModule.defId && htmlModule.ownerContext.isConnected) { Observer.deleteProperty(ownerContextModulesObj, htmlModule.defId); }\n detachImportsContext(htmlModule.ownerContext);\n } else {\n detachImportsContext(entry);\n }\n });\n }, { id: 'imports:template/importscontext', live: true, subtree: 'cross-roots', timing: 'sync', staticSensitivity: true, eventDetails: true });\n\n // ------------\n // IMPORTS\n // ------------\n realdom.realtime(window.document).query(config.elements.import, record => {\n record.entrants.forEach(node => handleRealtime(node, true, record));\n record.exits.forEach(node => handleRealtime(node, false, record));\n }, { id: 'imports:import', live: true, subtree: 'cross-roots', timing: 'sync', deferred: true });\n function handleRealtime(entry, connectedState) {\n const elInstance = HTMLImportElement.instance(entry);\n if (connectedState) { elInstance['#'].connectedCallback(); }\n else { elInstance['#'].disconnectedCallback(); }\n }\n // Hydration\n if (window.webqit.env === 'server') return;\n realdom.realtime(window.document).query(`(${config.anchorNodeSelector})`, record => {\n record.entrants.forEach(anchorNode => {\n if (_wq(anchorNode).get('isAnchorNode')) return; // Doubling up on the early return above! Ignoring every just created anchorNode\n const reviver = window.document.createElement('div');\n reviver.innerHTML = anchorNode.nodeValue;\n reviver.innerHTML = reviver.firstChild.textContent;\n const importEl = reviver.firstChild;\n let nodecount = parseInt(importEl.getAttribute('data-nodecount'));\n const slottedElements = new Set;\n let slottedElement = anchorNode;\n while ((slottedElement = slottedElement.previousElementSibling) && slottedElement.matches(config.slottedElementsSelector) && nodecount--) {\n slottedElements.add(slottedElement);\n }\n HTMLImportElement.instance(importEl)['#'].hydrate(anchorNode, slottedElements);\n });\n }, { id: 'imports:hydration', live: true, subtree: 'cross-roots', timing: 'sync' });\n}", "\n/**\n * @imports\n */\nimport init from './index.js';\n\n/**\n * @init\n */\ninit.call( window );"],
5
+ "mappings": "ugBAQe,WAAS,EAAK,CAC5B,MAAO,CAAC,MAAM,QAAQ,CAAG,GAAK,MAAO,IAAQ,UAAY,CAC1D,CCFe,WAAS,EAAK,CAC5B,MAAO,OAAM,QAAQ,CAAG,CACzB,CCDe,YAAS,EAAK,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