proto-sudoku-wc 0.0.726 → 0.0.728

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.
@@ -107,6 +107,7 @@ function queryNonceMetaTagContent(doc) {
107
107
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
108
108
  const h = (nodeName, vnodeData, ...children) => {
109
109
  let child = null;
110
+ let key = null;
110
111
  let simple = false;
111
112
  let lastSimple = false;
112
113
  const vNodeChildren = [];
@@ -134,6 +135,9 @@ const h = (nodeName, vnodeData, ...children) => {
134
135
  };
135
136
  walk(children);
136
137
  if (vnodeData) {
138
+ if (vnodeData.key) {
139
+ key = vnodeData.key;
140
+ }
137
141
  // normalize class / className attributes
138
142
  {
139
143
  const classData = vnodeData.className || vnodeData.class;
@@ -156,6 +160,9 @@ const h = (nodeName, vnodeData, ...children) => {
156
160
  if (vNodeChildren.length > 0) {
157
161
  vnode.$children$ = vNodeChildren;
158
162
  }
163
+ {
164
+ vnode.$key$ = key;
165
+ }
159
166
  return vnode;
160
167
  };
161
168
  /**
@@ -177,6 +184,9 @@ const newVNode = (tag, text) => {
177
184
  {
178
185
  vnode.$attrs$ = null;
179
186
  }
187
+ {
188
+ vnode.$key$ = null;
189
+ }
180
190
  return vnode;
181
191
  };
182
192
  const Host = {};
@@ -402,6 +412,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
402
412
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
403
413
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
404
414
  }
415
+ else if (memberName === 'key')
416
+ ;
405
417
  else if ((!isProp ) &&
406
418
  memberName[0] === 'o' &&
407
419
  memberName[1] === 'n') {
@@ -713,6 +725,8 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
713
725
  const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
714
726
  let oldStartIdx = 0;
715
727
  let newStartIdx = 0;
728
+ let idxInOld = 0;
729
+ let i = 0;
716
730
  let oldEndIdx = oldCh.length - 1;
717
731
  let oldStartVnode = oldCh[0];
718
732
  let oldEndVnode = oldCh[oldEndIdx];
@@ -720,6 +734,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
720
734
  let newStartVnode = newCh[0];
721
735
  let newEndVnode = newCh[newEndIdx];
722
736
  let node;
737
+ let elmToMove;
723
738
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
724
739
  if (oldStartVnode == null) {
725
740
  // VNode might have been moved left
@@ -786,7 +801,41 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
786
801
  newStartVnode = newCh[++newStartIdx];
787
802
  }
788
803
  else {
804
+ // Here we do some checks to match up old and new nodes based on the
805
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
806
+ // in the JSX for a DOM element in the implementation of a Stencil
807
+ // component.
808
+ //
809
+ // First we check to see if there are any nodes in the array of old
810
+ // children which have the same key as the first node in the new
811
+ // children.
812
+ idxInOld = -1;
789
813
  {
814
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
815
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
816
+ idxInOld = i;
817
+ break;
818
+ }
819
+ }
820
+ }
821
+ if (idxInOld >= 0) {
822
+ // We found a node in the old children which matches up with the first
823
+ // node in the new children! So let's deal with that
824
+ elmToMove = oldCh[idxInOld];
825
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
826
+ // the tag doesn't match so we'll need a new DOM element
827
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
828
+ }
829
+ else {
830
+ patch(elmToMove, newStartVnode, isInitialRender);
831
+ // invalidate the matching old node so that we won't try to update it
832
+ // again later on
833
+ oldCh[idxInOld] = undefined;
834
+ node = elmToMove.$elm$;
835
+ }
836
+ newStartVnode = newCh[++newStartIdx];
837
+ }
838
+ else {
790
839
  // We either didn't find an element in the old children that matches
791
840
  // the key of the first new child OR the build is not using `key`
792
841
  // attributes at all. In either case we need to create a new element
@@ -836,6 +885,14 @@ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
836
885
  // compare if two vnode to see if they're "technically" the same
837
886
  // need to have the same element tag, and same key to be the same
838
887
  if (leftVNode.$tag$ === rightVNode.$tag$) {
888
+ // this will be set if JSX tags in the build have `key` attrs set on them
889
+ // we only want to check this if we're not on the first render since on
890
+ // first render `leftVNode.$key$` will always be `null`, so we can be led
891
+ // astray and, for instance, accidentally delete a DOM node that we want to
892
+ // keep around.
893
+ if (!isInitialRender) {
894
+ return leftVNode.$key$ === rightVNode.$key$;
895
+ }
839
896
  return true;
840
897
  }
841
898
  return false;
@@ -1621,8 +1678,19 @@ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1621
1678
  /**
1622
1679
  * A WeakMap mapping runtime component references to their corresponding host reference
1623
1680
  * instances.
1681
+ *
1682
+ * **Note**: If we're in an HMR context we need to store a reference to this
1683
+ * value on `window` in order to maintain the mapping of {@link d.RuntimeRef}
1684
+ * to {@link d.HostRef} across HMR updates.
1685
+ *
1686
+ * This is necessary because when HMR updates for a component are processed by
1687
+ * the browser-side dev server client the JS bundle for that component is
1688
+ * re-fetched. Since the module containing {@link hostRefs} is included in
1689
+ * that bundle, if we do not store a reference to it the new iteration of the
1690
+ * component will not have access to the previous hostRef map, leading to a
1691
+ * bug where the new version of the component cannot properly initialize.
1624
1692
  */
1625
- const hostRefs = /*@__PURE__*/ new WeakMap();
1693
+ const hostRefs = new WeakMap();
1626
1694
  /**
1627
1695
  * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
1628
1696
  *
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-2f28f070.js');
5
+ const index = require('./index-e78c8e47.js');
6
6
 
7
7
  const defineCustomElements = (win, options) => {
8
8
  if (typeof window === 'undefined') return undefined;
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-2f28f070.js');
5
+ const index = require('./index-e78c8e47.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Browser v4.10.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.12.0 | 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));
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-2f28f070.js');
5
+ const index = require('./index-e78c8e47.js');
6
6
 
7
7
  const Alien = props => {
8
8
  const hex = props.hex || 'currentColor';
@@ -795,6 +795,7 @@ const createInstance = (defaults) => {
795
795
  return ky;
796
796
  };
797
797
  const ky = createInstance();
798
+ const ky$1 = ky;
798
799
 
799
800
  // --------------------------------------------------------[ mutable store ]
800
801
  const storeDef = {
@@ -943,7 +944,7 @@ const getPrefixFor = (platform) => {
943
944
  };
944
945
  const initApi = (platform) => {
945
946
  const prefix = getPrefixFor(platform);
946
- api = ky.extend({
947
+ api = ky$1.extend({
947
948
  hooks: {
948
949
  beforeRequest: [
949
950
  request => {
@@ -1231,6 +1232,7 @@ const ToolBar = _props => {
1231
1232
  };
1232
1233
 
1233
1234
  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, system-ui, sans-serif, 'Apple Color Emoji',\n '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)}";
1235
+ const ProtoSudokuStyle0 = protoSudokuCss;
1234
1236
 
1235
1237
  const ProtoSudoku = class {
1236
1238
  constructor(hostRef) {
@@ -1242,9 +1244,9 @@ const ProtoSudoku = class {
1242
1244
  actions.initApp(this.platform);
1243
1245
  }
1244
1246
  render() {
1245
- return (index.h("div", { id: "app", class: "ds1-main relative max-w-min p-0.5" }, index.h(Eswat2Io, null), index.h(Header, null, "Sudoku"), index.h(SudokuBoard, null), index.h(Keys, null), index.h("hr", { class: "ml-0 mr-0" }), index.h(ToolBar, null), index.h(Alerts, null)));
1247
+ return (index.h("div", { key: '9f50eec975c4da5f4984b80380067d5155dda0d1', id: "app", class: "ds1-main relative max-w-min p-0.5" }, index.h(Eswat2Io, { key: 'e7bab7e257022a9920f8b43785d9dc33ab7fed65' }), index.h(Header, { key: 'd8c32e6b9c20b9fe6c8ff2e9fc7a9900057a2679' }, "Sudoku"), index.h(SudokuBoard, { key: '8a028015ae4380aaa54a406ccf5cc908816ca6a4' }), index.h(Keys, { key: '951b6d20ca7a99ced4c60aa39fe040af6e96dd46' }), index.h("hr", { key: '35ba2812a3b068b21b5252c5f07d0b5dc2f18527', class: "ml-0 mr-0" }), index.h(ToolBar, { key: '114e7edd4bf3da82ae344f56cb7e856ce17a6da8' }), index.h(Alerts, { key: '2c15eb0ba714d1e0c378882c62ce575c428adc2a' })));
1246
1248
  }
1247
1249
  };
1248
- ProtoSudoku.style = protoSudokuCss;
1250
+ ProtoSudoku.style = ProtoSudokuStyle0;
1249
1251
 
1250
1252
  exports.proto_sudoku = ProtoSudoku;
@@ -4,7 +4,7 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "4.10.0",
7
+ "version": "4.12.0",
8
8
  "typescriptVersion": "5.3.3"
9
9
  },
10
10
  "collections": [],
@@ -15,7 +15,7 @@ export class ProtoSudoku {
15
15
  actions.initApp(this.platform);
16
16
  }
17
17
  render() {
18
- return (h("div", { id: "app", class: "ds1-main relative max-w-min p-0.5" }, h(Eswat2Io, null), h(Header, null, "Sudoku"), h(SudokuBoard, null), h(Keys, null), h("hr", { class: "ml-0 mr-0" }), h(ToolBar, null), h(Alerts, null)));
18
+ return (h("div", { key: '9f50eec975c4da5f4984b80380067d5155dda0d1', id: "app", class: "ds1-main relative max-w-min p-0.5" }, h(Eswat2Io, { key: 'e7bab7e257022a9920f8b43785d9dc33ab7fed65' }), h(Header, { key: 'd8c32e6b9c20b9fe6c8ff2e9fc7a9900057a2679' }, "Sudoku"), h(SudokuBoard, { key: '8a028015ae4380aaa54a406ccf5cc908816ca6a4' }), h(Keys, { key: '951b6d20ca7a99ced4c60aa39fe040af6e96dd46' }), h("hr", { key: '35ba2812a3b068b21b5252c5f07d0b5dc2f18527', class: "ml-0 mr-0" }), h(ToolBar, { key: '114e7edd4bf3da82ae344f56cb7e856ce17a6da8' }), h(Alerts, { key: '2c15eb0ba714d1e0c378882c62ce575c428adc2a' })));
19
19
  }
20
20
  static get is() { return "proto-sudoku"; }
21
21
  static get encapsulation() { return "shadow"; }
@@ -85,6 +85,7 @@ function queryNonceMetaTagContent(doc) {
85
85
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
86
86
  const h = (nodeName, vnodeData, ...children) => {
87
87
  let child = null;
88
+ let key = null;
88
89
  let simple = false;
89
90
  let lastSimple = false;
90
91
  const vNodeChildren = [];
@@ -112,6 +113,9 @@ const h = (nodeName, vnodeData, ...children) => {
112
113
  };
113
114
  walk(children);
114
115
  if (vnodeData) {
116
+ if (vnodeData.key) {
117
+ key = vnodeData.key;
118
+ }
115
119
  // normalize class / className attributes
116
120
  {
117
121
  const classData = vnodeData.className || vnodeData.class;
@@ -134,6 +138,9 @@ const h = (nodeName, vnodeData, ...children) => {
134
138
  if (vNodeChildren.length > 0) {
135
139
  vnode.$children$ = vNodeChildren;
136
140
  }
141
+ {
142
+ vnode.$key$ = key;
143
+ }
137
144
  return vnode;
138
145
  };
139
146
  /**
@@ -155,6 +162,9 @@ const newVNode = (tag, text) => {
155
162
  {
156
163
  vnode.$attrs$ = null;
157
164
  }
165
+ {
166
+ vnode.$key$ = null;
167
+ }
158
168
  return vnode;
159
169
  };
160
170
  const Host = {};
@@ -380,6 +390,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
380
390
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
381
391
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
382
392
  }
393
+ else if (memberName === 'key')
394
+ ;
383
395
  else if ((!isProp ) &&
384
396
  memberName[0] === 'o' &&
385
397
  memberName[1] === 'n') {
@@ -691,6 +703,8 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
691
703
  const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
692
704
  let oldStartIdx = 0;
693
705
  let newStartIdx = 0;
706
+ let idxInOld = 0;
707
+ let i = 0;
694
708
  let oldEndIdx = oldCh.length - 1;
695
709
  let oldStartVnode = oldCh[0];
696
710
  let oldEndVnode = oldCh[oldEndIdx];
@@ -698,6 +712,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
698
712
  let newStartVnode = newCh[0];
699
713
  let newEndVnode = newCh[newEndIdx];
700
714
  let node;
715
+ let elmToMove;
701
716
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
702
717
  if (oldStartVnode == null) {
703
718
  // VNode might have been moved left
@@ -764,7 +779,41 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
764
779
  newStartVnode = newCh[++newStartIdx];
765
780
  }
766
781
  else {
782
+ // Here we do some checks to match up old and new nodes based on the
783
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
784
+ // in the JSX for a DOM element in the implementation of a Stencil
785
+ // component.
786
+ //
787
+ // First we check to see if there are any nodes in the array of old
788
+ // children which have the same key as the first node in the new
789
+ // children.
790
+ idxInOld = -1;
767
791
  {
792
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
793
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
794
+ idxInOld = i;
795
+ break;
796
+ }
797
+ }
798
+ }
799
+ if (idxInOld >= 0) {
800
+ // We found a node in the old children which matches up with the first
801
+ // node in the new children! So let's deal with that
802
+ elmToMove = oldCh[idxInOld];
803
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
804
+ // the tag doesn't match so we'll need a new DOM element
805
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
806
+ }
807
+ else {
808
+ patch(elmToMove, newStartVnode, isInitialRender);
809
+ // invalidate the matching old node so that we won't try to update it
810
+ // again later on
811
+ oldCh[idxInOld] = undefined;
812
+ node = elmToMove.$elm$;
813
+ }
814
+ newStartVnode = newCh[++newStartIdx];
815
+ }
816
+ else {
768
817
  // We either didn't find an element in the old children that matches
769
818
  // the key of the first new child OR the build is not using `key`
770
819
  // attributes at all. In either case we need to create a new element
@@ -814,6 +863,14 @@ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
814
863
  // compare if two vnode to see if they're "technically" the same
815
864
  // need to have the same element tag, and same key to be the same
816
865
  if (leftVNode.$tag$ === rightVNode.$tag$) {
866
+ // this will be set if JSX tags in the build have `key` attrs set on them
867
+ // we only want to check this if we're not on the first render since on
868
+ // first render `leftVNode.$key$` will always be `null`, so we can be led
869
+ // astray and, for instance, accidentally delete a DOM node that we want to
870
+ // keep around.
871
+ if (!isInitialRender) {
872
+ return leftVNode.$key$ === rightVNode.$key$;
873
+ }
817
874
  return true;
818
875
  }
819
876
  return false;
@@ -1599,8 +1656,19 @@ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1599
1656
  /**
1600
1657
  * A WeakMap mapping runtime component references to their corresponding host reference
1601
1658
  * instances.
1659
+ *
1660
+ * **Note**: If we're in an HMR context we need to store a reference to this
1661
+ * value on `window` in order to maintain the mapping of {@link d.RuntimeRef}
1662
+ * to {@link d.HostRef} across HMR updates.
1663
+ *
1664
+ * This is necessary because when HMR updates for a component are processed by
1665
+ * the browser-side dev server client the JS bundle for that component is
1666
+ * re-fetched. Since the module containing {@link hostRefs} is included in
1667
+ * that bundle, if we do not store a reference to it the new iteration of the
1668
+ * component will not have access to the previous hostRef map, leading to a
1669
+ * bug where the new version of the component cannot properly initialize.
1602
1670
  */
1603
- const hostRefs = /*@__PURE__*/ new WeakMap();
1671
+ const hostRefs = new WeakMap();
1604
1672
  /**
1605
1673
  * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
1606
1674
  *
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-8700e73d.js';
2
- export { s as setNonce } from './index-8700e73d.js';
1
+ import { b as bootstrapLazy } from './index-985e3256.js';
2
+ export { s as setNonce } from './index-985e3256.js';
3
3
 
4
4
  const defineCustomElements = (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
@@ -1,8 +1,8 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-8700e73d.js';
2
- export { s as setNonce } from './index-8700e73d.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-985e3256.js';
2
+ export { s as setNonce } from './index-985e3256.js';
3
3
 
4
4
  /*
5
- Stencil Client Patch Browser v4.10.0 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Browser v4.12.0 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  const patchBrowser = () => {
8
8
  const importMeta = import.meta.url;
@@ -1,4 +1,4 @@
1
- import { h, g as getRenderingRef, f as forceUpdate, r as registerInstance } from './index-8700e73d.js';
1
+ import { h, g as getRenderingRef, f as forceUpdate, r as registerInstance } from './index-985e3256.js';
2
2
 
3
3
  const Alien = props => {
4
4
  const hex = props.hex || 'currentColor';
@@ -791,6 +791,7 @@ const createInstance = (defaults) => {
791
791
  return ky;
792
792
  };
793
793
  const ky = createInstance();
794
+ const ky$1 = ky;
794
795
 
795
796
  // --------------------------------------------------------[ mutable store ]
796
797
  const storeDef = {
@@ -939,7 +940,7 @@ const getPrefixFor = (platform) => {
939
940
  };
940
941
  const initApi = (platform) => {
941
942
  const prefix = getPrefixFor(platform);
942
- api = ky.extend({
943
+ api = ky$1.extend({
943
944
  hooks: {
944
945
  beforeRequest: [
945
946
  request => {
@@ -1227,6 +1228,7 @@ const ToolBar = _props => {
1227
1228
  };
1228
1229
 
1229
1230
  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, system-ui, sans-serif, 'Apple Color Emoji',\n '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)}";
1231
+ const ProtoSudokuStyle0 = protoSudokuCss;
1230
1232
 
1231
1233
  const ProtoSudoku = class {
1232
1234
  constructor(hostRef) {
@@ -1238,9 +1240,9 @@ const ProtoSudoku = class {
1238
1240
  actions.initApp(this.platform);
1239
1241
  }
1240
1242
  render() {
1241
- return (h("div", { id: "app", class: "ds1-main relative max-w-min p-0.5" }, h(Eswat2Io, null), h(Header, null, "Sudoku"), h(SudokuBoard, null), h(Keys, null), h("hr", { class: "ml-0 mr-0" }), h(ToolBar, null), h(Alerts, null)));
1243
+ return (h("div", { key: '9f50eec975c4da5f4984b80380067d5155dda0d1', id: "app", class: "ds1-main relative max-w-min p-0.5" }, h(Eswat2Io, { key: 'e7bab7e257022a9920f8b43785d9dc33ab7fed65' }), h(Header, { key: 'd8c32e6b9c20b9fe6c8ff2e9fc7a9900057a2679' }, "Sudoku"), h(SudokuBoard, { key: '8a028015ae4380aaa54a406ccf5cc908816ca6a4' }), h(Keys, { key: '951b6d20ca7a99ced4c60aa39fe040af6e96dd46' }), h("hr", { key: '35ba2812a3b068b21b5252c5f07d0b5dc2f18527', class: "ml-0 mr-0" }), h(ToolBar, { key: '114e7edd4bf3da82ae344f56cb7e856ce17a6da8' }), h(Alerts, { key: '2c15eb0ba714d1e0c378882c62ce575c428adc2a' })));
1242
1244
  }
1243
1245
  };
1244
- ProtoSudoku.style = protoSudokuCss;
1246
+ ProtoSudoku.style = ProtoSudokuStyle0;
1245
1247
 
1246
1248
  export { ProtoSudoku as proto_sudoku };
@@ -1,2 +1,2 @@
1
- import{h as t,g as e,f as r,r as o}from"./p-6add2b01.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},p=t=>{d(l,t>=0&&t<81?t:null)},b="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 j({},...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},j=(...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=j(e[t],r)),e={...e,[t]:r};C(o.headers)&&(r=T(r,o.headers),e.headers=r)}return e},M=(()=>{let t=!1,e=!1;const r="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.Request;return r&&o&&(e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")),t&&!e})(),R="function"==typeof globalThis.AbortController,z="function"==typeof globalThis.ReadableStream,S="function"==typeof globalThis.FormData,O=["get","post","put","patch","head","delete"],E={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},A=2147483647,P=Symbol("stop"),U={json:!0,parseJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},q={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0},B=t=>O.includes(t)?t.toUpperCase():t,N=[413,429,503],_={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,delay:t=>.3*2**(t-1)*1e3},D=(t={})=>{if("number"==typeof t)return{..._,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{..._,...t,afterStatusCodes:N}};class H{static create(t,e){const r=new H(t,e),o=async()=>{if("number"==typeof r._options.timeout&&r._options.timeout>A)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(!z)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(E))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:j({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:B(e.method??this._input.method),prefixUrl:String(e.prefixUrl||""),retry:D(e.retry),throwHttpErrors:!1!==e.throwHttpErrors,timeout:e.timeout??1e4,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(M&&(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);!(S&&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}const e=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,e)}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),A);if(0!==r&&this._retryCount>0){await async function(t,{signal:e}){return new Promise(((r,o)=>{function s(){clearTimeout(n),o(e.reason)}e&&(e.throwIfAborted(),e.addEventListener("abort",s,{once:!0}));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})===P)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}const t=((t,e)=>{const r={};for(const o in e)o in q||o in U||o in t||(r[o]=e[o]);return r})(this.request,this._options);return!1===this._options.timeout?this._options.fetch(this.request.clone(),t):async function(t,e,r,o){return new Promise(((s,n)=>{const a=setTimeout((()=>{r&&r.abort(),n(new v(t))}),o.timeout);o.fetch(t,e).then(s).catch(n).then((()=>{clearTimeout(a)}))}))}(this.request.clone(),t,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 O)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=P,e},L=$(),J={list:[],keys:[],locs:[],loading:!1,solved:!1,error:void 0,pick:void 0,data:void 0},{state:I}=(()=>{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)))}}})(J,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!=I.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}=I,r=new Set;return t.map((t=>{const{key:o}=e[t];"."!=o&&r.add(o)})),X.filter((t=>!r.has(t)))})(a);I.pick=r,I.keys=i,I.locs=a}else I.pick=void 0,I.keys=[],I.locs=[];F(I.pick)};let K;const V={netlify:"/.netlify/functions",vercel:"https://sudoku-rust-api.vercel.app/api"},Y=t=>{f(t)},F=t=>{p(t)},G=(t=!1)=>{I.list=[],I.keys=[],I.locs=[],I.loading=t,I.solved=!1,I.error=void 0,I.pick=void 0,I.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),I.data=t,I.list=a}else I.data=void 0,I.list=[]})({puzzle:r,ref:o})},tt=t=>{I.list=[...t],t.length=0},et={initApp:t=>{(t=>{const e=(t=>{const e=Object.keys(V).includes(t)?t:"vercel";return V[e]})(t);K=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}=I;Z(t[r])}},refresh:async()=>{G(!0),Y([]),F(I.pick);try{const t=await K.get("puzzle").json();Q(t)}catch(t){const{message:e}=t;console.log("-- ",e),console.log(t),I.error=e}finally{I.loading=!1}},select:t=>{Z(t)},check:()=>{const{list:t}=I,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;Y(o?e:[]),r>0?tt(t):81===n&&(I.solved=!0)},input:t=>{const{pick:e,list:r}=I;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}=I;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===b?"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}=I,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)),pt=[18,19,20,21,22,23,24,25,26,45,46,47,48,49,50,51,52,53],bt=pt.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":"",pt.includes(l)?"border-xbb-clrs-navy":"",bt.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}=I;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.4.1"),yt=t=>()=>{t.refresh()},xt=t=>()=>{t.check()},vt=()=>{const{list:e,solved:r}=I;return t("div",{class:"flex flex-row"},t(dt,{label:g,callback:yt(et)}),81!==e.length||r?"":t(dt,{label:b,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, sans-serif, 'Apple Color Emoji',\n '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-ce641d1f.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)},f=()=>[...c(i)],h=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 j({},...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},j=(...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=j(e[t],r)),e={...e,[t]:r};C(o.headers)&&(r=T(r,o.headers),e.headers=r)}return e},M=(()=>{let t=!1,e=!1;const r="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.Request;return r&&o&&(e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")),t&&!e})(),R="function"==typeof globalThis.AbortController,z="function"==typeof globalThis.ReadableStream,S="function"==typeof globalThis.FormData,O=["get","post","put","patch","head","delete"],E={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},A=2147483647,P=Symbol("stop"),U={json:!0,parseJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},q={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0},B=t=>O.includes(t)?t.toUpperCase():t,N=[413,429,503],_={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,delay:t=>.3*2**(t-1)*1e3},D=(t={})=>{if("number"==typeof t)return{..._,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{..._,...t,afterStatusCodes:N}};class H{static create(t,e){const r=new H(t,e),o=async()=>{if("number"==typeof r._options.timeout&&r._options.timeout>A)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(!z)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(E))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:j({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:B(e.method??this._input.method),prefixUrl:String(e.prefixUrl||""),retry:D(e.retry),throwHttpErrors:!1!==e.throwHttpErrors,timeout:e.timeout??1e4,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(M&&(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);!(S&&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}const e=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,e)}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),A);if(0!==r&&this._retryCount>0){await async function(t,{signal:e}){return new Promise(((r,o)=>{function s(){clearTimeout(n),o(e.reason)}e&&(e.throwIfAborted(),e.addEventListener("abort",s,{once:!0}));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})===P)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}const t=((t,e)=>{const r={};for(const o in e)o in q||o in U||o in t||(r[o]=e[o]);return r})(this.request,this._options);return!1===this._options.timeout?this._options.fetch(this.request.clone(),t):async function(t,e,r,o){return new Promise(((s,n)=>{const a=setTimeout((()=>{r&&r.abort(),n(new v(t))}),o.timeout);o.fetch(t,e).then(s).catch(n).then((()=>{clearTimeout(a)}))}))}(this.request.clone(),t,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 O)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=P,e},L=$(),J={list:[],keys:[],locs:[],loading:!1,solved:!1,error:void 0,pick:void 0,data:void 0},{state:I}=(()=>{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)))}}})(J,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!=I.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}=I,r=new Set;return t.map((t=>{const{key:o}=e[t];"."!=o&&r.add(o)})),X.filter((t=>!r.has(t)))})(a);I.pick=r,I.keys=i,I.locs=a}else I.pick=void 0,I.keys=[],I.locs=[];F(I.pick)};let K;const V={netlify:"/.netlify/functions",vercel:"https://sudoku-rust-api.vercel.app/api"},Y=t=>{h(t)},F=t=>{b(t)},G=(t=!1)=>{I.list=[],I.keys=[],I.locs=[],I.loading=t,I.solved=!1,I.error=void 0,I.pick=void 0,I.data=void 0},Q=(t,e=!0)=>{const{puzzle:r,ref:o}=t;e&&(h([]),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=>{f().forEach(((e,r)=>{const o=t[r],{isClue:s}=o;s||(o.key=e)}))})(a),I.data=t,I.list=a}else I.data=void 0,I.list=[]})({puzzle:r,ref:o})},tt=t=>{I.list=[...t],t.length=0},et={initApp:t=>{(t=>{const e=(t=>{const e=Object.keys(V).includes(t)?t:"vercel";return V[e]})(t);K=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}=I;Z(t[r])}},refresh:async()=>{G(!0),Y([]),F(I.pick);try{const t=await K.get("puzzle").json();Q(t)}catch(t){const{message:e}=t;console.log("-- ",e),console.log(t),I.error=e}finally{I.loading=!1}},select:t=>{Z(t)},check:()=>{const{list:t}=I,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;Y(o?e:[]),r>0?tt(t):81===n&&(I.solved=!0)},input:t=>{const{pick:e,list:r}=I;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}=I;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)},ft=()=>{const{keys:e,list:r,pick:o,solved:s}=I,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}))))},ht=[2,5,11,14,20,23,29,32,38,41,47,50,56,59,65,68,74,77],ut=ht.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}`,ht.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}=I;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.4.1"),yt=t=>()=>{t.refresh()},xt=t=>()=>{t.check()},vt=()=>{const{list:e,solved:r}=I;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",{key:"9f50eec975c4da5f4984b80380067d5155dda0d1",id:"app",class:"ds1-main relative max-w-min p-0.5"},t(lt,{key:"e7bab7e257022a9920f8b43785d9dc33ab7fed65"}),t(ct,{key:"d8c32e6b9c20b9fe6c8ff2e9fc7a9900057a2679"},"Sudoku"),t(wt,{key:"8a028015ae4380aaa54a406ccf5cc908816ca6a4"}),t(ft,{key:"951b6d20ca7a99ced4c60aa39fe040af6e96dd46"}),t("hr",{key:"35ba2812a3b068b21b5252c5f07d0b5dc2f18527",class:"ml-0 mr-0"}),t(vt,{key:"114e7edd4bf3da82ae344f56cb7e856ce17a6da8"}),t(nt,{key:"2c15eb0ba714d1e0c378882c62ce575c428adc2a"}))}};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, sans-serif, 'Apple Color Emoji',\n '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}
@@ -0,0 +1,2 @@
1
+ let e,n,t=!1,l=null,o=!1;const s="slot-fb{display:contents}slot-fb[hidden]{display:none}",i={},r=e=>"object"==(e=typeof e)||"function"===e;function c(e){var n,t,l;return null!==(l=null===(t=null===(n=e.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===t?void 0:t.getAttribute("content"))&&void 0!==l?l:void 0}const u=(e,n,...t)=>{let l=null,o=null,s=!1,i=!1;const c=[],u=n=>{for(let t=0;t<n.length;t++)l=n[t],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!r(l))&&(l+=""),s&&i?c[c.length-1].t+=l:c.push(s?f(null,l):l),i=s)};if(u(t),n){n.key&&(o=n.key);{const e=n.className||n.class;e&&(n.class="object"!=typeof e?e:Object.keys(e).filter((n=>e[n])).join(" "))}}if("function"==typeof e)return e(null===n?{}:n,c,d);const a=f(e,null);return a.l=n,c.length>0&&(a.o=c),a.i=o,a},f=(e,n)=>({u:0,v:e,t:n,p:null,o:null,l:null,i:null}),a={},d={forEach:(e,n)=>e.map(v).forEach(n),map:(e,n)=>e.map(v).map(n).map(y)},v=e=>({vattrs:e.l,vchildren:e.o,vkey:e.i,vname:e.h,vtag:e.v,vtext:e.t}),y=e=>{if("function"==typeof e.vtag){const n=Object.assign({},e.vattrs);return e.vkey&&(n.key=e.vkey),e.vname&&(n.name=e.vname),u(e.vtag,n,...e.vchildren||[])}const n=f(e.vtag,e.vtext);return n.l=e.vattrs,n.o=e.vchildren,n.i=e.vkey,n.h=e.vname,n},p=new WeakMap,h=e=>"sc-"+e.$,$=(e,n,t,l,o,s)=>{if(t!==l){let i=J(e,n),c=n.toLowerCase();if("class"===n){const n=e.classList,o=b(t),s=b(l);n.remove(...o.filter((e=>e&&!s.includes(e)))),n.add(...s.filter((e=>e&&!o.includes(e))))}else if("key"===n);else if(i||"o"!==n[0]||"n"!==n[1]){const c=r(l);if((i||c&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[n]=l;else{const o=null==l?"":l;"list"===n?i=!1:null!=t&&e[n]==o||(e[n]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(n)||e.removeAttribute(n):(!i||4&s||o)&&!c&&e.setAttribute(n,l=!0===l?"":l)}else if(n="-"===n[2]?n.slice(3):J(Z,c)?c.slice(2):c[2]+n.slice(3),t||l){const o=n.endsWith(w);n=n.replace(g,""),t&&ne.rel(e,n,t,o),l&&ne.ael(e,n,l,o)}}},m=/\s/,b=e=>e?e.split(m):[],w="Capture",g=RegExp(w+"$"),j=(e,n,t,l)=>{const o=11===n.p.nodeType&&n.p.host?n.p.host:n.p,s=e&&e.l||i,r=n.l||i;for(l in s)l in r||$(o,l,s[l],void 0,t,n.u);for(l in r)$(o,l,s[l],r[l],t,n.u)},S=(l,o,s)=>{const i=o.o[s];let r,c,u=0;if(null!==i.t)r=i.p=ee.createTextNode(i.t);else{if(t||(t="svg"===i.v),r=i.p=ee.createElementNS(t?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i.v),t&&"foreignObject"===i.v&&(t=!1),j(null,i,t),null!=e&&r["s-si"]!==e&&r.classList.add(r["s-si"]=e),i.o)for(u=0;u<i.o.length;++u)c=S(l,i,u),c&&r.appendChild(c);"svg"===i.v?t=!1:"foreignObject"===r.tagName&&(t=!0)}return r["s-hn"]=n,r},k=(e,t,l,o,s,i)=>{let r,c=e;for(c.shadowRoot&&c.tagName===n&&(c=c.shadowRoot);s<=i;++s)o[s]&&(r=S(null,l,s),r&&(o[s].p=r,c.insertBefore(r,t)))},O=(e,n,t)=>{for(let l=n;l<=t;++l){const n=e[l];if(n){const e=n.p;e&&e.remove()}}},M=(e,n,t=!1)=>e.v===n.v&&(!!t||e.i===n.i),C=(e,n,l=!1)=>{const o=n.p=e.p,s=e.o,i=n.o,r=n.v,c=n.t;null===c?(t="svg"===r||"foreignObject"!==r&&t,j(e,n,t),null!==s&&null!==i?((e,n,t,l,o=!1)=>{let s,i,r=0,c=0,u=0,f=0,a=n.length-1,d=n[0],v=n[a],y=l.length-1,p=l[0],h=l[y];for(;r<=a&&c<=y;)if(null==d)d=n[++r];else if(null==v)v=n[--a];else if(null==p)p=l[++c];else if(null==h)h=l[--y];else if(M(d,p,o))C(d,p,o),d=n[++r],p=l[++c];else if(M(v,h,o))C(v,h,o),v=n[--a],h=l[--y];else if(M(d,h,o))C(d,h,o),e.insertBefore(d.p,v.p.nextSibling),d=n[++r],h=l[--y];else if(M(v,p,o))C(v,p,o),e.insertBefore(v.p,d.p),v=n[--a],p=l[++c];else{for(u=-1,f=r;f<=a;++f)if(n[f]&&null!==n[f].i&&n[f].i===p.i){u=f;break}u>=0?(i=n[u],i.v!==p.v?s=S(n&&n[c],t,u):(C(i,p,o),n[u]=void 0,s=i.p),p=l[++c]):(s=S(n&&n[c],t,c),p=l[++c]),s&&d.p.parentNode.insertBefore(s,d.p)}r>a?k(e,null==l[y+1]?null:l[y+1].p,t,l,c,y):c>y&&O(n,r,a)})(o,s,n,i,l):null!==i?(null!==e.t&&(o.textContent=""),k(o,null,n,i,0,i.length-1)):null!==s&&O(s,0,s.length-1),t&&"svg"===r&&(t=!1)):e.t!==c&&(o.data=c)},x=(e,n)=>{n&&!e.m&&n["s-p"]&&n["s-p"].push(new Promise((n=>e.m=n)))},E=(e,n)=>{if(e.u|=16,!(4&e.u))return x(e,e.j),fe((()=>P(e,n)));e.u|=512},P=(e,n)=>{const t=e.S;return A(void 0,(()=>N(e,t,n)))},A=(e,n)=>L(e)?e.then(n):n(),L=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,N=async(e,n,t)=>{var l;const o=e.$hostElement$,i=o["s-rc"];t&&(e=>{const n=e.k,t=e.$hostElement$,l=n.u,o=((e,n)=>{var t;const l=h(n),o=Y.get(l);if(e=11===e.nodeType?e:ee,o)if("string"==typeof o){let i,r=p.get(e=e.head||e);if(r||p.set(e,r=new Set),!r.has(l)){{i=ee.createElement("style"),i.innerHTML=o;const n=null!==(t=ne.O)&&void 0!==t?t:c(ee);null!=n&&i.setAttribute("nonce",n),e.insertBefore(i,e.querySelector("link"))}4&n.u&&(i.innerHTML+=s),r&&r.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(t.shadowRoot?t.shadowRoot:t.getRootNode(),n);10&l&&(t["s-sc"]=o,t.classList.add(o+"-h"))})(e);R(e,n,o,t),i&&(i.map((e=>e())),o["s-rc"]=void 0);{const n=null!==(l=o["s-p"])&&void 0!==l?l:[],t=()=>U(e);0===n.length?t():(Promise.all(n).then(t),e.u|=4,n.length=0)}},R=(t,o,s,i)=>{try{l=o,o=o.render(),t.u&=-17,t.u|=2,((t,l,o=!1)=>{const s=t.$hostElement$,i=t.M||f(null,null),r=(e=>e&&e.v===a)(l)?l:u(null,null,l);if(n=s.tagName,o&&r.l)for(const e of Object.keys(r.l))s.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.l[e]=s[e]);r.v=null,r.u|=4,t.M=r,r.p=i.p=s.shadowRoot||s,e=s["s-sc"],C(i,r,o)})(t,o,i)}catch(e){K(e,t.$hostElement$)}return l=null,null},T=()=>l,U=e=>{const n=e.$hostElement$,t=e.S,l=e.j;64&e.u||(e.u|=64,F(n),D(t,"componentDidLoad"),e.C(n),l||q()),e.m&&(e.m(),e.m=void 0),512&e.u&&ue((()=>E(e,!1))),e.u&=-517},W=e=>{{const n=B(e),t=n.$hostElement$.isConnected;return t&&2==(18&n.u)&&E(n,!1),t}},q=()=>{F(ee.documentElement),ue((()=>(e=>{const n=ne.ce("appload",{detail:{namespace:"proto-sudoku-wc"}});return e.dispatchEvent(n),n})(Z)))},D=(e,n,t)=>{if(e&&e[n])try{return e[n](t)}catch(e){K(e)}},F=e=>e.classList.add("hydrated"),H=(e,n,t)=>{var l;const o=e.prototype;if(n.P){const s=Object.entries(n.P);if(s.map((([e,[l]])=>{(31&l||2&t&&32&l)&&Object.defineProperty(o,e,{get(){return((e,n)=>B(this).A.get(n))(0,e)},set(t){((e,n,t,l)=>{const o=B(e),s=o.A.get(n),i=o.u,c=o.S;t=((e,n)=>null==e||r(e)?e:1&n?e+"":e)(t,l.P[n][0]),8&i&&void 0!==s||t===s||Number.isNaN(s)&&Number.isNaN(t)||(o.A.set(n,t),c&&2==(18&i)&&E(o,!1))})(this,e,t,n)},configurable:!0,enumerable:!0})})),1&t){const t=new Map;o.attributeChangedCallback=function(e,l,s){ne.jmp((()=>{var i;const r=t.get(e);if(this.hasOwnProperty(r))s=this[r],delete this[r];else{if(o.hasOwnProperty(r)&&"number"==typeof this[r]&&this[r]==s)return;if(null==r){const t=B(this),o=null==t?void 0:t.u;if(o&&!(8&o)&&128&o&&s!==l){const o=t.S,r=null===(i=n.L)||void 0===i?void 0:i[e];null==r||r.forEach((n=>{null!=o[n]&&o[n].call(o,s,l,e)}))}return}}this[r]=(null!==s||"boolean"!=typeof this[r])&&s}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!==(l=n.L)&&void 0!==l?l:{}),...s.filter((([e,n])=>15&n[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))]))}}return e},V=(e,n={})=>{var t;const l=[],o=n.exclude||[],i=Z.customElements,r=ee.head,u=r.querySelector("meta[charset]"),f=ee.createElement("style"),a=[];let d,v=!0;Object.assign(ne,n),ne.N=new URL(n.resourcesUrl||"./",ee.baseURI).href;let y=!1;if(e.map((e=>{e[1].map((n=>{const t={u:n[0],$:n[1],P:n[2],R:n[3]};4&t.u&&(y=!0),t.P=n[2];const s=t.$,r=class extends HTMLElement{constructor(e){super(e),I(e=this,t),1&t.u&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),v?a.push(this):ne.jmp((()=>(e=>{if(0==(1&ne.u)){const n=B(e),t=n.k,l=()=>{};if(1&n.u)(null==n?void 0:n.S)||(null==n?void 0:n.T)&&n.T.then((()=>{}));else{n.u|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){x(n,n.j=t);break}}t.P&&Object.entries(t.P).map((([n,[t]])=>{if(31&t&&e.hasOwnProperty(n)){const t=e[n];delete e[n],e[n]=t}})),(async(e,n,t)=>{let l;if(0==(32&n.u)){n.u|=32;{if(l=X(t),l.then){const e=()=>{};l=await l,e()}l.isProxied||(H(l,t,2),l.isProxied=!0);const e=()=>{};n.u|=8;try{new l(n)}catch(e){K(e)}n.u&=-9,e()}if(l.style){let e=l.style;const n=h(t);if(!Y.has(n)){const l=()=>{};((e,n,t)=>{let l=Y.get(e);le&&t?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,Y.set(e,l)})(n,e,!!(1&t.u)),l()}}}const o=n.j,s=()=>E(n,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()})(0,n,t)}l()}})(this)))}disconnectedCallback(){ne.jmp((()=>(async()=>{if(0==(1&ne.u)){const e=B(this);(null==e?void 0:e.S)||(null==e?void 0:e.T)&&e.T.then((()=>{}))}})()))}componentOnReady(){return B(this).T}};t.U=e[0],o.includes(s)||i.get(s)||(l.push(s),i.define(s,H(r,t,1)))}))})),y&&(f.innerHTML+=s),f.innerHTML+=l+"{visibility:hidden}.hydrated{visibility:inherit}",f.innerHTML.length){f.setAttribute("data-styles","");const e=null!==(t=ne.O)&&void 0!==t?t:c(ee);null!=e&&f.setAttribute("nonce",e),r.insertBefore(f,u?u.nextSibling:r.firstChild)}v=!1,a.length?a.map((e=>e.connectedCallback())):ne.jmp((()=>d=setTimeout(q,30)))},_=e=>ne.O=e,z=new WeakMap,B=e=>z.get(e),G=(e,n)=>z.set(n.S=e,n),I=(e,n)=>{const t={u:0,$hostElement$:e,k:n,A:new Map};return t.T=new Promise((e=>t.C=e)),e["s-p"]=[],e["s-rc"]=[],z.set(e,t)},J=(e,n)=>n in e,K=(e,n)=>(0,console.error)(e,n),Q=new Map,X=e=>{const n=e.$.replace(/-/g,"_"),t=e.U,l=Q.get(t);return l?l[n]:import(`./${t}.entry.js`).then((e=>(Q.set(t,e),e[n])),K)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},Y=new Map,Z="undefined"!=typeof window?window:{},ee=Z.document||{head:{}},ne={u:0,N:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,n,t,l)=>e.addEventListener(n,t,l),rel:(e,n,t,l)=>e.removeEventListener(n,t,l),ce:(e,n)=>new CustomEvent(e,n)},te=e=>Promise.resolve(e),le=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),oe=[],se=[],ie=(e,n)=>t=>{e.push(t),o||(o=!0,n&&4&ne.u?ue(ce):ne.raf(ce))},re=e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(e){K(e)}e.length=0},ce=()=>{re(oe),re(se),(o=oe.length>0)&&ne.raf(ce)},ue=e=>te().then(e),fe=ie(se,!0);export{V as b,W as f,T as g,u as h,te as p,G as r,_ as s}
@@ -1 +1 @@
1
- import{p as o,b as t}from"./p-6add2b01.js";export{s as setNonce}from"./p-6add2b01.js";(()=>{const t=import.meta.url,p={};return""!==t&&(p.resourcesUrl=new URL(".",t).href),o(p)})().then((o=>t([["p-3c01bef1",[[1,"proto-sudoku",{tag:[1],platform:[1]}]]]],o)));
1
+ import{p as o,b as t}from"./p-ce641d1f.js";export{s as setNonce}from"./p-ce641d1f.js";(()=>{const t=import.meta.url,p={};return""!==t&&(p.resourcesUrl=new URL(".",t).href),o(p)})().then((o=>t([["p-6728b0ff",[[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.726",
3
+ "version": "0.0.728",
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,8 +27,8 @@
27
27
  "format": "prettier --write src"
28
28
  },
29
29
  "dependencies": {
30
- "@stencil/core": "4.10.0",
31
- "@stencil/store": "2.0.12",
30
+ "@stencil/core": "4.12.0",
31
+ "@stencil/store": "2.0.13",
32
32
  "ky": "1.2.0",
33
33
  "proto-tailwindcss-clrs": "0.0.306",
34
34
  "tailwindcss": "3.4.1"
@@ -1,2 +0,0 @@
1
- let n,t,e=!1,l=null,o=!1;const s="slot-fb{display:contents}slot-fb[hidden]{display:none}",i={},r=n=>"object"==(n=typeof n)||"function"===n;function c(n){var t,e,l;return null!==(l=null===(e=null===(t=n.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===e?void 0:e.getAttribute("content"))&&void 0!==l?l:void 0}const u=(n,t,...e)=>{let l=null,o=!1,s=!1;const i=[],c=t=>{for(let e=0;e<t.length;e++)l=t[e],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof n&&!r(l))&&(l+=""),o&&s?i[i.length-1].t+=l:i.push(o?a(null,l):l),s=o)};if(c(e),t){const n=t.className||t.class;n&&(t.class="object"!=typeof n?n:Object.keys(n).filter((t=>n[t])).join(" "))}if("function"==typeof n)return n(null===t?{}:t,i,d);const u=a(n,null);return u.l=t,i.length>0&&(u.o=i),u},a=(n,t)=>({i:0,u:n,t,v:null,o:null,l:null}),f={},d={forEach:(n,t)=>n.map(v).forEach(t),map:(n,t)=>n.map(v).map(t).map(p)},v=n=>({vattrs:n.l,vchildren:n.o,vkey:n.p,vname:n.h,vtag:n.u,vtext:n.t}),p=n=>{if("function"==typeof n.vtag){const t=Object.assign({},n.vattrs);return n.vkey&&(t.key=n.vkey),n.vname&&(t.name=n.vname),u(n.vtag,t,...n.vchildren||[])}const t=a(n.vtag,n.vtext);return t.l=n.vattrs,t.o=n.vchildren,t.p=n.vkey,t.h=n.vname,t},y=new WeakMap,h=n=>"sc-"+n.m,m=(n,t,e,l,o,s)=>{if(e!==l){let i=J(n,t),c=t.toLowerCase();if("class"===t){const t=n.classList,o=w(e),s=w(l);t.remove(...o.filter((n=>n&&!s.includes(n)))),t.add(...s.filter((n=>n&&!o.includes(n))))}else if(i||"o"!==t[0]||"n"!==t[1]){const c=r(l);if((i||c&&null!==l)&&!o)try{if(n.tagName.includes("-"))n[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=e&&n[t]==o||(n[t]=o)}}catch(n){}null==l||!1===l?!1===l&&""!==n.getAttribute(t)||n.removeAttribute(t):(!i||4&s||o)&&!c&&n.setAttribute(t,l=!0===l?"":l)}else if(t="-"===t[2]?t.slice(3):J(Z,c)?c.slice(2):c[2]+t.slice(3),e||l){const o=t.endsWith(b);t=t.replace(g,""),e&&tn.rel(n,t,e,o),l&&tn.ael(n,t,l,o)}}},$=/\s/,w=n=>n?n.split($):[],b="Capture",g=RegExp(b+"$"),j=(n,t,e,l)=>{const o=11===t.v.nodeType&&t.v.host?t.v.host:t.v,s=n&&n.l||i,r=t.l||i;for(l in s)l in r||m(o,l,s[l],void 0,e,t.i);for(l in r)m(o,l,s[l],r[l],e,t.i)},S=(l,o,s)=>{const i=o.o[s];let r,c,u=0;if(null!==i.t)r=i.v=nn.createTextNode(i.t);else{if(e||(e="svg"===i.u),r=i.v=nn.createElementNS(e?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i.u),e&&"foreignObject"===i.u&&(e=!1),j(null,i,e),null!=n&&r["s-si"]!==n&&r.classList.add(r["s-si"]=n),i.o)for(u=0;u<i.o.length;++u)c=S(l,i,u),c&&r.appendChild(c);"svg"===i.u?e=!1:"foreignObject"===r.tagName&&(e=!0)}return r["s-hn"]=t,r},O=(n,e,l,o,s,i)=>{let r,c=n;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);s<=i;++s)o[s]&&(r=S(null,l,s),r&&(o[s].v=r,c.insertBefore(r,e)))},k=(n,t,e)=>{for(let l=t;l<=e;++l){const t=n[l];if(t){const n=t.v;n&&n.remove()}}},M=(n,t)=>n.u===t.u,C=(n,t,l=!1)=>{const o=t.v=n.v,s=n.o,i=t.o,r=t.u,c=t.t;null===c?(e="svg"===r||"foreignObject"!==r&&e,j(n,t,e),null!==s&&null!==i?((n,t,e,l,o=!1)=>{let s,i=0,r=0,c=t.length-1,u=t[0],a=t[c],f=l.length-1,d=l[0],v=l[f];for(;i<=c&&r<=f;)null==u?u=t[++i]:null==a?a=t[--c]:null==d?d=l[++r]:null==v?v=l[--f]:M(u,d)?(C(u,d,o),u=t[++i],d=l[++r]):M(a,v)?(C(a,v,o),a=t[--c],v=l[--f]):M(u,v)?(C(u,v,o),n.insertBefore(u.v,a.v.nextSibling),u=t[++i],v=l[--f]):M(a,d)?(C(a,d,o),n.insertBefore(a.v,u.v),a=t[--c],d=l[++r]):(s=S(t&&t[r],e,r),d=l[++r],s&&u.v.parentNode.insertBefore(s,u.v));i>c?O(n,null==l[f+1]?null:l[f+1].v,e,l,r,f):r>f&&k(t,i,c)})(o,s,t,i,l):null!==i?(null!==n.t&&(o.textContent=""),O(o,null,t,i,0,i.length-1)):null!==s&&k(s,0,s.length-1),e&&"svg"===r&&(e=!1)):n.t!==c&&(o.data=c)},x=(n,t)=>{t&&!n.$&&t["s-p"]&&t["s-p"].push(new Promise((t=>n.$=t)))},E=(n,t)=>{if(n.i|=16,!(4&n.i))return x(n,n.j),fn((()=>P(n,t)));n.i|=512},P=(n,t)=>{const e=n.S;return A(void 0,(()=>N(n,e,t)))},A=(n,t)=>L(n)?n.then(t):t(),L=n=>n instanceof Promise||n&&n.then&&"function"==typeof n.then,N=async(n,t,e)=>{var l;const o=n.$hostElement$,i=o["s-rc"];e&&(n=>{const t=n.O,e=n.$hostElement$,l=t.i,o=((n,t)=>{var e;const l=h(t),o=Y.get(l);if(n=11===n.nodeType?n:nn,o)if("string"==typeof o){let i,r=y.get(n=n.head||n);if(r||y.set(n,r=new Set),!r.has(l)){{i=nn.createElement("style"),i.innerHTML=o;const t=null!==(e=tn.k)&&void 0!==e?e:c(nn);null!=t&&i.setAttribute("nonce",t),n.insertBefore(i,n.querySelector("link"))}4&t.i&&(i.innerHTML+=s),r&&r.add(l)}}else n.adoptedStyleSheets.includes(o)||(n.adoptedStyleSheets=[...n.adoptedStyleSheets,o]);return l})(e.shadowRoot?e.shadowRoot:e.getRootNode(),t);10&l&&(e["s-sc"]=o,e.classList.add(o+"-h"))})(n);R(n,t,o,e),i&&(i.map((n=>n())),o["s-rc"]=void 0);{const t=null!==(l=o["s-p"])&&void 0!==l?l:[],e=()=>U(n);0===t.length?e():(Promise.all(t).then(e),n.i|=4,t.length=0)}},R=(e,o,s,i)=>{try{l=o,o=o.render(),e.i&=-17,e.i|=2,((e,l,o=!1)=>{const s=e.$hostElement$,i=e.M||a(null,null),r=(n=>n&&n.u===f)(l)?l:u(null,null,l);if(t=s.tagName,o&&r.l)for(const n of Object.keys(r.l))s.hasAttribute(n)&&!["key","ref","style","class"].includes(n)&&(r.l[n]=s[n]);r.u=null,r.i|=4,e.M=r,r.v=i.v=s.shadowRoot||s,n=s["s-sc"],C(i,r,o)})(e,o,i)}catch(n){K(n,e.$hostElement$)}return l=null,null},T=()=>l,U=n=>{const t=n.$hostElement$,e=n.S,l=n.j;64&n.i||(n.i|=64,F(t),D(e,"componentDidLoad"),n.C(t),l||q()),n.$&&(n.$(),n.$=void 0),512&n.i&&an((()=>E(n,!1))),n.i&=-517},W=n=>{{const t=B(n),e=t.$hostElement$.isConnected;return e&&2==(18&t.i)&&E(t,!1),e}},q=()=>{F(nn.documentElement),an((()=>(n=>{const t=tn.ce("appload",{detail:{namespace:"proto-sudoku-wc"}});return n.dispatchEvent(t),t})(Z)))},D=(n,t,e)=>{if(n&&n[t])try{return n[t](e)}catch(n){K(n)}},F=n=>n.classList.add("hydrated"),H=(n,t,e)=>{var l;const o=n.prototype;if(t.P){const s=Object.entries(t.P);if(s.map((([n,[l]])=>{(31&l||2&e&&32&l)&&Object.defineProperty(o,n,{get(){return((n,t)=>B(this).A.get(t))(0,n)},set(e){((n,t,e,l)=>{const o=B(n),s=o.A.get(t),i=o.i,c=o.S;e=((n,t)=>null==n||r(n)?n:1&t?n+"":n)(e,l.P[t][0]),8&i&&void 0!==s||e===s||Number.isNaN(s)&&Number.isNaN(e)||(o.A.set(t,e),c&&2==(18&i)&&E(o,!1))})(this,n,e,t)},configurable:!0,enumerable:!0})})),1&e){const e=new Map;o.attributeChangedCallback=function(n,l,s){tn.jmp((()=>{var i;const r=e.get(n);if(this.hasOwnProperty(r))s=this[r],delete this[r];else{if(o.hasOwnProperty(r)&&"number"==typeof this[r]&&this[r]==s)return;if(null==r){const e=B(this),o=null==e?void 0:e.i;if(o&&!(8&o)&&128&o&&s!==l){const o=e.S,r=null===(i=t.L)||void 0===i?void 0:i[n];null==r||r.forEach((t=>{null!=o[t]&&o[t].call(o,s,l,n)}))}return}}this[r]=(null!==s||"boolean"!=typeof this[r])&&s}))},n.observedAttributes=Array.from(new Set([...Object.keys(null!==(l=t.L)&&void 0!==l?l:{}),...s.filter((([n,t])=>15&t[0])).map((([n,t])=>{const l=t[1]||n;return e.set(l,n),l}))]))}}return n},V=(n,t={})=>{var e;const l=[],o=t.exclude||[],i=Z.customElements,r=nn.head,u=r.querySelector("meta[charset]"),a=nn.createElement("style"),f=[];let d,v=!0;Object.assign(tn,t),tn.N=new URL(t.resourcesUrl||"./",nn.baseURI).href;let p=!1;if(n.map((n=>{n[1].map((t=>{const e={i:t[0],m:t[1],P:t[2],R:t[3]};4&e.i&&(p=!0),e.P=t[2];const s=e.m,r=class extends HTMLElement{constructor(n){super(n),I(n=this,e),1&e.i&&n.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),v?f.push(this):tn.jmp((()=>(n=>{if(0==(1&tn.i)){const t=B(n),e=t.O,l=()=>{};if(1&t.i)(null==t?void 0:t.S)||(null==t?void 0:t.T)&&t.T.then((()=>{}));else{t.i|=1;{let e=n;for(;e=e.parentNode||e.host;)if(e["s-p"]){x(t,t.j=e);break}}e.P&&Object.entries(e.P).map((([t,[e]])=>{if(31&e&&n.hasOwnProperty(t)){const e=n[t];delete n[t],n[t]=e}})),(async(n,t,e)=>{let l;if(0==(32&t.i)){t.i|=32;{if(l=X(e),l.then){const n=()=>{};l=await l,n()}l.isProxied||(H(l,e,2),l.isProxied=!0);const n=()=>{};t.i|=8;try{new l(t)}catch(n){K(n)}t.i&=-9,n()}if(l.style){let n=l.style;const t=h(e);if(!Y.has(t)){const l=()=>{};((n,t,e)=>{let l=Y.get(n);ln&&e?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,Y.set(n,l)})(t,n,!!(1&e.i)),l()}}}const o=t.j,s=()=>E(t,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()})(0,t,e)}l()}})(this)))}disconnectedCallback(){tn.jmp((()=>(async()=>{if(0==(1&tn.i)){const n=B(this);(null==n?void 0:n.S)||(null==n?void 0:n.T)&&n.T.then((()=>{}))}})()))}componentOnReady(){return B(this).T}};e.U=n[0],o.includes(s)||i.get(s)||(l.push(s),i.define(s,H(r,e,1)))}))})),p&&(a.innerHTML+=s),a.innerHTML+=l+"{visibility:hidden}.hydrated{visibility:inherit}",a.innerHTML.length){a.setAttribute("data-styles","");const n=null!==(e=tn.k)&&void 0!==e?e:c(nn);null!=n&&a.setAttribute("nonce",n),r.insertBefore(a,u?u.nextSibling:r.firstChild)}v=!1,f.length?f.map((n=>n.connectedCallback())):tn.jmp((()=>d=setTimeout(q,30)))},_=n=>tn.k=n,z=new WeakMap,B=n=>z.get(n),G=(n,t)=>z.set(t.S=n,t),I=(n,t)=>{const e={i:0,$hostElement$:n,O:t,A:new Map};return e.T=new Promise((n=>e.C=n)),n["s-p"]=[],n["s-rc"]=[],z.set(n,e)},J=(n,t)=>t in n,K=(n,t)=>(0,console.error)(n,t),Q=new Map,X=n=>{const t=n.m.replace(/-/g,"_"),e=n.U,l=Q.get(e);return l?l[t]:import(`./${e}.entry.js`).then((n=>(Q.set(e,n),n[t])),K)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},Y=new Map,Z="undefined"!=typeof window?window:{},nn=Z.document||{head:{}},tn={i:0,N:"",jmp:n=>n(),raf:n=>requestAnimationFrame(n),ael:(n,t,e,l)=>n.addEventListener(t,e,l),rel:(n,t,e,l)=>n.removeEventListener(t,e,l),ce:(n,t)=>new CustomEvent(n,t)},en=n=>Promise.resolve(n),ln=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(n){}return!1})(),on=[],sn=[],rn=(n,t)=>e=>{n.push(e),o||(o=!0,t&&4&tn.i?an(un):tn.raf(un))},cn=n=>{for(let t=0;t<n.length;t++)try{n[t](performance.now())}catch(n){K(n)}n.length=0},un=()=>{cn(on),cn(sn),(o=on.length>0)&&tn.raf(un)},an=n=>en().then(n),fn=rn(sn,!0);export{V as b,W as f,T as g,u as h,en as p,G as r,_ as s}