radames HF staff commited on
Commit
bf7c37f
β€’
1 Parent(s): 506a7bc
frontend/svelte.config.js CHANGED
@@ -11,6 +11,9 @@ const config = {
11
  })
12
  ],
13
  kit: {
 
 
 
14
  adapter: adapter({
15
  pages: 'build',
16
  assets: 'build',
 
11
  })
12
  ],
13
  kit: {
14
+ paths: {
15
+ base: '/static'
16
+ },
17
  adapter: adapter({
18
  pages: 'build',
19
  assets: 'build',
static/_app/immutable/chunks/1-bf0cf391.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{default as t}from"../components/error.svelte-2d9a3f98.js";export{t as component};
static/_app/immutable/chunks/1-e583b0d4.js DELETED
@@ -1 +0,0 @@
1
- import{default as t}from"../components/error.svelte-f5e989b0.js";export{t as component};
 
 
static/_app/immutable/chunks/2-3879e5a7.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{default as t}from"../components/pages/_page.svelte-c06cb3cf.js";export{t as component};
static/_app/immutable/chunks/2-ca93f0c9.js DELETED
@@ -1 +0,0 @@
1
- import{default as t}from"../components/pages/_page.svelte-ea2cf9bd.js";export{t as component};
 
 
static/_app/immutable/chunks/{singletons-9542ead4.js β†’ singletons-7373b018.js} RENAMED
@@ -1 +1 @@
1
- import{w as u}from"./index-3bda1050.js";let f="",b="";function g(n){f=n.base,b=n.assets||f}function m(n){let e=n.baseURI;if(!e){const t=n.getElementsByTagName("base");e=t.length?t[0].href:n.URL}return e}function _(){return{x:pageXOffset,y:pageYOffset}}function k(n){let e,t=null,r=null,a=null;for(const s of n.composedPath())s instanceof Element&&(!e&&s.nodeName.toUpperCase()==="A"&&(e=s),t===null&&(t=l(s,"data-sveltekit-noscroll")),r===null&&(r=l(s,"data-sveltekit-prefetch")),a===null&&(a=l(s,"data-sveltekit-reload")));const o=e&&new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI);return{a:e,url:o,options:{noscroll:t,prefetch:r,reload:a}}}function l(n,e){const t=n.getAttribute(e);return t===null?t:t===""?!0:(t==="off",!1)}function d(n){const e=u(n);let t=!0;function r(){t=!0,e.update(s=>s)}function a(s){t=!1,e.set(s)}function o(s){let i;return e.subscribe(c=>{(i===void 0||t&&c!==i)&&s(i=c)})}return{notify:r,set:a,subscribe:o}}function p(){const{set:n,subscribe:e}=u(!1);let t;async function r(){clearTimeout(t);const a=await fetch(`${b}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(a.ok){const{version:o}=await a.json(),s=o!=="1664554625991";return s&&(n(!0),clearTimeout(t)),s}else throw new Error(`Version check failed: ${a.status}`)}return{subscribe:e,check:r}}function v(n){n.client}const w={url:d({}),page:d({}),navigating:u(null),updated:p()};export{_ as a,g as b,k as f,m as g,v as i,w as s};
 
1
+ import{w as u}from"./index-3bda1050.js";let f="",b="";function g(n){f=n.base,b=n.assets||f}function m(n){let e=n.baseURI;if(!e){const t=n.getElementsByTagName("base");e=t.length?t[0].href:n.URL}return e}function _(){return{x:pageXOffset,y:pageYOffset}}function k(n){let e,t=null,r=null,a=null;for(const s of n.composedPath())s instanceof Element&&(!e&&s.nodeName.toUpperCase()==="A"&&(e=s),t===null&&(t=l(s,"data-sveltekit-noscroll")),r===null&&(r=l(s,"data-sveltekit-prefetch")),a===null&&(a=l(s,"data-sveltekit-reload")));const o=e&&new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI);return{a:e,url:o,options:{noscroll:t,prefetch:r,reload:a}}}function l(n,e){const t=n.getAttribute(e);return t===null?t:t===""?!0:(t==="off",!1)}function d(n){const e=u(n);let t=!0;function r(){t=!0,e.update(s=>s)}function a(s){t=!1,e.set(s)}function o(s){let i;return e.subscribe(c=>{(i===void 0||t&&c!==i)&&s(i=c)})}return{notify:r,set:a,subscribe:o}}function p(){const{set:n,subscribe:e}=u(!1);let t;async function r(){clearTimeout(t);const a=await fetch(`${b}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(a.ok){const{version:o}=await a.json(),s=o!=="1666720222473";return s&&(n(!0),clearTimeout(t)),s}else throw new Error(`Version check failed: ${a.status}`)}return{subscribe:e,check:r}}function v(n){n.client}const w={url:d({}),page:d({}),navigating:u(null),updated:p()};export{_ as a,g as b,k as f,m as g,v as i,w as s};
static/_app/immutable/components/{error.svelte-f5e989b0.js β†’ error.svelte-2d9a3f98.js} RENAMED
@@ -1 +1 @@
1
- import{S as A,i as C,s as F,k as v,q as k,a as h,e as q,l as g,m as E,r as $,h as p,c as R,b as u,F as P,u as S,A as w,G}from"../chunks/index-5559954d.js";import{s as H}from"../chunks/singletons-9542ead4.js";const O=()=>{const t=H,s={page:{subscribe:t.page.subscribe},navigating:{subscribe:t.navigating.subscribe},updated:t.updated};return Object.defineProperties(s,{preloading:{get(){return console.error("stores.preloading is deprecated; use stores.navigating instead"),{subscribe:t.navigating.subscribe}},enumerable:!1},session:{get(){return B(),{}},enumerable:!1}}),s},z={subscribe(t){return O().page.subscribe(t)}};function B(){throw new Error("stores.session is no longer available. See https://github.com/sveltejs/kit/discussions/5883")}function N(t){let s,i=t[0].error.frame+"",o;return{c(){s=v("pre"),o=k(i)},l(r){s=g(r,"PRE",{});var a=E(s);o=$(a,i),a.forEach(p)},m(r,a){u(r,s,a),P(s,o)},p(r,a){a&1&&i!==(i=r[0].error.frame+"")&&S(o,i)},d(r){r&&p(s)}}}function y(t){let s,i=t[0].error.stack+"",o;return{c(){s=v("pre"),o=k(i)},l(r){s=g(r,"PRE",{});var a=E(s);o=$(a,i),a.forEach(p)},m(r,a){u(r,s,a),P(s,o)},p(r,a){a&1&&i!==(i=r[0].error.stack+"")&&S(o,i)},d(r){r&&p(s)}}}function D(t){let s,i=t[0].status+"",o,r,a,b=t[0].error.message+"",_,d,c,m,l=t[0].error.frame&&N(t),n=t[0].error.stack&&y(t);return{c(){s=v("h1"),o=k(i),r=h(),a=v("pre"),_=k(b),d=h(),l&&l.c(),c=h(),n&&n.c(),m=q()},l(e){s=g(e,"H1",{});var f=E(s);o=$(f,i),f.forEach(p),r=R(e),a=g(e,"PRE",{});var j=E(a);_=$(j,b),j.forEach(p),d=R(e),l&&l.l(e),c=R(e),n&&n.l(e),m=q()},m(e,f){u(e,s,f),P(s,o),u(e,r,f),u(e,a,f),P(a,_),u(e,d,f),l&&l.m(e,f),u(e,c,f),n&&n.m(e,f),u(e,m,f)},p(e,[f]){f&1&&i!==(i=e[0].status+"")&&S(o,i),f&1&&b!==(b=e[0].error.message+"")&&S(_,b),e[0].error.frame?l?l.p(e,f):(l=N(e),l.c(),l.m(c.parentNode,c)):l&&(l.d(1),l=null),e[0].error.stack?n?n.p(e,f):(n=y(e),n.c(),n.m(m.parentNode,m)):n&&(n.d(1),n=null)},i:w,o:w,d(e){e&&p(s),e&&p(r),e&&p(a),e&&p(d),l&&l.d(e),e&&p(c),n&&n.d(e),e&&p(m)}}}function I(t,s,i){let o;return G(t,z,r=>i(0,o=r)),[o]}class L extends A{constructor(s){super(),C(this,s,I,D,F,{})}}export{L as default};
 
1
+ import{S as A,i as C,s as F,k as v,q as k,a as h,e as q,l as g,m as E,r as $,h as p,c as R,b as u,F as P,u as S,A as w,G}from"../chunks/index-5559954d.js";import{s as H}from"../chunks/singletons-7373b018.js";const O=()=>{const t=H,s={page:{subscribe:t.page.subscribe},navigating:{subscribe:t.navigating.subscribe},updated:t.updated};return Object.defineProperties(s,{preloading:{get(){return console.error("stores.preloading is deprecated; use stores.navigating instead"),{subscribe:t.navigating.subscribe}},enumerable:!1},session:{get(){return B(),{}},enumerable:!1}}),s},z={subscribe(t){return O().page.subscribe(t)}};function B(){throw new Error("stores.session is no longer available. See https://github.com/sveltejs/kit/discussions/5883")}function N(t){let s,i=t[0].error.frame+"",o;return{c(){s=v("pre"),o=k(i)},l(r){s=g(r,"PRE",{});var a=E(s);o=$(a,i),a.forEach(p)},m(r,a){u(r,s,a),P(s,o)},p(r,a){a&1&&i!==(i=r[0].error.frame+"")&&S(o,i)},d(r){r&&p(s)}}}function y(t){let s,i=t[0].error.stack+"",o;return{c(){s=v("pre"),o=k(i)},l(r){s=g(r,"PRE",{});var a=E(s);o=$(a,i),a.forEach(p)},m(r,a){u(r,s,a),P(s,o)},p(r,a){a&1&&i!==(i=r[0].error.stack+"")&&S(o,i)},d(r){r&&p(s)}}}function D(t){let s,i=t[0].status+"",o,r,a,b=t[0].error.message+"",_,d,c,m,l=t[0].error.frame&&N(t),n=t[0].error.stack&&y(t);return{c(){s=v("h1"),o=k(i),r=h(),a=v("pre"),_=k(b),d=h(),l&&l.c(),c=h(),n&&n.c(),m=q()},l(e){s=g(e,"H1",{});var f=E(s);o=$(f,i),f.forEach(p),r=R(e),a=g(e,"PRE",{});var j=E(a);_=$(j,b),j.forEach(p),d=R(e),l&&l.l(e),c=R(e),n&&n.l(e),m=q()},m(e,f){u(e,s,f),P(s,o),u(e,r,f),u(e,a,f),P(a,_),u(e,d,f),l&&l.m(e,f),u(e,c,f),n&&n.m(e,f),u(e,m,f)},p(e,[f]){f&1&&i!==(i=e[0].status+"")&&S(o,i),f&1&&b!==(b=e[0].error.message+"")&&S(_,b),e[0].error.frame?l?l.p(e,f):(l=N(e),l.c(),l.m(c.parentNode,c)):l&&(l.d(1),l=null),e[0].error.stack?n?n.p(e,f):(n=y(e),n.c(),n.m(m.parentNode,m)):n&&(n.d(1),n=null)},i:w,o:w,d(e){e&&p(s),e&&p(r),e&&p(a),e&&p(d),l&&l.d(e),e&&p(c),n&&n.d(e),e&&p(m)}}}function I(t,s,i){let o;return G(t,z,r=>i(0,o=r)),[o]}class L extends A{constructor(s){super(),C(this,s,I,D,F,{})}}export{L as default};
static/_app/immutable/components/pages/{_page.svelte-ea2cf9bd.js β†’ _page.svelte-c06cb3cf.js} RENAMED
@@ -1,9 +1,9 @@
1
- import{S as Ee,i as Ne,s as $e,k as L,l as z,m as H,h as _,n as c,b as Q,F as p,A as ue,H as Ge,I as he,a as A,q as j,J as de,c as U,r as F,p as Ce,K as se,u as me,L as Ze,f as J,g as Qe,t as ae,d as Je,M as Oe,N as qt,v as He,w as qe,x as Re,y as Le,O as et,P as ze,G as tt,o as Rt,e as rt,Q as W,R as Lt}from"../../chunks/index-5559954d.js";import{w as yt}from"../../chunks/index-3bda1050.js";if(!oe)var oe={map:function(e,t){var r={};return t?e.map(function(n,s){return r.index=s,t.call(r,n)}):e.slice()},naturalOrder:function(e,t){return e<t?-1:e>t?1:0},sum:function(e,t){var r={};return e.reduce(t?function(n,s,l){return r.index=l,n+t.call(r,s)}:function(n,s){return n+s},0)},max:function(e,t){return Math.max.apply(null,t?oe.map(e,t):e)}};var zt=function(){var e=5,t=8-e,r=1e3,n=.75;function s(h,a,d){return(h<<2*e)+(a<<e)+d}function l(h){var a=[],d=!1;function f(){a.sort(h),d=!0}return{push:function(b){a.push(b),d=!1},peek:function(b){return d||f(),b===void 0&&(b=a.length-1),a[b]},pop:function(){return d||f(),a.pop()},size:function(){return a.length},map:function(b){return a.map(b)},debug:function(){return d||f(),a}}}function i(h,a,d,f,b,x,M){var C=this;C.r1=h,C.r2=a,C.g1=d,C.g2=f,C.b1=b,C.b2=x,C.histo=M}i.prototype={volume:function(h){var a=this;return(!a._volume||h)&&(a._volume=(a.r2-a.r1+1)*(a.g2-a.g1+1)*(a.b2-a.b1+1)),a._volume},count:function(h){var a=this,d=a.histo;if(!a._count_set||h){var f=0,b,x,M,C;for(b=a.r1;b<=a.r2;b++)for(x=a.g1;x<=a.g2;x++)for(M=a.b1;M<=a.b2;M++)C=s(b,x,M),f+=d[C]||0;a._count=f,a._count_set=!0}return a._count},copy:function(){var h=this;return new i(h.r1,h.r2,h.g1,h.g2,h.b1,h.b2,h.histo)},avg:function(h){var a=this,d=a.histo;if(!a._avg||h){var f=0,b=1<<8-e,x=0,M=0,C=0,R,v,$,P,D;for(v=a.r1;v<=a.r2;v++)for($=a.g1;$<=a.g2;$++)for(P=a.b1;P<=a.b2;P++)D=s(v,$,P),R=d[D]||0,f+=R,x+=R*(v+.5)*b,M+=R*($+.5)*b,C+=R*(P+.5)*b;f?a._avg=[~~(x/f),~~(M/f),~~(C/f)]:a._avg=[~~(b*(a.r1+a.r2+1)/2),~~(b*(a.g1+a.g2+1)/2),~~(b*(a.b1+a.b2+1)/2)]}return a._avg},contains:function(h){var a=this,d=h[0]>>t;return gval=h[1]>>t,bval=h[2]>>t,d>=a.r1&&d<=a.r2&&gval>=a.g1&&gval<=a.g2&&bval>=a.b1&&bval<=a.b2}};function o(){this.vboxes=new l(function(h,a){return oe.naturalOrder(h.vbox.count()*h.vbox.volume(),a.vbox.count()*a.vbox.volume())})}o.prototype={push:function(h){this.vboxes.push({vbox:h,color:h.avg()})},palette:function(){return this.vboxes.map(function(h){return h.color})},size:function(){return this.vboxes.size()},map:function(h){for(var a=this.vboxes,d=0;d<a.size();d++)if(a.peek(d).vbox.contains(h))return a.peek(d).color;return this.nearest(h)},nearest:function(h){for(var a=this.vboxes,d,f,b,x=0;x<a.size();x++)f=Math.sqrt(Math.pow(h[0]-a.peek(x).color[0],2)+Math.pow(h[1]-a.peek(x).color[1],2)+Math.pow(h[2]-a.peek(x).color[2],2)),(f<d||d===void 0)&&(d=f,b=a.peek(x).color);return b},forcebw:function(){var h=this.vboxes;h.sort(function(b,x){return oe.naturalOrder(oe.sum(b.color),oe.sum(x.color))});var a=h[0].color;a[0]<5&&a[1]<5&&a[2]<5&&(h[0].color=[0,0,0]);var d=h.length-1,f=h[d].color;f[0]>251&&f[1]>251&&f[2]>251&&(h[d].color=[255,255,255])}};function m(h){var a=1<<3*e,d=new Array(a),f,b,x,M;return h.forEach(function(C){b=C[0]>>t,x=C[1]>>t,M=C[2]>>t,f=s(b,x,M),d[f]=(d[f]||0)+1}),d}function y(h,a){var d=1e6,f=0,b=1e6,x=0,M=1e6,C=0,R,v,$;return h.forEach(function(P){R=P[0]>>t,v=P[1]>>t,$=P[2]>>t,R<d?d=R:R>f&&(f=R),v<b?b=v:v>x&&(x=v),$<M?M=$:$>C&&(C=$)}),new i(d,f,b,x,M,C,a)}function q(h,a){if(!a.count())return;var d=a.r2-a.r1+1,f=a.g2-a.g1+1,b=a.b2-a.b1+1,x=oe.max([d,f,b]);if(a.count()==1)return[a.copy()];var M=0,C=[],R=[],v,$,P,D,T;if(x==d)for(v=a.r1;v<=a.r2;v++){for(D=0,$=a.g1;$<=a.g2;$++)for(P=a.b1;P<=a.b2;P++)T=s(v,$,P),D+=h[T]||0;M+=D,C[v]=M}else if(x==f)for(v=a.g1;v<=a.g2;v++){for(D=0,$=a.r1;$<=a.r2;$++)for(P=a.b1;P<=a.b2;P++)T=s($,v,P),D+=h[T]||0;M+=D,C[v]=M}else for(v=a.b1;v<=a.b2;v++){for(D=0,$=a.r1;$<=a.r2;$++)for(P=a.g1;P<=a.g2;P++)T=s($,P,v),D+=h[T]||0;M+=D,C[v]=M}C.forEach(function(B,I){R[I]=M-B});function w(B){var I=B+"1",g=B+"2",S,u,k,E,N,V=0;for(v=a[I];v<=a[g];v++)if(C[v]>M/2){for(k=a.copy(),E=a.copy(),S=v-a[I],u=a[g]-v,S<=u?N=Math.min(a[g]-1,~~(v+u/2)):N=Math.max(a[I],~~(v-1-S/2));!C[N];)N++;for(V=R[N];!V&&C[N-1];)V=R[--N];return k[g]=N,E[I]=k[g]+1,[k,E]}}return x==d?w("r"):x==f?w("g"):w("b")}function O(h,a){if(!h.length||a<2||a>256)return!1;var d=m(h);d.forEach(function(){});var f=y(h,d),b=new l(function(R,v){return oe.naturalOrder(R.count(),v.count())});b.push(f);function x(R,v){for(var $=1,P=0,D;P<r;){if(D=R.pop(),!D.count()){R.push(D),P++;continue}var T=q(d,D),w=T[0],B=T[1];if(!w||(R.push(w),B&&(R.push(B),$++),$>=v)||P++>r)return}}x(b,n*a);for(var M=new l(function(R,v){return oe.naturalOrder(R.count()*R.volume(),v.count()*v.volume())});b.size();)M.push(b.pop());x(M,a-M.size());for(var C=new o;M.size();)C.push(M.pop());return C}return{quantize:O}}(),St=zt.quantize;function Ie(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Te(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function be(){}var ye=.7,Se=1/ye,we="\\s*([+-]?\\d+)\\s*",ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",le="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Dt=/^#([0-9a-f]{3,8})$/,Bt=new RegExp(`^rgb\\(${we},${we},${we}\\)$`),Ot=new RegExp(`^rgb\\(${le},${le},${le}\\)$`),Tt=new RegExp(`^rgba\\(${we},${we},${we},${ke}\\)$`),At=new RegExp(`^rgba\\(${le},${le},${le},${ke}\\)$`),Ut=new RegExp(`^hsl\\(${ke},${le},${le}\\)$`),Vt=new RegExp(`^hsla\\(${ke},${le},${le},${ke}\\)$`),nt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ie(be,Ke,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:at,formatHex:at,formatHex8:jt,formatHsl:Ft,formatRgb:st,toString:st});function at(){return this.rgb().formatHex()}function jt(){return this.rgb().formatHex8()}function Ft(){return Et(this).formatHsl()}function st(){return this.rgb().formatRgb()}function Ke(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Dt.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?lt(t):r===3?new G(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Pe(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Pe(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Bt.exec(e))?new G(t[1],t[2],t[3],1):(t=Ot.exec(e))?new G(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Tt.exec(e))?Pe(t[1],t[2],t[3],t[4]):(t=At.exec(e))?Pe(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ut.exec(e))?ct(t[1],t[2]/100,t[3]/100,1):(t=Vt.exec(e))?ct(t[1],t[2]/100,t[3]/100,t[4]):nt.hasOwnProperty(e)?lt(nt[e]):e==="transparent"?new G(NaN,NaN,NaN,0):null}function lt(e){return new G(e>>16&255,e>>8&255,e&255,1)}function Pe(e,t,r,n){return n<=0&&(e=t=r=NaN),new G(e,t,r,n)}function kt(e){return e instanceof be||(e=Ke(e)),e?(e=e.rgb(),new G(e.r,e.g,e.b,e.opacity)):new G}function Xe(e,t,r,n){return arguments.length===1?kt(e):new G(e,t,r,n==null?1:n)}function G(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Ie(G,Xe,Te(be,{brighter(e){return e=e==null?Se:Math.pow(Se,e),new G(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ye:Math.pow(ye,e),new G(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new G(pe(this.r),pe(this.g),pe(this.b),De(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:it,formatHex:it,formatHex8:Wt,formatRgb:ot,toString:ot}));function it(){return`#${ge(this.r)}${ge(this.g)}${ge(this.b)}`}function Wt(){return`#${ge(this.r)}${ge(this.g)}${ge(this.b)}${ge((isNaN(this.opacity)?1:this.opacity)*255)}`}function ot(){const e=De(this.opacity);return`${e===1?"rgb(":"rgba("}${pe(this.r)}, ${pe(this.g)}, ${pe(this.b)}${e===1?")":`, ${e})`}`}function De(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ge(e){return e=pe(e),(e<16?"0":"")+e.toString(16)}function ct(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Z(e,t,r,n)}function Et(e){if(e instanceof Z)return new Z(e.h,e.s,e.l,e.opacity);if(e instanceof be||(e=Ke(e)),!e)return new Z;if(e instanceof Z)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,s=Math.min(t,r,n),l=Math.max(t,r,n),i=NaN,o=l-s,m=(l+s)/2;return o?(t===l?i=(r-n)/o+(r<n)*6:r===l?i=(n-t)/o+2:i=(t-r)/o+4,o/=m<.5?l+s:2-l-s,i*=60):o=m>0&&m<1?0:i,new Z(i,o,m,e.opacity)}function Gt(e,t,r,n){return arguments.length===1?Et(e):new Z(e,t,r,n==null?1:n)}function Z(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Ie(Z,Gt,Te(be,{brighter(e){return e=e==null?Se:Math.pow(Se,e),new Z(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ye:Math.pow(ye,e),new Z(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,s=2*r-n;return new G(Ae(e>=240?e-240:e+120,s,n),Ae(e,s,n),Ae(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new Z(ft(this.h),Me(this.s),Me(this.l),De(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=De(this.opacity);return`${e===1?"hsl(":"hsla("}${ft(this.h)}, ${Me(this.s)*100}%, ${Me(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ft(e){return e=(e||0)%360,e<0?e+360:e}function Me(e){return Math.max(0,Math.min(1,e||0))}function Ae(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Qt=Math.PI/180,Jt=180/Math.PI,Be=18,Nt=.96422,$t=1,It=.82521,Ct=4/29,ve=6/29,Pt=3*ve*ve,Kt=ve*ve*ve;function Mt(e){if(e instanceof ie)return new ie(e.l,e.a,e.b,e.opacity);if(e instanceof ce)return Ht(e);e instanceof G||(e=kt(e));var t=Fe(e.r),r=Fe(e.g),n=Fe(e.b),s=Ue((.2225045*t+.7168786*r+.0606169*n)/$t),l,i;return t===r&&r===n?l=i=s:(l=Ue((.4360747*t+.3850649*r+.1430804*n)/Nt),i=Ue((.0139322*t+.0971045*r+.7141733*n)/It)),new ie(116*s-16,500*(l-s),200*(s-i),e.opacity)}function Xt(e,t,r,n){return arguments.length===1?Mt(e):new ie(e,t,r,n==null?1:n)}function ie(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}Ie(ie,Xt,Te(be,{brighter(e){return new ie(this.l+Be*(e==null?1:e),this.a,this.b,this.opacity)},darker(e){return new ie(this.l-Be*(e==null?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=Nt*Ve(t),e=$t*Ve(e),r=It*Ve(r),new G(je(3.1338561*t-1.6168667*e-.4906146*r),je(-.9787684*t+1.9161415*e+.033454*r),je(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));function Ue(e){return e>Kt?Math.pow(e,1/3):e/Pt+Ct}function Ve(e){return e>ve?e*e*e:Pt*(e-Ct)}function je(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Fe(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Yt(e){if(e instanceof ce)return new ce(e.h,e.c,e.l,e.opacity);if(e instanceof ie||(e=Mt(e)),e.a===0&&e.b===0)return new ce(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Jt;return new ce(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function _e(e,t,r,n){return arguments.length===1?Yt(e):new ce(e,t,r,n==null?1:n)}function ce(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function Ht(e){if(isNaN(e.h))return new ie(e.l,0,0,e.opacity);var t=e.h*Qt;return new ie(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Ie(ce,_e,Te(be,{brighter(e){return new ce(this.h,this.c,this.l+Be*(e==null?1:e),this.opacity)},darker(e){return new ce(this.h,this.c,this.l-Be*(e==null?1:e),this.opacity)},rgb(){return Ht(this).rgb()}}));function Zt(e){return e.map(t=>_e(t)).sort((t,r)=>{const n=t.h,s=r.h;return s-n||isNaN(s)-isNaN(n)})}function er(e,t,r){const n=e,s=[];for(let l=0,i,o,m,y,q;l<t;l=l+r)i=l*4,o=n[i+0],m=n[i+1],y=n[i+2],q=n[i+3],(typeof q>"u"||q>=125)&&(o>250&&m>250&&y>250||s.push([o,m,y]));return s}function tr(e,t=5,r=1){return new Promise(n=>{const s=new Image;s.onload=async()=>{const l=s.width,i=s.height,o=document.createElement("canvas");o.width=l,o.height=i;const m=o.getContext("2d");m.drawImage(s,0,0,l,i);const y=m.getImageData(0,0,l,i),q=er(y.data,l*i,r),h=St(q,t).palette(),a=document.createElement("canvas");a.width=l/5,a.height=i/5,a.getContext("2d").drawImage(s,0,0,l,i,0,0,l/5,i/5);const f=await new Promise(x=>a.toBlob(x,"image/jpeg",.8)),b=h.map(x=>Xe(...x));n({colors:Zt(b),imgBlob:f})},s.src=e})}async function rr(e,t){const r=nr(t),n="https://huggingface.co/uploads",l=`color-palette-${crypto.randomUUID().split("-")[0]}-${r}.jpeg`,i=new File([e],l,{type:"image/jpeg"});console.log("uploading image",i);const m=await(await fetch(n,{method:"POST",headers:{"Content-Type":i.type,"X-Requested-With":"XMLHttpRequest"},body:i})).text();return console.log("uploaded images",m),m}function nr(e){return e?e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,""):""}const X=yt(""),xe=yt(!1),ar="wss://spaces.huggingface.tech/stabilityai/stable-diffusion/queue/join";function ut(e,t,r){const n=e.slice();return n[6]=t[r],n[8]=r,n}function ht(e){let t,r,n,s,l,i,o=(e[1]===e[8]?"copied":e[6].formatHex())+"",m,y,q,O,h;function a(){return e[4](e[6],e[8])}return{c(){t=L("div"),r=he("svg"),n=he("rect"),l=A(),i=L("span"),m=j(o),y=A(),this.h()},l(d){t=z(d,"DIV",{class:!0,style:!0});var f=H(t);r=de(f,"svg",{class:!0,width:!0,viewBox:!0});var b=H(r);n=de(b,"rect",{x:!0,y:!0,width:!0,height:!0,fill:!0}),H(n).forEach(_),b.forEach(_),l=U(f),i=z(f,"SPAN",{title:!0,class:!0,style:!0});var x=H(i);m=F(x,o),x.forEach(_),y=U(f),f.forEach(_),this.h()},h(){c(n,"x","0"),c(n,"y","0"),c(n,"width","50"),c(n,"height","50"),c(n,"fill",s=e[6].formatHex()),c(r,"class","block max-w-full aspect-square"),c(r,"width","100"),c(r,"viewBox","0 0 50 50"),c(i,"title","Copy single color"),c(i,"class","absolute bottom-0 text-center text-xs pl-1 font-bold uppercase"),Ce(i,"color",e[2](e[6])),c(t,"class",q=(e[1]===e[8]?"":"cursor-pointer")+" aspect-square relative"),Ce(t,"background-color",e[6].formatHex())},m(d,f){Q(d,t,f),p(t,r),p(r,n),p(t,l),p(t,i),p(i,m),p(t,y),O||(h=se(t,"click",a),O=!0)},p(d,f){e=d,f&1&&s!==(s=e[6].formatHex())&&c(n,"fill",s),f&3&&o!==(o=(e[1]===e[8]?"copied":e[6].formatHex())+"")&&me(m,o),f&1&&Ce(i,"color",e[2](e[6])),f&2&&q!==(q=(e[1]===e[8]?"":"cursor-pointer")+" aspect-square relative")&&c(t,"class",q),f&1&&Ce(t,"background-color",e[6].formatHex())},d(d){d&&_(t),O=!1,h()}}}function sr(e){let t,r,n=e[0],s=[];for(let l=0;l<n.length;l+=1)s[l]=ht(ut(e,n,l));return{c(){t=L("div"),r=L("div");for(let l=0;l<s.length;l+=1)s[l].c();this.h()},l(l){t=z(l,"DIV",{class:!0});var i=H(t);r=z(i,"DIV",{class:!0});var o=H(r);for(let m=0;m<s.length;m+=1)s[m].l(o);o.forEach(_),i.forEach(_),this.h()},h(){c(r,"class","flex"),c(t,"class","flex flex-col items-center")},m(l,i){Q(l,t,i),p(t,r);for(let o=0;o<s.length;o+=1)s[o].m(r,null)},p(l,[i]){if(i&15){n=l[0];let o;for(o=0;o<n.length;o+=1){const m=ut(l,n,o);s[o]?s[o].p(m,i):(s[o]=ht(m),s[o].c(),s[o].m(r,null))}for(;o<s.length;o+=1)s[o].d(1);s.length=n.length}},i:ue,o:ue,d(l){l&&_(t),Ge(s,l)}}}function lr(e,t,r){let{colors:n}=t;n.length;function s(m){const y=_e(m);return y.l>50?_e(y.h,y.c,0).formatHex():_e(y.h,y.c,100).formatHex()}let l=-1;async function i(m,y){l>-1||(r(1,l=y),await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([m],{type:"text/plain"})})]),setTimeout(()=>{r(1,l=-1)},800))}const o=(m,y)=>i(m.formatHex(),y);return e.$$set=m=>{"colors"in m&&r(0,n=m.colors)},[n,l,s,i,o]}class ir extends Ee{constructor(t){super(),Ne(this,t,lr,sr,$e,{colors:0})}}function dt(e,t,r){const n=e.slice();return n[12]=t[r],n[14]=r,n}function gt(e){let t,r;return t=new ir({props:{colors:e[4]}}),{c(){He(t.$$.fragment)},l(n){qe(t.$$.fragment,n)},m(n,s){Re(t,n,s),r=!0},p(n,s){const l={};s&16&&(l.colors=n[4]),t.$set(l)},i(n){r||(J(t.$$.fragment,n),r=!0)},o(n){ae(t.$$.fragment,n),r=!1},d(n){Le(t,n)}}}function pt(e){let t,r,n,s;function l(){return e[8](e[14])}function i(){return e[9](e[14])}return{c(){t=L("button"),this.h()},l(o){t=z(o,"BUTTON",{class:!0}),H(t).forEach(_),this.h()},h(){c(t,"class",r=(e[1]===e[14]?"bg-black dark:bg-white":"bg-white dark:bg-black")+" dark:bg-slate-300 rounded-full h-3 w-3 m-1 border border-black dark:border-white")},m(o,m){Q(o,t,m),n||(s=[se(t,"click",l),se(t,"mousemove",i)],n=!0)},p(o,m){e=o,m&2&&r!==(r=(e[1]===e[14]?"bg-black dark:bg-white":"bg-white dark:bg-black")+" dark:bg-slate-300 rounded-full h-3 w-3 m-1 border border-black dark:border-white")&&c(t,"class",r)},d(o){o&&_(t),n=!1,Oe(s)}}}function or(e){let t,r,n,s,l,i,o,m,y,q,O,h,a,d,f,b,x,M,C,R,v=e[2]?"Copied":"Copy",$,P,D,T,w=e[4]&&gt(e),B=e[0].images,I=[];for(let g=0;g<B.length;g+=1)I[g]=pt(dt(e,B,g));return{c(){t=L("div"),r=L("blockquote"),n=L("p"),s=j(e[5]),l=A(),i=L("div"),w&&w.c(),o=A(),m=L("div"),y=L("div"),q=L("img"),h=A(),a=L("div");for(let g=0;g<I.length;g+=1)I[g].c();d=A(),f=L("div"),b=L("div"),x=L("button"),M=j("Remix"),C=A(),R=L("button"),$=j(v),this.h()},l(g){t=z(g,"DIV",{class:!0});var S=H(t);r=z(S,"BLOCKQUOTE",{class:!0,title:!0});var u=H(r);n=z(u,"P",{});var k=H(n);s=F(k,e[5]),k.forEach(_),u.forEach(_),l=U(S),i=z(S,"DIV",{class:!0});var E=H(i);w&&w.l(E),E.forEach(_),o=U(S),m=z(S,"DIV",{class:!0});var N=H(m);y=z(N,"DIV",{class:!0});var V=H(y);q=z(V,"IMG",{loading:!0,class:!0,src:!0,alt:!0}),h=U(V),a=z(V,"DIV",{class:!0});var K=H(a);for(let ne=0;ne<I.length;ne+=1)I[ne].l(K);K.forEach(_),V.forEach(_),N.forEach(_),d=U(S),f=z(S,"DIV",{class:!0});var ee=H(f);b=z(ee,"DIV",{class:!0});var Y=H(b);x=z(Y,"BUTTON",{class:!0,title:!0});var te=H(x);M=F(te,"Remix"),te.forEach(_),C=U(Y),R=z(Y,"BUTTON",{class:!0,title:!0});var re=H(R);$=F(re,v),re.forEach(_),Y.forEach(_),ee.forEach(_),S.forEach(_),this.h()},h(){c(r,"class","row-start-1 mx-auto col-span-6 italic font-semibold max-w-prose text-base text-center line-clamp-3 my-3"),c(r,"title",e[5]),c(i,"class","row-start-3 md:row-start-2 col-span-6 md:col-span-4 flex items-center justify-center"),c(q,"loading","lazy"),c(q,"class","relative max-w-[100px] w-full aspect-square"),Ze(q.src,O=e[3])||c(q,"src",O),c(q,"alt",e[5]),c(a,"class","absolute flex justify-around w-full"),c(y,"class","relative"),c(m,"class","row-start-2 col-span-6 md:col-span-2 flex justify-center md:justify-end pb-3"),c(x,"class","button svelte-8zu88a"),c(x,"title","Send this prompt to input so you can remix it"),c(R,"class","button svelte-8zu88a"),c(R,"title","Copy all colors to clipboard"),R.disabled=e[2],c(b,"class","flex justify-center items-center"),c(f,"class","row-start-4 col-span-6 md:col-span-2 md:col-start-5 flex justify-center md:justify-end"),c(t,"class","grid grid-cols-6 gap-3")},m(g,S){Q(g,t,S),p(t,r),p(r,n),p(n,s),p(t,l),p(t,i),w&&w.m(i,null),p(t,o),p(t,m),p(m,y),p(y,q),p(y,h),p(y,a);for(let u=0;u<I.length;u+=1)I[u].m(a,null);p(t,d),p(t,f),p(f,b),p(b,x),p(x,M),p(b,C),p(b,R),p(R,$),P=!0,D||(T=[se(x,"click",e[10]),se(R,"click",e[11])],D=!0)},p(g,[S]){if((!P||S&32)&&me(s,g[5]),(!P||S&32)&&c(r,"title",g[5]),g[4]?w?(w.p(g,S),S&16&&J(w,1)):(w=gt(g),w.c(),J(w,1),w.m(i,null)):w&&(Qe(),ae(w,1,1,()=>{w=null}),Je()),(!P||S&8&&!Ze(q.src,O=g[3]))&&c(q,"src",O),(!P||S&32)&&c(q,"alt",g[5]),S&3){B=g[0].images;let u;for(u=0;u<B.length;u+=1){const k=dt(g,B,u);I[u]?I[u].p(k,S):(I[u]=pt(k),I[u].c(),I[u].m(a,null))}for(;u<I.length;u+=1)I[u].d(1);I.length=B.length}(!P||S&4)&&v!==(v=g[2]?"Copied":"Copy")&&me($,v),(!P||S&4)&&(R.disabled=g[2])},i(g){P||(J(w),P=!0)},o(g){ae(w),P=!1},d(g){g&&_(t),w&&w.d(),Ge(I,g),D=!1,Oe(T)}}}function cr(e,t,r){let n,s,l;const i=qt();let{promptData:o}=t,m=0,y=!1;async function q(f){y||(r(2,y=!0),await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([f],{type:"text/plain"})})]),setTimeout(()=>{r(2,y=!1)},1e3))}const O=f=>r(1,m=f),h=f=>r(1,m=f),a=()=>i("remix",{prompt:n}),d=()=>q(s.map(f=>f.formatHex()).join(", "));return e.$$set=f=>{"promptData"in f&&r(0,o=f.promptData)},e.$$.update=()=>{var f,b;e.$$.dirty&1&&r(5,n=o==null?void 0:o.prompt),e.$$.dirty&3&&r(4,s=((f=o==null?void 0:o.images[m])==null?void 0:f.colors.map(x=>Xe(x)))||[]),e.$$.dirty&3&&r(3,l=(b=o==null?void 0:o.images[m])==null?void 0:b.imgURL)},[o,m,y,l,s,n,i,q,O,h,a,d]}class fr extends Ee{constructor(t){super(),Ne(this,t,cr,or,$e,{promptData:0})}}function ur(e){let t,r;return{c(){t=he("svg"),r=he("path"),this.h()},l(n){t=de(n,"svg",{class:!0,xmlns:!0,"xmlns:xlink":!0,"aria-hidden":!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var s=H(t);r=de(s,"path",{d:!0,fill:!0}),H(r).forEach(_),s.forEach(_),this.h()},h(){c(r,"d","M10 16L20 6l1.4 1.4l-8.6 8.6l8.6 8.6L20 26z"),c(r,"fill","currentColor"),c(t,"class","ml-1.5 transform rotate-180"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),c(t,"aria-hidden","true"),c(t,"focusable","false"),c(t,"role","img"),c(t,"width","1em"),c(t,"height","1em"),c(t,"preserveAspectRatio","xMidYMid meet"),c(t,"viewBox","0 0 32 32")},m(n,s){Q(n,t,s),p(t,r)},p:ue,i:ue,o:ue,d(n){n&&_(t)}}}class hr extends Ee{constructor(t){super(),Ne(this,t,null,ur,$e,{})}}function dr(e){let t,r;return{c(){t=he("svg"),r=he("path"),this.h()},l(n){t=de(n,"svg",{class:!0,xmlns:!0,"xmlns:xlink":!0,"aria-hidden":!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var s=H(t);r=de(s,"path",{d:!0,fill:!0}),H(r).forEach(_),s.forEach(_),this.h()},h(){c(r,"d","M10 16L20 6l1.4 1.4l-8.6 8.6l8.6 8.6L20 26z"),c(r,"fill","currentColor"),c(t,"class","mr-1.5"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),c(t,"aria-hidden","true"),c(t,"focusable","false"),c(t,"role","img"),c(t,"width","1em"),c(t,"height","1em"),c(t,"preserveAspectRatio","xMidYMid meet"),c(t,"viewBox","0 0 32 32")},m(n,s){Q(n,t,s),p(t,r)},p:ue,i:ue,o:ue,d(n){n&&_(t)}}}class gr extends Ee{constructor(t){super(),Ne(this,t,null,dr,$e,{})}}function mt(e,t,r){const n=e.slice();return n[23]=t[r],n}function bt(e){let t,r,n,s,l=e[7]&&xt();return{c(){t=L("h3"),r=j(e[6]),n=A(),l&&l.c(),s=rt(),this.h()},l(i){t=z(i,"H3",{class:!0});var o=H(t);r=F(o,e[6]),o.forEach(_),n=U(i),l&&l.l(i),s=rt(),this.h()},h(){c(t,"class","text-xs font-bold ml-3 inline-block")},m(i,o){Q(i,t,o),p(t,r),Q(i,n,o),l&&l.m(i,o),Q(i,s,o)},p(i,o){o&64&&me(r,i[6]),i[7]?l||(l=xt(),l.c(),l.m(s.parentNode,s)):l&&(l.d(1),l=null)},d(i){i&&_(t),i&&_(n),l&&l.d(i),i&&_(s)}}}function xt(e){let t,r;return{c(){t=he("svg"),r=he("path"),this.h()},l(n){t=de(n,"svg",{xmlns:!0,fill:!0,viewBox:!0,class:!0});var s=H(t);r=de(s,"path",{fill:!0,d:!0}),H(r).forEach(_),s.forEach(_),this.h()},h(){c(r,"fill","currentColor"),c(r,"d","M20 12a8 8 0 0 1-8 8v4a12 12 0 0 0 12-12h-4Zm-2-5.3a8 8 0 0 1 2 5.3h4c0-3-1.1-5.8-3-8l-3 2.7Z"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"class","animate-spin max-w-[1rem] inline-block")},m(n,s){Q(n,t,s),p(t,r)},d(n){n&&_(t)}}}function wt(e){let t,r,n,s,l,i,o,m,y,q,O,h,a,d=e[0]+1+"",f,b,x,M,C,R,v,$,P,D,T,w,B,I=e[4],g=[];for(let u=0;u<I.length;u+=1)g[u]=vt(mt(e,I,u));const S=u=>ae(g[u],1,1,()=>{g[u]=null});return y=new gr({}),D=new hr({}),{c(){t=L("div");for(let u=0;u<g.length;u+=1)g[u].c();r=A(),n=L("nav"),s=L("ul"),l=L("li"),i=A(),o=L("li"),m=L("a"),He(y.$$.fragment),q=j(" Previous"),O=A(),h=L("li"),a=L("span"),f=j(d),b=A(),x=j("/"),M=L("span"),C=j(e[1]),R=A(),v=L("li"),$=L("a"),P=j("Next "),He(D.$$.fragment),this.h()},l(u){t=z(u,"DIV",{});var k=H(t);for(let fe=0;fe<g.length;fe+=1)g[fe].l(k);k.forEach(_),r=U(u),n=z(u,"NAV",{role:!0});var E=H(n);s=z(E,"UL",{class:!0});var N=H(s);l=z(N,"LI",{}),H(l).forEach(_),i=U(N),o=z(N,"LI",{});var V=H(o);m=z(V,"A",{class:!0,href:!0});var K=H(m);qe(y.$$.fragment,K),q=F(K," Previous"),K.forEach(_),V.forEach(_),O=U(N),h=z(N,"LI",{class:!0});var ee=H(h);a=z(ee,"SPAN",{class:!0});var Y=H(a);f=F(Y,d),b=U(Y),Y.forEach(_),x=F(ee,"/"),M=z(ee,"SPAN",{class:!0});var te=H(M);C=F(te,e[1]),te.forEach(_),ee.forEach(_),R=U(N),v=z(N,"LI",{});var re=H(v);$=z(re,"A",{class:!0,href:!0});var ne=H($);P=F(ne,"Next "),qe(D.$$.fragment,ne),ne.forEach(_),re.forEach(_),N.forEach(_),E.forEach(_),this.h()},h(){c(m,"class","px-2.5 py-1 hover:bg-gray-50 dark:hover:bg-gray-800 flex items-center rounded-lg"),c(m,"href","#"),c(a,"class","inline-block min-w-[3ch] text-right"),c(M,"class","inline-block min-w-[3ch]"),c(h,"class","text-sm"),c($,"class","px-2.5 py-1 hover:bg-gray-50 dark:hover:bg-gray-800 flex items-center rounded-lg"),c($,"href","#"),c(s,"class","items-center sm:justify-center space-x-2 select-none w-full flex justify-center mt-6 mb-4"),c(n,"role","navigation")},m(u,k){Q(u,t,k);for(let E=0;E<g.length;E+=1)g[E].m(t,null);Q(u,r,k),Q(u,n,k),p(n,s),p(s,l),p(s,i),p(s,o),p(o,m),Re(y,m,null),p(m,q),p(s,O),p(s,h),p(h,a),p(a,f),p(a,b),p(h,x),p(h,M),p(M,C),p(s,R),p(s,v),p(v,$),p($,P),Re(D,$,null),T=!0,w||(B=[se(m,"click",ze(e[17])),se($,"click",ze(e[18]))],w=!0)},p(u,k){if(k&528){I=u[4];let E;for(E=0;E<I.length;E+=1){const N=mt(u,I,E);g[E]?(g[E].p(N,k),J(g[E],1)):(g[E]=vt(N),g[E].c(),J(g[E],1),g[E].m(t,null))}for(Qe(),E=I.length;E<g.length;E+=1)S(E);Je()}(!T||k&1)&&d!==(d=u[0]+1+"")&&me(f,d),(!T||k&2)&&me(C,u[1])},i(u){if(!T){for(let k=0;k<I.length;k+=1)J(g[k]);J(y.$$.fragment,u),J(D.$$.fragment,u),T=!0}},o(u){g=g.filter(Boolean);for(let k=0;k<g.length;k+=1)ae(g[k]);ae(y.$$.fragment,u),ae(D.$$.fragment,u),T=!1},d(u){u&&_(t),Ge(g,u),u&&_(r),u&&_(n),Le(y),Le(D),w=!1,Oe(B)}}}function vt(e){let t,r,n,s;return t=new fr({props:{promptData:e[23]}}),t.$on("remix",e[9]),{c(){He(t.$$.fragment),r=A(),n=L("div"),this.h()},l(l){qe(t.$$.fragment,l),r=U(l),n=z(l,"DIV",{class:!0}),H(n).forEach(_),this.h()},h(){c(n,"class","border-b border-gray-200 py-2")},m(l,i){Re(t,l,i),Q(l,r,i),Q(l,n,i),s=!0},p(l,i){const o={};i&16&&(o.promptData=l[23]),t.$set(o)},i(l){s||(J(t.$$.fragment,l),s=!0)},o(l){ae(t.$$.fragment,l),s=!1},d(l){Le(t,l),l&&_(r),l&&_(n)}}}function pr(e){let t,r,n,s,l,i,o,m,y,q,O,h,a,d,f,b,x,M,C,R,v,$,P=e[5]?`${e[5]} submitted palettes`:"Loading...",D,T,w,B,I,g,S,u=e[6]&&bt(e),k=e[4]&&wt(e);return{c(){t=L("div"),r=L("h1"),n=j("Palette generation with Stable Diffusion"),s=A(),l=L("p"),i=j(`Original ideas:
2
 
3
  `),o=L("a"),m=j(`Matt DesLauriers
4
  `),y=j(`,
5
- `),q=L("a"),O=j("dribnet"),h=A(),a=L("div"),d=L("form"),f=L("input"),b=A(),x=L("button"),M=j("Create Palette"),C=A(),u&&u.c(),R=A(),v=L("div"),$=L("div"),D=j(P),T=A(),w=L("div"),B=A(),k&&k.c(),this.h()},l(E){t=z(E,"DIV",{class:!0});var N=H(t);r=z(N,"H1",{class:!0});var V=H(r);n=F(V,"Palette generation with Stable Diffusion"),V.forEach(_),s=U(N),l=z(N,"P",{class:!0});var K=H(l);i=F(K,`Original ideas:
6
 
7
  `),o=z(K,"A",{class:!0,target:!0,rel:!0,href:!0});var ee=H(o);m=F(ee,`Matt DesLauriers
8
  `),ee.forEach(_),y=F(K,`,
9
- `),q=z(K,"A",{class:!0,href:!0});var Y=H(q);O=F(Y,"dribnet"),Y.forEach(_),K.forEach(_),h=U(N),a=z(N,"DIV",{class:!0});var te=H(a);d=z(te,"FORM",{class:!0});var re=H(d);f=z(re,"INPUT",{class:!0,placeholder:!0,title:!0,type:!0,name:!0}),b=U(re),x=z(re,"BUTTON",{class:!0,title:!0});var ne=H(x);M=F(ne,"Create Palette"),ne.forEach(_),re.forEach(_),C=U(te),u&&u.l(te),te.forEach(_),R=U(N),v=z(N,"DIV",{class:!0});var fe=H(v);$=z(fe,"DIV",{class:!0});var Ye=H($);D=F(Ye,P),Ye.forEach(_),T=U(fe),w=z(fe,"DIV",{class:!0}),H(w).forEach(_),fe.forEach(_),B=U(N),k&&k.l(N),N.forEach(_),this.h()},h(){c(r,"class","text-3xl font-bold leading-normal"),c(o,"class","link svelte-zbscw1"),c(o,"target","_blank"),c(o,"rel","nofollow noopener"),c(o,"href","https://twitter.com/mattdesl/status/1569457653298139136"),c(q,"class","link svelte-zbscw1"),c(q,"href","https://drib.net/homage"),c(l,"class","text-sm"),c(f,"class","input svelte-zbscw1"),c(f,"placeholder","A photo of a beautiful sunset in San Francisco"),c(f,"title","Input prompt to generate image and obtain palette"),c(f,"type","text"),c(f,"name","prompt"),f.disabled=e[7],c(x,"class","button svelte-zbscw1"),x.disabled=e[7],c(x,"title","Generate Palette"),c(d,"class","grid grid-cols-6"),c(a,"class","relative top-0 z-50 bg-white dark:bg-black py-3"),c($,"class","font-bold text-sm"),c(w,"class","grow border-b border-gray-200"),c(v,"class","flex items-center gap-4 my-10"),c(t,"class","max-w-screen-md mx-auto px-3 py-8 relative z-0")},m(E,N){Q(E,t,N),p(t,r),p(r,n),p(t,s),p(t,l),p(l,i),p(l,o),p(o,m),p(l,y),p(l,q),p(q,O),p(t,h),p(t,a),p(a,d),p(d,f),e[13](f),et(f,e[2]),p(d,b),p(d,x),p(x,M),p(a,C),u&&u.m(a,null),p(t,R),p(t,v),p(v,$),p($,D),p(v,T),p(v,w),p(t,B),k&&k.m(t,null),I=!0,g||(S=[se(f,"input",e[14]),se(x,"click",ze(e[15])),se(d,"submit",ze(e[16]))],g=!0)},p(E,[N]){(!I||N&128)&&(f.disabled=E[7]),N&4&&f.value!==E[2]&&et(f,E[2]),(!I||N&128)&&(x.disabled=E[7]),E[6]?u?u.p(E,N):(u=bt(E),u.c(),u.m(a,null)):u&&(u.d(1),u=null),(!I||N&32)&&P!==(P=E[5]?`${E[5]} submitted palettes`:"Loading...")&&me(D,P),E[4]?k?(k.p(E,N),N&16&&J(k,1)):(k=wt(E),k.c(),J(k,1),k.m(t,null)):k&&(Qe(),ae(k,1,1,()=>{k=null}),Je())},i(E){I||(J(k),I=!0)},o(E){ae(k),I=!1},d(E){E&&_(t),e[13](null),u&&u.d(),k&&k.d(),g=!1,Oe(S)}}}const We=10;function _t(e){return e.sort((t,r)=>r.id-t.id).map(t=>t.data).filter(t=>t.images.length>0)}function mr(e,t,r){let n,s,l,i,o;tt(e,X,w=>r(6,i=w)),tt(e,xe,w=>r(7,o=w));const m="/embed/huggingface-projects/color-palette-generator-sd";let y=[],q,O;Rt(()=>{h();const w=window.setInterval(h,5e3);return()=>{clearInterval(w)}});async function h(){const w=await fetch(m+"/data").then(B=>B.json());(!y||(w==null?void 0:w.length)>(y==null?void 0:y.length))&&r(11,y=_t(w))}let a=0,d=[];async function f(w){try{const B=await fetch(m+"/new_palette",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:w.prompt,images:w.images.map(I=>({imgURL:I.imgURL,colors:I.colors.map(g=>g.formatHex())}))})}).then(I=>I.json());r(11,y=_t(B))}catch(B){console.error(B)}}async function b(w){if(!w||o==!0)return;W(X,i="Pending",i),W(xe,o=!0,o);const B=crypto.randomUUID(),I={fn_index:2,data:[w],session_hash:B},g=new WebSocket(ar);g.onclose=S=>{S.wasClean||(W(X,i="Error",i),W(xe,o=!1,o))},g.onmessage=async function(S){try{const u=JSON.parse(S.data);switch(W(X,i="",i),u.msg){case"send_data":W(X,i="Sending Data",i),g.send(JSON.stringify(I));break;case"queue_full":W(X,i="Queue full",i),g.close(),W(xe,o=!1,o);return;case"estimation":const{msg:k,rank:E,queue_size:N}=u;W(X,i=`On queue ${E}/${N}`,i);break;case"process_generating":W(X,i=u.success?"Generating":"Error",i);break;case"process_completed":try{const V=await x(u.output.data[0],w);f({prompt:w,images:V}),W(X,i=u.success?"Complete":"Error",i)}catch(V){W(X,i=V.message,i)}g.close(),W(xe,o=!1,o);return;case"process_starts":W(X,i="Processing",i);break}}catch(u){console.error(u),W(xe,o=!1,o),W(X,i="Error",i)}}}async function x(w,B){const I=["#040404","#B7B7B7","#565656","#747474","#6C6C6C"],g=[];let S=!1;for(const u of w){const{colors:k,imgBlob:E}=await tr(u);if(k.map(N=>N.formatHex().toUpperCase()).every(N=>I.includes(N)))S=!0;else{const N=await rr(E,B),V={colors:k,imgURL:N};g.push(V)}}if(g.length===0&&S)throw console.error("Possible NSFW image"),new Error("Possible NSFW image");return g}function M(w){r(2,q=w.detail.prompt),O.scrollIntoView({behavior:"smooth"}),"parentIFrame"in window&&window.parentIFrame.scrollTo(0,O.offsetTop)}function C(){window.scrollTo(0,0),"parentIFrame"in window&&window.parentIFrame.scrollTo(0,O.offsetTop)}function R(w){Lt[w?"unshift":"push"](()=>{O=w,r(3,O)})}function v(){q=this.value,r(2,q)}const $=()=>b(q),P=()=>b(q),D=()=>{r(0,a=a-1<0?0:a-1),C()},T=()=>{r(0,a=a+1>=s-1?s-1:a+1),C()};return e.$$.update=()=>{if(e.$$.dirty&2048&&r(5,n=(y==null?void 0:y.length)||null),e.$$.dirty&2048&&r(1,s=Math.ceil((y==null?void 0:y.length)/We)||0),e.$$.dirty&2049&&r(4,l=[...y].slice(a*We,(a+1)*We)),e.$$.dirty&4098&&s){const w=Array(s).fill([]).map((B,I)=>({value:I,label:I+1}));r(12,d=w.slice(0,3).concat([{value:-1,label:"..."}]).concat(w.length>3?w.slice(-1):[])),console.log(d)}},[a,s,q,O,l,n,i,o,b,M,C,y,d,R,v,$,P,D,T]}class wr extends Ee{constructor(t){super(),Ne(this,t,mr,pr,$e,{})}}export{wr as default};
 
1
+ import{S as Ee,i as Ne,s as $e,k as L,l as z,m as H,h as _,n as c,b as Q,F as p,A as ue,H as Ge,I as he,a as A,q as j,J as de,c as U,r as F,p as Ce,K as se,u as me,L as Ze,f as J,g as Qe,t as ae,d as Je,M as Oe,N as qt,v as He,w as qe,x as Re,y as Le,O as et,P as ze,G as tt,o as Rt,e as rt,Q as W,R as Lt}from"../../chunks/index-5559954d.js";import{w as yt}from"../../chunks/index-3bda1050.js";if(!oe)var oe={map:function(e,t){var r={};return t?e.map(function(n,s){return r.index=s,t.call(r,n)}):e.slice()},naturalOrder:function(e,t){return e<t?-1:e>t?1:0},sum:function(e,t){var r={};return e.reduce(t?function(n,s,l){return r.index=l,n+t.call(r,s)}:function(n,s){return n+s},0)},max:function(e,t){return Math.max.apply(null,t?oe.map(e,t):e)}};var zt=function(){var e=5,t=8-e,r=1e3,n=.75;function s(h,a,d){return(h<<2*e)+(a<<e)+d}function l(h){var a=[],d=!1;function f(){a.sort(h),d=!0}return{push:function(b){a.push(b),d=!1},peek:function(b){return d||f(),b===void 0&&(b=a.length-1),a[b]},pop:function(){return d||f(),a.pop()},size:function(){return a.length},map:function(b){return a.map(b)},debug:function(){return d||f(),a}}}function i(h,a,d,f,b,x,M){var C=this;C.r1=h,C.r2=a,C.g1=d,C.g2=f,C.b1=b,C.b2=x,C.histo=M}i.prototype={volume:function(h){var a=this;return(!a._volume||h)&&(a._volume=(a.r2-a.r1+1)*(a.g2-a.g1+1)*(a.b2-a.b1+1)),a._volume},count:function(h){var a=this,d=a.histo;if(!a._count_set||h){var f=0,b,x,M,C;for(b=a.r1;b<=a.r2;b++)for(x=a.g1;x<=a.g2;x++)for(M=a.b1;M<=a.b2;M++)C=s(b,x,M),f+=d[C]||0;a._count=f,a._count_set=!0}return a._count},copy:function(){var h=this;return new i(h.r1,h.r2,h.g1,h.g2,h.b1,h.b2,h.histo)},avg:function(h){var a=this,d=a.histo;if(!a._avg||h){var f=0,b=1<<8-e,x=0,M=0,C=0,R,w,$,P,D;for(w=a.r1;w<=a.r2;w++)for($=a.g1;$<=a.g2;$++)for(P=a.b1;P<=a.b2;P++)D=s(w,$,P),R=d[D]||0,f+=R,x+=R*(w+.5)*b,M+=R*($+.5)*b,C+=R*(P+.5)*b;f?a._avg=[~~(x/f),~~(M/f),~~(C/f)]:a._avg=[~~(b*(a.r1+a.r2+1)/2),~~(b*(a.g1+a.g2+1)/2),~~(b*(a.b1+a.b2+1)/2)]}return a._avg},contains:function(h){var a=this,d=h[0]>>t;return gval=h[1]>>t,bval=h[2]>>t,d>=a.r1&&d<=a.r2&&gval>=a.g1&&gval<=a.g2&&bval>=a.b1&&bval<=a.b2}};function o(){this.vboxes=new l(function(h,a){return oe.naturalOrder(h.vbox.count()*h.vbox.volume(),a.vbox.count()*a.vbox.volume())})}o.prototype={push:function(h){this.vboxes.push({vbox:h,color:h.avg()})},palette:function(){return this.vboxes.map(function(h){return h.color})},size:function(){return this.vboxes.size()},map:function(h){for(var a=this.vboxes,d=0;d<a.size();d++)if(a.peek(d).vbox.contains(h))return a.peek(d).color;return this.nearest(h)},nearest:function(h){for(var a=this.vboxes,d,f,b,x=0;x<a.size();x++)f=Math.sqrt(Math.pow(h[0]-a.peek(x).color[0],2)+Math.pow(h[1]-a.peek(x).color[1],2)+Math.pow(h[2]-a.peek(x).color[2],2)),(f<d||d===void 0)&&(d=f,b=a.peek(x).color);return b},forcebw:function(){var h=this.vboxes;h.sort(function(b,x){return oe.naturalOrder(oe.sum(b.color),oe.sum(x.color))});var a=h[0].color;a[0]<5&&a[1]<5&&a[2]<5&&(h[0].color=[0,0,0]);var d=h.length-1,f=h[d].color;f[0]>251&&f[1]>251&&f[2]>251&&(h[d].color=[255,255,255])}};function m(h){var a=1<<3*e,d=new Array(a),f,b,x,M;return h.forEach(function(C){b=C[0]>>t,x=C[1]>>t,M=C[2]>>t,f=s(b,x,M),d[f]=(d[f]||0)+1}),d}function y(h,a){var d=1e6,f=0,b=1e6,x=0,M=1e6,C=0,R,w,$;return h.forEach(function(P){R=P[0]>>t,w=P[1]>>t,$=P[2]>>t,R<d?d=R:R>f&&(f=R),w<b?b=w:w>x&&(x=w),$<M?M=$:$>C&&(C=$)}),new i(d,f,b,x,M,C,a)}function q(h,a){if(!a.count())return;var d=a.r2-a.r1+1,f=a.g2-a.g1+1,b=a.b2-a.b1+1,x=oe.max([d,f,b]);if(a.count()==1)return[a.copy()];var M=0,C=[],R=[],w,$,P,D,T;if(x==d)for(w=a.r1;w<=a.r2;w++){for(D=0,$=a.g1;$<=a.g2;$++)for(P=a.b1;P<=a.b2;P++)T=s(w,$,P),D+=h[T]||0;M+=D,C[w]=M}else if(x==f)for(w=a.g1;w<=a.g2;w++){for(D=0,$=a.r1;$<=a.r2;$++)for(P=a.b1;P<=a.b2;P++)T=s($,w,P),D+=h[T]||0;M+=D,C[w]=M}else for(w=a.b1;w<=a.b2;w++){for(D=0,$=a.r1;$<=a.r2;$++)for(P=a.g1;P<=a.g2;P++)T=s($,P,w),D+=h[T]||0;M+=D,C[w]=M}C.forEach(function(B,I){R[I]=M-B});function v(B){var I=B+"1",g=B+"2",S,u,k,E,N,V=0;for(w=a[I];w<=a[g];w++)if(C[w]>M/2){for(k=a.copy(),E=a.copy(),S=w-a[I],u=a[g]-w,S<=u?N=Math.min(a[g]-1,~~(w+u/2)):N=Math.max(a[I],~~(w-1-S/2));!C[N];)N++;for(V=R[N];!V&&C[N-1];)V=R[--N];return k[g]=N,E[I]=k[g]+1,[k,E]}}return x==d?v("r"):x==f?v("g"):v("b")}function O(h,a){if(!h.length||a<2||a>256)return!1;var d=m(h);d.forEach(function(){});var f=y(h,d),b=new l(function(R,w){return oe.naturalOrder(R.count(),w.count())});b.push(f);function x(R,w){for(var $=1,P=0,D;P<r;){if(D=R.pop(),!D.count()){R.push(D),P++;continue}var T=q(d,D),v=T[0],B=T[1];if(!v||(R.push(v),B&&(R.push(B),$++),$>=w)||P++>r)return}}x(b,n*a);for(var M=new l(function(R,w){return oe.naturalOrder(R.count()*R.volume(),w.count()*w.volume())});b.size();)M.push(b.pop());x(M,a-M.size());for(var C=new o;M.size();)C.push(M.pop());return C}return{quantize:O}}(),St=zt.quantize;function Ie(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Te(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function be(){}var ye=.7,Se=1/ye,ve="\\s*([+-]?\\d+)\\s*",ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",le="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Dt=/^#([0-9a-f]{3,8})$/,Bt=new RegExp(`^rgb\\(${ve},${ve},${ve}\\)$`),Ot=new RegExp(`^rgb\\(${le},${le},${le}\\)$`),Tt=new RegExp(`^rgba\\(${ve},${ve},${ve},${ke}\\)$`),At=new RegExp(`^rgba\\(${le},${le},${le},${ke}\\)$`),Ut=new RegExp(`^hsl\\(${ke},${le},${le}\\)$`),Vt=new RegExp(`^hsla\\(${ke},${le},${le},${ke}\\)$`),nt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ie(be,Ke,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:at,formatHex:at,formatHex8:jt,formatHsl:Ft,formatRgb:st,toString:st});function at(){return this.rgb().formatHex()}function jt(){return this.rgb().formatHex8()}function Ft(){return Et(this).formatHsl()}function st(){return this.rgb().formatRgb()}function Ke(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Dt.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?lt(t):r===3?new G(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Pe(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Pe(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Bt.exec(e))?new G(t[1],t[2],t[3],1):(t=Ot.exec(e))?new G(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Tt.exec(e))?Pe(t[1],t[2],t[3],t[4]):(t=At.exec(e))?Pe(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ut.exec(e))?ct(t[1],t[2]/100,t[3]/100,1):(t=Vt.exec(e))?ct(t[1],t[2]/100,t[3]/100,t[4]):nt.hasOwnProperty(e)?lt(nt[e]):e==="transparent"?new G(NaN,NaN,NaN,0):null}function lt(e){return new G(e>>16&255,e>>8&255,e&255,1)}function Pe(e,t,r,n){return n<=0&&(e=t=r=NaN),new G(e,t,r,n)}function kt(e){return e instanceof be||(e=Ke(e)),e?(e=e.rgb(),new G(e.r,e.g,e.b,e.opacity)):new G}function Xe(e,t,r,n){return arguments.length===1?kt(e):new G(e,t,r,n==null?1:n)}function G(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Ie(G,Xe,Te(be,{brighter(e){return e=e==null?Se:Math.pow(Se,e),new G(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ye:Math.pow(ye,e),new G(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new G(pe(this.r),pe(this.g),pe(this.b),De(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:it,formatHex:it,formatHex8:Wt,formatRgb:ot,toString:ot}));function it(){return`#${ge(this.r)}${ge(this.g)}${ge(this.b)}`}function Wt(){return`#${ge(this.r)}${ge(this.g)}${ge(this.b)}${ge((isNaN(this.opacity)?1:this.opacity)*255)}`}function ot(){const e=De(this.opacity);return`${e===1?"rgb(":"rgba("}${pe(this.r)}, ${pe(this.g)}, ${pe(this.b)}${e===1?")":`, ${e})`}`}function De(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ge(e){return e=pe(e),(e<16?"0":"")+e.toString(16)}function ct(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Z(e,t,r,n)}function Et(e){if(e instanceof Z)return new Z(e.h,e.s,e.l,e.opacity);if(e instanceof be||(e=Ke(e)),!e)return new Z;if(e instanceof Z)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,s=Math.min(t,r,n),l=Math.max(t,r,n),i=NaN,o=l-s,m=(l+s)/2;return o?(t===l?i=(r-n)/o+(r<n)*6:r===l?i=(n-t)/o+2:i=(t-r)/o+4,o/=m<.5?l+s:2-l-s,i*=60):o=m>0&&m<1?0:i,new Z(i,o,m,e.opacity)}function Gt(e,t,r,n){return arguments.length===1?Et(e):new Z(e,t,r,n==null?1:n)}function Z(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Ie(Z,Gt,Te(be,{brighter(e){return e=e==null?Se:Math.pow(Se,e),new Z(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ye:Math.pow(ye,e),new Z(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,s=2*r-n;return new G(Ae(e>=240?e-240:e+120,s,n),Ae(e,s,n),Ae(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new Z(ft(this.h),Me(this.s),Me(this.l),De(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=De(this.opacity);return`${e===1?"hsl(":"hsla("}${ft(this.h)}, ${Me(this.s)*100}%, ${Me(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ft(e){return e=(e||0)%360,e<0?e+360:e}function Me(e){return Math.max(0,Math.min(1,e||0))}function Ae(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Qt=Math.PI/180,Jt=180/Math.PI,Be=18,Nt=.96422,$t=1,It=.82521,Ct=4/29,we=6/29,Pt=3*we*we,Kt=we*we*we;function Mt(e){if(e instanceof ie)return new ie(e.l,e.a,e.b,e.opacity);if(e instanceof ce)return Ht(e);e instanceof G||(e=kt(e));var t=Fe(e.r),r=Fe(e.g),n=Fe(e.b),s=Ue((.2225045*t+.7168786*r+.0606169*n)/$t),l,i;return t===r&&r===n?l=i=s:(l=Ue((.4360747*t+.3850649*r+.1430804*n)/Nt),i=Ue((.0139322*t+.0971045*r+.7141733*n)/It)),new ie(116*s-16,500*(l-s),200*(s-i),e.opacity)}function Xt(e,t,r,n){return arguments.length===1?Mt(e):new ie(e,t,r,n==null?1:n)}function ie(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}Ie(ie,Xt,Te(be,{brighter(e){return new ie(this.l+Be*(e==null?1:e),this.a,this.b,this.opacity)},darker(e){return new ie(this.l-Be*(e==null?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=Nt*Ve(t),e=$t*Ve(e),r=It*Ve(r),new G(je(3.1338561*t-1.6168667*e-.4906146*r),je(-.9787684*t+1.9161415*e+.033454*r),je(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));function Ue(e){return e>Kt?Math.pow(e,1/3):e/Pt+Ct}function Ve(e){return e>we?e*e*e:Pt*(e-Ct)}function je(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Fe(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Yt(e){if(e instanceof ce)return new ce(e.h,e.c,e.l,e.opacity);if(e instanceof ie||(e=Mt(e)),e.a===0&&e.b===0)return new ce(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Jt;return new ce(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function _e(e,t,r,n){return arguments.length===1?Yt(e):new ce(e,t,r,n==null?1:n)}function ce(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function Ht(e){if(isNaN(e.h))return new ie(e.l,0,0,e.opacity);var t=e.h*Qt;return new ie(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Ie(ce,_e,Te(be,{brighter(e){return new ce(this.h,this.c,this.l+Be*(e==null?1:e),this.opacity)},darker(e){return new ce(this.h,this.c,this.l-Be*(e==null?1:e),this.opacity)},rgb(){return Ht(this).rgb()}}));function Zt(e){return e.map(t=>_e(t)).sort((t,r)=>{const n=t.h,s=r.h;return s-n||isNaN(s)-isNaN(n)})}function er(e,t,r){const n=e,s=[];for(let l=0,i,o,m,y,q;l<t;l=l+r)i=l*4,o=n[i+0],m=n[i+1],y=n[i+2],q=n[i+3],(typeof q>"u"||q>=125)&&(o>250&&m>250&&y>250||s.push([o,m,y]));return s}function tr(e,t=5,r=1){return new Promise(n=>{const s=new Image;s.onload=async()=>{const l=s.width,i=s.height,o=document.createElement("canvas");o.width=l,o.height=i;const m=o.getContext("2d");m.drawImage(s,0,0,l,i);const y=m.getImageData(0,0,l,i),q=er(y.data,l*i,r),h=St(q,t).palette(),a=document.createElement("canvas");a.width=l/5,a.height=i/5,a.getContext("2d").drawImage(s,0,0,l,i,0,0,l/5,i/5);const f=await new Promise(x=>a.toBlob(x,"image/jpeg",.8)),b=h.map(x=>Xe(...x));n({colors:Zt(b),imgBlob:f})},s.src=e})}async function rr(e,t){const r=nr(t),n="https://huggingface.co/uploads",l=`color-palette-${crypto.randomUUID().split("-")[0]}-${r}.jpeg`,i=new File([e],l,{type:"image/jpeg"});console.log("uploading image",i);const m=await(await fetch(n,{method:"POST",headers:{"Content-Type":i.type,"X-Requested-With":"XMLHttpRequest"},body:i})).text();return console.log("uploaded images",m),m}function nr(e){return e?e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,""):""}const X=yt(""),xe=yt(!1),ar="wss://spaces.huggingface.tech/stabilityai/stable-diffusion/queue/join";function ut(e,t,r){const n=e.slice();return n[6]=t[r],n[8]=r,n}function ht(e){let t,r,n,s,l,i,o=(e[1]===e[8]?"copied":e[6].formatHex())+"",m,y,q,O,h;function a(){return e[4](e[6],e[8])}return{c(){t=L("div"),r=he("svg"),n=he("rect"),l=A(),i=L("span"),m=j(o),y=A(),this.h()},l(d){t=z(d,"DIV",{class:!0,style:!0});var f=H(t);r=de(f,"svg",{class:!0,width:!0,viewBox:!0});var b=H(r);n=de(b,"rect",{x:!0,y:!0,width:!0,height:!0,fill:!0}),H(n).forEach(_),b.forEach(_),l=U(f),i=z(f,"SPAN",{title:!0,class:!0,style:!0});var x=H(i);m=F(x,o),x.forEach(_),y=U(f),f.forEach(_),this.h()},h(){c(n,"x","0"),c(n,"y","0"),c(n,"width","50"),c(n,"height","50"),c(n,"fill",s=e[6].formatHex()),c(r,"class","block max-w-full aspect-square"),c(r,"width","100"),c(r,"viewBox","0 0 50 50"),c(i,"title","Copy single color"),c(i,"class","absolute bottom-0 text-center text-xs pl-1 font-bold uppercase"),Ce(i,"color",e[2](e[6])),c(t,"class",q=(e[1]===e[8]?"":"cursor-pointer")+" aspect-square relative"),Ce(t,"background-color",e[6].formatHex())},m(d,f){Q(d,t,f),p(t,r),p(r,n),p(t,l),p(t,i),p(i,m),p(t,y),O||(h=se(t,"click",a),O=!0)},p(d,f){e=d,f&1&&s!==(s=e[6].formatHex())&&c(n,"fill",s),f&3&&o!==(o=(e[1]===e[8]?"copied":e[6].formatHex())+"")&&me(m,o),f&1&&Ce(i,"color",e[2](e[6])),f&2&&q!==(q=(e[1]===e[8]?"":"cursor-pointer")+" aspect-square relative")&&c(t,"class",q),f&1&&Ce(t,"background-color",e[6].formatHex())},d(d){d&&_(t),O=!1,h()}}}function sr(e){let t,r,n=e[0],s=[];for(let l=0;l<n.length;l+=1)s[l]=ht(ut(e,n,l));return{c(){t=L("div"),r=L("div");for(let l=0;l<s.length;l+=1)s[l].c();this.h()},l(l){t=z(l,"DIV",{class:!0});var i=H(t);r=z(i,"DIV",{class:!0});var o=H(r);for(let m=0;m<s.length;m+=1)s[m].l(o);o.forEach(_),i.forEach(_),this.h()},h(){c(r,"class","flex"),c(t,"class","flex flex-col items-center")},m(l,i){Q(l,t,i),p(t,r);for(let o=0;o<s.length;o+=1)s[o].m(r,null)},p(l,[i]){if(i&15){n=l[0];let o;for(o=0;o<n.length;o+=1){const m=ut(l,n,o);s[o]?s[o].p(m,i):(s[o]=ht(m),s[o].c(),s[o].m(r,null))}for(;o<s.length;o+=1)s[o].d(1);s.length=n.length}},i:ue,o:ue,d(l){l&&_(t),Ge(s,l)}}}function lr(e,t,r){let{colors:n}=t;n.length;function s(m){const y=_e(m);return y.l>50?_e(y.h,y.c,0).formatHex():_e(y.h,y.c,100).formatHex()}let l=-1;async function i(m,y){l>-1||(r(1,l=y),await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([m],{type:"text/plain"})})]),setTimeout(()=>{r(1,l=-1)},800))}const o=(m,y)=>i(m.formatHex(),y);return e.$$set=m=>{"colors"in m&&r(0,n=m.colors)},[n,l,s,i,o]}class ir extends Ee{constructor(t){super(),Ne(this,t,lr,sr,$e,{colors:0})}}function dt(e,t,r){const n=e.slice();return n[12]=t[r],n[14]=r,n}function gt(e){let t,r;return t=new ir({props:{colors:e[4]}}),{c(){He(t.$$.fragment)},l(n){qe(t.$$.fragment,n)},m(n,s){Re(t,n,s),r=!0},p(n,s){const l={};s&16&&(l.colors=n[4]),t.$set(l)},i(n){r||(J(t.$$.fragment,n),r=!0)},o(n){ae(t.$$.fragment,n),r=!1},d(n){Le(t,n)}}}function pt(e){let t,r,n,s;function l(){return e[8](e[14])}function i(){return e[9](e[14])}return{c(){t=L("button"),this.h()},l(o){t=z(o,"BUTTON",{class:!0}),H(t).forEach(_),this.h()},h(){c(t,"class",r=(e[1]===e[14]?"bg-black dark:bg-white":"bg-white dark:bg-black")+" dark:bg-slate-300 rounded-full h-3 w-3 m-1 border border-black dark:border-white")},m(o,m){Q(o,t,m),n||(s=[se(t,"click",l),se(t,"mousemove",i)],n=!0)},p(o,m){e=o,m&2&&r!==(r=(e[1]===e[14]?"bg-black dark:bg-white":"bg-white dark:bg-black")+" dark:bg-slate-300 rounded-full h-3 w-3 m-1 border border-black dark:border-white")&&c(t,"class",r)},d(o){o&&_(t),n=!1,Oe(s)}}}function or(e){let t,r,n,s,l,i,o,m,y,q,O,h,a,d,f,b,x,M,C,R,w=e[2]?"Copied":"Copy",$,P,D,T,v=e[4]&&gt(e),B=e[0].images,I=[];for(let g=0;g<B.length;g+=1)I[g]=pt(dt(e,B,g));return{c(){t=L("div"),r=L("blockquote"),n=L("p"),s=j(e[5]),l=A(),i=L("div"),v&&v.c(),o=A(),m=L("div"),y=L("div"),q=L("img"),h=A(),a=L("div");for(let g=0;g<I.length;g+=1)I[g].c();d=A(),f=L("div"),b=L("div"),x=L("button"),M=j("Remix"),C=A(),R=L("button"),$=j(w),this.h()},l(g){t=z(g,"DIV",{class:!0});var S=H(t);r=z(S,"BLOCKQUOTE",{class:!0,title:!0});var u=H(r);n=z(u,"P",{});var k=H(n);s=F(k,e[5]),k.forEach(_),u.forEach(_),l=U(S),i=z(S,"DIV",{class:!0});var E=H(i);v&&v.l(E),E.forEach(_),o=U(S),m=z(S,"DIV",{class:!0});var N=H(m);y=z(N,"DIV",{class:!0});var V=H(y);q=z(V,"IMG",{loading:!0,class:!0,src:!0,alt:!0}),h=U(V),a=z(V,"DIV",{class:!0});var K=H(a);for(let ne=0;ne<I.length;ne+=1)I[ne].l(K);K.forEach(_),V.forEach(_),N.forEach(_),d=U(S),f=z(S,"DIV",{class:!0});var ee=H(f);b=z(ee,"DIV",{class:!0});var Y=H(b);x=z(Y,"BUTTON",{class:!0,title:!0});var te=H(x);M=F(te,"Remix"),te.forEach(_),C=U(Y),R=z(Y,"BUTTON",{class:!0,title:!0});var re=H(R);$=F(re,w),re.forEach(_),Y.forEach(_),ee.forEach(_),S.forEach(_),this.h()},h(){c(r,"class","row-start-1 mx-auto col-span-6 italic font-semibold max-w-prose text-base text-center line-clamp-3 my-3"),c(r,"title",e[5]),c(i,"class","row-start-3 md:row-start-2 col-span-6 md:col-span-4 flex items-center justify-center"),c(q,"loading","lazy"),c(q,"class","relative max-w-[100px] w-full aspect-square"),Ze(q.src,O=e[3])||c(q,"src",O),c(q,"alt",e[5]),c(a,"class","absolute flex justify-around w-full"),c(y,"class","relative"),c(m,"class","row-start-2 col-span-6 md:col-span-2 flex justify-center md:justify-end pb-3"),c(x,"class","button svelte-8zu88a"),c(x,"title","Send this prompt to input so you can remix it"),c(R,"class","button svelte-8zu88a"),c(R,"title","Copy all colors to clipboard"),R.disabled=e[2],c(b,"class","flex justify-center items-center"),c(f,"class","row-start-4 col-span-6 md:col-span-2 md:col-start-5 flex justify-center md:justify-end"),c(t,"class","grid grid-cols-6 gap-3")},m(g,S){Q(g,t,S),p(t,r),p(r,n),p(n,s),p(t,l),p(t,i),v&&v.m(i,null),p(t,o),p(t,m),p(m,y),p(y,q),p(y,h),p(y,a);for(let u=0;u<I.length;u+=1)I[u].m(a,null);p(t,d),p(t,f),p(f,b),p(b,x),p(x,M),p(b,C),p(b,R),p(R,$),P=!0,D||(T=[se(x,"click",e[10]),se(R,"click",e[11])],D=!0)},p(g,[S]){if((!P||S&32)&&me(s,g[5]),(!P||S&32)&&c(r,"title",g[5]),g[4]?v?(v.p(g,S),S&16&&J(v,1)):(v=gt(g),v.c(),J(v,1),v.m(i,null)):v&&(Qe(),ae(v,1,1,()=>{v=null}),Je()),(!P||S&8&&!Ze(q.src,O=g[3]))&&c(q,"src",O),(!P||S&32)&&c(q,"alt",g[5]),S&3){B=g[0].images;let u;for(u=0;u<B.length;u+=1){const k=dt(g,B,u);I[u]?I[u].p(k,S):(I[u]=pt(k),I[u].c(),I[u].m(a,null))}for(;u<I.length;u+=1)I[u].d(1);I.length=B.length}(!P||S&4)&&w!==(w=g[2]?"Copied":"Copy")&&me($,w),(!P||S&4)&&(R.disabled=g[2])},i(g){P||(J(v),P=!0)},o(g){ae(v),P=!1},d(g){g&&_(t),v&&v.d(),Ge(I,g),D=!1,Oe(T)}}}function cr(e,t,r){let n,s,l;const i=qt();let{promptData:o}=t,m=0,y=!1;async function q(f){y||(r(2,y=!0),await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([f],{type:"text/plain"})})]),setTimeout(()=>{r(2,y=!1)},1e3))}const O=f=>r(1,m=f),h=f=>r(1,m=f),a=()=>i("remix",{prompt:n}),d=()=>q(s.map(f=>f.formatHex()).join(", "));return e.$$set=f=>{"promptData"in f&&r(0,o=f.promptData)},e.$$.update=()=>{var f,b;e.$$.dirty&1&&r(5,n=o==null?void 0:o.prompt),e.$$.dirty&3&&r(4,s=((f=o==null?void 0:o.images[m])==null?void 0:f.colors.map(x=>Xe(x)))||[]),e.$$.dirty&3&&r(3,l=(b=o==null?void 0:o.images[m])==null?void 0:b.imgURL)},[o,m,y,l,s,n,i,q,O,h,a,d]}class fr extends Ee{constructor(t){super(),Ne(this,t,cr,or,$e,{promptData:0})}}function ur(e){let t,r;return{c(){t=he("svg"),r=he("path"),this.h()},l(n){t=de(n,"svg",{class:!0,xmlns:!0,"xmlns:xlink":!0,"aria-hidden":!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var s=H(t);r=de(s,"path",{d:!0,fill:!0}),H(r).forEach(_),s.forEach(_),this.h()},h(){c(r,"d","M10 16L20 6l1.4 1.4l-8.6 8.6l8.6 8.6L20 26z"),c(r,"fill","currentColor"),c(t,"class","ml-1.5 transform rotate-180"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),c(t,"aria-hidden","true"),c(t,"focusable","false"),c(t,"role","img"),c(t,"width","1em"),c(t,"height","1em"),c(t,"preserveAspectRatio","xMidYMid meet"),c(t,"viewBox","0 0 32 32")},m(n,s){Q(n,t,s),p(t,r)},p:ue,i:ue,o:ue,d(n){n&&_(t)}}}class hr extends Ee{constructor(t){super(),Ne(this,t,null,ur,$e,{})}}function dr(e){let t,r;return{c(){t=he("svg"),r=he("path"),this.h()},l(n){t=de(n,"svg",{class:!0,xmlns:!0,"xmlns:xlink":!0,"aria-hidden":!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var s=H(t);r=de(s,"path",{d:!0,fill:!0}),H(r).forEach(_),s.forEach(_),this.h()},h(){c(r,"d","M10 16L20 6l1.4 1.4l-8.6 8.6l8.6 8.6L20 26z"),c(r,"fill","currentColor"),c(t,"class","mr-1.5"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),c(t,"aria-hidden","true"),c(t,"focusable","false"),c(t,"role","img"),c(t,"width","1em"),c(t,"height","1em"),c(t,"preserveAspectRatio","xMidYMid meet"),c(t,"viewBox","0 0 32 32")},m(n,s){Q(n,t,s),p(t,r)},p:ue,i:ue,o:ue,d(n){n&&_(t)}}}class gr extends Ee{constructor(t){super(),Ne(this,t,null,dr,$e,{})}}function mt(e,t,r){const n=e.slice();return n[23]=t[r],n}function bt(e){let t,r,n,s,l=e[7]&&xt();return{c(){t=L("h3"),r=j(e[6]),n=A(),l&&l.c(),s=rt(),this.h()},l(i){t=z(i,"H3",{class:!0});var o=H(t);r=F(o,e[6]),o.forEach(_),n=U(i),l&&l.l(i),s=rt(),this.h()},h(){c(t,"class","text-xs font-bold ml-3 inline-block")},m(i,o){Q(i,t,o),p(t,r),Q(i,n,o),l&&l.m(i,o),Q(i,s,o)},p(i,o){o&64&&me(r,i[6]),i[7]?l||(l=xt(),l.c(),l.m(s.parentNode,s)):l&&(l.d(1),l=null)},d(i){i&&_(t),i&&_(n),l&&l.d(i),i&&_(s)}}}function xt(e){let t,r;return{c(){t=he("svg"),r=he("path"),this.h()},l(n){t=de(n,"svg",{xmlns:!0,fill:!0,viewBox:!0,class:!0});var s=H(t);r=de(s,"path",{fill:!0,d:!0}),H(r).forEach(_),s.forEach(_),this.h()},h(){c(r,"fill","currentColor"),c(r,"d","M20 12a8 8 0 0 1-8 8v4a12 12 0 0 0 12-12h-4Zm-2-5.3a8 8 0 0 1 2 5.3h4c0-3-1.1-5.8-3-8l-3 2.7Z"),c(t,"xmlns","http://www.w3.org/2000/svg"),c(t,"fill","none"),c(t,"viewBox","0 0 24 24"),c(t,"class","animate-spin max-w-[1rem] inline-block")},m(n,s){Q(n,t,s),p(t,r)},d(n){n&&_(t)}}}function vt(e){let t,r,n,s,l,i,o,m,y,q,O,h,a,d=e[0]+1+"",f,b,x,M,C,R,w,$,P,D,T,v,B,I=e[4],g=[];for(let u=0;u<I.length;u+=1)g[u]=wt(mt(e,I,u));const S=u=>ae(g[u],1,1,()=>{g[u]=null});return y=new gr({}),D=new hr({}),{c(){t=L("div");for(let u=0;u<g.length;u+=1)g[u].c();r=A(),n=L("nav"),s=L("ul"),l=L("li"),i=A(),o=L("li"),m=L("a"),He(y.$$.fragment),q=j(" Previous"),O=A(),h=L("li"),a=L("span"),f=j(d),b=A(),x=j("/"),M=L("span"),C=j(e[1]),R=A(),w=L("li"),$=L("a"),P=j("Next "),He(D.$$.fragment),this.h()},l(u){t=z(u,"DIV",{});var k=H(t);for(let fe=0;fe<g.length;fe+=1)g[fe].l(k);k.forEach(_),r=U(u),n=z(u,"NAV",{role:!0});var E=H(n);s=z(E,"UL",{class:!0});var N=H(s);l=z(N,"LI",{}),H(l).forEach(_),i=U(N),o=z(N,"LI",{});var V=H(o);m=z(V,"A",{class:!0,href:!0});var K=H(m);qe(y.$$.fragment,K),q=F(K," Previous"),K.forEach(_),V.forEach(_),O=U(N),h=z(N,"LI",{class:!0});var ee=H(h);a=z(ee,"SPAN",{class:!0});var Y=H(a);f=F(Y,d),b=U(Y),Y.forEach(_),x=F(ee,"/"),M=z(ee,"SPAN",{class:!0});var te=H(M);C=F(te,e[1]),te.forEach(_),ee.forEach(_),R=U(N),w=z(N,"LI",{});var re=H(w);$=z(re,"A",{class:!0,href:!0});var ne=H($);P=F(ne,"Next "),qe(D.$$.fragment,ne),ne.forEach(_),re.forEach(_),N.forEach(_),E.forEach(_),this.h()},h(){c(m,"class","px-2.5 py-1 hover:bg-gray-50 dark:hover:bg-gray-800 flex items-center rounded-lg"),c(m,"href","#"),c(a,"class","inline-block min-w-[3ch] text-right"),c(M,"class","inline-block min-w-[3ch]"),c(h,"class","text-sm"),c($,"class","px-2.5 py-1 hover:bg-gray-50 dark:hover:bg-gray-800 flex items-center rounded-lg"),c($,"href","#"),c(s,"class","items-center sm:justify-center space-x-2 select-none w-full flex justify-center mt-6 mb-4"),c(n,"role","navigation")},m(u,k){Q(u,t,k);for(let E=0;E<g.length;E+=1)g[E].m(t,null);Q(u,r,k),Q(u,n,k),p(n,s),p(s,l),p(s,i),p(s,o),p(o,m),Re(y,m,null),p(m,q),p(s,O),p(s,h),p(h,a),p(a,f),p(a,b),p(h,x),p(h,M),p(M,C),p(s,R),p(s,w),p(w,$),p($,P),Re(D,$,null),T=!0,v||(B=[se(m,"click",ze(e[17])),se($,"click",ze(e[18]))],v=!0)},p(u,k){if(k&528){I=u[4];let E;for(E=0;E<I.length;E+=1){const N=mt(u,I,E);g[E]?(g[E].p(N,k),J(g[E],1)):(g[E]=wt(N),g[E].c(),J(g[E],1),g[E].m(t,null))}for(Qe(),E=I.length;E<g.length;E+=1)S(E);Je()}(!T||k&1)&&d!==(d=u[0]+1+"")&&me(f,d),(!T||k&2)&&me(C,u[1])},i(u){if(!T){for(let k=0;k<I.length;k+=1)J(g[k]);J(y.$$.fragment,u),J(D.$$.fragment,u),T=!0}},o(u){g=g.filter(Boolean);for(let k=0;k<g.length;k+=1)ae(g[k]);ae(y.$$.fragment,u),ae(D.$$.fragment,u),T=!1},d(u){u&&_(t),Ge(g,u),u&&_(r),u&&_(n),Le(y),Le(D),v=!1,Oe(B)}}}function wt(e){let t,r,n,s;return t=new fr({props:{promptData:e[23]}}),t.$on("remix",e[9]),{c(){He(t.$$.fragment),r=A(),n=L("div"),this.h()},l(l){qe(t.$$.fragment,l),r=U(l),n=z(l,"DIV",{class:!0}),H(n).forEach(_),this.h()},h(){c(n,"class","border-b border-gray-200 py-2")},m(l,i){Re(t,l,i),Q(l,r,i),Q(l,n,i),s=!0},p(l,i){const o={};i&16&&(o.promptData=l[23]),t.$set(o)},i(l){s||(J(t.$$.fragment,l),s=!0)},o(l){ae(t.$$.fragment,l),s=!1},d(l){Le(t,l),l&&_(r),l&&_(n)}}}function pr(e){let t,r,n,s,l,i,o,m,y,q,O,h,a,d,f,b,x,M,C,R,w,$,P=e[5]?`${e[5]} submitted palettes`:"Loading...",D,T,v,B,I,g,S,u=e[6]&&bt(e),k=e[4]&&vt(e);return{c(){t=L("div"),r=L("h1"),n=j("Palette generation with Stable Diffusion"),s=A(),l=L("p"),i=j(`Original ideas:
2
 
3
  `),o=L("a"),m=j(`Matt DesLauriers
4
  `),y=j(`,
5
+ `),q=L("a"),O=j("dribnet"),h=A(),a=L("div"),d=L("form"),f=L("input"),b=A(),x=L("button"),M=j("Create Palette"),C=A(),u&&u.c(),R=A(),w=L("div"),$=L("div"),D=j(P),T=A(),v=L("div"),B=A(),k&&k.c(),this.h()},l(E){t=z(E,"DIV",{class:!0});var N=H(t);r=z(N,"H1",{class:!0});var V=H(r);n=F(V,"Palette generation with Stable Diffusion"),V.forEach(_),s=U(N),l=z(N,"P",{class:!0});var K=H(l);i=F(K,`Original ideas:
6
 
7
  `),o=z(K,"A",{class:!0,target:!0,rel:!0,href:!0});var ee=H(o);m=F(ee,`Matt DesLauriers
8
  `),ee.forEach(_),y=F(K,`,
9
+ `),q=z(K,"A",{class:!0,href:!0});var Y=H(q);O=F(Y,"dribnet"),Y.forEach(_),K.forEach(_),h=U(N),a=z(N,"DIV",{class:!0});var te=H(a);d=z(te,"FORM",{class:!0});var re=H(d);f=z(re,"INPUT",{class:!0,placeholder:!0,title:!0,type:!0,name:!0}),b=U(re),x=z(re,"BUTTON",{class:!0,title:!0});var ne=H(x);M=F(ne,"Create Palette"),ne.forEach(_),re.forEach(_),C=U(te),u&&u.l(te),te.forEach(_),R=U(N),w=z(N,"DIV",{class:!0});var fe=H(w);$=z(fe,"DIV",{class:!0});var Ye=H($);D=F(Ye,P),Ye.forEach(_),T=U(fe),v=z(fe,"DIV",{class:!0}),H(v).forEach(_),fe.forEach(_),B=U(N),k&&k.l(N),N.forEach(_),this.h()},h(){c(r,"class","text-3xl font-bold leading-normal"),c(o,"class","link svelte-zbscw1"),c(o,"target","_blank"),c(o,"rel","nofollow noopener"),c(o,"href","https://twitter.com/mattdesl/status/1569457653298139136"),c(q,"class","link svelte-zbscw1"),c(q,"href","https://drib.net/homage"),c(l,"class","text-sm"),c(f,"class","input svelte-zbscw1"),c(f,"placeholder","A photo of a beautiful sunset in San Francisco"),c(f,"title","Input prompt to generate image and obtain palette"),c(f,"type","text"),c(f,"name","prompt"),f.disabled=e[7],c(x,"class","button svelte-zbscw1"),x.disabled=e[7],c(x,"title","Generate Palette"),c(d,"class","grid grid-cols-6"),c(a,"class","relative top-0 z-50 bg-white dark:bg-black py-3"),c($,"class","font-bold text-sm"),c(v,"class","grow border-b border-gray-200"),c(w,"class","flex items-center gap-4 my-10"),c(t,"class","max-w-screen-md mx-auto px-3 py-8 relative z-0")},m(E,N){Q(E,t,N),p(t,r),p(r,n),p(t,s),p(t,l),p(l,i),p(l,o),p(o,m),p(l,y),p(l,q),p(q,O),p(t,h),p(t,a),p(a,d),p(d,f),e[13](f),et(f,e[2]),p(d,b),p(d,x),p(x,M),p(a,C),u&&u.m(a,null),p(t,R),p(t,w),p(w,$),p($,D),p(w,T),p(w,v),p(t,B),k&&k.m(t,null),I=!0,g||(S=[se(f,"input",e[14]),se(x,"click",ze(e[15])),se(d,"submit",ze(e[16]))],g=!0)},p(E,[N]){(!I||N&128)&&(f.disabled=E[7]),N&4&&f.value!==E[2]&&et(f,E[2]),(!I||N&128)&&(x.disabled=E[7]),E[6]?u?u.p(E,N):(u=bt(E),u.c(),u.m(a,null)):u&&(u.d(1),u=null),(!I||N&32)&&P!==(P=E[5]?`${E[5]} submitted palettes`:"Loading...")&&me(D,P),E[4]?k?(k.p(E,N),N&16&&J(k,1)):(k=vt(E),k.c(),J(k,1),k.m(t,null)):k&&(Qe(),ae(k,1,1,()=>{k=null}),Je())},i(E){I||(J(k),I=!0)},o(E){ae(k),I=!1},d(E){E&&_(t),e[13](null),u&&u.d(),k&&k.d(),g=!1,Oe(S)}}}const We=10;function _t(e){return e.sort((t,r)=>r.id-t.id).map(t=>t.data).filter(t=>t.images.length>0)}function mr(e,t,r){let n,s,l,i,o;tt(e,X,v=>r(6,i=v)),tt(e,xe,v=>r(7,o=v));const m="/embed/huggingface-projects/color-palette-generator-sd";let y=[],q,O;Rt(()=>{h();const v=window.setInterval(h,5e3);return()=>{clearInterval(v)}});async function h(){const v=await fetch(m+"/data").then(B=>B.json());(!y||(v==null?void 0:v.length)>(y==null?void 0:y.length))&&r(11,y=_t(v))}let a=0,d=[];async function f(v){try{const B=await fetch(m+"/new_palette",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:v.prompt,images:v.images.map(I=>({imgURL:I.imgURL,colors:I.colors.map(g=>g.formatHex())}))})}).then(I=>I.json());r(11,y=_t(B))}catch(B){console.error(B)}}async function b(v){if(!v||o==!0)return;W(X,i="Pending",i),W(xe,o=!0,o);const B=crypto.randomUUID(),I={fn_index:2,data:[v],session_hash:B},g=new WebSocket(ar);g.onclose=S=>{S.wasClean||(W(X,i="Error",i),W(xe,o=!1,o))},g.onmessage=async function(S){try{const u=JSON.parse(S.data);switch(W(X,i="",i),u.msg){case"send_data":W(X,i="Sending Data",i),g.send(JSON.stringify(I));break;case"queue_full":W(X,i="Queue full",i),g.close(),W(xe,o=!1,o);return;case"estimation":const{msg:k,rank:E,queue_size:N}=u;W(X,i=`On queue ${E}/${N}`,i);break;case"process_generating":W(X,i=u.success?"Generating":"Error",i);break;case"process_completed":try{const V=await x(u.output.data[0],v);f({prompt:v,images:V}),W(X,i=u.success?"Complete":"Error",i)}catch(V){W(X,i=V.message,i)}g.close(),W(xe,o=!1,o);return;case"process_starts":W(X,i="Processing",i);break}}catch(u){console.error(u),W(xe,o=!1,o),W(X,i="Error",i)}}}async function x(v,B){const I=["#040404","#B7B7B7","#565656","#747474","#6C6C6C"],g=[];let S=!1;for(const u of v){const{colors:k,imgBlob:E}=await tr(u);if(k.map(N=>N.formatHex().toUpperCase()).every(N=>I.includes(N)))S=!0;else{const N=await rr(E,B),V={colors:k,imgURL:N};g.push(V)}}if(g.length===0&&S)throw console.error("Possible NSFW image"),new Error("Possible NSFW image");return g}function M(v){r(2,q=v.detail.prompt),O.scrollIntoView({behavior:"smooth"}),C()}function C(){window.scrollTo(0,0),"parentIFrame"in window&&window.parentIFrame.scrollTo(0,O.offsetTop)}function R(v){Lt[v?"unshift":"push"](()=>{O=v,r(3,O)})}function w(){q=this.value,r(2,q)}const $=()=>b(q),P=()=>b(q),D=()=>{r(0,a=a-1<0?0:a-1),C()},T=()=>{r(0,a=a+1>=s-1?s-1:a+1),C()};return e.$$.update=()=>{if(e.$$.dirty&2048&&r(5,n=(y==null?void 0:y.length)||null),e.$$.dirty&2048&&r(1,s=Math.ceil((y==null?void 0:y.length)/We)||0),e.$$.dirty&2049&&r(4,l=[...y].slice(a*We,(a+1)*We)),e.$$.dirty&4098&&s){const v=Array(s).fill([]).map((B,I)=>({value:I,label:I+1}));r(12,d=v.slice(0,3).concat([{value:-1,label:"..."}]).concat(v.length>3?v.slice(-1):[])),console.log(d)}},[a,s,q,O,l,n,i,o,b,M,C,y,d,R,w,$,P,D,T]}class vr extends Ee{constructor(t){super(),Ne(this,t,mr,pr,$e,{})}}export{vr as default};
static/_app/immutable/{start-db90f0a0.js β†’ start-59f72f27.js} RENAMED
@@ -1 +1 @@
1
- import{S as Ge,i as We,s as He,a as Me,e as z,c as Xe,b as W,g as ie,t as K,d as le,f as x,h as F,j as Ye,o as be,k as Qe,l as Ze,m as et,n as ge,p as C,q as tt,r as nt,u as rt,v as H,w as Se,x as M,y as X,z as De}from"./chunks/index-5559954d.js";import{g as Ce,f as qe,s as G,a as ve,b as at,i as st}from"./chunks/singletons-9542ead4.js";const ot=function(){const e=document.createElement("link").relList;return e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}(),it=function(r,e){return new URL(r,e).href},Ve={},se=function(e,t,c){return!t||t.length===0?e():Promise.all(t.map(o=>{if(o=it(o,c),o in Ve)return;Ve[o]=!0;const d=o.endsWith(".css"),n=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${n}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":ot,d||(f.as="script",f.crossOrigin=""),f.href=o,document.head.appendChild(f),d)return new Promise((w,_)=>{f.addEventListener("load",w),f.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())};class we{constructor(e,t){this.status=e,typeof t=="string"?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class Be{constructor(e,t){this.status=e,this.location=t}}function lt(r,e){return r==="/"||e==="ignore"?r:e==="never"?r.endsWith("/")?r.slice(0,-1):r:e==="always"&&!r.endsWith("/")?r+"/":r}function ct(r){for(const e in r)r[e]=r[e].replace(/%23/g,"#").replace(/%3[Bb]/g,";").replace(/%2[Cc]/g,",").replace(/%2[Ff]/g,"/").replace(/%3[Ff]/g,"?").replace(/%3[Aa]/g,":").replace(/%40/g,"@").replace(/%26/g,"&").replace(/%3[Dd]/g,"=").replace(/%2[Bb]/g,"+").replace(/%24/g,"$");return r}const ft=["href","pathname","search","searchParams","toString","toJSON"];function ut(r,e){const t=new URL(r);for(const c of ft){let o=t[c];Object.defineProperty(t,c,{get(){return e(),o},enumerable:!0,configurable:!0})}return t[Symbol.for("nodejs.util.inspect.custom")]=(c,o,d)=>d(r,o),dt(t),t}function dt(r){Object.defineProperty(r,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}function pt(r){let e=5381,t=r.length;if(typeof r=="string")for(;t;)e=e*33^r.charCodeAt(--t);else for(;t;)e=e*33^r[--t];return(e>>>0).toString(36)}const Re=window.fetch;window.fetch=(r,e)=>{if((r instanceof Request?r.method:(e==null?void 0:e.method)||"GET")!=="GET"){const c=new URL(r instanceof Request?r.url:r.toString(),document.baseURI).href;oe.delete(c)}return Re(r,e)};const oe=new Map;function ht(r,e,t){let o=`script[data-sveltekit-fetched][data-url=${JSON.stringify(typeof r=="string"?r:r.url)}]`;t&&typeof t.body=="string"&&(o+=`[data-hash="${pt(t.body)}"]`);const d=document.querySelector(o);if(d!=null&&d.textContent){const{body:n,...f}=JSON.parse(d.textContent),w=d.getAttribute("data-ttl");return w&&oe.set(e,{body:n,init:f,ttl:1e3*Number(w)}),Promise.resolve(new Response(n,f))}return Re(r,t)}function mt(r,e){const t=oe.get(r);if(t){if(performance.now()<t.ttl)return new Response(t.body,t.init);oe.delete(r)}return Re(r,e)}const _t=/^(\.\.\.)?(\w+)(?:=(\w+))?$/;function gt(r){const e=[],t=[];let c=!0;return{pattern:r===""?/^\/$/:new RegExp(`^${r.split(/(?:\/|$)/).filter(wt).map((d,n,f)=>{const w=decodeURIComponent(d),_=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(w);if(_)return e.push(_[1]),t.push(_[2]),"(?:/(.*))?";const b=n===f.length-1;return w&&"/"+w.split(/\[(.+?)\]/).map(($,S)=>{if(S%2){const N=_t.exec($);if(!N)throw new Error(`Invalid param: ${$}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,j,T,q]=N;return e.push(T),t.push(q),j?"(.*?)":"([^/]+?)"}return b&&$.includes(".")&&(c=!1),$.normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}${c?"/?":""}$`),names:e,types:t}}function wt(r){return!/^\([^)]+\)$/.test(r)}function yt(r,e,t,c){const o={};for(let d=0;d<e.length;d+=1){const n=e[d],f=t[d],w=r[d+1]||"";if(f){const _=c[f];if(!_)throw new Error(`Missing "${f}" param matcher`);if(!_(w))return}o[n]=w}return o}function bt(r,e,t,c){const o=new Set(e);return Object.entries(t).map(([f,[w,_,b]])=>{const{pattern:$,names:S,types:N}=gt(f),j={id:f,exec:T=>{const q=$.exec(T);if(q)return yt(q,S,N,c)},errors:[1,...b||[]].map(T=>r[T]),layouts:[0,..._||[]].map(n),leaf:d(w)};return j.errors.length=j.layouts.length=Math.max(j.errors.length,j.layouts.length),j});function d(f){const w=f<0;return w&&(f=~f),[w,r[f]]}function n(f){return f===void 0?f:[o.has(f),r[f]]}}function vt(r){let e,t,c;var o=r[0][0];function d(n){return{props:{data:n[2],form:n[1]}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&4&&(w.data=n[2]),f&2&&(w.form=n[1]),o!==(o=n[0][0])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function kt(r){let e,t,c;var o=r[0][0];function d(n){return{props:{data:n[2],$$slots:{default:[Et]},$$scope:{ctx:n}}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&4&&(w.data=n[2]),f&523&&(w.$$scope={dirty:f,ctx:n}),o!==(o=n[0][0])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function Et(r){let e,t,c;var o=r[0][1];function d(n){return{props:{data:n[3],form:n[1]}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&8&&(w.data=n[3]),f&2&&(w.form=n[1]),o!==(o=n[0][1])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function Je(r){let e,t=r[5]&&ze(r);return{c(){e=Qe("div"),t&&t.c(),this.h()},l(c){e=Ze(c,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var o=et(e);t&&t.l(o),o.forEach(F),this.h()},h(){ge(e,"id","svelte-announcer"),ge(e,"aria-live","assertive"),ge(e,"aria-atomic","true"),C(e,"position","absolute"),C(e,"left","0"),C(e,"top","0"),C(e,"clip","rect(0 0 0 0)"),C(e,"clip-path","inset(50%)"),C(e,"overflow","hidden"),C(e,"white-space","nowrap"),C(e,"width","1px"),C(e,"height","1px")},m(c,o){W(c,e,o),t&&t.m(e,null)},p(c,o){c[5]?t?t.p(c,o):(t=ze(c),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(c){c&&F(e),t&&t.d()}}}function ze(r){let e;return{c(){e=tt(r[6])},l(t){e=nt(t,r[6])},m(t,c){W(t,e,c)},p(t,c){c&64&&rt(e,t[6])},d(t){t&&F(e)}}}function St(r){let e,t,c,o,d;const n=[kt,vt],f=[];function w(b,$){return b[0][1]?0:1}e=w(r),t=f[e]=n[e](r);let _=r[4]&&Je(r);return{c(){t.c(),c=Me(),_&&_.c(),o=z()},l(b){t.l(b),c=Xe(b),_&&_.l(b),o=z()},m(b,$){f[e].m(b,$),W(b,c,$),_&&_.m(b,$),W(b,o,$),d=!0},p(b,[$]){let S=e;e=w(b),e===S?f[e].p(b,$):(ie(),K(f[S],1,1,()=>{f[S]=null}),le(),t=f[e],t?t.p(b,$):(t=f[e]=n[e](b),t.c()),x(t,1),t.m(c.parentNode,c)),b[4]?_?_.p(b,$):(_=Je(b),_.c(),_.m(o.parentNode,o)):_&&(_.d(1),_=null)},i(b){d||(x(t),d=!0)},o(b){K(t),d=!1},d(b){f[e].d(b),b&&F(c),_&&_.d(b),b&&F(o)}}}function Rt(r,e,t){let{stores:c}=e,{page:o}=e,{components:d}=e,{form:n}=e,{data_0:f=null}=e,{data_1:w=null}=e;Ye(c.page.notify);let _=!1,b=!1,$=null;return be(()=>{const S=c.page.subscribe(()=>{_&&(t(5,b=!0),t(6,$=document.title||"untitled page"))});return t(4,_=!0),S}),r.$$set=S=>{"stores"in S&&t(7,c=S.stores),"page"in S&&t(8,o=S.page),"components"in S&&t(0,d=S.components),"form"in S&&t(1,n=S.form),"data_0"in S&&t(2,f=S.data_0),"data_1"in S&&t(3,w=S.data_1)},r.$$.update=()=>{r.$$.dirty&384&&c.page.set(o)},[d,n,f,w,_,b,$,c,o]}class $t extends Ge{constructor(e){super(),We(this,e,Rt,St,He,{stores:7,page:8,components:0,form:1,data_0:2,data_1:3})}}const Lt={},ce=[()=>se(()=>import("./chunks/0-17a4fec1.js"),["chunks/0-17a4fec1.js","chunks/_layout-1daba58d.js","components/pages/_layout.svelte-55da5a4f.js","assets/_layout-e397cbf6.css","chunks/index-5559954d.js"],import.meta.url),()=>se(()=>import("./chunks/1-e583b0d4.js"),["chunks/1-e583b0d4.js","components/error.svelte-f5e989b0.js","chunks/index-5559954d.js","chunks/singletons-9542ead4.js","chunks/index-3bda1050.js"],import.meta.url),()=>se(()=>import("./chunks/2-ca93f0c9.js"),["chunks/2-ca93f0c9.js","components/pages/_page.svelte-ea2cf9bd.js","assets/_page-fd1176fc.css","chunks/index-5559954d.js","chunks/index-3bda1050.js"],import.meta.url)],Pt=[],Ot={"":[2]},jt={handleError:({error:r})=>(console.error(r),{message:"Internal Error"})},Ut="/__data.js",Fe="sveltekit:scroll",J="sveltekit:index",ne=bt(ce,Pt,Ot,Lt),ke=ce[0],Ee=ce[1];ke();Ee();let ee={};try{ee=JSON.parse(sessionStorage[Fe])}catch{}function ye(r){ee[r]=ve()}function It({target:r,base:e,trailing_slash:t}){var Ne;const c=[],o={id:null,promise:null},d={before_navigate:[],after_navigate:[]};let n={branch:[],error:null,session_id:0,url:null},f=!1,w=!0,_=!1,b=1,$=null,S=!1,N,j=(Ne=history.state)==null?void 0:Ne[J];j||(j=Date.now(),history.replaceState({...history.state,[J]:j},"",location.href));const T=ee[j];T&&(history.scrollRestoration="manual",scrollTo(T.x,T.y));let q=!1,V,$e;function Le(){if(!$){const a=new URL(location.href);$=Promise.resolve().then(async()=>{const i=pe(a,!0);await Oe(i,a,[]),$=null,S=!1})}return $}async function fe(a,{noscroll:i=!1,replaceState:p=!1,keepfocus:s=!1,state:l={}},h){return typeof a=="string"&&(a=new URL(a,Ce(document))),he({url:a,scroll:i?ve():null,keepfocus:s,redirect_chain:h,details:{state:l,replaceState:p},accepted:()=>{},blocked:()=>{},type:"goto"})}async function Pe(a){const i=pe(a,!1);if(!i)throw new Error("Attempted to prefetch a URL that does not belong to this app");return o.promise=Ie(i),o.id=i.id,o.promise}async function Oe(a,i,p,s,l){var v,k;const h=$e={};let m=a&&await Ie(a);if(!m&&i.origin===location.origin&&i.pathname===location.pathname&&(m=await te({status:404,error:new Error(`Not found: ${i.pathname}`),url:i,routeId:null})),!m)return await Q(i),!1;if(i=(a==null?void 0:a.url)||i,$e!==h)return!1;if(c.length=0,m.type==="redirect")if(p.length>10||p.includes(i.pathname))m=await te({status:500,error:new Error("Redirect loop"),url:i,routeId:null});else return fe(new URL(m.location,i).href,{},[...p,i.pathname]),!1;else((k=(v=m.props)==null?void 0:v.page)==null?void 0:k.status)>=400&&await G.updated.check()&&await Q(i);if(_=!0,s&&s.details){const{details:y}=s,g=y.replaceState?0:1;y.state[J]=j+=g,history[y.replaceState?"replaceState":"pushState"](y.state,"",i)}if(f){n=m.state,m.props.page&&(m.props.page.url=i);const y=ae();N.$set(m.props),y()}else je(m);if(s){const{scroll:y,keepfocus:g}=s;if(!g){const E=document.body,U=E.getAttribute("tabindex");E.tabIndex=-1,E.focus({preventScroll:!0}),setTimeout(()=>{var L;(L=getSelection())==null||L.removeAllRanges()}),U!==null?E.setAttribute("tabindex",U):E.removeAttribute("tabindex")}if(await De(),w){const E=i.hash&&document.getElementById(i.hash.slice(1));y?scrollTo(y.x,y.y):E?E.scrollIntoView():scrollTo(0,0)}}else await De();o.promise=null,o.id=null,w=!0,m.props.page&&(V=m.props.page),l&&l(),_=!1}function je(a){var l,h;n=a.state;const i=document.querySelector("style[data-sveltekit]");i&&i.remove(),V=a.props.page;const p=ae();N=new $t({target:r,props:{...a.props,stores:G},hydrate:!0}),p();const s={from:null,to:re("to",{params:n.params,routeId:(h=(l=n.route)==null?void 0:l.id)!=null?h:null,url:new URL(location.href)}),type:"load"};d.after_navigate.forEach(m=>m(s)),f=!0}async function Y({url:a,params:i,branch:p,status:s,error:l,route:h,form:m}){var U;const v=p.filter(Boolean),k={type:"loaded",state:{url:a,params:i,branch:p,error:l,route:h,session_id:b},props:{components:v.map(L=>L.node.component)}};m!==void 0&&(k.props.form=m);let y={},g=!V;for(let L=0;L<v.length;L+=1){const I=v[L];y={...y,...I.data},(g||!n.branch.some(A=>A===I))&&(k.props[`data_${L}`]=y,g=g||Object.keys((U=I.data)!=null?U:{}).length>0)}if(g||(g=Object.keys(V.data).length!==Object.keys(y).length),!n.url||a.href!==n.url.href||n.error!==l||g){k.props.page={error:l,params:i,routeId:h&&h.id,status:s,url:a,data:g?y:V.data};const L=(I,A)=>{Object.defineProperty(k.props.page,I,{get:()=>{throw new Error(`$page.${I} has been replaced by $page.url.${A}`)}})};L("origin","origin"),L("path","pathname"),L("query","searchParams")}return k}async function ue({loader:a,parent:i,url:p,params:s,routeId:l,server_data_node:h}){var y,g,E,U,L;let m=null;const v={dependencies:new Set,params:new Set,parent:!1,url:!1},k=await a();if((y=k.shared)!=null&&y.load){let I=function(...u){for(const R of u){const{href:O}=new URL(R,p);v.dependencies.add(O)}};const A={};for(const u in s)Object.defineProperty(A,u,{get(){return v.params.add(u),s[u]},enumerable:!0});const B={routeId:l,params:A,data:(g=h==null?void 0:h.data)!=null?g:null,url:ut(p,()=>{v.url=!0}),async fetch(u,R){let O;typeof u=="string"?O=u:(O=u.url,R={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:u.headers,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...R});const P=new URL(O,p).href;return I(P),f?mt(P,R):ht(O,P,R)},setHeaders:()=>{},depends:I,parent(){return v.parent=!0,i()}};Object.defineProperties(B,{props:{get(){throw new Error("@migration task: Replace `props` with `data` stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1},session:{get(){throw new Error("session is no longer available. See https://github.com/sveltejs/kit/discussions/5883")},enumerable:!1},stuff:{get(){throw new Error("@migration task: Remove stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1}}),m=(E=await k.shared.load.call(null,B))!=null?E:null}return{node:k,loader:a,server:h,shared:(U=k.shared)!=null&&U.load?{type:"data",data:m,uses:v}:null,data:(L=m!=null?m:h==null?void 0:h.data)!=null?L:null}}function Ue(a,i,p){if(S)return!0;if(!p)return!1;if(p.parent&&i||a.url&&p.url)return!0;for(const s of a.params)if(p.params.has(s))return!0;for(const s of p.dependencies)if(c.some(l=>l(new URL(s))))return!0;return!1}function de(a,i){var p,s;return(a==null?void 0:a.type)==="data"?{type:"data",data:a.data,uses:{dependencies:new Set((p=a.uses.dependencies)!=null?p:[]),params:new Set((s=a.uses.params)!=null?s:[]),parent:!!a.uses.parent,url:!!a.uses.url}}:(a==null?void 0:a.type)==="skip"&&i!=null?i:null}async function Ie({id:a,invalidating:i,url:p,params:s,route:l}){var B;if(o.id===a&&o.promise)return o.promise;const{errors:h,layouts:m,leaf:v}=l,k=n.url&&{url:a!==n.url.pathname+n.url.search,params:Object.keys(s).filter(u=>n.params[u]!==s[u])},y=[...m,v];h.forEach(u=>u==null?void 0:u().catch(()=>{})),y.forEach(u=>u==null?void 0:u[1]().catch(()=>{}));let g=null;const E=y.reduce((u,R,O)=>{var D;const P=n.branch[O],Z=!!(R!=null&&R[0])&&((P==null?void 0:P.loader)!==R[1]||Ue(k,u.some(Boolean),(D=P.server)==null?void 0:D.uses));return u.push(Z),u},[]);if(E.some(Boolean)){try{g=await Ke(p,E)}catch(u){return te({status:500,error:u,url:p,routeId:l.id})}if(g.type==="redirect")return g}const U=g==null?void 0:g.nodes;let L=!1;const I=y.map(async(u,R)=>{var D;if(!u)return;const O=n.branch[R],P=U==null?void 0:U[R];if((!P||P.type==="skip")&&u[1]===(O==null?void 0:O.loader)&&!Ue(k,L,(D=O.shared)==null?void 0:D.uses))return O;if(L=!0,(P==null?void 0:P.type)==="error")throw P;return ue({loader:u[1],url:p,params:s,routeId:l.id,parent:async()=>{var Te;const me={};for(let _e=0;_e<R;_e+=1)Object.assign(me,(Te=await I[_e])==null?void 0:Te.data);return me},server_data_node:de(P===void 0&&u[0]?{type:"skip"}:P!=null?P:null,O==null?void 0:O.server)})});for(const u of I)u.catch(()=>{});const A=[];for(let u=0;u<y.length;u+=1)if(y[u])try{A.push(await I[u])}catch(R){if(R instanceof Be)return{type:"redirect",location:R.location};let O=500,P;for(U!=null&&U.includes(R)?(O=(B=R.status)!=null?B:O,P=R.error):R instanceof we?(O=R.status,P=R.body):P=xe(R,{params:s,url:p,routeId:l.id});u--;)if(h[u]){let Z,D=u;for(;!A[D];)D-=1;try{return Z={node:await h[u](),loader:h[u],data:{},server:null,shared:null},await Y({url:p,params:s,branch:A.slice(0,D+1).concat(Z),status:O,error:P,route:l})}catch{continue}}await Q(p);return}else A.push(void 0);return await Y({url:p,params:s,branch:A,status:200,error:null,route:l,form:i?void 0:null})}async function te({status:a,error:i,url:p,routeId:s}){var y;const l={},h=await ke();let m=null;if(h.server)try{const g=await Ke(p,[!0]);if(g.type!=="data"||g.nodes[0]&&g.nodes[0].type!=="data")throw 0;m=(y=g.nodes[0])!=null?y:null}catch{await Q(p);return}const v=await ue({loader:ke,url:p,params:l,routeId:s,parent:()=>Promise.resolve({}),server_data_node:de(m)}),k={node:await Ee(),loader:Ee,shared:null,server:null,data:null};return await Y({url:p,params:l,branch:[v,k],status:a,error:i instanceof we?i.body:xe(i,{url:p,params:l,routeId:null}),route:null})}function pe(a,i){if(Ae(a))return;const p=decodeURI(a.pathname.slice(e.length)||"/");for(const s of ne){const l=s.exec(p);if(l){const h=new URL(a.origin+lt(a.pathname,t)+a.search+a.hash);return{id:h.pathname+h.search,invalidating:i,route:s,params:ct(l),url:h}}}}function Ae(a){return a.origin!==location.origin||!a.pathname.startsWith(e)}async function he({url:a,scroll:i,keepfocus:p,redirect_chain:s,details:l,type:h,delta:m,accepted:v,blocked:k}){var L,I,A,B;let y=!1;const g=pe(a,!1),E={from:re("from",{params:n.params,routeId:(I=(L=n.route)==null?void 0:L.id)!=null?I:null,url:n.url}),to:re("to",{params:(A=g==null?void 0:g.params)!=null?A:null,routeId:(B=g==null?void 0:g.route.id)!=null?B:null,url:a}),type:h};m!==void 0&&(E.delta=m);const U={...E,cancel:()=>{y=!0}};if(d.before_navigate.forEach(u=>u(U)),y){k();return}ye(j),v(),f&&G.navigating.set(E),await Oe(g,a,s,{scroll:i,keepfocus:p,details:l},()=>{d.after_navigate.forEach(u=>u(E)),G.navigating.set(null)})}function Q(a){return location.href=a.href,new Promise(()=>{})}return{after_navigate:a=>{be(()=>(d.after_navigate.push(a),()=>{const i=d.after_navigate.indexOf(a);d.after_navigate.splice(i,1)}))},before_navigate:a=>{be(()=>(d.before_navigate.push(a),()=>{const i=d.before_navigate.indexOf(a);d.before_navigate.splice(i,1)}))},disable_scroll_handling:()=>{(_||!f)&&(w=!1)},goto:(a,i={})=>fe(a,i,[]),invalidate:a=>{if(a===void 0)throw new Error("`invalidate()` (with no arguments) has been replaced by `invalidateAll()`");if(typeof a=="function")c.push(a);else{const{href:i}=new URL(a,location.href);c.push(p=>p.href===i)}return Le()},invalidateAll:()=>(S=!0,Le()),prefetch:async a=>{const i=new URL(a,Ce(document));await Pe(i)},prefetch_routes:async a=>{const p=(a?ne.filter(s=>a.some(l=>s.exec(l))):ne).map(s=>Promise.all([...s.layouts,s.leaf].map(l=>l==null?void 0:l[1]())));await Promise.all(p)},apply_action:async a=>{if(a.type==="error"){const i=new URL(location.href),{branch:p,route:s}=n;if(!s)return;let l=n.branch.length;for(;l--;)if(s.errors[l]){let h,m=l;for(;!p[m];)m-=1;try{h={node:await s.errors[l](),loader:s.errors[l],data:{},server:null,shared:null};const v=await Y({url:i,params:n.params,branch:p.slice(0,m+1).concat(h),status:500,error:a.error,route:s});n=v.state;const k=ae();N.$set(v.props),k();return}catch{continue}}}else if(a.type==="redirect")fe(a.location,{},[]);else{const i={form:a.data};a.status!==V.status&&(i.page={...V,status:a.status});const p=ae();N.$set(i),p()}},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",s=>{var m,v;let l=!1;const h={from:re("from",{params:n.params,routeId:(v=(m=n.route)==null?void 0:m.id)!=null?v:null,url:n.url}),to:null,type:"unload",cancel:()=>l=!0};d.before_navigate.forEach(k=>k(h)),l?(s.preventDefault(),s.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){ye(j);try{sessionStorage[Fe]=JSON.stringify(ee)}catch{}}});const a=s=>{const{url:l,options:h}=qe(s);if(l&&h.prefetch){if(Ae(l))return;Pe(l)}};let i;const p=s=>{clearTimeout(i),i=setTimeout(()=>{var l;(l=s.target)==null||l.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",a),addEventListener("mousemove",p),addEventListener("sveltekit:trigger_prefetch",a),addEventListener("click",s=>{if(s.button||s.which!==1||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||s.defaultPrevented)return;const{a:l,url:h,options:m}=qe(s);if(!l||!h)return;const v=l instanceof SVGAElement;if(!v&&!(h.protocol==="https:"||h.protocol==="http:"))return;const k=(l.getAttribute("rel")||"").split(/\s+/);if(l.hasAttribute("download")||k.includes("external")||m.reload||(v?l.target.baseVal:l.target))return;const[y,g]=h.href.split("#");if(g!==void 0&&y===location.href.split("#")[0]){q=!0,ye(j),n.url=h,G.page.set({...V,url:h}),G.page.notify();return}he({url:h,scroll:m.noscroll?ve():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:h.href===location.href},accepted:()=>s.preventDefault(),blocked:()=>s.preventDefault(),type:"link"})}),addEventListener("popstate",s=>{if(s.state){if(s.state[J]===j)return;const l=s.state[J]-j;he({url:new URL(location.href),scroll:ee[s.state[J]],keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{j=s.state[J]},blocked:()=>{history.go(-l)},type:"popstate",delta:l})}}),addEventListener("hashchange",()=>{q&&(q=!1,history.replaceState({...history.state,[J]:++j},"",location.href))});for(const s of document.querySelectorAll("link"))s.rel==="icon"&&(s.href=s.href);addEventListener("pageshow",s=>{s.persisted&&G.navigating.set(null)})},_hydrate:async({status:a,error:i,node_ids:p,params:s,routeId:l,data:h,form:m})=>{var y;const v=new URL(location.href);let k;try{const g=p.map(async(E,U)=>{const L=h[U];return ue({loader:ce[E],url:v,params:s,routeId:l,parent:async()=>{const I={};for(let A=0;A<U;A+=1)Object.assign(I,(await g[A]).data);return I},server_data_node:de(L)})});k=await Y({url:v,params:s,branch:await Promise.all(g),status:a,error:i,form:m,route:(y=ne.find(E=>E.id===l))!=null?y:null})}catch(g){const E=g;if(E instanceof Be){await Q(new URL(g.location,location.href));return}k=await te({status:E instanceof we?E.status:500,error:E,url:v,routeId:l})}je(k)}}}let At=1;async function Ke(r,e){const t=new URL(r);t.pathname=r.pathname.replace(/\/$/,"")+Ut,t.searchParams.set("__invalid",e.map(o=>o?"y":"n").join("")),t.searchParams.set("__id",String(At++)),await se(()=>import(t.href),[],import.meta.url);const c=window.__sveltekit_data;return delete window.__sveltekit_data,c}function xe(r,e){var t;return(t=jt.handleError({error:r,event:e}))!=null?t:{message:"Internal Error"}}const Nt=["hash","href","host","hostname","origin","pathname","port","protocol","search","searchParams","toString","toJSON"];function re(r,e){for(const t of Nt)Object.defineProperty(e,t,{get(){throw new Error(`The navigation shape changed - ${r}.${t} should now be ${r}.url.${t}`)}});return e}function ae(){return()=>{}}async function Ct({env:r,hydrate:e,paths:t,target:c,trailing_slash:o}){at(t);const d=It({target:c,base:t.base,trailing_slash:o});st({client:d}),e?await d._hydrate(e):d.goto(location.href,{replaceState:!0}),d._start_router()}export{Ct as start};
 
1
+ import{S as Ge,i as We,s as He,a as Me,e as z,c as Xe,b as W,g as ie,t as K,d as le,f as x,h as F,j as Ye,o as be,k as Qe,l as Ze,m as et,n as ge,p as C,q as tt,r as nt,u as rt,v as H,w as Se,x as M,y as X,z as De}from"./chunks/index-5559954d.js";import{g as Ce,f as qe,s as G,a as ve,b as at,i as st}from"./chunks/singletons-7373b018.js";const ot=function(){const e=document.createElement("link").relList;return e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}(),it=function(r,e){return new URL(r,e).href},Ve={},se=function(e,t,c){return!t||t.length===0?e():Promise.all(t.map(o=>{if(o=it(o,c),o in Ve)return;Ve[o]=!0;const d=o.endsWith(".css"),n=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${n}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":ot,d||(f.as="script",f.crossOrigin=""),f.href=o,document.head.appendChild(f),d)return new Promise((w,_)=>{f.addEventListener("load",w),f.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())};class we{constructor(e,t){this.status=e,typeof t=="string"?this.body={message:t}:t?this.body=t:this.body={message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}}class Be{constructor(e,t){this.status=e,this.location=t}}function lt(r,e){return r==="/"||e==="ignore"?r:e==="never"?r.endsWith("/")?r.slice(0,-1):r:e==="always"&&!r.endsWith("/")?r+"/":r}function ct(r){for(const e in r)r[e]=r[e].replace(/%23/g,"#").replace(/%3[Bb]/g,";").replace(/%2[Cc]/g,",").replace(/%2[Ff]/g,"/").replace(/%3[Ff]/g,"?").replace(/%3[Aa]/g,":").replace(/%40/g,"@").replace(/%26/g,"&").replace(/%3[Dd]/g,"=").replace(/%2[Bb]/g,"+").replace(/%24/g,"$");return r}const ft=["href","pathname","search","searchParams","toString","toJSON"];function ut(r,e){const t=new URL(r);for(const c of ft){let o=t[c];Object.defineProperty(t,c,{get(){return e(),o},enumerable:!0,configurable:!0})}return t[Symbol.for("nodejs.util.inspect.custom")]=(c,o,d)=>d(r,o),dt(t),t}function dt(r){Object.defineProperty(r,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}function pt(r){let e=5381,t=r.length;if(typeof r=="string")for(;t;)e=e*33^r.charCodeAt(--t);else for(;t;)e=e*33^r[--t];return(e>>>0).toString(36)}const Re=window.fetch;window.fetch=(r,e)=>{if((r instanceof Request?r.method:(e==null?void 0:e.method)||"GET")!=="GET"){const c=new URL(r instanceof Request?r.url:r.toString(),document.baseURI).href;oe.delete(c)}return Re(r,e)};const oe=new Map;function ht(r,e,t){let o=`script[data-sveltekit-fetched][data-url=${JSON.stringify(typeof r=="string"?r:r.url)}]`;t&&typeof t.body=="string"&&(o+=`[data-hash="${pt(t.body)}"]`);const d=document.querySelector(o);if(d!=null&&d.textContent){const{body:n,...f}=JSON.parse(d.textContent),w=d.getAttribute("data-ttl");return w&&oe.set(e,{body:n,init:f,ttl:1e3*Number(w)}),Promise.resolve(new Response(n,f))}return Re(r,t)}function mt(r,e){const t=oe.get(r);if(t){if(performance.now()<t.ttl)return new Response(t.body,t.init);oe.delete(r)}return Re(r,e)}const _t=/^(\.\.\.)?(\w+)(?:=(\w+))?$/;function gt(r){const e=[],t=[];let c=!0;return{pattern:r===""?/^\/$/:new RegExp(`^${r.split(/(?:\/|$)/).filter(wt).map((d,n,f)=>{const w=decodeURIComponent(d),_=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(w);if(_)return e.push(_[1]),t.push(_[2]),"(?:/(.*))?";const b=n===f.length-1;return w&&"/"+w.split(/\[(.+?)\]/).map(($,S)=>{if(S%2){const N=_t.exec($);if(!N)throw new Error(`Invalid param: ${$}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,j,T,q]=N;return e.push(T),t.push(q),j?"(.*?)":"([^/]+?)"}return b&&$.includes(".")&&(c=!1),$.normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}${c?"/?":""}$`),names:e,types:t}}function wt(r){return!/^\([^)]+\)$/.test(r)}function yt(r,e,t,c){const o={};for(let d=0;d<e.length;d+=1){const n=e[d],f=t[d],w=r[d+1]||"";if(f){const _=c[f];if(!_)throw new Error(`Missing "${f}" param matcher`);if(!_(w))return}o[n]=w}return o}function bt(r,e,t,c){const o=new Set(e);return Object.entries(t).map(([f,[w,_,b]])=>{const{pattern:$,names:S,types:N}=gt(f),j={id:f,exec:T=>{const q=$.exec(T);if(q)return yt(q,S,N,c)},errors:[1,...b||[]].map(T=>r[T]),layouts:[0,..._||[]].map(n),leaf:d(w)};return j.errors.length=j.layouts.length=Math.max(j.errors.length,j.layouts.length),j});function d(f){const w=f<0;return w&&(f=~f),[w,r[f]]}function n(f){return f===void 0?f:[o.has(f),r[f]]}}function vt(r){let e,t,c;var o=r[0][0];function d(n){return{props:{data:n[2],form:n[1]}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&4&&(w.data=n[2]),f&2&&(w.form=n[1]),o!==(o=n[0][0])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function kt(r){let e,t,c;var o=r[0][0];function d(n){return{props:{data:n[2],$$slots:{default:[Et]},$$scope:{ctx:n}}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&4&&(w.data=n[2]),f&523&&(w.$$scope={dirty:f,ctx:n}),o!==(o=n[0][0])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function Et(r){let e,t,c;var o=r[0][1];function d(n){return{props:{data:n[3],form:n[1]}}}return o&&(e=new o(d(r))),{c(){e&&H(e.$$.fragment),t=z()},l(n){e&&Se(e.$$.fragment,n),t=z()},m(n,f){e&&M(e,n,f),W(n,t,f),c=!0},p(n,f){const w={};if(f&8&&(w.data=n[3]),f&2&&(w.form=n[1]),o!==(o=n[0][1])){if(e){ie();const _=e;K(_.$$.fragment,1,0,()=>{X(_,1)}),le()}o?(e=new o(d(n)),H(e.$$.fragment),x(e.$$.fragment,1),M(e,t.parentNode,t)):e=null}else o&&e.$set(w)},i(n){c||(e&&x(e.$$.fragment,n),c=!0)},o(n){e&&K(e.$$.fragment,n),c=!1},d(n){n&&F(t),e&&X(e,n)}}}function Je(r){let e,t=r[5]&&ze(r);return{c(){e=Qe("div"),t&&t.c(),this.h()},l(c){e=Ze(c,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var o=et(e);t&&t.l(o),o.forEach(F),this.h()},h(){ge(e,"id","svelte-announcer"),ge(e,"aria-live","assertive"),ge(e,"aria-atomic","true"),C(e,"position","absolute"),C(e,"left","0"),C(e,"top","0"),C(e,"clip","rect(0 0 0 0)"),C(e,"clip-path","inset(50%)"),C(e,"overflow","hidden"),C(e,"white-space","nowrap"),C(e,"width","1px"),C(e,"height","1px")},m(c,o){W(c,e,o),t&&t.m(e,null)},p(c,o){c[5]?t?t.p(c,o):(t=ze(c),t.c(),t.m(e,null)):t&&(t.d(1),t=null)},d(c){c&&F(e),t&&t.d()}}}function ze(r){let e;return{c(){e=tt(r[6])},l(t){e=nt(t,r[6])},m(t,c){W(t,e,c)},p(t,c){c&64&&rt(e,t[6])},d(t){t&&F(e)}}}function St(r){let e,t,c,o,d;const n=[kt,vt],f=[];function w(b,$){return b[0][1]?0:1}e=w(r),t=f[e]=n[e](r);let _=r[4]&&Je(r);return{c(){t.c(),c=Me(),_&&_.c(),o=z()},l(b){t.l(b),c=Xe(b),_&&_.l(b),o=z()},m(b,$){f[e].m(b,$),W(b,c,$),_&&_.m(b,$),W(b,o,$),d=!0},p(b,[$]){let S=e;e=w(b),e===S?f[e].p(b,$):(ie(),K(f[S],1,1,()=>{f[S]=null}),le(),t=f[e],t?t.p(b,$):(t=f[e]=n[e](b),t.c()),x(t,1),t.m(c.parentNode,c)),b[4]?_?_.p(b,$):(_=Je(b),_.c(),_.m(o.parentNode,o)):_&&(_.d(1),_=null)},i(b){d||(x(t),d=!0)},o(b){K(t),d=!1},d(b){f[e].d(b),b&&F(c),_&&_.d(b),b&&F(o)}}}function Rt(r,e,t){let{stores:c}=e,{page:o}=e,{components:d}=e,{form:n}=e,{data_0:f=null}=e,{data_1:w=null}=e;Ye(c.page.notify);let _=!1,b=!1,$=null;return be(()=>{const S=c.page.subscribe(()=>{_&&(t(5,b=!0),t(6,$=document.title||"untitled page"))});return t(4,_=!0),S}),r.$$set=S=>{"stores"in S&&t(7,c=S.stores),"page"in S&&t(8,o=S.page),"components"in S&&t(0,d=S.components),"form"in S&&t(1,n=S.form),"data_0"in S&&t(2,f=S.data_0),"data_1"in S&&t(3,w=S.data_1)},r.$$.update=()=>{r.$$.dirty&384&&c.page.set(o)},[d,n,f,w,_,b,$,c,o]}class $t extends Ge{constructor(e){super(),We(this,e,Rt,St,He,{stores:7,page:8,components:0,form:1,data_0:2,data_1:3})}}const Lt={},ce=[()=>se(()=>import("./chunks/0-17a4fec1.js"),["chunks/0-17a4fec1.js","chunks/_layout-1daba58d.js","components/pages/_layout.svelte-55da5a4f.js","assets/_layout-e397cbf6.css","chunks/index-5559954d.js"],import.meta.url),()=>se(()=>import("./chunks/1-bf0cf391.js"),["chunks/1-bf0cf391.js","components/error.svelte-2d9a3f98.js","chunks/index-5559954d.js","chunks/singletons-7373b018.js","chunks/index-3bda1050.js"],import.meta.url),()=>se(()=>import("./chunks/2-3879e5a7.js"),["chunks/2-3879e5a7.js","components/pages/_page.svelte-c06cb3cf.js","assets/_page-fd1176fc.css","chunks/index-5559954d.js","chunks/index-3bda1050.js"],import.meta.url)],Pt=[],Ot={"":[2]},jt={handleError:({error:r})=>(console.error(r),{message:"Internal Error"})},Ut="/__data.js",Fe="sveltekit:scroll",J="sveltekit:index",ne=bt(ce,Pt,Ot,Lt),ke=ce[0],Ee=ce[1];ke();Ee();let ee={};try{ee=JSON.parse(sessionStorage[Fe])}catch{}function ye(r){ee[r]=ve()}function It({target:r,base:e,trailing_slash:t}){var Ne;const c=[],o={id:null,promise:null},d={before_navigate:[],after_navigate:[]};let n={branch:[],error:null,session_id:0,url:null},f=!1,w=!0,_=!1,b=1,$=null,S=!1,N,j=(Ne=history.state)==null?void 0:Ne[J];j||(j=Date.now(),history.replaceState({...history.state,[J]:j},"",location.href));const T=ee[j];T&&(history.scrollRestoration="manual",scrollTo(T.x,T.y));let q=!1,V,$e;function Le(){if(!$){const a=new URL(location.href);$=Promise.resolve().then(async()=>{const i=pe(a,!0);await Oe(i,a,[]),$=null,S=!1})}return $}async function fe(a,{noscroll:i=!1,replaceState:p=!1,keepfocus:s=!1,state:l={}},h){return typeof a=="string"&&(a=new URL(a,Ce(document))),he({url:a,scroll:i?ve():null,keepfocus:s,redirect_chain:h,details:{state:l,replaceState:p},accepted:()=>{},blocked:()=>{},type:"goto"})}async function Pe(a){const i=pe(a,!1);if(!i)throw new Error("Attempted to prefetch a URL that does not belong to this app");return o.promise=Ie(i),o.id=i.id,o.promise}async function Oe(a,i,p,s,l){var v,k;const h=$e={};let m=a&&await Ie(a);if(!m&&i.origin===location.origin&&i.pathname===location.pathname&&(m=await te({status:404,error:new Error(`Not found: ${i.pathname}`),url:i,routeId:null})),!m)return await Q(i),!1;if(i=(a==null?void 0:a.url)||i,$e!==h)return!1;if(c.length=0,m.type==="redirect")if(p.length>10||p.includes(i.pathname))m=await te({status:500,error:new Error("Redirect loop"),url:i,routeId:null});else return fe(new URL(m.location,i).href,{},[...p,i.pathname]),!1;else((k=(v=m.props)==null?void 0:v.page)==null?void 0:k.status)>=400&&await G.updated.check()&&await Q(i);if(_=!0,s&&s.details){const{details:y}=s,g=y.replaceState?0:1;y.state[J]=j+=g,history[y.replaceState?"replaceState":"pushState"](y.state,"",i)}if(f){n=m.state,m.props.page&&(m.props.page.url=i);const y=ae();N.$set(m.props),y()}else je(m);if(s){const{scroll:y,keepfocus:g}=s;if(!g){const E=document.body,U=E.getAttribute("tabindex");E.tabIndex=-1,E.focus({preventScroll:!0}),setTimeout(()=>{var L;(L=getSelection())==null||L.removeAllRanges()}),U!==null?E.setAttribute("tabindex",U):E.removeAttribute("tabindex")}if(await De(),w){const E=i.hash&&document.getElementById(i.hash.slice(1));y?scrollTo(y.x,y.y):E?E.scrollIntoView():scrollTo(0,0)}}else await De();o.promise=null,o.id=null,w=!0,m.props.page&&(V=m.props.page),l&&l(),_=!1}function je(a){var l,h;n=a.state;const i=document.querySelector("style[data-sveltekit]");i&&i.remove(),V=a.props.page;const p=ae();N=new $t({target:r,props:{...a.props,stores:G},hydrate:!0}),p();const s={from:null,to:re("to",{params:n.params,routeId:(h=(l=n.route)==null?void 0:l.id)!=null?h:null,url:new URL(location.href)}),type:"load"};d.after_navigate.forEach(m=>m(s)),f=!0}async function Y({url:a,params:i,branch:p,status:s,error:l,route:h,form:m}){var U;const v=p.filter(Boolean),k={type:"loaded",state:{url:a,params:i,branch:p,error:l,route:h,session_id:b},props:{components:v.map(L=>L.node.component)}};m!==void 0&&(k.props.form=m);let y={},g=!V;for(let L=0;L<v.length;L+=1){const I=v[L];y={...y,...I.data},(g||!n.branch.some(A=>A===I))&&(k.props[`data_${L}`]=y,g=g||Object.keys((U=I.data)!=null?U:{}).length>0)}if(g||(g=Object.keys(V.data).length!==Object.keys(y).length),!n.url||a.href!==n.url.href||n.error!==l||g){k.props.page={error:l,params:i,routeId:h&&h.id,status:s,url:a,data:g?y:V.data};const L=(I,A)=>{Object.defineProperty(k.props.page,I,{get:()=>{throw new Error(`$page.${I} has been replaced by $page.url.${A}`)}})};L("origin","origin"),L("path","pathname"),L("query","searchParams")}return k}async function ue({loader:a,parent:i,url:p,params:s,routeId:l,server_data_node:h}){var y,g,E,U,L;let m=null;const v={dependencies:new Set,params:new Set,parent:!1,url:!1},k=await a();if((y=k.shared)!=null&&y.load){let I=function(...u){for(const R of u){const{href:O}=new URL(R,p);v.dependencies.add(O)}};const A={};for(const u in s)Object.defineProperty(A,u,{get(){return v.params.add(u),s[u]},enumerable:!0});const B={routeId:l,params:A,data:(g=h==null?void 0:h.data)!=null?g:null,url:ut(p,()=>{v.url=!0}),async fetch(u,R){let O;typeof u=="string"?O=u:(O=u.url,R={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:u.headers,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...R});const P=new URL(O,p).href;return I(P),f?mt(P,R):ht(O,P,R)},setHeaders:()=>{},depends:I,parent(){return v.parent=!0,i()}};Object.defineProperties(B,{props:{get(){throw new Error("@migration task: Replace `props` with `data` stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1},session:{get(){throw new Error("session is no longer available. See https://github.com/sveltejs/kit/discussions/5883")},enumerable:!1},stuff:{get(){throw new Error("@migration task: Remove stuff https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693")},enumerable:!1}}),m=(E=await k.shared.load.call(null,B))!=null?E:null}return{node:k,loader:a,server:h,shared:(U=k.shared)!=null&&U.load?{type:"data",data:m,uses:v}:null,data:(L=m!=null?m:h==null?void 0:h.data)!=null?L:null}}function Ue(a,i,p){if(S)return!0;if(!p)return!1;if(p.parent&&i||a.url&&p.url)return!0;for(const s of a.params)if(p.params.has(s))return!0;for(const s of p.dependencies)if(c.some(l=>l(new URL(s))))return!0;return!1}function de(a,i){var p,s;return(a==null?void 0:a.type)==="data"?{type:"data",data:a.data,uses:{dependencies:new Set((p=a.uses.dependencies)!=null?p:[]),params:new Set((s=a.uses.params)!=null?s:[]),parent:!!a.uses.parent,url:!!a.uses.url}}:(a==null?void 0:a.type)==="skip"&&i!=null?i:null}async function Ie({id:a,invalidating:i,url:p,params:s,route:l}){var B;if(o.id===a&&o.promise)return o.promise;const{errors:h,layouts:m,leaf:v}=l,k=n.url&&{url:a!==n.url.pathname+n.url.search,params:Object.keys(s).filter(u=>n.params[u]!==s[u])},y=[...m,v];h.forEach(u=>u==null?void 0:u().catch(()=>{})),y.forEach(u=>u==null?void 0:u[1]().catch(()=>{}));let g=null;const E=y.reduce((u,R,O)=>{var D;const P=n.branch[O],Z=!!(R!=null&&R[0])&&((P==null?void 0:P.loader)!==R[1]||Ue(k,u.some(Boolean),(D=P.server)==null?void 0:D.uses));return u.push(Z),u},[]);if(E.some(Boolean)){try{g=await Ke(p,E)}catch(u){return te({status:500,error:u,url:p,routeId:l.id})}if(g.type==="redirect")return g}const U=g==null?void 0:g.nodes;let L=!1;const I=y.map(async(u,R)=>{var D;if(!u)return;const O=n.branch[R],P=U==null?void 0:U[R];if((!P||P.type==="skip")&&u[1]===(O==null?void 0:O.loader)&&!Ue(k,L,(D=O.shared)==null?void 0:D.uses))return O;if(L=!0,(P==null?void 0:P.type)==="error")throw P;return ue({loader:u[1],url:p,params:s,routeId:l.id,parent:async()=>{var Te;const me={};for(let _e=0;_e<R;_e+=1)Object.assign(me,(Te=await I[_e])==null?void 0:Te.data);return me},server_data_node:de(P===void 0&&u[0]?{type:"skip"}:P!=null?P:null,O==null?void 0:O.server)})});for(const u of I)u.catch(()=>{});const A=[];for(let u=0;u<y.length;u+=1)if(y[u])try{A.push(await I[u])}catch(R){if(R instanceof Be)return{type:"redirect",location:R.location};let O=500,P;for(U!=null&&U.includes(R)?(O=(B=R.status)!=null?B:O,P=R.error):R instanceof we?(O=R.status,P=R.body):P=xe(R,{params:s,url:p,routeId:l.id});u--;)if(h[u]){let Z,D=u;for(;!A[D];)D-=1;try{return Z={node:await h[u](),loader:h[u],data:{},server:null,shared:null},await Y({url:p,params:s,branch:A.slice(0,D+1).concat(Z),status:O,error:P,route:l})}catch{continue}}await Q(p);return}else A.push(void 0);return await Y({url:p,params:s,branch:A,status:200,error:null,route:l,form:i?void 0:null})}async function te({status:a,error:i,url:p,routeId:s}){var y;const l={},h=await ke();let m=null;if(h.server)try{const g=await Ke(p,[!0]);if(g.type!=="data"||g.nodes[0]&&g.nodes[0].type!=="data")throw 0;m=(y=g.nodes[0])!=null?y:null}catch{await Q(p);return}const v=await ue({loader:ke,url:p,params:l,routeId:s,parent:()=>Promise.resolve({}),server_data_node:de(m)}),k={node:await Ee(),loader:Ee,shared:null,server:null,data:null};return await Y({url:p,params:l,branch:[v,k],status:a,error:i instanceof we?i.body:xe(i,{url:p,params:l,routeId:null}),route:null})}function pe(a,i){if(Ae(a))return;const p=decodeURI(a.pathname.slice(e.length)||"/");for(const s of ne){const l=s.exec(p);if(l){const h=new URL(a.origin+lt(a.pathname,t)+a.search+a.hash);return{id:h.pathname+h.search,invalidating:i,route:s,params:ct(l),url:h}}}}function Ae(a){return a.origin!==location.origin||!a.pathname.startsWith(e)}async function he({url:a,scroll:i,keepfocus:p,redirect_chain:s,details:l,type:h,delta:m,accepted:v,blocked:k}){var L,I,A,B;let y=!1;const g=pe(a,!1),E={from:re("from",{params:n.params,routeId:(I=(L=n.route)==null?void 0:L.id)!=null?I:null,url:n.url}),to:re("to",{params:(A=g==null?void 0:g.params)!=null?A:null,routeId:(B=g==null?void 0:g.route.id)!=null?B:null,url:a}),type:h};m!==void 0&&(E.delta=m);const U={...E,cancel:()=>{y=!0}};if(d.before_navigate.forEach(u=>u(U)),y){k();return}ye(j),v(),f&&G.navigating.set(E),await Oe(g,a,s,{scroll:i,keepfocus:p,details:l},()=>{d.after_navigate.forEach(u=>u(E)),G.navigating.set(null)})}function Q(a){return location.href=a.href,new Promise(()=>{})}return{after_navigate:a=>{be(()=>(d.after_navigate.push(a),()=>{const i=d.after_navigate.indexOf(a);d.after_navigate.splice(i,1)}))},before_navigate:a=>{be(()=>(d.before_navigate.push(a),()=>{const i=d.before_navigate.indexOf(a);d.before_navigate.splice(i,1)}))},disable_scroll_handling:()=>{(_||!f)&&(w=!1)},goto:(a,i={})=>fe(a,i,[]),invalidate:a=>{if(a===void 0)throw new Error("`invalidate()` (with no arguments) has been replaced by `invalidateAll()`");if(typeof a=="function")c.push(a);else{const{href:i}=new URL(a,location.href);c.push(p=>p.href===i)}return Le()},invalidateAll:()=>(S=!0,Le()),prefetch:async a=>{const i=new URL(a,Ce(document));await Pe(i)},prefetch_routes:async a=>{const p=(a?ne.filter(s=>a.some(l=>s.exec(l))):ne).map(s=>Promise.all([...s.layouts,s.leaf].map(l=>l==null?void 0:l[1]())));await Promise.all(p)},apply_action:async a=>{if(a.type==="error"){const i=new URL(location.href),{branch:p,route:s}=n;if(!s)return;let l=n.branch.length;for(;l--;)if(s.errors[l]){let h,m=l;for(;!p[m];)m-=1;try{h={node:await s.errors[l](),loader:s.errors[l],data:{},server:null,shared:null};const v=await Y({url:i,params:n.params,branch:p.slice(0,m+1).concat(h),status:500,error:a.error,route:s});n=v.state;const k=ae();N.$set(v.props),k();return}catch{continue}}}else if(a.type==="redirect")fe(a.location,{},[]);else{const i={form:a.data};a.status!==V.status&&(i.page={...V,status:a.status});const p=ae();N.$set(i),p()}},_start_router:()=>{history.scrollRestoration="manual",addEventListener("beforeunload",s=>{var m,v;let l=!1;const h={from:re("from",{params:n.params,routeId:(v=(m=n.route)==null?void 0:m.id)!=null?v:null,url:n.url}),to:null,type:"unload",cancel:()=>l=!0};d.before_navigate.forEach(k=>k(h)),l?(s.preventDefault(),s.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"){ye(j);try{sessionStorage[Fe]=JSON.stringify(ee)}catch{}}});const a=s=>{const{url:l,options:h}=qe(s);if(l&&h.prefetch){if(Ae(l))return;Pe(l)}};let i;const p=s=>{clearTimeout(i),i=setTimeout(()=>{var l;(l=s.target)==null||l.dispatchEvent(new CustomEvent("sveltekit:trigger_prefetch",{bubbles:!0}))},20)};addEventListener("touchstart",a),addEventListener("mousemove",p),addEventListener("sveltekit:trigger_prefetch",a),addEventListener("click",s=>{if(s.button||s.which!==1||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||s.defaultPrevented)return;const{a:l,url:h,options:m}=qe(s);if(!l||!h)return;const v=l instanceof SVGAElement;if(!v&&!(h.protocol==="https:"||h.protocol==="http:"))return;const k=(l.getAttribute("rel")||"").split(/\s+/);if(l.hasAttribute("download")||k.includes("external")||m.reload||(v?l.target.baseVal:l.target))return;const[y,g]=h.href.split("#");if(g!==void 0&&y===location.href.split("#")[0]){q=!0,ye(j),n.url=h,G.page.set({...V,url:h}),G.page.notify();return}he({url:h,scroll:m.noscroll?ve():null,keepfocus:!1,redirect_chain:[],details:{state:{},replaceState:h.href===location.href},accepted:()=>s.preventDefault(),blocked:()=>s.preventDefault(),type:"link"})}),addEventListener("popstate",s=>{if(s.state){if(s.state[J]===j)return;const l=s.state[J]-j;he({url:new URL(location.href),scroll:ee[s.state[J]],keepfocus:!1,redirect_chain:[],details:null,accepted:()=>{j=s.state[J]},blocked:()=>{history.go(-l)},type:"popstate",delta:l})}}),addEventListener("hashchange",()=>{q&&(q=!1,history.replaceState({...history.state,[J]:++j},"",location.href))});for(const s of document.querySelectorAll("link"))s.rel==="icon"&&(s.href=s.href);addEventListener("pageshow",s=>{s.persisted&&G.navigating.set(null)})},_hydrate:async({status:a,error:i,node_ids:p,params:s,routeId:l,data:h,form:m})=>{var y;const v=new URL(location.href);let k;try{const g=p.map(async(E,U)=>{const L=h[U];return ue({loader:ce[E],url:v,params:s,routeId:l,parent:async()=>{const I={};for(let A=0;A<U;A+=1)Object.assign(I,(await g[A]).data);return I},server_data_node:de(L)})});k=await Y({url:v,params:s,branch:await Promise.all(g),status:a,error:i,form:m,route:(y=ne.find(E=>E.id===l))!=null?y:null})}catch(g){const E=g;if(E instanceof Be){await Q(new URL(g.location,location.href));return}k=await te({status:E instanceof we?E.status:500,error:E,url:v,routeId:l})}je(k)}}}let At=1;async function Ke(r,e){const t=new URL(r);t.pathname=r.pathname.replace(/\/$/,"")+Ut,t.searchParams.set("__invalid",e.map(o=>o?"y":"n").join("")),t.searchParams.set("__id",String(At++)),await se(()=>import(t.href),[],import.meta.url);const c=window.__sveltekit_data;return delete window.__sveltekit_data,c}function xe(r,e){var t;return(t=jt.handleError({error:r,event:e}))!=null?t:{message:"Internal Error"}}const Nt=["hash","href","host","hostname","origin","pathname","port","protocol","search","searchParams","toString","toJSON"];function re(r,e){for(const t of Nt)Object.defineProperty(e,t,{get(){throw new Error(`The navigation shape changed - ${r}.${t} should now be ${r}.url.${t}`)}});return e}function ae(){return()=>{}}async function Ct({env:r,hydrate:e,paths:t,target:c,trailing_slash:o}){at(t);const d=It({target:c,base:t.base,trailing_slash:o});st({client:d}),e?await d._hydrate(e):d.goto(location.href,{replaceState:!0}),d._start_router()}export{Ct as start};
static/_app/version.json CHANGED
@@ -1 +1 @@
1
- {"version":"1664554625991"}
 
1
+ {"version":"1666720222473"}
static/index.html CHANGED
@@ -2,20 +2,20 @@
2
  <html lang="en">
3
  <head>
4
  <meta charset="utf-8" />
5
- <link rel="icon" href="/embed/huggingface-projects/color-palette-generator-sd/static/favicon.png" />
6
  <meta name="viewport" content="width=device-width" />
7
  <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
8
  <meta http-equiv="content-security-policy" content="">
9
- <link href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/assets/_layout-e397cbf6.css" rel="stylesheet">
10
- <link href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/assets/_page-fd1176fc.css" rel="stylesheet">
11
- <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/start-db90f0a0.js">
12
- <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/index-5559954d.js">
13
- <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/singletons-9542ead4.js">
14
- <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/index-3bda1050.js">
15
- <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/components/pages/_layout.svelte-55da5a4f.js">
16
- <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/modules/pages/_layout.ts-b8ee4d7c.js">
17
- <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/chunks/_layout-1daba58d.js">
18
- <link rel="modulepreload" href="/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/components/pages/_page.svelte-ea2cf9bd.js">
19
  </head>
20
  <body class="dark:bg-[rgb(11,15,25)] bg-white dark:text-white text-black">
21
  <div>
@@ -45,7 +45,7 @@
45
 
46
 
47
  <script type="module" data-sveltekit-hydrate="9rn8b6">
48
- import { start } from "/embed/huggingface-projects/color-palette-generator-sd/static/_app/immutable/start-db90f0a0.js";
49
 
50
  start({
51
  env: {"PUBLIC_DEV_MODE":"PROD","PUBLIC_WS_ENDPOINT":"wss://spaces.huggingface.tech/stabilityai/stable-diffusion/queue/join"},
@@ -58,7 +58,7 @@
58
  data: (function(a){return [a,a]}(null)),
59
  form: null
60
  },
61
- paths: {"base":"/embed/huggingface-projects/color-palette-generator-sd/static","assets":"/embed/huggingface-projects/color-palette-generator-sd/static"},
62
  target: document.querySelector('[data-sveltekit-hydrate="9rn8b6"]').parentNode,
63
  trailing_slash: "never"
64
  });
 
2
  <html lang="en">
3
  <head>
4
  <meta charset="utf-8" />
5
+ <link rel="icon" href="/static/favicon.png" />
6
  <meta name="viewport" content="width=device-width" />
7
  <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
8
  <meta http-equiv="content-security-policy" content="">
9
+ <link href="/static/_app/immutable/assets/_layout-e397cbf6.css" rel="stylesheet">
10
+ <link href="/static/_app/immutable/assets/_page-fd1176fc.css" rel="stylesheet">
11
+ <link rel="modulepreload" href="/static/_app/immutable/start-59f72f27.js">
12
+ <link rel="modulepreload" href="/static/_app/immutable/chunks/index-5559954d.js">
13
+ <link rel="modulepreload" href="/static/_app/immutable/chunks/singletons-7373b018.js">
14
+ <link rel="modulepreload" href="/static/_app/immutable/chunks/index-3bda1050.js">
15
+ <link rel="modulepreload" href="/static/_app/immutable/components/pages/_layout.svelte-55da5a4f.js">
16
+ <link rel="modulepreload" href="/static/_app/immutable/modules/pages/_layout.ts-b8ee4d7c.js">
17
+ <link rel="modulepreload" href="/static/_app/immutable/chunks/_layout-1daba58d.js">
18
+ <link rel="modulepreload" href="/static/_app/immutable/components/pages/_page.svelte-c06cb3cf.js">
19
  </head>
20
  <body class="dark:bg-[rgb(11,15,25)] bg-white dark:text-white text-black">
21
  <div>
 
45
 
46
 
47
  <script type="module" data-sveltekit-hydrate="9rn8b6">
48
+ import { start } from "/static/_app/immutable/start-59f72f27.js";
49
 
50
  start({
51
  env: {"PUBLIC_DEV_MODE":"PROD","PUBLIC_WS_ENDPOINT":"wss://spaces.huggingface.tech/stabilityai/stable-diffusion/queue/join"},
 
58
  data: (function(a){return [a,a]}(null)),
59
  form: null
60
  },
61
+ paths: {"base":"/static","assets":"/static"},
62
  target: document.querySelector('[data-sveltekit-hydrate="9rn8b6"]').parentNode,
63
  trailing_slash: "never"
64
  });
static/vite-manifest.json CHANGED
@@ -1,11 +1,11 @@
1
  {
2
  "node_modules/@sveltejs/kit/src/runtime/client/start.js": {
3
- "file": "_app/immutable/start-db90f0a0.js",
4
  "src": "node_modules/@sveltejs/kit/src/runtime/client/start.js",
5
  "isEntry": true,
6
  "imports": [
7
  "_index-5559954d.js",
8
- "_singletons-9542ead4.js"
9
  ],
10
  "dynamicImports": [
11
  ".svelte-kit/generated/nodes/0.js",
@@ -25,16 +25,16 @@
25
  ]
26
  },
27
  "node_modules/@sveltejs/kit/src/runtime/components/error.svelte": {
28
- "file": "_app/immutable/components/error.svelte-f5e989b0.js",
29
  "src": "node_modules/@sveltejs/kit/src/runtime/components/error.svelte",
30
  "isEntry": true,
31
  "imports": [
32
  "_index-5559954d.js",
33
- "_singletons-9542ead4.js"
34
  ]
35
  },
36
  "src/routes/+page.svelte": {
37
- "file": "_app/immutable/components/pages/_page.svelte-ea2cf9bd.js",
38
  "src": "src/routes/+page.svelte",
39
  "isEntry": true,
40
  "imports": [
@@ -53,8 +53,8 @@
53
  "__layout-1daba58d.js"
54
  ]
55
  },
56
- "_singletons-9542ead4.js": {
57
- "file": "_app/immutable/chunks/singletons-9542ead4.js",
58
  "imports": [
59
  "_index-3bda1050.js"
60
  ]
@@ -81,7 +81,7 @@
81
  ]
82
  },
83
  ".svelte-kit/generated/nodes/1.js": {
84
- "file": "_app/immutable/chunks/1-e583b0d4.js",
85
  "src": ".svelte-kit/generated/nodes/1.js",
86
  "isDynamicEntry": true,
87
  "imports": [
@@ -89,7 +89,7 @@
89
  ]
90
  },
91
  ".svelte-kit/generated/nodes/2.js": {
92
- "file": "_app/immutable/chunks/2-ca93f0c9.js",
93
  "src": ".svelte-kit/generated/nodes/2.js",
94
  "isDynamicEntry": true,
95
  "imports": [
 
1
  {
2
  "node_modules/@sveltejs/kit/src/runtime/client/start.js": {
3
+ "file": "_app/immutable/start-59f72f27.js",
4
  "src": "node_modules/@sveltejs/kit/src/runtime/client/start.js",
5
  "isEntry": true,
6
  "imports": [
7
  "_index-5559954d.js",
8
+ "_singletons-7373b018.js"
9
  ],
10
  "dynamicImports": [
11
  ".svelte-kit/generated/nodes/0.js",
 
25
  ]
26
  },
27
  "node_modules/@sveltejs/kit/src/runtime/components/error.svelte": {
28
+ "file": "_app/immutable/components/error.svelte-2d9a3f98.js",
29
  "src": "node_modules/@sveltejs/kit/src/runtime/components/error.svelte",
30
  "isEntry": true,
31
  "imports": [
32
  "_index-5559954d.js",
33
+ "_singletons-7373b018.js"
34
  ]
35
  },
36
  "src/routes/+page.svelte": {
37
+ "file": "_app/immutable/components/pages/_page.svelte-c06cb3cf.js",
38
  "src": "src/routes/+page.svelte",
39
  "isEntry": true,
40
  "imports": [
 
53
  "__layout-1daba58d.js"
54
  ]
55
  },
56
+ "_singletons-7373b018.js": {
57
+ "file": "_app/immutable/chunks/singletons-7373b018.js",
58
  "imports": [
59
  "_index-3bda1050.js"
60
  ]
 
81
  ]
82
  },
83
  ".svelte-kit/generated/nodes/1.js": {
84
+ "file": "_app/immutable/chunks/1-bf0cf391.js",
85
  "src": ".svelte-kit/generated/nodes/1.js",
86
  "isDynamicEntry": true,
87
  "imports": [
 
89
  ]
90
  },
91
  ".svelte-kit/generated/nodes/2.js": {
92
+ "file": "_app/immutable/chunks/2-3879e5a7.js",
93
  "src": ".svelte-kit/generated/nodes/2.js",
94
  "isDynamicEntry": true,
95
  "imports": [