/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
client
/
components
/
/opt/canhelp/node_modules/next/dist/client/components
mkdir
upload
Name
Size
Mode
Actions
builtin/
-
0755
rm
errors/
-
0755
rm
http-access-fallback/
-
0755
rm
metadata/
-
0755
rm
router-reducer/
-
0755
rm
segment-cache-impl/
-
0755
rm
styles/
-
0755
rm
app-router-announcer.d.ts
196
0644
edit
dl
rm
app-router-announcer.js
3352
0644
edit
dl
rm
app-router-announcer.js.map
4678
0644
edit
dl
rm
app-router-headers.d.ts
1243
0644
edit
dl
rm
app-router-headers.js
3797
0644
edit
dl
rm
app-router-headers.js.map
3110
0644
edit
dl
rm
app-router-instance.d.ts
2081
0644
edit
dl
rm
app-router-instance.js
14432
0644
edit
dl
rm
app-router-instance.js.map
21179
0644
edit
dl
rm
app-router.d.ts
932
0644
edit
dl
rm
app-router.js
24987
0644
edit
dl
rm
app-router.js.map
34863
0644
edit
dl
rm
bailout-to-client-rendering.d.ts
80
0644
edit
dl
rm
bailout-to-client-rendering.js
1877
0644
edit
dl
rm
bailout-to-client-rendering.js.map
1665
0644
edit
dl
rm
bfcache.d.ts
1397
0644
edit
dl
rm
bfcache.js
4035
0644
edit
dl
rm
bfcache.js.map
6376
0644
edit
dl
rm
client-page.d.ts
876
0644
edit
dl
rm
client-page.js
2603
0644
edit
dl
rm
client-page.js.map
3907
0644
edit
dl
rm
client-segment.d.ts
842
0644
edit
dl
rm
client-segment.js
2192
0644
edit
dl
rm
client-segment.js.map
3087
0644
edit
dl
rm
dev-root-http-access-fallback-boundary.d.ts
230
0644
edit
dl
rm
dev-root-http-access-fallback-boundary.js
1862
0644
edit
dl
rm
dev-root-http-access-fallback-boundary.js.map
1290
0644
edit
dl
rm
error-boundary.d.ts
1566
0644
edit
dl
rm
error-boundary.js
5499
0644
edit
dl
rm
error-boundary.js.map
7409
0644
edit
dl
rm
forbidden.d.ts
44
0644
edit
dl
rm
forbidden.js
2077
0644
edit
dl
rm
forbidden.js.map
1986
0644
edit
dl
rm
handle-isr-error.d.ts
78
0644
edit
dl
rm
handle-isr-error.js
1085
0644
edit
dl
rm
handle-isr-error.js.map
1295
0644
edit
dl
rm
hooks-server-context.d.ts
326
0644
edit
dl
rm
hooks-server-context.js
1352
0644
edit
dl
rm
hooks-server-context.js.map
1182
0644
edit
dl
rm
is-next-router-error.d.ts
431
0644
edit
dl
rm
is-next-router-error.js
886
0644
edit
dl
rm
is-next-router-error.js.map
899
0644
edit
dl
rm
layout-router.d.ts
999
0644
edit
dl
rm
layout-router.js
27947
0644
edit
dl
rm
layout-router.js.map
37701
0644
edit
dl
rm
links.d.ts
2241
0644
edit
dl
rm
links.js
14053
0644
edit
dl
rm
links.js.map
21056
0644
edit
dl
rm
match-segments.d.ts
154
0644
edit
dl
rm
match-segments.js
1054
0644
edit
dl
rm
match-segments.js.map
1045
0644
edit
dl
rm
nav-failure-handler.d.ts
123
0644
edit
dl
rm
nav-failure-handler.js
2492
0644
edit
dl
rm
nav-failure-handler.js.map
2868
0644
edit
dl
rm
navigation-untracked.d.ts
11
0644
edit
dl
rm
navigation-untracked.js
2607
0644
edit
dl
rm
navigation-untracked.js.map
3349
0644
edit
dl
rm
navigation.d.ts
4635
0644
edit
dl
rm
navigation.js
7942
0644
edit
dl
rm
navigation.js.map
12713
0644
edit
dl
rm
navigation.react-server.d.ts
1238
0644
edit
dl
rm
navigation.react-server.js
3501
0644
edit
dl
rm
navigation.react-server.js.map
2838
0644
edit
dl
rm
noop-head.d.ts
42
0644
edit
dl
rm
noop-head.js
607
0644
edit
dl
rm
noop-head.js.map
249
0644
edit
dl
rm
not-found.d.ts
43
0644
edit
dl
rm
not-found.js
1888
0644
edit
dl
rm
not-found.js.map
1750
0644
edit
dl
rm
promise-queue.d.ts
192
0644
edit
dl
rm
promise-queue.js
4274
0644
edit
dl
rm
promise-queue.js.map
3607
0644
edit
dl
rm
redirect-boundary.d.ts
776
0644
edit
dl
rm
redirect-boundary.js
3270
0644
edit
dl
rm
redirect-boundary.js.map
3975
0644
edit
dl
rm
redirect-error.d.ts
633
0644
edit
dl
rm
redirect-error.js
1819
0644
edit
dl
rm
redirect-error.js.map
2124
0644
edit
dl
rm
redirect-status-code.d.ts
120
0644
edit
dl
rm
redirect-status-code.js
967
0644
edit
dl
rm
redirect-status-code.js.map
330
0644
edit
dl
rm
redirect.d.ts
2469
0644
edit
dl
rm
redirect.js
3746
0644
edit
dl
rm
redirect.js.map
5919
0644
edit
dl
rm
render-from-template-context.d.ts
100
0644
edit
dl
rm
render-from-template-context.js
1170
0644
edit
dl
rm
render-from-template-context.js.map
645
0644
edit
dl
rm
segment-cache.d.ts
3498
0644
edit
dl
rm
segment-cache.js
7611
0644
edit
dl
rm
segment-cache.js.map
8946
0644
edit
dl
rm
static-generation-bailout.d.ts
205
0644
edit
dl
rm
static-generation-bailout.js
1302
0644
edit
dl
rm
static-generation-bailout.js.map
926
0644
edit
dl
rm
unauthorized.d.ts
47
0644
edit
dl
rm
unauthorized.js
2110
0644
edit
dl
rm
unauthorized.js.map
2018
0644
edit
dl
rm
unrecognized-action-error.d.ts
790
0644
edit
dl
rm
unrecognized-action-error.js
1244
0644
edit
dl
rm
unrecognized-action-error.js.map
1502
0644
edit
dl
rm
unresolved-thenable.d.ts
183
0644
edit
dl
rm
unresolved-thenable.js
769
0644
edit
dl
rm
unresolved-thenable.js.map
450
0644
edit
dl
rm
unstable-rethrow.browser.d.ts
64
0644
edit
dl
rm
unstable-rethrow.browser.js
1011
0644
edit
dl
rm
unstable-rethrow.browser.js.map
832
0644
edit
dl
rm
unstable-rethrow.d.ts
591
0644
edit
dl
rm
unstable-rethrow.js
1250
0644
edit
dl
rm
unstable-rethrow.js.map
1122
0644
edit
dl
rm
unstable-rethrow.server.d.ts
64
0644
edit
dl
rm
unstable-rethrow.server.js
1521
0644
edit
dl
rm
unstable-rethrow.server.js.map
1505
0644
edit
dl
rm
use-action-queue.d.ts
330
0644
edit
dl
rm
use-action-queue.js
2903
0644
edit
dl
rm
use-action-queue.js.map
3300
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/client/components/app-router-instance.js
(14432B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { createMutableActionQueue: null, dispatchNavigateAction: null, dispatchTraverseAction: null, getCurrentAppRouterState: null, publicAppRouterInstance: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { createMutableActionQueue: function() { return createMutableActionQueue; }, dispatchNavigateAction: function() { return dispatchNavigateAction; }, dispatchTraverseAction: function() { return dispatchTraverseAction; }, getCurrentAppRouterState: function() { return getCurrentAppRouterState; }, publicAppRouterInstance: function() { return publicAppRouterInstance; } }); const _routerreducertypes = require("./router-reducer/router-reducer-types"); const _routerreducer = require("./router-reducer/router-reducer"); const _react = require("react"); const _isthenable = require("../../shared/lib/is-thenable"); const _segmentcache = require("./segment-cache"); const _useactionqueue = require("./use-action-queue"); const _addbasepath = require("../add-base-path"); const _approuter = require("./app-router"); const _prefetchreducer = require("./router-reducer/reducers/prefetch-reducer"); const _links = require("./links"); function runRemainingActions(actionQueue, setState) { if (actionQueue.pending !== null) { actionQueue.pending = actionQueue.pending.next; if (actionQueue.pending !== null) { // eslint-disable-next-line @typescript-eslint/no-use-before-define runAction({ actionQueue, action: actionQueue.pending, setState }); } else { // No more actions are pending, check if a refresh is needed if (actionQueue.needsRefresh) { actionQueue.needsRefresh = false; actionQueue.dispatch({ type: _routerreducertypes.ACTION_REFRESH, origin: window.location.origin }, setState); } } } } async function runAction(param) { let { actionQueue, action, setState } = param; const prevState = actionQueue.state; actionQueue.pending = action; const payload = action.payload; const actionResult = actionQueue.action(prevState, payload); function handleResult(nextState) { // if we discarded this action, the state should also be discarded if (action.discarded) { return; } actionQueue.state = nextState; runRemainingActions(actionQueue, setState); action.resolve(nextState); } // if the action is a promise, set up a callback to resolve it if ((0, _isthenable.isThenable)(actionResult)) { actionResult.then(handleResult, (err)=>{ runRemainingActions(actionQueue, setState); action.reject(err); }); } else { handleResult(actionResult); } } function dispatchAction(actionQueue, payload, setState) { let resolvers = { resolve: setState, reject: ()=>{} }; // most of the action types are async with the exception of restore // it's important that restore is handled quickly since it's fired on the popstate event // and we don't want to add any delay on a back/forward nav // this only creates a promise for the async actions if (payload.type !== _routerreducertypes.ACTION_RESTORE) { // Create the promise and assign the resolvers to the object. const deferredPromise = new Promise((resolve, reject)=>{ resolvers = { resolve, reject }; }); (0, _react.startTransition)(()=>{ // we immediately notify React of the pending promise -- the resolver is attached to the action node // and will be called when the associated action promise resolves setState(deferredPromise); }); } const newAction = { payload, next: null, resolve: resolvers.resolve, reject: resolvers.reject }; // Check if the queue is empty if (actionQueue.pending === null) { // The queue is empty, so add the action and start it immediately // Mark this action as the last in the queue actionQueue.last = newAction; runAction({ actionQueue, action: newAction, setState }); } else if (payload.type === _routerreducertypes.ACTION_NAVIGATE || payload.type === _routerreducertypes.ACTION_RESTORE) { // Navigations (including back/forward) take priority over any pending actions. // Mark the pending action as discarded (so the state is never applied) and start the navigation action immediately. actionQueue.pending.discarded = true; // The rest of the current queue should still execute after this navigation. // (Note that it can't contain any earlier navigations, because we always put those into `actionQueue.pending` by calling `runAction`) newAction.next = actionQueue.pending.next; // if the pending action was a server action, mark the queue as needing a refresh once events are processed if (actionQueue.pending.payload.type === _routerreducertypes.ACTION_SERVER_ACTION) { actionQueue.needsRefresh = true; } runAction({ actionQueue, action: newAction, setState }); } else { // The queue is not empty, so add the action to the end of the queue // It will be started by runRemainingActions after the previous action finishes if (actionQueue.last !== null) { actionQueue.last.next = newAction; } actionQueue.last = newAction; } } let globalActionQueue = null; function createMutableActionQueue(initialState, instrumentationHooks) { const actionQueue = { state: initialState, dispatch: (payload, setState)=>dispatchAction(actionQueue, payload, setState), action: async (state, action)=>{ const result = (0, _routerreducer.reducer)(state, action); return result; }, pending: null, last: null, onRouterTransitionStart: instrumentationHooks !== null && typeof instrumentationHooks.onRouterTransitionStart === 'function' ? instrumentationHooks.onRouterTransitionStart : null }; if (typeof window !== 'undefined') { // The action queue is lazily created on hydration, but after that point // it doesn't change. So we can store it in a global rather than pass // it around everywhere via props/context. if (globalActionQueue !== null) { throw Object.defineProperty(new Error('Internal Next.js Error: createMutableActionQueue was called more ' + 'than once'), "__NEXT_ERROR_CODE", { value: "E624", enumerable: false, configurable: true }); } globalActionQueue = actionQueue; } return actionQueue; } function getCurrentAppRouterState() { return globalActionQueue !== null ? globalActionQueue.state : null; } function getAppRouterActionQueue() { if (globalActionQueue === null) { throw Object.defineProperty(new Error('Internal Next.js error: Router action dispatched before initialization.'), "__NEXT_ERROR_CODE", { value: "E668", enumerable: false, configurable: true }); } return globalActionQueue; } function getProfilingHookForOnNavigationStart() { if (globalActionQueue !== null) { return globalActionQueue.onRouterTransitionStart; } return null; } function dispatchNavigateAction(href, navigateType, shouldScroll, linkInstanceRef) { // TODO: This stuff could just go into the reducer. Leaving as-is for now // since we're about to rewrite all the router reducer stuff anyway. const url = new URL((0, _addbasepath.addBasePath)(href), location.href); if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) { window.next.__pendingUrl = url; } (0, _links.setLinkForCurrentNavigation)(linkInstanceRef); const onRouterTransitionStart = getProfilingHookForOnNavigationStart(); if (onRouterTransitionStart !== null) { onRouterTransitionStart(href, navigateType); } (0, _useactionqueue.dispatchAppRouterAction)({ type: _routerreducertypes.ACTION_NAVIGATE, url, isExternalUrl: (0, _approuter.isExternalURL)(url), locationSearch: location.search, shouldScroll, navigateType, allowAliasing: true }); } function dispatchTraverseAction(href, tree) { const onRouterTransitionStart = getProfilingHookForOnNavigationStart(); if (onRouterTransitionStart !== null) { onRouterTransitionStart(href, 'traverse'); } (0, _useactionqueue.dispatchAppRouterAction)({ type: _routerreducertypes.ACTION_RESTORE, url: new URL(href), tree }); } const publicAppRouterInstance = { back: ()=>window.history.back(), forward: ()=>window.history.forward(), prefetch: process.env.__NEXT_CLIENT_SEGMENT_CACHE ? // data in the router reducer state; it writes into a global mutable // cache. So we don't need to dispatch an action. (href, options)=>{ const actionQueue = getAppRouterActionQueue(); var _options_kind; const prefetchKind = (_options_kind = options == null ? void 0 : options.kind) != null ? _options_kind : _routerreducertypes.PrefetchKind.AUTO; // We don't currently offer a way to issue a runtime prefetch via `router.prefetch()`. // This will be possible when we update its API to not take a PrefetchKind. let fetchStrategy; switch(prefetchKind){ case _routerreducertypes.PrefetchKind.AUTO: { // We default to PPR. We'll discover whether or not the route supports it with the initial prefetch. fetchStrategy = _segmentcache.FetchStrategy.PPR; break; } case _routerreducertypes.PrefetchKind.FULL: { fetchStrategy = _segmentcache.FetchStrategy.Full; break; } case _routerreducertypes.PrefetchKind.TEMPORARY: { // This concept doesn't exist in the segment cache implementation. return; } default: { prefetchKind; // Despite typescript thinking that this can't happen, // we might get an unexpected value from user code. // We don't know what they want, but we know they want a prefetch, // so use the default. fetchStrategy = _segmentcache.FetchStrategy.PPR; } } var _options_onInvalidate; (0, _segmentcache.prefetch)(href, actionQueue.state.nextUrl, actionQueue.state.tree, fetchStrategy, (_options_onInvalidate = options == null ? void 0 : options.onInvalidate) != null ? _options_onInvalidate : null); } : (href, options)=>{ // Use the old prefetch implementation. const actionQueue = getAppRouterActionQueue(); const url = (0, _approuter.createPrefetchURL)(href); if (url !== null) { var _options_kind; // The prefetch reducer doesn't actually update any state or // trigger a rerender. It just writes to a mutable cache. So we // shouldn't bother calling setState/dispatch; we can just re-run // the reducer directly using the current state. // TODO: Refactor this away from a "reducer" so it's // less confusing. (0, _prefetchreducer.prefetchReducer)(actionQueue.state, { type: _routerreducertypes.ACTION_PREFETCH, url, kind: (_options_kind = options == null ? void 0 : options.kind) != null ? _options_kind : _routerreducertypes.PrefetchKind.FULL }); } }, replace: (href, options)=>{ (0, _react.startTransition)(()=>{ var _options_scroll; dispatchNavigateAction(href, 'replace', (_options_scroll = options == null ? void 0 : options.scroll) != null ? _options_scroll : true, null); }); }, push: (href, options)=>{ (0, _react.startTransition)(()=>{ var _options_scroll; dispatchNavigateAction(href, 'push', (_options_scroll = options == null ? void 0 : options.scroll) != null ? _options_scroll : true, null); }); }, refresh: ()=>{ (0, _react.startTransition)(()=>{ (0, _useactionqueue.dispatchAppRouterAction)({ type: _routerreducertypes.ACTION_REFRESH, origin: window.location.origin }); }); }, hmrRefresh: ()=>{ if (process.env.NODE_ENV !== 'development') { throw Object.defineProperty(new Error('hmrRefresh can only be used in development mode. Please use refresh instead.'), "__NEXT_ERROR_CODE", { value: "E485", enumerable: false, configurable: true }); } else { (0, _react.startTransition)(()=>{ (0, _useactionqueue.dispatchAppRouterAction)({ type: _routerreducertypes.ACTION_HMR_REFRESH, origin: window.location.origin }); }); } } }; // Exists for debugging purposes. Don't use in application code. if (typeof window !== 'undefined' && window.next) { window.next.router = publicAppRouterInstance; } if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } //# sourceMappingURL=app-router-instance.js.map
Save
cmd:
run