PageSourceSearch

https://lora.nudemuse.online/assets/analyticsReconstruction-BN-Op2-R.js

js nudemuse.online collected 2026-10-08 10:21:41 UTC 192,481 bytes, 116 lines download raw bytes

1import{c as ee,b as l,j as t,C as Rt,L as Ln,aj as Hr,D as bs,F as ys,t as ne,G as On,aH as In,aI as Mn,aJ as Dn,M as ve,I as lr,X as We,S as He,aK as $n,K as vs,R as ws,e as Wr,aL as Fn,aM as ks,aN as Un,aO as zn,E as $t,a5 as Bn,a4 as Hn,aP as Wn,am as qn,aQ as Vn,A as Kn,a8 as Zt,aR as Gn,aS as qr,aT as Yn,aU as Xn,u as Vr,aV as Zn,ac as Tt,a3 as cr,aW as Jn,v as Qn,aX as ea,aY as js,aZ as ta,d as ra,ab as Ns,a_ as sa,a$ as Kr,b0 as na}from"./index-B5gfQUrt.js";/**
2 * @license lucide-react v0.487.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const aa=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],Cs=ee("badge-dollar-sign",aa);/**
7 * @license lucide-react v0.487.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const oa=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ia=ee("chevron-left",oa);/**
12 * @license lucide-react v0.487.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const la=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ca=ee("chevron-up",la);/**
17 * @license lucide-react v0.487.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const da=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],st=ee("download",da);/**
22 * @license lucide-react v0.487.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const ua=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],yr=ee("file-text",ua);/**
27 * @license lucide-react v0.487.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */const ma=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]],fa=ee("folder-up",ma);/**
32 * @license lucide-react v0.487.0 - ISC
33 *
34 * This source code is licensed under the ISC license.
35 * See the LICENSE file in the root directory of this source tree.
36 */const pa=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],ha=ee("gift",pa);/**
37 * @license lucide-react v0.487.0 - ISC
38 *
39 * This source code is licensed under the ISC license.
40 * See the LICENSE file in the root directory of this source tree.
41 */const xa=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],ga=ee("house",xa);/**
42 * @license lucide-react v0.487.0 - ISC
43 *
44 * This source code is licensed under the ISC license.
45 * See the LICENSE file in the root directory of this source tree.
46 */const ba=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],ya=ee("image-plus",ba);/**
47 * @license lucide-react v0.487.0 - ISC
48 *
49 * This source code is licensed under the ISC license.
50 * See the LICENSE file in the root directory of this source tree.
51 */const va=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],wa=ee("list-checks",va);/**
52 * @license lucide-react v0.487.0 - ISC
53 *
54 * This source code is licensed under the ISC license.
55 * See the LICENSE file in the root directory of this source tree.
56 */const ka=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],ja=ee("list",ka);/**
57 * @license lucide-react v0.487.0 - ISC
58 *
59 * This source code is licensed under the ISC license.
60 * See the LICENSE file in the root directory of this source tree.
61 */const Na=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],Ca=ee("lock-keyhole",Na);/**
62 * @license lucide-react v0.487.0 - ISC
63 *
64 * This source code is licensed under the ISC license.
65 * See the LICENSE file in the root directory of this source tree.
66 */const Sa=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],Pa=ee("mail",Sa);/**
67 * @license lucide-react v0.487.0 - ISC
68 *
69 * This source code is licensed under the ISC license.
70 * See the LICENSE file in the root directory of this source tree.
71 */const Ea=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],dr=ee("maximize-2",Ea);/**
72 * @license lucide-react v0.487.0 - ISC
73 *
74 * This source code is licensed under the ISC license.
75 * See the LICENSE file in the root directory of this source tree.
76 */const Aa=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],jt=ee("message-square",Aa);/**
77 * @license lucide-react v0.487.0 - ISC
78 *
79 * This source code is licensed under the ISC license.
80 * See the LICENSE file in the root directory of this source tree.
81 */const _a=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],Ra=ee("palette",_a);/**
82 * @license lucide-react v0.487.0 - ISC
83 *
84 * This source code is licensed under the ISC license.
85 * See the LICENSE file in the root directory of this source tree.
86 */const Ta=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],La=ee("send",Ta);/**
87 * @license lucide-react v0.487.0 - ISC
88 *
89 * This source code is licensed under the ISC license.
90 * See the LICENSE file in the root directory of this source tree.
91 */const Oa=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
91y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],ur=ee("shield-alert",Oa);/**
92 * @license lucide-react v0.487.0 - ISC
93 *
94 * This source code is licensed under the ISC license.
95 * See the LICENSE file in the root directory of this source tree.
96 */const Ia=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],ht=ee("sparkles",Ia);/**
97 * @license lucide-react v0.487.0 - ISC
98 *
99 * This source code is licensed under the ISC license.
100 * See the LICENSE file in the root directory of this source tree.
101 */const Ma=[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]],Da=ee("store",Ma);/**
102 * @license lucide-react v0.487.0 - ISC
103 *
104 * This source code is licensed under the ISC license.
105 * See the LICENSE file in the root directory of this source tree.
106 */const $a=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Fa=ee("tag",$a);/**
107 * @license lucide-react v0.487.0 - ISC
108 *
109 * This source code is licensed under the ISC license.
110 * See the LICENSE file in the root directory of this source tree.
111 */const Ua=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],Jt=ee("upload",Ua);/**
112 * @license lucide-react v0.487.0 - ISC
113 *
114 * This source code is licensed under the ISC license.
115 * See the LICENSE file in the root directory of this source tree.
116 */const za=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Ba=ee("user-round",za),Ha=["Illustrious","Pony","Anima","Krea2"],Wa={pony:0,illustrious:1,anima:2,krea2:3};function Xl(e){return Wa[String(e||"").trim().toLowerCase()]??4}function Zl(e){switch(String(e||"").trim().toLowerCase()){case"illustrious":return"bg-pink-100 text-pink-700 border-pink-200";case"pony":return"bg-amber-100 text-amber-700 border-amber-200";case"anima":return"bg-cyan-100 text-cyan-700 border-cyan-200";case"krea2":return"bg-violet-100 text-violet-700 border-violet-200";default:return"bg-gray-100 text-gray-700 border-gray-200"}}function qe(e){return e?String(e).replace(/_/g," ").replace(/\s+/g," ").trim():""}function Jl(e){return e?String(e).replace(/_/g," "):""}const Ss={USD:"US Dollar",EUR:"Euro",GBP:"British Pound",CAD:"Canadian Dollar",AUD:"Australian Dollar",CHF:"Swiss Franc",NZD:"New Zealand Dollar",SGD:"Singapore Dollar",HKD:"Hong Kong Dollar",SEK:"Swedish Krona",NOK:"Norwegian Krone",DKK:"Danish Krone",PLN:"Polish Zloty",CZK:"Czech Koruna",MXN:"Mexican Peso",BRL:"Brazilian Real",PHP:"Philippine Peso",MYR:"Malaysian Ringgit",THB:"Thai Baht",ILS:"Israeli New Shekel",ZAR:"South African Rand"};function Gr(e){const r=String(e||"").trim().toUpperCase();return r?`${r} - ${Ss[r]||r}`:""}function qa({id:e,value:r,allowedCurrencies:s,onChange:n,disabled:o=!1}){const i=s.length?s:["USD"],a=String(r||i[0]||"USD").trim().toUpperCase(),[d,c]=l.useState(!1),[f,m]=l.useState(""),x=l.useRef(null),h=l.useMemo(()=>{const p=f.trim().toLowerCase();return p?i.filter(g=>Gr(g).toLowerCase().includes(p)):i},[i,f]),u=p=>{n(p),m(""),c(!1)};return t.jsxs("div",{className:"relative mt-2",onBlur:()=>{x.current&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>{c(!1),m("")},120)},onFocus:()=>{x.current&&window.clearTimeout(x.current)},children:[t.jsxs("button",{id:e,type:"button",disabled:o,"aria-haspopup":"listbox","aria-expanded":d,onClick:()=>!o&&c(p=>!p),className:"flex h-11 w-full items-center justify-between gap-3 rounded-md border border-slate-300 bg-white px-3 text-left text-sm font-semibold text-slate-950 outline-none transition hover:border-slate-400 focus:border-emerald-500 focus:ring-2 focus:ring-emerald-400/20 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:text-slate-500 dark:border-slate-700 dark:bg-slate-950 dar
116k:text-white dark:hover:border-slate-500 dark:disabled:bg-slate-950/70",children:[t.jsx("span",{className:"min-w-0 truncate",children:Gr(a)}),t.jsx(Rt,{className:"shrink-0 text-slate-400",size:17})]}),d&&!o&&t.jsxs("div",{className:"absolute left-0 right-0 top-12 z-40 rounded-lg border border-slate-200 bg-white p-2 shadow-xl shadow-slate-900/15 dark:border-slate-700 dark:bg-slate-950 dark:shadow-black/40",children:[t.jsxs("div",{className:"relative",children:[t.jsx(Ln,{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:16}),t.jsx("input",{value:f,onChange:p=>m(p.target.value),onKeyDown:p=>{p.key==="Escape"&&(c(!1),m("")),p.key==="Enter"&&h[0]&&(p.preventDefault(),u(h[0]))},placeholder:"Search currency",autoFocus:!0,className:"h-10 w-full rounded-md border border-slate-300 bg-white pl-9 pr-3 text-sm text-slate-950 outline-none focus:border-emerald-500 dark:border-slate-700 dark:bg-slate-900 dark:text-white"})]}),t.jsx("div",{role:"listbox","aria-labelledby":e,className:"mt-2 max-h-72 overflow-y-auto rounded-md border border-slate-100 bg-slate-50 p-1 dark:border-slate-800 dark:bg-slate-900/70",children:h.length?h.map(p=>t.jsxs("button",{type:"button",role:"option","aria-selected":p===a,onMouseDown:g=>g.preventDefault(),onClick:()=>u(p),className:`flex min-h-10 w-full items-center justify-between gap-3 rounded px-2.5 py-2 text-left text-sm transition ${p===a?"bg-emerald-100 font-bold text-emerald-900 dark:bg-emerald-500/20 dark:text-emerald-100":"text-slate-700 hover:bg-white dark:text-slate-200 dark:hover:bg-slate-800"}`,children:[t.jsx("span",{className:"min-w-0 truncate",children:Ss[p]||p}),t.jsx("span",{className:"shrink-0 font-bold",children:p})]},p)):t.jsx("div",{className:"px-3 py-4 text-center text-sm text-slate-500 dark:text-slate-400",children:"No matching currency"})})]})]})}function vr(){const[e,r]=l.useState(0);return l.useEffect(()=>{const s=()=>r(n=>n+1);return window.addEventListener(Hr,s),()=>window.removeEventListener(Hr,s)},[]),e}function wr(e,r){try{const s=window.sessionStorage.getItem(e);if(!s)return r;const n=JSON.parse(s);return n&&typeof n=="object"?{...r,...n}:r}catch{return r}}function kr(e,r){try{window.sessionStorage.setItem(e,JSON.stringify(r))}catch{}}function Lt(e){try{window.sessionStorage.removeItem(e)}catch{}}const Va={paypal_lora:{title:"PayPal LoRA Commission Checkout",subtitle:"Use this page to place a LoRA commission directly through PayPal.",priceLabel:"$15"},paypal_imageset:{title:"PayPal Image-Set Commission Checkout",subtitle:"Use this page to place an image-set commission directly through PayPal."},paypal_lora_reduced:{title:"Reduced LoRA Commission",subtitle:"Confirm the commission details, choose add-ons, then complete payment through PayPal.",priceLabel:"$10"}},Yr="AVsoRXscBTeOmPN6rjNuZCT0UTeeOQWeW2v-bEbkZ3PMefuRDedJdsTBTv71HSkgWZFZSTCun5VZViIb".trim(),Ps=["Discord","Civitai","X / Twitter","Email","Pixiv","SubscribeStar","Fiverr","Rule34","Boosty"],Xr=50,Ka=300*1024*1024,Ga=3*1024*1024*1024;function Ya(e,r="$10"){return e?`${e.amount} ${e.currency}`:r}function ft(e,r,s){if(!e)return s;const n=Number(e.exchangeRateFromUsd||(e.currency==="USD"?"1":""));return!Number.isFinite(n)||n<=0?s:`+${(r/100*n).toFixed(2)} ${e.currency}`}function Qe(){return t.jsx("span",{className:"text-red-600 dark:text-red-400","aria-hidden":"true",children:"*"})}function Me(e){return String(e||"").trim().toLowerCase()==="email"}function Zr(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e||"").trim())}function Qt(e){const r=String(e||"").trim();if(!r)return"";const s=r.toLowerCase().replace(/[^a-z0-9]+/g,"");return{discord:"Discord",civitai:"Civitai",x:"X / Twitter",twitter:"X / Twitter",xtwitter:"X / Twitter",email:"Email",mail:"Email",pixiv:"Pixiv",subscribestar:"SubscribeStar",fiverr:"Fiverr",rule34:"Rule34",boosty:"Boosty"}[s]||Ps.find(o=>o.toLowerCase()===r.toLowerCase())||r}function Xa(e,r){if((String(e.commissionType||"")==="image_set"?"image_set":"lora")==="image_set")return[{label:"Base image-set commission",amount:r.replace(/^\$/,""),amountCents:1e3}];const n=[{label:"Base LoRA commission",amount:"15.00",amountCents:1500},{label:"0-1 outfits",amount:"0.00",amountCents:0}],o=String(e.outfitTier||"0_1");return o==="up_to_3"&&(n[1]={label:"Up to 3 outfits",amount:"10.00",amountCents:1e3}),o==="all"&&(n[1]={label:"All outfits",amount:"25.00",amountCents:2500}),e.roadmapOrigin&&n.push({label:"Roadmap-origin discount",amount:"-5.00",amountCents:-500}),e.fastDelivery&&n.push({label:"Extra-fast delivery",amount:o==="all"?"15.00":"10.00",amountCents:o==="all"?1500:1e3}),e.privateModel&&n.push({label:"Private model",amount:"5.00",amountCents:500}),e.allEpochFiles&&n.push({label:"All epoch files",amount:"5.00",amountCents:500}),e.imageSetAddon&&n.push({label:"Additional image set add-on",amount:"10.00",amountCents:1e3}),n}function Za({text:e}){const[r,s]=l.useState(!1);return t.jsxs("span",{className:"relative inline-flex shrink-0",children:[t.jsx("button",{type:"button","aria-label":"Show option details","aria-expanded":r,onClick:n=>{n.stopPropagation(),s(o=>!o)},onBlur:()=>window.setTimeout(()=>s(!1),120),className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 shadow-sm transition hover:border-emerald-300 hover:bg-emerald-50 hover:text-emerald-700 focus:outline-none focus:ring-2 focus:ring-emerald-400/50 dark:border-white/10 dark:bg-slate-950 dar
116k:text-slate-300 dark:hover:border-emerald-500/50 dark:hover:bg-emerald-500/10 dark:hover:text-emerald-100",children:t.jsx(vs,{size:16})}),r&&t.jsx("span",{className:"absolute right-0 top-9 z-20 w-64 rounded-lg border border-slate-200 bg-white p-3 text-left text-xs font-semibold leading-5 text-slate-600 shadow-xl shadow-slate-900/10 dark:border-white/10 dark:bg-[#111b2e] dark:text-slate-200 dark:shadow-black/30",children:e})]})}function et({active:e,title:r,price:s,info:n,onClick:o}){return t.jsx("div",{role:"button",tabIndex:0,onClick:o,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),o())},className:`w-full rounded-lg border p-3 text-left transition md:p-4 ${e?"border-emerald-400 bg-emerald-50 text-emerald-950 shadow-sm dark:border-emerald-500/70 dark:bg-emerald-500/12 dark:text-emerald-50":"border-slate-200 bg-white text-slate-700 hover:border-slate-300 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:border-slate-500"}`,children:t.jsxs("span",{className:"flex items-start justify-between gap-3",children:[t.jsx("span",{className:"min-w-0 flex-1 text-left",children:t.jsx("span",{className:"flex items-center gap-2 font-bold",children:r})}),t.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[s&&t.jsx("span",{className:"text-sm font-black",children:s}),t.jsx(Za,{text:n})]})]})})}function Ja({order:e,embedded:r=!1,onClose:s}){var pe;const n=vr(),o=`kurutai:commission-checkout:${e}`,i=`kurutai:commission-pending:${e}`,[a,d]=l.useState(null),[c,f]=l.useState(null),[m,x]=l.useState(""),[h,u]=l.useState(""),[p,g]=l.useState([]),[k,N]=l.useState(""),[A,_]=l.useState(!1),P=l.useMemo(()=>Va[e],[e]),E=e==="paypal_imageset",w=e==="paypal_lora_reduced",C=l.useMemo(()=>{const b=new URLSearchParams(window.location.search);return{origin:String(b.get("origin")||"").trim(),character:String(b.get("character")||"").trim(),contact:String(b.get("contact")||"").trim(),contactChannel:String(b.get("contact_channel")||"").trim(),contactName:String(b.get("contact_name")||"").trim(),email:String(b.get("email")||"").trim()}},[]),[j,H]=l.useState(()=>wr(o,{commissionType:E?"image_set":"lora",currency:"USD",origin:C.origin,character:C.character,baseModel:"Illustrious",referenceUrl:"",notes:"",contact:C.contact||[Qt(C.contactChannel),C.contactName].filter(Boolean).join(": "),contactChannel:Qt(C.contactChannel),contactName:C.contactName||C.contact,email:Me(C.contactChannel)?C.contactName||C.contact:C.email,outfitTier:"0_1",roadmapOrigin:e==="paypal_lora_reduced",fastDelivery:!1,privateModel:!1,allEpochFiles:!1,imageSetAddon:!1,pageUrl:window.location.href})),$=l.useRef(j),T=l.useRef(p),F=l.useRef(!1),z=!String(j.origin||"").trim()||!String(j.character||"").trim()||!String(j.baseModel||"").trim()||!String(j.contactChannel||"").trim()||!String(j.contactName||"").trim(),W=Me(String(j.contactChannel||""))&&!Zr(String(j.contactName||"")),G=!Me(String(j.contactChannel||""))&&String(j.email||"").trim()&&!Zr(String(j.email||"")),K=!!(W||G),q=String((a==null?void 0:a.clientId)||Yr||"").trim(),D=(a==null?void 0:a.serverReady)&&q&&c&&!z&&!K,Y=(c==null?void 0:c.currency)||"",se=(pe=c==null?void 0:c.lineItems)!=null&&pe.length?c.lineItems:Xa(j,P.priceLabel||"$10"),Z=b=>H(I=>({...I,...b})),fe=b=>{H(I=>{const y=b.contactChannel!==void 0?Qt(b.contactChannel):String(I.contactChannel||""),R=b.contactName!==void 0?b.contactName:String(I.contactName||""),L=Me(y);return{...I,...b,contactChannel:y,email:L?R:I.email,contact:[y,R].map(M=>String(M||"").trim()).filter(Boolean).join(": ")}})},J=b=>{if(!b.length)return;const I=[...p,...b];if(I.length>Xr){N(`You can upload up to ${Xr} reference files.`);return}const y=I.find(L=>L.size>Ka);if(y){N(`${y.name} is larger than 300 MB.`);return}if(I.reduce((L,M)=>L+M.size,0)>Ga){N("Reference files exceed the 3 GB total upload limit.");return}N(""),g(I)},ae=b=>{b.preventDefault(),_(!1),J(Array.from(b.dataTransfer.files||[]))};l.useEffect(()=>{bs();const b={route:"checkout",pageKind:"checkout",order:e,...C};ys({viewKey:`checkout:${e}`,pageKind:"checkout",pageUrl:window.location.href,metadata:b}),ne("page_view",{pageUrl:window.location.href,metadata:b}),ne("commission_checkout_open",{metadata:b})},[C,e]),l.useEffect(()=>{On().then(b=>{var y;const I=(y=b.allowedCurrencies)!=null&&y.length?b.allowedCurrencies:[b.currency||"USD"];d({serverReady:!!b.serverReady,clientId:String(b.clientId||Yr||"").trim(),environment:b.environment,currency:b.currency,allowedCurrencies:I}),H(R=>({...R,currency:I.includes(String(R.currency||""))?R.currency:I[0]||"USD"}))}).catch(b=>u(b instanceof Error?b.message:"Failed to load PayPal config."))},[n]),l.useEffect(()=>{let b=!1;const I=window.setTimeout(()=>{In(j).then(y=>{b||(f(y.quote),u(""))}).catch(y=>{b||(f(null),u(y instanceof Error?y.message:"Could not calculate quote."))})},200);return()=>{b=!0,window.clearTimeout(I)}},[j,n]),l.useEffect(()=>{kr(o,j)},[j,o]),l.useEffect(()=>{$.current=j},[j]),l.useEffect(()=>{T.current=p},[p]);const le=l.useCallback(async(b,I,y,R)=>{x("Recovering your completed payment...");const L=await Mn(b,I);y.length&&(x("Uploading references..."),await Dn(b,y,R)),window.sessionStorage.removeItem(i),Lt(o),x("Payment captured. Opening your private page..."),L.privatePageUrl&&window.location.assign(L.privatePageUrl)},[o,i]);return l.useEffect(()=>{if(F.current)return;let b=null;try{b=JSON.parse(window.sessionStorage.getItem(i)||"null")}catch{b=null}if(!(b!=null&&b.approved)||!b.orderId||!b.form)return;const I=b.referenceSubmissionId||ve("commission-references");b.referenceSubmissionId||window.sessionStorage.setItem(i,JSON.stringify({...b,referenceSubmissionId:I})),F.current=!0,le(b.orderId,b.form,T.current,I).catch(y=>{x(""),u(y instanceof Error?y.message:"Could not recover the completed payment yet.")}).finally(()=>{F.current=!1})},[le,i,n]),l.useEffect(()=>{var V;if(!D||!Y)return;let b=!1;const I="paypal-api-commission-buttons",R=`${String((a==null?void 0:a.environment)||"").toLowerCase()==="sandbox"?"https://www.sandbox.paypal.com":"https://www.paypal.com"}/sdk/js?client-id=${encodeURIComponent(q)}&currency=${encodeURIComponent(Y)}&components=buttons&intent=capture`,L=()=>{var oe;if(b)return;const X=window.paypalCommissionCheckout,ce=document.getElementById(I);if(!(X!=null&&X.Buttons)||!ce)return;ce.innerHTML="";const me={style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal",height:45},createOrder:async()=>{const te=$.current;x("Creating PayPal order...");const Ce=await $n(te);return x(""),Ce.paypalOrderId},onApprove:async te=>{const Ce=$.current,we=T.current;x("Capturing payment...");const ye=String(te.orderID||""),Ie=ve("commission-references");window.sessionStorage.setItem(i,JSON.stringify({orderId:ye,form:Ce,approved:!0,referenceSubmissionId:Ie})),await le(ye,Ce,we,Ie)},onError:te=>{x(""),u(te instanceof Error?te.message:"PayPal checkout failed.")}};(oe=X.FUNDING)!=null&&oe.PAYPAL&&(me.fundingSource=X.FUNDING.PAYPAL);const Q=X.Buttons(me).render(`#${I}`);Q&&typeof Q.catch=="function"&&Q.catch(te=>{b||u(te instanceof Error?te.message:"Could not render PayPal checkout.")})},M=document.querySelector('script[data-paypal-sdk="api-checkout"]');
116if(M){if(M.getAttribute("data-currency")===Y)return(V=window.paypalCommissionCheckout)!=null&&V.Buttons?L():M.addEventListener("load",L,{once:!0}),()=>{b=!0;const X=document.getElementById(I);X&&(X.innerHTML="")};M.remove(),delete window.paypalCommissionCheckout}const U=document.createElement("script");return U.src=R,U.async=!0,U.crossOrigin="anonymous",U.setAttribute("data-paypal-sdk","api-checkout"),U.setAttribute("data-namespace","paypalCommissionCheckout"),U.setAttribute("data-currency",Y),U.addEventListener("load",L,{once:!0}),U.addEventListener("error",()=>!b&&u("Could not load PayPal checkout."),{once:!0}),document.head.appendChild(U),()=>{b=!0;const X=document.getElementById(I);X&&(X.innerHTML="")}},[a==null?void 0:a.environment,le,D,q,Y,i]),t.jsx("div",{className:`${r?"":"min-h-screen"} bg-[#f6f7fb] text-slate-950 dark:bg-[#090d18] dark:text-slate-100`,children:t.jsxs("main",{className:`${r?"w-full px-0 py-0":"mx-auto w-full max-w-6xl px-2 py-3 md:px-4 md:py-10"}`,children:[r?s?t.jsxs("button",{type:"button",onClick:s,className:"sticky top-0 z-20 mb-3 inline-flex items-center gap-2 rounded-md border border-slate-200 bg-white/95 px-3 py-2 text-sm font-semibold text-slate-600 shadow-sm hover:text-slate-950 md:static md:mb-4 md:border-0 md:bg-transparent md:px-0 md:py-0 md:shadow-none dark:border-slate-700 dark:bg-slate-900/95 dark:text-slate-300 dark:hover:text-white md:dark:bg-transparent",children:[t.jsx(lr,{size:16}),"Back to options"]}):null:t.jsxs("a",{href:"/",className:"sticky top-0 z-20 mb-3 inline-flex items-center gap-2 rounded-md border border-slate-200 bg-white/95 px-3 py-2 text-sm font-semibold text-slate-600 shadow-sm hover:text-slate-950 md:static md:mb-5 md:border-0 md:bg-transparent md:px-0 md:py-0 md:shadow-none dark:border-slate-700 dark:bg-slate-900/95 dark:text-slate-300 dark:hover:text-white md:dark:bg-transparent",children:[t.jsx(lr,{size:16}),"Back to Lexicon"]}),t.jsxs("div",{className:"grid gap-3 md:gap-5 lg:grid-cols-[minmax(0,1fr)_360px]",children:[t.jsxs("section",{className:"rounded-lg border border-slate-200 bg-white p-3 shadow-sm md:p-5 dark:border-white/10 dark:bg-[#0f1728]",children:[t.jsxs("div",{className:"border-b border-slate-200 pb-3 md:pb-5 dark:border-white/10",children:[w&&t.jsx("p",{className:"text-xs font-bold uppercase tracking-normal text-emerald-700 dark:text-emerald-300",children:"Roadmap origin discount applied"}),t.jsx("h1",{className:"mt-1 text-xl font-black tracking-normal text-slate-950 md:mt-2 md:text-3xl dark:text-white",children:P.title}),t.jsx("p",{className:"mt-1 max-w-2xl text-xs leading-5 text-slate-600 md:mt-2 md:text-sm md:leading-6 dark:text-slate-300",children:P.subtitle})]}),t.jsxs("div",{className:"mt-5 grid gap-3 md:grid-cols-3",children:[t.jsxs("label",{className:"block text-sm font-semibold text-slate-700 dark:text-slate-200",children:["Origin ",Qe(),t.jsx("input",{value:qe(String(j.origin||"")),onChange:b=>Z({origin:b.target.value}),readOnly:w,"aria-disabled":w,placeholder:"Anime, game, creator, series, or source",className:`mt-2 h-11 w-full rounded-md border px-3 text-sm font-bold outline-none ${w?"cursor-not-allowed border-slate-200 bg-slate-100 text-slate-500 dark:border-slate-800 dark:bg-slate-950/70 dark:text-slate-500":"border-slate-300 bg-white text-slate-950 focus:border-emerald-500 dark:border-slate-700 dark:bg-slate-950 dark:text-white"}`})]}),t.jsxs("label",{className:"block text-sm font-semibold text-slate-700 dark:text-slate-200",children:["Character ",Qe(),t.jsx("input",{value:String(j.character||""),onChange:b=>Z({character:b.target.value}),placeholder:"Character name",className:"mt-2 h-11 w-full rounded-md border border-slate-300 bg-white px-3 text-sm text-slate-950 outline-none focus:border-emerald-500 dark:border-slate-700 dark:bg-slate-950 dark:text-white"})]}),t.jsxs("label",{className:"block text-sm font-semibold text-slate-700 dark:text-slate-200",children:["Base Model ",Qe(),t.jsxs("span",{className:"relative mt-2 block",children:[t.jsx(Ra,{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:17}),t.jsx("select",{value:String(j.baseModel||"Illustrious"),onChange:b=>Z({baseModel:b.target.value}),className:"h-11 w-full appearance-none rounded-md border border-slate-300 bg-white pl-10 pr-10 text-sm font-semibold text-slate-950 outline-none transition focus:border-emerald-500 focus:ring-2 focus:ring-emerald-400/20 dark:border-slate-700 dark:bg-slate-950 dar
116k:text-white",children:Ha.map(b=>t.jsx("option",{value:b,children:b},b))}),t.jsx(Rt,{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-slate-400",size:17})]})]})]}),!E&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mt-6",children:[t.jsx("h2",{className:"text-base font-bold text-slate-950 md:text-lg dark:text-white",children:"Outfit Scope"}),t.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-3",children:[t.jsx(et,{active:j.outfitTier==="0_1",title:"0-1 outfits",info:"Included in the base commission price. Choose this when the model should focus on the character's main/default look, a single outfit, or when outfit variety is not important for the final LoRA.",onClick:()=>Z({outfitTier:"0_1"})}),t.jsx(et,{active:j.outfitTier==="up_to_3",title:"Up to 3 outfits",price:ft(c,1e3,"+$10"),info:"Adds support for up to three distinct outfit looks in the training set. This is useful when the character has a few iconic variants and you want the LoRA to understand more than the default appearance without turning the order into a full outfit-coverage job.",onClick:()=>Z({outfitTier:"up_to_3"})}),t.jsx(et,{active:j.outfitTier==="all",title:"All outfits",price:ft(c,2500,"+$25"),info:"Best when you want broad outfit coverage for the character. I will source and include all usable outfits I can reasonably identify for the origin/character, which takes more preparation and cleanup than a focused model.",onClick:()=>Z({outfitTier:"all"})})]})]}),t.jsxs("div",{className:"mt-6",children:[t.jsx("h2",{className:"text-base font-bold text-slate-950 md:text-lg dark:text-white",children:"Add-ons"}),t.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[t.jsx(et,{active:!!j.privateModel,title:"Private model",price:ft(c,500,"+$5"),info:"The commissioned LoRA will be delivered to you privately and will not be posted publicly on Civitai. You still receive the private progress/delivery page and files, but the public release step is skipped.",onClick:()=>Z({privateModel:!j.privateModel})}),t.jsx(et,{active:!!j.allEpochFiles,title:"All epoch files",price:ft(c,500,"+$5"),info:"By default, delivery includes the final selected model. With this add-on, I also include the intermediate epoch files so you can compare versions, test different checkpoints, or keep more control over which training stage you prefer.",onClick:()=>Z({allEpochFiles:!j.allEpochFiles})}),t.jsx(et,{active:!!j.imageSetAddon,title:"Add a image set to the order",price:ft(c,1e3,"+$10"),info:"Adds a generated image set with at least 40 images of the commissioned character, made with my high-quality self-trained model. This uses the same kind of model pipeline I use for SubscribeStar sets and is delivered with the order/private page.",onClick:()=>Z({imageSetAddon:!j.imageSetAddon})})]})]})]}),t.jsxs("div",{className:"mt-6",children:[t.jsx("h2",{className:"text-base font-bold text-slate-950 md:text-lg dark:text-white",children:"Your Details"}),t.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[t.jsxs("label",{className:"block text-sm font-semibold text-slate-700 dark:text-slate-200",children:["Channel ",Qe(),t.jsxs("span",{className:"relative mt-2 block",children:[t.jsx(Ba,{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:17}),t.jsxs("select",{value:String(j.contactChannel||""),onChange:b=>fe({contactChannel:b.target.value}),className:"h-11 w-full appearance-none rounded-md border border-slate-300 bg-white pl-10 pr-10 text-sm font-semibold text-slate-950 outline-none transition focus:border-emerald-500 focus:ring-2 focus:ring-emerald-400/20 dark:border-slate-700 dark:bg-slate-950 dark:text-white",children:[t.jsx("option",{value:"",children:"Select channel"}),Ps.map(b=>t.jsx("option",{value:b,children:b},b))]}),t.jsx(Rt,{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-slate-400",size:17})]})]}),t.jsxs("label",{className:"block text-sm font-semibold text-slate-700 dark:text-slate-200",children:[Me(String(j.contactChannel||""))?"Email address":"Name / Username"," ",Qe(),t.jsx("input",{type:Me(String(j.contactChannel||""))?"email":"text",value:String(j.contactName||""),onChange:b=>fe({contactName:b.target.value}),placeholder:Me(String(j.contactChannel||""))?"[email protected]":"Your name or username",className:"mt-2 h-11 w-full rounded-md border border-slate-300 bg-white px-3 text-sm text-slate-950 outline-none focus:border-emerald-500 dark:border-slate-700 dark:bg-slate-950 dar
116k:text-white"})]}),!Me(String(j.contactChannel||""))&&t.jsxs("label",{className:"block text-sm font-semibold text-slate-700 dark:text-slate-200",children:["Email optional",t.jsxs("span",{className:"relative mt-2 block",children:[t.jsx(Pa,{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:17}),t.jsx("input",{type:"email",value:String(j.email||""),onChange:b=>Z({email:b.target.value}),placeholder:"[email protected]",className:"h-11 w-full rounded-md border border-slate-300 bg-white pl-10 pr-3 text-sm text-slate-950 outline-none focus:border-emerald-500 dark:border-slate-700 dark:bg-slate-950 dark:text-white"})]}),t.jsx("span",{className:"mt-2 block text-xs leading-5 text-slate-500 dark:text-slate-400",children:"If provided, you will receive the order confirmation, the link to your private status page, and important commission updates such as when your order is ready for approval."})]}),t.jsxs("label",{className:"block text-sm font-semibold text-slate-700 dark:text-slate-200 md:col-span-2",children:["Reference URL",t.jsx("input",{value:String(j.referenceUrl||""),onChange:b=>Z({referenceUrl:b.target.value}),placeholder:"Link to references, gallery, post, or notes",className:"mt-2 h-11 w-full rounded-md border border-slate-300 bg-white px-3 text-sm text-slate-950 outline-none focus:border-emerald-500 dark:border-slate-700 dark:bg-slate-950 dark:text-white"})]}),t.jsxs("label",{className:"block text-sm font-semibold text-slate-700 dark:text-slate-200 md:col-span-2",children:["Notes",t.jsx("textarea",{value:String(j.notes||""),maxLength:5e3,onChange:b=>Z({notes:b.target.value.slice(0,5e3)}),placeholder:E?"Anything you would like me to focus on in this commission set. Outfits, poses, acts, priorities.":"Anything else I should know about the character, style, outfits, priorities, or references.",className:"mt-2 min-h-32 w-full resize-y rounded-md border border-slate-300 bg-white px-3 py-2 text-sm text-slate-950 outline-none focus:border-emerald-500 dark:border-slate-700 dark:bg-slate-950 dark:text-white"}),t.jsxs("span",{className:"mt-1 block text-right text-xs text-slate-500",children:[String(j.notes||"").length,"/5000"]})]}),t.jsxs("div",{className:"md:col-span-2",children:[t.jsxs("label",{onDragOver:b=>{b.preventDefault(),_(!0)},onDragLeave:()=>_(!1),onDrop:ae,className:`flex cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border border-dashed px-4 py-6 text-center text-sm font-bold transition ${A?"border-emerald-400 bg-emerald-50 text-emerald-800 dark:border-emerald-500 dark:bg-emerald-500/10 dark:text-emerald-100":"border-slate-300 bg-slate-50 text-slate-700 hover:border-emerald-400 hover:bg-emerald-50 dark:border-slate-700 dark:bg-slate-950/60 dark:text-slate-200 dark:hover:border-emerald-500/70 dark:hover:bg-emerald-500/10"}`,children:[t.jsx(ya,{size:22}),t.jsx("span",{children:"Drop reference images/files here or click to upload"}),t.jsx("span",{className:"text-xs font-medium opacity-70",children:"Images, PDF, TXT, ZIP, 7Z, or RAR. Up to 50 files, 300 MB each, 3 GB total."}),t.jsx("input",{type:"file",multiple:!0,accept:"image/*,.pdf,.txt,.zip,.7z,.rar",className:"sr-only",onChange:b=>{J(Array.from(b.target.files||[])),b.target.value=""}})]}),k&&t.jsx("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:k}),p.length>0&&t.jsx("div",{className:"mt-2 space-y-2",children:p.map((b,I)=>t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-slate-200 bg-white px-3 py-2 text-sm text-slate-700 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200",children:[t.jsx("span",{className:"min-w-0 truncate",children:b.name}),t.jsx("button",{type:"button",onClick:()=>{g(y=>y.filter((R,L)=>L!==I)),N("")},className:"shrink-0 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-slate-800 dark:hover:text-white","aria-label":`Remove ${b.n
116ame}`,children:t.jsx(We,{size:15})})]},`${b.name}-${b.size}-${I}`))})]})]})]})]}),t.jsx("aside",{className:"lg:sticky lg:top-6 lg:self-start",children:t.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-3 shadow-sm md:p-5 dark:border-white/10 dark:bg-[#0f1728]",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm font-bold text-emerald-700 dark:text-emerald-300",children:[t.jsx(He,{size:18}),"Order Summary"]}),t.jsxs("label",{className:"mt-4 block text-sm font-semibold text-slate-700 dark:text-slate-200",children:["Currency ",Qe(),t.jsx(qa,{id:"commission-payment-currency",value:String(j.currency||(a==null?void 0:a.currency)||"USD"),allowedCurrencies:(a==null?void 0:a.allowedCurrencies)||[(a==null?void 0:a.currency)||"USD"],onChange:b=>Z({currency:b})})]}),t.jsx("div",{className:"mt-4 space-y-2 text-sm",children:se.map((b,I)=>t.jsxs("div",{className:"flex justify-between gap-3 border-b border-slate-100 pb-2 last:border-0 dark:border-white/10",children:[t.jsx("span",{className:"text-slate-600 dark:text-slate-300",children:b.label}),t.jsx("span",{className:"font-bold text-slate-950 dark:text-white",children:b.amountCents===0?"Included":`${b.amount} ${(c==null?void 0:c.currency)||String(j.currency||"USD")}`})]},`${b.label}-${I}`))}),t.jsxs("div",{className:"mt-4 flex items-end justify-between gap-3 border-t border-slate-200 pt-4 dark:border-white/10",children:[t.jsx("span",{className:"text-sm font-bold text-slate-600 dark:text-slate-300",children:"Total"}),t.jsx("span",{className:"text-2xl font-black text-slate-950 md:text-3xl dark:text-white",children:Ya(c,P.priceLabel||"$10")})]}),z&&t.jsx("p",{className:"mt-3 rounded-md border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-300/40 dark:bg-amber-300/10 dark:text-amber-100",children:"Fill out required fields to continue to payment."}),K&&t.jsx("p",{className:"mt-3 rounded-md border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-300/40 dark:bg-amber-300/10 dark:text-amber-100",children:"Enter a valid email address or leave the optional email field blank."}),(!(a!=null&&a.serverReady)||!q)&&t.jsx("p",{className:"mt-3 rounded-md border border-slate-300 bg-slate-50 p-3 text-sm text-slate-700 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300",children:"PayPal checkout is currently unavailable because the API credentials are missing in this environment."}),D&&t.jsx("div",{className:"mt-4 overflow-hidden rounded-md bg-transparent",children:t.jsx("div",{id:"paypal-api-commission-buttons"})}),m&&t.jsx("p",{className:"mt-3 text-sm font-semibold text-emerald-700 dark:text-emerald-300",children:m}),h&&t.jsx("p",{className:"mt-3 text-sm font-semibold text-red-700 dark:text-red-300",children:h})]})})]})]})})}const Qa=("https://lora.nudemuse.online".trim()||"https://lora.nudemuse.online").replace(/\/+$/,"")+"/";function Jr(e){const r=new Set,s=[];for(const n of e){const o=String(n||"").trim();if(!o)continue;const i=o.toLowerCase();r.has(i)||(r.add(i),s.push(o))}return s}function tt(e){const r=Jr([e.originTitleEnglish,e.originTitleRomaji,e.originTitleNative]);if(r.length>0)return r.join(" / ");const s=Jr(Array.isArray(e.originTitleVariants)?e.originTitleVariants:[]);return s.length>0?s.join(" / "):qe(e.targetOrigin||e.targetName||"Unknown Origin")}function eo(e){if(String(e.targetType||"").toLowerCase()!=="origin"||String(e.syncStatus||"active").toLowerCase()!=="active")return!1;const r=String(e.status||"").toLowerCase();return!["done","online","cancelled","hidden","archived","quarantined"].includes(r)}function to(e,r="",s="",n="",o="roadmap_reduced_offer"){const i=new URL(Qa);return i.searchParams.set("order","paypal_lora_reduced"),i.searchParams.set("origin",e),r.trim()&&i.searchParams.set("contact_name",r.trim()),n.trim()&&i.searchParams.set("contact_channel",n.trim()),s.trim()&&i.searchParams.set("email",s.trim()),i.searchParams.set("source",o),i.toString()}function ro({origins:e,loading:r=!1,contactName:s="",email:n="",channel:o="",source:i,trackingPageId:a=0,compact:d=!1}){const[c,f]=l.useState(!1),[m,x]=l.useState(""),[h,u]=l.useState(""),[p,g]=l.useState(null),[k,N]=l.useState(!1),[A,_]=l.useState(""),P=p??e,E=l.useMemo(()=>P.filter(eo).slice().sort((T,F)=>tt(T).localeCompare(tt(F),void 0,{sensitivity:"base"})),[P]);l.useEffect(()=>{if(!c)return;const T=new AbortController;return N(!0),_(""),ws({signal:T.signal},{limit:1e4,targetType:"origin"}).then(F=>{T.signal.aborted||g(F)}).catch(F=>{T.signal.aborted||_(F instanceof Error?F.message:"Failed to load the complete origin list.")}).finally(()=>{T.signal.aborted||N(!1)}),()=>T.abort()},[c]),l.useEffect(()=>{x(T=>T&&E.some(F=>tt(F)===T)?T:E[0]?tt(E[0]):"")},[E]);const w=h.trim().toLowerCase(),C=w?E.filter(T=>[tt(T),T.targetName,T.targetOrigin,T.targetKey,T.originId,...Array.isArray(T.originAliases)?T.originAliases:[]].map(z=>String(z||"").toLowerCase()).join(" ").includes(w)):E,j=m.trim()?to(m.trim(),s,n,o,i):"",H=E.length.toLocaleStr
116ing("en-US"),$=r||k;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`${d?"":"mt-3"} overflow-hidden rounded-lg border border-amber-300/40 bg-slate-950 p-4 shadow-sm`,children:t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-emerald-300 px-2 py-1 text-xs font-black uppercase tracking-normal text-emerald-950",children:[t.jsx(Fa,{size:13}),"Save $5"]}),t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-amber-200/35 bg-amber-200/10 px-2 py-1 text-xs font-bold text-amber-100",children:[t.jsx(Wr,{size:13}),"Faster queue"]})]}),t.jsxs("h3",{className:"flex items-center gap-2 text-base font-black text-white",children:[t.jsx(Cs,{size:18,className:"text-amber-200"}),"Commission a roadmap LoRA for $10"]}),t.jsx("p",{className:"mt-1 text-sm leading-6 text-slate-300",children:"These origins are already in my workflow, so your character starts cheaper and moves sooner."})]}),t.jsxs("button",{type:"button",onClick:()=>{f(!0),ne("commission_click",{metadata:{target:`${i}_modal_open`,pageId:a}})},className:"inline-flex h-10 shrink-0 items-center justify-center gap-2 rounded-md bg-amber-200 px-4 text-sm font-black text-slate-950 shadow-sm hover:bg-amber-100",children:[t.jsx(wa,{size:16}),"See eligible origins"]})]})}),c&&t.jsx("div",{className:"fixed inset-0 z-[150] flex items-center justify-center bg-black/70 p-4",onClick:()=>f(!1),children:t.jsxs("div",{className:"w-full max-w-5xl overflow-hidden rounded-lg border border-white/10 bg-[#0b1020] shadow-2xl",onClick:T=>T.stopPropagation(),children:[t.jsx("div",{className:"border-b border-white/10 bg-slate-950 px-5 py-5",children:t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"mb-3 flex flex-wrap gap-2",children:[t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-emerald-300 px-2.5 py-1 text-xs font-black uppercase tracking-normal text-emerald-950",children:[t.jsx(ha,{size:14}),"Roadmap deal"]}),t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-amber-200/35 bg-amber-200/10 px-2.5 py-1 text-xs font-bold text-amber-100",children:[H," eligible ",E.length===1?"origin":"origins"]})]}),t.jsx("h2",{className:"text-2xl font-black leading-tight text-white",children:"Pick a roadmap origin. Pay less. Skip the cold start."}),t.jsxs("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-slate-300",children:["Normal LoRA commissions start at ",t.jsx("span",{className:"text-slate-500 line-through",children:"$15"}),". Roadmap-origin commissions start at ",t.jsx("span",{className:"font-black text-emerald-200",children:"$10"})," because the source work is already underway."]})]}),t.jsx("button",{type:"button",onClick:()=>f(!1),className:"rounded-md p-2 text-slate-300 hover:bg-white/10","aria-label":"Close reduced commission form",children:t.jsx(We,{size:18})})]})}),t.jsxs("div",{className:"grid gap-0 lg:grid-cols-[minmax(0,1fr)_320px]",children:[t.jsxs("div",{className:"p-5",children:[t.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"block text-xs font-bold uppercase tracking-normal text-slate-400",children:"Choose an origin"}),t.jsx("p",{className:"mt-1 text-sm text-slate-300",children:"Search the roadmap and lock in the discounted checkout."})]}),!$&&E.length>0&&t.jsx("span",{className:"shrink-0 rounded-md border border-white/10 bg-white/[0.04] px-2 py-1 text-xs text-slate-400",children:C.length===E.length?`${E.length} available`:`${C.length} of ${E.length}`})]}),t.jsxs("div",{className:"rounded-md border border-white/10 bg-black/20 p-2",children:[t.jsx("input",{value:h,onChange:T=>u(T.target.value),placeholder:"Search origins",className:"mb-2 h-10 w-full rounded-md border border-white/10 bg-black/25 px-3 text-sm text-white outline-none placeholder:text-slate-500 focus:border-amber-200/70"}),t.jsxs("div",{className:"max-h-[52vh] overflow-auto pr-1",children:[$&&t.jsx("div",{className:"p-3 text-sm text-slate-400",children:"Loading the complete origin list..."}),!$&&A&&t.jsx("div",{className:"mb-2 rounded-md border border-amber-300/25 bg-amber-200/10 p-3 text-sm text-amber-100",children:"The complete list could not be loaded. Showing the available preview instead."}),!$&&E.length===0&&t.jsx("div",{className:"p-3 text-sm text-slate-400",children:"No roadmap deals are available right now."}),!$&&E.length>0&&C.length===0&&t.jsx("div",{className:"p-3 text-sm text-slate-400",children:"No origins match your search."}),!$&&C.length>0&&t.jsx("div",{className:"space-y-2",children:C.map(T=>{const F=tt(T),z=m===F;return t.jsx("button",{type:"button",onClick:()=>x(F),className:`w-full rounded-md border p-3 text-left transition ${z?"border-emerald-300 bg-emerald-300/14 text-white":"border-sky-200/20 bg-sky-300/[0.06] text-slate-200 hover:border-sky-200/50 hover:bg-sky-300/[0.1]"}`,children:t.jsxs("span",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{className:"min-w-0 break-words text-sm font-semibold leading-5",children:F}),t.jsx("span",{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-full border ${z?"border-emerald-300 bg-emerald-300 text-slate-950":"border-white/15 bg-black/20 text-transparent"}`,children:t.jsx(He,{size:14})})]})},T.targetKey)})})]})]})]}),t.jsxs("div",{className:"border-t border-white/10 bg-white/[0.04] p-5 lg:border-l lg:border-t-0",children:[t.jsxs("div",{className:"rounded-lg border border-emerald-300/30 bg-emerald-300/[0.08] p-4",children:[t.jsx("span",{className:"text-xs font-black uppercase tracking-normal text-emerald-200",children:"Roadmap price"}),t.jsxs("div",{className:"mt-2 flex items-end gap-3",children:[t.jsx("span",{className:"text-4xl font-black leading-none text-white",children:"$10"}),t.jsx("span",{className:"pb-1 text-sm font-semibold text-slate-400 line-through",children:"$15 normal"})]}),t.jsx("p",{className:"mt-2 text-sm font-semibold text-emerald-100",children:"You save $5 before add-ons."})]}),t.jsxs("div",{className:"mt-4 space-y-3 text-sm text-slate-300",children:[t.jsxs("div",{className:"flex gap-3",children:[t.jsx(ht,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-200"}),t.jsx("p",{children:"Perfect when you want a polished LoRA commission without waiting through the full custom setup."})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx(Wr,{className:"mt-0.5 h-4 w-4 shrink-0 text-sky-200"}),t.jsx("p",{children:"Less setup time means faster delivery than a cold-start commission."})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx(He,{className:"mt-0.5 h-4 w-4 shrink-0 text-emerald-200"}),t.jsx("p",{children:"You still choose the character, outfits, add-ons, and references at checkout."})]})]}),t.jsx("p",{className:"mt-5 min-h-[3rem] rounded-md border border-white/10 bg-black/20 p-3 text-sm leading-6 text-slate-300",children:m?t.jsxs(t.Fragment,{children:["Selected: ",t.jsx("span",{className:"font-bold text-white",children:m})]}):"Choose an origin to continue."})]})]}),t.jsxs("div",{className:"flex flex-wrap justify-end gap-2 border-t border-white/10 px-5 py-4",children:[t.jsx("button",{type:"button",onClick:()=>f(!1),className:"inline-flex h-10 items-center justify-center rounded-md border border-white/15 px-4 text-sm font-bold text-slate-200 hover:bg-white/[0.06]",children:"Cancel"}),t.jsxs("a",{href:j||void 0,target:"_blank",rel:"noreferrer","aria-disabled":!j,onClick:T=>{if(!j){T.preventDefault();return}ne("commission_click",{metadata:{target:`${i}_checkout`,pageId:a,origin:m.trim()}})},className:`inline-flex h-10 items-center justify-center gap-2 rounded-md px-4 text-sm font-black ${j?"bg-emerald-300 text-emerald-950 hover:bg-emerald-200":"pointer-events-none bg-slate-600 text-slate-300"}`,children:["Claim $10 roadmap price",t.jsx(Fn,{size:16})]})]})]})})]})}function Re(e,r,{checkForDefaultPrevented:s=!0}={}
vendor: 10,268 bytes, line 116
116){return function(o){if(e==null||e(o),s===!1||!o.defaultPrevented)return r==null?void 0:r(o)}}function Qr(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function Es(...e){return r=>{let s=!1;const n=e.map(o=>{const i=Qr(o,r);return!s&&typeof i=="function"&&(s=!0),i});if(s)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():Qr(e[o],null)}}}}function Ge(...e){return l.useCallback(Es(...e),e)}function As(e,r=[]){let s=[];function n(i,a){const d=l.createContext(a),c=s.length;s=[...s,a];const f=x=>{var N;const{scope:h,children:u,...p}=x,g=((N=h==null?void 0:h[e])==null?void 0:N[c])||d,k=l.useMemo(()=>p,Object.values(p));return t.jsx(g.Provider,{value:k,children:u})};f.displayName=i+"Provider";function m(x,h){var g;const u=((g=h==null?void 0:h[e])==null?void 0:g[c])||d,p=l.useContext(u);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${x}\` must be used within \`${i}\``)}return[f,m]}const o=()=>{const i=s.map(a=>l.createContext(a));return function(d){const c=(d==null?void 0:d[e])||i;return l.useMemo(()=>({[`__scope${e}`]:{...d,[e]:c}}),[d,c])}};return o.scopeName=e,[n,so(o,...r)]}function so(...e){const r=e[0];if(e.length===1)return r;const s=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=n.reduce((d,{useScope:c,scopeName:f})=>{const x=c(i)[`__scope${f}`];return{...d,...x}},{});return l.useMemo(()=>({[`__scope${r.scopeName}`]:a}),[a])}};return s.scopeName=r.scopeName,s}var _s=l.forwardRef((e,r)=>{const{children:s,...n}=e,o=l.Children.toArray(s),i=o.find(no);if(i){const a=i.props.children,d=o.map(c=>c===i?l.Children.count(a)>1?l.Children.only(null):l.isValidElement(a)?a.props.children:null:c);return t.jsx(mr,{...n,ref:r,children:l.isValidElement(a)?l.cloneElement(a,void 0,d):null})}return t.jsx(mr,{...n,ref:r,children:s})});_s.displayName="Slot";var mr=l.forwardRef((e,r)=>{const{children:s,...n}=e;if(l.isValidElement(s)){const o=oo(s),i=ao(n,s.props);return s.type!==l.Fragment&&(i.ref=r?Es(r,o):o),l.cloneElement(s,i)}return l.Children.count(s)>1?l.Children.only(null):null});mr.displayName="SlotClone";var Rs=({children:e})=>t.jsx(t.Fragment,{children:e});function no(e){return l.isValidElement(e)&&e.type===Rs}function ao(e,r){const s={...r};for(const n in r){const o=e[n],i=r[n];/^on[A-Z]/.test(n)?o&&i?s[n]=(...d)=>{i(...d),o(...d)}:o&&(s[n]=o):n==="style"?s[n]={...o,...i}:n==="className"&&(s[n]=[o,i].filter(Boolean).join(" "))}return{...e,...s}}function oo(e){var n,o;let r=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var io=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Fe=io.reduce((e,r)=>{const s=l.forwardRef((n,o)=>{const{asChild:i,...a}=n,d=i?_s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(d,{...a,ref:o})});return s.displayName=`Primitive.${r}`,{...e,[r]:s}},{});function lo(e,r){e&&ks.flushSync(()=>e.dispatchEvent(r))}function it(e){const r=l.useRef(e);return l.useEffect(()=>{r.current=e}),l.useMemo(()=>(...s)=>{var n;return(n=r.current)==null?void 0:n.call(r,...s)},[])}function co(e,r=globalThis==null?void 0:globalThis.document){const s=it(e);l.useEffect(()=>{const n=o=>{o.key==="Escape"&&s(o)};return r.addEventListener("keydown",n,{capture:!0}),()=>r.removeEventListener("keydown",n,{capture:!0})},[s,r])}var uo="DismissableLayer",fr="dismissableLayer.update",mo="dismissableLayer.pointerDownOutside",fo="dismissableLayer.focusOutside",es,Ts=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ls=l.forwardRef((e,r)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:d,...c}=e,f=l.useContext(Ts),[m,x]=l.useState(null),h=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,u]=l.useState({}),p=Ge(r,C=>x(C)),g=Array.from(f.layers),[k]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=g.indexOf(k),A=m?g.indexOf(m):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,P=A>=N,E=xo(C=>{const j=C.target,H=[...f.branches].some($=>$.contains(j));!P||H||(o==null||o(C),a==null||a(C),C.defaultPrevented||d==null||d())},h),w=go(C=>{const j=C.target;[...f.branches].some($=>$.contains(j))||(i==null||i(C),a==null||a(C),C.defaultPrevented||d==null||d())},h);return co(C=>{A===f.layers.size-1&&(n==null||n(C),!C.defaultPrevented&&d&&(C.preventDefault(),d()))},h),l.useEffect(()=>{if(m)return s&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(es=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),ts(),()=>{s&&f.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=es)}},[m,h,s,f]),l.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),ts())},[m,f]),l.useEffect(()=>{const C=()=>u({});return document.addEventListener(fr,C),()=>document.removeEventListener(fr,C)},[]),t.jsx(Fe.div,{...c,ref:p,style:{pointerEvents:_?P?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,E.onPointerDownCapture)})});Ls.displayName=uo;var po="DismissableLayerBranch",ho=l.forwardRef((e,r)=>{const s=l.useContext(Ts),n=l.useRef(null),o=Ge(r,n);return l.useEffect(()=>{const i=n.current;if(i)return s.branches.add(i),()=>{s.branches.delete(i)}},[s.branches]),t.jsx(Fe.div,{...e,ref:o})});ho.displayName=po;function xo(e,r=globalThis==null?void 0:globalThis.document){const s=it(e),n=l.useRef(!1),o=l.useRef(()=>{});return l.useEffect(()=>{const i=d=>{if(d.target&&!n.current){let c=function(){Os(mo,s,f,{discrete:!0})};const f={originalEvent:d};d.pointerType==="touch"?(r.removeEventListener("click",o.current),o.current=c,r.addEventListener("click",o.current,{once:!0})):c()}else r.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{r.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),r.removeEventListener("pointerdown",i),r.removeEventListener("click",o.current)}},[r,s]),{onPointerDownCapture:()=>n.current=!0}}function go(e,r=globalThis==null?void 0:globalThis.document){const s=it(e),n=l.useRef(!1);return l.useEffect(()=>{const o=i=>{i.target&&!n.current&&Os(fo,s,{originalEvent:i},{discrete:!1})};return r.addEventListener("focusin",o),()=>r.removeEventListener("focusin",o)},[r,s]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ts(){const e=new CustomEvent(fr);document.dispatchEvent(e)}function Os(e,r,s,{discrete:n}){const o=s.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});r&&o.addEventListener(e,r,{once:!0}),n?lo(o,i):o.dispatchEvent(i)}var Ve=globalThis!=null&&globalThis.document?l.useLayoutEffect:()=>{},bo=Un.useId||(()=>{}),yo=0;function vo(e){const[r,s]=l.useState(bo());return Ve(()=>{s(n=>n??String(yo++))},[e]),r?`radix-${r}`:""}const wo=["top","right","bottom","left"],De=Math.min,xe=Math.max,Ot=Math.round,Nt=Math.floor,Ae=e=>({x:e,y:e}),ko={left:"right",right:"left",bottom:"top",top:"bottom"};function pr(e,r,s){return xe(e,De(r,s))}function Te(e,r){return typeof e=="function"?e(r):e}function Le(e){return e.split("-")[0]}function lt(e){return e.split("-")[1]}function jr(e){return e==="x"?"y":"x"}function Nr(e){return e==="y"?"height":"width"}function Ee(e){const r=e[0];return r==="t"||r==="b"?"y":"x"}function Cr(e){return jr(Ee(e))}function jo(e,r,s){s===void 0&&(s=!1);const n=lt(e),o=Cr(e),i=Nr(o);let a=o==="x"?n===(s?"end":"start")?"right":"left":n==="start"?"bottom":"top";return r.reference[i]>r.floating[i]&&(a=It(a)),[a,It(a)]}function No(e){const r=It(e);return[hr(e),r,hr(r)]}function hr(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const rs=["left","right"],ss=["right","left"],Co=["top","bottom"],So=["bottom","top"];function Po(e,r,s){switch(e){case"top":case"bottom":return s?r?ss:rs:r?rs:ss;case"left":case"right":return r?Co:So;default:return[]}}function Eo(e,r,s,n){const o=lt(e);let i=Po(Le(e),s==="start",n);return o&&(i=i.map(a=>a+"-"+o),r&&(i=i.concat(i.map(hr)))),i}function It(e){const r=Le(e);return ko[r]+e.slice(r.length)}function Ao(e){return{top:0,right:0,bottom:0,left:0,...e}}function Is(e){return typeof e!="number"?Ao(e):{top:e,right:e,bottom:e,left:e}}function Mt(e){const{x:r,y:s,width:n,height:o}=e;return{width:n,height:o,top:s,left:r,right:r+n,bottom:s+o,x:r,y:s}}function ns(e,r,s){let{reference:n,floating:o}=e;const i=Ee(r),a=Cr(r),d=Nr(a),c=Le(r),f=i==="y",m=n.x+n.width/2-o.width/2,x=n.y+n.height/2-o.height/2,h=n[d]/2-o[d]/2;let u;switch(c){case"top":u={x:m,y:n.y-o.height};break;case"bottom":u={x:m,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:x};break;case"left":u={x:n.x-o.width,y:x};break;default:u={x:n.x,y:n.y}}switch(lt(r)){case"start":u[a]-=h*(s&&f?-1:1);break;case"end":u[a]+=h*(s&&f?-1:1);break}return u}async function _o(e,r){var s;r===void 0&&(r={});const{x:n,y:o,platform:i,rects:a,elements:d,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:x="floating",altBoundary:h=!1,padding:u=0}=Te(r,e),p=Is(u),k=d[h?x==="floating"?"reference":"floating":x],N=Mt(await i.getClippingRect({element:(s=await(i.isElement==null?void 0:i.isElement(k)))==null||s?k:k.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(d.floating)),boundary:f,rootBoundary:m,strategy:c})),A=x==="floating"?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d.floating)),P=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},E=Mt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:A,offsetParent:_,strategy:c}):A);return{top:(N.top-E.top+p.top)/P.y,bottom:(E.bottom-N.bottom+p.bottom)/P.y,left:(N.left-E.left+p.left)/P.x,r
vendor: 8,888 bytes, line 116
116ight:(E.right-N.right+p.right)/P.x}}const Ro=50,To=async(e,r,s)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=s,d=a.detectOverflow?a:{...a,detectOverflow:_o},c=await(a.isRTL==null?void 0:a.isRTL(r));let f=await a.getElementRects({reference:e,floating:r,strategy:o}),{x:m,y:x}=ns(f,n,c),h=n,u=0;const p={};for(let g=0;g<i.length;g++){const k=i[g];if(!k)continue;const{name:N,fn:A}=k,{x:_,y:P,data:E,reset:w}=await A({x:m,y:x,initialPlacement:n,placement:h,strategy:o,middlewareData:p,rects:f,platform:d,elements:{reference:e,floating:r}});m=_??m,x=P??x,p[N]={...p[N],...E},w&&u<Ro&&(u++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(f=w.rects===!0?await a.getElementRects({reference:e,floating:r,strategy:o}):w.rects),{x:m,y:x}=ns(f,h,c)),g=-1)}return{x:m,y:x,placement:h,strategy:o,middlewareData:p}},Lo=e=>({name:"arrow",options:e,async fn(r){const{x:s,y:n,placement:o,rects:i,platform:a,elements:d,middlewareData:c}=r,{element:f,padding:m=0}=Te(e,r)||{};if(f==null)return{};const x=Is(m),h={x:s,y:n},u=Cr(o),p=Nr(u),g=await a.getDimensions(f),k=u==="y",N=k?"top":"left",A=k?"bottom":"right",_=k?"clientHeight":"clientWidth",P=i.reference[p]+i.reference[u]-h[u]-i.floating[p],E=h[u]-i.reference[u],w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let C=w?w[_]:0;(!C||!await(a.isElement==null?void 0:a.isElement(w)))&&(C=d.floating[_]||i.floating[p]);const j=P/2-E/2,H=C/2-g[p]/2-1,$=De(x[N],H),T=De(x[A],H),F=$,z=C-g[p]-T,W=C/2-g[p]/2+j,G=pr(F,W,z),K=!c.arrow&&lt(o)!=null&&W!==G&&i.reference[p]/2-(W<F?$:T)-g[p]/2<0,q=K?W<F?W-F:W-z:0;return{[u]:h[u]+q,data:{[u]:G,centerOffset:W-G-q,...K&&{alignmentOffset:q}},reset:K}}}),Oo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(r){var s,n;const{placement:o,middlewareData:i,rects:a,initialPlacement:d,platform:c,elements:f}=r,{mainAxis:m=!0,crossAxis:x=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...k}=Te(e,r);if((s=i.arrow)!=null&&s.alignmentOffset)return{};const N=Le(o),A=Ee(d),_=Le(d)===d,P=await(c.isRTL==null?void 0:c.isRTL(f.floating)),E=h||(_||!g?[It(d)]:No(d)),w=p!=="none";!h&&w&&E.push(...Eo(d,g,p,P));const C=[d,...E],j=await c.detectOverflow(r,k),H=[];let $=((n=i.flip)==null?void 0:n.overflows)||[];if(m&&H.push(j[N]),x){const W=jo(o,a,P);H.push(j[W[0]],j[W[1]])}if($=[...$,{placement:o,overflows:H}],!H.every(W=>W<=0)){var T,F;const W=(((T=i.flip)==null?void 0:T.index)||0)+1,G=C[W];if(G&&(!(x==="alignment"?A!==Ee(G):!1)||$.every(D=>Ee(D.placement)===A?D.overflows[0]>0:!0)))return{data:{index:W,overflows:$},reset:{placement:G}};let K=(F=$.filter(q=>q.overflows[0]<=0).sort((q,D)=>q.overflows[1]-D.overflows[1])[0])==null?void 0:F.placement;if(!K)switch(u){case"bestFit":{var z;const q=(z=$.filter(D=>{if(w){const Y=Ee(D.placement);return Y===A||Y==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(Y=>Y>0).reduce((Y,se)=>Y+se,0)]).sort((D,Y)=>D[1]-Y[1])[0])==null?void 0:z[0];q&&(K=q);break}case"initialPlacement":K=d;break}if(o!==K)return{reset:{placement:K}}}return{}}}};function as(e,r){return{top:e.top-r.height,right:e.right-r.width,bottom:e.bottom-r.height,left:e.left-r.width}}function os(e){return wo.some(r=>e[r]>=0)}const Io=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(r){const{rects:s,platform:n}=r,{strategy:o="referenceHidden",...i}=Te(e,r);switch(o){case"referenceHidden":{const a=await n.detectOverflow(r,{...i,elementContext:"reference"}),d=as(a,s.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:os(d)}}}case"escaped":{const a=await n.detectOverflow(r,{...i,altBoundary:!0}),d=as(a,s.floating);return{data:{escapedOffsets:d,escaped:os(d)}}}default:return{}}}}},Ms=new Set(["left","top"]);async function Mo(e,r){const{placement:s,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),a=Le(s),d=lt(s),c=Ee(s)==="y",f=Ms.has(a)?-1:1,m=i&&c?-1:1,x=Te(r,e);let{mainAxis:h,crossAxis:u,alignmentAxis:p}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return d&&typeof p=="number"&&(u=d==="end"?p*-1:p),c?{x:u*m,y:h*f}:{x:h*f,y:u*m}}const Do=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(r){var s,n;const{x:o,y:i,placement:a,middlewareData:d}=r,c=await Mo(r,e);return a===((s=d.offset)==null?void 0:s.placement)&&(n=d.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},$o=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(r){const{x:s,y:n,placement:o,platform:i}=r,{mainAxis:a=!0,crossAxis:d=!1,limiter:c={fn:N=>{let{x:A,y:_}=N;return{x:A,y:_}}},...f}=Te(e,r),m={x:s,y:n},x=await i.detectOverflow(r,f),h=Ee(Le(o)),u=jr(h);let p=m[u],g=m[h];if(a){const N=u==="y"?"top":"left",A=u==="y"?"bottom":"right",_=p+x[N],P=p-x[A];p=pr(_,p,P)}if(d){const N=h==="y"?"top":"left",A=h==="y"?"bottom":"right",_=g+x[N],P=g-x[A];g=pr(_,g,P)}const k=c.fn({...r,[u]:p,[h]:g});return{...k,data:{x:k.x-s,y:k.y-n,enabled:{[u]:a,[h]:d}}}}}},Fo=function(e){return e===void 0&&(e={}),{options:e,fn(r){const{x:s,y:n,placement:o,rects:i,middlewareData:a}=r,{offset:d=0,mainAxis:c=!0,crossAxis:f=!0}=Te(e,r),m={x:s,y:n},x=Ee(o),h=jr(x);let u=m[h],p=m[x];const g=Te(d,r),k=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const _=h==="y"?"height":"width",P=i.reference[h]-i.floating[_]+k.mainAxis,E=i.reference[h]+i.reference[_]-k.mainAxis;u<P?u=P:u>E&&(u=E)}if(f){var N,A;const _=h==="y"?"width":"height",P=Ms.has(Le(o)),E=i.reference[x]-i.floating[_]+(P&&((N=a.offset)==null?void 0:N[x])||0)+(P?0:k.crossAxis),w=i.reference[x]+i.reference[_]+(P?0:((A=a.offset)==null?void 0:A[x])||0)-(P?k.crossAxis:0);p<E?p=E:p>w&&(p=w)}return{[h]:u,[x]:p}}}},Uo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(r){var s,n;const{placement:o,rects:i,platform:a,elements:d}=r,{apply:c=()=>{},...f}=Te(e,r),m=await a.detectOverflow(r,f),x=Le(o),h=lt(o),u=Ee(o)==="y",{width:p,height:g}=i.floating;let k,N;x==="top"||x==="bottom"?(k=x,N=h===(await(a.isRTL==null?void 0:a.isRTL(d.floating))?"start":"end")?"left":"right"):(N=x,k=h==="end"?"top":"bottom");const A=g-m.top-m.bottom,_=p-m.left-m.right,P=De(g-m[k],A),E=De(p-m[N],_),w=!r.middlewareData.shift;let C=P,j=E;if((s=r.middlewareData.shift)!=null&&s.enabled.x&&(j=_),(n=r.middlewareData.shift)!=null&&n.enabled.y&&(C=A),w&&!h){const $=xe(m.left,0),T=xe(m.right,0),F=xe(m.top,0),z=xe(m.bottom,0);u?j=p-2*($!==0||T!==0?$+T:xe(m.left,m.right)):C=g-2*(F!==0||z!==0?F+z:xe(m.top,m.bottom))}await c({...r,availableWidth:j,availableHeight:C});const H=await a.getDimensions(d.floating);return p!==H.width||g!==H.height?{reset:{rects:!0}}:{}}}};function Ft(){return typeof window<"u"}function ct(e){return Ds(e)?(e.nodeName||"").toLowerCase():"#document"}function ge(e){var r;return(e==null||(r=e.ownerDocument)==null?void 0:r.defaultView)||window}function _e(e){var r;return(r=(Ds(e)?e.ownerDocument:e.document)||window.document)==null?void 0:r.documentElement}function Ds(e){return Ft()?e instanceof Node||e instanceof ge(e).Node:!1}function je(e){return Ft()?e instanceof Element||e instanceof ge(e).Element:!1}function Oe(e){return Ft()?e instanceof HTMLElement||e instanceof ge(e).HTMLElement:!1}function is(e){return!Ft()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ge(e).ShadowRoot}function bt(e){const{overflow:r,overflowX:s,overflowY:n,display:o}=Ne(e);return/auto|scroll|overlay|hidden|clip/.test(r+n+s)&&o!=="inline"&&o!=="contents"}function zo(e){return/^(table|td|th)$/.test(ct(e))}function Ut(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Bo=/transform|translate|scale|rotate|perspective|filter/,Ho=/paint|layout|strict|content/,Be=e=>!!e&&e!=="none";let er;function Sr(e){const r=je(e)?Ne(e):e;return Be(r.transform)||Be(r.translate)||Be(r.scale)||Be(r.rotate)||Be(r.perspective)||!Pr()&&(Be(r.backdropFilter)||Be(r.filter))||Bo.test(r.willChange||"")||Ho.test(r.contain||"")}function Wo(e){let r=$e(e);for(;Oe(r)&&!at(r);){if(Sr(r))return r;if(Ut(r))return null;r=$e(r)}return null}function Pr(){return er==null&&(er=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),er}function at(e){return/^(html|body|#document)$/.test(ct(e))}function Ne(e){return ge(e).getComputedStyle(e)}function zt(e){return je(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $e(e){if(ct(e)==="html")return e;const r=e.assignedSlot||e.parentNode||is(e)&&e.host||_e(e);return is(r)?r.host:r}function $s(e){const r=$e(e);return at(r)?e.ownerDocument?e.ownerDocument.body:e.body:Oe(r)&&bt(r)?r:$s(r)}function gt(e,r,s){var n;r===void 0&&(r=[]),s===void 0&&(s=!0);const o=$s(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),a=ge(
vendor: 14,289 bytes, line 116
116o);if(i){const d=xr(a);return r.concat(a,a.visualViewport||[],bt(o)?o:[],d&&s?gt(d):[])}else return r.concat(o,gt(o,[],s))}function xr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fs(e){const r=Ne(e);let s=parseFloat(r.width)||0,n=parseFloat(r.height)||0;const o=Oe(e),i=o?e.offsetWidth:s,a=o?e.offsetHeight:n,d=Ot(s)!==i||Ot(n)!==a;return d&&(s=i,n=a),{width:s,height:n,$:d}}function Er(e){return je(e)?e:e.contextElement}function nt(e){const r=Er(e);if(!Oe(r))return Ae(1);const s=r.getBoundingClientRect(),{width:n,height:o,$:i}=Fs(r);let a=(i?Ot(s.width):s.width)/n,d=(i?Ot(s.height):s.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!d||!Number.isFinite(d))&&(d=1),{x:a,y:d}}const qo=Ae(0);function Us(e){const r=ge(e);return!Pr()||!r.visualViewport?qo:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function Vo(e,r,s){return r===void 0&&(r=!1),!s||r&&s!==ge(e)?!1:r}function Ke(e,r,s,n){r===void 0&&(r=!1),s===void 0&&(s=!1);const o=e.getBoundingClientRect(),i=Er(e);let a=Ae(1);r&&(n?je(n)&&(a=nt(n)):a=nt(e));const d=Vo(i,s,n)?Us(i):Ae(0);let c=(o.left+d.x)/a.x,f=(o.top+d.y)/a.y,m=o.width/a.x,x=o.height/a.y;if(i){const h=ge(i),u=n&&je(n)?ge(n):n;let p=h,g=xr(p);for(;g&&n&&u!==p;){const k=nt(g),N=g.getBoundingClientRect(),A=Ne(g),_=N.left+(g.clientLeft+parseFloat(A.paddingLeft))*k.x,P=N.top+(g.clientTop+parseFloat(A.paddingTop))*k.y;c*=k.x,f*=k.y,m*=k.x,x*=k.y,c+=_,f+=P,p=ge(g),g=xr(p)}}return Mt({width:m,height:x,x:c,y:f})}function Bt(e,r){const s=zt(e).scrollLeft;return r?r.left+s:Ke(_e(e)).left+s}function zs(e,r){const s=e.getBoundingClientRect(),n=s.left+r.scrollLeft-Bt(e,s),o=s.top+r.scrollTop;return{x:n,y:o}}function Ko(e){let{elements:r,rect:s,offsetParent:n,strategy:o}=e;const i=o==="fixed",a=_e(n),d=r?Ut(r.floating):!1;if(n===a||d&&i)return s;let c={scrollLeft:0,scrollTop:0},f=Ae(1);const m=Ae(0),x=Oe(n);if((x||!x&&!i)&&((ct(n)!=="body"||bt(a))&&(c=zt(n)),x)){const u=Ke(n);f=nt(n),m.x=u.x+n.clientLeft,m.y=u.y+n.clientTop}const h=a&&!x&&!i?zs(a,c):Ae(0);return{width:s.width*f.x,height:s.height*f.y,x:s.x*f.x-c.scrollLeft*f.x+m.x+h.x,y:s.y*f.y-c.scrollTop*f.y+m.y+h.y}}function Go(e){return Array.from(e.getClientRects())}function Yo(e){const r=_e(e),s=zt(e),n=e.ownerDocument.body,o=xe(r.scrollWidth,r.clientWidth,n.scrollWidth,n.clientWidth),i=xe(r.scrollHeight,r.clientHeight,n.scrollHeight,n.clientHeight);let a=-s.scrollLeft+Bt(e);const d=-s.scrollTop;return Ne(n).direction==="rtl"&&(a+=xe(r.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:d}}const ls=25;function Xo(e,r){const s=ge(e),n=_e(e),o=s.visualViewport;let i=n.clientWidth,a=n.clientHeight,d=0,c=0;if(o){i=o.width,a=o.height;const m=Pr();(!m||m&&r==="fixed")&&(d=o.offsetLeft,c=o.offsetTop)}const f=Bt(n);if(f<=0){const m=n.ownerDocument,x=m.body,h=getComputedStyle(x),u=m.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(n.clientWidth-x.clientWidth-u);p<=ls&&(i-=p)}else f<=ls&&(i+=f);return{width:i,height:a,x:d,y:c}}function Zo(e,r){const s=Ke(e,!0,r==="fixed"),n=s.top+e.clientTop,o=s.left+e.clientLeft,i=Oe(e)?nt(e):Ae(1),a=e.clientWidth*i.x,d=e.clientHeight*i.y,c=o*i.x,f=n*i.y;return{width:a,height:d,x:c,y:f}}function cs(e,r,s){let n;if(r==="viewport")n=Xo(e,s);else if(r==="document")n=Yo(_e(e));else if(je(r))n=Zo(r,s);else{const o=Us(e);n={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return Mt(n)}function Bs(e,r){const s=$e(e);return s===r||!je(s)||at(s)?!1:Ne(s).position==="fixed"||Bs(s,r)}function Jo(e,r){const s=r.get(e);if(s)return s;let n=gt(e,[],!1).filter(d=>je(d)&&ct(d)!=="body"),o=null;const i=Ne(e).position==="fixed";let a=i?$e(e):e;for(;je(a)&&!at(a);){const d=Ne(a),c=Sr(a);!c&&d.position==="fixed"&&(o=null),(i?!c&&!o:!c&&d.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||bt(a)&&!c&&Bs(e,a))?n=n.filter(m=>m!==a):o=d,a=$e(a)}return r.set(e,n),n}function Qo(e){let{element:r,boundary:s,rootBoundary:n,strategy:o}=e;const a=[...s==="clippingAncestors"?Ut(r)?[]:Jo(r,this._c):[].concat(s),n],d=cs(r,a[0],o);let c=d.top,f=d.right,m=d.bottom,x=d.left;for(let h=1;h<a.length;h++){const u=cs(r,a[h],o);c=xe(u.top,c),f=De(u.right,f),m=De(u.bottom,m),x=xe(u.left,x)}return{width:f-x,height:m-c,x,y:c}}function ei(e){const{width:r,height:s}=Fs(e);return{width:r,height:s}}function ti(e,r,s){const n=Oe(r),o=_e(r),i=s==="fixed",a=Ke(e,!0,i,r);let d={scrollLeft:0,scrollTop:0};const c=Ae(0);function f(){c.x=Bt(o)}if(n||!n&&!i)if((ct(r)!=="body"||bt(o))&&(d=zt(r)),n){const u=Ke(r,!0,i,r);c.x=u.x+r.clientLeft,c.y=u.y+r.clientTop}else o&&f();i&&!n&&o&&f();const m=o&&!n&&!i?zs(o,d):Ae(0),x=a.left+d.scrollLeft-c.x-m.x,h=a.top+d.scrollTop-c.y-m.y;return{x,y:h,width:a.width,height:a.height}}function tr(e){return Ne(e).position==="static"}function ds(e,r){if(!Oe(e)||Ne(e).position==="fixed")return null;if(r)return r(e);let s=e.offsetParent;return _e(e)===s&&(s=s.ownerDocument.body),s}function Hs(e,r){const s=ge(e);if(Ut(e))return s;if(!Oe(e)){let o=$e(e);for(;o&&!at(o);){if(je(o)&&!tr(o))return o;o=$e(o)}return s}let n=ds(e,r);for(;n&&zo(n)&&tr(n);)n=ds(n,r);return n&&at(n)&&tr(n)&&!Sr(n)?s:n||Wo(e)||s}const ri=async function(e){const r=this.getOffsetParent||Hs,s=this.getDimensions,n=await s(e.floating);return{reference:ti(e.reference,await r(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function si(e){return Ne(e).direction==="rtl"}const ni={convertOffsetParentRelativeRectToViewportRelativeRect:Ko,getDocumentElement:_e,getClippingRect:Qo,getOffsetParent:Hs,getElementRects:ri,getClientRects:Go,getDimensions:ei,getScale:nt,isElement:je,isRTL:si};function Ws(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height}function ai(e,r){let s=null,n;const o=_e(e);function i(){var d;clearTimeout(n),(d=s)==null||d.disconnect(),s=null}function a(d,c){d===void 0&&(d=!1),c===void 0&&(c=1),i();const f=e.getBoundingClientRect(),{left:m,top:x,width:h,height:u}=f;if(d||r(),!h||!u)return;const p=Nt(x),g=Nt(o.clientWidth-(m+h)),k=Nt(o.clientHeight-(x+u)),N=Nt(m),_={rootMargin:-p+"px "+-g+"px "+-k+"px "+-N+"px",threshold:xe(0,De(1,c))||1};let P=!0;function E(w){const C=w[0].intersectionRatio;if(C!==c){if(!P)return a();C?a(!1,C):n=setTimeout(()=>{a(!1,1e-7)},1e3)}C===1&&!Ws(f,e.getBoundingClientRect())&&a(),P=!1}try{s=new IntersectionObserver(E,{..._,root:o.ownerDocument})}catch{s=new IntersectionObserver(E,_)}s.observe(e)}return a(!0),i}function oi(e,r,s,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,f=Er(e),m=o||i?[...f?gt(f):[],...r?gt(r):[]]:[];m.forEach(N=>{o&&N.addEventListener("scroll",s,{passive:!0}),i&&N.addEventListener("resize",s)});const x=f&&d?ai(f,s):null;let h=-1,u=null;a&&(u=new ResizeObserver(N=>{let[A]=N;A&&A.target===f&&u&&r&&(u.unobserve(r),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=u)==null||_.observe(r)})),s()}),f&&!c&&u.observe(f),r&&u.observe(r));let p,g=c?Ke(e):null;c&&k();function k(){const N=Ke(e);g&&!Ws(g,N)&&s(),g=N,p=requestAnimationFrame(k)}return s(),()=>{var N;m.forEach(A=>{o&&A.removeEventListener("scroll",s),i&&A.removeEventListener("resize",s)}),x==null||x(),(N=u)==null||N.disconnect(),u=null,c&&cancelAnimationFrame(p)}}const ii=Do,li=$o,ci=Oo,di=Uo,ui=Io,us=Lo,mi=Fo,fi=(e,r,s)=>{const n=new Map,o={platform:ni,...s},i={...o.platform,_c:n};return To(e,r,{...o,platform:i})};var pi=typeof document<"u",hi=function(){},Et=pi?l.useLayoutEffect:hi;function Dt(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(typeof e=="function"&&e.toString()===r.toString())return!0;let s,n,o;if(e&&r&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==r.length)return!1;for(n=s;n--!==0;)if(!Dt(e[n],r[n]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(r).length)return!1;for(n=s;n--!==0;)if(!{}.hasOwnProperty.call(r,o[n]))return!1;for(n=s;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!Dt(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}function qs(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ms(e,r){const s=qs(e);return Math.round(r*s)/s}function rr(e){const r=l.useRef(e);return Et(()=>{r.current=e}),r}function xi(e){e===void 0&&(e={});const{placement:r="bottom",strategy:s="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:a}={},transform:d=!0,whileElementsMounted:c,open:f}=e,[m,x]=l.useState({x:0,y:0,strategy:s,placement:r,middlewareData:{},isPositioned:!1}),[h,u]=l.useState(n);Dt(h,n)||u(n);const[p,g]=l.useState(null),[k,N]=l.useState(null),A=l.useCallback(D=>{D!==w.current&&(w.current=D,g(D))},[]),_=l.useCallback(D=>{D!==C.current&&(C.current=D,N(D))},[]),P=i||p,E=a||k,w=l.useRef(null),C=l.useRef(null),j=l.useRef(m),H=c!=null,$=rr(c),T=rr(o),F=rr(f),z=l.useCallback(()=>{if(!w.current||!C.current)return;const D={placement:r,strategy:s,middleware:h};T.current&&(D.platform=T.current),fi(w.current,C.current,D).then(Y=>{const se={...Y,isPositioned:F.current!==!1};W.current&&!Dt(j.current,se)&&(j.current=se,ks.flushSync(()=>{x(se)}))})},[h,r,s,T,F]);Et(()=>{f===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,x(D=>({...D,isPositioned:!1})))},[f]);const W=l.useRef(!1);Et(()=>(W.current=!0,()=>{W.current=!1}),[]),Et(()=>{if(P&&(w.current=P),E&&(C.current=E),P&&E){if($.current)return $.current(P,E,z);z()}},[P,E,z,$,H]);const G=l.useMemo(()=>({reference:w,floating:C,setReference:A,setFloating:_}),[A,_]),K=l.useMemo(()=>({reference:P,floating:E}),[P,E]),q=l.useMemo(()=>{const D={position:s,left:0,top:0};if(!K.floating)return D;const Y=ms(K.floating,m.x),se=ms(K.floating,m.y);return d?{...D,transform:"translate("+Y+"px, "+se+"px)",...qs(K.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:Y,top:se}},[s,d,K.floating,m.x,m.y]);return l.useMemo(()=>({...m,update:z,refs:G,elements:K,floatingStyles:q}),[m,z,G,K,q])}const gi=e=>{function r(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:n,padding:o}=typeof e=="function"?e(s):e;return n&&r(n)?n.current!=null?us({element:n.current,padding:o}).fn(s):{}:n?us({element:n,padding:o}).fn(s):{}}}},bi=(e,r)=>{const s=ii(e);return{name:s.name,fn:s.fn,options:[e,r]}},yi=(e,r)=>{const s=li(e);return{name:s.name,fn:s.fn,options:[e,r]}},vi=(e,r)=>({fn:mi(e).fn,options:[e,r]}),wi=(e,r)=>{const s=ci(e);return{name:s.name,fn:s.fn,options:[e,r]}},ki=(e,r)=>{const s=di(e);return{name:s.name,fn:s.fn,options:[e,r]}},ji=(e,r)=>{const s=ui(e);return{name:s.name,fn:s.fn,options:[e,r]}},Ni=(e,r)=>{const s=gi(e);return{name:s.name,fn:s.fn,options:[e,r]}};var Ci="Arrow",Vs=l.forwardRef((e,r)=>{const{children:s,width:n=10,height:o=5,...i}=e;return t.jsx(Fe.svg,{...i,ref:r,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?s:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});Vs.displayName=Ci;var Si=Vs;function Pi(e){const[r,s]=l.useState(void 0);return Ve(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,d;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;a=f.inlineSize,d=f.blockSize}else a=e.offsetWidth,d=e.offsetHeight;s({width:a,height:d})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else s(void 0)},[e]),r}var Ar="Popper",[Ks,Gs]=As(Ar),[Ei,Ys]=Ks(Ar),Xs=e=>{const{__scopePopper:r,children:s}=e,[n,o]=l.useState(null);return t.jsx(Ei,{scope:r,anchor:n,onAnchorChange:o,children:s})};Xs.displayName=Ar;var Zs="PopperAnchor",Js=l.forwardRef((e,r)=>{const{__scopePopper:s,virtualRef:n,...o}=e,i=Ys(Zs,s),a=l.useRef(null),d=Ge(r,a);return l.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:t.jsx(Fe.div,{...o,ref:d})});Js.displayName=Zs;var _r="PopperContent",[Ai,_i]=Ks(_r),Qs=l.forwardRef((e,r)=>{var b,I,y,R,L,M;const{__scopePopper:s,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:d=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:x="partial",hideWhenDetached:h=!1,updatePositionStrategy:u="optimized",onPlaced:p,...g}=e,k=Ys(_r,s),[N,A]=l.useState(null),_=Ge(r,U=>A(U)),[P,E]=l.useState(null),w=Pi(P),C=(w==null?void 0:w.width)??0,j=(w==null?void 0:w.height)??0,H=n+(i!=="center"?"-"+i:""),$=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},T=Array.isArray(f)?f:[f],F=T.length>0,z={padding:$,boundary:T.filter(Ti),altBoundary:F},{refs:W,floatingStyles:G,placement:K,isPositioned:q,middlewareData:D}=xi({strategy:"fixed",placement:H,whileElementsMounted:(...U)=>oi(...U,{animationFrame:u==="always"}),elements:{reference:k.anchor},middleware:[bi({mainAxis:o+j,alignmentAxis:a}),c&&yi({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?vi():void 0,...z}),c&&wi({...z}),ki({...z,apply:({elements:U,rects:V,availableWidth:X,availableHeight:ce})=>{const{width:me,height:be}=V.reference,Q=U.floating.style;Q.setProperty("--radix-popper-available-width",`${X}px`),Q.setProperty("--radix-popper-available-height",`${ce}px`),Q.setProperty("--radix-popper-anchor-width",`${me}px`),Q.setProperty("--radix-popper-anchor-height",`${be}px`)}}),P&&Ni({element:P,padding:d}),Li({arrowWidth:C,arrowHeight:j}),h&&ji({strategy:"referenceHidden",...z})]}),[Y,se]=rn(K),Z=it(p);Ve(()=>{q&&(Z==null||Z())},[q,Z]);const fe=(b=D.arrow)==null?void 0:b.x,J=(I=D.arrow)==null?void 0:I.y,ae=((y=D.arrow)==null?void 0:y.centerOffset)!==0,[le,pe]=l.useState();return Ve(()=>{N&&pe(window.getComputedStyle(N).zIndex)},[N]),t.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:q?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[(R=D.transformOrigin)==null?void 0:R.x,(L=D.transformOrigin)==null?void 0:L.y].join(" "),...((M=D.hide)==null?void 0:M.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Ai,{scope:s,placedSide:Y,onArrowChange:E,arrowX:fe,arrowY:J,shouldHideArrow:ae,children:t.jsx(Fe.div,{"data-side":Y,"data-align":se,...g,ref:_,style:{...g.style,animation:q?void 0:"none"}})})})});Qs.displayName=_r;var en="PopperArrow",Ri={top:"bottom",right:"left",bottom:"top",left:"r
116ight"},tn=l.forwardRef(function(r,s){const{__scopePopper:n,...o}=r,i=_i(en,n),a=Ri[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(Si,{...o,ref:s,style:{...o.style,display:"block"}})})});tn.displayName=en;function Ti(e){return e!==null}var Li=e=>({name:"transformOrigin",options:e,fn(r){var k,N,A;const{placement:s,rects:n,middlewareData:o}=r,a=((k=o.arrow)==null?void 0:k.centerOffset)!==0,d=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[f,m]=rn(s),x={start:"0%",center:"50%",end:"100%"}[m],h=(((N=o.arrow)==null?void 0:N.x)??0)+d/2,u=(((A=o.arrow)==null?void 0:A.y)??0)+c/2;let p="",g="";return f==="bottom"?(p=a?x:`${h}px`,g=`${-c}px`):f==="top"?(p=a?x:`${h}px`,g=`${n.floating.height+c}px`):f==="right"?(p=`${-c}px`,g=a?x:`${u}px`):f==="left"&&(p=`${n.floating.width+c}px`,g=a?x:`${u}px`),{data:{x:p,y:g}}}});function rn(e){const[r,s="center"]=e.split("-");return[r,s]}var Oi=Xs,Ii=Js,Mi=Qs,Di=tn,$i="Portal",sn=l.forwardRef((e,r)=>{var d;const{container:s,...n}=e,[o,i]=l.useState(!1);Ve(()=>i(!0),[]);const a=s||o&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return a?zn.createPortal(t.jsx(Fe.div,{...n,ref:r}),a):null});sn.displayName=$i;function Fi(e,r){return l.useReducer((s,n)=>r[s][n]??s,e)}var Rr=e=>{const{present:r,children:s}=e,n=Ui(r),o=typeof s=="function"?s({present:n.isPresent}):l.Children.only(s),i=Ge(n.ref,zi(o));return typeof s=="function"||n.isPresent?l.cloneElement(o,{ref:i}):null};Rr.displayName="Presence";function Ui(e){const[r,s]=l.useState(),n=l.useRef({}),o=l.useRef(e),i=l.useRef("none"),a=e?"mounted":"unmounted",[d,c]=Fi(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{const f=Ct(n.current);i.current=d==="mounted"?f:"none"},[d]),Ve(()=>{const f=n.current,m=o.current;if(m!==e){const h=i.current,u=Ct(f);e?c("MOUNT"):u==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(m&&h!==u?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ve(()=>{if(r){let f;const m=r.ownerDocument.defaultView??window,x=u=>{const g=Ct(n.current).includes(u.animationName);if(u.target===r&&g&&(c("ANIMATION_END"),!o.current)){const k=r.style.animationFillMode;r.style.animationFillMode="forwards",f=m.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=k)})}},h=u=>{u.target===r&&(i.current=Ct(n.current))};return r.addEventListener("animationstart",h),r.addEventListener("animationcancel",x),r.addEventListener("animationend",x),()=>{m.clearTimeout(f),r.removeEventListener("animationstart",h),r.removeEventListener("animationcancel",x),r.removeEventListener("animationend",x)}}else c("ANIMATION_END")},[r,c]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:l.useCallback(f=>{f&&(n.current=getComputedStyle(f)),s(f)},[])}}function Ct(e){return(e==null?void 0:e.animationName)||"none"}function zi(e){var n,o;let r=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function Bi({prop:e,defaultProp:r,onChange:s=()=>{}}){const[n,o]=Hi({defaultProp:r,onChange:s}),i=e!==void 0,a=i?e:n,d=it(s),c=l.useCallback(f=>{if(i){const x=typeof f=="function"?f(e):f;x!==e&&d(x)}else o(f)},[i,e,o,d]);return[a,c]}function Hi({defaultProp:e,onChange:r}){const s=l.useState(e),[n]=s,o=l.useRef(n),i=it(r);return l.useEffect(()=>{o.current!==n&&(i(n),o.current=n)},[n,o,i]),s}var Wi="VisuallyHidden",nn=l.forwardRef((e,r)=>t.jsx(Fe.span,{...e,ref:r,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));nn.displayName=Wi;var qi=nn,[Ht]=As("Tooltip",[Gs]),Wt=Gs(),an="TooltipProvider",Vi=700,gr="tooltip.open",[Ki,Tr]=Ht(an),on=e=>{const{__scopeTooltip:r,delayDuration:s=Vi,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,[a,d]=l.useState(!0),c=l.useRef(!1),f=l.useRef(0);return l.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),t.jsx(Ki,{scope:r,isOpenDelayed:a,delayDuration:s,onOpen:l.useCallback(()=>{window.clearTimeout(f.current),d(!1)},[]),onClose:l.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>d(!0),n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(m=>{c.current=m},[]),disableHoverableContent:o,children:i})};on.displayName=an;var qt="Tooltip",[Gi,yt]=Ht(qt),ln=e=>{const{__scopeTooltip:r,children:s,open:n,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:d}=e,c=Tr(qt,e.__scopeTooltip),f=Wt(r),[m,x]=l.useState(null),h=vo(),u=l.useRef(0),p=a??c.disableHoverableContent,g=d??c.delayDuration,k=l.useRef(!1),[N=!1,A]=Bi({prop:n,defaultProp:o,onChange:C=>{C?(c.onOpen(),document.dispatchEvent(new CustomEvent(gr))):c.onClose(),i==null||i(C)}}),_=l.useMemo(()=>N?k.current?"delayed-open":"instant-open":"closed",[N]),P=l.useCallback(()=>{window.clearTimeout(u.current),u.current=0,k.current=!1,A(!0)},[A]),E=l.useCallback(()=>{window.clearTimeout(u.current),u.current=0,A(!1)},[A]),w=l.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>{k.current=!0,A(!0),u.current=0},g)},[g,A]);return l.useEffect(()=>()=>{u.current&&(window.clearTimeout(u.current),u.current=0)},[]),t.jsx(Oi,{...f,children:t.jsx(Gi,{scope:r,contentId:h,open:N,stateAttribute:_,trigger:m,onTriggerChange:x,onTriggerEnter:l.useCallback(()=>{c.isOpenDelayed?w():P()},[c.isOpenDelayed,w,P]),onTriggerLeave:l.useCallback(()=>{p?E():(window.clearTimeout(u.current),u.current=0)},[E,p]),onOpen:P,onClose:E,disableHoverableContent:p,children:s})})};ln.displayName=qt;var br="TooltipTrigger",cn=l.forwardRef((e,r)=>{const{__scopeTooltip:s,...n}=e,o=yt(br,s),i=Tr(br,s),a=Wt(s),d=l.useRef(null),c=Ge(r,d,o.onTriggerChange),f=l.useRef(!1),m=l.useRef(!1),x=l.useCallback(()=>f.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),t.jsx(Ii,{asChild:!0,...a,children:t.jsx(Fe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:c,onPointerMove:Re(e.onPointerMove,h=>{h.pointerType!=="touch"&&!m.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Re(e.onFocus,()=>{f.current||o.onOpen()}),onBlur:Re(e.onBlur,o.onClose),onClick:Re(e.onClick,o.onClose)})})});cn.displayName=br;var Lr="TooltipPortal",[Yi,Xi]=Ht(Lr,{forceMount:void 0}),dn=e=>{const{__scopeTooltip:r,forceMount:s,children:n,container:o}=e,i=yt(Lr,r);return t.jsx(Yi,{scope:r,forceMount:s,children:t.jsx(Rr,{present:s||i.open,children:t.jsx(sn,{asChild:!0,container:o,children:n})})})};dn.displayName=Lr;var ot="TooltipContent",un=l.forwardRef((e,r)=>{const s=Xi(ot,e.__scopeTooltip),{forceMount:n=s.forceMount,side:o="top",...i}=e,a=yt(ot,e.__scopeTooltip);return t.jsx(Rr,{present:n||a.open,children:a.disableHoverableContent?t.jsx(mn,{side:o,...i,ref:r}):t.jsx(Zi,{side:o,...i,ref:r})})}),Zi=l.forwardRef((e,r)=>{const s=yt(ot,e.__scopeTooltip),n=Tr(ot,e.__scopeTooltip),o=l.useRef(null),i=Ge(r,o),[a,d]=l.useState(null),{trigger:c,onClose:f}=s,m=o.current,{onPointerInTransitChange:x}=n,h=l.useCallback(()=>{d(null),x(!1)},[x]),u=l.useCallback((p,g)=>{const k=p.currentTarget,N={x:p.clientX,y:p.clientY},A=el(N,k.getBoundingClientRect()),_=tl(N,A),P=rl(g.getBoundingClientRect()),E=nl([..._,...P]);d(E),x(!0)},[x]);return l.useEffect(()=>()=>h(),[h]),l.useEffect(()=>{if(c&&m){const p=k=>u(k,m),g=k=>u(k,c);return c.addEventListener("pointerleave",p),m.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",p),m.removeEventListener("pointerleave",g)}}},[c,m,u,h]),l.useEffect(()=>{if(a){const p=g=>{const k=g.target,N={x:g.clientX,y:g.clientY},A=(c==null?void 0:c.contains(k))||(m==null?void 0:m.contains(k)),_=!sl(N,a);A?h():_&&(h(),f())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[c,m,a,f,h]),t.jsx(mn,{...e,ref:i})}),[Ji,Qi]=Ht(qt,{isInside:!1}),mn=l.forwardRef((e,r)=>{const{__scopeTooltip:s,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...d}=e,c=yt(ot,s),f=Wt(s),{onClose:m}=c;return l.useEffect(()=>(document.addEventListener(gr,m),()=>document.removeEventListener(gr,m)),[m]),l.useEffect(()=>{if(c.trigger){const x=h=>{const u=h.target;u!=null&&u.contains(c.trigger)&&m()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[c.trigger,m]),t.jsx(Ls,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:t.jsxs(Mi,{"data-state":c.stateAttribute,...f,...d,ref:r,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(Rs,{children:n}),t.jsx(Ji,{scope:s,isInside:!0,children:t.jsx(qi,{id:c.contentId,role:"tooltip",children:o||n})})]})})});un.displayName=ot;var fn="TooltipArrow",pn=l.forwardRef((e,r)=>{const{__scopeTooltip:s,...n}=e,o=Wt(s);return Qi(fn,s).isInside?null:t.jsx(Di,{...o,...n,ref:r})});pn.displayName=fn;function el(e,r){const s=Math.abs(r.top-e.y),n=Math.abs(r.bottom-e.y),o=Math.abs(r.right-e.x),i=Math.abs(r.left-e.x);switch(Math.min(s,n,o,i)){case i:return"left";case o:return"right";case s:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function tl(e,r,s=5){const n=[];
116switch(r){case"top":n.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":n.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":n.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":n.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return n}function rl(e){const{top:r,right:s,bottom:n,left:o}=e;return[{x:o,y:r},{x:s,y:r},{x:s,y:n},{x:o,y:n}]}function sl(e,r){const{x:s,y:n}=e;let o=!1;for(let i=0,a=r.length-1;i<r.length;a=i++){const d=r[i].x,c=r[i].y,f=r[a].x,m=r[a].y;c>n!=m>n&&s<(f-d)*(n-c)/(m-c)+d&&(o=!o)}return o}function nl(e){const r=e.slice();return r.sort((s,n)=>s.x<n.x?-1:s.x>n.x?1:s.y<n.y?-1:s.y>n.y?1:0),al(r)}function al(e){if(e.length<=1)return e.slice();const r=[];for(let n=0;n<e.length;n++){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],a=r[r.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))r.pop();else break}r.push(o)}r.pop();const s=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;s.length>=2;){const i=s[s.length-1],a=s[s.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))s.pop();else break}s.push(o)}return s.pop(),r.length===1&&s.length===1&&r[0].x===s[0].x&&r[0].y===s[0].y?r:r.concat(s)}var ol=on,il=ln,ll=cn,cl=dn,dl=un,ul=pn;const dt={dark:{heading:"text-slate-300",muted:"text-slate-500",text:"text-slate-100",body:"text-slate-200",box:"border-white/10 bg-black/20",prompt:"border-white/10 bg-black/25 text-slate-200",button:"border-white/12 bg-white/[0.06] text-slate-200 hover:border-cyan-200/40 hover:bg-white/10",link:"text-cyan-200 hover:text-cyan-100",weight:"text-cyan-100",tableHead:"border-white/10 bg-white/[0.04] text-slate-500",divider:"divide-white/10",warning:"border-amber-300/25 bg-amber-300/[0.08] text-amber-100",unavailable:"text-amber-200"},light:{heading:"text-gray-700 dark:text-gray-300",muted:"text-gray-500 dark:text-gray-400",text:"text-gray-900 dark:text-gray-100",body:"text-gray-800 dark:text-gray-200",box:"border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-800",prompt:"border-gray-200 bg-white text-gray-800 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200",button:"border-gray-300 bg-white text-gray-700 hover:border-indigo-300 hover:bg-indigo-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:border-indigo-600 dark:hover:bg-gray-700",link:"text-indigo-700 hover:text-indigo-900 dark:text-indigo-300 dark:hover:text-indigo-200",weight:"text-indigo-800 dark:text-indigo-300",tableHead:"border-gray-200 bg-gray-50 text-gray-500 dark:border-gray-700 dark:bg-gray-900/60 dark:text-gray-400",divider:"divide-gray-200 dark:divide-gray-700",warning:"border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-700 dark:bg-amber-950/50 dark:text-amber-200",unavailable:"text-amber-800 dark:text-amber-300"}};function hn({text:e,variant:r,label:s="Copy"}){const[n,o]=l.useState(!1),i=async()=>{if(e)try{await navigator.clipboard.writeText(e),o(!0),window.setTimeout(()=>o(!1),1600)}catch{o(!1)}};return t.jsxs("button",{type:"button",onClick:i,className:`inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border px-2.5 text-xs font-semibold ${dt[r].button}`,children:[n?t.jsx(Bn,{size:14,className:"text-emerald-600"}):t.jsx(Hn,{size:14}),n?"Copied":s]})}function pt({label:e,resource:r,variant:s}){const n=dt[s];return t.jsxs("div",{className:`rounded-lg border p-3 ${n.box}`,children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:`text-[11px] font-bold uppercase tracking-wide ${n.muted}`,children:e}),t.jsx("div",{className:`mt-1 break-words text-sm font-semibold ${n.text}`,children:r.name})]}
116),r.sourceUrl&&r.availability==="available"&&t.jsxs("a",{href:r.sourceUrl,target:"_blank",rel:"noreferrer",className:`inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border px-2.5 text-xs font-bold ${n.button}`,children:[r.sourcePlatform?qe(r.sourcePlatform):"Source",t.jsx($t,{size:13})]})]}),r.availability==="unavailable"&&t.jsx("div",{className:`mt-2 text-xs leading-5 ${n.unavailable}`,children:"The source file is no longer available."})]})}function ml({loras:e,variant:r}){if(!e.length)return null;const s=dt[r];return t.jsxs("div",{className:`overflow-hidden rounded-lg border ${s.box}`,children:[t.jsxs("div",{className:`grid grid-cols-[minmax(0,1fr)_4.5rem] border-b px-3 py-2 text-[10px] font-bold uppercase tracking-wide ${s.tableHead}`,children:[t.jsx("span",{children:"LoRA"}),t.jsx("span",{className:"text-right",children:"Weight"})]}),t.jsx("div",{className:`divide-y ${s.divider}`,children:e.map((n,o)=>t.jsxs("div",{className:"px-3 py-2.5",children:[t.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_4.5rem] items-center gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:`break-words text-sm font-semibold ${s.text}`,children:n.name}),n.sourceUrl&&n.availability==="available"&&t.jsxs("a",{href:n.sourceUrl,target:"_blank",rel:"noreferrer",className:`mt-1 inline-flex items-center gap-1 text-xs font-semibold ${s.link}`,children:[n.sourcePlatform?qe(n.sourcePlatform):"Source",t.jsx($t,{size:12})]})]}),t.jsx("div",{className:`text-right font-mono text-sm font-bold ${s.weight}`,children:n.weight==null?"—":Number(n.weight).toFixed(1)})]}),n.availability==="unavailable"&&t.jsx("div",{className:`mt-2 text-xs leading-5 ${s.unavailable}`,children:"The source file is no longer available."})]},`${n.name}-${o}`))})]})}function fl({variant:e}){return t.jsx(ol,{delayDuration:120,skipDelayDuration:150,disableHoverableContent:!1,children:t.jsxs(il,{children:[t.jsx(ll,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":"What is SwarmUI segmentation refining?",className:`mx-0.5 inline-flex h-5 w-5 translate-y-[2px] select-none items-center justify-center rounded-full align-baseline outline-none ${e==="dark"?"text-cyan-200/75 hover:bg-cyan-200/10 hover:text-cyan-100 focus:bg-cyan-200/10 focus:text-cyan-100":"text-cyan-600 hover:bg-cyan-100 hover:text-cyan-800 focus:bg-cyan-100 focus:text-cyan-800"}`,children:t.jsx(vs,{size:14})})}),t.jsx(cl,{children:t.jsxs(dl,{side:"bottom",align:"end",sideOffset:4,collisionPadding:12,className:"z-[80] w-[min(22rem,calc(100vw-1.5rem))] select-none rounded-lg border border-cyan-200/20 bg-slate-900 p-3 text-left text-xs font-normal normal-case leading-5 tracking-normal text-slate-200 shadow-2xl",children:["SwarmUI's segmentation refining is an alternative to a regular face ADetailer. It uses CLIP Segmentation to automatically find the area named inside ",t.jsx("code",{className:"rounded bg-black/35 px-1 py-0.5 text-cyan-100",children:"<segment:…>"})," and performs an additional localized refinement pass on it. In ",t.jsx("code",{className:"rounded bg-black/35 px-1 py-0.5 text-cyan-100",children:"<segment:girl's face,0.55,0.2>"}),", ",t.jsx("code",{className:"rounded bg-black/35 px-1 py-0.5 text-cyan-100",children:"girl's face"})," is the area CLIP is searching for, ",t.jsx("code",{className:"rounded bg-black/35 px-1 py-0.5 text-cyan-100",children:"0.55"})," is the refinement creativity—or inpaint strength—and ",t.jsx("code",{className:"rounded bg-black/35 px-1 py-0.5 text-cyan-100",children:"0.2"})," is the minimum segmentation-match threshold. This syntax is specific to SwarmUI and may not work in other generators. I personally recommend SwarmUI over any other UI. If you would like to try it, you can get more information at"," ",t.jsxs("a",{href:"https://swarmui.net",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 font-bold text-cyan-200 underline decoration-cyan-300/40 underline-offset-2 hover:text-cyan-100",children:["swarmui.net ",t.jsx($t,{size:11})]}),".",t.jsx(ul,{className:"fill-slate-900"})]})})]})})}function fs({title:e,text:r,variant:s}){if(!r)return null;const n=dt[s],o=e==="Positive prompt"?/<segment:[^>]+>/i.exec(r):null;return t.jsxs("section",{children:[t.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[t.jsx("h4",{className:`text-xs font-bold uppercase tracking-wide ${n.heading}`,children:e}),t.jsx(hn,{text:r,variant:s})]}),t.jsx("div",{className:`max-h-52 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border p-3 text-sm leading-6 ${n.prompt}`,children:o?t.jsxs(t.Fragment,{children:[r.slice(0,o.index),o[0],t.jsx(fl,{variant:s}),r.slice(o.index+o[0].length)]}):r})]})}function de({label:e,value:r,variant:s}){if(r==null||r==="")return null;const n=dt[s];return t.jsxs("div",{className:`rounded-lg border px-3 py-2 ${n.box}`,children:[t.jsx("div",{className:`text-[10px] font-bold uppercase tracking-wide ${n.muted}`,children:e}),t.jsx("div",{className:`mt-0.5 break-words text-sm font-semibold ${n.text}`,children:r})]})}function pl({details:e,variant:r="dark"}){const s=dt[r];return t.jsxs("div",{className:"space-y-5",children:[e.legacyModelDataUnavailable&&t.jsx("div",{className:`rounded-lg border p-3 text-xs leading-5 ${s.warning}`,children:"This image uses older Swarm metadata. Its generation settings are preserved, but verified model links are unavailable because the workflow did not record tensor hashes."}),t.jsx(fs,{title:"Positive prompt",text:e.promptPositive,variant:r}),t.jsx(fs,{title:"Negative prompt",text:e.promptNegative,variant:r}),t.jsxs("section",{className:"space-y-2",children:[t.jsx("h4",{className:`text-xs font-bold uppercase tracking-wide ${s.heading}`,children:"Models and resources"}),e.checkpoint&&t.jsx(pt,{label:"Checkpoint",resource:e.checkpoint,variant:r}),t.jsx(ml,{loras:e.loras,variant:r}),e.vae&&t.jsx(pt,{label:"VAE",resource:e.vae,variant:r}),e.textEncoder&&t.jsx(pt,{label:"Text encoder",resource:e.textEncoder,variant:r})]}),t.jsxs("section",{children:[t.jsx("h4",{className:`mb-2 text-xs font-bold uppercase tracking-wide ${s.heading}`,children:"Generation settings"}),t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.width>0&&e.height>0&&t.jsx(de,{label:"Dimensions",value:`${e.width} × ${e.height}`,variant:r}),t.jsx(de,{label:"Steps",value:e.steps,variant:r}),t.jsx(de,{label:"CFG",value:e.cfgScale,variant:r}),t.jsx(de,{label:"Sampler",value:e.sampler,variant:r}),t.jsx(de,{label:"Scheduler",value:e.scheduler,variant:r}),t.jsx(de,{label:"Clip skip",value:e.clipSkip,variant:r}),t.jsx(de,{label:"Denoise",value:e.denoise,variant:r}),e.seed!=null&&t.jsxs("div",{className:`col-span-2 flex items-center justify-between gap-3 rounded-lg border px-3 py-2 ${s.box}`,children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:`text-[10px] font-bold uppercase tracking-wide ${s.muted}`,children:"Seed"}),t.jsx("div",{className:`mt-0.5 truncate text-sm font-semibold ${s.text}`,children:e.seed})]}),t.jsx(hn,{text:String(e.seed),variant:r})]})]})]}),e.upscaling&&t.jsxs("section",{className:"space-y-2",children:[t.jsx("h4",{className:`text-xs font-bold uppercase tracking-wide ${s.heading}`,children:"Upscaling"}),e.upscaling.model&&t.jsx(pt,{label:"Upscaler",resource:e.upscaling.model,variant:r}),t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsx(de,{label:"Scale",value:e.upscaling.factor!=null?`${e.upscaling.factor}×`:null,variant:r}),t.jsx(de,{label:"Method",value:e.upscaling.method,variant:r}),t.jsx(de,{label:"Denoise",value:e.upscaling.denoise,variant:r})]})]}),e.refinement&&t.jsxs("section",{className:"space-y-2",children:[t.jsx("h4",{className:`text-xs font-bold uppercase tracking-wide ${s.heading}`,children:"Refinement"}),e.refinement.model&&t.jsx(pt,{label:"Refiner model",resource:e.refinement.model,variant:r}),t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsx(de,{label:"Method",value:e.refinement.method,variant:r}),t.jsx(de,{label:"Control",value:e.refinement.controlPercentage!=null?`${e.refinement.controlPercentage}%`:null,variant:r}),t.jsx(de,{label:"Steps",value:e.refinement.steps,variant:r}),t.jsx(de,{label:"CFG",value:e.refinement.cfgScale,variant:r}),t.jsx(de,{label:"Sampler",value:e.refinement.sampler,variant:r}),t.jsx(de,{label:"Scheduler",value:e.refinement.scheduler,variant:r})]})]})]})}function hl({preset:e,loraId:r,embedded:s=!1}
116){const n=String(e||"feedback").trim().toLowerCase(),o=n==="prompt_suggestion",i=n==="contact",a=n==="commission",d=vr(),c=`kurutai:form-draft:${n}:${String(r||"general")}`,[f,m]=l.useState(null),[x,h]=l.useState(""),[u,p]=l.useState(""),[g,k]=l.useState(""),[N,A]=l.useState(""),[_,P]=l.useState(""),[E,w]=l.useState(""),[C,j]=l.useState("any"),[H,$]=l.useState(["full","partial"]),[T,F]=l.useState('"any"'),[z,W]=l.useState(["16:9"]),[G,K]=l.useState(!1),[q,D]=l.useState(!1),[Y,se]=l.useState(!1),[Z,fe]=l.useState(""),[J,ae]=l.useState(null),[le,pe]=l.useState(!1),[b,I]=l.useState(""),[y,R]=l.useState("info"),[L,M]=l.useState(0),[U,V]=l.useState(()=>Date.now()),[X,ce]=l.useState(""),[me,be]=l.useState(()=>ve(n)),Q=l.useRef(""),oe=l.useRef(!1),te=l.useRef(""),Ce=l.useRef(!1),we=JSON.stringify({subject:x,message:u,contact:g,focusCategoryKey:N,poseName:_,posePrompt:E,expressionCategory:C,clothingLevels:H,legwearMode:T,resolutions:z,requiresPartner:G,hasFeetFocus:q,hasHardcodedClothing:Y,notes:Z});l.useEffect(()=>{if(Q.current===c)return;Q.current=c,oe.current=!0;const S=wr(c,{subject:"",message:"",contact:"",focusCategoryKey:"",poseName:"",posePrompt:"",expressionCategory:"any",clothingLevels:["full","partial"],legwearMode:'"any"',resolutions:["16:9"],requiresPartner:!1,hasFeetFocus:!1,hasHardcodedClothing:!1,notes:"",submissionId:ve(n)});h(S.subject),p(S.message),k(S.contact),A(S.focusCategoryKey),P(S.poseName),w(S.posePrompt),j(S.expressionCategory),$(S.clothingLevels),F(S.legwearMode),W(S.resolutions),K(S.requiresPartner),D(S.hasFeetFocus),se(S.hasHardcodedClothing),fe(S.notes),be(S.submissionId)},[c,n]),l.useEffect(()=>{if(Q.current===c){if(oe.current){oe.current=!1;return}if(Ce.current){if(te.current===we)return;Ce.current=!1}if(te.current&&te.current!==we){te.current="",be(ve(n));return}kr(c,{...JSON.parse(we),submissionId:me})}},[c,we,n,me]),l.useEffect(()=>{if(L<=Date.now())return;const S=window.setInterval(()=>V(Date.now()),1e3);return()=>window.clearInterval(S)},[L]);const ye=Math.max(0,Math.ceil((L-U)/1e3)),Ie=S=>`You're too fast! My bot protection has been triggered, please give my PC ${S}s to breathe a bit and then go wild again!`;l.useEffect(()=>{Wn().then(ae).catch(()=>ae(null))},[d]),l.useEffect(()=>{r&&qn(r).then(m).catch(()=>m(null))},[r,d]),l.useEffect(()=>{h(o?S=>S||"Prompt suggestion":i?S=>S||"Contact":a?S=>S||"Commission Inquiry":S=>S||"Feedback")},[o,i,a]);const Vt=l.useMemo(()=>o?"Suggest Prompt":i?"Contact":a?"Commission Inquiry":"Feedback",[o,i,a]),Ue=(S,he)=>S.includes(he)?S.filter(Kt=>Kt!==he):[...S,he],Ye=async()=>{if(ye>0){R("error"),I(Ie(ye));return}if(!x.trim()||!u.trim()){R("error"),I("Please fill subject and message.");return}if(o&&(!N||!_.trim()||!E.trim()||H.length===0||z.length===0)){R("error"),I("Please fill all required prompt fields.");return}pe(!0),I(""),te.current=we;try{await Vn({loraId:r||null,preset:o?"prompt_suggestion":i?"contact":a?"commission":"feedback",category:o?"prompt_suggestion":i?"contact":a?"commission":"feedback",subject:x.trim(),message:u.trim(),contact:g.trim(),pageUrl:window.location.href,website:X,submissionId:me,metadata:o?{source:"external_prompt_form",focusCategoryKey:N,poseName:_.trim(),posePrompt:E.trim(),expressionCategory:C,clothingLevels:H,legwearMode:T,resolutions:z,requiresPartner:G,hasFeetFocus:q,hasHardcodedClothing:Y,notes:Z.trim()}:{source:i?"external_contact_form":a?"external_commission_form":"external_feedback_form"}}),R("success"),I("Thanks, sent successfully."),Ce.current=!0,Lt(c),be(ve(n))}catch(S){if(S instanceof Kn&&S.status===429){const he=Math.max(1,Number(S.retryAfterSeconds||20));M(Date.now()+he*1e3),V(Date.now()),R("error"),I(Ie(he))}else R("error"),I(S instanceof Error?S.message:"Failed to send form.")}finally{pe(!1)}};return t.jsx("div",{className:`${s?"bg-transparent":"min-h-screen bg-gradient-to-br from-gray-50 to-gray-100 dark:from-gray-950 dark:to-gray-900"}`,children:t.jsx("main",{className:`${s?"w-full px-0 py-0":"mx-auto max-w-3xl px-4 py-10"}`,children:t.jsxs("div",{className:"rounded-lg bg-white p-6 shadow-sm dark:bg-gray-900",children:[t.jsx("h1",{className:"text-2xl font-semibold text-gray-900 dark:text-gray-100",children:Vt}),f&&t.jsxs("p",{className:"mt-1 text-sm text-gray-600 dark:text-gray-300",children:["For: ",t.jsx("span",{className:"font-semibold",children:qe(f.name)})," (ID ",f.id,")"]}),o?t.jsxs("div",{className:"mt-3 rounded border border-amber-200 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dar
116k:text-amber-200",children:[t.jsx("p",{className:"font-semibold",children:"Why these fields matter"}),t.jsx("p",{className:"mt-1",children:"This structure helps implement your pose much faster and fit it for different clothing setups. The prompt system can adapt related tags automatically (for clothing, legwear, and mapped conflicts), so detailed input here is extremely helpful."}),t.jsx("p",{className:"mt-2",children:"Not every suggestion can be implemented. Very obscure, unsafe, or legally problematic requests may be declined."})]}):i?t.jsx("div",{className:"mt-3 rounded border border-teal-200 bg-teal-50 p-3 text-sm text-teal-900 dark:border-teal-700 dark:bg-teal-950 dark:text-teal-200",children:"Use this form for direct questions, business contact, or collaboration topics."}):a?t.jsx("div",{className:"mt-3 rounded border border-orange-200 bg-orange-50 p-3 text-sm text-orange-900 dark:border-orange-700 dark:bg-orange-950 dark:text-orange-200",children:"Use this form for commission-specific discussion: project type, timeline, budget range, and special requirements."}):t.jsx("div",{className:"mt-3 rounded border border-yellow-200 bg-yellow-50 p-3 text-sm text-yellow-900 dark:border-yellow-700 dark:bg-yellow-950 dark:text-yellow-200",children:"Feedback and questions are welcome. Clear context and examples help a lot."}),t.jsxs("div",{className:"mt-4 space-y-3",children:[t.jsx("input",{type:"text",value:X,onChange:S=>ce(S.target.value),tabIndex:-1,autoComplete:"off",className:"hidden","aria-hidden":"true"}),t.jsxs("label",{className:"block text-sm text-gray-700 dark:text-gray-200",children:["Subject *",t.jsx("input",{type:"text",className:"mt-1 w-full rounded border border-gray-300 bg-white px-2 py-1 text-sm dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",value:x,onChange:S=>h(S.target.value)})]}),t.jsxs("label",{className:"block text-sm text-gray-700 dark:text-gray-200",children:["Message *",t.jsx("textarea",{className:"mt-1 h-28 w-full rounded border border-gray-300 bg-white px-2 py-1 text-sm dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",value:u,onChange:S=>p(S.target.value)})]}),t.jsxs("label",{className:"block text-sm text-gray-700 dark:text-gray-200",children:["Contact (optional)",t.jsx("input",{type:"text",className:"mt-1 w-full rounded border border-gray-300 bg-white px-2 py-1 text-sm dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",value:g,onChange:S=>k(S.target.value)})]})]}),o&&t.jsxs("div",{className:"mt-6 rounded border border-gray-200 p-4 dark:border-gray-700",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"Prompt Fields"}),t.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[t.jsxs("label",{className:"text-sm text-gray-700 dark:text-gray-200",children:["Focus Category *",t.jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:"High-level grouping (used in pose drilldown)."}),t.jsxs("select",{className:"mt-1 w-full rounded border border-gray-300 bg-white px-2 py-1 text-sm dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",value:N,onChange:S=>A(S.target.value),children:[t.jsx("option",{value:"",children:"Select..."}),((J==null?void 0:J.focusCategories)||[]).map(S=>t.jsx("option",{value:S.key,children:qe(S.name)},S.key))]})]}),t.jsxs("label",{className:"text-sm text-gray-700 dark:text-gray-200",children:["Expression Category *",t.jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:"Which expression pool should be used with this pose."}),t.jsxs("select",{className:"mt-1 w-full rounded border border-gray-300 bg-white px-2 py-1 text-sm dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",value:C,onChange:S=>j(S.target.value),children:[t.jsx("option",{value:"any",children:"any"}),t.jsx("option",{value:"embedded",children:"embedded"}),((J==null?void 0:J.expressionCategories)||[]).map(S=>t.jsx("option",{value:S,children:S},S))]})]})]}),t.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[t.jsxs("label",{className:"text-sm text-gray-700 dark:text-gray-200",children:["Pose Name *",t.jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:"Short human-readable title (used in dropdowns)."}),t.jsx("input",{type:"text",className:"mt-1 w-full rounded border border-gray-300 bg-white px-2 py-1 text-sm dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",value:_,onCh
116ange:S=>P(S.target.value)})]}),t.jsxs("label",{className:"text-sm text-gray-700 dark:text-gray-200",children:["Legwear Mode",t.jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:"Compatibility guard for outfits (for example barefoot only)."}),t.jsx("select",{className:"mt-1 w-full rounded border border-gray-300 bg-white px-2 py-1 text-sm dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",value:T,onChange:S=>F(S.target.value),children:((J==null?void 0:J.legwearModes)||['"any"','"none"','"barefoot_only"']).map(S=>t.jsx("option",{value:S,children:S},S))})]})]}),t.jsxs("label",{className:"mt-3 block text-sm text-gray-700 dark:text-gray-200",children:["Pose Prompt *",t.jsxs("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:["The actual prompt template. Placeholders like ","{CLOTHING_LEVEL}"," and ","{LEGWEAR}"," are supported."]}),t.jsx("textarea",{className:"mt-1 h-24 w-full rounded border border-gray-300 bg-white px-2 py-1 text-sm dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",value:E,onChange:S=>w(S.target.value)})]}),t.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:"Clothing Levels *"}),t.jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:"Which clothing states this pose should support."}),t.jsx("div",{className:"mt-1 flex flex-wrap gap-2",children:((J==null?void 0:J.clothingLevels)||["full","partial","nude"]).map(S=>t.jsx("button",{type:"button",onClick:()=>$(he=>Ue(he,S)),className:`rounded border px-2 py-1 text-sm ${H.includes(S)?"border-purple-500 bg-purple-200 text-purple-900 dark:border-purple-400 dark:bg-purple-800 dark:text-purple-100":"border-gray-300 bg-white text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200"}`,children:S},S))})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:"Resolutions *"}),t.jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:"Aspect ratios this pose works well with."}),t.jsx("div",{className:"mt-1 flex flex-wrap gap-2",children:((J==null?void 0:J.resolutions)||["16:9","1:1","9:16"]).map(S=>t.jsx("button",{type:"button",onClick:()=>W(he=>Ue(he,S)),className:`rounded border px-2 py-1 text-sm ${z.includes(S)?"border-blue-500 bg-blue-200 text-blue-900 dark:border-blue-400 dark:bg-blue-800 dark:text-blue-100":"border-gray-300 bg-white text-gray-700 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200"}`,children:S},S))})]})]}),t.jsxs("div",{className:"mt-3 grid gap-2 md:grid-cols-3",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-200",children:[t.jsx("input",{type:"checkbox",checked:G,onChange:S=>K(S.target.checked)}),"Requires Partner"]}),t.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-200",children:[t.jsx("input",{type:"checkbox",checked:q,onChange:S=>D(S.target.checked)}),"Feet Focus"]}),t.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-200",children:[t.jsx("input",{type:"checkbox",checked:Y,onChange:S=>se(S.target.checked)}),"Hardcoded Clothing"]})]}),t.jsxs("label",{className:"mt-3 block text-sm text-gray-700 dark:text-gray-200",children:["Notes",t.jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:"Optional implementation hints, edge-cases, or references."}),t.jsx("textarea",{className:"mt-1 h-20 w-full rounded border border-gray-300 bg-white px-2 py-1 text-sm dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",value:Z,onChange:S=>fe(S.target.value)})]})]}),b&&y==="success"&&t.jsx("div",{className:"mt-4 rounded-lg border-2 border-emerald-300 bg-emerald-50 px-4 py-3 text-base font-semibold text-emerald-800 dark:border-emerald-600 dark:bg-emerald-950 dark:text-emerald-200",children:"Submission received successfully. Thank you."}),b&&y==="error"&&t.jsx("div",{className:"mt-4 rounded-lg border border-red-300 bg-red-50 px-4 py-3 text-sm font-semibold text-red-800 dark:border-red-700 dark:bg-red-950 dark:text-red-200",children:b}),t.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[t.jsx("button",{type:"button",onClick:Ye,disabled:le||ye>0,className:"rounded bg-purple-600 px-4 py-2 text-sm font-semibold text-white hover:bg-purple-700 disabled:cursor-not-allowed disabled:bg-gray-400",children:le?"Sending...":ye>0?`Submit (${ye}s)`:"Submit"}),ye>0&&t.jsxs("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:["Next submission available in ",ye,"s."]}),b&&y==="info"&&t.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:b})]})]})})})}const xl="https://www.fiverr.com/s/EgBq329";function gl(e,r){const s=window.location.origin+window.location.pathname,n=String(e||s).trim()||s;try{const o=new URL(n,window.location.origin);return o.search=r,o.hash="",o.toString()}catch{return`${s}${r}`}}function bl(e,r){return gl(e,`?form=${r}`)}function sr(e,r){const s=window.location.origin,n=String(e||s).trim()||s;try{const o=new URL(n,window.location.origin);return o.pathname=`/order/${r}`,o.search="",o.hash="",o.toString()}catch{return`/order/${r}`}}function ps(){const e=window.location.pathname.replace(/\/+$/,""),r=e.startsWith("/order/")?decode
116URIComponent(e.slice(7)):"",s=new URLSearchParams(window.location.search).get("order")||"",n=r||s;return n==="paypal_lora"||n==="paypal_imageset"?n:null}function nr(){return new URLSearchParams(window.location.search).get("form")==="commission"}function hs({className:e=""}){return t.jsx("img",{src:"/paypal-monogram.png",alt:"",className:`${e} object-contain`,loading:"lazy",decoding:"async"})}function St({href:e,title:r,badge:s,description:n,labels:o=[],icon:i,target:a,onSelect:d,onTrack:c}){const f=t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex min-w-0 gap-2 md:gap-3",children:[t.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-white/10 bg-slate-950 text-emerald-200 group-hover:border-emerald-300/45 md:h-11 md:w-11",children:t.jsx(i,{className:"h-4 w-4 md:h-5 md:w-5"})}),t.jsxs("span",{className:"min-w-0",children:[t.jsxs("span",{className:"flex flex-wrap gap-1.5",children:[t.jsx("span",{className:"inline-flex rounded-md bg-emerald-300 px-2 py-1 text-xs font-black uppercase tracking-normal text-emerald-950",children:s}),o.map(x=>{const h=x.tone||"positive",u=h==="negative"?"border-rose-300/35 bg-rose-300/[0.1] text-rose-100":h==="neutral"?"border-slate-300/25 bg-white/[0.06] text-slate-200":"border-emerald-300/35 bg-emerald-300/[0.1] text-emerald-100";return t.jsx("span",{className:`inline-flex rounded-md border px-2 py-1 text-xs font-black ${u}`,children:x.text},`${r}-${x.text}`)})]}),t.jsx("span",{className:"mt-1.5 block text-sm font-black text-white md:mt-2 md:text-base",children:r}),t.jsx("span",{className:"mt-1 block text-xs leading-5 text-slate-300 md:text-sm md:leading-6",children:n})]})]})}),m="group block rounded-lg border border-white/10 bg-white/[0.045] p-3 transition hover:border-emerald-300/45 hover:bg-white/[0.075] md:p-4";return d?t.jsx("button",{type:"button",onClick:()=>{c(a),d()},className:`${m} w-full text-left`,children:f}):t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:()=>c(a),className:m,children:f})}function yl({onClose:e,baseUrl:r,source:s="commission_options_modal"}){const n=bl(r,"commission"),o=sr(r,"paypal_lora"),i=sr(r,"paypal_imageset"),[a,d]=l.useState(()=>typeof window>"u"?null:ps()),[c,f]=l.useState(()=>typeof window>"u"?!1:nr()),m=p=>{ne("commission_click",{metadata:{target:p,source:s}})},x=p=>{d(p),f(!1);const g=sr(r,p);try{window.history.pushState({commissionView:"checkout",order:p},"",g)}catch{}},h=()=>{d(null),f(!0);try{window.history.pushState({commissionView:"inquiry"},"","/order?form=commission")}catch{}},u=()=>{var p,g;if(window.location.pathname.replace(/\/+$/,"").startsWith("/order/")&&((p=window.history.state)==null?void 0:p.commissionView)==="checkout"||nr()&&((g=window.history.state)==null?void 0:g.commissionView)==="inquiry"){window.history.back();return}d(null),f(!1);try{window.history.replaceState({commissionView:"options"},"","/order")}catch{}};return l.useEffect(()=>{const p=()=>{d(ps()),f(nr())};return window.addEventListener("popstate",p),()=>window.removeEventListener("popstate",p)},[]),t.jsx("div",{className:"fixed inset-0 z-[110] flex items-center justify-center bg-black/75 p-2 md:p-4",onClick:e,children:t.jsxs("div",{className:"w-full max-w-7xl overflow-hidden rounded-xl border border-white/10 bg-slate-950 text-white shadow-2xl",onClick:p=>p.stopPropagation(),children:[t.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-white/10 px-3 py-3 md:px-5 md:py-5",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-emerald-300 px-2 py-1 text-xs font-black uppercase tracking-normal text-emerald-950",children:[t.jsx(Cs,{className:"h-3.5 w-3.5"}),"Commission menu"]}),t.jsx("h4",{className:"mt-2 text-lg font-black leading-tight text-white md:mt-3 md:text-2xl",children:a?"Complete your commission checkout":c?"Send a custom commission inquiry":"Choose the best way to order"}),!a&&!c&&t.jsx("p",{className:"mt-1 hidden text-sm leading-6 text-slate-300 sm:block md:mt-2",children:"Direct PayPal orders are the cleanest checkout path: no extra platform fees, PayPal buyer protection included, and the same private progress page after payment."})]}),t.jsx("button",{type:"button",onClick:e,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-white/10 bg-white/[0.06] text-slate-200 hover:bg-white/[0.1]","aria-label":"Close commission options",children:t.jsx(We,{size:18})})]}),a?t.jsx("div",{className:"max-h-[84vh] overflow-y-auto bg-[#f6f7fb] p-2 md:max-h-[76vh] md:p-
1165 dark:bg-[#090d18]",children:t.jsx(Ja,{order:a,embedded:!0,onClose:u})}):c?t.jsxs("div",{className:"max-h-[84vh] overflow-y-auto bg-gray-50 p-3 md:max-h-[76vh] md:p-5 dark:bg-gray-950",children:[t.jsxs("button",{type:"button",onClick:u,className:"mb-4 inline-flex items-center gap-2 text-sm font-semibold text-slate-600 hover:text-slate-950 dark:text-slate-300 dark:hover:text-white",children:[t.jsx(lr,{size:16}),"Back to options"]}),t.jsx(hl,{preset:"commission",embedded:!0})]}):t.jsxs("div",{className:"max-h-[84vh] space-y-2 overflow-y-auto p-3 md:max-h-none md:space-y-3 md:p-5",children:[t.jsx(St,{href:o,title:"PayPal LoRA Commission",badge:"Best value",description:"The cleanest way to order a custom character LoRA with optional outfits, private model delivery, or an image-set bundle.",labels:[{text:"No platform fees"},{text:"PayPal buyer protection"},{text:"Live progress page"}],icon:hs,target:"paypal_lora",onSelect:()=>x("paypal_lora"),onTrack:m}),t.jsx(St,{href:i,title:"PayPal Image-Set Commission",badge:"Direct order",description:"Get a focused custom image set for a character, outfit, mood, or theme without ordering a full LoRA.",labels:[{text:"No platform fees"},{text:"PayPal buyer protection"},{text:"Custom poses and outfits"}],icon:hs,target:"paypal_imageset",onSelect:()=>x("paypal_imageset"),onTrack:m}),t.jsx(St,{href:xl,title:"Fiverr Commission",badge:"Platform order",description:"Use Fiverr if you prefer a marketplace order flow with platform messages, support, and Fiverr's built-in order handling.",labels:[{text:"Fiverr protection"},{text:"Marketplace support"},{text:"Platform fees",tone:"negative"}],icon:Da,target:"fiverr",onTrack:m}),t.jsx(St,{href:n,title:"Custom Inquiry",badge:"Ask first",description:"Send details first when the idea needs a custom quote, unusual scope, special references, or a payment method that should be discussed before payment.",labels:[{text:"More payment options"},{text:"Custom quote"}],icon:yr,target:"commission_inquiry_form",onSelect:h,onTrack:m})]}),!a&&t.jsx("div",{className:"border-t border-white/10 px-5 py-4",children:t.jsxs("p",{className:"flex gap-2 text-xs leading-5 text-slate-400",children:[t.jsx(He,{className:"mt-0.5 h-4 w-4 shrink-0 text-emerald-200"}),"PayPal orders still include buyer protection. Fiverr remains available if you prefer a marketplace checkout."]})})]})})}function vl(){const e=window.location.pathname.match(/^\/p\/([^/?#]+)/);return decodeURIComponent((e==null?void 0:e[1])||"")}function wl(){const e=new URLSearchParams(window.location.search);return["no_track","admin_view","local_admin"].some(r=>{const s=String(e.get(r)||"").trim().toLowerCase();return s==="1"||s==="true"||s==="yes"||s==="on"})}function ar(e){return`kurutai_private_page_client_name:${e}`}function xn(e){return`kurutai_private_page_seen_messages:${e}`}function gn(e){return`kurutai_private_page_generation_details_open:${e}`}function kl(e){try{return window.sessionStorage.getItem(gn(e))==="1"}catch{return!1}}function jl(e){try{const r=window.localStorage.getItem(xn(e)),s=r?JSON.parse(r):[];return new Set(Array.isArray(s)?s.map(n=>Number(n)).filter(n=>Number.isFinite(n)&&n>0):[])}catch{return new Set}}function Pt(e,r){try{window.localStorage.setItem(xn(e),JSON.stringify(Array.from(r).slice(-500)))}catch{}}function At(e){return Qn(e,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})||String(e||"").trim()}function Nl(e){return{progress:"Commission Progress",upload:"Upload Intake",custom:"Private Commission Page"}[String(e||"").toLowerCase()]||"Private Portal"}const bn=["style_gallery","sfw_outfit","outfit_reference","sfw_common","nsfw_images","style_comparison","epoch_comparison","model_file","other_image","other_file"],or=("https://lora.nudemuse.online".trim()||"https://lora.nudemuse.online").replace(/\/+$/,"")+"/",Cl=[{key:"created",label:"Commission Created",events:["lora_created","style_created"],current:"The commission is queued and waiting to begin.",upcoming:"Work has to start."},{key:"outfits",label:"Outfits Defined",events:["lora_outfits_defined","style_outfits_defined"],current:"Images are currently being sorted into outfits.",upcoming:"Images have to be sorted into outfits."},{key:"tagged",label:"Tagged",events:["lora_tagged","style_tagged"],current:"Image tags are currently being cleaned up.",upcoming:"Image tags have to be reviewed and assigned to outfits/base prompts."},{key:"prompts",label:"Prompts Defined",events:["lora_prompts_defined","style_prompts_defined"],current:"Training prompts are currently being prepared.",upcoming:"Tags have to be selected."},{key:"training-started",label:"Training Started",events:["lora_training_started","style_training_started"],current:"The LoRA is currently being trained.",upcoming:"Training has to start."},{key:"training-complete",label:"Training Complete",events:["lora_training_complete","style_training_complete"],current:"The trained model is currently being evaluated.",upcoming:"Training has to finish."},{key:"previews",label:"Preview Images Prepared",events:["lora_preview_images_prepared","style_preview_images_prepared"],current:"Preview images and delivery files are currently being prepared.",upcoming:"Preview images have to be prepared."}];function Sl(e,r){const s=!!e.targetIsPrivate,n=String(e.commissionApproval||"").trim().toLowerCase(),o={key:"delivery",label:s?"Delivered Privately":"Scheduled / Online",events:s?["lora_online","style_online"]:["lora_scheduled","style_scheduled","lora_online","style_online"],current:n==="changes_requested"?"Your requested changes are currently being reviewed.":e.approvalEnabled&&n!=="approved"?"The LoRA is ready for your review and approval.":s?"The approved LoRA is currently being prepared for private delivery.":"The model is currently being prepared for publication.",upcoming:s?"The LoRA has to be approved and delivered privately.":"The model has to be scheduled."},i=[...Cl,o],a=i.map(p=>r.find(g=>p.events.includes(String(g.eventName||"")))||null),d=String(e.targetStatus||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),c={future_goal:"created",commission_requested:"created",outfits_defined:"outfits",tagged:"tagged",prompts_defined:"prompts",in_training:"training-started",training_done:"training-complete",images_ready:"previews",on_hold:"previews",onhold:"previews"},f=d==="online"||d==="reuploaded",m=i.findIndex(p=>p.key===c[d]),x=a.reduce((p,g,k)=>g?Math.max(p,k):p,0),h=f?i.length-1:m>=0?m:x,u=f?-1:Math.min(h+1,i.length-1);return i.map((p,g)=>{const k=a[g],N=g<=h?"completed":g===u?"next":"upcoming";return{key:p.key,label:k&&!s&&g===i.length-1?k.label:p.label,message:N==="completed"?s&&g===i.length-1?"The LoRA has been delivered privately.":String((k==null?void 0:k.message)||""):p.upcoming,completedAt:N==="completed"?String((k==null?void 0:k.createdAt)||""):"",state:N}})}function yn(e){return String((e==null?void 0:e.linkedLoraIds)||"").split(/[\s,]+/).map(r=>
116r.trim()).filter(Boolean)}function ue(e){return yn(e)[0]||void 0}function Se(e,r){const s=yn(e);return{route:"private_page",pageKind:"private_page",privatePageId:(e==null?void 0:e.id)||0,templateKey:(e==null?void 0:e.templateKey)||"",status:(e==null?void 0:e.status)||"",title:(e==null?void 0:e.title)||"",linkedLoraIds:s,commissionUser:(e==null?void 0:e.commissionUser)||"",clientLabel:(e==null?void 0:e.clientLabel)||"",progressPercent:Number((e==null?void 0:e.progressPercent)||0),approvalEnabled:!!(e!=null&&e.approvalEnabled),commissionApproval:(e==null?void 0:e.commissionApproval)||"",targetDeliveryState:(e==null?void 0:e.targetDeliveryState)||"",...r}}function ir(e,r,s){return Se(e,{assetId:r.id,assetKind:r.kind,assetCategory:r.assetCategory||"",assetRating:r.rating||"",isNsfw:!!r.isNsfw,displayName:r.displayName||"",...s})}function Pl(e){try{const r=new URL(e,window.location.origin);return String(r.searchParams.get("id")||"").trim()}catch{const r=String(e||"").match(/[?&]id=([^&#]+)/);return r?decodeURIComponent(r[1]):""}}function El(e,r){return String(e.targetName||"").localeCompare(String(r.targetName||""))}function vn(e){return e.categoryLabel||e.assetCategory||(e.kind==="image"?"Images":"Files")}function Al({asset:e,onDownload:r}){const s=e.kind==="image";return t.jsx("div",{className:"rounded-lg border border-white/12 bg-white/[0.04] p-3",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-white/10 bg-black/20 text-cyan-200",children:s?t.jsx(js,{size:18}):t.jsx(yr,{size:18})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"break-words text-sm font-semibold text-white",children:e.displayName}),e.description&&t.jsx("div",{className:"mt-1 text-xs leading-5 text-slate-300",children:e.description})]}),!s&&e.downloadUrl&&t.jsxs("a",{href:e.downloadUrl,target:e.kind==="text"?"_blank":void 0,rel:e.kind==="text"?"noreferrer":void 0,onClick:()=>r(e),className:"inline-flex h-9 shrink-0 items-center gap-2 rounded-md bg-cyan-300 px-3 text-xs font-bold text-slate-950 hover:bg-cyan-200",children:[t.jsx(st,{size:15}),"Download"]})]})})}function _l({asset:e,onDownload:r}){return t.jsxs("section",{className:"rounded-md border border-white/10 bg-black/20 p-4",children:[t.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[t.jsxs("h3",{className:"flex items-center gap-2 text-sm font-bold uppercase tracking-normal text-slate-200",children:[t.jsx(yr,{size:16}),"Usage Instructions"]}),e.downloadUrl&&t.jsxs("a",{href:e.downloadUrl,target:"_blank",rel:"noreferrer",onClick:()=>r(e),className:"inline-flex h-8 items-center gap-2 rounded-md bg-cyan-300 px-3 text-xs font-bold text-slate-950 hover:bg-cyan-200",children:[t.jsx(st,{size:14}),"Open"]})]}),e.textContent?t.jsx("pre",{className:"max-h-[520px] overflow-auto whitespace-pre-wrap break-words rounded-md bg-slate-950/60 p-4 text-sm leading-6 text-slate-100",children:e.textContent}):t.jsx("div",{className:"text-sm text-slate-400",children:"Usage instructions are attached as a file."})]})}function Rl({asset:e,unlocked:r,onUnlock:s,onOpen:n}){const o=!!e.isNsfw;return o&&!r?t.jsxs("button",{type:"button",onClick:s,className:"group flex aspect-[3/4] w-full flex-col items-center justify-center rounded-md border border-red-300/25 bg-red-950/20 p-4 text-center hover:border-red-200/60",children:[t.jsx(ur,{className:"mb-3 text-red-200",size:28}),t.jsx("span",{className:"text-sm font-bold text-white",children:"NSFW image"}),t.jsx("span",{className:"mt-2 text-xs leading-5 text-red-100/80",children:"Click to confirm and view"})]}):t.jsxs("button",{type:"button",onClick:n,className:"group overflow-hidden rounded-md border border-white/10 bg-black/25 text-left hover:border-cyan-200/60",children:[(e.previewUrl||e.downloadUrl)&&t.jsx("img",{src:e.previewUrl||e.downloadUrl,alt:e.displayName,className:"aspect-[3/4] w-full object-cover",loading:"lazy"}),t.jsxs("span",{className:"flex min-h-12 items-start gap-2 px-3 py-2 text-xs leading-5 text-slate-300",children:[t.jsx(dr,{className:"mt-0.5 shrink-0 opacity-70",size:14}),o&&t.jsx(ur,{className:"mt-0.5 shrink-0 text-red-200",size:14}),t.jsx("span",{className:"break-words",children:e.displayName})]})]})}function Tl({details:e,loading:r,error:s,onClose:n}){return t.jsxs("aside",{onClick:o=>o.stopPropagation(),className:"absolute inset-x-0 bottom-0 z-30 flex max-h-[78vh] flex-col border-t border-white/15 bg-slate-950/98 shadow-2xl backdrop-blur-xl lg:static lg:h-full lg:max-h-none lg:w-[420px] lg:shrink-0 lg:border-l lg:border-t-0",children:[t.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-white/10 px-4",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm font-bold text-white",children:[t.jsx(Ns,{size:17,className:"text-cyan-200"}),"Generation details"]}
116),t.jsx("button",{type:"button",onClick:n,"aria-label":"Close generation details",className:"rounded-md p-2 text-slate-300 hover:bg-white/10 hover:text-white",children:t.jsx(We,{size:18})})]}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:[r&&t.jsxs("div",{className:"flex min-h-48 items-center justify-center text-sm text-slate-400",children:[t.jsx(Tt,{size:17,className:"mr-2 animate-spin"}),"Loading generation details…"]}),!r&&s&&t.jsx("div",{className:"rounded-lg border border-red-300/20 bg-red-950/25 p-4 text-sm leading-6 text-red-200",children:s}),!r&&e&&t.jsx(pl,{details:e,variant:"dark"})]})]})}function Ll({asset:e,images:r,unlockedNsfw:s,detailsOpen:n,detailsCache:o,detailsLoading:i,detailsError:a,onDetailsOpenChange:d,onAssetChange:c,onUnlockNsfw:f,onClose:m,onDownload:x}){const h=o[e.id]||null,u=bn.map(w=>({key:w,items:r.filter(C=>(C.assetCategory||"other_image")===w)})).filter(w=>w.items.length>0),p=e.assetCategory||"other_image",g=u.find(w=>w.key===p)||u[0],k=(g==null?void 0:g.items)||[e],N=k.findIndex(w=>w.id===e.id),A=k.length>1&&N>=0,_=!e.isNsfw||s.has(e.id),P=_&&n&&!!e.hasGenerationDetails,E=l.useCallback(w=>{if(!A)return;const C=(N+w+k.length)%k.length;c(k[C])},[A,k,N,c]);return l.useEffect(()=>{const w=document.body.style.overflow;document.body.style.overflow="hidden";const C=j=>{j.key==="Escape"?P?d(!1):m():j.key==="ArrowLeft"?E(-1):j.key==="ArrowRight"&&E(1)};return window.addEventListener("keydown",C),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",C)}},[E,m,d,P]),t.jsx("div",{className:"fixed inset-0 z-50 bg-black/95",role:"dialog","aria-modal":"true","aria-label":e.displayName,onClick:m,children:t.jsxs("div",{className:"relative flex h-[100dvh] min-h-0 w-full overflow-hidden",children:[t.jsxs("main",{className:"relative h-full min-h-0 min-w-0 flex-1 overflow-hidden",children:[t.jsx("button",{type:"button",onClick:m,"aria-label":"Close image",className:"absolute right-3 top-3 z-20 rounded-md bg-black/55 p-2.5 text-white hover:bg-white/15",children:t.jsx(We,{size:22})}),t.jsx("div",{className:"absolute inset-x-3 bottom-24 top-14 flex min-h-0 items-center justify-center sm:inset-x-14 lg:bottom-32 lg:top-5",children:t.jsxs("div",{className:"relative inline-flex max-h-full max-w-full items-center justify-center",onClick:w=>w.stopPropagation(),children:[_?t.jsx("img",{src:e.fullUrl||e.downloadUrl,alt:e.displayName,className:"block h-auto w-auto max-h-[calc(100dvh-9.5rem)] max-w-full object-contain lg:max-h-[calc(100dvh-9.25rem)]"}):t.jsxs("button",{type:"button",onClick:()=>f(e),className:"flex aspect-[3/4] max-h-[calc(100dvh-9.5rem)] max-w-full flex-col items-center justify-center rounded-xl border border-red-300/25 bg-red-950/25 p-8 text-center hover:border-red-200/60 hover:bg-red-950/35 lg:max-h-[calc(100dvh-9.25rem)]",children:[t.jsx(ur,{className:"mb-4 text-red-200",size:36}),t.jsx("span",{className:"text-base font-bold text-white",children:"NSFW image"}),t.jsx("span",{className:"mt-2 max-w-xs text-sm leading-6 text-red-100/80",children:"Click to confirm and view"})]}),A&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),E(-1)},"aria-label":"Previous image",className:"absolute left-2 top-1/2 z-20 -translate-y-1/2 rounded-full border border-white/15 bg-black/65 p-2.5 text-white shadow-lg hover:bg-black/85",children:t.jsx(ia,{size:25})}),t.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),E(1)},"aria-label":"Next image",className:"absolute right-2 top-1/2 z-20 -translate-y-1/2 rounded-full border border-white/15 bg-black/65 p-2.5 text-white shadow-lg hover:bg-black/85",children:t.jsx(ra,{size:25})})]})]})}),t.jsxs("div",{onClick:w=>w.stopPropagation(),className:"absolute inset-x-3 bottom-3 z-20 mx-auto flex max-w-xl items-center justify-between gap-2 rounded-xl border border-white/10 bg-black/75 p-2 shadow-xl backdrop-blur-md lg:bottom-5 lg:max-w-3xl lg:gap-4 lg:p-3",children:[t.jsxs("div",{className:"min-w-0 flex-1 px-1 lg:px-2",children:[t.jsx("label",{htmlFor:"private-lightbox-category",className:"mb-1 block text-[10px] font-bold uppercase tracking-wide text-slate-500 lg:text-xs",children:"Image category"}),t.jsx("select",{id:"private-lightbox-category","aria-label":"Image category",value:(g==null?void 0:g.key)||p,onChange:w=>{const C=u.find(j=>j.key===w.target.value);C!=null&&C.items[0]&&c(C.items[0])},className:"h-8 w-full min-w-0 rounded-md border border-white/12 bg-slate-900 px-2 text-xs font-semibold text-slate-100 outline-none focus:border-cyan-200/60 lg:h-11 lg:px-3 lg:text-sm",children:u.map(w=>t.jsxs("option",{value:w.key,children:[vn(w.items[0])," (",w.items.length,")"]},w.key))}),t.jsxs("div",{className:"mt-1 text-[10px] text-slate-400 lg:text-xs",children:["Image ",Math.max(1,N+1)," of ",k.length]})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[_&&e.downloadUrl&&t.jsxs("a",{href:e.downloadFileUrl||e.downloadUrl,download:!0,onClick:()=>x(e),className:"inline-flex h-9 items-center gap-1.5 rounded-md border border-white/12 bg-white/[0.07] px-3 text-xs font-bold text-white hover:bg-white/15 lg:h-11 lg:px-4 lg:text-sm",children:[t.jsx(st,{size:16}),t.jsx("span",{className:"hidden sm:inline",children:"Download"})]}
116),_&&e.hasGenerationDetails&&t.jsxs("button",{type:"button",onClick:()=>d(!n),className:`inline-flex h-9 items-center gap-1.5 rounded-md px-3 text-xs font-bold lg:h-11 lg:px-4 lg:text-sm ${P?"bg-cyan-200 text-slate-950":"bg-cyan-300 text-slate-950 hover:bg-cyan-200"}`,children:[t.jsx(Ns,{size:16}),t.jsx("span",{className:"hidden sm:inline",children:"Generation details"})]})]})]})]}),P&&t.jsx(Tl,{details:h,loading:i,error:a,onClose:()=>d(!1)})]})})}function Ol({links:e,onOpen:r}){if(!e.length)return null;const s=e.every(i=>String(i.targetType||"").toLowerCase()==="style")?"style":"character",n=s==="style"?"Style Card":"Character Card",o=s==="style"?"Try out different prompts with my pose generator. Use this link to open the style card.":"Try out different prompts with my pose generator. Use this link to open the character card.";return t.jsxs("section",{className:"rounded-md border border-cyan-200/20 bg-cyan-300/[0.06] p-4",children:[t.jsxs("h3",{className:"mb-2 flex items-center gap-2 text-sm font-bold uppercase tracking-normal text-slate-200",children:[t.jsx(dr,{size:16}),n]}),t.jsx("p",{className:"mb-3 text-sm leading-6 text-slate-300",children:o}),t.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((i,a)=>{const d=String(i.targetType||"").toLowerCase();return t.jsxs("a",{href:i.url,target:"_blank",rel:"noreferrer",onClick:()=>r(i,a),className:"inline-flex h-10 items-center gap-2 rounded-md bg-cyan-300 px-4 text-sm font-bold text-slate-950 hover:bg-cyan-200",children:[t.jsx(dr,{size:16}),"Open ",d==="style"?"style card":"card",e.length>1?` ${a+1}`:""]},i.url)})})]})}function Il({assets:e,loraCardLinks:r,packageDownloadUrl:s,unlockedNsfw:n,unlockNsfw:o,openImage:i,onAssetDownload:a,onCardOpen:d,onPackageDownload:c}){const f=e.filter(u=>u.kind==="image"),m=e.filter(u=>u.kind==="text"),x=e.filter(u=>u.kind!=="image"&&u.kind!=="text"),h=bn.map(u=>({key:u,items:f.filter(p=>(p.assetCategory||"other_image")===u)})).filter(u=>u.items.length>0);return t.jsxs("div",{className:"space-y-6",children:[h.map(u=>t.jsxs("section",{children:[t.jsxs("h3",{className:"mb-3 flex items-center gap-2 text-sm font-bold uppercase tracking-normal text-slate-200",children:[t.jsx(js,{size:16}),vn(u.items[0])]}),t.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3",children:u.items.map(p=>t.jsx(Rl,{asset:p,unlocked:n.has(p.id),onUnlock:()=>o(p),onOpen:()=>i(p)},p.id))})]},u.key)),m.map(u=>t.jsx(_l,{asset:u,onDownload:a},u.id)),t.jsx(Ol,{links:r,onOpen:d}),x.length>0&&t.jsxs("section",{children:[t.jsxs("h3",{className:"mb-3 flex items-center gap-2 text-sm font-bold uppercase tracking-normal text-slate-200",children:[t.jsx(st,{size:16}),"Files"]}),t.jsx("div",{className:"space-y-3",children:x.map(u=>t.jsx(Al,{asset:u,onDownload:a},u.id))})]}),s?t.jsx("section",{className:"rounded-md border border-emerald-200/25 bg-emerald-300/[0.08] p-4",children:t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[t.jsxs("div",{children:[t.jsxs("h3",{className:"flex items-center gap-2 text-sm font-bold uppercase tracking-normal text-slate-200",children:[t.jsx(st,{size:16}),"Complete Package"]}),t.jsx("p",{className:"mt-1 max-w-2xl text-sm leading-relaxed text-slate-300",children:"The ZIP archive is created automatically when you request it, so it may take a little while before the download starts."})]}),t.jsxs("a",{href:s,onClick:c,className:"inline-flex h-10 shrink-0 items-center justify-center gap-2 rounded-md bg-emerald-300 px-4 text-sm font-bold text-slate-950 hover:bg-emerald-200",children:[t.jsx(st,{size:16}),"Download zip"]})]})}):null]})}function rt(e){const r=Math.max(0,Number(e||0));if(r<1024)return`${r} B`;const s=["KB","MB","GB","TB"];let n=r/1024,o=s[0];for(let i=1;i<s.length&&n>=1024;i+=1)n/=1024,o=s[i];return`${n>=10?n.toFixed(0):n.toFixed(1)} ${o}`}async function Ml(e){const r=[];for(;;){const s=await new Promise((n,o)=>e.readEntries(n,o));if(!s.length)return r;r.push(...s)}}async function wn(e,r=""){if(e.isFile&&e.file){const s=await new Promise((n,o)=>e.file(n,o));
116return s.uploadRelativePath=[r,s.name].filter(Boolean).join("/"),[s]}if(e.isDirectory&&e.createReader){const s=[r,e.name].filter(Boolean).join("/"),n=await Ml(e.createReader());return(await Promise.all(n.map(i=>wn(i,s)))).flat()}return[]}function Dl({page:e,token:r,uploads:s,onUploadsChanged:n}){const o=vr(),i=l.useRef(null),a=l.useRef(null),d=l.useRef(""),c=l.useRef(""),f=l.useRef(new Map),m=l.useRef(null),[x,h]=l.useState([]),[u,p]=l.useState(!1),[g,k]=l.useState(!1),[N,A]=l.useState(!1),[_,P]=l.useState(""),[E,w]=l.useState(""),[C,j]=l.useState(0),[H,$]=l.useState(!1);l.useEffect(()=>{var y;(y=a.current)==null||y.setAttribute("webkitdirectory","")},[]);const T=l.useCallback(async()=>{if(document.visibilityState!=="visible"||m.current)return;const y=navigator.wakeLock;if(y)try{const R=await y.request("screen");m.current=R,A(!0),R.addEventListener("release",()=>{m.current===R&&(m.current=null),A(!1)})}catch{A(!1)}},[]);l.useEffect(()=>{if(!u){const R=m.current;m.current=null,A(!1),R&&!R.released&&R.release().catch(()=>{});return}T();const y=()=>{document.visibilityState==="visible"&&T()};return document.addEventListener("visibilitychange",y),()=>document.removeEventListener("visibilitychange",y)},[T,u]),l.useEffect(()=>()=>{const y=m.current;m.current=null,y&&!y.released&&y.release().catch(()=>{})},[]);const F=y=>{h(Array.from(y||[])),c.current=crypto.randomUUID(),P(""),w(""),j(0)},z=l.useMemo(()=>{const y=M=>`${String(M.relativePath||M.name||"").replace(/\\/g,"/").trim().toLowerCase()}\0${Number(M.size||0)}`,R=new Map;s.forEach(M=>{if(M.status!=="complete")return;const U=Date.parse(M.completedAt||M.createdAt||"");if(!Number.isFinite(U))return;const V=y(M);R.set(V,Math.max(R.get(V)||0,U))});const L=new Map;return s.forEach(M=>L.set(M.sessionId,[...L.get(M.sessionId)||[],M])),Array.from(L.entries()).map(([M,U])=>{const V=U.reduce((Q,oe)=>Q+Number(oe.size||0),0),X=U.filter(Q=>{if(Q.status==="complete")return!1;const oe=Date.parse(Q.createdAt||""),te=R.get(y(Q))||0;return!Number.isFinite(oe)||te<=oe}),ce=new Set(X.map(Q=>Q.id)),me=U.length-X.length,be=U.reduce((Q,oe)=>{const te=!ce.has(oe.id);return Q+(te?Number(oe.size||0):Math.min(Number(oe.receivedSize||0),Number(oe.size||0)))},0);return{sessionId:M,rows:U,retryRows:X,totalBytes:V,receivedBytes:be,resolvedFiles:me,partial:X.length>0}})},[s]),W=z.filter(y=>y.partial),G=l.useMemo(()=>s.filter(y=>y.status==="complete"),[s]),K=12,q=Math.max(0,G.length-K),D=H?G:G.slice(0,K),Y=async y=>{const R=Array.from(y.items||[]).map(L=>{const M=L.webkitGetAsEntry;return(M==null?void 0:M.call(L))||null}).filter(L=>!!L);if(!R.some(L=>L.isDirectory)){F(y.files);return}k(!0),w(""),P("Reading folder contents...");try{const M=(await Promise.all(R.map(U=>wn(U)))).flat();c.current=crypto.randomUUID(),h(M),j(0),P(M.length?`Found ${M.length}
116 files.`:"This folder contains no uploadable files.")}catch(L){w(L instanceof Error?L.message:"The folder contents could not be read."),P("")}finally{k(!1)}},se=Number(e.clientUploadMaxFiles||0),Z=Number(e.clientUploadMaxFileBytes||0),fe=Number(e.clientUploadMaxTotalBytes||0),J=String(e.clientUploadAllowedExtensions||"").trim(),ae=x.reduce((y,R)=>y+R.size,0),le=async(y,R,L)=>{p(!0),h(L),w(""),f.current.set(y,L);try{await sa(r,y,R,L,({uploadedBytes:U,totalBytes:V,completedFiles:X,totalFiles:ce,currentFile:me,concurrency:be})=>{j(V>0?Math.min(100,Math.round(U/V*100)):100),P(`Uploading ${me||"files"} — ${X}/${ce} complete — ${be} parallel`)});const M=await Kr(r);n(M.uploads||[]),f.current.delete(y),h([]),j(100),P("Upload complete. Your files were transferred successfully.")}catch(M){const U=await Kr(r).catch(()=>null);U&&n(U.uploads||[]),w(`${M instanceof Error?M.message:"Upload paused."} Press Retry to continue this partial upload.`),P("Upload paused.")}finally{p(!1)}};l.useEffect(()=>{if(o<=0||u)return;const y=W.find(L=>f.current.has(L.sessionId));if(!y)return;const R=f.current.get(y.sessionId);R!=null&&R.length&&le(y.sessionId,y.retryRows,R)},[o]);const pe=async()=>{if(!(!x.length||u)){p(!0),w(""),P("Preparing upload...");try{const y=c.current||crypto.randomUUID();c.current=y;const R=await na(r,x,y);n([...R.uploads,...s]),f.current.set(R.sessionId,x),await le(R.sessionId,R.uploads,x),c.current=""}
116catch(y){w(y instanceof Error?y.message:"Upload failed."),P(""),p(!1)}}},b=y=>{var U,V;if(u)return;const R=z.find(X=>X.sessionId===y);if(!R)return;const L=f.current.get(y);if(L!=null&&L.length){le(y,R.retryRows,L);return}d.current=y,R.retryRows.some(X=>String(X.relativePath||"").includes("/"))&&e.clientUploadFoldersEnabled?(U=a.current)==null||U.click():(V=i.current)==null||V.click()},I=y=>{const R=Array.from(y||[]),L=d.current;if(d.current="",L){const M=z.find(U=>U.sessionId===L);M&&R.length&&le(L,M.retryRows,R);return}F(y)};return t.jsxs("section",{className:"rounded-lg border border-cyan-200/20 bg-cyan-300/[0.05] p-5",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-cyan-200/20 bg-cyan-300/10 text-cyan-100",children:t.jsx(Jt,{size:19})}),t.jsxs("div",{children:[t.jsx("h2",{className:"text-base font-bold text-white",children:"Upload files to Kurut"}),t.jsx("p",{className:"mt-1 whitespace-pre-wrap text-sm leading-6 text-slate-300",children:e.clientUploadInstructions||"Upload the files requested for this private page."})]})]}),t.jsxs("div",{className:"mt-4 rounded-lg border border-dashed border-cyan-200/30 bg-black/20 p-5 text-center",onDragOver:y=>y.preventDefault(),onDrop:y=>{y.preventDefault(),Y(y.dataTransfer)},children:[t.jsx("div",{className:"text-sm text-slate-300",children:"Drop files here, or choose them below."}),t.jsxs("div",{className:"mt-3 flex flex-wrap justify-center gap-2",children:[t.jsxs("label",{className:"inline-flex h-10 cursor-pointer items-center gap-2 rounded-md bg-cyan-300 px-4 text-sm font-bold text-slate-950 hover:bg-cyan-200",children:[t.jsx(Jt,{size:16})," Choose files",t.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:y=>{I(y.target.files),y.currentTarget.value=""}})]}),e.clientUploadFoldersEnabled&&t.jsxs("label",{className:"inline-flex h-10 cursor-pointer items-center gap-2 rounded-md border border-cyan-200/35 px-4 text-sm font-bold text-cyan-100 hover:bg-cyan-300/10",children:[t.jsx(fa,{size:16})," Choose folder",t.jsx("input",{ref:a,type:"file",multiple:!0,className:"hidden",onChange:y=>{I(y.target.files),y.currentTarget.value=""}})]})]})]}),t.jsxs("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs text-slate-400",children:[t.jsxs("span",{children:["Files: ",se>0?`up to ${se} per upload`:"unlimited"]}),t.jsxs("span",{children:["Per file: ",Z>0?rt(Z):"unlimited"]}),t.jsxs("span",{children:["Total: ",fe>0?rt(fe):"unlimited"]}),t.jsxs("span",{children:["Types: ",J==="*"?"any":J||"none"]})]}),x.length>0&&t.jsxs("div",{className:"mt-4 rounded-md border border-white/10 bg-black/20 p-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[t.jsxs("span",{className:"font-semibold text-white",children:[x.length," file",x.length===1?"":"s"," selected"]}),t.jsx("span",{className:"text-slate-400",children:rt(ae)})]}),t.jsxs("div",{className:"mt-2 max-h-36 space-y-1 overflow-auto text-xs text-slate-400",children:[x.slice(0,30).map((y,R)=>t.jsx("div",{className:"truncate",children:y.webkitRelativePath||y.name},`${y.name}-${R}`)),x.length>30&&t.jsxs("div",{children:["...and ",x.length-30," more"]})]}),t.jsxs("button",{type:"button",onClick:pe,disabled:u||g,className:"mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-md bg-cyan-300 px-4 text-sm font-bold text-slate-950 hover:bg-cyan-200 disabled:cursor-not-allowed disabled:opacity-50",children:[u?t.jsx(Tt,{size:16,className:"animate-spin"}):t.jsx(Jt,{size:16}),u?`Uploading ${C}%`:"Start upload"]}),u&&t.jsx("div",{className:"mt-2 h-2 overflow-hidden rounded-full bg-white/10",children:t.jsx("div",{className:"h-full bg-cyan-300 transition-all",style:{width:`${C}%`}})}),u&&t.jsx("div",{className:"mt-2 text-center text-xs text-slate-400",children:N?"Screen wake lock active. Keep this page visible.":"Keep this page visible and the screen unlocked."})]}),_&&t.jsxs("div",{className:"mt-3 flex items-center gap-2 text-sm text-emerald-200",children:[C===100&&!u&&t.jsx(cr,{size:16}),_]}),E&&t.jsx("div",{className:"mt-3 text-sm text-red-300",children:E}),W.length>0&&t.jsxs("div",{className:"mt-5 border-t border-white/10 pt-4",children:[t.jsx("div",{className:"mb-2 text-xs font-bold uppercase tracking-normal text-amber-200",children:"Partial uploads"}),t.jsx("div",{className:"space-y-3",children:W.map(y=>{const R=y.totalBytes>0?Math.min(100,y.receivedBytes/y.totalBytes*100):0;return t.jsxs("div",{className:"rounded-md border border-amber-200/20 bg-amber-300/[0.06] p-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"text-sm font-semibold text-white",children:[y.resolvedFiles,"/",y.rows.length," files received"]}),t.jsxs("div",{className:"mt-1 text-xs text-slate-400",children:[rt(y.receivedBytes)," of ",rt(y.totalBytes)," — ",R.toFixed(1),"%"]})]}),t.jsxs("button",{type:"button",onClick:()=>b(y.sessionId),disabled:u,className:"inline-flex h-9 items-center gap-2 rounded-md bg-amber-200 px-3 text-xs font-bold text-slate-950 hover:bg-amber-100 disabled:cursor-not-allowed disabled:opacity-50",children:[t.jsx(Tt,{size:14})," Retry"]})]}),t.jsx("div",{className:"mt-2 h-2 overflow-hidden rounded-full bg-white/10",children:t.jsx("div",{className:"h-full bg-amber-200",style:{width:`${R}%`}})}),!f.current.has(y.sessionId)&&t.jsxs("div",{className:"mt-2 text-[11px] text-slate-500",children:["Retry will ask you to select the same ",y.rows.some(L=>String(L.relativePath||"").includes("/"))?"folder":"files"," again so the browser can restore access."]})]},y.sessionId)})})]}),G.length>0&&t.jsxs("div",{className:"mt-5 border-t border-white/10 pt-4",children:[t.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[t.jsx("div",{className:"text-xs font-bold uppercase tracking-normal text-slate-400",children:"Previously uploaded"}),t.jsxs("div",{className:"inline-flex items-center gap-1.5 text-xs font-semibold text-emerald-200",children:[t.jsx(cr,{size:14})," ",G.length," file",G.length===1?"":"s"," received successfully"]})]}),t.jsxs("div",{id:"private-completed-upload-list",className:"space-y-2",children:[D.map(y=>t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-white/10 bg-black/15 px-3 py-2 text-xs",children:[t.jsx("span",{className:"min-w-0 truncate text-slate-200",children:y.relativePath||y.name}),t.jsx("span",{className:"shrink-0 text-emerald-200",children:rt(y.size)})]},y.id)),q>0&&!H&&t.jsxs("button",{type:"button",onClick:()=>$(!0),"aria-expanded":"false","aria-controls":"private-completed-upload-list",className:"flex w-full items-center justify-center gap-1.5 rounded-md border border-cyan-200/20 bg-cyan-300/[0.06] px-3 py-2.5 text-xs font-bold text-cyan-100 hover:bg-cyan-300/10",children:[t.jsx(Rt,{size:14})," ... ",q," more successful upload",q===1?"":"s"]}),H&&q>0&&t.jsxs("button",{type:"button",onClick:()=>$(!1),"aria-expanded":"true","aria-controls":"private-completed-upload-list",className:"flex w-full items-center justify-center gap-1.5 rounded-md border border-white/10 px-3 py-2.5 text-xs font-semibold text-slate-300 hover:bg-white/[0.05]",children:[t.jsx(ca,{size:14})," Show fewer files"]})]})]})]})}function $l({msg:e}){const r=e.sender==="admin";return t.jsx("div",{className:`flex ${r?"justify-start":"justify-end"}`,children:t.jsxs("div",{className:`max-w-[82%] rounded-lg border px-3 py-2 ${r?"border-cyan-300/25 bg-cyan-300/10":"border-emerald-300/25 bg-emerald-300/10"}`,children:[t.jsxs("div",{className:"flex items-baseline gap-2 text-[11px] text-slate-300",children:[t.jsx("span",{className:"font-semibold text-white",children:e.authorName||(r?"KurutAI":"Client")}
116),t.jsx("span",{children:At(e.createdAt)})]}),t.jsx("div",{className:"mt-1 whitespace-pre-wrap break-words text-sm leading-6 text-slate-100",children:e.message})]})})}function Ql(){const e=l.useMemo(()=>vl(),[]),r=`kurutai:private-page-draft:${e}`,s=l.useMemo(()=>wr(r,{message:"",approvalNote:"",messageSubmissionId:"",approvalSubmissionId:""}),[r]),n=l.useRef(null),o=l.useRef(!1),i=l.useRef(new Set),[a,d]=l.useState(null),[c,f]=l.useState([]),[m,x]=l.useState([]),[h,u]=l.useState([]),[p,g]=l.useState([]),[k,N]=l.useState(!0),[A,_]=l.useState(""),[P,E]=l.useState(""),[w,C]=l.useState(s.message),[j,H]=l.useState(s.approvalNote),[$,T]=l.useState(()=>s.messageSubmissionId||ve("private-message")),[F,z]=l.useState(()=>s.approvalSubmissionId||ve("private-approval")),W=l.useRef(""),G=l.useRef(""),[K,q]=l.useState(""),[D,Y]=l.useState(!1),[se,Z]=l.useState(!1),[fe,J]=l.useState(()=>new Set),[ae,le]=l.useState(!1),[pe,b]=l.useState(!1),[I,y]=l.useState(!1),[R,L]=l.useState([]),[M,U]=l.useState(!1),[V,X]=l.useState(null),[ce,me]=l.useState(()=>kl(e)),[be,Q]=l.useState({}),[oe,te]=l.useState(!1),[Ce,we]=l.useState(!1),[ye,Ie]=l.useState(""),[Vt,Ue]=l.useState(()=>jl(e));l.useEffect(()=>{bs()},[]),l.useEffect(()=>{o.current=ae},[ae]),l.useEffect(()=>{a&&Zt("private_page_panels","state",{chatOpen:ae,commissionPopupOpen:pe,pageListOpen:I,generationDetailsOpen:ce,lightboxAssetId:(V==null?void 0:V.id)||0},{loraId:ue(a)})},[ae,pe,ce,V==null?void 0:V.id,a==null?void 0:a.id,I]),l.useEffect(()=>{W.current&&W.current!==w&&(W.current="",T(ve("private-message"))),G.current&&G.current!==j&&(G.current="",z(ve("private-approval"))),kr(r,{message:w,approvalNote:j,messageSubmissionId:$,approvalSubmissionId:F})},[j,F,w,$,r]),l.useEffect(()=>{if(!ae||!e)return;const v=window.setTimeout(()=>{Gn(e,w).catch(()=>{})},180);return()=>window.clearTimeout(v)},[ae,w,e]);const Ye=l.useCallback(v=>{if(u(v),o.current){const O=new Set(v.map(re=>re.id));Ue(O),Pt(e,O);const B=Math.max(0,...v.filter(re=>re.sender==="admin").map(re=>re.id));B>0&&qr(e,B).catch(()=>{})}},[e]),S=l.useCallback(async v=>{if(!(!e||!a))try{const O=await Yn(e,{signal:v});Ye(O.messages||[])}catch{}},[Ye,a,e]),he=l.useCallback(async(v=!1,O)=>{v||N(!0),_("");try{const B=await Xn(e,{signal:O});d(B.page),f(B.assets||[]),x(B.uploads||[]),E(ke=>ke.trim()?ke:window.localStorage.getItem(ar(e))||""||B.page.clientDisplayName||"");const re=B.messages||[];Ye(re),Ue(ke=>{if(ke.size>0||!o.current)return ke;const Je=new Set(re.map(Tn=>Tn.id));return Pt(e,Je),Je}),g(B.progressItems||[])}catch(B){if(O!=null&&O.aborted)return;_(B instanceof Error?B.message:"This private page is unavailable.")}finally{v||N(!1)}},[Ye,e]);Vr({key:`private-page:${e}:page`,enabled:!!e,intervalMs:15e3,task:({signal:v,trigger:O})=>he(O!=="initial",v)}),l.useEffect(()=>{if(!e||!a)return;let v=!1,O=null,B=0;const re=()=>{v||(O=new WebSocket(Jn(e)),O.onmessage=ke=>{try{JSON.parse(String(ke.data||"{}")).type==="message"&&S()}catch{}},O.onclose=()=>{v||(B=window.setTimeout(re,1500))})};return re(),()=>{v=!0,window.clearTimeout(B),O==null||O.close()}},[e,a==null?void 0:a.id,S]),Vr({key:`private-page:${e}:messages`,enabled:!!(e&&a),intervalMs:ae?3e3:8e3,task:({signal:v})=>S(v)}),l.useEffect(()=>{if(!(a!=null&&a.id)||wl())return;const v=Number(a.id||0);if(i.current.has(v))return;i.current.add(v);const O=ue(a),B=Se(a,{relatedPageCount:Array.isArray(a.relatedPages)?a.relatedPages.length:0,assetCount:c.length,messageCount:h.length});ys({viewKey:`private:page:${v}`,pageKind:"private_page",loraId:O,pageUrl:window.location.href,metadata:B}),ne("page_view",{loraId:O,pageUrl:window.location.href,metadata:B}),ne("private_page_open",{loraId:O,pageUrl:window.location.href,metadata:B})},[c.length,h.length,a]),l.useEffect(()=>{if(!(!!a&&((a==null?void 0:a.templateKey)==="progress"||(a==null?void 0:a.templateKey)==="custom")&&String((a==null?void 0:a.commissionApproval)||"").trim().toLowerCase()==="approved"))return;let O=!1;return U(!0),ws({},{limit:1e4,targetType:"origin"}).then(B=>{if(O)return;const re=B.filter(ke=>{if(String(ke.targetType||"").toLowerCase()!=="origin"||String(ke.syncStatus||"active").toLowerCase()!=="active")return!1;const Je=String(ke.status||"").toLowerCase();return!["done","online","cancelled","hidden","archived","quarantined"].includes(Je)}).sort(El);L(re)}
116).catch(()=>{O||L([])}).finally(()=>{O||U(!1)}),()=>{O=!0}},[a==null?void 0:a.commissionApproval,a==null?void 0:a.templateKey]),l.useEffect(()=>{var v;ae&&((v=n.current)==null||v.scrollIntoView({block:"end"}))},[ae,h]);const Kt=async()=>{if(w.trim()){Z(!0),_(""),W.current=w;try{const v=await ta(e,P.trim()||"Client",w.trim(),$);v.message&&(P.trim()&&window.localStorage.setItem(ar(e),P.trim()),u(O=>[...O,v.message]),Ue(O=>{const B=new Set(O).add(v.message.id);return Pt(e,B),B})),C(""),W.current="",T(ve("private-message")),Lt(r),ne("private_page_message_send",{loraId:ue(a),metadata:Se(a,{messageLength:w.trim().length})})}catch(v){_(v instanceof Error?v.message:"Failed to send message.")}finally{Z(!1)}}},ut=(a==null?void 0:a.accentColor)||"#36c6ff",vt=(a==null?void 0:a.templateKey)==="upload",Ir=Math.max(0,Math.min(100,Number((a==null?void 0:a.progressPercent)||0))),Gt=l.useMemo(()=>a?Sl(a,p):[],[a,p]),Yt=h.filter(v=>v.sender==="admin"&&!Vt.has(v.id)).length,Sn=Array.isArray(a==null?void 0:a.loraCardLinks)?a.loraCardLinks:[],Mr=Array.isArray(a==null?void 0:a.relatedPages)?a.relatedPages:[],mt=!!(a!=null&&a.approvalEnabled),ze=String((a==null?void 0:a.commissionApproval)||"").trim().toLowerCase(),Xe=String((a==null?void 0:a.targetDeliveryState)||"").trim().toLowerCase(),wt=String((a==null?void 0:a.targetDeliveryLabel)||"").trim(),Ze=mt&&!(ze==="approved"||Xe==="uploaded"||Xe==="scheduled"),Pn=c.length>0&&(mt||ze==="approved"||ze==="changes_requested")?`/api/private-pages/${encodeURIComponent(e)}/download-package`:"",Xt=((a==null?void 0:a.templateKey)==="progress"||(a==null?void 0:a.templateKey)==="custom")&&ze==="approved",Dr=Xt?t.jsx(ro,{origins:R,loading:M,contactName:(a==null?void 0:a.clientLabel)||(a==null?void 0:a.clientDisplayName)||"",email:(a==null?void 0:a.clientEmail)||"",channel:(a==null?void 0:a.clientChannel)||"",source:"private_page_approved_offer",trackingPageId:Number((a==null?void 0:a.id)||0)}):null,$r=()=>Mr.map(v=>{const O=Math.max(0,Math.min(100,Number(v.progressPercent||0))),B=qe(v.label||v.title);return t.jsxs("a",{href:v.url,"aria-current":v.isCurrent?"page":void 0,onClick:()=>{y(!1),ne("private_page_related_page_click",{loraId:ue(a),metadata:Se(a,{targetPageId:v.id,targetUrl:v.url,targetType:v.targetType,targetId:v.targetId,targetIsCurrent:!!v.isCurrent})})},className:`block rounded-md px-2 py-2 text-xs transition ${v.isCurrent?"bg-white/10 text-white":"text-slate-400 hover:bg-white/[0.06] hover:text-slate-100"}`,children:[t.jsx("span",{className:"block truncate font-semibold",children:B}),t.jsxs("span",{className:"mt-1 block text-[11px] text-slate-500",children:[O,"%"]}),v.approvalRequired&&t.jsx("span",{className:"mt-1 inline-flex rounded-sm border border-amber-200/40 bg-amber-300/15 px-1.5 py-0.5 text-[10px] font-bold text-amber-100",children:"Approval required"})]},v.id)}),En=()=>{le(!0),ne("private_page_chat_open",{loraId:ue(a),metadata:Se(a,{messageCount:h.length,unreadMessages:Yt})});const v=new Set(h.map(B=>B.id));Ue(v),Pt(e,v);const O=Math.max(0,...h.filter(B=>B.sender==="admin").map(B=>B.id));O>0&&qr(e,O).catch(()=>{}),S()},Fr=()=>{le(!1),ne("private_page_chat_close",{loraId:ue(a),metadata:Se(a,{messageCount:h.length})})},kt=async v=>{if(Ze){Y(!0),_(""),q(""),G.current=j;try{const O=await ea(e,v,{authorName:P.trim()||"Client",note:j.trim(),submissionId:F});P.trim()&&window.localStorage.setItem(ar(e),P.trim()),O.page&&d(O.page),q(v==="approved"?"Approval received. Thank you!":"Change request received. I will review your note in Messages."),ne("private_page_approval_submit",{loraId:ue(a),metadata:Se(a,{decision:v,noteLength:j.trim().length})}),H(""),G.current="",z(ve("private-approval")),Lt(r),he()}catch(O){_(O instanceof Error?O.message:"Failed to send approval decision.")}finally{Y(!1)}}},Ur=v=>{ne("private_page_asset_download_click",{loraId:ue(a),metadata:ir(a,v,{href:v.downloadFileUrl||v.downloadUrl||""})})},zr=v=>{J(O=>new Set(O).add(v.id)),ne("private_page_asset_nsfw_unlock",{loraId:ue(a),metadata:ir(a,v)})},Br=v=>{X(v),ne("private_page_image_open",{loraId:ue(a),metadata:ir(a,v,{hasFullUrl:!!v.fullUrl})}),Zt("private_gallery","show_asset",{assetId:v.id,filename:v.filePath||v.displayName,category:v.assetCategory||"",index:c.findIndex(O=>O.id===v.id),total:c.length},{loraId:ue(a)})},An=l.useCallback(v=>{me(v),Zt("private_generation_details",v?"open":"close",{open:v,assetId:(V==null?void 0:V.id)||0},{loraId:ue(a)});try{window.sessionStorage.setItem(gn(e),v?"1":"0")}catch{}},[V==null?void 0:V.id,a,e]);l.useEffect(()=>{if(!ce||!V||oe){ce||we(!1);return}let v=!1;return we(!0),Ie(""),Zn(e).then(O=>{v||(Q(O),te(!0))}).catch(O=>{v||Ie(O instanceof Error?O.message:"Generation details could not be loaded.")}).finally(()=>{v||we(!1)}),()=>{v=!0}},[oe,ce,V,e]);const _n=(v,O)=>{const B=String(v.url||""),re=Pl(B)||ue(a);
116ne("private_page_lora_card_open",{loraId:re,pageUrl:window.location.href,metadata:Se(a,{targetUrl:B,targetLoraId:String(v.entryId||re||""),targetEntryType:String(v.entryType||""),targetCardType:String(v.targetType||""),index:O})})},Rn=()=>{ne("private_page_package_download",{loraId:ue(a),pageUrl:window.location.href,metadata:Se(a,{assetCount:c.length})})};return k?t.jsx("div",{className:"min-h-screen bg-[#090d18] text-slate-100",children:t.jsx("div",{className:"mx-auto flex min-h-screen max-w-5xl items-center justify-center px-5",children:t.jsxs("div",{className:"flex items-center gap-3 text-sm text-slate-300",children:[t.jsx(Tt,{className:"animate-spin",size:18})," Loading private page"]})})}):A&&!a?t.jsx("div",{className:"min-h-screen bg-[#090d18] text-slate-100",children:t.jsx("div",{className:"mx-auto flex min-h-screen max-w-3xl items-center justify-center px-5",children:t.jsxs("div",{className:"rounded-lg border border-red-300/20 bg-red-950/20 p-6",children:[t.jsxs("div",{className:"flex items-center gap-3 text-lg font-bold text-white",children:[t.jsx(Ca,{})," Private page unavailable"]}),t.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-300",children:A})]})})}):t.jsxs("div",{className:"min-h-screen bg-[#090d18] text-slate-100",children:[!vt&&Mr.length>1&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",onClick:()=>y(!0),"aria-controls":"mobile-private-pages","aria-expanded":I,className:"fixed left-4 top-4 z-40 inline-flex h-10 items-center gap-2 rounded-md border border-cyan-200/30 bg-[#0b1020]/90 px-3 text-xs font-bold text-cyan-100 shadow-xl shadow-black/30 backdrop-blur hover:border-cyan-200/70 hover:bg-[#111a33] xl:hidden",children:[t.jsx(ja,{size:16}),"Pages"]}),t.jsxs("nav",{className:"fixed left-4 top-24 z-30 hidden max-h-[calc(100vh-7rem)] w-48 overflow-hidden rounded-lg border border-white/10 bg-[#0b1020]/75 shadow-xl shadow-black/20 backdrop-blur xl:block","aria-label":"Private pages",children:[t.jsx("div",{className:"border-b border-white/10 bg-[#0b1020]/90 px-4 py-3 text-[11px] font-semibold uppercase tracking-normal text-slate-500",children:"Pages"}),t.jsx("div",{className:"max-h-[calc(100vh-10.25rem)] space-y-1 overflow-y-auto p-3 pr-2",children:$r()})]}),I&&t.jsx("div",{className:"fixed inset-0 z-50 bg-black/55 xl:hidden",onClick:()=>y(!1),children:t.jsxs("nav",{id:"mobile-private-pages",className:"h-full w-[min(82vw,20rem)] overflow-hidden border-r border-white/10 bg-[#0b1020] shadow-2xl","aria-label":"Private pages",onClick:v=>v.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between border-b border-white/10 bg-[#0b1020] px-4 py-3",children:[t.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-normal text-slate-400",children:"Pages"}),t.jsx("button",{type:"button",onClick:()=>y(!1),className:"rounded-md p-2 text-slate-300 hover:bg-white/10","aria-label":"Hide private pages list",children:t.jsx(We,{size:18})})]}),t.jsx("div",{className:"max-h-[calc(100vh-3.9rem)] space-y-1 overflow-y-auto p-3 pr-2",children:$r()})]})})]}),t.jsxs("div",{className:`mx-auto px-6 py-10 ${vt?"max-w-3xl":"max-w-7xl"}`,children:[t.jsxs("header",{className:"mb-7 border-b border-white/10 pb-6",children:[t.jsxs("div",{className:"mb-4 inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/[0.04] px-3 py-1 text-xs font-semibold text-slate-300",children:[t.jsx(He,{size:14,style:{color:ut}}),Nl((a==null?void 0:a.templateKey)||"")]}),t.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[t.jsx("h1",{className:"max-w-4xl break-words text-4xl font-black tracking-normal text-white md:text-5xl",children:a==null?void 0:a.title}),!vt&&t.jsxs("a",{href:or,target:"_blank",rel:"noreferrer",onClick:()=>ne("private_page_public_site_click",{loraId:ue(a),metadata:Se(a,{targetUrl:or})}),className:"inline-flex h-11 shrink-0 items-center justify-center gap-2 rounded-md border border-cyan-200/30 bg-cyan-300/10 px-4 text-sm font-bold text-cyan-100 hover:border-cyan-200/70 hover:bg-cyan-300/18",children:[t.jsx(ga,{size:17}),"Open public site",t.jsx($t,{size:15,className:"opacity-75"})]})]}),(a==null?void 0:a.heroText)&&t.jsx("p",{className:"mt-4 max-w-3xl text-base leading-7 text-slate-300",children:a.heroText})]}),t.jsxs("main",{className:"space-y-7",children:[t.jsxs("section",{className:"space-y-7",children:[(a==null?void 0:a.templateKey)==="progress"&&t.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.04] p-4",children:[t.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3 text-sm",children:[t.jsx("span",{className:"font-semibold text-white",children:a.progressLabel||"Current progress"}),t.jsxs("span",{className:"text-slate-300",children:[Ir,"%"]})]}),t.jsx("div",{className:"h-3 overflow-hidden rounded-full bg-white/10",children:t.jsx("div",{className:"h-full rounded-full",style:{width:`${Ir}%`,backgroundColor:ut}})})]}),(a==null?void 0:a.templateKey)==="progress"&&Gt.length>0&&t.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.04] p-4",children:[t.jsx("h2",{className:"mb-3 text-base font-bold text-white",children:"Commission Timeline"}),t.jsx("div",{children:Gt.map((v,O)=>{const B=v.state==="completed",re=v.state==="next";return t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex w-6 shrink-0 flex-col items-center",children:[B?t.jsx(cr,{size:21,className:"shrink-0 text-emerald-400","aria-label":"Completed"}):t.jsx("span",{className:`mt-0.5 block h-4 w-4 shrink-0 rounded-full border-2 ${re?"bg-white/10":"border-slate-600 bg-slate-900"}`,style:re?{borderColor:ut,boxShadow:`0 0 0 4px ${ut}20`}:void 0,"aria-label":re?"Next step":"Upcoming"}),O<Gt.length-1&&t.jsx("span",{className:`my-1 min-h-6 w-px flex-1 ${B?"bg-emerald-400/65":"bg-slate-700"}`})]}),t.jsxs("div",{className:"min-w-0 flex-1 pb-4",children:[B&&v.completedAt&&t.jsxs("div",{className:"text-xs text-emerald-300/80",children:["Completed ",At(v.completedAt)]}),re&&t.jsx("div",{className:"text-xs font-semibold",style:{color:ut}
116,children:"Next step"}),t.jsxs("div",{className:`mt-0.5 text-sm leading-6 ${v.state==="upcoming"?"text-slate-400":"text-slate-300"}`,children:[t.jsx("span",{className:v.state==="upcoming"?"font-semibold text-slate-400":"font-semibold text-white",children:v.label}),v.message&&t.jsxs("span",{children:[" - ",v.message]})]})]})]},v.key)})})]}),mt&&((a==null?void 0:a.templateKey)==="progress"||(a==null?void 0:a.templateKey)==="custom")&&t.jsxs("section",{className:"rounded-lg border border-white/10 bg-white/[0.04] p-5",children:[t.jsx("h2",{className:"mb-2 text-base font-bold text-white",children:"Commission Approval"}),ze==="approved"?t.jsxs("div",{className:"rounded-md border border-emerald-300/20 bg-emerald-300/10 p-4 text-sm leading-6 text-emerald-100",children:["Approved",a.approvedOn?` on ${At(a.approvedOn)}`:"","."]}):Xe==="uploaded"?t.jsxs("div",{className:"rounded-md border border-cyan-300/20 bg-cyan-300/10 p-4 text-sm leading-6 text-cyan-100",children:[wt||"Uploaded to CivitAI","."]}):Xe==="scheduled"?t.jsxs("div",{className:"rounded-md border border-cyan-300/20 bg-cyan-300/10 p-4 text-sm leading-6 text-cyan-100",children:[wt||"Scheduled to CivitAI",a.targetAvailabilityLabel?` - ${a.targetAvailabilityLabel}`:"","."]}):mt?ze==="changes_requested"?t.jsx("div",{className:"text-sm text-amber-200",children:"Changes requested. I will review your note in Messages."}):t.jsx("div",{className:"text-sm text-slate-300",children:"Review the files and card, then approve the model or request changes."}):t.jsx("div",{className:"rounded-md border border-white/10 bg-black/20 p-4 text-sm leading-6 text-slate-300",children:"LoRA is not yet ready to be approved. If you have any questions or changes please use the Messages button on the bottom right ❤️"}),K&&t.jsx("div",{className:"mt-3 rounded-md border border-emerald-300/20 bg-emerald-300/10 p-3 text-sm text-emerald-100",children:K}),Xt&&t.jsx("div",{className:"mt-4 rounded-md border border-fuchsia-200/25 bg-fuchsia-300/[0.08] p-4",children:t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[t.jsxs("div",{children:[t.jsxs("h3",{className:"flex items-center gap-2 text-sm font-bold text-white",children:[t.jsx(ht,{size:16,className:"text-fuchsia-200"}),"Ready for the next idea?"]}),t.jsx("p",{className:"mt-1 text-sm leading-6 text-slate-300",children:"Since this commission is approved, you can start another LoRA, image set, or custom request from here."})]}),t.jsxs("button",{type:"button",onClick:()=>{b(!0),ne("commission_click",{metadata:{target:"private_page_after_approval_modal_open",pageId:(a==null?void 0:a.id)||0}})},className:"inline-flex h-10 shrink-0 items-center justify-center gap-2 rounded-md bg-fuchsia-200 px-4 text-sm font-bold text-slate-950 hover:bg-fuchsia-100",children:[t.jsx(ht,{size:16}),"View options"]})]})}),Dr,t.jsxs("div",{className:Ze?"":"pointer-events-none opacity-40","aria-disabled":!Ze,children:[t.jsx("textarea",{value:j,onChange:v=>H(v.target.value),disabled:!Ze,placeholder:"Optional note, or describe requested changes",rows:3,className:"mt-3 w-full resize-y rounded-md border border-white/10 bg-black/20 px-3 py-2 text-sm leading-6 text-white outline-none focus:border-cyan-300/70 disabled:cursor-not-allowed"}),t.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[t.jsxs("button",{type:"button",onClick:()=>kt("approved"),disabled:D||!Ze,className:"inline-flex h-10 items-center justify-center gap-2 rounded-md bg-emerald-300 px-4 text-sm font-bold text-slate-950 hover:bg-emerald-200 disabled:cursor-not-allowed disabled:opacity-50",children:[t.jsx(He,{size:16}),"Approve model"]}),t.jsxs("button",{type:"button",onClick:()=>kt("changes_requested"),disabled:D||!Ze,className:"inline-flex h-10 items-center justify-center gap-2 rounded-md border border-amber-200/40 px-4 text-sm font-bold text-amber-100 hover:bg-amber-300/10 disabled:cursor-not-allowed disabled:opacity-50",children:[t.jsx(jt,{size:16}),"Ask for changes"]})]})]})]}),(a==null?void 0:a.bodyText)&&t.jsx("div",{className:"rounded-lg border border-white/10 bg-white/[0.04] p-4",children:t.jsx("div",{className:"whitespace-pre-wrap break-words text-sm leading-7 text-slate-200",children:a.bodyText})}),(a==null?void 0:a.clientUploadsEnabled)&&t.jsx(Dl,{page:a,token:e,uploads:m,onUploadsChanged:x}),!vt&&t.jsxs("div",{className:"rounded-lg border border-white/10 bg-white/[0.04] p-4",children:[t.jsx("h2",{className:"mb-3 text-base font-bold text-white",children:"Files & Previews"}),c.length?t.jsx(Il,{assets:c,loraCardLinks:Sn,packageDownloadUrl:Pn,unlockedNsfw:fe,unlockNsfw:zr,openImage:Br,onAssetDownload:Ur,onCardOpen:_n,onPackageDownload:Rn}):t.jsx("div",{className:"text-sm text-slate-400",children:"No files have been attached yet."})]})]}),!mt&&((a==null?void 0:a.templateKey)==="progress"||(a==null?void 0:a.templateKey)==="custom")&&t.jsxs("section",{className:"rounded-lg border border-white/10 bg-white/[0.04] p-5",children:[t.jsx("h2",{className:"mb-2 text-base font-bold text-white",children:"Commission Approval"}),ze==="approved"?t.jsxs("div",{className:"rounded-md border border-emerald-300/20 bg-emerald-300/10 p-4 text-sm leading-6 text-emerald-100",children:["Approved",a.approvedOn?` on ${At(a.approvedOn)}`:"","."]}):Xe==="uploaded"?t.jsxs("div",{className:"rounded-md border border-cyan-300/20 bg-cyan-300/10 p-4 text-sm leading-6 text-cyan-100",children:[wt||"Uploaded to CivitAI","."]}):Xe==="scheduled"?t.jsxs("div",{className:"rounded-md border border-cyan-300/20 bg-cyan-300/10 p-4 text-sm leading-6 text-cyan-100",children:[wt||"Scheduled to CivitAI",a.targetAvailabilityLabel?` - ${a.targetAvailabilityLabel}`:"","."]}):t.jsx("div",{className:"rounded-md border border-white/10 bg-black/20 p-4 text-sm leading-6 text-slate-300",children:"LoRA is not yet ready to be approved. If you have any questions or changes please use the Messages button on the bottom right."}),K&&t.jsx("div",{className:"mt-3 rounded-md border border-emerald-300/20 bg-emerald-300/10 p-3 text-sm text-emerald-100",children:K}),Xt&&t.jsx("div",{className:"mt-4 rounded-md border border-fuchsia-200/25 bg-fuchsia-300/[0.08] p-4",children:t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[t.jsxs("div",{children:[t.jsxs("h3",{className:"flex items-center gap-2 text-sm font-bold text-white",children:[t.jsx(ht,{size:16,className:"text-fuchsia-200"}),"Ready for the next idea?"]}),t.jsx("p",{className:"mt-1 text-sm leading-6 text-slate-300",children:"Since this commission is approved, you can start another LoRA, image set, or custom request from here."})]}),t.jsxs("button",{type:"button",onClick:()=>{b(!0),ne("commission_click",{metadata:{target:"private_page_after_approval_modal_open",pageId:(a==null?void 0:a.id)||0}})},className:"inline-flex h-10 shrink-0 items-center justify-center gap-2 rounded-md bg-fuchsia-200 px-4 text-sm font-bold text-slate-950 hover:bg-fuchsia-100",children:[t.jsx(ht,{size:16}),"View options"]})]})}),Dr,t.jsxs("div",{className:"pointer-events-none opacity-40","aria-disabled":!0,children:[t.jsx("textarea",{value:j,onChange:v=>H(v.target.value),disabled:!0,placeholder:"Optional note, or describe requested changes",rows:3,className:"mt-3 w-full resize-y rounded-md border border-white/10 bg-black/20 px-3 py-2 text-sm leading-6 text-white outline-none focus:border-cyan-300/70 disabled:cursor-not-allowed"}),t.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[t.jsxs("button",{type:"button",onClick:()=>kt("approved"),disabled:!0,className:"inline-flex h-10 items-center justify-center gap-2 rounded-md bg-emerald-300 px-4 text-sm font-bold text-slate-950 hover:bg-emerald-200 disabled:cursor-not-allowed disabled:opacity-50",children:[t.jsx(He,{size:16}),"Approve model"]}),t.jsxs("button",{type:"button",onClick:()=>kt("changes_requested"),disabled:!0,className:"inline-flex h-10 items-center justify-center gap-2 rounded-md border border-amber-200/40 px-4 text-sm font-bold text-amber-100 hover:bg-amber-300/10 disabled:cursor-not-allowed disabled:opacity-50",children:[t.jsx(jt,{size:16}),"Ask for changes"]})]})]})]})]})]}),t.jsxs("button",{type:"button",onClick:En,className:"fixed bottom-5 right-5 z-40 inline-flex h-12 items-center gap-2 rounded-full bg-cyan-300 px-5 text-sm font-bold text-slate-950 shadow-2xl shadow-black/40 hover:bg-cyan-200",children:[t.jsx(jt,{size:18}),"Message Kurut",Yt>0&&t.jsx("span",{className:"rounded-full bg-slate-950 px-2 py-0.5 text-xs text-white",children:Yt})]}),ae&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-end bg-black/45 p-4 md:p-6",onClick:Fr,children:t.jsxs("div",{className:"w-full max-w-md rounded-lg border border-white/10 bg-[#0b1020] p-4 shadow-2xl",onClick:v=>v.stopPropagation(),children:[t.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[t.jsxs("h2",{className:"flex items-center gap-2 text-base font-bold text-white",children:[t.jsx(jt,{size:18})," Message Kurut"]}),t.jsx("button",{type:"button",onClick:Fr,className:"rounded-md p-2 text-slate-300 hover:bg-white/10",children:t.jsx(We,{size:18})})]}),t.jsxs("div",{className:"mb-4 max-h-[420px] space-y-3 overflow-auto pr-1",children:[h.length?h.map(v
116=>t.jsx($l,{msg:v},v.id)):t.jsx("div",{className:"text-sm text-slate-400",children:"No messages yet."}),t.jsx("div",{ref:n})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("input",{value:P,onChange:v=>E(v.target.value),placeholder:"Your name (optional)",className:"h-10 w-full rounded-md border border-white/10 bg-black/20 px-3 text-sm text-white outline-none focus:border-cyan-300/70"}),t.jsx("textarea",{value:w,onChange:v=>C(v.target.value),placeholder:"Write a message",rows:4,className:"w-full resize-y rounded-md border border-white/10 bg-black/20 px-3 py-2 text-sm leading-6 text-white outline-none focus:border-cyan-300/70"}),t.jsxs("button",{type:"button",onClick:Kt,disabled:se||!w.trim(),className:"inline-flex h-10 w-full items-center justify-center gap-2 rounded-md bg-cyan-300 px-4 text-sm font-bold text-slate-950 hover:bg-cyan-200 disabled:cursor-not-allowed disabled:opacity-50",children:[t.jsx(La,{size:16}),"Send"]}),A&&t.jsx("div",{className:"text-xs text-red-300",children:A})]})]})}),pe&&t.jsx(yl,{onClose:()=>b(!1),baseUrl:or,source:"private_page_after_approval"}),V&&t.jsx(Ll,{asset:V,images:c.filter(v=>v.kind==="image"),unlockedNsfw:fe,detailsOpen:ce,detailsCache:be,detailsLoading:Ce,detailsError:ye,onDetailsOpenChange:An,onAssetChange:Br,onUnlockNsfw:zr,onClose:()=>X(null),onDownload:Ur})]})}const Fl="analytics_replay";let _t=null;function kn(e){const r=e.getBoundingClientRect();_t={left:r.left,top:r.top,width:r.width,height:r.height}}function Ul(){try{return new URLSearchParams(window.location.search).get(Fl)==="1"}catch{return!1}}function ie(e){return String(e??"").replace(/\s+/g," ").trim().toLowerCase()}function xt(e){if(!(e instanceof HTMLElement))return!1;const r=window.getComputedStyle(e),s=e.getBoundingClientRect();return r.visibility!=="hidden"&&r.display!=="none"&&s.width>0&&s.height>0}function jn(){return Array.from(document.querySelectorAll("button,a,input,textarea,select,[role='button'],[role='tab'],[role='menuitem'],[data-analytics-id]")).filter(xt)}function Nn(e,r){if(!r)return null;const s=e.find(n=>ie(n.innerText||n.textContent)===r);return s||e.find(n=>ie(n.innerText||n.textContent).includes(r))||null}function Or(e){if(ie(e.analyticsId)){const h=document.querySelector(`[data-analytics-id="${CSS.escape(String(e.analyticsId))}"]`);if(h&&xt(h))return h}const s=String(e.id||"").trim();if(s){const h=document.getElementById(s);if(h&&xt(h))return h}const n=jn(),o=ie(e.ariaLabel);if(o){const h=n.find(u=>ie(u.getAttribute("aria-label"))===o);if(h)return h}const i=ie(e.name||e.inputName);if(i){const h=n.find(u=>ie(u.getAttribute("name"))===i);if(h)return h}const a=ie(e.placeholder);if(a){const h=n.find(u=>ie(u.getAttribute("placeholder"))===a);if(h)return h}const d=ie(e.label);if(d){const u=Array.from(document.querySelectorAll("label")).find(p=>ie(p.textContent).includes(d));if(u){const p=u.getAttribute("for"),g=p?document.getElementById(p):u.querySelector("input,textarea,select,button");if(g&&xt(g))return g}}const c=ie(e.text||e.title),f=Nn(n,c);if(f)return f;const m=Number(e.x),x=Number(e.y);if(Number.isFinite(m)&&Number.isFinite(x)){const h=document.elementFromPoint(m,x),u=h==null?void 0:h.closest("button,a,input,textarea,select,[role='button'],[role='tab'],[data-analytics-id]");if(u&&xt(u))return u}return null}function xs(e,r){var o;const s=e instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,n=(o=Object.getOwnPropertyDescriptor(s,"value"))==null?void 0:o.set;n==null||n.call(e,r),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function zl(e){const r=Or(e);if(!r)return!1;if(kn(r),r instanceof HTMLInputElement)return r.type==="checkbox"||r.type==="radio"?(r.checked=!!e.checked,r.dispatchEvent(new Event("change",{bubbles:!0})),!0):(r.type==="file"||xs(r,String(e.value??"")),!0);if(r instanceof HTMLTextAreaElement)return xs(r,String(e.value??"")),!0;if(r instanceof HTMLSelectElement){const s=Array.isArray(e.selectedValues)?e.selectedValues.map(String):[String(e.value??"")];return Array.from(r.options).forEach(n=>
116{n.selected=s.includes(n.value)}),r.dispatchEvent(new Event("change",{bubbles:!0})),!0}return r.isContentEditable?(r.textContent=String(e.value??""),r.dispatchEvent(new Event("input",{bubbles:!0})),!0):!1}function Cn(e){const r=ie(e.innerText||e.textContent||e.getAttribute("aria-label"));return e.closest("a")||e.closest("form")&&e.type==="submit"?!0:/pay|purchase|place order|submit order|send message|approve|download|upload|delete|remove|confirm payment/.test(r)}function Bl(e){const r=Or(e);if(!r||Cn(r))return!1;kn(r);try{return r.click(),!0}finally{}}function Hl(e){if(String(e.href||"").trim())return!0;const r=ie(e.text||e.ariaLabel||e.title);return/pay|purchase|place order|submit order|send message|approve|download|upload|delete|remove|confirm payment/.test(r)}function Pe(e){const r=jn();for(const s of e){const n=Nn(r,ie(s));if(n&&!Cn(n)){try{n.click()}finally{}return!0}}return!1}function Wl(e){const r=ie(e.component),s=ie(e.action),n=e.state&&typeof e.state=="object"?e.state:{};if(r==="prompt_builder"){const o=!!n.expanded;return Pe(o?["Expand"]:["Hide"])}if(r.includes("gallery")&&s==="navigate")return ie(n.direction)==="previous"?Pe(["Previous image","Previous","‹"]):Pe(["Next image","Next","›"]);if(r.includes("generation_details")){const o=!!n.open;return Pe(o?["Generation details"]:["Close generation details"])}if(r==="private_page_panels"){if(n.chatOpen)return Pe(["Open chat","Messages","Chat"]);if(n.pageListOpen)return Pe(["Private pages","Show private pages list"])}return!1}function ql(e){const r=Number(e.top),s=Number(e.left),n=e.target;if(n&&typeof n=="object"&&String(n.target||"")!=="document"){const o=Or(n);if(o)return o.scrollTo({top:Number.isFinite(r)?r:0,left:Number.isFinite(s)?s:0,behavior:"instant"}),!0}return window.scrollTo({top:Number.isFinite(r)?r:0,left:Number.isFinite(s)?s:0,behavior:"instant"}),!0}async function Vl(e){const r=ie(e.eventName),s=e.metadata||{};if(_t=null,r==="ui_click"&&Hl(s))return{applied:!1,reason:"Shown but intentionally not executed in read-only mode"};let n=!1;const o=r==="ui_input"||r==="ui_click"?18:1;for(let i=0;i<o&&!n;i+=1)r==="ui_input"?n=zl(s):r==="ui_scroll"?n=ql(s):r==="ui_click"?n=Bl(s):r==="ui_state_change"?n=Wl(s):r.includes("generation_details_toggle")&&(n=s.open?Pe(["Generation details"]):Pe(["Close generation details"])),!n&&i<o-1&&await new Promise(a=>window.setTimeout(a,140));return await new Promise(i=>window.setTimeout(i,r==="ui_click"||r==="ui_state_change"?90:20)),n?{applied:!0,..._t?{targetRect:_t}:{}}:{applied:!1,reason:"No safe matching control was found"}}function gs(){var e;(e=window.parent)==null||e.postMessage({type:"kurutai-reconstruction-ready",url:window.location.href},"*")}function ec(){if(!Ul())return;document.documentElement.dataset.analyticsReconstruction="1";const e=new URLSearchParams(window.location.search).get("analytics_replay_theme");(e==="dark"||e==="light")&&(document.documentElement.classList.toggle("dark",e==="dark"),document.documentElement.style.colorScheme=e),window.addEventListener("submit",s=>{s.preventDefault(),s.stopImmediatePropagation()},!0);const r=window.fetch.bind(window);window.fetch=((s,n)=>{const o=String((n==null?void 0:n.method)||(s instanceof Request?s.method:"GET")).toUpperCase();return["GET","HEAD","OPTIONS"].includes(o)?r(s,n):Promise.resolve(new Response(JSON.stringify({ok:!0,reconstruction:!0}),{status:200,headers:{"Content-Type":"application/json"}}))}),window.addEventListener("message",async s=>{var i;const n=s.data;if(!n||n.type!=="kurutai-reconstruction-apply")return;const o=[];for(const a of Array.isArray(n.events)?n.events:[])o.push(await Vl(a));(i=window.parent)==null||i.postMessage({type:"kurutai-reconstruction-applied",commandId:String(n.commandId||""),results:o,scrollX:window.scrollX,scrollY:window.scrollY},"*")}),document.readyState==="complete"?gs():window.addEventListener("load",()=>window.setTimeout(gs,50),{once:!0})}export{pl as A,Cs as B,ia as C,st as D,yr as F,Ca as L,Pa as M,qa as P,ro as R,ht as S,Ba as U,Xl as a,Zl as b,Lt as c,Jl as d,ca as e,La as f,Ra as g,yl as h,hl as i,Ql as j,Ja as k,ec as l,qe as p,wr as r,vr as u,kr as w};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.