apprun 3.30.0 → 3.30.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  ## 3.30.0
6
6
 
7
+ * Add React-safe apprun-play-html
7
8
  * Add no-init-route flag
8
9
  * Save Rect in app in case it needs to be used in the future
9
10
  * Create custom element that extends HTMLDivElement
package/README.md CHANGED
@@ -20,7 +20,7 @@ const update = {
20
20
  };
21
21
  app.start(document.body, state, view, update);
22
22
  ```
23
- <div is="apprun-play" style="height:200px"></div>
23
+ <apprun-play style="height:200px"></apprun-play>
24
24
 
25
25
  ## AppRun Benefits
26
26
 
@@ -1 +1 @@
1
- {"version":3,"file":"dist/apprun-dev-tools.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,IARnB,CASGK,MAAM,I,yDCiFT,IAAIC,EACJ,MAAMP,EAAwB,iBAATQ,MAAqBA,KAAKA,OAASA,MAAQA,MAC3C,iBAAX,EAAAC,GAAuB,EAAAA,EAAOC,SAAW,EAAAD,GAAU,EAAAA,EACzDT,EAAU,KAAKA,EAAsB,gBACvCO,EAAMP,EAAU,KAEhBO,EAAM,IA/FD,MAYLI,cACEL,KAAKM,QAAU,GAGjBC,GAAGC,EAAcC,EAAuBC,EAAwB,IAC9DV,KAAKM,QAAQE,GAAQR,KAAKM,QAAQE,IAAS,GAC3CR,KAAKM,QAAQE,GAAMG,KAAK,CAAEF,GAAAA,EAAIC,QAAAA,IAGhCE,IAAIJ,EAAcC,GAChB,MAAMI,EAAcb,KAAKM,QAAQE,IAAS,GAE1CR,KAAKM,QAAQE,GAAQK,EAAYC,QAAQC,GAAQA,EAAIN,KAAOA,IA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AM6B,EAAO,CAACpD,EAAWE,EAAQqB,KAClB,MAATA,IACJ8B,EAAI/I,KAAK,CAAE0F,UAAAA,EAAWuB,MAAAA,IACtB0B,EAASG,KAAKlD,EAAQqB,KAGxB,OAAO,SAASnB,IACd,GAAI4C,GAAoB5C,EAAE5D,MAAO,CAC/B,MAAM+E,EAAQnB,EAAEwD,SAGV1D,EAAS,CAAEsD,KAFJpD,EAAE5D,MAEQiH,QADPrD,EAAEA,GAEZJ,EAAYI,EAAEJ,UAChBuB,aAAiBzF,QACnByF,EAAMsC,MAAKlB,GAAKS,EAAKpD,EAAWE,EAAQyC,KAExCS,EAAKpD,EAAWE,EAAQqB,U","sources":["webpack://apprun/webpack/universalModuleDefinition","webpack://apprun/./src/app.ts","webpack://apprun/webpack/bootstrap","webpack://apprun/webpack/runtime/define property getters","webpack://apprun/webpack/runtime/global","webpack://apprun/webpack/runtime/hasOwnProperty shorthand","webpack://apprun/webpack/runtime/make namespace object","webpack://apprun/./src/vdom-to-html.tsx","webpack://apprun/./src/apprun-dev-tools-tests.tsx","webpack://apprun/./src/apprun-dev-tools.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apprun\"] = factory();\n\telse\n\t\troot[\"apprun\"] = factory();\n})(this, () => {\nreturn ","import { EventOptions} from './types'\nexport class App {\n\n private _events: Object;\n\n public start;\n public h;\n public createElement;\n public render;\n public Fragment;\n public webComponent;\n public safeHTML;\n\n constructor() {\n this._events = {};\n }\n\n on(name: string, fn: (...args) => void, options: EventOptions = {}): void {\n this._events[name] = this._events[name] || [];\n this._events[name].push({ fn, options });\n }\n\n off(name: string, fn: (...args) => void): void {\n const subscribers = this._events[name] || [];\n\n this._events[name] = subscribers.filter((sub) => sub.fn !== fn);\n }\n\n find(name: string): any {\n return this._events[name];\n }\n\n run(name: string, ...args): number {\n const subscribers = this.getSubscribers(name, this._events);\n console.assert(subscribers && subscribers.length > 0, 'No subscriber for event: ' + name);\n subscribers.forEach((sub) => {\n const { fn, options } = sub;\n if (options.delay) {\n this.delay(name, fn, args, options);\n } else {\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }\n return !sub.options.once;\n });\n\n return subscribers.length;\n }\n\n once(name: string, fn, options: EventOptions = {}): void {\n this.on(name, fn, { ...options, once: true });\n }\n\n private delay(name, fn, args, options): void {\n if (options._t) clearTimeout(options._t);\n options._t = setTimeout(() => {\n clearTimeout(options._t);\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }, options.delay);\n }\n\n query(name: string, ...args): Promise<any[]> {\n const subscribers = this.getSubscribers(name, this._events);\n console.assert(subscribers && subscribers.length > 0, 'No subscriber for event: ' + name);\n const promises = subscribers.map(sub => {\n const { fn, options } = sub;\n return Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n });\n return Promise.all(promises);\n }\n\n private getSubscribers(name: string, events) {\n const subscribers = events[name] || [];\n\n // Update the list of subscribers by pulling out those which will run once.\n // We must do this update prior to running any of the events in case they\n // cause additional events to be turned off or on.\n events[name] = subscribers.filter((sub) => {\n return !sub.options.once;\n });\n Object.keys(events).filter(evt => evt.endsWith('*') && name.startsWith(evt.replace('*', '')))\n .sort((a, b) => b.length - a.length)\n .forEach(evt => subscribers.push(...events[evt].map(sub => ({\n ...sub,\n options: { ...sub.options, event: name }\n }))));\n return subscribers;\n }\n}\n\nconst AppRunVersions = 'AppRun-3';\nlet app: App;\nconst root = (typeof self === 'object' && self.self === self && self) ||\n (typeof global === 'object' && global.global === global && global)\nif (root['app'] && root['_AppRunVersions']) {\n app = root['app'];\n} else {\n app = new App();\n root['app'] = app;\n root['_AppRunVersions'] = AppRunVersions;\n}\nexport default app;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nimport { VDOM } from './types';\nimport { TemplateResult } from 'lit-html';\n\nfunction getProp(prop) {\n if (typeof prop === 'object') {\n return Object.keys(prop).map(name => `${name}:${prop[name]}`).join(';');\n }\n else return prop.toString();\n}\n\nfunction toProps(props) {\n return Object.keys(props)\n .map(name => ` ${name === 'className' ? 'class' : name}=\"${getProp(props[name])}\"`)\n .join('');\n}\n\nfunction toHTMLArray(nodes) {\n return nodes.map(node => toHTML(node)).join('');\n}\n\nfunction clean(obj) {\n for (var i in obj) {\n if (obj[i] == null) {\n delete obj[i];\n } else if (typeof obj[i] === 'object') {\n clean(obj[i]);\n }\n }\n}\n\nfunction toHTML (vdom) {\n if (!vdom) return '';\n if ('_$litType$' in vdom) {\n return vdom.toString();\n }\n clean(vdom);\n if (Array.isArray(vdom)) return toHTMLArray(vdom);\n if (typeof vdom === 'string') {\n return vdom.startsWith('_html:') ? vdom.substring(6) : vdom;\n } else if (vdom.tag) {\n const props = vdom.props ? toProps(vdom.props) : '';\n const children = vdom.children ? toHTMLArray(vdom.children) : '';\n return `<${vdom.tag}${props}>${children}</${vdom.tag}>`;\n }\n if (typeof vdom === 'object') return JSON.stringify(vdom);\n}\n\nexport default toHTML;","declare var app;\nlet win;\napp['debug'] = true;\n\nfunction openWin(name) {\n win = window.open('', name);\n win.document.write(`<html>\n <title>AppRun Analyzer | ${document.location.href}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\" }\n </style>\n <body><pre>`);\n}\n\nfunction write(text) {\n win.document.write(text + '\\n');\n}\n\nfunction closeWin() {\n win.document.write(`</pre>\n </body>\n </html>`);\n win.document.close();\n}\n\nconst print_component_test = component => {\n write(`import ${component.constructor.name} from '../src/${component.constructor.name}'`);\n write(`describe('${component.constructor.name}', ()=>{`);\n component._actions.forEach(action => {\n if (action.name !== '.') {\n write(` it ('should handle event: ${action.name}', (done)=>{`);\n write(` const component = new ${component.constructor.name}().mount();`);\n write(` component.run('${action.name}');`);\n write(` setTimeout(() => {`);\n write(` \\/\\/expect(?).toHaveBeenCalled();`);\n write(` \\/\\/expect(component.state).toBe(?);`);\n write(` done();`);\n write(` })`);\n }\n });\n write(`});`);\n};\nexport const _createEventTests = () => {\n const o = { components: {} };\n app.run('get-components', o);\n const { components } = o;\n openWin('');\n if (components instanceof Map) {\n for (let [key, comps] of components) {\n comps.forEach(print_component_test);\n }\n } else {\n Object.keys(components).forEach(el => {\n components[el].forEach(print_component_test);\n });\n }\n closeWin();\n}\n\nlet recording = false;\nlet events = [];\n\napp.on('debug', p => {\n if (recording && p.vdom) {\n events.push(p);\n console.log(`* ${events.length} state(s) recorded.`);\n }\n});\n\nexport const _createStateTests = (s) => {\n\n const printTests = () => {\n if (events.length === 0) {\n console.log('* No state recorded.');\n return;\n }\n openWin('');\n events.forEach((event, idx) => {\n write(` it ('view snapshot: #${idx + 1}', ()=>{`);\n write(` const component = new ${event.component.constructor.name}()`);\n write(` const state = ${JSON.stringify(event.state, undefined, 2)};`);\n write(` const vdom = component['view'](state);`);\n write(` expect(JSON.stringify(vdom)).toMatchSnapshot();`);\n write(` })`);\n });\n closeWin();\n }\n\n if (s === 'start') {\n events = [];\n recording = true;\n console.log('* State logging started.');\n } else if (s === 'stop') {\n printTests();\n recording = false;\n events = [];\n console.log('* State logging stopped.');\n } else {\n console.log('create-state-tests <start|stop>');\n }\n}\n","import app from './app';\nimport toHTML from './vdom-to-html';\nimport { _createEventTests, _createStateTests } from './apprun-dev-tools-tests';\n\napp['debug'] = true;\n\nwindow['_apprun-help'] = ['', () => {\n Object.keys(window).forEach(cmd => {\n if (cmd.startsWith('_apprun-')) {\n cmd === '_apprun-help' ?\n console.log('AppRun Commands:') :\n console.log(`* ${cmd.substring(8)}: ${window[cmd][0]}`);\n }\n });\n}];\n\nfunction newWin(html) {\n const win = window.open('', '_apprun_debug', 'toolbar=0');\n win.document.write(`<html>\n <title>AppRun Analyzer | ${document.location.href}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\" }\n li { margin-left: 80px; }\n </style>\n <body>\n <div id=\"main\">${html}</div>\n </script>\n </body>\n </html>`);\n win.document.close();\n}\n\nconst get_components = () => {\n const o = { components: {} };\n app.run('get-components', o);\n const { components } = o;\n return components;\n}\nconst viewElement = element => <div>\n {element.tagName.toLowerCase()}{element.id ? '#' + element.id : ''}\n {' '}\n {element.className && element.className.split(' ').map(c => '.' + c).join() }\n</div>;\n\nconst viewComponents = state => {\n\n const Events = ({ events }) => <ul>\n {events && events.filter(event => event.name !== '.').map(event => <li>\n {event.name}\n </li>)}\n </ul>;\n\n const Components = ({ components }) => <ul>\n {components.map(component => <li>\n <div>{component.constructor.name}</div>\n <Events events={component['_actions']} />\n </li>)}\n </ul>;\n\n return <ul>\n {state.map(({ element, comps}) => <li>\n <div>{viewElement(element)}</div>\n <Components components={comps} />\n </li>)}\n </ul>\n}\n\nconst viewEvents = state => {\n\n const Components = ({ components }) => <ul>\n {components.map(component => <li>\n <div>{component.constructor.name}</div>\n </li>)}\n </ul>;\n\n const Events = ({ events, global }) => <ul>\n {events && events\n .filter(event =>\n event.global === global && event.event !== '.')\n .map(({ event, components }) => <li>\n <div>{event}</div>\n <Components components={components} />\n </li>)}\n </ul>;\n\n return <div>\n <div>GLOBAL EVENTS</div>\n <Events events={state} global={true} />\n <div>LOCAL EVENTS</div>\n <Events events={state} global={false} />\n </div>\n}\n\nconst _events = (print?) => {\n const global_events = app['_events']\n const events = {};\n const cache = get_components();\n\n const add_component = component => component['_actions'].forEach(event => {\n events[event.name] = events[event.name] || [];\n events[event.name].push(component);\n });\n\n if (cache instanceof Map) {\n for (let [key, comps] of cache) {\n comps.forEach(add_component);\n }\n } else {\n Object.keys(cache).forEach(el =>\n cache[el].forEach(add_component)\n );\n }\n const data = [];\n Object.keys(events).forEach(event => {\n data.push({ event, components: events[event], global: global_events[event] ? true : false });\n });\n\n data.sort(((a, b) => a.event > b.event ? 1 : -1)).map(e => e.event);\n\n if (print) {\n const vdom = viewEvents(data);\n newWin(toHTML(vdom));\n } else {\n console.log('=== GLOBAL EVENTS ===')\n data.filter(event => event.global && event.event !== '.')\n .forEach(({ event, components }) => console.log({ event }, components));\n console.log('=== LOCAL EVENTS ===')\n data.filter(event => !event.global && event.event !== '.')\n .forEach(({ event, components }) => console.log({ event }, components));\n }\n}\n\nconst _components = (print?) => {\n const components = get_components();\n const data = [];\n\n if (components instanceof Map) {\n for (let [key, comps] of components) {\n const element = typeof key === 'string' ? document.getElementById(key) || document.querySelector(key): key;\n data.push({ element, comps });\n }\n } else {\n Object.keys(components).forEach(el => {\n const element = typeof el === 'string' ? document.getElementById(el) || document.querySelector(el): el;\n data.push({ element, comps: components[el] });\n });\n }\n if (print) {\n const vdom = viewComponents(data);\n newWin(toHTML(vdom));\n } else {\n data.forEach(({ element, comps }) => console.log(element, comps));\n }\n}\n\nlet debugging = Number(window?.localStorage?.getItem('__apprun_debugging__')) || 0;\napp.on('debug', p => {\n if (debugging & 1 && p.event) console.log(p);\n if (debugging & 2 && p.vdom) console.log(p);\n});\n\nwindow['_apprun-components'] = ['components [print]', (p) => {\n _components(p === 'print');\n}]\n\nwindow['_apprun-events'] = ['events [print]', (p) => {\n _events(p === 'print');\n}]\n\nwindow['_apprun-log'] = ['log [event|view] on|off', (a1?, a2?) => {\n if (a1 === 'on') {\n debugging = 3;\n } else if (a1 === 'off') {\n debugging = 0;\n } else if (a1 === 'event') {\n if (a2 === 'on') {\n debugging |= 1;\n } else if (a2 === 'off') {\n debugging &= ~1;\n }\n } else if (a1 === 'view') {\n if (a2 === 'on') {\n debugging |= 2;\n } else if (a2 === 'off') {\n debugging &= ~2;\n }\n }\n console.log(`* log ${a1} ${a2 || ''}`);\n window?.localStorage?.setItem('__apprun_debugging__', `${debugging}`)\n}];\n\nwindow['_apprun-create-event-tests'] = ['create-event-tests',\n () => _createEventTests()\n]\n\nwindow['_apprun-create-state-tests'] = ['create-state-tests <start|stop>',\n (p?) => _createStateTests(p)\n]\n\nwindow['_apprun'] = (strings) => {\n const [cmd, ...p] = strings[0].split(' ').filter(c => !!c);\n const command = window[`_apprun-${cmd}`];\n if (command) command[1](...p);\n else window['_apprun-help'][1]();\n}\n\nconsole.info('AppRun DevTools 2.27: type \"_apprun `help`\" to list all available commands.');\n\nconst reduxExt = window['__REDUX_DEVTOOLS_EXTENSION__'];\nif (reduxExt) {\n let devTools_running = false;\n const devTools = window['__REDUX_DEVTOOLS_EXTENSION__'].connect();\n if (devTools) {\n const hash = location.hash || '#';\n devTools.send(hash, '' );\n const buf = [{ component:null, state:''}];\n console.info('Connected to the Redux DevTools');\n devTools.subscribe((message) => {\n if (message.type === 'START') devTools_running = true;\n else if (message.type === 'STOP') devTools_running = false;\n else if (message.type === 'DISPATCH') {\n // console.log('From Redux DevTools: ', message);\n const idx = message.payload.index;\n if (idx === 0) { app.run(hash) }\n else {\n const { component, state } = buf[idx];\n component?.setState(state);\n }\n }\n });\n\n const send = (component, action, state) => {\n if (state == null) return;\n buf.push({ component, state });\n devTools.send(action, state);\n }\n\n app.on('debug', p => {\n if (devTools_running && p.event) {\n const state = p.newState;\n const type = p.event;\n const payload = p.p;\n const action = { type, payload };\n const component = p.component;\n if (state instanceof Promise) {\n state.then(s => send(component, action, s));\n } else {\n send(component, action, state);\n }\n }\n });\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","app","self","g","global","constructor","_events","on","name","fn","options","push","off","subscribers","filter","sub","find","run","args","getSubscribers","console","assert","length","forEach","delay","Object","keys","apply","once","_t","clearTimeout","setTimeout","query","promises","map","Promise","all","events","evt","endsWith","startsWith","replace","sort","a","b","event","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","defineProperty","enumerable","get","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","toHTMLArray","nodes","node","toHTML","join","clean","i","vdom","toString","Array","isArray","substring","tag","props","toProps","children","JSON","stringify","win","openWin","open","document","write","location","href","text","closeWin","close","print_component_test","component","_actions","action","recording","p","log","newWin","html","cmd","get_components","components","debugging","Number","localStorage","getItem","print","data","Map","comps","element","getElementById","querySelector","el","state","Events","Components","tagName","toLowerCase","id","className","split","c","viewElement","viewComponents","_components","global_events","cache","add_component","viewEvents","a1","a2","setItem","_createEventTests","s","idx","strings","command","info","devTools_running","devTools","connect","hash","send","buf","subscribe","message","type","payload","index","setState","newState","then"],"sourceRoot":""}
1
+ {"version":3,"file":"dist/apprun-dev-tools.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,I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ts","webpack://apprun/webpack/bootstrap","webpack://apprun/webpack/runtime/define property getters","webpack://apprun/webpack/runtime/global","webpack://apprun/webpack/runtime/hasOwnProperty shorthand","webpack://apprun/webpack/runtime/make namespace object","webpack://apprun/./src/vdom-to-html.tsx","webpack://apprun/./src/apprun-dev-tools-tests.tsx","webpack://apprun/./src/apprun-dev-tools.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apprun\"] = factory();\n\telse\n\t\troot[\"apprun\"] = factory();\n})(this, () => {\nreturn ","import { EventOptions} from './types'\nexport class App {\n\n private _events: Object;\n\n public start;\n public h;\n public createElement;\n public render;\n public Fragment;\n public webComponent;\n public safeHTML;\n\n constructor() {\n this._events = {};\n }\n\n on(name: string, fn: (...args) => void, options: EventOptions = {}): void {\n this._events[name] = this._events[name] || [];\n this._events[name].push({ fn, options });\n }\n\n off(name: string, fn: (...args) => void): void {\n const subscribers = this._events[name] || [];\n\n this._events[name] = subscribers.filter((sub) => sub.fn !== fn);\n }\n\n find(name: string): any {\n return this._events[name];\n }\n\n run(name: string, ...args): number {\n const subscribers = this.getSubscribers(name, this._events);\n console.assert(subscribers && subscribers.length > 0, 'No subscriber for event: ' + name);\n subscribers.forEach((sub) => {\n const { fn, options } = sub;\n if (options.delay) {\n this.delay(name, fn, args, options);\n } else {\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }\n return !sub.options.once;\n });\n\n return subscribers.length;\n }\n\n once(name: string, fn, options: EventOptions = {}): void {\n this.on(name, fn, { ...options, once: true });\n }\n\n private delay(name, fn, args, options): void {\n if (options._t) clearTimeout(options._t);\n options._t = setTimeout(() => {\n clearTimeout(options._t);\n Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n }, options.delay);\n }\n\n query(name: string, ...args): Promise<any[]> {\n const subscribers = this.getSubscribers(name, this._events);\n console.assert(subscribers && subscribers.length > 0, 'No subscriber for event: ' + name);\n const promises = subscribers.map(sub => {\n const { fn, options } = sub;\n return Object.keys(options).length > 0 ? fn.apply(this, [...args, options]) : fn.apply(this, args);\n });\n return Promise.all(promises);\n }\n\n private getSubscribers(name: string, events) {\n const subscribers = events[name] || [];\n\n // Update the list of subscribers by pulling out those which will run once.\n // We must do this update prior to running any of the events in case they\n // cause additional events to be turned off or on.\n events[name] = subscribers.filter((sub) => {\n return !sub.options.once;\n });\n Object.keys(events).filter(evt => evt.endsWith('*') && name.startsWith(evt.replace('*', '')))\n .sort((a, b) => b.length - a.length)\n .forEach(evt => subscribers.push(...events[evt].map(sub => ({\n ...sub,\n options: { ...sub.options, event: name }\n }))));\n return subscribers;\n }\n}\n\nconst AppRunVersions = 'AppRun-3';\nlet app: App;\nconst root = (typeof self === 'object' && self.self === self && self) ||\n (typeof global === 'object' && global.global === global && global)\nif (root['app'] && root['_AppRunVersions']) {\n app = root['app'];\n} else {\n app = new App();\n root['app'] = app;\n root['_AppRunVersions'] = AppRunVersions;\n}\nexport default app;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","\nimport { VDOM } from './types';\nimport { TemplateResult } from 'lit-html';\n\nfunction getProp(prop) {\n if (typeof prop === 'object') {\n return Object.keys(prop).map(name => `${name}:${prop[name]}`).join(';');\n }\n else return prop.toString();\n}\n\nfunction toProps(props) {\n return Object.keys(props)\n .map(name => ` ${name === 'className' ? 'class' : name}=\"${getProp(props[name])}\"`)\n .join('');\n}\n\nfunction toHTMLArray(nodes) {\n return nodes.map(node => toHTML(node)).join('');\n}\n\nfunction clean(obj) {\n for (var i in obj) {\n if (obj[i] == null) {\n delete obj[i];\n } else if (typeof obj[i] === 'object') {\n clean(obj[i]);\n }\n }\n}\n\nfunction toHTML (vdom) {\n if (!vdom) return '';\n if ('_$litType$' in vdom) {\n return vdom.toString();\n }\n clean(vdom);\n if (Array.isArray(vdom)) return toHTMLArray(vdom);\n if (typeof vdom === 'string') {\n return vdom.startsWith('_html:') ? vdom.substring(6) : vdom;\n } else if (vdom.tag) {\n const props = vdom.props ? toProps(vdom.props) : '';\n const children = vdom.children ? toHTMLArray(vdom.children) : '';\n return `<${vdom.tag}${props}>${children}</${vdom.tag}>`;\n }\n if (typeof vdom === 'object') return JSON.stringify(vdom);\n}\n\nexport default toHTML;","declare var app;\nlet win;\napp['debug'] = true;\n\nfunction openWin(name) {\n win = window.open('', name);\n win.document.write(`<html>\n <title>AppRun Analyzer | ${document.location.href}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\" }\n </style>\n <body><pre>`);\n}\n\nfunction write(text) {\n win.document.write(text + '\\n');\n}\n\nfunction closeWin() {\n win.document.write(`</pre>\n </body>\n </html>`);\n win.document.close();\n}\n\nconst print_component_test = component => {\n write(`import ${component.constructor.name} from '../src/${component.constructor.name}'`);\n write(`describe('${component.constructor.name}', ()=>{`);\n component._actions.forEach(action => {\n if (action.name !== '.') {\n write(` it ('should handle event: ${action.name}', (done)=>{`);\n write(` const component = new ${component.constructor.name}().mount();`);\n write(` component.run('${action.name}');`);\n write(` setTimeout(() => {`);\n write(` \\/\\/expect(?).toHaveBeenCalled();`);\n write(` \\/\\/expect(component.state).toBe(?);`);\n write(` done();`);\n write(` })`);\n }\n });\n write(`});`);\n};\nexport const _createEventTests = () => {\n const o = { components: {} };\n app.run('get-components', o);\n const { components } = o;\n openWin('');\n if (components instanceof Map) {\n for (let [key, comps] of components) {\n comps.forEach(print_component_test);\n }\n } else {\n Object.keys(components).forEach(el => {\n components[el].forEach(print_component_test);\n });\n }\n closeWin();\n}\n\nlet recording = false;\nlet events = [];\n\napp.on('debug', p => {\n if (recording && p.vdom) {\n events.push(p);\n console.log(`* ${events.length} state(s) recorded.`);\n }\n});\n\nexport const _createStateTests = (s) => {\n\n const printTests = () => {\n if (events.length === 0) {\n console.log('* No state recorded.');\n return;\n }\n openWin('');\n events.forEach((event, idx) => {\n write(` it ('view snapshot: #${idx + 1}', ()=>{`);\n write(` const component = new ${event.component.constructor.name}()`);\n write(` const state = ${JSON.stringify(event.state, undefined, 2)};`);\n write(` const vdom = component['view'](state);`);\n write(` expect(JSON.stringify(vdom)).toMatchSnapshot();`);\n write(` })`);\n });\n closeWin();\n }\n\n if (s === 'start') {\n events = [];\n recording = true;\n console.log('* State logging started.');\n } else if (s === 'stop') {\n printTests();\n recording = false;\n events = [];\n console.log('* State logging stopped.');\n } else {\n console.log('create-state-tests <start|stop>');\n }\n}\n","import app from './app';\nimport toHTML from './vdom-to-html';\nimport { _createEventTests, _createStateTests } from './apprun-dev-tools-tests';\n\napp['debug'] = true;\n\nwindow['_apprun-help'] = ['', () => {\n Object.keys(window).forEach(cmd => {\n if (cmd.startsWith('_apprun-')) {\n cmd === '_apprun-help' ?\n console.log('AppRun Commands:') :\n console.log(`* ${cmd.substring(8)}: ${window[cmd][0]}`);\n }\n });\n}];\n\nfunction newWin(html) {\n const win = window.open('', '_apprun_debug', 'toolbar=0');\n win.document.write(`<html>\n <title>AppRun Analyzer | ${document.location.href}</title>\n <style>\n body { font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\" }\n li { margin-left: 80px; }\n </style>\n <body>\n <div id=\"main\">${html}</div>\n </script>\n </body>\n </html>`);\n win.document.close();\n}\n\nconst get_components = () => {\n const o = { components: {} };\n app.run('get-components', o);\n const { components } = o;\n return components;\n}\nconst viewElement = element => <div>\n {element.tagName.toLowerCase()}{element.id ? '#' + element.id : ''}\n {' '}\n {element.className && element.className.split(' ').map(c => '.' + c).join() }\n</div>;\n\nconst viewComponents = state => {\n\n const Events = ({ events }) => <ul>\n {events && events.filter(event => event.name !== '.').map(event => <li>\n {event.name}\n </li>)}\n </ul>;\n\n const Components = ({ components }) => <ul>\n {components.map(component => <li>\n <div>{component.constructor.name}</div>\n <Events events={component['_actions']} />\n </li>)}\n </ul>;\n\n return <ul>\n {state.map(({ element, comps}) => <li>\n <div>{viewElement(element)}</div>\n <Components components={comps} />\n </li>)}\n </ul>\n}\n\nconst viewEvents = state => {\n\n const Components = ({ components }) => <ul>\n {components.map(component => <li>\n <div>{component.constructor.name}</div>\n </li>)}\n </ul>;\n\n const Events = ({ events, global }) => <ul>\n {events && events\n .filter(event =>\n event.global === global && event.event !== '.')\n .map(({ event, components }) => <li>\n <div>{event}</div>\n <Components components={components} />\n </li>)}\n </ul>;\n\n return <div>\n <div>GLOBAL EVENTS</div>\n <Events events={state} global={true} />\n <div>LOCAL EVENTS</div>\n <Events events={state} global={false} />\n </div>\n}\n\nconst _events = (print?) => {\n const global_events = app['_events']\n const events = {};\n const cache = get_components();\n\n const add_component = component => component['_actions'].forEach(event => {\n events[event.name] = events[event.name] || [];\n events[event.name].push(component);\n });\n\n if (cache instanceof Map) {\n for (let [key, comps] of cache) {\n comps.forEach(add_component);\n }\n } else {\n Object.keys(cache).forEach(el =>\n cache[el].forEach(add_component)\n );\n }\n const data = [];\n Object.keys(events).forEach(event => {\n data.push({ event, components: events[event], global: global_events[event] ? true : false });\n });\n\n data.sort(((a, b) => a.event > b.event ? 1 : -1)).map(e => e.event);\n\n if (print) {\n const vdom = viewEvents(data);\n newWin(toHTML(vdom));\n } else {\n console.log('=== GLOBAL EVENTS ===')\n data.filter(event => event.global && event.event !== '.')\n .forEach(({ event, components }) => console.log({ event }, components));\n console.log('=== LOCAL EVENTS ===')\n data.filter(event => !event.global && event.event !== '.')\n .forEach(({ event, components }) => console.log({ event }, components));\n }\n}\n\nconst _components = (print?) => {\n const components = get_components();\n const data = [];\n\n if (components instanceof Map) {\n for (let [key, comps] of components) {\n const element = typeof key === 'string' ? document.getElementById(key) || document.querySelector(key): key;\n data.push({ element, comps });\n }\n } else {\n Object.keys(components).forEach(el => {\n const element = typeof el === 'string' ? document.getElementById(el) || document.querySelector(el): el;\n data.push({ element, comps: components[el] });\n });\n }\n if (print) {\n const vdom = viewComponents(data);\n newWin(toHTML(vdom));\n } else {\n data.forEach(({ element, comps }) => console.log(element, comps));\n }\n}\n\nlet debugging = Number(window?.localStorage?.getItem('__apprun_debugging__')) || 0;\napp.on('debug', p => {\n if (debugging & 1 && p.event) console.log(p);\n if (debugging & 2 && p.vdom) console.log(p);\n});\n\nwindow['_apprun-components'] = ['components [print]', (p) => {\n _components(p === 'print');\n}]\n\nwindow['_apprun-events'] = ['events [print]', (p) => {\n _events(p === 'print');\n}]\n\nwindow['_apprun-log'] = ['log [event|view] on|off', (a1?, a2?) => {\n if (a1 === 'on') {\n debugging = 3;\n } else if (a1 === 'off') {\n debugging = 0;\n } else if (a1 === 'event') {\n if (a2 === 'on') {\n debugging |= 1;\n } else if (a2 === 'off') {\n debugging &= ~1;\n }\n } else if (a1 === 'view') {\n if (a2 === 'on') {\n debugging |= 2;\n } else if (a2 === 'off') {\n debugging &= ~2;\n }\n }\n console.log(`* log ${a1} ${a2 || ''}`);\n window?.localStorage?.setItem('__apprun_debugging__', `${debugging}`)\n}];\n\nwindow['_apprun-create-event-tests'] = ['create-event-tests',\n () => _createEventTests()\n]\n\nwindow['_apprun-create-state-tests'] = ['create-state-tests <start|stop>',\n (p?) => _createStateTests(p)\n]\n\nwindow['_apprun'] = (strings) => {\n const [cmd, ...p] = strings[0].split(' ').filter(c => !!c);\n const command = window[`_apprun-${cmd}`];\n if (command) command[1](...p);\n else window['_apprun-help'][1]();\n}\n\nconsole.info('AppRun DevTools 2.27: type \"_apprun `help`\" to list all available commands.');\n\nconst reduxExt = window['__REDUX_DEVTOOLS_EXTENSION__'];\nif (reduxExt) {\n let devTools_running = false;\n const devTools = window['__REDUX_DEVTOOLS_EXTENSION__'].connect();\n if (devTools) {\n const hash = location.hash || '#';\n devTools.send(hash, '' );\n const buf = [{ component:null, state:''}];\n console.info('Connected to the Redux DevTools');\n devTools.subscribe((message) => {\n if (message.type === 'START') devTools_running = true;\n else if (message.type === 'STOP') devTools_running = false;\n else if (message.type === 'DISPATCH') {\n // console.log('From Redux DevTools: ', message);\n const idx = message.payload.index;\n if (idx === 0) { app.run(hash) }\n else {\n const { component, state } = buf[idx];\n component?.setState(state);\n }\n }\n });\n\n const send = (component, action, state) => {\n if (state == null) return;\n buf.push({ component, state });\n devTools.send(action, state);\n }\n\n app.on('debug', p => {\n if (devTools_running && p.event) {\n const state = p.newState;\n const type = p.event;\n const payload = p.p;\n const action = { type, payload };\n const component = p.component;\n if (state instanceof Promise) {\n state.then(s => send(component, action, s));\n } else {\n send(component, action, state);\n }\n }\n });\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","app","self","g","global","constructor","_events","on","name","fn","options","push","off","subscribers","filter","sub","find","run","args","getSubscribers","console","assert","length","forEach","delay","Object","keys","apply","once","_t","clearTimeout","setTimeout","query","promises","map","Promise","all","events","evt","endsWith","startsWith","replace","sort","a","b","event","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","defineProperty","enumerable","get","globalThis","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","toHTMLArray","nodes","node","toHTML","join","clean","i","vdom","toString","Array","isArray","substring","tag","props","toProps","children","JSON","stringify","win","openWin","open","document","write","location","href","text","closeWin","close","print_component_test","component","_actions","action","recording","p","log","newWin","html","cmd","get_components","components","debugging","Number","localStorage","getItem","print","data","Map","comps","element","getElementById","querySelector","el","state","Events","Components","tagName","toLowerCase","id","className","split","c","viewElement","viewComponents","_components","global_events","cache","add_component","viewEvents","a1","a2","setItem","_createEventTests","s","idx","strings","command","info","devTools_running","devTools","connect","hash","send","buf","subscribe","message","type","payload","index","setState","newState","then"],"sourceRoot":""}
@@ -1,19 +1,19 @@
1
- class t{constructor(){this._events={}}on(t,i,s={}){this._events[t]=this._events[t]||[],this._events[t].push({fn:i,options:s})}off(t,i){const s=this._events[t]||[];this._events[t]=s.filter((t=>t.fn!==i))}find(t){return this._events[t]}run(t,...i){const s=this.getSubscribers(t,this._events);return console.assert(s&&s.length>0,"No subscriber for event: "+t),s.forEach((s=>{const{fn:n,options:e}=s;return e.delay?this.delay(t,n,i,e):Object.keys(e).length>0?n.apply(this,[...i,e]):n.apply(this,i),!s.options.once})),s.length}once(t,i,s={}){this.on(t,i,Object.assign(Object.assign({},s),{once:!0}))}delay(t,i,s,n){n._t&&clearTimeout(n._t),n._t=setTimeout((()=>{clearTimeout(n._t),Object.keys(n).length>0?i.apply(this,[...s,n]):i.apply(this,s)}),n.delay)}query(t,...i){const s=this.getSubscribers(t,this._events);console.assert(s&&s.length>0,"No subscriber for event: "+t);const n=s.map((t=>{const{fn:s,options:n}=t;return Object.keys(n).length>0?s.apply(this,[...i,n]):s.apply(this,i)}));return Promise.all(n)}getSubscribers(t,i){const s=i[t]||[];return i[t]=s.filter((t=>!t.options.once)),Object.keys(i).filter((i=>i.endsWith("*")&&t.startsWith(i.replace("*","")))).sort(((t,i)=>i.length-t.length)).forEach((n=>s.push(...i[n].map((i=>Object.assign(Object.assign({},i),{options:Object.assign(Object.assign({},i.options),{event:t})})))))),s}}let i;const s="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;s.app&&s._AppRunVersions?i=s.app:(i=new t,s.app=i,s._AppRunVersions="AppRun-3");var n=i;const e=(t,i)=>(i?t.state[i]:t.state)||"",o=(t,i,s)=>{if(i){const n=t.state||{};n[i]=s,t.setState(n)}else t.setState(s)},r=(t,i)=>{if(Array.isArray(t))return t.map((t=>r(t,i)));{let{tag:s,props:h,children:c}=t;return s?(h&&Object.keys(h).forEach((t=>{t.startsWith("$")&&(((t,i,s,r)=>{if(t.startsWith("$on")){const s=i[t];if(t=t.substring(1),"boolean"==typeof s)i[t]=i=>r.run?r.run(t,i):n.run(t,i);else if("string"==typeof s)i[t]=t=>r.run?r.run(s,t):n.run(s,t);else if("function"==typeof s)i[t]=t=>r.setState(s(r.state,t));else if(Array.isArray(s)){const[e,...o]=s;"string"==typeof e?i[t]=t=>r.run?r.run(e,...o,t):n.run(e,...o,t):"function"==typeof e&&(i[t]=t=>r.setState(e(r.state,...o,t)))}}else if("$bind"===t){const n=i.type||"text",h="string"==typeof i[t]?i[t]:i.name;if("input"===s)switch(n){case"checkbox":i.checked=e(r,h),i.onclick=t=>o(r,h||t.target.name,t.target.checked);break;case"radio":i.checked=e(r,h)===i.value,i.onclick=t=>o(r,h||t.target.name,t.target.value);break;case"number":case"range":i.value=e(r,h),i.oninput=t=>o(r,h||t.target.name,Number(t.target.value));break;default:i.value=e(r,h),i.oninput=t=>o(r,h||t.target.name,t.target.value)}else"select"===s?(i.value=e(r,h),i.onchange=t=>{t.target.multiple||o(r,h||t.target.name,t.target.value)}):"option"===s?(i.selected=e(r,h),i.onclick=t=>o(r,h||t.target.name,t.target.selected)):"textarea"===s&&(i.innerHTML=e(r,h),i.oninput=t=>o(r,h||t.target.name,t.target.value))}else n.run("$",{key:t,tag:s,props:i,component:r})})(t,h,s,i),delete h[t])})),c&&(c=r(c,i)),{tag:s,props:h,children:c}):t}};function h(t,...i){return c(i)}function c(t){const i=[],s=t=>{null!=t&&""!==t&&!1!==t&&i.push("function"==typeof t||"object"==typeof t?t:`${t}`)};return t&&t.forEach((t=>{Array.isArray(t)?t.forEach((t=>s(t))):s(t)})),i}function l(t,i,...s){const n=c(s);if("string"==typeof t)return{tag:t,props:i,children:n};if(Array.isArray(t))return t;if(void 0===t&&s)return n;if(Object.getPrototypeOf(t).t)return{tag:t,props:i,children:n};if("function"==typeof t)return t(i,n);throw new Error(`Unknown tag in vdom ${t}`)}const u=new WeakMap,d=(t,i,s={})=>{if(null==i||!1===i)return;!function(t,i,s={}){if(null==i||!1===i)return;if(i=g(i,s),!t)return;const n="SVG"===t.nodeName;Array.isArray(i)?f(t,i,n):f(t,[i],n)}("string"==typeof t&&t?document.getElementById(t)||document.querySelector(t):t,i=r(i,s),s)};function a(t,i,s){3!==i._op&&(s=s||"svg"===i.tag,!function(t,i){const s=t.nodeName,n=`${i.tag||""}`;return s.toUpperCase()===n.toUpperCase()}(t,i)?t.parentNode.replaceChild(y(i,s),t):(!(2&i._op)&&f(t,i.children,s),!(1&i._op)&&b(t,i.props,s)))}function f(t,i,s){var n,e;const o=(null===(n=t.childNodes)||void 0===n?void 0:n.length)||0,r=(null==i?void 0:i.length)||0,h=Math.min(o,r);for(let n=0;n<h;n++){const e=i[n];if(3===e._op)continue;const o=t.childNodes[n];if("string"==typeof e)o.textContent!==e&&(3===o.nodeType?o.nodeValue=e:t.replaceChild(p(e),o));else if(e instanceof HTMLElement||e instanceof SVGElement)t.insertBefore(e,o);else{const i=e.props&&e.props.key;if(i)if(o.key===i)a(t.childNodes[n],e,s);else{const r=u[i];if(r){const i=r.nextSibling;t.insertBefore(r,o),i?t.insertBefore(o,i):t.appendChild(o),a(t.childNodes[n],e,s)}else t.replaceChild(y(e,s),o)}else a(t.childNodes[n],e,s)}}let c=(null===(e=t.childNodes)||void 0===e?void 0:e.length)||0;for(;c>h;)t.removeChild(t.lastChild),c--;if(r>h){const n=document.createDocumentFragment();for(let t=h;t<i.length;t++)n.appendChild(y(i[t],s));t.appendChild(n)}}const v=t=>{const i=document.createElement("section");return i.insertAdjacentHTML("afterbegin",t),Array.from(i.children)};function p(t){if(0===(null==t?void 0:t.indexOf("_html:"))){const i=document.createElement("div");return i.insertAdjacentHTML("afterbegin",t.substring(6)),i}return document.createTextNode(null!=t?t:"")}function y(t,i){if(t instanceof HTMLElement||t instanceof SVGElement)return t;if("string"==typeof t)return p(t);if(!t.tag||"function"==typeof t.tag)return p(JSON.stringify(t));const s=(i=i||"svg"===t.tag)?document.createElementNS("http://www.w3.org/2000/svg",t.tag):document.createElement(t.tag);return b(s,t.props,i),t.children&&t.children.forEach((t=>s.appendChild(y(t,i)))),s}function b(t,i,s){const n=t._props||{};i=function(t,i){i.class=i.class||i.className,delete i.className;const s={};return t&&Object.keys(t).forEach((t=>s[t]=null)),i&&Object.keys(i).forEach((t=>s[t]=i[t])),s}(n,i||{}),t._props=i;for(const n in i){const e=i[n];if(n.startsWith("data-")){const i=n.substring(5).replace(/-(\w)/g,(t=>t[1].toUpperCase()));t.dataset[i]!==e&&(e||""===e?t.dataset[i]=e:delete t.dataset[i])}else if("style"===n)if(t.style.cssText&&(t.style.cssText=""),"string"==typeof e)t.style.cssText=e;else for(const i in e)t.style[i]!==e[i]&&(t.style[i]=e[i]);else if(n.startsWith("xlink")){const i=n.replace("xlink","").toLowerCase();null==e||!1===e?t.removeAttributeNS("http://www.w3.org/1999/xlink",i):t.setAttributeNS("http://www.w3.org/1999/xlink",i,e)}else n.startsWith("on")?e&&"function"!=typeof e?"string"==typeof e&&(e?t.setAttribute(n,e):t.removeAttribute(n)):t[n]=e:/^id$|^class$|^list$|^readonly$|^contenteditable$|^role|-/g.test(n)||s?t.getAttribute(n)!==e&&(e?t.setAttribute(n,e):t.removeAttribute(n)):t[n]!==e&&(t[n]=e);"key"===n&&e&&(u[e]=t)}i&&"function"==typeof i.ref&&window.requestAnimationFrame((()=>i.ref(t)))}function g(t,i,s=0){var n;if("string"==typeof t)return t;if(Array.isArray(t))return t.map((t=>g(t,i,s++)));let e=t;if(t&&"function"==typeof t.tag&&Object.getPrototypeOf(t.tag).t&&(e=function(t,i,s){const{tag:n,props:e,children:o}=t;let r=`_${s}`,h=e&&e.id;h?r=h:h=`_${s}${Date.now()}`;let c="section";e&&e.as&&(c=e.as,delete e.as),i.i||(i.i={});let l=i.i[r];if(!(l&&l instanceof n&&l.element)){const t=document.createElement(c);l=i.i[r]=new n(Object.assign(Object.assign({},e),{children:o})).start(t)}if(l.mounted){const t=l.mounted(e,o,l.state);void 0!==t&&l.setState(t)}return b(l.element,e,!1),l.element}(t,i,s)),e&&Array.isArray(e.children)){const t=null===(n=e.props)||void 0===n?void 0:n._component;if(t){let i=0;e.children=e.children.map((s=>g(s,t,i++)))}else e.children=e.children.map((t=>g(t,i,s++)))}return e}const w=(t,i={})=>class extends HTMLDivElement{constructor(){super()}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(i.observedAttributes||[]).map((t=>t.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component){const s=i||{};this._shadowRoot=s.shadow?this.attachShadow({mode:"open"}):this;const n=s.observedAttributes||[],e=n.reduce(((t,i)=>{const s=i.toLowerCase();return s!==i&&(t[s]=i),t}),{});this._attrMap=t=>e[t]||t;const o={};Array.from(this.attributes).forEach((t=>o[this._attrMap(t.name)]=t.value)),n.forEach((t=>{void 0!==this[t]&&(o[t]=this[t]),Object.defineProperty(this,t,{get:()=>o[t],set(i){this.attributeChangedCallback(t,o[t],i)},configurable:!0,enumerable:!0})})),requestAnimationFrame((()=>{const i=this.children?Array.from(this.children):[];if(i.forEach((t=>t.parentElement.removeChild(t))),this._component=new t(Object.assign(Object.assign({},o),{children:i})).mount(this._shadowRoot,s),this._component._props=o,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const t=this._component.mounted(o,i,this._component.state);void 0!==t&&(this._component.state=t)}this.on=this._component.on.bind(this._component),this.run=this._component.run.bind(this._component),!1!==s.render&&this._component.run(".")}))}}disconnectedCallback(){var t,i,s,n;null===(i=null===(t=this._component)||void 0===t?void 0:t.unload)||void 0===i||i.call(t),null===(n=null===(s=this._component)||void 0===s?void 0:s.unmount)||void 0===n||n.call(s),this._component=null}attributeChangedCallback(t,s,n){if(this._component){const e=this._attrMap(t);this._component._props[e]=n,this._component.run("attributeChanged",e,s,n),n!==s&&!1!==i.render&&window.requestAnimationFrame((()=>{this._component.run(".")}))}}};var m=(t,i,s)=>{"undefined"!=typeof customElements&&customElements.define(t,w(i,s),{extends:"div"})};const $={meta:new WeakMap,defineMetadata(t,i,s){this.meta.has(s)||this.meta.set(s,{}),this.meta.get(s)[t]=i},getMetadataKeys(t){return t=Object.getPrototypeOf(t),this.meta.get(t)?Object.keys(this.meta.get(t)):[]},getMetadata(t,i){return i=Object.getPrototypeOf(i),this.meta.get(i)?this.meta.get(i)[t]:null}};function j(t,i={}){return(s,n,e)=>{const o=t?t.toString():n;return $.defineMetadata(`apprun-update:${o}`,{name:o,key:n,options:i},s),e}}function A(t,i={}){return function(s,n){const e=t?t.toString():n;$.defineMetadata(`apprun-update:${e}`,{name:e,key:n,options:i},s)}}function O(t,i){return function(s){return m(t,s,i),s}}const _=new Map;n.find("get-components")||n.on("get-components",(t=>t.components=_));const x=t=>t;class k{constructor(i,s,n,e){this.state=i,this.view=s,this.update=n,this.options=e,this._app=new t,this._actions=[],this._global_events=[],this._history=[],this._history_idx=-1,this._history_prev=()=>{this._history_idx--,this._history_idx>=0?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=0},this._history_next=()=>{this._history_idx++,this._history_idx<this._history.length?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=this._history.length-1},this.start=(t=null,i)=>this.mount(t,Object.assign({render:!0},i))}renderState(t,i=null){if(!this.view)return;let s=i||this.view(t);if(n.debug&&n.run("debug",{component:this,_:s?".":"-",state:t,vdom:s,el:this.element}),"object"!=typeof document)return;const e="string"==typeof this.element&&this.element?document.getElementById(this.element)||document.querySelector(this.element):this.element;if(e){const t="_c";this.unload?e._component===this&&e.getAttribute(t)===this.tracking_id||(this.tracking_id=(new Date).valueOf().toString(),e.setAttribute(t,this.tracking_id),"undefined"!=typeof MutationObserver&&(this.observer||(this.observer=new MutationObserver((t=>{t[0].oldValue!==this.tracking_id&&document.body.contains(e)||(this.unload(this.state),this.observer.disconnect(),this.observer=null)}))),this.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[t]}))):e.removeAttribute&&e.removeAttribute(t),e._component=this}!i&&s&&(s=r(s,this),n.render(e,s,this)),this.rendered&&this.rendered(this.state)}setState(t,i={render:!0,history:!1}){if(t instanceof Promise)Promise.resolve(t).then((s=>{this.setState(s,i),this._state=t}));else{if(this._state=t,null==t)return;this.state=t,!1!==i.render&&this.renderState(t),!1!==i.history&&this.enable_history&&(this._history=[...this._history,t],this._history_idx=this._history.length-1),"function"==typeof i.callback&&i.callback(this.state)}}mount(t=null,i){var s,e;return console.assert(!this.element,"Component already mounted."),this.options=i=Object.assign(Object.assign({},this.options),i),this.element=t,this.global_event=i.global_event,this.enable_history=!!i.history,this.enable_history&&(this.on(i.history.prev||"history-prev",this._history_prev),this.on(i.history.next||"history-next",this._history_next)),i.route&&(this.update=this.update||{},this.update[i.route]||(this.update[i.route]=x)),this.add_actions(),this.state=null!==(e=null!==(s=this.state)&&void 0!==s?s:this.model)&&void 0!==e?e:{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!i.render,history:!0}),n.debug&&(_.get(t)?_.get(t).push(this):_.set(t,[this])),this}is_global_event(t){return t&&(this.global_event||this._global_events.indexOf(t)>=0||t.startsWith("#")||t.startsWith("/")||t.startsWith("@"))}add_action(t,i,s={}){i&&"function"==typeof i&&(s.global&&this._global_events.push(t),this.on(t,((...e)=>{n.debug&&n.run("debug",{component:this,_:">",event:t,p:e,current_state:this.state,options:s});const o=i(this.state,...e);n.debug&&n.run("debug",{component:this,_:"<",event:t,p:e,newState:o,state:this.state,options:s}),this.setState(o,s)}),s))}add_actions(){const t=this.update||{};$.getMetadataKeys(this).forEach((i=>{if(i.startsWith("apprun-update:")){const s=$.getMetadata(i,this);t[s.name]=[this[s.key].bind(this),s.options]}}));const i={};Array.isArray(t)?t.forEach((t=>{const[s,n,e]=t;s.toString().split(",").forEach((t=>i[t.trim()]=[n,e]))})):Object.keys(t).forEach((s=>{const n=t[s];("function"==typeof n||Array.isArray(n))&&s.split(",").forEach((t=>i[t.trim()]=n))})),i["."]||(i["."]=x),Object.keys(i).forEach((t=>{const s=i[t];"function"==typeof s?this.add_action(t,s):Array.isArray(s)&&this.add_action(t,s[0],s[1])}))}run(t,...i){if(this.state instanceof Promise)return Promise.resolve(this.state).then((s=>{this.state=s,this.run(t,...i)}));{const s=t.toString();return this.is_global_event(s)?n.run(s,...i):this._app.run(s,...i)}}on(t,i,s){const e=t.toString();return this._actions.push({name:e,fn:i}),this.is_global_event(e)?n.on(e,i,s):this._app.on(e,i,s)}unmount(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this._actions.forEach((t=>{const{name:i,fn:s}=t;this.is_global_event(i)?n.off(i,s):this._app.off(i,s)}))}}k.t=!0;const T="//",M="///",E=t=>{if(t||(t="#"),t.startsWith("#")){const[i,...s]=t.split("/");n.run(i,...s)||n.run("///",i,...s),n.run("//",i,...s)}else if(t.startsWith("/")){const[i,s,...e]=t.split("/");n.run("/"+s,...e)||n.run("///","/"+s,...e),n.run("//","/"+s,...e)}else n.run(t)||n.run("///",t),n.run("//",t)};n.h=n.createElement=l,n.render=d,n.Fragment=h,n.webComponent=m,n.safeHTML=v,n.start=(t,i,s,n,e)=>{const o=Object.assign({render:!0,global_event:!0},e),r=new k(i,s,n);return e&&e.rendered&&(r.rendered=e.rendered),r.mount(t,o),r};const C=t=>{};
1
+ class t{constructor(){this._events={}}on(t,i,s={}){this._events[t]=this._events[t]||[],this._events[t].push({fn:i,options:s})}off(t,i){const s=this._events[t]||[];this._events[t]=s.filter((t=>t.fn!==i))}find(t){return this._events[t]}run(t,...i){const s=this.getSubscribers(t,this._events);return console.assert(s&&s.length>0,"No subscriber for event: "+t),s.forEach((s=>{const{fn:n,options:e}=s;return e.delay?this.delay(t,n,i,e):Object.keys(e).length>0?n.apply(this,[...i,e]):n.apply(this,i),!s.options.once})),s.length}once(t,i,s={}){this.on(t,i,Object.assign(Object.assign({},s),{once:!0}))}delay(t,i,s,n){n._t&&clearTimeout(n._t),n._t=setTimeout((()=>{clearTimeout(n._t),Object.keys(n).length>0?i.apply(this,[...s,n]):i.apply(this,s)}),n.delay)}query(t,...i){const s=this.getSubscribers(t,this._events);console.assert(s&&s.length>0,"No subscriber for event: "+t);const n=s.map((t=>{const{fn:s,options:n}=t;return Object.keys(n).length>0?s.apply(this,[...i,n]):s.apply(this,i)}));return Promise.all(n)}getSubscribers(t,i){const s=i[t]||[];return i[t]=s.filter((t=>!t.options.once)),Object.keys(i).filter((i=>i.endsWith("*")&&t.startsWith(i.replace("*","")))).sort(((t,i)=>i.length-t.length)).forEach((n=>s.push(...i[n].map((i=>Object.assign(Object.assign({},i),{options:Object.assign(Object.assign({},i.options),{event:t})})))))),s}}let i;const s="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;s.app&&s._AppRunVersions?i=s.app:(i=new t,s.app=i,s._AppRunVersions="AppRun-3");var n=i;const e=(t,i)=>(i?t.state[i]:t.state)||"",o=(t,i,s)=>{if(i){const n=t.state||{};n[i]=s,t.setState(n)}else t.setState(s)},r=(t,i)=>{if(Array.isArray(t))return t.map((t=>r(t,i)));{let{tag:s,props:h,children:c}=t;return s?(h&&Object.keys(h).forEach((t=>{t.startsWith("$")&&(((t,i,s,r)=>{if(t.startsWith("$on")){const s=i[t];if(t=t.substring(1),"boolean"==typeof s)i[t]=i=>r.run?r.run(t,i):n.run(t,i);else if("string"==typeof s)i[t]=t=>r.run?r.run(s,t):n.run(s,t);else if("function"==typeof s)i[t]=t=>r.setState(s(r.state,t));else if(Array.isArray(s)){const[e,...o]=s;"string"==typeof e?i[t]=t=>r.run?r.run(e,...o,t):n.run(e,...o,t):"function"==typeof e&&(i[t]=t=>r.setState(e(r.state,...o,t)))}}else if("$bind"===t){const n=i.type||"text",h="string"==typeof i[t]?i[t]:i.name;if("input"===s)switch(n){case"checkbox":i.checked=e(r,h),i.onclick=t=>o(r,h||t.target.name,t.target.checked);break;case"radio":i.checked=e(r,h)===i.value,i.onclick=t=>o(r,h||t.target.name,t.target.value);break;case"number":case"range":i.value=e(r,h),i.oninput=t=>o(r,h||t.target.name,Number(t.target.value));break;default:i.value=e(r,h),i.oninput=t=>o(r,h||t.target.name,t.target.value)}else"select"===s?(i.value=e(r,h),i.onchange=t=>{t.target.multiple||o(r,h||t.target.name,t.target.value)}):"option"===s?(i.selected=e(r,h),i.onclick=t=>o(r,h||t.target.name,t.target.selected)):"textarea"===s&&(i.innerHTML=e(r,h),i.oninput=t=>o(r,h||t.target.name,t.target.value))}else n.run("$",{key:t,tag:s,props:i,component:r})})(t,h,s,i),delete h[t])})),c&&(c=r(c,i)),{tag:s,props:h,children:c}):t}};function h(t,...i){return l(i)}const c="_props";function l(t){const i=[],s=t=>{null!=t&&""!==t&&!1!==t&&i.push("function"==typeof t||"object"==typeof t?t:`${t}`)};return t&&t.forEach((t=>{Array.isArray(t)?t.forEach((t=>s(t))):s(t)})),i}function u(t,i,...s){const n=l(s);if("string"==typeof t)return{tag:t,props:i,children:n};if(Array.isArray(t))return t;if(void 0===t&&s)return n;if(Object.getPrototypeOf(t).t)return{tag:t,props:i,children:n};if("function"==typeof t)return t(i,n);throw new Error(`Unknown tag in vdom ${t}`)}const d=new WeakMap,a=(t,i,s={})=>{if(null==i||!1===i)return;!function(t,i,s={}){if(null==i||!1===i)return;if(i=w(i,s),!t)return;const n="SVG"===t.nodeName;Array.isArray(i)?v(t,i,n):v(t,[i],n)}("string"==typeof t&&t?document.getElementById(t)||document.querySelector(t):t,i=r(i,s),s)};function f(t,i,s){3!==i._op&&(s=s||"svg"===i.tag,!function(t,i){const s=t.nodeName,n=`${i.tag||""}`;return s.toUpperCase()===n.toUpperCase()}(t,i)?t.parentNode.replaceChild(b(i,s),t):(!(2&i._op)&&v(t,i.children,s),!(1&i._op)&&g(t,i.props,s)))}function v(t,i,s){var n,e;const o=(null===(n=t.childNodes)||void 0===n?void 0:n.length)||0,r=(null==i?void 0:i.length)||0,h=Math.min(o,r);for(let n=0;n<h;n++){const e=i[n];if(3===e._op)continue;const o=t.childNodes[n];if("string"==typeof e)o.textContent!==e&&(3===o.nodeType?o.nodeValue=e:t.replaceChild(y(e),o));else if(e instanceof HTMLElement||e instanceof SVGElement)t.insertBefore(e,o);else{const i=e.props&&e.props.key;if(i)if(o.key===i)f(t.childNodes[n],e,s);else{const r=d[i];if(r){const i=r.nextSibling;t.insertBefore(r,o),i?t.insertBefore(o,i):t.appendChild(o),f(t.childNodes[n],e,s)}else t.replaceChild(b(e,s),o)}else f(t.childNodes[n],e,s)}}let c=(null===(e=t.childNodes)||void 0===e?void 0:e.length)||0;for(;c>h;)t.removeChild(t.lastChild),c--;if(r>h){const n=document.createDocumentFragment();for(let t=h;t<i.length;t++)n.appendChild(b(i[t],s));t.appendChild(n)}}const p=t=>{const i=document.createElement("section");return i.insertAdjacentHTML("afterbegin",t),Array.from(i.children)};function y(t){if(0===(null==t?void 0:t.indexOf("_html:"))){const i=document.createElement("div");return i.insertAdjacentHTML("afterbegin",t.substring(6)),i}return document.createTextNode(null!=t?t:"")}function b(t,i){if(t instanceof HTMLElement||t instanceof SVGElement)return t;if("string"==typeof t)return y(t);if(!t.tag||"function"==typeof t.tag)return y(JSON.stringify(t));const s=(i=i||"svg"===t.tag)?document.createElementNS("http://www.w3.org/2000/svg",t.tag):document.createElement(t.tag);return g(s,t.props,i),t.children&&t.children.forEach((t=>s.appendChild(b(t,i)))),s}function g(t,i,s){const n=t[c]||{};i=function(t,i){i.class=i.class||i.className,delete i.className;const s={};return t&&Object.keys(t).forEach((t=>s[t]=null)),i&&Object.keys(i).forEach((t=>s[t]=i[t])),s}(n,i||{}),t[c]=i;for(const n in i){const e=i[n];if(n.startsWith("data-")){const i=n.substring(5).replace(/-(\w)/g,(t=>t[1].toUpperCase()));t.dataset[i]!==e&&(e||""===e?t.dataset[i]=e:delete t.dataset[i])}else if("style"===n)if(t.style.cssText&&(t.style.cssText=""),"string"==typeof e)t.style.cssText=e;else for(const i in e)t.style[i]!==e[i]&&(t.style[i]=e[i]);else if(n.startsWith("xlink")){const i=n.replace("xlink","").toLowerCase();null==e||!1===e?t.removeAttributeNS("http://www.w3.org/1999/xlink",i):t.setAttributeNS("http://www.w3.org/1999/xlink",i,e)}else n.startsWith("on")?e&&"function"!=typeof e?"string"==typeof e&&(e?t.setAttribute(n,e):t.removeAttribute(n)):t[n]=e:/^id$|^class$|^list$|^readonly$|^contenteditable$|^role|-/g.test(n)||s?t.getAttribute(n)!==e&&(e?t.setAttribute(n,e):t.removeAttribute(n)):t[n]!==e&&(t[n]=e);"key"===n&&e&&(d[e]=t)}i&&"function"==typeof i.ref&&window.requestAnimationFrame((()=>i.ref(t)))}function w(t,i,s=0){var n;if("string"==typeof t)return t;if(Array.isArray(t))return t.map((t=>w(t,i,s++)));let e=t;if(t&&"function"==typeof t.tag&&Object.getPrototypeOf(t.tag).t&&(e=function(t,i,s){const{tag:n,props:e,children:o}=t;let r=`_${s}`,h=e&&e.id;h?r=h:h=`_${s}${Date.now()}`;let c="section";e&&e.as&&(c=e.as,delete e.as),i.i||(i.i={});let l=i.i[r];if(l&&l instanceof n&&l.element)l.renderState(l.state);else{const t=document.createElement(c);l=i.i[r]=new n(Object.assign(Object.assign({},e),{children:o})).start(t)}if(l.mounted){const t=l.mounted(e,o,l.state);void 0!==t&&l.setState(t)}return g(l.element,e,!1),l.element}(t,i,s)),e&&Array.isArray(e.children)){const t=null===(n=e.props)||void 0===n?void 0:n._component;if(t){let i=0;e.children=e.children.map((s=>w(s,t,i++)))}else e.children=e.children.map((t=>w(t,i,s++)))}return e}const m=(t,i={})=>class extends HTMLElement{constructor(){super()}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(i.observedAttributes||[]).map((t=>t.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component){const s=i||{};this._shadowRoot=s.shadow?this.attachShadow({mode:"open"}):this;const n=s.observedAttributes||[],e=n.reduce(((t,i)=>{const s=i.toLowerCase();return s!==i&&(t[s]=i),t}),{});this._attrMap=t=>e[t]||t;const o={};Array.from(this.attributes).forEach((t=>o[this._attrMap(t.name)]=t.value)),n.forEach((t=>{void 0!==this[t]&&(o[t]=this[t]),Object.defineProperty(this,t,{get:()=>o[t],set(i){this.attributeChangedCallback(t,o[t],i)},configurable:!0,enumerable:!0})})),requestAnimationFrame((()=>{const i=this.children?Array.from(this.children):[];if(i.forEach((t=>t.parentElement.removeChild(t))),this._component=new t(Object.assign(Object.assign({},o),{children:i})).mount(this._shadowRoot,s),this._component._props=o,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const t=this._component.mounted(o,i,this._component.state);void 0!==t&&(this._component.state=t)}this.on=this._component.on.bind(this._component),this.run=this._component.run.bind(this._component),!1!==s.render&&this._component.run(".")}))}}disconnectedCallback(){var t,i,s,n;null===(i=null===(t=this._component)||void 0===t?void 0:t.unload)||void 0===i||i.call(t),null===(n=null===(s=this._component)||void 0===s?void 0:s.unmount)||void 0===n||n.call(s),this._component=null}attributeChangedCallback(t,s,n){if(this._component){const e=this._attrMap(t);this._component._props[e]=n,this._component.run("attributeChanged",e,s,n),n!==s&&!1!==i.render&&window.requestAnimationFrame((()=>{this._component.run(".")}))}}};var $=(t,i,s)=>{"undefined"!=typeof customElements&&customElements.define(t,m(i,s))};const j={meta:new WeakMap,defineMetadata(t,i,s){this.meta.has(s)||this.meta.set(s,{}),this.meta.get(s)[t]=i},getMetadataKeys(t){return t=Object.getPrototypeOf(t),this.meta.get(t)?Object.keys(this.meta.get(t)):[]},getMetadata(t,i){return i=Object.getPrototypeOf(i),this.meta.get(i)?this.meta.get(i)[t]:null}};function A(t,i={}){return(s,n,e)=>{const o=t?t.toString():n;return j.defineMetadata(`apprun-update:${o}`,{name:o,key:n,options:i},s),e}}function O(t,i={}){return function(s,n){const e=t?t.toString():n;j.defineMetadata(`apprun-update:${e}`,{name:e,key:n,options:i},s)}}function _(t,i){return function(s){return $(t,s,i),s}}const x=new Map;n.find("get-components")||n.on("get-components",(t=>t.components=x));const k=t=>t;class T{constructor(i,s,n,e){this.state=i,this.view=s,this.update=n,this.options=e,this._app=new t,this._actions=[],this._global_events=[],this._history=[],this._history_idx=-1,this._history_prev=()=>{this._history_idx--,this._history_idx>=0?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=0},this._history_next=()=>{this._history_idx++,this._history_idx<this._history.length?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=this._history.length-1},this.start=(t=null,i)=>this.mount(t,Object.assign({render:!0},i))}renderState(t,i=null){if(!this.view)return;let s=i||this.view(t);if(n.debug&&n.run("debug",{component:this,_:s?".":"-",state:t,vdom:s,el:this.element}),"object"!=typeof document)return;const e="string"==typeof this.element&&this.element?document.getElementById(this.element)||document.querySelector(this.element):this.element;if(e){const t="_c";this.unload?e._component===this&&e.getAttribute(t)===this.tracking_id||(this.tracking_id=(new Date).valueOf().toString(),e.setAttribute(t,this.tracking_id),"undefined"!=typeof MutationObserver&&(this.observer||(this.observer=new MutationObserver((t=>{t[0].oldValue!==this.tracking_id&&document.body.contains(e)||(this.unload(this.state),this.observer.disconnect(),this.observer=null)}))),this.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[t]}))):e.removeAttribute&&e.removeAttribute(t),e._component=this}!i&&s&&(s=r(s,this),n.render(e,s,this)),this.rendered&&this.rendered(this.state)}setState(t,i={render:!0,history:!1}){if(t instanceof Promise)Promise.resolve(t).then((s=>{this.setState(s,i),this._state=t}));else{if(this._state=t,null==t)return;this.state=t,!1!==i.render&&this.renderState(t),!1!==i.history&&this.enable_history&&(this._history=[...this._history,t],this._history_idx=this._history.length-1),"function"==typeof i.callback&&i.callback(this.state)}}mount(t=null,i){var s,e;return console.assert(!this.element,"Component already mounted."),this.options=i=Object.assign(Object.assign({},this.options),i),this.element=t,this.global_event=i.global_event,this.enable_history=!!i.history,this.enable_history&&(this.on(i.history.prev||"history-prev",this._history_prev),this.on(i.history.next||"history-next",this._history_next)),i.route&&(this.update=this.update||{},this.update[i.route]||(this.update[i.route]=k)),this.add_actions(),this.state=null!==(e=null!==(s=this.state)&&void 0!==s?s:this.model)&&void 0!==e?e:{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!i.render,history:!0}),n.debug&&(x.get(t)?x.get(t).push(this):x.set(t,[this])),this}is_global_event(t){return t&&(this.global_event||this._global_events.indexOf(t)>=0||t.startsWith("#")||t.startsWith("/")||t.startsWith("@"))}add_action(t,i,s={}){i&&"function"==typeof i&&(s.global&&this._global_events.push(t),this.on(t,((...e)=>{n.debug&&n.run("debug",{component:this,_:">",event:t,p:e,current_state:this.state,options:s});const o=i(this.state,...e);n.debug&&n.run("debug",{component:this,_:"<",event:t,p:e,newState:o,state:this.state,options:s}),this.setState(o,s)}),s))}add_actions(){const t=this.update||{};j.getMetadataKeys(this).forEach((i=>{if(i.startsWith("apprun-update:")){const s=j.getMetadata(i,this);t[s.name]=[this[s.key].bind(this),s.options]}}));const i={};Array.isArray(t)?t.forEach((t=>{const[s,n,e]=t;s.toString().split(",").forEach((t=>i[t.trim()]=[n,e]))})):Object.keys(t).forEach((s=>{const n=t[s];("function"==typeof n||Array.isArray(n))&&s.split(",").forEach((t=>i[t.trim()]=n))})),i["."]||(i["."]=k),Object.keys(i).forEach((t=>{const s=i[t];"function"==typeof s?this.add_action(t,s):Array.isArray(s)&&this.add_action(t,s[0],s[1])}))}run(t,...i){if(this.state instanceof Promise)return Promise.resolve(this.state).then((s=>{this.state=s,this.run(t,...i)}));{const s=t.toString();return this.is_global_event(s)?n.run(s,...i):this._app.run(s,...i)}}on(t,i,s){const e=t.toString();return this._actions.push({name:e,fn:i}),this.is_global_event(e)?n.on(e,i,s):this._app.on(e,i,s)}unmount(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this._actions.forEach((t=>{const{name:i,fn:s}=t;this.is_global_event(i)?n.off(i,s):this._app.off(i,s)}))}}T.t=!0;const M="//",E="///",C=t=>{if(t||(t="#"),t.startsWith("#")){const[i,...s]=t.split("/");n.run(i,...s)||n.run(E,i,...s),n.run(M,i,...s)}else if(t.startsWith("/")){const[i,s,...e]=t.split("/");n.run("/"+s,...e)||n.run(E,"/"+s,...e),n.run(M,"/"+s,...e)}else n.run(t)||n.run(E,t),n.run(M,t)};n.h=n.createElement=u,n.render=a,n.Fragment=h,n.webComponent=$,n.safeHTML=p,n.start=(t,i,s,n,e)=>{const o=Object.assign({render:!0,global_event:!0},e),r=new T(i,s,n);return e&&e.rendered&&(r.rendered=e.rendered),r.mount(t,o),r};const S=t=>{};
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
6
  */
