(()=>{var ne=Object.defineProperty;var w=(e,t)=>{for(var n in t)ne(e,n,{get:t[n],enumerable:!0})};var C={};w(C,{SetText:()=>re,Text:()=>le});var oe=window.location.origin+"/wails/runtime";function ie(e,t,n){let o=new URL(oe);o.searchParams.append("method",e),n&&o.searchParams.append("args",JSON.stringify(n));let i={headers:{}};return t&&(i.headers["x-wails-window-name"]=t),new Promise((l,f)=>{fetch(o,i).then(a=>{if(a.ok)return a.headers.get("Content-Type")&&a.headers.get("Content-Type").indexOf("application/json")!==-1?a.json():a.text();f(Error(a.statusText))}).then(a=>l(a)).catch(a=>f(a))})}function r(e,t){return function(n,o=null){return ie(e+"."+n,t,o)}}var R=r("clipboard");function re(e){R("SetText",{text:e})}function le(){return R("Text")}var M={};w(M,{Hide:()=>ae,Quit:()=>se,Show:()=>ue});var b=r("application");function ae(){b("Hide")}function ue(){b("Show")}function se(){b("Quit")}var S={};w(S,{Log:()=>fe});var ce=r("log");function fe(e){return ce("Log",e)}var L={};w(L,{GetAll:()=>de,GetCurrent:()=>pe,GetPrimary:()=>me});var E=r("screens");function de(){return E("GetAll")}function me(){return E("GetPrimary")}function pe(){return E("GetCurrent")}var we="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var g=(e=21)=>{let t="",n=e;for(;n--;)t+=we[Math.random()*64|0];return t};var ge=r("call"),s=new Map;function xe(){let e;do e=g();while(s.has(e));return e}function A(e,t,n){let o=s.get(e);o&&(n?o.resolve(JSON.parse(t)):o.resolve(t),s.delete(e))}function T(e,t){let n=s.get(e);n&&(n.reject(t),s.delete(e))}function P(e,t){return new Promise((n,o)=>{let i=xe();t=t||{},t["call-id"]=i,s.set(i,{resolve:n,reject:o}),ge(e,t).catch(l=>{o(l),s.delete(i)})})}function y(e){return P("Call",e)}function D(e,t,...n){return P("Call",{packageName:"wails-plugins",structName:e,methodName:t,args:n})}function N(e){let t=r("window",e);return{Center:()=>void t("Center"),SetTitle:n=>void t("SetTitle",{title:n}),Fullscreen:()=>void t("Fullscreen"),UnFullscreen:()=>void t("UnFullscreen"),SetSize:(n,o)=>t("SetSize",{width:n,height:o}),Size:()=>t("Size"),SetMaxSize:(n,o)=>void t("SetMaxSize",{width:n,height:o}),SetMinSize:(n,o)=>void t("SetMinSize",{width:n,height:o}),SetAlwaysOnTop:n=>void t("SetAlwaysOnTop",{alwaysOnTop:n}),SetPosition:(n,o)=>t("SetPosition",{x:n,y:o}),Position:()=>t("Position"),Screen:()=>t("Screen"),Hide:()=>void t("Hide"),Maximise:()=>void t("Maximise"),Show:()=>void t("Show"),Close:()=>void t("Close"),ToggleMaximise:()=>void t("ToggleMaximise"),UnMaximise:()=>void t("UnMaximise"),Minimise:()=>void t("Minimise"),UnMinimise:()=>void t("UnMinimise"),Restore:()=>void t("Restore"),SetBackgroundColour:(n,o,i,l)=>void t("SetBackgroundColour",{r:n,g:o,b:i,a:l})}}var ve=r("events"),k=class{constructor(t,n,o){this.eventName=t,this.maxCallbacks=o||-1,this.Callback=i=>(n(i),this.maxCallbacks===-1?!1:(this.maxCallbacks-=1,this.maxCallbacks===0))}},x=class{constructor(t,n=null){this.name=t,this.data=n}},u=new Map;function v(e,t,n){let o=u.get(e)||[],i=new k(e,t,n);return o.push(i),u.set(e,o),()=>he(i)}function F(e,t){return v(e,t,-1)}function U(e,t){return v(e,t,1)}function he(e){let t=e.eventName,n=u.get(t).filter(o=>o!==e);n.length===0?u.delete(t):u.set(t,n)}function z(e){console.log("dispatching event: ",{event:e});let t=u.get(e.name);if(t){let n=[];t.forEach(o=>{o.Callback(e)&&n.push(o)}),n.length>0&&(t=t.filter(o=>!n.includes(o)),t.length===0?u.delete(e.name):u.set(e.name,t))}}function G(e,...t){[e,...t].forEach(o=>{u.delete(o)})}function I(){u.clear()}function h(e){ve("Emit",e)}var Ce=r("dialog"),c=new Map;function be(){let e;do e=g();while(c.has(e));return e}function B(e,t,n){let o=c.get(e);o&&(n?o.resolve(JSON.parse(t)):o.resolve(t),c.delete(e))}function H(e,t){let n=c.get(e);n&&(n.reject(t),c.delete(e))}function d(e,t){return new Promise((n,o)=>{let i=be();t=t||{},t["dialog-id"]=i,c.set(i,{resolve:n,reject:o}),Ce(e,t).catch(l=>{o(l),c.delete(i)})})}function Q(e){return d("Info",e)}function Y(e){return d("Warning",e)}function J(e){return d("Error",e)}function m(e){return d("Question",e)}function q(e){return d("OpenFile",e)}function X(e){return d("SaveFile",e)}var Me=r("contextmenu");function Se(e,t,n,o){return Me("OpenContextMenu",{id:e,x:t,y:n,data:o})}function V(e){e?window.addEventListener("contextmenu",j):window.removeEventListener("contextmenu",j)}function j(e){_(e.target,e)}function _(e,t){let n=e.getAttribute("data-contextmenu");if(n)t.preventDefault(),Se(n,t.clientX,t.clientY,e.getAttribute("data-contextmenu-data"));else{let o=e.parentElement;o&&_(o,t)}}function K(e,t=null){let n=new x(e,t);h(n)}function Ee(){document.querySelectorAll("[data-wml-event]").forEach(function(t){let n=t.getAttribute("data-wml-event"),o=t.getAttribute("data-wml-confirm"),i=t.getAttribute("data-wml-trigger")||"click",l=function(){if(o){m({Title:"Confirm",Message:o,Buttons:[{Label:"Yes"},{Label:"No",IsDefault:!0}]}).then(function(f){f!=="No"&&K(n)});return}K(n)};t.removeEventListener(i,l),t.addEventListener(i,l)})}function Z(e){wails.Window[e]===void 0&&console.log("Window method "+e+" not found"),wails.Window[e]()}function Le(){document.querySelectorAll("[data-wml-window]").forEach(function(t){let n=t.getAttribute("data-wml-window"),o=t.getAttribute("data-wml-confirm"),i=t.getAttribute("data-wml-trigger")||"click",l=function(){if(o){m({Title:"Confirm",Message:o,Buttons:[{Label:"Yes"},{Label:"No",IsDefault:!0}]}).then(function(f){f!=="No"&&Z(n)});return}Z(n)};t.removeEventListener(i,l),t.addEventListener(i,l)})}function O(){Ee(),Le()}var $=function(e){webkit.messageHandlers.external.postMessage(e)};var p=!1;function ke(e){let t=window.getComputedStyle(e.target).getPropertyValue("--wails-draggable");return t&&(t=t.trim()),t!=="drag"||e.buttons!==1?!1:e.detail===1}function ee(){window.addEventListener("mousedown",Oe),window.addEventListener("mousemove",Re),window.addEventListener("mouseup",We)}function Oe(e){if(ke(e)){if(e.offsetX>e.target.clientWidth||e.offsetY>e.target.clientHeight)return;p=!0}else p=!1}function We(e){(e.buttons!==void 0?e.buttons:e.which)>0&&W()}function W(){document.body.style.cursor="default",p=!1}function Re(e){p&&(p=!1,(e.buttons!==void 0?e.buttons:e.which)>0&&$("drag"))}window.wails={...te(null)};window._wails={dialogCallback:B,dialogErrorCallback:H,dispatchWailsEvent:z,callCallback:A,callErrorCallback:T,endDrag:W};function te(e){return{Clipboard:{...C},Application:{...M,GetWindowByName(t){return te(t)}},Log:S,Screens:L,Call:y,Plugin:D,WML:{Reload:O},Dialog:{Info:Q,Warning:Y,Error:J,Question:m,OpenFile:q,SaveFile:X},Events:{Emit:h,On:F,Once:U,OnMultiple:v,Off:G,OffAll:I},Window:N(e)}}console.log("Wails v3.0.0 Debug Mode Enabled");V(!0);ee();document.addEventListener("DOMContentLoaded",function(e){O()});})();