@scrabble-solver/scrabble-solver 2.11.1 → 2.11.3
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +6 -6
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/eslint/.cache_8dgz12 +1 -1
- package/.next/cache/next-server.js.nft.json +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/210.js +109 -0
- package/.next/server/chunks/277.js +380 -258
- package/.next/server/chunks/44.js +47 -0
- package/.next/server/chunks/987.js +91 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_app.js +1 -73
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/api/dictionary/[locale]/[word].js +3 -4
- package/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
- package/.next/server/pages/api/dictionary/[locale].js +3 -4
- package/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
- package/.next/server/pages/api/solve.js +38 -13
- package/.next/server/pages/api/solve.js.nft.json +1 -1
- package/.next/server/pages/api/verify.js +5 -5
- package/.next/server/pages/api/verify.js.nft.json +1 -1
- package/.next/server/pages/api/visit.js +3 -4
- package/.next/server/pages/api/visit.js.nft.json +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/index.js +141 -237
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/index.json +1 -1
- package/.next/static/{esK8DG-6aS5V7QFRtR3YE → USLkKOoHbITebIEHkMGX_}/_buildManifest.js +1 -1
- package/.next/static/chunks/pages/_app-21c83ddb81fc09d0.js +28 -0
- package/.next/static/chunks/pages/index-0858deea02b2a417.js +1 -0
- package/.next/static/css/885da289cec275b3.css +1 -0
- package/.next/static/css/ea1c8134fe9a143e.css +2 -0
- package/.next/trace +53 -53
- package/package.json +9 -9
- package/src/api/index.ts +1 -0
- package/src/api/isCellValid.ts +3 -2
- package/src/api/isCharacterValid.ts +13 -0
- package/src/components/Board/components/Cell/Cell.module.scss +10 -2
- package/src/components/Board/hooks/useGrid.ts +1 -2
- package/src/components/Board/lib/getPositionInGrid.ts +1 -1
- package/src/components/Button/Button.module.scss +14 -1
- package/src/components/LogoSplashScreen/LogoSplashScreen.module.scss +4 -1
- package/src/components/Modal/Modal.module.scss +21 -1
- package/src/components/Modal/Modal.tsx +4 -1
- package/src/components/NotFound/NotFound.module.scss +13 -4
- package/src/components/NotFound/NotFound.tsx +4 -7
- package/src/components/Rack/Rack.tsx +3 -1
- package/src/components/Results/HeaderButton.tsx +5 -12
- package/src/components/Results/Result.tsx +5 -3
- package/src/components/Results/Results.module.scss +13 -1
- package/src/components/Results/Results.tsx +29 -43
- package/src/components/Results/types.ts +1 -1
- package/src/components/Solver/Solver.module.scss +4 -0
- package/src/components/Solver/Solver.tsx +9 -12
- package/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +5 -6
- package/src/components/Tile/Tile.module.scss +53 -79
- package/src/components/Tile/Tile.tsx +1 -3
- package/src/components/Tile/TilePure.tsx +4 -14
- package/src/hooks/useAppLayout.ts +3 -1
- package/src/i18n/constants.ts +65 -0
- package/src/i18n/de.json +1 -1
- package/src/i18n/en.json +1 -1
- package/src/i18n/es.json +1 -1
- package/src/i18n/fa.json +1 -1
- package/src/i18n/fr.json +1 -1
- package/src/i18n/i18n.module.scss +27 -0
- package/src/i18n/pl.json +1 -1
- package/src/icons/DashCircleFill.svg +1 -0
- package/src/icons/EyeFill.svg +5 -0
- package/src/icons/index.ts +3 -2
- package/src/lib/createRegExp.ts +13 -0
- package/src/lib/groupResults.ts +38 -0
- package/src/lib/guessLocale.ts +22 -0
- package/src/lib/index.ts +4 -1
- package/src/lib/sortResults.ts +6 -10
- package/src/modals/DictionaryModal/DictionaryModal.module.scss +0 -1
- package/src/modals/MenuModal/MenuModal.module.scss +23 -0
- package/src/modals/MenuModal/MenuModal.tsx +8 -2
- package/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +4 -1
- package/src/modals/RemainingTilesModal/components/Character/Character.module.scss +8 -0
- package/src/modals/ResultsModal/ResultsModal.module.scss +2 -3
- package/src/modals/ResultsModal/ResultsModal.tsx +47 -11
- package/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.module.scss +3 -44
- package/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +4 -2
- package/src/pages/api/dictionary/[locale]/[word].ts +0 -1
- package/src/pages/api/dictionary/[locale]/index.ts +0 -1
- package/src/pages/api/solve.ts +3 -3
- package/src/pages/api/verify.ts +0 -1
- package/src/pages/api/visit.ts +0 -1
- package/src/pages/index.tsx +13 -15
- package/src/parameters/index.ts +2 -2
- package/src/state/sagas.ts +1 -0
- package/src/state/selectors.ts +37 -37
- package/src/state/slices/boardInitialState.ts +3 -1
- package/src/state/slices/cellFilterInitialState.ts +3 -3
- package/src/state/slices/cellFilterSlice.ts +3 -1
- package/src/state/slices/dictionaryInitialState.ts +2 -2
- package/src/state/slices/rackInitialState.ts +3 -1
- package/src/state/slices/resultsInitialState.ts +11 -4
- package/src/state/slices/settingsInitialState.ts +10 -21
- package/src/state/slices/solveInitialState.ts +2 -2
- package/src/state/slices/solveSlice.ts +2 -0
- package/src/state/slices/verifyInitialState.ts +13 -4
- package/src/styles/mixins.scss +5 -1
- package/src/styles/variables.scss +13 -0
- package/src/types/index.ts +11 -2
- package/.next/server/chunks/417.js +0 -221
- package/.next/server/chunks/664.js +0 -621
- package/.next/static/chunks/pages/_app-270526803bc274eb.js +0 -28
- package/.next/static/chunks/pages/index-c6e7754ccf3532df.js +0 -1
- package/.next/static/css/ad39b36eab07e613.css +0 -1
- package/.next/static/css/e5803e581e4c0451.css +0 -2
- package/src/components/Board/types/index.ts +0 -4
- package/src/modals/SettingsModal/components/LocaleSetting/options.ts +0 -68
- /package/.next/static/{esK8DG-6aS5V7QFRtR3YE → USLkKOoHbITebIEHkMGX_}/_ssgManifest.js +0 -0
|
@@ -1,621 +0,0 @@
|
|
|
1
|
-
exports.id = 664;
|
|
2
|
-
exports.ids = [664];
|
|
3
|
-
exports.modules = {
|
|
4
|
-
|
|
5
|
-
/***/ 92648:
|
|
6
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
7
|
-
|
|
8
|
-
"use strict";
|
|
9
|
-
var __webpack_unused_export__;
|
|
10
|
-
|
|
11
|
-
__webpack_unused_export__ = ({
|
|
12
|
-
value: true
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "Z", ({
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function() {
|
|
17
|
-
return _interopRequireDefault;
|
|
18
|
-
}
|
|
19
|
-
}));
|
|
20
|
-
function _interopRequireDefault(obj) {
|
|
21
|
-
return obj && obj.__esModule ? obj : {
|
|
22
|
-
default: obj
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/***/ }),
|
|
28
|
-
|
|
29
|
-
/***/ 17273:
|
|
30
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
31
|
-
|
|
32
|
-
"use strict";
|
|
33
|
-
var __webpack_unused_export__;
|
|
34
|
-
|
|
35
|
-
__webpack_unused_export__ = ({
|
|
36
|
-
value: true
|
|
37
|
-
});
|
|
38
|
-
Object.defineProperty(exports, "Z", ({
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function() {
|
|
41
|
-
return _objectWithoutPropertiesLoose;
|
|
42
|
-
}
|
|
43
|
-
}));
|
|
44
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
45
|
-
if (source == null) return {};
|
|
46
|
-
var target = {};
|
|
47
|
-
var sourceKeys = Object.keys(source);
|
|
48
|
-
var key, i;
|
|
49
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
50
|
-
key = sourceKeys[i];
|
|
51
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
52
|
-
target[key] = source[key];
|
|
53
|
-
}
|
|
54
|
-
return target;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/***/ }),
|
|
59
|
-
|
|
60
|
-
/***/ 64266:
|
|
61
|
-
/***/ ((module, exports, __webpack_require__) => {
|
|
62
|
-
|
|
63
|
-
"use strict";
|
|
64
|
-
|
|
65
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
66
|
-
value: true
|
|
67
|
-
}));
|
|
68
|
-
exports.addBasePath = addBasePath;
|
|
69
|
-
var _addPathPrefix = __webpack_require__(11751);
|
|
70
|
-
var _normalizeTrailingSlash = __webpack_require__(82387);
|
|
71
|
-
const basePath = false || "";
|
|
72
|
-
function addBasePath(path, required) {
|
|
73
|
-
if (false) {}
|
|
74
|
-
return (0, _normalizeTrailingSlash).normalizePathTrailingSlash((0, _addPathPrefix).addPathPrefix(path, basePath));
|
|
75
|
-
}
|
|
76
|
-
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
77
|
-
Object.defineProperty(exports.default, "__esModule", {
|
|
78
|
-
value: true
|
|
79
|
-
});
|
|
80
|
-
Object.assign(exports.default, exports);
|
|
81
|
-
module.exports = exports.default;
|
|
82
|
-
} //# sourceMappingURL=add-base-path.js.map
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
/***/ }),
|
|
86
|
-
|
|
87
|
-
/***/ 370:
|
|
88
|
-
/***/ ((module, exports, __webpack_require__) => {
|
|
89
|
-
|
|
90
|
-
"use strict";
|
|
91
|
-
|
|
92
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
93
|
-
value: true
|
|
94
|
-
}));
|
|
95
|
-
exports.addLocale = void 0;
|
|
96
|
-
var _normalizeTrailingSlash = __webpack_require__(82387);
|
|
97
|
-
const addLocale = (path, ...args)=>{
|
|
98
|
-
if (false) {}
|
|
99
|
-
return path;
|
|
100
|
-
};
|
|
101
|
-
exports.addLocale = addLocale;
|
|
102
|
-
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
103
|
-
Object.defineProperty(exports.default, "__esModule", {
|
|
104
|
-
value: true
|
|
105
|
-
});
|
|
106
|
-
Object.assign(exports.default, exports);
|
|
107
|
-
module.exports = exports.default;
|
|
108
|
-
} //# sourceMappingURL=add-locale.js.map
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/***/ }),
|
|
112
|
-
|
|
113
|
-
/***/ 81516:
|
|
114
|
-
/***/ ((module, exports) => {
|
|
115
|
-
|
|
116
|
-
"use strict";
|
|
117
|
-
|
|
118
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
119
|
-
value: true
|
|
120
|
-
}));
|
|
121
|
-
exports.getDomainLocale = getDomainLocale;
|
|
122
|
-
const basePath = (/* unused pure expression or super */ null && ( false || ""));
|
|
123
|
-
function getDomainLocale(path, locale, locales, domainLocales) {
|
|
124
|
-
if (false) {} else {
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
129
|
-
Object.defineProperty(exports.default, "__esModule", {
|
|
130
|
-
value: true
|
|
131
|
-
});
|
|
132
|
-
Object.assign(exports.default, exports);
|
|
133
|
-
module.exports = exports.default;
|
|
134
|
-
} //# sourceMappingURL=get-domain-locale.js.map
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
/***/ }),
|
|
138
|
-
|
|
139
|
-
/***/ 95569:
|
|
140
|
-
/***/ ((module, exports, __webpack_require__) => {
|
|
141
|
-
|
|
142
|
-
"use strict";
|
|
143
|
-
|
|
144
|
-
"use client";
|
|
145
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
146
|
-
value: true
|
|
147
|
-
}));
|
|
148
|
-
exports["default"] = void 0;
|
|
149
|
-
var _interop_require_default = (__webpack_require__(92648)/* ["default"] */ .Z);
|
|
150
|
-
var _object_without_properties_loose = (__webpack_require__(17273)/* ["default"] */ .Z);
|
|
151
|
-
var _react = _interop_require_default(__webpack_require__(16689));
|
|
152
|
-
var _resolveHref = __webpack_require__(87782);
|
|
153
|
-
var _isLocalUrl = __webpack_require__(71109);
|
|
154
|
-
var _formatUrl = __webpack_require__(23938);
|
|
155
|
-
var _utils = __webpack_require__(59232);
|
|
156
|
-
var _addLocale = __webpack_require__(370);
|
|
157
|
-
var _routerContext = __webpack_require__(24964);
|
|
158
|
-
var _appRouterContext = __webpack_require__(3280);
|
|
159
|
-
var _useIntersection = __webpack_require__(80508);
|
|
160
|
-
var _getDomainLocale = __webpack_require__(81516);
|
|
161
|
-
var _addBasePath = __webpack_require__(64266);
|
|
162
|
-
const prefetched = new Set();
|
|
163
|
-
function prefetch(router, href, as, options, isAppRouter) {
|
|
164
|
-
if (true) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
// app-router supports external urls out of the box so it shouldn't short-circuit here as support for e.g. `replace` is added in the app-router.
|
|
168
|
-
if (!isAppRouter && !(0, _isLocalUrl).isLocalURL(href)) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
// We should only dedupe requests when experimental.optimisticClientCache is
|
|
172
|
-
// disabled.
|
|
173
|
-
if (!options.bypassPrefetchedCheck) {
|
|
174
|
-
const locale = typeof options.locale !== "undefined" ? options.locale : "locale" in router ? router.locale : undefined;
|
|
175
|
-
const prefetchedKey = href + "%" + as + "%" + locale;
|
|
176
|
-
// If we've already fetched the key, then don't prefetch it again!
|
|
177
|
-
if (prefetched.has(prefetchedKey)) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
// Mark this URL as prefetched.
|
|
181
|
-
prefetched.add(prefetchedKey);
|
|
182
|
-
}
|
|
183
|
-
// Prefetch the JSON page if asked (only in the client)
|
|
184
|
-
// We need to handle a prefetch error here since we may be
|
|
185
|
-
// loading with priority which can reject but we don't
|
|
186
|
-
// want to force navigation since this is only a prefetch
|
|
187
|
-
Promise.resolve(router.prefetch(href, as, options)).catch((err)=>{
|
|
188
|
-
if (false) {}
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
function isModifiedEvent(event) {
|
|
192
|
-
const eventTarget = event.currentTarget;
|
|
193
|
-
const target = eventTarget.getAttribute("target");
|
|
194
|
-
return target && target !== "_self" || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.nativeEvent && event.nativeEvent.which === 2;
|
|
195
|
-
}
|
|
196
|
-
function linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled) {
|
|
197
|
-
const { nodeName } = e.currentTarget;
|
|
198
|
-
// anchors inside an svg have a lowercase nodeName
|
|
199
|
-
const isAnchorNodeName = nodeName.toUpperCase() === "A";
|
|
200
|
-
if (isAnchorNodeName && (isModifiedEvent(e) || // app-router supports external urls out of the box so it shouldn't short-circuit here as support for e.g. `replace` is added in the app-router.
|
|
201
|
-
!isAppRouter && !(0, _isLocalUrl).isLocalURL(href))) {
|
|
202
|
-
// ignore click for browser’s default behavior
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
e.preventDefault();
|
|
206
|
-
const navigate = ()=>{
|
|
207
|
-
// If the router is an NextRouter instance it will have `beforePopState`
|
|
208
|
-
if ("beforePopState" in router) {
|
|
209
|
-
router[replace ? "replace" : "push"](href, as, {
|
|
210
|
-
shallow,
|
|
211
|
-
locale,
|
|
212
|
-
scroll
|
|
213
|
-
});
|
|
214
|
-
} else {
|
|
215
|
-
router[replace ? "replace" : "push"](as || href, {
|
|
216
|
-
forceOptimisticNavigation: !prefetchEnabled
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
if (isAppRouter) {
|
|
221
|
-
// @ts-expect-error startTransition exists.
|
|
222
|
-
_react.default.startTransition(navigate);
|
|
223
|
-
} else {
|
|
224
|
-
navigate();
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
function formatStringOrUrl(urlObjOrString) {
|
|
228
|
-
if (typeof urlObjOrString === "string") {
|
|
229
|
-
return urlObjOrString;
|
|
230
|
-
}
|
|
231
|
-
return (0, _formatUrl).formatUrl(urlObjOrString);
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* React Component that enables client-side transitions between routes.
|
|
235
|
-
*/ const Link = /*#__PURE__*/ _react.default.forwardRef(function LinkComponent(props, forwardedRef) {
|
|
236
|
-
if (false) {}
|
|
237
|
-
let children;
|
|
238
|
-
const { href: hrefProp , as: asProp , children: childrenProp , prefetch: prefetchProp , passHref , replace , shallow , scroll , locale , onClick , onMouseEnter: onMouseEnterProp , onTouchStart: onTouchStartProp , legacyBehavior =true === false } = props, restProps = _object_without_properties_loose(props, [
|
|
239
|
-
"href",
|
|
240
|
-
"as",
|
|
241
|
-
"children",
|
|
242
|
-
"prefetch",
|
|
243
|
-
"passHref",
|
|
244
|
-
"replace",
|
|
245
|
-
"shallow",
|
|
246
|
-
"scroll",
|
|
247
|
-
"locale",
|
|
248
|
-
"onClick",
|
|
249
|
-
"onMouseEnter",
|
|
250
|
-
"onTouchStart",
|
|
251
|
-
"legacyBehavior"
|
|
252
|
-
]);
|
|
253
|
-
children = childrenProp;
|
|
254
|
-
if (legacyBehavior && (typeof children === "string" || typeof children === "number")) {
|
|
255
|
-
children = /*#__PURE__*/ _react.default.createElement("a", null, children);
|
|
256
|
-
}
|
|
257
|
-
const prefetchEnabled = prefetchProp !== false;
|
|
258
|
-
const pagesRouter = _react.default.useContext(_routerContext.RouterContext);
|
|
259
|
-
const appRouter = _react.default.useContext(_appRouterContext.AppRouterContext);
|
|
260
|
-
const router = pagesRouter != null ? pagesRouter : appRouter;
|
|
261
|
-
// We're in the app directory if there is no pages router.
|
|
262
|
-
const isAppRouter = !pagesRouter;
|
|
263
|
-
if (false) {}
|
|
264
|
-
const { href , as } = _react.default.useMemo(()=>{
|
|
265
|
-
if (!pagesRouter) {
|
|
266
|
-
const resolvedHref = formatStringOrUrl(hrefProp);
|
|
267
|
-
return {
|
|
268
|
-
href: resolvedHref,
|
|
269
|
-
as: asProp ? formatStringOrUrl(asProp) : resolvedHref
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
const [resolvedHref, resolvedAs] = (0, _resolveHref).resolveHref(pagesRouter, hrefProp, true);
|
|
273
|
-
return {
|
|
274
|
-
href: resolvedHref,
|
|
275
|
-
as: asProp ? (0, _resolveHref).resolveHref(pagesRouter, asProp) : resolvedAs || resolvedHref
|
|
276
|
-
};
|
|
277
|
-
}, [
|
|
278
|
-
pagesRouter,
|
|
279
|
-
hrefProp,
|
|
280
|
-
asProp
|
|
281
|
-
]);
|
|
282
|
-
const previousHref = _react.default.useRef(href);
|
|
283
|
-
const previousAs = _react.default.useRef(as);
|
|
284
|
-
// This will return the first child, if multiple are provided it will throw an error
|
|
285
|
-
let child;
|
|
286
|
-
if (legacyBehavior) {
|
|
287
|
-
if (false) {} else {
|
|
288
|
-
child = _react.default.Children.only(children);
|
|
289
|
-
}
|
|
290
|
-
} else {
|
|
291
|
-
if (false) { var ref; }
|
|
292
|
-
}
|
|
293
|
-
const childRef = legacyBehavior ? child && typeof child === "object" && child.ref : forwardedRef;
|
|
294
|
-
const [setIntersectionRef, isVisible, resetVisible] = (0, _useIntersection).useIntersection({
|
|
295
|
-
rootMargin: "200px"
|
|
296
|
-
});
|
|
297
|
-
const setRef = _react.default.useCallback((el)=>{
|
|
298
|
-
// Before the link getting observed, check if visible state need to be reset
|
|
299
|
-
if (previousAs.current !== as || previousHref.current !== href) {
|
|
300
|
-
resetVisible();
|
|
301
|
-
previousAs.current = as;
|
|
302
|
-
previousHref.current = href;
|
|
303
|
-
}
|
|
304
|
-
setIntersectionRef(el);
|
|
305
|
-
if (childRef) {
|
|
306
|
-
if (typeof childRef === "function") childRef(el);
|
|
307
|
-
else if (typeof childRef === "object") {
|
|
308
|
-
childRef.current = el;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
}, [
|
|
312
|
-
as,
|
|
313
|
-
childRef,
|
|
314
|
-
href,
|
|
315
|
-
resetVisible,
|
|
316
|
-
setIntersectionRef
|
|
317
|
-
]);
|
|
318
|
-
// Prefetch the URL if we haven't already and it's visible.
|
|
319
|
-
_react.default.useEffect(()=>{
|
|
320
|
-
// in dev, we only prefetch on hover to avoid wasting resources as the prefetch will trigger compiling the page.
|
|
321
|
-
if (false) {}
|
|
322
|
-
if (!router) {
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
// If we don't need to prefetch the URL, don't do prefetch.
|
|
326
|
-
if (!isVisible || !prefetchEnabled) {
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
// Prefetch the URL.
|
|
330
|
-
prefetch(router, href, as, {
|
|
331
|
-
locale
|
|
332
|
-
}, isAppRouter);
|
|
333
|
-
}, [
|
|
334
|
-
as,
|
|
335
|
-
href,
|
|
336
|
-
isVisible,
|
|
337
|
-
locale,
|
|
338
|
-
prefetchEnabled,
|
|
339
|
-
pagesRouter == null ? void 0 : pagesRouter.locale,
|
|
340
|
-
router,
|
|
341
|
-
isAppRouter
|
|
342
|
-
]);
|
|
343
|
-
const childProps = {
|
|
344
|
-
ref: setRef,
|
|
345
|
-
onClick (e) {
|
|
346
|
-
if (false) {}
|
|
347
|
-
if (!legacyBehavior && typeof onClick === "function") {
|
|
348
|
-
onClick(e);
|
|
349
|
-
}
|
|
350
|
-
if (legacyBehavior && child.props && typeof child.props.onClick === "function") {
|
|
351
|
-
child.props.onClick(e);
|
|
352
|
-
}
|
|
353
|
-
if (!router) {
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
if (e.defaultPrevented) {
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled);
|
|
360
|
-
},
|
|
361
|
-
onMouseEnter (e) {
|
|
362
|
-
if (!legacyBehavior && typeof onMouseEnterProp === "function") {
|
|
363
|
-
onMouseEnterProp(e);
|
|
364
|
-
}
|
|
365
|
-
if (legacyBehavior && child.props && typeof child.props.onMouseEnter === "function") {
|
|
366
|
-
child.props.onMouseEnter(e);
|
|
367
|
-
}
|
|
368
|
-
if (!router) {
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
if (!prefetchEnabled && isAppRouter) {
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
prefetch(router, href, as, {
|
|
375
|
-
locale,
|
|
376
|
-
priority: true,
|
|
377
|
-
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
|
|
378
|
-
bypassPrefetchedCheck: true
|
|
379
|
-
}, isAppRouter);
|
|
380
|
-
},
|
|
381
|
-
onTouchStart (e) {
|
|
382
|
-
if (!legacyBehavior && typeof onTouchStartProp === "function") {
|
|
383
|
-
onTouchStartProp(e);
|
|
384
|
-
}
|
|
385
|
-
if (legacyBehavior && child.props && typeof child.props.onTouchStart === "function") {
|
|
386
|
-
child.props.onTouchStart(e);
|
|
387
|
-
}
|
|
388
|
-
if (!router) {
|
|
389
|
-
return;
|
|
390
|
-
}
|
|
391
|
-
if (!prefetchEnabled && isAppRouter) {
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
prefetch(router, href, as, {
|
|
395
|
-
locale,
|
|
396
|
-
priority: true,
|
|
397
|
-
// @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
|
|
398
|
-
bypassPrefetchedCheck: true
|
|
399
|
-
}, isAppRouter);
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
// If child is an <a> tag and doesn't have a href attribute, or if the 'passHref' property is
|
|
403
|
-
// defined, we specify the current 'href', so that repetition is not needed by the user.
|
|
404
|
-
// If the url is absolute, we can bypass the logic to prepend the domain and locale.
|
|
405
|
-
if ((0, _utils).isAbsoluteUrl(as)) {
|
|
406
|
-
childProps.href = as;
|
|
407
|
-
} else if (!legacyBehavior || passHref || child.type === "a" && !("href" in child.props)) {
|
|
408
|
-
const curLocale = typeof locale !== "undefined" ? locale : pagesRouter == null ? void 0 : pagesRouter.locale;
|
|
409
|
-
// we only render domain locales if we are currently on a domain locale
|
|
410
|
-
// so that locale links are still visitable in development/preview envs
|
|
411
|
-
const localeDomain = (pagesRouter == null ? void 0 : pagesRouter.isLocaleDomain) && (0, _getDomainLocale).getDomainLocale(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.locales, pagesRouter == null ? void 0 : pagesRouter.domainLocales);
|
|
412
|
-
childProps.href = localeDomain || (0, _addBasePath).addBasePath((0, _addLocale).addLocale(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.defaultLocale));
|
|
413
|
-
}
|
|
414
|
-
return legacyBehavior ? /*#__PURE__*/ _react.default.cloneElement(child, childProps) : /*#__PURE__*/ _react.default.createElement("a", Object.assign({}, restProps, childProps), children);
|
|
415
|
-
});
|
|
416
|
-
var _default = Link;
|
|
417
|
-
exports["default"] = _default;
|
|
418
|
-
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
419
|
-
Object.defineProperty(exports.default, "__esModule", {
|
|
420
|
-
value: true
|
|
421
|
-
});
|
|
422
|
-
Object.assign(exports.default, exports);
|
|
423
|
-
module.exports = exports.default;
|
|
424
|
-
} //# sourceMappingURL=link.js.map
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
/***/ }),
|
|
428
|
-
|
|
429
|
-
/***/ 82387:
|
|
430
|
-
/***/ ((module, exports, __webpack_require__) => {
|
|
431
|
-
|
|
432
|
-
"use strict";
|
|
433
|
-
|
|
434
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
435
|
-
value: true
|
|
436
|
-
}));
|
|
437
|
-
exports.normalizePathTrailingSlash = void 0;
|
|
438
|
-
var _removeTrailingSlash = __webpack_require__(93297);
|
|
439
|
-
var _parsePath = __webpack_require__(28854);
|
|
440
|
-
const normalizePathTrailingSlash = (path)=>{
|
|
441
|
-
if (!path.startsWith("/") || undefined) {
|
|
442
|
-
return path;
|
|
443
|
-
}
|
|
444
|
-
const { pathname , query , hash } = (0, _parsePath).parsePath(path);
|
|
445
|
-
if (false) {}
|
|
446
|
-
return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;
|
|
447
|
-
};
|
|
448
|
-
exports.normalizePathTrailingSlash = normalizePathTrailingSlash;
|
|
449
|
-
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
450
|
-
Object.defineProperty(exports.default, "__esModule", {
|
|
451
|
-
value: true
|
|
452
|
-
});
|
|
453
|
-
Object.assign(exports.default, exports);
|
|
454
|
-
module.exports = exports.default;
|
|
455
|
-
} //# sourceMappingURL=normalize-trailing-slash.js.map
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
/***/ }),
|
|
459
|
-
|
|
460
|
-
/***/ 10029:
|
|
461
|
-
/***/ ((module, exports) => {
|
|
462
|
-
|
|
463
|
-
"use strict";
|
|
464
|
-
|
|
465
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
466
|
-
value: true
|
|
467
|
-
}));
|
|
468
|
-
exports.cancelIdleCallback = exports.requestIdleCallback = void 0;
|
|
469
|
-
const requestIdleCallback = typeof self !== "undefined" && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
|
|
470
|
-
let start = Date.now();
|
|
471
|
-
return self.setTimeout(function() {
|
|
472
|
-
cb({
|
|
473
|
-
didTimeout: false,
|
|
474
|
-
timeRemaining: function() {
|
|
475
|
-
return Math.max(0, 50 - (Date.now() - start));
|
|
476
|
-
}
|
|
477
|
-
});
|
|
478
|
-
}, 1);
|
|
479
|
-
};
|
|
480
|
-
exports.requestIdleCallback = requestIdleCallback;
|
|
481
|
-
const cancelIdleCallback = typeof self !== "undefined" && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
|
|
482
|
-
return clearTimeout(id);
|
|
483
|
-
};
|
|
484
|
-
exports.cancelIdleCallback = cancelIdleCallback;
|
|
485
|
-
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
486
|
-
Object.defineProperty(exports.default, "__esModule", {
|
|
487
|
-
value: true
|
|
488
|
-
});
|
|
489
|
-
Object.assign(exports.default, exports);
|
|
490
|
-
module.exports = exports.default;
|
|
491
|
-
} //# sourceMappingURL=request-idle-callback.js.map
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
/***/ }),
|
|
495
|
-
|
|
496
|
-
/***/ 80508:
|
|
497
|
-
/***/ ((module, exports, __webpack_require__) => {
|
|
498
|
-
|
|
499
|
-
"use strict";
|
|
500
|
-
|
|
501
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
502
|
-
value: true
|
|
503
|
-
}));
|
|
504
|
-
exports.useIntersection = useIntersection;
|
|
505
|
-
var _react = __webpack_require__(16689);
|
|
506
|
-
var _requestIdleCallback = __webpack_require__(10029);
|
|
507
|
-
const hasIntersectionObserver = typeof IntersectionObserver === "function";
|
|
508
|
-
const observers = new Map();
|
|
509
|
-
const idList = [];
|
|
510
|
-
function createObserver(options) {
|
|
511
|
-
const id = {
|
|
512
|
-
root: options.root || null,
|
|
513
|
-
margin: options.rootMargin || ""
|
|
514
|
-
};
|
|
515
|
-
const existing = idList.find((obj)=>obj.root === id.root && obj.margin === id.margin);
|
|
516
|
-
let instance;
|
|
517
|
-
if (existing) {
|
|
518
|
-
instance = observers.get(existing);
|
|
519
|
-
if (instance) {
|
|
520
|
-
return instance;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
const elements = new Map();
|
|
524
|
-
const observer = new IntersectionObserver((entries)=>{
|
|
525
|
-
entries.forEach((entry)=>{
|
|
526
|
-
const callback = elements.get(entry.target);
|
|
527
|
-
const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
|
|
528
|
-
if (callback && isVisible) {
|
|
529
|
-
callback(isVisible);
|
|
530
|
-
}
|
|
531
|
-
});
|
|
532
|
-
}, options);
|
|
533
|
-
instance = {
|
|
534
|
-
id,
|
|
535
|
-
observer,
|
|
536
|
-
elements
|
|
537
|
-
};
|
|
538
|
-
idList.push(id);
|
|
539
|
-
observers.set(id, instance);
|
|
540
|
-
return instance;
|
|
541
|
-
}
|
|
542
|
-
function observe(element, callback, options) {
|
|
543
|
-
const { id , observer , elements } = createObserver(options);
|
|
544
|
-
elements.set(element, callback);
|
|
545
|
-
observer.observe(element);
|
|
546
|
-
return function unobserve() {
|
|
547
|
-
elements.delete(element);
|
|
548
|
-
observer.unobserve(element);
|
|
549
|
-
// Destroy observer when there's nothing left to watch:
|
|
550
|
-
if (elements.size === 0) {
|
|
551
|
-
observer.disconnect();
|
|
552
|
-
observers.delete(id);
|
|
553
|
-
const index = idList.findIndex((obj)=>obj.root === id.root && obj.margin === id.margin);
|
|
554
|
-
if (index > -1) {
|
|
555
|
-
idList.splice(index, 1);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
function useIntersection({ rootRef , rootMargin , disabled }) {
|
|
561
|
-
const isDisabled = disabled || !hasIntersectionObserver;
|
|
562
|
-
const [visible, setVisible] = (0, _react).useState(false);
|
|
563
|
-
const elementRef = (0, _react).useRef(null);
|
|
564
|
-
const setElement = (0, _react).useCallback((element)=>{
|
|
565
|
-
elementRef.current = element;
|
|
566
|
-
}, []);
|
|
567
|
-
(0, _react).useEffect(()=>{
|
|
568
|
-
if (hasIntersectionObserver) {
|
|
569
|
-
if (isDisabled || visible) return;
|
|
570
|
-
const element = elementRef.current;
|
|
571
|
-
if (element && element.tagName) {
|
|
572
|
-
const unobserve = observe(element, (isVisible)=>isVisible && setVisible(isVisible), {
|
|
573
|
-
root: rootRef == null ? void 0 : rootRef.current,
|
|
574
|
-
rootMargin
|
|
575
|
-
});
|
|
576
|
-
return unobserve;
|
|
577
|
-
}
|
|
578
|
-
} else {
|
|
579
|
-
if (!visible) {
|
|
580
|
-
const idleCallback = (0, _requestIdleCallback).requestIdleCallback(()=>setVisible(true));
|
|
581
|
-
return ()=>(0, _requestIdleCallback).cancelIdleCallback(idleCallback);
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
585
|
-
}, [
|
|
586
|
-
isDisabled,
|
|
587
|
-
rootMargin,
|
|
588
|
-
rootRef,
|
|
589
|
-
visible,
|
|
590
|
-
elementRef.current
|
|
591
|
-
]);
|
|
592
|
-
const resetVisible = (0, _react).useCallback(()=>{
|
|
593
|
-
setVisible(false);
|
|
594
|
-
}, []);
|
|
595
|
-
return [
|
|
596
|
-
setElement,
|
|
597
|
-
visible,
|
|
598
|
-
resetVisible
|
|
599
|
-
];
|
|
600
|
-
}
|
|
601
|
-
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
602
|
-
Object.defineProperty(exports.default, "__esModule", {
|
|
603
|
-
value: true
|
|
604
|
-
});
|
|
605
|
-
Object.assign(exports.default, exports);
|
|
606
|
-
module.exports = exports.default;
|
|
607
|
-
} //# sourceMappingURL=use-intersection.js.map
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
/***/ }),
|
|
611
|
-
|
|
612
|
-
/***/ 41664:
|
|
613
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
614
|
-
|
|
615
|
-
module.exports = __webpack_require__(95569)
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
/***/ })
|
|
619
|
-
|
|
620
|
-
};
|
|
621
|
-
;
|