-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
index.js
39 lines (37 loc) · 65.4 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var Ho=Object.defineProperty,Io=Object.defineProperties;var qo=Object.getOwnPropertyDescriptors;var Ui=Object.getOwnPropertySymbols;var No=Object.prototype.hasOwnProperty,Bo=Object.prototype.propertyIsEnumerable;var Hi=(e,t,n)=>t in e?Ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ii=(e,t)=>{for(var n in t||(t={}))No.call(t,n)&&Hi(e,n,t[n]);if(Ui)for(var n of Ui(t))Bo.call(t,n)&&Hi(e,n,t[n]);return e},qi=(e,t)=>Io(e,qo(t));import{S as X,i as Y,s as $,e as s,a as v,t as z,b as a,c as O,d as r,l as C,f as G,n as I,g as W,r as x,o as Xe,h as Wn,j as E,p as Ye,k as he,m as Go,q as Ni,u as dt,v as $e,w as Bi,x as J,y as Gi,z as Vi,A as Ji,B as Ki,C as Xi,D as Yi,E as Vo,F as $i,G as Qi,H as Jo,I as Ko,J as Xo}from"./vendor.js";const Yo=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerpolicy&&(l.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?l.credentials="include":o.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}};Yo();/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Zi=function(e,t){return(Zi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])})(e,t)};function Ln(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Zi(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ft=function(){return(ft=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function g(e,t,n,i){return new(n||(n=Promise))(function(o,l){function u(h){try{p(i.next(h))}catch(f){l(f)}}function c(h){try{p(i.throw(h))}catch(f){l(f)}}function p(h){var f;h.done?o(h.value):(f=h.value,f instanceof n?f:new n(function(M){M(f)})).then(u,c)}p((i=i.apply(e,t||[])).next())})}function _(e,t){var n,i,o,l,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(p){return function(h){return function(f){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,i&&(o=2&f[0]?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[2&f[0],o.value]),f[0]){case 0:case 1:o=f;break;case 4:return u.label++,{value:f[1],done:!1};case 5:u.label++,i=f[1],f=[0];continue;case 7:f=u.ops.pop(),u.trys.pop();continue;default:if(o=u.trys,!((o=o.length>0&&o[o.length-1])||f[0]!==6&&f[0]!==2)){u=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){u.label=f[1];break}if(f[0]===6&&u.label<o[1]){u.label=o[1],o=f;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(f);break}o[2]&&u.ops.pop(),u.trys.pop();continue}f=t.call(e,u)}catch(M){f=[6,M],i=0}finally{n=o=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([p,h])}}}function Lt(e,t){t===void 0&&(t=!1);var n=window.crypto.getRandomValues(new Uint32Array(1))[0],i="_".concat(n);return Object.defineProperty(window,i,{value:function(o){return t&&Reflect.deleteProperty(window,i),e==null?void 0:e(o)},writable:!1,configurable:!0}),n}function me(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,new Promise(function(i,o){var l=Lt(function(c){i(c),Reflect.deleteProperty(window,u)},!0),u=Lt(function(c){o(c),Reflect.deleteProperty(window,l)},!0);window.__TAURI_IPC__(ft({cmd:e,callback:l,error:u},t))})]})})}function xi(e){return navigator.userAgent.includes("Windows")?"https://asset.localhost/".concat(e):"asset://".concat(e)}Object.freeze({__proto__:null,transformCallback:Lt,invoke:me,convertFileSrc:xi});function T(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,me("tauri",e)]})})}function $o(e,t,n,i){return g(this,void 0,void 0,function(){return _(this,function(o){return typeof n=="object"&&Object.freeze(n),[2,T({__tauriModule:"Shell",message:{cmd:"execute",program:t,args:n,options:i,onEventFn:Lt(e)}})]})})}var An=function(){function e(){this.eventListeners=Object.create(null)}return e.prototype.addEventListener=function(t,n){t in this.eventListeners?this.eventListeners[t].push(n):this.eventListeners[t]=[n]},e.prototype._emit=function(t,n){if(t in this.eventListeners)for(var i=0,o=this.eventListeners[t];i<o.length;i++)(0,o[i])(n)},e.prototype.on=function(t,n){return this.addEventListener(t,n),this},e}(),to=function(){function e(t){this.pid=t}return e.prototype.write=function(t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:t}})]})})},e.prototype.kill=function(){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})]})})},e}(),eo=function(e){function t(n,i,o){i===void 0&&(i=[]);var l=e.call(this)||this;return l.stdout=new An,l.stderr=new An,l.program=n,l.args=typeof i=="string"?[i]:i,l.options=o!=null?o:{},l}return Ln(t,e),t.sidecar=function(n,i,o){i===void 0&&(i=[]);var l=new t(n,i,o);return l.options.sidecar=!0,l},t.prototype.spawn=function(){return g(this,void 0,void 0,function(){var n=this;return _(this,function(i){return[2,$o(function(o){switch(o.event){case"Error":n._emit("error",o.payload);break;case"Terminated":n._emit("close",o.payload);break;case"Stdout":n.stdout._emit("data",o.payload);break;case"Stderr":n.stderr._emit("data",o.payload)}},this.program,this.args,this.options).then(function(o){return new to(o)})]})})},t.prototype.execute=function(){return g(this,void 0,void 0,function(){var n=this;return _(this,function(i){return[2,new Promise(function(o,l){n.on("error",l);var u=[],c=[];n.stdout.on("data",function(p){u.push(p)}),n.stderr.on("data",function(p){c.push(p)}),n.on("close",function(p){o({code:p.code,signal:p.signal,stdout:u.join(`
`),stderr:c.join(`
`)})}),n.spawn().catch(l)})]})})},t}(An);function En(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})]})})}Object.freeze({__proto__:null,Command:eo,Child:to,open:En});function no(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"App",message:{cmd:"getAppVersion"}})]})})}function io(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"App",message:{cmd:"getAppName"}})]})})}function oo(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"App",message:{cmd:"getTauriVersion"}})]})})}Object.freeze({__proto__:null,getName:io,getVersion:no,getTauriVersion:oo});function ro(e){return e===void 0&&(e=0),g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})]})})}function Dn(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"Process",message:{cmd:"relaunch"}})]})})}Object.freeze({__proto__:null,exit:ro,relaunch:Dn});function Qo(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P,S,j,F,U;return{c(){t=s("h1"),t.textContent="Welcome",n=v(),i=s("p"),i.textContent="Tauri's API capabilities using the ` @tauri-apps/api ` package. It's used as\n the main validation app, serving as the testbed of our development process. In\n the future, this app will be used on Tauri's integration tests.",o=v(),l=s("p"),u=z("Current App version: "),c=z(e[0]),p=v(),h=s("p"),f=z("Current Tauri version: "),M=z(e[1]),m=v(),d=s("p"),b=z("Current App name: "),k=z(e[2]),y=v(),P=s("button"),P.textContent="Close application",S=v(),j=s("button"),j.textContent="Relaunch application",a(P,"class","button"),a(j,"class","button")},m(L,H){O(L,t,H),O(L,n,H),O(L,i,H),O(L,o,H),O(L,l,H),r(l,u),r(l,c),O(L,p,H),O(L,h,H),r(h,f),r(h,M),O(L,m,H),O(L,d,H),r(d,b),r(d,k),O(L,y,H),O(L,P,H),O(L,S,H),O(L,j,H),F||(U=[C(P,"click",e[3]),C(j,"click",e[4])],F=!0)},p(L,[H]){H&1&&G(c,L[0]),H&2&&G(M,L[1]),H&4&&G(k,L[2])},i:I,o:I,d(L){L&&W(t),L&&W(n),L&&W(i),L&&W(o),L&&W(l),L&&W(p),L&&W(h),L&&W(m),L&&W(d),L&&W(y),L&&W(P),L&&W(S),L&&W(j),F=!1,x(U)}}}function Zo(e,t,n){let i=0,o=0,l="Unknown";io().then(p=>{n(2,l=p)}),no().then(p=>{n(0,i=p)}),oo().then(p=>{n(1,o=p)});async function u(){await ro()}async function c(){await Dn()}return[i,o,l,u,c]}class xo extends X{constructor(t){super();Y(this,t,Zo,Qo,$,{})}}function lo(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}Object.freeze({__proto__:null,getMatches:lo});function tr(e){let t,n,i,o,l,u,c,p,h,f,M;return{c(){t=s("div"),n=z(`This binary can be run on the terminal and takes the following arguments:
`),i=s("ul"),i.innerHTML=`<li>--config PATH</li>
<li>--theme light|dark|system</li>
<li>--verbose</li>`,o=z(`
Additionally, it has a `),l=s("i"),l.textContent="update --background",u=z(` subcommand.
Note that the arguments are only parsed, not implemented.
`),c=s("br"),p=v(),h=s("button"),h.textContent="Get matches",a(h,"class","button"),a(h,"id","cli-matches")},m(m,d){O(m,t,d),r(t,n),r(t,i),r(t,o),r(t,l),r(t,u),r(t,c),r(t,p),r(t,h),f||(M=C(h,"click",e[0]),f=!0)},p:I,i:I,o:I,d(m){m&&W(t),f=!1,M()}}}function er(e,t,n){let{onMessage:i}=t;function o(){lo().then(i).catch(i)}return e.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class nr extends X{constructor(t){super();Y(this,t,er,tr,$,{onMessage:1})}}function uo(e,t,n){return g(this,void 0,void 0,function(){return _(this,function(i){switch(i.label){case 0:return[4,T({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:typeof n=="string"?n:JSON.stringify(n)}})];case 1:return i.sent(),[2]}})})}function so(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Event",message:{cmd:"unlisten",eventId:e}})]})})}function At(e,t){return g(this,void 0,void 0,function(){var n=this;return _(this,function(i){return[2,T({__tauriModule:"Event",message:{cmd:"listen",event:e,handler:Lt(t)}}).then(function(o){return function(){return g(n,void 0,void 0,function(){return _(this,function(l){return[2,so(o)]})})}})]})})}function Rn(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,At(e,function(i){t(i),so(i.id).catch(function(){})})]})})}function Qe(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,uo(e,null,t)]})})}Object.freeze({__proto__:null,listen:At,once:Rn,emit:Qe});function ir(e){let t,n,i,o,l,u,c,p;return{c(){t=s("div"),n=s("button"),n.textContent="Call Log API",i=v(),o=s("button"),o.textContent="Call Request (async) API",l=v(),u=s("button"),u.textContent="Send event to Rust",a(n,"class","button"),a(n,"id","log"),a(o,"class","button"),a(o,"id","request"),a(u,"class","button"),a(u,"id","event")},m(h,f){O(h,t,f),r(t,n),r(t,i),r(t,o),r(t,l),r(t,u),c||(p=[C(n,"click",e[0]),C(o,"click",e[1]),C(u,"click",e[2])],c=!0)},p:I,i:I,o:I,d(h){h&&W(t),c=!1,x(p)}}}function or(e,t,n){let{onMessage:i}=t,o;Xe(async()=>{o=await At("rust-event",i)}),Wn(()=>{o&&o()});function l(){me("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){me("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){Qe("js-event","this is the payload string")}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[l,u,c,i]}class rr extends X{constructor(t){super();Y(this,t,or,ir,$,{onMessage:3})}}function jn(e){return e===void 0&&(e={}),g(this,void 0,void 0,function(){return _(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,T({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})]})})}function ao(e){return e===void 0&&(e={}),g(this,void 0,void 0,function(){return _(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,T({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})]})})}function lr(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e}})]})})}function ur(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Dialog",message:{cmd:"askDialog",title:t,message:e}})]})})}function sr(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Dialog",message:{cmd:"confirmDialog",title:t,message:e}})]})})}Object.freeze({__proto__:null,open:jn,save:ao,message:lr,ask:ur,confirm:sr});var Vt;function ar(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}}).then(function(i){return new TextDecoder().decode(new Uint8Array(i))})]})})}function Fn(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}})]})})}function cr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return typeof t=="object"&&Object.freeze(t),typeof e=="object"&&Object.freeze(e),[2,T({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:Array.from(new TextEncoder().encode(e.contents)),options:t}})]})})}function dr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return typeof t=="object"&&Object.freeze(t),typeof e=="object"&&Object.freeze(e),[2,T({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:Array.from(e.contents),options:t}})]})})}function co(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})]})})}function fr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})]})})}function pr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})]})})}function hr(e,t,n){return n===void 0&&(n={}),g(this,void 0,void 0,function(){return _(this,function(i){return[2,T({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})]})})}function mr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})]})})}function vr(e,t,n){return n===void 0&&(n={}),g(this,void 0,void 0,function(){return _(this,function(i){return[2,T({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})]})})}(function(e){e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Desktop=6]="Desktop",e[e.Document=7]="Document",e[e.Download=8]="Download",e[e.Executable=9]="Executable",e[e.Font=10]="Font",e[e.Home=11]="Home",e[e.Picture=12]="Picture",e[e.Public=13]="Public",e[e.Runtime=14]="Runtime",e[e.Template=15]="Template",e[e.Video=16]="Video",e[e.Resource=17]="Resource",e[e.App=18]="App",e[e.Log=19]="Log"})(Vt||(Vt={}));Object.freeze({__proto__:null,get BaseDirectory(){return Vt},get Dir(){return Vt},readTextFile:ar,readBinaryFile:Fn,writeFile:cr,writeBinaryFile:dr,readDir:co,createDir:fr,removeDir:pr,copyFile:hr,removeFile:mr,renameFile:vr});function gr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P,S,j,F;return{c(){t=s("div"),n=s("input"),i=v(),o=s("input"),l=v(),u=s("div"),c=s("input"),p=v(),h=s("label"),h.textContent="Multiple",f=v(),M=s("div"),m=s("input"),d=v(),b=s("label"),b.textContent="Directory",k=v(),y=s("button"),y.textContent="Open dialog",P=v(),S=s("button"),S.textContent="Open save dialog",a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(o,"id","dialog-filter"),a(o,"placeholder","Extensions filter, comma-separated"),a(o,"class","svelte-1eg58yg"),a(c,"type","checkbox"),a(c,"id","dialog-multiple"),a(h,"for","dialog-multiple"),a(m,"type","checkbox"),a(m,"id","dialog-directory"),a(b,"for","dialog-directory"),a(y,"class","button"),a(y,"id","open-dialog"),a(S,"class","button"),a(S,"id","save-dialog")},m(U,L){O(U,t,L),r(t,n),E(n,e[0]),r(t,i),r(t,o),E(o,e[1]),r(t,l),r(t,u),r(u,c),c.checked=e[2],r(u,p),r(u,h),r(t,f),r(t,M),r(M,m),m.checked=e[3],r(M,d),r(M,b),r(t,k),r(t,y),r(t,P),r(t,S),j||(F=[C(n,"input",e[8]),C(o,"input",e[9]),C(c,"change",e[10]),C(m,"change",e[11]),C(y,"click",e[4]),C(S,"click",e[5])],j=!0)},p(U,[L]){L&1&&n.value!==U[0]&&E(n,U[0]),L&2&&o.value!==U[1]&&E(o,U[1]),L&4&&(c.checked=U[2]),L&8&&(m.checked=U[3])},i:I,o:I,d(U){U&&W(t),j=!1,x(F)}}}function _r(e,t){var n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){var l=o.target.result;t(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function br(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:o}=t,l=null,u=null,c=!1,p=!1;function h(){jn({title:"My wonderful open dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(k=>k.trim())}]:[],multiple:c,directory:p}).then(function(k){if(Array.isArray(k))i(k);else{var y=k,P=y.match(/\S+\.\S+$/g);Fn(y).then(function(S){P&&(y.includes(".png")||y.includes(".jpg"))?_r(new Uint8Array(S),function(j){var F="data:image/png;base64,"+j;o('<img src="'+F+'"></img>')}):i(k)}).catch(i(k))}}).catch(i)}function f(){ao({title:"My wonderful save dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(k=>k.trim())}]:[]}).then(i).catch(i)}function M(){l=this.value,n(0,l)}function m(){u=this.value,n(1,u)}function d(){c=this.checked,n(2,c)}function b(){p=this.checked,n(3,p)}return e.$$set=k=>{"onMessage"in k&&n(6,i=k.onMessage),"insecureRenderHtml"in k&&n(7,o=k.insecureRenderHtml)},[l,u,c,p,h,f,i,o,M,m,d,b]}class yr extends X{constructor(t){super();Y(this,t,br,gr,$,{onMessage:6,insecureRenderHtml:7})}}function fo(e,t,n){const i=e.slice();return i[9]=t[n],i}function po(e){let t,n=e[9][0]+"",i,o;return{c(){t=s("option"),i=z(n),t.__value=o=e[9][1],t.value=t.__value},m(l,u){O(l,t,u),r(t,i)},p:I,d(l){l&&W(t)}}}function wr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b=e[2],k=[];for(let y=0;y<b.length;y+=1)k[y]=po(fo(e,b,y));return{c(){t=s("form"),n=s("select"),i=s("option"),i.textContent="None";for(let y=0;y<k.length;y+=1)k[y].c();o=v(),l=s("input"),u=v(),c=s("button"),c.textContent="Read",p=v(),h=s("button"),h.textContent="Use as img src",f=v(),M=s("img"),i.__value="",i.value=i.__value,a(n,"class","button"),a(n,"id","dir"),a(l,"id","path-to-read"),a(l,"placeholder","Type the path to read..."),a(c,"class","button"),a(c,"id","read"),a(h,"class","button"),a(h,"type","button"),a(M,"alt","file")},m(y,P){O(y,t,P),r(t,n),r(n,i);for(let S=0;S<k.length;S+=1)k[S].m(n,null);r(t,o),r(t,l),E(l,e[0]),r(t,u),r(t,c),r(t,p),r(t,h),r(t,f),r(t,M),e[8](M),m||(d=[C(l,"input",e[7]),C(h,"click",e[4]),C(t,"submit",Ye(e[3]))],m=!0)},p(y,[P]){if(P&4){b=y[2];let S;for(S=0;S<b.length;S+=1){const j=fo(y,b,S);k[S]?k[S].p(j,P):(k[S]=po(j),k[S].c(),k[S].m(n,null))}for(;S<k.length;S+=1)k[S].d(1);k.length=b.length}P&1&&l.value!==y[0]&&E(l,y[0])},i:I,o:I,d(y){y&&W(t),he(k,y),e[8](null),m=!1,x(d)}}}function ho(){return document.getElementById("dir").value?parseInt(dir.value):null}function Mr(e,t){const n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){const l=o.target.result;t(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function kr(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:o}=t,l="",u;const c=Object.keys(Vt).filter(m=>isNaN(parseInt(m))).map(m=>[m,Vt[m]]);function p(){const m=l.match(/\S+\.\S+$/g),d={dir:ho()};(m?Fn(l,d):co(l,d)).then(function(k){if(m)if(l.includes(".png")||l.includes(".jpg"))Mr(new Uint8Array(k),function(y){const P="data:image/png;base64,"+y;o('<img src="'+P+'"></img>')});else{const y=String.fromCharCode.apply(null,k);o('<textarea id="file-response" style="height: 400px"></textarea><button id="file-save">Save</button>'),setTimeout(()=>{const P=document.getElementById("file-response");P.value=y,document.getElementById("file-save").addEventListener("click",function(){writeFile({file:l,contents:P.value},{dir:ho()}).catch(i)})})}else i(k)}).catch(i)}function h(){n(1,u.src=xi(l),u)}function f(){l=this.value,n(0,l)}function M(m){Go[m?"unshift":"push"](()=>{u=m,n(1,u)})}return e.$$set=m=>{"onMessage"in m&&n(5,i=m.onMessage),"insecureRenderHtml"in m&&n(6,o=m.insecureRenderHtml)},[l,u,c,p,h,i,o,f,M]}class Tr extends X{constructor(t){super();Y(this,t,kr,wr,$,{onMessage:5,insecureRenderHtml:6})}}var ve;(function(e){e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary"})(ve||(ve={}));var Un=function(){function e(t,n){this.type=t,this.payload=n}return e.form=function(t){return new e("Form",t)},e.json=function(t){return new e("Json",t)},e.text=function(t){return new e("Text",t)},e.bytes=function(t){return new e("Bytes",t)},e}(),mo=function(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data},vo=function(){function e(t){this.id=t}return e.prototype.drop=function(){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},e.prototype.request=function(t){return g(this,void 0,void 0,function(){var n;return _(this,function(i){return(n=!t.responseType||t.responseType===ve.JSON)&&(t.responseType=ve.Text),[2,T({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then(function(o){var l=new mo(o);if(n){try{l.data=JSON.parse(l.data)}catch(u){if(l.ok&&l.data==="")l.data={};else if(l.ok)throw Error("Failed to parse response `".concat(l.data,"` as JSON: ").concat(u,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return l}return l})]})})},e.prototype.get=function(t,n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,this.request(ft({method:"GET",url:t},n))]})})},e.prototype.post=function(t,n,i){return g(this,void 0,void 0,function(){return _(this,function(o){return[2,this.request(ft({method:"POST",url:t,body:n},i))]})})},e.prototype.put=function(t,n,i){return g(this,void 0,void 0,function(){return _(this,function(o){return[2,this.request(ft({method:"PUT",url:t,body:n},i))]})})},e.prototype.patch=function(t,n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,this.request(ft({method:"PATCH",url:t},n))]})})},e.prototype.delete=function(t,n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,this.request(ft({method:"DELETE",url:t},n))]})})},e}();function Hn(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(function(n){return new vo(n)})]})})}var In=null;function Cr(e,t){var n;return g(this,void 0,void 0,function(){return _(this,function(i){switch(i.label){case 0:return In!==null?[3,2]:[4,Hn()];case 1:In=i.sent(),i.label=2;case 2:return[2,In.request(ft({url:e,method:(n=t==null?void 0:t.method)!==null&&n!==void 0?n:"GET"},t))]}})})}Object.freeze({__proto__:null,getClient:Hn,fetch:Cr,Body:Un,Client:vo,Response:mo,get ResponseType(){return ve}});function Sr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P;return{c(){t=s("form"),n=s("select"),i=s("option"),i.textContent="GET",o=s("option"),o.textContent="POST",l=s("option"),l.textContent="PUT",u=s("option"),u.textContent="PATCH",c=s("option"),c.textContent="DELETE",p=v(),h=s("input"),f=v(),M=s("br"),m=v(),d=s("textarea"),b=v(),k=s("button"),k.textContent="Make request",i.__value="GET",i.value=i.__value,o.__value="POST",o.value=o.__value,l.__value="PUT",l.value=l.__value,u.__value="PATCH",u.value=u.__value,c.__value="DELETE",c.value=c.__value,a(n,"class","button"),a(n,"id","request-method"),e[0]===void 0&&Ni(()=>e[5].call(n)),a(h,"id","request-url"),a(h,"placeholder","Type the request URL..."),a(d,"id","request-body"),a(d,"placeholder","Request body"),a(d,"rows","5"),dt(d,"width","100%"),dt(d,"margin-right","10px"),dt(d,"font-size","12px"),a(k,"class","button"),a(k,"id","make-request")},m(S,j){O(S,t,j),r(t,n),r(n,i),r(n,o),r(n,l),r(n,u),r(n,c),$e(n,e[0]),r(t,p),r(t,h),E(h,e[1]),r(t,f),r(t,M),r(t,m),r(t,d),E(d,e[2]),r(t,b),r(t,k),y||(P=[C(n,"change",e[5]),C(h,"input",e[6]),C(d,"input",e[7]),C(t,"submit",Ye(e[3]))],y=!0)},p(S,[j]){j&1&&$e(n,S[0]),j&2&&h.value!==S[1]&&E(h,S[1]),j&4&&E(d,S[2])},i:I,o:I,d(S){S&&W(t),y=!1,x(P)}}}function zr(e,t,n){let i="GET",o="https://jsonplaceholder.typicode.com/todos/1",l="",{onMessage:u}=t;async function c(){const M=await Hn().catch(k=>{throw u(k),k}),b={url:o||""||"",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?b.body=Un.json(JSON.parse(l)):l!==""&&(b.body=Un.text(l)),M.request(b).then(u).catch(u)}function p(){i=Bi(this),n(0,i)}function h(){o=this.value,n(1,o)}function f(){l=this.value,n(2,l)}return e.$$set=M=>{"onMessage"in M&&n(4,u=M.onMessage)},[i,o,l,c,u,p,h,f]}class Pr extends X{constructor(t){super();Y(this,t,zr,Sr,$,{onMessage:4})}}function Or(e){let t,n,i;return{c(){t=s("button"),t.textContent="Send test notification",a(t,"class","button"),a(t,"id","notification")},m(o,l){O(o,t,l),n||(i=C(t,"click",Wr),n=!0)},p:I,i:I,o:I,d(o){o&&W(t),n=!1,i()}}}function Wr(){new Notification("Notification title",{body:"This is the notification body"})}function Lr(e,t,n){let{onMessage:i}=t;return e.$$set=o=>{"onMessage"in o&&n(0,i=o.onMessage)},[i]}class Ar extends X{constructor(t){super();Y(this,t,Lr,Or,$,{onMessage:0})}}var Jt,Ze=function(e,t){this.type="Logical",this.width=e,this.height=t},Kt=function(){function e(t,n){this.type="Physical",this.width=t,this.height=n}return e.prototype.toLogical=function(t){return new Ze(this.width/t,this.height/t)},e}(),go=function(e,t){this.type="Logical",this.x=e,this.y=t},Xt=function(){function e(t,n){this.type="Physical",this.x=t,this.y=n}return e.prototype.toLogical=function(t){return new go(this.x/t,this.y/t)},e}();function Er(){return new ge(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function _o(){return window.__TAURI_METADATA__.__windows.map(function(e){return new ge(e.label,{skip:!0})})}(function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"})(Jt||(Jt={}));var bo=["tauri://created","tauri://error"],yo=function(){function e(t){this.label=t,this.listeners=Object.create(null)}return e.prototype.listen=function(t,n){return g(this,void 0,void 0,function(){var i=this;return _(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,At(t,n)]})})},e.prototype.once=function(t,n){return g(this,void 0,void 0,function(){var i=this;return _(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,Rn(t,n)]})})},e.prototype.emit=function(t,n){return g(this,void 0,void 0,function(){var i,o;return _(this,function(l){if(bo.includes(t)){for(i=0,o=this.listeners[t]||[];i<o.length;i++)(0,o[i])({event:t,id:-1,payload:n});return[2,Promise.resolve()]}return[2,uo(t,this.label,n)]})})},e.prototype._handleTauriEvent=function(t,n){return!!bo.includes(t)&&(t in this.listeners?this.listeners[t].push(n):this.listeners[t]=[n],!0)},e}(),wo=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return Ln(t,e),t.prototype.scaleFactor=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})]})})},t.prototype.innerPosition=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(function(i){var o=i.x,l=i.y;return new Xt(o,l)})]})})},t.prototype.outerPosition=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(function(i){var o=i.x,l=i.y;return new Xt(o,l)})]})})},t.prototype.innerSize=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(function(i){var o=i.width,l=i.height;return new Kt(o,l)})]})})},t.prototype.outerSize=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(function(i){var o=i.width,l=i.height;return new Kt(o,l)})]})})},t.prototype.isFullscreen=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})]})})},t.prototype.isMaximized=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})]})})},t.prototype.isDecorated=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})]})})},t.prototype.isResizable=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})]})})},t.prototype.isVisible=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})]})})},t.prototype.center=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})]})})},t.prototype.requestUserAttention=function(n){return g(this,void 0,void 0,function(){var i;return _(this,function(o){return i=null,n&&(i=n===Jt.Critical?{type:"Critical"}:{type:"Informational"}),[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:i}}}})]})})},t.prototype.setResizable=function(n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:n}}}})]})})},t.prototype.setTitle=function(n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:n}}}})]})})},t.prototype.maximize=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})]})})},t.prototype.unmaximize=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})]})})},t.prototype.toggleMaximize=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})]})})},t.prototype.minimize=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})]})})},t.prototype.unminimize=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})]})})},t.prototype.show=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})]})})},t.prototype.hide=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})]})})},t.prototype.close=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})]})})},t.prototype.setDecorations=function(n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:n}}}})]})})},t.prototype.setAlwaysOnTop=function(n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:n}}}})]})})},t.prototype.setSize=function(n){return g(this,void 0,void 0,function(){return _(this,function(i){if(!n||n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:n.type,data:{width:n.width,height:n.height}}}}}})]})})},t.prototype.setMinSize=function(n){return g(this,void 0,void 0,function(){return _(this,function(i){if(n&&n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:n?{type:n.type,data:{width:n.width,height:n.height}}:null}}}})]})})},t.prototype.setMaxSize=function(n){return g(this,void 0,void 0,function(){return _(this,function(i){if(n&&n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:n?{type:n.type,data:{width:n.width,height:n.height}}:null}}}})]})})},t.prototype.setPosition=function(n){return g(this,void 0,void 0,function(){return _(this,function(i){if(!n||n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:n.type,data:{x:n.x,y:n.y}}}}}})]})})},t.prototype.setFullscreen=function(n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:n}}}})]})})},t.prototype.setFocus=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})]})})},t.prototype.setIcon=function(n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:n}}}}})]})})},t.prototype.setSkipTaskbar=function(n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:n}}}})]})})},t.prototype.startDragging=function(){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})]})})},t}(yo),ge=function(e){function t(n,i){i===void 0&&(i={});var o=e.call(this,n)||this;return(i==null?void 0:i.skip)||T({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:ft({label:n},i)}}}).then(function(){return g(o,void 0,void 0,function(){return _(this,function(l){return[2,this.emit("tauri://created")]})})}).catch(function(l){return g(o,void 0,void 0,function(){return _(this,function(u){return[2,this.emit("tauri://error",l)]})})}),o}return Ln(t,e),t.getByLabel=function(n){return _o().some(function(i){return i.label===n})?new t(n,{skip:!0}):null},t}(wo),qn=new ge(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0});function Dr(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}})]})})}function Rr(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}})]})})}function jr(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}})]})})}Object.freeze({__proto__:null,WebviewWindow:ge,WebviewWindowHandle:yo,WindowManager:wo,getCurrent:Er,getAll:_o,appWindow:qn,LogicalSize:Ze,PhysicalSize:Kt,LogicalPosition:go,PhysicalPosition:Xt,get UserAttentionType(){return Jt},currentMonitor:Dr,primaryMonitor:Rr,availableMonitors:jr});function Mo(e,t,n){const i=e.slice();return i[54]=t[n],i}function ko(e){let t,n=e[54]+"",i,o;return{c(){t=s("option"),i=z(n),t.__value=o=e[54],t.value=t.__value},m(l,u){O(l,t,u),r(t,i)},p(l,u){u[0]&2&&n!==(n=l[54]+"")&&G(i,n),u[0]&2&&o!==(o=l[54])&&(t.__value=o,t.value=t.__value)},d(l){l&&W(t)}}}function Fr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P,S,j,F,U,L,H,N,tt,st,K,B,R,nt,D,Q,_e,be,Et,ye,Yt,et,pt,Dt,we,it,Me,Rt,ke,ot,Te,ht,jt,Ce,rt,Se,Ft,ze,lt,Pe,q,zt,Nn,mt,Bn,Oe,Gn,vt,Vn,Ut,We,Jn,at,Kn,Le,Xn,ct,xe,ut,Ht,gt,tn,Yn,$t,$n,Ae=e[20].width+"",en,Qn,Qt,Zn,Ee=e[20].height+"",nn,xn,_t,on,ti,Zt,ei,De=e[21].width+"",rn,ni,xt,ii,Re=e[21].height+"",ln,oi,It,bt,un,ri,te,li,je=e[20].toLogical(e[17]).width+"",sn,ui,ee,si,Fe=e[20].toLogical(e[17]).height+"",an,ai,yt,cn,ci,ne,di,Ue=e[21].toLogical(e[17]).width+"",dn,fi,ie,pi,He=e[21].toLogical(e[17]).height+"",fn,hi,qt,wt,pn,mi,oe,vi,Ie=e[18].x+"",hn,gi,re,_i,qe=e[18].y+"",mn,bi,Mt,vn,yi,le,wi,Ne=e[19].x+"",gn,Mi,ue,ki,Be=e[19].y+"",_n,Ti,Nt,kt,bn,Ci,se,Si,Ge=e[18].toLogical(e[17]).x+"",yn,zi,ae,Pi,Ve=e[18].toLogical(e[17]).y+"",wn,Oi,Tt,Mn,Wi,ce,Li,Je=e[19].toLogical(e[17]).x+"",kn,Ai,de,Ei,Ke=e[19].toLogical(e[17]).y+"",Tn,Cn,Ct,Pt,Di,fe,Sn,St,Ot,Ri,pe,zn,Wt,Pn,Bt,On,ji,Gt=Object.keys(e[1]),Z=[];for(let w=0;w<Gt.length;w+=1)Z[w]=ko(Mo(e,Gt,w));return{c(){t=s("div"),n=s("select");for(let w=0;w<Z.length;w+=1)Z[w].c();i=v(),o=s("div"),l=s("label"),u=s("input"),c=z(`
Resizable`),p=v(),h=s("label"),f=s("input"),M=z(`
Maximize`),m=v(),d=s("button"),d.textContent="Center",b=v(),k=s("button"),k.textContent="Minimize",y=v(),P=s("button"),P.textContent="Hide",S=v(),j=s("label"),F=s("input"),U=z(`
Transparent`),L=v(),H=s("label"),N=s("input"),tt=z(`
Has decorations`),st=v(),K=s("label"),B=s("input"),R=z(`
Always on top`),nt=v(),D=s("label"),Q=s("input"),_e=z(`
Fullscreen`),be=v(),Et=s("button"),Et.textContent="Change icon",ye=v(),Yt=s("div"),et=s("div"),pt=s("div"),Dt=s("div"),we=z(`X
`),it=s("input"),Me=v(),Rt=s("div"),ke=z(`Y
`),ot=s("input"),Te=v(),ht=s("div"),jt=s("div"),Ce=z(`Width
`),rt=s("input"),Se=v(),Ft=s("div"),ze=z(`Height
`),lt=s("input"),Pe=v(),q=s("div"),zt=s("div"),Nn=z(`Min width
`),mt=s("input"),Bn=v(),Oe=s("div"),Gn=z(`Min height
`),vt=s("input"),Vn=v(),Ut=s("div"),We=s("div"),Jn=z(`Max width
`),at=s("input"),Kn=v(),Le=s("div"),Xn=z(`Max height
`),ct=s("input"),xe=v(),ut=s("div"),Ht=s("div"),gt=s("div"),tn=s("div"),tn.textContent="Inner Size",Yn=v(),$t=s("span"),$n=z("Width: "),en=z(Ae),Qn=v(),Qt=s("span"),Zn=z("Height: "),nn=z(Ee),xn=v(),_t=s("div"),on=s("div"),on.textContent="Outer Size",ti=v(),Zt=s("span"),ei=z("Width: "),rn=z(De),ni=v(),xt=s("span"),ii=z("Height: "),ln=z(Re),oi=v(),It=s("div"),bt=s("div"),un=s("div"),un.textContent="Inner Logical Size",ri=v(),te=s("span"),li=z("Width: "),sn=z(je),ui=v(),ee=s("span"),si=z("Height: "),an=z(Fe),ai=v(),yt=s("div"),cn=s("div"),cn.textContent="Outer Logical Size",ci=v(),ne=s("span"),di=z("Width: "),dn=z(Ue),fi=v(),ie=s("span"),pi=z("Height: "),fn=z(He),hi=v(),qt=s("div"),wt=s("div"),pn=s("div"),pn.textContent="Inner Position",mi=v(),oe=s("span"),vi=z("x: "),hn=z(Ie),gi=v(),re=s("span"),_i=z("y: "),mn=z(qe),bi=v(),Mt=s("div"),vn=s("div"),vn.textContent="Outer Position",yi=v(),le=s("span"),wi=z("x: "),gn=z(Ne),Mi=v(),ue=s("span"),ki=z("y: "),_n=z(Be),Ti=v(),Nt=s("div"),kt=s("div"),bn=s("div"),bn.textContent="Inner Logical Position",Ci=v(),se=s("span"),Si=z("x: "),yn=z(Ge),zi=v(),ae=s("span"),Pi=z("y: "),wn=z(Ve),Oi=v(),Tt=s("div"),Mn=s("div"),Mn.textContent="Outer Logical Position",Wi=v(),ce=s("span"),Li=z("x: "),kn=z(Je),Ai=v(),de=s("span"),Ei=z("y: "),Tn=z(Ke),Cn=v(),Ct=s("form"),Pt=s("input"),Di=v(),fe=s("button"),fe.textContent="Set title",Sn=v(),St=s("form"),Ot=s("input"),Ri=v(),pe=s("button"),pe.textContent="Open URL",zn=v(),Wt=s("button"),Wt.textContent="Request attention",Pn=v(),Bt=s("button"),Bt.textContent="New window",a(n,"class","button"),e[0]===void 0&&Ni(()=>e[31].call(n)),a(u,"type","checkbox"),a(f,"type","checkbox"),a(d,"title","Unminimizes after 2 seconds"),a(k,"title","Unminimizes after 2 seconds"),a(P,"title","Visible again after 2 seconds"),a(F,"type","checkbox"),a(N,"type","checkbox"),a(B,"type","checkbox"),a(Q,"type","checkbox"),a(it,"type","number"),a(it,"min","0"),a(it,"class","svelte-12ggtr4"),a(ot,"type","number"),a(ot,"min","0"),a(ot,"class","svelte-12ggtr4"),a(pt,"class","flex col grow svelte-12ggtr4"),a(rt,"type","number"),a(rt,"min","400"),a(rt,"class","svelte-12ggtr4"),a(lt,"type","number"),a(lt,"min","400"),a(lt,"class","svelte-12ggtr4"),a(ht,"class","flex col grow svelte-12ggtr4"),a(mt,"type","number"),a(mt,"class","svelte-12ggtr4"),a(vt,"type","number"),a(vt,"class","svelte-12ggtr4"),a(q,"class","flex col grow svelte-12ggtr4"),a(at,"type","number"),a(at,"min","400"),a(at,"class","svelte-12ggtr4"),a(ct,"type","number"),a(ct,"min","400"),a(ct,"class","svelte-12ggtr4"),a(Ut,"class","flex col grow svelte-12ggtr4"),a(et,"class","window-controls flex flex-row svelte-12ggtr4"),a(t,"class","flex col"),a($t,"class","svelte-12ggtr4"),a(Qt,"class","svelte-12ggtr4"),a(gt,"class","grow window-property svelte-12ggtr4"),a(Zt,"class","svelte-12ggtr4"),a(xt,"class","svelte-12ggtr4"),a(_t,"class","grow window-property svelte-12ggtr4"),a(Ht,"class","flex"),a(te,"class","svelte-12ggtr4"),a(ee,"class","svelte-12ggtr4"),a(bt,"class","grow window-property svelte-12ggtr4"),a(ne,"class","svelte-12ggtr4"),a(ie,"class","svelte-12ggtr4"),a(yt,"class","grow window-property svelte-12ggtr4"),a(It,"class","flex"),a(oe,"class","svelte-12ggtr4"),a(re,"class","svelte-12ggtr4"),a(wt,"class","grow window-property svelte-12ggtr4"),a(le,"class","svelte-12ggtr4"),a(ue,"class","svelte-12ggtr4"),a(Mt,"class","grow window-property svelte-12ggtr4"),a(qt,"class","flex"),a(se,"class","svelte-12ggtr4"),a(ae,"class","svelte-12ggtr4"),a(kt,"class","grow window-property svelte-12ggtr4"),a(ce,"class","svelte-12ggtr4"),a(de,"class","svelte-12ggtr4"),a(Tt,"class","grow window-property svelte-12ggtr4"),a(Nt,"class","flex"),a(Pt,"id","title"),a(fe,"class","button"),a(fe,"type","submit"),dt(Ct,"margin-top","24px"),a(Ot,"id","url"),a(pe,"class","button"),a(pe,"id","open-url"),dt(St,"margin-top","24px"),a(Wt,"class","button"),a(Wt,"title","Minimizes the window, requests attention for 3s and then resets it"),a(Bt,"class","button")},m(w,A){O(w,t,A),r(t,n);for(let V=0;V<Z.length;V+=1)Z[V].m(n,null);$e(n,e[0]),r(t,i),r(t,o),r(o,l),r(l,u),u.checked=e[2],r(l,c),r(o,p),r(o,h),r(h,f),f.checked=e[3],r(h,M),r(o,m),r(o,d),r(o,b),r(o,k),r(o,y),r(o,P),r(o,S),r(o,j),r(j,F),F.checked=e[16],r(j,U),r(o,L),r(o,H),r(H,N),N.checked=e[4],r(H,tt),r(o,st),r(o,K),r(K,B),B.checked=e[5],r(K,R),r(o,nt),r(o,D),r(D,Q),Q.checked=e[6],r(D,_e),r(o,be),r(o,Et),r(t,ye),r(t,Yt),r(Yt,et),r(et,pt),r(pt,Dt),r(Dt,we),r(Dt,it),E(it,e[13]),r(pt,Me),r(pt,Rt),r(Rt,ke),r(Rt,ot),E(ot,e[14]),r(et,Te),r(et,ht),r(ht,jt),r(jt,Ce),r(jt,rt),E(rt,e[7]),r(ht,Se),r(ht,Ft),r(Ft,ze),r(Ft,lt),E(lt,e[8]),r(et,Pe),r(et,q),r(q,zt),r(zt,Nn),r(zt,mt),E(mt,e[9]),r(q,Bn),r(q,Oe),r(Oe,Gn),r(Oe,vt),E(vt,e[10]),r(et,Vn),r(et,Ut),r(Ut,We),r(We,Jn),r(We,at),E(at,e[11]),r(Ut,Kn),r(Ut,Le),r(Le,Xn),r(Le,ct),E(ct,e[12]),O(w,xe,A),O(w,ut,A),r(ut,Ht),r(Ht,gt),r(gt,tn),r(gt,Yn),r(gt,$t),r($t,$n),r($t,en),r(gt,Qn),r(gt,Qt),r(Qt,Zn),r(Qt,nn),r(Ht,xn),r(Ht,_t),r(_t,on),r(_t,ti),r(_t,Zt),r(Zt,ei),r(Zt,rn),r(_t,ni),r(_t,xt),r(xt,ii),r(xt,ln),r(ut,oi),r(ut,It),r(It,bt),r(bt,un),r(bt,ri),r(bt,te),r(te,li),r(te,sn),r(bt,ui),r(bt,ee),r(ee,si),r(ee,an),r(It,ai),r(It,yt),r(yt,cn),r(yt,ci),r(yt,ne),r(ne,di),r(ne,dn),r(yt,fi),r(yt,ie),r(ie,pi),r(ie,fn),r(ut,hi),r(ut,qt),r(qt,wt),r(wt,pn),r(wt,mi),r(wt,oe),r(oe,vi),r(oe,hn),r(wt,gi),r(wt,re),r(re,_i),r(re,mn),r(qt,bi),r(qt,Mt),r(Mt,vn),r(Mt,yi),r(Mt,le),r(le,wi),r(le,gn),r(Mt,Mi),r(Mt,ue),r(ue,ki),r(ue,_n),r(ut,Ti),r(ut,Nt),r(Nt,kt),r(kt,bn),r(kt,Ci),r(kt,se),r(se,Si),r(se,yn),r(kt,zi),r(kt,ae),r(ae,Pi),r(ae,wn),r(Nt,Oi),r(Nt,Tt),r(Tt,Mn),r(Tt,Wi),r(Tt,ce),r(ce,Li),r(ce,kn),r(Tt,Ai),r(Tt,de),r(de,Ei),r(de,Tn),O(w,Cn,A),O(w,Ct,A),r(Ct,Pt),E(Pt,e[22]),r(Ct,Di),r(Ct,fe),O(w,Sn,A),O(w,St,A),r(St,Ot),E(Ot,e[15]),r(St,Ri),r(St,pe),O(w,zn,A),O(w,Wt,A),O(w,Pn,A),O(w,Bt,A),On||(ji=[C(n,"change",e[31]),C(u,"change",e[32]),C(f,"change",e[33]),C(d,"click",e[34]),C(k,"click",e[26]),C(P,"click",e[25]),C(F,"change",e[35]),C(N,"change",e[36]),C(B,"change",e[37]),C(Q,"change",e[38]),C(Et,"click",e[27]),C(it,"input",e[39]),C(ot,"input",e[40]),C(rt,"input",e[41]),C(lt,"input",e[42]),C(mt,"input",e[43]),C(vt,"input",e[44]),C(at,"input",e[45]),C(ct,"input",e[46]),C(Pt,"input",e[47]),C(Ct,"submit",Ye(e[24])),C(Ot,"input",e[48]),C(St,"submit",Ye(e[23])),C(Wt,"click",e[29]),C(Bt,"click",e[28])],On=!0)},p(w,A){if(A[0]&2){Gt=Object.keys(w[1]);let V;for(V=0;V<Gt.length;V+=1){const Fi=Mo(w,Gt,V);Z[V]?Z[V].p(Fi,A):(Z[V]=ko(Fi),Z[V].c(),Z[V].m(n,null))}for(;V<Z.length;V+=1)Z[V].d(1);Z.length=Gt.length}A[0]&3&&$e(n,w[0]),A[0]&4&&(u.checked=w[2]),A[0]&8&&(f.checked=w[3]),A[0]&65536&&(F.checked=w[16]),A[0]&16&&(N.checked=w[4]),A[0]&32&&(B.checked=w[5]),A[0]&64&&(Q.checked=w[6]),A[0]&8192&&J(it.value)!==w[13]&&E(it,w[13]),A[0]&16384&&J(ot.value)!==w[14]&&E(ot,w[14]),A[0]&128&&J(rt.value)!==w[7]&&E(rt,w[7]),A[0]&256&&J(lt.value)!==w[8]&&E(lt,w[8]),A[0]&512&&J(mt.value)!==w[9]&&E(mt,w[9]),A[0]&1024&&J(vt.value)!==w[10]&&E(vt,w[10]),A[0]&2048&&J(at.value)!==w[11]&&E(at,w[11]),A[0]&4096&&J(ct.value)!==w[12]&&E(ct,w[12]),A[0]&1048576&&Ae!==(Ae=w[20].width+"")&&G(en,Ae),A[0]&1048576&&Ee!==(Ee=w[20].height+"")&&G(nn,Ee),A[0]&2097152&&De!==(De=w[21].width+"")&&G(rn,De),A[0]&2097152&&Re!==(Re=w[21].height+"")&&G(ln,Re),A[0]&1179648&&je!==(je=w[20].toLogical(w[17]).width+"")&&G(sn,je),A[0]&1179648&&Fe!==(Fe=w[20].toLogical(w[17]).height+"")&&G(an,Fe),A[0]&2228224&&Ue!==(Ue=w[21].toLogical(w[17]).width+"")&&G(dn,Ue),A[0]&2228224&&He!==(He=w[21].toLogical(w[17]).height+"")&&G(fn,He),A[0]&262144&&Ie!==(Ie=w[18].x+"")&&G(hn,Ie),A[0]&262144&&qe!==(qe=w[18].y+"")&&G(mn,qe),A[0]&524288&&Ne!==(Ne=w[19].x+"")&&G(gn,Ne),A[0]&524288&&Be!==(Be=w[19].y+"")&&G(_n,Be),A[0]&393216&&Ge!==(Ge=w[18].toLogical(w[17]).x+"")&&G(yn,Ge),A[0]&393216&&Ve!==(Ve=w[18].toLogical(w[17]).y+"")&&G(wn,Ve),A[0]&655360&&Je!==(Je=w[19].toLogical(w[17]).x+"")&&G(kn,Je),A[0]&655360&&Ke!==(Ke=w[19].toLogical(w[17]).y+"")&&G(Tn,Ke),A[0]&4194304&&Pt.value!==w[22]&&E(Pt,w[22]),A[0]&32768&&Ot.value!==w[15]&&E(Ot,w[15])},i:I,o:I,d(w){w&&W(t),he(Z,w),w&&W(xe),w&&W(ut),w&&W(Cn),w&&W(Ct),w&&W(Sn),w&&W(St),w&&W(zn),w&&W(Wt),w&&W(Pn),w&&W(Bt),On=!1,x(ji)}}}function Ur(e,t,n){window.UserAttentionType=Jt;let i=qn.label;const o={[i]:qn};let{onMessage:l}=t,u="https://tauri.studio",c=!0,p=!1,h=!1,f=!0,M=!1,m=!1,d=900,b=700,k=600,y=600,P=null,S=null,j=100,F=100,U=1,L=new Xt(j,F),H=new Xt(j,F),N=new Kt(d,b),tt=new Kt(d,b),st,K,B="Awesome Tauri Example!";function R(){En(u)}function nt(){o[i].setTitle(B)}function D(){o[i].hide(),setTimeout(o[i].show,2e3)}function Q(){o[i].minimize(),setTimeout(o[i].unminimize,2e3)}function _e(){jn({multiple:!1}).then(q=>{q&&o[i].setIcon(q)})}function be(){const q=Math.random().toString().replace(".",""),zt=new ge(q);n(1,o[q]=zt,o),zt.once("tauri://error",function(){l("Error creating new webview")})}function Et(){o[i].innerSize().then(q=>{n(20,N=q),n(7,d=N.width),n(8,b=N.height)}),o[i].outerSize().then(q=>{n(21,tt=q)})}function ye(){o[i].innerPosition().then(q=>{n(18,L=q)}),o[i].outerPosition().then(q=>{n(19,H=q),n(13,j=H.x),n(14,F=H.y)})}async function Yt(q){st&&st(),K&&K(),K=await q.listen("tauri://move",ye),st=await q.listen("tauri://resize",Et)}async function et(){await o[i].minimize(),await o[i].requestUserAttention(Jt.Critical),await new Promise(q=>setTimeout(q,3e3)),await o[i].requestUserAttention(null)}function pt(){i=Bi(this),n(0,i),n(1,o)}function Dt(){c=this.checked,n(2,c)}function we(){p=this.checked,n(3,p)}const it=()=>o[i].center();function Me(){h=this.checked,n(16,h)}function Rt(){f=this.checked,n(4,f)}function ke(){M=this.checked,n(5,M)}function ot(){m=this.checked,n(6,m)}function Te(){j=J(this.value),n(13,j)}function ht(){F=J(this.value),n(14,F)}function jt(){d=J(this.value),n(7,d)}function Ce(){b=J(this.value),n(8,b)}function rt(){k=J(this.value),n(9,k)}function Se(){y=J(this.value),n(10,y)}function Ft(){P=J(this.value),n(11,P)}function ze(){S=J(this.value),n(12,S)}function lt(){B=this.value,n(22,B)}function Pe(){u=this.value,n(15,u)}return e.$$set=q=>{"onMessage"in q&&n(30,l=q.onMessage)},e.$$.update=()=>{e.$$.dirty[0]&7&&o[i].setResizable(c),e.$$.dirty[0]&11&&(p?o[i].maximize():o[i].unmaximize()),e.$$.dirty[0]&19&&o[i].setDecorations(f),e.$$.dirty[0]&35&&o[i].setAlwaysOnTop(M),e.$$.dirty[0]&67&&o[i].setFullscreen(m),e.$$.dirty[0]&387&&o[i].setSize(new Kt(d,b)),e.$$.dirty[0]&1539&&(k&&y?o[i].setMinSize(new Ze(k,y)):o[i].setMinSize(null)),e.$$.dirty[0]&6147&&(P&&S?o[i].setMaxSize(new Ze(P,S)):o[i].setMaxSize(null)),e.$$.dirty[0]&24579&&o[i].setPosition(new Xt(j,F)),e.$$.dirty[0]&3&&o[i].scaleFactor().then(q=>n(17,U=q)),e.$$.dirty[0]&3&&Yt(o[i])},[i,o,c,p,f,M,m,d,b,k,y,P,S,j,F,u,h,U,L,H,N,tt,B,R,nt,D,Q,_e,be,et,l,pt,Dt,we,it,Me,Rt,ke,ot,Te,ht,jt,Ce,rt,Se,Ft,ze,lt,Pe]}class Hr extends X{constructor(t){super();Y(this,t,Ur,Fr,$,{onMessage:30},[-1,-1])}}function To(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:Lt(t)}})]})})}function Ir(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:Lt(t)}})]})})}function qr(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})]})})}function Co(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})]})})}function So(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:To,registerAll:Ir,isRegistered:qr,unregister:Co,unregisterAll:So});function zo(e,t,n){const i=e.slice();return i[9]=t[n],i}function Po(e){let t,n=e[9]+"",i,o,l,u,c;function p(){return e[8](e[9])}return{c(){t=s("div"),i=z(n),o=v(),l=s("button"),l.textContent="Unregister",a(l,"type","button")},m(h,f){O(h,t,f),r(t,i),r(t,o),r(t,l),u||(c=C(l,"click",p),u=!0)},p(h,f){e=h,f&2&&n!==(n=e[9]+"")&&G(i,n)},d(h){h&&W(t),u=!1,c()}}}function Oo(e){let t,n,i;return{c(){t=s("button"),t.textContent="Unregister all",a(t,"type","button")},m(o,l){O(o,t,l),n||(i=C(t,"click",e[5]),n=!0)},p:I,d(o){o&&W(t),n=!1,i()}}}function Nr(e){let t,n,i,o,l,u,c,p,h,f,M=e[1],m=[];for(let b=0;b<M.length;b+=1)m[b]=Po(zo(e,M,b));let d=e[1].length&&Oo(e);return{c(){t=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="Register",u=v(),c=s("div");for(let b=0;b<m.length;b+=1)m[b].c();p=v(),d&&d.c(),a(i,"placeholder","Type a shortcut with '+' as separator..."),a(l,"type","button")},m(b,k){O(b,t,k),r(t,n),r(n,i),E(i,e[0]),r(n,o),r(n,l),r(t,u),r(t,c);for(let y=0;y<m.length;y+=1)m[y].m(c,null);r(c,p),d&&d.m(c,null),h||(f=[C(i,"input",e[7]),C(l,"click",e[3])],h=!0)},p(b,[k]){if(k&1&&i.value!==b[0]&&E(i,b[0]),k&18){M=b[1];let y;for(y=0;y<M.length;y+=1){const P=zo(b,M,y);m[y]?m[y].p(P,k):(m[y]=Po(P),m[y].c(),m[y].m(c,p))}for(;y<m.length;y+=1)m[y].d(1);m.length=M.length}b[1].length?d?d.p(b,k):(d=Oo(b),d.c(),d.m(c,null)):d&&(d.d(1),d=null)},i:I,o:I,d(b){b&&W(t),he(m,b),d&&d.d(),h=!1,x(f)}}}function Br(e,t,n){let i,{onMessage:o}=t;const l=Vi([]);Gi(e,l,m=>n(1,i=m));let u="CmdOrControl+X";function c(){const m=u;To(m,()=>{o(`Shortcut ${m} triggered`)}).then(()=>{l.update(d=>[...d,m]),o(`Shortcut ${m} registered successfully`)}).catch(o)}function p(m){const d=m;Co(d).then(()=>{l.update(b=>b.filter(k=>k!==d)),o(`Shortcut ${d} unregistered`)}).catch(o)}function h(){So().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function f(){u=this.value,n(0,u)}const M=m=>p(m);return e.$$set=m=>{"onMessage"in m&&n(6,o=m.onMessage)},[u,i,l,c,p,h,o,f,M]}class Gr extends X{constructor(t){super();Y(this,t,Br,Nr,$,{onMessage:6})}}function Wo(e){let t,n,i,o,l;return{c(){t=s("input"),n=v(),i=s("button"),i.textContent="Write",a(t,"placeholder","write to stdin"),a(i,"class","button")},m(u,c){O(u,t,c),E(t,e[3]),O(u,n,c),O(u,i,c),o||(l=[C(t,"input",e[10]),C(i,"click",e[7])],o=!0)},p(u,c){c&8&&t.value!==u[3]&&E(t,u[3])},d(u){u&&W(t),u&&W(n),u&&W(i),o=!1,x(l)}}}function Vr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y=e[4]&&Wo(e);return{c(){t=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="Run",u=v(),c=s("button"),c.textContent="Kill",p=v(),y&&y.c(),h=v(),f=s("div"),M=s("input"),m=v(),d=s("input"),a(l,"class","button"),a(c,"class","button"),a(M,"placeholder","Working directory"),a(d,"placeholder","Environment variables"),dt(d,"width","300px")},m(P,S){O(P,t,S),r(t,n),r(n,i),E(i,e[0]),r(n,o),r(n,l),r(n,u),r(n,c),r(n,p),y&&y.m(n,null),r(t,h),r(t,f),r(f,M),E(M,e[1]),r(f,m),r(f,d),E(d,e[2]),b||(k=[C(i,"input",e[9]),C(l,"click",e[5]),C(c,"click",e[6]),C(M,"input",e[11]),C(d,"input",e[12])],b=!0)},p(P,[S]){S&1&&i.value!==P[0]&&E(i,P[0]),P[4]?y?y.p(P,S):(y=Wo(P),y.c(),y.m(n,null)):y&&(y.d(1),y=null),S&2&&M.value!==P[1]&&E(M,P[1]),S&4&&d.value!==P[2]&&E(d,P[2])},i:I,o:I,d(P){P&&W(t),y&&y.d(),b=!1,x(k)}}}function Jr(e,t,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:u}=t,c='echo "hello world"',p=null,h="SOMETHING=value ANOTHER=2",f="",M;function m(){return h.split(" ").reduce((F,U)=>{let[L,H]=U.split("=");return qi(Ii({},F),{[L]:H})},{})}function d(){n(4,M=null);const F=new eo(o,[...l,c],{cwd:p||null,env:m()});F.on("close",U=>{u(`command finished with code ${U.code} and signal ${U.signal}`),n(4,M=null)}),F.on("error",U=>u(`command error: "${U}"`)),F.stdout.on("data",U=>u(`command stdout: "${U}"`)),F.stderr.on("data",U=>u(`command stderr: "${U}"`)),F.spawn().then(U=>{n(4,M=U)}).catch(u)}function b(){M.kill().then(()=>u("killed child process")).catch(u)}function k(){M.write(f).catch(u)}function y(){c=this.value,n(0,c)}function P(){f=this.value,n(3,f)}function S(){p=this.value,n(1,p)}function j(){h=this.value,n(2,h)}return e.$$set=F=>{"onMessage"in F&&n(8,u=F.onMessage)},[c,p,h,f,M,d,b,k,u,y,P,S,j]}class Kr extends X{constructor(t){super();Y(this,t,Jr,Vr,$,{onMessage:8})}}function Lo(){return g(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return _(this,function(n){return[2,new Promise(function(i,o){At("tauri://update-status",function(l){var u;(u=l==null?void 0:l.payload).error?(e(),o(u.error)):u.status==="DONE"&&(e(),i())}).then(function(l){t=l}).catch(function(l){throw e(),l}),Qe("tauri://update-install").catch(function(l){throw e(),l})})]})})}function Ao(){return g(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return _(this,function(n){return[2,new Promise(function(i,o){Rn("tauri://update-available",function(l){var u;u=l==null?void 0:l.payload,e(),i({manifest:u,shouldUpdate:!0})}).catch(function(l){throw e(),l}),At("tauri://update-status",function(l){var u;(u=l==null?void 0:l.payload).error?(e(),o(u.error)):u.status==="UPTODATE"&&(e(),i({shouldUpdate:!1}))}).then(function(l){t=l}).catch(function(l){throw e(),l}),Qe("tauri://update").catch(function(l){throw e(),l})})]})})}Object.freeze({__proto__:null,installUpdate:Lo,checkUpdate:Ao});function Xr(e){let t,n,i,o,l,u;return{c(){t=s("div"),n=s("button"),n.textContent="Check update",i=v(),o=s("button"),o.textContent="Install update",a(n,"class","button"),a(n,"id","check_update"),a(o,"class","button hidden"),a(o,"id","start_update")},m(c,p){O(c,t,p),r(t,n),r(t,i),r(t,o),l||(u=[C(n,"click",e[0]),C(o,"click",e[1])],l=!0)},p:I,i:I,o:I,d(c){c&&W(t),l=!1,x(u)}}}function Yr(e,t,n){let{onMessage:i}=t,o;Xe(async()=>{o=await At("tauri://update-status",i)}),Wn(()=>{o&&o()});async function l(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:c,manifest:p}=await Ao();i(`Should update: ${c}`),i(p),c&&document.getElementById("start_update").classList.remove("hidden")}catch(c){i(c)}}async function u(){try{document.getElementById("start_update").classList.add("hidden"),await Lo(),i("Installation complete, restart required."),await Dn()}catch(c){i(c)}}return e.$$set=c=>{"onMessage"in c&&n(2,i=c.onMessage)},[l,u,i]}class $r extends X{constructor(t){super();Y(this,t,Yr,Xr,$,{onMessage:2})}}function Eo(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})]})})}function Do(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"Clipboard",message:{cmd:"readText"}})]})})}Object.freeze({__proto__:null,writeText:Eo,readText:Do});function Qr(e){let t,n,i,o,l,u,c,p,h;return{c(){t=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="Write",u=v(),c=s("button"),c.textContent="Read",a(i,"placeholder","Text to write to the clipboard"),a(l,"type","button"),a(c,"type","button")},m(f,M){O(f,t,M),r(t,n),r(n,i),E(i,e[0]),r(n,o),r(n,l),r(t,u),r(t,c),p||(h=[C(i,"input",e[4]),C(l,"click",e[1]),C(c,"click",e[2])],p=!0)},p(f,[M]){M&1&&i.value!==f[0]&&E(i,f[0])},i:I,o:I,d(f){f&&W(t),p=!1,x(h)}}}function Zr(e,t,n){let{onMessage:i}=t,o="clipboard message";function l(){Eo(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){Do().then(p=>{i(`Clipboard contents: ${p}`)}).catch(i)}function c(){o=this.value,n(0,o)}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[o,l,u,i,c]}class xr extends X{constructor(t){super();Y(this,t,Zr,Qr,$,{onMessage:3})}}function tl(e){let t;return{c(){t=s("div"),t.innerHTML=`<div class="alert"><p>Not available for Linux</p></div>
<video id="localVideo" autoplay="" playsinline=""><track kind="captions"/></video>`},m(n,i){O(n,t,i)},p:I,i:I,o:I,d(n){n&&W(t)}}}function el(e,t,n){let{onMessage:i}=t;const o=window.constraints={audio:!0,video:!0};function l(c){const p=document.querySelector("video"),h=c.getVideoTracks();i("Got stream with constraints:",o),i(`Using video device: ${h[0].label}`),window.stream=c,p.srcObject=c}function u(c){if(c.name==="ConstraintNotSatisfiedError"){const p=o.video;i(`The resolution ${p.width.exact}x${p.height.exact} px is not supported by your device.`)}else c.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${c.name}`,c)}return Xe(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(o);l(c)}catch(c){u(c)}}),Wn(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),e.$$set=c=>{"onMessage"in c&&n(0,i=c.onMessage)},[i]}class nl extends X{constructor(t){super();Y(this,t,el,tl,$,{onMessage:0})}}function il(e){let t,n,i,o,l,u,c,p,h,f,M,m;return{c(){t=s("input"),n=v(),i=s("input"),o=v(),l=s("button"),l.textContent="Post it.",u=v(),c=s("p"),c.textContent="Result:",p=v(),h=s("pre"),f=z(e[2]),a(l,"type","button")},m(d,b){O(d,t,b),E(t,e[0]),O(d,n,b),O(d,i,b),E(i,e[1]),O(d,o,b),O(d,l,b),O(d,u,b),O(d,c,b),O(d,p,b),O(d,h,b),r(h,f),M||(m=[C(t,"input",e[4]),C(i,"input",e[5]),C(l,"click",e[3])],M=!0)},p(d,[b]){b&1&&t.value!==d[0]&&E(t,d[0]),b&2&&i.value!==d[1]&&E(i,d[1]),b&4&&G(f,d[2])},i:I,o:I,d(d){d&&W(t),d&&W(n),d&&W(i),d&&W(o),d&&W(l),d&&W(u),d&&W(c),d&&W(p),d&&W(h),M=!1,x(m)}}}function ol(e,t,n){let i="baz",o="qux",l=null;async function u(){let h=navigator.userAgent.includes("Windows")?"https://customprotocol.test/example.html":"customprotocol://test/example.html";const M=await(await fetch(h,{method:"POST",body:JSON.stringify({foo:i,bar:o})})).json();n(2,l=JSON.stringify(M))}function c(){i=this.value,n(0,i)}function p(){o=this.value,n(1,o)}return[i,o,l,u,c,p]}class rl extends X{constructor(t){super();Y(this,t,ol,il,$,{})}}function Ro(e,t,n){const i=e.slice();return i[10]=t[n],i}function jo(e,t,n){const i=e.slice();return i[13]=t[n],i}function Fo(e){let t,n=e[13].label+"",i,o,l,u,c;function p(){return e[9](e[13])}return{c(){t=s("p"),i=z(n),o=v(),a(t,"class",l="nv noselect "+(e[0]===e[13]?"nv_selected":""))},m(h,f){O(h,t,f),r(t,i),r(t,o),u||(c=C(t,"click",p),u=!0)},p(h,f){e=h,f&1&&l!==(l="nv noselect "+(e[0]===e[13]?"nv_selected":""))&&a(t,"class",l)},d(h){h&&W(t),u=!1,c()}}}function ll(e){let t,n=e[10].html+"",i;return{c(){i=Ji(),t=new Xo(i)},m(o,l){t.m(n,o,l),O(o,i,l)},p(o,l){l&2&&n!==(n=o[10].html+"")&&t.p(n)},d(o){o&&W(i),o&&t.d()}}}function ul(e){let t,n=e[10].text+"",i;return{c(){t=s("p"),i=z(n)},m(o,l){O(o,t,l),r(t,i)},p(o,l){l&2&&n!==(n=o[10].text+"")&&G(i,n)},d(o){o&&W(t)}}}function Uo(e){let t;function n(l,u){return l[10].text?ul:ll}let i=n(e),o=i(e);return{c(){o.c(),t=Ji()},m(l,u){o.m(l,u),O(l,t,u)},p(l,u){i===(i=n(l))&&o?o.p(l,u):(o.d(1),o=i(l),o&&(o.c(),o.m(t.parentNode,t)))},d(l){o.d(l),l&&W(t)}}}function sl(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P,S,j,F,U,L,H=e[2],N=[];for(let R=0;R<H.length;R+=1)N[R]=Fo(jo(e,H,R));var tt=e[0].component;function st(R){return{props:{onMessage:R[5],insecureRenderHtml:R[6]}}}tt&&(m=new tt(st(e)));let K=e[1],B=[];for(let R=0;R<K.length;R+=1)B[R]=Uo(Ro(e,K,R));return{c(){t=s("main"),n=s("div"),i=s("img"),l=v(),u=s("div"),u.innerHTML=`<a class="dark-link" target="_blank" href="https://tauri.studio/en/docs/get-started/intro">Documentation</a>
<a class="dark-link" target="_blank" href="https://github.com/tauri-apps/tauri">Github</a>
<a class="dark-link" target="_blank" href="https://github.com/tauri-apps/tauri/tree/dev/tauri/examples/api">Source</a>`,c=v(),p=s("div"),h=s("div");for(let R=0;R<N.length;R+=1)N[R].c();f=v(),M=s("div"),m&&Ki(m.$$.fragment),d=v(),b=s("div"),k=s("p"),y=s("strong"),y.textContent="Tauri Console",P=v(),S=s("span"),S.textContent="clear",j=v();for(let R=0;R<B.length;R+=1)B[R].c();a(i,"class","logo"),i.src!==(o="tauri logo.png")&&a(i,"src",o),a(i,"height","60"),a(i,"alt","logo"),a(n,"class","flex row noselect just-around"),a(n,"style","margin=1em;"),a(n,"data-tauri-drag-region",""),dt(h,"width","15em"),dt(h,"margin-left","0.5em"),a(M,"class","content"),a(p,"class","flex row"),a(S,"class","nv"),a(k,"class","flex row just-around"),a(b,"id","response"),dt(b,"white-space","pre-line")},m(R,nt){O(R,t,nt),r(t,n),r(n,i),r(n,l),r(n,u),r(t,c),r(t,p),r(p,h);for(let D=0;D<N.length;D+=1)N[D].m(h,null);r(p,f),r(p,M),m&&Xi(m,M,null),r(t,d),r(t,b),r(b,k),r(k,y),r(k,P),r(k,S),r(b,j);for(let D=0;D<B.length;D+=1)B[D].m(b,null);F=!0,U||(L=[C(i,"click",e[8]),C(S,"click",e[7])],U=!0)},p(R,[nt]){if(nt&21){H=R[2];let D;for(D=0;D<H.length;D+=1){const Q=jo(R,H,D);N[D]?N[D].p(Q,nt):(N[D]=Fo(Q),N[D].c(),N[D].m(h,null))}for(;D<N.length;D+=1)N[D].d(1);N.length=H.length}if(tt!==(tt=R[0].component)){if(m){Jo();const D=m;Yi(D.$$.fragment,1,0,()=>{Qi(D,1)}),Vo()}tt?(m=new tt(st(R)),Ki(m.$$.fragment),$i(m.$$.fragment,1),Xi(m,M,null)):m=null}if(nt&2){K=R[1];let D;for(D=0;D<K.length;D+=1){const Q=Ro(R,K,D);B[D]?B[D].p(Q,nt):(B[D]=Uo(Q),B[D].c(),B[D].m(b,null))}for(;D<B.length;D+=1)B[D].d(1);B.length=K.length}},i(R){F||(m&&$i(m.$$.fragment,R),F=!0)},o(R){m&&Yi(m.$$.fragment,R),F=!1},d(R){R&&W(t),he(N,R),m&&Qi(m),he(B,R),U=!1,x(L)}}}const al="ctrl+b";function cl(e,t,n){let i;Xe(()=>{Ko(al,()=>{me("menu_toggle")})});const o=[{label:"Welcome",component:xo},{label:"Messages",component:rr},{label:"CLI",component:nr},{label:"Dialog",component:yr},{label:"File system",component:Tr},{label:"HTTP",component:Pr},{label:"HTTP Form",component:rl},{label:"Notifications",component:Ar},{label:"Window",component:Hr},{label:"Shortcuts",component:Gr},{label:"Shell",component:Kr},{label:"Updater",component:$r},{label:"Clipboard",component:xr},{label:"WebRTC",component:nl}];let l=o[0],u=Vi([]);Gi(e,u,d=>n(1,i=d));function c(d){n(0,l=d)}function p(d){u.update(b=>[{text:`[${new Date().toLocaleTimeString()}]: `+(typeof d=="string"?d:JSON.stringify(d))},...b])}function h(d){u.update(b=>[{html:d},...b])}function f(){u.update(()=>[])}function M(){En("https://tauri.studio/")}return[l,i,o,u,c,p,h,f,M,d=>c(d)]}class dl extends X{constructor(t){super();Y(this,t,cl,sl,$,{})}}new dl({target:document.body});