From 4a2234480c6b2105577310e90b7da7d0ae80c127 Mon Sep 17 00:00:00 2001 From: Thomas Steiner Date: Fri, 26 May 2023 13:24:53 +0200 Subject: [PATCH] Firefox clipboard fix --- docs/assets/{collect-356ee285.js => collect-563a935e.js} | 2 +- ...filehandling-7f105388.js => filehandling-aba82c08.js} | 2 +- docs/assets/{index-72d74a78.js => index-08969439.js} | 4 ++-- docs/assets/{install-83387fda.js => install-4fe4437f.js} | 2 +- docs/assets/{share-a6c580ec.js => share-627cad8a.js} | 2 +- ...owcontrols-ca6365f4.js => windowcontrols-f0d3548a.js} | 2 +- docs/index.html | 2 +- docs/sw.js | 2 +- src/js/clipboard.js | 9 ++++++++- 9 files changed, 17 insertions(+), 10 deletions(-) rename docs/assets/{collect-356ee285.js => collect-563a935e.js} (88%) rename docs/assets/{filehandling-7f105388.js => filehandling-aba82c08.js} (80%) rename docs/assets/{index-72d74a78.js => index-08969439.js} (91%) rename docs/assets/{install-83387fda.js => install-4fe4437f.js} (82%) rename docs/assets/{share-a6c580ec.js => share-627cad8a.js} (86%) rename docs/assets/{windowcontrols-ca6365f4.js => windowcontrols-f0d3548a.js} (79%) diff --git a/docs/assets/collect-356ee285.js b/docs/assets/collect-563a935e.js similarity index 88% rename from docs/assets/collect-356ee285.js rename to docs/assets/collect-563a935e.js index 8c3079f..859fd81 100644 --- a/docs/assets/collect-356ee285.js +++ b/docs/assets/collect-563a935e.js @@ -1 +1 @@ -import{l as g}from"./index-72d74a78.js";(async(o,n,t,a,r,c,s,d,i,e)=>{const m={z:`${o()}`.substr(2),cid:`${n.getItem(i)||(e=`${o()}`.substr(2),n.setItem(i,e),e)}`,ua:d.userAgent,dr:a.referrer||"",sr:`${t.width}x${t.height}`,vp:`${r.clientWidth}x${r.clientHeight}`,sd:`${t.pixelDepth}-bits`,ul:d.language,dl:c(s.href),dp:c(s.pathname),dt:a.title},h=new FormData;for(const[l,p]of Object.entries(m))h.append(l,p);try{await fetch("https://svgcode.glitch.me/",{method:"post",body:h})}catch{}})(Math.random,localStorage,screen,document,g,encodeURIComponent,location,navigator,"cid",0); +import{l as g}from"./index-08969439.js";(async(o,n,t,a,r,c,s,d,i,e)=>{const m={z:`${o()}`.substr(2),cid:`${n.getItem(i)||(e=`${o()}`.substr(2),n.setItem(i,e),e)}`,ua:d.userAgent,dr:a.referrer||"",sr:`${t.width}x${t.height}`,vp:`${r.clientWidth}x${r.clientHeight}`,sd:`${t.pixelDepth}-bits`,ul:d.language,dl:c(s.href),dp:c(s.pathname),dt:a.title},h=new FormData;for(const[l,p]of Object.entries(m))h.append(l,p);try{await fetch("https://svgcode.glitch.me/",{method:"post",body:h})}catch{}})(Math.random,localStorage,screen,document,g,encodeURIComponent,location,navigator,"cid",0); diff --git a/docs/assets/filehandling-7f105388.js b/docs/assets/filehandling-aba82c08.js similarity index 80% rename from docs/assets/filehandling-7f105388.js rename to docs/assets/filehandling-aba82c08.js index 1532777..00165a2 100644 --- a/docs/assets/filehandling-7f105388.js +++ b/docs/assets/filehandling-aba82c08.js @@ -1 +1 @@ -import{i as n,s as a,F as o}from"./index-72d74a78.js";window.launchQueue.setConsumer(async e=>{if(e.files.length)for(const t of e.files){const s=await t.getFile();if(s.type.startsWith("image/")){const i=URL.createObjectURL(s);n.addEventListener("load",()=>{URL.revokeObjectURL(i)},{once:!0}),n.src=i,await a(o,t);return}}}); +import{i as n,s as a,F as o}from"./index-08969439.js";window.launchQueue.setConsumer(async e=>{if(e.files.length)for(const t of e.files){const s=await t.getFile();if(s.type.startsWith("image/")){const i=URL.createObjectURL(s);n.addEventListener("load",()=>{URL.revokeObjectURL(i)},{once:!0}),n.src=i,await a(o,t);return}}}); diff --git a/docs/assets/index-72d74a78.js b/docs/assets/index-08969439.js similarity index 91% rename from docs/assets/index-72d74a78.js rename to docs/assets/index-08969439.js index 6c56159..e3eeb29 100644 --- a/docs/assets/index-72d74a78.js +++ b/docs/assets/index-08969439.js @@ -23,7 +23,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho - `.replace(/[\r\n]/g,"").replace(/\s+/g," ").trim(),Dt=()=>{let e="";for(const[t,n]of Object.entries(Ut)){const r=v[t];n.initial!==Number(r.value)&&(e+=`${t}(${r.value}${r.dataset.unit}) `)}return e},xn=()=>{let e=`${R.checked?`url('${Sn()}#posterize') `:""}`;return e+=Dt(),e.trim()||"none"};function Pn(){return new Worker("/assets/monochromeworker-f4bfce91.js")}let q=null;const Cn=async e=>(q&&q.terminate(),q=new Pn,new Promise(async t=>{const n=new MessageChannel;n.port1.onmessage=({data:i})=>{n.port1.close(),q&&(q.terminate(),q=null),t(i.result)};const r={turdsize:Number(v[L.turdsize].value),alphamax:Number(v[L.alphamax].value),turnpolicy:Number(v[L.turnpolicy].value),opttolerance:Number(v[L.opttolerance].value),opticurve:O.checked?1:0,extractcolors:!1};q.postMessage({imageData:e,params:r},[n.port2])}));function On(){return new Worker("/assets/colorworker-9f272d25.js")}let W=null;const M={},Tn=async e=>(W&&W.terminate(),W=new On,new Promise(async t=>{const n=new MessageChannel;n.port1.onmessage=({data:l})=>{n.port1.close(),W&&(W.terminate(),W=null),t(l.result)},Oe.value=0;let r="",i="",a="",s=0;M.current&&(clearInterval(M.current),M.current=null),M.current=setInterval(()=>{const l=`${r}${a}${i}`;if(l.length!==s){const d=w.dataset.transform;d&&w.setAttribute("transform",d),w.innerHTML=l,s=l.length}},500);const o=new MessageChannel;o.port1.onmessage=({data:l})=>{const d=Math.floor(l.processed/l.total*100);if(Oe.value=d,l.svg){r||(r=l.svg.replace(/(.*?]+>)(.*?)(<\/svg>)/,"$1").replace(/\s+width="\d+(?:\.\d+)?"/,"").replace(/\s+height="\d+(?:\.\d+)"/,""),i=l.svg.replace(/(.*?]+>)(.*?)(<\/svg>)/,"$3"));const u=l.svg.replace(/(.*?]+>)(.*?)(<\/svg>)/,"$2");a+=u}l.processed===l.total&&(clearInterval(M.current),M.current=null,o.port1.close(),Oe.value=0)};const c={minPathSegments:Number(v[L.minPathLength].value),strokeWidth:Number(v[L.strokeWidth].value),turdsize:Number(v[L.turdsize].value),alphamax:Number(v[L.alphamax].value),turnpolicy:Number(v[L.turnpolicy].value),opttolerance:Number(v[L.opttolerance].value),opticurve:O.checked?1:0,extractcolors:!1,posterizelevel:2,posterizationalgorithm:0};W.postMessage({imageData:e,params:c},[n.port2,o.port2])})),yt=(e,t)=>{const n=e[t];return n?typeof n=="function"?n():Promise.resolve(n):new Promise((r,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+t)))})},we="language",Rn=["ar","be","ca","da","de","el","en","es","fr","he","id","it","ja","ko","nl","no","pl","pt","ru","uk","zh"],An=["ar-TN","be-BY","ca-ES","da-DK","de-DE","el-GR","en-GB","en-US","es-ES","fr-FR","he-IL","id-ID","it-IT","ja-JP","ko-KR","nl-NL","no-NO","pl-PL","pt-BR","ru-RU","uk-UA","zh-CN"],In=["ar","fa","he","ur"];class Mn{constructor(){this.defaultLanguage="en",this.defaultLocale="US",this.translations=null,this.supportedLanguages=Rn,this.supportedLocales=An,this.currentLanguageAndLocale=this.detectOrRestoreLanguageAndLocale()}findBestMatchingLanguageAndLocale(t,n){return n&&(n=n.toUpperCase()),!t||!this.supportedLanguages.includes(t)?(t=this.defaultLanguage,n=this.defaultLocale):(!n||!this.supportedLocales.includes(`${t}-${n}`))&&(n=this.supportedLocales.find(r=>r.startsWith(`${t}-`)).split("-")[1]),{language:t,locale:n}}detectOrRestoreLanguageAndLocale(){const t=new URL(location),n=t.searchParams,r=n.get("lang");if(r){n.delete("lang"),history.pushState({},"",t);const[c,l=""]=r.split("-"),{language:d,locale:u}=this.findBestMatchingLanguageAndLocale(c,l);return this.setLanguageAndLocale(d,u),{language:d,locale:u}}try{const c=localStorage.getItem(we);if(c){const{language:l,locale:d}=JSON.parse(c);return this.setLanguageAndLocale(l,d),{language:l,locale:d}}}catch{}const[i,a=""]=navigator.language?.split("-"),{language:s,locale:o}=this.findBestMatchingLanguageAndLocale(i,a);return this.setLanguageAndLocale(s,o),{language:s,locale:o}}async setLanguageAndLocale(t,n){try{this.supportedLanguages.includes(t)||(localStorage.removeItem(we),t=this.defaultLanguage,n=this.defaultLocale),n&&!this.supportedLocales.includes(`${t}-${n}`)&&(localStorage.removeItem(we),t=this.defaultLanguage,n=this.defaultLocale),this.currentLanguageAndLocale={language:t,locale:n},localStorage.setItem(we,JSON.stringify(this.currentLanguageAndLocale))}catch{}T.lang=`${t}${n?`-${n}`:""}`,In.includes(t)?T.dir="rtl":T.dir="ltr",await this.getTranslations()}async getTranslations(){const{language:t,locale:n}=this.currentLanguageAndLocale;this.translations=(await yt(Object.assign({"../i18n/ar-TN.js":()=>p(()=>import("./ar-TN-917a8102.js"),["assets/ar-TN-917a8102.js","assets/languages-e8d9835d.js"]),"../i18n/be-BY.js":()=>p(()=>import("./be-BY-e27002d9.js"),["assets/be-BY-e27002d9.js","assets/languages-e8d9835d.js"]),"../i18n/ca-ES.js":()=>p(()=>import("./ca-ES-450231bf.js"),["assets/ca-ES-450231bf.js","assets/languages-e8d9835d.js"]),"../i18n/da-DK.js":()=>p(()=>import("./da-DK-fecf3d76.js"),["assets/da-DK-fecf3d76.js","assets/languages-e8d9835d.js"]),"../i18n/de-DE.js":()=>p(()=>import("./de-DE-c44b440e.js"),["assets/de-DE-c44b440e.js","assets/languages-e8d9835d.js"]),"../i18n/el-GR.js":()=>p(()=>import("./el-GR-cf1cb156.js"),["assets/el-GR-cf1cb156.js","assets/languages-e8d9835d.js"]),"../i18n/en-GB.js":()=>p(()=>import("./en-GB-1ebb0134.js"),["assets/en-GB-1ebb0134.js","assets/languages-e8d9835d.js"]),"../i18n/en-US.js":()=>p(()=>import("./en-US-14af226a.js"),["assets/en-US-14af226a.js","assets/languages-e8d9835d.js"]),"../i18n/es-ES.js":()=>p(()=>import("./es-ES-8cdc11e3.js"),["assets/es-ES-8cdc11e3.js","assets/languages-e8d9835d.js"]),"../i18n/fr-FR.js":()=>p(()=>import("./fr-FR-dff4346a.js"),["assets/fr-FR-dff4346a.js","assets/languages-e8d9835d.js"]),"../i18n/he-IL.js":()=>p(()=>import("./he-IL-3b82a749.js"),["assets/he-IL-3b82a749.js","assets/languages-e8d9835d.js"]),"../i18n/id-ID.js":()=>p(()=>import("./id-ID-d5dc62f7.js"),["assets/id-ID-d5dc62f7.js","assets/languages-e8d9835d.js"]),"../i18n/it-IT.js":()=>p(()=>import("./it-IT-24240090.js"),["assets/it-IT-24240090.js","assets/languages-e8d9835d.js"]),"../i18n/ja-JP.js":()=>p(()=>import("./ja-JP-6b72f65f.js"),["assets/ja-JP-6b72f65f.js","assets/languages-e8d9835d.js"]),"../i18n/ko-KR.js":()=>p(()=>import("./ko-KR-9fdbc612.js"),["assets/ko-KR-9fdbc612.js","assets/languages-e8d9835d.js"]),"../i18n/languages.js":()=>p(()=>import("./languages-e8d9835d.js"),[]),"../i18n/nl-NL.js":()=>p(()=>import("./nl-NL-f6a4c727.js"),["assets/nl-NL-f6a4c727.js","assets/languages-e8d9835d.js"]),"../i18n/no-NO.js":()=>p(()=>import("./no-NO-cb14a155.js"),["assets/no-NO-cb14a155.js","assets/languages-e8d9835d.js"]),"../i18n/pl-PL.js":()=>p(()=>import("./pl-PL-9ac090e3.js"),["assets/pl-PL-9ac090e3.js","assets/languages-e8d9835d.js"]),"../i18n/pt-BR.js":()=>p(()=>import("./pt-BR-30fb79a1.js"),["assets/pt-BR-30fb79a1.js","assets/languages-e8d9835d.js"]),"../i18n/ru-RU.js":()=>p(()=>import("./ru-RU-e5f207da.js"),["assets/ru-RU-e5f207da.js","assets/languages-e8d9835d.js"]),"../i18n/uk-UA.js":()=>p(()=>import("./uk-UA-87a01182.js"),["assets/uk-UA-87a01182.js","assets/languages-e8d9835d.js"]),"../i18n/zh-CN.js":()=>p(()=>import("./zh-CN-148f9e59.js"),["assets/zh-CN-148f9e59.js","assets/languages-e8d9835d.js"])}),`../i18n/${t}${n?`-${n}`:""}.js`).catch(()=>yt(Object.assign({"../i18n/ar-TN.js":()=>p(()=>import("./ar-TN-917a8102.js"),["assets/ar-TN-917a8102.js","assets/languages-e8d9835d.js"]),"../i18n/be-BY.js":()=>p(()=>import("./be-BY-e27002d9.js"),["assets/be-BY-e27002d9.js","assets/languages-e8d9835d.js"]),"../i18n/ca-ES.js":()=>p(()=>import("./ca-ES-450231bf.js"),["assets/ca-ES-450231bf.js","assets/languages-e8d9835d.js"]),"../i18n/da-DK.js":()=>p(()=>import("./da-DK-fecf3d76.js"),["assets/da-DK-fecf3d76.js","assets/languages-e8d9835d.js"]),"../i18n/de-DE.js":()=>p(()=>import("./de-DE-c44b440e.js"),["assets/de-DE-c44b440e.js","assets/languages-e8d9835d.js"]),"../i18n/el-GR.js":()=>p(()=>import("./el-GR-cf1cb156.js"),["assets/el-GR-cf1cb156.js","assets/languages-e8d9835d.js"]),"../i18n/en-GB.js":()=>p(()=>import("./en-GB-1ebb0134.js"),["assets/en-GB-1ebb0134.js","assets/languages-e8d9835d.js"]),"../i18n/en-US.js":()=>p(()=>import("./en-US-14af226a.js"),["assets/en-US-14af226a.js","assets/languages-e8d9835d.js"]),"../i18n/es-ES.js":()=>p(()=>import("./es-ES-8cdc11e3.js"),["assets/es-ES-8cdc11e3.js","assets/languages-e8d9835d.js"]),"../i18n/fr-FR.js":()=>p(()=>import("./fr-FR-dff4346a.js"),["assets/fr-FR-dff4346a.js","assets/languages-e8d9835d.js"]),"../i18n/he-IL.js":()=>p(()=>import("./he-IL-3b82a749.js"),["assets/he-IL-3b82a749.js","assets/languages-e8d9835d.js"]),"../i18n/id-ID.js":()=>p(()=>import("./id-ID-d5dc62f7.js"),["assets/id-ID-d5dc62f7.js","assets/languages-e8d9835d.js"]),"../i18n/it-IT.js":()=>p(()=>import("./it-IT-24240090.js"),["assets/it-IT-24240090.js","assets/languages-e8d9835d.js"]),"../i18n/ja-JP.js":()=>p(()=>import("./ja-JP-6b72f65f.js"),["assets/ja-JP-6b72f65f.js","assets/languages-e8d9835d.js"]),"../i18n/ko-KR.js":()=>p(()=>import("./ko-KR-9fdbc612.js"),["assets/ko-KR-9fdbc612.js","assets/languages-e8d9835d.js"]),"../i18n/languages.js":()=>p(()=>import("./languages-e8d9835d.js"),[]),"../i18n/nl-NL.js":()=>p(()=>import("./nl-NL-f6a4c727.js"),["assets/nl-NL-f6a4c727.js","assets/languages-e8d9835d.js"]),"../i18n/no-NO.js":()=>p(()=>import("./no-NO-cb14a155.js"),["assets/no-NO-cb14a155.js","assets/languages-e8d9835d.js"]),"../i18n/pl-PL.js":()=>p(()=>import("./pl-PL-9ac090e3.js"),["assets/pl-PL-9ac090e3.js","assets/languages-e8d9835d.js"]),"../i18n/pt-BR.js":()=>p(()=>import("./pt-BR-30fb79a1.js"),["assets/pt-BR-30fb79a1.js","assets/languages-e8d9835d.js"]),"../i18n/ru-RU.js":()=>p(()=>import("./ru-RU-e5f207da.js"),["assets/ru-RU-e5f207da.js","assets/languages-e8d9835d.js"]),"../i18n/uk-UA.js":()=>p(()=>import("./uk-UA-87a01182.js"),["assets/uk-UA-87a01182.js","assets/languages-e8d9835d.js"]),"../i18n/zh-CN.js":()=>p(()=>import("./zh-CN-148f9e59.js"),["assets/zh-CN-148f9e59.js","assets/languages-e8d9835d.js"])}),`../i18n/${this.defaultLocale}.js`))).default}t(t){return this.translations[t]||"⛔️ Missing translation"}}const m=new Mn,$n='',Vn=e=>{if(e===0)return"0B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(2)*1} ${["B","KB","MB"][t]}`},wt=(e,t)=>{e&&(e=e.replace(/\s+width="\d+(?:\.\d+)?"/,"").replace(/\s+height="\d+(?:\.\d+)"/,""),w.classList.remove(Me),w.classList.remove($e),w.classList.add(t),w.innerHTML=e,P(`${m.t("svgSize")}: ${Vn(e.length)}`,3e3))},A=async()=>{w.innerHTML="",w.classList.remove(Me,$e),M.current&&(clearInterval(M.current),M.current=null);const e=w.getAttribute("transform");w.innerHTML=$n,e&&(w.dataset.transform=e,w.setAttribute("transform",""));const t=zt?await Vt():jt();if(_.checked){const n=await Tn(t);e&&w.setAttribute("transform",e),wt(n,Me)}else{const n=await Cn(t);e&&w.setAttribute("transform",e),wt(n,$e)}},ge=(()=>{if(typeof self>"u")return!1;if("top"in self&&self!==top)try{}catch{return!1}return"showOpenFilePicker"in self})(),jn=ge?Promise.resolve().then(function(){return Un}):Promise.resolve().then(function(){return Xn});async function zn(...e){return(await jn).default(...e)}ge?Promise.resolve().then(function(){return Wn}):Promise.resolve().then(function(){return Jn});const Dn=ge?Promise.resolve().then(function(){return Gn}):Promise.resolve().then(function(){return Qn});async function Hn(...e){return(await Dn).default(...e)}const Bn=async e=>{const t=await e.getFile();return t.handle=e,t};var Nn=async(e=[{}])=>{Array.isArray(e)||(e=[e]);const t=[];e.forEach((i,a)=>{t[a]={description:i.description||"Files",accept:{}},i.mimeTypes?i.mimeTypes.map(s=>{t[a].accept[s]=i.extensions||[]}):t[a].accept["*/*"]=i.extensions||[]});const n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(Bn));return e[0].multiple?r:r[0]},Un={__proto__:null,default:Nn};function Re(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(i){return{value:i,done:r}})}return Re=function(n){this.s=n,this.n=n.next},Re.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(n){var r=this.s.return;return r===void 0?Promise.resolve({value:n,done:!0}):t(r.apply(this.s,arguments))},throw:function(n){var r=this.s.return;return r===void 0?Promise.reject(n):t(r.apply(this.s,arguments))}},new Re(e)}const Ht=async(e,t,n=e.name,r)=>{const i=[],a=[];var s,o=!1,c=!1;try{for(var l,d=function(u){var h,f,E,V=2;for(typeof Symbol<"u"&&(f=Symbol.asyncIterator,E=Symbol.iterator);V--;){if(f&&(h=u[f])!=null)return h.call(u);if(E&&(h=u[E])!=null)return new Re(h.call(u));f="@@asyncIterator",E="@@iterator"}throw new TypeError("Object is not async iterable")}(e.values());o=!(l=await d.next()).done;o=!1){const u=l.value,h=`${n}/${u.name}`;u.kind==="file"?a.push(u.getFile().then(f=>(f.directoryHandle=e,f.handle=u,Object.defineProperty(f,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>h})))):u.kind!=="directory"||!t||r&&r(u)||i.push(Ht(u,t,h,r))}}catch(u){c=!0,s=u}finally{try{o&&d.return!=null&&await d.return()}finally{if(c)throw s}}return[...(await Promise.all(i)).flat(),...await Promise.all(a)]};var qn=async(e={})=>{e.recursive=e.recursive||!1,e.mode=e.mode||"read";const t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode});return(await(await t.values()).next()).done?[t]:Ht(t,e.recursive,void 0,e.skipDirectory)},Wn={__proto__:null,default:qn},Fn=async(e,t=[{}],n=null,r=!1,i=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const a=[];let s=null;if(e instanceof Blob&&e.type?s=e.type:e.headers&&e.headers.get("content-type")&&(s=e.headers.get("content-type")),t.forEach((l,d)=>{a[d]={description:l.description||"Files",accept:{}},l.mimeTypes?(d===0&&s&&l.mimeTypes.push(s),l.mimeTypes.map(u=>{a[d].accept[u]=l.extensions||[]})):s?a[d].accept[s]=l.extensions||[]:a[d].accept["*/*"]=l.extensions||[]}),n)try{await n.getFile()}catch(l){if(n=null,r)throw l}const o=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:a,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&i&&i(o);const c=await o.createWritable();return"stream"in e?(await e.stream().pipeTo(c),o):"body"in e?(await e.body.pipeTo(c),o):(await c.write(await e),await c.close(),o)},Gn={__proto__:null,default:Fn},Yn=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,n)=>{const r=document.createElement("input");r.type="file";const i=[...e.map(c=>c.mimeTypes||[]),...e.map(c=>c.extensions||[])].join();r.multiple=e[0].multiple||!1,r.accept=i||"",r.style.display="none",document.body.append(r);const a=c=>{typeof s=="function"&&s(),t(c)},s=e[0].legacySetup&&e[0].legacySetup(a,()=>s(n),r),o=()=>{window.removeEventListener("focus",o),r.remove()};r.addEventListener("click",()=>{window.addEventListener("focus",o)}),r.addEventListener("change",()=>{window.removeEventListener("focus",o),r.remove(),a(r.multiple?Array.from(r.files):r.files[0])}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Xn={__proto__:null,default:Yn},Kn=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,n)=>{const r=document.createElement("input");r.type="file",r.webkitdirectory=!0;const i=s=>{typeof a=="function"&&a(),t(s)},a=e[0].legacySetup&&e[0].legacySetup(i,()=>a(n),r);r.addEventListener("change",()=>{let s=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(s=s.filter(o=>o.webkitRelativePath.split("/").every(c=>!e[0].skipDirectory({name:c,kind:"directory"})))):s=s.filter(o=>o.webkitRelativePath.split("/").length===2),i(s)}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Jn={__proto__:null,default:Kn},Zn=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);const n=document.createElement("a");let r=e;"body"in e&&(r=await async function(s,o){const c=s.getReader(),l=new ReadableStream({start:h=>async function f(){return c.read().then(({done:E,value:V})=>{if(!E)return h.enqueue(V),f();h.close()})}()}),d=new Response(l),u=await d.blob();return c.releaseLock(),new Blob([u],{type:o})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(await r);const i=()=>{typeof a=="function"&&a()},a=t.legacySetup&&t.legacySetup(i,()=>a(),n);return n.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(n.href),3e4),i()}),n.click(),null},Qn={__proto__:null,default:Zn};function er(){return new Worker("/assets/svgoworker-7ff1a964.js")}let F=null;const Ae=async e=>(F&&F.terminate(),F=new er,new Promise(t=>{const n=new MessageChannel;n.port1.onmessage=({data:r})=>{n.port1.close(),F&&(F.terminate(),F=null),t(r.result)},F.postMessage({svg:e},[n.port2])}));function ze(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function tr(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=ze(n);return(i,a)=>r.then(s=>a(s.transaction(t,i).objectStore(t)))}let We;function st(){return We||(We=tr("keyval-store","keyval")),We}function re(e,t=st()){return t("readonly",n=>ze(n.get(e)))}function U(e,t,n=st()){return n("readwrite",r=>(r.put(t,e),ze(r.transaction)))}function nr(e,t=st()){return t("readwrite",n=>(n.delete(e),ze(n.transaction)))}const me="fileHandle",rr=e=>e?e.name.replace(/\.[^\.]+$/,""):"";Ee.addEventListener("click",async()=>{try{const e=await zn({mimeTypes:["image/*"],description:"Image files"}),t=URL.createObjectURL(e);y.addEventListener("load",()=>{URL.revokeObjectURL(t)},{once:!0}),y.src=t,ge&&await U(me,e.handle)}catch(e){console.error(e.name,e.message),P(e.message)}});document.addEventListener("dragover",e=>{e.preventDefault()});document.addEventListener("dragenter",e=>{e.preventDefault(),T.classList.add("dropenter")});document.addEventListener("dragleave",e=>{e.preventDefault(),e.target===T&&T.classList.remove("dropenter")});document.addEventListener("drop",async e=>{e.preventDefault(),e.stopPropagation(),T.classList.remove("dropenter");const t=e.dataTransfer.items[0];if(t.kind==="file"){let n;if(y.addEventListener("load",()=>{URL.revokeObjectURL(n)},{once:!0}),ge){const i=await t.getAsFileSystemHandle();if(i.kind!=="file")return;const a=await i.getFile();n=URL.createObjectURL(a),y.src=n,await U(me,i);return}const r=t.getAsFile();n=URL.createObjectURL(r),y.src=n}});ke.addEventListener("click",async()=>{const e=async()=>{P(m.t("optimizingSVG"),1/0);const t=await Ae(w.innerHTML);return Tr(),new Blob([t],{type:"image/svg+xml"})};try{let t=!1;try{t=await re(me)}catch{}const n=rr(t);await Hn(e(),{fileName:n,description:"SVG file",extensions:[".svg"],mimeTypes:["image/svg+xml"]}),P(m.t("savedSVG"))}catch(t){console.error(t.name,t.message),P(t.message)}});Pe.addEventListener("click",async()=>{try{const e=await navigator.clipboard.read();for(const t of e)for(const n of t.types)if(n.startsWith("image/")){const r=await t.getType(n);if(!r)return;const i=URL.createObjectURL(r);y.src=i;return}}catch(e){console.error(e.name,e.message),P(e.message)}});document.addEventListener("paste",e=>{try{if(!e.clipboardData.files.length)return;const t=e.clipboardData.files[0];if(t.type.startsWith("image/")){const n=URL.createObjectURL(t);y.src=n;return}}catch(t){console.error(t.name,t.message),P(t.message)}});Se.addEventListener("click",async()=>{let e=w.innerHTML;P(m.t("optimizingSVG"),1/0);try{"ClipboardItem"in window?Mt?await navigator.clipboard.write([new ClipboardItem({"text/plain":new Promise(async t=>{t(new Blob([e],{type:"text/plain"}))})})]):(e=await Ae(e),await navigator.clipboard.write([new ClipboardItem({"text/plain":new Promise(async t=>{t(new Blob([e],{type:"text/plain"}))}),"image/svg+xml":new Promise(async t=>{t(new Blob([e],{type:"image/svg+xml"}))})})])):await navigator.clipboard.writeText(await Ae(e))}catch{e=await Ae(e);const n=new Blob([e],{type:"text/plain"}),r=new Blob([e],{type:"image/svg+xml"});try{Number(navigator.userAgent.replace(/.*Chrome\/(\d+).*/,"$1"))<=88?await navigator.clipboard.write([new ClipboardItem({[n.type]:n})]):await navigator.clipboard.write([new ClipboardItem({[r.type]:r,[n.type]:n})])}catch{try{await navigator.clipboard.write([new ClipboardItem({[n.type]:n})])}catch(a){P(a.message);return}}}P(m.t("copiedSVG"))});class B{constructor(t){this.id=-1,this.nativePointer=t,this.pageX=t.pageX,this.pageY=t.pageY,this.clientX=t.clientX,this.clientY=t.clientY,self.Touch&&t instanceof Touch?this.id=t.identifier:le(t)&&(this.id=t.pointerId)}getCoalesced(){if("getCoalescedEvents"in this.nativePointer){const t=this.nativePointer.getCoalescedEvents().map(n=>new B(n));if(t.length>0)return t}return[this]}}const le=e=>"pointerId"in e,Fe=e=>"changedTouches"in e,bt=()=>{};class ir{constructor(t,{start:n=()=>!0,move:r=bt,end:i=bt,rawUpdates:a=!1,avoidPointerEvents:s=!1}={}){this._element=t,this.startPointers=[],this.currentPointers=[],this._excludeFromButtonsCheck=new Set,this._pointerStart=o=>{if(le(o)&&o.buttons===0)this._excludeFromButtonsCheck.add(o.pointerId);else if(!(o.buttons&1))return;const c=new B(o);this.currentPointers.some(l=>l.id===c.id)||this._triggerPointerStart(c,o)&&(le(o)?((o.target&&"setPointerCapture"in o.target?o.target:this._element).setPointerCapture(o.pointerId),this._element.addEventListener(this._rawUpdates?"pointerrawupdate":"pointermove",this._move),this._element.addEventListener("pointerup",this._pointerEnd),this._element.addEventListener("pointercancel",this._pointerEnd)):(window.addEventListener("mousemove",this._move),window.addEventListener("mouseup",this._pointerEnd)))},this._touchStart=o=>{for(const c of Array.from(o.changedTouches))this._triggerPointerStart(new B(c),o)},this._move=o=>{if(!Fe(o)&&(!le(o)||!this._excludeFromButtonsCheck.has(o.pointerId))&&o.buttons===0){this._pointerEnd(o);return}const c=this.currentPointers.slice(),l=Fe(o)?Array.from(o.changedTouches).map(u=>new B(u)):[new B(o)],d=[];for(const u of l){const h=this.currentPointers.findIndex(f=>f.id===u.id);h!==-1&&(d.push(u),this.currentPointers[h]=u)}d.length!==0&&this._moveCallback(c,d,o)},this._triggerPointerEnd=(o,c)=>{if(!Fe(c)&&c.buttons&1)return!1;const l=this.currentPointers.findIndex(u=>u.id===o.id);if(l===-1)return!1;this.currentPointers.splice(l,1),this.startPointers.splice(l,1),this._excludeFromButtonsCheck.delete(o.id);const d=!(c.type==="mouseup"||c.type==="touchend"||c.type==="pointerup");return this._endCallback(o,c,d),!0},this._pointerEnd=o=>{if(this._triggerPointerEnd(new B(o),o))if(le(o)){if(this.currentPointers.length)return;this._element.removeEventListener(this._rawUpdates?"pointerrawupdate":"pointermove",this._move),this._element.removeEventListener("pointerup",this._pointerEnd),this._element.removeEventListener("pointercancel",this._pointerEnd)}else window.removeEventListener("mousemove",this._move),window.removeEventListener("mouseup",this._pointerEnd)},this._touchEnd=o=>{for(const c of Array.from(o.changedTouches))this._triggerPointerEnd(new B(c),o)},this._startCallback=n,this._moveCallback=r,this._endCallback=i,this._rawUpdates=a&&"onpointerrawupdate"in window,self.PointerEvent&&!s?this._element.addEventListener("pointerdown",this._pointerStart):(this._element.addEventListener("mousedown",this._pointerStart),this._element.addEventListener("touchstart",this._touchStart),this._element.addEventListener("touchmove",this._move),this._element.addEventListener("touchend",this._touchEnd),this._element.addEventListener("touchcancel",this._touchEnd))}stop(){this._element.removeEventListener("pointerdown",this._pointerStart),this._element.removeEventListener("mousedown",this._pointerStart),this._element.removeEventListener("touchstart",this._touchStart),this._element.removeEventListener("touchmove",this._move),this._element.removeEventListener("touchend",this._touchEnd),this._element.removeEventListener("touchcancel",this._touchEnd),this._element.removeEventListener(this._rawUpdates?"pointerrawupdate":"pointermove",this._move),this._element.removeEventListener("pointerup",this._pointerEnd),this._element.removeEventListener("pointercancel",this._pointerEnd),window.removeEventListener("mousemove",this._move),window.removeEventListener("mouseup",this._pointerEnd)}_triggerPointerStart(t,n){return this._startCallback(t,n)?(this.currentPointers.push(t),this.startPointers.push(t),!0):!1}}function or(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var ar=`pinch-zoom { + `.replace(/[\r\n]/g,"").replace(/\s+/g," ").trim(),Dt=()=>{let e="";for(const[t,n]of Object.entries(Ut)){const r=v[t];n.initial!==Number(r.value)&&(e+=`${t}(${r.value}${r.dataset.unit}) `)}return e},xn=()=>{let e=`${R.checked?`url('${Sn()}#posterize') `:""}`;return e+=Dt(),e.trim()||"none"};function Pn(){return new Worker("/assets/monochromeworker-f4bfce91.js")}let q=null;const Cn=async e=>(q&&q.terminate(),q=new Pn,new Promise(async t=>{const n=new MessageChannel;n.port1.onmessage=({data:i})=>{n.port1.close(),q&&(q.terminate(),q=null),t(i.result)};const r={turdsize:Number(v[L.turdsize].value),alphamax:Number(v[L.alphamax].value),turnpolicy:Number(v[L.turnpolicy].value),opttolerance:Number(v[L.opttolerance].value),opticurve:O.checked?1:0,extractcolors:!1};q.postMessage({imageData:e,params:r},[n.port2])}));function On(){return new Worker("/assets/colorworker-9f272d25.js")}let W=null;const M={},Tn=async e=>(W&&W.terminate(),W=new On,new Promise(async t=>{const n=new MessageChannel;n.port1.onmessage=({data:l})=>{n.port1.close(),W&&(W.terminate(),W=null),t(l.result)},Oe.value=0;let r="",i="",a="",s=0;M.current&&(clearInterval(M.current),M.current=null),M.current=setInterval(()=>{const l=`${r}${a}${i}`;if(l.length!==s){const d=w.dataset.transform;d&&w.setAttribute("transform",d),w.innerHTML=l,s=l.length}},500);const o=new MessageChannel;o.port1.onmessage=({data:l})=>{const d=Math.floor(l.processed/l.total*100);if(Oe.value=d,l.svg){r||(r=l.svg.replace(/(.*?]+>)(.*?)(<\/svg>)/,"$1").replace(/\s+width="\d+(?:\.\d+)?"/,"").replace(/\s+height="\d+(?:\.\d+)"/,""),i=l.svg.replace(/(.*?]+>)(.*?)(<\/svg>)/,"$3"));const u=l.svg.replace(/(.*?]+>)(.*?)(<\/svg>)/,"$2");a+=u}l.processed===l.total&&(clearInterval(M.current),M.current=null,o.port1.close(),Oe.value=0)};const c={minPathSegments:Number(v[L.minPathLength].value),strokeWidth:Number(v[L.strokeWidth].value),turdsize:Number(v[L.turdsize].value),alphamax:Number(v[L.alphamax].value),turnpolicy:Number(v[L.turnpolicy].value),opttolerance:Number(v[L.opttolerance].value),opticurve:O.checked?1:0,extractcolors:!1,posterizelevel:2,posterizationalgorithm:0};W.postMessage({imageData:e,params:c},[n.port2,o.port2])})),yt=(e,t)=>{const n=e[t];return n?typeof n=="function"?n():Promise.resolve(n):new Promise((r,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+t)))})},we="language",Rn=["ar","be","ca","da","de","el","en","es","fr","he","id","it","ja","ko","nl","no","pl","pt","ru","uk","zh"],An=["ar-TN","be-BY","ca-ES","da-DK","de-DE","el-GR","en-GB","en-US","es-ES","fr-FR","he-IL","id-ID","it-IT","ja-JP","ko-KR","nl-NL","no-NO","pl-PL","pt-BR","ru-RU","uk-UA","zh-CN"],In=["ar","fa","he","ur"];class Mn{constructor(){this.defaultLanguage="en",this.defaultLocale="US",this.translations=null,this.supportedLanguages=Rn,this.supportedLocales=An,this.currentLanguageAndLocale=this.detectOrRestoreLanguageAndLocale()}findBestMatchingLanguageAndLocale(t,n){return n&&(n=n.toUpperCase()),!t||!this.supportedLanguages.includes(t)?(t=this.defaultLanguage,n=this.defaultLocale):(!n||!this.supportedLocales.includes(`${t}-${n}`))&&(n=this.supportedLocales.find(r=>r.startsWith(`${t}-`)).split("-")[1]),{language:t,locale:n}}detectOrRestoreLanguageAndLocale(){const t=new URL(location),n=t.searchParams,r=n.get("lang");if(r){n.delete("lang"),history.pushState({},"",t);const[c,l=""]=r.split("-"),{language:d,locale:u}=this.findBestMatchingLanguageAndLocale(c,l);return this.setLanguageAndLocale(d,u),{language:d,locale:u}}try{const c=localStorage.getItem(we);if(c){const{language:l,locale:d}=JSON.parse(c);return this.setLanguageAndLocale(l,d),{language:l,locale:d}}}catch{}const[i,a=""]=navigator.language?.split("-"),{language:s,locale:o}=this.findBestMatchingLanguageAndLocale(i,a);return this.setLanguageAndLocale(s,o),{language:s,locale:o}}async setLanguageAndLocale(t,n){try{this.supportedLanguages.includes(t)||(localStorage.removeItem(we),t=this.defaultLanguage,n=this.defaultLocale),n&&!this.supportedLocales.includes(`${t}-${n}`)&&(localStorage.removeItem(we),t=this.defaultLanguage,n=this.defaultLocale),this.currentLanguageAndLocale={language:t,locale:n},localStorage.setItem(we,JSON.stringify(this.currentLanguageAndLocale))}catch{}T.lang=`${t}${n?`-${n}`:""}`,In.includes(t)?T.dir="rtl":T.dir="ltr",await this.getTranslations()}async getTranslations(){const{language:t,locale:n}=this.currentLanguageAndLocale;this.translations=(await yt(Object.assign({"../i18n/ar-TN.js":()=>p(()=>import("./ar-TN-917a8102.js"),["assets/ar-TN-917a8102.js","assets/languages-e8d9835d.js"]),"../i18n/be-BY.js":()=>p(()=>import("./be-BY-e27002d9.js"),["assets/be-BY-e27002d9.js","assets/languages-e8d9835d.js"]),"../i18n/ca-ES.js":()=>p(()=>import("./ca-ES-450231bf.js"),["assets/ca-ES-450231bf.js","assets/languages-e8d9835d.js"]),"../i18n/da-DK.js":()=>p(()=>import("./da-DK-fecf3d76.js"),["assets/da-DK-fecf3d76.js","assets/languages-e8d9835d.js"]),"../i18n/de-DE.js":()=>p(()=>import("./de-DE-c44b440e.js"),["assets/de-DE-c44b440e.js","assets/languages-e8d9835d.js"]),"../i18n/el-GR.js":()=>p(()=>import("./el-GR-cf1cb156.js"),["assets/el-GR-cf1cb156.js","assets/languages-e8d9835d.js"]),"../i18n/en-GB.js":()=>p(()=>import("./en-GB-1ebb0134.js"),["assets/en-GB-1ebb0134.js","assets/languages-e8d9835d.js"]),"../i18n/en-US.js":()=>p(()=>import("./en-US-14af226a.js"),["assets/en-US-14af226a.js","assets/languages-e8d9835d.js"]),"../i18n/es-ES.js":()=>p(()=>import("./es-ES-8cdc11e3.js"),["assets/es-ES-8cdc11e3.js","assets/languages-e8d9835d.js"]),"../i18n/fr-FR.js":()=>p(()=>import("./fr-FR-dff4346a.js"),["assets/fr-FR-dff4346a.js","assets/languages-e8d9835d.js"]),"../i18n/he-IL.js":()=>p(()=>import("./he-IL-3b82a749.js"),["assets/he-IL-3b82a749.js","assets/languages-e8d9835d.js"]),"../i18n/id-ID.js":()=>p(()=>import("./id-ID-d5dc62f7.js"),["assets/id-ID-d5dc62f7.js","assets/languages-e8d9835d.js"]),"../i18n/it-IT.js":()=>p(()=>import("./it-IT-24240090.js"),["assets/it-IT-24240090.js","assets/languages-e8d9835d.js"]),"../i18n/ja-JP.js":()=>p(()=>import("./ja-JP-6b72f65f.js"),["assets/ja-JP-6b72f65f.js","assets/languages-e8d9835d.js"]),"../i18n/ko-KR.js":()=>p(()=>import("./ko-KR-9fdbc612.js"),["assets/ko-KR-9fdbc612.js","assets/languages-e8d9835d.js"]),"../i18n/languages.js":()=>p(()=>import("./languages-e8d9835d.js"),[]),"../i18n/nl-NL.js":()=>p(()=>import("./nl-NL-f6a4c727.js"),["assets/nl-NL-f6a4c727.js","assets/languages-e8d9835d.js"]),"../i18n/no-NO.js":()=>p(()=>import("./no-NO-cb14a155.js"),["assets/no-NO-cb14a155.js","assets/languages-e8d9835d.js"]),"../i18n/pl-PL.js":()=>p(()=>import("./pl-PL-9ac090e3.js"),["assets/pl-PL-9ac090e3.js","assets/languages-e8d9835d.js"]),"../i18n/pt-BR.js":()=>p(()=>import("./pt-BR-30fb79a1.js"),["assets/pt-BR-30fb79a1.js","assets/languages-e8d9835d.js"]),"../i18n/ru-RU.js":()=>p(()=>import("./ru-RU-e5f207da.js"),["assets/ru-RU-e5f207da.js","assets/languages-e8d9835d.js"]),"../i18n/uk-UA.js":()=>p(()=>import("./uk-UA-87a01182.js"),["assets/uk-UA-87a01182.js","assets/languages-e8d9835d.js"]),"../i18n/zh-CN.js":()=>p(()=>import("./zh-CN-148f9e59.js"),["assets/zh-CN-148f9e59.js","assets/languages-e8d9835d.js"])}),`../i18n/${t}${n?`-${n}`:""}.js`).catch(()=>yt(Object.assign({"../i18n/ar-TN.js":()=>p(()=>import("./ar-TN-917a8102.js"),["assets/ar-TN-917a8102.js","assets/languages-e8d9835d.js"]),"../i18n/be-BY.js":()=>p(()=>import("./be-BY-e27002d9.js"),["assets/be-BY-e27002d9.js","assets/languages-e8d9835d.js"]),"../i18n/ca-ES.js":()=>p(()=>import("./ca-ES-450231bf.js"),["assets/ca-ES-450231bf.js","assets/languages-e8d9835d.js"]),"../i18n/da-DK.js":()=>p(()=>import("./da-DK-fecf3d76.js"),["assets/da-DK-fecf3d76.js","assets/languages-e8d9835d.js"]),"../i18n/de-DE.js":()=>p(()=>import("./de-DE-c44b440e.js"),["assets/de-DE-c44b440e.js","assets/languages-e8d9835d.js"]),"../i18n/el-GR.js":()=>p(()=>import("./el-GR-cf1cb156.js"),["assets/el-GR-cf1cb156.js","assets/languages-e8d9835d.js"]),"../i18n/en-GB.js":()=>p(()=>import("./en-GB-1ebb0134.js"),["assets/en-GB-1ebb0134.js","assets/languages-e8d9835d.js"]),"../i18n/en-US.js":()=>p(()=>import("./en-US-14af226a.js"),["assets/en-US-14af226a.js","assets/languages-e8d9835d.js"]),"../i18n/es-ES.js":()=>p(()=>import("./es-ES-8cdc11e3.js"),["assets/es-ES-8cdc11e3.js","assets/languages-e8d9835d.js"]),"../i18n/fr-FR.js":()=>p(()=>import("./fr-FR-dff4346a.js"),["assets/fr-FR-dff4346a.js","assets/languages-e8d9835d.js"]),"../i18n/he-IL.js":()=>p(()=>import("./he-IL-3b82a749.js"),["assets/he-IL-3b82a749.js","assets/languages-e8d9835d.js"]),"../i18n/id-ID.js":()=>p(()=>import("./id-ID-d5dc62f7.js"),["assets/id-ID-d5dc62f7.js","assets/languages-e8d9835d.js"]),"../i18n/it-IT.js":()=>p(()=>import("./it-IT-24240090.js"),["assets/it-IT-24240090.js","assets/languages-e8d9835d.js"]),"../i18n/ja-JP.js":()=>p(()=>import("./ja-JP-6b72f65f.js"),["assets/ja-JP-6b72f65f.js","assets/languages-e8d9835d.js"]),"../i18n/ko-KR.js":()=>p(()=>import("./ko-KR-9fdbc612.js"),["assets/ko-KR-9fdbc612.js","assets/languages-e8d9835d.js"]),"../i18n/languages.js":()=>p(()=>import("./languages-e8d9835d.js"),[]),"../i18n/nl-NL.js":()=>p(()=>import("./nl-NL-f6a4c727.js"),["assets/nl-NL-f6a4c727.js","assets/languages-e8d9835d.js"]),"../i18n/no-NO.js":()=>p(()=>import("./no-NO-cb14a155.js"),["assets/no-NO-cb14a155.js","assets/languages-e8d9835d.js"]),"../i18n/pl-PL.js":()=>p(()=>import("./pl-PL-9ac090e3.js"),["assets/pl-PL-9ac090e3.js","assets/languages-e8d9835d.js"]),"../i18n/pt-BR.js":()=>p(()=>import("./pt-BR-30fb79a1.js"),["assets/pt-BR-30fb79a1.js","assets/languages-e8d9835d.js"]),"../i18n/ru-RU.js":()=>p(()=>import("./ru-RU-e5f207da.js"),["assets/ru-RU-e5f207da.js","assets/languages-e8d9835d.js"]),"../i18n/uk-UA.js":()=>p(()=>import("./uk-UA-87a01182.js"),["assets/uk-UA-87a01182.js","assets/languages-e8d9835d.js"]),"../i18n/zh-CN.js":()=>p(()=>import("./zh-CN-148f9e59.js"),["assets/zh-CN-148f9e59.js","assets/languages-e8d9835d.js"])}),`../i18n/${this.defaultLocale}.js`))).default}t(t){return this.translations[t]||"⛔️ Missing translation"}}const m=new Mn,$n='',Vn=e=>{if(e===0)return"0B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(2)*1} ${["B","KB","MB"][t]}`},wt=(e,t)=>{e&&(e=e.replace(/\s+width="\d+(?:\.\d+)?"/,"").replace(/\s+height="\d+(?:\.\d+)"/,""),w.classList.remove(Me),w.classList.remove($e),w.classList.add(t),w.innerHTML=e,P(`${m.t("svgSize")}: ${Vn(e.length)}`,3e3))},A=async()=>{w.innerHTML="",w.classList.remove(Me,$e),M.current&&(clearInterval(M.current),M.current=null);const e=w.getAttribute("transform");w.innerHTML=$n,e&&(w.dataset.transform=e,w.setAttribute("transform",""));const t=zt?await Vt():jt();if(_.checked){const n=await Tn(t);e&&w.setAttribute("transform",e),wt(n,Me)}else{const n=await Cn(t);e&&w.setAttribute("transform",e),wt(n,$e)}},ge=(()=>{if(typeof self>"u")return!1;if("top"in self&&self!==top)try{}catch{return!1}return"showOpenFilePicker"in self})(),jn=ge?Promise.resolve().then(function(){return Un}):Promise.resolve().then(function(){return Xn});async function zn(...e){return(await jn).default(...e)}ge?Promise.resolve().then(function(){return Wn}):Promise.resolve().then(function(){return Jn});const Dn=ge?Promise.resolve().then(function(){return Gn}):Promise.resolve().then(function(){return Qn});async function Hn(...e){return(await Dn).default(...e)}const Bn=async e=>{const t=await e.getFile();return t.handle=e,t};var Nn=async(e=[{}])=>{Array.isArray(e)||(e=[e]);const t=[];e.forEach((i,a)=>{t[a]={description:i.description||"Files",accept:{}},i.mimeTypes?i.mimeTypes.map(s=>{t[a].accept[s]=i.extensions||[]}):t[a].accept["*/*"]=i.extensions||[]});const n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(Bn));return e[0].multiple?r:r[0]},Un={__proto__:null,default:Nn};function Re(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(i){return{value:i,done:r}})}return Re=function(n){this.s=n,this.n=n.next},Re.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(n){var r=this.s.return;return r===void 0?Promise.resolve({value:n,done:!0}):t(r.apply(this.s,arguments))},throw:function(n){var r=this.s.return;return r===void 0?Promise.reject(n):t(r.apply(this.s,arguments))}},new Re(e)}const Ht=async(e,t,n=e.name,r)=>{const i=[],a=[];var s,o=!1,c=!1;try{for(var l,d=function(u){var h,f,E,V=2;for(typeof Symbol<"u"&&(f=Symbol.asyncIterator,E=Symbol.iterator);V--;){if(f&&(h=u[f])!=null)return h.call(u);if(E&&(h=u[E])!=null)return new Re(h.call(u));f="@@asyncIterator",E="@@iterator"}throw new TypeError("Object is not async iterable")}(e.values());o=!(l=await d.next()).done;o=!1){const u=l.value,h=`${n}/${u.name}`;u.kind==="file"?a.push(u.getFile().then(f=>(f.directoryHandle=e,f.handle=u,Object.defineProperty(f,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>h})))):u.kind!=="directory"||!t||r&&r(u)||i.push(Ht(u,t,h,r))}}catch(u){c=!0,s=u}finally{try{o&&d.return!=null&&await d.return()}finally{if(c)throw s}}return[...(await Promise.all(i)).flat(),...await Promise.all(a)]};var qn=async(e={})=>{e.recursive=e.recursive||!1,e.mode=e.mode||"read";const t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode});return(await(await t.values()).next()).done?[t]:Ht(t,e.recursive,void 0,e.skipDirectory)},Wn={__proto__:null,default:qn},Fn=async(e,t=[{}],n=null,r=!1,i=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const a=[];let s=null;if(e instanceof Blob&&e.type?s=e.type:e.headers&&e.headers.get("content-type")&&(s=e.headers.get("content-type")),t.forEach((l,d)=>{a[d]={description:l.description||"Files",accept:{}},l.mimeTypes?(d===0&&s&&l.mimeTypes.push(s),l.mimeTypes.map(u=>{a[d].accept[u]=l.extensions||[]})):s?a[d].accept[s]=l.extensions||[]:a[d].accept["*/*"]=l.extensions||[]}),n)try{await n.getFile()}catch(l){if(n=null,r)throw l}const o=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:a,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&i&&i(o);const c=await o.createWritable();return"stream"in e?(await e.stream().pipeTo(c),o):"body"in e?(await e.body.pipeTo(c),o):(await c.write(await e),await c.close(),o)},Gn={__proto__:null,default:Fn},Yn=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,n)=>{const r=document.createElement("input");r.type="file";const i=[...e.map(c=>c.mimeTypes||[]),...e.map(c=>c.extensions||[])].join();r.multiple=e[0].multiple||!1,r.accept=i||"",r.style.display="none",document.body.append(r);const a=c=>{typeof s=="function"&&s(),t(c)},s=e[0].legacySetup&&e[0].legacySetup(a,()=>s(n),r),o=()=>{window.removeEventListener("focus",o),r.remove()};r.addEventListener("click",()=>{window.addEventListener("focus",o)}),r.addEventListener("change",()=>{window.removeEventListener("focus",o),r.remove(),a(r.multiple?Array.from(r.files):r.files[0])}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Xn={__proto__:null,default:Yn},Kn=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,n)=>{const r=document.createElement("input");r.type="file",r.webkitdirectory=!0;const i=s=>{typeof a=="function"&&a(),t(s)},a=e[0].legacySetup&&e[0].legacySetup(i,()=>a(n),r);r.addEventListener("change",()=>{let s=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(s=s.filter(o=>o.webkitRelativePath.split("/").every(c=>!e[0].skipDirectory({name:c,kind:"directory"})))):s=s.filter(o=>o.webkitRelativePath.split("/").length===2),i(s)}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Jn={__proto__:null,default:Kn},Zn=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);const n=document.createElement("a");let r=e;"body"in e&&(r=await async function(s,o){const c=s.getReader(),l=new ReadableStream({start:h=>async function f(){return c.read().then(({done:E,value:V})=>{if(!E)return h.enqueue(V),f();h.close()})}()}),d=new Response(l),u=await d.blob();return c.releaseLock(),new Blob([u],{type:o})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(await r);const i=()=>{typeof a=="function"&&a()},a=t.legacySetup&&t.legacySetup(i,()=>a(),n);return n.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(n.href),3e4),i()}),n.click(),null},Qn={__proto__:null,default:Zn};function er(){return new Worker("/assets/svgoworker-7ff1a964.js")}let F=null;const Ae=async e=>(F&&F.terminate(),F=new er,new Promise(t=>{const n=new MessageChannel;n.port1.onmessage=({data:r})=>{n.port1.close(),F&&(F.terminate(),F=null),t(r.result)},F.postMessage({svg:e},[n.port2])}));function ze(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function tr(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=ze(n);return(i,a)=>r.then(s=>a(s.transaction(t,i).objectStore(t)))}let We;function st(){return We||(We=tr("keyval-store","keyval")),We}function re(e,t=st()){return t("readonly",n=>ze(n.get(e)))}function U(e,t,n=st()){return n("readwrite",r=>(r.put(t,e),ze(r.transaction)))}function nr(e,t=st()){return t("readwrite",n=>(n.delete(e),ze(n.transaction)))}const me="fileHandle",rr=e=>e?e.name.replace(/\.[^\.]+$/,""):"";Ee.addEventListener("click",async()=>{try{const e=await zn({mimeTypes:["image/*"],description:"Image files"}),t=URL.createObjectURL(e);y.addEventListener("load",()=>{URL.revokeObjectURL(t)},{once:!0}),y.src=t,ge&&await U(me,e.handle)}catch(e){console.error(e.name,e.message),P(e.message)}});document.addEventListener("dragover",e=>{e.preventDefault()});document.addEventListener("dragenter",e=>{e.preventDefault(),T.classList.add("dropenter")});document.addEventListener("dragleave",e=>{e.preventDefault(),e.target===T&&T.classList.remove("dropenter")});document.addEventListener("drop",async e=>{e.preventDefault(),e.stopPropagation(),T.classList.remove("dropenter");const t=e.dataTransfer.items[0];if(t.kind==="file"){let n;if(y.addEventListener("load",()=>{URL.revokeObjectURL(n)},{once:!0}),ge){const i=await t.getAsFileSystemHandle();if(i.kind!=="file")return;const a=await i.getFile();n=URL.createObjectURL(a),y.src=n,await U(me,i);return}const r=t.getAsFile();n=URL.createObjectURL(r),y.src=n}});ke.addEventListener("click",async()=>{const e=async()=>{P(m.t("optimizingSVG"),1/0);const t=await Ae(w.innerHTML);return Tr(),new Blob([t],{type:"image/svg+xml"})};try{let t=!1;try{t=await re(me)}catch{}const n=rr(t);await Hn(e(),{fileName:n,description:"SVG file",extensions:[".svg"],mimeTypes:["image/svg+xml"]}),P(m.t("savedSVG"))}catch(t){console.error(t.name,t.message),P(t.message)}});Pe.addEventListener("click",async()=>{try{const e=await navigator.clipboard.read();for(const t of e)for(const n of t.types)if(n.startsWith("image/")){const r=await t.getType(n);if(!r)return;const i=URL.createObjectURL(r);y.src=i;return}}catch(e){console.error(e.name,e.message),P(e.message)}});document.addEventListener("paste",e=>{try{if(!e.clipboardData.files.length)return;const t=e.clipboardData.files[0];if(t.type.startsWith("image/")){const n=URL.createObjectURL(t);y.src=n;return}}catch(t){console.error(t.name,t.message),P(t.message)}});Se.addEventListener("click",async()=>{let e=w.innerHTML;P(m.t("optimizingSVG"),1/0);try{"ClipboardItem"in window?Mt?await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"})})]):(e=await Ae(e),await navigator.clipboard.write([new ClipboardItem({"text/plain":new Promise(async t=>{t(new Blob([e],{type:"text/plain"}))}),"image/svg+xml":new Promise(async t=>{t(new Blob([e],{type:"image/svg+xml"}))})})])):await navigator.clipboard.writeText(await Ae(e))}catch{e=await Ae(e);const n=new Blob([e],{type:"text/plain"}),r=new Blob([e],{type:"image/svg+xml"});try{Number(navigator.userAgent.replace(/.*Chrome\/(\d+).*/,"$1"))<=88?await navigator.clipboard.write([new ClipboardItem({[n.type]:n})]):await navigator.clipboard.write([new ClipboardItem({[r.type]:r,[n.type]:n})])}catch{try{await navigator.clipboard.write([new ClipboardItem({[n.type]:n})])}catch(a){P(a.message);return}}}P(m.t("copiedSVG"))});class B{constructor(t){this.id=-1,this.nativePointer=t,this.pageX=t.pageX,this.pageY=t.pageY,this.clientX=t.clientX,this.clientY=t.clientY,self.Touch&&t instanceof Touch?this.id=t.identifier:le(t)&&(this.id=t.pointerId)}getCoalesced(){if("getCoalescedEvents"in this.nativePointer){const t=this.nativePointer.getCoalescedEvents().map(n=>new B(n));if(t.length>0)return t}return[this]}}const le=e=>"pointerId"in e,Fe=e=>"changedTouches"in e,bt=()=>{};class ir{constructor(t,{start:n=()=>!0,move:r=bt,end:i=bt,rawUpdates:a=!1,avoidPointerEvents:s=!1}={}){this._element=t,this.startPointers=[],this.currentPointers=[],this._excludeFromButtonsCheck=new Set,this._pointerStart=o=>{if(le(o)&&o.buttons===0)this._excludeFromButtonsCheck.add(o.pointerId);else if(!(o.buttons&1))return;const c=new B(o);this.currentPointers.some(l=>l.id===c.id)||this._triggerPointerStart(c,o)&&(le(o)?((o.target&&"setPointerCapture"in o.target?o.target:this._element).setPointerCapture(o.pointerId),this._element.addEventListener(this._rawUpdates?"pointerrawupdate":"pointermove",this._move),this._element.addEventListener("pointerup",this._pointerEnd),this._element.addEventListener("pointercancel",this._pointerEnd)):(window.addEventListener("mousemove",this._move),window.addEventListener("mouseup",this._pointerEnd)))},this._touchStart=o=>{for(const c of Array.from(o.changedTouches))this._triggerPointerStart(new B(c),o)},this._move=o=>{if(!Fe(o)&&(!le(o)||!this._excludeFromButtonsCheck.has(o.pointerId))&&o.buttons===0){this._pointerEnd(o);return}const c=this.currentPointers.slice(),l=Fe(o)?Array.from(o.changedTouches).map(u=>new B(u)):[new B(o)],d=[];for(const u of l){const h=this.currentPointers.findIndex(f=>f.id===u.id);h!==-1&&(d.push(u),this.currentPointers[h]=u)}d.length!==0&&this._moveCallback(c,d,o)},this._triggerPointerEnd=(o,c)=>{if(!Fe(c)&&c.buttons&1)return!1;const l=this.currentPointers.findIndex(u=>u.id===o.id);if(l===-1)return!1;this.currentPointers.splice(l,1),this.startPointers.splice(l,1),this._excludeFromButtonsCheck.delete(o.id);const d=!(c.type==="mouseup"||c.type==="touchend"||c.type==="pointerup");return this._endCallback(o,c,d),!0},this._pointerEnd=o=>{if(this._triggerPointerEnd(new B(o),o))if(le(o)){if(this.currentPointers.length)return;this._element.removeEventListener(this._rawUpdates?"pointerrawupdate":"pointermove",this._move),this._element.removeEventListener("pointerup",this._pointerEnd),this._element.removeEventListener("pointercancel",this._pointerEnd)}else window.removeEventListener("mousemove",this._move),window.removeEventListener("mouseup",this._pointerEnd)},this._touchEnd=o=>{for(const c of Array.from(o.changedTouches))this._triggerPointerEnd(new B(c),o)},this._startCallback=n,this._moveCallback=r,this._endCallback=i,this._rawUpdates=a&&"onpointerrawupdate"in window,self.PointerEvent&&!s?this._element.addEventListener("pointerdown",this._pointerStart):(this._element.addEventListener("mousedown",this._pointerStart),this._element.addEventListener("touchstart",this._touchStart),this._element.addEventListener("touchmove",this._move),this._element.addEventListener("touchend",this._touchEnd),this._element.addEventListener("touchcancel",this._touchEnd))}stop(){this._element.removeEventListener("pointerdown",this._pointerStart),this._element.removeEventListener("mousedown",this._pointerStart),this._element.removeEventListener("touchstart",this._touchStart),this._element.removeEventListener("touchmove",this._move),this._element.removeEventListener("touchend",this._touchEnd),this._element.removeEventListener("touchcancel",this._touchEnd),this._element.removeEventListener(this._rawUpdates?"pointerrawupdate":"pointermove",this._move),this._element.removeEventListener("pointerup",this._pointerEnd),this._element.removeEventListener("pointercancel",this._pointerEnd),window.removeEventListener("mousemove",this._move),window.removeEventListener("mouseup",this._pointerEnd)}_triggerPointerStart(t,n){return this._startCallback(t,n)?(this.currentPointers.push(t),this.startPointers.push(t),!0):!1}}function or(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var ar=`pinch-zoom { display: block; overflow: hidden; touch-action: none; @@ -38,4 +38,4 @@ pinch-zoom > * { will-change: transform; } `;or(ar);const be="min-scale";function _t(e,t){return t?Math.sqrt((t.clientX-e.clientX)**2+(t.clientY-e.clientY)**2):0}function Lt(e,t){return t?{clientX:(e.clientX+t.clientX)/2,clientY:(e.clientY+t.clientY)/2}:e}function Et(e,t){return typeof e=="number"?e:e.trimRight().endsWith("%")?t*parseFloat(e)/100:parseFloat(e)}let kt;function Bt(){return kt||(kt=document.createElementNS("http://www.w3.org/2000/svg","svg"))}function Ge(){return Bt().createSVGMatrix()}function St(){return Bt().createSVGPoint()}const Ye=.01;class sr extends HTMLElement{constructor(){super(),this._transform=Ge(),new MutationObserver(()=>this._stageElChange()).observe(this,{childList:!0});const t=new ir(this,{start:(n,r)=>t.currentPointers.length===2||!this._positioningEl?!1:(r.preventDefault(),!0),move:n=>{this._onPointerMove(n,t.currentPointers)}});this.addEventListener("wheel",n=>this._onWheel(n))}static get observedAttributes(){return[be]}attributeChangedCallback(t,n,r){t===be&&this.scales.width?i+=s.width-c.x:l.x<0&&(i+=-l.x),c.y>s.height?a+=s.height-c.y:l.y<0&&(a+=-l.y),this._updateTransform(n,i,a,r)}_updateTransform(t,n,r,i){if(!(t1&&console.warn(" must not have more than one child."),this.setTransform({allowChangeEvent:!0}))}_onWheel(t){if(!this._positioningEl)return;t.preventDefault();const n=this._positioningEl.getBoundingClientRect();let{deltaY:r}=t;const{ctrlKey:i,deltaMode:a}=t;a===1&&(r*=15);const o=1-r/(i?100:300);this._applyChange({scaleDiff:o,originX:t.clientX-n.left,originY:t.clientY-n.top,allowChangeEvent:!0})}_onPointerMove(t,n){if(!this._positioningEl)return;const r=this._positioningEl.getBoundingClientRect(),i=Lt(t[0],t[1]),a=Lt(n[0],n[1]),s=i.clientX-r.left,o=i.clientY-r.top,c=_t(t[0],t[1]),l=_t(n[0],n[1]),d=c?l/c:1;this._applyChange({originX:s,originY:o,scaleDiff:d,panX:a.clientX-i.clientX,panY:a.clientY-i.clientY,allowChangeEvent:!0})}_applyChange(t={}){const{panX:n=0,panY:r=0,originX:i=0,originY:a=0,scaleDiff:s=1,allowChangeEvent:o=!1}=t,c=Ge().translate(n,r).translate(i,a).translate(this.x,this.y).scale(s).translate(-i,-a).scale(this.scale);this.setTransform({allowChangeEvent:o,scale:c.a,x:c.e,y:c.f})}}customElements.define("pinch-zoom",sr);const cr='',lr='',dr='',ur='',hr='',pr='',mr='',fr='',gr='',vr='',yr='',wr='',ct="monochromeSettings",lt="colorSettings",Me="color",$e="monochrome",D="%",Nt="deg",de="steps",xt="pixels",ot="",br="segments",j={brightness:"brightness",contrast:"contrast",grayscale:"grayscale",hueRotate:"hue-rotate",invert:"invert",opacity:"opacity",saturate:"saturate",sepia:"sepia"},S={red:"red",green:"green",blue:"blue",alpha:"alpha"},fe={scale:"scale",rotation:"rotation"},L={minPathLength:"minPathSegments",strokeWidth:"strokeWidth",turdsize:"turdsize",alphamax:"alphamax",turnpolicy:"turnpolicy",opticurve:"opticurve",opttolerance:"opttolerance"},Ut={[j.brightness]:{unit:D,initial:100,min:0,max:200},[j.contrast]:{unit:D,initial:100,min:0,max:200},[j.grayscale]:{unit:D,initial:0,min:0,max:100},[j.hueRotate]:{unit:Nt,initial:0,min:0,max:360},[j.invert]:{unit:D,initial:0,min:0,max:100},[j.opacity]:{unit:D,initial:100,min:0,max:100},[j.saturate]:{unit:D,initial:100,min:0,max:200},[j.sepia]:{unit:D,initial:0,min:0,max:100}},_r={[S.red]:{unit:de,initial:5,min:1,max:20},[S.green]:{unit:de,initial:5,min:1,max:20},[S.blue]:{unit:de,initial:5,min:1,max:20},[S.alpha]:{unit:de,initial:1,min:1,max:10}},Lr={[fe.scale]:{unit:D,initial:100,min:1,max:200},[fe.rotation]:{unit:Nt,initial:0,min:0,max:360}},Er={[L.turdsize]:{unit:xt,initial:2,min:0,max:50},[L.strokeWidth]:{unit:xt,initial:0,min:0,max:100},[L.minPathLength]:{unit:br,initial:0,min:0,max:30},[L.alphamax]:{unit:ot,initial:1,min:0,max:1.3334},[L.turnpolicy]:{unit:de,initial:4,min:0,max:6},[L.opttolerance]:{unit:ot,initial:.2,min:0,max:1}},kr=[{name:"svgOptions",icon:ur},{name:"colorChannels",icon:cr},{name:"imageSizeAndRotation",icon:lr},{name:"imagePreprocessing",icon:dr}],dt=[Object.entries(Er),Object.entries(_r),Object.entries(Lr),Object.entries(Ut)],v={},Ve={},I={},ie=(e,t)=>{const n=m.t(e);return` (${e?`${t}${n.length===1?n:` ${n}`}`:t})`},H=e=>{const t=document.createElement("span");return t.classList.add("icon"),t.innerHTML=e,t},Sr=(e,t)=>{const n=document.createElement("details");I[e]=n;const r=document.createElement("summary"),i=H(t);r.append(i);const a=document.createElement("span");return a.textContent=m.t(e),a.dataset.i18nKey=e,r.append(a),n.append(r),n},xr=["alphamax","turnpolicy","optimize-curves","opttolerance","minPathSegments"],Pr=async(e,t,n)=>{const{unit:r,min:i,max:a,initial:s}=t,o=document.createElement("div");o.classList.add("preprocess-input"),xr.includes(e)&&o.classList.add("advanced");const c=document.createElement("label"),l=document.createElement("span");l.textContent=m.t(e),l.dataset.i18nKey=e,c.append(l),c.htmlFor=e;const d=await De(),u=document.createElement("span");Ve[e]=u,u.textContent=ie(r,d[e]||s),u.dataset.dynamicI18nKey=r,u.dataset.dynamicValue=d[e]||s;const h=document.createElement("input");v[e]=h,h.id=e,h.type="range",h.class=e,r&&(h.dataset.unit=r),r===ot&&(h.step=.01),h.min=i,h.max=a,h.value=d[e]||s,h.addEventListener("input",()=>{u.textContent=ie(r,h.value),u.dataset.dynamicValue=h.value}),Object.keys(S).includes(e)?h.addEventListener("change",Te(async()=>{await Y(h),await A()},250)):Object.keys(L).includes(e)?h.addEventListener("change",Te(async()=>{await Y(h),await A()},250)):h.addEventListener("change",Te(async()=>{await Y(h),await A()},250));const f=document.createElement("button");f.type="button",f.textContent=m.t("reset"),f.dataset.i18nKey="reset",f.addEventListener("click",async()=>{h.value=s,u.textContent=ie(r,s),u.dataset.dynamicValue=s,h.dispatchEvent(new Event("change"))}),c.append(u),o.append(c);const E=document.createElement("div");o.append(E),E.append(h),E.append(f),n.append(o)},qt=()=>{const e=!R.checked;Object.keys(S).forEach(t=>{v[t].disabled=e})};R.addEventListener("change",async()=>{qt(),await Y(R),await A()});const ut=async()=>{const e=await De();R.checked=e[R.id]??R.defaultChecked,qt(),$.checked=e[$.id]??$.defaultChecked,O.checked=e[O.id]??O.defaultChecked,Wt(),G.checked=e[G.id]??G.defaultChecked,Gt(),dt.forEach(t=>{for(const[n,r]of t){const i=e[v[n].id]||r.initial;v[n].value=i,Ve[n].textContent=ie(r.unit,i)}})};_.addEventListener("change",async()=>{await U(_.id,_.checked),await U(C.id,C.checked),await ut(),await A()});C.addEventListener("change",async()=>{await U(_.id,_.checked),await U(C.id,C.checked),await ut(),await A()});$.addEventListener("change",async()=>{await Y($),await A()});const Wt=()=>{v.opttolerance.disabled=!O.checked};O.addEventListener("change",async()=>{Wt(),await Y(O),await A()});he.addEventListener("input",()=>{z.classList.toggle("debug",he.checked)});const Cr=async()=>{await m.getTranslations(),Ft();const e=getComputedStyle(T).getPropertyValue("--mobile-breakpoint"),t=window.matchMedia(`(max-width: ${e})`),n=()=>{if(t.matches){rt.open=!1;return}rt.open=!0};n(),t.addEventListener("change",n);try{_.checked=await re(_.id)??_.defaultChecked}catch{_.checked=_.defaultChecked}try{C.checked=await re(C.id)??C.defaultChecked}catch{C.checked=C.defaultChecked}_.checked&&w.classList.add(Me),C.checked&&w.classList.add($e);const r=[];dt.forEach(async(s,o)=>{const{name:c,icon:l}=kr[o],d=Sr(c,l);mt.append(d),o<2&&(d.open=!0),c==="colorChannels"?I.colorChannels.append(R.parentNode):c==="svgOptions"?(I.svgOptions.append(_.parentNode),I.svgOptions.append(C.parentNode)):c==="imageSizeAndRotation"&&I.imageSizeAndRotation.append($.parentNode);for(const[u,h]of s)r.push(Pr(u,h,d));Promise.all(r).then(async()=>{for(const[u]of s){if(u==="opttolerance"){const h=I.svgOptions.querySelector('[for="opttolerance"]').parentNode;I.svgOptions.insertBefore(O.parentNode,h)}if(c==="svgOptions"){const h=I.svgOptions.querySelector(".preprocess-input.advanced");I.svgOptions.insertBefore(G.parentNode,h)}}await ut()})}),mt.append(at.parentNode),y.addEventListener("load",async()=>{y.width=y.naturalWidth,y.height=y.naturalHeight;const s=await De();if(y.src!==new URL("/favicon.png",location.href).toString()||Object.keys(s).length>1)setTimeout(async()=>{It(),await A()},100);else{const o=await fetch(`/potraced-${_.checked?"color":"monochrome"}.svg`).then(c=>c.text());w.innerHTML=o}}),y.complete&&y.dispatchEvent(new Event("load")),Oe.hidden=!1,new URL(location).searchParams.has("debug")&&(he.checked=!0,he.labels[0].hidden=!1,he.dispatchEvent(new Event("input")));try{const s=await re(me);if(s&&await Or(s)){const o=await s.getFile(),c=URL.createObjectURL(o);y.src=c}}catch(s){console.error(s.name,s.message);try{await nr(me)}catch(o){console.error(o.name,o.message)}}},Or=async e=>{const t={mode:"read"};return await e.queryPermission(t)==="granted"||await e.requestPermission(t)==="granted"},Ft=()=>{ln.textContent=m.t("license"),dn.textContent=m.t("about"),at.textContent=m.t("resetAll"),nn.textContent=m.t("posterizeInputImage"),rn.textContent=m.t("colorSVG"),on.textContent=m.t("monochromeSVG"),an.textContent=m.t("considerDPR"),sn.textContent=m.t("opticurve"),cn.textContent=m.t("showAdvancedControls"),Ee.innerHTML="",Ee.append(H(hr));const e=document.createElement("span");e.textContent=m.t("openImage"),Ee.append(e),ke.innerHTML="",ke.append(H(pr));const t=document.createElement("span");t.textContent=m.t("saveSVG"),ke.append(t),xe.innerHTML="",xe.append(H(Mt?gr:vr));const n=document.createElement("span");n.textContent=m.t("shareSVG"),xe.append(n),Se.innerHTML="",Se.append(H(mr));const r=document.createElement("span");r.textContent=m.t("copySVG"),Se.append(r),Pe.innerHTML="",Pe.append(H(fr));const i=document.createElement("span");i.textContent=m.t("pasteImage"),Pe.append(i),Ce.innerHTML="",Ce.append(H(wr));const a=document.createElement("span");a.textContent=m.t("install"),Ce.append(a),T.dataset.dropText=m.t("dropFileHere"),Ne.innerHTML="",Ne.append(H(yr)),Ne.append(document.createTextNode(m.t("tweak"))),Rt.ariaLabel=m.t("closeOptions"),document.querySelectorAll("[data-i18n-key]").forEach(s=>{s.textContent=m.t(s.dataset.i18nKey)}),document.querySelectorAll("[data-dynamic-i18n-key]").forEach(s=>{s.textContent=ie(s.dataset.dynamicI18nKey,s.dataset.dynamicValue)}),Ie.innerHTML="",m.supportedLocales.sort().forEach(s=>{const[o,c]=s.split("-"),l=document.createElement("option");l.value=s,l.textContent=m.t(`${o}${c}`),o===m.currentLanguageAndLocale.language&&c===m.currentLanguageAndLocale.locale&&(l.selected=!0),Ie.append(l)})};Ie.addEventListener("change",async()=>{const[e,t]=Ie.value.split("-");try{await m.setLanguageAndLocale(e,t),Ft()}catch(n){console.error(n.name,n.message)}});at.addEventListener("click",async()=>{const e=(t,n,r)=>{v[t].value=r,Ve[t].textContent=ie(n,r),Ve[t].dataset.dynamicValue=r};dt.forEach(t=>{for(const[n,r]of t)e(n,r.unit,r.initial)}),O.checked=O.defaultChecked,opttolerance.disabled=!O.defaultChecked,R.checked=R.defaultChecked,$.checked=$.defaultChecked,await Rr(),It(),await A()});let Xe=null;const P=(e,t=5e3)=>{if(Q.innerHTML=e,Q.hidden=!1,Xe&&clearTimeout(Xe),t!==1/0){Xe=setTimeout(()=>{Q.hidden=!0,Q.textContent=""},t);return}},Tr=()=>{Q.hidden=!0,Q.textContent=""},Gt=async()=>{await Y(G),document.querySelectorAll(".advanced").forEach(e=>{G.checked?e.style.display="block":e.style.display="none"})};G.addEventListener("change",Gt);T.style.setProperty("--100vh",`${window.innerHeight}px`);window.addEventListener("resize",Te(()=>{T.style.setProperty("--100vh",`${window.innerHeight}px`)},250));Rt.addEventListener("click",()=>{rt.open=!1});const Rr=async()=>{await U(_.checked?lt:ct,{})},De=async()=>{try{const e=_.checked?await re(lt):await re(ct);return e||{}}catch{return{}}},Y=async e=>{try{const t=await De();t[e.id]=e.type==="range"?e.value:e.checked,await U(_.checked?lt:ct,t)}catch{}};function Ar(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:r,onRegistered:i,onRegisteredSW:a,onRegisterError:s}=e;let o,c;const l=async(u=!0)=>{await c};async function d(){if("serviceWorker"in navigator){const{Workbox:u}=await p(()=>import("./workbox-window.prod.es5-dc90f814.js"),[]);o=new u("/sw.js",{scope:"/",type:"classic"}),o.addEventListener("activated",h=>{(h.isUpdate||h.isExternal)&&window.location.reload()}),o.addEventListener("installed",h=>{h.isUpdate||r?.()}),o.register({immediate:t}).then(h=>{a?a("/sw.js",h):i?.(h)}).catch(h=>{s?.(h)})}}return c=d(),l}// @license © 2019 Google LLC. Licensed under the Apache License, Version 2.0. -const ue=document;let Z={};try{Z=localStorage}catch{}const je="prefers-color-scheme",_e="media",b="light",k="dark",Pt=`(${je}:${k})`,Ir=`(${je}:${b})`,Ct="link[rel=stylesheet]",Ke="remember",Je="legend",Le="toggle",Ot="switch",Ze="appearance",Qe="permanent",et="mode",ce="colorschemechange",tt="permanentcolorscheme",Tt="all",nt="not all",g="dark-mode-toggle",ne="https://googlechromelabs.github.io/dark-mode-toggle/demo/",J=(e,t,n=t)=>{Object.defineProperty(e,n,{enumerable:!0,get(){const r=this.getAttribute(t);return r===null?"":r},set(r){this.setAttribute(t,r)}})},Mr=(e,t,n=t)=>{Object.defineProperty(e,n,{enumerable:!0,get(){return this.hasAttribute(t)},set(r){r?this.setAttribute(t,""):this.removeAttribute(t)}})},Yt=ue.createElement("template");Yt.innerHTML=`
`;class $r extends HTMLElement{static get observedAttributes(){return[et,Ze,Qe,Je,b,k,Ke]}constructor(){super(),J(this,et),J(this,Ze),J(this,Je),J(this,b),J(this,k),J(this,Ke),Mr(this,Qe),this.t=null,this.i=null,ue.addEventListener(ce,t=>{this.mode=t.detail.colorScheme,this.o(),this.l()}),ue.addEventListener(tt,t=>{this.permanent=t.detail.permanent,this.h.checked=this.permanent}),this.p()}p(){const t=this.attachShadow({mode:"open"});t.append(Yt.content.cloneNode(!0)),this.t=ue.querySelectorAll(`${Ct}[${_e}*=${je}][${_e}*="${k}"]`),this.i=ue.querySelectorAll(`${Ct}[${_e}*=${je}][${_e}*="${b}"]`),this.g=t.querySelector("[part=lightRadio]"),this.m=t.querySelector("[part=lightLabel]"),this.u=t.querySelector("[part=darkRadio]"),this.k=t.querySelector("[part=darkLabel]"),this.v=t.querySelector("[part=toggleCheckbox]"),this.$=t.querySelector("[part=toggleLabel]"),this.L=t.querySelector("legend"),this.C=t.querySelector("aside"),this.h=t.querySelector("[part=permanentCheckbox]"),this.M=t.querySelector("[part=permanentLabel]")}connectedCallback(){const t=matchMedia(Pt).media!==nt;t&&matchMedia(Pt).addListener(({matches:r})=>{this.permanent||(this.mode=r?k:b,this.R(ce,{colorScheme:this.mode}))});let n=!1;try{n=Z.getItem(g)}catch{}if(n&&[k,b].includes(n)?(this.mode=n,this.h.checked=!0,this.permanent=!0):t&&(this.mode=matchMedia(Ir).matches?b:k),this.mode||(this.mode=b),this.permanent&&!n)try{Z.setItem(g,this.mode)}catch{}this.appearance||(this.appearance=Le),this._(),this.o(),this.l(),[this.g,this.u].forEach(r=>{r.addEventListener("change",()=>{this.mode=this.g.checked?b:k,this.l(),this.R(ce,{colorScheme:this.mode})})}),this.v.addEventListener("change",()=>{this.mode=this.v.checked?k:b,this.o(),this.R(ce,{colorScheme:this.mode})}),this.h.addEventListener("change",()=>{this.permanent=this.h.checked,this.R(tt,{permanent:this.permanent})}),this.A(),this.R(ce,{colorScheme:this.mode}),this.R(tt,{permanent:this.permanent})}attributeChangedCallback(t,n,r){if(t===et){if(![b,k].includes(r))throw new RangeError(`Allowed values: "${b}" and "${k}".`);if(matchMedia("(hover:none)").matches&&this.remember&&this.S(),this.permanent)try{Z.setItem(g,this.mode)}catch{}this.o(),this.l(),this.A()}else if(t===Ze){if(![Le,Ot].includes(r))throw new RangeError(`Allowed values: "${Le}" and "${Ot}".`);this._()}else if(t===Qe){if(this.permanent){if(this.mode)try{Z.setItem(g,this.mode)}catch{}}else try{Z.removeItem(g)}catch{}this.h.checked=this.permanent}else t===Je?this.L.textContent=r:t===Ke?this.M.textContent=r:t===b?(this.m.textContent=r,this.mode===b&&(this.$.textContent=r)):t===k&&(this.k.textContent=r,this.mode===k&&(this.$.textContent=r))}R(t,n){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:n}))}_(){const t=this.appearance===Le;this.g.hidden=t,this.m.hidden=t,this.u.hidden=t,this.k.hidden=t,this.v.hidden=!t,this.$.hidden=!t}o(){this.mode===b?this.g.checked=!0:this.u.checked=!0}l(){this.mode===b?(this.$.style.setProperty(`--${g}-checkbox-icon`,`var(--${g}-light-icon,url("${ne}moon.png"))`),this.$.textContent=this.light,this.light||(this.$.ariaLabel=k),this.v.checked=!1):(this.$.style.setProperty(`--${g}-checkbox-icon`,`var(--${g}-dark-icon,url("${ne}sun.png"))`),this.$.textContent=this.dark,this.dark||(this.$.ariaLabel=b),this.v.checked=!0)}A(){this.mode===b?(this.i.forEach(t=>{t.media=Tt,t.disabled=!1}),this.t.forEach(t=>{t.media=nt,t.disabled=!0})):(this.t.forEach(t=>{t.media=Tt,t.disabled=!1}),this.i.forEach(t=>{t.media=nt,t.disabled=!0}))}S(){this.C.style.visibility="visible",setTimeout(()=>{this.C.style.visibility="hidden"},3e3)}}customElements.define(g,$r);"launchQueue"in window&&p(()=>import("./filehandling-7f105388.js"),[]);"windowControlsOverlay"in navigator&&p(()=>import("./windowcontrols-ca6365f4.js"),[]);"onbeforeinstallprompt"in window&&"onappinstalled"in window?p(()=>import("./install-83387fda.js"),[]):Ce.style.display="none";"share"in navigator&&"canShare"in navigator?p(()=>import("./share-a6c580ec.js"),[]):xe.style.display="none";"serviceWorker"in navigator&&window.addEventListener("load",async()=>{try{await navigator.serviceWorker.register("./sharetargetsw.js",{scope:"/share-target/"})}catch(e){console.error(e.name,e.message),P(e.message)}if(location.search.includes("share-target")){const e=await caches.keys(),t=await caches.open(e.filter(r=>r.startsWith("media"))[0]),n=await t.match("shared-image");if(n){const r=await n.blob();await t.delete("shared-image");const i=URL.createObjectURL(r);y.addEventListener("load",()=>{URL.revokeObjectURL(i)},{once:!0}),y.src=i}}});const Vr=()=>{let e=!1;const t={get type(){e=!0}};try{new Worker("blob://",t)}finally{return e}},Xt=()=>{const e=At.mode;T.style.setProperty("--color-scheme",e),un.content=e==="dark"?"#131313":"#fff"};At.addEventListener("colorschemechange",Xt);Xt();(async()=>(Cr(),Vr()||await p(()=>import("./module-workers-polyfill.min-53ae82b3.js"),[]),Ar({onOfflineReady(){P(m.t("readyToWorkOffline"))},onNeedRefresh(){location.reload()}})()))();location.href==="https://svgco.de/"&&p(()=>import("./collect-356ee285.js"),[]);export{me as F,zr as a,Ce as b,xe as c,Te as d,w as e,P as f,m as g,Tr as h,y as i,re as j,rr as k,T as l,jr as m,Ae as o,U as s}; +const ue=document;let Z={};try{Z=localStorage}catch{}const je="prefers-color-scheme",_e="media",b="light",k="dark",Pt=`(${je}:${k})`,Ir=`(${je}:${b})`,Ct="link[rel=stylesheet]",Ke="remember",Je="legend",Le="toggle",Ot="switch",Ze="appearance",Qe="permanent",et="mode",ce="colorschemechange",tt="permanentcolorscheme",Tt="all",nt="not all",g="dark-mode-toggle",ne="https://googlechromelabs.github.io/dark-mode-toggle/demo/",J=(e,t,n=t)=>{Object.defineProperty(e,n,{enumerable:!0,get(){const r=this.getAttribute(t);return r===null?"":r},set(r){this.setAttribute(t,r)}})},Mr=(e,t,n=t)=>{Object.defineProperty(e,n,{enumerable:!0,get(){return this.hasAttribute(t)},set(r){r?this.setAttribute(t,""):this.removeAttribute(t)}})},Yt=ue.createElement("template");Yt.innerHTML=`
`;class $r extends HTMLElement{static get observedAttributes(){return[et,Ze,Qe,Je,b,k,Ke]}constructor(){super(),J(this,et),J(this,Ze),J(this,Je),J(this,b),J(this,k),J(this,Ke),Mr(this,Qe),this.t=null,this.i=null,ue.addEventListener(ce,t=>{this.mode=t.detail.colorScheme,this.o(),this.l()}),ue.addEventListener(tt,t=>{this.permanent=t.detail.permanent,this.h.checked=this.permanent}),this.p()}p(){const t=this.attachShadow({mode:"open"});t.append(Yt.content.cloneNode(!0)),this.t=ue.querySelectorAll(`${Ct}[${_e}*=${je}][${_e}*="${k}"]`),this.i=ue.querySelectorAll(`${Ct}[${_e}*=${je}][${_e}*="${b}"]`),this.g=t.querySelector("[part=lightRadio]"),this.m=t.querySelector("[part=lightLabel]"),this.u=t.querySelector("[part=darkRadio]"),this.k=t.querySelector("[part=darkLabel]"),this.v=t.querySelector("[part=toggleCheckbox]"),this.$=t.querySelector("[part=toggleLabel]"),this.L=t.querySelector("legend"),this.C=t.querySelector("aside"),this.h=t.querySelector("[part=permanentCheckbox]"),this.M=t.querySelector("[part=permanentLabel]")}connectedCallback(){const t=matchMedia(Pt).media!==nt;t&&matchMedia(Pt).addListener(({matches:r})=>{this.permanent||(this.mode=r?k:b,this.R(ce,{colorScheme:this.mode}))});let n=!1;try{n=Z.getItem(g)}catch{}if(n&&[k,b].includes(n)?(this.mode=n,this.h.checked=!0,this.permanent=!0):t&&(this.mode=matchMedia(Ir).matches?b:k),this.mode||(this.mode=b),this.permanent&&!n)try{Z.setItem(g,this.mode)}catch{}this.appearance||(this.appearance=Le),this._(),this.o(),this.l(),[this.g,this.u].forEach(r=>{r.addEventListener("change",()=>{this.mode=this.g.checked?b:k,this.l(),this.R(ce,{colorScheme:this.mode})})}),this.v.addEventListener("change",()=>{this.mode=this.v.checked?k:b,this.o(),this.R(ce,{colorScheme:this.mode})}),this.h.addEventListener("change",()=>{this.permanent=this.h.checked,this.R(tt,{permanent:this.permanent})}),this.A(),this.R(ce,{colorScheme:this.mode}),this.R(tt,{permanent:this.permanent})}attributeChangedCallback(t,n,r){if(t===et){if(![b,k].includes(r))throw new RangeError(`Allowed values: "${b}" and "${k}".`);if(matchMedia("(hover:none)").matches&&this.remember&&this.S(),this.permanent)try{Z.setItem(g,this.mode)}catch{}this.o(),this.l(),this.A()}else if(t===Ze){if(![Le,Ot].includes(r))throw new RangeError(`Allowed values: "${Le}" and "${Ot}".`);this._()}else if(t===Qe){if(this.permanent){if(this.mode)try{Z.setItem(g,this.mode)}catch{}}else try{Z.removeItem(g)}catch{}this.h.checked=this.permanent}else t===Je?this.L.textContent=r:t===Ke?this.M.textContent=r:t===b?(this.m.textContent=r,this.mode===b&&(this.$.textContent=r)):t===k&&(this.k.textContent=r,this.mode===k&&(this.$.textContent=r))}R(t,n){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:n}))}_(){const t=this.appearance===Le;this.g.hidden=t,this.m.hidden=t,this.u.hidden=t,this.k.hidden=t,this.v.hidden=!t,this.$.hidden=!t}o(){this.mode===b?this.g.checked=!0:this.u.checked=!0}l(){this.mode===b?(this.$.style.setProperty(`--${g}-checkbox-icon`,`var(--${g}-light-icon,url("${ne}moon.png"))`),this.$.textContent=this.light,this.light||(this.$.ariaLabel=k),this.v.checked=!1):(this.$.style.setProperty(`--${g}-checkbox-icon`,`var(--${g}-dark-icon,url("${ne}sun.png"))`),this.$.textContent=this.dark,this.dark||(this.$.ariaLabel=b),this.v.checked=!0)}A(){this.mode===b?(this.i.forEach(t=>{t.media=Tt,t.disabled=!1}),this.t.forEach(t=>{t.media=nt,t.disabled=!0})):(this.t.forEach(t=>{t.media=Tt,t.disabled=!1}),this.i.forEach(t=>{t.media=nt,t.disabled=!0}))}S(){this.C.style.visibility="visible",setTimeout(()=>{this.C.style.visibility="hidden"},3e3)}}customElements.define(g,$r);"launchQueue"in window&&p(()=>import("./filehandling-aba82c08.js"),[]);"windowControlsOverlay"in navigator&&p(()=>import("./windowcontrols-f0d3548a.js"),[]);"onbeforeinstallprompt"in window&&"onappinstalled"in window?p(()=>import("./install-4fe4437f.js"),[]):Ce.style.display="none";"share"in navigator&&"canShare"in navigator?p(()=>import("./share-627cad8a.js"),[]):xe.style.display="none";"serviceWorker"in navigator&&window.addEventListener("load",async()=>{try{await navigator.serviceWorker.register("./sharetargetsw.js",{scope:"/share-target/"})}catch(e){console.error(e.name,e.message),P(e.message)}if(location.search.includes("share-target")){const e=await caches.keys(),t=await caches.open(e.filter(r=>r.startsWith("media"))[0]),n=await t.match("shared-image");if(n){const r=await n.blob();await t.delete("shared-image");const i=URL.createObjectURL(r);y.addEventListener("load",()=>{URL.revokeObjectURL(i)},{once:!0}),y.src=i}}});const Vr=()=>{let e=!1;const t={get type(){e=!0}};try{new Worker("blob://",t)}finally{return e}},Xt=()=>{const e=At.mode;T.style.setProperty("--color-scheme",e),un.content=e==="dark"?"#131313":"#fff"};At.addEventListener("colorschemechange",Xt);Xt();(async()=>(Cr(),Vr()||await p(()=>import("./module-workers-polyfill.min-53ae82b3.js"),[]),Ar({onOfflineReady(){P(m.t("readyToWorkOffline"))},onNeedRefresh(){location.reload()}})()))();location.href==="https://svgco.de/"&&p(()=>import("./collect-563a935e.js"),[]);export{me as F,zr as a,Ce as b,xe as c,Te as d,w as e,P as f,m as g,Tr as h,y as i,re as j,rr as k,T as l,jr as m,Ae as o,U as s}; diff --git a/docs/assets/install-83387fda.js b/docs/assets/install-4fe4437f.js similarity index 82% rename from docs/assets/install-83387fda.js rename to docs/assets/install-4fe4437f.js index 3adf2c8..e05939c 100644 --- a/docs/assets/install-83387fda.js +++ b/docs/assets/install-4fe4437f.js @@ -1 +1 @@ -import{b as l}from"./index-72d74a78.js";let e=null;window.addEventListener("beforeinstallprompt",t=>{t.preventDefault(),e=t,l.style.display="flex"});l.addEventListener("click",async()=>{if(!e)return;e.prompt(),(await e.userChoice).outcome==="accepted"&&(l.style.display="none",e=null)});window.addEventListener("appinstalled",t=>{l.style.display="none",e=null}); +import{b as l}from"./index-08969439.js";let e=null;window.addEventListener("beforeinstallprompt",t=>{t.preventDefault(),e=t,l.style.display="flex"});l.addEventListener("click",async()=>{if(!e)return;e.prompt(),(await e.userChoice).outcome==="accepted"&&(l.style.display="none",e=null)});window.addEventListener("appinstalled",t=>{l.style.display="none",e=null}); diff --git a/docs/assets/share-a6c580ec.js b/docs/assets/share-627cad8a.js similarity index 86% rename from docs/assets/share-a6c580ec.js rename to docs/assets/share-627cad8a.js index 696e0ac..5164d2c 100644 --- a/docs/assets/share-a6c580ec.js +++ b/docs/assets/share-627cad8a.js @@ -1 +1 @@ -import{c as r,e as l,f as i,g as o,o as g,h as c,j as m,F as f,k as d}from"./index-72d74a78.js";r.style.display="flex";r.addEventListener("click",async()=>{let a=l.innerHTML;i(o.t("optimizingSVG"),1/0),a=await g(a),c();let t=!1;try{t=await m(f)}catch{}const n=t?d(t):"Untitled.svg",s={files:[new File([a],n,{type:"image/svg+xml"})]};if(navigator.canShare(s))try{await navigator.share(s)}catch(e){e.name!=="AbortError"&&(console.error(e.name,e.message),i(e.message))}}); +import{c as r,e as l,f as i,g as o,o as g,h as c,j as m,F as f,k as d}from"./index-08969439.js";r.style.display="flex";r.addEventListener("click",async()=>{let a=l.innerHTML;i(o.t("optimizingSVG"),1/0),a=await g(a),c();let t=!1;try{t=await m(f)}catch{}const n=t?d(t):"Untitled.svg",s={files:[new File([a],n,{type:"image/svg+xml"})]};if(navigator.canShare(s))try{await navigator.share(s)}catch(e){e.name!=="AbortError"&&(console.error(e.name,e.message),i(e.message))}}); diff --git a/docs/assets/windowcontrols-ca6365f4.js b/docs/assets/windowcontrols-f0d3548a.js similarity index 79% rename from docs/assets/windowcontrols-ca6365f4.js rename to docs/assets/windowcontrols-f0d3548a.js index 78421e5..322d8ab 100644 --- a/docs/assets/windowcontrols-ca6365f4.js +++ b/docs/assets/windowcontrols-f0d3548a.js @@ -1 +1 @@ -import{d as a,m as e,a as s}from"./index-72d74a78.js";const o="window-controls-overlay",n=()=>{e.classList.toggle(o,navigator.windowControlsOverlay.visible),s.classList.toggle(o,navigator.windowControlsOverlay.visible)};navigator.windowControlsOverlay.addEventListener("geometrychange",a(async()=>{n()},250));n(); +import{d as a,m as e,a as s}from"./index-08969439.js";const o="window-controls-overlay",n=()=>{e.classList.toggle(o,navigator.windowControlsOverlay.visible),s.classList.toggle(o,navigator.windowControlsOverlay.visible)};navigator.windowControlsOverlay.addEventListener("geometrychange",a(async()=>{n()},250));n(); diff --git a/docs/index.html b/docs/index.html index 9564baf..6bd87f4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -101,7 +101,7 @@ } - + diff --git a/docs/sw.js b/docs/sw.js index edfa4fc..741090a 100644 --- a/docs/sw.js +++ b/docs/sw.js @@ -1 +1 @@ -if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()})).then((()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s})));self.define=(r,n)=>{const i=s||("document"in self?document.currentScript.src:"")||location.href;if(e[i])return;let u={};const o=s=>l(s,i),t={module:{uri:i},exports:u,require:o};e[i]=Promise.all(r.map((s=>t[s]||o(s)))).then((s=>(n(...s),u)))}}define(["./workbox-3625d7b0"],(function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/ar-TN-917a8102.js",revision:null},{url:"assets/be-BY-e27002d9.js",revision:null},{url:"assets/ca-ES-450231bf.js",revision:null},{url:"assets/collect-356ee285.js",revision:null},{url:"assets/colorworker-9f272d25.js",revision:null},{url:"assets/da-DK-fecf3d76.js",revision:null},{url:"assets/de-DE-c44b440e.js",revision:null},{url:"assets/el-GR-cf1cb156.js",revision:null},{url:"assets/en-GB-1ebb0134.js",revision:null},{url:"assets/en-US-14af226a.js",revision:null},{url:"assets/es-ES-8cdc11e3.js",revision:null},{url:"assets/filehandling-7f105388.js",revision:null},{url:"assets/fr-FR-dff4346a.js",revision:null},{url:"assets/he-IL-3b82a749.js",revision:null},{url:"assets/id-ID-d5dc62f7.js",revision:null},{url:"assets/index-72d74a78.js",revision:null},{url:"assets/install-83387fda.js",revision:null},{url:"assets/it-IT-24240090.js",revision:null},{url:"assets/ja-JP-6b72f65f.js",revision:null},{url:"assets/ko-KR-9fdbc612.js",revision:null},{url:"assets/languages-e8d9835d.js",revision:null},{url:"assets/module-workers-polyfill.min-53ae82b3.js",revision:null},{url:"assets/monochromeworker-f4bfce91.js",revision:null},{url:"assets/nl-NL-f6a4c727.js",revision:null},{url:"assets/no-NO-cb14a155.js",revision:null},{url:"assets/pl-PL-9ac090e3.js",revision:null},{url:"assets/preprocessworker-0f706d1d.js",revision:null},{url:"assets/preprocessworker-f3e5e051.js",revision:null},{url:"assets/pt-BR-30fb79a1.js",revision:null},{url:"assets/ru-RU-e5f207da.js",revision:null},{url:"assets/share-a6c580ec.js",revision:null},{url:"assets/style-02ad85c7.css",revision:null},{url:"assets/svgoworker-7ff1a964.js",revision:null},{url:"assets/uk-UA-87a01182.js",revision:null},{url:"assets/windowcontrols-ca6365f4.js",revision:null},{url:"assets/workbox-window.prod.es5-dc90f814.js",revision:null},{url:"assets/zh-CN-148f9e59.js",revision:null},{url:"index.html",revision:"a9bd6979928d8cfdfe5c35c830d18c4b"},{url:"sharetargetsw.js",revision:"fe6035ce16732cd07fe629f4f0959ef6"},{url:"manifest.webmanifest",revision:"a6cd9ce43a40d9bc3b49fe0094b0c5e5"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))})); +if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()})).then((()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s})));self.define=(r,n)=>{const i=s||("document"in self?document.currentScript.src:"")||location.href;if(e[i])return;let u={};const o=s=>l(s,i),a={module:{uri:i},exports:u,require:o};e[i]=Promise.all(r.map((s=>a[s]||o(s)))).then((s=>(n(...s),u)))}}define(["./workbox-3625d7b0"],(function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/ar-TN-917a8102.js",revision:null},{url:"assets/be-BY-e27002d9.js",revision:null},{url:"assets/ca-ES-450231bf.js",revision:null},{url:"assets/collect-563a935e.js",revision:null},{url:"assets/colorworker-9f272d25.js",revision:null},{url:"assets/da-DK-fecf3d76.js",revision:null},{url:"assets/de-DE-c44b440e.js",revision:null},{url:"assets/el-GR-cf1cb156.js",revision:null},{url:"assets/en-GB-1ebb0134.js",revision:null},{url:"assets/en-US-14af226a.js",revision:null},{url:"assets/es-ES-8cdc11e3.js",revision:null},{url:"assets/filehandling-aba82c08.js",revision:null},{url:"assets/fr-FR-dff4346a.js",revision:null},{url:"assets/he-IL-3b82a749.js",revision:null},{url:"assets/id-ID-d5dc62f7.js",revision:null},{url:"assets/index-08969439.js",revision:null},{url:"assets/install-4fe4437f.js",revision:null},{url:"assets/it-IT-24240090.js",revision:null},{url:"assets/ja-JP-6b72f65f.js",revision:null},{url:"assets/ko-KR-9fdbc612.js",revision:null},{url:"assets/languages-e8d9835d.js",revision:null},{url:"assets/module-workers-polyfill.min-53ae82b3.js",revision:null},{url:"assets/monochromeworker-f4bfce91.js",revision:null},{url:"assets/nl-NL-f6a4c727.js",revision:null},{url:"assets/no-NO-cb14a155.js",revision:null},{url:"assets/pl-PL-9ac090e3.js",revision:null},{url:"assets/preprocessworker-0f706d1d.js",revision:null},{url:"assets/preprocessworker-f3e5e051.js",revision:null},{url:"assets/pt-BR-30fb79a1.js",revision:null},{url:"assets/ru-RU-e5f207da.js",revision:null},{url:"assets/share-627cad8a.js",revision:null},{url:"assets/style-02ad85c7.css",revision:null},{url:"assets/svgoworker-7ff1a964.js",revision:null},{url:"assets/uk-UA-87a01182.js",revision:null},{url:"assets/windowcontrols-f0d3548a.js",revision:null},{url:"assets/workbox-window.prod.es5-dc90f814.js",revision:null},{url:"assets/zh-CN-148f9e59.js",revision:null},{url:"index.html",revision:"b8ad7dc93595ef71eafdd65533ac2b57"},{url:"sharetargetsw.js",revision:"fe6035ce16732cd07fe629f4f0959ef6"},{url:"manifest.webmanifest",revision:"a6cd9ce43a40d9bc3b49fe0094b0c5e5"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))})); diff --git a/src/js/clipboard.js b/src/js/clipboard.js index fcba662..672f00c 100644 --- a/src/js/clipboard.js +++ b/src/js/clipboard.js @@ -85,13 +85,20 @@ copyButton.addEventListener('click', async () => { ]); // Safari (non-optimized SVG) } else { + /* await navigator.clipboard.write([ new ClipboardItem({ - 'text/plain': new Promise(async (resolve) => { + 'text/plain': new Promise((resolve) => { resolve(new Blob([svg], { type: 'text/plain' })); }), }), ]); + */ + await navigator.clipboard.write([ + new ClipboardItem({ + 'text/plain': new Blob([svg], { type: 'text/plain' }), + }), + ]); } } // Chromium < 98.