tauri/examples/api/public/build/bundle.js
chip c88838aa76
feat: build without proc macros (#1226)
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2021-03-12 22:10:19 -03:00

18 lines
45 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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