const t={turquoise:"#1abc9c",emerald:"#2ecc71",river:"#3498db",amethyst:"#9b59b6",asphalt:"#34495e",sun:"#f1c40f",carrot:"#e67e22",alizarin:"#e74c3c",cloud:"#ecf0f1",concrete:"#95a5a6"},e={info:"#3498db",debug:"#9b59b6",warn:"#e67e22",error:"#e74c3c",log:"#95a5a6"},n={debug:0,log:1,info:2,warn:3,error:4};class s{constructor(i){this.level=1,this.new=t=>{const e=new s(t);return e.level=this.level,e.color=this.color,e},this.setColor=e=>(this.color=t[e],this),this.setLevel=t=>(this.level=n[t],this),this.debug=(...t)=>this.print("debug",...t),this.debugGroup=(t,...e)=>this.printGroup("debug",t,...e),this.log=(...t)=>this.print("log",...t),this.logGroup=(t,...e)=>this.printGroup("log",t,...e),this.info=(...t)=>this.print("info",...t),this.infoGroup=(t,...e)=>this.printGroup("info",t,...e),this.warn=(...t)=>this.print("warn",...t),this.warnGroup=(t,...e)=>this.printGroup("warn",t,...e),this.error=(...t)=>this.print("error",...t),this.errorGroup=(t,...e)=>this.printGroup("error",t,...e),this.print=(t,...e)=>{n[t]<this.level||console[t](...this.getColoredMessage(t,e))},this.printGroup=(t,e,...s)=>{n[t]<this.level||(console.groupCollapsed(...this.getColoredMessage(t,e)),console.log(...s),console.groupEnd())},this.getColoredMessage=(t,...n)=>{let s="black";return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(s="white"),[`%c${t.toUpperCase()} %c${this.prefix} %c${n.join(" ")}`,`color:${e[t]}; font-weight: bold;`,`color:${this.color}; font-weight: bold;`,`color:${s}; font-weight: normal;`]},this.prefix=i}}class i{constructor(t=i.defaultLanguage){this.logger=new s("SozlukClient").setColor("concrete").setLevel("info"),this.language=t,this.contents=[]}async getContent(t,e){const n=this.contents.filter((e=>e.key===t)),s={language:this.language,key:t,defaultData:e,defaultLanguage:i.defaultLanguage,contents:this.contents};if(!n)return void this.logger.warnGroup("A: No entry found.",s);const o=n.find((t=>t.language===this.language));if(this.language===i.defaultLanguage)return this.logger.debug("B: Found content which is default language.",Object.assign(Object.assign({},s),{entryInLanguage:o})),h(e,o);const r=n.find((t=>t.language===i.defaultLanguage));return o||r?!o&&r?(this.logger.debug("D: Found content only in default language.",Object.assign(Object.assign({},s),{entryInDefaultLanguage:r})),h(e,r)):o&&!r?(this.logger.debug("E: Found content only in provided language.",Object.assign(Object.assign({},s),{entryInLanguage:o})),h(e,o)):(this.logger.debug("F: Found content.",Object.assign(Object.assign({},s),{entryInLanguage:o,entryInDefaultLanguage:r})),h(e,h(r,o))):(this.logger.warnGroup("C: No content found.",s),e)}setContents(t){return this.contents=t,this}setLanguage(t){return this.language=t,this}}function o(t){return t&&"object"==typeof t&&!Array.isArray(t)}function h(t={},e={}){let n=Object.assign({},t);return o(t)&&o(e)&&Object.keys(e).forEach((s=>{o(e[s])?s in t?n[s]=h(t[s],e[s]):Object.assign(n,{[s]:e[s]}):Object.assign(n,{[s]:e[s]})})),n}i.defaultLanguage="en",i.build=(t,e)=>t.replace(/\{(.*?)}/g,((t,n)=>e[n]));export{s as L,i as S}