spyne 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"spyne.esm.js","sources":["../src/spyne/utils/spyne-utils-channel-route-url.js","../src/spyne/utils/spyne-utils-channel-route.js","../src/spyne/utils/spyne-plugins-methods.js","../src/spyne/utils/deep-merge.js","../src/spyne/utils/spyne-app-properties.js","../src/spyne/channels/channels-config.js","../src/spyne/utils/safe-clone.js","../src/spyne/channels/channel-payload-class.js","../src/spyne/utils/mixins/base-core-mixins.js","../src/spyne/utils/frp-tools.js","../src/spyne/utils/spyne-warn.js","../src/spyne/utils/sanitize-data.js","../src/spyne/utils/sanitize-html.js","../src/spyne/views/dom-element-template.js","../src/spyne/views/dom-element.js","../src/spyne/utils/viewstream-animations.js","../node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../node_modules/rxjs/dist/esm5/internal/util/lift.js","../node_modules/tslib/tslib.es6.mjs","../node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js","../node_modules/rxjs/dist/esm5/internal/util/isPromise.js","../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../node_modules/rxjs/dist/esm5/internal/Subscription.js","../node_modules/rxjs/dist/esm5/internal/config.js","../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../node_modules/rxjs/dist/esm5/internal/util/noop.js","../node_modules/rxjs/dist/esm5/internal/NotificationFactories.js","../node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../node_modules/rxjs/dist/esm5/internal/Subscriber.js","../node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../node_modules/rxjs/dist/esm5/internal/util/identity.js","../node_modules/rxjs/dist/esm5/internal/util/pipe.js","../node_modules/rxjs/dist/esm5/internal/Observable.js","../node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js","../node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js","../node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js","../node_modules/rxjs/dist/esm5/internal/symbol/iterator.js","../node_modules/rxjs/dist/esm5/internal/util/isIterable.js","../node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js","../node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js","../node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../node_modules/rxjs/dist/esm5/internal/scheduler/Action.js","../node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js","../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js","../node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","../node_modules/rxjs/dist/esm5/internal/Scheduler.js","../node_modules/rxjs/dist/esm5/internal/scheduler/async.js","../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js","../node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js","../node_modules/rxjs/dist/esm5/internal/operators/catchError.js","../node_modules/rxjs/dist/esm5/internal/operators/observeOn.js","../node_modules/rxjs/dist/esm5/internal/operators/subscribeOn.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js","../node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js","../node_modules/rxjs/dist/esm5/internal/operators/map.js","../node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js","../node_modules/rxjs/dist/esm5/internal/observable/combineLatest.js","../node_modules/rxjs/dist/esm5/internal/observable/from.js","../node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js","../node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js","../node_modules/rxjs/dist/esm5/internal/util/argsOrArgArray.js","../node_modules/rxjs/dist/esm5/internal/operators/combineLatest.js","../node_modules/rxjs/dist/esm5/internal/util/args.js","../node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../node_modules/rxjs/dist/esm5/internal/Subject.js","../node_modules/rxjs/dist/esm5/internal/operators/debounceTime.js","../node_modules/rxjs/dist/esm5/internal/observable/empty.js","../node_modules/rxjs/dist/esm5/internal/operators/take.js","../node_modules/rxjs/dist/esm5/internal/operators/filter.js","../node_modules/rxjs/dist/esm5/internal/operators/finalize.js","../node_modules/rxjs/dist/esm5/internal/operators/share.js","../node_modules/rxjs/dist/esm5/internal/operators/takeWhile.js","../node_modules/rxjs/dist/esm5/internal/operators/tap.js","../src/spyne/utils/viewstream-observables.js","../src/spyne/views/view-stream-element.js","../src/spyne/utils/gc.js","../src/spyne/views/view-stream-payload.js","../src/spyne/views/view-stream-broadcaster.js","../src/spyne/utils/mixins/base-streams-mixins.js","../src/spyne/utils/channel-payload-filter.js","../src/spyne/views/view-stream-selector.js","../src/spyne/views/view-stream.js","../node_modules/rxjs/dist/esm5/internal/operators/skip.js","../src/spyne/utils/route-channel-updater.js","../src/spyne/channels/channel.js","../node_modules/rxjs/dist/esm5/internal/operators/combineLatestWith.js","../src/spyne/channels/spyne-channel-route.js","../src/spyne/channels/spyne-channel-ui.js","../src/spyne/utils/spyne-utils-channel-window.js","../src/spyne/channels/spyne-channel-window.js","../node_modules/rxjs/dist/esm5/internal/operators/skipWhile.js","../src/spyne/channels/spyne-channel-lifecycle.js","../src/spyne/channels/spyne-channel-ai.js","../src/spyne/channels/channel-proxy.js","../src/spyne/channels/channels-map.js","../src/spyne/utils/spyne-trait.js","../src/spyne/utils/channel-fetch-util.js","../src/spyne/channels/channel-fetch-class.js","../src/spyne/spyne-plugins.js","../src/spyne/spyne-app.js"],"sourcesContent":["import { isEmpty, head, values, compose, prop, complement, isNil, allPass, reduce, filter, equals, toPairs, replace, either, propEq, __, invert, path, zipObj, reject, keys, find, assoc, is, has, when, split, always, concat, join, flatten, map, ifElse, test, findLastIndex, last, defaultTo, fromPairs } from 'ramda'\nimport { SpyneAppProperties } from './spyne-app-properties.js'\n\nexport class SpyneUtilsChannelRouteUrl {\n constructor() {\n /**\n * @module SpyneUtilsChannelRouteUrl\n * @type internal\n *\n * @constructor\n * @desc\n * Internal url methods for the SpyneRouteChannel\n */\n this.checkIfObjIsNotEmptyOrNil = SpyneUtilsChannelRouteUrl.checkIfObjIsNotEmptyOrNil.bind(this)\n }\n\n static checkIfObjIsNotEmptyOrNil(obj) {\n const isNotEmpty = compose(complement(isEmpty), head, values)\n const isNotNil = compose(complement(isNil), head, values)\n const isNotNilAndIsNotEmpty = allPass([isNotEmpty, isNotNil])\n return isNotNilAndIsNotEmpty(obj)\n }\n\n static checkIfParamValueMatchesRegex(paramValue, routeObj) {\n const rejectParamKey = reject(equals('routeName'))\n const keysArr = compose(rejectParamKey, keys)\n const testForRegexMatch = str => test(new RegExp(str), paramValue)\n const checker = compose(find(testForRegexMatch), keysArr)\n const regexMatchStr = checker(routeObj)\n if (is(String, regexMatchStr)) {\n routeObj = assoc(paramValue, prop(regexMatchStr, routeObj), routeObj)\n }\n return routeObj\n }\n\n static formatStrAsWindowLocation(str) {\n const hash = str\n const search = str\n const pathname = str\n return { hash, search, pathname }\n }\n\n static getLocationStrByType(t, isHash = false, loc = window.location) {\n const type = isHash === true ? 'hash' : t\n\n const typeMap = {\n slash: 'pathname',\n query: 'search',\n hash: 'hash'\n }\n const propVal = typeMap[type]\n const str = prop(propVal, loc)\n const checkForSlashAndHash = /^(\\/)?(#)?(\\/)?(.*)$/\n // console.log(\"DATA LOC STR \",{str, loc, prop, type,isHash});\n return str.replace(checkForSlashAndHash, '$4')\n }\n\n static createRouteArrayFromParams(data, route, t = 'slash', paramsFromLoc) {\n const urlArr = []\n const loopThroughParam = (routeObj) => {\n const urlObj = {}\n const keyword = routeObj.routeName // PARAM FORM SPYNE CONFIG\n let paramValFromData = data[keyword] !== undefined ? data[keyword] : prop(keyword, paramsFromLoc) // PULL VALUE FOR THIS PARAM FROM DATA\n const paramValType = typeof (routeObj[paramValFromData])\n\n if (paramValType === 'string') {\n paramValFromData = routeObj[paramValFromData]\n } else if (paramValType === 'undefined') {\n routeObj = this.checkIfParamValueMatchesRegex(paramValFromData, routeObj)\n }\n\n urlObj[keyword] = paramValFromData\n\n if (this.checkIfObjIsNotEmptyOrNil(urlObj)) {\n urlArr.push(urlObj)\n }\n\n const isObject = is(Object, routeObj)\n const objectParamExists = has(paramValFromData, routeObj)\n const objectContainsRoute = has('routePath', routeObj)\n const recursivelyCallLoopBool = objectParamExists && isObject\n if (recursivelyCallLoopBool === true) {\n const newObj = routeObj[paramValFromData]\n if (has('routePath', newObj)) {\n loopThroughParam(newObj.routePath)\n }\n } else if (objectContainsRoute === true && paramValFromData !== undefined) {\n loopThroughParam(routeObj.routePath)\n }\n }\n\n loopThroughParam(route)\n\n return urlArr\n }\n\n static createSlashString(arr) {\n const arrClear = reject(isNil)\n const notUndefined = when(complement(isNil, __), join('/'))\n const stripRegex = replace(/^(\\^*)(.*|^\\$)(\\$)$/, '$2')\n const joiner = compose(stripRegex, notUndefined, arrClear, flatten, map(values))\n return joiner(arr)\n }\n\n static createQueryString(arr) {\n const arrClear = reject(isNil)\n\n const isNotNilAndIsNotEmpty = this.checkIfObjIsNotEmptyOrNil\n\n const createPair = compose(\n join('='),\n flatten,\n toPairs)\n\n const checkPair = ifElse(\n isNotNilAndIsNotEmpty,\n createPair,\n always(undefined)\n )\n\n const mapArrayOfPairs = map(checkPair)\n\n const checkIfStrIsEmpty = when(\n complement(isEmpty),\n concat('?'))\n\n const createQs = compose(\n checkIfStrIsEmpty,\n join('&'),\n arrClear,\n mapArrayOfPairs)\n\n return createQs(arr)\n }\n\n static checkPayloadForRegexOverrides(urlsArr, data, parseString = 'Value') {\n // CHECK IF PAYLOAD HAS ANY OVERRIDES\n const getPropValOverride = (key) => prop(`${key}${parseString}`, data)\n\n // GET ANY POSSIBLE VALUE USING THE CURRENT KEY\n const getOverrideVal = compose(getPropValOverride, head, keys)\n\n // MAP ALL OBJECT VALS TO TEST FOR OVERRIDES\n const mapUrlProps = (prop) => {\n const overrideVal = getOverrideVal(prop)\n\n // console.log(\"override val \",overrideVal, data);\n // if regex value is found\n if (overrideVal !== undefined) {\n return assoc(compose(head, keys)(prop), overrideVal, prop)\n }\n // identity\n return prop\n }\n\n return map(mapUrlProps, urlsArr)\n }\n\n static checkForRouteValWithMultipleVals(urlsArr) {\n // Define the internal method to extract the string before the pipe\n const getStringBeforePipe = (input) => {\n const match = input.match(/^[^|]*/)\n return match ? (match[0] === '^$' ? '' : match[0]) : input\n }\n\n const mapUrlArrObj = (obj) => {\n const pipeReducer = (acc, key) => {\n acc[key] = getStringBeforePipe(obj[key])\n return acc\n }\n\n if (typeof obj === 'object') {\n obj = Object.keys(obj).reduce(pipeReducer, {})\n }\n return obj\n }\n\n if (Array.isArray(urlsArr) === true) {\n return urlsArr.map(mapUrlArrObj)\n }\n\n return urlsArr\n }\n\n static checkForRouteValsPartMatch(urlsArr, data = {}) {\n /**\n * 1. Loop through urlsArr\n * 2. Loop through properties\n * 3. Apply matchGlobPattern to each property value and check for match with data object property\n * 4. Return the updated object with matched values, or keep the original pattern if no match\n */\n\n const matchGlobPattern = (str, globPattern) => {\n const globPatternMatch = (pattern, value) => {\n const escapedPattern = pattern\n .replace(/[-/\\\\^$+?.()|[\\]{}]/g, '\\\\$&') // Escape special characters\n .replace(/\\*/g, '[\\\\w\\\\d_-]*') // * should match any sequence of alphanumeric, underscores, or dashes\n\n const regexPattern = new RegExp(`^${escapedPattern}$`) // Match the full string\n return regexPattern.test(value)\n }\n\n // Split the globPattern by pipe (|)\n const patterns = globPattern.split('|')\n\n // Check if the string matches any of the patterns\n const hasMatch = patterns.some((pattern) => globPatternMatch(pattern, str))\n\n // Return the string if there's a match, otherwise return the glob pattern\n return hasMatch ? str : globPattern\n }\n\n // Function to check and replace matching properties\n const replaceMatchingProperty = (obj) => {\n const updatedObj = { ...obj } // Create a copy of the object to avoid mutation\n\n // Function to check each property and apply matchGlobPattern\n const checkAndReplaceProperty = (key) => {\n if (Object.prototype.hasOwnProperty.call(updatedObj, key) && data[key]) {\n updatedObj[key] = matchGlobPattern(data[key], updatedObj[key])\n }\n }\n\n // Loop through the properties of the object\n Object.keys(updatedObj).forEach(checkAndReplaceProperty)\n\n return updatedObj\n }\n\n // Loop through the array and replace matching properties\n return urlsArr.map(replaceMatchingProperty)\n }\n\n static convertParamsToRoute(data, r = SpyneAppProperties.config.channels.ROUTE, t, locStr) {\n const urlType = t !== undefined ? t : r.type\n const isHash = r.isHash\n const route = r.routes.routePath\n const locationStr = locStr !== undefined ? locStr : this.getLocationStrByType(urlType, isHash)\n const paramsFromCurrentLocation = this.convertRouteToParams(locationStr, r, urlType).routeData\n let urlArr = this.createRouteArrayFromParams(data, route, urlType, paramsFromCurrentLocation)\n\n urlArr = SpyneUtilsChannelRouteUrl.checkPayloadForRegexOverrides(urlArr, data)\n urlArr = SpyneUtilsChannelRouteUrl.checkForRouteValWithMultipleVals(urlArr)\n // THIS WILL MATCH EXACTLY THE PROPERTY ID, SO pageId=\"dashboard_1\" will return that instead of globPattern[0]\n // urlArr = SpyneUtilsChannelRouteUrl.checkForRouteValsPartMatch(urlArr, data)\n // console.log('PARAMS TO ROUTE ', { data, r, urlArr, locationStr, paramsFromCurrentLocation })\n\n // THIS CREATES A QUERY PATH STR\n if (urlType === 'query') {\n return this.createQueryString(urlArr)\n }\n\n return this.createSlashString(urlArr)\n }\n\n static findIndexOfMatchedStringOrRegex(mainStr, paramsArr) {\n const is404 = paramsArr.includes('.+')\n\n const reFn = (s) => {\n if (is404) {\n if (!s.startsWith('^')) {\n s = '^' + s\n }\n if (!s.endsWith('$')) {\n s = s + '$'\n }\n }\n\n return new RegExp(s)\n }\n\n const checkForEmpty = replace(/^$/, '^$')\n const createStrRegexTest = (str) => {\n return {\n str,\n re: reFn(str)\n }\n }\n\n const checkForEitherStrOrReMatch = either(\n propEq(mainStr, 'str'), compose(test(__, mainStr), prop('re'))\n )\n\n const findMatchIndex = compose(findLastIndex(equals(true)), map(checkForEitherStrOrReMatch), map(createStrRegexTest), map(checkForEmpty))\n\n return findMatchIndex(paramsArr)\n }\n\n static checkIfValueShouldMapToParam(obj, str, regexTokens) {\n //\n //\n // THIS IS A VERY IMPORTANT METHOD\n // IT COMPARES THE STRING TO BE MATCHED WITH THE ROUTE PATH OBJECT\n // AND IT WILL RETURN ONE OF THREE THINGS\n // 1. THE STRING ITSELF\n // 2. A MATCHING KEY FROM THE CURRENT OBJECT\n // 3. THE ROUTENAME\n //\n\n // GO THROUGH KEYS AND CHECK IF REGEX MATCHES\n\n // GO THROUGH ROUTE CONFIG TO FIGURE OUT IF VAL OR KEY SHOULD BE COMPARED\n // if the value is an object, choose the key of the route path to check against\n const getValCompareArr = compose(map(last), map(filter(is(String))), toPairs)\n\n // CREATE THE ARRAY OF EITHER VALS OR KEYS\n const paramsArr = getValCompareArr(obj)\n\n // RESULTS FROM PARAM CHECK\n // let paramIndex = checkForParamsMatch(paramsArr);\n\n const paramIndex = SpyneUtilsChannelRouteUrl.findIndexOfMatchedStringOrRegex(str, paramsArr)\n\n // DEFAULT VAL FOR STRING\n let paramStr = str\n\n // LEGACY METHOD -- TURN OFF\n // WHEN THERE IS A MATCH FROM THE CURRENT ROUTE PATH OBJECT\n if (paramIndex >= 0) {\n const param = paramsArr[paramIndex]\n const invertedObj = invert(obj)\n\n // PULL INVERTED OBJECT TO SEE IF STR MATCHES\n const getParamInverted = compose(head, defaultTo([]), prop(param))\n const paramInverted = getParamInverted(invertedObj)\n // spyne 11.0.1;\n const re = /^([-$\\w]*)$/\n const keyMatch = re.test(paramInverted)\n\n if (keyMatch === true && is(String, paramInverted) === true) {\n paramStr = paramInverted\n }\n }\n\n return paramStr\n }\n\n static createArrFromSlashStr(str) {\n const slashRe = /^([/])?(.*)$/\n return str.replace(slashRe, '$2').split('/')\n }\n\n static convertSlashRouteStrToParamsObj(topLevelRoute, str, regexTokens) {\n const routeValue = str\n const valuesArr = this.createArrFromSlashStr(str)\n const paths = []\n const routedValuesArr = []\n let latestObj = topLevelRoute\n const createParamsFromStr = (total, currentValue) => {\n const routeValueStr = this.checkIfValueShouldMapToParam(latestObj, currentValue, regexTokens)\n\n latestObj = this.checkIfParamValueMatchesRegex(currentValue, latestObj)\n const prevPathNotEqCurrentPath = (str) => str !== last(paths)\n\n const isEmptyOrNil = either(isEmpty, isNil)\n\n if (latestObj !== undefined && prevPathNotEqCurrentPath(latestObj.routeName) && isEmptyOrNil(routeValueStr) === false) {\n paths.push(latestObj.routeName)\n routedValuesArr.push(routeValueStr)\n }\n const strPath = [currentValue, 'routePath']\n const routeParamPath = ['routePath']\n const objectFromStr = path(strPath, latestObj)\n const objectFromRouteParam = path(routeParamPath, latestObj)\n\n if (objectFromStr !== undefined) {\n latestObj = objectFromStr\n } else if (objectFromRouteParam !== undefined) {\n latestObj = objectFromRouteParam\n }\n }\n\n reduce(createParamsFromStr, 0, valuesArr)\n const routeData = zipObj(paths, routedValuesArr)\n const pathInnermost = this.getLastArrVal(paths)\n return { paths, pathInnermost, routeData, routeValue }\n }\n\n static getLastArrVal(arr) {\n const getLastParam = (a) => last(a) !== undefined ? last(a) : ''\n return getLastParam(arr)\n }\n\n static createDefaultParamFromEmptyStr(topLevelRoute, str) {\n const obj = {}\n const keyword = topLevelRoute.routeName\n obj[keyword] = this.checkIfValueShouldMapToParam(topLevelRoute, str)\n return obj\n }\n\n static convertQueryStrToParams(topLevelRoute, str, regexTokens) {\n const queryRe = /^([?])?(.*)$/\n const routeValue = str\n const strArr = str.replace(queryRe, '$2')\n const convertToParams = compose(map(split('=')), split('&'))\n const paramsArr = convertToParams(strArr)\n let routeData = fromPairs(paramsArr)\n\n let paths = map(head, paramsArr)\n\n if (isEmpty(str) === true) {\n routeData = this.createDefaultParamFromEmptyStr(topLevelRoute, str, regexTokens)\n paths = keys(routeData)\n }\n const pathInnermost = this.getLastArrVal(paths)\n\n return { paths, pathInnermost, routeData, routeValue }\n }\n\n static convertRouteToParams(str, routeConfig, t) {\n const addSlash = (url) => url.replace(/\\/$|$/, '/')\n if (routeConfig === undefined) {\n return {}\n }\n const type = t !== undefined ? t : routeConfig.type\n const regexTokens = defaultTo({}, prop('regexTokens', routeConfig))\n const topLevelRoute = routeConfig.routes.routePath\n\n if (type === 'query') {\n return this.convertQueryStrToParams(topLevelRoute, str)\n }\n str = addSlash(str)\n\n return this.convertSlashRouteStrToParamsObj(topLevelRoute, str, regexTokens)\n }\n}\n","import { fromEventPattern } from 'rxjs'\nimport { last, flatten, clone, pick, prop, pickAll, path, equals, compose, keys, filter, propEq, uniq, map, __, chain, is, includes, fromPairs, reject, mergeDeepRight, mergeRight, test, toPairs, values } from 'ramda'\nimport { SpyneUtilsChannelRouteUrl } from './spyne-utils-channel-route-url.js'\n\nexport class SpyneUtilsChannelRoute {\n constructor() {\n /**\n * @module SpyneUtilsChannelRoute\n * @type internal\n *\n * @constructor\n * @desc\n * Internal utility methods for the SpyneRouteChannel\n *\n */\n this.createPopStateStream = SpyneUtilsChannelRoute.createPopStateStream.bind(this)\n }\n\n static createPopStateStream(subscribeFn) {\n const addHandler = function(handler) {\n window.onpopstate = handler\n }\n const removeHandler = function() {\n window.onpopstate = function() {}\n }\n const popupObs$ = fromEventPattern(addHandler, removeHandler)\n\n popupObs$.subscribe(subscribeFn)\n }\n\n static getLastArrVal(arr) {\n const getLastParam = (a) => last(a) !== undefined ? last(a) : ''\n return getLastParam(arr)\n }\n\n static compareRouteKeywords(obj = {}, arr) {\n const pickValues = (o, a) => a !== undefined ? pick(a, o) : o\n let obj1 = pickValues(obj, arr)\n return {\n pickValues,\n compare: (obj = {}, arr) => {\n const obj2 = pickValues(obj, arr)\n const compareProps = p => {\n const p1 = prop(p, obj1)\n const p2 = prop(p, obj2)\n const same = equals(p1, p2)\n const previousExists = p1 !== undefined\n const nextExists = p2 !== undefined\n const changed = !same\n const added = previousExists === false && nextExists === true\n const removed = previousExists === true && nextExists === false\n // console.log(\"P: \",p,{same, previousExists, nextExists});\n const obj = {}\n obj[p] = { same, changed, added, removed, previousExists, nextExists }\n return obj\n }\n\n const createPred = p => compose(keys, filter(propEq(true, p)))\n\n const getPropsState = compose(map(compareProps), uniq, chain(keys))([obj1, obj2])\n const pathsChanged = chain(createPred('changed'), getPropsState)\n const pathsAdded = chain(createPred('added'), getPropsState)\n const pathsRemoved = chain(createPred('removed'), getPropsState)\n obj1 = obj2\n return { pathsAdded, pathsRemoved, pathsChanged }\n },\n\n getComparer: () => obj1\n\n }\n }\n\n static getRouteArrData(routeArr, paramsArr) {\n const paths = filter(includes(__, routeArr), paramsArr)\n const pathInnermost = SpyneUtilsChannelRoute.getLastArrVal(paths)\n // console.log('arr and routeName ',{paths, pathInnermost});\n return { paths, pathInnermost }\n }\n\n static flattenConfigObject(obj) {\n const go = (obj_) => chain(([k, v]) => {\n if (typeof v === 'object' && v !== null && !Array.isArray(v)) {\n return map(([k_, v_]) => [`${k}.${k_}`, v_], go(v))\n } else {\n return [[k, v]]\n }\n }, toPairs(obj_))\n\n // console.log(\"FLATTEN: \", values(fromPairs(go(obj))));\n return values(fromPairs(go(obj)))\n }\n\n static addRouteDatasets(channelRouteObj) {\n // channelRouteObj.type='query';\n\n function removeUndefined(arr) {\n return arr.map(obj => {\n for (const key in obj) {\n if (key === undefined || key === 'undefined' || obj[key] === undefined) {\n delete obj[key]\n } else if (obj[key] && typeof obj[key] === 'object' && !Array.isArray(obj[key])) {\n // recurse if nested object\n obj[key] = removeUndefined([obj[key]])[0]\n }\n }\n return obj\n })\n }\n\n const { type, isHash } = channelRouteObj\n\n // create href and check to see if need to convert to hash href links\n const getHREF = (obj) => {\n const santizeHREF = str => {\n const hrefRE = /^(.*\\/)([\\w-]*\\/?)(.*)$/gm\n // const hrefRE = /^(.*\\/)([\\w-]*)(.*)$/gm;\n str = str.replace(hrefRE, '$1$2')\n // str = String(str).replace('^$', \"\");\n return str\n }\n\n const headStrVal = type === 'query' ? '' : isHash === true ? '#' : '/'\n const hrefStr = SpyneUtilsChannelRouteUrl.convertParamsToRoute(obj, channelRouteObj)\n return headStrVal + santizeHREF(hrefStr)\n }\n\n // remove special chars from href\n const sanitizeStr = (str) => String(str).replace(/([^A-Za-z0-9-_])/g, '')\n\n // test whether to use key or val\n const isValidStrRE = /^([A-Za-z0-9_-])+$/m\n\n const createInitialValFn = (accMain = [], routePathObj, objAcc = {}) => {\n let { routeName } = routePathObj\n\n const propsReducer = (acc, arrPair) => {\n const [key, val] = arrPair\n const isObject = is(Object, val)\n\n const createTitle = (str) => String(str).replace(/([-_])/g, ' ').toUpperCase()\n\n const getLinkText = str => test(isValidStrRE, str) ? createTitle(str) : key\n\n if (key === 'routeName' || key === '404') {\n return acc\n }\n\n routeName = routeName || prop('routeName', val)\n // console.log(\"THE KEY IS \",{key,val,routeName})\n\n let o = clone(objAcc)\n o[routeName] = sanitizeStr(key)\n\n if (isObject === true) {\n if (keys(o).length === 1) {\n const subRouteName = path(['routePath', 'routeName'], val)\n if (subRouteName) {\n const oBase = clone(o)\n oBase[subRouteName] = ''\n oBase.navLevel = keys(objAcc).length\n oBase.title = getLinkText(key)\n oBase.href = getHREF(oBase)\n acc.push(oBase)\n }\n }\n o = createInitialValFn(accMain, val, o)\n } else {\n o.title = getLinkText(key)\n o.href = getHREF(o)\n }\n o.navLevel = keys(objAcc).length\n acc.push(o)\n return acc\n }\n\n return toPairs(routePathObj).reduce(propsReducer, [])\n }\n\n const reducedArr = createInitialValFn([], channelRouteObj.routes)\n let routeDatasetsArr = flatten(reducedArr)\n routeDatasetsArr = removeUndefined(routeDatasetsArr)\n\n const getNavProps = (datasetsArr) => {\n const exclude = reject(includes(__, ['title', 'href', 'navLevel', 'undefined']))\n const getMainKeys = compose(uniq, exclude, flatten, map(keys))\n return getMainKeys(datasetsArr)\n }\n const routeNamesArr = getNavProps(routeDatasetsArr)\n\n return { routeDatasetsArr, routeNamesArr }\n }\n\n static conformRouteObject(channelRouteObj = {}, add404Props = false) {\n const channelsRoutePath = path(['channels', 'ROUTE'], channelRouteObj)\n let { add404s } = channelsRoutePath !== undefined ? channelsRoutePath : channelRouteObj\n add404s = add404s || add404Props\n const parseRoutePath = (a) => {\n const val = a[1]\n const isArr = is(Array, val)\n if (val === '') {\n a[1] = '^$'\n } else if (isArr) {\n a[1] = val.join('|')\n }\n return a\n }\n\n const transduceConfig = (arr) => {\n const [key, val] = arr\n const obj404 = add404s ? { 404: '.+' } : {}\n const isObj = is(Object, val)\n const isArr = is(Array, val)\n const iterObj = isObj === true && isArr === false\n const isRoutePath = key === 'routePath'\n if (iterObj) {\n arr[1] = configMapperFn(arr[1])\n if (isRoutePath) {\n arr[1] = compose(mergeDeepRight(obj404), fromPairs, map(parseRoutePath), toPairs)(arr[1])\n }\n }\n return arr\n }\n\n const configMapperFn = compose(fromPairs, map(transduceConfig), toPairs)\n\n if (channelsRoutePath !== undefined) {\n channelRouteObj.channels.ROUTE = configMapperFn(channelRouteObj.channels.ROUTE)\n const extraRouteData = SpyneUtilsChannelRoute.addRouteDatasets(channelRouteObj.channels.ROUTE)\n channelRouteObj.channels.ROUTE = mergeRight(channelRouteObj.channels.ROUTE, extraRouteData)\n return channelRouteObj\n }\n\n return configMapperFn(channelRouteObj)\n }\n\n static getLocationData() {\n const locationParamsArr = [\n 'href',\n 'origin',\n 'protocol',\n 'host',\n 'hostname',\n 'port',\n 'pathname',\n 'search',\n 'hash']\n return pickAll(locationParamsArr, window.location)\n }\n}\n","import { allPass, compose, is, keys, not, prop } from 'ramda'\n\nconst _pluginMethodsObj = Object.create({})\n\nconst isNotArr = compose(not, is(Array))\n// const isNotEmpty = compose(not, isEmpty)\n// const isNonEmptyStr = allPass([is(String), isNotEmpty])\n// const isNonEmptyArr = allPass([is(Array), isNotEmpty])\nconst isObjectFn = compose(allPass([isNotArr, is(Object)]))\n// const isNonEmptyObjectFn = compose(allPass([isNotEmpty, isNotArr, is(Object)]))\n\nexport class SpynePluginsMethods {\n constructor() {\n _pluginMethodsObj.foo = () => console.log('used for testing purposes.')\n }\n\n addMethod(key, fn, test = false) {\n if (Object.prototype.hasOwnProperty.call(_pluginMethodsObj, key) === true) {\n const warnStr = `Spyne Warning: the method name, ${key}, already exists.`\n if (test) {\n return warnStr\n }\n console.warn(warnStr)\n } else {\n _pluginMethodsObj[key] = fn\n }\n }\n\n addMethods(methodsObj = {}, test = false) {\n let warnStr\n\n const isObj = isObjectFn(methodsObj)\n\n if (isObj === false) {\n warnStr = `Spyne Warning: the pluginMethods property, ${JSON.stringify(methodsObj)} needs to be an object.`\n if (test) {\n return warnStr\n }\n console.warn(warnStr)\n return\n }\n\n const checkEachKeyForValidMethod = (keyStr) => {\n const methodVal = prop(keyStr, methodsObj)\n\n const isFunction = typeof (methodVal) === 'function'\n\n if (isFunction) {\n this.addMethod(keyStr, methodVal, test)\n } else {\n warnStr = `the value for ${keyStr} is not a valid function.`\n if (test) {\n return warnStr\n } else {\n console.warn(warnStr)\n }\n }\n }\n\n const methodKeys = keys(methodsObj)\n\n return methodKeys.map(checkEachKeyForValidMethod).join(',')\n }\n\n checkIfMethodExists(key) {\n\n }\n\n get pluginMethodsObj() {\n return _pluginMethodsObj\n }\n}\n","function isMergeableObject(val) {\n const nonNullObject = val && typeof val === 'object'\n return nonNullObject && Object.prototype.toString.call(val) !== '[object RegExp]' && Object.prototype.toString.call(val) !== '[object Date]'\n}\n\nfunction emptyTarget(val) {\n return Array.isArray(val) ? [] : {}\n}\n\nfunction cloneIfNecessary(value, optionsArgument) {\n const clone = optionsArgument && optionsArgument.clone === true\n return (clone && isMergeableObject(value))\n ? deepMerge(emptyTarget(value),\n value, optionsArgument)\n : value\n}\n\nfunction defaultArrayMerge(target, source, optionsArgument) {\n const destination = target.slice()\n source.forEach(function(e, i) {\n if (typeof destination[i] === 'undefined') {\n destination[i] = cloneIfNecessary(e, optionsArgument)\n } else if (isMergeableObject(e)) {\n destination[i] = deepMerge(target[i], e, optionsArgument)\n } else if (target.indexOf(e) === -1) {\n destination.push(cloneIfNecessary(e, optionsArgument))\n }\n })\n return destination\n}\n\nfunction mergeObject(target, source, optionsArgument) {\n const destination = {}\n if (isMergeableObject(target)) {\n Object.keys(target).forEach(function(key) {\n destination[key] = cloneIfNecessary(target[key], optionsArgument)\n })\n }\n Object.keys(source).forEach(function(key) {\n if (!isMergeableObject(source[key]) || !target[key]) {\n destination[key] = cloneIfNecessary(source[key], optionsArgument)\n } else {\n destination[key] = deepMerge(target[key], source[key], optionsArgument)\n }\n })\n return destination\n}\n\nfunction deepMerge(target, source, optionsArgument) {\n const array = Array.isArray(source)\n const options = optionsArgument || { arrayMerge: defaultArrayMerge }\n const arrayMerge = options.arrayMerge || defaultArrayMerge\n\n if (array) {\n return Array.isArray(target)\n ? arrayMerge(target, source, optionsArgument)\n : cloneIfNecessary(source, optionsArgument)\n } else {\n return mergeObject(target, source, optionsArgument)\n }\n}\n\ndeepMerge.all = function deepmergeAll(array, optionsArgument) {\n if (!Array.isArray(array) || array.length < 2) {\n throw new Error(\n 'first argument should be an array with at least two elements')\n }\n\n // we are sure there are at least 2 values, so it is safe to have no initial value\n return array.reduce(function(prev, next) {\n return deepMerge(prev, next, optionsArgument)\n })\n}\n\nexport { deepMerge }\n","import { SpyneUtilsChannelRoute } from './spyne-utils-channel-route.js'\nimport { SpyneUtilsChannelRouteUrl } from './spyne-utils-channel-route-url.js'\nimport { SpynePluginsMethods } from './spyne-plugins-methods.js'\nimport { deepMerge } from './deep-merge.js'\n\nlet _config\nlet _channels\nlet _channelsMap\nlet _initialized\nlet _debug = true\nlet _enableCMSProxies = false\nconst _excludeChannelsFromConsole = []\n/* eslint-disable */\nlet _linksData\nlet _navLinks\nlet _IMG_PATH\nconst _doNotTrackChannelsArr = []\nconst _proxiesMap = new Map()\n\nfunction random6Chars() {\n // For simplicity: slice(2, 8) gets 6 random chars from the substring\n return Math.random().toString(36).slice(2, 8);\n}\n\nconst _spynePluginMethods = new SpynePluginsMethods()\n\nclass SpyneAppPropertiesClass {\n constructor() {\n _initialized = false\n }\n\n get channelsMap() {\n return _channelsMap\n }\n\n get initialized() {\n return _initialized\n }\n\n get config() {\n return _config\n }\n\n get debug() {\n return _debug\n }\n\n /**\n * The application's sanitization mode, set via config.mode in SpyneApp.init.\n * 'app' (default) is the strict production posture; 'richtext' (aliases:\n * 'authoring', 'development') is the permissive posture for CMS and\n * authoring tools.\n */\n get mode() {\n return _config?.mode !== undefined ? _config.mode : 'app'\n }\n\n /**\n * This is mostly used for debugging purposes\n *\n * @example\n * TITLE['<h4>Listing the registereed Channels in the browser console</h4>']\n * SpyneApp.listChannels();\n *\n * @returns A list of all registered channels\n */\n static listChannels() {\n return Array.from(_channels.map.keys())\n }\n\n initialize(defaultConfig = {}, config = {}, channelsMap, routeUtils) {\n _channels = channelsMap\n _config = deepMerge(defaultConfig, config)\n // console.log(\"config is \", { defaultConfig,config });\n if (_config.channels && _config.channels.ROUTE) {\n // _config = SpyneUtilsChannelRoute.conformRouteObject(_config)\n _config = routeUtils.conformRouteObject(_config)\n }\n _IMG_PATH = _config?.IMG_PATH\n _debug = _config.debug !== undefined ? _config.debug : _debug\n this.getChannelActions = _channels.getChannelActions.bind(_channels)\n this.listRegisteredChannels = _channels.listRegisteredChannels.bind(_channels)\n _initialized = true\n this._initialized = _initialized\n this.setChannelsMap()\n if (config?.baseHref) {\n this.setHeadBaseHref(config.baseHref)\n }\n return _config\n }\n\n setHeadBaseHref(str) {\n // Create a new base element\n const baseTag = document.createElement('base')\n // Set the href attribute to the desired base URL\n baseTag.href = str // You can set this to any base URL\n // Append the base element to the head section of the document\n document.head.appendChild(baseTag)\n }\n\n conformRouteConfig(add404Props = false) {\n /**\n * THIS METHOD IS PRIMARILY USED FOR SPA GEN SITE GENERATION\n */\n\n // eslint-disable-next-line no-undef\n _config = SpyneUtilsChannelRoute.conformRouteObject(_config, add404Props)\n }\n\n setChannelsMap() {\n const getStream = _channels.getStream.bind(_channels)\n const testStream = _channels.testStream.bind(_channels)\n const getProxySubject = _channels.getProxySubject.bind(_channels)\n\n _channelsMap = { getStream, testStream, getProxySubject }\n }\n\n// ──────────────────────────────────────────────────────────────────────────\n// FIXED: durable setProp/getProp + isolated ephemeral (read-once) tier\n//\n// Contract after fix:\n// setProp(key, val) → durable. Persists for the app lifespan.\n// Returns val.\n// setProp(key, val, true) → ephemeral. Read-once via getProp. Returns val.\n// createTempProp(val) → ephemeral with generated key. Returns the key.\n// getProp(key) → returns durable value if present;\n// otherwise returns ephemeral value ONCE,\n// then deletes it. The two tiers cannot\n// shadow each other.\n// ──────────────────────────────────────────────────────────────────────────\n\n setProp(key, val, isTemp = false) {\n if (isTemp) {\n _config.ephemeralProps[key] = val;\n } else {\n _config.tmpProps[key] = val;\n }\n return val; // FIX 2: both tiers return the stored value\n }\n\n getProp(key) {\n // FIX 1+3: durable tier resolves FIRST and independently. A durable value\n // can never be shadowed or consumed by a same-named ephemeral key.\n if (_config?.tmpProps && Object.prototype.hasOwnProperty.call(_config.tmpProps, key)) {\n return _config.tmpProps[key];\n }\n // Ephemeral tier: read-once. Only reached when no durable value exists.\n if (_config?.ephemeralProps && Object.prototype.hasOwnProperty.call(_config.ephemeralProps, key)) {\n const tempVal = _config.ephemeralProps[key];\n delete _config.ephemeralProps[key];\n return tempVal;\n }\n return undefined;\n }\n\n createTempProp(value) {\n const key = random6Chars();\n this.setProp(key, value, true); // isTemp = true\n return key; // returns key (correct — caller needs it to read back)\n }\n\n\n setChannelConfig(channelName, config) {\n _config.channels[channelName] = config\n return _config.channels[channelName]\n }\n\n /**\n * This method is useful to check in the console or in the code what actions are available to be listened to.\n * @param {String} channelName\n * @returns {Array} An array of Actions that can be listened to\n */\n /* getChannelActions(channelName) {\n return _channels.getChannelActions(channelName);\n } */\n\n getChannelConfig(channelName, config = _config) {\n if (channelName === 'CHANNEL_ROUTE') {\n channelName = 'ROUTE'\n } else if (channelName === 'CHANNEL_WINDOW') {\n channelName = 'WINDOW'\n }\n\n if (config === undefined || _config.channels === undefined) {\n console.warn('Spyne warning: Spyne config object is empty!')\n return\n }\n\n const channelConfig = _config.channels[channelName]\n\n if (channelConfig === undefined) {\n console.warn(`Spyne warning: Spyne configuration for channel, ${channelName} is empty!`)\n return\n }\n\n return channelConfig\n }\n\n registerChannel() {\n\n }\n\n addPluginConfig(pluginName, pluginConfig = {}) {\n if (_config.plugins === undefined) {\n _config.plugins = {}\n }\n this.addPluginMethods(pluginConfig.pluginMethods)\n\n _config.plugins[pluginName] = pluginConfig\n }\n\n getPluginsMethodObj(pluginMethodsObj) {\n if (pluginMethodsObj) {\n this.addPluginMethods(pluginMethodsObj)\n }\n\n return _spynePluginMethods.pluginMethodsObj\n }\n\n addPluginMethods(pluginMethods) {\n if (pluginMethods) {\n _spynePluginMethods.addMethods(pluginMethods)\n }\n }\n\n doNotTrackChannel(channelName) {\n _doNotTrackChannelsArr.push(channelName)\n }\n\n getUntrackedChannelsList() {\n return _doNotTrackChannelsArr\n }\n\n registerProxyReviver(name, method) {\n _proxiesMap.set(name, method)\n // console.log(\"REGISTERD PROXY REVIVER\",_proxiesMap, _proxiesMap.get(name));\n }\n\n // This is the new method you add\n registerPlugin(pluginInstance) {\n if (!this._initialized) {\n console.warn('SpyneApp is not initialized yet. Plugin will not be fully registered.')\n }\n // console.log(\"INSTANCE \",this, pluginInstance)\n\n pluginInstance.register(this)\n }\n\n getProxyReviver(proxyName) {\n return _proxiesMap.get(proxyName)\n }\n\n getPluginConfigByPluginName(pluginName) {\n return _config.plugins[pluginName]\n }\n\n get IMG_PATH() {\n return _IMG_PATH\n }\n\n get excludeChannelsFromConsole() {\n return _excludeChannelsFromConsole\n }\n\n // Setter for _excludeChannelsFromConsole\n set excludeChannelsFromConsole(value) {\n if (typeof value === 'string') {\n // Push a single string into the array if not already present\n if (!_excludeChannelsFromConsole.includes(value)) {\n _excludeChannelsFromConsole.push(value)\n }\n } else if (Array.isArray(value)) {\n // Merge an array into the existing array, avoiding duplicates\n value.forEach(item => {\n if (typeof item === 'string' && !_excludeChannelsFromConsole.includes(item)) {\n _excludeChannelsFromConsole.push(item)\n }\n })\n } else {\n console.warn('Invalid value provided to excludeChannelsFromConsole. Only strings or arrays are allowed.')\n }\n }\n\n get linksData() {\n console.warn('get links data in SpyneAppProperties is deprecated, use navLinks')\n return _navLinks\n }\n\n set linksData(arr) {\n console.warn('set links data in SpyneAppProperties is deprecated, use navLinks')\n }\n\n get navLinks() {\n return _navLinks\n }\n\n set navLinks(arr) {\n _navLinks = arr\n }\n\n get enableCMSProxies(){\n return _enableCMSProxies\n }\n\n getHrefFromData(routeProps={}){\n\n return SpyneUtilsChannelRouteUrl.convertParamsToRoute(routeProps);\n\n }\n\n set enableCMSProxies(bool=true){\n _enableCMSProxies = Boolean(bool);\n }\n\n setCMSProxyMethod(fn){\n this.enableCMSProxies = true;\n this.formatTemplateForProxyData = fn;\n\n }\n\n tempGetChannelsInstance() {\n\n }\n\n tempGetConfig() {\n\n }\n}\n\nexport const SpyneAppProperties = new SpyneAppPropertiesClass()\n","import { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { compose, path, is } from 'ramda'\nimport { Observable, Subject } from 'rxjs'\n\n// console.log('channels config loaded ',R,Rx);\nconst registeredStreamNames = () => ({\n includes: () => SpyneAppProperties.initialized === true ? SpyneAppProperties.listRegisteredChannels() : ['CHANNEL_ROUTE', 'CHANNEL_UI', 'CHANNEL_WINDOW', 'DISPATCHER']\n\n})\n\n// getGlobalObj().channelsListArr;\nconst registeredSteps = ['LOAD', 'RENDER', 'MOUNT', 'UNMOUNT', 'DISPOSE', 'GARBAGE_COLLECT', 'UPDATE']\nconst registeredLifeStreamTypes = ['parent', 'self', 'child', 'children', 'view']\nconst registeredStreamTypes = ['Observable', 'BehaviorSubject', 'Subject', 'Observer', 'Subscriber', 'FromEventObservable']\nconst registeredActions = ['subscribe', 'combineLatest']\nconst getRxType = (obs) => obs().constructor.name\n// let getObservableType = (obs) => obs.constructor.name;\nconst confirmObservable = (obs) => obs.subscribe !== undefined\n// let pullMainRoute = (str) => str.replace(/^(\\/?)(.*)(\\/)(.*)/g, '$2');\nlet baseValidations = []; let viewInfoValidations = []; let uiValidations = []\nlet lifestreamValidations = []; let stepValidations = []; let stepDisposeValidations = []; let stepUpdateValidations = []\nlet routeValidations = []; let StreamsConfig = []\n\nif (compose !== undefined && Observable !== undefined) {\n// ===========================================================================\n // ALL VALIDATIONS ADD THE BASE VALIDATIONS THROUGH CONCATENATION\n // ===========================================================================\n baseValidations = [\n {\n error: `need to match a valid name within ${registeredStreamTypes}`,\n predicate: payload => registeredStreamNames().includes(payload.name)\n },\n\n {\n error: 'param \\'observable\\' must contain a valid Observable',\n // predicate: payload => registeredStreamTypes.includes(getObservableType(payload.observable))\n predicate: payload => confirmObservable(payload.observable)\n },\n {\n error: 'param action must be a registered action',\n predicate: payload => registeredActions.includes(payload.action)\n }\n\n ]\n // ===========================================================================\n // THESE VALIDATIONS ARE CONCATENATED WHEN THE OBSERVABLE REFERS TO A VIEW\n // ===========================================================================\n viewInfoValidations = [\n {\n error: 'needs vsid number in srcElement',\n predicate: compose(is(String), path(['data', 'srcElement', 'vsid']))\n },\n {\n error: 'needs a id in srcElement',\n predicate: compose(is(String),\n path(['data', 'srcElement', 'id']))\n }\n ]\n\n // ===========================================================================\n // NO SPECIFIC UI VALIDATIONS AT THIS TIME -- IT JUST ADD OTHERS\n // ===========================================================================\n uiValidations = function() {\n const uiValidations = []\n return uiValidations.concat(baseValidations).concat(viewInfoValidations)\n }\n // ===========================================================================\n // NO SPECIFIC LIFESTREAM VALIDATIONS AT THIS TIME -- IT JUST ADD OTHERS\n const lifeStreamValidations = [\n\n {\n error: `need to match a valid name within ${registeredStreamTypes}`,\n predicate: payload => registeredStreamNames().includes(payload.name)\n },\n\n {\n error: `needs one of the following step strings: ${registeredSteps}`,\n predicate: payload => registeredSteps.includes(payload.STEP)\n },\n {\n error: `type needs to one of the following: ${registeredLifeStreamTypes}`,\n predicate: payload => registeredLifeStreamTypes.includes(payload.type)\n },\n\n {\n error: 'viewId needs to be added ',\n predicate: payload => payload.viewId !== undefined\n }\n ]\n\n stepValidations = function() {\n const stepValidations = []\n return stepValidations.concat(lifeStreamValidations)\n }\n\n stepDisposeValidations = function() {\n const stepUpdateValidations = [\n {\n error: 'DISPOSE STEP requires a disposeItem param in the data object',\n predicate: payload => payload.STEP === 'DISPOSE' &&\n payload.data.disposeItems !== undefined\n }\n ]\n return stepUpdateValidations.concat(lifeStreamValidations)\n }\n\n stepUpdateValidations = function() {\n const stepUpdateValidations = [\n {\n error: 'UPDATE STEP requires a data object ',\n predicate: payload => payload.STEP === 'UPDATE' && payload.data !==\n undefined\n }\n ]\n return stepUpdateValidations.concat(lifeStreamValidations)\n }\n // ===========================================================================\n // lifestreamValidations\n // ===========================================================================\n lifestreamValidations = function() {\n return lifeStreamValidations.concat(baseValidations)\n .concat(viewInfoValidations)\n }\n // ===========================================================================\n // HERE IS THE ROUTE VALIDATIONS\n // ===========================================================================\n routeValidations = function() {\n const routeValidations = [\n /*\n *\n {\n error: `needs a valid route string within [${registeredRoutes}]`,\n predicate: payload => registeredRoutes.includes(pullMainRoute(payload.data.navigateTo))\n }\n *\n */\n\n ]\n return routeValidations.concat(baseValidations).concat(viewInfoValidations)\n }\n // ===========================================================================\n /*\n * THE IDEA OF StreamsConfig IS TO COMPLETELY GENERATE ALL APP STREAMS USING THIS OBJECT\n * THIS HAS NOT BEEN IMPLEMENTED -- MAY BE ADDED IN A FUTURE VERSION\n */\n // ===========================================================================\n StreamsConfig = function() {\n const streamValidations = [\n {\n error: 'param \\'name\\' must be of a registered type',\n predicate: payload => registeredStreamNames().includes(payload.name)\n },\n {\n error: 'param \\'observable\\' must contain a valid Observable',\n predicate: payload => registeredStreamTypes.includes(\n getRxType(payload.observable))\n },\n {\n error: 'param action must be a registered action',\n predicate: payload => registeredActions.includes(payload.action)\n }\n\n ]\n\n return {\n streams: [\n {\n init: {\n name: 'DISPATCHER',\n observable: () => new Subject(),\n action: 'subscribe'\n },\n structure: {\n type: String,\n observable: Observable || Subject,\n action: String\n },\n validations: streamValidations\n },\n {\n init: {\n name: 'UBU',\n observable: () => new Subject(),\n action: 'subscribe'\n },\n structure: {\n type: String,\n observable: Observable || Subject,\n action: String\n },\n validations: streamValidations\n }\n ]\n }\n }\n}\nexport {\n stepDisposeValidations, stepUpdateValidations, stepValidations, uiValidations, routeValidations, lifestreamValidations, registeredStreamNames, StreamsConfig\n}\n","import { clone, compose, fromPairs, is, path, toPairs } from 'ramda'\nimport { SpyneAppProperties } from './spyne-app-properties.js'\n\nconst getPropType = (prp) => {\n let type = typeof prp\n if (['number', 'boolean', 'string'].includes(type)) {\n type = 'primitive'\n } else if (type === 'object') {\n if (Array.isArray(prp)) {\n type = 'array'\n } else if (prp === null) {\n type = 'undefined'\n }\n }\n return type\n}\n\nconst cmsDataReviveNestedProxyObj = (proxyObj, proxyReviverMethod) => {\n const { __proxy__proxyName } = proxyObj\n\n if (__proxy__proxyName === undefined) {\n console.error('object is not proxy object ', proxyObj)\n }\n\n const cloneNestedProxyObj = (target, pathArr) => {\n const nestedProxyObj = path(pathArr, proxyObj)\n const { __proxy__isProxy, __proxy__props } = nestedProxyObj\n return __proxy__isProxy ? proxyReviverMethod(target, __proxy__props) : target\n }\n\n const rootObj = cloneNestedProxyObj(clone(proxyObj), [])\n\n const proxyIterable = (iterObj, iterPath) => {\n const dataPath = iterPath || []\n const loopObj = ([key, prop]) => {\n const type = getPropType(prop)\n const clonedPath = [...dataPath]\n clonedPath.push(key)\n if (type === 'object' || type === 'array') {\n iterObj[key] = cloneNestedProxyObj(prop, clonedPath)\n proxyIterable(prop, clonedPath)\n }\n }\n Object.entries(iterObj).forEach(loopObj)\n }\n\n proxyIterable(rootObj)\n // console.timeEnd('proxify2');\n\n return rootObj\n}\n\nexport const safeClone = function(o) {\n const { __proxy__proxyName } = o\n if (__proxy__proxyName !== undefined) {\n const proxyReviverMethod = SpyneAppProperties.getProxyReviver(__proxy__proxyName)\n if (typeof proxyReviverMethod === 'function') {\n return cmsDataReviveNestedProxyObj(o, proxyReviverMethod)\n }\n }\n\n const isArr = is(Array)\n const isObj = is(Object)\n const isIter = ob => isArr(ob) === false && isObj(ob) === true\n const isIterable = isIter(o)\n return isIterable ? compose(fromPairs, toPairs, clone)(o) : clone(o)\n}\n","import {\n mergeAll,\n clone,\n fromPairs,\n toPairs,\n compose,\n includes,\n pickAll,\n lte,\n defaultTo,\n prop,\n is\n} from 'ramda'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { safeClone } from '../utils/safe-clone.js'\n\nexport class ChannelPayload {\n /**\n *\n * All Channel data is published using this interface.\n * @module ChannelPayload\n * @type internal\n *\n * @constructor\n * @param {String} channelName\n * @param {String} action\n * @param {Object} payload\n * @param {Element} srcElement\n * @param {Event} event\n *\n * @property {String} channelName - = undefined; The name of the Channel that is sending the payload.\n * @property {String} action - = undefined; An action string that has been registered within the Channel's addRegisteredActions method.\n * @property {Object} payload - = undefined; The data object.\n * @property {HTMLElement} srcElement - = {}; This is populated when triggered from a ViewStream instance.\n * @property {UIEvent} event - = undefined; The UIEvent, if any.\n * @returns Validated ChannelPayload json object\n */\n constructor(channelName, action, payload, srcElement, event, timeLabel) {\n const channel = channelName\n // payload = ChannelPayload.deepFreeze(payload);\n\n if (timeLabel) {\n console.time(timeLabel)\n }\n\n const channelPayloadItemObj = { channelName, action, srcElement, event }\n // Object.defineProperty(channelPayloadItemObj, 'payload', {get: () => clone(payload)});\n const frozenPayload = ChannelPayload.deepFreeze(payload)\n channelPayloadItemObj.payload = frozenPayload\n /**\n * This is a convenience method that helps with destructuring by merging all properties.\n *\n * @returns\n * JSON Object\n *\n * @example\n * TITLE['<h4>Destructuring Properties using the ChannelPayload props Method</h4>']\n * let {el, action, myVal} = payload.props();\n *\n *\n */\n\n if (SpyneAppProperties.debug === true) {\n if (Object.prototype.hasOwnProperty.call(payload, 'payload')) {\n const payloadStr = JSON.stringify(payload)\n console.warn(`Spyne Warning: the following payload contains a nested payload property which may create conflicts: Action: ${action}, ${payloadStr}`)\n }\n\n const channelActionsArr = SpyneAppProperties.getChannelActions(channel)\n\n ChannelPayload.validateAction(action, channel, channelActionsArr)\n }\n\n channelPayloadItemObj.clone = () => mergeAll([\n { payload:safeClone(channelPayloadItemObj.payload) },\n channelPayloadItemObj.payload,\n { channel: clone(channel) },\n { event: clone(event) },\n { srcElement },\n clone(channelPayloadItemObj.srcElement), { action: clone(channelPayloadItemObj.action) }\n ])\n\n const channelPayloadItemObjProps = {\n $dir: {\n get: () => channelPayloadItemObj._dir,\n set: (val) => {\n channelPayloadItemObj._dir = val\n return val\n }\n }\n }\n\n if (channel === 'CHANNEL_ROUTE') {\n // channelPayloadItemObj['location'] = ChannelPayload.getLocationData();\n channelPayloadItemObjProps.location = {\n get: () => ChannelPayload.getLocationData()\n }\n /* channelPayloadItemObjProps['routeData'] = {\n get: ()=>prop('routeData', frozenPayload)\n }\n*/\n }\n\n channelPayloadItemObj._dir = undefined\n\n Object.defineProperties(channelPayloadItemObj, channelPayloadItemObjProps)\n\n if (timeLabel) {\n console.timeEnd(timeLabel)\n }\n return channelPayloadItemObj\n }\n\n static validateAction(action, channel, arr) {\n const isInArr = includes(action, arr)\n if (isInArr === false && SpyneAppProperties.initialized === true) {\n console.warn(`warning: Action: '${action}' is not registered within the ${channel} channel!`)\n }\n return isInArr\n }\n\n static getLocationData() {\n const locationParamsArr = [\n 'href',\n 'origin',\n 'protocol',\n 'host',\n 'hostname',\n 'port',\n 'pathname',\n 'search',\n 'hash']\n return pickAll(locationParamsArr, window.location)\n }\n\n static getStreamItem() {\n\n }\n\n static deepClone(o) {\n const isArr = is(Array)\n const isObj = is(Object)\n const isIter = ob => isArr(ob) === false && isObj(ob) === true\n const isIterable = isIter(o)\n return isIterable ? compose(fromPairs, toPairs, clone)(o) : clone(o)\n }\n\n static deepFreeze(o) {\n // return o;\n // return Object.freeze(o);\n const elIsDomElement = compose(lte(0), defaultTo(-1), prop('nodeType'))\n\n try {\n Object.freeze(o)\n Object.getOwnPropertyNames(o).forEach(function(prop) {\n if (Object.prototype.hasOwnProperty.call(o, prop) &&\n elIsDomElement(o[prop]) === false &&\n o[prop] !== null &&\n (typeof o[prop] === 'object' || typeof o[prop] === 'function') &&\n !Object.isFrozen(o[prop])) {\n ChannelPayload.deepFreeze(o[prop])\n }\n })\n } catch (e) {\n // console.log(\"FREEZE ERR \",{o,e});\n return o\n }\n\n return o\n }\n\n static getMouseEventKeys() {\n return ['altKey', 'bubbles', 'cancelBubble', 'cancelable', 'clientX', 'clientY', 'composed', 'ctrlKey', 'currentTarget', 'defaultPrevented', 'detail', 'eventPhase', 'fromElement', 'isTrusted', 'layerX', 'layerY', 'metaKey', 'movementX', 'movementY', 'offsetX', 'offsetY', 'pageX', 'pageY', 'path', 'relatedTarget', 'returnValue', 'screenX', 'screenY', 'shiftKey', 'sourceCapabilities', 'srcElement', 'target', 'timeStamp', 'toElement', 'type', 'view', 'which', 'x', 'y']\n }\n}\n","export function baseCoreMixins() {\n return {\n createpropsMap: function() {\n const wm = new WeakMap()\n const objKey = { vsid: this.props.vsid }\n wm.set(objKey, this.props)\n return {\n key: objKey,\n weakMap: wm\n }\n },\n gc: function() {\n for (const m in this) {\n delete this[m]\n }\n delete this\n },\n createId: function() {\n // let num = Math.floor(Math.random(10000000) * 10000000);\n // const num = () => Math.random().toString(36).substring(2, 8);;\n const num = () => Math.random().toString(36).replace(/\\d/gm, '').substring(1, 8)\n return num()\n // return `vsid-${num()}`;\n },\n setTraceFunc: function(debug) {\n return debug === true\n ? console.log\n : () => {\n }\n }\n }\n}\n","import { defaultTo, match, forEach, test, includes, without, complement, isEmpty, values, isNil, filter, __, keys, compose, head, map, cond, T, allPass, concat, uniq } from 'ramda'\nconst isIOS = () => {\n const userAgent = window.navigator.userAgent.toLowerCase()\n // let safari = /safari/.test(userAgent);\n const ios = /iphone|ipod|ipad/.test(userAgent)\n return ios === true\n}\n\nconst delayCall = async(fn, time) => {\n function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms))\n }\n\n const timeoutHandler = async() => {\n await sleep(1)\n window.requestAnimationFrame(fn)\n }\n\n window.setTimeout(timeoutHandler, time)\n}\n\nconst getConstructorName = (obj) => {\n if (obj.constructor.name !== undefined) {\n return obj.constructor.name\n }\n const re = /^(function\\s)(\\w+)(\\(.*)$/\n const str = obj.toString()\n return defaultTo(String(str).substr(0, 12), match(re, str)[2])\n}\n\nconst arrFromMapKeys = (map) => {\n const arr = []\n const addKeysToArr = (v, k, i) => arr.push(k)\n forEach(addKeysToArr, map)\n return arr\n}\n\nconst findStrFromRegexArr = (obj, str) => {\n if (obj[str] !== undefined) {\n return str\n }\n const checkIfMatch = s => test(new RegExp(s), str)\n const checkStrMatch = includes(str)\n const checkIfRegExMatch = compose(includes(true), map(checkIfMatch))\n const runMatchChecks = cond([\n [checkStrMatch, () => str],\n [checkIfRegExMatch, () => str],\n [T, () => undefined]\n ])\n return runMatchChecks(obj)\n}\n\nconst findStrOrRegexMatchStr = (obj, str) => {\n if (obj[str] !== undefined) {\n return str\n }\n const createRe = s => new RegExp(s)\n const checkerIfRegexMatchExists = compose(head, filter(compose(test(__, str), createRe)))\n return checkerIfRegexMatchExists(keys(obj))\n}\n\nconst closest = (array, num) => {\n let i = 0\n let minDiff = 1000\n let ans\n for (i in array) {\n const m = Math.abs(num - array[i])\n if (m < minDiff) {\n minDiff = m\n ans = array[i]\n }\n }\n return ans\n}\n\nconst convertDomStringMapToObj = (domMap) => {\n const obj = {}\n for (const d in domMap) {\n obj[d] = domMap[d]\n }\n return obj\n}\n\n// const passPageData = pick(['params', 'routeId', 'data'], __);\n\nconst subscribeFn = {\n next: x => console.log(`next ${x}`),\n error: x => console.log(`error ${x}`),\n complete: x => console.log(`complete ${x}`)\n}\n\nconst right = x => ({\n map: f => right(f(x)),\n fold: (f, g) => g(x),\n inspect: () => `right(${x})`\n\n})\n\nconst ifNilThenUpdate = (val, newVal) => {\n const isNilBool = isNil(val)\n return isNilBool ? newVal : val\n}\n\nconst left = x => ({\n map: f => left(x),\n fold: (f, g) => f(x),\n inspect: () => `left(${x})`\n})\n\nconst checkIfObjIsNotEmptyOrNil = (obj) => {\n const isNotEmpty = compose(complement(isEmpty), head, values)\n const isNotNil = compose(complement(isNil), head, values)\n const isNotNilAndIsNotEmpty = allPass([isNotEmpty, isNotNil])\n return isNotNilAndIsNotEmpty(obj)\n}\n\nconst fromNullable = x => x !== null ? right(x) : left(null)\n\nconst findInObj = (obj, val, error = null) => {\n const found = obj[val]\n return found ? right(found) : left(error)\n}\nconst pullRouteInfo = () => {\n const str = pullHashAndSlashFromPath(window.location.hash)\n const routeId = pullMainRoute(str)\n const params = pullParams(str)\n return { routeId, params }\n}\n\nfunction getAllMethodNames(instance, omittedMethods = []) {\n // Optionally rename `instance` to something more descriptive:\n const baseClassMethodsArr = ['length', 'name', 'prototype', 'constructor']\n const combinedOmittedMethods = concat(baseClassMethodsArr, omittedMethods)\n\n // Filter out omitted\n const omitPropsFromArr = compose(without(combinedOmittedMethods), uniq)\n\n // Pull out instance methods\n const methods = omitPropsFromArr(\n Object.getOwnPropertyNames(instance.constructor.prototype)\n )\n\n // Pull out static methods\n const staticMethods = omitPropsFromArr(\n Object.getOwnPropertyNames(instance.constructor)\n )\n\n const allMethods = concat(methods, staticMethods)\n\n return { methods, staticMethods, allMethods }\n}\n\n/* const getAllMethodNames3 = (_this = this, omittedMethods = []) => {\n const getPropNamesArr = (obj = this, omittedMethods = []) => {\n return Object.getOwnPropertyNames(obj)\n }\n // Filter Methods\n const baseClassMethodsArr = ['length', 'name', 'prototype', 'constructor']\n omittedMethods = concat(baseClassMethodsArr, omittedMethods)\n const omitPropsFromArr = compose(without(omittedMethods), uniq)\n\n // PULL OUT METHOD NAMES\n const methods = omitPropsFromArr(Object.getOwnPropertyNames(_this.constructor.prototype))\n const staticMethods = omitPropsFromArr(getPropNamesArr(_this.constructor))\n const allMethods = concat(methods, staticMethods)\n\n return { methods, staticMethods, allMethods }\n // return 'fn';\n} */\n\n// ROUTE REGEX EXPRESSIONS\nconst removeSlashes = str => str.replace(/^(\\/)(.*)/g, '$2')\nconst routeRE = /^(\\/?)(\\w*)(\\/?)(.*)/g\nconst pullHashAndSlashFromPath = (str) => str.replace(/^(#\\/?)(.*)/, '$2')\nconst pullSlashFromPath = (str) => str.replace(/^(\\/?)(.*)/, '$2')\nconst pullMainRoute = (str) => str.replace(routeRE, '$2')\nconst pullParams = (str) => str.replace(routeRE, '$4')\nconst pullTranslateX = str => str.replace(/^(matrix)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*)(,.*)/, '$6')\nconst pullTranslateY = str => str.replace(/^(matrix)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d)(.*)/, '$7')\nconst pullTranslateYFromHeader = str => str.replace(/^(transform: matrix)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*)(\\).*;)/, '$6')\nexport { getConstructorName, arrFromMapKeys, getAllMethodNames, findStrOrRegexMatchStr, findStrFromRegexArr, checkIfObjIsNotEmptyOrNil, isIOS, pullRouteInfo, pullTranslateYFromHeader, pullSlashFromPath, pullHashAndSlashFromPath, closest, pullTranslateY, pullTranslateX, pullMainRoute, pullParams, right, left, fromNullable, findInObj, ifNilThenUpdate, removeSlashes, subscribeFn, convertDomStringMapToObj, delayCall }\n","/**\n * Central outlet for SpyneJS developer-hint warnings (invalid selectors,\n * sanitized attributes, policy removals, deprecations).\n *\n * Warnings are suppressed when window.SPYNE_SUPPRESS_WARNINGS is true —\n * primarily for test runs, where expected-failure cases would otherwise\n * flood the reporter. The flag lives on window (not module state) so it\n * spans separately bundled test files.\n *\n * Security-posture warnings (e.g. config.disableSanitize) do NOT route\n * through here and are always printed.\n */\nconst spyneWarn = (...args) => {\n const suppressed = typeof window !== 'undefined' && window.SPYNE_SUPPRESS_WARNINGS === true\n if (suppressed !== true) {\n console.warn(...args)\n }\n}\n\nconst setSpyneWarningsDisabled = (bool = true) => {\n if (typeof window !== 'undefined') {\n window.SPYNE_SUPPRESS_WARNINGS = bool === true\n }\n}\n\nexport { spyneWarn, setSpyneWarningsDisabled }\n","// src/utils/sanitize-data.js\nimport DOMPurify from 'dompurify'\nimport { spyneWarn } from './spyne-warn.js'\nimport { SpyneAppProperties } from './spyne-app-properties.js'\n\nlet _sanitizeData\nlet isConfigured = false\nlet globalDisable = false\nlet forceStrict = false // deprecated legacy toggle, see setSanitizeDataForceStrict\n\n/* ---------------------------------------------\n * URI policy\n *\n * Allows https?, mailto:, tel:, data:image/ and any scheme-less\n * (relative, fragment, query, protocol-relative) URL.\n * All other schemes (javascript:, vbscript:, data:text/html, etc.) fail.\n * ------------------------------------------- */\nconst SAFE_URI_REGEXP = /^(?:(?:https?|mailto|tel):|data:image\\/|(?![a-z][a-z0-9+.-]*:)[\\s\\S]*$)/i\n\n// Browsers strip ASCII control characters and whitespace when parsing URL\n// schemes, so \"jav\\tascript:\" executes. Normalize before testing.\n// eslint-disable-next-line no-control-regex -- matching control chars is the point\nconst normalizeUriForCheck = (val) => String(val).replace(/[\\u0000-\\u0020]/g, '')\n\nconst isSafeUri = (val) => SAFE_URI_REGEXP.test(normalizeUriForCheck(val))\n\n/* ---------------------------------------------\n * Custom elements\n *\n * The framework's own custom elements (spyne-*) are first-party output —\n * the CMS proxy wraps editable content in <spyne-cms-item> etc. — and are\n * admitted in every mode. They are inert without their defining plugin\n * and the attribute check below only admits data-* on them.\n *\n * Additional elements register via allowCustomElements() (additive only;\n * names must contain a hyphen per the custom-element spec, so built-in\n * tags like script or iframe can never be admitted through this path)\n * or via config.customElements at SpyneApp.init.\n * ------------------------------------------- */\nconst SPYNE_CUSTOM_ELEMENT_RE = /^spyne-[a-z][a-z0-9-]*$/i\n\nconst allowedCustomElementPatterns = []\n\nconst allowCustomElements = (elements = []) => {\n const arr = Array.isArray(elements) ? elements : [elements]\n\n arr.forEach((entry) => {\n if (entry instanceof RegExp) {\n allowedCustomElementPatterns.push(entry)\n return\n }\n\n const name = String(entry).toLowerCase()\n if (/^[a-z][a-z0-9]*-[a-z0-9-]+$/.test(name) !== true) {\n spyneWarn(`SPYNE WARNING: \"${entry}\" is not a valid custom element name (a hyphen is required) and was not added to the sanitizer allowlist.`)\n return\n }\n\n allowedCustomElementPatterns.push(name)\n })\n}\n\nconst customElementTagCheck = (tagName) => {\n if (SPYNE_CUSTOM_ELEMENT_RE.test(tagName)) return true\n\n return allowedCustomElementPatterns.some(p =>\n p instanceof RegExp ? p.test(tagName) : p === tagName\n )\n}\n\nconst CUSTOM_ELEMENT_HANDLING = {\n tagNameCheck: customElementTagCheck,\n attributeNameCheck: /^data-[a-z0-9-]+$/i,\n allowCustomizedBuiltInElements: false\n}\n\n/* ---------------------------------------------\n * Mode configurations\n * ------------------------------------------- */\nconst SAFE_FOR_RICH_TEXT = {\n ALLOWED_TAGS: [\n 'a', 'b', 'i', 'em', 'strong', 'u', 'p', 'br', 'ul', 'dl', 'dt', 'dd', 'ol', 'li', 'hr',\n 'blockquote', 'pre', 'code', 'span', 'div', 'section', 'article', 'aside',\n 'header', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',\n 'table', 'thead', 'tbody', 'tr', 'td', 'th', 'img', 'figure', 'figcaption',\n 'video', 'source', 'iframe', 'input', 'button', 'label', 'link'\n ],\n ADD_TAGS: ['iframe', 'input', 'button', 'link'],\n ALLOWED_ATTR: [\n 'href', 'src', 'alt', 'class', 'title', 'width', 'height', 'style', 'target', 'rel',\n 'controls', 'poster', 'type', 'rows', 'cols', 'sandbox'\n ],\n ALLOW_DATA_ATTR: true,\n FORBID_ATTR: ['onerror', 'onload', 'onclick', 'onmouseover', 'onfocus', 'onblur', 'onchange'],\n FORBID_TAGS: ['script', 'object', 'embed', 'meta'],\n ALLOWED_URI_REGEXP: SAFE_URI_REGEXP,\n CUSTOM_ELEMENT_HANDLING\n}\n\nconst SAFE_FOR_APP = {\n FORBID_TAGS: ['script', 'iframe', 'object', 'embed', 'form', 'input', 'button', 'link', 'meta'],\n FORBID_ATTR: ['onerror', 'onload', 'onclick', 'onmouseover', 'onfocus', 'onblur', 'onchange'],\n ALLOW_DATA_ATTR: false,\n ALLOWED_URI_REGEXP: SAFE_URI_REGEXP,\n CUSTOM_ELEMENT_HANDLING\n}\n\n/* ---------------------------------------------\n * Iframe policy\n *\n * Configured via config.iframes at SpyneApp.init:\n * allow — undefined (mode default: richtext yes, app no) | true | false\n * allowedOrigins — [] (any https origin) | ['https://www.youtube.com', ...]\n * sandbox — sandbox value forced onto iframes lacking one; false = never force\n *\n * A per-call override can be passed as opts.iframes to sanitizeData.\n * ------------------------------------------- */\nconst DEFAULT_IFRAME_SANDBOX = 'allow-scripts allow-same-origin allow-popups'\n\nlet configuredIframePolicy = { allow: undefined, allowedOrigins: [], sandbox: DEFAULT_IFRAME_SANDBOX }\nlet activeIframePolicy = configuredIframePolicy\n\nconst resolveIframePolicy = (override) => {\n if (!override) return configuredIframePolicy\n return {\n allow: override.allow !== undefined ? override.allow : configuredIframePolicy.allow,\n allowedOrigins: override.allowedOrigins !== undefined ? override.allowedOrigins : configuredIframePolicy.allowedOrigins,\n sandbox: override.sandbox !== undefined ? override.sandbox : configuredIframePolicy.sandbox\n }\n}\n\nconst iframeAllowedForMode = (mode, policy = activeIframePolicy) => {\n if (policy.allow === undefined) return mode === 'richtext'\n return policy.allow === true\n}\n\n// localhost is a secure context per the platform's own definition.\nconst isTrustworthyLocalHostname = (hostname) =>\n hostname === 'localhost' ||\n hostname === '127.0.0.1' ||\n hostname === '[::1]' ||\n hostname.endsWith('.localhost')\n\nconst isAllowedIframeSrc = (src, policy = activeIframePolicy) => {\n const normalized = normalizeUriForCheck(src)\n\n let resolved\n try {\n resolved = new URL(normalized, window.location.href)\n } catch (e) {\n return false\n }\n\n // Executable/pseudo schemes (javascript:, data:, vbscript:) resolve with\n // an opaque 'null' origin and fail both checks below.\n\n // Same-origin embeds (including relative src) are as trusted as the\n // page itself and always pass, regardless of scheme or allowlist.\n if (resolved.origin === window.location.origin && resolved.origin !== 'null') {\n return true\n }\n\n // Cross-origin embeds must be https, or http on a localhost host\n // (a secure context) to keep local development friction-free.\n const isSecure = resolved.protocol === 'https:' ||\n (resolved.protocol === 'http:' && isTrustworthyLocalHostname(resolved.hostname))\n\n if (isSecure !== true) return false\n\n const origins = policy.allowedOrigins\n if (!Array.isArray(origins) || origins.length === 0) return true\n\n return origins.some(o => {\n try {\n return new URL(o).origin === resolved.origin\n } catch (e) {\n return false\n }\n })\n}\n\nlet iframeHookAdded = false\nconst addIframeHardeningHook = () => {\n if (iframeHookAdded) return\n iframeHookAdded = true\n\n DOMPurify.addHook('afterSanitizeAttributes', (node) => {\n if (!node || node.tagName !== 'IFRAME') return\n\n const src = node.getAttribute('src') || ''\n if (src !== '' && isAllowedIframeSrc(src) !== true) {\n spyneWarn(`SPYNE WARNING: iframe src \"${src}\" was removed by the iframe policy (same-origin, https, or an allowed origin is required).`)\n node.removeAttribute('src')\n }\n\n const { sandbox } = activeIframePolicy\n if (sandbox !== false && node.hasAttribute('sandbox') !== true) {\n node.setAttribute('sandbox', sandbox)\n }\n })\n}\n\n/* ---------------------------------------------\n * Determine sanitization mode\n *\n * Explicit config always wins; the build environment is only a\n * fallback when no mode has been configured.\n * ------------------------------------------- */\nconst RICHTEXT_ALIASES = ['richtext', 'authoring', 'development']\n\nconst resolveDefaultMode = () => {\n const configMode = SpyneAppProperties?.mode\n\n if (RICHTEXT_ALIASES.includes(configMode)) return 'richtext'\n if (configMode === 'app') return 'app'\n\n try {\n if (typeof process !== 'undefined' && process?.env?.NODE_ENV === 'development') {\n return 'richtext'\n }\n } catch (e) {\n // no build-time env available\n }\n\n return 'app'\n}\n\n/* --------------------------------------------- */\nconst buildModeConfig = (mode) => {\n const base = mode === 'richtext' ? SAFE_FOR_RICH_TEXT : SAFE_FOR_APP\n const allowIframe = iframeAllowedForMode(mode)\n\n if (mode === 'richtext' && allowIframe !== true) {\n return {\n ...base,\n ALLOWED_TAGS: base.ALLOWED_TAGS.filter(t => t !== 'iframe'),\n ADD_TAGS: base.ADD_TAGS.filter(t => t !== 'iframe'),\n FORBID_TAGS: [...base.FORBID_TAGS, 'iframe']\n }\n }\n\n if (mode === 'app' && allowIframe === true) {\n return {\n ...base,\n FORBID_TAGS: base.FORBID_TAGS.filter(t => t !== 'iframe'),\n ADD_TAGS: ['iframe'],\n ADD_ATTR: ['sandbox']\n }\n }\n\n return base\n}\n\nfunction makeSanitizeFn(mode = 'app') {\n const cfg = buildModeConfig(mode)\n\n return (html) => DOMPurify.sanitize(html, cfg)\n}\n\n/* ---------------------------------------------\n * Configure once\n * ------------------------------------------- */\nconst sanitizeDataConfigure = (config = {}) => {\n if (isConfigured) {\n spyneWarn('sanitizeData is already configured. Reconfiguration is not allowed.')\n return\n }\n\n const { strict = false, disableSanitize = false, iframes, customElements } = config\n\n globalDisable = disableSanitize === true\n\n if (customElements !== undefined) {\n allowCustomElements(customElements)\n }\n\n if (iframes && typeof iframes === 'object') {\n configuredIframePolicy = resolveIframePolicy(iframes)\n activeIframePolicy = configuredIframePolicy\n }\n\n if (globalDisable) {\n console.warn('SPYNE SECURITY WARNING: All data sanitization is DISABLED via config.disableSanitize. Do not use this setting in production.')\n } else {\n addIframeHardeningHook()\n }\n\n const processFactory = (mode) => {\n const sanitizeStr = makeSanitizeFn(mode)\n const process = (val) => {\n if (Array.isArray(val)) return val.map(process)\n if (val && typeof val === 'object') {\n const out = {}\n for (const [k, v] of Object.entries(val)) {\n out[k] = (typeof v === 'string') ? sanitizeStr(v) : process(v)\n }\n return out\n }\n return (typeof val === 'string') ? sanitizeStr(val) : val\n }\n return process\n }\n\n _sanitizeData = (data, opts = {}) => {\n const { disableSanitize: callDisable = false, mode, iframes: iframesOverride } = opts\n if (globalDisable || callDisable) return data\n\n const legacyStrict = forceStrict || strict\n const effectiveMode = mode || (legacyStrict ? 'app' : resolveDefaultMode())\n\n // Sanitization is synchronous, so the per-call iframe policy can be\n // scoped with a swap-and-restore around the processing pass.\n activeIframePolicy = resolveIframePolicy(iframesOverride)\n try {\n return processFactory(effectiveMode)(data)\n } finally {\n activeIframePolicy = configuredIframePolicy\n }\n }\n\n sanitizeDataConfigure.sanitizeDataForce = (data, mode) => {\n if (globalDisable) return data\n const effective = mode || resolveDefaultMode()\n return processFactory(effective)(data)\n }\n\n isConfigured = true\n}\n\n/* ---------------------------------------------\n * Configurable runtime sanitizer\n * ------------------------------------------- */\nconst sanitizeData = (data, opts = {}) => {\n if (!isConfigured) {\n throw new Error('sanitizeData is not configured. Call sanitizeDataConfigure() first.')\n }\n return _sanitizeData(data, opts)\n}\n\n/* ---------------------------------------------\n * Always-on sanitizer with environment default\n * ------------------------------------------- */\nconst sanitizeDataForce = (data, mode) => {\n if (!isConfigured || !sanitizeDataConfigure.sanitizeDataForce) {\n const sanitizeStr = makeSanitizeFn(mode || resolveDefaultMode())\n return (typeof data === 'string') ? sanitizeStr(data) : data\n }\n return sanitizeDataConfigure.sanitizeDataForce(data, mode)\n}\n\n/* ---------------------------------------------\n * Attribute sanitizer\n *\n * The single value-level guard for the attribute channel\n * (DomElement.setElAttrs). Attribute names are gated by the\n * DomElement/ViewStream allowlists; this validates values.\n *\n * Independent of sanitizeDataConfigure so it is always available.\n * Returns { allowed: Boolean, value }.\n * ------------------------------------------- */\nconst URL_ATTRS = [\n 'href', 'src', 'action', 'formaction', 'ping', 'poster',\n 'cite', 'codebase', 'manifest', 'icon', 'background'\n]\n\nconst sanitizeAttribute = (key, value, tagName) => {\n if (globalDisable) return { allowed: true, value }\n\n const k = String(key).toLowerCase()\n const tag = String(tagName || '').toUpperCase()\n\n // Event-handler attributes are never legitimate in SpyneJS —\n // broadcastEvents is the declared mechanism for interactivity.\n if (k.startsWith('on')) {\n return { allowed: false, value }\n }\n\n // srcdoc is a full HTML document; sanitize it as one.\n if (k === 'srcdoc') {\n const cfg = buildModeConfig(resolveDefaultMode())\n return { allowed: true, value: DOMPurify.sanitize(String(value), cfg) }\n }\n\n // Iframe src follows the iframe policy: https-only, plus the\n // configured origin allowlist.\n if (tag === 'IFRAME' && k === 'src') {\n return { allowed: isAllowedIframeSrc(value, configuredIframePolicy), value }\n }\n\n if (URL_ATTRS.includes(k) && isSafeUri(value) !== true) {\n return { allowed: false, value }\n }\n\n return { allowed: true, value }\n}\n\n/**\n * Applies the configured iframe sandbox policy to an element created\n * through the attribute channel (DomElement), mirroring the DOMPurify\n * hook that guards parsed HTML.\n */\nconst applyIframeHardening = (el) => {\n if (globalDisable || !el || el.tagName !== 'IFRAME') return el\n\n const { sandbox } = configuredIframePolicy\n if (sandbox !== false && el.hasAttribute('sandbox') !== true) {\n el.setAttribute('sandbox', sandbox)\n }\n\n return el\n}\n\n/* ---------------------------------------------\n * Event-target sanitizer\n * ------------------------------------------- */\nconst sanitizeEventTarget = (el, mode) => {\n if (!el || globalDisable) return\n const effectiveMode = mode || resolveDefaultMode()\n const sanitizeStr = makeSanitizeFn(effectiveMode)\n const UNSAFE_RE = /<(?:script|object|embed|form|input|button|link|meta)[^>]*>|on\\w+=|javascript:/i\n if (typeof el.value === 'string' && UNSAFE_RE.test(el.value)) {\n const clean = sanitizeStr(el.value)\n if (clean !== el.value) el.value = clean\n }\n if (el.isContentEditable && typeof el.innerHTML === 'string' && UNSAFE_RE.test(el.innerHTML)) {\n const clean = sanitizeStr(el.innerHTML)\n if (clean !== el.innerHTML) el.innerHTML = clean\n }\n}\n\n/* ---------------------------------------------\n * @deprecated Use sanitizeData(data, { mode: 'app' }) per call, or set\n * config.mode at SpyneApp.init. Retained for backward compatibility.\n * ------------------------------------------- */\nconst setSanitizeDataForceStrict = (bool = true) => {\n spyneWarn('SPYNE DEPRECATION: setSanitizeDataForceStrict is deprecated. Pass { mode: \"app\" } to sanitizeData, or set config.mode in SpyneApp.init.')\n forceStrict = !!bool\n}\n\nexport {\n sanitizeDataConfigure,\n sanitizeData,\n sanitizeDataForce,\n sanitizeAttribute,\n applyIframeHardening,\n allowCustomElements,\n CUSTOM_ELEMENT_HANDLING as customElementHandling,\n sanitizeEventTarget,\n setSanitizeDataForceStrict\n}\nexport default sanitizeData\n","import DOMPurify from 'dompurify'\nimport { spyneWarn } from './spyne-warn.js'\nimport { customElementHandling } from './sanitize-data.js'\n\nlet _sanitizeHTML\nlet isConfigured = false\n\n/**\n * Configures the template-layer sanitizer.\n *\n * Sanitization is always on. The three-level posture:\n *\n * mode: 'app' (default) — DOMPurify with its standard allowlist\n * mode: 'richtext' — additionally admits iframe/link (+ sandbox attr)\n * so CMS/authoring content survives templates\n * strict: true — additionally registers a Trusted Types 'default'\n * policy so DOM sinks route through sanitization\n * disableSanitize: true — the only full passthrough; logs a security warning\n */\nconst sanitizeHTMLConfigure = (config = {}) => {\n if (isConfigured) {\n spyneWarn('sanitizeHTML is already configured. Reconfiguration is not allowed.')\n return\n }\n\n const {\n strict = false,\n mode = 'app',\n disableSanitize = false,\n allowTargetAttr = true,\n addNoopener = true,\n debug = false,\n iframes = {}\n } = config\n\n if (disableSanitize === true) {\n console.warn('SPYNE SECURITY WARNING: All HTML sanitization is DISABLED via config.disableSanitize. Do not use this setting in production.')\n _sanitizeHTML = (html) => html\n isConfigured = true\n return\n }\n\n const isRichtext = ['richtext', 'authoring', 'development'].includes(mode)\n\n // Iframe admission follows config.iframes.allow when set; otherwise\n // the mode default (richtext yes, app no). The DOMPurify hook added by\n // sanitize-data enforces src origin and sandbox policy on whatever\n // is admitted here.\n const allowIframe = iframes.allow !== undefined ? iframes.allow === true : isRichtext\n\n const domPurifyConfig = {\n RETURN_TRUSTED_TYPE: false,\n ADD_TAGS: [\n ...(allowIframe ? ['iframe'] : []),\n ...(isRichtext ? ['link'] : [])\n ],\n ADD_ATTR: [\n ...(allowTargetAttr ? ['target'] : []),\n ...(allowIframe ? ['sandbox'] : [])\n ],\n // Admits the framework's spyne-* elements (CMS proxy wrappers) and any\n // elements registered via allowCustomElements/config.customElements.\n // The tag check is a closure, so late plugin registration is honored.\n CUSTOM_ELEMENT_HANDLING: customElementHandling,\n ...(allowIframe !== true && isRichtext ? { FORBID_TAGS: ['iframe'] } : {})\n }\n\n const sanitizeWithPolicy = (html) => DOMPurify.sanitize(html, domPurifyConfig)\n\n if (allowTargetAttr) {\n DOMPurify.addHook('afterSanitizeAttributes', (node) => {\n if (!node || typeof node.getAttribute !== 'function') return\n if (node.tagName !== 'A') return\n\n const href = node.getAttribute('href')\n const target = node.getAttribute('target')\n\n // remove target on anchors without href\n if (!href && target) {\n node.removeAttribute('target')\n return\n }\n\n if (!target) return\n\n const validTargets = ['_blank', '_self', '_parent', '_top']\n if (!validTargets.includes(target)) {\n node.removeAttribute('target')\n return\n }\n\n if (target === '_blank' && addNoopener) {\n const currentRel = node.getAttribute('rel') || ''\n const relParts = currentRel.split(/\\s+/).filter(Boolean)\n const relSet = new Set(relParts)\n\n relSet.add('noopener')\n relSet.add('noreferrer')\n\n node.setAttribute('rel', Array.from(relSet).join(' '))\n }\n })\n }\n\n _sanitizeHTML = sanitizeWithPolicy\n\n if (strict === true && window.trustedTypes) {\n try {\n const policy = window.trustedTypes.createPolicy('default', {\n createHTML: (toEscape) => sanitizeWithPolicy(toEscape)\n })\n\n _sanitizeHTML = (html) => policy.createHTML(html)\n\n if (debug === true) {\n console.log('SPYNE: Trusted Types default policy registered. Note that browser enforcement additionally requires the CSP header: require-trusted-types-for \\'script\\'.')\n }\n } catch (err) {\n spyneWarn('SPYNE WARNING: A Trusted Types \"default\" policy already exists on this page. Falling back to direct sanitization.', err)\n }\n }\n\n isConfigured = true\n}\n\nconst sanitizeHTML = (html) => {\n if (!isConfigured) {\n throw new Error('sanitizeHTML is not configured. Call sanitizeHTMLConfigure() with appropriate config.')\n }\n return _sanitizeHTML(html)\n}\n\nexport { sanitizeHTMLConfigure }\nexport default sanitizeHTML\n","import { includes, __, ifElse, path, prop, reject, is, isNil, isEmpty } from 'ramda'\nimport sanitizeHTML from '../utils/sanitize-html.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\n\n/**\n * DomElementTemplate\n *\n * Mustache-compatible template engine used by ViewStream and DomElement for HTML rendering.\n *\n * Supported syntax:\n * {{key}} variable interpolation, HTML-escaped\n * {{key.path.to.value}} dot-notation property access\n * {{#key}}...{{/key}} array/object sections\n * {{.}} current element inside a loop\n * {{#}}...{{/}} top-level bare array (passed as `data`)\n *\n * Nesting:\n * DomElementTemplate supports exactly ONE level of nested array sections.\n * A template like {{#rows}}...{{#cells}}...{{/cells}}...{{/rows}} is supported.\n * Deeper nesting — {{#a}}{{#b}}{{#c}}...{{/c}}{{/b}}{{/a}} — is NOT supported.\n *\n * When a template has deeper nesting, a warning is logged in debug mode and\n * the third-level loop is not processed. This is a deliberate design choice:\n * deep hierarchical rendering belongs in nested ViewStreams, not in templates.\n * Nested ViewStreams provide proper lifecycle semantics, isolated rendering,\n * and clearer architectural boundaries than arbitrarily-nested templates.\n *\n * Not currently supported in nested loops:\n * - CMS proxy metadata (__cms__dataId, __cms__keyFor_*). Inner-loop CMS\n * editing is a future enhancement; until then, content inside an inner\n * loop is rendered as read-only from the CMS perspective.\n */\nexport class DomElementTemplate {\n constructor(template, data = {}, opts = {}) {\n this.template = this.formatTemplate(template)\n this.isProxyData = data.__cms__isProxy === true\n this.testMode = opts?.testMode\n\n // Normalize triple-bracket tags to double-bracket.\n //\n // DomElementTemplate treats {{{key}}} as an alias for {{key}} — both\n // interpolate the value as-is. Mustache's convention of \"triple-bracket\n // means unescaped\" doesn't apply here because SpyneJS handles escaping\n // and sanitization through `sanitize-data` (keyed on SpyneApp mode)\n // before values reach the template, not through syntax-level escaping.\n //\n // We accept triple-bracket syntax so that authors and AI familiar with\n // standard Mustache don't have their templates silently break when they\n // reach for {{{key}}} out of habit. The normalization happens once here,\n // so the rest of the engine only ever reasons about double-bracket tags.\n this.template = DomElementTemplate.normalizeTripleBrackets(this.template)\n\n if (this.isProxyData === true) {\n const proxyFormatter = SpyneAppProperties.enableCMSProxies === true\n ? SpyneAppProperties.formatTemplateForProxyData\n : DomElementTemplate.formatTemplateForProxyData\n\n if (typeof proxyFormatter === 'function') {\n this.template = proxyFormatter(this.template)\n }\n }\n\n const checkForArrayData = () => {\n if (is(Array, data) === true) {\n data = { spyneData:data }\n this.template = this.template.replace('{{/}}', '{{/spyneData}}')\n this.template = this.template.replace('{{#}}', '{{#spyneData}}')\n }\n }\n\n checkForArrayData()\n\n this.templateData = data\n\n // Stash used by per-iteration substitution so that CMS proxy lookups\n // for string-array items (where __cms__dataId / __cms__keyFor_* live on\n // the PARENT array, not on the individual string elements) can find the\n // parent object at render time. Set by parseTheTmplLoop, cleared when\n // that loop completes.\n this.currentOuterLoopData = null\n\n const strArr = DomElementTemplate.getStringArray(this.template)\n\n let strMatches = this.template.match(DomElementTemplate.findTmplLoopsRE())\n strMatches = strMatches === null ? [] : strMatches\n\n const parseTmplLoopsRE = DomElementTemplate.parseTmplLoopsRE()\n\n const parseTmplLoopFn = this.parseTheTmplLoop.bind(this)\n\n const mapTmplLoop = (str) => {\n return str.replace(parseTmplLoopsRE, parseTmplLoopFn)\n }\n\n const findTmplLoopsPred = includes(__, strMatches)\n const checkForMatches = ifElse(\n findTmplLoopsPred,\n mapTmplLoop,\n this.addParams.bind(this))\n\n this.finalArr = strArr.map(checkForMatches)\n }\n\n static isPrimitiveTag(str) {\n return /({{\\.\\*?}})/.test(str)\n }\n\n /**\n * Normalizes triple-bracket tags to double-bracket form.\n *\n * {{{key}}} → {{key}}\n * {{{a.b.c}}} → {{a.b.c}}\n * {{{.}}} → {{.}}\n * {{{.*}}} → {{.*}}\n *\n * Section markers {{#key}} and {{/key}} are already two-bracket by\n * convention and are not affected. Tags of the wrong shape (unbalanced,\n * four or more brackets, etc.) are left untouched — anything the main\n * parser doesn't recognize later will render as literal text, which is\n * the correct failure mode for a logic-less template engine.\n *\n * This exists because DomElementTemplate treats {{{key}}} and {{key}}\n * as interchangeable — sanitization and escaping are config-driven\n * through `sanitize-data`, not syntax-driven through bracket count.\n * Normalizing at construction time means the rest of the engine (loop\n * regexes, CMS proxy wrapping, variable substitution) only reasons\n * about one bracket style.\n */\n static normalizeTripleBrackets(template) {\n if (typeof template !== 'string' || template.indexOf('{{{') === -1) {\n return template\n }\n // Match balanced triple-brackets containing anything that isn't a\n // brace character. Keeps the captured inner content, strips the\n // outer third brace on each side.\n return template.replace(/\\{\\{\\{([^{}]+?)\\}\\}\\}/g, '{{$1}}')\n }\n\n // FIND CORRECT NESTED DATA\n static getNestedDataReducer(data = {}, param = '') {\n const dataReducer = (nestedData, str) => {\n if (nestedData[str]) {\n return nestedData[str]\n }\n return typeof nestedData === 'string' ? nestedData : ''\n }\n\n return /(\\.)/gm.test(String(param)) ? String(param).split('.').reduce(dataReducer, data) : data[param] ?? ''\n }\n\n static getStringArray(template) {\n const strArr = template.split(DomElementTemplate.findTmplLoopsRE())\n const emptyRE = /^([\\\\n\\s\\W]+)$/\n // findTmplLoopsRE has TWO capture groups (the full loop match, and the\n // \\2-backreferenced key name). When used with String.prototype.split, the\n // second group is emitted into the result array as a leaked chunk.\n //\n // The chunks arrive in a predictable 3-step cycle:\n // index 0: pre-text before the first loop\n // index 1: full match the loop (keep)\n // index 2: group-2 leak the loop's key name (discard)\n // index 3: between-loops text\n // index 4: full match\n // index 5: group-2 leak\n // ...\n // So any index i where i >= 2 and (i - 2) % 3 === 0 is a key-name leak\n // that should not flow into the render pipeline.\n const withoutLeaks = strArr.filter((_, i) => !(i >= 2 && (i - 2) % 3 === 0))\n const filterOutEmptyStrings = s => s.match(emptyRE)\n const finalStr = reject(filterOutEmptyStrings, withoutLeaks)\n\n return finalStr\n }\n\n /**\n * Regex that finds top-level loop sections, pairing each opening tag with a\n * closing tag of the SAME NAME via the \\2 backreference. This is what makes\n * {{#rows}}<tr>{{#cells}}<td>{{.}}</td>{{/cells}}</tr>{{/rows}} match as a\n * single outer loop rather than getting truncated at the inner {{/cells}}.\n */\n static findTmplLoopsRE() {\n return /({{#([\\w.]+)}}[\\w\\n\\s\\W]+?{{\\/\\2}})/gm\n }\n\n static parseTmplLoopsRE() {\n return /({{#([\\w.]+)}})([\\w\\n\\s\\W]+?)({{\\/\\2}})/gm\n }\n\n /**\n * Regex for finding a single inner loop inside an outer loop's body.\n * Identical in form to parseTmplLoopsRE, but created fresh to avoid\n * shared-lastIndex bugs with global regexes when used in .replace callbacks.\n */\n static innerLoopRE() {\n return /({{#([\\w.]+)}})([\\w\\n\\s\\W]+?)({{\\/\\2}})/gm\n }\n\n static swapParamsForTagsRE() {\n return /({{)(.*?)(}})/gm\n }\n\n /**\n * Detects whether a template body contains any {{#key}}...{{/key}} pair.\n * Used to decide whether the inner-loop pass is needed, and to detect\n * two-level nesting for warning purposes.\n */\n static hasLoop(str) {\n return DomElementTemplate.innerLoopRE().test(str)\n }\n\n removeThis() {\n if (this !== undefined) {\n this.finalArr = undefined\n this.templateData = undefined\n this.template = undefined\n }\n }\n\n /**\n * @desc Returns a document fragment generated from the template and any added data.\n */\n renderDocFrag() {\n let html = DomElementTemplate.replaceImgPath(this.finalArr.join(''))\n if (this.testMode !== true) {\n html = sanitizeHTML(html)\n }\n const isTableSubTag = /^([^>]*?)(<){1}(\\b)(thead|col|colgroup|tbody|td|tfoot|tr|th)(\\b)([^\\0]*)$/.test(html)\n const el = isTableSubTag ? html : document.createRange().createContextualFragment(html)\n\n window.setTimeout(this.removeThis, 2)\n return el\n }\n\n renderToString() {\n let html = this.finalArr.join('')\n html = DomElementTemplate.replaceImgPath(html)\n if (this.testMode !== true) {\n // String(...) unwraps TrustedHTML when strict mode is active,\n // keeping this method's string contract.\n html = String(sanitizeHTML(html))\n }\n window.setTimeout(this.removeThis, 2)\n return html\n }\n\n getTemplateString() {\n return this.finalArr.join('')\n }\n\n formatTemplate(template) {\n return ['SCRIPT', 'TEMPLATE'].includes(prop('nodeName', template)) === true ? template.innerHTML : template\n }\n\n getDataValFromPathStr(pathStr, dataFile) {\n const pathArr = String(pathStr).split('.')\n const pathData = path(pathArr, dataFile)\n return pathData || ''\n }\n\n addParams(str) {\n const replaceTags = (str, p1, p2, p3) => {\n return DomElementTemplate.getNestedDataReducer(this.templateData, p2)\n }\n return str.replace(DomElementTemplate.swapParamsForTagsRE(), replaceTags)\n }\n\n static replaceImgPath(templateStr) {\n const { IMG_PATH } = SpyneAppProperties\n if (IMG_PATH !== undefined) {\n templateStr = templateStr.replaceAll(/src\\s*=\\s*(['\"])imgs\\//g, `src=$1${IMG_PATH}`)\n return templateStr.replaceAll(/url\\(\\s*(['\"]?)imgs\\//g, `url($1${IMG_PATH}`)\n }\n return templateStr\n }\n\n /**\n * Resolves a single inner loop (one level down) inside an outer-loop body,\n * using `parentItem` as the data context. If the inner body itself contains\n * another loop, a debug-mode warning is logged and that deeper loop is not\n * processed.\n *\n * Returns the body string with any inner loop expanded, ready for\n * outer-level variable substitution.\n */\n processInnerLoop(bodyStr, parentItem) {\n const innerRE = DomElementTemplate.innerLoopRE()\n\n return bodyStr.replace(innerRE, (fullMatch, openTag, innerKey, innerBody /*, closeTag */) => {\n // Detect disallowed second-level nesting inside the inner body.\n if (DomElementTemplate.hasLoop(innerBody) === true) {\n if (SpyneAppProperties.debug === true && this.testMode !== true) {\n console.warn(\n 'Spyne Warning: DomElementTemplate supports one level of nested array loops. ' +\n `A deeper nested loop was detected inside \"{{#${innerKey}}}\". ` +\n 'Consider restructuring via nested ViewStreams instead.'\n )\n }\n // Strip unsupported deeper-level section tags so they don't emit as\n // garbled variables during substitution below.\n innerBody = innerBody.replace(/{{[#/][\\w.]+}}/g, '')\n }\n\n const innerData = DomElementTemplate.getNestedDataReducer(parentItem, innerKey)\n\n if (isNil(innerData) === true || isEmpty(innerData)) {\n return ''\n }\n\n const innerArr = Array.isArray(innerData) ? innerData : [innerData]\n\n // While processing an inner loop, the \"outer\" data for CMS string-item\n // lookups is the current innerData (the array/object the inner items\n // belong to), not the original outer-loop array. Swap it in, restore\n // when the inner pass completes.\n const previousOuter = this.currentOuterLoopData\n this.currentOuterLoopData = innerData\n\n const rendered = innerArr.map((innerItem, innerIdx) => {\n return this.substituteForItem(innerBody, innerItem, innerIdx)\n }).join('')\n\n this.currentOuterLoopData = previousOuter\n return rendered\n })\n }\n\n /**\n * Substitutes {{...}} variables in `str` using `item` as the data context.\n *\n * Three cases:\n *\n * 1. String item + primitive {{.}}/{{.*}} template:\n * direct text substitution (no CMS wrapping possible — this path only\n * runs when formatTemplateForProxyData has NOT wrapped the tag).\n *\n * 2. String item + non-primitive template:\n * can happen two ways: (a) a section iterating strings where\n * formatTemplateForProxyData has replaced {{.}}/{{.*}} with\n * {{spyneLoopKey}} + {{origKey}} inside a <spyne-cms-item> wrapper,\n * or (b) a non-proxy template with positional tokens only.\n * Build a context that satisfies both — spyneLoopKey = the string,\n * plus __cms__dataId / origKey looked up on the parent array when\n * proxy data is active.\n *\n * 3. Object item:\n * the conventional path — build a lookup object with the item's\n * properties plus positional tokens, substitute by property name\n * or dot-path.\n */\n substituteForItem(str, item, index) {\n // Case 1: string item with a primitive-tag template.\n if (typeof item === 'string') {\n if (DomElementTemplate.isPrimitiveTag(str)) {\n const escaped = item.replace(/\\$/g, '$$$$') // $ -> $$ for replace() literal safety\n return str.replace(DomElementTemplate.swapParamsForTagsRE(), escaped)\n }\n\n // Case 2: string item with a non-primitive template.\n const ctx = this.buildStringItemContext(item, index)\n return this.substituteObject(str, ctx)\n }\n\n // Case 3: object item.\n const dataObj = this.buildItemContext(item, index)\n return this.substituteObject(str, dataObj)\n }\n\n /**\n * Builds the per-iteration lookup context for a STRING item.\n *\n * Always includes:\n * - spyneLoopKey: the string itself (matches the CMS proxy wrapping,\n * which replaces {{.}}/{{.*}} inside string loops with {{spyneLoopKey}})\n * - loopIndex / loopNum: positional tokens\n *\n * When proxy data is active, additionally includes:\n * - __cms__dataId: the CMS identifier for the PARENT array (the string\n * items themselves are primitives and don't carry the id)\n * - origKey: the original key the CMS uses to address this specific\n * string within its parent, looked up via __cms__keyFor_<item>\n */\n buildStringItemContext(item, index) {\n const context = {\n spyneLoopKey: item,\n loopIndex: index,\n loopNum: index + 1\n }\n\n if (this.isProxyData === true) {\n const outerData = this.currentOuterLoopData\n if (outerData && typeof outerData === 'object') {\n context.__cms__dataId = outerData.__cms__dataId || ''\n const keyIdStr = `__cms__keyFor_${item}`\n context.origKey = outerData[keyIdStr] !== undefined ? outerData[keyIdStr] : ''\n } else {\n context.__cms__dataId = ''\n context.origKey = ''\n }\n }\n\n return context\n }\n\n /**\n * Builds the per-iteration lookup context for an OBJECT item, including\n * CMS-proxy metadata when this template is rendering proxied data.\n */\n buildItemContext(item, index) {\n const context = Object.assign({}, item, {\n loopIndex: index,\n loopNum: index + 1\n })\n\n if (this.isProxyData === true) {\n context.__cms__dataId = item.__cms__dataId\n context.spyneLoopKey = item\n context.loopIndex = index\n context.loopNum = index + 1\n }\n\n return context\n }\n\n /**\n * Replaces {{key}} and {{a.b.c}} tokens in `str` using `ctx` as the source.\n */\n substituteObject(str, ctx) {\n const reDot = /(\\.)/gm\n const positional = { loopIndex: ctx.loopIndex, loopNum: ctx.loopNum }\n\n const replacer = (match, p1, p2) => {\n // Auto-injected positional tokens take precedence\n if (positional[p2] !== undefined) return positional[p2]\n\n // Simple key access\n if (reDot.test(p2) === false && ctx[p2] !== undefined) {\n return ctx[p2]\n }\n\n // Dot-path access\n return this.getDataValFromPathStr(p2, ctx)\n }\n\n return str.replace(DomElementTemplate.swapParamsForTagsRE(), replacer)\n }\n\n /**\n * Entry point for each top-level loop match. Extracts loop data, runs the\n * inner-loop pass on the body for each iteration, then substitutes outer\n * variables.\n */\n parseTheTmplLoop(str, p1, p2, p3) {\n const outerBody = p3\n const elData = DomElementTemplate.getNestedDataReducer(this.templateData, p2)\n\n if (isNil(elData) === true || isEmpty(elData)) {\n return ''\n }\n\n // Stash the outer data so that per-iteration substitution can look up\n // CMS proxy metadata (__cms__dataId, __cms__keyFor_*) that lives on the\n // parent array object — not on individual string elements.\n const previousOuter = this.currentOuterLoopData\n this.currentOuterLoopData = elData\n\n const elArr = Array.isArray(elData) ? elData : [elData]\n\n // Whether the outer body contains an inner loop is cheap to test and lets\n // us skip the inner-loop processing entirely for the common single-level case.\n const bodyHasInnerLoop = DomElementTemplate.hasLoop(outerBody)\n\n const rendered = elArr.map((item, index) => {\n const body = bodyHasInnerLoop\n ? this.processInnerLoop(outerBody, item)\n : outerBody\n\n return this.substituteForItem(body, item, index)\n }).join('')\n\n this.currentOuterLoopData = previousOuter\n return rendered\n }\n}\n","import { baseCoreMixins } from '../utils/mixins/base-core-mixins.js'\nimport { spyneWarn } from '../utils/spyne-warn.js'\nimport { DomElementTemplate } from './dom-element-template.js'\nimport { deepMerge } from '../utils/deep-merge.js'\nimport { sanitizeAttribute, applyIframeHardening } from '../utils/sanitize-data.js'\nimport { is, defaultTo, pick, mapObjIndexed, forEachObjIndexed, pipe } from 'ramda'\n\nclass DomElement {\n /**\n * @module DomElement\n * @type util\n *\n * @desc\n * <p>This is the ViewStream rendering engine.</p>\n * <p>This is the recommended process for creating HTMLElements that do not require the logic and overhead of a ViewStream instance.</p>\n * <button class='modal-btn btn btn-blue-ref' data-type='modal-window' data-num=800 data-value='attributes'>View Attributes</button>\n *\n * @constructor\n * @param {string} tagName the tagname for this dom element.\n * @param {object} attributes any domElement attribute (except for class )\n * @param {string|object} data string for text tags and json for templates\n * @param {template} template\n * @property {String} props.tagName - = 'div'; Default for tagName.\n * @property {Object} props.attributes - = {}; This can be any valid HTML attribute for the given tagName.\n * @property {String|Object} props.data = undefined; This is either a String for an element or JSON data object for a template.\n * @property {String|HTML} props.template = undefined; If a template is defined, the DomElement will use it.\n *\n */\n\n constructor(props = {}, testMode = false) {\n const checkDefault = (dflt, val) => defaultTo(dflt)(val)\n\n props.tagName = checkDefault('div', props.tagName)\n\n props.attributes = props.attributes !== undefined ? props.attributes : this.getDomAttributes(props)\n props.attrs = this.updateAttrs(props.attributes)\n\n props.fragment = document.createDocumentFragment()\n this.testMode = testMode\n this.props = props\n\n this.addMixins()\n }\n\n setProp(key, val) {\n this.props[key] = val\n }\n\n getProp(val) {\n return this.props[val]\n }\n\n get el() {\n return this.props.el\n }\n\n setElAttrs(el, params) {\n const testMode = this.testMode === true\n const addAttributes = (val, key) => {\n const addToDataset = (val, key) => { el.dataset[key] = val }\n if (key === 'dataset') {\n // Dataset values are inert text and are the framework's payload\n // surface; they are applied as-is.\n forEachObjIndexed(addToDataset, val)\n return\n }\n\n if (testMode !== true) {\n const { allowed, value } = sanitizeAttribute(key, val, el.tagName)\n if (allowed !== true) {\n spyneWarn(`SPYNE WARNING: The attribute \"${key}\" was removed during sanitization.`, el)\n return\n }\n val = value\n }\n\n el.setAttribute(key, val)\n }\n this.getProp('attrs').forEach(addAttributes)\n\n if (testMode !== true) {\n applyIframeHardening(el)\n }\n\n return el\n }\n\n updateAttrs(params, m) {\n const theMap = m !== undefined ? m : new Map()\n const addAttributes = (val, key) => theMap.set(key, val)\n mapObjIndexed(addAttributes, params)\n return theMap\n }\n\n addTemplate(el) {\n const template = this.getProp('template')\n\n const addTmpl = (template) => {\n let data = this.getProp('data')\n data = is(Object, data) ? data : {}\n const frag = new DomElementTemplate(template, data, { testMode: this?.testMode }).renderDocFrag()\n const fragIsString = is(String, frag)\n fragIsString ? el.innerHTML = frag : el.appendChild(frag)\n return el\n }\n const doNothing = (el) => el\n return template !== undefined ? addTmpl(template) : doNothing(el)\n }\n\n createElement(tagName = 'div') {\n return document.createElement(tagName)\n }\n\n addContent(el) {\n const text = (this.getProp('data'))\n const isText = is(String, text)\n if (isText === true) {\n const txt = document.createTextNode(text)\n el.appendChild(txt)\n }\n return el\n }\n\n execute() {\n const el = pipe(\n this.createElement.bind(this),\n this.setElAttrs.bind(this),\n this.addTemplate.bind(this),\n this.addContent.bind(this)\n )(this.getProp('tagName'))\n // this.getProp('fragment').appendChild(el);\n this.props.el = el\n }\n\n /**\n * This method will render the HTML Element\n * @returns {HTMLElement} HTMLElement\n */\n render() {\n this.execute()\n this.props.template = undefined\n this.props.data = undefined\n this.props.attributes = undefined\n return this.getProp('el')\n }\n\n renderToHTMLString() {\n this.execute()\n this.props.template = undefined\n this.props.data = undefined\n this.props.attributes = undefined\n return this.getProp('el').outerHTML\n }\n\n returnIfDefined(obj, val) {\n if (val !== undefined) {\n const isObj = typeof (val) === 'undefined'\n isObj === false ? obj[val] = val : obj[val] = deepMerge(obj[val], val)\n }\n }\n\n updateprops(val) {\n this.returnIfDefined(this.props, val)\n return this\n }\n\n updatepropsAndRun(val) {\n this.updateprops(val)\n this.execute()\n return this.getProp('fragment')\n }\n\n unmount() {\n if (this.props !== undefined) {\n this.getProp('el').remove()\n this.props = undefined\n this.gc()\n }\n }\n\n updateTag(tagName = 'div') { this.updateprops(tagName) }\n updateAttributes(attrs = {}) { this.updateprops(attrs) }\n updateTemplate(template) { this.updateprops(template) }\n updateData(data = {}) { this.updateprops(data) }\n addTagAndRender(tagName = 'div') { this.updatepropsAndRun(tagName) }\n addAttrsibutesAndRender(attrs = {}) { this.updatepropsAndRun(attrs) }\n addTemplateAndRender(template) { this.updatepropsAndRun(template) }\n addDataAndRender(data = {}) { this.updatepropsAndRun(data) }\n // ==================================\n // BASE CORE MIXINS\n // ==================================\n addMixins() {\n const coreMixins = baseCoreMixins()\n this.gc = coreMixins.gc.bind(this)\n }\n\n getDomAttributes(props) {\n return pick(this.attributesArray, props)\n }\n\n get attributesArray() {\n return [\n 'accept',\n 'accept-charset',\n 'accesskey',\n 'action',\n 'align',\n 'allow',\n 'alt',\n 'async',\n 'autocapitalize',\n 'autocomplete',\n 'autofocus',\n 'autoplay',\n 'bgcolor',\n 'border',\n 'buffered',\n 'challenge',\n 'charset',\n 'checked',\n 'cite',\n 'class',\n 'code',\n 'codebase',\n 'color',\n 'cols',\n 'colspan',\n 'content',\n 'contenteditable',\n 'contextmenu',\n 'controls',\n 'coords',\n 'crossorigin',\n 'csp',\n 'dataset',\n 'datetime',\n 'decoding',\n 'default',\n 'defer',\n 'dir',\n 'dirname',\n 'disabled',\n 'download',\n 'draggable',\n 'dropzone',\n 'enctype',\n 'for',\n 'form',\n 'formaction',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hreflang',\n 'http-equiv',\n 'icon',\n 'id',\n 'importance',\n 'integrity',\n 'ismap',\n 'itemprop',\n 'keytype',\n 'kind',\n 'label',\n 'lang',\n 'language',\n 'lazyload',\n 'list',\n 'loop',\n 'low',\n 'manifest',\n 'max',\n 'maxlength',\n 'minlength',\n 'media',\n 'method',\n 'min',\n 'multiple',\n 'muted',\n 'name',\n 'novalidate',\n 'open',\n 'optimum',\n 'pattern',\n 'ping',\n 'placeholder',\n 'poster',\n 'preload',\n 'radiogroup',\n 'readonly',\n 'referrerpolicy',\n 'rel',\n 'required',\n 'reversed',\n 'rows',\n 'rowspan',\n 'sandbox',\n 'scope',\n 'scoped',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'slot',\n 'span',\n 'spellcheck',\n 'src',\n 'srcdoc',\n 'srclang',\n 'srcset',\n 'start',\n 'step',\n 'style',\n 'summary',\n 'tabindex',\n 'target',\n 'title',\n 'translate',\n 'type',\n 'usemap',\n 'value',\n 'width',\n 'wrap'\n ]\n }\n}\nconst DomEl = DomElement\nexport { DomElement, DomEl }\n","const createFaderInlineText = (isInBool = false, t = 1, e = 'ease', startZeroBool = false) => {\n const initOpacityZero = startZeroBool === true ? 'opacity:0;' : ''\n const opacity = isInBool === true ? 1 : 0\n return `${initOpacityZero}transition: opacity ${t}s ${e}; opacity: ${opacity};`\n}\nexport function fadein(el, t) {\n const currentOpacity = window.getComputedStyle(el).opacity * 1\n const startAtZero = currentOpacity === 1\n const inlineCss = createFaderInlineText(true, t, 'ease', startAtZero)\n el.style.cssText += inlineCss\n}\nexport function fadeout(el, t, callback) {\n const inlineCss = createFaderInlineText(false, t, 'ease')\n el.style.cssText += inlineCss\n\n // window.setTimeout(callback, t * 1000);\n el.addEventListener('transitionend', callback, false)\n}\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","export var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n//# sourceMappingURL=isArrayLike.js.map","import { isFunction } from \"./isFunction\";\nexport function isPromise(value) {\n return isFunction(value === null || value === void 0 ? void 0 : value.then);\n}\n//# sourceMappingURL=isPromise.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","export var COMPLETE_NOTIFICATION = (function () { return createNotification('C', undefined, undefined); })();\nexport function errorNotification(error) {\n return createNotification('E', undefined, error);\n}\nexport function nextNotification(value) {\n return createNotification('N', value, undefined);\n}\nexport function createNotification(kind, value, error) {\n return {\n kind: kind,\n value: value,\n error: error,\n };\n}\n//# sourceMappingURL=NotificationFactories.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\nexport function isInteropObservable(input) {\n return isFunction(input[Symbol_observable]);\n}\n//# sourceMappingURL=isInteropObservable.js.map","import { isFunction } from './isFunction';\nexport function isAsyncIterable(obj) {\n return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);\n}\n//# sourceMappingURL=isAsyncIterable.js.map","export function createInvalidObservableTypeError(input) {\n return new TypeError(\"You provided \" + (input !== null && typeof input === 'object' ? 'an invalid object' : \"'\" + input + \"'\") + \" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.\");\n}\n//# sourceMappingURL=throwUnobservableError.js.map","export function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport var iterator = getSymbolIterator();\n//# sourceMappingURL=iterator.js.map","import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\nexport function isIterable(input) {\n return isFunction(input === null || input === void 0 ? void 0 : input[Symbol_iterator]);\n}\n//# sourceMappingURL=isIterable.js.map","import { __asyncGenerator, __await, __generator } from \"tslib\";\nimport { isFunction } from './isFunction';\nexport function readableStreamLikeToAsyncGenerator(readableStream) {\n return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {\n var reader, _a, value, done;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n reader = readableStream.getReader();\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 9, 10]);\n _b.label = 2;\n case 2:\n if (!true) return [3, 8];\n return [4, __await(reader.read())];\n case 3:\n _a = _b.sent(), value = _a.value, done = _a.done;\n if (!done) return [3, 5];\n return [4, __await(void 0)];\n case 4: return [2, _b.sent()];\n case 5: return [4, __await(value)];\n case 6: return [4, _b.sent()];\n case 7:\n _b.sent();\n return [3, 2];\n case 8: return [3, 10];\n case 9:\n reader.releaseLock();\n return [7];\n case 10: return [2];\n }\n });\n });\n}\nexport function isReadableStreamLike(obj) {\n return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);\n}\n//# sourceMappingURL=isReadableStreamLike.js.map","import { __asyncValues, __awaiter, __generator, __values } from \"tslib\";\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isPromise } from '../util/isPromise';\nimport { Observable } from '../Observable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isIterable } from '../util/isIterable';\nimport { isReadableStreamLike, readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nimport { isFunction } from '../util/isFunction';\nimport { reportUnhandledError } from '../util/reportUnhandledError';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function innerFrom(input) {\n if (input instanceof Observable) {\n return input;\n }\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromInteropObservable(input);\n }\n if (isArrayLike(input)) {\n return fromArrayLike(input);\n }\n if (isPromise(input)) {\n return fromPromise(input);\n }\n if (isAsyncIterable(input)) {\n return fromAsyncIterable(input);\n }\n if (isIterable(input)) {\n return fromIterable(input);\n }\n if (isReadableStreamLike(input)) {\n return fromReadableStreamLike(input);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\nexport function fromInteropObservable(obj) {\n return new Observable(function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (isFunction(obs.subscribe)) {\n return obs.subscribe(subscriber);\n }\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n });\n}\nexport function fromArrayLike(array) {\n return new Observable(function (subscriber) {\n for (var i = 0; i < array.length && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n });\n}\nexport function fromPromise(promise) {\n return new Observable(function (subscriber) {\n promise\n .then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, reportUnhandledError);\n });\n}\nexport function fromIterable(iterable) {\n return new Observable(function (subscriber) {\n var e_1, _a;\n try {\n for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {\n var value = iterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n subscriber.complete();\n });\n}\nexport function fromAsyncIterable(asyncIterable) {\n return new Observable(function (subscriber) {\n process(asyncIterable, subscriber).catch(function (err) { return subscriber.error(err); });\n });\n}\nexport function fromReadableStreamLike(readableStream) {\n return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));\n}\nfunction process(asyncIterable, subscriber) {\n var asyncIterable_1, asyncIterable_1_1;\n var e_2, _a;\n return __awaiter(this, void 0, void 0, function () {\n var value, e_2_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 5, 6, 11]);\n asyncIterable_1 = __asyncValues(asyncIterable);\n _b.label = 1;\n case 1: return [4, asyncIterable_1.next()];\n case 2:\n if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done)) return [3, 4];\n value = asyncIterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return [2];\n }\n _b.label = 3;\n case 3: return [3, 1];\n case 4: return [3, 11];\n case 5:\n e_2_1 = _b.sent();\n e_2 = { error: e_2_1 };\n return [3, 11];\n case 6:\n _b.trys.push([6, , 9, 10]);\n if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return))) return [3, 8];\n return [4, _a.call(asyncIterable_1)];\n case 7:\n _b.sent();\n _b.label = 8;\n case 8: return [3, 10];\n case 9:\n if (e_2) throw e_2.error;\n return [7];\n case 10: return [7];\n case 11:\n subscriber.complete();\n return [2];\n }\n });\n });\n}\n//# sourceMappingURL=innerFrom.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { __extends } from \"tslib\";\nimport { Subscription } from '../Subscription';\nvar Action = (function (_super) {\n __extends(Action, _super);\n function Action(scheduler, work) {\n return _super.call(this) || this;\n }\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n return this;\n };\n return Action;\n}(Subscription));\nexport { Action };\n//# sourceMappingURL=Action.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var intervalProvider = {\n setInterval: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = intervalProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {\n return delegate.setInterval.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearInterval: function (handle) {\n var delegate = intervalProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=intervalProvider.js.map","import { __extends } from \"tslib\";\nimport { Action } from './Action';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nvar AsyncAction = (function (_super) {\n __extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.pending = false;\n return _this;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n var _a;\n if (delay === void 0) { delay = 0; }\n if (this.closed) {\n return this;\n }\n this.state = state;\n var id = this.id;\n var scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, _id, delay) {\n if (delay === void 0) { delay = 0; }\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (_scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n return undefined;\n };\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, _delay) {\n var errored = false;\n var errorValue;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype.unsubscribe = function () {\n if (!this.closed) {\n var _a = this, id = _a.id, scheduler = _a.scheduler;\n var actions = scheduler.actions;\n this.work = this.state = this.scheduler = null;\n this.pending = false;\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n _super.prototype.unsubscribe.call(this);\n }\n };\n return AsyncAction;\n}(Action));\nexport { AsyncAction };\n//# sourceMappingURL=AsyncAction.js.map","export var dateTimestampProvider = {\n now: function () {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nvar Scheduler = (function () {\n function Scheduler(schedulerActionCtor, now) {\n if (now === void 0) { now = Scheduler.now; }\n this.schedulerActionCtor = schedulerActionCtor;\n this.now = now;\n }\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) { delay = 0; }\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n };\n Scheduler.now = dateTimestampProvider.now;\n return Scheduler;\n}());\nexport { Scheduler };\n//# sourceMappingURL=Scheduler.js.map","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport var asyncScheduler = new AsyncScheduler(AsyncAction);\nexport var async = asyncScheduler;\n//# sourceMappingURL=async.js.map","import { __extends } from \"tslib\";\nimport { Scheduler } from '../Scheduler';\nvar AsyncScheduler = (function (_super) {\n __extends(AsyncScheduler, _super);\n function AsyncScheduler(SchedulerAction, now) {\n if (now === void 0) { now = Scheduler.now; }\n var _this = _super.call(this, SchedulerAction, now) || this;\n _this.actions = [];\n _this._active = false;\n return _this;\n }\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this._active) {\n actions.push(action);\n return;\n }\n var error;\n this._active = true;\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()));\n this._active = false;\n if (error) {\n while ((action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler));\nexport { AsyncScheduler };\n//# sourceMappingURL=AsyncScheduler.js.map","export function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {\n if (delay === void 0) { delay = 0; }\n if (repeat === void 0) { repeat = false; }\n var scheduleSubscription = scheduler.schedule(function () {\n work();\n if (repeat) {\n parentSubscription.add(this.schedule(null, delay));\n }\n else {\n this.unsubscribe();\n }\n }, delay);\n parentSubscription.add(scheduleSubscription);\n if (!repeat) {\n return scheduleSubscription;\n }\n}\n//# sourceMappingURL=executeSchedule.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { operate } from '../util/lift';\nexport function catchError(selector) {\n return operate(function (source, subscriber) {\n var innerSub = null;\n var syncUnsub = false;\n var handledResult;\n innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, function (err) {\n handledResult = innerFrom(selector(err, catchError(selector)(source)));\n if (innerSub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n else {\n syncUnsub = true;\n }\n }));\n if (syncUnsub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n });\n}\n//# sourceMappingURL=catchError.js.map","import { executeSchedule } from '../util/executeSchedule';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function observeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return executeSchedule(subscriber, scheduler, function () { return subscriber.next(value); }, delay); }, function () { return executeSchedule(subscriber, scheduler, function () { return subscriber.complete(); }, delay); }, function (err) { return executeSchedule(subscriber, scheduler, function () { return subscriber.error(err); }, delay); }));\n });\n}\n//# sourceMappingURL=observeOn.js.map","import { operate } from '../util/lift';\nexport function subscribeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n subscriber.add(scheduler.schedule(function () { return source.subscribe(subscriber); }, delay));\n });\n}\n//# sourceMappingURL=subscribeOn.js.map","import { Observable } from '../Observable';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleAsyncIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable(function (subscriber) {\n executeSchedule(subscriber, scheduler, function () {\n var iterator = input[Symbol.asyncIterator]();\n executeSchedule(subscriber, scheduler, function () {\n iterator.next().then(function (result) {\n if (result.done) {\n subscriber.complete();\n }\n else {\n subscriber.next(result.value);\n }\n });\n }, 0, true);\n });\n });\n}\n//# sourceMappingURL=scheduleAsyncIterable.js.map","import { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isReadableStreamLike } from '../util/isReadableStreamLike';\nimport { scheduleReadableStreamLike } from './scheduleReadableStreamLike';\nexport function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n }\n if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n }\n if (isAsyncIterable(input)) {\n return scheduleAsyncIterable(input, scheduler);\n }\n if (isIterable(input)) {\n return scheduleIterable(input, scheduler);\n }\n if (isReadableStreamLike(input)) {\n return scheduleReadableStreamLike(input, scheduler);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\n//# sourceMappingURL=scheduled.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function scheduleObservable(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=scheduleObservable.js.map","import { Observable } from '../Observable';\nexport function scheduleArray(input, scheduler) {\n return new Observable(function (subscriber) {\n var i = 0;\n return scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n }\n else {\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n this.schedule();\n }\n }\n });\n });\n}\n//# sourceMappingURL=scheduleArray.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function schedulePromise(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=schedulePromise.js.map","import { Observable } from '../Observable';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from '../util/isFunction';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleIterable(input, scheduler) {\n return new Observable(function (subscriber) {\n var iterator;\n executeSchedule(subscriber, scheduler, function () {\n iterator = input[Symbol_iterator]();\n executeSchedule(subscriber, scheduler, function () {\n var _a;\n var value;\n var done;\n try {\n (_a = iterator.next(), value = _a.value, done = _a.done);\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n }\n }, 0, true);\n });\n return function () { return isFunction(iterator === null || iterator === void 0 ? void 0 : iterator.return) && iterator.return(); };\n });\n}\n//# sourceMappingURL=scheduleIterable.js.map","import { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nexport function scheduleReadableStreamLike(input, scheduler) {\n return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);\n}\n//# sourceMappingURL=scheduleReadableStreamLike.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { map } from \"../operators/map\";\nvar isArray = Array.isArray;\nfunction callOrApply(fn, args) {\n return isArray(args) ? fn.apply(void 0, __spreadArray([], __read(args))) : fn(args);\n}\nexport function mapOneOrManyArgs(fn) {\n return map(function (args) { return callOrApply(fn, args); });\n}\n//# sourceMappingURL=mapOneOrManyArgs.js.map","import { Observable } from '../Observable';\nimport { argsArgArrayOrObject } from '../util/argsArgArrayOrObject';\nimport { from } from './from';\nimport { identity } from '../util/identity';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nimport { popResultSelector, popScheduler } from '../util/args';\nimport { createObject } from '../util/createObject';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function combineLatest() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n var resultSelector = popResultSelector(args);\n var _a = argsArgArrayOrObject(args), observables = _a.args, keys = _a.keys;\n if (observables.length === 0) {\n return from([], scheduler);\n }\n var result = new Observable(combineLatestInit(observables, scheduler, keys\n ?\n function (values) { return createObject(keys, values); }\n :\n identity));\n return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;\n}\nexport function combineLatestInit(observables, scheduler, valueTransform) {\n if (valueTransform === void 0) { valueTransform = identity; }\n return function (subscriber) {\n maybeSchedule(scheduler, function () {\n var length = observables.length;\n var values = new Array(length);\n var active = length;\n var remainingFirstValues = length;\n var _loop_1 = function (i) {\n maybeSchedule(scheduler, function () {\n var source = from(observables[i], scheduler);\n var hasFirstValue = false;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n values[i] = value;\n if (!hasFirstValue) {\n hasFirstValue = true;\n remainingFirstValues--;\n }\n if (!remainingFirstValues) {\n subscriber.next(valueTransform(values.slice()));\n }\n }, function () {\n if (!--active) {\n subscriber.complete();\n }\n }));\n }, subscriber);\n };\n for (var i = 0; i < length; i++) {\n _loop_1(i);\n }\n }, subscriber);\n };\n}\nfunction maybeSchedule(scheduler, execute, subscription) {\n if (scheduler) {\n executeSchedule(subscription, scheduler, execute);\n }\n else {\n execute();\n }\n}\n//# sourceMappingURL=combineLatest.js.map","import { scheduled } from '../scheduled/scheduled';\nimport { innerFrom } from './innerFrom';\nexport function from(input, scheduler) {\n return scheduler ? scheduled(input, scheduler) : innerFrom(input);\n}\n//# sourceMappingURL=from.js.map","import { map } from './map';\nimport { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { mergeInternals } from './mergeInternals';\nimport { isFunction } from '../util/isFunction';\nexport function mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Infinity; }\n if (isFunction(resultSelector)) {\n return mergeMap(function (a, i) { return map(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom(project(a, i))); }, concurrent);\n }\n else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return operate(function (source, subscriber) { return mergeInternals(source, subscriber, project, concurrent); });\n}\n//# sourceMappingURL=mergeMap.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { executeSchedule } from '../util/executeSchedule';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {\n var buffer = [];\n var active = 0;\n var index = 0;\n var isComplete = false;\n var checkComplete = function () {\n if (isComplete && !buffer.length && !active) {\n subscriber.complete();\n }\n };\n var outerNext = function (value) { return (active < concurrent ? doInnerSub(value) : buffer.push(value)); };\n var doInnerSub = function (value) {\n expand && subscriber.next(value);\n active++;\n var innerComplete = false;\n innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, function (innerValue) {\n onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);\n if (expand) {\n outerNext(innerValue);\n }\n else {\n subscriber.next(innerValue);\n }\n }, function () {\n innerComplete = true;\n }, undefined, function () {\n if (innerComplete) {\n try {\n active--;\n var _loop_1 = function () {\n var bufferedValue = buffer.shift();\n if (innerSubScheduler) {\n executeSchedule(subscriber, innerSubScheduler, function () { return doInnerSub(bufferedValue); });\n }\n else {\n doInnerSub(bufferedValue);\n }\n };\n while (buffer.length && active < concurrent) {\n _loop_1();\n }\n checkComplete();\n }\n catch (err) {\n subscriber.error(err);\n }\n }\n }));\n };\n source.subscribe(createOperatorSubscriber(subscriber, outerNext, function () {\n isComplete = true;\n checkComplete();\n }));\n return function () {\n additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();\n };\n}\n//# sourceMappingURL=mergeInternals.js.map","var isArray = Array.isArray;\nexport function argsOrArgArray(args) {\n return args.length === 1 && isArray(args[0]) ? args[0] : args;\n}\n//# sourceMappingURL=argsOrArgArray.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { combineLatestInit } from '../observable/combineLatest';\nimport { operate } from '../util/lift';\nimport { argsOrArgArray } from '../util/argsOrArgArray';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nimport { pipe } from '../util/pipe';\nimport { popResultSelector } from '../util/args';\nexport function combineLatest() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var resultSelector = popResultSelector(args);\n return resultSelector\n ? pipe(combineLatest.apply(void 0, __spreadArray([], __read(args))), mapOneOrManyArgs(resultSelector))\n : operate(function (source, subscriber) {\n combineLatestInit(__spreadArray([source], __read(argsOrArgArray(args))))(subscriber);\n });\n}\n//# sourceMappingURL=combineLatest.js.map","import { isFunction } from './isFunction';\nimport { isScheduler } from './isScheduler';\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nexport function popResultSelector(args) {\n return isFunction(last(args)) ? args.pop() : undefined;\n}\nexport function popScheduler(args) {\n return isScheduler(last(args)) ? args.pop() : undefined;\n}\nexport function popNumber(args, defaultValue) {\n return typeof last(args) === 'number' ? args.pop() : defaultValue;\n}\n//# sourceMappingURL=args.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","import { asyncScheduler } from '../scheduler/async';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function debounceTime(dueTime, scheduler) {\n if (scheduler === void 0) { scheduler = asyncScheduler; }\n return operate(function (source, subscriber) {\n var activeTask = null;\n var lastValue = null;\n var lastTime = null;\n var emit = function () {\n if (activeTask) {\n activeTask.unsubscribe();\n activeTask = null;\n var value = lastValue;\n lastValue = null;\n subscriber.next(value);\n }\n };\n function emitWhenIdle() {\n var targetTime = lastTime + dueTime;\n var now = scheduler.now();\n if (now < targetTime) {\n activeTask = this.schedule(undefined, targetTime - now);\n subscriber.add(activeTask);\n return;\n }\n emit();\n }\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n lastValue = value;\n lastTime = scheduler.now();\n if (!activeTask) {\n activeTask = scheduler.schedule(emitWhenIdle, dueTime);\n subscriber.add(activeTask);\n }\n }, function () {\n emit();\n subscriber.complete();\n }, undefined, function () {\n lastValue = activeTask = null;\n }));\n });\n}\n//# sourceMappingURL=debounceTime.js.map","import { Observable } from '../Observable';\nexport var EMPTY = new Observable(function (subscriber) { return subscriber.complete(); });\nexport function empty(scheduler) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\nfunction emptyScheduled(scheduler) {\n return new Observable(function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });\n}\n//# sourceMappingURL=empty.js.map","import { EMPTY } from '../observable/empty';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function take(count) {\n return count <= 0\n ?\n function () { return EMPTY; }\n : operate(function (source, subscriber) {\n var seen = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n if (++seen <= count) {\n subscriber.next(value);\n if (count <= seen) {\n subscriber.complete();\n }\n }\n }));\n });\n}\n//# sourceMappingURL=take.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function filter(predicate, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return predicate.call(thisArg, value, index++) && subscriber.next(value); }));\n });\n}\n//# sourceMappingURL=filter.js.map","import { operate } from '../util/lift';\nexport function finalize(callback) {\n return operate(function (source, subscriber) {\n try {\n source.subscribe(subscriber);\n }\n finally {\n subscriber.add(callback);\n }\n });\n}\n//# sourceMappingURL=finalize.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { innerFrom } from '../observable/innerFrom';\nimport { Subject } from '../Subject';\nimport { SafeSubscriber } from '../Subscriber';\nimport { operate } from '../util/lift';\nexport function share(options) {\n if (options === void 0) { options = {}; }\n var _a = options.connector, connector = _a === void 0 ? function () { return new Subject(); } : _a, _b = options.resetOnError, resetOnError = _b === void 0 ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === void 0 ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === void 0 ? true : _d;\n return function (wrapperSource) {\n var connection;\n var resetConnection;\n var subject;\n var refCount = 0;\n var hasCompleted = false;\n var hasErrored = false;\n var cancelReset = function () {\n resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();\n resetConnection = undefined;\n };\n var reset = function () {\n cancelReset();\n connection = subject = undefined;\n hasCompleted = hasErrored = false;\n };\n var resetAndUnsubscribe = function () {\n var conn = connection;\n reset();\n conn === null || conn === void 0 ? void 0 : conn.unsubscribe();\n };\n return operate(function (source, subscriber) {\n refCount++;\n if (!hasErrored && !hasCompleted) {\n cancelReset();\n }\n var dest = (subject = subject !== null && subject !== void 0 ? subject : connector());\n subscriber.add(function () {\n refCount--;\n if (refCount === 0 && !hasErrored && !hasCompleted) {\n resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);\n }\n });\n dest.subscribe(subscriber);\n if (!connection &&\n refCount > 0) {\n connection = new SafeSubscriber({\n next: function (value) { return dest.next(value); },\n error: function (err) {\n hasErrored = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnError, err);\n dest.error(err);\n },\n complete: function () {\n hasCompleted = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnComplete);\n dest.complete();\n },\n });\n innerFrom(source).subscribe(connection);\n }\n })(wrapperSource);\n };\n}\nfunction handleReset(reset, on) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (on === true) {\n reset();\n return;\n }\n if (on === false) {\n return;\n }\n var onSubscriber = new SafeSubscriber({\n next: function () {\n onSubscriber.unsubscribe();\n reset();\n },\n });\n return innerFrom(on.apply(void 0, __spreadArray([], __read(args)))).subscribe(onSubscriber);\n}\n//# sourceMappingURL=share.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function takeWhile(predicate, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var result = predicate(value, index++);\n (result || inclusive) && subscriber.next(value);\n !result && subscriber.complete();\n }));\n });\n}\n//# sourceMappingURL=takeWhile.js.map","import { isFunction } from '../util/isFunction';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { identity } from '../util/identity';\nexport function tap(observerOrNext, error, complete) {\n var tapObserver = isFunction(observerOrNext) || error || complete\n ?\n { next: observerOrNext, error: error, complete: complete }\n : observerOrNext;\n return tapObserver\n ? operate(function (source, subscriber) {\n var _a;\n (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n var isUnsub = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var _a;\n (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);\n subscriber.next(value);\n }, function () {\n var _a;\n isUnsub = false;\n (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n subscriber.complete();\n }, function (err) {\n var _a;\n isUnsub = false;\n (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);\n subscriber.error(err);\n }, function () {\n var _a, _b;\n if (isUnsub) {\n (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n }\n (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);\n }));\n })\n :\n identity;\n}\n//# sourceMappingURL=tap.js.map","import { Subject } from 'rxjs'\nimport { filter, map } from 'rxjs/operators'\nimport { flip, mergeRight, clone, forEach, propSatisfies } from 'ramda'\nexport class ViewStreamObservable {\n constructor(props) {\n /**\n * @module ViewStreamObservable\n * @type internal\n *\n * @constructor\n * @desc\n * Internal observable that creates the ViewStream Observable that branches out to parent, internal and child directions\n */\n this.props.observableStreams = ViewStreamObservable.createDirectionalObservables()\n }\n\n static createDirectionalFiltersObject() {\n const dirInternal = 'internal'\n const dirParent = 'parent'\n const dirChild = 'child'\n return {\n P: [dirParent],\n C: [dirChild],\n PCI: [dirParent, dirInternal, dirChild],\n CI: [dirChild, dirInternal],\n PI: [dirParent, dirInternal],\n PC: [dirParent, dirChild]\n }\n }\n\n static addDefaultDir(obj) {\n const defaults = flip(mergeRight)\n return defaults({ $dir:['internal'] }, clone(obj))\n }\n\n static addDownInternalDir(obj, arr = ['internal', 'down']) {\n const defaults = flip(mergeRight)\n return defaults(clone(obj), { $dir:arr })\n }\n\n static addChildAndInternalDir(obj, arr = ['child', 'down']) {\n const defaults = flip(mergeRight)\n return defaults(clone(obj), { $dir:arr })\n }\n\n static mapToDefaultDir(p) {\n return this.addDefaultDir(p)\n }\n\n static createDirectionalObservables(obs$ = new Subject(), viewName, vsid) {\n if (viewName !== undefined && vsid !== undefined) {\n obs$.viewName = viewName\n obs$.vsid = vsid\n }\n\n const filterStreams = val => propSatisfies(arrType => arrType.includes(val), '$dir')\n const filterParent = filterStreams('parent')\n const filterChild = filterStreams('child')\n const filterInternal = filterStreams('internal')\n\n const addfrom$ = relStr => mergeRight({ from$:relStr })\n const addParentfrom$ = addfrom$('child')\n const addInternalfrom$ = addfrom$('internal')\n const addChildfrom$ = addfrom$('parent')\n\n const raw$ = obs$\n .pipe(filter((payload) => payload !== undefined && payload.action !== undefined))\n\n const toInternal$ = obs$.pipe(filter(filterInternal), map(addInternalfrom$))\n const toParent$ = obs$.pipe(filter(filterParent), map(addParentfrom$))\n const toChild$ = obs$.pipe(filter(filterChild), map(addChildfrom$))\n\n const streamObj = {\n parent: toParent$,\n internal: toInternal$,\n child: toChild$\n }\n\n const completeStream = (arr = []) => {\n const endStream = o => {\n o.complete()\n o.isStopped = true\n }\n\n const setCompleteStream = (str) => {\n if (streamObj[str] !== undefined) {\n const obs$ = streamObj[str]\n endStream(obs$)\n }\n }\n\n if (arr !== undefined && arr.length >= 1) {\n arr.forEach(setCompleteStream)\n }\n }\n const completeAll = () => {\n const completeStream = o => {\n o.complete()\n o.isStopped = true\n }\n forEach(completeStream, [raw$, toInternal$, toParent$, toChild$])\n }\n\n return {\n raw$, toInternal$, toParent$, toChild$, completeAll, completeStream\n }\n }\n}\n","import { DomElement } from './dom-element.js'\nimport { fadein, fadeout } from '../utils/viewstream-animations.js'\nimport { ViewStreamObservable } from '../utils/viewstream-observables.js'\nimport { deepMerge } from '../utils/deep-merge.js'\nimport { Subject, bindCallback } from 'rxjs'\nimport { filter, isNil, pick, props, defaultTo } from 'ramda'\n\nexport class ViewStreamElement {\n /**\n * @module ViewStreamElement\n * @type internal\n * @desc\n * This is an internal class that is part of the ViewStream observable system.\n *\n * @constructor\n * @param {Observable} sink$\n * @param {Object} viewProps\n * @param {String} vsid\n * @param {String} vsName\n *\n */\n constructor(sink$, viewProps = {}, vsid = '', vsName = 'theName') {\n this.addMixins()\n this._state = 'INIT'\n this.vsid = vsid\n this.el = viewProps.el\n this.vsName = vsName\n this.defaults = {\n debug:false,\n extendedHashMethods: {}\n }\n this.options = deepMerge(this.defaults, viewProps)\n const createExtraStatesMethod = (arr) => {\n const [action, funcStr] = arr\n this.options.extendedHashMethods[action] = (p) => this[funcStr](p)\n }\n this.addActionListeners().forEach(createExtraStatesMethod)\n this.options.hashMethods = this.setHashMethods(this.options.extendedHashMethods)\n this.sink$ = sink$\n this.sink$\n .subscribe(this.onObsSinkSubscribe.bind(this))\n\n this.$dirs = ViewStreamObservable.createDirectionalFiltersObject()\n this.addDefaultDir = ViewStreamObservable.addDefaultDir\n this.sourceStreams = ViewStreamObservable.createDirectionalObservables(new Subject(), this.vsName, this.vsid)\n this._source$ = this.sourceStreams.toInternal$ // new Subject();\n }\n\n addActionListeners() {\n return []\n }\n\n setHashMethods(extendedHashMethodsObj = {}) {\n const defaultHashMethods = {\n VS_DETRITUS_COLLECT : (p) => this.onGarbageCollect(p),\n READY_FOR_VS_DETRITUS_COLLECT : (p) => this.onReadyForGC(p),\n EXTIRPATE : (p) => this.onDispose(p),\n VS_SPAWN : (p) => this.onRender(p),\n VS_SPAWN_AND_ATTACH_TO_PARENT : (p) => this.onRenderAndAttachToParent(p),\n VS_SPAWN_AND_ATTACH_TO_DOM : (p) => this.onRenderAndAttachToDom(p),\n ATTACH_CHILD_TO_SELF : (p) => this.onAttachChildToSelf(p)\n }\n return deepMerge(defaultHashMethods, extendedHashMethodsObj)\n }\n\n createDomItem() {\n this.props = this.props !== undefined ? this.props : {}\n const removeIsNil = (val) => val !== undefined\n const attrs = filter(removeIsNil, pick(['id', 'className'], this.props))\n const { tagName, data, template } = this.props\n return new DomElement(tagName, attrs, data, template)\n }\n\n onDisposeCompleted(d) {\n // console.log('bv self disposed after animateOut ', d, this);\n }\n\n animateInTween(el, time) {\n fadein(el, time)\n }\n\n animateOutTween(el, time, callback) {\n // console.log('anim out ', {el, time, callback});\n fadeout(el, time, callback)\n }\n\n setAnimateIn(d) {\n if (d.animateIn === true) {\n const el = d.el !== undefined ? d.el : this.domItem.el\n this.animateInTween(el, d.animateInTime)\n }\n }\n\n /**\n *\n * @param {Object} d\n * @returns payload that confirms dispose\n */\n\n disposeMethod(d) {\n const el = d.el.el !== undefined ? d.el.el : d.el // DOM ITEMS HAVE THEIR EL ITEMS NESTED\n\n const gcData = { action:'READY_FOR_VS_DETRITUS_COLLECT', $dir:this.$dirs.PI, el }\n\n const animateOut = (d, callback) => {\n this.animateOutTween(el, d.animateOutTime, callback)\n }\n\n const fadeOutObs = bindCallback(animateOut)\n const onFadeoutCompleted = (e) => {\n this._source$.next(gcData)\n }\n\n const onFadeoutObs = (d) => {\n fadeOutObs(d)\n .subscribe(onFadeoutCompleted)\n return { action:'EXTIRPATING', $dir:this.$dirs.CI }\n }\n const onEmptyObs = () => ({ action:'EXTIRPATE_AND_READY_FOR_VS_DETRITUS_COLLECT', $dir:this.$dirs.CI })\n const fn = d.animateOut === true ? onFadeoutObs : onEmptyObs\n return fn(d)\n }\n\n onDispose(d) {\n return this.disposeMethod(d)\n }\n\n removeStream() {\n // this.sourceStreams.completeAll();\n if (this.sourceStreams !== undefined) {\n this.sourceStreams.completeStream(['internal', 'child'])\n }\n }\n\n onReadyForGC(p) {\n this.removeStream()\n }\n\n onGarbageCollect(p) {\n if (this.domItem !== undefined) {\n this.domItem.unmount()\n }\n\n if (this.sourceStreams !== undefined) {\n this.sourceStreams.completeStream(['parent'])\n }\n\n delete this\n }\n\n getSourceStream() {\n return this._source$\n }\n\n combineDomItems(d) {\n if (this.el !== undefined) {\n return\n }\n\n const container = isNil(d.query) ? d.node : d.query\n const prepend = (node, item) => node.insertBefore(item, node.firstChild)\n const append = (node, item) => node.appendChild(item)\n const after = (node, item) => node.after(item)\n\n const defaultFn = prepend\n const attachTypeHash = {\n appendChild : append,\n after\n }\n // DETERMINE WHETHER TO USE APPEND OR PREPEND\n // ON CONNECTING DOM ITEMS TO EACH OTHER\n // let attachFunc = d.attachType === 'appendChild' ? append : prepend;\n const attachFunc = attachTypeHash[d.attachType] || defaultFn\n attachFunc(container, this.domItem.render())\n this.setAnimateIn(d)\n }\n\n /**\n *\n * @param p\n * @returns payload to append child element to current element\n */\n\n onAttachChildToSelf(p) {\n const data = p.childRenderData\n this.combineDomItems(data)\n return {\n action: 'CHILD_ATTACHED',\n $dir: this.$dirs.PI\n }\n }\n\n /**\n *\n * @param {Object} d\n * @returns payload that attaches current child element to parent\n */\n onRenderAndAttachToParent(d) {\n this.onRender(d)\n this.combineDomItems(d)\n return {\n action: 'VS_SPAWNED_AND_ATTACHED_TO_PARENT',\n el: this.el || this.domItem.el,\n $dir: this.$dirs.PI\n }\n }\n\n renderDomItem(d) {\n const [tagName, attributes, data, template] = d\n this.domItem = new DomElement({ tagName, attributes, data, template })\n return this.domItem\n }\n\n onRender(d) {\n const getEl = (data) => this.renderDomItem(data)\n const el = this.el || getEl(props(['tagName', 'domAttributes', 'data', 'template'], d))\n return {\n action: 'VS_SPAWNED',\n el,\n $dir: this.$dirs.I\n }\n }\n\n extendedMethods(data) {\n }\n\n /**\n *\n * @param d\n * @returns\n * Payload containing the action, internal observable and element.\n */\n onRenderAndAttachToDom(d) {\n const getEl = (data) => this.renderDomItem(data)\n d.attachData.el = getEl(props(['tagName', 'domAttributes', 'data', 'template'], d))\n this.combineDomItems(d.attachData)\n return {\n action: 'VS_SPAWNED_AND_ATTACHED_TO_DOM',\n el: this.el || d.attachData.el.el,\n $dir: this.$dirs.CI\n }\n }\n\n /**\n *\n * The ViewStream directs all relevant actions to the DomElement to render and dispose of itself\n *\n * @param {Object} payload\n */\n onObsSinkSubscribe(payload) {\n const action = payload.action\n const defaultToFn = defaultTo((data) => this.extendedMethods(data))\n const fn = defaultToFn(this.options.hashMethods[action])\n const data = fn(payload)\n const sendData = (d) => this._source$.next(d)\n if (data !== undefined) {\n sendData(Object.freeze(data))\n }\n }\n\n addMixins() {\n // ==================================\n // BASE CORE MIXINS\n // ==================================\n // let coreMixins = baseCoreMixins();\n }\n}\n","import { forEach } from 'ramda'\nexport function gc() {\n const cleanup = () => {\n const loopM = m => undefined\n forEach(loopM, this)\n }\n setTimeout(cleanup, 1)\n}\n","import { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { safeClone } from '../utils/safe-clone.js'\nimport { gc } from '../utils/gc.js'\nimport {\n compose,\n clone,\n fromPairs,\n toPairs,\n is\n} from 'ramda'\n\nexport class ViewStreamPayload {\n /**\n *\n * Observables sent from ViewStreams to Channels are validated by this class\n *\n * @module ViewStreamPayload\n * @type internal\n *\n * @constructor\n * @param {String} name\n * @param {Observable} observable\n * @param {Object} data\n * @param {String} action\n * @param {Boolean} debug\n */\n constructor(name, observable, data, action = 'subscribe', debug = false) {\n // this.addMixins();\n const options = {\n name,\n observable,\n data,\n action\n }\n this.sendToDirectorStream(options)\n }\n\n sendToDirectorStream(payload) {\n const directorStream$ = SpyneAppProperties.channelsMap.getStream('DISPATCHER')\n const frozenPayload = safeClone(payload)\n // console.log(\"VS PAYLOAD \",frozenPayload);\n directorStream$.next(frozenPayload)\n payload = undefined\n\n delete this\n }\n\n static deepClone(o) {\n const isArr = is(Array)\n const isObj = is(Object)\n const isIter = ob => isArr(ob) === false && isObj(ob) === true\n const isIterable = isIter(o)\n return isIterable ? compose(fromPairs, toPairs, clone)(o) : clone(o)\n }\n\n static getMouseEventKeys() {\n return ['altKey', 'bubbles', 'cancelBubble', 'cancelable', 'clientX', 'clientY', 'composed', 'ctrlKey', 'currentTarget', 'defaultPrevented', 'detail', 'eventPhase', 'fromElement', 'isTrusted', 'layerX', 'layerY', 'metaKey', 'movementX', 'movementY', 'offsetX', 'offsetY', 'pageX', 'pageY', 'path', 'relatedTarget', 'returnValue', 'screenX', 'screenY', 'shiftKey', 'sourceCapabilities', 'srcElement', 'target', 'timeStamp', 'toElement', 'type', 'view', 'which', 'x', 'y']\n }\n\n addMixins() {\n this.gc = gc\n }\n}\n","import { baseStreamsMixins } from '../utils/mixins/base-streams-mixins.js'\nimport { convertDomStringMapToObj } from '../utils/frp-tools.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { fromEvent } from 'rxjs'\nimport { map } from 'rxjs/operators'\nimport { clone, omit } from 'ramda'\nconst isDevMode = SpyneAppProperties.debug === true\n\nexport class ViewStreamBroadcaster {\n /**\n * The class takes in all of the elements from the 'broadcastEvents' method and directs the events to either the UI or ROUTE channels\n * @module ViewStreamBroadcaster\n * @type internal\n *\n * @constructor\n * @param {Object} props\n * @param {Function} broadcastFn\n */\n\n constructor(props, broadcastFn) {\n this.addMixins()\n this.props = props\n this.broadcastFn = broadcastFn\n this.broadcaster(this.broadcastFn)\n }\n\n addDblClickEvt(q) {\n const dblclick$ = fromEvent(q, 'dblclick')\n // console.log('ADDING DBL CLICK ', q);\n const stream$ = dblclick$.pipe(\n map(p => {\n const data = clone(p)\n // ADD DOUBLECLICK TO UI EVENTS\n data.typeOverRide = 'dblclick'\n return data\n }))\n return stream$\n }\n\n // ==================================================================\n // BROADCAST BUTTON EVENTS\n // ==================================================================\n broadcast(args) {\n if (args.length <= 0 && isDevMode === true) {\n console.warn(`Spyne Warning: The nested array in ${this.props.name}.broadcastEvents appears to be empty --> vsid:${this.props.vsid}!`)\n return\n }\n // payloads to send, based on either the array or the elements dataMap\n const channelPayloads = {\n UI: this.sendUIPayload,\n ROUTE: this.sendRoutePayload\n }\n // spread operator to select variables from arrays\n const [selector, event, local] = args\n // btn query\n let channel // hoist channel and later check if chnl exists\n let query = this.props.el.querySelectorAll(selector)\n\n if (query.length <= 0) {\n const el = this.props.el\n const checkParentEls = (element) => {\n if (element === el) {\n query = [element]\n }\n }\n\n const pluckElFromParent = () => {\n const elParent = el.parentElement !== null ? el.parentElement : document\n const elSelected = elParent.querySelectorAll(selector)\n elSelected.forEach = Array.prototype.forEach\n elSelected.forEach(checkParentEls)\n }\n\n pluckElFromParent()\n }\n\n const isLocalEvent = local !== undefined\n const addObservable = (q) => {\n // the btn observable\n const observable = event !== 'dblClick'\n ? fromEvent(q, event, { preventDefault: () => true })\n : this.addDblClickEvt(q)\n // select channel and data values from either the array or the element's dom Map\n channel = q.dataset.channel// ifNilThenUpdate(chnl, q.dataset.channel);\n const data = {}// convertDomStringMapToObj(q.dataset);\n data.payload = convertDomStringMapToObj(q.dataset)\n data.payload = omit(['channel'], data.payload)\n if (data.channel === 'ROUTE') {\n data.payload.endPreventDefault = true\n }\n\n data.channel = channel\n // payload needs vsid# to pass verification\n\n data.srcElement = {}// pick(['vsid','viewName'], data);\n data.srcElement.id = this.props.id\n data.srcElement.vsid = this.props.vsid\n data.srcElement.isLocalEvent = isLocalEvent\n // data.srcElement['viewName'] = this.props.name;\n data.srcElement.srcEvent = event\n data.srcElement.el = q\n // select the correct payload\n\n function getValidChannel(ch) {\n if (ch === 'ROUTE' || ch === 'CHANNEL_ROUTE') {\n return 'ROUTE'\n }\n if (ch !== 'UI' && ch !== 'CHANNEL_UI' && ch !== undefined) {\n console.warn(`SpyneJS warning: The channel, ${ch}, is not allowed here, only \"UI\" or \"ROUTE\" are valid channels, defaulting to CHANNEL_UI`)\n }\n return 'UI'\n }\n\n const channelPayload = channelPayloads[getValidChannel(channel)]\n // run payload\n channelPayload(observable, data)\n }\n const queryIsNil = query === undefined || query.length <= 0\n if (queryIsNil === true && isDevMode === true) {\n console.warn(`Spyne Warning: The item ${selector}, does not appear to exist in ${this.props.name} --> vsid:${this.props.vsid}!`)\n\n // addObservable(query, event);\n } else {\n query.forEach = Array.prototype.forEach\n query.forEach(addObservable)\n }\n }\n\n broadcaster(arrFn) {\n const broadcastArr = arrFn()\n broadcastArr.forEach(args => this.broadcast(args))\n }\n\n // =================================================================\n addMixins() {\n // ==================================\n // BASE STREAM MIXINS\n // ==================================\n const streamMixins = baseStreamsMixins()\n this.sendUIPayload = streamMixins.sendUIPayload\n this.sendRoutePayload = streamMixins.sendRoutePayload\n }\n}\n","import { ViewStreamPayload } from '../../views/view-stream-payload.js'\n\nexport function baseStreamsMixins() {\n return {\n testFunc: function(str) {\n console.log('stream mixin is ', str)\n },\n sendRoutePayload: function(obs, data) {\n /** TODO: ADD A CHECK FOR END ROUTE AND TRANSFORM TO EMPTY */\n return new ViewStreamPayload('CHANNEL_ROUTE', obs, data, 'subscribe')\n },\n sendUIPayload: function(obs, data) {\n return new ViewStreamPayload('CHANNEL_UI', obs, data, 'subscribe')\n }\n /*\n sendInfoToChannel: function(channelName, payload) {\n const getProp = str => prop(str, this.props);\n const channel = channelName;\n let srcElement = {\n vsid: getProp('vsid'),\n el: getProp('el'),\n viewName: getProp('name')\n };\n let data = {\n payload, channel, srcElement\n };\n return new ViewStreamPayload(channelName, new of(''), data,\n 'subscribe');\n },\n */\n /* sendLifeStreamPayload: function(obs, data) {\n return new ViewStreamPayload('LIFESTREAM', obs, data, 'subscribe');\n },\n\n createLifeStreamPayload: function(STEP, data = {}, type = 'parent') {\n let viewId = `${this.props.name}: ${this.props.vsid}`;\n return new LifestreamPayload('LIFESTREAM', STEP, type, viewId, data).data;\n } */\n }\n}\n","import {\n is,\n reject,\n isNil,\n find,\n allPass,\n forEachObjIndexed,\n not,\n isEmpty,\n always,\n compose,\n equals,\n prop,\n where,\n defaultTo,\n mergeAll,\n F,\n omit,\n flatten,\n any,\n curry,\n lte\n , map as rMap\n} from 'ramda'\n\nimport { SpyneAppProperties } from './spyne-app-properties.js'\n\nconst isNotArr = compose(not, is(Array))\nconst isNotEmpty = compose(not, isEmpty)\nconst isNonEmptyStr = allPass([is(String), isNotEmpty])\nconst isNonEmptyArr = allPass([is(Array), isNotEmpty])\nconst isObjectFn = compose(allPass([isNotArr, is(Object)]))\nconst isNonEmptyObjectFn = compose(allPass([isNotEmpty, isNotArr, is(Object)]))\n\nconst isString = (val) => is(String, val)\nconst isBoolean = (val) => is(Boolean, val)\nconst isNumber = (val) => is(Number, val)\nconst isArrayFn = (val) => is(Array, val)\n\nexport class ChannelPayloadFilter {\n /**\n * @module ChannelPayloadFilter\n * @type util\n *\n *\n * @desc\n * <p>This utility filters ChannelPayload objects by using query selectors and/or by comparing data properties</p>\n * <h3>The ChannelPayloadFilter features</h3>\n * <ul>\n * <li>Can be used by Channels and ViewStreams</li>\n * <li>ChannelPayloadFilter instances can be used as the third parameter when binding actions to ViewStream methods.</li>\n * <li>Selectors can be a query string, an array of selector strings, or the selector can be an actual dom element.</li>\n * <li>Selectors are not required and can be disregarded by adding \"\" or undefined as the selector property.</li>\n * <li>The data object compares the values from the props() method of a ChannelPayload object</li>\n * <li>Internally, The data object is conformed to a spec object for ramda&rsquo;s EXT['where', '//ramdajs.com/docs/#where'] method</li>\n * </ul>\n *\n * @constructor\n * @property {String|Array|HTMLElement} selector The matching element\n * @param {Object} filters Object that contains the selector, props, and debugLabel params.\n * @property {Object} propFilters A json object containing filtering methods for channel props variables.\n *\n * @property {String|Array|HTMLElement} selector - = ''; The matching element.\n * @property {Object} propFilters - = {}; A json object containing comprators for any expected property values.\n * @returns Boolean\n *\n *\n * @example\n * TITLE['<h4>Filtering using Selectors and a Property Comparator Within a ViewStream Instance</h4>']\n * const mySelectors = ['ul', 'li:first-child'];\n * const propFilters = {\n * linkType: \"external\"\n * };\n * const myFilter = new ChannelPayloadFilter(mySelectors, propFilters);\n *\n * addActionListeners() {\n * return [\n * ['CHANNEL_UI_CLICK_EVENT', 'onClickEvent', myFilter]\n * ]\n * }\n *\n * @example\n * TITLE['<h4>Filtering Using Method and String Comparators Within a ViewStream Instance</h4>']\n * const propFilters = {\n * type: \"scrolling-element\",\n * scrollNum: (n)=>n>=1200 && n<=5000;\n * };\n * const myFilter = new ChannelPayloadFilter('', propFilters);\n *\n * addActionListeners() {\n * return [\n * ['CHANNEL_UI_CLICK_EVENT', 'onClickEvent', myFilter]\n * ]\n * }\n *\n *\n * @example\n * TITLE['<h4>A Simple Property Filtering Example Within a Channel Instance</h4>']\n * // Filter for a button with a data type of 'link'\n * const myFilter = new ChannelPayloadFilter('' {type: \"link\"});\n *\n * this.getChannel(\"CHANNEL_UI\")\n * .pipe(filter(myFilter))\n * .subscribe(myChannelMethod);\n *\n */\n constructor(selector, filters = {}, debugLabel, testMode) {\n const selectorIsObj = isObjectFn(selector)\n\n if (selectorIsObj) {\n filters = selector\n selector = prop('selector', filters)\n testMode = testMode || prop('testMode', filters)\n }\n\n const debugLabelArr = [debugLabel, prop('debugLabel', filters)]\n\n debugLabel = compose(find(is(String)))(debugLabelArr)\n\n let props = omit(['debugLabel', 'label', 'selector', 'props', 'testMode', 'propFilters'], filters)\n if (filters.props !== undefined) {\n props = mergeAll([filters.props, props])\n } else if (filters.propFilters !== undefined) {\n props = mergeAll([filters.propFilters, props])\n }\n\n filters.propFilters = props\n\n const { propFilters } = filters\n\n const addStringSelectorFilter = isNonEmptyStr(selector) ? ChannelPayloadFilter.filterSelector([selector], debugLabel) : undefined\n const addArraySelectorFilter = isNonEmptyArr(selector) ? ChannelPayloadFilter.filterSelector(selector, debugLabel) : undefined\n const addDataFilter = isNonEmptyObjectFn(propFilters) ? ChannelPayloadFilter.filterData(propFilters, debugLabel) : undefined\n\n let filtersArr = reject(isNil, [addStringSelectorFilter, addArraySelectorFilter, addDataFilter])\n\n // IF ARRAY IS EMPTY ALWAYS RETURN FALSE;\n\n const filtersAreEmpty = isEmpty(filtersArr)\n\n if (filtersAreEmpty) {\n filtersArr = [always(false)]\n if (SpyneAppProperties.debug === true && testMode !== true) {\n console.warn(`Spyne Warning: The Channel Filter, with selector: ${selector}, and propFilters:${propFilters} appears to be empty!`)\n }\n }\n if (testMode === true) {\n return { selector, propFilters, debugLabel, filters, testMode, filtersAreEmpty }\n }\n\n return allPass(filtersArr)\n }\n\n static filterData(filterJson, filterdebugLabel) {\n const debugLabel = filterdebugLabel\n\n const compareData = () => {\n // DO NOT ALLOW AN EMPTY OBJECT TO RETURN TRUEs\n if (isEmpty(filterJson)) {\n return always(false)\n }\n\n // CHECKS ALL VALUES IN JSON TO DETERMINE IF THERE ARE FILTERING METHODS\n\n const createCurryComparator = compareStr => (str) => {\n return str === compareStr\n }\n const checkToConvertToFn = (val, key, obj) => {\n let fnVal = F\n if (isString(val) || isBoolean(val) || isNumber(val)) {\n fnVal = createCurryComparator(val)\n } else if (typeof val === 'function') {\n return val\n } else if (isArrayFn(val) || isObjectFn(val)) {\n console.warn(\n `ChannelPayloadFilter: Property \"${val}\" is an array/object, which is not allowed. ` +\n 'This property will always return false.'\n )\n return fnVal\n }\n return fnVal\n }\n filterJson = rMap(checkToConvertToFn, filterJson)\n\n // TAP LOGGER\n const tapLogger = (comparedObj) => {\n if (debugLabel === undefined) {\n return comparedObj\n }\n const propsBooleans = {}\n const mapBools = (value, key) => {\n propsBooleans[key] = value(prop(key, comparedObj))\n }\n forEachObjIndexed(mapBools, filterJson)\n console.log(`%c CHANNEL PAYLOAD FILTER DEBUGGER [\"${debugLabel}\"] - values: `, 'color:orange;', { propsBooleans, comparedObj })\n\n return comparedObj\n }\n\n // END TAP LOGGER\n const fMethod = where(filterJson)\n\n const getFilteringObj = (v) => {\n const { payload, srcElement, event } = v || {}\n const o = Object.assign({}, v, srcElement, event, payload)\n // console.log('o is ',o);\n return o\n }\n\n return compose(fMethod, tapLogger, defaultTo({}), getFilteringObj)\n }\n\n return compareData()\n }\n\n static checkPayloadSelector(arr, debugLabel, srcPayload) {\n // ELEMENT FROM PAYLOADs\n const { payload, srcElement, event } = srcPayload || {}\n\n const reduceFindEl = (acc, src) => {\n const el = prop('el', src)\n if (ChannelPayloadFilter.elIsDomElement(el) && acc === undefined) {\n acc = el\n }\n return acc\n }\n\n const el = [srcElement, payload, prop('srcElement', event), srcPayload].reduce(reduceFindEl, undefined)\n\n // RETURN BOOLEAN MATCH WITH PAYLOAD EL\n const compareEls = (elCompare) => elCompare.isEqualNode((el))\n\n // LOOP THROUGH NODES IN querySelectorAll()\n const mapNodeArrWithEl = (sel) => {\n // convert nodelist to array of els\n const nodeArr = Array.from(document.querySelectorAll(sel))\n // els array to boolean array\n return rMap(compareEls, nodeArr)\n }\n\n if (debugLabel !== undefined) {\n const nodeArrResultsDebugger = compose(flatten, rMap(mapNodeArrWithEl))(arr)\n const selectorsArr = arr\n console.log(`%c CHANNEL PAYLOAD FILTER DEBUGGER [\"${debugLabel}\"] - selectors: `, 'color:orange;', { el, selectorsArr, nodeArrResultsDebugger })\n }\n\n // CHECK IF PAYLOAD EL EXISTS\n if (typeof (el) !== 'object') {\n return false\n }\n\n // LOOP THROUGH ALL SELECTORS IN MAIN ARRAY\n const nodeArrResult = compose(flatten, rMap(mapNodeArrWithEl))(arr)\n if (isEmpty(nodeArrResult) === true) {\n return false\n }\n\n return any(equals(true), nodeArrResult)\n }\n\n static elIsDomElement(o) {\n if (is(String, o)) {\n o = document.querySelector(o)\n }\n\n return compose(lte(0), defaultTo(-1), prop('nodeType'))(o)\n }\n\n static filterSelector(selectorArr, debugLabel) {\n const arr = reject(isEmpty, selectorArr)\n const payloadCheck = curry(ChannelPayloadFilter.checkPayloadSelector)\n return payloadCheck(arr, debugLabel)\n }\n}\n","import { head, compose, reject, split, isEmpty, lte, defaultTo, prop } from 'ramda'\nimport { spyneWarn } from '../utils/spyne-warn.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\n\nfunction generateSpyneSelectorId(el) {\n const num = () => Math.random().toString(36).replace(/\\d/gm, '').substring(1, 8)\n let vsid = `${num()}`\n if (el.dataset.vsid === undefined) {\n el.dataset.vsid = vsid\n } else {\n vsid = el.dataset.vsid\n }\n return `[data-vsid='${vsid}']`\n}\n\nfunction isDevMode() {\n return SpyneAppProperties.debug === true\n}\n\nfunction isNodeElement(el) {\n const nodeCheck = compose(lte(0), defaultTo(-1), prop('nodeType'))\n return nodeCheck(el)\n}\n\nfunction getElOrList(cxt, sel, verboseBool = false) {\n const list = getNodeListArray(cxt, sel, verboseBool)\n return list.length === 1 ? head(list) : list\n}\n\nfunction testSelectors(cxt, sel, verboseBool) {\n const el = document.querySelector(cxt)\n\n const elIsDomElement = compose(lte(0), defaultTo(-1), prop('nodeType'))\n\n if (el !== null && elIsDomElement(el) === false) {\n spyneWarn(`Spyne Warning: the el object is not a valid single element, ${el}`)\n return\n }\n\n if (sel !== undefined && String(sel).trim().length > 0) {\n function isValidSelector(selector) {\n try {\n const elements = document.querySelectorAll(selector)\n return elements.length > 0 // Returns true if the selector is valid and selects at least one element\n } catch (e) {\n return false // Catching an exception means the selector is invalid\n }\n }\n\n const isValidSelectorBool = isValidSelector(sel)\n if (verboseBool === true && isDevMode() === true && isValidSelectorBool === false) {\n spyneWarn(`Spyne Warning: the selector, ${sel} does not exist in this el, ${cxt}`)\n }\n }\n}\n\nfunction getNodeListArray(cxt, sel, verboseBool = false) {\n const selector = sel !== undefined ? `${cxt} ${sel}` : cxt\n let isParent = false\n\n const returnSelectorIfValid = (selector) => {\n let arr = []\n try {\n arr = document.querySelectorAll(selector)\n } catch (e) { arr = [] }\n try {\n isParent = document.querySelector(sel) === document.querySelector(cxt)\n if (isParent === true) {\n arr = [document.querySelector(sel)]\n }\n } catch (e) {\n // return [];\n }\n return arr// document.querySelectorAll(selector);\n }\n\n const elArr = returnSelectorIfValid(selector)\n\n if (verboseBool === true) {\n const mainSel = isParent === true ? 'body' : cxt\n testSelectors(mainSel, sel, verboseBool)\n }\n\n return elArr\n}\n\nfunction setInlineCss(val, cxt, sel) {\n const arr = getNodeListArray(cxt, sel)\n const addInlineCss = item => {\n item.style.cssText = val\n }\n arr.forEach(addInlineCss)\n return this\n}\n\n/**\n *\n * @module ViewStreamSelector\n * @type util\n *\n * @param {String|El} cxt The main element\n * @param {String|El} The selector as a String\n * @returns {function(*=)}\n * @constructor\n */\n\nfunction ViewStreamSelector(cxt, sel) {\n cxt = typeof (cxt) === 'string' ? cxt : generateSpyneSelectorId(cxt)\n testSelectors(cxt, sel, false)\n\n function selector(sel) {\n return ViewStreamSelector(cxt, sel)\n }\n\n /**\n * Convenience method to map through a NodeList.\n *\n * @param {Function} fn\n * @returns An array of elements\n */\n selector.map = (fn) => Array.from(getNodeListArray(cxt, sel)).map(fn)\n\n /**\n * Convenience method to iterate through a NodeList\n *\n * @param {Function} fn\n * @returns An array of elements\n */\n selector.forEach = (fn) => Array.from(getNodeListArray(cxt, sel)).map(fn)\n\n /**\n *\n * Adds the class to the Element or to the NodeList.\n * @param {String} c\n *\n *\n * @property {String} c - = undefined; The class to be added.\n *\n **/\n selector.addClass = (c) => {\n const arr = getNodeListArray(cxt, sel)\n const addClass = item => item.classList.add(c)\n arr.forEach(addClass)\n return selector\n }\n\n /**\n *\n * @param {String} c\n * @desc Removes the class to the Element or to the NodeList.\n */\n selector.removeClass = (c) => {\n const arr = getNodeListArray(cxt, sel)\n const removeClass = item => {\n item.classList.remove(c)\n }\n arr.forEach(removeClass)\n return selector\n }\n\n /**\n *\n * @param {String} c\n * @desc Sets the class to equal exactly the class string.\n */\n selector.setClass = (c) => {\n const arr = getNodeListArray(cxt, sel)\n /**\n * NON IE CLEANER SOLUTION\n * const removeClass = item => item.classList = c;\n * arr.forEach(removeClass);\n */\n\n const setTheClass = item => {\n const removeClassStrArr = compose(reject(isEmpty), split(' '))(item.className)\n const classStrArr = c.split(' ')\n const remover = s => item.classList.remove(s)\n const adder = sel => item.classList.add(sel)\n removeClassStrArr.forEach(remover)\n classStrArr.forEach(adder)\n }\n arr.forEach(setTheClass)\n return selector\n }\n\n selector.unmount = () => {\n // console.log('unmounting selector ', this);\n }\n\n /**\n *\n * @param {String} c\n * @param {Boolean} bool Default is undefined.\n * @desc Sets the class based on the provided boolean or the toggles the class.\n *\n * @example\n * this.props.el$.toggleClass('myclass', true);\n *\n */\n selector.toggleClass = (c, bool) => {\n const arr = getNodeListArray(cxt, sel)\n const toggleClass = item => {\n bool = bool !== undefined ? bool : !item.classList.contains(c)\n bool ? item.classList.add(c) : item.classList.remove(c)\n }\n arr.forEach(toggleClass)\n return selector\n }\n\n selector.toggle = (c, bool) => {\n selector.toggleClass(c, bool)\n return selector\n }\n\n /**\n * Attaches html to the Selector's element (the first match when the\n * selector matches multiple elements).\n * @param htmlElement\n */\n selector.appendChild = (htmlElement) => {\n const el = selector.el\n if (el !== null) {\n el.appendChild(htmlElement)\n } else {\n spyneWarn(`Spyne Warning: The selector, ${sel} does not appear to be valid!`)\n }\n\n return selector.el\n }\n\n /**\n *\n * Adds class with a delay of 1ms to allow css to register a transition.\n * @param c\n */\n selector.addAnimClass = (c) => {\n const delayAddClass = () => {\n const arr = getNodeListArray(cxt, sel)\n const addClass = item => {\n try {\n item.classList.add(c)\n } catch (e) {\n }\n }\n arr.forEach(addClass)\n }\n requestAnimationFrame(delayAddClass)\n return selector\n }\n\n /**\n *\n * @param {String} c\n * @param {String|HTMLElement} elSel The selector for the element.\n * @desc Sets the class active HTMLElement from a NodeList.\n */\n selector.setActiveItem = (c, elSel) => {\n const arr = getNodeListArray(cxt, sel)\n const currentEl = typeof elSel === 'string'\n ? getElOrList(cxt, elSel)\n : elSel\n\n arr.forEach(item => item.classList.remove(c))\n\n if (isNodeElement(currentEl) === true) {\n const matchingEl = Array.from(arr).find(item => item === currentEl)\n\n if (matchingEl) {\n matchingEl.classList.add(c)\n } else if (isDevMode() === true) {\n spyneWarn(\n `Spyne Warning: The selector, ${elSel}, is valid but does not match any item in setActiveItem: ${c}`\n )\n }\n } else if (isDevMode() === true) {\n spyneWarn(\n `Spyne Warning: The selector, ${elSel}, does not appear to be a valid item in setActiveItem: ${c}`\n )\n }\n\n return selector\n }\n\n /**\n *\n * @function el\n *\n * @desc\n * getter that always resolves to a single element: the matched element,\n * or the first item when the selector matches multiple elements (a\n * warning is logged in debug mode).\n *\n * @returns\n * An HTMLElement, or null when the selector matches nothing\n * (mirroring querySelector)\n */\n\n /**\n *\n * @function els\n *\n * @desc\n * getter that always resolves to an Array of the matched elements.\n *\n * @returns\n * An Array of HTMLElements; empty when the selector matches nothing\n */\n\n /**\n *\n * @function length\n *\n * @desc\n * Determines the length of the NodeList\n *\n * @returns\n * The number of elements matched by the selector\n */\n\n /**\n *\n * @function exists\n *\n * @desc\n * Determines whether an the selected element exists\n *\n * @returns\n * Boolean\n */\n\n const getElsArray = (verboseBool = true) => Array.from(getNodeListArray(cxt, sel, verboseBool))\n\n Object.defineProperty(selector, 'el', {\n get: () => {\n const list = getElsArray()\n if (list.length > 1 && isDevMode() === true) {\n spyneWarn(`Spyne Warning: el$(\"${sel !== undefined ? sel : cxt}\").el matched ${list.length} elements; returning the first. Use .els for the full list.`)\n }\n return list.length >= 1 ? list[0] : null\n }\n })\n Object.defineProperty(selector, 'els', { get: () => getElsArray() })\n Object.defineProperty(selector, 'arr', { get: () => getElsArray() })\n\n // Undocumented. Retains the pre-0.24 polymorphic el contract — a single\n // element, a NodeList, or an empty NodeList depending on match count —\n // to assist in debugging and migrating older SpyneJS apps.\n Object.defineProperty(selector, 'elLegacy', { get: () => getElOrList(cxt, sel, true) })\n Object.defineProperty(selector, 'len', { get: () => getNodeListArray(cxt, sel, false).length })\n Object.defineProperty(selector, 'length', { get: () => getNodeListArray(cxt, sel, false).length })\n Object.defineProperty(selector, 'exists', { get: () => getNodeListArray(cxt, sel, false).length >= 1 })\n\n Object.defineProperty(selector, 'inline', { set: (val) => setInlineCss(val, cxt, sel), get: () => selector })\n Object.defineProperty(selector, 'inlineCss', { set: (val) => setInlineCss(val, cxt, sel), get: () => selector })\n\n return selector\n}\n\nexport { ViewStreamSelector }\n","import { baseCoreMixins } from '../utils/mixins/base-core-mixins.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { deepMerge } from '../utils/deep-merge.js'\nimport { safeClone } from '../utils/safe-clone.js'\nimport {\n findStrOrRegexMatchStr,\n getConstructorName\n} from '../utils/frp-tools.js'\nimport { ViewStreamElement } from './view-stream-element.js'\nimport { registeredStreamNames } from '../channels/channels-config.js'\nimport { ViewStreamBroadcaster } from './view-stream-broadcaster.js'\nimport { ViewStreamPayload } from './view-stream-payload.js'\nimport { ChannelPayloadFilter } from '../utils/channel-payload-filter.js'\nimport { ViewStreamObservable } from '../utils/viewstream-observables.js'\nimport { ViewStreamSelector } from './view-stream-selector.js'\nimport { Subject, of } from 'rxjs'\nimport { mergeMap, map, takeWhile, filter, tap, skip, finalize } from 'rxjs/operators'\nimport {\n pick,\n compose,\n isNil,\n all,\n forEach,\n toLower,\n either,\n findIndex,\n apply,\n test,\n flatten,\n prop,\n always,\n lte,\n defaultTo,\n propSatisfies,\n allPass,\n curry,\n is,\n slice,\n path,\n omit,\n ifElse,\n mergeRight,\n where,\n equals\n , map as rMap\n} from 'ramda'\n\nexport class ViewStream {\n /**\n * @module ViewStream\n *\n * @desc\n *\n * <p>ViewStream is the interactive-view component, and its core functionality is comprised of two internal components: </p>\n <ul class='basic'>\n *\n */\n constructor(props = {}) {\n this.vsnum = Math.random()\n this.addMixins()\n this._postRenderCalled = false\n this.defaults = () => {\n const vsid = this.createId()\n const id = props.id ? props.id : vsid\n return {\n vsid,\n id,\n tagName: 'div',\n el: undefined,\n data: undefined,\n animateIn: false,\n animateInTime: 0.5,\n animateOut: false,\n animateOutTime: 0.5,\n sendLifecyleEvents: false,\n hashId: `#${id}`,\n id$: `#${id}`,\n viewClass: ViewStreamElement,\n extendedSourcesHashMethods: {},\n debug: false,\n template: undefined,\n node: document.createDocumentFragment(),\n name: getConstructorName(this)\n }\n }\n this._state = {}\n this.$dirs = ViewStreamObservable.createDirectionalFiltersObject()\n this.addDefaultDirection = ViewStreamObservable.addDefaultDir\n this.addDownInternalDir = ViewStreamObservable.addDownInternalDir\n // this.props = Object.assigREADY_FOR_VS_DETRITUS_COLLECTn({}, this.defaults(), props);\n this.props = deepMerge(this.defaults(), props)\n this.sendLifecycleMethod = this.props.sendLifecyleEvents === true ? this.sendLifecycleMethodActive.bind(this) : this.sendLifecycleMethodInactive.bind(this)\n const attributesArr = this.attributesArray\n // let attributesArr = ['id', 'class', 'dataset'];\n this.props.domAttributes = pick(attributesArr, this.props)\n if (this.props.traits !== undefined) {\n this.addTraits(this.props.traits)\n }\n this.loadAllMethods()\n this.props.action = 'LOADED'\n this.sink$ = new Subject()\n this.props.elIsAlreadyRenderedBool = this.elAlreadyExistsFn(this.props)\n const ViewClass = this.props.viewClass\n this.view = new ViewClass(this.sink$, { el:this.props.el }, this.props.vsid, this.props.id)// new this.props.viewClass(this.sink$);\n this.sourceStreams = this.view.sourceStreams\n this._rawSource$ = this.view.getSourceStream()\n this._rawSource$.viewName = this.props.name\n this.sendEventsDownStream = this.sendEventsDownStreamFn\n this.initViewStream()\n this.isDevMode = ViewStream.isDevMode()\n this.props.addedChannels = []\n this.checkIfElementAlreadyExists()\n }\n\n // ============================= HASH KEY AND SPIGOT METHODS==============================\n get source$() {\n return this._source$\n }\n\n get attributesArray() {\n return [\n // Global Attributes\n 'accesskey', 'class', 'contenteditable', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'style', 'tabindex', 'title', 'translate',\n\n // Accessiblity Attributes\n 'aria-autocomplete', 'aria-checked', 'aria-disabled', 'aria-expanded', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-label', 'aria-level', 'aria-multiline', 'aria-multiselectable', 'aria-orientation', 'aria-pressed', 'aria-readonly', 'aria-required', 'aria-selected', 'aria-sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext', 'aria-atomic', 'aria-busy', 'aria-live', 'aria-relevant', 'aria-dropeffect', 'aria-grabbed', 'aria-activedescendant', 'aria-controls', 'aria-describedby', 'aria-flowto', 'aria-labelledby', 'aria-owns', 'aria-posinset', 'aria-setsize',\n\n // Specific Attributes for input\n 'accept', 'autocomplete', 'autofocus', 'checked', 'dirname', 'disabled', 'form', 'formaction',\n 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'list', 'max', 'maxlength',\n 'min', 'minlength', 'multiple', 'name', 'pattern', 'placeholder', 'readonly', 'required', 'size', 'step', 'value',\n\n // Specific Attributes for img\n 'alt', 'srcset', 'sizes', 'usemap', 'ismap',\n\n // Specific Attributes for a and link\n 'href', 'target', 'download', 'ping', 'rel', 'hreflang', 'as', 'media',\n\n // Specific Attributes for form\n 'accept-charset', 'action', 'enctype', 'novalidate',\n\n // Specific Attributes for meta\n 'content', 'charset', 'http-equiv',\n\n // Specific Attributes for script\n 'async', 'defer', 'integrity', 'nomodule', 'nonce', 'referrerpolicy',\n\n // Other Element-specific Attributes\n 'autocapitalize', 'autoplay', 'buffered', 'challenge', 'cite', 'code', 'codebase', 'color', 'cols', 'colspan', 'contextmenu', 'controls', 'coords', 'crossorigin', 'csp', 'dataset', 'datetime', 'decoding', 'default', 'for', 'headers', 'high', 'icon', 'importance', 'itemprop', 'keytype', 'kind', 'label', 'language', 'lazyload', 'loop', 'low', 'manifest', 'method', 'muted', 'open', 'optimum', 'poster', 'preload', 'radiogroup', 'reversed', 'role', 'rows', 'rowspan', 'sandbox', 'scope', 'scoped', 'selected', 'shape', 'slot', 'span', 'srcdoc', 'src', 'type', 'srclang', 'start', 'summary', 'wrap', 'width', 'height'\n ]\n }\n\n static isDevMode() {\n return SpyneAppProperties.debug\n }\n\n static checkIfActionsAreRegistered(channelsArr = [], actionsArr) {\n if (actionsArr.length > 0) {\n const getAllActions = (a) => {\n const getRegisteredActionsArr = (str) => SpyneAppProperties.getChannelActions(str)\n const arr = a.map(getRegisteredActionsArr)\n return flatten(arr)\n }\n const checkForMatch = (strMatch) => {\n const re = new RegExp(strMatch)\n const actionIndex = findIndex(test(re), getAllActionsArr)\n if (actionIndex < 0) {\n const channelSyntax = channelsArr.length === 1 ? 'from added channel' : 'from added channels'\n console.warn(`Spyne Warning: The action, ${strMatch}, in ${this.props.name}, does not match any of the registered actions ${channelSyntax}, ${channelsArr.join(', ')}`)\n }\n // const vsnum = ()=> R.test(new RegExp(str), \"CHANNEL_ROUTE_TEST_EVENT\")\n }\n const getAllActionsArr = getAllActions(channelsArr)\n actionsArr.forEach(checkForMatch)\n }\n }\n\n /**\n *\n * Add any query within the ViewStream's dom and any dom events to automatically be observed by the UI Channel.\n * <br>\n * @example\n *\n * broadcastEvents() {\n * // ADD BUTTON EVENTS AS NESTED ARRAYS\n * return [\n * ['#my-button', 'mouseover'],\n * ['#my-input', 'change']\n * ]\n * }\n *\n *\n * */\n\n static isValidNestedArr(eventsArr) {\n const isTrue = equals(true)\n const allIsTrue = all(isTrue)\n const isString = is(String)\n const isValidArr = compose(allIsTrue, rMap(isString), slice(0, 2), defaultTo([]))\n const mapEventsArrFn = compose(allIsTrue, rMap(isValidArr), defaultTo([]))\n return mapEventsArrFn(eventsArr)\n }\n\n static elIsDomElement(o) {\n if (is(String, o)) {\n o = document.querySelector(o)\n }\n\n return compose(lte(0), defaultTo(-1), prop('nodeType'))(o)\n }\n\n updatePropsToMatchEl() {\n const getTagName = compose(toLower, either(prop('tagName'), always('')))\n this.props.tagName = getTagName(this.props.el)\n }\n\n // =====================================================================\n\n elAlreadyExistsFn(props) {\n const elIsDomElement = compose(lte(0), defaultTo(-1), prop('nodeType'))\n const elIsRendered = el => document.body.contains(el)\n return propSatisfies(allPass([elIsRendered, elIsDomElement]), 'el')(props)\n }\n\n checkIfElementAlreadyExists() {\n if (this.props.elIsAlreadyRenderedBool === true) {\n this.updatePropsToMatchEl()\n this.postRender()\n } else if (this.props.el === null) {\n console.error(`Spyne Error: The defined element for this ViewStream instance, ${this.constructor.name}, appears to not exist.`)\n }\n }\n\n loadAllMethods() {\n const channelFn = curry(this.onChannelMethodCall.bind(this))\n const createExtraStatesMethod = (arr) => {\n let [action, funcStr, actionFilter] = arr\n if (is(String, actionFilter)) {\n actionFilter = new ChannelPayloadFilter({ selector:actionFilter })\n }\n this.props.extendedSourcesHashMethods[action] = channelFn(funcStr,\n actionFilter)\n }\n this.addActionListeners().forEach(createExtraStatesMethod)\n this.props.hashSourceMethods = this.setSourceHashMethods(\n this.props.extendedSourcesHashMethods)\n }\n\n /**\n * Binds channel actions to local methods, formatted as array values.\n * <ul>\n * <li><b>First value:</b> Action name, as a string or as a basic Regular Expression.\n * <li><b>Second value:</b> The method to be called when the action is published.\n * <li><b>Third optional value:</b> This is a filter option that can be a selector string. or an instance of the LINK['channelPayloadFilter', 'channel-payload-filter'].\n * </ul>\n * @example\n * addActionListeners() {\n * return [\n * ['CHANNEL_UI_CLICK_EVENT', 'onClickEvent', 'li.myclass'],\n * ['CHANNEL_MY_CUSTOM_EVENT', 'onActionReturned']\n * ]\n * }\n *\n * @returns Nested Array\n */\n addActionListeners() {\n return []\n }\n\n onChannelMethodCall(str, actionFilter, p) {\n const runFunc = (payload) => {\n if (this[str] === undefined) {\n console.warn(`Spyne Warning: The method, ${str} does not appear to exist in ${this.constructor.name}!`)\n } else {\n this[str](payload)\n }\n }\n\n if (p.$dir !== undefined && p.$dir.includes('child') &&\n this.deleted !== true) {\n const obj = deepMerge({}, p)// Object.assign({}, p);\n obj.$dir = this.$dirs.C\n this.sourceStreams.raw$.next(obj)\n }\n const filterPayload = defaultTo(always(true), actionFilter)\n\n if (filterPayload(p) === true) {\n p = omit(['$dir'], p)\n runFunc(p)\n }\n }\n\n setSourceHashMethods(extendedSourcesHashMethods = {}) {\n const hashSourceKeys = {\n EXTIRPATING: (p) => this.checkParentDispose(p),\n EXTIRPATE: (p) => this.disposeViewStream(p),\n // 'CHILD_EXTIRPATE' : (p) => this.disposeViewStream(p),\n VS_SPAWNED: (p) => this.onVSRendered(p),\n VS_SPAWNED_AND_ATTACHED_TO_DOM: (p) => this.onVSRendered(p),\n VS_SPAWNED_AND_ATTACHED_TO_PARENT: (p) => this.onVSRendered(p),\n // 'CHILD_VS_SPAWNED' : (p) => this.attachChildToView(p),\n READY_FOR_VS_DETRITUS_COLLECT: (p) => this.onReadyToGC(p),\n VS_NULLITY: () => ({})\n }\n return deepMerge.all([{}, hashSourceKeys, extendedSourcesHashMethods])\n }\n\n // ====================== MAIN STREAM METHODS ==========================\n initViewStream() {\n this._source$ = this._rawSource$.pipe(map(\n (payload) => this.onMapViewSource(payload)), takeWhile(this.notGCSTATE))\n\n this.initAutoMergeSourceStreams()\n this.updateSourceSubscription(this._source$, true)\n }\n\n notGCSTATE(p) {\n return !p.action.includes('READY_FOR_VS_DETRITUS_COLLECT')\n }\n\n eqGCSTATE(p) {\n return !p.action.includes('READY_FOR_VS_DETRITUS_COLLECT')\n }\n\n notCOMPLETED(p) {\n return !p.action.includes('COMPLETED')\n }\n\n notGCCOMPLETE(p) {\n return !p.action.includes('GC_COMPLETE')\n }\n\n testVal(p) {\n console.log('TESTING VALL IS ', p)\n }\n\n addParentStream(obs, attachData) {\n const filterOutNullData = (data) => data !== undefined && data.action !==\n undefined\n const checkIfDisposeOrFadeout = (d) => {\n const data = deepMerge({}, d)\n\n if (data.action === 'EXTIRPATE_AND_READY_FOR_VS_DETRITUS_COLLECT') {\n this.disposeViewStream(data)\n data.action = 'READY_FOR_VS_DETRITUS_COLLECT'\n }\n return data\n }\n\n this.parent$ = obs.pipe(\n filter(filterOutNullData),\n map(checkIfDisposeOrFadeout))\n this.updateSourceSubscription(this.parent$, false, 'PARENT')\n this.renderAndAttachToParent(attachData)\n }\n\n addChildStream(obs$) {\n const filterOutNullData = (data) => data !== undefined && data.action !==\n undefined\n const child$ = obs$.pipe(\n filter(filterOutNullData),\n tap(p => this.tracer('addChildStraem do ', p)),\n map((p) => {\n return p\n }),\n finalize(p => this.onChildCompleted(child$.source)))\n this.updateSourceSubscription(child$, true, 'CHILD')\n }\n\n onChildDisposed(p) {\n\n }\n\n // =======================================================================================\n\n onChildCompleted(p) {\n const findName = (x) => {\n const finalDest = (y) => {\n while (y.destination !== undefined) {\n y = finalDest(y.destination)\n }\n return y\n }\n return pick(['id', 'vsid'], finalDest(x))\n }\n const childCompletedData = findName(p)\n this.tracer('onChildCompleted ', this.vsnum, p)\n // console.log('obj is ',childCompletedName,obj,this.props);\n this.onChildDisposed(childCompletedData, p)\n return childCompletedData\n }\n\n initAutoMergeSourceStreams() {\n // ====================== SUBSCRIPTION SOURCE =========================\n const subscriber = {\n next: this.onSubscribeToSourcesNext.bind(this),\n error: this.onSubscribeToSourcesError.bind(this),\n complete: this.onSubscribeToSourcesComplete.bind(this)\n }\n // let takeBeforeGCOld = (val) => val.action !== 'VS_DETRITUS_COLLECTED';\n // let takeBeforeGC = (p) => !p.action.includes('READY_FOR_VS_DETRITUS_COLLECT');\n // let mapToState = (val) => ({action:val});\n // =====================================================================\n // ========== METHODS TO CHECK FOR WHEN TO COMPLETE THE STREAM =========\n const completeAll = () => {\n this.props.el$ = undefined\n this.uberSource$.complete()\n this.autoSubscriber$.complete()\n this.sink$.complete()\n this.props = undefined\n this.deleted = true\n this.tracer('completeAll', this.deleted, this.props)\n }\n const decrementOnObservableClosed = () => {\n obsCount -= 1\n if (obsCount === 0) {\n completeAll()\n }\n }\n // =====================================================================\n // ======================== INIT STREAM METHODS ========================\n let obsCount = 0\n this.uberSource$ = new Subject()\n // ======================= COMPOSED RXJS OBSERVABLE ======================\n const incrementObservablesThatCloses = () => { obsCount += 1 }\n this.autoMergeSubject$ = this.uberSource$.pipe(mergeMap((obsData) => {\n const branchObservable$ = obsData.observable.pipe(filter(\n (p) => p !== undefined && p.action !== undefined), map(p => {\n // console.log('PAYLOAD IS ', p, this.constructor.name)\n const payload = deepMerge({}, p)\n payload.action = p.action// addRelationToState(obsData.rel, p.action);\n this.tracer('autoMergeSubject$', payload)\n return payload\n }))\n\n if (obsData.autoClosesBool === false) {\n return branchObservable$\n } else {\n incrementObservablesThatCloses()\n return branchObservable$.pipe(finalize(decrementOnObservableClosed))\n }\n }))\n // ============================= SUBSCRIBER ==============================\n this.autoSubscriber$ = this.autoMergeSubject$\n // .do((p) => console.log('SINK DATA ', this.constructor.name, p))\n .pipe(filter((p) => p !== undefined && p.action !== undefined))\n .subscribe(subscriber)\n }\n\n // ========================= MERGE STREAMS TO MAIN SUBSCRIBER =================\n updateSourceSubscription(obs$, autoClosesBool = false, rel) {\n // const directionArr = sendDownStream === true ? this.$dirs.DI : this.$dirs.I;\n const obj = {\n observable: obs$,\n autoClosesBool,\n rel\n }\n this.tracer('updateSourceSubscription ', this.vsnum, obj)\n this.uberSource$.next(obj)\n }\n\n // ============================= SUBSCRIBER METHODS ==============================\n onSubscribeToSourcesNext(payload = {}) {\n const defaultToFn = defaultTo((p) => this.sendExtendedStreams(p))\n\n // ****USE REGEX AS PREDICATE CHECK FOR PAYLOAD.ACTION IN HASH METHODS OBJ\n // const hashAction = this.props.hashSourceMethods[payload.action];\n const hashActionStr = findStrOrRegexMatchStr(this.props.hashSourceMethods,\n payload.action)\n const hashAction = this.props.hashSourceMethods[hashActionStr]\n // console.log('S PAYLOAD ', this.props.name, typeof (hashAction), payload);\n\n const fn = defaultToFn(hashAction)\n\n // console.log('hash methods ', fn, this.props.name, payload.action, hashActionStr, this.props.hashSourceMethods);\n\n fn(payload)\n // console.log(fn, payload, ' THE PAYLOAD FROM SUBSCRIBE IS ', ' ---- ', ' ---> ', this.props);\n // console.log('EXTIRPATER VS NEXT', this.constructor.name, payload);\n\n this.tracer('onSubscribeToSourcesNext', { payload })\n }\n\n onSubscribeToSourcesError(payload = '') {\n console.log('ALL ERROR ', this.constructor.name, payload)\n }\n\n /*\n attachChildToView(data) {\n // let childRenderData = data.attachData;\n // console.log('CHILD DATA ', this.constructor.name, childRenderData);\n // this.openSpigot('ATTACH_CHILD_TO_SELF', {childRenderData});\n }\n */\n\n onSubscribeToSourcesComplete() {\n // console.log('==== EXTIRPATER ALL COMPLETED ====', this.constructor.name);\n this.tracer('onSubscribeToSourcesComplete', 'VS_DETRITUS_COLLECT')\n\n this.openSpigot('VS_DETRITUS_COLLECT')\n }\n\n sendExtendedStreams(payload) {\n this.tracer('sendExtendedStreams', payload)\n // console.log('extended methods ', payload.action, payload);\n this.openSpigot(payload.action, payload)\n }\n\n // ===================================== VS_SPAWN METHODS ==================================\n renderAndAttachToParent(attachData) {\n // let childRenderData = attachData;\n this.openSpigot('VS_SPAWN_AND_ATTACH_TO_PARENT', attachData)\n }\n\n renderView() {\n this.openSpigot('VS_SPAWN')\n }\n\n renderViewAndAttachToDom(node, type, attachType) {\n const attachData = { node, type, attachType }\n this.openSpigot('VS_SPAWN_AND_ATTACH_TO_DOM', { attachData })\n }\n\n // ===================================== EXTIRPATE METHODS =================================\n checkParentDispose(p) {\n if (p.from$ === 'parent') {\n this.disposeViewStream(p)\n }\n }\n\n onBeforeDispose() {\n\n }\n\n // ===================================== SINK$ METHODS =================================\n\n /**\n *\n * Wraps window.setTimeout with a check to see if \"this\" ViewStream element and its props property still exists\n * @property {function} fn - = 'function'; The local method that is to be called.\n * @property {number} ms - = 0; The time, in milleseconds, for the timeout.\n * @property {boolean} bind - = false; When true, will bind the method to 'this'.\n *\n */\n\n setTimeout(fn, ms = 0, bind = false) {\n const timeoutMethod = (...args) => {\n if (this !== undefined && this.props !== undefined) {\n const methodFn = bind === true ? fn.bind(this) : fn\n apply(methodFn, args)\n }\n }\n window.setTimeout(timeoutMethod, ms)\n }\n\n /**\n *\n * Begins the removal process of the ViewStream instance along with all of its chained ViewStream children.\n */\n disposeViewStream(p) {\n // console.log('EXTIRPATER VS onDispose ', this.constructor.name);\n this.onBeforeDispose()\n this.openSpigot('EXTIRPATE')\n }\n\n onChildDispose(p) {\n }\n\n onParentDisposing(p) {\n // this.updateSourceSubscription(this._source$);\n this.openSpigot('EXTIRPATE')\n }\n\n onReadyToGC(p) {\n const isInternal = p.from$ !== undefined && p.from$ === 'internal'\n if (isInternal) {\n // this.openSpigot('VS_DETRITUS_COLLECT');\n }\n this.tracer('onReadyToGC', isInternal, p)\n }\n\n openSpigot(action, obj = {}) {\n if (this.props !== undefined) {\n this.props.action = action\n const data = mergeRight(this.props, obj)\n // let data = Object.assign({}, this.props, obj);\n\n this.sink$.next(Object.freeze(data))\n }\n }\n\n setAttachData(attachType, query) {\n const checkQuery = () => {\n const q = this.props.el.querySelector(query)\n const isDevMode = ViewStream.isDevMode()\n if (isDevMode === true && is(String, query) && isNil(q)) {\n console.warn(`Spyne Warning: The appendView query in ${this.props.name}, '${query}', appears to not exist!`)\n }\n return q\n }\n\n return {\n node: this.props.el,\n type: 'ViewStreamObservable',\n attachType,\n query: checkQuery(query)\n }\n }\n\n getParentEls(el, num) {\n const getElem = el => el.parentElement\n let iter = 0\n let parentEl = el\n while (iter < num) {\n parentEl = getElem(parentEl)\n iter++\n }\n return parentEl\n }\n\n setAttachParentData(attachType, query, level) {\n query = query !== '' ? query : undefined\n const node = this.getParentEls(this.props.el, level)\n return {\n node,\n type: 'ViewStreamObservable',\n attachType,\n query: node.querySelector(query)\n }\n }\n\n onMapViewSource(payload = {}) {\n this.props = mergeRight(this.props, payload)\n return payload\n }\n\n // ====================== ATTACH STREAM AND DOM DATA AGGREGATORS==========================\n exchangeViewsWithChild(childView, attachData) {\n this.addChildStream(childView.sourceStreams.toParent$)\n childView.addParentStream(this.sourceStreams.toChild$, attachData)\n }\n\n /**\n * Appends a ViewStream object to an existing dom element.\n * @param {HTMLElement} node the ViewStream child that is to be attached.\n * @example\n * // returns\n * <body>\n * <h2>Hello World</h2>\n * </body>\n *\n * let viewStream = new ViewStream('h2', 'Hello World');\n * viewStream.appendToDom(document.body);\n *\n */\n appendToDom(node) {\n // console.log(\"append to dom \",this.props.vsid, this.props.el);\n if (this.props.el !== undefined) {\n console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be appendedToDom. This may create unsusual side effects!`)\n }\n this.renderViewAndAttachToDom(node, 'dom', 'appendChild')\n }\n\n appendToDomAfter(node) {\n if (this.props.el !== undefined) {\n console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be appendedToDomAfter. This may create unsusual side effects!`)\n }\n this.renderViewAndAttachToDom(node, 'dom', 'after')\n }\n\n /**\n * Prepends the current ViewStream object to an existing dom element.\n * @param {HTMLElement} node the ViewStream child that is to be attached.\n *\n * @example\n * this.prependToDom(document.body);\n *\n */\n\n prependToDom(node) {\n if (this.props.el !== undefined) {\n console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be prependedToDom. This may create unsusual side effects!`)\n }\n this.renderViewAndAttachToDom(node, 'dom', 'prependChild')\n }\n\n /**\n * This method appends a child ViewStream object. <br>After the attachment, rxjs observables are exchanged between the parent and child ViewStream objects.<br><br>\n * @param {ViewStream} v the ViewStream child that is to be attached.\n * @param {string} query a querySelector within this ViewStream.\n *\n * @example\n * // returns\n * <body>\n * <main>\n * <h2>Hello World</h2>\n * </main>\n * </body>\n *\n *\n * let parentView = new ViewStream('main');\n * parentView.appendToDom(document.body);\n *\n * let childView = new ViewStream({tagName:'h2', data:'Hello World'};\n * parentView.appendView(childView)\n *\n * */\n appendView(v, query) {\n this.exchangeViewsWithChild(v, this.setAttachData('appendChild', query))\n }\n\n appendViewAfter(v, query) {\n this.exchangeViewsWithChild(v, this.setAttachData('after', query))\n }\n\n /**\n * This method appends a child ViewStream object to a parent ViewStream object.\n * @param {ViewStream} v the ViewStream parent.\n * @param {string} query a querySelector within this ViewStream.\n * @param {level} this parameters can attach the viewStream's dom element up the dom tree while still maintaining the parent-child relationship of the ViewStream objects.\n *\n * @example\n * // returns\n * <body>\n * <main>\n * <h2>Hello World</h2>\n * </main>\n * </body>\n *\n *\n * let parentView = new ViewStream('main');\n * parentView.appendToDom(document.body);\n *\n * let childView = new ViewStream({tagName:'h2', data:'Hello World'};\n * childView.appendToParent(parentView)\n *\n * */\n\n appendViewToParentEl(v, query, level = 1) {\n this.exchangeViewsWithChild(v,\n this.setAttachParentData('appendChild', query, level))\n }\n\n /**\n * This method prepends a child ViewStream object to a parent ViewStream object.\n * @param {ViewStream} v\n * @param {string} query\n * @param {number} level\n *\n * @property {ViewStream} v - = undefined; the ViewStream parent.\n * @property {string} query - = undefined; a querySelector within this ViewStream.\n * @property {number} level - = 1; this parameter can attach the viewStream's dom element up the dom tree while still maintaining the parent-child relationship of the ViewStream objects.\n *\n * @example\n * let parentView = new ViewStream('main');\n * parentView.prependToDom(document.body);\n *\n * let childView = new ViewStream({tagName:'h2', data:'Hello World'};\n * childView.prependViewToParentEl(parentView)\n *\n * */\n prependViewToParentEl(v, query, level = 1) {\n this.exchangeViewsWithChild(v,\n this.setAttachParentData('prependChild', query, level))\n }\n\n /**\n *\n *\n * This method prepends a child ViewStream object to the current ViewStream object. <br>After the attachment, rxjs observables are exchanged between the parent and child ViewStream objects.<br><br>\n * @param {ViewStream} v the ViewStream child that is to be attached.\n * @param {string} query a querySelector within this ViewStream.\n *\n * @example\n * // returns\n * <body>\n * <main>\n * <h2>Hello World</h2>\n * </main>\n * </body>\n *\n * let parentView = new ViewStream('main');\n * parentView.appendToDom(document.body);\n *\n * let childView = new ViewStream({tagName:'h2', data:'Hello World'};\n * parentView.prependView(childView);\n *\n * */\n\n prependView(v, query) {\n this.exchangeViewsWithChild(v, this.setAttachData('prependChild', query))\n }\n\n /**\n * Appends a ViewStream object that are not rendered to the #spyne-null-views div.\n */\n appendToNull() {\n const node = document.getElementById('spyne-null-views')\n this.renderViewAndAttachToDom(node, 'dom', 'appendChild')\n }\n\n onVSRendered(payload) {\n // console.log('VS_SPAWN: ', this.props.name, payload);\n if (payload.from$ === 'internal') {\n // this.props['el'] = payload.el.el;\n\n this.postRender()\n // this.broadcaster = new Spyne.ViewStreamBroadcaster(this.props, this.broadcastEvents);\n }\n }\n\n postRender() {\n if (this._postRenderedCalled === true) {\n return\n }\n\n this.beforeAfterRender()\n this.afterRender()\n\n this.onRendered()\n const startAnimFrameAfterRendered = () => this.onAnimFrameAfterRendered()\n requestAnimationFrame(startAnimFrameAfterRendered)\n\n if (this.isDevMode === true) {\n const eventsArr = this.broadcastEvents()\n const isValidArr = ViewStream.isValidNestedArr(eventsArr)\n if (isValidArr === false) {\n console.warn(`Spyne Warning: The array returned from broadcastEvents in ${this.props.name}, '${JSON.stringify(eventsArr)}', does not appear to be properly formatted!`)\n }\n }\n this.initializeChannels()\n this.viewsStreamBroadcaster = new ViewStreamBroadcaster(this.props, this.broadcastEvents.bind(this))\n this.afterBroadcastEvents()\n\n this._postRenderedCalled = true\n }\n\n addTraits(traits) {\n if (traits.constructor.name !== 'Array') {\n traits = [traits]\n }\n const addTrait = (TraitClass) => {\n new TraitClass(this)\n }\n\n traits.forEach(addTrait)\n }\n\n // ================================= METHODS TO BE EXTENDED ==============================\n\n afterBroadcastEvents() {\n if (this.isDevMode === true) {\n const pullActionsFromList = (arr) => arr[0]\n const nestedActionsArr = this.addActionListeners()\n\n const actionsArr = nestedActionsArr.map(pullActionsFromList)\n\n const isValidArr = ViewStream.isValidNestedArr(nestedActionsArr)\n\n if (isValidArr === false) {\n console.warn(`Spyne Warning: The array returned from addActionsListeners in ${this.props.name}, '${JSON.stringify(nestedActionsArr)}', does not appear to be properly formatted!`)\n } else {\n const checkForExistingMethod = (arr) => {\n const method = defaultTo('', arr[1])\n const isMethod = is(Function, this[method])\n if (isMethod === false) {\n console.warn(`Spyne Warning: The method in addActionListeners nested Array, '${JSON.stringify(arr)}', in ${this.props.name}, does not appear to exist!`)\n }\n }\n compose(forEach(checkForExistingMethod), defaultTo([]))(nestedActionsArr)\n }\n\n const delayForProxyChannelResets = () => {\n if (path(['props', 'addedChannels'], this) !== undefined) {\n ViewStream.checkIfActionsAreRegistered.bind(this)(this.props.addedChannels, actionsArr)\n }\n }\n this.setTimeout(delayForProxyChannelResets, 500)\n }\n }\n\n setDataVSID() {\n this.props.el.dataset.vsid = this.props.vsid// String(this.props.vsid).replace(/^(vsid-)(.*)$/, '$2');\n }\n\n beforeAfterRender() {\n /* let dm2 = function(el) {\n return function(str = '') {\n return new DomItemSelectors(el, str);\n };\n }; */\n\n // this.props.el$ = dm2(this.props.el);\n this.setDataVSID()\n this.props.el$ = ViewStreamSelector(this.props.el)\n // console.log('EL IS ', this.props.el$.elArr);\n // window.theEl$ = this.props.el$;\n }\n\n // THIS IS AN EVENT HOLDER METHOD BECAUSE SENDING DOWNSTREAM REQUIRE THE PARENT TO HAVE A METHOD\n downStream() {\n\n }\n\n /**\n *\n * This method is called as soon as the element has been rendered.\n *\n */\n\n onRendered() {\n }\n\n /**\n *\n * This method is useful to add animation classes to be called immediately after rendering.\n *\n */\n\n onAnimFrameAfterRendered() {\n }\n\n /**\n *\n * (Deprecated. Use onRendered). This method is called as soon as the element has been rendered.\n *\n */\n\n afterRender() {\n }\n\n broadcastEvents() {\n // ADD BUTTON EVENTS AS NESTED ARRAYS\n return []\n }\n\n /**\n *\n * Automatically connect to an instance of registered channels, such as 'DOM', 'UI', and 'ROUTE' channels.\n *\n *\n * @example\n *\n * let uiChannel = this.getChannel('UI');\n *\n * uiChannel\n * .filter((p) => p.data.id==='#my-button')\n * .subscribe((p) => console.log('my button was clicked ', p));\n *\n * */\n\n getChannel(channel) {\n const isValidChannel = c => registeredStreamNames().includes(c)\n const error = c => console.warn(\n `channel name ${c} is not within ${registeredStreamNames}`)\n const startSubscribe = (c) => {\n const obs$ = SpyneAppProperties.channelsMap.getStream(c).observer\n\n return obs$.pipe(takeWhile(p => this.deleted !== true))\n }// getGlobalParam('streamsController').getStream(c).observer;\n\n const fn = ifElse(isValidChannel, startSubscribe, error)\n\n return fn(channel)\n }\n\n /**\n * CHECKS TO SEE IF CHANNELS HAVE BEEN ADDED TO props.channels object;\n */\n initializeChannels() {\n const addChannel = (channel) => {\n const [channelName, skipFirst = false] = Array.isArray(channel) ? channel : [channel]\n this?.addChannel(channelName, skipFirst)\n }\n if (Array.isArray(this?.props?.channels)) {\n this?.props?.channels?.forEach(addChannel)\n } else if (Array.isArray(this?.props?.channel)) {\n console.warn('props.channel is not a ViewStream property. Do you mean props.channels?')\n }\n }\n\n /**\n *\n * Preferred method to connect to instances of registered channels, such as 'DOM', 'UI', and 'ROUTE' channels.\n *\n * Add Channel will automatically unsubscribe to the channel, whereas the getChannel method requires the developer to manually unsubscribe.\n *\n * @param {string} str The name of the registered Channel that was added to the Channels Controller.\n * @param {boolean} bool false, add true if the View should wait for this channel to unsubscribe before removing itself.\n * @param {sendDownStream} bool The direction where the stream is allowed to travel.\n *\n * @example\n *\n * let routeChannel = this.addChannel('ROUTE');\n *\n * addActionListeners() {\n * return [\n * ['CHANNEL_ROUTE_CHANGE_EVENT', 'onMapRouteEvent']\n * ]\n * }\n *\n * onMapRouteEvent(p) {\n * console.log('the route value is ', p);\n * }\n *\n *\n * */\n\n addChannel(channelName, skipFirst = false, sendDownStream = false, bool = false) {\n const directionArr = sendDownStream === true ? this.$dirs.CI : this.$dirs.I\n const mapDirection = p => {\n // et p2 = defaultTo({}, clone(p));\n const pl = p// || {};\n pl.$dir = directionArr\n return pl\n // return deepMerge(dirObj, p2);\n // Object.assign({$dir: directionArr}, clone(p))\n }\n if (this?.props?.addedChannels?.includes(channelName) === true) {\n // CHECKS IF CHANNEL HAS ALREADY BEEN ADDED\n return\n }\n const isLocalEventCheck = path(['srcElement', 'isLocalEvent'])\n const cidCheck = path(['srcElement', 'vsid'])\n const cidMatches = p => {\n const vsid = cidCheck(p)\n const isLocalEvent = isLocalEventCheck(p)\n const filterEvent = isLocalEvent !== true || vsid === this.props.vsid\n // console.log(\"checks \",vsid,this.props.vsid, isLocalEvent,filterEvent);\n return filterEvent\n }\n\n const pipeArr = [map(mapDirection), filter(cidMatches)]\n if (skipFirst === true) {\n pipeArr.unshift(skip(1))\n }\n\n const channel$ = this.getChannel(channelName).pipe(...pipeArr)\n this.updateSourceSubscription(channel$, false)\n this.props.addedChannels.push(channelName)\n }\n\n checkIfChannelExists(channelName) {\n const channelExists = SpyneAppProperties.channelsMap.testStream(channelName)\n if (channelExists !== true) {\n console.warn(`SPYNE WARNING: The ChannelPayload from ${this.props.name}, has been sent to a channel, ${channelName}, that has not been registered!`)\n }\n return channelExists\n }\n\n /**\n *\n * @param {String} channelName\n * @param {Object} payload\n * @param {String} action\n * @property {string} channelName - = undefined; The name of the registered Channel.\n * @property {object} payload - = {}; The main data to send to the channel.\n * @property {string} action - = \"VIEWSTREAM_EVENT\"; The action sent to the channel.\n * @desc\n * This method creates a versatile and consistent method to communicate with all channels.\n *\n *\n */\n\n sendInfoToChannel(channelName, pl = {}, action) {\n const payload = pl\n\n const defaultToAction = defaultTo('VIEWSTREAM_EVENT')\n const channelDefaultActionHash = {\n CHANNEL_ROUTE: 'CHANNEL_ROUTE_CHANGE_EVENT'\n }\n const getActionFn = compose(defaultToAction, prop(channelName))\n\n action = action || getActionFn(channelDefaultActionHash)\n\n const data = { payload, action }\n\n try {\n data.srcElement = compose(pick(['id', 'vsid', 'class', 'tagName']), prop('props'))(this)\n if (this.checkIfChannelExists(channelName) === true) {\n if (/CHANNEL_LIFECYCLE/.test(action) === false) {\n Object.defineProperties(data, {\n payload: {\n get: () => safeClone(pl)\n }\n })\n }\n const obs$ = of(data)\n return new ViewStreamPayload(channelName, obs$, data)\n }\n } catch (e) {\n console.warn('SPYNE WARNING ', e)\n }\n }\n\n tracer(...args) {\n this.sendLifecycleMethod(...args)\n }\n\n sendLifecycleMethodInactive() {\n\n }\n\n sendLifecycleMethodActive(val, p) {\n const isRendered = where({\n from$: equals('internal'),\n action: equals('VS_SPAWNED_AND_ATTACHED_TO_PARENT')\n }, p)\n const isDisposed = p === 'VS_DETRITUS_COLLECT'\n if (isRendered === true) {\n this.sendInfoToChannel('CHANNEL_LIFECYCLE', { action:'CHANNEL_LIFECYCLE_RENDERED_EVENT' }, 'CHANNEL_LIFECYCLE_RENDERED_EVENT')\n } else if (isDisposed === true) {\n this.sendInfoToChannel('CHANNEL_LIFECYCLE', { action:'CHANNEL_LIFECYCLE_DISPOSED_EVENT' }, 'CHANNEL_LIFECYCLE_DISPOSED_EVENT')\n }\n }\n\n createActionFilter(selectors, data) {\n return new ChannelPayloadFilter(selectors, data)\n }\n\n isLocalEvent(channelPayloadItem) {\n const itemEl = path(['srcElement', 'el'], channelPayloadItem)\n const thisEl = path(['props', 'el'], this)\n // console.log('this el is ',{thisEl, itemEl});\n return ViewStream.elIsDomElement(thisEl) && ViewStream.elIsDomElement(itemEl) && thisEl.contains(itemEl)\n }\n\n // =======================================================================================\n addMixins() {\n // ==================================\n // BASE CORE MIXINS\n // ==================================\n const coreMixins = baseCoreMixins()\n this.createId = coreMixins.createId\n }\n}\n","import { filter } from './filter';\nexport function skip(count) {\n return filter(function (_, index) { return count <= index; });\n}\n//# sourceMappingURL=skip.js.map","import { ViewStream } from '../views/view-stream.js'\nimport { curry } from 'ramda'\nexport class RouteChannelUpdater {\n constructor(cxt) {\n const name = String(cxt.props.name)\n const id = `${name}_ROUTE_UPDATER`\n\n const sendRouteChannelUpdate = curry(RouteChannelUpdater.createTemporaryViewStreamObj)\n return sendRouteChannelUpdate({ id, name })\n }\n\n static createTemporaryViewStreamObj(props, data) {\n const { name, id } = props\n const payload = data\n const vs = new ViewStream({\n id, name, data\n })\n\n vs.onRendered = () => {\n vs.sendInfoToChannel('CHANNEL_ROUTE', payload)\n }\n\n vs.afterBroadcastEvents = () => {\n vs.disposeViewStream()\n }\n\n vs.appendToNull()\n }\n}\n","import { registeredStreamNames } from './channels-config.js'\nimport { ChannelPayload } from './channel-payload-class.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { RouteChannelUpdater } from '../utils/route-channel-updater.js'\n\nimport { ReplaySubject, Subject, forkJoin, EMPTY } from 'rxjs'\nimport { filter, map, take, combineLatestWith } from 'rxjs/operators'\nimport {\n ifElse,\n identity,\n head,\n mergeAll,\n objOf,\n view,\n is,\n chain,\n lensIndex,\n always,\n fromPairs,\n path,\n isEmpty,\n equals,\n prop,\n propEq\n , map as rMap\n} from 'ramda'\n\nexport class Channel {\n /**\n * @module Channel\n * @type extendable\n *\n * @desc\n * <p>The Channel component wraps methods and functionality around an RxJs Subject, to create a one-way data flow between itself and other Channels and ViewStreams.</p>\n * <p>Channels get data by importing json objects, subscribing to other Channels and by parsing ViewStream info.</p>\n * <h3>The Basic Channel Structure</h3>\n * <ul>\n * <li>Channels requires a unique name, for example, <b>CHANNEL_MYCHANNEL</b>, which components use to select and subscribe to any channel.</li>\n * <li>Channels are instantiated and 'registered' with the LINK['SpyneApp', 'spyne-app'].</li>\n * <li>Channels remain persistent and are not deleted.</li>\n * </ul>\n * <h3>Components that extend Channel</h3>\n * <ul>\n * <li>The four Spyne Channels, LINK['SpyneChannelUI', 'spyne-channel-u-i'], LINK['SpyneChannelWindow', 'spyne-channel-window'], LINK['SpyneChannelRoute', 'spyne-channel-route'] and LINK['SpyneChannelLifecycle', 'spyne-channel-lifecycle'], all extend Channel.</li>\n * <li>ChannelFetch also extends Channel, adds a ChannelFetchUtil component to immediately publish fetched responses.</li>\n * </ul>\n * <h3>Sending ChannelPayloads</h3>\n * <p>Channels send data using the <a class='linker' data-channel=\"ROUTE\" data-event-prevent-default=\"true\" data-menu-item=\"channel-send-channel-payload\" href=\"/guide/reference/channel-send-channel-payload\" >sendChannelPayload</a>\n method.</p>\n *\n *\n * <h3>Receiving Data from ViewStream Instances</h3>\n * <p>ViewStreams can send data to any custom channel using the <a class='linker' data-channel=\"ROUTE\" data-event-prevent-default=\"true\" data-menu-item=\"view-stream-send-into-to-channel\" href=\"/guide/reference/view-stream-send-info-to-channel\" >sendInfoToChannel</a>\n method. Channels cam listen to any ViewStream data directed to itself through the default method, <a class='linker' data-channel=\"ROUTE\" data-event-prevent-default=\"true\" data-menu-item=\"channel-on-view-stream-info\" href=\"/guide/reference/channel-on-view-stream-info\" >onViewStreamInfo</a>. </p>\n *\n *\n * @example\n * TITLE[\"<h4>Registering a New Channel Instance</h4>\"]\n * SpyneApp.register(new Channel(\"CHANNEL_MYCHANNEL\");\n *\n *\n * @constructor\n * @param {string} CHANNEL_NAME\n * @param {Object} props This json object takes in parameters to initialize the channel\n * @property {String} CHANNEL_NAME - = undefined; This will be the registered name for this channel.\n * @property {Object} props - = {}; The props objects allows for custom properties for the channel.\n * @property {Object} props.sendCachedPayload - = false; Publishes its most current payload to late subscribers, when set to true.\n *\n */\n constructor(CHANNEL_NAME, props = {}) {\n this.addRegisteredActions.bind(this)\n this.createChannelActionsObj(CHANNEL_NAME, props.extendedActionsArr)\n\n // Basic props setup\n props.name = CHANNEL_NAME\n props.defaultActions = props.data !== undefined ? [`${props.name}_EVENT`] : []\n this.props = props\n\n this.props.isRegistered = false\n this.props.isProxy =\n this.props.isProxy === undefined ? false : this.props.isProxy\n\n // Determine a default from presence of props.data\n const defaultCachedPayloadBool = this.props.data !== undefined\n\n // If props.replay is defined, override sendCachedPayload with it.\n // Otherwise, use the existing sendCachedPayload property or default.\n if (typeof this.props.replay !== 'undefined') {\n this.props.sendCachedPayload = this.props.replay\n } else {\n this.props.sendCachedPayload =\n this.props.sendCachedPayload === undefined\n ? defaultCachedPayloadBool\n : this.props.sendCachedPayload\n }\n\n this.sendPayloadToRouteChannel = new RouteChannelUpdater(this)\n this.createChannelActionMethods()\n\n // Set up streams\n this.streamsController = SpyneAppProperties.channelsMap\n const observer$ = this.getMainObserver()\n this.checkForPersistentDataMode = Channel.checkForPersistentDataMode.bind(this)\n this.observer$ = this.props.observer = observer$\n\n // Subscribe to DISPATCHER\n const dispatcherStream$ = this.streamsController.getStream('DISPATCHER')\n const payloadPredByChannelName = propEq(props.name, 'name')\n dispatcherStream$\n .pipe(filter(payloadPredByChannelName))\n .subscribe((val) => this.onReceivedObservable(val))\n }\n\n getMainObserver() {\n if (this.streamsController === undefined) {\n console.warn(`Spyne Warning: The following channel, ${this.props.name}, appears to be registered before Spyne has been initialized.`)\n }\n\n const proxyExists = this.streamsController.testStream(this.props.name)\n\n if (proxyExists === true) {\n return this.streamsController.getProxySubject(this.props.name, this.props.sendCachedPayload)\n } else {\n return this.props.sendCachedPayload === true ? new ReplaySubject(1) : new Subject()\n }\n }\n\n // OVERRIDE INITIALIZATION METHOD\n /**\n * <p>(Deprecated. Use onRegistered). This method is empty and is called as soon as the Channel has been registered.</p>\n * <p>Tasks such as subscribing to other channels, and sending initial payloads can be added here.</p>\n */\n onChannelInitialized() {\n\n }\n\n // OVERRIDE INITIALIZATION METHOD\n /**\n * <p>This method is empty and is called as soon as the Channel has been registered.</p>\n * <p>Tasks such as subscribing to other channels, and sending initial payloads can be added here.</p>\n */\n onRegistered(props = this.props) {\n if (props.data !== undefined) {\n const action = Object.keys(this.channelActions)[0]\n // console.log(\"CHANNELS ACTIONS IS \",this.channelActions);\n // Object(this.channelActions).keys[0];\n this.sendChannelPayload(action, props.data)\n }\n }\n\n get isProxy() {\n return this.props.isProxy\n }\n\n get channelName() {\n return this.props.name\n }\n\n /**\n *\n * @desc\n * returns the source observable for the channel\n */\n get observer() {\n return this.observer$\n }\n\n checkForTraits() {\n const addTraits = (traits) => {\n if (traits.constructor.name !== 'Array') {\n traits = [traits]\n }\n const addTrait = (TraitClass) => {\n return new TraitClass(this)\n }\n\n traits.forEach(addTrait)\n }\n\n if (this.props.traits !== undefined) {\n addTraits(this.props.traits)\n }\n }\n\n // DO NOT OVERRIDE THIS METHOD\n initializeStream() {\n this.checkForTraits()\n this.onChannelInitialized()\n this.checkForPersistentDataMode()\n this.onRegistered()\n this.props.isRegistered = true\n }\n\n static checkForPersistentDataMode(props = this.props, actionsObj = this.channelActions) {\n const actionsObjIsEmpty = isEmpty(actionsObj)\n const dataIsAdded = prop('data', props) !== undefined\n const autoSetToCachedPayload = actionsObjIsEmpty === true && dataIsAdded === true\n const setDefaultActionsObj = () => {\n const { name } = props\n const actionStr = `${name}_EVENT`\n return {\n [actionStr] : actionStr\n }\n }\n\n if (autoSetToCachedPayload) {\n props.sendCachedPayload = true\n actionsObj = setDefaultActionsObj()\n\n if (this.channelActions !== undefined) {\n this.channelActions = actionsObj\n }\n }\n\n // console.log(\"PROPS IS \",{actionsObjIsEmpty, dataIsAdded, props, actionsObj}, this.channelActions)\n return { props, actionsObj }\n }\n\n setTrace(bool) {\n }\n\n createChannelActionsObj(name, extendedActionsArr = []) {\n const getActionVal = ifElse(is(String), identity, head)\n const mainArr = extendedActionsArr.concat(this.addRegisteredActions(name))\n const arr = rMap(getActionVal, mainArr)\n const converter = str => objOf(str, str)\n const obj = mergeAll(chain(converter, arr))\n this.channelActions = obj\n }\n\n createChannelActionMethods() {\n const defaultFn = 'onViewStreamInfo'\n const getActionVal = ifElse(is(String), identity, head)\n const delayCheckIfTraitMethodHasBeenAdded = (methodStr, val) => {\n const delayer = () => {\n if (typeof this[methodStr] !== 'function') {\n console.warn(`\"${this.props.name}\", REQUIRES THE FOLLOWING METHOD ${methodStr} FOR ACTION, ${val[0]}`)\n }\n }\n window.setTimeout(delayer, 100)\n }\n\n const getCustomMethod = val => {\n const methodStr = view(lensIndex(1), val)\n delayCheckIfTraitMethodHasBeenAdded(methodStr, val)\n return methodStr\n }\n\n const getArrMethod = ifElse(is(String), always(defaultFn), getCustomMethod)\n\n const createObj = val => {\n const key = getActionVal(val)\n const method = getArrMethod(val)\n return [key, method]\n }\n\n this.channelActionMethods = fromPairs(rMap(createObj, this.addRegisteredActions()))\n\n // console.log('the channel action methods ',this.channelActionMethods);\n }\n\n /**\n *\n * @desc\n * <p>Channels send along Action names along with its payload.</p>\n * <p>Before any action can be used, that action needs to be registered using this method.</p>\n * <p>ViewStream instances can filter ChannelPayloads by binding specific LINK['actions to local methods', 'view-stream-add-action-listeners'].</p>\n * <p>Forcing registration of actions allows Spyne to validate Actions, and is also a useful way to keep track of all Actions that are intended to be used.</p>\n *\n * @returns\n * Array of Strings\n *\n * @example\n * TITLE[\"<h4>Registering Actions in the addRegisteredActions method</h4>\"]\n * addRegisteredActions() {\n * return [\n * 'CHANNEL_MY_CHANNEL_EVENT',\n * 'CHANNEL_MY_CHANNEL_UPDATE_EVENT'\n * ];\n * }\n *\n */\n addRegisteredActions() {\n let arr = []\n if (path(['props', 'data'], this)) {\n arr = [`${this.props.name}_EVENT`]\n }\n return arr\n }\n\n onReceivedObservable(obj) {\n this.onIncomingObservable(obj)\n }\n\n getActionMethodForObservable(obj) {\n obj.unpacked = true\n const defaultFn = this.onViewStreamInfo.bind(this)\n\n const methodStr = path(['data', 'action'], obj)\n const methodVal = prop(methodStr, this.channelActionMethods)\n\n let fn = defaultFn\n\n if (methodVal !== undefined && methodVal !== 'onViewStreamInfo') {\n const methodExists = typeof (this[methodVal]) === 'function'\n if (methodExists === true) {\n fn = this[methodVal].bind(this)\n }\n }\n\n return fn\n }\n\n onIncomingObservable(obj) {\n const eqsName = equals(obj.name, this.props.name)\n const { action, payload, srcElement } = obj.data\n // console.log(\"INCOMING \",{action, payload, srcElement}, {obj});\n const mergeProps = (d) => mergeAll([d, { action: prop('action', d) }, prop('payload', d), prop('srcElement', d)])\n const dataObj = obsVal => ({\n clone: () => mergeProps(obj.data),\n action,\n payload,\n srcElement,\n event: obsVal\n })\n const onSuccess = (obj) => obj.observable.pipe(map(dataObj))\n .subscribe(this.getActionMethodForObservable(obj))\n const onError = () => {}\n return eqsName === true ? onSuccess(obj) : onError()\n }\n\n /**\n *\n * <p>ViewSteam instances can send info to channels through its LINK['sendInfoToChannel, 'view-stream-send-info-to-channel'] method.</p>\n * <p>Data received from ViewStreams are directed to this method.</p>\n * <p>ViewStreams send data using the LINK['ViewStreamPayload', 'view-stream-payload'] format.</p>\n *\n * @param {ViewStreamPayload} obj\n *\n * @example\n * TITLE[\"<h4>Parsing Data Returned from a ViewStream Instance</h4>\"]\n * onViewStreamInfo(obj){\n * let data = obj.viewStreamInfo;\n * let action = data.action;\n * let newPayload = this.parseViewStreamData(data);\n * this.sendChannelPayload(action, newPayload);\n * }\n *\n *\n */\n onViewStreamInfo(obs) {\n }\n\n /**\n *\n * @desc\n *\n * <p>This method takes an action, a data object and other properties to create and publish a LINK['ChannelPayload', 'channel-payload'] object.</p>\n * <p>Once the action and payload is validated, this method will publish the data by using the channel's source Subject next() method.\n * <p>This consistent format allows subscribers to understand how to parse any incoming channel data.</p>\n *\n * @param {String} action\n * @param {Object} payload\n * @param {HTMLElement} srcElement\n * @param {HTMLElement} event\n * @param {Observable} obs$\n * @property {String} action - = undefined; Required. An action is a string, typically in the format of \"CHANNEL_NAME_ACTION_NAME_EVENT\", and that has been added in the addRegisteredActions method.\n * @property {Object} payload - = undefined; Required. This can be any javascript object and is used to send any custom data.\n * @property {HTMLElement} srcElement - = Not Required. undefined; This can be either the element returned from the UI Channel, or the srcElement from a ViewStream instance.\n * @property {UIEvent} event - = undefined; Not Required. This will be defined if the event is from the UI Channel.\n * @property {Observable} obs$ - = this.observer; This default is the source observable for this channel.\n *\n * @example\n * TITLE['<h4>Publishing a ChannelPayload</h4>']\n * let action = \"CHANNEL_MY_CHANNEL_REGISTERED_ACTION_EVENT\";\n * let data = {foo:\"bar\"};\n * this.sendChannelPayload(action, data);\n *\n */\n sendChannelPayload(action, payload, srcElement = {}, event = {}, obs$ = this.observer$) {\n // MAKES ALL CHANNEL BASE AND DATA STREAMS CONSISTENT\n\n const channelPayloadItem = new ChannelPayload(this.props.name, action, payload, srcElement, event)\n // console.log(\"CHANNEL STREEM ITEM \",channelPayloadItem);\n\n // const onNextFrame = ()=>obs$.next(channelPayloadItem);\n // requestAnimationFrame(onNextFrame)\n\n obs$.next(channelPayloadItem)\n }\n\n /**\n *\n * <p>Allows channels to subscribe to other channels.</p>\n * <p>This method returns the source rxjs Subject for the requested Channel, which can be listened to by calling its subscribe method.</p>\n * <p>Knowledge of rxjs is not required to subscribe to and parse Channel data.</p>\n * <p>But accessing the rxjs Subject gives developers the ability to use all of the available rxjs mapping and observable tools.</p>\n *\n * @param {String} channelName The registered name of the requested channel.\n * @returns\n * The source rxjs Subject of the requested channel.\n * @example\n * TITLE[\"<h4>Subscribing to a Channel Using the getChannel method</h4>\"]\n * let route$ = this.getChannel(\"CHANNEL_ROUTE\")\n * route$.subscribe(localMethod);\n *\n *\n */\n getChannel(channelName, payloadFilter) {\n const isValidChannel = c => registeredStreamNames().includes(c)\n const error = c => console.warn(\n `channel name ${c} is not within ${registeredStreamNames}`)\n const startSubscribe = (c) => {\n const obs$ = this.streamsController.getStream(c).observer\n if (obs$.source) {\n obs$.source.channelName = channelName\n } else {\n obs$.channelName = channelName\n }\n\n if (payloadFilter !== undefined) {\n return obs$.pipe(filter(payloadFilter))\n }\n\n return obs$\n }\n const fn = ifElse(isValidChannel, startSubscribe, error)\n return fn(channelName)\n }\n\n /**\n * Merge Channels is a convenience method to forkJoin Channel.observer$\n *\n * */\n\n mergeChannels(channelsArr, emitOnce = true) {\n // 1) Normalize inputs to Observables\n const channelObservables = channelsArr.map(item => {\n if (typeof item === 'string') {\n const chan$ = this.getChannel(item)\n return emitOnce ? chan$.pipe(take(1)) : chan$\n }\n return emitOnce ? item.pipe(take(1)) : item\n })\n\n // 2) Combine them\n let combined$\n if (emitOnce) { // one‑shot: snapshot then complete\n combined$ = forkJoin(channelObservables)\n } else { // live updates: combineLatestWith\n if (channelObservables.length === 0) {\n combined$ = EMPTY\n } else if (channelObservables.length === 1) {\n combined$ = channelObservables[0]\n } else {\n const [first$, ...rest$] = channelObservables\n combined$ = first$.pipe(combineLatestWith(...rest$))\n }\n }\n\n // 3) Map array → keyed object\n // return combined$;\n return combined$.pipe(\n map(resultsArr => {\n const obj = {}\n channelsArr.forEach((item, idx) => {\n const iterKey = typeof item === 'string' ? item : `channel_${idx}`\n const cnKey = item?.source?.channelName || item?.source?.source?.channelName\n const key = cnKey || iterKey\n obj[key] = resultsArr[idx]\n })\n return obj\n })\n )\n }\n\n static checkForNotTrackFlag(props = {}) {\n if (props.doNotTrack === true) {\n SpyneAppProperties.doNotTrackChannel(props.channelName)\n }\n }\n}\n","import { __read, __spreadArray } from \"tslib\";\nimport { combineLatest } from './combineLatest';\nexport function combineLatestWith() {\n var otherSources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n otherSources[_i] = arguments[_i];\n }\n return combineLatest.apply(void 0, __spreadArray([], __read(otherSources)));\n}\n//# sourceMappingURL=combineLatestWith.js.map","import { Channel } from './channel.js'\nimport { SpyneUtilsChannelRouteUrl } from '../utils/spyne-utils-channel-route-url.js'\nimport { SpyneUtilsChannelRoute } from '../utils/spyne-utils-channel-route.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { ReplaySubject, merge } from 'rxjs'\nimport { map } from 'rxjs/operators'\n\nimport {\n pick,\n find,\n omit,\n over,\n mergeRight,\n is,\n objOf,\n mergeAll,\n path,\n keys,\n prop,\n equals,\n head,\n compose,\n lensProp,\n chain,\n pickAll,\n defaultTo,\n isEmpty,\n concat,\n when,\n complement,\n reverse,\n curryN,\n __,\n test,\n replace,\n toPairs,\n reduce\n , filter as ramdaFilter, mergeRight as rMerge\n} from 'ramda'\n\nexport class SpyneChannelRoute extends Channel {\n constructor(name = 'CHANNEL_ROUTE', props = {}) {\n /**\n * @module SpyneChannelRoute\n * @type core\n *\n * @desc\n *\n * <p>The SpyneChannelRoute has the two main duties:\n * <ul>\n * <li>Combine data with the current window location to update the location's pathname.</li>\n * <li>Listen to window location changes to translate the location pathname into a series of model properties.</li>\n * </ul>\n * <p>In both cases, this channel sends a ChannelPayload containing updated route properties.</p>\n *\n * <h3>The two actions that are regsitered for the Route channel are:</h3>\n * <ul>\n * <li>CHANNEL_ROUTE_DEEPLINK_EVENT</li>\n * <li>CHANNEL_ROUTE_CHANGE_EVENT</li>\n * </ul>\n *\n * <h3>The Routes Configuration Object</h3>\n * <p>Thr routes configuration object is used to map the location string to and from a route model.</p>\n *\n * <pre> {\n * routePath: {\n * routeName: 'levelOneProp',\n * routeOption1: 'branching-ends-here',\n * routeOption2: {\n * routePath: {\n * routeName: 'levelTwoProp',\n * optionLevel2: 'level-2-branch-ends-here'\n *\n * }\n * }\n * }\n * }\n *\n * </pre>\n * <p>This config object consists of nested routePath objects that corresponds to all of the branching possiblities for the app.</p>\n * <p>The routeName value is the property name for each routePath.</p>\n * <h3>Route Options</h3>\n * <p>A routePath may contain several route option key-value pairs, which is used to map between data and the window location.</p>\n * <ul class='basic'>\n * <li>\n * <h5 class='basic'>The Route Option Key (or left value)</h5>\n * <ul class='decimal'>\n * <li>Maps the window location to route data properties</li>\n * <li>This channel can 'fill in the blanks' so that only the updated level routeNames are required to revise the window location</li>\n * <li>Can be a regex pattern so that multiple data properties can share the same branching logic</li>\n * </ul>\n * </li>\n *\n * <li>\n * <h5 class='basic'>The Route Option Value (or right value)</h5>\n * <ul class='decimal'>\n * <li>Maps data properties to part of a window location</li>\n * <li>Determines the string value for its level of the window location</li>\n * <li>The value can be a regex pattern so that multiple locations can map to same routeData property</li>\n * <li>Branching ends for the route option when this value is a either a String or a regex pattern</li>\n * <li>Branching continues for the route option when this value is a nested routePath object</li>\n * </ul>\n * </li>\n * </ul>\n *\n * <h3>Enhancing The App's Routing Logic</h3>\n * <p>The best practice for a Spyne App is to have one component, a custom channel, listen to the SpyneRouteChannel. All other components will then listen to the custom route channel. This allows the custom route channel to enhance routing logic with more data and custom actions.</p>\n * <p>You can see this custom routing channel in action in the Spyne Starter App</p>\n *\n * <h4 class='basic'>Examining this Site's Route Configuration</h4>\n * <article class='code-example' id='routes-config-example'></article>\n * <p>You can see this site routing in action by opening up the console's routes panel</p>\n * <div class='btn btn-blue-ref btn-console' data-type=\"console\" data-value=\"open\" data-channel-type=\"route\">CLICK TO OPEN ROUTE PANEL</div>\n *\n * @example\n * TITLE[\"<h4>Binding UI ELements to the Route Channel</h4>\"]\n * // This also is an example of how to override the RouteOption value (useful when the value is a regex pattern)\n * <div class='btn' data-channel=\"ROUTE\" data-page-id='home' data-page-id-value=''>HOME</div>\n *\n * @example\n * TITLE[\"<h4>Updating the Route Channel using ViewStream&rsquo;s sendInfoToChannel</h4>\"]\n * const dataUpdateObj = {pageId:'guide', section:'reference', menuItem:'spyne-route-channel'};\n * this.sendInfoToChannel(\"CHANNEL_ROUTE\", dataUpdateObj);\n *\n * @example\n * TITLE[\"<h4>Updating the Route Channel using Channel&rsquo;s sendPayloadToRouteChannel</h4>\"]\n * const dataUpdateObj = {pageId:'guide', section:'reference', menuItem:'spyne-route-channel'};\n * this.sendPayloadToRouteChannel(dataUpdateObj);\n *\n * @constructor\n * @param {Object} config\n * @property {String} config.type - = 'slash'; This property determines the url structure by conforming the window pathname to either the slash, query or hash formats.\n * @property {Object} config.routes - = {routePath: {routeName:'change'}; This nested Object is used to contruct the window pathname and to express the window location as model variables.\n * @property {String} CHANNEL_NAME - = 'CHANNEL_ROUTE';\n *\n */\n props.sendCachedPayload = true\n super('CHANNEL_ROUTE', props)\n this.createChannelActionsObj()\n this.routeConfigJson = this.getRouteConfig()\n this.bindStaticMethods()\n this.navToStream$ = new ReplaySubject(1)\n this.observer$ = this.navToStream$.pipe(map(info => this.onMapNext(info)))\n this.compareRouteKeywords = SpyneUtilsChannelRoute.compareRouteKeywords()\n }\n\n checkConfigForHash() {\n // LEGACY CHECK TO SIMPLIFY CONFIG FOR HASH;\n const isHashType = SpyneAppProperties.config.channels.ROUTE.type === 'hash'\n if (isHashType === true) {\n SpyneAppProperties.config.channels.ROUTE.type = 'slash'\n SpyneAppProperties.config.channels.ROUTE.isHash = true\n }\n }\n\n onRegistered() {\n this.checkConfigForHash()\n this.initStream()\n }\n\n createChannelActionsObj() {\n const arr = this.addRegisteredActions()\n const converter = str => objOf(str, str)\n const obj = mergeAll(chain(converter, arr))\n this.channelActions = obj\n }\n\n addRegisteredActions() {\n return [\n 'CHANNEL_ROUTE_DEEPLINK_EVENT',\n 'CHANNEL_ROUTE_CHANGE_EVENT',\n 'CHANNEL_ROUTE_CONFIG_UPDATED_EVENT',\n ['CHANNEL_ROUTE_UPDATE_CONFIG_EVENT', 'updateRouteConfig']\n ]\n }\n\n updateRouteConfig(e) {\n const newRoutesObj = pick(['isHash', 'isHidden', 'routes', 'type'], e.payload)\n\n SpyneAppProperties.config.channels.ROUTE = mergeRight(SpyneAppProperties.config.channels.ROUTE, newRoutesObj)\n\n SpyneAppProperties.conformRouteConfig()\n\n const routeConfig = this.getRouteConfig()\n const action = 'CHANNEL_ROUTE_CONFIG_UPDATED_EVENT'\n\n // reverse because routeDatasetsArr turns out that way\n routeConfig.navLinks = [...routeConfig?.routeDatasetsArr]\n\n this.routeConfigJson = routeConfig\n this.bindStaticMethodsWithConfigData()\n\n this.sendChannelPayload(action, routeConfig, {}, {}, this.navToStream$)\n }\n\n getRouteConfig() {\n const spyneConfig = SpyneAppProperties.config\n const routeConfig = path(['channels', 'ROUTE'], spyneConfig)\n if (routeConfig.type === 'query') {\n routeConfig.isHash = false\n }\n\n const arr = SpyneUtilsChannelRoute.flattenConfigObject(routeConfig.routes)\n routeConfig.paramsArr = arr\n return routeConfig\n }\n\n initStream() {\n this.firstLoadStream$ = new ReplaySubject(1)\n this.onIncomingDomEvent(undefined, this.routeConfigJson, '' + 'CHANNEL_ROUTE_DEEPLINK_EVENT')\n\n SpyneUtilsChannelRoute.createPopStateStream(this.onIncomingDomEvent.bind(this))\n\n this.observer$ = merge(this.firstLoadStream$,\n this.navToStream$)\n }\n\n onMapNext(data, firstLoaded = false) {\n data.action = 'CHANNEL_ROUTE_CHANGE_EVENT'\n return data\n }\n\n static removeSSID(payload) {\n const routeLens = lensProp(['routeData'])\n const omitSSID = over(routeLens, omit(['vsid']))\n return omitSSID(payload)\n }\n\n static onIncomingDomEvent(evt, config = this.routeConfigJson, actn) {\n const action = actn !== undefined\n ? actn\n : this.channelActions.CHANNEL_ROUTE_CHANGE_EVENT\n\n // CHECK IF THIS IS A HISTORY EVENT BY USING THE routeCount PROPERTY\n const eventCount = path(['state', 'routeCount'], evt)\n const isHistoryCount = is(Number, eventCount) === true\n let payload = this.getDataFromString(config, isHistoryCount)\n if (isHistoryCount === true) {\n payload.routeCount = eventCount\n }\n // ===============================================================\n if (actn === 'CHANNEL_ROUTE_DEEPLINK_EVENT') {\n payload.navLinks = prop('routeDatasetsArr', config)\n // payload.linksData = payload.navLinks\n // SpyneAppProperties.linksData = payload.navLinks\n\n // define an alias property using Object.defineProperty\n Object.defineProperty(payload, 'linksData', {\n get() {\n // console.warn('get links data is deprecated in ROUTE DEEPLINK DATA, use navLinks')\n return this.navLinks\n },\n set(value) {\n console.warn('set links data is deprecated in ROUTE DEEPLINK DATA, use navLinks')\n\n // this.navLinks = value;\n },\n enumerable: true\n })\n }\n const keywordArrs = this.compareRouteKeywords.compare(payload.routeData, payload.paths)\n payload = rMerge(payload, keywordArrs)\n this.sendChannelPayload(action, payload, undefined, evt, this.navToStream$)\n }\n\n static checkForRouteParamsOverrides(payload) {\n return payload\n }\n\n static checkForEventMethods(obs) {\n const re = /^(event)([A-Z].*)([A-Z].*)$/gm\n const getMethods = compose(ramdaFilter(test(re)), keys, prop('payload'))\n const methodsArr = getMethods(obs)\n if (methodsArr.length >= 1) {\n const evt = prop('event', obs)\n if (evt !== undefined) {\n const methodUpdate = (match, p1, p2, p3, p4) => String(p2).toLowerCase() + p3 + p4\n const methodStrReplace = replace(/^(event)([A-Z])(.*)([A-Z].*)$/gm, methodUpdate)\n const runMethod = (methodStr) => {\n const m = methodStrReplace(methodStr)\n if (evt[m] !== undefined) { evt[m]() }\n }\n methodsArr.forEach(runMethod)\n }\n }\n\n return obs\n }\n\n static checkForEndRoute(pl, routeConfigJson = this.routeConfigJson, debugBool) {\n const endRoute = compose(equals('true'), path(['payload', 'endRoute']))(pl)\n\n if (endRoute !== true) {\n return pl\n }\n const debug = debugBool !== undefined ? debugBool : SpyneAppProperties.debug === true\n const { payload } = pl\n\n const getPropVal = (routePath) => {\n const routeName = prop('routeName', routePath)\n if (routeName) {\n const keysArr = compose(keys, omit(['routeName']))(routePath)\n const routeNameVal = payload[routeName]\n const pred = arrStr => new RegExp(`^${arrStr}$`).test(routeNameVal)\n const routeVal = find(pred, keysArr)\n return routeVal\n }\n }\n\n let iter = 0\n const onReduceRoutePaths = (acc = [], arr) => {\n // const [key, val] = arr\n const val = arr[1]\n const { routePath } = val\n const routeName = prop('routeName', routePath)\n const routeNameVal = getPropVal(routePath)\n const isObj = is(Object, val)\n const isArr = is(Array, val)\n const iterObj = isObj === true && isArr === false\n iter = iter + 1\n if (iterObj) {\n const nextRoutePath = routePath[routeNameVal]\n // console.log('key is ',{iter,acc,key, routeName, routeNameVal, iterObj, nextRoutePath});\n if (nextRoutePath) {\n compose(reverse, reduce(onReduceRoutePaths, acc), toPairs)({ nextRoutePath })\n } else {\n // console.log(\"KEY IS \",{iter,key, routeName, routeNameVal})\n if (iter === 1) {\n if (debug) {\n console.warn(`Spyne Warning: use of end route method should add start route value of \"${routeName}\".`)\n }\n } else {\n acc.push(routeName)\n }\n }\n }\n return acc\n }\n\n const { routes } = routeConfigJson\n\n const endRouteValArr = compose(reverse, reduce(onReduceRoutePaths, []), toPairs)({ routes })\n // console.log('end route val arr ',endRouteValArr);\n if (endRouteValArr.length === 1) {\n const endRouteVal = endRouteValArr[0]\n pl.payload[endRouteVal] = ''\n } else {\n if (debug) {\n // console.warn(`Spyne Warning: the end route param did not yield any results for ${JSON.stringify(payload)} `);\n }\n }\n\n return pl\n }\n\n onViewStreamInfo(pl) {\n const action = pl.action ?? this.channelActions.CHANNEL_ROUTE_CHANGE_EVENT\n\n function domStringMapToObject(domStringMap) {\n const obj = {}\n for (const key in domStringMap) {\n // Check if it’s a direct property (though dataset rarely has anything on the prototype):\n if (Object.prototype.hasOwnProperty.call(domStringMap, key)) {\n obj[key] = domStringMap[key]\n }\n }\n return obj\n }\n\n if (pl?.srcElement?.el?.dataset) {\n pl.payload = domStringMapToObject(pl?.srcElement?.el?.dataset) ?? pl.payload\n }\n\n // console.log('ROUTE CHANNEL VSI ', { pl })\n\n SpyneChannelRoute.checkForEventMethods(pl)\n pl = this.checkForEndRoute(pl)\n let payload = this.getDataFromParams(pl)\n\n const srcElement = prop('srcElement', pl)\n const event = prop('event', pl)\n const changeLocationBool = !payload.isHidden\n const keywordArrs = this.compareRouteKeywords.compare(payload.routeData, payload.paths)\n\n payload = rMerge(payload, keywordArrs)\n this.sendRouteStream(payload, changeLocationBool)\n\n payload = SpyneChannelRoute.removeSSID(payload)\n\n this.sendChannelPayload(action, payload, srcElement, event,\n this.navToStream$)\n }\n\n static checkAndConvertStrWithRegexTokens(routeValue, regexTokenObj) {\n const tokenKeysArr = keys(regexTokenObj)\n\n return tokenKeysArr\n }\n\n sendRouteStream(payload, changeWindowLoc = true) {\n if (changeWindowLoc === true) {\n this.setWindowLocation(payload)\n }\n }\n\n static getRouteState() {\n return 'CHANNEL_ROUTE_CHANGE_EVENT'\n }\n\n static getIsDeepLinkBool(isHistory) {\n return isHistory === false && this._routeCount === 0\n }\n\n static getRouteCount(isHistory = false) {\n if (this._routeCount === undefined) {\n this._routeCount = 0\n return this._routeCount\n }\n if (isHistory === false) {\n this._routeCount += 1\n }\n return this._routeCount\n }\n\n static getExtraPayloadParams(config = this.routeConfigJson, isHistory = false) {\n const routeCount = this.getRouteCount(isHistory)\n const isDeepLink = this.getIsDeepLinkBool(isHistory)\n const isHash = config.isHash\n const isHidden = config.isHidden\n const routeType = config.type\n return { routeCount, isDeepLink, isHash, isHistory, isHidden, routeType }\n }\n\n static getDataFromParams(pl, config = this.routeConfigJson) {\n let routeData = prop('payload', pl)\n\n const routeValue = this.getRouteStrFromParams(routeData, config)\n\n // WINDOW LOCATION HASN'T BEEN CHANGED YET, SO WILL GET STR PARAMS\n const getPropFromConfig = (prp, defalt) => defaultTo(defalt, prop(prp, config))\n const typeForStr = getPropFromConfig('type', 'slash')\n const isHashForStr = getPropFromConfig('isHash', false)\n const nextWindowLoc = SpyneUtilsChannelRouteUrl.formatStrAsWindowLocation(routeValue)\n const dataFromStr = this.getDataFromLocationStr(typeForStr, isHashForStr, nextWindowLoc)\n\n const { pathInnermost, paths } = dataFromStr\n\n routeData = rMerge(dataFromStr.routeData, routeData)\n\n const { routeCount, isDeepLink, isHash, isHistory, isHidden, routeType } = this.getExtraPayloadParams(\n config)\n return {\n isDeepLink,\n routeCount,\n pathInnermost,\n paths,\n routeData,\n routeValue,\n isHash,\n isHidden,\n isHistory,\n routeType\n }\n }\n\n static getDataFromString(config = this.routeConfigJson, isHistory = false) {\n const type = config.type\n const hashIsTrue = config.isHash === true\n const str = SpyneUtilsChannelRouteUrl.getLocationStrByType(type, hashIsTrue)\n const { paths, pathInnermost, routeData, routeValue } = SpyneChannelRoute.getParamsFromRouteStr(\n str, config, type)\n const { routeCount, isDeepLink, isHash, routeType, isHidden } = this.getExtraPayloadParams(\n config, isHistory)\n\n const obj = {\n isDeepLink,\n routeCount,\n pathInnermost,\n paths,\n routeData,\n routeValue,\n isHash,\n isHidden,\n isHistory,\n routeType\n }\n return obj\n }\n\n static getDataFromLocationStr(t = 'slash', isHash = this.routeConfigJson.isHash, loc = window.location) {\n const type = this.routeConfigJson !== undefined\n ? this.routeConfigJson.type\n : t\n\n const str = SpyneUtilsChannelRouteUrl.getLocationStrByType(type, isHash, loc)\n const { paths, pathInnermost, routeData, routeValue } = this.getParamsFromRouteStr(\n str, this.routeConfigJson, type)\n const action = this.getRouteState()\n return { paths, pathInnermost, routeData, routeValue, action }\n }\n\n static getLocationData() {\n const locationParamsArr = [\n 'href',\n 'origin',\n 'protocol',\n 'host',\n 'hostname',\n 'port',\n 'pathname',\n 'search',\n 'hash']\n return pickAll(locationParamsArr, window.location)\n }\n\n static getRouteStrFromParams(paramsData, routeConfig, t) {\n const type = t !== undefined ? t : routeConfig.type\n const obj = SpyneUtilsChannelRouteUrl.convertParamsToRoute(paramsData, routeConfig, type)\n return obj\n }\n\n static getParamsFromRouteStr(str, routeConfig, t) {\n const type = t !== undefined ? t : routeConfig.type\n const obj = SpyneUtilsChannelRouteUrl.convertRouteToParams(str, routeConfig, type)\n return obj\n }\n\n checkEmptyRouteStr(str, isHash = false) {\n const isEmptyBool = isEmpty(str)\n const pathNameIsEmptyBool = isEmptyBool === true && isHash === false\n const hashNameIsEmptyBool = isEmptyBool === true && isHash === true\n const hashNameBool = isEmptyBool === false && isHash === true\n\n if (pathNameIsEmptyBool === true || hashNameIsEmptyBool === true) {\n return '/'\n } else if (hashNameBool === true) {\n return concat('#', str)\n }\n return str\n }\n\n static removeLastSlash(str) {\n const re = /^(.*)(\\/)$/\n return str.replace(re, '$1')\n }\n\n setWindowLocation(channelPayload) {\n let { isHash, routeValue, routeType } = channelPayload\n routeValue = this.checkEmptyRouteStr(routeValue, isHash)\n const { routeCount } = channelPayload\n if (isHash === true || routeType === 'query') {\n const pathName = SpyneChannelRoute.removeLastSlash(window.location.pathname)\n routeValue = pathName + routeValue\n window.history.pushState({ routeCount }, '', routeValue)\n } else {\n const checkForSlash = when(\n compose(complement(equals('/')), head), concat('/', __))\n window.history.pushState({ routeCount }, '', checkForSlash(routeValue))\n }\n }\n\n getWindowLocation() {\n return window.location.pathname // pullHashAndSlashFromPath(window.location.hash);\n }\n\n bindStaticMethods() {\n this.checkForEndRoute = SpyneChannelRoute.checkForEndRoute.bind(this)\n this.getIsDeepLinkBool = SpyneChannelRoute.getIsDeepLinkBool.bind(this)\n this.getDataFromLocationStr = SpyneChannelRoute.getDataFromLocationStr.bind(\n this)\n this.onIncomingDomEvent = SpyneChannelRoute.onIncomingDomEvent.bind(this)\n this.getDataFromString = SpyneChannelRoute.getDataFromString.bind(this)\n this.getParamsFromRouteStr = SpyneChannelRoute.getParamsFromRouteStr.bind(this)\n this.getLocationData = SpyneChannelRoute.getLocationData.bind(this)\n this.getRouteState = SpyneChannelRoute.getRouteState.bind(this)\n this.getDataFromParams = SpyneChannelRoute.getDataFromParams.bind(this)\n this.getRouteCount = SpyneChannelRoute.getRouteCount.bind(this)\n this.getExtraPayloadParams = SpyneChannelRoute.getExtraPayloadParams.bind(this)\n this.bindStaticMethodsWithConfigData()\n }\n\n bindStaticMethodsWithConfigData() {\n const curriedGetRoute = curryN(3, SpyneChannelRoute.getRouteStrFromParams)\n this.getRouteStrFromParams = curriedGetRoute(__, this.routeConfigJson,\n this.routeConfigJson.type)\n }\n}\n","import { Channel } from './channel.js'\nimport { Observable } from 'rxjs'\nimport { map } from 'rxjs/operators'\nimport { equals, path, compose, prop, filter, replace, lensProp, over, omit, test, keys, either, toUpper } from 'ramda'\nimport { sanitizeEventTarget } from '../utils/sanitize-data.js'\n\nexport class SpyneChannelUI extends Channel {\n /**\n * @module SpyneChannelUI\n * @type core\n *\n * @desc\n * <p>This Channel listens to all User Events that have been set to broadcast by ViewStream instances, using the broadCastEvents method.</p>\n * <p>HTML Elements that have their data channel property set to \"ROUTE\" will broadcast their ui event to that channel instead.</p>\n * <div class='btn btn-blue-ref btn-console modal-btn' data-type='modal-window' data-value='uiEvents'>View UI Events</div></br></br>\n * <p>See LINK['ViewStream', 'view-stream'] for an example on how to bind HTML Elements to the UI Channel.</p>\n *\n * @constructor\n * @property {String} CHANNEL_NAME - = 'CHANNEL_UI';\n *\n *\n */\n\n constructor(name = 'CHANNEL_UI', props = {}) {\n props.sendCachedPayload = false\n super(name, props)\n this.keyEventsLoaded = false\n this.keyCodeArr = []\n }\n\n addRegisteredActions() {\n return [\n 'CHANNEL_UI_DOMCONTENTLOADED_EVENT',\n 'CHANNEL_UI_ABORT_EVENT',\n 'CHANNEL_UI_ACTIVATE_EVENT',\n 'CHANNEL_UI_ADDTRACK_EVENT',\n 'CHANNEL_UI_AFTERPRINT_EVENT',\n 'CHANNEL_UI_AFTERSCRIPTEXECUTE_EVENT',\n 'CHANNEL_UI_ANIMATIONCANCEL_EVENT',\n 'CHANNEL_UI_ANIMATIONEND_EVENT',\n 'CHANNEL_UI_ANIMATIONITERATION_EVENT',\n 'CHANNEL_UI_ANIMATIONSTART_EVENT',\n 'CHANNEL_UI_APPINSTALLED_EVENT',\n 'CHANNEL_UI_AUDIOEND_EVENT',\n 'CHANNEL_UI_AUDIOSTART_EVENT',\n 'CHANNEL_UI_AUXCLICK_EVENT',\n 'CHANNEL_UI_BEFOREINPUT_EVENT',\n 'CHANNEL_UI_BEFOREPRINT_EVENT',\n 'CHANNEL_UI_BEFOREUNLOAD_EVENT',\n 'CHANNEL_UI_BEGINEVENT_EVENT',\n 'CHANNEL_UI_BLOCKED_EVENT',\n 'CHANNEL_UI_BLUR_EVENT',\n 'CHANNEL_UI_BOUNDARY_EVENT',\n 'CHANNEL_UI_BUFFEREDAMOUNTLOW_EVENT',\n 'CHANNEL_UI_CANCEL_EVENT',\n 'CHANNEL_UI_CANPLAY_EVENT',\n 'CHANNEL_UI_CANPLAYTHROUGH_EVENT',\n 'CHANNEL_UI_CHANGE_EVENT',\n 'CHANNEL_UI_CLICK_EVENT',\n 'CHANNEL_UI_CLOSE_EVENT',\n 'CHANNEL_UI_CLOSING_EVENT',\n 'CHANNEL_UI_COMPLETE_EVENT',\n 'CHANNEL_UI_COMPOSITIONEND_EVENT',\n 'CHANNEL_UI_COMPOSITIONSTART_EVENT',\n 'CHANNEL_UI_COMPOSITIONUPDATE_EVENT',\n 'CHANNEL_UI_CONNECT_EVENT',\n 'CHANNEL_UI_CONNECTIONSTATECHANGE_EVENT',\n 'CHANNEL_UI_CONTENTDELETE_EVENT',\n 'CHANNEL_UI_CONTEXTMENU_EVENT',\n 'CHANNEL_UI_COPY_EVENT',\n 'CHANNEL_UI_CUECHANGE_EVENT',\n 'CHANNEL_UI_CUT_EVENT',\n 'CHANNEL_UI_DATACHANNEL_EVENT',\n 'CHANNEL_UI_DBLCLICK_EVENT',\n 'CHANNEL_UI_DEVICECHANGE_EVENT',\n 'CHANNEL_UI_DEVICEMOTION_EVENT',\n 'CHANNEL_UI_DEVICEORIENTATION_EVENT',\n 'CHANNEL_UI_DRAG_EVENT',\n 'CHANNEL_UI_DRAGEND_EVENT',\n 'CHANNEL_UI_DRAGENTER_EVENT',\n 'CHANNEL_UI_DRAGLEAVE_EVENT',\n 'CHANNEL_UI_DRAGOVER_EVENT',\n 'CHANNEL_UI_DRAGSTART_EVENT',\n 'CHANNEL_UI_DROP_EVENT',\n 'CHANNEL_UI_DURATIONCHANGE_EVENT',\n 'CHANNEL_UI_EMPTIED_EVENT',\n 'CHANNEL_UI_END_EVENT',\n 'CHANNEL_UI_ENDEVENT_EVENT',\n 'CHANNEL_UI_ENDED_EVENT',\n 'CHANNEL_UI_ENTERPICTUREINPICTURE_EVENT',\n 'CHANNEL_UI_ERROR_EVENT',\n 'CHANNEL_UI_FOCUS_EVENT',\n 'CHANNEL_UI_FOCUSIN_EVENT',\n 'CHANNEL_UI_FOCUSOUT_EVENT',\n 'CHANNEL_UI_FORMDATA_EVENT',\n 'CHANNEL_UI_FULLSCREENCHANGE_EVENT',\n 'CHANNEL_UI_FULLSCREENERROR_EVENT',\n 'CHANNEL_UI_GAMEPADCONNECTED_EVENT',\n 'CHANNEL_UI_GAMEPADDISCONNECTED_EVENT',\n 'CHANNEL_UI_GATHERINGSTATECHANGE_EVENT',\n 'CHANNEL_UI_GESTURECHANGE_EVENT',\n 'CHANNEL_UI_GESTUREEND_EVENT',\n 'CHANNEL_UI_GESTURESTART_EVENT',\n 'CHANNEL_UI_GOTPOINTERCAPTURE_EVENT',\n 'CHANNEL_UI_HASHCHANGE_EVENT',\n 'CHANNEL_UI_ICECANDIDATE_EVENT',\n 'CHANNEL_UI_ICECANDIDATEERROR_EVENT',\n 'CHANNEL_UI_ICECONNECTIONSTATECHANGE_EVENT',\n 'CHANNEL_UI_ICEGATHERINGSTATECHANGE_EVENT',\n 'CHANNEL_UI_INPUT_EVENT',\n 'CHANNEL_UI_INPUTSOURCESCHANGE_EVENT',\n 'CHANNEL_UI_INSTALL_EVENT',\n 'CHANNEL_UI_INVALID_EVENT',\n 'CHANNEL_UI_KEYDOWN_EVENT',\n 'CHANNEL_UI_KEYUP_EVENT',\n 'CHANNEL_UI_LANGUAGECHANGE_EVENT',\n 'CHANNEL_UI_LEAVEPICTUREINPICTURE_EVENT',\n 'CHANNEL_UI_LOAD_EVENT',\n 'CHANNEL_UI_LOADEDDATA_EVENT',\n 'CHANNEL_UI_LOADEDMETADATA_EVENT',\n 'CHANNEL_UI_LOADEND_EVENT',\n 'CHANNEL_UI_LOADSTART_EVENT',\n 'CHANNEL_UI_LOSTPOINTERCAPTURE_EVENT',\n 'CHANNEL_UI_MARK_EVENT',\n 'CHANNEL_UI_MERCHANTVALIDATION_EVENT',\n 'CHANNEL_UI_MESSAGE_EVENT',\n 'CHANNEL_UI_MESSAGEERROR_EVENT',\n 'CHANNEL_UI_MOUSEDOWN_EVENT',\n 'CHANNEL_UI_MOUSEENTER_EVENT',\n 'CHANNEL_UI_MOUSELEAVE_EVENT',\n 'CHANNEL_UI_MOUSEMOVE_EVENT',\n 'CHANNEL_UI_MOUSEOUT_EVENT',\n 'CHANNEL_UI_MOUSEOVER_EVENT',\n 'CHANNEL_UI_MOUSEUP_EVENT',\n 'CHANNEL_UI_MUTE_EVENT',\n 'CHANNEL_UI_NEGOTIATIONNEEDED_EVENT',\n 'CHANNEL_UI_NOMATCH_EVENT',\n 'CHANNEL_UI_NOTIFICATIONCLICK_EVENT',\n 'CHANNEL_UI_OFFLINE_EVENT',\n 'CHANNEL_UI_ONLINE_EVENT',\n 'CHANNEL_UI_OPEN_EVENT',\n 'CHANNEL_UI_ORIENTATIONCHANGE_EVENT',\n 'CHANNEL_UI_PAGEHIDE_EVENT',\n 'CHANNEL_UI_PAGESHOW_EVENT',\n 'CHANNEL_UI_PASTE_EVENT',\n 'CHANNEL_UI_PAUSE_EVENT',\n 'CHANNEL_UI_PAYERDETAILCHANGE_EVENT',\n 'CHANNEL_UI_PAYMENTMETHODCHANGE_EVENT',\n 'CHANNEL_UI_PLAY_EVENT',\n 'CHANNEL_UI_PLAYING_EVENT',\n 'CHANNEL_UI_POINTERCANCEL_EVENT',\n 'CHANNEL_UI_POINTERDOWN_EVENT',\n 'CHANNEL_UI_POINTERENTER_EVENT',\n 'CHANNEL_UI_POINTERLEAVE_EVENT',\n 'CHANNEL_UI_POINTERLOCKCHANGE_EVENT',\n 'CHANNEL_UI_POINTERLOCKERROR_EVENT',\n 'CHANNEL_UI_POINTERMOVE_EVENT',\n 'CHANNEL_UI_POINTEROUT_EVENT',\n 'CHANNEL_UI_POINTEROVER_EVENT',\n 'CHANNEL_UI_POINTERUP_EVENT',\n 'CHANNEL_UI_POPSTATE_EVENT',\n 'CHANNEL_UI_PROGRESS_EVENT',\n 'CHANNEL_UI_PUSH_EVENT',\n 'CHANNEL_UI_PUSHSUBSCRIPTIONCHANGE_EVENT',\n 'CHANNEL_UI_RATECHANGE_EVENT',\n 'CHANNEL_UI_READYSTATECHANGE_EVENT',\n 'CHANNEL_UI_REJECTIONHANDLED_EVENT',\n 'CHANNEL_UI_REMOVETRACK_EVENT',\n 'CHANNEL_UI_REMOVESTREAM_EVENT',\n 'CHANNEL_UI_REPEATEVENT_EVENT',\n 'CHANNEL_UI_RESET_EVENT',\n 'CHANNEL_UI_RESIZE_EVENT',\n 'CHANNEL_UI_RESOURCETIMINGBUFFERFULL_EVENT',\n 'CHANNEL_UI_RESULT_EVENT',\n 'CHANNEL_UI_RESUME_EVENT',\n 'CHANNEL_UI_SCROLL_EVENT',\n 'CHANNEL_UI_SEARCH_EVENT',\n 'CHANNEL_UI_SEEKED_EVENT',\n 'CHANNEL_UI_SEEKING_EVENT',\n 'CHANNEL_UI_SELECT_EVENT',\n 'CHANNEL_UI_SELECTEDCANDIDATEPAIRCHANGE_EVENT',\n 'CHANNEL_UI_SELECTEND_EVENT',\n 'CHANNEL_UI_SELECTIONCHANGE_EVENT',\n 'CHANNEL_UI_SELECTSTART_EVENT',\n 'CHANNEL_UI_SHIPPINGADDRESSCHANGE_EVENT',\n 'CHANNEL_UI_SHIPPINGOPTIONCHANGE_EVENT',\n 'CHANNEL_UI_SIGNALINGSTATECHANGE_EVENT',\n 'CHANNEL_UI_SLOTCHANGE_EVENT',\n 'CHANNEL_UI_SOUNDEND_EVENT',\n 'CHANNEL_UI_SOUNDSTART_EVENT',\n 'CHANNEL_UI_SPEECHEND_EVENT',\n 'CHANNEL_UI_SPEECHSTART_EVENT',\n 'CHANNEL_UI_SQUEEZE_EVENT',\n 'CHANNEL_UI_SQUEEZEEND_EVENT',\n 'CHANNEL_UI_SQUEEZESTART_EVENT',\n 'CHANNEL_UI_STALLED_EVENT',\n 'CHANNEL_UI_START_EVENT',\n 'CHANNEL_UI_STATECHANGE_EVENT',\n 'CHANNEL_UI_STORAGE_EVENT',\n 'CHANNEL_UI_SUBMIT_EVENT',\n 'CHANNEL_UI_SUCCESS_EVENT',\n 'CHANNEL_UI_SUSPEND_EVENT',\n 'CHANNEL_UI_TIMEOUT_EVENT',\n 'CHANNEL_UI_TIMEUPDATE_EVENT',\n 'CHANNEL_UI_TOGGLE_EVENT',\n 'CHANNEL_UI_TONECHANGE_EVENT',\n 'CHANNEL_UI_TOUCHCANCEL_EVENT',\n 'CHANNEL_UI_TOUCHEND_EVENT',\n 'CHANNEL_UI_TOUCHMOVE_EVENT',\n 'CHANNEL_UI_TOUCHSTART_EVENT',\n 'CHANNEL_UI_TRACK_EVENT',\n 'CHANNEL_UI_TRANSITIONCANCEL_EVENT',\n 'CHANNEL_UI_TRANSITIONEND_EVENT',\n 'CHANNEL_UI_TRANSITIONRUN_EVENT',\n 'CHANNEL_UI_TRANSITIONSTART_EVENT',\n 'CHANNEL_UI_UNHANDLEDREJECTION_EVENT',\n 'CHANNEL_UI_UNLOAD_EVENT',\n 'CHANNEL_UI_UNMUTE_EVENT',\n 'CHANNEL_UI_UPGRADENEEDED_EVENT',\n 'CHANNEL_UI_VERSIONCHANGE_EVENT',\n 'CHANNEL_UI_VISIBILITYCHANGE_EVENT',\n 'CHANNEL_UI_VOICESCHANGED_EVENT',\n 'CHANNEL_UI_VOLUMECHANGE_EVENT',\n 'CHANNEL_UI_VRDISPLAYACTIVATE_EVENT',\n 'CHANNEL_UI_VRDISPLAYBLUR_EVENT',\n 'CHANNEL_UI_VRDISPLAYCONNECT_EVENT',\n 'CHANNEL_UI_VRDISPLAYDEACTIVATE_EVENT',\n 'CHANNEL_UI_VRDISPLAYDISCONNECT_EVENT',\n 'CHANNEL_UI_VRDISPLAYFOCUS_EVENT',\n 'CHANNEL_UI_VRDISPLAYPOINTERRESTRICTED_EVENT',\n 'CHANNEL_UI_VRDISPLAYPOINTERUNRESTRICTED_EVENT',\n 'CHANNEL_UI_VRDISPLAYPRESENTCHANGE_EVENT',\n 'CHANNEL_UI_WAITING_EVENT',\n 'CHANNEL_UI_WEBGLCONTEXTCREATIONERROR_EVENT',\n 'CHANNEL_UI_WEBGLCONTEXTLOST_EVENT',\n 'CHANNEL_UI_WEBGLCONTEXTRESTORED_EVENT',\n 'CHANNEL_UI_WEBKITMOUSEFORCECHANGED_EVENT',\n 'CHANNEL_UI_WEBKITMOUSEFORCEDOWN_EVENT',\n 'CHANNEL_UI_WEBKITMOUSEFORCEUP_EVENT',\n 'CHANNEL_UI_WEBKITMOUSEFORCEWILLBEGIN_EVENT',\n 'CHANNEL_UI_WHEEL_EVENT'\n ]\n }\n\n loadKeyStream() {\n const keyUps = Observable.fromEvent(document, 'keyup')\n const filterKeys = e => this.keyCodeArr.indexOf(e.keyCode) >= 0\n this.keyPresses$ = keyUps.groupBy(e => e.keyCode)\n .mergeAll()\n .filter(filterKeys)\n .repeat()\n .subscribe(this.onKeyPressed.bind(this))\n }\n\n addKeyEvent(num) {\n if (this.keyEventsLoaded === false) {\n this.loadKeyStream()\n }\n this.keyEventsLoaded = true\n this.registerKey(num)\n }\n\n registerKey(c) {\n this.keyCodeArr.push(c)\n }\n\n onKeyPressed(evt) {\n // console.log('key is ', evt);\n }\n\n static removeSSID(pl) {\n const routeLens = lensProp(['payload'])\n const omitSSID = over(routeLens, omit(['vsid']))\n return omitSSID(pl)\n }\n\n onIncomingObservable(obj) {\n const eqsName = equals(obj.name, this.props.name)\n obj.data = SpyneChannelUI.removeSSID(obj.data)\n const { payload, srcElement } = obj.data\n const dataObj = obsVal => ({ payload, srcElement, event: obsVal })\n const onSuccess = (obj) => obj.observable.pipe(map(dataObj))\n .subscribe(this.onUIEvent.bind(this))\n const onError = () => {}\n return eqsName === true ? onSuccess(obj) : onError()\n }\n\n getActionState(val) {\n const typeVal = path(['event', 'type'])\n const typeOverRideVal = path(['event', 'typeOverRide'])\n const eventType = compose(toUpper, either(typeOverRideVal, typeVal))\n const type = eventType(val)\n const mainAction = 'CHANNEL_UI'\n return type !== undefined ? `${mainAction}_${type}_EVENT` : mainAction\n }\n\n static checkForEventMethods(obs) {\n const re = /^(event)([A-Z].*)([A-Z].*)$/gm\n const getMethods = compose(filter(test(re)), keys, prop('payload'))\n const methodsArr = getMethods(obs)\n if (methodsArr.length >= 1) {\n const evt = prop('event', obs)\n if (evt !== undefined) {\n const methodUpdate = (match, p1, p2, p3, p4) => String(p2).toLowerCase() + p3 + p4\n const methodStrReplace = replace(/^(event)([A-Z])(.*)([A-Z].*)$/gm, methodUpdate)\n const runMethod = (methodStr) => {\n const m = methodStrReplace(methodStr)\n if (evt[m] !== undefined && typeof (evt[m]) === 'function') { evt[m]() }\n }\n methodsArr.forEach(runMethod)\n }\n }\n\n return obs\n }\n\n onUIEvent(obs) {\n function domStringMapToObject(domStringMap) {\n const obj = {}\n for (const key in domStringMap) {\n // Check if it’s a direct property (though dataset rarely has anything on the prototype):\n if (Object.prototype.hasOwnProperty.call(domStringMap, key)) {\n obj[key] = domStringMap[key]\n }\n }\n return obj\n }\n\n obs.payload = domStringMapToObject(obs?.srcElement?.el?.dataset) ?? obs.payload\n\n SpyneChannelUI.checkForEventMethods(obs)\n obs.action = this.getActionState(obs)\n const action = obs.action// this.getActionState(obs);\n // const { srcElement } = obs\n const { payload, srcElement } = obs\n\n const event = obs.event\n sanitizeEventTarget(event?.target)\n // const payload = domStringMapToObject(srcElement?.el?.dataset) ?? obs.payload\n this.sendChannelPayload(action, payload, srcElement, event)\n }\n}\n","import { fromEventPattern } from 'rxjs'\nimport { map } from 'rxjs/operators'\nimport { mapObjIndexed } from 'ramda'\n\nexport class SpyneUtilsChannelWindow {\n /**\n * @module SpyneUtilsChannelWindow\n * @type internal\n *\n * @constructor\n * @desc\n * Internal utility methods for SpyneWindowChannel\n *\n *\n */\n constructor() {\n this.createDomObservableFromEvent = SpyneUtilsChannelWindow.createDomObservableFromEvent.bind(\n this)\n }\n\n static createDomObservableFromEvent(eventName, mapFn, isPassive = true, element = window) {\n const addHandler = handler => element.addEventListener(eventName, handler,\n { passive: isPassive })\n const removeHandler = () => { element[eventName] = (p) => p }\n mapFn = mapFn === undefined ? (p) => p : mapFn\n return fromEventPattern(addHandler, removeHandler).pipe(map(mapFn))\n }\n\n // MEDIA QUERIES\n static createMediaQuery(str) {\n const mq = window.matchMedia(str)\n this.checkIfValidMediaQuery(mq, str)\n return mq !== false ? mq : false\n }\n\n static checkIfValidMediaQuery(mq, str) {\n const noSpaces = str => str.replace(/\\s+/gm, '')\n const isValidBool = mq.matches !== undefined && noSpaces(mq.media).indexOf(noSpaces(str)) >= 0\n const warnMsg = str => console.warn(`Spyne Info: the following query string, \"${str}\", has been optimized to \"${mq.media}\" by the browser and may not be a valid Media Query item!`)\n if (isValidBool === false) {\n warnMsg(str)\n }\n return isValidBool\n }\n\n static createMediaQueryHandler(query, key) {\n const keyFn = key => p => {\n p.mediaQueryName = key\n return p\n }\n\n const mapKey = keyFn(key)\n\n const handlers = (q) => {\n return {\n addHandler: (handler) => { q.addListener(handler) },\n removeHandler: (handler) => { q.onchange = () => {} }\n }\n }\n const mediaQueryHandler = handlers(query)\n /* eslint-disable new-cap */\n return new fromEventPattern(\n mediaQueryHandler.addHandler,\n mediaQueryHandler.removeHandler)\n .pipe(map(mapKey))\n }\n\n static createMergedObsFromObj(config) {\n const mediaQueriesObj = config.mediaQueries || config.mediaQueries\n const arr = []\n\n const loopQueries = (val, key, obj) => {\n const mq = SpyneUtilsChannelWindow.createMediaQuery(val)\n if (mq !== false) {\n arr.push(SpyneUtilsChannelWindow.createMediaQueryHandler(mq, key))\n }\n return arr\n }\n\n mapObjIndexed(loopQueries, mediaQueriesObj)\n return arr\n }\n}\n","import { Channel } from './channel.js'\nimport { checkIfObjIsNotEmptyOrNil } from '../utils/frp-tools.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { SpyneUtilsChannelWindow } from '../utils/spyne-utils-channel-window.js'\nimport { merge } from 'rxjs'\nimport { map, debounceTime, skipWhile } from 'rxjs/operators'\nimport { curry, pick, partialRight, mapObjIndexed, apply, map as rMap } from 'ramda'\nimport { deepMerge } from '../utils/deep-merge.js'\n\nexport class SpyneChannelWindow extends Channel {\n /**\n * @module SpyneChannelWindow\n * @type core\n *\n * @desc\n * The Window Channel will listen to window and document events that are set in its configuration file\n * <div class='btn btn-blue-ref btn-console modal-btn' data-type='modal-window' data-value='windowEvents'>View Window Events</div></br></br>\n *\n * @constructor\n * @param {String} CHANNEL_NAME\n * @param {Object} config\n * @property {Object} config - = {}; The config has several options used to listen to window and document events.\n * @property {Array} config.events - = []; Any window and document events can be added here.\n * @property {Object} config.mediaQueries - = {}; Media queries are added as key,value pairs; the key is the name of the boolean for the query, the value is the query itself.\n * @property {Boolean} config.listenForResize - = true; This is default listening for resize event.\n * @property {Boolean} config.listenForOrientation - = true; Listen for horizontal and landscape orientation changes on mobile devices.\n * @property {Boolean} config.listenForMouseWheel - = false; If set to true, will listen for mouseWheel and will add direction and distance parameters.\n * @property {Boolean} config.debounceMSTimeForResize - = 200; The time between resize events in milliseconds.\n * @property {Boolean} config.debounceMSTimeForScroll - = 150; The time between scroll events in milliseconds.\n * @property {String} CHANNEL_NAME - = 'CHANNEL_WINDOW';\n *\n *\n */\n constructor(CHANNEL_NAME = 'CHANNEL_WINDOW') {\n super(CHANNEL_NAME)\n this.bindStaticMethods()\n this.currentScrollY = 0\n }\n\n initializeStream() {\n this.domChannelConfig = SpyneAppProperties.config.channels.WINDOW\n const obs$Arr = this.getActiveObservables()\n const dom$ = merge(...obs$Arr)\n this.dom$ = dom$\n dom$.subscribe(p => {\n const { action, payload, srcElement, event } = p\n this.sendChannelPayload(action, payload, srcElement, event)\n })\n }\n\n static getMouseWheelMapFn(event) {\n const action = this.channelActions.CHANNEL_WINDOW_WHEEL_EVENT\n const scrollDir = event.deltaY <= 0 ? 'up' : 'down'\n const { deltaX, deltaY, deltaZ } = event\n const payload = { scrollDir, deltaX, deltaY, deltaZ }\n const srcElement = event.srcElement\n return { action, payload, srcElement, event }\n }\n\n static createCurriedGenericEvent(actionStr) {\n const action = `CHANNEL_WINDOW_${actionStr.toUpperCase()}_EVENT`\n const curryFn = curry(SpyneChannelWindow.mapGenericEvent)\n return curryFn(action)\n }\n\n static mapGenericEvent(actn, event) {\n // console.log(\"map generic event \",actn);\n const action = actn\n const payload = event\n const srcElement = event.srcElement\n return { action, payload, srcElement, event }\n }\n\n static getResizeMapFn(event) {\n const action = this.channelActions.CHANNEL_WINDOW_RESIZE_EVENT\n const payload = pick(\n ['innerWidth', 'innerHeight', 'outerWidth', 'outerHeight'], window)\n const srcElement = event.srcElement\n return { action, payload, srcElement, event }\n }\n\n static getOrientationMapFn(event) {\n const action = this.channelActions.CHANNEL_WINDOW_ORIENTATION_EVENT\n const orientationStr = '(orientation: portrait)'\n const isPortraitBool = window.matchMedia(orientationStr).matches\n const payload = pick(\n ['innerWidth', 'innerHeight', 'outerWidth', 'outerHeight'], window)\n payload.orientation = isPortraitBool === true\n ? 'portrait'\n : 'landscape'\n const srcElement = event.srcElement\n return { action, payload, srcElement, event }\n }\n\n getMediaQueryMapFn(event) {\n const action = this.channelActions.CHANNEL_WINDOW_MEDIA_QUERY_EVENT\n const payload = pick(['matches', 'media', 'mediaQueryName'], event)\n const srcElement = event.srcElement\n return { action, payload, srcElement, event }\n }\n\n createMouseWheelObservable(config) {\n const debounceT = config.debounceMSTimeForScroll\n\n return SpyneUtilsChannelWindow.createDomObservableFromEvent('wheel',\n SpyneChannelWindow.getMouseWheelMapFn.bind(this))\n .pipe(\n debounceTime(debounceT)\n )\n }\n\n static getScrollData() {\n let currentScrollY = 0\n\n const getScrollData = (scrollY) => {\n const scrollDistance = currentScrollY - scrollY\n const scrollDir = scrollDistance >= 0 ? 'up' : 'down'\n currentScrollY = scrollY\n return { scrollY, scrollDistance, scrollDir }\n }\n return getScrollData\n }\n\n static getScrollY(scrollElement) {\n return scrollElement.pageYOffset !== undefined ? scrollElement.pageYOffset : scrollElement.scrollTop\n }\n\n static getScrollMapFn(event, interval, action, scrollDataFn, scrollElement) {\n const scrollY = SpyneChannelWindow.getScrollY(scrollElement)\n const payload = scrollDataFn(scrollY)\n const { scrollDistance } = payload\n const srcElement = event.srcElement\n return { action, payload, srcElement, scrollDistance, event }\n }\n\n createScrollObservable(config, scrollElement = window, isPassive = true) {\n const skipWhenDirIsMissing = evt => evt.scrollDistance === 0\n const dTime = config.debounceMSTimeForScroll\n\n const element = scrollElement\n\n const isWindow = scrollElement === window\n\n const scrollElForVals = config.scrollElForVals !== undefined ? config.scrollElForVals : scrollElement\n const action = isWindow ? 'CHANNEL_WINDOW_SCROLL_EVENT' : 'CHANNEL_WINDOW_ELEMENT_SCROLL_EVENT'\n\n const scrollDataFn = SpyneChannelWindow.getScrollData()\n // console.log(\"SCROLL ELEMENT \",action,scrollElement, scrollElForVals);\n const scrollMapFn = partialRight(SpyneChannelWindow.getScrollMapFn, [action, scrollDataFn, scrollElForVals, isPassive, element]).bind(this)\n\n // console.log(\"createScrollObservable \", {scrollMapFn, scrollDataFn, action, config, scrollElement, element})\n\n return SpyneUtilsChannelWindow.createDomObservableFromEvent('scroll',\n scrollMapFn, isPassive, element)\n .pipe(\n debounceTime(dTime),\n skipWhile(skipWhenDirIsMissing),\n map(p => {\n const newScrollY = SpyneChannelWindow.getScrollY(element)\n p.payload.scrollDistanceAbs = Math.abs(this.currentScrollY - newScrollY)\n this.currentScrollY = newScrollY\n return p\n })\n )\n }\n\n createOrientationObservable(config) {\n // console.log(\"add orientation\");orientationchange\n return SpyneUtilsChannelWindow.createDomObservableFromEvent('orientationchange',\n SpyneChannelWindow.getOrientationMapFn.bind(this))\n }\n\n createResizeObservable(config) {\n const dTime = config.debounceMSTimeForResize\n // console.log('resize this ', this);\n\n return SpyneUtilsChannelWindow.createDomObservableFromEvent('resize',\n SpyneChannelWindow.getResizeMapFn.bind(this)).pipe(debounceTime(dTime))\n }\n\n getEventsFromConfig(config = this.domChannelConfig) {\n const obs$Arr = config.events\n\n const addWindowEventToArr = str => {\n const mapFn = SpyneChannelWindow.createCurriedGenericEvent(str)\n return SpyneUtilsChannelWindow.createDomObservableFromEvent(str, mapFn)\n }\n\n return rMap(addWindowEventToArr, obs$Arr)\n }\n\n getActiveObservables(config = this.domChannelConfig) {\n let obs$Arr = []\n\n // CHECK TO ADD MEDIA QUERY OBSERVABLE\n // ==========================================\n config.listenForMediaQueries = checkIfObjIsNotEmptyOrNil(\n config.mediaQueries) || checkIfObjIsNotEmptyOrNil(\n config.mediaQueries)\n\n // =========================================\n\n const methods = {\n listenForResize: this.createResizeObservable.bind(this),\n listenForOrientation: this.createOrientationObservable.bind(this),\n listenForScroll: this.createScrollObservable.bind(this),\n listenForWheel: this.createMouseWheelObservable.bind(this)\n }\n\n const addObservableToArr = (method, key, i) => {\n const addObsBool = config[key]\n if (addObsBool) {\n obs$Arr.push(method(config))\n }\n }\n\n mapObjIndexed(addObservableToArr, methods)\n\n // 'listenForMediaQueries' : this.getMediaQueryObservable.bind(this)\n this.checkForMediaQueries(config.listenForMediaQueries)\n\n const eventsArr = this.getEventsFromConfig(config)\n obs$Arr = obs$Arr.concat(eventsArr)\n\n return obs$Arr\n }\n\n checkForMediaQueries(bool) {\n const sendMQStream = p => {\n const { action, payload, srcElement, event } = p\n this.sendChannelPayload(action, payload, srcElement, event,\n this.observer$)\n }\n\n if (bool === true) {\n this.getMediaQueryObservable(this.domChannelConfig)\n .subscribe(sendMQStream)\n }\n }\n\n getMediaQueryObservable(config) {\n const arr = this.createMergedObsFromObj(config)\n // console.log(\"ARR IS \",{arr});\n const obs$ = apply(merge, arr)\n return obs$.pipe(map(this.getMediaQueryMapFn.bind(this)))\n }\n\n addRegisteredActions() {\n return [\n 'CHANNEL_WINDOW_ABORT_EVENT',\n 'CHANNEL_WINDOW_AFTERPRINT_EVENT',\n 'CHANNEL_WINDOW_ANIMATIONEND_EVENT',\n 'CHANNEL_WINDOW_ANIMATIONITERATION_EVENT',\n 'CHANNEL_WINDOW_ANIMATIONSTART_EVENT',\n 'CHANNEL_WINDOW_APPINSTALLED_EVENT',\n 'CHANNEL_WINDOW_BEFOREPRINT_EVENT',\n 'CHANNEL_WINDOW_BEFOREUNLOAD_EVENT',\n 'CHANNEL_WINDOW_BEGINEVENT_EVENT',\n 'CHANNEL_WINDOW_BLUR_EVENT',\n 'CHANNEL_WINDOW_CACHED_EVENT',\n 'CHANNEL_WINDOW_CHANGE_EVENT',\n 'CHANNEL_WINDOW_CLICK_EVENT',\n 'CHANNEL_WINDOW_CLOSE_EVENT',\n 'CHANNEL_WINDOW_COMPOSITIONEND_EVENT',\n 'CHANNEL_WINDOW_COMPOSITIONSTART_EVENT',\n 'CHANNEL_WINDOW_COMPOSITIONUPDATE_EVENT',\n 'CHANNEL_WINDOW_COPY_EVENT',\n 'CHANNEL_WINDOW_CUT_EVENT',\n 'CHANNEL_WINDOW_DBLCLICK_EVENT',\n 'CHANNEL_WINDOW_DEVICECHANGE_EVENT',\n 'CHANNEL_WINDOW_DEVICELIGHT_EVENT',\n 'CHANNEL_WINDOW_DEVICEMOTION_EVENT',\n 'CHANNEL_WINDOW_DEVICEORIENTATION_EVENT',\n 'CHANNEL_WINDOW_DEVICEPROXIMITY_EVENT',\n 'CHANNEL_WINDOW_DOMATTRIBUTENAMECHANGED_EVENT',\n 'CHANNEL_WINDOW_DOMATTRMODIFIED_EVENT',\n 'CHANNEL_WINDOW_DOMCHARACTERDATAMODIFIED_EVENT',\n 'CHANNEL_WINDOW_DOMCONTENTLOADED_EVENT',\n 'CHANNEL_WINDOW_DOMCONTENTLOADED_EVENT',\n 'CHANNEL_WINDOW_DOMELEMENTNAMECHANGED_EVENT',\n 'CHANNEL_WINDOW_DRAGEND_EVENT',\n 'CHANNEL_WINDOW_DRAGENTER_EVENT',\n 'CHANNEL_WINDOW_DRAGLEAVE_EVENT',\n 'CHANNEL_WINDOW_DRAGOVER_EVENT',\n 'CHANNEL_WINDOW_DRAGSTART_EVENT',\n 'CHANNEL_WINDOW_DRAG_EVENT',\n 'CHANNEL_WINDOW_DROP_EVENT',\n 'CHANNEL_WINDOW_ELEMENT_SCROLL_EVENT',\n 'CHANNEL_WINDOW_ERROR_EVENT',\n 'CHANNEL_WINDOW_FOCUSIN_EVENT',\n 'CHANNEL_WINDOW_FOCUS_EVENT',\n 'CHANNEL_WINDOW_FULLSCREENCHANGE_EVENT',\n 'CHANNEL_WINDOW_FULLSCREENERROR_EVENT',\n 'CHANNEL_WINDOW_HASHCHANGE_EVENT',\n 'CHANNEL_WINDOW_INPUT_EVENT',\n 'CHANNEL_WINDOW_INVALID_EVENT',\n 'CHANNEL_WINDOW_KEYDOWN_EVENT',\n 'CHANNEL_WINDOW_KEYPRESS_EVENT',\n 'CHANNEL_WINDOW_KEYUP_EVENT',\n 'CHANNEL_WINDOW_LOAD_EVENT',\n 'CHANNEL_WINDOW_MEDIA_QUERY_EVENT',\n 'CHANNEL_WINDOW_MESSAGE_EVENT',\n 'CHANNEL_WINDOW_MOUSEDOWN_EVENT',\n 'CHANNEL_WINDOW_MOUSEENTER_EVENT',\n 'CHANNEL_WINDOW_MOUSELEAVE_EVENT',\n 'CHANNEL_WINDOW_MOUSEMOVE_EVENT',\n 'CHANNEL_WINDOW_MOUSEOUT_EVENT',\n 'CHANNEL_WINDOW_MOUSEOVER_EVENT',\n 'CHANNEL_WINDOW_MOUSEUP_EVENT',\n 'CHANNEL_WINDOW_MOUSEWHEEL_EVENT',\n 'CHANNEL_WINDOW_OFFLINE_EVENT',\n 'CHANNEL_WINDOW_ONLINE_EVENT',\n 'CHANNEL_WINDOW_OPEN_EVENT',\n 'CHANNEL_WINDOW_ORIENTATION_EVENT',\n 'CHANNEL_WINDOW_PAGEHIDE_EVENT',\n 'CHANNEL_WINDOW_PAGESHOW_EVENT',\n 'CHANNEL_WINDOW_PASTE_EVENT',\n 'CHANNEL_WINDOW_POPSTATE_EVENT',\n 'CHANNEL_WINDOW_POPSTATE_EVENT',\n 'CHANNEL_WINDOW_PROGRESSEVENTS_EVENT',\n 'CHANNEL_WINDOW_RESET_EVENT',\n 'CHANNEL_WINDOW_RESIZE_EVENT',\n 'CHANNEL_WINDOW_SCROLL_ELEMENT_ADDED_EVENT',\n 'CHANNEL_WINDOW_SCROLL_EVENT',\n 'CHANNEL_WINDOW_SCROLL_LOCK_EVENT',\n ['CHANNEL_WINDOW_SCROLL_LOCK_EVENT', 'onScrollLockEvent'],\n ['CHANNEL_WINDOW_SET_ELEMENT_TO_SCROLL_EVENT', 'onSetElementToScroll'],\n 'CHANNEL_WINDOW_STORAGE_EVENT',\n 'CHANNEL_WINDOW_SUBMIT_EVENT',\n 'CHANNEL_WINDOW_TRANSITIONCANCEL_EVENT',\n 'CHANNEL_WINDOW_TRANSITIONEND_EVENT',\n 'CHANNEL_WINDOW_TRANSITIONRUN_EVENT',\n 'CHANNEL_WINDOW_TRANSITIONSTART_EVENT',\n 'CHANNEL_WINDOW_UNLOAD_EVENT',\n 'CHANNEL_WINDOW_WHEEL_EVENT'\n ]\n }\n\n onScrollLockEvent(e) {\n // DEPRECATED -- MOVED TO spyne-plugin-scroll-lock;\n }\n\n onSetElementToScroll(e) {\n let { config, el, scrollElement } = e.payload\n config = config || {}\n config = deepMerge(this.domChannelConfig, config)\n\n scrollElement = scrollElement || el\n\n const action = 'CHANNEL_WINDOW_SCROLL_ELEMENT_ADDED_EVENT'\n this.sendChannelPayload(action, { el }, el)\n\n this.createScrollObservable(config, scrollElement)\n .subscribe(p => {\n const { action, payload, srcElement, event } = p\n this.sendChannelPayload(action, payload, srcElement, event)\n })\n }\n\n bindStaticMethods() {\n this.createMediaQueryHandler = SpyneUtilsChannelWindow.createMediaQueryHandler.bind(\n this)\n this.createMergedObsFromObj = SpyneUtilsChannelWindow.createMergedObsFromObj.bind(\n this)\n }\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function skipWhile(predicate) {\n return operate(function (source, subscriber) {\n var taking = false;\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return (taking || (taking = !predicate(value, index++))) && subscriber.next(value); }));\n });\n}\n//# sourceMappingURL=skipWhile.js.map","import { Channel } from './channel.js'\n\nexport class SpyneChannelLifecycle extends Channel {\n /**\n * @module SpyneChannelLifecycle\n * @type core\n *\n * @desc\n * Internal Channel that publishes rendering and disposing events of all ViewStreams whose property, proper.sendLifecycleEvents is set to true.\n *\n * <h3>The two actions that are regsitered for this channel are:</h3>\n * <ul>\n * <li>CHANNEL_LIFECYCLE_RENDERED_EVENT</li>\n * <li>CHANNEL_LIFECYCLE_DISPOSED_EVENT</li>\n * </ul>\n * @constructor\n * @property {String} CHANNEL_NAME - = 'CHANNEL_LIFECYCLE';\n */\n\n constructor(props = {}) {\n super('CHANNEL_LIFECYCLE', props)\n }\n\n addRegisteredActions() {\n return [\n 'CHANNEL_LIFECYCLE_RENDERED_EVENT',\n 'CHANNEL_LIFECYCLE_DISPOSED_EVENT'\n ]\n }\n\n onViewStreamInfo(obj) {\n const { action, srcElement } = obj\n const payload = srcElement\n payload.action = action\n this.onSendEvent(action, payload)\n }\n\n onSendEvent(actionStr, payload = {}) {\n const action = this.channelActions[actionStr]\n const srcElement = {}\n const event = undefined\n const delayStream = () => this.sendChannelPayload(action, payload, srcElement, event)\n window.setTimeout(delayStream, 0)\n }\n}\n","import { Channel } from './channel.js'\n\nexport class SpyneChannelAI extends Channel {\n /**\n * @module SpyneChannelAI\n * @type core\n *\n * @desc\n * Internal Channel that publishes rendering and disposing events of all ViewStreams whose property, proper.sendAIEvents is set to true.\n *\n * <h3>The two actions that are regsitered for this channel are:</h3>\n * <ul>\n * <li>CHANNEL_AI_RENDERED_EVENT</li>\n * <li>CHANNEL_AI_DISPOSED_EVENT</li>\n * </ul>\n * @constructor\n * @property {String} CHANNEL_NAME - = 'CHANNEL_AI';\n */\n\n constructor(props = {}) {\n super('CHANNEL_AI', props)\n }\n\n addRegisteredActions() {\n return [\n 'CHANNEL_AI_RENDERED_EVENT',\n 'CHANNEL_AI_DISPOSED_EVENT'\n ]\n }\n\n onViewStreamInfo(obj) {\n const { action, srcElement } = obj\n const payload = srcElement\n payload.action = action\n this.onSendEvent(action, payload)\n }\n\n onSendEvent(actionStr, payload = {}) {\n const action = this.channelActions[actionStr]\n const srcElement = {}\n const event = undefined\n const delayStream = () => this.sendChannelPayload(action, payload, srcElement, event)\n window.setTimeout(delayStream, 0)\n }\n}\n","import { Channel } from './channel.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { Subject, ReplaySubject, merge } from 'rxjs'\nimport { includes } from 'ramda'\nimport { delayCall } from '../utils/frp-tools.js'\n\nexport class ChannelProxy extends Channel {\n /**\n * @module ChannelProxy\n * @type internal\n *\n * @constructor\n * @param {String} name\n * @param {Object} props\n *\n * @desc\n * A proxy channel is created when a channel is subscribed to before it is registered.\n *\n */\n constructor(name, props = {}) {\n props.isProxy = true\n super(name, props)\n this.props = props\n this.subject$ = new Subject()\n this.replaySub$ = new ReplaySubject(1)\n this.observer$ = merge(this.subject$, this.replaySub$)\n const isDevMode = SpyneAppProperties.debug\n if (isDevMode === true) {\n this.checkIfChannelIsStillProxy(name)\n }\n }\n\n getMergedSubject(peristData = false) {\n return peristData === true ? this.replaySub$ : this.subject$\n }\n\n checkIfChannelIsStillProxy(channelName) {\n const name = channelName\n\n const checkIfProxy = () => {\n const bool = includes(name, SpyneAppProperties.listRegisteredChannels())\n if (bool !== true) {\n console.warn(`Spyne Warning: The channel, ${name} does not appear to be registered!`)\n }\n }\n\n delayCall(checkIfProxy, 1000)\n }\n\n get replaySubject() {\n return this.replaySub$\n }\n\n get subject() {\n return this.subject$\n }\n}\n","import { SpyneChannelRoute } from './spyne-channel-route.js'\nimport { SpyneChannelUI } from './spyne-channel-ui.js'\nimport { SpyneChannelWindow } from './spyne-channel-window.js'\nimport { SpyneChannelLifecycle } from './spyne-channel-lifecycle.js'\nimport { SpyneChannelAI } from './spyne-channel-ai.js'\n\nimport { Subject } from 'rxjs'\nimport { ChannelProxy } from './channel-proxy.js'\nimport { propEq, pluck, prop, filter, pathEq, reject, compose, join, map as rMap } from 'ramda'\n\nconst _map = new Map()\n\nexport class ChannelsMap {\n /**\n * @module ChannelsDelegator\n * @type internal\n *\n * @desc\n * This object creates the logic so that Channels and ViewStreams can communicate with each other\n *\n * @constructor\n *\n */\n\n constructor() {\n this.addMixins()\n _map.set('DISPATCHER', new Subject())\n this.listRegisteredChannels = ChannelsMap.listRegisteredChannels.bind(this)\n this.getChannelsList = ChannelsMap.getChannelsList.bind(this)\n }\n\n get map() {\n return _map\n }\n\n static getChannelsList() {\n const proxyMapFn = (k, v) => {\n const key = k[0]\n const val = k[1].constructor.name\n return { key, val }\n }\n return Array.from(_map, proxyMapFn)\n }\n\n static listRegisteredChannels(showOnlyProxies = false) {\n const proxyMap = this.getChannelsList()\n const rejectProxyFn = reject(propEq('ChannelProxy', 'val'))\n const filterProxyFn = filter(propEq('ChannelProxy', 'val'))\n const fn = showOnlyProxies === true ? filterProxyFn : rejectProxyFn\n const removedProxyArr = fn(proxyMap)\n return pluck(['key'], removedProxyArr)\n }\n\n listProxyChannels() {\n return this.listRegisteredChannels(true)\n }\n\n checkForMissingChannels() {\n const proxyMap = this.getChannelsList()\n const filterProxyFn = filter(propEq('ChannelProxy', 'val'))\n const filterProxyArr = filterProxyFn(proxyMap)\n\n if (filterProxyArr.length >= 1) {\n const channelStr = filterProxyArr.length === 1 ? 'Channel has' : 'Channels have'\n const channels = compose(join(', '), rMap(prop('key')))(filterProxyArr)\n const filterPrefixWarning = `Spyne Warning: The following ${channelStr} not been initialized: ${channels}`\n console.warn(filterPrefixWarning)\n }\n }\n\n init() {\n this.createMainStreams()\n }\n\n createMainStreams() {\n this.routeStream = new SpyneChannelRoute()\n _map.set('CHANNEL_ROUTE', this.routeStream)\n\n this.uiStream = new SpyneChannelUI()\n _map.set('CHANNEL_UI', this.uiStream)\n\n this.domStream = new SpyneChannelWindow()\n _map.set('CHANNEL_WINDOW', this.domStream)\n\n this.viewStreamLifecycle = new SpyneChannelLifecycle()\n _map.set('CHANNEL_LIFECYCLE', this.viewStreamLifecycle)\n\n this.aiStream = new SpyneChannelAI()\n _map.set('CHANNEL_AI', this.aiStream)\n\n this.routeStream.initializeStream()\n this.domStream.initializeStream()\n }\n\n addKeyEvent(key) {\n _map.get('UI').addKeyEvent(key)\n }\n\n registerStream(val) {\n const name = val.channelName\n const nameExists = _map.has(name)\n if (nameExists) {\n const isAlreadyRegisterd = compose(pathEq(['props', 'isRegistered'], true))(_map.get(name))\n if (isAlreadyRegisterd) {\n console.warn(`Spyne Warning: The Channel, ${name}, has already been registered!`)\n return\n }\n }\n\n _map.set(name, val)\n val.initializeStream()\n }\n\n getChannelActions(str) {\n return _map.get(str).addRegisteredActions()\n }\n\n getProxySubject(name, isReplaySubject = false) {\n const subjectType = isReplaySubject === true ? 'replaySubject' : 'subject'\n\n return _map.get(name)[subjectType]\n }\n\n testStream(name) {\n return _map.get(name) !== undefined\n }\n\n getStream(name) {\n if (this.testStream(name) === false) {\n _map.set(name, new ChannelProxy(name))\n }\n\n return _map.get(name)\n }\n\n addMixins() {\n // ==================================\n // BASE CORE DECORATORS\n // ==================================\n // let coreMixins = baseCoreMixins();\n // ==================================\n // BASE STREAMS DECORATORS\n // ==================================\n // let streamsMixins = BaseStreamsMixins();\n }\n}\n","import { getAllMethodNames } from './frp-tools.js'\nimport { reject, curryN, __, map } from 'ramda'\nimport { SpyneAppProperties } from './spyne-app-properties.js'\n\nexport class SpyneTrait {\n /**\n * @module SpyneTrait\n * @type extendable\n * @param {this} parentContext\n * @param {String} prefix\n * @param {Boolean} autoInit\n * @constructor\n * @property {this} parentContent - = undefined; This binds all methods within SpyneTrait into the parentContext's object\n * @property {String} prefix - = undefined; SpyneTraits forces all method names to begin with the same prefix. This allows other objects to quickly understand where the original method is set.\n * @desc\n * SpyneTraits allow the ehancing of classes and other objects without having to extend classes or manipulate function prototypes\n *\n */\n\n constructor(parentContext, prefix = '', autoInit = true) {\n this.parentContext = parentContext\n this.omittedMethods = [\n 'autoBinder',\n 'initAutoBinder',\n 'getEnhancerMethods',\n 'checkForMalformedMethods',\n 'caller',\n 'arguments',\n 'bindParentViewStream']\n\n this.prefix = prefix\n\n if (autoInit === true) {\n this.autoBinder()\n }\n return this.allMethodsList\n }\n\n initAutoBinder() {\n this.autoBinder()\n }\n\n getEnhancerMethods() {\n return getAllMethodNames(this, this.omittedMethods)\n }\n\n checkForMalformedMethods(methodsArr) {\n const isDebugMode = SpyneAppProperties?.debug || false\n\n if (this.prefix === '' && isDebugMode) {\n console.warn(`SPYNE WARNING: The following SpyneTrait ${this.constructor.name} needs a prefix`)\n return\n }\n // let reStr = `^(${this.prefix})(.*)$`;\n // let re = new RegExp(reStr);\n const hasPrefix = (str) => str.indexOf(this.prefix) === 0\n\n const malformedMethodsArr = reject(hasPrefix, methodsArr)\n if (malformedMethodsArr.length >= 1 && isDebugMode) {\n const warningStr = `Spyne Warning: The following method(s) in ${this.constructor.name} require the prefix, \"${this.prefix}\": [${malformedMethodsArr.join(', ')}];`\n console.warn(warningStr)\n }\n }\n\n bindParentViewStream(methodsObj, context) {\n this.checkForMalformedMethods(methodsObj.allMethods)\n const obj = {}\n const bindMethodsToParentViewStream = (str, isStatic = false) => {\n const constructorType = isStatic === true ? this.constructor : this\n const propertyType = typeof (constructorType[str])\n if (propertyType === 'function') {\n obj[str] = context[str] = constructorType[str].bind(context)\n }\n }\n\n const bindCurry = curryN(2, bindMethodsToParentViewStream)\n const bindStaticMethodsToParentViewStream = bindCurry(__, true)\n // MAP STATIC METHODS\n map(bindStaticMethodsToParentViewStream, methodsObj.staticMethods)\n // MAP MAIN METHODS\n map(bindMethodsToParentViewStream, methodsObj.methods)\n return obj\n }\n\n autoBinder() {\n const allMethods = this.getEnhancerMethods()\n // console.log('all ',allMethods);\n this.allMethodsList = this.bindParentViewStream(allMethods, this.parentContext)\n return this.allMethodsList\n }\n}\n","import { from, of } from 'rxjs'\nimport { catchError, map, mergeMap, share, tap } from 'rxjs/operators'\nimport { compose, prop, defaultTo, pick, mergeDeepRight } from 'ramda'\nimport sanitizeData from './sanitize-data.js'\nimport { spyneWarn } from './spyne-warn.js'\n\nexport class ChannelFetchUtil {\n /**\n * @module ChannelFetchUtil\n * @type util\n *\n * @desc\n * This is the core object used for ChannelFetch. This utility wraps the JavaScript\n * fetch API into an observable.\n *\n * @constructor\n * @param {Object} options Properties used to create the fetch request\n * @param {Function} subscriber A method assigned to listen to the result\n * @param {Boolean} testMode Controls initialization for unit tests\n * @param {String} CHANNEL_NAME The name of the channel using this fetch util\n *\n * @property {String} options.url - The URL used for the request\n * @property {Object} options.serverOptions - The properties for the request\n * @property {Function} options.mapFn - A method that can parse the data before it is returned\n * @property {String} options.responseType - Default is json\n * @property {Boolean} options.debug - Logs fetch response details before observable completes\n * @property {Boolean} options.disableSanitize - Allows trusted fetch data to skip sanitization\n *\n * @returns The fetched response parsed by the configured parameters.\n */\n\n constructor(options = {}, subscriber, testMode, CHANNEL_NAME) {\n const testSubscriber = p => console.log('FETCH RETURNED ', p)\n\n this._mapFn = ChannelFetchUtil.setMapFn(options)\n this._url = ChannelFetchUtil.setUrl(options)\n this._responseType = ChannelFetchUtil.setResponseType(options)\n this._serverOptions = ChannelFetchUtil.setServerOptions(options)\n this._subscriber = subscriber !== undefined ? subscriber : testSubscriber\n this.debug = options?.debug === true\n this.disableSanitize = options?.disableSanitize === true\n this.channelName = CHANNEL_NAME\n\n const fetchProps = {\n mapFn: this.mapFn,\n url: this.url,\n serverOptions: this.serverOptions,\n responseType: this.responseType,\n disableSanitize: this.disableSanitize,\n debug: this.debug\n }\n\n if (testMode !== true) {\n ChannelFetchUtil.startWindowFetch(fetchProps, this._subscriber, this.channelName)\n }\n }\n\n static startWindowFetch(props, subscriber, channelName) {\n const { mapFn, url, serverOptions, responseType, debug } = props\n\n const metadata = {\n channelName,\n url,\n responseType,\n serverOptions\n }\n\n const tapLogDebug = p => {\n console.log('DEBUG FETCH :', p, metadata)\n }\n\n const tapLog = debug === true ? tap(tapLogDebug) : tap(() => {})\n\n const mapWrapper = mapMethod => data => {\n const disableSanitize = props?.disableSanitize === true\n\n // Fetched data is remote and untrusted: always sanitize in 'app' mode,\n // regardless of the application's authoring/richtext posture.\n const sanitizedData = disableSanitize ? data : sanitizeData(data, { mode: 'app' })\n\n return mapMethod(sanitizedData, metadata)\n }\n\n const response$ = from(window.fetch(url, serverOptions)).pipe(\n mergeMap(response =>\n from(ChannelFetchUtil.parseResponse(response, metadata))\n ),\n\n tapLog,\n\n map(mapWrapper(mapFn)),\n\n catchError(error =>\n of(ChannelFetchUtil.createFetchErrorPayload(error, metadata))\n ),\n\n share()\n )\n\n response$.subscribe(subscriber)\n }\n\n static async parseResponse(response, metadata) {\n const { responseType } = metadata\n\n const status = response.status\n const statusText = response.statusText\n const contentType = response.headers?.get?.('content-type') || ''\n\n const responseMetadata = {\n ...metadata,\n status,\n statusText,\n contentType,\n ok: response.ok\n }\n\n if (response.ok !== true) {\n const rawBody = await ChannelFetchUtil.safeReadText(response)\n\n throw ChannelFetchUtil.createFetchError({\n errorType: 'FETCH_HTTP_ERROR',\n message: `Fetch request failed with status ${status} ${statusText}`,\n metadata: responseMetadata,\n rawBody\n })\n }\n\n if (responseType === 'json') {\n return ChannelFetchUtil.parseJsonResponse(response, responseMetadata)\n }\n\n if (responseType === 'text') {\n return response.text()\n }\n\n if (responseType === 'blob') {\n return response.blob()\n }\n\n if (responseType === 'arrayBuffer') {\n return response.arrayBuffer()\n }\n\n if (responseType === 'formData') {\n return response.formData()\n }\n\n throw ChannelFetchUtil.createFetchError({\n errorType: 'FETCH_UNSUPPORTED_RESPONSE_TYPE',\n message: `Unsupported fetch responseType \"${responseType}\"`,\n metadata: responseMetadata\n })\n }\n\n static async parseJsonResponse(response, metadata) {\n const rawBody = await response.text()\n const trimmedBody = rawBody.trim()\n\n if (trimmedBody === '') {\n return null\n }\n\n try {\n return JSON.parse(trimmedBody)\n } catch (error) {\n throw ChannelFetchUtil.createFetchError({\n errorType: 'FETCH_RESPONSE_PARSE_ERROR',\n message: 'Expected JSON but could not parse response body.',\n metadata,\n rawBody,\n originalError: error\n })\n }\n }\n\n static createFetchError({ errorType, message, metadata, rawBody = '', originalError }) {\n const error = new Error(message)\n\n error.isChannelFetchError = true\n error.errorType = errorType\n error.metadata = metadata\n error.rawBody = rawBody\n error.originalError = originalError\n\n return error\n }\n\n static createFetchErrorPayload(error, metadata) {\n const fetchMetadata = error?.metadata || metadata || {}\n\n return {\n isChannelFetchError: true,\n isError: true,\n error: true,\n errorType: error?.errorType || 'FETCH_UNKNOWN_ERROR',\n message: error?.message || 'Unknown ChannelFetchUtil error',\n\n channelName: fetchMetadata.channelName,\n url: fetchMetadata.url,\n responseType: fetchMetadata.responseType,\n status: fetchMetadata.status,\n statusText: fetchMetadata.statusText,\n contentType: fetchMetadata.contentType,\n ok: fetchMetadata.ok,\n\n rawBodyPreview: ChannelFetchUtil.truncateBody(error?.rawBody),\n\n originalErrorMessage: error?.originalError?.message\n }\n }\n\n static truncateBody(body = '', maxLength = 500) {\n if (typeof body !== 'string') {\n return ''\n }\n\n return body.length > maxLength\n ? `${body.slice(0, maxLength)}...`\n : body\n }\n\n static async safeReadText(response) {\n try {\n return await response.text()\n } catch (error) {\n return ''\n }\n }\n\n static setMapFn(opts) {\n const getFn = compose(defaultTo(p => p), prop('mapFn'))\n return getFn(opts)\n }\n\n static setUrl(opts) {\n const url = prop('url', opts)\n\n if (url === undefined) {\n spyneWarn('SPYNE WARNING: URL is undefined for data channel')\n }\n\n return url\n }\n\n static setResponseType(opts) {\n return defaultTo('json', prop('responseType', opts))\n }\n\n get mapFn() {\n return this._mapFn\n }\n\n get url() {\n return this._url\n }\n\n get serverOptions() {\n return this._serverOptions\n }\n\n get responseType() {\n return this._responseType\n }\n\n static stringifyBodyIfItExists(obj) {\n const body = obj?.body\n\n const shouldStringifyBody =\n body !== null &&\n typeof body === 'object' &&\n body.constructor === Object\n\n if (shouldStringifyBody !== true) {\n return obj\n }\n\n const headers = new Headers(obj.headers || {})\n\n if (headers.has('Content-Type') !== true) {\n headers.set('Content-Type', 'application/json')\n }\n\n return {\n ...obj,\n headers,\n body: JSON.stringify(body)\n }\n }\n\n static updateMethodWhenBodyExists(opts) {\n const hasBody = opts?.body !== undefined\n const method = opts?.method || 'GET'\n\n if (hasBody && method.toUpperCase() === 'GET') {\n spyneWarn(\n 'SPYNE WARNING: Fetch body was provided with method GET. Changing method to POST.',\n opts\n )\n\n return {\n ...opts,\n method: 'POST'\n }\n }\n\n return opts\n }\n\n static setServerOptions(opts) {\n const options = pick([\n 'method',\n 'headers',\n 'body',\n 'mode',\n 'credentials',\n 'cache',\n 'redirect',\n 'referrer',\n 'referrerPolicy',\n 'integrity',\n 'keepalive'\n ], opts)\n\n let mergedOptions = mergeDeepRight(ChannelFetchUtil.baseOptions(), options)\n\n mergedOptions = ChannelFetchUtil.updateMethodWhenBodyExists(mergedOptions)\n mergedOptions = ChannelFetchUtil.stringifyBodyIfItExists(mergedOptions)\n\n return mergedOptions\n }\n\n static baseOptions() {\n return {\n method: 'GET',\n\n headers: new Headers({\n Accept: 'application/json, text/plain, */*'\n }),\n\n mode: 'cors',\n credentials: 'same-origin',\n cache: 'default',\n redirect: 'follow',\n referrerPolicy: 'no-referrer-when-downgrade',\n integrity: '',\n keepalive: false\n }\n }\n}\n","import { Channel } from './channel.js'\nimport { ChannelFetchUtil } from '../utils/channel-fetch-util.js'\nimport { path, pick, mergeDeepRight, all, allPass, either, values, defaultTo, reject, compose, isNil } from 'ramda'\n\nexport class ChannelFetch extends Channel {\n /**\n * @module ChannelFetch\n * @type extendable\n * @desc\n * <p>ChannelFetch extends Channel and is designed to create a Channel from fetched http data.</p>\n * <p>A ChannelFetch instance can be created with just the channel name and url properties.</p>\n * <p>The data is fetched once, but the ChannelFetch's data is always available to other Channel and ViewStream instances</p>\n *\n * <h3>The ChannelFetch Class</h3>\n * <ul>\n * <li>Extends Channel and uses the ChannelFetchUtil to make any type of http(s) request.</li>\n * <li>Requires a url property at instantiation.</li>\n * <li>The response data is published as a ChannelPayload.</li>\n * <li>The action for the returned ChannelFetch data is always in the following format, \"CHANNEL_NAME_RESPONSE_EVENT\"</li>\n * <li>Fetch failures (network errors, non-OK HTTP statuses, unparseable responses) are published as a conformed error ChannelPayload with the action format, \"CHANNEL_NAME_ERROR_EVENT\"</li>\n * <li>The error payload contains filterable properties such as errorType, status, statusText, url and message.</li>\n * <li>The default request type is a GET request that returns a JSON object.</li>\n * <li>However, any type of request and return type can be configured by using the body property when creating the instance.</li>\n * <li>The mapFn gives access to the returned response and can be use to parse the data before it is published to other Channels and ViewStream instances. The mapFn is not called for error payloads.</li>\n * <li>Channel Fetch will send the last response to future subscribers, and will not make further http(s) requests unless directed to do so.</li>\n * <li>Data can be Fetched again, by sending a \"CHANNEL_NAME_REQUEST_EVENT\" action from a ViewStream's sendInfoToChannel method.</li>\n * </ul>\n *\n * @constructor\n * @param {String} name\n * @param {Object} props\n *\n * @property {String} name - = undefined; The registered name for the channel.\n * @property {String} props.url - = undefined; The url to be fetched.\n * @property {Function} props.mapFn - = undefined; This method is called immediately after the fetched response and behaves like any map method.\n * @property {Object} props.body - = undefined; This will update the options, including header options, sent along with the fetch request. Default options uses a GET request.\n *\n * @example\n * TITLE[\"<h4>A ViewStream Instance Sending A Fetch Update Request</h4>\"]\n * const action = \"CHANNEL_FETCHCHANNEL_NAME_REQUEST_EVENT\";\n * const url = \"//site.com/json/\";\n * const body = {\n * method: \"POST\"\n * }\n *\n * this.sendInfoToChannel(\"CHANNEL_FETCHCHANNEL_NAME\", {action, url, body});\n *\n *\n */\n\n constructor(name, props = { disableSanitize:false }) {\n // ALLOW FOR GENERIC MAP PROPERTY\n\n ChannelFetch.validateMapMethod(props, name)\n\n if (props.map !== undefined) {\n props.mapFn = props.map\n }\n props.extendedActionsArr = [\n `${name}_RESPONSE_EVENT`,\n `${name}_ERROR_EVENT`,\n [`${name}_REQUEST_EVENT`, 'onFetchUpdate']\n ]\n props.sendCachedPayload = true\n super(name, props)\n }\n\n static validateMapMethod(props, name, testMode = false) {\n const isNotEmpty = arr => arr.length >= 1\n const isNotFunction = val => typeof (val) !== 'function'\n const isUndefinedOrWrongType = either(isNil, isNotFunction)\n const isUndefined = all(isUndefinedOrWrongType)\n const isNotUndefinedAndIsNotEmpty = allPass([isUndefined, isNotEmpty])\n const mapMethodIsInvalid = compose(isNotUndefinedAndIsNotEmpty, values, pick(['map', 'mapFn']))(props)\n\n if (mapMethodIsInvalid) {\n if (testMode === false) {\n console.warn(`Spyne Warning: The map method for ChannelFetch, ${name}, appears to be invalid`)\n }\n return false\n }\n\n return true\n }\n\n onRegistered(props = this.props) {\n if (props?.pause !== true) {\n this.startFetch()\n }\n }\n\n addRegisteredActions(name) {\n const arr = [\n 'CHANNEL_RESPONSE_EVENT',\n 'CHANNEL_ERROR_EVENT',\n ['CHANNEL_UPDATE_RESPONSE_EVENT', 'onFetchUpdate'],\n ['CHANNEL_FETCH_REQUEST_EVENT', 'onFetchUpdate']\n ]\n\n const extendedArr = compose(defaultTo([]), path(['props', 'extendedActionsArr']))\n return arr.concat(extendedArr(this))\n }\n\n startFetch(options = {}, subscriber = this.onFetchReturned.bind(this)) {\n const fetchProps = this.consolidateAllFetchProps(options)\n return new ChannelFetchUtil(fetchProps, subscriber, false, this.props.name)\n }\n\n onFetchUpdate(evt) {\n const propsOptions = this.getPropsForFetch(evt)\n this.startFetch(propsOptions)\n }\n\n onFetchReturned(streamItem) {\n const isFetchError = streamItem?.isChannelFetchError === true\n const action = isFetchError\n ? `${this.props.name}_ERROR_EVENT`\n : `${this.props.name}_RESPONSE_EVENT`\n\n return this.createChannelPayloadItem(streamItem, action)\n }\n\n createChannelPayloadItem(payload, action = `${this.props.name}_RESPONSE_EVENT`) {\n const { name, sendCachedPayload, url } = this.props\n const srcElement = { name, sendCachedPayload, url }\n this.sendChannelPayload(action, payload, srcElement)\n }\n\n getPropsForFetch(evt) {\n const dataObj = evt?.payload ?? evt?.viewStreamInfo?.payload ?? {}\n return pick(['mapFn', 'url', 'header', 'body', 'mode', 'method', 'responseType', 'debug'], dataObj)\n }\n\n consolidateAllFetchProps(options, props = this.props) {\n const propsOptions = pick(['mapFn', 'url', 'header', 'body', 'mode', 'disableSanitize', 'method', 'responseType', 'debug'], props)\n const mergeOptions = (o1, o2) => mergeDeepRight(o1, o2)\n const filterOutUndefined = reject(isNil)\n return compose(filterOutUndefined, mergeOptions)(propsOptions, options)\n }\n\n get observer() {\n return this.observer$\n }\n}\n","import { DomElement } from './views/dom-element.js'\nimport { SpyneAppProperties } from './utils/spyne-app-properties.js'\nimport { is, clone, pathSatisfies } from 'ramda'\nlet _spyneAppProps = SpyneAppProperties\nexport class SpynePlugin {\n constructor(props = {}) {\n let { name, config, parentEl } = props\n this.props = props\n\n if (config === undefined) {\n config = clone(props)\n }\n\n this.name = name || 'empty'\n this.props.name = name\n config = SpynePlugin.mergeDefaultConfig(config, this.defaultConfig())\n this.props.parentEl = parentEl || SpynePlugin.createParentEl()\n // SpynePlugin.getSpyneApp(name, config)\n this.props.config = config\n if (this.props.traits !== undefined) {\n this.addTraits(this.props.traits)\n }\n\n // this.onBeforeRegistered()\n // this.onRegistered()\n // this.onRender()\n }\n\n /**\n * Now this method will be called when the app decides to register the plugin.\n * This way, the plugin no longer has to import or rely on its own version\n * of SpyneAppProperties. Instead, it is *passed* the authoritative instance.\n */\n register(spyneAppProps) {\n // 1. Save a reference to the real SpyneAppProperties\n _spyneAppProps = spyneAppProps\n this.props.pluginName = this.props.name\n\n // this.props.config = _spyneAppProps.getPluginConfigByPluginName(this.props.pluginName)\n\n if (_spyneAppProps.initialized === false) {\n console.warn(\n `Spyne Warning: SpyneApp has not been initialized yet! Cannot register plugin \"${this.name}\".`\n )\n return\n }\n\n this.onBeforeRegistered()\n\n // 2. Add plugin config in the real SpyneAppProperties\n this.props.config = clone(this.props.config)\n _spyneAppProps.addPluginConfig(this.name, this.props.config)\n\n // If you have plugin-level logic that depends on the real spyneApp,\n // you can add it here, e.g.:\n // spyneAppProps.addPluginMethods(this.props.config.pluginMethods)\n\n // 3. If you have other plugin lifecycle methods\n this.onRegistered()\n this.onRender()\n }\n\n get SpyneAppProperties() {\n return _spyneAppProps\n }\n\n static mergeDefaultConfig(config = {}, defaultConfig = this.defaultConfig()) {\n return Object.assign(defaultConfig, config)\n }\n\n static getSpyneApp(name, config) {\n if (_spyneAppProps.initialized === false) {\n console.warn(`Spyne Warning: Unable to install plugin, ${name}! SpyneApp has not been initialized!`)\n // SpyneApp.init()\n } else {\n _spyneAppProps.addPluginConfig(name, config)\n }\n }\n\n static updateSpyneConfig(spyneApp, pluginName, pluginConfig) {\n const pathExists = pathSatisfies(is(Object), ['config', 'plugins', pluginName])(spyneApp)\n\n if (pathExists === true) {\n if (spyneApp.config.debug === true) {\n console.warn(`Spyne Warning: The plugin, ${pluginName}, already exists`)\n }\n return false\n }\n spyneApp.config.plugins[pluginName] = pluginConfig\n return spyneApp.config.plugins[pluginName]\n }\n\n static createParentEl(el) {\n const createPluginParentEl = () => {\n const pluginEl = document.getElementById('spyne-plugins')\n\n const createPluginEl = () => {\n const pluginEl = new DomElement({\n id: 'spyne-plugins'\n })\n document.body.appendChild(pluginEl.render())\n const el = document.getElementById('spyne-plugins')\n el.style.cssText = 'position:absolute; top:0;left:0;width:100%;height:100%;min-height:100vh;z-index:1000000; pointer-events:none'\n return el\n }\n return pluginEl || createPluginEl()\n }\n\n return el || createPluginParentEl()\n }\n\n addTraits(traits) {\n if (traits.constructor.name !== 'Array') {\n traits = [traits]\n }\n const addTrait = (TraitClass) => {\n return new TraitClass(this)\n }\n\n traits.forEach(addTrait)\n }\n\n onBeforeRegistered() {\n // this.props.pluginName = this.props.name\n // this.props.config = _spyneAppProps.getPluginConfigByPluginName(this.props.pluginName)\n this.checkForRequiredWindowEvent()\n }\n\n checkForRequiredWindowEvent() {\n const requiredEvents = this.props.requiredEvents ?? []\n const windowConfig = SpyneAppProperties.getChannelConfig('WINDOW')\n\n const missingEvents = requiredEvents.filter(evt => !windowConfig.events.includes(evt))\n\n // If any are missing, log a single warning listing them\n if (missingEvents.length > 0) {\n console.warn(\n `plugin \"${this.props.name}\" requires the following config.WINDOW.events, --> ${missingEvents.join(', ')} <--`\n )\n }\n }\n\n defaultConfig() {\n return {\n\n }\n }\n\n onRegistered() {\n\n }\n\n onRender() {\n\n }\n}\n","import { ChannelsMap } from './channels/channels-map.js'\nimport { ViewStream } from './views/view-stream.js'\nimport { SpyneUtilsChannelRoute } from './utils/spyne-utils-channel-route.js'\nimport { SpyneAppProperties } from './utils/spyne-app-properties.js'\nimport { sanitizeHTMLConfigure } from './utils/sanitize-html.js'\nimport { sanitizeDataConfigure } from './utils/sanitize-data.js'\n\nconst _channels = new ChannelsMap()\nconst version = '0.25.0'\n\nclass SpyneApplication {\n /**\n *\n * SpyneApp creates the global Spyne object, and creates the following items\n * <ul>\n *\n * <li>LINK['ChannelsMap', 'channels-controller'] that directs the flow of data to all Channels</li>\n * <li>LINK['SpyneChannelUI', 'spyne-channel-u-i'], that broadcast all user interaction events</li>\n * <li>LINK['SpyneChannelRoute', 'spyne-channel-route'], that broadcast window location changes and is the only other channel that can be bound to user events</li>\n * <li>LINK['SpyneChannelWindow', 'spyne-channel-window'], that broadcast all requested window and document events, such as scrolling, resizing and media queries</li>\n * <li>LINK['SpyneChannelLifecycle', 'spyne-channel-lifecycle'], that broadcasts rendering and removing of ViewStream elements that have been directed to broadcast their lifecycle events</li>\n * </ul>\n *\n *\n * @module SpyneApp\n * @type core\n *\n * @constructor\n * @param {Object} config\n * @property {Object} config - = {}; This global config object is mainly used to provide configuration details for two SpyneChannels, CHANNEL_ROUTE and CHANNEL_WINDOW.\n */\n\n constructor() {\n this.version = version\n }\n\n get channels() {\n return _channels\n }\n\n init(config = {}, testMode = false) {\n // this.channels = new ChannelsMap();\n /*!\n * Spyne 0.25.0\n * https://spynejs.org\n *\n * @license\n * Copyright 2017-2025, Frank Batista,\n * Relevant Context, LLC. All rights reserved.\n *\n * Licensed under the GNU Lesser General Public License v3.0 (the \"License\");\n * You may not use this file except in compliance with the License.\n * A copy of the License is located in the project root, or at:\n * https://www.gnu.org/licenses/lgpl-3.0.html\n *\n * This notice may not be removed or altered from any distribution.\n */\n /* eslint-disable */\n\n if(SpyneAppProperties.initialized === true){\n if (testMode){\n return 'The Spyne Application has already been initialized!';\n } else {\n console.warn('The Spyne Application has already been initialized!');\n }\n return\n }\n\n //const imgPath = IMG_PATH || undefined;\n const imgPath = (typeof IMG_PATH !== 'undefined') ? IMG_PATH : undefined;\n let defaultConfig = {\n scrollLock: false,\n scrollLockX: 31,\n scrollLockY: 0,\n debug: false,\n strict: false,\n mode: 'app',\n disableSanitize: false,\n iframes: {},\n customElements: [],\n baseHref: undefined,\n IMG_PATH: imgPath,\n pluginMethods:{\n\n },\n plugins:{\n\n },\n tmp: {},\n ephemeralProps: {},\n tmpProps: {},\n channels: {\n WINDOW: {\n mediaQueries: {\n\n },\n events: [],\n listenForResize: true,\n listenForOrientation: true,\n listenForScroll: false,\n listenForMouseWheel: false,\n listenForWheel: false,\n debounceMSTimeForResize: 200,\n debounceMSTimeForScroll: 150\n },\n\n ROUTE: {\n type: 'slash',\n isHash: false,\n isHidden: false,\n add404s: false,\n routes: {\n 'routePath' : {\n 'routeName' : 'change'\n }\n }\n\n }\n }\n };\n if (config !== undefined) {\n const routeUtils = SpyneUtilsChannelRoute;\n config = SpyneAppProperties.initialize(defaultConfig, config, _channels, routeUtils);\n //console.log(\"SPYNE APP PROPS \",SpyneAppProperties);\n //window.Spyne = this;\n //window.Spyne['config'] = deepMerge(defaultConfig, config)\n }\n this.pluginsFn = SpyneAppProperties.getPluginsMethodObj(config['pluginMethods']);\n this.getChannelActions = (str) => _channels.getChannelActions(str);\n this.registerChannel = (val) => _channels.registerStream(val);\n this.registerPlugin = (pluginInstance) => SpyneAppProperties.registerPlugin(pluginInstance);\n this.registerDataChannel = (obs$) => _channels.registerStream(obs$);\n this.listChannels = () => Array.from(_channels.map.keys());\n let nullHolder = new ViewStream({ id:'spyne-null-views' });\n nullHolder.appendToDom(document.body);\n nullHolder.props.el.style.cssText = 'display:none; opacity:0; pointer-events:none;';\n _channels.init();\n\n if (SpyneAppProperties.config.debug===true){\n window.Spyne = {version};\n }\n\n sanitizeHTMLConfigure(SpyneAppProperties.config);\n sanitizeDataConfigure(SpyneAppProperties.config);\n\n }\n\n /**\n * This is mostly used for debugging purposes\n *\n * @example\n * TITLE['<h4>Listing the registereed Channels in the browser console</h4>']\n * SpyneApp.listChannels();\n *\n * @returns A list of all registered channels\n */\n static listChannels() {\n return Array.from(_channels.map.keys());\n }\n\n /**\n * This method is useful to check in the console or in the code what actions are available to be listened to.\n * @param {String} str\n * @returns {Array} An array of Actions that can be listened to\n */\n static getChannelActions(str) {\n return _channels.getChannelActions(str);\n }\n\n /**\n *\n * This method will add the channel to the registered list so that it can subscribed by all ViewStream and Channel instances.\n * @param {Channel} c\n *\n *\n */\n static registerChannel(c) {\n if (SpyneAppProperties.initialized === false) {\n console.warn('Spyne has not been initialized');\n } else {\n return _channels.registerStream(c);\n }\n }\n}\n\n\nexport let SpyneApp = new SpyneApplication();\n"],"names":["SpyneUtilsChannelRouteUrl","constructor","this","checkIfObjIsNotEmptyOrNil","bind","obj","isNotEmpty","compose","complement","isEmpty","head","values","isNotNil","isNil","allPass","isNotNilAndIsNotEmpty","checkIfParamValueMatchesRegex","paramValue","routeObj","rejectParamKey","reject","equals","keysArr","keys","regexMatchStr","find","str","test","RegExp","checker","is","String","assoc","prop","formatStrAsWindowLocation","hash","search","pathname","getLocationStrByType","t","isHash","loc","window","location","slash","query","replace","createRouteArrayFromParams","data","route","paramsFromLoc","urlArr","loopThroughParam","urlObj","keyword","routeName","paramValFromData","undefined","paramValType","push","isObject","Object","objectParamExists","has","objectContainsRoute","newObj","routePath","createSlashString","arr","arrClear","notUndefined","when","__","join","stripRegex","flatten","map","joiner","createQueryString","createPair","toPairs","checkPair","ifElse","always","mapArrayOfPairs","checkIfStrIsEmpty","concat","createQs","checkPayloadForRegexOverrides","urlsArr","parseString","getOverrideVal","key","overrideVal","checkForRouteValWithMultipleVals","mapUrlArrObj","pipeReducer","acc","input","match","getStringBeforePipe","reduce","Array","isArray","checkForRouteValsPartMatch","matchGlobPattern","globPattern","split","some","pattern","value","escapedPattern","globPatternMatch","updatedObj","forEach","prototype","hasOwnProperty","call","convertParamsToRoute","r","SpyneAppProperties","config","channels","ROUTE","locStr","urlType","type","routes","locationStr","paramsFromCurrentLocation","convertRouteToParams","routeData","findIndexOfMatchedStringOrRegex","mainStr","paramsArr","is404","includes","checkForEmpty","checkForEitherStrOrReMatch","either","propEq","findLastIndex","re","s","startsWith","endsWith","findMatchIndex","checkIfValueShouldMapToParam","regexTokens","last","filter","getValCompareArr","paramIndex","paramStr","param","invertedObj","invert","paramInverted","defaultTo","getParamInverted","createArrFromSlashStr","convertSlashRouteStrToParamsObj","topLevelRoute","routeValue","valuesArr","paths","routedValuesArr","latestObj","total","currentValue","routeValueStr","isEmptyOrNil","prevPathNotEqCurrentPath","objectFromStr","path","objectFromRouteParam","zipObj","pathInnermost","getLastArrVal","a","createDefaultParamFromEmptyStr","convertQueryStrToParams","strArr","convertToParams","fromPairs","routeConfig","SpyneUtilsChannelRoute","createPopStateStream","subscribeFn","fromEventPattern","handler","onpopstate","subscribe","compareRouteKeywords","pickValues","o","pick","obj1","compare","obj2","createPred","p","getPropsState","p1","p2","same","previousExists","nextExists","changed","added","removed","uniq","chain","pathsChanged","pathsAdded","pathsRemoved","getComparer","getRouteArrData","routeArr","flattenConfigObject","go","obj_","k","v","k_","v_","addRouteDatasets","channelRouteObj","getHREF","headStrVal","hrefStr","isValidStrRE","createInitialValFn","accMain","routePathObj","objAcc","arrPair","val","getLinkText","toUpperCase","createTitle","clone","length","subRouteName","oBase","navLevel","title","href","reducedArr","routeDatasetsArr","removeUndefined","routeNamesArr","datasetsArr","exclude","getMainKeys","getNavProps","conformRouteObject","add404Props","channelsRoutePath","add404s","parseRoutePath","isArr","configMapperFn","obj404","isObj","isRoutePath","mergeDeepRight","extraRouteData","mergeRight","getLocationData","pickAll","_pluginMethodsObj","create","isNotArr","not","isObjectFn","isMergeableObject","toString","cloneIfNecessary","optionsArgument","deepMerge","defaultArrayMerge","target","source","destination","slice","e","i","indexOf","array","arrayMerge","mergeObject","_config","_channels","_channelsMap","_initialized","all","Error","prev","next","_debug","_enableCMSProxies","_excludeChannelsFromConsole","_navLinks","_IMG_PATH","_doNotTrackChannelsArr","_proxiesMap","Map","_spynePluginMethods","foo","console","log","addMethod","fn","warnStr","warn","addMethods","methodsObj","JSON","stringify","keyStr","methodVal","checkIfMethodExists","pluginMethodsObj","channelsMap","initialized","debug","mode","listChannels","from","initialize","defaultConfig","routeUtils","IMG_PATH","getChannelActions","listRegisteredChannels","setChannelsMap","baseHref","setHeadBaseHref","baseTag","document","createElement","appendChild","conformRouteConfig","getStream","testStream","getProxySubject","setProp","isTemp","ephemeralProps","tmpProps","getProp","tempVal","createTempProp","Math","random","setChannelConfig","channelName","getChannelConfig","channelConfig","registerChannel","addPluginConfig","pluginName","pluginConfig","plugins","addPluginMethods","pluginMethods","getPluginsMethodObj","doNotTrackChannel","getUntrackedChannelsList","registerProxyReviver","name","method","set","registerPlugin","pluginInstance","register","getProxyReviver","proxyName","get","getPluginConfigByPluginName","excludeChannelsFromConsole","item","linksData","navLinks","enableCMSProxies","getHrefFromData","routeProps","bool","Boolean","setCMSProxyMethod","formatTemplateForProxyData","tempGetChannelsInstance","tempGetConfig","registeredStreamNames","Observable","cmsDataReviveNestedProxyObj","proxyObj","proxyReviverMethod","__proxy__proxyName","error","cloneNestedProxyObj","pathArr","nestedProxyObj","__proxy__isProxy","__proxy__props","rootObj","proxyIterable","iterObj","iterPath","dataPath","entries","prp","getPropType","clonedPath","safeClone","ob","ChannelPayload","action","payload","srcElement","event","timeLabel","channel","time","channelPayloadItemObj","frozenPayload","deepFreeze","payloadStr","channelActionsArr","validateAction","mergeAll","channelPayloadItemObjProps","$dir","_dir","defineProperties","timeEnd","isInArr","getStreamItem","deepClone","elIsDomElement","lte","freeze","getOwnPropertyNames","isFrozen","getMouseEventKeys","baseCoreMixins","createpropsMap","wm","WeakMap","objKey","vsid","props","weakMap","gc","m","createId","substring","setTraceFunc","delayCall","async","setTimeout","ms","Promise","resolve","requestAnimationFrame","getConstructorName","substr","spyneWarn","args","SPYNE_SUPPRESS_WARNINGS","setSpyneWarningsDisabled","_sanitizeData","isConfigured","globalDisable","SAFE_URI_REGEXP","normalizeUriForCheck","SPYNE_CUSTOM_ELEMENT_RE","allowedCustomElementPatterns","allowCustomElements","elements","entry","toLowerCase","CUSTOM_ELEMENT_HANDLING","tagNameCheck","tagName","attributeNameCheck","allowCustomizedBuiltInElements","SAFE_FOR_RICH_TEXT","ALLOWED_TAGS","ADD_TAGS","ALLOWED_ATTR","ALLOW_DATA_ATTR","FORBID_ATTR","FORBID_TAGS","ALLOWED_URI_REGEXP","SAFE_FOR_APP","configuredIframePolicy","allow","allowedOrigins","sandbox","activeIframePolicy","resolveIframePolicy","override","isAllowedIframeSrc","src","policy","normalized","resolved","URL","origin","hostname","protocol","origins","iframeHookAdded","RICHTEXT_ALIASES","resolveDefaultMode","configMode","process","env","NODE_ENV","buildModeConfig","base","allowIframe","iframeAllowedForMode","ADD_ATTR","makeSanitizeFn","cfg","html","DOMPurify","sanitize","sanitizeDataConfigure","strict","disableSanitize","iframes","customElements","addHook","node","getAttribute","removeAttribute","hasAttribute","setAttribute","processFactory","sanitizeStr","out","opts","callDisable","iframesOverride","effectiveMode","sanitizeDataForce","effective","sanitizeData","URL_ATTRS","sanitizeAttribute","allowed","tag","sanitizeEventTarget","el","UNSAFE_RE","clean","isContentEditable","innerHTML","_sanitizeHTML","sanitizeHTML","DomElementTemplate","template","formatTemplate","isProxyData","__cms__isProxy","testMode","normalizeTripleBrackets","proxyFormatter","spyneData","checkForArrayData","templateData","currentOuterLoopData","getStringArray","strMatches","findTmplLoopsRE","parseTmplLoopsRE","parseTmplLoopFn","parseTheTmplLoop","findTmplLoopsPred","checkForMatches","addParams","finalArr","isPrimitiveTag","getNestedDataReducer","nestedData","emptyRE","withoutLeaks","_","innerLoopRE","swapParamsForTagsRE","hasLoop","removeThis","renderDocFrag","replaceImgPath","createRange","createContextualFragment","renderToString","getTemplateString","getDataValFromPathStr","pathStr","dataFile","p3","templateStr","replaceAll","processInnerLoop","bodyStr","parentItem","innerRE","fullMatch","openTag","innerKey","innerBody","innerData","innerArr","previousOuter","rendered","innerItem","innerIdx","substituteForItem","index","escaped","ctx","buildStringItemContext","substituteObject","dataObj","buildItemContext","context","spyneLoopKey","loopIndex","loopNum","outerData","__cms__dataId","keyIdStr","origKey","assign","reDot","positional","outerBody","elData","elArr","bodyHasInnerLoop","body","DomElement","dflt","attributes","getDomAttributes","attrs","updateAttrs","fragment","createDocumentFragment","addMixins","setElAttrs","params","addToDataset","dataset","forEachObjIndexed","applyIframeHardening","theMap","mapObjIndexed","addTemplate","frag","addTmpl","addContent","text","txt","createTextNode","execute","pipe","render","renderToHTMLString","outerHTML","returnIfDefined","updateprops","updatepropsAndRun","unmount","remove","updateTag","updateAttributes","updateTemplate","updateData","addTagAndRender","addAttrsibutesAndRender","addTemplateAndRender","addDataAndRender","coreMixins","attributesArray","createFaderInlineText","isInBool","startZeroBool","isFunction","operate","init","lift","hasLift","liftedSource","err","TypeError","extendStatics","d","b","setPrototypeOf","__proto__","__extends","__awaiter","thisArg","_arguments","P","generator","fulfilled","step","rejected","result","done","then","apply","__generator","f","y","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","n","op","pop","__values","__read","ar","__spreadArray","to","pack","arguments","l","__await","__asyncGenerator","asyncIterator","q","AsyncIterator","resume","fulfill","settle","shift","__asyncValues","SuppressedError","isArrayLike","x","isPromise","createErrorClass","createImpl","ctorFunc","instance","stack","UnsubscriptionError","_super","errors","message","arrRemove","splice","Subscription","initialTeardown","closed","_parentage","_finalizers","empty","unsubscribe","e_1","_a","e_2","_b","_parentage_1","_parentage_1_1","e_1_1","return","initialFinalizer","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","add","teardown","_hasParent","_addParent","parent","_removeParent","EMPTY","EMPTY_SUBSCRIPTION","isSubscription","onUnhandledError","onStoppedNotification","useDeprecatedSynchronousErrorHandling","useDeprecatedNextContext","timeoutProvider","timeout","_i","delegate","clearTimeout","handle","reportUnhandledError","noop","COMPLETE_NOTIFICATION","createNotification","kind","errorContext","cb","Subscriber","_this","isStopped","EMPTY_OBSERVER","complete","SafeSubscriber","handleStoppedNotification","nextNotification","_next","_error","_complete","_bind","Function","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","context_1","notification","subscriber","observable","identity","pipeFromArray","fns","_subscribe","operator","isObserver","_trySubscribe","sink","promiseCtor","getPromiseCtor","Symbol_observable","operations","toPromise","isInteropObservable","isAsyncIterable","createInvalidObservableTypeError","isIterable","Symbol_iterator","readableStreamLikeToAsyncGenerator","readableStream","reader","getReader","read","releaseLock","isReadableStreamLike","innerFrom","obs","promise","fromAsyncIterable","iterable","iterable_1","iterable_1_1","asyncIterable","asyncIterable_1","asyncIterable_1_1","catch","createOperatorSubscriber","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","Action","scheduler","work","schedule","state","delay","intervalProvider","setInterval","clearInterval","AsyncAction","pending","id","recycleAsyncId","requestAsyncId","_id","flush","_scheduler","_execute","_delay","errorValue","errored","actions","dateTimestampProvider","now","Date","Scheduler","schedulerActionCtor","asyncScheduler","AsyncScheduler","SchedulerAction","_active","executeSchedule","parentSubscription","repeat","scheduleSubscription","catchError","selector","handledResult","innerSub","syncUnsub","observeOn","subscribeOn","scheduleAsyncIterable","scheduled","scheduleObservable","scheduleArray","schedulePromise","scheduleIterable","scheduleReadableStreamLike","project","mapOneOrManyArgs","callOrApply","combineLatestInit","observables","valueTransform","maybeSchedule","active","remainingFirstValues","_loop_1","hasFirstValue","subscription","mergeMap","resultSelector","concurrent","Infinity","ii","onBeforeNext","expand","innerSubScheduler","additionalFinalizer","buffer","isComplete","checkComplete","outerNext","doInnerSub","innerComplete","innerValue","bufferedValue","mergeInternals","combineLatest","popResultSelector","argsOrArgArray","ObjectUnsubscribedError","Subject","currentObservers","observers","hasError","thrownError","subject","AnonymousSubject","_throwIfClosed","_c","defineProperty","enumerable","configurable","_checkFinalizedStatuses","_innerSubscribe","asObservable","debounceTime","dueTime","activeTask","lastValue","lastTime","emit","emitWhenIdle","targetTime","take","count","seen","predicate","finalize","callback","handleReset","reset","on","onSubscriber","takeWhile","inclusive","tap","tapObserver","isUnsub","ViewStreamObservable","observableStreams","createDirectionalObservables","createDirectionalFiltersObject","dirInternal","dirParent","dirChild","C","PCI","CI","PI","PC","addDefaultDir","flip","defaults","addDownInternalDir","addChildAndInternalDir","mapToDefaultDir","obs$","viewName","filterStreams","propSatisfies","arrType","filterParent","filterChild","filterInternal","addfrom$","relStr","from$","addParentfrom$","addInternalfrom$","addChildfrom$","raw$","toInternal$","toParent$","toChild$","streamObj","internal","child","completeAll","completeStream","setCompleteStream","ViewStreamElement","sink$","viewProps","vsName","_state","extendedHashMethods","options","addActionListeners","funcStr","hashMethods","setHashMethods","onObsSinkSubscribe","$dirs","sourceStreams","_source$","extendedHashMethodsObj","VS_DETRITUS_COLLECT","onGarbageCollect","READY_FOR_VS_DETRITUS_COLLECT","onReadyForGC","EXTIRPATE","onDispose","VS_SPAWN","onRender","VS_SPAWN_AND_ATTACH_TO_PARENT","onRenderAndAttachToParent","VS_SPAWN_AND_ATTACH_TO_DOM","onRenderAndAttachToDom","ATTACH_CHILD_TO_SELF","onAttachChildToSelf","createDomItem","onDisposeCompleted","animateInTween","currentOpacity","getComputedStyle","opacity","inlineCss","style","cssText","fadein","animateOutTween","addEventListener","fadeout","setAnimateIn","animateIn","domItem","animateInTime","disposeMethod","gcData","fadeOutObs","bindCallback","animateOutTime","onFadeoutCompleted","animateOut","removeStream","getSourceStream","combineDomItems","container","defaultFn","insertBefore","firstChild","after","attachType","childRenderData","renderDomItem","getEl","I","extendedMethods","attachData","defaultToFn","sendData","ViewStreamPayload","sendToDirectorStream","directorStream$","isDevMode","ViewStreamBroadcaster","broadcastFn","broadcaster","addDblClickEvt","fromEvent","typeOverRide","broadcast","channelPayloads","UI","sendUIPayload","sendRoutePayload","local","querySelectorAll","checkParentEls","element","elSelected","parentElement","pluckElFromParent","isLocalEvent","addObservable","preventDefault","domMap","convertDomStringMapToObj","omit","endPreventDefault","srcEvent","ch","channelPayload","arrFn","streamMixins","testFunc","isNonEmptyStr","isNonEmptyArr","isNonEmptyObjectFn","ChannelPayloadFilter","filters","debugLabel","debugLabelArr","propFilters","addStringSelectorFilter","filterSelector","addArraySelectorFilter","addDataFilter","filterData","filtersArr","filtersAreEmpty","filterJson","filterdebugLabel","rMap","fnVal","F","isString","isBoolean","Number","isNumber","compareStr","isArrayFn","fMethod","where","comparedObj","propsBooleans","compareData","checkPayloadSelector","srcPayload","compareEls","elCompare","isEqualNode","mapNodeArrWithEl","sel","nodeArr","nodeArrResultsDebugger","selectorsArr","nodeArrResult","any","querySelector","selectorArr","curry","payloadCheck","getElOrList","cxt","verboseBool","list","getNodeListArray","testSelectors","trim","isValidSelector","isValidSelectorBool","isParent","returnSelectorIfValid","setInlineCss","ViewStreamSelector","generateSpyneSelectorId","addClass","c","classList","removeClass","setClass","removeClassStrArr","className","classStrArr","toggleClass","contains","toggle","htmlElement","addAnimClass","setActiveItem","elSel","currentEl","nodeCheck","matchingEl","getElsArray","ViewStream","vsnum","_postRenderCalled","sendLifecyleEvents","hashId","id$","viewClass","extendedSourcesHashMethods","addDefaultDirection","sendLifecycleMethod","sendLifecycleMethodActive","sendLifecycleMethodInactive","attributesArr","domAttributes","traits","addTraits","loadAllMethods","elIsAlreadyRenderedBool","elAlreadyExistsFn","ViewClass","view","_rawSource$","sendEventsDownStream","sendEventsDownStreamFn","initViewStream","addedChannels","checkIfElementAlreadyExists","source$","checkIfActionsAreRegistered","channelsArr","actionsArr","checkForMatch","strMatch","findIndex","getAllActionsArr","channelSyntax","getAllActions","isValidNestedArr","eventsArr","isTrue","allIsTrue","isValidArr","mapEventsArrFn","updatePropsToMatchEl","getTagName","toLower","postRender","channelFn","onChannelMethodCall","actionFilter","hashSourceMethods","setSourceHashMethods","runFunc","deleted","filterPayload","hashSourceKeys","EXTIRPATING","checkParentDispose","disposeViewStream","VS_SPAWNED","onVSRendered","VS_SPAWNED_AND_ATTACHED_TO_DOM","VS_SPAWNED_AND_ATTACHED_TO_PARENT","onReadyToGC","VS_NULLITY","onMapViewSource","notGCSTATE","initAutoMergeSourceStreams","updateSourceSubscription","eqGCSTATE","notCOMPLETED","notGCCOMPLETE","testVal","addParentStream","parent$","renderAndAttachToParent","addChildStream","child$","tracer","onChildCompleted","onChildDisposed","childCompletedData","finalDest","findName","onSubscribeToSourcesNext","onSubscribeToSourcesError","onSubscribeToSourcesComplete","el$","uberSource$","autoSubscriber$","decrementOnObservableClosed","obsCount","autoMergeSubject$","obsData","branchObservable$","autoClosesBool","rel","sendExtendedStreams","hashActionStr","checkerIfRegexMatchExists","openSpigot","renderView","renderViewAndAttachToDom","onBeforeDispose","methodFn","onChildDispose","onParentDisposing","isInternal","setAttachData","checkQuery","getParentEls","num","getElem","iter","parentEl","setAttachParentData","level","exchangeViewsWithChild","childView","appendToDom","appendToDomAfter","prependToDom","appendView","appendViewAfter","appendViewToParentEl","prependViewToParentEl","prependView","appendToNull","getElementById","_postRenderedCalled","beforeAfterRender","afterRender","onRendered","onAnimFrameAfterRendered","broadcastEvents","initializeChannels","viewsStreamBroadcaster","afterBroadcastEvents","TraitClass","pullActionsFromList","nestedActionsArr","delayForProxyChannelResets","setDataVSID","downStream","getChannel","observer","addChannel","skipFirst","sendDownStream","directionArr","isLocalEventCheck","cidCheck","pipeArr","pl","unshift","channel$","checkIfChannelExists","channelExists","sendInfoToChannel","defaultToAction","getActionFn","CHANNEL_ROUTE","of","isDisposed","createActionFilter","selectors","channelPayloadItem","itemEl","thisEl","RouteChannelUpdater","createTemporaryViewStreamObj","sendRouteChannelUpdate","vs","Channel","CHANNEL_NAME","addRegisteredActions","createChannelActionsObj","extendedActionsArr","defaultActions","isRegistered","isProxy","defaultCachedPayloadBool","replay","sendCachedPayload","sendPayloadToRouteChannel","createChannelActionMethods","streamsController","observer$","getMainObserver","checkForPersistentDataMode","dispatcherStream$","payloadPredByChannelName","onReceivedObservable","ReplaySubject","onChannelInitialized","onRegistered","channelActions","sendChannelPayload","checkForTraits","initializeStream","actionsObj","actionsObjIsEmpty","dataIsAdded","actionStr","setDefaultActionsObj","setTrace","getActionVal","mainArr","objOf","delayCheckIfTraitMethodHasBeenAdded","methodStr","getArrMethod","lensIndex","channelActionMethods","onIncomingObservable","getActionMethodForObservable","unpacked","onViewStreamInfo","eqsName","obsVal","mergeProps","onSuccess","payloadFilter","mergeChannels","emitOnce","channelObservables","chan$","combined$","forkJoin","first$","rest$","otherSources","combineLatestWith","resultsArr","idx","iterKey","checkForNotTrackFlag","doNotTrack","SpyneChannelRoute","super","routeConfigJson","getRouteConfig","bindStaticMethods","navToStream$","info","onMapNext","checkConfigForHash","initStream","updateRouteConfig","newRoutesObj","bindStaticMethodsWithConfigData","spyneConfig","firstLoadStream$","onIncomingDomEvent","merge","firstLoaded","removeSSID","routeLens","lensProp","over","omitSSID","evt","actn","CHANNEL_ROUTE_CHANGE_EVENT","eventCount","isHistoryCount","getDataFromString","routeCount","keywordArrs","rMerge","checkForRouteParamsOverrides","checkForEventMethods","methodsArr","ramdaFilter","getMethods","methodStrReplace","p4","runMethod","checkForEndRoute","debugBool","onReduceRoutePaths","routeNameVal","arrStr","getPropVal","nextRoutePath","reverse","endRouteValArr","endRouteVal","domStringMap","domStringMapToObject","getDataFromParams","changeLocationBool","isHidden","sendRouteStream","checkAndConvertStrWithRegexTokens","regexTokenObj","changeWindowLoc","setWindowLocation","getRouteState","getIsDeepLinkBool","isHistory","_routeCount","getRouteCount","getExtraPayloadParams","isDeepLink","routeType","getRouteStrFromParams","getPropFromConfig","defalt","typeForStr","isHashForStr","nextWindowLoc","dataFromStr","getDataFromLocationStr","hashIsTrue","getParamsFromRouteStr","paramsData","checkEmptyRouteStr","isEmptyBool","removeLastSlash","history","pushState","checkForSlash","getWindowLocation","curriedGetRoute","curryN","SpyneChannelUI","keyEventsLoaded","keyCodeArr","loadKeyStream","keyUps","keyPresses$","groupBy","keyCode","onKeyPressed","addKeyEvent","registerKey","onUIEvent","getActionState","typeVal","typeOverRideVal","toUpper","eventType","mainAction","SpyneUtilsChannelWindow","createDomObservableFromEvent","eventName","mapFn","isPassive","passive","createMediaQuery","mq","matchMedia","checkIfValidMediaQuery","noSpaces","isValidBool","matches","media","warnMsg","createMediaQueryHandler","mapKey","mediaQueryName","keyFn","mediaQueryHandler","addHandler","addListener","removeHandler","onchange","createMergedObsFromObj","mediaQueriesObj","mediaQueries","SpyneChannelWindow","currentScrollY","domChannelConfig","WINDOW","obs$Arr","getActiveObservables","dom$","getMouseWheelMapFn","CHANNEL_WINDOW_WHEEL_EVENT","scrollDir","deltaY","deltaX","deltaZ","createCurriedGenericEvent","mapGenericEvent","curryFn","getResizeMapFn","CHANNEL_WINDOW_RESIZE_EVENT","getOrientationMapFn","CHANNEL_WINDOW_ORIENTATION_EVENT","isPortraitBool","orientation","getMediaQueryMapFn","CHANNEL_WINDOW_MEDIA_QUERY_EVENT","createMouseWheelObservable","debounceT","debounceMSTimeForScroll","getScrollData","scrollY","scrollDistance","getScrollY","scrollElement","pageYOffset","scrollTop","getScrollMapFn","interval","scrollDataFn","createScrollObservable","dTime","isWindow","scrollElForVals","scrollMapFn","partialRight","taking","newScrollY","scrollDistanceAbs","abs","createOrientationObservable","createResizeObservable","debounceMSTimeForResize","getEventsFromConfig","events","listenForMediaQueries","methods","listenForResize","listenForOrientation","listenForScroll","listenForWheel","checkForMediaQueries","sendMQStream","getMediaQueryObservable","onScrollLockEvent","onSetElementToScroll","SpyneChannelLifecycle","onSendEvent","SpyneChannelAI","ChannelProxy","subject$","replaySub$","checkIfChannelIsStillProxy","getMergedSubject","peristData","replaySubject","_map","ChannelsMap","getChannelsList","showOnlyProxies","proxyMap","rejectProxyFn","filterProxyFn","removedProxyArr","pluck","listProxyChannels","checkForMissingChannels","filterProxyArr","filterPrefixWarning","createMainStreams","routeStream","uiStream","domStream","viewStreamLifecycle","aiStream","registerStream","pathEq","isReplaySubject","subjectType","SpyneTrait","parentContext","prefix","autoInit","omittedMethods","autoBinder","allMethodsList","initAutoBinder","getEnhancerMethods","combinedOmittedMethods","omitPropsFromArr","without","staticMethods","allMethods","getAllMethodNames","checkForMalformedMethods","isDebugMode","malformedMethodsArr","warningStr","bindParentViewStream","bindMethodsToParentViewStream","isStatic","constructorType","bindStaticMethodsToParentViewStream","bindCurry","ChannelFetchUtil","_mapFn","setMapFn","_url","setUrl","_responseType","setResponseType","_serverOptions","setServerOptions","_subscriber","fetchProps","url","serverOptions","responseType","startWindowFetch","metadata","tapLog","response$","fetch","response","parseResponse","mapMethod","sanitizedData","createFetchErrorPayload","connector","resetOnError","resetOnComplete","_d","resetOnRefCountZero","wrapperSource","connection","resetConnection","refCount","hasCompleted","hasErrored","cancelReset","resetAndUnsubscribe","conn","dest","share","status","statusText","contentType","headers","responseMetadata","ok","rawBody","safeReadText","createFetchError","errorType","parseJsonResponse","blob","arrayBuffer","formData","trimmedBody","parse","originalError","isChannelFetchError","fetchMetadata","isError","rawBodyPreview","truncateBody","originalErrorMessage","maxLength","getFn","stringifyBodyIfItExists","Headers","updateMethodWhenBodyExists","mergedOptions","baseOptions","Accept","credentials","cache","redirect","referrerPolicy","integrity","keepalive","ChannelFetch","validateMapMethod","isUndefinedOrWrongType","isUndefined","isNotUndefinedAndIsNotEmpty","pause","startFetch","extendedArr","onFetchReturned","consolidateAllFetchProps","onFetchUpdate","propsOptions","getPropsForFetch","streamItem","createChannelPayloadItem","viewStreamInfo","filterOutUndefined","o1","o2","_spyneAppProps","SpynePlugin","mergeDefaultConfig","createParentEl","spyneAppProps","onBeforeRegistered","getSpyneApp","updateSpyneConfig","spyneApp","pathSatisfies","pluginEl","createPluginEl","checkForRequiredWindowEvent","requiredEvents","windowConfig","missingEvents","version","SpyneApp","scrollLock","scrollLockX","scrollLockY","tmp","listenForMouseWheel","pluginsFn","registerDataChannel","nullHolder","Spyne","allowTargetAttr","addNoopener","isRichtext","domPurifyConfig","RETURN_TRUSTED_TYPE","customElementHandling","sanitizeWithPolicy","relParts","relSet","Set","trustedTypes","createPolicy","createHTML","toEscape","sanitizeHTMLConfigure"],"mappings":"+tCAGO,MAAMA,GACX,WAAAC,GASEC,KAAKC,0BAA4BH,GAA0BG,0BAA0BC,KAAKF,KAC3F,CAED,gCAAOC,CAA0BE,GA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BAAkBhM,EAAU,CACpE,uBAAAwM,CAAwBnC,EAAQ,CAAE,GAAIxoB,KAAKmqB,kBAAkB3B,EAAQ,CACrE,oBAAAoC,CAAqBzH,GAAYnjB,KAAKmqB,kBAAkBhH,EAAW,CACnE,gBAAA0H,CAAiB/nB,EAAO,CAAE,GAAI9C,KAAKmqB,kBAAkBrnB,EAAO,CAI5D,SAAA8lB,GACE,MAAMkC,EAAalP,KACnB5b,KAAKoc,GAAK0O,EAAW1O,GAAGlc,KAAKF,KAC9B,CAED,gBAAAuoB,CAAiBrM,GACf,OAAOhQ,GAAKlM,KAAK+qB,gBAAiB7O,EACnC,CAED,mBAAI6O,GACF,MAAO,CACL,SACA,iBACA,YACA,SACA,QACA,QACA,MACA,QACA,iBACA,eACA,YACA,WACA,UACA,SACA,WACA,YACA,UACA,UACA,OACA,QACA,OACA,WACA,QACA,OACA,UACA,UACA,kBACA,cACA,WACA,SACA,cACA,MACA,UACA,WACA,WACA,UACA,QACA,MACA,UACA,WACA,WACA,YACA,WACA,UACA,MACA,OACA,aACA,UACA,SACA,SACA,OACA,OACA,WACA,aACA,OACA,KACA,aACA,YACA,QACA,WACA,UACA,OACA,QACA,OACA,WACA,WACA,OACA,OACA,MACA,WACA,MACA,YACA,YACA,QACA,SACA,MACA,WACA,QACA,OACA,aACA,OACA,UACA,UACA,OACA,cACA,SACA,UACA,aACA,WACA,iBACA,MACA,WACA,WACA,OACA,UACA,UACA,QACA,SACA,WACA,QACA,OACA,QACA,OACA,OACA,aACA,MACA,SACA,UACA,SACA,QACA,OACA,QACA,UACA,WACA,SACA,QACA,YACA,OACA,SACA,QACA,QACA,OAEH,ECrUH,MAAMC,GAAwB,CAACC,GAAW,EAAO5oB,EAAI,EAAGuP,EAAI,OAAQsZ,GAAgB,IAG3E,IAFmC,IAAlBA,EAAyB,aAAe,yBAEhB7oB,MAAMuP,gBADzB,IAAbqZ,EAAoB,EAAI,KCFnC,SAASE,GAAWvkB,GACvB,MAAwB,mBAAVA,C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yCACA,iCACA,+BACA,wBACA,6BACA,uBACA,+BACA,4BACA,gCACA,gCACA,qCACA,wBACA,2BACA,6BACA,6BACA,4BACA,6BACA,wBACA,kCACA,2BACA,uBACA,4BACA,yBACA,yCACA,yBACA,yBACA,2BACA,4BACA,4BACA,oCACA,mCACA,oCACA,uCACA,wCACA,iCACA,8BACA,gCACA,qCACA,8BACA,gCACA,qCACA,4CACA,2CACA,yBACA,sCACA,2BACA,2BACA,2BACA,yBACA,kCACA,yCACA,wBACA,8BACA,kCACA,2BACA,6BACA,sCACA,wBACA,sCACA,2BACA,gCACA,6BACA,8BACA,8BACA,6BACA,4BACA,6BACA,2BACA,wBACA,qCACA,2BACA,qCACA,2BACA,0BACA,wBACA,qCACA,4BACA,4BACA,yBACA,yBACA,qCACA,uCACA,wBACA,2BACA,iCACA,+BACA,gCACA,gCACA,qCACA,oCACA,+BACA,8BACA,+BACA,6BACA,4BACA,4BACA,wBACA,0CACA,8BACA,oCACA,oCACA,+BACA,gCACA,+BACA,yBACA,0BACA,4CACA,0BACA,0BACA,0BACA,0BACA,0BACA,2BACA,0BACA,+CACA,6BACA,mCACA,+BACA,yCACA,wCACA,wCACA,8BACA,4BACA,8BACA,6BACA,+BACA,2BACA,8BACA,gCACA,2BACA,yBACA,+BACA,2BACA,0BACA,2BACA,2BACA,2BACA,8BACA,0BACA,8BACA,+BACA,4BACA,6BACA,8BACA,yBACA,oCACA,iCACA,iCACA,mCACA,sCACA,0BACA,0BACA,iCACA,iCACA,oCACA,iCACA,gCACA,qCACA,iCACA,oCACA,uCACA,uCACA,kCACA,8CACA,gDACA,0CACA,2BACA,6CACA,oCACA,wCACA,2CACA,wCACA,sCACA,6CACA,yBAEH,CAED,aAAA0J,GACE,MAAMC,EAAS3oC,EAAWstB,UAAU7wB,SAAU,SAE9ClV,KAAKqhD,YAAcD,EAAOE,QAAQ1vC,GAAKA,EAAE2vC,SACtC1mC,WACAzR,OAHgBwI,GAAK5R,KAAKkhD,WAAWpvC,QAA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AK,KAClD,OAbCgd,EAAKE,gBAAgB,eARrBF,EAAKE,gBAAgB,YAyB3BuB,GAAgBuwC,GAED,IAAXryC,GAAmB1e,OAAOmxD,aAC5B,IACE,MAAMn0C,EAAShd,OAAOmxD,aAAaC,aAAa,UAAW,CACzDC,WAAaC,GAAaP,EAAmBO,KAG/C9wC,GAAiBlC,GAAStB,EAAOq0C,WAAW/yC,IAE9B,IAAV1M,GACFhB,QAAQC,IAAI,0JAEf,CAAC,MAAOoY,GACPvO,GAAU,oHAAqHuO,EAChI,CAGHlO,IAAe,G+FoBbw2C,CAAsBzsD,GAAmBC,QACzC0Z,GAAsB3Z,GAAmBC,OAE1C,CAWD,mBAAO+M,GACL,OAAOlO,MAAMmO,KAAKpC,GAAUzN,IAAIrD,OACjC,CAOD,wBAAOuT,CAAkBpT,GACvB,OAAO2Q,GAAUyC,kBAAkBpT,EACpC,CASD,sBAAO8U,CAAgBk1B,GACrB,IAAuC,IAAnClkC,GAAmB6M,YAGrB,OAAOhC,GAAUs3C,eAAeje,GAFhCp4B,QAAQK,KAAK,iCAIhB"}
1
+ {"version":3,"file":"spyne.esm.js","sources":["../src/spyne/utils/spyne-utils-channel-route-url.js","../src/spyne/utils/spyne-utils-channel-route.js","../src/spyne/utils/spyne-plugins-methods.js","../src/spyne/utils/deep-merge.js","../src/spyne/utils/spyne-app-properties.js","../src/spyne/channels/channels-config.js","../src/spyne/utils/safe-clone.js","../src/spyne/channels/channel-payload-class.js","../src/spyne/utils/mixins/base-core-mixins.js","../src/spyne/utils/frp-tools.js","../src/spyne/utils/spyne-warn.js","../src/spyne/utils/sanitize-data.js","../src/spyne/utils/sanitize-html.js","../src/spyne/views/dom-element-template.js","../src/spyne/views/dom-element.js","../src/spyne/utils/viewstream-animations.js","../node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../node_modules/rxjs/dist/esm5/internal/util/lift.js","../node_modules/tslib/tslib.es6.mjs","../node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js","../node_modules/rxjs/dist/esm5/internal/util/isPromise.js","../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../node_modules/rxjs/dist/esm5/internal/Subscription.js","../node_modules/rxjs/dist/esm5/internal/config.js","../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../node_modules/rxjs/dist/esm5/internal/util/noop.js","../node_modules/rxjs/dist/esm5/internal/NotificationFactories.js","../node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../node_modules/rxjs/dist/esm5/internal/Subscriber.js","../node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../node_modules/rxjs/dist/esm5/internal/util/identity.js","../node_modules/rxjs/dist/esm5/internal/util/pipe.js","../node_modules/rxjs/dist/esm5/internal/Observable.js","../node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js","../node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js","../node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js","../node_modules/rxjs/dist/esm5/internal/symbol/iterator.js","../node_modules/rxjs/dist/esm5/internal/util/isIterable.js","../node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js","../node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js","../node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../node_modules/rxjs/dist/esm5/internal/scheduler/Action.js","../node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js","../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js","../node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","../node_modules/rxjs/dist/esm5/internal/Scheduler.js","../node_modules/rxjs/dist/esm5/internal/scheduler/async.js","../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js","../node_modules/rxjs/dist/esm5/internal/observable/timer.js","../node_modules/rxjs/dist/esm5/internal/util/isScheduler.js","../node_modules/rxjs/dist/esm5/internal/util/isDate.js","../node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js","../node_modules/rxjs/dist/esm5/internal/operators/catchError.js","../node_modules/rxjs/dist/esm5/internal/operators/observeOn.js","../node_modules/rxjs/dist/esm5/internal/operators/subscribeOn.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js","../node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js","../node_modules/rxjs/dist/esm5/internal/operators/map.js","../node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js","../node_modules/rxjs/dist/esm5/internal/observable/combineLatest.js","../node_modules/rxjs/dist/esm5/internal/observable/from.js","../node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js","../node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js","../node_modules/rxjs/dist/esm5/internal/util/argsOrArgArray.js","../node_modules/rxjs/dist/esm5/internal/operators/combineLatest.js","../node_modules/rxjs/dist/esm5/internal/util/args.js","../node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../node_modules/rxjs/dist/esm5/internal/Subject.js","../node_modules/rxjs/dist/esm5/internal/operators/debounceTime.js","../node_modules/rxjs/dist/esm5/internal/observable/empty.js","../node_modules/rxjs/dist/esm5/internal/operators/take.js","../node_modules/rxjs/dist/esm5/internal/operators/filter.js","../node_modules/rxjs/dist/esm5/internal/operators/finalize.js","../node_modules/rxjs/dist/esm5/internal/operators/share.js","../node_modules/rxjs/dist/esm5/internal/operators/takeWhile.js","../node_modules/rxjs/dist/esm5/internal/operators/tap.js","../node_modules/rxjs/dist/esm5/internal/operators/throttleTime.js","../node_modules/rxjs/dist/esm5/internal/operators/throttle.js","../src/spyne/utils/viewstream-observables.js","../src/spyne/views/view-stream-element.js","../src/spyne/utils/gc.js","../src/spyne/views/view-stream-payload.js","../src/spyne/views/view-stream-broadcaster.js","../src/spyne/utils/mixins/base-streams-mixins.js","../src/spyne/utils/channel-payload-filter.js","../src/spyne/views/view-stream-selector.js","../src/spyne/views/view-stream.js","../node_modules/rxjs/dist/esm5/internal/operators/skip.js","../src/spyne/utils/route-channel-updater.js","../src/spyne/channels/channel.js","../node_modules/rxjs/dist/esm5/internal/operators/combineLatestWith.js","../src/spyne/channels/spyne-channel-route.js","../src/spyne/channels/spyne-channel-ui.js","../src/spyne/utils/spyne-utils-channel-window.js","../src/spyne/channels/spyne-channel-window.js","../node_modules/rxjs/dist/esm5/internal/operators/skipWhile.js","../node_modules/rxjs/dist/esm5/internal/operators/buffer.js","../node_modules/rxjs/dist/esm5/internal/operators/bufferCount.js","../src/spyne/channels/spyne-channel-lifecycle.js","../src/spyne/channels/spyne-channel-ai.js","../src/spyne/channels/channel-proxy.js","../src/spyne/channels/channels-map.js","../src/spyne/utils/spyne-trait.js","../src/spyne/utils/channel-fetch-util.js","../src/spyne/channels/channel-fetch-class.js","../src/spyne/spyne-plugins.js","../src/spyne/spyne-app.js"],"sourcesContent":["import { isEmpty, head, values, compose, prop, complement, isNil, allPass, reduce, filter, equals, toPairs, replace, either, propEq, __, invert, path, zipObj, reject, keys, find, assoc, is, has, when, split, always, concat, join, flatten, map, ifElse, test, findLastIndex, last, defaultTo, fromPairs } from 'ramda'\nimport { SpyneAppProperties } from './spyne-app-properties.js'\n\nexport class SpyneUtilsChannelRouteUrl {\n constructor() {\n /**\n * @module SpyneUtilsChannelRouteUrl\n * @type internal\n *\n * @constructor\n * @desc\n * Internal url methods for the SpyneRouteChannel\n */\n this.checkIfObjIsNotEmptyOrNil = SpyneUtilsChannelRouteUrl.checkIfObjIsNotEmptyOrNil.bind(this)\n }\n\n static checkIfObjIsNotEmptyOrNil(obj) {\n const isNotEmpty = compose(complement(isEmpty), head, values)\n const isNotNil = compose(complement(isNil), head, values)\n const isNotNilAndIsNotEmpty = allPass([isNotEmpty, isNotNil])\n return isNotNilAndIsNotEmpty(obj)\n }\n\n static checkIfParamValueMatchesRegex(paramValue, routeObj) {\n const rejectParamKey = reject(equals('routeName'))\n const keysArr = compose(rejectParamKey, keys)\n const testForRegexMatch = str => test(new RegExp(str), paramValue)\n const checker = compose(find(testForRegexMatch), keysArr)\n const regexMatchStr = checker(routeObj)\n if (is(String, regexMatchStr)) {\n routeObj = assoc(paramValue, prop(regexMatchStr, routeObj), routeObj)\n }\n return routeObj\n }\n\n static formatStrAsWindowLocation(str) {\n const hash = str\n const search = str\n const pathname = str\n return { hash, search, pathname }\n }\n\n static getLocationStrByType(t, isHash = false, loc = window.location) {\n const type = isHash === true ? 'hash' : t\n\n const typeMap = {\n slash: 'pathname',\n query: 'search',\n hash: 'hash'\n }\n const propVal = typeMap[type]\n const str = prop(propVal, loc)\n const checkForSlashAndHash = /^(\\/)?(#)?(\\/)?(.*)$/\n // console.log(\"DATA LOC STR \",{str, loc, prop, type,isHash});\n return str.replace(checkForSlashAndHash, '$4')\n }\n\n static createRouteArrayFromParams(data, route, t = 'slash', paramsFromLoc) {\n const urlArr = []\n const loopThroughParam = (routeObj) => {\n const urlObj = {}\n const keyword = routeObj.routeName // PARAM FORM SPYNE CONFIG\n let paramValFromData = data[keyword] !== undefined ? data[keyword] : prop(keyword, paramsFromLoc) // PULL VALUE FOR THIS PARAM FROM DATA\n const paramValType = typeof (routeObj[paramValFromData])\n\n if (paramValType === 'string') {\n paramValFromData = routeObj[paramValFromData]\n } else if (paramValType === 'undefined') {\n routeObj = this.checkIfParamValueMatchesRegex(paramValFromData, routeObj)\n }\n\n urlObj[keyword] = paramValFromData\n\n if (this.checkIfObjIsNotEmptyOrNil(urlObj)) {\n urlArr.push(urlObj)\n }\n\n const isObject = is(Object, routeObj)\n const objectParamExists = has(paramValFromData, routeObj)\n const objectContainsRoute = has('routePath', routeObj)\n const recursivelyCallLoopBool = objectParamExists && isObject\n if (recursivelyCallLoopBool === true) {\n const newObj = routeObj[paramValFromData]\n if (has('routePath', newObj)) {\n loopThroughParam(newObj.routePath)\n }\n } else if (objectContainsRoute === true && paramValFromData !== undefined) {\n loopThroughParam(routeObj.routePath)\n }\n }\n\n loopThroughParam(route)\n\n return urlArr\n }\n\n static createSlashString(arr) {\n const arrClear = reject(isNil)\n const notUndefined = when(complement(isNil, __), join('/'))\n const stripRegex = replace(/^(\\^*)(.*|^\\$)(\\$)$/, '$2')\n const joiner = compose(stripRegex, notUndefined, arrClear, flatten, map(values))\n return joiner(arr)\n }\n\n static createQueryString(arr) {\n const arrClear = reject(isNil)\n\n const isNotNilAndIsNotEmpty = this.checkIfObjIsNotEmptyOrNil\n\n const createPair = compose(\n join('='),\n flatten,\n toPairs)\n\n const checkPair = ifElse(\n isNotNilAndIsNotEmpty,\n createPair,\n always(undefined)\n )\n\n const mapArrayOfPairs = map(checkPair)\n\n const checkIfStrIsEmpty = when(\n complement(isEmpty),\n concat('?'))\n\n const createQs = compose(\n checkIfStrIsEmpty,\n join('&'),\n arrClear,\n mapArrayOfPairs)\n\n return createQs(arr)\n }\n\n static checkPayloadForRegexOverrides(urlsArr, data, parseString = 'Value') {\n // CHECK IF PAYLOAD HAS ANY OVERRIDES\n const getPropValOverride = (key) => prop(`${key}${parseString}`, data)\n\n // GET ANY POSSIBLE VALUE USING THE CURRENT KEY\n const getOverrideVal = compose(getPropValOverride, head, keys)\n\n // MAP ALL OBJECT VALS TO TEST FOR OVERRIDES\n const mapUrlProps = (prop) => {\n const overrideVal = getOverrideVal(prop)\n\n // console.log(\"override val \",overrideVal, data);\n // if regex value is found\n if (overrideVal !== undefined) {\n return assoc(compose(head, keys)(prop), overrideVal, prop)\n }\n // identity\n return prop\n }\n\n return map(mapUrlProps, urlsArr)\n }\n\n static checkForRouteValWithMultipleVals(urlsArr) {\n // Define the internal method to extract the string before the pipe\n const getStringBeforePipe = (input) => {\n const match = input.match(/^[^|]*/)\n return match ? (match[0] === '^$' ? '' : match[0]) : input\n }\n\n const mapUrlArrObj = (obj) => {\n const pipeReducer = (acc, key) => {\n acc[key] = getStringBeforePipe(obj[key])\n return acc\n }\n\n if (typeof obj === 'object') {\n obj = Object.keys(obj).reduce(pipeReducer, {})\n }\n return obj\n }\n\n if (Array.isArray(urlsArr) === true) {\n return urlsArr.map(mapUrlArrObj)\n }\n\n return urlsArr\n }\n\n static checkForRouteValsPartMatch(urlsArr, data = {}) {\n /**\n * 1. Loop through urlsArr\n * 2. Loop through properties\n * 3. Apply matchGlobPattern to each property value and check for match with data object property\n * 4. Return the updated object with matched values, or keep the original pattern if no match\n */\n\n const matchGlobPattern = (str, globPattern) => {\n const globPatternMatch = (pattern, value) => {\n const escapedPattern = pattern\n .replace(/[-/\\\\^$+?.()|[\\]{}]/g, '\\\\$&') // Escape special characters\n .replace(/\\*/g, '[\\\\w\\\\d_-]*') // * should match any sequence of alphanumeric, underscores, or dashes\n\n const regexPattern = new RegExp(`^${escapedPattern}$`) // Match the full string\n return regexPattern.test(value)\n }\n\n // Split the globPattern by pipe (|)\n const patterns = globPattern.split('|')\n\n // Check if the string matches any of the patterns\n const hasMatch = patterns.some((pattern) => globPatternMatch(pattern, str))\n\n // Return the string if there's a match, otherwise return the glob pattern\n return hasMatch ? str : globPattern\n }\n\n // Function to check and replace matching properties\n const replaceMatchingProperty = (obj) => {\n const updatedObj = { ...obj } // Create a copy of the object to avoid mutation\n\n // Function to check each property and apply matchGlobPattern\n const checkAndReplaceProperty = (key) => {\n if (Object.prototype.hasOwnProperty.call(updatedObj, key) && data[key]) {\n updatedObj[key] = matchGlobPattern(data[key], updatedObj[key])\n }\n }\n\n // Loop through the properties of the object\n Object.keys(updatedObj).forEach(checkAndReplaceProperty)\n\n return updatedObj\n }\n\n // Loop through the array and replace matching properties\n return urlsArr.map(replaceMatchingProperty)\n }\n\n static convertParamsToRoute(data, r = SpyneAppProperties.config.channels.ROUTE, t, locStr) {\n const urlType = t !== undefined ? t : r.type\n const isHash = r.isHash\n const route = r.routes.routePath\n const locationStr = locStr !== undefined ? locStr : this.getLocationStrByType(urlType, isHash)\n const paramsFromCurrentLocation = this.convertRouteToParams(locationStr, r, urlType).routeData\n let urlArr = this.createRouteArrayFromParams(data, route, urlType, paramsFromCurrentLocation)\n\n urlArr = SpyneUtilsChannelRouteUrl.checkPayloadForRegexOverrides(urlArr, data)\n urlArr = SpyneUtilsChannelRouteUrl.checkForRouteValWithMultipleVals(urlArr)\n // THIS WILL MATCH EXACTLY THE PROPERTY ID, SO pageId=\"dashboard_1\" will return that instead of globPattern[0]\n // urlArr = SpyneUtilsChannelRouteUrl.checkForRouteValsPartMatch(urlArr, data)\n // console.log('PARAMS TO ROUTE ', { data, r, urlArr, locationStr, paramsFromCurrentLocation })\n\n // THIS CREATES A QUERY PATH STR\n if (urlType === 'query') {\n return this.createQueryString(urlArr)\n }\n\n return this.createSlashString(urlArr)\n }\n\n static findIndexOfMatchedStringOrRegex(mainStr, paramsArr) {\n const is404 = paramsArr.includes('.+')\n\n const reFn = (s) => {\n if (is404) {\n if (!s.startsWith('^')) {\n s = '^' + s\n }\n if (!s.endsWith('$')) {\n s = s + '$'\n }\n }\n\n return new RegExp(s)\n }\n\n const checkForEmpty = replace(/^$/, '^$')\n const createStrRegexTest = (str) => {\n return {\n str,\n re: reFn(str)\n }\n }\n\n const checkForEitherStrOrReMatch = either(\n propEq(mainStr, 'str'), compose(test(__, mainStr), prop('re'))\n )\n\n const findMatchIndex = compose(findLastIndex(equals(true)), map(checkForEitherStrOrReMatch), map(createStrRegexTest), map(checkForEmpty))\n\n return findMatchIndex(paramsArr)\n }\n\n static checkIfValueShouldMapToParam(obj, str, regexTokens) {\n //\n //\n // THIS IS A VERY IMPORTANT METHOD\n // IT COMPARES THE STRING TO BE MATCHED WITH THE ROUTE PATH OBJECT\n // AND IT WILL RETURN ONE OF THREE THINGS\n // 1. THE STRING ITSELF\n // 2. A MATCHING KEY FROM THE CURRENT OBJECT\n // 3. THE ROUTENAME\n //\n\n // GO THROUGH KEYS AND CHECK IF REGEX MATCHES\n\n // GO THROUGH ROUTE CONFIG TO FIGURE OUT IF VAL OR KEY SHOULD BE COMPARED\n // if the value is an object, choose the key of the route path to check against\n const getValCompareArr = compose(map(last), map(filter(is(String))), toPairs)\n\n // CREATE THE ARRAY OF EITHER VALS OR KEYS\n const paramsArr = getValCompareArr(obj)\n\n // RESULTS FROM PARAM CHECK\n // let paramIndex = checkForParamsMatch(paramsArr);\n\n const paramIndex = SpyneUtilsChannelRouteUrl.findIndexOfMatchedStringOrRegex(str, paramsArr)\n\n // DEFAULT VAL FOR STRING\n let paramStr = str\n\n // LEGACY METHOD -- TURN OFF\n // WHEN THERE IS A MATCH FROM THE CURRENT ROUTE PATH OBJECT\n if (paramIndex >= 0) {\n const param = paramsArr[paramIndex]\n const invertedObj = invert(obj)\n\n // PULL INVERTED OBJECT TO SEE IF STR MATCHES\n const getParamInverted = compose(head, defaultTo([]), prop(param))\n const paramInverted = getParamInverted(invertedObj)\n // spyne 11.0.1;\n const re = /^([-$\\w]*)$/\n const keyMatch = re.test(paramInverted)\n\n if (keyMatch === true && is(String, paramInverted) === true) {\n paramStr = paramInverted\n }\n }\n\n return paramStr\n }\n\n static createArrFromSlashStr(str) {\n const slashRe = /^([/])?(.*)$/\n return str.replace(slashRe, '$2').split('/')\n }\n\n static convertSlashRouteStrToParamsObj(topLevelRoute, str, regexTokens) {\n const routeValue = str\n const valuesArr = this.createArrFromSlashStr(str)\n const paths = []\n const routedValuesArr = []\n let latestObj = topLevelRoute\n const createParamsFromStr = (total, currentValue) => {\n const routeValueStr = this.checkIfValueShouldMapToParam(latestObj, currentValue, regexTokens)\n\n latestObj = this.checkIfParamValueMatchesRegex(currentValue, latestObj)\n const prevPathNotEqCurrentPath = (str) => str !== last(paths)\n\n const isEmptyOrNil = either(isEmpty, isNil)\n\n if (latestObj !== undefined && prevPathNotEqCurrentPath(latestObj.routeName) && isEmptyOrNil(routeValueStr) === false) {\n paths.push(latestObj.routeName)\n routedValuesArr.push(routeValueStr)\n }\n const strPath = [currentValue, 'routePath']\n const routeParamPath = ['routePath']\n const objectFromStr = path(strPath, latestObj)\n const objectFromRouteParam = path(routeParamPath, latestObj)\n\n if (objectFromStr !== undefined) {\n latestObj = objectFromStr\n } else if (objectFromRouteParam !== undefined) {\n latestObj = objectFromRouteParam\n }\n }\n\n reduce(createParamsFromStr, 0, valuesArr)\n const routeData = zipObj(paths, routedValuesArr)\n const pathInnermost = this.getLastArrVal(paths)\n return { paths, pathInnermost, routeData, routeValue }\n }\n\n static getLastArrVal(arr) {\n const getLastParam = (a) => last(a) !== undefined ? last(a) : ''\n return getLastParam(arr)\n }\n\n static createDefaultParamFromEmptyStr(topLevelRoute, str) {\n const obj = {}\n const keyword = topLevelRoute.routeName\n obj[keyword] = this.checkIfValueShouldMapToParam(topLevelRoute, str)\n return obj\n }\n\n static convertQueryStrToParams(topLevelRoute, str, regexTokens) {\n const queryRe = /^([?])?(.*)$/\n const routeValue = str\n const strArr = str.replace(queryRe, '$2')\n const convertToParams = compose(map(split('=')), split('&'))\n const paramsArr = convertToParams(strArr)\n let routeData = fromPairs(paramsArr)\n\n let paths = map(head, paramsArr)\n\n if (isEmpty(str) === true) {\n routeData = this.createDefaultParamFromEmptyStr(topLevelRoute, str, regexTokens)\n paths = keys(routeData)\n }\n const pathInnermost = this.getLastArrVal(paths)\n\n return { paths, pathInnermost, routeData, routeValue }\n }\n\n static convertRouteToParams(str, routeConfig, t) {\n const addSlash = (url) => url.replace(/\\/$|$/, '/')\n if (routeConfig === undefined) {\n return {}\n }\n const type = t !== undefined ? t : routeConfig.type\n const regexTokens = defaultTo({}, prop('regexTokens', routeConfig))\n const topLevelRoute = routeConfig.routes.routePath\n\n if (type === 'query') {\n return this.convertQueryStrToParams(topLevelRoute, str)\n }\n str = addSlash(str)\n\n return this.convertSlashRouteStrToParamsObj(topLevelRoute, str, regexTokens)\n }\n}\n","import { fromEventPattern } from 'rxjs'\nimport { last, flatten, clone, pick, prop, pickAll, path, equals, compose, keys, filter, propEq, uniq, map, __, chain, is, includes, fromPairs, reject, mergeDeepRight, mergeRight, test, toPairs, values } from 'ramda'\nimport { SpyneUtilsChannelRouteUrl } from './spyne-utils-channel-route-url.js'\n\nexport class SpyneUtilsChannelRoute {\n constructor() {\n /**\n * @module SpyneUtilsChannelRoute\n * @type internal\n *\n * @constructor\n * @desc\n * Internal utility methods for the SpyneRouteChannel\n *\n */\n this.createPopStateStream = SpyneUtilsChannelRoute.createPopStateStream.bind(this)\n }\n\n static createPopStateStream(subscribeFn) {\n const addHandler = function(handler) {\n window.onpopstate = handler\n }\n const removeHandler = function() {\n window.onpopstate = function() {}\n }\n const popupObs$ = fromEventPattern(addHandler, removeHandler)\n\n popupObs$.subscribe(subscribeFn)\n }\n\n static getLastArrVal(arr) {\n const getLastParam = (a) => last(a) !== undefined ? last(a) : ''\n return getLastParam(arr)\n }\n\n static compareRouteKeywords(obj = {}, arr) {\n const pickValues = (o, a) => a !== undefined ? pick(a, o) : o\n let obj1 = pickValues(obj, arr)\n return {\n pickValues,\n compare: (obj = {}, arr) => {\n const obj2 = pickValues(obj, arr)\n const compareProps = p => {\n const p1 = prop(p, obj1)\n const p2 = prop(p, obj2)\n const same = equals(p1, p2)\n const previousExists = p1 !== undefined\n const nextExists = p2 !== undefined\n const changed = !same\n const added = previousExists === false && nextExists === true\n const removed = previousExists === true && nextExists === false\n // console.log(\"P: \",p,{same, previousExists, nextExists});\n const obj = {}\n obj[p] = { same, changed, added, removed, previousExists, nextExists }\n return obj\n }\n\n const createPred = p => compose(keys, filter(propEq(true, p)))\n\n const getPropsState = compose(map(compareProps), uniq, chain(keys))([obj1, obj2])\n const pathsChanged = chain(createPred('changed'), getPropsState)\n const pathsAdded = chain(createPred('added'), getPropsState)\n const pathsRemoved = chain(createPred('removed'), getPropsState)\n obj1 = obj2\n return { pathsAdded, pathsRemoved, pathsChanged }\n },\n\n getComparer: () => obj1\n\n }\n }\n\n static getRouteArrData(routeArr, paramsArr) {\n const paths = filter(includes(__, routeArr), paramsArr)\n const pathInnermost = SpyneUtilsChannelRoute.getLastArrVal(paths)\n // console.log('arr and routeName ',{paths, pathInnermost});\n return { paths, pathInnermost }\n }\n\n static flattenConfigObject(obj) {\n const go = (obj_) => chain(([k, v]) => {\n if (typeof v === 'object' && v !== null && !Array.isArray(v)) {\n return map(([k_, v_]) => [`${k}.${k_}`, v_], go(v))\n } else {\n return [[k, v]]\n }\n }, toPairs(obj_))\n\n // console.log(\"FLATTEN: \", values(fromPairs(go(obj))));\n return values(fromPairs(go(obj)))\n }\n\n static addRouteDatasets(channelRouteObj) {\n // channelRouteObj.type='query';\n\n function removeUndefined(arr) {\n return arr.map(obj => {\n for (const key in obj) {\n if (key === undefined || key === 'undefined' || obj[key] === undefined) {\n delete obj[key]\n } else if (obj[key] && typeof obj[key] === 'object' && !Array.isArray(obj[key])) {\n // recurse if nested object\n obj[key] = removeUndefined([obj[key]])[0]\n }\n }\n return obj\n })\n }\n\n const { type, isHash } = channelRouteObj\n\n // create href and check to see if need to convert to hash href links\n const getHREF = (obj) => {\n const santizeHREF = str => {\n const hrefRE = /^(.*\\/)([\\w-]*\\/?)(.*)$/gm\n // const hrefRE = /^(.*\\/)([\\w-]*)(.*)$/gm;\n str = str.replace(hrefRE, '$1$2')\n // str = String(str).replace('^$', \"\");\n return str\n }\n\n const headStrVal = type === 'query' ? '' : isHash === true ? '#' : '/'\n const hrefStr = SpyneUtilsChannelRouteUrl.convertParamsToRoute(obj, channelRouteObj)\n return headStrVal + santizeHREF(hrefStr)\n }\n\n // remove special chars from href\n const sanitizeStr = (str) => String(str).replace(/([^A-Za-z0-9-_])/g, '')\n\n // test whether to use key or val\n const isValidStrRE = /^([A-Za-z0-9_-])+$/m\n\n const createInitialValFn = (accMain = [], routePathObj, objAcc = {}) => {\n let { routeName } = routePathObj\n\n const propsReducer = (acc, arrPair) => {\n const [key, val] = arrPair\n const isObject = is(Object, val)\n\n const createTitle = (str) => String(str).replace(/([-_])/g, ' ').toUpperCase()\n\n const getLinkText = str => test(isValidStrRE, str) ? createTitle(str) : key\n\n if (key === 'routeName' || key === '404') {\n return acc\n }\n\n routeName = routeName || prop('routeName', val)\n // console.log(\"THE KEY IS \",{key,val,routeName})\n\n let o = clone(objAcc)\n o[routeName] = sanitizeStr(key)\n\n if (isObject === true) {\n if (keys(o).length === 1) {\n const subRouteName = path(['routePath', 'routeName'], val)\n if (subRouteName) {\n const oBase = clone(o)\n oBase[subRouteName] = ''\n oBase.navLevel = keys(objAcc).length\n oBase.title = getLinkText(key)\n oBase.href = getHREF(oBase)\n acc.push(oBase)\n }\n }\n o = createInitialValFn(accMain, val, o)\n } else {\n o.title = getLinkText(key)\n o.href = getHREF(o)\n }\n o.navLevel = keys(objAcc).length\n acc.push(o)\n return acc\n }\n\n return toPairs(routePathObj).reduce(propsReducer, [])\n }\n\n const reducedArr = createInitialValFn([], channelRouteObj.routes)\n let routeDatasetsArr = flatten(reducedArr)\n routeDatasetsArr = removeUndefined(routeDatasetsArr)\n\n const getNavProps = (datasetsArr) => {\n const exclude = reject(includes(__, ['title', 'href', 'navLevel', 'undefined']))\n const getMainKeys = compose(uniq, exclude, flatten, map(keys))\n return getMainKeys(datasetsArr)\n }\n const routeNamesArr = getNavProps(routeDatasetsArr)\n\n return { routeDatasetsArr, routeNamesArr }\n }\n\n static conformRouteObject(channelRouteObj = {}, add404Props = false) {\n const channelsRoutePath = path(['channels', 'ROUTE'], channelRouteObj)\n let { add404s } = channelsRoutePath !== undefined ? channelsRoutePath : channelRouteObj\n add404s = add404s || add404Props\n const parseRoutePath = (a) => {\n const val = a[1]\n const isArr = is(Array, val)\n if (val === '') {\n a[1] = '^$'\n } else if (isArr) {\n a[1] = val.join('|')\n }\n return a\n }\n\n const transduceConfig = (arr) => {\n const [key, val] = arr\n const obj404 = add404s ? { 404: '.+' } : {}\n const isObj = is(Object, val)\n const isArr = is(Array, val)\n const iterObj = isObj === true && isArr === false\n const isRoutePath = key === 'routePath'\n if (iterObj) {\n arr[1] = configMapperFn(arr[1])\n if (isRoutePath) {\n arr[1] = compose(mergeDeepRight(obj404), fromPairs, map(parseRoutePath), toPairs)(arr[1])\n }\n }\n return arr\n }\n\n const configMapperFn = compose(fromPairs, map(transduceConfig), toPairs)\n\n if (channelsRoutePath !== undefined) {\n channelRouteObj.channels.ROUTE = configMapperFn(channelRouteObj.channels.ROUTE)\n const extraRouteData = SpyneUtilsChannelRoute.addRouteDatasets(channelRouteObj.channels.ROUTE)\n channelRouteObj.channels.ROUTE = mergeRight(channelRouteObj.channels.ROUTE, extraRouteData)\n return channelRouteObj\n }\n\n return configMapperFn(channelRouteObj)\n }\n\n static getLocationData() {\n const locationParamsArr = [\n 'href',\n 'origin',\n 'protocol',\n 'host',\n 'hostname',\n 'port',\n 'pathname',\n 'search',\n 'hash']\n return pickAll(locationParamsArr, window.location)\n }\n}\n","import { allPass, compose, is, keys, not, prop } from 'ramda'\n\nconst _pluginMethodsObj = Object.create({})\n\nconst isNotArr = compose(not, is(Array))\n// const isNotEmpty = compose(not, isEmpty)\n// const isNonEmptyStr = allPass([is(String), isNotEmpty])\n// const isNonEmptyArr = allPass([is(Array), isNotEmpty])\nconst isObjectFn = compose(allPass([isNotArr, is(Object)]))\n// const isNonEmptyObjectFn = compose(allPass([isNotEmpty, isNotArr, is(Object)]))\n\nexport class SpynePluginsMethods {\n constructor() {\n _pluginMethodsObj.foo = () => console.log('used for testing purposes.')\n }\n\n addMethod(key, fn, test = false) {\n if (Object.prototype.hasOwnProperty.call(_pluginMethodsObj, key) === true) {\n const warnStr = `Spyne Warning: the method name, ${key}, already exists.`\n if (test) {\n return warnStr\n }\n console.warn(warnStr)\n } else {\n _pluginMethodsObj[key] = fn\n }\n }\n\n addMethods(methodsObj = {}, test = false) {\n let warnStr\n\n const isObj = isObjectFn(methodsObj)\n\n if (isObj === false) {\n warnStr = `Spyne Warning: the pluginMethods property, ${JSON.stringify(methodsObj)} needs to be an object.`\n if (test) {\n return warnStr\n }\n console.warn(warnStr)\n return\n }\n\n const checkEachKeyForValidMethod = (keyStr) => {\n const methodVal = prop(keyStr, methodsObj)\n\n const isFunction = typeof (methodVal) === 'function'\n\n if (isFunction) {\n this.addMethod(keyStr, methodVal, test)\n } else {\n warnStr = `the value for ${keyStr} is not a valid function.`\n if (test) {\n return warnStr\n } else {\n console.warn(warnStr)\n }\n }\n }\n\n const methodKeys = keys(methodsObj)\n\n return methodKeys.map(checkEachKeyForValidMethod).join(',')\n }\n\n checkIfMethodExists(key) {\n\n }\n\n get pluginMethodsObj() {\n return _pluginMethodsObj\n }\n}\n","function isMergeableObject(val) {\n const nonNullObject = val && typeof val === 'object'\n return nonNullObject && Object.prototype.toString.call(val) !== '[object RegExp]' && Object.prototype.toString.call(val) !== '[object Date]'\n}\n\nfunction emptyTarget(val) {\n return Array.isArray(val) ? [] : {}\n}\n\nfunction cloneIfNecessary(value, optionsArgument) {\n const clone = optionsArgument && optionsArgument.clone === true\n return (clone && isMergeableObject(value))\n ? deepMerge(emptyTarget(value),\n value, optionsArgument)\n : value\n}\n\nfunction defaultArrayMerge(target, source, optionsArgument) {\n const destination = target.slice()\n source.forEach(function(e, i) {\n if (typeof destination[i] === 'undefined') {\n destination[i] = cloneIfNecessary(e, optionsArgument)\n } else if (isMergeableObject(e)) {\n destination[i] = deepMerge(target[i], e, optionsArgument)\n } else if (target.indexOf(e) === -1) {\n destination.push(cloneIfNecessary(e, optionsArgument))\n }\n })\n return destination\n}\n\nfunction mergeObject(target, source, optionsArgument) {\n const destination = {}\n if (isMergeableObject(target)) {\n Object.keys(target).forEach(function(key) {\n destination[key] = cloneIfNecessary(target[key], optionsArgument)\n })\n }\n Object.keys(source).forEach(function(key) {\n if (!isMergeableObject(source[key]) || !target[key]) {\n destination[key] = cloneIfNecessary(source[key], optionsArgument)\n } else {\n destination[key] = deepMerge(target[key], source[key], optionsArgument)\n }\n })\n return destination\n}\n\nfunction deepMerge(target, source, optionsArgument) {\n const array = Array.isArray(source)\n const options = optionsArgument || { arrayMerge: defaultArrayMerge }\n const arrayMerge = options.arrayMerge || defaultArrayMerge\n\n if (array) {\n return Array.isArray(target)\n ? arrayMerge(target, source, optionsArgument)\n : cloneIfNecessary(source, optionsArgument)\n } else {\n return mergeObject(target, source, optionsArgument)\n }\n}\n\ndeepMerge.all = function deepmergeAll(array, optionsArgument) {\n if (!Array.isArray(array) || array.length < 2) {\n throw new Error(\n 'first argument should be an array with at least two elements')\n }\n\n // we are sure there are at least 2 values, so it is safe to have no initial value\n return array.reduce(function(prev, next) {\n return deepMerge(prev, next, optionsArgument)\n })\n}\n\nexport { deepMerge }\n","import { SpyneUtilsChannelRoute } from './spyne-utils-channel-route.js'\nimport { SpyneUtilsChannelRouteUrl } from './spyne-utils-channel-route-url.js'\nimport { SpynePluginsMethods } from './spyne-plugins-methods.js'\nimport { deepMerge } from './deep-merge.js'\n\nlet _config\nlet _channels\nlet _channelsMap\nlet _initialized\nlet _debug = true\nlet _enableCMSProxies = false\nlet _cmsRehydrator\nlet _cmsLineageWarner\nconst _excludeChannelsFromConsole = []\n/* eslint-disable */\nlet _linksData\nlet _navLinks\nlet _IMG_PATH\nconst _doNotTrackChannelsArr = []\nconst _proxiesMap = new Map()\n\nfunction random6Chars() {\n // For simplicity: slice(2, 8) gets 6 random chars from the substring\n return Math.random().toString(36).slice(2, 8);\n}\n\nconst _spynePluginMethods = new SpynePluginsMethods()\n\nclass SpyneAppPropertiesClass {\n constructor() {\n _initialized = false\n }\n\n get channelsMap() {\n return _channelsMap\n }\n\n get initialized() {\n return _initialized\n }\n\n get config() {\n return _config\n }\n\n get debug() {\n return _debug\n }\n\n /**\n * The application's sanitization mode, set via config.mode in SpyneApp.init.\n * 'app' (default) is the strict production posture; 'richtext' (aliases:\n * 'authoring', 'development') is the permissive posture for CMS and\n * authoring tools.\n */\n get mode() {\n return _config?.mode !== undefined ? _config.mode : 'app'\n }\n\n /**\n * This is mostly used for debugging purposes\n *\n * @example\n * TITLE['<h4>Listing the registereed Channels in the browser console</h4>']\n * SpyneApp.listChannels();\n *\n * @returns A list of all registered channels\n */\n static listChannels() {\n return Array.from(_channels.map.keys())\n }\n\n initialize(defaultConfig = {}, config = {}, channelsMap, routeUtils) {\n _channels = channelsMap\n _config = deepMerge(defaultConfig, config)\n // console.log(\"config is \", { defaultConfig,config });\n if (_config.channels && _config.channels.ROUTE) {\n // _config = SpyneUtilsChannelRoute.conformRouteObject(_config)\n _config = routeUtils.conformRouteObject(_config)\n }\n _IMG_PATH = _config?.IMG_PATH\n _debug = _config.debug !== undefined ? _config.debug : _debug\n this.getChannelActions = _channels.getChannelActions.bind(_channels)\n this.listRegisteredChannels = _channels.listRegisteredChannels.bind(_channels)\n _initialized = true\n this._initialized = _initialized\n this.setChannelsMap()\n if (config?.baseHref) {\n this.setHeadBaseHref(config.baseHref)\n }\n return _config\n }\n\n setHeadBaseHref(str) {\n // Create a new base element\n const baseTag = document.createElement('base')\n // Set the href attribute to the desired base URL\n baseTag.href = str // You can set this to any base URL\n // Append the base element to the head section of the document\n document.head.appendChild(baseTag)\n }\n\n conformRouteConfig(add404Props = false) {\n /**\n * THIS METHOD IS PRIMARILY USED FOR SPA GEN SITE GENERATION\n */\n\n // eslint-disable-next-line no-undef\n _config = SpyneUtilsChannelRoute.conformRouteObject(_config, add404Props)\n }\n\n setChannelsMap() {\n const getStream = _channels.getStream.bind(_channels)\n const testStream = _channels.testStream.bind(_channels)\n const getProxySubject = _channels.getProxySubject.bind(_channels)\n\n _channelsMap = { getStream, testStream, getProxySubject }\n }\n\n// ──────────────────────────────────────────────────────────────────────────\n// FIXED: durable setProp/getProp + isolated ephemeral (read-once) tier\n//\n// Contract after fix:\n// setProp(key, val) → durable. Persists for the app lifespan.\n// Returns val.\n// setProp(key, val, true) → ephemeral. Read-once via getProp. Returns val.\n// createTempProp(val) → ephemeral with generated key. Returns the key.\n// getProp(key) → returns durable value if present;\n// otherwise returns ephemeral value ONCE,\n// then deletes it. The two tiers cannot\n// shadow each other.\n// ──────────────────────────────────────────────────────────────────────────\n\n setProp(key, val, isTemp = false) {\n if (isTemp) {\n _config.ephemeralProps[key] = val;\n } else {\n _config.tmpProps[key] = val;\n }\n return val; // FIX 2: both tiers return the stored value\n }\n\n getProp(key) {\n // FIX 1+3: durable tier resolves FIRST and independently. A durable value\n // can never be shadowed or consumed by a same-named ephemeral key.\n if (_config?.tmpProps && Object.prototype.hasOwnProperty.call(_config.tmpProps, key)) {\n return _config.tmpProps[key];\n }\n // Ephemeral tier: read-once. Only reached when no durable value exists.\n if (_config?.ephemeralProps && Object.prototype.hasOwnProperty.call(_config.ephemeralProps, key)) {\n const tempVal = _config.ephemeralProps[key];\n delete _config.ephemeralProps[key];\n return tempVal;\n }\n return undefined;\n }\n\n createTempProp(value) {\n const key = random6Chars();\n this.setProp(key, value, true); // isTemp = true\n return key; // returns key (correct — caller needs it to read back)\n }\n\n\n setChannelConfig(channelName, config) {\n _config.channels[channelName] = config\n return _config.channels[channelName]\n }\n\n /**\n * This method is useful to check in the console or in the code what actions are available to be listened to.\n * @param {String} channelName\n * @returns {Array} An array of Actions that can be listened to\n */\n /* getChannelActions(channelName) {\n return _channels.getChannelActions(channelName);\n } */\n\n getChannelConfig(channelName, config = _config) {\n if (channelName === 'CHANNEL_ROUTE') {\n channelName = 'ROUTE'\n } else if (channelName === 'CHANNEL_WINDOW') {\n channelName = 'WINDOW'\n }\n\n if (config === undefined || _config.channels === undefined) {\n console.warn('Spyne warning: Spyne config object is empty!')\n return\n }\n\n const channelConfig = _config.channels[channelName]\n\n if (channelConfig === undefined) {\n console.warn(`Spyne warning: Spyne configuration for channel, ${channelName} is empty!`)\n return\n }\n\n return channelConfig\n }\n\n registerChannel() {\n\n }\n\n addPluginConfig(pluginName, pluginConfig = {}) {\n if (_config.plugins === undefined) {\n _config.plugins = {}\n }\n this.addPluginMethods(pluginConfig.pluginMethods)\n\n _config.plugins[pluginName] = pluginConfig\n }\n\n getPluginsMethodObj(pluginMethodsObj) {\n if (pluginMethodsObj) {\n this.addPluginMethods(pluginMethodsObj)\n }\n\n return _spynePluginMethods.pluginMethodsObj\n }\n\n addPluginMethods(pluginMethods) {\n if (pluginMethods) {\n _spynePluginMethods.addMethods(pluginMethods)\n }\n }\n\n doNotTrackChannel(channelName) {\n _doNotTrackChannelsArr.push(channelName)\n }\n\n getUntrackedChannelsList() {\n return _doNotTrackChannelsArr\n }\n\n registerProxyReviver(name, method) {\n _proxiesMap.set(name, method)\n // console.log(\"REGISTERD PROXY REVIVER\",_proxiesMap, _proxiesMap.get(name));\n }\n\n // This is the new method you add\n registerPlugin(pluginInstance) {\n if (!this._initialized) {\n console.warn('SpyneApp is not initialized yet. Plugin will not be fully registered.')\n }\n // console.log(\"INSTANCE \",this, pluginInstance)\n\n pluginInstance.register(this)\n }\n\n getProxyReviver(proxyName) {\n return _proxiesMap.get(proxyName)\n }\n\n /**\n * Registers the CMS re-hydration hook consulted by DomElementTemplate when\n * it receives plain (unproxied) data while CMS proxies are enabled. The\n * hook receives the template data and returns either revived proxy data\n * for that content or undefined to decline. Implementations must be cheap\n * for non-CMS data — ideally a single own-property read before bailing.\n */\n registerCmsRehydrator(method) {\n _cmsRehydrator = method\n }\n\n get rehydrateCmsData() {\n return _cmsRehydrator\n }\n\n /**\n * Registers the debug-mode hook DomElementTemplate calls when data renders\n * unproxied while CMS proxies are enabled and re-hydration declined —\n * the lineage reporter that turns silent proxy strips into warnings.\n */\n registerCmsLineageWarner(method) {\n _cmsLineageWarner = method\n }\n\n get warnUnproxiedCmsData() {\n return _cmsLineageWarner\n }\n\n getPluginConfigByPluginName(pluginName) {\n return _config.plugins[pluginName]\n }\n\n get IMG_PATH() {\n return _IMG_PATH\n }\n\n get excludeChannelsFromConsole() {\n return _excludeChannelsFromConsole\n }\n\n // Setter for _excludeChannelsFromConsole\n set excludeChannelsFromConsole(value) {\n if (typeof value === 'string') {\n // Push a single string into the array if not already present\n if (!_excludeChannelsFromConsole.includes(value)) {\n _excludeChannelsFromConsole.push(value)\n }\n } else if (Array.isArray(value)) {\n // Merge an array into the existing array, avoiding duplicates\n value.forEach(item => {\n if (typeof item === 'string' && !_excludeChannelsFromConsole.includes(item)) {\n _excludeChannelsFromConsole.push(item)\n }\n })\n } else {\n console.warn('Invalid value provided to excludeChannelsFromConsole. Only strings or arrays are allowed.')\n }\n }\n\n get linksData() {\n console.warn('get links data in SpyneAppProperties is deprecated, use navLinks')\n return _navLinks\n }\n\n set linksData(arr) {\n console.warn('set links data in SpyneAppProperties is deprecated, use navLinks')\n }\n\n get navLinks() {\n return _navLinks\n }\n\n set navLinks(arr) {\n _navLinks = arr\n }\n\n get enableCMSProxies(){\n return _enableCMSProxies\n }\n\n getHrefFromData(routeProps={}){\n\n return SpyneUtilsChannelRouteUrl.convertParamsToRoute(routeProps);\n\n }\n\n set enableCMSProxies(bool=true){\n _enableCMSProxies = Boolean(bool);\n }\n\n setCMSProxyMethod(fn){\n this.enableCMSProxies = true;\n this.formatTemplateForProxyData = fn;\n\n }\n\n tempGetChannelsInstance() {\n\n }\n\n tempGetConfig() {\n\n }\n}\n\nexport const SpyneAppProperties = new SpyneAppPropertiesClass()\n","import { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { compose, path, is } from 'ramda'\nimport { Observable, Subject } from 'rxjs'\n\n// console.log('channels config loaded ',R,Rx);\nconst registeredStreamNames = () => ({\n includes: () => SpyneAppProperties.initialized === true ? SpyneAppProperties.listRegisteredChannels() : ['CHANNEL_ROUTE', 'CHANNEL_UI', 'CHANNEL_WINDOW', 'DISPATCHER']\n\n})\n\n// getGlobalObj().channelsListArr;\nconst registeredSteps = ['LOAD', 'RENDER', 'MOUNT', 'UNMOUNT', 'DISPOSE', 'GARBAGE_COLLECT', 'UPDATE']\nconst registeredLifeStreamTypes = ['parent', 'self', 'child', 'children', 'view']\nconst registeredStreamTypes = ['Observable', 'BehaviorSubject', 'Subject', 'Observer', 'Subscriber', 'FromEventObservable']\nconst registeredActions = ['subscribe', 'combineLatest']\nconst getRxType = (obs) => obs().constructor.name\n// let getObservableType = (obs) => obs.constructor.name;\nconst confirmObservable = (obs) => obs.subscribe !== undefined\n// let pullMainRoute = (str) => str.replace(/^(\\/?)(.*)(\\/)(.*)/g, '$2');\nlet baseValidations = []; let viewInfoValidations = []; let uiValidations = []\nlet lifestreamValidations = []; let stepValidations = []; let stepDisposeValidations = []; let stepUpdateValidations = []\nlet routeValidations = []; let StreamsConfig = []\n\nif (compose !== undefined && Observable !== undefined) {\n// ===========================================================================\n // ALL VALIDATIONS ADD THE BASE VALIDATIONS THROUGH CONCATENATION\n // ===========================================================================\n baseValidations = [\n {\n error: `need to match a valid name within ${registeredStreamTypes}`,\n predicate: payload => registeredStreamNames().includes(payload.name)\n },\n\n {\n error: 'param \\'observable\\' must contain a valid Observable',\n // predicate: payload => registeredStreamTypes.includes(getObservableType(payload.observable))\n predicate: payload => confirmObservable(payload.observable)\n },\n {\n error: 'param action must be a registered action',\n predicate: payload => registeredActions.includes(payload.action)\n }\n\n ]\n // ===========================================================================\n // THESE VALIDATIONS ARE CONCATENATED WHEN THE OBSERVABLE REFERS TO A VIEW\n // ===========================================================================\n viewInfoValidations = [\n {\n error: 'needs vsid number in srcElement',\n predicate: compose(is(String), path(['data', 'srcElement', 'vsid']))\n },\n {\n error: 'needs a id in srcElement',\n predicate: compose(is(String),\n path(['data', 'srcElement', 'id']))\n }\n ]\n\n // ===========================================================================\n // NO SPECIFIC UI VALIDATIONS AT THIS TIME -- IT JUST ADD OTHERS\n // ===========================================================================\n uiValidations = function() {\n const uiValidations = []\n return uiValidations.concat(baseValidations).concat(viewInfoValidations)\n }\n // ===========================================================================\n // NO SPECIFIC LIFESTREAM VALIDATIONS AT THIS TIME -- IT JUST ADD OTHERS\n const lifeStreamValidations = [\n\n {\n error: `need to match a valid name within ${registeredStreamTypes}`,\n predicate: payload => registeredStreamNames().includes(payload.name)\n },\n\n {\n error: `needs one of the following step strings: ${registeredSteps}`,\n predicate: payload => registeredSteps.includes(payload.STEP)\n },\n {\n error: `type needs to one of the following: ${registeredLifeStreamTypes}`,\n predicate: payload => registeredLifeStreamTypes.includes(payload.type)\n },\n\n {\n error: 'viewId needs to be added ',\n predicate: payload => payload.viewId !== undefined\n }\n ]\n\n stepValidations = function() {\n const stepValidations = []\n return stepValidations.concat(lifeStreamValidations)\n }\n\n stepDisposeValidations = function() {\n const stepUpdateValidations = [\n {\n error: 'DISPOSE STEP requires a disposeItem param in the data object',\n predicate: payload => payload.STEP === 'DISPOSE' &&\n payload.data.disposeItems !== undefined\n }\n ]\n return stepUpdateValidations.concat(lifeStreamValidations)\n }\n\n stepUpdateValidations = function() {\n const stepUpdateValidations = [\n {\n error: 'UPDATE STEP requires a data object ',\n predicate: payload => payload.STEP === 'UPDATE' && payload.data !==\n undefined\n }\n ]\n return stepUpdateValidations.concat(lifeStreamValidations)\n }\n // ===========================================================================\n // lifestreamValidations\n // ===========================================================================\n lifestreamValidations = function() {\n return lifeStreamValidations.concat(baseValidations)\n .concat(viewInfoValidations)\n }\n // ===========================================================================\n // HERE IS THE ROUTE VALIDATIONS\n // ===========================================================================\n routeValidations = function() {\n const routeValidations = [\n /*\n *\n {\n error: `needs a valid route string within [${registeredRoutes}]`,\n predicate: payload => registeredRoutes.includes(pullMainRoute(payload.data.navigateTo))\n }\n *\n */\n\n ]\n return routeValidations.concat(baseValidations).concat(viewInfoValidations)\n }\n // ===========================================================================\n /*\n * THE IDEA OF StreamsConfig IS TO COMPLETELY GENERATE ALL APP STREAMS USING THIS OBJECT\n * THIS HAS NOT BEEN IMPLEMENTED -- MAY BE ADDED IN A FUTURE VERSION\n */\n // ===========================================================================\n StreamsConfig = function() {\n const streamValidations = [\n {\n error: 'param \\'name\\' must be of a registered type',\n predicate: payload => registeredStreamNames().includes(payload.name)\n },\n {\n error: 'param \\'observable\\' must contain a valid Observable',\n predicate: payload => registeredStreamTypes.includes(\n getRxType(payload.observable))\n },\n {\n error: 'param action must be a registered action',\n predicate: payload => registeredActions.includes(payload.action)\n }\n\n ]\n\n return {\n streams: [\n {\n init: {\n name: 'DISPATCHER',\n observable: () => new Subject(),\n action: 'subscribe'\n },\n structure: {\n type: String,\n observable: Observable || Subject,\n action: String\n },\n validations: streamValidations\n },\n {\n init: {\n name: 'UBU',\n observable: () => new Subject(),\n action: 'subscribe'\n },\n structure: {\n type: String,\n observable: Observable || Subject,\n action: String\n },\n validations: streamValidations\n }\n ]\n }\n }\n}\nexport {\n stepDisposeValidations, stepUpdateValidations, stepValidations, uiValidations, routeValidations, lifestreamValidations, registeredStreamNames, StreamsConfig\n}\n","import { clone, compose, fromPairs, is, path, toPairs } from 'ramda'\nimport { SpyneAppProperties } from './spyne-app-properties.js'\n\nconst getPropType = (prp) => {\n let type = typeof prp\n if (['number', 'boolean', 'string'].includes(type)) {\n type = 'primitive'\n } else if (type === 'object') {\n if (Array.isArray(prp)) {\n type = 'array'\n } else if (prp === null) {\n type = 'undefined'\n }\n }\n return type\n}\n\nconst cmsDataReviveNestedProxyObj = (proxyObj = {}, proxyReviverMethod) => {\n const { __proxy__proxyName } = proxyObj\n\n if (__proxy__proxyName === undefined) {\n console.error('object is not proxy object ', proxyObj)\n }\n\n const cloneNestedProxyObj = (target, pathArr) => {\n const nestedProxyObj = path(pathArr, proxyObj)\n const { __proxy__isProxy, __proxy__props } = nestedProxyObj\n return __proxy__isProxy ? proxyReviverMethod(target, __proxy__props) : target\n }\n\n const rootObj = cloneNestedProxyObj(clone(proxyObj), [])\n\n const proxyIterable = (iterObj, iterPath) => {\n const dataPath = iterPath || []\n const loopObj = ([key, prop]) => {\n const type = getPropType(prop)\n const clonedPath = [...dataPath]\n clonedPath.push(key)\n if (type === 'object' || type === 'array') {\n iterObj[key] = cloneNestedProxyObj(prop, clonedPath)\n proxyIterable(prop, clonedPath)\n }\n }\n Object.entries(iterObj).forEach(loopObj)\n }\n\n proxyIterable(rootObj)\n // console.timeEnd('proxify2');\n\n return rootObj\n}\n\nconst reviveIfProxy = (o = {}) => {\n const { __proxy__proxyName } = o\n if (__proxy__proxyName !== undefined) {\n const proxyReviverMethod = SpyneAppProperties.getProxyReviver(__proxy__proxyName)\n if (typeof proxyReviverMethod === 'function') {\n return cmsDataReviveNestedProxyObj(o, proxyReviverMethod)\n }\n }\n return undefined\n}\n\n/**\n *\n * Deep, proxy-preserving clone. Unlike safeClone — which only revives when the\n * ROOT object is a proxy — this walks plain containers (objects and arrays)\n * and revives any nested proxy it finds, so wrappers that hold proxied data\n * (e.g. channel payloads, pageData containers) survive cloning intact.\n * Functions are passed through by reference; cycles are guarded.\n *\n * @param {Object|Array} o\n * @returns A writable copy in which every nested proxy has been revived\n */\nexport const safeCloneDeep = function(o, seen = new WeakSet()) {\n if (o === null || typeof o !== 'object') {\n return o\n }\n\n const revived = reviveIfProxy(o)\n if (revived !== undefined) {\n return revived\n }\n\n if (seen.has(o)) {\n return o\n }\n seen.add(o)\n\n if (Array.isArray(o)) {\n return o.map(item => safeCloneDeep(item, seen))\n }\n\n const out = {}\n Object.entries(o).forEach(([key, val]) => {\n out[key] = safeCloneDeep(val, seen)\n })\n return out\n}\n\n/**\n * Re-wraps a derived array with the SOURCE array's proxy metadata via the\n * registered reviver. Native filter/reject/map keep element identity but\n * return a plain array — losing the array-level proxy that string-item\n * template loops (e.g. {{#titles}}) rely on for __cms__dataId / keyFor\n * lookups. In production (no proxies) this is a single undefined check.\n *\n * Note: the reviver rebuilds its key/value map from the derived contents, so\n * value-keyed lookups survive while original index positions shift.\n */\nconst rewrapArrayFromSource = (sourceArr, resultArr) => {\n const proxyName = sourceArr?.__proxy__proxyName\n if (proxyName === undefined) {\n return resultArr\n }\n const proxyReviverMethod = SpyneAppProperties.getProxyReviver(proxyName)\n if (typeof proxyReviverMethod !== 'function') {\n return resultArr\n }\n return proxyReviverMethod(resultArr, sourceArr.__proxy__props)\n}\n\n/**\n *\n * Proxy-preserving Array.prototype.filter: elements keep their identity\n * (native behavior) AND the returned array keeps the source array's proxy\n * metadata. Use in place of ramda filter / arr.filter on CMS data.\n */\nexport const safeFilter = function(arr, predicate) {\n return rewrapArrayFromSource(arr, arr.filter(predicate))\n}\n\n/**\n *\n * Proxy-preserving reject — inverse of safeFilter.\n */\nexport const safeReject = function(arr, predicate) {\n return rewrapArrayFromSource(arr, arr.filter((item, i) => predicate(item, i) === false))\n}\n\n/**\n *\n * Proxy-preserving Array.prototype.map with an augment-in-place contract:\n * proxied elements arrive in the callback as WRITABLE revived copies, so\n * `safeMap(stories, s => { s.type = 'story'; return s; })` is safe by\n * construction (no silent live-proxy write traps). Plain elements pass by\n * reference exactly like native map, so production cost matches native.\n * A callback that builds an entirely new object per element still strips\n * that element's identity — there is nothing left to preserve.\n */\nexport const safeMap = function(arr, mapFn) {\n const result = arr.map((item, i) => {\n const isProxied = item !== null && typeof item === 'object' && item.__proxy__proxyName !== undefined\n return mapFn(isProxied ? safeCloneDeep(item) : item, i)\n })\n return rewrapArrayFromSource(arr, result)\n}\n\n/**\n *\n * Revive-then-augment. Live CMS proxies silently ignore writes of new keys,\n * so properties cannot be attached to them directly. This returns a writable,\n * proxy-preserved copy of o with the given props applied — the sanctioned way\n * to add view or route properties to CMS-proxied data.\n *\n * @param {Object|Array} o\n * @param {Object} propsObj properties to assign onto the revived copy\n * @returns A writable proxy-preserved copy carrying the extra props\n */\nexport const safeAugment = function(o, propsObj = {}) {\n const target = safeCloneDeep(o)\n Object.entries(propsObj).forEach(([key, val]) => {\n target[key] = val\n })\n return target\n}\n\nexport const safeClone = function(o, deep = false) {\n const revived = reviveIfProxy(o)\n if (revived !== undefined) {\n return revived\n }\n\n if (deep === true) {\n return safeCloneDeep(o)\n }\n\n const isArr = is(Array)\n const isObj = is(Object)\n const isIter = ob => isArr(ob) === false && isObj(ob) === true\n const isIterable = isIter(o)\n return isIterable ? compose(fromPairs, toPairs, clone)(o) : clone(o)\n}\n","import {\n mergeAll,\n clone,\n fromPairs,\n toPairs,\n compose,\n includes,\n pickAll,\n lte,\n defaultTo,\n prop,\n is\n} from 'ramda'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { safeClone, safeCloneDeep } from '../utils/safe-clone.js'\n\n// read-only facades for cms-proxied payload subtrees, cached per proxy so\n// repeated dispatches of the same canonical data reuse a single wrapper\nconst _readOnlyFacadeCache = new WeakMap()\n\nexport class ChannelPayload {\n /**\n *\n * All Channel data is published using this interface.\n * @module ChannelPayload\n * @type internal\n *\n * @constructor\n * @param {String} channelName\n * @param {String} action\n * @param {Object} payload\n * @param {Element} srcElement\n * @param {Event} event\n *\n * @property {String} channelName - = undefined; The name of the Channel that is sending the payload.\n * @property {String} action - = undefined; An action string that has been registered within the Channel's addRegisteredActions method.\n * @property {Object} payload - = undefined; The data object.\n * @property {HTMLElement} srcElement - = {}; This is populated when triggered from a ViewStream instance.\n * @property {UIEvent} event - = undefined; The UIEvent, if any.\n * @returns Validated ChannelPayload json object\n */\n constructor(channelName, action, payload, srcElement, event, timeLabel) {\n const channel = channelName\n // payload = ChannelPayload.deepFreeze(payload);\n\n if (timeLabel) {\n console.time(timeLabel)\n }\n\n const channelPayloadItemObj = { channelName, action, srcElement, event }\n // Object.defineProperty(channelPayloadItemObj, 'payload', {get: () => clone(payload)});\n channelPayloadItemObj.payload = ChannelPayload.deepFreeze(payload)\n /**\n * This is a convenience method that helps with destructuring by merging all properties.\n *\n * @returns\n * JSON Object\n *\n * @example\n * TITLE['<h4>Destructuring Properties using the ChannelPayload props Method</h4>']\n * let {el, action, myVal} = payload.props();\n *\n *\n */\n\n if (SpyneAppProperties.debug === true) {\n if (Object.prototype.hasOwnProperty.call(payload, 'payload')) {\n const payloadStr = JSON.stringify(payload)\n console.warn(`Spyne Warning: the following payload contains a nested payload property which may create conflicts: Action: ${action}, ${payloadStr}`)\n }\n\n const channelActionsArr = SpyneAppProperties.getChannelActions(channel)\n\n ChannelPayload.validateAction(action, channel, channelActionsArr)\n }\n\n channelPayloadItemObj.clone = () => {\n return mergeAll([\n { payload:safeClone(channelPayloadItemObj.payload) },\n channelPayloadItemObj.payload,\n { channel: clone(channel) },\n { event: clone(event) },\n { srcElement },\n clone(channelPayloadItemObj.srcElement), { action: clone(channelPayloadItemObj.action) }\n ])\n }\n\n /**\n * Proxy-preserving version of clone. Returns the same merged shape, but\n * the payload is copied with safeCloneDeep, so any CMS proxy objects —\n * at the root or nested inside plain containers or arrays — are revived\n * as writable proxy copies instead of being stripped by a structural\n * clone. Use this when a handler treats the payload as its data source.\n *\n * @returns\n * JSON Object\n *\n * @example\n * TITLE['<h4>Retrieving Proxied Payload Data</h4>']\n * onStoryEvent(e){\n * const data = e.safeClone();\n * this.addStoryArticle(data);\n * }\n *\n */\n channelPayloadItemObj.safeClone = () => {\n const revivedPayload = safeCloneDeep(channelPayloadItemObj.payload)\n return mergeAll([\n { payload: revivedPayload },\n revivedPayload,\n { channel },\n { event },\n { srcElement },\n channelPayloadItemObj.srcElement,\n { action: channelPayloadItemObj.action }\n ])\n }\n\n const channelPayloadItemObjProps = {\n $dir: {\n get: () => channelPayloadItemObj._dir,\n set: (val) => {\n channelPayloadItemObj._dir = val\n return val\n }\n }\n }\n\n if (channel === 'CHANNEL_ROUTE') {\n // channelPayloadItemObj['location'] = ChannelPayload.getLocationData();\n channelPayloadItemObjProps.location = {\n get: () => ChannelPayload.getLocationData()\n }\n /* channelPayloadItemObjProps['routeData'] = {\n get: ()=>prop('routeData', frozenPayload)\n }\n*/\n }\n\n channelPayloadItemObj._dir = undefined\n\n Object.defineProperties(channelPayloadItemObj, channelPayloadItemObjProps)\n\n if (timeLabel) {\n console.timeEnd(timeLabel)\n }\n return channelPayloadItemObj\n }\n\n static validateAction(action, channel, arr) {\n const isInArr = includes(action, arr)\n if (isInArr === false && SpyneAppProperties.initialized === true) {\n console.warn(`warning: Action: '${action}' is not registered within the ${channel} channel!`)\n }\n return isInArr\n }\n\n static getLocationData() {\n const locationParamsArr = [\n 'href',\n 'origin',\n 'protocol',\n 'host',\n 'hostname',\n 'port',\n 'pathname',\n 'search',\n 'hash']\n return pickAll(locationParamsArr, window.location)\n }\n\n static getStreamItem() {\n\n }\n\n static deepClone(o) {\n const isArr = is(Array)\n const isObj = is(Object)\n const isIter = ob => isArr(ob) === false && isObj(ob) === true\n const isIterable = isIter(o)\n return isIterable ? compose(fromPairs, toPairs, clone)(o) : clone(o)\n }\n\n /**\n * Wraps a CMS-proxied payload subtree in a read-only facade. Payloads are\n * reference-by-wire (every subscriber shares the same object), and freezing\n * a proxy would freeze the CANONICAL cms target for the whole app — so\n * instead the payload boundary gets a lightweight second proxy that blocks\n * writes while reads (and nested reads) pass through. Consumers that need\n * a writable copy call e.safeClone(). Facades are cached per proxy so\n * repeated dispatches of the same data reuse one wrapper.\n */\n static createReadOnlyProxyFacade(proxyObj) {\n if (_readOnlyFacadeCache.has(proxyObj)) {\n return _readOnlyFacadeCache.get(proxyObj)\n }\n\n const warnBlockedWrite = (propName) => {\n if (SpyneAppProperties.debug === true) {\n console.warn(`Spyne Warning: blocked write of '${String(propName)}' on read-only channel payload data; use e.safeClone() for a writable copy`)\n }\n return true // silent no-op; returning false would throw in strict mode\n }\n\n const facade = new Proxy(proxyObj, {\n get(target, propName) {\n const val = target[propName]\n // nested cms containers are proxies themselves — wrap them so deep\n // writes are blocked too (cached, so repeat reads reuse the facade)\n if (val !== null && typeof val === 'object' && val.__proxy__isProxy === true) {\n return ChannelPayload.createReadOnlyProxyFacade(val)\n }\n return val\n },\n set(target, propName) {\n return warnBlockedWrite(propName)\n },\n defineProperty(target, propName) {\n return warnBlockedWrite(propName)\n },\n deleteProperty(target, propName) {\n return warnBlockedWrite(propName)\n }\n })\n\n _readOnlyFacadeCache.set(proxyObj, facade)\n return facade\n }\n\n static deepFreeze(o) {\n // return o;\n // return Object.freeze(o);\n const elIsDomElement = compose(lte(0), defaultTo(-1), prop('nodeType'))\n\n // CMS proxy subtrees are NOT frozen (that would freeze the canonical cms\n // target app-wide) — they are wrapped in a read-only facade instead, so\n // the payload immutability contract holds without copies\n if (o !== null && typeof o === 'object' && o.__proxy__isProxy === true) {\n return ChannelPayload.createReadOnlyProxyFacade(o)\n }\n\n try {\n // children first: proxy subtrees must be swapped for their facades\n // BEFORE the parent is frozen, or the assignment would be rejected\n Object.getOwnPropertyNames(o).forEach(function(prop) {\n const val = o[prop]\n if (Object.prototype.hasOwnProperty.call(o, prop) &&\n elIsDomElement(val) === false &&\n val !== null &&\n (typeof val === 'object' || typeof val === 'function') &&\n !Object.isFrozen(val)) {\n const processed = ChannelPayload.deepFreeze(val)\n if (processed !== val) {\n o[prop] = processed\n }\n }\n })\n Object.freeze(o)\n } catch (e) {\n // console.log(\"FREEZE ERR \",{o,e});\n return o\n }\n\n return o\n }\n\n static getMouseEventKeys() {\n return ['altKey', 'bubbles', 'cancelBubble', 'cancelable', 'clientX', 'clientY', 'composed', 'ctrlKey', 'currentTarget', 'defaultPrevented', 'detail', 'eventPhase', 'fromElement', 'isTrusted', 'layerX', 'layerY', 'metaKey', 'movementX', 'movementY', 'offsetX', 'offsetY', 'pageX', 'pageY', 'path', 'relatedTarget', 'returnValue', 'screenX', 'screenY', 'shiftKey', 'sourceCapabilities', 'srcElement', 'target', 'timeStamp', 'toElement', 'type', 'view', 'which', 'x', 'y']\n }\n}\n","export function baseCoreMixins() {\n return {\n createpropsMap: function() {\n const wm = new WeakMap()\n const objKey = { vsid: this.props.vsid }\n wm.set(objKey, this.props)\n return {\n key: objKey,\n weakMap: wm\n }\n },\n gc: function() {\n for (const m in this) {\n delete this[m]\n }\n delete this\n },\n createId: function() {\n // let num = Math.floor(Math.random(10000000) * 10000000);\n // const num = () => Math.random().toString(36).substring(2, 8);;\n const num = () => Math.random().toString(36).replace(/\\d/gm, '').substring(1, 8)\n return num()\n // return `vsid-${num()}`;\n },\n setTraceFunc: function(debug) {\n return debug === true\n ? console.log\n : () => {\n }\n }\n }\n}\n","import { defaultTo, match, forEach, test, includes, without, complement, isEmpty, values, isNil, filter, __, keys, compose, head, map, cond, T, allPass, concat, uniq } from 'ramda'\nconst isIOS = () => {\n const userAgent = window.navigator.userAgent.toLowerCase()\n // let safari = /safari/.test(userAgent);\n const ios = /iphone|ipod|ipad/.test(userAgent)\n return ios === true\n}\n\nconst delayCall = async(fn, time) => {\n function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms))\n }\n\n const timeoutHandler = async() => {\n await sleep(1)\n window.requestAnimationFrame(fn)\n }\n\n window.setTimeout(timeoutHandler, time)\n}\n\nconst getConstructorName = (obj) => {\n if (obj.constructor.name !== undefined) {\n return obj.constructor.name\n }\n const re = /^(function\\s)(\\w+)(\\(.*)$/\n const str = obj.toString()\n return defaultTo(String(str).substr(0, 12), match(re, str)[2])\n}\n\nconst arrFromMapKeys = (map) => {\n const arr = []\n const addKeysToArr = (v, k, i) => arr.push(k)\n forEach(addKeysToArr, map)\n return arr\n}\n\nconst findStrFromRegexArr = (obj, str) => {\n if (obj[str] !== undefined) {\n return str\n }\n const checkIfMatch = s => test(new RegExp(s), str)\n const checkStrMatch = includes(str)\n const checkIfRegExMatch = compose(includes(true), map(checkIfMatch))\n const runMatchChecks = cond([\n [checkStrMatch, () => str],\n [checkIfRegExMatch, () => str],\n [T, () => undefined]\n ])\n return runMatchChecks(obj)\n}\n\nconst findStrOrRegexMatchStr = (obj, str) => {\n if (obj[str] !== undefined) {\n return str\n }\n const createRe = s => new RegExp(s)\n const checkerIfRegexMatchExists = compose(head, filter(compose(test(__, str), createRe)))\n return checkerIfRegexMatchExists(keys(obj))\n}\n\nconst closest = (array, num) => {\n let i = 0\n let minDiff = 1000\n let ans\n for (i in array) {\n const m = Math.abs(num - array[i])\n if (m < minDiff) {\n minDiff = m\n ans = array[i]\n }\n }\n return ans\n}\n\nconst convertDomStringMapToObj = (domMap) => {\n const obj = {}\n for (const d in domMap) {\n obj[d] = domMap[d]\n }\n return obj\n}\n\n// const passPageData = pick(['params', 'routeId', 'data'], __);\n\nconst subscribeFn = {\n next: x => console.log(`next ${x}`),\n error: x => console.log(`error ${x}`),\n complete: x => console.log(`complete ${x}`)\n}\n\nconst right = x => ({\n map: f => right(f(x)),\n fold: (f, g) => g(x),\n inspect: () => `right(${x})`\n\n})\n\nconst ifNilThenUpdate = (val, newVal) => {\n const isNilBool = isNil(val)\n return isNilBool ? newVal : val\n}\n\nconst left = x => ({\n map: f => left(x),\n fold: (f, g) => f(x),\n inspect: () => `left(${x})`\n})\n\nconst checkIfObjIsNotEmptyOrNil = (obj) => {\n const isNotEmpty = compose(complement(isEmpty), head, values)\n const isNotNil = compose(complement(isNil), head, values)\n const isNotNilAndIsNotEmpty = allPass([isNotEmpty, isNotNil])\n return isNotNilAndIsNotEmpty(obj)\n}\n\nconst fromNullable = x => x !== null ? right(x) : left(null)\n\nconst findInObj = (obj, val, error = null) => {\n const found = obj[val]\n return found ? right(found) : left(error)\n}\nconst pullRouteInfo = () => {\n const str = pullHashAndSlashFromPath(window.location.hash)\n const routeId = pullMainRoute(str)\n const params = pullParams(str)\n return { routeId, params }\n}\n\nfunction getAllMethodNames(instance, omittedMethods = []) {\n // Optionally rename `instance` to something more descriptive:\n const baseClassMethodsArr = ['length', 'name', 'prototype', 'constructor']\n const combinedOmittedMethods = concat(baseClassMethodsArr, omittedMethods)\n\n // Filter out omitted\n const omitPropsFromArr = compose(without(combinedOmittedMethods), uniq)\n\n // Pull out instance methods\n const methods = omitPropsFromArr(\n Object.getOwnPropertyNames(instance.constructor.prototype)\n )\n\n // Pull out static methods\n const staticMethods = omitPropsFromArr(\n Object.getOwnPropertyNames(instance.constructor)\n )\n\n const allMethods = concat(methods, staticMethods)\n\n return { methods, staticMethods, allMethods }\n}\n\n/* const getAllMethodNames3 = (_this = this, omittedMethods = []) => {\n const getPropNamesArr = (obj = this, omittedMethods = []) => {\n return Object.getOwnPropertyNames(obj)\n }\n // Filter Methods\n const baseClassMethodsArr = ['length', 'name', 'prototype', 'constructor']\n omittedMethods = concat(baseClassMethodsArr, omittedMethods)\n const omitPropsFromArr = compose(without(omittedMethods), uniq)\n\n // PULL OUT METHOD NAMES\n const methods = omitPropsFromArr(Object.getOwnPropertyNames(_this.constructor.prototype))\n const staticMethods = omitPropsFromArr(getPropNamesArr(_this.constructor))\n const allMethods = concat(methods, staticMethods)\n\n return { methods, staticMethods, allMethods }\n // return 'fn';\n} */\n\n// ROUTE REGEX EXPRESSIONS\nconst removeSlashes = str => str.replace(/^(\\/)(.*)/g, '$2')\nconst routeRE = /^(\\/?)(\\w*)(\\/?)(.*)/g\nconst pullHashAndSlashFromPath = (str) => str.replace(/^(#\\/?)(.*)/, '$2')\nconst pullSlashFromPath = (str) => str.replace(/^(\\/?)(.*)/, '$2')\nconst pullMainRoute = (str) => str.replace(routeRE, '$2')\nconst pullParams = (str) => str.replace(routeRE, '$4')\nconst pullTranslateX = str => str.replace(/^(matrix)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*)(,.*)/, '$6')\nconst pullTranslateY = str => str.replace(/^(matrix)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d)(.*)/, '$7')\nconst pullTranslateYFromHeader = str => str.replace(/^(transform: matrix)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*,)(.*\\d*)(\\).*;)/, '$6')\nexport { getConstructorName, arrFromMapKeys, getAllMethodNames, findStrOrRegexMatchStr, findStrFromRegexArr, checkIfObjIsNotEmptyOrNil, isIOS, pullRouteInfo, pullTranslateYFromHeader, pullSlashFromPath, pullHashAndSlashFromPath, closest, pullTranslateY, pullTranslateX, pullMainRoute, pullParams, right, left, fromNullable, findInObj, ifNilThenUpdate, removeSlashes, subscribeFn, convertDomStringMapToObj, delayCall }\n","/**\n * Central outlet for SpyneJS developer-hint warnings (invalid selectors,\n * sanitized attributes, policy removals, deprecations).\n *\n * Warnings are suppressed when window.SPYNE_SUPPRESS_WARNINGS is true —\n * primarily for test runs, where expected-failure cases would otherwise\n * flood the reporter. The flag lives on window (not module state) so it\n * spans separately bundled test files.\n *\n * Security-posture warnings (e.g. config.disableSanitize) do NOT route\n * through here and are always printed.\n */\nconst spyneWarn = (...args) => {\n const suppressed = typeof window !== 'undefined' && window.SPYNE_SUPPRESS_WARNINGS === true\n if (suppressed !== true) {\n console.warn(...args)\n }\n}\n\nconst setSpyneWarningsDisabled = (bool = true) => {\n if (typeof window !== 'undefined') {\n window.SPYNE_SUPPRESS_WARNINGS = bool === true\n }\n}\n\nexport { spyneWarn, setSpyneWarningsDisabled }\n","// src/utils/sanitize-data.js\nimport DOMPurify from 'dompurify'\nimport { spyneWarn } from './spyne-warn.js'\nimport { SpyneAppProperties } from './spyne-app-properties.js'\n\nlet _sanitizeData\nlet isConfigured = false\nlet globalDisable = false\nlet forceStrict = false // deprecated legacy toggle, see setSanitizeDataForceStrict\n\n/* ---------------------------------------------\n * URI policy\n *\n * Allows https?, mailto:, tel:, data:image/ and any scheme-less\n * (relative, fragment, query, protocol-relative) URL.\n * All other schemes (javascript:, vbscript:, data:text/html, etc.) fail.\n * ------------------------------------------- */\nconst SAFE_URI_REGEXP = /^(?:(?:https?|mailto|tel):|data:image\\/|(?![a-z][a-z0-9+.-]*:)[\\s\\S]*$)/i\n\n// Browsers strip ASCII control characters and whitespace when parsing URL\n// schemes, so \"jav\\tascript:\" executes. Normalize before testing.\n// eslint-disable-next-line no-control-regex -- matching control chars is the point\nconst normalizeUriForCheck = (val) => String(val).replace(/[\\u0000-\\u0020]/g, '')\n\nconst isSafeUri = (val) => SAFE_URI_REGEXP.test(normalizeUriForCheck(val))\n\n/* ---------------------------------------------\n * Custom elements\n *\n * The framework's own custom elements (spyne-*) are first-party output —\n * the CMS proxy wraps editable content in <spyne-cms-item> etc. — and are\n * admitted in every mode. They are inert without their defining plugin\n * and the attribute check below only admits data-* on them.\n *\n * Additional elements register via allowCustomElements() (additive only;\n * names must contain a hyphen per the custom-element spec, so built-in\n * tags like script or iframe can never be admitted through this path)\n * or via config.customElements at SpyneApp.init.\n * ------------------------------------------- */\nconst SPYNE_CUSTOM_ELEMENT_RE = /^spyne-[a-z][a-z0-9-]*$/i\n\nconst allowedCustomElementPatterns = []\n\nconst allowCustomElements = (elements = []) => {\n const arr = Array.isArray(elements) ? elements : [elements]\n\n arr.forEach((entry) => {\n if (entry instanceof RegExp) {\n allowedCustomElementPatterns.push(entry)\n return\n }\n\n const name = String(entry).toLowerCase()\n if (/^[a-z][a-z0-9]*-[a-z0-9-]+$/.test(name) !== true) {\n spyneWarn(`SPYNE WARNING: \"${entry}\" is not a valid custom element name (a hyphen is required) and was not added to the sanitizer allowlist.`)\n return\n }\n\n allowedCustomElementPatterns.push(name)\n })\n}\n\nconst customElementTagCheck = (tagName) => {\n if (SPYNE_CUSTOM_ELEMENT_RE.test(tagName)) return true\n\n return allowedCustomElementPatterns.some(p =>\n p instanceof RegExp ? p.test(tagName) : p === tagName\n )\n}\n\nconst CUSTOM_ELEMENT_HANDLING = {\n tagNameCheck: customElementTagCheck,\n attributeNameCheck: /^data-[a-z0-9-]+$/i,\n allowCustomizedBuiltInElements: false\n}\n\n/* ---------------------------------------------\n * Mode configurations\n * ------------------------------------------- */\nconst SAFE_FOR_RICH_TEXT = {\n ALLOWED_TAGS: [\n 'a', 'b', 'i', 'em', 'strong', 'u', 'p', 'br', 'ul', 'dl', 'dt', 'dd', 'ol', 'li', 'hr',\n 'blockquote', 'pre', 'code', 'span', 'div', 'section', 'article', 'aside',\n 'header', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',\n 'table', 'thead', 'tbody', 'tr', 'td', 'th', 'img', 'figure', 'figcaption',\n 'video', 'source', 'iframe', 'input', 'button', 'label', 'link'\n ],\n ADD_TAGS: ['iframe', 'input', 'button', 'link'],\n ALLOWED_ATTR: [\n 'href', 'src', 'alt', 'class', 'title', 'width', 'height', 'style', 'target', 'rel',\n 'controls', 'poster', 'type', 'rows', 'cols', 'sandbox'\n ],\n ALLOW_DATA_ATTR: true,\n FORBID_ATTR: ['onerror', 'onload', 'onclick', 'onmouseover', 'onfocus', 'onblur', 'onchange'],\n FORBID_TAGS: ['script', 'object', 'embed', 'meta'],\n ALLOWED_URI_REGEXP: SAFE_URI_REGEXP,\n CUSTOM_ELEMENT_HANDLING\n}\n\nconst SAFE_FOR_APP = {\n FORBID_TAGS: ['script', 'iframe', 'object', 'embed', 'form', 'input', 'button', 'link', 'meta'],\n FORBID_ATTR: ['onerror', 'onload', 'onclick', 'onmouseover', 'onfocus', 'onblur', 'onchange'],\n ALLOW_DATA_ATTR: false,\n ALLOWED_URI_REGEXP: SAFE_URI_REGEXP,\n CUSTOM_ELEMENT_HANDLING\n}\n\n/* ---------------------------------------------\n * Iframe policy\n *\n * Configured via config.iframes at SpyneApp.init:\n * allow — undefined (mode default: richtext yes, app no) | true | false\n * allowedOrigins — [] (any https origin) | ['https://www.youtube.com', ...]\n * sandbox — sandbox value forced onto iframes lacking one; false = never force\n *\n * A per-call override can be passed as opts.iframes to sanitizeData.\n * ------------------------------------------- */\nconst DEFAULT_IFRAME_SANDBOX = 'allow-scripts allow-same-origin allow-popups'\n\nlet configuredIframePolicy = { allow: undefined, allowedOrigins: [], sandbox: DEFAULT_IFRAME_SANDBOX }\nlet activeIframePolicy = configuredIframePolicy\n\nconst resolveIframePolicy = (override) => {\n if (!override) return configuredIframePolicy\n return {\n allow: override.allow !== undefined ? override.allow : configuredIframePolicy.allow,\n allowedOrigins: override.allowedOrigins !== undefined ? override.allowedOrigins : configuredIframePolicy.allowedOrigins,\n sandbox: override.sandbox !== undefined ? override.sandbox : configuredIframePolicy.sandbox\n }\n}\n\nconst iframeAllowedForMode = (mode, policy = activeIframePolicy) => {\n if (policy.allow === undefined) return mode === 'richtext'\n return policy.allow === true\n}\n\n// localhost is a secure context per the platform's own definition.\nconst isTrustworthyLocalHostname = (hostname) =>\n hostname === 'localhost' ||\n hostname === '127.0.0.1' ||\n hostname === '[::1]' ||\n hostname.endsWith('.localhost')\n\nconst isAllowedIframeSrc = (src, policy = activeIframePolicy) => {\n const normalized = normalizeUriForCheck(src)\n\n let resolved\n try {\n resolved = new URL(normalized, window.location.href)\n } catch (e) {\n return false\n }\n\n // Executable/pseudo schemes (javascript:, data:, vbscript:) resolve with\n // an opaque 'null' origin and fail both checks below.\n\n // Same-origin embeds (including relative src) are as trusted as the\n // page itself and always pass, regardless of scheme or allowlist.\n if (resolved.origin === window.location.origin && resolved.origin !== 'null') {\n return true\n }\n\n // Cross-origin embeds must be https, or http on a localhost host\n // (a secure context) to keep local development friction-free.\n const isSecure = resolved.protocol === 'https:' ||\n (resolved.protocol === 'http:' && isTrustworthyLocalHostname(resolved.hostname))\n\n if (isSecure !== true) return false\n\n const origins = policy.allowedOrigins\n if (!Array.isArray(origins) || origins.length === 0) return true\n\n return origins.some(o => {\n try {\n return new URL(o).origin === resolved.origin\n } catch (e) {\n return false\n }\n })\n}\n\nlet iframeHookAdded = false\nconst addIframeHardeningHook = () => {\n if (iframeHookAdded) return\n iframeHookAdded = true\n\n DOMPurify.addHook('afterSanitizeAttributes', (node) => {\n if (!node || node.tagName !== 'IFRAME') return\n\n const src = node.getAttribute('src') || ''\n if (src !== '' && isAllowedIframeSrc(src) !== true) {\n spyneWarn(`SPYNE WARNING: iframe src \"${src}\" was removed by the iframe policy (same-origin, https, or an allowed origin is required).`)\n node.removeAttribute('src')\n }\n\n const { sandbox } = activeIframePolicy\n if (sandbox !== false && node.hasAttribute('sandbox') !== true) {\n node.setAttribute('sandbox', sandbox)\n }\n })\n}\n\n/* ---------------------------------------------\n * Anchor policy\n *\n * Configured via config.anchors at SpyneApp.init:\n * allowTarget — true (default) admits target on dynamic anchors in\n * every mode; the hook validates values and forces\n * noopener. false strips target everywhere.\n * addNoopener — true (default) forces rel=\"noopener noreferrer\"\n * onto target=\"_blank\" anchors.\n * allowedDomains — [] (any destination the URI scheme policy allows) |\n * ['https://github.com', ...] restricts cross-origin\n * hrefs to the listed origins. Same-origin, relative,\n * mailto: and tel: hrefs are always allowed.\n *\n * A per-call override can be passed as opts.anchors to sanitizeData.\n * The legacy top-level allowTargetAttr and addNoopener config keys are\n * honored as fallbacks.\n * ------------------------------------------- */\n// target accepts any browsing-context name; these are the keywords that\n// stay in the same context and therefore carry no opener risk.\nconst SAME_CONTEXT_TARGETS = ['_self', '_parent', '_top']\n\nlet configuredAnchorPolicy = { allowTarget: true, addNoopener: true, allowedDomains: [] }\nlet activeAnchorPolicy = configuredAnchorPolicy\n\nconst resolveAnchorPolicy = (override) => {\n if (!override) return configuredAnchorPolicy\n return {\n allowTarget: override.allowTarget !== undefined ? override.allowTarget === true : configuredAnchorPolicy.allowTarget,\n addNoopener: override.addNoopener !== undefined ? override.addNoopener === true : configuredAnchorPolicy.addNoopener,\n allowedDomains: override.allowedDomains !== undefined ? override.allowedDomains : configuredAnchorPolicy.allowedDomains\n }\n}\n\nconst isAllowedAnchorHref = (href, policy = activeAnchorPolicy) => {\n const normalized = normalizeUriForCheck(href)\n\n // mailto: and tel: are not domains and always pass.\n if (/^(mailto|tel):/i.test(normalized)) return true\n\n let resolved\n try {\n resolved = new URL(normalized, window.location.href)\n } catch (e) {\n return false\n }\n\n // Same-origin links (including relative hrefs) are never restricted.\n if (resolved.origin === window.location.origin && resolved.origin !== 'null') {\n return true\n }\n\n if (/^https?:$/.test(resolved.protocol) !== true) return false\n\n const domains = policy.allowedDomains\n if (!Array.isArray(domains) || domains.length === 0) return true\n\n return domains.some(d => {\n try {\n return new URL(d).origin === resolved.origin\n } catch (e) {\n return false\n }\n })\n}\n\nconst forceNoopenerRel = (el) => {\n const currentRel = el.getAttribute('rel') || ''\n const relSet = new Set(currentRel.split(/\\s+/).filter(Boolean))\n\n relSet.add('noopener')\n relSet.add('noreferrer')\n\n el.setAttribute('rel', Array.from(relSet).join(' '))\n}\n\nlet anchorHookAdded = false\nconst addAnchorHardeningHook = () => {\n if (anchorHookAdded) return\n anchorHookAdded = true\n\n DOMPurify.addHook('afterSanitizeAttributes', (node) => {\n if (!node || typeof node.getAttribute !== 'function') return\n if (node.tagName !== 'A') return\n\n const policy = activeAnchorPolicy\n const href = node.getAttribute('href')\n\n if (href && policy.allowedDomains.length > 0 && isAllowedAnchorHref(href, policy) !== true) {\n spyneWarn(`SPYNE WARNING: anchor href \"${href}\" was removed by the anchor policy (same-origin or an allowed domain is required).`)\n node.removeAttribute('href')\n }\n\n const target = node.getAttribute('target')\n if (!target) return\n\n // target without an href serves no purpose.\n if (policy.allowTarget !== true || !node.getAttribute('href')) {\n node.removeAttribute('target')\n return\n }\n\n // Any browsing-context name is valid; _blank and named windows both\n // hand the opened page an opener reference, so noopener applies to\n // every target except the same-context keywords.\n if (SAME_CONTEXT_TARGETS.includes(target) !== true && policy.addNoopener === true) {\n forceNoopenerRel(node)\n }\n })\n}\n\n/* ---------------------------------------------\n * Determine sanitization mode\n *\n * Explicit config always wins; the build environment is only a\n * fallback when no mode has been configured.\n * ------------------------------------------- */\nconst RICHTEXT_ALIASES = ['richtext', 'authoring', 'development']\n\nconst resolveDefaultMode = () => {\n const configMode = SpyneAppProperties?.mode\n\n if (RICHTEXT_ALIASES.includes(configMode)) return 'richtext'\n if (configMode === 'app') return 'app'\n\n try {\n if (typeof process !== 'undefined' && process?.env?.NODE_ENV === 'development') {\n return 'richtext'\n }\n } catch (e) {\n // no build-time env available\n }\n\n return 'app'\n}\n\n/* --------------------------------------------- */\nconst buildModeConfig = (mode) => {\n const base = mode === 'richtext' ? SAFE_FOR_RICH_TEXT : SAFE_FOR_APP\n const allowIframe = iframeAllowedForMode(mode)\n\n if (mode === 'richtext' && allowIframe !== true) {\n return {\n ...base,\n ALLOWED_TAGS: base.ALLOWED_TAGS.filter(t => t !== 'iframe'),\n ADD_TAGS: base.ADD_TAGS.filter(t => t !== 'iframe'),\n FORBID_TAGS: [...base.FORBID_TAGS, 'iframe']\n }\n }\n\n if (mode === 'app') {\n const cfg = { ...base }\n const addAttr = []\n\n if (allowIframe === true) {\n cfg.FORBID_TAGS = base.FORBID_TAGS.filter(t => t !== 'iframe')\n cfg.ADD_TAGS = ['iframe']\n addAttr.push('sandbox')\n }\n\n // DOMPurify strips target by default; re-admit it (with rel) so the\n // anchor hook can validate values and force noopener instead.\n if (activeAnchorPolicy.allowTarget === true) {\n addAttr.push('target', 'rel')\n }\n\n if (addAttr.length > 0) {\n cfg.ADD_ATTR = addAttr\n }\n\n return cfg\n }\n\n return base\n}\n\nfunction makeSanitizeFn(mode = 'app') {\n const cfg = buildModeConfig(mode)\n\n return (html) => DOMPurify.sanitize(html, cfg)\n}\n\n/* ---------------------------------------------\n * Configure once\n * ------------------------------------------- */\nconst sanitizeDataConfigure = (config = {}) => {\n if (isConfigured) {\n spyneWarn('sanitizeData is already configured. Reconfiguration is not allowed.')\n return\n }\n\n const { strict = false, disableSanitize = false, iframes, customElements, anchors, allowTargetAttr, addNoopener } = config\n\n globalDisable = disableSanitize === true\n\n if (customElements !== undefined) {\n allowCustomElements(customElements)\n }\n\n if (iframes && typeof iframes === 'object') {\n configuredIframePolicy = resolveIframePolicy(iframes)\n activeIframePolicy = configuredIframePolicy\n }\n\n // config.anchors wins; the legacy top-level allowTargetAttr/addNoopener\n // keys are honored as fallbacks.\n configuredAnchorPolicy = resolveAnchorPolicy({\n allowTarget: anchors?.allowTarget !== undefined ? anchors.allowTarget : allowTargetAttr,\n addNoopener: anchors?.addNoopener !== undefined ? anchors.addNoopener : addNoopener,\n allowedDomains: anchors?.allowedDomains\n })\n activeAnchorPolicy = configuredAnchorPolicy\n\n if (globalDisable) {\n console.warn('SPYNE SECURITY WARNING: All data sanitization is DISABLED via config.disableSanitize. Do not use this setting in production.')\n } else {\n addIframeHardeningHook()\n addAnchorHardeningHook()\n }\n\n const processFactory = (mode) => {\n const sanitizeStr = makeSanitizeFn(mode)\n const process = (val) => {\n if (Array.isArray(val)) return val.map(process)\n if (val && typeof val === 'object') {\n const out = {}\n for (const [k, v] of Object.entries(val)) {\n out[k] = (typeof v === 'string') ? sanitizeStr(v) : process(v)\n }\n return out\n }\n return (typeof val === 'string') ? sanitizeStr(val) : val\n }\n return process\n }\n\n _sanitizeData = (data, opts = {}) => {\n const { disableSanitize: callDisable = false, mode, iframes: iframesOverride, anchors: anchorsOverride } = opts\n if (globalDisable || callDisable) return data\n\n const legacyStrict = forceStrict || strict\n const effectiveMode = mode || (legacyStrict ? 'app' : resolveDefaultMode())\n\n // Sanitization is synchronous, so the per-call iframe and anchor\n // policies can be scoped with a swap-and-restore around the pass.\n activeIframePolicy = resolveIframePolicy(iframesOverride)\n activeAnchorPolicy = resolveAnchorPolicy(anchorsOverride)\n try {\n return processFactory(effectiveMode)(data)\n } finally {\n activeIframePolicy = configuredIframePolicy\n activeAnchorPolicy = configuredAnchorPolicy\n }\n }\n\n sanitizeDataConfigure.sanitizeDataForce = (data, mode) => {\n if (globalDisable) return data\n const effective = mode || resolveDefaultMode()\n return processFactory(effective)(data)\n }\n\n isConfigured = true\n}\n\n/* ---------------------------------------------\n * Configurable runtime sanitizer\n * ------------------------------------------- */\nconst sanitizeData = (data, opts = {}) => {\n if (!isConfigured) {\n throw new Error('sanitizeData is not configured. Call sanitizeDataConfigure() first.')\n }\n return _sanitizeData(data, opts)\n}\n\n/* ---------------------------------------------\n * Always-on sanitizer with environment default\n * ------------------------------------------- */\nconst sanitizeDataForce = (data, mode) => {\n if (!isConfigured || !sanitizeDataConfigure.sanitizeDataForce) {\n const sanitizeStr = makeSanitizeFn(mode || resolveDefaultMode())\n return (typeof data === 'string') ? sanitizeStr(data) : data\n }\n return sanitizeDataConfigure.sanitizeDataForce(data, mode)\n}\n\n/* ---------------------------------------------\n * Attribute sanitizer\n *\n * The single value-level guard for the attribute channel\n * (DomElement.setElAttrs). Attribute names are gated by the\n * DomElement/ViewStream allowlists; this validates values.\n *\n * Independent of sanitizeDataConfigure so it is always available.\n * Returns { allowed: Boolean, value }.\n * ------------------------------------------- */\nconst URL_ATTRS = [\n 'href', 'src', 'action', 'formaction', 'ping', 'poster',\n 'cite', 'codebase', 'manifest', 'icon', 'background'\n]\n\nconst sanitizeAttribute = (key, value, tagName) => {\n if (globalDisable) return { allowed: true, value }\n\n const k = String(key).toLowerCase()\n const tag = String(tagName || '').toUpperCase()\n\n // Event-handler attributes are never legitimate in SpyneJS —\n // broadcastEvents is the declared mechanism for interactivity.\n if (k.startsWith('on')) {\n return { allowed: false, value }\n }\n\n // srcdoc is a full HTML document; sanitize it as one.\n if (k === 'srcdoc') {\n const cfg = buildModeConfig(resolveDefaultMode())\n return { allowed: true, value: DOMPurify.sanitize(String(value), cfg) }\n }\n\n // Iframe src follows the iframe policy: https-only, plus the\n // configured origin allowlist.\n if (tag === 'IFRAME' && k === 'src') {\n return { allowed: isAllowedIframeSrc(value, configuredIframePolicy), value }\n }\n\n // Anchor href follows the anchor policy: safe scheme, plus the\n // configured domain allowlist for cross-origin destinations.\n if (tag === 'A' && k === 'href') {\n if (isSafeUri(value) !== true) return { allowed: false, value }\n if (configuredAnchorPolicy.allowedDomains.length > 0 && isAllowedAnchorHref(value, configuredAnchorPolicy) !== true) {\n return { allowed: false, value }\n }\n return { allowed: true, value }\n }\n\n if (URL_ATTRS.includes(k) && isSafeUri(value) !== true) {\n return { allowed: false, value }\n }\n\n return { allowed: true, value }\n}\n\n/**\n * Applies the configured iframe and anchor policies to an element created\n * through the attribute channel (DomElement), mirroring the DOMPurify\n * hooks that guard parsed HTML.\n */\nconst applyElementHardening = (el) => {\n if (globalDisable || !el) return el\n\n if (el.tagName === 'IFRAME') {\n const { sandbox } = configuredIframePolicy\n if (sandbox !== false && el.hasAttribute('sandbox') !== true) {\n el.setAttribute('sandbox', sandbox)\n }\n }\n\n if (el.tagName === 'A') {\n const policy = configuredAnchorPolicy\n const target = el.getAttribute('target')\n\n if (target) {\n if (policy.allowTarget !== true || !el.getAttribute('href')) {\n el.removeAttribute('target')\n } else if (SAME_CONTEXT_TARGETS.includes(target) !== true && policy.addNoopener === true) {\n forceNoopenerRel(el)\n }\n }\n }\n\n return el\n}\n\n/* ---------------------------------------------\n * Event-target sanitizer\n * ------------------------------------------- */\nconst sanitizeEventTarget = (el, mode) => {\n if (!el || globalDisable) return\n const effectiveMode = mode || resolveDefaultMode()\n const sanitizeStr = makeSanitizeFn(effectiveMode)\n const UNSAFE_RE = /<(?:script|object|embed|form|input|button|link|meta)[^>]*>|on\\w+=|javascript:/i\n if (typeof el.value === 'string' && UNSAFE_RE.test(el.value)) {\n const clean = sanitizeStr(el.value)\n if (clean !== el.value) el.value = clean\n }\n if (el.isContentEditable && typeof el.innerHTML === 'string' && UNSAFE_RE.test(el.innerHTML)) {\n const clean = sanitizeStr(el.innerHTML)\n if (clean !== el.innerHTML) el.innerHTML = clean\n }\n}\n\n/* ---------------------------------------------\n * @deprecated Use sanitizeData(data, { mode: 'app' }) per call, or set\n * config.mode at SpyneApp.init. Retained for backward compatibility.\n * ------------------------------------------- */\nconst setSanitizeDataForceStrict = (bool = true) => {\n spyneWarn('SPYNE DEPRECATION: setSanitizeDataForceStrict is deprecated. Pass { mode: \"app\" } to sanitizeData, or set config.mode in SpyneApp.init.')\n forceStrict = !!bool\n}\n\nexport {\n sanitizeDataConfigure,\n sanitizeData,\n sanitizeDataForce,\n sanitizeAttribute,\n applyElementHardening,\n allowCustomElements,\n CUSTOM_ELEMENT_HANDLING as customElementHandling,\n sanitizeEventTarget,\n setSanitizeDataForceStrict\n}\nexport default sanitizeData\n","import DOMPurify from 'dompurify'\nimport { spyneWarn } from './spyne-warn.js'\nimport { customElementHandling } from './sanitize-data.js'\n\nlet _sanitizeHTML\nlet isConfigured = false\n\n/**\n * Configures the template-layer sanitizer.\n *\n * Sanitization is always on. The three-level posture:\n *\n * mode: 'app' (default) — DOMPurify with its standard allowlist\n * mode: 'richtext' — additionally admits iframe/link (+ sandbox attr)\n * so CMS/authoring content survives templates\n * strict: true — additionally registers a Trusted Types 'default'\n * policy so DOM sinks route through sanitization\n * disableSanitize: true — the only full passthrough; logs a security warning\n */\nconst sanitizeHTMLConfigure = (config = {}) => {\n if (isConfigured) {\n spyneWarn('sanitizeHTML is already configured. Reconfiguration is not allowed.')\n return\n }\n\n const {\n strict = false,\n mode = 'app',\n disableSanitize = false,\n allowTargetAttr = true,\n debug = false,\n iframes = {},\n anchors = {}\n } = config\n\n if (disableSanitize === true) {\n console.warn('SPYNE SECURITY WARNING: All HTML sanitization is DISABLED via config.disableSanitize. Do not use this setting in production.')\n _sanitizeHTML = (html) => html\n isConfigured = true\n return\n }\n\n const isRichtext = ['richtext', 'authoring', 'development'].includes(mode)\n\n // Iframe admission follows config.iframes.allow when set; otherwise\n // the mode default (richtext yes, app no). The DOMPurify hook added by\n // sanitize-data enforces src origin and sandbox policy on whatever\n // is admitted here.\n const allowIframe = iframes.allow !== undefined ? iframes.allow === true : isRichtext\n\n // config.anchors.allowTarget wins; the legacy top-level allowTargetAttr\n // key is honored as a fallback. Target values and noopener enforcement\n // are handled by the anchor hook registered in sanitize-data, which\n // applies to this layer's sanitization as well.\n const allowTarget = anchors.allowTarget !== undefined ? anchors.allowTarget === true : allowTargetAttr === true\n\n const domPurifyConfig = {\n RETURN_TRUSTED_TYPE: false,\n ADD_TAGS: [\n ...(allowIframe ? ['iframe'] : []),\n ...(isRichtext ? ['link'] : [])\n ],\n ADD_ATTR: [\n ...(allowTarget ? ['target', 'rel'] : []),\n ...(allowIframe ? ['sandbox'] : [])\n ],\n // Admits the framework's spyne-* elements (CMS proxy wrappers) and any\n // elements registered via allowCustomElements/config.customElements.\n // The tag check is a closure, so late plugin registration is honored.\n CUSTOM_ELEMENT_HANDLING: customElementHandling,\n ...(allowIframe !== true && isRichtext ? { FORBID_TAGS: ['iframe'] } : {})\n }\n\n const sanitizeWithPolicy = (html) => DOMPurify.sanitize(html, domPurifyConfig)\n\n _sanitizeHTML = sanitizeWithPolicy\n\n if (strict === true && window.trustedTypes) {\n try {\n const policy = window.trustedTypes.createPolicy('default', {\n createHTML: (toEscape) => sanitizeWithPolicy(toEscape)\n })\n\n _sanitizeHTML = (html) => policy.createHTML(html)\n\n if (debug === true) {\n console.log('SPYNE: Trusted Types default policy registered. Note that browser enforcement additionally requires the CSP header: require-trusted-types-for \\'script\\'.')\n }\n } catch (err) {\n spyneWarn('SPYNE WARNING: A Trusted Types \"default\" policy already exists on this page. Falling back to direct sanitization.', err)\n }\n }\n\n isConfigured = true\n}\n\nconst sanitizeHTML = (html) => {\n if (!isConfigured) {\n throw new Error('sanitizeHTML is not configured. Call sanitizeHTMLConfigure() with appropriate config.')\n }\n return _sanitizeHTML(html)\n}\n\nexport { sanitizeHTMLConfigure }\nexport default sanitizeHTML\n","import { includes, __, ifElse, path, prop, reject, is, isNil, isEmpty } from 'ramda'\nimport sanitizeHTML from '../utils/sanitize-html.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\n\n/**\n * DomElementTemplate\n *\n * Mustache-compatible template engine used by ViewStream and DomElement for HTML rendering.\n *\n * Supported syntax:\n * {{key}} variable interpolation, HTML-escaped\n * {{key.path.to.value}} dot-notation property access\n * {{#key}}...{{/key}} array/object sections\n * {{.}} current element inside a loop\n * {{#}}...{{/}} top-level bare array (passed as `data`)\n *\n * Nesting:\n * DomElementTemplate supports exactly ONE level of nested array sections.\n * A template like {{#rows}}...{{#cells}}...{{/cells}}...{{/rows}} is supported.\n * Deeper nesting — {{#a}}{{#b}}{{#c}}...{{/c}}{{/b}}{{/a}} — is NOT supported.\n *\n * When a template has deeper nesting, a warning is logged in debug mode and\n * the third-level loop is not processed. This is a deliberate design choice:\n * deep hierarchical rendering belongs in nested ViewStreams, not in templates.\n * Nested ViewStreams provide proper lifecycle semantics, isolated rendering,\n * and clearer architectural boundaries than arbitrarily-nested templates.\n *\n * Not currently supported in nested loops:\n * - CMS proxy metadata (__cms__dataId, __cms__keyFor_*). Inner-loop CMS\n * editing is a future enhancement; until then, content inside an inner\n * loop is rendered as read-only from the CMS perspective.\n */\nexport class DomElementTemplate {\n constructor(template, data = {}, opts = {}) {\n this.template = this.formatTemplate(template)\n this.isProxyData = data.__cms__isProxy === true\n this.testMode = opts?.testMode\n\n // CMS lineage pass — construction-time only, and only in authoring mode.\n // In production (enableCMSProxies false) this costs one boolean read;\n // nothing here ever runs inside the substitution loops.\n if (this.isProxyData === false && SpyneAppProperties.enableCMSProxies === true) {\n const rehydrated = SpyneAppProperties.rehydrateCmsData?.(data)\n if (rehydrated !== undefined) {\n // a stripped clone was re-identified — render with the revived proxy\n data = rehydrated\n this.isProxyData = true\n } else if (DomElementTemplate.templateBindsProxiedChild(data, this.template) === true) {\n // plain wrapper holding proxied values (e.g. a pageData container),\n // AND this template actually references one of those proxied children\n // via a dot-path or loop token — only then is CMS wrapping useful.\n // Flipping on child presence alone put ~40% of all templates through\n // the wrap→inflate→sanitize→strip pipeline for zero bindings.\n this.isProxyData = true\n } else if (SpyneAppProperties.debug === true) {\n SpyneAppProperties.warnUnproxiedCmsData?.(data, this.template)\n }\n }\n\n // Normalize triple-bracket tags to double-bracket.\n //\n // DomElementTemplate treats {{{key}}} as an alias for {{key}} — both\n // interpolate the value as-is. Mustache's convention of \"triple-bracket\n // means unescaped\" doesn't apply here because SpyneJS handles escaping\n // and sanitization through `sanitize-data` (keyed on SpyneApp mode)\n // before values reach the template, not through syntax-level escaping.\n //\n // We accept triple-bracket syntax so that authors and AI familiar with\n // standard Mustache don't have their templates silently break when they\n // reach for {{{key}}} out of habit. The normalization happens once here,\n // so the rest of the engine only ever reasons about double-bracket tags.\n this.template = DomElementTemplate.normalizeTripleBrackets(this.template)\n\n if (this.isProxyData === true) {\n const proxyFormatter = SpyneAppProperties.enableCMSProxies === true\n ? SpyneAppProperties.formatTemplateForProxyData\n : DomElementTemplate.formatTemplateForProxyData\n\n if (typeof proxyFormatter === 'function') {\n this.template = proxyFormatter(this.template)\n }\n }\n\n const checkForArrayData = () => {\n if (is(Array, data) === true) {\n data = { spyneData:data }\n this.template = this.template.replace('{{/}}', '{{/spyneData}}')\n this.template = this.template.replace('{{#}}', '{{#spyneData}}')\n }\n }\n\n checkForArrayData()\n\n this.templateData = data\n\n // Stash used by per-iteration substitution so that CMS proxy lookups\n // for string-array items (where __cms__dataId / __cms__keyFor_* live on\n // the PARENT array, not on the individual string elements) can find the\n // parent object at render time. Set by parseTheTmplLoop, cleared when\n // that loop completes.\n this.currentOuterLoopData = null\n\n const strArr = DomElementTemplate.getStringArray(this.template)\n\n let strMatches = this.template.match(DomElementTemplate.findTmplLoopsRE())\n strMatches = strMatches === null ? [] : strMatches\n\n const parseTmplLoopsRE = DomElementTemplate.parseTmplLoopsRE()\n\n const parseTmplLoopFn = this.parseTheTmplLoop.bind(this)\n\n const mapTmplLoop = (str) => {\n return str.replace(parseTmplLoopsRE, parseTmplLoopFn)\n }\n\n const findTmplLoopsPred = includes(__, strMatches)\n const checkForMatches = ifElse(\n findTmplLoopsPred,\n mapTmplLoop,\n this.addParams.bind(this))\n\n this.finalArr = strArr.map(checkForMatches)\n }\n\n static isPrimitiveTag(str) {\n return /({{\\.\\*?}})/.test(str)\n }\n\n /**\n * Shallow, one-level scan for CMS-proxied values inside a plain container,\n * bailing on the first hit. Lets wrappers that hold proxied content (a\n * pageData object, a filtered array of proxied stories) opt in to CMS\n * template wrapping even though the wrapper itself is not a proxy.\n * Only ever called in authoring mode (enableCMSProxies true).\n */\n /**\n * Wrapper detection with a binding test: returns true only when data holds\n * a proxied child under a key that the template actually references via a\n * dot-path ({{key.prop}}) or loop ({{#key}} / {{#key.path}}) token. A\n * template that never reaches into the proxied child gains nothing from\n * CMS wrapping — its own top-level tokens have no dataId to bind — so\n * flipping it into proxy mode only pays the wrap/sanitize/strip pipeline.\n */\n static templateBindsProxiedChild(data, template) {\n if (data === null || typeof data !== 'object' || typeof template !== 'string') {\n return false\n }\n if (template.indexOf('{{') === -1) {\n return false\n }\n const keys = Object.keys(data)\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n const val = data[key]\n if (val !== null && typeof val === 'object' && val.__cms__isProxy === true) {\n if (template.indexOf(`{{${key}.`) !== -1 ||\n template.indexOf(`{{#${key}}}`) !== -1 ||\n template.indexOf(`{{#${key}.`) !== -1) {\n return true\n }\n }\n }\n return false\n }\n\n static hasProxiedChild(data) {\n if (data === null || typeof data !== 'object') {\n return false\n }\n const values = Object.values(data)\n for (let i = 0; i < values.length; i++) {\n const val = values[i]\n if (val !== null && typeof val === 'object' && val.__cms__isProxy === true) {\n return true\n }\n }\n return false\n }\n\n /**\n * Normalizes triple-bracket tags to double-bracket form.\n *\n * {{{key}}} → {{key}}\n * {{{a.b.c}}} → {{a.b.c}}\n * {{{.}}} → {{.}}\n * {{{.*}}} → {{.*}}\n *\n * Section markers {{#key}} and {{/key}} are already two-bracket by\n * convention and are not affected. Tags of the wrong shape (unbalanced,\n * four or more brackets, etc.) are left untouched — anything the main\n * parser doesn't recognize later will render as literal text, which is\n * the correct failure mode for a logic-less template engine.\n *\n * This exists because DomElementTemplate treats {{{key}}} and {{key}}\n * as interchangeable — sanitization and escaping are config-driven\n * through `sanitize-data`, not syntax-driven through bracket count.\n * Normalizing at construction time means the rest of the engine (loop\n * regexes, CMS proxy wrapping, variable substitution) only reasons\n * about one bracket style.\n */\n static normalizeTripleBrackets(template) {\n if (typeof template !== 'string' || template.indexOf('{{{') === -1) {\n return template\n }\n // Match balanced triple-brackets containing anything that isn't a\n // brace character. Keeps the captured inner content, strips the\n // outer third brace on each side.\n return template.replace(/\\{\\{\\{([^{}]+?)\\}\\}\\}/g, '{{$1}}')\n }\n\n // FIND CORRECT NESTED DATA\n static getNestedDataReducer(data = {}, param = '') {\n const dataReducer = (nestedData, str) => {\n if (nestedData[str]) {\n return nestedData[str]\n }\n return typeof nestedData === 'string' ? nestedData : ''\n }\n\n return /(\\.)/gm.test(String(param)) ? String(param).split('.').reduce(dataReducer, data) : data[param] ?? ''\n }\n\n static getStringArray(template) {\n const strArr = template.split(DomElementTemplate.findTmplLoopsRE())\n const emptyRE = /^([\\\\n\\s\\W]+)$/\n // findTmplLoopsRE has TWO capture groups (the full loop match, and the\n // \\2-backreferenced key name). When used with String.prototype.split, the\n // second group is emitted into the result array as a leaked chunk.\n //\n // The chunks arrive in a predictable 3-step cycle:\n // index 0: pre-text before the first loop\n // index 1: full match the loop (keep)\n // index 2: group-2 leak the loop's key name (discard)\n // index 3: between-loops text\n // index 4: full match\n // index 5: group-2 leak\n // ...\n // So any index i where i >= 2 and (i - 2) % 3 === 0 is a key-name leak\n // that should not flow into the render pipeline.\n const withoutLeaks = strArr.filter((_, i) => !(i >= 2 && (i - 2) % 3 === 0))\n const filterOutEmptyStrings = s => s.match(emptyRE)\n const finalStr = reject(filterOutEmptyStrings, withoutLeaks)\n\n return finalStr\n }\n\n /**\n * Regex that finds top-level loop sections, pairing each opening tag with a\n * closing tag of the SAME NAME via the \\2 backreference. This is what makes\n * {{#rows}}<tr>{{#cells}}<td>{{.}}</td>{{/cells}}</tr>{{/rows}} match as a\n * single outer loop rather than getting truncated at the inner {{/cells}}.\n */\n static findTmplLoopsRE() {\n return /({{#([\\w.]+)}}[\\w\\n\\s\\W]+?{{\\/\\2}})/gm\n }\n\n static parseTmplLoopsRE() {\n return /({{#([\\w.]+)}})([\\w\\n\\s\\W]+?)({{\\/\\2}})/gm\n }\n\n /**\n * Regex for finding a single inner loop inside an outer loop's body.\n * Identical in form to parseTmplLoopsRE, but created fresh to avoid\n * shared-lastIndex bugs with global regexes when used in .replace callbacks.\n */\n static innerLoopRE() {\n return /({{#([\\w.]+)}})([\\w\\n\\s\\W]+?)({{\\/\\2}})/gm\n }\n\n static swapParamsForTagsRE() {\n return /({{)(.*?)(}})/gm\n }\n\n /**\n * Detects whether a template body contains any {{#key}}...{{/key}} pair.\n * Used to decide whether the inner-loop pass is needed, and to detect\n * two-level nesting for warning purposes.\n */\n static hasLoop(str) {\n return DomElementTemplate.innerLoopRE().test(str)\n }\n\n removeThis() {\n if (this !== undefined) {\n this.finalArr = undefined\n this.templateData = undefined\n this.template = undefined\n }\n }\n\n /**\n * @desc Returns a document fragment generated from the template and any added data.\n */\n /**\n * Unwraps <spyne-cms-item> elements whose data-cms-id resolved to an empty\n * string — tokens that live on a plain wrapper (no __cms__dataId) rather\n * than on CMS content. Leaves their inner text in place, so the rendered\n * DOM matches what a non-CMS render would produce. Only runs in authoring\n * mode (isProxyData true), one pass over the final HTML string.\n */\n static stripInertCmsItems(html) {\n if (html.indexOf('data-cms-id=\"\"') === -1) {\n return html\n }\n const inertRE = /<spyne-cms-item data-cms-id=\"\"[^>]*>[\\s\\S]*?<spyne-cms-item-text>([\\s\\S]*?)<\\/spyne-cms-item-text>\\s*<\\/spyne-cms-item>/g\n return html.replace(inertRE, '$1')\n }\n\n renderDocFrag() {\n let html = DomElementTemplate.replaceImgPath(this.finalArr.join(''))\n if (this.isProxyData === true) {\n html = DomElementTemplate.stripInertCmsItems(html)\n }\n if (this.testMode !== true) {\n html = sanitizeHTML(html)\n }\n const isTableSubTag = /^([^>]*?)(<){1}(\\b)(thead|col|colgroup|tbody|td|tfoot|tr|th)(\\b)([^\\0]*)$/.test(html)\n const el = isTableSubTag ? html : document.createRange().createContextualFragment(html)\n\n window.setTimeout(this.removeThis, 2)\n return el\n }\n\n renderToString() {\n let html = this.finalArr.join('')\n html = DomElementTemplate.replaceImgPath(html)\n if (this.isProxyData === true) {\n html = DomElementTemplate.stripInertCmsItems(html)\n }\n if (this.testMode !== true) {\n // String(...) unwraps TrustedHTML when strict mode is active,\n // keeping this method's string contract.\n html = String(sanitizeHTML(html))\n }\n window.setTimeout(this.removeThis, 2)\n return html\n }\n\n getTemplateString() {\n return this.finalArr.join('')\n }\n\n formatTemplate(template) {\n return ['SCRIPT', 'TEMPLATE'].includes(prop('nodeName', template)) === true ? template.innerHTML : template\n }\n\n getDataValFromPathStr(pathStr, dataFile) {\n const pathArr = String(pathStr).split('.')\n const pathData = path(pathArr, dataFile)\n return pathData || ''\n }\n\n addParams(str) {\n const replaceTags = (str, p1, p2, p3) => {\n return DomElementTemplate.getNestedDataReducer(this.templateData, p2)\n }\n return str.replace(DomElementTemplate.swapParamsForTagsRE(), replaceTags)\n }\n\n static replaceImgPath(templateStr) {\n const { IMG_PATH } = SpyneAppProperties\n if (IMG_PATH !== undefined) {\n templateStr = templateStr.replaceAll(/src\\s*=\\s*(['\"])imgs\\//g, `src=$1${IMG_PATH}`)\n return templateStr.replaceAll(/url\\(\\s*(['\"]?)imgs\\//g, `url($1${IMG_PATH}`)\n }\n return templateStr\n }\n\n /**\n * Resolves a single inner loop (one level down) inside an outer-loop body,\n * using `parentItem` as the data context. If the inner body itself contains\n * another loop, a debug-mode warning is logged and that deeper loop is not\n * processed.\n *\n * Returns the body string with any inner loop expanded, ready for\n * outer-level variable substitution.\n */\n processInnerLoop(bodyStr, parentItem) {\n const innerRE = DomElementTemplate.innerLoopRE()\n\n return bodyStr.replace(innerRE, (fullMatch, openTag, innerKey, innerBody /*, closeTag */) => {\n // Detect disallowed second-level nesting inside the inner body.\n if (DomElementTemplate.hasLoop(innerBody) === true) {\n if (SpyneAppProperties.debug === true && this.testMode !== true) {\n console.warn(\n 'Spyne Warning: DomElementTemplate supports one level of nested array loops. ' +\n `A deeper nested loop was detected inside \"{{#${innerKey}}}\". ` +\n 'Consider restructuring via nested ViewStreams instead.'\n )\n }\n // Strip unsupported deeper-level section tags so they don't emit as\n // garbled variables during substitution below.\n innerBody = innerBody.replace(/{{[#/][\\w.]+}}/g, '')\n }\n\n const innerData = DomElementTemplate.getNestedDataReducer(parentItem, innerKey)\n\n if (isNil(innerData) === true || isEmpty(innerData)) {\n return ''\n }\n\n const innerArr = Array.isArray(innerData) ? innerData : [innerData]\n\n // While processing an inner loop, the \"outer\" data for CMS string-item\n // lookups is the current innerData (the array/object the inner items\n // belong to), not the original outer-loop array. Swap it in, restore\n // when the inner pass completes.\n const previousOuter = this.currentOuterLoopData\n this.currentOuterLoopData = innerData\n\n const rendered = innerArr.map((innerItem, innerIdx) => {\n return this.substituteForItem(innerBody, innerItem, innerIdx)\n }).join('')\n\n this.currentOuterLoopData = previousOuter\n return rendered\n })\n }\n\n /**\n * Substitutes {{...}} variables in `str` using `item` as the data context.\n *\n * Three cases:\n *\n * 1. String item + primitive {{.}}/{{.*}} template:\n * direct text substitution (no CMS wrapping possible — this path only\n * runs when formatTemplateForProxyData has NOT wrapped the tag).\n *\n * 2. String item + non-primitive template:\n * can happen two ways: (a) a section iterating strings where\n * formatTemplateForProxyData has replaced {{.}}/{{.*}} with\n * {{spyneLoopKey}} + {{origKey}} inside a <spyne-cms-item> wrapper,\n * or (b) a non-proxy template with positional tokens only.\n * Build a context that satisfies both — spyneLoopKey = the string,\n * plus __cms__dataId / origKey looked up on the parent array when\n * proxy data is active.\n *\n * 3. Object item:\n * the conventional path — build a lookup object with the item's\n * properties plus positional tokens, substitute by property name\n * or dot-path.\n */\n substituteForItem(str, item, index) {\n // Case 1: string item with a primitive-tag template.\n if (typeof item === 'string') {\n if (DomElementTemplate.isPrimitiveTag(str)) {\n const escaped = item.replace(/\\$/g, '$$$$') // $ -> $$ for replace() literal safety\n return str.replace(DomElementTemplate.swapParamsForTagsRE(), escaped)\n }\n\n // Case 2: string item with a non-primitive template.\n const ctx = this.buildStringItemContext(item, index)\n return this.substituteObject(str, ctx)\n }\n\n // Case 3: object item.\n const dataObj = this.buildItemContext(item, index)\n return this.substituteObject(str, dataObj)\n }\n\n /**\n * Builds the per-iteration lookup context for a STRING item.\n *\n * Always includes:\n * - spyneLoopKey: the string itself (matches the CMS proxy wrapping,\n * which replaces {{.}}/{{.*}} inside string loops with {{spyneLoopKey}})\n * - loopIndex / loopNum: positional tokens\n *\n * When proxy data is active, additionally includes:\n * - __cms__dataId: the CMS identifier for the PARENT array (the string\n * items themselves are primitives and don't carry the id)\n * - origKey: the original key the CMS uses to address this specific\n * string within its parent, looked up via __cms__keyFor_<item>\n */\n buildStringItemContext(item, index) {\n const context = {\n spyneLoopKey: item,\n loopIndex: index,\n loopNum: index + 1\n }\n\n if (this.isProxyData === true) {\n const outerData = this.currentOuterLoopData\n if (outerData && typeof outerData === 'object') {\n context.__cms__dataId = outerData.__cms__dataId || ''\n const keyIdStr = `__cms__keyFor_${item}`\n context.origKey = outerData[keyIdStr] !== undefined ? outerData[keyIdStr] : ''\n } else {\n context.__cms__dataId = ''\n context.origKey = ''\n }\n }\n\n return context\n }\n\n /**\n * Builds the per-iteration lookup context for an OBJECT item, including\n * CMS-proxy metadata when this template is rendering proxied data.\n */\n buildItemContext(item, index) {\n const context = Object.assign({}, item, {\n loopIndex: index,\n loopNum: index + 1\n })\n\n if (this.isProxyData === true) {\n context.__cms__dataId = item.__cms__dataId\n context.spyneLoopKey = item\n context.loopIndex = index\n context.loopNum = index + 1\n }\n\n return context\n }\n\n /**\n * Replaces {{key}} and {{a.b.c}} tokens in `str` using `ctx` as the source.\n */\n substituteObject(str, ctx) {\n const reDot = /(\\.)/gm\n const positional = { loopIndex: ctx.loopIndex, loopNum: ctx.loopNum }\n\n const replacer = (match, p1, p2) => {\n // Auto-injected positional tokens take precedence\n if (positional[p2] !== undefined) return positional[p2]\n\n // Simple key access\n if (reDot.test(p2) === false && ctx[p2] !== undefined) {\n return ctx[p2]\n }\n\n // Dot-path access\n return this.getDataValFromPathStr(p2, ctx)\n }\n\n return str.replace(DomElementTemplate.swapParamsForTagsRE(), replacer)\n }\n\n /**\n * Entry point for each top-level loop match. Extracts loop data, runs the\n * inner-loop pass on the body for each iteration, then substitutes outer\n * variables.\n */\n parseTheTmplLoop(str, p1, p2, p3) {\n const outerBody = p3\n const elData = DomElementTemplate.getNestedDataReducer(this.templateData, p2)\n\n if (isNil(elData) === true || isEmpty(elData)) {\n return ''\n }\n\n // Stash the outer data so that per-iteration substitution can look up\n // CMS proxy metadata (__cms__dataId, __cms__keyFor_*) that lives on the\n // parent array object — not on individual string elements.\n const previousOuter = this.currentOuterLoopData\n this.currentOuterLoopData = elData\n\n const elArr = Array.isArray(elData) ? elData : [elData]\n\n // Whether the outer body contains an inner loop is cheap to test and lets\n // us skip the inner-loop processing entirely for the common single-level case.\n const bodyHasInnerLoop = DomElementTemplate.hasLoop(outerBody)\n\n const rendered = elArr.map((item, index) => {\n const body = bodyHasInnerLoop\n ? this.processInnerLoop(outerBody, item)\n : outerBody\n\n return this.substituteForItem(body, item, index)\n }).join('')\n\n this.currentOuterLoopData = previousOuter\n return rendered\n }\n}\n","import { baseCoreMixins } from '../utils/mixins/base-core-mixins.js'\nimport { spyneWarn } from '../utils/spyne-warn.js'\nimport { DomElementTemplate } from './dom-element-template.js'\nimport { deepMerge } from '../utils/deep-merge.js'\nimport { sanitizeAttribute, applyElementHardening } from '../utils/sanitize-data.js'\nimport { is, defaultTo, pick, mapObjIndexed, forEachObjIndexed, pipe } from 'ramda'\n\nclass DomElement {\n /**\n * @module DomElement\n * @type util\n *\n * @desc\n * <p>This is the ViewStream rendering engine.</p>\n * <p>This is the recommended process for creating HTMLElements that do not require the logic and overhead of a ViewStream instance.</p>\n * <button class='modal-btn btn btn-blue-ref' data-type='modal-window' data-num=800 data-value='attributes'>View Attributes</button>\n *\n * @constructor\n * @param {string} tagName the tagname for this dom element.\n * @param {object} attributes any domElement attribute (except for class )\n * @param {string|object} data string for text tags and json for templates\n * @param {template} template\n * @property {String} props.tagName - = 'div'; Default for tagName.\n * @property {Object} props.attributes - = {}; This can be any valid HTML attribute for the given tagName.\n * @property {String|Object} props.data = undefined; This is either a String for an element or JSON data object for a template.\n * @property {String|HTML} props.template = undefined; If a template is defined, the DomElement will use it.\n *\n */\n\n constructor(props = {}, testMode = false) {\n const checkDefault = (dflt, val) => defaultTo(dflt)(val)\n\n props.tagName = checkDefault('div', props.tagName)\n\n props.attributes = props.attributes !== undefined ? props.attributes : this.getDomAttributes(props)\n props.attrs = this.updateAttrs(props.attributes)\n\n props.fragment = document.createDocumentFragment()\n this.testMode = testMode\n this.props = props\n\n this.addMixins()\n }\n\n setProp(key, val) {\n this.props[key] = val\n }\n\n getProp(val) {\n return this.props[val]\n }\n\n get el() {\n return this.props.el\n }\n\n setElAttrs(el, params) {\n const testMode = this.testMode === true\n const addAttributes = (val, key) => {\n const addToDataset = (val, key) => { el.dataset[key] = val }\n if (key === 'dataset') {\n // Dataset values are inert text and are the framework's payload\n // surface; they are applied as-is.\n forEachObjIndexed(addToDataset, val)\n return\n }\n\n if (testMode !== true) {\n const { allowed, value } = sanitizeAttribute(key, val, el.tagName)\n if (allowed !== true) {\n spyneWarn(`SPYNE WARNING: The attribute \"${key}\" was removed during sanitization.`, el)\n return\n }\n val = value\n }\n\n el.setAttribute(key, val)\n }\n this.getProp('attrs').forEach(addAttributes)\n\n if (testMode !== true) {\n applyElementHardening(el)\n }\n\n return el\n }\n\n updateAttrs(params, m) {\n const theMap = m !== undefined ? m : new Map()\n const addAttributes = (val, key) => theMap.set(key, val)\n mapObjIndexed(addAttributes, params)\n return theMap\n }\n\n addTemplate(el) {\n const template = this.getProp('template')\n\n const addTmpl = (template) => {\n let data = this.getProp('data')\n data = is(Object, data) ? data : {}\n const frag = new DomElementTemplate(template, data, { testMode: this?.testMode }).renderDocFrag()\n const fragIsString = is(String, frag)\n fragIsString ? el.innerHTML = frag : el.appendChild(frag)\n return el\n }\n const doNothing = (el) => el\n return template !== undefined ? addTmpl(template) : doNothing(el)\n }\n\n createElement(tagName = 'div') {\n return document.createElement(tagName)\n }\n\n addContent(el) {\n const text = (this.getProp('data'))\n const isText = is(String, text)\n if (isText === true) {\n const txt = document.createTextNode(text)\n el.appendChild(txt)\n }\n return el\n }\n\n execute() {\n const el = pipe(\n this.createElement.bind(this),\n this.setElAttrs.bind(this),\n this.addTemplate.bind(this),\n this.addContent.bind(this)\n )(this.getProp('tagName'))\n // this.getProp('fragment').appendChild(el);\n this.props.el = el\n }\n\n /**\n * This method will render the HTML Element\n * @returns {HTMLElement} HTMLElement\n */\n render() {\n this.execute()\n this.props.template = undefined\n this.props.data = undefined\n this.props.attributes = undefined\n return this.getProp('el')\n }\n\n renderToHTMLString() {\n this.execute()\n this.props.template = undefined\n this.props.data = undefined\n this.props.attributes = undefined\n return this.getProp('el').outerHTML\n }\n\n returnIfDefined(obj, val) {\n if (val !== undefined) {\n const isObj = typeof (val) === 'undefined'\n isObj === false ? obj[val] = val : obj[val] = deepMerge(obj[val], val)\n }\n }\n\n updateprops(val) {\n this.returnIfDefined(this.props, val)\n return this\n }\n\n updatepropsAndRun(val) {\n this.updateprops(val)\n this.execute()\n return this.getProp('fragment')\n }\n\n unmount() {\n if (this.props !== undefined) {\n this.getProp('el').remove()\n this.props = undefined\n this.gc()\n }\n }\n\n updateTag(tagName = 'div') { this.updateprops(tagName) }\n updateAttributes(attrs = {}) { this.updateprops(attrs) }\n updateTemplate(template) { this.updateprops(template) }\n updateData(data = {}) { this.updateprops(data) }\n addTagAndRender(tagName = 'div') { this.updatepropsAndRun(tagName) }\n addAttrsibutesAndRender(attrs = {}) { this.updatepropsAndRun(attrs) }\n addTemplateAndRender(template) { this.updatepropsAndRun(template) }\n addDataAndRender(data = {}) { this.updatepropsAndRun(data) }\n // ==================================\n // BASE CORE MIXINS\n // ==================================\n addMixins() {\n const coreMixins = baseCoreMixins()\n this.gc = coreMixins.gc.bind(this)\n }\n\n getDomAttributes(props) {\n return pick(this.attributesArray, props)\n }\n\n get attributesArray() {\n return [\n 'accept',\n 'accept-charset',\n 'accesskey',\n 'action',\n 'align',\n 'allow',\n 'alt',\n 'async',\n 'autocapitalize',\n 'autocomplete',\n 'autofocus',\n 'autoplay',\n 'bgcolor',\n 'border',\n 'buffered',\n 'challenge',\n 'charset',\n 'checked',\n 'cite',\n 'class',\n 'code',\n 'codebase',\n 'color',\n 'cols',\n 'colspan',\n 'content',\n 'contenteditable',\n 'contextmenu',\n 'controls',\n 'coords',\n 'crossorigin',\n 'csp',\n 'dataset',\n 'datetime',\n 'decoding',\n 'default',\n 'defer',\n 'dir',\n 'dirname',\n 'disabled',\n 'download',\n 'draggable',\n 'dropzone',\n 'enctype',\n 'for',\n 'form',\n 'formaction',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hreflang',\n 'http-equiv',\n 'icon',\n 'id',\n 'importance',\n 'integrity',\n 'ismap',\n 'itemprop',\n 'keytype',\n 'kind',\n 'label',\n 'lang',\n 'language',\n 'lazyload',\n 'list',\n 'loop',\n 'low',\n 'manifest',\n 'max',\n 'maxlength',\n 'minlength',\n 'media',\n 'method',\n 'min',\n 'multiple',\n 'muted',\n 'name',\n 'novalidate',\n 'open',\n 'optimum',\n 'pattern',\n 'ping',\n 'placeholder',\n 'poster',\n 'preload',\n 'radiogroup',\n 'readonly',\n 'referrerpolicy',\n 'rel',\n 'required',\n 'reversed',\n 'rows',\n 'rowspan',\n 'sandbox',\n 'scope',\n 'scoped',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'slot',\n 'span',\n 'spellcheck',\n 'src',\n 'srcdoc',\n 'srclang',\n 'srcset',\n 'start',\n 'step',\n 'style',\n 'summary',\n 'tabindex',\n 'target',\n 'title',\n 'translate',\n 'type',\n 'usemap',\n 'value',\n 'width',\n 'wrap'\n ]\n }\n}\nconst DomEl = DomElement\nexport { DomElement, DomEl }\n","const createFaderInlineText = (isInBool = false, t = 1, e = 'ease', startZeroBool = false) => {\n const initOpacityZero = startZeroBool === true ? 'opacity:0;' : ''\n const opacity = isInBool === true ? 1 : 0\n return `${initOpacityZero}transition: opacity ${t}s ${e}; opacity: ${opacity};`\n}\nexport function fadein(el, t) {\n const currentOpacity = window.getComputedStyle(el).opacity * 1\n const startAtZero = currentOpacity === 1\n const inlineCss = createFaderInlineText(true, t, 'ease', startAtZero)\n el.style.cssText += inlineCss\n}\nexport function fadeout(el, t, callback) {\n const inlineCss = createFaderInlineText(false, t, 'ease')\n el.style.cssText += inlineCss\n\n // window.setTimeout(callback, t * 1000);\n el.addEventListener('transitionend', callback, false)\n}\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","export var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n//# sourceMappingURL=isArrayLike.js.map","import { isFunction } from \"./isFunction\";\nexport function isPromise(value) {\n return isFunction(value === null || value === void 0 ? void 0 : value.then);\n}\n//# sourceMappingURL=isPromise.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","export var COMPLETE_NOTIFICATION = (function () { return createNotification('C', undefined, undefined); })();\nexport function errorNotification(error) {\n return createNotification('E', undefined, error);\n}\nexport function nextNotification(value) {\n return createNotification('N', value, undefined);\n}\nexport function createNotification(kind, value, error) {\n return {\n kind: kind,\n value: value,\n error: error,\n };\n}\n//# sourceMappingURL=NotificationFactories.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\nexport function isInteropObservable(input) {\n return isFunction(input[Symbol_observable]);\n}\n//# sourceMappingURL=isInteropObservable.js.map","import { isFunction } from './isFunction';\nexport function isAsyncIterable(obj) {\n return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);\n}\n//# sourceMappingURL=isAsyncIterable.js.map","export function createInvalidObservableTypeError(input) {\n return new TypeError(\"You provided \" + (input !== null && typeof input === 'object' ? 'an invalid object' : \"'\" + input + \"'\") + \" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.\");\n}\n//# sourceMappingURL=throwUnobservableError.js.map","export function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport var iterator = getSymbolIterator();\n//# sourceMappingURL=iterator.js.map","import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\nexport function isIterable(input) {\n return isFunction(input === null || input === void 0 ? void 0 : input[Symbol_iterator]);\n}\n//# sourceMappingURL=isIterable.js.map","import { __asyncGenerator, __await, __generator } from \"tslib\";\nimport { isFunction } from './isFunction';\nexport function readableStreamLikeToAsyncGenerator(readableStream) {\n return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {\n var reader, _a, value, done;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n reader = readableStream.getReader();\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 9, 10]);\n _b.label = 2;\n case 2:\n if (!true) return [3, 8];\n return [4, __await(reader.read())];\n case 3:\n _a = _b.sent(), value = _a.value, done = _a.done;\n if (!done) return [3, 5];\n return [4, __await(void 0)];\n case 4: return [2, _b.sent()];\n case 5: return [4, __await(value)];\n case 6: return [4, _b.sent()];\n case 7:\n _b.sent();\n return [3, 2];\n case 8: return [3, 10];\n case 9:\n reader.releaseLock();\n return [7];\n case 10: return [2];\n }\n });\n });\n}\nexport function isReadableStreamLike(obj) {\n return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);\n}\n//# sourceMappingURL=isReadableStreamLike.js.map","import { __asyncValues, __awaiter, __generator, __values } from \"tslib\";\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isPromise } from '../util/isPromise';\nimport { Observable } from '../Observable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isIterable } from '../util/isIterable';\nimport { isReadableStreamLike, readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nimport { isFunction } from '../util/isFunction';\nimport { reportUnhandledError } from '../util/reportUnhandledError';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function innerFrom(input) {\n if (input instanceof Observable) {\n return input;\n }\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromInteropObservable(input);\n }\n if (isArrayLike(input)) {\n return fromArrayLike(input);\n }\n if (isPromise(input)) {\n return fromPromise(input);\n }\n if (isAsyncIterable(input)) {\n return fromAsyncIterable(input);\n }\n if (isIterable(input)) {\n return fromIterable(input);\n }\n if (isReadableStreamLike(input)) {\n return fromReadableStreamLike(input);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\nexport function fromInteropObservable(obj) {\n return new Observable(function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (isFunction(obs.subscribe)) {\n return obs.subscribe(subscriber);\n }\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n });\n}\nexport function fromArrayLike(array) {\n return new Observable(function (subscriber) {\n for (var i = 0; i < array.length && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n });\n}\nexport function fromPromise(promise) {\n return new Observable(function (subscriber) {\n promise\n .then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, reportUnhandledError);\n });\n}\nexport function fromIterable(iterable) {\n return new Observable(function (subscriber) {\n var e_1, _a;\n try {\n for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {\n var value = iterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n subscriber.complete();\n });\n}\nexport function fromAsyncIterable(asyncIterable) {\n return new Observable(function (subscriber) {\n process(asyncIterable, subscriber).catch(function (err) { return subscriber.error(err); });\n });\n}\nexport function fromReadableStreamLike(readableStream) {\n return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));\n}\nfunction process(asyncIterable, subscriber) {\n var asyncIterable_1, asyncIterable_1_1;\n var e_2, _a;\n return __awaiter(this, void 0, void 0, function () {\n var value, e_2_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 5, 6, 11]);\n asyncIterable_1 = __asyncValues(asyncIterable);\n _b.label = 1;\n case 1: return [4, asyncIterable_1.next()];\n case 2:\n if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done)) return [3, 4];\n value = asyncIterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return [2];\n }\n _b.label = 3;\n case 3: return [3, 1];\n case 4: return [3, 11];\n case 5:\n e_2_1 = _b.sent();\n e_2 = { error: e_2_1 };\n return [3, 11];\n case 6:\n _b.trys.push([6, , 9, 10]);\n if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return))) return [3, 8];\n return [4, _a.call(asyncIterable_1)];\n case 7:\n _b.sent();\n _b.label = 8;\n case 8: return [3, 10];\n case 9:\n if (e_2) throw e_2.error;\n return [7];\n case 10: return [7];\n case 11:\n subscriber.complete();\n return [2];\n }\n });\n });\n}\n//# sourceMappingURL=innerFrom.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { __extends } from \"tslib\";\nimport { Subscription } from '../Subscription';\nvar Action = (function (_super) {\n __extends(Action, _super);\n function Action(scheduler, work) {\n return _super.call(this) || this;\n }\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n return this;\n };\n return Action;\n}(Subscription));\nexport { Action };\n//# sourceMappingURL=Action.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var intervalProvider = {\n setInterval: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = intervalProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {\n return delegate.setInterval.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearInterval: function (handle) {\n var delegate = intervalProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=intervalProvider.js.map","import { __extends } from \"tslib\";\nimport { Action } from './Action';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nvar AsyncAction = (function (_super) {\n __extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.pending = false;\n return _this;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n var _a;\n if (delay === void 0) { delay = 0; }\n if (this.closed) {\n return this;\n }\n this.state = state;\n var id = this.id;\n var scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, _id, delay) {\n if (delay === void 0) { delay = 0; }\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (_scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n return undefined;\n };\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, _delay) {\n var errored = false;\n var errorValue;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype.unsubscribe = function () {\n if (!this.closed) {\n var _a = this, id = _a.id, scheduler = _a.scheduler;\n var actions = scheduler.actions;\n this.work = this.state = this.scheduler = null;\n this.pending = false;\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n _super.prototype.unsubscribe.call(this);\n }\n };\n return AsyncAction;\n}(Action));\nexport { AsyncAction };\n//# sourceMappingURL=AsyncAction.js.map","export var dateTimestampProvider = {\n now: function () {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nvar Scheduler = (function () {\n function Scheduler(schedulerActionCtor, now) {\n if (now === void 0) { now = Scheduler.now; }\n this.schedulerActionCtor = schedulerActionCtor;\n this.now = now;\n }\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) { delay = 0; }\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n };\n Scheduler.now = dateTimestampProvider.now;\n return Scheduler;\n}());\nexport { Scheduler };\n//# sourceMappingURL=Scheduler.js.map","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport var asyncScheduler = new AsyncScheduler(AsyncAction);\nexport var async = asyncScheduler;\n//# sourceMappingURL=async.js.map","import { __extends } from \"tslib\";\nimport { Scheduler } from '../Scheduler';\nvar AsyncScheduler = (function (_super) {\n __extends(AsyncScheduler, _super);\n function AsyncScheduler(SchedulerAction, now) {\n if (now === void 0) { now = Scheduler.now; }\n var _this = _super.call(this, SchedulerAction, now) || this;\n _this.actions = [];\n _this._active = false;\n return _this;\n }\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this._active) {\n actions.push(action);\n return;\n }\n var error;\n this._active = true;\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()));\n this._active = false;\n if (error) {\n while ((action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler));\nexport { AsyncScheduler };\n//# sourceMappingURL=AsyncScheduler.js.map","import { Observable } from '../Observable';\nimport { async as asyncScheduler } from '../scheduler/async';\nimport { isScheduler } from '../util/isScheduler';\nimport { isValidDate } from '../util/isDate';\nexport function timer(dueTime, intervalOrScheduler, scheduler) {\n if (dueTime === void 0) { dueTime = 0; }\n if (scheduler === void 0) { scheduler = asyncScheduler; }\n var intervalDuration = -1;\n if (intervalOrScheduler != null) {\n if (isScheduler(intervalOrScheduler)) {\n scheduler = intervalOrScheduler;\n }\n else {\n intervalDuration = intervalOrScheduler;\n }\n }\n return new Observable(function (subscriber) {\n var due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;\n if (due < 0) {\n due = 0;\n }\n var n = 0;\n return scheduler.schedule(function () {\n if (!subscriber.closed) {\n subscriber.next(n++);\n if (0 <= intervalDuration) {\n this.schedule(undefined, intervalDuration);\n }\n else {\n subscriber.complete();\n }\n }\n }, due);\n });\n}\n//# sourceMappingURL=timer.js.map","import { isFunction } from './isFunction';\nexport function isScheduler(value) {\n return value && isFunction(value.schedule);\n}\n//# sourceMappingURL=isScheduler.js.map","export function isValidDate(value) {\n return value instanceof Date && !isNaN(value);\n}\n//# sourceMappingURL=isDate.js.map","export function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {\n if (delay === void 0) { delay = 0; }\n if (repeat === void 0) { repeat = false; }\n var scheduleSubscription = scheduler.schedule(function () {\n work();\n if (repeat) {\n parentSubscription.add(this.schedule(null, delay));\n }\n else {\n this.unsubscribe();\n }\n }, delay);\n parentSubscription.add(scheduleSubscription);\n if (!repeat) {\n return scheduleSubscription;\n }\n}\n//# sourceMappingURL=executeSchedule.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { operate } from '../util/lift';\nexport function catchError(selector) {\n return operate(function (source, subscriber) {\n var innerSub = null;\n var syncUnsub = false;\n var handledResult;\n innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, function (err) {\n handledResult = innerFrom(selector(err, catchError(selector)(source)));\n if (innerSub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n else {\n syncUnsub = true;\n }\n }));\n if (syncUnsub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n });\n}\n//# sourceMappingURL=catchError.js.map","import { executeSchedule } from '../util/executeSchedule';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function observeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return executeSchedule(subscriber, scheduler, function () { return subscriber.next(value); }, delay); }, function () { return executeSchedule(subscriber, scheduler, function () { return subscriber.complete(); }, delay); }, function (err) { return executeSchedule(subscriber, scheduler, function () { return subscriber.error(err); }, delay); }));\n });\n}\n//# sourceMappingURL=observeOn.js.map","import { operate } from '../util/lift';\nexport function subscribeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n subscriber.add(scheduler.schedule(function () { return source.subscribe(subscriber); }, delay));\n });\n}\n//# sourceMappingURL=subscribeOn.js.map","import { Observable } from '../Observable';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleAsyncIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable(function (subscriber) {\n executeSchedule(subscriber, scheduler, function () {\n var iterator = input[Symbol.asyncIterator]();\n executeSchedule(subscriber, scheduler, function () {\n iterator.next().then(function (result) {\n if (result.done) {\n subscriber.complete();\n }\n else {\n subscriber.next(result.value);\n }\n });\n }, 0, true);\n });\n });\n}\n//# sourceMappingURL=scheduleAsyncIterable.js.map","import { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isReadableStreamLike } from '../util/isReadableStreamLike';\nimport { scheduleReadableStreamLike } from './scheduleReadableStreamLike';\nexport function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n }\n if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n }\n if (isAsyncIterable(input)) {\n return scheduleAsyncIterable(input, scheduler);\n }\n if (isIterable(input)) {\n return scheduleIterable(input, scheduler);\n }\n if (isReadableStreamLike(input)) {\n return scheduleReadableStreamLike(input, scheduler);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\n//# sourceMappingURL=scheduled.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function scheduleObservable(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=scheduleObservable.js.map","import { Observable } from '../Observable';\nexport function scheduleArray(input, scheduler) {\n return new Observable(function (subscriber) {\n var i = 0;\n return scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n }\n else {\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n this.schedule();\n }\n }\n });\n });\n}\n//# sourceMappingURL=scheduleArray.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function schedulePromise(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=schedulePromise.js.map","import { Observable } from '../Observable';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from '../util/isFunction';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleIterable(input, scheduler) {\n return new Observable(function (subscriber) {\n var iterator;\n executeSchedule(subscriber, scheduler, function () {\n iterator = input[Symbol_iterator]();\n executeSchedule(subscriber, scheduler, function () {\n var _a;\n var value;\n var done;\n try {\n (_a = iterator.next(), value = _a.value, done = _a.done);\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n }\n }, 0, true);\n });\n return function () { return isFunction(iterator === null || iterator === void 0 ? void 0 : iterator.return) && iterator.return(); };\n });\n}\n//# sourceMappingURL=scheduleIterable.js.map","import { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nexport function scheduleReadableStreamLike(input, scheduler) {\n return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);\n}\n//# sourceMappingURL=scheduleReadableStreamLike.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { map } from \"../operators/map\";\nvar isArray = Array.isArray;\nfunction callOrApply(fn, args) {\n return isArray(args) ? fn.apply(void 0, __spreadArray([], __read(args))) : fn(args);\n}\nexport function mapOneOrManyArgs(fn) {\n return map(function (args) { return callOrApply(fn, args); });\n}\n//# sourceMappingURL=mapOneOrManyArgs.js.map","import { Observable } from '../Observable';\nimport { argsArgArrayOrObject } from '../util/argsArgArrayOrObject';\nimport { from } from './from';\nimport { identity } from '../util/identity';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nimport { popResultSelector, popScheduler } from '../util/args';\nimport { createObject } from '../util/createObject';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function combineLatest() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n var resultSelector = popResultSelector(args);\n var _a = argsArgArrayOrObject(args), observables = _a.args, keys = _a.keys;\n if (observables.length === 0) {\n return from([], scheduler);\n }\n var result = new Observable(combineLatestInit(observables, scheduler, keys\n ?\n function (values) { return createObject(keys, values); }\n :\n identity));\n return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;\n}\nexport function combineLatestInit(observables, scheduler, valueTransform) {\n if (valueTransform === void 0) { valueTransform = identity; }\n return function (subscriber) {\n maybeSchedule(scheduler, function () {\n var length = observables.length;\n var values = new Array(length);\n var active = length;\n var remainingFirstValues = length;\n var _loop_1 = function (i) {\n maybeSchedule(scheduler, function () {\n var source = from(observables[i], scheduler);\n var hasFirstValue = false;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n values[i] = value;\n if (!hasFirstValue) {\n hasFirstValue = true;\n remainingFirstValues--;\n }\n if (!remainingFirstValues) {\n subscriber.next(valueTransform(values.slice()));\n }\n }, function () {\n if (!--active) {\n subscriber.complete();\n }\n }));\n }, subscriber);\n };\n for (var i = 0; i < length; i++) {\n _loop_1(i);\n }\n }, subscriber);\n };\n}\nfunction maybeSchedule(scheduler, execute, subscription) {\n if (scheduler) {\n executeSchedule(subscription, scheduler, execute);\n }\n else {\n execute();\n }\n}\n//# sourceMappingURL=combineLatest.js.map","import { scheduled } from '../scheduled/scheduled';\nimport { innerFrom } from './innerFrom';\nexport function from(input, scheduler) {\n return scheduler ? scheduled(input, scheduler) : innerFrom(input);\n}\n//# sourceMappingURL=from.js.map","import { map } from './map';\nimport { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { mergeInternals } from './mergeInternals';\nimport { isFunction } from '../util/isFunction';\nexport function mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Infinity; }\n if (isFunction(resultSelector)) {\n return mergeMap(function (a, i) { return map(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom(project(a, i))); }, concurrent);\n }\n else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return operate(function (source, subscriber) { return mergeInternals(source, subscriber, project, concurrent); });\n}\n//# sourceMappingURL=mergeMap.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { executeSchedule } from '../util/executeSchedule';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {\n var buffer = [];\n var active = 0;\n var index = 0;\n var isComplete = false;\n var checkComplete = function () {\n if (isComplete && !buffer.length && !active) {\n subscriber.complete();\n }\n };\n var outerNext = function (value) { return (active < concurrent ? doInnerSub(value) : buffer.push(value)); };\n var doInnerSub = function (value) {\n expand && subscriber.next(value);\n active++;\n var innerComplete = false;\n innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, function (innerValue) {\n onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);\n if (expand) {\n outerNext(innerValue);\n }\n else {\n subscriber.next(innerValue);\n }\n }, function () {\n innerComplete = true;\n }, undefined, function () {\n if (innerComplete) {\n try {\n active--;\n var _loop_1 = function () {\n var bufferedValue = buffer.shift();\n if (innerSubScheduler) {\n executeSchedule(subscriber, innerSubScheduler, function () { return doInnerSub(bufferedValue); });\n }\n else {\n doInnerSub(bufferedValue);\n }\n };\n while (buffer.length && active < concurrent) {\n _loop_1();\n }\n checkComplete();\n }\n catch (err) {\n subscriber.error(err);\n }\n }\n }));\n };\n source.subscribe(createOperatorSubscriber(subscriber, outerNext, function () {\n isComplete = true;\n checkComplete();\n }));\n return function () {\n additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();\n };\n}\n//# sourceMappingURL=mergeInternals.js.map","var isArray = Array.isArray;\nexport function argsOrArgArray(args) {\n return args.length === 1 && isArray(args[0]) ? args[0] : args;\n}\n//# sourceMappingURL=argsOrArgArray.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { combineLatestInit } from '../observable/combineLatest';\nimport { operate } from '../util/lift';\nimport { argsOrArgArray } from '../util/argsOrArgArray';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nimport { pipe } from '../util/pipe';\nimport { popResultSelector } from '../util/args';\nexport function combineLatest() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var resultSelector = popResultSelector(args);\n return resultSelector\n ? pipe(combineLatest.apply(void 0, __spreadArray([], __read(args))), mapOneOrManyArgs(resultSelector))\n : operate(function (source, subscriber) {\n combineLatestInit(__spreadArray([source], __read(argsOrArgArray(args))))(subscriber);\n });\n}\n//# sourceMappingURL=combineLatest.js.map","import { isFunction } from './isFunction';\nimport { isScheduler } from './isScheduler';\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nexport function popResultSelector(args) {\n return isFunction(last(args)) ? args.pop() : undefined;\n}\nexport function popScheduler(args) {\n return isScheduler(last(args)) ? args.pop() : undefined;\n}\nexport function popNumber(args, defaultValue) {\n return typeof last(args) === 'number' ? args.pop() : defaultValue;\n}\n//# sourceMappingURL=args.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","import { asyncScheduler } from '../scheduler/async';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function debounceTime(dueTime, scheduler) {\n if (scheduler === void 0) { scheduler = asyncScheduler; }\n return operate(function (source, subscriber) {\n var activeTask = null;\n var lastValue = null;\n var lastTime = null;\n var emit = function () {\n if (activeTask) {\n activeTask.unsubscribe();\n activeTask = null;\n var value = lastValue;\n lastValue = null;\n subscriber.next(value);\n }\n };\n function emitWhenIdle() {\n var targetTime = lastTime + dueTime;\n var now = scheduler.now();\n if (now < targetTime) {\n activeTask = this.schedule(undefined, targetTime - now);\n subscriber.add(activeTask);\n return;\n }\n emit();\n }\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n lastValue = value;\n lastTime = scheduler.now();\n if (!activeTask) {\n activeTask = scheduler.schedule(emitWhenIdle, dueTime);\n subscriber.add(activeTask);\n }\n }, function () {\n emit();\n subscriber.complete();\n }, undefined, function () {\n lastValue = activeTask = null;\n }));\n });\n}\n//# sourceMappingURL=debounceTime.js.map","import { Observable } from '../Observable';\nexport var EMPTY = new Observable(function (subscriber) { return subscriber.complete(); });\nexport function empty(scheduler) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\nfunction emptyScheduled(scheduler) {\n return new Observable(function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });\n}\n//# sourceMappingURL=empty.js.map","import { EMPTY } from '../observable/empty';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function take(count) {\n return count <= 0\n ?\n function () { return EMPTY; }\n : operate(function (source, subscriber) {\n var seen = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n if (++seen <= count) {\n subscriber.next(value);\n if (count <= seen) {\n subscriber.complete();\n }\n }\n }));\n });\n}\n//# sourceMappingURL=take.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function filter(predicate, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return predicate.call(thisArg, value, index++) && subscriber.next(value); }));\n });\n}\n//# sourceMappingURL=filter.js.map","import { operate } from '../util/lift';\nexport function finalize(callback) {\n return operate(function (source, subscriber) {\n try {\n source.subscribe(subscriber);\n }\n finally {\n subscriber.add(callback);\n }\n });\n}\n//# sourceMappingURL=finalize.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { innerFrom } from '../observable/innerFrom';\nimport { Subject } from '../Subject';\nimport { SafeSubscriber } from '../Subscriber';\nimport { operate } from '../util/lift';\nexport function share(options) {\n if (options === void 0) { options = {}; }\n var _a = options.connector, connector = _a === void 0 ? function () { return new Subject(); } : _a, _b = options.resetOnError, resetOnError = _b === void 0 ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === void 0 ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === void 0 ? true : _d;\n return function (wrapperSource) {\n var connection;\n var resetConnection;\n var subject;\n var refCount = 0;\n var hasCompleted = false;\n var hasErrored = false;\n var cancelReset = function () {\n resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();\n resetConnection = undefined;\n };\n var reset = function () {\n cancelReset();\n connection = subject = undefined;\n hasCompleted = hasErrored = false;\n };\n var resetAndUnsubscribe = function () {\n var conn = connection;\n reset();\n conn === null || conn === void 0 ? void 0 : conn.unsubscribe();\n };\n return operate(function (source, subscriber) {\n refCount++;\n if (!hasErrored && !hasCompleted) {\n cancelReset();\n }\n var dest = (subject = subject !== null && subject !== void 0 ? subject : connector());\n subscriber.add(function () {\n refCount--;\n if (refCount === 0 && !hasErrored && !hasCompleted) {\n resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);\n }\n });\n dest.subscribe(subscriber);\n if (!connection &&\n refCount > 0) {\n connection = new SafeSubscriber({\n next: function (value) { return dest.next(value); },\n error: function (err) {\n hasErrored = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnError, err);\n dest.error(err);\n },\n complete: function () {\n hasCompleted = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnComplete);\n dest.complete();\n },\n });\n innerFrom(source).subscribe(connection);\n }\n })(wrapperSource);\n };\n}\nfunction handleReset(reset, on) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (on === true) {\n reset();\n return;\n }\n if (on === false) {\n return;\n }\n var onSubscriber = new SafeSubscriber({\n next: function () {\n onSubscriber.unsubscribe();\n reset();\n },\n });\n return innerFrom(on.apply(void 0, __spreadArray([], __read(args)))).subscribe(onSubscriber);\n}\n//# sourceMappingURL=share.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function takeWhile(predicate, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var result = predicate(value, index++);\n (result || inclusive) && subscriber.next(value);\n !result && subscriber.complete();\n }));\n });\n}\n//# sourceMappingURL=takeWhile.js.map","import { isFunction } from '../util/isFunction';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { identity } from '../util/identity';\nexport function tap(observerOrNext, error, complete) {\n var tapObserver = isFunction(observerOrNext) || error || complete\n ?\n { next: observerOrNext, error: error, complete: complete }\n : observerOrNext;\n return tapObserver\n ? operate(function (source, subscriber) {\n var _a;\n (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n var isUnsub = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var _a;\n (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);\n subscriber.next(value);\n }, function () {\n var _a;\n isUnsub = false;\n (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n subscriber.complete();\n }, function (err) {\n var _a;\n isUnsub = false;\n (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);\n subscriber.error(err);\n }, function () {\n var _a, _b;\n if (isUnsub) {\n (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n }\n (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);\n }));\n })\n :\n identity;\n}\n//# sourceMappingURL=tap.js.map","import { asyncScheduler } from '../scheduler/async';\nimport { throttle } from './throttle';\nimport { timer } from '../observable/timer';\nexport function throttleTime(duration, scheduler, config) {\n if (scheduler === void 0) { scheduler = asyncScheduler; }\n var duration$ = timer(duration, scheduler);\n return throttle(function () { return duration$; }, config);\n}\n//# sourceMappingURL=throttleTime.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nexport function throttle(durationSelector, config) {\n return operate(function (source, subscriber) {\n var _a = config !== null && config !== void 0 ? config : {}, _b = _a.leading, leading = _b === void 0 ? true : _b, _c = _a.trailing, trailing = _c === void 0 ? false : _c;\n var hasValue = false;\n var sendValue = null;\n var throttled = null;\n var isComplete = false;\n var endThrottling = function () {\n throttled === null || throttled === void 0 ? void 0 : throttled.unsubscribe();\n throttled = null;\n if (trailing) {\n send();\n isComplete && subscriber.complete();\n }\n };\n var cleanupThrottling = function () {\n throttled = null;\n isComplete && subscriber.complete();\n };\n var startThrottle = function (value) {\n return (throttled = innerFrom(durationSelector(value)).subscribe(createOperatorSubscriber(subscriber, endThrottling, cleanupThrottling)));\n };\n var send = function () {\n if (hasValue) {\n hasValue = false;\n var value = sendValue;\n sendValue = null;\n subscriber.next(value);\n !isComplete && startThrottle(value);\n }\n };\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n hasValue = true;\n sendValue = value;\n !(throttled && !throttled.closed) && (leading ? send() : startThrottle(value));\n }, function () {\n isComplete = true;\n !(trailing && hasValue && throttled && !throttled.closed) && subscriber.complete();\n }));\n });\n}\n//# sourceMappingURL=throttle.js.map","import { Subject } from 'rxjs'\nimport { filter, map } from 'rxjs/operators'\nimport { flip, mergeRight, clone, forEach, propSatisfies } from 'ramda'\nexport class ViewStreamObservable {\n constructor(props) {\n /**\n * @module ViewStreamObservable\n * @type internal\n *\n * @constructor\n * @desc\n * Internal observable that creates the ViewStream Observable that branches out to parent, internal and child directions\n */\n this.props.observableStreams = ViewStreamObservable.createDirectionalObservables()\n }\n\n static createDirectionalFiltersObject() {\n const dirInternal = 'internal'\n const dirParent = 'parent'\n const dirChild = 'child'\n return {\n P: [dirParent],\n C: [dirChild],\n PCI: [dirParent, dirInternal, dirChild],\n CI: [dirChild, dirInternal],\n PI: [dirParent, dirInternal],\n PC: [dirParent, dirChild]\n }\n }\n\n static addDefaultDir(obj) {\n const defaults = flip(mergeRight)\n return defaults({ $dir:['internal'] }, clone(obj))\n }\n\n static addDownInternalDir(obj, arr = ['internal', 'down']) {\n const defaults = flip(mergeRight)\n return defaults(clone(obj), { $dir:arr })\n }\n\n static addChildAndInternalDir(obj, arr = ['child', 'down']) {\n const defaults = flip(mergeRight)\n return defaults(clone(obj), { $dir:arr })\n }\n\n static mapToDefaultDir(p) {\n return this.addDefaultDir(p)\n }\n\n static createDirectionalObservables(obs$ = new Subject(), viewName, vsid) {\n if (viewName !== undefined && vsid !== undefined) {\n obs$.viewName = viewName\n obs$.vsid = vsid\n }\n\n const filterStreams = val => propSatisfies(arrType => arrType.includes(val), '$dir')\n const filterParent = filterStreams('parent')\n const filterChild = filterStreams('child')\n const filterInternal = filterStreams('internal')\n\n const addfrom$ = relStr => mergeRight({ from$:relStr })\n const addParentfrom$ = addfrom$('child')\n const addInternalfrom$ = addfrom$('internal')\n const addChildfrom$ = addfrom$('parent')\n\n const raw$ = obs$\n .pipe(filter((payload) => payload !== undefined && payload.action !== undefined))\n\n const toInternal$ = obs$.pipe(filter(filterInternal), map(addInternalfrom$))\n const toParent$ = obs$.pipe(filter(filterParent), map(addParentfrom$))\n const toChild$ = obs$.pipe(filter(filterChild), map(addChildfrom$))\n\n const streamObj = {\n parent: toParent$,\n internal: toInternal$,\n child: toChild$\n }\n\n const completeStream = (arr = []) => {\n const endStream = o => {\n o.complete()\n o.isStopped = true\n }\n\n const setCompleteStream = (str) => {\n if (streamObj[str] !== undefined) {\n const obs$ = streamObj[str]\n endStream(obs$)\n }\n }\n\n if (arr !== undefined && arr.length >= 1) {\n arr.forEach(setCompleteStream)\n }\n }\n const completeAll = () => {\n const completeStream = o => {\n o.complete()\n o.isStopped = true\n }\n forEach(completeStream, [raw$, toInternal$, toParent$, toChild$])\n }\n\n return {\n raw$, toInternal$, toParent$, toChild$, completeAll, completeStream\n }\n }\n}\n","import { DomElement } from './dom-element.js'\nimport { fadein, fadeout } from '../utils/viewstream-animations.js'\nimport { ViewStreamObservable } from '../utils/viewstream-observables.js'\nimport { deepMerge } from '../utils/deep-merge.js'\nimport { Subject, bindCallback } from 'rxjs'\nimport { filter, isNil, pick, props, defaultTo } from 'ramda'\n\nexport class ViewStreamElement {\n /**\n * @module ViewStreamElement\n * @type internal\n * @desc\n * This is an internal class that is part of the ViewStream observable system.\n *\n * @constructor\n * @param {Observable} sink$\n * @param {Object} viewProps\n * @param {String} vsid\n * @param {String} vsName\n *\n */\n constructor(sink$, viewProps = {}, vsid = '', vsName = 'theName') {\n this.addMixins()\n this._state = 'INIT'\n this.vsid = vsid\n this.el = viewProps.el\n this.vsName = vsName\n this.defaults = {\n debug:false,\n extendedHashMethods: {}\n }\n this.options = deepMerge(this.defaults, viewProps)\n const createExtraStatesMethod = (arr) => {\n const [action, funcStr] = arr\n this.options.extendedHashMethods[action] = (p) => this[funcStr](p)\n }\n this.addActionListeners().forEach(createExtraStatesMethod)\n this.options.hashMethods = this.setHashMethods(this.options.extendedHashMethods)\n this.sink$ = sink$\n this.sink$\n .subscribe(this.onObsSinkSubscribe.bind(this))\n\n this.$dirs = ViewStreamObservable.createDirectionalFiltersObject()\n this.addDefaultDir = ViewStreamObservable.addDefaultDir\n this.sourceStreams = ViewStreamObservable.createDirectionalObservables(new Subject(), this.vsName, this.vsid)\n this._source$ = this.sourceStreams.toInternal$ // new Subject();\n }\n\n addActionListeners() {\n return []\n }\n\n setHashMethods(extendedHashMethodsObj = {}) {\n const defaultHashMethods = {\n VS_DETRITUS_COLLECT : (p) => this.onGarbageCollect(p),\n READY_FOR_VS_DETRITUS_COLLECT : (p) => this.onReadyForGC(p),\n EXTIRPATE : (p) => this.onDispose(p),\n VS_SPAWN : (p) => this.onRender(p),\n VS_SPAWN_AND_ATTACH_TO_PARENT : (p) => this.onRenderAndAttachToParent(p),\n VS_SPAWN_AND_ATTACH_TO_DOM : (p) => this.onRenderAndAttachToDom(p),\n ATTACH_CHILD_TO_SELF : (p) => this.onAttachChildToSelf(p)\n }\n return deepMerge(defaultHashMethods, extendedHashMethodsObj)\n }\n\n createDomItem() {\n this.props = this.props !== undefined ? this.props : {}\n const removeIsNil = (val) => val !== undefined\n const attrs = filter(removeIsNil, pick(['id', 'className'], this.props))\n const { tagName, data, template } = this.props\n return new DomElement(tagName, attrs, data, template)\n }\n\n onDisposeCompleted(d) {\n // console.log('bv self disposed after animateOut ', d, this);\n }\n\n animateInTween(el, time) {\n fadein(el, time)\n }\n\n animateOutTween(el, time, callback) {\n // console.log('anim out ', {el, time, callback});\n fadeout(el, time, callback)\n }\n\n setAnimateIn(d) {\n if (d.animateIn === true) {\n const el = d.el !== undefined ? d.el : this.domItem.el\n this.animateInTween(el, d.animateInTime)\n }\n }\n\n /**\n *\n * @param {Object} d\n * @returns payload that confirms dispose\n */\n\n disposeMethod(d) {\n const el = d.el.el !== undefined ? d.el.el : d.el // DOM ITEMS HAVE THEIR EL ITEMS NESTED\n\n const gcData = { action:'READY_FOR_VS_DETRITUS_COLLECT', $dir:this.$dirs.PI, el }\n\n const animateOut = (d, callback) => {\n this.animateOutTween(el, d.animateOutTime, callback)\n }\n\n const fadeOutObs = bindCallback(animateOut)\n const onFadeoutCompleted = (e) => {\n this._source$.next(gcData)\n }\n\n const onFadeoutObs = (d) => {\n fadeOutObs(d)\n .subscribe(onFadeoutCompleted)\n return { action:'EXTIRPATING', $dir:this.$dirs.CI }\n }\n const onEmptyObs = () => ({ action:'EXTIRPATE_AND_READY_FOR_VS_DETRITUS_COLLECT', $dir:this.$dirs.CI })\n const fn = d.animateOut === true ? onFadeoutObs : onEmptyObs\n return fn(d)\n }\n\n onDispose(d) {\n return this.disposeMethod(d)\n }\n\n removeStream() {\n // this.sourceStreams.completeAll();\n if (this.sourceStreams !== undefined) {\n this.sourceStreams.completeStream(['internal', 'child'])\n }\n }\n\n onReadyForGC(p) {\n this.removeStream()\n }\n\n onGarbageCollect(p) {\n if (this.domItem !== undefined) {\n this.domItem.unmount()\n }\n\n if (this.sourceStreams !== undefined) {\n this.sourceStreams.completeStream(['parent'])\n }\n\n delete this\n }\n\n getSourceStream() {\n return this._source$\n }\n\n combineDomItems(d) {\n if (this.el !== undefined) {\n return\n }\n\n const container = isNil(d.query) ? d.node : d.query\n const prepend = (node, item) => node.insertBefore(item, node.firstChild)\n const append = (node, item) => node.appendChild(item)\n const after = (node, item) => node.after(item)\n\n const defaultFn = prepend\n const attachTypeHash = {\n appendChild : append,\n after\n }\n // DETERMINE WHETHER TO USE APPEND OR PREPEND\n // ON CONNECTING DOM ITEMS TO EACH OTHER\n // let attachFunc = d.attachType === 'appendChild' ? append : prepend;\n const attachFunc = attachTypeHash[d.attachType] || defaultFn\n attachFunc(container, this.domItem.render())\n this.setAnimateIn(d)\n }\n\n /**\n *\n * @param p\n * @returns payload to append child element to current element\n */\n\n onAttachChildToSelf(p) {\n const data = p.childRenderData\n this.combineDomItems(data)\n return {\n action: 'CHILD_ATTACHED',\n $dir: this.$dirs.PI\n }\n }\n\n /**\n *\n * @param {Object} d\n * @returns payload that attaches current child element to parent\n */\n onRenderAndAttachToParent(d) {\n this.onRender(d)\n this.combineDomItems(d)\n return {\n action: 'VS_SPAWNED_AND_ATTACHED_TO_PARENT',\n el: this.el || this.domItem.el,\n $dir: this.$dirs.PI\n }\n }\n\n renderDomItem(d) {\n const [tagName, attributes, data, template] = d\n this.domItem = new DomElement({ tagName, attributes, data, template })\n return this.domItem\n }\n\n onRender(d) {\n const getEl = (data) => this.renderDomItem(data)\n const el = this.el || getEl(props(['tagName', 'domAttributes', 'data', 'template'], d))\n return {\n action: 'VS_SPAWNED',\n el,\n $dir: this.$dirs.I\n }\n }\n\n extendedMethods(data) {\n }\n\n /**\n *\n * @param d\n * @returns\n * Payload containing the action, internal observable and element.\n */\n onRenderAndAttachToDom(d) {\n const getEl = (data) => this.renderDomItem(data)\n d.attachData.el = getEl(props(['tagName', 'domAttributes', 'data', 'template'], d))\n this.combineDomItems(d.attachData)\n return {\n action: 'VS_SPAWNED_AND_ATTACHED_TO_DOM',\n el: this.el || d.attachData.el.el,\n $dir: this.$dirs.CI\n }\n }\n\n /**\n *\n * The ViewStream directs all relevant actions to the DomElement to render and dispose of itself\n *\n * @param {Object} payload\n */\n onObsSinkSubscribe(payload) {\n const action = payload.action\n const defaultToFn = defaultTo((data) => this.extendedMethods(data))\n const fn = defaultToFn(this.options.hashMethods[action])\n const data = fn(payload)\n const sendData = (d) => this._source$.next(d)\n if (data !== undefined) {\n sendData(Object.freeze(data))\n }\n }\n\n addMixins() {\n // ==================================\n // BASE CORE MIXINS\n // ==================================\n // let coreMixins = baseCoreMixins();\n }\n}\n","import { forEach } from 'ramda'\nexport function gc() {\n const cleanup = () => {\n const loopM = m => undefined\n forEach(loopM, this)\n }\n setTimeout(cleanup, 1)\n}\n","import { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { safeClone } from '../utils/safe-clone.js'\nimport { gc } from '../utils/gc.js'\nimport {\n compose,\n clone,\n fromPairs,\n toPairs,\n is\n} from 'ramda'\n\nexport class ViewStreamPayload {\n /**\n *\n * Observables sent from ViewStreams to Channels are validated by this class\n *\n * @module ViewStreamPayload\n * @type internal\n *\n * @constructor\n * @param {String} name\n * @param {Observable} observable\n * @param {Object} data\n * @param {String} action\n * @param {Boolean} debug\n */\n constructor(name, observable, data, action = 'subscribe', debug = false) {\n // this.addMixins();\n const options = {\n name,\n observable,\n data,\n action\n }\n this.sendToDirectorStream(options)\n }\n\n sendToDirectorStream(payload) {\n const directorStream$ = SpyneAppProperties.channelsMap.getStream('DISPATCHER')\n const frozenPayload = safeClone(payload)\n // console.log(\"VS PAYLOAD \",frozenPayload);\n directorStream$.next(frozenPayload)\n payload = undefined\n\n delete this\n }\n\n static deepClone(o) {\n const isArr = is(Array)\n const isObj = is(Object)\n const isIter = ob => isArr(ob) === false && isObj(ob) === true\n const isIterable = isIter(o)\n return isIterable ? compose(fromPairs, toPairs, clone)(o) : clone(o)\n }\n\n static getMouseEventKeys() {\n return ['altKey', 'bubbles', 'cancelBubble', 'cancelable', 'clientX', 'clientY', 'composed', 'ctrlKey', 'currentTarget', 'defaultPrevented', 'detail', 'eventPhase', 'fromElement', 'isTrusted', 'layerX', 'layerY', 'metaKey', 'movementX', 'movementY', 'offsetX', 'offsetY', 'pageX', 'pageY', 'path', 'relatedTarget', 'returnValue', 'screenX', 'screenY', 'shiftKey', 'sourceCapabilities', 'srcElement', 'target', 'timeStamp', 'toElement', 'type', 'view', 'which', 'x', 'y']\n }\n\n addMixins() {\n this.gc = gc\n }\n}\n","import { baseStreamsMixins } from '../utils/mixins/base-streams-mixins.js'\nimport { convertDomStringMapToObj } from '../utils/frp-tools.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { fromEvent } from 'rxjs'\nimport { map } from 'rxjs/operators'\nimport { clone, omit } from 'ramda'\nconst isDevMode = SpyneAppProperties.debug === true\n\nexport class ViewStreamBroadcaster {\n /**\n * The class takes in all of the elements from the 'broadcastEvents' method and directs the events to either the UI or ROUTE channels\n * @module ViewStreamBroadcaster\n * @type internal\n *\n * @constructor\n * @param {Object} props\n * @param {Function} broadcastFn\n */\n\n constructor(props, broadcastFn) {\n this.addMixins()\n this.props = props\n this.broadcastFn = broadcastFn\n this.broadcaster(this.broadcastFn)\n }\n\n addDblClickEvt(q) {\n const dblclick$ = fromEvent(q, 'dblclick')\n // console.log('ADDING DBL CLICK ', q);\n const stream$ = dblclick$.pipe(\n map(p => {\n const data = clone(p)\n // ADD DOUBLECLICK TO UI EVENTS\n data.typeOverRide = 'dblclick'\n return data\n }))\n return stream$\n }\n\n // ==================================================================\n // BROADCAST BUTTON EVENTS\n // ==================================================================\n broadcast(args) {\n if (args.length <= 0 && isDevMode === true) {\n console.warn(`Spyne Warning: The nested array in ${this.props.name}.broadcastEvents appears to be empty --> vsid:${this.props.vsid}!`)\n return\n }\n // payloads to send, based on either the array or the elements dataMap\n const channelPayloads = {\n UI: this.sendUIPayload,\n ROUTE: this.sendRoutePayload\n }\n // spread operator to select variables from arrays\n const [selector, event, local] = args\n // btn query\n let channel // hoist channel and later check if chnl exists\n let query = this.props.el.querySelectorAll(selector)\n\n if (query.length <= 0) {\n const el = this.props.el\n const checkParentEls = (element) => {\n if (element === el) {\n query = [element]\n }\n }\n\n const pluckElFromParent = () => {\n const elParent = el.parentElement !== null ? el.parentElement : document\n const elSelected = elParent.querySelectorAll(selector)\n elSelected.forEach = Array.prototype.forEach\n elSelected.forEach(checkParentEls)\n }\n\n pluckElFromParent()\n }\n\n const isLocalEvent = local !== undefined\n const addObservable = (q) => {\n // the btn observable\n const observable = event !== 'dblClick'\n ? fromEvent(q, event, { preventDefault: () => true })\n : this.addDblClickEvt(q)\n // select channel and data values from either the array or the element's dom Map\n channel = q.dataset.channel// ifNilThenUpdate(chnl, q.dataset.channel);\n const data = {}// convertDomStringMapToObj(q.dataset);\n data.payload = convertDomStringMapToObj(q.dataset)\n data.payload = omit(['channel'], data.payload)\n if (data.channel === 'ROUTE') {\n data.payload.endPreventDefault = true\n }\n\n data.channel = channel\n // payload needs vsid# to pass verification\n\n data.srcElement = {}// pick(['vsid','viewName'], data);\n data.srcElement.id = this.props.id\n data.srcElement.vsid = this.props.vsid\n data.srcElement.isLocalEvent = isLocalEvent\n // data.srcElement['viewName'] = this.props.name;\n data.srcElement.srcEvent = event\n data.srcElement.el = q\n // select the correct payload\n\n function getValidChannel(ch) {\n if (ch === 'ROUTE' || ch === 'CHANNEL_ROUTE') {\n return 'ROUTE'\n }\n if (ch !== 'UI' && ch !== 'CHANNEL_UI' && ch !== undefined) {\n console.warn(`SpyneJS warning: The channel, ${ch}, is not allowed here, only \"UI\" or \"ROUTE\" are valid channels, defaulting to CHANNEL_UI`)\n }\n return 'UI'\n }\n\n const channelPayload = channelPayloads[getValidChannel(channel)]\n // run payload\n channelPayload(observable, data)\n }\n const queryIsNil = query === undefined || query.length <= 0\n if (queryIsNil === true && isDevMode === true) {\n console.warn(`Spyne Warning: The item ${selector}, does not appear to exist in ${this.props.name} --> vsid:${this.props.vsid}!`)\n\n // addObservable(query, event);\n } else {\n query.forEach = Array.prototype.forEach\n query.forEach(addObservable)\n }\n }\n\n broadcaster(arrFn) {\n const broadcastArr = arrFn()\n broadcastArr.forEach(args => this.broadcast(args))\n }\n\n // =================================================================\n addMixins() {\n // ==================================\n // BASE STREAM MIXINS\n // ==================================\n const streamMixins = baseStreamsMixins()\n this.sendUIPayload = streamMixins.sendUIPayload\n this.sendRoutePayload = streamMixins.sendRoutePayload\n }\n}\n","import { ViewStreamPayload } from '../../views/view-stream-payload.js'\n\nexport function baseStreamsMixins() {\n return {\n testFunc: function(str) {\n console.log('stream mixin is ', str)\n },\n sendRoutePayload: function(obs, data) {\n /** TODO: ADD A CHECK FOR END ROUTE AND TRANSFORM TO EMPTY */\n return new ViewStreamPayload('CHANNEL_ROUTE', obs, data, 'subscribe')\n },\n sendUIPayload: function(obs, data) {\n return new ViewStreamPayload('CHANNEL_UI', obs, data, 'subscribe')\n }\n /*\n sendInfoToChannel: function(channelName, payload) {\n const getProp = str => prop(str, this.props);\n const channel = channelName;\n let srcElement = {\n vsid: getProp('vsid'),\n el: getProp('el'),\n viewName: getProp('name')\n };\n let data = {\n payload, channel, srcElement\n };\n return new ViewStreamPayload(channelName, new of(''), data,\n 'subscribe');\n },\n */\n /* sendLifeStreamPayload: function(obs, data) {\n return new ViewStreamPayload('LIFESTREAM', obs, data, 'subscribe');\n },\n\n createLifeStreamPayload: function(STEP, data = {}, type = 'parent') {\n let viewId = `${this.props.name}: ${this.props.vsid}`;\n return new LifestreamPayload('LIFESTREAM', STEP, type, viewId, data).data;\n } */\n }\n}\n","import {\n is,\n reject,\n isNil,\n find,\n allPass,\n forEachObjIndexed,\n not,\n isEmpty,\n always,\n compose,\n equals,\n prop,\n where,\n defaultTo,\n mergeAll,\n F,\n omit,\n any,\n curry,\n lte\n , map as rMap\n} from 'ramda'\n\nimport { SpyneAppProperties } from './spyne-app-properties.js'\n\nconst isNotArr = compose(not, is(Array))\nconst isNotEmpty = compose(not, isEmpty)\nconst isNonEmptyStr = allPass([is(String), isNotEmpty])\nconst isNonEmptyArr = allPass([is(Array), isNotEmpty])\nconst isObjectFn = compose(allPass([isNotArr, is(Object)]))\nconst isNonEmptyObjectFn = compose(allPass([isNotEmpty, isNotArr, is(Object)]))\n\nconst isString = (val) => is(String, val)\nconst isBoolean = (val) => is(Boolean, val)\nconst isNumber = (val) => is(Number, val)\nconst isArrayFn = (val) => is(Array, val)\n\nexport class ChannelPayloadFilter {\n /**\n * @module ChannelPayloadFilter\n * @type util\n *\n *\n * @desc\n * <p>This utility filters ChannelPayload objects by using query selectors and/or by comparing data properties</p>\n * <h3>The ChannelPayloadFilter features</h3>\n * <ul>\n * <li>Can be used by Channels and ViewStreams</li>\n * <li>ChannelPayloadFilter instances can be used as the third parameter when binding actions to ViewStream methods.</li>\n * <li>Selectors can be a query string, an array of selector strings, or the selector can be an actual dom element.</li>\n * <li>Selectors are not required and can be disregarded by adding \"\" or undefined as the selector property.</li>\n * <li>The data object compares the values from the props() method of a ChannelPayload object</li>\n * <li>Internally, The data object is conformed to a spec object for ramda&rsquo;s EXT['where', '//ramdajs.com/docs/#where'] method</li>\n * </ul>\n *\n * @constructor\n * @property {String|Array|HTMLElement} selector The matching element\n * @param {Object} filters Object that contains the selector, props, and debugLabel params.\n * @property {Object} propFilters A json object containing filtering methods for channel props variables.\n *\n * @property {String|Array|HTMLElement} selector - = ''; The matching element.\n * @property {Object} propFilters - = {}; A json object containing comprators for any expected property values.\n * @returns Boolean\n *\n *\n * @example\n * TITLE['<h4>Filtering using Selectors and a Property Comparator Within a ViewStream Instance</h4>']\n * const mySelectors = ['ul', 'li:first-child'];\n * const propFilters = {\n * linkType: \"external\"\n * };\n * const myFilter = new ChannelPayloadFilter(mySelectors, propFilters);\n *\n * addActionListeners() {\n * return [\n * ['CHANNEL_UI_CLICK_EVENT', 'onClickEvent', myFilter]\n * ]\n * }\n *\n * @example\n * TITLE['<h4>Filtering Using Method and String Comparators Within a ViewStream Instance</h4>']\n * const propFilters = {\n * type: \"scrolling-element\",\n * scrollNum: (n)=>n>=1200 && n<=5000;\n * };\n * const myFilter = new ChannelPayloadFilter('', propFilters);\n *\n * addActionListeners() {\n * return [\n * ['CHANNEL_UI_CLICK_EVENT', 'onClickEvent', myFilter]\n * ]\n * }\n *\n *\n * @example\n * TITLE['<h4>A Simple Property Filtering Example Within a Channel Instance</h4>']\n * // Filter for a button with a data type of 'link'\n * const myFilter = new ChannelPayloadFilter('' {type: \"link\"});\n *\n * this.getChannel(\"CHANNEL_UI\")\n * .pipe(filter(myFilter))\n * .subscribe(myChannelMethod);\n *\n */\n constructor(selector, filters = {}, debugLabel, testMode) {\n const selectorIsObj = isObjectFn(selector)\n\n if (selectorIsObj) {\n filters = selector\n selector = prop('selector', filters)\n testMode = testMode || prop('testMode', filters)\n }\n\n const debugLabelArr = [debugLabel, prop('debugLabel', filters)]\n\n debugLabel = compose(find(is(String)))(debugLabelArr)\n\n let props = omit(['debugLabel', 'label', 'selector', 'props', 'testMode', 'propFilters'], filters)\n if (filters.props !== undefined) {\n props = mergeAll([filters.props, props])\n } else if (filters.propFilters !== undefined) {\n props = mergeAll([filters.propFilters, props])\n }\n\n filters.propFilters = props\n\n const { propFilters } = filters\n\n const addStringSelectorFilter = isNonEmptyStr(selector) ? ChannelPayloadFilter.filterSelector([selector], debugLabel) : undefined\n const addArraySelectorFilter = isNonEmptyArr(selector) ? ChannelPayloadFilter.filterSelector(selector, debugLabel) : undefined\n const addDataFilter = isNonEmptyObjectFn(propFilters) ? ChannelPayloadFilter.filterData(propFilters, debugLabel) : undefined\n\n let filtersArr = reject(isNil, [addStringSelectorFilter, addArraySelectorFilter, addDataFilter])\n\n // IF ARRAY IS EMPTY ALWAYS RETURN FALSE;\n\n const filtersAreEmpty = isEmpty(filtersArr)\n\n if (filtersAreEmpty) {\n filtersArr = [always(false)]\n if (SpyneAppProperties.debug === true && testMode !== true) {\n console.warn(`Spyne Warning: The Channel Filter, with selector: ${selector}, and propFilters:${propFilters} appears to be empty!`)\n }\n }\n if (testMode === true) {\n return { selector, propFilters, debugLabel, filters, testMode, filtersAreEmpty }\n }\n\n return allPass(filtersArr)\n }\n\n static filterData(filterJson, filterdebugLabel) {\n const debugLabel = filterdebugLabel\n\n const compareData = () => {\n // DO NOT ALLOW AN EMPTY OBJECT TO RETURN TRUEs\n if (isEmpty(filterJson)) {\n return always(false)\n }\n\n // CHECKS ALL VALUES IN JSON TO DETERMINE IF THERE ARE FILTERING METHODS\n\n const createCurryComparator = compareStr => (str) => {\n return str === compareStr\n }\n const checkToConvertToFn = (val, key, obj) => {\n let fnVal = F\n if (isString(val) || isBoolean(val) || isNumber(val)) {\n fnVal = createCurryComparator(val)\n } else if (typeof val === 'function') {\n return val\n } else if (isArrayFn(val) || isObjectFn(val)) {\n console.warn(\n `ChannelPayloadFilter: Property \"${val}\" is an array/object, which is not allowed. ` +\n 'This property will always return false.'\n )\n return fnVal\n }\n return fnVal\n }\n filterJson = rMap(checkToConvertToFn, filterJson)\n\n // TAP LOGGER\n const tapLogger = (comparedObj) => {\n if (debugLabel === undefined) {\n return comparedObj\n }\n const propsBooleans = {}\n const mapBools = (value, key) => {\n propsBooleans[key] = value(prop(key, comparedObj))\n }\n forEachObjIndexed(mapBools, filterJson)\n console.log(`%c CHANNEL PAYLOAD FILTER DEBUGGER [\"${debugLabel}\"] - values: `, 'color:orange;', { propsBooleans, comparedObj })\n\n return comparedObj\n }\n\n // END TAP LOGGER\n const fMethod = where(filterJson)\n\n const getFilteringObj = (v) => {\n const { payload, srcElement, event } = v || {}\n const o = Object.assign({}, v, srcElement, event, payload)\n // console.log('o is ',o);\n return o\n }\n\n return compose(fMethod, tapLogger, defaultTo({}), getFilteringObj)\n }\n\n return compareData()\n }\n\n static checkPayloadSelector(arr, debugLabel, srcPayload) {\n // ELEMENT FROM PAYLOADs\n const { payload, srcElement, event } = srcPayload || {}\n\n const reduceFindEl = (acc, src) => {\n if (acc !== undefined) {\n return acc\n }\n const el = prop('el', src)\n if (ChannelPayloadFilter.elIsDomElement(el)) {\n acc = el\n }\n return acc\n }\n\n const el = [srcElement, payload, prop('srcElement', event), srcPayload].reduce(reduceFindEl, undefined)\n\n // CHECK IF PAYLOAD EL EXISTS\n const elCanMatch = el !== null && typeof el === 'object' && typeof el.matches === 'function'\n\n // the payload element is tested directly with Element.matches — the same\n // \"is this el one of the selector's elements\" answer as the previous\n // document-wide querySelectorAll walk, without scanning the document on\n // every dispatch (isEqualNode could also pass a structural lookalike of\n // a matched node, which was an over-match, not a contract)\n const elMatches = (sel) => {\n try {\n return el.matches(sel)\n } catch (e) {\n if (SpyneAppProperties.debug === true) {\n console.warn(`Spyne Warning: The ChannelPayloadFilter selector, ${sel}, is not a valid css selector!`)\n }\n return false\n }\n }\n\n const matchesBoolArr = elCanMatch ? rMap(elMatches, arr) : []\n\n if (debugLabel !== undefined) {\n const selectorsArr = arr\n console.log(`%c CHANNEL PAYLOAD FILTER DEBUGGER [\"${debugLabel}\"] - selectors: `, 'color:orange;', { el, selectorsArr, nodeArrResultsDebugger: matchesBoolArr })\n }\n\n if (elCanMatch === false || isEmpty(matchesBoolArr) === true) {\n return false\n }\n\n return any(equals(true), matchesBoolArr)\n }\n\n static elIsDomElement(o) {\n if (is(String, o)) {\n o = document.querySelector(o)\n }\n\n return compose(lte(0), defaultTo(-1), prop('nodeType'))(o)\n }\n\n static filterSelector(selectorArr, debugLabel) {\n const arr = reject(isEmpty, selectorArr)\n const payloadCheck = curry(ChannelPayloadFilter.checkPayloadSelector)\n return payloadCheck(arr, debugLabel)\n }\n}\n","import { head, compose, reject, split, isEmpty, lte, defaultTo, prop } from 'ramda'\nimport { spyneWarn } from '../utils/spyne-warn.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\n\nfunction generateSpyneSelectorId(el) {\n const num = () => Math.random().toString(36).replace(/\\d/gm, '').substring(1, 8)\n let vsid = `${num()}`\n if (el.dataset.vsid === undefined) {\n el.dataset.vsid = vsid\n } else {\n vsid = el.dataset.vsid\n }\n return `[data-vsid='${vsid}']`\n}\n\nfunction isDevMode() {\n return SpyneAppProperties.debug === true\n}\n\nfunction isNodeElement(el) {\n const nodeCheck = compose(lte(0), defaultTo(-1), prop('nodeType'))\n return nodeCheck(el)\n}\n\nfunction getElOrList(cxt, sel, verboseBool = false) {\n const list = getNodeListArray(cxt, sel, verboseBool)\n return list.length === 1 ? head(list) : list\n}\n\nfunction testSelectors(cxt, sel, verboseBool) {\n const el = document.querySelector(cxt)\n\n const elIsDomElement = compose(lte(0), defaultTo(-1), prop('nodeType'))\n\n if (el !== null && elIsDomElement(el) === false) {\n spyneWarn(`Spyne Warning: the el object is not a valid single element, ${el}`)\n return\n }\n\n if (sel !== undefined && String(sel).trim().length > 0) {\n function isValidSelector(selector) {\n try {\n const elements = document.querySelectorAll(selector)\n return elements.length > 0 // Returns true if the selector is valid and selects at least one element\n } catch (e) {\n return false // Catching an exception means the selector is invalid\n }\n }\n\n const isValidSelectorBool = isValidSelector(sel)\n if (verboseBool === true && isDevMode() === true && isValidSelectorBool === false) {\n spyneWarn(`Spyne Warning: the selector, ${sel} does not exist in this el, ${cxt}`)\n }\n }\n}\n\nfunction getNodeListArray(cxt, sel, verboseBool = false) {\n const selector = sel !== undefined ? `${cxt} ${sel}` : cxt\n let isParent = false\n\n const returnSelectorIfValid = (selector) => {\n let arr = []\n try {\n arr = document.querySelectorAll(selector)\n } catch (e) { arr = [] }\n try {\n isParent = document.querySelector(sel) === document.querySelector(cxt)\n if (isParent === true) {\n arr = [document.querySelector(sel)]\n }\n } catch (e) {\n // return [];\n }\n return arr// document.querySelectorAll(selector);\n }\n\n const elArr = returnSelectorIfValid(selector)\n\n if (verboseBool === true) {\n const mainSel = isParent === true ? 'body' : cxt\n testSelectors(mainSel, sel, verboseBool)\n }\n\n return elArr\n}\n\nfunction setInlineCss(val, cxt, sel) {\n const arr = getNodeListArray(cxt, sel)\n const addInlineCss = item => {\n item.style.cssText = val\n }\n arr.forEach(addInlineCss)\n return this\n}\n\n/**\n *\n * @module ViewStreamSelector\n * @type util\n *\n * @param {String|El} cxt The main element\n * @param {String|El} The selector as a String\n * @returns {function(*=)}\n * @constructor\n */\n\nfunction ViewStreamSelector(cxt, sel) {\n cxt = typeof (cxt) === 'string' ? cxt : generateSpyneSelectorId(cxt)\n testSelectors(cxt, sel, false)\n\n function selector(sel) {\n return ViewStreamSelector(cxt, sel)\n }\n\n /**\n * Convenience method to map through a NodeList.\n *\n * @param {Function} fn\n * @returns An array of elements\n */\n selector.map = (fn) => Array.from(getNodeListArray(cxt, sel)).map(fn)\n\n /**\n * Convenience method to iterate through a NodeList\n *\n * @param {Function} fn\n * @returns An array of elements\n */\n selector.forEach = (fn) => Array.from(getNodeListArray(cxt, sel)).map(fn)\n\n /**\n *\n * Adds the class to the Element or to the NodeList.\n * @param {String} c\n *\n *\n * @property {String} c - = undefined; The class to be added.\n *\n **/\n selector.addClass = (c) => {\n const arr = getNodeListArray(cxt, sel)\n const addClass = item => item.classList.add(c)\n arr.forEach(addClass)\n return selector\n }\n\n /**\n *\n * @param {String} c\n * @desc Removes the class to the Element or to the NodeList.\n */\n selector.removeClass = (c) => {\n const arr = getNodeListArray(cxt, sel)\n const removeClass = item => {\n item.classList.remove(c)\n }\n arr.forEach(removeClass)\n return selector\n }\n\n /**\n *\n * @param {String} c\n * @desc Sets the class to equal exactly the class string.\n */\n selector.setClass = (c) => {\n const arr = getNodeListArray(cxt, sel)\n /**\n * NON IE CLEANER SOLUTION\n * const removeClass = item => item.classList = c;\n * arr.forEach(removeClass);\n */\n\n const setTheClass = item => {\n const removeClassStrArr = compose(reject(isEmpty), split(' '))(item.className)\n const classStrArr = c.split(' ')\n const remover = s => item.classList.remove(s)\n const adder = sel => item.classList.add(sel)\n removeClassStrArr.forEach(remover)\n classStrArr.forEach(adder)\n }\n arr.forEach(setTheClass)\n return selector\n }\n\n selector.unmount = () => {\n // console.log('unmounting selector ', this);\n }\n\n /**\n *\n * @param {String} c\n * @param {Boolean} bool Default is undefined.\n * @desc Sets the class based on the provided boolean or the toggles the class.\n *\n * @example\n * this.props.el$.toggleClass('myclass', true);\n *\n */\n selector.toggleClass = (c, bool) => {\n const arr = getNodeListArray(cxt, sel)\n const toggleClass = item => {\n bool = bool !== undefined ? bool : !item.classList.contains(c)\n bool ? item.classList.add(c) : item.classList.remove(c)\n }\n arr.forEach(toggleClass)\n return selector\n }\n\n selector.toggle = (c, bool) => {\n selector.toggleClass(c, bool)\n return selector\n }\n\n /**\n * Attaches html to the Selector's element (the first match when the\n * selector matches multiple elements).\n * @param htmlElement\n */\n selector.appendChild = (htmlElement) => {\n const el = selector.el\n if (el !== null) {\n el.appendChild(htmlElement)\n } else {\n spyneWarn(`Spyne Warning: The selector, ${sel} does not appear to be valid!`)\n }\n\n return selector.el\n }\n\n /**\n *\n * Adds class with a delay of 1ms to allow css to register a transition.\n * @param c\n */\n selector.addAnimClass = (c) => {\n const delayAddClass = () => {\n const arr = getNodeListArray(cxt, sel)\n const addClass = item => {\n try {\n item.classList.add(c)\n } catch (e) {\n }\n }\n arr.forEach(addClass)\n }\n requestAnimationFrame(delayAddClass)\n return selector\n }\n\n /**\n *\n * @param {String} c\n * @param {String|HTMLElement} elSel The selector for the element.\n * @desc Sets the class active HTMLElement from a NodeList.\n */\n selector.setActiveItem = (c, elSel) => {\n const arr = getNodeListArray(cxt, sel)\n const currentEl = typeof elSel === 'string'\n ? getElOrList(cxt, elSel)\n : elSel\n\n arr.forEach(item => item.classList.remove(c))\n\n if (isNodeElement(currentEl) === true) {\n const matchingEl = Array.from(arr).find(item => item === currentEl)\n\n if (matchingEl) {\n matchingEl.classList.add(c)\n } else if (isDevMode() === true) {\n spyneWarn(\n `Spyne Warning: The selector, ${elSel}, is valid but does not match any item in setActiveItem: ${c}`\n )\n }\n } else if (isDevMode() === true) {\n spyneWarn(\n `Spyne Warning: The selector, ${elSel}, does not appear to be a valid item in setActiveItem: ${c}`\n )\n }\n\n return selector\n }\n\n /**\n *\n * @function el\n *\n * @desc\n * getter that always resolves to a single element: the matched element,\n * or the first item when the selector matches multiple elements (a\n * warning is logged in debug mode).\n *\n * @returns\n * An HTMLElement, or null when the selector matches nothing\n * (mirroring querySelector)\n */\n\n /**\n *\n * @function els\n *\n * @desc\n * getter that always resolves to an Array of the matched elements.\n *\n * @returns\n * An Array of HTMLElements; empty when the selector matches nothing\n */\n\n /**\n *\n * @function length\n *\n * @desc\n * Determines the length of the NodeList\n *\n * @returns\n * The number of elements matched by the selector\n */\n\n /**\n *\n * @function exists\n *\n * @desc\n * Determines whether an the selected element exists\n *\n * @returns\n * Boolean\n */\n\n const getElsArray = (verboseBool = true) => Array.from(getNodeListArray(cxt, sel, verboseBool))\n\n Object.defineProperty(selector, 'el', {\n get: () => {\n const list = getElsArray()\n if (list.length > 1 && isDevMode() === true) {\n spyneWarn(`Spyne Warning: el$(\"${sel !== undefined ? sel : cxt}\").el matched ${list.length} elements; returning the first. Use .els for the full list.`)\n }\n return list.length >= 1 ? list[0] : null\n }\n })\n Object.defineProperty(selector, 'els', { get: () => getElsArray() })\n Object.defineProperty(selector, 'arr', { get: () => getElsArray() })\n\n // Undocumented. Retains the pre-0.24 polymorphic el contract — a single\n // element, a NodeList, or an empty NodeList depending on match count —\n // to assist in debugging and migrating older SpyneJS apps.\n Object.defineProperty(selector, 'elLegacy', { get: () => getElOrList(cxt, sel, true) })\n Object.defineProperty(selector, 'len', { get: () => getNodeListArray(cxt, sel, false).length })\n Object.defineProperty(selector, 'length', { get: () => getNodeListArray(cxt, sel, false).length })\n Object.defineProperty(selector, 'exists', { get: () => getNodeListArray(cxt, sel, false).length >= 1 })\n\n Object.defineProperty(selector, 'inline', { set: (val) => setInlineCss(val, cxt, sel), get: () => selector })\n Object.defineProperty(selector, 'inlineCss', { set: (val) => setInlineCss(val, cxt, sel), get: () => selector })\n\n return selector\n}\n\nexport { ViewStreamSelector }\n","import { baseCoreMixins } from '../utils/mixins/base-core-mixins.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { deepMerge } from '../utils/deep-merge.js'\nimport { safeClone } from '../utils/safe-clone.js'\nimport {\n findStrOrRegexMatchStr,\n getConstructorName\n} from '../utils/frp-tools.js'\nimport { ViewStreamElement } from './view-stream-element.js'\nimport { registeredStreamNames } from '../channels/channels-config.js'\nimport { ViewStreamBroadcaster } from './view-stream-broadcaster.js'\nimport { ViewStreamPayload } from './view-stream-payload.js'\nimport { ChannelPayloadFilter } from '../utils/channel-payload-filter.js'\nimport { ViewStreamObservable } from '../utils/viewstream-observables.js'\nimport { ViewStreamSelector } from './view-stream-selector.js'\nimport { Subject, of } from 'rxjs'\nimport { mergeMap, map, takeWhile, filter, tap, skip, finalize } from 'rxjs/operators'\nimport {\n pick,\n compose,\n isNil,\n all,\n forEach,\n toLower,\n either,\n findIndex,\n apply,\n test,\n flatten,\n prop,\n always,\n lte,\n defaultTo,\n propSatisfies,\n allPass,\n curry,\n is,\n slice,\n path,\n omit,\n ifElse,\n mergeRight,\n where,\n equals\n , map as rMap\n} from 'ramda'\n\nexport class ViewStream {\n /**\n * @module ViewStream\n *\n * @desc\n *\n * <p>ViewStream is the interactive-view component, and its core functionality is comprised of two internal components: </p>\n <ul class='basic'>\n *\n */\n constructor(props = {}) {\n this.vsnum = Math.random()\n this.addMixins()\n this._postRenderCalled = false\n this.defaults = () => {\n const vsid = this.createId()\n const id = props.id ? props.id : vsid\n return {\n vsid,\n id,\n tagName: 'div',\n el: undefined,\n data: undefined,\n animateIn: false,\n animateInTime: 0.5,\n animateOut: false,\n animateOutTime: 0.5,\n sendLifecyleEvents: false,\n hashId: `#${id}`,\n id$: `#${id}`,\n viewClass: ViewStreamElement,\n extendedSourcesHashMethods: {},\n debug: false,\n template: undefined,\n node: document.createDocumentFragment(),\n name: getConstructorName(this)\n }\n }\n this._state = {}\n this.$dirs = ViewStreamObservable.createDirectionalFiltersObject()\n this.addDefaultDirection = ViewStreamObservable.addDefaultDir\n this.addDownInternalDir = ViewStreamObservable.addDownInternalDir\n // this.props = Object.assigREADY_FOR_VS_DETRITUS_COLLECTn({}, this.defaults(), props);\n this.props = deepMerge(this.defaults(), props)\n this.sendLifecycleMethod = this.props.sendLifecyleEvents === true ? this.sendLifecycleMethodActive.bind(this) : this.sendLifecycleMethodInactive.bind(this)\n const attributesArr = this.attributesArray\n // let attributesArr = ['id', 'class', 'dataset'];\n this.props.domAttributes = pick(attributesArr, this.props)\n if (this.props.traits !== undefined) {\n this.addTraits(this.props.traits)\n }\n this.loadAllMethods()\n this.props.action = 'LOADED'\n this.sink$ = new Subject()\n this.props.elIsAlreadyRenderedBool = this.elAlreadyExistsFn(this.props)\n const ViewClass = this.props.viewClass\n this.view = new ViewClass(this.sink$, { el:this.props.el }, this.props.vsid, this.props.id)// new this.props.viewClass(this.sink$);\n this.sourceStreams = this.view.sourceStreams\n this._rawSource$ = this.view.getSourceStream()\n this._rawSource$.viewName = this.props.name\n this.sendEventsDownStream = this.sendEventsDownStreamFn\n this.initViewStream()\n this.isDevMode = ViewStream.isDevMode()\n this.props.addedChannels = []\n this.checkIfElementAlreadyExists()\n }\n\n // ============================= HASH KEY AND SPIGOT METHODS==============================\n get source$() {\n return this._source$\n }\n\n get attributesArray() {\n return [\n // Global Attributes\n 'accesskey', 'class', 'contenteditable', 'dir', 'draggable', 'hidden', 'id', 'lang', 'spellcheck', 'style', 'tabindex', 'title', 'translate',\n\n // Accessiblity Attributes\n 'aria-autocomplete', 'aria-checked', 'aria-disabled', 'aria-expanded', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-label', 'aria-level', 'aria-multiline', 'aria-multiselectable', 'aria-orientation', 'aria-pressed', 'aria-readonly', 'aria-required', 'aria-selected', 'aria-sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext', 'aria-atomic', 'aria-busy', 'aria-live', 'aria-relevant', 'aria-dropeffect', 'aria-grabbed', 'aria-activedescendant', 'aria-controls', 'aria-describedby', 'aria-flowto', 'aria-labelledby', 'aria-owns', 'aria-posinset', 'aria-setsize',\n\n // Specific Attributes for input\n 'accept', 'autocomplete', 'autofocus', 'checked', 'dirname', 'disabled', 'form', 'formaction',\n 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'list', 'max', 'maxlength',\n 'min', 'minlength', 'multiple', 'name', 'pattern', 'placeholder', 'readonly', 'required', 'size', 'step', 'value',\n\n // Specific Attributes for img\n 'alt', 'srcset', 'sizes', 'usemap', 'ismap',\n\n // Specific Attributes for a and link\n 'href', 'target', 'download', 'ping', 'rel', 'hreflang', 'as', 'media',\n\n // Specific Attributes for form\n 'accept-charset', 'action', 'enctype', 'novalidate',\n\n // Specific Attributes for meta\n 'content', 'charset', 'http-equiv',\n\n // Specific Attributes for script\n 'async', 'defer', 'integrity', 'nomodule', 'nonce', 'referrerpolicy',\n\n // Other Element-specific Attributes\n 'autocapitalize', 'autoplay', 'buffered', 'challenge', 'cite', 'code', 'codebase', 'color', 'cols', 'colspan', 'contextmenu', 'controls', 'coords', 'crossorigin', 'csp', 'dataset', 'datetime', 'decoding', 'default', 'for', 'headers', 'high', 'icon', 'importance', 'itemprop', 'keytype', 'kind', 'label', 'language', 'lazyload', 'loop', 'low', 'manifest', 'method', 'muted', 'open', 'optimum', 'poster', 'preload', 'radiogroup', 'reversed', 'role', 'rows', 'rowspan', 'sandbox', 'scope', 'scoped', 'selected', 'shape', 'slot', 'span', 'srcdoc', 'src', 'type', 'srclang', 'start', 'summary', 'wrap', 'width', 'height'\n ]\n }\n\n static isDevMode() {\n return SpyneAppProperties.debug\n }\n\n static checkIfActionsAreRegistered(channelsArr = [], actionsArr) {\n if (actionsArr.length > 0) {\n const getAllActions = (a) => {\n const getRegisteredActionsArr = (str) => SpyneAppProperties.getChannelActions(str)\n const arr = a.map(getRegisteredActionsArr)\n return flatten(arr)\n }\n const checkForMatch = (strMatch) => {\n const re = new RegExp(strMatch)\n const actionIndex = findIndex(test(re), getAllActionsArr)\n if (actionIndex < 0) {\n const channelSyntax = channelsArr.length === 1 ? 'from added channel' : 'from added channels'\n console.warn(`Spyne Warning: The action, ${strMatch}, in ${this.props.name}, does not match any of the registered actions ${channelSyntax}, ${channelsArr.join(', ')}`)\n }\n // const vsnum = ()=> R.test(new RegExp(str), \"CHANNEL_ROUTE_TEST_EVENT\")\n }\n const getAllActionsArr = getAllActions(channelsArr)\n actionsArr.forEach(checkForMatch)\n }\n }\n\n /**\n *\n * Add any query within the ViewStream's dom and any dom events to automatically be observed by the UI Channel.\n * <br>\n * @example\n *\n * broadcastEvents() {\n * // ADD BUTTON EVENTS AS NESTED ARRAYS\n * return [\n * ['#my-button', 'mouseover'],\n * ['#my-input', 'change']\n * ]\n * }\n *\n *\n * */\n\n static isValidNestedArr(eventsArr) {\n const isTrue = equals(true)\n const allIsTrue = all(isTrue)\n const isString = is(String)\n const isValidArr = compose(allIsTrue, rMap(isString), slice(0, 2), defaultTo([]))\n const mapEventsArrFn = compose(allIsTrue, rMap(isValidArr), defaultTo([]))\n return mapEventsArrFn(eventsArr)\n }\n\n static elIsDomElement(o) {\n if (is(String, o)) {\n o = document.querySelector(o)\n }\n\n return compose(lte(0), defaultTo(-1), prop('nodeType'))(o)\n }\n\n updatePropsToMatchEl() {\n const getTagName = compose(toLower, either(prop('tagName'), always('')))\n this.props.tagName = getTagName(this.props.el)\n }\n\n // =====================================================================\n\n elAlreadyExistsFn(props) {\n const elIsDomElement = compose(lte(0), defaultTo(-1), prop('nodeType'))\n const elIsRendered = el => document.body.contains(el)\n return propSatisfies(allPass([elIsRendered, elIsDomElement]), 'el')(props)\n }\n\n checkIfElementAlreadyExists() {\n if (this.props.elIsAlreadyRenderedBool === true) {\n this.updatePropsToMatchEl()\n this.postRender()\n } else if (this.props.el === null) {\n console.error(`Spyne Error: The defined element for this ViewStream instance, ${this.constructor.name}, appears to not exist.`)\n }\n }\n\n loadAllMethods() {\n const channelFn = curry(this.onChannelMethodCall.bind(this))\n const createExtraStatesMethod = (arr) => {\n let [action, funcStr, actionFilter] = arr\n if (is(String, actionFilter)) {\n actionFilter = new ChannelPayloadFilter({ selector:actionFilter })\n }\n this.props.extendedSourcesHashMethods[action] = channelFn(funcStr,\n actionFilter)\n }\n this.addActionListeners().forEach(createExtraStatesMethod)\n this.props.hashSourceMethods = this.setSourceHashMethods(\n this.props.extendedSourcesHashMethods)\n }\n\n /**\n * Binds channel actions to local methods, formatted as array values.\n * <ul>\n * <li><b>First value:</b> Action name, as a string or as a basic Regular Expression.\n * <li><b>Second value:</b> The method to be called when the action is published.\n * <li><b>Third optional value:</b> This is a filter option that can be a selector string. or an instance of the LINK['channelPayloadFilter', 'channel-payload-filter'].\n * </ul>\n * @example\n * addActionListeners() {\n * return [\n * ['CHANNEL_UI_CLICK_EVENT', 'onClickEvent', 'li.myclass'],\n * ['CHANNEL_MY_CUSTOM_EVENT', 'onActionReturned']\n * ]\n * }\n *\n * @returns Nested Array\n */\n addActionListeners() {\n return []\n }\n\n onChannelMethodCall(str, actionFilter, p) {\n const runFunc = (payload) => {\n if (this[str] === undefined) {\n console.warn(`Spyne Warning: The method, ${str} does not appear to exist in ${this.constructor.name}!`)\n } else {\n this[str](payload)\n }\n }\n\n if (p.$dir !== undefined && p.$dir.includes('child') &&\n this.deleted !== true) {\n const obj = deepMerge({}, p)// Object.assign({}, p);\n obj.$dir = this.$dirs.C\n this.sourceStreams.raw$.next(obj)\n }\n const filterPayload = defaultTo(always(true), actionFilter)\n\n if (filterPayload(p) === true) {\n p = omit(['$dir'], p)\n runFunc(p)\n }\n }\n\n setSourceHashMethods(extendedSourcesHashMethods = {}) {\n const hashSourceKeys = {\n EXTIRPATING: (p) => this.checkParentDispose(p),\n EXTIRPATE: (p) => this.disposeViewStream(p),\n // 'CHILD_EXTIRPATE' : (p) => this.disposeViewStream(p),\n VS_SPAWNED: (p) => this.onVSRendered(p),\n VS_SPAWNED_AND_ATTACHED_TO_DOM: (p) => this.onVSRendered(p),\n VS_SPAWNED_AND_ATTACHED_TO_PARENT: (p) => this.onVSRendered(p),\n // 'CHILD_VS_SPAWNED' : (p) => this.attachChildToView(p),\n READY_FOR_VS_DETRITUS_COLLECT: (p) => this.onReadyToGC(p),\n VS_NULLITY: () => ({})\n }\n return deepMerge.all([{}, hashSourceKeys, extendedSourcesHashMethods])\n }\n\n // ====================== MAIN STREAM METHODS ==========================\n initViewStream() {\n this._source$ = this._rawSource$.pipe(map(\n (payload) => this.onMapViewSource(payload)), takeWhile(this.notGCSTATE))\n\n this.initAutoMergeSourceStreams()\n this.updateSourceSubscription(this._source$, true)\n }\n\n notGCSTATE(p) {\n return !p.action.includes('READY_FOR_VS_DETRITUS_COLLECT')\n }\n\n eqGCSTATE(p) {\n return !p.action.includes('READY_FOR_VS_DETRITUS_COLLECT')\n }\n\n notCOMPLETED(p) {\n return !p.action.includes('COMPLETED')\n }\n\n notGCCOMPLETE(p) {\n return !p.action.includes('GC_COMPLETE')\n }\n\n testVal(p) {\n console.log('TESTING VALL IS ', p)\n }\n\n addParentStream(obs, attachData) {\n const filterOutNullData = (data) => data !== undefined && data.action !==\n undefined\n const checkIfDisposeOrFadeout = (d) => {\n const data = deepMerge({}, d)\n\n if (data.action === 'EXTIRPATE_AND_READY_FOR_VS_DETRITUS_COLLECT') {\n this.disposeViewStream(data)\n data.action = 'READY_FOR_VS_DETRITUS_COLLECT'\n }\n return data\n }\n\n this.parent$ = obs.pipe(\n filter(filterOutNullData),\n map(checkIfDisposeOrFadeout))\n this.updateSourceSubscription(this.parent$, false, 'PARENT')\n this.renderAndAttachToParent(attachData)\n }\n\n addChildStream(obs$) {\n const filterOutNullData = (data) => data !== undefined && data.action !==\n undefined\n const child$ = obs$.pipe(\n filter(filterOutNullData),\n tap(p => this.tracer('addChildStraem do ', p)),\n map((p) => {\n return p\n }),\n finalize(p => this.onChildCompleted(child$.source)))\n this.updateSourceSubscription(child$, true, 'CHILD')\n }\n\n onChildDisposed(p) {\n\n }\n\n // =======================================================================================\n\n onChildCompleted(p) {\n const findName = (x) => {\n const finalDest = (y) => {\n while (y.destination !== undefined) {\n y = finalDest(y.destination)\n }\n return y\n }\n return pick(['id', 'vsid'], finalDest(x))\n }\n const childCompletedData = findName(p)\n this.tracer('onChildCompleted ', this.vsnum, p)\n // console.log('obj is ',childCompletedName,obj,this.props);\n this.onChildDisposed(childCompletedData, p)\n return childCompletedData\n }\n\n initAutoMergeSourceStreams() {\n // ====================== SUBSCRIPTION SOURCE =========================\n const subscriber = {\n next: this.onSubscribeToSourcesNext.bind(this),\n error: this.onSubscribeToSourcesError.bind(this),\n complete: this.onSubscribeToSourcesComplete.bind(this)\n }\n // let takeBeforeGCOld = (val) => val.action !== 'VS_DETRITUS_COLLECTED';\n // let takeBeforeGC = (p) => !p.action.includes('READY_FOR_VS_DETRITUS_COLLECT');\n // let mapToState = (val) => ({action:val});\n // =====================================================================\n // ========== METHODS TO CHECK FOR WHEN TO COMPLETE THE STREAM =========\n const completeAll = () => {\n this.props.el$ = undefined\n this.uberSource$.complete()\n this.autoSubscriber$.complete()\n this.sink$.complete()\n this.props = undefined\n this.deleted = true\n this.tracer('completeAll', this.deleted, this.props)\n }\n const decrementOnObservableClosed = () => {\n obsCount -= 1\n if (obsCount === 0) {\n completeAll()\n }\n }\n // =====================================================================\n // ======================== INIT STREAM METHODS ========================\n let obsCount = 0\n this.uberSource$ = new Subject()\n // ======================= COMPOSED RXJS OBSERVABLE ======================\n const incrementObservablesThatCloses = () => { obsCount += 1 }\n this.autoMergeSubject$ = this.uberSource$.pipe(mergeMap((obsData) => {\n const branchObservable$ = obsData.observable.pipe(filter(\n (p) => p !== undefined && p.action !== undefined), map(p => {\n // console.log('PAYLOAD IS ', p, this.constructor.name)\n const payload = deepMerge({}, p)\n payload.action = p.action// addRelationToState(obsData.rel, p.action);\n this.tracer('autoMergeSubject$', payload)\n return payload\n }))\n\n if (obsData.autoClosesBool === false) {\n return branchObservable$\n } else {\n incrementObservablesThatCloses()\n return branchObservable$.pipe(finalize(decrementOnObservableClosed))\n }\n }))\n // ============================= SUBSCRIBER ==============================\n this.autoSubscriber$ = this.autoMergeSubject$\n // .do((p) => console.log('SINK DATA ', this.constructor.name, p))\n .pipe(filter((p) => p !== undefined && p.action !== undefined))\n .subscribe(subscriber)\n }\n\n // ========================= MERGE STREAMS TO MAIN SUBSCRIBER =================\n updateSourceSubscription(obs$, autoClosesBool = false, rel) {\n // const directionArr = sendDownStream === true ? this.$dirs.DI : this.$dirs.I;\n const obj = {\n observable: obs$,\n autoClosesBool,\n rel\n }\n this.tracer('updateSourceSubscription ', this.vsnum, obj)\n this.uberSource$.next(obj)\n }\n\n // ============================= SUBSCRIBER METHODS ==============================\n onSubscribeToSourcesNext(payload = {}) {\n const defaultToFn = defaultTo((p) => this.sendExtendedStreams(p))\n\n // ****USE REGEX AS PREDICATE CHECK FOR PAYLOAD.ACTION IN HASH METHODS OBJ\n // const hashAction = this.props.hashSourceMethods[payload.action];\n const hashActionStr = findStrOrRegexMatchStr(this.props.hashSourceMethods,\n payload.action)\n const hashAction = this.props.hashSourceMethods[hashActionStr]\n // console.log('S PAYLOAD ', this.props.name, typeof (hashAction), payload);\n\n const fn = defaultToFn(hashAction)\n\n // console.log('hash methods ', fn, this.props.name, payload.action, hashActionStr, this.props.hashSourceMethods);\n\n fn(payload)\n // console.log(fn, payload, ' THE PAYLOAD FROM SUBSCRIBE IS ', ' ---- ', ' ---> ', this.props);\n // console.log('EXTIRPATER VS NEXT', this.constructor.name, payload);\n\n this.tracer('onSubscribeToSourcesNext', { payload })\n }\n\n onSubscribeToSourcesError(payload = '') {\n console.log('ALL ERROR ', this.constructor.name, payload)\n }\n\n /*\n attachChildToView(data) {\n // let childRenderData = data.attachData;\n // console.log('CHILD DATA ', this.constructor.name, childRenderData);\n // this.openSpigot('ATTACH_CHILD_TO_SELF', {childRenderData});\n }\n */\n\n onSubscribeToSourcesComplete() {\n // console.log('==== EXTIRPATER ALL COMPLETED ====', this.constructor.name);\n this.tracer('onSubscribeToSourcesComplete', 'VS_DETRITUS_COLLECT')\n\n this.openSpigot('VS_DETRITUS_COLLECT')\n }\n\n sendExtendedStreams(payload) {\n this.tracer('sendExtendedStreams', payload)\n // console.log('extended methods ', payload.action, payload);\n this.openSpigot(payload.action, payload)\n }\n\n // ===================================== VS_SPAWN METHODS ==================================\n renderAndAttachToParent(attachData) {\n // let childRenderData = attachData;\n this.openSpigot('VS_SPAWN_AND_ATTACH_TO_PARENT', attachData)\n }\n\n renderView() {\n this.openSpigot('VS_SPAWN')\n }\n\n renderViewAndAttachToDom(node, type, attachType) {\n const attachData = { node, type, attachType }\n this.openSpigot('VS_SPAWN_AND_ATTACH_TO_DOM', { attachData })\n }\n\n // ===================================== EXTIRPATE METHODS =================================\n checkParentDispose(p) {\n if (p.from$ === 'parent') {\n this.disposeViewStream(p)\n }\n }\n\n onBeforeDispose() {\n\n }\n\n // ===================================== SINK$ METHODS =================================\n\n /**\n *\n * Wraps window.setTimeout with a check to see if \"this\" ViewStream element and its props property still exists\n * @property {function} fn - = 'function'; The local method that is to be called.\n * @property {number} ms - = 0; The time, in milleseconds, for the timeout.\n * @property {boolean} bind - = false; When true, will bind the method to 'this'.\n *\n */\n\n setTimeout(fn, ms = 0, bind = false) {\n const timeoutMethod = (...args) => {\n if (this !== undefined && this.props !== undefined) {\n const methodFn = bind === true ? fn.bind(this) : fn\n apply(methodFn, args)\n }\n }\n window.setTimeout(timeoutMethod, ms)\n }\n\n /**\n *\n * Begins the removal process of the ViewStream instance along with all of its chained ViewStream children.\n */\n disposeViewStream(p) {\n // console.log('EXTIRPATER VS onDispose ', this.constructor.name);\n this.onBeforeDispose()\n this.openSpigot('EXTIRPATE')\n }\n\n onChildDispose(p) {\n }\n\n onParentDisposing(p) {\n // this.updateSourceSubscription(this._source$);\n this.openSpigot('EXTIRPATE')\n }\n\n onReadyToGC(p) {\n const isInternal = p.from$ !== undefined && p.from$ === 'internal'\n if (isInternal) {\n // this.openSpigot('VS_DETRITUS_COLLECT');\n }\n this.tracer('onReadyToGC', isInternal, p)\n }\n\n openSpigot(action, obj = {}) {\n if (this.props !== undefined) {\n this.props.action = action\n const data = mergeRight(this.props, obj)\n // let data = Object.assign({}, this.props, obj);\n\n this.sink$.next(Object.freeze(data))\n }\n }\n\n setAttachData(attachType, query) {\n const checkQuery = () => {\n const q = this.props.el.querySelector(query)\n const isDevMode = ViewStream.isDevMode()\n if (isDevMode === true && is(String, query) && isNil(q)) {\n console.warn(`Spyne Warning: The appendView query in ${this.props.name}, '${query}', appears to not exist!`)\n }\n return q\n }\n\n return {\n node: this.props.el,\n type: 'ViewStreamObservable',\n attachType,\n query: checkQuery(query)\n }\n }\n\n getParentEls(el, num) {\n const getElem = el => el.parentElement\n let iter = 0\n let parentEl = el\n while (iter < num) {\n parentEl = getElem(parentEl)\n iter++\n }\n return parentEl\n }\n\n setAttachParentData(attachType, query, level) {\n query = query !== '' ? query : undefined\n const node = this.getParentEls(this.props.el, level)\n return {\n node,\n type: 'ViewStreamObservable',\n attachType,\n query: node.querySelector(query)\n }\n }\n\n onMapViewSource(payload = {}) {\n this.props = mergeRight(this.props, payload)\n return payload\n }\n\n // ====================== ATTACH STREAM AND DOM DATA AGGREGATORS==========================\n exchangeViewsWithChild(childView, attachData) {\n this.addChildStream(childView.sourceStreams.toParent$)\n childView.addParentStream(this.sourceStreams.toChild$, attachData)\n }\n\n /**\n * Appends a ViewStream object to an existing dom element.\n * @param {HTMLElement} node the ViewStream child that is to be attached.\n * @example\n * // returns\n * <body>\n * <h2>Hello World</h2>\n * </body>\n *\n * let viewStream = new ViewStream('h2', 'Hello World');\n * viewStream.appendToDom(document.body);\n *\n */\n appendToDom(node) {\n // console.log(\"append to dom \",this.props.vsid, this.props.el);\n if (this.props.el !== undefined) {\n console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be appendedToDom. This may create unsusual side effects!`)\n }\n this.renderViewAndAttachToDom(node, 'dom', 'appendChild')\n }\n\n appendToDomAfter(node) {\n if (this.props.el !== undefined) {\n console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be appendedToDomAfter. This may create unsusual side effects!`)\n }\n this.renderViewAndAttachToDom(node, 'dom', 'after')\n }\n\n /**\n * Prepends the current ViewStream object to an existing dom element.\n * @param {HTMLElement} node the ViewStream child that is to be attached.\n *\n * @example\n * this.prependToDom(document.body);\n *\n */\n\n prependToDom(node) {\n if (this.props.el !== undefined) {\n console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be prependedToDom. This may create unsusual side effects!`)\n }\n this.renderViewAndAttachToDom(node, 'dom', 'prependChild')\n }\n\n /**\n * This method appends a child ViewStream object. <br>After the attachment, rxjs observables are exchanged between the parent and child ViewStream objects.<br><br>\n * @param {ViewStream} v the ViewStream child that is to be attached.\n * @param {string} query a querySelector within this ViewStream.\n *\n * @example\n * // returns\n * <body>\n * <main>\n * <h2>Hello World</h2>\n * </main>\n * </body>\n *\n *\n * let parentView = new ViewStream('main');\n * parentView.appendToDom(document.body);\n *\n * let childView = new ViewStream({tagName:'h2', data:'Hello World'};\n * parentView.appendView(childView)\n *\n * */\n appendView(v, query) {\n this.exchangeViewsWithChild(v, this.setAttachData('appendChild', query))\n }\n\n appendViewAfter(v, query) {\n this.exchangeViewsWithChild(v, this.setAttachData('after', query))\n }\n\n /**\n * This method appends a child ViewStream object to a parent ViewStream object.\n * @param {ViewStream} v the ViewStream parent.\n * @param {string} query a querySelector within this ViewStream.\n * @param {level} this parameters can attach the viewStream's dom element up the dom tree while still maintaining the parent-child relationship of the ViewStream objects.\n *\n * @example\n * // returns\n * <body>\n * <main>\n * <h2>Hello World</h2>\n * </main>\n * </body>\n *\n *\n * let parentView = new ViewStream('main');\n * parentView.appendToDom(document.body);\n *\n * let childView = new ViewStream({tagName:'h2', data:'Hello World'};\n * childView.appendToParent(parentView)\n *\n * */\n\n appendViewToParentEl(v, query, level = 1) {\n this.exchangeViewsWithChild(v,\n this.setAttachParentData('appendChild', query, level))\n }\n\n /**\n * This method prepends a child ViewStream object to a parent ViewStream object.\n * @param {ViewStream} v\n * @param {string} query\n * @param {number} level\n *\n * @property {ViewStream} v - = undefined; the ViewStream parent.\n * @property {string} query - = undefined; a querySelector within this ViewStream.\n * @property {number} level - = 1; this parameter can attach the viewStream's dom element up the dom tree while still maintaining the parent-child relationship of the ViewStream objects.\n *\n * @example\n * let parentView = new ViewStream('main');\n * parentView.prependToDom(document.body);\n *\n * let childView = new ViewStream({tagName:'h2', data:'Hello World'};\n * childView.prependViewToParentEl(parentView)\n *\n * */\n prependViewToParentEl(v, query, level = 1) {\n this.exchangeViewsWithChild(v,\n this.setAttachParentData('prependChild', query, level))\n }\n\n /**\n *\n *\n * This method prepends a child ViewStream object to the current ViewStream object. <br>After the attachment, rxjs observables are exchanged between the parent and child ViewStream objects.<br><br>\n * @param {ViewStream} v the ViewStream child that is to be attached.\n * @param {string} query a querySelector within this ViewStream.\n *\n * @example\n * // returns\n * <body>\n * <main>\n * <h2>Hello World</h2>\n * </main>\n * </body>\n *\n * let parentView = new ViewStream('main');\n * parentView.appendToDom(document.body);\n *\n * let childView = new ViewStream({tagName:'h2', data:'Hello World'};\n * parentView.prependView(childView);\n *\n * */\n\n prependView(v, query) {\n this.exchangeViewsWithChild(v, this.setAttachData('prependChild', query))\n }\n\n /**\n * Appends a ViewStream object that are not rendered to the #spyne-null-views div.\n */\n appendToNull() {\n const node = document.getElementById('spyne-null-views')\n this.renderViewAndAttachToDom(node, 'dom', 'appendChild')\n }\n\n onVSRendered(payload) {\n // console.log('VS_SPAWN: ', this.props.name, payload);\n if (payload.from$ === 'internal') {\n // this.props['el'] = payload.el.el;\n\n this.postRender()\n // this.broadcaster = new Spyne.ViewStreamBroadcaster(this.props, this.broadcastEvents);\n }\n }\n\n postRender() {\n if (this._postRenderedCalled === true) {\n return\n }\n\n this.beforeAfterRender()\n this.afterRender()\n\n this.onRendered()\n const startAnimFrameAfterRendered = () => this.onAnimFrameAfterRendered()\n requestAnimationFrame(startAnimFrameAfterRendered)\n\n if (this.isDevMode === true) {\n const eventsArr = this.broadcastEvents()\n const isValidArr = ViewStream.isValidNestedArr(eventsArr)\n if (isValidArr === false) {\n console.warn(`Spyne Warning: The array returned from broadcastEvents in ${this.props.name}, '${JSON.stringify(eventsArr)}', does not appear to be properly formatted!`)\n }\n }\n this.initializeChannels()\n this.viewsStreamBroadcaster = new ViewStreamBroadcaster(this.props, this.broadcastEvents.bind(this))\n this.afterBroadcastEvents()\n\n this._postRenderedCalled = true\n }\n\n addTraits(traits) {\n if (traits.constructor.name !== 'Array') {\n traits = [traits]\n }\n const addTrait = (TraitClass) => {\n new TraitClass(this)\n }\n\n traits.forEach(addTrait)\n }\n\n // ================================= METHODS TO BE EXTENDED ==============================\n\n afterBroadcastEvents() {\n if (this.isDevMode === true) {\n const pullActionsFromList = (arr) => arr[0]\n const nestedActionsArr = this.addActionListeners()\n\n const actionsArr = nestedActionsArr.map(pullActionsFromList)\n\n const isValidArr = ViewStream.isValidNestedArr(nestedActionsArr)\n\n if (isValidArr === false) {\n console.warn(`Spyne Warning: The array returned from addActionsListeners in ${this.props.name}, '${JSON.stringify(nestedActionsArr)}', does not appear to be properly formatted!`)\n } else {\n const checkForExistingMethod = (arr) => {\n const method = defaultTo('', arr[1])\n const isMethod = is(Function, this[method])\n if (isMethod === false) {\n console.warn(`Spyne Warning: The method in addActionListeners nested Array, '${JSON.stringify(arr)}', in ${this.props.name}, does not appear to exist!`)\n }\n }\n compose(forEach(checkForExistingMethod), defaultTo([]))(nestedActionsArr)\n }\n\n const delayForProxyChannelResets = () => {\n if (path(['props', 'addedChannels'], this) !== undefined) {\n ViewStream.checkIfActionsAreRegistered.bind(this)(this.props.addedChannels, actionsArr)\n }\n }\n this.setTimeout(delayForProxyChannelResets, 500)\n }\n }\n\n setDataVSID() {\n this.props.el.dataset.vsid = this.props.vsid// String(this.props.vsid).replace(/^(vsid-)(.*)$/, '$2');\n }\n\n beforeAfterRender() {\n /* let dm2 = function(el) {\n return function(str = '') {\n return new DomItemSelectors(el, str);\n };\n }; */\n\n // this.props.el$ = dm2(this.props.el);\n this.setDataVSID()\n this.props.el$ = ViewStreamSelector(this.props.el)\n // console.log('EL IS ', this.props.el$.elArr);\n // window.theEl$ = this.props.el$;\n }\n\n // THIS IS AN EVENT HOLDER METHOD BECAUSE SENDING DOWNSTREAM REQUIRE THE PARENT TO HAVE A METHOD\n downStream() {\n\n }\n\n /**\n *\n * This method is called as soon as the element has been rendered.\n *\n */\n\n onRendered() {\n }\n\n /**\n *\n * This method is useful to add animation classes to be called immediately after rendering.\n *\n */\n\n onAnimFrameAfterRendered() {\n }\n\n /**\n *\n * (Deprecated. Use onRendered). This method is called as soon as the element has been rendered.\n *\n */\n\n afterRender() {\n }\n\n broadcastEvents() {\n // ADD BUTTON EVENTS AS NESTED ARRAYS\n return []\n }\n\n /**\n *\n * Automatically connect to an instance of registered channels, such as 'DOM', 'UI', and 'ROUTE' channels.\n *\n *\n * @example\n *\n * let uiChannel = this.getChannel('UI');\n *\n * uiChannel\n * .filter((p) => p.data.id==='#my-button')\n * .subscribe((p) => console.log('my button was clicked ', p));\n *\n * */\n\n getChannel(channel) {\n const isValidChannel = c => registeredStreamNames().includes(c)\n const error = c => console.warn(\n `channel name ${c} is not within ${registeredStreamNames}`)\n const startSubscribe = (c) => {\n const obs$ = SpyneAppProperties.channelsMap.getStream(c).observer\n\n return obs$.pipe(takeWhile(p => this.deleted !== true))\n }// getGlobalParam('streamsController').getStream(c).observer;\n\n const fn = ifElse(isValidChannel, startSubscribe, error)\n\n return fn(channel)\n }\n\n /**\n * CHECKS TO SEE IF CHANNELS HAVE BEEN ADDED TO props.channels object;\n */\n initializeChannels() {\n const addChannel = (channel) => {\n const [channelName, skipFirst = false] = Array.isArray(channel) ? channel : [channel]\n this?.addChannel(channelName, skipFirst)\n }\n if (Array.isArray(this?.props?.channels)) {\n this?.props?.channels?.forEach(addChannel)\n } else if (Array.isArray(this?.props?.channel)) {\n console.warn('props.channel is not a ViewStream property. Do you mean props.channels?')\n }\n }\n\n /**\n *\n * Preferred method to connect to instances of registered channels, such as 'DOM', 'UI', and 'ROUTE' channels.\n *\n * Add Channel will automatically unsubscribe to the channel, whereas the getChannel method requires the developer to manually unsubscribe.\n *\n * @param {string} str The name of the registered Channel that was added to the Channels Controller.\n * @param {boolean} bool false, add true if the View should wait for this channel to unsubscribe before removing itself.\n * @param {sendDownStream} bool The direction where the stream is allowed to travel.\n *\n * @example\n *\n * let routeChannel = this.addChannel('ROUTE');\n *\n * addActionListeners() {\n * return [\n * ['CHANNEL_ROUTE_CHANGE_EVENT', 'onMapRouteEvent']\n * ]\n * }\n *\n * onMapRouteEvent(p) {\n * console.log('the route value is ', p);\n * }\n *\n *\n * */\n\n addChannel(channelName, skipFirst = false, sendDownStream = false, bool = false) {\n const directionArr = sendDownStream === true ? this.$dirs.CI : this.$dirs.I\n const mapDirection = p => {\n // et p2 = defaultTo({}, clone(p));\n const pl = p// || {};\n pl.$dir = directionArr\n return pl\n // return deepMerge(dirObj, p2);\n // Object.assign({$dir: directionArr}, clone(p))\n }\n if (this?.props?.addedChannels?.includes(channelName) === true) {\n // CHECKS IF CHANNEL HAS ALREADY BEEN ADDED\n return\n }\n const isLocalEventCheck = path(['srcElement', 'isLocalEvent'])\n const cidCheck = path(['srcElement', 'vsid'])\n const cidMatches = p => {\n const vsid = cidCheck(p)\n const isLocalEvent = isLocalEventCheck(p)\n const filterEvent = isLocalEvent !== true || vsid === this.props.vsid\n // console.log(\"checks \",vsid,this.props.vsid, isLocalEvent,filterEvent);\n return filterEvent\n }\n\n const pipeArr = [map(mapDirection), filter(cidMatches)]\n if (skipFirst === true) {\n pipeArr.unshift(skip(1))\n }\n\n const channel$ = this.getChannel(channelName).pipe(...pipeArr)\n this.updateSourceSubscription(channel$, false)\n this.props.addedChannels.push(channelName)\n }\n\n checkIfChannelExists(channelName) {\n const channelExists = SpyneAppProperties.channelsMap.testStream(channelName)\n if (channelExists !== true) {\n console.warn(`SPYNE WARNING: The ChannelPayload from ${this.props.name}, has been sent to a channel, ${channelName}, that has not been registered!`)\n }\n return channelExists\n }\n\n /**\n *\n * @param {String} channelName\n * @param {Object} payload\n * @param {String} action\n * @property {string} channelName - = undefined; The name of the registered Channel.\n * @property {object} payload - = {}; The main data to send to the channel.\n * @property {string} action - = \"VIEWSTREAM_EVENT\"; The action sent to the channel.\n * @desc\n * This method creates a versatile and consistent method to communicate with all channels.\n *\n *\n */\n\n sendInfoToChannel(channelName, pl = {}, action) {\n const payload = pl\n\n const defaultToAction = defaultTo('VIEWSTREAM_EVENT')\n const channelDefaultActionHash = {\n CHANNEL_ROUTE: 'CHANNEL_ROUTE_CHANGE_EVENT'\n }\n const getActionFn = compose(defaultToAction, prop(channelName))\n\n action = action || getActionFn(channelDefaultActionHash)\n\n const data = { payload, action }\n\n try {\n data.srcElement = compose(pick(['id', 'vsid', 'class', 'tagName']), prop('props'))(this)\n if (this.checkIfChannelExists(channelName) === true) {\n if (/CHANNEL_LIFECYCLE/.test(action) === false) {\n Object.defineProperties(data, {\n payload: {\n get: () => safeClone(pl)\n }\n })\n }\n const obs$ = of(data)\n return new ViewStreamPayload(channelName, obs$, data)\n }\n } catch (e) {\n console.warn('SPYNE WARNING ', e)\n }\n }\n\n tracer(...args) {\n this.sendLifecycleMethod(...args)\n }\n\n sendLifecycleMethodInactive() {\n\n }\n\n sendLifecycleMethodActive(val, p) {\n const isRendered = where({\n from$: equals('internal'),\n action: equals('VS_SPAWNED_AND_ATTACHED_TO_PARENT')\n }, p)\n const isDisposed = p === 'VS_DETRITUS_COLLECT'\n if (isRendered === true) {\n this.sendInfoToChannel('CHANNEL_LIFECYCLE', { action:'CHANNEL_LIFECYCLE_RENDERED_EVENT' }, 'CHANNEL_LIFECYCLE_RENDERED_EVENT')\n } else if (isDisposed === true) {\n this.sendInfoToChannel('CHANNEL_LIFECYCLE', { action:'CHANNEL_LIFECYCLE_DISPOSED_EVENT' }, 'CHANNEL_LIFECYCLE_DISPOSED_EVENT')\n }\n }\n\n createActionFilter(selectors, data) {\n return new ChannelPayloadFilter(selectors, data)\n }\n\n isLocalEvent(channelPayloadItem) {\n const itemEl = path(['srcElement', 'el'], channelPayloadItem)\n const thisEl = path(['props', 'el'], this)\n // console.log('this el is ',{thisEl, itemEl});\n return ViewStream.elIsDomElement(thisEl) && ViewStream.elIsDomElement(itemEl) && thisEl.contains(itemEl)\n }\n\n // =======================================================================================\n addMixins() {\n // ==================================\n // BASE CORE MIXINS\n // ==================================\n const coreMixins = baseCoreMixins()\n this.createId = coreMixins.createId\n }\n}\n","import { filter } from './filter';\nexport function skip(count) {\n return filter(function (_, index) { return count <= index; });\n}\n//# sourceMappingURL=skip.js.map","import { ViewStream } from '../views/view-stream.js'\nimport { curry } from 'ramda'\nexport class RouteChannelUpdater {\n constructor(cxt) {\n const name = String(cxt.props.name)\n const id = `${name}_ROUTE_UPDATER`\n\n const sendRouteChannelUpdate = curry(RouteChannelUpdater.createTemporaryViewStreamObj)\n return sendRouteChannelUpdate({ id, name })\n }\n\n static createTemporaryViewStreamObj(props, data) {\n const { name, id } = props\n const payload = data\n const vs = new ViewStream({\n id, name, data\n })\n\n vs.onRendered = () => {\n vs.sendInfoToChannel('CHANNEL_ROUTE', payload)\n }\n\n vs.afterBroadcastEvents = () => {\n vs.disposeViewStream()\n }\n\n vs.appendToNull()\n }\n}\n","import { registeredStreamNames } from './channels-config.js'\nimport { ChannelPayload } from './channel-payload-class.js'\nimport { safeCloneDeep } from '../utils/safe-clone.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { RouteChannelUpdater } from '../utils/route-channel-updater.js'\n\nimport { ReplaySubject, Subject, forkJoin, EMPTY } from 'rxjs'\nimport { filter, map, take, combineLatestWith } from 'rxjs/operators'\nimport {\n ifElse,\n identity,\n head,\n mergeAll,\n objOf,\n view,\n is,\n chain,\n lensIndex,\n always,\n fromPairs,\n path,\n isEmpty,\n equals,\n prop,\n propEq\n , map as rMap\n} from 'ramda'\n\nexport class Channel {\n /**\n * @module Channel\n * @type extendable\n *\n * @desc\n * <p>The Channel component wraps methods and functionality around an RxJs Subject, to create a one-way data flow between itself and other Channels and ViewStreams.</p>\n * <p>Channels get data by importing json objects, subscribing to other Channels and by parsing ViewStream info.</p>\n * <h3>The Basic Channel Structure</h3>\n * <ul>\n * <li>Channels requires a unique name, for example, <b>CHANNEL_MYCHANNEL</b>, which components use to select and subscribe to any channel.</li>\n * <li>Channels are instantiated and 'registered' with the LINK['SpyneApp', 'spyne-app'].</li>\n * <li>Channels remain persistent and are not deleted.</li>\n * </ul>\n * <h3>Components that extend Channel</h3>\n * <ul>\n * <li>The four Spyne Channels, LINK['SpyneChannelUI', 'spyne-channel-u-i'], LINK['SpyneChannelWindow', 'spyne-channel-window'], LINK['SpyneChannelRoute', 'spyne-channel-route'] and LINK['SpyneChannelLifecycle', 'spyne-channel-lifecycle'], all extend Channel.</li>\n * <li>ChannelFetch also extends Channel, adds a ChannelFetchUtil component to immediately publish fetched responses.</li>\n * </ul>\n * <h3>Sending ChannelPayloads</h3>\n * <p>Channels send data using the <a class='linker' data-channel=\"ROUTE\" data-event-prevent-default=\"true\" data-menu-item=\"channel-send-channel-payload\" href=\"/guide/reference/channel-send-channel-payload\" >sendChannelPayload</a>\n method.</p>\n *\n *\n * <h3>Receiving Data from ViewStream Instances</h3>\n * <p>ViewStreams can send data to any custom channel using the <a class='linker' data-channel=\"ROUTE\" data-event-prevent-default=\"true\" data-menu-item=\"view-stream-send-into-to-channel\" href=\"/guide/reference/view-stream-send-info-to-channel\" >sendInfoToChannel</a>\n method. Channels cam listen to any ViewStream data directed to itself through the default method, <a class='linker' data-channel=\"ROUTE\" data-event-prevent-default=\"true\" data-menu-item=\"channel-on-view-stream-info\" href=\"/guide/reference/channel-on-view-stream-info\" >onViewStreamInfo</a>. </p>\n *\n *\n * @example\n * TITLE[\"<h4>Registering a New Channel Instance</h4>\"]\n * SpyneApp.register(new Channel(\"CHANNEL_MYCHANNEL\");\n *\n *\n * @constructor\n * @param {string} CHANNEL_NAME\n * @param {Object} props This json object takes in parameters to initialize the channel\n * @property {String} CHANNEL_NAME - = undefined; This will be the registered name for this channel.\n * @property {Object} props - = {}; The props objects allows for custom properties for the channel.\n * @property {Object} props.sendCachedPayload - = false; Publishes its most current payload to late subscribers, when set to true.\n *\n */\n constructor(CHANNEL_NAME, props = {}) {\n this.addRegisteredActions.bind(this)\n this.createChannelActionsObj(CHANNEL_NAME, props.extendedActionsArr)\n\n // Basic props setup\n props.name = CHANNEL_NAME\n props.defaultActions = props.data !== undefined ? [`${props.name}_EVENT`] : []\n this.props = props\n\n this.props.isRegistered = false\n this.props.isProxy =\n this.props.isProxy === undefined ? false : this.props.isProxy\n\n // Determine a default from presence of props.data\n const defaultCachedPayloadBool = this.props.data !== undefined\n\n // If props.replay is defined, override sendCachedPayload with it.\n // Otherwise, use the existing sendCachedPayload property or default.\n if (typeof this.props.replay !== 'undefined') {\n this.props.sendCachedPayload = this.props.replay\n } else {\n this.props.sendCachedPayload =\n this.props.sendCachedPayload === undefined\n ? defaultCachedPayloadBool\n : this.props.sendCachedPayload\n }\n\n this.sendPayloadToRouteChannel = new RouteChannelUpdater(this)\n this.createChannelActionMethods()\n\n // Set up streams\n this.streamsController = SpyneAppProperties.channelsMap\n const observer$ = this.getMainObserver()\n this.checkForPersistentDataMode = Channel.checkForPersistentDataMode.bind(this)\n this.observer$ = this.props.observer = observer$\n\n // Subscribe to DISPATCHER\n const dispatcherStream$ = this.streamsController.getStream('DISPATCHER')\n const payloadPredByChannelName = propEq(props.name, 'name')\n dispatcherStream$\n .pipe(filter(payloadPredByChannelName))\n .subscribe((val) => this.onReceivedObservable(val))\n }\n\n getMainObserver() {\n if (this.streamsController === undefined) {\n console.warn(`Spyne Warning: The following channel, ${this.props.name}, appears to be registered before Spyne has been initialized.`)\n }\n\n const proxyExists = this.streamsController.testStream(this.props.name)\n\n if (proxyExists === true) {\n return this.streamsController.getProxySubject(this.props.name, this.props.sendCachedPayload)\n } else {\n return this.props.sendCachedPayload === true ? new ReplaySubject(1) : new Subject()\n }\n }\n\n // OVERRIDE INITIALIZATION METHOD\n /**\n * <p>(Deprecated. Use onRegistered). This method is empty and is called as soon as the Channel has been registered.</p>\n * <p>Tasks such as subscribing to other channels, and sending initial payloads can be added here.</p>\n */\n onChannelInitialized() {\n\n }\n\n // OVERRIDE INITIALIZATION METHOD\n /**\n * <p>This method is empty and is called as soon as the Channel has been registered.</p>\n * <p>Tasks such as subscribing to other channels, and sending initial payloads can be added here.</p>\n */\n onRegistered(props = this.props) {\n if (props.data !== undefined) {\n const action = Object.keys(this.channelActions)[0]\n // console.log(\"CHANNELS ACTIONS IS \",this.channelActions);\n // Object(this.channelActions).keys[0];\n this.sendChannelPayload(action, props.data)\n }\n }\n\n get isProxy() {\n return this.props.isProxy\n }\n\n get channelName() {\n return this.props.name\n }\n\n /**\n *\n * @desc\n * returns the source observable for the channel\n */\n get observer() {\n return this.observer$\n }\n\n checkForTraits() {\n const addTraits = (traits) => {\n if (traits.constructor.name !== 'Array') {\n traits = [traits]\n }\n const addTrait = (TraitClass) => {\n return new TraitClass(this)\n }\n\n traits.forEach(addTrait)\n }\n\n if (this.props.traits !== undefined) {\n addTraits(this.props.traits)\n }\n }\n\n // DO NOT OVERRIDE THIS METHOD\n initializeStream() {\n this.checkForTraits()\n this.onChannelInitialized()\n this.checkForPersistentDataMode()\n this.onRegistered()\n this.props.isRegistered = true\n }\n\n static checkForPersistentDataMode(props = this.props, actionsObj = this.channelActions) {\n const actionsObjIsEmpty = isEmpty(actionsObj)\n const dataIsAdded = prop('data', props) !== undefined\n const autoSetToCachedPayload = actionsObjIsEmpty === true && dataIsAdded === true\n const setDefaultActionsObj = () => {\n const { name } = props\n const actionStr = `${name}_EVENT`\n return {\n [actionStr] : actionStr\n }\n }\n\n if (autoSetToCachedPayload) {\n props.sendCachedPayload = true\n actionsObj = setDefaultActionsObj()\n\n if (this.channelActions !== undefined) {\n this.channelActions = actionsObj\n }\n }\n\n // console.log(\"PROPS IS \",{actionsObjIsEmpty, dataIsAdded, props, actionsObj}, this.channelActions)\n return { props, actionsObj }\n }\n\n setTrace(bool) {\n }\n\n createChannelActionsObj(name, extendedActionsArr = []) {\n const getActionVal = ifElse(is(String), identity, head)\n const mainArr = extendedActionsArr.concat(this.addRegisteredActions(name))\n const arr = rMap(getActionVal, mainArr)\n const converter = str => objOf(str, str)\n const obj = mergeAll(chain(converter, arr))\n this.channelActions = obj\n }\n\n createChannelActionMethods() {\n const defaultFn = 'onViewStreamInfo'\n const getActionVal = ifElse(is(String), identity, head)\n const delayCheckIfTraitMethodHasBeenAdded = (methodStr, val) => {\n const delayer = () => {\n if (typeof this[methodStr] !== 'function') {\n console.warn(`\"${this.props.name}\", REQUIRES THE FOLLOWING METHOD ${methodStr} FOR ACTION, ${val[0]}`)\n }\n }\n window.setTimeout(delayer, 100)\n }\n\n const getCustomMethod = val => {\n const methodStr = view(lensIndex(1), val)\n delayCheckIfTraitMethodHasBeenAdded(methodStr, val)\n return methodStr\n }\n\n const getArrMethod = ifElse(is(String), always(defaultFn), getCustomMethod)\n\n const createObj = val => {\n const key = getActionVal(val)\n const method = getArrMethod(val)\n return [key, method]\n }\n\n this.channelActionMethods = fromPairs(rMap(createObj, this.addRegisteredActions()))\n\n // console.log('the channel action methods ',this.channelActionMethods);\n }\n\n /**\n *\n * @desc\n * <p>Channels send along Action names along with its payload.</p>\n * <p>Before any action can be used, that action needs to be registered using this method.</p>\n * <p>ViewStream instances can filter ChannelPayloads by binding specific LINK['actions to local methods', 'view-stream-add-action-listeners'].</p>\n * <p>Forcing registration of actions allows Spyne to validate Actions, and is also a useful way to keep track of all Actions that are intended to be used.</p>\n *\n * @returns\n * Array of Strings\n *\n * @example\n * TITLE[\"<h4>Registering Actions in the addRegisteredActions method</h4>\"]\n * addRegisteredActions() {\n * return [\n * 'CHANNEL_MY_CHANNEL_EVENT',\n * 'CHANNEL_MY_CHANNEL_UPDATE_EVENT'\n * ];\n * }\n *\n */\n addRegisteredActions() {\n let arr = []\n if (path(['props', 'data'], this)) {\n arr = [`${this.props.name}_EVENT`]\n }\n return arr\n }\n\n onReceivedObservable(obj) {\n this.onIncomingObservable(obj)\n }\n\n getActionMethodForObservable(obj) {\n obj.unpacked = true\n const defaultFn = this.onViewStreamInfo.bind(this)\n\n const methodStr = path(['data', 'action'], obj)\n const methodVal = prop(methodStr, this.channelActionMethods)\n\n let fn = defaultFn\n\n if (methodVal !== undefined && methodVal !== 'onViewStreamInfo') {\n const methodExists = typeof (this[methodVal]) === 'function'\n if (methodExists === true) {\n fn = this[methodVal].bind(this)\n }\n }\n\n return fn\n }\n\n onIncomingObservable(obj) {\n const eqsName = equals(obj.name, this.props.name)\n const { action, payload, srcElement } = obj.data\n // console.log(\"INCOMING \",{action, payload, srcElement}, {obj});\n const mergeProps = (d) => mergeAll([d, { action: prop('action', d) }, prop('payload', d), prop('srcElement', d)])\n const dataObj = obsVal => ({\n clone: () => mergeProps(obj.data),\n // proxy-preserving clone — mirrors ChannelPayload.safeClone for\n // channel-side getChannel subscribers\n safeClone: () => {\n const revivedPayload = safeCloneDeep(payload)\n return mergeAll([\n { payload: revivedPayload },\n revivedPayload,\n { action },\n { srcElement },\n { event: obsVal }\n ])\n },\n action,\n payload,\n srcElement,\n event: obsVal\n })\n const onSuccess = (obj) => obj.observable.pipe(map(dataObj))\n .subscribe(this.getActionMethodForObservable(obj))\n const onError = () => {}\n return eqsName === true ? onSuccess(obj) : onError()\n }\n\n /**\n *\n * <p>ViewSteam instances can send info to channels through its LINK['sendInfoToChannel, 'view-stream-send-info-to-channel'] method.</p>\n * <p>Data received from ViewStreams are directed to this method.</p>\n * <p>ViewStreams send data using the LINK['ViewStreamPayload', 'view-stream-payload'] format.</p>\n *\n * @param {ViewStreamPayload} obj\n *\n * @example\n * TITLE[\"<h4>Parsing Data Returned from a ViewStream Instance</h4>\"]\n * onViewStreamInfo(obj){\n * let data = obj.viewStreamInfo;\n * let action = data.action;\n * let newPayload = this.parseViewStreamData(data);\n * this.sendChannelPayload(action, newPayload);\n * }\n *\n *\n */\n onViewStreamInfo(obs) {\n }\n\n /**\n *\n * @desc\n *\n * <p>This method takes an action, a data object and other properties to create and publish a LINK['ChannelPayload', 'channel-payload'] object.</p>\n * <p>Once the action and payload is validated, this method will publish the data by using the channel's source Subject next() method.\n * <p>This consistent format allows subscribers to understand how to parse any incoming channel data.</p>\n *\n * @param {String} action\n * @param {Object} payload\n * @param {HTMLElement} srcElement\n * @param {HTMLElement} event\n * @param {Observable} obs$\n * @property {String} action - = undefined; Required. An action is a string, typically in the format of \"CHANNEL_NAME_ACTION_NAME_EVENT\", and that has been added in the addRegisteredActions method.\n * @property {Object} payload - = undefined; Required. This can be any javascript object and is used to send any custom data.\n * @property {HTMLElement} srcElement - = Not Required. undefined; This can be either the element returned from the UI Channel, or the srcElement from a ViewStream instance.\n * @property {UIEvent} event - = undefined; Not Required. This will be defined if the event is from the UI Channel.\n * @property {Observable} obs$ - = this.observer; This default is the source observable for this channel.\n *\n * @example\n * TITLE['<h4>Publishing a ChannelPayload</h4>']\n * let action = \"CHANNEL_MY_CHANNEL_REGISTERED_ACTION_EVENT\";\n * let data = {foo:\"bar\"};\n * this.sendChannelPayload(action, data);\n *\n */\n sendChannelPayload(action, payload, srcElement = {}, event = {}, obs$ = this.observer$) {\n // MAKES ALL CHANNEL BASE AND DATA STREAMS CONSISTENT\n\n const channelPayloadItem = new ChannelPayload(this.props.name, action, payload, srcElement, event)\n // console.log(\"CHANNEL STREEM ITEM \",channelPayloadItem);\n\n // const onNextFrame = ()=>obs$.next(channelPayloadItem);\n // requestAnimationFrame(onNextFrame)\n\n obs$.next(channelPayloadItem)\n }\n\n /**\n *\n * <p>Allows channels to subscribe to other channels.</p>\n * <p>This method returns the source rxjs Subject for the requested Channel, which can be listened to by calling its subscribe method.</p>\n * <p>Knowledge of rxjs is not required to subscribe to and parse Channel data.</p>\n * <p>But accessing the rxjs Subject gives developers the ability to use all of the available rxjs mapping and observable tools.</p>\n *\n * @param {String} channelName The registered name of the requested channel.\n * @returns\n * The source rxjs Subject of the requested channel.\n * @example\n * TITLE[\"<h4>Subscribing to a Channel Using the getChannel method</h4>\"]\n * let route$ = this.getChannel(\"CHANNEL_ROUTE\")\n * route$.subscribe(localMethod);\n *\n *\n */\n getChannel(channelName, payloadFilter) {\n const isValidChannel = c => registeredStreamNames().includes(c)\n const error = c => console.warn(\n `channel name ${c} is not within ${registeredStreamNames}`)\n const startSubscribe = (c) => {\n const obs$ = this.streamsController.getStream(c).observer\n if (obs$.source) {\n obs$.source.channelName = channelName\n } else {\n obs$.channelName = channelName\n }\n\n if (payloadFilter !== undefined) {\n return obs$.pipe(filter(payloadFilter))\n }\n\n return obs$\n }\n const fn = ifElse(isValidChannel, startSubscribe, error)\n return fn(channelName)\n }\n\n /**\n * Merge Channels is a convenience method to forkJoin Channel.observer$\n *\n * */\n\n mergeChannels(channelsArr, emitOnce = true) {\n // 1) Normalize inputs to Observables\n const channelObservables = channelsArr.map(item => {\n if (typeof item === 'string') {\n const chan$ = this.getChannel(item)\n return emitOnce ? chan$.pipe(take(1)) : chan$\n }\n return emitOnce ? item.pipe(take(1)) : item\n })\n\n // 2) Combine them\n let combined$\n if (emitOnce) { // one‑shot: snapshot then complete\n combined$ = forkJoin(channelObservables)\n } else { // live updates: combineLatestWith\n if (channelObservables.length === 0) {\n combined$ = EMPTY\n } else if (channelObservables.length === 1) {\n combined$ = channelObservables[0]\n } else {\n const [first$, ...rest$] = channelObservables\n combined$ = first$.pipe(combineLatestWith(...rest$))\n }\n }\n\n // 3) Map array → keyed object\n // return combined$;\n return combined$.pipe(\n map(resultsArr => {\n const obj = {}\n channelsArr.forEach((item, idx) => {\n const iterKey = typeof item === 'string' ? item : `channel_${idx}`\n const cnKey = item?.source?.channelName || item?.source?.source?.channelName\n const key = cnKey || iterKey\n obj[key] = resultsArr[idx]\n })\n return obj\n })\n )\n }\n\n static checkForNotTrackFlag(props = {}) {\n if (props.doNotTrack === true) {\n SpyneAppProperties.doNotTrackChannel(props.channelName)\n }\n }\n}\n","import { __read, __spreadArray } from \"tslib\";\nimport { combineLatest } from './combineLatest';\nexport function combineLatestWith() {\n var otherSources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n otherSources[_i] = arguments[_i];\n }\n return combineLatest.apply(void 0, __spreadArray([], __read(otherSources)));\n}\n//# sourceMappingURL=combineLatestWith.js.map","import { Channel } from './channel.js'\nimport { SpyneUtilsChannelRouteUrl } from '../utils/spyne-utils-channel-route-url.js'\nimport { SpyneUtilsChannelRoute } from '../utils/spyne-utils-channel-route.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { ReplaySubject, merge } from 'rxjs'\nimport { map } from 'rxjs/operators'\n\nimport {\n pick,\n find,\n omit,\n over,\n mergeRight,\n is,\n objOf,\n mergeAll,\n path,\n keys,\n prop,\n equals,\n head,\n compose,\n lensProp,\n chain,\n pickAll,\n defaultTo,\n isEmpty,\n concat,\n when,\n complement,\n reverse,\n curryN,\n __,\n test,\n replace,\n toPairs,\n reduce\n , filter as ramdaFilter, mergeRight as rMerge\n} from 'ramda'\n\nexport class SpyneChannelRoute extends Channel {\n constructor(name = 'CHANNEL_ROUTE', props = {}) {\n /**\n * @module SpyneChannelRoute\n * @type core\n *\n * @desc\n *\n * <p>The SpyneChannelRoute has the two main duties:\n * <ul>\n * <li>Combine data with the current window location to update the location's pathname.</li>\n * <li>Listen to window location changes to translate the location pathname into a series of model properties.</li>\n * </ul>\n * <p>In both cases, this channel sends a ChannelPayload containing updated route properties.</p>\n *\n * <h3>The two actions that are regsitered for the Route channel are:</h3>\n * <ul>\n * <li>CHANNEL_ROUTE_DEEPLINK_EVENT</li>\n * <li>CHANNEL_ROUTE_CHANGE_EVENT</li>\n * </ul>\n *\n * <h3>The Routes Configuration Object</h3>\n * <p>Thr routes configuration object is used to map the location string to and from a route model.</p>\n *\n * <pre> {\n * routePath: {\n * routeName: 'levelOneProp',\n * routeOption1: 'branching-ends-here',\n * routeOption2: {\n * routePath: {\n * routeName: 'levelTwoProp',\n * optionLevel2: 'level-2-branch-ends-here'\n *\n * }\n * }\n * }\n * }\n *\n * </pre>\n * <p>This config object consists of nested routePath objects that corresponds to all of the branching possiblities for the app.</p>\n * <p>The routeName value is the property name for each routePath.</p>\n * <h3>Route Options</h3>\n * <p>A routePath may contain several route option key-value pairs, which is used to map between data and the window location.</p>\n * <ul class='basic'>\n * <li>\n * <h5 class='basic'>The Route Option Key (or left value)</h5>\n * <ul class='decimal'>\n * <li>Maps the window location to route data properties</li>\n * <li>This channel can 'fill in the blanks' so that only the updated level routeNames are required to revise the window location</li>\n * <li>Can be a regex pattern so that multiple data properties can share the same branching logic</li>\n * </ul>\n * </li>\n *\n * <li>\n * <h5 class='basic'>The Route Option Value (or right value)</h5>\n * <ul class='decimal'>\n * <li>Maps data properties to part of a window location</li>\n * <li>Determines the string value for its level of the window location</li>\n * <li>The value can be a regex pattern so that multiple locations can map to same routeData property</li>\n * <li>Branching ends for the route option when this value is a either a String or a regex pattern</li>\n * <li>Branching continues for the route option when this value is a nested routePath object</li>\n * </ul>\n * </li>\n * </ul>\n *\n * <h3>Enhancing The App's Routing Logic</h3>\n * <p>The best practice for a Spyne App is to have one component, a custom channel, listen to the SpyneRouteChannel. All other components will then listen to the custom route channel. This allows the custom route channel to enhance routing logic with more data and custom actions.</p>\n * <p>You can see this custom routing channel in action in the Spyne Starter App</p>\n *\n * <h4 class='basic'>Examining this Site's Route Configuration</h4>\n * <article class='code-example' id='routes-config-example'></article>\n * <p>You can see this site routing in action by opening up the console's routes panel</p>\n * <div class='btn btn-blue-ref btn-console' data-type=\"console\" data-value=\"open\" data-channel-type=\"route\">CLICK TO OPEN ROUTE PANEL</div>\n *\n * @example\n * TITLE[\"<h4>Binding UI ELements to the Route Channel</h4>\"]\n * // This also is an example of how to override the RouteOption value (useful when the value is a regex pattern)\n * <div class='btn' data-channel=\"ROUTE\" data-page-id='home' data-page-id-value=''>HOME</div>\n *\n * @example\n * TITLE[\"<h4>Updating the Route Channel using ViewStream&rsquo;s sendInfoToChannel</h4>\"]\n * const dataUpdateObj = {pageId:'guide', section:'reference', menuItem:'spyne-route-channel'};\n * this.sendInfoToChannel(\"CHANNEL_ROUTE\", dataUpdateObj);\n *\n * @example\n * TITLE[\"<h4>Updating the Route Channel using Channel&rsquo;s sendPayloadToRouteChannel</h4>\"]\n * const dataUpdateObj = {pageId:'guide', section:'reference', menuItem:'spyne-route-channel'};\n * this.sendPayloadToRouteChannel(dataUpdateObj);\n *\n * @constructor\n * @param {Object} config\n * @property {String} config.type - = 'slash'; This property determines the url structure by conforming the window pathname to either the slash, query or hash formats.\n * @property {Object} config.routes - = {routePath: {routeName:'change'}; This nested Object is used to contruct the window pathname and to express the window location as model variables.\n * @property {String} CHANNEL_NAME - = 'CHANNEL_ROUTE';\n *\n */\n props.sendCachedPayload = true\n super('CHANNEL_ROUTE', props)\n this.createChannelActionsObj()\n this.routeConfigJson = this.getRouteConfig()\n this.bindStaticMethods()\n this.navToStream$ = new ReplaySubject(1)\n this.observer$ = this.navToStream$.pipe(map(info => this.onMapNext(info)))\n this.compareRouteKeywords = SpyneUtilsChannelRoute.compareRouteKeywords()\n }\n\n checkConfigForHash() {\n // LEGACY CHECK TO SIMPLIFY CONFIG FOR HASH;\n const isHashType = SpyneAppProperties.config.channels.ROUTE.type === 'hash'\n if (isHashType === true) {\n SpyneAppProperties.config.channels.ROUTE.type = 'slash'\n SpyneAppProperties.config.channels.ROUTE.isHash = true\n }\n }\n\n onRegistered() {\n this.checkConfigForHash()\n this.initStream()\n }\n\n createChannelActionsObj() {\n const arr = this.addRegisteredActions()\n const converter = str => objOf(str, str)\n const obj = mergeAll(chain(converter, arr))\n this.channelActions = obj\n }\n\n addRegisteredActions() {\n return [\n 'CHANNEL_ROUTE_DEEPLINK_EVENT',\n 'CHANNEL_ROUTE_CHANGE_EVENT',\n 'CHANNEL_ROUTE_CONFIG_UPDATED_EVENT',\n ['CHANNEL_ROUTE_UPDATE_CONFIG_EVENT', 'updateRouteConfig']\n ]\n }\n\n updateRouteConfig(e) {\n const newRoutesObj = pick(['isHash', 'isHidden', 'routes', 'type'], e.payload)\n\n SpyneAppProperties.config.channels.ROUTE = mergeRight(SpyneAppProperties.config.channels.ROUTE, newRoutesObj)\n\n SpyneAppProperties.conformRouteConfig()\n\n const routeConfig = this.getRouteConfig()\n const action = 'CHANNEL_ROUTE_CONFIG_UPDATED_EVENT'\n\n // reverse because routeDatasetsArr turns out that way\n routeConfig.navLinks = [...routeConfig?.routeDatasetsArr]\n\n this.routeConfigJson = routeConfig\n this.bindStaticMethodsWithConfigData()\n\n this.sendChannelPayload(action, routeConfig, {}, {}, this.navToStream$)\n }\n\n getRouteConfig() {\n const spyneConfig = SpyneAppProperties.config\n const routeConfig = path(['channels', 'ROUTE'], spyneConfig)\n if (routeConfig.type === 'query') {\n routeConfig.isHash = false\n }\n\n const arr = SpyneUtilsChannelRoute.flattenConfigObject(routeConfig.routes)\n routeConfig.paramsArr = arr\n return routeConfig\n }\n\n initStream() {\n this.firstLoadStream$ = new ReplaySubject(1)\n this.onIncomingDomEvent(undefined, this.routeConfigJson, '' + 'CHANNEL_ROUTE_DEEPLINK_EVENT')\n\n SpyneUtilsChannelRoute.createPopStateStream(this.onIncomingDomEvent.bind(this))\n\n this.observer$ = merge(this.firstLoadStream$,\n this.navToStream$)\n }\n\n onMapNext(data, firstLoaded = false) {\n data.action = 'CHANNEL_ROUTE_CHANGE_EVENT'\n return data\n }\n\n static removeSSID(payload) {\n const routeLens = lensProp(['routeData'])\n const omitSSID = over(routeLens, omit(['vsid']))\n return omitSSID(payload)\n }\n\n static onIncomingDomEvent(evt, config = this.routeConfigJson, actn) {\n const action = actn !== undefined\n ? actn\n : this.channelActions.CHANNEL_ROUTE_CHANGE_EVENT\n\n // CHECK IF THIS IS A HISTORY EVENT BY USING THE routeCount PROPERTY\n const eventCount = path(['state', 'routeCount'], evt)\n const isHistoryCount = is(Number, eventCount) === true\n let payload = this.getDataFromString(config, isHistoryCount)\n if (isHistoryCount === true) {\n payload.routeCount = eventCount\n }\n // ===============================================================\n if (actn === 'CHANNEL_ROUTE_DEEPLINK_EVENT') {\n payload.navLinks = prop('routeDatasetsArr', config)\n // payload.linksData = payload.navLinks\n // SpyneAppProperties.linksData = payload.navLinks\n\n // define an alias property using Object.defineProperty\n Object.defineProperty(payload, 'linksData', {\n get() {\n // console.warn('get links data is deprecated in ROUTE DEEPLINK DATA, use navLinks')\n return this.navLinks\n },\n set(value) {\n console.warn('set links data is deprecated in ROUTE DEEPLINK DATA, use navLinks')\n\n // this.navLinks = value;\n },\n enumerable: true\n })\n }\n const keywordArrs = this.compareRouteKeywords.compare(payload.routeData, payload.paths)\n payload = rMerge(payload, keywordArrs)\n this.sendChannelPayload(action, payload, undefined, evt, this.navToStream$)\n }\n\n static checkForRouteParamsOverrides(payload) {\n return payload\n }\n\n static checkForEventMethods(obs) {\n const re = /^(event)([A-Z].*)([A-Z].*)$/gm\n const getMethods = compose(ramdaFilter(test(re)), keys, prop('payload'))\n const methodsArr = getMethods(obs)\n if (methodsArr.length >= 1) {\n const evt = prop('event', obs)\n if (evt !== undefined) {\n const methodUpdate = (match, p1, p2, p3, p4) => String(p2).toLowerCase() + p3 + p4\n const methodStrReplace = replace(/^(event)([A-Z])(.*)([A-Z].*)$/gm, methodUpdate)\n const runMethod = (methodStr) => {\n const m = methodStrReplace(methodStr)\n if (evt[m] !== undefined) { evt[m]() }\n }\n methodsArr.forEach(runMethod)\n }\n }\n\n return obs\n }\n\n static checkForEndRoute(pl, routeConfigJson = this.routeConfigJson, debugBool) {\n const endRoute = compose(equals('true'), path(['payload', 'endRoute']))(pl)\n\n if (endRoute !== true) {\n return pl\n }\n const debug = debugBool !== undefined ? debugBool : SpyneAppProperties.debug === true\n const { payload } = pl\n\n const getPropVal = (routePath) => {\n const routeName = prop('routeName', routePath)\n if (routeName) {\n const keysArr = compose(keys, omit(['routeName']))(routePath)\n const routeNameVal = payload[routeName]\n const pred = arrStr => new RegExp(`^${arrStr}$`).test(routeNameVal)\n const routeVal = find(pred, keysArr)\n return routeVal\n }\n }\n\n let iter = 0\n const onReduceRoutePaths = (acc = [], arr) => {\n // const [key, val] = arr\n const val = arr[1]\n const { routePath } = val\n const routeName = prop('routeName', routePath)\n const routeNameVal = getPropVal(routePath)\n const isObj = is(Object, val)\n const isArr = is(Array, val)\n const iterObj = isObj === true && isArr === false\n iter = iter + 1\n if (iterObj) {\n const nextRoutePath = routePath[routeNameVal]\n // console.log('key is ',{iter,acc,key, routeName, routeNameVal, iterObj, nextRoutePath});\n if (nextRoutePath) {\n compose(reverse, reduce(onReduceRoutePaths, acc), toPairs)({ nextRoutePath })\n } else {\n // console.log(\"KEY IS \",{iter,key, routeName, routeNameVal})\n if (iter === 1) {\n if (debug) {\n console.warn(`Spyne Warning: use of end route method should add start route value of \"${routeName}\".`)\n }\n } else {\n acc.push(routeName)\n }\n }\n }\n return acc\n }\n\n const { routes } = routeConfigJson\n\n const endRouteValArr = compose(reverse, reduce(onReduceRoutePaths, []), toPairs)({ routes })\n // console.log('end route val arr ',endRouteValArr);\n if (endRouteValArr.length === 1) {\n const endRouteVal = endRouteValArr[0]\n pl.payload[endRouteVal] = ''\n } else {\n if (debug) {\n // console.warn(`Spyne Warning: the end route param did not yield any results for ${JSON.stringify(payload)} `);\n }\n }\n\n return pl\n }\n\n onViewStreamInfo(pl) {\n const action = pl.action ?? this.channelActions.CHANNEL_ROUTE_CHANGE_EVENT\n\n function domStringMapToObject(domStringMap) {\n const obj = {}\n for (const key in domStringMap) {\n // Check if it’s a direct property (though dataset rarely has anything on the prototype):\n if (Object.prototype.hasOwnProperty.call(domStringMap, key)) {\n obj[key] = domStringMap[key]\n }\n }\n return obj\n }\n\n if (pl?.srcElement?.el?.dataset) {\n pl.payload = domStringMapToObject(pl?.srcElement?.el?.dataset) ?? pl.payload\n }\n\n // console.log('ROUTE CHANNEL VSI ', { pl })\n\n SpyneChannelRoute.checkForEventMethods(pl)\n pl = this.checkForEndRoute(pl)\n let payload = this.getDataFromParams(pl)\n\n const srcElement = prop('srcElement', pl)\n const event = prop('event', pl)\n const changeLocationBool = !payload.isHidden\n const keywordArrs = this.compareRouteKeywords.compare(payload.routeData, payload.paths)\n\n payload = rMerge(payload, keywordArrs)\n this.sendRouteStream(payload, changeLocationBool)\n\n payload = SpyneChannelRoute.removeSSID(payload)\n\n this.sendChannelPayload(action, payload, srcElement, event,\n this.navToStream$)\n }\n\n static checkAndConvertStrWithRegexTokens(routeValue, regexTokenObj) {\n const tokenKeysArr = keys(regexTokenObj)\n\n return tokenKeysArr\n }\n\n sendRouteStream(payload, changeWindowLoc = true) {\n if (changeWindowLoc === true) {\n this.setWindowLocation(payload)\n }\n }\n\n static getRouteState() {\n return 'CHANNEL_ROUTE_CHANGE_EVENT'\n }\n\n static getIsDeepLinkBool(isHistory) {\n return isHistory === false && this._routeCount === 0\n }\n\n static getRouteCount(isHistory = false) {\n if (this._routeCount === undefined) {\n this._routeCount = 0\n return this._routeCount\n }\n if (isHistory === false) {\n this._routeCount += 1\n }\n return this._routeCount\n }\n\n static getExtraPayloadParams(config = this.routeConfigJson, isHistory = false) {\n const routeCount = this.getRouteCount(isHistory)\n const isDeepLink = this.getIsDeepLinkBool(isHistory)\n const isHash = config.isHash\n const isHidden = config.isHidden\n const routeType = config.type\n return { routeCount, isDeepLink, isHash, isHistory, isHidden, routeType }\n }\n\n static getDataFromParams(pl, config = this.routeConfigJson) {\n let routeData = prop('payload', pl)\n\n const routeValue = this.getRouteStrFromParams(routeData, config)\n\n // WINDOW LOCATION HASN'T BEEN CHANGED YET, SO WILL GET STR PARAMS\n const getPropFromConfig = (prp, defalt) => defaultTo(defalt, prop(prp, config))\n const typeForStr = getPropFromConfig('type', 'slash')\n const isHashForStr = getPropFromConfig('isHash', false)\n const nextWindowLoc = SpyneUtilsChannelRouteUrl.formatStrAsWindowLocation(routeValue)\n const dataFromStr = this.getDataFromLocationStr(typeForStr, isHashForStr, nextWindowLoc)\n\n const { pathInnermost, paths } = dataFromStr\n\n routeData = rMerge(dataFromStr.routeData, routeData)\n\n const { routeCount, isDeepLink, isHash, isHistory, isHidden, routeType } = this.getExtraPayloadParams(\n config)\n return {\n isDeepLink,\n routeCount,\n pathInnermost,\n paths,\n routeData,\n routeValue,\n isHash,\n isHidden,\n isHistory,\n routeType\n }\n }\n\n static getDataFromString(config = this.routeConfigJson, isHistory = false) {\n const type = config.type\n const hashIsTrue = config.isHash === true\n const str = SpyneUtilsChannelRouteUrl.getLocationStrByType(type, hashIsTrue)\n const { paths, pathInnermost, routeData, routeValue } = SpyneChannelRoute.getParamsFromRouteStr(\n str, config, type)\n const { routeCount, isDeepLink, isHash, routeType, isHidden } = this.getExtraPayloadParams(\n config, isHistory)\n\n const obj = {\n isDeepLink,\n routeCount,\n pathInnermost,\n paths,\n routeData,\n routeValue,\n isHash,\n isHidden,\n isHistory,\n routeType\n }\n return obj\n }\n\n static getDataFromLocationStr(t = 'slash', isHash = this.routeConfigJson.isHash, loc = window.location) {\n const type = this.routeConfigJson !== undefined\n ? this.routeConfigJson.type\n : t\n\n const str = SpyneUtilsChannelRouteUrl.getLocationStrByType(type, isHash, loc)\n const { paths, pathInnermost, routeData, routeValue } = this.getParamsFromRouteStr(\n str, this.routeConfigJson, type)\n const action = this.getRouteState()\n return { paths, pathInnermost, routeData, routeValue, action }\n }\n\n static getLocationData() {\n const locationParamsArr = [\n 'href',\n 'origin',\n 'protocol',\n 'host',\n 'hostname',\n 'port',\n 'pathname',\n 'search',\n 'hash']\n return pickAll(locationParamsArr, window.location)\n }\n\n static getRouteStrFromParams(paramsData, routeConfig, t) {\n const type = t !== undefined ? t : routeConfig.type\n const obj = SpyneUtilsChannelRouteUrl.convertParamsToRoute(paramsData, routeConfig, type)\n return obj\n }\n\n static getParamsFromRouteStr(str, routeConfig, t) {\n const type = t !== undefined ? t : routeConfig.type\n const obj = SpyneUtilsChannelRouteUrl.convertRouteToParams(str, routeConfig, type)\n return obj\n }\n\n checkEmptyRouteStr(str, isHash = false) {\n const isEmptyBool = isEmpty(str)\n const pathNameIsEmptyBool = isEmptyBool === true && isHash === false\n const hashNameIsEmptyBool = isEmptyBool === true && isHash === true\n const hashNameBool = isEmptyBool === false && isHash === true\n\n if (pathNameIsEmptyBool === true || hashNameIsEmptyBool === true) {\n return '/'\n } else if (hashNameBool === true) {\n return concat('#', str)\n }\n return str\n }\n\n static removeLastSlash(str) {\n const re = /^(.*)(\\/)$/\n return str.replace(re, '$1')\n }\n\n setWindowLocation(channelPayload) {\n let { isHash, routeValue, routeType } = channelPayload\n routeValue = this.checkEmptyRouteStr(routeValue, isHash)\n const { routeCount } = channelPayload\n if (isHash === true || routeType === 'query') {\n const pathName = SpyneChannelRoute.removeLastSlash(window.location.pathname)\n routeValue = pathName + routeValue\n window.history.pushState({ routeCount }, '', routeValue)\n } else {\n const checkForSlash = when(\n compose(complement(equals('/')), head), concat('/', __))\n window.history.pushState({ routeCount }, '', checkForSlash(routeValue))\n }\n }\n\n getWindowLocation() {\n return window.location.pathname // pullHashAndSlashFromPath(window.location.hash);\n }\n\n bindStaticMethods() {\n this.checkForEndRoute = SpyneChannelRoute.checkForEndRoute.bind(this)\n this.getIsDeepLinkBool = SpyneChannelRoute.getIsDeepLinkBool.bind(this)\n this.getDataFromLocationStr = SpyneChannelRoute.getDataFromLocationStr.bind(\n this)\n this.onIncomingDomEvent = SpyneChannelRoute.onIncomingDomEvent.bind(this)\n this.getDataFromString = SpyneChannelRoute.getDataFromString.bind(this)\n this.getParamsFromRouteStr = SpyneChannelRoute.getParamsFromRouteStr.bind(this)\n this.getLocationData = SpyneChannelRoute.getLocationData.bind(this)\n this.getRouteState = SpyneChannelRoute.getRouteState.bind(this)\n this.getDataFromParams = SpyneChannelRoute.getDataFromParams.bind(this)\n this.getRouteCount = SpyneChannelRoute.getRouteCount.bind(this)\n this.getExtraPayloadParams = SpyneChannelRoute.getExtraPayloadParams.bind(this)\n this.bindStaticMethodsWithConfigData()\n }\n\n bindStaticMethodsWithConfigData() {\n const curriedGetRoute = curryN(3, SpyneChannelRoute.getRouteStrFromParams)\n this.getRouteStrFromParams = curriedGetRoute(__, this.routeConfigJson,\n this.routeConfigJson.type)\n }\n}\n","import { Channel } from './channel.js'\nimport { Observable } from 'rxjs'\nimport { map } from 'rxjs/operators'\nimport { equals, path, compose, prop, filter, replace, lensProp, over, omit, test, keys, either, toUpper } from 'ramda'\nimport { sanitizeEventTarget } from '../utils/sanitize-data.js'\n\nexport class SpyneChannelUI extends Channel {\n /**\n * @module SpyneChannelUI\n * @type core\n *\n * @desc\n * <p>This Channel listens to all User Events that have been set to broadcast by ViewStream instances, using the broadCastEvents method.</p>\n * <p>HTML Elements that have their data channel property set to \"ROUTE\" will broadcast their ui event to that channel instead.</p>\n * <div class='btn btn-blue-ref btn-console modal-btn' data-type='modal-window' data-value='uiEvents'>View UI Events</div></br></br>\n * <p>See LINK['ViewStream', 'view-stream'] for an example on how to bind HTML Elements to the UI Channel.</p>\n *\n * @constructor\n * @property {String} CHANNEL_NAME - = 'CHANNEL_UI';\n *\n *\n */\n\n constructor(name = 'CHANNEL_UI', props = {}) {\n props.sendCachedPayload = false\n super(name, props)\n this.keyEventsLoaded = false\n this.keyCodeArr = []\n }\n\n addRegisteredActions() {\n return [\n 'CHANNEL_UI_DOMCONTENTLOADED_EVENT',\n 'CHANNEL_UI_ABORT_EVENT',\n 'CHANNEL_UI_ACTIVATE_EVENT',\n 'CHANNEL_UI_ADDTRACK_EVENT',\n 'CHANNEL_UI_AFTERPRINT_EVENT',\n 'CHANNEL_UI_AFTERSCRIPTEXECUTE_EVENT',\n 'CHANNEL_UI_ANIMATIONCANCEL_EVENT',\n 'CHANNEL_UI_ANIMATIONEND_EVENT',\n 'CHANNEL_UI_ANIMATIONITERATION_EVENT',\n 'CHANNEL_UI_ANIMATIONSTART_EVENT',\n 'CHANNEL_UI_APPINSTALLED_EVENT',\n 'CHANNEL_UI_AUDIOEND_EVENT',\n 'CHANNEL_UI_AUDIOSTART_EVENT',\n 'CHANNEL_UI_AUXCLICK_EVENT',\n 'CHANNEL_UI_BEFOREINPUT_EVENT',\n 'CHANNEL_UI_BEFOREPRINT_EVENT',\n 'CHANNEL_UI_BEFOREUNLOAD_EVENT',\n 'CHANNEL_UI_BEGINEVENT_EVENT',\n 'CHANNEL_UI_BLOCKED_EVENT',\n 'CHANNEL_UI_BLUR_EVENT',\n 'CHANNEL_UI_BOUNDARY_EVENT',\n 'CHANNEL_UI_BUFFEREDAMOUNTLOW_EVENT',\n 'CHANNEL_UI_CANCEL_EVENT',\n 'CHANNEL_UI_CANPLAY_EVENT',\n 'CHANNEL_UI_CANPLAYTHROUGH_EVENT',\n 'CHANNEL_UI_CHANGE_EVENT',\n 'CHANNEL_UI_CLICK_EVENT',\n 'CHANNEL_UI_CLOSE_EVENT',\n 'CHANNEL_UI_CLOSING_EVENT',\n 'CHANNEL_UI_COMPLETE_EVENT',\n 'CHANNEL_UI_COMPOSITIONEND_EVENT',\n 'CHANNEL_UI_COMPOSITIONSTART_EVENT',\n 'CHANNEL_UI_COMPOSITIONUPDATE_EVENT',\n 'CHANNEL_UI_CONNECT_EVENT',\n 'CHANNEL_UI_CONNECTIONSTATECHANGE_EVENT',\n 'CHANNEL_UI_CONTENTDELETE_EVENT',\n 'CHANNEL_UI_CONTEXTMENU_EVENT',\n 'CHANNEL_UI_COPY_EVENT',\n 'CHANNEL_UI_CUECHANGE_EVENT',\n 'CHANNEL_UI_CUT_EVENT',\n 'CHANNEL_UI_DATACHANNEL_EVENT',\n 'CHANNEL_UI_DBLCLICK_EVENT',\n 'CHANNEL_UI_DEVICECHANGE_EVENT',\n 'CHANNEL_UI_DEVICEMOTION_EVENT',\n 'CHANNEL_UI_DEVICEORIENTATION_EVENT',\n 'CHANNEL_UI_DRAG_EVENT',\n 'CHANNEL_UI_DRAGEND_EVENT',\n 'CHANNEL_UI_DRAGENTER_EVENT',\n 'CHANNEL_UI_DRAGLEAVE_EVENT',\n 'CHANNEL_UI_DRAGOVER_EVENT',\n 'CHANNEL_UI_DRAGSTART_EVENT',\n 'CHANNEL_UI_DROP_EVENT',\n 'CHANNEL_UI_DURATIONCHANGE_EVENT',\n 'CHANNEL_UI_EMPTIED_EVENT',\n 'CHANNEL_UI_END_EVENT',\n 'CHANNEL_UI_ENDEVENT_EVENT',\n 'CHANNEL_UI_ENDED_EVENT',\n 'CHANNEL_UI_ENTERPICTUREINPICTURE_EVENT',\n 'CHANNEL_UI_ERROR_EVENT',\n 'CHANNEL_UI_FOCUS_EVENT',\n 'CHANNEL_UI_FOCUSIN_EVENT',\n 'CHANNEL_UI_FOCUSOUT_EVENT',\n 'CHANNEL_UI_FORMDATA_EVENT',\n 'CHANNEL_UI_FULLSCREENCHANGE_EVENT',\n 'CHANNEL_UI_FULLSCREENERROR_EVENT',\n 'CHANNEL_UI_GAMEPADCONNECTED_EVENT',\n 'CHANNEL_UI_GAMEPADDISCONNECTED_EVENT',\n 'CHANNEL_UI_GATHERINGSTATECHANGE_EVENT',\n 'CHANNEL_UI_GESTURECHANGE_EVENT',\n 'CHANNEL_UI_GESTUREEND_EVENT',\n 'CHANNEL_UI_GESTURESTART_EVENT',\n 'CHANNEL_UI_GOTPOINTERCAPTURE_EVENT',\n 'CHANNEL_UI_HASHCHANGE_EVENT',\n 'CHANNEL_UI_ICECANDIDATE_EVENT',\n 'CHANNEL_UI_ICECANDIDATEERROR_EVENT',\n 'CHANNEL_UI_ICECONNECTIONSTATECHANGE_EVENT',\n 'CHANNEL_UI_ICEGATHERINGSTATECHANGE_EVENT',\n 'CHANNEL_UI_INPUT_EVENT',\n 'CHANNEL_UI_INPUTSOURCESCHANGE_EVENT',\n 'CHANNEL_UI_INSTALL_EVENT',\n 'CHANNEL_UI_INVALID_EVENT',\n 'CHANNEL_UI_KEYDOWN_EVENT',\n 'CHANNEL_UI_KEYUP_EVENT',\n 'CHANNEL_UI_LANGUAGECHANGE_EVENT',\n 'CHANNEL_UI_LEAVEPICTUREINPICTURE_EVENT',\n 'CHANNEL_UI_LOAD_EVENT',\n 'CHANNEL_UI_LOADEDDATA_EVENT',\n 'CHANNEL_UI_LOADEDMETADATA_EVENT',\n 'CHANNEL_UI_LOADEND_EVENT',\n 'CHANNEL_UI_LOADSTART_EVENT',\n 'CHANNEL_UI_LOSTPOINTERCAPTURE_EVENT',\n 'CHANNEL_UI_MARK_EVENT',\n 'CHANNEL_UI_MERCHANTVALIDATION_EVENT',\n 'CHANNEL_UI_MESSAGE_EVENT',\n 'CHANNEL_UI_MESSAGEERROR_EVENT',\n 'CHANNEL_UI_MOUSEDOWN_EVENT',\n 'CHANNEL_UI_MOUSEENTER_EVENT',\n 'CHANNEL_UI_MOUSELEAVE_EVENT',\n 'CHANNEL_UI_MOUSEMOVE_EVENT',\n 'CHANNEL_UI_MOUSEOUT_EVENT',\n 'CHANNEL_UI_MOUSEOVER_EVENT',\n 'CHANNEL_UI_MOUSEUP_EVENT',\n 'CHANNEL_UI_MUTE_EVENT',\n 'CHANNEL_UI_NEGOTIATIONNEEDED_EVENT',\n 'CHANNEL_UI_NOMATCH_EVENT',\n 'CHANNEL_UI_NOTIFICATIONCLICK_EVENT',\n 'CHANNEL_UI_OFFLINE_EVENT',\n 'CHANNEL_UI_ONLINE_EVENT',\n 'CHANNEL_UI_OPEN_EVENT',\n 'CHANNEL_UI_ORIENTATIONCHANGE_EVENT',\n 'CHANNEL_UI_PAGEHIDE_EVENT',\n 'CHANNEL_UI_PAGESHOW_EVENT',\n 'CHANNEL_UI_PASTE_EVENT',\n 'CHANNEL_UI_PAUSE_EVENT',\n 'CHANNEL_UI_PAYERDETAILCHANGE_EVENT',\n 'CHANNEL_UI_PAYMENTMETHODCHANGE_EVENT',\n 'CHANNEL_UI_PLAY_EVENT',\n 'CHANNEL_UI_PLAYING_EVENT',\n 'CHANNEL_UI_POINTERCANCEL_EVENT',\n 'CHANNEL_UI_POINTERDOWN_EVENT',\n 'CHANNEL_UI_POINTERENTER_EVENT',\n 'CHANNEL_UI_POINTERLEAVE_EVENT',\n 'CHANNEL_UI_POINTERLOCKCHANGE_EVENT',\n 'CHANNEL_UI_POINTERLOCKERROR_EVENT',\n 'CHANNEL_UI_POINTERMOVE_EVENT',\n 'CHANNEL_UI_POINTEROUT_EVENT',\n 'CHANNEL_UI_POINTEROVER_EVENT',\n 'CHANNEL_UI_POINTERUP_EVENT',\n 'CHANNEL_UI_POPSTATE_EVENT',\n 'CHANNEL_UI_PROGRESS_EVENT',\n 'CHANNEL_UI_PUSH_EVENT',\n 'CHANNEL_UI_PUSHSUBSCRIPTIONCHANGE_EVENT',\n 'CHANNEL_UI_RATECHANGE_EVENT',\n 'CHANNEL_UI_READYSTATECHANGE_EVENT',\n 'CHANNEL_UI_REJECTIONHANDLED_EVENT',\n 'CHANNEL_UI_REMOVETRACK_EVENT',\n 'CHANNEL_UI_REMOVESTREAM_EVENT',\n 'CHANNEL_UI_REPEATEVENT_EVENT',\n 'CHANNEL_UI_RESET_EVENT',\n 'CHANNEL_UI_RESIZE_EVENT',\n 'CHANNEL_UI_RESOURCETIMINGBUFFERFULL_EVENT',\n 'CHANNEL_UI_RESULT_EVENT',\n 'CHANNEL_UI_RESUME_EVENT',\n 'CHANNEL_UI_SCROLL_EVENT',\n 'CHANNEL_UI_SEARCH_EVENT',\n 'CHANNEL_UI_SEEKED_EVENT',\n 'CHANNEL_UI_SEEKING_EVENT',\n 'CHANNEL_UI_SELECT_EVENT',\n 'CHANNEL_UI_SELECTEDCANDIDATEPAIRCHANGE_EVENT',\n 'CHANNEL_UI_SELECTEND_EVENT',\n 'CHANNEL_UI_SELECTIONCHANGE_EVENT',\n 'CHANNEL_UI_SELECTSTART_EVENT',\n 'CHANNEL_UI_SHIPPINGADDRESSCHANGE_EVENT',\n 'CHANNEL_UI_SHIPPINGOPTIONCHANGE_EVENT',\n 'CHANNEL_UI_SIGNALINGSTATECHANGE_EVENT',\n 'CHANNEL_UI_SLOTCHANGE_EVENT',\n 'CHANNEL_UI_SOUNDEND_EVENT',\n 'CHANNEL_UI_SOUNDSTART_EVENT',\n 'CHANNEL_UI_SPEECHEND_EVENT',\n 'CHANNEL_UI_SPEECHSTART_EVENT',\n 'CHANNEL_UI_SQUEEZE_EVENT',\n 'CHANNEL_UI_SQUEEZEEND_EVENT',\n 'CHANNEL_UI_SQUEEZESTART_EVENT',\n 'CHANNEL_UI_STALLED_EVENT',\n 'CHANNEL_UI_START_EVENT',\n 'CHANNEL_UI_STATECHANGE_EVENT',\n 'CHANNEL_UI_STORAGE_EVENT',\n 'CHANNEL_UI_SUBMIT_EVENT',\n 'CHANNEL_UI_SUCCESS_EVENT',\n 'CHANNEL_UI_SUSPEND_EVENT',\n 'CHANNEL_UI_TIMEOUT_EVENT',\n 'CHANNEL_UI_TIMEUPDATE_EVENT',\n 'CHANNEL_UI_TOGGLE_EVENT',\n 'CHANNEL_UI_TONECHANGE_EVENT',\n 'CHANNEL_UI_TOUCHCANCEL_EVENT',\n 'CHANNEL_UI_TOUCHEND_EVENT',\n 'CHANNEL_UI_TOUCHMOVE_EVENT',\n 'CHANNEL_UI_TOUCHSTART_EVENT',\n 'CHANNEL_UI_TRACK_EVENT',\n 'CHANNEL_UI_TRANSITIONCANCEL_EVENT',\n 'CHANNEL_UI_TRANSITIONEND_EVENT',\n 'CHANNEL_UI_TRANSITIONRUN_EVENT',\n 'CHANNEL_UI_TRANSITIONSTART_EVENT',\n 'CHANNEL_UI_UNHANDLEDREJECTION_EVENT',\n 'CHANNEL_UI_UNLOAD_EVENT',\n 'CHANNEL_UI_UNMUTE_EVENT',\n 'CHANNEL_UI_UPGRADENEEDED_EVENT',\n 'CHANNEL_UI_VERSIONCHANGE_EVENT',\n 'CHANNEL_UI_VISIBILITYCHANGE_EVENT',\n 'CHANNEL_UI_VOICESCHANGED_EVENT',\n 'CHANNEL_UI_VOLUMECHANGE_EVENT',\n 'CHANNEL_UI_VRDISPLAYACTIVATE_EVENT',\n 'CHANNEL_UI_VRDISPLAYBLUR_EVENT',\n 'CHANNEL_UI_VRDISPLAYCONNECT_EVENT',\n 'CHANNEL_UI_VRDISPLAYDEACTIVATE_EVENT',\n 'CHANNEL_UI_VRDISPLAYDISCONNECT_EVENT',\n 'CHANNEL_UI_VRDISPLAYFOCUS_EVENT',\n 'CHANNEL_UI_VRDISPLAYPOINTERRESTRICTED_EVENT',\n 'CHANNEL_UI_VRDISPLAYPOINTERUNRESTRICTED_EVENT',\n 'CHANNEL_UI_VRDISPLAYPRESENTCHANGE_EVENT',\n 'CHANNEL_UI_WAITING_EVENT',\n 'CHANNEL_UI_WEBGLCONTEXTCREATIONERROR_EVENT',\n 'CHANNEL_UI_WEBGLCONTEXTLOST_EVENT',\n 'CHANNEL_UI_WEBGLCONTEXTRESTORED_EVENT',\n 'CHANNEL_UI_WEBKITMOUSEFORCECHANGED_EVENT',\n 'CHANNEL_UI_WEBKITMOUSEFORCEDOWN_EVENT',\n 'CHANNEL_UI_WEBKITMOUSEFORCEUP_EVENT',\n 'CHANNEL_UI_WEBKITMOUSEFORCEWILLBEGIN_EVENT',\n 'CHANNEL_UI_WHEEL_EVENT'\n ]\n }\n\n loadKeyStream() {\n const keyUps = Observable.fromEvent(document, 'keyup')\n const filterKeys = e => this.keyCodeArr.indexOf(e.keyCode) >= 0\n this.keyPresses$ = keyUps.groupBy(e => e.keyCode)\n .mergeAll()\n .filter(filterKeys)\n .repeat()\n .subscribe(this.onKeyPressed.bind(this))\n }\n\n addKeyEvent(num) {\n if (this.keyEventsLoaded === false) {\n this.loadKeyStream()\n }\n this.keyEventsLoaded = true\n this.registerKey(num)\n }\n\n registerKey(c) {\n this.keyCodeArr.push(c)\n }\n\n onKeyPressed(evt) {\n // console.log('key is ', evt);\n }\n\n static removeSSID(pl) {\n const routeLens = lensProp(['payload'])\n const omitSSID = over(routeLens, omit(['vsid']))\n return omitSSID(pl)\n }\n\n onIncomingObservable(obj) {\n const eqsName = equals(obj.name, this.props.name)\n obj.data = SpyneChannelUI.removeSSID(obj.data)\n const { payload, srcElement } = obj.data\n const dataObj = obsVal => ({ payload, srcElement, event: obsVal })\n const onSuccess = (obj) => obj.observable.pipe(map(dataObj))\n .subscribe(this.onUIEvent.bind(this))\n const onError = () => {}\n return eqsName === true ? onSuccess(obj) : onError()\n }\n\n getActionState(val) {\n const typeVal = path(['event', 'type'])\n const typeOverRideVal = path(['event', 'typeOverRide'])\n const eventType = compose(toUpper, either(typeOverRideVal, typeVal))\n const type = eventType(val)\n const mainAction = 'CHANNEL_UI'\n return type !== undefined ? `${mainAction}_${type}_EVENT` : mainAction\n }\n\n static checkForEventMethods(obs) {\n const re = /^(event)([A-Z].*)([A-Z].*)$/gm\n const getMethods = compose(filter(test(re)), keys, prop('payload'))\n const methodsArr = getMethods(obs)\n if (methodsArr.length >= 1) {\n const evt = prop('event', obs)\n if (evt !== undefined) {\n const methodUpdate = (match, p1, p2, p3, p4) => String(p2).toLowerCase() + p3 + p4\n const methodStrReplace = replace(/^(event)([A-Z])(.*)([A-Z].*)$/gm, methodUpdate)\n const runMethod = (methodStr) => {\n const m = methodStrReplace(methodStr)\n if (evt[m] !== undefined && typeof (evt[m]) === 'function') { evt[m]() }\n }\n methodsArr.forEach(runMethod)\n }\n }\n\n return obs\n }\n\n onUIEvent(obs) {\n function domStringMapToObject(domStringMap) {\n const obj = {}\n for (const key in domStringMap) {\n // Check if it’s a direct property (though dataset rarely has anything on the prototype):\n if (Object.prototype.hasOwnProperty.call(domStringMap, key)) {\n obj[key] = domStringMap[key]\n }\n }\n return obj\n }\n\n obs.payload = domStringMapToObject(obs?.srcElement?.el?.dataset) ?? obs.payload\n\n SpyneChannelUI.checkForEventMethods(obs)\n obs.action = this.getActionState(obs)\n const action = obs.action// this.getActionState(obs);\n // const { srcElement } = obs\n const { payload, srcElement } = obs\n\n const event = obs.event\n sanitizeEventTarget(event?.target)\n // const payload = domStringMapToObject(srcElement?.el?.dataset) ?? obs.payload\n this.sendChannelPayload(action, payload, srcElement, event)\n }\n}\n","import { fromEventPattern } from 'rxjs'\nimport { map } from 'rxjs/operators'\nimport { mapObjIndexed } from 'ramda'\n\nexport class SpyneUtilsChannelWindow {\n /**\n * @module SpyneUtilsChannelWindow\n * @type internal\n *\n * @constructor\n * @desc\n * Internal utility methods for SpyneWindowChannel\n *\n *\n */\n constructor() {\n this.createDomObservableFromEvent = SpyneUtilsChannelWindow.createDomObservableFromEvent.bind(\n this)\n }\n\n static createDomObservableFromEvent(eventName, mapFn, isPassive = true, element = window) {\n const addHandler = handler => element.addEventListener(eventName, handler,\n { passive: isPassive })\n const removeHandler = () => { element[eventName] = (p) => p }\n mapFn = mapFn === undefined ? (p) => p : mapFn\n return fromEventPattern(addHandler, removeHandler).pipe(map(mapFn))\n }\n\n // MEDIA QUERIES\n static createMediaQuery(str) {\n const mq = window.matchMedia(str)\n this.checkIfValidMediaQuery(mq, str)\n return mq !== false ? mq : false\n }\n\n static checkIfValidMediaQuery(mq, str) {\n const noSpaces = str => str.replace(/\\s+/gm, '')\n const isValidBool = mq.matches !== undefined && noSpaces(mq.media).indexOf(noSpaces(str)) >= 0\n const warnMsg = str => console.warn(`Spyne Info: the following query string, \"${str}\", has been optimized to \"${mq.media}\" by the browser and may not be a valid Media Query item!`)\n if (isValidBool === false) {\n warnMsg(str)\n }\n return isValidBool\n }\n\n static createMediaQueryHandler(query, key) {\n const keyFn = key => p => {\n p.mediaQueryName = key\n return p\n }\n\n const mapKey = keyFn(key)\n\n const handlers = (q) => {\n return {\n addHandler: (handler) => { q.addListener(handler) },\n removeHandler: (handler) => { q.onchange = () => {} }\n }\n }\n const mediaQueryHandler = handlers(query)\n /* eslint-disable new-cap */\n return new fromEventPattern(\n mediaQueryHandler.addHandler,\n mediaQueryHandler.removeHandler)\n .pipe(map(mapKey))\n }\n\n static createMergedObsFromObj(config) {\n const mediaQueriesObj = config.mediaQueries || config.mediaQueries\n const arr = []\n\n const loopQueries = (val, key, obj) => {\n const mq = SpyneUtilsChannelWindow.createMediaQuery(val)\n if (mq !== false) {\n arr.push(SpyneUtilsChannelWindow.createMediaQueryHandler(mq, key))\n }\n return arr\n }\n\n mapObjIndexed(loopQueries, mediaQueriesObj)\n return arr\n }\n}\n","import { Channel } from './channel.js'\nimport { checkIfObjIsNotEmptyOrNil } from '../utils/frp-tools.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { SpyneUtilsChannelWindow } from '../utils/spyne-utils-channel-window.js'\nimport { merge } from 'rxjs'\nimport { map, debounceTime, skipWhile, buffer, bufferCount, throttleTime, filter } from 'rxjs/operators'\nimport { curry, pick, partialRight, mapObjIndexed, apply, map as rMap } from 'ramda'\nimport { deepMerge } from '../utils/deep-merge.js'\n\nconst customActionsArr = []\n\nexport class SpyneChannelWindow extends Channel {\n /**\n * @module SpyneChannelWindow\n * @type core\n *\n * @desc\n * The Window Channel will listen to window and document events that are set in its configuration file\n * <div class='btn btn-blue-ref btn-console modal-btn' data-type='modal-window' data-value='windowEvents'>View Window Events</div></br></br>\n *\n * @constructor\n * @param {String} CHANNEL_NAME\n * @param {Object} config\n * @property {Object} config - = {}; The config has several options used to listen to window and document events.\n * @property {Array} config.events - = []; Any window and document events can be added here.\n * @property {Array} config.customEvents - = []; Application CustomEvents to capture. Each entry is either an event name string, or an object with a name property plus ONE rate/batch option: buffer (ms of quiet that closes a batch; emits one payload whose payload.detail is the array of batched details), count (batch every n events), debounce (ms; emits only the latest event), or throttle (ms; emits the leading event per window). Example: ['simple_event', {name: 'spyne_cms_item_connected', buffer: 400}].\n * @property {Object} config.mediaQueries - = {}; Media queries are added as key,value pairs; the key is the name of the boolean for the query, the value is the query itself.\n * @property {Boolean} config.listenForResize - = true; This is default listening for resize event.\n * @property {Boolean} config.listenForOrientation - = true; Listen for horizontal and landscape orientation changes on mobile devices.\n * @property {Boolean} config.listenForMouseWheel - = false; If set to true, will listen for mouseWheel and will add direction and distance parameters.\n * @property {Boolean} config.debounceMSTimeForResize - = 200; The time between resize events in milliseconds.\n * @property {Boolean} config.debounceMSTimeForScroll - = 150; The time between scroll events in milliseconds.\n * @property {String} CHANNEL_NAME - = 'CHANNEL_WINDOW';\n *\n *\n */\n constructor(CHANNEL_NAME = 'CHANNEL_WINDOW') {\n super(CHANNEL_NAME)\n this.bindStaticMethods()\n this.currentScrollY = 0\n }\n\n initializeStream() {\n this.domChannelConfig = SpyneAppProperties.config.channels.WINDOW\n const obs$Arr = this.getActiveObservables()\n const dom$ = merge(...obs$Arr)\n this.dom$ = dom$\n dom$.subscribe(p => {\n const { action, payload, srcElement, event } = p\n this.sendChannelPayload(action, payload, srcElement, event)\n })\n }\n\n static getMouseWheelMapFn(event) {\n const action = this.channelActions.CHANNEL_WINDOW_WHEEL_EVENT\n const scrollDir = event.deltaY <= 0 ? 'up' : 'down'\n const { deltaX, deltaY, deltaZ } = event\n const payload = { scrollDir, deltaX, deltaY, deltaZ }\n const srcElement = event.srcElement\n return { action, payload, srcElement, event }\n }\n\n static createCurriedGenericEvent(actionStr) {\n const action = `CHANNEL_WINDOW_${actionStr.toUpperCase()}_EVENT`\n const curryFn = curry(SpyneChannelWindow.mapGenericEvent)\n return curryFn(action)\n }\n\n static mapGenericEvent(actn, event) {\n // console.log(\"map generic event \",actn);\n const action = actn\n const payload = event\n const srcElement = event.srcElement\n return { action, payload, srcElement, event }\n }\n\n static getResizeMapFn(event) {\n const action = this.channelActions.CHANNEL_WINDOW_RESIZE_EVENT\n const payload = pick(\n ['innerWidth', 'innerHeight', 'outerWidth', 'outerHeight'], window)\n const srcElement = event.srcElement\n return { action, payload, srcElement, event }\n }\n\n static getOrientationMapFn(event) {\n const action = this.channelActions.CHANNEL_WINDOW_ORIENTATION_EVENT\n const orientationStr = '(orientation: portrait)'\n const isPortraitBool = window.matchMedia(orientationStr).matches\n const payload = pick(\n ['innerWidth', 'innerHeight', 'outerWidth', 'outerHeight'], window)\n payload.orientation = isPortraitBool === true\n ? 'portrait'\n : 'landscape'\n const srcElement = event.srcElement\n return { action, payload, srcElement, event }\n }\n\n getMediaQueryMapFn(event) {\n const action = this.channelActions.CHANNEL_WINDOW_MEDIA_QUERY_EVENT\n const payload = pick(['matches', 'media', 'mediaQueryName'], event)\n const srcElement = event.srcElement\n return { action, payload, srcElement, event }\n }\n\n createMouseWheelObservable(config) {\n const debounceT = config.debounceMSTimeForScroll\n\n return SpyneUtilsChannelWindow.createDomObservableFromEvent('wheel',\n SpyneChannelWindow.getMouseWheelMapFn.bind(this))\n .pipe(\n debounceTime(debounceT)\n )\n }\n\n static getScrollData() {\n let currentScrollY = 0\n\n const getScrollData = (scrollY) => {\n const scrollDistance = currentScrollY - scrollY\n const scrollDir = scrollDistance >= 0 ? 'up' : 'down'\n currentScrollY = scrollY\n return { scrollY, scrollDistance, scrollDir }\n }\n return getScrollData\n }\n\n static getScrollY(scrollElement) {\n return scrollElement.pageYOffset !== undefined ? scrollElement.pageYOffset : scrollElement.scrollTop\n }\n\n static getScrollMapFn(event, interval, action, scrollDataFn, scrollElement) {\n const scrollY = SpyneChannelWindow.getScrollY(scrollElement)\n const payload = scrollDataFn(scrollY)\n const { scrollDistance } = payload\n const srcElement = event.srcElement\n return { action, payload, srcElement, scrollDistance, event }\n }\n\n createScrollObservable(config, scrollElement = window, isPassive = true) {\n const skipWhenDirIsMissing = evt => evt.scrollDistance === 0\n const dTime = config.debounceMSTimeForScroll\n\n const element = scrollElement\n\n const isWindow = scrollElement === window\n\n const scrollElForVals = config.scrollElForVals !== undefined ? config.scrollElForVals : scrollElement\n const action = isWindow ? 'CHANNEL_WINDOW_SCROLL_EVENT' : 'CHANNEL_WINDOW_ELEMENT_SCROLL_EVENT'\n\n const scrollDataFn = SpyneChannelWindow.getScrollData()\n // console.log(\"SCROLL ELEMENT \",action,scrollElement, scrollElForVals);\n const scrollMapFn = partialRight(SpyneChannelWindow.getScrollMapFn, [action, scrollDataFn, scrollElForVals, isPassive, element]).bind(this)\n\n // console.log(\"createScrollObservable \", {scrollMapFn, scrollDataFn, action, config, scrollElement, element})\n\n return SpyneUtilsChannelWindow.createDomObservableFromEvent('scroll',\n scrollMapFn, isPassive, element)\n .pipe(\n debounceTime(dTime),\n skipWhile(skipWhenDirIsMissing),\n map(p => {\n const newScrollY = SpyneChannelWindow.getScrollY(element)\n p.payload.scrollDistanceAbs = Math.abs(this.currentScrollY - newScrollY)\n this.currentScrollY = newScrollY\n return p\n })\n )\n }\n\n createOrientationObservable(config) {\n // console.log(\"add orientation\");orientationchange\n return SpyneUtilsChannelWindow.createDomObservableFromEvent('orientationchange',\n SpyneChannelWindow.getOrientationMapFn.bind(this))\n }\n\n createResizeObservable(config) {\n const dTime = config.debounceMSTimeForResize\n // console.log('resize this ', this);\n\n return SpyneUtilsChannelWindow.createDomObservableFromEvent('resize',\n SpyneChannelWindow.getResizeMapFn.bind(this)).pipe(debounceTime(dTime))\n }\n\n getEventsFromConfig(config = this.domChannelConfig) {\n const obs$Arr = config.events\n\n const customEntries = Array.isArray(config.customEvents)\n ? config.customEvents.map(SpyneChannelWindow.conformCustomEventConfig).filter(entry => entry !== null)\n : []\n\n customEntries.forEach(entry => this.updateChannelActions(entry.name))\n\n const addWindowEventToArr = str => {\n const mapFn = SpyneChannelWindow.createCurriedGenericEvent(str)\n return SpyneUtilsChannelWindow.createDomObservableFromEvent(str, mapFn)\n }\n\n const addCustomEventToArr = ({ name, operator, value }) => {\n const obs$ = addWindowEventToArr(name)\n return operator === undefined ? obs$ : SpyneChannelWindow.customizeCustomEventObservable(obs$, operator, value)\n }\n\n return rMap(addWindowEventToArr, obs$Arr).concat(rMap(addCustomEventToArr, customEntries))\n }\n\n /**\n * Normalizes a config.customEvents entry — an event name string or a\n * {name, <operator>} object — to {name, operator, value}. Complexity is\n * capped at one level: a single operator key (buffer, count, debounce or\n * throttle); when several are set the first in that order wins.\n */\n static conformCustomEventConfig(entry) {\n if (typeof entry === 'string') {\n return { name: entry, operator: undefined, value: undefined }\n }\n\n if (entry !== null && typeof entry === 'object' && typeof entry.name === 'string') {\n const operatorKeys = ['buffer', 'count', 'debounce', 'throttle']\n const setKeys = operatorKeys.filter(key => entry[key] !== undefined)\n const operator = setKeys[0]\n\n if (setKeys.length > 1 && SpyneAppProperties.debug === true) {\n console.warn(`Spyne Warning: the customEvent, ${entry.name}, sets multiple operators (${setKeys.join(', ')}); using ${operator}.`)\n }\n\n return { name: entry.name, operator, value: operator !== undefined ? entry[operator] : undefined }\n }\n\n console.warn(`Spyne Warning: the following config.customEvents entry is not a string or a {name} object and was skipped: ${JSON.stringify(entry)}`)\n return null\n }\n\n /**\n * Applies the entry's rate/batch operator to the conformed CustomEvent\n * observable. buffer and count emit ONE batched payload (payload.detail is\n * the array of each event's detail); debounce and throttle pass single\n * conformed events through untouched.\n */\n static customizeCustomEventObservable(obs$, operator, value) {\n switch (operator) {\n case 'buffer':\n // quiet-gap batching: the batch closes after `value` ms without a new event\n return obs$.pipe(\n buffer(obs$.pipe(debounceTime(value))),\n filter(pArr => pArr.length > 0),\n map(SpyneChannelWindow.mapBatchedEvents)\n )\n case 'count':\n // fixed-size batching: a partial batch is held until it fills\n return obs$.pipe(\n bufferCount(value),\n map(SpyneChannelWindow.mapBatchedEvents)\n )\n case 'debounce':\n return obs$.pipe(debounceTime(value))\n case 'throttle':\n return obs$.pipe(throttleTime(value))\n default:\n return obs$\n }\n }\n\n static mapBatchedEvents(pArr) {\n const last = pArr[pArr.length - 1]\n const { action, srcElement, event } = last\n const detail = pArr.map(p => p.event !== undefined && p.event !== null ? p.event.detail : undefined)\n const payload = { detail, isBatch: true, batchCount: pArr.length }\n return { action, payload, srcElement, event }\n }\n\n getActiveObservables(config = this.domChannelConfig) {\n let obs$Arr = []\n\n // CHECK TO ADD MEDIA QUERY OBSERVABLE\n // ==========================================\n config.listenForMediaQueries = checkIfObjIsNotEmptyOrNil(\n config.mediaQueries) || checkIfObjIsNotEmptyOrNil(\n config.mediaQueries)\n\n // =========================================\n\n const methods = {\n listenForResize: this.createResizeObservable.bind(this),\n listenForOrientation: this.createOrientationObservable.bind(this),\n listenForScroll: this.createScrollObservable.bind(this),\n listenForWheel: this.createMouseWheelObservable.bind(this)\n }\n\n const addObservableToArr = (method, key, i) => {\n const addObsBool = config[key]\n if (addObsBool) {\n obs$Arr.push(method(config))\n }\n }\n\n mapObjIndexed(addObservableToArr, methods)\n\n // 'listenForMediaQueries' : this.getMediaQueryObservable.bind(this)\n this.checkForMediaQueries(config.listenForMediaQueries)\n\n const eventsArr = this.getEventsFromConfig(config)\n obs$Arr = obs$Arr.concat(eventsArr)\n\n return obs$Arr\n }\n\n checkForMediaQueries(bool) {\n const sendMQStream = p => {\n const { action, payload, srcElement, event } = p\n this.sendChannelPayload(action, payload, srcElement, event,\n this.observer$)\n }\n\n if (bool === true) {\n this.getMediaQueryObservable(this.domChannelConfig)\n .subscribe(sendMQStream)\n }\n }\n\n getMediaQueryObservable(config) {\n const arr = this.createMergedObsFromObj(config)\n // console.log(\"ARR IS \",{arr});\n const obs$ = apply(merge, arr)\n return obs$.pipe(map(this.getMediaQueryMapFn.bind(this)))\n }\n\n updateChannelActions(str) {\n if (typeof str !== 'string') {\n return\n }\n function getWindowAction() {\n return `CHANNEL_WINDOW_${str.toUpperCase()}_EVENT`\n }\n const windowAction = getWindowAction()\n customActionsArr.push(windowAction)\n }\n\n addRegisteredActions() {\n const mainActions = [\n 'CHANNEL_WINDOW_ABORT_EVENT',\n 'CHANNEL_WINDOW_AFTERPRINT_EVENT',\n 'CHANNEL_WINDOW_ANIMATIONEND_EVENT',\n 'CHANNEL_WINDOW_ANIMATIONITERATION_EVENT',\n 'CHANNEL_WINDOW_ANIMATIONSTART_EVENT',\n 'CHANNEL_WINDOW_APPINSTALLED_EVENT',\n 'CHANNEL_WINDOW_BEFOREPRINT_EVENT',\n 'CHANNEL_WINDOW_BEFOREUNLOAD_EVENT',\n 'CHANNEL_WINDOW_BEGINEVENT_EVENT',\n 'CHANNEL_WINDOW_BLUR_EVENT',\n 'CHANNEL_WINDOW_CACHED_EVENT',\n 'CHANNEL_WINDOW_CHANGE_EVENT',\n 'CHANNEL_WINDOW_CLICK_EVENT',\n 'CHANNEL_WINDOW_CLOSE_EVENT',\n 'CHANNEL_WINDOW_COMPOSITIONEND_EVENT',\n 'CHANNEL_WINDOW_COMPOSITIONSTART_EVENT',\n 'CHANNEL_WINDOW_COMPOSITIONUPDATE_EVENT',\n 'CHANNEL_WINDOW_COPY_EVENT',\n 'CHANNEL_WINDOW_CUT_EVENT',\n 'CHANNEL_WINDOW_DBLCLICK_EVENT',\n 'CHANNEL_WINDOW_DEVICECHANGE_EVENT',\n 'CHANNEL_WINDOW_DEVICELIGHT_EVENT',\n 'CHANNEL_WINDOW_DEVICEMOTION_EVENT',\n 'CHANNEL_WINDOW_DEVICEORIENTATION_EVENT',\n 'CHANNEL_WINDOW_DEVICEPROXIMITY_EVENT',\n 'CHANNEL_WINDOW_DOMATTRIBUTENAMECHANGED_EVENT',\n 'CHANNEL_WINDOW_DOMATTRMODIFIED_EVENT',\n 'CHANNEL_WINDOW_DOMCHARACTERDATAMODIFIED_EVENT',\n 'CHANNEL_WINDOW_DOMCONTENTLOADED_EVENT',\n 'CHANNEL_WINDOW_DOMCONTENTLOADED_EVENT',\n 'CHANNEL_WINDOW_DOMELEMENTNAMECHANGED_EVENT',\n 'CHANNEL_WINDOW_DRAGEND_EVENT',\n 'CHANNEL_WINDOW_DRAGENTER_EVENT',\n 'CHANNEL_WINDOW_DRAGLEAVE_EVENT',\n 'CHANNEL_WINDOW_DRAGOVER_EVENT',\n 'CHANNEL_WINDOW_DRAGSTART_EVENT',\n 'CHANNEL_WINDOW_DRAG_EVENT',\n 'CHANNEL_WINDOW_DROP_EVENT',\n 'CHANNEL_WINDOW_ELEMENT_SCROLL_EVENT',\n 'CHANNEL_WINDOW_ERROR_EVENT',\n 'CHANNEL_WINDOW_FOCUSIN_EVENT',\n 'CHANNEL_WINDOW_FOCUS_EVENT',\n 'CHANNEL_WINDOW_FULLSCREENCHANGE_EVENT',\n 'CHANNEL_WINDOW_FULLSCREENERROR_EVENT',\n 'CHANNEL_WINDOW_HASHCHANGE_EVENT',\n 'CHANNEL_WINDOW_INPUT_EVENT',\n 'CHANNEL_WINDOW_INVALID_EVENT',\n 'CHANNEL_WINDOW_KEYDOWN_EVENT',\n 'CHANNEL_WINDOW_KEYPRESS_EVENT',\n 'CHANNEL_WINDOW_KEYUP_EVENT',\n 'CHANNEL_WINDOW_LOAD_EVENT',\n 'CHANNEL_WINDOW_MEDIA_QUERY_EVENT',\n 'CHANNEL_WINDOW_MESSAGE_EVENT',\n 'CHANNEL_WINDOW_MOUSEDOWN_EVENT',\n 'CHANNEL_WINDOW_MOUSEENTER_EVENT',\n 'CHANNEL_WINDOW_MOUSELEAVE_EVENT',\n 'CHANNEL_WINDOW_MOUSEMOVE_EVENT',\n 'CHANNEL_WINDOW_MOUSEOUT_EVENT',\n 'CHANNEL_WINDOW_MOUSEOVER_EVENT',\n 'CHANNEL_WINDOW_MOUSEUP_EVENT',\n 'CHANNEL_WINDOW_MOUSEWHEEL_EVENT',\n 'CHANNEL_WINDOW_OFFLINE_EVENT',\n 'CHANNEL_WINDOW_ONLINE_EVENT',\n 'CHANNEL_WINDOW_OPEN_EVENT',\n 'CHANNEL_WINDOW_ORIENTATION_EVENT',\n 'CHANNEL_WINDOW_PAGEHIDE_EVENT',\n 'CHANNEL_WINDOW_PAGESHOW_EVENT',\n 'CHANNEL_WINDOW_PASTE_EVENT',\n 'CHANNEL_WINDOW_POPSTATE_EVENT',\n 'CHANNEL_WINDOW_POPSTATE_EVENT',\n 'CHANNEL_WINDOW_PROGRESSEVENTS_EVENT',\n 'CHANNEL_WINDOW_RESET_EVENT',\n 'CHANNEL_WINDOW_RESIZE_EVENT',\n 'CHANNEL_WINDOW_SCROLL_ELEMENT_ADDED_EVENT',\n 'CHANNEL_WINDOW_SCROLL_EVENT',\n 'CHANNEL_WINDOW_SCROLL_LOCK_EVENT',\n ['CHANNEL_WINDOW_SCROLL_LOCK_EVENT', 'onScrollLockEvent'],\n ['CHANNEL_WINDOW_SET_ELEMENT_TO_SCROLL_EVENT', 'onSetElementToScroll'],\n 'CHANNEL_WINDOW_STORAGE_EVENT',\n 'CHANNEL_WINDOW_SUBMIT_EVENT',\n 'CHANNEL_WINDOW_TRANSITIONCANCEL_EVENT',\n 'CHANNEL_WINDOW_TRANSITIONEND_EVENT',\n 'CHANNEL_WINDOW_TRANSITIONRUN_EVENT',\n 'CHANNEL_WINDOW_TRANSITIONSTART_EVENT',\n 'CHANNEL_WINDOW_UNLOAD_EVENT',\n 'CHANNEL_WINDOW_WHEEL_EVENT'\n ]\n\n return mainActions.concat(customActionsArr)\n }\n\n onScrollLockEvent(e) {\n // DEPRECATED -- MOVED TO spyne-plugin-scroll-lock;\n }\n\n onSetElementToScroll(e) {\n let { config, el, scrollElement } = e.payload\n config = config || {}\n config = deepMerge(this.domChannelConfig, config)\n\n scrollElement = scrollElement || el\n\n const action = 'CHANNEL_WINDOW_SCROLL_ELEMENT_ADDED_EVENT'\n this.sendChannelPayload(action, { el }, el)\n\n this.createScrollObservable(config, scrollElement)\n .subscribe(p => {\n const { action, payload, srcElement, event } = p\n this.sendChannelPayload(action, payload, srcElement, event)\n })\n }\n\n bindStaticMethods() {\n this.createMediaQueryHandler = SpyneUtilsChannelWindow.createMediaQueryHandler.bind(\n this)\n this.createMergedObsFromObj = SpyneUtilsChannelWindow.createMergedObsFromObj.bind(\n this)\n }\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function skipWhile(predicate) {\n return operate(function (source, subscriber) {\n var taking = false;\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return (taking || (taking = !predicate(value, index++))) && subscriber.next(value); }));\n });\n}\n//# sourceMappingURL=skipWhile.js.map","import { operate } from '../util/lift';\nimport { noop } from '../util/noop';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nexport function buffer(closingNotifier) {\n return operate(function (source, subscriber) {\n var currentBuffer = [];\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return currentBuffer.push(value); }, function () {\n subscriber.next(currentBuffer);\n subscriber.complete();\n }));\n innerFrom(closingNotifier).subscribe(createOperatorSubscriber(subscriber, function () {\n var b = currentBuffer;\n currentBuffer = [];\n subscriber.next(b);\n }, noop));\n return function () {\n currentBuffer = null;\n };\n });\n}\n//# sourceMappingURL=buffer.js.map","import { __values } from \"tslib\";\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { arrRemove } from '../util/arrRemove';\nexport function bufferCount(bufferSize, startBufferEvery) {\n if (startBufferEvery === void 0) { startBufferEvery = null; }\n startBufferEvery = startBufferEvery !== null && startBufferEvery !== void 0 ? startBufferEvery : bufferSize;\n return operate(function (source, subscriber) {\n var buffers = [];\n var count = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var e_1, _a, e_2, _b;\n var toEmit = null;\n if (count++ % startBufferEvery === 0) {\n buffers.push([]);\n }\n try {\n for (var buffers_1 = __values(buffers), buffers_1_1 = buffers_1.next(); !buffers_1_1.done; buffers_1_1 = buffers_1.next()) {\n var buffer = buffers_1_1.value;\n buffer.push(value);\n if (bufferSize <= buffer.length) {\n toEmit = toEmit !== null && toEmit !== void 0 ? toEmit : [];\n toEmit.push(buffer);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (buffers_1_1 && !buffers_1_1.done && (_a = buffers_1.return)) _a.call(buffers_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (toEmit) {\n try {\n for (var toEmit_1 = __values(toEmit), toEmit_1_1 = toEmit_1.next(); !toEmit_1_1.done; toEmit_1_1 = toEmit_1.next()) {\n var buffer = toEmit_1_1.value;\n arrRemove(buffers, buffer);\n subscriber.next(buffer);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (toEmit_1_1 && !toEmit_1_1.done && (_b = toEmit_1.return)) _b.call(toEmit_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n }, function () {\n var e_3, _a;\n try {\n for (var buffers_2 = __values(buffers), buffers_2_1 = buffers_2.next(); !buffers_2_1.done; buffers_2_1 = buffers_2.next()) {\n var buffer = buffers_2_1.value;\n subscriber.next(buffer);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (buffers_2_1 && !buffers_2_1.done && (_a = buffers_2.return)) _a.call(buffers_2);\n }\n finally { if (e_3) throw e_3.error; }\n }\n subscriber.complete();\n }, undefined, function () {\n buffers = null;\n }));\n });\n}\n//# sourceMappingURL=bufferCount.js.map","import { Channel } from './channel.js'\n\nexport class SpyneChannelLifecycle extends Channel {\n /**\n * @module SpyneChannelLifecycle\n * @type core\n *\n * @desc\n * Internal Channel that publishes rendering and disposing events of all ViewStreams whose property, proper.sendLifecycleEvents is set to true.\n *\n * <h3>The two actions that are regsitered for this channel are:</h3>\n * <ul>\n * <li>CHANNEL_LIFECYCLE_RENDERED_EVENT</li>\n * <li>CHANNEL_LIFECYCLE_DISPOSED_EVENT</li>\n * </ul>\n * @constructor\n * @property {String} CHANNEL_NAME - = 'CHANNEL_LIFECYCLE';\n */\n\n constructor(props = {}) {\n super('CHANNEL_LIFECYCLE', props)\n }\n\n addRegisteredActions() {\n return [\n 'CHANNEL_LIFECYCLE_RENDERED_EVENT',\n 'CHANNEL_LIFECYCLE_DISPOSED_EVENT'\n ]\n }\n\n onViewStreamInfo(obj) {\n const { action, srcElement } = obj\n const payload = srcElement\n payload.action = action\n this.onSendEvent(action, payload)\n }\n\n onSendEvent(actionStr, payload = {}) {\n const action = this.channelActions[actionStr]\n const srcElement = {}\n const event = undefined\n const delayStream = () => this.sendChannelPayload(action, payload, srcElement, event)\n window.setTimeout(delayStream, 0)\n }\n}\n","import { Channel } from './channel.js'\n\nexport class SpyneChannelAI extends Channel {\n /**\n * @module SpyneChannelAI\n * @type core\n *\n * @desc\n * Internal Channel that publishes rendering and disposing events of all ViewStreams whose property, proper.sendAIEvents is set to true.\n *\n * <h3>The two actions that are regsitered for this channel are:</h3>\n * <ul>\n * <li>CHANNEL_AI_RENDERED_EVENT</li>\n * <li>CHANNEL_AI_DISPOSED_EVENT</li>\n * </ul>\n * @constructor\n * @property {String} CHANNEL_NAME - = 'CHANNEL_AI';\n */\n\n constructor(props = {}) {\n super('CHANNEL_AI', props)\n }\n\n addRegisteredActions() {\n return [\n 'CHANNEL_AI_RENDERED_EVENT',\n 'CHANNEL_AI_DISPOSED_EVENT'\n ]\n }\n\n onViewStreamInfo(obj) {\n const { action, srcElement } = obj\n const payload = srcElement\n payload.action = action\n this.onSendEvent(action, payload)\n }\n\n onSendEvent(actionStr, payload = {}) {\n const action = this.channelActions[actionStr]\n const srcElement = {}\n const event = undefined\n const delayStream = () => this.sendChannelPayload(action, payload, srcElement, event)\n window.setTimeout(delayStream, 0)\n }\n}\n","import { Channel } from './channel.js'\nimport { SpyneAppProperties } from '../utils/spyne-app-properties.js'\nimport { Subject, ReplaySubject, merge } from 'rxjs'\nimport { includes } from 'ramda'\nimport { delayCall } from '../utils/frp-tools.js'\n\nexport class ChannelProxy extends Channel {\n /**\n * @module ChannelProxy\n * @type internal\n *\n * @constructor\n * @param {String} name\n * @param {Object} props\n *\n * @desc\n * A proxy channel is created when a channel is subscribed to before it is registered.\n *\n */\n constructor(name, props = {}) {\n props.isProxy = true\n super(name, props)\n this.props = props\n this.subject$ = new Subject()\n this.replaySub$ = new ReplaySubject(1)\n this.observer$ = merge(this.subject$, this.replaySub$)\n const isDevMode = SpyneAppProperties.debug\n if (isDevMode === true) {\n this.checkIfChannelIsStillProxy(name)\n }\n }\n\n getMergedSubject(peristData = false) {\n return peristData === true ? this.replaySub$ : this.subject$\n }\n\n checkIfChannelIsStillProxy(channelName) {\n const name = channelName\n\n const checkIfProxy = () => {\n const bool = includes(name, SpyneAppProperties.listRegisteredChannels())\n if (bool !== true) {\n console.warn(`Spyne Warning: The channel, ${name} does not appear to be registered!`)\n }\n }\n\n delayCall(checkIfProxy, 1000)\n }\n\n get replaySubject() {\n return this.replaySub$\n }\n\n get subject() {\n return this.subject$\n }\n}\n","import { SpyneChannelRoute } from './spyne-channel-route.js'\nimport { SpyneChannelUI } from './spyne-channel-ui.js'\nimport { SpyneChannelWindow } from './spyne-channel-window.js'\nimport { SpyneChannelLifecycle } from './spyne-channel-lifecycle.js'\nimport { SpyneChannelAI } from './spyne-channel-ai.js'\n\nimport { Subject } from 'rxjs'\nimport { ChannelProxy } from './channel-proxy.js'\nimport { propEq, pluck, prop, filter, pathEq, reject, compose, join, map as rMap } from 'ramda'\n\nconst _map = new Map()\n\nexport class ChannelsMap {\n /**\n * @module ChannelsDelegator\n * @type internal\n *\n * @desc\n * This object creates the logic so that Channels and ViewStreams can communicate with each other\n *\n * @constructor\n *\n */\n\n constructor() {\n this.addMixins()\n _map.set('DISPATCHER', new Subject())\n this.listRegisteredChannels = ChannelsMap.listRegisteredChannels.bind(this)\n this.getChannelsList = ChannelsMap.getChannelsList.bind(this)\n }\n\n get map() {\n return _map\n }\n\n static getChannelsList() {\n const proxyMapFn = (k, v) => {\n const key = k[0]\n const val = k[1].constructor.name\n return { key, val }\n }\n return Array.from(_map, proxyMapFn)\n }\n\n static listRegisteredChannels(showOnlyProxies = false) {\n const proxyMap = this.getChannelsList()\n const rejectProxyFn = reject(propEq('ChannelProxy', 'val'))\n const filterProxyFn = filter(propEq('ChannelProxy', 'val'))\n const fn = showOnlyProxies === true ? filterProxyFn : rejectProxyFn\n const removedProxyArr = fn(proxyMap)\n return pluck(['key'], removedProxyArr)\n }\n\n listProxyChannels() {\n return this.listRegisteredChannels(true)\n }\n\n checkForMissingChannels() {\n const proxyMap = this.getChannelsList()\n const filterProxyFn = filter(propEq('ChannelProxy', 'val'))\n const filterProxyArr = filterProxyFn(proxyMap)\n\n if (filterProxyArr.length >= 1) {\n const channelStr = filterProxyArr.length === 1 ? 'Channel has' : 'Channels have'\n const channels = compose(join(', '), rMap(prop('key')))(filterProxyArr)\n const filterPrefixWarning = `Spyne Warning: The following ${channelStr} not been initialized: ${channels}`\n console.warn(filterPrefixWarning)\n }\n }\n\n init() {\n this.createMainStreams()\n }\n\n createMainStreams() {\n this.routeStream = new SpyneChannelRoute()\n _map.set('CHANNEL_ROUTE', this.routeStream)\n\n this.uiStream = new SpyneChannelUI()\n _map.set('CHANNEL_UI', this.uiStream)\n\n this.domStream = new SpyneChannelWindow()\n _map.set('CHANNEL_WINDOW', this.domStream)\n\n this.viewStreamLifecycle = new SpyneChannelLifecycle()\n _map.set('CHANNEL_LIFECYCLE', this.viewStreamLifecycle)\n\n this.aiStream = new SpyneChannelAI()\n _map.set('CHANNEL_AI', this.aiStream)\n\n this.routeStream.initializeStream()\n this.domStream.initializeStream()\n }\n\n addKeyEvent(key) {\n _map.get('UI').addKeyEvent(key)\n }\n\n registerStream(val) {\n const name = val.channelName\n const nameExists = _map.has(name)\n if (nameExists) {\n const isAlreadyRegisterd = compose(pathEq(['props', 'isRegistered'], true))(_map.get(name))\n if (isAlreadyRegisterd) {\n console.warn(`Spyne Warning: The Channel, ${name}, has already been registered!`)\n return\n }\n }\n\n _map.set(name, val)\n val.initializeStream()\n }\n\n getChannelActions(str) {\n return _map.get(str).addRegisteredActions()\n }\n\n getProxySubject(name, isReplaySubject = false) {\n const subjectType = isReplaySubject === true ? 'replaySubject' : 'subject'\n\n return _map.get(name)[subjectType]\n }\n\n testStream(name) {\n return _map.get(name) !== undefined\n }\n\n getStream(name) {\n if (this.testStream(name) === false) {\n _map.set(name, new ChannelProxy(name))\n }\n\n return _map.get(name)\n }\n\n addMixins() {\n // ==================================\n // BASE CORE DECORATORS\n // ==================================\n // let coreMixins = baseCoreMixins();\n // ==================================\n // BASE STREAMS DECORATORS\n // ==================================\n // let streamsMixins = BaseStreamsMixins();\n }\n}\n","import { getAllMethodNames } from './frp-tools.js'\nimport { reject, curryN, __, map } from 'ramda'\nimport { SpyneAppProperties } from './spyne-app-properties.js'\n\nexport class SpyneTrait {\n /**\n * @module SpyneTrait\n * @type extendable\n * @param {this} parentContext\n * @param {String} prefix\n * @param {Boolean} autoInit\n * @constructor\n * @property {this} parentContent - = undefined; This binds all methods within SpyneTrait into the parentContext's object\n * @property {String} prefix - = undefined; SpyneTraits forces all method names to begin with the same prefix. This allows other objects to quickly understand where the original method is set.\n * @desc\n * SpyneTraits allow the ehancing of classes and other objects without having to extend classes or manipulate function prototypes\n *\n */\n\n constructor(parentContext, prefix = '', autoInit = true) {\n this.parentContext = parentContext\n this.omittedMethods = [\n 'autoBinder',\n 'initAutoBinder',\n 'getEnhancerMethods',\n 'checkForMalformedMethods',\n 'caller',\n 'arguments',\n 'bindParentViewStream']\n\n this.prefix = prefix\n\n if (autoInit === true) {\n this.autoBinder()\n }\n return this.allMethodsList\n }\n\n initAutoBinder() {\n this.autoBinder()\n }\n\n getEnhancerMethods() {\n return getAllMethodNames(this, this.omittedMethods)\n }\n\n checkForMalformedMethods(methodsArr) {\n const isDebugMode = SpyneAppProperties?.debug || false\n\n if (this.prefix === '' && isDebugMode) {\n console.warn(`SPYNE WARNING: The following SpyneTrait ${this.constructor.name} needs a prefix`)\n return\n }\n // let reStr = `^(${this.prefix})(.*)$`;\n // let re = new RegExp(reStr);\n const hasPrefix = (str) => str.indexOf(this.prefix) === 0\n\n const malformedMethodsArr = reject(hasPrefix, methodsArr)\n if (malformedMethodsArr.length >= 1 && isDebugMode) {\n const warningStr = `Spyne Warning: The following method(s) in ${this.constructor.name} require the prefix, \"${this.prefix}\": [${malformedMethodsArr.join(', ')}];`\n console.warn(warningStr)\n }\n }\n\n bindParentViewStream(methodsObj, context) {\n this.checkForMalformedMethods(methodsObj.allMethods)\n const obj = {}\n const bindMethodsToParentViewStream = (str, isStatic = false) => {\n const constructorType = isStatic === true ? this.constructor : this\n const propertyType = typeof (constructorType[str])\n if (propertyType === 'function') {\n obj[str] = context[str] = constructorType[str].bind(context)\n }\n }\n\n const bindCurry = curryN(2, bindMethodsToParentViewStream)\n const bindStaticMethodsToParentViewStream = bindCurry(__, true)\n // MAP STATIC METHODS\n map(bindStaticMethodsToParentViewStream, methodsObj.staticMethods)\n // MAP MAIN METHODS\n map(bindMethodsToParentViewStream, methodsObj.methods)\n return obj\n }\n\n autoBinder() {\n const allMethods = this.getEnhancerMethods()\n // console.log('all ',allMethods);\n this.allMethodsList = this.bindParentViewStream(allMethods, this.parentContext)\n return this.allMethodsList\n }\n}\n","import { from, of } from 'rxjs'\nimport { catchError, map, mergeMap, share, tap } from 'rxjs/operators'\nimport { compose, prop, defaultTo, pick, mergeDeepRight } from 'ramda'\nimport sanitizeData from './sanitize-data.js'\nimport { spyneWarn } from './spyne-warn.js'\n\nexport class ChannelFetchUtil {\n /**\n * @module ChannelFetchUtil\n * @type util\n *\n * @desc\n * This is the core object used for ChannelFetch. This utility wraps the JavaScript\n * fetch API into an observable.\n *\n * @constructor\n * @param {Object} options Properties used to create the fetch request\n * @param {Function} subscriber A method assigned to listen to the result\n * @param {Boolean} testMode Controls initialization for unit tests\n * @param {String} CHANNEL_NAME The name of the channel using this fetch util\n *\n * @property {String} options.url - The URL used for the request\n * @property {Object} options.serverOptions - The properties for the request\n * @property {Function} options.mapFn - A method that can parse the data before it is returned\n * @property {String} options.responseType - Default is json\n * @property {Boolean} options.debug - Logs fetch response details before observable completes\n * @property {Boolean} options.disableSanitize - Allows trusted fetch data to skip sanitization\n *\n * @returns The fetched response parsed by the configured parameters.\n */\n\n constructor(options = {}, subscriber, testMode, CHANNEL_NAME) {\n const testSubscriber = p => console.log('FETCH RETURNED ', p)\n\n this._mapFn = ChannelFetchUtil.setMapFn(options)\n this._url = ChannelFetchUtil.setUrl(options)\n this._responseType = ChannelFetchUtil.setResponseType(options)\n this._serverOptions = ChannelFetchUtil.setServerOptions(options)\n this._subscriber = subscriber !== undefined ? subscriber : testSubscriber\n this.debug = options?.debug === true\n this.disableSanitize = options?.disableSanitize === true\n this.channelName = CHANNEL_NAME\n\n const fetchProps = {\n mapFn: this.mapFn,\n url: this.url,\n serverOptions: this.serverOptions,\n responseType: this.responseType,\n disableSanitize: this.disableSanitize,\n debug: this.debug\n }\n\n if (testMode !== true) {\n ChannelFetchUtil.startWindowFetch(fetchProps, this._subscriber, this.channelName)\n }\n }\n\n static startWindowFetch(props, subscriber, channelName) {\n const { mapFn, url, serverOptions, responseType, debug } = props\n\n const metadata = {\n channelName,\n url,\n responseType,\n serverOptions\n }\n\n const tapLogDebug = p => {\n console.log('DEBUG FETCH :', p, metadata)\n }\n\n const tapLog = debug === true ? tap(tapLogDebug) : tap(() => {})\n\n const mapWrapper = mapMethod => data => {\n const disableSanitize = props?.disableSanitize === true\n\n // Fetched data is remote and untrusted: always sanitize in 'app' mode,\n // regardless of the application's authoring/richtext posture.\n const sanitizedData = disableSanitize ? data : sanitizeData(data, { mode: 'app' })\n\n return mapMethod(sanitizedData, metadata)\n }\n\n const response$ = from(window.fetch(url, serverOptions)).pipe(\n mergeMap(response =>\n from(ChannelFetchUtil.parseResponse(response, metadata))\n ),\n\n tapLog,\n\n map(mapWrapper(mapFn)),\n\n catchError(error =>\n of(ChannelFetchUtil.createFetchErrorPayload(error, metadata))\n ),\n\n share()\n )\n\n response$.subscribe(subscriber)\n }\n\n static async parseResponse(response, metadata) {\n const { responseType } = metadata\n\n const status = response.status\n const statusText = response.statusText\n const contentType = response.headers?.get?.('content-type') || ''\n\n const responseMetadata = {\n ...metadata,\n status,\n statusText,\n contentType,\n ok: response.ok\n }\n\n if (response.ok !== true) {\n const rawBody = await ChannelFetchUtil.safeReadText(response)\n\n throw ChannelFetchUtil.createFetchError({\n errorType: 'FETCH_HTTP_ERROR',\n message: `Fetch request failed with status ${status} ${statusText}`,\n metadata: responseMetadata,\n rawBody\n })\n }\n\n if (responseType === 'json') {\n return ChannelFetchUtil.parseJsonResponse(response, responseMetadata)\n }\n\n if (responseType === 'text') {\n return response.text()\n }\n\n if (responseType === 'blob') {\n return response.blob()\n }\n\n if (responseType === 'arrayBuffer') {\n return response.arrayBuffer()\n }\n\n if (responseType === 'formData') {\n return response.formData()\n }\n\n throw ChannelFetchUtil.createFetchError({\n errorType: 'FETCH_UNSUPPORTED_RESPONSE_TYPE',\n message: `Unsupported fetch responseType \"${responseType}\"`,\n metadata: responseMetadata\n })\n }\n\n static async parseJsonResponse(response, metadata) {\n const rawBody = await response.text()\n const trimmedBody = rawBody.trim()\n\n if (trimmedBody === '') {\n return null\n }\n\n try {\n return JSON.parse(trimmedBody)\n } catch (error) {\n throw ChannelFetchUtil.createFetchError({\n errorType: 'FETCH_RESPONSE_PARSE_ERROR',\n message: 'Expected JSON but could not parse response body.',\n metadata,\n rawBody,\n originalError: error\n })\n }\n }\n\n static createFetchError({ errorType, message, metadata, rawBody = '', originalError }) {\n const error = new Error(message)\n\n error.isChannelFetchError = true\n error.errorType = errorType\n error.metadata = metadata\n error.rawBody = rawBody\n error.originalError = originalError\n\n return error\n }\n\n static createFetchErrorPayload(error, metadata) {\n const fetchMetadata = error?.metadata || metadata || {}\n\n return {\n isChannelFetchError: true,\n isError: true,\n error: true,\n errorType: error?.errorType || 'FETCH_UNKNOWN_ERROR',\n message: error?.message || 'Unknown ChannelFetchUtil error',\n\n channelName: fetchMetadata.channelName,\n url: fetchMetadata.url,\n responseType: fetchMetadata.responseType,\n status: fetchMetadata.status,\n statusText: fetchMetadata.statusText,\n contentType: fetchMetadata.contentType,\n ok: fetchMetadata.ok,\n\n rawBodyPreview: ChannelFetchUtil.truncateBody(error?.rawBody),\n\n originalErrorMessage: error?.originalError?.message\n }\n }\n\n static truncateBody(body = '', maxLength = 500) {\n if (typeof body !== 'string') {\n return ''\n }\n\n return body.length > maxLength\n ? `${body.slice(0, maxLength)}...`\n : body\n }\n\n static async safeReadText(response) {\n try {\n return await response.text()\n } catch (error) {\n return ''\n }\n }\n\n static setMapFn(opts) {\n const getFn = compose(defaultTo(p => p), prop('mapFn'))\n return getFn(opts)\n }\n\n static setUrl(opts) {\n const url = prop('url', opts)\n\n if (url === undefined) {\n spyneWarn('SPYNE WARNING: URL is undefined for data channel')\n }\n\n return url\n }\n\n static setResponseType(opts) {\n return defaultTo('json', prop('responseType', opts))\n }\n\n get mapFn() {\n return this._mapFn\n }\n\n get url() {\n return this._url\n }\n\n get serverOptions() {\n return this._serverOptions\n }\n\n get responseType() {\n return this._responseType\n }\n\n static stringifyBodyIfItExists(obj) {\n const body = obj?.body\n\n const shouldStringifyBody =\n body !== null &&\n typeof body === 'object' &&\n body.constructor === Object\n\n if (shouldStringifyBody !== true) {\n return obj\n }\n\n const headers = new Headers(obj.headers || {})\n\n if (headers.has('Content-Type') !== true) {\n headers.set('Content-Type', 'application/json')\n }\n\n return {\n ...obj,\n headers,\n body: JSON.stringify(body)\n }\n }\n\n static updateMethodWhenBodyExists(opts) {\n const hasBody = opts?.body !== undefined\n const method = opts?.method || 'GET'\n\n if (hasBody && method.toUpperCase() === 'GET') {\n spyneWarn(\n 'SPYNE WARNING: Fetch body was provided with method GET. Changing method to POST.',\n opts\n )\n\n return {\n ...opts,\n method: 'POST'\n }\n }\n\n return opts\n }\n\n static setServerOptions(opts) {\n const options = pick([\n 'method',\n 'headers',\n 'body',\n 'mode',\n 'credentials',\n 'cache',\n 'redirect',\n 'referrer',\n 'referrerPolicy',\n 'integrity',\n 'keepalive'\n ], opts)\n\n let mergedOptions = mergeDeepRight(ChannelFetchUtil.baseOptions(), options)\n\n mergedOptions = ChannelFetchUtil.updateMethodWhenBodyExists(mergedOptions)\n mergedOptions = ChannelFetchUtil.stringifyBodyIfItExists(mergedOptions)\n\n return mergedOptions\n }\n\n static baseOptions() {\n return {\n method: 'GET',\n\n headers: new Headers({\n Accept: 'application/json, text/plain, */*'\n }),\n\n mode: 'cors',\n credentials: 'same-origin',\n cache: 'default',\n redirect: 'follow',\n referrerPolicy: 'no-referrer-when-downgrade',\n integrity: '',\n keepalive: false\n }\n }\n}\n","import { Channel } from './channel.js'\nimport { ChannelFetchUtil } from '../utils/channel-fetch-util.js'\nimport { path, pick, mergeDeepRight, all, allPass, either, values, defaultTo, reject, compose, isNil } from 'ramda'\n\nexport class ChannelFetch extends Channel {\n /**\n * @module ChannelFetch\n * @type extendable\n * @desc\n * <p>ChannelFetch extends Channel and is designed to create a Channel from fetched http data.</p>\n * <p>A ChannelFetch instance can be created with just the channel name and url properties.</p>\n * <p>The data is fetched once, but the ChannelFetch's data is always available to other Channel and ViewStream instances</p>\n *\n * <h3>The ChannelFetch Class</h3>\n * <ul>\n * <li>Extends Channel and uses the ChannelFetchUtil to make any type of http(s) request.</li>\n * <li>Requires a url property at instantiation.</li>\n * <li>The response data is published as a ChannelPayload.</li>\n * <li>The action for the returned ChannelFetch data is always in the following format, \"CHANNEL_NAME_RESPONSE_EVENT\"</li>\n * <li>Fetch failures (network errors, non-OK HTTP statuses, unparseable responses) are published as a conformed error ChannelPayload with the action format, \"CHANNEL_NAME_ERROR_EVENT\"</li>\n * <li>The error payload contains filterable properties such as errorType, status, statusText, url and message.</li>\n * <li>The default request type is a GET request that returns a JSON object.</li>\n * <li>However, any type of request and return type can be configured by using the body property when creating the instance.</li>\n * <li>The mapFn gives access to the returned response and can be use to parse the data before it is published to other Channels and ViewStream instances. The mapFn is not called for error payloads.</li>\n * <li>Channel Fetch will send the last response to future subscribers, and will not make further http(s) requests unless directed to do so.</li>\n * <li>Data can be Fetched again, by sending a \"CHANNEL_NAME_REQUEST_EVENT\" action from a ViewStream's sendInfoToChannel method.</li>\n * </ul>\n *\n * @constructor\n * @param {String} name\n * @param {Object} props\n *\n * @property {String} name - = undefined; The registered name for the channel.\n * @property {String} props.url - = undefined; The url to be fetched.\n * @property {Function} props.mapFn - = undefined; This method is called immediately after the fetched response and behaves like any map method.\n * @property {Object} props.body - = undefined; This will update the options, including header options, sent along with the fetch request. Default options uses a GET request.\n *\n * @example\n * TITLE[\"<h4>A ViewStream Instance Sending A Fetch Update Request</h4>\"]\n * const action = \"CHANNEL_FETCHCHANNEL_NAME_REQUEST_EVENT\";\n * const url = \"//site.com/json/\";\n * const body = {\n * method: \"POST\"\n * }\n *\n * this.sendInfoToChannel(\"CHANNEL_FETCHCHANNEL_NAME\", {action, url, body});\n *\n *\n */\n\n constructor(name, props = { disableSanitize:false }) {\n // ALLOW FOR GENERIC MAP PROPERTY\n\n ChannelFetch.validateMapMethod(props, name)\n\n if (props.map !== undefined) {\n props.mapFn = props.map\n }\n props.extendedActionsArr = [\n `${name}_RESPONSE_EVENT`,\n `${name}_ERROR_EVENT`,\n [`${name}_REQUEST_EVENT`, 'onFetchUpdate']\n ]\n props.sendCachedPayload = true\n super(name, props)\n }\n\n static validateMapMethod(props, name, testMode = false) {\n const isNotEmpty = arr => arr.length >= 1\n const isNotFunction = val => typeof (val) !== 'function'\n const isUndefinedOrWrongType = either(isNil, isNotFunction)\n const isUndefined = all(isUndefinedOrWrongType)\n const isNotUndefinedAndIsNotEmpty = allPass([isUndefined, isNotEmpty])\n const mapMethodIsInvalid = compose(isNotUndefinedAndIsNotEmpty, values, pick(['map', 'mapFn']))(props)\n\n if (mapMethodIsInvalid) {\n if (testMode === false) {\n console.warn(`Spyne Warning: The map method for ChannelFetch, ${name}, appears to be invalid`)\n }\n return false\n }\n\n return true\n }\n\n onRegistered(props = this.props) {\n if (props?.pause !== true) {\n this.startFetch()\n }\n }\n\n addRegisteredActions(name) {\n const arr = [\n 'CHANNEL_RESPONSE_EVENT',\n 'CHANNEL_ERROR_EVENT',\n ['CHANNEL_UPDATE_RESPONSE_EVENT', 'onFetchUpdate'],\n ['CHANNEL_FETCH_REQUEST_EVENT', 'onFetchUpdate']\n ]\n\n const extendedArr = compose(defaultTo([]), path(['props', 'extendedActionsArr']))\n return arr.concat(extendedArr(this))\n }\n\n startFetch(options = {}, subscriber = this.onFetchReturned.bind(this)) {\n const fetchProps = this.consolidateAllFetchProps(options)\n return new ChannelFetchUtil(fetchProps, subscriber, false, this.props.name)\n }\n\n onFetchUpdate(evt) {\n const propsOptions = this.getPropsForFetch(evt)\n this.startFetch(propsOptions)\n }\n\n onFetchReturned(streamItem) {\n const isFetchError = streamItem?.isChannelFetchError === true\n const action = isFetchError\n ? `${this.props.name}_ERROR_EVENT`\n : `${this.props.name}_RESPONSE_EVENT`\n\n return this.createChannelPayloadItem(streamItem, action)\n }\n\n createChannelPayloadItem(payload, action = `${this.props.name}_RESPONSE_EVENT`) {\n const { name, sendCachedPayload, url } = this.props\n const srcElement = { name, sendCachedPayload, url }\n this.sendChannelPayload(action, payload, srcElement)\n }\n\n getPropsForFetch(evt) {\n const dataObj = evt?.payload ?? evt?.viewStreamInfo?.payload ?? {}\n return pick(['mapFn', 'url', 'header', 'body', 'mode', 'method', 'responseType', 'debug'], dataObj)\n }\n\n consolidateAllFetchProps(options, props = this.props) {\n const propsOptions = pick(['mapFn', 'url', 'header', 'body', 'mode', 'disableSanitize', 'method', 'responseType', 'debug'], props)\n const mergeOptions = (o1, o2) => mergeDeepRight(o1, o2)\n const filterOutUndefined = reject(isNil)\n return compose(filterOutUndefined, mergeOptions)(propsOptions, options)\n }\n\n get observer() {\n return this.observer$\n }\n}\n","import { DomElement } from './views/dom-element.js'\nimport { SpyneAppProperties } from './utils/spyne-app-properties.js'\nimport { is, clone, pathSatisfies } from 'ramda'\nlet _spyneAppProps = SpyneAppProperties\nexport class SpynePlugin {\n constructor(props = {}) {\n let { name, config, parentEl } = props\n this.props = props\n\n if (config === undefined) {\n config = clone(props)\n }\n\n this.name = name || 'empty'\n this.props.name = name\n config = SpynePlugin.mergeDefaultConfig(config, this.defaultConfig())\n this.props.parentEl = parentEl || SpynePlugin.createParentEl()\n // SpynePlugin.getSpyneApp(name, config)\n this.props.config = config\n if (this.props.traits !== undefined) {\n this.addTraits(this.props.traits)\n }\n\n // this.onBeforeRegistered()\n // this.onRegistered()\n // this.onRender()\n }\n\n /**\n * Now this method will be called when the app decides to register the plugin.\n * This way, the plugin no longer has to import or rely on its own version\n * of SpyneAppProperties. Instead, it is *passed* the authoritative instance.\n */\n register(spyneAppProps) {\n // 1. Save a reference to the real SpyneAppProperties\n _spyneAppProps = spyneAppProps\n this.props.pluginName = this.props.name\n\n // this.props.config = _spyneAppProps.getPluginConfigByPluginName(this.props.pluginName)\n\n if (_spyneAppProps.initialized === false) {\n console.warn(\n `Spyne Warning: SpyneApp has not been initialized yet! Cannot register plugin \"${this.name}\".`\n )\n return\n }\n\n this.onBeforeRegistered()\n\n // 2. Add plugin config in the real SpyneAppProperties\n this.props.config = clone(this.props.config)\n _spyneAppProps.addPluginConfig(this.name, this.props.config)\n\n // If you have plugin-level logic that depends on the real spyneApp,\n // you can add it here, e.g.:\n // spyneAppProps.addPluginMethods(this.props.config.pluginMethods)\n\n // 3. If you have other plugin lifecycle methods\n this.onRegistered()\n this.onRender()\n }\n\n get SpyneAppProperties() {\n return _spyneAppProps\n }\n\n static mergeDefaultConfig(config = {}, defaultConfig = this.defaultConfig()) {\n return Object.assign(defaultConfig, config)\n }\n\n static getSpyneApp(name, config) {\n if (_spyneAppProps.initialized === false) {\n console.warn(`Spyne Warning: Unable to install plugin, ${name}! SpyneApp has not been initialized!`)\n // SpyneApp.init()\n } else {\n _spyneAppProps.addPluginConfig(name, config)\n }\n }\n\n static updateSpyneConfig(spyneApp, pluginName, pluginConfig) {\n const pathExists = pathSatisfies(is(Object), ['config', 'plugins', pluginName])(spyneApp)\n\n if (pathExists === true) {\n if (spyneApp.config.debug === true) {\n console.warn(`Spyne Warning: The plugin, ${pluginName}, already exists`)\n }\n return false\n }\n spyneApp.config.plugins[pluginName] = pluginConfig\n return spyneApp.config.plugins[pluginName]\n }\n\n static createParentEl(el) {\n const createPluginParentEl = () => {\n const pluginEl = document.getElementById('spyne-plugins')\n\n const createPluginEl = () => {\n const pluginEl = new DomElement({\n id: 'spyne-plugins'\n })\n document.body.appendChild(pluginEl.render())\n const el = document.getElementById('spyne-plugins')\n el.style.cssText = 'position:absolute; top:0;left:0;width:100%;height:100%;min-height:100vh;z-index:1000000; pointer-events:none'\n return el\n }\n return pluginEl || createPluginEl()\n }\n\n return el || createPluginParentEl()\n }\n\n addTraits(traits) {\n if (traits.constructor.name !== 'Array') {\n traits = [traits]\n }\n const addTrait = (TraitClass) => {\n return new TraitClass(this)\n }\n\n traits.forEach(addTrait)\n }\n\n onBeforeRegistered() {\n // this.props.pluginName = this.props.name\n // this.props.config = _spyneAppProps.getPluginConfigByPluginName(this.props.pluginName)\n this.checkForRequiredWindowEvent()\n }\n\n checkForRequiredWindowEvent() {\n const requiredEvents = this.props.requiredEvents ?? []\n const requiredCustomEvents = this.props.requiredCustomEvents ?? []\n\n const windowConfig = SpyneAppProperties.getChannelConfig('WINDOW')\n\n const missingEvents = requiredEvents.filter(evt => !windowConfig.events.includes(evt))\n\n // entries on BOTH sides can be a name string or a {name, buffer|count|debounce|throttle}\n // object — hosts declare how the event is conformed, plugins declare the exact\n // configuration they expect, and matching is by name only\n const entryName = entry => typeof entry === 'string' ? entry : entry?.name\n const customEventNames = windowConfig.customEvents.map(entryName)\n const missingCustomEvents = requiredCustomEvents.filter(evt => !customEventNames.includes(entryName(evt)))\n\n // If any are missing, log a single warning listing them\n if (missingEvents.length > 0) {\n console.warn(\n `plugin \"${this.props.name}\" requires the following config.WINDOW.events, --> ${missingEvents.join(', ')} <--`\n )\n }\n\n if (missingCustomEvents.length > 0) {\n // print the exact configuration entry so it can be pasted into the host config\n const entryAsConfigStr = entry => typeof entry === 'string' ? `'${entry}'` : JSON.stringify(entry)\n console.warn(\n `plugin \"${this.props.name}\" requires the following config.WINDOW.customEvents, --> ${missingCustomEvents.map(entryAsConfigStr).join(', ')} <--`\n )\n }\n }\n\n defaultConfig() {\n return {\n\n }\n }\n\n onRegistered() {\n\n }\n\n onRender() {\n\n }\n}\n","import { ChannelsMap } from './channels/channels-map.js'\nimport { ViewStream } from './views/view-stream.js'\nimport { SpyneUtilsChannelRoute } from './utils/spyne-utils-channel-route.js'\nimport { SpyneAppProperties } from './utils/spyne-app-properties.js'\nimport { sanitizeHTMLConfigure } from './utils/sanitize-html.js'\nimport { sanitizeDataConfigure } from './utils/sanitize-data.js'\n\nconst _channels = new ChannelsMap()\nconst version = '0.26.0'\n\nclass SpyneApplication {\n /**\n *\n * SpyneApp creates the global Spyne object, and creates the following items\n * <ul>\n *\n * <li>LINK['ChannelsMap', 'channels-controller'] that directs the flow of data to all Channels</li>\n * <li>LINK['SpyneChannelUI', 'spyne-channel-u-i'], that broadcast all user interaction events</li>\n * <li>LINK['SpyneChannelRoute', 'spyne-channel-route'], that broadcast window location changes and is the only other channel that can be bound to user events</li>\n * <li>LINK['SpyneChannelWindow', 'spyne-channel-window'], that broadcast all requested window and document events, such as scrolling, resizing and media queries</li>\n * <li>LINK['SpyneChannelLifecycle', 'spyne-channel-lifecycle'], that broadcasts rendering and removing of ViewStream elements that have been directed to broadcast their lifecycle events</li>\n * </ul>\n *\n *\n * @module SpyneApp\n * @type core\n *\n * @constructor\n * @param {Object} config\n * @property {Object} config - = {}; This global config object is mainly used to provide configuration details for two SpyneChannels, CHANNEL_ROUTE and CHANNEL_WINDOW.\n */\n\n constructor() {\n this.version = version\n }\n\n get channels() {\n return _channels\n }\n\n init(config = {}, testMode = false) {\n // this.channels = new ChannelsMap();\n /*!\n * Spyne 0.26.0\n * https://spynejs.org\n *\n * @license\n * Copyright 2017-2025, Frank Batista,\n * Relevant Context, LLC. All rights reserved.\n *\n * Licensed under the GNU Lesser General Public License v3.0 (the \"License\");\n * You may not use this file except in compliance with the License.\n * A copy of the License is located in the project root, or at:\n * https://www.gnu.org/licenses/lgpl-3.0.html\n *\n * This notice may not be removed or altered from any distribution.\n */\n /* eslint-disable */\n\n if(SpyneAppProperties.initialized === true){\n if (testMode){\n return 'The Spyne Application has already been initialized!';\n } else {\n console.warn('The Spyne Application has already been initialized!');\n }\n return\n }\n\n //const imgPath = IMG_PATH || undefined;\n const imgPath = (typeof IMG_PATH !== 'undefined') ? IMG_PATH : undefined;\n let defaultConfig = {\n scrollLock: false,\n scrollLockX: 31,\n scrollLockY: 0,\n debug: false,\n strict: false,\n mode: 'app',\n disableSanitize: false,\n iframes: {},\n anchors: {},\n customElements: [],\n baseHref: undefined,\n IMG_PATH: imgPath,\n pluginMethods:{\n\n },\n plugins:{\n\n },\n tmp: {},\n ephemeralProps: {},\n tmpProps: {},\n channels: {\n WINDOW: {\n mediaQueries: {\n\n },\n events: [],\n customEvents: [],\n listenForResize: true,\n listenForOrientation: true,\n listenForScroll: false,\n listenForMouseWheel: false,\n listenForWheel: false,\n debounceMSTimeForResize: 200,\n debounceMSTimeForScroll: 150\n },\n\n ROUTE: {\n type: 'slash',\n isHash: false,\n isHidden: false,\n add404s: false,\n routes: {\n 'routePath' : {\n 'routeName' : 'change'\n }\n }\n\n }\n }\n };\n if (config !== undefined) {\n const routeUtils = SpyneUtilsChannelRoute;\n config = SpyneAppProperties.initialize(defaultConfig, config, _channels, routeUtils);\n //console.log(\"SPYNE APP PROPS \",SpyneAppProperties);\n //window.Spyne = this;\n //window.Spyne['config'] = deepMerge(defaultConfig, config)\n }\n this.pluginsFn = SpyneAppProperties.getPluginsMethodObj(config['pluginMethods']);\n this.getChannelActions = (str) => _channels.getChannelActions(str);\n this.registerChannel = (val) => _channels.registerStream(val);\n this.registerPlugin = (pluginInstance) => SpyneAppProperties.registerPlugin(pluginInstance);\n this.registerDataChannel = (obs$) => _channels.registerStream(obs$);\n this.listChannels = () => Array.from(_channels.map.keys());\n let nullHolder = new ViewStream({ id:'spyne-null-views' });\n nullHolder.appendToDom(document.body);\n nullHolder.props.el.style.cssText = 'display:none; opacity:0; pointer-events:none;';\n _channels.init();\n\n if (SpyneAppProperties.config.debug===true){\n window.Spyne = {version};\n }\n\n sanitizeHTMLConfigure(SpyneAppProperties.config);\n sanitizeDataConfigure(SpyneAppProperties.config);\n\n }\n\n /**\n * This is mostly used for debugging purposes\n *\n * @example\n * TITLE['<h4>Listing the registereed Channels in the browser console</h4>']\n * SpyneApp.listChannels();\n *\n * @returns A list of all registered channels\n */\n static listChannels() {\n return Array.from(_channels.map.keys());\n }\n\n /**\n * This method is useful to check in the console or in the code what actions are available to be listened to.\n * @param {String} str\n * @returns {Array} An array of Actions that can be listened to\n */\n static getChannelActions(str) {\n return _channels.getChannelActions(str);\n }\n\n /**\n *\n * This method will add the channel to the registered list so that it can subscribed by all ViewStream and Channel instances.\n * @param {Channel} c\n *\n *\n */\n static registerChannel(c) {\n if (SpyneAppProperties.initialized === false) {\n console.warn('Spyne has not been initialized');\n } else {\n return _channels.registerStream(c);\n }\n }\n}\n\n\nexport let SpyneApp = new SpyneApplication();\n"],"names":["SpyneUtilsChannelRouteUrl","constructor","this","checkIfObjIsNotEmptyOrNil","bind","obj","isNotEmpty","compose","complement","isEmpty","head","values","isNotNil","isNil","allPass","isNotNilAndIsNotEmpty","checkIfParamValueMatchesRegex","paramValue","routeObj","rejectParamKey","reject","equals","keysArr","keys","regexMatchStr","find","str","test","RegExp","checker","is","String","assoc","prop","formatStrAsWindowLocation","hash","search","pathname","getLocationStrByType","t","isHash","loc","window","location","slash","query","replace","createRouteArrayFromParams","data","route","paramsFromLoc","urlArr","loopThroughParam","urlObj","keyword","routeName","paramValFromData","undefined","paramValType","push","isObject","Object","objectParamExists","has","objectContainsRoute","newObj","routePath","createSlashString","arr","arrClear","notUndefined","when","__","join","stripRegex","flatten","map","joiner","createQueryString","createPair","toPairs","checkPair","ifElse","always","mapArrayOfPairs","checkIfStrIsEmpty","concat","createQs","checkPayloadForRegexOverrides","urlsArr","parseString","getOverrideVal","key","overrideVal","checkForRouteValWithMultipleVals","mapUrlArrObj","pipeReducer","acc","input","match","getStringBeforePipe","reduce","Array","isArray","checkForRouteValsPartMatch","matchGlobPattern","globPattern","split","some","pattern","value","escapedPattern","globPatternMatch","updatedObj","forEach","prototype","hasOwnProperty","call","convertParamsToRoute","r","SpyneAppProperties","config","channels","ROUTE","locStr","urlType","type","routes","locationStr","paramsFromCurrentLocation","convertRouteToParams","routeData","findIndexOfMatchedStringOrRegex","mainStr","paramsArr","is404","includes","checkForEmpty","checkForEitherStrOrReMatch","either","propEq","findLastIndex","re","s","startsWith","endsWith","findMatchIndex","checkIfValueShouldMapToParam","regexTokens","last","filter","getValCompareArr","paramIndex","paramStr","param","invertedObj","invert","paramInverted","defaultTo","getParamInverted","createArrFromSlashStr","convertSlashRouteStrToParamsObj","topLevelRoute","routeValue","valuesArr","paths","routedValuesArr","latestObj","total","currentValue","routeValueStr","isEmptyOrNil","prevPathNotEqCurrentPath","objectFromStr","path","objectFromRouteParam","zipObj","pathInnermost","getLastArrVal","a","createDefaultParamFromEmptyStr","convertQueryStrToParams","strArr","convertToParams","fromPairs","routeConfig","SpyneUtilsChannelRoute","createPopStateStream","subscribeFn","fromEventPattern","handler","onpopstate","subscribe","compareRouteKeywords","pickValues","o","pick","obj1","compare","obj2","createPred","p","getPropsState","p1","p2","same","previousExists","nextExists","changed","added","removed","uniq","chain","pathsChanged","pathsAdded","pathsRemoved","getComparer","getRouteArrData","routeArr","flattenConfigObject","go","obj_","k","v","k_","v_","addRouteDatasets","channelRouteObj","getHREF","headStrVal","hrefStr","isValidStrRE","createInitialValFn","accMain","routePathObj","objAcc","arrPair","val","getLinkText","toUpperCase","createTitle","clone","length","subRouteName","oBase","navLevel","title","href","reducedArr","routeDatasetsArr","removeUndefined","routeNamesArr","datasetsArr","exclude","getMainKeys","getNavProps","conformRouteObject","add404Props","channelsRoutePath","add404s","parseRoutePath","isArr","configMapperFn","obj404","isObj","isRoutePath","mergeDeepRight","extraRouteData","mergeRight","getLocationData","pickAll","_pluginMethodsObj","create","isNotArr","not","isObjectFn","isMergeableObject","toString","cloneIfNecessary","optionsArgument","deepMerge","defaultArrayMerge","target","source","destination","slice","e","i","indexOf","array","arrayMerge","mergeObject","_config","_channels","_channelsMap","_initialized","all","Error","prev","next","_cmsRehydrator","_cmsLineageWarner","_debug","_enableCMSProxies","_excludeChannelsFromConsole","_navLinks","_IMG_PATH","_doNotTrackChannelsArr","_proxiesMap","Map","_spynePluginMethods","foo","console","log","addMethod","fn","warnStr","warn","addMethods","methodsObj","JSON","stringify","keyStr","methodVal","checkIfMethodExists","pluginMethodsObj","channelsMap","initialized","debug","mode","listChannels","from","initialize","defaultConfig","routeUtils","IMG_PATH","getChannelActions","listRegisteredChannels","setChannelsMap","baseHref","setHeadBaseHref","baseTag","document","createElement","appendChild","conformRouteConfig","getStream","testStream","getProxySubject","setProp","isTemp","ephemeralProps","tmpProps","getProp","tempVal","createTempProp","Math","random","setChannelConfig","channelName","getChannelConfig","channelConfig","registerChannel","addPluginConfig","pluginName","pluginConfig","plugins","addPluginMethods","pluginMethods","getPluginsMethodObj","doNotTrackChannel","getUntrackedChannelsList","registerProxyReviver","name","method","set","registerPlugin","pluginInstance","register","getProxyReviver","proxyName","get","registerCmsRehydrator","rehydrateCmsData","registerCmsLineageWarner","warnUnproxiedCmsData","getPluginConfigByPluginName","excludeChannelsFromConsole","item","linksData","navLinks","enableCMSProxies","getHrefFromData","routeProps","bool","Boolean","setCMSProxyMethod","formatTemplateForProxyData","tempGetChannelsInstance","tempGetConfig","registeredStreamNames","Observable","cmsDataReviveNestedProxyObj","proxyObj","proxyReviverMethod","__proxy__proxyName","error","cloneNestedProxyObj","pathArr","nestedProxyObj","__proxy__isProxy","__proxy__props","rootObj","proxyIterable","iterObj","iterPath","dataPath","entries","prp","getPropType","clonedPath","reviveIfProxy","safeCloneDeep","seen","WeakSet","revived","add","out","rewrapArrayFromSource","sourceArr","resultArr","safeFilter","predicate","safeReject","safeMap","mapFn","result","isProxied","safeAugment","propsObj","safeClone","deep","ob","_readOnlyFacadeCache","WeakMap","ChannelPayload","action","payload","srcElement","event","timeLabel","channel","time","channelPayloadItemObj","deepFreeze","payloadStr","channelActionsArr","validateAction","mergeAll","revivedPayload","channelPayloadItemObjProps","$dir","_dir","defineProperties","timeEnd","isInArr","getStreamItem","deepClone","createReadOnlyProxyFacade","warnBlockedWrite","propName","facade","Proxy","defineProperty","deleteProperty","elIsDomElement","lte","getOwnPropertyNames","isFrozen","processed","freeze","getMouseEventKeys","baseCoreMixins","createpropsMap","wm","objKey","vsid","props","weakMap","gc","m","createId","substring","setTraceFunc","delayCall","async","setTimeout","ms","Promise","resolve","requestAnimationFrame","getConstructorName","substr","spyneWarn","args","SPYNE_SUPPRESS_WARNINGS","setSpyneWarningsDisabled","_sanitizeData","isConfigured","globalDisable","SAFE_URI_REGEXP","normalizeUriForCheck","isSafeUri","SPYNE_CUSTOM_ELEMENT_RE","allowedCustomElementPatterns","allowCustomElements","elements","entry","toLowerCase","CUSTOM_ELEMENT_HANDLING","tagNameCheck","tagName","attributeNameCheck","allowCustomizedBuiltInElements","SAFE_FOR_RICH_TEXT","ALLOWED_TAGS","ADD_TAGS","ALLOWED_ATTR","ALLOW_DATA_ATTR","FORBID_ATTR","FORBID_TAGS","ALLOWED_URI_REGEXP","SAFE_FOR_APP","configuredIframePolicy","allow","allowedOrigins","sandbox","activeIframePolicy","resolveIframePolicy","override","isAllowedIframeSrc","src","policy","normalized","resolved","URL","origin","hostname","protocol","origins","iframeHookAdded","SAME_CONTEXT_TARGETS","configuredAnchorPolicy","allowTarget","addNoopener","allowedDomains","activeAnchorPolicy","resolveAnchorPolicy","isAllowedAnchorHref","domains","d","forceNoopenerRel","el","currentRel","getAttribute","relSet","Set","setAttribute","anchorHookAdded","RICHTEXT_ALIASES","resolveDefaultMode","configMode","process","env","NODE_ENV","buildModeConfig","base","allowIframe","iframeAllowedForMode","cfg","addAttr","ADD_ATTR","makeSanitizeFn","html","DOMPurify","sanitize","sanitizeDataConfigure","strict","disableSanitize","iframes","customElements","anchors","allowTargetAttr","addHook","node","removeAttribute","hasAttribute","processFactory","sanitizeStr","opts","callDisable","iframesOverride","anchorsOverride","effectiveMode","sanitizeDataForce","effective","sanitizeData","URL_ATTRS","sanitizeEventTarget","UNSAFE_RE","clean","isContentEditable","innerHTML","_sanitizeHTML","sanitizeHTML","DomElementTemplate","template","formatTemplate","isProxyData","__cms__isProxy","testMode","rehydrated","templateBindsProxiedChild","normalizeTripleBrackets","proxyFormatter","spyneData","checkForArrayData","templateData","currentOuterLoopData","getStringArray","strMatches","findTmplLoopsRE","parseTmplLoopsRE","parseTmplLoopFn","parseTheTmplLoop","findTmplLoopsPred","checkForMatches","addParams","finalArr","isPrimitiveTag","hasProxiedChild","getNestedDataReducer","nestedData","emptyRE","withoutLeaks","_","innerLoopRE","swapParamsForTagsRE","hasLoop","removeThis","stripInertCmsItems","renderDocFrag","replaceImgPath","createRange","createContextualFragment","renderToString","getTemplateString","getDataValFromPathStr","pathStr","dataFile","p3","templateStr","replaceAll","processInnerLoop","bodyStr","parentItem","innerRE","fullMatch","openTag","innerKey","innerBody","innerData","innerArr","previousOuter","rendered","innerItem","innerIdx","substituteForItem","index","escaped","ctx","buildStringItemContext","substituteObject","dataObj","buildItemContext","context","spyneLoopKey","loopIndex","loopNum","outerData","__cms__dataId","keyIdStr","origKey","assign","reDot","positional","outerBody","elData","elArr","bodyHasInnerLoop","body","DomElement","dflt","attributes","getDomAttributes","attrs","updateAttrs","fragment","createDocumentFragment","addMixins","setElAttrs","params","addToDataset","dataset","allowed","tag","sanitizeAttribute","forEachObjIndexed","applyElementHardening","theMap","mapObjIndexed","addTemplate","frag","addTmpl","addContent","text","txt","createTextNode","execute","pipe","render","renderToHTMLString","outerHTML","returnIfDefined","updateprops","updatepropsAndRun","unmount","remove","updateTag","updateAttributes","updateTemplate","updateData","addTagAndRender","addAttrsibutesAndRender","addTemplateAndRender","addDataAndRender","coreMixins","attributesArray","createFaderInlineText","isInBool","startZeroBool","isFunction","operate","init","lift","hasLift","liftedSource","err","TypeError","extendStatics","b","setPrototypeOf","__proto__","__extends","__awaiter","thisArg","_arguments","P","generator","fulfilled","step","rejected","done","then","apply","__generator","f","y","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","n","op","pop","__values","__read","ar","__spreadArray","to","pack","arguments","l","__await","__asyncGenerator","asyncIterator","q","AsyncIterator","resume","fulfill","settle","shift","__asyncValues","SuppressedError","isArrayLike","x","isPromise","createErrorClass","createImpl","ctorFunc","instance","stack","UnsubscriptionError","_super","errors","message","arrRemove","splice","Subscription","initialTeardown","closed","_parentage","_finalizers","empty","unsubscribe","e_1","_a","e_2","_b","_parentage_1","_parentage_1_1","e_1_1","return","initialFinalizer","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","teardown","_hasParent","_addParent","parent","_removeParent","EMPTY","EMPTY_SUBSCRIPTION","isSubscription","onUnhandledError","onStoppedNotification","useDeprecatedSynchronousErrorHandling","useDeprecatedNextContext","timeoutProvider","timeout","_i","delegate","clearTimeout","handle","reportUnhandledError","noop","COMPLETE_NOTIFICATION","createNotification","kind","errorContext","cb","Subscriber","_this","isStopped","EMPTY_OBSERVER","complete","SafeSubscriber","handleStoppedNotification","nextNotification","_next","_error","_complete","_bind","Function","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","context_1","notification","subscriber","observable","identity","pipeFromArray","fns","_subscribe","operator","isObserver","_trySubscribe","sink","promiseCtor","getPromiseCtor","Symbol_observable","operations","toPromise","isInteropObservable","isAsyncIterable","createInvalidObservableTypeError","isIterable","Symbol_iterator","readableStreamLikeToAsyncGenerator","readableStream","reader","getReader","read","releaseLock","isReadableStreamLike","innerFrom","obs","promise","fromAsyncIterable","iterable","iterable_1","iterable_1_1","asyncIterable","asyncIterable_1","asyncIterable_1_1","catch","createOperatorSubscriber","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","Action","scheduler","work","schedule","state","delay","intervalProvider","setInterval","clearInterval","AsyncAction","pending","id","recycleAsyncId","requestAsyncId","_id","flush","_scheduler","_execute","_delay","errorValue","errored","actions","dateTimestampProvider","now","Date","Scheduler","schedulerActionCtor","asyncScheduler","AsyncScheduler","SchedulerAction","_active","timer","dueTime","intervalOrScheduler","intervalDuration","due","isNaN","isValidDate","executeSchedule","parentSubscription","repeat","scheduleSubscription","catchError","selector","handledResult","innerSub","syncUnsub","observeOn","subscribeOn","scheduleAsyncIterable","scheduled","scheduleObservable","scheduleArray","schedulePromise","scheduleIterable","scheduleReadableStreamLike","project","mapOneOrManyArgs","callOrApply","combineLatestInit","observables","valueTransform","maybeSchedule","active","remainingFirstValues","_loop_1","hasFirstValue","subscription","mergeMap","resultSelector","concurrent","Infinity","ii","onBeforeNext","expand","innerSubScheduler","additionalFinalizer","buffer","isComplete","checkComplete","outerNext","doInnerSub","innerComplete","innerValue","bufferedValue","mergeInternals","combineLatest","popResultSelector","argsOrArgArray","ObjectUnsubscribedError","Subject","currentObservers","observers","hasError","thrownError","subject","AnonymousSubject","_throwIfClosed","_c","enumerable","configurable","_checkFinalizedStatuses","_innerSubscribe","asObservable","debounceTime","activeTask","lastValue","lastTime","emit","emitWhenIdle","targetTime","take","count","finalize","callback","handleReset","reset","on","onSubscriber","takeWhile","inclusive","tap","tapObserver","isUnsub","throttleTime","duration","duration$","durationSelector","leading","trailing","hasValue","sendValue","throttled","endThrottling","send","cleanupThrottling","startThrottle","throttle","ViewStreamObservable","observableStreams","createDirectionalObservables","createDirectionalFiltersObject","dirInternal","dirParent","dirChild","C","PCI","CI","PI","PC","addDefaultDir","flip","defaults","addDownInternalDir","addChildAndInternalDir","mapToDefaultDir","obs$","viewName","filterStreams","propSatisfies","arrType","filterParent","filterChild","filterInternal","addfrom$","relStr","from$","addParentfrom$","addInternalfrom$","addChildfrom$","raw$","toInternal$","toParent$","toChild$","streamObj","internal","child","completeAll","completeStream","setCompleteStream","ViewStreamElement","sink$","viewProps","vsName","_state","extendedHashMethods","options","addActionListeners","funcStr","hashMethods","setHashMethods","onObsSinkSubscribe","$dirs","sourceStreams","_source$","extendedHashMethodsObj","VS_DETRITUS_COLLECT","onGarbageCollect","READY_FOR_VS_DETRITUS_COLLECT","onReadyForGC","EXTIRPATE","onDispose","VS_SPAWN","onRender","VS_SPAWN_AND_ATTACH_TO_PARENT","onRenderAndAttachToParent","VS_SPAWN_AND_ATTACH_TO_DOM","onRenderAndAttachToDom","ATTACH_CHILD_TO_SELF","onAttachChildToSelf","createDomItem","onDisposeCompleted","animateInTween","currentOpacity","getComputedStyle","opacity","inlineCss","style","cssText","fadein","animateOutTween","addEventListener","fadeout","setAnimateIn","animateIn","domItem","animateInTime","disposeMethod","gcData","fadeOutObs","bindCallback","animateOutTime","onFadeoutCompleted","animateOut","removeStream","getSourceStream","combineDomItems","container","defaultFn","insertBefore","firstChild","after","attachType","childRenderData","renderDomItem","getEl","I","extendedMethods","attachData","defaultToFn","sendData","ViewStreamPayload","sendToDirectorStream","directorStream$","frozenPayload","isDevMode","ViewStreamBroadcaster","broadcastFn","broadcaster","addDblClickEvt","fromEvent","typeOverRide","broadcast","channelPayloads","UI","sendUIPayload","sendRoutePayload","local","querySelectorAll","checkParentEls","element","elSelected","parentElement","pluckElFromParent","isLocalEvent","addObservable","preventDefault","domMap","convertDomStringMapToObj","omit","endPreventDefault","srcEvent","ch","channelPayload","arrFn","streamMixins","testFunc","isNonEmptyStr","isNonEmptyArr","isNonEmptyObjectFn","ChannelPayloadFilter","filters","debugLabel","debugLabelArr","propFilters","addStringSelectorFilter","filterSelector","addArraySelectorFilter","addDataFilter","filterData","filtersArr","filtersAreEmpty","filterJson","filterdebugLabel","rMap","fnVal","F","isString","isBoolean","Number","isNumber","compareStr","isArrayFn","fMethod","where","comparedObj","propsBooleans","compareData","checkPayloadSelector","srcPayload","elCanMatch","matches","matchesBoolArr","sel","selectorsArr","nodeArrResultsDebugger","any","querySelector","selectorArr","curry","payloadCheck","getElOrList","cxt","verboseBool","list","getNodeListArray","testSelectors","trim","isValidSelector","isValidSelectorBool","isParent","returnSelectorIfValid","setInlineCss","ViewStreamSelector","generateSpyneSelectorId","addClass","c","classList","removeClass","setClass","removeClassStrArr","className","classStrArr","toggleClass","contains","toggle","htmlElement","addAnimClass","setActiveItem","elSel","currentEl","nodeCheck","matchingEl","getElsArray","ViewStream","vsnum","_postRenderCalled","sendLifecyleEvents","hashId","id$","viewClass","extendedSourcesHashMethods","addDefaultDirection","sendLifecycleMethod","sendLifecycleMethodActive","sendLifecycleMethodInactive","attributesArr","domAttributes","traits","addTraits","loadAllMethods","elIsAlreadyRenderedBool","elAlreadyExistsFn","ViewClass","view","_rawSource$","sendEventsDownStream","sendEventsDownStreamFn","initViewStream","addedChannels","checkIfElementAlreadyExists","source$","checkIfActionsAreRegistered","channelsArr","actionsArr","checkForMatch","strMatch","findIndex","getAllActionsArr","channelSyntax","getAllActions","isValidNestedArr","eventsArr","isTrue","allIsTrue","isValidArr","mapEventsArrFn","updatePropsToMatchEl","getTagName","toLower","postRender","channelFn","onChannelMethodCall","actionFilter","hashSourceMethods","setSourceHashMethods","runFunc","deleted","filterPayload","hashSourceKeys","EXTIRPATING","checkParentDispose","disposeViewStream","VS_SPAWNED","onVSRendered","VS_SPAWNED_AND_ATTACHED_TO_DOM","VS_SPAWNED_AND_ATTACHED_TO_PARENT","onReadyToGC","VS_NULLITY","onMapViewSource","notGCSTATE","initAutoMergeSourceStreams","updateSourceSubscription","eqGCSTATE","notCOMPLETED","notGCCOMPLETE","testVal","addParentStream","parent$","renderAndAttachToParent","addChildStream","child$","tracer","onChildCompleted","onChildDisposed","childCompletedData","finalDest","findName","onSubscribeToSourcesNext","onSubscribeToSourcesError","onSubscribeToSourcesComplete","el$","uberSource$","autoSubscriber$","decrementOnObservableClosed","obsCount","autoMergeSubject$","obsData","branchObservable$","autoClosesBool","rel","sendExtendedStreams","hashActionStr","checkerIfRegexMatchExists","openSpigot","renderView","renderViewAndAttachToDom","onBeforeDispose","methodFn","onChildDispose","onParentDisposing","isInternal","setAttachData","checkQuery","getParentEls","num","getElem","iter","parentEl","setAttachParentData","level","exchangeViewsWithChild","childView","appendToDom","appendToDomAfter","prependToDom","appendView","appendViewAfter","appendViewToParentEl","prependViewToParentEl","prependView","appendToNull","getElementById","_postRenderedCalled","beforeAfterRender","afterRender","onRendered","onAnimFrameAfterRendered","broadcastEvents","initializeChannels","viewsStreamBroadcaster","afterBroadcastEvents","TraitClass","pullActionsFromList","nestedActionsArr","delayForProxyChannelResets","setDataVSID","downStream","getChannel","observer","addChannel","skipFirst","sendDownStream","directionArr","isLocalEventCheck","cidCheck","pipeArr","pl","unshift","channel$","checkIfChannelExists","channelExists","sendInfoToChannel","defaultToAction","getActionFn","CHANNEL_ROUTE","of","isDisposed","createActionFilter","selectors","channelPayloadItem","itemEl","thisEl","RouteChannelUpdater","createTemporaryViewStreamObj","sendRouteChannelUpdate","vs","Channel","CHANNEL_NAME","addRegisteredActions","createChannelActionsObj","extendedActionsArr","defaultActions","isRegistered","isProxy","defaultCachedPayloadBool","replay","sendCachedPayload","sendPayloadToRouteChannel","createChannelActionMethods","streamsController","observer$","getMainObserver","checkForPersistentDataMode","dispatcherStream$","payloadPredByChannelName","onReceivedObservable","ReplaySubject","onChannelInitialized","onRegistered","channelActions","sendChannelPayload","checkForTraits","initializeStream","actionsObj","actionsObjIsEmpty","dataIsAdded","actionStr","setDefaultActionsObj","setTrace","getActionVal","mainArr","objOf","delayCheckIfTraitMethodHasBeenAdded","methodStr","getArrMethod","lensIndex","channelActionMethods","onIncomingObservable","getActionMethodForObservable","unpacked","onViewStreamInfo","eqsName","obsVal","mergeProps","onSuccess","payloadFilter","mergeChannels","emitOnce","channelObservables","chan$","combined$","forkJoin","first$","rest$","otherSources","combineLatestWith","resultsArr","idx","iterKey","checkForNotTrackFlag","doNotTrack","SpyneChannelRoute","super","routeConfigJson","getRouteConfig","bindStaticMethods","navToStream$","info","onMapNext","checkConfigForHash","initStream","updateRouteConfig","newRoutesObj","bindStaticMethodsWithConfigData","spyneConfig","firstLoadStream$","onIncomingDomEvent","merge","firstLoaded","removeSSID","routeLens","lensProp","over","omitSSID","evt","actn","CHANNEL_ROUTE_CHANGE_EVENT","eventCount","isHistoryCount","getDataFromString","routeCount","keywordArrs","rMerge","checkForRouteParamsOverrides","checkForEventMethods","methodsArr","ramdaFilter","getMethods","methodStrReplace","p4","runMethod","checkForEndRoute","debugBool","onReduceRoutePaths","routeNameVal","arrStr","getPropVal","nextRoutePath","reverse","endRouteValArr","endRouteVal","domStringMap","domStringMapToObject","getDataFromParams","changeLocationBool","isHidden","sendRouteStream","checkAndConvertStrWithRegexTokens","regexTokenObj","changeWindowLoc","setWindowLocation","getRouteState","getIsDeepLinkBool","isHistory","_routeCount","getRouteCount","getExtraPayloadParams","isDeepLink","routeType","getRouteStrFromParams","getPropFromConfig","defalt","typeForStr","isHashForStr","nextWindowLoc","dataFromStr","getDataFromLocationStr","hashIsTrue","getParamsFromRouteStr","paramsData","checkEmptyRouteStr","isEmptyBool","removeLastSlash","history","pushState","checkForSlash","getWindowLocation","curriedGetRoute","curryN","SpyneChannelUI","keyEventsLoaded","keyCodeArr","loadKeyStream","keyUps","keyPresses$","groupBy","keyCode","onKeyPressed","addKeyEvent","registerKey","onUIEvent","getActionState","typeVal","typeOverRideVal","toUpper","eventType","mainAction","SpyneUtilsChannelWindow","createDomObservableFromEvent","eventName","isPassive","passive","createMediaQuery","mq","matchMedia","checkIfValidMediaQuery","noSpaces","isValidBool","media","warnMsg","createMediaQueryHandler","mapKey","mediaQueryName","keyFn","mediaQueryHandler","addHandler","addListener","removeHandler","onchange","createMergedObsFromObj","mediaQueriesObj","mediaQueries","customActionsArr","SpyneChannelWindow","currentScrollY","domChannelConfig","WINDOW","obs$Arr","getActiveObservables","dom$","getMouseWheelMapFn","CHANNEL_WINDOW_WHEEL_EVENT","scrollDir","deltaY","deltaX","deltaZ","createCurriedGenericEvent","mapGenericEvent","curryFn","getResizeMapFn","CHANNEL_WINDOW_RESIZE_EVENT","getOrientationMapFn","CHANNEL_WINDOW_ORIENTATION_EVENT","isPortraitBool","orientation","getMediaQueryMapFn","CHANNEL_WINDOW_MEDIA_QUERY_EVENT","createMouseWheelObservable","debounceT","debounceMSTimeForScroll","getScrollData","scrollY","scrollDistance","getScrollY","scrollElement","pageYOffset","scrollTop","getScrollMapFn","interval","scrollDataFn","createScrollObservable","dTime","isWindow","scrollElForVals","scrollMapFn","partialRight","taking","newScrollY","scrollDistanceAbs","abs","createOrientationObservable","createResizeObservable","debounceMSTimeForResize","getEventsFromConfig","events","customEntries","customEvents","conformCustomEventConfig","updateChannelActions","addWindowEventToArr","customizeCustomEventObservable","setKeys","closingNotifier","currentBuffer","pArr","mapBatchedEvents","bufferSize","startBufferEvery","buffers","toEmit","buffers_1","buffers_1_1","toEmit_1","toEmit_1_1","e_3","buffers_2","buffers_2_1","e_3_1","detail","isBatch","batchCount","listenForMediaQueries","methods","listenForResize","listenForOrientation","listenForScroll","listenForWheel","checkForMediaQueries","sendMQStream","getMediaQueryObservable","windowAction","onScrollLockEvent","onSetElementToScroll","SpyneChannelLifecycle","onSendEvent","SpyneChannelAI","ChannelProxy","subject$","replaySub$","checkIfChannelIsStillProxy","getMergedSubject","peristData","replaySubject","_map","ChannelsMap","getChannelsList","showOnlyProxies","proxyMap","rejectProxyFn","filterProxyFn","removedProxyArr","pluck","listProxyChannels","checkForMissingChannels","filterProxyArr","filterPrefixWarning","createMainStreams","routeStream","uiStream","domStream","viewStreamLifecycle","aiStream","registerStream","pathEq","isReplaySubject","subjectType","SpyneTrait","parentContext","prefix","autoInit","omittedMethods","autoBinder","allMethodsList","initAutoBinder","getEnhancerMethods","combinedOmittedMethods","omitPropsFromArr","without","staticMethods","allMethods","getAllMethodNames","checkForMalformedMethods","isDebugMode","malformedMethodsArr","warningStr","bindParentViewStream","bindMethodsToParentViewStream","isStatic","constructorType","bindStaticMethodsToParentViewStream","bindCurry","ChannelFetchUtil","_mapFn","setMapFn","_url","setUrl","_responseType","setResponseType","_serverOptions","setServerOptions","_subscriber","fetchProps","url","serverOptions","responseType","startWindowFetch","metadata","tapLog","response$","fetch","response","parseResponse","mapMethod","sanitizedData","createFetchErrorPayload","connector","resetOnError","resetOnComplete","_d","resetOnRefCountZero","wrapperSource","connection","resetConnection","refCount","hasCompleted","hasErrored","cancelReset","resetAndUnsubscribe","conn","dest","share","status","statusText","contentType","headers","responseMetadata","ok","rawBody","safeReadText","createFetchError","errorType","parseJsonResponse","blob","arrayBuffer","formData","trimmedBody","parse","originalError","isChannelFetchError","fetchMetadata","isError","rawBodyPreview","truncateBody","originalErrorMessage","maxLength","getFn","stringifyBodyIfItExists","Headers","updateMethodWhenBodyExists","mergedOptions","baseOptions","Accept","credentials","cache","redirect","referrerPolicy","integrity","keepalive","ChannelFetch","validateMapMethod","isUndefinedOrWrongType","isUndefined","isNotUndefinedAndIsNotEmpty","pause","startFetch","extendedArr","onFetchReturned","consolidateAllFetchProps","onFetchUpdate","propsOptions","getPropsForFetch","streamItem","createChannelPayloadItem","viewStreamInfo","filterOutUndefined","o1","o2","_spyneAppProps","SpynePlugin","mergeDefaultConfig","createParentEl","spyneAppProps","onBeforeRegistered","getSpyneApp","updateSpyneConfig","spyneApp","pathSatisfies","pluginEl","createPluginEl","checkForRequiredWindowEvent","requiredEvents","requiredCustomEvents","windowConfig","missingEvents","entryName","customEventNames","missingCustomEvents","entryAsConfigStr","version","SpyneApp","scrollLock","scrollLockX","scrollLockY","tmp","listenForMouseWheel","pluginsFn","registerDataChannel","nullHolder","Spyne","isRichtext","domPurifyConfig","RETURN_TRUSTED_TYPE","customElementHandling","sanitizeWithPolicy","trustedTypes","createPolicy","createHTML","toEscape","sanitizeHTMLConfigure"],"mappings":"+tCAGO,MAAMA,GACX,WAAAC,GASEC,KAAKC,0BAA4BH,GAA0BG,0BAA0BC,KAAKF,KAC3F,CAED,gCAAOC,CAA0BE,GAC/B,MAAMC,EAAaC,EAAQC,EAAWC,GAAUC,EAAMC,GAChDC,EAAWL,EAAQC,EAAWK,GAAQH,EAAMC,GAElD,OAD8BG,EAAQ,CAACR,EAAYM,GAC5CG,CAAsBV,EAC9B,CAED,oCAAOW,CAA8BC,EAAYC,GAC/C,MAAMC,EAAiBC,EAAOC,EAAO,cAC/BC,EAAUf,EAAQY,EAAgBI,GAGlCC,EADUjB,EAAQkB,EADEC,GAAOC,EAAK,IAAIC,OAAOF,GAAMT,IACNK,EAC3BO,CAAQX,GAI9B,OAHIY,EAAGC,OAAQP,KACbN,EAAWc,EAAMf,EAAYgB,EAAKT,EAAeN,GAAWA,IAEvDA,CACR,CAED,gCAAOgB,CAA0BR,GAI/B,MAAO,CAAES,KAHIT,EAGEU,OAFAV,EAEQW,SADNX,EAElB,CAED,2BAAOY,CAAqBC,EAAGC,GAAS,EAAOC,EAAMC,OAAOC,UAY1D,OAHaV,EANG,CACdW,MAAO,WACPC,MAAO,SACPV,KAAM,SALgB,IAAXK,EAAkB,OAASD,GAQbE,GAGhBK,QAFkB,uBAEY,KAC1C,CAED,iCAAOC,CAA2BC,EAAMC,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B/qB,EAAO,CAI5D,SAAAqpB,GACE,MAAMqC,EAAaxQ,KACnBhe,KAAKue,GAAKiQ,EAAWjQ,GAAGre,KAAKF,KAC9B,CAED,gBAAA8rB,CAAiBzN,GACf,OAAOnS,GAAKlM,KAAKyuB,gBAAiBpQ,EACnC,CAED,mBAAIoQ,GACF,MAAO,CACL,SACA,iBACA,YACA,SACA,QACA,QACA,MACA,QACA,iBACA,eACA,YACA,WACA,UACA,SACA,WACA,YACA,UACA,UACA,OACA,QACA,OACA,WACA,QACA,OACA,UACA,UACA,kBACA,cACA,WACA,SACA,cACA,MACA,UACA,WACA,WACA,UACA,QACA,MACA,UACA,WACA,WACA,YACA,WACA,UACA,MACA,OACA,aACA,UACA,SACA,SACA,OACA,OACA,WACA,aACA,OACA,KACA,aACA,YACA,QACA,WACA,UACA,OACA,QACA,OACA,WACA,WACA,OACA,OACA,MACA,WACA,MACA,YACA,YACA,QACA,SACA,MACA,WACA,QACA,OACA,aACA,OACA,UACA,UACA,OACA,cACA,SACA,UACA,aACA,WACA,iBACA,MACA,WACA,WACA,OACA,UACA,UACA,QACA,SACA,WACA,QACA,OACA,QACA,OACA,OACA,aACA,MACA,SACA,UACA,SACA,QACA,OACA,QACA,UACA,WACA,SACA,QACA,YACA,OACA,SACA,QACA,QACA,OAEH,ECrUH,MAAMC,GAAwB,CAACC,GAAW,EAAOtsB,EAAI,EAAGuP,EAAI,OAAQgd,GAAgB,IAG3E,IAFmC,IAAlBA,EAAyB,aAAe,yBAEhBvsB,MAAMuP,gBADzB,IAAb+c,EAAoB,EAAI,KCFnC,SAASE,GAAWjoB,GACvB,MAAwB,mBAAVA,CAClB,CCEO,SAASkoB,GAAQC,GACpB,OAAO,SAAUtd,GACb,GALD,SAAiBA,GACpB,OAAOod,GAAWpd,aAA4C,EAAIA,EAAOud,KAC7E,CAGYC,CAAQxd,GACR,OAAOA,EAAOud,KAAK,SAAUE,GACzB,IACI,OAAOH,EAAKG,EAAclvB,KAC7B,CACD,MAAO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ACpDlkD,KAAKkkD,sBAAwBkB,EAAgB9gD,EAAItE,KAAKggD,gBACpDhgD,KAAKggD,gBAAgBp4C,KACxB,ECnkBI,MAAM09C,WAAuBzJ,GAiBlC,WAAA97C,CAAYoX,EAAO,aAAckH,EAAQ,CAAA,GACvCA,EAAMk+B,mBAAoB,EAC1BwD,MAAM5oC,EAAMkH,GACZre,KAAKulD,iBAAkB,EACvBvlD,KAAKwlD,WAAa,EACnB,CAED,oBAAAzJ,GACE,MAAO,CACL,oCACA,yBACA,4BACA,4BACA,8BACA,sCACA,mCACA,gCACA,sCACA,kCACA,gCACA,4BACA,8BACA,4BACA,+BACA,+BACA,gCACA,8BACA,2BACA,wBACA,4BACA,qCACA,0BACA,2BACA,kCACA,0BACA,yBACA,yBACA,2BACA,4BACA,kCACA,oCACA,qCACA,2BACA,yCACA,iCACA,+BACA,wBACA,6BACA,uBACA,+BACA,4BACA,gCACA,gCACA,qCACA,wBACA,2BACA,6BACA,6BACA,4BACA,6BACA,wBACA,kCACA,2BACA,uBACA,4BACA,yBACA,yCACA,yBACA,yBACA,2BACA,4BACA,4BACA,oCACA,mCACA,oCACA,uCACA,wCACA,iCACA,8BACA,gCACA,qCACA,8BACA,gCACA,qCACA,4CACA,2CACA,yBACA,sCACA,2BACA,2BACA,2BACA,yBACA,kCACA,yCACA,wBACA,8BACA,kCACA,2BACA,6BACA,sCACA,wBACA,sCACA,2BACA,gCACA,6BACA,8BACA,8BACA,6BACA,4BACA,6BACA,2BACA,wBACA,qCACA,2BACA,qCACA,2BACA,0BACA,wBACA,qCACA,4BACA,4BACA,yBACA,yBACA,qCACA,uCACA,wBACA,2BACA,iCACA,+BACA,gCACA,gCACA,qCACA,oCACA,+BACA,8BACA,+BACA,6BACA,4BACA,4BACA,wBACA,0CACA,8BACA,oCACA,oCACA,+BACA,gCACA,+BACA,yBACA,0BACA,4CACA,0BACA,0BACA,0BACA,0BACA,0BACA,2BACA,0BACA,+CACA,6BACA,mCACA,+BACA,yCACA,w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KAAK28C,aAGI,IAATnkC,GACFxY,KAAKwtD,wBAAwBxtD,KAAKooD,kBAC/Bt8C,UAAUyhD,EAEhB,CAED,uBAAAC,CAAwBjmD,GACtB,MAAMrD,EAAMlE,KAAK8nD,uBAAuBvgD,GAGxC,OADa6oB,GAAM0wB,EAAO58C,GACdqpB,KAAK7oB,GAAI1E,KAAKwpD,mBAAmBtpD,KAAKF,OACnD,CAED,oBAAAyrD,CAAqBjqD,GACnB,GAAmB,iBAARA,EACT,OAKF,MAAMisD,EAFG,kBAAkBjsD,EAAIqN,sBAG/Bo5C,GAAiBxkD,KAAKgqD,EACvB,CAED,oBAAA1R,GA0FE,MAzFoB,CAClB,6BACA,kCACA,oCACA,0CACA,sCACA,oCACA,mCACA,oCACA,kCACA,4BACA,8BACA,8BACA,6BACA,6BACA,sCACA,wCACA,yCACA,4BACA,2BACA,gCACA,oCACA,mCACA,oCACA,yCACA,uCACA,+CACA,uCACA,gDACA,wCACA,wCACA,6CACA,+BACA,iCACA,iCACA,gCACA,iCACA,4BACA,4BACA,sCACA,6BACA,+BACA,6BACA,wCACA,uCACA,kCACA,6BACA,+BACA,+BACA,gCACA,6BACA,4BACA,mCACA,+BACA,iCACA,kCACA,kCACA,iCACA,gCACA,iCACA,+BACA,kCACA,+BACA,8BACA,4BACA,mCACA,gCACA,gCACA,6BACA,gCACA,gCACA,sCACA,6BACA,8BACA,4CACA,8BACA,mCACA,CAAC,mCAAoC,qBACrC,CAAC,6CAA8C,wBAC/C,+BACA,8BACA,wCACA,qCACA,qCACA,uCACA,8BACA,8BAGiB32C,OAAO6iD,GAC3B,CAED,iBAAAyF,CAAkB97C,GAEjB,CAED,oBAAA+7C,CAAqB/7C,GACnB,IAAIrK,OAAEA,EAAMyb,GAAEA,EAAEinC,cAAEA,GAAkBr4C,EAAEiK,QACtCtU,EAASA,GAAU,CAAE,EACrBA,EAAS+J,GAAUtR,KAAKooD,iBAAkB7gD,GAE1C0iD,EAAgBA,GAAiBjnC,EAGjChj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