diff --git a/README.md b/README.md index c795b01..d47b336 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,12 @@ Almost 10 years ago I [wrote an algorithm](https://github.com/mendrik/diorama) that layouts a set of images into a fixed-size rectangle. The old algorithm was heavily optimized for speed, making the code hard to read and even harder to maintain. -Recently (2023) I had an idea how to simplify the algortihm and decided to put this on to a more modern foundation. -The current configuration values size uniformity over cropping. +Recently (2023) I had an idea how to simplify the algorithm and decided to put this on to a more modern foundation. -The result [can be seen here](https://mendrik.github.io/diorama-2023/). +Though the algorithm searches for gap-less solutions the provided demo here cheats by giving images a bit of space and avoids cropping. +It should be fairly trivial to display images via contain/cover modes in other scenarios. + +The result [can be seen here](https://mendrik.github.io/diorama-2023/). ## Layout algorithm @@ -27,7 +29,5 @@ export const findSolution = ( export type Config = { maxComputationTime: number // ms how long the algorithm is allowed to search for a good solution, default 300ms sizeHomogenity: number // how imporant equal picture-sizes are. If you don't care about cropping at all set this to 1000 - aspectRatioThreshold: number // minimum requirement for aspect ratio match, should be somewhere around 0.95 - 0.995. - minImages: number // the minimum amount of images where the algorithm even bothers to search solutions } ``` diff --git a/docs/assets/find-solution-9294ca45.js b/docs/assets/find-solution-9294ca45.js new file mode 100644 index 0000000..646fc8e --- /dev/null +++ b/docs/assets/find-solution-9294ca45.js @@ -0,0 +1,5 @@ +var Ee=Object.defineProperty;var be=(p,h,m)=>h in p?Ee(p,h,{enumerable:!0,configurable:!0,writable:!0,value:m}):p[h]=m;var ft=(p,h,m)=>(be(p,typeof h!="symbol"?h+"":h,m),m);(function(){"use strict";/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const p=Symbol("Comlink.proxy"),h=Symbol("Comlink.endpoint"),m=Symbol("Comlink.releaseProxy"),P=Symbol("Comlink.finalizer"),_=Symbol("Comlink.thrown"),F=t=>typeof t=="object"&&t!==null||typeof t=="function",gt={canHandle:t=>F(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return I(t,e),[n,[n]]},deserialize(t){return t.start(),mt(t)}},ht={canHandle:t=>F(t)&&_ in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},D=new Map([["proxy",gt],["throw",ht]]);function yt(t,e){for(const n of t)if(e===n||n==="*"||n instanceof RegExp&&n.test(e))return!0;return!1}function I(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!yt(n,a.origin)){console.warn(`Invalid origin '${a.origin}' for comlink proxy`);return}const{id:o,type:i,path:s}=Object.assign({path:[]},a.data),c=(a.data.argumentList||[]).map(d);let u;try{const l=s.slice(0,-1).reduce((f,j)=>f[j],t),y=s.reduce((f,j)=>f[j],t);switch(i){case"GET":u=y;break;case"SET":l[s.slice(-1)[0]]=d(a.data.value),u=!0;break;case"APPLY":u=y.apply(l,c);break;case"CONSTRUCT":{const f=new y(...c);u=Ot(f)}break;case"ENDPOINT":{const{port1:f,port2:j}=new MessageChannel;I(t,j),u=St(f,[f])}break;case"RELEASE":u=void 0;break;default:return}}catch(l){u={value:l,[_]:0}}Promise.resolve(u).catch(l=>({value:l,[_]:0})).then(l=>{const[y,f]=z(l);e.postMessage(Object.assign(Object.assign({},y),{id:o}),f),i==="RELEASE"&&(e.removeEventListener("message",r),V(e),P in t&&typeof t[P]=="function"&&t[P]())}).catch(l=>{const[y,f]=z({value:new TypeError("Unserializable return value"),[_]:0});e.postMessage(Object.assign(Object.assign({},y),{id:o}),f)})}),e.start&&e.start()}function pt(t){return t.constructor.name==="MessagePort"}function V(t){pt(t)&&t.close()}function mt(t,e){return k(t,[],e)}function T(t){if(t)throw new Error("Proxy has been released and is not useable")}function W(t){return w(t,{type:"RELEASE"}).then(()=>{V(t)})}const C=new WeakMap,R="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(C.get(t)||0)-1;C.set(t,e),e===0&&W(t)});function dt(t,e){const n=(C.get(e)||0)+1;C.set(e,n),R&&R.register(t,e,t)}function vt(t){R&&R.unregister(t)}function k(t,e=[],n=function(){}){let r=!1;const a=new Proxy(n,{get(o,i){if(T(r),i===m)return()=>{vt(a),W(t),r=!0};if(i==="then"){if(e.length===0)return{then:()=>a};const s=w(t,{type:"GET",path:e.map(c=>c.toString())}).then(d);return s.then.bind(s)}return k(t,[...e,i])},set(o,i,s){T(r);const[c,u]=z(s);return w(t,{type:"SET",path:[...e,i].map(l=>l.toString()),value:c},u).then(d)},apply(o,i,s){T(r);const c=e[e.length-1];if(c===h)return w(t,{type:"ENDPOINT"}).then(d);if(c==="bind")return k(t,e.slice(0,-1));const[u,l]=B(s);return w(t,{type:"APPLY",path:e.map(y=>y.toString()),argumentList:u},l).then(d)},construct(o,i){T(r);const[s,c]=B(i);return w(t,{type:"CONSTRUCT",path:e.map(u=>u.toString()),argumentList:s},c).then(d)}});return dt(a,t),a}function wt(t){return Array.prototype.concat.apply([],t)}function B(t){const e=t.map(z);return[e.map(n=>n[0]),wt(e.map(n=>n[1]))]}const G=new WeakMap;function St(t,e){return G.set(t,e),t}function Ot(t){return Object.assign(t,{[p]:!0})}function z(t){for(const[e,n]of D)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},G.get(t)||[]]}function d(t){switch(t.type){case"HANDLER":return D.get(t.name).deserialize(t.value);case"RAW":return t.value}}function w(t,e,n){return new Promise(r=>{const a=At();t.addEventListener("message",function o(i){!i.data||!i.data.id||i.data.id!==a||(t.removeEventListener("message",o),r(i.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:a},e),n)})}function At(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function S(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function v(t){return function e(n){return arguments.length===0||S(n)?e:t.apply(this,arguments)}}function g(t){return function e(n,r){switch(arguments.length){case 0:return e;case 1:return S(n)?e:v(function(a){return t(n,a)});default:return S(n)&&S(r)?e:S(n)?v(function(a){return t(a,r)}):S(r)?v(function(a){return t(n,a)}):t(n,r)}}}var M=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function Et(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function bt(t,e,n){return function(){if(arguments.length===0)return n();var r=arguments[arguments.length-1];if(!M(r)){for(var a=0;a=0;)n=Q[r],O(n,e)&&!zt(a,n)&&(a[a.length]=n),r-=1;return a}),A=Mt,Pt=v(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),tt=Pt;function et(t,e,n,r){var a=Y(t),o=Y(e);function i(s,c){return H(s,c,n.slice(),r.slice())}return!Z(function(s,c){return!Z(i,c,s)},o,a)}function H(t,e,n,r){if(N(t,e))return!0;var a=tt(t);if(a!==tt(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(a){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&jt(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&N(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!N(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var o=n.length-1;o>=0;){if(n[o]===t)return r[o]===e;o-=1}switch(a){case"Map":return t.size!==e.size?!1:et(t.entries(),e.entries(),n.concat([t]),r.concat([e]));case"Set":return t.size!==e.size?!1:et(t.values(),e.values(),n.concat([t]),r.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=A(t);if(i.length!==A(e).length)return!1;var s=n.concat([t]),c=r.concat([e]);for(o=i.length-1;o>=0;){var u=i[o];if(!(O(u,e)&&H(e[u],t[u],s,c)))return!1;o-=1}return!0}var It=g(function(e,n){return H(e,n,[],[])}),kt=It;function Nt(t,e,n){var r,a;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(r=1/e;n=0}function $(t,e){for(var n=0,r=e.length,a=Array(r);n":rt(i,s)},r=function(o,i){return $(function(s){return q(s)+": "+n(o[s])},i.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+$(n,t).join(", ")+"))";case"[object Array]":return"["+$(n,t).concat(r(t,Gt(function(o){return/^\d+$/.test(o)},A(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+n(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?n(NaN):q(qt(t)))+")";case"[object Map]":return"new Map("+n(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+n(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+n(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+n(t.valueOf())+")":q(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var a=t.toString();if(a!=="[object Object]")return a}return"{"+r(t,A(t)).join(", ")+"}"}}var Xt=v(function(e){return rt(e,[])}),x=Xt,Yt=Number.isInteger||function(e){return e<<0===e};function L(t){return Object.prototype.toString.call(t)==="[object String]"}var Zt=g(function(e,n){var r=e<0?n.length+e:e;return L(n)?n.charAt(r):n[r]}),at=Zt,Jt=g(function(e,n){if(n!=null)return Yt(e)?at(e,n):n[e]}),Qt=Jt;function ot(t){var e=Object.prototype.toString.call(t);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"}var Kt=g(function(e,n){if(M(e)){if(M(n))return e.concat(n);throw new TypeError(x(n)+" is not an array")}if(L(e)){if(L(n))return e+n;throw new TypeError(x(n)+" is not a string")}if(e!=null&&ot(e["fantasy-land/concat"]))return e["fantasy-land/concat"](n);if(e!=null&&ot(e.concat))return e.concat(n);throw new TypeError(x(e)+' does not have a method named "concat" or "fantasy-land/concat"')}),it=Kt,te=at(-1),ee=te,ne=g(function t(e,n){if(!nt(n)&&!M(n))return n;var r=n instanceof Array?[]:{},a,o,i;for(o in n)a=e[o],i=typeof a,r[o]=i==="function"?a(n[o]):a&&i==="object"?t(a,n[o]):n[o];return r}),re=ne;function ae(t){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1,r=arguments.length;ni?1:0})}),ut=le;ce(1,18).map(t=>`./images/${t}.jpg`);const fe=600,ge=.8,he=t=>t.length>0,ye=t=>e=>(e.score+e.sizeHomogeneity*t.sizeHomogeneity)/(t.sizeHomogeneity+1),pe=(t,e)=>{const n=ut(ye(e),t),r=ee(n);return re({pictures:ut(Qt("url"))},r)},me=t=>"url"in t,b=(t,e,n)=>{if(me(n))return[{position:t,dimension:e,url:n.url}];if(n.horizontal){const r=e.height*n.first.aspectRatio,a={x:t.x+r,y:t.y},o={width:r,height:e.height},s={width:e.width-r,height:e.height};return it(b(t,o,n.first),b(a,s,n.second))}else{const r=e.width/n.first.aspectRatio,a={x:t.x,y:t.y+r},o={width:e.width,height:r},i=e.height-r,s={width:e.width,height:i};return it(b(t,o,n.first),b(a,s,n.second))}},de=t=>{const e=Math.max(...t.map(o=>o.width)),n=Math.max(...t.map(o=>o.height)),r=Math.min(...t.map(o=>o.width)),a=Math.min(...t.map(o=>o.height));return(r/e+a/n)/2},ve=(t,e,n)=>{const r=b({x:0,y:0},t,n),a=de(r.map(o=>o.dimension));return{dimension:t,score:e,sizeHomogeneity:a,pictures:r}},U=(t,e)=>t+Math.random()*(e-t+1)|0;class we{constructor(e,n,r){ft(this,"aspectRatio",0);this.horizontal=e,this.first=n,this.second=r;const a=n.aspectRatio+r.aspectRatio;this.aspectRatio=e?a:n.aspectRatio*r.aspectRatio/a}}const ct=(t,e)=>new we(!!U(0,1),t,e),lt=t=>{const e=t.length-1;if(e===0)return t[0];if(e===1)return ct(t[0],t[1]);const n=U(0,e);let r;do r=U(0,e);while(n===r);const a=ct(t[n],t[r]);return lt(t.with(n,a).toSpliced(r,1))},Se=(t,e)=>{const n=t.height*e;if(n<=t.width)return{width:n,height:t.height};{const r=t.width/e;return{width:t.width,height:r}}},Oe={maxComputationTime:fe,sizeHomogeneity:ge};var Ae=Object.freeze({__proto__:null,findSolution:(t,e,n)=>{const r=se(n??{},Oe),a=Date.now(),o=e.width/e.height,i=[];for(;Date.now()-a{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Pp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _c={exports:{}},wo={},Ec={exports:{}},I={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Gr=Symbol.for("react.element"),Np=Symbol.for("react.portal"),zp=Symbol.for("react.fragment"),Op=Symbol.for("react.strict_mode"),Lp=Symbol.for("react.profiler"),Tp=Symbol.for("react.provider"),Rp=Symbol.for("react.context"),Ip=Symbol.for("react.forward_ref"),$p=Symbol.for("react.suspense"),jp=Symbol.for("react.memo"),Mp=Symbol.for("react.lazy"),Ms=Symbol.iterator;function Fp(e){return e===null||typeof e!="object"?null:(e=Ms&&e[Ms]||e["@@iterator"],typeof e=="function"?e:null)}var xc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Cc=Object.assign,Pc={};function Gn(e,t,n){this.props=e,this.context=t,this.refs=Pc,this.updater=n||xc}Gn.prototype.isReactComponent={};Gn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Gn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Nc(){}Nc.prototype=Gn.prototype;function Ou(e,t,n){this.props=e,this.context=t,this.refs=Pc,this.updater=n||xc}var Lu=Ou.prototype=new Nc;Lu.constructor=Ou;Cc(Lu,Gn.prototype);Lu.isPureReactComponent=!0;var Fs=Array.isArray,zc=Object.prototype.hasOwnProperty,Tu={current:null},Oc={key:!0,ref:!0,__self:!0,__source:!0};function Lc(e,t,n){var r,i={},o=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(o=""+t.key),t)zc.call(t,r)&&!Oc.hasOwnProperty(r)&&(i[r]=t[r]);var u=arguments.length-2;if(u===1)i.children=n;else if(1>>1,J=x[j];if(0>>1;ji(ot,z))jei(Ze,ot)?(x[j]=Ze,x[je]=z,j=je):(x[j]=ot,x[$e]=z,j=$e);else if(jei(Ze,z))x[j]=Ze,x[je]=z,j=je;else break e}}return N}function i(x,N){var z=x.sortIndex-N.sortIndex;return z!==0?z:x.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var s=[],a=[],h=1,m=null,p=3,y=!1,v=!1,k=!1,T=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(x){for(var N=n(a);N!==null;){if(N.callback===null)r(a);else if(N.startTime<=x)r(a),N.sortIndex=N.expirationTime,t(s,N);else break;N=n(a)}}function g(x){if(k=!1,d(x),!v)if(n(s)!==null)v=!0,Jn(E);else{var N=n(a);N!==null&&Qt(g,N.startTime-x)}}function E(x,N){v=!1,k&&(k=!1,f(P),P=-1),y=!0;var z=p;try{for(d(N),m=n(s);m!==null&&(!(m.expirationTime>N)||x&&!Pe());){var j=m.callback;if(typeof j=="function"){m.callback=null,p=m.priorityLevel;var J=j(m.expirationTime<=N);N=e.unstable_now(),typeof J=="function"?m.callback=J:m===n(s)&&r(s),d(N)}else r(s);m=n(s)}if(m!==null)var vt=!0;else{var $e=n(a);$e!==null&&Qt(g,$e.startTime-N),vt=!1}return vt}finally{m=null,p=z,y=!1}}var _=!1,w=null,P=-1,U=5,R=-1;function Pe(){return!(e.unstable_now()-Rx||125j?(x.sortIndex=z,t(a,x),n(s)===null&&x===n(a)&&(k?(f(P),P=-1):k=!0,Qt(g,z-j))):(x.sortIndex=J,t(s,x),v||y||(v=!0,Jn(E))),x},e.unstable_shouldYield=Pe,e.unstable_wrapCallback=function(x){var N=p;return function(){var z=p;p=N;try{return x.apply(this,arguments)}finally{p=z}}}})($c);Ic.exports=$c;var Kp=Ic.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var jc=F,Te=Kp;function S(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cl=Object.prototype.hasOwnProperty,Xp=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,As={},Us={};function qp(e){return Cl.call(Us,e)?!0:Cl.call(As,e)?!1:Xp.test(e)?Us[e]=!0:(As[e]=!0,!1)}function Jp(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Zp(e,t,n,r){if(t===null||typeof t>"u"||Jp(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Se(e,t,n,r,i,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var de={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){de[e]=new Se(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];de[t]=new Se(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){de[e]=new Se(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){de[e]=new Se(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){de[e]=new Se(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){de[e]=new Se(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){de[e]=new Se(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){de[e]=new Se(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){de[e]=new Se(e,5,!1,e.toLowerCase(),null,!1,!1)});var Iu=/[\-:]([a-z])/g;function $u(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Iu,$u);de[t]=new Se(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Iu,$u);de[t]=new Se(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Iu,$u);de[t]=new Se(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){de[e]=new Se(e,1,!1,e.toLowerCase(),null,!1,!1)});de.xlinkHref=new Se("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){de[e]=new Se(e,1,!1,e.toLowerCase(),null,!0,!0)});function ju(e,t,n,r){var i=de.hasOwnProperty(t)?de[t]:null;(i!==null?i.type!==0:r||!(2u||i[l]!==o[u]){var s=` -`+i[l].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=l&&0<=u);break}}}finally{Go=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?sr(e):""}function bp(e){switch(e.tag){case 5:return sr(e.type);case 16:return sr("Lazy");case 13:return sr("Suspense");case 19:return sr("SuspenseList");case 0:case 2:case 15:return e=Ko(e.type,!1),e;case 11:return e=Ko(e.type.render,!1),e;case 1:return e=Ko(e.type,!0),e;default:return""}}function Ol(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case yn:return"Fragment";case gn:return"Portal";case Pl:return"Profiler";case Mu:return"StrictMode";case Nl:return"Suspense";case zl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Dc:return(e.displayName||"Context")+".Consumer";case Fc:return(e._context.displayName||"Context")+".Provider";case Fu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Du:return t=e.displayName||null,t!==null?t:Ol(e.type)||"Memo";case _t:t=e._payload,e=e._init;try{return Ol(e(t))}catch{}}return null}function eh(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ol(t);case 8:return t===Mu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Dt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Uc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function th(e){var t=Uc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ii(e){e._valueTracker||(e._valueTracker=th(e))}function Bc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Uc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ai(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ll(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ws(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Dt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Wc(e,t){t=t.checked,t!=null&&ju(e,"checked",t,!1)}function Tl(e,t){Wc(e,t);var n=Dt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Rl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Rl(e,t.type,Dt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hs(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Rl(e,t,n){(t!=="number"||Ai(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ar=Array.isArray;function On(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=oi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Cr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nh=["Webkit","ms","Moz","O"];Object.keys(pr).forEach(function(e){nh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pr[t]=pr[e]})});function Yc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||pr.hasOwnProperty(e)&&pr[e]?(""+t).trim():t+"px"}function Gc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Yc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var rh=X({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function jl(e,t){if(t){if(rh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(S(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(S(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(S(61))}if(t.style!=null&&typeof t.style!="object")throw Error(S(62))}}function Ml(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fl=null;function Au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Dl=null,Ln=null,Tn=null;function Ys(e){if(e=qr(e)){if(typeof Dl!="function")throw Error(S(280));var t=e.stateNode;t&&(t=xo(t),Dl(e.stateNode,e.type,t))}}function Kc(e){Ln?Tn?Tn.push(e):Tn=[e]:Ln=e}function Xc(){if(Ln){var e=Ln,t=Tn;if(Tn=Ln=null,Ys(e),t)for(e=0;e>>=0,e===0?32:31-(hh(e)/mh|0)|0}var li=64,ui=4194304;function cr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var u=l&~i;u!==0?r=cr(u):(o&=l,o!==0&&(r=cr(o)))}else l=n&~i,l!==0?r=cr(l):o!==0&&(r=cr(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Kr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ke(t),e[t]=n}function wh(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=mr),ta=String.fromCharCode(32),na=!1;function gf(e,t){switch(e){case"keyup":return Gh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vn=!1;function Xh(e,t){switch(e){case"compositionend":return yf(t);case"keypress":return t.which!==32?null:(na=!0,ta);case"textInput":return e=t.data,e===ta&&na?null:e;default:return null}}function qh(e,t){if(vn)return e==="compositionend"||!Gu&&gf(e,t)?(e=hf(),xi=Vu=Pt=null,vn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=la(n)}}function kf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _f(){for(var e=window,t=Ai();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ai(e.document)}return t}function Ku(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function om(e){var t=_f(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&kf(n.ownerDocument.documentElement,n)){if(r!==null&&Ku(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=ua(n,o);var l=ua(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,wn=null,Vl=null,yr=null,Ql=!1;function sa(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ql||wn==null||wn!==Ai(r)||(r=wn,"selectionStart"in r&&Ku(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),yr&&Tr(yr,r)||(yr=r,r=Yi(Vl,"onSelect"),0_n||(e.current=Jl[_n],Jl[_n]=null,_n--)}function B(e,t){_n++,Jl[_n]=e.current,e.current=t}var At={},ge=Bt(At),Ee=Bt(!1),on=At;function Mn(e,t){var n=e.type.contextTypes;if(!n)return At;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xe(e){return e=e.childContextTypes,e!=null}function Ki(){Q(Ee),Q(ge)}function ma(e,t,n){if(ge.current!==At)throw Error(S(168));B(ge,t),B(Ee,n)}function Tf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(S(108,eh(e)||"Unknown",i));return X({},n,r)}function Xi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||At,on=ge.current,B(ge,e),B(Ee,Ee.current),!0}function ga(e,t,n){var r=e.stateNode;if(!r)throw Error(S(169));n?(e=Tf(e,t,on),r.__reactInternalMemoizedMergedChildContext=e,Q(Ee),Q(ge),B(ge,e)):Q(Ee),B(Ee,n)}var st=null,Co=!1,sl=!1;function Rf(e){st===null?st=[e]:st.push(e)}function ym(e){Co=!0,Rf(e)}function Wt(){if(!sl&&st!==null){sl=!0;var e=0,t=D;try{var n=st;for(D=1;e>=l,i-=l,at=1<<32-Ke(t)+i|n<P?(U=w,w=null):U=w.sibling;var R=p(f,w,d[P],g);if(R===null){w===null&&(w=U);break}e&&w&&R.alternate===null&&t(f,w),c=o(R,c,P),_===null?E=R:_.sibling=R,_=R,w=U}if(P===d.length)return n(f,w),Y&&Gt(f,P),E;if(w===null){for(;PP?(U=w,w=null):U=w.sibling;var Pe=p(f,w,R.value,g);if(Pe===null){w===null&&(w=U);break}e&&w&&Pe.alternate===null&&t(f,w),c=o(Pe,c,P),_===null?E=Pe:_.sibling=Pe,_=Pe,w=U}if(R.done)return n(f,w),Y&&Gt(f,P),E;if(w===null){for(;!R.done;P++,R=d.next())R=m(f,R.value,g),R!==null&&(c=o(R,c,P),_===null?E=R:_.sibling=R,_=R);return Y&&Gt(f,P),E}for(w=r(f,w);!R.done;P++,R=d.next())R=y(w,f,P,R.value,g),R!==null&&(e&&R.alternate!==null&&w.delete(R.key===null?P:R.key),c=o(R,c,P),_===null?E=R:_.sibling=R,_=R);return e&&w.forEach(function(Ht){return t(f,Ht)}),Y&&Gt(f,P),E}function T(f,c,d,g){if(typeof d=="object"&&d!==null&&d.type===yn&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case ri:e:{for(var E=d.key,_=c;_!==null;){if(_.key===E){if(E=d.type,E===yn){if(_.tag===7){n(f,_.sibling),c=i(_,d.props.children),c.return=f,f=c;break e}}else if(_.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===_t&&Ea(E)===_.type){n(f,_.sibling),c=i(_,d.props),c.ref=rr(f,_,d),c.return=f,f=c;break e}n(f,_);break}else t(f,_);_=_.sibling}d.type===yn?(c=tn(d.props.children,f.mode,g,d.key),c.return=f,f=c):(g=Ri(d.type,d.key,d.props,null,f.mode,g),g.ref=rr(f,c,d),g.return=f,f=g)}return l(f);case gn:e:{for(_=d.key;c!==null;){if(c.key===_)if(c.tag===4&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(f,c.sibling),c=i(c,d.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=gl(d,f.mode,g),c.return=f,f=c}return l(f);case _t:return _=d._init,T(f,c,_(d._payload),g)}if(ar(d))return v(f,c,d,g);if(Zn(d))return k(f,c,d,g);hi(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,c!==null&&c.tag===6?(n(f,c.sibling),c=i(c,d),c.return=f,f=c):(n(f,c),c=ml(d,f.mode,g),c.return=f,f=c),l(f)):n(f,c)}return T}var Dn=Uf(!0),Bf=Uf(!1),Jr={},it=Bt(Jr),jr=Bt(Jr),Mr=Bt(Jr);function Zt(e){if(e===Jr)throw Error(S(174));return e}function rs(e,t){switch(B(Mr,t),B(jr,e),B(it,Jr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:$l(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=$l(t,e)}Q(it),B(it,t)}function An(){Q(it),Q(jr),Q(Mr)}function Wf(e){Zt(Mr.current);var t=Zt(it.current),n=$l(t,e.type);t!==n&&(B(jr,e),B(it,n))}function is(e){jr.current===e&&(Q(it),Q(jr))}var G=Bt(0);function to(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var al=[];function os(){for(var e=0;en?n:4,e(!0);var r=cl.transition;cl.transition={};try{e(!1),t()}finally{D=n,cl.transition=r}}function id(){return Be().memoizedState}function km(e,t,n){var r=$t(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},od(e))ld(t,n);else if(n=Mf(e,t,n,r),n!==null){var i=ve();Xe(n,e,r,i),ud(n,t,r)}}function _m(e,t,n){var r=$t(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(od(e))ld(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,u=o(l,n);if(i.hasEagerState=!0,i.eagerState=u,Je(u,l)){var s=t.interleaved;s===null?(i.next=i,ts(t)):(i.next=s.next,s.next=i),t.interleaved=i;return}}catch{}finally{}n=Mf(e,t,i,r),n!==null&&(i=ve(),Xe(n,e,r,i),ud(n,t,r))}}function od(e){var t=e.alternate;return e===K||t!==null&&t===K}function ld(e,t){vr=no=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ud(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Bu(e,n)}}var ro={readContext:Ue,useCallback:pe,useContext:pe,useEffect:pe,useImperativeHandle:pe,useInsertionEffect:pe,useLayoutEffect:pe,useMemo:pe,useReducer:pe,useRef:pe,useState:pe,useDebugValue:pe,useDeferredValue:pe,useTransition:pe,useMutableSource:pe,useSyncExternalStore:pe,useId:pe,unstable_isNewReconciler:!1},Em={readContext:Ue,useCallback:function(e,t){return et().memoizedState=[e,t===void 0?null:t],e},useContext:Ue,useEffect:Ca,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,zi(4194308,4,bf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zi(4194308,4,e,t)},useInsertionEffect:function(e,t){return zi(4,2,e,t)},useMemo:function(e,t){var n=et();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=et();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=km.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=et();return e={current:e},t.memoizedState=e},useState:xa,useDebugValue:cs,useDeferredValue:function(e){return et().memoizedState=e},useTransition:function(){var e=xa(!1),t=e[0];return e=Sm.bind(null,e[1]),et().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=K,i=et();if(Y){if(n===void 0)throw Error(S(407));n=n()}else{if(n=t(),ae===null)throw Error(S(349));un&30||Qf(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Ca(Gf.bind(null,r,o,e),[e]),r.flags|=2048,Ar(9,Yf.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=et(),t=ae.identifierPrefix;if(Y){var n=ct,r=at;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Fr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[nt]=t,e[$r]=r,gd(e,t,!1,!1),t.stateNode=e;e:{switch(l=Ml(n,r),n){case"dialog":W("cancel",e),W("close",e),i=r;break;case"iframe":case"object":case"embed":W("load",e),i=r;break;case"video":case"audio":for(i=0;iBn&&(t.flags|=128,r=!0,ir(o,!1),t.lanes=4194304)}else{if(!r)if(e=to(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ir(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Y)return he(t),null}else 2*Z()-o.renderingStartTime>Bn&&n!==1073741824&&(t.flags|=128,r=!0,ir(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Z(),t.sibling=null,n=G.current,B(G,r?n&1|2:n&1),t):(he(t),null);case 22:case 23:return gs(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ze&1073741824&&(he(t),t.subtreeFlags&6&&(t.flags|=8192)):he(t),null;case 24:return null;case 25:return null}throw Error(S(156,t.tag))}function Tm(e,t){switch(qu(t),t.tag){case 1:return xe(t.type)&&Ki(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return An(),Q(Ee),Q(ge),os(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return is(t),null;case 13:if(Q(G),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(S(340));Fn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Q(G),null;case 4:return An(),null;case 10:return es(t.type._context),null;case 22:case 23:return gs(),null;case 24:return null;default:return null}}var gi=!1,me=!1,Rm=typeof WeakSet=="function"?WeakSet:Set,C=null;function Pn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){q(e,t,r)}else n.current=null}function au(e,t,n){try{n()}catch(r){q(e,t,r)}}var $a=!1;function Im(e,t){if(Yl=Vi,e=_f(),Ku(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,u=-1,s=-1,a=0,h=0,m=e,p=null;t:for(;;){for(var y;m!==n||i!==0&&m.nodeType!==3||(u=l+i),m!==o||r!==0&&m.nodeType!==3||(s=l+r),m.nodeType===3&&(l+=m.nodeValue.length),(y=m.firstChild)!==null;)p=m,m=y;for(;;){if(m===e)break t;if(p===n&&++a===i&&(u=l),p===o&&++h===r&&(s=l),(y=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=y}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Gl={focusedElem:e,selectionRange:n},Vi=!1,C=t;C!==null;)if(t=C,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,C=e;else for(;C!==null;){t=C;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var k=v.memoizedProps,T=v.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?k:Ve(t.type,k),T);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(S(163))}}catch(g){q(t,t.return,g)}if(e=t.sibling,e!==null){e.return=t.return,C=e;break}C=t.return}return v=$a,$a=!1,v}function wr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&au(t,n,o)}i=i.next}while(i!==r)}}function zo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function cu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function wd(e){var t=e.alternate;t!==null&&(e.alternate=null,wd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nt],delete t[$r],delete t[ql],delete t[mm],delete t[gm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Sd(e){return e.tag===5||e.tag===3||e.tag===4}function ja(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Gi));else if(r!==4&&(e=e.child,e!==null))for(fu(e,t,n),e=e.sibling;e!==null;)fu(e,t,n),e=e.sibling}function du(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(du(e,t,n),e=e.sibling;e!==null;)du(e,t,n),e=e.sibling}var ce=null,Qe=!1;function St(e,t,n){for(n=n.child;n!==null;)kd(e,t,n),n=n.sibling}function kd(e,t,n){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(So,n)}catch{}switch(n.tag){case 5:me||Pn(n,t);case 6:var r=ce,i=Qe;ce=null,St(e,t,n),ce=r,Qe=i,ce!==null&&(Qe?(e=ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ce.removeChild(n.stateNode));break;case 18:ce!==null&&(Qe?(e=ce,n=n.stateNode,e.nodeType===8?ul(e.parentNode,n):e.nodeType===1&&ul(e,n),Or(e)):ul(ce,n.stateNode));break;case 4:r=ce,i=Qe,ce=n.stateNode.containerInfo,Qe=!0,St(e,t,n),ce=r,Qe=i;break;case 0:case 11:case 14:case 15:if(!me&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&au(n,t,l),i=i.next}while(i!==r)}St(e,t,n);break;case 1:if(!me&&(Pn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){q(n,t,u)}St(e,t,n);break;case 21:St(e,t,n);break;case 22:n.mode&1?(me=(r=me)||n.memoizedState!==null,St(e,t,n),me=r):St(e,t,n);break;default:St(e,t,n)}}function Ma(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Rm),t.forEach(function(r){var i=Wm.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function He(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Z()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*jm(r/1960))-r,10e?16:e,Nt===null)var r=!1;else{if(e=Nt,Nt=null,lo=0,$&6)throw Error(S(331));var i=$;for($|=4,C=e.current;C!==null;){var o=C,l=o.child;if(C.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sZ()-hs?en(e,0):ps|=n),Ce(e,t)}function Od(e,t){t===0&&(e.mode&1?(t=ui,ui<<=1,!(ui&130023424)&&(ui=4194304)):t=1);var n=ve();e=mt(e,t),e!==null&&(Kr(e,t,n),Ce(e,n))}function Bm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Od(e,n)}function Wm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(S(314))}r!==null&&r.delete(t),Od(e,n)}var Ld;Ld=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ee.current)_e=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return _e=!1,Om(e,t,n);_e=!!(e.flags&131072)}else _e=!1,Y&&t.flags&1048576&&If(t,Ji,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Oi(e,t),e=t.pendingProps;var i=Mn(t,ge.current);In(t,n),i=us(null,t,r,e,i,n);var o=ss();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xe(r)?(o=!0,Xi(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ns(t),i.updater=Po,t.stateNode=i,i._reactInternals=t,nu(t,r,e,n),t=ou(null,t,r,!0,o,n)):(t.tag=0,Y&&o&&Xu(t),ye(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Oi(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Vm(r),e=Ve(r,e),i){case 0:t=iu(null,t,r,e,n);break e;case 1:t=Ta(null,t,r,e,n);break e;case 11:t=Oa(null,t,r,e,n);break e;case 14:t=La(null,t,r,Ve(r.type,e),n);break e}throw Error(S(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ve(r,i),iu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ve(r,i),Ta(e,t,r,i,n);case 3:e:{if(pd(t),e===null)throw Error(S(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Ff(e,t),eo(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Un(Error(S(423)),t),t=Ra(e,t,r,n,i);break e}else if(r!==i){i=Un(Error(S(424)),t),t=Ra(e,t,r,n,i);break e}else for(Oe=Tt(t.stateNode.containerInfo.firstChild),Le=t,Y=!0,Ye=null,n=Bf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Fn(),r===i){t=gt(e,t,n);break e}ye(e,t,r,n)}t=t.child}return t;case 5:return Wf(t),e===null&&bl(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,Kl(r,i)?l=null:o!==null&&Kl(r,o)&&(t.flags|=32),dd(e,t),ye(e,t,l,n),t.child;case 6:return e===null&&bl(t),null;case 13:return hd(e,t,n);case 4:return rs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Dn(t,null,r,n):ye(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ve(r,i),Oa(e,t,r,i,n);case 7:return ye(e,t,t.pendingProps,n),t.child;case 8:return ye(e,t,t.pendingProps.children,n),t.child;case 12:return ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,l=i.value,B(Zi,r._currentValue),r._currentValue=l,o!==null)if(Je(o.value,l)){if(o.children===i.children&&!Ee.current){t=gt(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){l=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=ft(-1,n&-n),s.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var h=a.pending;h===null?s.next=s:(s.next=h.next,h.next=s),a.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),eu(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(S(341));l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),eu(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}ye(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,In(t,n),i=Ue(i),r=r(i),t.flags|=1,ye(e,t,r,n),t.child;case 14:return r=t.type,i=Ve(r,t.pendingProps),i=Ve(r.type,i),La(e,t,r,i,n);case 15:return cd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ve(r,i),Oi(e,t),t.tag=1,xe(r)?(e=!0,Xi(t)):e=!1,In(t,n),Af(t,r,i),nu(t,r,i,n),ou(null,t,r,!0,e,n);case 19:return md(e,t,n);case 22:return fd(e,t,n)}throw Error(S(156,t.tag))};function Td(e,t){return nf(e,t)}function Hm(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function De(e,t,n,r){return new Hm(e,t,n,r)}function vs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vm(e){if(typeof e=="function")return vs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Fu)return 11;if(e===Du)return 14}return 2}function jt(e,t){var n=e.alternate;return n===null?(n=De(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ri(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")vs(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case yn:return tn(n.children,i,o,t);case Mu:l=8,i|=8;break;case Pl:return e=De(12,n,t,i|2),e.elementType=Pl,e.lanes=o,e;case Nl:return e=De(13,n,t,i),e.elementType=Nl,e.lanes=o,e;case zl:return e=De(19,n,t,i),e.elementType=zl,e.lanes=o,e;case Ac:return Lo(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fc:l=10;break e;case Dc:l=9;break e;case Fu:l=11;break e;case Du:l=14;break e;case _t:l=16,r=null;break e}throw Error(S(130,e==null?e:typeof e,""))}return t=De(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function tn(e,t,n,r){return e=De(7,e,r,t),e.lanes=n,e}function Lo(e,t,n,r){return e=De(22,e,r,t),e.elementType=Ac,e.lanes=n,e.stateNode={isHidden:!1},e}function ml(e,t,n){return e=De(6,e,null,t),e.lanes=n,e}function gl(e,t,n){return t=De(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qm(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qo(0),this.expirationTimes=qo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qo(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ws(e,t,n,r,i,o,l,u,s){return e=new Qm(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=De(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ns(o),e}function Ym(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jd)}catch(e){console.error(e)}}jd(),Rc.exports=Re;var Jm=Rc.exports,Md,Va=Jm;Md=Va.createRoot,Va.hydrateRoot;const nn={of(e){return Ge(e)},empty(){return ue},zero(){return ue},fromNullable(e){return e==null?ue:Ge(e)},fromFalsy(e){return e?Ge(e):ue},fromPredicate(e,t){switch(arguments.length){case 1:return n=>nn.fromPredicate(e,n);default:return e(t)?Ge(t):ue}},mapMaybe(e,t){switch(arguments.length){case 1:return n=>nn.mapMaybe(e,n);default:return nn.catMaybes(t.map(e))}},catMaybes(e){let t=[];for(const n of e)n.isJust()&&t.push(n.extract());return t},encase(e){try{return Ge(e())}catch{return ue}},isMaybe(e){return e instanceof Es||e instanceof xs},sequence(e){let t=[];for(const n of e)if(n.isJust())t.push(n.extract());else return ue;return Ge(t)},"fantasy-land/of"(e){return this.of(e)},"fantasy-land/empty"(){return this.empty()},"fantasy-land/zero"(){return this.zero()}};class Es{constructor(t){this.__value=t,this["fantasy-land/equals"]=this.equals,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/alt"]=this.alt,this["fantasy-land/chain"]=this.chain,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend,this["fantasy-land/filter"]=this.filter}isJust(){return!0}isNothing(){return!1}inspect(){return`Just(${this.__value})`}toString(){return this.inspect()}toJSON(){const t=this.__value;return t instanceof Date?t.toJSON():t}equals(t){return this.extract()===t.extract()}map(t){return Ge(t(this.__value))}ap(t){return t.isJust()?this.map(t.extract()):ue}alt(t){return this}altLazy(t){return this}chain(t){return t(this.__value)}chainNullable(t){return nn.fromNullable(t(this.__value))}join(){return this.__value}reduce(t,n){return t(n,this.__value)}extend(t){return Ge(t(this))}unsafeCoerce(){return this.__value}caseOf(t){return"_"in t?t._():t.Just(this.__value)}orDefault(t){return this.__value}orDefaultLazy(t){return this.__value}toList(){return[this.__value]}mapOrDefault(t,n){return t(this.__value)}extract(){return this.__value}extractNullable(){return this.__value}toEither(t){return Mt(this.__value)}ifJust(t){return t(this.__value),this}ifNothing(t){return this}filter(t){return t(this.__value)?Ge(this.__value):ue}}Es.prototype.constructor=nn;class xs{constructor(){this["fantasy-land/equals"]=this.equals,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/alt"]=this.alt,this["fantasy-land/chain"]=this.chain,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend,this["fantasy-land/filter"]=this.filter}isJust(){return!1}isNothing(){return!0}inspect(){return"Nothing"}toString(){return this.inspect()}toJSON(){return this.__value}equals(t){return this.extract()===t.extract()}map(t){return ue}ap(t){return ue}alt(t){return t}altLazy(t){return t()}chain(t){return ue}chainNullable(t){return ue}join(){return ue}reduce(t,n){return n}extend(t){return ue}unsafeCoerce(){throw new Error("Maybe#unsafeCoerce was ran on a Nothing")}caseOf(t){return"_"in t?t._():t.Nothing()}orDefault(t){return t}orDefaultLazy(t){return t()}toList(){return[]}mapOrDefault(t,n){return n}extract(){}extractNullable(){return null}toEither(t){return Br(t)}ifJust(t){return this}ifNothing(t){return t(),this}filter(t){return ue}}xs.prototype.constructor=nn;const Ge=e=>new Es(e),ue=new xs,Cs={of(e){return Mt(e)},lefts(e){let t=[];for(const n of e)n.isLeft()&&t.push(n.extract());return t},rights(e){let t=[];for(const n of e)n.isRight()&&t.push(n.extract());return t},encase(e){try{return Mt(e())}catch(t){return Br(t)}},sequence(e){let t=[];for(const n of e){if(n.isLeft())return n;t.push(n.extract())}return Mt(t)},isEither(e){return e instanceof Ns||e instanceof Ps},"fantasy-land/of"(e){return Cs.of(e)}};class Ps{constructor(t){this.__value=t,this._="R",this["fantasy-land/bimap"]=this.bimap,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/equals"]=this.equals,this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend}isLeft(){return!1}isRight(){return!0}toJSON(){return this.__value}inspect(){return`Right(${this.__value})`}toString(){return this.inspect()}bimap(t,n){return Mt(n(this.__value))}map(t){return Mt(t(this.__value))}mapLeft(t){return this}ap(t){return t.isRight()?this.map(t.extract()):t}equals(t){return t.isRight()?this.__value===t.extract():!1}chain(t){return t(this.__value)}chainLeft(t){return this}join(){return this.__value}alt(t){return this}altLazy(t){return this}reduce(t,n){return t(n,this.__value)}extend(t){return Mt(t(this))}unsafeCoerce(){return this.__value}caseOf(t){return"_"in t?t._():t.Right(this.__value)}leftOrDefault(t){return t}orDefault(t){return this.__value}orDefaultLazy(t){return this.__value}leftOrDefaultLazy(t){return t()}ifLeft(t){return this}ifRight(t){return t(this.__value),this}toMaybe(){return Ge(this.__value)}leftToMaybe(){return ue}extract(){return this.__value}swap(){return Br(this.__value)}}Ps.prototype.constructor=Cs;class Ns{constructor(t){this.__value=t,this._="L",this["fantasy-land/bimap"]=this.bimap,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/equals"]=this.equals,this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend}isLeft(){return!0}isRight(){return!1}toJSON(){return this.__value}inspect(){return`Left(${JSON.stringify(this.__value)})`}toString(){return this.inspect()}bimap(t,n){return Br(t(this.__value))}map(t){return this}mapLeft(t){return Br(t(this.__value))}ap(t){return t.isLeft()?t:this}equals(t){return t.isLeft()?t.extract()===this.__value:!1}chain(t){return this}chainLeft(t){return t(this.__value)}join(){return this}alt(t){return t}altLazy(t){return t()}reduce(t,n){return n}extend(t){return this}unsafeCoerce(){throw this.__value instanceof Error?this.__value:new Error("Either#unsafeCoerce was ran on a Left")}caseOf(t){return"_"in t?t._():t.Left(this.__value)}leftOrDefault(t){return this.__value}orDefault(t){return t}orDefaultLazy(t){return t()}leftOrDefaultLazy(t){return this.__value}ifLeft(t){return t(this.__value),this}ifRight(t){return this}toMaybe(){return ue}leftToMaybe(){return Ge(this.__value)}extract(){return this.__value}swap(){return Mt(this.__value)}}Ns.prototype.constructor=Cs;const Br=e=>new Ns(e),Mt=e=>new Ps(e),Fd=e=>{throw new Error(e)},Zm=e=>new Promise((t,n)=>{const r=new Image;r.onload=()=>t({dimension:{width:r.width,height:r.height},aspectRatio:r.width/r.height,url:e}),r.onerror=n,r.src=e}),bm=e=>Promise.all(e.map(Zm));function V(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function se(e){return function t(n){return arguments.length===0||V(n)?t:e.apply(this,arguments)}}function re(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return V(n)?t:se(function(i){return e(n,i)});default:return V(n)&&V(r)?t:V(n)?se(function(i){return e(i,r)}):V(r)?se(function(i){return e(n,i)}):e(n,r)}}}var eg=re(function(t,n){return Number(t)+Number(n)});const Dd=eg;function jo(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(n){return t.apply(this,arguments)};case 2:return function(n,r){return t.apply(this,arguments)};case 3:return function(n,r,i){return t.apply(this,arguments)};case 4:return function(n,r,i,o){return t.apply(this,arguments)};case 5:return function(n,r,i,o,l){return t.apply(this,arguments)};case 6:return function(n,r,i,o,l,u){return t.apply(this,arguments)};case 7:return function(n,r,i,o,l,u,s){return t.apply(this,arguments)};case 8:return function(n,r,i,o,l,u,s,a){return t.apply(this,arguments)};case 9:return function(n,r,i,o,l,u,s,a,h){return t.apply(this,arguments)};case 10:return function(n,r,i,o,l,u,s,a,h,m){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function Ad(e,t,n){return function(){for(var r=[],i=0,o=e,l=0,u=!1;l=arguments.length)?s=t[l]:(s=arguments[i],i+=1),r[l]=s,V(s)?u=!0:o-=1,l+=1}return!u&&o<=0?n.apply(this,r):jo(Math.max(0,o),Ad(e,r,n))}}var tg=re(function(t,n){return t===1?se(n):jo(t,Ad(t,[],n))});const Ud=tg;function Bd(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return V(n)?t:re(function(o,l){return e(n,o,l)});case 2:return V(n)&&V(r)?t:V(n)?re(function(o,l){return e(o,r,l)}):V(r)?re(function(o,l){return e(n,o,l)}):se(function(o){return e(n,r,o)});default:return V(n)&&V(r)&&V(i)?t:V(n)&&V(r)?re(function(o,l){return e(o,l,i)}):V(n)&&V(i)?re(function(o,l){return e(o,r,l)}):V(r)&&V(i)?re(function(o,l){return e(n,o,l)}):V(n)?se(function(o){return e(o,r,i)}):V(r)?se(function(o){return e(n,o,i)}):V(i)?se(function(o){return e(n,r,o)}):e(n,r,i)}}}const Wr=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function ng(e){return e!=null&&typeof e["@@transducer/step"]=="function"}function Wd(e,t,n){return function(){if(arguments.length===0)return n();var r=arguments[arguments.length-1];if(!Wr(r)){for(var i=0;i=0;)n=Ka[r],co(n,t)&&!ag(i,n)&&(i[i.length]=n),r-=1;return i});const Hr=cg;var fg=se(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)});const qa=fg;function Ja(e,t,n,r){var i=Qa(e),o=Qa(t);function l(u,s){return zs(u,s,n.slice(),r.slice())}return!Ya(function(u,s){return!Ya(l,s,u)},o,i)}function zs(e,t,n,r){if(yl(e,t))return!0;var i=qa(e);if(i!==qa(t))return!1;if(typeof e["fantasy-land/equals"]=="function"||typeof t["fantasy-land/equals"]=="function")return typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t)&&typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e);if(typeof e.equals=="function"||typeof t.equals=="function")return typeof e.equals=="function"&&e.equals(t)&&typeof t.equals=="function"&&t.equals(e);switch(i){case"Arguments":case"Array":case"Object":if(typeof e.constructor=="function"&&ig(e.constructor)==="Promise")return e===t;break;case"Boolean":case"Number":case"String":if(!(typeof e==typeof t&&yl(e.valueOf(),t.valueOf())))return!1;break;case"Date":if(!yl(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(!(e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.sticky===t.sticky&&e.unicode===t.unicode))return!1;break}for(var o=n.length-1;o>=0;){if(n[o]===e)return r[o]===t;o-=1}switch(i){case"Map":return e.size!==t.size?!1:Ja(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size!==t.size?!1:Ja(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var l=Hr(e);if(l.length!==Hr(t).length)return!1;var u=n.concat([e]),s=r.concat([t]);for(o=l.length-1;o>=0;){var a=l[o];if(!(co(a,t)&&zs(t[a],e[a],u,s)))return!1;o-=1}return!0}var dg=re(function(t,n){return zs(t,n,[],[])});const Hd=dg;function pg(e,t,n){var r,i;if(typeof e.indexOf=="function")switch(typeof t){case"number":if(t===0){for(r=1/t;n=0}function vl(e,t){for(var n=0,r=t.length,i=Array(r);n":Qd(l,u)},r=function(o,l){return vl(function(u){return wl(u)+": "+n(o[u])},l.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+vl(n,e).join(", ")+"))";case"[object Array]":return"["+vl(n,e).concat(r(e,Vd(function(o){return/^\d+$/.test(o)},Hr(e)))).join(", ")+"]";case"[object Boolean]":return typeof e=="object"?"new Boolean("+n(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?n(NaN):wl(mg(e)))+")";case"[object Map]":return"new Map("+n(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return typeof e=="object"?"new Number("+n(e.valueOf())+")":1/e===-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+n(Array.from(e).sort())+")";case"[object String]":return typeof e=="object"?"new String("+n(e.valueOf())+")":wl(e);case"[object Undefined]":return"undefined";default:if(typeof e.toString=="function"){var i=e.toString();if(i!=="[object Object]")return i}return"{"+r(e,Hr(e)).join(", ")+"}"}}var Cg=se(function(t){return Qd(t,[])});const _r=Cg;var Pg=re(function(t,n){if(t===n)return n;function r(s,a){if(s>a!=a>s)return a>s?a:s}var i=r(t,n);if(i!==void 0)return i;var o=r(typeof t,typeof n);if(o!==void 0)return o===typeof t?t:n;var l=_r(t),u=r(l,_r(n));return u!==void 0&&u===l?t:n});const Ng=Pg,zg=Number.isInteger||function(t){return t<<0===t};function fo(e){return Object.prototype.toString.call(e)==="[object String]"}var Og=re(function(t,n){var r=t<0?n.length+t:t;return fo(n)?n.charAt(r):n[r]});const Lg=Og;var Tg=re(function(t,n){if(n!=null)return zg(t)?Lg(t,n):n[t]});const Za=Tg;var Rg=se(function(t){return Wr(t)?!0:!t||typeof t!="object"||fo(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1});const Ig=Rg;var ba=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function $g(e,t,n){return function(i,o,l){if(Ig(l))return e(i,o,l);if(l==null)return o;if(typeof l["fantasy-land/reduce"]=="function")return t(i,o,l,"fantasy-land/reduce");if(l[ba]!=null)return n(i,o,l[ba]());if(typeof l.next=="function")return n(i,o,l);if(typeof l.reduce=="function")return t(i,o,l,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function jg(e,t,n){for(var r=0,i=n.length;r=0&&this.i>=this.n?rg(r):r},e}();function uy(e){return function(t){return new ly(e,t)}}var sy=re(Wd(["take"],uy,function(t,n){return Gd(0,t<0?1/0:t,n)}));const Kd=sy;var ay=se(function(t){return Ud(t.length,function(n,r){var i=Array.prototype.slice.call(arguments,0);return i[0]=r,i[1]=n,t.apply(this,i)})});const cy=ay;var fy=Dd(1);const Xd=fy;function vu(e){return Object.prototype.toString.call(e)==="[object Number]"}var dy=se(function(t){return t!=null&&vu(t.length)?t.length:NaN});const rc=dy;var py=re(function(t,n){if(!(vu(t)&&vu(n)))throw new TypeError("Both arguments to range must be numbers");for(var r=[],i=t;i`./images/${e}.jpg`),ur=20,vy=4,wy=8;var b=function(){return b=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0?le(qn,--We):0,Hn--,ee===10&&(Hn=1,Fo--),ee}function qe(){return ee=We2||Su(ee)>3?"":" "}function Ty(e,t){for(;--t&&qe()&&!(ee<48||ee>102||ee>57&&ee<65||ee>70&&ee<97););return Ao(e,$i()+(t<6&&rn()==32&&qe()==32))}function ku(e){for(;qe();)switch(ee){case e:return We;case 34:case 39:e!==34&&e!==39&&ku(ee);break;case 40:e===41&&ku(e);break;case 92:qe();break}return We}function Ry(e,t){for(;qe()&&e+ee!==47+10;)if(e+ee===42+42&&rn()===47)break;return"/*"+Ao(t,We-1)+"*"+Ls(e===47?e:qe())}function Iy(e){for(;!Su(rn());)qe();return Ao(e,We)}function $y(e){return Oy(ji("",null,null,null,[""],e=zy(e),0,[0],e))}function ji(e,t,n,r,i,o,l,u,s){for(var a=0,h=0,m=l,p=0,y=0,v=0,k=1,T=1,f=1,c=0,d="",g=i,E=o,_=r,w=d;T;)switch(v=c,c=qe()){case 40:if(v!=108&&le(w,m-1)==58){Ii(w+=L(Sl(c),"&","&\f"),"&\f")!=-1&&(f=-1);break}case 34:case 39:case 91:w+=Sl(c);break;case 9:case 10:case 13:case 32:w+=Ly(v);break;case 92:w+=Ty($i()-1,7);continue;case 47:switch(rn()){case 42:case 47:dr(jy(Ry(qe(),$i()),t,n,s),s);break;default:w+="/"}break;case 123*k:u[a++]=tt(w)*f;case 125*k:case 59:case 0:switch(c){case 0:case 125:T=0;case 59+h:f==-1&&(w=L(w,/\f/g,"")),y>0&&tt(w)-m&&dr(y>32?lc(w+";",r,n,m-1,s):lc(L(w," ","")+";",r,n,m-2,s),s);break;case 59:w+=";";default:if(dr(_=oc(w,t,n,a,h,i,u,d,g=[],E=[],m,o),o),c===123)if(h===0)ji(w,t,_,_,g,o,m,u,E);else switch(p===99&&le(w,3)===110?100:p){case 100:case 108:case 109:case 115:ji(e,_,_,r&&dr(oc(e,_,_,0,0,i,u,d,i,g=[],m,E),E),i,E,m,u,r?g:E);break;default:ji(w,_,_,_,[""],E,0,u,E)}}a=h=y=0,k=f=1,d=w="",m=l;break;case 58:m=1+tt(w),y=v;default:if(k<1){if(c==123)--k;else if(c==125&&k++==0&&Ny()==125)continue}switch(w+=Ls(c),c*k){case 38:f=h>0?1:(w+="\f",-1);break;case 44:u[a++]=(tt(w)-1)*f,f=1;break;case 64:rn()===45&&(w+=Sl(qe())),p=rn(),h=m=tt(d=w+=Iy($i())),c++;break;case 45:v===45&&tt(w)==2&&(k=0)}}return o}function oc(e,t,n,r,i,o,l,u,s,a,h,m){for(var p=i-1,y=i===0?o:[""],v=bd(y),k=0,T=0,f=0;k0?y[c]+" "+d:L(d,/&\f/g,y[c])))&&(s[f++]=g);return Do(e,t,n,i===0?Mo:u,s,a,h,m)}function jy(e,t,n,r){return Do(e,t,n,qd,Ls(Py()),Wn(e,2,-2),0,r)}function lc(e,t,n,r,i){return Do(e,t,n,Os,Wn(e,0,r),Wn(e,r+1,-1),r,i)}function tp(e,t,n){switch(xy(e,t)){case 5103:return M+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return M+e+e;case 4789:return Er+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return M+e+Er+e+H+e+e;case 5936:switch(le(e,t+11)){case 114:return M+e+H+L(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return M+e+H+L(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return M+e+H+L(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return M+e+H+e+e;case 6165:return M+e+H+"flex-"+e+e;case 5187:return M+e+L(e,/(\w+).+(:[^]+)/,M+"box-$1$2"+H+"flex-$1$2")+e;case 5443:return M+e+H+"flex-item-"+L(e,/flex-|-self/g,"")+(ut(e,/flex-|baseline/)?"":H+"grid-row-"+L(e,/flex-|-self/g,""))+e;case 4675:return M+e+H+"flex-line-pack"+L(e,/align-content|flex-|-self/g,"")+e;case 5548:return M+e+H+L(e,"shrink","negative")+e;case 5292:return M+e+H+L(e,"basis","preferred-size")+e;case 6060:return M+"box-"+L(e,"-grow","")+M+e+H+L(e,"grow","positive")+e;case 4554:return M+L(e,/([^-])(transform)/g,"$1"+M+"$2")+e;case 6187:return L(L(L(e,/(zoom-|grab)/,M+"$1"),/(image-set)/,M+"$1"),e,"")+e;case 5495:case 3959:return L(e,/(image-set\([^]*)/,M+"$1$`$1");case 4968:return L(L(e,/(.+:)(flex-)?(.*)/,M+"box-pack:$3"+H+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+M+e+e;case 4200:if(!ut(e,/flex-|baseline/))return H+"grid-column-align"+Wn(e,t)+e;break;case 2592:case 3360:return H+L(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,ut(r.props,/grid-\w+-end/)})?~Ii(e+(n=n[t].value),"span")?e:H+L(e,"-start","")+e+H+"grid-row-span:"+(~Ii(n,"span")?ut(n,/\d+/):+ut(n,/\d+/)-+ut(e,/\d+/))+";":H+L(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return ut(r.props,/grid-\w+-start/)})?e:H+L(L(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return L(e,/(.+)-inline(.+)/,M+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(tt(e)-1-t>6)switch(le(e,t+1)){case 109:if(le(e,t+4)!==45)break;case 102:return L(e,/(.+:)(.+)-([^]+)/,"$1"+M+"$2-$3$1"+Er+(le(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ii(e,"stretch")?tp(L(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return L(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,l,u,s,a){return H+i+":"+o+a+(l?H+i+"-span:"+(u?s:+s-+o)+a:"")+e});case 4949:if(le(e,t+6)===121)return L(e,":",":"+M)+e;break;case 6444:switch(le(e,le(e,14)===45?18:11)){case 120:return L(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+M+(le(e,14)===45?"inline-":"")+"box$3$1"+M+"$2$3$1"+H+"$2box$3")+e;case 100:return L(e,":",":"+H)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return L(e,"scroll-","scroll-snap-")+e}return e}function po(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case Os:e.return=tp(e.value,e.length,n);return;case Jd:return po([kt(e,{value:L(e.value,"@","@"+M)})],r);case Mo:if(e.length)return Cy(n=e.props,function(i){switch(ut(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":hn(kt(e,{props:[L(i,/:(read-\w+)/,":"+Er+"$1")]})),hn(kt(e,{props:[i]})),wu(e,{props:ic(n,r)});break;case"::placeholder":hn(kt(e,{props:[L(i,/:(plac\w+)/,":"+M+"input-$1")]})),hn(kt(e,{props:[L(i,/:(plac\w+)/,":"+Er+"$1")]})),hn(kt(e,{props:[L(i,/:(plac\w+)/,H+"input-$1")]})),hn(kt(e,{props:[i]})),wu(e,{props:ic(n,r)});break}return""})}}var Uy={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Vn=typeof process<"u"&&process.env!==void 0&&({}.REACT_APP_SC_ATTR||{}.SC_ATTR)||"data-styled",Ts=typeof window<"u"&&"HTMLElement"in window,By=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&{}.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&{}.REACT_APP_SC_DISABLE_SPEEDY!==""?{}.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&{}.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&{}.SC_DISABLE_SPEEDY!==void 0&&{}.SC_DISABLE_SPEEDY!==""&&{}.SC_DISABLE_SPEEDY!=="false"&&{}.SC_DISABLE_SPEEDY),Wy={},Uo=Object.freeze([]),Qn=Object.freeze({});function np(e,t,n){return n===void 0&&(n=Qn),e.theme!==n.theme&&e.theme||t||n.theme}var rp=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Hy=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Vy=/(^-|-$)/g;function uc(e){return e.replace(Hy,"-").replace(Vy,"")}var Qy=/(a)(d)/gi,sc=function(e){return String.fromCharCode(e+(e>25?39:97))};function _u(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=sc(t%52)+n;return(sc(t%52)+n).replace(Qy,"$1-$2")}var kl,zn=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ip=function(e){return zn(5381,e)};function op(e){return _u(ip(e)>>>0)}function Yy(e){return e.displayName||e.name||"Component"}function _l(e){return typeof e=="string"&&!0}var lp=typeof Symbol=="function"&&Symbol.for,up=lp?Symbol.for("react.memo"):60115,Gy=lp?Symbol.for("react.forward_ref"):60112,Ky={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Xy={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},sp={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},qy=((kl={})[Gy]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},kl[up]=sp,kl);function ac(e){return("type"in(t=e)&&t.type.$$typeof)===up?sp:"$$typeof"in e?qy[e.$$typeof]:Ky;var t}var Jy=Object.defineProperty,Zy=Object.getOwnPropertyNames,cc=Object.getOwnPropertySymbols,by=Object.getOwnPropertyDescriptor,ev=Object.getPrototypeOf,fc=Object.prototype;function ap(e,t,n){if(typeof t!="string"){if(fc){var r=ev(t);r&&r!==fc&&ap(e,r,n)}var i=Zy(t);cc&&(i=i.concat(cc(t)));for(var o=ac(e),l=ac(t),u=0;u0?" Args: ".concat(t.join(", ")):""))}var tv=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,o=i;t>=o;)if((o<<=1)<0)throw Zr(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var l=i;l=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),o=i+r,l=i;l=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(T+="".concat(f,","))}),s+="".concat(v).concat(k,'{content:"').concat(T,'"}').concat(`/*!sc*/ -`)},h=0;h0?".".concat(t):p},h=s.slice();h.push(function(p){p.type===Mo&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(dv,n).replace(r,a))}),l.prefix&&h.push(Ay),h.push(My);var m=function(p,y,v,k){y===void 0&&(y=""),v===void 0&&(v=""),k===void 0&&(k="&"),t=k,n=y,r=new RegExp("\\".concat(n,"\\b"),"g");var T=p.replace(pv,""),f=$y(v||y?"".concat(v," ").concat(y," { ").concat(T," }"):T);l.namespace&&(f=fp(f,l.namespace));var c=[];return po(f,Fy(h.concat(Dy(function(d){return c.push(d)})))),c};return m.hash=s.length?s.reduce(function(p,y){return y.name||Zr(15),zn(p,y.name)},5381).toString():"",m}var mv=new mo,Cu=hv(),dp=O.createContext({shouldForwardProp:void 0,styleSheet:mv,stylis:Cu});dp.Consumer;O.createContext(void 0);function Pu(){return F.useContext(dp)}var gv=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=Cu);var l=r.name+o.hash;i.hasNameForId(r.id,l)||i.insertRules(r.id,l,o(r.rules,l,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,Is(this,function(){throw Zr(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Cu),this.name+t.hash},e}(),yv=function(e){return e>="A"&&e<="Z"};function pc(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,l)){var u=r(o,".".concat(l),void 0,this.componentId);n.insertRules(this.componentId,l,u)}i=bt(i,l),this.staticRulesId=l}else{for(var s=zn(this.baseHash,r.hash),a="",h=0;h>>0);n.hasNameForId(this.componentId,y)||n.insertRules(this.componentId,y,r(a,".".concat(y),void 0,this.componentId)),i=bt(i,y)}}return i},e}(),$s=O.createContext(void 0);$s.Consumer;var El={};function Sv(e,t,n){var r=Rs(e),i=e,o=!_l(e),l=t.attrs,u=l===void 0?Uo:l,s=t.componentId,a=s===void 0?function(g,E){var _=typeof g!="string"?"sc":uc(g);El[_]=(El[_]||0)+1;var w="".concat(_,"-").concat(op("6.1.1"+_+El[_]));return E?"".concat(E,"-").concat(w):w}(t.displayName,t.parentComponentId):s,h=t.displayName,m=h===void 0?function(g){return _l(g)?"styled.".concat(g):"Styled(".concat(Yy(g),")")}(e):h,p=t.displayName&&t.componentId?"".concat(uc(t.displayName),"-").concat(t.componentId):t.componentId||a,y=r&&i.attrs?i.attrs.concat(u).filter(Boolean):u,v=t.shouldForwardProp;if(r&&i.shouldForwardProp){var k=i.shouldForwardProp;if(t.shouldForwardProp){var T=t.shouldForwardProp;v=function(g,E){return k(g,E)&&T(g,E)}}else v=k}var f=new wv(n,p,r?i.componentStyle:void 0);function c(g,E){return function(_,w,P){var U=_.attrs,R=_.componentStyle,Pe=_.defaultProps,Ht=_.foldedComponentIds,Vt=_.styledComponentId,ei=_.target,Ho=O.useContext($s),Jn=Pu(),Qt=_.shouldForwardProp||Jn.shouldForwardProp,x=function($e,ot,je){for(var Ze,Yt=b(b({},ot),{className:void 0,theme:je}),Vo=0;Vo<$e.length;Vo+=1){var ti=Yn(Ze=$e[Vo])?Ze(Yt):Ze;for(var wt in ti)Yt[wt]=wt==="className"?bt(Yt[wt],ti[wt]):wt==="style"?b(b({},Yt[wt]),ti[wt]):ti[wt]}return ot.className&&(Yt.className=bt(Yt.className,ot.className)),Yt}(U,w,np(w,Ho,Pe)||Qn),N=x.as||ei,z={};for(var j in x)x[j]===void 0||j[0]==="$"||j==="as"||j==="theme"||(j==="forwardedAs"?z.as=x.forwardedAs:Qt&&!Qt(j,N)||(z[j]=x[j]));var J=function($e,ot){var je=Pu(),Ze=$e.generateAndInjectStyles(ot,je.styleSheet,je.stylis);return Ze}(R,x),vt=bt(Ht,Vt);return J&&(vt+=" "+J),x.className&&(vt+=" "+x.className),z[_l(N)&&!rp.has(N)?"class":"className"]=vt,z.ref=P,F.createElement(N,z)}(d,g,E)}c.displayName=m;var d=O.forwardRef(c);return d.attrs=y,d.componentStyle=f,d.displayName=m,d.shouldForwardProp=v,d.foldedComponentIds=r?bt(i.foldedComponentIds,i.styledComponentId):"",d.styledComponentId=p,d.target=r?i.target:e,Object.defineProperty(d,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(g){this._foldedDefaultProps=r?function(E){for(var _=[],w=1;w2&&mo.registerId(this.componentId+t),this.removeStyles(t,r),this.createStyles(t,n,r,i)},e}();function _v(e){for(var t=[],n=1;n=0)&&(n[i]=e[i]);return n}function br(e,t){if(e==null)return{};var n=Ev(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var xv=["size","color"];function Cv(e){var t=e.size,n=t===void 0?24:t,r=e.color,i=r===void 0?"currentColor":r,o=br(e,xv);return O.createElement("svg",cn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-box-padding",width:n,height:n,viewBox:"0 0 24 24",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},o),O.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O.createElement("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),O.createElement("path",{d:"M8 16v.01"}),O.createElement("path",{d:"M8 12v.01"}),O.createElement("path",{d:"M8 8v.01"}),O.createElement("path",{d:"M16 16v.01"}),O.createElement("path",{d:"M16 12v.01"}),O.createElement("path",{d:"M16 8v.01"}),O.createElement("path",{d:"M12 8v.01"}),O.createElement("path",{d:"M12 16v.01"}))}var Pv=["size","color"];function Nv(e){var t=e.size,n=t===void 0?24:t,r=e.color,i=r===void 0?"currentColor":r,o=br(e,Pv);return O.createElement("svg",cn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-layout-grid-add",width:n,height:n,viewBox:"0 0 24 24",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},o),O.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O.createElement("rect",{x:"4",y:"4",width:"6",height:"6",rx:"1"}),O.createElement("rect",{x:"14",y:"4",width:"6",height:"6",rx:"1"}),O.createElement("rect",{x:"4",y:"14",width:"6",height:"6",rx:"1"}),O.createElement("path",{d:"M14 17h6m-3 -3v6"}))}var zv=["size","color"];function Ov(e){var t=e.size,n=t===void 0?24:t,r=e.color,i=r===void 0?"currentColor":r,o=br(e,zv);return O.createElement("svg",cn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-refresh",width:n,height:n,viewBox:"0 0 24 24",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},o),O.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O.createElement("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),O.createElement("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"}))}var Lv=["size","color"];function Tv(e){var t=e.size,n=t===void 0?24:t,r=e.color,i=r===void 0?"currentColor":r,o=br(e,Lv);return O.createElement("svg",cn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-trash",width:n,height:n,viewBox:"0 0 24 24",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},o),O.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O.createElement("line",{x1:"4",y1:"7",x2:"20",y2:"7"}),O.createElement("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),O.createElement("line",{x1:"14",y1:"11",x2:"14",y2:"17"}),O.createElement("path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"}),O.createElement("path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"}))}var Rv=["size","color"];function Iv(e){var t=e.size,n=t===void 0?24:t,r=e.color,i=r===void 0?"currentColor":r,o=br(e,Rv);return O.createElement("svg",cn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-window-maximize",width:n,height:n,viewBox:"0 0 24 24",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},o),O.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O.createElement("rect",{x:"3",y:"16",width:"5",height:"5",rx:"1"}),O.createElement("path",{d:"M4 12v-6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-6"}),O.createElement("path",{d:"M12 8h4v4"}),O.createElement("path",{d:"M16 8l-5 5"}))}const $v=()=>new Proxy({},{get(e,t){return Fd(`Object was not yet initialized [tried to access: ${String(t)}]`)}}),gc=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],dt=(()=>{if(typeof document>"u")return!1;const e=gc[0],t={};for(const n of gc)if((n==null?void 0:n[1])in document){for(const[i,o]of n.entries())t[e[i]]=o;return t}return!1})(),yc={change:dt.fullscreenchange,error:dt.fullscreenerror};let Ne={request(e=document.documentElement,t){return new Promise((n,r)=>{const i=()=>{Ne.off("change",i),n()};Ne.on("change",i);const o=e[dt.requestFullscreen](t);o instanceof Promise&&o.then(i).catch(r)})},exit(){return new Promise((e,t)=>{if(!Ne.isFullscreen){e();return}const n=()=>{Ne.off("change",n),e()};Ne.on("change",n);const r=document[dt.exitFullscreen]();r instanceof Promise&&r.then(n).catch(t)})},toggle(e,t){return Ne.isFullscreen?Ne.exit():Ne.request(e,t)},onchange(e){Ne.on("change",e)},onerror(e){Ne.on("error",e)},on(e,t){const n=yc[e];n&&document.addEventListener(n,t,!1)},off(e,t){const n=yc[e];n&&document.removeEventListener(n,t,!1)},raw:dt};Object.defineProperties(Ne,{isFullscreen:{get:()=>!!document[dt.fullscreenElement]},element:{enumerable:!0,get:()=>document[dt.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>!!document[dt.fullscreenEnabled]}});dt||(Ne={isEnabled:!1});const vc=Ne;function jv(){var e=F.useRef(!1),t=F.useCallback(function(){return e.current},[]);return F.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function Mv(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=F.useRef(0),i=jv(),o=F.useState(n),l=o[0],u=o[1],s=F.useCallback(function(){for(var a=[],h=0;h(e.refresh="refresh",e.showCrop="showCrop",e.addImage="addImage",e.removeImage="removeImage",e))(Yr||{});const Wo=F.createContext($v()),Uv=Bo.ol` - position: absolute; - display: flex; - gap: 10px; - top: 5px; - left: 5px; - width: fit-content; - height: auto; - z-index: 1; - background-color: rgb(108, 108, 108); - border-radius: 4px; - list-style: none; - padding: 4px; - box-shadow: inset 1px 1px 1px rgba(200, 200, 200, 0.7), inset -1px -1px 1px rgba(60, 60, 60, 0.7), - 3px 3px 7px -3px rgba(0, 0, 0, 0.7); - - > li { - display: contents; - } - - & button { - appearance: none; - background: none; - border: none; - cursor: pointer; - display: flex; - justify-items: center; - align-items: center; - width: 30px; - height: 30px; - border-radius: 2px; - - &:hover, - &:active { - background-color: rgba(200, 200, 200, 0.4); - } - } -`,Bv=({children:e})=>{const[,{set:t,get:n}]=Av(),r=F.useCallback((l,u)=>{const s=n(l)??[];t(l,gy([u],s))},[t,n]),i=F.useCallback((l,u)=>{const s=n(l)??[];return t(l,bg([u],s)),()=>r(l,u)},[n,t,r]),o=l=>()=>{const u=n(l);u==null||u.forEach(s=>s())};return A.jsxs(Wo.Provider,{value:{subscribe:i},children:[A.jsxs(Uv,{children:[A.jsx("li",{children:A.jsx("button",{onClick:o("refresh"),title:"rearrange",children:A.jsx(Ov,{size:ur,color:"white"})})}),A.jsx("li",{children:A.jsx("button",{onClick:o("showCrop"),title:"show cropping",children:A.jsx(Cv,{size:ur,color:"white"})})}),A.jsx("li",{children:A.jsx("button",{onClick:o("addImage"),title:"add image",children:A.jsx(Nv,{size:ur,color:"white"})})}),A.jsx("li",{children:A.jsx("button",{onClick:o("removeImage"),title:"remove image",children:A.jsx(Tv,{size:ur,color:"white"})})}),vc.isEnabled&&A.jsx("li",{children:A.jsx("button",{onClick:()=>void vc.request(),title:"fullscreen",children:A.jsx(Iv,{size:ur,color:"white"})})})]}),e]})};/** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */const vp=Symbol("Comlink.proxy"),Wv=Symbol("Comlink.endpoint"),Hv=Symbol("Comlink.releaseProxy"),xl=Symbol("Comlink.finalizer"),Di=Symbol("Comlink.thrown"),wp=e=>typeof e=="object"&&e!==null||typeof e=="function",Vv={canHandle:e=>wp(e)&&e[vp],serialize(e){const{port1:t,port2:n}=new MessageChannel;return kp(e,t),[n,[n]]},deserialize(e){return e.start(),Ep(e)}},Qv={canHandle:e=>wp(e)&&Di in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},Sp=new Map([["proxy",Vv],["throw",Qv]]);function Yv(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function kp(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(i){if(!i||!i.data)return;if(!Yv(n,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:o,type:l,path:u}=Object.assign({path:[]},i.data),s=(i.data.argumentList||[]).map(Xt);let a;try{const h=u.slice(0,-1).reduce((p,y)=>p[y],e),m=u.reduce((p,y)=>p[y],e);switch(l){case"GET":a=m;break;case"SET":h[u.slice(-1)[0]]=Xt(i.data.value),a=!0;break;case"APPLY":a=m.apply(h,s);break;case"CONSTRUCT":{const p=new m(...s);a=Zv(p)}break;case"ENDPOINT":{const{port1:p,port2:y}=new MessageChannel;kp(e,y),a=Jv(p,[p])}break;case"RELEASE":a=void 0;break;default:return}}catch(h){a={value:h,[Di]:0}}Promise.resolve(a).catch(h=>({value:h,[Di]:0})).then(h=>{const[m,p]=vo(h);t.postMessage(Object.assign(Object.assign({},m),{id:o}),p),l==="RELEASE"&&(t.removeEventListener("message",r),_p(t),xl in e&&typeof e[xl]=="function"&&e[xl]())}).catch(h=>{const[m,p]=vo({value:new TypeError("Unserializable return value"),[Di]:0});t.postMessage(Object.assign(Object.assign({},m),{id:o}),p)})}),t.start&&t.start()}function Gv(e){return e.constructor.name==="MessagePort"}function _p(e){Gv(e)&&e.close()}function Ep(e,t){return zu(e,[],t)}function Si(e){if(e)throw new Error("Proxy has been released and is not useable")}function xp(e){return mn(e,{type:"RELEASE"}).then(()=>{_p(e)})}const go=new WeakMap,yo="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(go.get(e)||0)-1;go.set(e,t),t===0&&xp(e)});function Kv(e,t){const n=(go.get(t)||0)+1;go.set(t,n),yo&&yo.register(e,t,e)}function Xv(e){yo&&yo.unregister(e)}function zu(e,t=[],n=function(){}){let r=!1;const i=new Proxy(n,{get(o,l){if(Si(r),l===Hv)return()=>{Xv(i),xp(e),r=!0};if(l==="then"){if(t.length===0)return{then:()=>i};const u=mn(e,{type:"GET",path:t.map(s=>s.toString())}).then(Xt);return u.then.bind(u)}return zu(e,[...t,l])},set(o,l,u){Si(r);const[s,a]=vo(u);return mn(e,{type:"SET",path:[...t,l].map(h=>h.toString()),value:s},a).then(Xt)},apply(o,l,u){Si(r);const s=t[t.length-1];if(s===Wv)return mn(e,{type:"ENDPOINT"}).then(Xt);if(s==="bind")return zu(e,t.slice(0,-1));const[a,h]=wc(u);return mn(e,{type:"APPLY",path:t.map(m=>m.toString()),argumentList:a},h).then(Xt)},construct(o,l){Si(r);const[u,s]=wc(l);return mn(e,{type:"CONSTRUCT",path:t.map(a=>a.toString()),argumentList:u},s).then(Xt)}});return Kv(i,e),i}function qv(e){return Array.prototype.concat.apply([],e)}function wc(e){const t=e.map(vo);return[t.map(n=>n[0]),qv(t.map(n=>n[1]))]}const Cp=new WeakMap;function Jv(e,t){return Cp.set(e,t),e}function Zv(e){return Object.assign(e,{[vp]:!0})}function vo(e){for(const[t,n]of Sp)if(n.canHandle(e)){const[r,i]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},i]}return[{type:"RAW",value:e},Cp.get(e)||[]]}function Xt(e){switch(e.type){case"HANDLER":return Sp.get(e.name).deserialize(e.value);case"RAW":return e.value}}function mn(e,t,n){return new Promise(r=>{const i=bv();e.addEventListener("message",function o(l){!l.data||!l.data.id||l.data.id!==i||(e.removeEventListener("message",o),r(l.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)})}function bv(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const e0=Ep(new Worker(new URL("/diorama-2023/assets/worker-5821772f.js",self.location))),t0=(e,t,n)=>e0.findSolution(e,t,n),n0=(e,t)=>{const[n,r]=F.useState(0),{subscribe:i}=F.useContext(Wo),[o,l]=Mv(async()=>t0(e,t),[e.length,t.width,t.height,n]);return F.useLayoutEffect(()=>{t.width>0&&t.height>0&&l()},[l,e.length,t.width,t.height,n]),js(()=>i(Yr.refresh,()=>r(Xd))),o},Sc=ty(cy(Kd)),r0=e=>{const{subscribe:t}=F.useContext(Wo),[n,r]=F.useState(Kd(wy,e));return js(()=>{const i=t(Yr.addImage,()=>r(tc(rc,Xd,Sc(e)))),o=t(Yr.removeImage,()=>r(tc(rc,ry,Ng(1),Sc(e))));return()=>{i(),o()}}),n},i0=({picture:{position:e,dimension:t,url:n},scaleX:r,scaleY:i})=>A.jsx("li",{style:{backgroundImage:`url(${n})`,left:e.x*r,top:e.y*i,width:t.width*r,height:t.height*i}}),o0=(e,t)=>{let n;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{t(...r)},e)}},l0=e=>({width:e.clientWidth,height:e.clientHeight}),u0=()=>{const e=F.useRef(null),[t,n]=F.useState({width:0,height:0});return F.useLayoutEffect(()=>{var l;const r=(l=e.current)==null?void 0:l.parentElement;if(!r)return;const i=o0(50,()=>{const u=l0(r);F.startTransition(()=>{n(s=>Hd(s,u)?s:u)})}),o=new ResizeObserver(i);return o.observe(r),()=>o.disconnect()},[e]),[e,t]},s0=Bo.ol` - position: relative; - overflow: hidden; - width: 100%; - height: 100%; - transition: all 1s linear; - - > li { - position: absolute; - transition-property: width, left, top, height; - transition-duration: 1s; - background-repeat: no-repeat; - background-size: cover; - border: 0.5pt solid white; - } -`,kc=(e,t,n)=>e&&e.pictures.length>vy?Za(n,t)/Za(n,e.dimension):1,a0=({images:e})=>{const[t,n]=u0(),r=r0(e),{error:i,value:o}=n0(r,n),l=F.useMemo(()=>A.jsx(s0,{ref:t,className:"diorama-list",children:o==null?void 0:o.pictures.map(u=>A.jsx(i0,{picture:u,scaleX:kc(o,n,"width"),scaleY:kc(o,n,"height")},u.url))}),[t,o]);return Gg(i)?l:A.jsxs("div",{children:["Failed to layout: ",i.message]})},c0=_v` - body.show-crop .diorama-list > li { - background-size: contain; - } -`,f0=()=>{const{subscribe:e}=F.useContext(Wo);return js(()=>e(Yr.showCrop,()=>document.body.classList.toggle("show-crop"))),A.jsx(c0,{})},d0=Bo.div` - width: 100vw; - height: 100vh; -`,p0=({images:e})=>A.jsxs(Bv,{children:[A.jsx(f0,{}),A.jsx(d0,{children:A.jsx(a0,{images:e})})]});nn.fromNullable(document.getElementById("root")).ifNothing(()=>Fd("#root element not found")).map(Md).map(e=>bm(yy).then(t=>{e.render(A.jsx(F.StrictMode,{children:A.jsx(p0,{images:t})}))}).catch(()=>alert("Failed to load images"))); diff --git a/docs/assets/index-40c542ee.js b/docs/assets/index-40c542ee.js new file mode 100644 index 0000000..30aef54 --- /dev/null +++ b/docs/assets/index-40c542ee.js @@ -0,0 +1,87 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function _p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wc={exports:{}},yo={},Sc={exports:{}},R={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Vr=Symbol.for("react.element"),Ep=Symbol.for("react.portal"),xp=Symbol.for("react.fragment"),Cp=Symbol.for("react.strict_mode"),Pp=Symbol.for("react.profiler"),Np=Symbol.for("react.provider"),zp=Symbol.for("react.context"),Op=Symbol.for("react.forward_ref"),Lp=Symbol.for("react.suspense"),Tp=Symbol.for("react.memo"),Rp=Symbol.for("react.lazy"),Ts=Symbol.iterator;function $p(e){return e===null||typeof e!="object"?null:(e=Ts&&e[Ts]||e["@@iterator"],typeof e=="function"?e:null)}var kc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_c=Object.assign,Ec={};function Kn(e,t,n){this.props=e,this.context=t,this.refs=Ec,this.updater=n||kc}Kn.prototype.isReactComponent={};Kn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Kn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xc(){}xc.prototype=Kn.prototype;function xu(e,t,n){this.props=e,this.context=t,this.refs=Ec,this.updater=n||kc}var Cu=xu.prototype=new xc;Cu.constructor=xu;_c(Cu,Kn.prototype);Cu.isPureReactComponent=!0;var Rs=Array.isArray,Cc=Object.prototype.hasOwnProperty,Pu={current:null},Pc={key:!0,ref:!0,__self:!0,__source:!0};function Nc(e,t,n){var r,i={},o=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(o=""+t.key),t)Cc.call(t,r)&&!Pc.hasOwnProperty(r)&&(i[r]=t[r]);var u=arguments.length-2;if(u===1)i.children=n;else if(1>>1,J=x[I];if(0>>1;Ii(ot,z))jei(Ze,ot)?(x[I]=Ze,x[je]=z,I=je):(x[I]=ot,x[Ie]=z,I=Ie);else if(jei(Ze,z))x[I]=Ze,x[je]=z,I=je;else break e}}return N}function i(x,N){var z=x.sortIndex-N.sortIndex;return z!==0?z:x.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var s=[],a=[],h=1,m=null,p=3,y=!1,v=!1,k=!1,L=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(x){for(var N=n(a);N!==null;){if(N.callback===null)r(a);else if(N.startTime<=x)r(a),N.sortIndex=N.expirationTime,t(s,N);else break;N=n(a)}}function g(x){if(k=!1,d(x),!v)if(n(s)!==null)v=!0,Jn(E);else{var N=n(a);N!==null&&Vt(g,N.startTime-x)}}function E(x,N){v=!1,k&&(k=!1,f(P),P=-1),y=!0;var z=p;try{for(d(N),m=n(s);m!==null&&(!(m.expirationTime>N)||x&&!Pe());){var I=m.callback;if(typeof I=="function"){m.callback=null,p=m.priorityLevel;var J=I(m.expirationTime<=N);N=e.unstable_now(),typeof J=="function"?m.callback=J:m===n(s)&&r(s),d(N)}else r(s);m=n(s)}if(m!==null)var vt=!0;else{var Ie=n(a);Ie!==null&&Vt(g,Ie.startTime-N),vt=!1}return vt}finally{m=null,p=z,y=!1}}var _=!1,w=null,P=-1,A=5,T=-1;function Pe(){return!(e.unstable_now()-Tx||125I?(x.sortIndex=z,t(a,x),n(s)===null&&x===n(a)&&(k?(f(P),P=-1):k=!0,Vt(g,z-I))):(x.sortIndex=J,t(s,x),v||y||(v=!0,Jn(E))),x},e.unstable_shouldYield=Pe,e.unstable_wrapCallback=function(x){var N=p;return function(){var z=p;p=N;try{return x.apply(this,arguments)}finally{p=z}}}})(Tc);Lc.exports=Tc;var Vp=Lc.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Rc=M,Te=Vp;function S(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_l=Object.prototype.hasOwnProperty,Qp=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Is={},js={};function Yp(e){return _l.call(js,e)?!0:_l.call(Is,e)?!1:Qp.test(e)?js[e]=!0:(Is[e]=!0,!1)}function Kp(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Gp(e,t,n,r){if(t===null||typeof t>"u"||Kp(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Se(e,t,n,r,i,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var de={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){de[e]=new Se(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];de[t]=new Se(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){de[e]=new Se(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){de[e]=new Se(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){de[e]=new Se(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){de[e]=new Se(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){de[e]=new Se(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){de[e]=new Se(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){de[e]=new Se(e,5,!1,e.toLowerCase(),null,!1,!1)});var zu=/[\-:]([a-z])/g;function Ou(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(zu,Ou);de[t]=new Se(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(zu,Ou);de[t]=new Se(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(zu,Ou);de[t]=new Se(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){de[e]=new Se(e,1,!1,e.toLowerCase(),null,!1,!1)});de.xlinkHref=new Se("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){de[e]=new Se(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lu(e,t,n,r){var i=de.hasOwnProperty(t)?de[t]:null;(i!==null?i.type!==0:r||!(2u||i[l]!==o[u]){var s=` +`+i[l].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=l&&0<=u);break}}}finally{Vo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ur(e):""}function Xp(e){switch(e.tag){case 5:return ur(e.type);case 16:return ur("Lazy");case 13:return ur("Suspense");case 19:return ur("SuspenseList");case 0:case 2:case 15:return e=Qo(e.type,!1),e;case 11:return e=Qo(e.type.render,!1),e;case 1:return e=Qo(e.type,!0),e;default:return""}}function Pl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case gn:return"Fragment";case mn:return"Portal";case El:return"Profiler";case Tu:return"StrictMode";case xl:return"Suspense";case Cl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case jc:return(e.displayName||"Context")+".Consumer";case Ic:return(e._context.displayName||"Context")+".Provider";case Ru:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $u:return t=e.displayName||null,t!==null?t:Pl(e.type)||"Memo";case _t:t=e._payload,e=e._init;try{return Pl(e(t))}catch{}}return null}function qp(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Pl(t);case 8:return t===Tu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ft(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jp(e){var t=Fc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ei(e){e._valueTracker||(e._valueTracker=Jp(e))}function Dc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Fc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Mi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Nl(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Fs(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ft(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ac(e,t){t=t.checked,t!=null&&Lu(e,"checked",t,!1)}function zl(e,t){Ac(e,t);var n=Ft(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ol(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ol(e,t.type,Ft(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ds(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ol(e,t,n){(t!=="number"||Mi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var sr=Array.isArray;function zn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=ti.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function xr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Zp=["Webkit","ms","Moz","O"];Object.keys(dr).forEach(function(e){Zp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),dr[t]=dr[e]})});function Hc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||dr.hasOwnProperty(e)&&dr[e]?(""+t).trim():t+"px"}function Vc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Hc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var bp=X({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Rl(e,t){if(t){if(bp[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(S(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(S(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(S(61))}if(t.style!=null&&typeof t.style!="object")throw Error(S(62))}}function $l(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Il=null;function Iu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jl=null,On=null,Ln=null;function Bs(e){if(e=Kr(e)){if(typeof jl!="function")throw Error(S(280));var t=e.stateNode;t&&(t=_o(t),jl(e.stateNode,e.type,t))}}function Qc(e){On?Ln?Ln.push(e):Ln=[e]:On=e}function Yc(){if(On){var e=On,t=Ln;if(Ln=On=null,Bs(e),t)for(e=0;e>>=0,e===0?32:31-(ch(e)/fh|0)|0}var ni=64,ri=4194304;function ar(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ui(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var u=l&~i;u!==0?r=ar(u):(o&=l,o!==0&&(r=ar(o)))}else l=n&~i,l!==0?r=ar(l):o!==0&&(r=ar(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Qr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ge(t),e[t]=n}function mh(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=hr),qs=String.fromCharCode(32),Js=!1;function pf(e,t){switch(e){case"keyup":return Hh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yn=!1;function Qh(e,t){switch(e){case"compositionend":return hf(t);case"keypress":return t.which!==32?null:(Js=!0,qs);case"textInput":return e=t.data,e===qs&&Js?null:e;default:return null}}function Yh(e,t){if(yn)return e==="compositionend"||!Wu&&pf(e,t)?(e=ff(),ki=Au=Pt=null,yn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ta(n)}}function vf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wf(){for(var e=window,t=Mi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Mi(e.document)}return t}function Hu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function tm(e){var t=wf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&vf(n.ownerDocument.documentElement,n)){if(r!==null&&Hu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=na(n,o);var l=na(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,vn=null,Bl=null,gr=null,Wl=!1;function ra(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wl||vn==null||vn!==Mi(r)||(r=vn,"selectionStart"in r&&Hu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),gr&&Lr(gr,r)||(gr=r,r=Hi(Bl,"onSelect"),0kn||(e.current=Gl[kn],Gl[kn]=null,kn--)}function U(e,t){kn++,Gl[kn]=e.current,e.current=t}var Dt={},ge=Ut(Dt),Ee=Ut(!1),on=Dt;function jn(e,t){var n=e.type.contextTypes;if(!n)return Dt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xe(e){return e=e.childContextTypes,e!=null}function Qi(){V(Ee),V(ge)}function ca(e,t,n){if(ge.current!==Dt)throw Error(S(168));U(ge,t),U(Ee,n)}function zf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(S(108,qp(e)||"Unknown",i));return X({},n,r)}function Yi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Dt,on=ge.current,U(ge,e),U(Ee,Ee.current),!0}function fa(e,t,n){var r=e.stateNode;if(!r)throw Error(S(169));n?(e=zf(e,t,on),r.__reactInternalMemoizedMergedChildContext=e,V(Ee),V(ge),U(ge,e)):V(Ee),U(Ee,n)}var st=null,Eo=!1,ol=!1;function Of(e){st===null?st=[e]:st.push(e)}function pm(e){Eo=!0,Of(e)}function Bt(){if(!ol&&st!==null){ol=!0;var e=0,t=F;try{var n=st;for(F=1;e>=l,i-=l,at=1<<32-Ge(t)+i|n<P?(A=w,w=null):A=w.sibling;var T=p(f,w,d[P],g);if(T===null){w===null&&(w=A);break}e&&w&&T.alternate===null&&t(f,w),c=o(T,c,P),_===null?E=T:_.sibling=T,_=T,w=A}if(P===d.length)return n(f,w),Y&&Yt(f,P),E;if(w===null){for(;PP?(A=w,w=null):A=w.sibling;var Pe=p(f,w,T.value,g);if(Pe===null){w===null&&(w=A);break}e&&w&&Pe.alternate===null&&t(f,w),c=o(Pe,c,P),_===null?E=Pe:_.sibling=Pe,_=Pe,w=A}if(T.done)return n(f,w),Y&&Yt(f,P),E;if(w===null){for(;!T.done;P++,T=d.next())T=m(f,T.value,g),T!==null&&(c=o(T,c,P),_===null?E=T:_.sibling=T,_=T);return Y&&Yt(f,P),E}for(w=r(f,w);!T.done;P++,T=d.next())T=y(w,f,P,T.value,g),T!==null&&(e&&T.alternate!==null&&w.delete(T.key===null?P:T.key),c=o(T,c,P),_===null?E=T:_.sibling=T,_=T);return e&&w.forEach(function(Wt){return t(f,Wt)}),Y&&Yt(f,P),E}function L(f,c,d,g){if(typeof d=="object"&&d!==null&&d.type===gn&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case br:e:{for(var E=d.key,_=c;_!==null;){if(_.key===E){if(E=d.type,E===gn){if(_.tag===7){n(f,_.sibling),c=i(_,d.props.children),c.return=f,f=c;break e}}else if(_.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===_t&&va(E)===_.type){n(f,_.sibling),c=i(_,d.props),c.ref=rr(f,_,d),c.return=f,f=c;break e}n(f,_);break}else t(f,_);_=_.sibling}d.type===gn?(c=en(d.props.children,f.mode,g,d.key),c.return=f,f=c):(g=Oi(d.type,d.key,d.props,null,f.mode,g),g.ref=rr(f,c,d),g.return=f,f=g)}return l(f);case mn:e:{for(_=d.key;c!==null;){if(c.key===_)if(c.tag===4&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(f,c.sibling),c=i(c,d.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=pl(d,f.mode,g),c.return=f,f=c}return l(f);case _t:return _=d._init,L(f,c,_(d._payload),g)}if(sr(d))return v(f,c,d,g);if(Zn(d))return k(f,c,d,g);ci(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,c!==null&&c.tag===6?(n(f,c.sibling),c=i(c,d),c.return=f,f=c):(n(f,c),c=dl(d,f.mode,g),c.return=f,f=c),l(f)):n(f,c)}return L}var Fn=Ff(!0),Df=Ff(!1),Gr={},it=Ut(Gr),Ir=Ut(Gr),jr=Ut(Gr);function Jt(e){if(e===Gr)throw Error(S(174));return e}function Zu(e,t){switch(U(jr,t),U(Ir,e),U(it,Gr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Tl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Tl(t,e)}V(it),U(it,t)}function Dn(){V(it),V(Ir),V(jr)}function Af(e){Jt(jr.current);var t=Jt(it.current),n=Tl(t,e.type);t!==n&&(U(Ir,e),U(it,n))}function bu(e){Ir.current===e&&(V(it),V(Ir))}var K=Ut(0);function Zi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ll=[];function es(){for(var e=0;en?n:4,e(!0);var r=ul.transition;ul.transition={};try{e(!1),t()}finally{F=n,ul.transition=r}}function td(){return Be().memoizedState}function ym(e,t,n){var r=It(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},nd(e))rd(t,n);else if(n=$f(e,t,n,r),n!==null){var i=ve();Xe(n,e,r,i),id(n,t,r)}}function vm(e,t,n){var r=It(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(nd(e))rd(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,u=o(l,n);if(i.hasEagerState=!0,i.eagerState=u,Je(u,l)){var s=t.interleaved;s===null?(i.next=i,qu(t)):(i.next=s.next,s.next=i),t.interleaved=i;return}}catch{}finally{}n=$f(e,t,i,r),n!==null&&(i=ve(),Xe(n,e,r,i),id(n,t,r))}}function nd(e){var t=e.alternate;return e===G||t!==null&&t===G}function rd(e,t){yr=bi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function id(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mu(e,n)}}var eo={readContext:Ue,useCallback:pe,useContext:pe,useEffect:pe,useImperativeHandle:pe,useInsertionEffect:pe,useLayoutEffect:pe,useMemo:pe,useReducer:pe,useRef:pe,useState:pe,useDebugValue:pe,useDeferredValue:pe,useTransition:pe,useMutableSource:pe,useSyncExternalStore:pe,useId:pe,unstable_isNewReconciler:!1},wm={readContext:Ue,useCallback:function(e,t){return et().memoizedState=[e,t===void 0?null:t],e},useContext:Ue,useEffect:Sa,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ci(4194308,4,qf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ci(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ci(4,2,e,t)},useMemo:function(e,t){var n=et();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=et();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ym.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=et();return e={current:e},t.memoizedState=e},useState:wa,useDebugValue:os,useDeferredValue:function(e){return et().memoizedState=e},useTransition:function(){var e=wa(!1),t=e[0];return e=gm.bind(null,e[1]),et().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=G,i=et();if(Y){if(n===void 0)throw Error(S(407));n=n()}else{if(n=t(),ae===null)throw Error(S(349));un&30||Wf(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Sa(Vf.bind(null,r,o,e),[e]),r.flags|=2048,Dr(9,Hf.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=et(),t=ae.identifierPrefix;if(Y){var n=ct,r=at;n=(r&~(1<<32-Ge(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Mr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[nt]=t,e[$r]=r,pd(e,t,!1,!1),t.stateNode=e;e:{switch(l=$l(n,r),n){case"dialog":B("cancel",e),B("close",e),i=r;break;case"iframe":case"object":case"embed":B("load",e),i=r;break;case"video":case"audio":for(i=0;iUn&&(t.flags|=128,r=!0,ir(o,!1),t.lanes=4194304)}else{if(!r)if(e=Zi(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ir(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Y)return he(t),null}else 2*Z()-o.renderingStartTime>Un&&n!==1073741824&&(t.flags|=128,r=!0,ir(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Z(),t.sibling=null,n=K.current,U(K,r?n&1|2:n&1),t):(he(t),null);case 22:case 23:return fs(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ze&1073741824&&(he(t),t.subtreeFlags&6&&(t.flags|=8192)):he(t),null;case 24:return null;case 25:return null}throw Error(S(156,t.tag))}function Nm(e,t){switch(Qu(t),t.tag){case 1:return xe(t.type)&&Qi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dn(),V(Ee),V(ge),es(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bu(t),null;case 13:if(V(K),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(S(340));Mn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(K),null;case 4:return Dn(),null;case 10:return Xu(t.type._context),null;case 22:case 23:return fs(),null;case 24:return null;default:return null}}var di=!1,me=!1,zm=typeof WeakSet=="function"?WeakSet:Set,C=null;function Cn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){q(e,t,r)}else n.current=null}function lu(e,t,n){try{n()}catch(r){q(e,t,r)}}var Oa=!1;function Om(e,t){if(Hl=Bi,e=wf(),Hu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,u=-1,s=-1,a=0,h=0,m=e,p=null;t:for(;;){for(var y;m!==n||i!==0&&m.nodeType!==3||(u=l+i),m!==o||r!==0&&m.nodeType!==3||(s=l+r),m.nodeType===3&&(l+=m.nodeValue.length),(y=m.firstChild)!==null;)p=m,m=y;for(;;){if(m===e)break t;if(p===n&&++a===i&&(u=l),p===o&&++h===r&&(s=l),(y=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=y}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Vl={focusedElem:e,selectionRange:n},Bi=!1,C=t;C!==null;)if(t=C,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,C=e;else for(;C!==null;){t=C;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var k=v.memoizedProps,L=v.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?k:Ve(t.type,k),L);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(S(163))}}catch(g){q(t,t.return,g)}if(e=t.sibling,e!==null){e.return=t.return,C=e;break}C=t.return}return v=Oa,Oa=!1,v}function vr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&lu(t,n,o)}i=i.next}while(i!==r)}}function Po(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function uu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function gd(e){var t=e.alternate;t!==null&&(e.alternate=null,gd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nt],delete t[$r],delete t[Kl],delete t[fm],delete t[dm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function yd(e){return e.tag===5||e.tag===3||e.tag===4}function La(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function su(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vi));else if(r!==4&&(e=e.child,e!==null))for(su(e,t,n),e=e.sibling;e!==null;)su(e,t,n),e=e.sibling}function au(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(au(e,t,n),e=e.sibling;e!==null;)au(e,t,n),e=e.sibling}var ce=null,Qe=!1;function St(e,t,n){for(n=n.child;n!==null;)vd(e,t,n),n=n.sibling}function vd(e,t,n){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(vo,n)}catch{}switch(n.tag){case 5:me||Cn(n,t);case 6:var r=ce,i=Qe;ce=null,St(e,t,n),ce=r,Qe=i,ce!==null&&(Qe?(e=ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ce.removeChild(n.stateNode));break;case 18:ce!==null&&(Qe?(e=ce,n=n.stateNode,e.nodeType===8?il(e.parentNode,n):e.nodeType===1&&il(e,n),zr(e)):il(ce,n.stateNode));break;case 4:r=ce,i=Qe,ce=n.stateNode.containerInfo,Qe=!0,St(e,t,n),ce=r,Qe=i;break;case 0:case 11:case 14:case 15:if(!me&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&lu(n,t,l),i=i.next}while(i!==r)}St(e,t,n);break;case 1:if(!me&&(Cn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){q(n,t,u)}St(e,t,n);break;case 21:St(e,t,n);break;case 22:n.mode&1?(me=(r=me)||n.memoizedState!==null,St(e,t,n),me=r):St(e,t,n);break;default:St(e,t,n)}}function Ta(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new zm),t.forEach(function(r){var i=Dm.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function He(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Z()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Tm(r/1960))-r,10e?16:e,Nt===null)var r=!1;else{if(e=Nt,Nt=null,ro=0,$&6)throw Error(S(331));var i=$;for($|=4,C=e.current;C!==null;){var o=C,l=o.child;if(C.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sZ()-as?bt(e,0):ss|=n),Ce(e,t)}function Pd(e,t){t===0&&(e.mode&1?(t=ri,ri<<=1,!(ri&130023424)&&(ri=4194304)):t=1);var n=ve();e=mt(e,t),e!==null&&(Qr(e,t,n),Ce(e,n))}function Fm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Pd(e,n)}function Dm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(S(314))}r!==null&&r.delete(t),Pd(e,n)}var Nd;Nd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ee.current)_e=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return _e=!1,Cm(e,t,n);_e=!!(e.flags&131072)}else _e=!1,Y&&t.flags&1048576&&Lf(t,Gi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Pi(e,t),e=t.pendingProps;var i=jn(t,ge.current);Rn(t,n),i=ns(null,t,r,e,i,n);var o=rs();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xe(r)?(o=!0,Yi(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ju(t),i.updater=xo,t.stateNode=i,i._reactInternals=t,bl(t,r,e,n),t=nu(null,t,r,!0,o,n)):(t.tag=0,Y&&o&&Vu(t),ye(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Pi(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Um(r),e=Ve(r,e),i){case 0:t=tu(null,t,r,e,n);break e;case 1:t=Pa(null,t,r,e,n);break e;case 11:t=xa(null,t,r,e,n);break e;case 14:t=Ca(null,t,r,Ve(r.type,e),n);break e}throw Error(S(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ve(r,i),tu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ve(r,i),Pa(e,t,r,i,n);case 3:e:{if(cd(t),e===null)throw Error(S(387));r=t.pendingProps,o=t.memoizedState,i=o.element,If(e,t),Ji(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=An(Error(S(423)),t),t=Na(e,t,r,n,i);break e}else if(r!==i){i=An(Error(S(424)),t),t=Na(e,t,r,n,i);break e}else for(Oe=Tt(t.stateNode.containerInfo.firstChild),Le=t,Y=!0,Ye=null,n=Df(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Mn(),r===i){t=gt(e,t,n);break e}ye(e,t,r,n)}t=t.child}return t;case 5:return Af(t),e===null&&ql(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,Ql(r,i)?l=null:o!==null&&Ql(r,o)&&(t.flags|=32),ad(e,t),ye(e,t,l,n),t.child;case 6:return e===null&&ql(t),null;case 13:return fd(e,t,n);case 4:return Zu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fn(t,null,r,n):ye(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ve(r,i),xa(e,t,r,i,n);case 7:return ye(e,t,t.pendingProps,n),t.child;case 8:return ye(e,t,t.pendingProps.children,n),t.child;case 12:return ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,l=i.value,U(Xi,r._currentValue),r._currentValue=l,o!==null)if(Je(o.value,l)){if(o.children===i.children&&!Ee.current){t=gt(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){l=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=ft(-1,n&-n),s.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var h=a.pending;h===null?s.next=s:(s.next=h.next,h.next=s),a.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),Jl(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(S(341));l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),Jl(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}ye(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Rn(t,n),i=Ue(i),r=r(i),t.flags|=1,ye(e,t,r,n),t.child;case 14:return r=t.type,i=Ve(r,t.pendingProps),i=Ve(r.type,i),Ca(e,t,r,i,n);case 15:return ud(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ve(r,i),Pi(e,t),t.tag=1,xe(r)?(e=!0,Yi(t)):e=!1,Rn(t,n),Mf(t,r,i),bl(t,r,i,n),nu(null,t,r,!0,e,n);case 19:return dd(e,t,n);case 22:return sd(e,t,n)}throw Error(S(156,t.tag))};function zd(e,t){return bc(e,t)}function Am(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function De(e,t,n,r){return new Am(e,t,n,r)}function ps(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Um(e){if(typeof e=="function")return ps(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ru)return 11;if(e===$u)return 14}return 2}function jt(e,t){var n=e.alternate;return n===null?(n=De(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Oi(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")ps(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case gn:return en(n.children,i,o,t);case Tu:l=8,i|=8;break;case El:return e=De(12,n,t,i|2),e.elementType=El,e.lanes=o,e;case xl:return e=De(13,n,t,i),e.elementType=xl,e.lanes=o,e;case Cl:return e=De(19,n,t,i),e.elementType=Cl,e.lanes=o,e;case Mc:return zo(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ic:l=10;break e;case jc:l=9;break e;case Ru:l=11;break e;case $u:l=14;break e;case _t:l=16,r=null;break e}throw Error(S(130,e==null?e:typeof e,""))}return t=De(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function en(e,t,n,r){return e=De(7,e,r,t),e.lanes=n,e}function zo(e,t,n,r){return e=De(22,e,r,t),e.elementType=Mc,e.lanes=n,e.stateNode={isHidden:!1},e}function dl(e,t,n){return e=De(6,e,null,t),e.lanes=n,e}function pl(e,t,n){return t=De(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bm(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ko(0),this.expirationTimes=Ko(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ko(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hs(e,t,n,r,i,o,l,u,s){return e=new Bm(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=De(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ju(o),e}function Wm(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rd)}catch(e){console.error(e)}}Rd(),Oc.exports=Re;var Km=Oc.exports,$d,Aa=Km;$d=Aa.createRoot,Aa.hydrateRoot;const tn={of(e){return Ke(e)},empty(){return ue},zero(){return ue},fromNullable(e){return e==null?ue:Ke(e)},fromFalsy(e){return e?Ke(e):ue},fromPredicate(e,t){switch(arguments.length){case 1:return n=>tn.fromPredicate(e,n);default:return e(t)?Ke(t):ue}},mapMaybe(e,t){switch(arguments.length){case 1:return n=>tn.mapMaybe(e,n);default:return tn.catMaybes(t.map(e))}},catMaybes(e){let t=[];for(const n of e)n.isJust()&&t.push(n.extract());return t},encase(e){try{return Ke(e())}catch{return ue}},isMaybe(e){return e instanceof vs||e instanceof ws},sequence(e){let t=[];for(const n of e)if(n.isJust())t.push(n.extract());else return ue;return Ke(t)},"fantasy-land/of"(e){return this.of(e)},"fantasy-land/empty"(){return this.empty()},"fantasy-land/zero"(){return this.zero()}};class vs{constructor(t){this.__value=t,this["fantasy-land/equals"]=this.equals,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/alt"]=this.alt,this["fantasy-land/chain"]=this.chain,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend,this["fantasy-land/filter"]=this.filter}isJust(){return!0}isNothing(){return!1}inspect(){return`Just(${this.__value})`}toString(){return this.inspect()}toJSON(){const t=this.__value;return t instanceof Date?t.toJSON():t}equals(t){return this.extract()===t.extract()}map(t){return Ke(t(this.__value))}ap(t){return t.isJust()?this.map(t.extract()):ue}alt(t){return this}altLazy(t){return this}chain(t){return t(this.__value)}chainNullable(t){return tn.fromNullable(t(this.__value))}join(){return this.__value}reduce(t,n){return t(n,this.__value)}extend(t){return Ke(t(this))}unsafeCoerce(){return this.__value}caseOf(t){return"_"in t?t._():t.Just(this.__value)}orDefault(t){return this.__value}orDefaultLazy(t){return this.__value}toList(){return[this.__value]}mapOrDefault(t,n){return t(this.__value)}extract(){return this.__value}extractNullable(){return this.__value}toEither(t){return Mt(this.__value)}ifJust(t){return t(this.__value),this}ifNothing(t){return this}filter(t){return t(this.__value)?Ke(this.__value):ue}}vs.prototype.constructor=tn;class ws{constructor(){this["fantasy-land/equals"]=this.equals,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/alt"]=this.alt,this["fantasy-land/chain"]=this.chain,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend,this["fantasy-land/filter"]=this.filter}isJust(){return!1}isNothing(){return!0}inspect(){return"Nothing"}toString(){return this.inspect()}toJSON(){return this.__value}equals(t){return this.extract()===t.extract()}map(t){return ue}ap(t){return ue}alt(t){return t}altLazy(t){return t()}chain(t){return ue}chainNullable(t){return ue}join(){return ue}reduce(t,n){return n}extend(t){return ue}unsafeCoerce(){throw new Error("Maybe#unsafeCoerce was ran on a Nothing")}caseOf(t){return"_"in t?t._():t.Nothing()}orDefault(t){return t}orDefaultLazy(t){return t()}toList(){return[]}mapOrDefault(t,n){return n}extract(){}extractNullable(){return null}toEither(t){return Ur(t)}ifJust(t){return this}ifNothing(t){return t(),this}filter(t){return ue}}ws.prototype.constructor=tn;const Ke=e=>new vs(e),ue=new ws,Ss={of(e){return Mt(e)},lefts(e){let t=[];for(const n of e)n.isLeft()&&t.push(n.extract());return t},rights(e){let t=[];for(const n of e)n.isRight()&&t.push(n.extract());return t},encase(e){try{return Mt(e())}catch(t){return Ur(t)}},sequence(e){let t=[];for(const n of e){if(n.isLeft())return n;t.push(n.extract())}return Mt(t)},isEither(e){return e instanceof _s||e instanceof ks},"fantasy-land/of"(e){return Ss.of(e)}};class ks{constructor(t){this.__value=t,this._="R",this["fantasy-land/bimap"]=this.bimap,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/equals"]=this.equals,this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend}isLeft(){return!1}isRight(){return!0}toJSON(){return this.__value}inspect(){return`Right(${this.__value})`}toString(){return this.inspect()}bimap(t,n){return Mt(n(this.__value))}map(t){return Mt(t(this.__value))}mapLeft(t){return this}ap(t){return t.isRight()?this.map(t.extract()):t}equals(t){return t.isRight()?this.__value===t.extract():!1}chain(t){return t(this.__value)}chainLeft(t){return this}join(){return this.__value}alt(t){return this}altLazy(t){return this}reduce(t,n){return t(n,this.__value)}extend(t){return Mt(t(this))}unsafeCoerce(){return this.__value}caseOf(t){return"_"in t?t._():t.Right(this.__value)}leftOrDefault(t){return t}orDefault(t){return this.__value}orDefaultLazy(t){return this.__value}leftOrDefaultLazy(t){return t()}ifLeft(t){return this}ifRight(t){return t(this.__value),this}toMaybe(){return Ke(this.__value)}leftToMaybe(){return ue}extract(){return this.__value}swap(){return Ur(this.__value)}}ks.prototype.constructor=Ss;class _s{constructor(t){this.__value=t,this._="L",this["fantasy-land/bimap"]=this.bimap,this["fantasy-land/map"]=this.map,this["fantasy-land/ap"]=this.ap,this["fantasy-land/equals"]=this.equals,this["fantasy-land/chain"]=this.chain,this["fantasy-land/alt"]=this.alt,this["fantasy-land/reduce"]=this.reduce,this["fantasy-land/extend"]=this.extend}isLeft(){return!0}isRight(){return!1}toJSON(){return this.__value}inspect(){return`Left(${JSON.stringify(this.__value)})`}toString(){return this.inspect()}bimap(t,n){return Ur(t(this.__value))}map(t){return this}mapLeft(t){return Ur(t(this.__value))}ap(t){return t.isLeft()?t:this}equals(t){return t.isLeft()?t.extract()===this.__value:!1}chain(t){return this}chainLeft(t){return t(this.__value)}join(){return this}alt(t){return t}altLazy(t){return t()}reduce(t,n){return n}extend(t){return this}unsafeCoerce(){throw this.__value instanceof Error?this.__value:new Error("Either#unsafeCoerce was ran on a Left")}caseOf(t){return"_"in t?t._():t.Left(this.__value)}leftOrDefault(t){return this.__value}orDefault(t){return t}orDefaultLazy(t){return t()}leftOrDefaultLazy(t){return this.__value}ifLeft(t){return t(this.__value),this}ifRight(t){return this}toMaybe(){return ue}leftToMaybe(){return Ke(this.__value)}extract(){return this.__value}swap(){return Mt(this.__value)}}_s.prototype.constructor=Ss;const Ur=e=>new _s(e),Mt=e=>new ks(e),Id=e=>{throw new Error(e)},Gm=e=>new Promise((t,n)=>{const r=new Image;r.onload=()=>t({dimension:{width:r.width,height:r.height},aspectRatio:r.width/r.height,url:e}),r.onerror=n,r.src=e}),Xm=e=>Promise.all(e.map(Gm));function H(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function se(e){return function t(n){return arguments.length===0||H(n)?t:e.apply(this,arguments)}}function ne(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return H(n)?t:se(function(i){return e(n,i)});default:return H(n)&&H(r)?t:H(n)?se(function(i){return e(i,r)}):H(r)?se(function(i){return e(n,i)}):e(n,r)}}}var qm=ne(function(t,n){return Number(t)+Number(n)});const jd=qm;function $o(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(n){return t.apply(this,arguments)};case 2:return function(n,r){return t.apply(this,arguments)};case 3:return function(n,r,i){return t.apply(this,arguments)};case 4:return function(n,r,i,o){return t.apply(this,arguments)};case 5:return function(n,r,i,o,l){return t.apply(this,arguments)};case 6:return function(n,r,i,o,l,u){return t.apply(this,arguments)};case 7:return function(n,r,i,o,l,u,s){return t.apply(this,arguments)};case 8:return function(n,r,i,o,l,u,s,a){return t.apply(this,arguments)};case 9:return function(n,r,i,o,l,u,s,a,h){return t.apply(this,arguments)};case 10:return function(n,r,i,o,l,u,s,a,h,m){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function Md(e,t,n){return function(){for(var r=[],i=0,o=e,l=0,u=!1;l=arguments.length)?s=t[l]:(s=arguments[i],i+=1),r[l]=s,H(s)?u=!0:o-=1,l+=1}return!u&&o<=0?n.apply(this,r):$o(Math.max(0,o),Md(e,r,n))}}var Jm=ne(function(t,n){return t===1?se(n):$o(t,Md(t,[],n))});const Fd=Jm;function Dd(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return H(n)?t:ne(function(o,l){return e(n,o,l)});case 2:return H(n)&&H(r)?t:H(n)?ne(function(o,l){return e(o,r,l)}):H(r)?ne(function(o,l){return e(n,o,l)}):se(function(o){return e(n,r,o)});default:return H(n)&&H(r)&&H(i)?t:H(n)&&H(r)?ne(function(o,l){return e(o,l,i)}):H(n)&&H(i)?ne(function(o,l){return e(o,r,l)}):H(r)&&H(i)?ne(function(o,l){return e(n,o,l)}):H(n)?se(function(o){return e(o,r,i)}):H(r)?se(function(o){return e(n,o,i)}):H(i)?se(function(o){return e(n,r,o)}):e(n,r,i)}}}const Br=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function Zm(e){return e!=null&&typeof e["@@transducer/step"]=="function"}function Ad(e,t,n){return function(){if(arguments.length===0)return n();var r=arguments[arguments.length-1];if(!Br(r)){for(var i=0;i=0;)n=Ha[r],uo(n,t)&&!og(i,n)&&(i[i.length]=n),r-=1;return i});const Wr=lg;var ug=se(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)});const Qa=ug;function Ya(e,t,n,r){var i=Ua(e),o=Ua(t);function l(u,s){return Es(u,s,n.slice(),r.slice())}return!Ba(function(u,s){return!Ba(l,s,u)},o,i)}function Es(e,t,n,r){if(hl(e,t))return!0;var i=Qa(e);if(i!==Qa(t))return!1;if(typeof e["fantasy-land/equals"]=="function"||typeof t["fantasy-land/equals"]=="function")return typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t)&&typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e);if(typeof e.equals=="function"||typeof t.equals=="function")return typeof e.equals=="function"&&e.equals(t)&&typeof t.equals=="function"&&t.equals(e);switch(i){case"Arguments":case"Array":case"Object":if(typeof e.constructor=="function"&&eg(e.constructor)==="Promise")return e===t;break;case"Boolean":case"Number":case"String":if(!(typeof e==typeof t&&hl(e.valueOf(),t.valueOf())))return!1;break;case"Date":if(!hl(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(!(e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.sticky===t.sticky&&e.unicode===t.unicode))return!1;break}for(var o=n.length-1;o>=0;){if(n[o]===e)return r[o]===t;o-=1}switch(i){case"Map":return e.size!==t.size?!1:Ya(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size!==t.size?!1:Ya(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var l=Wr(e);if(l.length!==Wr(t).length)return!1;var u=n.concat([e]),s=r.concat([t]);for(o=l.length-1;o>=0;){var a=l[o];if(!(uo(a,t)&&Es(t[a],e[a],u,s)))return!1;o-=1}return!0}var sg=ne(function(t,n){return Es(t,n,[],[])});const Ud=sg;function ag(e,t,n){var r,i;if(typeof e.indexOf=="function")switch(typeof t){case"number":if(t===0){for(r=1/t;n=0}function ml(e,t){for(var n=0,r=t.length,i=Array(r);n":Wd(l,u)},r=function(o,l){return ml(function(u){return gl(u)+": "+n(o[u])},l.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+ml(n,e).join(", ")+"))";case"[object Array]":return"["+ml(n,e).concat(r(e,Bd(function(o){return/^\d+$/.test(o)},Wr(e)))).join(", ")+"]";case"[object Boolean]":return typeof e=="object"?"new Boolean("+n(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?n(NaN):gl(fg(e)))+")";case"[object Map]":return"new Map("+n(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return typeof e=="object"?"new Number("+n(e.valueOf())+")":1/e===-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+n(Array.from(e).sort())+")";case"[object String]":return typeof e=="object"?"new String("+n(e.valueOf())+")":gl(e);case"[object Undefined]":return"undefined";default:if(typeof e.toString=="function"){var i=e.toString();if(i!=="[object Object]")return i}return"{"+r(e,Wr(e)).join(", ")+"}"}}var kg=se(function(t){return Wd(t,[])});const kr=kg;var _g=ne(function(t,n){if(t===n)return n;function r(s,a){if(s>a!=a>s)return a>s?a:s}var i=r(t,n);if(i!==void 0)return i;var o=r(typeof t,typeof n);if(o!==void 0)return o===typeof t?t:n;var l=kr(t),u=r(l,kr(n));return u!==void 0&&u===l?t:n});const Eg=_g,xg=Number.isInteger||function(t){return t<<0===t};function so(e){return Object.prototype.toString.call(e)==="[object String]"}var Cg=ne(function(t,n){var r=t<0?n.length+t:t;return so(n)?n.charAt(r):n[r]});const Pg=Cg;var Ng=ne(function(t,n){if(n!=null)return xg(t)?Pg(t,n):n[t]});const Ka=Ng;var zg=se(function(t){return Br(t)?!0:!t||typeof t!="object"||so(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1});const Og=zg;var Ga=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function Lg(e,t,n){return function(i,o,l){if(Og(l))return e(i,o,l);if(l==null)return o;if(typeof l["fantasy-land/reduce"]=="function")return t(i,o,l,"fantasy-land/reduce");if(l[Ga]!=null)return n(i,o,l[Ga]());if(typeof l.next=="function")return n(i,o,l);if(typeof l.reduce=="function")return t(i,o,l,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function Tg(e,t,n){for(var r=0,i=n.length;r=0&&this.i>=this.n?bm(r):r},e}();function ry(e){return function(t){return new ny(e,t)}}var iy=ne(Ad(["take"],ry,function(t,n){return Vd(0,t<0?1/0:t,n)}));const Qd=iy;var oy=se(function(t){return Fd(t.length,function(n,r){var i=Array.prototype.slice.call(arguments,0);return i[0]=r,i[1]=n,t.apply(this,i)})});const ly=oy;var uy=jd(1);const Yd=uy;function mu(e){return Object.prototype.toString.call(e)==="[object Number]"}var sy=se(function(t){return t!=null&&mu(t.length)?t.length:NaN});const Za=sy;var ay=ne(function(t,n){if(!(mu(t)&&mu(n)))throw new TypeError("Both arguments to range must be numbers");for(var r=[],i=t;i`./images/${e}.jpg`),mi=20,hy=8;var ie=function(){return ie=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0?le(qn,--We):0,Wn--,b===10&&(Wn=1,jo--),b}function qe(){return b=We2||yu(b)>3?"":" "}function Py(e,t){for(;--t&&qe()&&!(b<48||b>102||b>57&&b<65||b>70&&b<97););return Fo(e,Ti()+(t<6&&nn()==32&&qe()==32))}function vu(e){for(;qe();)switch(b){case e:return We;case 34:case 39:e!==34&&e!==39&&vu(b);break;case 40:e===41&&vu(e);break;case 92:qe();break}return We}function Ny(e,t){for(;qe()&&e+b!==47+10;)if(e+b===42+42&&nn()===47)break;return"/*"+Fo(t,We-1)+"*"+Cs(e===47?e:qe())}function zy(e){for(;!yu(nn());)qe();return Fo(e,We)}function Oy(e){return xy(Ri("",null,null,null,[""],e=Ey(e),0,[0],e))}function Ri(e,t,n,r,i,o,l,u,s){for(var a=0,h=0,m=l,p=0,y=0,v=0,k=1,L=1,f=1,c=0,d="",g=i,E=o,_=r,w=d;L;)switch(v=c,c=qe()){case 40:if(v!=108&&le(w,m-1)==58){Li(w+=O(yl(c),"&","&\f"),"&\f")!=-1&&(f=-1);break}case 34:case 39:case 91:w+=yl(c);break;case 9:case 10:case 13:case 32:w+=Cy(v);break;case 92:w+=Py(Ti()-1,7);continue;case 47:switch(nn()){case 42:case 47:fr(Ly(Ny(qe(),Ti()),t,n,s),s);break;default:w+="/"}break;case 123*k:u[a++]=tt(w)*f;case 125*k:case 59:case 0:switch(c){case 0:case 125:L=0;case 59+h:f==-1&&(w=O(w,/\f/g,"")),y>0&&tt(w)-m&&fr(y>32?tc(w+";",r,n,m-1,s):tc(O(w," ","")+";",r,n,m-2,s),s);break;case 59:w+=";";default:if(fr(_=ec(w,t,n,a,h,i,u,d,g=[],E=[],m,o),o),c===123)if(h===0)Ri(w,t,_,_,g,o,m,u,E);else switch(p===99&&le(w,3)===110?100:p){case 100:case 108:case 109:case 115:Ri(e,_,_,r&&fr(ec(e,_,_,0,0,i,u,d,i,g=[],m,E),E),i,E,m,u,r?g:E);break;default:Ri(w,_,_,_,[""],E,0,u,E)}}a=h=y=0,k=f=1,d=w="",m=l;break;case 58:m=1+tt(w),y=v;default:if(k<1){if(c==123)--k;else if(c==125&&k++==0&&_y()==125)continue}switch(w+=Cs(c),c*k){case 38:f=h>0?1:(w+="\f",-1);break;case 44:u[a++]=(tt(w)-1)*f,f=1;break;case 64:nn()===45&&(w+=yl(qe())),p=nn(),h=m=tt(d=w+=zy(Ti())),c++;break;case 45:v===45&&tt(w)==2&&(k=0)}}return o}function ec(e,t,n,r,i,o,l,u,s,a,h,m){for(var p=i-1,y=i===0?o:[""],v=qd(y),k=0,L=0,f=0;k0?y[c]+" "+d:O(d,/&\f/g,y[c])))&&(s[f++]=g);return Mo(e,t,n,i===0?Io:u,s,a,h,m)}function Ly(e,t,n,r){return Mo(e,t,n,Kd,Cs(ky()),Bn(e,2,-2),0,r)}function tc(e,t,n,r,i){return Mo(e,t,n,xs,Bn(e,0,r),Bn(e,r+1,-1),r,i)}function Zd(e,t,n){switch(wy(e,t)){case 5103:return j+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return j+e+e;case 4789:return _r+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return j+e+_r+e+W+e+e;case 5936:switch(le(e,t+11)){case 114:return j+e+W+O(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return j+e+W+O(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return j+e+W+O(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return j+e+W+e+e;case 6165:return j+e+W+"flex-"+e+e;case 5187:return j+e+O(e,/(\w+).+(:[^]+)/,j+"box-$1$2"+W+"flex-$1$2")+e;case 5443:return j+e+W+"flex-item-"+O(e,/flex-|-self/g,"")+(ut(e,/flex-|baseline/)?"":W+"grid-row-"+O(e,/flex-|-self/g,""))+e;case 4675:return j+e+W+"flex-line-pack"+O(e,/align-content|flex-|-self/g,"")+e;case 5548:return j+e+W+O(e,"shrink","negative")+e;case 5292:return j+e+W+O(e,"basis","preferred-size")+e;case 6060:return j+"box-"+O(e,"-grow","")+j+e+W+O(e,"grow","positive")+e;case 4554:return j+O(e,/([^-])(transform)/g,"$1"+j+"$2")+e;case 6187:return O(O(O(e,/(zoom-|grab)/,j+"$1"),/(image-set)/,j+"$1"),e,"")+e;case 5495:case 3959:return O(e,/(image-set\([^]*)/,j+"$1$`$1");case 4968:return O(O(e,/(.+:)(flex-)?(.*)/,j+"box-pack:$3"+W+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+j+e+e;case 4200:if(!ut(e,/flex-|baseline/))return W+"grid-column-align"+Bn(e,t)+e;break;case 2592:case 3360:return W+O(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,ut(r.props,/grid-\w+-end/)})?~Li(e+(n=n[t].value),"span")?e:W+O(e,"-start","")+e+W+"grid-row-span:"+(~Li(n,"span")?ut(n,/\d+/):+ut(n,/\d+/)-+ut(e,/\d+/))+";":W+O(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return ut(r.props,/grid-\w+-start/)})?e:W+O(O(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return O(e,/(.+)-inline(.+)/,j+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(tt(e)-1-t>6)switch(le(e,t+1)){case 109:if(le(e,t+4)!==45)break;case 102:return O(e,/(.+:)(.+)-([^]+)/,"$1"+j+"$2-$3$1"+_r+(le(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Li(e,"stretch")?Zd(O(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return O(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,l,u,s,a){return W+i+":"+o+a+(l?W+i+"-span:"+(u?s:+s-+o)+a:"")+e});case 4949:if(le(e,t+6)===121)return O(e,":",":"+j)+e;break;case 6444:switch(le(e,le(e,14)===45?18:11)){case 120:return O(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+j+(le(e,14)===45?"inline-":"")+"box$3$1"+j+"$2$3$1"+W+"$2box$3")+e;case 100:return O(e,":",":"+W)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return O(e,"scroll-","scroll-snap-")+e}return e}function co(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case xs:e.return=Zd(e.value,e.length,n);return;case Gd:return co([kt(e,{value:O(e.value,"@","@"+j)})],r);case Io:if(e.length)return Sy(n=e.props,function(i){switch(ut(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":pn(kt(e,{props:[O(i,/:(read-\w+)/,":"+_r+"$1")]})),pn(kt(e,{props:[i]})),gu(e,{props:ba(n,r)});break;case"::placeholder":pn(kt(e,{props:[O(i,/:(plac\w+)/,":"+j+"input-$1")]})),pn(kt(e,{props:[O(i,/:(plac\w+)/,":"+_r+"$1")]})),pn(kt(e,{props:[O(i,/:(plac\w+)/,W+"input-$1")]})),pn(kt(e,{props:[i]})),gu(e,{props:ba(n,r)});break}return""})}}var jy={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Hn=typeof process<"u"&&process.env!==void 0&&({}.REACT_APP_SC_ATTR||{}.SC_ATTR)||"data-styled",Ps=typeof window<"u"&&"HTMLElement"in window,My=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&{}.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&{}.REACT_APP_SC_DISABLE_SPEEDY!==""?{}.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&{}.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&{}.SC_DISABLE_SPEEDY!==void 0&&{}.SC_DISABLE_SPEEDY!==""&&{}.SC_DISABLE_SPEEDY!=="false"&&{}.SC_DISABLE_SPEEDY),Do=Object.freeze([]),Vn=Object.freeze({});function Fy(e,t,n){return n===void 0&&(n=Vn),e.theme!==n.theme&&e.theme||t||n.theme}var bd=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Dy=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ay=/(^-|-$)/g;function nc(e){return e.replace(Dy,"-").replace(Ay,"")}var Uy=/(a)(d)/gi,rc=function(e){return String.fromCharCode(e+(e>25?39:97))};function wu(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=rc(t%52)+n;return(rc(t%52)+n).replace(Uy,"$1-$2")}var vl,Nn=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ep=function(e){return Nn(5381,e)};function By(e){return wu(ep(e)>>>0)}function Wy(e){return e.displayName||e.name||"Component"}function wl(e){return typeof e=="string"&&!0}var tp=typeof Symbol=="function"&&Symbol.for,np=tp?Symbol.for("react.memo"):60115,Hy=tp?Symbol.for("react.forward_ref"):60112,Vy={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Qy={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},rp={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Yy=((vl={})[Hy]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},vl[np]=rp,vl);function ic(e){return("type"in(t=e)&&t.type.$$typeof)===np?rp:"$$typeof"in e?Yy[e.$$typeof]:Vy;var t}var Ky=Object.defineProperty,Gy=Object.getOwnPropertyNames,oc=Object.getOwnPropertySymbols,Xy=Object.getOwnPropertyDescriptor,qy=Object.getPrototypeOf,lc=Object.prototype;function ip(e,t,n){if(typeof t!="string"){if(lc){var r=qy(t);r&&r!==lc&&ip(e,r,n)}var i=Gy(t);oc&&(i=i.concat(oc(t)));for(var o=ic(e),l=ic(t),u=0;u0?" Args: ".concat(t.join(", ")):""))}var Jy=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,o=i;t>=o;)if((o<<=1)<0)throw Xr(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var l=i;l=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),o=i+r,l=i;l=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(L+="".concat(f,","))}),s+="".concat(v).concat(k,'{content:"').concat(L,'"}').concat(`/*!sc*/ +`)},h=0;h0?".".concat(t):p},h=s.slice();h.push(function(p){p.type===Io&&p.value.includes("&")&&(p.props[0]=p.props[0].replace(s0,n).replace(r,a))}),l.prefix&&h.push(Iy),h.push(Ty);var m=function(p,y,v,k){y===void 0&&(y=""),v===void 0&&(v=""),k===void 0&&(k="&"),t=k,n=y,r=new RegExp("\\".concat(n,"\\b"),"g");var L=p.replace(a0,""),f=Oy(v||y?"".concat(v," ").concat(y," { ").concat(L," }"):L);l.namespace&&(f=up(f,l.namespace));var c=[];return co(f,Ry(h.concat($y(function(d){return c.push(d)})))),c};return m.hash=s.length?s.reduce(function(p,y){return y.name||Xr(15),Nn(p,y.name)},5381).toString():"",m}var f0=new lp,ku=c0(),sp=D.createContext({shouldForwardProp:void 0,styleSheet:f0,stylis:ku});sp.Consumer;D.createContext(void 0);function ac(){return M.useContext(sp)}var d0=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=ku);var l=r.name+o.hash;i.hasNameForId(r.id,l)||i.insertRules(r.id,l,o(r.rules,l,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,zs(this,function(){throw Xr(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=ku),this.name+t.hash},e}(),p0=function(e){return e>="A"&&e<="Z"};function cc(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,l)){var u=r(o,".".concat(l),void 0,this.componentId);n.insertRules(this.componentId,l,u)}i=Zt(i,l),this.staticRulesId=l}else{for(var s=Nn(this.baseHash,r.hash),a="",h=0;h>>0);n.hasNameForId(this.componentId,y)||n.insertRules(this.componentId,y,r(a,".".concat(y),void 0,this.componentId)),i=Zt(i,y)}}return i},e}(),fp=D.createContext(void 0);fp.Consumer;var Sl={};function y0(e,t,n){var r=Ns(e),i=e,o=!wl(e),l=t.attrs,u=l===void 0?Do:l,s=t.componentId,a=s===void 0?function(g,E){var _=typeof g!="string"?"sc":nc(g);Sl[_]=(Sl[_]||0)+1;var w="".concat(_,"-").concat(By("6.1.1"+_+Sl[_]));return E?"".concat(E,"-").concat(w):w}(t.displayName,t.parentComponentId):s,h=t.displayName,m=h===void 0?function(g){return wl(g)?"styled.".concat(g):"Styled(".concat(Wy(g),")")}(e):h,p=t.displayName&&t.componentId?"".concat(nc(t.displayName),"-").concat(t.componentId):t.componentId||a,y=r&&i.attrs?i.attrs.concat(u).filter(Boolean):u,v=t.shouldForwardProp;if(r&&i.shouldForwardProp){var k=i.shouldForwardProp;if(t.shouldForwardProp){var L=t.shouldForwardProp;v=function(g,E){return k(g,E)&&L(g,E)}}else v=k}var f=new g0(n,p,r?i.componentStyle:void 0);function c(g,E){return function(_,w,P){var A=_.attrs,T=_.componentStyle,Pe=_.defaultProps,Wt=_.foldedComponentIds,Ht=_.styledComponentId,qr=_.target,Uo=D.useContext(fp),Jn=ac(),Vt=_.shouldForwardProp||Jn.shouldForwardProp,x=function(Ie,ot,je){for(var Ze,Qt=ie(ie({},ot),{className:void 0,theme:je}),Bo=0;Bo=0)&&(n[i]=e[i]);return n}function Ao(e,t){if(e==null)return{};var n=w0(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var S0=["size","color"];function k0(e){var t=e.size,n=t===void 0?24:t,r=e.color,i=r===void 0?"currentColor":r,o=Ao(e,S0);return D.createElement("svg",Yn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-layout-grid-add",width:n,height:n,viewBox:"0 0 24 24",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},o),D.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),D.createElement("rect",{x:"4",y:"4",width:"6",height:"6",rx:"1"}),D.createElement("rect",{x:"14",y:"4",width:"6",height:"6",rx:"1"}),D.createElement("rect",{x:"4",y:"14",width:"6",height:"6",rx:"1"}),D.createElement("path",{d:"M14 17h6m-3 -3v6"}))}var _0=["size","color"];function E0(e){var t=e.size,n=t===void 0?24:t,r=e.color,i=r===void 0?"currentColor":r,o=Ao(e,_0);return D.createElement("svg",Yn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-refresh",width:n,height:n,viewBox:"0 0 24 24",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},o),D.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),D.createElement("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"}),D.createElement("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"}))}var x0=["size","color"];function C0(e){var t=e.size,n=t===void 0?24:t,r=e.color,i=r===void 0?"currentColor":r,o=Ao(e,x0);return D.createElement("svg",Yn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-trash",width:n,height:n,viewBox:"0 0 24 24",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},o),D.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),D.createElement("line",{x1:"4",y1:"7",x2:"20",y2:"7"}),D.createElement("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),D.createElement("line",{x1:"14",y1:"11",x2:"14",y2:"17"}),D.createElement("path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"}),D.createElement("path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"}))}var P0=["size","color"];function N0(e){var t=e.size,n=t===void 0?24:t,r=e.color,i=r===void 0?"currentColor":r,o=Ao(e,P0);return D.createElement("svg",Yn({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-window-maximize",width:n,height:n,viewBox:"0 0 24 24",stroke:i,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},o),D.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),D.createElement("rect",{x:"3",y:"16",width:"5",height:"5",rx:"1"}),D.createElement("path",{d:"M4 12v-6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-6"}),D.createElement("path",{d:"M12 8h4v4"}),D.createElement("path",{d:"M16 8l-5 5"}))}const z0=()=>new Proxy({},{get(e,t){return Id(`Object was not yet initialized [tried to access: ${String(t)}]`)}}),pc=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],dt=(()=>{if(typeof document>"u")return!1;const e=pc[0],t={};for(const n of pc)if((n==null?void 0:n[1])in document){for(const[i,o]of n.entries())t[e[i]]=o;return t}return!1})(),hc={change:dt.fullscreenchange,error:dt.fullscreenerror};let Ne={request(e=document.documentElement,t){return new Promise((n,r)=>{const i=()=>{Ne.off("change",i),n()};Ne.on("change",i);const o=e[dt.requestFullscreen](t);o instanceof Promise&&o.then(i).catch(r)})},exit(){return new Promise((e,t)=>{if(!Ne.isFullscreen){e();return}const n=()=>{Ne.off("change",n),e()};Ne.on("change",n);const r=document[dt.exitFullscreen]();r instanceof Promise&&r.then(n).catch(t)})},toggle(e,t){return Ne.isFullscreen?Ne.exit():Ne.request(e,t)},onchange(e){Ne.on("change",e)},onerror(e){Ne.on("error",e)},on(e,t){const n=hc[e];n&&document.addEventListener(n,t,!1)},off(e,t){const n=hc[e];n&&document.removeEventListener(n,t,!1)},raw:dt};Object.defineProperties(Ne,{isFullscreen:{get:()=>!!document[dt.fullscreenElement]},element:{enumerable:!0,get:()=>document[dt.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>!!document[dt.fullscreenEnabled]}});dt||(Ne={isEnabled:!1});const mc=Ne;function O0(){var e=M.useRef(!1),t=M.useCallback(function(){return e.current},[]);return M.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function L0(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=M.useRef(0),i=O0(),o=M.useState(n),l=o[0],u=o[1],s=M.useCallback(function(){for(var a=[],h=0;h(e.refresh="refresh",e.showCrop="showCrop",e.addImage="addImage",e.removeImage="removeImage",e))(po||{});const Ls=M.createContext(z0()),I0=Os.ol` + position: absolute; + display: flex; + gap: 10px; + top: 5px; + left: 5px; + width: fit-content; + height: auto; + z-index: 1; + background-color: rgb(108, 108, 108); + border-radius: 4px; + list-style: none; + padding: 4px; + box-shadow: inset 1px 1px 1px rgba(200, 200, 200, 0.7), inset -1px -1px 1px rgba(60, 60, 60, 0.7), + 3px 3px 7px -3px rgba(0, 0, 0, 0.7); + + > li { + display: contents; + } + + & button { + appearance: none; + background: none; + border: none; + cursor: pointer; + display: flex; + justify-items: center; + align-items: center; + width: 30px; + height: 30px; + border-radius: 2px; + + &:hover, + &:active { + background-color: rgba(200, 200, 200, 0.4); + } + } +`,j0=({children:e})=>{const[,{set:t,get:n}]=$0(),r=M.useCallback((l,u)=>{const s=n(l)??[];t(l,dy([u],s))},[t,n]),i=M.useCallback((l,u)=>{const s=n(l)??[];return t(l,Xg([u],s)),()=>r(l,u)},[n,t,r]),o=l=>()=>{const u=n(l);u==null||u.forEach(s=>s())};return Q.jsxs(Ls.Provider,{value:{subscribe:i},children:[Q.jsxs(I0,{children:[Q.jsx("li",{children:Q.jsx("button",{onClick:o("refresh"),title:"rearrange",children:Q.jsx(E0,{size:mi,color:"white"})})}),Q.jsx("li",{children:Q.jsx("button",{onClick:o("addImage"),title:"add image",children:Q.jsx(k0,{size:mi,color:"white"})})}),Q.jsx("li",{children:Q.jsx("button",{onClick:o("removeImage"),title:"remove image",children:Q.jsx(C0,{size:mi,color:"white"})})}),mc.isEnabled&&Q.jsx("li",{children:Q.jsx("button",{onClick:()=>void mc.request(),title:"fullscreen",children:Q.jsx(N0,{size:mi,color:"white"})})})]}),e]})};/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const hp=Symbol("Comlink.proxy"),M0=Symbol("Comlink.endpoint"),F0=Symbol("Comlink.releaseProxy"),kl=Symbol("Comlink.finalizer"),ji=Symbol("Comlink.thrown"),mp=e=>typeof e=="object"&&e!==null||typeof e=="function",D0={canHandle:e=>mp(e)&&e[hp],serialize(e){const{port1:t,port2:n}=new MessageChannel;return yp(e,t),[n,[n]]},deserialize(e){return e.start(),wp(e)}},A0={canHandle:e=>mp(e)&&ji in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},gp=new Map([["proxy",D0],["throw",A0]]);function U0(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function yp(e,t=globalThis,n=["*"]){t.addEventListener("message",function r(i){if(!i||!i.data)return;if(!U0(n,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:o,type:l,path:u}=Object.assign({path:[]},i.data),s=(i.data.argumentList||[]).map(Gt);let a;try{const h=u.slice(0,-1).reduce((p,y)=>p[y],e),m=u.reduce((p,y)=>p[y],e);switch(l){case"GET":a=m;break;case"SET":h[u.slice(-1)[0]]=Gt(i.data.value),a=!0;break;case"APPLY":a=m.apply(h,s);break;case"CONSTRUCT":{const p=new m(...s);a=Y0(p)}break;case"ENDPOINT":{const{port1:p,port2:y}=new MessageChannel;yp(e,y),a=Q0(p,[p])}break;case"RELEASE":a=void 0;break;default:return}}catch(h){a={value:h,[ji]:0}}Promise.resolve(a).catch(h=>({value:h,[ji]:0})).then(h=>{const[m,p]=go(h);t.postMessage(Object.assign(Object.assign({},m),{id:o}),p),l==="RELEASE"&&(t.removeEventListener("message",r),vp(t),kl in e&&typeof e[kl]=="function"&&e[kl]())}).catch(h=>{const[m,p]=go({value:new TypeError("Unserializable return value"),[ji]:0});t.postMessage(Object.assign(Object.assign({},m),{id:o}),p)})}),t.start&&t.start()}function B0(e){return e.constructor.name==="MessagePort"}function vp(e){B0(e)&&e.close()}function wp(e,t){return Eu(e,[],t)}function yi(e){if(e)throw new Error("Proxy has been released and is not useable")}function Sp(e){return hn(e,{type:"RELEASE"}).then(()=>{vp(e)})}const ho=new WeakMap,mo="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(ho.get(e)||0)-1;ho.set(e,t),t===0&&Sp(e)});function W0(e,t){const n=(ho.get(t)||0)+1;ho.set(t,n),mo&&mo.register(e,t,e)}function H0(e){mo&&mo.unregister(e)}function Eu(e,t=[],n=function(){}){let r=!1;const i=new Proxy(n,{get(o,l){if(yi(r),l===F0)return()=>{H0(i),Sp(e),r=!0};if(l==="then"){if(t.length===0)return{then:()=>i};const u=hn(e,{type:"GET",path:t.map(s=>s.toString())}).then(Gt);return u.then.bind(u)}return Eu(e,[...t,l])},set(o,l,u){yi(r);const[s,a]=go(u);return hn(e,{type:"SET",path:[...t,l].map(h=>h.toString()),value:s},a).then(Gt)},apply(o,l,u){yi(r);const s=t[t.length-1];if(s===M0)return hn(e,{type:"ENDPOINT"}).then(Gt);if(s==="bind")return Eu(e,t.slice(0,-1));const[a,h]=gc(u);return hn(e,{type:"APPLY",path:t.map(m=>m.toString()),argumentList:a},h).then(Gt)},construct(o,l){yi(r);const[u,s]=gc(l);return hn(e,{type:"CONSTRUCT",path:t.map(a=>a.toString()),argumentList:u},s).then(Gt)}});return W0(i,e),i}function V0(e){return Array.prototype.concat.apply([],e)}function gc(e){const t=e.map(go);return[t.map(n=>n[0]),V0(t.map(n=>n[1]))]}const kp=new WeakMap;function Q0(e,t){return kp.set(e,t),e}function Y0(e){return Object.assign(e,{[hp]:!0})}function go(e){for(const[t,n]of gp)if(n.canHandle(e)){const[r,i]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},i]}return[{type:"RAW",value:e},kp.get(e)||[]]}function Gt(e){switch(e.type){case"HANDLER":return gp.get(e.name).deserialize(e.value);case"RAW":return e.value}}function hn(e,t,n){return new Promise(r=>{const i=K0();e.addEventListener("message",function o(l){!l.data||!l.data.id||l.data.id!==i||(e.removeEventListener("message",o),r(l.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),n)})}function K0(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const G0=wp(new Worker(new URL("/diorama-2023/assets/find-solution-9294ca45.js",self.location))),X0=(e,t,n)=>G0.findSolution(e,t,n),q0=(e,t)=>{const[n,r]=M.useState(0),{subscribe:i}=M.useContext(Ls),[o,l]=L0(async()=>X0(e,t),[e.length,t.width,t.height,n]);return M.useLayoutEffect(()=>{t.width>0&&t.height>0&&l()},[l,e.length,t.width,t.height,n]),pp(()=>i(po.refresh,()=>r(Yd))),o},yc=Jg(ly(Qd)),J0=e=>{const{subscribe:t}=M.useContext(Ls),[n,r]=M.useState(Qd(hy,e));return pp(()=>{const i=t(po.addImage,()=>r(qa(Za,Yd,yc(e)))),o=t(po.removeImage,()=>r(qa(Za,bg,Eg(1),yc(e))));return()=>{i(),o()}}),n},Z0=({picture:{position:e,dimension:t,url:n},scaleX:r,scaleY:i,idx:o})=>{const l=t.width/t.height;return Q.jsx("li",{className:"photo-frame",style:{rotate:`${o%4-1.5}deg`,left:e.x*r,top:e.y*i,aspectRatio:l,width:t.width*r,height:t.height*i},children:Q.jsx("img",{className:"photo",src:n,alt:""})})},b0=(e,t)=>{let n;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{t(...r)},e)}},ev=e=>({width:e.clientWidth,height:e.clientHeight}),tv=()=>{const e=M.useRef(null),[t,n]=M.useState({width:0,height:0});return M.useLayoutEffect(()=>{var l;const r=(l=e.current)==null?void 0:l.parentElement;if(!r)return;const i=b0(50,()=>{const u=ev(r);M.startTransition(()=>{n(s=>Ud(s,u)?s:u)})}),o=new ResizeObserver(i);return o.observe(r),()=>o.disconnect()},[e]),[e,t]},vc=(e,t,n)=>Ka(n,t)/Ka(n,e.dimension),nv=({images:e})=>{const[t,n]=tv(),r=J0(e),{error:i,value:o}=q0(r,n),l=M.useMemo(()=>Q.jsx("ol",{ref:t,className:"diorama-list",children:o==null?void 0:o.pictures.map((u,s)=>Q.jsx(Z0,{picture:u,idx:s,scaleX:vc(o,n,"width"),scaleY:vc(o,n,"height")},u.url))}),[t,o]);return Hg(i)?l:Q.jsxs("div",{children:["Failed to layout: ",i.message]})},rv=Os.div` + width: 100vw; + height: 100vh; +`,iv=({images:e})=>Q.jsx(j0,{children:Q.jsx(rv,{children:Q.jsx(nv,{images:e})})});tn.fromNullable(document.getElementById("root")).ifNothing(()=>Id("#root element not found")).map($d).map(e=>Xm(py).then(t=>{e.render(Q.jsx(M.StrictMode,{children:Q.jsx(iv,{images:t})}))}).catch(()=>alert("Failed to load images"))); diff --git a/docs/assets/index-652be329.css b/docs/assets/index-652be329.css new file mode 100644 index 0000000..f76c551 --- /dev/null +++ b/docs/assets/index-652be329.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Roboto&display=swap";:root{font-family:Roboto,Arial,Helvetica,sans-serif}html{box-sizing:border-box;font-size:16px;overflow:hidden}*,*:before,*:after{box-sizing:inherit}body,h1,h2,h3,h4,h5,h6,p,ol,ul{margin:0;padding:0;font-weight:400;width:100vw;height:100vh}body.show-crop .image-gallery>li{background-size:contain!important}ol,ul{list-style:none}img{max-width:100%;height:auto}.diorama-list{position:relative;overflow:hidden;width:100%;height:100%;transition:all 1s linear}.photo-frame{display:flex;border:10px solid transparent;position:absolute;transition-property:left,top;transition-duration:1s;justify-content:center;align-items:center}.photo-frame .photo{border:5px solid white;border-radius:3px;box-shadow:1px 1px 3px #00000080;max-width:100%;max-height:100%} diff --git a/docs/assets/index-bec3ba48.css b/docs/assets/index-bec3ba48.css deleted file mode 100644 index bff4eb6..0000000 --- a/docs/assets/index-bec3ba48.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Roboto&display=swap";:root{font-family:Roboto,Arial,Helvetica,sans-serif}html{box-sizing:border-box;font-size:16px;overflow:hidden}*,*:before,*:after{box-sizing:inherit}body,h1,h2,h3,h4,h5,h6,p,ol,ul{margin:0;padding:0;font-weight:400;width:100vw;height:100vh}body.show-crop .image-gallery>li{background-size:contain!important}ol,ul{list-style:none}img{max-width:100%;height:auto} diff --git a/docs/assets/worker-5821772f.js b/docs/assets/worker-5821772f.js deleted file mode 100644 index 134de1c..0000000 --- a/docs/assets/worker-5821772f.js +++ /dev/null @@ -1,5 +0,0 @@ -var Te=Object.defineProperty;var Re=(y,p,m)=>p in y?Te(y,p,{enumerable:!0,configurable:!0,writable:!0,value:m}):y[p]=m;var lt=(y,p,m)=>(Re(y,typeof p!="symbol"?p+"":p,m),m);(function(){"use strict";/** - * @license - * Copyright 2019 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */const y=Symbol("Comlink.proxy"),p=Symbol("Comlink.endpoint"),m=Symbol("Comlink.releaseProxy"),I=Symbol("Comlink.finalizer"),j=Symbol("Comlink.thrown"),F=t=>typeof t=="object"&&t!==null||typeof t=="function",ft={canHandle:t=>F(t)&&t[y],serialize(t){const{port1:e,port2:n}=new MessageChannel;return M(t,e),[n,[n]]},deserialize(t){return t.start(),yt(t)}},gt={canHandle:t=>F(t)&&j in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},D=new Map([["proxy",ft],["throw",gt]]);function ht(t,e){for(const n of t)if(e===n||n==="*"||n instanceof RegExp&&n.test(e))return!0;return!1}function M(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(o){if(!o||!o.data)return;if(!ht(n,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:a,type:i,path:s}=Object.assign({path:[]},o.data),u=(o.data.argumentList||[]).map(d);let c;try{const l=s.slice(0,-1).reduce((f,w)=>f[w],t),g=s.reduce((f,w)=>f[w],t);switch(i){case"GET":c=g;break;case"SET":l[s.slice(-1)[0]]=d(o.data.value),c=!0;break;case"APPLY":c=g.apply(l,u);break;case"CONSTRUCT":{const f=new g(...u);c=St(f)}break;case"ENDPOINT":{const{port1:f,port2:w}=new MessageChannel;M(t,w),c=wt(f,[f])}break;case"RELEASE":c=void 0;break;default:return}}catch(l){c={value:l,[j]:0}}Promise.resolve(c).catch(l=>({value:l,[j]:0})).then(l=>{const[g,f]=z(l);e.postMessage(Object.assign(Object.assign({},g),{id:a}),f),i==="RELEASE"&&(e.removeEventListener("message",r),V(e),I in t&&typeof t[I]=="function"&&t[I]())}).catch(l=>{const[g,f]=z({value:new TypeError("Unserializable return value"),[j]:0});e.postMessage(Object.assign(Object.assign({},g),{id:a}),f)})}),e.start&&e.start()}function pt(t){return t.constructor.name==="MessagePort"}function V(t){pt(t)&&t.close()}function yt(t,e){return P(t,[],e)}function _(t){if(t)throw new Error("Proxy has been released and is not useable")}function B(t){return S(t,{type:"RELEASE"}).then(()=>{V(t)})}const T=new WeakMap,R="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(T.get(t)||0)-1;T.set(t,e),e===0&&B(t)});function mt(t,e){const n=(T.get(e)||0)+1;T.set(e,n),R&&R.register(t,e,t)}function dt(t){R&&R.unregister(t)}function P(t,e=[],n=function(){}){let r=!1;const o=new Proxy(n,{get(a,i){if(_(r),i===m)return()=>{dt(o),B(t),r=!0};if(i==="then"){if(e.length===0)return{then:()=>o};const s=S(t,{type:"GET",path:e.map(u=>u.toString())}).then(d);return s.then.bind(s)}return P(t,[...e,i])},set(a,i,s){_(r);const[u,c]=z(s);return S(t,{type:"SET",path:[...e,i].map(l=>l.toString()),value:u},c).then(d)},apply(a,i,s){_(r);const u=e[e.length-1];if(u===p)return S(t,{type:"ENDPOINT"}).then(d);if(u==="bind")return P(t,e.slice(0,-1));const[c,l]=W(s);return S(t,{type:"APPLY",path:e.map(g=>g.toString()),argumentList:c},l).then(d)},construct(a,i){_(r);const[s,u]=W(i);return S(t,{type:"CONSTRUCT",path:e.map(c=>c.toString()),argumentList:s},u).then(d)}});return mt(o,t),o}function vt(t){return Array.prototype.concat.apply([],t)}function W(t){const e=t.map(z);return[e.map(n=>n[0]),vt(e.map(n=>n[1]))]}const G=new WeakMap;function wt(t,e){return G.set(t,e),t}function St(t){return Object.assign(t,{[y]:!0})}function z(t){for(const[e,n]of D)if(n.canHandle(t)){const[r,o]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},o]}return[{type:"RAW",value:t},G.get(t)||[]]}function d(t){switch(t.type){case"HANDLER":return D.get(t.name).deserialize(t.value);case"RAW":return t.value}}function S(t,e,n){return new Promise(r=>{const o=Ot();t.addEventListener("message",function a(i){!i.data||!i.data.id||i.data.id!==o||(t.removeEventListener("message",a),r(i.data))}),t.start&&t.start(),t.postMessage(Object.assign({id:o},e),n)})}function Ot(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function O(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function v(t){return function e(n){return arguments.length===0||O(n)?e:t.apply(this,arguments)}}function h(t){return function e(n,r){switch(arguments.length){case 0:return e;case 1:return O(n)?e:v(function(o){return t(n,o)});default:return O(n)&&O(r)?e:O(n)?v(function(o){return t(o,r)}):O(r)?v(function(o){return t(n,o)}):t(n,r)}}}var C=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function At(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function Et(t,e,n){return function(){if(arguments.length===0)return n();var r=arguments[arguments.length-1];if(!C(r)){for(var o=0;o=0;)n=Q[r],A(n,e)&&!zt(o,n)&&(o[o.length]=n),r-=1;return o}),E=Ct,It=v(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),tt=It;function et(t,e,n,r){var o=Y(t),a=Y(e);function i(s,u){return N(s,u,n.slice(),r.slice())}return!Z(function(s,u){return!Z(i,u,s)},a,o)}function N(t,e,n,r){if(k(t,e))return!0;var o=tt(t);if(o!==tt(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(o){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&bt(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&k(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!k(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var a=n.length-1;a>=0;){if(n[a]===t)return r[a]===e;a-=1}switch(o){case"Map":return t.size!==e.size?!1:et(t.entries(),e.entries(),n.concat([t]),r.concat([e]));case"Set":return t.size!==e.size?!1:et(t.values(),e.values(),n.concat([t]),r.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var i=E(t);if(i.length!==E(e).length)return!1;var s=n.concat([t]),u=r.concat([e]);for(a=i.length-1;a>=0;){var c=i[a];if(!(A(c,e)&&N(e[c],t[c],s,u)))return!1;a-=1}return!0}var Mt=h(function(e,n){return N(e,n,[],[])}),Pt=Mt;function kt(t,e,n){var r,o;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(r=1/e;n=0}function H(t,e){for(var n=0,r=e.length,o=Array(r);n":rt(i,s)},r=function(a,i){return H(function(s){return $(s)+": "+n(a[s])},i.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+H(n,t).join(", ")+"))";case"[object Array]":return"["+H(n,t).concat(r(t,Wt(function(a){return/^\d+$/.test(a)},E(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+n(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?n(NaN):$($t(t)))+")";case"[object Map]":return"new Map("+n(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+n(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+n(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+n(t.valueOf())+")":$(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var o=t.toString();if(o!=="[object Object]")return o}return"{"+r(t,E(t)).join(", ")+"}"}}var Gt=v(function(e){return rt(e,[])}),q=Gt,Xt=Number.isInteger||function(e){return e<<0===e};function L(t){return Object.prototype.toString.call(t)==="[object String]"}var Yt=h(function(e,n){var r=e<0?n.length+e:e;return L(n)?n.charAt(r):n[r]}),ot=Yt,Zt=h(function(e,n){if(n!=null)return Xt(e)?ot(e,n):n[e]}),Jt=Zt;function at(t){var e=Object.prototype.toString.call(t);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"}var Qt=h(function(e,n){if(C(e)){if(C(n))return e.concat(n);throw new TypeError(q(n)+" is not an array")}if(L(e)){if(L(n))return e+n;throw new TypeError(q(n)+" is not a string")}if(e!=null&&at(e["fantasy-land/concat"]))return e["fantasy-land/concat"](n);if(e!=null&&at(e.concat))return e.concat(n);throw new TypeError(q(e)+' does not have a method named "concat" or "fantasy-land/concat"')}),Kt=Qt,te=ot(-1),ee=te,ne=h(function t(e,n){if(!nt(n)&&!C(n))return n;var r=n instanceof Array?[]:{},o,a,i;for(a in n)o=e[a],i=typeof o,r[a]=i==="function"?o(n[a]):o&&i==="object"?t(o,n[a]):n[a];return r}),re=ne;function oe(t){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1,r=arguments.length;ni?1:0})}),st=le;ce(1,18).map(t=>`./images/${t}.jpg`);const fe=600,ge=1e4,he=.98,pe=4,ye=t=>t.length>0,me=(t,e)=>{const n=t.height*e;if(n<=t.width)return{width:n,height:t.height};{const r=t.width/e;return{width:t.width,height:r}}},de=(t,e)=>{const r=st(a=>(a.aspectRatioDelta+a.sizeHomogeneity*e.sizeHomogeneity)/(e.sizeHomogeneity+1),t),o=ee(r);return re({pictures:st(Jt("url"))},o)},ve=t=>"url"in t,x=(t,e,n)=>{if(ve(n))return[{position:t,dimension:e,url:n.url}];const r=e.height*n.first.aspectRatio,o=e.width/n.first.aspectRatio,a=n.horizontal?r:o,i={x:t.x+a,y:t.y},s={x:t.x,y:t.y+a},u={width:a,height:e.height},c={width:e.width,height:a},l=e.width-a,g=e.height-a,f={width:l,height:e.height},w={width:e.width,height:g},be=n.horizontal?i:s,je=n.horizontal?u:c,_e=n.horizontal?f:w;return Kt(x(t,je,n.first),x(be,_e,n.second))},we=t=>{const e=Math.max(...t.map(a=>a.width)),n=Math.max(...t.map(a=>a.height)),r=Math.min(...t.map(a=>a.width)),o=Math.min(...t.map(a=>a.height));return(r/e+o/n)/2},Se=(t,e,n)=>{const r=x({x:0,y:0},t,n),o=we(r.map(a=>a.dimension));return{dimension:t,aspectRatioDelta:e,sizeHomogeneity:o,pictures:r}},U=(t,e)=>t+Math.random()*(e-t+1)|0;class Oe{constructor(e,n,r){lt(this,"aspectRatio",0);this.horizontal=e,this.first=n,this.second=r;const o=n.aspectRatio+r.aspectRatio;this.aspectRatio=e?o:n.aspectRatio*r.aspectRatio/o}}const ut=(t,e)=>new Oe(!!U(0,1),t,e),ct=t=>{const e=t.length-1;if(e===0)return t[0];if(e===1)return ut(t[0],t[1]);const n=U(0,e);let r;do r=U(0,e);while(n===r);const o=ut(t[n],t[r]);return ct(t.with(n,o).toSpliced(r,1))},Ae={aspectRatioThreshold:he,maxComputationTime:fe,minImages:pe,sizeHomogeneity:ge};var Ee=Object.freeze({__proto__:null,findSolution:(t,e,n)=>{const r=se(n??{},Ae),o=Date.now(),a=e.width/e.height,i=[];let s=0;for(;Date.now()-or.aspectRatioThreshold){const g=me(e,u.aspectRatio),f=Se(g,l,u);i.push(f)}s++}if(console.log("cycles ran:",s),!ye(i))throw new Error("No solution");return de(i,r)}});M(Ee)})(); diff --git a/docs/index.html b/docs/index.html index 2ec068c..ab71f66 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,8 +6,8 @@ - - + +
diff --git a/src/assets/index.pcss b/src/assets/index.pcss index 832ed3d..b219a3b 100644 --- a/src/assets/index.pcss +++ b/src/assets/index.pcss @@ -33,4 +33,31 @@ ol, ul { img { max-width: 100%; height: auto; -} +} + + +.diorama-list { + position: relative; + overflow: hidden; + width: 100%; + height: 100%; + transition: all 1s linear; +} + +.photo-frame { + display: flex; + border: 10px solid transparent; + position: absolute; + transition-property: left, top; + transition-duration: 1s; + justify-content: center; + align-items: center; + + .photo { + border: 5px solid white; + border-radius: 3px; + box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, 0.5); + max-width: 100%; + max-height: 100%; + } +} diff --git a/src/constants.ts b/src/constants.ts index 58e3dc4..dcd92c4 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -2,9 +2,7 @@ import type { Milliseconds } from './types/types' import { range } from 'ramda' export const images = range(1, 18).map(n => `./images/${n}.jpg`) -export const maxComputationTime: Milliseconds = 600 as Milliseconds -export const sizeHomogeneity = 10000 // the higher the value, the more pictures will approach the same size -export const aspectRatioThreshold = 0.98 // minimum requirement for aspect ratio match 0-1 +export const maxComputationTime = 600 as Milliseconds +export const sizeHomogeneity = .8 // the higher the value, the more pictures will approach the same size export const iconSize = 20 -export const minImages = 4 export const initialImageAmount = 8 diff --git a/src/hooks/use-calculate.ts b/src/hooks/use-calculate.ts index 4fcc747..76fd57b 100644 --- a/src/hooks/use-calculate.ts +++ b/src/hooks/use-calculate.ts @@ -2,7 +2,7 @@ import { useAsyncFn, useEffectOnce } from 'react-use' import { Action, controlContext } from '../ui/controls' import { useContext, useLayoutEffect, useState } from 'react' import type { Dimension, Picture, Solution } from '../types/types' -import { findSolution } from '../layout/find-solution' +import { worker } from '../layout/worker' import type { AsyncState } from 'react-use/lib/useAsyncFn' import { inc } from 'ramda' @@ -10,7 +10,7 @@ export const useCalculate = (images: Picture[], dimension: Dimension): AsyncStat const [redraw, forceUpdate] = useState(0) const { subscribe } = useContext(controlContext) const [status, trigger] = useAsyncFn( - async () => findSolution(images, dimension), + async () => worker(images, dimension), [images.length, dimension.width, dimension.height, redraw] ) diff --git a/src/index.ts b/src/index.ts index 76e9359..44778a7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ -export { findSolution } from './layout/find-solution' +export { worker } from './layout/worker' export { useParentResize } from './hooks/use-parent-resize' export * from './types/types' diff --git a/src/layout/evaluate-solutions.ts b/src/layout/evaluate-solutions.ts index 5db9f82..542f80f 100644 --- a/src/layout/evaluate-solutions.ts +++ b/src/layout/evaluate-solutions.ts @@ -4,12 +4,12 @@ import type { PositionedPicture, Config, NonEmptyArray, Solution } from '../type import { evolve, last, prop, sortBy } from 'ramda' import type { Ord } from 'ramda' -export const evaluateSolutions = (results: NonEmptyArray, config: Config): Solution => { - const aspectRatioAndSize = (solution: Solution): Ord => - (solution.aspectRatioDelta + solution.sizeHomogeneity * config.sizeHomogeneity) / - (config.sizeHomogeneity + 1) +const aspectRatioAndSize = (config:Config) => (solution: Solution): Ord => + (solution.score + solution.sizeHomogeneity * config.sizeHomogeneity) / + (config.sizeHomogeneity + 1) - const rated = sortBy(aspectRatioAndSize, results) +export const evaluateSolutions = (results: NonEmptyArray, config: Config): Solution => { + const rated = sortBy(aspectRatioAndSize(config), results) const winner = last(rated) return evolve({ pictures: sortBy(prop('url')) }, winner) } diff --git a/src/layout/find-solution.ts b/src/layout/find-solution.ts index 610586b..0c32bff 100644 --- a/src/layout/find-solution.ts +++ b/src/layout/find-solution.ts @@ -1,11 +1,36 @@ -import type { Config, Dimension, Solution, Picture } from '../types/types' +import { maxComputationTime, sizeHomogeneity } from '../constants' +import type { Config, Dimension, Picture, Solution } from '../types/types' +import { isNotEmpty } from '../utils/isNotEmpty' +import { evaluateSolutions } from './evaluate-solutions' +import { positionSolution } from './position-solution' +import { toRandomTree } from './to-random-tree' +import { mergeLeft } from 'ramda' +import { resizeDimension } from '../utils/resize-dimension' -export const workerInstance = new ComlinkWorker( - new URL('./worker', import.meta.url) -) +const defaultConfig: Config = { + maxComputationTime, + sizeHomogeneity +} export const findSolution = ( pictures: Picture[], targetDimension: Dimension, - config?: Partial -): Promise => workerInstance.findSolution(pictures, targetDimension, config) + partialConfig?: Partial +): Solution => { + const config = mergeLeft(partialConfig ?? {}, defaultConfig) + const start = Date.now() + const arTarget = targetDimension.width / targetDimension.height + const solutions: Solution[] = [] + + while (Date.now() - start < config.maxComputationTime) { + const root = toRandomTree(pictures) + const distance = Math.abs(root.aspectRatio - arTarget) + const score = Math.max(0, 1 - distance / arTarget) + const actualDimensions = resizeDimension(targetDimension, root.aspectRatio) + solutions.push(positionSolution(actualDimensions, score, root)) + } + if (!isNotEmpty(solutions)) { + throw new Error('No solution') + } + return evaluateSolutions(solutions, config) +} diff --git a/src/layout/position-pictures.ts b/src/layout/position-pictures.ts index f4c2240..648c907 100644 --- a/src/layout/position-pictures.ts +++ b/src/layout/position-pictures.ts @@ -11,29 +11,28 @@ export const positionPictures = ( if (isPicture(rect)) { return [{ position, dimension, url: rect.url }] } + if (rect.horizontal) { + const lengthHorizontal = dimension.height * rect.first.aspectRatio + const positionHorizontal = { x: position.x + lengthHorizontal, y: position.y } + const dimensionHorizontal = { width: lengthHorizontal, height: dimension.height } + const remainingWidth = dimension.width - lengthHorizontal + const dimension2Horizontal = { width: remainingWidth, height: dimension.height } + + return concat( + positionPictures(position, dimensionHorizontal, rect.first), + positionPictures(positionHorizontal, dimension2Horizontal, rect.second) + ) + } else { + const lengthVertical = dimension.width / rect.first.aspectRatio + const positionVertical = { x: position.x, y: position.y + lengthVertical } + const dimensionVertical = { width: dimension.width, height: lengthVertical } + const remainingHeight = dimension.height - lengthVertical + const dimension2Vertical = { width: dimension.width, height: remainingHeight } + + return concat( + positionPictures(position, dimensionVertical, rect.first), + positionPictures(positionVertical, dimension2Vertical, rect.second) + ) + } - const lengthHorizontal = dimension.height * rect.first.aspectRatio - const lengthVertical = dimension.width / rect.first.aspectRatio - - const length = rect.horizontal ? lengthHorizontal : lengthVertical - - const positionHorizontal = { x: position.x + length, y: position.y } - const positionVertical = { x: position.x, y: position.y + length } - - const dimensionHorizontal = { width: length, height: dimension.height } - const dimensionVertical = { width: dimension.width, height: length } - - const remainingWidth = dimension.width - length - const remainingHeight = dimension.height - length - const dimension2Horizontal = { width: remainingWidth, height: dimension.height } - const dimension2Vertical = { width: dimension.width, height: remainingHeight } - - const position2 = rect.horizontal ? positionHorizontal : positionVertical - const dimension1 = rect.horizontal ? dimensionHorizontal : dimensionVertical - const dimension2 = rect.horizontal ? dimension2Horizontal : dimension2Vertical - - return concat( - positionPictures(position, dimension1, rect.first), - positionPictures(position2, dimension2, rect.second) - ) } diff --git a/src/layout/position-solution.ts b/src/layout/position-solution.ts index 5f775bd..d43e2ce 100644 --- a/src/layout/position-solution.ts +++ b/src/layout/position-solution.ts @@ -5,14 +5,14 @@ import { sizeVariation } from '../utils/size-variation' export const positionSolution = ( dimension: Dimension, - aspectRatioDelta: number, + score: number, composition: Composition ): Solution => { const pictures = positionPictures({ x: 0, y: 0 }, dimension, composition) const sizeHomogeneity = sizeVariation(pictures.map(p => p.dimension)) return { dimension, - aspectRatioDelta, + score, sizeHomogeneity, pictures } diff --git a/src/layout/worker.ts b/src/layout/worker.ts index eb9defb..dfa07c2 100644 --- a/src/layout/worker.ts +++ b/src/layout/worker.ts @@ -1,47 +1,12 @@ -import { aspectRatioThreshold, maxComputationTime, minImages, sizeHomogeneity } from '../constants' -import type { Config, Dimension, Picture, Solution } from '../types/types' -import { isNotEmpty } from '../utils/isNotEmpty' -import { resizeDimension } from '../utils/resize-dimension' -import { evaluateSolutions } from './evaluate-solutions' -import { positionSolution } from './position-solution' -import { toRandomTree } from './to-random-tree' -import {mergeLeft} from 'ramda' +import type { Config, Dimension, Solution, Picture } from '../types/types' -const defaultConfig: Config = { - aspectRatioThreshold, - maxComputationTime, - minImages, - sizeHomogeneity -} +export const workerInstance = new ComlinkWorker( + new URL('./find-solution', import.meta.url) +) -export const findSolution = ( +export const worker = ( pictures: Picture[], targetDimension: Dimension, - partialConfig?: Partial -): Solution => { - const config = mergeLeft(partialConfig ?? {}, defaultConfig) - const start = Date.now() - const arTarget = targetDimension.width / targetDimension.height - const solutions: Solution[] = [] - let cycles = 0 + config?: Partial +): Promise => workerInstance.findSolution(pictures, targetDimension, config) - // search possible solutions for a limited amount of time - while (Date.now() - start < config.maxComputationTime) { - const root = toRandomTree(pictures) - const distance = Math.abs(root.aspectRatio - arTarget) - const score = Math.max(0, 1 - distance / arTarget) - - // discard non-fitting solutions (too much crop) - if (pictures.length <= config.minImages || score > config.aspectRatioThreshold) { - const actualDimensions = resizeDimension(targetDimension, root.aspectRatio) - const finalLayout = positionSolution(actualDimensions, score, root) - solutions.push(finalLayout) - } - cycles++ - } - console.log('cycles ran:', cycles) - if (!isNotEmpty(solutions)) { - throw new Error('No solution') - } - return evaluateSolutions(solutions, config) -} diff --git a/src/types/types.ts b/src/types/types.ts index 43b3307..7b266ba 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -4,6 +4,7 @@ type Brand = { __tag: T } export type RelativeUrl = string export type Milliseconds = number & Brand<'ms'> +export type Pixels = number & Brand<'px'> export type Picture = { dimension: Dimension @@ -19,7 +20,7 @@ export type PositionedPicture = { export type Solution = { pictures: PositionedPicture[] - aspectRatioDelta: number + score: number sizeHomogeneity: number dimension: Dimension } @@ -46,6 +47,4 @@ export type NonEmptyArray = [T, ...T[]] export type Config = { maxComputationTime: number sizeHomogeneity: number // the higher the value, the more pictures will approach the same size - aspectRatioThreshold: number // minimum requirement for aspect ratio match 0-1 - minImages: number } diff --git a/src/ui/controls.tsx b/src/ui/controls.tsx index ec6d70f..7dc77ad 100644 --- a/src/ui/controls.tsx +++ b/src/ui/controls.tsx @@ -1,6 +1,6 @@ import {PropsWithChildren, createContext, useCallback, EffectCallback} from 'react' import { iconSize } from '../constants' -import { BoxPadding, LayoutGridAdd, Refresh, Trash, WindowMaximize } from 'tabler-icons-react' +import { LayoutGridAdd, Refresh, Trash, WindowMaximize } from 'tabler-icons-react' import { concat, without } from 'ramda' import { uninitialized } from '../utils/uninitialized' import screenfull from 'screenfull' @@ -94,11 +94,6 @@ export const Controls = ({ children }: PropsWithChildren): JSX.Element -
  • - -