diff --git a/.changes/write-file-rename.md b/.changes/write-file-rename.md new file mode 100644 index 00000000000..38b73278b05 --- /dev/null +++ b/.changes/write-file-rename.md @@ -0,0 +1,5 @@ +--- +"api": patch +--- + +Renamed `writeFile` to `writeTextFile` but kept the original function for backwards compatibility. diff --git a/.changes/write-file-variants.md b/.changes/write-file-variants.md new file mode 100644 index 00000000000..4d83aa881b3 --- /dev/null +++ b/.changes/write-file-variants.md @@ -0,0 +1,5 @@ +--- +"api": patch +--- + +Added `(path, contents[, options])` overload to the `writeTextFile` and `writeBinaryFile` APIs. diff --git a/core/tauri/scripts/bundle.js b/core/tauri/scripts/bundle.js index 897316c4de2..e29a8f317c8 100644 --- a/core/tauri/scripts/bundle.js +++ b/core/tauri/scripts/bundle.js @@ -1 +1 @@ -function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}("object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports:{});try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}function r(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]&&arguments[1],a=n(),o="_".concat(a);return Object.defineProperty(window,o,{value:function(n){return t&&Reflect.deleteProperty(window,o),r([e,"optionalCall",function(e){return e(n)}])},writable:!1,configurable:!0}),a}function o(e){return i.apply(this,arguments)}function i(){return(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=a((function(t){e(t),Reflect.deleteProperty(window,i)}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,o)}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asset",r=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(r):"".concat(t,"://").concat(r)}});function s(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o("tauri",t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppName"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getTauriVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var h=Object.freeze({__proto__:null,getName:function(){return l.apply(this,arguments)},getVersion:function(){return p.apply(this,arguments)},getTauriVersion:function(){return f.apply(this,arguments)}});function m(){return(m=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Cli",message:{cmd:"cliMatches"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var d=Object.freeze({__proto__:null,getMatches:function(){return m.apply(this,arguments)}});function y(){return(y=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(){return(g=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _=Object.freeze({__proto__:null,writeText:function(e){return y.apply(this,arguments)},readText:function(){return g.apply(this,arguments)}});function w(e){for(var t=void 0,r=e[0],n=1;n0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(){return(b=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(){return(R=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t,title:w([n,"optionalAccess",function(e){return e.title}]),type:w([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t,title:w([n,"optionalAccess",function(e){return e.title}]),type:w([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(){return(x=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t,title:w([n,"optionalAccess",function(e){return e.title}]),type:w([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var T=Object.freeze({__proto__:null,open:function(){return v.apply(this,arguments)},save:function(){return b.apply(this,arguments)},message:function(e,t){return R.apply(this,arguments)},ask:function(e,t){return k.apply(this,arguments)},confirm:function(e,t){return x.apply(this,arguments)}});function G(e,t){return P.apply(this,arguments)}function P(){return(P=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:r}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e,t,r){return A.apply(this,arguments)}function A(){return(A=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:r,payload:"string"==typeof n?n:JSON.stringify(n)}});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(e,t,r){return C.apply(this,arguments)}function C(){return(C=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:r,handler:a(n)}}).then((function(e){return _asyncToGenerator(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",G(t,e));case 1:case"end":return r.stop()}}),r)})))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(e,t,r){return S.apply(this,arguments)}function S(){return(S=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,r,(function(e){n(e),G(t,e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t){return L.apply(this,arguments)}function L(){return(L=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(e,t){return E.apply(this,arguments)}function E(){return(E=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",j(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(e,t){return F.apply(this,arguments)}function F(){return(F=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M(t,void 0,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var I,N=Object.freeze({__proto__:null,listen:D,once:z,emit:W});function U(){return(U=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(){return(H=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}});case 3:return n=e.sent,e.abrupt("return",Uint8Array.from(n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(){return(V=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from((new TextEncoder).encode(t.contents)),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q(){return(q=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from(t.contents),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function B(){return(B=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(){return(J=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(){return(K=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y(){return(Y=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(){return($=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q(){return(Q=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(e){e[e.Audio=1]="Audio";e[e.Cache=2]="Cache";e[e.Config=3]="Config";e[e.Data=4]="Data";e[e.LocalData=5]="LocalData";e[e.Desktop=6]="Desktop";e[e.Document=7]="Document";e[e.Download=8]="Download";e[e.Executable=9]="Executable";e[e.Font=10]="Font";e[e.Home=11]="Home";e[e.Picture=12]="Picture";e[e.Public=13]="Public";e[e.Runtime=14]="Runtime";e[e.Template=15]="Template";e[e.Video=16]="Video";e[e.Resource=17]="Resource";e[e.App=18]="App";e[e.Log=19]="Log";e[e.Temp=20]="Temp"}(I||(I={}));var X=Object.freeze({__proto__:null,get BaseDirectory(){return I},get Dir(){return I},readTextFile:function(e){return U.apply(this,arguments)},readBinaryFile:function(e){return H.apply(this,arguments)},writeFile:function(e){return V.apply(this,arguments)},writeBinaryFile:function(e){return q.apply(this,arguments)},readDir:function(e){return B.apply(this,arguments)},createDir:function(e){return J.apply(this,arguments)},removeDir:function(e){return K.apply(this,arguments)},copyFile:function(e,t){return Y.apply(this,arguments)},removeFile:function(e){return $.apply(this,arguments)},renameFile:function(e,t){return Q.apply(this,arguments)}});function Z(){return(Z=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ee(){return(ee=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(){return(te=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function re(){return(re=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ne(){return(ne=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ae,oe=Object.freeze({__proto__:null,register:function(e,t){return Z.apply(this,arguments)},registerAll:function(e,t){return ee.apply(this,arguments)},isRegistered:function(e){return te.apply(this,arguments)},unregister:function(e){return re.apply(this,arguments)},unregisterAll:function(){return ne.apply(this,arguments)}});function ie(e,t){return null!=e?e:t()}function ue(e){for(var t=void 0,r=e[0],n=1;n=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data})),pe=function(){function e(t){_classCallCheck(this,e),this.id=t}var t,r,n,a,o,i,u;return _createClass(e,[{key:"drop",value:(u=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"request",value:(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=!t.responseType||t.responseType===ae.JSON)&&(t.responseType=ae.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new ce(e);if(r){try{t.data=JSON.parse(t.data)}catch(e){if(t.ok&&""===t.data)t.data={};else if(t.ok)throw Error("Failed to parse response `".concat(t.data,"` as JSON: ").concat(e,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return t}return t})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"get",value:(o=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"GET",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(a=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"POST",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"put",value:(n=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PUT",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PATCH",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"DELETE",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function le(e){return fe.apply(this,arguments)}function fe(){return(fe=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(e){return new pe(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var he=null;function me(){return(me=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==he){e.next=4;break}return e.next=3,le();case 3:he=e.sent;case 4:return e.abrupt("return",he.request(_objectSpread({url:t,method:ie(ue([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var de=Object.freeze({__proto__:null,getClient:le,fetch:function(e,t){return me.apply(this,arguments)},Body:se,Client:pe,Response:ce,get ResponseType(){return ae}});function ye(){return(ye=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("default"===window.Notification.permission){e.next=2;break}return e.abrupt("return",Promise.resolve("granted"===window.Notification.permission));case 2:return e.abrupt("return",s({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ge(){return(ge=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _e=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return ge.apply(this,arguments)},isPermissionGranted:function(){return ye.apply(this,arguments)}});function we(){return navigator.appVersion.includes("Win")}function ve(){return(ve=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(){return(be=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Audio}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Re(){return(Re=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ke(){return(ke=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Config}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(){return(xe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Desktop}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(){return(Ge=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){return(Pe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Executable}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(){return(Ae=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Font}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Home}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return(Ce=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.LocalData}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){return(je=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Picture}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Public}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(){return(Le=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Runtime}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){return(ze=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Template}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Video}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(){return(We=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Fe=we()?"\\":"/",Ie=we()?";":":";function Ne(){return(Ne=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,r=new Array(t),n=0;n0&&void 0!==r[0]?r[0]:0,e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $e(){return($e=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Qe=Object.freeze({__proto__:null,exit:function(){return Ye.apply(this,arguments)},relaunch:function(){return $e.apply(this,arguments)}});function Xe(e,t){return null!=e?e:t()}function Ze(e,t){return et.apply(this,arguments)}function et(){return(et=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,o,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3?i[3]:void 0,"object"===_typeof(n)&&Object.freeze(n),e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"execute",program:r,args:n,options:o,onEventFn:a(t)}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var tt=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addEventListener",value:function(e,t){e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t]}},{key:"_emit",value:function(e,t){if(e in this.eventListeners){var r,n=_createForOfIteratorHelper(this.eventListeners[e]);try{for(n.s();!(r=n.n()).done;){(0,r.value)(t)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"on",value:function(e,t){return this.addEventListener(e,t),this}}]),e}(),rt=function(){function e(t){_classCallCheck(this,e),this.pid=t}var t,r;return _createClass(e,[{key:"write",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:"string"==typeof t?t:Array.from(t)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"kill",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),nt=function(e){_inherits(a,e);var t,r,n=_createSuper(a);function a(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return _classCallCheck(this,a),t=n.call(this),a.prototype.__init2.call(_assertThisInitialized(t)),a.prototype.__init3.call(_assertThisInitialized(t)),t.program=e,t.args="string"==typeof r?[r]:r,t.options=Xe(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new tt}},{key:"__init3",value:function(){this.stderr=new tt}},{key:"spawn",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ze((function(e){switch(e.event){case"Error":t._emit("error",e.payload);break;case"Terminated":t._emit("close",e.payload);break;case"Stdout":t.stdout._emit("data",e.payload);break;case"Stderr":t.stderr._emit("data",e.payload)}}),this.program,this.args,this.options).then((function(e){return new rt(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"execute",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){t.on("error",r);var n=[],a=[];t.stdout.on("data",(function(e){n.push(e)})),t.stderr.on("data",(function(e){a.push(e)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:n.join("\n"),stderr:a.join("\n")})})),t.spawn().catch(r)})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}],[{key:"sidecar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=new a(e,t,r);return n.options.sidecar=!0,n}}]),a}(tt);function at(){return(at=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"open",path:t,with:r}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ot=Object.freeze({__proto__:null,Command:nt,Child:rt,EventEmitter:tt,open:function(e,t){return at.apply(this,arguments)}});function it(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,r),n=t.call(this,e),pt([a,"optionalAccess",function(e){return e.skip}])||s({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:_objectSpread({label:e},a)}}}).then(_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://created"));case 1:case"end":return e.stop()}}),e)})))).catch(function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://error",t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n}return _createClass(r,null,[{key:"getByLabel",value:function(e){return yt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(vt);function Rt(){return(Rt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kt(){return(kt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xt(){return(xt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"__TAURI_METADATA__"in window?gt=new bt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),gt=new bt("main",{skip:!0}));var Tt=Object.freeze({__proto__:null,WebviewWindow:bt,WebviewWindowHandle:wt,WindowManager:vt,getCurrent:function(){return new bt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:yt,get appWindow(){return gt},LogicalSize:ft,PhysicalSize:ht,LogicalPosition:mt,PhysicalPosition:dt,get UserAttentionType(){return lt},currentMonitor:function(){return Rt.apply(this,arguments)},primaryMonitor:function(){return kt.apply(this,arguments)},availableMonitors:function(){return xt.apply(this,arguments)}}),Gt=we()?"\r\n":"\n";function Pt(){return(Pt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"platform"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mt(){return(Mt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"version"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(){return(At=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"osType"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ot(){return(Ot=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ct(){return(Ct=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"tempdir"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jt=Object.freeze({__proto__:null,EOL:Gt,platform:function(){return Pt.apply(this,arguments)},version:function(){return Mt.apply(this,arguments)},type:function(){return At.apply(this,arguments)},arch:function(){return Ot.apply(this,arguments)},tempdir:function(){return Ct.apply(this,arguments)}}),St=o;e.app=h,e.cli=d,e.clipboard=_,e.dialog=T,e.event=N,e.fs=X,e.globalShortcut=oe,e.http=de,e.invoke=St,e.notification=_e,e.os=jt,e.path=Ke,e.process=Qe,e.shell=ot,e.tauri=u,e.updater=ct,e.window=Tt,Object.defineProperty(e,"__esModule",{value:!0})})); +function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}("object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports:{});try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}function r(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]&&arguments[1],a=n(),o="_".concat(a);return Object.defineProperty(window,o,{value:function(n){return t&&Reflect.deleteProperty(window,o),r([e,"optionalCall",function(e){return e(n)}])},writable:!1,configurable:!0}),a}function o(e){return i.apply(this,arguments)}function i(){return(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=a((function(t){e(t),Reflect.deleteProperty(window,i)}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,o)}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asset",r=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(r):"".concat(t,"://").concat(r)}});function s(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o("tauri",t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppName"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getTauriVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var h=Object.freeze({__proto__:null,getName:function(){return l.apply(this,arguments)},getVersion:function(){return p.apply(this,arguments)},getTauriVersion:function(){return f.apply(this,arguments)}});function m(){return(m=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Cli",message:{cmd:"cliMatches"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var d=Object.freeze({__proto__:null,getMatches:function(){return m.apply(this,arguments)}});function y(){return(y=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(){return(g=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _=Object.freeze({__proto__:null,writeText:function(e){return y.apply(this,arguments)},readText:function(){return g.apply(this,arguments)}});function w(e){for(var t=void 0,r=e[0],n=1;n0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(){return(b=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(){return(R=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t,title:w([n,"optionalAccess",function(e){return e.title}]),type:w([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t,title:w([n,"optionalAccess",function(e){return e.title}]),type:w([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(){return(x=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t,title:w([n,"optionalAccess",function(e){return e.title}]),type:w([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var T=Object.freeze({__proto__:null,open:function(){return v.apply(this,arguments)},save:function(){return b.apply(this,arguments)},message:function(e,t){return R.apply(this,arguments)},ask:function(e,t){return k.apply(this,arguments)},confirm:function(e,t){return x.apply(this,arguments)}});function G(e,t){return P.apply(this,arguments)}function P(){return(P=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:r}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e,t,r){return A.apply(this,arguments)}function A(){return(A=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:r,payload:"string"==typeof n?n:JSON.stringify(n)}});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(e,t,r){return C.apply(this,arguments)}function C(){return(C=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:r,handler:a(n)}}).then((function(e){return _asyncToGenerator(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",G(t,e));case 1:case"end":return r.stop()}}),r)})))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(e,t,r){return S.apply(this,arguments)}function S(){return(S=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,r,(function(e){n(e),G(t,e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t){return L.apply(this,arguments)}function L(){return(L=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(e,t){return E.apply(this,arguments)}function E(){return(E=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",j(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(e,t){return F.apply(this,arguments)}function F(){return(F=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M(t,void 0,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var I,N=Object.freeze({__proto__:null,listen:D,once:z,emit:W});function U(e,t){return null!=e?e:t()}function H(){return(H=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(){return(V=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}});case 3:return n=e.sent,e.abrupt("return",Uint8Array.from(n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q(e,t,r){return B.apply(this,arguments)}function B(){return(B=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){var a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:""},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),"string"==typeof r?a.contents=U(r,(function(){return""})):o=r,e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from((new TextEncoder).encode(a.contents)),options:o}}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(){return(J=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){var a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:[]},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),r&&"dir"in r?o=r:a.contents=U(r,(function(){return[]})),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from(a.contents),options:o}}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(){return(K=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y(){return(Y=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(){return($=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q(){return(Q=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function X(){return(X=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Z(){return(Z=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:r,options:n}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(e){e[e.Audio=1]="Audio";e[e.Cache=2]="Cache";e[e.Config=3]="Config";e[e.Data=4]="Data";e[e.LocalData=5]="LocalData";e[e.Desktop=6]="Desktop";e[e.Document=7]="Document";e[e.Download=8]="Download";e[e.Executable=9]="Executable";e[e.Font=10]="Font";e[e.Home=11]="Home";e[e.Picture=12]="Picture";e[e.Public=13]="Public";e[e.Runtime=14]="Runtime";e[e.Template=15]="Template";e[e.Video=16]="Video";e[e.Resource=17]="Resource";e[e.App=18]="App";e[e.Log=19]="Log";e[e.Temp=20]="Temp"}(I||(I={}));var ee=Object.freeze({__proto__:null,get BaseDirectory(){return I},get Dir(){return I},readTextFile:function(e){return H.apply(this,arguments)},readBinaryFile:function(e){return V.apply(this,arguments)},writeTextFile:q,writeFile:q,writeBinaryFile:function(e,t,r){return J.apply(this,arguments)},readDir:function(e){return K.apply(this,arguments)},createDir:function(e){return Y.apply(this,arguments)},removeDir:function(e){return $.apply(this,arguments)},copyFile:function(e,t){return Q.apply(this,arguments)},removeFile:function(e){return X.apply(this,arguments)},renameFile:function(e,t){return Z.apply(this,arguments)}});function te(){return(te=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function re(){return(re=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ne(){return(ne=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ae(){return(ae=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oe(){return(oe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ie,ue=Object.freeze({__proto__:null,register:function(e,t){return te.apply(this,arguments)},registerAll:function(e,t){return re.apply(this,arguments)},isRegistered:function(e){return ne.apply(this,arguments)},unregister:function(e){return ae.apply(this,arguments)},unregisterAll:function(){return oe.apply(this,arguments)}});function se(e,t){return null!=e?e:t()}function ce(e){for(var t=void 0,r=e[0],n=1;n=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data})),fe=function(){function e(t){_classCallCheck(this,e),this.id=t}var t,r,n,a,o,i,u;return _createClass(e,[{key:"drop",value:(u=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"request",value:(i=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=!t.responseType||t.responseType===ie.JSON)&&(t.responseType=ie.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new le(e);if(r){try{t.data=JSON.parse(t.data)}catch(e){if(t.ok&&""===t.data)t.data={};else if(t.ok)throw Error("Failed to parse response `".concat(t.data,"` as JSON: ").concat(e,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return t}return t})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"get",value:(o=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"GET",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(a=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"POST",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"put",value:(n=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PUT",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PATCH",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"DELETE",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function he(e){return me.apply(this,arguments)}function me(){return(me=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(e){return new fe(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var de=null;function ye(){return(ye=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==de){e.next=4;break}return e.next=3,he();case 3:de=e.sent;case 4:return e.abrupt("return",de.request(_objectSpread({url:t,method:se(ce([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ge=Object.freeze({__proto__:null,getClient:he,fetch:function(e,t){return ye.apply(this,arguments)},Body:pe,Client:fe,Response:le,get ResponseType(){return ie}});function _e(){return(_e=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("default"===window.Notification.permission){e.next=2;break}return e.abrupt("return",Promise.resolve("granted"===window.Notification.permission));case 2:return e.abrupt("return",s({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(){return(we=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ve=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return we.apply(this,arguments)},isPermissionGranted:function(){return _e.apply(this,arguments)}});function be(){return navigator.appVersion.includes("Win")}function Re(){return(Re=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ke(){return(ke=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Audio}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(){return(xe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Config}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(){return(Ge=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){return(Pe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Desktop}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(){return(Ae=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Executable}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return(Ce=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Font}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){return(je=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Home}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.LocalData}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Picture}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(){return(Le=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Public}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){return(ze=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Runtime}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(){return(We=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Template}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fe(){return(Fe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Video}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ie(){return(Ie=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:I.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ne=be()?"\\":"/",Ue=be()?";":":";function He(){return(He=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t,r,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,r=new Array(t),n=0;n0&&void 0!==r[0]?r[0]:0,e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xe(){return(Xe=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ze=Object.freeze({__proto__:null,exit:function(){return Qe.apply(this,arguments)},relaunch:function(){return Xe.apply(this,arguments)}});function et(e,t){return null!=e?e:t()}function tt(e,t){return rt.apply(this,arguments)}function rt(){return(rt=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){var n,o,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3?i[3]:void 0,"object"===_typeof(n)&&Object.freeze(n),e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"execute",program:r,args:n,options:o,onEventFn:a(t)}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var nt=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addEventListener",value:function(e,t){e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t]}},{key:"_emit",value:function(e,t){if(e in this.eventListeners){var r,n=_createForOfIteratorHelper(this.eventListeners[e]);try{for(n.s();!(r=n.n()).done;){(0,r.value)(t)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"on",value:function(e,t){return this.addEventListener(e,t),this}}]),e}(),at=function(){function e(t){_classCallCheck(this,e),this.pid=t}var t,r;return _createClass(e,[{key:"write",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:"string"==typeof t?t:Array.from(t)}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"kill",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),ot=function(e){_inherits(a,e);var t,r,n=_createSuper(a);function a(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return _classCallCheck(this,a),t=n.call(this),a.prototype.__init2.call(_assertThisInitialized(t)),a.prototype.__init3.call(_assertThisInitialized(t)),t.program=e,t.args="string"==typeof r?[r]:r,t.options=et(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new nt}},{key:"__init3",value:function(){this.stderr=new nt}},{key:"spawn",value:(r=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",tt((function(e){switch(e.event){case"Error":t._emit("error",e.payload);break;case"Terminated":t._emit("close",e.payload);break;case"Stdout":t.stdout._emit("data",e.payload);break;case"Stderr":t.stderr._emit("data",e.payload)}}),this.program,this.args,this.options).then((function(e){return new at(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"execute",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){t.on("error",r);var n=[],a=[];t.stdout.on("data",(function(e){n.push(e)})),t.stderr.on("data",(function(e){a.push(e)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:n.join("\n"),stderr:a.join("\n")})})),t.spawn().catch(r)})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}],[{key:"sidecar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=new a(e,t,r);return n.options.sidecar=!0,n}}]),a}(nt);function it(){return(it=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"open",path:t,with:r}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ut=Object.freeze({__proto__:null,Command:ot,Child:at,EventEmitter:nt,open:function(e,t){return it.apply(this,arguments)}});function st(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,r),n=t.call(this,e),ft([a,"optionalAccess",function(e){return e.skip}])||s({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:_objectSpread({label:e},a)}}}).then(_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://created"));case 1:case"end":return e.stop()}}),e)})))).catch(function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://error",t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n}return _createClass(r,null,[{key:"getByLabel",value:function(e){return _t().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(Rt);function xt(){return(xt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tt(){return(Tt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gt(){return(Gt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"__TAURI_METADATA__"in window?wt=new kt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),wt=new kt("main",{skip:!0}));var Pt=Object.freeze({__proto__:null,WebviewWindow:kt,WebviewWindowHandle:bt,WindowManager:Rt,getCurrent:function(){return new kt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:_t,get appWindow(){return wt},LogicalSize:mt,PhysicalSize:dt,LogicalPosition:yt,PhysicalPosition:gt,get UserAttentionType(){return ht},currentMonitor:function(){return xt.apply(this,arguments)},primaryMonitor:function(){return Tt.apply(this,arguments)},availableMonitors:function(){return Gt.apply(this,arguments)}}),Mt=be()?"\r\n":"\n";function At(){return(At=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"platform"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ot(){return(Ot=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"version"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ct(){return(Ct=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"osType"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jt(){return(jt=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function St(){return(St=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"tempdir"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Dt=Object.freeze({__proto__:null,EOL:Mt,platform:function(){return At.apply(this,arguments)},version:function(){return Ot.apply(this,arguments)},type:function(){return Ct.apply(this,arguments)},arch:function(){return jt.apply(this,arguments)},tempdir:function(){return St.apply(this,arguments)}}),Lt=o;e.app=h,e.cli=d,e.clipboard=_,e.dialog=T,e.event=N,e.fs=ee,e.globalShortcut=ue,e.http=ge,e.invoke=Lt,e.notification=ve,e.os=Dt,e.path=$e,e.process=Ze,e.shell=ut,e.tauri=u,e.updater=lt,e.window=Pt,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index 1525a9f776a..25576a17225 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,15 +1,15 @@ -var zi=Object.defineProperty,Ci=Object.defineProperties;var Mi=Object.getOwnPropertyDescriptors;var Yl=Object.getOwnPropertySymbols;var Ti=Object.prototype.hasOwnProperty,Si=Object.prototype.propertyIsEnumerable;var Jl=(n,t,l)=>t in n?zi(n,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[t]=l,Kl=(n,t)=>{for(var l in t||(t={}))Ti.call(t,l)&&Jl(n,l,t[l]);if(Yl)for(var l of Yl(t))Si.call(t,l)&&Jl(n,l,t[l]);return n},Ql=(n,t)=>Ci(n,Mi(t));import{S as X,i as Y,s as J,e as o,a as h,t as C,b as u,c as S,d as e,l as y,f as F,n as W,g as R,r as x,h as Ri,j as Li,o as Ei,k as Hi,m as Zl,p as Oi,q as en,u as $l,v as Wn,w as Un,x as Pi,y as E,z as xl,A as ei,B as Ai,C as tn,D as $e,E as ti,F as Ii,G as Wi,H as Ui,I as qn,J as xe,K as ni,L as Nn,M as Dn,N as G,O as jn,P as nn,Q as Fn,R as li,T as ii,U as qi,V as Ni,W as si,X as oi,Y as Di,Z as ji,_ as Fi,$ as Gi,a0 as Bi,a1 as Vi,a2 as Xi,a3 as Yi,a4 as Ji,a5 as Gn,a6 as Bn,a7 as Vn,a8 as Xn,a9 as Yn,aa as Ki,ab as ai,ac as Qi,ad as Zi,ae as $i,af as xi}from"./vendor.js";const es=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const r of a.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function l(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerpolicy&&(a.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?a.credentials="include":s.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(s){if(s.ep)return;s.ep=!0;const a=l(s);fetch(s.href,a)}};es();function ts(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b,d,z,M,q,A,P;return{c(){t=o("h1"),t.textContent="Welcome",l=h(),i=o("p"),i.textContent="Tauri's API capabilities using the ` @tauri-apps/api ` package. It's used as\n the main validation app, serving as the testbed of our development process. In\n the future, this app will be used on Tauri's integration tests.",s=h(),a=o("p"),r=C("Current App version: "),c=C(n[0]),m=h(),v=o("p"),k=C("Current Tauri version: "),g=C(n[1]),p=h(),_=o("p"),w=C("Current App name: "),b=C(n[2]),d=h(),z=o("button"),z.textContent="Close application",M=h(),q=o("button"),q.textContent="Relaunch application",u(z,"class","button"),u(q,"class","button")},m(L,I){S(L,t,I),S(L,l,I),S(L,i,I),S(L,s,I),S(L,a,I),e(a,r),e(a,c),S(L,m,I),S(L,v,I),e(v,k),e(v,g),S(L,p,I),S(L,_,I),e(_,w),e(_,b),S(L,d,I),S(L,z,I),S(L,M,I),S(L,q,I),A||(P=[y(z,"click",n[3]),y(q,"click",n[4])],A=!0)},p(L,[I]){I&1&&F(c,L[0]),I&2&&F(g,L[1]),I&4&&F(b,L[2])},i:W,o:W,d(L){L&&R(t),L&&R(l),L&&R(i),L&&R(s),L&&R(a),L&&R(m),L&&R(v),L&&R(p),L&&R(_),L&&R(d),L&&R(z),L&&R(M),L&&R(q),A=!1,x(P)}}}function ns(n,t,l){let i=0,s=0,a="Unknown";Ri().then(m=>{l(2,a=m)}),Li().then(m=>{l(0,i=m)}),Ei().then(m=>{l(1,s=m)});async function r(){await Hi()}async function c(){await Zl()}return[i,s,a,r,c]}class ls extends X{constructor(t){super();Y(this,t,ns,ts,J,{})}}function is(n){let t,l,i,s,a,r,c,m,v,k,g;return{c(){t=o("div"),l=C(`This binary can be run on the terminal and takes the following arguments: +var zi=Object.defineProperty,Ci=Object.defineProperties;var Mi=Object.getOwnPropertyDescriptors;var Yl=Object.getOwnPropertySymbols;var Ti=Object.prototype.hasOwnProperty,Si=Object.prototype.propertyIsEnumerable;var Jl=(n,t,l)=>t in n?zi(n,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[t]=l,Kl=(n,t)=>{for(var l in t||(t={}))Ti.call(t,l)&&Jl(n,l,t[l]);if(Yl)for(var l of Yl(t))Si.call(t,l)&&Jl(n,l,t[l]);return n},Ql=(n,t)=>Ci(n,Mi(t));import{S as X,i as Y,s as J,e as o,a as h,t as C,b as u,c as S,d as e,l as y,f as G,n as W,g as R,r as x,h as Ri,j as Li,o as Ei,k as Hi,m as Zl,p as Oi,q as en,u as $l,v as Wn,w as Un,x as Pi,y as E,z as xl,A as ei,B as Ai,C as tn,D as $e,E as ti,F as Ii,G as Wi,H as Ui,I as qi,J as qn,K as xe,L as ni,M as Nn,N as Dn,O as B,P as jn,Q as nn,R as Gn,T as li,U as ii,V as Ni,W as Di,X as si,Y as oi,Z as ji,_ as Gi,$ as Bi,a0 as Fi,a1 as Vi,a2 as Xi,a3 as Yi,a4 as Ji,a5 as Ki,a6 as Bn,a7 as Fn,a8 as Vn,a9 as Xn,aa as Yn,ab as Qi,ac as ai,ad as Zi,ae as $i,af as xi,ag as es}from"./vendor.js";const ts=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const r of a.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function l(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerpolicy&&(a.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?a.credentials="include":s.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(s){if(s.ep)return;s.ep=!0;const a=l(s);fetch(s.href,a)}};ts();function ns(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b,d,z,M,q,A,P;return{c(){t=o("h1"),t.textContent="Welcome",l=h(),i=o("p"),i.textContent="Tauri's API capabilities using the ` @tauri-apps/api ` package. It's used as\n the main validation app, serving as the testbed of our development process. In\n the future, this app will be used on Tauri's integration tests.",s=h(),a=o("p"),r=C("Current App version: "),c=C(n[0]),m=h(),v=o("p"),k=C("Current Tauri version: "),g=C(n[1]),p=h(),_=o("p"),w=C("Current App name: "),b=C(n[2]),d=h(),z=o("button"),z.textContent="Close application",M=h(),q=o("button"),q.textContent="Relaunch application",u(z,"class","button"),u(q,"class","button")},m(L,I){S(L,t,I),S(L,l,I),S(L,i,I),S(L,s,I),S(L,a,I),e(a,r),e(a,c),S(L,m,I),S(L,v,I),e(v,k),e(v,g),S(L,p,I),S(L,_,I),e(_,w),e(_,b),S(L,d,I),S(L,z,I),S(L,M,I),S(L,q,I),A||(P=[y(z,"click",n[3]),y(q,"click",n[4])],A=!0)},p(L,[I]){I&1&&G(c,L[0]),I&2&&G(g,L[1]),I&4&&G(b,L[2])},i:W,o:W,d(L){L&&R(t),L&&R(l),L&&R(i),L&&R(s),L&&R(a),L&&R(m),L&&R(v),L&&R(p),L&&R(_),L&&R(d),L&&R(z),L&&R(M),L&&R(q),A=!1,x(P)}}}function ls(n,t,l){let i=0,s=0,a="Unknown";Ri().then(m=>{l(2,a=m)}),Li().then(m=>{l(0,i=m)}),Ei().then(m=>{l(1,s=m)});async function r(){await Hi()}async function c(){await Zl()}return[i,s,a,r,c]}class is extends X{constructor(t){super();Y(this,t,ls,ns,J,{})}}function ss(n){let t,l,i,s,a,r,c,m,v,k,g;return{c(){t=o("div"),l=C(`This binary can be run on the terminal and takes the following arguments: `),i=o("ul"),i.innerHTML=`
  • --config PATH
  • --theme light|dark|system
  • --verbose
  • `,s=C(` Additionally, it has a `),a=o("i"),a.textContent="update --background",r=C(` subcommand. Note that the arguments are only parsed, not implemented. - `),c=o("br"),m=h(),v=o("button"),v.textContent="Get matches",u(v,"class","button"),u(v,"id","cli-matches")},m(p,_){S(p,t,_),e(t,l),e(t,i),e(t,s),e(t,a),e(t,r),e(t,c),e(t,m),e(t,v),k||(g=y(v,"click",n[0]),k=!0)},p:W,i:W,o:W,d(p){p&&R(t),k=!1,g()}}}function ss(n,t,l){let{onMessage:i}=t;function s(){Oi().then(i).catch(i)}return n.$$set=a=>{"onMessage"in a&&l(1,i=a.onMessage)},[s,i]}class os extends X{constructor(t){super();Y(this,t,ss,is,J,{onMessage:1})}}function as(n){let t,l,i,s,a,r,c,m;return{c(){t=o("div"),l=o("button"),l.textContent="Call Log API",i=h(),s=o("button"),s.textContent="Call Request (async) API",a=h(),r=o("button"),r.textContent="Send event to Rust",u(l,"class","button"),u(l,"id","log"),u(s,"class","button"),u(s,"id","request"),u(r,"class","button"),u(r,"id","event")},m(v,k){S(v,t,k),e(t,l),e(t,i),e(t,s),e(t,a),e(t,r),c||(m=[y(l,"click",n[0]),y(s,"click",n[1]),y(r,"click",n[2])],c=!0)},p:W,i:W,o:W,d(v){v&&R(t),c=!1,x(m)}}}function us(n,t,l){let{onMessage:i}=t,s;en(async()=>{s=await $l("rust-event",i)}),Wn(()=>{s&&s()});function a(){Un("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function r(){Un("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){Pi("js-event","this is the payload string")}return n.$$set=m=>{"onMessage"in m&&l(3,i=m.onMessage)},[a,r,c,i]}class rs extends X{constructor(t){super();Y(this,t,us,as,J,{onMessage:3})}}function cs(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b,d,z,M,q,A;return{c(){t=o("div"),l=o("input"),i=h(),s=o("input"),a=h(),r=o("div"),c=o("input"),m=h(),v=o("label"),v.textContent="Multiple",k=h(),g=o("div"),p=o("input"),_=h(),w=o("label"),w.textContent="Directory",b=h(),d=o("button"),d.textContent="Open dialog",z=h(),M=o("button"),M.textContent="Open save dialog",u(l,"id","dialog-default-path"),u(l,"placeholder","Default path"),u(s,"id","dialog-filter"),u(s,"placeholder","Extensions filter, comma-separated"),u(s,"class","svelte-1eg58yg"),u(c,"type","checkbox"),u(c,"id","dialog-multiple"),u(v,"for","dialog-multiple"),u(p,"type","checkbox"),u(p,"id","dialog-directory"),u(w,"for","dialog-directory"),u(d,"class","button"),u(d,"id","open-dialog"),u(M,"class","button"),u(M,"id","save-dialog")},m(P,L){S(P,t,L),e(t,l),E(l,n[0]),e(t,i),e(t,s),E(s,n[1]),e(t,a),e(t,r),e(r,c),c.checked=n[2],e(r,m),e(r,v),e(t,k),e(t,g),e(g,p),p.checked=n[3],e(g,_),e(g,w),e(t,b),e(t,d),e(t,z),e(t,M),q||(A=[y(l,"input",n[8]),y(s,"input",n[9]),y(c,"change",n[10]),y(p,"change",n[11]),y(d,"click",n[4]),y(M,"click",n[5])],q=!0)},p(P,[L]){L&1&&l.value!==P[0]&&E(l,P[0]),L&2&&s.value!==P[1]&&E(s,P[1]),L&4&&(c.checked=P[2]),L&8&&(p.checked=P[3])},i:W,o:W,d(P){P&&R(t),q=!1,x(A)}}}function ps(n,t){var l=new Blob([n],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(s){var a=s.target.result;t(a.substr(a.indexOf(",")+1))},i.readAsDataURL(l)}function fs(n,t,l){let{onMessage:i}=t,{insecureRenderHtml:s}=t,a=null,r=null,c=!1,m=!1;function v(){xl({title:"My wonderful open dialog",defaultPath:a,filters:r?[{name:"Tauri Example",extensions:r.split(",").map(b=>b.trim())}]:[],multiple:c,directory:m}).then(function(b){if(Array.isArray(b))i(b);else{var d=b,z=d.match(/\S+\.\S+$/g);ei(d).then(function(M){z&&(d.includes(".png")||d.includes(".jpg"))?ps(new Uint8Array(M),function(q){var A="data:image/png;base64,"+q;s('')}):i(b)}).catch(i(b))}}).catch(i)}function k(){Ai({title:"My wonderful save dialog",defaultPath:a,filters:r?[{name:"Tauri Example",extensions:r.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function g(){a=this.value,l(0,a)}function p(){r=this.value,l(1,r)}function _(){c=this.checked,l(2,c)}function w(){m=this.checked,l(3,m)}return n.$$set=b=>{"onMessage"in b&&l(6,i=b.onMessage),"insecureRenderHtml"in b&&l(7,s=b.insecureRenderHtml)},[a,r,c,m,v,k,i,s,g,p,_,w]}class ds extends X{constructor(t){super();Y(this,t,fs,cs,J,{onMessage:6,insecureRenderHtml:7})}}function ui(n,t,l){const i=n.slice();return i[9]=t[l],i}function ri(n){let t,l=n[9][0]+"",i,s;return{c(){t=o("option"),i=C(l),t.__value=s=n[9][1],t.value=t.__value},m(a,r){S(a,t,r),e(t,i)},p:W,d(a){a&&R(t)}}}function hs(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w=n[2],b=[];for(let d=0;disNaN(parseInt(p))).map(p=>[p,ti[p]]);function m(){const p=a.match(/\S+\.\S+$/g),_={dir:ci()};(p?ei(a,_):Ii(a,_)).then(function(b){if(p)if(a.includes(".png")||a.includes(".jpg"))ms(new Uint8Array(b),function(d){const z="data:image/png;base64,"+d;s('')});else{const d=String.fromCharCode.apply(null,b);s(''),setTimeout(()=>{const z=document.getElementById("file-response");z.value=d,document.getElementById("file-save").addEventListener("click",function(){writeFile({file:a,contents:z.value},{dir:ci()}).catch(i)})})}else i(b)}).catch(i)}function v(){l(1,r.src=Wi(a),r)}function k(){a=this.value,l(0,a)}function g(p){Ui[p?"unshift":"push"](()=>{r=p,l(1,r)})}return n.$$set=p=>{"onMessage"in p&&l(5,i=p.onMessage),"insecureRenderHtml"in p&&l(6,s=p.insecureRenderHtml)},[a,r,c,m,v,i,s,k,g]}class _s extends X{constructor(t){super();Y(this,t,vs,hs,J,{onMessage:5,insecureRenderHtml:6})}}function gs(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b;return{c(){t=o("form"),l=o("select"),i=o("option"),i.textContent="GET",s=o("option"),s.textContent="POST",a=o("option"),a.textContent="PUT",r=o("option"),r.textContent="PATCH",c=o("option"),c.textContent="DELETE",m=h(),v=o("br"),k=h(),g=o("textarea"),p=h(),_=o("button"),_.textContent="Make request",i.__value="GET",i.value=i.__value,s.__value="POST",s.value=s.__value,a.__value="PUT",a.value=a.__value,r.__value="PATCH",r.value=r.__value,c.__value="DELETE",c.value=c.__value,u(l,"class","button"),u(l,"id","request-method"),n[0]===void 0&&qn(()=>n[4].call(l)),u(g,"id","request-body"),u(g,"placeholder","Request body"),u(g,"rows","5"),u(g,"class","svelte-1xfmj7b"),u(_,"class","button"),u(_,"id","make-request")},m(d,z){S(d,t,z),e(t,l),e(l,i),e(l,s),e(l,a),e(l,r),e(l,c),xe(l,n[0]),e(t,m),e(t,v),e(t,k),e(t,g),E(g,n[1]),e(t,p),e(t,_),w||(b=[y(l,"change",n[4]),y(g,"input",n[5]),y(t,"submit",tn(n[2]))],w=!0)},p(d,[z]){z&1&&xe(l,d[0]),z&2&&E(g,d[1])},i:W,o:W,d(d){d&&R(t),w=!1,x(b)}}}function bs(n,t,l){let i="GET",s="",{onMessage:a}=t;async function r(){const v=await ni().catch(p=>{throw a(p),p}),g={url:"http://localhost:3003",method:i||"GET"||"GET"};s.startsWith("{")&&s.endsWith("}")||s.startsWith("[")&&s.endsWith("]")?g.body=Nn.json(JSON.parse(s)):s!==""&&(g.body=Nn.text(s)),v.request(g).then(a).catch(a)}function c(){i=Dn(this),l(0,i)}function m(){s=this.value,l(1,s)}return n.$$set=v=>{"onMessage"in v&&l(3,a=v.onMessage)},[i,s,r,a,c,m]}class ws extends X{constructor(t){super();Y(this,t,bs,gs,J,{onMessage:3})}}function ks(n){let t,l,i;return{c(){t=o("button"),t.textContent="Send test notification",u(t,"class","button"),u(t,"id","notification")},m(s,a){S(s,t,a),l||(i=y(t,"click",ys),l=!0)},p:W,i:W,o:W,d(s){s&&R(t),l=!1,i()}}}function ys(){new Notification("Notification title",{body:"This is the notification body"})}function zs(n,t,l){let{onMessage:i}=t;return n.$$set=s=>{"onMessage"in s&&l(0,i=s.onMessage)},[i]}class Cs extends X{constructor(t){super();Y(this,t,zs,ks,J,{onMessage:0})}}function pi(n,t,l){const i=n.slice();return i[65]=t[l],i}function fi(n,t,l){const i=n.slice();return i[68]=t[l],i}function di(n){let t,l=n[68]+"",i,s;return{c(){t=o("option"),i=C(l),t.__value=s=n[68],t.value=t.__value},m(a,r){S(a,t,r),e(t,i)},p(a,r){r[0]&2&&l!==(l=a[68]+"")&&F(i,l),r[0]&2&&s!==(s=a[68])&&(t.__value=s,t.value=t.__value)},d(a){a&&R(t)}}}function hi(n){let t,l=n[65]+"",i,s;return{c(){t=o("option"),i=C(l),t.__value=s=n[65],t.value=t.__value},m(a,r){S(a,t,r),e(t,i)},p:W,d(a){a&&R(t)}}}function Ms(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b,d,z,M,q,A,P,L,I,N,K,fe,V,j,O,Q,H,B,Se,Re,Ae,wt,et,ee,de,Ie,kt,le,yt,We,zt,ie,Ct,he,Ue,Mt,se,Tt,qe,St,oe,Rt,me,Ne,Lt,ae,Et,De,Ht,ue,Ot,ve,je,D,te,Jn,Pt,Kn,ce,ln,re,Fe,_e,sn,Qn,tt,Zn,At=n[25].width+"",on,$n,nt,xn,It=n[25].height+"",an,el,ge,un,tl,lt,nl,Wt=n[26].width+"",rn,ll,it,il,Ut=n[26].height+"",cn,sl,Ge,be,pn,ol,st,al,qt=n[25].toLogical(n[22]).width+"",fn,ul,ot,rl,Nt=n[25].toLogical(n[22]).height+"",dn,cl,we,hn,pl,at,fl,Dt=n[26].toLogical(n[22]).width+"",mn,dl,ut,hl,jt=n[26].toLogical(n[22]).height+"",vn,ml,Be,ke,_n,vl,rt,_l,Ft=n[23].x+"",gn,gl,ct,bl,Gt=n[23].y+"",bn,wl,ye,wn,kl,pt,yl,Bt=n[24].x+"",kn,zl,ft,Cl,Vt=n[24].y+"",yn,Ml,Ve,ze,zn,Tl,dt,Sl,Xt=n[23].toLogical(n[22]).x+"",Cn,Rl,ht,Ll,Yt=n[23].toLogical(n[22]).y+"",Mn,El,Ce,Tn,Hl,mt,Ol,Jt=n[24].toLogical(n[22]).x+"",Sn,Pl,vt,Al,Kt=n[24].toLogical(n[22]).y+"",Rn,Ln,ne,En,Il,Qt,Xe,Wl,Ul,Zt,Ye,ql,Nl,pe,Dl,Je,$t,jl,Le,Fl,xt,Gl,Ee,Hn,Me,He,Bl,_t,On,Te,Oe,Vl,gt,Pn,Pe,An,Ke,In,Xl,Qe=Object.keys(n[1]),Z=[];for(let f=0;f{"onMessage"in a&&l(1,i=a.onMessage)},[s,i]}class as extends X{constructor(t){super();Y(this,t,os,ss,J,{onMessage:1})}}function us(n){let t,l,i,s,a,r,c,m;return{c(){t=o("div"),l=o("button"),l.textContent="Call Log API",i=h(),s=o("button"),s.textContent="Call Request (async) API",a=h(),r=o("button"),r.textContent="Send event to Rust",u(l,"class","button"),u(l,"id","log"),u(s,"class","button"),u(s,"id","request"),u(r,"class","button"),u(r,"id","event")},m(v,k){S(v,t,k),e(t,l),e(t,i),e(t,s),e(t,a),e(t,r),c||(m=[y(l,"click",n[0]),y(s,"click",n[1]),y(r,"click",n[2])],c=!0)},p:W,i:W,o:W,d(v){v&&R(t),c=!1,x(m)}}}function rs(n,t,l){let{onMessage:i}=t,s;en(async()=>{s=await $l("rust-event",i)}),Wn(()=>{s&&s()});function a(){Un("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function r(){Un("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){Pi("js-event","this is the payload string")}return n.$$set=m=>{"onMessage"in m&&l(3,i=m.onMessage)},[a,r,c,i]}class cs extends X{constructor(t){super();Y(this,t,rs,us,J,{onMessage:3})}}function ps(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b,d,z,M,q,A;return{c(){t=o("div"),l=o("input"),i=h(),s=o("input"),a=h(),r=o("div"),c=o("input"),m=h(),v=o("label"),v.textContent="Multiple",k=h(),g=o("div"),p=o("input"),_=h(),w=o("label"),w.textContent="Directory",b=h(),d=o("button"),d.textContent="Open dialog",z=h(),M=o("button"),M.textContent="Open save dialog",u(l,"id","dialog-default-path"),u(l,"placeholder","Default path"),u(s,"id","dialog-filter"),u(s,"placeholder","Extensions filter, comma-separated"),u(s,"class","svelte-1eg58yg"),u(c,"type","checkbox"),u(c,"id","dialog-multiple"),u(v,"for","dialog-multiple"),u(p,"type","checkbox"),u(p,"id","dialog-directory"),u(w,"for","dialog-directory"),u(d,"class","button"),u(d,"id","open-dialog"),u(M,"class","button"),u(M,"id","save-dialog")},m(P,L){S(P,t,L),e(t,l),E(l,n[0]),e(t,i),e(t,s),E(s,n[1]),e(t,a),e(t,r),e(r,c),c.checked=n[2],e(r,m),e(r,v),e(t,k),e(t,g),e(g,p),p.checked=n[3],e(g,_),e(g,w),e(t,b),e(t,d),e(t,z),e(t,M),q||(A=[y(l,"input",n[8]),y(s,"input",n[9]),y(c,"change",n[10]),y(p,"change",n[11]),y(d,"click",n[4]),y(M,"click",n[5])],q=!0)},p(P,[L]){L&1&&l.value!==P[0]&&E(l,P[0]),L&2&&s.value!==P[1]&&E(s,P[1]),L&4&&(c.checked=P[2]),L&8&&(p.checked=P[3])},i:W,o:W,d(P){P&&R(t),q=!1,x(A)}}}function fs(n,t){var l=new Blob([n],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(s){var a=s.target.result;t(a.substr(a.indexOf(",")+1))},i.readAsDataURL(l)}function ds(n,t,l){let{onMessage:i}=t,{insecureRenderHtml:s}=t,a=null,r=null,c=!1,m=!1;function v(){xl({title:"My wonderful open dialog",defaultPath:a,filters:r?[{name:"Tauri Example",extensions:r.split(",").map(b=>b.trim())}]:[],multiple:c,directory:m}).then(function(b){if(Array.isArray(b))i(b);else{var d=b,z=d.match(/\S+\.\S+$/g);ei(d).then(function(M){z&&(d.includes(".png")||d.includes(".jpg"))?fs(new Uint8Array(M),function(q){var A="data:image/png;base64,"+q;s('')}):i(b)}).catch(i(b))}}).catch(i)}function k(){Ai({title:"My wonderful save dialog",defaultPath:a,filters:r?[{name:"Tauri Example",extensions:r.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function g(){a=this.value,l(0,a)}function p(){r=this.value,l(1,r)}function _(){c=this.checked,l(2,c)}function w(){m=this.checked,l(3,m)}return n.$$set=b=>{"onMessage"in b&&l(6,i=b.onMessage),"insecureRenderHtml"in b&&l(7,s=b.insecureRenderHtml)},[a,r,c,m,v,k,i,s,g,p,_,w]}class hs extends X{constructor(t){super();Y(this,t,ds,ps,J,{onMessage:6,insecureRenderHtml:7})}}function ui(n,t,l){const i=n.slice();return i[9]=t[l],i}function ri(n){let t,l=n[9][0]+"",i,s;return{c(){t=o("option"),i=C(l),t.__value=s=n[9][1],t.value=t.__value},m(a,r){S(a,t,r),e(t,i)},p:W,d(a){a&&R(t)}}}function ms(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w=n[2],b=[];for(let d=0;disNaN(parseInt(p))).map(p=>[p,ti[p]]);function m(){const p=a.match(/\S+\.\S+$/g),_={dir:ci()};(p?ei(a,_):Ii(a,_)).then(function(b){if(p)if(a.includes(".png")||a.includes(".jpg"))vs(new Uint8Array(b),function(d){const z="data:image/png;base64,"+d;s('')});else{const d=String.fromCharCode.apply(null,b);s(''),setTimeout(()=>{const z=document.getElementById("file-response");z.value=d,document.getElementById("file-save").addEventListener("click",function(){Wi(a,z.value,{dir:ci()}).catch(i)})})}else i(b)}).catch(i)}function v(){l(1,r.src=Ui(a),r)}function k(){a=this.value,l(0,a)}function g(p){qi[p?"unshift":"push"](()=>{r=p,l(1,r)})}return n.$$set=p=>{"onMessage"in p&&l(5,i=p.onMessage),"insecureRenderHtml"in p&&l(6,s=p.insecureRenderHtml)},[a,r,c,m,v,i,s,k,g]}class gs extends X{constructor(t){super();Y(this,t,_s,ms,J,{onMessage:5,insecureRenderHtml:6})}}function bs(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b;return{c(){t=o("form"),l=o("select"),i=o("option"),i.textContent="GET",s=o("option"),s.textContent="POST",a=o("option"),a.textContent="PUT",r=o("option"),r.textContent="PATCH",c=o("option"),c.textContent="DELETE",m=h(),v=o("br"),k=h(),g=o("textarea"),p=h(),_=o("button"),_.textContent="Make request",i.__value="GET",i.value=i.__value,s.__value="POST",s.value=s.__value,a.__value="PUT",a.value=a.__value,r.__value="PATCH",r.value=r.__value,c.__value="DELETE",c.value=c.__value,u(l,"class","button"),u(l,"id","request-method"),n[0]===void 0&&qn(()=>n[4].call(l)),u(g,"id","request-body"),u(g,"placeholder","Request body"),u(g,"rows","5"),u(g,"class","svelte-1xfmj7b"),u(_,"class","button"),u(_,"id","make-request")},m(d,z){S(d,t,z),e(t,l),e(l,i),e(l,s),e(l,a),e(l,r),e(l,c),xe(l,n[0]),e(t,m),e(t,v),e(t,k),e(t,g),E(g,n[1]),e(t,p),e(t,_),w||(b=[y(l,"change",n[4]),y(g,"input",n[5]),y(t,"submit",tn(n[2]))],w=!0)},p(d,[z]){z&1&&xe(l,d[0]),z&2&&E(g,d[1])},i:W,o:W,d(d){d&&R(t),w=!1,x(b)}}}function ws(n,t,l){let i="GET",s="",{onMessage:a}=t;async function r(){const v=await ni().catch(p=>{throw a(p),p}),g={url:"http://localhost:3003",method:i||"GET"||"GET"};s.startsWith("{")&&s.endsWith("}")||s.startsWith("[")&&s.endsWith("]")?g.body=Nn.json(JSON.parse(s)):s!==""&&(g.body=Nn.text(s)),v.request(g).then(a).catch(a)}function c(){i=Dn(this),l(0,i)}function m(){s=this.value,l(1,s)}return n.$$set=v=>{"onMessage"in v&&l(3,a=v.onMessage)},[i,s,r,a,c,m]}class ks extends X{constructor(t){super();Y(this,t,ws,bs,J,{onMessage:3})}}function ys(n){let t,l,i;return{c(){t=o("button"),t.textContent="Send test notification",u(t,"class","button"),u(t,"id","notification")},m(s,a){S(s,t,a),l||(i=y(t,"click",zs),l=!0)},p:W,i:W,o:W,d(s){s&&R(t),l=!1,i()}}}function zs(){new Notification("Notification title",{body:"This is the notification body"})}function Cs(n,t,l){let{onMessage:i}=t;return n.$$set=s=>{"onMessage"in s&&l(0,i=s.onMessage)},[i]}class Ms extends X{constructor(t){super();Y(this,t,Cs,ys,J,{onMessage:0})}}function pi(n,t,l){const i=n.slice();return i[65]=t[l],i}function fi(n,t,l){const i=n.slice();return i[68]=t[l],i}function di(n){let t,l=n[68]+"",i,s;return{c(){t=o("option"),i=C(l),t.__value=s=n[68],t.value=t.__value},m(a,r){S(a,t,r),e(t,i)},p(a,r){r[0]&2&&l!==(l=a[68]+"")&&G(i,l),r[0]&2&&s!==(s=a[68])&&(t.__value=s,t.value=t.__value)},d(a){a&&R(t)}}}function hi(n){let t,l=n[65]+"",i,s;return{c(){t=o("option"),i=C(l),t.__value=s=n[65],t.value=t.__value},m(a,r){S(a,t,r),e(t,i)},p:W,d(a){a&&R(t)}}}function Ts(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b,d,z,M,q,A,P,L,I,N,K,fe,V,j,O,Q,H,F,Se,Re,Ae,wt,et,ee,de,Ie,kt,le,yt,We,zt,ie,Ct,he,Ue,Mt,se,Tt,qe,St,oe,Rt,me,Ne,Lt,ae,Et,De,Ht,ue,Ot,ve,je,D,te,Jn,Pt,Kn,ce,ln,re,Ge,_e,sn,Qn,tt,Zn,At=n[25].width+"",on,$n,nt,xn,It=n[25].height+"",an,el,ge,un,tl,lt,nl,Wt=n[26].width+"",rn,ll,it,il,Ut=n[26].height+"",cn,sl,Be,be,pn,ol,st,al,qt=n[25].toLogical(n[22]).width+"",fn,ul,ot,rl,Nt=n[25].toLogical(n[22]).height+"",dn,cl,we,hn,pl,at,fl,Dt=n[26].toLogical(n[22]).width+"",mn,dl,ut,hl,jt=n[26].toLogical(n[22]).height+"",vn,ml,Fe,ke,_n,vl,rt,_l,Gt=n[23].x+"",gn,gl,ct,bl,Bt=n[23].y+"",bn,wl,ye,wn,kl,pt,yl,Ft=n[24].x+"",kn,zl,ft,Cl,Vt=n[24].y+"",yn,Ml,Ve,ze,zn,Tl,dt,Sl,Xt=n[23].toLogical(n[22]).x+"",Cn,Rl,ht,Ll,Yt=n[23].toLogical(n[22]).y+"",Mn,El,Ce,Tn,Hl,mt,Ol,Jt=n[24].toLogical(n[22]).x+"",Sn,Pl,vt,Al,Kt=n[24].toLogical(n[22]).y+"",Rn,Ln,ne,En,Il,Qt,Xe,Wl,Ul,Zt,Ye,ql,Nl,pe,Dl,Je,$t,jl,Le,Gl,xt,Bl,Ee,Hn,Me,He,Fl,_t,On,Te,Oe,Vl,gt,Pn,Pe,An,Ke,In,Xl,Qe=Object.keys(n[1]),Z=[];for(let f=0;fn[37].call(l)),u(r,"type","checkbox"),u(k,"type","checkbox"),u(_,"title","Unminimizes after 2 seconds"),u(b,"title","Unminimizes after 2 seconds"),u(z,"title","Visible again after 2 seconds"),u(A,"type","checkbox"),u(N,"type","checkbox"),u(j,"type","checkbox"),u(B,"type","checkbox"),u(le,"type","number"),u(le,"min","0"),u(le,"class","svelte-1tppwwz"),u(ie,"type","number"),u(ie,"min","0"),u(ie,"class","svelte-1tppwwz"),u(de,"class","flex col grow svelte-1tppwwz"),u(se,"type","number"),u(se,"min","400"),u(se,"class","svelte-1tppwwz"),u(oe,"type","number"),u(oe,"min","400"),u(oe,"class","svelte-1tppwwz"),u(he,"class","flex col grow svelte-1tppwwz"),u(ae,"type","number"),u(ae,"class","svelte-1tppwwz"),u(ue,"type","number"),u(ue,"class","svelte-1tppwwz"),u(me,"class","flex col grow svelte-1tppwwz"),u(te,"type","number"),u(te,"min","400"),u(te,"class","svelte-1tppwwz"),u(ce,"type","number"),u(ce,"min","400"),u(ce,"class","svelte-1tppwwz"),u(ve,"class","flex col grow svelte-1tppwwz"),u(ee,"class","window-controls flex flex-row svelte-1tppwwz"),u(t,"class","flex col"),u(tt,"class","svelte-1tppwwz"),u(nt,"class","svelte-1tppwwz"),u(_e,"class","grow window-property svelte-1tppwwz"),u(lt,"class","svelte-1tppwwz"),u(it,"class","svelte-1tppwwz"),u(ge,"class","grow window-property svelte-1tppwwz"),u(Fe,"class","flex"),u(st,"class","svelte-1tppwwz"),u(ot,"class","svelte-1tppwwz"),u(be,"class","grow window-property svelte-1tppwwz"),u(at,"class","svelte-1tppwwz"),u(ut,"class","svelte-1tppwwz"),u(we,"class","grow window-property svelte-1tppwwz"),u(Ge,"class","flex"),u(rt,"class","svelte-1tppwwz"),u(ct,"class","svelte-1tppwwz"),u(ke,"class","grow window-property svelte-1tppwwz"),u(pt,"class","svelte-1tppwwz"),u(ft,"class","svelte-1tppwwz"),u(ye,"class","grow window-property svelte-1tppwwz"),u(Be,"class","flex"),u(dt,"class","svelte-1tppwwz"),u(ht,"class","svelte-1tppwwz"),u(ze,"class","grow window-property svelte-1tppwwz"),u(mt,"class","svelte-1tppwwz"),u(vt,"class","svelte-1tppwwz"),u(Ce,"class","grow window-property svelte-1tppwwz"),u(Ve,"class","flex"),u(Xe,"type","checkbox"),u(Ye,"type","checkbox"),u(pe,"class","button"),n[19]===void 0&&qn(()=>n[55].call(pe)),u(Le,"type","number"),u(Ee,"type","number"),u(Je,"class","flex col grow svelte-1tppwwz"),u(He,"id","title"),u(_t,"class","button"),u(_t,"type","submit"),u(Me,"class","svelte-1tppwwz"),u(Oe,"id","url"),u(gt,"class","button"),u(gt,"id","open-url"),u(Te,"class","svelte-1tppwwz"),u(Pe,"class","button"),u(Pe,"title","Minimizes the window, requests attention for 3s and then resets it"),u(Ke,"class","button")},m(f,T){S(f,t,T),e(t,l);for(let U=0;U{typeof D=="string"&&s[i].setIcon(D)})}function Ie(){const D=Math.random().toString().replace(".",""),te=new qi(D);l(1,s[D]=te,s),te.once("tauri://error",function(){r("Error creating new webview")})}function kt(){s[i].innerSize().then(D=>{l(25,K=D),l(7,w=K.width),l(8,b=K.height)}),s[i].outerSize().then(D=>{l(26,fe=D)})}function le(){s[i].innerPosition().then(D=>{l(23,I=D)}),s[i].outerPosition().then(D=>{l(24,N=D),l(13,A=N.x),l(14,P=N.y)})}async function yt(D){V&&V(),j&&j(),j=await D.listen("tauri://move",le),V=await D.listen("tauri://resize",kt)}async function We(){await s[i].minimize(),await s[i].requestUserAttention(Ni.Critical),await new Promise(D=>setTimeout(D,3e3)),await s[i].requestUserAttention(null)}function zt(){i=Dn(this),l(0,i),l(1,s)}function ie(){m=this.checked,l(2,m)}function Ct(){v=this.checked,l(3,v)}const he=()=>s[i].center();function Ue(){k=this.checked,l(21,k)}function Mt(){g=this.checked,l(4,g)}function se(){p=this.checked,l(5,p)}function Tt(){_=this.checked,l(6,_)}function qe(){A=G(this.value),l(13,A)}function St(){P=G(this.value),l(14,P)}function oe(){w=G(this.value),l(7,w)}function Rt(){b=G(this.value),l(8,b)}function me(){d=G(this.value),l(9,d)}function Ne(){z=G(this.value),l(10,z)}function Lt(){M=G(this.value),l(11,M)}function ae(){q=G(this.value),l(12,q)}function Et(){O=this.checked,l(15,O)}function De(){Q=this.checked,l(16,Q)}function Ht(){Se=Dn(this),l(19,Se),l(28,a)}function ue(){H=G(this.value),l(17,H)}function Ot(){B=G(this.value),l(18,B)}function ve(){Re=this.value,l(27,Re)}function je(){c=this.value,l(20,c)}return n.$$set=D=>{"onMessage"in D&&l(36,r=D.onMessage)},n.$$.update=()=>{n.$$.dirty[0]&7&&s[i].setResizable(m),n.$$.dirty[0]&11&&(v?s[i].maximize():s[i].unmaximize()),n.$$.dirty[0]&19&&s[i].setDecorations(g),n.$$.dirty[0]&35&&s[i].setAlwaysOnTop(p),n.$$.dirty[0]&67&&s[i].setFullscreen(_),n.$$.dirty[0]&387&&s[i].setSize(new Fn(w,b)),n.$$.dirty[0]&1539&&(d&&z?s[i].setMinSize(new li(d,z)):s[i].setMinSize(null)),n.$$.dirty[0]&6147&&(M&&q?s[i].setMaxSize(new li(M,q)):s[i].setMaxSize(null)),n.$$.dirty[0]&24579&&s[i].setPosition(new nn(A,P)),n.$$.dirty[0]&3&&s[i].scaleFactor().then(D=>l(22,L=D)),n.$$.dirty[0]&3&&yt(s[i]),n.$$.dirty[0]&32771&&s[i].setCursorGrab(O),n.$$.dirty[0]&65539&&s[i].setCursorVisible(Q),n.$$.dirty[0]&524291&&s[i].setCursorIcon(Se),n.$$.dirty[0]&393219&&s[i].setCursorPosition(new nn(H,B))},[i,s,m,v,g,p,_,w,b,d,z,M,q,A,P,O,Q,H,B,Se,c,k,L,I,N,K,fe,Re,a,Ae,wt,et,ee,de,Ie,We,r,zt,ie,Ct,he,Ue,Mt,se,Tt,qe,St,oe,Rt,me,Ne,Lt,ae,Et,De,Ht,ue,Ot,ve,je]}class Ss extends X{constructor(t){super();Y(this,t,Ts,Ms,J,{onMessage:36},[-1,-1,-1])}}function mi(n,t,l){const i=n.slice();return i[9]=t[l],i}function vi(n){let t,l=n[9]+"",i,s,a,r,c;function m(){return n[8](n[9])}return{c(){t=o("div"),i=C(l),s=h(),a=o("button"),a.textContent="Unregister",u(a,"type","button")},m(v,k){S(v,t,k),e(t,i),e(t,s),e(t,a),r||(c=y(a,"click",m),r=!0)},p(v,k){n=v,k&2&&l!==(l=n[9]+"")&&F(i,l)},d(v){v&&R(t),r=!1,c()}}}function _i(n){let t,l,i;return{c(){t=o("button"),t.textContent="Unregister all",u(t,"type","button")},m(s,a){S(s,t,a),l||(i=y(t,"click",n[5]),l=!0)},p:W,d(s){s&&R(t),l=!1,i()}}}function Rs(n){let t,l,i,s,a,r,c,m,v,k,g=n[1],p=[];for(let w=0;wl(1,i=p));let r="CmdOrControl+X";function c(){const p=r;Di(p,()=>{s(`Shortcut ${p} triggered`)}).then(()=>{a.update(_=>[..._,p]),s(`Shortcut ${p} registered successfully`)}).catch(s)}function m(p){const _=p;ji(_).then(()=>{a.update(w=>w.filter(b=>b!==_)),s(`Shortcut ${_} unregistered`)}).catch(s)}function v(){Fi().then(()=>{a.update(()=>[]),s("Unregistered all shortcuts")}).catch(s)}function k(){r=this.value,l(0,r)}const g=p=>m(p);return n.$$set=p=>{"onMessage"in p&&l(6,s=p.onMessage)},[r,i,a,c,m,v,s,k,g]}class Es extends X{constructor(t){super();Y(this,t,Ls,Rs,J,{onMessage:6})}}function gi(n){let t,l,i,s,a;return{c(){t=o("input"),l=h(),i=o("button"),i.textContent="Write",u(t,"placeholder","write to stdin"),u(i,"class","button")},m(r,c){S(r,t,c),E(t,n[3]),S(r,l,c),S(r,i,c),s||(a=[y(t,"input",n[10]),y(i,"click",n[7])],s=!0)},p(r,c){c&8&&t.value!==r[3]&&E(t,r[3])},d(r){r&&R(t),r&&R(l),r&&R(i),s=!1,x(a)}}}function Hs(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b,d=n[4]&&gi(n);return{c(){t=o("div"),l=o("div"),i=o("input"),s=h(),a=o("button"),a.textContent="Run",r=h(),c=o("button"),c.textContent="Kill",m=h(),d&&d.c(),v=h(),k=o("div"),g=o("input"),p=h(),_=o("input"),u(a,"class","button"),u(c,"class","button"),u(g,"placeholder","Working directory"),u(_,"class","env-vars svelte-1g38c1n"),u(_,"placeholder","Environment variables")},m(z,M){S(z,t,M),e(t,l),e(l,i),E(i,n[0]),e(l,s),e(l,a),e(l,r),e(l,c),e(l,m),d&&d.m(l,null),e(t,v),e(t,k),e(k,g),E(g,n[1]),e(k,p),e(k,_),E(_,n[2]),w||(b=[y(i,"input",n[9]),y(a,"click",n[5]),y(c,"click",n[6]),y(g,"input",n[11]),y(_,"input",n[12])],w=!0)},p(z,[M]){M&1&&i.value!==z[0]&&E(i,z[0]),z[4]?d?d.p(z,M):(d=gi(z),d.c(),d.m(l,null)):d&&(d.d(1),d=null),M&2&&g.value!==z[1]&&E(g,z[1]),M&4&&_.value!==z[2]&&E(_,z[2])},i:W,o:W,d(z){z&&R(t),d&&d.d(),w=!1,x(b)}}}function Os(n,t,l){const i=navigator.userAgent.includes("Windows");let s=i?"cmd":"sh",a=i?["/C"]:["-c"],{onMessage:r}=t,c='echo "hello world"',m=null,v="SOMETHING=value ANOTHER=2",k="",g;function p(){return v.split(" ").reduce((A,P)=>{let[L,I]=P.split("=");return Ql(Kl({},A),{[L]:I})},{})}function _(){l(4,g=null);const A=new Gi(s,[...a,c],{cwd:m||null,env:p()});A.on("close",P=>{r(`command finished with code ${P.code} and signal ${P.signal}`),l(4,g=null)}),A.on("error",P=>r(`command error: "${P}"`)),A.stdout.on("data",P=>r(`command stdout: "${P}"`)),A.stderr.on("data",P=>r(`command stderr: "${P}"`)),A.spawn().then(P=>{l(4,g=P)}).catch(r)}function w(){g.kill().then(()=>r("killed child process")).catch(r)}function b(){g.write(k).catch(r)}function d(){c=this.value,l(0,c)}function z(){k=this.value,l(3,k)}function M(){m=this.value,l(1,m)}function q(){v=this.value,l(2,v)}return n.$$set=A=>{"onMessage"in A&&l(8,r=A.onMessage)},[c,m,v,k,g,_,w,b,r,d,z,M,q]}class Ps extends X{constructor(t){super();Y(this,t,Os,Hs,J,{onMessage:8})}}function As(n){let t,l,i,s,a,r;return{c(){t=o("div"),l=o("button"),l.textContent="Check update",i=h(),s=o("button"),s.textContent="Install update",u(l,"class","button"),u(l,"id","check_update"),u(s,"class","button hidden"),u(s,"id","start_update")},m(c,m){S(c,t,m),e(t,l),e(t,i),e(t,s),a||(r=[y(l,"click",n[0]),y(s,"click",n[1])],a=!0)},p:W,i:W,o:W,d(c){c&&R(t),a=!1,x(r)}}}function Is(n,t,l){let{onMessage:i}=t,s;en(async()=>{s=await $l("tauri://update-status",i)}),Wn(()=>{s&&s()});async function a(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:c,manifest:m}=await Bi();i(`Should update: ${c}`),i(m),c&&document.getElementById("start_update").classList.remove("hidden")}catch(c){i(c)}}async function r(){try{document.getElementById("start_update").classList.add("hidden"),await Vi(),i("Installation complete, restart required."),await Zl()}catch(c){i(c)}}return n.$$set=c=>{"onMessage"in c&&l(2,i=c.onMessage)},[a,r,i]}class Ws extends X{constructor(t){super();Y(this,t,Is,As,J,{onMessage:2})}}function Us(n){let t,l,i,s,a,r,c,m,v;return{c(){t=o("div"),l=o("div"),i=o("input"),s=h(),a=o("button"),a.textContent="Write",r=h(),c=o("button"),c.textContent="Read",u(i,"placeholder","Text to write to the clipboard"),u(a,"type","button"),u(c,"type","button")},m(k,g){S(k,t,g),e(t,l),e(l,i),E(i,n[0]),e(l,s),e(l,a),e(t,r),e(t,c),m||(v=[y(i,"input",n[4]),y(a,"click",n[1]),y(c,"click",n[2])],m=!0)},p(k,[g]){g&1&&i.value!==k[0]&&E(i,k[0])},i:W,o:W,d(k){k&&R(t),m=!1,x(v)}}}function qs(n,t,l){let{onMessage:i}=t,s="clipboard message";function a(){Xi(s).then(()=>{i("Wrote to the clipboard")}).catch(i)}function r(){Yi().then(m=>{i(`Clipboard contents: ${m}`)}).catch(i)}function c(){s=this.value,l(0,s)}return n.$$set=m=>{"onMessage"in m&&l(3,i=m.onMessage)},[s,a,r,i,c]}class Ns extends X{constructor(t){super();Y(this,t,qs,Us,J,{onMessage:3})}}function Ds(n){let t;return{c(){t=o("div"),t.innerHTML=`

    Not available for Linux

    - `},m(l,i){S(l,t,i)},p:W,i:W,o:W,d(l){l&&R(t)}}}function js(n,t,l){let{onMessage:i}=t;const s=window.constraints={audio:!0,video:!0};function a(c){const m=document.querySelector("video"),v=c.getVideoTracks();i("Got stream with constraints:",s),i(`Using video device: ${v[0].label}`),window.stream=c,m.srcObject=c}function r(c){if(c.name==="ConstraintNotSatisfiedError"){const m=s.video;i(`The resolution ${m.width.exact}x${m.height.exact} px is not supported by your device.`)}else c.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${c.name}`,c)}return en(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(s);a(c)}catch(c){r(c)}}),Wn(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),n.$$set=c=>{"onMessage"in c&&l(0,i=c.onMessage)},[i]}class Fs extends X{constructor(t){super();Y(this,t,js,Ds,J,{onMessage:0})}}function Gs(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b;return p=new Ji({props:{json:n[2]}}),{c(){t=o("div"),l=o("input"),i=h(),s=o("input"),a=h(),r=o("label"),c=o("input"),m=C(` - Multipart`),v=h(),k=o("button"),k.textContent="Post it.",g=h(),Gn(p.$$.fragment),u(c,"type","checkbox"),u(k,"type","button")},m(d,z){S(d,t,z),e(t,l),E(l,n[0]),e(t,i),e(t,s),E(s,n[1]),e(t,a),e(t,r),e(r,c),c.checked=n[3],e(r,m),e(t,v),e(t,k),e(t,g),Bn(p,t,null),_=!0,w||(b=[y(l,"input",n[5]),y(s,"input",n[6]),y(c,"change",n[7]),y(k,"click",n[4])],w=!0)},p(d,[z]){z&1&&l.value!==d[0]&&E(l,d[0]),z&2&&s.value!==d[1]&&E(s,d[1]),z&8&&(c.checked=d[3]);const M={};z&4&&(M.json=d[2]),p.$set(M)},i(d){_||(Vn(p.$$.fragment,d),_=!0)},o(d){Xn(p.$$.fragment,d),_=!1},d(d){d&&R(t),Yn(p),w=!1,x(b)}}}function Bs(n,t,l){let i="baz",s="qux",a=null,r=!0;async function c(){const g=await ni().catch(p=>{throw onMessage(p),p});l(2,a=await g.request({url:"http://localhost:3003",method:"POST",body:Nn.form({foo:i,bar:s}),headers:r?{"Content-Type":"multipart/form-data"}:void 0,responseType:Ki.Text}))}function m(){i=this.value,l(0,i)}function v(){s=this.value,l(1,s)}function k(){r=this.checked,l(3,r)}return[i,s,a,r,c,m,v,k]}class Vs extends X{constructor(t){super();Y(this,t,Bs,Gs,J,{})}}function bi(n,t,l){const i=n.slice();return i[10]=t[l],i}function wi(n,t,l){const i=n.slice();return i[13]=t[l],i}function ki(n){let t,l=n[13].label+"",i,s,a,r,c;function m(){return n[9](n[13])}return{c(){t=o("p"),i=C(l),s=h(),u(t,"class",a="nv noselect "+(n[0]===n[13]?"nv_selected":""))},m(v,k){S(v,t,k),e(t,i),e(t,s),r||(c=y(t,"click",m),r=!0)},p(v,k){n=v,k&1&&a!==(a="nv noselect "+(n[0]===n[13]?"nv_selected":""))&&u(t,"class",a)},d(v){v&&R(t),r=!1,c()}}}function Xs(n){let t,l=n[10].html+"",i;return{c(){i=ai(),t=new xi(i)},m(s,a){t.m(l,s,a),S(s,i,a)},p(s,a){a&2&&l!==(l=s[10].html+"")&&t.p(l)},d(s){s&&R(i),s&&t.d()}}}function Ys(n){let t,l=n[10].text+"",i;return{c(){t=o("p"),i=C(l)},m(s,a){S(s,t,a),e(t,i)},p(s,a){a&2&&l!==(l=s[10].text+"")&&F(i,l)},d(s){s&&R(t)}}}function yi(n){let t;function l(a,r){return a[10].text?Ys:Xs}let i=l(n),s=i(n);return{c(){s.c(),t=ai()},m(a,r){s.m(a,r),S(a,t,r)},p(a,r){i===(i=l(a))&&s?s.p(a,r):(s.d(1),s=i(a),s&&(s.c(),s.m(t.parentNode,t)))},d(a){s.d(a),a&&R(t)}}}function Js(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b,d,z,M,q,A,P,L,I=n[2],N=[];for(let O=0;ODocumentation + `),Le=o("input"),Gl=h(),xt=o("div"),Bl=C(`Y position + `),Ee=o("input"),Hn=h(),Me=o("form"),He=o("input"),Fl=h(),_t=o("button"),_t.textContent="Set title",On=h(),Te=o("form"),Oe=o("input"),Vl=h(),gt=o("button"),gt.textContent="Open URL",Pn=h(),Pe=o("button"),Pe.textContent="Request attention",An=h(),Ke=o("button"),Ke.textContent="New window",u(l,"class","button"),n[0]===void 0&&qn(()=>n[37].call(l)),u(r,"type","checkbox"),u(k,"type","checkbox"),u(_,"title","Unminimizes after 2 seconds"),u(b,"title","Unminimizes after 2 seconds"),u(z,"title","Visible again after 2 seconds"),u(A,"type","checkbox"),u(N,"type","checkbox"),u(j,"type","checkbox"),u(F,"type","checkbox"),u(le,"type","number"),u(le,"min","0"),u(le,"class","svelte-1tppwwz"),u(ie,"type","number"),u(ie,"min","0"),u(ie,"class","svelte-1tppwwz"),u(de,"class","flex col grow svelte-1tppwwz"),u(se,"type","number"),u(se,"min","400"),u(se,"class","svelte-1tppwwz"),u(oe,"type","number"),u(oe,"min","400"),u(oe,"class","svelte-1tppwwz"),u(he,"class","flex col grow svelte-1tppwwz"),u(ae,"type","number"),u(ae,"class","svelte-1tppwwz"),u(ue,"type","number"),u(ue,"class","svelte-1tppwwz"),u(me,"class","flex col grow svelte-1tppwwz"),u(te,"type","number"),u(te,"min","400"),u(te,"class","svelte-1tppwwz"),u(ce,"type","number"),u(ce,"min","400"),u(ce,"class","svelte-1tppwwz"),u(ve,"class","flex col grow svelte-1tppwwz"),u(ee,"class","window-controls flex flex-row svelte-1tppwwz"),u(t,"class","flex col"),u(tt,"class","svelte-1tppwwz"),u(nt,"class","svelte-1tppwwz"),u(_e,"class","grow window-property svelte-1tppwwz"),u(lt,"class","svelte-1tppwwz"),u(it,"class","svelte-1tppwwz"),u(ge,"class","grow window-property svelte-1tppwwz"),u(Ge,"class","flex"),u(st,"class","svelte-1tppwwz"),u(ot,"class","svelte-1tppwwz"),u(be,"class","grow window-property svelte-1tppwwz"),u(at,"class","svelte-1tppwwz"),u(ut,"class","svelte-1tppwwz"),u(we,"class","grow window-property svelte-1tppwwz"),u(Be,"class","flex"),u(rt,"class","svelte-1tppwwz"),u(ct,"class","svelte-1tppwwz"),u(ke,"class","grow window-property svelte-1tppwwz"),u(pt,"class","svelte-1tppwwz"),u(ft,"class","svelte-1tppwwz"),u(ye,"class","grow window-property svelte-1tppwwz"),u(Fe,"class","flex"),u(dt,"class","svelte-1tppwwz"),u(ht,"class","svelte-1tppwwz"),u(ze,"class","grow window-property svelte-1tppwwz"),u(mt,"class","svelte-1tppwwz"),u(vt,"class","svelte-1tppwwz"),u(Ce,"class","grow window-property svelte-1tppwwz"),u(Ve,"class","flex"),u(Xe,"type","checkbox"),u(Ye,"type","checkbox"),u(pe,"class","button"),n[19]===void 0&&qn(()=>n[55].call(pe)),u(Le,"type","number"),u(Ee,"type","number"),u(Je,"class","flex col grow svelte-1tppwwz"),u(He,"id","title"),u(_t,"class","button"),u(_t,"type","submit"),u(Me,"class","svelte-1tppwwz"),u(Oe,"id","url"),u(gt,"class","button"),u(gt,"id","open-url"),u(Te,"class","svelte-1tppwwz"),u(Pe,"class","button"),u(Pe,"title","Minimizes the window, requests attention for 3s and then resets it"),u(Ke,"class","button")},m(f,T){S(f,t,T),e(t,l);for(let U=0;U{typeof D=="string"&&s[i].setIcon(D)})}function Ie(){const D=Math.random().toString().replace(".",""),te=new Ni(D);l(1,s[D]=te,s),te.once("tauri://error",function(){r("Error creating new webview")})}function kt(){s[i].innerSize().then(D=>{l(25,K=D),l(7,w=K.width),l(8,b=K.height)}),s[i].outerSize().then(D=>{l(26,fe=D)})}function le(){s[i].innerPosition().then(D=>{l(23,I=D)}),s[i].outerPosition().then(D=>{l(24,N=D),l(13,A=N.x),l(14,P=N.y)})}async function yt(D){V&&V(),j&&j(),j=await D.listen("tauri://move",le),V=await D.listen("tauri://resize",kt)}async function We(){await s[i].minimize(),await s[i].requestUserAttention(Di.Critical),await new Promise(D=>setTimeout(D,3e3)),await s[i].requestUserAttention(null)}function zt(){i=Dn(this),l(0,i),l(1,s)}function ie(){m=this.checked,l(2,m)}function Ct(){v=this.checked,l(3,v)}const he=()=>s[i].center();function Ue(){k=this.checked,l(21,k)}function Mt(){g=this.checked,l(4,g)}function se(){p=this.checked,l(5,p)}function Tt(){_=this.checked,l(6,_)}function qe(){A=B(this.value),l(13,A)}function St(){P=B(this.value),l(14,P)}function oe(){w=B(this.value),l(7,w)}function Rt(){b=B(this.value),l(8,b)}function me(){d=B(this.value),l(9,d)}function Ne(){z=B(this.value),l(10,z)}function Lt(){M=B(this.value),l(11,M)}function ae(){q=B(this.value),l(12,q)}function Et(){O=this.checked,l(15,O)}function De(){Q=this.checked,l(16,Q)}function Ht(){Se=Dn(this),l(19,Se),l(28,a)}function ue(){H=B(this.value),l(17,H)}function Ot(){F=B(this.value),l(18,F)}function ve(){Re=this.value,l(27,Re)}function je(){c=this.value,l(20,c)}return n.$$set=D=>{"onMessage"in D&&l(36,r=D.onMessage)},n.$$.update=()=>{n.$$.dirty[0]&7&&s[i].setResizable(m),n.$$.dirty[0]&11&&(v?s[i].maximize():s[i].unmaximize()),n.$$.dirty[0]&19&&s[i].setDecorations(g),n.$$.dirty[0]&35&&s[i].setAlwaysOnTop(p),n.$$.dirty[0]&67&&s[i].setFullscreen(_),n.$$.dirty[0]&387&&s[i].setSize(new Gn(w,b)),n.$$.dirty[0]&1539&&(d&&z?s[i].setMinSize(new li(d,z)):s[i].setMinSize(null)),n.$$.dirty[0]&6147&&(M&&q?s[i].setMaxSize(new li(M,q)):s[i].setMaxSize(null)),n.$$.dirty[0]&24579&&s[i].setPosition(new nn(A,P)),n.$$.dirty[0]&3&&s[i].scaleFactor().then(D=>l(22,L=D)),n.$$.dirty[0]&3&&yt(s[i]),n.$$.dirty[0]&32771&&s[i].setCursorGrab(O),n.$$.dirty[0]&65539&&s[i].setCursorVisible(Q),n.$$.dirty[0]&524291&&s[i].setCursorIcon(Se),n.$$.dirty[0]&393219&&s[i].setCursorPosition(new nn(H,F))},[i,s,m,v,g,p,_,w,b,d,z,M,q,A,P,O,Q,H,F,Se,c,k,L,I,N,K,fe,Re,a,Ae,wt,et,ee,de,Ie,We,r,zt,ie,Ct,he,Ue,Mt,se,Tt,qe,St,oe,Rt,me,Ne,Lt,ae,Et,De,Ht,ue,Ot,ve,je]}class Rs extends X{constructor(t){super();Y(this,t,Ss,Ts,J,{onMessage:36},[-1,-1,-1])}}function mi(n,t,l){const i=n.slice();return i[9]=t[l],i}function vi(n){let t,l=n[9]+"",i,s,a,r,c;function m(){return n[8](n[9])}return{c(){t=o("div"),i=C(l),s=h(),a=o("button"),a.textContent="Unregister",u(a,"type","button")},m(v,k){S(v,t,k),e(t,i),e(t,s),e(t,a),r||(c=y(a,"click",m),r=!0)},p(v,k){n=v,k&2&&l!==(l=n[9]+"")&&G(i,l)},d(v){v&&R(t),r=!1,c()}}}function _i(n){let t,l,i;return{c(){t=o("button"),t.textContent="Unregister all",u(t,"type","button")},m(s,a){S(s,t,a),l||(i=y(t,"click",n[5]),l=!0)},p:W,d(s){s&&R(t),l=!1,i()}}}function Ls(n){let t,l,i,s,a,r,c,m,v,k,g=n[1],p=[];for(let w=0;wl(1,i=p));let r="CmdOrControl+X";function c(){const p=r;ji(p,()=>{s(`Shortcut ${p} triggered`)}).then(()=>{a.update(_=>[..._,p]),s(`Shortcut ${p} registered successfully`)}).catch(s)}function m(p){const _=p;Gi(_).then(()=>{a.update(w=>w.filter(b=>b!==_)),s(`Shortcut ${_} unregistered`)}).catch(s)}function v(){Bi().then(()=>{a.update(()=>[]),s("Unregistered all shortcuts")}).catch(s)}function k(){r=this.value,l(0,r)}const g=p=>m(p);return n.$$set=p=>{"onMessage"in p&&l(6,s=p.onMessage)},[r,i,a,c,m,v,s,k,g]}class Hs extends X{constructor(t){super();Y(this,t,Es,Ls,J,{onMessage:6})}}function gi(n){let t,l,i,s,a;return{c(){t=o("input"),l=h(),i=o("button"),i.textContent="Write",u(t,"placeholder","write to stdin"),u(i,"class","button")},m(r,c){S(r,t,c),E(t,n[3]),S(r,l,c),S(r,i,c),s||(a=[y(t,"input",n[10]),y(i,"click",n[7])],s=!0)},p(r,c){c&8&&t.value!==r[3]&&E(t,r[3])},d(r){r&&R(t),r&&R(l),r&&R(i),s=!1,x(a)}}}function Os(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b,d=n[4]&&gi(n);return{c(){t=o("div"),l=o("div"),i=o("input"),s=h(),a=o("button"),a.textContent="Run",r=h(),c=o("button"),c.textContent="Kill",m=h(),d&&d.c(),v=h(),k=o("div"),g=o("input"),p=h(),_=o("input"),u(a,"class","button"),u(c,"class","button"),u(g,"placeholder","Working directory"),u(_,"class","env-vars svelte-1g38c1n"),u(_,"placeholder","Environment variables")},m(z,M){S(z,t,M),e(t,l),e(l,i),E(i,n[0]),e(l,s),e(l,a),e(l,r),e(l,c),e(l,m),d&&d.m(l,null),e(t,v),e(t,k),e(k,g),E(g,n[1]),e(k,p),e(k,_),E(_,n[2]),w||(b=[y(i,"input",n[9]),y(a,"click",n[5]),y(c,"click",n[6]),y(g,"input",n[11]),y(_,"input",n[12])],w=!0)},p(z,[M]){M&1&&i.value!==z[0]&&E(i,z[0]),z[4]?d?d.p(z,M):(d=gi(z),d.c(),d.m(l,null)):d&&(d.d(1),d=null),M&2&&g.value!==z[1]&&E(g,z[1]),M&4&&_.value!==z[2]&&E(_,z[2])},i:W,o:W,d(z){z&&R(t),d&&d.d(),w=!1,x(b)}}}function Ps(n,t,l){const i=navigator.userAgent.includes("Windows");let s=i?"cmd":"sh",a=i?["/C"]:["-c"],{onMessage:r}=t,c='echo "hello world"',m=null,v="SOMETHING=value ANOTHER=2",k="",g;function p(){return v.split(" ").reduce((A,P)=>{let[L,I]=P.split("=");return Ql(Kl({},A),{[L]:I})},{})}function _(){l(4,g=null);const A=new Fi(s,[...a,c],{cwd:m||null,env:p()});A.on("close",P=>{r(`command finished with code ${P.code} and signal ${P.signal}`),l(4,g=null)}),A.on("error",P=>r(`command error: "${P}"`)),A.stdout.on("data",P=>r(`command stdout: "${P}"`)),A.stderr.on("data",P=>r(`command stderr: "${P}"`)),A.spawn().then(P=>{l(4,g=P)}).catch(r)}function w(){g.kill().then(()=>r("killed child process")).catch(r)}function b(){g.write(k).catch(r)}function d(){c=this.value,l(0,c)}function z(){k=this.value,l(3,k)}function M(){m=this.value,l(1,m)}function q(){v=this.value,l(2,v)}return n.$$set=A=>{"onMessage"in A&&l(8,r=A.onMessage)},[c,m,v,k,g,_,w,b,r,d,z,M,q]}class As extends X{constructor(t){super();Y(this,t,Ps,Os,J,{onMessage:8})}}function Is(n){let t,l,i,s,a,r;return{c(){t=o("div"),l=o("button"),l.textContent="Check update",i=h(),s=o("button"),s.textContent="Install update",u(l,"class","button"),u(l,"id","check_update"),u(s,"class","button hidden"),u(s,"id","start_update")},m(c,m){S(c,t,m),e(t,l),e(t,i),e(t,s),a||(r=[y(l,"click",n[0]),y(s,"click",n[1])],a=!0)},p:W,i:W,o:W,d(c){c&&R(t),a=!1,x(r)}}}function Ws(n,t,l){let{onMessage:i}=t,s;en(async()=>{s=await $l("tauri://update-status",i)}),Wn(()=>{s&&s()});async function a(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:c,manifest:m}=await Vi();i(`Should update: ${c}`),i(m),c&&document.getElementById("start_update").classList.remove("hidden")}catch(c){i(c)}}async function r(){try{document.getElementById("start_update").classList.add("hidden"),await Xi(),i("Installation complete, restart required."),await Zl()}catch(c){i(c)}}return n.$$set=c=>{"onMessage"in c&&l(2,i=c.onMessage)},[a,r,i]}class Us extends X{constructor(t){super();Y(this,t,Ws,Is,J,{onMessage:2})}}function qs(n){let t,l,i,s,a,r,c,m,v;return{c(){t=o("div"),l=o("div"),i=o("input"),s=h(),a=o("button"),a.textContent="Write",r=h(),c=o("button"),c.textContent="Read",u(i,"placeholder","Text to write to the clipboard"),u(a,"type","button"),u(c,"type","button")},m(k,g){S(k,t,g),e(t,l),e(l,i),E(i,n[0]),e(l,s),e(l,a),e(t,r),e(t,c),m||(v=[y(i,"input",n[4]),y(a,"click",n[1]),y(c,"click",n[2])],m=!0)},p(k,[g]){g&1&&i.value!==k[0]&&E(i,k[0])},i:W,o:W,d(k){k&&R(t),m=!1,x(v)}}}function Ns(n,t,l){let{onMessage:i}=t,s="clipboard message";function a(){Yi(s).then(()=>{i("Wrote to the clipboard")}).catch(i)}function r(){Ji().then(m=>{i(`Clipboard contents: ${m}`)}).catch(i)}function c(){s=this.value,l(0,s)}return n.$$set=m=>{"onMessage"in m&&l(3,i=m.onMessage)},[s,a,r,i,c]}class Ds extends X{constructor(t){super();Y(this,t,Ns,qs,J,{onMessage:3})}}function js(n){let t;return{c(){t=o("div"),t.innerHTML=`

    Not available for Linux

    + `},m(l,i){S(l,t,i)},p:W,i:W,o:W,d(l){l&&R(t)}}}function Gs(n,t,l){let{onMessage:i}=t;const s=window.constraints={audio:!0,video:!0};function a(c){const m=document.querySelector("video"),v=c.getVideoTracks();i("Got stream with constraints:",s),i(`Using video device: ${v[0].label}`),window.stream=c,m.srcObject=c}function r(c){if(c.name==="ConstraintNotSatisfiedError"){const m=s.video;i(`The resolution ${m.width.exact}x${m.height.exact} px is not supported by your device.`)}else c.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${c.name}`,c)}return en(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(s);a(c)}catch(c){r(c)}}),Wn(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),n.$$set=c=>{"onMessage"in c&&l(0,i=c.onMessage)},[i]}class Bs extends X{constructor(t){super();Y(this,t,Gs,js,J,{onMessage:0})}}function Fs(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b;return p=new Ki({props:{json:n[2]}}),{c(){t=o("div"),l=o("input"),i=h(),s=o("input"),a=h(),r=o("label"),c=o("input"),m=C(` + Multipart`),v=h(),k=o("button"),k.textContent="Post it.",g=h(),Bn(p.$$.fragment),u(c,"type","checkbox"),u(k,"type","button")},m(d,z){S(d,t,z),e(t,l),E(l,n[0]),e(t,i),e(t,s),E(s,n[1]),e(t,a),e(t,r),e(r,c),c.checked=n[3],e(r,m),e(t,v),e(t,k),e(t,g),Fn(p,t,null),_=!0,w||(b=[y(l,"input",n[5]),y(s,"input",n[6]),y(c,"change",n[7]),y(k,"click",n[4])],w=!0)},p(d,[z]){z&1&&l.value!==d[0]&&E(l,d[0]),z&2&&s.value!==d[1]&&E(s,d[1]),z&8&&(c.checked=d[3]);const M={};z&4&&(M.json=d[2]),p.$set(M)},i(d){_||(Vn(p.$$.fragment,d),_=!0)},o(d){Xn(p.$$.fragment,d),_=!1},d(d){d&&R(t),Yn(p),w=!1,x(b)}}}function Vs(n,t,l){let i="baz",s="qux",a=null,r=!0;async function c(){const g=await ni().catch(p=>{throw onMessage(p),p});l(2,a=await g.request({url:"http://localhost:3003",method:"POST",body:Nn.form({foo:i,bar:s}),headers:r?{"Content-Type":"multipart/form-data"}:void 0,responseType:Qi.Text}))}function m(){i=this.value,l(0,i)}function v(){s=this.value,l(1,s)}function k(){r=this.checked,l(3,r)}return[i,s,a,r,c,m,v,k]}class Xs extends X{constructor(t){super();Y(this,t,Vs,Fs,J,{})}}function bi(n,t,l){const i=n.slice();return i[10]=t[l],i}function wi(n,t,l){const i=n.slice();return i[13]=t[l],i}function ki(n){let t,l=n[13].label+"",i,s,a,r,c;function m(){return n[9](n[13])}return{c(){t=o("p"),i=C(l),s=h(),u(t,"class",a="nv noselect "+(n[0]===n[13]?"nv_selected":""))},m(v,k){S(v,t,k),e(t,i),e(t,s),r||(c=y(t,"click",m),r=!0)},p(v,k){n=v,k&1&&a!==(a="nv noselect "+(n[0]===n[13]?"nv_selected":""))&&u(t,"class",a)},d(v){v&&R(t),r=!1,c()}}}function Ys(n){let t,l=n[10].html+"",i;return{c(){i=ai(),t=new es(i)},m(s,a){t.m(l,s,a),S(s,i,a)},p(s,a){a&2&&l!==(l=s[10].html+"")&&t.p(l)},d(s){s&&R(i),s&&t.d()}}}function Js(n){let t,l=n[10].text+"",i;return{c(){t=o("p"),i=C(l)},m(s,a){S(s,t,a),e(t,i)},p(s,a){a&2&&l!==(l=s[10].text+"")&&G(i,l)},d(s){s&&R(t)}}}function yi(n){let t;function l(a,r){return a[10].text?Js:Ys}let i=l(n),s=i(n);return{c(){s.c(),t=ai()},m(a,r){s.m(a,r),S(a,t,r)},p(a,r){i===(i=l(a))&&s?s.p(a,r):(s.d(1),s=i(a),s&&(s.c(),s.m(t.parentNode,t)))},d(a){s.d(a),a&&R(t)}}}function Ks(n){let t,l,i,s,a,r,c,m,v,k,g,p,_,w,b,d,z,M,q,A,P,L,I=n[2],N=[];for(let O=0;ODocumentation Github - Source`,c=h(),m=o("div"),v=o("div");for(let O=0;O{Yn(H,1)}),Qi()}K?(p=new K(fe(O)),Gn(p.$$.fragment),Vn(p.$$.fragment,1),Bn(p,g,null)):p=null}if(Q&2){V=O[1];let H;for(H=0;H{$i(Ks,()=>{Un("menu_toggle")})}),jn.listen("tauri://file-drop",function(_){m(`File drop: ${_.payload}`)});const s=[{label:"Welcome",component:ls},{label:"Messages",component:rs},{label:"CLI",component:os},{label:"Dialog",component:ds},{label:"File system",component:_s},{label:"HTTP",component:ws},{label:"HTTP Form",component:Vs},{label:"Notifications",component:Cs},{label:"Window",component:Ss},{label:"Shortcuts",component:Es},{label:"Shell",component:Ps},{label:"Updater",component:Ws},{label:"Clipboard",component:Ns},{label:"WebRTC",component:Fs}];let a=s[0],r=oi([]);si(n,r,_=>l(1,i=_));function c(_){l(0,a=_)}function m(_){r.update(w=>[{text:`[${new Date().toLocaleTimeString()}]: `+(typeof _=="string"?_:JSON.stringify(_))},...w])}function v(_){r.update(w=>[{html:_},...w])}function k(){r.update(()=>[])}function g(){ii("https://tauri.studio/")}return[a,i,s,r,c,m,v,k,g,_=>c(_)]}class Zs extends X{constructor(t){super();Y(this,t,Qs,Js,J,{})}}new Zs({target:document.body}); + Source`,c=h(),m=o("div"),v=o("div");for(let O=0;O{Yn(H,1)}),Zi()}K?(p=new K(fe(O)),Bn(p.$$.fragment),Vn(p.$$.fragment,1),Fn(p,g,null)):p=null}if(Q&2){V=O[1];let H;for(H=0;H{xi(Qs,()=>{Un("menu_toggle")})}),jn.listen("tauri://file-drop",function(_){m(`File drop: ${_.payload}`)});const s=[{label:"Welcome",component:is},{label:"Messages",component:cs},{label:"CLI",component:as},{label:"Dialog",component:hs},{label:"File system",component:gs},{label:"HTTP",component:ks},{label:"HTTP Form",component:Xs},{label:"Notifications",component:Ms},{label:"Window",component:Rs},{label:"Shortcuts",component:Hs},{label:"Shell",component:As},{label:"Updater",component:Us},{label:"Clipboard",component:Ds},{label:"WebRTC",component:Bs}];let a=s[0],r=oi([]);si(n,r,_=>l(1,i=_));function c(_){l(0,a=_)}function m(_){r.update(w=>[{text:`[${new Date().toLocaleTimeString()}]: `+(typeof _=="string"?_:JSON.stringify(_))},...w])}function v(_){r.update(w=>[{html:_},...w])}function k(){r.update(()=>[])}function g(){ii("https://tauri.studio/")}return[a,i,s,r,c,m,v,k,g,_=>c(_)]}class $s extends X{constructor(t){super();Y(this,t,Zs,Ks,J,{})}}new $s({target:document.body}); diff --git a/examples/api/dist/assets/vendor.js b/examples/api/dist/assets/vendor.js index 37a9f54cc50..437aed9b671 100644 --- a/examples/api/dist/assets/vendor.js +++ b/examples/api/dist/assets/vendor.js @@ -1,4 +1,4 @@ -function L(){}function zt(t){return t()}function St(){return Object.create(null)}function B(t){t.forEach(zt)}function ye(t){return typeof t=="function"}function Wt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function be(t){return Object.keys(t).length===0}function we(t,...e){if(t==null)return L;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Cn(t,e,n){t.$$.on_destroy.push(we(e,n))}function T(t,e){t.appendChild(e)}function S(t,e,n){t.insertBefore(e,n||null)}function z(t){t.parentNode.removeChild(t)}function Me(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function $n(t){return function(e){return e.preventDefault(),t.call(this,e)}}function P(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Dn(t){return t===""?null:+t}function Oe(t){return Array.from(t.childNodes)}function I(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Ln(t,e){t.value=e==null?"":e}function Fn(t,e){for(let n=0;n{et.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}}function Pe(t){t&&t.c()}function xt(t,e,n,i){const{fragment:r,on_mount:o,on_destroy:a,after_update:f}=t.$$;r&&r.m(e,n),i||lt(()=>{const d=o.map(zt).filter(ye);a?a.push(...d):B(d),t.$$.on_mount=[]}),f.forEach(lt)}function Kt(t,e){const n=t.$$;n.fragment!==null&&(B(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Ee(t,e){t.$$.dirty[0]===-1&&(H.push(t),Ae(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=m.length?m[0]:_;return d.ctx&&r(d.ctx[c],d.ctx[c]=g)&&(!d.skip_bound&&d.bound[c]&&d.bound[c](g),h&&Ee(t,c)),_}):[],d.update(),h=!0,B(d.before_update),d.fragment=i?i(d.ctx):!1,e.target){if(e.hydrate){const c=Oe(e.target);d.fragment&&d.fragment.l(c),c.forEach(z)}else d.fragment&&d.fragment.c();e.intro&&$(t.$$.fragment),xt(t,e.target,e.anchor,e.customElement),Ft()}Z(f)}class ze{$destroy(){Kt(this,1),this.$destroy=L}$on(e,n){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!be(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const V=[];function Nn(t,e=L){let n;const i=[];function r(f){if(Wt(t,f)&&(t=f,n)){const d=!V.length;for(let h=0;h{const c=i.indexOf(h);c!==-1&&i.splice(c,1),i.length===0&&(n(),n=null)}}return{set:r,update:o,subscribe:a}}/*! +function L(){}function zt(t){return t()}function St(){return Object.create(null)}function B(t){t.forEach(zt)}function ge(t){return typeof t=="function"}function Wt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function be(t){return Object.keys(t).length===0}function we(t,...e){if(t==null)return L;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Cn(t,e,n){t.$$.on_destroy.push(we(e,n))}function T(t,e){t.appendChild(e)}function S(t,e,n){t.insertBefore(e,n||null)}function z(t){t.parentNode.removeChild(t)}function Me(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function $n(t){return function(e){return e.preventDefault(),t.call(this,e)}}function P(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Dn(t){return t===""?null:+t}function Oe(t){return Array.from(t.childNodes)}function I(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Ln(t,e){t.value=e==null?"":e}function Fn(t,e){for(let n=0;n{et.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}}function Pe(t){t&&t.c()}function xt(t,e,n,i){const{fragment:r,on_mount:o,on_destroy:a,after_update:f}=t.$$;r&&r.m(e,n),i||ct(()=>{const d=o.map(zt).filter(ge);a?a.push(...d):B(d),t.$$.on_mount=[]}),f.forEach(ct)}function Kt(t,e){const n=t.$$;n.fragment!==null&&(B(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Ee(t,e){t.$$.dirty[0]===-1&&(H.push(t),Ae(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const y=m.length?m[0]:v;return d.ctx&&r(d.ctx[l],d.ctx[l]=y)&&(!d.skip_bound&&d.bound[l]&&d.bound[l](y),h&&Ee(t,l)),v}):[],d.update(),h=!0,B(d.before_update),d.fragment=i?i(d.ctx):!1,e.target){if(e.hydrate){const l=Oe(e.target);d.fragment&&d.fragment.l(l),l.forEach(z)}else d.fragment&&d.fragment.c();e.intro&&$(t.$$.fragment),xt(t,e.target,e.anchor,e.customElement),Ft()}Z(f)}class ze{$destroy(){Kt(this,1),this.$destroy=L}$on(e,n){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!be(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const V=[];function Nn(t,e=L){let n;const i=[];function r(f){if(Wt(t,f)&&(t=f,n)){const d=!V.length;for(let h=0;h{const l=i.indexOf(h);l!==-1&&i.splice(l,1),i.length===0&&(n(),n=null)}}return{set:r,update:o,subscribe:a}}/*! * hotkeys-js v3.8.5 * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. * @@ -6,20 +6,7 @@ function L(){}function zt(t){return t()}function St(){return Object.create(null) * http://jaywcjlove.github.io/hotkeys * * Licensed under the MIT license. - */var mt=typeof navigator!="undefined"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function _t(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on".concat(e),function(){n(window.event)})}function Rt(t,e){for(var n=e.slice(0,e.length-1),i=0;i=0;)e[n-1]+=",",e.splice(n,1),n=e.lastIndexOf("");return e}function Se(t,e){for(var n=t.length>=e.length?t:e,i=t.length>=e.length?e:t,r=!0,o=0;o=0&&y.splice(n,1),t.key&&t.key.toLowerCase()==="meta"&&y.splice(0,y.length),(e===93||e===224)&&(e=91),e in A){A[e]=!1;for(var i in U)U[i]===e&&(F[i]=!1)}}function Fe(t){if(!t)Object.keys(k).forEach(function(a){return delete k[a]});else if(Array.isArray(t))t.forEach(function(a){a.key&&vt(a)});else if(typeof t=="object")t.key&&vt(t);else if(typeof t=="string"){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i1?Rt(U,h):[];k[m]=k[m].map(function(b){var v=r?b.method===r:!0;return v&&b.scope===i&&Se(b.mods,g)?{}:b})}})};function Ht(t,e,n){var i;if(e.scope===n||e.scope==="all"){i=e.mods.length>0;for(var r in A)Object.prototype.hasOwnProperty.call(A,r)&&(!A[r]&&e.mods.indexOf(+r)>-1||A[r]&&e.mods.indexOf(+r)===-1)&&(i=!1);(e.mods.length===0&&!A[16]&&!A[18]&&!A[17]&&!A[91]||i||e.shortcut==="*")&&e.method(t,e)===!1&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function Gt(t){var e=k["*"],n=t.keyCode||t.which||t.charCode;if(!!F.filter.call(this,t)){if((n===93||n===224)&&(n=91),y.indexOf(n)===-1&&n!==229&&y.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(g){var b=Bt[g];t[g]&&y.indexOf(b)===-1?y.push(b):!t[g]&&y.indexOf(b)>-1?y.splice(y.indexOf(b),1):g==="metaKey"&&t[g]&&y.length===3&&(t.ctrlKey||t.shiftKey||t.altKey||(y=y.slice(y.indexOf(b))))}),n in A){A[n]=!0;for(var i in U)U[i]===n&&(F[i]=!0);if(!e)return}for(var r in A)Object.prototype.hasOwnProperty.call(A,r)&&(A[r]=t[Bt[r]]);t.getModifierState&&!(t.altKey&&!t.ctrlKey)&&t.getModifierState("AltGraph")&&(y.indexOf(17)===-1&&y.push(17),y.indexOf(18)===-1&&y.push(18),A[17]=!0,A[18]=!0);var o=G();if(e)for(var a=0;a-1}function F(t,e,n){y=[];var i=Ut(t),r=[],o="all",a=document,f=0,d=!1,h=!0,c="+";for(n===void 0&&typeof e=="function"&&(n=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(o=e.scope),e.element&&(a=e.element),e.keyup&&(d=e.keyup),e.keydown!==void 0&&(h=e.keydown),typeof e.splitKey=="string"&&(c=e.splitKey)),typeof e=="string"&&(o=e);f1&&(r=Rt(U,t)),t=t[t.length-1],t=t==="*"?"*":it(t),t in k||(k[t]=[]),k[t].push({keyup:d,keydown:h,scope:o,mods:r,shortcut:i[f],method:n,key:i[f],splitKey:c});typeof a!="undefined"&&!xe(a)&&window&&(Vt.push(a),_t(a,"keydown",function(_){Gt(_)}),_t(window,"focus",function(){y=[]}),_t(a,"keyup",function(_){Gt(_),Le(_)}))}var gt={setScope:qt,getScope:G,deleteScope:De,getPressedKeyCodes:We,isPressed:$e,filter:Ce,unbind:Fe};for(var yt in gt)Object.prototype.hasOwnProperty.call(gt,yt)&&(F[yt]=gt[yt]);if(typeof window!="undefined"){var Ke=window.hotkeys;F.noConflict=function(t){return t&&window.hotkeys===F&&(window.hotkeys=Ke),F},window.hotkeys=F}/*! ***************************************************************************** -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 Jt=function(t,e){return(Jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])})(t,e)};function bt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Jt(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var D=function(){return(D=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&r[r.length-1])||c[0]!==6&&c[0]!==2)){a=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]0:!1;function vt(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on".concat(e),function(){n(window.event)})}function Rt(t,e){for(var n=e.slice(0,e.length-1),i=0;i=0;)e[n-1]+=",",e.splice(n,1),n=e.lastIndexOf("");return e}function Se(t,e){for(var n=t.length>=e.length?t:e,i=t.length>=e.length?e:t,r=!0,o=0;o=0&&g.splice(n,1),t.key&&t.key.toLowerCase()==="meta"&&g.splice(0,g.length),(e===93||e===224)&&(e=91),e in A){A[e]=!1;for(var i in U)U[i]===e&&(F[i]=!1)}}function Fe(t){if(!t)Object.keys(k).forEach(function(a){return delete k[a]});else if(Array.isArray(t))t.forEach(function(a){a.key&&_t(a)});else if(typeof t=="object")t.key&&_t(t);else if(typeof t=="string"){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i1?Rt(U,h):[];k[m]=k[m].map(function(b){var _=r?b.method===r:!0;return _&&b.scope===i&&Se(b.mods,y)?{}:b})}})};function Ht(t,e,n){var i;if(e.scope===n||e.scope==="all"){i=e.mods.length>0;for(var r in A)Object.prototype.hasOwnProperty.call(A,r)&&(!A[r]&&e.mods.indexOf(+r)>-1||A[r]&&e.mods.indexOf(+r)===-1)&&(i=!1);(e.mods.length===0&&!A[16]&&!A[18]&&!A[17]&&!A[91]||i||e.shortcut==="*")&&e.method(t,e)===!1&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function Gt(t){var e=k["*"],n=t.keyCode||t.which||t.charCode;if(!!F.filter.call(this,t)){if((n===93||n===224)&&(n=91),g.indexOf(n)===-1&&n!==229&&g.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(y){var b=Bt[y];t[y]&&g.indexOf(b)===-1?g.push(b):!t[y]&&g.indexOf(b)>-1?g.splice(g.indexOf(b),1):y==="metaKey"&&t[y]&&g.length===3&&(t.ctrlKey||t.shiftKey||t.altKey||(g=g.slice(g.indexOf(b))))}),n in A){A[n]=!0;for(var i in U)U[i]===n&&(F[i]=!0);if(!e)return}for(var r in A)Object.prototype.hasOwnProperty.call(A,r)&&(A[r]=t[Bt[r]]);t.getModifierState&&!(t.altKey&&!t.ctrlKey)&&t.getModifierState("AltGraph")&&(g.indexOf(17)===-1&&g.push(17),g.indexOf(18)===-1&&g.push(18),A[17]=!0,A[18]=!0);var o=G();if(e)for(var a=0;a-1}function F(t,e,n){g=[];var i=Ut(t),r=[],o="all",a=document,f=0,d=!1,h=!0,l="+";for(n===void 0&&typeof e=="function"&&(n=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(o=e.scope),e.element&&(a=e.element),e.keyup&&(d=e.keyup),e.keydown!==void 0&&(h=e.keydown),typeof e.splitKey=="string"&&(l=e.splitKey)),typeof e=="string"&&(o=e);f1&&(r=Rt(U,t)),t=t[t.length-1],t=t==="*"?"*":it(t),t in k||(k[t]=[]),k[t].push({keyup:d,keydown:h,scope:o,mods:r,shortcut:i[f],method:n,key:i[f],splitKey:l});typeof a!="undefined"&&!xe(a)&&window&&(Vt.push(a),vt(a,"keydown",function(v){Gt(v)}),vt(window,"focus",function(){g=[]}),vt(a,"keyup",function(v){Gt(v),Le(v)}))}var yt={setScope:qt,getScope:G,deleteScope:De,getPressedKeyCodes:We,isPressed:$e,filter:Ce,unbind:Fe};for(var gt in yt)Object.prototype.hasOwnProperty.call(yt,gt)&&(F[gt]=yt[gt]);if(typeof window!="undefined"){var Ke=window.hotkeys;F.noConflict=function(t){return t&&window.hotkeys===F&&(window.hotkeys=Ke),F},window.hotkeys=F}var Jt=function(t,e){return(Jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])})(t,e)};function bt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Jt(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var D=function(){return(D=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&r[r.length-1])||l[0]!==6&&l[0]!==2)){a=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data},ce=function(){function t(e){this.id=e}return t.prototype.drop=function(){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,l({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},t.prototype.request=function(e){return u(this,void 0,void 0,function(){var n;return s(this,function(i){return(n=!e.responseType||e.responseType===X.JSON)&&(e.responseType=X.Text),[2,l({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(function(r){var o=new ae(r);if(n){try{o.data=JSON.parse(o.data)}catch(a){if(o.ok&&o.data==="")o.data={};else if(o.ok)throw Error("Failed to parse response `".concat(o.data,"` as JSON: ").concat(a,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return o}return o})]})})},t.prototype.get=function(e,n){return u(this,void 0,void 0,function(){return s(this,function(i){return[2,this.request(D({method:"GET",url:e},n))]})})},t.prototype.post=function(e,n,i){return u(this,void 0,void 0,function(){return s(this,function(r){return[2,this.request(D({method:"POST",url:e,body:n},i))]})})},t.prototype.put=function(e,n,i){return u(this,void 0,void 0,function(){return s(this,function(r){return[2,this.request(D({method:"PUT",url:e,body:n},i))]})})},t.prototype.patch=function(e,n){return u(this,void 0,void 0,function(){return s(this,function(i){return[2,this.request(D({method:"PATCH",url:e},n))]})})},t.prototype.delete=function(e,n){return u(this,void 0,void 0,function(){return s(this,function(i){return[2,this.request(D({method:"DELETE",url:e},n))]})})},t}();function le(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,l({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(function(n){return new ce(n)})]})})}var Pt=null;function vn(t,e){var n;return u(this,void 0,void 0,function(){return s(this,function(i){switch(i.label){case 0:return Pt!==null?[3,2]:[4,le()];case 1:Pt=i.sent(),i.label=2;case 2:return[2,Pt.request(D({url:t,method:(n=e==null?void 0:e.method)!==null&&n!==void 0?n:"GET"},e))]}})})}Object.freeze({__proto__:null,getClient:le,fetch:vn,Body:_n,Client:ce,Response:ae,get ResponseType(){return X}});function gn(t,e){return u(this,void 0,void 0,function(){return s(this,function(n){return[2,l({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:N(e)}})]})})}function yn(t,e){return u(this,void 0,void 0,function(){return s(this,function(n){return[2,l({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:N(e)}})]})})}function bn(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,l({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]})})}function wn(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,l({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]})})}function Mn(){return u(this,void 0,void 0,function(){return s(this,function(t){return[2,l({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:gn,registerAll:yn,isRegistered:bn,unregister:wn,unregisterAll:Mn});function On(){return u(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return s(this,function(n){return[2,new Promise(function(i,r){At("tauri://update-status",function(o){var a;(a=o==null?void 0:o.payload).error?(t(),r(a.error)):a.status==="DONE"&&(t(),i())}).then(function(o){e=o}).catch(function(o){throw t(),o}),Tt("tauri://update-install").catch(function(o){throw t(),o})})]})})}function kn(){return u(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return s(this,function(n){return[2,new Promise(function(i,r){se("tauri://update-available",function(o){var a;a=o==null?void 0:o.payload,t(),i({manifest:a,shouldUpdate:!0})}).catch(function(o){throw t(),o}),At("tauri://update-status",function(o){var a;(a=o==null?void 0:o.payload).error?(t(),r(a.error)):a.status==="UPTODATE"&&(t(),i({shouldUpdate:!1}))}).then(function(o){e=o}).catch(function(o){throw t(),o}),Tt("tauri://update").catch(function(o){throw t(),o})})]})})}Object.freeze({__proto__:null,installUpdate:On,checkUpdate:kn});function An(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,l({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}})]})})}function Tn(){return u(this,void 0,void 0,function(){return s(this,function(t){return[2,l({__tauriModule:"Clipboard",message:{cmd:"readText"}})]})})}Object.freeze({__proto__:null,writeText:An,readText:Tn});function fe(t,e,n){const i=t.slice();return i[12]=e[n],i[14]=n,i}function de(t){let e,n,i,r,o,a,f,d,h,c,_,m,g,b,v,st,Et,x=t[5],M=[];for(let p=0;pR(M[p],1,1,()=>{M[p]=null});let E=!t[3]&&_e(),j=!t[3]&&t[8]&&ve();return{c(){e=W("span"),n=W("span"),i=C(t[6]),r=q(),o=W("ul");for(let p=0;p{c[b]=null}),pt(),o=c[r],o?o.p(m,g):(o=c[r]=h[r](m),o.c()),$(o,1),o.m(e,a))},i(m){f||($(o),f=!0)},o(m){R(o),f=!1},d(m){m&&z(e),d&&d.d(),c[r].d()}}}function _e(t){let e;return{c(){e=W("span"),e.textContent=",",P(e,"class","comma svelte-gbh3pt")},m(n,i){S(n,e,i)},d(n){n&&z(e)}}}function ve(t){let e;return{c(){e=W("span"),e.textContent=",",P(e,"class","comma svelte-gbh3pt")},m(n,i){S(n,e,i)},d(n){n&&z(e)}}}function jn(t){let e,n,i=t[5].length&&de(t);return{c(){i&&i.c(),e=Ct()},m(r,o){i&&i.m(r,o),S(r,e,o),n=!0},p(r,[o]){r[5].length?i?(i.p(r,o),o&32&&$(i,1)):(i=de(r),i.c(),$(i,1),i.m(e.parentNode,e)):i&&(ht(),R(i,1,1,()=>{i=null}),pt())},i(r){n||($(i),n=!0)},o(r){R(i),n=!1},d(r){i&&i.d(r),r&&z(e)}}}const zn="...";function Sn(t,e,n){let{json:i}=e,{depth:r=1/0}=e,{_lvl:o=0}=e,{_last:a=!0}=e;const f=v=>v===null?"null":typeof v;let d,h,c,_,m;const g=v=>{switch(f(v)){case"string":return`"${v}"`;case"function":return"f () {...}";case"symbol":return v.toString();default:return v}},b=()=>{n(8,m=!m)};return t.$$set=v=>{"json"in v&&n(0,i=v.json),"depth"in v&&n(1,r=v.depth),"_lvl"in v&&n(2,o=v._lvl),"_last"in v&&n(3,a=v._last)},t.$$.update=()=>{t.$$.dirty&17&&(n(5,d=f(i)==="object"?Object.keys(i):[]),n(4,h=Array.isArray(i)),n(6,c=h?"[":"{"),n(7,_=h?"]":"}")),t.$$.dirty&6&&n(8,m=r=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data},le=function(){function t(e){this.id=e}return t.prototype.drop=function(){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,c({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},t.prototype.request=function(e){return u(this,void 0,void 0,function(){var n;return s(this,function(i){return(n=!e.responseType||e.responseType===X.JSON)&&(e.responseType=X.Text),[2,c({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(function(r){var o=new ae(r);if(n){try{o.data=JSON.parse(o.data)}catch(a){if(o.ok&&o.data==="")o.data={};else if(o.ok)throw Error("Failed to parse response `".concat(o.data,"` as JSON: ").concat(a,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return o}return o})]})})},t.prototype.get=function(e,n){return u(this,void 0,void 0,function(){return s(this,function(i){return[2,this.request(D({method:"GET",url:e},n))]})})},t.prototype.post=function(e,n,i){return u(this,void 0,void 0,function(){return s(this,function(r){return[2,this.request(D({method:"POST",url:e,body:n},i))]})})},t.prototype.put=function(e,n,i){return u(this,void 0,void 0,function(){return s(this,function(r){return[2,this.request(D({method:"PUT",url:e,body:n},i))]})})},t.prototype.patch=function(e,n){return u(this,void 0,void 0,function(){return s(this,function(i){return[2,this.request(D({method:"PATCH",url:e},n))]})})},t.prototype.delete=function(e,n){return u(this,void 0,void 0,function(){return s(this,function(i){return[2,this.request(D({method:"DELETE",url:e},n))]})})},t}();function ce(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,c({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(function(n){return new le(n)})]})})}var Pt=null;function _n(t,e){var n;return u(this,void 0,void 0,function(){return s(this,function(i){switch(i.label){case 0:return Pt!==null?[3,2]:[4,ce()];case 1:Pt=i.sent(),i.label=2;case 2:return[2,Pt.request(D({url:t,method:(n=e==null?void 0:e.method)!==null&&n!==void 0?n:"GET"},e))]}})})}Object.freeze({__proto__:null,getClient:ce,fetch:_n,Body:vn,Client:le,Response:ae,get ResponseType(){return X}});function yn(t,e){return u(this,void 0,void 0,function(){return s(this,function(n){return[2,c({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:N(e)}})]})})}function gn(t,e){return u(this,void 0,void 0,function(){return s(this,function(n){return[2,c({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:N(e)}})]})})}function bn(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,c({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]})})}function wn(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,c({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]})})}function Mn(){return u(this,void 0,void 0,function(){return s(this,function(t){return[2,c({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:yn,registerAll:gn,isRegistered:bn,unregister:wn,unregisterAll:Mn});function On(){return u(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return s(this,function(n){return[2,new Promise(function(i,r){At("tauri://update-status",function(o){var a;(a=o==null?void 0:o.payload).error?(t(),r(a.error)):a.status==="DONE"&&(t(),i())}).then(function(o){e=o}).catch(function(o){throw t(),o}),Tt("tauri://update-install").catch(function(o){throw t(),o})})]})})}function kn(){return u(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return s(this,function(n){return[2,new Promise(function(i,r){se("tauri://update-available",function(o){var a;a=o==null?void 0:o.payload,t(),i({manifest:a,shouldUpdate:!0})}).catch(function(o){throw t(),o}),At("tauri://update-status",function(o){var a;(a=o==null?void 0:o.payload).error?(t(),r(a.error)):a.status==="UPTODATE"&&(t(),i({shouldUpdate:!1}))}).then(function(o){e=o}).catch(function(o){throw t(),o}),Tt("tauri://update").catch(function(o){throw t(),o})})]})})}Object.freeze({__proto__:null,installUpdate:On,checkUpdate:kn});function An(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,c({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}})]})})}function Tn(){return u(this,void 0,void 0,function(){return s(this,function(t){return[2,c({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})]})})}Object.freeze({__proto__:null,writeText:An,readText:Tn});function fe(t,e,n){const i=t.slice();return i[12]=e[n],i[14]=n,i}function de(t){let e,n,i,r,o,a,f,d,h,l,v,m,y,b,_,st,Et,x=t[5],M=[];for(let p=0;pR(M[p],1,1,()=>{M[p]=null});let E=!t[3]&&ve(),j=!t[3]&&t[8]&&_e();return{c(){e=W("span"),n=W("span"),i=C(t[6]),r=q(),o=W("ul");for(let p=0;p{l[b]=null}),pt(),o=l[r],o?o.p(m,y):(o=l[r]=h[r](m),o.c()),$(o,1),o.m(e,a))},i(m){f||($(o),f=!0)},o(m){R(o),f=!1},d(m){m&&z(e),d&&d.d(),l[r].d()}}}function ve(t){let e;return{c(){e=W("span"),e.textContent=",",P(e,"class","comma svelte-gbh3pt")},m(n,i){S(n,e,i)},d(n){n&&z(e)}}}function _e(t){let e;return{c(){e=W("span"),e.textContent=",",P(e,"class","comma svelte-gbh3pt")},m(n,i){S(n,e,i)},d(n){n&&z(e)}}}function jn(t){let e,n,i=t[5].length&&de(t);return{c(){i&&i.c(),e=Ct()},m(r,o){i&&i.m(r,o),S(r,e,o),n=!0},p(r,[o]){r[5].length?i?(i.p(r,o),o&32&&$(i,1)):(i=de(r),i.c(),$(i,1),i.m(e.parentNode,e)):i&&(ht(),R(i,1,1,()=>{i=null}),pt())},i(r){n||($(i),n=!0)},o(r){R(i),n=!1},d(r){i&&i.d(r),r&&z(e)}}}const zn="...";function Sn(t,e,n){let{json:i}=e,{depth:r=1/0}=e,{_lvl:o=0}=e,{_last:a=!0}=e;const f=_=>_===null?"null":typeof _;let d,h,l,v,m;const y=_=>{switch(f(_)){case"string":return`"${_}"`;case"function":return"f () {...}";case"symbol":return _.toString();default:return _}},b=()=>{n(8,m=!m)};return t.$$set=_=>{"json"in _&&n(0,i=_.json),"depth"in _&&n(1,r=_.depth),"_lvl"in _&&n(2,o=_._lvl),"_last"in _&&n(3,a=_._last)},t.$$.update=()=>{t.$$.dirty&17&&(n(5,d=f(i)==="object"?Object.keys(i):[]),n(4,h=Array.isArray(i)),n(6,l=h?"[":"{"),n(7,v=h?"]":"}")),t.$$.dirty&6&&n(8,m=r - import { readBinaryFile, readDir, Dir } from "@tauri-apps/api/fs"; - import { convertFileSrc } from "@tauri-apps/api/tauri"; + import { + readBinaryFile, + writeTextFile, + readDir, + Dir + } from '@tauri-apps/api/fs' + import { convertFileSrc } from '@tauri-apps/api/tauri' - export let onMessage; - export let insecureRenderHtml; + export let onMessage + export let insecureRenderHtml - let pathToRead = ""; - let img; + let pathToRead = '' + let img function getDir() { - const dirSelect = document.getElementById("dir"); - return dirSelect.value ? parseInt(dir.value) : null; + const dirSelect = document.getElementById('dir') + return dirSelect.value ? parseInt(dir.value) : null } function arrayBufferToBase64(buffer, callback) { const blob = new Blob([buffer], { - type: "application/octet-binary", - }); - const reader = new FileReader(); + type: 'application/octet-binary' + }) + const reader = new FileReader() reader.onload = function (evt) { - const dataurl = evt.target.result; - callback(dataurl.substr(dataurl.indexOf(",") + 1)); - }; - reader.readAsDataURL(blob); + const dataurl = evt.target.result + callback(dataurl.substr(dataurl.indexOf(',') + 1)) + } + reader.readAsDataURL(blob) } const DirOptions = Object.keys(Dir) .filter((key) => isNaN(parseInt(key))) - .map((dir) => [dir, Dir[dir]]); + .map((dir) => [dir, Dir[dir]]) function read() { - const isFile = pathToRead.match(/\S+\.\S+$/g); + const isFile = pathToRead.match(/\S+\.\S+$/g) const opts = { - dir: getDir(), - }; + dir: getDir() + } const promise = isFile ? readBinaryFile(pathToRead, opts) - : readDir(pathToRead, opts); + : readDir(pathToRead, opts) promise .then(function (response) { if (isFile) { - if (pathToRead.includes(".png") || pathToRead.includes(".jpg")) { + if (pathToRead.includes('.png') || pathToRead.includes('.jpg')) { arrayBufferToBase64(new Uint8Array(response), function (base64) { - const src = "data:image/png;base64," + base64; - insecureRenderHtml(''); - }); + const src = 'data:image/png;base64,' + base64 + insecureRenderHtml('') + }) } else { - const value = String.fromCharCode.apply(null, response); + const value = String.fromCharCode.apply(null, response) insecureRenderHtml( '' - ); + ) setTimeout(() => { - const fileInput = document.getElementById("file-response"); - fileInput.value = value; + const fileInput = document.getElementById('file-response') + fileInput.value = value document - .getElementById("file-save") - .addEventListener("click", function () { - writeFile( - { - file: pathToRead, - contents: fileInput.value, - }, - { - dir: getDir(), - } - ).catch(onMessage); - }); - }); + .getElementById('file-save') + .addEventListener('click', function () { + writeTextFile(pathToRead, fileInput.value, { + dir: getDir() + }).catch(onMessage) + }) + }) } } else { - onMessage(response); + onMessage(response) } }) - .catch(onMessage); + .catch(onMessage) } function setSrc() { @@ -95,5 +94,5 @@ - file + file diff --git a/examples/api/yarn.lock b/examples/api/yarn.lock index 1d8b49b7e6e..aa3f31c59a3 100644 --- a/examples/api/yarn.lock +++ b/examples/api/yarn.lock @@ -23,9 +23,9 @@ svelte-hmr "^0.14.7" "@tauri-apps/api@../../tooling/api/dist": - version "1.0.0-rc.3" + version "1.0.0-rc.6" dependencies: - type-fest "2.12.2" + type-fest "2.13.0" "@zerodevx/svelte-json-view@0.2.0": version "0.2.0" @@ -267,10 +267,10 @@ svelte@3.35.0: resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.35.0.tgz#e0d0ba60c4852181c2b4fd851194be6fda493e65" integrity sha512-gknlZkR2sXheu/X+B7dDImwANVvK1R0QGQLd8CNIfxxGPeXBmePnxfzb6fWwTQRsYQG7lYkZXvpXJvxvpsoB7g== -type-fest@2.12.2: - version "2.12.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.12.2.tgz#80a53614e6b9b475eb9077472fb7498dc7aa51d0" - integrity sha512-qt6ylCGpLjZ7AaODxbpyBZSs9fCI9SkL3Z9q2oxMBQhs/uyY+VD8jHA8ULCGmWQJlBgqvO3EJeAngOHD8zQCrQ== +type-fest@2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.13.0.tgz#d1ecee38af29eb2e863b22299a3d68ef30d2abfb" + integrity sha512-lPfAm42MxE4/456+QyIaaVBAwgpJb6xZ8PRu09utnhPdWwcyj9vgy6Sq0Z5yNbJ21EdxB5dRU/Qg8bsyAMtlcw== vite@^2.6.4: version "2.6.14" diff --git a/tooling/api/src/dialog.ts b/tooling/api/src/dialog.ts index 77f3cc68527..2b7143a1472 100644 --- a/tooling/api/src/dialog.ts +++ b/tooling/api/src/dialog.ts @@ -207,6 +207,11 @@ async function confirm( }) } -export type { DialogFilter, OpenDialogOptions, SaveDialogOptions } +export type { + DialogFilter, + OpenDialogOptions, + SaveDialogOptions, + MessageDialogOptions +} export { open, save, message, ask, confirm } diff --git a/tooling/api/src/fs.ts b/tooling/api/src/fs.ts index c6dfdfb65f4..13f6dcb873c 100644 --- a/tooling/api/src/fs.ts +++ b/tooling/api/src/fs.ts @@ -96,6 +96,7 @@ export enum BaseDirectory { interface FsOptions { dir?: BaseDirectory + // note that adding fields here needs a change in the writeBinaryFile check } interface FsDirOptions { @@ -111,12 +112,14 @@ interface FsTextFileOption { contents: string } +type BinaryFileContents = Iterable | ArrayLike + /** Options object used to write a binary data to a file. */ interface FsBinaryFileOption { /** Path to the file to write. */ path: string /** The byte array contents. */ - contents: Iterable | ArrayLike + contents: BinaryFileContents } interface FileEntry { @@ -177,19 +180,61 @@ async function readBinaryFile( /** * Writes a UTF-8 text file. * - * @param file File configuration object. + * @param path The file path. + * @param contents The file contents. + * @param options Configuration object. + * @returns A promise indicating the success or failure of the operation. + */ +async function writeTextFile( + path: string, + contents: string, + options?: FsOptions +): Promise + +/** + * Writes a UTF-8 text file. + * + * @param file The object containing the file path and contents. * @param options Configuration object. * @returns A promise indicating the success or failure of the operation. */ -async function writeFile( +async function writeTextFile( file: FsTextFileOption, - options: FsOptions = {} + options?: FsOptions +): Promise + +/** + * Writes a UTF-8 text file. + * + * @param file File configuration object. + * @param options Configuration object. + * @returns A promise indicating the success or failure of the operation. + */ +async function writeTextFile( + path: string | FsTextFileOption, + contents?: string | FsOptions, + options?: FsOptions ): Promise { if (typeof options === 'object') { Object.freeze(options) } - if (typeof file === 'object') { - Object.freeze(file) + if (typeof path === 'object') { + Object.freeze(path) + } + + const file: FsTextFileOption = { path: '', contents: '' } + let fileOptions: FsOptions | undefined = options + if (typeof path === 'string') { + file.path = path + } else { + file.path = path.path + file.contents = path.contents + } + + if (typeof contents === 'string') { + file.contents = contents ?? '' + } else { + fileOptions = contents } return invokeTauriCommand({ @@ -198,7 +243,7 @@ async function writeFile( cmd: 'writeFile', path: file.path, contents: Array.from(new TextEncoder().encode(file.contents)), - options + options: fileOptions } }) } @@ -206,19 +251,62 @@ async function writeFile( /** * Writes a byte array content to a file. * - * @param file Write configuration object. + * @param path The file path. + * @param contents The file contents. + * @param options Configuration object. + * @returns A promise indicating the success or failure of the operation. + */ +async function writeBinaryFile( + path: string, + contents: BinaryFileContents, + options?: FsOptions +): Promise + +/** + * Writes a byte array content to a file. + * + * @param file The object containing the file path and contents. * @param options Configuration object. * @returns A promise indicating the success or failure of the operation. */ async function writeBinaryFile( file: FsBinaryFileOption, - options: FsOptions = {} + options?: FsOptions +): Promise + +/** + * Writes a byte array content to a file. + * + * @param file Write configuration object. + * @param options Configuration object. + * @returns A promise indicating the success or failure of the operation. + */ +async function writeBinaryFile( + path: string | FsBinaryFileOption, + contents?: BinaryFileContents | FsOptions, + options?: FsOptions ): Promise { if (typeof options === 'object') { Object.freeze(options) } - if (typeof file === 'object') { - Object.freeze(file) + if (typeof path === 'object') { + Object.freeze(path) + } + + const file: FsBinaryFileOption = { path: '', contents: [] } + let fileOptions: FsOptions | undefined = options + if (typeof path === 'string') { + file.path = path + } else { + file.path = path.path + file.contents = path.contents + } + + if (contents && 'dir' in contents) { + fileOptions = contents + } else { + // @ts-expect-error + file.contents = contents ?? [] } return invokeTauriCommand({ @@ -227,7 +315,7 @@ async function writeBinaryFile( cmd: 'writeFile', path: file.path, contents: Array.from(file.contents), - options + options: fileOptions } }) } @@ -371,6 +459,7 @@ export type { FsOptions, FsDirOptions, FsTextFileOption, + BinaryFileContents, FsBinaryFileOption, FileEntry } @@ -379,7 +468,8 @@ export { BaseDirectory as Dir, readTextFile, readBinaryFile, - writeFile, + writeTextFile, + writeTextFile as writeFile, writeBinaryFile, readDir, createDir, diff --git a/tooling/api/src/http.ts b/tooling/api/src/http.ts index 707c0be2640..61230194627 100644 --- a/tooling/api/src/http.ts +++ b/tooling/api/src/http.ts @@ -431,4 +431,4 @@ export type { FetchOptions } -export { getClient, fetch, Body, Client, Response, ResponseType } +export { getClient, fetch, Body, Client, Response, ResponseType, FilePart } diff --git a/tooling/cli/node/test/jest/fixtures/app/dist/index.html b/tooling/cli/node/test/jest/fixtures/app/dist/index.html index 6bf0b614934..1975cbbc9eb 100644 --- a/tooling/cli/node/test/jest/fixtures/app/dist/index.html +++ b/tooling/cli/node/test/jest/fixtures/app/dist/index.html @@ -31,13 +31,7 @@ } return window.__TAURI__.fs - .writeFile( - { - path: 'tauri-test.txt', - contents: contents - }, - options - ) + .writeTextFile('tauri-test.txt', contents, options) .then(function (res) { reply({ cmd: 'writeFile' + commandSuffix