2 lines
34 KiB
JavaScript
2 lines
34 KiB
JavaScript
var Ue=Object.defineProperty,dn=Object.defineProperties;var mn=Object.getOwnPropertyDescriptors;var Le=Object.getOwnPropertySymbols;var un=Object.prototype.hasOwnProperty,wn=Object.prototype.propertyIsEnumerable;var ze=(n,e,i)=>e in n?Ue(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i,Ie=(n,e)=>{for(var i in e||(e={}))un.call(e,i)&&ze(n,i,e[i]);if(Le)for(var i of Le(e))wn.call(e,i)&&ze(n,i,e[i]);return n},je=(n,e)=>dn(n,mn(e));var p=(n,e)=>{for(var i in e)Ue(n,i,{get:e[i],enumerable:!0})};var me={};p(me,{Application:()=>Ce,Browser:()=>ee,Call:()=>Re,CancelError:()=>F,CancellablePromise:()=>H,CancelledRejectionError:()=>b,Clipboard:()=>Ee,Create:()=>Oe,Dialogs:()=>ie,Events:()=>re,Flags:()=>ge,Screens:()=>Fe,System:()=>fe,WML:()=>de,Window:()=>S});var de={};p(de,{Enable:()=>ce,Reload:()=>$e});var ee={};p(ee,{OpenURL:()=>q});var pn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function D(n=21){let e="",i=n|0;for(;i--;)e+=pn[Math.random()*64|0];return e}var fn=window.location.origin+"/wails/runtime",d=Object.freeze({Call:0,Clipboard:1,Application:2,Events:3,ContextMenu:4,Dialog:5,Window:6,Screens:7,System:8,Browser:9,CancelCall:10}),gn=D();function m(n,e=""){return function(i,o=null){return hn(n,i,e,o)}}async function hn(n,e,i,o){var l,c;let t=new URL(fn);t.searchParams.append("object",n.toString()),t.searchParams.append("method",e.toString()),o&&t.searchParams.append("args",JSON.stringify(o));let r={"x-wails-client-id":gn};i&&(r["x-wails-window-name"]=i);let a=await fetch(t,{headers:r});if(!a.ok)throw new Error(await a.text());return((c=(l=a.headers.get("Content-Type"))==null?void 0:l.indexOf("application/json"))!=null?c:-1)!==-1?a.json():a.text()}var Wn=m(d.Browser),bn=0;function q(n){return Wn(bn,{url:n.toString()})}var ie={};p(ie,{Error:()=>On,Info:()=>Rn,OpenFile:()=>kn,Question:()=>ne,SaveFile:()=>Fn,Warning:()=>En});window._wails=window._wails||{};window._wails.dialogErrorCallback=xn;window._wails.dialogResultCallback=Sn;var vn=m(d.Dialog),z=new Map,yn=0,Pn=1,Cn=2,Dn=3,Tn=4,Mn=5;function Sn(n,e,i){let o=Be(n);if(o)if(i)try{o.resolve(JSON.parse(e))}catch(t){o.reject(new TypeError("could not parse result: "+t.message,{cause:t}))}else o.resolve(e)}function xn(n,e){var i;(i=Be(n))==null||i.reject(new window.Error(e))}function Be(n){let e=z.get(n);return z.delete(n),e}function An(){let n;do n=D();while(z.has(n));return n}function T(n,e={}){let i=An();return new Promise((o,t)=>{z.set(i,{resolve:o,reject:t}),vn(n,Object.assign({"dialog-id":i},e)).catch(r=>{z.delete(i),t(r)})})}function Rn(n){return T(yn,n)}function En(n){return T(Pn,n)}function On(n){return T(Cn,n)}function ne(n){return T(Dn,n)}function kn(n){var e;return(e=T(Tn,n))!=null?e:[]}function Fn(n){return T(Mn,n)}var re={};p(re,{Emit:()=>te,Off:()=>Bn,OffAll:()=>Hn,On:()=>In,OnMultiple:()=>oe,Once:()=>jn,Types:()=>Ne,WailsEvent:()=>Z});var g=new Map,N=class{constructor(e,i,o){this.eventName=e,this.callback=i,this.maxCallbacks=o||-1}dispatch(e){try{this.callback(e)}catch(i){}return this.maxCallbacks===-1?!1:(this.maxCallbacks-=1,this.maxCallbacks===0)}};function He(n){let e=g.get(n.eventName);e&&(e=e.filter(i=>i!==n),e.length===0?g.delete(n.eventName):g.set(n.eventName,e))}var Ne=Object.freeze({Windows:Object.freeze({APMPowerSettingChange:"windows:APMPowerSettingChange",APMPowerStatusChange:"windows:APMPowerStatusChange",APMResumeAutomatic:"windows:APMResumeAutomatic",APMResumeSuspend:"windows:APMResumeSuspend",APMSuspend:"windows:APMSuspend",ApplicationStarted:"windows:ApplicationStarted",SystemThemeChanged:"windows:SystemThemeChanged",WebViewNavigationCompleted:"windows:WebViewNavigationCompleted",WindowActive:"windows:WindowActive",WindowBackgroundErase:"windows:WindowBackgroundErase",WindowClickActive:"windows:WindowClickActive",WindowClosing:"windows:WindowClosing",WindowDidMove:"windows:WindowDidMove",WindowDidResize:"windows:WindowDidResize",WindowDPIChanged:"windows:WindowDPIChanged",WindowDragDrop:"windows:WindowDragDrop",WindowDragEnter:"windows:WindowDragEnter",WindowDragLeave:"windows:WindowDragLeave",WindowDragOver:"windows:WindowDragOver",WindowEndMove:"windows:WindowEndMove",WindowEndResize:"windows:WindowEndResize",WindowFullscreen:"windows:WindowFullscreen",WindowHide:"windows:WindowHide",WindowInactive:"windows:WindowInactive",WindowKeyDown:"windows:WindowKeyDown",WindowKeyUp:"windows:WindowKeyUp",WindowKillFocus:"windows:WindowKillFocus",WindowNonClientHit:"windows:WindowNonClientHit",WindowNonClientMouseDown:"windows:WindowNonClientMouseDown",WindowNonClientMouseLeave:"windows:WindowNonClientMouseLeave",WindowNonClientMouseMove:"windows:WindowNonClientMouseMove",WindowNonClientMouseUp:"windows:WindowNonClientMouseUp",WindowPaint:"windows:WindowPaint",WindowRestore:"windows:WindowRestore",WindowSetFocus:"windows:WindowSetFocus",WindowShow:"windows:WindowShow",WindowStartMove:"windows:WindowStartMove",WindowStartResize:"windows:WindowStartResize",WindowUnFullscreen:"windows:WindowUnFullscreen",WindowZOrderChanged:"windows:WindowZOrderChanged",WindowMinimise:"windows:WindowMinimise",WindowUnMinimise:"windows:WindowUnMinimise",WindowMaximise:"windows:WindowMaximise",WindowUnMaximise:"windows:WindowUnMaximise"}),Mac:Object.freeze({ApplicationDidBecomeActive:"mac:ApplicationDidBecomeActive",ApplicationDidChangeBackingProperties:"mac:ApplicationDidChangeBackingProperties",ApplicationDidChangeEffectiveAppearance:"mac:ApplicationDidChangeEffectiveAppearance",ApplicationDidChangeIcon:"mac:ApplicationDidChangeIcon",ApplicationDidChangeOcclusionState:"mac:ApplicationDidChangeOcclusionState",ApplicationDidChangeScreenParameters:"mac:ApplicationDidChangeScreenParameters",ApplicationDidChangeStatusBarFrame:"mac:ApplicationDidChangeStatusBarFrame",ApplicationDidChangeStatusBarOrientation:"mac:ApplicationDidChangeStatusBarOrientation",ApplicationDidChangeTheme:"mac:ApplicationDidChangeTheme",ApplicationDidFinishLaunching:"mac:ApplicationDidFinishLaunching",ApplicationDidHide:"mac:ApplicationDidHide",ApplicationDidResignActive:"mac:ApplicationDidResignActive",ApplicationDidUnhide:"mac:ApplicationDidUnhide",ApplicationDidUpdate:"mac:ApplicationDidUpdate",ApplicationShouldHandleReopen:"mac:ApplicationShouldHandleReopen",ApplicationWillBecomeActive:"mac:ApplicationWillBecomeActive",ApplicationWillFinishLaunching:"mac:ApplicationWillFinishLaunching",ApplicationWillHide:"mac:ApplicationWillHide",ApplicationWillResignActive:"mac:ApplicationWillResignActive",ApplicationWillTerminate:"mac:ApplicationWillTerminate",ApplicationWillUnhide:"mac:ApplicationWillUnhide",ApplicationWillUpdate:"mac:ApplicationWillUpdate",MenuDidAddItem:"mac:MenuDidAddItem",MenuDidBeginTracking:"mac:MenuDidBeginTracking",MenuDidClose:"mac:MenuDidClose",MenuDidDisplayItem:"mac:MenuDidDisplayItem",MenuDidEndTracking:"mac:MenuDidEndTracking",MenuDidHighlightItem:"mac:MenuDidHighlightItem",MenuDidOpen:"mac:MenuDidOpen",MenuDidPopUp:"mac:MenuDidPopUp",MenuDidRemoveItem:"mac:MenuDidRemoveItem",MenuDidSendAction:"mac:MenuDidSendAction",MenuDidSendActionToItem:"mac:MenuDidSendActionToItem",MenuDidUpdate:"mac:MenuDidUpdate",MenuWillAddItem:"mac:MenuWillAddItem",MenuWillBeginTracking:"mac:MenuWillBeginTracking",MenuWillDisplayItem:"mac:MenuWillDisplayItem",MenuWillEndTracking:"mac:MenuWillEndTracking",MenuWillHighlightItem:"mac:MenuWillHighlightItem",MenuWillOpen:"mac:MenuWillOpen",MenuWillPopUp:"mac:MenuWillPopUp",MenuWillRemoveItem:"mac:MenuWillRemoveItem",MenuWillSendAction:"mac:MenuWillSendAction",MenuWillSendActionToItem:"mac:MenuWillSendActionToItem",MenuWillUpdate:"mac:MenuWillUpdate",WebViewDidCommitNavigation:"mac:WebViewDidCommitNavigation",WebViewDidFinishNavigation:"mac:WebViewDidFinishNavigation",WebViewDidReceiveServerRedirectForProvisionalNavigation:"mac:WebViewDidReceiveServerRedirectForProvisionalNavigation",WebViewDidStartProvisionalNavigation:"mac:WebViewDidStartProvisionalNavigation",WindowDidBecomeKey:"mac:WindowDidBecomeKey",WindowDidBecomeMain:"mac:WindowDidBecomeMain",WindowDidBeginSheet:"mac:WindowDidBeginSheet",WindowDidChangeAlpha:"mac:WindowDidChangeAlpha",WindowDidChangeBackingLocation:"mac:WindowDidChangeBackingLocation",WindowDidChangeBackingProperties:"mac:WindowDidChangeBackingProperties",WindowDidChangeCollectionBehavior:"mac:WindowDidChangeCollectionBehavior",WindowDidChangeEffectiveAppearance:"mac:WindowDidChangeEffectiveAppearance",WindowDidChangeOcclusionState:"mac:WindowDidChangeOcclusionState",WindowDidChangeOrderingMode:"mac:WindowDidChangeOrderingMode",WindowDidChangeScreen:"mac:WindowDidChangeScreen",WindowDidChangeScreenParameters:"mac:WindowDidChangeScreenParameters",WindowDidChangeScreenProfile:"mac:WindowDidChangeScreenProfile",WindowDidChangeScreenSpace:"mac:WindowDidChangeScreenSpace",WindowDidChangeScreenSpaceProperties:"mac:WindowDidChangeScreenSpaceProperties",WindowDidChangeSharingType:"mac:WindowDidChangeSharingType",WindowDidChangeSpace:"mac:WindowDidChangeSpace",WindowDidChangeSpaceOrderingMode:"mac:WindowDidChangeSpaceOrderingMode",WindowDidChangeTitle:"mac:WindowDidChangeTitle",WindowDidChangeToolbar:"mac:WindowDidChangeToolbar",WindowDidDeminiaturize:"mac:WindowDidDeminiaturize",WindowDidEndSheet:"mac:WindowDidEndSheet",WindowDidEnterFullScreen:"mac:WindowDidEnterFullScreen",WindowDidEnterVersionBrowser:"mac:WindowDidEnterVersionBrowser",WindowDidExitFullScreen:"mac:WindowDidExitFullScreen",WindowDidExitVersionBrowser:"mac:WindowDidExitVersionBrowser",WindowDidExpose:"mac:WindowDidExpose",WindowDidFocus:"mac:WindowDidFocus",WindowDidMiniaturize:"mac:WindowDidMiniaturize",WindowDidMove:"mac:WindowDidMove",WindowDidOrderOffScreen:"mac:WindowDidOrderOffScreen",WindowDidOrderOnScreen:"mac:WindowDidOrderOnScreen",WindowDidResignKey:"mac:WindowDidResignKey",WindowDidResignMain:"mac:WindowDidResignMain",WindowDidResize:"mac:WindowDidResize",WindowDidUpdate:"mac:WindowDidUpdate",WindowDidUpdateAlpha:"mac:WindowDidUpdateAlpha",WindowDidUpdateCollectionBehavior:"mac:WindowDidUpdateCollectionBehavior",WindowDidUpdateCollectionProperties:"mac:WindowDidUpdateCollectionProperties",WindowDidUpdateShadow:"mac:WindowDidUpdateShadow",WindowDidUpdateTitle:"mac:WindowDidUpdateTitle",WindowDidUpdateToolbar:"mac:WindowDidUpdateToolbar",WindowDidZoom:"mac:WindowDidZoom",WindowFileDraggingEntered:"mac:WindowFileDraggingEntered",WindowFileDraggingExited:"mac:WindowFileDraggingExited",WindowFileDraggingPerformed:"mac:WindowFileDraggingPerformed",WindowHide:"mac:WindowHide",WindowMaximise:"mac:WindowMaximise",WindowUnMaximise:"mac:WindowUnMaximise",WindowMinimise:"mac:WindowMinimise",WindowUnMinimise:"mac:WindowUnMinimise",WindowShouldClose:"mac:WindowShouldClose",WindowShow:"mac:WindowShow",WindowWillBecomeKey:"mac:WindowWillBecomeKey",WindowWillBecomeMain:"mac:WindowWillBecomeMain",WindowWillBeginSheet:"mac:WindowWillBeginSheet",WindowWillChangeOrderingMode:"mac:WindowWillChangeOrderingMode",WindowWillClose:"mac:WindowWillClose",WindowWillDeminiaturize:"mac:WindowWillDeminiaturize",WindowWillEnterFullScreen:"mac:WindowWillEnterFullScreen",WindowWillEnterVersionBrowser:"mac:WindowWillEnterVersionBrowser",WindowWillExitFullScreen:"mac:WindowWillExitFullScreen",WindowWillExitVersionBrowser:"mac:WindowWillExitVersionBrowser",WindowWillFocus:"mac:WindowWillFocus",WindowWillMiniaturize:"mac:WindowWillMiniaturize",WindowWillMove:"mac:WindowWillMove",WindowWillOrderOffScreen:"mac:WindowWillOrderOffScreen",WindowWillOrderOnScreen:"mac:WindowWillOrderOnScreen",WindowWillResignMain:"mac:WindowWillResignMain",WindowWillResize:"mac:WindowWillResize",WindowWillUnfocus:"mac:WindowWillUnfocus",WindowWillUpdate:"mac:WindowWillUpdate",WindowWillUpdateAlpha:"mac:WindowWillUpdateAlpha",WindowWillUpdateCollectionBehavior:"mac:WindowWillUpdateCollectionBehavior",WindowWillUpdateCollectionProperties:"mac:WindowWillUpdateCollectionProperties",WindowWillUpdateShadow:"mac:WindowWillUpdateShadow",WindowWillUpdateTitle:"mac:WindowWillUpdateTitle",WindowWillUpdateToolbar:"mac:WindowWillUpdateToolbar",WindowWillUpdateVisibility:"mac:WindowWillUpdateVisibility",WindowWillUseStandardFrame:"mac:WindowWillUseStandardFrame",WindowZoomIn:"mac:WindowZoomIn",WindowZoomOut:"mac:WindowZoomOut",WindowZoomReset:"mac:WindowZoomReset"}),Linux:Object.freeze({ApplicationStartup:"linux:ApplicationStartup",SystemThemeChanged:"linux:SystemThemeChanged",WindowDeleteEvent:"linux:WindowDeleteEvent",WindowDidMove:"linux:WindowDidMove",WindowDidResize:"linux:WindowDidResize",WindowFocusIn:"linux:WindowFocusIn",WindowFocusOut:"linux:WindowFocusOut",WindowLoadChanged:"linux:WindowLoadChanged"}),Common:Object.freeze({ApplicationOpenedWithFile:"common:ApplicationOpenedWithFile",ApplicationStarted:"common:ApplicationStarted",ApplicationLaunchedWithUrl:"common:ApplicationLaunchedWithUrl",ThemeChanged:"common:ThemeChanged",WindowClosing:"common:WindowClosing",WindowDidMove:"common:WindowDidMove",WindowDidResize:"common:WindowDidResize",WindowDPIChanged:"common:WindowDPIChanged",WindowFilesDropped:"common:WindowFilesDropped",WindowFocus:"common:WindowFocus",WindowFullscreen:"common:WindowFullscreen",WindowHide:"common:WindowHide",WindowLostFocus:"common:WindowLostFocus",WindowMaximise:"common:WindowMaximise",WindowMinimise:"common:WindowMinimise",WindowToggleFrameless:"common:WindowToggleFrameless",WindowRestore:"common:WindowRestore",WindowRuntimeReady:"common:WindowRuntimeReady",WindowShow:"common:WindowShow",WindowUnFullscreen:"common:WindowUnFullscreen",WindowUnMaximise:"common:WindowUnMaximise",WindowUnMinimise:"common:WindowUnMinimise",WindowZoom:"common:WindowZoom",WindowZoomIn:"common:WindowZoomIn",WindowZoomOut:"common:WindowZoomOut",WindowZoomReset:"common:WindowZoomReset",WindowDropZoneFilesDropped:"common:WindowDropZoneFilesDropped"})});window._wails=window._wails||{};window._wails.dispatchWailsEvent=Un;var Ln=m(d.Events),zn=0,Z=class{constructor(e,i=null){this.name=e,this.data=i}};function Un(n){let e=g.get(n.name);if(!e)return;let i=new Z(n.name,n.data);"sender"in n&&(i.sender=n.sender),e=e.filter(o=>!o.dispatch(i)),e.length===0?g.delete(n.name):g.set(n.name,e)}function oe(n,e,i){let o=g.get(n)||[],t=new N(n,e,i);return o.push(t),g.set(n,o),()=>He(t)}function In(n,e){return oe(n,e,-1)}function jn(n,e){return oe(n,e,1)}function Bn(...n){n.forEach(e=>g.delete(e))}function Hn(){g.clear()}function te(n,e){let i,o;return typeof n=="object"&&n!==null&&"name"in n&&"data"in n?(i=n.name,o=n.data):(i=n,o=e),Ln(zn,{name:i,data:o})}function Ze(){return new MouseEvent("mousedown").buttons===0}function Ve(){if(!EventTarget||!AbortSignal||!AbortController)return!1;let n=!0,e=new EventTarget,i=new AbortController;return e.addEventListener("test",()=>{n=!1},{signal:i.signal}),i.abort(),e.dispatchEvent(new CustomEvent("test")),n}function V(n){var e;return n.target instanceof HTMLElement?n.target:!(n.target instanceof HTMLElement)&&n.target instanceof Node&&(e=n.target.parentElement)!=null?e:document.body}var Ge=!1;document.addEventListener("DOMContentLoaded",()=>{Ge=!0});function Ke(n){Ge||document.readyState==="complete"?n():document.addEventListener("DOMContentLoaded",n)}var Nn="data-wails-dropzone",M="wails-dropzone-hover",u=null,Zn=0,Vn=1,Gn=2,Kn=3,Yn=4,Xn=5,_n=6,$n=7,Jn=8,Qn=9,qn=10,ei=11,ni=12,ii=13,oi=14,ti=15,ri=16,si=17,ai=18,li=19,ci=20,di=21,mi=22,ui=23,wi=24,pi=25,fi=26,gi=27,hi=28,Wi=29,bi=30,vi=31,yi=32,Pi=33,Ci=34,Di=35,Ti=36,Mi=37,Si=38,xi=39,Ai=40,Ri=41,Ei=42,Oi=43,ki=44,Fi=45,Li=46,zi=47,Ui=48,Ii=49,ji=50;function Ye(n){return n?n.closest("[".concat(Nn,"]")):null}var s=Symbol("caller");s;var G=class G{constructor(e=""){this[s]=m(d.Window,e);for(let i of Object.getOwnPropertyNames(G.prototype))i!=="constructor"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this))}Get(e){return new G(e)}Position(){return this[s](Zn)}Center(){return this[s](Vn)}Close(){return this[s](Gn)}DisableSizeConstraints(){return this[s](Kn)}EnableSizeConstraints(){return this[s](Yn)}Focus(){return this[s](Xn)}ForceReload(){return this[s](_n)}Fullscreen(){return this[s]($n)}GetScreen(){return this[s](Jn)}GetZoom(){return this[s](Qn)}Height(){return this[s](qn)}Hide(){return this[s](ei)}IsFocused(){return this[s](ni)}IsFullscreen(){return this[s](ii)}IsMaximised(){return this[s](oi)}IsMinimised(){return this[s](ti)}Maximise(){return this[s](ri)}Minimise(){return this[s](si)}Name(){return this[s](ai)}OpenDevTools(){return this[s](li)}RelativePosition(){return this[s](ci)}Reload(){return this[s](di)}Resizable(){return this[s](mi)}Restore(){return this[s](ui)}SetPosition(e,i){return this[s](wi,{x:e,y:i})}SetAlwaysOnTop(e){return this[s](pi,{alwaysOnTop:e})}SetBackgroundColour(e,i,o,t){return this[s](fi,{r:e,g:i,b:o,a:t})}SetFrameless(e){return this[s](gi,{frameless:e})}SetFullscreenButtonEnabled(e){return this[s](hi,{enabled:e})}SetMaxSize(e,i){return this[s](Wi,{width:e,height:i})}SetMinSize(e,i){return this[s](bi,{width:e,height:i})}SetRelativePosition(e,i){return this[s](vi,{x:e,y:i})}SetResizable(e){return this[s](yi,{resizable:e})}SetSize(e,i){return this[s](Pi,{width:e,height:i})}SetTitle(e){return this[s](Ci,{title:e})}SetZoom(e){return this[s](Di,{zoom:e})}Show(){return this[s](Ti)}Size(){return this[s](Mi)}ToggleFullscreen(){return this[s](Si)}ToggleMaximise(){return this[s](xi)}ToggleFrameless(){return this[s](Ai)}UnFullscreen(){return this[s](Ri)}UnMaximise(){return this[s](Ei)}UnMinimise(){return this[s](Oi)}Width(){return this[s](ki)}Zoom(){return this[s](Fi)}ZoomIn(){return this[s](Li)}ZoomOut(){return this[s](zi)}ZoomReset(){return this[s](Ui)}HandlePlatformFileDrop(e,i,o){let t=document.elementFromPoint(i,o),r=Ye(t);if(!r)return;let a={id:r.id,classList:Array.from(r.classList),attributes:{}};for(let c=0;c<r.attributes.length;c++){let w=r.attributes[c];a.attributes[w.name]=w.value}let l={filenames:e,x:i,y:o,elementDetails:a};this[s](ji,l)}SnapAssist(){return this[s](Ii)}},se=G,Bi=new se("");function Hi(){let n=document.documentElement,e=0;n.addEventListener("dragenter",i=>{if(i.preventDefault(),i.dataTransfer&&i.dataTransfer.types.includes("Files")){e++;let o=document.elementFromPoint(i.clientX,i.clientY),t=Ye(o);u&&u!==t&&u.classList.remove(M),t?(t.classList.add(M),i.dataTransfer.dropEffect="copy",u=t):(i.dataTransfer.dropEffect="none",u=null)}},!1),n.addEventListener("dragover",i=>{i.preventDefault(),i.dataTransfer&&i.dataTransfer.types.includes("Files")&&(u?(u.classList.contains(M)||u.classList.add(M),i.dataTransfer.dropEffect="copy"):i.dataTransfer.dropEffect="none")},!1),n.addEventListener("dragleave",i=>{i.preventDefault(),i.dataTransfer&&i.dataTransfer.types.includes("Files")&&(e--,(e===0||i.relatedTarget===null||u&&!u.contains(i.relatedTarget))&&(u&&(u.classList.remove(M),u=null),e=0))},!1),n.addEventListener("drop",i=>{i.preventDefault(),e=0,u&&(u.classList.remove(M),u=null)},!1)}typeof window<"u"&&typeof document<"u"&&Hi();var S=Bi;function Ni(n,e=null){te(n,e)}function Zi(n,e){let i=S.Get(n),o=i[e];if(typeof o=="function")try{o.call(i)}catch(t){}}function Xe(n){let e=n.currentTarget;function i(t="Yes"){if(t!=="Yes")return;let r=e.getAttribute("wml-event")||e.getAttribute("data-wml-event"),a=e.getAttribute("wml-target-window")||e.getAttribute("data-wml-target-window")||"",l=e.getAttribute("wml-window")||e.getAttribute("data-wml-window"),c=e.getAttribute("wml-openurl")||e.getAttribute("data-wml-openurl");r!==null&&Ni(r),l!==null&&Zi(a,l),c!==null&&q(c)}let o=e.getAttribute("wml-confirm")||e.getAttribute("data-wml-confirm");o?ne({Title:"Confirm",Message:o,Detached:!1,Buttons:[{Label:"Yes"},{Label:"No",IsDefault:!0}]}).then(i):i()}var U=Symbol("controller"),x=Symbol("triggerMap"),v=Symbol("elementCount");U;var ae=class{constructor(){this[U]=new AbortController}set(e,i){return{signal:this[U].signal}}reset(){this[U].abort(),this[U]=new AbortController}};x,v;var le=class{constructor(){this[x]=new WeakMap,this[v]=0}set(e,i){return this[x].has(e)||this[v]++,this[x].set(e,i),{}}reset(){if(!(this[v]<=0)){for(let e of document.body.querySelectorAll("*")){if(this[v]<=0)break;let i=this[x].get(e);i!=null&&this[v]--;for(let o of i||[])e.removeEventListener(o,Xe)}this[x]=new WeakMap,this[v]=0}}},_e=Ve()?new ae:new le;function Vi(n){let e=/\S+/g,i=n.getAttribute("wml-trigger")||n.getAttribute("data-wml-trigger")||"click",o=[],t;for(;(t=e.exec(i))!==null;)o.push(t[0]);let r=_e.set(n,o);for(let a of o)n.addEventListener(a,Xe,r)}function ce(){Ke($e)}function $e(){_e.reset(),document.body.querySelectorAll("[wml-event], [wml-window], [wml-openurl], [data-wml-event], [data-wml-window], [data-wml-openurl]").forEach(Vi)}window.wails=me;ce();var fe={};p(fe,{Capabilities:()=>_i,Environment:()=>$i,HandlePlatformFileDrop:()=>io,IsAMD64:()=>qi,IsARM:()=>eo,IsARM64:()=>no,IsDarkMode:()=>Xi,IsDebug:()=>pe,IsLinux:()=>Ji,IsMac:()=>Qi,IsWindows:()=>K,invoke:()=>y});var we=m(d.System),Gi=0,Ki=1,Yi=100,ue=(function(){var n,e,i,o,t;try{if((e=(n=window.chrome)==null?void 0:n.webview)!=null&&e.postMessage)return window.chrome.webview.postMessage.bind(window.chrome.webview);if((t=(o=(i=window.webkit)==null?void 0:i.messageHandlers)==null?void 0:o.external)!=null&&t.postMessage)return window.webkit.messageHandlers.external.postMessage.bind(window.webkit.messageHandlers.external)}catch(r){}return null})();function y(n){ue==null||ue(n)}function Xi(){return we(Gi)}async function _i(){let n=await fetch("/wails/capabilities");if(n.ok)return n.json();throw new Error("could not fetch capabilities: "+n.statusText)}function $i(){return we(Ki)}function K(){return window._wails.environment.OS==="windows"}function Ji(){return window._wails.environment.OS==="linux"}function Qi(){return window._wails.environment.OS==="darwin"}function qi(){return window._wails.environment.Arch==="amd64"}function eo(){return window._wails.environment.Arch==="arm"}function no(){return window._wails.environment.Arch==="arm64"}function pe(){return!!window._wails.environment.Debug}function io(n,e,i){let o=document.elementFromPoint(e,i),t=o?o.id:"",r=o?Array.from(o.classList):[];we(Yi,{filenames:n,x:e,y:i,elementId:t,classList:r}).then(()=>{}).catch(l=>{})}window.addEventListener("contextmenu",so);var oo=m(d.ContextMenu),to=0;function ro(n,e,i,o){oo(to,{id:n,x:e,y:i,data:o})}function so(n){let e=V(n),i=window.getComputedStyle(e).getPropertyValue("--custom-contextmenu").trim();if(i){n.preventDefault();let o=window.getComputedStyle(e).getPropertyValue("--custom-contextmenu-data");ro(i,n.clientX,n.clientY,o)}else ao(n,e)}function ao(n,e){if(pe())return;switch(window.getComputedStyle(e).getPropertyValue("--default-contextmenu").trim()){case"show":return;case"hide":n.preventDefault();return}if(e.isContentEditable)return;let i=window.getSelection(),o=i&&i.toString().length>0;if(o)for(let t=0;t<i.rangeCount;t++){let a=i.getRangeAt(t).getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(document.elementFromPoint(c.left,c.top)===e)return}}(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(o||!e.readOnly&&!e.disabled)||n.preventDefault()}var ge={};p(ge,{GetFlag:()=>I});function I(n){try{return window._wails.flags[n]}catch(e){throw new Error("Unable to retrieve flag '"+n+"': "+e,{cause:e})}}var j=!1,B=!1,ve=!1,R=!1,E=!1,P="",Je="auto",A=0,he=Ze();window._wails=window._wails||{};window._wails.setResizable=n=>{ve=n,ve||(R=E=!1,f())};window.addEventListener("mousedown",ye,{capture:!0});window.addEventListener("mousemove",ye,{capture:!0});window.addEventListener("mouseup",ye,{capture:!0});for(let n of["click","contextmenu","dblclick"])window.addEventListener(n,lo,{capture:!0});function lo(n){(B||E)&&(n.stopImmediatePropagation(),n.stopPropagation(),n.preventDefault())}var We=0,co=1,be=2;function ye(n){let e,i=n.buttons;switch(n.type){case"mousedown":e=We,he||(i=A|1<<n.button);break;case"mouseup":e=co,he||(i=A&~(1<<n.button));break;default:e=be,he||(i=A);break}let o=A&~i,t=i&~A;A=i,e===We&&!(t&n.button)&&(o|=1<<n.button,t|=1<<n.button),(e!==be&&E||B&&(e===We||n.button!==0))&&(n.stopImmediatePropagation(),n.stopPropagation(),n.preventDefault()),o&1&&uo(n),t&1&&mo(n),e===be&&po(n)}function mo(n){if(j=!1,R=!1,!K()&&n.type==="mousedown"&&n.button===0&&n.detail!==1)return;if(P){R=!0;return}let e=V(n),i=window.getComputedStyle(e);j=i.getPropertyValue("--wails-draggable").trim()==="drag"&&n.offsetX-parseFloat(i.paddingLeft)<e.clientWidth&&n.offsetY-parseFloat(i.paddingTop)<e.clientHeight}function uo(n){j=!1,B=!1,R=!1,E=!1}var wo=Object.freeze({"se-resize":"nwse-resize","sw-resize":"nesw-resize","nw-resize":"nwse-resize","ne-resize":"nesw-resize","w-resize":"ew-resize","n-resize":"ns-resize","s-resize":"ns-resize","e-resize":"ew-resize"});function f(n){n?(P||(Je=document.body.style.cursor),document.body.style.cursor=wo[n]):!n&&P&&(document.body.style.cursor=Je),P=n||""}function po(n){if(R&&P?(E=!0,y("wails:resize:"+P)):j&&(B=!0,y("wails:drag")),B||E){j=R=!1;return}if(!ve||!K()){P&&f();return}let e=I("system.resizeHandleHeight")||5,i=I("system.resizeHandleWidth")||5,o=I("resizeCornerExtra")||10,t=window.outerWidth-n.clientX<i,r=n.clientX<i,a=n.clientY<e,l=window.outerHeight-n.clientY<e,c=window.outerWidth-n.clientX<i+o,w=n.clientX<i+o,J=n.clientY<e+o,Q=window.outerHeight-n.clientY<e+o;!w&&!J&&!Q&&!c?f():c&&Q?f("se-resize"):w&&Q?f("sw-resize"):w&&J?f("nw-resize"):J&&c?f("ne-resize"):r?f("w-resize"):a?f("n-resize"):l?f("s-resize"):t?f("e-resize"):f()}var Ce={};p(Ce,{Hide:()=>Wo,Quit:()=>vo,Show:()=>bo});var Pe=m(d.Application),fo=0,go=1,ho=2;function Wo(){return Pe(fo)}function bo(){return Pe(go)}function vo(){return Pe(ho)}var Re={};p(Re,{ByID:()=>No,ByName:()=>Ho,Call:()=>Ae,RuntimeError:()=>$});var qe=Function.prototype.toString,O=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,De,Y;if(typeof O=="function"&&typeof Object.defineProperty=="function")try{De=Object.defineProperty({},"length",{get:function(){throw Y}}),Y={},O(function(){throw 42},null,De)}catch(n){n!==Y&&(O=null)}else O=null;var yo=/^\s*class\b/,Me=function(e){try{var i=qe.call(e);return yo.test(i)}catch(o){return!1}},Te=function(e){try{return Me(e)?!1:(qe.call(e),!0)}catch(i){return!1}},X=Object.prototype.toString,Po="[object Object]",Co="[object Function]",Do="[object GeneratorFunction]",To="[object HTMLAllCollection]",Mo="[object HTML document.all class]",So="[object HTMLCollection]",xo=typeof Symbol=="function"&&!!Symbol.toStringTag,Ao=!(0 in[,]),Se=function(){return!1};typeof document=="object"&&(Qe=document.all,X.call(Qe)===X.call(document.all)&&(Se=function(e){if((Ao||!e)&&(typeof e>"u"||typeof e=="object"))try{var i=X.call(e);return(i===To||i===Mo||i===So||i===Po)&&e("")==null}catch(o){}return!1}));var Qe;function Ro(n){if(Se(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;try{O(n,null,De)}catch(e){if(e!==Y)return!1}return!Me(n)&&Te(n)}function Eo(n){if(Se(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;if(xo)return Te(n);if(Me(n))return!1;var e=X.call(n);return e!==Co&&e!==Do&&!/^\[object HTML/.test(e)?!1:Te(n)}var W=O?Ro:Eo;var F=class extends Error{constructor(e,i){super(e,i),this.name="CancelError"}},b=class extends Error{constructor(e,i,o){super((o!=null?o:"Unhandled rejection in cancelled promise.")+" Reason: "+Oo(i),{cause:i}),this.promise=e,this.name="CancelledRejectionError"}},h=Symbol("barrier"),xe=Symbol("cancelImpl"),tn,en=(tn=Symbol.species)!=null?tn:Symbol("speciesPolyfill"),H=class n extends Promise{constructor(e,i){let o,t;if(super((c,w)=>{o=c,t=w}),this.constructor[en]!==Promise)throw new TypeError("CancellablePromise does not support transparent subclassing. Please refrain from overriding the [Symbol.species] static property.");let r={promise:this,resolve:o,reject:t,get oncancelled(){return i!=null?i:null},set oncancelled(c){i=c!=null?c:void 0}},a={get root(){return a},resolving:!1,settled:!1};Object.defineProperties(this,{[h]:{configurable:!1,enumerable:!1,writable:!0,value:null},[xe]:{configurable:!1,enumerable:!1,writable:!1,value:rn(r,a)}});let l=an(r,a);try{e(sn(r,a),l)}catch(c){a.resolving||l(c)}}cancel(e){return new n(i=>{Promise.all([this[xe](new F("Promise cancelled.",{cause:e})),ko(this)]).then(()=>i(),()=>i())})}cancelOn(e){return e.aborted?this.cancel(e.reason):e.addEventListener("abort",()=>void this.cancel(e.reason),{capture:!0}),this}then(e,i,o){if(!(this instanceof n))throw new TypeError("CancellablePromise.prototype.then called on an invalid object.");if(W(e)||(e=nn),W(i)||(i=on),e===nn&&i==on)return new n(r=>r(this));let t={};return this[h]=t,new n((r,a)=>{super.then(l=>{var c;this[h]===t&&(this[h]=null),(c=t.resolve)==null||c.call(t);try{r(e(l))}catch(w){a(w)}},l=>{var c;this[h]===t&&(this[h]=null),(c=t.resolve)==null||c.call(t);try{r(i(l))}catch(w){a(w)}})},async r=>{try{return o==null?void 0:o(r)}finally{await this.cancel(r)}})}catch(e,i){return this.then(void 0,e,i)}finally(e,i){if(!(this instanceof n))throw new TypeError("CancellablePromise.prototype.finally called on an invalid object.");return W(e)?this.then(o=>n.resolve(e()).then(()=>o),o=>n.resolve(e()).then(()=>{throw o}),i):this.then(e,e,i)}static get[(h,xe,en)](){return Promise}static all(e){let i=Array.from(e),o=i.length===0?n.resolve(i):new n((t,r)=>{Promise.all(i).then(t,r)},t=>_(o,i,t));return o}static allSettled(e){let i=Array.from(e),o=i.length===0?n.resolve(i):new n((t,r)=>{Promise.allSettled(i).then(t,r)},t=>_(o,i,t));return o}static any(e){let i=Array.from(e),o=i.length===0?n.resolve(i):new n((t,r)=>{Promise.any(i).then(t,r)},t=>_(o,i,t));return o}static race(e){let i=Array.from(e),o=new n((t,r)=>{Promise.race(i).then(t,r)},t=>_(o,i,t));return o}static cancel(e){let i=new n(()=>{});return i.cancel(e),i}static timeout(e,i){let o=new n(()=>{});return AbortSignal&&typeof AbortSignal=="function"&&AbortSignal.timeout&&typeof AbortSignal.timeout=="function"?AbortSignal.timeout(e).addEventListener("abort",()=>void o.cancel(i)):setTimeout(()=>void o.cancel(i),e),o}static sleep(e,i){return new n(o=>{setTimeout(()=>o(i),e)})}static reject(e){return new n((i,o)=>o(e))}static resolve(e){return e instanceof n?e:new n(i=>i(e))}static withResolvers(){let e={oncancelled:null};return e.promise=new n((i,o)=>{e.resolve=i,e.reject=o},i=>{var o;(o=e.oncancelled)==null||o.call(e,i)}),e}};function rn(n,e){let i;return o=>{if(e.settled||(e.settled=!0,e.reason=o,n.reject(o),Promise.prototype.then.call(n.promise,void 0,t=>{if(t!==o)throw t})),!(!e.reason||!n.oncancelled))return i=new Promise(t=>{try{t(n.oncancelled(e.reason.cause))}catch(r){Promise.reject(new b(n.promise,r,"Unhandled exception in oncancelled callback."))}}).catch(t=>{Promise.reject(new b(n.promise,t,"Unhandled rejection in oncancelled callback."))}),n.oncancelled=null,i}}function sn(n,e){return i=>{if(!e.resolving){if(e.resolving=!0,i===n.promise){if(e.settled)return;e.settled=!0,n.reject(new TypeError("A promise cannot be resolved with itself."));return}if(i!=null&&(typeof i=="object"||typeof i=="function")){let o;try{o=i.then}catch(t){e.settled=!0,n.reject(t);return}if(W(o)){try{let a=i.cancel;if(W(a)){let l=c=>{Reflect.apply(a,i,[c])};e.reason?rn(je(Ie({},n),{oncancelled:l}),e)(e.reason):n.oncancelled=l}}catch(a){}let t={root:e.root,resolving:!1,get settled(){return this.root.settled},set settled(a){this.root.settled=a},get reason(){return this.root.reason}},r=an(n,t);try{Reflect.apply(o,i,[sn(n,t),r])}catch(a){r(a)}return}}e.settled||(e.settled=!0,n.resolve(i))}}}function an(n,e){return i=>{if(!e.resolving)if(e.resolving=!0,e.settled){try{if(i instanceof F&&e.reason instanceof F&&Object.is(i.cause,e.reason.cause))return}catch(o){}Promise.reject(new b(n.promise,i))}else e.settled=!0,n.reject(i)}}function _(n,e,i){let o=[];for(let t of e){let r;try{if(!W(t.then)||(r=t.cancel,!W(r)))continue}catch(l){continue}let a;try{a=Reflect.apply(r,t,[i])}catch(l){Promise.reject(new b(n,l,"Unhandled exception in cancel method."));continue}a&&o.push((a instanceof Promise?a:Promise.resolve(a)).catch(l=>{Promise.reject(new b(n,l,"Unhandled rejection in cancel method."))}))}return Promise.all(o)}function nn(n){return n}function on(n){throw n}function Oo(n){try{if(n instanceof Error||typeof n!="object"||n.toString!==Object.prototype.toString)return""+n}catch(e){}try{return JSON.stringify(n)}catch(e){}try{return Object.prototype.toString.call(n)}catch(e){}return"<could not convert error to string>"}function ko(n){var i;let e=(i=n[h])!=null?i:{};return"promise"in e||Object.assign(e,k()),n[h]==null&&(e.resolve(),n[h]=e),e.promise}var k=Promise.withResolvers;k&&typeof k=="function"?k=k.bind(Promise):k=function(){let n,e;return{promise:new Promise((o,t)=>{n=o,e=t}),resolve:n,reject:e}};window._wails=window._wails||{};window._wails.callResultHandler=Io;window._wails.callErrorHandler=jo;var Fo=m(d.Call),Lo=m(d.CancelCall),L=new Map,zo=0,Uo=0,$=class extends Error{constructor(e,i){super(e,i),this.name="RuntimeError"}};function Io(n,e,i){let o=ln(n);if(o)if(!e)o.resolve(void 0);else if(!i)o.resolve(e);else try{o.resolve(JSON.parse(e))}catch(t){o.reject(new TypeError("could not parse result: "+t.message,{cause:t}))}}function jo(n,e,i){let o=ln(n);if(o)if(!i)o.reject(new Error(e));else{let t;try{t=JSON.parse(e)}catch(l){o.reject(new TypeError("could not parse error: "+l.message,{cause:l}));return}let r={};t.cause&&(r.cause=t.cause);let a;switch(t.kind){case"ReferenceError":a=new ReferenceError(t.message,r);break;case"TypeError":a=new TypeError(t.message,r);break;case"RuntimeError":a=new $(t.message,r);break;default:a=new Error(t.message,r);break}o.reject(a)}}function ln(n){let e=L.get(n);return L.delete(n),e}function Bo(){let n;do n=D();while(L.has(n));return n}function Ae(n){let e=Bo(),i=H.withResolvers();L.set(e,{resolve:i.resolve,reject:i.reject});let o=Fo(zo,Object.assign({"call-id":e},n)),t=!1;o.then(()=>{t=!0},a=>{L.delete(e),i.reject(a)});let r=()=>(L.delete(e),Lo(Uo,{"call-id":e}).catch(a=>{}));return i.oncancelled=()=>t?r():o.then(r),i.promise}function Ho(n,...e){return Ae({methodName:n,args:e})}function No(n,...e){return Ae({methodID:n,args:e})}var Ee={};p(Ee,{SetText:()=>Go,Text:()=>Ko});var cn=m(d.Clipboard),Zo=0,Vo=1;function Go(n){return cn(Zo,{text:n})}function Ko(){return cn(Vo)}var Oe={};p(Oe,{Any:()=>C,Array:()=>Xo,ByteSlice:()=>Yo,Map:()=>_o,Nullable:()=>$o,Struct:()=>Jo});function C(n){return n}function Yo(n){return n==null?"":n}function Xo(n){return n===C?e=>e===null?[]:e:e=>{if(e===null)return[];for(let i=0;i<e.length;i++)e[i]=n(e[i]);return e}}function _o(n,e){return e===C?i=>i===null?{}:i:i=>{if(i===null)return{};for(let o in i)i[o]=e(i[o]);return i}}function $o(n){return n===C?C:e=>e===null?null:n(e)}function Jo(n){let e=!0;for(let i in n)if(n[i]!==C){e=!1;break}return e?C:i=>{for(let o in n)o in i&&(i[o]=n[o](i[o]));return i}}var Fe={};p(Fe,{GetAll:()=>nt,GetCurrent:()=>ot,GetPrimary:()=>it});var ke=m(d.Screens),Qo=0,qo=1,et=2;function nt(){return ke(Qo)}function it(){return ke(qo)}function ot(){return ke(et)}window._wails=window._wails||{};window._wails.invoke=y;window._wails.handlePlatformFileDrop=S.HandlePlatformFileDrop.bind(S);y("wails:runtime:ready");export{Ce as Application,ee as Browser,Re as Call,F as CancelError,H as CancellablePromise,b as CancelledRejectionError,Ee as Clipboard,Oe as Create,ie as Dialogs,re as Events,ge as Flags,Fe as Screens,fe as System,de as WML,S as Window};
|