UNPKG

@glyph-cat/swiss-army-knife

Version:
1 lines 59.7 kB
import{SimpleStateManager as t,SimpleFiniteStateManager as r}from"cotton-box";import e from"autoprefixer";import n from"postcss";class i{constructor(t){this.internalAppIdentifier=t,this.createStorageKey=this.createStorageKey.bind(this),this.clearStorage=this.clearStorage.bind(this),this.clearLocalStorage=this.clearLocalStorage.bind(this),this.clearSessionStorage=this.clearSessionStorage.bind(this),this.clearAllStorage=this.clearAllStorage.bind(this)}createStorageKey(t){return`${this.internalAppIdentifier}/${t}`}clearStorage(t){for(let r=0;r<t.length;r++){const e=t.key(r);(null==e?void 0:e.startsWith(this.internalAppIdentifier))&&t.removeItem(e)}}clearLocalStorage(){this.clearStorage(localStorage)}clearSessionStorage(){this.clearStorage(sessionStorage)}clearAllStorage(){this.clearLocalStorage(),this.clearSessionStorage()}}function o(t){if("undefined"!=typeof window)return t()}function s(){return(new Date).toISOString().replace(/[^a-z0-9]/gi,"")}const a="production"!==process.env.NODE_ENV;var u;!function(t){t.CJS="CJS",t.ES="ES",t.MJS="MJS",t.RN="RN",t.UMD="UMD",t.UMD_MIN="UMD_MIN"}(u||(u={}));const c="ES",h="cfe443b08bce5094a0331628ac57af0c7db931fc",l=a||"ES"===u.RN||"undefined"!=typeof window,f="0.0.0-experimental.83";var d;!function(t){t[t.NO=0]="NO",t[t.YES=1]="YES"}(d||(d={}));const p=s();function g(t,r,e){const n=[...e,...r],i=Math.max(0,n.length-t);return i>0&&n.splice(0,i),n}function m(t,r,e,n={}){const i=(null==n?void 0:n.harshJoin)?[...r,...e]:[...[...r].reverse(),...e],o=Math.max(0,i.length-t);return o>0&&i.splice(t,o),i}function b(t,r=0){return t[Math.max(0,t.length-1-r)]}function E(t,r){for(let e=t.length-1;e>=0;e--)if(r(t[e],e))return t[e];return null}function v(t){return[...new Set(t)]}function T(t,r){const e=[...t],n=[];for(let t=0;t<r;t++)n.push(e.pop());return[e,...n]}function C(t,r){const e=r-t;return t+Math.floor(Math.random()*e)}function w(t,r=!1){const e=[...t];do{let t=e.length;for(;t;){const r=C(0,t--),n=e[t];e[t]=e[r],e[r]=n}}while(r&&y(t,e));return e}function y(t,r){if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(!Object.is(t[e],r[e]))return!1;return!0}function S(t){const r=Math.floor(t.length/2),e={value:t[r]},n=t.slice(0,r),i=t.slice(r+1,t.length);return n.length>0&&(e.left=S(n)),i.length>0&&(e.right=S(i)),e}function O(t,r){let e=[];const n=[];for(let i=0;i<t.length;i++){const o=t[i];e.push(o);e.length>=r&&(n.push(e),e=[])}return e.length>0&&(n.push(e),e=[]),n}function A(t){return t[C(0,t.length)]}const N=["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit","sed","do","eiusmod","tempor","incididunt","ut","labore","et","dolore","magna","aliqua","enim","ad","minim","veniam","quis","nostrud","exercitation","ullamco","laboris","nisi","aliquip","ex","ea","commodo","consequat","duis","aute","irure","in","reprehenderit","voluptate","velit","esse","cillum","eu","fugiat","nulla","pariatur","excepteur","sint","occaecat","cupidatat","non","proident","sunt","culpa","qui","officia","deserunt","mollit","anim","id","est","laborum"];function I(t){const r=[];for(;r.length<t;)r.push(A(N));return r.join(" ")}var R,$;function M(t){return"boolean"==typeof t}function D(t){return"function"==typeof t}function L(t){return Object.is(t,NaN)}function _(t){return"number"==typeof t}function x(t){return"number"==typeof t&&!L(t)}function k(t){return"object"==typeof t}function F(t){return"object"==typeof t&&!H(t)}function B(t){return"string"==typeof t}function P(t){return"symbol"==typeof t}function U(t){return D(null==t?void 0:t.then)}function X(t){return void 0===t}function H(t){return Object.is(t,null)}function G(t){return H(t)||X(t)}function j(t){return X(t)||H(t)}function V(t,...r){a&&console[t](...r)}function z(...t){V("info",...t)}function Y(...t){V("warn",...t)}function q(...t){V("error",...t)}function Q(t){return t.length<=0?"[]":`['${t.join("', '")}']`}function W(t){const r=[];for(const e of t)r.push(B(e)?`'${e}'`:String(e));return`[${r.join(", ")}]`}function J(t){let r="";for(const e of t)r+=e.match(/^[a-z]/i)?`.${e}`:`['${e}']`;return r.match(/^\./)&&(r=r.replace(/^\./,"")),`\`${r}\``}function K(t){const r=t.toString(),e=r[r.length-1];return"1"!==e||r.match(/11$/)?"2"!==e||r.match(/12$/)?"3"!==e||r.match(/13$/)?`${t}th`:`${t}rd`:`${t}nd`:`${t}st`}function Z(t,r){return!!t&&Object.prototype.hasOwnProperty.call(t,r)}function tt(t,r){if(l&&r.length<1&&q("Expected there to be at least one property name but got none"),!t)return!1;for(const e of r)if(Object.prototype.hasOwnProperty.call(t,e))return!0;return!1}function rt(t,r){if(l&&r.length<1&&q("Expected there to be at least one property name but got none"),!t)return!1;for(const e of r)if(!Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function et(t){const r=(t=t.replace(/[.\]]([\d][\da-z_-]*)/gi,'["$1"]').replace(/[\]?]/g,"").replace(/\.?\[/g,".")).split(/\.\[?/g),e=[];for(let t=0;t<r.length;t++)r[t].length<=0||(/^\d+$/.test(r[t])?e.push(Number(r[t])):e.push(r[t].replace(/^["'`]/,"").replace(/["'`]$/,"")));return e}function nt(t,r){return st(t,r)[1]}function it(t,r){if(l&&r.length<1&&q("Expected there to be at least one property path but got none"),!t)return!1;for(const e of r)if(st(t,e)[1])return!0;return!1}function ot(t,r){if(l&&r.length<1&&q("Expected there to be at least one property path but got none"),!t)return!1;for(const e of r)if(!st(t,e)[1])return!1;return!0}function st(t,r){if(!t)return[void 0,!1];let e=t;Array.isArray(r)||(r=et(r)),l&&r.length<=0&&q("Expected there to be at least one path segment but got none");for(let t=0;t<r.length;t++){const n=r[t];if(!Object.prototype.hasOwnProperty.call(e,n))return[void 0,!1];e=e[n]}return[e,!0]}function at(t,r,e){let n=t;Array.isArray(r)||(r=et(r));const i=r.length-1;for(let t=0;t<=i;t++){const o=r[t];t===i?n[o]=e:(Object.prototype.hasOwnProperty.call(n,o)||(n[o]=x(r[t+1])?[]:{}),n=n[o])}}function ut(t,r,e){return Array.isArray(r)||(r=et(r)),ct(t,!0,r,e)}function ct(t,r,e,n){var i;const[o,...s]=e;if(Array.isArray(t)||!r&&x(o)){const r=[...null!==(i=t)&&void 0!==i?i:[]];return r[o]=s.length>0?ct(r[o],Z(r,o),s,n):n,r}return{...t,[o]:s.length>0?ct(null==t?void 0:t[o],Z(t,o),s,n):n}}function ht(t,r,e){return Array.isArray(r)||(r=et(r)),lt(t,r,e,!0)}function lt(t,r,e,n){const[i,...o]=r,s=!!n&&Object.prototype.hasOwnProperty.call(t,i);if(Array.isArray(t)||!n&&x(i)){const r=[...n?t:[]];return r[i]=o.length>0?lt(r[i],o,e,s):e(null==t?void 0:t[i],s),r}return{...t,[i]:o.length>0?lt(null==t?void 0:t[i],o,e,s):e(null==t?void 0:t[i],s)}}function ft(t,r,e){return Array.isArray(r)||(r=et(r)),dt(t,r,e)[0]}function dt(t,r,e){if(G(t))return[t,!1];const[n,...i]=r;if(!Object.prototype.hasOwnProperty.call(t,n))return[t,!1];if(Array.isArray(t)){const r=[...t],[o]=r.splice(n,1);if(i.length>0){const[t,s]=dt(o,i,e);return(null==e?void 0:e.clean)&&!s||r.splice(n,0,t),[r,!(null==e?void 0:e.clean)||r.length>0]}return[r,!(null==e?void 0:e.clean)||r.length>0]}{const r={...t},o=r[n];if(i.length>0){const[t,s]=dt(o,i,e);return(null==e?void 0:e.clean)&&!s?delete r[n]:r[n]=t,[r,!(null==e?void 0:e.clean)||Object.keys(r).length>0]}{const{[n]:r,...i}=t;return[i,!(null==e?void 0:e.clean)||Object.keys(i).length>0]}}}function pt(t){const r=Object.keys(t);for(const e of r)t[t[e]]=e}function gt(t){const r={};for(const e in t){const n=t[e];r[e]=n,r[n]=e}return Object.freeze(r),r}function mt(t){return r=>{var e;return String(null!==(e=t[r])&&void 0!==e?e:r)}}!function(t){t.ARRAY=[],t.OBJECT={},t.FUNCTION=()=>{},t.PROMISE=Promise.resolve(),t.STRING="",t.DOUBLE_QUOTE='""',t.SINGLE_QUOTE="''",t.BACKTICK_QUOTE="``"}(R||(R={}));class bt{constructor(t={}){this.t={};for(const r in t){const e=t[r];this.t[r]=e,this.t[e]=r}}add(t,r){const e=this.clone();return e.t[t]=r,e.t[r]=t,e}remove(t){const r=this.clone(),e=r.t[t];return delete r.t[t],delete r.t[e],r}get(t){return this.t[t]}toJSON(){return{...this.t}}has(t){return Z(this.t,t)}clone(){const t=new bt;return t.t=this.toJSON(),t}}function Et(t){const r={};for(const e of t)r[e]=!0;return r}function vt(t){return Object.freeze(Et(t))}function Tt(t){return JSON.parse(JSON.stringify(t))}function Ct(t,r){return JSON.stringify(t)===JSON.stringify(r)}function wt(t){try{return JSON.stringify(t)}catch(r){return String(t)}}function yt(t,r){if(!B(t))return null;try{return JSON.parse(t,r)}catch(t){return null}}class St{constructor(t){this.factory=t,this.o=!1}get isInitialized(){return this.o}get value(){return this.o||(this.u=this.factory(),this.o=!0),this.u}}function Ot(t,r){if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++)if(!Object.is(t[e],r[e]))return!1;return!0}function At(t){let r,e;return(...n)=>{if(X(r)||!Ot(r,n)){const i=t(...n);e=i,r=n}return e}}function Nt(t,r=2,e){let n=[];return(...e)=>{for(let t=0;t<n.length;t++){const[r,i]=n[t];if(Ot(r,e))return i}const i=t(...e);return n=m(r,[[e,i]],n),i}}function It(t){return X(t)?null:t}function Rt(t,r){if(!t)return;let e=1;for(const n in t){if(e===r)return n;e+=1}}function $t(t,r){if(t)return t[Rt(t,r)]}function Mt(t){return Rt(t,1)}function Dt(t){return $t(t,1)}function Lt(t){if(!t)return!0;for(const r in t)return!1;return!0}function _t(t){if(!t)return!1;for(const r in t)return!0;return!1}function xt(t,r){const e={};let n=0;for(const i in t)r(t[i],i,n,t)&&(e[i]=t[i]),n+=1;return e}function kt(t){const r={};for(const e in t)if(Z(t,e))if(k(t[e])){const n=kt(t[e]);for(const t in n)Z(n,t)&&(r[e+"."+t]=n[t])}else r[e]=t[e];return r}function Ft(t,r){let e=0;const n=[];for(const i in t)n.push(r(t[i],i,e,t)),e+=1;return n}function Bt(t,r){let e=t;for(const t of r){if(!Z(e,t))continue;const{[t]:r,...n}=e;e=n}return e}function Pt(t,r){const e={};for(const n of r)Z(t,n)&&(e[n]=t[n]);return e}function Ut(t,r,e){let n=0;for(const i in t)e=r(e,t[i],i,n,t),n+=1;return e}function Xt(t,r){const e=Object.keys(t);e.sort(((e,n)=>r({key:e,value:t[e]},{key:n,value:t[n]})));const n={};for(const r of e)n[r]=t[r];return n}function Ht(t,...r){let e=t;for(const n of r)for(const r in t)Z(n,r)&&(e={...e,[r]:n[r]});return e}function Gt(t){return{current:t}}class jt{constructor(t){const r=new Map;for(const e of t){const[t,n]=e;for(const e of t)r.set(e,n)}this.expandedData=r}resolve(t){return this.expandedData.get(t)}}class Vt{constructor(t){const r=new Map;for(const e of t){const[t,n]=e;for(const e of n)r.set(e,t)}this.reversedData=r,this.resolve=this.resolve.bind(this)}resolve(t){return this.reversedData.get(t)}}function zt(t){return t.replace(/^[\s\n\t]+/,"").replace(/[\s\n\t]+$/,"")}function Yt(t){const r=[],e=t.split(/\n/g);for(const t of e)r.push(zt(t));return zt(r.join("\n"))}function qt(t,r,e){return Math.min(Math.max(r,t),e)}!function(t){t.toBoolean=function(t){return/^(t(rue)?|y(es)?|1)$/i.test(t)},t.toString=function(t){return k(t)?JSON.stringify(t):zt(String(t))}}($||($={}));const Qt=Math.PI/180,Wt=180/Math.PI;function Jt(t){return t*Qt}function Kt(t){return t*Wt}function Zt(t,r){const e=[t,r];return e.q=t,e.r=r,e}function tr(t){return t%2==0}function rr(t){return t%2!=0}function er(t,r){return r%t==0}function nr(t){return r=>r%t==0}function ir(t,r){const e=Math.abs(r-t);return r>t?t+2*e:t-2*e}function or(t,r,e,n){return Math.hypot(e-t,n-r)}function sr(t,r){return or(t.x,t.y,r.x,r.y)}function ar(t,r){let e=Math.atan2(t.x*r.y-t.y*r.x,t.x*r.x+t.y*r.y);return e<0&&(e*=-1),e}function ur(t,r,e,n){return ar({x:r.x-t.x,y:r.y-t.y},{x:n.x-e.x,y:n.y-e.y})}function cr(t,r,e,n,i,o){return Math.sqrt(Math.pow(n-t,2)+Math.pow(i-r,2)+Math.pow(o-e,2))}function hr(t,r){return cr(t.x,t.y,t.z,r.x,r.y,r.z)}function lr(t,r){const e=t.x*r.x+t.y*r.y+t.z*r.z,n=Math.pow(t.x,2)+Math.pow(t.y,2)+Math.pow(t.z,2),i=Math.pow(r.x,2)+Math.pow(r.y,2)+Math.pow(r.z,2);return Math.acos(e/Math.sqrt(n*i))}function fr(t,r,e,n){return lr({x:r.x-t.x,y:r.y-t.y,z:r.z-t.z},{x:n.x-e.x,y:n.y-e.y,z:n.z-e.z})}function dr(t,r,e){const n=r-e*t;return t=>e*t+n}function pr(t,r,e,n){return e*n+(r-e*t)}function gr(t,r,e,n){const i=(n-r)/(e-t),o=r-i*t;return t=>i*t+o}function mr(t,r,e,n,i){const o=(n-r)/(e-t);return o*i+(r-o*t)}function br(t,r,e){return(t-r)/(e-r)}class Er{constructor(t){this.decimals=t,l&&(t<0?Y(`Expected \`decimal\` to be >=1 but got ${t}`):0===t&&Y(`${Er.name} is unnecessary when decimals is 0`)),this.decimals=Math.max(t,0),this.offset=Math.pow(10,this.decimals)}add(t,...r){const e=Math.pow(10,this.decimals);let n=t*e;for(const t of r)n+=t*e;return parseFloat((n/e).toFixed(this.decimals))}subtract(t,...r){const e=Math.pow(10,this.decimals);let n=t*e;for(const t of r)n-=t*e;return parseFloat((n/e).toFixed(this.decimals))}multiply(t,...r){let e=t*this.offset;for(const t of r)e*=t*this.offset,e/=this.offset;return parseFloat((e/this.offset).toFixed(this.decimals))}divide(t,...r){let e=t;for(const t of r)e=e*this.offset/(t*this.offset);return parseFloat(e.toFixed(this.decimals))}}function vr(t,r,e){return t>=r&&t<=e}function Tr(t,r,e){return t<r||t>e}function Cr(t){return 0===t}function wr(t){return t<0}function yr(t){return t<=0}function Sr(t){return t>0}function Or(t){return t>=0}function Ar(t,r=0){return parseFloat(t.toFixed(r))}class Nr{constructor(t,r){this.values=t,this.options=r}get size(){return this.values.length}get sum(){if(X(this.p)){this.p=0;for(let t=0;t<this.values.length;t++)this.p+=this.values[t]}return this.p}get mean(){return X(this.v)&&(this.v=this.sum/this.values.length),this.v}get median(){if(X(this.T))if(this.values.length%2!=0)this.T=this.values[Math.floor(this.values.length/2)];else{const t=this.values.length/2;this.T=(this.values[t-1]+this.values[t])/2}return this.T}get variance(){var t;if(X(this.O)){let r=0;for(let t=0;t<this.values.length;t++)r+=Math.pow(this.values[t]-this.mean,2);this.O=r/(this.values.length-((null===(t=this.options)||void 0===t?void 0:t.forPopulation)?0:1))}return this.O}get stddev(){return X(this.N)&&(this.N=Math.sqrt(this.variance)),this.N}}var Ir;!function(t){t.RGB="RGB",t.RGBA="RGBA",t.HSL="HSL",t.HSLA="HSLA",t.FFF="FFF",t.FFFF="FFFF",t.FFFFFF="FFFFFF",t.FFFFFFFF="FFFFFFFF"}(Ir||(Ir={}));const Rr=new St((()=>{const t="black,000000;silver,c0c0c0;gray,808080;white,ffffff;maroon,800000;red,ff0000;purple,800080;fuchsia,ff00ff;green,008000;lime,00ff00;olive,808000;yellow,ffff00;navy,000080;blue,0000ff;teal,008080;aqua,00ffff;aliceblue,f0f8ff;antiquewhite,faebd7;aqua,00ffff;aquamarine,7fffd4;azure,f0ffff;beige,f5f5dc;bisque,ffe4c4;black,000000;blanchedalmond,ffebcd;blue,0000ff;blueviolet,8a2be2;brown,a52a2a;burlywood,deb887;cadetblue,5f9ea0;chartreuse,7fff00;chocolate,d2691e;coral,ff7f50;cornflowerblue,6495ed;cornsilk,fff8dc;crimson,dc143c;cyan,00ffff;darkblue,00008b;darkcyan,008b8b;darkgoldenrod,b8860b;darkgray,a9a9a9;darkgreen,006400;darkgrey,a9a9a9;darkkhaki,bdb76b;darkmagenta,8b008b;darkolivegreen,556b2f;darkorange,ff8c00;darkorchid,9932cc;darkred,8b0000;darksalmon,e9967a;darkseagreen,8fbc8f;darkslateblue,483d8b;darkslategray,2f4f4f;darkslategrey,2f4f4f;darkturquoise,00ced1;darkviolet,9400d3;deeppink,ff1493;deepskyblue,00bfff;dimgray,696969;dimgrey,696969;dodgerblue,1e90ff;firebrick,b22222;floralwhite,fffaf0;forestgreen,228b22;fuchsia,ff00ff;gainsboro,dcdcdc;ghostwhite,f8f8ff;gold,ffd700;goldenrod,daa520;gray,808080;green,008000;greenyellow,adff2f;grey,808080;honeydew,f0fff0;hotpink,ff69b4;indianred,cd5c5c;indigo,4b0082;ivory,fffff0;khaki,f0e68c;lavender,e6e6fa;lavenderblush,fff0f5;lawngreen,7cfc00;lemonchiffon,fffacd;lightblue,add8e6;lightcoral,f08080;lightcyan,e0ffff;lightgoldenrodyellow,fafad2;lightgray,d3d3d3;lightgreen,90ee90;lightgrey,d3d3d3;lightpink,ffb6c1;lightsalmon,ffa07a;lightseagreen,20b2aa;lightskyblue,87cefa;lightslategray,778899;lightslategrey,778899;lightsteelblue,b0c4de;lightyellow,ffffe0;lime,00ff00;limegreen,32cd32;linen,faf0e6;magenta,ff00ff;maroon,800000;mediumaquamarine,66cdaa;mediumblue,0000cd;mediumorchid,ba55d3;mediumpurple,9370db;mediumseagreen,3cb371;mediumslateblue,7b68ee;mediumspringgreen,00fa9a;mediumturquoise,48d1cc;mediumvioletred,c71585;midnightblue,191970;mintcream,f5fffa;mistyrose,ffe4e1;moccasin,ffe4b5;navajowhite,ffdead;navy,000080;oldlace,fdf5e6;olive,808000;olivedrab,6b8e23;orange,ffa500;orangered,ff4500;orchid,da70d6;palegoldenrod,eee8aa;palegreen,98fb98;paleturquoise,afeeee;palevioletred,db7093;papayawhip,ffefd5;peachpuff,ffdab9;peru,cd853f;pink,ffc0cb;plum,dda0dd;powderblue,b0e0e6;purple,800080;red,ff0000;rosybrown,bc8f8f;royalblue,4169e1;saddlebrown,8b4513;salmon,fa8072;sandybrown,f4a460;seagreen,2e8b57;seashell,fff5ee;sienna,a0522d;silver,c0c0c0;skyblue,87ceeb;slateblue,6a5acd;slategray,708090;slategrey,708090;snow,fffafa;springgreen,00ff7f;steelblue,4682b4;tan,d2b48c;teal,008080;thistle,d8bfd8;tomato,ff6347;turquoise,40e0d0;violet,ee82ee;wheat,f5deb3;white,ffffff;whitesmoke,f5f5f5;yellow,ffff00;yellowgreen,9acd32".split(/;/g),r={};for(const e of t){const[t,n]=e.split(",");r[t]=n,r[n]=t}return r}));function $r(t,r,e,n,i){"alpha"===t&&B(i)&&/%/.test(i)&&(e=100),Tr(n,r,e)&&q(`Expected ${t} value to be equal to or between ${r} and ${e} but got: ${B(i)?`"${i}"`:`\`${i}\``}`)}const Mr="red",Dr="green",Lr="blue",_r="alpha",xr="hue",kr="saturation",Fr="lightness";var Br;!function(t){t.fromHSLToRGB=function(t,r,e){e/=100;const n=r=>(r+t/30)%12,i=(r/=100)*Math.min(e,1-e),o=t=>e-i*Math.max(-1,Math.min(n(t)-3,Math.min(9-n(t),1)));return[Math.round(255*o(0)),Math.round(255*o(8)),Math.round(255*o(4))]},t.fromRGBToHSL=function(t,r,e){const n=t/Pr.MAX_RGB_VALUE,i=r/Pr.MAX_RGB_VALUE,o=e/Pr.MAX_RGB_VALUE,s=Math.max(n,i,o),a=Math.min(n,i,o),u=new Nr([s,a]).mean,c=s-a,h=s===a?0:u<=.5?c/(s+a):c/(2-s-a),l=0===c?1:c,f=n===s?(i-o)/l:i===s?2+(o-n)/l:4+(n-i)/l;return[Math.round(60*(f<0?f+Pr.MAX_HUE_VALUE:f)%360),Math.round(h*Pr.MAX_SATURATION_VALUE),Math.round(u*Pr.MAX_LIGHTNESS_VALUE)]},t.getLuminance=function(t,r,e){return.21*t+.72*r+.07*e},t.createContrastingValue=function({light:t,dark:r,threshold:e=127}){return n=>{B(n)&&(n=Pr.fromString(n));const i=qt(e,Pr.MIN_RGB_VALUE,Pr.MAX_RGB_VALUE);return n.luminance>=i?t:r}}}(Br||(Br={}));class Pr{static fromRGB(t,r,e,n){if(x(t))return Pr.fromRGBValues(t,r,e,n);if(B(t))return Pr.fromRGBString(t);if(k(t))return Pr.fromRGBObject(t);throw l&&q(["Invalid RGB parameter.","","Usage:",` - Values, example: ${Pr.fromRGB.name}(255, 255, 255)`,` - String, example: ${Pr.fromRGB.name}('rgb(255,255,255)')`,` - Object, example: ${Pr.fromRGB.name}({ red: 255, green: 255, blue: 255 })`].join("\n")),new Error("Invalid RGB parameter")}static fromRGBString(t){const[r,e,n,i,o,s,a,u]=function(t){if(!/^rgba?\(\s*\d{1,3}\s+\d{1,3}\s+\d{1,3}(\s+(\d+%|[\d.]+))?\s*\)$/i.test(t.replace(/[,/]/g," ")))throw new Error(`Invalid RGB string '${t}'`);t=t.replace(/[,/]/g," ");const[r,e,n,i]=t.match(/\d{1,3}\s+\d{1,3}\s+\d{1,3}(\s+(\d+%|[\d.]+))?/i)[0].split(/\s+/g);return[Number(r),r,Number(e),e,Number(n),n,i?Number(i.match(/[\d.]+/)[0]):null,null!=i?i:null]}(t);$r(Mr,...Ur.red,r,e),$r(Dr,...Ur.green,n,i),$r(Lr,...Ur.blue,o,s),u&&$r(_r,...Ur.alpha,a,u);const c=new Pr;return c.R={...c.R,red:r,green:n,blue:o,...G(u)?{}:{alpha:/%/.test(u)?a/100:a}},c}static fromRGBObject(t){const{red:r,green:e,blue:n,alpha:i}=t;return Pr.fromRGBValues(r,e,n,i)}static fromRGBValues(t,r,e,n){$r(Mr,...Ur.red,t,t),$r(Dr,...Ur.green,r,r),$r(Lr,...Ur.blue,e,e),n&&$r(_r,...Ur.alpha,n,n);const i=new Pr;return i.R={...i.R,red:t,green:r,blue:e,...G(n)?{}:{alpha:n}},i}static fromHSL(t,r,e,n){if(x(t))return Pr.fromHSLValues(t,r,e,n);if(B(t))return Pr.fromHSLString(t);if(k(t))return Pr.fromHSLObject(t);throw l&&q(["Invalid HSL parameter.","","Usage:",` - Values, example: ${Pr.fromHSL.name}(255, 100, 100)`,` - String, example: ${Pr.fromHSL.name}('hsl(0,100%,100%)')`,` - Object, example: ${Pr.fromHSL.name}({ hue: 255, saturation: 100, lightness: 100 })`].join("\n")),new Error("Invalid HSL parameter")}static fromHSLString(t){const[r,e,n,i,o,s,a,u]=function(t){if(t=t.replace(/[,/]/g," "),!/^hsla?\(\s*([\d.]+(deg|rad)?|none)\s+[\d.]+%?\s+[\d.]+%?(\s+[\d.]+%?)?\s*\)$/i.test(t))throw new Error(`Invalid HSL string '${t}'`);const[r,e,n,i]=t.match(/([\d.]+(deg|rad)?|none)\s+[\d.]+%?\s+[\d.]+%?(\s+[\d.]+%?)?/i)[0].split(/\s+/g),o=r.match(/[\d.]+/);return[(null==o?void 0:o[0])?Number(o[0]):0,r,Number(e.match(/[\d.]+/)[0]),e,Number(n.match(/[\d.]+/)[0]),n,i?Number(i.match(/[\d.]+/)[0]):null,null!=i?i:null]}(t);$r(xr,...Ur.hue,r,e),$r(kr,...Ur.saturation,n,i),$r(Fr,...Ur.lightness,o,s),u&&$r(_r,...Ur.alpha,a,u);const c=new Pr;return c.R={...c.R,hue:r,saturation:n,lightness:o,...G(u)?{}:{alpha:/%/.test(u)?a/100:a}},c}static fromHSLObject(t){const{hue:r,saturation:e,lightness:n,alpha:i}=t;return Pr.fromHSLValues(r,e,n,i)}static fromHSLValues(t,r,e,n){$r(xr,...Ur.hue,t,t),$r(kr,...Ur.saturation,r,r),$r(Fr,...Ur.lightness,e,e),n&&$r(_r,...Ur.alpha,n,n);const i=new Pr;return i.R={...i.R,hue:t,saturation:r,lightness:e,...G(n)?{}:{alpha:n}},i}static fromHex(t){const[r,e,n,i,o,s,a,u]=function(t){if(!/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.test(t))throw new Error(`Invalid hex code '${t}'`);if((t=t.match(/[\da-f]+/i)[0]).length<=4){const[r,e,n,i]=t;return[parseInt(`${r}${r}`,16),r,parseInt(`${e}${e}`,16),e,parseInt(`${n}${n}`,16),n,i?parseInt(`${i}${i}`,16)/255:null,null!=i?i:null]}{const[r,e,n,i,o,s,a,u]=t,c=`${r}${e}`,h=`${n}${i}`,l=`${o}${s}`,f=`${a}${u}`;return[parseInt(c,16),c,parseInt(h,16),h,parseInt(l,16),l,u?parseInt(f,16)/255:null,u?f:null]}}(t);$r(Mr,...Ur.red,r,e),$r(Dr,...Ur.green,n,i),$r(Lr,...Ur.blue,o,s),u&&$r("alpha",...Ur.alpha,a,u);const c=new Pr;return c.R={...c.R,red:r,green:n,blue:o,...G(u)?{}:{alpha:a}},c}static fromString(t){if(/^#/.test(t))return Pr.fromHex(t);if(/^rgb/i.test(t))return Pr.fromRGBString(t);if(/^hsl/i.test(t))return Pr.fromHSLString(t);throw new Error(`Invalid color syntax '${t}'`)}static fromJSON(t){if(Z(t,Mr))return Pr.fromRGBObject(t);if(Z(t,xr))return Pr.fromHSLObject(t);throw new Error(`Invalid object: ${wt(t)}`)}constructor(){this.R={...Pr.$},this._=()=>{const[t,r,e]=Br.fromHSLToRGB(this.R.hue,this.R.saturation,this.R.lightness);this.R.red=t,this.R.green=r,this.R.blue=e},this.P=()=>{const[t,r,e]=Br.fromRGBToHSL(this.R.red,this.R.green,this.R.blue);this.R.hue=t,this.R.saturation=r,this.R.lightness=e},this.U=()=>"#"+this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0"),this.X=()=>this.U()+Math.round(this.alpha*Pr.MAX_RGB_VALUE).toString(16).padStart(2,"0"),this.V=(t,r,e)=>{const n=[this.red,this.green,this.blue];return r&&n.push(parseFloat(this.alpha.toFixed(e))),`rgb${t?"a":""}(${n.join(", ")})`},this.Y=(t,r,e)=>{const n=[`${this.hue}deg`,`${this.saturation}%`,`${this.lightness}%`];return r&&n.push(parseFloat(this.alpha.toFixed(e))),`hsl${t?"a":""}(${n.join(", ")})`}}get isInvalid(){if(H(this.R.red)){if(!H(this.R.hue)&&(Tr(this.R.hue,...Ur.hue)||Tr(this.R.saturation,...Ur.saturation)||Tr(this.R.lightness,...Ur.lightness)))return!0}else if(Tr(this.R.red,...Ur.red)||Tr(this.R.blue,...Ur.blue)||Tr(this.R.green,...Ur.green))return!0;return!!Tr(this.R.alpha,...Ur.alpha)}get red(){return H(this.R.red)&&this._(),this.R.red}get green(){return H(this.R.green)&&this._(),this.R.green}get blue(){return H(this.R.blue)&&this._(),this.R.blue}get alpha(){return this.R.alpha}get hue(){return H(this.R.hue)&&this.P(),this.R.hue}get saturation(){return H(this.R.saturation)&&this.P(),this.R.saturation}get lightness(){return H(this.R.lightness)&&this.P(),this.R.lightness}get luminance(){return Br.getLuminance(this.red,this.green,this.blue)}toJSON(){return{red:this.red,green:this.green,blue:this.blue,alpha:this.alpha,hue:this.hue,saturation:this.saturation,lightness:this.lightness,luminance:this.luminance}}toString(t=Ir.FFFFFF,r){var e;if(this.isInvalid)return"#InvalidColor";const n=null==r?void 0:r.suppressAlphaInShortFormats;if(t===Ir.FFFFFF){if(this.alpha===Pr.MAX_ALPHA_VALUE||n)return this.U();t=Ir.FFFFFFFF}if(t===Ir.FFFFFFFF)return this.X();if(t===Ir.FFF){if(this.alpha===Pr.MAX_ALPHA_VALUE||n){let t;const r=this.U();return t=r[1]===r[2]&&r[3]===r[4]&&r[5]===r[6]?"#"+r[1]+r[3]+r[5]:r,t}t=Ir.FFFF}if(t===Ir.FFFF){let t;const r=this.X();return t=r[1]===r[2]&&r[3]===r[4]&&r[5]===r[6]&&r[7]===r[8]?"#"+r[1]+r[3]+r[5]+r[7]:r,t}const i=null!==(e=null==r?void 0:r.truncateDecimals)&&void 0!==e?e:3;if(t===Ir.RGB)return this.V(0,this.alpha===Pr.MAX_ALPHA_VALUE||n?0:1,i);if(t===Ir.RGBA)return this.V(1,1,i);if(t===Ir.HSL)return this.Y(0,this.alpha===Pr.MAX_ALPHA_VALUE||n?0:1,i);if(t===Ir.HSLA)return this.Y(1,1,i);throw new Error(`Invalid format '${t}'`)}valueOf(){return this.toString()}}Pr.MIN_ALPHA_VALUE=0,Pr.MAX_ALPHA_VALUE=1,Pr.MIN_RGB_VALUE=0,Pr.MAX_RGB_VALUE=255,Pr.MIN_HUE_VALUE=0,Pr.MAX_HUE_VALUE=360,Pr.MIN_SATURATION_VALUE=0,Pr.MAX_SATURATION_VALUE=100,Pr.MIN_LIGHTNESS_VALUE=0,Pr.MAX_LIGHTNESS_VALUE=100,Pr.$={red:null,green:null,blue:null,alpha:Pr.MAX_ALPHA_VALUE,hue:null,saturation:null,lightness:null};const Ur={red:[Pr.MIN_RGB_VALUE,Pr.MAX_RGB_VALUE],green:[Pr.MIN_RGB_VALUE,Pr.MAX_RGB_VALUE],blue:[Pr.MIN_RGB_VALUE,Pr.MAX_RGB_VALUE],alpha:[Pr.MIN_ALPHA_VALUE,Pr.MAX_ALPHA_VALUE],hue:[Pr.MIN_HUE_VALUE,Pr.MAX_HUE_VALUE],saturation:[Pr.MIN_SATURATION_VALUE,Pr.MAX_SATURATION_VALUE],lightness:[Pr.MIN_LIGHTNESS_VALUE,Pr.MAX_LIGHTNESS_VALUE]};var Xr;!function(t){t.fromCSSName=function(t){return t=t.toLowerCase(),Rr.value[t]?Pr.fromHex(`#${Rr.value[t]}`):null},t.toCSSName=function(t){var r;let e;return e=B(t)?/^#([\da-f]{6,})$/i.test(t)?t.replace("#","").substring(0,6):Pr.fromString(t).toString(Ir.FFFFFF):t.toString(Ir.FFFFFF),e&&null!==(r=Rr.value[e.replace("#","")])&&void 0!==r?r:null}}(Xr||(Xr={}));class Hr{constructor(t){t.Timestamp&&(this.Timestamp=t.Timestamp),t.DateTime&&(this.DateTime=t.DateTime),this.DateTimeToHTMLInputString=this.DateTimeToHTMLInputString.bind(this),this.DateTimeToSQLString=this.DateTimeToSQLString.bind(this),this.DateTimeToTimestamp=this.DateTimeToTimestamp.bind(this),this.HTMLInputStringToDateTime=this.HTMLInputStringToDateTime.bind(this),this.SQLStringToDateTime=this.SQLStringToDateTime.bind(this),this.TimestampToDateTime=this.TimestampToDateTime.bind(this)}DateTimeToHTMLInputString(t){return t.toFormat("yyyy-LL-dd")+"T"+t.toFormat("HH:mm")}DateTimeToSQLString(t){return t?t.toSQL():null}DateTimeToTimestamp(t){return t?this.Timestamp.fromMillis(t.toMillis()):null}HTMLInputStringToDateTime(t){return this.DateTime.fromISO(t)}SQLStringToDateTime(t){return t?this.DateTime.fromSQL(t):null}TimestampToDateTime(t){return t?this.DateTime.fromMillis(t.toMillis()):null}}class Gr{constructor(t=Gr.MINIMUM_CACHE_SIZE){this.cacheSize=t,this.W=[],this.Z=!1,t<Gr.MINIMUM_CACHE_SIZE&&q(`Expected \`cacheSize\` to be at least ${Gr.MINIMUM_CACHE_SIZE}but got ${t}. Automatically setting to ${Gr.MINIMUM_CACHE_SIZE}.`),this.cacheSize=Math.max(t,Gr.MINIMUM_CACHE_SIZE)}mark(t){t!==Gr.MAX_PROGRESS?this.W=g(this.cacheSize,[[qt(t,Gr.MIN_PROGRESS,Gr.MAX_PROGRESS),Date.now()]],this.W):this.Z=!0}getEstimation(){if(this.Z)return 0;if(this.W.length<Gr.MINIMUM_CACHE_SIZE)return 1/0;let t=0;for(let r=1;r<this.W.length;r++){const[e,n]=this.W[r-1],[i,o]=this.W[r];t+=(i-e)/(o-n)}const r=t/(this.W.length-1);if(r<=0)return 1/0;const[e]=this.W[this.W.length-1],n=(Gr.MAX_PROGRESS-e)/r;return Math.round(n)}reset(){this.Z=!1,this.W=[]}}Gr.MIN_PROGRESS=0,Gr.MAX_PROGRESS=100,Gr.MINIMUM_CACHE_SIZE=2;const jr={height:0,width:0};function Vr(){return{height:window.screen.height,width:window.screen.width}}function zr(){return"undefined"!=typeof document?{height:document.documentElement.clientHeight,width:document.documentElement.clientWidth}:jr}class Yr{constructor(t){this.element=t}observe(t){let r=null;const e=()=>{const e=this.element.getBoundingClientRect(),n={height:e.height,left:e.left,top:e.top,width:e.width};Ct(r,n)||(r=n,t(n))};let n=0;const i=setInterval((()=>{e(),n++>9&&clearInterval(i)}),10),o=setInterval(e,100);return()=>{clearInterval(i),clearInterval(o)}}}var qr,Qr;function Wr(t){return t.readyState>=qr.HAVE_ENOUGH_DATA?Promise.resolve():new Promise((r=>{const e=()=>{t.removeEventListener("loadeddata",e),r()};t.addEventListener("loadeddata",e)}))}function Jr(t){return t.readyState>=qr.HAVE_ENOUGH_DATA&&!t.paused&&!t.ended}function Kr(t){return Jr(t)?Promise.resolve():new Promise((r=>{const e=()=>{t.removeEventListener("play",e),r()};t.addEventListener("play",e)}))}!function(t){t[t.HAVE_NOTHING=0]="HAVE_NOTHING",t[t.HAVE_METADATA=1]="HAVE_METADATA",t[t.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",t[t.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",t[t.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"}(qr||(qr={})),function(t){t.ASCII="ascii",t.UTF_8="utf-8",t.UTF_16LE="utf-16le",t.UCS_2="ucs-2",t.BASE_64="base64",t.LATIN_1="latin1",t.BINARY="binary",t.HEX="hex"}(Qr||(Qr={}));class Zr extends Error{}class te extends Error{}function re(t,r){let e;return(...n)=>{clearTimeout(e),e=setTimeout((()=>{t(...n)}),r)}}function ee(t,r){let e;return(...n)=>(clearTimeout(e),new Promise((i=>{e=setTimeout((()=>{i(t(...n))}),r)})))}function ne(t){return new Promise((r=>{setTimeout((()=>{r()}),t)}))}function ie(t){return t<=0?Promise.resolve():new Promise((r=>{let e=0;const n=()=>{e++>=t?r():requestAnimationFrame(n)};requestAnimationFrame(n)}))}class oe{constructor(t){this.time=t}now(){return new Promise((t=>{this.tt=t,this.rt=setTimeout((()=>{t()}),this.time)}))}add(t){}cancel(){clearTimeout(this.rt),this.tt()}}class se{constructor(t){this.callback=t}start(t){this.stop(),this.et=setInterval(this.callback,t)}stop(){clearInterval(this.et)}}class ae{constructor(t,r){this.nt=()=>{if(x(this.it))return this.it;if(D(this.it)){const t=this.it();if(!x(t))throw new Error(`Generated interval is invalid: ${String(t)}`);return t}throw new Error(`Invalid interval: ${String(this.it)}`)},this.ot=async()=>{for(;this.st;){const t=this.ut(),r=ne(this.nt());await Promise.all([t,r])}},this.ut=t,this.it=r,this.start=this.start.bind(this),this.stop=this.stop.bind(this)}async start(){this.st?q(`${ae.name} is already running.`):(this.st=!0,await this.ot())}stop(){this.st=!1}}class ue{constructor(t){this.generator=t,this.ct=new Set,this.create=this.create.bind(this),this.untrack=this.untrack.bind(this),this.reset=this.reset.bind(this),this.track=this.track.bind(this)}create(...t){let r,e=0;for(r=this.generator(e,...t);this.has(r);)r=this.generator(++e,...t);return this.track(r),r}untrack(t){this.ct.delete(t)}get history(){return[...this.ct.values()]}reset(){this.ct.clear()}track(...t){for(const r of t)this.ct.add(r)}has(t){return this.ct.has(t)}}const ce={DEFAULT:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",NUMERIC:"0123456789",HEX_LOWER:"0123456789abcdef",HEX_UPPER:"0123456789ABCDEF",ALPHABET_LOWER:"abcdefghijklmnopqrstuvwxyz",ALPHABET_UPPER:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",ALPHANUMERIC_LOWER:"abcdefghijklmnopqrstuvwxyz0123456789",ALPHANUMERIC_UPPER:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"};function he(...t){return v(t.join("").split("")).join("")}const le=ce.ALPHABET_LOWER,fe=ce.DEFAULT;class de extends ue{static create(t){let r=A(le);for(;r.length<t;)r+=A(fe);return r}constructor(t,r=.8){super(((t,e)=>{const n=Math.pow(fe.length,e),i=t/n>=r;return de.create(e+(i?Math.ceil(t/n):0))})),this.minimumLength=t,this.bumpThreshold=r,this.minimumLength=Math.max(0,t)}create(t){return super.create(t||this.minimumLength)}}const pe=new de(6);class ge extends ue{static create(t,r=ce.DEFAULT){let e="";for(;e.length<t;)e+=A(r);return e}constructor(t,r,e=.8){super(((t,r,n)=>{const i=Math.pow(n.length,r),o=t/i>=e;return ge.create(r+(o?Math.ceil(t/i):0),n)})),this.minimumLength=t,this.charset=r,this.bumpThreshold=e,this.charset=r||ce.DEFAULT,this.minimumLength=Math.max(0,t)}create(t,r){return super.create(t||this.minimumLength,r||this.charset)}}class me extends ue{static create(){return[ge.create(8,ce.HEX_LOWER),ge.create(4,ce.HEX_LOWER),ge.create(4,ce.HEX_LOWER),ge.create(4,ce.HEX_LOWER),ge.create(12,ce.HEX_LOWER)].join("-")}constructor(){super(me.create)}create(){return super.create()}}class be{constructor(r,e){this.ht=new me,this.lt=new Set,this.isOccupied=new t(!1),this.activationKey=null!=r?r:be.DEFAULT_ACTIVATION_KEY,a&&1!==this.activationKey.length&&Y(`Expected chordActivationKey to be precisely 1 letter but received "${this.activationKey}" (${this.activationKey.length} letters)`),this.timeout=null!=e?e:be.DEFAULT_TIMEOUT,a&&wr(this.timeout)&&Y(`Expected timeout to be greater than 0 but got ${this.timeout}`),this.occupyKeyChord=this.occupyKeyChord.bind(this),this.dispose=this.dispose.bind(this)}occupyKeyChord(){const t=this.ht.create();return this.lt.add(t),this.ft(),()=>{this.lt.delete(t),this.ft(),this.ht.untrack(t)}}dispose(){this.isOccupied.dispose()}ft(){this.isOccupied.set(this.lt.size>0)}}var Ee;be.DEFAULT_ACTIVATION_KEY="k",be.DEFAULT_TIMEOUT=3e3,function(t){t.Alt="Alt",t.ArrowDown="ArrowDown",t.ArrowLeft="ArrowLeft",t.ArrowRight="ArrowRight",t.ArrowUp="ArrowUp",t.Backspace="Backspace",t.Control="Control",t.CapsLock="CapsLock",t.Enter="Enter",t.Escape="Escape",t.F1="F1",t.F2="F2",t.F3="F3",t.F4="F4",t.F5="F5",t.F6="F6",t.F7="F7",t.F8="F8",t.F9="F9",t.F10="F10",t.F11="F11",t.F12="F12",t.Meta="Meta",t.Shift="Shift",t.Space=" ",t.Tab="Tab"}(Ee||(Ee={}));class ve{constructor(t,r){this.callback=t,this.triggerTime=r,this.dt=!1}run(){const t=Math.max(0,this.triggerTime.getTime()-(new Date).getTime());this.gt=setTimeout((()=>{this.callback(),this.dt=!0}),t)}cancel(){clearTimeout(this.gt),this.dt=!0}flush(){this.cancel(),this.dt||this.callback()}}class Te{constructor(){this.bt=[],this.Et=!1,this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.now=this.now.bind(this)}get isRunning(){return this.Et}start(){this.Et?a&&q(`Attempted to start a ${Te.name} that has already been started`):(this.bt.push([performance.now(),null]),this.Et=!0)}stop(){if(!this.Et)return void(a&&q(`Attempted to stop a ${Te.name} that has already been stopped`));const[t]=this.bt[this.bt.length-1];this.bt[this.bt.length-1]=[t,performance.now()],this.Et=!1}now(){let t=0;for(const[r,e]of this.bt)t+=(null!=e?e:performance.now())-r;return t}}class Ce{constructor(){this.vt={},this.Tt=0,this.Ct=0,this.wt=0}watch(t){const r=++this.wt;this.vt[r]=t,this.Tt+=1;return()=>{this.vt[r]&&(delete this.vt[r],this.Ct+=1)}}unwatchAll(){const t=Object.keys(this.vt).length;this.vt={},this.Ct+=t}refresh(...t){const r=Object.values(this.vt);for(let e=0;e<r.length;e++)r[e](...t)}get stats(){return{count:{active:this.Tt,expired:this.Ct}}}}class we extends Ce{constructor(t){super(),this.watchers=[],this.unwatchList=[],this.watchers=t,this.yt=this.refresh,this.refresh=()=>{throw new Error("AggregateWatcher does not allow triggering refreshes externally")};for(const t of this.watchers){const r=t.watch(((...t)=>{this.yt(...t)}));this.unwatchList.push(r)}}unwatchAll(){for(const t of this.unwatchList)t();super.unwatchAll()}}class ye{static now(){throw new Zr}static fromDate(t){throw new Zr}static fromMillis(t){throw new Zr}constructor(t,r){throw new Zr}toDate(){throw new Zr}toMillis(){throw new Zr}isEqual(t){throw new Zr}toString(){return""}valueOf(){throw new Zr}}function Se(t){try{const r=t();if(U(r))return new Promise((t=>{r.then((()=>{t()}))}))}catch(t){}}const Oe=new Set("a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,big,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1> to <h6,head,header,hgroup,hr,html,i,iframe,img,input,ins,kbd,label,legend,li,link,main,map,mark,menu,meta,meter,nav,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,pre,progress,q,rp,rt,ruby,s,samp,script,search,section,select,small,source,span,strike,strong,style,sub,summary,sup,svg,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr".split(","));var Ae,Ne,Ie;function Re(t,r){const e=t.querySelectorAll(r);return e.item(e.length-1)}!function(t){t.CONNECT="CONNECT",t.DELETE="DELETE",t.GET="GET",t.HEAD="HEAD",t.OPTIONS="OPTIONS",t.PATCH="PATCH",t.POST="POST",t.PUT="PUT",t.TRACE="TRACE"}(Ae||(Ae={})),function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLY_HINTS=103]="EARLY_HINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.MULTI_STATUS=207]="MULTI_STATUS",t[t.ALREADY_REPORTED=208]="ALREADY_REPORTED",t[t.IM_USED=226]="IM_USED",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.USE_PROXY_DEPRECATED=305]="USE_PROXY_DEPRECATED",t[t.UNUSED=306]="UNUSED",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.URI_TOO_LONG=414]="URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.TOO_EARLY_EXPERIMENTAL=425]="TOO_EARLY_EXPERIMENTAL",t[t.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",t[t.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",t[t.INTERNAL_ERROR=500]="INTERNAL_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.LOOP_DETECTED=508]="LOOP_DETECTED",t[t.NOT_EXTENDED=510]="NOT_EXTENDED",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(Ne||(Ne={})),function(t){t[t.INTERNAL=-1]="INTERNAL",t[t.LOW=1]="LOW",t[t.HIGH=2]="HIGH"}(Ie||(Ie={}));const $e="data-precedence-level",Me=`style[${$e}="${Ie.INTERNAL}"]`,De=`style[${$e}="${Ie.LOW}"]`;function Le(t,r,e){null!=r||(r=Ie.HIGH);const n=document.createElement("style");if(n.innerHTML=t,n.setAttribute($e,String(r)),e&&(e.current=n),r===Ie.INTERNAL){const t=Re(document.head,Me);if(t)t.insertAdjacentElement("afterend",n);else{const t=document.head.querySelector(["style",'link[rel="stylesheet"]','link[rel="preload"][as="style"]'].join(","));document.head.insertBefore(n,t)}}else if(r===Ie.LOW){const t=Re(document.head,De);if(t)t.insertAdjacentElement("afterend",n);else{const t=document.head.querySelector([`style:not([${$e}^="${Ie.INTERNAL}"])`,'link[rel="stylesheet"]','link[rel="preload"][as="style"]'].join(","));document.head.insertBefore(n,t)}}else document.head.append(n);return()=>{e&&(e.current=null),n.remove()}}function _e(t){return`${t}ms`}const xe=/^--/,ke=/^O/,Fe=/^(moz|ms|o|webkit)(?=-)/;function Be(t){if(xe.test(t))return t;ke.test(t)&&(t=t.replace(ke,"o-"));let r=t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase();return r.match(Fe)&&(r=`-${r}`),r}function Pe(t){return x(t)?`${t}px`:t}const Ue=/(gap|height|margin|padding|position|radius|size|spacing|width)/i;function Xe(t,r){return Ue.test(t)?Pe(r):String(r)}function He(t){return/^[a-z]/.test(t)?`.${t}`:t}const Ge=Gt(null),je=Gt(null);function Ve(t){if(!a)return!0;if(/^(\.|#)/.test(t)||Oe.has(t)||je.current.has(t))return!0;for(const r of Ge.current)if(r.test(t))return!0;return!1}function ze(...t){if(a)for(const r of t)B(r)?je.current.add(r):Ge.current.push(r)}function Ye(t){const r={};for(const e in t){const n=t[e],i=Be(e);r[i]=Xe(i,n)}return r}a&&(Ge.current=[],je.current=new Set),ze.displayName="ignoreWhenCompilingStyles";const qe=n([e({grid:"autoplace",overrideBrowserslist:"production"===process.env.NODE_ENV?[">0.5%","not dead","not op_mini all"]:["last 3 chrome version","last 3 firefox version","last 5 safari version"]})]);function Qe(t){const r=[];for(const e in t){const n=t[e],i=Be(e);r.push(`${i}:${Xe(i,n)}`)}return qe.process(r.join(";")).css}const We=a?new Set:null;function Je(t,r){if(a&&!je.current.has("*")){const r=t.split(/\s*[\s>+~,]\s*/g);for(const t of r){const r=t.replace(/:.+$/,"");We.has(r)||(Ve(r)||Y(`Found unrecognized element "${r}" when compiling styles. If this was intentional or if it is a valid web component, you can suppress this warning by calling ${e=ze,n=void 0,null!==(n=e.displayName)&&void 0!==n?n:e.name}(['${r}'])`),We.add(r))}}var e,n;return`${t}{${Qe(r)}}`}function Ke(t,r){const e=[];for(const r in t){const n=t[r];e.push(`--${r}:${Xe(r,n)}`)}const n=e.join(";");return r?`${He(r)}{${n}}`:n}function Ze(...t){return t.filter((t=>!!t)).join(" ").trim().replace(/\s+/g," ")}const tn=Ze,rn={VERY_SHORT:50,SHORT:100,MEDIUM:200,LONG:300,VERY_LONG:500,EXTRA_LONG:750,QUARTER_SECOND:750,ONE_SECOND:1e3},en={None:0,XXS:2,XS:3,S:5,M:10,L:15,XL:20,XXL:40,XXXL:60},nn={TOP:"env(safe-area-inset-top)",LEFT:"env(safe-area-inset-left)",RIGHT:"env(safe-area-inset-right)",BOTTOM:"env(safe-area-inset-bottom)"};function on(t){return t+"px"}function sn(t){return t+"pt"}function an(t){return t+"em"}function un(t){return t+"rem"}function cn(t){return t+"fr"}function hn(t){return t+"vh"}function ln(t){return t+"vw"}function fn(t){return t+"vmin"}function dn(t){return t+"vmax"}function pn(t){return t+"%"}const gn=/^--/;function mn(t,r){const e=[];for(const n in t){const i=t[n],o=gn.test(n)?n:`--${n}`;e.push(o),r.style.setProperty(o,Xe(n,i))}return()=>{for(const t of e)r.style.removeProperty(t)}}function bn(t,r,e=Ie.HIGH){const n=pe.create(),i=Le(Ke(t,n),e);return null!=r||(r=document.body),r.classList.add(n),()=>{r.classList.remove(n),i()}}class En extends Map{compile(){const t=[];return this.forEach(((r,e)=>{t.push(Je(e,r))})),t.join("")}}class vn extends En{constructor(t=[],r){super(),this.precedenceLevel=r,this.St=new Map;const e=Gt(null);this.Ot=o((()=>Le(this.At(),r,e))),this.element=e.current;for(const[r,e]of t)this.set(r,e)}set(t,r){return super.set(t,r),this.St.set(t,Je(t,r)),this.element.innerHTML=this.At(),this}delete(t){const r=super.delete(t);return this.St.delete(t),this.element.innerHTML=this.At(),r}clear(){super.clear(),this.St.clear(),this.element.innerHTML=""}dispose(){var t;this.clear(),this.St.clear(),null===(t=this.Ot)||void 0===t||t.call(this)}At(){return[...this.St.values()].join("")}}const Tn={hidden:"hidden",noScroll:"noScroll",a:"a"};var Cn,wn;o((()=>{Le(new En([[`.${Tn.hidden}`,{left:0,opacity:0,pointerEvents:"none",position:"fixed",top:0,zIndex:-9999}],[`.${Tn.noScroll}`,{overflow:"hidden"}]]).compile(),Ie.INTERNAL)})),function(t){t.dark="dark",t.light="light"}(Cn||(Cn={})),function(t){t.dark="dark",t.light="light",t.auto="auto"}(wn||(wn={}));const yn={spacingNone:"var(--spacingNone)",spacingXXXS:"var(--spacingXXXS)",spacingXXS:"var(--spacingXXS)",spacingXS:"var(--spacingXS)",spacingS:"var(--spacingS)",spacingM:"var(--spacingM)",spacingL:"var(--spacingL)",spacingXL:"var(--spacingXL)",spacingXXL:"var(--spacingXXL)",spacingXXXL:"var(--spacingXXXL)",durationVeryShort:"var(--durationVeryShort)",durationShort:"var(--durationShort)",durationMedium:"var(--durationMedium)",durationLong:"var(--durationLong)",durationVeryLong:"var(--durationVeryLong)",durationExtraLong:"var(--durationExtraLong)",primaryColor:"var(--primaryColor)",primaryColorLighter:"var(--primaryColorLighter)",primaryColorDarker:"var(--primaryColorDarker)",primaryColor20:"var(--primaryColor20)",primaryColor40:"var(--primaryColor40)",primaryColor60:"var(--primaryColor60)",primaryColor80:"var(--primaryColor80)",primaryTextColor:"var(--primaryTextColor)",primaryTextColorLighter:"var(--primaryTextColorLighter)",primaryTextColorDarker:"var(--primaryTextColorDarker)",appBgColor:"var(--appBgColor)",appBgColor2:"var(--appBgColor2)",appBgColor3:"var(--appBgColor3)",appBgColor4:"var(--appBgColor4)",appTextColor:"var(--appTextColor)",appTextColor2:"var(--appTextColor2)",appTextColor3:"var(--appTextColor3)",appTextColor4:"var(--appTextColor4)",appTextColorStrong:"var(--appTextColorStrong)",separatorColor:"var(--separatorColor)",separatorColor2:"var(--separatorColor2)",separatorColor3:"var(--separatorColor3)",separatorColor4:"var(--separatorColor4)",neutralColor:"var(--neutralColor)",infoColor:"var(--infoColor)",successColor:"var(--successColor)",warnColor:"var(--warnColor)",errorColor:"var(--errorColor)",dangerColor:"var(--dangerColor)",inputElementBorderRadius:"var(--inputElementBorderRadius)",inputElementBorderSize:"var(--inputElementBorderSize)",interactionAnimationDuration:"var(--interactionAnimationDuration)",interactiveEnabledCursor:"var(--interactiveEnabledCursor)",interactiveDisabledCursor:"var(--interactiveDisabledCursor)"},Sn={busyShadeA:"var(--busyShadeA)",busyShadeB:"var(--busyShadeB)",inputBorderColor:"var(--inputBorderColor)",progressBg:"var(--progressBg)",switchBackground:"var(--switchBackground)",switchBorderColor:"var(--switchBorderColor)",switchDisabledBackground:"var(--switchDisabledBackground)",switchThumbStretchSize:"var(--switchThumbStretchSize)",thumbColor:"var(--thumbColor)",buttonDisabledColor:"var(--buttonDisabledColor)"},On="#2b80ff",An=Pr.fromHex(On);class Nn{constructor(t,r,e={}){this.colorScheme=t,this.customValues=e,this.internalValues={};const n=t===Cn.light,i={...n?Nn.DEFAULT_LIGHT_BASE_PALETTE:Nn.DEFAULT_DARK_BASE_PALETTE,...null==r?void 0:r.basePalette},{primaryColor:o,appBgColor:s,appTextColor:a,separatorColor:u}=i,c=Pr.fromString(o),h=In(c,1.1).toString(),l=In(c,.9).toString(),f=Pr.fromString(s),d=Pr.fromString(a),p=Pr.fromString(u);this.palette={...i,primaryColorLighter:h,primaryColorDarker:l,primaryColor20:`${o}20`,primaryColor40:`${o}40`,primaryColor60:`${o}60`,primaryColor80:`${o}80`,primaryTextColor:o,primaryTextColorLighter:h,primaryTextColorDarker:l,appBgColor2:In(f,n?.9:1.1).toString(),appBgColor3:In(f,n?.8:1.2).toString(),appBgColor4:In(f,n?.7:1.3).toString(),appTextColor2:In(d,n?1.1:.9).toString(),appTextColor3:In(d,n?1.2:.8).toString(),appTextColor4:In(d,n?1.3:.7).toString(),appTextColorStrong:n?"#000000":"#ffffff",separatorColor2:In(p,n?1.1:.9).toString(),separatorColor3:In(p,n?1.2:.8).toString(),separatorColor4:In(p,n?1.3:.7).toString()},this.spacing={...Nn.DEFAULT_SPACING,...null==r?void 0:r.spacing},this.duration={...Nn.DEFAULT_DURATION,...null==r?void 0:r.duration},this.componentParameters={...Nn.DEFAULT_COMPONENT_PARAMETERS,...null==r?void 0:r.componentParameters};const g="#808080";this.internalValues={busyShadeA:"#80808040",busyShadeB:"#808080"+(n?"00":"20"),inputBorderColor:g,progressBg:"#000000"+(n?"10":"40"),switchBackground:n?"#4b4b4b40":"#00000000",switchBorderColor:n?"#80808040":g,switchDisabledBackground:n?"#80808020":"#00000000",switchThumbStretchSize:"5px",thumbColor:n?"#ffffff":"#eeeeee",buttonDisabledColor:n?"#b5b5b5":"#4b4b4b"}}}function In(t,r){return Pr.fromHSL({hue:t.hue,saturation:t.saturation,lightness:t.lightness*r})}Nn.DEFAULT_LIGHT_BASE_PALETTE={primaryColor:On,appBgColor:"#eeeeee",appTextColor:"#4b4b4b",separatorColor:"#808080",neutralColor:Pr.fromHSL({hue:An.hue,saturation:.15*An.saturation,lightness:Math.min(1.2*An.lightness,100)}).toString(),infoColor:"#00cccc",successColor:"#008000",warnColor:"#ee6600",errorColor:"#ff3333",dangerColor:"#ff4a4a"},Nn.DEFAULT_DARK_BASE_PALETTE={primaryColor:On,appBgColor:"#111111",appTextColor:"#b5b5b5",separatorColor:"#808080",neutralColor:Pr.fromHSL({hue:An.hue,saturation:.15*An.saturation,lightness:.4*An.lightness}).toString(),infoColor:"#00cccc",successColor:"#00aa00",warnColor:"#ff8000",errorColor:"#ff4b4b",dangerColor:"#ff6666"},Nn.DEFAULT_SPACING={None:0,XXXS:1,XXS:2,XS:3,S:5,M:10,L:15,XL:20,XXL:40,XXXL:60},Nn.DEFAULT_DURATION={VERY_SHORT:50,SHORT:100,MEDIUM:200,LONG:300,VERY_LONG:500,EXTRA_LONG:750},Nn.DEFAULT_COMPONENT_PARAMETERS={inputElementBorderRadius:5,inputElementBorderSize:2,interactionAnimationDuration:"150ms",interactiveEnabledCursor:"pointer",interactiveDisabledCursor:"not-allowed"};class Rn{static createConstraintWithExactDeviceId(t,r){return{...r,video:{deviceId:{exact:t}}}}get state(){return this.Nt}get videoDimensions(){return this.It}constructor(){this.Nt=new r(Rn.State.CREATED,[[Rn.State.CREATED,Rn.State.STARTING],[Rn.State.CREATED,Rn.State.DISPOSED],[Rn.State.STARTING,Rn.State.STARTED],[Rn.State.STARTING,Rn.State.DENIED],[Rn.State.STARTING,Rn.State.OVERCONSTRAINED],[Rn.State.DENIED,Rn.State.DISPOSED],[Rn.State.OVERCONSTRAINED,Rn.State.DISPOSED],[Rn.State.STARTED,Rn.State.STOPPED],[Rn.State.STARTED,Rn.State.DENIED],[Rn.State.STOPPED,Rn.State.STARTING],[Rn.State.STOPPED,Rn.State.DISPOSED]],{name:"VideoCamera",serializeState:mt(Rn.State)}),this.It=new t({height:0,width:0}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.dispose=this.dispose.bind(this),this.videoElement=document.createElement("video"),this.videoElement.className=Tn.hidden,this.videoElement.controls=!1,this.videoElement.muted=!0,document.body.append(this.videoElement)}async start(t){if(!this.Nt.trySet(Rn.State.STARTING))return!1;try{return this.Rt=await navigator.mediaDevices.getUserMedia(t),this.videoElement.srcObject=this.Rt,await this.videoElement.play(),this.It.set({height:this.videoElement.videoHeight,width:this.videoElement.videoWidth}),this.videoElement.height=t