tauri/examples/api/public/build/bundle.js
Alve Larsson 53fd48e811
API example new ui (#1310)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2021-03-14 22:48:08 -03:00

18 lines
46 KiB
JavaScript

var app=function(){"use strict";function e(){}function t(e){return e()}function n(){return Object.create(null)}function i(e){e.forEach(t)}function o(e){return"function"==typeof e}function r(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function u(t,n,i){t.$$.on_destroy.push(function(t,...n){if(null==t)return e;const i=t.subscribe(...n);return i.unsubscribe?()=>i.unsubscribe():i}(n,i))}function a(e,t){e.appendChild(t)}function s(e,t,n){e.insertBefore(t,n||null)}function c(e){e.parentNode.removeChild(e)}function l(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function d(e){return document.createElement(e)}function f(e){return document.createTextNode(e)}function p(){return f(" ")}function h(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function _(e){return function(t){return t.preventDefault(),e.call(this,t)}}function m(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function v(e){return""===e?null:+e}function g(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function b(e,t){e.value=null==t?"":t}function y(e,t,n,i){e.style.setProperty(t,n,i?"important":"")}function w(e,t){for(let n=0;n<e.options.length;n+=1){const i=e.options[n];if(i.__value===t)return void(i.selected=!0)}}let k;function x(e){k=e}const C=[],T=[],M=[],$=[],O=Promise.resolve();let F=!1;function D(e){M.push(e)}let j=!1;const P=new Set;function W(){if(!j){j=!0;do{for(let e=0;e<C.length;e+=1){const t=C[e];x(t),A(t.$$)}for(x(null),C.length=0;T.length;)T.pop()();for(let e=0;e<M.length;e+=1){const t=M[e];P.has(t)||(P.add(t),t())}M.length=0}while(C.length);for(;$.length;)$.pop()();F=!1,j=!1,P.clear()}}function A(e){if(null!==e.fragment){e.update(),i(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(D)}}const z=new Set;let S;function E(e,t){e&&e.i&&(z.delete(e),e.i(t))}function B(e,t,n,i){if(e&&e.o){if(z.has(e))return;z.add(e),S.c.push((()=>{z.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}}function R(e){e&&e.c()}function q(e,n,r,u){const{fragment:a,on_mount:s,on_destroy:c,after_update:l}=e.$$;a&&a.m(n,r),u||D((()=>{const n=s.map(t).filter(o);c?c.push(...n):i(n),e.$$.on_mount=[]})),l.forEach(D)}function H(e,t){const n=e.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function I(e,t){-1===e.$$.dirty[0]&&(C.push(e),F||(F=!0,O.then(W)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function L(t,o,r,u,a,s,l=[-1]){const d=k;x(t);const f=t.$$={fragment:null,ctx:null,props:s,update:e,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=r?r(t,o.props||{},((e,n,...i)=>{const o=i.length?i[0]:n;return f.ctx&&a(f.ctx[e],f.ctx[e]=o)&&(!f.skip_bound&&f.bound[e]&&f.bound[e](o),p&&I(t,e)),n})):[],f.update(),p=!0,i(f.before_update),f.fragment=!!u&&u(f.ctx),o.target){if(o.hydrate){const e=function(e){return Array.from(e.childNodes)}(o.target);f.fragment&&f.fragment.l(e),e.forEach(c)}else f.fragment&&f.fragment.c();o.intro&&E(t.$$.fragment),q(t,o.target,o.anchor,o.customElement),W()}x(d)}class N{$destroy(){H(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function U(e){var t={exports:{}};return e(t,t.exports),t.exports}var G=U((function(e,t){
/*! *****************************************************************************
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(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function i(e,t,n,i){return new(n||(n=Promise))((function(o,r){function u(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}s((i=i.apply(e,t||[])).next())}))}function o(e,t){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:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){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=t.call(e,u)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function r(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function u(e,t){void 0===t&&(t=!1);var n=r()+r()+"-"+r()+"-"+r()+"-"+r()+"-"+r()+r()+r();return Object.defineProperty(window,n,{value:function(i){return t&&Reflect.deleteProperty(window,n),null==e?void 0:e(i)},writable:!1,configurable:!0}),n}function a(e,n){return void 0===n&&(n={}),i(this,void 0,void 0,(function(){return o(this,(function(i){return[2,new Promise((function(i,o){var r=u((function(e){i(e),Reflect.deleteProperty(window,a)}),!0),a=u((function(e){o(e),Reflect.deleteProperty(window,r)}),!0);window.rpc.notify(e,t._assign({callback:r,error:a},n))}))]}))}))}t._assign=function(){return t._assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t._assign.apply(this,arguments)};var s=Object.freeze({__proto__:null,transformCallback:u,invoke:a});t.__awaiter=i,t.__extends=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},t.__generator=o,t.invoke=a,t.tauri=s,t.transformCallback=u})),J={invokeTauriCommand:function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,G.invoke("tauri",e)]}))}))}},X=U((function(e,t){function n(e,t,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:"listen",event:e,handler:G.transformCallback(t,n),once:n}})];case 1:return i.sent(),[2]}}))}))}t.emit=function(e,t,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:e,windowLabel:t,payload:n}})];case 1:return i.sent(),[2]}}))}))},t.listen=function(e,t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){return[2,n(e,t,!1)]}))}))},t.once=function(e,t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){return[2,n(e,t,!0)]}))}))}})),Y=U((function(e,t){function n(){return new r(window.__TAURI__.__currentWindow.label)}function i(){return window.__TAURI__.__windows}var o=["tauri://created","tauri://error"],r=function(){function e(e){this.label=e,this.listeners={}}return e.prototype.listen=function(e,t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return this._handleTauriEvent(e,t)?[2,Promise.resolve()]:[2,X.listen(e,t)]}))}))},e.prototype.once=function(e,t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return this._handleTauriEvent(e,t)?[2,Promise.resolve()]:[2,X.once(e,t)]}))}))},e.prototype.emit=function(e,t){return G.__awaiter(this,void 0,void 0,(function(){var n,i;return G.__generator(this,(function(r){if(o.includes(e)){for(n=0,i=this.listeners[e]||[];n<i.length;n++)(0,i[n])({type:e,payload:t});return[2,Promise.resolve()]}return[2,X.emit(e,this.label,t)]}))}))},e.prototype._handleTauriEvent=function(e,t){return!!o.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)},e}(),u=function(e){function t(t,n){void 0===n&&(n={});var i=e.call(this,t)||this;return J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"createWebview",options:G._assign({label:t},n)}}).then((function(){return G.__awaiter(i,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,this.emit("tauri://created")]}))}))})).catch((function(e){return G.__awaiter(i,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,this.emit("tauri://error",e)]}))}))})),i}return G.__extends(t,e),t.getByLabel=function(e){return i().some((function(t){return t.label===e}))?new r(e):null},t}(r),a=new(function(){function e(){}return e.prototype.setResizable=function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setResizable",resizable:e}})]}))}))},e.prototype.setTitle=function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setTitle",title:e}})]}))}))},e.prototype.maximize=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"maximize"}})]}))}))},e.prototype.unmaximize=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"unmaximize"}})]}))}))},e.prototype.minimize=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"minimize"}})]}))}))},e.prototype.unminimize=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"unminimize"}})]}))}))},e.prototype.show=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"show"}})]}))}))},e.prototype.hide=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"hide"}})]}))}))},e.prototype.close=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"close"}})]}))}))},e.prototype.setDecorations=function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setDecorations",decorations:e}})]}))}))},e.prototype.setAlwaysOnTop=function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setAlwaysOnTop",alwaysOnTop:e}})]}))}))},e.prototype.setWidth=function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setWidth",width:e}})]}))}))},e.prototype.setHeight=function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setHeight",height:e}})]}))}))},e.prototype.resize=function(e,t){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:e,height:t}})]}))}))},e.prototype.setMinSize=function(e,t){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:e,minHeight:t}})]}))}))},e.prototype.setMaxSize=function(e,t){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:e,maxHeight:t}})]}))}))},e.prototype.setX=function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setX",x:e}})]}))}))},e.prototype.setY=function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setY",y:e}})]}))}))},e.prototype.setPosition=function(e,t){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:e,y:t}})]}))}))},e.prototype.setFullscreen=function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setFullscreen",fullscreen:e}})]}))}))},e.prototype.setIcon=function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Window",message:{cmd:"setIcon",icon:e}})]}))}))},e}()),s=Object.freeze({__proto__:null,WebviewWindow:u,getCurrent:n,getAll:i,appWindow:a});t.WebviewWindow=u,t.appWindow=a,t.getAll=i,t.getCurrent=n,t.window=s})),V=U((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.WebviewWindow=Y.WebviewWindow,t.appWindow=Y.appWindow,t.getAll=Y.getAll,t.getCurrent=Y.getCurrent})),K=U((function(e,t){function n(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]}))}))}var i=Object.freeze({__proto__:null,getMatches:n});t.cli=i,t.getMatches=n})),Q=U((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMatches=K.getMatches}));function Z(t){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(e,u){s(e,n,u),a(n,i),o||(r=h(i,"click",t[0]),o=!0)},p:e,i:e,o:e,d(e){e&&c(n),o=!1,r()}}}function ee(e,t,n){let{onMessage:i}=t;return e.$$set=e=>{"onMessage"in e&&n(1,i=e.onMessage)},[function(){Q.getMatches().then(i).catch(i)},i]}class te extends N{constructor(e){super(),L(this,e,ee,Z,r,{onMessage:1})}}var ne=U((function(e,t){function n(e,t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,X.emit(e,void 0,t)]}))}))}var i=Object.freeze({__proto__:null,emit:n,listen:X.listen,once:X.once});t.emit=n,t.event=i})),ie=U((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.listen=X.listen,t.once=X.once,t.emit=ne.emit})),oe=U((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.invoke=G.invoke,t.transformCallback=G.transformCallback}));function re(t){let n,o,r,u,l,f,_,v;return{c(){n=d("div"),o=d("button"),o.textContent="Call Log API",r=p(),u=d("button"),u.textContent="Call Request (async) API",l=p(),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(e,i){s(e,n,i),a(n,o),a(n,r),a(n,u),a(n,l),a(n,f),_||(v=[h(o,"click",t[0]),h(u,"click",t[1]),h(f,"click",t[2])],_=!0)},p:e,i:e,o:e,d(e){e&&c(n),_=!1,i(v)}}}function ue(e,t,n){let{onMessage:i}=t;return ie.listen("rust-event",i),e.$$set=e=>{"onMessage"in e&&n(3,i=e.onMessage)},[function(){oe.invoke("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})},function(){oe.invoke("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)},function(){ie.emit("js-event","this is the payload string")},i]}class ae extends N{constructor(e){super(),L(this,e,ue,re,r,{onMessage:3})}}var se=U((function(e,t){function n(e){return void 0===e&&(e={}),G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return"object"==typeof e&&Object.freeze(e),[2,J.invokeTauriCommand({__tauriModule:"Dialog",mainThread:!0,message:{cmd:"openDialog",options:e}})]}))}))}function i(e){return void 0===e&&(e={}),G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return"object"==typeof e&&Object.freeze(e),[2,J.invokeTauriCommand({__tauriModule:"Dialog",mainThread:!0,message:{cmd:"saveDialog",options:e}})]}))}))}var o=Object.freeze({__proto__:null,open:n,save:i});t.dialog=o,t.open=n,t.save=i})),ce=U((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.open=se.open,t.save=se.save})),le=U((function(e,t){var n,i=G;function o(e,t){return void 0===t&&(t={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"readTextFile",path:e,options:t}})]}))}))}function r(e,t){return void 0===t&&(t={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"readBinaryFile",path:e,options:t}})]}))}))}function u(e,t){return void 0===t&&(t={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return"object"==typeof t&&Object.freeze(t),"object"==typeof e&&Object.freeze(e),[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:e.contents,options:t}})]}))}))}function a(e){var t=function(e){if(e.length<65536)return String.fromCharCode.apply(null,Array.from(e));for(var t="",n=e.length,i=0;i<n;i++){var o=e.subarray(65536*i,65536*(i+1));t+=String.fromCharCode.apply(null,Array.from(o))}return t}(new Uint8Array(e));return btoa(t)}function s(e,t){return void 0===t&&(t={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return"object"==typeof t&&Object.freeze(t),"object"==typeof e&&Object.freeze(e),[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"writeBinaryFile",path:e.path,contents:a(e.contents),options:t}})]}))}))}function c(e,t){return void 0===t&&(t={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})]}))}))}function l(e,t){return void 0===t&&(t={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})]}))}))}function d(e,t){return void 0===t&&(t={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})]}))}))}function f(e,t,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:e,destination:t,options:n}})]}))}))}function p(e,t){return void 0===t&&(t={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})]}))}))}function h(e,t,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:e,newPath:t,options:n}})]}))}))}t.BaseDirectory=void 0,(n=t.BaseDirectory||(t.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";var _=Object.freeze({__proto__:null,get BaseDirectory(){return t.BaseDirectory},get Dir(){return t.BaseDirectory},readTextFile:o,readBinaryFile:r,writeFile:u,writeBinaryFile:s,readDir:c,createDir:l,removeDir:d,copyFile:f,removeFile:p,renameFile:h});t.copyFile=f,t.createDir=l,t.fs=_,t.readBinaryFile=r,t.readDir=c,t.readTextFile=o,t.removeDir=d,t.removeFile=p,t.renameFile=h,t.writeBinaryFile=s,t.writeFile=u})),de=U((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BaseDirectory",{enumerable:!0,get:function(){return le.BaseDirectory}}),Object.defineProperty(t,"Dir",{enumerable:!0,get:function(){return le.BaseDirectory}}),t.copyFile=le.copyFile,t.createDir=le.createDir,t.readBinaryFile=le.readBinaryFile,t.readDir=le.readDir,t.readTextFile=le.readTextFile,t.removeDir=le.removeDir,t.removeFile=le.removeFile,t.renameFile=le.renameFile,t.writeBinaryFile=le.writeBinaryFile,t.writeFile=le.writeFile}));function fe(t){let n,o,r,u,l,f,_,v,g,y,w,k,x,C,T,M,$,O,F,D;return{c(){n=d("div"),o=d("input"),r=p(),u=d("input"),l=p(),f=d("div"),_=d("input"),v=p(),g=d("label"),g.textContent="Multiple",y=p(),w=d("div"),k=d("input"),x=p(),C=d("label"),C.textContent="Directory",T=p(),M=d("button"),M.textContent="Open dialog",$=p(),O=d("button"),O.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(_,"type","checkbox"),m(_,"id","dialog-multiple"),m(g,"for","dialog-multiple"),m(k,"type","checkbox"),m(k,"id","dialog-directory"),m(C,"for","dialog-directory"),m(M,"class","button"),m(M,"id","open-dialog"),m(O,"class","button"),m(O,"id","save-dialog")},m(e,i){s(e,n,i),a(n,o),b(o,t[0]),a(n,r),a(n,u),b(u,t[1]),a(n,l),a(n,f),a(f,_),_.checked=t[2],a(f,v),a(f,g),a(n,y),a(n,w),a(w,k),k.checked=t[3],a(w,x),a(w,C),a(n,T),a(n,M),a(n,$),a(n,O),F||(D=[h(o,"input",t[7]),h(u,"input",t[8]),h(_,"change",t[9]),h(k,"change",t[10]),h(M,"click",t[4]),h(O,"click",t[5])],F=!0)},p(e,[t]){1&t&&o.value!==e[0]&&b(o,e[0]),2&t&&u.value!==e[1]&&b(u,e[1]),4&t&&(_.checked=e[2]),8&t&&(k.checked=e[3])},i:e,o:e,d(e){e&&c(n),F=!1,i(D)}}}function pe(e,t,n){let{onMessage:i}=t,o=null,r=null,u=!1,a=!1;return e.$$set=e=>{"onMessage"in e&&n(6,i=e.onMessage)},[o,r,u,a,function(){ce.open({defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map((e=>e.trim()))}]:[],multiple:u,directory:a}).then((function(e){if(Array.isArray(e))i(e);else{var t=e,n=t.match(/\S+\.\S+$/g);de.readBinaryFile(t).then((function(o){var r,u,a,s;n&&(t.includes(".png")||t.includes(".jpg"))?(r=new Uint8Array(o),u=function(e){i('<img src="data:image/png;base64,'+e+'"></img>')},a=new Blob([r],{type:"application/octet-binary"}),(s=new FileReader).onload=function(e){var t=e.target.result;u(t.substr(t.indexOf(",")+1))},s.readAsDataURL(a)):i(e)})).catch(i(e))}})).catch(i)},function(){ce.save({defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map((e=>e.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(){a=this.checked,n(3,a)}]}class he extends N{constructor(e){var t;super(),document.getElementById("svelte-1eg58yg-style")||((t=d("style")).id="svelte-1eg58yg-style",t.textContent="#dialog-filter.svelte-1eg58yg{width:260px}",a(document.head,t)),L(this,e,pe,fe,r,{onMessage:6})}}function _e(e,t,n){const i=e.slice();return i[5]=t[n],i}function me(t){let n,i,o=t[5][0]+"";return{c(){n=d("option"),i=f(o),n.__value=t[5][1],n.value=n.__value},m(e,t){s(e,n,t),a(n,i)},p:e,d(e){e&&c(n)}}}function ve(t){let n,o,r,u,f,v,g,y,w,k=t[1],x=[];for(let e=0;e<k.length;e+=1)x[e]=me(_e(t,k,e));return{c(){n=d("form"),o=d("select"),r=d("option"),r.textContent="None";for(let e=0;e<x.length;e+=1)x[e].c();u=p(),f=d("input"),v=p(),g=d("button"),g.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(g,"class","button"),m(g,"id","read")},m(e,i){s(e,n,i),a(n,o),a(o,r);for(let e=0;e<x.length;e+=1)x[e].m(o,null);a(n,u),a(n,f),b(f,t[0]),a(n,v),a(n,g),y||(w=[h(f,"input",t[4]),h(n,"submit",_(t[2]))],y=!0)},p(e,[t]){if(2&t){let n;for(k=e[1],n=0;n<k.length;n+=1){const i=_e(e,k,n);x[n]?x[n].p(i,t):(x[n]=me(i),x[n].c(),x[n].m(o,null))}for(;n<x.length;n+=1)x[n].d(1);x.length=k.length}1&t&&f.value!==e[0]&&b(f,e[0])},i:e,o:e,d(e){e&&c(n),l(x,e),y=!1,i(w)}}}function ge(){return document.getElementById("dir").value?parseInt(dir.value):null}function be(e,t,n){let{onMessage:i}=t,o="";const r=Object.keys(de.Dir).filter((e=>isNaN(parseInt(e)))).map((e=>[e,de.Dir[e]]));return e.$$set=e=>{"onMessage"in e&&n(3,i=e.onMessage)},[o,r,function(){const e=o.match(/\S+\.\S+$/g),t={dir:ge()};(e?de.readBinaryFile(o,t):de.readDir(o,t)).then((function(t){if(e)if(o.includes(".png")||o.includes(".jpg"))!function(e,t){const n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(e){const n=e.target.result;t(n.substr(n.indexOf(",")+1))},i.readAsDataURL(n)}(new Uint8Array(t),(function(e){i('<img src="'+("data:image/png;base64,"+e)+'"></img>')}));else{const e=String.fromCharCode.apply(null,t);i('<textarea id="file-response" style="height: 400px"></textarea><button id="file-save">Save</button>'),setTimeout((()=>{const t=document.getElementById("file-response");t.value=e,document.getElementById("file-save").addEventListener("click",(function(){writeFile({file:o,contents:t.value},{dir:ge()}).catch(i)}))}))}else i(t)})).catch(i)},i,function(){o=this.value,n(0,o)}]}class ye extends N{constructor(e){super(),L(this,e,be,ve,r,{onMessage:3})}}var we=U((function(e,t){var n;t.ResponseType=void 0,(n=t.ResponseType||(t.ResponseType={}))[n.JSON=1]="JSON",n[n.Text=2]="Text",n[n.Binary=3]="Binary";var i=function(){function e(e,t){this.type=e,this.payload=t}return e.form=function(t){return new e("Form",t)},e.json=function(t){return new e("Json",t)},e.text=function(t){return new e("Text",t)},e.bytes=function(t){return new e("Bytes",t)},e}(),o=function(){function e(e){this.id=e}return e.prototype.drop=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]}))}))},e.prototype.request=function(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}})]}))}))},e.prototype.get=function(e,t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,this.request(G._assign({method:"GET",url:e},t))]}))}))},e.prototype.post=function(e,t,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:e,body:t},n))]}))}))},e.prototype.put=function(e,t,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:e,body:t},n))]}))}))},e.prototype.patch=function(e,t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,this.request(G._assign({method:"PATCH",url:e},t))]}))}))},e.prototype.delete=function(e,t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,this.request(G._assign({method:"DELETE",url:e},t))]}))}))},e}();function r(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then((function(e){return new o(e)}))]}))}))}var u=null;function a(e,t){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,r()];case 1:u=i.sent(),i.label=2;case 2:return[2,u.request(G._assign({url:e,method:null!==(n=null==t?void 0:t.method)&&void 0!==n?n:"GET"},t))]}}))}))}var s=Object.freeze({__proto__:null,get ResponseType(){return t.ResponseType},Body:i,Client:o,getClient:r,fetch:a});t.Body=i,t.Client=o,t.fetch=a,t.getClient=r,t.http=s})),ke=U((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Body=we.Body,t.Client=we.Client,Object.defineProperty(t,"ResponseType",{enumerable:!0,get:function(){return we.ResponseType}}),t.fetch=we.fetch,t.getClient=we.getClient}));function xe(t){let n,o,r,u,l,f,v,g,k,x,C,T,M,$,O,F,j;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",v=d("option"),v.textContent="DELETE",g=p(),k=d("input"),x=p(),C=d("br"),T=p(),M=d("textarea"),$=p(),O=d("button"),O.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,v.__value="DELETE",v.value=v.__value,m(o,"class","button"),m(o,"id","request-method"),void 0===t[0]&&D((()=>t[5].call(o))),m(k,"id","request-url"),m(k,"placeholder","Type the request URL..."),m(M,"id","request-body"),m(M,"placeholder","Request body"),m(M,"rows","5"),y(M,"width","100%"),y(M,"margin-right","10px"),y(M,"font-size","12px"),m(O,"class","button"),m(O,"id","make-request")},m(e,i){s(e,n,i),a(n,o),a(o,r),a(o,u),a(o,l),a(o,f),a(o,v),w(o,t[0]),a(n,g),a(n,k),b(k,t[1]),a(n,x),a(n,C),a(n,T),a(n,M),b(M,t[2]),a(n,$),a(n,O),F||(j=[h(o,"change",t[5]),h(k,"input",t[6]),h(M,"input",t[7]),h(n,"submit",_(t[3]))],F=!0)},p(e,[t]){1&t&&w(o,e[0]),2&t&&k.value!==e[1]&&b(k,e[1]),4&t&&b(M,e[2])},i:e,o:e,d(e){e&&c(n),F=!1,i(j)}}}function Ce(e,t,n){let i="GET",o="",r="",{onMessage:u}=t;return e.$$set=e=>{"onMessage"in e&&n(4,u=e.onMessage)},[i,o,r,async function(){const e=await ke.getClient(),t={url:o||""||"",method:i||"GET"||"GET"};r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")?t.body=ke.Body.json(JSON.parse(r)):""!==r&&(t.body=ke.Body.text(r)),e.request(t).then(u).catch(u)},u,function(){i=function(e){const t=e.querySelector(":checked")||e.options[0];return t&&t.__value}(this),n(0,i)},function(){o=this.value,n(1,o)},function(){r=this.value,n(2,r)}]}class Te extends N{constructor(e){super(),L(this,e,Ce,xe,r,{onMessage:4})}}function Me(t){let n,i,o;return{c(){n=d("button"),n.textContent="Send test notification",m(n,"class","button"),m(n,"id","notification")},m(e,r){s(e,n,r),i||(o=h(n,"click",t[0]),i=!0)},p:e,i:e,o:e,d(e){e&&c(n),i=!1,o()}}}function $e(){new Notification("Notification title",{body:"This is the notification body"})}function Oe(e,t,n){let{onMessage:i}=t;return e.$$set=e=>{"onMessage"in e&&n(1,i=e.onMessage)},[function(){"default"===Notification.permission?Notification.requestPermission().then((function(e){"granted"===e?$e():i("Permission is "+e)})).catch(i):"granted"===Notification.permission?$e():i("Permission is denied")},i]}class Fe extends N{constructor(e){super(),L(this,e,Oe,Me,r,{onMessage:1})}}var De=U((function(e,t){function n(e,t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return"object"==typeof t&&Object.freeze(t),[2,J.invokeTauriCommand({__tauriModule:"Shell",message:{cmd:"execute",command:e,args:"string"==typeof t?[t]:t}})]}))}))}function i(e,t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})]}))}))}var o=Object.freeze({__proto__:null,execute:n,open:i});t.execute=n,t.open=i,t.shell=o})),je=U((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.execute=De.execute,t.open=De.open}));function Pe(t){let n,o,r,u,l,g,w,k,x,C,T,M,$,O,F,D,j,P,W,A,z,S,E,B,R,q,H,I,L,N,U,G,J,X,Y,V,K,Q,Z,ee,te,ne,ie,oe,re,ue,ae,se,ce,le,de,fe,pe,he,_e,me,ve,ge,be,ye,we,ke,xe,Ce,Te,Me,$e,Oe,Fe,De,je,Pe,We,Ae,ze,Se,Ee,Be,Re,qe,He;return{c(){n=d("div"),o=d("div"),r=d("label"),u=d("input"),l=f("\n Resizable"),g=p(),w=d("label"),k=d("input"),x=f("\n Maximize"),C=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"),z=f("\n Has decorations"),S=p(),E=d("label"),B=d("input"),R=f("\n Always on top"),q=p(),H=d("label"),I=d("input"),L=f("\n Fullscreen"),N=p(),U=d("button"),U.textContent="Change icon",G=p(),J=d("div"),X=d("div"),Y=d("div"),V=d("div"),K=f("X\n "),Q=d("input"),Z=p(),ee=d("div"),te=f("Y\n "),ne=d("input"),ie=p(),oe=d("div"),re=d("div"),ue=f("Width\n "),ae=d("input"),se=p(),ce=d("div"),le=f("Height\n "),de=d("input"),fe=p(),pe=d("div"),he=d("div"),_e=f("Min width\n "),me=d("input"),ve=p(),ge=d("div"),be=f("Min height\n "),ye=d("input"),we=p(),ke=d("div"),xe=d("div"),Ce=f("Max width\n "),Te=d("input"),Me=p(),$e=d("div"),Oe=f("Max height\n "),Fe=d("input"),De=p(),je=d("form"),Pe=d("input"),We=p(),Ae=d("button"),Ae.textContent="Set title",ze=p(),Se=d("form"),Ee=d("input"),Be=p(),Re=d("button"),Re.textContent="Open URL",m(u,"type","checkbox"),m(k,"type","checkbox"),m(T,"title","Unminimizes after 2 seconds"),m($,"title","Visible again after 2 seconds"),m(D,"type","checkbox"),m(A,"type","checkbox"),m(B,"type","checkbox"),m(I,"type","checkbox"),m(Q,"type","number"),m(Q,"min","0"),m(Q,"class","svelte-b76pvm"),m(ne,"type","number"),m(ne,"min","0"),m(ne,"class","svelte-b76pvm"),m(Y,"class","flex col grow svelte-b76pvm"),m(ae,"type","number"),m(ae,"min","400"),m(ae,"class","svelte-b76pvm"),m(de,"type","number"),m(de,"min","400"),m(de,"class","svelte-b76pvm"),m(oe,"class","flex col grow svelte-b76pvm"),m(me,"type","number"),m(me,"class","svelte-b76pvm"),m(ye,"type","number"),m(ye,"class","svelte-b76pvm"),m(pe,"class","flex col grow svelte-b76pvm"),m(Te,"type","number"),m(Te,"min","400"),m(Te,"class","svelte-b76pvm"),m(Fe,"type","number"),m(Fe,"min","400"),m(Fe,"class","svelte-b76pvm"),m(ke,"class","flex col grow svelte-b76pvm"),m(X,"class","window-controls flex flex-row svelte-b76pvm"),m(n,"class","flex col"),m(Pe,"id","title"),m(Ae,"class","button"),m(Ae,"type","submit"),y(je,"margin-top","24px"),m(Ee,"id","url"),m(Re,"class","button"),m(Re,"id","open-url"),y(Se,"margin-top","24px")},m(e,i){s(e,n,i),a(n,o),a(o,r),a(r,u),u.checked=t[0],a(r,l),a(o,g),a(o,w),a(w,k),k.checked=t[1],a(w,x),a(o,C),a(o,T),a(o,M),a(o,$),a(o,O),a(o,F),a(F,D),D.checked=t[14],a(F,j),a(o,P),a(o,W),a(W,A),A.checked=t[2],a(W,z),a(o,S),a(o,E),a(E,B),B.checked=t[3],a(E,R),a(o,q),a(o,H),a(H,I),I.checked=t[4],a(H,L),a(o,N),a(o,U),a(n,G),a(n,J),a(J,X),a(X,Y),a(Y,V),a(V,K),a(V,Q),b(Q,t[11]),a(Y,Z),a(Y,ee),a(ee,te),a(ee,ne),b(ne,t[12]),a(X,ie),a(X,oe),a(oe,re),a(re,ue),a(re,ae),b(ae,t[5]),a(oe,se),a(oe,ce),a(ce,le),a(ce,de),b(de,t[6]),a(X,fe),a(X,pe),a(pe,he),a(he,_e),a(he,me),b(me,t[7]),a(pe,ve),a(pe,ge),a(ge,be),a(ge,ye),b(ye,t[8]),a(X,we),a(X,ke),a(ke,xe),a(xe,Ce),a(xe,Te),b(Te,t[9]),a(ke,Me),a(ke,$e),a($e,Oe),a($e,Fe),b(Fe,t[10]),s(e,De,i),s(e,je,i),a(je,Pe),b(Pe,t[15]),a(je,We),a(je,Ae),s(e,ze,i),s(e,Se,i),a(Se,Ee),b(Ee,t[13]),a(Se,Be),a(Se,Re),qe||(He=[h(u,"change",t[21]),h(k,"change",t[22]),h(T,"click",t[19]),h($,"click",t[18]),h(D,"change",t[23]),h(A,"change",t[24]),h(B,"change",t[25]),h(I,"change",t[26]),h(U,"click",t[20]),h(Q,"input",t[27]),h(ne,"input",t[28]),h(ae,"input",t[29]),h(de,"input",t[30]),h(me,"input",t[31]),h(ye,"input",t[32]),h(Te,"input",t[33]),h(Fe,"input",t[34]),h(Pe,"input",t[35]),h(je,"submit",_(t[17])),h(Ee,"input",t[36]),h(Se,"submit",_(t[16]))],qe=!0)},p(e,t){1&t[0]&&(u.checked=e[0]),2&t[0]&&(k.checked=e[1]),16384&t[0]&&(D.checked=e[14]),4&t[0]&&(A.checked=e[2]),8&t[0]&&(B.checked=e[3]),16&t[0]&&(I.checked=e[4]),2048&t[0]&&v(Q.value)!==e[11]&&b(Q,e[11]),4096&t[0]&&v(ne.value)!==e[12]&&b(ne,e[12]),32&t[0]&&v(ae.value)!==e[5]&&b(ae,e[5]),64&t[0]&&v(de.value)!==e[6]&&b(de,e[6]),128&t[0]&&v(me.value)!==e[7]&&b(me,e[7]),256&t[0]&&v(ye.value)!==e[8]&&b(ye,e[8]),512&t[0]&&v(Te.value)!==e[9]&&b(Te,e[9]),1024&t[0]&&v(Fe.value)!==e[10]&&b(Fe,e[10]),32768&t[0]&&Pe.value!==e[15]&&b(Pe,e[15]),8192&t[0]&&Ee.value!==e[13]&&b(Ee,e[13])},i:e,o:e,d(e){e&&c(n),e&&c(De),e&&c(je),e&&c(ze),e&&c(Se),qe=!1,i(He)}}}function We(e,t,n){const{setResizable:i,setTitle:o,maximize:r,unmaximize:u,minimize:a,unminimize:s,show:c,hide:l,setTransparent:d,setDecorations:f,setAlwaysOnTop:p,setWidth:h,setHeight:_,setMinSize:m,setMaxSize:g,setX:b,setY:y,setFullscreen:w,setIcon:k}=V.appWindow;let x="https://tauri.studio",C=!0,T=!1,M=!1,$=!0,O=!1,F=!1,D=900,j=700,P=600,W=600,A=null,z=null,S=100,E=100,B="Awesome Tauri Example!";return e.$$.update=()=>{1&e.$$.dirty[0]&&i(C),2&e.$$.dirty[0]&&(T?r():u()),4&e.$$.dirty[0]&&f($),8&e.$$.dirty[0]&&p(O),16&e.$$.dirty[0]&&w(F),32&e.$$.dirty[0]&&h(D),64&e.$$.dirty[0]&&_(j),384&e.$$.dirty[0]&&P&&W&&m(P,W),1536&e.$$.dirty[0]&&A&&z&&g(A,z),2048&e.$$.dirty[0]&&b(S),4096&e.$$.dirty[0]&&y(E)},[C,T,$,O,F,D,j,P,W,A,z,S,E,x,M,B,function(){je.open(x)},function(){o(B)},function(){l(),setTimeout(c,2e3)},function(){a(),setTimeout(s,2e3)},function(){ce.open({multiple:!1}).then(k)},function(){C=this.checked,n(0,C)},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(){E=v(this.value),n(12,E)},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(){z=v(this.value),n(10,z)},function(){B=this.value,n(15,B)},function(){x=this.value,n(13,x)}]}class Ae extends N{constructor(e){var t;super(),document.getElementById("svelte-b76pvm-style")||((t=d("style")).id="svelte-b76pvm-style",t.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,t)),L(this,e,We,Pe,r,{},[-1,-1])}}const ze=[];var Se=U((function(e,t){function n(e,t){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:e,handler:G.transformCallback(t)}})]}))}))}function i(e,t){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:e,handler:G.transformCallback(t)}})]}))}))}function o(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})]}))}))}function r(e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})]}))}))}function u(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]}))}))}var a=Object.freeze({__proto__:null,register:n,registerAll:i,isRegistered:o,unregister:r,unregisterAll:u});t.globalShortcut=a,t.isRegistered=o,t.register=n,t.registerAll=i,t.unregister=r,t.unregisterAll=u})),Ee=U((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isRegistered=Se.isRegistered,t.register=Se.register,t.registerAll=Se.registerAll,t.unregister=Se.unregister,t.unregisterAll=Se.unregisterAll}));function Be(e,t,n){const i=e.slice();return i[9]=t[n],i}function Re(e){let t,n,i,o,r,u,l=e[9]+"";function _(){return e[8](e[9])}return{c(){t=d("div"),n=f(l),i=p(),o=d("button"),o.textContent="Unregister",m(o,"type","button")},m(e,c){s(e,t,c),a(t,n),a(t,i),a(t,o),r||(u=h(o,"click",_),r=!0)},p(t,i){e=t,2&i&&l!==(l=e[9]+"")&&g(n,l)},d(e){e&&c(t),r=!1,u()}}}function qe(t){let n,i,o;return{c(){n=d("button"),n.textContent="Unregister all",m(n,"type","button")},m(e,r){s(e,n,r),i||(o=h(n,"click",t[5]),i=!0)},p:e,d(e){e&&c(n),i=!1,o()}}}function He(t){let n,o,r,u,f,_,v,g,y,w,k=t[1],x=[];for(let e=0;e<k.length;e+=1)x[e]=Re(Be(t,k,e));let C=t[1].length&&qe(t);return{c(){n=d("div"),o=d("div"),r=d("input"),u=p(),f=d("button"),f.textContent="Register",_=p(),v=d("div");for(let e=0;e<x.length;e+=1)x[e].c();g=p(),C&&C.c(),m(r,"placeholder","Type a shortcut with '+' as separator..."),m(f,"type","button")},m(e,i){s(e,n,i),a(n,o),a(o,r),b(r,t[0]),a(o,u),a(o,f),a(n,_),a(n,v);for(let e=0;e<x.length;e+=1)x[e].m(v,null);a(v,g),C&&C.m(v,null),y||(w=[h(r,"input",t[7]),h(f,"click",t[3])],y=!0)},p(e,[t]){if(1&t&&r.value!==e[0]&&b(r,e[0]),18&t){let n;for(k=e[1],n=0;n<k.length;n+=1){const i=Be(e,k,n);x[n]?x[n].p(i,t):(x[n]=Re(i),x[n].c(),x[n].m(v,g))}for(;n<x.length;n+=1)x[n].d(1);x.length=k.length}e[1].length?C?C.p(e,t):(C=qe(e),C.c(),C.m(v,null)):C&&(C.d(1),C=null)},i:e,o:e,d(e){e&&c(n),l(x,e),C&&C.d(),y=!1,i(w)}}}function Ie(t,n,i){let o,{onMessage:a}=n;const s=function(t,n=e){let i;const o=[];function u(e){if(r(t,e)&&(t=e,i)){const e=!ze.length;for(let e=0;e<o.length;e+=1){const n=o[e];n[1](),ze.push(n,t)}if(e){for(let e=0;e<ze.length;e+=2)ze[e][0](ze[e+1]);ze.length=0}}}return{set:u,update:function(e){u(e(t))},subscribe:function(r,a=e){const s=[r,a];return o.push(s),1===o.length&&(i=n(u)||e),r(t),()=>{const e=o.indexOf(s);-1!==e&&o.splice(e,1),0===o.length&&(i(),i=null)}}}}([]);u(t,s,(e=>i(1,o=e)));let c="CmdOrControl+X";function l(e){const t=e;Ee.unregister(t).then((()=>{s.update((e=>e.filter((e=>e!==t)))),a(`Shortcut ${t} unregistered`)})).catch(a)}return t.$$set=e=>{"onMessage"in e&&i(6,a=e.onMessage)},[c,o,s,function(){const e=c;Ee.register(e,(()=>{a(`Shortcut ${e} triggered`)})).then((()=>{s.update((t=>[...t,e])),a(`Shortcut ${e} registered successfully`)})).catch(a)},l,function(){Ee.unregisterAll().then((()=>{s.update((()=>[])),a("Unregistered all shortcuts")})).catch(a)},a,function(){c=this.value,i(0,c)},e=>l(e)]}class Le extends N{constructor(e){super(),L(this,e,Ie,He,r,{onMessage:6})}}function Ne(t){let n,i,o;return{c(){n=d("h1"),n.textContent="Welcome",i=p(),o=d("p"),o.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(e,t){s(e,n,t),s(e,i,t),s(e,o,t)},p:e,i:e,o:e,d(e){e&&c(n),e&&c(i),e&&c(o)}}}class Ue extends N{constructor(e){super(),L(this,e,null,Ne,r,{})}}function Ge(e,t,n){const i=e.slice();return i[8]=t[n],i}function Je(e){let t,n,i,o,r,u,l=e[8].label+"";function _(){return e[6](e[8])}return{c(){t=d("p"),n=f(l),i=p(),m(t,"class",o="nv noselect "+(e[0]===e[8]?"nv_selected":""))},m(e,o){s(e,t,o),a(t,n),a(t,i),r||(u=h(t,"click",_),r=!0)},p(n,i){e=n,1&i&&o!==(o="nv noselect "+(e[0]===e[8]?"nv_selected":""))&&m(t,"class",o)},d(e){e&&c(t),r=!1,u()}}}function Xe(e){let t,n,o,r,u,_,v,b,w,k,x,C,T,M,$,O,F,D,j,P,W,A,z,I=e[2],L=[];for(let t=0;t<I.length;t+=1)L[t]=Je(Ge(e,I,t));var N=e[0].component;function U(e){return{props:{onMessage:e[4]}}}return N&&(C=new N(U(e))),{c(){t=d("main"),n=d("div"),o=d("img"),u=p(),_=d("div"),_.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 e=0;e<L.length;e+=1)L[e].c();k=p(),x=d("div"),C&&R(C.$$.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(e[1]),o.src!==(r="tauri.png")&&m(o,"src","tauri.png"),m(o,"height","60"),m(o,"alt","logo"),m(n,"class","flex row noselect just-around"),m(n,"style","margin=1em;"),y(w,"width","15em"),y(w,"margin-left","0.5em"),m(x,"class","content"),m(b,"class","flex row"),m(D,"class","nv"),m($,"class","flex row just-around"),m(M,"id","response")},m(i,r){s(i,t,r),a(t,n),a(n,o),a(n,u),a(n,_),a(t,v),a(t,b),a(b,w);for(let e=0;e<L.length;e+=1)L[e].m(w,null);a(b,k),a(b,x),C&&q(C,x,null),a(t,T),a(t,M),a(M,$),a($,O),a($,F),a($,D),a(M,j),a(M,P),W=!0,A||(z=[h(o,"click",e[5]),h(D,"click",e[7])],A=!0)},p(e,[t]){if(13&t){let n;for(I=e[2],n=0;n<I.length;n+=1){const i=Ge(e,I,n);L[n]?L[n].p(i,t):(L[n]=Je(i),L[n].c(),L[n].m(w,null))}for(;n<L.length;n+=1)L[n].d(1);L.length=I.length}if(N!==(N=e[0].component)){if(C){S={r:0,c:[],p:S};const e=C;B(e.$$.fragment,1,0,(()=>{H(e,1)})),S.r||i(S.c),S=S.p}N?(C=new N(U(e)),R(C.$$.fragment),E(C.$$.fragment,1),q(C,x,null)):C=null}(!W||2&t)&&g(P,e[1])},i(e){W||(C&&E(C.$$.fragment,e),W=!0)},o(e){C&&B(C.$$.fragment,e),W=!1},d(e){e&&c(t),l(L,e),C&&H(C),A=!1,i(z)}}}function Ye(e,t,n){const i=[{label:"Welcome",component:Ue},{label:"Messages",component:ae},{label:"CLI",component:te},{label:"Dialog",component:he},{label:"File system",component:ye},{label:"HTTP",component:Te},{label:"Notifications",component:Fe},{label:"Window",component:Ae},{label:"Shortcuts",component:Le}];let o=i[0],r=[""];function u(e){n(0,o=e)}return[o,r,i,u,function(e){n(1,r+="string"==typeof e?e:JSON.stringify(e))},function(){V.open("https://tauri.studio/")},e=>u(e),()=>{n(1,r=[""])}]}return new class extends N{constructor(e){super(),L(this,e,Ye,Xe,r,{})}}({target:document.body})}();
//# sourceMappingURL=bundle.js.map