@webqit/oohtml 2.1.49 → 2.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/html-imports.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../node_modules/@webqit/observer/src/main.js", "../node_modules/@webqit/util/js/isObject.js", "../node_modules/@webqit/util/js/getType.js", "../node_modules/@webqit/util/js/isArray.js", "../node_modules/@webqit/util/arr/intersect.js", "../node_modules/@webqit/util/js/internals.js", "../node_modules/@webqit/util/js/isTypeFunction.js", "../node_modules/@webqit/util/js/isClass.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/arr/from.js", "../node_modules/@webqit/observer/src/core/Registration.js", "../node_modules/@webqit/observer/src/util.js", "../node_modules/@webqit/observer/src/core/ListenerRegistration.js", "../node_modules/@webqit/observer/src/core/Registry.js", "../node_modules/@webqit/observer/src/core/ListenerRegistry.js", "../node_modules/@webqit/observer/src/core/TrapsRegistration.js", "../node_modules/@webqit/observer/src/core/TrapsRegistry.js", "../node_modules/@webqit/observer/src/core/Descriptor.js", "../node_modules/@webqit/observer/src/actors.js", "../node_modules/@webqit/observer/src/index.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/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", "../src/util.js", "../src/context-api/_ContextRequestEvent.js", "../src/context-api/HTMLContext.js", "../src/context-api/HTMLContextProvider.js", "../src/html-imports/_HTMLExportsManager.js", "../src/html-imports/_HTMLImportsProvider.js", "../src/html-imports/_HTMLImportElement.js", "../src/html-imports/index.js", "../src/html-imports/targets.browser.js"],
|
|
4
|
-
"sourcesContent": ["\n/**\n * @imports\n */\nimport { _isObject, _isTypeObject, _isFunction, _getType } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport ListenerRegistry from './core/ListenerRegistry.js';\nimport TrapsRegistry from './core/TrapsRegistry.js';\nimport Descriptor from './core/Descriptor.js';\nimport { unproxy } from './actors.js';\nimport { _, _await } from './util.js';\n\n/* ---------------SPECIAL APIs--------------- */\n\n/**\n * Creates a Path array instance from arguments.\n * \n * @param Array\t ...segments\n *\n * @return Path\n */\nclass Path extends Array {}\nexport function path( ...segments ) {\n return new Path( ...segments );\n}\n\n/**\n * Reduces a path array against handler.\n * \n * @param Array|Object\t target\n * @param Array\t path\n * @param Function\t receiver\n * @param Function\t final\n * @param Object\t params\n * \n * @example reduce( object, [ segement1, segement2 ], observe, ( value, flags ) => {}, params );\n *\n * @return Any\n */\nexport function reduce( target, path, receiver, final = x => x, params = {} ) {\n if ( !path.length ) return;\n return ( function eat( target, path, $params ) {\n const segment = path[ $params.level ];\n const isLastSegment = $params.level === path.length - 1;\n if ( target instanceof Descriptor && target.type !== 'get' ) {\n // Always probe event-generated trees\n $params = { ...$params, probe: 'always' };\n } else if ( $params.probe !== 'always' ) {\n // Probe until (before) last segment\n $params = { ...$params, probe: !isLastSegment };\n }\n // ---------------\n return receiver( target, segment, ( result, ...args ) => {\n // -----------\n const addTrail = desc => {\n if ( !( desc instanceof Descriptor ) ) return;\n desc.path = [ desc.key ];\n if ( target instanceof Descriptor ) {\n desc.path = target.path.concat( desc.key );\n Object.defineProperty( desc, 'context', { get: () => target, configurable: true } );\n }\n };\n const advance = result => {\n const $value = resolveObj( result/* a Descriptor who's value could be proxied */, false );\n return _await( $value/* could be a promise */, $value => {\n if ( result instanceof Descriptor ) {\n result.value = $value; // Update to (fulfilled), unproxied, value\n } else {\n result = $value;\n }\n const flags = args[ 0 ] || {};\n return eat( result, path, { ...$params, ...flags, level: $params.level + 1, } );\n } );\n };\n // -----------\n if ( isPropsList( segment ) && Array.isArray( result ) ) {\n result.forEach( addTrail );\n if ( isLastSegment ) return final( result, ...args );\n return result.map( advance );\n }\n // -----------\n addTrail( result );\n if ( isLastSegment ) return final( result, ...args );\n return advance( result );\n // -----------\n }, $params );\n } )( target, path.slice( 0 ), { ...params, level: 0 } );\n}\n\n/**\n * Adds an observer to a target's registry.\n *\n * @param Array|Object\t target\n * @param String|Object\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return AbortController\n */\nexport function observe( target, prop, receiver, params = {} ) {\n // ---------------\n target = resolveObj( target, !params.level );\n\tif ( _isFunction( arguments[ 1 ] ) ) {\n [ , receiver, params = {} ] = arguments;\n prop = Infinity;\n\t}\n\tif ( !_isFunction( receiver ) ) throw new Error( `Handler must be a function; \"${ _getType( receiver ) }\" given!` );\n if ( prop instanceof Path ) return reduce( target, prop, observe, receiver, params );\n // ---------------\n params = { ...params, descripted: true };\n delete params.live;\n if ( !_isTypeObject( target ) ) return params.probe && get( target, prop, receiver, params );\n // ---------------\n const emit = bind( target, prop, receiver, params );\n if ( params.probe ) {\n return get( target, prop, emit, params );\n }\n return emit();\n}\n\n/**\n * Adds an interceptor object to a target's registry.\n *\n * @param Array|Object\t target\n * @param Object\t traps\n * @param Object\t\t params\n *\n * @return AbortRegistry\n */\nexport function intercept( target, traps, params = {} ) {\n // ---------------\n target = resolveObj( target );\n if ( !_isObject( traps ) ) {\n [ /*target*/, /*type*/, /*handler*/, params = {} ] = arguments;\n traps = { [ arguments[ 1 ] ]: arguments[ 2 ] };\n }\n // ---------------\n return TrapsRegistry.getInstance( target, true, params.namespace ).addRegistration( { traps, params } );\n}\n\n/* ---------------QUERY APIs--------------- */\n\n/**\n * Performs a \"getOwnPropertyDescriptor\" operation.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getOwnPropertyDescriptor( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'getOwnPropertyDescriptor', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a \"getOwnPropertyDescriptors\" operation.\n * @note this isn't part of the standard Reflect API.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getOwnPropertyDescriptors( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'getOwnPropertyDescriptors', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a \"getPrototypeOf\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getPrototypeOf( target, receiver = x => x, params = {} ) {\n return exec( target, 'getPrototypeOf', {}, receiver, params );\n}\n\n/**\n * Performs a \"isExtensible\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function isExtensible( target, receiver = x => x, params = {} ) {\n return exec( target, 'isExtensible', {}, receiver, params );\n}\n\n/**\n * Performs a \"ownKeys\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function ownKeys( target, receiver = x => x, params = {} ) {\n return exec( target, 'ownKeys', {}, receiver, params );\n}\n\n/**\n * Performs an operation of the given \"type\".\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function has( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'has', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a get operation.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function get( target, prop, receiver = x => x, params = {} ) {\n // ---------------\n let isLive;\n target = resolveObj( target, !params.level );\n if ( _isObject( receiver ) ) { [ params, receiver ] = [ receiver, x => x ]; }\n else if ( params.live ) { isLive = true; }\n if ( prop instanceof Path ) return reduce( target, prop, get, receiver, params );\n // ---------------\n return resolveProps( target, prop, props => {\n const related = [ ...props ];\n return ( function next( results, _props, _done ) {\n if ( !_props.length ) return _done( results );\n const prop = _props.shift();\n if ( ![ 'string', 'number', 'symbol' ].includes( typeof prop ) ) {\n throw new Error( `Property name/key ${ prop } invalid.` );\n }\n // ---------\n function defaultGet( descriptor, value = undefined ) {\n const _next = value => ( descriptor.value = value, next( [ ...results, params.live || params.descripted ? descriptor : value ]/** not using concat() as value may be an array */, _props, _done ) );\n if ( arguments.length > 1 ) return _next( value );\n const accessorizedProps = _( target, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key + '' );\n if ( accessorization && accessorization.intact() ) {\n return _next( accessorization.getValue() );\n }\n return _next( Reflect.get( target, descriptor.key, ...( params.receiver ? [ params.receiver ] : [] ) ) );\n }\n // ---------\n const descriptor = new Descriptor( target, {\n type: 'get',\n key: prop,\n value: undefined,\n related,\n } );\n if ( !_isTypeObject( target ) ) return next( [ ...results, params.live || params.descripted ? descriptor : undefined ], _props, _done );\n const listenerRegistry = TrapsRegistry.getInstance( target, false, params.namespace );\n if ( listenerRegistry ) {\n return listenerRegistry.emit( descriptor, defaultGet );\n }\n return defaultGet( descriptor );\n } )( [], props.slice( 0 ), results => {\n const result_s = isPropsList( prop/*original*/ ) ? results : results[ 0 ];\n if ( isLive && _isTypeObject( target ) ) {\n const emit = bind( target, prop, receiver, params );\n return emit( result_s );\n }\n return receiver( result_s );\n } );\n }, params );\n}\n\n/* ---------------MUTATION APIs--------------- */\n\n/**\n * Performs a batch operation.\n * \n * @param Object\t target\n * @param Function\t callback\n * @param Object\t params\n *\n * @return Void\n */\nexport function batch( target, callback, params = {} ) {\n target = resolveObj( target );\n return ListenerRegistry.getInstance( target, true, params.namespace ).batch( callback );\n}\n\n/**\n * Performs a set operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Any\t value\n * @param Function\t receiver\n * @param Object\t params\n * @param Bool\t def\n *\n * @return Any\n */\nexport function set( target, prop, value, receiver = x => x, params = {}, def = false ) {\n // ---------------\n target = resolveObj( target );\n let entries = [ [ prop, value ] ];\n if ( _isObject( prop ) ) {\n [ /*target*/, /*hash*/, receiver = x => x, params = {}, def = false ] = arguments;\n entries = Object.entries( prop );\n }\n if ( _isObject( receiver ) ) { [ def, params, receiver ] = [ typeof params === 'boolean' ? params : false, receiver, x => x ]; }\n // ---------------\n const related = entries.map( ( [ prop ] ) => prop );\n return ( function next( descriptors, entries, _done ) {\n if ( !entries.length ) return _done( descriptors );\n const [ prop, value ] = entries.shift();\n // ---------\n function defaultSet( descriptor, status = undefined ) {\n const _next = status => ( descriptor.status = status, next( descriptors.concat( descriptor ), entries, _done ) );\n if ( arguments.length > 1 ) return _next( descriptor, status );\n const accessorizedProps = _( target, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key + '' );\n if ( descriptor.type === 'defineProperty' ) {\n if ( accessorization && !accessorization.restore() ) _next( false );\n Object.defineProperty( target, descriptor.key, descriptor.value );\n return _next( true );\n }\n if ( accessorization && accessorization.intact() ) {\n return _next( accessorization.setValue( descriptor.value ) );\n }\n return _next( Reflect.set( target, descriptor.key, descriptor.value ) );\n }\n // ---------\n function exec( isUpdate, oldValue ) {\n if ( params.diff && value === oldValue ) return next( descriptors, entries, _done );\n const descriptor = new Descriptor( target, {\n type: def ? 'defineProperty' : 'set',\n key: prop,\n value,\n isUpdate,\n oldValue,\n related: [ ...related ],\n detail: params.detail,\n } );\n const listenerRegistry = TrapsRegistry.getInstance( target, false, params.namespace );\n return listenerRegistry \n ? listenerRegistry.emit( descriptor, defaultSet ) \n : defaultSet( descriptor );\n }\n // ---------\n return has( target, prop, exists => {\n if ( !exists ) return exec( exists );\n return get( target, prop, oldValue => exec( exists, oldValue ), params );\n }, params );\n // ---------\n } )( [], entries.slice( 0 ), descriptors => {\n const listenerRegistry = ListenerRegistry.getInstance( target, false, params.namespace );\n if ( listenerRegistry ) listenerRegistry.emit( descriptors );\n return receiver(\n isPropsList( prop/*original*/ ) ? descriptors.map( opr => opr.status ) : descriptors[ 0 ]?.status\n );\n } );\n}\n\n/**\n * Performs a defineProperty operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Object\t descriptor\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function defineProperty( target, prop, descriptor, receiver = x => x, params = {} ) {\n return set( target, prop, descriptor, receiver, params, true/*def*/ );\n}\n\n/**\n * Performs a defineProperties operation.\n * @note this isn't part of the standard Reflect API.\n * \n * @param Object\t target\n * @param Object\t descriptors\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function defineProperties( target, descriptors, receiver = x => x, params = {} ) {\n return set( target, descriptors, receiver, params, true/*def*/ );\n}\n\n/**\n * Performs a delete operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function deleteProperty( target, prop, receiver = x => x, params = {} ) {\n // ---------------\n target = resolveObj( target );\n if ( _isObject( receiver ) ) { [ params, receiver ] = [ receiver, x => x ]; }\n // ---------------\n const props = _arrFrom( prop, false ), related = [ ...props ];\n return ( function next( descriptors, props, _done ) {\n if ( !props.length ) return _done( descriptors );\n const prop = props.shift();\n // ---------\n function defaultDel( descriptor, status = undefined ) {\n const _next = status => ( descriptor.status = status, next( descriptors.concat( descriptor ), props, _done ) );\n if ( arguments.length > 1 ) return _next( descriptor, status );\n const accessorizedProps = _( target, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key + '' );\n if ( accessorization && !accessorization.restore() ) _next( false );\n return _next( Reflect.deleteProperty( target, descriptor.key ) );\n }\n // ---------\n function exec( oldValue ) {\n const descriptor = new Descriptor( target, {\n type: 'deleteProperty',\n key: prop,\n oldValue,\n related: [ ...related ],\n detail: params.detail,\n } );\n const listenerRegistry = TrapsRegistry.getInstance( target, false, params.namespace );\n return listenerRegistry \n ? listenerRegistry.emit( descriptor, defaultDel ) \n : defaultDel( descriptor );\n }\n // ---------\n return get( target, prop, exec, params );\n // ---------\n } )( [], props.slice( 0 ), descriptors => {\n const listenerRegistry = ListenerRegistry.getInstance( target, false, params.namespace );\n if ( listenerRegistry ) listenerRegistry.emit( descriptors );\n return receiver(\n isPropsList( prop/*original*/ ) ? descriptors.map( opr => opr.status ) : descriptors[ 0 ].status\n );\n } );\n}\n\n/**\n * @alias deleteProperty()\n */\nexport function deleteProperties( target, props, receiver = x => x, params = {} ) {\n return deleteProperty( ...arguments );\n}\n\n/* ---------------EFFECT APIs--------------- */\n\n/**\n * Performs a \"construct\" operation.\n *\n * @param Array|Object\t target\n * @param Array\t\t\t argumentsList\n * @param Object\t\t newTarget\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function construct( target, argumentsList, newTarget = null, receiver = x => x, params = {} ) {\n return exec( target, 'construct', arguments.length > 2 ? { argumentsList, newTarget } : { argumentsList }, receiver, params );\n}\n\n/**\n * Performs an \"apply\" operation.\n *\n * @param Array|Object\t target\n * @param Any\t thisArgument\n * @param Array\t argumentsList\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function apply( target, thisArgument, argumentsList, receiver = x => x, params = {} ) {\n return exec( target, 'apply', { thisArgument, argumentsList }, receiver, params );\n}\n\n/**\n * Performs a \"setPrototypeOf\" operation.\n *\n * @param Array|Object\t target\n * @param Anyr\t proto\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function setPrototypeOf( target, proto, receiver = x => x, params = {} ) {\n return exec( target, 'setPrototypeOf', { proto }, receiver, params );\n}\n\n/**\n * Performs a \"preventExtension\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function preventExtensions( target, receiver = x => x, params = {} ) {\n return exec( target, 'preventExtensions', {}, receiver, params );\n}\n\n/* ---------------HELPER APIs--------------- */\n\n/**\n * Adds an observer to a target's registry.\n *\n * @param Array|Object\t target\n * @param String|Object\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Function: AbortController\n */\nfunction bind( target, prop, receiver, params = {} ) {\n let controller;\n if ( !params.signal ) {\n controller = new AbortController;\n params = { ...params, signal: controller.signal };\n }\n const listenerRegistry = ListenerRegistry.getInstance( target, true, params.namespace );\n return function emit( descriptor_s, prevRegistration = null ) {\n prevRegistration?.remove();\n const registrationNext = listenerRegistry.addRegistration( prop, emit, params );\n const flags = { signal: registrationNext.signal, };\n if ( arguments.length ) {\n const handlerReturnValue = receiver( descriptor_s, flags );\n if ( arguments.length > 1 ) return handlerReturnValue;\n }\n return controller;\n };\n}\n\n/**\n * Performs an operation of the given \"type\".\n *\n * @param Array|Object\t target\n * @param String\t\t type\n * @param Object\t\t payload\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nfunction exec( target, type, payload = {}, receiver = x => x, params = {} ) {\n // ---------\n target = resolveObj( target );\n if ( _isObject( receiver ) ) { [ params, receiver ] = [ receiver, x => x ]; } \n // ---------\n function defaultExec( descriptor, result ) {\n if ( arguments.length > 1 ) return receiver( result );\n return receiver( Reflect[ type ]( target, ...Object.values( payload ) ) );\n }\n // ---------\n const descriptor = new Descriptor( target, { type, ...payload } );\n const listenerRegistry = TrapsRegistry.getInstance( target, false, params.namespace );\n if ( listenerRegistry ) {\n return listenerRegistry.emit( descriptor, defaultExec );\n }\n return defaultExec( descriptor );\n}\n\n// Asks if prop is a multi-result field\nfunction isPropsList( prop ) {\n return prop === Infinity || Array.isArray( prop );\n}\n\n// Resolves obj down to it's self\nfunction resolveObj( obj, assert = true ) {\n\tif ( ( !obj || !_isTypeObject( obj ) ) && assert ) throw new Error( `Object must be of type object or array! \"${ _getType( obj ) }\" given.` );\n if ( obj instanceof Descriptor ) {\n obj = obj.value;\n }\n\treturn obj && unproxy( obj );\n}\n\n// Resolves prop down to actual keys\nfunction resolveProps( obj, prop, receiver, params = {} ) {\n if ( prop === Infinity ) {\n if ( params.level && !_isTypeObject( obj ) ) return receiver( [] );\n return ownKeys( obj, receiver, params );\n }\n return receiver( _arrFrom( prop, false ) );\n}\n", "\r\n/**\r\n * Tells if val is pure object.\r\n *\r\n * @param object\t \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn !Array.isArray(val) && typeof val === 'object' && val;\r\n};\r\n", "\r\n/**\r\n * Returns the val's type.\r\n *\r\n * @param string \tval\r\n *\r\n * @return string\r\n */\r\nexport default function(val) {\r\n\treturn typeof val;\r\n};\r\n", "\r\n/**\r\n * Tells if val is of type \"array\".\r\n *\r\n * @param object\t \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn Array.isArray(val);\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isArray from '../js/isArray.js';\r\n\r\n/**\r\n * Returns the intersection of two arrays;\r\n * optionally using a custom matching function.\r\n *\r\n * @param array \tarr\r\n * @param array\t \tarr2\r\n * @param function \tcallback\r\n *\r\n * @return array\r\n */\r\nexport default function(arr, arr2, callback = null) {\r\n\treturn !_isArray(arr2) ? [] : arr.filter(val1 => callback \r\n\t\t? arr2.filter(val2 => callback(val1, val2)).length \r\n\t\t: arr2.indexOf(val1) !== -1\r\n\t);\r\n};\r\n", "/**\r\n * @imports\r\n */\r\nimport _intersect from '../arr/intersect.js';\r\n\r\n/**\r\n * Creates and/or returns an \"internals\" object for the given object.\r\n * \r\n * @param Any obj\r\n * @param String namespace\r\n * \r\n * @return Object\r\n */\r\nexport default function internals(obj, ...namespaces) {\r\n if (!globalThis.webqit) { globalThis.webqit = {}; }\r\n if (!globalThis.webqit.refs) {\r\n Object.defineProperty(globalThis.webqit, 'refs', {value: new ObservableMap})\r\n }\r\n if (!arguments.length) return globalThis.webqit.refs;\r\n let itnls = globalThis.webqit.refs.get(obj);\r\n if (!itnls) {\r\n itnls = new ObservableMap;\r\n globalThis.webqit.refs.set(obj, itnls);\r\n }\r\n let _ns, _itnls;\r\n while ((_ns = namespaces.shift())) {\r\n if ((_itnls = itnls) && !(itnls = itnls.get(_ns))) {\r\n itnls = new ObservableMap;\r\n _itnls.set(_ns, itnls);\r\n }\r\n }\r\n return itnls;\r\n}\r\n\r\nclass ObservableMap extends Map {\r\n constructor( ...args ) {\r\n super( ...args );\r\n this.observers = new Set;\r\n }\r\n set( key, value ) {\r\n let returnValue = super.set( key, value );\r\n this.fire( 'set', key, value, key );\r\n return returnValue;\r\n }\r\n delete( key ) {\r\n let returnValue = super.delete( key );\r\n this.fire( 'delete', key );\r\n return returnValue;\r\n }\r\n has( key ) {\r\n this.fire( 'has', key );\r\n return super.has( key );\r\n }\r\n get( key ) {\r\n this.fire( 'get', key );\r\n return super.get( key );\r\n }\r\n keyNames() { return Array.from( super.keys() ); }\r\n observe( type, key, callback ) {\r\n const entry = { type, key, callback };\r\n this.observers.add( entry );\r\n return () => this.observers.delete( entry );\r\n }\r\n unobserve( type, key, callback ) {\r\n if ( Array.isArray( type ) || Array.isArray( key ) ) {\r\n throw new Error( `The \"type\" and \"key\" arguments can only be strings.` );\r\n }\r\n for ( let entry of this.observers ) {\r\n if ( !( _intersection( [ type, '*' ], entry.type ) && _intersection( [ key, '*' ], entry.key ) && entry.callback === callback ) ) continue;\r\n this.observers.delete( entry );\r\n }\r\n }\r\n fire( type, key, ...args ) {\r\n // IMPORTANT: Array.from() must be used so that new additions to this.observers\r\n // during the loop aren't picked up!\r\n for ( let entry of this.observers ) {\r\n if ( !( _intersection( [ type, '*' ], entry.type ) && _intersection( [ key, '*' ], entry.key ) ) ) continue;\r\n entry.callback( ...args );\r\n }\r\n }\r\n}\r\n\r\nconst _intersection = ( a, b ) => {\r\n if ( Array.isArray( b ) ) return _intersect( a, b ).length;\r\n return a.includes( b );\r\n}\r\n", "\r\n/**\r\n * Tells if val is of type \"function\".\r\n * This holds true for both regular functions and classes.\r\n *\r\n * @param object\t \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn typeof val === 'function';\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isTypeFunction from './isTypeFunction.js';\r\n\r\n/**\r\n * Tells if val is of type \"class\".\r\n *\r\n * @param object \t\tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn _isTypeFunction(val) && /^class\\s?/.test(Function.prototype.toString.call(val));\r\n};\r\n", "\r\n/**\r\n * Tells if val is undefined or is null.\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn val === null || val === '';\r\n};\r\n", "\r\n/**\r\n * Tells if val is undefined or is of type \"undefined\".\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn arguments.length && (val === undefined || typeof val === 'undefined');\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isTypeFunction from './isTypeFunction.js';\r\n\r\n/**\r\n * Tells if val is of type \"object\".\r\n * This holds true for anything object, including built-ins.\r\n *\r\n * @param object\t \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn Array.isArray(val) || (typeof val === 'object' && val) || _isTypeFunction(val);\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isNull from './isNull.js';\r\nimport _isUndefined from './isUndefined.js';\r\nimport _isTypeObject from './isTypeObject.js';\r\n\r\n/**\r\n * Tells if val is empty in its own type.\r\n * This holds true for NULLs, UNDEFINED, FALSE, 0,\r\n * objects without keys, empty arrays.\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn _isNull(val) || _isUndefined(val) || val === false || val === 0 \r\n\t\t|| (_isTypeObject(val) && !Object.keys(val).length);\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isTypeFunction from './isTypeFunction.js';\r\n\r\n/**\r\n * Tells if val is of type \"function\".\r\n *\r\n * @param object \t\tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn _isTypeFunction(val) || (val && {}.toString.call(val) === '[object function]');\r\n};\r\n", "\r\n/**\r\n * Tells if val is of type \"number\".\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn val instanceof Number || (typeof val === 'number');\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isNumber from './isNumber.js';\r\n/**\r\n * Tells if val is of type \"string\" or a numeric string.\r\n * This holds true for both numbers and numeric strings.\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn _isNumber(val) || (val !== true && val !== false && val !== null && val !== '' && !isNaN(val * 1));\r\n};\r\n", "\r\n/**\r\n * Tells if val is of type \"string\".\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn val instanceof String || (typeof val === 'string' && val !== null);\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isString from './isString.js';\r\nimport _isUndefined from './isUndefined.js';\r\n\r\n/**\r\n * Tells if val is \"array-like\".\r\n * This holds true for anything that has a length property.\r\n *\r\n * @param object\t \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn !_isString(val) && !_isUndefined(val.length);\r\n};\r\n", "\r\n/**\r\n * Adds an item if not already exist.\r\n *\r\n * @param array \tarr\r\n * @param array\t \t...itms\r\n *\r\n * @return array\r\n */\r\nexport default function(arr, ...items) {\r\n\titems.forEach(itm => {\r\n\t\tif (arr.indexOf(itm) < 0) {\r\n\t\t\tarr.push(itm);\r\n\t\t}\r\n\t});\r\n\treturn arr;\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isArray from '../js/isArray.js';\r\n\r\n/**\r\n * Returns the prototype chain.\r\n *\r\n * @param object \t\tobj\r\n * @param object\t \tuntil\r\n *\r\n * @return bool\r\n */\r\nexport default function(obj, until) {\r\n\tuntil = until || Object.prototype;\r\n\tuntil = until && !_isArray(until) ? [until] : until;\r\n\t// We get the chain of inheritance\r\n\tvar prototypalChain = [];\r\n\tvar obj = obj;\r\n\twhile((obj && (!until || until.indexOf(obj) < 0) && obj.name !== 'default')) {\r\n\t\tprototypalChain.push(obj);\r\n\t\tobj = obj ? Object.getPrototypeOf(obj) : null;\r\n\t}\r\n\treturn prototypalChain;\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _pushUnique from '../arr/pushUnique.js';\r\nimport _getPrototypeChain from './getPrototypeChain.js';\r\n\r\n/**\r\n * Eagerly retrieves object members all down the prototype chain.\r\n *\r\n * @param object\t \tobj\r\n * @param object\t \tuntil\r\n *\r\n * @return array\r\n */\r\nexport default function(obj, until) {\r\n\tvar keysAll = [];\r\n\t_getPrototypeChain(obj, until).forEach(obj => {\r\n\t\t_pushUnique(keysAll, ...Object.getOwnPropertyNames(obj));\r\n\t});\r\n\treturn keysAll;\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isArray from '../js/isArray.js';\r\nimport _isFunction from '../js/isFunction.js';\r\nimport _isObject from '../js/isObject.js';\r\nimport _isTypeObject from '../js/isTypeObject.js';\r\nimport _isNumeric from '../js/isNumeric.js';\r\nimport _getAllPropertyNames from './getAllPropertyNames.js';\r\n\r\n/**\r\n * Merges values from subsequent arrays/objects first array/object;\r\n * optionally recursive\r\n *\r\n * @param array ...objs\r\n *\r\n * @return void\r\n */\r\nexport default function mergeCallback(objs, callback, deepProps = false, isReplace = false, withSymbols = false) {\r\n\tvar depth = 0;\r\n\tvar obj1 = objs.shift();\r\n\tif (_isNumeric(obj1) || obj1 === true || obj1 === false) {\r\n\t\tdepth = obj1;\r\n\t\tobj1 = objs.shift();\r\n\t}\r\n\tif (!objs.length) {\r\n\t\tthrow new Error('_merge() requires two or more array/objects.');\r\n\t}\r\n\tobjs.forEach((obj2, i) => {\r\n\t\tif (!_isTypeObject(obj2) && !_isFunction(obj2)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t(deepProps ? _getAllPropertyNames(obj2) : Object.keys(obj2)).forEach(key => {\r\n\t\t\tif (!callback(key, obj1, obj2, i)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar valAtObj1 = obj1[key];\r\n\t\t\tvar valAtObj2 = obj2[key];\r\n\t\t\tif (((_isArray(valAtObj1) && _isArray(valAtObj2)) || (_isObject(valAtObj1) && _isObject(valAtObj2))) \r\n\t\t\t&& (depth === true || depth > 0)) {\r\n\t\t\t\t// RECURSE...\r\n\t\t\t\tobj1[key] = _isArray(valAtObj1) && _isArray(valAtObj2) ? [] : {};\r\n\t\t\t\tmergeCallback([_isNumeric(depth) ? depth - 1 : depth, obj1[key], valAtObj1, valAtObj2], callback, deepProps, isReplace, withSymbols);\r\n\t\t\t} else {\r\n\t\t\t\tif (_isArray(obj1) && _isArray(obj2)) {\r\n\t\t\t\t\tif (isReplace) {\r\n\t\t\t\t\t\tobj1[key] = valAtObj2;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tobj1.push(valAtObj2);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// In case we're setting a read-only property\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tif (withSymbols) {\r\n\t\t\t\t\t\t\tObject.defineProperty(obj1, key, Object.getOwnPropertyDescriptor(obj2, key));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tobj1[key] = obj2[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch(e) {}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\treturn obj1;\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _mergeCallback from './mergeCallback.js';\r\n\r\n/**\r\n * Merges values from subsequent arrays/objects first array/object;\r\n * optionally recursive\r\n *\r\n * @param array ...objs\r\n *\r\n * @return void\r\n */\r\nexport default function(...objs) {\r\n\treturn _mergeCallback(objs, (k, obj1, obj2) => {\r\n\t\treturn true;\r\n\t}, false/*deepProps*/, false/*isReplace*/, false/*withSymbols*/);\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isArray from '../js/isArray.js';\r\nimport _isTypeArray from '../js/isTypeArray.js';\r\nimport _isEmpty from '../js/isEmpty.js';\r\nimport _isObject from '../js/isObject.js';\r\n\r\n/**\r\n * Casts an array-like object to an array.\r\n *\r\n * @param mixed \tval\r\n * @param bool\t \tcastObject\r\n *\r\n * @return array\r\n */\r\nexport default function(val, castObject = true) {\r\n\tif (_isArray(val)) {\r\n\t\treturn val;\r\n\t};\r\n\tif (!castObject && _isObject(val)) {\r\n\t\treturn [val];\r\n\t};\r\n\tif (val !== false && val !== 0 && _isEmpty(val)) {\r\n\t\treturn [];\r\n\t};\r\n\tif (_isTypeArray(val)) {\r\n\t\treturn Array.prototype.slice.call(val);\r\n\t};\r\n\tif (_isObject(val)) {\r\n\t\treturn Object.values(val);\r\n\t};\r\n\treturn [val];\r\n};\r\n", "\n/**\n * ---------------------------\n * The Registration class\n * ---------------------------\n */\n\nexport default class Registration {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param Registry\t\t\tregistry\n\t * @param object\t\t\tdfn\n\t *\n\t * @return void\n\t */\n\tconstructor( registry, dfn ) {\n\t\tthis.registry = registry;\n\t\tObject.assign( this, { ...dfn, target: registry.target } );\n\t\tif ( this.params.signal ) {\n\t\t\tthis.params.signal.addEventListener( 'abort', () => this.remove() );\n\t\t}\n\t}\n\n\t/**\n\t * Sets a \"disconnected\" flag on the Registration.\n\t *\n\t * @return void\n\t */\n\tremove() {\n\t\tthis.removed = true;\n\t\treturn this.registry.removeRegistration( this );\n\t}\n}", "\n/**\n * @imports\n */\nimport { _internals } from '@webqit/util/js/index.js';\n\nexport const _ = ( ...args ) => _internals( 'observer-api', ...args );\n\nexport const _await = ( value, callback ) => value instanceof Promise ? value.then( callback ) : callback( value );\n", "\n/**\n * @imports\n */\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport Registration from './Registration.js';\nimport { _await } from '../util.js';\n\n/**\n * ---------------------------\n * The ListenerRegistration class\n * ---------------------------\n */\n\nexport default class ListenerRegistration extends Registration {\n\t\n\t/**\n\t * @constructor\n\t */\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.emit.currentRegistration = this;\n\t\tObject.defineProperty( this, 'abortController', { value: new AbortController } );\n\t\tObject.defineProperty( this, 'signal', { value: this.abortController.signal } );\n\t}\n\n\t/**\n\t * De-registers the instance.\n\t * \n\t * @return Void\n\t */\n\tremove() {\n\t\tthis.abortController.abort();\n\t\tsuper.remove();\n\t}\n\n\t/**\n\t * Calls the observer's handler function\n\t * on matching with the event's fields.\n\t *\n\t * @param Array\t\t\t \t\tevents\n\t *\n\t * @return Any\n\t */\n\tfire( events ) {\n\t\tif ( this.emit.recursionTarget && ![ 'inject', 'force-async', 'force-sync' ].includes( this.params.recursions ) ) return;\n\t\tlet matches = events, filter = this.filter;\n\t\tif ( filter !== Infinity && ( filter = _arrFrom( filter, false ) ) ) {\n\t\t\tmatches = events.filter( event => filter.includes( event.key ) );\n\t\t}\n\t\tif ( this.params.diff ) {\n\t\t\tmatches = matches.filter( event => event.type !== 'set' || event.value !== event.oldValue );\n\t\t}\n\t\tif ( matches.length ) {\n\t\t\tif ( this.emit.recursionTarget && this.params.recursions !== 'force-sync' ) {\n\t\t\t\tthis.emit.recursionTarget.push( ...matches );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.emit.recursionTarget = this.params.recursions === 'inject' ? matches : [];\n\t\t\tconst $ret = this.filter === Infinity || Array.isArray( this.filter )\n\t\t\t\t? this.emit( matches, this )\n\t\t\t\t: this.emit( matches[ 0 ], this );\n\t\t\t// NOTEL: on calling emit(), this registration has expired and a new one active!!!\n\t\t\treturn _await( $ret, ret => {\n\t\t\t\tconst recursions = this.emit.recursionTarget;\n\t\t\t\tdelete this.emit.recursionTarget;\n\t\t\t\tif ( this.params.recursions === 'force-async' ) {\n\t\t\t\t\tif ( recursions.length ) return this.emit.currentRegistration.fire( recursions );\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t\t} );\n\t\t}\n\t}\n}\n", "\n/**\n * @imports\n */\nimport { _isTypeObject, _getType } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom, _intersect, _equals as _arrEquals } from '@webqit/util/arr/index.js';\nimport { _ } from '../util.js';\n\n/**\n * ---------------------------\n * The Registry class\n * ---------------------------\n */\n\nexport default class Registry {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param object\ttarget\n\t * \n\t * @return void\n\t */\n\tconstructor( target ) {\n\t\tthis.target = target;\n\t\tthis.entries = [];\n\t}\n\t\n\t/**\n\t * Adds an Registration instance\n\t * with optional tags.\n\t *\n\t * @param Registration\t\tregistration\n\t *\n\t * @return Registration\n\t */\n\taddRegistration( registration ) {\n\t\tthis.entries.push( registration );\n\t\treturn registration;\n\t}\n\t\n\t/**\n\t * Removes registrations by reference.\n\t *\n\t * @param Registration\t\tregistration\n\t *\n\t * @return void\n\t */\n\tremoveRegistration( registration ) {\n\t\tthis.entries = this.entries.filter( _entry => _entry !== registration );\n\t}\n\t\t\n\t/**\n\t * Returns a observer-specific object embedded on an element.\n\t *\n\t * @param string\t\ttype\n\t * @param array|object\ttarget\n\t * @param bool \tcreateIfNotExists\n\t * @param string \tnamespace\n\t *\n\t * @return Registry\n\t */\n\tstatic _getInstance( type, target, createIfNotExists = true, namespace = this.__namespace ) {\n\t\tif ( !_isTypeObject( target ) ) throw new Error( `Subject must be of type object; \"${ _getType( target ) }\" given!` );\n\t\tlet ImplementationClass = this;\n\t\tif ( namespace && _( 'namespaces' ).has( type + '-' + namespace ) ) {\n\t\t\tImplementationClass = _( 'namespaces' ).get( type + '-' + namespace );\n\t\t\ttype += '-' + namespace\n\t\t}\n\t\tif ( !_( target, 'registry' ).has( type ) && createIfNotExists ) {\n\t\t\t_( target, 'registry' ).set( type, new ImplementationClass( target ) );\n\t\t}\n\t\treturn _( target, 'registry' ).get( type );\n\t}\n\n\t/**\n\t * Extend a Fireable Class with a namespace.\n\t *\n\t * @param string\t\tnamespace\n\t * @param class \tImplementationClass\n\t *\n\t * @return void|class\n\t */\n\tstatic _namespace( type, namespace, ImplementationClass = null ) {\n\t\ttype += '-' + namespace;\n\t\tif ( arguments.length === 2 ) return _( 'namespaces' ).get( type );\n\t\tif ( !( ImplementationClass.prototype instanceof this ) ) {\n\t\t\tthrow new Error( `The implementation of the namespace ${ this.name }.${ namespace } must be a subclass of ${ this.name }.` );\n\t\t}\n\t\t_( 'namespaces' ).set( type, ImplementationClass );\n\t\tImplementationClass.__namespace = namespace;\n\t}\n}", "\n/**\n * @imports\n */\nimport ListenerRegistration from './ListenerRegistration.js';\nimport Registry from './Registry.js';\nimport { _await } from '../util.js';\n\n/**\n * ---------------------------\n * The ListenerRegistry class\n * ---------------------------\n */\n\nexport default class ListenerRegistry extends Registry {\n\n\tstatic getInstance( target, createIfNotExists = true, namespace = null ) {\n\t\treturn super._getInstance( 'listeners', ...arguments );\n\t}\n\n\tstatic namespace( namespace, ImplementationClass = null ) {\n\t\treturn super._namespace( 'listeners', ...arguments );\n\t}\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( target ) {\n\t\tsuper( target );\n\t\tthis.batches = [];\n\t}\n\t\n\t/**\n\t * @addRegistration\n\t */\n\taddRegistration( filter, emit, params ) {\n\t\treturn super.addRegistration( new ListenerRegistration( this, { filter, emit, params } ) );\n\t}\n\t\n\t/**\n\t * Fires all observers with the given evt (change).\n\t *\n\t * @param Arrayn events\n\t *\n\t * @return Void\n\t */\n\temit( events ) {\n\t\tif ( this.batches.length ) {\n\t\t\tthis.batches[ 0 ].events.push( ...events );\n\t\t\treturn\n\t\t}\n\t\tthis.entries.forEach( listener => listener.fire( events ) );\n\t}\n\n\t/**\n\t * Fires all observers with the given evt (change).\n\t *\n\t * @param Arrayn events\n\t *\n\t * @return Void\n\t */\n\tbatch( callback ) {\n\t\tthis.batches.unshift( { entries: [ ...this.entries ], events: [] } );\n\t\tconst returnValue = callback();\n\t\treturn _await( returnValue, returnValue => {\n\t\t\tconst batch = this.batches.shift();\n\t\t\tif ( batch.events.length ) {\n\t\t\t\tbatch.entries.forEach( listener => listener.fire( batch.events ) );\n\t\t\t}\n\t\t\treturn returnValue;\n\t\t} )\n\t}\n\n}", "\n/**\n * @imports\n */\nimport Registration from './Registration.js';\n\n/**\n * ---------------------------\n * The TrapsRegistration class\n * ---------------------------\n */\n\nexport default class TrapsRegistration extends Registration {\n\t\n\t/**\n\t * Calls the observer's handler function\n\t * on matching with the descriptor's fields.\n\t *\n\t * @param Descriptor\t\t\t \tdescriptor\n\t * @param function\t\t\t\t\tnext\n\t * @param mixed\t\t\t\t\t \trecieved\n\t *\n\t * @return void\n\t */\n\texec( descriptor, next, recieved ) {\n\t\tif ( this.running || !this.traps[ descriptor.type ] ) {\n\t\t\treturn next( ...Array.prototype.slice.call( arguments, 2 ) );\n\t\t}\n\t\tthis.running = true;\n\t\treturn this.traps[ descriptor.type ]( descriptor, recieved, ( ...args ) => {\n\t\t\tthis.running = false;\n\t\t\treturn next( ...args );\n\t\t} );\n\t}\n}", "\n/**\n * @imports\n */\nimport TrapsRegistration from './TrapsRegistration.js';\nimport Registry from './Registry.js';\n\n/**\n * ---------------------------\n * The TrapsRegistry class\n * ---------------------------\n */\n\nexport default class TrapsRegistry extends Registry {\n\n\tstatic getInstance( target, createIfNotExists = true, namespace = null ) {\n\t\treturn super._getInstance( 'traps', ...arguments );\n\t}\n\n\tstatic namespace( namespace, ImplementationClass = null ) {\n\t\treturn super._namespace( 'traps', ...arguments );\n\t}\n\t\n\t/**\n\t * @inheritdoc\n\t */\n\taddRegistration( dfn ) {\n\t\treturn super.addRegistration( new TrapsRegistration( this, dfn ) );\n\t}\n\n\t/**\n\t * Fires all interceptors with the given action.\n\t *\n\t * @param Descriptor\t\tdescriptor\n\t * @param function\t\t\tdefaultHandler\n\t *\n\t * @return mixed\n\t */\n\temit( descriptor, defaultHandler = null ) {\n\t\tconst $this = this;\n\t\treturn ( function next( index, ..._args ) {\n\t\t\tconst registration = $this.entries[ index ];\n\t\t\tif ( registration ) {\n\t\t\t\treturn registration.exec( descriptor, ( ...args ) => {\n\t\t\t\t\treturn next( index + 1, ...args );\n\t\t\t\t}/*next*/, ..._args );\n\t\t\t}\n\t\t\treturn defaultHandler ? defaultHandler( descriptor, ..._args ) : _args[ 0 ];\n\t\t} )( 0 );\n\t}\n}", "\n/**\n * ---------------------------\n * The Descriptor class\n * ---------------------------\n */\n\nexport default class Descriptor {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param array|object\ttarget\n\t * @param object\t\tdfn\n\t *\n\t * @return void\n\t */\n\tconstructor( target, dfn ) {\n\t\tthis.target = target;\n\t\tif ( !( dfn.type ) ) throw new Error( 'Descriptor type must be given in definition!' );\n\t\tObject.assign( this, dfn );\n\t}\n}", "\n/**\n * @imports\n */\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport { _isClass, _isFunction, _isTypeObject, _getType } from '@webqit/util/js/index.js';\nimport { set, deleteProperty, has, get, ownKeys, defineProperty, getOwnPropertyDescriptor } from \"./main.js\";\nimport { batch, apply, construct, getPrototypeOf, setPrototypeOf, isExtensible, preventExtensions } from \"./main.js\";\nimport { _ } from './util.js';\n\n/* ---------------ACCESSORIZE METHODS--------------- */\n\n/**\n * Accessorizes props.\n *\n * @param Array|Object\ttarget\n * @param String|Array\tprops\n * @param Object\t\tparams\n *\n * @return Array\n */\nexport function accessorize( target, props, params = {} ) {\n target = resolveTarget( target );\n const accessorizedProps = _( target, 'accessorizedProps' );\n // ---------\n function getDescriptorDeep( prop ) {\n let descriptor, proto = target;\n do {\n descriptor = Object.getOwnPropertyDescriptor( proto, prop );\n } while ( !descriptor && ( proto = Object.getPrototypeOf( proto ) ) );\n return descriptor \n ? { proto, descriptor } \n : { descriptor: { value: undefined, configurable: true, enumerable: true, writable: true } };\n }\n // ---------\n function accessorizeProp( prop ) {\n if ( accessorizedProps.has( prop + '' ) ) return true;\n // ------------------\n // Current Descriptor Record\n const currentDescriptorRecord = getDescriptorDeep( prop );\n currentDescriptorRecord.getValue = function() {\n return this.descriptor.get ? this.descriptor.get() : this.descriptor.value;\n };\n currentDescriptorRecord.setValue = function( value ) {\n this.dirty = true;\n return this.descriptor.set ? this.descriptor.set( value ) !== false : ( this.descriptor.value = value, true );\n };\n currentDescriptorRecord.intact = function() {\n const currentDescriptor = Object.getOwnPropertyDescriptor( target, prop );\n return currentDescriptor?.get === accessorization.get \n && currentDescriptor?.set === accessorization.set\n && accessorizedProps.get( prop + '' ) === this;\n };\n currentDescriptorRecord.restore = function() {\n if ( !this.intact() ) return false;\n if ( ( this.proto && this.proto !== target ) || ( !this.proto && !this.dirty ) ) { delete target[ prop ]; }\n else { Object.defineProperty( target, prop, this.descriptor ); }\n accessorizedProps.delete( prop + '' );\n return true;\n };\n accessorizedProps.set( prop + '', currentDescriptorRecord );\n // ------------------\n // enumerable, configurable\n const { enumerable = true } = currentDescriptorRecord.descriptor;\n const accessorization = { enumerable, configurable: true };\n // set, get\n if ( ( 'value' in currentDescriptorRecord.descriptor ) || currentDescriptorRecord.descriptor.set ) {\n accessorization.set = function ( value ) { return set( this, prop, value, params ); };\n }\n if ( ( 'value' in currentDescriptorRecord.descriptor ) || currentDescriptorRecord.descriptor.get ) {\n accessorization.get = function () { return get( this, prop, params ); };\n }\n try {\n Object.defineProperty( target, prop, accessorization );\n return true;\n } catch( e ) {\n accessorizedProps.delete( prop + '' );\n return false;\n }\n }\n const _props = Array.isArray( props ) ? props : (\n props === undefined ? Object.keys( target ) : [ props ]\n );\n const statuses = _props.map( accessorizeProp );\n return props === undefined || Array.isArray( props ) \n ? statuses \n : statuses[ 0 ];\n}\n\n/**\n * Unaccessorizes previously accessorized props.\n *\n * @param Array|Object\ttarget\n * @param String|Array\tprops\n * @param Object\t\tparams\n *\n * @return Array\n */\nexport function unaccessorize( target, props, params = {} ) {\n target = resolveTarget( target );\n const accessorizedProps = _( target, 'accessorizedProps' );\n function unaccessorizeProp( prop ) {\n if ( !accessorizedProps.has( prop + '' ) ) return true;\n return accessorizedProps.get( prop + '' ).restore();\n }\n const _props = Array.isArray( props ) ? props : (\n props === undefined ? Object.keys( target ) : [ props ]\n );\n const statuses = _props.map( unaccessorizeProp );\n return props === undefined || Array.isArray( props ) \n ? statuses \n : statuses[ 0 ];\n}\n\n/* ---------------PROXY METHODS--------------- */\n\n/**\n * Returns an object as a proxy and binds all instance methods\n * to the proxy instead of the object itself.\n *\n * @param Array|Object\t\ttarget\n * @param Object\t\t params\n *\n * @return Proxy\n */\nexport function proxy( target, params = {} ) {\n target = resolveTarget( target );\n const proxy = new Proxy( target, {\n apply: ( target, thisArgument, argumentsList ) => apply( target, thisArgument, argumentsList, params ),\n construct: ( target, argumentsList, newTarget = null ) => construct( target, argumentsList, newTarget, params ),\n defineProperty: ( target, propertyKey, attributes ) => defineProperty( target, propertyKey, attributes, params ),\n deleteProperty: ( target, propertyKey ) => deleteProperty( target, propertyKey, params ),\n get: ( target, propertyKey, receiver = null ) => {\n const val = get( target, propertyKey, { ...params, receiver } );\n if ( params.proxyAutoBinding !== false && _isFunction( val ) && !_isClass( val )) {\n return function( ...args ) {\n const _this = this || proxy;\n return batch( _this, () => val.call( _this, ...args ) );\n }\n }\n return val;\n },\n getOwnPropertyDescriptor: ( target, propertyKey ) => getOwnPropertyDescriptor( target, propertyKey, params ),\n getPrototypeOf: target => getPrototypeOf( target, params ),\n has: ( target, propertyKey ) => has( target, propertyKey, params ),\n isExtensible: target => isExtensible( target, params ),\n ownKeys: target => ownKeys( target, params ),\n preventExtensions: target => preventExtensions( target, params ),\n set: ( target, propertyKey, value, receiver = null ) => set( target, propertyKey, value, { ...params, receiver } ),\n setPrototypeOf: ( target, prototype ) => setPrototypeOf( target, prototype, params ),\n });\n _( proxy ).set( proxy, target );\n\treturn proxy;\n}\n\n/**\n * Returns the original object earlier proxied by proxy().\n *\n * @param Proxy|Any\t\ttarget\n *\n * @return Any\n */\nexport function unproxy( target ) {\n // Proxy targets are mapped to their own instances internally\n return _( target ).get( target ) || target;\n}\n\n/* ---------------HELPERS--------------- */\n\n/** \n * Ensures target object is an object or array.\n *\n * @param Array|Object\ttarget\n *\n * @return Array|Object\n */\nfunction resolveTarget( target ) {\n\tif ( !target || !_isTypeObject( target ) ) throw new Error('Target must be of type object!');\n\treturn unproxy( target );\n}\n", "\n/**\n * @imports\n */\nimport * as main from './main.js';\nimport * as actors from './actors.js';\n\nconst Observer = { ...main, ...actors };\n\nexport default Observer;", "\r\n/**\r\n * @imports\r\n */\r\nimport _isTypeObject from '../js/isTypeObject.js';\r\nimport _isUndefined from '../js/isUndefined.js';\r\nimport _isNull from '../js/isNull.js';\r\nimport _arrFrom from '../arr/from.js';\r\n\r\n/**\r\n * Retrieves the value at the given path.\r\n *\r\n * A return value of undefined is ambiguous, and can mean either that the\r\n * path does not exist, or that the path actually exists but with a value of undefined. If it is required to\r\n * know whether the path actually exists, pass an object as a third argument.\r\n * This object will have an \"exists\" key set to true/false.\r\n *\r\n * @param object \t\t\t\tctxt\r\n * @param array \t\t\t\tpath\r\n * @param object \t\t\t\ttrap\r\n * @param object \t\t\t\treciever\r\n *\r\n * @return mixed\r\n */\r\nexport default function(ctxt, path, trap = {}, reciever = {}) {\r\n\tpath = _arrFrom(path).slice();\r\n\tvar _ctxt = ctxt;\r\n\twhile(!_isUndefined(_ctxt) && !_isNull(_ctxt) && path.length) {\r\n\t\tvar _key = path.shift();\r\n\t\tif (!(trap.get ? trap.get(_ctxt, _key) : (_isTypeObject(_ctxt) ? _key in _ctxt : _ctxt[_key]))) {\r\n\t\t\treciever.exists = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t_ctxt = trap.get ? trap.get(_ctxt, _key) : _ctxt[_key];\r\n\t}\r\n\treciever.exists = true;\r\n\treturn _ctxt;\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isTypeObject from '../js/isTypeObject.js';\r\nimport _isFunction from '../js/isFunction.js';\r\nimport _isNumeric from '../js/isNumeric.js';\r\nimport _isArray from '../js/isArray.js';\r\nimport _arrFrom from '../arr/from.js';\r\nimport _get from './get.js';\r\n\r\n/**\r\n * Sets a value to the given path.\r\n *\r\n * @param object \t\t\t\tobj\r\n * @param array \t\t\t\tpath\r\n * @param mixed \t\t\t\tval\r\n * @param object|function \t\tbuildTree\r\n * @param object \t\t\t\ttrap\r\n *\r\n * @return bool\r\n */\r\nexport default function(obj, path, val, buildTree = {}, trap = {}) {\r\n\tconst _set = (target, key, val) => {\r\n\t\tif (trap.set) {\r\n\t\t\treturn trap.set(target, key, val);\r\n\t\t} else {\r\n\t\t\tif (_isNumeric(path[i]) && _isArray(target)) {\r\n\t\t\t\ttarget.push(val);\r\n\t\t\t} else {\r\n\t\t\t\ttarget[key] = val;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n\tpath = _arrFrom(path);\r\n\tvar target = obj;\r\n\tfor(var i = 0; i < path.length; i ++) {\r\n\t\tif (i < path.length - 1) {\r\n\t\t\tif (!target || (!_isTypeObject(target) && !_isFunction(target))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tvar branch = _get(target, path[i], trap);\r\n\t\t\tif (!_isTypeObject(branch)) {\r\n\t\t\t\tif (trap.buildTree === false) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbranch = _isFunction(trap.buildTree) ? trap.buildTree(i) : (_isNumeric(path[i + 1]) ? [] : {});\r\n\t\t\t\tvar branchSuccess = _set(target, path[i], branch);\r\n\t\t\t\tif (!branchSuccess) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttarget = branch;\r\n\t\t} else {\r\n\t\t\treturn _set(target, path[i], val);\r\n\t\t}\r\n\t}\r\n};\r\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, asyncDOM = true ) {\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\tthis.async = asyncDOM;\n\t\tif ( this.window.requestAnimationFrame ) {\n\t\t\tthis._run();\n\t\t} else {\n\t\t\tthis.async = false;\n\t\t}\n\t}\n\n\t_run() {\n\t\tthis.window.requestAnimationFrame( () => {\n\t\t\tfor ( const callback of this.readCallbacks ) {\n\t\t\t\tcallback();\n\t\t\t\tthis.readCallbacks.delete( callback );\n\t\t\t}\n\t\t\tfor ( const callback of this.writeCallbacks ) {\n\t\t\t\tcallback();\n\t\t\t\tthis.writeCallbacks.delete( callback );\n\t\t\t}\n\t\t\tthis._run();\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.async === false ) {\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.async === false ) {\n\t\t\tcallback();\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.async === false ) {\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.async === false ) {\n\t\t\tcallback();\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/**\n * @imports\n */\nimport { _isFunction, _isObject, _internals } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.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\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.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 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\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 _internals( 'realdom.realtime', this.window, 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, records = Array.isArray( record_s ) ? record_s : [ record_s ];\n\t\tlet dispatchBatch = new Set;\n\t\tfor ( const [ depth, registries ] of this.registry( interceptionTiming ) ) {\n\t\t\tfor ( const [ context, registry ] of registries ) {\n\t\t\t\t// Ensure event target is/within context\n\t\t\t\tlet matches = records.filter( record => {\n\t\t\t\t\tif ( !context.contains( record.target ) ) return false;\n\t\t\t\t\treturn depth === 'subtree' || record.target === context;\n\t\t\t\t} );\n\t\t\t\tif ( !matches.length ) continue;\n\t\t\t\t// Records will be dispatched in their original form\n\t\t\t\tif ( !Array.isArray( record_s ) ) { matches = matches[ 0 ]; }\n\t\t\t\tfor ( const registration of registry ) {\n\t\t\t\t\tdispatchBatch.add( [ registration, matches, context ] );\n\t\t\t\t\t//callback.call( this, registration, matches, context );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Saving everything to dispatchBatch ensures that recursive modifications\n\t\t// to both this.registry( interceptionTiming ), registries, and registry aren't pciked up\n\t\tfor ( const [ registration, record_s, context ] of dispatchBatch ) {\n\t\t\tcallback.call( this, registration, record_s, context );\n\t\t}\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 Realtime from './Realtime.js';\n\n/**\n *\n * @class AttrRealtime\n */\nexport default class AttrRealtime extends Realtime {\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\tfilter\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( filter, callback = undefined, params = {} ) {\n\t\tconst originalFilterIsString = typeof filter === 'string';\n\t\t[ filter = [], callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// -------------\n\t\tconst records = attrIntersection( context, filter );\n\t\tconst record_s = originalFilterIsString ? records[ 0 ] : records;\n\t\tif ( !callback ) return record_s;\n\t\tconst signalGenerator = callback && params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst flags = signalGenerator?.generate() || {};\n\t\tcallback( record_s, flags, context );\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 ? filter[ 0 ] : filter, 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\tfilter\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( filter, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof filter === 'string';\n\t\t[ filter = [], callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( originalFilterIsString ? filter[ 0 ] : filter, 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 = dedup( 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 };\n\t\tif ( filter.length ) { $params.attributeFilter = filter; }\n\t\tdisconnectable.observe( context, $params );\n\t\t// -------------\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, filter, 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\tfilter\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( filter, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof filter === 'string';\n\t\t[ filter, 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\tconst intersectionDepth = params.subtree ? 'subtree' : 'children';\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() {\n\t\t\tregistry.delete( registration );\n\t\t\tif ( !registry.size ) { registries.delete( context ); }\n\t\t} };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, filter, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\t// -------------\n\t\tconst registries = this.registry( interceptionTiming, intersectionDepth );\n\t\tif ( !registries.has( context ) ) { registries.set( context, new Set ); }\n\t\tconst registry = registries.get( context );\n\t\tregistry.add( registration );\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 dedup( records ) {\n\treturn records.reduce( ( rcds, rcd, i ) => {\n\t\tif ( rcds[ i - 1 ]?.attributeName === 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, filter, callback, params, atomics, originalFilterIsString, signalGenerator } = registration;\n\tif ( params.atomic && !atomics.size ) {\n\t\trecords = attrIntersection( context, filter, records );\n\t}\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: 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?.generate() || {};\n\tcallback( record_s, flags, context );\n}\n\n/**\n * Helper to determining which records to deliver.\n * \n * @param Object \t\t\tcontext\n * @param Array \t\t\tfilter\n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction attrIntersection( context, filter, records = [] ) {\n\tconst _type = { event: null, type: 'attribute' };\n\tif ( filter.length ) {\n\t\treturn filter.map( attrName => {\n\t\t\treturn records.find( r => r.name === attrName ) || { target: context, name: attrName, value: 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: 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 ] || '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\tclearTimeout( registry[ record.name ]?.timeout ); // Clear any previous that's still active\n\t\tregistry[ record.name ] = record.event; // Main: set event details... and next to timeout details\n\t\tconst timeout = setTimeout( () => { delete registry[ record.name ]; }, 0 );\n\t\tObject.defineProperty( record.event, 'timeout', { value: timeout, configurable: true } );\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 = dedup( records ).map( rcd => withAttrEventDetails.call( window, rcd ) ).filter( ( rcd, i ) => {\n\t\t\treturn !Array.isArray( rcd.event );\n\t\t} );\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 = 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';\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\tselectors\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( selectors, callback = undefined, params = {} ) {\n\t\t[ selectors, 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 ( !selectors.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 ( selectors.every( selector => typeof selector === 'string' ) && ( selectors = selectors.join( ',' ) ) ) {\n\t\t\t\tconst matches = params.subtree\n\t\t\t\t\t? context.querySelectorAll( selectors )\n\t\t\t\t\t: [ ...context.children ].filter( node => node.matches( selectors ) );\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( selectors, 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( selectors, callback = undefined, params = {} ) {\n\t\t[ selectors, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( selectors, callback, { ...params, subtree: false } );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: true } )\n\t */\n\tsubtree( selectors, callback = undefined, params = {} ) {\n\t\t[ selectors, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( selectors, callback, { ...params, subtree: true } );\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|Element|string\t\tselectors\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( selectors, callback, params = {} ) {\n\t\t[ selectors, callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( selectors, 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, } );\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, selectors, 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\tselectors\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( selectors, callback, params = {} ) {\n\t\t[ selectors, 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\tconst intersectionDepth = params.subtree ? 'subtree' : 'children';\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 } );\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() {\n\t\t\tmo.disconnect();\n\t\t\tregistry.delete( registration );\n\t\t\tif ( !registry.size ) { registries.delete( context ); }\n\t\t} };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, selectors, callback, params, signalGenerator, disconnectable };\n\t\t// -------------\n\t\tconst registries = this.registry( interceptionTiming, intersectionDepth );\n\t\tif ( !registries.has( context ) ) { registries.set( context, new Set ); }\n\t\tconst registry = registries.get( context );\n\t\tregistry.add( registration );\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\n/**\n * Sensitivty for attribute changes for attribute selectors.\n * \n * @param object registration\n * \n * @returns Disconnectable\n */\nfunction staticSensitivity( registration ) {\n\tconst window = this;\n\tconst { context, selectors, callback, params, signalGenerator } = registration;\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( selectors.filter( s => typeof s === 'string' && 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, selectors.some( selector => node.matches( selector ) ) ); }\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, selectors, 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 ( selectors.length ) {\n\t\t\trecord[ generation ] = nodesIntersection( selectors, _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\ttargets \n * @param Array \t\t\tsources \n * @param Bool \t\t\t\tdeepIntersect \n * \n * @returns \n */\nfunction nodesIntersection( targets, sources, deepIntersect ) {\n\tsources = Array.isArray( sources ) ? sources : [ ...sources ];\n\tconst match = ( sources, target ) => {\n\t\t// Filter out text nodes\n\t\tsources = sources.filter( source => source.matches );\n\t\tif ( typeof target === 'string' ) {\n\t\t\t// Is directly mutated...\n\t\t\tlet matches = sources.filter( source => source.matches( target ) );\n\t\t\t// Is contextly mutated...\n\t\t\tif ( deepIntersect ) {\n\t\t\t\tmatches = sources.reduce( ( collection, source ) => {\n\t\t\t\t\treturn [ ...collection, ...source.querySelectorAll( target ) ];\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( target ) || (\n\t\t\t\tdeepIntersect && sources.some( source => source.contains( target ) )\n\t\t\t) ) { return [ target ]; }\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 targets.reduce( ( matches, target ) => {\n\t\tlet _matches;\n\t\tif ( sources.$$searchCache.has( target ) ) {\n\t\t\t_matches = sources.$$searchCache.get( target );\n\t\t} else {\n\t\t\t_matches = match( sources, target ) || [];\n\t\t\tif ( _isObject( target ) ) {\n\t\t\t\tsources.$$searchCache.set( target, _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.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// 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 _originalApis = { characterData: Object.create( null ), other: Object.create( null ) };\n\t[ 'insertBefore'/*Node*/, 'insertAdjacentElement', 'insertAdjacentHTML', 'setHTML',\n\t\t'replaceChildren', 'replaceWith', 'remove', 'replaceChild'/*Node*/, 'removeChild'/*Node*/, \n\t\t'before', 'after', 'append', 'prepend', 'appendChild'/*Node*/, \n\t].forEach( apiName => {\n\t\tfunction method( ...args ) {\n\t\t\tconst originalApis = this instanceof CharacterData ? _originalApis.characterData : _originalApis.other;\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tconst exec = () => originalApis[ apiName ].call( this, ...args );\n\t\t\tif ( !( this instanceof CharacterData || this instanceof Element || this instanceof DocumentFragment ) ) 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 ( [ 'setHTML', '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', 'setHTML' ].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 originalApis[ apiName ].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 );\n\t\t\t\toriginalApis.setHTML.call( temp, entrants[ 0 ], apiName === 'setHTML' ? 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\targs[ 1 ].______isTemp = true;\n\t\t\t\t\targs[ 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\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, () => {\n\t\t\t\treturn originalApis[ apiNameFinal ].call( this, ...args );\n\t\t\t} );\n\t\t}\n\t\t// We'll be sure to monkey the correct interface\n\t\tif ( [ 'insertBefore', 'replaceChild', 'removeChild', 'appendChild' ].includes( apiName ) ) {\n\t\t\t_originalApis.other[ apiName ] = Node.prototype[ apiName ];\n\t\t\tNode.prototype[ apiName ] = method;\n\t\t} else {\n\t\t\t// Comment nodes have this methods too\n\t\t\tif ( [ 'after', 'before', 'remove', 'replaceWith' ].includes( apiName ) ) {\n\t\t\t\t_originalApis.characterData[ apiName ] = CharacterData.prototype[ apiName ];\n\t\t\t\tCharacterData.prototype[ apiName ] = method;\n\t\t\t}\n\t\t\t// In case newer methods like setHTML() are not supported\n\t\t\tif ( Element.prototype[ apiName ] ) {\n\t\t\t\t_originalApis.other[ apiName ] = Element.prototype[ apiName ];\n\t\t\t\tElement.prototype[ apiName ] = method;\n\t\t\t}\n\t\t}\n\t} );\n\n\tconst originalApis = Object.create( null );\n\t// Intercept DOM mutation properties\n\t[ 'outerHTML', 'outerText'/*HTMLElement*/, 'innerHTML', \n\t\t'innerText'/*HTMLElement*/,'textContent'/*Node*/, 'nodeValue'/*Node*/\n\t].forEach( apiName => {\n\t\t// We'll be sure to monkey the correct interface\n\t\tconst Interface = [ 'textContent', 'nodeValue' ].includes( apiName ) ? Node : (\n\t\t\t[ 'outerText', 'innerText' ].includes( apiName ) ? HTMLElement : Element\n\t\t);\n\t\toriginalApis[ apiName ] = Object.getOwnPropertyDescriptor( Interface.prototype, apiName );\n\t\tObject.defineProperty( Interface.prototype, apiName, { ...originalApis[ apiName ], set: function( value ) {\n\t\t\tlet exec = () => originalApis[ apiName ].set.call( this, value );\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tif ( !( this instanceof Element ) ) 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\texits = /*this instanceof HTMLTemplateElement \n\t\t\t\t\t? [ ...this.content.childNodes ]\n\t\t\t\t\t: */[ ...this.childNodes ];\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 === 'TEMPLATE' ? 'div' : tempNodeName );\n\t\t\t\toriginalApis[ apiName ].set.call( temp, value );\n\t\t\t\tentrants = /*[ ...temp.childNodes ];*/this instanceof HTMLTemplateElement ? [] : [ ...temp.childNodes ];\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\tvalue.______isTemp = true;\n\t\t\t\t\tvalue.append( ...temp.childNodes );\n\t\t\t\t\texec = () => 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 = () => this.content.replaceChildren( ...temp.childNodes );\n\t\t\t\t\t} else {\n\t\t\t\t\t\texec = () => Element.prototype.replaceChildren.call( this, ...temp.childNodes );\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\t// Intercept document mutation methods\n\t[ 'append', 'prepend', 'replaceChildren' ].forEach( apiName => {\n\t\t[ document, DocumentFragment.prototype ].forEach( target => {\n\t\t\tconst originalApi = target[ apiName ];\n\t\t\ttarget[ apiName ] = function( ...args ) {\n\t\t\t\tif ( this.______isTemp ) return originalApi.call( this, ...args );\n\t\t\t\tconst exits = apiName === 'replaceChildren' ? [ ...this.childNodes ] : [];\n\t\t\t\tconst record = {\n\t\t\t\t\ttarget: this,\n\t\t\t\t\tentrants: args,\n\t\t\t\t\texits,\n\t\t\t\t\ttype: 'interception', \n\t\t\t\t\tevent: [ this, apiName ]\n\t\t\t\t};\n\t\t\t\treturn intercept( record, () => {\n\t\t\t\t\treturn originalApi.call( this, ...args );\n\t\t\t\t} );\n\t\t\t}\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 // ------\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 * @imports\n */\nimport realdomInit from '@webqit/realdom';\nimport { _internals } from '@webqit/util/js/index.js';\nimport { _merge } from '@webqit/util/obj/index.js';\n\nexport const _ = ( ...args ) => _internals( 'oohtml', ...args );\n\nexport function _init( name, $config, $defaults ) {\n const _name = name.toUpperCase().replace( '-', '_' );\n const window = this, realdom = realdomInit.call( window );\n window.webqit || ( window.webqit = {} );\n window.webqit.oohtml || ( window.webqit.oohtml = {} );\n window.webqit.oohtml.configs || ( window.webqit.oohtml.configs = {} );\n window.webqit.oohtml.configs[ _name ] || ( window.webqit.oohtml.configs[ _name ] = {} );\n // ---------------------\n _merge( 2, window.webqit.oohtml.configs[ _name ], $defaults, $config, realdom.meta( name ).json() );\n // ---------------------\n return { config: window.webqit.oohtml.configs[ _name ], realdom, window };\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};", "\nexport default function() {\n const window = this;\n return class ContextRequestEvent extends window.Event {\n\n /**\n * @constructor\n */\n constructor( request, callback, { type = 'contextrequest', ...options } = {} ) {\n super( type, options );\n Object.defineProperty( this, 'request', { get: () => request } );\n Object.defineProperty( this, 'callback', { get: () => callback } );\n }\n\n /**\n * @respondWith\n */\n respondWith( response, ...rest ) {\n if ( this.request.diff ) {\n if ( 'previousValue' in this && this.previousValue === response ) return;\n this.previousValue = response;\n }\n return this.callback( response, ...rest );\n }\n };\n}", "\n/**\n * @imports\n */\nimport _ContextRequestEvent from './_ContextRequestEvent.js';\nimport { _ } from '../util.js';\n\nexport default class HTMLContext {\n\n /**\n * @instance\n */\n static instance( host ) {\n return _( host ).get( 'context::instance' ) || new this( host );;\n }\n\n /**\n * @constructor\n */\n constructor( host ) {\n _( host ).get( `context::instance` )?.dispose();\n _( host ).set( `context::instance`, this );\n const priv = { host, contexts: new Set };\n Object.defineProperty( this, '#', { get: () => priv } );\n const ContextRequestEvent = _ContextRequestEvent.call( host.ownerDocument?.defaultView || host.defaultView );\n Object.defineProperty( this, 'ContextRequestEvent', { get: () => ContextRequestEvent } );\n this[ Symbol.iterator ] = function*() {\n const it = priv.contexts[ Symbol.iterator ]();\n yield it.next().value;\n }\n }\n\n /**\n * @length()\n */\n get length() {\n this[ '#' ].contexts.size;\n }\n\n /**\n * @find()\n */\n findProvider( callback ) {\n return [ ...this[ '#' ].contexts ].find( callback );\n }\n\n /**\n * @attachProvider()\n */\n attachProvider( context ) {\n this[ '#' ].contexts.add( context );\n context.initialize( this[ '#' ].host );\n }\n\n /**\n * @detachProvider()\n */\n detachProvider( context ) {\n context.dispose( this[ '#' ].host );\n this[ '#' ].contexts.delete( context );\n }\n\n /**\n * @request()\n */\n request( request, callback, options = {} ) {\n return this[ '#' ].host.dispatchEvent(\n new this.ContextRequestEvent( request, callback, { bubbles: true, ...options } )\n );\n }\n\n /**\n * @dispose()\n */\n dispose() {}\n\n}", "\n/**\n * @imports\n */\nimport { _compare } from '../util.js';\nimport HTMLContext from './HTMLContext.js';\n\nexport default class HTMLContextProvider {\n\n /**\n * @config\n */\n static get config() {\n return {};\n }\n\n /**\n * @attachTo\n */\n static attachTo( host, Id, multiple = false ) {\n let provider, contextMgr = HTMLContext.instance( host );\n if ( !multiple && ( provider = contextMgr.findProvider( cx => this.matchRequest( cx.id, Id, true ) ) ) ) return provider;\n return contextMgr.attachProvider( new this( Id ) );\n }\n\n /**\n * @detachFrom\n */\n static detachFrom( host, Id, multiple = false ) {\n let provider, contextMgr = HTMLContext.instance( host );\n for ( provider of contextMgr[ '#' ].contexts ) {\n if ( !this.matchRequest( provider.id, Id, true ) || ( typeof multiple === 'function' && !multiple( provider ) ) ) continue;\n contextMgr.detachProvider( provider );\n if ( typeof multiple !== 'function' && !multiple ) return provider;\n }\n }\n \n /**\n * @createId\n */\n static createId( host, fields = {} ) {\n const id = { ...fields };\n if ( id.contextName ) return id;\n if ( host.getAttribute && !( id.contextName = ( host.getAttribute( this.config.context.attr.contextname ) || '' ).trim() ) ) {\n delete id.contextName;\n } else if ( !host.ownerDocument ) {\n id.contextName = 'root';\n }\n return id;\n }\n \n /**\n * @createRequest\n */\n static createRequest( fields = {} ) {\n return { ...fields };\n }\n\n /**\n * @matchesRequest\n */\n static matchRequest( id, request, strict = false ) {\n if ( strict ) return _compare( id, request, 1, true );\n return request.type === id.type && !request.contextName || request.contextName === id.contextName;\n }\n\n /**\n * @constructor\n */\n constructor( id ) {\n Object.defineProperty( this, 'id', { get: () => id } );\n Object.defineProperty( this, 'subscriptions', { value: new Set } );\n }\n\n /**\n * @length()\n */\n get length() {\n this.subscriptions.size;\n }\n\n /**\n * @handle()\n */\n handle( event ) {}\n\n /**\n * @subscribe()\n */\n subscribe( event ) {\n this.subscriptions.add( event );\n if ( !event.request.signal ) return;\n event.request.signal.addEventListener( 'abort', () => {\n this.unsubscribe( event );\n } );\n }\n\n /**\n * @unsubscribe()\n */\n unsubscribe( event ) {\n this.subscriptions.delete( event );\n event.request.controller?.abort();\n }\n\n /**\n * @handleEvent()\n */\n handleEvent( event ) {\n if ( this.disposed || ( event.target === this.host && event.request?.superContextOnly )\n || !event.request || typeof event.callback !== 'function' || !this.constructor.matchRequest( this.id, event.request ) ) return;\n event.stopPropagation();\n if ( event.type === 'contextclaim' ) {\n const claims = new Set;\n this.subscriptions.forEach( subscriptionEvent => {\n if ( !event.target.contains( subscriptionEvent.request.superContextOnly ? subscriptionEvent.target.parentNode : subscriptionEvent.target ) \n || !this.constructor.matchRequest( event.request/*provider ID*/, subscriptionEvent.request/*request ID*/ ) ) return;\n this.subscriptions.delete( subscriptionEvent );\n claims.add( subscriptionEvent );\n } );\n event.respondWith( claims );\n } else if ( event.type === 'contextrequest' ) {\n if ( event.request.live ) { this.subscribe( event ); }\n 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 HTMLContext.instance( host ).request( { ...this.id, superContextOnly: true }, claims => claims.forEach( subscriptionEvent => {\n this.subscribe( subscriptionEvent );\n this.handle( subscriptionEvent );\n } ), { type: 'contextclaim' } );\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.unsubscribe( subscriptionEvent );\n const { target, request, callback, options } = subscriptionEvent;\n HTMLContext.instance( target ).request( request, callback, options );\n } );\n return this;\n }\n\n}", "\n/**\n * @imports\n */\nimport Observer from '@webqit/observer';\nimport { _isNumeric } from '@webqit/util/js/index.js';\nimport { getModulesObject } from './index.js';\nimport { _ } from '../util.js';\n\nexport default class _HTMLExportsManager {\n\n /**\n * @instance\n */\n static instance( window, host, config ) {\n return _( host ).get( 'exportsmanager::instance' ) || new this( window, host, config );\n }\n\n /**\n * @constructor\n */\n constructor( window, host, config = {}, parent = null, level = 0 ) {\n _( host ).get( `exportsmanager::instance` )?.dispose();\n _( host ).set( `exportsmanager::instance`, this );\n this.host = host;\n this.window = window;\n this.config = config;\n this.parent = parent;\n this.level = level;\n this.modules = getModulesObject( this.host );\n this.exportId = ( this.host.getAttribute( this.config.template?.attr.moduledef ) || '' ).trim();\n this.validateExportId( this.exportId );\n const realdom = this.window.webqit.realdom;\n // ----------\n this.realtimeA = realdom.realtime( this.host.content ).children( record => {\n this.export( record.entrants, true );\n this.export( 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 exportId\n *\n * @returns Void\n */\n validateExportId( exportId ) {\n if ( [ '@', '/', '*', '#' ].some( token => exportId.includes( token ) ) ) {\n throw new Error( `The export ID \"${ exportId }\" contains an invalid character.` );\n }\n }\n\n /**\n * Maps module contents as exports.\n * \n * @param Array entries\n * @param Bool isConnected\n *\n * @returns Void\n */\n export( entries, isConnected ) {\n let dirty, allFragments = Observer.get( this.modules, '#' ) || [];\n Observer.batch( this.modules, () => {\n entries.forEach( entry => {\n if ( entry.nodeType !== 1 ) return;\n const isTemplate = entry.matches( this.config.templateSelector );\n const exportId = ( entry.getAttribute( isTemplate ? this.config.template.attr.moduledef : this.config.template.attr.fragmentdef ) || '' ).trim();\n if ( isConnected ) {\n if ( isTemplate && exportId ) { new _HTMLExportsManager( this.window, entry, this.config, this.host, this.level + 1 ); }\n else {\n allFragments.push( entry );\n dirty = true;\n }\n if ( exportId ) {\n this.validateExportId( exportId );\n Observer.set( this.modules, ( !isTemplate && '#' || '' ) + exportId, entry );\n }\n } else {\n if ( isTemplate && exportId ) { _HTMLExportsManager.instance( this.window, entry ).dispose(); }\n else {\n allFragments = allFragments.filter( x => x !== entry );\n dirty = true;\n }\n if ( exportId ) Observer.deleteProperty( this.modules, ( !isTemplate && '#' || '' ) + exportId );\n }\n } );\n if ( dirty ) Observer.set( this.modules, '#', allFragments );\n } );\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 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.modules, '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 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 // The promise\n const controller = new AbortController();\n const fire = ( type, detail ) => this.host.dispatchEvent( new this.window.CustomEvent( type, { detail } ) );\n const request = this.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 let extendedId = ( this.host.getAttribute( this.config.template.attr.extends ) || '' ).trim();\n let inheritedIds = ( this.host.getAttribute( this.config.template.attr.inherits ) || '' ).trim();\n const handleInherited = records => {\n records.forEach( record => {\n if ( Observer.get( this.modules, record.key ) !== record.oldValue ) return;\n if ( [ 'get'/*initial get*/, 'set', 'defineProperty' ].includes( record.type ) ) {\n Observer[ record.type.replace( 'get', 'set' ) ]( this.modules, record.key, record.value );\n } else if ( record.type === 'deleteProperty' ) {\n Observer.deleteProperty( this.modules, record.key );\n }\n } );\n };\n const realtimes = [];\n const parentExportsObj = getModulesObject( this.parent );\n if ( extendedId ) {\n realtimes.push( Observer.reduce( parentExportsObj, [ extendedId, this.config.template.api.modules, Infinity ], Observer.get, handleInherited, { live: true } ) );\n }\n if ( ( inheritedIds = inheritedIds.split( ' ' ).map( id => id.trim() ).filter( x => x ) ).length ) {\n realtimes.push( Observer.get( parentExportsObj, 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.abort() );\n Object.entries( this.modules ).forEach( ( [ key, entry ] ) => {\n if ( key.startsWith( '#' ) ) return;\n _HTMLExportsManager.instance( this.window, entry ).dispose();\n } );\n }\n}\n", "\n/**\n * @imports\n */\nimport Observer from '@webqit/observer';\nimport { HTMLContext, HTMLContextProvider } from '../context-api/index.js';\nimport { getModulesObject } from './index.js';\nimport { _ } from '../util.js';\n\nexport default class _HTMLImportsProvider extends HTMLContextProvider {\n\n /**\n * @createId\n */\n static createId( host, fields = {} ) {\n if ( !( 'type' in fields ) ) fields = { type: 'htmlimports', ...fields };\n return super.createId( host, fields );\n }\n\n /**\n * @createRequest\n */\n static createRequest( fields = {} ) {\n const request = { type: 'htmlimports', ...fields };\n if ( !request.contextName && request.detail?.startsWith( '/' ) ) { request.contextName = 'root'; }\n else if ( request.detail?.startsWith( '@' ) ) {\n const [ contextName, ...detail ] = request.detail.slice( 1 ).split( /(?<=\\w)(?=\\/|#)/ ).map( s => s.trim() );\n request.contextName = contextName;\n request.detail = detail.join( '' );\n }\n return request;\n }\n \n /**\n * @localModules\n */\n get localModules() {\n return getModulesObject( this.host );\n }\n\n /**\n * @handle()\n */\n handle( event ) {\n // Any existing event.request.controller? Abort!\n event.request.controller?.abort();\n\n // Parse and translate detail\n if ( ( event.request.detail || '' ).trim() === '/' ) return event.respondWith( this.localModules );\n const $config = this.constructor.config;\n let path = ( event.request.detail || '' ).split( /\\/|(?<=\\w)(?=#)/g ).map( x => x.trim() ).filter( x => x );\n if ( path.length ) { path = path.join( `/${ $config.template.api.modules }/` )?.split( '/' ) || []; }\n // No detail?\n if ( !path.length ) return event.respondWith();\n \n // We'll now fulfill request\n const options = { live: event.request.live, descripted: true };\n // Find a way to resolve request against two sources\n event.request.controller = Observer.reduce( this.localModules, path, Observer.get, ( result, { signal } = {} ) => {\n const _result = Array.isArray( result ) ? result : result.value;\n const _isValidResult = Array.isArray( result ) ? result.length : result.value;\n if ( !_isValidResult && this.host.isConnected === false ) return; // Subtree is being disposed\n if ( _isValidResult || !this.contextModules ) return event.respondWith( _result );\n // This superModules binding is automatically aborted by the injected control.signal; see below\n return Observer.reduce( this.contextModules, path, Observer.get, result => {\n return event.respondWith( Array.isArray( result ) ? result : result.value );\n }, { signal, ...options } );\n }, options );\n }\n\n /**\n * @startRealtime()\n */\n realtimeSources( host ) {\n this.host = host;\n // ----------------\n const update = () => {\n for ( const subscriptionEvent of this.subscriptions ) {\n this.handle( subscriptionEvent );\n }\n };\n // ----------------\n const $config = this.constructor.config;\n if ( !this.host.matches || !$config.context.attr.importscontext ) return;\n // Any existing this.refdSourceController? Abort!\n this.refdSourceController?.disconnect();\n const realdom = this.host.ownerDocument.defaultView.webqit.realdom;\n this.refdSourceController = realdom.realtime( this.host ).attr( $config.context.attr.importscontext, ( record, { signal } ) => {\n // No importscontext attr set. But we're still watching\n if ( !record.value ) {\n this.contextModules = undefined;\n return update();\n }\n // This superModules contextrequest is automatically aborted by the injected signal below\n const request = this.constructor.createRequest( { detail: record.value.trim(), live: true, signal, superContextOnly: true } );\n HTMLContext.instance( this.host ).request( request, response => {\n this.contextModules = !( response && Object.getPrototypeOf( response ) ) ? response : getModulesObject( response );\n update();\n } );\n }, { live: true, timing: 'sync', lifecycleSignals: true } );\n }\n\n /**\n * @initialize()\n */\n initialize( host ) {\n // If host has importscontext attr, compute that\n this.realtimeSources( host );\n // Now, listen for contextrequest and contextclaim events\n // And process own claim\n return super.initialize( host );\n }\n \n /**\n * @dispose()\n */\n dispose( host ) {\n // Stop listening for sources\n this.refdSourceController?.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 { HTMLContext } from '../context-api/index.js';\nimport _HTMLImportsContext from './_HTMLImportsProvider.js';\nimport { _ } from '../util.js';\n\n/**\n * Creates the HTMLImportElement class.\n * \n * @param Object config \n * \n * @return HTMLImportElement\n */\nexport default function( config ) {\n const window = this, { realdom } = window.webqit;\n const BaseElement = config.import.tagName.includes( '-' ) ? window.HTMLElement : class {};\n return class HTMLImportElement extends BaseElement {\n \n /**\n * @instance\n * \n * @param HTMLElement node\n * \n * @returns \n */\n static instance( node ) {\n if ( config.import.tagName.includes( '-' ) && ( node instanceof this ) ) return node;\n return _( 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 _( 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 _( anchorNode ).set( 'anchoredNode@imports', this.el );\n };\n\n priv.importRequest = ( callback, signal = null ) => {\n const request = _HTMLImportsContext.createRequest( { detail: priv.moduleRef && !priv.moduleRef.includes( '#' ) ? priv.moduleRef + '#' : priv.moduleRef, live: signal && true, signal } );\n HTMLContext.instance( this.el.isConnected ? this.el.parentNode : priv.anchorNode.parentNode ).request( request, response => {\n callback( ( response instanceof window.HTMLTemplateElement ? [ ...response.content.children ] : (\n Array.isArray( response ) ? response : response && [ response ]\n ) ) || [] );\n } );\n };\n\n priv.hydrate = ( anchorNode, slottedElements ) => {\n // ----------------\n priv.moduleRef = ( this.el.getAttribute( config.import.attr.moduleref ) || '' ).trim();\n priv.setAnchorNode( anchorNode );\n priv.autoRestore( () => {\n slottedElements.forEach( slottedElement => {\n priv.slottedElements.add( slottedElement );\n _( slottedElement ).set( 'slot@imports', this.el );\n } );\n } );\n // ----------------\n priv.hydrationImportRequest = new AbortController;\n priv.importRequest( fragments => {\n if ( priv.originalsRemapped ) { return this.fill( fragments ); }\n const identifiersMap = fragments.map( fragment => ( { el: fragment, fragmentDef: fragment.getAttribute( config.template.attr.fragmentdef ) || '', tagName: fragment.tagName, } ) );\n slottedElements.forEach( slottedElement => {\n const tagName = slottedElement.tagName, fragmentDef = slottedElement.getAttribute( config.template.attr.fragmentdef ) || '';\n const originalsMatch = identifiersMap.filter( fragmentIdentifiers => tagName === fragmentIdentifiers.tagName && fragmentDef === fragmentIdentifiers.fragmentDef );\n if ( originalsMatch.length !== 1 ) return;\n _( slottedElement ).set( 'original@imports', originalsMatch[ 0 ].el );\n } );\n priv.originalsRemapped = true;\n }, priv.hydrationImportRequest.signal );\n };\n\n priv.autoRestore = ( callback = null ) => {\n priv.autoRestoreRealtime?.disconnect();\n if ( callback ) callback();\n if ( !priv.slottedElements.size ) {\n priv.anchorNode.replaceWith( this.el );\n return;\n }\n const autoRestoreRealtime = realdom.realtime( window.document ).observe( [ ...priv.slottedElements ], record => {\n record.exits.forEach( outgoingNode => {\n _( 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 priv.anchorNode.replaceWith( this.el );\n }\n }, { subtree: true, timing: 'sync', generation: 'exits' } );\n priv.autoRestoreRealtime = autoRestoreRealtime;\n };\n\n priv.connectedCallback = () => {\n // In case this is DOM node relocation or induced reinsertion into the DOM\n if ( priv.slottedElements.size ) throw new Error( `Illegal reinsertion into the DOM; import slot is not empty!` );\n // Totally initialize this instance?\n if ( !priv.anchorNode ) { priv.setAnchorNode( this.createAnchorNode() ); }\n if ( priv.moduleRefRealtime ) return;\n priv.moduleRefRealtime = realdom.realtime( this.el ).attr( config.import.attr.moduleref, ( record, { signal } ) => {\n priv.moduleRef = record.value;\n // Below, we ignore first restore from hydration\n priv.importRequest( fragments => !priv.hydrationImportRequest && this.fill( fragments ), signal );\n }, { live: true, timing: 'sync', lifecycleSignals: true } );\n // Must come after\n priv.hydrationImportRequest?.abort();\n priv.hydrationImportRequest = null;\n };\n\n priv.disconnectedCallback = () => {\n priv.hydrationImportRequest?.abort();\n priv.hydrationImportRequest = null;\n if ( priv.anchorNode.isConnected ) return;\n priv.moduleRefRealtime?.disconnect();\n priv.moduleRefRealtime = null;\n };\n }\n\n /**\n * Creates the slot's anchor node.\n *\n * @return Element\n */\n createAnchorNode() {\n if ( !config.isomorphic ) { return window.document.createTextNode( '' ) }\n return window.document.createComment( this.el.outerHTML );\n }\n\n /**\n * Fills the slot with slottableElements\n *\n * @param Iterable slottableElements\n *\n * @return void\n */\n fill( slottableElements ) {\n if ( Array.isArray( slottableElements ) ) { slottableElements = new Set( slottableElements ) }\n this[ '#' ].autoRestore( () => { \n this[ '#' ].slottedElements.forEach( slottedElement => {\n const slottedElementOriginal = _( 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 ( this.el.isConnected && slottableElements.size ) {\n this.el.replaceWith( this[ '#' ].anchorNode );\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( config.template.attr.fragmentdef ) ) {\n slottableElementClone.toggleAttribute( config.template.attr.fragmentdef, true );\n }\n _( slottableElementClone ).set( 'original@imports', slottableElement );\n _( 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}", "\n/**\n * @imports\n */\nimport Observer from '@webqit/observer';\nimport { HTMLContext } from '../context-api/index.js';\nimport _HTMLExportsManager from './_HTMLExportsManager.js';\nimport _HTMLImportElement from './_HTMLImportElement.js';\nimport _HTMLImportsProvider from './_HTMLImportsProvider.js';\nimport { _, _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, realdom, window } = _init.call( this, 'html-imports', $config, {\n template: { attr: { moduledef: 'def', fragmentdef: 'def', extends: 'extends', inherits: 'inherits' }, api: { modules: 'modules', moduledef: 'def' }, },\n context: { attr: { importscontext: 'importscontext', contextname: 'contextname' }, api: { import: 'import' }, },\n import: { tagName: 'import', attr: { moduleref: 'ref' }, },\n staticsensitivity: true,\n isomorphic: true,\n } );\n config.templateSelector = `template[${ window.CSS.escape( config.template.attr.moduledef ) }]`;\n config.ownerContextSelector = [ config.context.attr.contextname, config.context.attr.importscontext ].map( a => `[${ window.CSS.escape( a ) }]` ).join( ',' );\n config.slottedElementsSelector = `[${ window.CSS.escape( config.template.attr.fragmentdef ) }]`;\n window.webqit.HTMLImportElement = _HTMLImportElement.call( window, config );\n window.webqit.HTMLImportsProvider = class extends _HTMLImportsProvider {\n static get config() { return config; }\n };\n window.webqit.Observer = Observer;\n exposeModulesObjects.call( window, config );\n realdom.ready( () => hydration.call( window, config ) );\n realtime.call( window, config );\n}\n\nexport { Observer }\n\n/**\n * Returns the \"exports\" object associated with the given node.\n *\n * @param Element node\n * @param Bool autoCreate\n *\n * @return Object\n */\nexport function getModulesObject( node, autoCreate = true ) {\n\tif ( !_( node ).has( 'modules' ) && autoCreate ) {\n\t\tconst modulesObj = Object.create( null );\n\t\t_( node ).set( 'modules', modulesObj );\n\t}\n\treturn _( node ).get( 'modules' );\n}\n\n/**\n * Exposes HTML Modules with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeModulesObjects( config ) {\n const window = this;\n // Assertions\n if ( config.template.api.modules in window.HTMLTemplateElement.prototype ) { throw new Error( `The \"HTMLTemplateElement\" class already has a \"${ config.template.api.modules }\" property!` ); }\n if ( config.template.api.moduledef in window.HTMLTemplateElement.prototype ) { throw new Error( `The \"HTMLTemplateElement\" class already has a \"${ config.template.api.moduledef }\" property!` ); }\n if ( config.context.api.import in window.document ) { throw new Error( `document already has a \"${ config.context.api.import }\" property!` ); }\n if ( config.context.api.import in window.HTMLElement.prototype ) { throw new Error( `The \"HTMLElement\" class already has a \"${ config.context.api.import }\" property!` ); }\n // Definitions\n Object.defineProperty( window.HTMLTemplateElement.prototype, config.template.api.modules, { get: function() {\n return getModulesObject( this );\n } } );\n Object.defineProperty( window.HTMLTemplateElement.prototype, config.template.api.moduledef, { get: function() {\n return this.getAttribute( config.template.attr.moduledef );\n } } );\n Object.defineProperty( window.document, config.context.api.import, { value: function( ref, callback, options = {} ) {\n return importRequest( window.document, ref, callback, options );\n } } );\n Object.defineProperty( window.HTMLElement.prototype, config.context.api.import, { value: function( ref, callback, options = {} ) {\n return importRequest( this, ref, callback, options );\n } } );\n function importRequest( context, ref, callback, options ) {\n const request = _HTMLImportsProvider.createRequest( { detail: ref, ...options } );\n return HTMLContext.instance( context ).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, { realdom, HTMLImportElement, HTMLImportsProvider } = window.webqit;\n // ------------\n // MODULES\n // ------------\n const attachImportsContext = host => {\n const contextId = HTMLImportsProvider.createId( host );\n HTMLImportsProvider.attachTo( host, contextId );\n };\n const detachImportsContext = ( host, force ) => {\n const contextId = HTMLImportsProvider.createId( host );\n HTMLImportsProvider.detachFrom( host, contextId, cx => {\n return force || host.matches && !host.matches( config.ownerContextSelector ) && !Object.keys( cx.localModules ).length;\n } );\n };\n // ------------\n realdom.realtime( window.document ).subtree/*instead of observe(); reason: jsdom timing*/( [ config.templateSelector, config.ownerContextSelector ], record => {\n record.entrants.forEach( entry => {\n if ( entry.matches( config.templateSelector ) ) {\n Object.defineProperty( entry, 'scoped', { value: entry.hasAttribute( 'scoped' ) } ); \n const moduleExport = new _HTMLExportsManager( window, entry, config );\n moduleExport.ownerContext = entry.scoped ? record.target : window.document;\n const ownerContextModulesObj = getModulesObject( moduleExport.ownerContext );\n if ( moduleExport.exportId ) { Observer.set( ownerContextModulesObj, moduleExport.exportId, entry ); }\n // The ownerContext's modulesObj - 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( moduleExport.ownerContext );\n } else {\n attachImportsContext( entry );\n }\n } );\n record.exits.forEach( entry => {\n if ( entry.matches( config.templateSelector ) ) {\n const moduleExport = _HTMLExportsManager.instance( window, entry, config );\n const ownerContextModulesObj = getModulesObject( moduleExport.ownerContext );\n if ( moduleExport.exportId ) { Observer.deleteProperty( ownerContextModulesObj, moduleExport.exportId ); }\n detachImportsContext( moduleExport.ownerContext );\n } else {\n detachImportsContext( entry, true );\n }\n } );\n }, { live: true, timing: 'sync', staticSensitivity: config.staticsensitivity } );\n // ------------\n // IMPORTS\n // ------------\n realdom.realtime( window.document ).subtree/*instead of observe(); reason: jsdom timing*/( config.import.tagName, record => {\n record.entrants.forEach( node => handleRealtime( node, true, record ) );\n record.exits.forEach( node => handleRealtime( node, false, record ) );\n }, { live: true, timing: 'sync' } );\n function handleRealtime( entry, connectedState, record ) {\n const elInstance = HTMLImportElement.instance( entry );\n if ( connectedState ) { elInstance[ '#' ].connectedCallback(); }\n else { elInstance[ '#' ].disconnectedCallback(); }\n }\n}\n\n/**\n * Performs hydration for server-slotted elements.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction hydration( config ) {\n const window = this, { HTMLImportElement } = window.webqit;\n function scan( context ) {\n const slottedElements = new Set;\n context.childNodes.forEach( node => {\n if ( node.nodeType === 1/** ELEMENT_NODE */ ) {\n if ( !node.matches( config.slottedElementsSelector ) ) return;\n if ( _( node ).get( 'slot@imports' ) ) return;\n slottedElements.add( node );\n } else if ( node.nodeType === 8/** COMMENT_NODE */ ) {\n const nodeValue = node.nodeValue.trim();\n if ( !nodeValue.startsWith( '<' + config.import.tagName ) ) return;\n if ( !nodeValue.endsWith( '</' + config.import.tagName + '>' ) ) return;\n const reviver = window.document.createElement( 'div' );\n reviver.innerHTML = nodeValue;\n const importEl = reviver.firstChild;\n if ( !importEl.matches( config.import.tagName ) ) return;\n HTMLImportElement.instance( importEl )[ '#' ].hydrate(\n node/* the comment node */, slottedElements\n );\n slottedElements.clear();\n }\n } );\n }\n Array.from( window.document.querySelectorAll( config.slottedElementsSelector ) ).forEach( slottedElement => {\n // hydration() might be running AFTER certain <slots> have resolved\n // and slottedElement might be a just-resolved node\n if ( _( slottedElement ).get( 'slot@imports' ) ) return;\n if ( _( slottedElement.parentNode ).get( 'alreadyscanned@imports' ) ) return;\n scan( slottedElement.parentNode );\n // Scanning is once for every parent\n _( slottedElement.parentNode ).set( 'alreadyscanned@imports', true );\n } );\n}\n", "\n/**\n * @imports\n */\nimport init from './index.js';\n\n/**\n * @init\n */\ninit.call( window );"],
|
|
5
|
-
"mappings": "mGAAA,6ZCQe,WAAS,EAAK,CAC5B,MAAO,CAAC,MAAM,QAAQ,CAAG,GAAK,MAAO,IAAQ,UAAY,CAC1D,CCFe,WAAS,EAAK,CAC5B,MAAO,OAAO,EACf,CCFe,WAAS,EAAK,CAC5B,MAAO,OAAM,QAAQ,CAAG,CACzB,CCMe,YAAS,EAAK,EAAM,EAAW,KAAM,CACnD,MAAO,AAAC,GAAS,CAAI,EAAS,EAAI,OAAO,GAAQ,EAC9C,EAAK,OAAO,GAAQ,EAAS,EAAM,CAAI,CAAC,EAAE,OAC1C,EAAK,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BAAsB,EAAO,OACpD,WAAe,EAAU,CACrB,GAAM,GAAkB,GAAI,KAC5B,EAAQ,WAAW,QAAS,GAAQ,CAChC,GAAK,EAAK,WAAa,EAAuB,CAE1C,GADK,CAAC,EAAK,QAAS,EAAO,uBAAwB,GAC9C,EAAG,CAAK,EAAE,IAAK,cAAe,EAAI,OACvC,EAAgB,IAAK,CAAK,CAC9B,SAAY,EAAK,WAAa,EAAuB,CACjD,GAAM,GAAY,EAAK,UAAU,KAAK,EAEtC,GADK,CAAC,EAAU,WAAY,IAAM,EAAO,OAAO,OAAQ,GACnD,CAAC,EAAU,SAAU,KAAO,EAAO,OAAO,QAAU,GAAI,EAAI,OACjE,GAAM,GAAU,EAAO,SAAS,cAAe,KAAM,EACrD,EAAQ,UAAY,EACpB,GAAM,GAAW,EAAQ,WACzB,GAAK,CAAC,EAAS,QAAS,EAAO,OAAO,OAAQ,EAAI,OAClD,EAAkB,SAAU,CAAS,EAAG,KAAM,QAC1C,EAA4B,CAChC,EACA,EAAgB,MAAM,CAC1B,CACJ,CAAE,CACN,CACA,MAAM,KAAM,EAAO,SAAS,iBAAkB,EAAO,uBAAwB,CAAE,EAAE,QAAS,GAAkB,CAGxG,AAAK,EAAG,CAAe,EAAE,IAAK,cAAe,GACxC,EAAG,EAAe,UAAW,EAAE,IAAK,wBAAyB,GAClE,GAAM,EAAe,UAAW,EAEhC,EAAG,EAAe,UAAW,EAAE,IAAK,yBAA0B,EAAK,EACvE,CAAE,CACN,CC1LA,GAAK,KAAM,MAAO",
|
|
4
|
+
"sourcesContent": ["\n/**\n * @imports\n */\nimport { _isObject, _isTypeObject, _isFunction, _getType } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport ListenerRegistry from './core/ListenerRegistry.js';\nimport TrapsRegistry from './core/TrapsRegistry.js';\nimport Descriptor from './core/Descriptor.js';\nimport { unproxy } from './actors.js';\nimport { _, _await } from './util.js';\n\n/* ---------------SPECIAL APIs--------------- */\n\n/**\n * Creates a Path array instance from arguments.\n * \n * @param Array\t ...segments\n *\n * @return Path\n */\nclass Path extends Array {}\nexport function path( ...segments ) {\n return new Path( ...segments );\n}\n\n/**\n * Reduces a path array against handler.\n * \n * @param Array|Object\t target\n * @param Array\t path\n * @param Function\t receiver\n * @param Function\t final\n * @param Object\t params\n * \n * @example reduce( object, [ segement1, segement2 ], observe, ( value, flags ) => {}, params );\n *\n * @return Any\n */\nexport function reduce( target, path, receiver, final = x => x, params = {} ) {\n if ( !path.length ) return;\n return ( function eat( target, path, $params ) {\n const segment = path[ $params.level ];\n const isLastSegment = $params.level === path.length - 1;\n if ( target instanceof Descriptor && target.type !== 'get' ) {\n // Always probe event-generated trees\n $params = { ...$params, probe: 'always' };\n } else if ( $params.probe !== 'always' ) {\n // Probe until (before) last segment\n $params = { ...$params, probe: !isLastSegment };\n }\n // ---------------\n return receiver( target, segment, ( result, ...args ) => {\n // -----------\n const addTrail = desc => {\n if ( !( desc instanceof Descriptor ) ) return;\n desc.path = [ desc.key ];\n if ( target instanceof Descriptor ) {\n desc.path = target.path.concat( desc.key );\n Object.defineProperty( desc, 'context', { get: () => target, configurable: true } );\n }\n };\n const advance = result => {\n const $value = resolveObj( result/* a Descriptor who's value could be proxied */, false );\n return _await( $value/* could be a promise */, $value => {\n if ( result instanceof Descriptor ) {\n result.value = $value; // Update to (fulfilled), unproxied, value\n } else {\n result = $value;\n }\n const flags = args[ 0 ] || {};\n return eat( result, path, { ...$params, ...flags, level: $params.level + 1, } );\n } );\n };\n // -----------\n if ( isPropsList( segment ) && Array.isArray( result ) ) {\n result.forEach( addTrail );\n if ( isLastSegment ) return final( result, ...args );\n return result.map( advance );\n }\n // -----------\n addTrail( result );\n if ( isLastSegment ) return final( result, ...args );\n return advance( result );\n // -----------\n }, $params );\n } )( target, path.slice( 0 ), { ...params, level: 0 } );\n}\n\n/**\n * Adds an observer to a target's registry.\n *\n * @param Array|Object\t target\n * @param String|Object\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return AbortController\n */\nexport function observe( target, prop, receiver, params = {} ) {\n // ---------------\n target = resolveObj( target, !params.level );\n\tif ( _isFunction( arguments[ 1 ] ) ) {\n [ , receiver, params = {} ] = arguments;\n prop = Infinity;\n\t}\n\tif ( !_isFunction( receiver ) ) throw new Error( `Handler must be a function; \"${ _getType( receiver ) }\" given!` );\n if ( prop instanceof Path ) return reduce( target, prop, observe, receiver, params );\n // ---------------\n params = { ...params, descripted: true };\n delete params.live;\n if ( !_isTypeObject( target ) ) return params.probe && get( target, prop, receiver, params );\n // ---------------\n const emit = bind( target, prop, receiver, params );\n if ( params.probe ) {\n return get( target, prop, emit, params );\n }\n return emit();\n}\n\n/**\n * Adds an interceptor object to a target's registry.\n *\n * @param Array|Object\t target\n * @param Object\t traps\n * @param Object\t\t params\n *\n * @return AbortRegistry\n */\nexport function intercept( target, traps, params = {} ) {\n // ---------------\n target = resolveObj( target );\n if ( !_isObject( traps ) ) {\n [ /*target*/, /*type*/, /*handler*/, params = {} ] = arguments;\n traps = { [ arguments[ 1 ] ]: arguments[ 2 ] };\n }\n // ---------------\n return TrapsRegistry.getInstance( target, true, params.namespace ).addRegistration( { traps, params } );\n}\n\n/* ---------------QUERY APIs--------------- */\n\n/**\n * Performs a \"getOwnPropertyDescriptor\" operation.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getOwnPropertyDescriptor( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'getOwnPropertyDescriptor', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a \"getOwnPropertyDescriptors\" operation.\n * @note this isn't part of the standard Reflect API.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getOwnPropertyDescriptors( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'getOwnPropertyDescriptors', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a \"getPrototypeOf\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function getPrototypeOf( target, receiver = x => x, params = {} ) {\n return exec( target, 'getPrototypeOf', {}, receiver, params );\n}\n\n/**\n * Performs a \"isExtensible\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function isExtensible( target, receiver = x => x, params = {} ) {\n return exec( target, 'isExtensible', {}, receiver, params );\n}\n\n/**\n * Performs a \"ownKeys\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function ownKeys( target, receiver = x => x, params = {} ) {\n return exec( target, 'ownKeys', {}, receiver, params );\n}\n\n/**\n * Performs an operation of the given \"type\".\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function has( target, prop, receiver = x => x, params = {} ) {\n return exec( target, 'has', { key: prop }, receiver, params );\n}\n\n/**\n * Performs a get operation.\n *\n * @param Array|Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function get( target, prop, receiver = x => x, params = {} ) {\n // ---------------\n let isLive;\n target = resolveObj( target, !params.level );\n if ( _isObject( receiver ) ) { [ params, receiver ] = [ receiver, x => x ]; }\n else if ( params.live ) { isLive = true; }\n if ( prop instanceof Path ) return reduce( target, prop, get, receiver, params );\n // ---------------\n return resolveProps( target, prop, props => {\n const related = [ ...props ];\n return ( function next( results, _props, _done ) {\n if ( !_props.length ) return _done( results );\n const prop = _props.shift();\n if ( ![ 'string', 'number', 'symbol' ].includes( typeof prop ) ) {\n throw new Error( `Property name/key ${ prop } invalid.` );\n }\n // ---------\n function defaultGet( descriptor, value = undefined ) {\n const _next = value => ( descriptor.value = value, next( [ ...results, params.live || params.descripted ? descriptor : value ]/** not using concat() as value may be an array */, _props, _done ) );\n if ( arguments.length > 1 ) return _next( value );\n const accessorizedProps = _( target, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key + '' );\n if ( accessorization && accessorization.intact() ) {\n return _next( accessorization.getValue() );\n }\n return _next( Reflect.get( target, descriptor.key, ...( params.receiver ? [ params.receiver ] : [] ) ) );\n }\n // ---------\n const descriptor = new Descriptor( target, {\n type: 'get',\n key: prop,\n value: undefined,\n related,\n } );\n if ( !_isTypeObject( target ) ) return next( [ ...results, params.live || params.descripted ? descriptor : undefined ], _props, _done );\n const listenerRegistry = TrapsRegistry.getInstance( target, false, params.namespace );\n if ( listenerRegistry ) {\n return listenerRegistry.emit( descriptor, defaultGet );\n }\n return defaultGet( descriptor );\n } )( [], props.slice( 0 ), results => {\n const result_s = isPropsList( prop/*original*/ ) ? results : results[ 0 ];\n if ( isLive && _isTypeObject( target ) ) {\n const emit = bind( target, prop, receiver, params );\n return emit( result_s );\n }\n return receiver( result_s );\n } );\n }, params );\n}\n\n/* ---------------MUTATION APIs--------------- */\n\n/**\n * Performs a batch operation.\n * \n * @param Object\t target\n * @param Function\t callback\n * @param Object\t params\n *\n * @return Void\n */\nexport function batch( target, callback, params = {} ) {\n target = resolveObj( target );\n return ListenerRegistry.getInstance( target, true, params.namespace ).batch( callback );\n}\n\n/**\n * Performs a set operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Any\t value\n * @param Function\t receiver\n * @param Object\t params\n * @param Bool\t def\n *\n * @return Any\n */\nexport function set( target, prop, value, receiver = x => x, params = {}, def = false ) {\n // ---------------\n target = resolveObj( target );\n let entries = [ [ prop, value ] ];\n if ( _isObject( prop ) ) {\n [ /*target*/, /*hash*/, receiver = x => x, params = {}, def = false ] = arguments;\n entries = Object.entries( prop );\n }\n if ( _isObject( receiver ) ) { [ def, params, receiver ] = [ typeof params === 'boolean' ? params : false, receiver, x => x ]; }\n // ---------------\n const related = entries.map( ( [ prop ] ) => prop );\n return ( function next( descriptors, entries, _done ) {\n if ( !entries.length ) return _done( descriptors );\n const [ prop, value ] = entries.shift();\n // ---------\n function defaultSet( descriptor, status = undefined ) {\n const _next = status => ( descriptor.status = status, next( descriptors.concat( descriptor ), entries, _done ) );\n if ( arguments.length > 1 ) return _next( descriptor, status );\n const accessorizedProps = _( target, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key + '' );\n if ( descriptor.type === 'defineProperty' ) {\n if ( accessorization && !accessorization.restore() ) _next( false );\n Object.defineProperty( target, descriptor.key, descriptor.value );\n return _next( true );\n }\n if ( accessorization && accessorization.intact() ) {\n return _next( accessorization.setValue( descriptor.value ) );\n }\n return _next( Reflect.set( target, descriptor.key, descriptor.value ) );\n }\n // ---------\n function exec( isUpdate, oldValue ) {\n if ( params.diff && value === oldValue ) return next( descriptors, entries, _done );\n const descriptor = new Descriptor( target, {\n type: def ? 'defineProperty' : 'set',\n key: prop,\n value,\n isUpdate,\n oldValue,\n related: [ ...related ],\n detail: params.detail,\n } );\n const listenerRegistry = TrapsRegistry.getInstance( target, false, params.namespace );\n return listenerRegistry \n ? listenerRegistry.emit( descriptor, defaultSet ) \n : defaultSet( descriptor );\n }\n // ---------\n return has( target, prop, exists => {\n if ( !exists ) return exec( exists );\n return get( target, prop, oldValue => exec( exists, oldValue ), params );\n }, params );\n // ---------\n } )( [], entries.slice( 0 ), descriptors => {\n const listenerRegistry = ListenerRegistry.getInstance( target, false, params.namespace );\n if ( listenerRegistry ) listenerRegistry.emit( descriptors );\n return receiver(\n isPropsList( prop/*original*/ ) ? descriptors.map( opr => opr.status ) : descriptors[ 0 ]?.status\n );\n } );\n}\n\n/**\n * Performs a defineProperty operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Object\t descriptor\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function defineProperty( target, prop, descriptor, receiver = x => x, params = {} ) {\n return set( target, prop, descriptor, receiver, params, true/*def*/ );\n}\n\n/**\n * Performs a defineProperties operation.\n * @note this isn't part of the standard Reflect API.\n * \n * @param Object\t target\n * @param Object\t descriptors\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function defineProperties( target, descriptors, receiver = x => x, params = {} ) {\n return set( target, descriptors, receiver, params, true/*def*/ );\n}\n\n/**\n * Performs a delete operation.\n * \n * @param Object\t target\n * @param String|Number\t prop\n * @param Function\t receiver\n * @param Object\t params\n *\n * @return Any\n */\nexport function deleteProperty( target, prop, receiver = x => x, params = {} ) {\n // ---------------\n target = resolveObj( target );\n if ( _isObject( receiver ) ) { [ params, receiver ] = [ receiver, x => x ]; }\n // ---------------\n const props = _arrFrom( prop, false ), related = [ ...props ];\n return ( function next( descriptors, props, _done ) {\n if ( !props.length ) return _done( descriptors );\n const prop = props.shift();\n // ---------\n function defaultDel( descriptor, status = undefined ) {\n const _next = status => ( descriptor.status = status, next( descriptors.concat( descriptor ), props, _done ) );\n if ( arguments.length > 1 ) return _next( descriptor, status );\n const accessorizedProps = _( target, 'accessorizedProps', false );\n const accessorization = accessorizedProps && accessorizedProps.get( descriptor.key + '' );\n if ( accessorization && !accessorization.restore() ) _next( false );\n return _next( Reflect.deleteProperty( target, descriptor.key ) );\n }\n // ---------\n function exec( oldValue ) {\n const descriptor = new Descriptor( target, {\n type: 'deleteProperty',\n key: prop,\n oldValue,\n related: [ ...related ],\n detail: params.detail,\n } );\n const listenerRegistry = TrapsRegistry.getInstance( target, false, params.namespace );\n return listenerRegistry \n ? listenerRegistry.emit( descriptor, defaultDel ) \n : defaultDel( descriptor );\n }\n // ---------\n return get( target, prop, exec, params );\n // ---------\n } )( [], props.slice( 0 ), descriptors => {\n const listenerRegistry = ListenerRegistry.getInstance( target, false, params.namespace );\n if ( listenerRegistry ) listenerRegistry.emit( descriptors );\n return receiver(\n isPropsList( prop/*original*/ ) ? descriptors.map( opr => opr.status ) : descriptors[ 0 ].status\n );\n } );\n}\n\n/**\n * @alias deleteProperty()\n */\nexport function deleteProperties( target, props, receiver = x => x, params = {} ) {\n return deleteProperty( ...arguments );\n}\n\n/* ---------------EFFECT APIs--------------- */\n\n/**\n * Performs a \"construct\" operation.\n *\n * @param Array|Object\t target\n * @param Array\t\t\t argumentsList\n * @param Object\t\t newTarget\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function construct( target, argumentsList, newTarget = null, receiver = x => x, params = {} ) {\n return exec( target, 'construct', arguments.length > 2 ? { argumentsList, newTarget } : { argumentsList }, receiver, params );\n}\n\n/**\n * Performs an \"apply\" operation.\n *\n * @param Array|Object\t target\n * @param Any\t thisArgument\n * @param Array\t argumentsList\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function apply( target, thisArgument, argumentsList, receiver = x => x, params = {} ) {\n return exec( target, 'apply', { thisArgument, argumentsList }, receiver, params );\n}\n\n/**\n * Performs a \"setPrototypeOf\" operation.\n *\n * @param Array|Object\t target\n * @param Anyr\t proto\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function setPrototypeOf( target, proto, receiver = x => x, params = {} ) {\n return exec( target, 'setPrototypeOf', { proto }, receiver, params );\n}\n\n/**\n * Performs a \"preventExtension\" operation.\n *\n * @param Array|Object\t target\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nexport function preventExtensions( target, receiver = x => x, params = {} ) {\n return exec( target, 'preventExtensions', {}, receiver, params );\n}\n\n/* ---------------HELPER APIs--------------- */\n\n/**\n * Adds an observer to a target's registry.\n *\n * @param Array|Object\t target\n * @param String|Object\t prop\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Function: AbortController\n */\nfunction bind( target, prop, receiver, params = {} ) {\n let controller;\n if ( !params.signal ) {\n controller = new AbortController;\n params = { ...params, signal: controller.signal };\n }\n const listenerRegistry = ListenerRegistry.getInstance( target, true, params.namespace );\n return function emit( descriptor_s, prevRegistration = null ) {\n prevRegistration?.remove();\n const registrationNext = listenerRegistry.addRegistration( prop, emit, params );\n const flags = { signal: registrationNext.signal, };\n if ( arguments.length ) {\n const handlerReturnValue = receiver( descriptor_s, flags );\n if ( arguments.length > 1 ) return handlerReturnValue;\n }\n return controller;\n };\n}\n\n/**\n * Performs an operation of the given \"type\".\n *\n * @param Array|Object\t target\n * @param String\t\t type\n * @param Object\t\t payload\n * @param Function\t receiver\n * @param Object\t\t params\n *\n * @return Any\n */\nfunction exec( target, type, payload = {}, receiver = x => x, params = {} ) {\n // ---------\n target = resolveObj( target );\n if ( _isObject( receiver ) ) { [ params, receiver ] = [ receiver, x => x ]; } \n // ---------\n function defaultExec( descriptor, result ) {\n if ( arguments.length > 1 ) return receiver( result );\n return receiver( Reflect[ type ]( target, ...Object.values( payload ) ) );\n }\n // ---------\n const descriptor = new Descriptor( target, { type, ...payload } );\n const listenerRegistry = TrapsRegistry.getInstance( target, false, params.namespace );\n if ( listenerRegistry ) {\n return listenerRegistry.emit( descriptor, defaultExec );\n }\n return defaultExec( descriptor );\n}\n\n// Asks if prop is a multi-result field\nfunction isPropsList( prop ) {\n return prop === Infinity || Array.isArray( prop );\n}\n\n// Resolves obj down to it's self\nfunction resolveObj( obj, assert = true ) {\n\tif ( ( !obj || !_isTypeObject( obj ) ) && assert ) throw new Error( `Object must be of type object or array! \"${ _getType( obj ) }\" given.` );\n if ( obj instanceof Descriptor ) {\n obj = obj.value;\n }\n\treturn obj && unproxy( obj );\n}\n\n// Resolves prop down to actual keys\nfunction resolveProps( obj, prop, receiver, params = {} ) {\n if ( prop === Infinity ) {\n if ( params.level && !_isTypeObject( obj ) ) return receiver( [] );\n return ownKeys( obj, receiver, params );\n }\n return receiver( _arrFrom( prop, false ) );\n}\n", "\r\n/**\r\n * Tells if val is pure object.\r\n *\r\n * @param object\t \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn !Array.isArray(val) && typeof val === 'object' && val;\r\n};\r\n", "\r\n/**\r\n * Returns the val's type.\r\n *\r\n * @param string \tval\r\n *\r\n * @return string\r\n */\r\nexport default function(val) {\r\n\treturn typeof val;\r\n};\r\n", "\r\n/**\r\n * Tells if val is of type \"array\".\r\n *\r\n * @param object\t \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn Array.isArray(val);\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isArray from '../js/isArray.js';\r\n\r\n/**\r\n * Returns the intersection of two arrays;\r\n * optionally using a custom matching function.\r\n *\r\n * @param array \tarr\r\n * @param array\t \tarr2\r\n * @param function \tcallback\r\n *\r\n * @return array\r\n */\r\nexport default function(arr, arr2, callback = null) {\r\n\treturn !_isArray(arr2) ? [] : arr.filter(val1 => callback \r\n\t\t? arr2.filter(val2 => callback(val1, val2)).length \r\n\t\t: arr2.indexOf(val1) !== -1\r\n\t);\r\n};\r\n", "/**\r\n * @imports\r\n */\r\nimport _intersect from '../arr/intersect.js';\r\n\r\n/**\r\n * Creates and/or returns an \"internals\" object for the given object.\r\n * \r\n * @param Any obj\r\n * @param String namespace\r\n * \r\n * @return Object\r\n */\r\nexport default function internals(obj, ...namespaces) {\r\n if (!globalThis.webqit) { globalThis.webqit = {}; }\r\n if (!globalThis.webqit.refs) {\r\n Object.defineProperty(globalThis.webqit, 'refs', {value: new ObservableMap})\r\n }\r\n if (!arguments.length) return globalThis.webqit.refs;\r\n let itnls = globalThis.webqit.refs.get(obj);\r\n if (!itnls) {\r\n itnls = new ObservableMap;\r\n globalThis.webqit.refs.set(obj, itnls);\r\n }\r\n let _ns, _itnls;\r\n while ((_ns = namespaces.shift())) {\r\n if ((_itnls = itnls) && !(itnls = itnls.get(_ns))) {\r\n itnls = new ObservableMap;\r\n _itnls.set(_ns, itnls);\r\n }\r\n }\r\n return itnls;\r\n}\r\n\r\nclass ObservableMap extends Map {\r\n constructor( ...args ) {\r\n super( ...args );\r\n this.observers = new Set;\r\n }\r\n set( key, value ) {\r\n let returnValue = super.set( key, value );\r\n this.fire( 'set', key, value, key );\r\n return returnValue;\r\n }\r\n delete( key ) {\r\n let returnValue = super.delete( key );\r\n this.fire( 'delete', key );\r\n return returnValue;\r\n }\r\n has( key ) {\r\n this.fire( 'has', key );\r\n return super.has( key );\r\n }\r\n get( key ) {\r\n this.fire( 'get', key );\r\n return super.get( key );\r\n }\r\n keyNames() { return Array.from( super.keys() ); }\r\n observe( type, key, callback ) {\r\n const entry = { type, key, callback };\r\n this.observers.add( entry );\r\n return () => this.observers.delete( entry );\r\n }\r\n unobserve( type, key, callback ) {\r\n if ( Array.isArray( type ) || Array.isArray( key ) ) {\r\n throw new Error( `The \"type\" and \"key\" arguments can only be strings.` );\r\n }\r\n for ( let entry of this.observers ) {\r\n if ( !( _intersection( [ type, '*' ], entry.type ) && _intersection( [ key, '*' ], entry.key ) && entry.callback === callback ) ) continue;\r\n this.observers.delete( entry );\r\n }\r\n }\r\n fire( type, key, ...args ) {\r\n // IMPORTANT: Array.from() must be used so that new additions to this.observers\r\n // during the loop aren't picked up!\r\n for ( let entry of this.observers ) {\r\n if ( !( _intersection( [ type, '*' ], entry.type ) && _intersection( [ key, '*' ], entry.key ) ) ) continue;\r\n entry.callback( ...args );\r\n }\r\n }\r\n}\r\n\r\nconst _intersection = ( a, b ) => {\r\n if ( Array.isArray( b ) ) return _intersect( a, b ).length;\r\n return a.includes( b );\r\n}\r\n", "\r\n/**\r\n * Tells if val is of type \"function\".\r\n * This holds true for both regular functions and classes.\r\n *\r\n * @param object\t \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn typeof val === 'function';\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isTypeFunction from './isTypeFunction.js';\r\n\r\n/**\r\n * Tells if val is of type \"class\".\r\n *\r\n * @param object \t\tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn _isTypeFunction(val) && /^class\\s?/.test(Function.prototype.toString.call(val));\r\n};\r\n", "\r\n/**\r\n * Tells if val is undefined or is null.\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn val === null || val === '';\r\n};\r\n", "\r\n/**\r\n * Tells if val is undefined or is of type \"undefined\".\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn arguments.length && (val === undefined || typeof val === 'undefined');\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isTypeFunction from './isTypeFunction.js';\r\n\r\n/**\r\n * Tells if val is of type \"object\".\r\n * This holds true for anything object, including built-ins.\r\n *\r\n * @param object\t \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn Array.isArray(val) || (typeof val === 'object' && val) || _isTypeFunction(val);\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isNull from './isNull.js';\r\nimport _isUndefined from './isUndefined.js';\r\nimport _isTypeObject from './isTypeObject.js';\r\n\r\n/**\r\n * Tells if val is empty in its own type.\r\n * This holds true for NULLs, UNDEFINED, FALSE, 0,\r\n * objects without keys, empty arrays.\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn _isNull(val) || _isUndefined(val) || val === false || val === 0 \r\n\t\t|| (_isTypeObject(val) && !Object.keys(val).length);\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isTypeFunction from './isTypeFunction.js';\r\n\r\n/**\r\n * Tells if val is of type \"function\".\r\n *\r\n * @param object \t\tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn _isTypeFunction(val) || (val && {}.toString.call(val) === '[object function]');\r\n};\r\n", "\r\n/**\r\n * Tells if val is of type \"number\".\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn val instanceof Number || (typeof val === 'number');\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isNumber from './isNumber.js';\r\n/**\r\n * Tells if val is of type \"string\" or a numeric string.\r\n * This holds true for both numbers and numeric strings.\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn _isNumber(val) || (val !== true && val !== false && val !== null && val !== '' && !isNaN(val * 1));\r\n};\r\n", "\r\n/**\r\n * Tells if val is of type \"string\".\r\n *\r\n * @param string \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn val instanceof String || (typeof val === 'string' && val !== null);\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isString from './isString.js';\r\nimport _isUndefined from './isUndefined.js';\r\n\r\n/**\r\n * Tells if val is \"array-like\".\r\n * This holds true for anything that has a length property.\r\n *\r\n * @param object\t \tval\r\n *\r\n * @return bool\r\n */\r\nexport default function(val) {\r\n\treturn !_isString(val) && !_isUndefined(val.length);\r\n};\r\n", "\r\n/**\r\n * Adds an item if not already exist.\r\n *\r\n * @param array \tarr\r\n * @param array\t \t...itms\r\n *\r\n * @return array\r\n */\r\nexport default function(arr, ...items) {\r\n\titems.forEach(itm => {\r\n\t\tif (arr.indexOf(itm) < 0) {\r\n\t\t\tarr.push(itm);\r\n\t\t}\r\n\t});\r\n\treturn arr;\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isArray from '../js/isArray.js';\r\n\r\n/**\r\n * Returns the prototype chain.\r\n *\r\n * @param object \t\tobj\r\n * @param object\t \tuntil\r\n *\r\n * @return bool\r\n */\r\nexport default function(obj, until) {\r\n\tuntil = until || Object.prototype;\r\n\tuntil = until && !_isArray(until) ? [until] : until;\r\n\t// We get the chain of inheritance\r\n\tvar prototypalChain = [];\r\n\tvar obj = obj;\r\n\twhile((obj && (!until || until.indexOf(obj) < 0) && obj.name !== 'default')) {\r\n\t\tprototypalChain.push(obj);\r\n\t\tobj = obj ? Object.getPrototypeOf(obj) : null;\r\n\t}\r\n\treturn prototypalChain;\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _pushUnique from '../arr/pushUnique.js';\r\nimport _getPrototypeChain from './getPrototypeChain.js';\r\n\r\n/**\r\n * Eagerly retrieves object members all down the prototype chain.\r\n *\r\n * @param object\t \tobj\r\n * @param object\t \tuntil\r\n *\r\n * @return array\r\n */\r\nexport default function(obj, until) {\r\n\tvar keysAll = [];\r\n\t_getPrototypeChain(obj, until).forEach(obj => {\r\n\t\t_pushUnique(keysAll, ...Object.getOwnPropertyNames(obj));\r\n\t});\r\n\treturn keysAll;\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isArray from '../js/isArray.js';\r\nimport _isFunction from '../js/isFunction.js';\r\nimport _isObject from '../js/isObject.js';\r\nimport _isTypeObject from '../js/isTypeObject.js';\r\nimport _isNumeric from '../js/isNumeric.js';\r\nimport _getAllPropertyNames from './getAllPropertyNames.js';\r\n\r\n/**\r\n * Merges values from subsequent arrays/objects first array/object;\r\n * optionally recursive\r\n *\r\n * @param array ...objs\r\n *\r\n * @return void\r\n */\r\nexport default function mergeCallback(objs, callback, deepProps = false, isReplace = false, withSymbols = false) {\r\n\tvar depth = 0;\r\n\tvar obj1 = objs.shift();\r\n\tif (_isNumeric(obj1) || obj1 === true || obj1 === false) {\r\n\t\tdepth = obj1;\r\n\t\tobj1 = objs.shift();\r\n\t}\r\n\tif (!objs.length) {\r\n\t\tthrow new Error('_merge() requires two or more array/objects.');\r\n\t}\r\n\tobjs.forEach((obj2, i) => {\r\n\t\tif (!_isTypeObject(obj2) && !_isFunction(obj2)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t(deepProps ? _getAllPropertyNames(obj2) : Object.keys(obj2)).forEach(key => {\r\n\t\t\tif (!callback(key, obj1, obj2, i)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar valAtObj1 = obj1[key];\r\n\t\t\tvar valAtObj2 = obj2[key];\r\n\t\t\tif (((_isArray(valAtObj1) && _isArray(valAtObj2)) || (_isObject(valAtObj1) && _isObject(valAtObj2))) \r\n\t\t\t&& (depth === true || depth > 0)) {\r\n\t\t\t\t// RECURSE...\r\n\t\t\t\tobj1[key] = _isArray(valAtObj1) && _isArray(valAtObj2) ? [] : {};\r\n\t\t\t\tmergeCallback([_isNumeric(depth) ? depth - 1 : depth, obj1[key], valAtObj1, valAtObj2], callback, deepProps, isReplace, withSymbols);\r\n\t\t\t} else {\r\n\t\t\t\tif (_isArray(obj1) && _isArray(obj2)) {\r\n\t\t\t\t\tif (isReplace) {\r\n\t\t\t\t\t\tobj1[key] = valAtObj2;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tobj1.push(valAtObj2);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// In case we're setting a read-only property\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tif (withSymbols) {\r\n\t\t\t\t\t\t\tObject.defineProperty(obj1, key, Object.getOwnPropertyDescriptor(obj2, key));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tobj1[key] = obj2[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch(e) {}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\treturn obj1;\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _mergeCallback from './mergeCallback.js';\r\n\r\n/**\r\n * Merges values from subsequent arrays/objects first array/object;\r\n * optionally recursive\r\n *\r\n * @param array ...objs\r\n *\r\n * @return void\r\n */\r\nexport default function(...objs) {\r\n\treturn _mergeCallback(objs, (k, obj1, obj2) => {\r\n\t\treturn true;\r\n\t}, false/*deepProps*/, false/*isReplace*/, false/*withSymbols*/);\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isArray from '../js/isArray.js';\r\nimport _isTypeArray from '../js/isTypeArray.js';\r\nimport _isEmpty from '../js/isEmpty.js';\r\nimport _isObject from '../js/isObject.js';\r\n\r\n/**\r\n * Casts an array-like object to an array.\r\n *\r\n * @param mixed \tval\r\n * @param bool\t \tcastObject\r\n *\r\n * @return array\r\n */\r\nexport default function(val, castObject = true) {\r\n\tif (_isArray(val)) {\r\n\t\treturn val;\r\n\t};\r\n\tif (!castObject && _isObject(val)) {\r\n\t\treturn [val];\r\n\t};\r\n\tif (val !== false && val !== 0 && _isEmpty(val)) {\r\n\t\treturn [];\r\n\t};\r\n\tif (_isTypeArray(val)) {\r\n\t\treturn Array.prototype.slice.call(val);\r\n\t};\r\n\tif (_isObject(val)) {\r\n\t\treturn Object.values(val);\r\n\t};\r\n\treturn [val];\r\n};\r\n", "\n/**\n * ---------------------------\n * The Registration class\n * ---------------------------\n */\n\nexport default class Registration {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param Registry\t\t\tregistry\n\t * @param object\t\t\tdfn\n\t *\n\t * @return void\n\t */\n\tconstructor( registry, dfn ) {\n\t\tthis.registry = registry;\n\t\tObject.assign( this, { ...dfn, target: registry.target } );\n\t\tif ( this.params.signal ) {\n\t\t\tthis.params.signal.addEventListener( 'abort', () => this.remove() );\n\t\t}\n\t}\n\n\t/**\n\t * Sets a \"disconnected\" flag on the Registration.\n\t *\n\t * @return void\n\t */\n\tremove() {\n\t\tthis.removed = true;\n\t\treturn this.registry.removeRegistration( this );\n\t}\n}", "\n/**\n * @imports\n */\nimport { _internals } from '@webqit/util/js/index.js';\n\nexport const _ = ( ...args ) => _internals( 'observer-api', ...args );\n\nexport const _await = ( value, callback ) => value instanceof Promise ? value.then( callback ) : callback( value );\n", "\n/**\n * @imports\n */\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport Registration from './Registration.js';\nimport { _await } from '../util.js';\n\n/**\n * ---------------------------\n * The ListenerRegistration class\n * ---------------------------\n */\n\nexport default class ListenerRegistration extends Registration {\n\t\n\t/**\n\t * @constructor\n\t */\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.emit.currentRegistration = this;\n\t\tObject.defineProperty( this, 'abortController', { value: new AbortController } );\n\t\tObject.defineProperty( this, 'signal', { value: this.abortController.signal } );\n\t}\n\n\t/**\n\t * De-registers the instance.\n\t * \n\t * @return Void\n\t */\n\tremove() {\n\t\tthis.abortController.abort();\n\t\tsuper.remove();\n\t}\n\n\t/**\n\t * Calls the observer's handler function\n\t * on matching with the event's fields.\n\t *\n\t * @param Array\t\t\t \t\tevents\n\t *\n\t * @return Any\n\t */\n\tfire( events ) {\n\t\tif ( this.emit.recursionTarget && ![ 'inject', 'force-async', 'force-sync' ].includes( this.params.recursions ) ) return;\n\t\tlet matches = events, filter = this.filter;\n\t\tif ( filter !== Infinity && ( filter = _arrFrom( filter, false ) ) ) {\n\t\t\tmatches = events.filter( event => filter.includes( event.key ) );\n\t\t}\n\t\tif ( this.params.diff ) {\n\t\t\tmatches = matches.filter( event => event.type !== 'set' || event.value !== event.oldValue );\n\t\t}\n\t\tif ( matches.length ) {\n\t\t\tif ( this.emit.recursionTarget && this.params.recursions !== 'force-sync' ) {\n\t\t\t\tthis.emit.recursionTarget.push( ...matches );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.emit.recursionTarget = this.params.recursions === 'inject' ? matches : [];\n\t\t\tconst $ret = this.filter === Infinity || Array.isArray( this.filter )\n\t\t\t\t? this.emit( matches, this )\n\t\t\t\t: this.emit( matches[ 0 ], this );\n\t\t\t// NOTEL: on calling emit(), this registration has expired and a new one active!!!\n\t\t\treturn _await( $ret, ret => {\n\t\t\t\tconst recursions = this.emit.recursionTarget;\n\t\t\t\tdelete this.emit.recursionTarget;\n\t\t\t\tif ( this.params.recursions === 'force-async' ) {\n\t\t\t\t\tif ( recursions.length ) return this.emit.currentRegistration.fire( recursions );\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t\t} );\n\t\t}\n\t}\n}\n", "\n/**\n * @imports\n */\nimport { _isTypeObject, _getType } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom, _intersect, _equals as _arrEquals } from '@webqit/util/arr/index.js';\nimport { _ } from '../util.js';\n\n/**\n * ---------------------------\n * The Registry class\n * ---------------------------\n */\n\nexport default class Registry {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param object\ttarget\n\t * \n\t * @return void\n\t */\n\tconstructor( target ) {\n\t\tthis.target = target;\n\t\tthis.entries = [];\n\t}\n\t\n\t/**\n\t * Adds an Registration instance\n\t * with optional tags.\n\t *\n\t * @param Registration\t\tregistration\n\t *\n\t * @return Registration\n\t */\n\taddRegistration( registration ) {\n\t\tthis.entries.push( registration );\n\t\treturn registration;\n\t}\n\t\n\t/**\n\t * Removes registrations by reference.\n\t *\n\t * @param Registration\t\tregistration\n\t *\n\t * @return void\n\t */\n\tremoveRegistration( registration ) {\n\t\tthis.entries = this.entries.filter( _entry => _entry !== registration );\n\t}\n\t\t\n\t/**\n\t * Returns a observer-specific object embedded on an element.\n\t *\n\t * @param string\t\ttype\n\t * @param array|object\ttarget\n\t * @param bool \tcreateIfNotExists\n\t * @param string \tnamespace\n\t *\n\t * @return Registry\n\t */\n\tstatic _getInstance( type, target, createIfNotExists = true, namespace = this.__namespace ) {\n\t\tif ( !_isTypeObject( target ) ) throw new Error( `Subject must be of type object; \"${ _getType( target ) }\" given!` );\n\t\tlet ImplementationClass = this;\n\t\tif ( namespace && _( 'namespaces' ).has( type + '-' + namespace ) ) {\n\t\t\tImplementationClass = _( 'namespaces' ).get( type + '-' + namespace );\n\t\t\ttype += '-' + namespace\n\t\t}\n\t\tif ( !_( target, 'registry' ).has( type ) && createIfNotExists ) {\n\t\t\t_( target, 'registry' ).set( type, new ImplementationClass( target ) );\n\t\t}\n\t\treturn _( target, 'registry' ).get( type );\n\t}\n\n\t/**\n\t * Extend a Fireable Class with a namespace.\n\t *\n\t * @param string\t\tnamespace\n\t * @param class \tImplementationClass\n\t *\n\t * @return void|class\n\t */\n\tstatic _namespace( type, namespace, ImplementationClass = null ) {\n\t\ttype += '-' + namespace;\n\t\tif ( arguments.length === 2 ) return _( 'namespaces' ).get( type );\n\t\tif ( !( ImplementationClass.prototype instanceof this ) ) {\n\t\t\tthrow new Error( `The implementation of the namespace ${ this.name }.${ namespace } must be a subclass of ${ this.name }.` );\n\t\t}\n\t\t_( 'namespaces' ).set( type, ImplementationClass );\n\t\tImplementationClass.__namespace = namespace;\n\t}\n}", "\n/**\n * @imports\n */\nimport ListenerRegistration from './ListenerRegistration.js';\nimport Registry from './Registry.js';\nimport { _await } from '../util.js';\n\n/**\n * ---------------------------\n * The ListenerRegistry class\n * ---------------------------\n */\n\nexport default class ListenerRegistry extends Registry {\n\n\tstatic getInstance( target, createIfNotExists = true, namespace = null ) {\n\t\treturn super._getInstance( 'listeners', ...arguments );\n\t}\n\n\tstatic namespace( namespace, ImplementationClass = null ) {\n\t\treturn super._namespace( 'listeners', ...arguments );\n\t}\n\n\t/**\n\t * @constructor\n\t */\n\tconstructor( target ) {\n\t\tsuper( target );\n\t\tthis.batches = [];\n\t}\n\t\n\t/**\n\t * @addRegistration\n\t */\n\taddRegistration( filter, emit, params ) {\n\t\treturn super.addRegistration( new ListenerRegistration( this, { filter, emit, params } ) );\n\t}\n\t\n\t/**\n\t * Fires all observers with the given evt (change).\n\t *\n\t * @param Arrayn events\n\t *\n\t * @return Void\n\t */\n\temit( events ) {\n\t\tif ( this.batches.length ) {\n\t\t\tthis.batches[ 0 ].events.push( ...events );\n\t\t\treturn\n\t\t}\n\t\tthis.entries.forEach( listener => listener.fire( events ) );\n\t}\n\n\t/**\n\t * Fires all observers with the given evt (change).\n\t *\n\t * @param Arrayn events\n\t *\n\t * @return Void\n\t */\n\tbatch( callback ) {\n\t\tthis.batches.unshift( { entries: [ ...this.entries ], events: [] } );\n\t\tconst returnValue = callback();\n\t\treturn _await( returnValue, returnValue => {\n\t\t\tconst batch = this.batches.shift();\n\t\t\tif ( batch.events.length ) {\n\t\t\t\tbatch.entries.forEach( listener => listener.fire( batch.events ) );\n\t\t\t}\n\t\t\treturn returnValue;\n\t\t} )\n\t}\n\n}", "\n/**\n * @imports\n */\nimport Registration from './Registration.js';\n\n/**\n * ---------------------------\n * The TrapsRegistration class\n * ---------------------------\n */\n\nexport default class TrapsRegistration extends Registration {\n\t\n\t/**\n\t * Calls the observer's handler function\n\t * on matching with the descriptor's fields.\n\t *\n\t * @param Descriptor\t\t\t \tdescriptor\n\t * @param function\t\t\t\t\tnext\n\t * @param mixed\t\t\t\t\t \trecieved\n\t *\n\t * @return void\n\t */\n\texec( descriptor, next, recieved ) {\n\t\tif ( this.running || !this.traps[ descriptor.type ] ) {\n\t\t\treturn next( ...Array.prototype.slice.call( arguments, 2 ) );\n\t\t}\n\t\tthis.running = true;\n\t\treturn this.traps[ descriptor.type ]( descriptor, recieved, ( ...args ) => {\n\t\t\tthis.running = false;\n\t\t\treturn next( ...args );\n\t\t} );\n\t}\n}", "\n/**\n * @imports\n */\nimport TrapsRegistration from './TrapsRegistration.js';\nimport Registry from './Registry.js';\n\n/**\n * ---------------------------\n * The TrapsRegistry class\n * ---------------------------\n */\n\nexport default class TrapsRegistry extends Registry {\n\n\tstatic getInstance( target, createIfNotExists = true, namespace = null ) {\n\t\treturn super._getInstance( 'traps', ...arguments );\n\t}\n\n\tstatic namespace( namespace, ImplementationClass = null ) {\n\t\treturn super._namespace( 'traps', ...arguments );\n\t}\n\t\n\t/**\n\t * @inheritdoc\n\t */\n\taddRegistration( dfn ) {\n\t\treturn super.addRegistration( new TrapsRegistration( this, dfn ) );\n\t}\n\n\t/**\n\t * Fires all interceptors with the given action.\n\t *\n\t * @param Descriptor\t\tdescriptor\n\t * @param function\t\t\tdefaultHandler\n\t *\n\t * @return mixed\n\t */\n\temit( descriptor, defaultHandler = null ) {\n\t\tconst $this = this;\n\t\treturn ( function next( index, ..._args ) {\n\t\t\tconst registration = $this.entries[ index ];\n\t\t\tif ( registration ) {\n\t\t\t\treturn registration.exec( descriptor, ( ...args ) => {\n\t\t\t\t\treturn next( index + 1, ...args );\n\t\t\t\t}/*next*/, ..._args );\n\t\t\t}\n\t\t\treturn defaultHandler ? defaultHandler( descriptor, ..._args ) : _args[ 0 ];\n\t\t} )( 0 );\n\t}\n}", "\n/**\n * ---------------------------\n * The Descriptor class\n * ---------------------------\n */\n\nexport default class Descriptor {\n\t\n\t/**\n\t * Initializes the instance.\n\t *\n\t * @param array|object\ttarget\n\t * @param object\t\tdfn\n\t *\n\t * @return void\n\t */\n\tconstructor( target, dfn ) {\n\t\tthis.target = target;\n\t\tif ( !( dfn.type ) ) throw new Error( 'Descriptor type must be given in definition!' );\n\t\tObject.assign( this, dfn );\n\t}\n}", "\n/**\n * @imports\n */\nimport { _from as _arrFrom } from '@webqit/util/arr/index.js';\nimport { _isClass, _isFunction, _isTypeObject, _getType } from '@webqit/util/js/index.js';\nimport { set, deleteProperty, has, get, ownKeys, defineProperty, getOwnPropertyDescriptor } from \"./main.js\";\nimport { batch, apply, construct, getPrototypeOf, setPrototypeOf, isExtensible, preventExtensions } from \"./main.js\";\nimport { _ } from './util.js';\n\n/* ---------------ACCESSORIZE METHODS--------------- */\n\n/**\n * Accessorizes props.\n *\n * @param Array|Object\ttarget\n * @param String|Array\tprops\n * @param Object\t\tparams\n *\n * @return Array\n */\nexport function accessorize( target, props, params = {} ) {\n target = resolveTarget( target );\n const accessorizedProps = _( target, 'accessorizedProps' );\n // ---------\n function getDescriptorDeep( prop ) {\n let descriptor, proto = target;\n do {\n descriptor = Object.getOwnPropertyDescriptor( proto, prop );\n } while ( !descriptor && ( proto = Object.getPrototypeOf( proto ) ) );\n return descriptor \n ? { proto, descriptor } \n : { descriptor: { value: undefined, configurable: true, enumerable: true, writable: true } };\n }\n // ---------\n function accessorizeProp( prop ) {\n if ( accessorizedProps.has( prop + '' ) ) return true;\n // ------------------\n // Current Descriptor Record\n const currentDescriptorRecord = getDescriptorDeep( prop );\n currentDescriptorRecord.getValue = function() {\n return this.descriptor.get ? this.descriptor.get() : this.descriptor.value;\n };\n currentDescriptorRecord.setValue = function( value ) {\n this.dirty = true;\n return this.descriptor.set ? this.descriptor.set( value ) !== false : ( this.descriptor.value = value, true );\n };\n currentDescriptorRecord.intact = function() {\n const currentDescriptor = Object.getOwnPropertyDescriptor( target, prop );\n return currentDescriptor?.get === accessorization.get \n && currentDescriptor?.set === accessorization.set\n && accessorizedProps.get( prop + '' ) === this;\n };\n currentDescriptorRecord.restore = function() {\n if ( !this.intact() ) return false;\n if ( ( this.proto && this.proto !== target ) || ( !this.proto && !this.dirty ) ) { delete target[ prop ]; }\n else { Object.defineProperty( target, prop, this.descriptor ); }\n accessorizedProps.delete( prop + '' );\n return true;\n };\n accessorizedProps.set( prop + '', currentDescriptorRecord );\n // ------------------\n // enumerable, configurable\n const { enumerable = true } = currentDescriptorRecord.descriptor;\n const accessorization = { enumerable, configurable: true };\n // set, get\n if ( ( 'value' in currentDescriptorRecord.descriptor ) || currentDescriptorRecord.descriptor.set ) {\n accessorization.set = function ( value ) { return set( this, prop, value, params ); };\n }\n if ( ( 'value' in currentDescriptorRecord.descriptor ) || currentDescriptorRecord.descriptor.get ) {\n accessorization.get = function () { return get( this, prop, params ); };\n }\n try {\n Object.defineProperty( target, prop, accessorization );\n return true;\n } catch( e ) {\n accessorizedProps.delete( prop + '' );\n return false;\n }\n }\n const _props = Array.isArray( props ) ? props : (\n props === undefined ? Object.keys( target ) : [ props ]\n );\n const statuses = _props.map( accessorizeProp );\n return props === undefined || Array.isArray( props ) \n ? statuses \n : statuses[ 0 ];\n}\n\n/**\n * Unaccessorizes previously accessorized props.\n *\n * @param Array|Object\ttarget\n * @param String|Array\tprops\n * @param Object\t\tparams\n *\n * @return Array\n */\nexport function unaccessorize( target, props, params = {} ) {\n target = resolveTarget( target );\n const accessorizedProps = _( target, 'accessorizedProps' );\n function unaccessorizeProp( prop ) {\n if ( !accessorizedProps.has( prop + '' ) ) return true;\n return accessorizedProps.get( prop + '' ).restore();\n }\n const _props = Array.isArray( props ) ? props : (\n props === undefined ? Object.keys( target ) : [ props ]\n );\n const statuses = _props.map( unaccessorizeProp );\n return props === undefined || Array.isArray( props ) \n ? statuses \n : statuses[ 0 ];\n}\n\n/* ---------------PROXY METHODS--------------- */\n\n/**\n * Returns an object as a proxy and binds all instance methods\n * to the proxy instead of the object itself.\n *\n * @param Array|Object\t\ttarget\n * @param Object\t\t params\n *\n * @return Proxy\n */\nexport function proxy( target, params = {} ) {\n target = resolveTarget( target );\n const proxy = new Proxy( target, {\n apply: ( target, thisArgument, argumentsList ) => apply( target, thisArgument, argumentsList, params ),\n construct: ( target, argumentsList, newTarget = null ) => construct( target, argumentsList, newTarget, params ),\n defineProperty: ( target, propertyKey, attributes ) => defineProperty( target, propertyKey, attributes, params ),\n deleteProperty: ( target, propertyKey ) => deleteProperty( target, propertyKey, params ),\n get: ( target, propertyKey, receiver = null ) => {\n const val = get( target, propertyKey, { ...params, receiver } );\n if ( params.proxyAutoBinding !== false && _isFunction( val ) && !_isClass( val )) {\n return function( ...args ) {\n const _this = this || proxy;\n return batch( _this, () => val.call( _this, ...args ) );\n }\n }\n return val;\n },\n getOwnPropertyDescriptor: ( target, propertyKey ) => getOwnPropertyDescriptor( target, propertyKey, params ),\n getPrototypeOf: target => getPrototypeOf( target, params ),\n has: ( target, propertyKey ) => has( target, propertyKey, params ),\n isExtensible: target => isExtensible( target, params ),\n ownKeys: target => ownKeys( target, params ),\n preventExtensions: target => preventExtensions( target, params ),\n set: ( target, propertyKey, value, receiver = null ) => set( target, propertyKey, value, { ...params, receiver } ),\n setPrototypeOf: ( target, prototype ) => setPrototypeOf( target, prototype, params ),\n });\n _( proxy ).set( proxy, target );\n\treturn proxy;\n}\n\n/**\n * Returns the original object earlier proxied by proxy().\n *\n * @param Proxy|Any\t\ttarget\n *\n * @return Any\n */\nexport function unproxy( target ) {\n // Proxy targets are mapped to their own instances internally\n return _( target ).get( target ) || target;\n}\n\n/* ---------------HELPERS--------------- */\n\n/** \n * Ensures target object is an object or array.\n *\n * @param Array|Object\ttarget\n *\n * @return Array|Object\n */\nfunction resolveTarget( target ) {\n\tif ( !target || !_isTypeObject( target ) ) throw new Error('Target must be of type object!');\n\treturn unproxy( target );\n}\n", "\n/**\n * @imports\n */\nimport * as main from './main.js';\nimport * as actors from './actors.js';\n\nconst Observer = { ...main, ...actors };\n\nexport default Observer;", "\r\n/**\r\n * @imports\r\n */\r\nimport _isTypeObject from '../js/isTypeObject.js';\r\nimport _isUndefined from '../js/isUndefined.js';\r\nimport _isNull from '../js/isNull.js';\r\nimport _arrFrom from '../arr/from.js';\r\n\r\n/**\r\n * Retrieves the value at the given path.\r\n *\r\n * A return value of undefined is ambiguous, and can mean either that the\r\n * path does not exist, or that the path actually exists but with a value of undefined. If it is required to\r\n * know whether the path actually exists, pass an object as a third argument.\r\n * This object will have an \"exists\" key set to true/false.\r\n *\r\n * @param object \t\t\t\tctxt\r\n * @param array \t\t\t\tpath\r\n * @param object \t\t\t\ttrap\r\n * @param object \t\t\t\treciever\r\n *\r\n * @return mixed\r\n */\r\nexport default function(ctxt, path, trap = {}, reciever = {}) {\r\n\tpath = _arrFrom(path).slice();\r\n\tvar _ctxt = ctxt;\r\n\twhile(!_isUndefined(_ctxt) && !_isNull(_ctxt) && path.length) {\r\n\t\tvar _key = path.shift();\r\n\t\tif (!(trap.get ? trap.get(_ctxt, _key) : (_isTypeObject(_ctxt) ? _key in _ctxt : _ctxt[_key]))) {\r\n\t\t\treciever.exists = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t_ctxt = trap.get ? trap.get(_ctxt, _key) : _ctxt[_key];\r\n\t}\r\n\treciever.exists = true;\r\n\treturn _ctxt;\r\n};\r\n", "\r\n/**\r\n * @imports\r\n */\r\nimport _isTypeObject from '../js/isTypeObject.js';\r\nimport _isFunction from '../js/isFunction.js';\r\nimport _isNumeric from '../js/isNumeric.js';\r\nimport _isArray from '../js/isArray.js';\r\nimport _arrFrom from '../arr/from.js';\r\nimport _get from './get.js';\r\n\r\n/**\r\n * Sets a value to the given path.\r\n *\r\n * @param object \t\t\t\tobj\r\n * @param array \t\t\t\tpath\r\n * @param mixed \t\t\t\tval\r\n * @param object|function \t\tbuildTree\r\n * @param object \t\t\t\ttrap\r\n *\r\n * @return bool\r\n */\r\nexport default function(obj, path, val, buildTree = {}, trap = {}) {\r\n\tconst _set = (target, key, val) => {\r\n\t\tif (trap.set) {\r\n\t\t\treturn trap.set(target, key, val);\r\n\t\t} else {\r\n\t\t\tif (_isNumeric(path[i]) && _isArray(target)) {\r\n\t\t\t\ttarget.push(val);\r\n\t\t\t} else {\r\n\t\t\t\ttarget[key] = val;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n\tpath = _arrFrom(path);\r\n\tvar target = obj;\r\n\tfor(var i = 0; i < path.length; i ++) {\r\n\t\tif (i < path.length - 1) {\r\n\t\t\tif (!target || (!_isTypeObject(target) && !_isFunction(target))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tvar branch = _get(target, path[i], trap);\r\n\t\t\tif (!_isTypeObject(branch)) {\r\n\t\t\t\tif (trap.buildTree === false) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbranch = _isFunction(trap.buildTree) ? trap.buildTree(i) : (_isNumeric(path[i + 1]) ? [] : {});\r\n\t\t\t\tvar branchSuccess = _set(target, path[i], branch);\r\n\t\t\t\tif (!branchSuccess) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttarget = branch;\r\n\t\t} else {\r\n\t\t\treturn _set(target, path[i], val);\r\n\t\t}\r\n\t}\r\n};\r\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, asyncDOM = true ) {\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\tthis.async = asyncDOM;\n\t\tif ( this.window.requestAnimationFrame ) {\n\t\t\tthis._run();\n\t\t} else {\n\t\t\tthis.async = false;\n\t\t}\n\t}\n\n\t_run() {\n\t\tthis.window.requestAnimationFrame( () => {\n\t\t\tfor ( const callback of this.readCallbacks ) {\n\t\t\t\tcallback();\n\t\t\t\tthis.readCallbacks.delete( callback );\n\t\t\t}\n\t\t\tfor ( const callback of this.writeCallbacks ) {\n\t\t\t\tcallback();\n\t\t\t\tthis.writeCallbacks.delete( callback );\n\t\t\t}\n\t\t\tthis._run();\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.async === false ) {\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.async === false ) {\n\t\t\tcallback();\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.async === false ) {\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.async === false ) {\n\t\t\tcallback();\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/**\n * @imports\n */\nimport { _isFunction, _isObject, _internals } from '@webqit/util/js/index.js';\nimport { _from as _arrFrom } from '@webqit/util/arr/index.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\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.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 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\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 _internals( 'realdom.realtime', this.window, 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, records = Array.isArray( record_s ) ? record_s : [ record_s ];\n\t\tlet dispatchBatch = new Set;\n\t\tfor ( const [ depth, registries ] of this.registry( interceptionTiming ) ) {\n\t\t\tfor ( const [ context, registry ] of registries ) {\n\t\t\t\t// Ensure event target is/within context\n\t\t\t\tlet matches = records.filter( record => {\n\t\t\t\t\tif ( !context.contains( record.target ) ) return false;\n\t\t\t\t\treturn depth === 'subtree' || record.target === context;\n\t\t\t\t} );\n\t\t\t\tif ( !matches.length ) continue;\n\t\t\t\t// Records will be dispatched in their original form\n\t\t\t\tif ( !Array.isArray( record_s ) ) { matches = matches[ 0 ]; }\n\t\t\t\tfor ( const registration of registry ) {\n\t\t\t\t\tdispatchBatch.add( [ registration, matches, context ] );\n\t\t\t\t\t//callback.call( this, registration, matches, context );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Saving everything to dispatchBatch ensures that recursive modifications\n\t\t// to both this.registry( interceptionTiming ), registries, and registry aren't pciked up\n\t\tfor ( const [ registration, record_s, context ] of dispatchBatch ) {\n\t\t\tcallback.call( this, registration, record_s, context );\n\t\t}\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 Realtime from './Realtime.js';\n\n/**\n *\n * @class AttrRealtime\n */\nexport default class AttrRealtime extends Realtime {\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\tfilter\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( filter, callback = undefined, params = {} ) {\n\t\tconst originalFilterIsString = typeof filter === 'string';\n\t\t[ filter = [], callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\tconst { context } = this;\n\t\t// -------------\n\t\tconst records = attrIntersection( context, filter );\n\t\tconst record_s = originalFilterIsString ? records[ 0 ] : records;\n\t\tif ( !callback ) return record_s;\n\t\tconst signalGenerator = callback && params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst flags = signalGenerator?.generate() || {};\n\t\tcallback( record_s, flags, context );\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 ? filter[ 0 ] : filter, 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\tfilter\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( filter, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof filter === 'string';\n\t\t[ filter = [], callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( originalFilterIsString ? filter[ 0 ] : filter, 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 = dedup( 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 };\n\t\tif ( filter.length ) { $params.attributeFilter = filter; }\n\t\tdisconnectable.observe( context, $params );\n\t\t// -------------\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, filter, 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\tfilter\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( filter, callback, params = {} ) {\n\t\tconst originalFilterIsString = typeof filter === 'string';\n\t\t[ filter, 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\tconst intersectionDepth = params.subtree ? 'subtree' : 'children';\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() {\n\t\t\tregistry.delete( registration );\n\t\t\tif ( !registry.size ) { registries.delete( context ); }\n\t\t} };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, filter, callback, params, atomics: new Map, originalFilterIsString, signalGenerator, disconnectable };\n\t\t// -------------\n\t\tconst registries = this.registry( interceptionTiming, intersectionDepth );\n\t\tif ( !registries.has( context ) ) { registries.set( context, new Set ); }\n\t\tconst registry = registries.get( context );\n\t\tregistry.add( registration );\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 dedup( records ) {\n\treturn records.reduce( ( rcds, rcd, i ) => {\n\t\tif ( rcds[ i - 1 ]?.attributeName === 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, filter, callback, params, atomics, originalFilterIsString, signalGenerator } = registration;\n\tif ( params.atomic && !atomics.size ) {\n\t\trecords = attrIntersection( context, filter, records );\n\t}\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: 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?.generate() || {};\n\tcallback( record_s, flags, context );\n}\n\n/**\n * Helper to determining which records to deliver.\n * \n * @param Object \t\t\tcontext\n * @param Array \t\t\tfilter\n * @param Array \t\t\trecords\n * \n * @returns Array\n */\nfunction attrIntersection( context, filter, records = [] ) {\n\tconst _type = { event: null, type: 'attribute' };\n\tif ( filter.length ) {\n\t\treturn filter.map( attrName => {\n\t\t\treturn records.find( r => r.name === attrName ) || { target: context, name: attrName, value: 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: 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 ] || '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\tclearTimeout( registry[ record.name ]?.timeout ); // Clear any previous that's still active\n\t\tregistry[ record.name ] = record.event; // Main: set event details... and next to timeout details\n\t\tconst timeout = setTimeout( () => { delete registry[ record.name ]; }, 0 );\n\t\tObject.defineProperty( record.event, 'timeout', { value: timeout, configurable: true } );\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 = dedup( records ).map( rcd => withAttrEventDetails.call( window, rcd ) ).filter( ( rcd, i ) => {\n\t\t\treturn !Array.isArray( rcd.event );\n\t\t} );\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 = 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';\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\tselectors\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( selectors, callback = undefined, params = {} ) {\n\t\t[ selectors, 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 ( !selectors.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 ( selectors.every( selector => typeof selector === 'string' ) && ( selectors = selectors.join( ',' ) ) ) {\n\t\t\t\tconst matches = params.subtree\n\t\t\t\t\t? context.querySelectorAll( selectors )\n\t\t\t\t\t: [ ...context.children ].filter( node => node.matches( selectors ) );\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( selectors, 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( selectors, callback = undefined, params = {} ) {\n\t\t[ selectors, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( selectors, callback, { ...params, subtree: false } );\n\t}\n\n\t/**\n\t * Alias for query( ..., { subtree: true } )\n\t */\n\tsubtree( selectors, callback = undefined, params = {} ) {\n\t\t[ selectors, callback = undefined, params = {} ] = this.resolveArgs( arguments );\n\t\treturn this.query( selectors, callback, { ...params, subtree: true } );\n\t}\n\n\t/**\n\t * Mutation Observer\n\t * \n\t * @param array|Element|string\t\tselectors\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( selectors, callback, params = {} ) {\n\t\t[ selectors, callback, params = {} ] = this.resolveArgs( arguments );\n\t\t// ------------------------\n\t\tif ( [ 'sync', 'intercept' ].includes( params.timing ) ) return this.observeSync( selectors, 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, } );\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, selectors, 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\tselectors\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( selectors, callback, params = {} ) {\n\t\t[ selectors, 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\tconst intersectionDepth = params.subtree ? 'subtree' : 'children';\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 } );\n\t\t// -------------\n\t\tconst disconnectable = { disconnect() {\n\t\t\tmo.disconnect();\n\t\t\tregistry.delete( registration );\n\t\t\tif ( !registry.size ) { registries.delete( context ); }\n\t\t} };\n\t\tconst signalGenerator = params.signalGenerator || params.lifecycleSignals && this.createSignalGenerator();\n\t\tconst registration = { context, selectors, callback, params, signalGenerator, disconnectable };\n\t\t// -------------\n\t\tconst registries = this.registry( interceptionTiming, intersectionDepth );\n\t\tif ( !registries.has( context ) ) { registries.set( context, new Set ); }\n\t\tconst registry = registries.get( context );\n\t\tregistry.add( registration );\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\n/**\n * Sensitivty for attribute changes for attribute selectors.\n * \n * @param object registration\n * \n * @returns Disconnectable\n */\nfunction staticSensitivity( registration ) {\n\tconst window = this;\n\tconst { context, selectors, callback, params, signalGenerator } = registration;\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( selectors.filter( s => typeof s === 'string' && 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, selectors.some( selector => node.matches( selector ) ) ); }\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, selectors, 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 ( selectors.length ) {\n\t\t\trecord[ generation ] = nodesIntersection( selectors, _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\ttargets \n * @param Array \t\t\tsources \n * @param Bool \t\t\t\tdeepIntersect \n * \n * @returns \n */\nfunction nodesIntersection( targets, sources, deepIntersect ) {\n\tsources = Array.isArray( sources ) ? sources : [ ...sources ];\n\tconst match = ( sources, target ) => {\n\t\t// Filter out text nodes\n\t\tsources = sources.filter( source => source.matches );\n\t\tif ( typeof target === 'string' ) {\n\t\t\t// Is directly mutated...\n\t\t\tlet matches = sources.filter( source => source.matches( target ) );\n\t\t\t// Is contextly mutated...\n\t\t\tif ( deepIntersect ) {\n\t\t\t\tmatches = sources.reduce( ( collection, source ) => {\n\t\t\t\t\treturn [ ...collection, ...source.querySelectorAll( target ) ];\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( target ) || (\n\t\t\t\tdeepIntersect && sources.some( source => source.contains( target ) )\n\t\t\t) ) { return [ target ]; }\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 targets.reduce( ( matches, target ) => {\n\t\tlet _matches;\n\t\tif ( sources.$$searchCache.has( target ) ) {\n\t\t\t_matches = sources.$$searchCache.get( target );\n\t\t} else {\n\t\t\t_matches = match( sources, target ) || [];\n\t\t\tif ( _isObject( target ) ) {\n\t\t\t\tsources.$$searchCache.set( target, _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.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// 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 _originalApis = { characterData: Object.create( null ), other: Object.create( null ) };\n\t[ 'insertBefore'/*Node*/, 'insertAdjacentElement', 'insertAdjacentHTML', 'setHTML',\n\t\t'replaceChildren', 'replaceWith', 'remove', 'replaceChild'/*Node*/, 'removeChild'/*Node*/, \n\t\t'before', 'after', 'append', 'prepend', 'appendChild'/*Node*/, \n\t].forEach( apiName => {\n\t\tfunction method( ...args ) {\n\t\t\tconst originalApis = this instanceof CharacterData ? _originalApis.characterData : _originalApis.other;\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tconst exec = () => originalApis[ apiName ].call( this, ...args );\n\t\t\tif ( !( this instanceof CharacterData || this instanceof Element || this instanceof DocumentFragment ) ) 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 ( [ 'setHTML', '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', 'setHTML' ].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 originalApis[ apiName ].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 );\n\t\t\t\toriginalApis.setHTML.call( temp, entrants[ 0 ], apiName === 'setHTML' ? 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\targs[ 1 ].______isTemp = true;\n\t\t\t\t\targs[ 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\tconst record = { target, entrants, exits, type: 'interception', event: [ this, apiName ] };\n\t\t\treturn intercept( record, () => {\n\t\t\t\treturn originalApis[ apiNameFinal ].call( this, ...args );\n\t\t\t} );\n\t\t}\n\t\t// We'll be sure to monkey the correct interface\n\t\tif ( [ 'insertBefore', 'replaceChild', 'removeChild', 'appendChild' ].includes( apiName ) ) {\n\t\t\t_originalApis.other[ apiName ] = Node.prototype[ apiName ];\n\t\t\tNode.prototype[ apiName ] = method;\n\t\t} else {\n\t\t\t// Comment nodes have this methods too\n\t\t\tif ( [ 'after', 'before', 'remove', 'replaceWith' ].includes( apiName ) ) {\n\t\t\t\t_originalApis.characterData[ apiName ] = CharacterData.prototype[ apiName ];\n\t\t\t\tCharacterData.prototype[ apiName ] = method;\n\t\t\t}\n\t\t\t// In case newer methods like setHTML() are not supported\n\t\t\tif ( Element.prototype[ apiName ] ) {\n\t\t\t\t_originalApis.other[ apiName ] = Element.prototype[ apiName ];\n\t\t\t\tElement.prototype[ apiName ] = method;\n\t\t\t}\n\t\t}\n\t} );\n\n\tconst originalApis = Object.create( null );\n\t// Intercept DOM mutation properties\n\t[ 'outerHTML', 'outerText'/*HTMLElement*/, 'innerHTML', \n\t\t'innerText'/*HTMLElement*/,'textContent'/*Node*/, 'nodeValue'/*Node*/\n\t].forEach( apiName => {\n\t\t// We'll be sure to monkey the correct interface\n\t\tconst Interface = [ 'textContent', 'nodeValue' ].includes( apiName ) ? Node : (\n\t\t\t[ 'outerText', 'innerText' ].includes( apiName ) ? HTMLElement : Element\n\t\t);\n\t\toriginalApis[ apiName ] = Object.getOwnPropertyDescriptor( Interface.prototype, apiName );\n\t\tObject.defineProperty( Interface.prototype, apiName, { ...originalApis[ apiName ], set: function( value ) {\n\t\t\tlet exec = () => originalApis[ apiName ].set.call( this, value );\n\t\t\t// Instance of Node interface? Abort!\n\t\t\tif ( !( this instanceof Element ) ) 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\texits = /*this instanceof HTMLTemplateElement \n\t\t\t\t\t? [ ...this.content.childNodes ]\n\t\t\t\t\t: */[ ...this.childNodes ];\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 === 'TEMPLATE' ? 'div' : tempNodeName );\n\t\t\t\toriginalApis[ apiName ].set.call( temp, value );\n\t\t\t\tentrants = /*[ ...temp.childNodes ];*/this instanceof HTMLTemplateElement ? [] : [ ...temp.childNodes ];\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\tvalue.______isTemp = true;\n\t\t\t\t\tvalue.append( ...temp.childNodes );\n\t\t\t\t\texec = () => 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 = () => this.content.replaceChildren( ...temp.childNodes );\n\t\t\t\t\t} else {\n\t\t\t\t\t\texec = () => Element.prototype.replaceChildren.call( this, ...temp.childNodes );\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\t// Intercept document mutation methods\n\t[ 'append', 'prepend', 'replaceChildren' ].forEach( apiName => {\n\t\t[ document, DocumentFragment.prototype ].forEach( target => {\n\t\t\tconst originalApi = target[ apiName ];\n\t\t\ttarget[ apiName ] = function( ...args ) {\n\t\t\t\tif ( this.______isTemp ) return originalApi.call( this, ...args );\n\t\t\t\tconst exits = apiName === 'replaceChildren' ? [ ...this.childNodes ] : [];\n\t\t\t\tconst record = {\n\t\t\t\t\ttarget: this,\n\t\t\t\t\tentrants: args,\n\t\t\t\t\texits,\n\t\t\t\t\ttype: 'interception', \n\t\t\t\t\tevent: [ this, apiName ]\n\t\t\t\t};\n\t\t\t\treturn intercept( record, () => {\n\t\t\t\t\treturn originalApi.call( this, ...args );\n\t\t\t\t} );\n\t\t\t}\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 // ------\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 * @imports\n */\nimport realdomInit from '@webqit/realdom';\nimport { _internals } from '@webqit/util/js/index.js';\nimport { _merge } from '@webqit/util/obj/index.js';\n\nexport const _ = ( ...args ) => _internals( 'oohtml', ...args );\n\nexport function _init( name, $config, $defaults ) {\n const _name = name.toUpperCase().replace( '-', '_' );\n const window = this, realdom = realdomInit.call( window );\n window.webqit || ( window.webqit = {} );\n window.webqit.oohtml || ( window.webqit.oohtml = {} );\n window.webqit.oohtml.configs || ( window.webqit.oohtml.configs = {} );\n window.webqit.oohtml.configs[ _name ] || ( window.webqit.oohtml.configs[ _name ] = {} );\n // ---------------------\n _merge( 2, window.webqit.oohtml.configs[ _name ], $defaults, $config, realdom.meta( name ).json() );\n // ---------------------\n return { config: window.webqit.oohtml.configs[ _name ], realdom, window };\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};", "\nexport default function() {\n const window = this;\n return class ContextRequestEvent extends window.Event {\n\n /**\n * @constructor\n */\n constructor( request, callback, { type = 'contextrequest', ...options } = {} ) {\n super( type, options );\n Object.defineProperty( this, 'request', { get: () => request } );\n Object.defineProperty( this, 'callback', { get: () => callback } );\n }\n\n /**\n * @respondWith\n */\n respondWith( response, ...rest ) {\n if ( this.request.diff ) {\n if ( 'previousValue' in this && this.previousValue === response ) return;\n this.previousValue = response;\n }\n return this.callback( response, ...rest );\n }\n };\n}", "\n/**\n * @imports\n */\nimport _ContextRequestEvent from './_ContextRequestEvent.js';\nimport { _ } from '../util.js';\n\nexport default class HTMLContext {\n\n /**\n * @instance\n */\n static instance( host ) {\n return _( host ).get( 'context::instance' ) || new this( host );;\n }\n\n /**\n * @constructor\n */\n constructor( host ) {\n _( host ).get( `context::instance` )?.dispose();\n _( host ).set( `context::instance`, this );\n const priv = { host, contexts: new Set };\n Object.defineProperty( this, '#', { get: () => priv } );\n const ContextRequestEvent = _ContextRequestEvent.call( host.ownerDocument?.defaultView || host.defaultView );\n Object.defineProperty( this, 'ContextRequestEvent', { get: () => ContextRequestEvent } );\n this[ Symbol.iterator ] = function*() {\n const it = priv.contexts[ Symbol.iterator ]();\n yield it.next().value;\n }\n }\n\n /**\n * @length()\n */\n get length() {\n this[ '#' ].contexts.size;\n }\n\n /**\n * @find()\n */\n findProvider( callback ) {\n return [ ...this[ '#' ].contexts ].find( callback );\n }\n\n /**\n * @attachProvider()\n */\n attachProvider( context ) {\n this[ '#' ].contexts.add( context );\n context.initialize( this[ '#' ].host );\n }\n\n /**\n * @detachProvider()\n */\n detachProvider( context ) {\n context.dispose( this[ '#' ].host );\n this[ '#' ].contexts.delete( context );\n }\n\n /**\n * @request()\n */\n request( request, callback, options = {} ) {\n return this[ '#' ].host.dispatchEvent(\n new this.ContextRequestEvent( request, callback, { bubbles: true, ...options } )\n );\n }\n\n /**\n * @dispose()\n */\n dispose() {}\n\n}", "\n/**\n * @imports\n */\nimport { _compare } from '../util.js';\nimport HTMLContext from './HTMLContext.js';\n\nexport default class HTMLContextProvider {\n\n /**\n * @config\n */\n static get config() {\n return {};\n }\n\n /**\n * @attachTo\n */\n static attachTo( host, Id, multiple = false ) {\n let provider, contextMgr = HTMLContext.instance( host );\n if ( !multiple && ( provider = contextMgr.findProvider( cx => this.matchRequest( cx.id, Id, true ) ) ) ) return provider;\n return contextMgr.attachProvider( new this( Id ) );\n }\n\n /**\n * @detachFrom\n */\n static detachFrom( host, Id, multiple = false ) {\n let provider, contextMgr = HTMLContext.instance( host );\n for ( provider of contextMgr[ '#' ].contexts ) {\n if ( !this.matchRequest( provider.id, Id, true ) || ( typeof multiple === 'function' && !multiple( provider ) ) ) continue;\n contextMgr.detachProvider( provider );\n if ( typeof multiple !== 'function' && !multiple ) return provider;\n }\n }\n \n /**\n * @createId\n */\n static createId( host, fields = {} ) {\n const id = { ...fields };\n if ( id.contextName ) return id;\n if ( host.getAttribute && !( id.contextName = ( host.getAttribute( this.config.context.attr.contextname ) || '' ).trim() ) ) {\n delete id.contextName;\n } else if ( !host.ownerDocument ) {\n id.contextName = 'root';\n }\n return id;\n }\n \n /**\n * @createRequest\n */\n static createRequest( fields = {} ) {\n return { ...fields };\n }\n\n /**\n * @matchesRequest\n */\n static matchRequest( id, request, strict = false ) {\n if ( strict ) return _compare( id, request, 1, true );\n return request.type === id.type && !request.contextName || request.contextName === id.contextName;\n }\n\n /**\n * @constructor\n */\n constructor( id ) {\n Object.defineProperty( this, 'id', { get: () => id } );\n Object.defineProperty( this, 'subscriptions', { value: new Set } );\n }\n\n /**\n * @length()\n */\n get length() {\n this.subscriptions.size;\n }\n\n /**\n * @handle()\n */\n handle( event ) {}\n\n /**\n * @subscribe()\n */\n subscribe( event ) {\n this.subscriptions.add( event );\n if ( !event.request.signal ) return;\n event.request.signal.addEventListener( 'abort', () => {\n this.unsubscribe( event );\n } );\n }\n\n /**\n * @unsubscribe()\n */\n unsubscribe( event ) {\n this.subscriptions.delete( event );\n event.request.controller?.abort();\n }\n\n /**\n * @handleEvent()\n */\n handleEvent( event ) {\n if ( this.disposed || ( event.target === this.host && event.request?.superContextOnly )\n || !event.request || typeof event.callback !== 'function' || !this.constructor.matchRequest( this.id, event.request ) ) return;\n event.stopPropagation();\n if ( event.type === 'contextclaim' ) {\n const claims = new Set;\n this.subscriptions.forEach( subscriptionEvent => {\n if ( !event.target.contains( subscriptionEvent.request.superContextOnly ? subscriptionEvent.target.parentNode : subscriptionEvent.target ) \n || !this.constructor.matchRequest( event.request/*provider ID*/, subscriptionEvent.request/*request ID*/ ) ) return;\n this.subscriptions.delete( subscriptionEvent );\n claims.add( subscriptionEvent );\n } );\n event.respondWith( claims );\n } else if ( event.type === 'contextrequest' ) {\n if ( event.request.live ) { this.subscribe( event ); }\n 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 HTMLContext.instance( host ).request( { ...this.id, superContextOnly: true }, claims => claims.forEach( subscriptionEvent => {\n this.subscribe( subscriptionEvent );\n this.handle( subscriptionEvent );\n } ), { type: 'contextclaim' } );\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.unsubscribe( subscriptionEvent );\n const { target, request, callback, options } = subscriptionEvent;\n HTMLContext.instance( target ).request( request, callback, options );\n } );\n return this;\n }\n\n}", "\n/**\n * @imports\n */\nimport Observer from '@webqit/observer';\nimport { _isNumeric } from '@webqit/util/js/index.js';\nimport { getModulesObject } from './index.js';\nimport { _ } from '../util.js';\n\nexport default class _HTMLExportsManager {\n\n /**\n * @instance\n */\n static instance( window, host, config ) {\n return _( host ).get( 'exportsmanager::instance' ) || new this( window, host, config );\n }\n\n /**\n * @constructor\n */\n constructor( window, host, config = {}, parent = null, level = 0 ) {\n _( host ).get( `exportsmanager::instance` )?.dispose();\n _( host ).set( `exportsmanager::instance`, this );\n this.host = host;\n this.window = window;\n this.config = config;\n this.parent = parent;\n this.level = level;\n this.modules = getModulesObject( this.host );\n this.exportId = ( this.host.getAttribute( this.config.template?.attr.moduledef ) || '' ).trim();\n this.validateExportId( this.exportId );\n const realdom = this.window.webqit.realdom;\n // ----------\n this.realtimeA = realdom.realtime( this.host.content ).children( record => {\n this.export( record.entrants, true );\n this.export( 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 exportId\n *\n * @returns Void\n */\n validateExportId( exportId ) {\n if ( [ '@', '/', '*', '#' ].some( token => exportId.includes( token ) ) ) {\n throw new Error( `The export ID \"${ exportId }\" contains an invalid character.` );\n }\n }\n\n /**\n * Maps module contents as exports.\n * \n * @param Array entries\n * @param Bool isConnected\n *\n * @returns Void\n */\n export( entries, isConnected ) {\n let dirty, allFragments = this.modules[ '#' ] || [];\n Observer.batch( this.modules, () => {\n entries.forEach( entry => {\n if ( entry.nodeType !== 1 ) return;\n const isTemplate = entry.matches( this.config.templateSelector );\n const exportId = ( entry.getAttribute( isTemplate ? this.config.template.attr.moduledef : this.config.template.attr.fragmentdef ) || '' ).trim();\n if ( isConnected ) {\n if ( isTemplate && exportId ) { new _HTMLExportsManager( this.window, entry, this.config, this.host, this.level + 1 ); }\n else {\n allFragments.push( entry );\n dirty = true;\n }\n if ( exportId ) {\n this.validateExportId( exportId );\n Observer.set( this.modules, ( !isTemplate && '#' || '' ) + exportId, entry );\n }\n } else {\n if ( isTemplate && exportId ) { _HTMLExportsManager.instance( this.window, entry ).dispose(); }\n else {\n allFragments = allFragments.filter( x => x !== entry );\n dirty = true;\n }\n if ( exportId ) Observer.deleteProperty( this.modules, ( !isTemplate && '#' || '' ) + exportId );\n }\n } );\n if ( dirty ) Observer.set( this.modules, '#', allFragments );\n } );\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 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.modules, '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 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 // The promise\n const controller = new AbortController();\n const fire = ( type, detail ) => this.host.dispatchEvent( new this.window.CustomEvent( type, { detail } ) );\n const request = this.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 let extendedId = ( this.host.getAttribute( this.config.template.attr.extends ) || '' ).trim();\n let inheritedIds = ( this.host.getAttribute( this.config.template.attr.inherits ) || '' ).trim();\n const handleInherited = records => {\n records.forEach( record => {\n if ( Observer.get( this.modules, record.key ) !== record.oldValue ) return;\n if ( [ 'get'/*initial get*/, 'set', 'defineProperty' ].includes( record.type ) ) {\n Observer[ record.type.replace( 'get', 'set' ) ]( this.modules, record.key, record.value );\n } else if ( record.type === 'deleteProperty' ) {\n Observer.deleteProperty( this.modules, record.key );\n }\n } );\n };\n const realtimes = [];\n const parentExportsObj = getModulesObject( this.parent );\n if ( extendedId ) {\n realtimes.push( Observer.reduce( parentExportsObj, [ extendedId, this.config.template.api.modules, Infinity ], Observer.get, handleInherited, { live: true } ) );\n }\n if ( ( inheritedIds = inheritedIds.split( ' ' ).map( id => id.trim() ).filter( x => x ) ).length ) {\n realtimes.push( Observer.get( parentExportsObj, 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.abort() );\n Object.entries( this.modules ).forEach( ( [ key, entry ] ) => {\n if ( key.startsWith( '#' ) ) return;\n _HTMLExportsManager.instance( this.window, entry ).dispose();\n } );\n }\n}\n", "\n/**\n * @imports\n */\nimport Observer from '@webqit/observer';\nimport { HTMLContext, HTMLContextProvider } from '../context-api/index.js';\nimport { getModulesObject } from './index.js';\nimport { _ } from '../util.js';\n\nexport default class _HTMLImportsProvider extends HTMLContextProvider {\n\n /**\n * @createId\n */\n static createId( host, fields = {} ) {\n if ( !( 'type' in fields ) ) fields = { type: 'htmlimports', ...fields };\n return super.createId( host, fields );\n }\n\n /**\n * @createRequest\n */\n static createRequest( fields = {} ) {\n const request = { type: 'htmlimports', ...fields };\n if ( !request.contextName && request.detail?.startsWith( '/' ) ) { request.contextName = 'root'; }\n else if ( request.detail?.startsWith( '@' ) ) {\n const [ contextName, ...detail ] = request.detail.slice( 1 ).split( /(?<=\\w)(?=\\/|#)/ ).map( s => s.trim() );\n request.contextName = contextName;\n request.detail = detail.join( '' );\n }\n return request;\n }\n \n /**\n * @localModules\n */\n get localModules() {\n return getModulesObject( this.host );\n }\n\n /**\n * @handle()\n */\n handle( event ) {\n // Any existing event.request.controller? Abort!\n event.request.controller?.abort();\n\n // Parse and translate detail\n if ( ( event.request.detail || '' ).trim() === '/' ) return event.respondWith( this.localModules );\n const $config = this.constructor.config;\n let path = ( event.request.detail || '' ).split( /\\/|(?<=\\w)(?=#)/g ).map( x => x.trim() ).filter( x => x );\n if ( path.length ) { path = path.join( `/${ $config.template.api.modules }/` )?.split( '/' ) || []; }\n // No detail?\n if ( !path.length ) return event.respondWith();\n \n // We'll now fulfill request\n const options = { live: event.request.live, descripted: true };\n // Find a way to resolve request against two sources\n event.request.controller = Observer.reduce( this.localModules, path, Observer.get, ( result, { signal } = {} ) => {\n const _result = Array.isArray( result ) ? result : result.value;\n const _isValidResult = Array.isArray( result ) ? result.length : result.value;\n if ( !_isValidResult && this.host.isConnected === false ) return; // Subtree is being disposed\n if ( _isValidResult || !this.contextModules ) return event.respondWith( _result );\n // This superModules binding is automatically aborted by the injected control.signal; see below\n return Observer.reduce( this.contextModules, path, Observer.get, result => {\n return event.respondWith( Array.isArray( result ) ? result : result.value );\n }, { signal, ...options } );\n }, options );\n }\n\n /**\n * @startRealtime()\n */\n realtimeSources( host ) {\n this.host = host;\n // ----------------\n const update = () => {\n for ( const subscriptionEvent of this.subscriptions ) {\n this.handle( subscriptionEvent );\n }\n };\n // ----------------\n const $config = this.constructor.config;\n if ( !this.host.matches || !$config.context.attr.importscontext ) return;\n // Any existing this.refdSourceController? Abort!\n this.refdSourceController?.disconnect();\n const realdom = this.host.ownerDocument.defaultView.webqit.realdom;\n this.refdSourceController = realdom.realtime( this.host ).attr( $config.context.attr.importscontext, ( record, { signal } ) => {\n // No importscontext attr set. But we're still watching\n if ( !record.value ) {\n this.contextModules = undefined;\n return update();\n }\n // This superModules contextrequest is automatically aborted by the injected signal below\n const request = this.constructor.createRequest( { detail: record.value.trim(), live: true, signal, superContextOnly: true } );\n HTMLContext.instance( this.host ).request( request, response => {\n this.contextModules = !( response && Object.getPrototypeOf( response ) ) ? response : getModulesObject( response );\n update();\n } );\n }, { live: true, timing: 'sync', lifecycleSignals: true } );\n }\n\n /**\n * @initialize()\n */\n initialize( host ) {\n // If host has importscontext attr, compute that\n this.realtimeSources( host );\n // Now, listen for contextrequest and contextclaim events\n // And process own claim\n return super.initialize( host );\n }\n \n /**\n * @dispose()\n */\n dispose( host ) {\n // Stop listening for sources\n this.refdSourceController?.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 { HTMLContext } from '../context-api/index.js';\nimport _HTMLImportsContext from './_HTMLImportsProvider.js';\nimport { _ } from '../util.js';\n\n/**\n * Creates the HTMLImportElement class.\n * \n * @param Object config \n * \n * @return HTMLImportElement\n */\nexport default function( config ) {\n const window = this, { realdom } = window.webqit;\n const BaseElement = config.import.tagName.includes( '-' ) ? window.HTMLElement : class {};\n return class HTMLImportElement extends BaseElement {\n \n /**\n * @instance\n * \n * @param HTMLElement node\n * \n * @returns \n */\n static instance( node ) {\n if ( config.import.tagName.includes( '-' ) && ( node instanceof this ) ) return node;\n return _( 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 _( 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 _( anchorNode ).set( 'anchoredNode@imports', this.el );\n };\n\n priv.importRequest = ( callback, signal = null ) => {\n const request = _HTMLImportsContext.createRequest( { detail: priv.moduleRef && !priv.moduleRef.includes( '#' ) ? priv.moduleRef + '#' : priv.moduleRef, live: signal && true, signal } );\n HTMLContext.instance( this.el.isConnected ? this.el.parentNode : priv.anchorNode.parentNode ).request( request, response => {\n callback( ( response instanceof window.HTMLTemplateElement ? [ ...response.content.children ] : (\n Array.isArray( response ) ? response : response && [ response ]\n ) ) || [] );\n } );\n };\n\n priv.hydrate = ( anchorNode, slottedElements ) => {\n // ----------------\n priv.moduleRef = ( this.el.getAttribute( config.import.attr.moduleref ) || '' ).trim();\n priv.setAnchorNode( anchorNode );\n priv.autoRestore( () => {\n slottedElements.forEach( slottedElement => {\n priv.slottedElements.add( slottedElement );\n _( slottedElement ).set( 'slot@imports', this.el );\n } );\n } );\n // ----------------\n priv.hydrationImportRequest = new AbortController;\n priv.importRequest( fragments => {\n if ( priv.originalsRemapped ) { return this.fill( fragments ); }\n const identifiersMap = fragments.map( fragment => ( { el: fragment, fragmentDef: fragment.getAttribute( config.template.attr.fragmentdef ) || '', tagName: fragment.tagName, } ) );\n slottedElements.forEach( slottedElement => {\n const tagName = slottedElement.tagName, fragmentDef = slottedElement.getAttribute( config.template.attr.fragmentdef ) || '';\n const originalsMatch = identifiersMap.filter( fragmentIdentifiers => tagName === fragmentIdentifiers.tagName && fragmentDef === fragmentIdentifiers.fragmentDef );\n if ( originalsMatch.length !== 1 ) return;\n _( slottedElement ).set( 'original@imports', originalsMatch[ 0 ].el );\n } );\n priv.originalsRemapped = true;\n }, priv.hydrationImportRequest.signal );\n };\n\n priv.autoRestore = ( callback = null ) => {\n priv.autoRestoreRealtime?.disconnect();\n if ( callback ) callback();\n if ( !priv.slottedElements.size ) {\n priv.anchorNode.replaceWith( this.el );\n return;\n }\n const autoRestoreRealtime = realdom.realtime( window.document ).observe( [ ...priv.slottedElements ], record => {\n record.exits.forEach( outgoingNode => {\n _( 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 priv.anchorNode.replaceWith( this.el );\n }\n }, { subtree: true, timing: 'sync', generation: 'exits' } );\n priv.autoRestoreRealtime = autoRestoreRealtime;\n };\n\n priv.connectedCallback = () => {\n // In case this is DOM node relocation or induced reinsertion into the DOM\n if ( priv.slottedElements.size ) throw new Error( `Illegal reinsertion into the DOM; import slot is not empty!` );\n // Totally initialize this instance?\n if ( !priv.anchorNode ) { priv.setAnchorNode( this.createAnchorNode() ); }\n if ( priv.moduleRefRealtime ) return;\n priv.moduleRefRealtime = realdom.realtime( this.el ).attr( config.import.attr.moduleref, ( record, { signal } ) => {\n priv.moduleRef = record.value;\n // Below, we ignore first restore from hydration\n priv.importRequest( fragments => !priv.hydrationImportRequest && this.fill( fragments ), signal );\n }, { live: true, timing: 'sync', lifecycleSignals: true } );\n // Must come after\n priv.hydrationImportRequest?.abort();\n priv.hydrationImportRequest = null;\n };\n\n priv.disconnectedCallback = () => {\n priv.hydrationImportRequest?.abort();\n priv.hydrationImportRequest = null;\n if ( priv.anchorNode.isConnected ) return;\n priv.moduleRefRealtime?.disconnect();\n priv.moduleRefRealtime = null;\n };\n }\n\n /**\n * Creates the slot's anchor node.\n *\n * @return Element\n */\n createAnchorNode() {\n if ( !config.isomorphic ) { return window.document.createTextNode( '' ) }\n return window.document.createComment( this.el.outerHTML );\n }\n\n /**\n * Fills the slot with slottableElements\n *\n * @param Iterable slottableElements\n *\n * @return void\n */\n fill( slottableElements ) {\n if ( Array.isArray( slottableElements ) ) { slottableElements = new Set( slottableElements ) }\n this[ '#' ].autoRestore( () => { \n this[ '#' ].slottedElements.forEach( slottedElement => {\n const slottedElementOriginal = _( 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 ( this.el.isConnected && slottableElements.size ) {\n this.el.replaceWith( this[ '#' ].anchorNode );\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( config.template.attr.fragmentdef ) ) {\n slottableElementClone.toggleAttribute( config.template.attr.fragmentdef, true );\n }\n _( slottableElementClone ).set( 'original@imports', slottableElement );\n _( 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}", "\n/**\n * @imports\n */\nimport Observer from '@webqit/observer';\nimport { HTMLContext } from '../context-api/index.js';\nimport _HTMLExportsManager from './_HTMLExportsManager.js';\nimport _HTMLImportElement from './_HTMLImportElement.js';\nimport _HTMLImportsProvider from './_HTMLImportsProvider.js';\nimport { _, _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, realdom, window } = _init.call( this, 'html-imports', $config, {\n template: { attr: { moduledef: 'def', fragmentdef: 'def', extends: 'extends', inherits: 'inherits' }, api: { modules: 'modules', moduledef: 'def' }, },\n context: { attr: { importscontext: 'importscontext', contextname: 'contextname' }, api: { import: 'import' }, },\n import: { tagName: 'import', attr: { moduleref: 'ref' }, },\n staticsensitivity: true,\n isomorphic: true,\n } );\n config.templateSelector = `template[${ window.CSS.escape( config.template.attr.moduledef ) }]`;\n config.ownerContextSelector = [ config.context.attr.contextname, config.context.attr.importscontext ].map( a => `[${ window.CSS.escape( a ) }]` ).join( ',' );\n config.slottedElementsSelector = `[${ window.CSS.escape( config.template.attr.fragmentdef ) }]`;\n window.webqit.HTMLImportElement = _HTMLImportElement.call( window, config );\n window.webqit.HTMLImportsProvider = class extends _HTMLImportsProvider {\n static get config() { return config; }\n };\n window.webqit.Observer = Observer;\n exposeModulesObjects.call( window, config );\n realdom.ready( () => hydration.call( window, config ) );\n realtime.call( window, config );\n}\n\nexport { Observer }\n\n/**\n * Returns the \"exports\" object associated with the given node.\n *\n * @param Element node\n * @param Bool autoCreate\n *\n * @return Object\n */\nexport function getModulesObject( node, autoCreate = true ) {\n\tif ( !_( node ).has( 'modules' ) && autoCreate ) {\n\t\tconst modulesObj = Object.create( null );\n\t\t_( node ).set( 'modules', modulesObj );\n\t}\n\treturn _( node ).get( 'modules' );\n}\n\n/**\n * Exposes HTML Modules with native APIs.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction exposeModulesObjects( config ) {\n const window = this;\n // Assertions\n if ( config.template.api.modules in window.HTMLTemplateElement.prototype ) { throw new Error( `The \"HTMLTemplateElement\" class already has a \"${ config.template.api.modules }\" property!` ); }\n if ( config.template.api.moduledef in window.HTMLTemplateElement.prototype ) { throw new Error( `The \"HTMLTemplateElement\" class already has a \"${ config.template.api.moduledef }\" property!` ); }\n if ( config.context.api.import in window.document ) { throw new Error( `document already has a \"${ config.context.api.import }\" property!` ); }\n if ( config.context.api.import in window.HTMLElement.prototype ) { throw new Error( `The \"HTMLElement\" class already has a \"${ config.context.api.import }\" property!` ); }\n // Definitions\n Object.defineProperty( window.HTMLTemplateElement.prototype, config.template.api.modules, { get: function() {\n return getModulesObject( this );\n } } );\n Object.defineProperty( window.HTMLTemplateElement.prototype, config.template.api.moduledef, { get: function() {\n return this.getAttribute( config.template.attr.moduledef );\n } } );\n Object.defineProperty( window.document, config.context.api.import, { value: function( ref, callback, options = {} ) {\n return importRequest( window.document, ref, callback, options );\n } } );\n Object.defineProperty( window.HTMLElement.prototype, config.context.api.import, { value: function( ref, callback, options = {} ) {\n return importRequest( this, ref, callback, options );\n } } );\n function importRequest( context, ref, callback, options ) {\n const request = _HTMLImportsProvider.createRequest( { detail: ref, ...options } );\n return HTMLContext.instance( context ).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, { realdom, HTMLImportElement, HTMLImportsProvider } = window.webqit;\n // ------------\n // MODULES\n // ------------\n const attachImportsContext = host => {\n const contextId = HTMLImportsProvider.createId( host );\n HTMLImportsProvider.attachTo( host, contextId );\n };\n const detachImportsContext = ( host, force ) => {\n const contextId = HTMLImportsProvider.createId( host );\n HTMLImportsProvider.detachFrom( host, contextId, cx => {\n return force || host.matches && !host.matches( config.ownerContextSelector ) && !Object.keys( cx.localModules ).length;\n } );\n };\n // ------------\n realdom.realtime( window.document ).subtree/*instead of observe(); reason: jsdom timing*/( [ config.templateSelector, config.ownerContextSelector ], record => {\n record.entrants.forEach( entry => {\n if ( entry.matches( config.templateSelector ) ) {\n Object.defineProperty( entry, 'scoped', { value: entry.hasAttribute( 'scoped' ) } ); \n const moduleExport = new _HTMLExportsManager( window, entry, config );\n moduleExport.ownerContext = entry.scoped ? record.target : window.document;\n const ownerContextModulesObj = getModulesObject( moduleExport.ownerContext );\n if ( moduleExport.exportId ) { Observer.set( ownerContextModulesObj, moduleExport.exportId, entry ); }\n // The ownerContext's modulesObj - 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( moduleExport.ownerContext );\n } else {\n attachImportsContext( entry );\n }\n } );\n record.exits.forEach( entry => {\n if ( entry.matches( config.templateSelector ) ) {\n const moduleExport = _HTMLExportsManager.instance( window, entry, config );\n const ownerContextModulesObj = getModulesObject( moduleExport.ownerContext );\n if ( moduleExport.exportId ) { Observer.deleteProperty( ownerContextModulesObj, moduleExport.exportId ); }\n detachImportsContext( moduleExport.ownerContext );\n } else {\n detachImportsContext( entry, true );\n }\n } );\n }, { live: true, timing: 'sync', staticSensitivity: config.staticsensitivity } );\n // ------------\n // IMPORTS\n // ------------\n realdom.realtime( window.document ).subtree/*instead of observe(); reason: jsdom timing*/( config.import.tagName, record => {\n record.entrants.forEach( node => handleRealtime( node, true, record ) );\n record.exits.forEach( node => handleRealtime( node, false, record ) );\n }, { live: true, timing: 'sync' } );\n function handleRealtime( entry, connectedState, record ) {\n const elInstance = HTMLImportElement.instance( entry );\n if ( connectedState ) { elInstance[ '#' ].connectedCallback(); }\n else { elInstance[ '#' ].disconnectedCallback(); }\n }\n}\n\n/**\n * Performs hydration for server-slotted elements.\n *\n * @param Object config\n *\n * @return Void\n */\nfunction hydration( config ) {\n const window = this, { HTMLImportElement } = window.webqit;\n function scan( context ) {\n const slottedElements = new Set;\n context.childNodes.forEach( node => {\n if ( node.nodeType === 1/** ELEMENT_NODE */ ) {\n if ( !node.matches( config.slottedElementsSelector ) ) return;\n if ( _( node ).get( 'slot@imports' ) ) return;\n slottedElements.add( node );\n } else if ( node.nodeType === 8/** COMMENT_NODE */ ) {\n const nodeValue = node.nodeValue.trim();\n if ( !nodeValue.startsWith( '<' + config.import.tagName ) ) return;\n if ( !nodeValue.endsWith( '</' + config.import.tagName + '>' ) ) return;\n const reviver = window.document.createElement( 'div' );\n reviver.innerHTML = nodeValue;\n const importEl = reviver.firstChild;\n if ( !importEl.matches( config.import.tagName ) ) return;\n HTMLImportElement.instance( importEl )[ '#' ].hydrate(\n node/* the comment node */, slottedElements\n );\n slottedElements.clear();\n }\n } );\n }\n Array.from( window.document.querySelectorAll( config.slottedElementsSelector ) ).forEach( slottedElement => {\n // hydration() might be running AFTER certain <slots> have resolved\n // and slottedElement might be a just-resolved node\n if ( _( slottedElement ).get( 'slot@imports' ) ) return;\n if ( _( slottedElement.parentNode ).get( 'alreadyscanned@imports' ) ) return;\n scan( slottedElement.parentNode );\n // Scanning is once for every parent\n _( slottedElement.parentNode ).set( 'alreadyscanned@imports', true );\n } );\n}\n", "\n/**\n * @imports\n */\nimport init from './index.js';\n\n/**\n * @init\n */\ninit.call( window );"],
|
|
5
|
+
"mappings": "mGAAA,6ZCQe,WAAS,EAAK,CAC5B,MAAO,CAAC,MAAM,QAAQ,CAAG,GAAK,MAAO,IAAQ,UAAY,CAC1D,CCFe,WAAS,EAAK,CAC5B,MAAO,OAAO,EACf,CCFe,WAAS,EAAK,CAC5B,MAAO,OAAM,QAAQ,CAAG,CACzB,CCMe,YAAS,EAAK,EAAM,EAAW,KAAM,CACnD,MAAO,AAAC,GAAS,CAAI,EAAS,EAAI,OAAO,GAAQ,EAC9C,EAAK,OAAO,GAAQ,EAAS,EAAM,CAAI,CAAC,EAAE,OAC1C,EAAK,QAAQ,CAAI,IAAM,EAC1B,EAHyB,CAAC,CAI3B,CCRe,WAAmB,KAAQ,EAAY,CAKlD,GAJK,WAAW,QAAU,YAAW,OAAS,CAAC,GAC1C,WAAW,OAAO,MACnB,OAAO,eAAe,WAAW,OAAQ,OAAQ,CAAC,MAAO,GAAI,GAAa,CAAC,EAE3E,CAAC,UAAU,OAAQ,MAAO,YAAW,OAAO,KAChD,GAAI,GAAQ,WAAW,OAAO,KAAK,IAAI,CAAG,EAC1C,AAAK,GACD,GAAQ,GAAI,IACZ,WAAW,OAAO,KAAK,IAAI,EAAK,CAAK,GAEzC,GAAI,GAAK,EACT,KAAQ,EAAM,EAAW,MAAM,GAC3B,AAAK,GAAS,IAAU,CAAE,GAAQ,EAAM,IAAI,CAAG,IAC3C,GAAQ,GAAI,IACZ,EAAO,IAAI,EAAK,CAAK,GAG7B,MAAO,EACX,CAEA,GAAM,IAAN,aAA4B,IAAI,CAC5B,eAAgB,EAAO,CACnB,MAAO,GAAG,CAAK,EACf,KAAK,UAAY,GAAI,IACzB,CACA,IAAK,EAAK,EAAQ,CACd,GAAI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