Files
pezkuwi-mobile-app/frontend/.metro-cache/cache/07/c5294cbc233d98f69f4a5cee5b0260b8289b3b31a6032515d103bd7f69350a4531aafc
T
2025-11-07 20:14:32 +00:00

1 line
15 KiB
Plaintext

{"dependencies":[],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n exports.getActionFromState = getActionFromState;\n function getActionFromState(state, options) {\n // Create a normalized configs object which will be easier to use\n const normalizedConfig = options ? createNormalizedConfigItem(options) : {};\n const routes = state.index != null ? state.routes.slice(0, state.index + 1) : state.routes;\n if (routes.length === 0) {\n return undefined;\n }\n if (!(routes.length === 1 && routes[0].key === undefined || routes.length === 2 && routes[0].key === undefined && routes[0].name === normalizedConfig?.initialRouteName && routes[1].key === undefined)) {\n return {\n type: 'RESET',\n payload: state\n };\n }\n const route = state.routes[state.index ?? state.routes.length - 1];\n let current = route?.state;\n let config = normalizedConfig?.screens?.[route?.name];\n let params = {\n ...route.params\n };\n const payload = route ? {\n name: route.name,\n path: route.path,\n params\n } : undefined;\n\n // If the screen contains a navigator, pop other screens to navigate to it\n // This avoid pushing multiple instances of navigators onto a stack\n //\n // For example:\n // - RootStack\n // - BottomTabs\n // - SomeScreen\n //\n // In this case, if deep linking to `BottomTabs`, we should pop `SomeScreen`\n // Otherwise, we'll end up with 2 instances of `BottomTabs` in the stack\n //\n // There are 2 ways we can detect if a screen contains a navigator:\n // - The route contains nested state in `route.state`\n // - Nested screens are defined in the config\n if (payload && config?.screens && Object.keys(config.screens).length) {\n payload.pop = true;\n }\n while (current) {\n if (current.routes.length === 0) {\n return undefined;\n }\n const routes = current.index != null ? current.routes.slice(0, current.index + 1) : current.routes;\n const route = routes[routes.length - 1];\n\n // Explicitly set to override existing value when merging params\n Object.assign(params, {\n initial: undefined,\n screen: undefined,\n params: undefined,\n state: undefined\n });\n if (routes.length === 1 && routes[0].key === undefined) {\n params.initial = true;\n params.screen = route.name;\n } else if (routes.length === 2 && routes[0].key === undefined && routes[0].name === config?.initialRouteName && routes[1].key === undefined) {\n params.initial = false;\n params.screen = route.name;\n } else {\n params.state = current;\n break;\n }\n if (route.state) {\n params.params = {\n ...route.params\n };\n params.pop = true;\n params = params.params;\n } else {\n params.path = route.path;\n params.params = route.params;\n }\n current = route.state;\n config = config?.screens?.[route.name];\n if (config?.screens && Object.keys(config.screens).length) {\n params.pop = true;\n }\n }\n if (payload?.params.screen || payload?.params.state) {\n payload.pop = true;\n }\n if (!payload) {\n return;\n }\n\n // Try to construct payload for a `NAVIGATE` action from the state\n // This lets us preserve the navigation state and not lose it\n return {\n type: 'NAVIGATE',\n payload\n };\n }\n const createNormalizedConfigItem = config => typeof config === 'object' && config != null ? {\n initialRouteName: config.initialRouteName,\n screens: config.screens != null ? createNormalizedConfigs(config.screens) : undefined\n } : {};\n const createNormalizedConfigs = options => Object.entries(options).reduce((acc, [k, v]) => {\n acc[k] = createNormalizedConfigItem(v);\n return acc;\n }, {});\n});","lineCount":112,"map":[[2,2,1,0],[2,14,1,12],[4,2,1,13,"Object"],[4,8,1,13],[4,9,1,13,"defineProperty"],[4,23,1,13],[4,24,1,13,"exports"],[4,31,1,13],[5,4,1,13,"value"],[5,9,1,13],[6,2,1,13],[7,2,3,0,"exports"],[7,9,3,0],[7,10,3,0,"getActionFromState"],[7,28,3,0],[7,31,3,0,"getActionFromState"],[7,49,3,0],[8,2,3,7],[8,11,3,16,"getActionFromState"],[8,29,3,34,"getActionFromState"],[8,30,3,35,"state"],[8,35,3,40],[8,37,3,42,"options"],[8,44,3,49],[8,46,3,51],[9,4,4,2],[10,4,5,2],[10,10,5,8,"normalizedConfig"],[10,26,5,24],[10,29,5,27,"options"],[10,36,5,34],[10,39,5,37,"createNormalizedConfigItem"],[10,65,5,63],[10,66,5,64,"options"],[10,73,5,71],[10,74,5,72],[10,77,5,75],[10,78,5,76],[10,79,5,77],[11,4,6,2],[11,10,6,8,"routes"],[11,16,6,14],[11,19,6,17,"state"],[11,24,6,22],[11,25,6,23,"index"],[11,30,6,28],[11,34,6,32],[11,38,6,36],[11,41,6,39,"state"],[11,46,6,44],[11,47,6,45,"routes"],[11,53,6,51],[11,54,6,52,"slice"],[11,59,6,57],[11,60,6,58],[11,61,6,59],[11,63,6,61,"state"],[11,68,6,66],[11,69,6,67,"index"],[11,74,6,72],[11,77,6,75],[11,78,6,76],[11,79,6,77],[11,82,6,80,"state"],[11,87,6,85],[11,88,6,86,"routes"],[11,94,6,92],[12,4,7,2],[12,8,7,6,"routes"],[12,14,7,12],[12,15,7,13,"length"],[12,21,7,19],[12,26,7,24],[12,27,7,25],[12,29,7,27],[13,6,8,4],[13,13,8,11,"undefined"],[13,22,8,20],[14,4,9,2],[15,4,10,2],[15,8,10,6],[15,10,10,8,"routes"],[15,16,10,14],[15,17,10,15,"length"],[15,23,10,21],[15,28,10,26],[15,29,10,27],[15,33,10,31,"routes"],[15,39,10,37],[15,40,10,38],[15,41,10,39],[15,42,10,40],[15,43,10,41,"key"],[15,46,10,44],[15,51,10,49,"undefined"],[15,60,10,58],[15,64,10,62,"routes"],[15,70,10,68],[15,71,10,69,"length"],[15,77,10,75],[15,82,10,80],[15,83,10,81],[15,87,10,85,"routes"],[15,93,10,91],[15,94,10,92],[15,95,10,93],[15,96,10,94],[15,97,10,95,"key"],[15,100,10,98],[15,105,10,103,"undefined"],[15,114,10,112],[15,118,10,116,"routes"],[15,124,10,122],[15,125,10,123],[15,126,10,124],[15,127,10,125],[15,128,10,126,"name"],[15,132,10,130],[15,137,10,135,"normalizedConfig"],[15,153,10,151],[15,155,10,153,"initialRouteName"],[15,171,10,169],[15,175,10,173,"routes"],[15,181,10,179],[15,182,10,180],[15,183,10,181],[15,184,10,182],[15,185,10,183,"key"],[15,188,10,186],[15,193,10,191,"undefined"],[15,202,10,200],[15,203,10,201],[15,205,10,203],[16,6,11,4],[16,13,11,11],[17,8,12,6,"type"],[17,12,12,10],[17,14,12,12],[17,21,12,19],[18,8,13,6,"payload"],[18,15,13,13],[18,17,13,15,"state"],[19,6,14,4],[19,7,14,5],[20,4,15,2],[21,4,16,2],[21,10,16,8,"route"],[21,15,16,13],[21,18,16,16,"state"],[21,23,16,21],[21,24,16,22,"routes"],[21,30,16,28],[21,31,16,29,"state"],[21,36,16,34],[21,37,16,35,"index"],[21,42,16,40],[21,46,16,44,"state"],[21,51,16,49],[21,52,16,50,"routes"],[21,58,16,56],[21,59,16,57,"length"],[21,65,16,63],[21,68,16,66],[21,69,16,67],[21,70,16,68],[22,4,17,2],[22,8,17,6,"current"],[22,15,17,13],[22,18,17,16,"route"],[22,23,17,21],[22,25,17,23,"state"],[22,30,17,28],[23,4,18,2],[23,8,18,6,"config"],[23,14,18,12],[23,17,18,15,"normalizedConfig"],[23,33,18,31],[23,35,18,33,"screens"],[23,42,18,40],[23,45,18,43,"route"],[23,50,18,48],[23,52,18,50,"name"],[23,56,18,54],[23,57,18,55],[24,4,19,2],[24,8,19,6,"params"],[24,14,19,12],[24,17,19,15],[25,6,20,4],[25,9,20,7,"route"],[25,14,20,12],[25,15,20,13,"params"],[26,4,21,2],[26,5,21,3],[27,4,22,2],[27,10,22,8,"payload"],[27,17,22,15],[27,20,22,18,"route"],[27,25,22,23],[27,28,22,26],[28,6,23,4,"name"],[28,10,23,8],[28,12,23,10,"route"],[28,17,23,15],[28,18,23,16,"name"],[28,22,23,20],[29,6,24,4,"path"],[29,10,24,8],[29,12,24,10,"route"],[29,17,24,15],[29,18,24,16,"path"],[29,22,24,20],[30,6,25,4,"params"],[31,4,26,2],[31,5,26,3],[31,8,26,6,"undefined"],[31,17,26,15],[33,4,28,2],[34,4,29,2],[35,4,30,2],[36,4,31,2],[37,4,32,2],[38,4,33,2],[39,4,34,2],[40,4,35,2],[41,4,36,2],[42,4,37,2],[43,4,38,2],[44,4,39,2],[45,4,40,2],[46,4,41,2],[47,4,42,2],[47,8,42,6,"payload"],[47,15,42,13],[47,19,42,17,"config"],[47,25,42,23],[47,27,42,25,"screens"],[47,34,42,32],[47,38,42,36,"Object"],[47,44,42,42],[47,45,42,43,"keys"],[47,49,42,47],[47,50,42,48,"config"],[47,56,42,54],[47,57,42,55,"screens"],[47,64,42,62],[47,65,42,63],[47,66,42,64,"length"],[47,72,42,70],[47,74,42,72],[48,6,43,4,"payload"],[48,13,43,11],[48,14,43,12,"pop"],[48,17,43,15],[48,20,43,18],[48,24,43,22],[49,4,44,2],[50,4,45,2],[50,11,45,9,"current"],[50,18,45,16],[50,20,45,18],[51,6,46,4],[51,10,46,8,"current"],[51,17,46,15],[51,18,46,16,"routes"],[51,24,46,22],[51,25,46,23,"length"],[51,31,46,29],[51,36,46,34],[51,37,46,35],[51,39,46,37],[52,8,47,6],[52,15,47,13,"undefined"],[52,24,47,22],[53,6,48,4],[54,6,49,4],[54,12,49,10,"routes"],[54,18,49,16],[54,21,49,19,"current"],[54,28,49,26],[54,29,49,27,"index"],[54,34,49,32],[54,38,49,36],[54,42,49,40],[54,45,49,43,"current"],[54,52,49,50],[54,53,49,51,"routes"],[54,59,49,57],[54,60,49,58,"slice"],[54,65,49,63],[54,66,49,64],[54,67,49,65],[54,69,49,67,"current"],[54,76,49,74],[54,77,49,75,"index"],[54,82,49,80],[54,85,49,83],[54,86,49,84],[54,87,49,85],[54,90,49,88,"current"],[54,97,49,95],[54,98,49,96,"routes"],[54,104,49,102],[55,6,50,4],[55,12,50,10,"route"],[55,17,50,15],[55,20,50,18,"routes"],[55,26,50,24],[55,27,50,25,"routes"],[55,33,50,31],[55,34,50,32,"length"],[55,40,50,38],[55,43,50,41],[55,44,50,42],[55,45,50,43],[57,6,52,4],[58,6,53,4,"Object"],[58,12,53,10],[58,13,53,11,"assign"],[58,19,53,17],[58,20,53,18,"params"],[58,26,53,24],[58,28,53,26],[59,8,54,6,"initial"],[59,15,54,13],[59,17,54,15,"undefined"],[59,26,54,24],[60,8,55,6,"screen"],[60,14,55,12],[60,16,55,14,"undefined"],[60,25,55,23],[61,8,56,6,"params"],[61,14,56,12],[61,16,56,14,"undefined"],[61,25,56,23],[62,8,57,6,"state"],[62,13,57,11],[62,15,57,13,"undefined"],[63,6,58,4],[63,7,58,5],[63,8,58,6],[64,6,59,4],[64,10,59,8,"routes"],[64,16,59,14],[64,17,59,15,"length"],[64,23,59,21],[64,28,59,26],[64,29,59,27],[64,33,59,31,"routes"],[64,39,59,37],[64,40,59,38],[64,41,59,39],[64,42,59,40],[64,43,59,41,"key"],[64,46,59,44],[64,51,59,49,"undefined"],[64,60,59,58],[64,62,59,60],[65,8,60,6,"params"],[65,14,60,12],[65,15,60,13,"initial"],[65,22,60,20],[65,25,60,23],[65,29,60,27],[66,8,61,6,"params"],[66,14,61,12],[66,15,61,13,"screen"],[66,21,61,19],[66,24,61,22,"route"],[66,29,61,27],[66,30,61,28,"name"],[66,34,61,32],[67,6,62,4],[67,7,62,5],[67,13,62,11],[67,17,62,15,"routes"],[67,23,62,21],[67,24,62,22,"length"],[67,30,62,28],[67,35,62,33],[67,36,62,34],[67,40,62,38,"routes"],[67,46,62,44],[67,47,62,45],[67,48,62,46],[67,49,62,47],[67,50,62,48,"key"],[67,53,62,51],[67,58,62,56,"undefined"],[67,67,62,65],[67,71,62,69,"routes"],[67,77,62,75],[67,78,62,76],[67,79,62,77],[67,80,62,78],[67,81,62,79,"name"],[67,85,62,83],[67,90,62,88,"config"],[67,96,62,94],[67,98,62,96,"initialRouteName"],[67,114,62,112],[67,118,62,116,"routes"],[67,124,62,122],[67,125,62,123],[67,126,62,124],[67,127,62,125],[67,128,62,126,"key"],[67,131,62,129],[67,136,62,134,"undefined"],[67,145,62,143],[67,147,62,145],[68,8,63,6,"params"],[68,14,63,12],[68,15,63,13,"initial"],[68,22,63,20],[68,25,63,23],[68,30,63,28],[69,8,64,6,"params"],[69,14,64,12],[69,15,64,13,"screen"],[69,21,64,19],[69,24,64,22,"route"],[69,29,64,27],[69,30,64,28,"name"],[69,34,64,32],[70,6,65,4],[70,7,65,5],[70,13,65,11],[71,8,66,6,"params"],[71,14,66,12],[71,15,66,13,"state"],[71,20,66,18],[71,23,66,21,"current"],[71,30,66,28],[72,8,67,6],[73,6,68,4],[74,6,69,4],[74,10,69,8,"route"],[74,15,69,13],[74,16,69,14,"state"],[74,21,69,19],[74,23,69,21],[75,8,70,6,"params"],[75,14,70,12],[75,15,70,13,"params"],[75,21,70,19],[75,24,70,22],[76,10,71,8],[76,13,71,11,"route"],[76,18,71,16],[76,19,71,17,"params"],[77,8,72,6],[77,9,72,7],[78,8,73,6,"params"],[78,14,73,12],[78,15,73,13,"pop"],[78,18,73,16],[78,21,73,19],[78,25,73,23],[79,8,74,6,"params"],[79,14,74,12],[79,17,74,15,"params"],[79,23,74,21],[79,24,74,22,"params"],[79,30,74,28],[80,6,75,4],[80,7,75,5],[80,13,75,11],[81,8,76,6,"params"],[81,14,76,12],[81,15,76,13,"path"],[81,19,76,17],[81,22,76,20,"route"],[81,27,76,25],[81,28,76,26,"path"],[81,32,76,30],[82,8,77,6,"params"],[82,14,77,12],[82,15,77,13,"params"],[82,21,77,19],[82,24,77,22,"route"],[82,29,77,27],[82,30,77,28,"params"],[82,36,77,34],[83,6,78,4],[84,6,79,4,"current"],[84,13,79,11],[84,16,79,14,"route"],[84,21,79,19],[84,22,79,20,"state"],[84,27,79,25],[85,6,80,4,"config"],[85,12,80,10],[85,15,80,13,"config"],[85,21,80,19],[85,23,80,21,"screens"],[85,30,80,28],[85,33,80,31,"route"],[85,38,80,36],[85,39,80,37,"name"],[85,43,80,41],[85,44,80,42],[86,6,81,4],[86,10,81,8,"config"],[86,16,81,14],[86,18,81,16,"screens"],[86,25,81,23],[86,29,81,27,"Object"],[86,35,81,33],[86,36,81,34,"keys"],[86,40,81,38],[86,41,81,39,"config"],[86,47,81,45],[86,48,81,46,"screens"],[86,55,81,53],[86,56,81,54],[86,57,81,55,"length"],[86,63,81,61],[86,65,81,63],[87,8,82,6,"params"],[87,14,82,12],[87,15,82,13,"pop"],[87,18,82,16],[87,21,82,19],[87,25,82,23],[88,6,83,4],[89,4,84,2],[90,4,85,2],[90,8,85,6,"payload"],[90,15,85,13],[90,17,85,15,"params"],[90,23,85,21],[90,24,85,22,"screen"],[90,30,85,28],[90,34,85,32,"payload"],[90,41,85,39],[90,43,85,41,"params"],[90,49,85,47],[90,50,85,48,"state"],[90,55,85,53],[90,57,85,55],[91,6,86,4,"payload"],[91,13,86,11],[91,14,86,12,"pop"],[91,17,86,15],[91,20,86,18],[91,24,86,22],[92,4,87,2],[93,4,88,2],[93,8,88,6],[93,9,88,7,"payload"],[93,16,88,14],[93,18,88,16],[94,6,89,4],[95,4,90,2],[97,4,92,2],[98,4,93,2],[99,4,94,2],[99,11,94,9],[100,6,95,4,"type"],[100,10,95,8],[100,12,95,10],[100,22,95,20],[101,6,96,4,"payload"],[102,4,97,2],[102,5,97,3],[103,2,98,0],[104,2,99,0],[104,8,99,6,"createNormalizedConfigItem"],[104,34,99,32],[104,37,99,35,"config"],[104,43,99,41],[104,47,99,45],[104,54,99,52,"config"],[104,60,99,58],[104,65,99,63],[104,73,99,71],[104,77,99,75,"config"],[104,83,99,81],[104,87,99,85],[104,91,99,89],[104,94,99,92],[105,4,100,2,"initialRouteName"],[105,20,100,18],[105,22,100,20,"config"],[105,28,100,26],[105,29,100,27,"initialRouteName"],[105,45,100,43],[106,4,101,2,"screens"],[106,11,101,9],[106,13,101,11,"config"],[106,19,101,17],[106,20,101,18,"screens"],[106,27,101,25],[106,31,101,29],[106,35,101,33],[106,38,101,36,"createNormalizedConfigs"],[106,61,101,59],[106,62,101,60,"config"],[106,68,101,66],[106,69,101,67,"screens"],[106,76,101,74],[106,77,101,75],[106,80,101,78,"undefined"],[107,2,102,0],[107,3,102,1],[107,6,102,4],[107,7,102,5],[107,8,102,6],[108,2,103,0],[108,8,103,6,"createNormalizedConfigs"],[108,31,103,29],[108,34,103,32,"options"],[108,41,103,39],[108,45,103,43,"Object"],[108,51,103,49],[108,52,103,50,"entries"],[108,59,103,57],[108,60,103,58,"options"],[108,67,103,65],[108,68,103,66],[108,69,103,67,"reduce"],[108,75,103,73],[108,76,103,74],[108,77,103,75,"acc"],[108,80,103,78],[108,82,103,80],[108,83,103,81,"k"],[108,84,103,82],[108,86,103,84,"v"],[108,87,103,85],[108,88,103,86],[108,93,103,91],[109,4,104,2,"acc"],[109,7,104,5],[109,8,104,6,"k"],[109,9,104,7],[109,10,104,8],[109,13,104,11,"createNormalizedConfigItem"],[109,39,104,37],[109,40,104,38,"v"],[109,41,104,39],[109,42,104,40],[110,4,105,2],[110,11,105,9,"acc"],[110,14,105,12],[111,2,106,0],[111,3,106,1],[111,5,106,3],[111,6,106,4],[111,7,106,5],[111,8,106,6],[112,0,106,7],[112,3]],"functionMap":{"names":["<global>","getActionFromState","createNormalizedConfigItem","createNormalizedConfigs","Object.entries.reduce$argument_0"],"mappings":"AAA;OCE;CD+F;mCEC;MFG;gCGC,0CC;CDG,KH"},"hasCjsExports":false},"type":"js/module"}]}