proto-sudoku-wc 0.1.134 → 0.1.135
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.
|
@@ -862,6 +862,7 @@ const normalizeRetryOptions = (retry = {}) => {
|
|
|
862
862
|
if (retry.methods && !Array.isArray(retry.methods)) {
|
|
863
863
|
throw new Error('retry.methods must be an array');
|
|
864
864
|
}
|
|
865
|
+
retry.methods &&= retry.methods.map(method => method.toLowerCase());
|
|
865
866
|
if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {
|
|
866
867
|
throw new Error('retry.statusCodes must be an array');
|
|
867
868
|
}
|
|
@@ -1016,21 +1017,35 @@ class Ky {
|
|
|
1016
1017
|
for (const hook of ky.#options.hooks.afterResponse) {
|
|
1017
1018
|
// Clone the response before passing to hook so we can cancel it if needed
|
|
1018
1019
|
const clonedResponse = ky.#decorateResponse(response.clone());
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1020
|
+
let modifiedResponse;
|
|
1021
|
+
try {
|
|
1022
|
+
// eslint-disable-next-line no-await-in-loop
|
|
1023
|
+
modifiedResponse = await hook(ky.request, ky.#getNormalizedOptions(), clonedResponse, { retryCount: ky.#retryCount });
|
|
1024
|
+
}
|
|
1025
|
+
catch (error) {
|
|
1026
|
+
// Cancel both responses to prevent memory leaks when hook throws
|
|
1027
|
+
ky.#cancelResponseBody(clonedResponse);
|
|
1028
|
+
ky.#cancelResponseBody(response);
|
|
1029
|
+
throw error;
|
|
1023
1030
|
}
|
|
1024
1031
|
if (modifiedResponse instanceof RetryMarker) {
|
|
1025
|
-
// Cancel both the cloned response passed to the hook and the current response
|
|
1026
|
-
//
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
clonedResponse.body?.cancel(),
|
|
1030
|
-
response.body?.cancel(),
|
|
1031
|
-
]);
|
|
1032
|
+
// Cancel both the cloned response passed to the hook and the current response to prevent resource leaks (especially important in Deno/Bun).
|
|
1033
|
+
// Do not await cancellation since hooks can clone the response, leaving extra tee branches that keep cancel promises pending per the Streams spec.
|
|
1034
|
+
ky.#cancelResponseBody(clonedResponse);
|
|
1035
|
+
ky.#cancelResponseBody(response);
|
|
1032
1036
|
throw new ForceRetryError(modifiedResponse.options);
|
|
1033
1037
|
}
|
|
1038
|
+
// Determine which response to use going forward
|
|
1039
|
+
const nextResponse = modifiedResponse instanceof globalThis.Response ? modifiedResponse : response;
|
|
1040
|
+
// Cancel any response bodies we won't use to prevent memory leaks.
|
|
1041
|
+
// Uses fire-and-forget since hooks may have cloned the response, creating tee branches that block cancellation.
|
|
1042
|
+
if (clonedResponse !== nextResponse) {
|
|
1043
|
+
ky.#cancelResponseBody(clonedResponse);
|
|
1044
|
+
}
|
|
1045
|
+
if (response !== nextResponse) {
|
|
1046
|
+
ky.#cancelResponseBody(response);
|
|
1047
|
+
}
|
|
1048
|
+
response = nextResponse;
|
|
1034
1049
|
}
|
|
1035
1050
|
ky.#decorateResponse(response);
|
|
1036
1051
|
if (!response.ok && (typeof ky.#options.throwHttpErrors === 'function'
|
|
@@ -1051,23 +1066,20 @@ class Ky {
|
|
|
1051
1066
|
if (!supportsResponseStreams) {
|
|
1052
1067
|
throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.');
|
|
1053
1068
|
}
|
|
1054
|
-
|
|
1069
|
+
const progressResponse = response.clone();
|
|
1070
|
+
ky.#cancelResponseBody(response);
|
|
1071
|
+
return streamResponse(progressResponse, ky.#options.onDownloadProgress);
|
|
1055
1072
|
}
|
|
1056
1073
|
return response;
|
|
1057
1074
|
};
|
|
1058
1075
|
// Always wrap in #retry to catch forced retries from afterResponse hooks
|
|
1059
1076
|
// Method retriability is checked in #calculateRetryDelay for non-forced retries
|
|
1060
1077
|
const result = ky.#retry(function_)
|
|
1061
|
-
.finally(
|
|
1078
|
+
.finally(() => {
|
|
1062
1079
|
const originalRequest = ky.#originalRequest;
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
}
|
|
1067
|
-
if (!ky.request.bodyUsed) {
|
|
1068
|
-
cleanupPromises.push(ky.request.body?.cancel());
|
|
1069
|
-
}
|
|
1070
|
-
await Promise.all(cleanupPromises);
|
|
1080
|
+
// Ignore cancellation errors from already-locked or already-consumed streams.
|
|
1081
|
+
ky.#cancelBody(originalRequest?.body ?? undefined);
|
|
1082
|
+
ky.#cancelBody(ky.request.body ?? undefined);
|
|
1071
1083
|
});
|
|
1072
1084
|
for (const [type, mimeType] of Object.entries(responseTypes)) {
|
|
1073
1085
|
// Only expose `.bytes()` when the environment implements it.
|
|
@@ -1273,6 +1285,17 @@ class Ky {
|
|
|
1273
1285
|
}
|
|
1274
1286
|
return response;
|
|
1275
1287
|
}
|
|
1288
|
+
#cancelBody(body) {
|
|
1289
|
+
if (!body) {
|
|
1290
|
+
return;
|
|
1291
|
+
}
|
|
1292
|
+
// Ignore cancellation failures from already-locked or already-consumed streams.
|
|
1293
|
+
void body.cancel().catch(() => undefined);
|
|
1294
|
+
}
|
|
1295
|
+
#cancelResponseBody(response) {
|
|
1296
|
+
// Ignore cancellation failures from already-locked or already-consumed streams.
|
|
1297
|
+
this.#cancelBody(response.body ?? undefined);
|
|
1298
|
+
}
|
|
1276
1299
|
async #retry(function_) {
|
|
1277
1300
|
try {
|
|
1278
1301
|
return await function_();
|
|
@@ -860,6 +860,7 @@ const normalizeRetryOptions = (retry = {}) => {
|
|
|
860
860
|
if (retry.methods && !Array.isArray(retry.methods)) {
|
|
861
861
|
throw new Error('retry.methods must be an array');
|
|
862
862
|
}
|
|
863
|
+
retry.methods &&= retry.methods.map(method => method.toLowerCase());
|
|
863
864
|
if (retry.statusCodes && !Array.isArray(retry.statusCodes)) {
|
|
864
865
|
throw new Error('retry.statusCodes must be an array');
|
|
865
866
|
}
|
|
@@ -1014,21 +1015,35 @@ class Ky {
|
|
|
1014
1015
|
for (const hook of ky.#options.hooks.afterResponse) {
|
|
1015
1016
|
// Clone the response before passing to hook so we can cancel it if needed
|
|
1016
1017
|
const clonedResponse = ky.#decorateResponse(response.clone());
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1018
|
+
let modifiedResponse;
|
|
1019
|
+
try {
|
|
1020
|
+
// eslint-disable-next-line no-await-in-loop
|
|
1021
|
+
modifiedResponse = await hook(ky.request, ky.#getNormalizedOptions(), clonedResponse, { retryCount: ky.#retryCount });
|
|
1022
|
+
}
|
|
1023
|
+
catch (error) {
|
|
1024
|
+
// Cancel both responses to prevent memory leaks when hook throws
|
|
1025
|
+
ky.#cancelResponseBody(clonedResponse);
|
|
1026
|
+
ky.#cancelResponseBody(response);
|
|
1027
|
+
throw error;
|
|
1021
1028
|
}
|
|
1022
1029
|
if (modifiedResponse instanceof RetryMarker) {
|
|
1023
|
-
// Cancel both the cloned response passed to the hook and the current response
|
|
1024
|
-
//
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
clonedResponse.body?.cancel(),
|
|
1028
|
-
response.body?.cancel(),
|
|
1029
|
-
]);
|
|
1030
|
+
// Cancel both the cloned response passed to the hook and the current response to prevent resource leaks (especially important in Deno/Bun).
|
|
1031
|
+
// Do not await cancellation since hooks can clone the response, leaving extra tee branches that keep cancel promises pending per the Streams spec.
|
|
1032
|
+
ky.#cancelResponseBody(clonedResponse);
|
|
1033
|
+
ky.#cancelResponseBody(response);
|
|
1030
1034
|
throw new ForceRetryError(modifiedResponse.options);
|
|
1031
1035
|
}
|
|
1036
|
+
// Determine which response to use going forward
|
|
1037
|
+
const nextResponse = modifiedResponse instanceof globalThis.Response ? modifiedResponse : response;
|
|
1038
|
+
// Cancel any response bodies we won't use to prevent memory leaks.
|
|
1039
|
+
// Uses fire-and-forget since hooks may have cloned the response, creating tee branches that block cancellation.
|
|
1040
|
+
if (clonedResponse !== nextResponse) {
|
|
1041
|
+
ky.#cancelResponseBody(clonedResponse);
|
|
1042
|
+
}
|
|
1043
|
+
if (response !== nextResponse) {
|
|
1044
|
+
ky.#cancelResponseBody(response);
|
|
1045
|
+
}
|
|
1046
|
+
response = nextResponse;
|
|
1032
1047
|
}
|
|
1033
1048
|
ky.#decorateResponse(response);
|
|
1034
1049
|
if (!response.ok && (typeof ky.#options.throwHttpErrors === 'function'
|
|
@@ -1049,23 +1064,20 @@ class Ky {
|
|
|
1049
1064
|
if (!supportsResponseStreams) {
|
|
1050
1065
|
throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.');
|
|
1051
1066
|
}
|
|
1052
|
-
|
|
1067
|
+
const progressResponse = response.clone();
|
|
1068
|
+
ky.#cancelResponseBody(response);
|
|
1069
|
+
return streamResponse(progressResponse, ky.#options.onDownloadProgress);
|
|
1053
1070
|
}
|
|
1054
1071
|
return response;
|
|
1055
1072
|
};
|
|
1056
1073
|
// Always wrap in #retry to catch forced retries from afterResponse hooks
|
|
1057
1074
|
// Method retriability is checked in #calculateRetryDelay for non-forced retries
|
|
1058
1075
|
const result = ky.#retry(function_)
|
|
1059
|
-
.finally(
|
|
1076
|
+
.finally(() => {
|
|
1060
1077
|
const originalRequest = ky.#originalRequest;
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
}
|
|
1065
|
-
if (!ky.request.bodyUsed) {
|
|
1066
|
-
cleanupPromises.push(ky.request.body?.cancel());
|
|
1067
|
-
}
|
|
1068
|
-
await Promise.all(cleanupPromises);
|
|
1078
|
+
// Ignore cancellation errors from already-locked or already-consumed streams.
|
|
1079
|
+
ky.#cancelBody(originalRequest?.body ?? undefined);
|
|
1080
|
+
ky.#cancelBody(ky.request.body ?? undefined);
|
|
1069
1081
|
});
|
|
1070
1082
|
for (const [type, mimeType] of Object.entries(responseTypes)) {
|
|
1071
1083
|
// Only expose `.bytes()` when the environment implements it.
|
|
@@ -1271,6 +1283,17 @@ class Ky {
|
|
|
1271
1283
|
}
|
|
1272
1284
|
return response;
|
|
1273
1285
|
}
|
|
1286
|
+
#cancelBody(body) {
|
|
1287
|
+
if (!body) {
|
|
1288
|
+
return;
|
|
1289
|
+
}
|
|
1290
|
+
// Ignore cancellation failures from already-locked or already-consumed streams.
|
|
1291
|
+
void body.cancel().catch(() => undefined);
|
|
1292
|
+
}
|
|
1293
|
+
#cancelResponseBody(response) {
|
|
1294
|
+
// Ignore cancellation failures from already-locked or already-consumed streams.
|
|
1295
|
+
this.#cancelBody(response.body ?? undefined);
|
|
1296
|
+
}
|
|
1274
1297
|
async #retry(function_) {
|
|
1275
1298
|
try {
|
|
1276
1299
|
return await function_();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as t,S as e,r as n}from"./p-CBGxvxwA.js";const r=e=>{const n=e.hex||"currentColor",r=e.size||24;return t("svg",{class:e.class,width:r,height:r,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"alien"),t("g",{fill:n},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"}))},o="proto-sudoku",s=`${o}::data`,i=`${o}::inputs`,a=`${o}::pick`,l=t=>{const e=localStorage.getItem(t);return e?JSON.parse(e):void 0},c=(t,e)=>{const n=JSON.stringify(e);localStorage.setItem(t,n)},h=()=>[...l(i)],f=t=>{c(i,t.join(""))},d=()=>{const t=l(a);return null!==t?t:void 0},u=t=>{c(a,t>=0&&t<81?t:null)},p="Check ?",g="New Puzzle",b=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys()){const n=t.get(e).filter((t=>{const e=t.deref();return e&&(!("isConnected"in(n=e))||n.isConnected);var n}));t.set(e,n)}})(...e)}),2e3)}})(),y=e.forceUpdate,w=e.getRenderingRef,m=(t,e)=>{const n=t.indexOf(e);n>=0&&(t[n]=t[t.length-1],t.length--)};class v extends Error{response;request;options;constructor(t,e,n){const r=`${t.status||0===t.status?t.status:""} ${t.statusText??""}`.trim();super(`Request failed with ${r?`status code ${r}`:"an unknown error"}: ${e.method} ${e.url}`),this.name="HTTPError",this.response=t,this.request=e,this.options=n}}class x extends Error{name="NonError";value;constructor(t){let e="Non-error value was thrown";try{"string"==typeof t?e=t:t&&"object"==typeof t&&"message"in t&&"string"==typeof t.message&&(e=t.message)}catch{}super(e),this.value=t}}class C extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(t){const e=t?.cause?t.cause instanceof Error?t.cause:new x(t.cause):void 0;super(t?.code?`Forced retry: ${t.code}`:"Forced retry",e?{cause:e}:void 0),this.customDelay=t?.delay,this.code=t?.code,this.customRequest=t?.request}}const T=(()=>{let t=!1,e=!1;const n="function"==typeof globalThis.ReadableStream,r="function"==typeof globalThis.Request;if(n&&r)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(t){if(t instanceof Error&&"unsupported BodyInit type"===t.message)return!1;throw t}return t&&!e})(),k="function"==typeof globalThis.AbortController,R="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,E="function"==typeof globalThis.ReadableStream,S="function"==typeof globalThis.FormData,j=["get","post","put","patch","head","delete"],M={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},P=2147483647,A=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,O=Symbol("stop");class z{options;constructor(t){this.options=t}}const N=t=>new z(t),U={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},q={next:!0},L={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,duplex:!0},B=(t,e,n)=>{let r,o=0;return t.pipeThrough(new TransformStream({transform(t,s){if(s.enqueue(t),r){o+=r.byteLength;let t=0===e?0:o/e;t>=1&&(t=1-Number.EPSILON),n?.({percent:t,totalBytes:Math.max(e,o),transferredBytes:o},r)}r=t},flush(){r&&(o+=r.byteLength,n?.({percent:1,totalBytes:Math.max(e,o),transferredBytes:o},r))}}))},$=t=>null!==t&&"object"==typeof t,D=(...t)=>{for(const e of t)if((!$(e)||Array.isArray(e))&&void 0!==e)throw new TypeError("The `options` argument must be an object");return X({},...t)},H=(t={},e={})=>{const n=new globalThis.Headers(t),r=e instanceof globalThis.Headers,o=new globalThis.Headers(e);for(const[t,e]of o.entries())r&&"undefined"===e||void 0===e?n.delete(t):n.set(t,e);return n};function J(t,e,n){return Object.hasOwn(e,n)&&void 0===e[n]?[]:X(t[n]??[],e[n]??[])}const F=(t={},e={})=>({beforeRequest:J(t,e,"beforeRequest"),beforeRetry:J(t,e,"beforeRetry"),afterResponse:J(t,e,"afterResponse"),beforeError:J(t,e,"beforeError")}),W=(t,e)=>{const n=new URLSearchParams;for(const r of[t,e])if(void 0!==r)if(r instanceof URLSearchParams)for(const[t,e]of r.entries())n.append(t,e);else if(Array.isArray(r))for(const t of r){if(!Array.isArray(t)||2!==t.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(t[0]),String(t[1]))}else if($(r))for(const[t,e]of Object.entries(r))void 0!==e&&n.append(t,String(e));else{const t=new URLSearchParams(r);for(const[e,r]of t.entries())n.append(e,r)}return n},X=(...t)=>{let e,n={},r={},o={};const s=[];for(const i of t)if(Array.isArray(i))Array.isArray(n)||(n=[]),n=[...n,...i];else if($(i)){for(let[t,r]of Object.entries(i))if("signal"===t&&r instanceof globalThis.AbortSignal)s.push(r);else if("context"!==t)"searchParams"!==t?($(r)&&t in n&&(r=X(n[t],r)),n={...n,[t]:r}):e=null==r?void 0:void 0===e?r:W(e,r);else{if(null!=r&&(!$(r)||Array.isArray(r)))throw new TypeError("The `context` option must be an object");n={...n,context:null==r?{}:{...n.context,...r}}}$(i.hooks)&&(o=F(o,i.hooks),n.hooks=o),$(i.headers)&&(r=H(r,i.headers),n.headers=r)}return void 0!==e&&(n.searchParams=e),s.length>0&&(n.signal=1===s.length?s[0]:R?AbortSignal.any(s):s.at(-1)),void 0===n.context&&(n.context={}),n},I=t=>j.includes(t)?t.toUpperCase():t,G={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},K=(t={})=>{if("number"==typeof t)return{...G,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");const e=Object.fromEntries(Object.entries(t).filter((([,t])=>void 0!==t)));return{...G,...e}};class Z extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}}class V{static create(t,e){const n=new V(t,e),r=n.#t((async()=>{if("number"==typeof n.#e.timeout&&n.#e.timeout>P)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let t=await n.#n();for(const e of n.#e.hooks.afterResponse){const r=n.#r(t.clone()),o=await e(n.request,n.#o(),r,{retryCount:n.#s});if(o instanceof globalThis.Response&&(t=o),o instanceof z)throw await Promise.all([r.body?.cancel(),t.body?.cancel()]),new C(o.options)}if(n.#r(t),!t.ok&&("function"==typeof n.#e.throwHttpErrors?n.#e.throwHttpErrors(t.status):n.#e.throwHttpErrors)){let e=new v(t,n.request,n.#o());for(const t of n.#e.hooks.beforeError)e=await t(e,{retryCount:n.#s});throw e}if(n.#e.onDownloadProgress){if("function"!=typeof n.#e.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!E)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return((t,e)=>{if(!t.body)return t;if(204===t.status)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});const n=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(B(t.body,n,e),{status:t.status,statusText:t.statusText,headers:t.headers})})(t.clone(),n.#e.onDownloadProgress)}return t})).finally((async()=>{const t=n.#i,e=[];t&&!t.bodyUsed&&e.push(t.body?.cancel()),n.request.bodyUsed||e.push(n.request.body?.cancel()),await Promise.all(e)}));for(const[t,o]of Object.entries(M))"bytes"===t&&"function"!=typeof globalThis.Response?.prototype?.bytes||(r[t]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||o);const s=await r;if("json"===t){if(204===s.status)return"";const t=await s.text();return""===t?"":e.parseJson?e.parseJson(t):JSON.parse(t)}return s[t]()});return r}static#a(t){return!t||"object"!=typeof t||Array.isArray(t)||t instanceof URLSearchParams?t:Object.fromEntries(Object.entries(t).filter((([,t])=>void 0!==t)))}request;#l;#s=0;#c;#e;#i;#h;#f;constructor(t,e={}){if(this.#c=t,this.#e={...e,headers:H(this.#c.headers,e.headers),hooks:F({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:I(e.method??this.#c.method??"GET"),prefixUrl:String(e.prefixUrl||""),retry:K(e.retry),throwHttpErrors:e.throwHttpErrors??!0,timeout:e.timeout??1e4,fetch:e.fetch??globalThis.fetch.bind(globalThis),context:e.context??{}},"string"!=typeof this.#c&&!(this.#c instanceof URL||this.#c instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&"string"==typeof this.#c){if(this.#c.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#c=this.#e.prefixUrl+this.#c}k&&R&&(this.#h=this.#e.signal??this.#c.signal,this.#l=new globalThis.AbortController,this.#e.signal=this.#h?AbortSignal.any([this.#h,this.#l.signal]):this.#l.signal),T&&(this.#e.duplex="half"),void 0!==this.#e.json&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const n=e.headers&&new globalThis.Headers(e.headers).has("content-type");if(this.#c instanceof globalThis.Request&&(S&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!n&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#c,this.#e),void 0!==(r=this.#e.searchParams)&&(Array.isArray(r)?r.length>0:r instanceof URLSearchParams?r.size>0:"object"==typeof r?Object.keys(r).length>0:"string"==typeof r?r.trim().length>0:Boolean(r))){const t="string"==typeof this.#e.searchParams?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(V.#a(this.#e.searchParams)).toString(),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,"?"+t);this.request=new globalThis.Request(e,this.#e)}var r;if(this.#e.onUploadProgress){if("function"!=typeof this.#e.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!T)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#d(this.request,this.#e.body??void 0)}}#u(){const t=this.#e.retry.delay(this.#s);let e=t;!0===this.#e.retry.jitter?e=Math.random()*t:"function"==typeof this.#e.retry.jitter&&(e=this.#e.retry.jitter(t),(!Number.isFinite(e)||e<0)&&(e=t));const n=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(n,e)}async#p(t){if(this.#s++,this.#s>this.#e.retry.limit)throw t;const e=t instanceof Error?t:new x(t);if(e instanceof C)return e.customDelay??this.#u();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw t;if(void 0!==this.#e.retry.shouldRetry){const n=await this.#e.retry.shouldRetry({error:e,retryCount:this.#s});if(!1===n)throw t;if(!0===n)return this.#u()}if(function(t){return t instanceof Z||t?.name===Z.name}(t)&&!this.#e.retry.retryOnTimeout)throw t;if(function(t){return t instanceof v||t?.name===v.name}(t)){if(!this.#e.retry.statusCodes.includes(t.response.status))throw t;const e=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(e&&this.#e.retry.afterStatusCodes.includes(t.response.status)){let t=1e3*Number(e);Number.isNaN(t)?t=Date.parse(e)-Date.now():t>=Date.parse("2024-01-01")&&(t-=Date.now());const n=this.#e.retry.maxRetryAfter??t;return t<n?t:n}if(413===t.response.status)throw t}return this.#u()}#r(t){return this.#e.parseJson&&(t.json=async()=>this.#e.parseJson(await t.text())),t}async#t(t){try{return await t()}catch(e){const n=Math.min(await this.#p(e),P);if(this.#s<1)throw e;if(await async function(t,{signal:e}){return new Promise(((n,r)=>{function o(){clearTimeout(s),r(e.reason)}e&&(e.throwIfAborted(),e.addEventListener("abort",o,{once:!0}));const s=setTimeout((()=>{e?.removeEventListener("abort",o),n()}),t)}))}(n,this.#h?{signal:this.#h}:{}),e instanceof C&&e.customRequest){const t=this.#e.signal?new globalThis.Request(e.customRequest,{signal:this.#e.signal}):new globalThis.Request(e.customRequest);this.#g(t)}for(const t of this.#e.hooks.beforeRetry){const n=await t({request:this.request,options:this.#o(),error:e,retryCount:this.#s});if(n instanceof globalThis.Request){this.#g(n);break}if(n instanceof globalThis.Response)return n;if(n===O)return}return this.#t(t)}}async#n(){this.#l?.signal.aborted&&(this.#l=new globalThis.AbortController,this.#e.signal=this.#h?AbortSignal.any([this.#h,this.#l.signal]):this.#l.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(const t of this.#e.hooks.beforeRequest){const e=await t(this.request,this.#o(),{retryCount:this.#s});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#g(e);break}}const t=((t,e)=>{const n={};for(const r in e)Object.hasOwn(e,r)&&(r in L||r in U||r in t&&!(r in q)||(n[r]=e[r]));return n})(this.request,this.#e);return this.#i=this.request,this.request=this.#i.clone(),!1===this.#e.timeout?this.#e.fetch(this.#i,t):async function(t,e,n,r){return new Promise(((o,s)=>{const i=setTimeout((()=>{n&&n.abort(),s(new Z(t))}),r.timeout);r.fetch(t,e).then(o).catch(s).then((()=>{clearTimeout(i)}))}))}(this.#i,t,this.#l,this.#e)}#o(){if(!this.#f){const{hooks:t,...e}=this.#e;this.#f=Object.freeze(e)}return this.#f}#g(t){this.#f=void 0,this.request=this.#d(t)}#d(t,e){return this.#e.onUploadProgress&&t.body?((t,e,n)=>{if(!t.body)return t;const r=(t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(const[n,r]of t)e+=A,e+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${n}"`).length,e+="string"==typeof r?(new TextEncoder).encode(r).length:r.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if("string"==typeof t)return(new TextEncoder).encode(t).length;if(t instanceof URLSearchParams)return(new TextEncoder).encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if("object"==typeof t&&null!==t)try{const e=JSON.stringify(t);return(new TextEncoder).encode(e).length}catch{return 0}return 0})(n??t.body);return new Request(t,{duplex:"half",body:B(t.body,r,e)})})(t,this.#e.onUploadProgress,e??this.#e.body??void 0):t}}
|
|
2
|
-
/*! MIT License © Sindre Sorhus */const Y=t=>{const e=(e,n)=>V.create(e,D(t,n));for(const n of j)e[n]=(e,r)=>V.create(e,D(t,r,{method:n}));return e.create=t=>Y(D(t)),e.extend=e=>("function"==typeof e&&(e=e(t??{})),Y(D(t,e))),e.stop=O,e.retry=N,e},_=Y(),Q={list:[],keys:[],locs:[],loading:!1,solved:!1,error:void 0,pick:void 0,data:void 0},{state:tt}=(()=>{const t=((t,e=(t,e)=>t!==e)=>{const n=()=>{return("function"==typeof(e=t)?e():e)??{};var e},r=n();let o=new Map(Object.entries(r));const s="undefined"!=typeof Proxy,i=s?null:{},a={dispose:[],get:[],set:[],reset:[]},l=new Map,c=()=>{o=new Map(Object.entries(n())),s||g(),a.reset.forEach((t=>t()))},h=t=>(a.get.forEach((e=>e(t))),o.get(t)),f=(t,n)=>{const r=o.get(t);e(n,r,t)&&(o.set(t,n),s||p(t),a.set.forEach((e=>e(t,n,r))))},d=s?new Proxy(r,{get:(t,e)=>h(e),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>o.has(e),set:(t,e,n)=>(f(e,n),!0)}):(g(),i),u=(t,e)=>(a[t].push(e),()=>{m(a[t],e)});function p(t){!s&&i&&(Object.prototype.hasOwnProperty.call(i,t)||Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:()=>h(t),set(e){f(t,e)}}))}function g(){if(s||!i)return;const t=new Set(o.keys());for(const e of Object.keys(i))t.has(e)||delete i[e];for(const e of t)p(e)}return{state:d,get:h,set:f,on:u,onChange:(t,e)=>{const r=(n,r)=>{n===t&&e(r)},o=()=>{const r=n();e(r[t])},s=u("set",r),i=u("reset",o);return l.set(e,{setHandler:r,resetHandler:o,propName:t}),()=>{s(),i(),l.delete(e)}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(u("set",e.set)),e.get&&t.push(u("get",e.get)),e.reset&&t.push(u("reset",e.reset)),e.dispose&&t.push(u("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{a.dispose.forEach((t=>t())),c()},reset:c,forceUpdate:t=>{const e=o.get(t);a.set.forEach((n=>n(t,e,e)))},removeListener:(t,e)=>{const n=l.get(e);n&&n.propName===t&&(m(a.set,n.setHandler),m(a.reset,n.resetHandler),l.delete(e))}}})(Q,void 0);return t.use((()=>{if("function"!=typeof w||"function"!=typeof y)return{};const t=y,e=w,n=new Map;return{dispose:()=>n.clear(),get:t=>{const r=e();r&&((t,e,n)=>{let r=t.get(e);r||(r=[],t.set(e,r)),r.some((t=>t.deref()===n))||r.push(new WeakRef(n))})(n,t,r)},set:e=>{const r=n.get(e);if(r){const o=r.filter((e=>{const n=e.deref();return!!n&&t(n)}));n.set(e,o)}b(n)},reset:()=>{n.forEach((e=>{e.forEach((e=>{const n=e.deref();n&&t(n)}))})),b(n)}}})()),t})(),et=new Map([["row",new Map],["column",new Map],["box",new Map]]),nt=["1","2","3","4","5","6","7","8","9"],rt=t=>{if(void 0!==t&&t.indx!=tt.pick){const{isClue:e,indx:n,row:r,column:o,box:s}=t,i=((t,e,n,r)=>{const o=new Map([["row",e],["column",n],["box",r]]),s=new Set;return o.forEach(((e,n)=>{et.get(n).get(e).forEach((e=>{e!==t&&s.add(e)}))})),Array.from(s)})(n,r,o,s),a=e?[]:(t=>{const{list:e}=tt,n=new Set;return t.map((t=>{const{key:r}=e[t];"."!=r&&n.add(r)})),nt.filter((t=>!n.has(t)))})(i);tt.pick=n,tt.keys=a,tt.locs=i}else tt.pick=void 0,tt.keys=[],tt.locs=[];at(tt.pick)};let ot;const st={local:"http://localhost:8080/api",netlify:"/.netlify/functions",vercel:"https://sudoku-rust-api.vercel.app/api"},it=t=>{f(t)},at=t=>{u(t)},lt=(t=!1)=>{tt.list=[],tt.keys=[],tt.locs=[],tt.loading=t,tt.solved=!1,tt.error=void 0,tt.pick=void 0,tt.data=void 0},ct=(t,e=!0)=>{const{puzzle:n,ref:r}=t;e&&(f([]),c(s,t)),(t=>{if(t){const{puzzle:e,ref:n}=t,r=e?[...e]:[],o=n?atob(n):void 0,s=o?[...o]:[],i=r.map(((t,e)=>{const n=s[e],r=t===n,o=Math.floor(e/9),i=e%9,a=((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)(o,i);return((t,e,n,r)=>{new Map([["row",e],["column",n],["box",r]]).forEach(((e,n)=>{const r=et.get(n);r.has(e)?r.get(e).add(t):r.set(e,new Set([t]))}))})(e,o,i,a),{key:t,isClue:r,value:n,indx:e,row:o,column:i,box:a}}));(t=>{h().forEach(((e,n)=>{const r=t[n],{isClue:o}=r;o||(r.key=e)}))})(i),tt.data=t,tt.list=i}else tt.data=void 0,tt.list=[]})({puzzle:n,ref:r})},ht=t=>{tt.list=[...t],t.length=0},ft={initApp:t=>{(t=>{const e=(t=>{const e=Object.keys(st).includes(t)?t:"vercel";return st[e]})(t);ot=_.extend({hooks:{beforeRequest:[t=>{t.headers.set("X-Requested-With","ky"),t.headers.set("X-Custom-Header","foobar")}]},prefixUrl:e,timeout:1e4})})(t),lt();const e=l(s),n=d();if(e&&(ct(e,!1),n>=0)){const{list:t}=tt;rt(t[n])}},refresh:async()=>{lt(!0),it([]),at(tt.pick);try{const t=await ot.get("puzzle").json();ct(t)}catch(t){const{message:e}=t;console.log("-- ",e),console.log(t),tt.error=e}finally{tt.loading=!1}},select:t=>{rt(t)},check:()=>{const{list:t}=tt,e=[];let n=0,r=0,o=0;t.forEach((t=>{const{key:s,value:i,isClue:a}=t;a?o+=1:"."!==s&&(s!==i?(n+=1,t.key="."):r+=1),e.push(t.key)}));const s=o+r;it(r?e:[]),n>0?ht(t):81===s&&(tt.solved=!0)},input:t=>{const{pick:e,list:n}=tt;n[e].key=t,ht(n)}},dt=(...t)=>t.filter(Boolean).join(" "),ut=e=>{const n=e.hex||"currentColor",r=e.label||"loading...",o=e.size||24;return t("svg",{class:dt(e.class||"","animate-spin"),width:o,height:o,fill:"none",viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,r),t("g",null,t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:n,"stroke-width":"4"}),t("path",{class:"opacity-75",fill:n,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"}))},pt=e=>{const{message:n,salute:o,spinner:s=!1}=e;return t("div",{class:"mt-5 flex h-24px flex-row items-center"},t(s?ut:r,{class:"mr-2"}),o?t("label",{class:"mr-1 font-bold"},o,":"):"",t("label",{class:"italic"},n))},gt=()=>{const{solved:e,loading:n,error:r}=tt;return t("div",{class:"flex flex-col"},n||r||e?"":t(pt,{message:"Welcome, are you ready to play?..."}),n?t(pt,{message:"Loading...",spinner:!0}):"",r?t(pt,{message:r,salute:"ERROR"}):"",e?t(pt,{message:"You solved the puzzle!!"}):"")},bt=e=>{const n=e.hex||"currentColor",r=e.size||24;return t("svg",{class:e.class,width:r,height:r,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"fingerprint"),t("g",{fill:n},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"}))},yt="eswat2",wt=()=>t("a",{class:"absolute right-0 top-0 text-clrs-gray hover:text-clrs-navy",href:"https://eswat2.dev","aria-label":yt,target:"blank",title:yt},t(bt,{label:yt})),mt=(e,n)=>t("h1",{class:dt("text-center uppercase text-clrs-red","mb-11 ml-0 mr-0 mt-11","text-6xl font-thin")},n),vt=e=>{const{label:n,callback:r,matched:o=!1}=e;return t("button",{class:dt("rounded-md border border-solid border-clrs-slate4 font-bold",n===p?"mr-2 bg-clrs-yellow px-3 py-2 text-clrs-navy":n===g?"mr-2 bg-clrs-navy px-3 py-2 text-white":"x"===n?"mr-1 bg-clrs-red px-2 py-1 text-white":o?"mr-1 bg-clrs-slate4 px-2 py-1 text-white":"mr-1 bg-gray-50 px-2 py-1 text-clrs-navy"),onClick:r},n)},xt=()=>{const{keys:e,list:n,pick:r,solved:o}=tt,s=t=>()=>{ft.input(t)},i=o?[]:e,a=null!=r?n[r]:void 0;return t("div",{class:"mt-2 flex flex-row justify-end"},o||!a||a.isClue||"."==a.key?"":t(vt,{label:"x",callback:s(".")}),i.map((e=>t(vt,{label:e,callback:s(e),matched:a.key===e}))))},Ct=[2,5,11,14,20,23,29,32,38,41,47,50,56,59,65,68,74,77],Tt=Ct.map((t=>t+1)),kt=[18,19,20,21,22,23,24,25,26,45,46,47,48,49,50,51,52,53],Rt=kt.map((t=>t+9)),Et=e=>{const{cell:n,focus:r,selected:o,solved:s}=e,{key:i,isClue:a,indx:l}=n,c="."!=i?i:"";return t("label",{class:dt(`cell-${l}`,Ct.includes(l)?"border-xbr-clrs-navy":"",Tt.includes(l)?"border-xbl-clrs-navy":"",kt.includes(l)?"border-xbb-clrs-navy":"",Rt.includes(l)?"border-xbt-clrs-navy":"","h-8 w-8 border border-solid text-center leading-8",o?"border-clrs-red bg-clrs-red-a50 text-clrs-red":r?"border-clrs-gray bg-clrs-green-a50 font-bold":a?"border-clrs-gray bg-clrs-silver":""!==c?"border-clrs-gray text-clrs-red":"border-clrs-gray"),onClick:((t,e)=>()=>{e||ft.select(t)})(n,s)},c)},St=()=>{const{list:e,pick:n,locs:r,solved:o}=tt;return t("div",{class:dt("flex flex-row flex-wrap","border border-solid border-clrs-navy","h-76p5 w-76p5 text-lg")},e.map(((e,s)=>{const i=!o&&s===n,a=!o&&r.includes(s);return t(Et,{cell:e,focus:a,selected:i,solved:o})})))},jt=()=>t("label",{class:"ml-auto align-top text-xs italic text-clrs-slate4"},"Tailwind ","4.1.18"),Mt=t=>()=>{t.refresh()},Pt=t=>()=>{t.check()},At=()=>{const{list:e,solved:n}=tt;return t("div",{class:"flex flex-row"},t(vt,{label:g,callback:Mt(ft)}),81!==e.length||n?"":t(vt,{label:p,callback:Pt(ft)}),t(jt,null))},Ot=class{constructor(t){n(this,t),this.tag="proto-sudoku",this.platform="vercel"}componentDidLoad(){ft.initApp(this.platform)}render(){return t("div",{key:"9f50eec975c4da5f4984b80380067d5155dda0d1",id:"app",class:"ds1-main relative max-w-min p-0.5"},t(wt,{key:"e7bab7e257022a9920f8b43785d9dc33ab7fed65"}),t(mt,{key:"d8c32e6b9c20b9fe6c8ff2e9fc7a9900057a2679"},"Sudoku"),t(St,{key:"8a028015ae4380aaa54a406ccf5cc908816ca6a4"}),t(xt,{key:"951b6d20ca7a99ced4c60aa39fe040af6e96dd46"}),t("hr",{key:"35ba2812a3b068b21b5252c5f07d0b5dc2f18527",class:"ml-0 mr-0"}),t(At,{key:"114e7edd4bf3da82ae344f56cb7e856ce17a6da8"}),t(gt,{key:"2c15eb0ba714d1e0c378882c62ce575c428adc2a"}))}};Ot.style="\\n@layer properties;\\n@layer theme, base, components, utilities;\\n@layer theme {\\n :root,\\n :host {\\n --font-sans:\\n ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',\\n 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';\\n --color-gray-50: oklch(98.5% 0.002 247.839);\\n --color-white: #fff;\\n --spacing: 0.25rem;\\n --text-xs: 0.75rem;\\n --text-xs--line-height: calc(1 / 0.75);\\n --text-lg: 1.125rem;\\n --text-lg--line-height: calc(1.75 / 1.125);\\n --text-6xl: 3.75rem;\\n --text-6xl--line-height: 1;\\n --font-weight-thin: 100;\\n --font-weight-bold: 700;\\n --radius-md: 0.375rem;\\n --animate-spin: spin 1s linear infinite;\\n }\\n}\\n@layer utilities {\\n .absolute {\\n position: absolute;\\n }\\n .relative {\\n position: relative;\\n }\\n .top-0 {\\n top: calc(var(--spacing) * 0);\\n }\\n .right-0 {\\n right: calc(var(--spacing) * 0);\\n }\\n .m-6 {\\n margin: calc(var(--spacing) * 6);\\n }\\n .mt-2 {\\n margin-top: calc(var(--spacing) * 2);\\n }\\n .mt-5 {\\n margin-top: calc(var(--spacing) * 5);\\n }\\n .mt-11 {\\n margin-top: calc(var(--spacing) * 11);\\n }\\n .mr-0 {\\n margin-right: calc(var(--spacing) * 0);\\n }\\n .mr-1 {\\n margin-right: calc(var(--spacing) * 1);\\n }\\n .mr-2 {\\n margin-right: calc(var(--spacing) * 2);\\n }\\n .mb-11 {\\n margin-bottom: calc(var(--spacing) * 11);\\n }\\n .ml-0 {\\n margin-left: calc(var(--spacing) * 0);\\n }\\n .ml-auto {\\n margin-left: auto;\\n }\\n .flex {\\n display: flex;\\n }\\n .grid {\\n display: grid;\\n }\\n .h-8 {\\n height: calc(var(--spacing) * 8);\\n }\\n .h-24px {\\n height: 24px;\\n }\\n .h-76p5 {\\n height: 19.125rem;\\n }\\n .w-8 {\\n width: calc(var(--spacing) * 8);\\n }\\n .w-76p5 {\\n width: 19.125rem;\\n }\\n .max-w-min {\\n max-width: min-content;\\n }\\n .animate-spin {\\n animation: var(--animate-spin);\\n }\\n .flex-col {\\n flex-direction: column;\\n }\\n .flex-row {\\n flex-direction: row;\\n }\\n .flex-wrap {\\n flex-wrap: wrap;\\n }\\n .items-center {\\n align-items: center;\\n }\\n .justify-end {\\n justify-content: flex-end;\\n }\\n .rounded-md {\\n border-radius: var(--radius-md);\\n }\\n .border {\\n border-style: var(--tw-border-style);\\n border-width: 1px;\\n }\\n .border-solid {\\n --tw-border-style: solid;\\n border-style: solid;\\n }\\n .border-clrs-gray {\\n border-color: var(--clrs-gray, #aaaaaa);\\n }\\n .border-clrs-navy {\\n border-color: var(--clrs-navy, #001f3f);\\n }\\n .border-clrs-red {\\n border-color: var(--clrs-red, #ff4136);\\n }\\n .border-clrs-slate4 {\\n border-color: var(--clrs-slate4, #4e5964);\\n }\\n .bg-clrs-green-a50 {\\n background-color: var(--clrs-green-a50, #2ecc4050);\\n }\\n .bg-clrs-navy {\\n background-color: var(--clrs-navy, #001f3f);\\n }\\n .bg-clrs-red {\\n background-color: var(--clrs-red, #ff4136);\\n }\\n .bg-clrs-red-a50 {\\n background-color: var(--clrs-red-a50, #ff413650);\\n }\\n .bg-clrs-silver {\\n background-color: var(--clrs-silver, #dddddd);\\n }\\n .bg-clrs-slate4 {\\n background-color: var(--clrs-slate4, #4e5964);\\n }\\n .bg-clrs-yellow {\\n background-color: var(--clrs-yellow, #ffdc00);\\n }\\n .bg-gray-50 {\\n background-color: var(--color-gray-50);\\n }\\n .p-0\\.5 {\\n padding: calc(var(--spacing) * 0.5);\\n }\\n .px-2 {\\n padding-inline: calc(var(--spacing) * 2);\\n }\\n .px-3 {\\n padding-inline: calc(var(--spacing) * 3);\\n }\\n .py-1 {\\n padding-block: calc(var(--spacing) * 1);\\n }\\n .py-2 {\\n padding-block: calc(var(--spacing) * 2);\\n }\\n .text-center {\\n text-align: center;\\n }\\n .align-top {\\n vertical-align: top;\\n }\\n .font-sans {\\n font-family: var(--font-sans);\\n }\\n .text-6xl {\\n font-size: var(--text-6xl);\\n line-height: var(--tw-leading, var(--text-6xl--line-height));\\n }\\n .text-lg {\\n font-size: var(--text-lg);\\n line-height: var(--tw-leading, var(--text-lg--line-height));\\n }\\n .text-xs {\\n font-size: var(--text-xs);\\n line-height: var(--tw-leading, var(--text-xs--line-height));\\n }\\n .leading-8 {\\n --tw-leading: calc(var(--spacing) * 8);\\n line-height: calc(var(--spacing) * 8);\\n }\\n .font-bold {\\n --tw-font-weight: var(--font-weight-bold);\\n font-weight: var(--font-weight-bold);\\n }\\n .font-thin {\\n --tw-font-weight: var(--font-weight-thin);\\n font-weight: var(--font-weight-thin);\\n }\\n .text-clrs-gray {\\n color: var(--clrs-gray, #aaaaaa);\\n }\\n .text-clrs-navy {\\n color: var(--clrs-navy, #001f3f);\\n }\\n .text-clrs-red {\\n color: var(--clrs-red, #ff4136);\\n }\\n .text-clrs-slate4 {\\n color: var(--clrs-slate4, #4e5964);\\n }\\n .text-white {\\n color: var(--color-white);\\n }\\n .uppercase {\\n text-transform: uppercase;\\n }\\n .italic {\\n font-style: italic;\\n }\\n .opacity-25 {\\n opacity: 25%;\\n }\\n .opacity-75 {\\n opacity: 75%;\\n }\\n .shadow {\\n --tw-shadow:\\n 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)),\\n 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\\n box-shadow:\\n var(--tw-inset-shadow), var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\\n }\\n .border-xbb-clrs-navy {\\n border-bottom: 1px solid var(--clrs-navy, #001f3f) !important;\\n }\\n .border-xbl-clrs-navy {\\n border-left: 1px solid var(--clrs-navy, #001f3f) !important;\\n }\\n .border-xbr-clrs-navy {\\n border-right: 1px solid var(--clrs-navy, #001f3f) !important;\\n }\\n .border-xbt-clrs-navy {\\n border-top: 1px solid var(--clrs-navy, #001f3f) !important;\\n }\\n .hover\\:text-clrs-navy {\\n &:hover {\\n @media (hover: hover) {\\n color: var(--clrs-navy, #001f3f);\\n }\\n }\\n }\\n}\\n@layer components {\\n .ds1-main {\\n margin: calc(var(--spacing) * 6);\\n display: flex;\\n flex-direction: column;\\n font-family: var(--font-sans);\\n color: var(--clrs-navy, #001f3f);\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n }\\n}\\n@keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n@layer properties {\\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or\\n ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {\\n *,\\n ::before,\\n ::after,\\n ::backdrop {\\n --tw-border-style: solid;\\n --tw-leading: initial;\\n --tw-font-weight: initial;\\n --tw-shadow: 0 0 #0000;\\n --tw-shadow-color: initial;\\n --tw-shadow-alpha: 100%;\\n --tw-inset-shadow: 0 0 #0000;\\n --tw-inset-shadow-color: initial;\\n --tw-inset-shadow-alpha: 100%;\\n --tw-ring-color: initial;\\n --tw-ring-shadow: 0 0 #0000;\\n --tw-inset-ring-color: initial;\\n --tw-inset-ring-shadow: 0 0 #0000;\\n --tw-ring-inset: initial;\\n --tw-ring-offset-width: 0px;\\n --tw-ring-offset-color: #fff;\\n --tw-ring-offset-shadow: 0 0 #0000;\\n }\\n }\\n}\\n";export{Ot as proto_sudoku}
|
|
1
|
+
import{h as t,S as e,r as n}from"./p-CBGxvxwA.js";const r=e=>{const n=e.hex||"currentColor",r=e.size||24;return t("svg",{class:e.class,width:r,height:r,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"alien"),t("g",{fill:n},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"}))},o="proto-sudoku",s=`${o}::data`,i=`${o}::inputs`,a=`${o}::pick`,l=t=>{const e=localStorage.getItem(t);return e?JSON.parse(e):void 0},c=(t,e)=>{const n=JSON.stringify(e);localStorage.setItem(t,n)},h=()=>[...l(i)],f=t=>{c(i,t.join(""))},d=()=>{const t=l(a);return null!==t?t:void 0},u=t=>{c(a,t>=0&&t<81?t:null)},p="Check ?",g="New Puzzle",b=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys()){const n=t.get(e).filter((t=>{const e=t.deref();return e&&(!("isConnected"in(n=e))||n.isConnected);var n}));t.set(e,n)}})(...e)}),2e3)}})(),y=e.forceUpdate,w=e.getRenderingRef,m=(t,e)=>{const n=t.indexOf(e);n>=0&&(t[n]=t[t.length-1],t.length--)};class v extends Error{response;request;options;constructor(t,e,n){const r=`${t.status||0===t.status?t.status:""} ${t.statusText??""}`.trim();super(`Request failed with ${r?`status code ${r}`:"an unknown error"}: ${e.method} ${e.url}`),this.name="HTTPError",this.response=t,this.request=e,this.options=n}}class x extends Error{name="NonError";value;constructor(t){let e="Non-error value was thrown";try{"string"==typeof t?e=t:t&&"object"==typeof t&&"message"in t&&"string"==typeof t.message&&(e=t.message)}catch{}super(e),this.value=t}}class C extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(t){const e=t?.cause?t.cause instanceof Error?t.cause:new x(t.cause):void 0;super(t?.code?`Forced retry: ${t.code}`:"Forced retry",e?{cause:e}:void 0),this.customDelay=t?.delay,this.code=t?.code,this.customRequest=t?.request}}const T=(()=>{let t=!1,e=!1;const n="function"==typeof globalThis.ReadableStream,r="function"==typeof globalThis.Request;if(n&&r)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(t){if(t instanceof Error&&"unsupported BodyInit type"===t.message)return!1;throw t}return t&&!e})(),k="function"==typeof globalThis.AbortController,R="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,E="function"==typeof globalThis.ReadableStream,S="function"==typeof globalThis.FormData,j=["get","post","put","patch","head","delete"],M={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},A=2147483647,P=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,O=Symbol("stop");class z{options;constructor(t){this.options=t}}const N=t=>new z(t),U={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},q={next:!0},L={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,duplex:!0},B=(t,e,n)=>{let r,o=0;return t.pipeThrough(new TransformStream({transform(t,s){if(s.enqueue(t),r){o+=r.byteLength;let t=0===e?0:o/e;t>=1&&(t=1-Number.EPSILON),n?.({percent:t,totalBytes:Math.max(e,o),transferredBytes:o},r)}r=t},flush(){r&&(o+=r.byteLength,n?.({percent:1,totalBytes:Math.max(e,o),transferredBytes:o},r))}}))},$=t=>null!==t&&"object"==typeof t,D=(...t)=>{for(const e of t)if((!$(e)||Array.isArray(e))&&void 0!==e)throw new TypeError("The `options` argument must be an object");return X({},...t)},H=(t={},e={})=>{const n=new globalThis.Headers(t),r=e instanceof globalThis.Headers,o=new globalThis.Headers(e);for(const[t,e]of o.entries())r&&"undefined"===e||void 0===e?n.delete(t):n.set(t,e);return n};function J(t,e,n){return Object.hasOwn(e,n)&&void 0===e[n]?[]:X(t[n]??[],e[n]??[])}const F=(t={},e={})=>({beforeRequest:J(t,e,"beforeRequest"),beforeRetry:J(t,e,"beforeRetry"),afterResponse:J(t,e,"afterResponse"),beforeError:J(t,e,"beforeError")}),W=(t,e)=>{const n=new URLSearchParams;for(const r of[t,e])if(void 0!==r)if(r instanceof URLSearchParams)for(const[t,e]of r.entries())n.append(t,e);else if(Array.isArray(r))for(const t of r){if(!Array.isArray(t)||2!==t.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(t[0]),String(t[1]))}else if($(r))for(const[t,e]of Object.entries(r))void 0!==e&&n.append(t,String(e));else{const t=new URLSearchParams(r);for(const[e,r]of t.entries())n.append(e,r)}return n},X=(...t)=>{let e,n={},r={},o={};const s=[];for(const i of t)if(Array.isArray(i))Array.isArray(n)||(n=[]),n=[...n,...i];else if($(i)){for(let[t,r]of Object.entries(i))if("signal"===t&&r instanceof globalThis.AbortSignal)s.push(r);else if("context"!==t)"searchParams"!==t?($(r)&&t in n&&(r=X(n[t],r)),n={...n,[t]:r}):e=null==r?void 0:void 0===e?r:W(e,r);else{if(null!=r&&(!$(r)||Array.isArray(r)))throw new TypeError("The `context` option must be an object");n={...n,context:null==r?{}:{...n.context,...r}}}$(i.hooks)&&(o=F(o,i.hooks),n.hooks=o),$(i.headers)&&(r=H(r,i.headers),n.headers=r)}return void 0!==e&&(n.searchParams=e),s.length>0&&(n.signal=1===s.length?s[0]:R?AbortSignal.any(s):s.at(-1)),void 0===n.context&&(n.context={}),n},I=t=>j.includes(t)?t.toUpperCase():t,G={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},K=(t={})=>{if("number"==typeof t)return{...G,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.methods&&=t.methods.map((t=>t.toLowerCase())),t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");const e=Object.fromEntries(Object.entries(t).filter((([,t])=>void 0!==t)));return{...G,...e}};class Z extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}}class V{static create(t,e){const n=new V(t,e),r=n.#t((async()=>{if("number"==typeof n.#e.timeout&&n.#e.timeout>A)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let t=await n.#n();for(const e of n.#e.hooks.afterResponse){const r=n.#r(t.clone());let o;try{o=await e(n.request,n.#o(),r,{retryCount:n.#s})}catch(e){throw n.#i(r),n.#i(t),e}if(o instanceof z)throw n.#i(r),n.#i(t),new C(o.options);const s=o instanceof globalThis.Response?o:t;r!==s&&n.#i(r),t!==s&&n.#i(t),t=s}if(n.#r(t),!t.ok&&("function"==typeof n.#e.throwHttpErrors?n.#e.throwHttpErrors(t.status):n.#e.throwHttpErrors)){let e=new v(t,n.request,n.#o());for(const t of n.#e.hooks.beforeError)e=await t(e,{retryCount:n.#s});throw e}if(n.#e.onDownloadProgress){if("function"!=typeof n.#e.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!E)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=t.clone();return n.#i(t),((t,e)=>{if(!t.body)return t;if(204===t.status)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});const n=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(B(t.body,n,e),{status:t.status,statusText:t.statusText,headers:t.headers})})(e,n.#e.onDownloadProgress)}return t})).finally((()=>{const t=n.#a;n.#l(t?.body??void 0),n.#l(n.request.body??void 0)}));for(const[t,o]of Object.entries(M))"bytes"===t&&"function"!=typeof globalThis.Response?.prototype?.bytes||(r[t]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||o);const s=await r;if("json"===t){if(204===s.status)return"";const t=await s.text();return""===t?"":e.parseJson?e.parseJson(t):JSON.parse(t)}return s[t]()});return r}static#c(t){return!t||"object"!=typeof t||Array.isArray(t)||t instanceof URLSearchParams?t:Object.fromEntries(Object.entries(t).filter((([,t])=>void 0!==t)))}request;#h;#s=0;#f;#e;#a;#d;#u;constructor(t,e={}){if(this.#f=t,this.#e={...e,headers:H(this.#f.headers,e.headers),hooks:F({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},e.hooks),method:I(e.method??this.#f.method??"GET"),prefixUrl:String(e.prefixUrl||""),retry:K(e.retry),throwHttpErrors:e.throwHttpErrors??!0,timeout:e.timeout??1e4,fetch:e.fetch??globalThis.fetch.bind(globalThis),context:e.context??{}},"string"!=typeof this.#f&&!(this.#f instanceof URL||this.#f instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&"string"==typeof this.#f){if(this.#f.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#f=this.#e.prefixUrl+this.#f}k&&R&&(this.#d=this.#e.signal??this.#f.signal,this.#h=new globalThis.AbortController,this.#e.signal=this.#d?AbortSignal.any([this.#d,this.#h.signal]):this.#h.signal),T&&(this.#e.duplex="half"),void 0!==this.#e.json&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const n=e.headers&&new globalThis.Headers(e.headers).has("content-type");if(this.#f instanceof globalThis.Request&&(S&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!n&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#f,this.#e),void 0!==(r=this.#e.searchParams)&&(Array.isArray(r)?r.length>0:r instanceof URLSearchParams?r.size>0:"object"==typeof r?Object.keys(r).length>0:"string"==typeof r?r.trim().length>0:Boolean(r))){const t="string"==typeof this.#e.searchParams?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(V.#c(this.#e.searchParams)).toString(),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,"?"+t);this.request=new globalThis.Request(e,this.#e)}var r;if(this.#e.onUploadProgress){if("function"!=typeof this.#e.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!T)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#p(this.request,this.#e.body??void 0)}}#g(){const t=this.#e.retry.delay(this.#s);let e=t;!0===this.#e.retry.jitter?e=Math.random()*t:"function"==typeof this.#e.retry.jitter&&(e=this.#e.retry.jitter(t),(!Number.isFinite(e)||e<0)&&(e=t));const n=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(n,e)}async#b(t){if(this.#s++,this.#s>this.#e.retry.limit)throw t;const e=t instanceof Error?t:new x(t);if(e instanceof C)return e.customDelay??this.#g();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw t;if(void 0!==this.#e.retry.shouldRetry){const n=await this.#e.retry.shouldRetry({error:e,retryCount:this.#s});if(!1===n)throw t;if(!0===n)return this.#g()}if(function(t){return t instanceof Z||t?.name===Z.name}(t)&&!this.#e.retry.retryOnTimeout)throw t;if(function(t){return t instanceof v||t?.name===v.name}(t)){if(!this.#e.retry.statusCodes.includes(t.response.status))throw t;const e=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Retry-After")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(e&&this.#e.retry.afterStatusCodes.includes(t.response.status)){let t=1e3*Number(e);Number.isNaN(t)?t=Date.parse(e)-Date.now():t>=Date.parse("2024-01-01")&&(t-=Date.now());const n=this.#e.retry.maxRetryAfter??t;return t<n?t:n}if(413===t.response.status)throw t}return this.#g()}#r(t){return this.#e.parseJson&&(t.json=async()=>this.#e.parseJson(await t.text())),t}#l(t){t&&t.cancel().catch((()=>{}))}#i(t){this.#l(t.body??void 0)}async#t(t){try{return await t()}catch(e){const n=Math.min(await this.#b(e),A);if(this.#s<1)throw e;if(await async function(t,{signal:e}){return new Promise(((n,r)=>{function o(){clearTimeout(s),r(e.reason)}e&&(e.throwIfAborted(),e.addEventListener("abort",o,{once:!0}));const s=setTimeout((()=>{e?.removeEventListener("abort",o),n()}),t)}))}(n,this.#d?{signal:this.#d}:{}),e instanceof C&&e.customRequest){const t=this.#e.signal?new globalThis.Request(e.customRequest,{signal:this.#e.signal}):new globalThis.Request(e.customRequest);this.#y(t)}for(const t of this.#e.hooks.beforeRetry){const n=await t({request:this.request,options:this.#o(),error:e,retryCount:this.#s});if(n instanceof globalThis.Request){this.#y(n);break}if(n instanceof globalThis.Response)return n;if(n===O)return}return this.#t(t)}}async#n(){this.#h?.signal.aborted&&(this.#h=new globalThis.AbortController,this.#e.signal=this.#d?AbortSignal.any([this.#d,this.#h.signal]):this.#h.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(const t of this.#e.hooks.beforeRequest){const e=await t(this.request,this.#o(),{retryCount:this.#s});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#y(e);break}}const t=((t,e)=>{const n={};for(const r in e)Object.hasOwn(e,r)&&(r in L||r in U||r in t&&!(r in q)||(n[r]=e[r]));return n})(this.request,this.#e);return this.#a=this.request,this.request=this.#a.clone(),!1===this.#e.timeout?this.#e.fetch(this.#a,t):async function(t,e,n,r){return new Promise(((o,s)=>{const i=setTimeout((()=>{n&&n.abort(),s(new Z(t))}),r.timeout);r.fetch(t,e).then(o).catch(s).then((()=>{clearTimeout(i)}))}))}(this.#a,t,this.#h,this.#e)}#o(){if(!this.#u){const{hooks:t,...e}=this.#e;this.#u=Object.freeze(e)}return this.#u}#y(t){this.#u=void 0,this.request=this.#p(t)}#p(t,e){return this.#e.onUploadProgress&&t.body?((t,e,n)=>{if(!t.body)return t;const r=(t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(const[n,r]of t)e+=P,e+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${n}"`).length,e+="string"==typeof r?(new TextEncoder).encode(r).length:r.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if("string"==typeof t)return(new TextEncoder).encode(t).length;if(t instanceof URLSearchParams)return(new TextEncoder).encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if("object"==typeof t&&null!==t)try{const e=JSON.stringify(t);return(new TextEncoder).encode(e).length}catch{return 0}return 0})(n??t.body);return new Request(t,{duplex:"half",body:B(t.body,r,e)})})(t,this.#e.onUploadProgress,e??this.#e.body??void 0):t}}
|
|
2
|
+
/*! MIT License © Sindre Sorhus */const Y=t=>{const e=(e,n)=>V.create(e,D(t,n));for(const n of j)e[n]=(e,r)=>V.create(e,D(t,r,{method:n}));return e.create=t=>Y(D(t)),e.extend=e=>("function"==typeof e&&(e=e(t??{})),Y(D(t,e))),e.stop=O,e.retry=N,e},_=Y(),Q={list:[],keys:[],locs:[],loading:!1,solved:!1,error:void 0,pick:void 0,data:void 0},{state:tt}=(()=>{const t=((t,e=(t,e)=>t!==e)=>{const n=()=>{return("function"==typeof(e=t)?e():e)??{};var e},r=n();let o=new Map(Object.entries(r));const s="undefined"!=typeof Proxy,i=s?null:{},a={dispose:[],get:[],set:[],reset:[]},l=new Map,c=()=>{o=new Map(Object.entries(n())),s||g(),a.reset.forEach((t=>t()))},h=t=>(a.get.forEach((e=>e(t))),o.get(t)),f=(t,n)=>{const r=o.get(t);e(n,r,t)&&(o.set(t,n),s||p(t),a.set.forEach((e=>e(t,n,r))))},d=s?new Proxy(r,{get:(t,e)=>h(e),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>o.has(e),set:(t,e,n)=>(f(e,n),!0)}):(g(),i),u=(t,e)=>(a[t].push(e),()=>{m(a[t],e)});function p(t){!s&&i&&(Object.prototype.hasOwnProperty.call(i,t)||Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:()=>h(t),set(e){f(t,e)}}))}function g(){if(s||!i)return;const t=new Set(o.keys());for(const e of Object.keys(i))t.has(e)||delete i[e];for(const e of t)p(e)}return{state:d,get:h,set:f,on:u,onChange:(t,e)=>{const r=(n,r)=>{n===t&&e(r)},o=()=>{const r=n();e(r[t])},s=u("set",r),i=u("reset",o);return l.set(e,{setHandler:r,resetHandler:o,propName:t}),()=>{s(),i(),l.delete(e)}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(u("set",e.set)),e.get&&t.push(u("get",e.get)),e.reset&&t.push(u("reset",e.reset)),e.dispose&&t.push(u("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{a.dispose.forEach((t=>t())),c()},reset:c,forceUpdate:t=>{const e=o.get(t);a.set.forEach((n=>n(t,e,e)))},removeListener:(t,e)=>{const n=l.get(e);n&&n.propName===t&&(m(a.set,n.setHandler),m(a.reset,n.resetHandler),l.delete(e))}}})(Q,void 0);return t.use((()=>{if("function"!=typeof w||"function"!=typeof y)return{};const t=y,e=w,n=new Map;return{dispose:()=>n.clear(),get:t=>{const r=e();r&&((t,e,n)=>{let r=t.get(e);r||(r=[],t.set(e,r)),r.some((t=>t.deref()===n))||r.push(new WeakRef(n))})(n,t,r)},set:e=>{const r=n.get(e);if(r){const o=r.filter((e=>{const n=e.deref();return!!n&&t(n)}));n.set(e,o)}b(n)},reset:()=>{n.forEach((e=>{e.forEach((e=>{const n=e.deref();n&&t(n)}))})),b(n)}}})()),t})(),et=new Map([["row",new Map],["column",new Map],["box",new Map]]),nt=["1","2","3","4","5","6","7","8","9"],rt=t=>{if(void 0!==t&&t.indx!=tt.pick){const{isClue:e,indx:n,row:r,column:o,box:s}=t,i=((t,e,n,r)=>{const o=new Map([["row",e],["column",n],["box",r]]),s=new Set;return o.forEach(((e,n)=>{et.get(n).get(e).forEach((e=>{e!==t&&s.add(e)}))})),Array.from(s)})(n,r,o,s),a=e?[]:(t=>{const{list:e}=tt,n=new Set;return t.map((t=>{const{key:r}=e[t];"."!=r&&n.add(r)})),nt.filter((t=>!n.has(t)))})(i);tt.pick=n,tt.keys=a,tt.locs=i}else tt.pick=void 0,tt.keys=[],tt.locs=[];at(tt.pick)};let ot;const st={local:"http://localhost:8080/api",netlify:"/.netlify/functions",vercel:"https://sudoku-rust-api.vercel.app/api"},it=t=>{f(t)},at=t=>{u(t)},lt=(t=!1)=>{tt.list=[],tt.keys=[],tt.locs=[],tt.loading=t,tt.solved=!1,tt.error=void 0,tt.pick=void 0,tt.data=void 0},ct=(t,e=!0)=>{const{puzzle:n,ref:r}=t;e&&(f([]),c(s,t)),(t=>{if(t){const{puzzle:e,ref:n}=t,r=e?[...e]:[],o=n?atob(n):void 0,s=o?[...o]:[],i=r.map(((t,e)=>{const n=s[e],r=t===n,o=Math.floor(e/9),i=e%9,a=((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)(o,i);return((t,e,n,r)=>{new Map([["row",e],["column",n],["box",r]]).forEach(((e,n)=>{const r=et.get(n);r.has(e)?r.get(e).add(t):r.set(e,new Set([t]))}))})(e,o,i,a),{key:t,isClue:r,value:n,indx:e,row:o,column:i,box:a}}));(t=>{h().forEach(((e,n)=>{const r=t[n],{isClue:o}=r;o||(r.key=e)}))})(i),tt.data=t,tt.list=i}else tt.data=void 0,tt.list=[]})({puzzle:n,ref:r})},ht=t=>{tt.list=[...t],t.length=0},ft={initApp:t=>{(t=>{const e=(t=>{const e=Object.keys(st).includes(t)?t:"vercel";return st[e]})(t);ot=_.extend({hooks:{beforeRequest:[t=>{t.headers.set("X-Requested-With","ky"),t.headers.set("X-Custom-Header","foobar")}]},prefixUrl:e,timeout:1e4})})(t),lt();const e=l(s),n=d();if(e&&(ct(e,!1),n>=0)){const{list:t}=tt;rt(t[n])}},refresh:async()=>{lt(!0),it([]),at(tt.pick);try{const t=await ot.get("puzzle").json();ct(t)}catch(t){const{message:e}=t;console.log("-- ",e),console.log(t),tt.error=e}finally{tt.loading=!1}},select:t=>{rt(t)},check:()=>{const{list:t}=tt,e=[];let n=0,r=0,o=0;t.forEach((t=>{const{key:s,value:i,isClue:a}=t;a?o+=1:"."!==s&&(s!==i?(n+=1,t.key="."):r+=1),e.push(t.key)}));const s=o+r;it(r?e:[]),n>0?ht(t):81===s&&(tt.solved=!0)},input:t=>{const{pick:e,list:n}=tt;n[e].key=t,ht(n)}},dt=(...t)=>t.filter(Boolean).join(" "),ut=e=>{const n=e.hex||"currentColor",r=e.label||"loading...",o=e.size||24;return t("svg",{class:dt(e.class||"","animate-spin"),width:o,height:o,fill:"none",viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,r),t("g",null,t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:n,"stroke-width":"4"}),t("path",{class:"opacity-75",fill:n,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"}))},pt=e=>{const{message:n,salute:o,spinner:s=!1}=e;return t("div",{class:"mt-5 flex h-24px flex-row items-center"},t(s?ut:r,{class:"mr-2"}),o?t("label",{class:"mr-1 font-bold"},o,":"):"",t("label",{class:"italic"},n))},gt=()=>{const{solved:e,loading:n,error:r}=tt;return t("div",{class:"flex flex-col"},n||r||e?"":t(pt,{message:"Welcome, are you ready to play?..."}),n?t(pt,{message:"Loading...",spinner:!0}):"",r?t(pt,{message:r,salute:"ERROR"}):"",e?t(pt,{message:"You solved the puzzle!!"}):"")},bt=e=>{const n=e.hex||"currentColor",r=e.size||24;return t("svg",{class:e.class,width:r,height:r,viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,e.label||"fingerprint"),t("g",{fill:n},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"}))},yt="eswat2",wt=()=>t("a",{class:"absolute right-0 top-0 text-clrs-gray hover:text-clrs-navy",href:"https://eswat2.dev","aria-label":yt,target:"blank",title:yt},t(bt,{label:yt})),mt=(e,n)=>t("h1",{class:dt("text-center uppercase text-clrs-red","mb-11 ml-0 mr-0 mt-11","text-6xl font-thin")},n),vt=e=>{const{label:n,callback:r,matched:o=!1}=e;return t("button",{class:dt("rounded-md border border-solid border-clrs-slate4 font-bold",n===p?"mr-2 bg-clrs-yellow px-3 py-2 text-clrs-navy":n===g?"mr-2 bg-clrs-navy px-3 py-2 text-white":"x"===n?"mr-1 bg-clrs-red px-2 py-1 text-white":o?"mr-1 bg-clrs-slate4 px-2 py-1 text-white":"mr-1 bg-gray-50 px-2 py-1 text-clrs-navy"),onClick:r},n)},xt=()=>{const{keys:e,list:n,pick:r,solved:o}=tt,s=t=>()=>{ft.input(t)},i=o?[]:e,a=null!=r?n[r]:void 0;return t("div",{class:"mt-2 flex flex-row justify-end"},o||!a||a.isClue||"."==a.key?"":t(vt,{label:"x",callback:s(".")}),i.map((e=>t(vt,{label:e,callback:s(e),matched:a.key===e}))))},Ct=[2,5,11,14,20,23,29,32,38,41,47,50,56,59,65,68,74,77],Tt=Ct.map((t=>t+1)),kt=[18,19,20,21,22,23,24,25,26,45,46,47,48,49,50,51,52,53],Rt=kt.map((t=>t+9)),Et=e=>{const{cell:n,focus:r,selected:o,solved:s}=e,{key:i,isClue:a,indx:l}=n,c="."!=i?i:"";return t("label",{class:dt(`cell-${l}`,Ct.includes(l)?"border-xbr-clrs-navy":"",Tt.includes(l)?"border-xbl-clrs-navy":"",kt.includes(l)?"border-xbb-clrs-navy":"",Rt.includes(l)?"border-xbt-clrs-navy":"","h-8 w-8 border border-solid text-center leading-8",o?"border-clrs-red bg-clrs-red-a50 text-clrs-red":r?"border-clrs-gray bg-clrs-green-a50 font-bold":a?"border-clrs-gray bg-clrs-silver":""!==c?"border-clrs-gray text-clrs-red":"border-clrs-gray"),onClick:((t,e)=>()=>{e||ft.select(t)})(n,s)},c)},St=()=>{const{list:e,pick:n,locs:r,solved:o}=tt;return t("div",{class:dt("flex flex-row flex-wrap","border border-solid border-clrs-navy","h-76p5 w-76p5 text-lg")},e.map(((e,s)=>{const i=!o&&s===n,a=!o&&r.includes(s);return t(Et,{cell:e,focus:a,selected:i,solved:o})})))},jt=()=>t("label",{class:"ml-auto align-top text-xs italic text-clrs-slate4"},"Tailwind ","4.1.18"),Mt=t=>()=>{t.refresh()},At=t=>()=>{t.check()},Pt=()=>{const{list:e,solved:n}=tt;return t("div",{class:"flex flex-row"},t(vt,{label:g,callback:Mt(ft)}),81!==e.length||n?"":t(vt,{label:p,callback:At(ft)}),t(jt,null))},Ot=class{constructor(t){n(this,t),this.tag="proto-sudoku",this.platform="vercel"}componentDidLoad(){ft.initApp(this.platform)}render(){return t("div",{key:"9f50eec975c4da5f4984b80380067d5155dda0d1",id:"app",class:"ds1-main relative max-w-min p-0.5"},t(wt,{key:"e7bab7e257022a9920f8b43785d9dc33ab7fed65"}),t(mt,{key:"d8c32e6b9c20b9fe6c8ff2e9fc7a9900057a2679"},"Sudoku"),t(St,{key:"8a028015ae4380aaa54a406ccf5cc908816ca6a4"}),t(xt,{key:"951b6d20ca7a99ced4c60aa39fe040af6e96dd46"}),t("hr",{key:"35ba2812a3b068b21b5252c5f07d0b5dc2f18527",class:"ml-0 mr-0"}),t(Pt,{key:"114e7edd4bf3da82ae344f56cb7e856ce17a6da8"}),t(gt,{key:"2c15eb0ba714d1e0c378882c62ce575c428adc2a"}))}};Ot.style="\\n@layer properties;\\n@layer theme, base, components, utilities;\\n@layer theme {\\n :root,\\n :host {\\n --font-sans:\\n ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',\\n 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';\\n --color-gray-50: oklch(98.5% 0.002 247.839);\\n --color-white: #fff;\\n --spacing: 0.25rem;\\n --text-xs: 0.75rem;\\n --text-xs--line-height: calc(1 / 0.75);\\n --text-lg: 1.125rem;\\n --text-lg--line-height: calc(1.75 / 1.125);\\n --text-6xl: 3.75rem;\\n --text-6xl--line-height: 1;\\n --font-weight-thin: 100;\\n --font-weight-bold: 700;\\n --radius-md: 0.375rem;\\n --animate-spin: spin 1s linear infinite;\\n }\\n}\\n@layer utilities {\\n .absolute {\\n position: absolute;\\n }\\n .relative {\\n position: relative;\\n }\\n .top-0 {\\n top: calc(var(--spacing) * 0);\\n }\\n .right-0 {\\n right: calc(var(--spacing) * 0);\\n }\\n .m-6 {\\n margin: calc(var(--spacing) * 6);\\n }\\n .mt-2 {\\n margin-top: calc(var(--spacing) * 2);\\n }\\n .mt-5 {\\n margin-top: calc(var(--spacing) * 5);\\n }\\n .mt-11 {\\n margin-top: calc(var(--spacing) * 11);\\n }\\n .mr-0 {\\n margin-right: calc(var(--spacing) * 0);\\n }\\n .mr-1 {\\n margin-right: calc(var(--spacing) * 1);\\n }\\n .mr-2 {\\n margin-right: calc(var(--spacing) * 2);\\n }\\n .mb-11 {\\n margin-bottom: calc(var(--spacing) * 11);\\n }\\n .ml-0 {\\n margin-left: calc(var(--spacing) * 0);\\n }\\n .ml-auto {\\n margin-left: auto;\\n }\\n .flex {\\n display: flex;\\n }\\n .grid {\\n display: grid;\\n }\\n .h-8 {\\n height: calc(var(--spacing) * 8);\\n }\\n .h-24px {\\n height: 24px;\\n }\\n .h-76p5 {\\n height: 19.125rem;\\n }\\n .w-8 {\\n width: calc(var(--spacing) * 8);\\n }\\n .w-76p5 {\\n width: 19.125rem;\\n }\\n .max-w-min {\\n max-width: min-content;\\n }\\n .animate-spin {\\n animation: var(--animate-spin);\\n }\\n .flex-col {\\n flex-direction: column;\\n }\\n .flex-row {\\n flex-direction: row;\\n }\\n .flex-wrap {\\n flex-wrap: wrap;\\n }\\n .items-center {\\n align-items: center;\\n }\\n .justify-end {\\n justify-content: flex-end;\\n }\\n .rounded-md {\\n border-radius: var(--radius-md);\\n }\\n .border {\\n border-style: var(--tw-border-style);\\n border-width: 1px;\\n }\\n .border-solid {\\n --tw-border-style: solid;\\n border-style: solid;\\n }\\n .border-clrs-gray {\\n border-color: var(--clrs-gray, #aaaaaa);\\n }\\n .border-clrs-navy {\\n border-color: var(--clrs-navy, #001f3f);\\n }\\n .border-clrs-red {\\n border-color: var(--clrs-red, #ff4136);\\n }\\n .border-clrs-slate4 {\\n border-color: var(--clrs-slate4, #4e5964);\\n }\\n .bg-clrs-green-a50 {\\n background-color: var(--clrs-green-a50, #2ecc4050);\\n }\\n .bg-clrs-navy {\\n background-color: var(--clrs-navy, #001f3f);\\n }\\n .bg-clrs-red {\\n background-color: var(--clrs-red, #ff4136);\\n }\\n .bg-clrs-red-a50 {\\n background-color: var(--clrs-red-a50, #ff413650);\\n }\\n .bg-clrs-silver {\\n background-color: var(--clrs-silver, #dddddd);\\n }\\n .bg-clrs-slate4 {\\n background-color: var(--clrs-slate4, #4e5964);\\n }\\n .bg-clrs-yellow {\\n background-color: var(--clrs-yellow, #ffdc00);\\n }\\n .bg-gray-50 {\\n background-color: var(--color-gray-50);\\n }\\n .p-0\\.5 {\\n padding: calc(var(--spacing) * 0.5);\\n }\\n .px-2 {\\n padding-inline: calc(var(--spacing) * 2);\\n }\\n .px-3 {\\n padding-inline: calc(var(--spacing) * 3);\\n }\\n .py-1 {\\n padding-block: calc(var(--spacing) * 1);\\n }\\n .py-2 {\\n padding-block: calc(var(--spacing) * 2);\\n }\\n .text-center {\\n text-align: center;\\n }\\n .align-top {\\n vertical-align: top;\\n }\\n .font-sans {\\n font-family: var(--font-sans);\\n }\\n .text-6xl {\\n font-size: var(--text-6xl);\\n line-height: var(--tw-leading, var(--text-6xl--line-height));\\n }\\n .text-lg {\\n font-size: var(--text-lg);\\n line-height: var(--tw-leading, var(--text-lg--line-height));\\n }\\n .text-xs {\\n font-size: var(--text-xs);\\n line-height: var(--tw-leading, var(--text-xs--line-height));\\n }\\n .leading-8 {\\n --tw-leading: calc(var(--spacing) * 8);\\n line-height: calc(var(--spacing) * 8);\\n }\\n .font-bold {\\n --tw-font-weight: var(--font-weight-bold);\\n font-weight: var(--font-weight-bold);\\n }\\n .font-thin {\\n --tw-font-weight: var(--font-weight-thin);\\n font-weight: var(--font-weight-thin);\\n }\\n .text-clrs-gray {\\n color: var(--clrs-gray, #aaaaaa);\\n }\\n .text-clrs-navy {\\n color: var(--clrs-navy, #001f3f);\\n }\\n .text-clrs-red {\\n color: var(--clrs-red, #ff4136);\\n }\\n .text-clrs-slate4 {\\n color: var(--clrs-slate4, #4e5964);\\n }\\n .text-white {\\n color: var(--color-white);\\n }\\n .uppercase {\\n text-transform: uppercase;\\n }\\n .italic {\\n font-style: italic;\\n }\\n .opacity-25 {\\n opacity: 25%;\\n }\\n .opacity-75 {\\n opacity: 75%;\\n }\\n .shadow {\\n --tw-shadow:\\n 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)),\\n 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\\n box-shadow:\\n var(--tw-inset-shadow), var(--tw-inset-ring-shadow),\\n var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\\n }\\n .border-xbb-clrs-navy {\\n border-bottom: 1px solid var(--clrs-navy, #001f3f) !important;\\n }\\n .border-xbl-clrs-navy {\\n border-left: 1px solid var(--clrs-navy, #001f3f) !important;\\n }\\n .border-xbr-clrs-navy {\\n border-right: 1px solid var(--clrs-navy, #001f3f) !important;\\n }\\n .border-xbt-clrs-navy {\\n border-top: 1px solid var(--clrs-navy, #001f3f) !important;\\n }\\n .hover\\:text-clrs-navy {\\n &:hover {\\n @media (hover: hover) {\\n color: var(--clrs-navy, #001f3f);\\n }\\n }\\n }\\n}\\n@layer components {\\n .ds1-main {\\n margin: calc(var(--spacing) * 6);\\n display: flex;\\n flex-direction: column;\\n font-family: var(--font-sans);\\n color: var(--clrs-navy, #001f3f);\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n }\\n}\\n@keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n@layer properties {\\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or\\n ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {\\n *,\\n ::before,\\n ::after,\\n ::backdrop {\\n --tw-border-style: solid;\\n --tw-leading: initial;\\n --tw-font-weight: initial;\\n --tw-shadow: 0 0 #0000;\\n --tw-shadow-color: initial;\\n --tw-shadow-alpha: 100%;\\n --tw-inset-shadow: 0 0 #0000;\\n --tw-inset-shadow-color: initial;\\n --tw-inset-shadow-alpha: 100%;\\n --tw-ring-color: initial;\\n --tw-ring-shadow: 0 0 #0000;\\n --tw-inset-ring-color: initial;\\n --tw-inset-ring-shadow: 0 0 #0000;\\n --tw-ring-inset: initial;\\n --tw-ring-offset-width: 0px;\\n --tw-ring-offset-color: #fff;\\n --tw-ring-offset-shadow: 0 0 #0000;\\n }\\n }\\n}\\n";export{Ot as proto_sudoku}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,B as a,c as n,w as r,N as e,H as o,b as i}from"./p-CBGxvxwA.js";export{s as setNonce}from"./p-CBGxvxwA.js";import{g as p}from"./p-DQuL1Twl.js";var m=s=>{const t=s.cloneNode;s.cloneNode=function(s){if("TEMPLATE"===this.nodeName)return t.call(this,s);const a=t.call(this,!1),n=this.childNodes;if(s)for(let s=0;s<n.length;s++)2!==n[s].nodeType&&a.appendChild(n[s].cloneNode(!0));return a}};(()=>{a.isDev&&!a.isTesting&&n("Running in development mode."),a.cloneNodeFix&&m(o.prototype);const s=a.scriptDataOpts?r.document&&Array.from(r.document.querySelectorAll("script")).find((s=>new RegExp(`/${e}(\\.esm)?\\.js($|\\?|#)`).test(s.src)||s.getAttribute("data-stencil-namespace")===e)):null,i=import.meta.url,p=a.scriptDataOpts&&(s||{})["data-opts"]||{};return""!==i&&(p.resourcesUrl=new URL(".",i).href),t(p)})().then((async s=>(await p(),i([["p-
|
|
1
|
+
import{p as t,B as a,c as n,w as r,N as e,H as o,b as i}from"./p-CBGxvxwA.js";export{s as setNonce}from"./p-CBGxvxwA.js";import{g as p}from"./p-DQuL1Twl.js";var m=s=>{const t=s.cloneNode;s.cloneNode=function(s){if("TEMPLATE"===this.nodeName)return t.call(this,s);const a=t.call(this,!1),n=this.childNodes;if(s)for(let s=0;s<n.length;s++)2!==n[s].nodeType&&a.appendChild(n[s].cloneNode(!0));return a}};(()=>{a.isDev&&!a.isTesting&&n("Running in development mode."),a.cloneNodeFix&&m(o.prototype);const s=a.scriptDataOpts?r.document&&Array.from(r.document.querySelectorAll("script")).find((s=>new RegExp(`/${e}(\\.esm)?\\.js($|\\?|#)`).test(s.src)||s.getAttribute("data-stencil-namespace")===e)):null,i=import.meta.url,p=a.scriptDataOpts&&(s||{})["data-opts"]||{};return""!==i&&(p.resourcesUrl=new URL(".",i).href),t(p)})().then((async s=>(await p(),i([["p-18a8ddd7",[[1,"proto-sudoku",{tag:[1],platform:[1]}]]]],s))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proto-sudoku-wc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.135",
|
|
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",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@stencil/core": "4.40.1",
|
|
31
31
|
"@stencil/store": "2.2.2",
|
|
32
|
-
"ky": "1.14.
|
|
32
|
+
"ky": "1.14.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"autoprefixer": "10.4.23",
|