@shgysk8zer0/polyfills 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/CSSStyleSheet.js +2 -2
- package/JSON.js +2 -0
- package/all.js +3 -42
- package/all.min.js +2 -2
- package/all.min.js.map +1 -1
- package/array.js +0 -1
- package/browser.js +43 -0
- package/browser.min.js +56 -0
- package/browser.min.js.map +1 -0
- package/map.js +37 -41
- package/node.js +1 -0
- package/node.min.js +1 -1
- package/node.min.js.map +1 -1
- package/package.json +16 -3
- package/regexp.js +8 -0
- package/deprecated/.gitkeep +0 -0
- package/rollup.config.js +0 -39
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- markdownlint-disable -->
|
|
1
2
|
# Changelog
|
|
2
3
|
All notable changes to this project will be documented in this file.
|
|
3
4
|
|
|
@@ -6,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
7
|
|
|
7
8
|
## [Unreleased]
|
|
8
9
|
|
|
10
|
+
## [v0.4.3] - 2024-09-17
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Add a few tests via `*.test.js` and `node --test`
|
|
14
|
+
- Add `browser.js` (replaces `all.js`)
|
|
15
|
+
- Add `RegExp.escape`
|
|
16
|
+
- Add `exports` to `package.json`
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- Update to node 20.9.0
|
|
20
|
+
|
|
21
|
+
### Deprecated
|
|
22
|
+
- Deprecated `all.js`/`all.min.js`
|
|
23
|
+
|
|
9
24
|
## [v0.4.2] - 2024-09-13
|
|
10
25
|
|
|
11
26
|
### Added
|
package/CSSStyleSheet.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export function createSheet(rules = '', { disabled = false, media } = {}) {
|
|
2
2
|
const style = Document.parseHTML(
|
|
3
3
|
`<style>${rules}</style>`,
|
|
4
|
-
{ sanitizer:
|
|
4
|
+
{ sanitizer: { allowElements: ['style', 'html', 'head', 'body'] }}
|
|
5
5
|
);
|
|
6
6
|
|
|
7
7
|
const sheet = style.styleSheets.item(0);
|
|
@@ -73,7 +73,7 @@ if (! (CSSStyleSheet.prototype.replaceSync instanceof Function)) {
|
|
|
73
73
|
CSSStyleSheet.prototype.replaceSync = function replaceSync(rules) {
|
|
74
74
|
const sheet = Document.parseHTML(
|
|
75
75
|
`<style>${rules}</style>`,
|
|
76
|
-
{ sanitizer:
|
|
76
|
+
{ sanitizer: { allowElements: ['style', 'html', 'head', 'body'] }}
|
|
77
77
|
).styleSheets.item(0);
|
|
78
78
|
|
|
79
79
|
clearCSSRules(this);
|
package/JSON.js
CHANGED
package/all.js
CHANGED
|
@@ -1,42 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import './globalThis.js';
|
|
5
|
-
import './string.js';
|
|
6
|
-
import './deprefixer.js';
|
|
7
|
-
import './object.js';
|
|
8
|
-
import './map.js';
|
|
9
|
-
import './array.js';
|
|
10
|
-
import './symbols.js';
|
|
11
|
-
import './function.js';
|
|
12
|
-
import './url.js';
|
|
13
|
-
import './number.js';
|
|
14
|
-
import './iterator.js';
|
|
15
|
-
import './math.js';
|
|
16
|
-
import './secure-context.js';
|
|
17
|
-
import './navigator.js';
|
|
18
|
-
import './performance.js';
|
|
19
|
-
import './abort.js';
|
|
20
|
-
import './errors.js';
|
|
21
|
-
import './match-media.js';
|
|
22
|
-
import './promise.js';
|
|
23
|
-
import './textEncoder.js';
|
|
24
|
-
import './crypto.js';
|
|
25
|
-
import './cookieStore.js';
|
|
26
|
-
import './animation.js';
|
|
27
|
-
import './trustedTypes.js';
|
|
28
|
-
import './Document.js';
|
|
29
|
-
import './ShadowRoot.js';
|
|
30
|
-
import './CSSStyleSheet.js';
|
|
31
|
-
import './element.js';
|
|
32
|
-
import './set.js';
|
|
33
|
-
import './weakMap.js';
|
|
34
|
-
import './window.js';
|
|
35
|
-
import './scheduler.js';
|
|
36
|
-
import './elementInternals.js';
|
|
37
|
-
import './blob.js';
|
|
38
|
-
import './request.js';
|
|
39
|
-
import './response.js';
|
|
40
|
-
import './Record.js';
|
|
41
|
-
import './Tuple.js';
|
|
42
|
-
import './JSON.js';
|
|
1
|
+
import './browser.js';
|
|
2
|
+
|
|
3
|
+
console.warn(new Error('`all.js` and `all.min.js` are deprecated. Please switch to `browser.js`/`browser.min.js'));
|
package/all.min.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*/;const Le="cookieStore"in globalThis,Oe={constructor:Symbol("constructor")};function Pe(){return 0===document.cookie.length?[]:document.cookie.split(";").map((e=>{const[t,r=null]=e.split("=");return{name:decodeURIComponent(t.trim()),value:"string"==typeof r?decodeURIComponent(r.trim()):null,path:void 0,expires:void 0,domain:void 0,sameSite:void 0,secure:void 0,partitioned:!1}}))}function ke({name:e=null,value:t=null}={}){return"string"==typeof e&&(e=decodeURIComponent(e)),"string"==typeof t&&(t=decodeURIComponent(t)),"string"==typeof e&&"string"==typeof t?Pe().filter((r=>r.name===e&&r.value===t)):"string"==typeof e?Pe().filter((t=>t.name===e)):"string"==typeof t?Pe().filter((e=>e.value===t)):Pe()}function Fe({name:e,value:t,expires:r=null,maxAge:n=null,path:o="/",sameSite:i="lax",domain:a=null,secure:s=!1,partitioned:l=!1}){if(Number.isInteger(n))Fe({name:e,value:t,expires:Date.now()+n,path:o,sameSite:i,domain:a,secure:s,partitioned:l});else{let n=`${encodeURIComponent(e)}=`;t&&(n+=encodeURIComponent(t)),Number.isInteger(r)?n+=`;expires=${new Date(r).toUTCString()}`:r instanceof Date&&(n+=`;expires=${r.toUTCString()}`),"string"==typeof o&&(n+=`;path=${o}`),"string"==typeof a&&(n+=`;domain=${a}`),"string"==typeof i&&(n+=`;sameSite=${i}`),!0===s&&(n+=";secure"),!0===l&&(n+=";partitioned"),document.cookie=n}}class Re extends EventTarget{constructor(e){if(e!==Oe.constructor)throw new DOMException("Invalid constructor");super(),Object.defineProperty(this,Oe.onchange,{enumerable:!1,configurable:!1,writable:!0,value:null})}get onchange(){return this[Oe.onchange]}set onchange(e){this[Oe.onchange]instanceof Function&&this.removeEventListener("change",this[Oe.onchange]),e instanceof Function&&this.addEventListener("change",e)}async get(e){const t=await this.getAll(e);return Array.isArray(t)&&0!==t.length?t[0]:null}async getAll(e){return ke("string"==typeof e?{name:e}:e)}async set(...e){if(1===e.length&&"object"==typeof e[0]&&"string"==typeof e[0].name){const t=function({name:e,value:t=null,domain:r=null,path:n="/",expires:o=null,maxAge:i=null,sameSite:a="lax",secure:s=!1,partitioned:l=!1}){return{name:e,value:t,domain:r,path:n,expires:o,maxAge:i,sameSite:a,secure:s,partitioned:l}}(e[0]);Fe(t);const r=new Event("change");r.changed=[t],r.deleted=[],this.dispatchEvent(r)}else{if(2!==e.length)throw new Error("Invalid arguments");this.set({name:e[0],value:e[1]})}}async delete(e={}){if("string"==typeof e)this.delete({name:e});else{if("object"!=typeof e||"string"!=typeof e.name)throw new TypeError("Failed to execute 'delete' on 'CookieStore': required member name is undefined.");{const t=await this.getAll(e);if(0!==t.length){const r=new Event("change");r.changed=[],r.deleted=new Array(t.length),t.forEach(((t,n)=>{t.path=e.path||"/",t.domain=e.domain||null,t.secure=e.secure||null,delete t.value,t.sameSite=e.sameSite||"lax",r.deleted[n]=t,Fe({...t,value:null,expires:1})})),this.dispatchEvent(r)}}}}}const je=new Re(Oe.constructor);if(!Le&&(globalThis.cookieStore=je),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("finished")&&Object.defineProperty(Animation.prototype,"finished",{get:function(){return new Promise(((e,t)=>{"finished"===this.playState?e(this):(this.addEventListener("finish",(()=>e(this)),{once:!0}),this.addEventListener("error",(e=>t(e)),{once:!0}))}))}}),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("ready")&&Object.defineProperty(Animation.prototype,"ready",{get:function(){return new Promise(((e,t)=>{this.pending?(this.addEventListener("ready",(()=>e(this)),{once:!0}),this.addEventListener("error",(e=>t(e)),{once:!0})):e(this)}))}}),"HTMLElement"in globalThis&&!("trustedTypes"in globalThis)){const Ot={key:Symbol("trust:key")},Pt=new Set(Object.keys(HTMLElement.prototype).filter((e=>e.startsWith("on")))),kt=()=>{const e=document.head.querySelector('meta[http-equiv="Content-Security-Policy"][content]');if(e instanceof HTMLMetaElement){const t=e.content.trim().split(";").filter((e=>0!==e.length)).map((e=>e.trim())),r=Object.fromEntries(t.map((e=>{const[t,...r]=e.trim().split(" ").filter((e=>0!==e.length));return[t,r]}))),n=Array.isArray(r["require-trusted-types-for"])&&r["require-trusted-types-for"].includes("'script'"),o=n&&Array.isArray(r["trusted-types"])?new Set(r["trusted-types"]):new Set,i=o.has("'allow-duplicates'");return o.has("'none'")?o.clear():i&&o.delete("'allow-duplicates'"),{enforced:n,allowedPolicies:o,allowDuplicates:i}}if(document.documentElement.dataset.hasOwnProperty("trustedPolicies")){const e=new Set(document.documentElement.dataset.trustedPolicies.split(" ")),t=e.has("'allow-duplicates'"),r=e.has("'none'");return t&&e.delete("'allow-duplicates'"),r&&e.clear(),{enforced:!0,allowedPolicies:e,allowDuplicates:t}}return{enforced:!1,allowedPolicies:new Set,allowDuplicates:!0}};class Ft{#k;#F;#R;#j;constructor({enforced:e,allowedPolicies:t,allowDuplicates:r}={},n){if(n!==Ot.key)throw new TypeError("Invalid constructor of TrustedTypePolicyFactory.");if(!(t instanceof Set))throw new TypeError("`allowedPolicies` must be a Set.");this.#F=t,this.#R=e,this.#j=r,this.#k=new Map}get defaultPolicy(){return this.#k.has("default")?this.#k.get("default"):null}createPolicy(e,{createHTML:t,createScript:r,createScriptURL:n}){if(/^[-#a-zA-Z0-9=_/@.%]+$/.test(e.toString())){if(this.#R&&!this.#F.has(e))throw new TypeError(`${e} is not an allowed policy.`);if(!this.#j&&this.#k.has(e))throw new TypeError(`${e} has already been created and duplicates are not allowed.`);{const o=new Rt(e.toString(),{createHTML:t,createScript:r,createScriptURL:n},Ot.key);return this.#k.set(o.name,o),o}}throw new TypeError(`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy: "${e}" contains invalid characters.`)}getAttributeType(e,t,r){if(e=e.toLowerCase(),t=t.toLowerCase(),"string"==typeof elementNS&&0!==r.length)return Pt.has(t)?"TrustedScript":null;if(Pt.has(t))return"TrustedScript";switch(e){case"script":return"src"===t?"TrustedScriptURL":null;case"iframe":return"srcdoc"===t?"TrustedHTML":"src"===t?"TrustedScriptURL":null;default:return null}}getPropertyType(e,t){if(e=e.toLowerCase(),Pt.has(t.toLowerCase()))return"TrustedScript";switch(e){case"embed":case"iframe":return"src"===t?"TrustedScriptURL":null;case"script":return"src"===t?"TrustedScriptURL":["text","innerText","textContent","innerHTML"].includes(t)?"TrustedScript":["outerHTML"].includes(t)?"TrustedHTML":null;default:return["innerHTML","outerHTML"].includes(t)?"TrustedHTML":null}}isHTML(e){return e instanceof globalThis.TrustedHTML}isScript(e){return e instanceof globalThis.TrustedScript}isScriptURL(e){return e instanceof globalThis.TrustedScriptURL}get emptyHTML(){return new It("",Ot.key)}get emptyScript(){return new Nt("",Ot.key)}get[Symbol.for("polyfilled")](){return!0}get[Symbol.for("enforced")](){return this.#R}}class Rt{#I;#N;#C;#H;#k;constructor(e,{createHTML:t,createScript:r,createScriptURL:n},o){if(o!==Ot.key)throw new Error(`Invalid construction of ${e} policy.`);this.#I=e,this.#N=t,this.#C=r,this.#H=n}get name(){return this.#I}createHTML(e,...t){if(this.#N instanceof Function)return new It(this.#N(e.toString(),...t).toString(),Ot.key);throw new TypeError("This policy does not provide `createHTML()`")}createScript(e,...t){if(this.#C instanceof Function)return new Nt(this.#C(e.toString(),...t).toString(),Ot.key);throw new TypeError("This policy does not provide `createScript()`")}createScriptURL(e,...t){if(this.#H instanceof Function)return new Ct(this.#H(e.toString(),...t).toString(),Ot.key);throw new TypeError("This policy does not provide `createScriptURL()`")}}class jt{#U;constructor(e,t){if(t!==Ot.key)throw new Error("Invalid constructor of TrustedType.");this.#U=e}toString(){return this.#U}toJSON(){return this.#U}}class It extends jt{}class Nt extends jt{}class Ct extends jt{}globalThis.TrustedTypePolicyFactory=Ft,globalThis.trustedTypes=new Ft(kt(),Ot.key),globalThis.TrustedHTML=It,globalThis.TrustedScript=Nt,globalThis.TrustedScriptURL=Ct}
|
|
24
24
|
/**
|
|
25
25
|
* @copyright 2023-2024 Chris Zuber <admin@kernvalley.us>
|
|
26
|
-
*/("HTMLElement"in globalThis&&!("trustedTypes"in globalThis)||"HTMLElement"in globalThis&&globalThis.trustedTypes[Symbol.for("polyfilled")]&&globalThis.trustedTypes[Symbol.for("enforced")])&&function(){function e(){return"trustedTypes"in globalThis}function t(){return e()&&!Object.is(trustedTypes.defaultPolicy,null)}function r(r){if(function(t){return e()&&trustedTypes.isHTML(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createHTML(r);throw new TypeError("Attempting to set HTML and no default policy is available.")}function n(r){if(function(t){return e()&&trustedTypes.isScript(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createScript(r);throw new TypeError("Attempting to create script and no default policy is available.")}function o(r){if(function(t){return e()&&trustedTypes.isScriptURL(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createScriptURL(r);throw new TypeError("Attempting to create script URL and no default policy is available.")}function i(t,r,n){return e()?trustedTypes.getAttributeType(t,r,n):null}try{const{write:e,writeln:t,execCommand:n}=Object.getOwnPropertyDescriptors(Document.prototype);Object.defineProperties(Document.prototype,{write:{value:function(t){e.value.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable,writable:e.writable},writeln:{value:function(e){t.value.call(this,r(e))},enumerable:t.enumerable,configurable:t.configurable,writable:t.writable},execCommand:{value:function(e,t,o){return["insertHTML"].includes(e)?n.value.call(this,e,t,r(o)):n.value.call(this,e,t,o)},enumerable:n.enumerable,configurable:n.configurable}})}catch(e){console.error(e)}if("ServiceWorkerContainer"in globalThis)try{const e=Object.getOwnPropertyDescriptor(ServiceWorkerContainer.prototype,"register");Object.defineProperty(ServiceWorkerContainer.prototype,"register",{value:function(t,r){return e.value.call(this,o(t),r)},enumerable:e.enumerable,configurable:e.configurable})}catch(e){console.error(e)}try{const e=Object.getOwnPropertyDescriptor(Range.prototype,"createContextualFragment");Object.defineProperty(Range.prototype,"createContextualFragment",{value:function(t){return e.value.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable})}catch(e){console.error(e)}try{const{parseFromString:e}=Object.getOwnPropertyDescriptors(DOMParser.prototype);Object.defineProperties(DOMParser.prototype,{parseFromString:{value:function(t,n){return"text/html"===n?e.value.call(this,r(t),n):e.value.call(this,t,n)},enumerable:e.enumerable,configurable:e.configurable,writable:e.writable}})}catch(e){console.error(e)}try{const{src:e,text:t}=Object.getOwnPropertyDescriptors(HTMLScriptElement.prototype);Object.defineProperties(HTMLScriptElement.prototype,{text:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,n(e))},enumerable:t.enumerable,configurable:t.configurable},src:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,o(t))},enumerable:e.enumerable,configurable:e.configurable}})}catch(e){console.error(e)}try{const{setAttribute:e,setAttributeNS:t,innerHTML:a,outerHTML:s,insertAdjacentHTML:l}=Object.getOwnPropertyDescriptors(Element.prototype);Object.defineProperties(Element.prototype,{setAttribute:{value:function(t,a){switch(i(this.tagName,t)){case"TrustedHTML":e.value.call(this,t,r(a));break;case"TrustedScript":e.value.call(this,t,n(a));break;case"TrustedScriptURL":e.value.call(this,t,o(a));break;default:e.value.call(this,t,a)}},enumerable:e.enumerable,configurable:e.configurable},setAttributeNS:{value:function(e,a,s){switch(i(this.tagName,a,e)){case"TrustedHTML":t.value.call(this,e,a,r(s));break;case"TrustedScript":t.value.call(this,e,a,n(s));break;case"TrustedScriptURL":t.value.call(this,e,a,o(s));break;default:t.value.call(this,e,a,s)}},enumerable:t.enumerable,configurable:t.configurable},innerHTML:{get:function(){return a.get.call(this)},set:function(e){a.set.call(this,r(e))},enumerable:a.enumerable,configurable:a.configurable},outerHTML:{get:function(){return s.get.call(this)},set:function(e){s.set.call(this,r(e))},enumerable:s.enumerable,configurable:s.configurable},insertAdjacentHTML:{value:function(e,t){l.value.call(this,e,r(t))},enumerable:l.enumerable,configurable:l.configurable}})}catch(e){console.error(e)}try{const{srcdoc:e,src:t}=Object.getOwnPropertyDescriptors(HTMLIFrameElement.prototype);Object.defineProperties(HTMLIFrameElement.prototype,{srcdoc:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable},src:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,o(e))},enumerable:t.enumerable,configurable:t.configurable}})}catch(e){console.error(e)}try{const{data:e,codeBase:t}=Object.getOwnPropertyDescriptors(HTMLObjectElement.prototype);Object.defineProperties(HTMLObjectElement.prototype,{data:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,o(t))},enumerable:e.enumerable,configurable:e.configurable},codeBase:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,o(e))},enumerable:t.enumerable,configurable:t.configurable}})}catch(e){console.error(e)}try{const{eval:e,setTimeout:t,setInterval:r}=globalThis;globalThis.eval=function(t){return e(n(t).toString())},globalThis.setTimeout=function(e,r,...o){return"string"==typeof e?t(n(e),r,...o):t(e,r,...o)},globalThis.setInterval=function(e,t,...o){return"string"==typeof e?r(n(e),t,...o):r(e,t,...o)};try{const e=globalThis.Function;globalThis.Function=function(...t){if(0===t.length)return e();{const r=n(t.pop());return e(...t,r.toString())}},globalThis.Function.prototype=e.prototype,e.prototype.constructor=globalThis.Function}catch(e){console.error(e)}}catch(e){console.error(e)}}();const Ie={get(){return Array.from(this.styleSheets).filter((e=>e.ownerNode.classList.contains("_adopted")))},set(e){if(!Array.isArray(e))throw new TypeError("Must be an array");{const t=new Set(this.adoptedStyleSheets);t.difference(e).forEach((e=>e.ownerNode.remove()));const r=[...new Set(e).difference(t)].map((e=>{const t=document.createElement("link"),r=new AbortController,n=r.signal,o=URL.createObjectURL(new File([],"adopted.css",{type:"text/css"}));return t.rel="stylesheet",t.href=o,t.classList.add("_adopted"),t.disabled=e.disabled,t.addEventListener("load",(({target:n})=>{r.abort(),t.media=e.media.mediaText,[...e.cssRules].forEach(((e,t)=>{n.sheet.insertRule(e.cssText,t)})),setTimeout((()=>URL.revokeObjectURL(n.href)),100)}),{once:!0,signal:n}),t.addEventListener("error",(({target:e})=>{r.abort(),URL.revokeObjectURL(e.href)}),{once:!0,signal:n}),t}));this instanceof Document?this.head.append(...r):this.append(...r)}}};function Ne(e){if(e instanceof HTMLTemplateElement&&e.parentElement instanceof HTMLElement){e.parentElement.attachShadow({mode:e.getAttribute("shadowrootmode"),clonable:e.hasAttribute("shadowrootclonable"),delegatesFocus:e.hasAttribute("shadowrootdelegatesfocus"),serializable:e.hasAttribute("shadowrootserializable")}).append(e.content),e.remove()}}function Ce(e){const t=(new DOMParser).parseFromString(e,"text/html"),r=document.createDocumentFragment();r.append(...t.body.childNodes),Ne(r.querySelector("template[shadowroootmode]")),this.replaceChildren(r)}function He(e){for(;e.cssRules.length>0;)e.deleteRule(0)}i(Document.prototype,"adoptedStyleSheets",Ie),o(Document,"parseHTMLUnsafe",(function(e){const t=new DOMParser,r=document.implementation.createHTMLDocument(),n=t.parseFromString(e,"text/html");return r.head.append(...n.head.childNodes),r.body.append(...n.body.childNodes),r.querySelectorAll("template[shadowrootmode]").forEach(Ne),r})),"ShadowRoot"in globalThis&&(i(ShadowRoot.prototype,"adoptedStyleSheets",Ie),o(ShadowRoot.prototype,"setHTMLUnsafe",Ce),o(ShadowRoot.prototype,"getHTML",(function({shadowRoots:e,serializableShadowRoots:t=!1}={}){return this.cloneNode(!0).innerHTML})));try{new CSSStyleSheet}catch{const Ht=globalThis.CSSStyleSheet;globalThis.CSSStyleSheet=function({disabled:e=!1,media:t}={}){const r=function(e="",{disabled:t=!1,media:r}={}){const n=Document.parseHTML(`<style>${e}</style>`,{sanitizer:new Sanitizer({allowElements:["style","html","head","body"]})}).styleSheets.item(0);return"string"==typeof r&&n.media.appendMedium(r),n.disabled=t,n}("#dfgbkjdfg{color:red;}",{disabled:e,media:t});return r.deleteRule(0),r},globalThis.CSSStyleSheet.prototype=Ht.prototype,Ht.prototype.constructor=globalThis.CSSStyleSheet}CSSStyleSheet.prototype.replace instanceof Function||(CSSStyleSheet.prototype.replace=function(e){const t=document.createElement("link"),r=new AbortController,{resolve:n,reject:o,promise:i}=Promise.withResolvers();return t.addEventListener("load",(({target:e})=>{He(this),[...e.sheet.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t))),n(this),r.abort(),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:r.signal}),t.addEventListener("error",(({target:e})=>{const t=new DOMException("Error loading stylesheet.");o(t),r.abort(t),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:r.signal}),t.rel="stylesheet",t.crossOrigin="anonymous",t.referrerPolicy="no-referrer",t.media="no-op",t.href=URL.createObjectURL(new File([e],"tmp.css",{type:"text/css"})),document.head.append(t),i}),CSSStyleSheet.prototype.replaceSync instanceof Function||(CSSStyleSheet.prototype.replaceSync=function(e){const t=Document.parseHTML(`<style>${e}</style>`,{sanitizer:new Sanitizer({allowElements:["style","html","head","body"]})}).styleSheets.item(0);He(this),[...t.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t)))});const Ue={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},De="http://www.w3.org/1999/xhtml",$e=new Set(("HTMLElement"in globalThis?Object.keys(HTMLElement.prototype):[]).filter((e=>e.startsWith("on"))));
|
|
26
|
+
*/("HTMLElement"in globalThis&&!("trustedTypes"in globalThis)||"HTMLElement"in globalThis&&globalThis.trustedTypes[Symbol.for("polyfilled")]&&globalThis.trustedTypes[Symbol.for("enforced")])&&function(){function e(){return"trustedTypes"in globalThis}function t(){return e()&&!Object.is(trustedTypes.defaultPolicy,null)}function r(r){if(function(t){return e()&&trustedTypes.isHTML(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createHTML(r);throw new TypeError("Attempting to set HTML and no default policy is available.")}function n(r){if(function(t){return e()&&trustedTypes.isScript(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createScript(r);throw new TypeError("Attempting to create script and no default policy is available.")}function o(r){if(function(t){return e()&&trustedTypes.isScriptURL(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createScriptURL(r);throw new TypeError("Attempting to create script URL and no default policy is available.")}function i(t,r,n){return e()?trustedTypes.getAttributeType(t,r,n):null}try{const{write:e,writeln:t,execCommand:n}=Object.getOwnPropertyDescriptors(Document.prototype);Object.defineProperties(Document.prototype,{write:{value:function(t){e.value.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable,writable:e.writable},writeln:{value:function(e){t.value.call(this,r(e))},enumerable:t.enumerable,configurable:t.configurable,writable:t.writable},execCommand:{value:function(e,t,o){return["insertHTML"].includes(e)?n.value.call(this,e,t,r(o)):n.value.call(this,e,t,o)},enumerable:n.enumerable,configurable:n.configurable}})}catch(e){console.error(e)}if("ServiceWorkerContainer"in globalThis)try{const e=Object.getOwnPropertyDescriptor(ServiceWorkerContainer.prototype,"register");Object.defineProperty(ServiceWorkerContainer.prototype,"register",{value:function(t,r){return e.value.call(this,o(t),r)},enumerable:e.enumerable,configurable:e.configurable})}catch(e){console.error(e)}try{const e=Object.getOwnPropertyDescriptor(Range.prototype,"createContextualFragment");Object.defineProperty(Range.prototype,"createContextualFragment",{value:function(t){return e.value.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable})}catch(e){console.error(e)}try{const{parseFromString:e}=Object.getOwnPropertyDescriptors(DOMParser.prototype);Object.defineProperties(DOMParser.prototype,{parseFromString:{value:function(t,n){return"text/html"===n?e.value.call(this,r(t),n):e.value.call(this,t,n)},enumerable:e.enumerable,configurable:e.configurable,writable:e.writable}})}catch(e){console.error(e)}try{const{src:e,text:t}=Object.getOwnPropertyDescriptors(HTMLScriptElement.prototype);Object.defineProperties(HTMLScriptElement.prototype,{text:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,n(e))},enumerable:t.enumerable,configurable:t.configurable},src:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,o(t))},enumerable:e.enumerable,configurable:e.configurable}})}catch(e){console.error(e)}try{const{setAttribute:e,setAttributeNS:t,innerHTML:a,outerHTML:s,insertAdjacentHTML:l}=Object.getOwnPropertyDescriptors(Element.prototype);Object.defineProperties(Element.prototype,{setAttribute:{value:function(t,a){switch(i(this.tagName,t)){case"TrustedHTML":e.value.call(this,t,r(a));break;case"TrustedScript":e.value.call(this,t,n(a));break;case"TrustedScriptURL":e.value.call(this,t,o(a));break;default:e.value.call(this,t,a)}},enumerable:e.enumerable,configurable:e.configurable},setAttributeNS:{value:function(e,a,s){switch(i(this.tagName,a,e)){case"TrustedHTML":t.value.call(this,e,a,r(s));break;case"TrustedScript":t.value.call(this,e,a,n(s));break;case"TrustedScriptURL":t.value.call(this,e,a,o(s));break;default:t.value.call(this,e,a,s)}},enumerable:t.enumerable,configurable:t.configurable},innerHTML:{get:function(){return a.get.call(this)},set:function(e){a.set.call(this,r(e))},enumerable:a.enumerable,configurable:a.configurable},outerHTML:{get:function(){return s.get.call(this)},set:function(e){s.set.call(this,r(e))},enumerable:s.enumerable,configurable:s.configurable},insertAdjacentHTML:{value:function(e,t){l.value.call(this,e,r(t))},enumerable:l.enumerable,configurable:l.configurable}})}catch(e){console.error(e)}try{const{srcdoc:e,src:t}=Object.getOwnPropertyDescriptors(HTMLIFrameElement.prototype);Object.defineProperties(HTMLIFrameElement.prototype,{srcdoc:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable},src:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,o(e))},enumerable:t.enumerable,configurable:t.configurable}})}catch(e){console.error(e)}try{const{data:e,codeBase:t}=Object.getOwnPropertyDescriptors(HTMLObjectElement.prototype);Object.defineProperties(HTMLObjectElement.prototype,{data:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,o(t))},enumerable:e.enumerable,configurable:e.configurable},codeBase:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,o(e))},enumerable:t.enumerable,configurable:t.configurable}})}catch(e){console.error(e)}try{const{eval:e,setTimeout:t,setInterval:r}=globalThis;globalThis.eval=function(t){return e(n(t).toString())},globalThis.setTimeout=function(e,r,...o){return"string"==typeof e?t(n(e),r,...o):t(e,r,...o)},globalThis.setInterval=function(e,t,...o){return"string"==typeof e?r(n(e),t,...o):r(e,t,...o)};try{const e=globalThis.Function;globalThis.Function=function(...t){if(0===t.length)return e();{const r=n(t.pop());return e(...t,r.toString())}},globalThis.Function.prototype=e.prototype,e.prototype.constructor=globalThis.Function}catch(e){console.error(e)}}catch(e){console.error(e)}}();const Ie={get(){return Array.from(this.styleSheets).filter((e=>e.ownerNode.classList.contains("_adopted")))},set(e){if(!Array.isArray(e))throw new TypeError("Must be an array");{const t=new Set(this.adoptedStyleSheets);t.difference(e).forEach((e=>e.ownerNode.remove()));const r=[...new Set(e).difference(t)].map((e=>{const t=document.createElement("link"),r=new AbortController,n=r.signal,o=URL.createObjectURL(new File([],"adopted.css",{type:"text/css"}));return t.rel="stylesheet",t.href=o,t.classList.add("_adopted"),t.disabled=e.disabled,t.addEventListener("load",(({target:n})=>{r.abort(),t.media=e.media.mediaText,[...e.cssRules].forEach(((e,t)=>{n.sheet.insertRule(e.cssText,t)})),setTimeout((()=>URL.revokeObjectURL(n.href)),100)}),{once:!0,signal:n}),t.addEventListener("error",(({target:e})=>{r.abort(),URL.revokeObjectURL(e.href)}),{once:!0,signal:n}),t}));this instanceof Document?this.head.append(...r):this.append(...r)}}};function Ne(e){if(e instanceof HTMLTemplateElement&&e.parentElement instanceof HTMLElement){e.parentElement.attachShadow({mode:e.getAttribute("shadowrootmode"),clonable:e.hasAttribute("shadowrootclonable"),delegatesFocus:e.hasAttribute("shadowrootdelegatesfocus"),serializable:e.hasAttribute("shadowrootserializable")}).append(e.content),e.remove()}}function Ce(e){const t=(new DOMParser).parseFromString(e,"text/html"),r=document.createDocumentFragment();r.append(...t.body.childNodes),Ne(r.querySelector("template[shadowroootmode]")),this.replaceChildren(r)}function He(e){for(;e.cssRules.length>0;)e.deleteRule(0)}i(Document.prototype,"adoptedStyleSheets",Ie),o(Document,"parseHTMLUnsafe",(function(e){const t=new DOMParser,r=document.implementation.createHTMLDocument(),n=t.parseFromString(e,"text/html");return r.head.append(...n.head.childNodes),r.body.append(...n.body.childNodes),r.querySelectorAll("template[shadowrootmode]").forEach(Ne),r})),"ShadowRoot"in globalThis&&(i(ShadowRoot.prototype,"adoptedStyleSheets",Ie),o(ShadowRoot.prototype,"setHTMLUnsafe",Ce),o(ShadowRoot.prototype,"getHTML",(function({shadowRoots:e,serializableShadowRoots:t=!1}={}){return this.cloneNode(!0).innerHTML})));try{new CSSStyleSheet}catch{const Ht=globalThis.CSSStyleSheet;globalThis.CSSStyleSheet=function({disabled:e=!1,media:t}={}){const r=function(e="",{disabled:t=!1,media:r}={}){const n=Document.parseHTML(`<style>${e}</style>`,{sanitizer:{allowElements:["style","html","head","body"]}}).styleSheets.item(0);return"string"==typeof r&&n.media.appendMedium(r),n.disabled=t,n}("#dfgbkjdfg{color:red;}",{disabled:e,media:t});return r.deleteRule(0),r},globalThis.CSSStyleSheet.prototype=Ht.prototype,Ht.prototype.constructor=globalThis.CSSStyleSheet}CSSStyleSheet.prototype.replace instanceof Function||(CSSStyleSheet.prototype.replace=function(e){const t=document.createElement("link"),r=new AbortController,{resolve:n,reject:o,promise:i}=Promise.withResolvers();return t.addEventListener("load",(({target:e})=>{He(this),[...e.sheet.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t))),n(this),r.abort(),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:r.signal}),t.addEventListener("error",(({target:e})=>{const t=new DOMException("Error loading stylesheet.");o(t),r.abort(t),URL.revokeObjectURL(e.href),e.remove()}),{once:!0,signal:r.signal}),t.rel="stylesheet",t.crossOrigin="anonymous",t.referrerPolicy="no-referrer",t.media="no-op",t.href=URL.createObjectURL(new File([e],"tmp.css",{type:"text/css"})),document.head.append(t),i}),CSSStyleSheet.prototype.replaceSync instanceof Function||(CSSStyleSheet.prototype.replaceSync=function(e){const t=Document.parseHTML(`<style>${e}</style>`,{sanitizer:{allowElements:["style","html","head","body"]}}).styleSheets.item(0);He(this),[...t.cssRules].forEach(((e,t)=>this.insertRule(e.cssText,t)))});const Ue={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},De="http://www.w3.org/1999/xhtml",$e=new Set(("HTMLElement"in globalThis?Object.keys(HTMLElement.prototype):[]).filter((e=>e.startsWith("on"))));
|
|
27
27
|
/**
|
|
28
28
|
* @copyright 2023-2024 Chris Zuber <admin@kernvalley.us>
|
|
29
29
|
*/function qe(e,t=De){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,attributes:o}=e;return Object.freeze({name:r,namespace:"string"==typeof n&&0!==n.length?n:t,attributes:o})}throw new TypeError("Invalid config entry for `elements`.")}function Be({elements:e,allowElements:t},r=De){if(Array.isArray(t))return console.warn("Use of `allowElements` is deprecated. Please use `elements` instead."),Be({elements:t},r);if(Array.isArray(e))return e.map((e=>qe(e,r)));throw new TypeError("`elements` expected to be an array.")}function ze(e,t){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,elements:o,...i}=e;return Object.freeze({name:r,namespace:"string"==typeof n?n:t,elements:o,...i})}throw new TypeError("Invalid entry in `attributes` config.")}function _e({attributes:e,allowAttributes:t},r){if(void 0!==t)return console.warn("Use of `allowAttributes` is deprecated. Please use `attributes` instead."),_e({attributes:t},r);if(Array.isArray(e))return e.map((e=>ze(e,r)));if("object"==typeof e&&null!==e)return console.warn("`attributes` should be an array, not an oobject."),_e({attributes:Object.entries(e).map((([e,t])=>({name:e,elements:t})))},r);throw new TypeError("`attributes` expected to be an array.")}function Ve({comments:e,allowComments:t}){return"boolean"==typeof t?(console.warn("Use of `allowComments` is deprecated. Please use `comments` instead."),t):"boolean"!=typeof e||e}function We({attributes:e,allowAttributes:t},r){return Object.freeze(Object.groupBy(_e({attributes:e,allowAttributes:t},r),(({namespace:e})=>e??"")))}function Ge({elements:e,allowElements:t},r=De){return Object.freeze(Object.groupBy(Be({elements:e,allowElements:t},r),(({namespace:e})=>e)))}const Ke=Object.freeze(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","itemid","itemprop","itemref","itemscope","itemtype","lang","part","popover","slot","spellcheck","tabindex","title","translate","virtualkeyboardpolicy","aria-keyshortcuts","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"].map((e=>ze(e)))),Xe=Object.freeze(["html","head","link","meta","body","address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","search","blockquote","cite","div","dd","dt","dl","figcaption","figure","hr","li","ol","ul","menu","p","pre","a","abbr","b","bdi","bdo","br","code","data","dfn","em","i","kbd","mark","q","rp","ruby","rt","s","del","ins","samp","small","span","strong","sub","sup","time","u","var","wbr","area","audio","img","map","track","video","picture","source","canvas","caption","col","colgroup","table","tbody","tr","td","tfoot","th","thead","button","datalist","option","fieldset","label","form","input","legend","meter","optgroup","select","output","progress","textarea","details","summary","dialog","slot","template","dir","strike","selectmenu","center"].map((e=>qe(e,De)))),Qe=Object.freeze(["abbr","accept","accept-charset","align","alink","allow","allowfullscreen","alt","anchor","archive","as","async","autocomplete","autocorrect","autopictureinpicture","autoplay","axis","background","behavior","border","bordercolor","capture","cellpadding","cellspacing","challenge","char","charoff","charset","checked","cite","classid","clear","code","codetype","color","cols","colspan","compact","content","controls","controlslist","conversiondestination","coords","crossorigin","csp","data","datetime","declare","decoding","default","defer","direction","dirname","disabled","disablepictureinpicture","disableremoteplayback","disallowdocumentaccess","download","elementtiming","enctype","end","for","form","formenctype","formmethod","formnovalidate","formtarget","frameborder","headers","height","high","href","hreflang","hreftranslate","hspace","imagesizes","imagesrcset","importance","impressiondata","impressionexpiry","incremental","integrity","invisible","invoketarget","invokeaction","is","ismap","keytype","kind","label","language","latencyhint","leftmargin","link","list","loading","longdesc","loop","low","lowsrc","manifest","marginheight","marginwidth","max","maxlength","mayscript","media","method","min","minlength","multiple","muted","name","nohref","nomodule","noresize","noshade","novalidate","nowrap","object","open","optimum","pattern","ping","placeholder","playsinline","policy","popovertarget","popovertargetaction","poster","preload","pseudo","readonly","referrerpolicy","rel","reportingorigin","required","resources","rev","reversed","role","rows","rowspan","rules","sandbox","scheme","scope","scopes","scrollamount","scrolldelay","scrolling","select","selected","shadowrootmode","shadowrootdelegatesfocus","shape","size","sizes","span","src","srcdoc","srclang","srcset","standby","start","step","summary","target","text","topmargin","truespeed","trusttoken","type","usemap","valign","value","valuetype","version","vlink","vspace","webkitdirectory","width","wrap"].map((e=>ze(e))).concat(Ke)),Je=Object.freeze({comments:!0,elements:Xe,attributes:Qe,dataAttributes:!0});
|
|
@@ -52,5 +52,5 @@ const mt="user-blocking",yt="user-visible",gt="background";async function bt(e,{
|
|
|
52
52
|
* Additionally, if `internals.states._polyfilled`
|
|
53
53
|
* - Use `._state--*` in addition to `:--*` to query element internals states
|
|
54
54
|
* - This includes `:disabled` -> `._state--disabled` & `:invalid` -> `._state--invalid`
|
|
55
|
-
*/:globalThis.scheduler=new wt;const vt={key:Symbol("key"),internals:Symbol("element-internals"),form:Symbol("form"),fieldset:Symbol("fieldset"),element:Symbol("element"),validity:Symbol("validity"),validationMessage:Symbol("validation-message"),value:Symbol("value"),state:Symbol("state"),formController:Symbol("form-controller"),anchor:Symbol("anchor"),customInputs:Symbol("custom-inputs")};if(!(HTMLElement.prototype.attachInternals instanceof Function)&&"FormDataEvent"in globalThis){const Gt={valueMissing:!1,typeMismatch:!1,patternMismatch:!1,tooLong:!1,tooShort:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,badInput:!1,customError:!1,valid:!0},Kt=e=>e.hasOwnProperty(vt.fieldset)&&e[vt.fieldset]instanceof HTMLFieldSetElement&&e[vt.fieldset].disabled,Xt=e=>e instanceof HTMLElement&&e.tagName.includes("-")&&customElements.get(e.tagName.toLowerCase()).formAssociated,Qt=(e,t)=>function(r){if(r.target.reportValidity()){if(t.willValidate&&r.formData instanceof FormData){const n=t[vt.value];n instanceof FormData?n.entries().forEach((([e,t])=>r.formData.set(e,t))):e.hasAttribute("name")&&r.formData.set(e.getAttribute("name"),t[vt.value])}}else r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation()},Jt=(e,t)=>{Object.entries(t).forEach((([t,r])=>e.style.setProperty(t,r)))},Zt=e=>e.hasAttribute("form")&&document.forms[e.getAttribute("form")]||e.closest("form"),Yt=(e,t,r)=>{if(e instanceof HTMLFormElement){if(!(r instanceof HTMLElement&&r.tagName.includes("-")))throw new TypeError("Not a custom element");if(!(t instanceof rr||t instanceof globalThis.ElementInternals))throw new TypeError("Invalid ElementInternals");if(!Xt(r))throw new TypeError(`${r.tagName} is not form associated.`);if(!(r.formAssociatedCallback instanceof Function))throw new TypeError(`${r.tagName} is missing a formAssociatedCallback method.`);{const n=new AbortController,o=r.closest("fieldset");o instanceof Element&&(r[vt.fieldset]=o,o.hasOwnProperty(vt.customInputs)||(o[vt.customInputs]=new Set),o[vt.customInputs].add(r),er.observe(o,tr)),t[vt.form]=e,t[vt.formController]=n;const{checkValidity:i,reportValidity:a}=e;e.reportValidity=function(){return!!a.call(this)&&t.reportValidity()},e.checkValidity=function(){return!!i.call(this)&&t.checkValidity()},n.signal.addEventListener("abort",(()=>{e.reportValidity=a,e.checkValidity=i}),{once:!0}),e.addEventListener("formdata",Qt(r,t),{signal:n.signal}),e.addEventListener("submit",(e=>{e.target.reportValidity()||(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation())}),{signal:n.signal}),r.formResetCallback instanceof Function&&e.addEventListener("reset",(()=>r.formResetCallback()),{signal:n.signal})}}else if(t[vt.formController]instanceof AbortController&&t[vt.formController].abort(),t[vt.form]=null,t[vt.formController]=null,r.hasOwnProperty(vt.fieldset)){const e=r[vt.fieldset];e.hasOwnProperty(vt.customInputs)&&(e[vt.customInputs].delete(r),0===e[vt.customInputs.size]&&delete e[vt.customInputs]),r[vt.fieldset]=null}},er=new MutationObserver((e=>{e.forEach((({target:t,type:r,attributeName:n})=>{if("attributes"===r&&"disabled"===n){const r=t.hasAttribute("disabled");if(Xt(t)&&t.hasOwnProperty(vt.internals)&&t[vt.internals].states.has("--disabled")!==r&&(1===e.length?!Kt(t):t.hasAttribute("disabled")===Kt(t)&&e.some((e=>e.target.isSameNode(t[vt.fieldset]))))){const e=t[vt.internals];r?e.states.add("--disabled"):e.states.delete("--disabled"),t.formDisabledCallback instanceof Function&&t.formDisabledCallback(r)}else"FIELDSET"!==t.tagName||!t.hasOwnProperty(vt.customInputs)||1!==e.length&&e.some((e=>t[vt.customInputs].has(e.target)))||t[vt.customInputs].forEach((e=>{e.isConnected&&e.hasOwnProperty(vt.internals)?e.hasAttribute("disabled")||(r?e[vt.internals].states.add("--disabled"):e[vt.internals].states.delete("--disabled"),e.formDisabledCallback instanceof Function&&e.formDisabledCallback(r)):t[vt.customInputs].delete(e)}))}}))})),tr={attributes:!0,attributeFilter:["disabled"]};class rr{constructor(e,t){if(t!==vt.key)throw new TypeError("Illegal constructor");if(!(e instanceof HTMLElement))throw new TypeError("Must be called on an HTMLElement");if(!e.tagName.includes("-"))throw new DOMException("Cannot attach internals to a built-in element.");{const t=!0,r=!1,n=!0;Object.defineProperties(this,{[vt.element]:{value:e,configurable:t,enumerable:r,writable:n},[vt.form]:{value:null,configurable:t,enumerable:r,writable:n},[vt.fieldset]:{value:null,configurable:t,enumerable:r,writable:n},[vt.anchor]:{value:null,configurable:t,enumerable:r,writable:n},[vt.validity]:{value:Gt,configurable:t,enumerable:r,writable:n},[vt.validationMessage]:{value:"",configurable:t,enumerable:r,writable:n},[vt.value]:{value:null,configurable:t,enumerable:r,writable:n},[vt.state]:{value:null,configurable:t,enumerable:r,writable:n},[vt.formController]:{value:null,configurable:t,enumerable:r,writable:n}}),Xt(e)&&er.observe(e,tr),Object.defineProperty(e,vt.internals,{value:this,enumerable:!1,configurable:!1,writable:!1}),setTimeout((()=>this.states.add("--element-internals-polyfilled")),10)}}get form(){return this[vt.form]}get labels(){const e=this.form;return e instanceof HTMLFormElement&&0!==this[vt.element].id.length?e.querySelectorAll(`label[for="${this[vt.element].id}"]`):document.createDocumentFragment().childNodes}get _polyfilled(){return!0}get shadowRoot(){return this[vt.element].shadowRoot}get validity(){return Xt(this[vt.element])?this[vt.validity]:void 0}get validationMessage(){return Xt(this[vt.element])?this[vt.validationMessage]||"":void 0}get willValidate(){const e=this[vt.element];return Xt(e)&&!Kt(e)&&!["disabled","readonly"].some((t=>e.hasAttribute(t)))}checkValidity(){if(this.willValidate){if(this.validity.valid){const e=this[vt.element].nextElementSibling;return e instanceof HTMLElement&&e.classList.contains("_element-internals-popup")&&e.remove(),!0}return this[vt.element].dispatchEvent(new Event("invalid")),!1}return!0}reportValidity(){if(this.checkValidity())return!0;{const e=this.validationMessage;if("string"==typeof e&&0!==e.length){const{bottom:t,left:r}=this[vt.element].getBoundingClientRect(),n=document.createElement("div");n.textContent=e,Jt(n,{position:"fixed","background-color":"#2b2a33",color:"#fafafa",top:`${t+2}px`,left:`${r}px`,"z-index":2147483647,"color-scheme":"light-dark","font-family":"system-ui, serif","font-size":"18px",display:"inline-block",padding:"0.6em 0.8em",border:"1px solid #1a1a1a","border-radius":"6px"}),n.classList.add("_element-internals-popup"),this[vt.element].focus();const o=this[vt.element].nextElementSibling;o instanceof Element&&o.classList.contains("_element-internals-popup")&&o.remove(),this[vt.element].insertAdjacentElement("afterend",n),this[vt.anchor]instanceof Element&&this[vt.anchor].focus(),setTimeout((()=>{n.isConnected&&n.remove()}),3e3)}return!1}}setFormValue(e,t){if(!Xt(this[vt.element]))throw new DOMException("Not form associated");this[vt.value]=e,this[vt.state]=t}setValidity({valueMissing:e=!1,typeMismatch:t=!1,patternMismatch:r=!1,tooLong:n=!1,tooShort:o=!1,rangeUnderflow:i=!1,rangeOverflow:a=!1,stepMismatch:s=!1,badInput:l=!1,customError:c=!1},u="",p){if(!Xt(this[vt.element]))throw new DOMException("Not form associated");if(("string"!=typeof u||0===u.length)&&(e||t||r||n||o||i||a||s||l||c))throw new DOMException("Message required if any flags are true.");{const h=[e,t,r,n,o,i,a,s,l,c].every((e=>!1===e));this[vt.validity]={valueMissing:e,typeMismatch:t,patternMismatch:r,tooLong:n,tooShort:o,rangeUnderflow:i,rangeOverflow:a,stepMismatch:s,badInput:l,customError:c,valid:h},this[vt.validationMessage]=u,this[vt.anchor]=p,h?(this.states.delete("--invalid"),this.states.add("--valid")):(this.states.add("--invalid"),this.states.delete("--valid"),this[vt.element].dispatchEvent(new Event("invalid")))}}_associateForm(e,t){Yt(e,this,t)}_findAssociatedForm(e){return Zt(e)}}HTMLElement.prototype.attachInternals=function(){if(this.hasOwnProperty(vt.internals))throw new DOMException("Invalid operation");if(this.tagName.includes("-"))return new rr(this,vt.key);throw new DOMException("Cannot call attachInternals on built-in elements.")},globalThis.ElementInternals=rr}if("ElementInternals"in globalThis&&!("CustomStateSet"in globalThis)){const nr="_state",or=new WeakMap,ir=e=>{if(e.toString().startsWith("--"))return`${nr}${e}`;throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value '${e}' must start with '--'.`)},{value:ar,writable:sr,configurable:lr,enumerable:cr}=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"attachInternals");class ur{constructor(e,t){if(t!==vt.key)throw new TypeError("Illegal Constructor");if(!(e instanceof HTMLElement))throw new TypeError("el must be an HTMLElement");or.set(this,e),this.add("--custom-states-polyfilled")}get _polyfilled(){return!0}get size(){return[...this.values()].length}add(e){or.get(this).classList.add(ir(e))}has(e){return or.get(this).classList.contains(ir(e))}delete(e){const t=ir(e);return!!or.get(this).classList.contains(t)&&(or.get(this).classList.remove(t),!0)}clear(){this.values().forEach((e=>this.delete(e)))}keys(){return this.values()}values(){return or.get(this).classList.values().filter((e=>e.startsWith(`${nr}--`))).map((e=>e.substr(nr.length)))}entries(){return this.values().map((e=>[e,e]))}forEach(e,t){this.values().forEach((r=>e.call(t||this,r,r,this)))}[Symbol.toStringTag](){return"CustomStateSet"}[Symbol.iterator](){return this.values()}}Object.defineProperty(HTMLElement.prototype,"attachInternals",{value:function(){const e=ar.call(this);return Object.defineProperty(e,vt.element,{value:this,enumerable:!1,writable:!1,configurable:!1}),Object.defineProperty(e,"states",{value:new ur(this,vt.key),configurable:!0,enumberable:!0}),Object.is(e.shadowRoot,null)&&!Object.is(this.shadowRoot,null)&&Object.defineProperty(e,"shadowRoot",{value:this.shadowRoot,configurable:!0,enumerable:!0}),e},writable:sr,configurable:lr,enumerable:cr}),globalThis.CustomStateSet=ur,function(e){const t=Object.fromEntries(Object.keys(Ue).map((e=>[e,{get:function(){return this[vt.element][e]},set:function(t){this[vt.element][e]=t},enumerable:!0,configurable:!0}])));Object.defineProperties(e,t)}(ElementInternals.prototype)}if(o(Blob.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),o(Request.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),o(Response,"json",((e,{status:t=200,statusText:r="",headers:n=new Headers}={})=>n instanceof Headers?(n.set("Content-Type","application/json"),new Response(JSON.stringify(e),{status:t,statusText:r,headers:n})):Response.json(e,{status:t,statusText:r,headers:new Headers(n)}))),o(Response,"redirect",((e,t=302)=>new Response(null,{status:t,headers:new Headers({Location:e})}))),o(Response.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),!(globalThis.Record instanceof Function)){function pr(e){if(new.target===pr)throw new TypeError("Record is not a constructor");const t=Object.create(pr.prototype);return Object.defineProperties(t,Object.fromEntries(Object.entries(e).map((([e,t])=>[e,{enumerable:!0,configurable:!1,writable:!1,value:t}])))),Object.freeze(t),t}pr.prototype.constructor=pr,Object.defineProperty(pr.prototype,Symbol.toStringTag,{value:"Record",enumerable:!0,configurable:!1,writable:!1}),pr.fromEntries=function(e){return pr(Object.fromEntries(e))},globalThis.Record=pr}if(!(globalThis.Tuple instanceof Function)){const hr=e=>{const t=Array.apply(Object.create(fr.prototype),e);return Object.setPrototypeOf(t,fr.prototype),t};function fr(...e){if(new.target===fr)throw new TypeError("Tuple is not a constructor");const t=hr(e);return Object.freeze(t),t}fr.prototype.forEach=function(e,t){Array.prototype.forEach.call(this,e,t)},fr.prototype.join=function(e=","){return Array.prototype.join.call(this,e)},fr.prototype.concat=function(...e){return fr(...this,...e)},fr.prototype.slice=function(e,t){return fr.from(Array.prototype.slice.call(this,e,t))},fr.prototype.indexOf=function(e,t){return Array.prototype.indexOf.call(this,e,t)},fr.prototype.lastIndexOf=function(e,t){return Array.prototype.lastIndexOf.call(this,e,t)},fr.prototype.findIndex=function(e,t){return Array.prototype.findIndex.call(this,e,t)},fr.prototype.find=function(e,t){return Array.prototype.find.call(this,e,t)},fr.prototype.findLast=function(e,t){return Array.prototype.findLast.call(this,e,t)},fr.prototype.findLastIndex=function(e,t){return Array.prototype.findLastIndex.call(this,e,t)},fr.prototype.every=function(e,t){return Array.prototype.every.call(this,e,t)},fr.prototype.some=function(e,t){return Array.prototype.some.call(this,e,t)},fr.prototype.includes=function(e,t){return Array.prototype.includes.call(this,e,t)},fr.prototype.map=function(e,t){return fr.from(Array.prototype.map.call(this,e,t))},fr.prototype.filter=function(e,t){return fr.from(Array.prototype.filter.call(this,e,t))},fr.prototype.flat=function(e){return fr.from(Array.prototype.flat.call(this,e))},fr.prototype.flatMap=function(e,t){return fr.from(Array.prototype.flatMap.call(this,e,t))},fr.prototype.at=function(e){return Array.prototype.at.call(this,e)},fr.prototype.reduce=function(e,t){return fr.from(Array.prototype.reduce.call(this,e,t))},fr.prototype.reduceRight=function(e,t){return fr.from(Array.prototype.reduceRight.call(this,e,t))},fr.prototype.toSorted=function(e){return fr.from(Array.prototype.toSorted.call(this,e))},fr.prototype.toSpliced=function(e,t,...r){return fr.from(Array.prototype.toSpliced.call(this,e,t,...r))},fr.prototype.toReversed=function(){return fr.from(Array.prototype.toReversed.apply(this))},fr.prototype.with=function(e,t){return fr.from(Array.prototype.with.call(this,e,t))},fr.prototype.toLocaleString=function(e,t){return Array.prototype.toLocaleString.call(this,e,t)},fr.prototype.toJSON=function(){return[...this]},fr.prototype.keys=function(){return Array.prototype.keys.apply(this)},fr.prototype.values=function(){return Array.prototype.values.apply(this)},fr.prototype.entries=function(){return Array.prototype.entries.apply(this)},fr.prototype[Symbol.iterator]=function(){return Array.prototype[Symbol.iterator].apply(this)},fr.from=function(e,t,r){const n=hr([]);return Array.prototype.push.apply(n,Array.from(e,t,r)),Object.freeze(n),n},fr.of=function(...e){return fr.from(e)},Object.defineProperties(fr.prototype,{length:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"length").get.apply(this)},enumerable:!0,configurable:!1},lastItem:{get:function(){return this[this.lastIndex]},enumerable:!0,configurable:!1},lastIndex:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"lastIndex").get.apply(this)},enumerable:!0,configurable:!1},[Symbol.toStringTag]:{value:"Tuple",enumerable:!0,configurable:!1,writable:!1}}),globalThis.Tuple=fr}if(!(JSON.parseImmutable instanceof Function)){function dr(e){return"object"==typeof e?null===e?null:Array.isArray(e)?Tuple.from(e.map((e=>dr(e)))):Record.fromEntries(Object.entries(e).map((([e,t])=>[e,dr(t)]))):e}JSON.parseImmutable=function(e){return JSON.parse(e,((e,t)=>dr(t)))}}}();
|
|
55
|
+
*/:globalThis.scheduler=new wt;const vt={key:Symbol("key"),internals:Symbol("element-internals"),form:Symbol("form"),fieldset:Symbol("fieldset"),element:Symbol("element"),validity:Symbol("validity"),validationMessage:Symbol("validation-message"),value:Symbol("value"),state:Symbol("state"),formController:Symbol("form-controller"),anchor:Symbol("anchor"),customInputs:Symbol("custom-inputs")};if(!(HTMLElement.prototype.attachInternals instanceof Function)&&"FormDataEvent"in globalThis){const Gt={valueMissing:!1,typeMismatch:!1,patternMismatch:!1,tooLong:!1,tooShort:!1,rangeUnderflow:!1,rangeOverflow:!1,stepMismatch:!1,badInput:!1,customError:!1,valid:!0},Kt=e=>e.hasOwnProperty(vt.fieldset)&&e[vt.fieldset]instanceof HTMLFieldSetElement&&e[vt.fieldset].disabled,Xt=e=>e instanceof HTMLElement&&e.tagName.includes("-")&&customElements.get(e.tagName.toLowerCase()).formAssociated,Qt=(e,t)=>function(r){if(r.target.reportValidity()){if(t.willValidate&&r.formData instanceof FormData){const n=t[vt.value];n instanceof FormData?n.entries().forEach((([e,t])=>r.formData.set(e,t))):e.hasAttribute("name")&&r.formData.set(e.getAttribute("name"),t[vt.value])}}else r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation()},Jt=(e,t)=>{Object.entries(t).forEach((([t,r])=>e.style.setProperty(t,r)))},Zt=e=>e.hasAttribute("form")&&document.forms[e.getAttribute("form")]||e.closest("form"),Yt=(e,t,r)=>{if(e instanceof HTMLFormElement){if(!(r instanceof HTMLElement&&r.tagName.includes("-")))throw new TypeError("Not a custom element");if(!(t instanceof rr||t instanceof globalThis.ElementInternals))throw new TypeError("Invalid ElementInternals");if(!Xt(r))throw new TypeError(`${r.tagName} is not form associated.`);if(!(r.formAssociatedCallback instanceof Function))throw new TypeError(`${r.tagName} is missing a formAssociatedCallback method.`);{const n=new AbortController,o=r.closest("fieldset");o instanceof Element&&(r[vt.fieldset]=o,o.hasOwnProperty(vt.customInputs)||(o[vt.customInputs]=new Set),o[vt.customInputs].add(r),er.observe(o,tr)),t[vt.form]=e,t[vt.formController]=n;const{checkValidity:i,reportValidity:a}=e;e.reportValidity=function(){return!!a.call(this)&&t.reportValidity()},e.checkValidity=function(){return!!i.call(this)&&t.checkValidity()},n.signal.addEventListener("abort",(()=>{e.reportValidity=a,e.checkValidity=i}),{once:!0}),e.addEventListener("formdata",Qt(r,t),{signal:n.signal}),e.addEventListener("submit",(e=>{e.target.reportValidity()||(e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation())}),{signal:n.signal}),r.formResetCallback instanceof Function&&e.addEventListener("reset",(()=>r.formResetCallback()),{signal:n.signal})}}else if(t[vt.formController]instanceof AbortController&&t[vt.formController].abort(),t[vt.form]=null,t[vt.formController]=null,r.hasOwnProperty(vt.fieldset)){const e=r[vt.fieldset];e.hasOwnProperty(vt.customInputs)&&(e[vt.customInputs].delete(r),0===e[vt.customInputs.size]&&delete e[vt.customInputs]),r[vt.fieldset]=null}},er=new MutationObserver((e=>{e.forEach((({target:t,type:r,attributeName:n})=>{if("attributes"===r&&"disabled"===n){const r=t.hasAttribute("disabled");if(Xt(t)&&t.hasOwnProperty(vt.internals)&&t[vt.internals].states.has("--disabled")!==r&&(1===e.length?!Kt(t):t.hasAttribute("disabled")===Kt(t)&&e.some((e=>e.target.isSameNode(t[vt.fieldset]))))){const e=t[vt.internals];r?e.states.add("--disabled"):e.states.delete("--disabled"),t.formDisabledCallback instanceof Function&&t.formDisabledCallback(r)}else"FIELDSET"!==t.tagName||!t.hasOwnProperty(vt.customInputs)||1!==e.length&&e.some((e=>t[vt.customInputs].has(e.target)))||t[vt.customInputs].forEach((e=>{e.isConnected&&e.hasOwnProperty(vt.internals)?e.hasAttribute("disabled")||(r?e[vt.internals].states.add("--disabled"):e[vt.internals].states.delete("--disabled"),e.formDisabledCallback instanceof Function&&e.formDisabledCallback(r)):t[vt.customInputs].delete(e)}))}}))})),tr={attributes:!0,attributeFilter:["disabled"]};class rr{constructor(e,t){if(t!==vt.key)throw new TypeError("Illegal constructor");if(!(e instanceof HTMLElement))throw new TypeError("Must be called on an HTMLElement");if(!e.tagName.includes("-"))throw new DOMException("Cannot attach internals to a built-in element.");{const t=!0,r=!1,n=!0;Object.defineProperties(this,{[vt.element]:{value:e,configurable:t,enumerable:r,writable:n},[vt.form]:{value:null,configurable:t,enumerable:r,writable:n},[vt.fieldset]:{value:null,configurable:t,enumerable:r,writable:n},[vt.anchor]:{value:null,configurable:t,enumerable:r,writable:n},[vt.validity]:{value:Gt,configurable:t,enumerable:r,writable:n},[vt.validationMessage]:{value:"",configurable:t,enumerable:r,writable:n},[vt.value]:{value:null,configurable:t,enumerable:r,writable:n},[vt.state]:{value:null,configurable:t,enumerable:r,writable:n},[vt.formController]:{value:null,configurable:t,enumerable:r,writable:n}}),Xt(e)&&er.observe(e,tr),Object.defineProperty(e,vt.internals,{value:this,enumerable:!1,configurable:!1,writable:!1}),setTimeout((()=>this.states.add("--element-internals-polyfilled")),10)}}get form(){return this[vt.form]}get labels(){const e=this.form;return e instanceof HTMLFormElement&&0!==this[vt.element].id.length?e.querySelectorAll(`label[for="${this[vt.element].id}"]`):document.createDocumentFragment().childNodes}get _polyfilled(){return!0}get shadowRoot(){return this[vt.element].shadowRoot}get validity(){return Xt(this[vt.element])?this[vt.validity]:void 0}get validationMessage(){return Xt(this[vt.element])?this[vt.validationMessage]||"":void 0}get willValidate(){const e=this[vt.element];return Xt(e)&&!Kt(e)&&!["disabled","readonly"].some((t=>e.hasAttribute(t)))}checkValidity(){if(this.willValidate){if(this.validity.valid){const e=this[vt.element].nextElementSibling;return e instanceof HTMLElement&&e.classList.contains("_element-internals-popup")&&e.remove(),!0}return this[vt.element].dispatchEvent(new Event("invalid")),!1}return!0}reportValidity(){if(this.checkValidity())return!0;{const e=this.validationMessage;if("string"==typeof e&&0!==e.length){const{bottom:t,left:r}=this[vt.element].getBoundingClientRect(),n=document.createElement("div");n.textContent=e,Jt(n,{position:"fixed","background-color":"#2b2a33",color:"#fafafa",top:`${t+2}px`,left:`${r}px`,"z-index":2147483647,"color-scheme":"light-dark","font-family":"system-ui, serif","font-size":"18px",display:"inline-block",padding:"0.6em 0.8em",border:"1px solid #1a1a1a","border-radius":"6px"}),n.classList.add("_element-internals-popup"),this[vt.element].focus();const o=this[vt.element].nextElementSibling;o instanceof Element&&o.classList.contains("_element-internals-popup")&&o.remove(),this[vt.element].insertAdjacentElement("afterend",n),this[vt.anchor]instanceof Element&&this[vt.anchor].focus(),setTimeout((()=>{n.isConnected&&n.remove()}),3e3)}return!1}}setFormValue(e,t){if(!Xt(this[vt.element]))throw new DOMException("Not form associated");this[vt.value]=e,this[vt.state]=t}setValidity({valueMissing:e=!1,typeMismatch:t=!1,patternMismatch:r=!1,tooLong:n=!1,tooShort:o=!1,rangeUnderflow:i=!1,rangeOverflow:a=!1,stepMismatch:s=!1,badInput:l=!1,customError:c=!1},u="",p){if(!Xt(this[vt.element]))throw new DOMException("Not form associated");if(("string"!=typeof u||0===u.length)&&(e||t||r||n||o||i||a||s||l||c))throw new DOMException("Message required if any flags are true.");{const h=[e,t,r,n,o,i,a,s,l,c].every((e=>!1===e));this[vt.validity]={valueMissing:e,typeMismatch:t,patternMismatch:r,tooLong:n,tooShort:o,rangeUnderflow:i,rangeOverflow:a,stepMismatch:s,badInput:l,customError:c,valid:h},this[vt.validationMessage]=u,this[vt.anchor]=p,h?(this.states.delete("--invalid"),this.states.add("--valid")):(this.states.add("--invalid"),this.states.delete("--valid"),this[vt.element].dispatchEvent(new Event("invalid")))}}_associateForm(e,t){Yt(e,this,t)}_findAssociatedForm(e){return Zt(e)}}HTMLElement.prototype.attachInternals=function(){if(this.hasOwnProperty(vt.internals))throw new DOMException("Invalid operation");if(this.tagName.includes("-"))return new rr(this,vt.key);throw new DOMException("Cannot call attachInternals on built-in elements.")},globalThis.ElementInternals=rr}if("ElementInternals"in globalThis&&!("CustomStateSet"in globalThis)){const nr="_state",or=new WeakMap,ir=e=>{if(e.toString().startsWith("--"))return`${nr}${e}`;throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value '${e}' must start with '--'.`)},{value:ar,writable:sr,configurable:lr,enumerable:cr}=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"attachInternals");class ur{constructor(e,t){if(t!==vt.key)throw new TypeError("Illegal Constructor");if(!(e instanceof HTMLElement))throw new TypeError("el must be an HTMLElement");or.set(this,e),this.add("--custom-states-polyfilled")}get _polyfilled(){return!0}get size(){return[...this.values()].length}add(e){or.get(this).classList.add(ir(e))}has(e){return or.get(this).classList.contains(ir(e))}delete(e){const t=ir(e);return!!or.get(this).classList.contains(t)&&(or.get(this).classList.remove(t),!0)}clear(){this.values().forEach((e=>this.delete(e)))}keys(){return this.values()}values(){return or.get(this).classList.values().filter((e=>e.startsWith(`${nr}--`))).map((e=>e.substr(nr.length)))}entries(){return this.values().map((e=>[e,e]))}forEach(e,t){this.values().forEach((r=>e.call(t||this,r,r,this)))}[Symbol.toStringTag](){return"CustomStateSet"}[Symbol.iterator](){return this.values()}}Object.defineProperty(HTMLElement.prototype,"attachInternals",{value:function(){const e=ar.call(this);return Object.defineProperty(e,vt.element,{value:this,enumerable:!1,writable:!1,configurable:!1}),Object.defineProperty(e,"states",{value:new ur(this,vt.key),configurable:!0,enumberable:!0}),Object.is(e.shadowRoot,null)&&!Object.is(this.shadowRoot,null)&&Object.defineProperty(e,"shadowRoot",{value:this.shadowRoot,configurable:!0,enumerable:!0}),e},writable:sr,configurable:lr,enumerable:cr}),globalThis.CustomStateSet=ur,function(e){const t=Object.fromEntries(Object.keys(Ue).map((e=>[e,{get:function(){return this[vt.element][e]},set:function(t){this[vt.element][e]=t},enumerable:!0,configurable:!0}])));Object.defineProperties(e,t)}(ElementInternals.prototype)}if(o(Blob.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),o(Request.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),o(Response,"json",((e,{status:t=200,statusText:r="",headers:n=new Headers}={})=>n instanceof Headers?(n.set("Content-Type","application/json"),new Response(JSON.stringify(e),{status:t,statusText:r,headers:n})):Response.json(e,{status:t,statusText:r,headers:new Headers(n)}))),o(Response,"redirect",((e,t=302)=>new Response(null,{status:t,headers:new Headers({Location:e})}))),o(Response.prototype,"bytes",(async function(){return new Uint8Array(await this.arrayBuffer())})),!(globalThis.Record instanceof Function)){function pr(e){if(new.target===pr)throw new TypeError("Record is not a constructor");const t=Object.create(pr.prototype);return Object.defineProperties(t,Object.fromEntries(Object.entries(e).map((([e,t])=>[e,{enumerable:!0,configurable:!1,writable:!1,value:t}])))),Object.freeze(t),t}pr.prototype.constructor=pr,Object.defineProperty(pr.prototype,Symbol.toStringTag,{value:"Record",enumerable:!0,configurable:!1,writable:!1}),pr.fromEntries=function(e){return pr(Object.fromEntries(e))},globalThis.Record=pr}if(!(globalThis.Tuple instanceof Function)){const hr=e=>{const t=Array.apply(Object.create(fr.prototype),e);return Object.setPrototypeOf(t,fr.prototype),t};function fr(...e){if(new.target===fr)throw new TypeError("Tuple is not a constructor");const t=hr(e);return Object.freeze(t),t}fr.prototype.forEach=function(e,t){Array.prototype.forEach.call(this,e,t)},fr.prototype.join=function(e=","){return Array.prototype.join.call(this,e)},fr.prototype.concat=function(...e){return fr(...this,...e)},fr.prototype.slice=function(e,t){return fr.from(Array.prototype.slice.call(this,e,t))},fr.prototype.indexOf=function(e,t){return Array.prototype.indexOf.call(this,e,t)},fr.prototype.lastIndexOf=function(e,t){return Array.prototype.lastIndexOf.call(this,e,t)},fr.prototype.findIndex=function(e,t){return Array.prototype.findIndex.call(this,e,t)},fr.prototype.find=function(e,t){return Array.prototype.find.call(this,e,t)},fr.prototype.findLast=function(e,t){return Array.prototype.findLast.call(this,e,t)},fr.prototype.findLastIndex=function(e,t){return Array.prototype.findLastIndex.call(this,e,t)},fr.prototype.every=function(e,t){return Array.prototype.every.call(this,e,t)},fr.prototype.some=function(e,t){return Array.prototype.some.call(this,e,t)},fr.prototype.includes=function(e,t){return Array.prototype.includes.call(this,e,t)},fr.prototype.map=function(e,t){return fr.from(Array.prototype.map.call(this,e,t))},fr.prototype.filter=function(e,t){return fr.from(Array.prototype.filter.call(this,e,t))},fr.prototype.flat=function(e){return fr.from(Array.prototype.flat.call(this,e))},fr.prototype.flatMap=function(e,t){return fr.from(Array.prototype.flatMap.call(this,e,t))},fr.prototype.at=function(e){return Array.prototype.at.call(this,e)},fr.prototype.reduce=function(e,t){return fr.from(Array.prototype.reduce.call(this,e,t))},fr.prototype.reduceRight=function(e,t){return fr.from(Array.prototype.reduceRight.call(this,e,t))},fr.prototype.toSorted=function(e){return fr.from(Array.prototype.toSorted.call(this,e))},fr.prototype.toSpliced=function(e,t,...r){return fr.from(Array.prototype.toSpliced.call(this,e,t,...r))},fr.prototype.toReversed=function(){return fr.from(Array.prototype.toReversed.apply(this))},fr.prototype.with=function(e,t){return fr.from(Array.prototype.with.call(this,e,t))},fr.prototype.toLocaleString=function(e,t){return Array.prototype.toLocaleString.call(this,e,t)},fr.prototype.toJSON=function(){return[...this]},fr.prototype.keys=function(){return Array.prototype.keys.apply(this)},fr.prototype.values=function(){return Array.prototype.values.apply(this)},fr.prototype.entries=function(){return Array.prototype.entries.apply(this)},fr.prototype[Symbol.iterator]=function(){return Array.prototype[Symbol.iterator].apply(this)},fr.from=function(e,t,r){const n=hr([]);return Array.prototype.push.apply(n,Array.from(e,t,r)),Object.freeze(n),n},fr.of=function(...e){return fr.from(e)},Object.defineProperties(fr.prototype,{length:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"length").get.apply(this)},enumerable:!0,configurable:!1},lastItem:{get:function(){return this[this.lastIndex]},enumerable:!0,configurable:!1},lastIndex:{get:function(){return Object.getOwnPropertyDescriptor(Array.prototype,"lastIndex").get.apply(this)},enumerable:!0,configurable:!1},[Symbol.toStringTag]:{value:"Tuple",enumerable:!0,configurable:!1,writable:!1}}),globalThis.Tuple=fr}if(!(JSON.parseImmutable instanceof Function)){function dr(e){return"object"==typeof e?null===e?null:Array.isArray(e)?Tuple.from(e.map((e=>dr(e)))):Record.fromEntries(Object.entries(e).map((([e,t])=>[e,dr(t)]))):e}JSON.parseImmutable=function(e){return JSON.parse(e,((e,t)=>dr(t)))}}if(!(RegExp.escape instanceof Function)){const mr=/[-[\]/{}()<>=#&!@%*+?.\\^$|;:"'`\s]/g;RegExp.escape=function(e){return e.toString().replace(mr,"\\$&")}}}();
|
|
56
56
|
//# sourceMappingURL=all.min.js.map
|