@shgysk8zer0/polyfills 0.2.6 → 0.2.7
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 +5 -0
- package/all.min.js +5 -5
- package/all.min.js.map +1 -1
- package/array.js +23 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [v0.2.7] - 2023-11-26
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Add `Array.prototype.lastIndex` and `Array.prototype.lastItem`
|
|
13
|
+
|
|
9
14
|
## [v0.2.6]- 2023-10-29
|
|
10
15
|
|
|
11
16
|
### Added
|
package/all.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(){"use strict";function e(e,t,n,{writable:o=!0,enumerable:r=!0,configurable:i=!0}={}){e[t]instanceof Function||Object.defineProperty(e,t,{value:n,writable:o,enumerable:r,configurable:i})}function t(e,t,{get:n,set:o,enumerable:r=!0,configurable:i=!0}={}){e.hasOwnProperty(t)||Object.defineProperty(e,t,{get:n,set:o,enumerable:r,configurable:i})}var n;!function(){"undefined"==typeof globalThis&&("undefined"!=typeof window?Object.defineProperty(Window.prototype,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:window}):"undefined"!=typeof global?Object.defineProperty(global,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:global}):"undefined"!=typeof self?Object.defineProperty(self,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:self}):Object.defineProperty(this,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:this}))}(),!("crypto"in window)&&"msCrypto"in window&&(globalThis.crypto=globalThis.msCrypto),"Notification"in window||(globalThis.Notification=globalThis.notifications||globalThis.webkitNotifications||globalThis.oNotifications||globalThis.msNotifications||!1),"doNotTrack"in navigator||(navigator.doNotTrack=globalThis.doNotTrack||navigator.msDoNotTrack||"unspecified"),"indexedDB"in window||(globalThis.indexedDB=globalThis.indexedDB||globalThis.mozIndexedDB||globalThis.webkitIndexedDB||globalThis.msIndexedDB||!1),"hidden"in document||(document.hidden=document.webkitHidden||document.msHidden||document.mozHidden||!1),"visibilityState"in document||(document.visibilityState=document.webkitVisibilityState||document.msVisibilityState||document.mozVisibilityState||"visible"),"fullscreenElement"in document||(document.fullscreenElement=document.mozFullScreenElement||document.webkitFullscreenElement||!1),"requestAnimationFrame"in window||(globalThis.requestAnimationFrame=globalThis.mozRequestAnimationFrame||globalThis.webkitRequestAnimationFrame||globalThis.msRequestAnimationFrame||!1),"exitFullscreen"in Document.prototype||(Document.prototype.exitFullscreen=document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msCancelFullScreen||!1),"requestFullscreen"in HTMLElement.prototype||(HTMLElement.prototype.requestFullscreen=HTMLElement.prototype.requestFullScreen||HTMLElement.prototype.mozRequestFullScreen||HTMLElement.prototype.webkitRequestFullScreen||!1),"fullscreen"in Document.prototype||Object.defineProperty(Document.prototype,"fullscreen",{get:()=>document.fullscreenElement instanceof Element}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){return Array.from(e).reduce(((e,n,o)=>{const r=t.call(e,n,o);return e.hasOwnProperty(r)?e[r].push(n):e[r]=[n],e}),{})}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(e,{insert:t,update:n}={}){const o=this.has(e);if(o&&n instanceof Function){const t=this.get(e),o=n.call(this,t,e,this);return o!==t&&this.set(e,o),o}if(o)return this.get(e);if(t instanceof Function){const n=t.call(this,e,this);return this.set(e,n),n}throw new Error("Key is not found and no `insert()` given")}),Map.groupBy instanceof Function||(Map.groupBy=function(e,t){return Array.from(e).reduce(((e,n,o)=>(e.emplace(t.call(e,n,o),{insert:()=>[n],update:e=>(e.push(n),e)}),e)),new Map)}),function(){const e=[Array,String,globalThis.Int8Array,globalThis.Uint8Array,globalThis.Uint8ClampedArray,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.Float32Array,globalThis.Float64Array,globalThis.BigInt64Array,globalThis.BigUint64Array];if(Array.prototype.flat instanceof Function||(Array.prototype.flat=function(e=1){const t=[];e=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,e));const n=(e,o)=>{Array.isArray(e)&&o>=0?e.forEach((e=>n(e,o-1))):t.push(e)};return n(this,Number.isNaN(e)?0:e),t}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(e,t){return this.map(e,t).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(e,t){let n;return this.forEach(((o,r,i)=>{e.call(t,o,r,i)&&(n=o)}),t),n}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(e,t){let n=-1;return this.forEach(((o,r,i)=>{e.call(t,o,r,i)&&(n=r)}),t),n}),!(Array.prototype.at instanceof Function)){const t=function(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]};for(const n of e)void 0!==n&&Object.defineProperty(n.prototype,"at",{value:t,writable:!0,enumerable:!1,configurable:!0})}!(Array.prototype.group instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.group=function(e){return console.warn("`Array.group()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupBy instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.groupBy=function(e){return console.warn("`Array.goupBy()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupToMap instanceof Function)&&Map.groupBy instanceof Function&&(Array.prototype.groupToMap=function(e){return console.warn("`Array.groupToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Map.groupBy instanceof Function&&(Array.prototype.groupByToMap=function(e){return console.warn("`Array.groupByToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(e,t,n=globalThis){let o=[];for await(const t of e)o.push(await t);return Array.from(o,t,n)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(e){return this===e||!!Array.isArray(e)&&(this.length===e.length&&this.every(((t,n)=>{const o=e[n];return Array.isArray(t)?Array.isArray(o)&&t.equals(o):Object.is(t,o)})))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(e){if(void 0===e)return[...new Set(this)];if("string"==typeof e){const t=[];return this.filter((n=>{const o=n[e];return!t.includes(o)&&(t.push(o),!0)}))}if(e instanceof Function){const t=[];return this.filter(((...n)=>{try{const o=e.apply(this,n);return"string"==typeof o&&(!t.includes(o)&&(t.push(o),!0))}catch(e){return!1}}))}throw new TypeError("Not a valid argument for uniqueBy")}),Array.prototype.toReversed instanceof Function||(Array.prototype.toReversed=function(){return[...this].reverse()}),Array.prototype.toSorted instanceof Function||(Array.prototype.toSorted=function(e){return[...this].sort(e)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(e,t,...n){const o=[...this];return o.splice(e,t,...n),o}),Array.prototype.with instanceof Function||(Array.prototype.with=function(e,t){const n=[...this];return n[e]=t,n})}(),"Symbol"in globalThis&&(void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator"))),function(){if(!(Function.prototype.once instanceof Function)){const e=new WeakMap;Function.prototype.once=function(t){const n=this;return function(...o){if(e.has(n))return e.get(n);if("AsyncFunction"===n.constructor.name){const r=n.apply(t||n,o).catch((t=>{throw e.delete(n),t}));return e.set(n,r),r}if(n instanceof Function){const r=n.apply(t||n,o);return e.set(n,r),r}}}}}(),e(URL,"canParse",((e,t)=>{try{return new URL(e,t),!0}catch{return!1}})),Number.range instanceof Function||(Number.range=function(e,t,n=1){return console.warn("`Number.range()` is deprecated. Use `Iterator.range()` instead."),globalThis.Iterator.range(e,t,{step:n})}),function(){"Iterator"in globalThis||(globalThis.Iterator={prototype:Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))});const e=globalThis.Iterator;e.range instanceof Function||(e.range=function*(t,n,o){if("number"==typeof o||"bigint"==typeof o)for(const r of e.range(t,n,{step:o}))yield r;else if("object"!=typeof o||Object.is(o,null))for(const o of e.range(t,n,{}))yield o;else{const{step:e=("number"==typeof t?t<n?1:-1:t<n?1n:-1n),inclusive:r=!1}=o;if("number"!=typeof t&&"bigint"!=typeof t)throw new TypeError("Start must be a number");if(Number.isNaN(t))throw new RangeError("Invalid start");if("number"!=typeof n&&"bigint"!=typeof n)throw new TypeError("End must be a number");if(Number.isNaN(n))throw new RangeError("Invalid end");if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("Step must be a number");if(Number.isNaN(e))throw new RangeError("Invalid step");if(0===e)throw new RangeError("Step must not be 0");if(e<0&&t<n||e>0&&t>n)return;if(r)if(e>0)for(let o=t;o<=n;o+=e)yield o;else for(let o=t;o>=n;o+=e)yield o;else if(e>0)for(let o=t;o<n;o+=e)yield o;else for(let o=t;o>n;o+=e)yield o}}),e.prototype[Symbol.toStringTag]||(e.prototype[Symbol.toStringTag]="Iterator"),e.prototype.take instanceof Function||(e.prototype.take=function*(e){let t=0;for(const n of this){if(++t>e)break;yield n}}),e.prototype.drop instanceof Function||(e.prototype.drop=function*(e){let t=0;for(const n of this)t++>=e&&(yield n)}),e.prototype.toArray instanceof Function||(e.prototype.toArray=function(){return Array.from(this)}),e.prototype.forEach instanceof Function||(e.prototype.forEach=function(e){for(const t of this)e(t)}),e.prototype.map instanceof Function||(e.prototype.map=function*(e){for(const t of this)yield e(t)}),e.prototype.reduce instanceof Function||(e.prototype.reduce=function(e,t){let n=void 0===t?this.next().value:t;for(const t of this)n=e(n,t);return n}),e.prototype.filter instanceof Function||(e.prototype.filter=function*(e){for(const t of this)e(t)&&(yield t)}),e.prototype.some instanceof Function||(e.prototype.some=function(e){let t=!1;for(const n of this)if(e(n)){t=!0;break}return t}),e.prototype.every instanceof Function||(e.prototype.every=function(e){let t=!0;for(const n of this)if(!e(n)){t=!1;break}return t}),e.prototype.find instanceof Function||(e.prototype.find=function(e){for(const t of this)if(e(t))return t}),e.prototype.indexed instanceof Function||(e.prototype.indexed=function*(){let e=0;for(const t of this)yield[e++,t]})}(),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=e=>e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=e=>(e>0)-(e<0)||+e),Math.hasOwnProperty("trunc")||(Math.trunc=e=>{const t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t}),Math.hasOwnProperty("expm1")||(Math.expm1=e=>Math.exp(e)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...e)=>Math.sqrt(e.reduce(((e,t)=>e+t**2),0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=e=>e**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=e=>Math.log(e)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=e=>Math.log(e)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=e=>Math.log(1+e)),Math.hasOwnProperty("fround")||(Math.fround=(n=new Float32Array(1),function(e){return n[0]=e,n[0]})),Math.clamp instanceof Function||(Math.clamp=function(e,t,n){return Math.min(Math.max(e,t),n)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),function(){if(!("isSecureContext"in globalThis)){const e=["localhost","127.0.0.1"],t="https:",n=[t,"file:","wss:"],o=(e=globalThis.document)=>[...e.scripts].every((({src:n})=>{if(0===n.length)return!0;{const{protocol:o,hostname:r}=new URL(n,e.baseURI);return o===t||r===location.hostname}}));Object.defineProperty(globalThis,"isSecureContext",{enumerable:!0,configurable:!0,get:function(){return window.parent===window&&(!(!n.includes(location.protocol)&&!e.includes(location.hostname))&&o())}})}}();const o=new WeakMap;function r(e){return e instanceof Function&&"AsyncFunction"===e.constructor.name}function i(e){return"object"==typeof e&&!Object.is(e,null)&&!Array.isArray(e)}function a(e){switch(typeof e){case"undefined":return"Undefined";case"function":return"prototype"in e?a(e.prototype):"constructor"in e?e.constructor.name:"Function";case"object":return Object.is(e,null)?"Null":"constructor"in e?e.constructor.name:Symbol.toStringTag in e?e[Symbol.toStringTag]:"prototype"in e?a(e.prototype):(console.log(e),"Unknown Object");case"string":return"String";case"number":return Number.isNaN(e)?"NaN":"Number";case"bigint":return"BigInt";case"boolean":return"Boolean";case"symbol":return"Symbol";default:return"Unknown"}}function s(e,t){return e.once instanceof Function?e.once(t):function(...n){if(o.has(e))return o.get(e);if(r(e)){const r=e.apply(t||this,n).catch((t=>{throw o.delete(e),t}));return o.set(e,r),r}if(e instanceof Function){const r=e.apply(t||this,n);return o.set(e,r),r}}}
|
|
1
|
+
!function(){"use strict";function e(e,t,n,{writable:o=!0,enumerable:r=!0,configurable:i=!0}={}){e[t]instanceof Function||Object.defineProperty(e,t,{value:n,writable:o,enumerable:r,configurable:i})}function t(e,t,{get:n,set:o,enumerable:r=!0,configurable:i=!0}={}){e.hasOwnProperty(t)||Object.defineProperty(e,t,{get:n,set:o,enumerable:r,configurable:i})}var n;!function(){"undefined"==typeof globalThis&&("undefined"!=typeof window?Object.defineProperty(Window.prototype,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:window}):"undefined"!=typeof global?Object.defineProperty(global,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:global}):"undefined"!=typeof self?Object.defineProperty(self,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:self}):Object.defineProperty(this,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:this}))}(),!("crypto"in window)&&"msCrypto"in window&&(globalThis.crypto=globalThis.msCrypto),"Notification"in window||(globalThis.Notification=globalThis.notifications||globalThis.webkitNotifications||globalThis.oNotifications||globalThis.msNotifications||!1),"doNotTrack"in navigator||(navigator.doNotTrack=globalThis.doNotTrack||navigator.msDoNotTrack||"unspecified"),"indexedDB"in window||(globalThis.indexedDB=globalThis.indexedDB||globalThis.mozIndexedDB||globalThis.webkitIndexedDB||globalThis.msIndexedDB||!1),"hidden"in document||(document.hidden=document.webkitHidden||document.msHidden||document.mozHidden||!1),"visibilityState"in document||(document.visibilityState=document.webkitVisibilityState||document.msVisibilityState||document.mozVisibilityState||"visible"),"fullscreenElement"in document||(document.fullscreenElement=document.mozFullScreenElement||document.webkitFullscreenElement||!1),"requestAnimationFrame"in window||(globalThis.requestAnimationFrame=globalThis.mozRequestAnimationFrame||globalThis.webkitRequestAnimationFrame||globalThis.msRequestAnimationFrame||!1),"exitFullscreen"in Document.prototype||(Document.prototype.exitFullscreen=document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msCancelFullScreen||!1),"requestFullscreen"in HTMLElement.prototype||(HTMLElement.prototype.requestFullscreen=HTMLElement.prototype.requestFullScreen||HTMLElement.prototype.mozRequestFullScreen||HTMLElement.prototype.webkitRequestFullScreen||!1),"fullscreen"in Document.prototype||Object.defineProperty(Document.prototype,"fullscreen",{get:()=>document.fullscreenElement instanceof Element}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){return Array.from(e).reduce(((e,n,o)=>{const r=t.call(e,n,o);return e.hasOwnProperty(r)?e[r].push(n):e[r]=[n],e}),{})}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(e,{insert:t,update:n}={}){const o=this.has(e);if(o&&n instanceof Function){const t=this.get(e),o=n.call(this,t,e,this);return o!==t&&this.set(e,o),o}if(o)return this.get(e);if(t instanceof Function){const n=t.call(this,e,this);return this.set(e,n),n}throw new Error("Key is not found and no `insert()` given")}),Map.groupBy instanceof Function||(Map.groupBy=function(e,t){return Array.from(e).reduce(((e,n,o)=>(e.emplace(t.call(e,n,o),{insert:()=>[n],update:e=>(e.push(n),e)}),e)),new Map)}),function(){const e=[Array,String,globalThis.Int8Array,globalThis.Uint8Array,globalThis.Uint8ClampedArray,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.Float32Array,globalThis.Float64Array,globalThis.BigInt64Array,globalThis.BigUint64Array];if(Array.prototype.flat instanceof Function||(Array.prototype.flat=function(e=1){const t=[];e=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,e));const n=(e,o)=>{Array.isArray(e)&&o>=0?e.forEach((e=>n(e,o-1))):t.push(e)};return n(this,Number.isNaN(e)?0:e),t}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(e,t){return this.map(e,t).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(e,t){let n;return this.forEach(((o,r,i)=>{e.call(t,o,r,i)&&(n=o)}),t),n}),"lastIndex"in Array.prototype||Object.defineProperty(Array.prototype,"lastIndex",{enumerable:!1,configurable:!1,get:function(){return Math.max(0,this.length-1)}}),"lastItem"in Array.prototype||Object.defineProperty(Array.prototype,"lastItem",{enumerable:!1,configurable:!1,get:function(){return this[this.lastIndex]},set:function(e){this[this.lastIndex]=e}}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(e,t){let n=-1;return this.forEach(((o,r,i)=>{e.call(t,o,r,i)&&(n=r)}),t),n}),!(Array.prototype.at instanceof Function)){const t=function(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]};for(const n of e)void 0!==n&&Object.defineProperty(n.prototype,"at",{value:t,writable:!0,enumerable:!1,configurable:!0})}!(Array.prototype.group instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.group=function(e){return console.warn("`Array.group()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupBy instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.groupBy=function(e){return console.warn("`Array.goupBy()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupToMap instanceof Function)&&Map.groupBy instanceof Function&&(Array.prototype.groupToMap=function(e){return console.warn("`Array.groupToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Map.groupBy instanceof Function&&(Array.prototype.groupByToMap=function(e){return console.warn("`Array.groupByToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(e,t,n=globalThis){let o=[];for await(const t of e)o.push(await t);return Array.from(o,t,n)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(e){return this===e||!!Array.isArray(e)&&(this.length===e.length&&this.every(((t,n)=>{const o=e[n];return Array.isArray(t)?Array.isArray(o)&&t.equals(o):Object.is(t,o)})))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(e){if(void 0===e)return[...new Set(this)];if("string"==typeof e){const t=[];return this.filter((n=>{const o=n[e];return!t.includes(o)&&(t.push(o),!0)}))}if(e instanceof Function){const t=[];return this.filter(((...n)=>{try{const o=e.apply(this,n);return"string"==typeof o&&(!t.includes(o)&&(t.push(o),!0))}catch(e){return!1}}))}throw new TypeError("Not a valid argument for uniqueBy")}),Array.prototype.toReversed instanceof Function||(Array.prototype.toReversed=function(){return[...this].reverse()}),Array.prototype.toSorted instanceof Function||(Array.prototype.toSorted=function(e){return[...this].sort(e)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(e,t,...n){const o=[...this];return o.splice(e,t,...n),o}),Array.prototype.with instanceof Function||(Array.prototype.with=function(e,t){const n=[...this];return n[e]=t,n})}(),"Symbol"in globalThis&&(void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator"))),function(){if(!(Function.prototype.once instanceof Function)){const e=new WeakMap;Function.prototype.once=function(t){const n=this;return function(...o){if(e.has(n))return e.get(n);if("AsyncFunction"===n.constructor.name){const r=n.apply(t||n,o).catch((t=>{throw e.delete(n),t}));return e.set(n,r),r}if(n instanceof Function){const r=n.apply(t||n,o);return e.set(n,r),r}}}}}(),e(URL,"canParse",((e,t)=>{try{return new URL(e,t),!0}catch{return!1}})),Number.range instanceof Function||(Number.range=function(e,t,n=1){return console.warn("`Number.range()` is deprecated. Use `Iterator.range()` instead."),globalThis.Iterator.range(e,t,{step:n})}),function(){"Iterator"in globalThis||(globalThis.Iterator={prototype:Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))});const e=globalThis.Iterator;e.range instanceof Function||(e.range=function*(t,n,o){if("number"==typeof o||"bigint"==typeof o)for(const r of e.range(t,n,{step:o}))yield r;else if("object"!=typeof o||Object.is(o,null))for(const o of e.range(t,n,{}))yield o;else{const{step:e=("number"==typeof t?t<n?1:-1:t<n?1n:-1n),inclusive:r=!1}=o;if("number"!=typeof t&&"bigint"!=typeof t)throw new TypeError("Start must be a number");if(Number.isNaN(t))throw new RangeError("Invalid start");if("number"!=typeof n&&"bigint"!=typeof n)throw new TypeError("End must be a number");if(Number.isNaN(n))throw new RangeError("Invalid end");if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("Step must be a number");if(Number.isNaN(e))throw new RangeError("Invalid step");if(0===e)throw new RangeError("Step must not be 0");if(e<0&&t<n||e>0&&t>n)return;if(r)if(e>0)for(let o=t;o<=n;o+=e)yield o;else for(let o=t;o>=n;o+=e)yield o;else if(e>0)for(let o=t;o<n;o+=e)yield o;else for(let o=t;o>n;o+=e)yield o}}),e.prototype[Symbol.toStringTag]||(e.prototype[Symbol.toStringTag]="Iterator"),e.prototype.take instanceof Function||(e.prototype.take=function*(e){let t=0;for(const n of this){if(++t>e)break;yield n}}),e.prototype.drop instanceof Function||(e.prototype.drop=function*(e){let t=0;for(const n of this)t++>=e&&(yield n)}),e.prototype.toArray instanceof Function||(e.prototype.toArray=function(){return Array.from(this)}),e.prototype.forEach instanceof Function||(e.prototype.forEach=function(e){for(const t of this)e(t)}),e.prototype.map instanceof Function||(e.prototype.map=function*(e){for(const t of this)yield e(t)}),e.prototype.reduce instanceof Function||(e.prototype.reduce=function(e,t){let n=void 0===t?this.next().value:t;for(const t of this)n=e(n,t);return n}),e.prototype.filter instanceof Function||(e.prototype.filter=function*(e){for(const t of this)e(t)&&(yield t)}),e.prototype.some instanceof Function||(e.prototype.some=function(e){let t=!1;for(const n of this)if(e(n)){t=!0;break}return t}),e.prototype.every instanceof Function||(e.prototype.every=function(e){let t=!0;for(const n of this)if(!e(n)){t=!1;break}return t}),e.prototype.find instanceof Function||(e.prototype.find=function(e){for(const t of this)if(e(t))return t}),e.prototype.indexed instanceof Function||(e.prototype.indexed=function*(){let e=0;for(const t of this)yield[e++,t]})}(),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=e=>e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=e=>(e>0)-(e<0)||+e),Math.hasOwnProperty("trunc")||(Math.trunc=e=>{const t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t}),Math.hasOwnProperty("expm1")||(Math.expm1=e=>Math.exp(e)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...e)=>Math.sqrt(e.reduce(((e,t)=>e+t**2),0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=e=>e**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=e=>Math.log(e)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=e=>Math.log(e)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=e=>Math.log(1+e)),Math.hasOwnProperty("fround")||(Math.fround=(n=new Float32Array(1),function(e){return n[0]=e,n[0]})),Math.clamp instanceof Function||(Math.clamp=function(e,t,n){return Math.min(Math.max(e,t),n)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),function(){if(!("isSecureContext"in globalThis)){const e=["localhost","127.0.0.1"],t="https:",n=[t,"file:","wss:"],o=(e=globalThis.document)=>[...e.scripts].every((({src:n})=>{if(0===n.length)return!0;{const{protocol:o,hostname:r}=new URL(n,e.baseURI);return o===t||r===location.hostname}}));Object.defineProperty(globalThis,"isSecureContext",{enumerable:!0,configurable:!0,get:function(){return window.parent===window&&(!(!n.includes(location.protocol)&&!e.includes(location.hostname))&&o())}})}}();const o=new WeakMap;function r(e){return e instanceof Function&&"AsyncFunction"===e.constructor.name}function i(e){return"object"==typeof e&&!Object.is(e,null)&&!Array.isArray(e)}function a(e){switch(typeof e){case"undefined":return"Undefined";case"function":return"prototype"in e?a(e.prototype):"constructor"in e?e.constructor.name:"Function";case"object":return Object.is(e,null)?"Null":"constructor"in e?e.constructor.name:Symbol.toStringTag in e?e[Symbol.toStringTag]:"prototype"in e?a(e.prototype):(console.log(e),"Unknown Object");case"string":return"String";case"number":return Number.isNaN(e)?"NaN":"Number";case"bigint":return"BigInt";case"boolean":return"Boolean";case"symbol":return"Symbol";default:return"Unknown"}}function s(e,t){return e.once instanceof Function?e.once(t):function(...n){if(o.has(e))return o.get(e);if(r(e)){const r=e.apply(t||this,n).catch((t=>{throw o.delete(e),t}));return o.set(e,r),r}if(e instanceof Function){const r=e.apply(t||this,n);return o.set(e,r),r}}}
|
|
2
2
|
/**
|
|
3
3
|
* @copyright 2023 Chris Zuber <admin@kernvalley.us>
|
|
4
4
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Lock
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
/**
|
|
25
25
|
* @copyright 2023 Chris Zuber <admin@kernvalley.us>
|
|
26
26
|
*/
|
|
27
|
-
function
|
|
27
|
+
function j(){return"trustedTypes"in globalThis&&trustedTypes instanceof EventTarget&&trustedTypes.createPolicy instanceof Function}!O&&(globalThis.cookieStore=R),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)}))}});
|
|
28
28
|
/**
|
|
29
29
|
* @copyright 2023 Chris Zuber <admin@kernvalley.us>
|
|
30
30
|
*/
|
|
31
|
-
const
|
|
31
|
+
const H=Object.keys(Object.getOwnPropertyDescriptors(HTMLElement.prototype)).filter((e=>e.startsWith("on"))),U=["action","cite","formaction","href","ping","src"],q=s((async function(){const{ok:e,headers:t}=await fetch(location.href,{method:"HEAD"});if(e&&t.has("Content-Security-Policy")){const e=t.get("Content-Security-Policy").trim().split(";").filter((e=>0!==e.length));return Object.fromEntries(e.map((e=>{const[t,...n]=e.trim().split(" ").filter((e=>0!==e.length));return[t,n]})))}}));function z(){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));return Object.fromEntries(t.map((e=>{const[t,...n]=e.trim().split(" ").filter((e=>0!==e.length));return[t,n]})))}return{}}
|
|
32
32
|
/**
|
|
33
33
|
* @copyright 2023 Chris Zuber <admin@kernvalley.us>
|
|
34
|
-
*/const B="1"===document.documentElement.dataset.fetchTrustCsp;function $({"trusted-types":e=null}={}){if(Array.isArray(e)){const t=new Set(e),n=t.has("'allow-duplicates'"),o=t.has("'none'");return n&&t.delete("'allow-duplicates'"),o&&t.clear(),t.add("empty#html"),t.add("empty#script"),{policies:t,allowDuplicates:n,hasNone:o}}return{}}const{allowDuplicates:_,allowedPolicies:V}=function(){const e=$(z());if("object"==typeof e&&e.policies instanceof Set){const{policies:t,allowDuplicates:n}=e;return{allowDuplicates:n,allowedPolicies:t}}{const e=(()=>{const e=$(z());return"object"==typeof e&&"allowDuplicates"in e?e.allowDuplicates:"1"===document.documentElement.dataset.allowTrustDuplicates})(),t=(()=>{if(document.documentElement.dataset.hasOwnProperty("trustedPolicies"))return new Set(["empty#html","empty#script",...document.documentElement.dataset.trustedPolicies.split(" ")]);{const{policies:e}=$(z());return e instanceof Set?e:new Set(["empty#html","empty#script"])}})();return t.has("'none'")&&t.clear(),t.add("empty#html"),t.add("empty#script"),{allowDuplicates:e,allowedPolicies:t}}}();
|
|
34
|
+
*/const B="1"===document.documentElement.dataset.fetchTrustCsp;function $({"trusted-types":e=null}={}){if(Array.isArray(e)){const t=new Set(e),n=t.has("'allow-duplicates'"),o=t.has("'none'");return n&&t.delete("'allow-duplicates'"),o&&t.clear(),t.add("empty#html"),t.add("empty#script"),{policies:t,allowDuplicates:n,hasNone:o}}return{}}const{allowDuplicates:_,allowedPolicies:V}=function(){const e=$(z());if("object"==typeof e&&e.policies instanceof Set){const{policies:t,allowDuplicates:n}=e;return{allowDuplicates:n,allowedPolicies:t}}{const e=(()=>{const e=$(z());return"object"==typeof e&&"allowDuplicates"in e?e.allowDuplicates:"1"===document.documentElement.dataset.allowTrustDuplicates})(),t=(()=>{if(document.documentElement.dataset.hasOwnProperty("trustedPolicies"))return new Set(["empty#html","empty#script",...document.documentElement.dataset.trustedPolicies.split(" ")]);{const{policies:e}=$(z());return e instanceof Set?e:new Set(["empty#html","empty#script"])}})();return t.has("'none'")&&t.clear(),t.add("empty#html"),t.add("empty#script"),{allowDuplicates:e,allowedPolicies:t}}}();j();const W={trustedValue:Symbol("[[Data]]"),trustedKey:Symbol("trusted-key"),emptyHTML:Symbol("policy-empty#html"),emptyScript:Symbol("policy-empty#script"),policy:Symbol.for("trust-policy"),defaultPolicy:Symbol("default-policy"),trustedTypesCSP:Symbol("trusted-types-csp")};Symbol.hasOwnProperty("toStringTag")||(Symbol.toStringTag=Symbol("Symbol.toStringTag"));const G=[];function K(e){return null!==function(e){return G.find((t=>t.name===e))||null}(e)}function Q(e,t){return function(){throw new TypeError(`Failed to execute '${t}' on 'TrustedTypePolicy': Policy ${e.name}'s TrustedTypePolicyOptions did not specify a '${t}' member.`)}}class X{constructor(e,{key:t,policy:n}){if(t!==W.trustedKey)throw new TypeError("Invalid constructor");Object.defineProperties(this,{[W.trustedValue]:{enumerable:!1,configurable:!1,writable:!1,value:e.toString()},[W.policy]:{enumerable:!1,configurable:!1,writable:!1,value:n.name}}),Object.freeze(this)}toString(){return this.valueOf()}toJSON(){return this.valueOf()}valueOf(){return this[W.trustedValue]}}class J extends X{[Symbol.toStringTag](){return"TrustedHTML"}}class Z extends X{[Symbol.toStringTag](){return"TrustedScript"}}class Y extends X{[Symbol.toStringTag](){return"TrustedScriptURL"}}class ee{constructor(e,{createHTML:t,createScript:n,createScriptURL:o}={},{key:r}){if(r!==W.trustedKey)throw new TypeError("Invalid constructor");Object.defineProperties(this,{name:{enumerable:!0,configurable:!1,writable:!1,value:e.toString()},createHTML:{enumerable:!0,configurable:!1,writable:!1,value:t instanceof Function?(e,...n)=>new J(t(e.toString(),...n),{key:W.trustedKey,policy:this}):Q(this,"createHTML")},createScript:{enumerable:!0,configurable:!1,writable:!1,value:n instanceof Function?(e,...t)=>new Z(n(e.toString(),...t),{key:W.trustedKey,policy:this}):Q(this,"createScript")},createScriptURL:{enumerable:!0,configurable:!1,writable:!1,value:o instanceof Function?(e,...t)=>new Y(o(e.toString(),...t),{key:W.trustedKey,policy:this}):Q(this,"createScriptURL")}})}}class te extends EventTarget{constructor(e){if(super(),e!==W.trustedKey)throw new TypeError("Invalid constructor");B&&async function(){const{policies:e,allowDuplicates:t=!1,hasNone:n=!1}=await q().then($);return e instanceof Set?{policies:e,allowDuplicates:t,hasNone:n}:{}}().then((({policies:e,allowDuplicates:t=!1,hasNone:n=!1})=>{void 0!==e&&Object.defineProperty(te,W.trustedTypesCSP,{value:{policies:e,allowDuplicates:t,hasNone:n},enumberable:!1,writable:!1,configurable:!1})})).catch((e=>console.error(e))),Object.defineProperties(this,{[W.defaultPolicy]:{enumerable:!1,configurable:!1,writable:!0,value:null},[W.emptyHTML]:{enumerable:!1,configurable:!1,writable:!1,value:this.createPolicy("empty#html",{createHTML:()=>""})},[W.emptyScript]:{enumerable:!1,configurable:!1,writable:!1,value:this.createPolicy("empty#script",{createScript:()=>""})}})}isHTML(e){return e instanceof globalThis.TrustedHTML}isScript(e){return e instanceof globalThis.TrustedScript}isScriptURL(e){return e instanceof globalThis.TrustedScriptURL}createPolicy(e,{createHTML:t,createScript:n,createScriptURL:o}={}){const r=new ee(e,{createHTML:t,createScript:n,createScriptURL:o},{key:W.trustedKey});if(!e.toString().match(/^[-#a-zA-Z0-9=_/@.%]+$/g))throw new TypeError(`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy: "${e}" contains invalid characters.`);if(te.hasOwnProperty(W.trustedTypesCSP)){const{policies:t,allowDuplicates:n,hasNone:o}=te[W.trustedTypesCSP];if(o&&"empty#html"!==e&&"empty#script"!==e)throw new TypeError(`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy: "${e}" disallowed.`);if(!t.has(e))throw new TypeError(`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy: "${e}" disallowed.`);if(!n&&K(e))throw new TypeError(`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy: "${e}" already exists.`)}else{if(V.size>2&&!V.has(e))throw new TypeError(`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy: "${e}" disallowed.`);if(!_&&K(e))throw new TypeError(`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy: "${e}" already exists.`)}return"default"===r.name&&(this[W.defaultPolicy]=r),G.push(r),r}getAttributeType(e,t,n){if(e=e.toLowerCase(),t=t.toLowerCase(),"string"==typeof elementNS&&0!==n.length)return H.includes(t)?"TrustedScript":null;if(H.includes(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(),H.includes(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}}get emptyHTML(){return this[W.emptyHTML].createHTML("")}get emptyScript(){return this[W.emptyScript].createScript("")}get defaultPolicy(){return this[W.defaultPolicy]}get _isPolyfill_(){return!0}static get allowDuplicates(){return _}}const ne=new te(W.trustedKey);!function(){if("TrustedTypePolicyFactory"in globalThis||(globalThis.TrustedTypePolicyFactory=te),"TrustedTypePolicy"in globalThis||(globalThis.TrustedTypePolicy=ee),"TrustedType"in globalThis||(globalThis.TrustedType=X),"TrustedHTML"in globalThis||(globalThis.TrustedHTML=J),"TrustedScript"in globalThis||(globalThis.TrustedScript=Z),"TrustedScriptURL"in globalThis||(globalThis.TrustedScriptURL=Y),"trustedTypes"in globalThis)try{globalThis.trustedTypes.createPolicy("empty#html",{createHTML:()=>""}),globalThis.trustedTypes.createPolicy("empty#script",{createScript:()=>""})}catch(e){console.error(e)}else globalThis.trustedTypes=ne}();
|
|
35
35
|
/**
|
|
36
36
|
* @copyright 2023 Chris Zuber <admin@kernvalley.us>
|
|
37
37
|
* @see https://wicg.github.io/sanitizer-api/#default-configuration-dictionary
|
|
38
38
|
*/
|
|
39
|
-
const oe=JSON.parse('{\n "allowCustomElements": false,\n "allowUnknownMarkup": false,\n "allowElements": [\n "a",\n "abbr",\n "acronym",\n "address",\n "area",\n "article",\n "aside",\n "audio",\n "b",\n "bdi",\n "bdo",\n "bgsound",\n "big",\n "blockquote",\n "body",\n "br",\n "button",\n "canvas",\n "caption",\n "center",\n "cite",\n "code",\n "col",\n "colgroup",\n "datalist",\n "dd",\n "del",\n "details",\n "dfn",\n "dialog",\n "dir",\n "div",\n "dl",\n "dt",\n "em",\n "fieldset",\n "figcaption",\n "figure",\n "font",\n "footer",\n "form",\n "h1",\n "h2",\n "h3",\n "h4",\n "h5",\n "h6",\n "head",\n "header",\n "hgroup",\n "hr",\n "html",\n "i",\n "img",\n "input",\n "ins",\n "kbd",\n "keygen",\n "label",\n "layer",\n "legend",\n "li",\n "link",\n "listing",\n "main",\n "map",\n "mark",\n "marquee",\n "menu",\n "meta",\n "meter",\n "nav",\n "nobr",\n "ol",\n "optgroup",\n "option",\n "output",\n "p",\n "picture",\n "popup",\n "pre",\n "progress",\n "q",\n "rb",\n "rp",\n "rt",\n "rtc",\n "ruby",\n "s",\n "samp",\n "section",\n "select",\n "selectmenu",\n "small",\n "source",\n "span",\n "strike",\n "strong",\n "style",\n "sub",\n "summary",\n "sup",\n "table",\n "tbody",\n "td",\n "tfoot",\n "th",\n "thead",\n "time",\n "tr",\n "track",\n "tt",\n "u",\n "ul",\n "var",\n "video",\n "wbr"\n ],\n "allowAttributes": {\n "abbr": [\n "*"\n ],\n "accept": [\n "*"\n ],\n "accept-charset": [\n "*"\n ],\n "accesskey": [\n "*"\n ],\n "action": [\n "*"\n ],\n "align": [\n "*"\n ],\n "alink": [\n "*"\n ],\n "allow": [\n "*"\n ],\n "allowfullscreen": [\n "*"\n ],\n "alt": [\n "*"\n ],\n "anchor": [\n "*"\n ],\n "archive": [\n "*"\n ],\n "as": [\n "*"\n ],\n "async": [\n "*"\n ],\n "autocapitalize": [\n "*"\n ],\n "autocomplete": [\n "*"\n ],\n "autocorrect": [\n "*"\n ],\n "autofocus": [\n "*"\n ],\n "autopictureinpicture": [\n "*"\n ],\n "autoplay": [\n "*"\n ],\n "axis": [\n "*"\n ],\n "background": [\n "*"\n ],\n "behavior": [\n "*"\n ],\n "bgcolor": [\n "*"\n ],\n "border": [\n "*"\n ],\n "bordercolor": [\n "*"\n ],\n "capture": [\n "*"\n ],\n "cellpadding": [\n "*"\n ],\n "cellspacing": [\n "*"\n ],\n "challenge": [\n "*"\n ],\n "char": [\n "*"\n ],\n "charoff": [\n "*"\n ],\n "charset": [\n "*"\n ],\n "checked": [\n "*"\n ],\n "cite": [\n "*"\n ],\n "class": [\n "*"\n ],\n "classid": [\n "*"\n ],\n "clear": [\n "*"\n ],\n "code": [\n "*"\n ],\n "codebase": [\n "*"\n ],\n "codetype": [\n "*"\n ],\n "color": [\n "*"\n ],\n "cols": [\n "*"\n ],\n "colspan": [\n "*"\n ],\n "compact": [\n "*"\n ],\n "content": [\n "*"\n ],\n "contenteditable": [\n "*"\n ],\n "controls": [\n "*"\n ],\n "controlslist": [\n "*"\n ],\n "conversiondestination": [\n "*"\n ],\n "coords": [\n "*"\n ],\n "crossorigin": [\n "*"\n ],\n "csp": [\n "*"\n ],\n "data": [\n "*"\n ],\n "datetime": [\n "*"\n ],\n "declare": [\n "*"\n ],\n "decoding": [\n "*"\n ],\n "default": [\n "*"\n ],\n "defer": [\n "*"\n ],\n "dir": [\n "*"\n ],\n "direction": [\n "*"\n ],\n "dirname": [\n "*"\n ],\n "disabled": [\n "*"\n ],\n "disablepictureinpicture": [\n "*"\n ],\n "disableremoteplayback": [\n "*"\n ],\n "disallowdocumentaccess": [\n "*"\n ],\n "download": [\n "*"\n ],\n "draggable": [\n "*"\n ],\n "elementtiming": [\n "*"\n ],\n "enctype": [\n "*"\n ],\n "end": [\n "*"\n ],\n "enterkeyhint": [\n "*"\n ],\n "event": [\n "*"\n ],\n "exportparts": [\n "*"\n ],\n "face": [\n "*"\n ],\n "for": [\n "*"\n ],\n "form": [\n "*"\n ],\n "formaction": [\n "*"\n ],\n "formenctype": [\n "*"\n ],\n "formmethod": [\n "*"\n ],\n "formnovalidate": [\n "*"\n ],\n "formtarget": [\n "*"\n ],\n "frame": [\n "*"\n ],\n "frameborder": [\n "*"\n ],\n "headers": [\n "*"\n ],\n "height": [\n "*"\n ],\n "hidden": [\n "*"\n ],\n "high": [\n "*"\n ],\n "href": [\n "*"\n ],\n "hreflang": [\n "*"\n ],\n "hreftranslate": [\n "*"\n ],\n "hspace": [\n "*"\n ],\n "http-equiv": [\n "*"\n ],\n "id": [\n "*"\n ],\n "imagesizes": [\n "*"\n ],\n "imagesrcset": [\n "*"\n ],\n "importance": [\n "*"\n ],\n "impressiondata": [\n "*"\n ],\n "impressionexpiry": [\n "*"\n ],\n "incremental": [\n "*"\n ],\n "inert": [\n "*"\n ],\n "inputmode": [\n "*"\n ],\n "integrity": [\n "*"\n ],\n "invisible": [\n "*"\n ],\n "is": [\n "*"\n ],\n "ismap": [\n "*"\n ],\n "keytype": [\n "*"\n ],\n "kind": [\n "*"\n ],\n "label": [\n "*"\n ],\n "lang": [\n "*"\n ],\n "language": [\n "*"\n ],\n "latencyhint": [\n "*"\n ],\n "leftmargin": [\n "*"\n ],\n "link": [\n "*"\n ],\n "list": [\n "*"\n ],\n "loading": [\n "*"\n ],\n "longdesc": [\n "*"\n ],\n "loop": [\n "*"\n ],\n "low": [\n "*"\n ],\n "lowsrc": [\n "*"\n ],\n "manifest": [\n "*"\n ],\n "marginheight": [\n "*"\n ],\n "marginwidth": [\n "*"\n ],\n "max": [\n "*"\n ],\n "maxlength": [\n "*"\n ],\n "mayscript": [\n "*"\n ],\n "media": [\n "*"\n ],\n "method": [\n "*"\n ],\n "min": [\n "*"\n ],\n "minlength": [\n "*"\n ],\n "multiple": [\n "*"\n ],\n "muted": [\n "*"\n ],\n "name": [\n "*"\n ],\n "nohref": [\n "*"\n ],\n "nomodule": [\n "*"\n ],\n "nonce": [\n "*"\n ],\n "noresize": [\n "*"\n ],\n "noshade": [\n "*"\n ],\n "novalidate": [\n "*"\n ],\n "nowrap": [\n "*"\n ],\n "object": [\n "*"\n ],\n "open": [\n "*"\n ],\n "optimum": [\n "*"\n ],\n "part": [\n "*"\n ],\n "pattern": [\n "*"\n ],\n "ping": [\n "*"\n ],\n "placeholder": [\n "*"\n ],\n "playsinline": [\n "*"\n ],\n "policy": [\n "*"\n ],\n "poster": [\n "*"\n ],\n "preload": [\n "*"\n ],\n "pseudo": [\n "*"\n ],\n "readonly": [\n "*"\n ],\n "referrerpolicy": [\n "*"\n ],\n "rel": [\n "*"\n ],\n "reportingorigin": [\n "*"\n ],\n "required": [\n "*"\n ],\n "resources": [\n "*"\n ],\n "rev": [\n "*"\n ],\n "reversed": [\n "*"\n ],\n "role": [\n "*"\n ],\n "rows": [\n "*"\n ],\n "rowspan": [\n "*"\n ],\n "rules": [\n "*"\n ],\n "sandbox": [\n "*"\n ],\n "scheme": [\n "*"\n ],\n "scope": [\n "*"\n ],\n "scopes": [\n "*"\n ],\n "scrollamount": [\n "*"\n ],\n "scrolldelay": [\n "*"\n ],\n "scrolling": [\n "*"\n ],\n "select": [\n "*"\n ],\n "selected": [\n "*"\n ],\n "shadowroot": [\n "*"\n ],\n "shadowrootdelegatesfocus": [\n "*"\n ],\n "shape": [\n "*"\n ],\n "size": [\n "*"\n ],\n "sizes": [\n "*"\n ],\n "slot": [\n "*"\n ],\n "span": [\n "*"\n ],\n "spellcheck": [\n "*"\n ],\n "src": [\n "*"\n ],\n "srcdoc": [\n "*"\n ],\n "srclang": [\n "*"\n ],\n "srcset": [\n "*"\n ],\n "standby": [\n "*"\n ],\n "start": [\n "*"\n ],\n "step": [\n "*"\n ],\n "style": [\n "*"\n ],\n "summary": [\n "*"\n ],\n "tabindex": [\n "*"\n ],\n "target": [\n "*"\n ],\n "text": [\n "*"\n ],\n "title": [\n "*"\n ],\n "topmargin": [\n "*"\n ],\n "translate": [\n "*"\n ],\n "truespeed": [\n "*"\n ],\n "trusttoken": [\n "*"\n ],\n "type": [\n "*"\n ],\n "usemap": [\n "*"\n ],\n "valign": [\n "*"\n ],\n "value": [\n "*"\n ],\n "valuetype": [\n "*"\n ],\n "version": [\n "*"\n ],\n "virtualkeyboardpolicy": [\n "*"\n ],\n "vlink": [\n "*"\n ],\n "vspace": [\n "*"\n ],\n "webkitdirectory": [\n "*"\n ],\n "width": [\n "*"\n ],\n "wrap": [\n "*"\n ]\n }\n}'),re=function(e,t,n=oe){const o=ue(t,n);e.replaceChildren(le(o))},ie=["https:"];ie.includes(location.protocol)||ie.push(location.protocol);const ae=s((()=>function(e,{createHTML:t=(()=>{throw new TypeError("This policy does not provide `createHTML()`")}),createScript:n=(()=>{throw new TypeError("This policy does not provide `createScript()`")}),createScriptURL:o=(()=>{throw new TypeError("This policy does not provide `createScriptURL()`")})}){return H()?trustedTypes.createPolicy(e,{createHTML:t,createScript:n,createScriptURL:o}):Object.freeze({name:e,createHTML:(e,...n)=>t(e.toString(),...n),createScript:(e,...t)=>n(e.toString(),...t),createScriptURL:(e,...t)=>o(e.toString(),...t)})}("sanitizer-raw#html",{createHTML:e=>e}))),se=e=>ae().createHTML(e);function le(e){const t=document.createDocumentFragment(),n=e.cloneNode(!0);return t.append(...n.head.childNodes,...n.body.childNodes),t}function ce({allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s,sanitizer:l}={},c){return l instanceof Sanitizer?ce(l.getConfiguration(),c):(void 0===e&&void 0===i&&(e=oe.allowAttributes),void 0===n&&void 0===a&&(n=oe.allowElements),{allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s})}function ue(e,t=oe){const n=(new DOMParser).parseFromString(se(e),"text/html");return Array.isArray(t.allowElements)&&!t.allowElements.includes("html")&&(t.allowElements=[...new Set([...t.allowElements,"html","head","body"])]),de(n,t)}function pe(e,t=oe){if(e instanceof Node){if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)return de(e,t);if(e.nodeType===Node.DOCUMENT_NODE)return de(le(e),t);throw new TypeError("sanitize requires a Document or DocumentFragment")}throw new TypeError("sanitize requires a Document or DocumentFragment")}function de(e,t=oe){try{if(!(e instanceof Node))throw new TypeError(`Expected a Node but got a ${a(e)}.`);if(!i(t))throw new TypeError(`Expected config to be an object but got ${a(t)}.`);const{allowElements:n,allowComments:o,allowAttributes:r,allowCustomElements:s,blockElements:l,dropAttributes:c,dropElements:u,allowUnknownMarkup:p}=ce(t),d=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let m=d.root.nodeType===Node.ELEMENT_NODE?d.root:d.nextNode();for(;m instanceof Node;){switch(m.nodeType){case Node.ELEMENT_NODE:{if(!p&&(!(m instanceof HTMLElement)||m instanceof HTMLUnknownElement)){m.remove();break}const e=m.tagName.toLowerCase();Array.isArray(u)&&u.includes(e)?m.remove():Array.isArray(l)&&l.includes(e)?m.hasChildNodes()?m.replaceWith(...m.childNodes):m.remove():e.includes("-")&&!s||Array.isArray(n)&&!n.includes(e)?m.remove():m.hasAttributes()&&m.getAttributeNames().forEach((t=>{const n=m.getAttributeNode(t),{value:o}=n;U.includes(t)&&!ie.includes(new URL(o,document.baseURI).protocol)?m.removeAttributeNode(n):i(c)?t in c&&["*",e].some((e=>c[t].includes(e)))&&m.removeAttributeNode(n):i(r)&&(t in r&&["*",e].some((e=>r[t].includes(e)))||m.removeAttributeNode(n))}));break}case Node.COMMENT_NODE:o||m.remove()}"template"===m.localName&&de(m.content,t),m=d.nextNode()}return e}catch(t){console.error(t),e.parentElement.removeChild(e)}}
|
|
39
|
+
const oe=JSON.parse('{\n "allowCustomElements": false,\n "allowUnknownMarkup": false,\n "allowElements": [\n "a",\n "abbr",\n "acronym",\n "address",\n "area",\n "article",\n "aside",\n "audio",\n "b",\n "bdi",\n "bdo",\n "bgsound",\n "big",\n "blockquote",\n "body",\n "br",\n "button",\n "canvas",\n "caption",\n "center",\n "cite",\n "code",\n "col",\n "colgroup",\n "datalist",\n "dd",\n "del",\n "details",\n "dfn",\n "dialog",\n "dir",\n "div",\n "dl",\n "dt",\n "em",\n "fieldset",\n "figcaption",\n "figure",\n "font",\n "footer",\n "form",\n "h1",\n "h2",\n "h3",\n "h4",\n "h5",\n "h6",\n "head",\n "header",\n "hgroup",\n "hr",\n "html",\n "i",\n "img",\n "input",\n "ins",\n "kbd",\n "keygen",\n "label",\n "layer",\n "legend",\n "li",\n "link",\n "listing",\n "main",\n "map",\n "mark",\n "marquee",\n "menu",\n "meta",\n "meter",\n "nav",\n "nobr",\n "ol",\n "optgroup",\n "option",\n "output",\n "p",\n "picture",\n "popup",\n "pre",\n "progress",\n "q",\n "rb",\n "rp",\n "rt",\n "rtc",\n "ruby",\n "s",\n "samp",\n "section",\n "select",\n "selectmenu",\n "small",\n "source",\n "span",\n "strike",\n "strong",\n "style",\n "sub",\n "summary",\n "sup",\n "table",\n "tbody",\n "td",\n "tfoot",\n "th",\n "thead",\n "time",\n "tr",\n "track",\n "tt",\n "u",\n "ul",\n "var",\n "video",\n "wbr"\n ],\n "allowAttributes": {\n "abbr": [\n "*"\n ],\n "accept": [\n "*"\n ],\n "accept-charset": [\n "*"\n ],\n "accesskey": [\n "*"\n ],\n "action": [\n "*"\n ],\n "align": [\n "*"\n ],\n "alink": [\n "*"\n ],\n "allow": [\n "*"\n ],\n "allowfullscreen": [\n "*"\n ],\n "alt": [\n "*"\n ],\n "anchor": [\n "*"\n ],\n "archive": [\n "*"\n ],\n "as": [\n "*"\n ],\n "async": [\n "*"\n ],\n "autocapitalize": [\n "*"\n ],\n "autocomplete": [\n "*"\n ],\n "autocorrect": [\n "*"\n ],\n "autofocus": [\n "*"\n ],\n "autopictureinpicture": [\n "*"\n ],\n "autoplay": [\n "*"\n ],\n "axis": [\n "*"\n ],\n "background": [\n "*"\n ],\n "behavior": [\n "*"\n ],\n "bgcolor": [\n "*"\n ],\n "border": [\n "*"\n ],\n "bordercolor": [\n "*"\n ],\n "capture": [\n "*"\n ],\n "cellpadding": [\n "*"\n ],\n "cellspacing": [\n "*"\n ],\n "challenge": [\n "*"\n ],\n "char": [\n "*"\n ],\n "charoff": [\n "*"\n ],\n "charset": [\n "*"\n ],\n "checked": [\n "*"\n ],\n "cite": [\n "*"\n ],\n "class": [\n "*"\n ],\n "classid": [\n "*"\n ],\n "clear": [\n "*"\n ],\n "code": [\n "*"\n ],\n "codebase": [\n "*"\n ],\n "codetype": [\n "*"\n ],\n "color": [\n "*"\n ],\n "cols": [\n "*"\n ],\n "colspan": [\n "*"\n ],\n "compact": [\n "*"\n ],\n "content": [\n "*"\n ],\n "contenteditable": [\n "*"\n ],\n "controls": [\n "*"\n ],\n "controlslist": [\n "*"\n ],\n "conversiondestination": [\n "*"\n ],\n "coords": [\n "*"\n ],\n "crossorigin": [\n "*"\n ],\n "csp": [\n "*"\n ],\n "data": [\n "*"\n ],\n "datetime": [\n "*"\n ],\n "declare": [\n "*"\n ],\n "decoding": [\n "*"\n ],\n "default": [\n "*"\n ],\n "defer": [\n "*"\n ],\n "dir": [\n "*"\n ],\n "direction": [\n "*"\n ],\n "dirname": [\n "*"\n ],\n "disabled": [\n "*"\n ],\n "disablepictureinpicture": [\n "*"\n ],\n "disableremoteplayback": [\n "*"\n ],\n "disallowdocumentaccess": [\n "*"\n ],\n "download": [\n "*"\n ],\n "draggable": [\n "*"\n ],\n "elementtiming": [\n "*"\n ],\n "enctype": [\n "*"\n ],\n "end": [\n "*"\n ],\n "enterkeyhint": [\n "*"\n ],\n "event": [\n "*"\n ],\n "exportparts": [\n "*"\n ],\n "face": [\n "*"\n ],\n "for": [\n "*"\n ],\n "form": [\n "*"\n ],\n "formaction": [\n "*"\n ],\n "formenctype": [\n "*"\n ],\n "formmethod": [\n "*"\n ],\n "formnovalidate": [\n "*"\n ],\n "formtarget": [\n "*"\n ],\n "frame": [\n "*"\n ],\n "frameborder": [\n "*"\n ],\n "headers": [\n "*"\n ],\n "height": [\n "*"\n ],\n "hidden": [\n "*"\n ],\n "high": [\n "*"\n ],\n "href": [\n "*"\n ],\n "hreflang": [\n "*"\n ],\n "hreftranslate": [\n "*"\n ],\n "hspace": [\n "*"\n ],\n "http-equiv": [\n "*"\n ],\n "id": [\n "*"\n ],\n "imagesizes": [\n "*"\n ],\n "imagesrcset": [\n "*"\n ],\n "importance": [\n "*"\n ],\n "impressiondata": [\n "*"\n ],\n "impressionexpiry": [\n "*"\n ],\n "incremental": [\n "*"\n ],\n "inert": [\n "*"\n ],\n "inputmode": [\n "*"\n ],\n "integrity": [\n "*"\n ],\n "invisible": [\n "*"\n ],\n "is": [\n "*"\n ],\n "ismap": [\n "*"\n ],\n "keytype": [\n "*"\n ],\n "kind": [\n "*"\n ],\n "label": [\n "*"\n ],\n "lang": [\n "*"\n ],\n "language": [\n "*"\n ],\n "latencyhint": [\n "*"\n ],\n "leftmargin": [\n "*"\n ],\n "link": [\n "*"\n ],\n "list": [\n "*"\n ],\n "loading": [\n "*"\n ],\n "longdesc": [\n "*"\n ],\n "loop": [\n "*"\n ],\n "low": [\n "*"\n ],\n "lowsrc": [\n "*"\n ],\n "manifest": [\n "*"\n ],\n "marginheight": [\n "*"\n ],\n "marginwidth": [\n "*"\n ],\n "max": [\n "*"\n ],\n "maxlength": [\n "*"\n ],\n "mayscript": [\n "*"\n ],\n "media": [\n "*"\n ],\n "method": [\n "*"\n ],\n "min": [\n "*"\n ],\n "minlength": [\n "*"\n ],\n "multiple": [\n "*"\n ],\n "muted": [\n "*"\n ],\n "name": [\n "*"\n ],\n "nohref": [\n "*"\n ],\n "nomodule": [\n "*"\n ],\n "nonce": [\n "*"\n ],\n "noresize": [\n "*"\n ],\n "noshade": [\n "*"\n ],\n "novalidate": [\n "*"\n ],\n "nowrap": [\n "*"\n ],\n "object": [\n "*"\n ],\n "open": [\n "*"\n ],\n "optimum": [\n "*"\n ],\n "part": [\n "*"\n ],\n "pattern": [\n "*"\n ],\n "ping": [\n "*"\n ],\n "placeholder": [\n "*"\n ],\n "playsinline": [\n "*"\n ],\n "policy": [\n "*"\n ],\n "poster": [\n "*"\n ],\n "preload": [\n "*"\n ],\n "pseudo": [\n "*"\n ],\n "readonly": [\n "*"\n ],\n "referrerpolicy": [\n "*"\n ],\n "rel": [\n "*"\n ],\n "reportingorigin": [\n "*"\n ],\n "required": [\n "*"\n ],\n "resources": [\n "*"\n ],\n "rev": [\n "*"\n ],\n "reversed": [\n "*"\n ],\n "role": [\n "*"\n ],\n "rows": [\n "*"\n ],\n "rowspan": [\n "*"\n ],\n "rules": [\n "*"\n ],\n "sandbox": [\n "*"\n ],\n "scheme": [\n "*"\n ],\n "scope": [\n "*"\n ],\n "scopes": [\n "*"\n ],\n "scrollamount": [\n "*"\n ],\n "scrolldelay": [\n "*"\n ],\n "scrolling": [\n "*"\n ],\n "select": [\n "*"\n ],\n "selected": [\n "*"\n ],\n "shadowroot": [\n "*"\n ],\n "shadowrootdelegatesfocus": [\n "*"\n ],\n "shape": [\n "*"\n ],\n "size": [\n "*"\n ],\n "sizes": [\n "*"\n ],\n "slot": [\n "*"\n ],\n "span": [\n "*"\n ],\n "spellcheck": [\n "*"\n ],\n "src": [\n "*"\n ],\n "srcdoc": [\n "*"\n ],\n "srclang": [\n "*"\n ],\n "srcset": [\n "*"\n ],\n "standby": [\n "*"\n ],\n "start": [\n "*"\n ],\n "step": [\n "*"\n ],\n "style": [\n "*"\n ],\n "summary": [\n "*"\n ],\n "tabindex": [\n "*"\n ],\n "target": [\n "*"\n ],\n "text": [\n "*"\n ],\n "title": [\n "*"\n ],\n "topmargin": [\n "*"\n ],\n "translate": [\n "*"\n ],\n "truespeed": [\n "*"\n ],\n "trusttoken": [\n "*"\n ],\n "type": [\n "*"\n ],\n "usemap": [\n "*"\n ],\n "valign": [\n "*"\n ],\n "value": [\n "*"\n ],\n "valuetype": [\n "*"\n ],\n "version": [\n "*"\n ],\n "virtualkeyboardpolicy": [\n "*"\n ],\n "vlink": [\n "*"\n ],\n "vspace": [\n "*"\n ],\n "webkitdirectory": [\n "*"\n ],\n "width": [\n "*"\n ],\n "wrap": [\n "*"\n ]\n }\n}'),re=function(e,t,n=oe){const o=ue(t,n);e.replaceChildren(le(o))},ie=["https:"];ie.includes(location.protocol)||ie.push(location.protocol);const ae=s((()=>function(e,{createHTML:t=(()=>{throw new TypeError("This policy does not provide `createHTML()`")}),createScript:n=(()=>{throw new TypeError("This policy does not provide `createScript()`")}),createScriptURL:o=(()=>{throw new TypeError("This policy does not provide `createScriptURL()`")})}){return j()?trustedTypes.createPolicy(e,{createHTML:t,createScript:n,createScriptURL:o}):Object.freeze({name:e,createHTML:(e,...n)=>t(e.toString(),...n),createScript:(e,...t)=>n(e.toString(),...t),createScriptURL:(e,...t)=>o(e.toString(),...t)})}("sanitizer-raw#html",{createHTML:e=>e}))),se=e=>ae().createHTML(e);function le(e){const t=document.createDocumentFragment(),n=e.cloneNode(!0);return t.append(...n.head.childNodes,...n.body.childNodes),t}function ce({allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s,sanitizer:l}={},c){return l instanceof Sanitizer?ce(l.getConfiguration(),c):(void 0===e&&void 0===i&&(e=oe.allowAttributes),void 0===n&&void 0===a&&(n=oe.allowElements),{allowAttributes:e,allowComments:t,allowElements:n,allowCustomElements:o,blockElements:r,dropAttributes:i,dropElements:a,allowUnknownMarkup:s})}function ue(e,t=oe){const n=(new DOMParser).parseFromString(se(e),"text/html");return Array.isArray(t.allowElements)&&!t.allowElements.includes("html")&&(t.allowElements=[...new Set([...t.allowElements,"html","head","body"])]),de(n,t)}function pe(e,t=oe){if(e instanceof Node){if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)return de(e,t);if(e.nodeType===Node.DOCUMENT_NODE)return de(le(e),t);throw new TypeError("sanitize requires a Document or DocumentFragment")}throw new TypeError("sanitize requires a Document or DocumentFragment")}function de(e,t=oe){try{if(!(e instanceof Node))throw new TypeError(`Expected a Node but got a ${a(e)}.`);if(!i(t))throw new TypeError(`Expected config to be an object but got ${a(t)}.`);const{allowElements:n,allowComments:o,allowAttributes:r,allowCustomElements:s,blockElements:l,dropAttributes:c,dropElements:u,allowUnknownMarkup:p}=ce(t),d=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT);let m=d.root.nodeType===Node.ELEMENT_NODE?d.root:d.nextNode();for(;m instanceof Node;){switch(m.nodeType){case Node.ELEMENT_NODE:{if(!p&&(!(m instanceof HTMLElement)||m instanceof HTMLUnknownElement)){m.remove();break}const e=m.tagName.toLowerCase();Array.isArray(u)&&u.includes(e)?m.remove():Array.isArray(l)&&l.includes(e)?m.hasChildNodes()?m.replaceWith(...m.childNodes):m.remove():e.includes("-")&&!s||Array.isArray(n)&&!n.includes(e)?m.remove():m.hasAttributes()&&m.getAttributeNames().forEach((t=>{const n=m.getAttributeNode(t),{value:o}=n;U.includes(t)&&!ie.includes(new URL(o,document.baseURI).protocol)?m.removeAttributeNode(n):i(c)?t in c&&["*",e].some((e=>c[t].includes(e)))&&m.removeAttributeNode(n):i(r)&&(t in r&&["*",e].some((e=>r[t].includes(e)))||m.removeAttributeNode(n))}));break}case Node.COMMENT_NODE:o||m.remove()}"template"===m.localName&&de(m.content,t),m=d.nextNode()}return e}catch(t){console.error(t),e.parentElement.removeChild(e)}}
|
|
40
40
|
/**
|
|
41
41
|
* @copyright 2022-2023 Chris Zuber <admin@kernvalley.us>
|
|
42
42
|
*/
|