7
- var S;n.on("$",C),n.on("debug",(t=>C)),n.on("//",C),n.on("#",C),n.route=E,n.on("route",(t=>n.route&&n.route(t))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{n.route===E&&(window.onpopstate=()=>E(location.hash),document.body.hasAttribute("apprun-no-init")&&n["no-init-route"]||E(location.hash))})),"object"==typeof window&&(window.Component=k,window._React=window.React,window.React=n,window.on=A,window.customElement=O,window.safeHTML=v);const N=globalThis.trustedTypes,L=N?N.createPolicy("lit-html",{createHTML:t=>t}):void 0,U=`lit$${(Math.random()+"").slice(9)}$`,D="?"+U,H=`<${D}>`,P=document,I=(t="")=>P.createComment(t),V=t=>null===t||"object"!=typeof t&&"function"!=typeof t,G=Array.isArray,R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,W=/-->/g,q=/>/g,z=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,F=/'/g,Z=/"/g,J=/^(?:script|style|textarea|title)$/i,K=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),B=K(1),Q=K(2),X=Symbol.for("lit-noChange"),Y=Symbol.for("lit-nothing"),tt=new WeakMap,it=(t,i,s)=>{var n,e;const o=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:i;let r=o._$litPart$;if(void 0===r){const t=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:null;o._$litPart$=r=new ht(i.insertBefore(I(),t),t,void 0,null!=s?s:{})}return r._$AI(t),r},st=P.createTreeWalker(P,129,null,!1),nt=(t,i)=>{const s=t.length-1,n=[];let e,o=2===i?"<svg>":"",r=R;for(let i=0;i<s;i++){const s=t[i];let h,c,l=-1,u=0;for(;u<s.length&&(r.lastIndex=u,c=r.exec(s),null!==c);)u=r.lastIndex,r===R?"!--"===c[1]?r=W:void 0!==c[1]?r=q:void 0!==c[2]?(J.test(c[2])&&(e=RegExp("</"+c[2],"g")),r=z):void 0!==c[3]&&(r=z):r===z?">"===c[0]?(r=null!=e?e:R,l=-1):void 0===c[1]?l=-2:(l=r.lastIndex-c[2].length,h=c[1],r=void 0===c[3]?z:'"'===c[3]?Z:F):r===Z||r===F?r=z:r===W||r===q?r=R:(r=z,e=void 0);const d=r===z&&t[i+1].startsWith("/>")?" ":"";o+=r===R?s+H:l>=0?(n.push(h),s.slice(0,l)+"$lit$"+s.slice(l)+U+d):s+U+(-2===l?(n.push(void 0),i):d)}const h=o+(t[s]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==L?L.createHTML(h):h,n]};class et{constructor({strings:t,_$litType$:i},s){let n;this.parts=[];let e=0,o=0;const r=t.length-1,h=this.parts,[c,l]=nt(t,i);if(this.el=et.createElement(c,s),st.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(n=st.nextNode())&&h.length<r;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const i of n.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(U)){const s=l[o++];if(t.push(i),void 0!==s){const t=n.getAttribute(s.toLowerCase()+"$lit$").split(U),i=/([.?@])?(.*)/.exec(s);h.push({type:1,index:e,name:i[2],strings:t,ctor:"."===i[1]?lt:"?"===i[1]?dt:"@"===i[1]?at:ct})}else h.push({type:6,index:e})}for(const i of t)n.removeAttribute(i)}if(J.test(n.tagName)){const t=n.textContent.split(U),i=t.length-1;if(i>0){n.textContent=N?N.emptyScript:"";for(let s=0;s<i;s++)n.append(t[s],I()),st.nextNode(),h.push({type:2,index:++e});n.append(t[i],I())}}}else if(8===n.nodeType)if(n.data===D)h.push({type:2,index:e});else{let t=-1;for(;-1!==(t=n.data.indexOf(U,t+1));)h.push({type:7,index:e}),t+=U.length-1}e++}}static createElement(t,i){const s=P.createElement("template");return s.innerHTML=t,s}}function ot(t,i,s=t,n){var e,o,r,h;if(i===X)return i;let c=void 0!==n?null===(e=s._$Cl)||void 0===e?void 0:e[n]:s._$Cu;const l=V(i)?void 0:i._$litDirective$;return(null==c?void 0:c.constructor)!==l&&(null===(o=null==c?void 0:c._$AO)||void 0===o||o.call(c,!1),void 0===l?c=void 0:(c=new l(t),c._$AT(t,s,n)),void 0!==n?(null!==(r=(h=s)._$Cl)&&void 0!==r?r:h._$Cl=[])[n]=c:s._$Cu=c),void 0!==c&&(i=ot(t,c._$AS(t,i.values),c,n)),i}class rt{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:n}=this._$AD,e=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:P).importNode(s,!0);st.currentNode=e;let o=st.nextNode(),r=0,h=0,c=n[0];for(;void 0!==c;){if(r===c.index){let i;2===c.type?i=new ht(o,o.nextSibling,this,t):1===c.type?i=new c.ctor(o,c.name,c.strings,this,t):6===c.type&&(i=new ft(o,this,t)),this.v.push(i),c=n[++h]}r!==(null==c?void 0:c.index)&&(o=st.nextNode(),r++)}return e}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class ht{constructor(t,i,s,n){var e;this.type=2,this._$AH=Y,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=n,this._$Cg=null===(e=null==n?void 0:n.isConnected)||void 0===e||e}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=ot(this,t,i),V(t)?t===Y||null==t||""===t?(this._$AH!==Y&&this._$AR(),this._$AH=Y):t!==this._$AH&&t!==X&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var i;return G(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.S(t):this.$(t)}A(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==Y&&V(this._$AH)?this._$AA.nextSibling.data=t:this.k(P.createTextNode(t)),this._$AH=t}T(t){var i;const{values:s,_$litType$:n}=t,e="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=et.createElement(n.h,this.options)),n);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===e)this._$AH.m(s);else{const t=new rt(e,this),i=t.p(this.options);t.m(s),this.k(i),this._$AH=t}}_$AC(t){let i=tt.get(t.strings);return void 0===i&&tt.set(t.strings,i=new et(t)),i}S(t){G(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,n=0;for(const e of t)n===i.length?i.push(s=new ht(this.A(I()),this.A(I()),this,this.options)):s=i[n],s._$AI(e),n++;n<i.length&&(this._$AR(s&&s._$AB.nextSibling,n),i.length=n)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class ct{constructor(t,i,s,n,e){this.type=1,this._$AH=Y,this._$AN=void 0,this.element=t,this.name=i,this._$AM=n,this.options=e,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=Y}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,n){const e=this.strings;let o=!1;if(void 0===e)t=ot(this,t,i,0),o=!V(t)||t!==this._$AH&&t!==X,o&&(this._$AH=t);else{const n=t;let r,h;for(t=e[0],r=0;r<e.length-1;r++)h=ot(this,n[s+r],i,r),h===X&&(h=this._$AH[r]),o||(o=!V(h)||h!==this._$AH[r]),h===Y?t=Y:t!==Y&&(t+=(null!=h?h:"")+e[r+1]),this._$AH[r]=h}o&&!n&&this.C(t)}C(t){t===Y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class lt extends ct{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===Y?void 0:t}}const ut=N?N.emptyScript:"";class dt extends ct{constructor(){super(...arguments),this.type=4}C(t){t&&t!==Y?this.element.setAttribute(this.name,ut):this.element.removeAttribute(this.name)}}class at extends ct{constructor(t,i,s,n,e){super(t,i,s,n,e),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=ot(this,t,i,0))&&void 0!==s?s:Y)===X)return;const n=this._$AH,e=t===Y&&n!==Y||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==Y&&(n===Y||e);e&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class ft{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){ot(this,t)}}const vt=window.litHtmlPolyfillSupport;null==vt||vt(et,ht),(null!==(S=globalThis.litHtmlVersions)&&void 0!==S?S:globalThis.litHtmlVersions=[]).push("2.2.1");
7
+ var N;n.on("$",S),n.on("debug",(t=>S)),n.on(M,S),n.on("#",S),n.route=C,n.on("route",(t=>n.route&&n.route(t))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{n.route===C&&(window.onpopstate=()=>C(location.hash),document.body.hasAttribute("apprun-no-init")||n["no-init-route"]||C(location.hash))})),"object"==typeof window&&(window.Component=T,window._React=window.React,window.React=n,window.on=O,window.customElement=_,window.safeHTML=p);const L=globalThis.trustedTypes,U=L?L.createPolicy("lit-html",{createHTML:t=>t}):void 0,H=`lit$${(Math.random()+"").slice(9)}$`,P="?"+H,D=`<${P}>`,I=document,V=(t="")=>I.createComment(t),G=t=>null===t||"object"!=typeof t&&"function"!=typeof t,R=Array.isArray,W=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,q=/-->/g,z=/>/g,F=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,Z=/'/g,J=/"/g,K=/^(?:script|style|textarea|title)$/i,B=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),Q=B(1),X=B(2),Y=Symbol.for("lit-noChange"),tt=Symbol.for("lit-nothing"),it=new WeakMap,st=(t,i,s)=>{var n,e;const o=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:i;let r=o._$litPart$;if(void 0===r){const t=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:null;o._$litPart$=r=new ct(i.insertBefore(V(),t),t,void 0,null!=s?s:{})}return r._$AI(t),r},nt=I.createTreeWalker(I,129,null,!1),et=(t,i)=>{const s=t.length-1,n=[];let e,o=2===i?"<svg>":"",r=W;for(let i=0;i<s;i++){const s=t[i];let h,c,l=-1,u=0;for(;u<s.length&&(r.lastIndex=u,c=r.exec(s),null!==c);)u=r.lastIndex,r===W?"!--"===c[1]?r=q:void 0!==c[1]?r=z:void 0!==c[2]?(K.test(c[2])&&(e=RegExp("</"+c[2],"g")),r=F):void 0!==c[3]&&(r=F):r===F?">"===c[0]?(r=null!=e?e:W,l=-1):void 0===c[1]?l=-2:(l=r.lastIndex-c[2].length,h=c[1],r=void 0===c[3]?F:'"'===c[3]?J:Z):r===J||r===Z?r=F:r===q||r===z?r=W:(r=F,e=void 0);const d=r===F&&t[i+1].startsWith("/>")?" ":"";o+=r===W?s+D:l>=0?(n.push(h),s.slice(0,l)+"$lit$"+s.slice(l)+H+d):s+H+(-2===l?(n.push(void 0),i):d)}const h=o+(t[s]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==U?U.createHTML(h):h,n]};class ot{constructor({strings:t,_$litType$:i},s){let n;this.parts=[];let e=0,o=0;const r=t.length-1,h=this.parts,[c,l]=et(t,i);if(this.el=ot.createElement(c,s),nt.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(n=nt.nextNode())&&h.length<r;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const i of n.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(H)){const s=l[o++];if(t.push(i),void 0!==s){const t=n.getAttribute(s.toLowerCase()+"$lit$").split(H),i=/([.?@])?(.*)/.exec(s);h.push({type:1,index:e,name:i[2],strings:t,ctor:"."===i[1]?ut:"?"===i[1]?at:"@"===i[1]?ft:lt})}else h.push({type:6,index:e})}for(const i of t)n.removeAttribute(i)}if(K.test(n.tagName)){const t=n.textContent.split(H),i=t.length-1;if(i>0){n.textContent=L?L.emptyScript:"";for(let s=0;s<i;s++)n.append(t[s],V()),nt.nextNode(),h.push({type:2,index:++e});n.append(t[i],V())}}}else if(8===n.nodeType)if(n.data===P)h.push({type:2,index:e});else{let t=-1;for(;-1!==(t=n.data.indexOf(H,t+1));)h.push({type:7,index:e}),t+=H.length-1}e++}}static createElement(t,i){const s=I.createElement("template");return s.innerHTML=t,s}}function rt(t,i,s=t,n){var e,o,r,h;if(i===Y)return i;let c=void 0!==n?null===(e=s._$Cl)||void 0===e?void 0:e[n]:s._$Cu;const l=G(i)?void 0:i._$litDirective$;return(null==c?void 0:c.constructor)!==l&&(null===(o=null==c?void 0:c._$AO)||void 0===o||o.call(c,!1),void 0===l?c=void 0:(c=new l(t),c._$AT(t,s,n)),void 0!==n?(null!==(r=(h=s)._$Cl)&&void 0!==r?r:h._$Cl=[])[n]=c:s._$Cu=c),void 0!==c&&(i=rt(t,c._$AS(t,i.values),c,n)),i}class ht{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:s},parts:n}=this._$AD,e=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:I).importNode(s,!0);nt.currentNode=e;let o=nt.nextNode(),r=0,h=0,c=n[0];for(;void 0!==c;){if(r===c.index){let i;2===c.type?i=new ct(o,o.nextSibling,this,t):1===c.type?i=new c.ctor(o,c.name,c.strings,this,t):6===c.type&&(i=new vt(o,this,t)),this.v.push(i),c=n[++h]}r!==(null==c?void 0:c.index)&&(o=nt.nextNode(),r++)}return e}m(t){let i=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class ct{constructor(t,i,s,n){var e;this.type=2,this._$AH=tt,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=n,this._$Cg=null===(e=null==n?void 0:n.isConnected)||void 0===e||e}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=rt(this,t,i),G(t)?t===tt||null==t||""===t?(this._$AH!==tt&&this._$AR(),this._$AH=tt):t!==this._$AH&&t!==Y&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var i;return R(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.S(t):this.$(t)}A(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==tt&&G(this._$AH)?this._$AA.nextSibling.data=t:this.k(I.createTextNode(t)),this._$AH=t}T(t){var i;const{values:s,_$litType$:n}=t,e="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=ot.createElement(n.h,this.options)),n);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===e)this._$AH.m(s);else{const t=new ht(e,this),i=t.p(this.options);t.m(s),this.k(i),this._$AH=t}}_$AC(t){let i=it.get(t.strings);return void 0===i&&it.set(t.strings,i=new ot(t)),i}S(t){R(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,n=0;for(const e of t)n===i.length?i.push(s=new ct(this.A(V()),this.A(V()),this,this.options)):s=i[n],s._$AI(e),n++;n<i.length&&(this._$AR(s&&s._$AB.nextSibling,n),i.length=n)}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class lt{constructor(t,i,s,n,e){this.type=1,this._$AH=tt,this._$AN=void 0,this.element=t,this.name=i,this._$AM=n,this.options=e,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=tt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,n){const e=this.strings;let o=!1;if(void 0===e)t=rt(this,t,i,0),o=!G(t)||t!==this._$AH&&t!==Y,o&&(this._$AH=t);else{const n=t;let r,h;for(t=e[0],r=0;r<e.length-1;r++)h=rt(this,n[s+r],i,r),h===Y&&(h=this._$AH[r]),o||(o=!G(h)||h!==this._$AH[r]),h===tt?t=tt:t!==tt&&(t+=(null!=h?h:"")+e[r+1]),this._$AH[r]=h}o&&!n&&this.C(t)}C(t){t===tt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class ut extends lt{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===tt?void 0:t}}const dt=L?L.emptyScript:"";class at extends lt{constructor(){super(...arguments),this.type=4}C(t){t&&t!==tt?this.element.setAttribute(this.name,dt):this.element.removeAttribute(this.name)}}class ft extends lt{constructor(t,i,s,n,e){super(t,i,s,n,e),this.type=5}_$AI(t,i=this){var s;if((t=null!==(s=rt(this,t,i,0))&&void 0!==s?s:tt)===Y)return;const n=this._$AH,e=t===tt&&n!==tt||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==tt&&(n===tt||e);e&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class vt{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){rt(this,t)}}const pt=window.litHtmlPolyfillSupport;null==pt||pt(ot,ct),(null!==(N=globalThis.litHtmlVersions)&&void 0!==N?N:globalThis.litHtmlVersions=[]).push("2.2.1");
8
8
  /**
9
9
  * @license
10
10
  * Copyright 2017 Google LLC
11
11
  * SPDX-License-Identifier: BSD-3-Clause
12
12
  */
13
- const pt=2,yt=5,bt=t=>(...i)=>({_$litDirective$:t,values:i});class gt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}
13
+ const yt=2,bt=5,gt=t=>(...i)=>({_$litDirective$:t,values:i});class wt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}
14
14
  /**
15
15
  * @license
16
16
  * Copyright 2017 Google LLC
17
17
  * SPDX-License-Identifier: BSD-3-Clause
18
- */class wt extends gt{constructor(t){if(super(t),this.it=Y,t.type!==pt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===Y||null==t)return this.ft=void 0,this.it=t;if(t===X)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.ft;this.it=t;const i=[t];return i.raw=i,this.ft={_$litType$:this.constructor.resultType,strings:i,values:[]}}}wt.directiveName="unsafeHTML",wt.resultType=1;const mt=bt(wt);function $t(t,i,s){i&&("string"==typeof i?(t._$litPart$||t.replaceChildren(),it(B`${mt(i)}`,t)):"_$litType$"in i?(t._$litPart$||t.replaceChildren(),it(i,t)):(d(t,i,s),t._$litPart$=void 0))}const jt=bt(class extends gt{constructor(t){if(super(t),t.type!==yt)throw new Error("${run} can only be used in event handlers")}update(t,i){let{element:s,name:e}=t;const o=()=>{let t=s._component;for(;!t&&s;)s=s.parentElement,t=s&&s._component;return console.assert(!!t,"Component not found."),t},[r,...h]=i;return"string"==typeof r?s[`on${e}`]=t=>{const i=o();i?i.run(r,...h,t):n.run(r,...h,t)}:"function"==typeof r&&(s[`on${e}`]=t=>o().setState(r(o().state,...h,t))),this.render()}render(){return X}});n.createElement=l,n.render=$t,n.Fragment=h,"object"==typeof window&&(window.React=window._React||n,window.html=B,window.svg=Q,window.run=jt);export{k as Component,M as ROUTER_404_EVENT,T as ROUTER_EVENT,n as app,O as customElement,n as default,j as event,B as html,A as on,$t as render,jt as run,v as safeHTML,Q as svg,j as update};
18
+ */class mt extends wt{constructor(t){if(super(t),this.it=tt,t.type!==yt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===tt||null==t)return this.ft=void 0,this.it=t;if(t===Y)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.ft;this.it=t;const i=[t];return i.raw=i,this.ft={_$litType$:this.constructor.resultType,strings:i,values:[]}}}mt.directiveName="unsafeHTML",mt.resultType=1;const $t=gt(mt);function jt(t,i,s){i&&("string"==typeof i?(t._$litPart$||t.replaceChildren(),st(Q`${$t(i)}`,t)):"_$litType$"in i?(t._$litPart$||t.replaceChildren(),st(i,t)):(a(t,i,s),t._$litPart$=void 0))}const At=gt(class extends wt{constructor(t){if(super(t),t.type!==bt)throw new Error("${run} can only be used in event handlers")}update(t,i){let{element:s,name:e}=t;const o=()=>{let t=s._component;for(;!t&&s;)s=s.parentElement,t=s&&s._component;return console.assert(!!t,"Component not found."),t},[r,...h]=i;return"string"==typeof r?s[`on${e}`]=t=>{const i=o();i?i.run(r,...h,t):n.run(r,...h,t)}:"function"==typeof r&&(s[`on${e}`]=t=>o().setState(r(o().state,...h,t))),this.render()}render(){return Y}});n.createElement=u,n.render=jt,n.Fragment=h,"object"==typeof window&&(window.React=window._React||n,window.html=Q,window.svg=X,window.run=At);export{T as Component,E as ROUTER_404_EVENT,M as ROUTER_EVENT,n as app,_ as customElement,n as default,A as event,Q as html,O as on,jt as render,At as run,p as safeHTML,X as svg,A as update};
19
19
  //# sourceMappingURL=apprun-html.esm.js.map