mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-22 10:11:32 +03:00
eedfa5e618
Co-authored-by: Thomas Kilsby <> Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
46 lines
98 KiB
JavaScript
46 lines
98 KiB
JavaScript
const ir=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerpolicy&&(l.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?l.credentials="include":o.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}};ir();function J(){}function wl(t){return t()}function Vo(){return Object.create(null)}function pe(t){t.forEach(wl)}function or(t){return typeof t=="function"}function Me(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Gn;function lr(t,e){return Gn||(Gn=document.createElement("a")),Gn.href=e,t===Gn.href}function rr(t){return Object.keys(t).length===0}function sr(t,...e){if(t==null)return J;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function kl(t,e,n){t.$$.on_destroy.push(sr(e,n))}function r(t,e){t.appendChild(e)}function m(t,e,n){t.insertBefore(e,n||null)}function h(t){t.parentNode.removeChild(t)}function pt(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function s(t){return document.createElement(t)}function ur(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function W(t){return document.createTextNode(t)}function v(){return W(" ")}function oi(){return W("")}function D(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function xn(t){return function(e){return e.preventDefault(),t.call(this,e)}}function u(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function re(t){return t===""?null:+t}function ar(t){return Array.from(t.childNodes)}function x(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function G(t,e){t.value=e==null?"":e}function Dt(t,e){for(let n=0;n<t.options.length;n+=1){const i=t.options[n];if(i.__value===e){i.selected=!0;return}}t.selectedIndex=-1}function Pi(t){const e=t.querySelector(":checked")||t.options[0];return e&&e.__value}function Jn(t,e,n){t.classList[n?"add":"remove"](e)}class cr{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=ur(n.nodeName):this.e=s(n.nodeName),this.t=n,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let n=0;n<this.n.length;n+=1)m(this.t,this.n[n],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(h)}}let Xt;function Jt(t){Xt=t}function Ml(){if(!Xt)throw new Error("Function called outside component initialization");return Xt}function ct(t){Ml().$$.on_mount.push(t)}function ji(t){Ml().$$.on_destroy.push(t)}const Vt=[],$n=[],Yn=[],Go=[],fr=Promise.resolve();let Ri=!1;function dr(){Ri||(Ri=!0,fr.then(Tl))}function Wt(t){Yn.push(t)}const Wi=new Set;let Xn=0;function Tl(){const t=Xt;do{for(;Xn<Vt.length;){const e=Vt[Xn];Xn++,Jt(e),pr(e.$$)}for(Jt(null),Vt.length=0,Xn=0;$n.length;)$n.pop()();for(let e=0;e<Yn.length;e+=1){const n=Yn[e];Wi.has(n)||(Wi.add(n),n())}Yn.length=0}while(Vt.length);for(;Go.length;)Go.pop()();Ri=!1,Wi.clear(),Jt(t)}function pr(t){if(t.fragment!==null){t.update(),pe(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Wt)}}const Kn=new Set;let ft;function li(){ft={r:0,c:[],p:ft}}function ri(){ft.r||pe(ft.c),ft=ft.p}function ze(t,e){t&&t.i&&(Kn.delete(t),t.i(e))}function je(t,e,n,i){if(t&&t.o){if(Kn.has(t))return;Kn.add(t),ft.c.push(()=>{Kn.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}function ei(t){t&&t.c()}function Yt(t,e,n,i){const{fragment:o,on_mount:l,on_destroy:a,after_update:f}=t.$$;o&&o.m(e,n),i||Wt(()=>{const c=l.map(wl).filter(or);a?a.push(...c):pe(c),t.$$.on_mount=[]}),f.forEach(Wt)}function Kt(t,e){const n=t.$$;n.fragment!==null&&(pe(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function hr(t,e){t.$$.dirty[0]===-1&&(Vt.push(t),dr(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Ee(t,e,n,i,o,l,a,f=[-1]){const c=Xt;Jt(t);const p=t.$$={fragment:null,ctx:null,props:l,update:J,not_equal:o,bound:Vo(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Vo(),dirty:f,skip_bound:!1,root:e.target||c.$$.root};a&&a(p.root);let d=!1;if(p.ctx=n?n(t,e.props||{},(k,_,...y)=>{const g=y.length?y[0]:_;return p.ctx&&o(p.ctx[k],p.ctx[k]=g)&&(!p.skip_bound&&p.bound[k]&&p.bound[k](g),d&&hr(t,k)),_}):[],p.update(),d=!0,pe(p.before_update),p.fragment=i?i(p.ctx):!1,e.target){if(e.hydrate){const k=ar(e.target);p.fragment&&p.fragment.l(k),k.forEach(h)}else p.fragment&&p.fragment.c();e.intro&&ze(t.$$.fragment),Yt(t,e.target,e.anchor,e.customElement),Tl()}Jt(c)}class Le{$destroy(){Kt(this,1),this.$destroy=J}$on(e,n){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!rr(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ot=[];function Cl(t,e=J){let n;const i=new Set;function o(f){if(Me(t,f)&&(t=f,n)){const c=!Ot.length;for(const p of i)p[1](),Ot.push(p,t);if(c){for(let p=0;p<Ot.length;p+=2)Ot[p][0](Ot[p+1]);Ot.length=0}}}function l(f){o(f(t))}function a(f,c=J){const p=[f,c];return i.add(p),i.size===1&&(n=e(o)||J),f(t),()=>{i.delete(p),i.size===0&&(n(),n=null)}}return{set:o,update:l,subscribe:a}}var Ii=function(t,e){return Ii=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},Ii(t,e)};function Hi(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}Ii(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var se=function(){return se=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},se.apply(this,arguments)};function M(t,e,n,i){return new(n||(n=Promise))(function(o,l){function a(p){try{c(i.next(p))}catch(d){l(d)}}function f(p){try{c(i.throw(p))}catch(d){l(d)}}function c(p){var d;p.done?o(p.value):(d=p.value,d instanceof n?d:new n(function(k){k(d)})).then(a,f)}c((i=i.apply(t,e||[])).next())})}function T(t,e){var n,i,o,l,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function f(c){return function(p){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&d[0]?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,i=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!((o=o.length>0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){a.label=d[1];break}if(d[0]===6&&a.label<o[1]){a.label=o[1],o=d;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(d);break}o[2]&&a.ops.pop(),a.trys.pop();continue}d=e.call(t,a)}catch(k){d=[6,k],i=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,p])}}}function ht(t,e){e===void 0&&(e=!1);var n=window.crypto.getRandomValues(new Uint32Array(1))[0],i="_".concat(n);return Object.defineProperty(window,i,{value:function(o){return e&&Reflect.deleteProperty(window,i),t==null?void 0:t(o)},writable:!1,configurable:!0}),n}function ti(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,new Promise(function(i,o){var l=ht(function(f){i(f),Reflect.deleteProperty(window,"_".concat(a))},!0),a=ht(function(f){o(f),Reflect.deleteProperty(window,"_".concat(l))},!0);window.__TAURI_IPC__(se({cmd:t,callback:l,error:a},e))})]})})}function El(t,e){e===void 0&&(e="asset");var n=encodeURIComponent(t);return navigator.userAgent.includes("Windows")?"https://".concat(e,".localhost/").concat(n):"".concat(e,"://").concat(n)}Object.freeze({__proto__:null,transformCallback:ht,invoke:ti,convertFileSrc:El});function O(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,ti("tauri",t)]})})}function mr(t,e,n,i){return n===void 0&&(n=[]),M(this,void 0,void 0,function(){return T(this,function(o){return typeof n=="object"&&Object.freeze(n),[2,O({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:n,options:i,onEventFn:ht(t)}})]})})}var Qn=function(){function t(){this.eventListeners=Object.create(null)}return t.prototype.addListener=function(e,n){return this.on(e,n)},t.prototype.removeListener=function(e,n){return this.off(e,n)},t.prototype.on=function(e,n){return e in this.eventListeners?this.eventListeners[e].push(n):this.eventListeners[e]=[n],this},t.prototype.once=function(e,n){var i=this,o=function(){for(var l=[],a=0;a<arguments.length;a++)l[a]=arguments[a];i.removeListener(e,o),n.apply(void 0,l)};return this.addListener(e,o)},t.prototype.off=function(e,n){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(function(i){return i!==n})),this},t.prototype.removeAllListeners=function(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this},t.prototype.emit=function(e){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];if(e in this.eventListeners){for(var o=this.eventListeners[e],l=0,a=o;l<a.length;l++){var f=a[l];f.apply(void 0,n)}return!0}return!1},t.prototype.listenerCount=function(e){return e in this.eventListeners?this.eventListeners[e].length:0},t.prototype.prependListener=function(e,n){return e in this.eventListeners?this.eventListeners[e].unshift(n):this.eventListeners[e]=[n],this},t.prototype.prependOnceListener=function(e,n){var i=this,o=function(){for(var l=[],a=0;a<arguments.length;a++)l[a]=arguments[a];i.removeListener(e,o),n.apply(void 0,l)};return this.prependListener(e,o)},t}(),Ll=function(){function t(e){this.pid=e}return t.prototype.write=function(e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})]})})},t.prototype.kill=function(){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,O({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})]})})},t}(),Sl=function(t){function e(n,i,o){i===void 0&&(i=[]);var l=t.call(this)||this;return l.stdout=new Qn,l.stderr=new Qn,l.program=n,l.args=typeof i=="string"?[i]:i,l.options=o!=null?o:{},l}return Hi(e,t),e.sidecar=function(n,i,o){i===void 0&&(i=[]);var l=new e(n,i,o);return l.options.sidecar=!0,l},e.prototype.spawn=function(){return M(this,void 0,void 0,function(){var n=this;return T(this,function(i){return[2,mr(function(o){switch(o.event){case"Error":n.emit("error",o.payload);break;case"Terminated":n.emit("close",o.payload);break;case"Stdout":n.stdout.emit("data",o.payload);break;case"Stderr":n.stderr.emit("data",o.payload)}},this.program,this.args,this.options).then(function(o){return new Ll(o)})]})})},e.prototype.execute=function(){return M(this,void 0,void 0,function(){var n=this;return T(this,function(i){return[2,new Promise(function(o,l){n.on("error",l);var a=[],f=[];n.stdout.on("data",function(c){a.push(c)}),n.stderr.on("data",function(c){f.push(c)}),n.on("close",function(c){o({code:c.code,signal:c.signal,stdout:a.join(`
|
|
`),stderr:f.join(`
|
|
`)})}),n.spawn().catch(l)})]})})},e}(Qn);function Ui(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Shell",message:{cmd:"open",path:t,with:e}})]})})}Object.freeze({__proto__:null,Command:Sl,Child:Ll,EventEmitter:Qn,open:Ui});function Ol(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:e}})]})})}function Al(t,e,n){return M(this,void 0,void 0,function(){return T(this,function(i){switch(i.label){case 0:return[4,O({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:e,payload:typeof n=="string"?n:JSON.stringify(n)}})];case 1:return i.sent(),[2]}})})}function Fi(t,e,n){return M(this,void 0,void 0,function(){var i=this;return T(this,function(o){return[2,O({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:e,handler:ht(n)}}).then(function(l){return function(){return M(i,void 0,void 0,function(){return T(this,function(a){return[2,Ol(t,l)]})})}})]})})}function Dl(t,e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,Fi(t,e,function(o){n(o),Ol(t,o.id).catch(function(){})})]})})}var ve;function Zt(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,Fi(t,null,e)]})})}function Wl(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,Dl(t,null,e)]})})}function si(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,Al(t,void 0,e)]})})}(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_FILE_DROP="tauri://file-drop",t.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",t.MENU="tauri://menu",t.CHECK_UPDATE="tauri://update",t.UPDATE_AVAILABLE="tauri://update-available",t.INSTALL_UPDATE="tauri://update-install",t.STATUS_UPDATE="tauri://update-status",t.DOWNLOAD_PROGRESS="tauri://update-download-progress"})(ve||(ve={}));Object.freeze({__proto__:null,get TauriEvent(){return ve},listen:Zt,once:Wl,emit:si});var Qt,ni=function(t,e){this.type="Logical",this.width=t,this.height=e},At=function(){function t(e,n){this.type="Physical",this.width=e,this.height=n}return t.prototype.toLogical=function(e){return new ni(this.width/e,this.height/e)},t}(),zl=function(t,e){this.type="Logical",this.x=t,this.y=e},dt=function(){function t(e,n){this.type="Physical",this.x=e,this.y=n}return t.prototype.toLogical=function(e){return new zl(this.x/e,this.y/e)},t}();function Gt(){return new zt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Pl(){return window.__TAURI_METADATA__.__windows.map(function(t){return new zt(t.label,{skip:!0})})}(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(Qt||(Qt={}));var Be,Jo=["tauri://created","tauri://error"],Rl=function(){function t(e){this.label=e,this.listeners=Object.create(null)}return t.prototype.listen=function(e,n){return M(this,void 0,void 0,function(){var i=this;return T(this,function(o){return this._handleTauriEvent(e,n)?[2,Promise.resolve(function(){var l=i.listeners[e];l.splice(l.indexOf(n),1)})]:[2,Fi(e,this.label,n)]})})},t.prototype.once=function(e,n){return M(this,void 0,void 0,function(){var i=this;return T(this,function(o){return this._handleTauriEvent(e,n)?[2,Promise.resolve(function(){var l=i.listeners[e];l.splice(l.indexOf(n),1)})]:[2,Dl(e,this.label,n)]})})},t.prototype.emit=function(e,n){return M(this,void 0,void 0,function(){var i,o;return T(this,function(l){if(Jo.includes(e)){for(i=0,o=this.listeners[e]||[];i<o.length;i++)(0,o[i])({event:e,id:-1,windowLabel:this.label,payload:n});return[2,Promise.resolve()]}return[2,Al(e,this.label,n)]})})},t.prototype._handleTauriEvent=function(e,n){return!!Jo.includes(e)&&(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0)},t}(),Il=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return Hi(e,t),e.prototype.scaleFactor=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})]})})},e.prototype.innerPosition=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(function(i){var o=i.x,l=i.y;return new dt(o,l)})]})})},e.prototype.outerPosition=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(function(i){var o=i.x,l=i.y;return new dt(o,l)})]})})},e.prototype.innerSize=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(function(i){var o=i.width,l=i.height;return new At(o,l)})]})})},e.prototype.outerSize=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(function(i){var o=i.width,l=i.height;return new At(o,l)})]})})},e.prototype.isFullscreen=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})]})})},e.prototype.isMaximized=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})]})})},e.prototype.isDecorated=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})]})})},e.prototype.isResizable=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})]})})},e.prototype.isVisible=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})]})})},e.prototype.theme=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})]})})},e.prototype.center=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})]})})},e.prototype.requestUserAttention=function(n){return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=null,n&&(i=n===Qt.Critical?{type:"Critical"}:{type:"Informational"}),[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:i}}}})]})})},e.prototype.setResizable=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:n}}}})]})})},e.prototype.setTitle=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:n}}}})]})})},e.prototype.maximize=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})]})})},e.prototype.unmaximize=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})]})})},e.prototype.toggleMaximize=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})]})})},e.prototype.minimize=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})]})})},e.prototype.unminimize=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})]})})},e.prototype.show=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})]})})},e.prototype.hide=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})]})})},e.prototype.close=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})]})})},e.prototype.setDecorations=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:n}}}})]})})},e.prototype.setAlwaysOnTop=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:n}}}})]})})},e.prototype.setSize=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){if(!n||n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:n.type,data:{width:n.width,height:n.height}}}}}})]})})},e.prototype.setMinSize=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){if(n&&n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:n?{type:n.type,data:{width:n.width,height:n.height}}:null}}}})]})})},e.prototype.setMaxSize=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){if(n&&n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:n?{type:n.type,data:{width:n.width,height:n.height}}:null}}}})]})})},e.prototype.setPosition=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){if(!n||n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:n.type,data:{x:n.x,y:n.y}}}}}})]})})},e.prototype.setFullscreen=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:n}}}})]})})},e.prototype.setFocus=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})]})})},e.prototype.setIcon=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof n=="string"?n:Array.from(n)}}}}})]})})},e.prototype.setSkipTaskbar=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:n}}}})]})})},e.prototype.setCursorGrab=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:n}}}})]})})},e.prototype.setCursorVisible=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:n}}}})]})})},e.prototype.setCursorIcon=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:n}}}})]})})},e.prototype.setCursorPosition=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){if(!n||n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:n.type,data:{x:n.x,y:n.y}}}}}})]})})},e.prototype.setIgnoreCursorEvents=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:n}}}})]})})},e.prototype.startDragging=function(){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})]})})},e.prototype.onResized=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.listen(ve.WINDOW_RESIZED,n)]})})},e.prototype.onMoved=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.listen(ve.WINDOW_MOVED,n)]})})},e.prototype.onCloseRequested=function(n){return M(this,void 0,void 0,function(){var i=this;return T(this,function(o){return[2,this.listen(ve.WINDOW_CLOSE_REQUESTED,function(l){var a=new Nl(l);Promise.resolve(n(a)).then(function(){if(!a.isPreventDefault())return i.close()})})]})})},e.prototype.onFocusChanged=function(n){return M(this,void 0,void 0,function(){var i,o;return T(this,function(l){switch(l.label){case 0:return[4,this.listen(ve.WINDOW_FOCUS,function(a){n(se(se({},a),{payload:!0}))})];case 1:return i=l.sent(),[4,this.listen(ve.WINDOW_BLUR,function(a){n(se(se({},a),{payload:!1}))})];case 2:return o=l.sent(),[2,function(){i(),o()}]}})})},e.prototype.onScaleChanged=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.listen(ve.WINDOW_SCALE_FACTOR_CHANGED,n)]})})},e.prototype.onMenuClicked=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.listen(ve.MENU,n)]})})},e.prototype.onFileDropEvent=function(n){return M(this,void 0,void 0,function(){var i,o,l;return T(this,function(a){switch(a.label){case 0:return[4,this.listen(ve.WINDOW_FILE_DROP,function(f){n(se(se({},f),{payload:{type:"drop",paths:f.payload}}))})];case 1:return i=a.sent(),[4,this.listen(ve.WINDOW_FILE_DROP_HOVER,function(f){n(se(se({},f),{payload:{type:"hover",paths:f.payload}}))})];case 2:return o=a.sent(),[4,this.listen(ve.WINDOW_FILE_DROP_CANCELLED,function(f){n(se(se({},f),{payload:{type:"cancel"}}))})];case 3:return l=a.sent(),[2,function(){i(),o(),l()}]}})})},e.prototype.onThemeChanged=function(n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.listen(ve.WINDOW_THEME_CHANGED,n)]})})},e}(Rl),Nl=function(){function t(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}return t.prototype.preventDefault=function(){this._preventDefault=!0},t.prototype.isPreventDefault=function(){return this._preventDefault},t}(),zt=function(t){function e(n,i){i===void 0&&(i={});var o=t.call(this,n)||this;return i!=null&&i.skip||O({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:se({label:n},i)}}}).then(function(){return M(o,void 0,void 0,function(){return T(this,function(l){return[2,this.emit("tauri://created")]})})}).catch(function(l){return M(o,void 0,void 0,function(){return T(this,function(a){return[2,this.emit("tauri://error",l)]})})}),o}return Hi(e,t),e.getByLabel=function(n){return Pl().some(function(i){return i.label===n})?new e(n,{skip:!0}):null},e}(Il);function vr(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}})]})})}function _r(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}})]})})}function br(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}})]})})}"__TAURI_METADATA__"in window?Be=new zt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.
|
|
Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),Be=new zt("main",{skip:!0}));Object.freeze({__proto__:null,WebviewWindow:zt,WebviewWindowHandle:Rl,WindowManager:Il,CloseRequestedEvent:Nl,getCurrent:Gt,getAll:Pl,get appWindow(){return Be},LogicalSize:ni,PhysicalSize:At,LogicalPosition:zl,PhysicalPosition:dt,get UserAttentionType(){return Qt},currentMonitor:vr,primaryMonitor:_r,availableMonitors:br});function gr(){return navigator.appVersion.includes("Win")}var yr=gr()?`\r
|
|
`:`
|
|
`;function jl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"Os",message:{cmd:"platform"}})]})})}function wr(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"Os",message:{cmd:"version"}})]})})}function kr(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"Os",message:{cmd:"osType"}})]})})}function Mr(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"Os",message:{cmd:"arch"}})]})})}function Tr(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"Os",message:{cmd:"tempdir"}})]})})}Object.freeze({__proto__:null,EOL:yr,platform:jl,version:wr,type:kr,arch:Mr,tempdir:Tr});function Hl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"App",message:{cmd:"getAppVersion"}})]})})}function Ul(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"App",message:{cmd:"getAppName"}})]})})}function Fl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"App",message:{cmd:"getTauriVersion"}})]})})}Object.freeze({__proto__:null,getName:Ul,getVersion:Hl,getTauriVersion:Fl});function ql(t){return t===void 0&&(t=0),M(this,void 0,void 0,function(){return T(this,function(e){return[2,O({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}})]})})}function qi(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"Process",message:{cmd:"relaunch"}})]})})}Object.freeze({__proto__:null,exit:ql,relaunch:qi});function Cr(t){let e,n,i,o,l,a,f,c,p,d,k,_,y,g,b,S,z,U,R,q,A,E,L,P,C,F;return{c(){e=s("p"),e.innerHTML=`This is a demo of Tauri's API capabilities using the <code>@tauri-apps/api</code> package. It's used as the main validation app, serving as the test bed of our
|
|
development process. In the future, this app will be used on Tauri's integration
|
|
tests.`,n=v(),i=s("br"),o=v(),l=s("br"),a=v(),f=s("pre"),c=W("App name: "),p=s("code"),d=W(t[2]),k=W(`
|
|
App version: `),_=s("code"),y=W(t[0]),g=W(`
|
|
Tauri version: `),b=s("code"),S=W(t[1]),z=W(`
|
|
`),U=v(),R=s("br"),q=v(),A=s("div"),E=s("button"),E.textContent="Close application",L=v(),P=s("button"),P.textContent="Relaunch application",u(E,"class","btn"),u(P,"class","btn"),u(A,"class","flex flex-wrap gap-1 shadow-")},m(B,Y){m(B,e,Y),m(B,n,Y),m(B,i,Y),m(B,o,Y),m(B,l,Y),m(B,a,Y),m(B,f,Y),r(f,c),r(f,p),r(p,d),r(f,k),r(f,_),r(_,y),r(f,g),r(f,b),r(b,S),r(f,z),m(B,U,Y),m(B,R,Y),m(B,q,Y),m(B,A,Y),r(A,E),r(A,L),r(A,P),C||(F=[D(E,"click",t[3]),D(P,"click",t[4])],C=!0)},p(B,[Y]){Y&4&&x(d,B[2]),Y&1&&x(y,B[0]),Y&2&&x(S,B[1])},i:J,o:J,d(B){B&&h(e),B&&h(n),B&&h(i),B&&h(o),B&&h(l),B&&h(a),B&&h(f),B&&h(U),B&&h(R),B&&h(q),B&&h(A),C=!1,pe(F)}}}function Er(t,e,n){let i="0.0.0",o="0.0.0",l="Unknown";Ul().then(c=>{n(2,l=c)}),Hl().then(c=>{n(0,i=c)}),Fl().then(c=>{n(1,o=c)});async function a(){await ql()}async function f(){await qi()}return[i,o,l,a,f]}class Lr extends Le{constructor(e){super(),Ee(this,e,Er,Cr,Me,{})}}function Bl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}Object.freeze({__proto__:null,getMatches:Bl});function Sr(t){let e,n,i,o,l,a,f,c,p,d,k,_,y;return{c(){e=s("p"),e.innerHTML=`This binary can be run from the terminal and takes the following arguments:
|
|
<code class="code-block flex flex-wrap my-2"><pre> --config <PATH>
|
|
--theme <light|dark|system>
|
|
--verbose</pre></code>
|
|
Additionally, it has a <code>update --background</code> subcommand.`,n=v(),i=s("br"),o=v(),l=s("div"),l.textContent="Note that the arguments are only parsed, not implemented.",a=v(),f=s("br"),c=v(),p=s("br"),d=v(),k=s("button"),k.textContent="Get matches",u(l,"class","note"),u(k,"class","btn"),u(k,"id","cli-matches")},m(g,b){m(g,e,b),m(g,n,b),m(g,i,b),m(g,o,b),m(g,l,b),m(g,a,b),m(g,f,b),m(g,c,b),m(g,p,b),m(g,d,b),m(g,k,b),_||(y=D(k,"click",t[0]),_=!0)},p:J,i:J,o:J,d(g){g&&h(e),g&&h(n),g&&h(i),g&&h(o),g&&h(l),g&&h(a),g&&h(f),g&&h(c),g&&h(p),g&&h(d),g&&h(k),_=!1,y()}}}function Or(t,e,n){let{onMessage:i}=e;function o(){Bl().then(i).catch(i)}return t.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class Ar extends Le{constructor(e){super(),Ee(this,e,Or,Sr,Me,{onMessage:1})}}function Dr(t){let e,n,i,o,l,a,f,c;return{c(){e=s("div"),n=s("button"),n.textContent="Call Log API",i=v(),o=s("button"),o.textContent="Call Request (async) API",l=v(),a=s("button"),a.textContent="Send event to Rust",u(n,"class","btn"),u(n,"id","log"),u(o,"class","btn"),u(o,"id","request"),u(a,"class","btn"),u(a,"id","event")},m(p,d){m(p,e,d),r(e,n),r(e,i),r(e,o),r(e,l),r(e,a),f||(c=[D(n,"click",t[0]),D(o,"click",t[1]),D(a,"click",t[2])],f=!0)},p:J,i:J,o:J,d(p){p&&h(e),f=!1,pe(c)}}}function Wr(t,e,n){let{onMessage:i}=e,o;ct(async()=>{o=await Zt("rust-event",i)}),ji(()=>{o&&o()});function l(){ti("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function a(){ti("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function f(){si("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[l,a,f,i]}class zr extends Le{constructor(e){super(),Ee(this,e,Wr,Dr,Me,{onMessage:3})}}function Bi(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return T(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,O({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})]})})}function Vl(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return T(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,O({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})]})})}function Pr(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,O({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function Gl(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,O({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function Rr(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,O({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}Object.freeze({__proto__:null,open:Bi,save:Vl,message:Pr,ask:Gl,confirm:Rr});var Pt;function Ir(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]})})}function Vi(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){var n;return T(this,function(i){switch(i.label){case 0:return[4,O({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:e}})];case 1:return n=i.sent(),[2,Uint8Array.from(n)]}})})}function Ni(t,e,n){return M(this,void 0,void 0,function(){var i,o;return T(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:""},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),typeof e=="string"?i.contents=e!=null?e:"":o=e,[2,O({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:o}})]})})}function Nr(t,e,n){return M(this,void 0,void 0,function(){var i,o;return T(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:[]},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),e&&"dir"in e?o=e:typeof t=="string"&&(i.contents=e!=null?e:[]),[2,O({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:o}})]})})}function Jl(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:e}})]})})}function jr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})]})})}function Hr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})]})})}function Ur(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})]})})}function Fr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})]})})}function qr(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return T(this,function(i){return[2,O({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})]})})}function Br(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"Fs",message:{cmd:"exists",path:t,options:e}})]})})}(function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Desktop=6]="Desktop",t[t.Document=7]="Document",t[t.Download=8]="Download",t[t.Executable=9]="Executable",t[t.Font=10]="Font",t[t.Home=11]="Home",t[t.Picture=12]="Picture",t[t.Public=13]="Public",t[t.Runtime=14]="Runtime",t[t.Template=15]="Template",t[t.Video=16]="Video",t[t.Resource=17]="Resource",t[t.App=18]="App",t[t.Log=19]="Log",t[t.Temp=20]="Temp"})(Pt||(Pt={}));Object.freeze({__proto__:null,get BaseDirectory(){return Pt},get Dir(){return Pt},readTextFile:Ir,readBinaryFile:Vi,writeTextFile:Ni,writeFile:Ni,writeBinaryFile:Nr,readDir:Jl,createDir:jr,removeDir:Hr,copyFile:Ur,removeFile:Fr,renameFile:qr,exists:Br});function Vr(t){let e,n,i,o,l,a,f,c,p,d,k,_,y,g,b,S,z,U,R,q,A,E,L,P;return{c(){e=s("div"),n=s("input"),i=v(),o=s("input"),l=v(),a=s("br"),f=v(),c=s("div"),p=s("input"),d=v(),k=s("label"),k.textContent="Multiple",_=v(),y=s("div"),g=s("input"),b=v(),S=s("label"),S.textContent="Directory",z=v(),U=s("br"),R=v(),q=s("button"),q.textContent="Open dialog",A=v(),E=s("button"),E.textContent="Open save dialog",u(n,"class","input"),u(n,"id","dialog-default-path"),u(n,"placeholder","Default path"),u(o,"class","input"),u(o,"id","dialog-filter"),u(o,"placeholder","Extensions filter, comma-separated"),u(e,"class","flex gap-2 children:grow"),u(p,"type","checkbox"),u(p,"id","dialog-multiple"),u(k,"for","dialog-multiple"),u(g,"type","checkbox"),u(g,"id","dialog-directory"),u(S,"for","dialog-directory"),u(q,"class","btn"),u(q,"id","open-dialog"),u(E,"class","btn"),u(E,"id","save-dialog")},m(C,F){m(C,e,F),r(e,n),G(n,t[0]),r(e,i),r(e,o),G(o,t[1]),m(C,l,F),m(C,a,F),m(C,f,F),m(C,c,F),r(c,p),p.checked=t[2],r(c,d),r(c,k),m(C,_,F),m(C,y,F),r(y,g),g.checked=t[3],r(y,b),r(y,S),m(C,z,F),m(C,U,F),m(C,R,F),m(C,q,F),m(C,A,F),m(C,E,F),L||(P=[D(n,"input",t[8]),D(o,"input",t[9]),D(p,"change",t[10]),D(g,"change",t[11]),D(q,"click",t[4]),D(E,"click",t[5])],L=!0)},p(C,[F]){F&1&&n.value!==C[0]&&G(n,C[0]),F&2&&o.value!==C[1]&&G(o,C[1]),F&4&&(p.checked=C[2]),F&8&&(g.checked=C[3])},i:J,o:J,d(C){C&&h(e),C&&h(l),C&&h(a),C&&h(f),C&&h(c),C&&h(_),C&&h(y),C&&h(z),C&&h(U),C&&h(R),C&&h(q),C&&h(A),C&&h(E),L=!1,pe(P)}}}function Gr(t,e){var n=new Blob([t],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){var l=o.target.result;e(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function Jr(t,e,n){let{onMessage:i}=e,{insecureRenderHtml:o}=e,l=null,a=null,f=!1,c=!1;function p(){Bi({title:"My wonderful open dialog",defaultPath:l,filters:a?[{name:"Tauri Example",extensions:a.split(",").map(b=>b.trim())}]:[],multiple:f,directory:c}).then(function(b){if(Array.isArray(b))i(b);else{var S=b,z=S.match(/\S+\.\S+$/g);Vi(S).then(function(U){z&&(S.includes(".png")||S.includes(".jpg"))?Gr(new Uint8Array(U),function(R){var q="data:image/png;base64,"+R;o('<img src="'+q+'"></img>')}):i(b)}).catch(i(b))}}).catch(i)}function d(){Vl({title:"My wonderful save dialog",defaultPath:l,filters:a?[{name:"Tauri Example",extensions:a.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function k(){l=this.value,n(0,l)}function _(){a=this.value,n(1,a)}function y(){f=this.checked,n(2,f)}function g(){c=this.checked,n(3,c)}return t.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,o=b.insecureRenderHtml)},[l,a,f,c,p,d,i,o,k,_,y,g]}class Xr extends Le{constructor(e){super(),Ee(this,e,Jr,Vr,Me,{onMessage:6,insecureRenderHtml:7})}}function Xo(t,e,n){const i=t.slice();return i[9]=e[n],i}function Yo(t){let e,n=t[9][0]+"",i,o;return{c(){e=s("option"),i=W(n),e.__value=o=t[9][1],e.value=e.__value},m(l,a){m(l,e,a),r(e,i)},p:J,d(l){l&&h(e)}}}function Yr(t){let e,n,i,o,l,a,f,c,p,d,k,_,y,g,b,S,z,U,R,q=t[2],A=[];for(let E=0;E<q.length;E+=1)A[E]=Yo(Xo(t,q,E));return{c(){e=s("form"),n=s("div"),i=s("select"),o=s("option"),o.textContent="None";for(let E=0;E<A.length;E+=1)A[E].c();l=v(),a=s("input"),f=v(),c=s("br"),p=v(),d=s("div"),k=s("button"),k.textContent="Read",_=v(),y=s("button"),y.textContent="Use as img src",g=v(),b=s("br"),S=v(),z=s("img"),o.__value="",o.value=o.__value,u(i,"class","input"),u(i,"id","dir"),u(a,"class","input grow"),u(a,"id","path-to-read"),u(a,"placeholder","Type the path to read..."),u(n,"class","flex gap-1"),u(k,"class","btn"),u(k,"id","read"),u(y,"class","btn"),u(y,"type","button"),u(e,"class","flex flex-col"),u(z,"alt","")},m(E,L){m(E,e,L),r(e,n),r(n,i),r(i,o);for(let P=0;P<A.length;P+=1)A[P].m(i,null);r(n,l),r(n,a),G(a,t[0]),r(e,f),r(e,c),r(e,p),r(e,d),r(d,k),r(d,_),r(d,y),m(E,g,L),m(E,b,L),m(E,S,L),m(E,z,L),t[8](z),U||(R=[D(a,"input",t[7]),D(y,"click",t[4]),D(e,"submit",xn(t[3]))],U=!0)},p(E,[L]){if(L&4){q=E[2];let P;for(P=0;P<q.length;P+=1){const C=Xo(E,q,P);A[P]?A[P].p(C,L):(A[P]=Yo(C),A[P].c(),A[P].m(i,null))}for(;P<A.length;P+=1)A[P].d(1);A.length=q.length}L&1&&a.value!==E[0]&&G(a,E[0])},i:J,o:J,d(E){E&&h(e),pt(A,E),E&&h(g),E&&h(b),E&&h(S),E&&h(z),t[8](null),U=!1,pe(R)}}}function Ko(){return document.getElementById("dir").value?parseInt(dir.value):null}function Kr(t,e){const n=new Blob([t],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){const l=o.target.result;e(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function Qr(t,e,n){let{onMessage:i}=e,{insecureRenderHtml:o}=e,l="",a;const f=Object.keys(Pt).filter(_=>isNaN(parseInt(_))).map(_=>[_,Pt[_]]);function c(){const _=l.match(/\S+\.\S+$/g),y={dir:Ko()};(_?Vi(l,y):Jl(l,y)).then(function(b){if(_)if(l.includes(".png")||l.includes(".jpg"))Kr(new Uint8Array(b),function(S){const z="data:image/png;base64,"+S;o('<img src="'+z+'"></img>')});else{const S=String.fromCharCode.apply(null,b);o('<textarea id="file-response"></textarea><button id="file-save">Save</button>'),setTimeout(()=>{const z=document.getElementById("file-response");z.value=S,document.getElementById("file-save").addEventListener("click",function(){Ni(l,z.value,{dir:Ko()}).catch(i)})})}else i(b)}).catch(i)}function p(){n(1,a.src=El(l),a)}function d(){l=this.value,n(0,l)}function k(_){$n[_?"unshift":"push"](()=>{a=_,n(1,a)})}return t.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,o=_.insecureRenderHtml)},[l,a,f,c,p,i,o,d,k]}class Zr extends Le{constructor(e){super(),Ee(this,e,Qr,Yr,Me,{onMessage:5,insecureRenderHtml:6})}}var Rt;(function(t){t[t.JSON=1]="JSON",t[t.Text=2]="Text",t[t.Binary=3]="Binary"})(Rt||(Rt={}));var Zn=function(){function t(e,n){this.type=e,this.payload=n}return t.form=function(e){var n={};for(var i in e){var o=e[i],l=void 0;l=typeof o=="string"?o:o instanceof Uint8Array||Array.isArray(o)?Array.from(o):typeof o.file=="string"?{file:o.file,mime:o.mime,fileName:o.fileName}:{file:Array.from(o.file),mime:o.mime,fileName:o.fileName},n[i]=l}return new t("Form",n)},t.json=function(e){return new t("Json",e)},t.text=function(e){return new t("Text",e)},t.bytes=function(e){return new t("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))},t}(),Xl=function(t){this.url=t.url,this.status=t.status,this.ok=this.status>=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data},Yl=function(){function t(e){this.id=e}return t.prototype.drop=function(){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,O({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},t.prototype.request=function(e){return M(this,void 0,void 0,function(){var n;return T(this,function(i){return(n=!e.responseType||e.responseType===Rt.JSON)&&(e.responseType=Rt.Text),[2,O({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(function(o){var l=new Xl(o);if(n){try{l.data=JSON.parse(l.data)}catch(a){if(l.ok&&l.data==="")l.data={};else if(l.ok)throw Error("Failed to parse response `".concat(l.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 l}return l})]})})},t.prototype.get=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(se({method:"GET",url:e},n))]})})},t.prototype.post=function(e,n,i){return M(this,void 0,void 0,function(){return T(this,function(o){return[2,this.request(se({method:"POST",url:e,body:n},i))]})})},t.prototype.put=function(e,n,i){return M(this,void 0,void 0,function(){return T(this,function(o){return[2,this.request(se({method:"PUT",url:e,body:n},i))]})})},t.prototype.patch=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(se({method:"PATCH",url:e},n))]})})},t.prototype.delete=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(se({method:"DELETE",url:e},n))]})})},t}();function ii(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,O({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(function(n){return new Yl(n)})]})})}var zi=null;function xr(t,e){var n;return M(this,void 0,void 0,function(){return T(this,function(i){switch(i.label){case 0:return zi!==null?[3,2]:[4,ii()];case 1:zi=i.sent(),i.label=2;case 2:return[2,zi.request(se({url:t,method:(n=e==null?void 0:e.method)!==null&&n!==void 0?n:"GET"},e))]}})})}Object.freeze({__proto__:null,getClient:ii,fetch:xr,Body:Zn,Client:Yl,Response:Xl,get ResponseType(){return Rt}});function Qo(t,e,n){const i=t.slice();return i[12]=e[n],i[14]=n,i}function Zo(t){let e,n,i,o,l,a,f,c,p,d,k,_,y,g,b,S,z,U=t[5],R=[];for(let L=0;L<U.length;L+=1)R[L]=el(Qo(t,U,L));const q=L=>je(R[L],1,1,()=>{R[L]=null});let A=!t[3]&&tl(),E=!t[3]&&t[8]&&nl();return{c(){e=s("span"),n=s("span"),i=W(t[6]),o=v(),l=s("ul");for(let L=0;L<R.length;L+=1)R[L].c();a=v(),f=s("span"),c=W(t[7]),A&&A.c(),p=v(),d=s("span"),k=W(t[6]),_=W(ns),y=W(t[7]),E&&E.c(),g=oi(),u(n,"class","bracket svelte-gbh3pt"),u(n,"tabindex","0"),u(l,"class","svelte-gbh3pt"),u(f,"class","bracket svelte-gbh3pt"),u(f,"tabindex","0"),u(e,"class","svelte-gbh3pt"),Jn(e,"hidden",t[8]),u(d,"class","bracket svelte-gbh3pt"),u(d,"tabindex","0"),Jn(d,"hidden",!t[8])},m(L,P){m(L,e,P),r(e,n),r(n,i),r(e,o),r(e,l);for(let C=0;C<R.length;C+=1)R[C].m(l,null);r(e,a),r(e,f),r(f,c),A&&A.m(e,null),m(L,p,P),m(L,d,P),r(d,k),r(d,_),r(d,y),E&&E.m(L,P),m(L,g,P),b=!0,S||(z=[D(n,"click",t[11]),D(f,"click",t[11]),D(d,"click",t[11])],S=!0)},p(L,P){if((!b||P&64)&&x(i,L[6]),P&1591){U=L[5];let C;for(C=0;C<U.length;C+=1){const F=Qo(L,U,C);R[C]?(R[C].p(F,P),ze(R[C],1)):(R[C]=el(F),R[C].c(),ze(R[C],1),R[C].m(l,null))}for(li(),C=U.length;C<R.length;C+=1)q(C);ri()}(!b||P&128)&&x(c,L[7]),L[3]?A&&(A.d(1),A=null):A||(A=tl(),A.c(),A.m(e,null)),P&256&&Jn(e,"hidden",L[8]),(!b||P&64)&&x(k,L[6]),(!b||P&128)&&x(y,L[7]),P&256&&Jn(d,"hidden",!L[8]),!L[3]&&L[8]?E||(E=nl(),E.c(),E.m(g.parentNode,g)):E&&(E.d(1),E=null)},i(L){if(!b){for(let P=0;P<U.length;P+=1)ze(R[P]);b=!0}},o(L){R=R.filter(Boolean);for(let P=0;P<R.length;P+=1)je(R[P]);b=!1},d(L){L&&h(e),pt(R,L),A&&A.d(),L&&h(p),L&&h(d),E&&E.d(L),L&&h(g),S=!1,pe(z)}}}function xo(t){let e,n,i=t[12]+"",o,l;return{c(){e=s("span"),n=W('"'),o=W(i),l=W('":'),u(e,"class","key")},m(a,f){m(a,e,f),r(e,n),r(e,o),r(e,l)},p(a,f){f&32&&i!==(i=a[12]+"")&&x(o,i)},d(a){a&&h(e)}}}function $r(t){let e,n=t[10](t[0][t[12]])+"",i,o,l=t[14]<t[5].length-1&&$o();return{c(){e=s("span"),i=W(n),l&&l.c(),u(e,"class",o="val "+t[9](t[0][t[12]])+" svelte-gbh3pt")},m(a,f){m(a,e,f),r(e,i),l&&l.m(e,null)},p(a,f){f&33&&n!==(n=a[10](a[0][a[12]])+"")&&x(i,n),a[14]<a[5].length-1?l||(l=$o(),l.c(),l.m(e,null)):l&&(l.d(1),l=null),f&33&&o!==(o="val "+a[9](a[0][a[12]])+" svelte-gbh3pt")&&u(e,"class",o)},i:J,o:J,d(a){a&&h(e),l&&l.d()}}}function es(t){let e,n;return e=new Kl({props:{json:t[0][t[12]],depth:t[1],_lvl:t[2]+1,_last:t[14]===t[5].length-1}}),{c(){ei(e.$$.fragment)},m(i,o){Yt(e,i,o),n=!0},p(i,o){const l={};o&33&&(l.json=i[0][i[12]]),o&2&&(l.depth=i[1]),o&4&&(l._lvl=i[2]+1),o&32&&(l._last=i[14]===i[5].length-1),e.$set(l)},i(i){n||(ze(e.$$.fragment,i),n=!0)},o(i){je(e.$$.fragment,i),n=!1},d(i){Kt(e,i)}}}function $o(t){let e;return{c(){e=s("span"),e.textContent=",",u(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function el(t){let e,n,i,o,l,a,f,c=!t[4]&&xo(t);const p=[es,$r],d=[];function k(_,y){return y&33&&(i=null),i==null&&(i=_[9](_[0][_[12]])==="object"),i?0:1}return o=k(t,-1),l=d[o]=p[o](t),{c(){e=s("li"),c&&c.c(),n=v(),l.c(),a=v()},m(_,y){m(_,e,y),c&&c.m(e,null),r(e,n),d[o].m(e,null),r(e,a),f=!0},p(_,y){_[4]?c&&(c.d(1),c=null):c?c.p(_,y):(c=xo(_),c.c(),c.m(e,n));let g=o;o=k(_,y),o===g?d[o].p(_,y):(li(),je(d[g],1,1,()=>{d[g]=null}),ri(),l=d[o],l?l.p(_,y):(l=d[o]=p[o](_),l.c()),ze(l,1),l.m(e,a))},i(_){f||(ze(l),f=!0)},o(_){je(l),f=!1},d(_){_&&h(e),c&&c.d(),d[o].d()}}}function tl(t){let e;return{c(){e=s("span"),e.textContent=",",u(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function nl(t){let e;return{c(){e=s("span"),e.textContent=",",u(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function ts(t){let e,n,i=t[5].length&&Zo(t);return{c(){i&&i.c(),e=oi()},m(o,l){i&&i.m(o,l),m(o,e,l),n=!0},p(o,[l]){o[5].length?i?(i.p(o,l),l&32&&ze(i,1)):(i=Zo(o),i.c(),ze(i,1),i.m(e.parentNode,e)):i&&(li(),je(i,1,1,()=>{i=null}),ri())},i(o){n||(ze(i),n=!0)},o(o){je(i),n=!1},d(o){i&&i.d(o),o&&h(e)}}}const ns="...";function is(t,e,n){let{json:i}=e,{depth:o=1/0}=e,{_lvl:l=0}=e,{_last:a=!0}=e;const f=b=>b===null?"null":typeof b;let c,p,d,k,_;const y=b=>{switch(f(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},g=()=>{n(8,_=!_)};return t.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,o=b.depth),"_lvl"in b&&n(2,l=b._lvl),"_last"in b&&n(3,a=b._last)},t.$$.update=()=>{t.$$.dirty&17&&(n(5,c=f(i)==="object"?Object.keys(i):[]),n(4,p=Array.isArray(i)),n(6,d=p?"[":"{"),n(7,k=p?"]":"}")),t.$$.dirty&6&&n(8,_=o<l)},[i,o,l,a,p,c,d,k,_,f,y,g]}class Kl extends Le{constructor(e){super(),Ee(this,e,is,ts,Me,{json:0,depth:1,_lvl:2,_last:3})}}function os(t){let e,n,i,o,l,a,f,c,p,d,k,_,y,g,b,S,z,U,R,q,A,E,L,P,C,F,B,Y,$,be,te,oe,Q,ge,I,Z,le,ue,ee,_e,ae,ye,ne,Te,Oe;return ye=new Kl({props:{json:t[4]}}),{c(){e=s("form"),n=s("select"),i=s("option"),i.textContent="GET",o=s("option"),o.textContent="POST",l=s("option"),l.textContent="PUT",a=s("option"),a.textContent="PATCH",f=s("option"),f.textContent="DELETE",c=v(),p=s("br"),d=v(),k=s("textarea"),_=v(),y=s("br"),g=v(),b=s("button"),b.textContent="Make request",S=v(),z=s("br"),U=v(),R=s("h3"),R.textContent="HTTP Form",q=v(),A=s("div"),E=s("input"),L=v(),P=s("input"),C=v(),F=s("br"),B=v(),Y=s("label"),$=s("input"),be=W(`
|
|
Multipart`),te=v(),oe=s("br"),Q=v(),ge=s("br"),I=v(),Z=s("button"),Z.textContent="Post it",le=v(),ue=s("br"),ee=v(),_e=s("br"),ae=v(),ei(ye.$$.fragment),i.__value="GET",i.value=i.__value,o.__value="POST",o.value=o.__value,l.__value="PUT",l.value=l.__value,a.__value="PATCH",a.value=a.__value,f.__value="DELETE",f.value=f.__value,u(n,"class","input"),u(n,"id","request-method"),t[0]===void 0&&Wt(()=>t[9].call(n)),u(k,"class","input h-auto w-100%"),u(k,"id","request-body"),u(k,"placeholder","Request body"),u(k,"rows","5"),u(b,"class","btn"),u(b,"id","make-request"),u(E,"class","input"),u(P,"class","input"),u(A,"class","flex gap-2 children:grow"),u($,"type","checkbox"),u(Z,"class","btn"),u(Z,"type","button")},m(N,V){m(N,e,V),r(e,n),r(n,i),r(n,o),r(n,l),r(n,a),r(n,f),Dt(n,t[0]),r(e,c),r(e,p),r(e,d),r(e,k),G(k,t[1]),r(e,_),r(e,y),r(e,g),r(e,b),m(N,S,V),m(N,z,V),m(N,U,V),m(N,R,V),m(N,q,V),m(N,A,V),r(A,E),G(E,t[2]),r(A,L),r(A,P),G(P,t[3]),m(N,C,V),m(N,F,V),m(N,B,V),m(N,Y,V),r(Y,$),$.checked=t[5],r(Y,be),m(N,te,V),m(N,oe,V),m(N,Q,V),m(N,ge,V),m(N,I,V),m(N,Z,V),m(N,le,V),m(N,ue,V),m(N,ee,V),m(N,_e,V),m(N,ae,V),Yt(ye,N,V),ne=!0,Te||(Oe=[D(n,"change",t[9]),D(k,"input",t[10]),D(e,"submit",xn(t[6])),D(E,"input",t[11]),D(P,"input",t[12]),D($,"change",t[13]),D(Z,"click",t[7])],Te=!0)},p(N,[V]){V&1&&Dt(n,N[0]),V&2&&G(k,N[1]),V&4&&E.value!==N[2]&&G(E,N[2]),V&8&&P.value!==N[3]&&G(P,N[3]),V&32&&($.checked=N[5]);const Ie={};V&16&&(Ie.json=N[4]),ye.$set(Ie)},i(N){ne||(ze(ye.$$.fragment,N),ne=!0)},o(N){je(ye.$$.fragment,N),ne=!1},d(N){N&&h(e),N&&h(S),N&&h(z),N&&h(U),N&&h(R),N&&h(q),N&&h(A),N&&h(C),N&&h(F),N&&h(B),N&&h(Y),N&&h(te),N&&h(oe),N&&h(Q),N&&h(ge),N&&h(I),N&&h(Z),N&&h(le),N&&h(ue),N&&h(ee),N&&h(_e),N&&h(ae),Kt(ye,N),Te=!1,pe(Oe)}}}function ls(t,e,n){let i="GET",o="",{onMessage:l}=e;async function a(){const z=await ii().catch(q=>{throw l(q),q}),R={url:"http://localhost:3003",method:i||"GET"||"GET"};o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]")?R.body=Zn.json(JSON.parse(o)):o!==""&&(R.body=Zn.text(o)),z.request(R).then(l).catch(l)}let f="baz",c="qux",p=null,d=!0;async function k(){const z=await ii().catch(U=>{throw l(U),U});n(4,p=await z.request({url:"http://localhost:3003",method:"POST",body:Zn.form({foo:f,bar:c}),headers:d?{"Content-Type":"multipart/form-data"}:void 0,responseType:Rt.Text}))}function _(){i=Pi(this),n(0,i)}function y(){o=this.value,n(1,o)}function g(){f=this.value,n(2,f)}function b(){c=this.value,n(3,c)}function S(){d=this.checked,n(5,d)}return t.$$set=z=>{"onMessage"in z&&n(8,l=z.onMessage)},[i,o,f,c,p,d,a,k,l,_,y,g,b,S]}class rs extends Le{constructor(e){super(),Ee(this,e,ls,os,Me,{onMessage:8})}}function ss(t){let e,n,i;return{c(){e=s("button"),e.textContent="Send test notification",u(e,"class","btn"),u(e,"id","notification")},m(o,l){m(o,e,l),n||(i=D(e,"click",us),n=!0)},p:J,i:J,o:J,d(o){o&&h(e),n=!1,i()}}}function us(){new Notification("Notification title",{body:"This is the notification body"})}function as(t,e,n){let{onMessage:i}=e;return t.$$set=o=>{"onMessage"in o&&n(0,i=o.onMessage)},[i]}class cs extends Le{constructor(e){super(),Ee(this,e,as,ss,Me,{onMessage:0})}}function il(t,e,n){const i=t.slice();return i[67]=e[n],i}function ol(t,e,n){const i=t.slice();return i[70]=e[n],i}function ll(t){let e,n,i,o,l,a,f=Object.keys(t[1]),c=[];for(let p=0;p<f.length;p+=1)c[p]=rl(ol(t,f,p));return{c(){e=s("span"),e.textContent="Selected window:",n=v(),i=s("select"),o=s("option"),o.textContent="Choose a window...";for(let p=0;p<c.length;p+=1)c[p].c();u(e,"class","font-700 text-sm"),o.__value="",o.value=o.__value,o.disabled=!0,o.selected=!0,u(i,"class","input"),t[0]===void 0&&Wt(()=>t[39].call(i))},m(p,d){m(p,e,d),m(p,n,d),m(p,i,d),r(i,o);for(let k=0;k<c.length;k+=1)c[k].m(i,null);Dt(i,t[0]),l||(a=D(i,"change",t[39]),l=!0)},p(p,d){if(d[0]&2){f=Object.keys(p[1]);let k;for(k=0;k<f.length;k+=1){const _=ol(p,f,k);c[k]?c[k].p(_,d):(c[k]=rl(_),c[k].c(),c[k].m(i,null))}for(;k<c.length;k+=1)c[k].d(1);c.length=f.length}d[0]&3&&Dt(i,p[0])},d(p){p&&h(e),p&&h(n),p&&h(i),pt(c,p),l=!1,a()}}}function rl(t){let e,n=t[70]+"",i,o;return{c(){e=s("option"),i=W(n),e.__value=o=t[70],e.value=e.__value},m(l,a){m(l,e,a),r(e,i)},p(l,a){a[0]&2&&n!==(n=l[70]+"")&&x(i,n),a[0]&2&&o!==(o=l[70])&&(e.__value=o,e.value=e.__value)},d(l){l&&h(e)}}}function sl(t){let e,n,i,o,l,a,f,c,p,d,k,_,y,g,b,S,z,U,R,q,A,E,L,P,C,F,B,Y,$,be,te,oe,Q,ge,I,Z,le,ue,ee,_e,ae,ye,ne,Te,Oe,N,V,Ie,Ae,Ce,ce,he,fe,De,nt,me,de,H,ie,X,we,xt,mt,$t,Ne,en,Ve,vt,tn,K,It,it,Nt,Pe,_t,bt,gt,We,He,Re,ot,jt,lt,Ht,rt=t[26].width+"",yt,Ut,wt,Ji,nn=t[26].height+"",ui,Xi,Ge,on,Yi,ln,Ki,rn=t[27].width+"",ai,Qi,sn,Zi,un=t[27].height+"",ci,xi,kt,Je,an,$i,cn,eo,fn=t[26].toLogical(t[23]).width+"",fi,to,dn,no,pn=t[26].toLogical(t[23]).height+"",di,io,Xe,hn,oo,mn,lo,vn=t[27].toLogical(t[23]).width+"",pi,ro,_n,so,bn=t[27].toLogical(t[23]).height+"",hi,uo,Mt,Ye,gn,ao,yn,co,wn=t[24].x+"",mi,fo,kn,po,Mn=t[24].y+"",vi,ho,Ke,Tn,mo,Cn,vo,En=t[25].x+"",_i,_o,Ln,bo,Sn=t[25].y+"",bi,go,Tt,Qe,On,yo,An,wo,Dn=t[24].toLogical(t[23]).x+"",gi,ko,Wn,Mo,zn=t[24].toLogical(t[23]).y+"",yi,To,Ze,Pn,Co,Rn,Eo,In=t[25].toLogical(t[23]).x+"",wi,Lo,Nn,So,jn=t[25].toLogical(t[23]).y+"",ki,Mi,Ti,Ci,Ft,Ei,Ue,Hn,Ct,Oo,Ao,Un,Et,Do,Wo,Fn,Lt,zo,Li,Fe,qn,Po,qe,Ro,Bn,Io,xe,No,Vn,jo,$e,Si,Oi,Ai,st,ut,et,Ho,qt,Uo,at,tt,Fo,Bt,Di,qo,St=t[29],Se=[];for(let w=0;w<St.length;w+=1)Se[w]=ul(il(t,St,w));return{c(){e=s("br"),n=v(),i=s("div"),o=s("button"),o.textContent="Center",l=v(),a=s("button"),a.textContent="Minimize",f=v(),c=s("button"),c.textContent="Hide",p=v(),d=s("button"),d.textContent="Change icon",k=v(),_=s("button"),_.textContent="Request attention",y=v(),g=s("br"),b=v(),S=s("div"),z=s("label"),U=W(`Maximized
|
|
`),R=s("input"),q=v(),A=s("label"),E=W(`Resizable
|
|
`),L=s("input"),P=v(),C=s("label"),F=W(`Has decorations
|
|
`),B=s("input"),Y=v(),$=s("label"),be=W(`Always on top
|
|
`),te=s("input"),oe=v(),Q=s("label"),ge=W(`Fullscreen
|
|
`),I=s("input"),Z=v(),le=s("br"),ue=v(),ee=s("div"),_e=s("div"),ae=s("div"),ye=W(`X
|
|
`),ne=s("input"),Te=v(),Oe=s("div"),N=W(`Y
|
|
`),V=s("input"),Ie=v(),Ae=s("div"),Ce=s("div"),ce=W(`Width
|
|
`),he=s("input"),fe=v(),De=s("div"),nt=W(`Height
|
|
`),me=s("input"),de=v(),H=s("div"),ie=s("div"),X=W(`Min width
|
|
`),we=s("input"),xt=v(),mt=s("div"),$t=W(`Min height
|
|
`),Ne=s("input"),en=v(),Ve=s("div"),vt=s("div"),tn=W(`Max width
|
|
`),K=s("input"),It=v(),it=s("div"),Nt=W(`Max height
|
|
`),Pe=s("input"),_t=v(),bt=s("br"),gt=v(),We=s("div"),He=s("div"),Re=s("div"),ot=s("div"),ot.textContent="Inner Size",jt=v(),lt=s("span"),Ht=W("Width: "),yt=W(rt),Ut=v(),wt=s("span"),Ji=W("Height: "),ui=W(nn),Xi=v(),Ge=s("div"),on=s("div"),on.textContent="Outer Size",Yi=v(),ln=s("span"),Ki=W("Width: "),ai=W(rn),Qi=v(),sn=s("span"),Zi=W("Height: "),ci=W(un),xi=v(),kt=s("div"),Je=s("div"),an=s("div"),an.textContent="Inner Logical Size",$i=v(),cn=s("span"),eo=W("Width: "),fi=W(fn),to=v(),dn=s("span"),no=W("Height: "),di=W(pn),io=v(),Xe=s("div"),hn=s("div"),hn.textContent="Outer Logical Size",oo=v(),mn=s("span"),lo=W("Width: "),pi=W(vn),ro=v(),_n=s("span"),so=W("Height: "),hi=W(bn),uo=v(),Mt=s("div"),Ye=s("div"),gn=s("div"),gn.textContent="Inner Position",ao=v(),yn=s("span"),co=W("x: "),mi=W(wn),fo=v(),kn=s("span"),po=W("y: "),vi=W(Mn),ho=v(),Ke=s("div"),Tn=s("div"),Tn.textContent="Outer Position",mo=v(),Cn=s("span"),vo=W("x: "),_i=W(En),_o=v(),Ln=s("span"),bo=W("y: "),bi=W(Sn),go=v(),Tt=s("div"),Qe=s("div"),On=s("div"),On.textContent="Inner Logical Position",yo=v(),An=s("span"),wo=W("x: "),gi=W(Dn),ko=v(),Wn=s("span"),Mo=W("y: "),yi=W(zn),To=v(),Ze=s("div"),Pn=s("div"),Pn.textContent="Outer Logical Position",Co=v(),Rn=s("span"),Eo=W("x: "),wi=W(In),Lo=v(),Nn=s("span"),So=W("y: "),ki=W(jn),Mi=v(),Ti=s("br"),Ci=v(),Ft=s("h4"),Ft.textContent="Cursor",Ei=v(),Ue=s("div"),Hn=s("label"),Ct=s("input"),Oo=W(`
|
|
Grab`),Ao=v(),Un=s("label"),Et=s("input"),Do=W(`
|
|
Visible`),Wo=v(),Fn=s("label"),Lt=s("input"),zo=W(`
|
|
Ignore events`),Li=v(),Fe=s("div"),qn=s("label"),Po=W(`Icon
|
|
`),qe=s("select");for(let w=0;w<Se.length;w+=1)Se[w].c();Ro=v(),Bn=s("label"),Io=W(`X position
|
|
`),xe=s("input"),No=v(),Vn=s("label"),jo=W(`Y position
|
|
`),$e=s("input"),Si=v(),Oi=s("br"),Ai=v(),st=s("div"),ut=s("form"),et=s("input"),Ho=v(),qt=s("button"),qt.textContent="Set title",Uo=v(),at=s("form"),tt=s("input"),Fo=v(),Bt=s("button"),Bt.textContent="Open URL",u(o,"class","btn"),u(o,"title","Unminimizes after 2 seconds"),u(a,"class","btn"),u(a,"title","Unminimizes after 2 seconds"),u(c,"class","btn"),u(c,"title","Visible again after 2 seconds"),u(d,"class","btn"),u(_,"class","btn"),u(_,"title","Minimizes the window, requests attention for 3s and then resets it"),u(i,"class","flex flex-wrap gap-2"),u(R,"type","checkbox"),u(L,"type","checkbox"),u(B,"type","checkbox"),u(te,"type","checkbox"),u(I,"type","checkbox"),u(S,"class","flex flex-wrap gap-2"),u(ne,"class","input"),u(ne,"type","number"),u(ne,"min","0"),u(V,"class","input"),u(V,"type","number"),u(V,"min","0"),u(_e,"class","flex children:grow flex-col"),u(he,"class","input"),u(he,"type","number"),u(he,"min","400"),u(me,"class","input"),u(me,"type","number"),u(me,"min","400"),u(Ae,"class","flex children:grow flex-col"),u(we,"class","input"),u(we,"type","number"),u(Ne,"class","input"),u(Ne,"type","number"),u(H,"class","flex children:grow flex-col"),u(K,"class","input"),u(K,"type","number"),u(K,"min","800"),u(Pe,"class","input"),u(Pe,"type","number"),u(Pe,"min","400"),u(Ve,"class","flex children:grow flex-col"),u(ee,"class","flex flex-row gap-2 flex-wrap"),u(ot,"class","text-accent dark:text-darkAccent font-700"),u(Re,"class","grow"),u(on,"class","text-accent dark:text-darkAccent font-700"),u(Ge,"class","grow"),u(He,"class","flex"),u(an,"class","text-accent dark:text-darkAccent font-700"),u(Je,"class","grow"),u(hn,"class","text-accent dark:text-darkAccent font-700"),u(Xe,"class","grow"),u(kt,"class","flex"),u(gn,"class","text-accent dark:text-darkAccent font-700"),u(Ye,"class","grow"),u(Tn,"class","text-accent dark:text-darkAccent font-700"),u(Ke,"class","grow"),u(Mt,"class","flex"),u(On,"class","text-accent dark:text-darkAccent font-700"),u(Qe,"class","grow"),u(Pn,"class","text-accent dark:text-darkAccent font-700"),u(Ze,"class","grow"),u(Tt,"class","flex"),u(Ft,"class","mb-2"),u(Ct,"type","checkbox"),u(Et,"type","checkbox"),u(Lt,"type","checkbox"),u(Ue,"class","flex gap-2"),u(qe,"class","input"),t[19]===void 0&&Wt(()=>t[57].call(qe)),u(xe,"class","input"),u(xe,"type","number"),u($e,"class","input"),u($e,"type","number"),u(Fe,"class","flex gap-2"),u(et,"class","input grow"),u(et,"id","title"),u(qt,"class","btn"),u(qt,"type","submit"),u(ut,"class","flex gap-1"),u(tt,"class","input grow"),u(tt,"id","url"),u(Bt,"class","btn"),u(Bt,"id","open-url"),u(at,"class","flex gap-1"),u(st,"class","flex flex-col gap-1")},m(w,j){m(w,e,j),m(w,n,j),m(w,i,j),r(i,o),r(i,l),r(i,a),r(i,f),r(i,c),r(i,p),r(i,d),r(i,k),r(i,_),m(w,y,j),m(w,g,j),m(w,b,j),m(w,S,j),r(S,z),r(z,U),r(z,R),R.checked=t[3],r(S,q),r(S,A),r(A,E),r(A,L),L.checked=t[2],r(S,P),r(S,C),r(C,F),r(C,B),B.checked=t[4],r(S,Y),r(S,$),r($,be),r($,te),te.checked=t[5],r(S,oe),r(S,Q),r(Q,ge),r(Q,I),I.checked=t[6],m(w,Z,j),m(w,le,j),m(w,ue,j),m(w,ee,j),r(ee,_e),r(_e,ae),r(ae,ye),r(ae,ne),G(ne,t[13]),r(_e,Te),r(_e,Oe),r(Oe,N),r(Oe,V),G(V,t[14]),r(ee,Ie),r(ee,Ae),r(Ae,Ce),r(Ce,ce),r(Ce,he),G(he,t[7]),r(Ae,fe),r(Ae,De),r(De,nt),r(De,me),G(me,t[8]),r(ee,de),r(ee,H),r(H,ie),r(ie,X),r(ie,we),G(we,t[9]),r(H,xt),r(H,mt),r(mt,$t),r(mt,Ne),G(Ne,t[10]),r(ee,en),r(ee,Ve),r(Ve,vt),r(vt,tn),r(vt,K),G(K,t[11]),r(Ve,It),r(Ve,it),r(it,Nt),r(it,Pe),G(Pe,t[12]),m(w,_t,j),m(w,bt,j),m(w,gt,j),m(w,We,j),r(We,He),r(He,Re),r(Re,ot),r(Re,jt),r(Re,lt),r(lt,Ht),r(lt,yt),r(Re,Ut),r(Re,wt),r(wt,Ji),r(wt,ui),r(He,Xi),r(He,Ge),r(Ge,on),r(Ge,Yi),r(Ge,ln),r(ln,Ki),r(ln,ai),r(Ge,Qi),r(Ge,sn),r(sn,Zi),r(sn,ci),r(We,xi),r(We,kt),r(kt,Je),r(Je,an),r(Je,$i),r(Je,cn),r(cn,eo),r(cn,fi),r(Je,to),r(Je,dn),r(dn,no),r(dn,di),r(kt,io),r(kt,Xe),r(Xe,hn),r(Xe,oo),r(Xe,mn),r(mn,lo),r(mn,pi),r(Xe,ro),r(Xe,_n),r(_n,so),r(_n,hi),r(We,uo),r(We,Mt),r(Mt,Ye),r(Ye,gn),r(Ye,ao),r(Ye,yn),r(yn,co),r(yn,mi),r(Ye,fo),r(Ye,kn),r(kn,po),r(kn,vi),r(Mt,ho),r(Mt,Ke),r(Ke,Tn),r(Ke,mo),r(Ke,Cn),r(Cn,vo),r(Cn,_i),r(Ke,_o),r(Ke,Ln),r(Ln,bo),r(Ln,bi),r(We,go),r(We,Tt),r(Tt,Qe),r(Qe,On),r(Qe,yo),r(Qe,An),r(An,wo),r(An,gi),r(Qe,ko),r(Qe,Wn),r(Wn,Mo),r(Wn,yi),r(Tt,To),r(Tt,Ze),r(Ze,Pn),r(Ze,Co),r(Ze,Rn),r(Rn,Eo),r(Rn,wi),r(Ze,Lo),r(Ze,Nn),r(Nn,So),r(Nn,ki),m(w,Mi,j),m(w,Ti,j),m(w,Ci,j),m(w,Ft,j),m(w,Ei,j),m(w,Ue,j),r(Ue,Hn),r(Hn,Ct),Ct.checked=t[15],r(Hn,Oo),r(Ue,Ao),r(Ue,Un),r(Un,Et),Et.checked=t[16],r(Un,Do),r(Ue,Wo),r(Ue,Fn),r(Fn,Lt),Lt.checked=t[20],r(Fn,zo),m(w,Li,j),m(w,Fe,j),r(Fe,qn),r(qn,Po),r(qn,qe);for(let ke=0;ke<Se.length;ke+=1)Se[ke].m(qe,null);Dt(qe,t[19]),r(Fe,Ro),r(Fe,Bn),r(Bn,Io),r(Bn,xe),G(xe,t[17]),r(Fe,No),r(Fe,Vn),r(Vn,jo),r(Vn,$e),G($e,t[18]),m(w,Si,j),m(w,Oi,j),m(w,Ai,j),m(w,st,j),r(st,ut),r(ut,et),G(et,t[28]),r(ut,Ho),r(ut,qt),r(st,Uo),r(st,at),r(at,tt),G(tt,t[22]),r(at,Fo),r(at,Bt),Di||(qo=[D(o,"click",t[40]),D(a,"click",t[33]),D(c,"click",t[32]),D(d,"click",t[34]),D(_,"click",t[36]),D(R,"change",t[41]),D(L,"change",t[42]),D(B,"change",t[43]),D(te,"change",t[44]),D(I,"change",t[45]),D(ne,"input",t[46]),D(V,"input",t[47]),D(he,"input",t[48]),D(me,"input",t[49]),D(we,"input",t[50]),D(Ne,"input",t[51]),D(K,"input",t[52]),D(Pe,"input",t[53]),D(Ct,"change",t[54]),D(Et,"change",t[55]),D(Lt,"change",t[56]),D(qe,"change",t[57]),D(xe,"input",t[58]),D($e,"input",t[59]),D(et,"input",t[60]),D(ut,"submit",xn(t[31])),D(tt,"input",t[61]),D(at,"submit",xn(t[30]))],Di=!0)},p(w,j){if(j[0]&8&&(R.checked=w[3]),j[0]&4&&(L.checked=w[2]),j[0]&16&&(B.checked=w[4]),j[0]&32&&(te.checked=w[5]),j[0]&64&&(I.checked=w[6]),j[0]&8192&&re(ne.value)!==w[13]&&G(ne,w[13]),j[0]&16384&&re(V.value)!==w[14]&&G(V,w[14]),j[0]&128&&re(he.value)!==w[7]&&G(he,w[7]),j[0]&256&&re(me.value)!==w[8]&&G(me,w[8]),j[0]&512&&re(we.value)!==w[9]&&G(we,w[9]),j[0]&1024&&re(Ne.value)!==w[10]&&G(Ne,w[10]),j[0]&2048&&re(K.value)!==w[11]&&G(K,w[11]),j[0]&4096&&re(Pe.value)!==w[12]&&G(Pe,w[12]),j[0]&67108864&&rt!==(rt=w[26].width+"")&&x(yt,rt),j[0]&67108864&&nn!==(nn=w[26].height+"")&&x(ui,nn),j[0]&134217728&&rn!==(rn=w[27].width+"")&&x(ai,rn),j[0]&134217728&&un!==(un=w[27].height+"")&&x(ci,un),j[0]&75497472&&fn!==(fn=w[26].toLogical(w[23]).width+"")&&x(fi,fn),j[0]&75497472&&pn!==(pn=w[26].toLogical(w[23]).height+"")&&x(di,pn),j[0]&142606336&&vn!==(vn=w[27].toLogical(w[23]).width+"")&&x(pi,vn),j[0]&142606336&&bn!==(bn=w[27].toLogical(w[23]).height+"")&&x(hi,bn),j[0]&16777216&&wn!==(wn=w[24].x+"")&&x(mi,wn),j[0]&16777216&&Mn!==(Mn=w[24].y+"")&&x(vi,Mn),j[0]&33554432&&En!==(En=w[25].x+"")&&x(_i,En),j[0]&33554432&&Sn!==(Sn=w[25].y+"")&&x(bi,Sn),j[0]&25165824&&Dn!==(Dn=w[24].toLogical(w[23]).x+"")&&x(gi,Dn),j[0]&25165824&&zn!==(zn=w[24].toLogical(w[23]).y+"")&&x(yi,zn),j[0]&41943040&&In!==(In=w[25].toLogical(w[23]).x+"")&&x(wi,In),j[0]&41943040&&jn!==(jn=w[25].toLogical(w[23]).y+"")&&x(ki,jn),j[0]&32768&&(Ct.checked=w[15]),j[0]&65536&&(Et.checked=w[16]),j[0]&1048576&&(Lt.checked=w[20]),j[0]&536870912){St=w[29];let ke;for(ke=0;ke<St.length;ke+=1){const Bo=il(w,St,ke);Se[ke]?Se[ke].p(Bo,j):(Se[ke]=ul(Bo),Se[ke].c(),Se[ke].m(qe,null))}for(;ke<Se.length;ke+=1)Se[ke].d(1);Se.length=St.length}j[0]&537395200&&Dt(qe,w[19]),j[0]&131072&&re(xe.value)!==w[17]&&G(xe,w[17]),j[0]&262144&&re($e.value)!==w[18]&&G($e,w[18]),j[0]&268435456&&et.value!==w[28]&&G(et,w[28]),j[0]&4194304&&tt.value!==w[22]&&G(tt,w[22])},d(w){w&&h(e),w&&h(n),w&&h(i),w&&h(y),w&&h(g),w&&h(b),w&&h(S),w&&h(Z),w&&h(le),w&&h(ue),w&&h(ee),w&&h(_t),w&&h(bt),w&&h(gt),w&&h(We),w&&h(Mi),w&&h(Ti),w&&h(Ci),w&&h(Ft),w&&h(Ei),w&&h(Ue),w&&h(Li),w&&h(Fe),pt(Se,w),w&&h(Si),w&&h(Oi),w&&h(Ai),w&&h(st),Di=!1,pe(qo)}}}function ul(t){let e,n=t[67]+"",i,o;return{c(){e=s("option"),i=W(n),e.__value=o=t[67],e.value=e.__value},m(l,a){m(l,e,a),r(e,i)},p:J,d(l){l&&h(e)}}}function fs(t){let e,n,i,o,l,a,f,c,p=Object.keys(t[1]).length>=1,d,k,_,y=p&&ll(t),g=t[1][t[0]]&&sl(t);return{c(){e=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="New window",a=v(),f=s("br"),c=v(),y&&y.c(),d=v(),g&&g.c(),u(i,"class","input grow"),u(i,"type","text"),u(i,"placeholder","New Window label.."),u(l,"class","btn"),u(n,"class","flex gap-1"),u(e,"class","flex flex-col children:grow gap-2")},m(b,S){m(b,e,S),r(e,n),r(n,i),G(i,t[21]),r(n,o),r(n,l),r(e,a),r(e,f),r(e,c),y&&y.m(e,null),r(e,d),g&&g.m(e,null),k||(_=[D(i,"input",t[38]),D(l,"click",t[35])],k=!0)},p(b,S){S[0]&2097152&&i.value!==b[21]&&G(i,b[21]),S[0]&2&&(p=Object.keys(b[1]).length>=1),p?y?y.p(b,S):(y=ll(b),y.c(),y.m(e,d)):y&&(y.d(1),y=null),b[1][b[0]]?g?g.p(b,S):(g=sl(b),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),y&&y.d(),g&&g.d(),k=!1,pe(_)}}}function ds(t,e,n){let i=Be.label;const o={[Be.label]:Be},l=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"];let{onMessage:a}=e,f,c="https://tauri.app",p=!0,d=!1,k=!0,_=!1,y=!1,g=null,b=null,S=null,z=null,U=null,R=null,q=null,A=null,E=1,L=new dt(q,A),P=new dt(q,A),C=new At(g,b),F=new At(g,b),B,Y,$=!1,be=!0,te=null,oe=null,Q="default",ge=!1,I="Awesome Tauri Example!";function Z(){Ui(c)}function le(){o[i].setTitle(I)}function ue(){o[i].hide(),setTimeout(o[i].show,2e3)}function ee(){o[i].minimize(),setTimeout(o[i].unminimize,2e3)}function _e(){Bi({multiple:!1}).then(K=>{typeof K=="string"&&o[i].setIcon(K)})}function ae(){if(!f)return;const K=new zt(f);n(1,o[f]=K,o),K.once("tauri://error",function(){a("Error creating new webview")})}function ye(){o[i].innerSize().then(K=>{n(26,C=K),n(7,g=C.width),n(8,b=C.height)}),o[i].outerSize().then(K=>{n(27,F=K)})}function ne(){o[i].innerPosition().then(K=>{n(24,L=K)}),o[i].outerPosition().then(K=>{n(25,P=K),n(13,q=P.x),n(14,A=P.y)})}async function Te(K){!K||(B&&B(),Y&&Y(),Y=await K.listen("tauri://move",ne),B=await K.listen("tauri://resize",ye))}async function Oe(){await o[i].minimize(),await o[i].requestUserAttention(Qt.Critical),await new Promise(K=>setTimeout(K,3e3)),await o[i].requestUserAttention(null)}function N(){f=this.value,n(21,f)}function V(){i=Pi(this),n(0,i),n(1,o)}const Ie=()=>o[i].center();function Ae(){d=this.checked,n(3,d)}function Ce(){p=this.checked,n(2,p)}function ce(){k=this.checked,n(4,k)}function he(){_=this.checked,n(5,_)}function fe(){y=this.checked,n(6,y)}function De(){q=re(this.value),n(13,q)}function nt(){A=re(this.value),n(14,A)}function me(){g=re(this.value),n(7,g)}function de(){b=re(this.value),n(8,b)}function H(){S=re(this.value),n(9,S)}function ie(){z=re(this.value),n(10,z)}function X(){U=re(this.value),n(11,U)}function we(){R=re(this.value),n(12,R)}function xt(){$=this.checked,n(15,$)}function mt(){be=this.checked,n(16,be)}function $t(){ge=this.checked,n(20,ge)}function Ne(){Q=Pi(this),n(19,Q),n(29,l)}function en(){te=re(this.value),n(17,te)}function Ve(){oe=re(this.value),n(18,oe)}function vt(){I=this.value,n(28,I)}function tn(){c=this.value,n(22,c)}return t.$$set=K=>{"onMessage"in K&&n(37,a=K.onMessage)},t.$$.update=()=>{var K,It,it,Nt,Pe,_t,bt,gt,We,He,Re,ot,jt,lt,Ht,rt,yt,Ut;t.$$.dirty[0]&3&&(o[i],ne(),ye()),t.$$.dirty[0]&7&&((K=o[i])==null||K.setResizable(p)),t.$$.dirty[0]&11&&(d?(It=o[i])==null||It.maximize():(it=o[i])==null||it.unmaximize()),t.$$.dirty[0]&19&&((Nt=o[i])==null||Nt.setDecorations(k)),t.$$.dirty[0]&35&&((Pe=o[i])==null||Pe.setAlwaysOnTop(_)),t.$$.dirty[0]&67&&((_t=o[i])==null||_t.setFullscreen(y)),t.$$.dirty[0]&387&&g&&b&&((bt=o[i])==null||bt.setSize(new At(g,b))),t.$$.dirty[0]&1539&&(S&&z?(gt=o[i])==null||gt.setMinSize(new ni(S,z)):(We=o[i])==null||We.setMinSize(null)),t.$$.dirty[0]&6147&&(U>800&&R>400?(He=o[i])==null||He.setMaxSize(new ni(U,R)):(Re=o[i])==null||Re.setMaxSize(null)),t.$$.dirty[0]&24579&&q!==null&&A!==null&&((ot=o[i])==null||ot.setPosition(new dt(q,A))),t.$$.dirty[0]&3&&((jt=o[i])==null||jt.scaleFactor().then(wt=>n(23,E=wt))),t.$$.dirty[0]&3&&Te(o[i]),t.$$.dirty[0]&32771&&((lt=o[i])==null||lt.setCursorGrab($)),t.$$.dirty[0]&65539&&((Ht=o[i])==null||Ht.setCursorVisible(be)),t.$$.dirty[0]&524291&&((rt=o[i])==null||rt.setCursorIcon(Q)),t.$$.dirty[0]&393219&&te!==null&&oe!==null&&((yt=o[i])==null||yt.setCursorPosition(new dt(te,oe))),t.$$.dirty[0]&1048579&&((Ut=o[i])==null||Ut.setIgnoreCursorEvents(ge))},[i,o,p,d,k,_,y,g,b,S,z,U,R,q,A,$,be,te,oe,Q,ge,f,c,E,L,P,C,F,I,l,Z,le,ue,ee,_e,ae,Oe,a,N,V,Ie,Ae,Ce,ce,he,fe,De,nt,me,de,H,ie,X,we,xt,mt,$t,Ne,en,Ve,vt,tn]}class ps extends Le{constructor(e){super(),Ee(this,e,ds,fs,Me,{onMessage:37},null,[-1,-1,-1])}}function Ql(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:ht(e)}})]})})}function hs(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,O({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:ht(e)}})]})})}function ms(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,O({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]})})}function Zl(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,O({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]})})}function xl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:Ql,registerAll:hs,isRegistered:ms,unregister:Zl,unregisterAll:xl});function al(t,e,n){const i=t.slice();return i[9]=e[n],i}function cl(t){let e,n=t[9]+"",i,o,l,a,f;function c(){return t[8](t[9])}return{c(){e=s("div"),i=W(n),o=v(),l=s("button"),l.textContent="Unregister",u(l,"class","btn"),u(l,"type","button"),u(e,"class","flex justify-between")},m(p,d){m(p,e,d),r(e,i),r(e,o),r(e,l),a||(f=D(l,"click",c),a=!0)},p(p,d){t=p,d&2&&n!==(n=t[9]+"")&&x(i,n)},d(p){p&&h(e),a=!1,f()}}}function fl(t){let e,n,i,o,l;return{c(){e=s("br"),n=v(),i=s("button"),i.textContent="Unregister all",u(i,"class","btn"),u(i,"type","button")},m(a,f){m(a,e,f),m(a,n,f),m(a,i,f),o||(l=D(i,"click",t[5]),o=!0)},p:J,d(a){a&&h(e),a&&h(n),a&&h(i),o=!1,l()}}}function vs(t){let e,n,i,o,l,a,f,c,p,d,k,_=t[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=cl(al(t,_,b));let g=t[1].length>1&&fl(t);return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Register",l=v(),a=s("br"),f=v(),c=s("div");for(let b=0;b<y.length;b+=1)y[b].c();p=v(),g&&g.c(),u(n,"class","input grow"),u(n,"placeholder","Type a shortcut with '+' as separator..."),u(o,"class","btn"),u(o,"type","button"),u(e,"class","flex gap-1"),u(c,"class","flex flex-col gap-1")},m(b,S){m(b,e,S),r(e,n),G(n,t[0]),r(e,i),r(e,o),m(b,l,S),m(b,a,S),m(b,f,S),m(b,c,S);for(let z=0;z<y.length;z+=1)y[z].m(c,null);r(c,p),g&&g.m(c,null),d||(k=[D(n,"input",t[7]),D(o,"click",t[3])],d=!0)},p(b,[S]){if(S&1&&n.value!==b[0]&&G(n,b[0]),S&18){_=b[1];let z;for(z=0;z<_.length;z+=1){const U=al(b,_,z);y[z]?y[z].p(U,S):(y[z]=cl(U),y[z].c(),y[z].m(c,p))}for(;z<y.length;z+=1)y[z].d(1);y.length=_.length}b[1].length>1?g?g.p(b,S):(g=fl(b),g.c(),g.m(c,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),b&&h(l),b&&h(a),b&&h(f),b&&h(c),pt(y,b),g&&g.d(),d=!1,pe(k)}}}function _s(t,e,n){let i,{onMessage:o}=e;const l=Cl([]);kl(t,l,_=>n(1,i=_));let a="CmdOrControl+X";function f(){const _=a;Ql(_,()=>{o(`Shortcut ${_} triggered`)}).then(()=>{l.update(y=>[...y,_]),o(`Shortcut ${_} registered successfully`)}).catch(o)}function c(_){const y=_;Zl(y).then(()=>{l.update(g=>g.filter(b=>b!==y)),o(`Shortcut ${y} unregistered`)}).catch(o)}function p(){xl().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function d(){a=this.value,n(0,a)}const k=_=>c(_);return t.$$set=_=>{"onMessage"in _&&n(6,o=_.onMessage)},[a,i,l,f,c,p,o,d,k]}class bs extends Le{constructor(e){super(),Ee(this,e,_s,vs,Me,{onMessage:6})}}function dl(t){let e,n,i,o,l,a,f;return{c(){e=s("br"),n=v(),i=s("input"),o=v(),l=s("button"),l.textContent="Write",u(i,"class","input"),u(i,"placeholder","write to stdin"),u(l,"class","btn")},m(c,p){m(c,e,p),m(c,n,p),m(c,i,p),G(i,t[4]),m(c,o,p),m(c,l,p),a||(f=[D(i,"input",t[14]),D(l,"click",t[8])],a=!0)},p(c,p){p&16&&i.value!==c[4]&&G(i,c[4])},d(c){c&&h(e),c&&h(n),c&&h(i),c&&h(o),c&&h(l),a=!1,pe(f)}}}function gs(t){let e,n,i,o,l,a,f,c,p,d,k,_,y,g,b,S,z,U,R,q,A,E,L,P,C=t[5]&&dl(t);return{c(){e=s("div"),n=s("div"),i=W(`Script:
|
|
`),o=s("input"),l=v(),a=s("div"),f=W(`Encoding:
|
|
`),c=s("input"),p=v(),d=s("div"),k=W(`Working directory:
|
|
`),_=s("input"),y=v(),g=s("div"),b=W(`Arguments:
|
|
`),S=s("input"),z=v(),U=s("div"),R=s("button"),R.textContent="Run",q=v(),A=s("button"),A.textContent="Kill",E=v(),C&&C.c(),u(o,"class","grow input"),u(n,"class","flex items-center gap-1"),u(c,"class","grow input"),u(a,"class","flex items-center gap-1"),u(_,"class","grow input"),u(_,"placeholder","Working directory"),u(d,"class","flex items-center gap-1"),u(S,"class","grow input"),u(S,"placeholder","Environment variables"),u(g,"class","flex items-center gap-1"),u(R,"class","btn"),u(A,"class","btn"),u(U,"class","flex children:grow gap-1"),u(e,"class","flex flex-col childre:grow gap-1")},m(F,B){m(F,e,B),r(e,n),r(n,i),r(n,o),G(o,t[0]),r(e,l),r(e,a),r(a,f),r(a,c),G(c,t[3]),r(e,p),r(e,d),r(d,k),r(d,_),G(_,t[1]),r(e,y),r(e,g),r(g,b),r(g,S),G(S,t[2]),r(e,z),r(e,U),r(U,R),r(U,q),r(U,A),r(e,E),C&&C.m(e,null),L||(P=[D(o,"input",t[10]),D(c,"input",t[11]),D(_,"input",t[12]),D(S,"input",t[13]),D(R,"click",t[6]),D(A,"click",t[7])],L=!0)},p(F,[B]){B&1&&o.value!==F[0]&&G(o,F[0]),B&8&&c.value!==F[3]&&G(c,F[3]),B&2&&_.value!==F[1]&&G(_,F[1]),B&4&&S.value!==F[2]&&G(S,F[2]),F[5]?C?C.p(F,B):(C=dl(F),C.c(),C.m(e,null)):C&&(C.d(1),C=null)},i:J,o:J,d(F){F&&h(e),C&&C.d(),L=!1,pe(P)}}}function ys(t,e,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:a}=e,f='echo "hello world"',c=null,p="SOMETHING=value ANOTHER=2",d="",k="",_;function y(){return p.split(" ").reduce((E,L)=>{let[P,C]=L.split("=");return{...E,[P]:C}},{})}function g(){n(5,_=null);const E=new Sl(o,[...l,f],{cwd:c||null,env:y(),encoding:d});E.on("close",L=>{a(`command finished with code ${L.code} and signal ${L.signal}`),n(5,_=null)}),E.on("error",L=>a(`command error: "${L}"`)),E.stdout.on("data",L=>a(`command stdout: "${L}"`)),E.stderr.on("data",L=>a(`command stderr: "${L}"`)),E.spawn().then(L=>{n(5,_=L)}).catch(a)}function b(){_.kill().then(()=>a("killed child process")).catch(a)}function S(){_.write(k).catch(a)}function z(){f=this.value,n(0,f)}function U(){d=this.value,n(3,d)}function R(){c=this.value,n(1,c)}function q(){p=this.value,n(2,p)}function A(){k=this.value,n(4,k)}return t.$$set=E=>{"onMessage"in E&&n(9,a=E.onMessage)},[f,c,p,d,k,_,g,b,S,a,z,U,R,q,A]}class ws extends Le{constructor(e){super(),Ee(this,e,ys,gs,Me,{onMessage:9})}}function Gi(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,Zt(ve.STATUS_UPDATE,function(n){t(n==null?void 0:n.payload)})]})})}function $l(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return T(this,function(n){return[2,new Promise(function(i,o){Gi(function(l){return l.error?(t(),o(l.error)):l.status==="DONE"?(t(),i()):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),si(ve.INSTALL_UPDATE).catch(function(l){throw t(),l})})]})})}function er(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return T(this,function(n){return[2,new Promise(function(i,o){Wl(ve.UPDATE_AVAILABLE,function(l){var a;a=l==null?void 0:l.payload,t(),i({manifest:a,shouldUpdate:!0})}).catch(function(l){throw t(),l}),Gi(function(l){return l.error?(t(),o(l.error)):l.status==="UPTODATE"?(t(),i({shouldUpdate:!1})):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),si(ve.CHECK_UPDATE).catch(function(l){throw t(),l})})]})})}Object.freeze({__proto__:null,onUpdaterEvent:Gi,installUpdate:$l,checkUpdate:er});function ks(t){let e;return{c(){e=s("button"),e.innerHTML='<div class="spinner animate-spin svelte-4xesec"></div>',u(e,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,e,i)},p:J,d(n){n&&h(e)}}}function Ms(t){let e,n,i;return{c(){e=s("button"),e.textContent="Install update",u(e,"class","btn")},m(o,l){m(o,e,l),n||(i=D(e,"click",t[4]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function Ts(t){let e,n,i;return{c(){e=s("button"),e.textContent="Check update",u(e,"class","btn")},m(o,l){m(o,e,l),n||(i=D(e,"click",t[3]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function Cs(t){let e;function n(l,a){return!l[0]&&!l[2]?Ts:!l[1]&&l[2]?Ms:ks}let i=n(t),o=i(t);return{c(){e=s("div"),o.c(),u(e,"class","flex children:grow children:h10")},m(l,a){m(l,e,a),o.m(e,null)},p(l,[a]){i===(i=n(l))&&o?o.p(l,a):(o.d(1),o=i(l),o&&(o.c(),o.m(e,null)))},i:J,o:J,d(l){l&&h(e),o.d()}}}function Es(t,e,n){let{onMessage:i}=e,o;ct(async()=>{o=await Zt("tauri://update-status",i)}),ji(()=>{o&&o()});let l,a,f;async function c(){n(0,l=!0);try{const{shouldUpdate:d,manifest:k}=await er();i(`Should update: ${d}`),i(k),n(2,f=d)}catch(d){i(d)}finally{n(0,l=!1)}}async function p(){n(1,a=!0);try{await $l(),i("Installation complete, restart required."),await qi()}catch(d){i(d)}finally{n(1,a=!1)}}return t.$$set=d=>{"onMessage"in d&&n(5,i=d.onMessage)},[l,a,f,c,p,i]}class Ls extends Le{constructor(e){super(),Ee(this,e,Es,Cs,Me,{onMessage:5})}}function tr(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,O({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}})]})})}function nr(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,O({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})]})})}Object.freeze({__proto__:null,writeText:tr,readText:nr});function Ss(t){let e,n,i,o,l,a,f,c;return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Write",l=v(),a=s("button"),a.textContent="Read",u(n,"class","grow input"),u(n,"placeholder","Text to write to the clipboard"),u(o,"class","btn"),u(o,"type","button"),u(a,"class","btn"),u(a,"type","button"),u(e,"class","flex gap-1")},m(p,d){m(p,e,d),r(e,n),G(n,t[0]),r(e,i),r(e,o),r(e,l),r(e,a),f||(c=[D(n,"input",t[4]),D(o,"click",t[1]),D(a,"click",t[2])],f=!0)},p(p,[d]){d&1&&n.value!==p[0]&&G(n,p[0])},i:J,o:J,d(p){p&&h(e),f=!1,pe(c)}}}function Os(t,e,n){let{onMessage:i}=e,o="clipboard message";function l(){tr(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function a(){nr().then(c=>{i(`Clipboard contents: ${c}`)}).catch(i)}function f(){o=this.value,n(0,o)}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,l,a,i,f]}class As extends Le{constructor(e){super(),Ee(this,e,Os,Ss,Me,{onMessage:3})}}function Ds(t){let e;return{c(){e=s("div"),e.innerHTML=`<div class="note-red grow">Not available for Linux</div>
|
|
<video id="localVideo" autoplay="" playsinline=""><track kind="captions"/></video>`,u(e,"class","flex flex-col gap-2")},m(n,i){m(n,e,i)},p:J,i:J,o:J,d(n){n&&h(e)}}}function Ws(t,e,n){let{onMessage:i}=e;const o=window.constraints={audio:!0,video:!0};function l(f){const c=document.querySelector("video"),p=f.getVideoTracks();i("Got stream with constraints:",o),i(`Using video device: ${p[0].label}`),window.stream=f,c.srcObject=f}function a(f){if(f.name==="ConstraintNotSatisfiedError"){const c=o.video;i(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else f.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: ${f.name}`,f)}return ct(async()=>{try{const f=await navigator.mediaDevices.getUserMedia(o);l(f)}catch(f){a(f)}}),ji(()=>{window.stream.getTracks().forEach(function(f){f.stop()})}),t.$$set=f=>{"onMessage"in f&&n(0,i=f.onMessage)},[i]}class zs extends Le{constructor(e){super(),Ee(this,e,Ws,Ds,Me,{onMessage:0})}}function pl(t,e,n){const i=t.slice();return i[32]=e[n],i}function hl(t,e,n){const i=t.slice();return i[35]=e[n],i}function ml(t){let e,n,i,o,l,a,f,c,p,d,k,_,y,g,b;function S(E,L){return E[3]?Rs:Ps}let z=S(t),U=z(t);function R(E,L){return E[2]?Ns:Is}let q=R(t),A=q(t);return{c(){e=s("div"),n=s("span"),n.textContent="Tauri API Validation",i=v(),o=s("span"),l=s("span"),U.c(),f=v(),c=s("span"),c.innerHTML='<div class="i-codicon-chrome-minimize"></div>',p=v(),d=s("span"),A.c(),_=v(),y=s("span"),y.innerHTML='<div class="i-codicon-chrome-close"></div>',u(n,"class","lt-sm:pl-10 text-darkPrimaryText"),u(l,"title",a=t[3]?"Switch to Light mode":"Switch to Dark mode"),u(l,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),u(c,"title","Minimize"),u(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),u(d,"title",k=t[2]?"Restore":"Maximize"),u(d,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),u(y,"title","Close"),u(y,"class","hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText "),u(o,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),u(e,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),u(e,"data-tauri-drag-region","")},m(E,L){m(E,e,L),r(e,n),r(e,i),r(e,o),r(o,l),U.m(l,null),r(o,f),r(o,c),r(o,p),r(o,d),A.m(d,null),r(o,_),r(o,y),g||(b=[D(l,"click",t[12]),D(c,"click",t[9]),D(d,"click",t[10]),D(y,"click",t[11])],g=!0)},p(E,L){z!==(z=S(E))&&(U.d(1),U=z(E),U&&(U.c(),U.m(l,null))),L[0]&8&&a!==(a=E[3]?"Switch to Light mode":"Switch to Dark mode")&&u(l,"title",a),q!==(q=R(E))&&(A.d(1),A=q(E),A&&(A.c(),A.m(d,null))),L[0]&4&&k!==(k=E[2]?"Restore":"Maximize")&&u(d,"title",k)},d(E){E&&h(e),U.d(),A.d(),g=!1,pe(b)}}}function Ps(t){let e;return{c(){e=s("div"),u(e,"class","i-ph-moon")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Rs(t){let e;return{c(){e=s("div"),u(e,"class","i-ph-sun")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Is(t){let e;return{c(){e=s("div"),u(e,"class","i-codicon-chrome-maximize")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Ns(t){let e;return{c(){e=s("div"),u(e,"class","i-codicon-chrome-restore")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function js(t){let e;return{c(){e=s("span"),u(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Hs(t){let e;return{c(){e=s("span"),u(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function vl(t){let e,n,i,o,l,a,f,c,p;function d(y,g){return y[3]?Fs:Us}let k=d(t),_=k(t);return{c(){e=s("a"),_.c(),n=v(),i=s("br"),o=v(),l=s("div"),a=v(),f=s("br"),u(e,"href","##"),u(e,"class","nv justify-between h-8"),u(l,"class","bg-white/5 h-2px")},m(y,g){m(y,e,g),_.m(e,null),m(y,n,g),m(y,i,g),m(y,o,g),m(y,l,g),m(y,a,g),m(y,f,g),c||(p=D(e,"click",t[12]),c=!0)},p(y,g){k!==(k=d(y))&&(_.d(1),_=k(y),_&&(_.c(),_.m(e,null)))},d(y){y&&h(e),_.d(),y&&h(n),y&&h(i),y&&h(o),y&&h(l),y&&h(a),y&&h(f),c=!1,p()}}}function Us(t){let e,n;return{c(){e=W(`Switch to Dark mode
|
|
`),n=s("div"),u(n,"class","i-ph-moon")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function Fs(t){let e,n;return{c(){e=W(`Switch to Light mode
|
|
`),n=s("div"),u(n,"class","i-ph-sun")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function qs(t){let e,n,i,o,l,a=t[35].label+"",f,c,p,d;function k(){return t[20](t[35])}return{c(){e=s("a"),n=s("div"),o=v(),l=s("p"),f=W(a),u(n,"class",i=t[35].icon+" mr-2"),u(e,"href","##"),u(e,"class",c="nv "+(t[1]===t[35]?"nv_selected":""))},m(_,y){m(_,e,y),r(e,n),r(e,o),r(e,l),r(l,f),p||(d=D(e,"click",k),p=!0)},p(_,y){t=_,y[0]&2&&c!==(c="nv "+(t[1]===t[35]?"nv_selected":""))&&u(e,"class",c)},d(_){_&&h(e),p=!1,d()}}}function _l(t){let e,n=t[35]&&qs(t);return{c(){n&&n.c(),e=oi()},m(i,o){n&&n.m(i,o),m(i,e,o)},p(i,o){i[35]&&n.p(i,o)},d(i){n&&n.d(i),i&&h(e)}}}function bl(t){let e,n=t[32].html+"",i;return{c(){e=new cr(!1),i=oi(),e.a=i},m(o,l){e.m(n,o,l),m(o,i,l)},p(o,l){l[0]&64&&n!==(n=o[32].html+"")&&e.p(n)},d(o){o&&h(i),o&&e.d()}}}function Bs(t){let e,n,i,o,l,a,f,c,p,d,k,_,y,g,b,S,z,U,R,q,A,E,L,P,C,F,B,Y=t[1].label+"",$,be,te,oe,Q,ge,I,Z,le,ue,ee,_e,ae,ye,ne,Te,Oe,N,V=t[5]&&ml(t);function Ie(H,ie){return H[0]?Hs:js}let Ae=Ie(t),Ce=Ae(t),ce=!t[5]&&vl(t),he=t[7],fe=[];for(let H=0;H<he.length;H+=1)fe[H]=_l(hl(t,he,H));var De=t[1].component;function nt(H){return{props:{onMessage:H[14],insecureRenderHtml:H[15]}}}De&&(Q=new De(nt(t)));let me=t[6],de=[];for(let H=0;H<me.length;H+=1)de[H]=bl(pl(t,me,H));return{c(){V&&V.c(),e=v(),n=s("div"),Ce.c(),i=v(),o=s("div"),l=s("aside"),a=s("img"),c=v(),ce&&ce.c(),p=v(),d=s("a"),d.innerHTML=`Documentation
|
|
<span class="i-codicon-link-external"></span>`,k=v(),_=s("a"),_.innerHTML=`GitHub
|
|
<span class="i-codicon-link-external"></span>`,y=v(),g=s("a"),g.innerHTML=`Source
|
|
<span class="i-codicon-link-external"></span>`,b=v(),S=s("br"),z=v(),U=s("div"),R=v(),q=s("br"),A=v(),E=s("div");for(let H=0;H<fe.length;H+=1)fe[H].c();P=v(),C=s("main"),F=s("div"),B=s("h1"),$=W(Y),be=v(),te=s("div"),oe=s("div"),Q&&ei(Q.$$.fragment),ge=v(),I=s("div"),Z=s("div"),le=v(),ue=s("div"),ee=s("p"),ee.textContent="Console",_e=v(),ae=s("div"),ae.innerHTML='<div class="i-codicon-clear-all"></div>',ye=v(),ne=s("div");for(let H=0;H<de.length;H+=1)de[H].c();u(n,"id","sidebarToggle"),u(n,"class","z-2000 display-none lt-sm:flex justify-center items-center absolute top-2 left-2 w-8 h-8 rd-8 bg-accent dark:bg-darkAccent active:bg-accentDark dark:active:bg-darkAccentDark"),u(a,"class","self-center p-7 cursor-pointer"),lr(a.src,f="tauri_logo.png")||u(a,"src",f),u(a,"alt","Tauri logo"),u(d,"class","nv justify-between h-8"),u(d,"target","_blank"),u(d,"href","https://tauri.app/v1/guides/"),u(_,"class","nv justify-between h-8"),u(_,"target","_blank"),u(_,"href","https://github.com/tauri-apps/tauri"),u(g,"class","nv justify-between h-8"),u(g,"target","_blank"),u(g,"href","https://github.com/tauri-apps/tauri/tree/dev/examples/api"),u(U,"class","bg-white/5 h-2px"),u(E,"class","flex flex-col overflow-y-auto children-h-10 children-flex-none gap-1"),u(l,"id","sidebar"),u(l,"class",L="lt-sm:h-screen lt-sm:shadow-lg lt-sm:shadow lt-sm:transition-transform lt-sm:absolute lt-sm:z-1999 "+(t[5]?"bg-darkPrimaryLighter/60 lt-sm:bg-darkPrimaryLighter":"bg-darkPrimaryLighter")+" transition-colors-250 overflow-hidden grid select-none px-2"),u(oe,"class","mr-2"),u(te,"class","overflow-y-auto"),u(F,"class","px-5 overflow-hidden grid grid-rows-[auto_1fr]"),u(Z,"class","bg-black/20 h-2px cursor-ns-resize"),u(ee,"class","font-semibold"),u(ae,"class","cursor-pointer h-85% rd-1 p-1 flex justify-center items-center hover:bg-hoverOverlay dark:hover:bg-darkHoverOverlay active:bg-hoverOverlay/25 dark:active:bg-darkHoverOverlay/25 "),u(ue,"class","flex justify-between items-center px-2"),u(ne,"class","px-2 overflow-y-auto all:font-mono code-block all:text-xs"),u(I,"id","console"),u(I,"class","select-none h-15rem grid grid-rows-[2px_2rem_1fr] gap-1 overflow-hidden"),u(C,"class","flex-1 bg-primary dark:bg-darkPrimary transition-transform transition-colors-250 grid grid-rows-[2fr_auto]"),u(o,"class","flex h-screen w-screen overflow-hidden children-pt8 children-pb-2 text-primaryText dark:text-darkPrimaryText")},m(H,ie){V&&V.m(H,ie),m(H,e,ie),m(H,n,ie),Ce.m(n,null),m(H,i,ie),m(H,o,ie),r(o,l),r(l,a),r(l,c),ce&&ce.m(l,null),r(l,p),r(l,d),r(l,k),r(l,_),r(l,y),r(l,g),r(l,b),r(l,S),r(l,z),r(l,U),r(l,R),r(l,q),r(l,A),r(l,E);for(let X=0;X<fe.length;X+=1)fe[X].m(E,null);r(o,P),r(o,C),r(C,F),r(F,B),r(B,$),r(F,be),r(F,te),r(te,oe),Q&&Yt(Q,oe,null),r(C,ge),r(C,I),r(I,Z),r(I,le),r(I,ue),r(ue,ee),r(ue,_e),r(ue,ae),r(I,ye),r(I,ne);for(let X=0;X<de.length;X+=1)de[X].m(ne,null);t[21](I),Te=!0,Oe||(N=[D(a,"click",t[19]),D(Z,"mousedown",t[17]),D(ae,"click",t[16])],Oe=!0)},p(H,ie){if(H[5]?V?V.p(H,ie):(V=ml(H),V.c(),V.m(e.parentNode,e)):V&&(V.d(1),V=null),Ae!==(Ae=Ie(H))&&(Ce.d(1),Ce=Ae(H),Ce&&(Ce.c(),Ce.m(n,null))),H[5]?ce&&(ce.d(1),ce=null):ce?ce.p(H,ie):(ce=vl(H),ce.c(),ce.m(l,p)),ie[0]&387){he=H[7];let X;for(X=0;X<he.length;X+=1){const we=hl(H,he,X);fe[X]?fe[X].p(we,ie):(fe[X]=_l(we),fe[X].c(),fe[X].m(E,null))}for(;X<fe.length;X+=1)fe[X].d(1);fe.length=he.length}if((!Te||ie[0]&32&&L!==(L="lt-sm:h-screen lt-sm:shadow-lg lt-sm:shadow lt-sm:transition-transform lt-sm:absolute lt-sm:z-1999 "+(H[5]?"bg-darkPrimaryLighter/60 lt-sm:bg-darkPrimaryLighter":"bg-darkPrimaryLighter")+" transition-colors-250 overflow-hidden grid select-none px-2"))&&u(l,"class",L),(!Te||ie[0]&2)&&Y!==(Y=H[1].label+"")&&x($,Y),De!==(De=H[1].component)){if(Q){li();const X=Q;je(X.$$.fragment,1,0,()=>{Kt(X,1)}),ri()}De?(Q=new De(nt(H)),ei(Q.$$.fragment),ze(Q.$$.fragment,1),Yt(Q,oe,null)):Q=null}if(ie[0]&64){me=H[6];let X;for(X=0;X<me.length;X+=1){const we=pl(H,me,X);de[X]?de[X].p(we,ie):(de[X]=bl(we),de[X].c(),de[X].m(ne,null))}for(;X<de.length;X+=1)de[X].d(1);de.length=me.length}},i(H){Te||(Q&&ze(Q.$$.fragment,H),Te=!0)},o(H){Q&&je(Q.$$.fragment,H),Te=!1},d(H){V&&V.d(H),H&&h(e),H&&h(n),Ce.d(),H&&h(i),H&&h(o),ce&&ce.d(),pt(fe,H),Q&&Kt(Q),pt(de,H),t[21](null),Oe=!1,pe(N)}}}let gl=50;function yl(t){const e=document.querySelector("html");t?e.classList.add("dark"):e.classList.remove("dark"),localStorage&&localStorage.setItem("theme",t?"dark":"")}function Vs(t,e){t.style.setProperty("--translate-x",`${e?"0":"-18.75"}rem`)}function Gs(t,e,n){let i;Be.label!=="main"&&Be.onCloseRequested(async I=>{await confirm("Are you sure?")||I.preventDefault()}),Be.onFileDropEvent(I=>{z(`File drop: ${JSON.stringify(I.payload)}`)});const o=navigator.userAgent.toLowerCase(),l=o.includes("android")||o.includes("iphone"),a=[{label:"Welcome",component:Lr,icon:"i-ph-hand-waving"},{label:"Communication",component:zr,icon:"i-codicon-radio-tower"},!l&&{label:"CLI",component:Ar,icon:"i-codicon-terminal"},!l&&{label:"Dialog",component:Xr,icon:"i-codicon-multiple-windows"},{label:"File system",component:Zr,icon:"i-codicon-files"},{label:"HTTP",component:rs,icon:"i-ph-globe-hemisphere-west"},!l&&{label:"Notifications",component:cs,icon:"i-codicon-bell-dot"},!l&&{label:"Window",component:ps,icon:"i-codicon-window"},!l&&{label:"Shortcuts",component:bs,icon:"i-codicon-record-keys"},{label:"Shell",component:ws,icon:"i-codicon-terminal-bash"},!l&&{label:"Updater",component:Ls,icon:"i-codicon-cloud-download"},!l&&{label:"Clipboard",component:As,icon:"i-codicon-clippy"},{label:"WebRTC",component:zs,icon:"i-ph-broadcast"}];let f=a[0];function c(I){n(1,f=I)}let p;ct(async()=>{const I=Gt();n(2,p=await I.isMaximized()),Zt("tauri://resize",async()=>{n(2,p=await I.isMaximized())})});function d(){Gt().minimize()}async function k(){const I=Gt();await I.isMaximized()?I.unmaximize():I.maximize()}let _=!1;async function y(){_||(_=await Gl("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Gt().close())}let g;ct(()=>{n(3,g=localStorage&&localStorage.getItem("theme")=="dark"),yl(g)});function b(){n(3,g=!g),yl(g)}let S=Cl([]);kl(t,S,I=>n(6,i=I));function z(I){S.update(Z=>[{html:`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `+(typeof I=="string"?I:JSON.stringify(I,null,1))+"</pre>"},...Z])}function U(I){S.update(Z=>[{html:`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `+I+"</pre>"},...Z])}function R(){S.update(()=>[])}let q,A,E;function L(I){E=I.clientY;const Z=window.getComputedStyle(q);A=parseInt(Z.height,10);const le=ee=>{const _e=ee.clientY-E,ae=A-_e;n(4,q.style.height=`${ae<gl?gl:ae}px`,q)},ue=()=>{document.removeEventListener("mouseup",ue),document.removeEventListener("mousemove",le)};document.addEventListener("mouseup",ue),document.addEventListener("mousemove",le)}let P;ct(async()=>{n(5,P=await jl()==="win32")});let C=!1,F,B,Y=!1,$=0,be=0;const te=(I,Z,le)=>Math.min(Math.max(Z,I),le);ct(()=>{n(18,F=document.querySelector("#sidebar")),B=document.querySelector("#sidebarToggle"),document.addEventListener("click",I=>{B.contains(I.target)?n(0,C=!C):C&&!F.contains(I.target)&&n(0,C=!1)}),document.addEventListener("touchstart",I=>{if(B.contains(I.target))return;const Z=I.touches[0].clientX;(0<Z&&Z<20&&!C||C)&&(Y=!0,$=Z)}),document.addEventListener("touchmove",I=>{if(Y){const Z=I.touches[0].clientX;be=Z;const le=(Z-$)/10;F.style.setProperty("--translate-x",`-${te(0,C?0-le:18.75-le,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(Y){const I=(be-$)/10;n(0,C=C?I>-(18.75/2):I>18.75/2)}Y=!1})});const oe=()=>Ui("https://tauri.app/"),Q=I=>{c(I),n(0,C=!1)};function ge(I){$n[I?"unshift":"push"](()=>{q=I,n(4,q)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const I=document.querySelector("#sidebar");I&&Vs(I,C)}},[C,f,p,g,q,P,i,a,c,d,k,y,b,S,z,U,R,L,F,oe,Q,ge]}class Js extends Le{constructor(e){super(),Ee(this,e,Gs,Bs,Me,{},null,[-1,-1])}}new Js({target:document.querySelector("#app")});
|