1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2238],{88618:function(e,t,r){r.d(t,{Z:function(){return h}});var l=r(57437),n=r(22840),o=r(27831),a=r(70837),s=r(40018),i=r(91863),c=r(93033),d=r(35515),u=r(16105),f=r(2265),m=r(50905);function h(){var e,t;let{forceSelectedWorker:r}=(0,m.o)(i.U6),[h,g]=(0,f.useState)(""),[p,b]=(0,f.useState)([]);(0,f.useEffect)(()=>{(async function(){b(await (0,n.Y)())})()},[]),(0,f.useEffect)(()=>{let e=sessionStorage.getItem("forceSelectedWorker");e&&((0,i.bC)(!0),g(e||""))},[]);let x=null;h&&(x=p.find(e=>e.id===h)),console.log("workerDetails",x);let w=p.map(e=>({label:"".concat(e.name),filterLabel:"".concat(e.name," ").concat(e.id),component:(0,l.jsxs)("div",{className:"col gap-0 mb-0",children:[(0,l.jsx)("div",{children:e.name}),(0,l.jsx)("div",{className:"text-xs font-mono",children:e.id})]}),value:e.id}));return(0,l.jsxs)("div",{className:"col w-full h-full",children:[(0,l.jsx)("h2",{className:"row font-bold",children:"Force Worker"}),(0,l.jsxs)("div",{className:"col gap-2",children:[(0,l.jsxs)("div",{children:["Temporarily send requests to a ",(0,l.jsx)("strong",{children:"specific worker"}),". This will ",(0,l.jsx)("strong",{children:"override"})," any current worker preference options that you may have set. Clearing this option will restore your previous worker preferences."]}),(0,l.jsx)("div",{children:"This setting will affect any images that are queued up and awaiting to be sent to the AI Horde."}),(0,l.jsx)("div",{children:(0,l.jsx)("strong",{children:"Select worker"})}),(0,l.jsxs)("div",{className:"w-full row",children:[(0,l.jsx)(a.Z,{onChange:e=>{e&&g(e.value)},options:w,value:{label:null===(e=p.filter(e=>e.id===h)[0])||void 0===e?void 0:e.name,value:h}}),(0,l.jsx)(o.Z,{onClick:()=>{h?((0,i.bC)(!0),sessionStorage.setItem("forceSelectedWorker",h)):sessionStorage.setItem("forceSelectedWorker",""),c.ZP.remove("modal")},children:(0,l.jsx)(d.Z,{})}),(0,l.jsx)(o.Z,{theme:"danger",onClick:()=>{g(""),sessionStorage.setItem("forceSelectedWorker",""),(0,i.bC)(!1)},children:(0,l.jsx)(u.Z,{})})]}),r&&(0,l.jsxs)("div",{children:[(0,l.jsx)("strong",{children:"Important:"})," All image requests will be sent to"," ",(0,l.jsx)("em",{children:null===(t=p.filter(e=>e.id===h)[0])||void 0===t?void 0:t.name}),". Depending on this worker's capabilities, some features may not be available or some requests may take more time than expected."]}),x&&(0,l.jsx)(s.default,{title:"Worker details",children:(0,l.jsxs)("div",{className:"col gap-0 font-mono",children:[(0,l.jsx)("div",{className:"row gap-2",children:(0,l.jsx)("strong",{children:x.name})}),(0,l.jsxs)("div",{className:"row gap-2 font-mono text-sm",children:[(0,l.jsx)("strong",{children:"Max pixels:"})," ",x.max_pixels.toLocaleString()]})]})})]})]})}},22840:function(e,t,r){r.d(t,{Y:function(){return s}});var l=r(9390),n=r(50674);let o=[],a=0,s=async()=>{let e=new Date().getTime();if(e-a<6e4&&o.length>0)return o;try{let t=await fetch("".concat(l.$.AI_HORDE_PROD_URL,"/api/v2/workers"),{cache:"no-store",headers:{"Content-Type":"application/json","Client-Agent":(0,n.N)()},method:"GET"}),r=await t.json();if(Array.isArray(r))o=r.filter(e=>"image"===e.type),a=e;else{if(o.length>0)return o;return[]}}catch(e){if(console.log("Error: Unable to fetch worker details from AI Horde"),console.log(e),o.length>0)return o;return[]}return o}},70837:function(e,t,r){r.d(t,{Z:function(){return u}});var l=r(57437),n=r(61994),o=r(69450),a=r(21533),s=r(2265),i=r(58095),c=r(54887);function d(e){let{children:t}=e;return(0,c.createPortal)(t,document.body)}function u(e){let{onChange:t=()=>{},options:r,value:c}=e,u=(0,s.useRef)(null),[f,m]=(0,s.useState)(!1),[h,g]=(0,s.useState)(c.label),[p,b]=(0,s.useState)(""),x=(0,s.useRef)(null);(0,s.useEffect)(()=>{g(c.label)},[c.label]);let w=()=>{m(!0),b("")},v=(e,r)=>{r&&(r.preventDefault(),r.stopPropagation()),j(),m(!1),g(e.label),t(e)},j=()=>{u.current&&u.current.blur()};(0,i.Z)(x,e=>{e.target.closest(".combobox-options")||(v(c),j())});let k=r.filter(e=>!!e.label&&(e.filterLabel?e.filterLabel.toLowerCase().includes(p.toLowerCase()):e.label.toLowerCase().includes(p.toLowerCase())));return(0,l.jsx)("div",{className:"relative w-full",ref:x,children:(0,l.jsx)(o.hQ,{value:c,onChange:e=>{t(e)},onClose:()=>{},children:e=>{var t;let{activeOption:r}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"justify-between relative cursor-pointer bg-gray-50 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2 dark:bg-gray-700 dark:border-gray-600 dark:focus:ring-blue-500 dark:focus:border-blue-500",children:[(0,l.jsx)(o.gA,{ref:u,className:(0,n.Z)("w-full !bg-input placeholder-gray-800! dark:placeholder-white! dark:text-white text-[16px]"),displayValue:e=>e.label,onChange:e=>{f?b(e.target.value):g(e.target.value)},onClick:()=>{m(!0)},onFocus:w,placeholder:null!==(t=null==r?void 0:r.label)&&void 0!==t?t:"",value:f?p:h,onKeyDown:e=>{"Enter"===e.key&&r?(b(r.label),v(r),u.current&&u.current.blur(),m(!1)):"Enter"!==e.key||r||e.preventDefault()},style:{textOverflow:"ellipsis",width:"calc(100% - 24px)"}}),(0,l.jsx)(o.Q$,{onClick:()=>{m(!0)},children:(0,l.jsx)("span",{className:"pointer-events-none absolute inset-y-0 right-0 ml-3 flex items-center pr-2",children:(0,l.jsx)(a.Z,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})})]}),f&&k.length>0&&(0,l.jsx)(d,{children:(0,l.jsx)("div",{className:"absolute z-1000! w-full",style:{to
1p:"".concat(u.current.getBoundingClientRect().bottom+window.scrollY+8,"px"),left:"".concat(u.current.getBoundingClientRect().left+window.scrollX-8,"px"),width:u.current.offsetWidth+40},children:(0,l.jsx)(o.L5,{static:!0,className:"combobox-options absolute z-1000! mt-1 max-h-56 w-full overflow-auto rounded-md py-1 text-base shadow-lg ring-1 ring-opacity-5 focus:outline-none sm:text-sm bg-gray-50 border border-gray-300 text-gray-900 text-[16px] focus:ring-blue-500 focus:border-blue-500 block 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",children:k.map((e,t)=>(0,l.jsx)(o.O2,{value:e,onClick:t=>{t.preventDefault(),t.stopPropagation(),v(e,t)},className:e=>{let{focus:t}=e;return function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}(t?"bg-indigo-600 ":"","text-black dark:text-white relative cursor-default rounded-md select-none py-2 pl-1 pr-9 hover:bg-indigo-600 hover:text-white")},children:e.component?e.component:e.label},"option-".concat(e.value,"-").concat(t)))})})})]})}})})}},44818:function(e,t,r){r.d(t,{R:function(){return a}});var l=r(37543),n=r(96487),o=r(52514);let a=async(e,t)=>{let r=(0,n.Ms)(e);r?(t.status&&t.status===o.B.Queued&&!r.horde_received_timestamp&&(t.horde_received_timestamp=Date.now()),t.status&&t.status===o.B.Done&&!r.horde_completed_timestamp&&(t.horde_completed_timestamp=Date.now()),t.wait_time&&(null===r.init_wait_time||t.wait_time>r.init_wait_time)&&(t.init_wait_time=t.wait_time),await (0,l._e)(e,{...t}),(0,n.fc)(e,{...t})):console.error("No pending image found with id: ".concat(e))}},79931:function(e,t,r){r.d(t,{EA:function(){return l},El:function(){return n},sR:function(){return o}});let l=(0,r(50905).n)({availableModels:[],modelDetails:{}}),n=e=>{l.set(()=>({availableModels:e}))},o=e=>{l.set(()=>({modelDetails:e}))}}}]);
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.