mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
1 line
80 KiB
JSON
1 line
80 KiB
JSON
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { r as registerInstance, e as createEvent, i as getElement, h, H as Host } from './index-7a8b7a1c.js';\nimport { c as componentOnReady, o as debounce } from './helpers-1457892a.js';\nimport { b as getIonMode } from './ionic-global-63a97a32.js';\nimport { o as openURL, c as createColorClasses } from './theme-ff3fc52f.js';\nconst Route = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteDataChanged = createEvent(this, \"ionRouteDataChanged\", 7);\n /**\n * Relative path that needs to match in order for this route to apply.\n *\n * Accepts paths similar to expressjs so that you can define parameters\n * in the url /foo/:bar where bar would be available in incoming props.\n */\n this.url = '';\n }\n onUpdate(newValue) {\n this.ionRouteDataChanged.emit(newValue);\n }\n onComponentProps(newValue, oldValue) {\n if (newValue === oldValue) {\n return;\n }\n const keys1 = newValue ? Object.keys(newValue) : [];\n const keys2 = oldValue ? Object.keys(oldValue) : [];\n if (keys1.length !== keys2.length) {\n this.onUpdate(newValue);\n return;\n }\n for (const key of keys1) {\n if (newValue[key] !== oldValue[key]) {\n this.onUpdate(newValue);\n return;\n }\n }\n }\n connectedCallback() {\n this.ionRouteDataChanged.emit();\n }\n static get watchers() {\n return {\n \"url\": [\"onUpdate\"],\n \"component\": [\"onUpdate\"],\n \"componentProps\": [\"onComponentProps\"]\n };\n }\n};\nconst RouteRedirect = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteRedirectChanged = createEvent(this, \"ionRouteRedirectChanged\", 7);\n }\n propDidChange() {\n this.ionRouteRedirectChanged.emit();\n }\n connectedCallback() {\n this.ionRouteRedirectChanged.emit();\n }\n static get watchers() {\n return {\n \"from\": [\"propDidChange\"],\n \"to\": [\"propDidChange\"]\n };\n }\n};\nconst ROUTER_INTENT_NONE = 'root';\nconst ROUTER_INTENT_FORWARD = 'forward';\nconst ROUTER_INTENT_BACK = 'back';\n\n// Join the non empty segments with \"/\".\nconst generatePath = segments => {\n const path = segments.filter(s => s.length > 0).join('/');\n return '/' + path;\n};\nconst generateUrl = (segments, useHash, queryString) => {\n let url = generatePath(segments);\n if (useHash) {\n url = '#' + url;\n }\n if (queryString !== undefined) {\n url += '?' + queryString;\n }\n return url;\n};\nconst writePath = (history, root, useHash, path, direction, state, queryString) => {\n const url = generateUrl([...parsePath(root).segments, ...path], useHash, queryString);\n if (direction === ROUTER_INTENT_FORWARD) {\n history.pushState(state, '', url);\n } else {\n history.replaceState(state, '', url);\n }\n};\nconst chainToPath = chain => {\n const path = [];\n for (const route of chain) {\n for (const segment of route.path) {\n if (segment[0] === ':') {\n const param = route.params && route.params[segment.slice(1)];\n if (!param) {\n return null;\n }\n path.push(param);\n } else if (segment !== '') {\n path.push(segment);\n }\n }\n }\n return path;\n};\n// Remove the prefix segments from the path segments.\n//\n// Return:\n// - null when the path segments do not start with the passed prefix,\n// - the path segments after the prefix otherwise.\nconst removePrefix = (prefix, path) => {\n if (prefix.length > path.length) {\n return null;\n }\n if (prefix.length <= 1 && prefix[0] === '') {\n return path;\n }\n for (let i = 0; i < prefix.length; i++) {\n if (prefix[i] !== path[i]) {\n return null;\n }\n }\n if (path.length === prefix.length) {\n return [''];\n }\n return path.slice(prefix.length);\n};\nconst readPath = (loc, root, useHash) => {\n const prefix = parsePath(root).segments;\n const pathname = useHash ? loc.hash.slice(1) : loc.pathname;\n const path = parsePath(pathname).segments;\n return removePrefix(prefix, path);\n};\n// Parses the path to:\n// - segments an array of '/' separated parts,\n// - queryString (undefined when no query string).\nconst parsePath = path => {\n let segments = [''];\n let queryString;\n if (path != null) {\n const qsStart = path.indexOf('?');\n if (qsStart > -1) {\n queryString = path.substr(qsStart + 1);\n path = path.substr(0, qsStart);\n }\n segments = path.split('/').map(s => s.trim()).filter(s => s.length > 0);\n if (segments.length === 0) {\n segments = [''];\n }\n }\n return {\n segments,\n queryString\n };\n};\nconst printRoutes = routes => {\n console.group(`[ion-core] ROUTES[${routes.length}]`);\n for (const chain of routes) {\n const path = [];\n chain.forEach(r => path.push(...r.path));\n const ids = chain.map(r => r.id);\n console.debug(`%c ${generatePath(path)}`, 'font-weight: bold; padding-left: 20px', '=>\\t', `(${ids.join(', ')})`);\n }\n console.groupEnd();\n};\nconst printRedirects = redirects => {\n console.group(`[ion-core] REDIRECTS[${redirects.length}]`);\n for (const redirect of redirects) {\n if (redirect.to) {\n console.debug('FROM: ', `$c ${generatePath(redirect.from)}`, 'font-weight: bold', ' TO: ', `$c ${generatePath(redirect.to.segments)}`, 'font-weight: bold');\n }\n }\n console.groupEnd();\n};\nconst writeNavState = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (root, chain, direction, index, changed = false, animation) {\n try {\n // find next navigation outlet in the DOM\n const outlet = searchNavNode(root);\n // make sure we can continue interacting the DOM, otherwise abort\n if (index >= chain.length || !outlet) {\n return changed;\n }\n yield new Promise(resolve => componentOnReady(outlet, resolve));\n const route = chain[index];\n const result = yield outlet.setRouteId(route.id, route.params, direction, animation);\n // if the outlet changed the page, reset navigation to neutral (no direction)\n // this means nested outlets will not animate\n if (result.changed) {\n direction = ROUTER_INTENT_NONE;\n changed = true;\n }\n // recursively set nested outlets\n changed = yield writeNavState(result.element, chain, direction, index + 1, changed, animation);\n // once all nested outlets are visible let's make the parent visible too,\n // using markVisible prevents flickering\n if (result.markVisible) {\n yield result.markVisible();\n }\n return changed;\n } catch (e) {\n console.error(e);\n return false;\n }\n });\n return function writeNavState(_x, _x2, _x3, _x4) {\n return _ref.apply(this, arguments);\n };\n}();\nconst readNavState = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator(function* (root) {\n const ids = [];\n let outlet;\n let node = root;\n // tslint:disable-next-line:no-constant-condition\n while (true) {\n outlet = searchNavNode(node);\n if (outlet) {\n const id = yield outlet.getRouteId();\n if (id) {\n node = id.element;\n id.element = undefined;\n ids.push(id);\n } else {\n break;\n }\n } else {\n break;\n }\n }\n return {\n ids,\n outlet\n };\n });\n return function readNavState(_x5) {\n return _ref2.apply(this, arguments);\n };\n}();\nconst waitUntilNavNode = () => {\n if (searchNavNode(document.body)) {\n return Promise.resolve();\n }\n return new Promise(resolve => {\n window.addEventListener('ionNavWillLoad', resolve, {\n once: true\n });\n });\n};\nconst QUERY = ':not([no-router]) ion-nav, :not([no-router]) ion-tabs, :not([no-router]) ion-router-outlet';\nconst searchNavNode = root => {\n if (!root) {\n return undefined;\n }\n if (root.matches(QUERY)) {\n return root;\n }\n const outlet = root.querySelector(QUERY);\n return outlet !== null && outlet !== void 0 ? outlet : undefined;\n};\n\n// Returns whether the given redirect matches the given path segments.\n//\n// A redirect matches when the segments of the path and redirect.from are equal.\n// Note that segments are only checked until redirect.from contains a '*' which matches any path segment.\n// The path ['some', 'path', 'to', 'page'] matches both ['some', 'path', 'to', 'page'] and ['some', 'path', '*'].\nconst matchesRedirect = (path, redirect) => {\n const {\n from,\n to\n } = redirect;\n if (to === undefined) {\n return false;\n }\n if (from.length > path.length) {\n return false;\n }\n for (let i = 0; i < from.length; i++) {\n const expected = from[i];\n if (expected === '*') {\n return true;\n }\n if (expected !== path[i]) {\n return false;\n }\n }\n return from.length === path.length;\n};\n// Returns the first redirect matching the path segments or undefined when no match found.\nconst findRouteRedirect = (path, redirects) => {\n return redirects.find(redirect => matchesRedirect(path, redirect));\n};\nconst matchesIDs = (ids, chain) => {\n const len = Math.min(ids.length, chain.length);\n let score = 0;\n for (let i = 0; i < len; i++) {\n const routeId = ids[i];\n const routeChain = chain[i];\n // Skip results where the route id does not match the chain at the same index\n if (routeId.id.toLowerCase() !== routeChain.id) {\n break;\n }\n if (routeId.params) {\n const routeIdParams = Object.keys(routeId.params);\n /**\n * Only compare routes with the chain that have the same number of parameters.\n */\n if (routeIdParams.length === routeChain.path.length) {\n /**\n * Maps the route's params into a path based on the path variable names,\n * to compare against the route chain format.\n *\n * Before:\n * ```ts\n * {\n * params: {\n * s1: 'a',\n * s2: 'b'\n * }\n * }\n * ```\n *\n * After:\n * ```ts\n * [':s1',':s2']\n * ```\n */\n const pathWithParams = routeIdParams.map(key => `:${key}`);\n for (let j = 0; j < pathWithParams.length; j++) {\n // Skip results where the path variable is not a match\n if (pathWithParams[j].toLowerCase() !== routeChain.path[j]) {\n break;\n }\n // Weight path matches for the same index higher.\n score++;\n }\n }\n }\n // Weight id matches\n score++;\n }\n return score;\n};\nconst matchesPath = (inputPath, chain) => {\n const segments = new RouterSegments(inputPath);\n let matchesDefault = false;\n let allparams;\n for (let i = 0; i < chain.length; i++) {\n const path = chain[i].path;\n if (path[0] === '') {\n matchesDefault = true;\n } else {\n for (const segment of path) {\n const data = segments.next();\n // data param\n if (segment[0] === ':') {\n if (data === '') {\n return null;\n }\n allparams = allparams || [];\n const params = allparams[i] || (allparams[i] = {});\n params[segment.slice(1)] = data;\n } else if (data !== segment) {\n return null;\n }\n }\n matchesDefault = false;\n }\n }\n const matches = matchesDefault ? matchesDefault === (segments.next() === '') : true;\n if (!matches) {\n return null;\n }\n if (allparams) {\n return chain.map((route, i) => ({\n id: route.id,\n path: route.path,\n params: mergeParams(route.params, allparams[i]),\n beforeEnter: route.beforeEnter,\n beforeLeave: route.beforeLeave\n }));\n }\n return chain;\n};\n// Merges the route parameter objects.\n// Returns undefined when both parameters are undefined.\nconst mergeParams = (a, b) => {\n return a || b ? Object.assign(Object.assign({}, a), b) : undefined;\n};\nconst routerIDsToChain = (ids, chains) => {\n let match = null;\n let maxMatches = 0;\n for (const chain of chains) {\n const score = matchesIDs(ids, chain);\n if (score > maxMatches) {\n match = chain;\n maxMatches = score;\n }\n }\n if (match) {\n return match.map((route, i) => ({\n id: route.id,\n path: route.path,\n params: mergeParams(route.params, ids[i] && ids[i].params)\n }));\n }\n return null;\n};\nconst routerPathToChain = (path, chains) => {\n let match = null;\n let matches = 0;\n for (const chain of chains) {\n const matchedChain = matchesPath(path, chain);\n if (matchedChain !== null) {\n const score = computePriority(matchedChain);\n if (score > matches) {\n matches = score;\n match = matchedChain;\n }\n }\n }\n return match;\n};\nconst computePriority = chain => {\n let score = 1;\n let level = 1;\n for (const route of chain) {\n for (const path of route.path) {\n if (path[0] === ':') {\n score += Math.pow(1, level);\n } else if (path !== '') {\n score += Math.pow(2, level);\n }\n level++;\n }\n }\n return score;\n};\nclass RouterSegments {\n constructor(path) {\n this.path = path.slice();\n }\n next() {\n if (this.path.length > 0) {\n return this.path.shift();\n }\n return '';\n }\n}\nconst readProp = (el, prop) => {\n if (prop in el) {\n return el[prop];\n }\n if (el.hasAttribute(prop)) {\n return el.getAttribute(prop);\n }\n return null;\n};\nconst readRedirects = root => {\n return Array.from(root.children).filter(el => el.tagName === 'ION-ROUTE-REDIRECT').map(el => {\n const to = readProp(el, 'to');\n return {\n from: parsePath(readProp(el, 'from')).segments,\n to: to == null ? undefined : parsePath(to)\n };\n });\n};\nconst readRoutes = root => {\n return flattenRouterTree(readRouteNodes(root));\n};\nconst readRouteNodes = node => {\n return Array.from(node.children).filter(el => el.tagName === 'ION-ROUTE' && el.component).map(el => {\n const component = readProp(el, 'component');\n return {\n path: parsePath(readProp(el, 'url')).segments,\n id: component.toLowerCase(),\n params: el.componentProps,\n beforeLeave: el.beforeLeave,\n beforeEnter: el.beforeEnter,\n children: readRouteNodes(el)\n };\n });\n};\nconst flattenRouterTree = nodes => {\n const chains = [];\n for (const node of nodes) {\n flattenNode([], chains, node);\n }\n return chains;\n};\nconst flattenNode = (chain, chains, node) => {\n chain = chain.slice();\n chain.push({\n id: node.id,\n path: node.path,\n params: node.params,\n beforeLeave: node.beforeLeave,\n beforeEnter: node.beforeEnter\n });\n if (node.children.length === 0) {\n chains.push(chain);\n return;\n }\n for (const child of node.children) {\n flattenNode(chain, chains, child);\n }\n};\nconst Router = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteWillChange = createEvent(this, \"ionRouteWillChange\", 7);\n this.ionRouteDidChange = createEvent(this, \"ionRouteDidChange\", 7);\n this.previousPath = null;\n this.busy = false;\n this.state = 0;\n this.lastState = 0;\n /**\n * The root path to use when matching URLs. By default, this is set to \"/\", but you can specify\n * an alternate prefix for all URL paths.\n */\n this.root = '/';\n /**\n * The router can work in two \"modes\":\n * - With hash: `/index.html#/path/to/page`\n * - Without hash: `/path/to/page`\n *\n * Using one or another might depend in the requirements of your app and/or where it's deployed.\n *\n * Usually \"hash-less\" navigation works better for SEO and it's more user friendly too, but it might\n * requires additional server-side configuration in order to properly work.\n *\n * On the other side hash-navigation is much easier to deploy, it even works over the file protocol.\n *\n * By default, this property is `true`, change to `false` to allow hash-less URLs.\n */\n this.useHash = true;\n }\n componentWillLoad() {\n var _this = this;\n return _asyncToGenerator(function* () {\n yield waitUntilNavNode();\n const canProceed = yield _this.runGuards(_this.getPath());\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n const {\n redirect\n } = canProceed;\n const path = parsePath(redirect);\n _this.setPath(path.segments, ROUTER_INTENT_NONE, path.queryString);\n yield _this.writeNavStateRoot(path.segments, ROUTER_INTENT_NONE);\n }\n } else {\n yield _this.onRoutesChanged();\n }\n })();\n }\n componentDidLoad() {\n window.addEventListener('ionRouteRedirectChanged', debounce(this.onRedirectChanged.bind(this), 10));\n window.addEventListener('ionRouteDataChanged', debounce(this.onRoutesChanged.bind(this), 100));\n }\n onPopState() {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n const direction = _this2.historyDirection();\n let segments = _this2.getPath();\n const canProceed = yield _this2.runGuards(segments);\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n segments = parsePath(canProceed.redirect).segments;\n } else {\n return false;\n }\n }\n return _this2.writeNavStateRoot(segments, direction);\n })();\n }\n onBackButton(ev) {\n ev.detail.register(0, processNextHandler => {\n this.back();\n processNextHandler();\n });\n }\n /** @internal */\n canTransition() {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n const canProceed = yield _this3.runGuards();\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n return canProceed.redirect;\n } else {\n return false;\n }\n }\n return true;\n })();\n }\n /**\n * Navigate to the specified URL.\n *\n * @param url The url to navigate to.\n * @param direction The direction of the animation. Defaults to `\"forward\"`.\n */\n push(url, direction = 'forward', animation) {\n var _this4 = this;\n return _asyncToGenerator(function* () {\n if (url.startsWith('.')) {\n url = new URL(url, window.location.href).pathname;\n }\n let parsedPath = parsePath(url);\n const canProceed = yield _this4.runGuards(parsedPath.segments);\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n parsedPath = parsePath(canProceed.redirect);\n } else {\n return false;\n }\n }\n _this4.setPath(parsedPath.segments, direction, parsedPath.queryString);\n return _this4.writeNavStateRoot(parsedPath.segments, direction, animation);\n })();\n }\n /**\n * Go back to previous page in the window.history.\n */\n back() {\n window.history.back();\n return Promise.resolve(this.waitPromise);\n }\n /** @internal */\n printDebug() {\n var _this5 = this;\n return _asyncToGenerator(function* () {\n printRoutes(readRoutes(_this5.el));\n printRedirects(readRedirects(_this5.el));\n })();\n }\n /** @internal */\n navChanged(direction) {\n var _this6 = this;\n return _asyncToGenerator(function* () {\n if (_this6.busy) {\n console.warn('[ion-router] router is busy, navChanged was cancelled');\n return false;\n }\n const {\n ids,\n outlet\n } = yield readNavState(window.document.body);\n const routes = readRoutes(_this6.el);\n const chain = routerIDsToChain(ids, routes);\n if (!chain) {\n console.warn('[ion-router] no matching URL for ', ids.map(i => i.id));\n return false;\n }\n const path = chainToPath(chain);\n if (!path) {\n console.warn('[ion-router] router could not match path because some required param is missing');\n return false;\n }\n _this6.setPath(path, direction);\n yield _this6.safeWriteNavState(outlet, chain, ROUTER_INTENT_NONE, path, null, ids.length);\n return true;\n })();\n }\n // This handler gets called when a `ion-route-redirect` component is added to the DOM or if the from or to property of such node changes.\n onRedirectChanged() {\n const path = this.getPath();\n if (path && findRouteRedirect(path, readRedirects(this.el))) {\n this.writeNavStateRoot(path, ROUTER_INTENT_NONE);\n }\n }\n // This handler gets called when a `ion-route` component is added to the DOM or if the from or to property of such node changes.\n onRoutesChanged() {\n return this.writeNavStateRoot(this.getPath(), ROUTER_INTENT_NONE);\n }\n historyDirection() {\n var _a;\n const win = window;\n if (win.history.state === null) {\n this.state++;\n win.history.replaceState(this.state, win.document.title, (_a = win.document.location) === null || _a === void 0 ? void 0 : _a.href);\n }\n const state = win.history.state;\n const lastState = this.lastState;\n this.lastState = state;\n if (state > lastState || state >= lastState && lastState > 0) {\n return ROUTER_INTENT_FORWARD;\n }\n if (state < lastState) {\n return ROUTER_INTENT_BACK;\n }\n return ROUTER_INTENT_NONE;\n }\n writeNavStateRoot(path, direction, animation) {\n var _this7 = this;\n return _asyncToGenerator(function* () {\n if (!path) {\n console.error('[ion-router] URL is not part of the routing set');\n return false;\n }\n // lookup redirect rule\n const redirects = readRedirects(_this7.el);\n const redirect = findRouteRedirect(path, redirects);\n let redirectFrom = null;\n if (redirect) {\n const {\n segments,\n queryString\n } = redirect.to;\n _this7.setPath(segments, direction, queryString);\n redirectFrom = redirect.from;\n path = segments;\n }\n // lookup route chain\n const routes = readRoutes(_this7.el);\n const chain = routerPathToChain(path, routes);\n if (!chain) {\n console.error('[ion-router] the path does not match any route');\n return false;\n }\n // write DOM give\n return _this7.safeWriteNavState(document.body, chain, direction, path, redirectFrom, 0, animation);\n })();\n }\n safeWriteNavState(node, chain, direction, path, redirectFrom, index = 0, animation) {\n var _this8 = this;\n return _asyncToGenerator(function* () {\n const unlock = yield _this8.lock();\n let changed = false;\n try {\n changed = yield _this8.writeNavState(node, chain, direction, path, redirectFrom, index, animation);\n } catch (e) {\n console.error(e);\n }\n unlock();\n return changed;\n })();\n }\n lock() {\n var _this9 = this;\n return _asyncToGenerator(function* () {\n const p = _this9.waitPromise;\n let resolve;\n _this9.waitPromise = new Promise(r => resolve = r);\n if (p !== undefined) {\n yield p;\n }\n return resolve;\n })();\n }\n // Executes the beforeLeave hook of the source route and the beforeEnter hook of the target route if they exist.\n //\n // When the beforeLeave hook does not return true (to allow navigating) then that value is returned early and the beforeEnter is executed.\n // Otherwise the beforeEnterHook hook of the target route is executed.\n runGuards(to = this.getPath(), from) {\n var _this10 = this;\n return _asyncToGenerator(function* () {\n if (from === undefined) {\n from = parsePath(_this10.previousPath).segments;\n }\n if (!to || !from) {\n return true;\n }\n const routes = readRoutes(_this10.el);\n const fromChain = routerPathToChain(from, routes);\n const beforeLeaveHook = fromChain && fromChain[fromChain.length - 1].beforeLeave;\n const canLeave = beforeLeaveHook ? yield beforeLeaveHook() : true;\n if (canLeave === false || typeof canLeave === 'object') {\n return canLeave;\n }\n const toChain = routerPathToChain(to, routes);\n const beforeEnterHook = toChain && toChain[toChain.length - 1].beforeEnter;\n return beforeEnterHook ? beforeEnterHook() : true;\n })();\n }\n writeNavState(node, chain, direction, path, redirectFrom, index = 0, animation) {\n var _this11 = this;\n return _asyncToGenerator(function* () {\n if (_this11.busy) {\n console.warn('[ion-router] router is busy, transition was cancelled');\n return false;\n }\n _this11.busy = true;\n // generate route event and emit will change\n const routeEvent = _this11.routeChangeEvent(path, redirectFrom);\n if (routeEvent) {\n _this11.ionRouteWillChange.emit(routeEvent);\n }\n const changed = yield writeNavState(node, chain, direction, index, false, animation);\n _this11.busy = false;\n // emit did change\n if (routeEvent) {\n _this11.ionRouteDidChange.emit(routeEvent);\n }\n return changed;\n })();\n }\n setPath(path, direction, queryString) {\n this.state++;\n writePath(window.history, this.root, this.useHash, path, direction, this.state, queryString);\n }\n getPath() {\n return readPath(window.location, this.root, this.useHash);\n }\n routeChangeEvent(path, redirectFromPath) {\n const from = this.previousPath;\n const to = generatePath(path);\n this.previousPath = to;\n if (to === from) {\n return null;\n }\n const redirectedFrom = redirectFromPath ? generatePath(redirectFromPath) : null;\n return {\n from,\n redirectedFrom,\n to\n };\n }\n get el() {\n return getElement(this);\n }\n};\nconst routerLinkCss = \":host{--background:transparent;--color:var(--ion-color-primary, #3880ff);background:var(--background);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}a{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit}\";\nconst RouterLink = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n /**\n * When using a router, it specifies the transition direction when navigating to\n * another page using `href`.\n */\n this.routerDirection = 'forward';\n this.onClick = ev => {\n openURL(this.href, ev, this.routerDirection, this.routerAnimation);\n };\n }\n render() {\n const mode = getIonMode(this);\n const attrs = {\n href: this.href,\n rel: this.rel,\n target: this.target\n };\n return h(Host, {\n onClick: this.onClick,\n class: createColorClasses(this.color, {\n [mode]: true,\n 'ion-activatable': true\n })\n }, h(\"a\", Object.assign({}, attrs), h(\"slot\", null)));\n }\n};\nRouterLink.style = routerLinkCss;\nexport { Route as ion_route, RouteRedirect as ion_route_redirect, Router as ion_router, RouterLink as ion_router_link };","map":{"version":3,"names":["r","registerInstance","e","createEvent","i","getElement","h","H","Host","c","componentOnReady","o","debounce","b","getIonMode","openURL","createColorClasses","Route","constructor","hostRef","ionRouteDataChanged","url","onUpdate","newValue","emit","onComponentProps","oldValue","keys1","Object","keys","keys2","length","key","connectedCallback","watchers","RouteRedirect","ionRouteRedirectChanged","propDidChange","ROUTER_INTENT_NONE","ROUTER_INTENT_FORWARD","ROUTER_INTENT_BACK","generatePath","segments","path","filter","s","join","generateUrl","useHash","queryString","undefined","writePath","history","root","direction","state","parsePath","pushState","replaceState","chainToPath","chain","route","segment","param","params","slice","push","removePrefix","prefix","readPath","loc","pathname","hash","qsStart","indexOf","substr","split","map","trim","printRoutes","routes","console","group","forEach","ids","id","debug","groupEnd","printRedirects","redirects","redirect","to","from","writeNavState","_ref","_asyncToGenerator","index","changed","animation","outlet","searchNavNode","Promise","resolve","result","setRouteId","element","markVisible","error","_x","_x2","_x3","_x4","apply","arguments","readNavState","_ref2","node","getRouteId","_x5","waitUntilNavNode","document","body","window","addEventListener","once","QUERY","matches","querySelector","matchesRedirect","expected","findRouteRedirect","find","matchesIDs","len","Math","min","score","routeId","routeChain","toLowerCase","routeIdParams","pathWithParams","j","matchesPath","inputPath","RouterSegments","matchesDefault","allparams","data","next","mergeParams","beforeEnter","beforeLeave","a","assign","routerIDsToChain","chains","match","maxMatches","routerPathToChain","matchedChain","computePriority","level","pow","shift","readProp","el","prop","hasAttribute","getAttribute","readRedirects","Array","children","tagName","readRoutes","flattenRouterTree","readRouteNodes","component","componentProps","nodes","flattenNode","child","Router","ionRouteWillChange","ionRouteDidChange","previousPath","busy","lastState","componentWillLoad","_this","canProceed","runGuards","getPath","setPath","writeNavStateRoot","onRoutesChanged","componentDidLoad","onRedirectChanged","bind","onPopState","_this2","historyDirection","onBackButton","ev","detail","register","processNextHandler","back","canTransition","_this3","_this4","startsWith","URL","location","href","parsedPath","waitPromise","printDebug","_this5","navChanged","_this6","warn","safeWriteNavState","_a","win","title","_this7","redirectFrom","_this8","unlock","lock","_this9","p","_this10","fromChain","beforeLeaveHook","canLeave","toChain","beforeEnterHook","_this11","routeEvent","routeChangeEvent","redirectFromPath","redirectedFrom","routerLinkCss","RouterLink","routerDirection","onClick","routerAnimation","render","mode","attrs","rel","target","class","color","style","ion_route","ion_route_redirect","ion_router","ion_router_link"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@ionic/core/dist/esm/ion-route_4.entry.js"],"sourcesContent":["import { r as registerInstance, e as createEvent, i as getElement, h, H as Host } from './index-7a8b7a1c.js';\nimport { c as componentOnReady, o as debounce } from './helpers-1457892a.js';\nimport { b as getIonMode } from './ionic-global-63a97a32.js';\nimport { o as openURL, c as createColorClasses } from './theme-ff3fc52f.js';\n\nconst Route = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteDataChanged = createEvent(this, \"ionRouteDataChanged\", 7);\n /**\n * Relative path that needs to match in order for this route to apply.\n *\n * Accepts paths similar to expressjs so that you can define parameters\n * in the url /foo/:bar where bar would be available in incoming props.\n */\n this.url = '';\n }\n onUpdate(newValue) {\n this.ionRouteDataChanged.emit(newValue);\n }\n onComponentProps(newValue, oldValue) {\n if (newValue === oldValue) {\n return;\n }\n const keys1 = newValue ? Object.keys(newValue) : [];\n const keys2 = oldValue ? Object.keys(oldValue) : [];\n if (keys1.length !== keys2.length) {\n this.onUpdate(newValue);\n return;\n }\n for (const key of keys1) {\n if (newValue[key] !== oldValue[key]) {\n this.onUpdate(newValue);\n return;\n }\n }\n }\n connectedCallback() {\n this.ionRouteDataChanged.emit();\n }\n static get watchers() { return {\n \"url\": [\"onUpdate\"],\n \"component\": [\"onUpdate\"],\n \"componentProps\": [\"onComponentProps\"]\n }; }\n};\n\nconst RouteRedirect = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteRedirectChanged = createEvent(this, \"ionRouteRedirectChanged\", 7);\n }\n propDidChange() {\n this.ionRouteRedirectChanged.emit();\n }\n connectedCallback() {\n this.ionRouteRedirectChanged.emit();\n }\n static get watchers() { return {\n \"from\": [\"propDidChange\"],\n \"to\": [\"propDidChange\"]\n }; }\n};\n\nconst ROUTER_INTENT_NONE = 'root';\nconst ROUTER_INTENT_FORWARD = 'forward';\nconst ROUTER_INTENT_BACK = 'back';\n\n// Join the non empty segments with \"/\".\nconst generatePath = (segments) => {\n const path = segments\n .filter(s => s.length > 0)\n .join('/');\n return '/' + path;\n};\nconst generateUrl = (segments, useHash, queryString) => {\n let url = generatePath(segments);\n if (useHash) {\n url = '#' + url;\n }\n if (queryString !== undefined) {\n url += '?' + queryString;\n }\n return url;\n};\nconst writePath = (history, root, useHash, path, direction, state, queryString) => {\n const url = generateUrl([...parsePath(root).segments, ...path], useHash, queryString);\n if (direction === ROUTER_INTENT_FORWARD) {\n history.pushState(state, '', url);\n }\n else {\n history.replaceState(state, '', url);\n }\n};\nconst chainToPath = (chain) => {\n const path = [];\n for (const route of chain) {\n for (const segment of route.path) {\n if (segment[0] === ':') {\n const param = route.params && route.params[segment.slice(1)];\n if (!param) {\n return null;\n }\n path.push(param);\n }\n else if (segment !== '') {\n path.push(segment);\n }\n }\n }\n return path;\n};\n// Remove the prefix segments from the path segments.\n//\n// Return:\n// - null when the path segments do not start with the passed prefix,\n// - the path segments after the prefix otherwise.\nconst removePrefix = (prefix, path) => {\n if (prefix.length > path.length) {\n return null;\n }\n if (prefix.length <= 1 && prefix[0] === '') {\n return path;\n }\n for (let i = 0; i < prefix.length; i++) {\n if (prefix[i] !== path[i]) {\n return null;\n }\n }\n if (path.length === prefix.length) {\n return [''];\n }\n return path.slice(prefix.length);\n};\nconst readPath = (loc, root, useHash) => {\n const prefix = parsePath(root).segments;\n const pathname = useHash ? loc.hash.slice(1) : loc.pathname;\n const path = parsePath(pathname).segments;\n return removePrefix(prefix, path);\n};\n// Parses the path to:\n// - segments an array of '/' separated parts,\n// - queryString (undefined when no query string).\nconst parsePath = (path) => {\n let segments = [''];\n let queryString;\n if (path != null) {\n const qsStart = path.indexOf('?');\n if (qsStart > -1) {\n queryString = path.substr(qsStart + 1);\n path = path.substr(0, qsStart);\n }\n segments = path.split('/')\n .map(s => s.trim())\n .filter(s => s.length > 0);\n if (segments.length === 0) {\n segments = [''];\n }\n }\n return { segments, queryString };\n};\n\nconst printRoutes = (routes) => {\n console.group(`[ion-core] ROUTES[${routes.length}]`);\n for (const chain of routes) {\n const path = [];\n chain.forEach(r => path.push(...r.path));\n const ids = chain.map(r => r.id);\n console.debug(`%c ${generatePath(path)}`, 'font-weight: bold; padding-left: 20px', '=>\\t', `(${ids.join(', ')})`);\n }\n console.groupEnd();\n};\nconst printRedirects = (redirects) => {\n console.group(`[ion-core] REDIRECTS[${redirects.length}]`);\n for (const redirect of redirects) {\n if (redirect.to) {\n console.debug('FROM: ', `$c ${generatePath(redirect.from)}`, 'font-weight: bold', ' TO: ', `$c ${generatePath(redirect.to.segments)}`, 'font-weight: bold');\n }\n }\n console.groupEnd();\n};\n\nconst writeNavState = async (root, chain, direction, index, changed = false, animation) => {\n try {\n // find next navigation outlet in the DOM\n const outlet = searchNavNode(root);\n // make sure we can continue interacting the DOM, otherwise abort\n if (index >= chain.length || !outlet) {\n return changed;\n }\n await new Promise(resolve => componentOnReady(outlet, resolve));\n const route = chain[index];\n const result = await outlet.setRouteId(route.id, route.params, direction, animation);\n // if the outlet changed the page, reset navigation to neutral (no direction)\n // this means nested outlets will not animate\n if (result.changed) {\n direction = ROUTER_INTENT_NONE;\n changed = true;\n }\n // recursively set nested outlets\n changed = await writeNavState(result.element, chain, direction, index + 1, changed, animation);\n // once all nested outlets are visible let's make the parent visible too,\n // using markVisible prevents flickering\n if (result.markVisible) {\n await result.markVisible();\n }\n return changed;\n }\n catch (e) {\n console.error(e);\n return false;\n }\n};\nconst readNavState = async (root) => {\n const ids = [];\n let outlet;\n let node = root;\n // tslint:disable-next-line:no-constant-condition\n while (true) {\n outlet = searchNavNode(node);\n if (outlet) {\n const id = await outlet.getRouteId();\n if (id) {\n node = id.element;\n id.element = undefined;\n ids.push(id);\n }\n else {\n break;\n }\n }\n else {\n break;\n }\n }\n return { ids, outlet };\n};\nconst waitUntilNavNode = () => {\n if (searchNavNode(document.body)) {\n return Promise.resolve();\n }\n return new Promise(resolve => {\n window.addEventListener('ionNavWillLoad', resolve, { once: true });\n });\n};\nconst QUERY = ':not([no-router]) ion-nav, :not([no-router]) ion-tabs, :not([no-router]) ion-router-outlet';\nconst searchNavNode = (root) => {\n if (!root) {\n return undefined;\n }\n if (root.matches(QUERY)) {\n return root;\n }\n const outlet = root.querySelector(QUERY);\n return outlet !== null && outlet !== void 0 ? outlet : undefined;\n};\n\n// Returns whether the given redirect matches the given path segments.\n//\n// A redirect matches when the segments of the path and redirect.from are equal.\n// Note that segments are only checked until redirect.from contains a '*' which matches any path segment.\n// The path ['some', 'path', 'to', 'page'] matches both ['some', 'path', 'to', 'page'] and ['some', 'path', '*'].\nconst matchesRedirect = (path, redirect) => {\n const { from, to } = redirect;\n if (to === undefined) {\n return false;\n }\n if (from.length > path.length) {\n return false;\n }\n for (let i = 0; i < from.length; i++) {\n const expected = from[i];\n if (expected === '*') {\n return true;\n }\n if (expected !== path[i]) {\n return false;\n }\n }\n return from.length === path.length;\n};\n// Returns the first redirect matching the path segments or undefined when no match found.\nconst findRouteRedirect = (path, redirects) => {\n return redirects.find(redirect => matchesRedirect(path, redirect));\n};\nconst matchesIDs = (ids, chain) => {\n const len = Math.min(ids.length, chain.length);\n let score = 0;\n for (let i = 0; i < len; i++) {\n const routeId = ids[i];\n const routeChain = chain[i];\n // Skip results where the route id does not match the chain at the same index\n if (routeId.id.toLowerCase() !== routeChain.id) {\n break;\n }\n if (routeId.params) {\n const routeIdParams = Object.keys(routeId.params);\n /**\n * Only compare routes with the chain that have the same number of parameters.\n */\n if (routeIdParams.length === routeChain.path.length) {\n /**\n * Maps the route's params into a path based on the path variable names,\n * to compare against the route chain format.\n *\n * Before:\n * ```ts\n * {\n * params: {\n * s1: 'a',\n * s2: 'b'\n * }\n * }\n * ```\n *\n * After:\n * ```ts\n * [':s1',':s2']\n * ```\n */\n const pathWithParams = routeIdParams.map(key => `:${key}`);\n for (let j = 0; j < pathWithParams.length; j++) {\n // Skip results where the path variable is not a match\n if (pathWithParams[j].toLowerCase() !== routeChain.path[j]) {\n break;\n }\n // Weight path matches for the same index higher.\n score++;\n }\n }\n }\n // Weight id matches\n score++;\n }\n return score;\n};\nconst matchesPath = (inputPath, chain) => {\n const segments = new RouterSegments(inputPath);\n let matchesDefault = false;\n let allparams;\n for (let i = 0; i < chain.length; i++) {\n const path = chain[i].path;\n if (path[0] === '') {\n matchesDefault = true;\n }\n else {\n for (const segment of path) {\n const data = segments.next();\n // data param\n if (segment[0] === ':') {\n if (data === '') {\n return null;\n }\n allparams = allparams || [];\n const params = allparams[i] || (allparams[i] = {});\n params[segment.slice(1)] = data;\n }\n else if (data !== segment) {\n return null;\n }\n }\n matchesDefault = false;\n }\n }\n const matches = (matchesDefault)\n ? matchesDefault === (segments.next() === '')\n : true;\n if (!matches) {\n return null;\n }\n if (allparams) {\n return chain.map((route, i) => ({\n id: route.id,\n path: route.path,\n params: mergeParams(route.params, allparams[i]),\n beforeEnter: route.beforeEnter,\n beforeLeave: route.beforeLeave\n }));\n }\n return chain;\n};\n// Merges the route parameter objects.\n// Returns undefined when both parameters are undefined.\nconst mergeParams = (a, b) => {\n return a || b ? Object.assign(Object.assign({}, a), b) : undefined;\n};\nconst routerIDsToChain = (ids, chains) => {\n let match = null;\n let maxMatches = 0;\n for (const chain of chains) {\n const score = matchesIDs(ids, chain);\n if (score > maxMatches) {\n match = chain;\n maxMatches = score;\n }\n }\n if (match) {\n return match.map((route, i) => ({\n id: route.id,\n path: route.path,\n params: mergeParams(route.params, ids[i] && ids[i].params)\n }));\n }\n return null;\n};\nconst routerPathToChain = (path, chains) => {\n let match = null;\n let matches = 0;\n for (const chain of chains) {\n const matchedChain = matchesPath(path, chain);\n if (matchedChain !== null) {\n const score = computePriority(matchedChain);\n if (score > matches) {\n matches = score;\n match = matchedChain;\n }\n }\n }\n return match;\n};\nconst computePriority = (chain) => {\n let score = 1;\n let level = 1;\n for (const route of chain) {\n for (const path of route.path) {\n if (path[0] === ':') {\n score += Math.pow(1, level);\n }\n else if (path !== '') {\n score += Math.pow(2, level);\n }\n level++;\n }\n }\n return score;\n};\nclass RouterSegments {\n constructor(path) {\n this.path = path.slice();\n }\n next() {\n if (this.path.length > 0) {\n return this.path.shift();\n }\n return '';\n }\n}\n\nconst readProp = (el, prop) => {\n if (prop in el) {\n return el[prop];\n }\n if (el.hasAttribute(prop)) {\n return el.getAttribute(prop);\n }\n return null;\n};\nconst readRedirects = (root) => {\n return Array.from(root.children)\n .filter(el => el.tagName === 'ION-ROUTE-REDIRECT')\n .map(el => {\n const to = readProp(el, 'to');\n return {\n from: parsePath(readProp(el, 'from')).segments,\n to: to == null ? undefined : parsePath(to),\n };\n });\n};\nconst readRoutes = (root) => {\n return flattenRouterTree(readRouteNodes(root));\n};\nconst readRouteNodes = (node) => {\n return Array.from(node.children)\n .filter(el => el.tagName === 'ION-ROUTE' && el.component)\n .map(el => {\n const component = readProp(el, 'component');\n return {\n path: parsePath(readProp(el, 'url')).segments,\n id: component.toLowerCase(),\n params: el.componentProps,\n beforeLeave: el.beforeLeave,\n beforeEnter: el.beforeEnter,\n children: readRouteNodes(el)\n };\n });\n};\nconst flattenRouterTree = (nodes) => {\n const chains = [];\n for (const node of nodes) {\n flattenNode([], chains, node);\n }\n return chains;\n};\nconst flattenNode = (chain, chains, node) => {\n chain = chain.slice();\n chain.push({\n id: node.id,\n path: node.path,\n params: node.params,\n beforeLeave: node.beforeLeave,\n beforeEnter: node.beforeEnter\n });\n if (node.children.length === 0) {\n chains.push(chain);\n return;\n }\n for (const child of node.children) {\n flattenNode(chain, chains, child);\n }\n};\n\nconst Router = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionRouteWillChange = createEvent(this, \"ionRouteWillChange\", 7);\n this.ionRouteDidChange = createEvent(this, \"ionRouteDidChange\", 7);\n this.previousPath = null;\n this.busy = false;\n this.state = 0;\n this.lastState = 0;\n /**\n * The root path to use when matching URLs. By default, this is set to \"/\", but you can specify\n * an alternate prefix for all URL paths.\n */\n this.root = '/';\n /**\n * The router can work in two \"modes\":\n * - With hash: `/index.html#/path/to/page`\n * - Without hash: `/path/to/page`\n *\n * Using one or another might depend in the requirements of your app and/or where it's deployed.\n *\n * Usually \"hash-less\" navigation works better for SEO and it's more user friendly too, but it might\n * requires additional server-side configuration in order to properly work.\n *\n * On the other side hash-navigation is much easier to deploy, it even works over the file protocol.\n *\n * By default, this property is `true`, change to `false` to allow hash-less URLs.\n */\n this.useHash = true;\n }\n async componentWillLoad() {\n await waitUntilNavNode();\n const canProceed = await this.runGuards(this.getPath());\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n const { redirect } = canProceed;\n const path = parsePath(redirect);\n this.setPath(path.segments, ROUTER_INTENT_NONE, path.queryString);\n await this.writeNavStateRoot(path.segments, ROUTER_INTENT_NONE);\n }\n }\n else {\n await this.onRoutesChanged();\n }\n }\n componentDidLoad() {\n window.addEventListener('ionRouteRedirectChanged', debounce(this.onRedirectChanged.bind(this), 10));\n window.addEventListener('ionRouteDataChanged', debounce(this.onRoutesChanged.bind(this), 100));\n }\n async onPopState() {\n const direction = this.historyDirection();\n let segments = this.getPath();\n const canProceed = await this.runGuards(segments);\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n segments = parsePath(canProceed.redirect).segments;\n }\n else {\n return false;\n }\n }\n return this.writeNavStateRoot(segments, direction);\n }\n onBackButton(ev) {\n ev.detail.register(0, processNextHandler => {\n this.back();\n processNextHandler();\n });\n }\n /** @internal */\n async canTransition() {\n const canProceed = await this.runGuards();\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n return canProceed.redirect;\n }\n else {\n return false;\n }\n }\n return true;\n }\n /**\n * Navigate to the specified URL.\n *\n * @param url The url to navigate to.\n * @param direction The direction of the animation. Defaults to `\"forward\"`.\n */\n async push(url, direction = 'forward', animation) {\n if (url.startsWith('.')) {\n url = (new URL(url, window.location.href)).pathname;\n }\n let parsedPath = parsePath(url);\n const canProceed = await this.runGuards(parsedPath.segments);\n if (canProceed !== true) {\n if (typeof canProceed === 'object') {\n parsedPath = parsePath(canProceed.redirect);\n }\n else {\n return false;\n }\n }\n this.setPath(parsedPath.segments, direction, parsedPath.queryString);\n return this.writeNavStateRoot(parsedPath.segments, direction, animation);\n }\n /**\n * Go back to previous page in the window.history.\n */\n back() {\n window.history.back();\n return Promise.resolve(this.waitPromise);\n }\n /** @internal */\n async printDebug() {\n printRoutes(readRoutes(this.el));\n printRedirects(readRedirects(this.el));\n }\n /** @internal */\n async navChanged(direction) {\n if (this.busy) {\n console.warn('[ion-router] router is busy, navChanged was cancelled');\n return false;\n }\n const { ids, outlet } = await readNavState(window.document.body);\n const routes = readRoutes(this.el);\n const chain = routerIDsToChain(ids, routes);\n if (!chain) {\n console.warn('[ion-router] no matching URL for ', ids.map(i => i.id));\n return false;\n }\n const path = chainToPath(chain);\n if (!path) {\n console.warn('[ion-router] router could not match path because some required param is missing');\n return false;\n }\n this.setPath(path, direction);\n await this.safeWriteNavState(outlet, chain, ROUTER_INTENT_NONE, path, null, ids.length);\n return true;\n }\n // This handler gets called when a `ion-route-redirect` component is added to the DOM or if the from or to property of such node changes.\n onRedirectChanged() {\n const path = this.getPath();\n if (path && findRouteRedirect(path, readRedirects(this.el))) {\n this.writeNavStateRoot(path, ROUTER_INTENT_NONE);\n }\n }\n // This handler gets called when a `ion-route` component is added to the DOM or if the from or to property of such node changes.\n onRoutesChanged() {\n return this.writeNavStateRoot(this.getPath(), ROUTER_INTENT_NONE);\n }\n historyDirection() {\n var _a;\n const win = window;\n if (win.history.state === null) {\n this.state++;\n win.history.replaceState(this.state, win.document.title, (_a = win.document.location) === null || _a === void 0 ? void 0 : _a.href);\n }\n const state = win.history.state;\n const lastState = this.lastState;\n this.lastState = state;\n if (state > lastState || (state >= lastState && lastState > 0)) {\n return ROUTER_INTENT_FORWARD;\n }\n if (state < lastState) {\n return ROUTER_INTENT_BACK;\n }\n return ROUTER_INTENT_NONE;\n }\n async writeNavStateRoot(path, direction, animation) {\n if (!path) {\n console.error('[ion-router] URL is not part of the routing set');\n return false;\n }\n // lookup redirect rule\n const redirects = readRedirects(this.el);\n const redirect = findRouteRedirect(path, redirects);\n let redirectFrom = null;\n if (redirect) {\n const { segments, queryString } = redirect.to;\n this.setPath(segments, direction, queryString);\n redirectFrom = redirect.from;\n path = segments;\n }\n // lookup route chain\n const routes = readRoutes(this.el);\n const chain = routerPathToChain(path, routes);\n if (!chain) {\n console.error('[ion-router] the path does not match any route');\n return false;\n }\n // write DOM give\n return this.safeWriteNavState(document.body, chain, direction, path, redirectFrom, 0, animation);\n }\n async safeWriteNavState(node, chain, direction, path, redirectFrom, index = 0, animation) {\n const unlock = await this.lock();\n let changed = false;\n try {\n changed = await this.writeNavState(node, chain, direction, path, redirectFrom, index, animation);\n }\n catch (e) {\n console.error(e);\n }\n unlock();\n return changed;\n }\n async lock() {\n const p = this.waitPromise;\n let resolve;\n this.waitPromise = new Promise(r => resolve = r);\n if (p !== undefined) {\n await p;\n }\n return resolve;\n }\n // Executes the beforeLeave hook of the source route and the beforeEnter hook of the target route if they exist.\n //\n // When the beforeLeave hook does not return true (to allow navigating) then that value is returned early and the beforeEnter is executed.\n // Otherwise the beforeEnterHook hook of the target route is executed.\n async runGuards(to = this.getPath(), from) {\n if (from === undefined) {\n from = parsePath(this.previousPath).segments;\n }\n if (!to || !from) {\n return true;\n }\n const routes = readRoutes(this.el);\n const fromChain = routerPathToChain(from, routes);\n const beforeLeaveHook = fromChain && fromChain[fromChain.length - 1].beforeLeave;\n const canLeave = beforeLeaveHook ? await beforeLeaveHook() : true;\n if (canLeave === false || typeof canLeave === 'object') {\n return canLeave;\n }\n const toChain = routerPathToChain(to, routes);\n const beforeEnterHook = toChain && toChain[toChain.length - 1].beforeEnter;\n return beforeEnterHook ? beforeEnterHook() : true;\n }\n async writeNavState(node, chain, direction, path, redirectFrom, index = 0, animation) {\n if (this.busy) {\n console.warn('[ion-router] router is busy, transition was cancelled');\n return false;\n }\n this.busy = true;\n // generate route event and emit will change\n const routeEvent = this.routeChangeEvent(path, redirectFrom);\n if (routeEvent) {\n this.ionRouteWillChange.emit(routeEvent);\n }\n const changed = await writeNavState(node, chain, direction, index, false, animation);\n this.busy = false;\n // emit did change\n if (routeEvent) {\n this.ionRouteDidChange.emit(routeEvent);\n }\n return changed;\n }\n setPath(path, direction, queryString) {\n this.state++;\n writePath(window.history, this.root, this.useHash, path, direction, this.state, queryString);\n }\n getPath() {\n return readPath(window.location, this.root, this.useHash);\n }\n routeChangeEvent(path, redirectFromPath) {\n const from = this.previousPath;\n const to = generatePath(path);\n this.previousPath = to;\n if (to === from) {\n return null;\n }\n const redirectedFrom = redirectFromPath ? generatePath(redirectFromPath) : null;\n return {\n from,\n redirectedFrom,\n to,\n };\n }\n get el() { return getElement(this); }\n};\n\nconst routerLinkCss = \":host{--background:transparent;--color:var(--ion-color-primary, #3880ff);background:var(--background);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}a{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit}\";\n\nconst RouterLink = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n /**\n * When using a router, it specifies the transition direction when navigating to\n * another page using `href`.\n */\n this.routerDirection = 'forward';\n this.onClick = (ev) => {\n openURL(this.href, ev, this.routerDirection, this.routerAnimation);\n };\n }\n render() {\n const mode = getIonMode(this);\n const attrs = {\n href: this.href,\n rel: this.rel,\n target: this.target\n };\n return (h(Host, { onClick: this.onClick, class: createColorClasses(this.color, {\n [mode]: true,\n 'ion-activatable': true\n }) }, h(\"a\", Object.assign({}, attrs), h(\"slot\", null))));\n }\n};\nRouterLink.style = routerLinkCss;\n\nexport { Route as ion_route, RouteRedirect as ion_route_redirect, Router as ion_router, RouterLink as ion_router_link };\n"],"mappings":";AAAA,SAASA,CAAC,IAAIC,gBAAgB,EAAEC,CAAC,IAAIC,WAAW,EAAEC,CAAC,IAAIC,UAAU,EAAEC,CAAC,EAAEC,CAAC,IAAIC,IAAI,QAAQ,qBAAqB;AAC5G,SAASC,CAAC,IAAIC,gBAAgB,EAAEC,CAAC,IAAIC,QAAQ,QAAQ,uBAAuB;AAC5E,SAASC,CAAC,IAAIC,UAAU,QAAQ,4BAA4B;AAC5D,SAASH,CAAC,IAAII,OAAO,EAAEN,CAAC,IAAIO,kBAAkB,QAAQ,qBAAqB;AAE3E,MAAMC,KAAK,GAAG,MAAM;EAClBC,WAAWA,CAACC,OAAO,EAAE;IACnBlB,gBAAgB,CAAC,IAAI,EAAEkB,OAAO,CAAC;IAC/B,IAAI,CAACC,mBAAmB,GAAGjB,WAAW,CAAC,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC;IACtE;AACJ;AAC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