proto-sudoku-wc 0.0.636 → 0.0.637
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/dist/cjs/{index-a880b2c7.js → index-9ad18987.js} +4 -8
- package/dist/cjs/loader.cjs.js +1 -10
- package/dist/cjs/proto-sudoku-wc.cjs.js +2 -5
- package/dist/cjs/proto-sudoku.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/proto-sudoku/alert.js +3 -3
- package/dist/collection/components/proto-sudoku/alerts.js +3 -3
- package/dist/collection/components/proto-sudoku/alien.js +1 -1
- package/dist/collection/components/proto-sudoku/button.js +2 -2
- package/dist/collection/components/proto-sudoku/cell.js +2 -2
- package/dist/collection/components/proto-sudoku/eswat2-io.js +2 -2
- package/dist/collection/components/proto-sudoku/fingerprint.js +1 -1
- package/dist/collection/components/proto-sudoku/header.js +2 -2
- package/dist/collection/components/proto-sudoku/keys.js +3 -3
- package/dist/collection/components/proto-sudoku/proto-sudoku.css +77 -63
- package/dist/collection/components/proto-sudoku/proto-sudoku.js +8 -8
- package/dist/collection/components/proto-sudoku/spinner.js +2 -2
- package/dist/collection/components/proto-sudoku/sudoku-board.js +3 -3
- package/dist/collection/components/proto-sudoku/tool-bar.js +4 -4
- package/dist/collection/components/proto-sudoku/tw-label.js +2 -2
- package/dist/collection/utils/store.js +3 -3
- package/dist/esm/{index-90f8475e.js → index-e3a0f2dc.js} +4 -8
- package/dist/esm/loader.js +2 -11
- package/dist/esm/proto-sudoku-wc.js +3 -6
- package/dist/esm/proto-sudoku.entry.js +2 -2
- package/dist/proto-sudoku-wc/{p-28a3c7ec.js → p-6b56583e.js} +1 -1
- package/dist/proto-sudoku-wc/{p-5a38af9d.entry.js → p-d31b59de.entry.js} +2 -2
- package/dist/proto-sudoku-wc/proto-sudoku-wc.esm.js +1 -1
- package/package.json +7 -7
- package/dist/esm/polyfills/css-shim.js +0 -1
@@ -299,9 +299,9 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
299
299
|
}
|
300
300
|
styles.set(scopeId, style);
|
301
301
|
};
|
302
|
-
const addStyle = (styleContainerNode, cmpMeta, mode
|
302
|
+
const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
303
303
|
var _a;
|
304
|
-
|
304
|
+
const scopeId = getScopeId(cmpMeta);
|
305
305
|
const style = styles.get(scopeId);
|
306
306
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
307
307
|
// so the fallback is to always use the document for the root node in those cases
|
@@ -316,11 +316,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
316
316
|
}
|
317
317
|
if (!appliedStyles.has(scopeId)) {
|
318
318
|
{
|
319
|
-
|
320
|
-
|
321
|
-
styleElm = doc.createElement('style');
|
322
|
-
styleElm.innerHTML = style;
|
323
|
-
}
|
319
|
+
styleElm = doc.createElement('style');
|
320
|
+
styleElm.innerHTML = style;
|
324
321
|
// Apply CSP nonce to the style tag if it exists
|
325
322
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
326
323
|
if (nonce != null) {
|
@@ -345,7 +342,6 @@ const attachStyles = (hostRef) => {
|
|
345
342
|
const flags = cmpMeta.$flags$;
|
346
343
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
347
344
|
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
348
|
-
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
349
345
|
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
350
346
|
// only required when we're NOT using native shadow dom (slot)
|
351
347
|
// or this browser doesn't support native shadow dom
|
package/dist/cjs/loader.cjs.js
CHANGED
@@ -2,20 +2,11 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
6
|
-
|
7
|
-
/*
|
8
|
-
Stencil Client Patch Esm v3.4.0 | MIT Licensed | https://stenciljs.com
|
9
|
-
*/
|
10
|
-
const patchEsm = () => {
|
11
|
-
return index.promiseResolve();
|
12
|
-
};
|
5
|
+
const index = require('./index-9ad18987.js');
|
13
6
|
|
14
7
|
const defineCustomElements = (win, options) => {
|
15
8
|
if (typeof window === 'undefined') return Promise.resolve();
|
16
|
-
return patchEsm().then(() => {
|
17
9
|
return index.bootstrapLazy([["proto-sudoku.cjs",[[1,"proto-sudoku",{"tag":[1],"platform":[1]}]]]], options);
|
18
|
-
});
|
19
10
|
};
|
20
11
|
|
21
12
|
exports.setNonce = index.setNonce;
|
@@ -2,19 +2,16 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
5
|
+
const index = require('./index-9ad18987.js');
|
6
6
|
|
7
7
|
/*
|
8
|
-
Stencil Client Patch Browser
|
8
|
+
Stencil Client Patch Browser v4.0.1 | MIT Licensed | https://stenciljs.com
|
9
9
|
*/
|
10
10
|
const patchBrowser = () => {
|
11
11
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('proto-sudoku-wc.cjs.js', document.baseURI).href));
|
12
12
|
const opts = {};
|
13
|
-
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
14
13
|
if (importMeta !== '') {
|
15
14
|
opts.resourcesUrl = new URL('.', importMeta).href;
|
16
|
-
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
17
|
-
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
18
15
|
}
|
19
16
|
return index.promiseResolve(opts);
|
20
17
|
};
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
5
|
+
const index = require('./index-9ad18987.js');
|
6
6
|
|
7
7
|
const Alien = props => {
|
8
8
|
const hex = props.hex || 'currentColor';
|
@@ -1212,7 +1212,7 @@ const ToolBar = _props => {
|
|
1212
1212
|
index.h(TwLabel, null)));
|
1213
1213
|
};
|
1214
1214
|
|
1215
|
-
const protoSudokuCss = "*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.ds1-main{margin:1.5rem;display:flex;flex-direction:column;font-family:ui-sans-serif
|
1215
|
+
const protoSudokuCss = "*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.ds1-main{margin:1.5rem;display:flex;flex-direction:column;font-family:ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n 'Helvetica Neue',\n Arial,\n 'Noto Sans',\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol',\n 'Noto Color Emoji';color:var(--clrs-navy, #001f3f);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.absolute{position:absolute}.relative{position:relative}.right-0{right:0px}.top-0{top:0px}.mb-11{margin-bottom:2.75rem}.ml-0{margin-left:0px}.ml-auto{margin-left:auto}.mr-0{margin-right:0px}.mr-1{margin-right:0.25rem}.mr-2{margin-right:0.5rem}.mt-11{margin-top:2.75rem}.mt-2{margin-top:0.5rem}.mt-5{margin-top:1.25rem}.flex{display:flex}.h-24px{height:24px}.h-76p5{height:19.125rem}.h-8{height:2rem}.w-76p5{width:19.125rem}.w-8{width:2rem}.max-w-min{max-width:-moz-min-content;max-width:min-content}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.rounded-md{border-radius:0.375rem}.border{border-width:1px}.border-solid{border-style:solid}.border-clrs-gray{border-color:var(--clrs-gray, #aaaaaa)}.border-clrs-navy{border-color:var(--clrs-navy, #001f3f)}.border-clrs-red{border-color:var(--clrs-red, #ff4136)}.border-clrs-slate4{border-color:var(--clrs-slate4, #4e5964)}.bg-clrs-green-a50{background-color:var(--clrs-green-a50, #2ecc4050)}.bg-clrs-navy{background-color:var(--clrs-navy, #001f3f)}.bg-clrs-red{background-color:var(--clrs-red, #ff4136)}.bg-clrs-red-a50{background-color:var(--clrs-red-a50, #ff413650)}.bg-clrs-silver{background-color:var(--clrs-silver, #dddddd)}.bg-clrs-slate4{background-color:var(--clrs-slate4, #4e5964)}.bg-clrs-yellow{background-color:var(--clrs-yellow, #ffdc00)}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.p-0{padding:0px}.p-0\\.5{padding:0.125rem}.px-2{padding-left:0.5rem;padding-right:0.5rem}.px-3{padding-left:0.75rem;padding-right:0.75rem}.py-1{padding-top:0.25rem;padding-bottom:0.25rem}.py-2{padding-top:0.5rem;padding-bottom:0.5rem}.text-center{text-align:center}.align-top{vertical-align:top}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xs{font-size:0.75rem;line-height:1rem}.font-bold{font-weight:700}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-8{line-height:2rem}.text-clrs-gray{color:var(--clrs-gray, #aaaaaa)}.text-clrs-navy{color:var(--clrs-navy, #001f3f)}.text-clrs-red{color:var(--clrs-red, #ff4136)}.text-clrs-slate4{color:var(--clrs-slate4, #4e5964)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity))}.opacity-25{opacity:0.25}.opacity-75{opacity:0.75}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),\n 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.border-xbb-clrs-navy{border-bottom:1px solid var(--clrs-navy, #001f3f) !important}.border-xbt-clrs-navy{border-top:1px solid var(--clrs-navy, #001f3f) !important}.border-xbl-clrs-navy{border-left:1px solid var(--clrs-navy, #001f3f) !important}.border-xbr-clrs-navy{border-right:1px solid var(--clrs-navy, #001f3f) !important}.hover\\:text-clrs-navy:hover{color:var(--clrs-navy, #001f3f)}";
|
1216
1216
|
|
1217
1217
|
const ProtoSudoku = class {
|
1218
1218
|
constructor(hostRef) {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"entries": [
|
3
|
-
"
|
3
|
+
"components/proto-sudoku/proto-sudoku.js"
|
4
4
|
],
|
5
5
|
"compiler": {
|
6
6
|
"name": "@stencil/core",
|
7
|
-
"version": "
|
7
|
+
"version": "4.0.1",
|
8
8
|
"typescriptVersion": "5.0.4"
|
9
9
|
},
|
10
10
|
"collections": [],
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { h } from
|
2
|
-
import { Alien } from
|
3
|
-
import { Spinner } from
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { Alien } from "./alien";
|
3
|
+
import { Spinner } from "./spinner";
|
4
4
|
const Alert = props => {
|
5
5
|
const { message, salute, spinner = false } = props;
|
6
6
|
return (h("div", { class: "mt-5 flex h-24px flex-row items-center" }, spinner ? h(Spinner, { class: "mr-2" }) : h(Alien, { class: "mr-2" }), salute ? h("label", { class: "mr-1 font-bold" }, salute, ":") : '', h("label", { class: "italic" }, message)));
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { h } from
|
2
|
-
import { Alert } from
|
3
|
-
import { state } from
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { Alert } from "./alert";
|
3
|
+
import { state } from "../../utils";
|
4
4
|
const Alerts = _props => {
|
5
5
|
const { solved, loading, error } = state;
|
6
6
|
const play = !loading && !error && !solved;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { h } from
|
2
|
-
import { tw, CHECK, NEW_PUZZLE, DELETE } from
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { tw, CHECK, NEW_PUZZLE, DELETE } from "../../utils";
|
3
3
|
const Button = props => {
|
4
4
|
const { label, callback, matched = false } = props;
|
5
5
|
return (h("button", { class: tw('rounded-md border border-solid border-clrs-slate4 font-bold', label === CHECK
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { h } from
|
2
|
-
import { actions, tw } from
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { actions, tw } from "../../utils";
|
3
3
|
// NOTE: building indx mapping for the border highlighting...
|
4
4
|
const borderRight = [
|
5
5
|
2, 5, 11, 14, 20, 23, 29, 32, 38, 41, 47, 50, 56, 59, 65, 68, 74, 77,
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { h } from
|
2
|
-
import { tw } from
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { tw } from "../../utils";
|
3
3
|
const Header = (_props, children) => {
|
4
4
|
return (h("h1", { class: tw('text-center uppercase text-clrs-red', 'mb-11 ml-0 mr-0 mt-11', 'text-6xl font-thin') }, children));
|
5
5
|
};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { h } from
|
2
|
-
import { Button } from
|
3
|
-
import { actions, state, DELETE } from
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { Button } from "./button";
|
3
|
+
import { actions, state, DELETE } from "../../utils";
|
4
4
|
const Keys = _props => {
|
5
5
|
const { keys, list, pick, solved } = state;
|
6
6
|
const genHandler = (key) => {
|
@@ -10,19 +10,19 @@
|
|
10
10
|
--tw-skew-y: 0;
|
11
11
|
--tw-scale-x: 1;
|
12
12
|
--tw-scale-y: 1;
|
13
|
-
--tw-pan-x:
|
14
|
-
--tw-pan-y:
|
15
|
-
--tw-pinch-zoom:
|
13
|
+
--tw-pan-x: ;
|
14
|
+
--tw-pan-y: ;
|
15
|
+
--tw-pinch-zoom: ;
|
16
16
|
--tw-scroll-snap-strictness: proximity;
|
17
|
-
--tw-gradient-from-position:
|
18
|
-
--tw-gradient-via-position:
|
19
|
-
--tw-gradient-to-position:
|
20
|
-
--tw-ordinal:
|
21
|
-
--tw-slashed-zero:
|
22
|
-
--tw-numeric-figure:
|
23
|
-
--tw-numeric-spacing:
|
24
|
-
--tw-numeric-fraction:
|
25
|
-
--tw-ring-inset:
|
17
|
+
--tw-gradient-from-position: ;
|
18
|
+
--tw-gradient-via-position: ;
|
19
|
+
--tw-gradient-to-position: ;
|
20
|
+
--tw-ordinal: ;
|
21
|
+
--tw-slashed-zero: ;
|
22
|
+
--tw-numeric-figure: ;
|
23
|
+
--tw-numeric-spacing: ;
|
24
|
+
--tw-numeric-fraction: ;
|
25
|
+
--tw-ring-inset: ;
|
26
26
|
--tw-ring-offset-width: 0px;
|
27
27
|
--tw-ring-offset-color: #fff;
|
28
28
|
--tw-ring-color: rgb(59 130 246 / 0.5);
|
@@ -30,24 +30,25 @@
|
|
30
30
|
--tw-ring-shadow: 0 0 #0000;
|
31
31
|
--tw-shadow: 0 0 #0000;
|
32
32
|
--tw-shadow-colored: 0 0 #0000;
|
33
|
-
--tw-blur:
|
34
|
-
--tw-brightness:
|
35
|
-
--tw-contrast:
|
36
|
-
--tw-grayscale:
|
37
|
-
--tw-hue-rotate:
|
38
|
-
--tw-invert:
|
39
|
-
--tw-saturate:
|
40
|
-
--tw-sepia:
|
41
|
-
--tw-drop-shadow:
|
42
|
-
--tw-backdrop-blur:
|
43
|
-
--tw-backdrop-brightness:
|
44
|
-
--tw-backdrop-contrast:
|
45
|
-
--tw-backdrop-grayscale:
|
46
|
-
--tw-backdrop-hue-rotate:
|
47
|
-
--tw-backdrop-invert:
|
48
|
-
--tw-backdrop-opacity:
|
49
|
-
--tw-backdrop-saturate:
|
50
|
-
--tw-backdrop-sepia:
|
33
|
+
--tw-blur: ;
|
34
|
+
--tw-brightness: ;
|
35
|
+
--tw-contrast: ;
|
36
|
+
--tw-grayscale: ;
|
37
|
+
--tw-hue-rotate: ;
|
38
|
+
--tw-invert: ;
|
39
|
+
--tw-saturate: ;
|
40
|
+
--tw-sepia: ;
|
41
|
+
--tw-drop-shadow: ;
|
42
|
+
--tw-backdrop-blur: ;
|
43
|
+
--tw-backdrop-brightness: ;
|
44
|
+
--tw-backdrop-contrast: ;
|
45
|
+
--tw-backdrop-grayscale: ;
|
46
|
+
--tw-backdrop-hue-rotate: ;
|
47
|
+
--tw-backdrop-invert: ;
|
48
|
+
--tw-backdrop-opacity: ;
|
49
|
+
--tw-backdrop-saturate: ;
|
50
|
+
--tw-backdrop-sepia:
|
51
|
+
;
|
51
52
|
}
|
52
53
|
|
53
54
|
::backdrop {
|
@@ -60,19 +61,19 @@
|
|
60
61
|
--tw-skew-y: 0;
|
61
62
|
--tw-scale-x: 1;
|
62
63
|
--tw-scale-y: 1;
|
63
|
-
--tw-pan-x:
|
64
|
-
--tw-pan-y:
|
65
|
-
--tw-pinch-zoom:
|
64
|
+
--tw-pan-x: ;
|
65
|
+
--tw-pan-y: ;
|
66
|
+
--tw-pinch-zoom: ;
|
66
67
|
--tw-scroll-snap-strictness: proximity;
|
67
|
-
--tw-gradient-from-position:
|
68
|
-
--tw-gradient-via-position:
|
69
|
-
--tw-gradient-to-position:
|
70
|
-
--tw-ordinal:
|
71
|
-
--tw-slashed-zero:
|
72
|
-
--tw-numeric-figure:
|
73
|
-
--tw-numeric-spacing:
|
74
|
-
--tw-numeric-fraction:
|
75
|
-
--tw-ring-inset:
|
68
|
+
--tw-gradient-from-position: ;
|
69
|
+
--tw-gradient-via-position: ;
|
70
|
+
--tw-gradient-to-position: ;
|
71
|
+
--tw-ordinal: ;
|
72
|
+
--tw-slashed-zero: ;
|
73
|
+
--tw-numeric-figure: ;
|
74
|
+
--tw-numeric-spacing: ;
|
75
|
+
--tw-numeric-fraction: ;
|
76
|
+
--tw-ring-inset: ;
|
76
77
|
--tw-ring-offset-width: 0px;
|
77
78
|
--tw-ring-offset-color: #fff;
|
78
79
|
--tw-ring-color: rgb(59 130 246 / 0.5);
|
@@ -80,33 +81,46 @@
|
|
80
81
|
--tw-ring-shadow: 0 0 #0000;
|
81
82
|
--tw-shadow: 0 0 #0000;
|
82
83
|
--tw-shadow-colored: 0 0 #0000;
|
83
|
-
--tw-blur:
|
84
|
-
--tw-brightness:
|
85
|
-
--tw-contrast:
|
86
|
-
--tw-grayscale:
|
87
|
-
--tw-hue-rotate:
|
88
|
-
--tw-invert:
|
89
|
-
--tw-saturate:
|
90
|
-
--tw-sepia:
|
91
|
-
--tw-drop-shadow:
|
92
|
-
--tw-backdrop-blur:
|
93
|
-
--tw-backdrop-brightness:
|
94
|
-
--tw-backdrop-contrast:
|
95
|
-
--tw-backdrop-grayscale:
|
96
|
-
--tw-backdrop-hue-rotate:
|
97
|
-
--tw-backdrop-invert:
|
98
|
-
--tw-backdrop-opacity:
|
99
|
-
--tw-backdrop-saturate:
|
100
|
-
--tw-backdrop-sepia:
|
84
|
+
--tw-blur: ;
|
85
|
+
--tw-brightness: ;
|
86
|
+
--tw-contrast: ;
|
87
|
+
--tw-grayscale: ;
|
88
|
+
--tw-hue-rotate: ;
|
89
|
+
--tw-invert: ;
|
90
|
+
--tw-saturate: ;
|
91
|
+
--tw-sepia: ;
|
92
|
+
--tw-drop-shadow: ;
|
93
|
+
--tw-backdrop-blur: ;
|
94
|
+
--tw-backdrop-brightness: ;
|
95
|
+
--tw-backdrop-contrast: ;
|
96
|
+
--tw-backdrop-grayscale: ;
|
97
|
+
--tw-backdrop-hue-rotate: ;
|
98
|
+
--tw-backdrop-invert: ;
|
99
|
+
--tw-backdrop-opacity: ;
|
100
|
+
--tw-backdrop-saturate: ;
|
101
|
+
--tw-backdrop-sepia:
|
102
|
+
;
|
101
103
|
}
|
102
104
|
|
103
105
|
.ds1-main {
|
104
106
|
margin: 1.5rem;
|
105
107
|
display: flex;
|
106
108
|
flex-direction: column;
|
107
|
-
font-family:
|
108
|
-
|
109
|
-
|
109
|
+
font-family:
|
110
|
+
ui-sans-serif,
|
111
|
+
system-ui,
|
112
|
+
-apple-system,
|
113
|
+
BlinkMacSystemFont,
|
114
|
+
'Segoe UI',
|
115
|
+
Roboto,
|
116
|
+
'Helvetica Neue',
|
117
|
+
Arial,
|
118
|
+
'Noto Sans',
|
119
|
+
sans-serif,
|
120
|
+
'Apple Color Emoji',
|
121
|
+
'Segoe UI Emoji',
|
122
|
+
'Segoe UI Symbol',
|
123
|
+
'Noto Color Emoji';
|
110
124
|
color: var(--clrs-navy, #001f3f);
|
111
125
|
-webkit-font-smoothing: antialiased;
|
112
126
|
-moz-osx-font-smoothing: grayscale;
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { h } from
|
2
|
-
import { Alerts } from
|
3
|
-
import { Eswat2Io } from
|
4
|
-
import { Header } from
|
5
|
-
import { Keys } from
|
6
|
-
import { SudokuBoard } from
|
7
|
-
import { ToolBar } from
|
8
|
-
import { actions } from
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { Alerts } from "./alerts";
|
3
|
+
import { Eswat2Io } from "./eswat2-io";
|
4
|
+
import { Header } from "./header";
|
5
|
+
import { Keys } from "./keys";
|
6
|
+
import { SudokuBoard } from "./sudoku-board";
|
7
|
+
import { ToolBar } from "./tool-bar";
|
8
|
+
import { actions } from "../../utils";
|
9
9
|
export class ProtoSudoku {
|
10
10
|
constructor() {
|
11
11
|
this.tag = 'proto-sudoku';
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { h } from
|
2
|
-
import { Cell } from
|
3
|
-
import { state, tw } from
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { Cell } from "./cell";
|
3
|
+
import { state, tw } from "../../utils";
|
4
4
|
const SudokuBoard = _props => {
|
5
5
|
const { list, pick, locs, solved } = state;
|
6
6
|
return (h("div", { class: tw('flex flex-row flex-wrap', 'border border-solid border-clrs-navy', 'h-76p5 w-76p5 text-lg') }, list.map((cell, index) => {
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { h } from
|
2
|
-
import { Button } from
|
3
|
-
import { TwLabel } from
|
4
|
-
import { actions, state, CHECK, NEW_PUZZLE } from
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { Button } from "./button";
|
3
|
+
import { TwLabel } from "./tw-label";
|
4
|
+
import { actions, state, CHECK, NEW_PUZZLE } from "../../utils";
|
5
5
|
const handleRefresh = (actions) => {
|
6
6
|
return () => {
|
7
7
|
actions.refresh();
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { h } from
|
2
|
-
import { TW_VERSION } from
|
1
|
+
import { h } from "@stencil/core";
|
2
|
+
import { TW_VERSION } from "../../utils";
|
3
3
|
const TwLabel = _props => {
|
4
4
|
return (h("label", { class: "ml-auto align-top text-xs italic text-clrs-slate4" }, "Tailwind ", TW_VERSION));
|
5
5
|
};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { createStore } from
|
2
|
-
import ky from
|
3
|
-
import { bag } from
|
1
|
+
import { createStore } from "@stencil/store";
|
2
|
+
import ky from "ky";
|
3
|
+
import { bag } from "./bag";
|
4
4
|
// --------------------------------------------------------[ mutable store ]
|
5
5
|
const storeDef = {
|
6
6
|
list: [],
|
@@ -277,9 +277,9 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
277
277
|
}
|
278
278
|
styles.set(scopeId, style);
|
279
279
|
};
|
280
|
-
const addStyle = (styleContainerNode, cmpMeta, mode
|
280
|
+
const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
281
281
|
var _a;
|
282
|
-
|
282
|
+
const scopeId = getScopeId(cmpMeta);
|
283
283
|
const style = styles.get(scopeId);
|
284
284
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
285
285
|
// so the fallback is to always use the document for the root node in those cases
|
@@ -294,11 +294,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
294
294
|
}
|
295
295
|
if (!appliedStyles.has(scopeId)) {
|
296
296
|
{
|
297
|
-
|
298
|
-
|
299
|
-
styleElm = doc.createElement('style');
|
300
|
-
styleElm.innerHTML = style;
|
301
|
-
}
|
297
|
+
styleElm = doc.createElement('style');
|
298
|
+
styleElm.innerHTML = style;
|
302
299
|
// Apply CSP nonce to the style tag if it exists
|
303
300
|
const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
|
304
301
|
if (nonce != null) {
|
@@ -323,7 +320,6 @@ const attachStyles = (hostRef) => {
|
|
323
320
|
const flags = cmpMeta.$flags$;
|
324
321
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
325
322
|
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
326
|
-
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
327
323
|
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
328
324
|
// only required when we're NOT using native shadow dom (slot)
|
329
325
|
// or this browser doesn't support native shadow dom
|
package/dist/esm/loader.js
CHANGED
@@ -1,18 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
export { s as setNonce } from './index-
|
3
|
-
|
4
|
-
/*
|
5
|
-
Stencil Client Patch Esm v3.4.0 | MIT Licensed | https://stenciljs.com
|
6
|
-
*/
|
7
|
-
const patchEsm = () => {
|
8
|
-
return promiseResolve();
|
9
|
-
};
|
1
|
+
import { b as bootstrapLazy } from './index-e3a0f2dc.js';
|
2
|
+
export { s as setNonce } from './index-e3a0f2dc.js';
|
10
3
|
|
11
4
|
const defineCustomElements = (win, options) => {
|
12
5
|
if (typeof window === 'undefined') return Promise.resolve();
|
13
|
-
return patchEsm().then(() => {
|
14
6
|
return bootstrapLazy([["proto-sudoku",[[1,"proto-sudoku",{"tag":[1],"platform":[1]}]]]], options);
|
15
|
-
});
|
16
7
|
};
|
17
8
|
|
18
9
|
export { defineCustomElements };
|
@@ -1,17 +1,14 @@
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
2
|
-
export { s as setNonce } from './index-
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-e3a0f2dc.js';
|
2
|
+
export { s as setNonce } from './index-e3a0f2dc.js';
|
3
3
|
|
4
4
|
/*
|
5
|
-
Stencil Client Patch Browser
|
5
|
+
Stencil Client Patch Browser v4.0.1 | MIT Licensed | https://stenciljs.com
|
6
6
|
*/
|
7
7
|
const patchBrowser = () => {
|
8
8
|
const importMeta = import.meta.url;
|
9
9
|
const opts = {};
|
10
|
-
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
11
10
|
if (importMeta !== '') {
|
12
11
|
opts.resourcesUrl = new URL('.', importMeta).href;
|
13
|
-
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
14
|
-
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
15
12
|
}
|
16
13
|
return promiseResolve(opts);
|
17
14
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { h, g as getRenderingRef, f as forceUpdate, r as registerInstance } from './index-
|
1
|
+
import { h, g as getRenderingRef, f as forceUpdate, r as registerInstance } from './index-e3a0f2dc.js';
|
2
2
|
|
3
3
|
const Alien = props => {
|
4
4
|
const hex = props.hex || 'currentColor';
|
@@ -1208,7 +1208,7 @@ const ToolBar = _props => {
|
|
1208
1208
|
h(TwLabel, null)));
|
1209
1209
|
};
|
1210
1210
|
|
1211
|
-
const protoSudokuCss = "*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.ds1-main{margin:1.5rem;display:flex;flex-direction:column;font-family:ui-sans-serif
|
1211
|
+
const protoSudokuCss = "*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.ds1-main{margin:1.5rem;display:flex;flex-direction:column;font-family:ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n 'Helvetica Neue',\n Arial,\n 'Noto Sans',\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol',\n 'Noto Color Emoji';color:var(--clrs-navy, #001f3f);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.absolute{position:absolute}.relative{position:relative}.right-0{right:0px}.top-0{top:0px}.mb-11{margin-bottom:2.75rem}.ml-0{margin-left:0px}.ml-auto{margin-left:auto}.mr-0{margin-right:0px}.mr-1{margin-right:0.25rem}.mr-2{margin-right:0.5rem}.mt-11{margin-top:2.75rem}.mt-2{margin-top:0.5rem}.mt-5{margin-top:1.25rem}.flex{display:flex}.h-24px{height:24px}.h-76p5{height:19.125rem}.h-8{height:2rem}.w-76p5{width:19.125rem}.w-8{width:2rem}.max-w-min{max-width:-moz-min-content;max-width:min-content}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.rounded-md{border-radius:0.375rem}.border{border-width:1px}.border-solid{border-style:solid}.border-clrs-gray{border-color:var(--clrs-gray, #aaaaaa)}.border-clrs-navy{border-color:var(--clrs-navy, #001f3f)}.border-clrs-red{border-color:var(--clrs-red, #ff4136)}.border-clrs-slate4{border-color:var(--clrs-slate4, #4e5964)}.bg-clrs-green-a50{background-color:var(--clrs-green-a50, #2ecc4050)}.bg-clrs-navy{background-color:var(--clrs-navy, #001f3f)}.bg-clrs-red{background-color:var(--clrs-red, #ff4136)}.bg-clrs-red-a50{background-color:var(--clrs-red-a50, #ff413650)}.bg-clrs-silver{background-color:var(--clrs-silver, #dddddd)}.bg-clrs-slate4{background-color:var(--clrs-slate4, #4e5964)}.bg-clrs-yellow{background-color:var(--clrs-yellow, #ffdc00)}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.p-0{padding:0px}.p-0\\.5{padding:0.125rem}.px-2{padding-left:0.5rem;padding-right:0.5rem}.px-3{padding-left:0.75rem;padding-right:0.75rem}.py-1{padding-top:0.25rem;padding-bottom:0.25rem}.py-2{padding-top:0.5rem;padding-bottom:0.5rem}.text-center{text-align:center}.align-top{vertical-align:top}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xs{font-size:0.75rem;line-height:1rem}.font-bold{font-weight:700}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-8{line-height:2rem}.text-clrs-gray{color:var(--clrs-gray, #aaaaaa)}.text-clrs-navy{color:var(--clrs-navy, #001f3f)}.text-clrs-red{color:var(--clrs-red, #ff4136)}.text-clrs-slate4{color:var(--clrs-slate4, #4e5964)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity))}.opacity-25{opacity:0.25}.opacity-75{opacity:0.75}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),\n 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.border-xbb-clrs-navy{border-bottom:1px solid var(--clrs-navy, #001f3f) !important}.border-xbt-clrs-navy{border-top:1px solid var(--clrs-navy, #001f3f) !important}.border-xbl-clrs-navy{border-left:1px solid var(--clrs-navy, #001f3f) !important}.border-xbr-clrs-navy{border-right:1px solid var(--clrs-navy, #001f3f) !important}.hover\\:text-clrs-navy:hover{color:var(--clrs-navy, #001f3f)}";
|
1212
1212
|
|
1213
1213
|
const ProtoSudoku = class {
|
1214
1214
|
constructor(hostRef) {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
let t,n,e=!1,l=null,o=!1;const s={},r=t=>"object"==(t=typeof t)||"function"===t;function c(t){var n,e,l;return null!==(l=null===(e=null===(n=t.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===e?void 0:e.getAttribute("content"))&&void 0!==l?l:void 0}const i=(t,n,...e)=>{let l=null,o=!1,s=!1;const c=[],i=n=>{for(let e=0;e<n.length;e++)l=n[e],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof t&&!r(l))&&(l+=""),o&&s?c[c.length-1].t+=l:c.push(o?u(null,l):l),s=o)};if(i(e),n){const t=n.className||n.class;t&&(n.class="object"!=typeof t?t:Object.keys(t).filter((n=>t[n])).join(" "))}if("function"==typeof t)return t(null===n?{}:n,c,f);const a=u(t,null);return a.l=n,c.length>0&&(a.o=c),a},u=(t,n)=>({i:0,u:t,t:n,p:null,o:null,l:null}),a={},f={forEach:(t,n)=>t.map(d).forEach(n),map:(t,n)=>t.map(d).map(n).map(p)},d=t=>({vattrs:t.l,vchildren:t.o,vkey:t.h,vname:t.m,vtag:t.u,vtext:t.t}),p=t=>{if("function"==typeof t.vtag){const n=Object.assign({},t.vattrs);return t.vkey&&(n.key=t.vkey),t.vname&&(n.name=t.vname),i(t.vtag,n,...t.vchildren||[])}const n=u(t.vtag,t.vtext);return n.l=t.vattrs,n.o=t.vchildren,n.h=t.vkey,n.m=t.vname,n},h=new WeakMap,y=t=>"sc-"+t.$,m=(t,n,e,l,o,s)=>{if(e!==l){let c=B(t,n),i=n.toLowerCase();if("class"===n){const n=t.classList,o=v(e),s=v(l);n.remove(...o.filter((t=>t&&!s.includes(t)))),n.add(...s.filter((t=>t&&!o.includes(t))))}else if(c||"o"!==n[0]||"n"!==n[1]){const i=r(l);if((c||i&&null!==l)&&!o)try{if(t.tagName.includes("-"))t[n]=l;else{const o=null==l?"":l;"list"===n?c=!1:null!=e&&t[n]==o||(t[n]=o)}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(n)||t.removeAttribute(n):(!c||4&s||o)&&!i&&t.setAttribute(n,l=!0===l?"":l)}else n="-"===n[2]?n.slice(3):B(Q,i)?i.slice(2):i[2]+n.slice(3),e&&Y.rel(t,n,e,!1),l&&Y.ael(t,n,l,!1)}},$=/\s/,v=t=>t?t.split($):[],w=(t,n,e,l)=>{const o=11===n.p.nodeType&&n.p.host?n.p.host:n.p,r=t&&t.l||s,c=n.l||s;for(l in r)l in c||m(o,l,r[l],void 0,e,n.i);for(l in c)m(o,l,r[l],c[l],e,n.i)},b=(n,l,o)=>{const s=l.o[o];let r,c,i=0;if(null!==s.t)r=s.p=X.createTextNode(s.t);else{if(e||(e="svg"===s.u),r=s.p=X.createElementNS(e?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s.u),e&&"foreignObject"===s.u&&(e=!1),w(null,s,e),null!=t&&r["s-si"]!==t&&r.classList.add(r["s-si"]=t),s.o)for(i=0;i<s.o.length;++i)c=b(n,s,i),c&&r.appendChild(c);"svg"===s.u?e=!1:"foreignObject"===r.tagName&&(e=!0)}return r},g=(t,e,l,o,s,r)=>{let c,i=t;for(i.shadowRoot&&i.tagName===n&&(i=i.shadowRoot);s<=r;++s)o[s]&&(c=b(null,l,s),c&&(o[s].p=c,i.insertBefore(c,e)))},j=(t,n,e)=>{for(let l=n;l<=e;++l){const n=t[l];if(n){const t=n.p;t&&t.remove()}}},S=(t,n)=>t.u===n.u,O=(t,n)=>{const l=n.p=t.p,o=t.o,s=n.o,r=n.u,c=n.t;null===c?(e="svg"===r||"foreignObject"!==r&&e,w(t,n,e),null!==o&&null!==s?((t,n,e,l)=>{let o,s=0,r=0,c=n.length-1,i=n[0],u=n[c],a=l.length-1,f=l[0],d=l[a];for(;s<=c&&r<=a;)null==i?i=n[++s]:null==u?u=n[--c]:null==f?f=l[++r]:null==d?d=l[--a]:S(i,f)?(O(i,f),i=n[++s],f=l[++r]):S(u,d)?(O(u,d),u=n[--c],d=l[--a]):S(i,d)?(O(i,d),t.insertBefore(i.p,u.p.nextSibling),i=n[++s],d=l[--a]):S(u,f)?(O(u,f),t.insertBefore(u.p,i.p),u=n[--c],f=l[++r]):(o=b(n&&n[r],e,r),f=l[++r],o&&i.p.parentNode.insertBefore(o,i.p));s>c?g(t,null==l[a+1]?null:l[a+1].p,e,l,r,a):r>a&&j(n,s,c)})(l,o,n,s):null!==s?(null!==t.t&&(l.textContent=""),g(l,null,n,s,0,s.length-1)):null!==o&&j(o,0,o.length-1),e&&"svg"===r&&(e=!1)):t.t!==c&&(l.data=c)},k=(t,n)=>{n&&!t.v&&n["s-p"]&&n["s-p"].push(new Promise((n=>t.v=n)))},M=(t,n)=>{if(t.i|=16,!(4&t.i))return k(t,t.g),ct((()=>C(t,n)));t.i|=512},C=(t,n)=>{const e=t.j;return x(void 0,(()=>E(t,e,n)))},x=(t,n)=>P(t)?t.then(n):n(),P=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,E=async(t,n,e)=>{var l;const o=t.S,s=o["s-rc"];e&&(t=>{const n=t.O,e=t.S,l=n.i,o=((t,n)=>{var e;
|
1
|
+
let t,n,e=!1,l=null,o=!1;const s={},r=t=>"object"==(t=typeof t)||"function"===t;function c(t){var n,e,l;return null!==(l=null===(e=null===(n=t.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===e?void 0:e.getAttribute("content"))&&void 0!==l?l:void 0}const i=(t,n,...e)=>{let l=null,o=!1,s=!1;const c=[],i=n=>{for(let e=0;e<n.length;e++)l=n[e],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof t&&!r(l))&&(l+=""),o&&s?c[c.length-1].t+=l:c.push(o?u(null,l):l),s=o)};if(i(e),n){const t=n.className||n.class;t&&(n.class="object"!=typeof t?t:Object.keys(t).filter((n=>t[n])).join(" "))}if("function"==typeof t)return t(null===n?{}:n,c,f);const a=u(t,null);return a.l=n,c.length>0&&(a.o=c),a},u=(t,n)=>({i:0,u:t,t:n,p:null,o:null,l:null}),a={},f={forEach:(t,n)=>t.map(d).forEach(n),map:(t,n)=>t.map(d).map(n).map(p)},d=t=>({vattrs:t.l,vchildren:t.o,vkey:t.h,vname:t.m,vtag:t.u,vtext:t.t}),p=t=>{if("function"==typeof t.vtag){const n=Object.assign({},t.vattrs);return t.vkey&&(n.key=t.vkey),t.vname&&(n.name=t.vname),i(t.vtag,n,...t.vchildren||[])}const n=u(t.vtag,t.vtext);return n.l=t.vattrs,n.o=t.vchildren,n.h=t.vkey,n.m=t.vname,n},h=new WeakMap,y=t=>"sc-"+t.$,m=(t,n,e,l,o,s)=>{if(e!==l){let c=B(t,n),i=n.toLowerCase();if("class"===n){const n=t.classList,o=v(e),s=v(l);n.remove(...o.filter((t=>t&&!s.includes(t)))),n.add(...s.filter((t=>t&&!o.includes(t))))}else if(c||"o"!==n[0]||"n"!==n[1]){const i=r(l);if((c||i&&null!==l)&&!o)try{if(t.tagName.includes("-"))t[n]=l;else{const o=null==l?"":l;"list"===n?c=!1:null!=e&&t[n]==o||(t[n]=o)}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(n)||t.removeAttribute(n):(!c||4&s||o)&&!i&&t.setAttribute(n,l=!0===l?"":l)}else n="-"===n[2]?n.slice(3):B(Q,i)?i.slice(2):i[2]+n.slice(3),e&&Y.rel(t,n,e,!1),l&&Y.ael(t,n,l,!1)}},$=/\s/,v=t=>t?t.split($):[],w=(t,n,e,l)=>{const o=11===n.p.nodeType&&n.p.host?n.p.host:n.p,r=t&&t.l||s,c=n.l||s;for(l in r)l in c||m(o,l,r[l],void 0,e,n.i);for(l in c)m(o,l,r[l],c[l],e,n.i)},b=(n,l,o)=>{const s=l.o[o];let r,c,i=0;if(null!==s.t)r=s.p=X.createTextNode(s.t);else{if(e||(e="svg"===s.u),r=s.p=X.createElementNS(e?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s.u),e&&"foreignObject"===s.u&&(e=!1),w(null,s,e),null!=t&&r["s-si"]!==t&&r.classList.add(r["s-si"]=t),s.o)for(i=0;i<s.o.length;++i)c=b(n,s,i),c&&r.appendChild(c);"svg"===s.u?e=!1:"foreignObject"===r.tagName&&(e=!0)}return r},g=(t,e,l,o,s,r)=>{let c,i=t;for(i.shadowRoot&&i.tagName===n&&(i=i.shadowRoot);s<=r;++s)o[s]&&(c=b(null,l,s),c&&(o[s].p=c,i.insertBefore(c,e)))},j=(t,n,e)=>{for(let l=n;l<=e;++l){const n=t[l];if(n){const t=n.p;t&&t.remove()}}},S=(t,n)=>t.u===n.u,O=(t,n)=>{const l=n.p=t.p,o=t.o,s=n.o,r=n.u,c=n.t;null===c?(e="svg"===r||"foreignObject"!==r&&e,w(t,n,e),null!==o&&null!==s?((t,n,e,l)=>{let o,s=0,r=0,c=n.length-1,i=n[0],u=n[c],a=l.length-1,f=l[0],d=l[a];for(;s<=c&&r<=a;)null==i?i=n[++s]:null==u?u=n[--c]:null==f?f=l[++r]:null==d?d=l[--a]:S(i,f)?(O(i,f),i=n[++s],f=l[++r]):S(u,d)?(O(u,d),u=n[--c],d=l[--a]):S(i,d)?(O(i,d),t.insertBefore(i.p,u.p.nextSibling),i=n[++s],d=l[--a]):S(u,f)?(O(u,f),t.insertBefore(u.p,i.p),u=n[--c],f=l[++r]):(o=b(n&&n[r],e,r),f=l[++r],o&&i.p.parentNode.insertBefore(o,i.p));s>c?g(t,null==l[a+1]?null:l[a+1].p,e,l,r,a):r>a&&j(n,s,c)})(l,o,n,s):null!==s?(null!==t.t&&(l.textContent=""),g(l,null,n,s,0,s.length-1)):null!==o&&j(o,0,o.length-1),e&&"svg"===r&&(e=!1)):t.t!==c&&(l.data=c)},k=(t,n)=>{n&&!t.v&&n["s-p"]&&n["s-p"].push(new Promise((n=>t.v=n)))},M=(t,n)=>{if(t.i|=16,!(4&t.i))return k(t,t.g),ct((()=>C(t,n)));t.i|=512},C=(t,n)=>{const e=t.j;return x(void 0,(()=>E(t,e,n)))},x=(t,n)=>P(t)?t.then(n):n(),P=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,E=async(t,n,e)=>{var l;const o=t.S,s=o["s-rc"];e&&(t=>{const n=t.O,e=t.S,l=n.i,o=((t,n)=>{var e;const l=y(n),o=K.get(l);if(t=11===t.nodeType?t:X,o)if("string"==typeof o){let n,s=h.get(t=t.head||t);if(s||h.set(t,s=new Set),!s.has(l)){{n=X.createElement("style"),n.innerHTML=o;const l=null!==(e=Y.k)&&void 0!==e?e:c(X);null!=l&&n.setAttribute("nonce",l),t.insertBefore(n,t.querySelector("link"))}s&&s.add(l)}}else t.adoptedStyleSheets.includes(o)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,o]);return l})(e.shadowRoot?e.shadowRoot:e.getRootNode(),n);10&l&&(e["s-sc"]=o,e.classList.add(o+"-h"))})(t);L(t,n),s&&(s.map((t=>t())),o["s-rc"]=void 0);{const n=null!==(l=o["s-p"])&&void 0!==l?l:[],e=()=>T(t);0===n.length?e():(Promise.all(n).then(e),t.i|=4,n.length=0)}},L=(e,o)=>{try{l=o,o=o.render(),e.i&=-17,e.i|=2,((e,l)=>{const o=e.S,s=e.M||u(null,null),r=(t=>t&&t.u===a)(l)?l:i(null,null,l);n=o.tagName,r.u=null,r.i|=4,e.M=r,r.p=s.p=o.shadowRoot||o,t=o["s-sc"],O(s,r)})(e,o)}catch(t){G(t,e.S)}return l=null,null},N=()=>l,T=t=>{const n=t.S,e=t.j,l=t.g;64&t.i||(t.i|=64,W(n),U(e,"componentDidLoad"),t.C(n),l||R()),t.v&&(t.v(),t.v=void 0),512&t.i&&rt((()=>M(t,!1))),t.i&=-517},A=t=>{{const n=V(t),e=n.S.isConnected;return e&&2==(18&n.i)&&M(n,!1),e}},R=()=>{W(X.documentElement),rt((()=>(t=>{const n=Y.ce("appload",{detail:{namespace:"proto-sudoku-wc"}});return t.dispatchEvent(n),n})(Q)))},U=(t,n,e)=>{if(t&&t[n])try{return t[n](e)}catch(t){G(t)}},W=t=>t.classList.add("hydrated"),q=(t,n,e)=>{if(n.P){const l=Object.entries(n.P),o=t.prototype;if(l.map((([t,[l]])=>{(31&l||2&e&&32&l)&&Object.defineProperty(o,t,{get(){return((t,n)=>V(this).L.get(n))(0,t)},set(e){((t,n,e,l)=>{const o=V(t),s=o.L.get(n),c=o.i,i=o.j;e=((t,n)=>null==t||r(t)?t:1&n?t+"":t)(e,l.P[n][0]),8&c&&void 0!==s||e===s||Number.isNaN(s)&&Number.isNaN(e)||(o.L.set(n,e),i&&2==(18&c)&&M(o,!1))})(this,t,e,n)},configurable:!0,enumerable:!0})})),1&e){const n=new Map;o.attributeChangedCallback=function(t,e,l){Y.jmp((()=>{const e=n.get(t);if(this.hasOwnProperty(e))l=this[e],delete this[e];else if(o.hasOwnProperty(e)&&"number"==typeof this[e]&&this[e]==l)return;this[e]=(null!==l||"boolean"!=typeof this[e])&&l}))},t.observedAttributes=l.filter((([t,n])=>15&n[0])).map((([t,e])=>{const l=e[1]||t;return n.set(l,t),l}))}}return t},D=(t,n={})=>{var e;const l=[],o=n.exclude||[],s=Q.customElements,r=X.head,i=r.querySelector("meta[charset]"),u=X.createElement("style"),a=[];let f,d=!0;Object.assign(Y,n),Y.N=new URL(n.resourcesUrl||"./",X.baseURI).href,t.map((t=>{t[1].map((n=>{const e={i:n[0],$:n[1],P:n[2],T:n[3]};e.P=n[2];const r=e.$,c=class extends HTMLElement{constructor(t){super(t),z(t=this,e),1&e.i&&t.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),d?a.push(this):Y.jmp((()=>(t=>{if(0==(1&Y.i)){const n=V(t),e=n.O,l=()=>{};if(!(1&n.i)){n.i|=1;{let e=t;for(;e=e.parentNode||e.host;)if(e["s-p"]){k(n,n.g=e);break}}e.P&&Object.entries(e.P).map((([n,[e]])=>{if(31&e&&t.hasOwnProperty(n)){const e=t[n];delete t[n],t[n]=e}})),(async(t,n,e,l,o)=>{if(0==(32&n.i)){n.i|=32;{if((o=J(e)).then){const t=()=>{};o=await o,t()}o.isProxied||(q(o,e,2),o.isProxied=!0);const t=()=>{};n.i|=8;try{new o(n)}catch(t){G(t)}n.i&=-9,t()}if(o.style){let t=o.style;const n=y(e);if(!K.has(n)){const l=()=>{};((t,n,e)=>{let l=K.get(t);tt&&e?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,K.set(t,l)})(n,t,!!(1&e.i)),l()}}}const s=n.g,r=()=>M(n,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(0,n,e)}l()}})(this)))}disconnectedCallback(){Y.jmp((()=>{}))}componentOnReady(){return V(this).A}};e.R=t[0],o.includes(r)||s.get(r)||(l.push(r),s.define(r,q(c,e,1)))}))}));{u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const t=null!==(e=Y.k)&&void 0!==e?e:c(X);null!=t&&u.setAttribute("nonce",t),r.insertBefore(u,i?i.nextSibling:r.firstChild)}d=!1,a.length?a.map((t=>t.connectedCallback())):Y.jmp((()=>f=setTimeout(R,30)))},F=t=>Y.k=t,H=new WeakMap,V=t=>H.get(t),_=(t,n)=>H.set(n.j=t,n),z=(t,n)=>{const e={i:0,S:t,O:n,L:new Map};return e.A=new Promise((t=>e.C=t)),t["s-p"]=[],t["s-rc"]=[],H.set(t,e)},B=(t,n)=>n in t,G=(t,n)=>(0,console.error)(t,n),I=new Map,J=t=>{const n=t.$.replace(/-/g,"_"),e=t.R,l=I.get(e);return l?l[n]:import(`./${e}.entry.js`).then((t=>(I.set(e,t),t[n])),G)
|
2
2
|
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},K=new Map,Q="undefined"!=typeof window?window:{},X=Q.document||{head:{}},Y={i:0,N:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,n,e,l)=>t.addEventListener(n,e,l),rel:(t,n,e,l)=>t.removeEventListener(n,e,l),ce:(t,n)=>new CustomEvent(t,n)},Z=t=>Promise.resolve(t),tt=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),nt=[],et=[],lt=(t,n)=>e=>{t.push(e),o||(o=!0,n&&4&Y.i?rt(st):Y.raf(st))},ot=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(t){G(t)}t.length=0},st=()=>{ot(nt),ot(et),(o=nt.length>0)&&Y.raf(st)},rt=t=>Z().then(t),ct=lt(et,!0);export{D as b,A as f,N as g,i as h,Z as p,_ as r,F as s}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{h as t,g as e,f as r,r as o}from"./p-28a3c7ec.js";const s=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"alien"),t("g",{fill:r},t("path",{d:"M10.31 10.93C11.33 12.57 11.18 14.5 9.96 15.28C8.74 16.04 6.92 15.33\n 5.89 13.69C4.87 12.05 5.03 10.1 6.25 9.34C7.47 8.58 9.29 9.29 10.31\n 10.93M12 17.75C14 17.75 14.5 17 14.5 17C14.5 17 14 19 12 19C10 19 9.5\n 17.03 9.5 17C9.5 17 10 17.75 12 17.75M17.75 9.34C18.97 10.1 19.13 12.05\n 18.11 13.69C17.08 15.33 15.26 16.04 14.04 15.28C12.82 14.5 12.67 12.57\n 13.69 10.93C14.71 9.29 16.53 8.58 17.75 9.34M12 20C14.5 20 20 14.86 20\n 11C20 7.14 16.41 4 12 4C7.59 4 4 7.14 4 11C4 14.86 9.5 20 12 20M12 2C17.5\n 2 22 6.04 22 11C22 15.08 16.32 22 12 22C7.68 22 2 15.08 2 11C2 6.04 6.5 2\n 12 2Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},n="proto-sudoku",a=`${n}::data`,i=`${n}::inputs`,l=`${n}::pick`,c=t=>{const e=localStorage.getItem(t);return e?JSON.parse(e):void 0},d=(t,e)=>{const r=JSON.stringify(e);localStorage.setItem(t,r)},h=()=>[...c(i)],f=t=>{d(i,t.join(""))},u=()=>{const t=c(l);return null!==t?t:void 0},b=t=>{d(l,t>=0&&t<81?t:null)},p="Check ?",g="New Puzzle",w=t=>!("isConnected"in t)||t.isConnected,m=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(w))})(...e)}),2e3)}})(),y=t=>"function"==typeof t?t():t;class x extends Error{constructor(t,e,r){const o=`${t.status||0===t.status?t.status:""} ${t.statusText||""}`.trim();super("Request failed with "+(o?`status code ${o}`:"an unknown error")),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=t,this.request=e,this.options=r}}class v extends Error{constructor(t){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=t}}const C=t=>null!==t&&"object"==typeof t,k=(...t)=>{for(const e of t)if((!C(e)||Array.isArray(e))&&void 0!==e)throw new TypeError("The `options` argument must be an object");return M({},...t)},T=(t={},e={})=>{const r=new globalThis.Headers(t),o=e instanceof globalThis.Headers,s=new globalThis.Headers(e);for(const[t,e]of s.entries())o&&"undefined"===e||void 0===e?r.delete(t):r.set(t,e);return r},M=(...t)=>{let e={},r={};for(const o of t)if(Array.isArray(o))Array.isArray(e)||(e=[]),e=[...e,...o];else if(C(o)){for(let[t,r]of Object.entries(o))C(r)&&t in e&&(r=M(e[t],r)),e={...e,[t]:r};C(o.headers)&&(r=T(r,o.headers),e.headers=r)}return e},j=(()=>{let t=!1,e=!1;const r="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.Request;return r&&o&&(e=new globalThis.Request("https://a.com",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")),t&&!e})(),R="function"==typeof globalThis.AbortController,S="function"==typeof globalThis.ReadableStream,z="function"==typeof globalThis.FormData,E=["get","post","put","patch","head","delete"],A={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},O=2147483647,B=Symbol("stop"),U=t=>E.includes(t)?t.toUpperCase():t,N=[413,429,503],P={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:N,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY},q=(t={})=>{if("number"==typeof t)return{...P,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...P,...t,afterStatusCodes:N}},_=Boolean(globalThis.DOMException);function D(t){if(_)return new DOMException(t?.reason??"The operation was aborted.","AbortError");const e=new Error(t?.reason??"The operation was aborted.");return e.name="AbortError",e}class H{static create(t,e){const r=new H(t,e),o=async()=>{if(r._options.timeout>O)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let t=await r._fetch();for(const e of r._options.hooks.afterResponse){const o=await e(r.request,r._options,r._decorateResponse(t.clone()));o instanceof globalThis.Response&&(t=o)}if(r._decorateResponse(t),!t.ok&&r._options.throwHttpErrors){let e=new x(t,r.request,r._options);for(const t of r._options.hooks.beforeError)e=await t(e);throw e}if(r._options.onDownloadProgress){if("function"!=typeof r._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!S)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return r._stream(t.clone(),r._options.onDownloadProgress)}return t},s=r._options.retry.methods.includes(r.request.method.toLowerCase())?r._retry(o):o();for(const[t,o]of Object.entries(A))s[t]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||o);const n=(await s).clone();if("json"===t){if(204===n.status)return"";if(0===(await n.clone().arrayBuffer()).byteLength)return"";if(e.parseJson)return e.parseJson(await n.text())}return n[t]()};return s}constructor(t,e={}){if(Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=t,this._options={credentials:this._input.credentials||"same-origin",...e,headers:T(this._input.headers,e.headers),hooks:M({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:U(e.method??this._input.method),prefixUrl:String(e.prefixUrl||""),retry:q(e.retry),throwHttpErrors:!1!==e.throwHttpErrors,timeout:void 0===e.timeout?1e4:e.timeout,fetch:e.fetch??globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(R){if(this.abortController=new globalThis.AbortController,this._options.signal){const t=this._options.signal;this._options.signal.addEventListener("abort",(()=>{this.abortController.abort(t.reason)}))}this._options.signal=this.abortController.signal}if(j&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const t="string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString(),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,"?"+t);!(z&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(e,{...this.request}),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<this._options.retry.limit&&!(t instanceof v)){if(t instanceof x){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;const e=t.response.headers.get("Retry-After");if(e&&this._options.retry.afterStatusCodes.includes(t.response.status)){let t=Number(e);return Number.isNaN(t)?t=Date.parse(e)-Date.now():t*=1e3,void 0!==this._options.retry.maxRetryAfter&&t>this._options.retry.maxRetryAfter?0:t}if(413===t.response.status)return 0}return Math.min(this._options.retry.backoffLimit,.3*2**(this._retryCount-1)*1e3)}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(e){const r=Math.min(this._calculateRetryDelay(e),O);if(0!==r&&this._retryCount>0){await async function(t,{signal:e}){return new Promise(((r,o)=>{if(e){if(e.aborted)return void o(D(e));e.addEventListener("abort",s,{once:!0})}function s(){o(D(e)),clearTimeout(n)}const n=setTimeout((()=>{e?.removeEventListener("abort",s),r()}),t)}))}(r,{signal:this._options.signal});for(const t of this._options.hooks.beforeRetry)if(await t({request:this.request,options:this._options,error:e,retryCount:this._retryCount})===B)return;return this._retry(t)}throw e}}async _fetch(){for(const t of this._options.hooks.beforeRequest){const e=await t(this.request,this._options);if(e instanceof Request){this.request=e;break}if(e instanceof Response)return e}return!1===this._options.timeout?this._options.fetch(this.request.clone()):async function(t,e,r){return new Promise(((o,s)=>{const n=setTimeout((()=>{e&&e.abort(),s(new v(t))}),r.timeout);r.fetch(t).then(o).catch(s).then((()=>{clearTimeout(n)}))}))}(this.request.clone(),this.abortController,this._options)}_stream(t,e){const r=Number(t.headers.get("content-length"))||0;let o=0;return 204===t.status?(e&&e({percent:1,totalBytes:r,transferredBytes:o},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(s){const n=t.body.getReader();e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array),await async function t(){const{done:a,value:i}=await n.read();a?s.close():(e&&(o+=i.byteLength,e({percent:0===r?0:o/r,transferredBytes:o,totalBytes:r},i)),s.enqueue(i),await t())}()}}),{status:t.status,statusText:t.statusText,headers:t.headers})}}
|
2
|
-
/*! MIT License © Sindre Sorhus */const $=t=>{const e=(e,r)=>H.create(e,k(t,r));for(const r of E)e[r]=(e,o)=>H.create(e,k(t,o,{method:r}));return e.create=t=>$(k(t)),e.extend=e=>$(k(t,e)),e.stop=B,e},L=$(),I={list:[],keys:[],locs:[],loading:!1,solved:!1,error:void 0,pick:void 0,data:void 0},{state:J}=(()=>{const t=((t,e=((t,e)=>t!==e))=>{const r=y(t);let o=new Map(Object.entries(null!=r?r:{}));const s={dispose:[],get:[],set:[],reset:[]},n=()=>{var e;o=new Map(Object.entries(null!==(e=y(t))&&void 0!==e?e:{})),s.reset.forEach((t=>t()))},a=t=>(s.get.forEach((e=>e(t))),o.get(t)),i=(t,r)=>{const n=o.get(t);e(r,n,t)&&(o.set(t,r),s.set.forEach((e=>e(t,r,n))))},l="undefined"==typeof Proxy?{}:new Proxy(r,{get:(t,e)=>a(e),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>o.has(e),set:(t,e,r)=>(i(e,r),!0)}),c=(t,e)=>(s[t].push(e),()=>{((t,e)=>{const r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.length--)})(s[t],e)});return{state:l,get:a,set:i,on:c,onChange:(e,r)=>{const o=c("set",((t,o)=>{t===e&&r(o)})),s=c("reset",(()=>r(y(t)[e])));return()=>{o(),s()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(c("set",e.set)),e.get&&t.push(c("get",e.get)),e.reset&&t.push(c("reset",e.reset)),e.dispose&&t.push(c("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{s.dispose.forEach((t=>t())),n()},reset:n,forceUpdate:t=>{const e=o.get(t);s.set.forEach((r=>r(t,e,e)))}}})(I,void 0);return t.use((()=>{if("function"!=typeof e)return{};const t=new Map;return{dispose:()=>t.clear(),get:r=>{const o=e();o&&((t,e,r)=>{const o=t.get(e);o?o.includes(r)||o.push(r):t.set(e,[r])})(t,r,o)},set:e=>{const o=t.get(e);o&&t.set(e,o.filter(r)),m(t)},reset:()=>{t.forEach((t=>t.forEach(r))),m(t)}}})()),t})(),W=new Map([["row",new Map],["column",new Map],["box",new Map]]),X=["1","2","3","4","5","6","7","8","9"],Z=t=>{if(void 0!==t&&t.indx!=J.pick){const{isClue:e,indx:r,row:o,column:s,box:n}=t,a=((t,e,r,o)=>{const s=new Map([["row",e],["column",r],["box",o]]),n=new Set;return s.forEach(((e,r)=>{W.get(r).get(e).forEach((e=>{e!==t&&n.add(e)}))})),Array.from(n)})(r,o,s,n),i=e?[]:(t=>{const{list:e}=J,r=new Set;return t.map((t=>{const{key:o}=e[t];"."!=o&&r.add(o)})),X.filter((t=>!r.has(t)))})(a);J.pick=r,J.keys=i,J.locs=a}else J.pick=void 0,J.keys=[],J.locs=[];Y(J.pick)};let F;const K={netlify:"/.netlify/functions",vercel:"https://sudoku-rust-api.vercel.app/api"},V=t=>{f(t)},Y=t=>{b(t)},G=(t=!1)=>{J.list=[],J.keys=[],J.locs=[],J.loading=t,J.solved=!1,J.error=void 0,J.pick=void 0,J.data=void 0},Q=(t,e=!0)=>{const{puzzle:r,ref:o}=t;e&&(f([]),d(a,t)),(t=>{if(t){const{puzzle:e,ref:r}=t,o=e?[...e]:[],s=r?atob(r):void 0,n=s?[...s]:[],a=o.map(((t,e)=>{const r=n[e],o=t===r,s=Math.floor(e/9),a=e%9,i=((t,e)=>e<3?t<3?0:t<6?3:6:e<6?t<3?1:t<6?4:7:t<3?2:t<6?5:8)(s,a);return((t,e,r,o)=>{new Map([["row",e],["column",r],["box",o]]).forEach(((e,r)=>{const o=W.get(r);o.has(e)?o.get(e).add(t):o.set(e,new Set([t]))}))})(e,s,a,i),{key:t,isClue:o,value:r,indx:e,row:s,column:a,box:i}}));(t=>{h().forEach(((e,r)=>{const o=t[r],{isClue:s}=o;s||(o.key=e)}))})(a),J.data=t,J.list=a}else J.data=void 0,J.list=[]})({puzzle:r,ref:o})},tt=t=>{J.list=[...t],t.length=0},et={initApp:t=>{(t=>{const e=(t=>{const e=Object.keys(K).includes(t)?t:"vercel";return K[e]})(t);F=L.extend({hooks:{beforeRequest:[t=>{t.headers.set("X-Requested-With","ky"),t.headers.set("X-Custom-Header","foobar")}]},prefixUrl:e,timeout:1e4})})(t),G();const e=c(a),r=u();if(e&&(Q(e,!1),r>=0)){const{list:t}=J;Z(t[r])}},refresh:async()=>{G(!0),V([]),Y(J.pick);try{const t=await F.get("puzzle").json();Q(t)}catch(t){const{message:e}=t;console.log("-- ",e),console.log(t),J.error=e}finally{J.loading=!1}},select:t=>{Z(t)},check:()=>{const{list:t}=J,e=[];let r=0,o=0,s=0;t.forEach((t=>{const{key:n,value:a,isClue:i}=t;i?s+=1:"."!==n&&(n!==a?(r+=1,t.key="."):o+=1),e.push(t.key)}));const n=s+o;V(o?e:[]),r>0?tt(t):81===n&&(J.solved=!0)},input:t=>{const{pick:e,list:r}=J;r[e].key=t,tt(r)}},rt=(...t)=>t.filter(Boolean).join(" "),ot=e=>{const r=e.hex||"currentColor",o=e.label||"loading...",s=e.size||24;return t("svg",{class:rt(e.class||"","animate-spin"),width:s,height:s,fill:"none",viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,o),t("g",null,t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:r,"stroke-width":"4"}),t("path",{class:"opacity-75",fill:r,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},st=e=>{const{message:r,salute:o,spinner:n=!1}=e;return t("div",{class:"mt-5 flex h-24px flex-row items-center"},t(n?ot:s,{class:"mr-2"}),o?t("label",{class:"mr-1 font-bold"},o,":"):"",t("label",{class:"italic"},r))},nt=()=>{const{solved:e,loading:r,error:o}=J;return t("div",{class:"flex flex-col"},r||o||e?"":t(st,{message:"Welcome, are you ready to play?..."}),r?t(st,{message:"Loading...",spinner:!0}):"",o?t(st,{message:o,salute:"ERROR"}):"",e?t(st,{message:"You solved the puzzle!!"}):"")},at=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"fingerprint"),t("g",{fill:r},t("path",{d:"M17.81,4.47C17.73,4.47 17.65,4.45 17.58,4.41C15.66,3.42 14,3\n 12,3C10.03,3 8.15,3.47 6.44,4.41C6.2,4.54 5.9,4.45 5.76,4.21C5.63,3.97\n 5.72,3.66 5.96,3.53C7.82,2.5 9.86,2 12,2C14.14,2 16,2.47\n 18.04,3.5C18.29,3.65 18.38,3.95 18.25,4.19C18.16,4.37 18,4.47\n 17.81,4.47M3.5,9.72C3.4,9.72 3.3,9.69 3.21,9.63C3,9.47 2.93,9.16\n 3.09,8.93C4.08,7.53 5.34,6.43 6.84,5.66C10,4.04 14,4.03\n 17.15,5.65C18.65,6.42 19.91,7.5 20.9,8.9C21.06,9.12 21,9.44\n 20.78,9.6C20.55,9.76 20.24,9.71 20.08,9.5C19.18,8.22 18.04,7.23\n 16.69,6.54C13.82,5.07 10.15,5.07 7.29,6.55C5.93,7.25 4.79,8.25\n 3.89,9.5C3.81,9.65 3.66,9.72 3.5,9.72M9.75,21.79C9.62,21.79 9.5,21.74\n 9.4,21.64C8.53,20.77 8.06,20.21 7.39,19C6.7,17.77 6.34,16.27\n 6.34,14.66C6.34,11.69 8.88,9.27 12,9.27C15.12,9.27 17.66,11.69\n 17.66,14.66A0.5,0.5 0 0,1 17.16,15.16A0.5,0.5 0 0,1\n 16.66,14.66C16.66,12.24 14.57,10.27 12,10.27C9.43,10.27 7.34,12.24\n 7.34,14.66C7.34,16.1 7.66,17.43 8.27,18.5C8.91,19.66 9.35,20.15\n 10.12,20.93C10.31,21.13 10.31,21.44 10.12,21.64C10,21.74 9.88,21.79\n 9.75,21.79M16.92,19.94C15.73,19.94 14.68,19.64 13.82,19.05C12.33,18.04\n 11.44,16.4 11.44,14.66A0.5,0.5 0 0,1 11.94,14.16A0.5,0.5 0 0,1\n 12.44,14.66C12.44,16.07 13.16,17.4 14.38,18.22C15.09,18.7 15.92,18.93\n 16.92,18.93C17.16,18.93 17.56,18.9 17.96,18.83C18.23,18.78 18.5,18.96\n 18.54,19.24C18.59,19.5 18.41,19.77 18.13,19.82C17.56,19.93 17.06,19.94\n 16.92,19.94M14.91,22C14.87,22 14.82,22 14.78,22C13.19,21.54 12.15,20.95\n 11.06,19.88C9.66,18.5 8.89,16.64 8.89,14.66C8.89,13.04 10.27,11.72\n 11.97,11.72C13.67,11.72 15.05,13.04 15.05,14.66C15.05,15.73 16,16.6\n 17.13,16.6C18.28,16.6 19.21,15.73 19.21,14.66C19.21,10.89 15.96,7.83\n 11.96,7.83C9.12,7.83 6.5,9.41 5.35,11.86C4.96,12.67 4.76,13.62\n 4.76,14.66C4.76,15.44 4.83,16.67 5.43,18.27C5.53,18.53 5.4,18.82\n 5.14,18.91C4.88,19 4.59,18.87 4.5,18.62C4,17.31 3.77,16\n 3.77,14.66C3.77,13.46 4,12.37 4.45,11.42C5.78,8.63 8.73,6.82\n 11.96,6.82C16.5,6.82 20.21,10.33 20.21,14.65C20.21,16.27 18.83,17.59\n 17.13,17.59C15.43,17.59 14.05,16.27 14.05,14.65C14.05,13.58 13.12,12.71\n 11.97,12.71C10.82,12.71 9.89,13.58 9.89,14.65C9.89,16.36 10.55,17.96\n 11.76,19.16C12.71,20.1 13.62,20.62 15.03,21C15.3,21.08 15.45,21.36\n 15.38,21.62C15.33,21.85 15.12,22 14.91,22Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},it="eswat2",lt=()=>t("a",{class:"absolute right-0 top-0 text-clrs-gray hover:text-clrs-navy",href:"https://eswat2.dev","aria-label":it,target:"blank",title:it},t(at,{label:it})),ct=(e,r)=>t("h1",{class:rt("text-center uppercase text-clrs-red","mb-11 ml-0 mr-0 mt-11","text-6xl font-thin")},r),dt=e=>{const{label:r,callback:o,matched:s=!1}=e;return t("button",{class:rt("rounded-md border border-solid border-clrs-slate4 font-bold",r===p?"mr-2 bg-clrs-yellow px-3 py-2 text-clrs-navy":r===g?"mr-2 bg-clrs-navy px-3 py-2 text-white":"x"===r?"mr-1 bg-clrs-red px-2 py-1 text-white":s?"mr-1 bg-clrs-slate4 px-2 py-1 text-white":"mr-1 bg-gray-50 px-2 py-1 text-clrs-navy"),onClick:o},r)},ht=()=>{const{keys:e,list:r,pick:o,solved:s}=J,n=t=>()=>{et.input(t)},a=s?[]:e,i=null!=o?r[o]:void 0;return t("div",{class:"mt-2 flex flex-row justify-end"},s||!i||i.isClue||"."==i.key?"":t(dt,{label:"x",callback:n(".")}),a.map((e=>t(dt,{label:e,callback:n(e),matched:i.key===e}))))},ft=[2,5,11,14,20,23,29,32,38,41,47,50,56,59,65,68,74,77],ut=ft.map((t=>t+1)),bt=[18,19,20,21,22,23,24,25,26,45,46,47,48,49,50,51,52,53],pt=bt.map((t=>t+9)),gt=e=>{const{cell:r,focus:o,selected:s,solved:n}=e,{key:a,isClue:i,indx:l}=r,c="."!=a?a:"";return t("label",{class:rt(`cell-${l}`,ft.includes(l)?"border-xbr-clrs-navy":"",ut.includes(l)?"border-xbl-clrs-navy":"",bt.includes(l)?"border-xbb-clrs-navy":"",pt.includes(l)?"border-xbt-clrs-navy":"","h-8 w-8 border border-solid text-center leading-8",s?"border-clrs-red bg-clrs-red-a50 text-clrs-red":o?"border-clrs-gray bg-clrs-green-a50 font-bold":i?"border-clrs-gray bg-clrs-silver":""!==c?"border-clrs-gray text-clrs-red":"border-clrs-gray"),onClick:((t,e)=>()=>{e||et.select(t)})(r,n)},c)},wt=()=>{const{list:e,pick:r,locs:o,solved:s}=J;return t("div",{class:rt("flex flex-row flex-wrap","border border-solid border-clrs-navy","h-76p5 w-76p5 text-lg")},e.map(((e,n)=>{const a=!s&&n===r,i=!s&&o.includes(n);return t(gt,{cell:e,focus:i,selected:a,solved:s})})))},mt=()=>t("label",{class:"ml-auto align-top text-xs italic text-clrs-slate4"},"Tailwind ","3.3.2"),yt=t=>()=>{t.refresh()},xt=t=>()=>{t.check()},vt=()=>{const{list:e,solved:r}=J;return t("div",{class:"flex flex-row"},t(dt,{label:g,callback:yt(et)}),81!==e.length||r?"":t(dt,{label:p,callback:xt(et)}),t(mt,null))},Ct=class{constructor(t){o(this,t),this.tag="proto-sudoku",this.platform="vercel"}componentDidLoad(){et.initApp(this.platform)}render(){return t("div",{id:"app",class:"ds1-main relative max-w-min p-0.5"},t(lt,null),t(ct,null,"Sudoku"),t(wt,null),t(ht,null),t("hr",{class:"ml-0 mr-0"}),t(vt,null),t(nt,null))}};Ct.style="*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.ds1-main{margin:1.5rem;display:flex;flex-direction:column;font-family:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,\n 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';color:var(--clrs-navy, #001f3f);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.absolute{position:absolute}.relative{position:relative}.right-0{right:0px}.top-0{top:0px}.mb-11{margin-bottom:2.75rem}.ml-0{margin-left:0px}.ml-auto{margin-left:auto}.mr-0{margin-right:0px}.mr-1{margin-right:0.25rem}.mr-2{margin-right:0.5rem}.mt-11{margin-top:2.75rem}.mt-2{margin-top:0.5rem}.mt-5{margin-top:1.25rem}.flex{display:flex}.h-24px{height:24px}.h-76p5{height:19.125rem}.h-8{height:2rem}.w-76p5{width:19.125rem}.w-8{width:2rem}.max-w-min{max-width:-moz-min-content;max-width:min-content}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.rounded-md{border-radius:0.375rem}.border{border-width:1px}.border-solid{border-style:solid}.border-clrs-gray{border-color:var(--clrs-gray, #aaaaaa)}.border-clrs-navy{border-color:var(--clrs-navy, #001f3f)}.border-clrs-red{border-color:var(--clrs-red, #ff4136)}.border-clrs-slate4{border-color:var(--clrs-slate4, #4e5964)}.bg-clrs-green-a50{background-color:var(--clrs-green-a50, #2ecc4050)}.bg-clrs-navy{background-color:var(--clrs-navy, #001f3f)}.bg-clrs-red{background-color:var(--clrs-red, #ff4136)}.bg-clrs-red-a50{background-color:var(--clrs-red-a50, #ff413650)}.bg-clrs-silver{background-color:var(--clrs-silver, #dddddd)}.bg-clrs-slate4{background-color:var(--clrs-slate4, #4e5964)}.bg-clrs-yellow{background-color:var(--clrs-yellow, #ffdc00)}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.p-0{padding:0px}.p-0\\.5{padding:0.125rem}.px-2{padding-left:0.5rem;padding-right:0.5rem}.px-3{padding-left:0.75rem;padding-right:0.75rem}.py-1{padding-top:0.25rem;padding-bottom:0.25rem}.py-2{padding-top:0.5rem;padding-bottom:0.5rem}.text-center{text-align:center}.align-top{vertical-align:top}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xs{font-size:0.75rem;line-height:1rem}.font-bold{font-weight:700}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-8{line-height:2rem}.text-clrs-gray{color:var(--clrs-gray, #aaaaaa)}.text-clrs-navy{color:var(--clrs-navy, #001f3f)}.text-clrs-red{color:var(--clrs-red, #ff4136)}.text-clrs-slate4{color:var(--clrs-slate4, #4e5964)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity))}.opacity-25{opacity:0.25}.opacity-75{opacity:0.75}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),\n 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.border-xbb-clrs-navy{border-bottom:1px solid var(--clrs-navy, #001f3f) !important}.border-xbt-clrs-navy{border-top:1px solid var(--clrs-navy, #001f3f) !important}.border-xbl-clrs-navy{border-left:1px solid var(--clrs-navy, #001f3f) !important}.border-xbr-clrs-navy{border-right:1px solid var(--clrs-navy, #001f3f) !important}.hover\\:text-clrs-navy:hover{color:var(--clrs-navy, #001f3f)}";export{Ct as proto_sudoku}
|
1
|
+
import{h as t,g as e,f as r,r as o}from"./p-6b56583e.js";const s=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"alien"),t("g",{fill:r},t("path",{d:"M10.31 10.93C11.33 12.57 11.18 14.5 9.96 15.28C8.74 16.04 6.92 15.33\n 5.89 13.69C4.87 12.05 5.03 10.1 6.25 9.34C7.47 8.58 9.29 9.29 10.31\n 10.93M12 17.75C14 17.75 14.5 17 14.5 17C14.5 17 14 19 12 19C10 19 9.5\n 17.03 9.5 17C9.5 17 10 17.75 12 17.75M17.75 9.34C18.97 10.1 19.13 12.05\n 18.11 13.69C17.08 15.33 15.26 16.04 14.04 15.28C12.82 14.5 12.67 12.57\n 13.69 10.93C14.71 9.29 16.53 8.58 17.75 9.34M12 20C14.5 20 20 14.86 20\n 11C20 7.14 16.41 4 12 4C7.59 4 4 7.14 4 11C4 14.86 9.5 20 12 20M12 2C17.5\n 2 22 6.04 22 11C22 15.08 16.32 22 12 22C7.68 22 2 15.08 2 11C2 6.04 6.5 2\n 12 2Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},n="proto-sudoku",a=`${n}::data`,i=`${n}::inputs`,l=`${n}::pick`,c=t=>{const e=localStorage.getItem(t);return e?JSON.parse(e):void 0},d=(t,e)=>{const r=JSON.stringify(e);localStorage.setItem(t,r)},h=()=>[...c(i)],f=t=>{d(i,t.join(""))},u=()=>{const t=c(l);return null!==t?t:void 0},b=t=>{d(l,t>=0&&t<81?t:null)},p="Check ?",g="New Puzzle",w=t=>!("isConnected"in t)||t.isConnected,m=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(w))})(...e)}),2e3)}})(),y=t=>"function"==typeof t?t():t;class x extends Error{constructor(t,e,r){const o=`${t.status||0===t.status?t.status:""} ${t.statusText||""}`.trim();super("Request failed with "+(o?`status code ${o}`:"an unknown error")),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=t,this.request=e,this.options=r}}class v extends Error{constructor(t){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=t}}const C=t=>null!==t&&"object"==typeof t,k=(...t)=>{for(const e of t)if((!C(e)||Array.isArray(e))&&void 0!==e)throw new TypeError("The `options` argument must be an object");return M({},...t)},T=(t={},e={})=>{const r=new globalThis.Headers(t),o=e instanceof globalThis.Headers,s=new globalThis.Headers(e);for(const[t,e]of s.entries())o&&"undefined"===e||void 0===e?r.delete(t):r.set(t,e);return r},M=(...t)=>{let e={},r={};for(const o of t)if(Array.isArray(o))Array.isArray(e)||(e=[]),e=[...e,...o];else if(C(o)){for(let[t,r]of Object.entries(o))C(r)&&t in e&&(r=M(e[t],r)),e={...e,[t]:r};C(o.headers)&&(r=T(r,o.headers),e.headers=r)}return e},j=(()=>{let t=!1,e=!1;const r="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.Request;return r&&o&&(e=new globalThis.Request("https://a.com",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")),t&&!e})(),R="function"==typeof globalThis.AbortController,S="function"==typeof globalThis.ReadableStream,z="function"==typeof globalThis.FormData,E=["get","post","put","patch","head","delete"],A={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},O=2147483647,B=Symbol("stop"),U=t=>E.includes(t)?t.toUpperCase():t,N=[413,429,503],P={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:N,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY},q=(t={})=>{if("number"==typeof t)return{...P,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...P,...t,afterStatusCodes:N}},_=Boolean(globalThis.DOMException);function D(t){if(_)return new DOMException(t?.reason??"The operation was aborted.","AbortError");const e=new Error(t?.reason??"The operation was aborted.");return e.name="AbortError",e}class H{static create(t,e){const r=new H(t,e),o=async()=>{if(r._options.timeout>O)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let t=await r._fetch();for(const e of r._options.hooks.afterResponse){const o=await e(r.request,r._options,r._decorateResponse(t.clone()));o instanceof globalThis.Response&&(t=o)}if(r._decorateResponse(t),!t.ok&&r._options.throwHttpErrors){let e=new x(t,r.request,r._options);for(const t of r._options.hooks.beforeError)e=await t(e);throw e}if(r._options.onDownloadProgress){if("function"!=typeof r._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!S)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return r._stream(t.clone(),r._options.onDownloadProgress)}return t},s=r._options.retry.methods.includes(r.request.method.toLowerCase())?r._retry(o):o();for(const[t,o]of Object.entries(A))s[t]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||o);const n=(await s).clone();if("json"===t){if(204===n.status)return"";if(0===(await n.clone().arrayBuffer()).byteLength)return"";if(e.parseJson)return e.parseJson(await n.text())}return n[t]()};return s}constructor(t,e={}){if(Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=t,this._options={credentials:this._input.credentials||"same-origin",...e,headers:T(this._input.headers,e.headers),hooks:M({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:U(e.method??this._input.method),prefixUrl:String(e.prefixUrl||""),retry:q(e.retry),throwHttpErrors:!1!==e.throwHttpErrors,timeout:void 0===e.timeout?1e4:e.timeout,fetch:e.fetch??globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(R){if(this.abortController=new globalThis.AbortController,this._options.signal){const t=this._options.signal;this._options.signal.addEventListener("abort",(()=>{this.abortController.abort(t.reason)}))}this._options.signal=this.abortController.signal}if(j&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const t="string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString(),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,"?"+t);!(z&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(e,{...this.request}),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount<this._options.retry.limit&&!(t instanceof v)){if(t instanceof x){if(!this._options.retry.statusCodes.includes(t.response.status))return 0;const e=t.response.headers.get("Retry-After");if(e&&this._options.retry.afterStatusCodes.includes(t.response.status)){let t=Number(e);return Number.isNaN(t)?t=Date.parse(e)-Date.now():t*=1e3,void 0!==this._options.retry.maxRetryAfter&&t>this._options.retry.maxRetryAfter?0:t}if(413===t.response.status)return 0}return Math.min(this._options.retry.backoffLimit,.3*2**(this._retryCount-1)*1e3)}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(e){const r=Math.min(this._calculateRetryDelay(e),O);if(0!==r&&this._retryCount>0){await async function(t,{signal:e}){return new Promise(((r,o)=>{if(e){if(e.aborted)return void o(D(e));e.addEventListener("abort",s,{once:!0})}function s(){o(D(e)),clearTimeout(n)}const n=setTimeout((()=>{e?.removeEventListener("abort",s),r()}),t)}))}(r,{signal:this._options.signal});for(const t of this._options.hooks.beforeRetry)if(await t({request:this.request,options:this._options,error:e,retryCount:this._retryCount})===B)return;return this._retry(t)}throw e}}async _fetch(){for(const t of this._options.hooks.beforeRequest){const e=await t(this.request,this._options);if(e instanceof Request){this.request=e;break}if(e instanceof Response)return e}return!1===this._options.timeout?this._options.fetch(this.request.clone()):async function(t,e,r){return new Promise(((o,s)=>{const n=setTimeout((()=>{e&&e.abort(),s(new v(t))}),r.timeout);r.fetch(t).then(o).catch(s).then((()=>{clearTimeout(n)}))}))}(this.request.clone(),this.abortController,this._options)}_stream(t,e){const r=Number(t.headers.get("content-length"))||0;let o=0;return 204===t.status?(e&&e({percent:1,totalBytes:r,transferredBytes:o},new Uint8Array),new globalThis.Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(s){const n=t.body.getReader();e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array),await async function t(){const{done:a,value:i}=await n.read();a?s.close():(e&&(o+=i.byteLength,e({percent:0===r?0:o/r,transferredBytes:o,totalBytes:r},i)),s.enqueue(i),await t())}()}}),{status:t.status,statusText:t.statusText,headers:t.headers})}}
|
2
|
+
/*! MIT License © Sindre Sorhus */const $=t=>{const e=(e,r)=>H.create(e,k(t,r));for(const r of E)e[r]=(e,o)=>H.create(e,k(t,o,{method:r}));return e.create=t=>$(k(t)),e.extend=e=>$(k(t,e)),e.stop=B,e},L=$(),I={list:[],keys:[],locs:[],loading:!1,solved:!1,error:void 0,pick:void 0,data:void 0},{state:J}=(()=>{const t=((t,e=((t,e)=>t!==e))=>{const r=y(t);let o=new Map(Object.entries(null!=r?r:{}));const s={dispose:[],get:[],set:[],reset:[]},n=()=>{var e;o=new Map(Object.entries(null!==(e=y(t))&&void 0!==e?e:{})),s.reset.forEach((t=>t()))},a=t=>(s.get.forEach((e=>e(t))),o.get(t)),i=(t,r)=>{const n=o.get(t);e(r,n,t)&&(o.set(t,r),s.set.forEach((e=>e(t,r,n))))},l="undefined"==typeof Proxy?{}:new Proxy(r,{get:(t,e)=>a(e),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>o.has(e),set:(t,e,r)=>(i(e,r),!0)}),c=(t,e)=>(s[t].push(e),()=>{((t,e)=>{const r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.length--)})(s[t],e)});return{state:l,get:a,set:i,on:c,onChange:(e,r)=>{const o=c("set",((t,o)=>{t===e&&r(o)})),s=c("reset",(()=>r(y(t)[e])));return()=>{o(),s()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(c("set",e.set)),e.get&&t.push(c("get",e.get)),e.reset&&t.push(c("reset",e.reset)),e.dispose&&t.push(c("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{s.dispose.forEach((t=>t())),n()},reset:n,forceUpdate:t=>{const e=o.get(t);s.set.forEach((r=>r(t,e,e)))}}})(I,void 0);return t.use((()=>{if("function"!=typeof e)return{};const t=new Map;return{dispose:()=>t.clear(),get:r=>{const o=e();o&&((t,e,r)=>{const o=t.get(e);o?o.includes(r)||o.push(r):t.set(e,[r])})(t,r,o)},set:e=>{const o=t.get(e);o&&t.set(e,o.filter(r)),m(t)},reset:()=>{t.forEach((t=>t.forEach(r))),m(t)}}})()),t})(),W=new Map([["row",new Map],["column",new Map],["box",new Map]]),X=["1","2","3","4","5","6","7","8","9"],Z=t=>{if(void 0!==t&&t.indx!=J.pick){const{isClue:e,indx:r,row:o,column:s,box:n}=t,a=((t,e,r,o)=>{const s=new Map([["row",e],["column",r],["box",o]]),n=new Set;return s.forEach(((e,r)=>{W.get(r).get(e).forEach((e=>{e!==t&&n.add(e)}))})),Array.from(n)})(r,o,s,n),i=e?[]:(t=>{const{list:e}=J,r=new Set;return t.map((t=>{const{key:o}=e[t];"."!=o&&r.add(o)})),X.filter((t=>!r.has(t)))})(a);J.pick=r,J.keys=i,J.locs=a}else J.pick=void 0,J.keys=[],J.locs=[];Y(J.pick)};let F;const K={netlify:"/.netlify/functions",vercel:"https://sudoku-rust-api.vercel.app/api"},V=t=>{f(t)},Y=t=>{b(t)},G=(t=!1)=>{J.list=[],J.keys=[],J.locs=[],J.loading=t,J.solved=!1,J.error=void 0,J.pick=void 0,J.data=void 0},Q=(t,e=!0)=>{const{puzzle:r,ref:o}=t;e&&(f([]),d(a,t)),(t=>{if(t){const{puzzle:e,ref:r}=t,o=e?[...e]:[],s=r?atob(r):void 0,n=s?[...s]:[],a=o.map(((t,e)=>{const r=n[e],o=t===r,s=Math.floor(e/9),a=e%9,i=((t,e)=>e<3?t<3?0:t<6?3:6:e<6?t<3?1:t<6?4:7:t<3?2:t<6?5:8)(s,a);return((t,e,r,o)=>{new Map([["row",e],["column",r],["box",o]]).forEach(((e,r)=>{const o=W.get(r);o.has(e)?o.get(e).add(t):o.set(e,new Set([t]))}))})(e,s,a,i),{key:t,isClue:o,value:r,indx:e,row:s,column:a,box:i}}));(t=>{h().forEach(((e,r)=>{const o=t[r],{isClue:s}=o;s||(o.key=e)}))})(a),J.data=t,J.list=a}else J.data=void 0,J.list=[]})({puzzle:r,ref:o})},tt=t=>{J.list=[...t],t.length=0},et={initApp:t=>{(t=>{const e=(t=>{const e=Object.keys(K).includes(t)?t:"vercel";return K[e]})(t);F=L.extend({hooks:{beforeRequest:[t=>{t.headers.set("X-Requested-With","ky"),t.headers.set("X-Custom-Header","foobar")}]},prefixUrl:e,timeout:1e4})})(t),G();const e=c(a),r=u();if(e&&(Q(e,!1),r>=0)){const{list:t}=J;Z(t[r])}},refresh:async()=>{G(!0),V([]),Y(J.pick);try{const t=await F.get("puzzle").json();Q(t)}catch(t){const{message:e}=t;console.log("-- ",e),console.log(t),J.error=e}finally{J.loading=!1}},select:t=>{Z(t)},check:()=>{const{list:t}=J,e=[];let r=0,o=0,s=0;t.forEach((t=>{const{key:n,value:a,isClue:i}=t;i?s+=1:"."!==n&&(n!==a?(r+=1,t.key="."):o+=1),e.push(t.key)}));const n=s+o;V(o?e:[]),r>0?tt(t):81===n&&(J.solved=!0)},input:t=>{const{pick:e,list:r}=J;r[e].key=t,tt(r)}},rt=(...t)=>t.filter(Boolean).join(" "),ot=e=>{const r=e.hex||"currentColor",o=e.label||"loading...",s=e.size||24;return t("svg",{class:rt(e.class||"","animate-spin"),width:s,height:s,fill:"none",viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,o),t("g",null,t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:r,"stroke-width":"4"}),t("path",{class:"opacity-75",fill:r,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},st=e=>{const{message:r,salute:o,spinner:n=!1}=e;return t("div",{class:"mt-5 flex h-24px flex-row items-center"},t(n?ot:s,{class:"mr-2"}),o?t("label",{class:"mr-1 font-bold"},o,":"):"",t("label",{class:"italic"},r))},nt=()=>{const{solved:e,loading:r,error:o}=J;return t("div",{class:"flex flex-col"},r||o||e?"":t(st,{message:"Welcome, are you ready to play?..."}),r?t(st,{message:"Loading...",spinner:!0}):"",o?t(st,{message:o,salute:"ERROR"}):"",e?t(st,{message:"You solved the puzzle!!"}):"")},at=e=>{const r=e.hex||"currentColor",o=e.size||24;return t("svg",{class:e.class,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"fingerprint"),t("g",{fill:r},t("path",{d:"M17.81,4.47C17.73,4.47 17.65,4.45 17.58,4.41C15.66,3.42 14,3\n 12,3C10.03,3 8.15,3.47 6.44,4.41C6.2,4.54 5.9,4.45 5.76,4.21C5.63,3.97\n 5.72,3.66 5.96,3.53C7.82,2.5 9.86,2 12,2C14.14,2 16,2.47\n 18.04,3.5C18.29,3.65 18.38,3.95 18.25,4.19C18.16,4.37 18,4.47\n 17.81,4.47M3.5,9.72C3.4,9.72 3.3,9.69 3.21,9.63C3,9.47 2.93,9.16\n 3.09,8.93C4.08,7.53 5.34,6.43 6.84,5.66C10,4.04 14,4.03\n 17.15,5.65C18.65,6.42 19.91,7.5 20.9,8.9C21.06,9.12 21,9.44\n 20.78,9.6C20.55,9.76 20.24,9.71 20.08,9.5C19.18,8.22 18.04,7.23\n 16.69,6.54C13.82,5.07 10.15,5.07 7.29,6.55C5.93,7.25 4.79,8.25\n 3.89,9.5C3.81,9.65 3.66,9.72 3.5,9.72M9.75,21.79C9.62,21.79 9.5,21.74\n 9.4,21.64C8.53,20.77 8.06,20.21 7.39,19C6.7,17.77 6.34,16.27\n 6.34,14.66C6.34,11.69 8.88,9.27 12,9.27C15.12,9.27 17.66,11.69\n 17.66,14.66A0.5,0.5 0 0,1 17.16,15.16A0.5,0.5 0 0,1\n 16.66,14.66C16.66,12.24 14.57,10.27 12,10.27C9.43,10.27 7.34,12.24\n 7.34,14.66C7.34,16.1 7.66,17.43 8.27,18.5C8.91,19.66 9.35,20.15\n 10.12,20.93C10.31,21.13 10.31,21.44 10.12,21.64C10,21.74 9.88,21.79\n 9.75,21.79M16.92,19.94C15.73,19.94 14.68,19.64 13.82,19.05C12.33,18.04\n 11.44,16.4 11.44,14.66A0.5,0.5 0 0,1 11.94,14.16A0.5,0.5 0 0,1\n 12.44,14.66C12.44,16.07 13.16,17.4 14.38,18.22C15.09,18.7 15.92,18.93\n 16.92,18.93C17.16,18.93 17.56,18.9 17.96,18.83C18.23,18.78 18.5,18.96\n 18.54,19.24C18.59,19.5 18.41,19.77 18.13,19.82C17.56,19.93 17.06,19.94\n 16.92,19.94M14.91,22C14.87,22 14.82,22 14.78,22C13.19,21.54 12.15,20.95\n 11.06,19.88C9.66,18.5 8.89,16.64 8.89,14.66C8.89,13.04 10.27,11.72\n 11.97,11.72C13.67,11.72 15.05,13.04 15.05,14.66C15.05,15.73 16,16.6\n 17.13,16.6C18.28,16.6 19.21,15.73 19.21,14.66C19.21,10.89 15.96,7.83\n 11.96,7.83C9.12,7.83 6.5,9.41 5.35,11.86C4.96,12.67 4.76,13.62\n 4.76,14.66C4.76,15.44 4.83,16.67 5.43,18.27C5.53,18.53 5.4,18.82\n 5.14,18.91C4.88,19 4.59,18.87 4.5,18.62C4,17.31 3.77,16\n 3.77,14.66C3.77,13.46 4,12.37 4.45,11.42C5.78,8.63 8.73,6.82\n 11.96,6.82C16.5,6.82 20.21,10.33 20.21,14.65C20.21,16.27 18.83,17.59\n 17.13,17.59C15.43,17.59 14.05,16.27 14.05,14.65C14.05,13.58 13.12,12.71\n 11.97,12.71C10.82,12.71 9.89,13.58 9.89,14.65C9.89,16.36 10.55,17.96\n 11.76,19.16C12.71,20.1 13.62,20.62 15.03,21C15.3,21.08 15.45,21.36\n 15.38,21.62C15.33,21.85 15.12,22 14.91,22Z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},it="eswat2",lt=()=>t("a",{class:"absolute right-0 top-0 text-clrs-gray hover:text-clrs-navy",href:"https://eswat2.dev","aria-label":it,target:"blank",title:it},t(at,{label:it})),ct=(e,r)=>t("h1",{class:rt("text-center uppercase text-clrs-red","mb-11 ml-0 mr-0 mt-11","text-6xl font-thin")},r),dt=e=>{const{label:r,callback:o,matched:s=!1}=e;return t("button",{class:rt("rounded-md border border-solid border-clrs-slate4 font-bold",r===p?"mr-2 bg-clrs-yellow px-3 py-2 text-clrs-navy":r===g?"mr-2 bg-clrs-navy px-3 py-2 text-white":"x"===r?"mr-1 bg-clrs-red px-2 py-1 text-white":s?"mr-1 bg-clrs-slate4 px-2 py-1 text-white":"mr-1 bg-gray-50 px-2 py-1 text-clrs-navy"),onClick:o},r)},ht=()=>{const{keys:e,list:r,pick:o,solved:s}=J,n=t=>()=>{et.input(t)},a=s?[]:e,i=null!=o?r[o]:void 0;return t("div",{class:"mt-2 flex flex-row justify-end"},s||!i||i.isClue||"."==i.key?"":t(dt,{label:"x",callback:n(".")}),a.map((e=>t(dt,{label:e,callback:n(e),matched:i.key===e}))))},ft=[2,5,11,14,20,23,29,32,38,41,47,50,56,59,65,68,74,77],ut=ft.map((t=>t+1)),bt=[18,19,20,21,22,23,24,25,26,45,46,47,48,49,50,51,52,53],pt=bt.map((t=>t+9)),gt=e=>{const{cell:r,focus:o,selected:s,solved:n}=e,{key:a,isClue:i,indx:l}=r,c="."!=a?a:"";return t("label",{class:rt(`cell-${l}`,ft.includes(l)?"border-xbr-clrs-navy":"",ut.includes(l)?"border-xbl-clrs-navy":"",bt.includes(l)?"border-xbb-clrs-navy":"",pt.includes(l)?"border-xbt-clrs-navy":"","h-8 w-8 border border-solid text-center leading-8",s?"border-clrs-red bg-clrs-red-a50 text-clrs-red":o?"border-clrs-gray bg-clrs-green-a50 font-bold":i?"border-clrs-gray bg-clrs-silver":""!==c?"border-clrs-gray text-clrs-red":"border-clrs-gray"),onClick:((t,e)=>()=>{e||et.select(t)})(r,n)},c)},wt=()=>{const{list:e,pick:r,locs:o,solved:s}=J;return t("div",{class:rt("flex flex-row flex-wrap","border border-solid border-clrs-navy","h-76p5 w-76p5 text-lg")},e.map(((e,n)=>{const a=!s&&n===r,i=!s&&o.includes(n);return t(gt,{cell:e,focus:i,selected:a,solved:s})})))},mt=()=>t("label",{class:"ml-auto align-top text-xs italic text-clrs-slate4"},"Tailwind ","3.3.2"),yt=t=>()=>{t.refresh()},xt=t=>()=>{t.check()},vt=()=>{const{list:e,solved:r}=J;return t("div",{class:"flex flex-row"},t(dt,{label:g,callback:yt(et)}),81!==e.length||r?"":t(dt,{label:p,callback:xt(et)}),t(mt,null))},Ct=class{constructor(t){o(this,t),this.tag="proto-sudoku",this.platform="vercel"}componentDidLoad(){et.initApp(this.platform)}render(){return t("div",{id:"app",class:"ds1-main relative max-w-min p-0.5"},t(lt,null),t(ct,null,"Sudoku"),t(wt,null),t(ht,null),t("hr",{class:"ml-0 mr-0"}),t(vt,null),t(nt,null))}};Ct.style="*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.ds1-main{margin:1.5rem;display:flex;flex-direction:column;font-family:ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n 'Helvetica Neue',\n Arial,\n 'Noto Sans',\n sans-serif,\n 'Apple Color Emoji',\n 'Segoe UI Emoji',\n 'Segoe UI Symbol',\n 'Noto Color Emoji';color:var(--clrs-navy, #001f3f);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.absolute{position:absolute}.relative{position:relative}.right-0{right:0px}.top-0{top:0px}.mb-11{margin-bottom:2.75rem}.ml-0{margin-left:0px}.ml-auto{margin-left:auto}.mr-0{margin-right:0px}.mr-1{margin-right:0.25rem}.mr-2{margin-right:0.5rem}.mt-11{margin-top:2.75rem}.mt-2{margin-top:0.5rem}.mt-5{margin-top:1.25rem}.flex{display:flex}.h-24px{height:24px}.h-76p5{height:19.125rem}.h-8{height:2rem}.w-76p5{width:19.125rem}.w-8{width:2rem}.max-w-min{max-width:-moz-min-content;max-width:min-content}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.rounded-md{border-radius:0.375rem}.border{border-width:1px}.border-solid{border-style:solid}.border-clrs-gray{border-color:var(--clrs-gray, #aaaaaa)}.border-clrs-navy{border-color:var(--clrs-navy, #001f3f)}.border-clrs-red{border-color:var(--clrs-red, #ff4136)}.border-clrs-slate4{border-color:var(--clrs-slate4, #4e5964)}.bg-clrs-green-a50{background-color:var(--clrs-green-a50, #2ecc4050)}.bg-clrs-navy{background-color:var(--clrs-navy, #001f3f)}.bg-clrs-red{background-color:var(--clrs-red, #ff4136)}.bg-clrs-red-a50{background-color:var(--clrs-red-a50, #ff413650)}.bg-clrs-silver{background-color:var(--clrs-silver, #dddddd)}.bg-clrs-slate4{background-color:var(--clrs-slate4, #4e5964)}.bg-clrs-yellow{background-color:var(--clrs-yellow, #ffdc00)}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.p-0{padding:0px}.p-0\\.5{padding:0.125rem}.px-2{padding-left:0.5rem;padding-right:0.5rem}.px-3{padding-left:0.75rem;padding-right:0.75rem}.py-1{padding-top:0.25rem;padding-bottom:0.25rem}.py-2{padding-top:0.5rem;padding-bottom:0.5rem}.text-center{text-align:center}.align-top{vertical-align:top}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xs{font-size:0.75rem;line-height:1rem}.font-bold{font-weight:700}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-8{line-height:2rem}.text-clrs-gray{color:var(--clrs-gray, #aaaaaa)}.text-clrs-navy{color:var(--clrs-navy, #001f3f)}.text-clrs-red{color:var(--clrs-red, #ff4136)}.text-clrs-slate4{color:var(--clrs-slate4, #4e5964)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity))}.opacity-25{opacity:0.25}.opacity-75{opacity:0.75}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),\n 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.border-xbb-clrs-navy{border-bottom:1px solid var(--clrs-navy, #001f3f) !important}.border-xbt-clrs-navy{border-top:1px solid var(--clrs-navy, #001f3f) !important}.border-xbl-clrs-navy{border-left:1px solid var(--clrs-navy, #001f3f) !important}.border-xbr-clrs-navy{border-right:1px solid var(--clrs-navy, #001f3f) !important}.hover\\:text-clrs-navy:hover{color:var(--clrs-navy, #001f3f)}";export{Ct as proto_sudoku}
|
@@ -1 +1 @@
|
|
1
|
-
import{p as o,b as
|
1
|
+
import{p as o,b as t}from"./p-6b56583e.js";export{s as setNonce}from"./p-6b56583e.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),o(e)})().then((o=>t([["p-d31b59de",[[1,"proto-sudoku",{tag:[1],platform:[1]}]]]],o)));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "proto-sudoku-wc",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.637",
|
4
4
|
"description": "prototype - a simple Sudoku app rendered in Stencil and Tailwind",
|
5
5
|
"main": "dist/index.cjs.js",
|
6
6
|
"module": "dist/index.js",
|
@@ -27,10 +27,10 @@
|
|
27
27
|
"format": "prettier --write src"
|
28
28
|
},
|
29
29
|
"dependencies": {
|
30
|
-
"@stencil/core": "
|
30
|
+
"@stencil/core": "4.0.1",
|
31
31
|
"@stencil/store": "2.0.8",
|
32
32
|
"ky": "0.33.3",
|
33
|
-
"proto-tailwindcss-clrs": "0.0.
|
33
|
+
"proto-tailwindcss-clrs": "0.0.254",
|
34
34
|
"tailwindcss": "3.3.2"
|
35
35
|
},
|
36
36
|
"devDependencies": {
|
@@ -38,11 +38,11 @@
|
|
38
38
|
"concurrently": "8.2.0",
|
39
39
|
"cspell": "6.31.1",
|
40
40
|
"cssnano": "6.0.1",
|
41
|
-
"eslint": "8.
|
42
|
-
"postcss": "8.4.
|
43
|
-
"prettier": "
|
41
|
+
"eslint": "8.44.0",
|
42
|
+
"postcss": "8.4.25",
|
43
|
+
"prettier": "3.0.0",
|
44
44
|
"prettier-plugin-tailwindcss": "0.3.0",
|
45
|
-
"typescript": "5.1.
|
45
|
+
"typescript": "5.1.6"
|
46
46
|
},
|
47
47
|
"license": "MIT"
|
48
48
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
|