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

26 lines
62 KiB
JavaScript
Raw Normal View History

var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function o(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function u(e,n,i){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const i=e.subscribe(...n);return i.unsubscribe?()=>i.unsubscribe():i}(n,i))}function s(t,e){t.appendChild(e)}function c(t,e,n){t.insertBefore(e,n||null)}function a(t){t.parentNode.removeChild(t)}function l(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function d(t){return document.createElement(t)}function f(t){return document.createTextNode(t)}function h(){return f(" ")}function p(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function v(t){return function(e){return e.preventDefault(),t.call(this,e)}}function m(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function g(t){return""===t?null:+t}function y(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function b(t,e){t.value=null==e?"":e}function _(t,e,n,i){t.style.setProperty(e,n,i?"important":"")}function w(t,e){for(let n=0;n<t.options.length;n+=1){const i=t.options[n];if(i.__value===e)return void(i.selected=!0)}}class x{constructor(t=null){this.a=t,this.e=this.n=null}m(t,e,n=null){this.e||(this.e=d(e.nodeName),this.t=e,this.h(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)c(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(a)}}let M;function k(t){M=t}function C(){if(!M)throw new Error("Function called outside component initialization");return M}function $(t){C().$$.on_mount.push(t)}function O(t){C().$$.on_destroy.push(t)}const T=[],E=[],P=[],S=[],z=Promise.resolve();let A=!1;function j(t){P.push(t)}let W=!1;const L=new Set;function D(){if(!W){W=!0;do{for(let t=0;t<T.length;t+=1){const e=T[t];k(e),F(e.$$)}for(k(null),T.length=0;E.length;)E.pop()();for(let t=0;t<P.length;t+=1){const e=P[t];L.has(e)||(L.add(e),e())}P.length=0}while(T.length);for(;S.length;)S.pop()();A=!1,W=!1,L.clear()}}function F(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(j)}}const R=new Set;let I;function U(t,e){t&&t.i&&(R.delete(t),t.i(e))}function K(t,e,n,i){if(t&&t.o){if(R.has(t))return;R.add(t),I.c.push((()=>{R.delete(t),i&&(n&&t.d(1),i())})),t.o(e)}}function q(t){t&&t.c()}function N(t,n,r,u){const{fragment:s,on_mount:c,on_destroy:a,after_update:l}=t.$$;s&&s.m(n,r),u||j((()=>{const n=c.map(e).filter(o);a?a.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(j)}function B(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function H(t,e){-1===t.$$.dirty[0]&&(T.push(t),A||(A=!0,z.then(D)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function G(e,o,r,u,s,c,l=[-1]){const d=M;k(e);const f=e.$$={fragment:null,ctx:null,props:c,update:t,not_equal:s,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:[]),callbacks:n(),dirty:l,skip_bound:!1};let h=!1;if(f.ctx=r?r(e,o.props||{},((t,n,...i)=>{const o=i.length?i[0]:n;return f.ctx&&s(f.ctx[t],f.ctx[t]=o)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](o),h&&H(e,t)),n})):[],f.update(),h=!0,i(f.before_update),f.fragment=!!u&&u(f.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);f.fragment&&f.fragment.l(t),t.forEach(a)}else f.fragment&&f.fragment.c();o.intro&&U(e.$$.fragment),N(e,o.target,o.anchor,o.customElement),D()}k(d)}class V{$destroy(){B(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const J=[];function X(e,n=t){let i;const o=[];function u(t){if(r(e,t)&&(e=t,i)){const t=!J.length;for(let t=0;t<o.le
/*!
* hotkeys-js v3.8.5
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2021 kenny wong <wowohoo@qq.com>
* http://jaywcjlove.github.io/hotkeys
*
* Licensed under the MIT license.
*/var Y="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function Q(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on".concat(e),(function(){n(window.event)}))}function Z(t,e){for(var n=e.slice(0,e.length-1),i=0;i<n.length;i++)n[i]=t[n[i].toLowerCase()];return n}function tt(t){"string"!=typeof t&&(t="");for(var e=(t=t.replace(/\s/g,"")).split(","),n=e.lastIndexOf("");n>=0;)e[n-1]+=",",e.splice(n,1),n=e.lastIndexOf("");return e}for(var et={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Y?173:189,"=":Y?61:187,";":Y?59:186,"'":222,"[":219,"]":221,"\\":220},nt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},it={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},ot={16:!1,18:!1,17:!1,91:!1},rt={},ut=1;ut<20;ut++)et["f".concat(ut)]=111+ut;var st=[],ct="all",at=[],lt=function(t){return et[t.toLowerCase()]||nt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function dt(t){ct=t||"all"}function ft(){return ct||"all"}var ht=function(t){var e=t.key,n=t.scope,i=t.method,o=t.splitKey,r=void 0===o?"+":o;tt(e).forEach((function(t){var e=t.split(r),o=e.length,u=e[o-1],s="*"===u?"*":lt(u);if(rt[s]){n||(n=ft());var c=o>1?Z(nt,e):[];rt[s]=rt[s].map((function(t){return(!i||t.method===i)&&t.scope===n&&function(t,e){for(var n=t.length>=e.length?t:e,i=t.length>=e.length?e:t,o=!0,r=0;r<n.length;r++)-1===i.indexOf(n[r])&&(o=!1);return o}(t.mods,c)?{}:t}))}}))};function pt(t,e,n){var i;if(e.scope===n||"all"===e.scope){for(var o in i=e.mods.length>0,ot)Object.prototype.hasOwnProperty.call(ot,o)&&(!ot[o]&&e.mods.indexOf(+o)>-1||ot[o]&&-1===e.mods.indexOf(+o))&&(i=!1);(0!==e.mods.length||ot[16]||ot[18]||ot[17]||ot[91])&&!i&&"*"!==e.shortcut||!1===e.method(t,e)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function vt(t){var e=rt["*"],n=t.keyCode||t.which||t.charCode;if(mt.filter.call(this,t)){if(93!==n&&224!==n||(n=91),-1===st.indexOf(n)&&229!==n&&st.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(e){var n=it[e];t[e]&&-1===st.indexOf(n)?st.push(n):!t[e]&&st.indexOf(n)>-1?st.splice(st.indexOf(n),1):"metaKey"===e&&t[e]&&3===st.length&&(t.ctrlKey||t.shiftKey||t.altKey||(st=st.slice(st.indexOf(n))))})),n in ot){for(var i in ot[n]=!0,nt)nt[i]===n&&(mt[i]=!0);if(!e)return}for(var o in ot)Object.prototype.hasOwnProperty.call(ot,o)&&(ot[o]=t[it[o]]);t.getModifierState&&(!t.altKey||t.ctrlKey)&&t.getModifierState("AltGraph")&&(-1===st.indexOf(17)&&st.push(17),-1===st.indexOf(18)&&st.push(18),ot[17]=!0,ot[18]=!0);var r=ft();if(e)for(var u=0;u<e.length;u++)e[u].scope===r&&("keydown"===t.type&&e[u].keydown||"keyup"===t.type&&e[u].keyup)&&pt(t,e[u],r);if(n in rt)for(var s=0;s<rt[n].length;s++)if(("keydown"===t.type&&rt[n][s].keydown||"keyup"===t.type&&rt[n][s].keyup)&&rt[n][s].key){for(var c=rt[n][s],a=c.splitKey,l=c.key.split(a),d=[],f=0;f<l.length;f++)d.push(lt(l[f]));d.sort().join("")===st.sort().join("")&&pt(t,c,r)}}}function mt(t,e,n){st=[];var i=tt(t),o=[],r="all",u=document,s=0,c=!1,a=!0,l="+";for(void 0===n&&"function"==typeof e&&(n=e),"[object Object]"===Object.prototype.toString.call(e)&&(e.scope&&(r=e.scope),e.element&&(u=e.element),e.keyup&&(c=e.keyup),void 0!==e.keydown&&(a=e.keydown),"string"==typeof e.splitKey&&(l=e.splitKey)),"string"==typeof e&&(r=e);s<i.length;s++)o=[],(t=i[s].split(l)).length>1&&(o=Z(nt,t)),(t="*"===(t=t[t.length-1])?"*":lt(t))in rt||(rt[t]=[]),rt[t].push({keyup:c,keydown:a,scope:r,mods:o,shortcut:i[s],method:n,key:i[s],splitKey:l});void 0!==u&&!function(t){return at.indexOf(t)>-1}(u)&
/*! *****************************************************************************
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 _t=function(t,e){return(_t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function wt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}_t(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var xt=function(){return(xt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Mt(t,e,n,i){return new(n||(n=Promise))((function(o,r){function u(t){try{c(i.next(t))}catch(t){r(t)}}function s(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,s)}c((i=i.apply(t,e||[])).next())}))}function kt(t,e){var n,i,o,r,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,i=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){u=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){u.label=r[1];break}if(6===r[0]&&u.label<o[1]){u.label=o[1],o=r;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(r);break}o[2]&&u.ops.pop(),u.trys.pop();continue}r=e.call(t,u)}catch(t){r=[6,t],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function Ct(t,e){void 0===e&&(e=!1);var n=function(){var t=new Int8Array(1);window.crypto.getRandomValues(t);var e=new Uint8Array(Math.max(16,Math.abs(t[0])));return window.crypto.getRandomValues(e),e.join("")}();return Object.defineProperty(window,n,{value:function(i){return e&&Reflect.deleteProperty(window,n),null==t?void 0:t(i)},writable:!1,configurable:!0}),n}function $t(t,e){return void 0===e&&(e={}),Mt(this,void 0,void 0,(function(){return kt(this,(function(n){return[2,new Promise((function(n,i){var o=Ct((function(t){n(t),Reflect.deleteProperty(window,r)}),!0),r=Ct((function(t){i(t),Reflect.deleteProperty(window,o)}),!0);window.rpc.notify(t,xt({__invokeKey:__TAURI_INVOKE_KEY__,callback:o,error:r},e))}))]}))}))}function Ot(t){return Mt(this,void 0,void 0,(function(){return kt(this,(function(e){return[2,$t("tauri",t)]}))}))}function Tt(t,e,n,i){return Mt(this,void 0,void 0,(function(){return kt(this,(function(o){return"object"==typeof n&&Object.freeze(n),[2,Ot({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:"string"==typeof n?[n]:n,options:i,onEventFn:Ct(t)}})]}))}))}Object.freeze({__proto__:null,transformCallback:Ct,invoke:$t});var Et,Pt,St=function(){function t(){this.eventListeners=Object.create(null)}return t.prototype.addEventListener=function(t,e){t in this.eventListeners?this.eventListeners[t].push(e):this.eventListeners[t]=[e]},t.prototype._emit=function(t,e){if(t in this.eventListeners)for(var n=0,i=this.eventListeners[t];n<i.length;n++)(0,i[n])(e)},t.prototype.on=function(t,e){return this.addEventListener(t,e),this},t}(),zt=function(){function t(t){this.pid=t}return t.prototype.write=function(t){return Mt(this,void 0,void 0,(function(){return kt(this,(function(e){return[2,Ot({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:t}})]}))}))},t.prototype.kill=function(){return Mt(this,void 0,void 0,(function(){return kt(this,(function(t){return[2,Ot({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})]
//# sourceMappingURL=bundle.js.map