mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-17 23:51:43 +03:00
18 lines
50 KiB
JavaScript
18 lines
50 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 r(t){return"function"==typeof t}function o(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 a(t,e){t.appendChild(e)}function s(t,e,n){t.insertBefore(e,n||null)}function c(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 p(){return f(" ")}function h(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function m(t){return function(e){return e.preventDefault(),t.call(this,e)}}function _(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function v(t){return""===t?null:+t}function g(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function b(t,e){t.value=null==e?"":e}function y(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 k;function C(t){k=t}const x=[],T=[],M=[],$=[],O=Promise.resolve();let F=!1;function D(t){M.push(t)}let j=!1;const P=new Set;function W(){if(!j){j=!0;do{for(let t=0;t<x.length;t+=1){const e=x[t];C(e),A(e.$$)}for(C(null),x.length=0;T.length;)T.pop()();for(let t=0;t<M.length;t+=1){const e=M[t];P.has(e)||(P.add(e),e())}M.length=0}while(x.length);for(;$.length;)$.pop()();F=!1,j=!1,P.clear()}}function A(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(D)}}const E=new Set;let S;function z(t,e){t&&t.i&&(E.delete(t),t.i(e))}function R(t,e,n,i){if(t&&t.o){if(E.has(t))return;E.add(t),S.c.push((()=>{E.delete(t),i&&(n&&t.d(1),i())})),t.o(e)}}function B(t){t&&t.c()}function L(t,n,o,u){const{fragment:a,on_mount:s,on_destroy:c,after_update:l}=t.$$;a&&a.m(n,o),u||D((()=>{const n=s.map(e).filter(r);c?c.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(D)}function q(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 I(t,e){-1===t.$$.dirty[0]&&(x.push(t),F||(F=!0,O.then(W)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function H(e,r,o,u,a,s,l=[-1]){const d=k;C(e);const f=e.$$={fragment:null,ctx:null,props:s,update:t,not_equal:a,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 p=!1;if(f.ctx=o?o(e,r.props||{},((t,n,...i)=>{const r=i.length?i[0]:n;return f.ctx&&a(f.ctx[t],f.ctx[t]=r)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](r),p&&I(e,t)),n})):[],f.update(),p=!0,i(f.before_update),f.fragment=!!u&&u(f.ctx),r.target){if(r.hydrate){const t=function(t){return Array.from(t.childNodes)}(r.target);f.fragment&&f.fragment.l(t),t.forEach(c)}else f.fragment&&f.fragment.c();r.intro&&z(e.$$.fragment),L(e,r.target,r.anchor,r.customElement),W()}C(d)}class U{$destroy(){q(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)}}function N(t){var e={exports:{}};return t(e,e.exports),e.exports}var G=N((function(t,e){
|
|
/*! *****************************************************************************
|
|
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 n=function(t,e){return(n=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 i(t,e,n,i){return new(n||(n=Promise))((function(r,o){function u(t){try{s(i.next(t))}catch(t){o(t)}}function a(t){try{s(i.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}s((i=i.apply(t,e||[])).next())}))}function r(t,e){var n,i,r,o,u={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,i=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((r=(r=u.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){u.label=o[1];break}if(6===o[0]&&u.label<r[1]){u.label=r[1],r=o;break}if(r&&u.label<r[2]){u.label=r[2],u.ops.push(o);break}r[2]&&u.ops.pop(),u.trys.pop();continue}o=e.call(t,u)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function o(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 u(t,n){return void 0===n&&(n={}),i(this,void 0,void 0,(function(){return r(this,(function(i){return[2,new Promise((function(i,r){var u=o((function(t){i(t),Reflect.deleteProperty(window,a)}),!0),a=o((function(t){r(t),Reflect.deleteProperty(window,u)}),!0);window.rpc.notify(t,e._assign({callback:u,error:a},n))}))]}))}))}e._assign=function(){return e._assign=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},e._assign.apply(this,arguments)};var a=Object.freeze({__proto__:null,transformCallback:o,invoke:u});e.__awaiter=i,e.__extends=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},e.__generator=r,e.invoke=u,e.tauri=a,e.transformCallback=o})),J={invokeTauriCommand:function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,G.invoke("tauri",t)]}))}))}},V=N((function(t,e){var n=J;function i(t,e,i,r){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(o){return"object"==typeof r&&Object.freeze(r),[2,n.invokeTauriCommand({__tauriModule:"Shell",message:{cmd:"execute",program:t,sidecar:e,onEventFn:G.transformCallback(i),args:"string"==typeof r?[r]:r}})]}))}))}var r=function(){function t(){this.eventListeners={}}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}(),o=function(){function t(t){this.pid=t}return t.prototype.write=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,n.invokeTauriCommand({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:t}})]}))}))},t.prototype.kill=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,n.invokeTauriCommand({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})]}))}))},t}(),u=function(t){function e(e,n){void 0===n&&(n=[]);var i=t.call(this)||this;return i.sidecar=!1,i.stdout=new r,i.stderr=new r,i.pid=null,i.program=e,i.args="string"==typeof n?[n]:n,i}return G.__extends(e,t),e.sidecar=function(t,n){void 0===n&&(n=[]);var i=new e(t,n);return i.sidecar=!0,i},e.prototype.spawn=function(){return G.__awaiter(this,void 0,void 0,(function(){var t=this;return G.__generator(this,(function(e){return[2,i(this.program,this.sidecar,(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.args).then((function(t){return new o(t)}))]}))}))},e.prototype.execute=function(){return G.__awaiter(this,void 0,void 0,(function(){var t=this;return G.__generator(this,(function(e){return[2,new Promise((function(e,n){t.on("error",n);var i=[],r=[];t.stdout.on("data",(function(t){i.push(t)})),t.stderr.on("data",(function(t){r.push(t)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:i.join("\n"),stderr:r.join("\n")})})),t.spawn().catch(n)}))]}))}))},e}(r);function a(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){return[2,n.invokeTauriCommand({__tauriModule:"Shell",message:{cmd:"open",path:t,with:e}})]}))}))}var s=Object.freeze({__proto__:null,Command:u,Child:o,open:a});e.Child=o,e.Command=u,e.open=a,e.shell=s})),X=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Child=V.Child,e.Command=V.Command,e.open=V.open}));function Y(e){let n,i,r;return{c(){n=d("h1"),n.textContent="Welcome",i=p(),r=d("p"),r.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."},m(t,e){s(t,n,e),s(t,i,e),s(t,r,e)},p:t,i:t,o:t,d(t){t&&c(n),t&&c(i),t&&c(r)}}}class K extends U{constructor(t){super(),H(this,t,null,Y,o,{})}}var Q=N((function(t,e){function n(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]}))}))}var i=Object.freeze({__proto__:null,getMatches:n});e.cli=i,e.getMatches=n})),Z=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMatches=Q.getMatches}));function tt(e){let n,i,r,o;return{c(){n=d("div"),i=d("button"),i.textContent="Get matches",_(i,"class","button"),_(i,"id","cli-matches")},m(t,u){s(t,n,u),a(n,i),r||(o=h(i,"click",e[0]),r=!0)},p:t,i:t,o:t,d(t){t&&c(n),r=!1,o()}}}function et(t,e,n){let{onMessage:i}=e;return t.$$set=t=>{"onMessage"in t&&n(1,i=t.onMessage)},[function(){Z.getMatches().then(i).catch(i)},i]}class nt extends U{constructor(t){super(),H(this,t,et,tt,o,{onMessage:1})}}var it=N((function(t,e){function n(t,e){return G.__awaiter(this,void 0,void 0,(function(){var n=this;return G.__generator(this,(function(r){return[2,J.invokeTauriCommand({__tauriModule:"Event",message:{cmd:"listen",event:t,handler:G.transformCallback(e)}}).then((function(t){return function(){return G.__awaiter(n,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,i(t)]}))}))}}))]}))}))}function i(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Event",message:{cmd:"unlisten",eventId:t}})]}))}))}e.emit=function(t,e,n){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){switch(i.label){case 0:return[4,J.invokeTauriCommand({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:e,payload:n}})];case 1:return i.sent(),[2]}}))}))},e.listen=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){return[2,n(t,e)]}))}))},e.once=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(r){return[2,n(t,(function(t){e(t),i(t.id).catch((function(){}))}))]}))}))}})),rt=N((function(t,e){function n(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,it.emit(t,void 0,e)]}))}))}var i=Object.freeze({__proto__:null,emit:n,listen:it.listen,once:it.once});e.emit=n,e.event=i})),ot=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.listen=it.listen,e.once=it.once,e.emit=rt.emit})),ut=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.invoke=G.invoke,e.transformCallback=G.transformCallback}));function at(e){let n,r,o,u,l,f,m,v;return{c(){n=d("div"),r=d("button"),r.textContent="Call Log API",o=p(),u=d("button"),u.textContent="Call Request (async) API",l=p(),f=d("button"),f.textContent="Send event to Rust",_(r,"class","button"),_(r,"id","log"),_(u,"class","button"),_(u,"id","request"),_(f,"class","button"),_(f,"id","event")},m(t,i){s(t,n,i),a(n,r),a(n,o),a(n,u),a(n,l),a(n,f),m||(v=[h(r,"click",e[0]),h(u,"click",e[1]),h(f,"click",e[2])],m=!0)},p:t,i:t,o:t,d(t){t&&c(n),m=!1,i(v)}}}function st(t,e,n){let{onMessage:i}=e;return ot.listen("rust-event",i),t.$$set=t=>{"onMessage"in t&&n(3,i=t.onMessage)},[function(){ut.invoke("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})},function(){ut.invoke("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)},function(){ot.emit("js-event","this is the payload string")},i]}class ct extends U{constructor(t){super(),H(this,t,st,at,o,{onMessage:3})}}var lt=N((function(t,e){function n(t){return void 0===t&&(t={}),G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,J.invokeTauriCommand({__tauriModule:"Dialog",mainThread:!0,message:{cmd:"openDialog",options:t}})]}))}))}function i(t){return void 0===t&&(t={}),G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,J.invokeTauriCommand({__tauriModule:"Dialog",mainThread:!0,message:{cmd:"saveDialog",options:t}})]}))}))}var r=Object.freeze({__proto__:null,open:n,save:i});e.dialog=r,e.open=n,e.save=i})),dt=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.open=lt.open,e.save=lt.save})),ft=N((function(t,e){var n,i=G;function r(t,e){return void 0===e&&(e={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]}))}))}function o(t,e){return void 0===e&&(e={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"readBinaryFile",path:t,options:e}})]}))}))}function u(t,e){return void 0===e&&(e={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return"object"==typeof e&&Object.freeze(e),"object"==typeof t&&Object.freeze(t),[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:t.contents,options:e}})]}))}))}function a(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 r=t.subarray(65536*i,65536*(i+1));e+=String.fromCharCode.apply(null,Array.from(r))}return e}(new Uint8Array(t));return btoa(e)}function s(t,e){return void 0===e&&(e={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return"object"==typeof e&&Object.freeze(e),"object"==typeof t&&Object.freeze(t),[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"writeBinaryFile",path:t.path,contents:a(t.contents),options:e}})]}))}))}function c(t,e){return void 0===e&&(e={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:e}})]}))}))}function l(t,e){return void 0===e&&(e={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})]}))}))}function d(t,e){return void 0===e&&(e={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})]}))}))}function f(t,e,n){return void 0===n&&(n={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(i){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})]}))}))}function p(t,e){return void 0===e&&(e={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})]}))}))}function h(t,e,n){return void 0===n&&(n={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(i){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})]}))}))}e.BaseDirectory=void 0,(n=e.BaseDirectory||(e.BaseDirectory={}))[n.Audio=1]="Audio",n[n.Cache=2]="Cache",n[n.Config=3]="Config",n[n.Data=4]="Data",n[n.LocalData=5]="LocalData",n[n.Desktop=6]="Desktop",n[n.Document=7]="Document",n[n.Download=8]="Download",n[n.Executable=9]="Executable",n[n.Font=10]="Font",n[n.Home=11]="Home",n[n.Picture=12]="Picture",n[n.Public=13]="Public",n[n.Runtime=14]="Runtime",n[n.Template=15]="Template",n[n.Video=16]="Video",n[n.Resource=17]="Resource",n[n.App=18]="App",n[n.Current=19]="Current";var m=Object.freeze({__proto__:null,get BaseDirectory(){return e.BaseDirectory},get Dir(){return e.BaseDirectory},readTextFile:r,readBinaryFile:o,writeFile:u,writeBinaryFile:s,readDir:c,createDir:l,removeDir:d,copyFile:f,removeFile:p,renameFile:h});e.copyFile=f,e.createDir=l,e.fs=m,e.readBinaryFile=o,e.readDir=c,e.readTextFile=r,e.removeDir=d,e.removeFile=p,e.renameFile=h,e.writeBinaryFile=s,e.writeFile=u})),pt=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"BaseDirectory",{enumerable:!0,get:function(){return ft.BaseDirectory}}),Object.defineProperty(e,"Dir",{enumerable:!0,get:function(){return ft.BaseDirectory}}),e.copyFile=ft.copyFile,e.createDir=ft.createDir,e.readBinaryFile=ft.readBinaryFile,e.readDir=ft.readDir,e.readTextFile=ft.readTextFile,e.removeDir=ft.removeDir,e.removeFile=ft.removeFile,e.renameFile=ft.renameFile,e.writeBinaryFile=ft.writeBinaryFile,e.writeFile=ft.writeFile}));function ht(e){let n,r,o,u,l,f,m,v,g,y,w,k,C,x,T,M,$,O,F,D;return{c(){n=d("div"),r=d("input"),o=p(),u=d("input"),l=p(),f=d("div"),m=d("input"),v=p(),g=d("label"),g.textContent="Multiple",y=p(),w=d("div"),k=d("input"),C=p(),x=d("label"),x.textContent="Directory",T=p(),M=d("button"),M.textContent="Open dialog",$=p(),O=d("button"),O.textContent="Open save dialog",_(r,"id","dialog-default-path"),_(r,"placeholder","Default path"),_(u,"id","dialog-filter"),_(u,"placeholder","Extensions filter, comma-separated"),_(u,"class","svelte-1eg58yg"),_(m,"type","checkbox"),_(m,"id","dialog-multiple"),_(g,"for","dialog-multiple"),_(k,"type","checkbox"),_(k,"id","dialog-directory"),_(x,"for","dialog-directory"),_(M,"class","button"),_(M,"id","open-dialog"),_(O,"class","button"),_(O,"id","save-dialog")},m(t,i){s(t,n,i),a(n,r),b(r,e[0]),a(n,o),a(n,u),b(u,e[1]),a(n,l),a(n,f),a(f,m),m.checked=e[2],a(f,v),a(f,g),a(n,y),a(n,w),a(w,k),k.checked=e[3],a(w,C),a(w,x),a(n,T),a(n,M),a(n,$),a(n,O),F||(D=[h(r,"input",e[7]),h(u,"input",e[8]),h(m,"change",e[9]),h(k,"change",e[10]),h(M,"click",e[4]),h(O,"click",e[5])],F=!0)},p(t,[e]){1&e&&r.value!==t[0]&&b(r,t[0]),2&e&&u.value!==t[1]&&b(u,t[1]),4&e&&(m.checked=t[2]),8&e&&(k.checked=t[3])},i:t,o:t,d(t){t&&c(n),F=!1,i(D)}}}function mt(t,e,n){let{onMessage:i}=e,r=null,o=null,u=!1,a=!1;return t.$$set=t=>{"onMessage"in t&&n(6,i=t.onMessage)},[r,o,u,a,function(){dt.open({defaultPath:r,filters:o?[{name:"Tauri Example",extensions:o.split(",").map((t=>t.trim()))}]:[],multiple:u,directory:a}).then((function(t){if(Array.isArray(t))i(t);else{var e=t,n=e.match(/\S+\.\S+$/g);pt.readBinaryFile(e).then((function(r){var o,u,a,s;n&&(e.includes(".png")||e.includes(".jpg"))?(o=new Uint8Array(r),u=function(t){i('<img src="data:image/png;base64,'+t+'"></img>')},a=new Blob([o],{type:"application/octet-binary"}),(s=new FileReader).onload=function(t){var e=t.target.result;u(e.substr(e.indexOf(",")+1))},s.readAsDataURL(a)):i(t)})).catch(i(t))}})).catch(i)},function(){dt.save({defaultPath:r,filters:o?[{name:"Tauri Example",extensions:o.split(",").map((t=>t.trim()))}]:[]}).then(i).catch(i)},i,function(){r=this.value,n(0,r)},function(){o=this.value,n(1,o)},function(){u=this.checked,n(2,u)},function(){a=this.checked,n(3,a)}]}class _t extends U{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}",a(document.head,e)),H(this,t,mt,ht,o,{onMessage:6})}}function vt(t,e,n){const i=t.slice();return i[5]=e[n],i}function gt(e){let n,i,r=e[5][0]+"";return{c(){n=d("option"),i=f(r),n.__value=e[5][1],n.value=n.__value},m(t,e){s(t,n,e),a(n,i)},p:t,d(t){t&&c(n)}}}function bt(e){let n,r,o,u,f,v,g,y,w,k=e[1],C=[];for(let t=0;t<k.length;t+=1)C[t]=gt(vt(e,k,t));return{c(){n=d("form"),r=d("select"),o=d("option"),o.textContent="None";for(let t=0;t<C.length;t+=1)C[t].c();u=p(),f=d("input"),v=p(),g=d("button"),g.textContent="Read",o.__value="",o.value=o.__value,_(r,"class","button"),_(r,"id","dir"),_(f,"id","path-to-read"),_(f,"placeholder","Type the path to read..."),_(g,"class","button"),_(g,"id","read")},m(t,i){s(t,n,i),a(n,r),a(r,o);for(let t=0;t<C.length;t+=1)C[t].m(r,null);a(n,u),a(n,f),b(f,e[0]),a(n,v),a(n,g),y||(w=[h(f,"input",e[4]),h(n,"submit",m(e[2]))],y=!0)},p(t,[e]){if(2&e){let n;for(k=t[1],n=0;n<k.length;n+=1){const i=vt(t,k,n);C[n]?C[n].p(i,e):(C[n]=gt(i),C[n].c(),C[n].m(r,null))}for(;n<C.length;n+=1)C[n].d(1);C.length=k.length}1&e&&f.value!==t[0]&&b(f,t[0])},i:t,o:t,d(t){t&&c(n),l(C,t),y=!1,i(w)}}}function yt(){return document.getElementById("dir").value?parseInt(dir.value):null}function wt(t,e,n){let{onMessage:i}=e,r="";const o=Object.keys(pt.Dir).filter((t=>isNaN(parseInt(t)))).map((t=>[t,pt.Dir[t]]));return t.$$set=t=>{"onMessage"in t&&n(3,i=t.onMessage)},[r,o,function(){const t=r.match(/\S+\.\S+$/g),e={dir:yt()};(t?pt.readBinaryFile(r,e):pt.readDir(r,e)).then((function(e){if(t)if(r.includes(".png")||r.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:r,contents:e.value},{dir:yt()}).catch(i)}))}))}else i(e)})).catch(i)},i,function(){r=this.value,n(0,r)}]}class kt extends U{constructor(t){super(),H(this,t,wt,bt,o,{onMessage:3})}}var Ct=N((function(t,e){var n;e.ResponseType=void 0,(n=e.ResponseType||(e.ResponseType={}))[n.JSON=1]="JSON",n[n.Text=2]="Text",n[n.Binary=3]="Binary";var i=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}(),r=function(){function t(t){this.id=t}return t.prototype.drop=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]}))}))},t.prototype.request=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}})]}))}))},t.prototype.get=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,this.request(G._assign({method:"GET",url:t},e))]}))}))},t.prototype.post=function(t,e,n){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){return[2,this.request(G._assign({method:"POST",url:t,body:e},n))]}))}))},t.prototype.put=function(t,e,n){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){return[2,this.request(G._assign({method:"PUT",url:t,body:e},n))]}))}))},t.prototype.patch=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,this.request(G._assign({method:"PATCH",url:t},e))]}))}))},t.prototype.delete=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,this.request(G._assign({method:"DELETE",url:t},e))]}))}))},t}();function o(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(t){return new r(t)}))]}))}))}var u=null;function a(t,e){var n;return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){switch(i.label){case 0:return null!==u?[3,2]:[4,o()];case 1:u=i.sent(),i.label=2;case 2:return[2,u.request(G._assign({url:t,method:null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"GET"},e))]}}))}))}var s=Object.freeze({__proto__:null,get ResponseType(){return e.ResponseType},Body:i,Client:r,getClient:o,fetch:a});e.Body=i,e.Client=r,e.fetch=a,e.getClient=o,e.http=s})),xt=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Body=Ct.Body,e.Client=Ct.Client,Object.defineProperty(e,"ResponseType",{enumerable:!0,get:function(){return Ct.ResponseType}}),e.fetch=Ct.fetch,e.getClient=Ct.getClient}));function Tt(e){let n,r,o,u,l,f,v,g,k,C,x,T,M,$,O,F,j;return{c(){n=d("form"),r=d("select"),o=d("option"),o.textContent="GET",u=d("option"),u.textContent="POST",l=d("option"),l.textContent="PUT",f=d("option"),f.textContent="PATCH",v=d("option"),v.textContent="DELETE",g=p(),k=d("input"),C=p(),x=d("br"),T=p(),M=d("textarea"),$=p(),O=d("button"),O.textContent="Make request",o.__value="GET",o.value=o.__value,u.__value="POST",u.value=u.__value,l.__value="PUT",l.value=l.__value,f.__value="PATCH",f.value=f.__value,v.__value="DELETE",v.value=v.__value,_(r,"class","button"),_(r,"id","request-method"),void 0===e[0]&&D((()=>e[5].call(r))),_(k,"id","request-url"),_(k,"placeholder","Type the request URL..."),_(M,"id","request-body"),_(M,"placeholder","Request body"),_(M,"rows","5"),y(M,"width","100%"),y(M,"margin-right","10px"),y(M,"font-size","12px"),_(O,"class","button"),_(O,"id","make-request")},m(t,i){s(t,n,i),a(n,r),a(r,o),a(r,u),a(r,l),a(r,f),a(r,v),w(r,e[0]),a(n,g),a(n,k),b(k,e[1]),a(n,C),a(n,x),a(n,T),a(n,M),b(M,e[2]),a(n,$),a(n,O),F||(j=[h(r,"change",e[5]),h(k,"input",e[6]),h(M,"input",e[7]),h(n,"submit",m(e[3]))],F=!0)},p(t,[e]){1&e&&w(r,t[0]),2&e&&k.value!==t[1]&&b(k,t[1]),4&e&&b(M,t[2])},i:t,o:t,d(t){t&&c(n),F=!1,i(j)}}}function Mt(t,e,n){let i="GET",r="",o="",{onMessage:u}=e;return t.$$set=t=>{"onMessage"in t&&n(4,u=t.onMessage)},[i,r,o,async function(){const t=await xt.getClient(),e={url:r||""||"",method:i||"GET"||"GET"};o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]")?e.body=xt.Body.json(JSON.parse(o)):""!==o&&(e.body=xt.Body.text(o)),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(){r=this.value,n(1,r)},function(){o=this.value,n(2,o)}]}class $t extends U{constructor(t){super(),H(this,t,Mt,Tt,o,{onMessage:4})}}function Ot(e){let n,i,r;return{c(){n=d("button"),n.textContent="Send test notification",_(n,"class","button"),_(n,"id","notification")},m(t,o){s(t,n,o),i||(r=h(n,"click",e[0]),i=!0)},p:t,i:t,o:t,d(t){t&&c(n),i=!1,r()}}}function Ft(){new Notification("Notification title",{body:"This is the notification body"})}function Dt(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?Ft():i("Permission is "+t)})).catch(i):"granted"===Notification.permission?Ft():i("Permission is denied")},i]}class jt extends U{constructor(t){super(),H(this,t,Dt,Ot,o,{onMessage:1})}}var Pt=N((function(t,e){function n(){return new o(window.__TAURI__.__currentWindow.label)}function i(){return window.__TAURI__.__windows}var r=["tauri://created","tauri://error"],o=function(){function t(t){this.label=t,this.listeners={}}return t.prototype.listen=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){var n=this;return G.__generator(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,it.listen(t,e)]}))}))},t.prototype.once=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){var n=this;return G.__generator(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,it.once(t,e)]}))}))},t.prototype.emit=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){var n,i;return G.__generator(this,(function(o){if(r.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,it.emit(t,this.label,e)]}))}))},t.prototype._handleTauriEvent=function(t,e){return!!r.includes(t)&&(t in this.listeners?this.listeners[t].push(e):this.listeners[t]=[e],!0)},t}(),u=function(t){function e(e,n){void 0===n&&(n={});var i=t.call(this,e)||this;return J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"createWebview",options:G._assign({label:e},n)}}).then((function(){return G.__awaiter(i,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,this.emit("tauri://created")]}))}))})).catch((function(t){return G.__awaiter(i,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,this.emit("tauri://error",t)]}))}))})),i}return G.__extends(e,t),e.getByLabel=function(t){return i().some((function(e){return e.label===t}))?new o(t):null},e}(o),a=new(function(){function t(){}return t.prototype.setResizable=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setResizable",resizable:t}})]}))}))},t.prototype.setTitle=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setTitle",title:t}})]}))}))},t.prototype.maximize=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"maximize"}})]}))}))},t.prototype.unmaximize=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"unmaximize"}})]}))}))},t.prototype.minimize=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"minimize"}})]}))}))},t.prototype.unminimize=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"unminimize"}})]}))}))},t.prototype.show=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"show"}})]}))}))},t.prototype.hide=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"hide"}})]}))}))},t.prototype.close=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"close"}})]}))}))},t.prototype.setDecorations=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setDecorations",decorations:t}})]}))}))},t.prototype.setAlwaysOnTop=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setAlwaysOnTop",alwaysOnTop:t}})]}))}))},t.prototype.setWidth=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setWidth",width:t}})]}))}))},t.prototype.setHeight=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setHeight",height:t}})]}))}))},t.prototype.resize=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"resize",width:t,height:e}})]}))}))},t.prototype.setMinSize=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setMinSize",minWidth:t,minHeight:e}})]}))}))},t.prototype.setMaxSize=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setMaxSize",maxWidth:t,maxHeight:e}})]}))}))},t.prototype.setX=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setX",x:t}})]}))}))},t.prototype.setY=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setY",y:t}})]}))}))},t.prototype.setPosition=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setPosition",x:t,y:e}})]}))}))},t.prototype.setFullscreen=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setFullscreen",fullscreen:t}})]}))}))},t.prototype.setIcon=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setIcon",icon:t}})]}))}))},t}()),s=Object.freeze({__proto__:null,WebviewWindow:u,getCurrent:n,getAll:i,appWindow:a});e.WebviewWindow=u,e.appWindow=a,e.getAll=i,e.getCurrent=n,e.window=s})),Wt=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.WebviewWindow=Pt.WebviewWindow,e.appWindow=Pt.appWindow,e.getAll=Pt.getAll,e.getCurrent=Pt.getCurrent}));function At(e){let n,r,o,u,l,g,w,k,C,x,T,M,$,O,F,D,j,P,W,A,E,S,z,R,B,L,q,I,H,U,N,G,J,V,X,Y,K,Q,Z,tt,et,nt,it,rt,ot,ut,at,st,ct,lt,dt,ft,pt,ht,mt,_t,vt,gt,bt,yt,wt,kt,Ct,xt,Tt,Mt,$t,Ot,Ft,Dt,jt,Pt,Wt,At,Et,St,zt,Rt,Bt,Lt,qt;return{c(){n=d("div"),r=d("div"),o=d("label"),u=d("input"),l=f("\n Resizable"),g=p(),w=d("label"),k=d("input"),C=f("\n Maximize"),x=p(),T=d("button"),T.textContent="Minimize",M=p(),$=d("button"),$.textContent="Hide",O=p(),F=d("label"),D=d("input"),j=f("\n Transparent"),P=p(),W=d("label"),A=d("input"),E=f("\n Has decorations"),S=p(),z=d("label"),R=d("input"),B=f("\n Always on top"),L=p(),q=d("label"),I=d("input"),H=f("\n Fullscreen"),U=p(),N=d("button"),N.textContent="Change icon",G=p(),J=d("div"),V=d("div"),X=d("div"),Y=d("div"),K=f("X\n "),Q=d("input"),Z=p(),tt=d("div"),et=f("Y\n "),nt=d("input"),it=p(),rt=d("div"),ot=d("div"),ut=f("Width\n "),at=d("input"),st=p(),ct=d("div"),lt=f("Height\n "),dt=d("input"),ft=p(),pt=d("div"),ht=d("div"),mt=f("Min width\n "),_t=d("input"),vt=p(),gt=d("div"),bt=f("Min height\n "),yt=d("input"),wt=p(),kt=d("div"),Ct=d("div"),xt=f("Max width\n "),Tt=d("input"),Mt=p(),$t=d("div"),Ot=f("Max height\n "),Ft=d("input"),Dt=p(),jt=d("form"),Pt=d("input"),Wt=p(),At=d("button"),At.textContent="Set title",Et=p(),St=d("form"),zt=d("input"),Rt=p(),Bt=d("button"),Bt.textContent="Open URL",_(u,"type","checkbox"),_(k,"type","checkbox"),_(T,"title","Unminimizes after 2 seconds"),_($,"title","Visible again after 2 seconds"),_(D,"type","checkbox"),_(A,"type","checkbox"),_(R,"type","checkbox"),_(I,"type","checkbox"),_(Q,"type","number"),_(Q,"min","0"),_(Q,"class","svelte-b76pvm"),_(nt,"type","number"),_(nt,"min","0"),_(nt,"class","svelte-b76pvm"),_(X,"class","flex col grow svelte-b76pvm"),_(at,"type","number"),_(at,"min","400"),_(at,"class","svelte-b76pvm"),_(dt,"type","number"),_(dt,"min","400"),_(dt,"class","svelte-b76pvm"),_(rt,"class","flex col grow svelte-b76pvm"),_(_t,"type","number"),_(_t,"class","svelte-b76pvm"),_(yt,"type","number"),_(yt,"class","svelte-b76pvm"),_(pt,"class","flex col grow svelte-b76pvm"),_(Tt,"type","number"),_(Tt,"min","400"),_(Tt,"class","svelte-b76pvm"),_(Ft,"type","number"),_(Ft,"min","400"),_(Ft,"class","svelte-b76pvm"),_(kt,"class","flex col grow svelte-b76pvm"),_(V,"class","window-controls flex flex-row svelte-b76pvm"),_(n,"class","flex col"),_(Pt,"id","title"),_(At,"class","button"),_(At,"type","submit"),y(jt,"margin-top","24px"),_(zt,"id","url"),_(Bt,"class","button"),_(Bt,"id","open-url"),y(St,"margin-top","24px")},m(t,i){s(t,n,i),a(n,r),a(r,o),a(o,u),u.checked=e[0],a(o,l),a(r,g),a(r,w),a(w,k),k.checked=e[1],a(w,C),a(r,x),a(r,T),a(r,M),a(r,$),a(r,O),a(r,F),a(F,D),D.checked=e[14],a(F,j),a(r,P),a(r,W),a(W,A),A.checked=e[2],a(W,E),a(r,S),a(r,z),a(z,R),R.checked=e[3],a(z,B),a(r,L),a(r,q),a(q,I),I.checked=e[4],a(q,H),a(r,U),a(r,N),a(n,G),a(n,J),a(J,V),a(V,X),a(X,Y),a(Y,K),a(Y,Q),b(Q,e[11]),a(X,Z),a(X,tt),a(tt,et),a(tt,nt),b(nt,e[12]),a(V,it),a(V,rt),a(rt,ot),a(ot,ut),a(ot,at),b(at,e[5]),a(rt,st),a(rt,ct),a(ct,lt),a(ct,dt),b(dt,e[6]),a(V,ft),a(V,pt),a(pt,ht),a(ht,mt),a(ht,_t),b(_t,e[7]),a(pt,vt),a(pt,gt),a(gt,bt),a(gt,yt),b(yt,e[8]),a(V,wt),a(V,kt),a(kt,Ct),a(Ct,xt),a(Ct,Tt),b(Tt,e[9]),a(kt,Mt),a(kt,$t),a($t,Ot),a($t,Ft),b(Ft,e[10]),s(t,Dt,i),s(t,jt,i),a(jt,Pt),b(Pt,e[15]),a(jt,Wt),a(jt,At),s(t,Et,i),s(t,St,i),a(St,zt),b(zt,e[13]),a(St,Rt),a(St,Bt),Lt||(qt=[h(u,"change",e[21]),h(k,"change",e[22]),h(T,"click",e[19]),h($,"click",e[18]),h(D,"change",e[23]),h(A,"change",e[24]),h(R,"change",e[25]),h(I,"change",e[26]),h(N,"click",e[20]),h(Q,"input",e[27]),h(nt,"input",e[28]),h(at,"input",e[29]),h(dt,"input",e[30]),h(_t,"input",e[31]),h(yt,"input",e[32]),h(Tt,"input",e[33]),h(Ft,"input",e[34]),h(Pt,"input",e[35]),h(jt,"submit",m(e[17])),h(zt,"input",e[36]),h(St,"submit",m(e[16]))],Lt=!0)},p(t,e){1&e[0]&&(u.checked=t[0]),2&e[0]&&(k.checked=t[1]),16384&e[0]&&(D.checked=t[14]),4&e[0]&&(A.checked=t[2]),8&e[0]&&(R.checked=t[3]),16&e[0]&&(I.checked=t[4]),2048&e[0]&&v(Q.value)!==t[11]&&b(Q,t[11]),4096&e[0]&&v(nt.value)!==t[12]&&b(nt,t[12]),32&e[0]&&v(at.value)!==t[5]&&b(at,t[5]),64&e[0]&&v(dt.value)!==t[6]&&b(dt,t[6]),128&e[0]&&v(_t.value)!==t[7]&&b(_t,t[7]),256&e[0]&&v(yt.value)!==t[8]&&b(yt,t[8]),512&e[0]&&v(Tt.value)!==t[9]&&b(Tt,t[9]),1024&e[0]&&v(Ft.value)!==t[10]&&b(Ft,t[10]),32768&e[0]&&Pt.value!==t[15]&&b(Pt,t[15]),8192&e[0]&&zt.value!==t[13]&&b(zt,t[13])},i:t,o:t,d(t){t&&c(n),t&&c(Dt),t&&c(jt),t&&c(Et),t&&c(St),Lt=!1,i(qt)}}}function Et(t,e,n){const{setResizable:i,setTitle:r,maximize:o,unmaximize:u,minimize:a,unminimize:s,show:c,hide:l,setTransparent:d,setDecorations:f,setAlwaysOnTop:p,setWidth:h,setHeight:m,setMinSize:_,setMaxSize:g,setX:b,setY:y,setFullscreen:w,setIcon:k}=Wt.appWindow;let C="https://tauri.studio",x=!0,T=!1,M=!1,$=!0,O=!1,F=!1,D=900,j=700,P=600,W=600,A=null,E=null,S=100,z=100,R="Awesome Tauri Example!";return t.$$.update=()=>{1&t.$$.dirty[0]&&i(x),2&t.$$.dirty[0]&&(T?o():u()),4&t.$$.dirty[0]&&f($),8&t.$$.dirty[0]&&p(O),16&t.$$.dirty[0]&&w(F),32&t.$$.dirty[0]&&h(D),64&t.$$.dirty[0]&&m(j),384&t.$$.dirty[0]&&P&&W&&_(P,W),1536&t.$$.dirty[0]&&A&&E&&g(A,E),2048&t.$$.dirty[0]&&b(S),4096&t.$$.dirty[0]&&y(z)},[x,T,$,O,F,D,j,P,W,A,E,S,z,C,M,R,function(){X.open(C)},function(){r(R)},function(){l(),setTimeout(c,2e3)},function(){a(),setTimeout(s,2e3)},function(){dt.open({multiple:!1}).then(k)},function(){x=this.checked,n(0,x)},function(){T=this.checked,n(1,T)},function(){M=this.checked,n(14,M)},function(){$=this.checked,n(2,$)},function(){O=this.checked,n(3,O)},function(){F=this.checked,n(4,F)},function(){S=v(this.value),n(11,S)},function(){z=v(this.value),n(12,z)},function(){D=v(this.value),n(5,D)},function(){j=v(this.value),n(6,j)},function(){P=v(this.value),n(7,P)},function(){W=v(this.value),n(8,W)},function(){A=v(this.value),n(9,A)},function(){E=v(this.value),n(10,E)},function(){R=this.value,n(15,R)},function(){C=this.value,n(13,C)}]}class St extends U{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}",a(document.head,e)),H(this,t,Et,At,o,{},[-1,-1])}}const zt=[];var Rt=N((function(t,e){function n(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:G.transformCallback(e)}})]}))}))}function i(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:G.transformCallback(e)}})]}))}))}function r(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]}))}))}function o(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]}))}))}function u(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]}))}))}var a=Object.freeze({__proto__:null,register:n,registerAll:i,isRegistered:r,unregister:o,unregisterAll:u});e.globalShortcut=a,e.isRegistered=r,e.register=n,e.registerAll=i,e.unregister=o,e.unregisterAll=u})),Bt=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isRegistered=Rt.isRegistered,e.register=Rt.register,e.registerAll=Rt.registerAll,e.unregister=Rt.unregister,e.unregisterAll=Rt.unregisterAll}));function Lt(t,e,n){const i=t.slice();return i[9]=e[n],i}function qt(t){let e,n,i,r,o,u,l=t[9]+"";function m(){return t[8](t[9])}return{c(){e=d("div"),n=f(l),i=p(),r=d("button"),r.textContent="Unregister",_(r,"type","button")},m(t,c){s(t,e,c),a(e,n),a(e,i),a(e,r),o||(u=h(r,"click",m),o=!0)},p(e,i){t=e,2&i&&l!==(l=t[9]+"")&&g(n,l)},d(t){t&&c(e),o=!1,u()}}}function It(e){let n,i,r;return{c(){n=d("button"),n.textContent="Unregister all",_(n,"type","button")},m(t,o){s(t,n,o),i||(r=h(n,"click",e[5]),i=!0)},p:t,d(t){t&&c(n),i=!1,r()}}}function Ht(e){let n,r,o,u,f,m,v,g,y,w,k=e[1],C=[];for(let t=0;t<k.length;t+=1)C[t]=qt(Lt(e,k,t));let x=e[1].length&&It(e);return{c(){n=d("div"),r=d("div"),o=d("input"),u=p(),f=d("button"),f.textContent="Register",m=p(),v=d("div");for(let t=0;t<C.length;t+=1)C[t].c();g=p(),x&&x.c(),_(o,"placeholder","Type a shortcut with '+' as separator..."),_(f,"type","button")},m(t,i){s(t,n,i),a(n,r),a(r,o),b(o,e[0]),a(r,u),a(r,f),a(n,m),a(n,v);for(let t=0;t<C.length;t+=1)C[t].m(v,null);a(v,g),x&&x.m(v,null),y||(w=[h(o,"input",e[7]),h(f,"click",e[3])],y=!0)},p(t,[e]){if(1&e&&o.value!==t[0]&&b(o,t[0]),18&e){let n;for(k=t[1],n=0;n<k.length;n+=1){const i=Lt(t,k,n);C[n]?C[n].p(i,e):(C[n]=qt(i),C[n].c(),C[n].m(v,g))}for(;n<C.length;n+=1)C[n].d(1);C.length=k.length}t[1].length?x?x.p(t,e):(x=It(t),x.c(),x.m(v,null)):x&&(x.d(1),x=null)},i:t,o:t,d(t){t&&c(n),l(C,t),x&&x.d(),y=!1,i(w)}}}function Ut(e,n,i){let r,{onMessage:a}=n;const s=function(e,n=t){let i;const r=[];function u(t){if(o(e,t)&&(e=t,i)){const t=!zt.length;for(let t=0;t<r.length;t+=1){const n=r[t];n[1](),zt.push(n,e)}if(t){for(let t=0;t<zt.length;t+=2)zt[t][0](zt[t+1]);zt.length=0}}}return{set:u,update:function(t){u(t(e))},subscribe:function(o,a=t){const s=[o,a];return r.push(s),1===r.length&&(i=n(u)||t),o(e),()=>{const t=r.indexOf(s);-1!==t&&r.splice(t,1),0===r.length&&(i(),i=null)}}}}([]);u(e,s,(t=>i(1,r=t)));let c="CmdOrControl+X";function l(t){const e=t;Bt.unregister(e).then((()=>{s.update((t=>t.filter((t=>t!==e)))),a(`Shortcut ${e} unregistered`)})).catch(a)}return e.$$set=t=>{"onMessage"in t&&i(6,a=t.onMessage)},[c,r,s,function(){const t=c;Bt.register(t,(()=>{a(`Shortcut ${t} triggered`)})).then((()=>{s.update((e=>[...e,t])),a(`Shortcut ${t} registered successfully`)})).catch(a)},l,function(){Bt.unregisterAll().then((()=>{s.update((()=>[])),a("Unregistered all shortcuts")})).catch(a)},a,function(){c=this.value,i(0,c)},t=>l(t)]}class Nt extends U{constructor(t){super(),H(this,t,Ut,Ht,o,{onMessage:6})}}function Gt(t){let e,n,r,o,u;return{c(){e=d("input"),n=p(),r=d("button"),r.textContent="Write",_(e,"placeholder","write to stdin"),_(r,"class","button")},m(i,a){s(i,e,a),b(e,t[1]),s(i,n,a),s(i,r,a),o||(u=[h(e,"input",t[8]),h(r,"click",t[5])],o=!0)},p(t,n){2&n&&e.value!==t[1]&&b(e,t[1])},d(t){t&&c(e),t&&c(n),t&&c(r),o=!1,i(u)}}}function Jt(e){let n,r,o,u,l,f,m,v,g,y,w=e[2]&&Gt(e);return{c(){n=d("div"),r=d("div"),o=d("input"),u=p(),l=d("button"),l.textContent="Run",f=p(),m=d("button"),m.textContent="Kill",v=p(),w&&w.c(),_(l,"class","button"),_(m,"class","button")},m(t,i){s(t,n,i),a(n,r),a(r,o),b(o,e[0]),a(r,u),a(r,l),a(r,f),a(r,m),a(r,v),w&&w.m(r,null),g||(y=[h(o,"input",e[7]),h(l,"click",e[3]),h(m,"click",e[4])],g=!0)},p(t,[e]){1&e&&o.value!==t[0]&&b(o,t[0]),t[2]?w?w.p(t,e):(w=Gt(t),w.c(),w.m(r,null)):w&&(w.d(1),w=null)},i:t,o:t,d(t){t&&c(n),w&&w.d(),g=!1,i(y)}}}function Vt(t,e,n){const i=navigator.userAgent.includes("Windows");let r,o=i?"cmd":"sh",u=i?["/C"]:["-c"],{onMessage:a}=e,s='echo "hello world"',c="";return t.$$set=t=>{"onMessage"in t&&n(6,a=t.onMessage)},[s,c,r,function(){n(2,r=null);const t=new X.Command(o,[...u,s]);t.on("close",(t=>{a(`command finished with code ${t.code} and signal ${t.signal}`),n(2,r=null)})),t.on("error",(t=>a(`command error: "${t}"`))),t.stdout.on("data",(t=>a(`command stdout: "${t}"`))),t.stderr.on("data",(t=>a(`command stderr: "${t}"`))),t.spawn().then((t=>{n(2,r=t)})).catch(a)},function(){r.kill().then((()=>a("killed child process"))).error(a)},function(){r.write(c).catch(a)},a,function(){s=this.value,n(0,s)},function(){c=this.value,n(1,c)}]}class Xt extends U{constructor(t){super(),H(this,t,Vt,Jt,o,{onMessage:6})}}function Yt(t,e,n){const i=t.slice();return i[8]=e[n],i}function Kt(t){let e,n,i,r,o,u,l=t[8].label+"";function m(){return t[6](t[8])}return{c(){e=d("p"),n=f(l),i=p(),_(e,"class",r="nv noselect "+(t[0]===t[8]?"nv_selected":""))},m(t,r){s(t,e,r),a(e,n),a(e,i),o||(u=h(e,"click",m),o=!0)},p(n,i){t=n,1&i&&r!==(r="nv noselect "+(t[0]===t[8]?"nv_selected":""))&&_(e,"class",r)},d(t){t&&c(e),o=!1,u()}}}function Qt(t){let e,n,r,o,u,m,v,b,w,k,C,x,T,M,$,O,F,D,j,P,W,A,E,I=t[2],H=[];for(let e=0;e<I.length;e+=1)H[e]=Kt(Yt(t,I,e));var U=t[0].component;function N(t){return{props:{onMessage:t[4]}}}return U&&(x=new U(N(t))),{c(){e=d("main"),n=d("div"),r=d("img"),u=p(),m=d("div"),m.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>',v=p(),b=d("div"),w=d("div");for(let t=0;t<H.length;t+=1)H[t].c();k=p(),C=d("div"),x&&B(x.$$.fragment),T=p(),M=d("div"),$=d("p"),O=d("strong"),O.textContent="Tauri Console",F=p(),D=d("a"),D.textContent="clear",j=p(),P=f(t[1]),r.src!==(o="tauri.png")&&_(r,"src","tauri.png"),_(r,"height","60"),_(r,"alt","logo"),_(n,"class","flex row noselect just-around"),_(n,"style","margin=1em;"),y(w,"width","15em"),y(w,"margin-left","0.5em"),_(C,"class","content"),_(b,"class","flex row"),_(D,"class","nv"),_($,"class","flex row just-around"),_(M,"id","response"),y(M,"white-space","pre-line")},m(i,o){s(i,e,o),a(e,n),a(n,r),a(n,u),a(n,m),a(e,v),a(e,b),a(b,w);for(let t=0;t<H.length;t+=1)H[t].m(w,null);a(b,k),a(b,C),x&&L(x,C,null),a(e,T),a(e,M),a(M,$),a($,O),a($,F),a($,D),a(M,j),a(M,P),W=!0,A||(E=[h(r,"click",t[5]),h(D,"click",t[7])],A=!0)},p(t,[e]){if(13&e){let n;for(I=t[2],n=0;n<I.length;n+=1){const i=Yt(t,I,n);H[n]?H[n].p(i,e):(H[n]=Kt(i),H[n].c(),H[n].m(w,null))}for(;n<H.length;n+=1)H[n].d(1);H.length=I.length}if(U!==(U=t[0].component)){if(x){S={r:0,c:[],p:S};const t=x;R(t.$$.fragment,1,0,(()=>{q(t,1)})),S.r||i(S.c),S=S.p}U?(x=new U(N(t)),B(x.$$.fragment),z(x.$$.fragment,1),L(x,C,null)):x=null}(!W||2&e)&&g(P,t[1])},i(t){W||(x&&z(x.$$.fragment,t),W=!0)},o(t){x&&R(x.$$.fragment,t),W=!1},d(t){t&&c(e),l(H,t),x&&q(x),A=!1,i(E)}}}function Zt(t,e,n){const i=[{label:"Welcome",component:K},{label:"Messages",component:ct},{label:"CLI",component:nt},{label:"Dialog",component:_t},{label:"File system",component:kt},{label:"HTTP",component:$t},{label:"Notifications",component:jt},{label:"Window",component:St},{label:"Shortcuts",component:Nt},{label:"Shell",component:Xt}];let r=i[0],o=[""];function u(t){n(0,r=t)}return[r,o,i,u,function(t){n(1,o+="string"==typeof t?t:JSON.stringify(t)),n(1,o+="\n")},function(){X.open("https://tauri.studio/")},t=>u(t),()=>{n(1,o=[""])}]}return new class extends U{constructor(t){super(),H(this,t,Zt,Qt,o,{})}}({target:document.body})}();
|
|
//# sourceMappingURL=bundle.js.map
|