"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ei(){}function A1(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var _o=function(e){qo(n,e);var t=b1(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(nt(this,n),r=t.call(this),Wo&&Jt.call(Wt(r)),r.options=hf(i),r.services={},r.logger=ut,r.modules={external:[]},A1(Wt(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),si(r,Wt(r));setTimeout(function(){r.init(i,o)},0)}return r}return rt(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=F1();this.options=ot(ot(ot({},a),this.options),hf(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=ot(ot({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(g){return g?typeof g=="function"?new g:g:null}if(!this.options.isClone){this.modules.logger?ut.init(l(this.modules.logger),this.options):ut.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=I1);var c=new x1(this.options);this.store=new S1(this.options.resources,this.options);var f=this.services;f.logger=ut,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new E1(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new R1(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new T1(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(g){for(var p=arguments.length,h=new Array(p>1?p-1:0),y=1;y1?p-1:0),y=1;y
0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var v=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];v.forEach(function(g){i[g]=function(){var p;return(p=i.store)[g].apply(p,arguments)}});var m=["addResource","addResources","addResourceBundle","removeResourceBundle"];m.forEach(function(g){i[g]=function(){var p;return(p=i.store)[g].apply(p,arguments),i}});var S=mr(),k=function(){var p=function(y,_){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),S.resolve(_),s(y,_)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return p(null,i.t.bind(i));i.changeLanguage(i.options.lng,p)};return this.options.resources||!this.options.initImmediate?k():setTimeout(k,0),S}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ei,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var u=[],c=function(v){if(!!v){var m=o.services.languageUtils.toResolveHierarchy(v);m.forEach(function(S){u.indexOf(S)<0&&u.push(S)})}};if(l)c(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(d){return c(d)})}this.options.preload&&this.options.preload.forEach(function(d){return c(d)}),this.services.backendConnector.load(u,this.options.ns,function(d){!d&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(d)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=mr();return i||(i=this.languages),o||(o=this.options.ns),s||(s=Ei),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&ph.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=mr();this.emit("languageChanging",i);var l=function(d){s.language=d,s.languages=s.services.languageUtils.toResolveHierarchy(d),s.resolvedLanguage=void 0,s.setResolvedLanguage(d)},u=function(d,v){v?(l(v),s.translator.changeLanguage(v),s.isLanguageChangingTo=void 0,s.emit("languageChanged",v),s.logger.log("languageChanged",v)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(d,function(){return s.t.apply(s,arguments)})},c=function(d){!i&&!d&&s.services.languageDetector&&(d=[]);var v=typeof d=="string"?d:s.services.languageUtils.getBestMatchFromCodes(d);v&&(s.language||l(v),s.translator.language||s.translator.changeLanguage(v),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(v)),s.loadResources(v,function(m){u(m,v)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(c):c(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function u(c,f){var d;if(qt(f)!=="object"){for(var v=arguments.length,m=new Array(v>2?v-2:0),S=2;S1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var c=function(v,m){var S=o.services.backendConnector.state["".concat(v,"|").concat(m)];return S===-1||S===2};if(s.precheck){var f=s.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(a,i)&&(!l||c(u,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=mr();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=mr();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(u){return a.indexOf(u)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(u){s.resolve(),o&&o(u)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ei,a=ot(ot(ot({},this.options),o),{isClone:!0}),l=new n(a);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(c){l[c]=i[c]}),l.services=ot({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new lf(l.services,l.options),l.translator.on("*",function(c){for(var f=arguments.length,d=new Array(f>1?f-1:0),v=1;v0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new _o(e,t)});var ke=_o.createInstance();ke.createInstance=_o.createInstance;ke.createInstance;ke.init;ke.loadResources;ke.reloadResources;ke.use;ke.changeLanguage;ke.getFixedT;ke.t;ke.exists;ke.setDefaultNamespace;ke.hasLoadedNamespace;ke.loadNamespaces;ke.loadLanguages;const U1="Stable Diffusion UI",z1="",$1={home:"Home",history:"History",community:"Community",settings:"Settings"},B1={"status-starting":"Stable Diffusion is starting...","status-ready":"Stable Diffusion is ready to use!","status-error":"Stable Diffusion is not running!","editor-title":"Prompt","initial-img-txt":"Initial Image: (optional)","initial-img-btn":"Browse...","initial-img-text2":"No file selected.","make-img-btn":"Make Image","make-img-btn-stop":"Stop"},Q1={"base-img":"Use base image:",seed:"Seed:","amount-of-img":"Amount of images to make:","how-many":"How many at once:",width:"Width:",height:"Height:",steps:"Number of inference steps:","guide-scale":"Guidance Scale:","live-preview":"Show a live preview of the image (disable this for faster image generation)","fix-face":"Fix incorrect faces and eyes (uses GFPGAN)",upscale:"Upscale the image to 4x resolution using:",corrected:"Show only the corrected/upscaled image"},V1={txt:"Image Modifiers (art styles, tags etc)"},H1={"use-btn":"Use Image","use-btn2":"Use Image and Tags"},K1={fave:"Favorites Only",search:"Search"},q1={ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cps:"Cross profile sharing","cps-disc":"Profiles will see suggestions from each other.",acb:"Allow cloud backup","acb-disc":"A button will show up for images on hover","acb-place":"Choose your","acc-api":"Api key","acb-api-place":"Your API key",save:"SAVE"},W1=`If you found this project useful and want to help keep it alive, please to help cover the cost of development and maintenance! Thank you for your support!
+ */var Ho=E.exports,hy=Ml.exports;function gy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var my=typeof Object.is=="function"?Object.is:gy,vy=hy.useSyncExternalStore,yy=Ho.useRef,Sy=Ho.useEffect,wy=Ho.useMemo,ky=Ho.useDebugValue;rh.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=yy(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=wy(function(){function l(p){if(!u){if(u=!0,c=p,p=r(p),i!==void 0&&s.hasValue){var v=s.value;if(i(v,p))return f=v}return f=p}if(v=f,my(c,p))return v;var S=r(p);return i!==void 0&&i(v,S)?v:(c=p,f=S)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,i]);var a=vy(e,o[0],o[1]);return Sy(function(){s.hasValue=!0,s.value=a},[a]),ky(a),a};(function(e){e.exports=rh})(nh);const xy=mf(nh.exports),{useSyncExternalStoreWithSelector:Oy}=xy;function Py(e,t=e.getState,n){const r=Oy(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return E.exports.useDebugValue(r),r}const Ac=e=>{const t=typeof e=="function"?py(e):e,n=(r,i)=>Py(t,r,i);return Object.assign(n,t),n},_y=e=>e?Ac(e):Ac;var Jl=_y;const Cy=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,...a}=t;let l;try{l=(o!=null?o:({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const u=l.connect(a);let c=!0;i.setState=(p,v,S)=>{const k=n(p,v);return c&&u.send(S===void 0?{type:s||"anonymous"}:typeof S=="string"?{type:S}:S,r()),k};const f=(...p)=>{const v=c;c=!1,n(...p),c=v},d=e(i.setState,r,i);if(u.init(d),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let p=!1;const v=i.dispatch;i.dispatch=(...S)=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&S[0].type==="__setState"&&!p&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),p=!0),v(...S)}}return u.subscribe(p=>{var v;switch(p.type){case"ACTION":if(typeof p.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Is(p.payload,S=>{if(S.type==="__setState"){f(S.state);return}!i.dispatchFromDevtools||typeof i.dispatch=="function"&&i.dispatch(S)});case"DISPATCH":switch(p.payload.type){case"RESET":return f(d),u.init(i.getState());case"COMMIT":return u.init(i.getState());case"ROLLBACK":return Is(p.state,S=>{f(S),u.init(i.getState())});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Is(p.state,S=>{f(S)});case"IMPORT_STATE":{const{nextLiftedState:S}=p.payload,k=(v=S.computedStates.slice(-1)[0])==null?void 0:v.state;if(!k)return;f(k),u.send(null,S);return}case"PAUSE_RECORDING":return c=!c}return}}),d},Ey=Cy,Is=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)},xo=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return xo(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return xo(r)(n)}}}},Ry=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:k=>k,version:0,merge:(k,m)=>({...m,...k}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return e((...k)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...k)},r,i);const c=xo(o.serialize),f=()=>{const k=o.partialize({...r()});let m;const h=c({state:k,version:o.version}).then(g=>u.setItem(o.name,g)).catch(g=>{m=g});if(m)throw m;return h},d=i.setState;i.setState=(k,m)=>{d(k,m),f()};const p=e((...k)=>{n(...k),f()},r,i);let v;const S=()=>{var k;if(!u)return;s=!1,a.forEach(h=>h(r()));const m=((k=o.onRehydrateStorage)==null?void 0:k.call(o,r()))||void 0;return xo(u.getItem.bind(u))(o.name).then(h=>{if(h)return o.deserialize(h)}).then(h=>{if(h)if(typeof h.version=="number"&&h.version!==o.version){if(o.migrate)return o.migrate(h.state,h.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return h.state}).then(h=>{var g;return v=o.merge(h,(g=r())!=null?g:p),n(v,!0),f()}).then(()=>{m==null||m(v,void 0),s=!0,l.forEach(h=>h(v))}).catch(h=>{m==null||m(void 0,h)})};return i.persist={setOptions:k=>{o={...o,...k},k.getStorage&&(u=k.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>S(),hasHydrated:()=>s,onHydrate:k=>(a.add(k),()=>{a.delete(k)}),onFinishHydration:k=>(l.add(k),()=>{l.delete(k)})},S(),v||p},Ny=Ry;function Zr(){return Math.floor(Math.random()*1e4)}const D=Jl(Ey((e,t)=>({parallelCount:1,requestOptions:{prompt:"a photograph of an astronaut riding a horse",seed:Zr(),num_outputs:1,num_inference_steps:50,guidance_scale:7.5,width:512,height:512,prompt_strength:.8,turbo:!0,use_cpu:!1,use_full_precision:!0,save_to_disk_path:"null",use_face_correction:"GFPGANv1.3",use_upscale:"RealESRGAN_x4plus",show_only_filtered_image:!0},tags:[],uiOptions:{isUseRandomSeed:!0,isUseAutoSave:!1,isSoundEnabled:!1},allModifiers:[[[]]],isInpainting:!1,setParallelCount:n=>e(ie(r=>{r.parallelCount=n})),setRequestOptions:(n,r)=>{e(ie(i=>{i.requestOptions[n]=r}))},getValueForRequestKey:n=>t().requestOptions[n],setAllModifiers:n=>{e(ie(r=>{r.allModifiers=n}))},toggleTag:n=>{e(ie(r=>{const i=r.tags.indexOf(n);i>-1?r.tags.splice(i,1):r.tags.push(n)}))},hasTag:n=>t().tags.indexOf(n)>-1,selectedTags:()=>t().tags,builtRequest:()=>{const n=t(),r=n.requestOptions,i=n.tags,o=`${r.prompt} ${i.join(",")}`,s={...r,prompt:o};return n.uiOptions.isUseAutoSave||(s.save_to_disk_path=null),s.init_image===void 0&&(s.prompt_strength=void 0),s.use_upscale===""&&(s.use_upscale=null),s.use_upscale===null&&s.use_face_correction===null&&(s.show_only_filtered_image=!1),s},toggleUseFaceCorrection:()=>{e(ie(n=>{const r=typeof n.getValueForRequestKey("use_face_correction")=="string"?null:"GFPGANv1.3";n.requestOptions.use_face_correction=r}))},isUsingFaceCorrection:()=>typeof t().getValueForRequestKey("use_face_correction")=="string",isUsingUpscaling:()=>t().getValueForRequestKey("use_upscale")!=="",toggleUseRandomSeed:()=>{e(ie(n=>{n.uiOptions.isUseRandomSeed=!n.uiOptions.isUseRandomSeed,n.requestOptions.seed=n.uiOptions.isUseRandomSeed?Zr():n.requestOptions.seed,localStorage.setItem("ui:isUseRandomSeed",n.uiOptions.isUseRandomSeed)}))},isRandomSeed:()=>t().uiOptions.isUseRandomSeed,toggleUseAutoSave:()=>{e(ie(n=>{n.uiOptions.isUseAutoSave=!n.uiOptions.isUseAutoSave,localStorage.setItem("ui:isUseAutoSave",n.uiOptions.isUseAutoSave)}))},isUseAutoSave:()=>t().uiOptions.isUseAutoSave,toggleSoundEnabled:()=>{e(ie(n=>{n.uiOptions.isSoundEnabled=!n.uiOptions.isSoundEnabled}))},isSoundEnabled:()=>t().uiOptions.isSoundEnabled,toggleInpainting:()=>{e(ie(n=>{n.isInpainting=!n.isInpainting}))}})));var Uc="_1jo75h1",zc="_1jo75h0",Iy="_1jo75h2";const $c="Stable Diffusion is starting...",Ly="Stable Diffusion is ready to use!",Bc="Stable Diffusion is not running!";function by({className:e}){const[t,n]=E.exports.useState($c),[r,i]=E.exports.useState(zc),{status:o,data:s}=vn(["health"],sy,{refetchInterval:oy});return E.exports.useEffect(()=>{o==="loading"?(n($c),i(zc)):o==="error"?(n(Bc),i(Uc)):o==="success"&&(s[0]==="OK"?(n(Ly),i(Iy)):(n(Bc),i(Uc)))},[o,s]),w(wn,{children:w("p",{className:[r,e].join(" "),children:t})})}function Wt(e){return Wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wt(e)}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qc(e,t){for(var n=0;n",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026","/":"/","/":"/"},Ty=function(t){return Fy[t]},jy=function(t){return t.replace(Dy,Ty)};function Vc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hc(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};za=Hc(Hc({},za),e)}function Uy(){return za}var zy=function(){function e(){nt(this,e),this.usedNamespaces={}}return rt(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function $y(e){ih=e}function By(){return ih}var Qy={type:"3rdParty",init:function(t){Ay(t.options.react),$y(t)}};function Vy(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var s=function(l,u){var c=t.services.backendConnector.state["".concat(l,"|").concat(u)];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!s(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||s(r,e)&&(!i||s(o,e)))}function Ky(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return $a("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,s){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!s(o.isLanguageChangingTo,e))return!1}}):Hy(e,t,n)}function oh(e){if(Array.isArray(e))return e}function qy(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function Wc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=E.exports.useContext(My)||{},i=r.i18n,o=r.defaultNS,s=n||i||By();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new zy),!s){$a("You will need to pass in an i18next instance by using initReactI18next");var a=function(R){return Array.isArray(R)?R[R.length-1]:R},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}s.options.react&&s.options.react.wait!==void 0&&$a("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=Ls(Ls(Ls({},Uy()),s.options.react),t),c=u.useSuspense,f=u.keyPrefix,d=e||o||s.options&&s.options.defaultNS;d=typeof d=="string"?[d]:d||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(d);var p=(s.isInitialized||s.initializedStoreOnce)&&d.every(function(x){return Ky(x,s,u)});function v(){return s.getFixedT(null,u.nsMode==="fallback"?d:d[0],f)}var S=E.exports.useState(v),k=Wy(S,2),m=k[0],h=k[1],g=d.join(),y=Gy(g),P=E.exports.useRef(!0);E.exports.useEffect(function(){var x=u.bindI18n,R=u.bindI18nStore;P.current=!0,!p&&!c&&qc(s,d,function(){P.current&&h(v)}),p&&y&&y!==g&&P.current&&h(v);function b(){P.current&&h(v)}return x&&s&&s.on(x,b),R&&s&&s.store.on(R,b),function(){P.current=!1,x&&s&&x.split(" ").forEach(function(M){return s.off(M,b)}),R&&s&&R.split(" ").forEach(function(M){return s.store.off(M,b)})}},[s,g]);var _=E.exports.useRef(!0);E.exports.useEffect(function(){P.current&&!_.current&&h(v),_.current=!1},[s,f]);var O=[m,s,p];if(O.t=m,O.i18n=s,O.ready=p,p||!p&&!c)return O;throw new Promise(function(x){qc(s,d,function(){x()})})}var Yy="_1v2cc580";const Jy=()=>{const{i18n:e}=gt(),[t,n]=E.exports.useState("id");return N("select",{onChange:i=>{const o=i.target.value;console.log(o),n(o),e.changeLanguage(o)},value:t,children:[w("option",{value:"en",children:"EN"}),w("option",{value:"es",children:"ES"})]})};function Xy(){const{t:e}=gt(),{status:t,data:n}=vn([Ua],th),[r,i]=E.exports.useState("2.1.0"),[o,s]=E.exports.useState("");return E.exports.useEffect(()=>{if(t==="success"){const{update_branch:a}=n;i("v2.1"),s(a==="main"?"(stable)":"(beta)")}},[t,n,i,i]),N("div",{className:Yy,children:[N("h1",{children:[e("title")," ",r," ",o," "]}),w(by,{className:"status-display"}),w(Jy,{})]})}const Ke=Jl(Ny((e,t)=>({isOpenAdvancedSettings:!1,isOpenAdvImprovementSettings:!1,isOpenAdvPropertySettings:!1,isOpenAdvWorkflowSettings:!1,isOpenAdvGPUSettings:!1,isOpenImageModifier:!1,imageMofidiersMap:{},toggleAdvancedSettings:()=>{e(ie(n=>{n.isOpenAdvancedSettings=!n.isOpenAdvancedSettings}))},toggleAdvImprovementSettings:()=>{e(ie(n=>{n.isOpenAdvImprovementSettings=!n.isOpenAdvImprovementSettings}))},toggleAdvPropertySettings:()=>{e(ie(n=>{n.isOpenAdvPropertySettings=!n.isOpenAdvPropertySettings}))},toggleAdvWorkflowSettings:()=>{e(ie(n=>{n.isOpenAdvWorkflowSettings=!n.isOpenAdvWorkflowSettings}))},toggleAdvGPUSettings:()=>{e(ie(n=>{n.isOpenAdvGPUSettings=!n.isOpenAdvGPUSettings}))},toggleImageModifier:()=>{e(ie(n=>{n.isOpenImageModifier=!n.isOpenImageModifier}))}}),{name:"createUI"}));var lh="_1961rof0",ve="_1961rof1";var mr="_11d5x3d1",Zy="_11d5x3d0",Ko="_11d5x3d2";function e0(){const{t:e}=gt(),t=D(f=>f.isUsingFaceCorrection()),n=D(f=>f.isUsingUpscaling()),r=D(f=>f.getValueForRequestKey("use_upscale")),i=D(f=>f.getValueForRequestKey("show_only_filtered_image")),o=D(f=>f.toggleUseFaceCorrection),s=D(f=>f.setRequestOptions),a=Ke(f=>f.isOpenAdvImprovementSettings),l=Ke(f=>f.toggleAdvImprovementSettings),[u,c]=E.exports.useState(!1);return E.exports.useEffect(()=>{c(!(t||r))},[t,n,c]),N("div",{children:[w("button",{type:"button",className:Ko,onClick:l,children:w("h4",{children:"Improvement Settings"})}),a&&N(wn,{children:[w("div",{className:ve,children:N("label",{children:[w("input",{type:"checkbox",checked:t,onChange:f=>o()}),"Fix incorrect faces and eyes (uses GFPGAN)"]})}),w("div",{className:ve,children:N("label",{children:[e("settings.ups"),N("select",{id:"upscale_model",name:"upscale_model",value:r,onChange:f=>{s("use_upscale",f.target.value)},children:[w("option",{value:"",children:e("settings.no-ups")}),w("option",{value:"RealESRGAN_x4plus",children:"RealESRGAN_x4plus"}),w("option",{value:"RealESRGAN_x4plus_anime_6B",children:"RealESRGAN_x4plus_anime_6B"})]})]})}),w("div",{className:ve,children:N("label",{children:[w("input",{disabled:u,type:"checkbox",checked:i,onChange:f=>s("show_only_filtered_image",f.target.checked)}),e("settings.correct")]})})]})]})}const Yc=[{value:128,label:"128 (*)"},{value:192,label:"192"},{value:256,label:"256 (*)"},{value:320,label:"320"},{value:384,label:"384"},{value:448,label:"448"},{value:512,label:"512 (*)"},{value:576,label:"576"},{value:640,label:"640"},{value:704,label:"704"},{value:768,label:"768 (*)"},{value:832,label:"832"},{value:896,label:"896"},{value:960,label:"960"},{value:1024,label:"1024 (*)"}];function t0(){const{t:e}=gt(),t=D(p=>p.setRequestOptions),n=D(p=>p.toggleUseRandomSeed),r=D(p=>p.isRandomSeed()),i=D(p=>p.getValueForRequestKey("seed")),o=D(p=>p.getValueForRequestKey("num_inference_steps")),s=D(p=>p.getValueForRequestKey("guidance_scale")),a=D(p=>p.getValueForRequestKey("init_image")),l=D(p=>p.getValueForRequestKey("prompt_strength")),u=D(p=>p.getValueForRequestKey("width")),c=D(p=>p.getValueForRequestKey("height")),f=Ke(p=>p.isOpenAdvPropertySettings),d=Ke(p=>p.toggleAdvPropertySettings);return N("div",{children:[w("button",{type:"button",className:Ko,onClick:d,children:w("h4",{children:"Property Settings"})}),f&&N(wn,{children:[N("div",{className:ve,children:[N("label",{children:["Seed:",w("input",{size:10,value:i,onChange:p=>t("seed",p.target.value),disabled:r,placeholder:"random"})]}),N("label",{children:[w("input",{type:"checkbox",checked:r,onChange:p=>n()})," ","Random Image"]})]}),w("div",{className:ve,children:N("label",{children:[e("settings.steps")," "," ",w("input",{value:o,onChange:p=>{t("num_inference_steps",p.target.value)},size:4})]})}),N("div",{className:ve,children:[N("label",{children:[e("settings.guide-scale"),w("input",{value:s,onChange:p=>t("guidance_scale",p.target.value),type:"range",min:"0",max:"20",step:".1"})]}),w("span",{children:s})]}),a&&N("div",{className:ve,children:[N("label",{children:[e("settings.prompt-str")," "," ",w("input",{value:l,onChange:p=>t("prompt_strength",p.target.value),type:"range",min:"0",max:"1",step:".05"})]}),w("span",{children:l})]}),N("div",{className:ve,children:[N("label",{children:[e("settings.width"),w("select",{value:u,onChange:p=>t("width",p.target.value),children:Yc.map(p=>w("option",{value:p.value,children:p.label},"width-option_"+p.value))})]}),N("label",{children:[e("settings.height"),w("select",{value:c,onChange:p=>t("height",p.target.value),children:Yc.map(p=>w("option",{value:p.value,children:p.label},"height-option_"+p.value))})]})]})]})]})}function n0(){const{t:e}=gt(),t=D(d=>d.getValueForRequestKey("num_outputs")),n=D(d=>d.parallelCount),r=D(d=>d.isUseAutoSave()),i=D(d=>d.getValueForRequestKey("save_to_disk_path")),o=D(d=>d.isSoundEnabled()),s=D(d=>d.setRequestOptions),a=D(d=>d.setParallelCount),l=D(d=>d.toggleUseAutoSave),u=D(d=>d.toggleSoundEnabled),c=Ke(d=>d.isOpenAdvWorkflowSettings),f=Ke(d=>d.toggleAdvWorkflowSettings);return N("div",{children:[w("button",{type:"button",className:Ko,onClick:f,children:w("h4",{children:"Workflow Settings"})}),c&&N(wn,{children:[w("div",{className:ve,children:N("label",{children:[e("settings.amount-of-img")," ",w("input",{type:"number",value:t,onChange:d=>s("num_outputs",parseInt(d.target.value,10)),size:4})]})}),w("div",{className:ve,children:N("label",{children:[e("settings.how-many"),w("input",{type:"number",value:n,onChange:d=>a(parseInt(d.target.value,10)),size:4})]})}),N("div",{className:ve,children:[N("label",{children:[w("input",{checked:r,onChange:d=>l(),type:"checkbox"}),e("storage.ast")," "]}),N("label",{children:[w("input",{value:i,onChange:d=>s("save_to_disk_path",d.target.value),size:40,disabled:!r}),w("span",{className:"visually-hidden",children:"Path on disk where images will be saved"})]})]}),w("div",{className:ve,children:N("label",{children:[w("input",{checked:o,onChange:d=>u(),type:"checkbox"}),e("advanced-settings.sound")]})})]})]})}function r0(){const{t:e}=gt(),t=D(a=>a.getValueForRequestKey("turbo")),n=D(a=>a.getValueForRequestKey("use_cpu")),r=D(a=>a.getValueForRequestKey("use_full_precision")),i=D(a=>a.setRequestOptions),o=Ke(a=>a.isOpenAdvGPUSettings),s=Ke(a=>a.toggleAdvGPUSettings);return N("div",{children:[w("button",{type:"button",className:Ko,onClick:s,children:w("h4",{children:"GPU Settings"})}),o&&N(wn,{children:[w("div",{className:ve,children:N("label",{children:[w("input",{checked:t,onChange:a=>i("turbo",a.target.checked),type:"checkbox"}),e("advanced-settings.turbo")," ",e("advanced-settings.turbo-disc")]})}),w("div",{className:ve,children:N("label",{children:[w("input",{type:"checkbox",checked:n,onChange:a=>i("use_cpu",a.target.checked)}),e("advanced-settings.cpu")," ",e("advanced-settings.cpu-disc")]})}),w("div",{className:ve,children:N("label",{children:[w("input",{checked:r,onChange:a=>i("use_full_precision",a.target.checked),type:"checkbox"}),e("advanced-settings.gpu")," ",e("advanced-settings.gpu-disc")]})})]})]})}function i0(){const{t:e}=gt(),[t,n]=E.exports.useState(!1),[r,i]=E.exports.useState("beta"),{status:o,data:s}=vn([Ua],th),a=$l(),{status:l,data:u}=vn([uy],async()=>await cy(r),{enabled:t});return E.exports.useEffect(()=>{if(o==="success"){const{update_branch:c}=s;i(c==="main"?"beta":"main")}},[o,s]),E.exports.useEffect(()=>{l==="success"&&(u[0]==="OK"&&a.invalidateQueries([Ua]),n(!1))},[l,u,n]),N("label",{children:[w("input",{disabled:!0,type:"checkbox",checked:r==="main",onChange:c=>{n(!0)}}),e("advanced-settings.beta")," ",e("advanced-settings.beta-disc")]})}function o0(){return N("ul",{className:Zy,children:[w("li",{className:mr,children:w(e0,{})}),w("li",{className:mr,children:w(t0,{})}),w("li",{className:mr,children:w(n0,{})}),w("li",{className:mr,children:w(r0,{})}),w("li",{className:mr,children:w(i0,{})})]})}function s0(){const e=Ke(n=>n.isOpenAdvancedSettings),t=Ke(n=>n.toggleAdvancedSettings);return N("div",{className:lh,children:[w("button",{type:"button",onClick:t,className:"panel-box-toggle-btn",children:w("h3",{children:"Advanced Settings"})}),e&&w(o0,{})]})}var a0="g3uahc1",l0="g3uahc0",u0="g3uahc2",c0="g3uahc3";function uh({name:e}){const t=D(i=>i.hasTag(e))?"selected":"",n=D(i=>i.toggleTag),r=()=>{n(e)};return w("div",{className:"modifierTag "+t,onClick:r,children:w("p",{children:e})})}function f0({tags:e}){return w("ul",{className:c0,children:e.map(t=>w("li",{children:w(uh,{name:t})},t))})}function d0({title:e,tags:t}){const[n,r]=E.exports.useState(!1);return N("div",{className:a0,children:[w("button",{type:"button",className:u0,onClick:()=>{r(!n)},children:w("h4",{children:e})}),n&&w(f0,{tags:t})]})}function p0(){const e=D(i=>i.allModifiers),t=Ke(i=>i.isOpenImageModifier),n=Ke(i=>i.toggleImageModifier);return N("div",{className:lh,children:[w("button",{type:"button",onClick:()=>{n()},className:"panel-box-toggle-btn",children:w("h3",{children:"Image Modifiers (art styles, tags, ect)"})}),t&&w("ul",{className:l0,children:e.map((i,o)=>w("li",{children:w(d0,{title:i[0],tags:i[1]})},i[0]))})]})}var h0="fma0ug0";function g0({imageData:e,brushSize:t,brushShape:n,brushColor:r,isErasing:i}){const o=E.exports.useRef(null),s=E.exports.useRef(null),[a,l]=E.exports.useState(!1),[u,c]=E.exports.useState(512),[f,d]=E.exports.useState(512);E.exports.useEffect(()=>{const h=new Image;h.onload=()=>{c(h.width),d(h.height)},h.src=e},[e]),E.exports.useEffect(()=>{if(o.current!=null){const h=o.current.getContext("2d"),g=h.getImageData(0,0,u,f),y=g.data;for(let P=0;P0&&(y[P]=parseInt(r,16),y[P+1]=parseInt(r,16),y[P+2]=parseInt(r,16));h.putImageData(g,0,0)}},[r]);const p=h=>{l(!0)},v=h=>{l(!1);const g=o.current;g!=null&&g.toDataURL()},S=(h,g,y,P,_)=>{const O=o.current;if(O!=null){const x=O.getContext("2d");if(i){const R=y/2;x.clearRect(h-R,g-R,y,y)}else x.beginPath(),x.lineWidth=y,x.lineCap=P,x.strokeStyle=_,x.moveTo(h,g),x.lineTo(h,g),x.stroke()}},k=(h,g,y,P,_)=>{const O=s.current;if(O!=null){const x=O.getContext("2d");if(x.beginPath(),x.clearRect(0,0,O.width,O.height),i){const R=y/2;x.lineWidth=2,x.lineCap="butt",x.strokeStyle=_,x.moveTo(h-R,g-R),x.lineTo(h+R,g-R),x.lineTo(h+R,g+R),x.lineTo(h-R,g+R),x.lineTo(h-R,g-R),x.stroke()}else x.lineWidth=y,x.lineCap=P,x.strokeStyle=_,x.moveTo(h,g),x.lineTo(h,g),x.stroke()}};return N("div",{className:h0,children:[w("img",{src:e}),w("canvas",{ref:o,width:u,height:f}),w("canvas",{ref:s,width:u,height:f,onMouseDown:p,onMouseUp:v,onMouseMove:h=>{const{nativeEvent:{offsetX:g,offsetY:y}}=h;k(g,y,t,n,r),a&&S(g,y,t,n,r)}})]})}var Jc="_2yyo4x2",m0="_2yyo4x1",v0="_2yyo4x0";function y0(){const e=E.exports.useRef(null),[t,n]=E.exports.useState("20"),[r,i]=E.exports.useState("round"),[o,s]=E.exports.useState("#fff"),[a,l]=E.exports.useState(!1),u=D(S=>S.getValueForRequestKey("init_image"));return N("div",{className:v0,children:[w(g0,{imageData:u,brushSize:t,brushShape:r,brushColor:o,isErasing:a}),N("div",{className:m0,children:[N("div",{className:Jc,children:[w("button",{onClick:()=>{l(!1)},children:"Mask"}),w("button",{onClick:()=>{l(!0)},children:"Erase"}),w("button",{disabled:!0,onClick:()=>{console.log("fill mask!!",e)},children:"Fill"}),w("button",{disabled:!0,onClick:()=>{console.log("clear all")},children:"Clear"}),N("label",{children:["Brush Size",w("input",{type:"range",min:"1",max:"100",value:t,onChange:S=>{n(S.target.value)}})]})]}),N("div",{className:Jc,children:[w("button",{onClick:()=>{i("round")},children:"Cirle Brush"}),w("button",{onClick:()=>{i("square")},children:"Square Brush"}),w("button",{onClick:()=>{s("#000")},children:"Dark Brush"}),w("button",{onClick:()=>{s("#fff")},children:"Light Brush"})]})]})]})}var S0="cjcdm20",w0="cjcdm21";var k0="_1how28i0",x0="_1how28i1";var O0="_1rn4m8a4",P0="_1rn4m8a2",_0="_1rn4m8a3",C0="_1rn4m8a0",E0="_1rn4m8a1",R0="_1rn4m8a5";function N0(e){const{t}=gt(),n=E.exports.useRef(null),r=D(c=>c.getValueForRequestKey("init_image")),i=D(c=>c.isInpainting),o=D(c=>c.setRequestOptions),s=()=>{var c;(c=n.current)==null||c.click()},a=c=>{const f=c.target.files[0];if(f){const d=new FileReader;d.onload=p=>{p.target!=null&&o("init_image",p.target.result)},d.readAsDataURL(f)}},l=D(c=>c.toggleInpainting),u=()=>{o("init_image",void 0),i&&l()};return N("div",{className:C0,children:[N("div",{children:[w("label",{className:E0,children:w("b",{children:t("home.initial-img-txt")})}),w("input",{ref:n,className:P0,name:"init_image",type:"file",onChange:a}),w("button",{className:_0,onClick:s,children:t("home.initial-img-btn")})]}),w("div",{className:O0,children:r&&N(wn,{children:[N("div",{children:[w("img",{src:r,width:"100",height:"100"}),w("button",{className:R0,onClick:u,children:"X"})]}),N("label",{children:[w("input",{type:"checkbox",onChange:c=>{l()},checked:i}),t("in-paint.txt")]})]})})]})}function I0(){const e=D(t=>t.selectedTags());return N("div",{className:"selected-tags",children:[w("p",{children:"Active Tags"}),w("ul",{children:e.map(t=>w("li",{children:w(uh,{name:t})},t))})]})}const An=Jl((e,t)=>({images:[],completedImageIds:[],addNewImage:(n,r,i=!1)=>{e(ie(o=>{let{seed:s}=r;i&&(s=Zr()),o.images.push({id:n,options:{...r,seed:s}})}))},hasQueuedImages:()=>t().images.length>0,firstInQueue:()=>t().images[0]||[],removeFirstInQueue:()=>{e(ie(n=>{const r=n.images.shift();n.completedImageIds.push(r.id)}))},clearCachedIds:()=>{e(ie(n=>{n.completedImageIds=[]}))}}));let _i;const L0=new Uint8Array(16);function b0(){if(!_i&&(_i=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!_i))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _i(L0)}const ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function D0(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}const F0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Xc={randomUUID:F0};function T0(e,t,n){if(Xc.randomUUID&&!t&&!e)return Xc.randomUUID();e=e||{};const r=e.random||(e.rng||b0)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return D0(r)}var j0="_1hnlbmt0";function M0(){const{t:e}=gt(),t=D(l=>l.parallelCount),n=D(l=>l.builtRequest),r=An(l=>l.addNewImage),i=An(l=>l.hasQueuedImages()),o=D(l=>l.isRandomSeed()),s=D(l=>l.setRequestOptions);return w("button",{className:j0,onClick:()=>{const l=n(),u=[];let{num_outputs:c}=l;if(t>c)u.push(c);else for(;c>=1;)c-=t,c<=0?u.push(t):u.push(Math.abs(c));u.forEach((f,d)=>{let p=l.seed;d!==0&&(p=Zr()),r(T0(),{...l,num_outputs:f,seed:p})}),o&&s("seed",Zr())},disabled:i,children:e("home.make-img-btn")})}function A0(){const{t:e}=gt(),t=D(i=>i.getValueForRequestKey("prompt")),n=D(i=>i.setRequestOptions),r=i=>{n("prompt",i.target.value)};return N("div",{className:k0,children:[N("div",{className:x0,children:[w("p",{children:e("home.editor-title")}),w("textarea",{value:t,onChange:r})]}),w(N0,{}),w(I0,{}),w(M0,{})]})}function U0(){const e=D(t=>t.isInpainting);return N(wn,{children:[N("div",{className:S0,children:[w(A0,{}),w(s0,{}),w(p0,{})]}),e&&w("div",{className:w0,children:w(y0,{})})]})}const z0=`${nn}/ding.mp3`,ch=Pf.forwardRef((e,t)=>w("audio",{ref:t,style:{display:"none"},children:w("source",{src:z0,type:"audio/mp3"})}));ch.displayName="AudioDing";var $0="_1yvg52n0",B0="_1yvg52n1";function Q0({imageData:e,metadata:t,className:n}){return w("div",{className:[$0,n].join(" "),children:w("img",{className:B0,src:e,alt:t.prompt})})}function V0({isLoading:e,image:t}){const{info:n,data:r}=t!=null?t:{},i=D(l=>l.setRequestOptions),o=()=>{const{prompt:l,seed:u,num_inference_steps:c,guidance_scale:f,use_face_correction:d,use_upscale:p,width:v,height:S}=n;let k=l.replace(/[^a-zA-Z0-9]/g,"_");k=k.substring(0,100);let m=`${k}_Seed-${u}_Steps-${c}_Guidance-${f}`;return d&&(m+=`_FaceCorrection-${d}`),p&&(m+=`_Upscale-${p}`),m+=`_${v}x${S}`,m+=".png",m},s=()=>{const l=document.createElement("a");l.download=o(),l.href=r,l.click()},a=()=>{i("init_image",r)};return w("div",{className:"current-display",children:e?w("h4",{className:"loading",children:"Loading..."}):t!=null&&N("div",{children:[N("p",{children:[" ",n==null?void 0:n.prompt]}),w(Q0,{imageData:r,metadata:n}),N("div",{children:[w("button",{onClick:s,children:"Save"}),w("button",{onClick:a,children:"Use as Input"})]})]})||w("h4",{className:"no-image",children:"Try Making a new image!"})})}var H0="fsj92y3",K0="fsj92y1",q0="fsj92y0",W0="fsj92y2";function G0({images:e,setCurrentDisplay:t,removeImages:n}){const r=i=>{const o=e[i];t(o)};return N("div",{className:q0,children:[e!=null&&e.length>0&&w("button",{className:H0,onClick:()=>{n()},children:"REMOVE"}),w("ul",{className:K0,children:e!=null&&e.map((i,o)=>i===void 0?(console.warn(`image ${o} is undefined`),null):w("li",{children:w("button",{className:W0,onClick:()=>{r(o)},children:w("img",{src:i.data,alt:i.info.prompt})})},i.id))})]})}var Y0="_688lcr1",J0="_688lcr0",X0="_688lcr2";const Z0="_batch";function e1(){const e=E.exports.useRef(null),t=D(g=>g.isSoundEnabled()),{id:n,options:r}=An(g=>g.firstInQueue()),i=An(g=>g.removeFirstInQueue),[o,s]=E.exports.useState(null),[a,l]=E.exports.useState(!1),[u,c]=E.exports.useState(!0),{status:f,data:d}=vn([Ns,n],async()=>await fy(r),{enabled:a});E.exports.useEffect(()=>{l(n!==void 0)},[n]),E.exports.useEffect(()=>{c(!!(a&&f==="loading"))},[a,f]),E.exports.useEffect(()=>{var g;f==="success"&&d.status==="succeeded"&&(t&&((g=e.current)==null||g.play()),i())},[f,d,i,e,t]);const p=$l(),[v,S]=E.exports.useState([]),k=An(g=>g.completedImageIds),m=An(g=>g.clearCachedIds);return E.exports.useEffect(()=>{const g=k.map(y=>p.getQueryData([Ns,y]));if(g.length>0){const y=g.map((P,_)=>{if(P!==void 0)return P.output.map((O,x)=>({id:`${k[x]}${Z0}-${O.seed}-${O.index}`,data:O.data,info:{...P.request,seed:O.seed}}))}).flat().reverse().filter(P=>P!==void 0);S(y),s(y[0]||null)}else S([]),s(null)},[S,s,p,k]),N("div",{className:J0,children:[w(ch,{ref:e}),w("div",{className:Y0,children:w(V0,{isLoading:u,image:o})}),w("div",{className:X0,children:w(G0,{removeImages:()=>{k.forEach(g=>{p.removeQueries([Ns,g])}),m()},images:v,setCurrentDisplay:s})})]})}var t1="_97t2g71",n1="_97t2g70";function r1(){return N("div",{className:n1,children:[N("p",{children:["If you found this project useful and want to help keep it alive, please"," ",w("a",{href:"https://ko-fi.com/cmdr2_stablediffusion_ui",target:"_blank",rel:"noreferrer",children:w("img",{src:`${nn}/kofi.png`,className:t1})})," ","to help cover the cost of development and maintenance! Thank you for your support!"]}),N("p",{children:["Please feel free to join the"," ",w("a",{href:"https://discord.com/invite/u9yhsFmEkB",target:"_blank",rel:"noreferrer",children:"discord community"})," ","or"," ",w("a",{href:"https://github.com/cmdr2/stable-diffusion-ui/issues",target:"_blank",rel:"noreferrer",children:"file an issue"})," ","if you have any problems or suggestions in using this interface."]}),N("div",{id:"footer-legal",children:[N("p",{children:[w("b",{children:"Disclaimer:"})," The authors of this project are not responsible for any content generated using this interface."]}),N("p",{children:["This license of this software forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, ",w("br",{}),"spread misinformation and target vulnerable groups. For the full list of restrictions please read"," ",w("a",{href:"https://github.com/cmdr2/stable-diffusion-ui/blob/main/LICENSE",target:"_blank",rel:"noreferrer",children:"the license"}),"."]}),w("p",{children:"By using this software, you consent to the terms and conditions of the license."})]})]})}function i1({className:e}){const t=D(a=>a.setRequestOptions),{status:n,data:r}=vn(["SaveDir"],ly),{status:i,data:o}=vn(["modifications"],ay),s=D(a=>a.setAllModifiers);return E.exports.useEffect(()=>{n==="success"&&t("save_to_disk_path",r)},[t,n,r]),E.exports.useEffect(()=>{i==="success"?s(o):i==="error"&&s(dy)},[t,i,o]),N("div",{className:[ey,e].join(" "),children:[w("header",{className:iy,children:w(Xy,{})}),w("nav",{className:ty,children:w(U0,{})}),w("main",{className:ny,children:w(e1,{})}),w("footer",{className:ry,children:w(r1,{})})]})}function o1({className:e}){return w("div",{children:w("h1",{children:"Settings"})})}var s1="_4vfmtj1z";function Gt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ba(e,t){return Ba=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Ba(e,t)}function qo(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ba(e,t)}function si(e,t){if(t&&(Wt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gt(e)}function pt(e){return pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},pt(e)}function a1(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l1(e){return oh(e)||a1(e)||sh(e)||ah()}function Zc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ef(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};nt(this,e),this.init(t,n)}return rt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||u1,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?a.replace(/###/g,"."):a}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function nf(e,t,n){var r=Xl(e,t,Object),i=r.obj,o=r.k;i[o]=n}function d1(e,t,n,r){var i=Xl(e,t,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function Oo(e,t){var n=Xl(e,t),r=n.obj,i=n.k;if(!!r)return r[i]}function rf(e,t,n){var r=Oo(e,n);return r!==void 0?r:Oo(t,n)}function fh(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):fh(e[r],t[r],n):e[r]=t[r]);return e}function _n(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var p1={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function h1(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return p1[t]}):e}var Wo=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,g1=[" ",",","?","!",";"];function m1(e,t,n){t=t||"",n=n||"";var r=g1.filter(function(a){return t.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}function of(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ci(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function dh(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+s;)s++,a=r.slice(o,o+s).join(n),l=i[a];if(l===void 0)return;if(l===null)return null;if(t.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var u=r.slice(o+s).join(n);return u?dh(l,u,n):void 0}i=i[r[o]]}return i}}var S1=function(e){qo(n,e);var t=v1(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return nt(this,n),i=t.call(this),Wo&&Xt.call(Gt(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return rt(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[i,o];s&&typeof s!="string"&&(c=c.concat(s)),s&&typeof s=="string"&&(c=c.concat(l?s.split(l):s)),i.indexOf(".")>-1&&(c=i.split("."));var f=Oo(this.data,c);return f||!u||typeof s!="string"?f:dh(this.data&&this.data[i]&&this.data[i][o],s,l)}},{key:"addResource",value:function(i,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[i,o];s&&(c=c.concat(u?s.split(u):s)),i.indexOf(".")>-1&&(c=i.split("."),a=o,o=c[1]),this.addNamespaces(o),nf(this.data,c,a),l.silent||this.emit("added",i,o,s,a)}},{key:"addResources",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(i,o,l,s[l],{silent:!0});a.silent||this.emit("added",i,o,s)}},{key:"addResourceBundle",value:function(i,o,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[i,o];i.indexOf(".")>-1&&(c=i.split("."),a=s,s=o,o=c[1]),this.addNamespaces(o);var f=Oo(this.data,c)||{};a?fh(f,s,l):f=Ci(Ci({},f),s),nf(this.data,c,f),u.silent||this.emit("added",i,o,s)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Ci(Ci({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Xt),ph={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var s=this;return t.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,i,o))}),n}};function sf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ge(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var af={},lf=function(e){qo(n,e);var t=w1(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return nt(this,n),i=t.call(this),Wo&&Xt.call(Gt(i)),f1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Gt(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=ut.create("translator"),i}return rt(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=s&&i.indexOf(s)>-1,c=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!m1(i,s,a);if(u&&!c){var f=i.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:i,namespaces:l};var d=i.split(s);(s!==a||s===a&&this.options.ns.indexOf(d[0])>-1)&&(l=d.shift()),i=d.join(a)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,s){var a=this;if(Wt(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,c=this.extractFromKey(i[i.length-1],o),f=c.key,d=c.namespaces,p=d[d.length-1],v=o.lng||this.language,S=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v&&v.toLowerCase()==="cimode"){if(S){var k=o.nsSeparator||this.options.nsSeparator;return l?(m.res="".concat(p).concat(k).concat(f),m):"".concat(p).concat(k).concat(f)}return l?(m.res=f,m):f}var m=this.resolve(i,o),h=m&&m.res,g=m&&m.usedKey||f,y=m&&m.exactUsedKey||f,P=Object.prototype.toString.apply(h),_=["[object Number]","[object Function]","[object RegExp]"],O=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,R=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if(x&&h&&R&&_.indexOf(P)<0&&!(typeof O=="string"&&P==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var b=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,h,ge(ge({},o),{},{ns:d})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(m.res=b,m):b}if(u){var M=P==="[object Array]",ne=M?[]:{},Re=M?y:g;for(var xe in h)if(Object.prototype.hasOwnProperty.call(h,xe)){var ar="".concat(Re).concat(u).concat(xe);ne[xe]=this.translate(ar,ge(ge({},o),{joinArrays:!1,ns:d})),ne[xe]===ar&&(ne[xe]=h[xe])}h=ne}}else if(x&&typeof O=="string"&&P==="[object Array]")h=h.join(O),h&&(h=this.extendTranslation(h,i,o,s));else{var It=!1,mt=!1,I=o.count!==void 0&&typeof o.count!="string",F=n.hasDefaultValue(o),T=I?this.pluralResolver.getSuffix(v,o.count,o):"",$=o["defaultValue".concat(T)]||o.defaultValue;!this.isValidLookup(h)&&F&&(It=!0,h=$),this.isValidLookup(h)||(mt=!0,h=f);var J=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,kn=J&&mt?void 0:h,Ne=F&&$!==h&&this.options.updateMissing;if(mt||It||Ne){if(this.logger.log(Ne?"updateKey":"missingKey",v,p,f,Ne?$:h),u){var xn=this.resolve(f,ge(ge({},o),{},{keySeparator:!1}));xn&&xn.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Ie=[],vt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&vt&&vt[0])for(var Go=0;Go1&&arguments[1]!==void 0?arguments[1]:{},a,l,u,c,f;return typeof i=="string"&&(i=[i]),i.forEach(function(d){if(!o.isValidLookup(a)){var p=o.extractFromKey(d,s),v=p.key;l=v;var S=p.namespaces;o.options.fallbackNS&&(S=S.concat(o.options.fallbackNS));var k=s.count!==void 0&&typeof s.count!="string",m=k&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),h=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",g=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);S.forEach(function(y){o.isValidLookup(a)||(f=y,!af["".concat(g[0],"-").concat(y)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(f)&&(af["".concat(g[0],"-").concat(y)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(g.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(function(P){if(!o.isValidLookup(a)){c=P;var _=[v];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(_,v,P,y,s);else{var O;k&&(O=o.pluralResolver.getSuffix(P,s.count,s));var x="".concat(o.options.pluralSeparator,"zero");if(k&&(_.push(v+O),m&&_.push(v+x)),h){var R="".concat(v).concat(o.options.contextSeparator).concat(s.context);_.push(R),k&&(_.push(R+O),m&&_.push(R+x))}}for(var b;b=_.pop();)o.isValidLookup(a)||(u=b,a=o.getResource(P,y,b,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:u,usedLng:c,usedNS:f}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,s,a):this.resourceStore.getResource(i,o,s,a)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&o===s.substring(0,o.length)&&i[s]!==void 0)return!0;return!1}}]),n}(Xt);function bs(e){return e.charAt(0).toUpperCase()+e.slice(1)}var x1=function(){function e(t){nt(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ut.create("languageUtils")}return rt(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=bs(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=bs(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=bs(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var s=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var s=r.getLanguagePartFromCode(o);if(r.isSupportedCode(s))return i=s;i=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(u){!u||(i.isSupportedCode(u)?s.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),o.forEach(function(l){s.indexOf(l)<0&&a(i.formatLanguageCode(l))}),s}}]),e}(),O1=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],P1={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},_1=["v1","v2","v3"],uf={zero:0,one:1,two:2,few:3,many:4,other:5};function C1(){var e={};return O1.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:P1[t.fc]}})}),e}var E1=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};nt(this,e),this.languageUtils=t,this.options=n,this.logger=ut.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=C1()}return rt(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return uf[s]-uf[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):o.numbers.map(function(s){return r.getSuffix(n,s,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!_1.includes(this.options.compatibilityJSON)}}]),e}();function cf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function We(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};nt(this,e),this.logger=ut.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return rt(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:h1,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?_n(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?_n(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?_n(r.nestingPrefix):r.nestingPrefixEscaped||_n("$t("),this.nestingSuffix=r.nestingSuffix?_n(r.nestingSuffix):r.nestingSuffixEscaped||_n(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var s=this,a,l,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(k){return k.replace(/\$/g,"$$$$")}var d=function(m){if(m.indexOf(s.formatSeparator)<0){var h=rf(r,c,m);return s.alwaysFormat?s.format(h,void 0,i,We(We(We({},o),r),{},{interpolationkey:m})):h}var g=m.split(s.formatSeparator),y=g.shift().trim(),P=g.join(s.formatSeparator).trim();return s.format(rf(r,c,y),P,i,We(We(We({},o),r),{},{interpolationkey:y}))};this.resetRegExp();var p=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,v=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,S=[{regex:this.regexpUnescape,safeValue:function(m){return f(m)}},{regex:this.regexp,safeValue:function(m){return s.escapeValue?f(s.escape(m)):f(m)}}];return S.forEach(function(k){for(u=0;a=k.regex.exec(n);){var m=a[1].trim();if(l=d(m),l===void 0)if(typeof p=="function"){var h=p(n,a,o);l=typeof h=="string"?h:""}else if(o&&o.hasOwnProperty(m))l="";else if(v){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(m," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=tf(l));var g=k.safeValue(l);if(n=n.replace(a[0],g),v?(k.regex.lastIndex+=l.length,k.regex.lastIndex-=a[0].length):k.regex.lastIndex=0,u++,u>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l=We({},o);l.applyPostProcessor=!1,delete l.defaultValue;function u(p,v){var S=this.nestingOptionsSeparator;if(p.indexOf(S)<0)return p;var k=p.split(new RegExp("".concat(S,"[ ]*{"))),m="{".concat(k[1]);p=k[0],m=this.interpolate(m,l);var h=m.match(/'/g),g=m.match(/"/g);(h&&h.length%2===0&&!g||g.length%2!==0)&&(m=m.replace(/'/g,'"'));try{l=JSON.parse(m),v&&(l=We(We({},v),l))}catch(y){return this.logger.warn("failed parsing options string in nesting for key ".concat(p),y),"".concat(p).concat(S).concat(m)}return delete l.defaultValue,p}for(;s=this.nestingRegexp.exec(n);){var c=[],f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var d=s[1].split(this.formatSeparator).map(function(p){return p.trim()});s[1]=d.shift(),c=d,f=!0}if(a=r(u.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=tf(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),f&&(a=c.reduce(function(p,v){return i.format(p,v,o.lng,We(We({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),e}();function ff(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bt(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(s){if(!!s){var a=s.split(":"),l=l1(a),u=l[0],c=l.slice(1),f=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=f),f==="false"&&(n[u.trim()]=!1),f==="true"&&(n[u.trim()]=!0),isNaN(f)||(n[u.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}var I1=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nt(this,e),this.logger=ut.create("formatter"),this.options=t,this.formats={number:function(r,i,o){return new Intl.NumberFormat(i,o).format(r)},currency:function(r,i,o){return new Intl.NumberFormat(i,bt(bt({},o),{},{style:"currency"})).format(r)},datetime:function(r,i,o){return new Intl.DateTimeFormat(i,bt({},o)).format(r)},relativetime:function(r,i,o){return new Intl.RelativeTimeFormat(i,bt({},o)).format(r,o.range||"day")},list:function(r,i,o){return new Intl.ListFormat(i,bt({},o)).format(r)}},this.init(t)}return rt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"format",value:function(n,r,i,o){var s=this,a=r.split(this.formatSeparator),l=a.reduce(function(u,c){var f=N1(c),d=f.formatName,p=f.formatOptions;if(s.formats[d]){var v=u;try{var S=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},k=S.locale||S.lng||o.locale||o.lng||i;v=s.formats[d](u,k,bt(bt(bt({},p),o),S))}catch(m){s.logger.warn(m)}return v}else s.logger.warn("there was no format function for ".concat(d));return u},n);return l}}]),e}();function df(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pf(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function D1(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var F1=function(e){qo(n,e);var t=L1(n);function n(r,i,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return nt(this,n),s=t.call(this),Wo&&Xt.call(Gt(s)),s.backend=r,s.store=i,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=ut.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return rt(n,[{key:"queueLoad",value:function(i,o,s,a){var l=this,u={},c={},f={},d={};return i.forEach(function(p){var v=!0;o.forEach(function(S){var k="".concat(p,"|").concat(S);!s.reload&&l.store.hasResourceBundle(p,S)?l.state[k]=2:l.state[k]<0||(l.state[k]===1?c[k]===void 0&&(c[k]=!0):(l.state[k]=1,v=!1,c[k]===void 0&&(c[k]=!0),u[k]===void 0&&(u[k]=!0),d[S]===void 0&&(d[S]=!0)))}),v||(f[p]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(d)}}},{key:"loaded",value:function(i,o,s){var a=i.split("|"),l=a[0],u=a[1];o&&this.emit("failedLoading",l,u,o),s&&this.store.addResourceBundle(l,u,s),this.state[i]=o?-1:2;var c={};this.queue.forEach(function(f){d1(f.loaded,[l],u),D1(f,i),o&&f.errors.push(o),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(d){c[d]||(c[d]={});var p=f.loaded[d];p.length&&p.forEach(function(v){c[d][v]===void 0&&(c[d][v]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(i,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!i.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:s,tried:l,wait:u,callback:c});return}return this.readingCalls++,this.backend[s](i,o,function(f,d){if(a.readingCalls--,a.waitingReads.length>0){var p=a.waitingReads.shift();a.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(f&&d&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,a,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(c){s.loadOne(c)})}},{key:"load",value:function(i,o,s){this.prepareLoading(i,o,{},s)}},{key:"reload",value:function(i,o,s){this.prepareLoading(i,o,{reload:!0},s)}},{key:"loadOne",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=i.split("|"),l=a[0],u=a[1];this.read(l,u,"read",void 0,void 0,function(c,f){c&&o.logger.warn("".concat(s,"loading namespace ").concat(u," for language ").concat(l," failed"),c),!c&&f&&o.logger.log("".concat(s,"loaded namespace ").concat(u," for language ").concat(l),f),o.loaded(i,c,f)})}},{key:"saveMissing",value:function(i,o,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}s==null||s===""||(this.backend&&this.backend.create&&this.backend.create(i,o,s,a,null,pf(pf({},u),{},{isUpdate:l})),!(!i||!i[0])&&this.store.addResource(i[0],o,s,a))}}]),n}(Xt);function T1(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Wt(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Wt(t[2])==="object"||Wt(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function hf(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function gf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ot(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ei(){}function A1(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var Po=function(e){qo(n,e);var t=j1(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(nt(this,n),r=t.call(this),Wo&&Xt.call(Gt(r)),r.options=hf(i),r.services={},r.logger=ut,r.modules={external:[]},A1(Gt(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),si(r,Gt(r));setTimeout(function(){r.init(i,o)},0)}return r}return rt(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=T1();this.options=ot(ot(ot({},a),this.options),hf(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=ot(ot({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(m){return m?typeof m=="function"?new m:m:null}if(!this.options.isClone){this.modules.logger?ut.init(l(this.modules.logger),this.options):ut.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=I1);var c=new x1(this.options);this.store=new S1(this.options.resources,this.options);var f=this.services;f.logger=ut,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new E1(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new R1(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new F1(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(m){for(var h=arguments.length,g=new Array(h>1?h-1:0),y=1;y1?h-1:0),y=1;y0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var p=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];p.forEach(function(m){i[m]=function(){var h;return(h=i.store)[m].apply(h,arguments)}});var v=["addResource","addResources","addResourceBundle","removeResourceBundle"];v.forEach(function(m){i[m]=function(){var h;return(h=i.store)[m].apply(h,arguments),i}});var S=vr(),k=function(){var h=function(y,P){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),S.resolve(P),s(y,P)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return h(null,i.t.bind(i));i.changeLanguage(i.options.lng,h)};return this.options.resources||!this.options.initImmediate?k():setTimeout(k,0),S}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ei,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var u=[],c=function(p){if(!!p){var v=o.services.languageUtils.toResolveHierarchy(p);v.forEach(function(S){u.indexOf(S)<0&&u.push(S)})}};if(l)c(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(d){return c(d)})}this.options.preload&&this.options.preload.forEach(function(d){return c(d)}),this.services.backendConnector.load(u,this.options.ns,function(d){!d&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(d)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=vr();return i||(i=this.languages),o||(o=this.options.ns),s||(s=Ei),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&ph.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=vr();this.emit("languageChanging",i);var l=function(d){s.language=d,s.languages=s.services.languageUtils.toResolveHierarchy(d),s.resolvedLanguage=void 0,s.setResolvedLanguage(d)},u=function(d,p){p?(l(p),s.translator.changeLanguage(p),s.isLanguageChangingTo=void 0,s.emit("languageChanged",p),s.logger.log("languageChanged",p)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(d,function(){return s.t.apply(s,arguments)})},c=function(d){!i&&!d&&s.services.languageDetector&&(d=[]);var p=typeof d=="string"?d:s.services.languageUtils.getBestMatchFromCodes(d);p&&(s.language||l(p),s.translator.language||s.translator.changeLanguage(p),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(p)),s.loadResources(p,function(v){u(v,p)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(c):c(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function u(c,f){var d;if(Wt(f)!=="object"){for(var p=arguments.length,v=new Array(p>2?p-2:0),S=2;S1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var c=function(p,v){var S=o.services.backendConnector.state["".concat(p,"|").concat(v)];return S===-1||S===2};if(s.precheck){var f=s.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(a,i)&&(!l||c(u,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=vr();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=vr();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(u){return a.indexOf(u)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(u){s.resolve(),o&&o(u)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ei,a=ot(ot(ot({},this.options),o),{isClone:!0}),l=new n(a);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(c){l[c]=i[c]}),l.services=ot({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new lf(l.services,l.options),l.translator.on("*",function(c){for(var f=arguments.length,d=new Array(f>1?f-1:0),p=1;p0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Po(e,t)});var ke=Po.createInstance();ke.createInstance=Po.createInstance;ke.createInstance;ke.init;ke.loadResources;ke.reloadResources;ke.use;ke.changeLanguage;ke.getFixedT;ke.t;ke.exists;ke.setDefaultNamespace;ke.hasLoadedNamespace;ke.loadNamespaces;ke.loadLanguages;const U1="Stable Diffusion UI",z1="",$1={home:"Home",history:"History",community:"Community",settings:"Settings"},B1={"status-starting":"Stable Diffusion is starting...","status-ready":"Stable Diffusion is ready to use!","status-error":"Stable Diffusion is not running!","editor-title":"Prompt","initial-img-txt":"Initial Image: (optional)","initial-img-btn":"Browse...","initial-img-text2":"No file selected.","make-img-btn":"Make Image","make-img-btn-stop":"Stop"},Q1={"base-img":"Use base image:",seed:"Seed:","amount-of-img":"Amount of images to make:","how-many":"How many at once:",width:"Width:",height:"Height:",steps:"Number of inference steps:","guide-scale":"Guidance Scale:","prompt-str":"Prompt Strength:","live-preview":"Show a live preview of the image (disable this for faster image generation)","fix-face":"Fix incorrect faces and eyes (uses GFPGAN)",ups:"Upscale the image to 4x resolution using:","no-ups":"No Upscaling",corrected:"Show only the corrected/upscaled image"},V1={txt:"Image Modifiers (art styles, tags etc)"},H1={"use-btn":"Use Image","use-btn2":"Use Image and Tags"},K1={fave:"Favorites Only",search:"Search"},q1={ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cps:"Cross profile sharing","cps-disc":"Profiles will see suggestions from each other.",acb:"Allow cloud backup","acb-disc":"A button will show up for images on hover","acb-place":"Choose your","acc-api":"Api key","acb-api-place":"Your API key",save:"SAVE"},W1=`If you found this project useful and want to help keep it alive, please to help cover the cost of development and maintenance! Thank you for your support!
Please feel free to join the discord community or file an issue if you have any problems or suggestions in using this interface.
@@ -94,4 +94,17 @@ By using this software, you consent to the terms and conditions of the license.
`,G1={title:U1,description:z1,navbar:$1,"land-cre":{cp:"Create Profile","cp-place":"Profile name",pp:"Profile Picture","pp-disc":"",ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cre:"Create"},"land-pre":{user:"Username",add:"Add Profile"},home:B1,"in-paint":{txt:"In-Painting (select the area which the AI will paint into)",clear:"Clear"},settings:Q1,tags:V1,"preview-prompt":{part1:'Type a prompt and press the "Make Image" button.',part2:`You can set an "Initial Image" if you want to guide the AI.
`,part3:`You can also add modifiers like "Realistic", "Pencil Sketch", "ArtStation" etc by browsing through the "Image Modifiers" section and selecting the desired modifiers.
`,part4:'Click "Advanced Settings" for additional settings like seed, image size, number of images to generate etc.',part5:"Enjoy! :)"},"current-task":"Current task","recent-create":"Recently Created",popup:H1,history:K1,"advanced-settings":{sound:"Play sound on task completion","sound-disc":"Will play a sound so user can hear when image is done.",turbo:"Turbo mode","turbo-disc":"Generates images faster, but uses an additional 1 GB of GPU memory",cpu:"Use CPU instead of GPU","cpu-disc":"Warning: this will be *very* slow",gpu:"Use full precision","gpu-disc":"(for GPU-only. warning: this will consume more VRAM)",beta:"Beta Features","beta-disc":`Get the latest features immediately (but could be less stable).
-Please restart the program after changing this.`,save:"SAVE"},storage:q1,import:{"imp-btn":"IMPORT","exp-btn":"EXPORT",disc:"It is a good idea to leave the exported file as it is. Otherwise it may not import correctly","disc:2":"When importing, only profiles that are not already present on the will be added."},about:W1},Y1="Stable Diffusion UI en Espa\xF1ol",J1="",X1={},Z1={},eS={},tS={},nS={},rS={},iS={},oS="",sS={title:Y1,description:J1,navbar:X1,"land-cre":{},"land-pre":{},home:Z1,"in-paint":{},settings:eS,tags:tS,"preview-prompt":{},"current-task":"","recent-create":"",popup:nS,history:rS,"advanced-settings":{},storage:iS,import:{},about:oS},aS={en:{translation:G1},es:{translation:sS}};ke.use(Qy).init({lng:"en",interpolation:{escapeValue:!1},resources:aS});const lS=new Am;function uS(){const e=s1;return w(Um,{location:lS,routes:[{path:"/",element:w(i1,{className:e})},{path:"/settings",element:w(o1,{className:e})}]})}const cS=new sm({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:1/0,cacheTime:1/0}}});Om();js.createRoot(document.getElementById("root")).render(w(_f.StrictMode,{children:N(um,{client:cS,children:[w(uS,{}),w(vm,{initialIsOpen:!0})]})}));
+Please restart the program after changing this.`,save:"SAVE"},storage:q1,import:{"imp-btn":"IMPORT","exp-btn":"EXPORT",disc:"It is a good idea to leave the exported file as it is. Otherwise it may not import correctly","disc:2":"When importing, only profiles that are not already present on the will be added."},about:W1},Y1="Stable Diffusion UI",J1="",X1={home:"Home",history:"History",community:"Community",settings:"Settings"},Z1={"status-starting":"Stable Diffusion is starting...","status-ready":"Stable Diffusion is ready to use!","status-error":"Stable Diffusion is not running!","editor-title":"Prompt","initial-img-txt":"Initial Image: (optional)","initial-img-btn":"Browse...","initial-img-text2":"No file selected.","make-img-btn":"Make Image","make-img-btn-stop":"Stop"},eS={"base-img":"Use base image:",seed:"Seed:","amount-of-img":"Amount of images to make:","how-many":"How many at once:",width:"Width:",height:"Height:",steps:"Number of inference steps:","guide-scale":"Guidance Scale:","prompt-str":"Prompt Strength:","live-preview":"Show a live preview of the image (disable this for faster image generation)","fix-face":"Fix incorrect faces and eyes (uses GFPGAN)",ups:"Upscale the image to 4x resolution using:","no-ups":"No Upscaling",corrected:"Show only the corrected/upscaled image"},tS={txt:"Image Modifiers (art styles, tags etc)"},nS={"use-btn":"Use Image","use-btn2":"Use Image and Tags"},rS={fave:"Favorites Only",search:"Search"},iS={ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cps:"Cross profile sharing","cps-disc":"Profiles will see suggestions from each other.",acb:"Allow cloud backup","acb-disc":"A button will show up for images on hover","acb-place":"Choose your","acc-api":"Api key","acb-api-place":"Your API key",save:"SAVE"},oS=`If you found this project useful and want to help keep it alive, please to help cover the cost of development and maintenance! Thank you for your support!
+
+Please feel free to join the discord community or file an issue if you have any problems or suggestions in using this interface.
+
+Disclaimer: The authors of this project are not responsible for any content generated using this interface.
+
+This license of this software forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm,
+spread misinformation and target vulnerable groups. For the full list of restrictions please read the license.
+
+By using this software, you consent to the terms and conditions of the license.
+`,sS={title:Y1,description:J1,navbar:X1,"land-cre":{cp:"Create Profile","cp-place":"Profile name",pp:"Profile Picture","pp-disc":"",ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cre:"Create"},"land-pre":{user:"Username",add:"Add Profile"},home:Z1,"in-paint":{txt:"In-Painting (select the area which the AI will paint into)",clear:"Clear"},settings:eS,tags:tS,"preview-prompt":{part1:'Type a prompt and press the "Make Image" button.',part2:`You can set an "Initial Image" if you want to guide the AI.
+`,part3:`You can also add modifiers like "Realistic", "Pencil Sketch", "ArtStation" etc by browsing through the "Image Modifiers" section and selecting the desired modifiers.
+`,part4:'Click "Advanced Settings" for additional settings like seed, image size, number of images to generate etc.',part5:"Enjoy! :)"},"current-task":"Current task","recent-create":"Recently Created",popup:nS,history:rS,"advanced-settings":{sound:"Play sound on task completion","sound-disc":"Will play a sound so user can hear when image is done.",turbo:"Turbo mode","turbo-disc":"Generates images faster, but uses an additional 1 GB of GPU memory",cpu:"Use CPU instead of GPU","cpu-disc":"Warning: this will be *very* slow",gpu:"Use full precision","gpu-disc":"(for GPU-only. warning: this will consume more VRAM)",beta:"Beta Features","beta-disc":`Get the latest features immediately (but could be less stable).
+Please restart the program after changing this.`,save:"SAVE"},storage:iS,import:{"imp-btn":"IMPORT","exp-btn":"EXPORT",disc:"It is a good idea to leave the exported file as it is. Otherwise it may not import correctly","disc:2":"When importing, only profiles that are not already present on the will be added."},about:oS},aS={en:{translation:G1},es:{translation:sS}};ke.use(Qy).init({lng:"en",interpolation:{escapeValue:!1},resources:aS});const lS=new Av;function uS(){const e=s1;return w(Uv,{location:lS,routes:[{path:"/",element:w(i1,{className:e})},{path:"/settings",element:w(o1,{className:e})}]})}const cS=new sv({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:1/0,cacheTime:1/0}}});Ov();Ds.createRoot(document.getElementById("root")).render(w(Pf.StrictMode,{children:N(uv,{client:cS,children:[w(uS,{}),w(mv,{initialIsOpen:!0})]})}));