tauri/examples/api/public/build/bundle.js

17 lines
52 KiB
JavaScript

var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function o(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function u(e,n,i){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const i=e.subscribe(...n);return i.unsubscribe?()=>i.unsubscribe():i}(n,i))}function s(t,e){t.appendChild(e)}function c(t,e,n){t.insertBefore(e,n||null)}function a(t){t.parentNode.removeChild(t)}function l(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function d(t){return document.createElement(t)}function f(t){return document.createTextNode(t)}function h(){return f(" ")}function p(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function v(t){return function(e){return e.preventDefault(),t.call(this,e)}}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function g(t){return""===t?null:+t}function y(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function b(t,e){t.value=null==e?"":e}function _(t,e,n,i){t.style.setProperty(e,n,i?"important":"")}function w(t,e){for(let n=0;n<t.options.length;n+=1){const i=t.options[n];if(i.__value===e)return void(i.selected=!0)}}let x;function M(t){x=t}function $(){if(!x)throw new Error("Function called outside component initialization");return x}function k(t){$().$$.on_mount.push(t)}function C(t){$().$$.on_destroy.push(t)}const P=[],z=[],T=[],S=[],E=Promise.resolve();let O=!1;function W(t){T.push(t)}let j=!1;const A=new Set;function L(){if(!j){j=!0;do{for(let t=0;t<P.length;t+=1){const e=P[t];M(e),F(e.$$)}for(M(null),P.length=0;z.length;)z.pop()();for(let t=0;t<T.length;t+=1){const e=T[t];A.has(e)||(A.add(e),e())}T.length=0}while(P.length);for(;S.length;)S.pop()();O=!1,j=!1,A.clear()}}function F(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(W)}}const D=new Set;let R;function I(t,e){t&&t.i&&(D.delete(t),t.i(e))}function U(t,e,n,i){if(t&&t.o){if(D.has(t))return;D.add(t),R.c.push((()=>{D.delete(t),i&&(n&&t.d(1),i())})),t.o(e)}}function q(t){t&&t.c()}function N(t,n,r,u){const{fragment:s,on_mount:c,on_destroy:a,after_update:l}=t.$$;s&&s.m(n,r),u||W((()=>{const n=c.map(e).filter(o);a?a.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(W)}function B(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function G(t,e){-1===t.$$.dirty[0]&&(P.push(t),O||(O=!0,E.then(L)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function H(e,o,r,u,s,c,l=[-1]){const d=x;M(e);const f=e.$$={fragment:null,ctx:null,props:c,update:t,not_equal:s,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:[]),callbacks:n(),dirty:l,skip_bound:!1};let h=!1;if(f.ctx=r?r(e,o.props||{},((t,n,...i)=>{const o=i.length?i[0]:n;return f.ctx&&s(f.ctx[t],f.ctx[t]=o)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](o),h&&G(e,t)),n})):[],f.update(),h=!0,i(f.before_update),f.fragment=!!u&&u(f.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);f.fragment&&f.fragment.l(t),t.forEach(a)}else f.fragment&&f.fragment.c();o.intro&&I(e.$$.fragment),N(e,o.target,o.anchor,o.customElement),L()}M(d)}class V{$destroy(){B(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}
/*! *****************************************************************************
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 J=function(t,e){return(J=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function X(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}J(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var K=function(){return(K=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Y(t,e,n,i){return new(n||(n=Promise))((function(o,r){function u(t){try{c(i.next(t))}catch(t){r(t)}}function s(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,s)}c((i=i.apply(t,e||[])).next())}))}function Q(t,e){var n,i,o,r,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,i=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){u=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){u.label=r[1];break}if(6===r[0]&&u.label<o[1]){u.label=o[1],o=r;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(r);break}o[2]&&u.ops.pop(),u.trys.pop();continue}r=e.call(t,u)}catch(t){r=[6,t],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function Z(t,e){void 0===e&&(e=!1);var n=function(){var t=new Int8Array(1);window.crypto.getRandomValues(t);var e=new Uint8Array(Math.max(16,Math.abs(t[0])));return window.crypto.getRandomValues(e),e.join("")}();return Object.defineProperty(window,n,{value:function(i){return e&&Reflect.deleteProperty(window,n),null==t?void 0:t(i)},writable:!1,configurable:!0}),n}function tt(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,new Promise((function(n,i){var o=Z((function(t){n(t),Reflect.deleteProperty(window,r)}),!0),r=Z((function(t){i(t),Reflect.deleteProperty(window,o)}),!0);window.rpc.notify(t,K({callback:o,error:r},e))}))]}))}))}function et(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,tt("tauri",t)]}))}))}function nt(t,e,n,i){return Y(this,void 0,void 0,(function(){return Q(this,(function(o){return"object"==typeof n&&Object.freeze(n),[2,et({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:"string"==typeof n?[n]:n,options:i,onEventFn:Z(t)}})]}))}))}Object.freeze({__proto__:null,transformCallback:Z,invoke:tt});var it,ot,rt=function(){function t(){this.eventListeners=Object.create(null)}return t.prototype.addEventListener=function(t,e){t in this.eventListeners?this.eventListeners[t].push(e):this.eventListeners[t]=[e]},t.prototype._emit=function(t,e){if(t in this.eventListeners)for(var n=0,i=this.eventListeners[t];n<i.length;n++)(0,i[n])(e)},t.prototype.on=function(t,e){return this.addEventListener(t,e),this},t}(),ut=function(){function t(t){this.pid=t}return t.prototype.write=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:t}})]}))}))},t.prototype.kill=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})]}))}))},t}(),st=function(t){function e(e,n,i){void 0===n&&(n=[]);var o=t.call(this)||this;return o.stdout=new rt,o.stderr=new rt,o.program=e,o.args="string"==typeof n?[n]:n,o.options=null!=i?i:{},o}return X(e,t),e.sidecar=function(t,n,i){void 0===n&&(n=[]);var o=new e(t,n,i);return o.options.sidecar=!0,o},e.prototype.spawn=function(){return Y(this,void 0,void 0,(function(){var t=this;return Q(this,(function(e){return[2,nt((function(e){switch(e.event){case"Error":t._emit("error",e.payload);break;case"Terminated":t._emit("close",e.payload);break;case"Stdout":t.stdout._emit("data",e.payload);break;case"Stderr":t.stderr._emit("data",e.payload)}}),this.program,this.args,this.options).then((function(t){return new ut(t)}))]}))}))},e.prototype.execute=function(){return Y(this,void 0,void 0,(function(){var t=this;return Q(this,(function(e){return[2,new Promise((function(e,n){t.on("error",n);var i=[],o=[];t.stdout.on("data",(function(t){i.push(t)})),t.stderr.on("data",(function(t){o.push(t)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:i.join("\n"),stderr:o.join("\n")})})),t.spawn().catch(n)}))]}))}))},e}(rt);function ct(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Shell",message:{cmd:"open",path:t,with:e}})]}))}))}function at(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"App",message:{cmd:"getAppVersion"}})]}))}))}function lt(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"App",message:{cmd:"getAppName"}})]}))}))}function dt(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"App",message:{cmd:"getTauriVersion"}})]}))}))}function ft(t){return void 0===t&&(t=0),Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}})]}))}))}function ht(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Process",message:{cmd:"relaunch"}})]}))}))}function pt(e){let n,o,r,u,l,v,g,b,_,w,x,M,$,k,C,P,z,T,S,E,O;return{c(){n=d("h1"),n.textContent="Welcome",o=h(),r=d("p"),r.textContent="Tauri's API capabilities using the ` @tauri-apps/api ` package. It's used as\r\n the main validation app, serving as the testbed of our development process. In\r\n the future, this app will be used on Tauri's integration tests.",u=h(),l=d("p"),v=f("Current App version: "),g=f(e[0]),b=h(),_=d("p"),w=f("Current Tauri version: "),x=f(e[1]),M=h(),$=d("p"),k=f("Current App name: "),C=f(e[2]),P=h(),z=d("button"),z.textContent="Close application",T=h(),S=d("button"),S.textContent="Relaunch application",m(z,"class","button"),m(S,"class","button")},m(t,i){c(t,n,i),c(t,o,i),c(t,r,i),c(t,u,i),c(t,l,i),s(l,v),s(l,g),c(t,b,i),c(t,_,i),s(_,w),s(_,x),c(t,M,i),c(t,$,i),s($,k),s($,C),c(t,P,i),c(t,z,i),c(t,T,i),c(t,S,i),E||(O=[p(z,"click",e[3]),p(S,"click",e[4])],E=!0)},p(t,[e]){1&e&&y(g,t[0]),2&e&&y(x,t[1]),4&e&&y(C,t[2])},i:t,o:t,d(t){t&&a(n),t&&a(o),t&&a(r),t&&a(u),t&&a(l),t&&a(b),t&&a(_),t&&a(M),t&&a($),t&&a(P),t&&a(z),t&&a(T),t&&a(S),E=!1,i(O)}}}function vt(t,e,n){let i=0,o=0,r="Unknown";return lt().then((t=>{n(2,r=t)})),at().then((t=>{n(0,i=t)})),dt().then((t=>{n(1,o=t)})),[i,o,r,async function(){await ft()},async function(){await ht()}]}Object.freeze({__proto__:null,Command:st,Child:ut,open:ct}),Object.freeze({__proto__:null,getName:lt,getVersion:at,getTauriVersion:dt}),Object.freeze({__proto__:null,exit:ft,relaunch:ht});class mt extends V{constructor(t){super(),H(this,t,vt,pt,r,{})}}function gt(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]}))}))}function yt(e){let n,i,o,r;return{c(){n=d("div"),i=d("button"),i.textContent="Get matches",m(i,"class","button"),m(i,"id","cli-matches")},m(t,u){c(t,n,u),s(n,i),o||(r=p(i,"click",e[0]),o=!0)},p:t,i:t,o:t,d(t){t&&a(n),o=!1,r()}}}function bt(t,e,n){let{onMessage:i}=e;return t.$$set=t=>{"onMessage"in t&&n(1,i=t.onMessage)},[function(){gt().then(i).catch(i)},i]}Object.freeze({__proto__:null,getMatches:gt});class _t extends V{constructor(t){super(),H(this,t,bt,yt,r,{onMessage:1})}}function wt(t,e,n){return Y(this,void 0,void 0,(function(){return Q(this,(function(i){switch(i.label){case 0:return[4,et({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:e,payload:n}})];case 1:return i.sent(),[2]}}))}))}function xt(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Event",message:{cmd:"unlisten",eventId:t}})]}))}))}function Mt(t,e){return Y(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,et({__tauriModule:"Event",message:{cmd:"listen",event:t,handler:Z(e)}}).then((function(t){return function(){return Y(n,void 0,void 0,(function(){return Q(this,(function(e){return[2,xt(t)]}))}))}}))]}))}))}function $t(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,Mt(t,(function(t){e(t),xt(t.id).catch((function(){}))}))]}))}))}function kt(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,wt(t,void 0,e)]}))}))}function Ct(e){let n,o,r,u,l,f,v,g;return{c(){n=d("div"),o=d("button"),o.textContent="Call Log API",r=h(),u=d("button"),u.textContent="Call Request (async) API",l=h(),f=d("button"),f.textContent="Send event to Rust",m(o,"class","button"),m(o,"id","log"),m(u,"class","button"),m(u,"id","request"),m(f,"class","button"),m(f,"id","event")},m(t,i){c(t,n,i),s(n,o),s(n,r),s(n,u),s(n,l),s(n,f),v||(g=[p(o,"click",e[0]),p(u,"click",e[1]),p(f,"click",e[2])],v=!0)},p:t,i:t,o:t,d(t){t&&a(n),v=!1,i(g)}}}function Pt(t,e,n){let i,{onMessage:o}=e;return k((async()=>{i=await Mt("rust-event",o)})),C((()=>{i&&i()})),t.$$set=t=>{"onMessage"in t&&n(3,o=t.onMessage)},[function(){tt("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})},function(){tt("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(o).catch(o)},function(){kt("js-event","this is the payload string")},o]}Object.freeze({__proto__:null,listen:Mt,once:$t,emit:kt});class zt extends V{constructor(t){super(),H(this,t,Pt,Ct,r,{onMessage:3})}}function Tt(t){return void 0===t&&(t={}),Y(this,void 0,void 0,(function(){return Q(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,et({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})]}))}))}function St(t){return void 0===t&&(t={}),Y(this,void 0,void 0,(function(){return Q(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,et({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})]}))}))}function Et(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Fs",message:{cmd:"readBinaryFile",path:t,options:e}})]}))}))}function Ot(t){var e=function(t){if(t.length<65536)return String.fromCharCode.apply(null,Array.from(t));for(var e="",n=t.length,i=0;i<n;i++){var o=t.subarray(65536*i,65536*(i+1));e+=String.fromCharCode.apply(null,Array.from(o))}return e}(new Uint8Array(t));return btoa(e)}function Wt(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:e}})]}))}))}function jt(e){let n,o,r,u,l,f,v,g,y,_,w,x,M,$,k,C,P,z,T,S;return{c(){n=d("div"),o=d("input"),r=h(),u=d("input"),l=h(),f=d("div"),v=d("input"),g=h(),y=d("label"),y.textContent="Multiple",_=h(),w=d("div"),x=d("input"),M=h(),$=d("label"),$.textContent="Directory",k=h(),C=d("button"),C.textContent="Open dialog",P=h(),z=d("button"),z.textContent="Open save dialog",m(o,"id","dialog-default-path"),m(o,"placeholder","Default path"),m(u,"id","dialog-filter"),m(u,"placeholder","Extensions filter, comma-separated"),m(u,"class","svelte-1eg58yg"),m(v,"type","checkbox"),m(v,"id","dialog-multiple"),m(y,"for","dialog-multiple"),m(x,"type","checkbox"),m(x,"id","dialog-directory"),m($,"for","dialog-directory"),m(C,"class","button"),m(C,"id","open-dialog"),m(z,"class","button"),m(z,"id","save-dialog")},m(t,i){c(t,n,i),s(n,o),b(o,e[0]),s(n,r),s(n,u),b(u,e[1]),s(n,l),s(n,f),s(f,v),v.checked=e[2],s(f,g),s(f,y),s(n,_),s(n,w),s(w,x),x.checked=e[3],s(w,M),s(w,$),s(n,k),s(n,C),s(n,P),s(n,z),T||(S=[p(o,"input",e[7]),p(u,"input",e[8]),p(v,"change",e[9]),p(x,"change",e[10]),p(C,"click",e[4]),p(z,"click",e[5])],T=!0)},p(t,[e]){1&e&&o.value!==t[0]&&b(o,t[0]),2&e&&u.value!==t[1]&&b(u,t[1]),4&e&&(v.checked=t[2]),8&e&&(x.checked=t[3])},i:t,o:t,d(t){t&&a(n),T=!1,i(S)}}}function At(t,e,n){let{onMessage:i}=e,o=null,r=null,u=!1,s=!1;return t.$$set=t=>{"onMessage"in t&&n(6,i=t.onMessage)},[o,r,u,s,function(){Tt({defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map((t=>t.trim()))}]:[],multiple:u,directory:s}).then((function(t){if(Array.isArray(t))i(t);else{var e=t,n=e.match(/\S+\.\S+$/g);Et(e).then((function(o){var r,u,s,c;n&&(e.includes(".png")||e.includes(".jpg"))?(r=new Uint8Array(o),u=function(t){i('<img src="data:image/png;base64,'+t+'"></img>')},s=new Blob([r],{type:"application/octet-binary"}),(c=new FileReader).onload=function(t){var e=t.target.result;u(e.substr(e.indexOf(",")+1))},c.readAsDataURL(s)):i(t)})).catch(i(t))}})).catch(i)},function(){St({defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map((t=>t.trim()))}]:[]}).then(i).catch(i)},i,function(){o=this.value,n(0,o)},function(){r=this.value,n(1,r)},function(){u=this.checked,n(2,u)},function(){s=this.checked,n(3,s)}]}Object.freeze({__proto__:null,open:Tt,save:St}),function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Desktop=6]="Desktop",t[t.Document=7]="Document",t[t.Download=8]="Download",t[t.Executable=9]="Executable",t[t.Font=10]="Font",t[t.Home=11]="Home",t[t.Picture=12]="Picture",t[t.Public=13]="Public",t[t.Runtime=14]="Runtime",t[t.Template=15]="Template",t[t.Video=16]="Video",t[t.Resource=17]="Resource",t[t.App=18]="App",t[t.Current=19]="Current"}(it||(it={})),Object.freeze({__proto__:null,get BaseDirectory(){return it},get Dir(){return it},readTextFile:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]}))}))},readBinaryFile:Et,writeFile:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return"object"==typeof e&&Object.freeze(e),"object"==typeof t&&Object.freeze(t),[2,et({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:t.contents,options:e}})]}))}))},writeBinaryFile:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return"object"==typeof e&&Object.freeze(e),"object"==typeof t&&Object.freeze(t),[2,et({__tauriModule:"Fs",message:{cmd:"writeBinaryFile",path:t.path,contents:Ot(t.contents),options:e}})]}))}))},readDir:Wt,createDir:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})]}))}))},removeDir:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})]}))}))},copyFile:function(t,e,n){return void 0===n&&(n={}),Y(this,void 0,void 0,(function(){return Q(this,(function(i){return[2,et({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})]}))}))},removeFile:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})]}))}))},renameFile:function(t,e,n){return void 0===n&&(n={}),Y(this,void 0,void 0,(function(){return Q(this,(function(i){return[2,et({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})]}))}))}});class Lt extends V{constructor(t){var e;super(),document.getElementById("svelte-1eg58yg-style")||((e=d("style")).id="svelte-1eg58yg-style",e.textContent="#dialog-filter.svelte-1eg58yg{width:260px}",s(document.head,e)),H(this,t,At,jt,r,{onMessage:6})}}function Ft(t,e,n){const i=t.slice();return i[5]=e[n],i}function Dt(e){let n,i,o=e[5][0]+"";return{c(){n=d("option"),i=f(o),n.__value=e[5][1],n.value=n.__value},m(t,e){c(t,n,e),s(n,i)},p:t,d(t){t&&a(n)}}}function Rt(e){let n,o,r,u,f,g,y,_,w,x=e[1],M=[];for(let t=0;t<x.length;t+=1)M[t]=Dt(Ft(e,x,t));return{c(){n=d("form"),o=d("select"),r=d("option"),r.textContent="None";for(let t=0;t<M.length;t+=1)M[t].c();u=h(),f=d("input"),g=h(),y=d("button"),y.textContent="Read",r.__value="",r.value=r.__value,m(o,"class","button"),m(o,"id","dir"),m(f,"id","path-to-read"),m(f,"placeholder","Type the path to read..."),m(y,"class","button"),m(y,"id","read")},m(t,i){c(t,n,i),s(n,o),s(o,r);for(let t=0;t<M.length;t+=1)M[t].m(o,null);s(n,u),s(n,f),b(f,e[0]),s(n,g),s(n,y),_||(w=[p(f,"input",e[4]),p(n,"submit",v(e[2]))],_=!0)},p(t,[e]){if(2&e){let n;for(x=t[1],n=0;n<x.length;n+=1){const i=Ft(t,x,n);M[n]?M[n].p(i,e):(M[n]=Dt(i),M[n].c(),M[n].m(o,null))}for(;n<M.length;n+=1)M[n].d(1);M.length=x.length}1&e&&f.value!==t[0]&&b(f,t[0])},i:t,o:t,d(t){t&&a(n),l(M,t),_=!1,i(w)}}}function It(){return document.getElementById("dir").value?parseInt(dir.value):null}function Ut(t,e,n){let{onMessage:i}=e,o="";const r=Object.keys(it).filter((t=>isNaN(parseInt(t)))).map((t=>[t,it[t]]));return t.$$set=t=>{"onMessage"in t&&n(3,i=t.onMessage)},[o,r,function(){const t=o.match(/\S+\.\S+$/g),e={dir:It()};(t?Et(o,e):Wt(o,e)).then((function(e){if(t)if(o.includes(".png")||o.includes(".jpg"))!function(t,e){const n=new Blob([t],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(t){const n=t.target.result;e(n.substr(n.indexOf(",")+1))},i.readAsDataURL(n)}(new Uint8Array(e),(function(t){i('<img src="'+("data:image/png;base64,"+t)+'"></img>')}));else{const t=String.fromCharCode.apply(null,e);i('<textarea id="file-response" style="height: 400px"></textarea><button id="file-save">Save</button>'),setTimeout((()=>{const e=document.getElementById("file-response");e.value=t,document.getElementById("file-save").addEventListener("click",(function(){writeFile({file:o,contents:e.value},{dir:It()}).catch(i)}))}))}else i(e)})).catch(i)},i,function(){o=this.value,n(0,o)}]}class qt extends V{constructor(t){super(),H(this,t,Ut,Rt,r,{onMessage:3})}}!function(t){t[t.JSON=1]="JSON",t[t.Text=2]="Text",t[t.Binary=3]="Binary"}(ot||(ot={}));var Nt=function(){function t(t,e){this.type=t,this.payload=e}return t.form=function(e){return new t("Form",e)},t.json=function(e){return new t("Json",e)},t.text=function(e){return new t("Text",e)},t.bytes=function(e){return new t("Bytes",e)},t}(),Bt=function(){function t(t){this.id=t}return t.prototype.drop=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]}))}))},t.prototype.request=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}})]}))}))},t.prototype.get=function(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,this.request(K({method:"GET",url:t},e))]}))}))},t.prototype.post=function(t,e,n){return Y(this,void 0,void 0,(function(){return Q(this,(function(i){return[2,this.request(K({method:"POST",url:t,body:e},n))]}))}))},t.prototype.put=function(t,e,n){return Y(this,void 0,void 0,(function(){return Q(this,(function(i){return[2,this.request(K({method:"PUT",url:t,body:e},n))]}))}))},t.prototype.patch=function(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,this.request(K({method:"PATCH",url:t},e))]}))}))},t.prototype.delete=function(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,this.request(K({method:"DELETE",url:t},e))]}))}))},t}();function Gt(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(t){return new Bt(t)}))]}))}))}var Ht=null;function Vt(e){let n,o,r,u,l,f,g,y,x,M,$,k,C,P,z,T,S;return{c(){n=d("form"),o=d("select"),r=d("option"),r.textContent="GET",u=d("option"),u.textContent="POST",l=d("option"),l.textContent="PUT",f=d("option"),f.textContent="PATCH",g=d("option"),g.textContent="DELETE",y=h(),x=d("input"),M=h(),$=d("br"),k=h(),C=d("textarea"),P=h(),z=d("button"),z.textContent="Make request",r.__value="GET",r.value=r.__value,u.__value="POST",u.value=u.__value,l.__value="PUT",l.value=l.__value,f.__value="PATCH",f.value=f.__value,g.__value="DELETE",g.value=g.__value,m(o,"class","button"),m(o,"id","request-method"),void 0===e[0]&&W((()=>e[5].call(o))),m(x,"id","request-url"),m(x,"placeholder","Type the request URL..."),m(C,"id","request-body"),m(C,"placeholder","Request body"),m(C,"rows","5"),_(C,"width","100%"),_(C,"margin-right","10px"),_(C,"font-size","12px"),m(z,"class","button"),m(z,"id","make-request")},m(t,i){c(t,n,i),s(n,o),s(o,r),s(o,u),s(o,l),s(o,f),s(o,g),w(o,e[0]),s(n,y),s(n,x),b(x,e[1]),s(n,M),s(n,$),s(n,k),s(n,C),b(C,e[2]),s(n,P),s(n,z),T||(S=[p(o,"change",e[5]),p(x,"input",e[6]),p(C,"input",e[7]),p(n,"submit",v(e[3]))],T=!0)},p(t,[e]){1&e&&w(o,t[0]),2&e&&x.value!==t[1]&&b(x,t[1]),4&e&&b(C,t[2])},i:t,o:t,d(t){t&&a(n),T=!1,i(S)}}}function Jt(t,e,n){let i="GET",o="",r="",{onMessage:u}=e;return t.$$set=t=>{"onMessage"in t&&n(4,u=t.onMessage)},[i,o,r,async function(){const t=await Gt(),e={url:o||""||"",method:i||"GET"||"GET"};r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")?e.body=Nt.json(JSON.parse(r)):""!==r&&(e.body=Nt.text(r)),t.request(e).then(u).catch(u)},u,function(){i=function(t){const e=t.querySelector(":checked")||t.options[0];return e&&e.__value}(this),n(0,i)},function(){o=this.value,n(1,o)},function(){r=this.value,n(2,r)}]}Object.freeze({__proto__:null,getClient:Gt,fetch:function(t,e){var n;return Y(this,void 0,void 0,(function(){return Q(this,(function(i){switch(i.label){case 0:return null!==Ht?[3,2]:[4,Gt()];case 1:Ht=i.sent(),i.label=2;case 2:return[2,Ht.request(K({url:t,method:null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"GET"},e))]}}))}))},Body:Nt,Client:Bt});class Xt extends V{constructor(t){super(),H(this,t,Jt,Vt,r,{onMessage:4})}}function Kt(e){let n,i,o;return{c(){n=d("button"),n.textContent="Send test notification",m(n,"class","button"),m(n,"id","notification")},m(t,r){c(t,n,r),i||(o=p(n,"click",e[0]),i=!0)},p:t,i:t,o:t,d(t){t&&a(n),i=!1,o()}}}function Yt(){new Notification("Notification title",{body:"This is the notification body"})}function Qt(t,e,n){let{onMessage:i}=e;return t.$$set=t=>{"onMessage"in t&&n(1,i=t.onMessage)},[function(){"default"===Notification.permission?Notification.requestPermission().then((function(t){"granted"===t?Yt():i("Permission is "+t)})).catch(i):"granted"===Notification.permission?Yt():i("Permission is denied")},i]}class Zt extends V{constructor(t){super(),H(this,t,Qt,Kt,r,{onMessage:1})}}var te=function(t,e){this.type="Logical",this.width=t,this.height=e},ee=function(){function t(t,e){this.type="Physical",this.width=t,this.height=e}return t.prototype.toLogical=function(t){return new te(this.width/t,this.height/t)},t}(),ne=function(t,e){this.type="Logical",this.x=t,this.y=e},ie=function(){function t(t,e){this.type="Physical",this.x=t,this.y=e}return t.prototype.toLogical=function(t){return new ne(this.x/t,this.y/t)},t}();function oe(){return window.__TAURI__.__windows}var re=["tauri://created","tauri://error"],ue=function(){function t(t){this.label=t,this.listeners=Object.create(null)}return t.prototype.listen=function(t,e){return Y(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,Mt(t,e)]}))}))},t.prototype.once=function(t,e){return Y(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,$t(t,e)]}))}))},t.prototype.emit=function(t,e){return Y(this,void 0,void 0,(function(){var n,i;return Q(this,(function(o){if(re.includes(t)){for(n=0,i=this.listeners[t]||[];n<i.length;n++)(0,i[n])({event:t,id:-1,payload:e});return[2,Promise.resolve()]}return[2,wt(t,this.label,e)]}))}))},t.prototype._handleTauriEvent=function(t,e){return!!re.includes(t)&&(t in this.listeners?this.listeners[t].push(e):this.listeners[t]=[e],!0)},t}(),se=function(t){function e(e,n){void 0===n&&(n={});var i=t.call(this,e)||this;return et({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:K({label:e},n)}}}).then((function(){return Y(i,void 0,void 0,(function(){return Q(this,(function(t){return[2,this.emit("tauri://created")]}))}))})).catch((function(t){return Y(i,void 0,void 0,(function(){return Q(this,(function(e){return[2,this.emit("tauri://error",t)]}))}))})),i}return X(e,t),e.getByLabel=function(t){return oe().some((function(e){return e.label===t}))?new ue(t):null},e}(ue),ce=function(){function t(){}return t.prototype.scaleFactor=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"scaleFactor"}})]}))}))},t.prototype.innerPosition=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"innerPosition"}})]}))}))},t.prototype.outerPosition=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"outerPosition"}})]}))}))},t.prototype.innerSize=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"innerSize"}})]}))}))},t.prototype.outerSize=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"outerSize"}})]}))}))},t.prototype.isFullscreen=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"isFullscreen"}})]}))}))},t.prototype.isMaximized=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"isMaximized"}})]}))}))},t.prototype.setResizable=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Window",message:{cmd:"setResizable",data:t}})]}))}))},t.prototype.setTitle=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Window",message:{cmd:"setTitle",data:t}})]}))}))},t.prototype.maximize=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"maximize"}})]}))}))},t.prototype.unmaximize=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"unmaximize"}})]}))}))},t.prototype.minimize=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"minimize"}})]}))}))},t.prototype.unminimize=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"unminimize"}})]}))}))},t.prototype.show=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"show"}})]}))}))},t.prototype.hide=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"hide"}})]}))}))},t.prototype.close=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"close"}})]}))}))},t.prototype.setDecorations=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Window",message:{cmd:"setDecorations",data:t}})]}))}))},t.prototype.setAlwaysOnTop=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Window",message:{cmd:"setAlwaysOnTop",data:t}})]}))}))},t.prototype.setSize=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){if(!t||"Logical"!==t.type&&"Physical"!==t.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,et({__tauriModule:"Window",message:{cmd:"setSize",data:{type:t.type,data:{width:t.width,height:t.height}}}})]}))}))},t.prototype.setMinSize=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){if(t&&"Logical"!==t.type&&"Physical"!==t.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,et({__tauriModule:"Window",message:{cmd:"setMinSize",data:t?{type:t.type,data:{width:t.width,height:t.height}}:null}})]}))}))},t.prototype.setMaxSize=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){if(t&&"Logical"!==t.type&&"Physical"!==t.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,et({__tauriModule:"Window",message:{cmd:"setMaxSize",data:t?{type:t.type,data:{width:t.width,height:t.height}}:null}})]}))}))},t.prototype.setPosition=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){if(!t||"Logical"!==t.type&&"Physical"!==t.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return[2,et({__tauriModule:"Window",message:{cmd:"setPosition",data:{type:t.type,data:{x:t.x,y:t.y}}}})]}))}))},t.prototype.setFullscreen=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Window",message:{cmd:"setFullscreen",data:t}})]}))}))},t.prototype.setIcon=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Window",message:{cmd:"setIcon",data:{icon:t}}})]}))}))},t.prototype.startDragging=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"startDragging"}})]}))}))},t}(),ae=new ce;function le(e){let n,o,r,u,l,y,w,x,M,$,k,C,P,z,T,S,E,O,W,j,A,L,F,D,R,I,U,q,N,B,G,H,V,J,X,K,Y,Q,Z,tt,et,nt,it,ot,rt,ut,st,ct,at,lt,dt,ft,ht,pt,vt,mt,gt,yt,bt,_t,wt,xt,Mt,$t,kt,Ct,Pt,zt,Tt,St,Et,Ot,Wt,jt,At,Lt,Ft,Dt,Rt,It,Ut,qt,Nt;return{c(){n=d("div"),o=d("div"),r=d("label"),u=d("input"),l=f("\r\n Resizable"),y=h(),w=d("label"),x=d("input"),M=f("\r\n Maximize"),$=h(),k=d("button"),k.textContent="Minimize",C=h(),P=d("button"),P.textContent="Hide",z=h(),T=d("label"),S=d("input"),E=f("\r\n Transparent"),O=h(),W=d("label"),j=d("input"),A=f("\r\n Has decorations"),L=h(),F=d("label"),D=d("input"),R=f("\r\n Always on top"),I=h(),U=d("label"),q=d("input"),N=f("\r\n Fullscreen"),B=h(),G=d("button"),G.textContent="Change icon",H=h(),V=d("div"),J=d("div"),X=d("div"),K=d("div"),Y=f("X\r\n "),Q=d("input"),Z=h(),tt=d("div"),et=f("Y\r\n "),nt=d("input"),it=h(),ot=d("div"),rt=d("div"),ut=f("Width\r\n "),st=d("input"),ct=h(),at=d("div"),lt=f("Height\r\n "),dt=d("input"),ft=h(),ht=d("div"),pt=d("div"),vt=f("Min width\r\n "),mt=d("input"),gt=h(),yt=d("div"),bt=f("Min height\r\n "),_t=d("input"),wt=h(),xt=d("div"),Mt=d("div"),$t=f("Max width\r\n "),kt=d("input"),Ct=h(),Pt=d("div"),zt=f("Max height\r\n "),Tt=d("input"),St=h(),Et=d("form"),Ot=d("input"),Wt=h(),jt=d("button"),jt.textContent="Set title",At=h(),Lt=d("form"),Ft=d("input"),Dt=h(),Rt=d("button"),Rt.textContent="Open URL",It=h(),Ut=d("button"),Ut.textContent="New window",m(u,"type","checkbox"),m(x,"type","checkbox"),m(k,"title","Unminimizes after 2 seconds"),m(P,"title","Visible again after 2 seconds"),m(S,"type","checkbox"),m(j,"type","checkbox"),m(D,"type","checkbox"),m(q,"type","checkbox"),m(Q,"type","number"),m(Q,"min","0"),m(Q,"class","svelte-b76pvm"),m(nt,"type","number"),m(nt,"min","0"),m(nt,"class","svelte-b76pvm"),m(X,"class","flex col grow svelte-b76pvm"),m(st,"type","number"),m(st,"min","400"),m(st,"class","svelte-b76pvm"),m(dt,"type","number"),m(dt,"min","400"),m(dt,"class","svelte-b76pvm"),m(ot,"class","flex col grow svelte-b76pvm"),m(mt,"type","number"),m(mt,"class","svelte-b76pvm"),m(_t,"type","number"),m(_t,"class","svelte-b76pvm"),m(ht,"class","flex col grow svelte-b76pvm"),m(kt,"type","number"),m(kt,"min","400"),m(kt,"class","svelte-b76pvm"),m(Tt,"type","number"),m(Tt,"min","400"),m(Tt,"class","svelte-b76pvm"),m(xt,"class","flex col grow svelte-b76pvm"),m(J,"class","window-controls flex flex-row svelte-b76pvm"),m(n,"class","flex col"),m(Ot,"id","title"),m(jt,"class","button"),m(jt,"type","submit"),_(Et,"margin-top","24px"),m(Ft,"id","url"),m(Rt,"class","button"),m(Rt,"id","open-url"),_(Lt,"margin-top","24px"),m(Ut,"class","button")},m(t,i){c(t,n,i),s(n,o),s(o,r),s(r,u),u.checked=e[0],s(r,l),s(o,y),s(o,w),s(w,x),x.checked=e[1],s(w,M),s(o,$),s(o,k),s(o,C),s(o,P),s(o,z),s(o,T),s(T,S),S.checked=e[14],s(T,E),s(o,O),s(o,W),s(W,j),j.checked=e[2],s(W,A),s(o,L),s(o,F),s(F,D),D.checked=e[3],s(F,R),s(o,I),s(o,U),s(U,q),q.checked=e[4],s(U,N),s(o,B),s(o,G),s(n,H),s(n,V),s(V,J),s(J,X),s(X,K),s(K,Y),s(K,Q),b(Q,e[11]),s(X,Z),s(X,tt),s(tt,et),s(tt,nt),b(nt,e[12]),s(J,it),s(J,ot),s(ot,rt),s(rt,ut),s(rt,st),b(st,e[5]),s(ot,ct),s(ot,at),s(at,lt),s(at,dt),b(dt,e[6]),s(J,ft),s(J,ht),s(ht,pt),s(pt,vt),s(pt,mt),b(mt,e[7]),s(ht,gt),s(ht,yt),s(yt,bt),s(yt,_t),b(_t,e[8]),s(J,wt),s(J,xt),s(xt,Mt),s(Mt,$t),s(Mt,kt),b(kt,e[9]),s(xt,Ct),s(xt,Pt),s(Pt,zt),s(Pt,Tt),b(Tt,e[10]),c(t,St,i),c(t,Et,i),s(Et,Ot),b(Ot,e[15]),s(Et,Wt),s(Et,jt),c(t,At,i),c(t,Lt,i),s(Lt,Ft),b(Ft,e[13]),s(Lt,Dt),s(Lt,Rt),c(t,It,i),c(t,Ut,i),qt||(Nt=[p(u,"change",e[23]),p(x,"change",e[24]),p(k,"click",e[19]),p(P,"click",e[18]),p(S,"change",e[25]),p(j,"change",e[26]),p(D,"change",e[27]),p(q,"change",e[28]),p(G,"click",e[20]),p(Q,"input",e[29]),p(nt,"input",e[30]),p(st,"input",e[31]),p(dt,"input",e[32]),p(mt,"input",e[33]),p(_t,"input",e[34]),p(kt,"input",e[35]),p(Tt,"input",e[36]),p(Ot,"input",e[37]),p(Et,"submit",v(e[17])),p(Ft,"input",e[38]),p(Lt,"submit",v(e[16])),p(Ut,"click",e[21])],qt=!0)},p(t,e){1&e[0]&&(u.checked=t[0]),2&e[0]&&(x.checked=t[1]),16384&e[0]&&(S.checked=t[14]),4&e[0]&&(j.checked=t[2]),8&e[0]&&(D.checked=t[3]),16&e[0]&&(q.checked=t[4]),2048&e[0]&&g(Q.value)!==t[11]&&b(Q,t[11]),4096&e[0]&&g(nt.value)!==t[12]&&b(nt,t[12]),32&e[0]&&g(st.value)!==t[5]&&b(st,t[5]),64&e[0]&&g(dt.value)!==t[6]&&b(dt,t[6]),128&e[0]&&g(mt.value)!==t[7]&&b(mt,t[7]),256&e[0]&&g(_t.value)!==t[8]&&b(_t,t[8]),512&e[0]&&g(kt.value)!==t[9]&&b(kt,t[9]),1024&e[0]&&g(Tt.value)!==t[10]&&b(Tt,t[10]),32768&e[0]&&Ot.value!==t[15]&&b(Ot,t[15]),8192&e[0]&&Ft.value!==t[13]&&b(Ft,t[13])},i:t,o:t,d(t){t&&a(n),t&&a(St),t&&a(Et),t&&a(At),t&&a(Lt),t&&a(It),t&&a(Ut),qt=!1,i(Nt)}}}function de(t,e,n){const{setResizable:i,setTitle:o,maximize:r,unmaximize:u,minimize:s,unminimize:c,show:a,hide:l,setDecorations:d,setAlwaysOnTop:f,setSize:h,setMinSize:p,setMaxSize:v,setPosition:m,setFullscreen:y,setIcon:b}=ae;let{onMessage:_}=e,w="https://tauri.studio",x=!0,M=!1,$=!1,k=!0,C=!1,P=!1,z=900,T=700,S=600,E=600,O=null,W=null,j=100,A=100,L="Awesome Tauri Example!";return t.$$set=t=>{"onMessage"in t&&n(22,_=t.onMessage)},t.$$.update=()=>{1&t.$$.dirty[0]&&i(x),2&t.$$.dirty[0]&&(M?r():u()),4&t.$$.dirty[0]&&d(k),8&t.$$.dirty[0]&&f(C),16&t.$$.dirty[0]&&y(P),96&t.$$.dirty[0]&&h(new te(z,T)),384&t.$$.dirty[0]&&p(S&&E?new te(S,E):null),1536&t.$$.dirty[0]&&v(O&&W?new te(O,W):null),6144&t.$$.dirty[0]&&m(new ne(j,A))},[x,M,k,C,P,z,T,S,E,O,W,j,A,w,$,L,function(){ct(w)},function(){o(L)},function(){l(),setTimeout(a,2e3)},function(){s(),setTimeout(c,2e3)},function(){Tt({multiple:!1}).then(b)},function(){new se(Math.random().toString()).once("tauri://error",(function(){_("Error creating new webview")}))},_,function(){x=this.checked,n(0,x)},function(){M=this.checked,n(1,M)},function(){$=this.checked,n(14,$)},function(){k=this.checked,n(2,k)},function(){C=this.checked,n(3,C)},function(){P=this.checked,n(4,P)},function(){j=g(this.value),n(11,j)},function(){A=g(this.value),n(12,A)},function(){z=g(this.value),n(5,z)},function(){T=g(this.value),n(6,T)},function(){S=g(this.value),n(7,S)},function(){E=g(this.value),n(8,E)},function(){O=g(this.value),n(9,O)},function(){W=g(this.value),n(10,W)},function(){L=this.value,n(15,L)},function(){w=this.value,n(13,w)}]}Object.freeze({__proto__:null,WebviewWindow:se,WebviewWindowHandle:ue,WindowManager:ce,getCurrent:function(){return new ue(window.__TAURI__.__currentWindow.label)},getAll:oe,appWindow:ae,LogicalSize:te,PhysicalSize:ee,LogicalPosition:ne,PhysicalPosition:ie,currentMonitor:function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"currentMonitor"}})]}))}))},primaryMonitor:function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"primaryMonitor"}})]}))}))},availableMonitors:function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"availableMonitors"}})]}))}))}});class fe extends V{constructor(t){var e;super(),document.getElementById("svelte-b76pvm-style")||((e=d("style")).id="svelte-b76pvm-style",e.textContent=".flex-row.svelte-b76pvm.svelte-b76pvm{flex-direction:row}.grow.svelte-b76pvm.svelte-b76pvm{flex-grow:1}.window-controls.svelte-b76pvm input.svelte-b76pvm{width:50px}",s(document.head,e)),H(this,t,de,le,r,{onMessage:22},[-1,-1])}}const he=[];function pe(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:Z(e)}})]}))}))}function ve(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]}))}))}function me(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]}))}))}function ge(t,e,n){const i=t.slice();return i[9]=e[n],i}function ye(t){let e,n,i,o,r,u,l=t[9]+"";function v(){return t[8](t[9])}return{c(){e=d("div"),n=f(l),i=h(),o=d("button"),o.textContent="Unregister",m(o,"type","button")},m(t,a){c(t,e,a),s(e,n),s(e,i),s(e,o),r||(u=p(o,"click",v),r=!0)},p(e,i){t=e,2&i&&l!==(l=t[9]+"")&&y(n,l)},d(t){t&&a(e),r=!1,u()}}}function be(e){let n,i,o;return{c(){n=d("button"),n.textContent="Unregister all",m(n,"type","button")},m(t,r){c(t,n,r),i||(o=p(n,"click",e[5]),i=!0)},p:t,d(t){t&&a(n),i=!1,o()}}}function _e(e){let n,o,r,u,f,v,g,y,_,w,x=e[1],M=[];for(let t=0;t<x.length;t+=1)M[t]=ye(ge(e,x,t));let $=e[1].length&&be(e);return{c(){n=d("div"),o=d("div"),r=d("input"),u=h(),f=d("button"),f.textContent="Register",v=h(),g=d("div");for(let t=0;t<M.length;t+=1)M[t].c();y=h(),$&&$.c(),m(r,"placeholder","Type a shortcut with '+' as separator..."),m(f,"type","button")},m(t,i){c(t,n,i),s(n,o),s(o,r),b(r,e[0]),s(o,u),s(o,f),s(n,v),s(n,g);for(let t=0;t<M.length;t+=1)M[t].m(g,null);s(g,y),$&&$.m(g,null),_||(w=[p(r,"input",e[7]),p(f,"click",e[3])],_=!0)},p(t,[e]){if(1&e&&r.value!==t[0]&&b(r,t[0]),18&e){let n;for(x=t[1],n=0;n<x.length;n+=1){const i=ge(t,x,n);M[n]?M[n].p(i,e):(M[n]=ye(i),M[n].c(),M[n].m(g,y))}for(;n<M.length;n+=1)M[n].d(1);M.length=x.length}t[1].length?$?$.p(t,e):($=be(t),$.c(),$.m(g,null)):$&&($.d(1),$=null)},i:t,o:t,d(t){t&&a(n),l(M,t),$&&$.d(),_=!1,i(w)}}}function we(e,n,i){let o,{onMessage:s}=n;const c=function(e,n=t){let i;const o=[];function u(t){if(r(e,t)&&(e=t,i)){const t=!he.length;for(let t=0;t<o.length;t+=1){const n=o[t];n[1](),he.push(n,e)}if(t){for(let t=0;t<he.length;t+=2)he[t][0](he[t+1]);he.length=0}}}return{set:u,update:function(t){u(t(e))},subscribe:function(r,s=t){const c=[r,s];return o.push(c),1===o.length&&(i=n(u)||t),r(e),()=>{const t=o.indexOf(c);-1!==t&&o.splice(t,1),0===o.length&&(i(),i=null)}}}}([]);u(e,c,(t=>i(1,o=t)));let a="CmdOrControl+X";function l(t){const e=t;ve(e).then((()=>{c.update((t=>t.filter((t=>t!==e)))),s(`Shortcut ${e} unregistered`)})).catch(s)}return e.$$set=t=>{"onMessage"in t&&i(6,s=t.onMessage)},[a,o,c,function(){const t=a;pe(t,(()=>{s(`Shortcut ${t} triggered`)})).then((()=>{c.update((e=>[...e,t])),s(`Shortcut ${t} registered successfully`)})).catch(s)},l,function(){me().then((()=>{c.update((()=>[])),s("Unregistered all shortcuts")})).catch(s)},s,function(){a=this.value,i(0,a)},t=>l(t)]}Object.freeze({__proto__:null,register:pe,registerAll:function(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:Z(e)}})]}))}))},isRegistered:function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]}))}))},unregister:ve,unregisterAll:me});class xe extends V{constructor(t){super(),H(this,t,we,_e,r,{onMessage:6})}}function Me(t){let e,n,o,r,u;return{c(){e=d("input"),n=h(),o=d("button"),o.textContent="Write",m(e,"placeholder","write to stdin"),m(o,"class","button")},m(i,s){c(i,e,s),b(e,t[3]),c(i,n,s),c(i,o,s),r||(u=[p(e,"input",t[10]),p(o,"click",t[7])],r=!0)},p(t,n){8&n&&e.value!==t[3]&&b(e,t[3])},d(t){t&&a(e),t&&a(n),t&&a(o),r=!1,i(u)}}}function $e(e){let n,o,r,u,l,f,v,g,y,w,x,M,$,k,C,P=e[4]&&Me(e);return{c(){n=d("div"),o=d("div"),r=d("input"),u=h(),l=d("button"),l.textContent="Run",f=h(),v=d("button"),v.textContent="Kill",g=h(),P&&P.c(),y=h(),w=d("div"),x=d("input"),M=h(),$=d("input"),m(l,"class","button"),m(v,"class","button"),m(x,"placeholder","Working directory"),m($,"placeholder","Environment variables"),_($,"width","300px")},m(t,i){c(t,n,i),s(n,o),s(o,r),b(r,e[0]),s(o,u),s(o,l),s(o,f),s(o,v),s(o,g),P&&P.m(o,null),s(n,y),s(n,w),s(w,x),b(x,e[1]),s(w,M),s(w,$),b($,e[2]),k||(C=[p(r,"input",e[9]),p(l,"click",e[5]),p(v,"click",e[6]),p(x,"input",e[11]),p($,"input",e[12])],k=!0)},p(t,[e]){1&e&&r.value!==t[0]&&b(r,t[0]),t[4]?P?P.p(t,e):(P=Me(t),P.c(),P.m(o,null)):P&&(P.d(1),P=null),2&e&&x.value!==t[1]&&b(x,t[1]),4&e&&$.value!==t[2]&&b($,t[2])},i:t,o:t,d(t){t&&a(n),P&&P.d(),k=!1,i(C)}}}function ke(t,e,n){const i=navigator.userAgent.includes("Windows");let o,r=i?"cmd":"sh",u=i?["/C"]:["-c"],{onMessage:s}=e,c='echo "hello world"',a=null,l="SOMETHING=value ANOTHER=2",d="";return t.$$set=t=>{"onMessage"in t&&n(8,s=t.onMessage)},[c,a,l,d,o,function(){n(4,o=null);const t=new st(r,[...u,c],{cwd:a||null,env:l.split(" ").reduce(((t,e)=>{let[n,i]=e.split("=");return{...t,[n]:i}}),{})});t.on("close",(t=>{s(`command finished with code ${t.code} and signal ${t.signal}`),n(4,o=null)})),t.on("error",(t=>s(`command error: "${t}"`))),t.stdout.on("data",(t=>s(`command stdout: "${t}"`))),t.stderr.on("data",(t=>s(`command stderr: "${t}"`))),t.spawn().then((t=>{n(4,o=t)})).catch(s)},function(){o.kill().then((()=>s("killed child process"))).catch(s)},function(){o.write(d).catch(s)},s,function(){c=this.value,n(0,c)},function(){d=this.value,n(3,d)},function(){a=this.value,n(1,a)},function(){l=this.value,n(2,l)}]}class Ce extends V{constructor(t){super(),H(this,t,ke,$e,r,{onMessage:8})}}function Pe(){return Y(this,void 0,void 0,(function(){function t(){e&&e(),e=void 0}var e;return Q(this,(function(n){return[2,new Promise((function(n,i){Mt("tauri://update-status",(function(e){var o;(o=null==e?void 0:e.payload).error?(t(),i(o.error)):"DONE"===o.status&&(t(),n())})).then((function(t){e=t})).catch((function(e){throw t(),e})),kt("tauri://update-install").catch((function(e){throw t(),e}))}))]}))}))}function ze(){return Y(this,void 0,void 0,(function(){function t(){e&&e(),e=void 0}var e;return Q(this,(function(n){return[2,new Promise((function(n,i){$t("tauri://update-available",(function(e){var i;i=null==e?void 0:e.payload,t(),n({manifest:i,shouldUpdate:!0})})).catch((function(e){throw t(),e})),Mt("tauri://update-status",(function(e){var o;(o=null==e?void 0:e.payload).error?(t(),i(o.error)):"UPTODATE"===o.status&&(t(),n({shouldUpdate:!1}))})).then((function(t){e=t})).catch((function(e){throw t(),e})),kt("tauri://update").catch((function(e){throw t(),e}))}))]}))}))}function Te(e){let n,o,r,u,l,f;return{c(){n=d("div"),o=d("button"),o.textContent="Check update",r=h(),u=d("button"),u.textContent="Install update",m(o,"class","button"),m(o,"id","check_update"),m(u,"class","button hidden"),m(u,"id","start_update")},m(t,i){c(t,n,i),s(n,o),s(n,r),s(n,u),l||(f=[p(o,"click",e[0]),p(u,"click",e[1])],l=!0)},p:t,i:t,o:t,d(t){t&&a(n),l=!1,i(f)}}}function Se(t,e,n){let i,{onMessage:o}=e;return k((async()=>{i=await Mt("tauri://update-status",o)})),C((()=>{i&&i()})),t.$$set=t=>{"onMessage"in t&&n(2,o=t.onMessage)},[async function(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:t,manifest:e}=await ze();o(`Should update: ${t}`),o(e),t&&document.getElementById("start_update").classList.remove("hidden")}catch(t){o(t)}},async function(){try{document.getElementById("start_update").classList.add("hidden"),await Pe(),o("Installation complete, restart required."),await ht()}catch(t){o(t)}},o]}Object.freeze({__proto__:null,installUpdate:Pe,checkUpdate:ze});class Ee extends V{constructor(t){super(),H(this,t,Se,Te,r,{onMessage:2})}}function Oe(t,e,n){const i=t.slice();return i[8]=e[n],i}function We(t){let e,n,i,o,r,u,l=t[8].label+"";function v(){return t[6](t[8])}return{c(){e=d("p"),n=f(l),i=h(),m(e,"class",o="nv noselect "+(t[0]===t[8]?"nv_selected":""))},m(t,o){c(t,e,o),s(e,n),s(e,i),r||(u=p(e,"click",v),r=!0)},p(n,i){t=n,1&i&&o!==(o="nv noselect "+(t[0]===t[8]?"nv_selected":""))&&m(e,"class",o)},d(t){t&&a(e),r=!1,u()}}}function je(t){let e,n,o,r,u,v,g,b,w,x,M,$,k,C,P,z,T,S,E,O,W,j,A,L=t[2],F=[];for(let e=0;e<L.length;e+=1)F[e]=We(Oe(t,L,e));var D=t[0].component;function G(t){return{props:{onMessage:t[4]}}}return D&&($=new D(G(t))),{c(){e=d("main"),n=d("div"),o=d("img"),u=h(),v=d("div"),v.innerHTML='<a class="dark-link" target="_blank" href="https://tauri.studio/en/docs/getting-started/intro">Documentation</a> \n <a class="dark-link" target="_blank" href="https://github.com/tauri-apps/tauri">Github</a> \n <a class="dark-link" target="_blank" href="https://github.com/tauri-apps/tauri/tree/dev/tauri/examples/api">Source</a>',g=h(),b=d("div"),w=d("div");for(let t=0;t<F.length;t+=1)F[t].c();x=h(),M=d("div"),$&&q($.$$.fragment),k=h(),C=d("div"),P=d("p"),z=d("strong"),z.textContent="Tauri Console",T=h(),S=d("a"),S.textContent="clear",E=h(),O=f(t[1]),o.src!==(r="tauri logo.png")&&m(o,"src","tauri logo.png"),m(o,"height","60"),m(o,"alt","logo"),m(n,"class","flex row noselect just-around"),m(n,"style","margin=1em;"),m(n,"data-tauri-drag-region",""),_(w,"width","15em"),_(w,"margin-left","0.5em"),m(M,"class","content"),m(b,"class","flex row"),m(S,"class","nv"),m(P,"class","flex row just-around"),m(C,"id","response"),_(C,"white-space","pre-line")},m(i,r){c(i,e,r),s(e,n),s(n,o),s(n,u),s(n,v),s(e,g),s(e,b),s(b,w);for(let t=0;t<F.length;t+=1)F[t].m(w,null);s(b,x),s(b,M),$&&N($,M,null),s(e,k),s(e,C),s(C,P),s(P,z),s(P,T),s(P,S),s(C,E),s(C,O),W=!0,j||(A=[p(o,"click",t[5]),p(S,"click",t[7])],j=!0)},p(t,[e]){if(13&e){let n;for(L=t[2],n=0;n<L.length;n+=1){const i=Oe(t,L,n);F[n]?F[n].p(i,e):(F[n]=We(i),F[n].c(),F[n].m(w,null))}for(;n<F.length;n+=1)F[n].d(1);F.length=L.length}if(D!==(D=t[0].component)){if($){R={r:0,c:[],p:R};const t=$;U(t.$$.fragment,1,0,(()=>{B(t,1)})),R.r||i(R.c),R=R.p}D?($=new D(G(t)),q($.$$.fragment),I($.$$.fragment,1),N($,M,null)):$=null}(!W||2&e)&&y(O,t[1])},i(t){W||($&&I($.$$.fragment,t),W=!0)},o(t){$&&U($.$$.fragment,t),W=!1},d(t){t&&a(e),l(F,t),$&&B($),j=!1,i(A)}}}function Ae(t,e,n){const i=[{label:"Welcome",component:mt},{label:"Messages",component:zt},{label:"CLI",component:_t},{label:"Dialog",component:Lt},{label:"File system",component:qt},{label:"HTTP",component:Xt},{label:"Notifications",component:Zt},{label:"Window",component:fe},{label:"Shortcuts",component:xe},{label:"Shell",component:Ce},{label:"Updater",component:Ee}];let o=i[0],r=[""];function u(t){n(0,o=t)}return[o,r,i,u,function(t){n(1,r+="string"==typeof t?t:JSON.stringify(t)),n(1,r+="\n")},function(){ct("https://tauri.studio/")},t=>u(t),()=>{n(1,r=[""])}]}return new class extends V{constructor(t){super(),H(this,t,Ae,je,r,{})}}({target:document.body})}();
//# sourceMappingURL=bundle.js.map