PageSourceSearch

https://artbot.site/_next/static/chunks/app/(content)/create/page-ff1f0de141b7c0ac.js

js artbot.site collected 2026-09-25 22:03:31 UTC 94,764 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7698],{51371:function(){},96127:function(){},19486:function(e,t,s){Promise.resolve().then(s.bind(s,44006)),Promise.resolve().then(s.bind(s,73451)),Promise.resolve().then(s.bind(s,20142)),Promise.resolve().then(s.bind(s,1860)),Promise.resolve().then(s.bind(s,7768)),Promise.resolve().then(s.bind(s,11)),Promise.resolve().then(s.bind(s,32243)),Promise.resolve().then(s.bind(s,26029)),Promise.resolve().then(s.bind(s,26144)),Promise.resolve().then(s.bind(s,2271)),Promise.resolve().then(s.bind(s,15e3)),Promise.resolve().then(s.bind(s,64131)),Promise.resolve().then(s.bind(s,18421)),Promise.resolve().then(s.bind(s,89003)),Promise.resolve().then(s.bind(s,17965)),Promise.resolve().then(s.bind(s,51930)),Promise.resolve().then(s.bind(s,6761)),Promise.resolve().then(s.bind(s,63104)),Promise.resolve().then(s.bind(s,84923)),Promise.resolve().then(s.bind(s,75258)),Promise.resolve().then(s.bind(s,40018)),Promise.resolve().then(s.bind(s,17858)),Promise.resolve().then(s.bind(s,40919)),Promise.resolve().then(s.bind(s,16489)),Promise.resolve().then(s.bind(s,91649)),Promise.resolve().then(s.bind(s,52762))},40919:function(e,t,s){"use strict";s.d(t,{default:function(){return u}});var r=s(99376),a=s(2265),l=s(50890);async function i(){try{let[e,t,s]=await Promise.allSettled(["https://raw.githubusercontent.com/Haidra-Org/AI-Horde-Styles/main/categories.json","https://raw.githubusercontent.com/Haidra-Org/AI-Horde-Styles/main/styles.json","https://raw.githubusercontent.com/amiantos/AI-Horde-Styles-Previews/main/previews.json"].map(e=>fetch(e))),r="fulfilled"===e.status?await e.value.json():{},a="fulfilled"===t.status?await t.value.json():{},l="fulfilled"===s.status?await s.value.json():{},i=Object.keys(r).reduce((e,t)=>(e[t]=r[t].filter(e=>e in a),e),{});return{success:!0,categories:i,presets:a,previews:l}}catch(e){return console.error(e),{success:!1,categories:{},presets:{},previews:{}}}}let n=["preset","model","steps","cfg_scale","clip"],o={model:"models",steps:"steps",cfg_scale:"cfg_scale",clip:"clipskip"},c=e=>{let t=(0,r.useSearchParams)(),[s,c]=(0,a.useState)(null),d=(0,l.X)(e),u=(0,a.useCallback)(async()=>{let s=t.get("preset");if(s){let e=await i();if(e.success&&e.presets[s]){d(s,e.presets[s]),c(e);return}}let r={};t.forEach((e,t)=>{if(n.includes(t)){let s=o[t];s&&("models"===s?r[s]=[e]:"steps"===s||"cfg_scale"===s||"clipskip"===s?r[s]=Number(e):r[s]=e)}}),Object.keys(r).length>0&&e(r)},[t,e,d]);return(0,a.useEffect)(()=>{u()},[u]),s};var d=s(17858);function u(){let{setInput:e}=(0,d.G)();return c(e),null}},16489:function(e,t,s){"use strict";s.d(t,{default:function(){return E}});var r=s(57437),a=s(50905),l=s(27831),i=s(4683),n=s(64520),o=s(37406),c=s(93033);function d(e){let{errors:t}=e;return(0,r.jsxs)("div",{className:"col w-full h-full",children:[(0,r.jsx)("h2",{className:"row font-bold",children:"Warnings"}),(0,r.jsx)("div",{className:"col w-full gap-4 flex-wrap",children:t.map(e=>(0,r.jsxs)("div",{className:"col gap-2 px-2 py-1 rounded",style:{borderLeft:"4px solid ".concat("critical"===e.type?"red":"orange")},children:[(0,r.jsxs)("div",{className:"row gap-2",children:["warning"===e.type&&(0,r.jsx)(n.Z,{}),"critical"===e.type&&(0,r.jsx)(o.Z,{className:"text-red-500"}),e.message]}),"warning"===e.type&&(0,r.jsx)("div",{className:"font-bold text-sm",children:"(Optional) You can still continue."}),"critical"===e.type&&(0,r.jsx)("div",{className:"font-bold text-sm",children:"(Required) You must fix this error in order to continue."})]},"error-".concat(e.message)))}),(0,r.jsx)("div",{className:"w-full row justify-end",children:(0,r.jsx)(l.Z,{onClick:()=>{c.ZP.remove("modal")},children:"Close"})})]})}var u=s(87415),h=s(34357),m=s(17858),p=s(62596),g=s(7328),x=s(74620),f=s(24929),b=s(72766),v=s(74565),w=s(99376),j=s(57355),y=s(9390),N=s(65273),k=s(87459),_=s(2265),C=s(77490),Z=s(47742),S=s(80896),P=s(79931),A=s(96487);let F=!1;var I=s(61994),R=s(88618),L=s(91863);function E(e){let{height:t=36,isSticky:s=!1}=e,{forceSelectedWorker:n}=(0,a.o)(L.U6),{input:o,kudos:E,setInput:M,setSourceImages:T}=(0,m.G)(),{prompt:D,negative:U}=o,{emptyInput:O,errors:G,handleCreateClick:B,hasCriticalError:W,requestPending:z}
1=function(){let{input:e}=(0,m.G)(),[t,s]=function(){var e,t;let{input:s}=(0,m.G)(),{modelDetails:r}=(0,a.o)(P.EA),[l,i]=(0,_.useState)([]),[n,o]=(0,_.useState)(!1),c=null!==(t=null===(e=r[null==s?void 0:s.models[0]])||void 0===e?void 0:e.baseline)&&void 0!==t?t:"";return(0,_.useEffect)(()=>{let e=!1,t=[],r=(0,Z.X)(s.tis),a=r.length>0;r.forEach(e=>{s.prompt.includes(e)&&(a=!1)}),a&&t.push({message:"Keyword tags for embedding not found within prompt.",type:"warning"});let l=(0,Z.X)(s.loras),n=l.length>0;l.forEach(e=>{s.prompt.includes(e)&&(n=!1)}),n&&t.push({message:"Keyword tags for LoRA not found in prompt.",type:"warning"}),s.prompt.length+s.negative.length>7e3&&S.d.get("useReplacementFilter")&&t.push({message:"Total prompt is likely too long for replacement filter. Max 7,000 characters. Please shorten prompt or disable replacement filter. Current length: ".concat(s.prompt.length),type:"warning"}),s.models[0].toLowerCase().indexOf("pony")>=0&&s.clipskip<2&&t.push({message:"PonyXL-based models require CLIP setting of at least 2.",type:"critical"});let d="stable diffusion 1"===c||"stable_diffusion_xl"===c;s.workflows.forEach(e=>{e&&("qr_code"!==e.type||d||t.push({message:"QR code option only supported using Stable Diffusion 1.x or SDXL models",type:"critical"}
1),"qr_code"!==e.type||e.text.trim()||t.push({message:"QR code workflow requires text or URL",type:"critical"}))}),s.loras.filter(e=>e.versionId===u.MJ.versionId).length>0&&"k_euler_a"!==s.sampler&&t.push({message:'TurboMix Euler LoRA requires "k_euler_a" sampler',type:"warning"}),s.loras.filter(e=>e.versionId===u.MS.versionId).length>0&&"k_dpmpp_sde"!==s.sampler&&t.push({message:'TurboMix LCM SDE LoRA requires "k_dpmpp_sde" sampler',type:"warning"}),"Stable Cascade 1.0"!==s.models[0]&&s.source_processing===C.C.Remix&&t.push({message:'Remix option can only be used with "Stable Cascade models',type:"critical"}),s.height*s.width>y.$.MAX_IMAGE_PIXELS&&t.push({message:"Image size of ".concat((s.height*s.width).toLocaleString()," pixels larger than supported max of ").concat(y.$.MAX_IMAGE_PIXELS.toLocaleString()," pixels. Try reducing image dimensions."),type:"critical"}),s.height*s.width<331776&&s.hires&&t.push({message:"Hi-res fix is not supported for images with less than ".concat(331776..toLocaleString()," pixels (~576 x 576).  Disable hi-red fix or try increasing image dimensions."),type:"critical"}),t.forEach(t=>{"critical"===t.type&&(e=!0)}),o(e),i(t)},[c,s]),[l,n]}(),[r,l]=(0,_.useState)(!1),i=(0,_.useCallback)(async()=>{if(!(!e.prompt.trim()&&!e.negative.trim())&&!r&&!s){l(!0);try{let t=await (0,N.w9)({...e}),s=await (0,h.aC)(y.$.IMAGE_UPLOAD_TEMP_ID);s&&s.length>0&&await (0,h.TO)(y.$.IMAGE_UPLOAD_TEMP_ID,t.artbot_id),t&&(0,A.hz)(t),await (0,k.b2)({artbot_id:t.artbot_id,prompt:e.prompt}),(0,j.M)({message:"Image successfully requested!",type:"success"})}finally{l(!1)}}},[s,e,r]);return(0,_.useEffect)(()=>{if(F)return;let e=e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&!r&&i()};return window.addEventListener("keydown",e),F=!0,()=>{F=!1,window.removeEventListener("keydown",e)}},[i,r]),{emptyInput:!e.prompt.trim()&&!e.negative.trim(),errors:t,handleCreateClick:i,hasCriticalError:s,requestPending:r}}(),H=(0,w.useRouter)(),q=D.trim().length+U.trim().length;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:(0,I.Z)("row w-full",!s&&"justify-between"),children:[!s&&(0,r.jsxs)("div",{className:"text-xs font-mono hidden md:block",children:["(",q.toLocaleString()," chars)",(0,r.jsx)("br",{}),E>0?(0,r.jsxs)("span",{children:["(",E," kudos)"]}):(0,r.jsx)("span",{children:"\xa0"})]}),!s&&(0,r.jsx)("div",{className:"md:hidden",children:"\xa0"}),(0,r.jsxs)("div",{className:(0,I.Z)("row",s&&"w-full"),children:[(0,r.jsx)(l.Z,{theme:"danger","aria-label":"Reset all settings",onClick:async()=>{c.ZP.show("delete",{children:(0,r.jsx)(i.Z,{deleteButtonTitle:"Reset",title:"Reset prompt?",message:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:"Are you sure you want to reset all image generation settings to their default values?"}),(0,r.jsx)("p",{children:"This cannot be undone."})]}),onDelete:async()=>{M({...new u.ZP}),await (0,h.uy)(y.$.IMAGE_UPLOAD_TEMP_ID),T([]),window.scrollTo(0,0),H.push("/create"),c.ZP.remove("modal")}})})},style:{height:"".concat(t,"px"),width:s?"25%":"88px"},children:(0,r.jsxs)("span",{className:"row gap-1",children:[(0,r.jsx)(p.Z,{stroke:1.5}),"Reset?"]})}),(0,r.jsx)(l.Z,{disabled:O||z||W,onClick:B,"aria-label":W?"Please fix errors before creating":"Create new image",title:W?"Please fix errors before creating":"Send image request to the AI Horde",style:{height:"".concat(t,"px"),width:s?"75%":"88px"},children:(0,r.jsx)("span",{className:"row gap-1",children:z?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.Z,{}),"Sending..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.Z,{stroke:1.5}),"Create",s&&E>0?(0,r.jsxs)("span",{children:["(",E," kudos)"]}):""]})})}),G.length>0&&(0,r.jsx)(l.Z,{theme:"warning","aria-label":"Show warnings",onClick:()=>{c.ZP.show("modal",{children:(0,r.jsx)(d,{errors:G})})},style:{height:"".concat(t,"px")},children:(0,r.jsx)("span",{className:"row gap-1",children:(0,r.jsx)(f.Z,{stroke:1.5})})}),(0,r.jsx)(l.Z,{"aria-label":n?"Worker locked":"Select worker",onClick:()=>{c.ZP.show("modal",{children:(0,r.jsx)(R.Z,{}),modalClassName:"max-w-[640px]"})},style:{backgroundColor:n?"orange":"rgb(106, 183, 198)",borderColor:n?"orange":"rgb(106, 183, 198)",height:"".concat(t,"px"),width:"40px"},children:n?(0,r.jsx)(b.Z,{stroke:1.5}):(0,r.jsx)(v.Z,{stroke:1.5})})]})]}),!s&&(0,r.jsxs)("div",{className:"row justify-between mb-[-10px]",children:[(0,r.jsx)("div",{children:"\xa0"}),(0,r.jsx)("div",{className:"block md:hidden",children:(0,r.jsxs)("div",{className:"row text-xs font-mono text-right",children:["(",q.toLocaleStr
1ing()," chars)",E>0&&(0,r.jsxs)("span",{children:[" | ","(",E," kudos)"]})]})})]})]})}},91649:function(e,t,s){"use strict";s.d(t,{default:function(){return X}});var r=s(57437),a=s(97707),l=s(65850),i=s(21533),n=s(774),o=s(62290),c=s(13103),d=s(99380),u=s(20828),h=s(16105),m=s(94207),p=s(90938),g=s(17193),x=s(2265),f=s(9607),b=s(80896),v=s(17858),w=s(27831),j=s(93033),y=s(87459),N=s(93143),k=s(95018),_=s(88864),C=s(69424),Z=s(62596),S=s(62595),P=s(57355),A=s(4683);function F(e){let{onDelete:t=()=>{},prompt:s,setPrompt:a}=e,[l,i]=(0,x.useState)(!!s.favorited),n="_suggestion"===s.artbot_id;return(0,r.jsxs)("div",{className:"col gap-2",style:{border:"1px solid #7e5a6c",borderRadius:"4px",padding:"8px"},children:[s.prompt,(0,r.jsxs)("div",{className:"row justify-between items-end!",children:[(0,r.jsx)("div",{style:{color:"gray",display:"flex",fontSize:"12px"},children:n?"":(0,S.i$)(s.timestamp)}),(0,r.jsxs)("div",{className:"row",children:[!n&&(0,r.jsx)(w.Z,{onClick:()=>{let e=!l;i(e),(0,y.kb)(s.id,e)},outline:!0,children:l?(0,r.jsx)(N.Z,{color:"red"}):(0,r.jsx)(k.Z,{})}),(0,r.jsx)(w.Z,{onClick:()=>{navigator.clipboard.writeText(s.prompt),(0,P.M)({message:"Prompt copied to clipboard!"})},children:(0,r.jsx)(_.Z,{})}),(0,r.jsx)(w.Z,{onClick:()=>{a(s.prompt),j.ZP.remove("modal")},children:(0,r.jsx)(C.Z,{})}),!n&&(0,r.jsx)(w.Z,{onClick:()=>{j.ZP.show("delete",{children:(0,r.jsx)(A.Z,{deleteButtonTitle:"Delete",title:"Delete prompt?",message:(0,r.jsxs)("div",{className:"col gap-4",children:[(0,r.jsx)("p",{children:"Are you sure you want to delete this prompt from your prompt library?"}),(0,r.jsx)("p",{children:"This cannot be undone."}),(0,r.jsx)("p",{children:"NOTE: No images will be harmed in this process."})]}),onDelete:async()=>{await (0,y.GR)(s.id),await t(),(0,P.M)({message:"Prompt deleted!",type:"success"})}})})},theme:"danger",children:(0,r.jsx)(Z.Z,{})})]})]})]})}var I=s(25103),R=s.n(I),L=s(80625);function E(e){let{type:t="prompt",setPrompt:s=()=>{}}=e,[a,l]=(0,x.useState)(!1),[i,n]=(0,x.useState)(!1),[o,c]=(0,x.useState)(""),[d,u]=(0,x.useState)(0),[m,p]=(0,x.useState)(!0),[g,f]=(0,x.useState)(0),[b,v]=(0,x.useState)([]),j=async function(){let e,s,{page:r,searchTerm:a,favorites:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{page:0,searchTerm:"",favorites:!1},i=5*r;if(a.trim().length>2){let r=(0,y.TY)(a);e=await (0,y.nu)(r,i,5,t,!0),s=await (0,y.nu)(r,i,5,t,!1)}else e=await (0,y.ku)(t,l),s=await (0,y.mX)({offset:i,limit:5,promptType:t,showFavorites:l});v(s),f(e),p(!1)};(0,x.useEffect)(()=>{j()},[]);let _="prompt"===t?"Prompt Libary":"Negative Prompt Libary";return(0,r.jsxs)("div",{className:"col w-full h-full",children:[(0,r.jsx)("h2",{className:"row font-bold",children:_}),(0,r.jsxs)("div",{className:"col gap-4",children:[(0,r.jsxs)("div",{className:"row w-full",children:["negative"===t&&(0,r.jsx)(w.Z,{outline:!a,onClick:()=>{l(!a)},title:"Suggested prompts",children:(0,r.jsx)(L.Z,{})}),(0,r.jsx)("input",{className:"bg-gray-50 border border-gray-300 text-gray-900 text-[16px] rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search your prompts",onChange:e=>{j({page:0,searchTerm:e.target.value}),c(e.target.value)},value:o}),(0,r.jsx)(w.Z,{disabled:!o.trim(),theme:"danger",onClick:async()=>{u(0),c(""),await j({page:0,searchTerm:""})},children:(0,r.jsx)(h.Z,{})}),(0,r.jsx)(w.Z,{outline:!i,onClick:async()=>{let e=!i;l(!1),n(e),await j({page:0,searchTerm:o,favorites:e})},children:i?(0,r.jsx)(N.Z,{}):(0,r.jsx)(k.Z,{})})]}),!a&&(0,r.jsxs)("div",{className:"text-sm",children:["Page ",d+1," of"," ",Math.ceil(g/5)||1," (",g," prompts)"]}),!a&&!m&&0===g&&(0,r.jsx)("p",{children:i?"No favorited prompts found.":"No items found. Try creating an image, first!"}),a&&(0,r.jsx)("p",{children:"Negative prompt suggestions"}),a&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(F,{prompt:{artbot_id:"_suggestion",prompt:"ugly, deformed, noisy, blurry, low contrast"},setPrompt:s}),(0,r.jsx)(F,{prompt:{artbot_id:"_suggestion",prompt:"lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, out of frame, deformed, blurry, username, watermark, signature"},setPrompt:s}),(0,r.jsx)(F,{prompt:{artbot_id:"_suggestion",prompt:"(worst quality, low quality:1.4), bad anatomy, bad hands, cropped, missing fingers, missing toes, too many toes, too many fingers, missing arms, long neck, Humpbacked, deformed, disfigured, poorly drawn face, distorted face, mutation, mutated, extra limb, ugly, poorly drawn hands, missing limb, floating limbs, disconnected limbs, malformed hands, out of focus, long body, monochrome, symbol, text, logo, door frame, window frame, mirror frame"},setPrompt:s})]}
1),!a&&b.map(e=>(0,r.jsx)(F,{prompt:e,setPrompt:s,onDelete:async()=>{await j({page:d,searchTerm:o,favorites:i})}},e.artbot_id))]}),!a&&(0,r.jsx)("div",{className:"row justify-center my-2",children:(0,r.jsx)(R(),{breakLabel:"...",nextLabel:"⇢",onPageChange:async e=>{u(e.selected),await j({page:e.selected,searchTerm:o})},containerClassName:"row gap-0",activeClassName:"bg-[#969696]",activeLinkClassName:"bg-[#969696] hover:bg-[#969696] cursor-default",breakLinkClassName:"border px-2 py-1 bg-[#8ac5d1] hover:bg-[#8ac5d1]",pageLinkClassName:"border px-4 py-2 bg-[#6AB7C6] hover:bg-[#8ac5d1]",previousLinkClassName:"rounded-l-md border px-4 py-2 bg-[#6AB7C6] hover:bg-[#8ac5d1]",nextLinkClassName:"rounded-r-md border px-4 py-2 bg-[#6AB7C6] hover:bg-[#8ac5d1]",disabledLinkClassName:"bg-[#969696] hover:bg-[#969696] cursor-default",pageRangeDisplayed:5,pageCount:Math.ceil(g/5),previousLabel:"⇠",renderOnZeroPageCount:null})})]})}var M=s(91443),T=s(68301),D=s(61994),U=s(40018),O=s(47742),G=s(52999);let B=(e,t)=>{if(!e||"object"!=typeof e)return{};if(!t)return e;let s=t.toLowerCase(),r={};return Object.keys(e).forEach(t=>{if(Array.isArray(e[t])){let a=e[t].filter(e=>e.toLowerCase().includes(s));a.length>0&&(r[t]=a)}}),r};function W(e){let{input:t,setInput:s}=e,[a,l]=(0,x.useState)(""),[i,n]=(0,x.useState)(t.prompt),[o,c]=(0,x.useState)([]),[d,u]=(0,x.useState)({}),m=(0,x.useCallback)(e=>{o.includes(e)?(c(o.filter(t=>t!==e)),n(i.replace(", ".concat(e),"")),s({prompt:i.replace(", ".concat(e),"")})):(c([...o,e]),n(i+", "+e),s({prompt:i+", "+e}))},[i,s,o]);(0,x.useEffect)(()=>{(async function(){let e=await fetch("".concat((0,G.P)(),"/api/styles")),{data:t}=await e.json();t&&u(t)})()},[]),(0,x.useEffect)(()=>{c((0,O.e)(d).filter(e=>i.includes(e)))},[i,d]);let p=B(d,a),g=Object.keys(p);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"col w-full h-full",children:[(0,r.jsx)("h2",{className:"row font-bold",children:"Tags"}),(0,r.jsxs)("div",{className:"row w-full mb-2",children:[(0,r.jsx)("input",{className:"bg-gray-50 border border-gray-300 text-gray-900 text-[16px] rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Filter styles",onChange:e=>{l(e.target.value)},value:a}),(0,r.jsx)(w.Z,{theme:"danger",onClick:()=>{l("")},children:(0,r.jsx)(h.Z,{})})]}),o.length>0&&(0,r.jsxs)(U.default,{className:"w-full col mb-4",children:[(0,r.jsx)("h3",{className:"font-bold text-[16px] text-white",children:"Used tags"}),(0,r.jsx)("div",{className:"row w-full gap-2 flex-wrap",children:o.map(e=>{let t=o.includes(e);return(0,r.jsxs)("div",{className:(0,D.Z)("row gap-2 px-2 py-1 rounded hover:bg-[#14B8A6] cursor-pointer text-white",t?"bg-[#14B8A6]":"bg-zinc-400 dark:bg-zinc-700"),onClick:()=>m(e),children:[t&&(0,r.jsx)("div",{className:"row gap-0 items-center",style:{borderRight:"1px solid white",paddingRight:"4px"},children:(0,r.jsx)(M.Z,{size:16})}),e]},"used_tag-".concat(e))})})]}),g.map(e=>(0,r.jsxs)("div",{className:"w-full col mb-4",children:[(0,r.jsxs)("h3",{className:"font-bold text-[16px] row gap-2",children:[e,(0,r.jsx)("button",{onClick:()=>{let t=p[e].filter(e=>!o.includes(e)),s=t[Math.floor(Math.random()*t.length)];s&&m(s)},title:"Select random style",children:(0,r.jsx)(T.Z,{className:"primary-color"})})]}),(0,r.jsx)("div",{className:"row w-full gap-2 flex-wrap",children:p[e]&&p[e].map(t=>{let s=o.includes(t);return(0,r.jsxs)("div",{className:(0,D.Z)("row gap-2 px-2 py-1 rounded hover:bg-[#14B8A6] cursor-pointer text-white",s?"bg-[#14B8A6]":"bg-zinc-400 dark:bg-zinc-700"),onClick:()=>m(t),children:[s&&(0,r.jsx)("div",{className:"row gap-0 items-center",style:{borderRight:"1px solid white",paddingRight:"4px"},children:(0,r.jsx)(M.Z,{size:16})}),t]},"".concat(e,"-").concat(t))})})]},e))]})})}var z=s(15602),H=s(93575);function q(e){let{input:t,setInput:s}=e,[a,l]=(0,x.useState)(t.prompt),[i,n]=(0,x.useState)([]),o=(0,x.useCallback)(e=>{i.includes(e)?(n(i.filter(t=>t!==e)),l(a.replace(", ".concat(e),"")),s({prompt:a.replace(", ".concat(e),"")})):(n([...i,e]),l(a+", "+e),s({prompt:a+", "+e}))},[a,s,i]),c=t.loras.reduce((e,t)=>
1(t&&t.modelVersions&&(t.modelVersions.length>0?e[t.name]=t.modelVersions[0].trainedWords:e[t.name]=[]),e),{}),d=t.tis.reduce((e,t)=>(t&&t.modelVersions&&(t.tags.length>0?e[t.name]=t.tags:e[t.name]=[]),e),{}),u={...c,...d},h=Object.keys(u);return(0,r.jsxs)("div",{className:"col w-full h-full",children:[(0,r.jsx)("h2",{className:"row font-bold",children:"Keywords"}),i.length>0&&(0,r.jsxs)(U.default,{className:"w-full col mb-4",children:[(0,r.jsx)("h3",{className:"font-bold text-[16px]",children:"Used tags"}),(0,r.jsx)("div",{className:"row w-full gap-2 flex-wrap",children:i.map(e=>{let t=i.includes(e);return(0,r.jsxs)("div",{className:(0,D.Z)("row gap-2 px-2 py-1 rounded hover:bg-[#14B8A6] cursor-pointer",t?"bg-[#14B8A6]":"bg-zinc-400 dark:bg-zinc-700"),onClick:()=>o(e),children:[t&&(0,r.jsx)("div",{className:"row gap-0 items-center",style:{borderRight:"1px solid white",paddingRight:"4px"},children:(0,r.jsx)(M.Z,{size:16})}),e]},"used_tag-".concat(e))})})]}),null==h?void 0:h.map(e=>{var s;return(0,r.jsxs)("div",{className:"w-full col mb-4",children:[(0,r.jsxs)("h3",{className:"font-bold text-[16px] row gap-2",children:[e,(0,r.jsx)("button",{onClick:()=>{let s=t.loras.filter(t=>t.name===e)[0];j.ZP.show("embeddingDetails",{children:(0,r.jsx)(H.Z,{details:s})})},title:"More information",children:(0,r.jsx)(z.Z,{className:"primary-color"})})]}),(0,r.jsx)("div",{className:"row w-full gap-2 flex-wrap",children:u[e]&&(null===(s=u[e])||void 0===s?void 0:s.map(t=>{let s=i.includes(t);return(0,r.jsxs)("div",{className:(0,D.Z)("row gap-2 px-2 py-1 rounded hover:bg-[#14B8A6] cursor-pointer",s?"bg-[#14B8A6]":"bg-zinc-400 dark:bg-zinc-700"),onClick:()=>o(t),children:[s&&(0,r.jsx)("div",{className:"row gap-0 items-center",style:{borderRight:"1px solid white",paddingRight:"4px"},children:(0,r.jsx)(M.Z,{size:16})}),t]},"".concat(e,"-").concat(t))}))})]},e)})]})}let V=e=>{let{children:t,header:s,initialEntered:l,style:n,...o}=e;return(0,r.jsx)(a.Q,{...o,initialEntered:l,style:n,header:e=>{let{state:{isEnter:t}}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Z,{className:"transition-transform duration-200 ease-out text-white ".concat(t&&"rotate-180")}),s]})},buttonProps:{className:()=>"flex w-full py-2 text-left"},contentProps:{className:"transition-height duration-200 ease-out"},children:t})};function X(){let[e,t,s,a]=function(){let[e,t]=(0,x.useState)(""),[s,r]=(0,x.useState)("");return[e,t,s,r]}(),{input:i,setInput:N}=(0,v.G)(),[k,_]=(0,x.useState)(!1),C=(0,x.useCallback)(()=>(0,r.jsx)(W,{input:i,setInput:N}),[i,N]);(0,x.useEffect)(()=>{_(b.d.get("negativePanelOpen")||!1)},[]);let Z=!1;return i.loras.forEach(e=>{if(!e||!e.modelVersions||e.isArtbotManualEntry)return!1;e.modelVersions.some(e=>e.trainedWords.length>0)&&(Z=!0)}),i.tis.forEach(e=>{var t;if("prompt"===e.inject_ti||"negprompt"===e.inject_ti)return!1;(null==e?void 0:null===(t=e.tags)||void 0===t?void 0:t.length)>0&&(Z=!0)}),(0,r.jsxs)("div",{className:"col bg-[#1d4d74] w-full rounded-md p-2",children:[(0,r.jsxs)("div",{className:"col gap-1",children:[(0,r.jsxs)("div",{className:"row font-bold text-sm text-white",children:[(0,r.jsx)(n.Z,{})," Prompt"]}),(0,r.jsx)("div",{children:(0,r.jsx)(f.Z,{className:"bg-gray-50 border border-gray-300 text-gray-900 text-[16px] rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 mb-2",placeholder:"Describe the image you want to generate",minRows:3,maxRows:8,onChange:e=>{e.target.value&&t(""),N({prompt:e.target.value})},style:{height:80},value:i.prompt})}),(0,r.jsxs)("div",{className:"row w-full justify-between",children:[(0,r.jsxs)("div",{className:"row gap-2",children:[Z&&(0,r.jsx)(w.Z,{className:"h-[36px]!",onClick:()=>{j.ZP.show("modal",{children:(0,r.jsx)(q,{input:i,setInput:N})})},title:"Suggested keywords from LoRA or TIs",style:{width:"36px"},children:(0,r.jsx)(o.Z,{stroke:1.5})}),(0,r.jsx)(w.Z,{className:"h-[36px]!",onClick:()=>{j.ZP.show("modal",{children:(0,r.jsx)(E,{setPrompt:e=>{t(i.prompt),N({prompt:e})}}),modalStyle:{maxWidth:"1024px",width:"calc(100% - 32px)"}})},title:"Recently used prompts",children:(0,r.jsxs)("span",{className:"row gap-1",children:[(0,r.jsx)(c.Z,{stroke:1.5})," ",(0,r.jsx)("span",{children:"Prompts"})]})}),(0,r.jsx)(w.Z,{className:"h-[36px]!",onClick:()=>{j.ZP.show("modal",{children:(0,r.jsx)(C,{}),modalClassName:"w-full md:min-w-[640px] max-w-[648px]"})},title:"Suggested tags to help add additional styles to an image",children:(0,r.jsxs)("span",{className:"row gap-1",children:[(0,r.jsx)(d.Z,{stroke:1.5})," ",(0,r.jsx)("span",{children:"Tags"})]})})]}),(0,r.jsx)("div",{className:"row",children:(0,r.jsx)(w.Z,{className:"h-[36px]!",type:"button",theme:"danger",disabled:!i.prompt&&!e,onClick:()=>{e?(t(""),N({prompt:e})):(window.scrollTo(0,0),t(i.prompt),N({prompt:""}))},children:(0,r.jsx)("span",{className:"row gap-1",children:e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{stroke:1.5})," ",(0,r.jsx)("span",{children:"Undo"})," "]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{stroke:1.5})," ",(0,r.jsx)("span",{children:"Clear"})]})})})})]})]}),(0,r.jsx)("div",{className:"col gap-1",children:(0,r.jsx)(l.U,{transition:!0,transitionTimeout:150,children:(0,r.jsx)(V,{header:(0,r.jsxs)("div",{className:"row font-bold text-sm gap-1 text-white",onClick:()=>{b.d.set("negativePanelOpen",!k),_(!k)},children:[(0,r.jsx)(m.Z,{})," Negative prompt"," ",(0,r.jsx)("span",{className:"text-xs font-normal",children:"(optional)"})]}),style:{marginBottom:"-8px"},initialEntered:k,children:(0,r.jsxs)("div",{className:"mb-[8px]",children:[(0,r.jsx)("div",{children:(0,r.jsx)(f.Z,{className:"bg-gray-50 border border-gray-300 text-gray-900 text-[16px] rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 mb-2",placeholder:"Words to de-prioritize from the image",minRows:3,maxRows:8,onChange:e=>{N({negative:e.target.value})},style:{height:80},value:i.negative})}),(0,r.jsxs)("div",{className:"row w-full justify-between",children:[(0,r.jsxs)("div",{className:"row gap-2",children:[(0,r.jsx)(w.Z,{disabled:!i.negative.trim(),className:"h-[36px]!",onClick:async()=>{""!==i.negative.trim()&&(await (0,y.b2)({prompt:i.negative,promptType:"negative"}),(0,P.M)({message:"Negative prompt saved!",type:"success"}))},title:"Save negative prompt for future use",children:(0,r.jsxs)("span",{className:"row gap-1",children:[(0,r.jsx)(p.Z,{stroke:1.5})," ",(0,r.jsx)("span",{children:"Save"})]})}),(0,r.jsx)(w.Z,{className:"h-[36px]!",onClick:()=>{j.ZP.show("modal",{children:(0,r.jsx)(E,{setPrompt:e=>{a(i.negative),N({negative:e})},type:"negative"}),modalStyle:{maxWidth:"1024px",width:"calc(100% - 32px)"}})},title:"Load previously saved negative prompt",children:(0,r.jsxs)("span",{className:"row gap-1",children:[(0,r.jsx)(g.Z,{stroke:1.5})," ",(0,r.jsx)("span",{children:"Load"})]})})]}),(0,r.jsx)("div",{className:"row",children:(0,r.jsx)(w.Z,{className:"h-[36px]!",theme:"danger",disabled:!i.negative&&!s,onClick:()=>{s?(a(""),N({negative:s})):(window.scrollTo(0,0),a(i.negative),N({negative:""}))},children:(0,r.jsx)("span",{className:"row gap-1",children:s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{stroke:1.5})," ",(0,r.jsx)("span",{children:"Undo"})," "]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{stroke:1.5})," ",(0,r.jsx)("span",{children:"Clear"})]})})})})]})]})})})})]})}},52762:function(e,t,s){"use strict";s.d(t,{default:function(){return i}});var r=s(57437),a=s(2265),l=s(16489);function i(){let[e,t]=(0,a.useState)(!1),s=()=>{t(window.scrollY>100)};return(0,a.useEffect)(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[]),(0,r.jsx)("div",{className:"transition-opacity duration-300 ".concat(e?"sticky top-0 opacity-100":"opacity-0"),children:(0,r.jsx)("div",{className:"row w-full items-center",children:e&&(0,r.jsx)(l.default,{isSticky:!0})})})}},44006:function(e,t,s){"use strict";s.d(t,{default:function(){return k}});
1var r=s(57437),a=s(35515),l=s(52867),i=s(38276),n=s(27831),o=s(40018),c=s(93033),d=s(21309),u=s(2265),h=s(17858),m=s(5405),p=s(62596),g=s(92280),x=s(73680),f=s(4683),b=s(93575),v=s(91802),w=s(91087);function j(e){return Math.round(20*e)/20}function y(e){let{tis:t,index:s,updates:r}=e,a=[...t],l=a[s],i=new v.yW({...l,...r,strength:void 0!==r.strength?parseFloat(Number(r.strength).toFixed(2)):l.strength});return a[s]=i,a}function N(e){var t;let{ti:s}=e,{input:a,setInput:l}=(0,h.G)(),[i,o]=(0,u.useState)((null==s?void 0:null===(t=s.strength)||void 0===t?void 0:t.toString())||"0"),d=a.tis.findIndex(e=>String(e.id)===String(s.id)),N=()=>{l({tis:a.tis.filter(e=>String(e.id)!==String(s.id))})},k=(e,t)=>{if(""===t)o("");else{let r=parseFloat(t);if(!isNaN(r)){let t=parseFloat(j(r).toFixed(2)),i=a.tis.map(r=>String(r.id)===String(s.id)?new v.yW({...r,[e]:t}):r);o(t.toString()),l({tis:i})}}};return(0,r.jsxs)("div",{className:"rounded bg-[#1d4d74] p-2 col",children:[(0,r.jsxs)("div",{className:"w-full row justify-between text-sm font-mono font-bold text-white",children:[s.isArtbotManualEntry?(0,r.jsxs)("span",{children:["LoRA by Version ID: ",s.name]}):(0,r.jsx)("span",{children:s.name}),(0,r.jsxs)("div",{className:"row gap-2",children:[(0,r.jsx)(n.Z,{disabled:s.isArtbotManualEntry,onClick:()=>{c.ZP.show("embeddingDetails",{children:(0,r.jsx)(b.Z,{details:s})})},children:(0,r.jsx)(m.Z,{stroke:1.5})}),(0,r.jsx)(n.Z,{theme:"danger",onClick:()=>{c.ZP.show("delete",{children:(0,r.jsx)(f.Z,{deleteButtonTitle:"Remove Embedding",title:"Remove Embedding?",message:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("p",{children:"Are you sure you want to remove this Emedding from your image request?"})}),onDelete:()=>{N()}})})},children:(0,r.jsx)(p.Z,{stroke:1.5})})]})]}),(0,r.jsx)(x.Z,{className:"row md:row",title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Inject"}),children:(0,r.jsx)(w.Z,{onChange:e=>{l({tis:y({tis:a.tis,index:d,updates:{inject_ti:e.value}})})},options:[{value:"prompt",label:"Prompt"},{value:"negprompt",label:"Negative Prompt"},{value:"none",label:"None"}],value:{value:s.inject_ti,label:s.inject_ti}})}),(0,r.jsx)(x.Z,{className:"row md:row",title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Strength"}),children:(0,r.jsx)("div",{className:"",children:(0,r.jsx)(g.Z,{min:-5,max:5,onBlur:()=>{if(""===i||isNaN(parseFloat(i)))o(s.strength.toString());else{let e=parseFloat(j(parseFloat(i)).toFixed(2)),t=y({tis:a.tis,index:d,updates:{strength:e}});o(e.toString()),l({tis:t})}},onChange:e=>{k("strength",e)},onMinusClick:()=>{let e=parseFloat(i)||0;e-.05<-5||k("strength",j(e-.05).toString())},onPlusClick:()=>{let e=parseFloat(i)||0;e+.05>5||k("strength",j(e+.05).toString())},value:i})})})]})}function k(){let{input:e,setInput:t}=(0,h.G)(),s=e=>"TextualInversion"===e._civitAiType,m=(0,u.useCallback)(r=>{s(r)&&!((e.tis.filter(e=>String(e.name)===String(r.versionId))||[]).length>0)&&t({tis:[...e.tis,r]})},[e,t]),p="Embeddings";return e.tis.length>0&&(p+=" (".concat(e.tis.length,")")),(0,r.jsxs)(o.default,{accordion:!0,anchor:"add-embedding",title:p,children:[(0,r.jsx)("div",{className:"row justify-end mb-2",children:(0,r.jsxs)("div",{className:"row gap-1",children:[(0,r.jsx)(n.Z,{onClick:()=>{c.ZP.show("modal",{children:(0,r.jsx)(u.Suspense,{children:(0,r.jsx)(d.Z,{onUseLoraClick:m,civitAiType:"TextualInversion"})}),modalStyle:{maxWidth:"1600px",minHeight:"calc(100vh - 32px)",width:"calc(100% - 32px)"}})},children:(0,r.jsx)(a.Z,{})}),(0,r.jsx)(n.Z,{onClick:()=>{c.ZP.show("modal",{children:(0,r.jsx)(u.Suspense,{children:(0,r.jsx)(d.Z,{onUseLoraClick:m,civitAiType:"TextualInversion",searchType:"favorite"})}),modalStyle:{maxWidth:"1600px",minHeight:"calc(100vh - 32px)",width:"calc(100% - 32px)"}})},children:(0,r.jsx)(l.Z,{})}),(0,r.jsx)(n.Z,{onClick:()=>{c.ZP.show("modal",{children:(0,r.jsx)(u.Suspense,{children:(0,r.jsx)(d.Z,{onUseLoraClick:m,civitAiType:"TextualInversion",searchType:"recent"})}),modalStyle:{maxWidth:"1600px",minHeight:"calc(100vh - 32px)",width:"calc(100% - 32px)"}})},children:(0,r.jsx)(i.Z,{})})]})}),e.tis.length>0&&(0,r.jsx)("div",{className:"w-full col",children:e.tis.map((e,t)=>(0,r.jsx)("div",{className:"w-full col",children:(0,r.jsx)(N,{ti:e})},"".concat(e.name,"_").concat(t)))})]})}},20142:function(e,t,s){"use strict";s.d(t,{default:function(){return m}});var r=s(57437),a=s(2265),l=s(40018),i=s(91087),n=s(73680),o=s(16105),c=s(27831),d=s(17858);let u=[{value:"",label:"None"},{value:"enabled",label:"Enabled"}],h=[{value:"center",label:"centered"},{value:"top left",label:"top left"},{value:"top right",label:"top right"},{value:"bottom left",label:"bottom left"},{value:"bottom right",label:"bottom right"}];
1function m(){let{input:e,setInput:t}=(0,d.G)(),[s,m]=(0,a.useState)({value:"",label:"None"}),[p,g]=(0,a.useState)(""),[x,f]=(0,a.useState)({value:"center",label:"Centered"}),b=(0,a.useCallback)((s,r)=>{let{workflows:a=[]}=e,l=!1,i=a.map(e=>"qr_code"===e.type?(l=!0,{...e,text:s,position:r}):e);l||i.push({type:"qr_code",position:r,text:s}),t({workflows:i})},[e,t]),v=s=>{let{workflows:r=[]}=e;if(s.value){if("enabled"===s.value){m({value:"enabled",label:"Enabled"}),t({workflows:[...r,{type:"qr_code",position:"center",text:""}]});return}}else{t({workflows:r.filter(e=>"qr_code"!==e.type)}),m({value:"",label:"None"}),g(""),f({value:"center",label:"centered"});return}};return(0,a.useEffect)(()=>{if(e.workflows.length>0){let t=e.workflows.find(e=>"qr_code"===e.type);t&&(m({value:"enabled",label:"Enabled"}),g(t.text),f({value:t.position,label:t.position}))}},[e.workflows]),(0,r.jsxs)(l.default,{anchor:"workflows",children:[(0,r.jsx)("div",{className:"row justify-between",children:(0,r.jsx)("h2",{className:"row font-bold text-white",children:"Workflows"})}),(0,r.jsxs)("div",{className:"w-full",children:[(0,r.jsx)(n.Z,{className:"row md:row",title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"QR Code"}),children:(0,r.jsx)(i.Z,{onChange:e=>v(e),options:u,value:{...s}})}),"enabled"===s.value&&(0,r.jsxs)("div",{className:"rounded bg-[#1d4d74] p-2 col mt-2",children:[(0,r.jsx)("label",{className:"col md:row justify-between gap-2 font-bold text-sm text-white",children:"QR Code Text"}),(0,r.jsxs)("div",{className:"w-full row",children:[(0,r.jsx)("input",{className:"bg-gray-50 border border-gray-300 text-gray-900 text-[16px] rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",onChange:e=>{let t=e.target;g(t.value),b(t.value,x.value)},placeholder:"Enter text or URL",value:p}),(0,r.jsx)("div",{className:"row gap-1",children:(0,r.jsx)(c.Z,{disabled:""===p,theme:"danger",title:"Clear text field",onClick:()=>{g(""),b("",x.value)},children:(0,r.jsx)(o.Z,{})})})]}),(0,r.jsx)("label",{className:"col md:row justify-between gap-2 font-bold text-sm mt-2 text-white",children:"QR Code Position"}),(0,r.jsx)(i.Z,{onChange:e=>{f(e),b(p,e.value)},options:h,value:{...x}})]})]})]})}},73451:function(e,t,s){"use strict";s.d(t,{default:function(){return n}});var r=s(57437),a=s(17858),l=s(40018),i=s(69195);function n(){let{input:e,setInput:t}=(0,a.G)();return(0,r.jsxs)(l.default,{accordion:!0,anchor:"additional-options",title:"Additional options",children:[(0,r.jsxs)("label",{className:"row gap-2 text-white",children:[(0,r.jsx)(i.Z,{checked:e.post_processing.includes("strip_background"),onChange:()=>{e.post_processing.includes("strip_background")?t({post_processing:e.post_processing.filter(e=>"strip_background"!==e)}):t({post_processing:[...e.post_processing,"strip_background"]})}}),"Strip background"]}),(0,r.jsxs)("label",{className:"row gap-2 text-white",children:[(0,r.jsx)(i.Z,{checked:e.karras,onChange:()=>{t({karras:!e.karras})}}),"Karras"]}),(0,r.jsxs)("label",{className:"row gap-2 text-white",children:[(0,r.jsx)(i.Z,{checked:e.tiling,onChange:()=>{t({tiling:!e.tiling})}}),"Tiling"]}),(0,r.jsxs)("label",{className:"row gap-2 text-white",children:[(0,r.jsx)(i.Z,{checked:e.transparent,onChange:()=>{t({transparent:!e.transparent})}}),"Transparent background"]})]})}},1860:function(e,t,s){"use strict";s.d(t,{default:function(){return n}});var r=s(57437),a=s(17858),l=s(92280),i=s(73680);function n(){let{input:e,setInput:t}=(0,a.G)();return(0,r.jsx)(i.Z,{className:"row md:row",title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"CLIP Skip"}),children:(0,r.jsx)("div",{className:"",children:(0,r.jsx)(l.Z,{min:1,max:12,onChange:e=>{t({clipskip:Number(e)})},onMinusClick:()=>{Number(e.clipskip)-1<1||t({clipskip:Number(e.clipskip)-1})},onPlusClick:()=>{Number(e.clipskip)+1>12||t({clipskip:Number(e.clipskip)+1})},value:e.clipskip})})})}},7768:function(e,t,s){"use strict";s.d(t,{default:function(){return d}});var r=s(57437),a=s(17858),l=s(2265),i=s(73680),n=s(91087),o=s(92280);let c=[{value:"",label:"None"},{value:"CodeFormers",label:"CodeFormers"},{value:"GFPGAN",label:"GFPGAN"}];
1function d(){let{input:e,setInput:t}=(0,a.G)(),[s,d]=(0,l.useState)("None");return(0,l.useEffect)(()=>{let t=e.post_processing;t.includes("GFPGAN")&&d("GFPGAN"),t.includes("CodeFormers")&&d("CodeFormers")},[e.post_processing]),(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)(i.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Face fixer"}),children:(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)(n.Z,{onChange:s=>{let r=e.post_processing.filter(e=>"GFPGAN"!==e&&"CodeFormers"!==e);d(s.label),"None"!==s.label?t({post_processing:[...r,s.value]}):t({facefixer_strength:.5,post_processing:r})},options:c,value:{value:s,label:s||"None"}})})}),("GFPGAN"===s||"CodeFormers"===s)&&(0,r.jsx)(i.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Strength"}),children:(0,r.jsx)("div",{className:"",children:(0,r.jsx)(o.Z,{min:.05,max:1,onBlur:()=>{isNaN(e.facefixer_strength)?t({facefixer_strength:.05}):t({facefixer_strength:parseFloat(Number(e.facefixer_strength).toFixed(2))})},onChange:e=>{t({facefixer_strength:e})},onMinusClick:()=>{Number(e.facefixer_strength)-.05<.05||t({facefixer_strength:parseFloat((Number(e.facefixer_strength)-.05).toFixed(2))})},onPlusClick:()=>{Number(e.facefixer_strength)+.05>1||t({facefixer_strength:parseFloat((Number(e.facefixer_strength)+.05).toFixed(2))})},value:e.facefixer_strength})})})]})}},11:function(e,t,s){"use strict";s.d(t,{default:function(){return n}});var r=s(57437),a=s(17858),l=s(92280),i=s(73680);function n(){let{input:e,setInput:t}=(0,a.G)();return(0,r.jsx)(i.Z,{className:"row md:row",title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Guidance"}),children:(0,r.jsx)("div",{className:"",children:(0,r.jsx)(l.Z,{min:.5,max:30,onBlur:()=>{isNaN(e.cfg_scale)?t({cfg_scale:7.5}):t({cfg_scale:parseFloat(Number(e.cfg_scale).toFixed(1))})},onChange:e=>{t({cfg_scale:e})},onMinusClick:()=>{Number(e.cfg_scale)-.5<.5||t({cfg_scale:Number(e.cfg_scale)-.5})},onPlusClick:()=>{Number(e.cfg_scale)+.5>30||t({cfg_scale:Number(e.cfg_scale)+.5})},value:e.cfg_scale})})})}},32243:function(e,t,s){"use strict";s.d(t,{default:function(){return c}});var r=s(57437),a=s(17858),l=s(73680),i=s(91087),n=s(92280);let o=[{value:!1,label:"Disabled"},{value:!0,label:"Enabled"}];function c(){let{input:e,setInput:t}=(0,a.G)();return(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)(l.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Hires fix"}),children:(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)(i.Z,{onChange:e=>{"Enabled"===e.label?t({hires:!0}):t({hires:!1})},options:o,value:{value:e.hires,label:e.hires?"Enabled":"Disabled"}})})}),e.hires&&(0,r.jsx)(l.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Strength"}),children:(0,r.jsx)("div",{className:"",children:(0,r.jsx)(n.Z,{min:.05,max:1,onBlur:()=>{isNaN(e.hires_fix_denoising_strength)?t({hires_fix_denoising_strength:.05}):t({hires_fix_denoising_strength:parseFloat(Number(e.hires_fix_denoising_strength).toFixed(2))})},onChange:e=>{t({hires_fix_denoising_strength:Number(e)})},onMinusClick:()=>{Number(e.hires_fix_denoising_strength)-.05<.05||t({hires_fix_denoising_strength:parseFloat((Number(e.hires_fix_denoising_strength)-.05).toFixed(2))})},onPlusClick:()=>{Number(e.hires_fix_denoising_strength)+.05>1||t({hires_fix_denoising_strength:parseFloat((Number(e.hires_fix_denoising_strength)+.05).toFixed(2))})},value:e.hires_fix_denoising_strength})})})]})}},26029:function(e,t,s){"use strict";s.d(t,{default:function(){return o}});var r=s(57437),a=s(2265),l=s(80896),i=s(40018),n=s(69195);function o(){let[e,t]=(0,a.useState)(!1),[s,o]=(0,a.useState)(!0),[c,d]=(0,a.useState)(!0),[u,h]=(0,a.useState)(!0),[m,p]=(0,a.useState)(!0),g=e=>{switch(e){case"slowWorkers":l.d.set("slow_workers",!l.d.get("slow_workers")),h(e=>!e);break;case"promptReplacement":l.d.set("useReplacementFilter",!l.d.get("useReplacementFilter")),d(e=>!e);break;case"downgrade":l.d.set("autoDowngrade",!l.d.get("autoDowngrade")),o(e=>!e);break;case"useTrusted":l.d.set("useTrusted",!l.d.get("useTrusted")),p(e=>!e);break;case"allowNsfw":l.d.set("allowNsfwImages",!l.d.get("allowNsfwImages")),t(e=>!e)}};return(0,a.useEffect)(()=>{t(l.d.get("allowNsfwImages")),o(l.d.get("autoDowngrade")),d(l.d.get("useReplacementFilter")),h(l.d.get("slow_workers")),p(l.d.get("useTrusted"))},[]),(0,r.jsxs)(i.default,{accordion:!0,anchor:"horde-settings",title:"Horde settings",children:[(0,r.jsxs)("label",{className:"row gap-2 text-white",children:[(0,r.jsx)(n.Z,{checked:s,onChange:()=>{g("downgrade")}}),"Auto downgrade"]}),(0,r.jsxs)("label",{className:"row gap-2 text-white",children:[(0,r.jsx)(n.Z,{checked:u,onChange:()=>{g("slowWorkers")}}),"Allow slow workers"]}),(0,r.jsxs)("label",{className:"row gap-2 text-white",children:[(0,r.jsx)(n.Z,{checked:e,onChange:()=>{g("allowNsfw")}}),"Allow NSFW"]}),(0,r.jsxs)("label",{className:"row gap-2 text-white",children:[(0,r.jsx)(n.Z,{checked:c,onChange:()=>{g("promptReplacement")}}),"Prompt filter"]}),(0,r.jsxs)("label",{className:"row gap-2 text-white",children:[(0,r.jsx)(n.Z,{checked:m,onChange:()=>{g("useTrusted")}}),"Use trusted workers"]})]})}},26144:function(e,t,s){"use strict";s.d(t,{default:function(){return n}});var r=s(57437),a=s(17858),l=s(92280),i=s(73680);
1function n(){let{input:e,setInput:t}=(0,a.G)();return(0,r.jsx)(i.Z,{className:"!row md:row",title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Images"}),children:(0,r.jsx)("div",{className:"",children:(0,r.jsx)(l.Z,{min:1,max:20,onBlur:()=>{isNaN(e.numImages)?t({numImages:1}):t({numImages:parseFloat(Number(e.numImages).toFixed(0))})},onChange:e=>{t({numImages:e})},onMinusClick:()=>{Number(e.numImages)-1<1||t({numImages:Number(e.numImages)-1})},onPlusClick:()=>{Number(e.numImages)+1>20||t({numImages:Number(e.numImages)+1})},value:e.numImages})})})}},2271:function(e,t,s){"use strict";s.d(t,{default:function(){return b}});var r=s(57437),a=s(17858),l=s(91087),i=s(73680),n=s(27831),o=s(17878),c=s(93033),d=s(2265),u=s(92280),h=s(72766),m=s(72902),p=s(59779);function g(e){let{input:t,setInput:s}=e,[a,l]=(0,d.useState)(t.height),[o,g]=(0,d.useState)(t.width),{getNewDimensions:x,updateAspectRatio:f}=function(e,t){let[s]=(0,d.useState)(e),[r]=(0,d.useState)(t),[a,l]=(0,d.useState)(e/t),i=(0,d.useCallback)(()=>s/r,[s,r]);return(0,d.useEffect)(()=>
1{l(i())},[i]),{adjustedWidth:s,adjustedHeight:r,aspectRatio:a,getNewDimensions:e=>{let{w:t,h:s,size:r,side:l}=e,i=t,n=s;return"width"===l?((n=64*Math.round((i=64*Math.round(r/64))/a/64))>=3072||n<=64)&&(n>=3072?n=3072:n<=64&&(n=64),i=64*Math.round(n*a/64)):((i=64*Math.round((n=64*Math.round(r/64))*a/64))>=3072||i<=64)&&(i>=3072?i=3072:i<=64&&(i=64),n=64*Math.round(i/a/64)),{adjustedWidth:i=Math.max(64,Math.min(3072,i)),adjustedHeight:n=Math.max(64,Math.min(3072,n))}},updateAspectRatio:(e,t)=>{l(e/t)}}}(t.width,t.height),[b,v]=(0,d.useState)(!1),w=(e,t)=>{l(t),g(e),s({height:t,width:e,imageOrientation:"custom"})};return(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)("h2",{className:"row font-bold",children:"Custom image size"}),(0,r.jsxs)("div",{className:"row w-full gap-2",children:[(0,r.jsx)(i.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-black dark:text-white gap-1",children:"Width"}),children:(0,r.jsx)(u.Z,{min:64,max:3072,onBlur:()=>{if(isNaN(o)||!o)w(1024,a),f(1024,a);else if(b){let{adjustedWidth:e,adjustedHeight:t}=x({w:o,h:a,size:parseFloat(Number(o).toFixed(0)),side:"width"});w(e,t)}else w(parseFloat(Number(o).toFixed(0)),a)},onChange:e=>{w(e,a)},onMinusClick:()=>{if(!(Number(o)-64<64)){if(b){let{adjustedWidth:e,adjustedHeight:t}=x({w:o,h:a,size:Number(o)-64,side:"width"});w(e,t)}else w(Number(o)-64,a)}},onPlusClick:()=>{if(!(Number(o)+64>3072)){if(b){let{adjustedWidth:e,adjustedHeight:t}=x({w:o,h:a,size:Number(o)+64,side:"width"});w(e,t)}else w(Number(o)+64,a)}},value:o})}),(0,r.jsx)("div",{style:{position:"relative",borderTop:"2px solid var(--foreground-color)",borderRight:"2px solid var(--foreground-color)",width:"20px",height:"20px",top:"8px"}})]}),(0,r.jsx)("div",{className:"row w-full gap-2 justify-end",children:(0,r.jsx)("div",{onClick:()=>{w(o,a),v(!b)},style:{cursor:"pointer",position:"relative",width:"20px",height:"22px",right:"-6px"},children:b?(0,r.jsx)(h.Z,{}):(0,r.jsx)(m.Z,{})})}),(0,r.jsxs)("div",{className:"row w-full gap-2",children:[(0,r.jsx)(i.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-black dark:text-white gap-1",children:"Height"}),children:(0,r.jsx)(u.Z,{min:64,max:3072,onBlur:()=>{if(isNaN(a)||!a)w(o,1024),f(o,1024);else if(b){let{adjustedWidth:e,adjustedHeight:t}=x({w:o,h:a,size:parseFloat(Number(a).toFixed(0)),side:"height"});w(e,t)}else w(parseFloat(Number(o).toFixed(0)),parseFloat(Number(a).toFixed(0)))},onChange:e=>{w(o,e)},onMinusClick:()=>{if(!(Number(a)-64<64)){if(b){let{adjustedWidth:e,adjustedHeight:t}=x({w:o,h:a,size:Number(a)-64,side:"height"});w(e,t)}else w(o,Number(a)-64)}},onPlusClick:()=>{if(!(Number(a)+64>3072)){if(b){let{adjustedWidth:e,adjustedHeight:t}=x({w:o,h:a,size:Number(a)+64,side:"height"});w(e,t)}else w(o,Number(a)+64)}},value:a})}),(0,r.jsx)("div",{style:{position:"relative",borderBottom:"2px solid var(--foreground-color)",borderRight:"2px solid var(--foreground-color)",width:"20px",height:"20px",top:"-8px"}})]}),(0,r.jsxs)("div",{className:"w-full text-right row justify-end!",children:[(0,r.jsx)(n.Z,{onClick:()=>{f(o,a),v(!b)},children:(0,r.jsxs)("span",{className:"row",children:[b?(0,r.jsx)(h.Z,{}):(0,r.jsx)(m.Z,{}),b?"Locked ratio":"Unlocked ratio"]})}),(0,r.jsx)(n.Z,{onClick:()=>{f(a,o),w(a,o)},children:(0,r.jsxs)("span",{className:"row",children:[(0,r.jsx)(p.Z,{})," Swap"]})}),(0,r.jsx)(n.Z,{onClick:()=>{c.ZP.remove("modal")},style:{minWidth:"60px"},children:"OK"})]})]})}let x={landscape_16x9:{id:"landscape_16x9",label:"Landscape (16 x 9)",orientation:"landscape-16x9",height:576,width:1024},landscape_3x2:{id:"landscape_3x2",label:"Landscape (3 x 2)",orientation:"landscape",height:704,width:1024},portrait_2x3:{id:"portrait_2x3",label:"Portrait (2 x 3)",orientation:"portrait",height:1024,width:704},phone_bg_9x21:{id:"phone_bg_9x21",label:"Phone background (9 x 21)",orientation:"phone-bg",height:1024,width:448},ultrawide_21x9:{id:"ultrawide_21x9",label:"Ultrawide (21 x 9)",orientation:"ultrawide",height:448,width:1024},square:{id:"square",label:"Square",orientation:"square",height:1024,width:1024},custom:{id:"custom",label:"Custom",orientation:"custom",height:1024,width:1024}},f=Object.values(x).map(e=>({value:e.id,label:e.label})).filter(e=>"custom"!==e.value);
1function b(){let{input:e,setInput:t}=(0,a.G)();return(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)(i.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Aspect"}),children:(0,r.jsxs)("div",{className:"row w-full",children:[(0,r.jsx)(l.Z,{onChange:e=>{t({imageOrientation:e.value,height:x[e.value].height,width:x[e.value].width})},options:f,value:{value:e.imageOrientation,label:x[e.imageOrientation].label}}),(0,r.jsx)(n.Z,{onClick:()=>{c.ZP.show("modal",{children:(0,r.jsx)(g,{input:e,setInput:t})})},children:(0,r.jsx)(o.Z,{})})]})}),(0,r.jsxs)("div",{className:"text-sm font-mono w-full text-right text-white font-bold",children:[e.width,"w x ",e.height,"h"]})]})}},15e3:function(e,t,s){"use strict";s.d(t,{default:function(){return p}});var r=s(57437),a=s(17858),l=s(77490),i=s(2265),n=s(40018),o=s(91087),c=s(92280),d=s(73680),u=s(69195);let h=[{value:l.C.Img2Img,label:"img2img"},{value:l.C.InPainting,label:"inpainting"},{value:l.C.Remix,label:"remix"}],m=["","canny","hed","depth","normal","openpose","seg","scribble","fakescribbles","hough"];function p(){let{input:e,setInput:t,sourceImages:s}=(0,a.G)(),[p,g]=(0,i.useState)({value:"",label:"none"});return((0,i.useEffect)(()=>{e.control_type?g({value:e.control_type,label:e.control_type}):""===e.control_type&&g({value:"",label:"none"})},[e.control_type]),0===s.length)?null:(0,r.jsxs)(n.default,{accordion:!0,anchor:"image-processing",title:"Image processing",children:[(0,r.jsx)(d.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Processing"}),children:(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)(o.Z,{onChange:s=>{if(s.value==l.C.Remix)g({value:"",label:"none"}),t({control_type:void 0,denoising_strength:void 0,image_is_control:!1,models:["Stable Cascade 1.0"],source_processing:s.value});else{let r={source_processing:s.value};e.denoising_strength||s.value!==l.C.Img2Img||(r.denoising_strength=.75),t(r)}},options:[...h],value:{value:e.source_processing,label:e.source_processing}})})}),(0,r.jsx)(d.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Denoise"}),children:(0,r.jsx)("div",{className:"",children:(0,r.jsx)(c.Z,{min:0,max:1,onBlur:()=>{isNaN(e.denoising_strength)?t({denoising_strength:.5}):t({denoising_strength:parseFloat(Number(e.denoising_strength).toFixed(2))})},onChange:e=>{t({denoising_strength:e})},onMinusClick:()=>{Number(e.denoising_strength)-.05<0||t({denoising_strength:parseFloat((Number(e.denoising_strength)-.05).toFixed(2))})},onPlusClick:()=>{Number(e.denoising_strength)+.05>1||t({denoising_strength:parseFloat((Number(e.denoising_strength)+.05).toFixed(2))})},value:e.denoising_strength})})}),(0,r.jsx)("div",{className:""}),(0,r.jsx)(d.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"ControlNet"}),children:(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)(o.Z,{onChange:e=>{t({control_type:e.value})},options:m.map(e=>""===e?{value:"",label:"none"}:{value:e,label:e}),value:p})})}),(0,r.jsx)(d.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Control image?"}),children:(0,r.jsx)(u.Z,{checked:e.image_is_control,disabled:e.source_processing===l.C.Remix,onChange:()=>{t({image_is_control:!e.image_is_control})}})})]})}},64131:function(e,t,s){"use strict";s.d(t,{default:function(){return _}});var r=s(57437),a=s(35515),l=s(52867),i=s(38276),n=s(27831),o=s(40018),c=s(93033),d=s(21309),u=s(17858),h=s(5405),m=s(62596),p=s(92280),g=s(73680),x=s(2265),f=s(4683),b=s(93575),v=s(91802);function w(e){return Math.round(20*e)/20}function j(e){let{loras:t,index:s,updates:r}=e,a=[...t],l=a[s],i=new v.uL({...l,...r,clip:void 0!==r.clip?parseFloat(Number(r.clip).toFixed(2)):l.clip,strength:void 0!==r.strength?parseFloat(Number(r.strength).toFixed(2)):l.strength});return a[s]=i,a}function y(e){let{lora:t}
1=e,{input:s,setInput:a}=(0,u.G)(),[l,i]=(0,x.useState)(t.strength.toString()),[o,d]=(0,x.useState)(t.clip.toString()),y=s.loras.findIndex(e=>String(e.versionId)===String(t.versionId)),N=()=>{a({loras:s.loras.filter(e=>String(e.versionId)!==String(t.versionId))})},k=(e,r)=>{if(""===r)"strength"===e?i(""):d("");else{let l=parseFloat(r);if(!isNaN(l)){let r=parseFloat(w(l).toFixed(2)),n=s.loras.map(s=>String(s.versionId)===String(t.versionId)?new v.uL({...s,[e]:r}):s);"strength"===e?i(r.toString()):d(r.toString()),a({loras:n})}}},_=t.modelVersions.filter(e=>e.id===t.versionId);return(0,r.jsxs)("div",{className:"rounded bg-[#1d4d74] p-2 col",children:[(0,r.jsxs)("div",{className:"w-full row justify-between text-sm font-mono font-bold text-white",children:[t.isArtbotManualEntry&&"247778"!==t.id?(0,r.jsxs)("span",{children:["LoRA by Version ID: ",t.name]}):(0,r.jsx)("span",{children:t.name}),(0,r.jsxs)("div",{className:"row gap-2",children:[(0,r.jsx)(n.Z,{disabled:t.isArtbotManualEntry,onClick:()=>{c.ZP.show("embeddingDetails",{children:(0,r.jsx)(b.Z,{details:t})})},children:(0,r.jsx)(h.Z,{stroke:1.5})}),(0,r.jsx)(n.Z,{theme:"danger",onClick:()=>{c.ZP.show("delete",{children:(0,r.jsx)(f.Z,{deleteButtonTitle:"Remove LoRA",title:"Remove LoRA?",message:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("p",{children:"Are you sure you want to remove this LoRA from your image request?"})}),onDelete:()=>{N()}})})},children:(0,r.jsx)(m.Z,{stroke:1.5})})]})]}),(null==t?void 0:t.modelVersions)&&t.modelVersions[0]&&(0,r.jsx)(g.Z,{className:"row md:row",title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Version:"}),children:(0,r.jsx)("span",{className:"font-mono pl-4 text-white font-bold",children:_&&_[0].name})}),(0,r.jsx)(g.Z,{className:"row md:row",title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Strength"}),children:(0,r.jsx)("div",{className:"",children:(0,r.jsx)(p.Z,{min:-5,max:5,onBlur:()=>{if(""===l||isNaN(parseFloat(l)))i(t.strength.toString());else{let e=parseFloat(w(parseFloat(l)).toFixed(2)),t=j({loras:s.loras,index:y,updates:{strength:e}});i(e.toString()),a({loras:t})}},onChange:e=>{k("strength",e)},onMinusClick:()=>{let e=parseFloat(l)||0;e-.05<-5||k("strength",w(e-.05).toString())},onPlusClick:()=>{let e=parseFloat(l)||0;e+.05>5||k("strength",w(e+.05).toString())},value:l})})}),(0,r.jsx)(g.Z,{className:"!row md:row",title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Clip"}),children:(0,r.jsx)("div",{className:"",children:(0,r.jsx)(p.Z,{min:-5,max:5,onBlur:()=>{if(""===o||isNaN(parseFloat(o)))d(t.clip.toString());else{let e=parseFloat(w(parseFloat(o)).toFixed(2)),t=j({loras:s.loras,index:y,updates:{clip:e}});d(e.toString()),a({loras:t})}},onChange:e=>{k("clip",e)},onMinusClick:()=>{let e=parseFloat(o)||0;e-.05<-5||k("clip",w(e-.05).toString())},onPlusClick:()=>{let e=parseFloat(o)||0;e+.05>5||k("clip",w(e+.05).toString())},value:o})})})]})}var N=s(9390),k=s(57355);function _(){let{input:e,setInput:t}=(0,u.G)(),s=e=>"LORA"===e._civitAiType,h=(0,x.useCallback)(r=>{if(s(r)){if(e.loras.length>=N.$.MAX_LORAS){(0,k.M)({message:"Can't add more than ".concat(N.$.MAX_LORAS," LoRAs."),type:"error"});return}(e.loras.filter(e=>String(e.name)===String(r.versionId))||[]).length>0||t({loras:[...e.loras,r]})}},[e,t]),m="LoRAs";return e.loras.length>0&&(m+=" (".concat(e.loras.length," / ").concat(N.$.MAX_LORAS,")")),(0,r.jsxs)(o.default,{anchor:"add-lora",accordion:!0,title:m,children:[(0,r.jsx)("div",{className:"row justify-end mb-2",children:(0,r.jsxs)("div",{className:"row gap-1",children:[(0,r.jsx)(n.Z,{onClick:()=>{c.ZP.show("modal",{children:(0,r.jsx)(x.Suspense,{children:(0,r.jsx)(d.Z,{onUseLoraClick:h})}),modalStyle:{maxWidth:"1600px",minHeight:"calc(100vh - 32px)",width:"calc(100% - 32px)"}})},children:(0,r.jsx)(a.Z,{})}),(0,r.jsx)(n.Z,{onClick:()=>{c.ZP.show("modal",{children:(0,r.jsx)(x.Suspense,{children:(0,r.jsx)(d.Z,{onUseLoraClick:h,searchType:"favorite"})}),modalStyle:{maxWidth:"1600px",minHeight:"calc(100vh - 32px)",width:"100%"}})},children:(0,r.jsx)(l.Z,{})}),(0,r.jsx)(n.Z,{onClick:()=>{c.ZP.show("modal",{children:(0,r.jsx)(x.Suspense,{children:(0,r.jsx)(d.Z,{onUseLoraClick:h,searchType:"recent"})}
1),modalStyle:{maxWidth:"1600px",minHeight:"calc(100vh - 32px)",width:"100%"}})},children:(0,r.jsx)(i.Z,{})})]})}),e.loras.length>0&&(0,r.jsx)("div",{className:"w-full col",children:e.loras.map((e,t)=>(0,r.jsx)("div",{className:"w-full col",children:(0,r.jsx)(y,{lora:e})},"".concat(e.name,"_").concat(t)))})]})}},21309:function(e,t,s){"use strict";s.d(t,{Z:function(){return U}});var r=s(57437),a=s(93033),l=s(96048),i=s(16105),n=s(90938),o=s(78967),c=s(47386),d=s(50931),u=s(27831),h=s(2265),m=s(10338),p=s(81125),g=s(80896),x=s(9390);let f=null,b=async e=>{let{input:t,page:r=1,limit:a=20,type:l="LORA",signal:i,url:n}=e;return new Promise(e=>{f||(f=new Worker(s.tu(new URL(s.p+s.u(6835),s.b))));let o=setTimeout(()=>{u||(u=!0,e({items:[],metadata:{},error:!0}))},x.$.CIVITAI_API_TIMEOUT_MS),c=t=>{clearTimeout(o),u||("result"===t.data.type?(u=!0,e({items:t.data.data.items||[],metadata:t.data.data.metadata||{},error:!1,cached:t.data.cached||!1})):"error"===t.data.type&&(u=!0,e({items:[],metadata:{},error:!0}))),null==f||f.removeEventListener("message",c)};f.addEventListener("message",c),f.onerror=t=>{clearTimeout(o),console.error("Worker error:",t),e({items:[],metadata:{},error:!0}),null==f||f.removeEventListener("message",c)};let d=g.d.get("civitAiBaseModelFilter");f.postMessage({searchParams:{input:t,page:r,limit:a,type:l,url:n},userBaseModelFilters:d,API_BASE_URL:"https://civitai.com/api/v1"});let u=!1;if(i){if(i.aborted){u=!0,e({items:[],metadata:{},error:!0});return}i.addEventListener("abort",()=>{u||(clearTimeout(o),u=!0,e({items:[],metadata:{},error:!0}),null==f||f.removeEventListener("message",c))})}})},v=function(e){let{input:t,page:s=1,limit:r=20,type:a}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i="";l.includes("SD 1.x")&&(i+=["1.4","1.5","1.5 LCM"].map(e=>"&baseModels=SD "+e).join("")),l.includes("SD 2.x")&&(i+=["2.0","2.0 768","2.1","2.1 768","2.1 Unclip"].map(e=>"&baseModels=SD "+e).join("")),l.includes("SDXL")&&(i+=["0.9","1.0","1.0 LCM","Turbo"].map(e=>"&baseModels=SDXL "+e).join("")),l.includes("Pony")&&(i+="&baseModels=Pony"),l.includes("Flux")&&(i+=["Flux.1 S","Flux.1 D"].map(e=>"&baseModels="+e).join("")),l.includes("NoobAI")&&(i+="&baseModels=NoobAI"),l.includes("Illustrious")&&(i+="&baseModels=Illustrious"),i=i.replace(/ /g,"%20");let n="types=LORA&types=LoCon";"TextualInversion"===a?n="types=TextualInversion":"LoCon"===a&&(n="types=LoCon");let o="&nsfw=".concat(l.includes("NSFW")),c="limit=".concat(r).concat(t?"&query=".concat(t):"").concat(t?"":"&page=".concat(s)).concat(o).concat(i);return"".concat(n,"&sort=Highest%20Rated&").concat(c)},w=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return v({input:e,page:1,limit:20,type:t},s)},j=()=>new AbortController,y=e=>e instanceof DOMException&&"AbortError"===e.name?(console.log("Request was aborted"),""):(console.error("Error fetching CivitAI results:",e),"An error occurred while fetching data."),N=(e,t)=>w(e,t,g.d.get("civitAiBaseModelFilter")||[]);var k=s(40018);function _(e){let{onSelectionChange:t=()=>{}}=e,[s,a]=(0,h.useState)(g.d.get("civitAiBaseModelFilter")),l=e=>{a(s=>{let r=s.includes(e)?s.filter(t=>t!==e):[...s,e];return g.d.set("civitAiBaseModelFilter",r),t(r),r})};return(0,r.jsx)(k.default,{className:"flex items-center justify-center px-4",children:(0,r.jsx)("div",{className:"flex flex-wrap justify-center items-center gap-4 w-full max-w-4xl",children:[{label:"SD 1.x",value:"SD 1.x"},{label:"SD 2.x",value:"SD 2.x"},{label:"SDXL",value:"SDXL"},{label:"Pony",value:"Pony"},{label:"Flux.1",value:"Flux"},{label:"NoobAI",value:"NoobAI"},{label:"Illustrious",value:"Illustrious"},{label:"Show NSFW?",value:"NSFW"}].map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-1 whitespace-nowrap",children:[(0,r.jsx)("input",{id:"checkbox-".concat(e.value),type:"checkbox",checked:s.includes(e.value),onChange:()=>l(e.value),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),(0,r.jsx)("label",{htmlFor:"checkbox-".concat(e.value),className:"text-sm font-medium text-gray-900 dark:text-gray-300",children:e.label})]},e.value))})})}var C=s(50011),Z=s.n(C),S=s(93575),P=s(30213),A=e=>{let[t,s]=(0,h.useState)(0);return(0,h.useEffect)(()=>{let t=e.current,r=new ResizeObserver(e=>{e[0]&&s(e[0].contentRect.width)});return t&&r.observe(t),()=>{t&&r.unobserve(t)}},[e]),t},F=e=>{let{civitAiType:t="LORA",onUseLoraClick:s=()=>{},image:l}=e,i=g.d.get("civitAiBaseModelFilter"),n=(0,h.useRef)(null),o=A(n);return l?(0,r.jsxs)("div",{className:Z()["image-item"],onClick:()=>{a.ZP.show("embeddingDetails",{children:(0,r.jsx)(S.Z,{civitAiType:t,details:l.details,onUseLoraClick:s}
1),id:"LoraDetails"})},ref:n,style:{width:"100%",height:"".concat(o/4*5,"px"),padding:0,position:"relative",maxHeight:"400px",maxWidth:"320px"},children:[(0,r.jsx)("img",{src:l.src,alt:l.name,style:{maxHeight:"400px",width:"100%",height:"100%",objectFit:"cover",filter:!i.includes("NSFW")&&l.nsfwLevel>=7?"blur(12px)":"none"}}),(0,r.jsxs)("div",{style:{alignItems:"center",backgroundColor:"black",bottom:"64px",color:"white",display:"flex",flexDirection:"row",fontSize:"12px",fontWeight:"bold",gap:"8px",height:"24px",padding:"4px",left:0,position:"absolute",opacity:.9},children:[(0,r.jsx)(P.Z,{stroke:1}),l.baseModel]}),(0,r.jsxs)("div",{className:"row items-center justify-center font-bold text-xs px-2 text-center",style:{backdropFilter:"blur(10px)",bottom:0,height:"64px",left:0,position:"absolute",right:0},children:[(0,r.jsx)("div",{className:"text-white font-bold z-10",children:l.name}),(0,r.jsx)("div",{className:"z-1",style:{backgroundColor:"black",opacity:.4,bottom:0,height:"64px",left:0,position:"absolute",right:0}})]})]}):null},I=s(91802);let R=e=>{let[t,s]=(0,h.useState)(null);return(0,h.useEffect)(()=>{let t=()=>{e.current?s(e.current.offsetWidth):s(window.innerWidth)};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[e]),t};var L=e=>{let{children:t,gap:s=20,containerRef:a}=e,l=(0,h.useRef)(null),i=R(a||l);if(!t||!i)return null;let n=2;i>1900?n=7:i>1700?n=6:i>1500?n=5:i>1200?n=4:i>1e3?n=3:i>800&&(n=2);let o=h.Children.toArray(t);o.length<n&&(n=o.length);let c={},d=[];for(let e=0;e<n;e++)c["column".concat(e)]=[];for(let e=0;e<o.length;e++){let t=e%n;c["column".concat(t)].push((0,r.jsx)("div",{style:{marginBottom:"".concat(s,"px")},children:o[e]},"image_".concat(e,"_col_").concat(t)))}for(let e=0;e<n;e++)d.push((0,r.jsx)("div",{style:{marginLeft:"".concat(e>0?s:0,"px"),flex:1},className:"is_col",children:c["column".concat(e)]},"col_".concat(e)));return(0,r.jsx)("div",{style:{display:"flex"},ref:a||l,children:d})};s(524);var E=s(61994),M=s(23018),T=s.n(M);function D(e){let{style:t,size:s=50}=e;return(0,r.jsx)("svg",{viewBox:"0 0 50 50",width:s,height:s,className:T().styledSVG,style:t,children:(0,r.jsx)("circle",{cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"5",className:T().styledCircle})})}function U(e){let{civitAiType:t="LORA",onUseLoraClick:s=()=>{},searchType:x="search"}=e,{currentPage:f,debouncedSearchRequest:v,pendingSearch:w,searchResults:k,goToNextPage:C,goToPreviousPage:Z,hasNextPage:S,hasPreviousPage:P,setLocalFilterTermAndResetPage:A}=function(e){let{searchType:t="search",type:s="LORA"}=e,[r,a]=(0,h.useState)({currentPage:1,currentPageUrl:null,nextPageUrl:null,previousPages:[],previousPageUrls:[]}),[l,i]=(0,h.useState)(""),[n,o]=(0,h.useState)(!1),[c,d]=(0,h.useState)([]),[u,x]=(0,h.useState)(!1),[f,v]=(0,h.useState)(""),w=(0,h.useRef)(null),k=(0,h.useRef)(!1),_=(0,h.useRef)(!1),C=(0,h.useRef)(null),Z=(0,h.useRef)(""),S=(0,h.useRef)(!0),P=(0,h.useRef)(0),A=(0,h.useRef)(null),F=(0,h.useCallback)(async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if("favorite"===t||"recent"===t){let l=await (0,p.eZ)("LORA"===s?"lora":"ti",t,e,r);d(l.items),a(e=>({currentPage:r,currentPageUrl:1===r?null:"page=".concat(r),nextPageUrl:l.currentPage<l.totalPages?"next":null,previousPages:r>1?[...e.previousPages,"page=".concat(r-1)]:[],previousPageUrls:e.previousPageUrls}))}},[t,s]),I=(0,h.useCallback)(e=>{i(e),a(()=>({currentPage:1,currentPageUrl:null,nextPageUrl:null,previousPages:[],previousPageUrls:[]}))},[]),R=(0,h.useCallback)(async(e,t)=>{++P.current,A.current&&A.current.cancel();let l=g.d.get("civitAiBaseModelFilter").sort().join(","),i=t||"search:".concat(e||"","_page:").concat(r.currentPage,"_type:").concat(s,"_filters:").concat(l);if(C.current===i&&c.length>0)return;k.current=!0,C.current=i,x(!1),o(!0);let n=j();w.current&&!t&&e!==Z.current&&void 0!==e&&w.current.abort(),w.current=n;try{let l=await b({input:e,page:t?void 0:r.currentPage,type:s,signal:n.signal,url:t});if(!S.current)return;if(l.error)x("Unable to load data from CivitAI, please try again shortly.");else{d(l.items);let r=l.metadata.nextPage||null;if(t){let e=t===r;a(s=>({...s,currentPageUrl:t,nextPageUrl:e?null:r}))}else{v(e||""),C.current=null;let t=N(e,s);a(()=>({currentPage:1,currentPageUrl:t,nextPageUrl:r,previousPages:[],previousPageUrls:[]}))}}}catch(t){let e=y(t);e&&x(e)}finally{k.current=!1,_.current=!1,S.current&&o(!1)}},[r.currentPage,s,c.length]);(0,h.useEffect)(()=>(A.current=(0,m.D)(R,500),()=>{A.current&&A.current.cancel()}),[R]);let L=(0,h.useCallback)(e=>{A.current&&A.current(e)},[]),E=(0,h.useCallback)(async()=>
1{if(r.nextPageUrl&&!k.current){_.current=!0;let e=r.currentPageUrl;a(t=>({...t,currentPage:t.currentPage+1,previousPages:[...t.previousPages,"page=".concat(t.currentPage)],previousPageUrls:[...t.previousPageUrls,...e?[e]:[]]})),await R(void 0,r.nextPageUrl),_.current=!1}},[r.nextPageUrl,r.currentPageUrl,R]),M=(0,h.useCallback)(async()=>{if(r.currentPage>1&&!k.current){if(_.current=!0,r.previousPageUrls.length>0){let e=r.previousPageUrls[r.previousPageUrls.length-1],t=2===r.currentPage;if(a(t=>({...t,currentPage:t.currentPage-1,currentPageUrl:e,previousPages:t.previousPages.slice(0,-1),previousPageUrls:t.previousPageUrls.slice(0,-1)})),t){let e=N(f,s);await R(void 0,e)}else e?await R(void 0,e):await R(f||"")}else a(()=>({currentPage:1,currentPageUrl:null,nextPageUrl:null,previousPages:[],previousPageUrls:[]})),await R(f||"");_.current=!1}},[r.currentPage,r.previousPageUrls,f,R,s]);return(0,h.useEffect)(()=>{(async()=>{try{"favorite"===t||"recent"===t?(o(!0),await F(l,r.currentPage),o(!1)):"search"!==t||1!==r.currentPage||_.current||0!==c.length&&f===Z.current||(Z.current=f,C.current=null,await R(f))}catch(e){console.error("Error fetching data:",e),x("An error occurred while fetching data."),o(!1)}})()},[t,l,f,r.currentPage,c.length,F,R]),(0,h.useEffect)(()=>{("favorite"===t||"recent"===t)&&a(()=>({currentPage:1,currentPageUrl:null,nextPageUrl:null,previousPages:[],previousPageUrls:[]}))},[t]),(0,h.useEffect)(()=>(S.current=!0,()=>{S.current=!1,A.current&&A.current.cancel()}),[]),{currentPage:r.currentPage,debouncedSearchRequest:L,fetchCivitAiResults:R,hasError:u,pendingSearch:n,searchResults:c,goToNextPage:E,goToPreviousPage:M,hasNextPage:!!r.nextPageUrl,hasPreviousPage:r.previousPages.length>0,setLocalFilterTermAndResetPage:I}}({searchType:x,type:t}),R=(0,h.useRef)(null),M=(0,h.useRef)(null),[T,U]=(0,h.useState)(!1),[O,G]=(0,h.useState)(""),[B,W]=(0,h.useState)(!1);(0,h.useEffect)(()=>{console.log("[LoraSearch] Focus effect running"),M.current&&setTimeout(()=>{M.current.focus()},400)},[]),console.log("[LoraSearch] Transforming data, searchResults:",k.length);let z=k.map(e=>{var t,s;let r;if("modelVersions"in e){let s=e.modelVersions[0]||{},a=(null===(t=s.images)||void 0===t?void 0:t[0])||{};r={key:String(e.id),name:e.name,baseModel:s.baseModel,nsfwLevel:a.nsfwLevel,src:a.url,width:a.width,height:a.height,details:e}}else if("model"in e){let t=e.model,a=t.modelVersions[0]||{},l=(null===(s=a.images)||void 0===s?void 0:s[0])||{};r={key:String(t.id),name:t.name,baseModel:a.baseModel,nsfwLevel:l.nsfwLevel,src:l.url,width:l.width,height:l.height,details:t}}return r}).filter(e=>void 0!==e),H="LORA"===t?"LoRA":"Embedding",q="".concat(H," Search");"favorite"===x?q="Favorite ".concat(H,"s"):"recent"===x&&(q="Recently used ".concat(H,"s"));let V="Enter LoRA or Lycoris name";return T&&(V="Enter CivitAI version ID"),"TextualInversion"===t&&(V="Enter textual inversion or embedding name"),(0,r.jsxs)("div",{className:"col w-full h-full",ref:R,children:[(0,r.jsxs)("h2",{className:"row font-bold",children:[q," ",(0,r.jsx)("span",{className:"text-xs font-normal",children:"(via CivitAI)"})]}),(0,r.jsxs)("div",{className:"row w-full",children:["search"===x&&"LORA"===t&&(0,r.jsx)(u.Z,{outline:!T,onClick:()=>{G(""),U(!T)},title:"Input by version ID",children:(0,r.jsx)(l.Z,{})}),(0,r.jsx)("input",{className:"bg-gray-50 border border-gray-300 text-gray-900 text-[16px] rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:V,onChange:e=>{let t=e.target.value.trim();G(e.target.value),"favorite"===x||"recent"===x?A(t.trim()):(console.log("[LoraSearch] Calling debouncedSearchRequest with:",t.trim()),v(t.trim()))},ref:M,value:O}),(0,r.jsx)(u.Z,{theme:"danger",onClick:()=>{G(""),v("")},children:(0,r.jsx)(i.Z,{})}),T&&(0,r.jsx)(u.Z,{disabled:!O.trim(),onClick:()=>{s(new I.uL({id:O.trim(),civitAiType:"LORA",versionId:O.trim(),versionName:"",isArtbotManualEntry:!0,name:O.trim(),strength:1,clip:1})),a.ZP.remove("modal")},title:"Use LoRA by Version ID",children:(0,r.jsx)(n.Z,{})}),!T&&(0,r.jsx)(u.Z,{outline:!B,onClick:()=>{W(!B)},children:(0,r.jsx)(o.Z,{})})]}),B&&!T&&(0,r.jsx)(_,{onSelectionChange:()=>{v(O.trim())}}),T&&(0,r.jsx)("div",{children:"Enter CivitAI version ID in order to directly use LoRA."}),!T&&!w&&O.trim()&&0===k.length&&(0,r.jsx)("div",{className:"w-full row justify-center items-center",children:"No results found."}),(0,r.jsxs)("div",{className:"relative min-h-[200px]",children:[w&&!T&&(0,r.jsx)("div",{className:"absolute inset-0 bg-white/80 dark:bg-gray-900/80 z-10 flex items-center justify-center rounded-lg backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,r.jsx)(D,{size:60}),(0,r.jsx)("div",{className:"text-lg font-medium text-gray-700 dark:text-gray-300",children:"Loading results..."})]})}),(0,r.jsx)("div",{className:(0,E.Z)(w&&"opacity-50"),children:(0,r.jsx)(L,{containerRef:R,children:z.map(e=>(0,r.jsx)("div",{style:{width:"100%",marginBottom:"20px"},children:(0,r.jsx)(F,{civitAiType:t,onUseLoraClick:s,image:e})},"".concat(e.key)))})})]}),(P||S)&&(0,r.jsxs)("div",{className:"w-full row justify-center gap-2 items-center",children:[(0,r.jsx)("div",{className:(0,E.Z)("cursor-pointer transition-opacity",P&&!w?"primary-color":"text-gray-400",w&&"opacity-50 cursor-not-allowed"),onClick:()=>{P&&!w&&Z()},children:(0,r.jsx)(c.Z,{})}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{children:f}),w&&(0,r.jsx)(D,{size:16})]}),(0,r.jsx)("div",{className:(0,E.Z)("cursor-pointer transition-opacity",S&&!w?"primary-color":"text-gray-400",w&&"opacity-50 cursor-not-allowed"),onClick:()=>{S&&!w&&C()},children:(0,r.jsx)(d.Z,{})})]})]})}},18421:function(e,t,s){"use strict";s.d(t,{default:function(){return x}});var r=s(57437),a=s(93033),l=s(73680),i=s(17858),n=s(27831),o=s(68301),c=s(30408),d=s(2265),u=s(79931),h=s(41110),m=s(50905),p=e=>{let{handleSelectModel:t}=e,{availableModels:s,modelDetails:a}=(0,m.o)(u.EA),l=(0,d.useRef)(null);return(0,d.useEffect)(()=>{l.current&&setTimeout(()=>{window.scrollTo(0,0)},100)},[]),(0,r.jsx)("div",{ref:l,children:(0,r.jsxs)("div",{className:"col pt-4",children:[(0,r.jsx)("h2",{className:"row font-bold",children:"Image models"}),(0,r.jsx)(h.default,{isModal:!0,modelsAvailable:s,modelDetails:a,onUseModel:t})]})})},g=s(70837);function x(){let{availableModels:e,modelDetails:t}=(0,m.o)(u.EA),{input:s,setInput:d}=(0,i.G)(),h=t=>{let s=e.find(e=>e.name===t);return(null==s?void 0:s.count)?" (".concat(s.count,")"):""},x=e=>{var r,a,l,i;if(!e||!e.value)return;let n=e.value,o={baseline:null!==(l=null===(r=t[n])||void 0===r?void 0:r.baseline)&&void 0!==l?l:"",version:null!==(i=null===(a=t[n])||void 0===a?void 0:a.version)&&void 0!==i?i:""},c=n.toLowerCase().indexOf("pony")>=0,u={models:[n],modelDetails:o};c&&s.clipskip<2&&(u.clipskip=2),d(u)};return(0,r.jsx)(l.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Image model"}),children:(0,r.jsxs)("div",{className:"w-full row",children:[(0,r.jsx)(g.Z,{onChange:e=>x(e),options:e.map(e=>({value:e.name,label:e.name+h(e.name)})),value:{value:s.models[0],label:s.models[0]?"".concat(s.models[0]).concat(h(s.models[0])):s.models[0]}}),(0,r.jsx)(n.Z,{onClick:()=>{d({models:[e[Math.floor(Math.random()*e.length)].name]})},children:(0,r.jsx)(o.Z,{})}),(0,r.jsx)(n.Z,{onClick:()=>{a.ZP.show("modal",{children:(0,r.jsx)(p,{handleSelectModel:e=>{e&&(d({models:[e]}),a.ZP.remove("modal"))}}),modalClassName:"w-full md:min-w-[640px] max-w-[648px]"})},children:(0,r.jsx)(c.Z,{})})]})})}},89003:function(e,t,s){"use strict";s.d(t,{default:function(){return o}});var r=s(57437),a=s(17858),l=s(91087),i=s(73680);
1let n=[{value:"DDIM",label:"DDIM"},{value:"k_dpm_2_a",label:"k_dpm_2_a"},{value:"k_dpm_2",label:"k_dpm_2"},{value:"k_dpm_adaptive",label:"k_dpm_adaptive"},{value:"k_dpm_fast",label:"k_dpm_fast"},{value:"k_dpmpp_2m",label:"k_dpmpp_2m"},{value:"k_dpmpp_2s_a",label:"k_dpmpp_2s_a"},{value:"k_dpmpp_sde",label:"k_dpmpp_sde"},{value:"k_euler_a",label:"k_euler_a"},{value:"k_euler",label:"k_euler"},{value:"k_heun",label:"k_heun"},{value:"k_lms",label:"k_lms"},{value:"lcm",label:"lcm"}];function o(){let{input:e,setInput:t}=(0,a.G)();return(0,r.jsx)(i.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Sampler"}),children:(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)(l.Z,{onChange:e=>{t({sampler:e.value})},options:n.map(e=>({value:e.value,label:e.label})),value:{value:e.sampler,label:e.sampler}})})})}},17965:function(e,t,s){"use strict";s.d(t,{default:function(){return c}});var r=s(57437),a=s(17858),l=s(73680),i=s(27831),n=s(95563),o=s(16105);function c(){let{input:e,setInput:t}=(0,a.G)();return(0,r.jsx)(l.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Seed"}),children:(0,r.jsxs)("div",{className:"w-full row",children:[(0,r.jsx)("input",{className:"bg-gray-50 border border-gray-300 text-gray-900 text-[16px] rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",onChange:e=>t({seed:e.target.value}),value:e.seed}),(0,r.jsxs)("div",{className:"row gap-1",children:[(0,r.jsx)(i.Z,{title:"Insert random seed",onClick:()=>{t({seed:Math.abs(4294967296*Math.random()|0)})},children:(0,r.jsx)(n.Z,{})}),(0,r.jsx)(i.Z,{disabled:""===e.seed,theme:"danger",title:"Clear seed",onClick:()=>{t({seed:""})},children:(0,r.jsx)(o.Z,{})})]})]})})}},51930:function(e,t,s){"use strict";s.d(t,{default:function(){return n}});var r=s(57437),a=s(17858),l=s(92280),i=s(73680);function n(){let{input:e,setInput:t}=(0,a.G)();return(0,r.jsx)(i.Z,{className:"row md:row",title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Steps"}),children:(0,r.jsx)("div",{className:"",children:(0,r.jsx)(l.Z,{min:1,max:50,onBlur:()=>{isNaN(e.steps)?t({steps:24}):t({steps:parseFloat(Number(e.steps).toFixed(0))})},onChange:e=>{t({steps:Number(e)})},onMinusClick:()=>{Number(e.steps)-1<1||t({steps:Number(e.steps)-1})},onPlusClick:()=>{Number(e.steps)+1>50||t({steps:Number(e.steps)+1})},value:e.steps})})})}},6761:function(e,t,s){"use strict";s.d(t,{default:function(){return y}});var r=s(57437),a=s(17858),l=s(73680),i=s(68301),n=s(91443),o=s(91087),c=s(93033),d=s(16105),u=s(63454),h=s(16393),m=s(2265),p=s(27831),g=e=>{let[t,s]=(0,m.useState)(!1),r=(0,m.useRef)(null),a=(0,m.useRef)(null);return(0,m.useEffect)(()=>{let t=r.current,l=new IntersectionObserver(e=>{let[t]=e;s(t.isIntersecting)},e);return a.current=l,t&&l.observe(t),()=>{t&&l.unobserve(t)}},[e]),{ref:r,isIntersecting:t,stopObserving:()=>{a.current&&r.current&&a.current.unobserve(r.current)}}},x=s(3392),f=s(93926),b=s(85922);let v=e=>{let{src:t,alt:s,fallbackColor:a,style:l}=e,{ref:i,isIntersecting:n,stopObserving:o}=g({rootMargin:"0px 0px 500px 0px",threshold:.5}),[c,d]=(0,m.useState)(!1),[u,h]=(0,m.useState)(!1);return(0,r.jsxs)("div",{ref:i,style:{width:"200px",height:"200px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:u?a:"transparent",borderRadius:"4px",...l},children:[!n&&!c&&!u&&(0,r.jsx)("div",{style:{width:"100%",height:"100%",backgroundColor:a}}),(n||c)&&(0,r.jsx)("img",{src:t,alt:s,onLoad:()=>{d(!0),o()},onError:()=>{h(!0),o()},style:{display:c?"block":"none",width:"100%",height:"100%",objectFit:"cover"}})]})};var w=e=>{let{categories:t,previews:s,handleOnClick:a=()=>{}}=e,[l,n]=(0,m.useState)(""),[o,g]=(0,m.useState)("person"),w=((e,t)=>{if(!t)return e;let s=t.toLowerCase();return Object.keys(e).reduce((t,r)=>{let a=e[r].filter(e=>e.toLowerCase().includes(s));return a.length>0&&(t[r]=a),t},{})})(t,l);return(0,r.jsxs)("div",{className:"col w-full h-full",children:[(0,r.jsx)("h2",{className:"row font-bold",children:"Style Presets"}),(0,r.jsxs)("div",{className:"row w-full mb-2",children:[(0,r.jsx)("input",{className:"bg-gray-50 border border-gray-300 text-gray-900 text-[16px] rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Filter presets",onChange:e=>{n(e.target.value)},value:l}),(0,r.jsx)(p.Z,{theme:"danger",onClick:()=>{n("")},children:(0,r.jsx)(d.Z,{})}),(0,r.jsxs)(x.Z,{menuButton:(0,r.jsx)(p.Z,{as:"div",onClick:()=>{},title:"View other preset example images",children:(0,r.jsx)(u.Z,{})}),shift:-120,children:[(0,r.jsx)(f.t,{children:"View examples"}),(0,r.jsxs)(b.s,{onClick:()=>{g("person")},children:[(0,r.jsx)("div",{className:"w-[20px] pr-1",children:"person"===o&&(0,r.jsx)(h.Z,{size:12})}),"Person"]}),(0,r.jsxs)(b.s,{onClick:()=>{g("place")},children:[(0,r.jsx)("div",{className:"w-[20px] pr-1",children:"place"===o&&(0,r.jsx)(h.Z,{size:12})}),"Place"]}),(0,r.jsxs)(b.s,{onClick:()=>{g("thing")},children:[(0,r.jsx)("div",{className:"w-[20px] pr-1",children:"thing"===o&&(0,r.jsx)(h.Z,{size:12})}),"Thing"]})]})]}),Object.keys(w).map(e=>w[e]&&0!==w[e].length?(0,r.jsxs)("div",{className:"w-full col mb-6",children:[(0,r.jsxs)("h3",{className:"font-bold text-[18px] row gap-2",children:[e,(0,r.jsx)("button",{onClick:()=>{let t=w[e],s=t[Math.floor(Math.random()*t.length)];s&&(a(s),c.ZP.remove("modal"))},title:"Select random style",children:(0,r.jsx)(i.Z,{className:"primary-color"})})]}),(0,r.jsx)("div",{className:"row w-full gap-2 flex-wrap",children:(0,r.jsx)("div",{className:"row w-full gap-2 flex-wrap",children:w[e].map(t=>t?(0,r.jsxs)("div",{style:{cursor:"pointer",width:"200px",height:"auto",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"center"},onClick:()=>{a(t)},children:[(0,r.jsx)(v,{src:s[t]&&t?s[t][o]:"",alt:t,fallbackColor:"gray"}),(0,r.jsx)("div",{style:{width:"200px",padding:"4px",textAlign:"center",wordWrap:"break-word",whiteSpace:"normal",fontSize:"12px"},children:t})]},"".concat(e,"-").concat(t)):null)})})]},e):null)]})},j=s(50890);function y(e){let{categories:t,presets:s,previews:d}
1=e,{input:u,setInput:h}=(0,a.G)(),m=(0,j.X)(h),g=[{label:"None",value:"none"}];return u.preset.length>0&&(g=[{label:u.preset[0].name,value:u.preset[0].name}]),(0,r.jsx)(l.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Style preset"}),children:(0,r.jsxs)("div",{className:"w-full row",children:[(0,r.jsx)(o.Z,{hideDropdown:!0,onClick:()=>{c.ZP.show("modal",{children:(0,r.jsx)(w,{categories:t,presets:s,previews:d,handleOnClick:e=>{m(e,s[e]),c.ZP.remove("modal")}}),modalClassName:"w-full md:min-w-[640px] max-w-[648px]"})},onChange:()=>{},options:g,value:g[0]}),(0,r.jsx)(p.Z,{onClick:()=>{let e=Object.keys(s),t=e[Math.floor(Math.random()*e.length)];m(t,s[t])},children:(0,r.jsx)(i.Z,{})}),(0,r.jsx)(p.Z,{theme:"danger",onClick:()=>h({preset:[]}),children:(0,r.jsx)(n.Z,{})})]})})}},63104:function(e,t,s){"use strict";s.d(t,{default:function(){return j}});var r=s(57437),a=s(78666),l=s(2265),i=s(73619),n=s(79356),o=s(91443),c=s(78359),d=s(83231),u=s.n(d),h=s(13683),m=s(17858),p=s(77490),g=s(40018),x=s(92280),f=s(29223),b=s(34357),v=s(9390);let w={quality:.95,maxWidth:3072,maxHeight:3072};function j(){let{setInput:e,sourceImages:t,setSourceImages:d}=(0,m.G)(),j=(0,l.useCallback)(async s=>{d([...t,s]),await (0,b.pg)(s),0===t.length?e({source_processing:p.C.Img2Img}):t.length>=1&&e({source_processing:p.C.Remix})},[e,d,t]),y=(0,l.useCallback)(async(e,s)=>{let r=t.map(t=>t.image_id===e?{...t,strength:s}:t);await (0,b.vo)(e,"strength",s),d(r)},[d,t]),N=(0,l.useCallback)(async s=>{d(t.filter(e=>e.image_id!==s)),await (0,b.uV)(s),0===t.length&&e({source_processing:p.C.Prompt})},[e,d,t]),k=(0,l.useCallback)(async e=>{let{source_image:s}=e,r=await (0,c.vZ)(s),a={artbot_id:v.$.IMAGE_UPLOAD_TEMP_ID,apiResponse:"",horde_id:"",image_id:(0,i.x0)(v.$.NANO_ID_LENGTH),imageType:h.__.SOURCE,imageStatus:h.zu.OK,model:"",imageBlobBuffer:r,seed:"",worker_id:"",worker_name:"",kudos:"0"};t.length>=1&&(a.strength=1),await j(a)},[j,t]),_=(0,l.useCallback)(async e=>{let[t]=e,r=new FileReader;r.onabort=()=>console.log("file reading was aborted"),r.onerror=()=>console.log("file reading has failed"),r.onload=async()=>{let e;let{readAndCompressImage:r}=await s.e(7356).then(s.t.bind(s,37356,23)),a=await r(t,w);if(a&&(e=await (0,c.y3)(a)),!e)return;let[,l]=e.split(";base64,");try{let{croppedBase64:e}=await (0,c.tf)(l),t=await (0,c.q$)(e);if(!t)return;k({source_image:t})}catch(e){console.error("Error cropping the image:",e)}};try{r.readAsDataURL(t)}catch(e){console.error("Upload image error: ".concat(e))}},[k]),{fileRejections:C,getRootProps:Z,getInputProps:S,isDragActive:P}=(0,a.uI)({accept:{"image/*":[]},maxFiles:1,onDrop:_});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(g.default,{accordion:!0,anchor:"upload",title:"Upload image",children:[(0,r.jsx)("div",{className:"text-sm text-white mb-2",children:"Upload a source image for use with ControlNet or img2img features."}),(null==C?void 0:C.length)>0&&(0,r.jsx)("div",{className:"mb-2 text-red-500 text-lg font-bold",children:"Please upload a single valid image file!"}),(0,r.jsxs)("div",{className:u().Dropzone,...Z(),children:[(0,r.jsx)("input",{...S()}),(0,r.jsx)(n.Z,{style:{display:"block"}}),P?"drop image here":(0,r.jsx)("div",{children:"drag image or click to upload"})]})]}),t.length>0&&(0,r.jsx)(g.default,{accordion:!0,initiallyExpanded:!0,anchor:"uploaded-images",title:"Uploaded images (".concat(t.length," / 5)"),children:t.map((e,t)=>(0,r.jsxs)("div",{children:[t>0&&(0,r.jsx)("div",{className:"border-dotted",style:{borderTop:"1px dotted white"}}),(0,r.jsxs)("div",{className:"relative col gap-1",children:[(0,r.jsx)("div",{className:"absolute top-1 right-1 w-[24px] h-[24px] opacity-45",children:(0,r.jsx)("div",{className:"absolute top-0 left-0 right-0 bottom-0 bg-black z-0"})}),(0,r.jsx)("div",{className:"absolute top-1 right-1 cursor-pointer",onClick:()=>{N(e.image_id)},children:(0,r.jsx)("div",{className:"text-white opacity-100 z-10",children:(0,r.jsx)(o.Z,{className:"text-white"})})}),(0,r.jsx)(f.Z,{alt:"uploaded image",image_id:e.image_id}),t>0&&(0,r.jsx)("div",{children:(0,r.jsxs)("label",{className:"options-label",children:["Stregth:",(0,r.jsx)("div",{className:"max-w-[140px]",children:(0,r.jsx)(x.Z,{min:.05,max:1,onBlur:()=>{isNaN(e.strength)?y(e.image_id,1):y(e.image_id,parseFloat(Number(e.strength).toFixed(2)))},onChange:t=>{y(e.image_id,t)},onMinusClick:()=>{Number(e.strength)-.05<.05||y(e.image_id,parseFloat((Number(e.strength)-.05).toFixed(2)))},onPlusClick:()=>{Number(e.strength)+.05>1||y(e.image_id,parseFloat((Number(e.strength)+.05).toFixed(2)))},value:e.strength})})]})})]},e.image_id)]},"uploaded-image-".concat(e.image_id)))})]})}},84923:function(e,t,s){"use strict";s.d(t,{default:function(){return u}});var r=s(57437),a=s(2265),l=s(62596),i=s(17858),n=s(91087),o=s(27831),c=s(73680);let d=[{value:"4x_AnimeSharp",label:"4x_AnimeSharp"},{value:"NMKD_Siax",label:"NMKD_Siax"},{value:"RealESRGAN_x2plus",label:"RealESRGAN_x2plus"},{value:"RealESRGAN_x4plus_anime_6B",label:"RealESRGAN_x4plus_anime_6B"},{value:"RealESRGAN_x4plus",label:"RealESRGAN_x4plus"}];
1function u(){let{input:e,setInput:t}=(0,i.G)(),[s,u]=(0,a.useState)([]),h=r=>{let a=s.filter(e=>e!==r),l=e.post_processing.filter(e=>e!==r);u(a),t({post_processing:l})};return(0,a.useEffect)(()=>{let t=e.post_processing;u(t.filter(e=>"4x_AnimeSharp"===e||"NMKD_Siax"===e||"RealESRGAN_x2plus"===e||"RealESRGAN_x4plus_anime_6B"===e||"RealESRGAN_x4plus"===e))},[e.post_processing]),(0,r.jsxs)("div",{className:"col",children:[(0,r.jsx)(c.Z,{title:(0,r.jsx)("span",{className:"row font-bold text-sm text-white gap-1",children:"Upscalers"}),children:(0,r.jsx)("div",{className:"w-full",children:(0,r.jsx)(n.Z,{onChange:r=>{s.includes(r.value)||(u([...s,r.value]),t({post_processing:[...e.post_processing,r.value]}))},options:d,value:{value:"",label:"None"}})})}),s.length>0&&(0,r.jsx)("div",{className:"col gap-3",children:s.map(e=>(0,r.jsxs)("div",{className:"row  gap-3 font-mono",children:[(0,r.jsx)(o.Z,{theme:"danger",onClick:()=>h(e),children:(0,r.jsx)(l.Z,{})}),e]},"upscale_processor-".concat(e)))})]})}},92280:function(e,t,s){"use strict";var r=s(57437),a=s(76295),l=s(35515),i=s(27831);t.Z=e=>{let{disabled:t=!1,min:s=0,max:n=100,value:o,onBlur:c=()=>{},onChange:d=()=>{},onMinusClick:u=()=>{},onPlusClick:h=()=>{}}=e,m=()=>{Number(o)<=s||t||u()},p=()=>{Number(o)>=n||t||h()};return(0,r.jsxs)("div",{className:"row gap-0 items-start",children:[(0,r.jsx)("input",{className:"bg-gray-50 border border-gray-300 text-gray-900 text-[16px] rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-[100px] p-2 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 rounded-r-none",onBlur:c,onChange:e=>d(e.target.value),onKeyDown:e=>{e=e||window.event,t||(("ArrowUp"===e.code||"Equal"===e.code||"NumpadAdd"===e.code)&&(e.preventDefault(),p()),("ArrowDown"===e.code||"Minus"===e.code||"NumpadSubtract"===e.code)&&(e.preventDefault(),m()))},pattern:"[0-9]*",type:"number",value:o}),(0,r.jsxs)("div",{className:"row gap-0",children:[(0,r.jsx)(i.Z,{className:"rounded-l-none! rounded-r-none! border! border-gray-300! dark:border-gray-600!",onClick:()=>{m()},children:(0,r.jsx)(a.Z,{})}),(0,r.jsx)(i.Z,{className:"rounded-l-none! border! border-l-0! border-gray-300! dark:border-gray-600!",onClick:()=>{p()},children:(0,r.jsx)(l.Z,{})})]})]})}},69195:function(e,t,s){"use strict";var r=s(57437),a=s(2265),l=s(61994),i=s(69366),n=s.n(i);t.Z=e=>{let{checked:t,disabled:s,onChange:i=()=>{}}=e,o=(0,a.useId)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{checked:t,onChange:()=>{s||i()},className:n()["react-switch-checkbox"],id:o,type:"checkbox"}),(0,r.jsx)("label",{className:(0,l.Z)(n()["react-switch-label"],t&&n().Checked,s&&n().DisabledLabel),htmlFor:o,children:(0,r.jsx)("span",{className:(0,l.Z)(n()["react-switch-button"],s&&n().DisabledButton)})})]})}},87459:function(e,t,s){"use strict";s.d(t,{GR:function(){return u},TY:function(){return l},b2:function(){return d},kb:function(){return i},ku:function(){return n},mX:function(){return c},nu:function(){return o}});var r=s(86615),a=s(6228);let l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.trim()?Array.from(new Set((e=e.trim()).split(/\W+/).filter(Boolean).filter(e=>e.length>2).map(e=>e.toLowerCase()))):[]},i=async(e,t)=>{try{await a.db.transaction("rw",a.db.promptsHistory,async()=>{await a.db.promptsHistory.where("id").equals(e).modify({favorited:t?1:0})})}catch(e){throw console.error("Transaction failed: ",e),e}},n=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prompt",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){let s=[e,t?1:0];return await a.db.promptsHistory.where("[promptType+favorited]").equals(s).count()}return await a.db.promptsHistory.where({promptType:e}).count()},o=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"prompt",l=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(0===e.length)return[];let i=await a.db.promptsHistory.where("promptWords").equals(e[0]).filter(e=>e.promptType===r).toArray();for(let t=1;t<e.length;t++){let s=await a.db.promptsHistory.where("promptWords").equals(e[t]).filter(e=>e.promptType===r).toArray();i=i.filter(e=>s.some(t=>t.id===e.id))}return l?i.length:i.slice(t,t+s)},c=async function(){let{offset:e=0,limit:t=20,promptType:s="prompt",showFavorites:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r?await a.db.promptsHistory.where("[promptType+favorited]").equals([s,1]).offset(e).limit(t).reverse().toArray():await a.db.promptsHistory.where({promptType:s}).offset(e).limit(t).reverse().toArray()},d=async e=>{let{artbot_id:t="",prompt:s="",promptType:i="prompt"}=e;if(0===s.trim().length)return;let n=(0,r.sha256)(s.trim().toLowerCase()),o=l(s);try{await a.db.transaction("rw",[a.db.promptsHistory,a.db.promptsJobMap],async()=>{let e=await a.db.promptsHistory.where({hash_id:n}).first();if(e&&"id"in e){await a.db.promptsJobMap.add({artbot_id:t,prompt_id:e.id}),await a.db.promptsHistory.where({id:e.id}).modify({timestamp:Date.now()});return}let r=await a.db.promptsHistory.add({artbot_id:t,hash_id:n,timestamp:Date.now(),favorited:0,prompt:s,promptWords:o,promptType:i});r&&"prompt"===i&&await a.db.promptsJobMap.add({artbot_id:t,prompt_id:r})})}catch(e){throw console.log("addPromptToDexie error: ",e),e}},u=async e=>{await a.db.transaction("rw",[a.db.promptsHistory,a.db.promptsJobMap],async()=>{await a.db.promptsJobMap.where("prompt_id").equals(e).delete(),await a.db.promptsHistory.delete(e)})}},50890:function(e,t,s){"use strict";s.d(t,{X:function(){return o}});var r=s(2265),a=s(87415),l=s(91802),i=s(50905),n=s(79931);let o=e=>{let{modelDetails:t}=(0,i.o)(n.EA);return(0,r.useCallback)((s,r)=>{let i={};
1Object.keys(r).forEach(e=>{if("prompt"!==e){if("model"===e){i.models=[r.model];let e=t[r.model];e&&(i.modelDetails={baseline:e.baseline,version:e.version});return}if(("height"===e||"width"===e)&&(i.imageOrientation="custom"),"loras"===e&&void 0!==r.loras){i.loras=[],r.loras.forEach(e=>{var t;let s;s=e.name===a.MJ.versionId?a.MJ:new l.uL({id:e.name,versionId:!!e.is_version&&Number(e.name),versionName:e.name,isArtbotManualEntry:!0,name:e.name,strength:e.model||1,clip:e.clip_skip||1}),null===(t=i.loras)||void 0===t||t.push({...s})});return}"enhance"!==e&&(i[e]=r[e])}}),e({...i,preset:[{name:s,settings:{...r}}]})},[t,e])}},17858:function(e,t,s){"use strict";s.d(t,{G:function(){return b},PromptInputProvider:function(){return v}});var r=s(57437),a=s(2265),l=s(87415),i=s(10338),n=s(34357),o=s(50905),c=s(39262),d=s(28683),u=s(19024),h=s(80896),m=s(50674),p=s(9390),g=s(968);let x=(0,a.createContext)({input:{},kudos:0,pageLoaded:!1,setInput:()=>{},setPageLoaded:()=>{},setSourceImages:()=>{},sourceImages:[]}),f=(0,i.D)(e=>{sessionStorage.setItem("userInput",e)},300),b=()=>(0,a.useContext)(x),v=e=>{let{children:t}=e,{inputUpdated:s}=(0,o.o)(c.a),[i,b]=(0,a.useState)(!1),[v,w]=(0,a.useState)(0),[j,y]=(0,a.useState)([]),N=(0,a.useRef)(null),k=(0,a.useCallback)(async e=>{N.current&&clearTimeout(N.current),N.current=setTimeout(async()=>{try{var t;let{apiParams:s}=await u.g.build(e);if(s.dry_run=!0,!e.prompt.trim()&&!e.negative.trim()&&v>0)return;e.prompt.trim()||e.negative.trim()||0!==v||(s.prompt="_");let r=(null===(t=h.d.apikey())||void 0===t?void 0:t.trim())||p.$.AI_HORDE_ANON_KEY,a=await fetch("https://aihorde.net/api/v2/generate/async",{body:JSON.stringify(s),cache:"no-store",method:"POST",headers:{"Content-Type":"application/json","Client-Agent":(0,m.N)(),apikey:r}});if(a.ok){let e=await a.json();w(e.kudos)}else console.error("Failed to fetch kudos:",a.statusText)}catch(e){console.error("Error fetching kudos:",e)}},1050)},[v]),[_,C]=(0,a.useReducer)((e,t)=>{let s={...e,...t};return f(JSON.stringify(s)),(0,g.QB)(s).catch(console.error),k(s),s},new l.ZP);(0,a.useEffect)(()=>{let e=async()=>{let e=await (0,g.$)();if(e)C(e);else{let e=sessionStorage.getItem("userInput");e&&C(JSON.parse(e))}},t=sessionStorage.getItem("userInput");t?C(JSON.parse(t)):e()},[s]);let Z=(0,a.useCallback)(async()=>{y(await (0,n.aC)(p.$.IMAGE_UPLOAD_TEMP_ID))},[]);return(0,a.useEffect)(()=>{Z()},[Z]),(0,a.useEffect)(()=>{if(window.location.hash.startsWith("#share=")){let e=(0,d.g9)(window.location.hash)||"",t=(0,d.eP)(e);delete t.id,delete t.artbot_id,C({...t})}},[]),(0,r.jsx)(x.Provider,{value:{input:_,kudos:v,pageLoaded:i,setInput:C,setPageLoaded:b,setSourceImages:y,sourceImages:j},children:t})}},91863:function(e,t,s){"use strict";s.d(t,{AF:function(){return l},Nq:function(){return i},U6:function(){return r},bC:function(){return a},eU:function(){return n},nW:function(){return o}});let r=(0,s(50905).n)({forceAllowedWorkers:!1,forceBlockedWorkers:!1,forceSelectedWorker:!1,hordeMessages:[],userDetails:{},sharedKey:""}),a=e=>{r.set(()=>({forceSelectedWorker:e}))},l=e=>{r.set(()=>({sharedKey:e}))},i=e=>{r.set(()=>({userDetails:e}))},n=e=>{r.set(t=>({hordeMessages:[...t.hordeMessages,...e.filter(e=>!t.hordeMessages.some(t=>t.id===e.id))]}))},o=e=>{let{forceAllowedWorkers:t,forceBlockedWorkers:s}=e;r.set(()=>({forceAllowedWorkers:t,forceBlockedWorkers:s}))}},47742:function(e,t,s){"use strict";s.d(t,{X:function(){return a},e:function(){return r}});let r=e=>{let t=[];return Object.keys(e).forEach(s=>{t=t.concat(e[s])}),t},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((e,t)=>(t&&t.modelVersions&&(void 0!==t._civitAiType&&"TextualInversion"===t._civitAiType&&"none"===t.inject_ti?e=e.concat(t.tags):void 0!==t._civitAiType&&"Lora"===t._civitAiType&&t.modelVersions.length>0&&(e=e.concat(t.modelVersions[0].trainedWords))),e),[])}},50011:function(e){e.exports={"image-item":"loraSearch_image-item__CjYci"}},83231:function(e){e.exports={Dropzone:"uploadImage_Dropzone__S3oXs"}},524:function(e){e.exports={"masonry-item":"masonry_masonry-item__IYzjb"}},23018:function(e){e.exports={styledSVG:"spinner_styledSVG__PSVHU",rotate:"spinner_rotate__gc314",styledCircle:"spinner_styledCircle__dye8i",dash:"spinner_dash__ilyVA"}},69366:function(e){e.exports={"react-switch-label":"switch_react-switch-label__BRFXh","react-switch-button":"switch_react-switch-button__Ox3Oo","react-switch-checkbox":"switch_react-switch-checkbox__Xn7zh",Checked:"switch_Checked__pgiN0",DisabledLabel:"switch_DisabledLabel__nuwZy",DisabledButton:"switch_DisabledButton__rzcwE"}}},function(e){e.O(0,[733,5102,1330,3125,2972,5966,5541,9064,3138,4654,5143,3155,1430,940,5920,4130,1608,4078,2238,5258,1110,2971,5910,1744],function(){return e(e.s=19486)}),_N_E=e.O()}]);

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.