5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-11 22:49:29 +08:00
wails/v3/internal/assetserver/bundledassets/runtime.js
2025-02-25 18:30:52 +01:00

2 lines
33 KiB
JavaScript

var Le=Object.defineProperty,ln=Object.defineProperties;var cn=Object.getOwnPropertyDescriptors;var Oe=Object.getOwnPropertySymbols;var dn=Object.prototype.hasOwnProperty,mn=Object.prototype.propertyIsEnumerable;var Fe=(n,e,i)=>e in n?Le(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i,Ue=(n,e)=>{for(var i in e||(e={}))dn.call(e,i)&&Fe(n,i,e[i]);if(Oe)for(var i of Oe(e))mn.call(e,i)&&Fe(n,i,e[i]);return n},Ie=(n,e)=>ln(n,cn(e));var w=(n,e)=>{for(var i in e)Le(n,i,{get:e[i],enumerable:!0})};var P=(n,e,i)=>new Promise((o,t)=>{var r=l=>{try{c(i.next(l))}catch(u){t(u)}},a=l=>{try{c(i.throw(l))}catch(u){t(u)}},c=l=>l.done?o(l.value):Promise.resolve(l.value).then(r,a);c((i=i.apply(n,e)).next())});var de={};w(de,{Application:()=>ye,Browser:()=>$,Call:()=>xe,CancelError:()=>O,CancellablePromise:()=>B,CancelledRejectionError:()=>W,Clipboard:()=>Ae,Create:()=>Re,Dialogs:()=>ne,Events:()=>te,Flags:()=>pe,Screens:()=>ke,System:()=>we,WML:()=>ce,Window:()=>V});var ce={};w(ce,{Enable:()=>le,Reload:()=>Ye});var $={};w($,{OpenURL:()=>_});var un="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function D(n=21){let e="",i=n|0;for(;i--;)e+=un[Math.random()*64|0];return e}var wn=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}),pn=D();function m(n,e=""){return function(i,o=null){return fn(n,i,e,o)}}function fn(n,e,i,o){return P(this,null,function*(){var c,l;let t=new URL(wn);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":pn};i&&(r["x-wails-window-name"]=i);let a=yield fetch(t,{headers:r});if(!a.ok)throw new Error(yield a.text());return((l=(c=a.headers.get("Content-Type"))==null?void 0:c.indexOf("application/json"))!=null?l:-1)!==-1?a.json():a.text()})}var gn=m(d.Browser),hn=0;function _(n){return gn(hn,{url:n.toString()})}var ne={};w(ne,{Error:()=>Rn,Info:()=>xn,OpenFile:()=>En,Question:()=>ee,SaveFile:()=>kn,Warning:()=>An});window._wails=window._wails||{};window._wails.dialogErrorCallback=Sn;window._wails.dialogResultCallback=Mn;var Wn=m(d.Dialog),L=new Map,bn=0,vn=1,yn=2,Cn=3,Pn=4,Dn=5;function Mn(n,e,i){let o=ze(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 Sn(n,e){var i;(i=ze(n))==null||i.reject(new window.Error(e))}function ze(n){let e=L.get(n);return L.delete(n),e}function Tn(){let n;do n=D();while(L.has(n));return n}function M(n,e={}){let i=Tn();return new Promise((o,t)=>{L.set(i,{resolve:o,reject:t}),Wn(n,Object.assign({"dialog-id":i},e)).catch(r=>{L.delete(i),t(r)})})}function xn(n){return M(bn,n)}function An(n){return M(vn,n)}function Rn(n){return M(yn,n)}function ee(n){return M(Cn,n)}function En(n){var e;return(e=M(Pn,n))!=null?e:[]}function kn(n){return M(Dn,n)}var te={};w(te,{Emit:()=>oe,Off:()=>zn,OffAll:()=>jn,On:()=>Un,OnMultiple:()=>ie,Once:()=>In,Types:()=>Be,WailsEvent:()=>S});var f=new Map,H=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 je(n){let e=f.get(n.eventName);e&&(e=e.filter(i=>i!==n),e.length===0?f.delete(n.eventName):f.set(n.eventName,e))}var Be=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",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",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"})});window._wails=window._wails||{};window._wails.dispatchWailsEvent=Ln;var On=m(d.Events),Fn=0,S=class{constructor(e,i=null){this.name=e,this.data=i}};function Ln(n){let e=f.get(n.name);if(!e)return;let i=new S(n.name,n.data);"sender"in n&&(i.sender=n.sender),e=e.filter(o=>!o.dispatch(i)),e.length===0?f.delete(n.name):f.set(n.name,e)}function ie(n,e,i){let o=f.get(n)||[],t=new H(n,e,i);return o.push(t),f.set(n,o),()=>je(t)}function Un(n,e){return ie(n,e,-1)}function In(n,e){return ie(n,e,1)}function zn(...n){n.forEach(e=>f.delete(e))}function jn(){f.clear()}function oe(n){return On(Fn,n)}function He(){return new MouseEvent("mousedown").buttons===0}function Ne(){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 N(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 Ze=!1;document.addEventListener("DOMContentLoaded",()=>{Ze=!0});function Ve(n){Ze||document.readyState==="complete"?n():document.addEventListener("DOMContentLoaded",n)}var Bn=0,Hn=1,Nn=2,Zn=3,Vn=4,Kn=5,Gn=6,Yn=7,Xn=8,Jn=9,Qn=10,qn=11,_n=12,$n=13,ei=14,ni=15,ii=16,oi=17,ti=18,ri=19,si=20,ai=21,li=22,ci=23,di=24,mi=25,ui=26,wi=27,pi=28,fi=29,gi=30,hi=31,Wi=32,bi=33,vi=34,yi=35,Ci=36,Pi=37,Di=38,Mi=39,Si=40,Ti=41,xi=42,Ai=43,Ri=44,Ei=45,ki=46,Oi=47,s=Symbol("caller");s;var Z=class Z{constructor(e=""){this[s]=m(d.Window,e);for(let i of Object.getOwnPropertyNames(Z.prototype))i!=="constructor"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this))}Get(e){return new Z(e)}Position(){return this[s](Bn)}Center(){return this[s](Hn)}Close(){return this[s](Nn)}DisableSizeConstraints(){return this[s](Zn)}EnableSizeConstraints(){return this[s](Vn)}Focus(){return this[s](Kn)}ForceReload(){return this[s](Gn)}Fullscreen(){return this[s](Yn)}GetScreen(){return this[s](Xn)}GetZoom(){return this[s](Jn)}Height(){return this[s](Qn)}Hide(){return this[s](qn)}IsFocused(){return this[s](_n)}IsFullscreen(){return this[s]($n)}IsMaximised(){return this[s](ei)}IsMinimised(){return this[s](ni)}Maximise(){return this[s](ii)}Minimise(){return this[s](oi)}Name(){return this[s](ti)}OpenDevTools(){return this[s](ri)}RelativePosition(){return this[s](si)}Reload(){return this[s](ai)}Resizable(){return this[s](li)}Restore(){return this[s](ci)}SetPosition(e,i){return this[s](di,{x:e,y:i})}SetAlwaysOnTop(e){return this[s](mi,{alwaysOnTop:e})}SetBackgroundColour(e,i,o,t){return this[s](ui,{r:e,g:i,b:o,a:t})}SetFrameless(e){return this[s](wi,{frameless:e})}SetFullscreenButtonEnabled(e){return this[s](pi,{enabled:e})}SetMaxSize(e,i){return this[s](fi,{width:e,height:i})}SetMinSize(e,i){return this[s](gi,{width:e,height:i})}SetRelativePosition(e,i){return this[s](hi,{x:e,y:i})}SetResizable(e){return this[s](Wi,{resizable:e})}SetSize(e,i){return this[s](bi,{width:e,height:i})}SetTitle(e){return this[s](vi,{title:e})}SetZoom(e){return this[s](yi,{zoom:e})}Show(){return this[s](Ci)}Size(){return this[s](Pi)}ToggleFullscreen(){return this[s](Di)}ToggleMaximise(){return this[s](Mi)}UnFullscreen(){return this[s](Si)}UnMaximise(){return this[s](Ti)}UnMinimise(){return this[s](xi)}Width(){return this[s](Ai)}Zoom(){return this[s](Ri)}ZoomIn(){return this[s](Ei)}ZoomOut(){return this[s](ki)}ZoomReset(){return this[s](Oi)}},re=Z,Fi=new re(""),V=Fi;function Li(n,e=null){oe(new S(n,e))}function Ui(n,e){let i=V.Get(n),o=i[e];if(typeof o=="function")try{o.call(i)}catch(t){}}function Ke(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")||"",c=e.getAttribute("wml-window")||e.getAttribute("data-wml-window"),l=e.getAttribute("wml-openurl")||e.getAttribute("data-wml-openurl");r!==null&&Li(r),c!==null&&Ui(a,c),l!==null&&_(l)}let o=e.getAttribute("wml-confirm")||e.getAttribute("data-wml-confirm");o?ee({Title:"Confirm",Message:o,Detached:!1,Buttons:[{Label:"Yes"},{Label:"No",IsDefault:!0}]}).then(i):i()}var U=Symbol("controller"),T=Symbol("triggerMap"),b=Symbol("elementCount");U;var se=class{constructor(){this[U]=new AbortController}set(e,i){return{signal:this[U].signal}}reset(){this[U].abort(),this[U]=new AbortController}};T,b;var ae=class{constructor(){this[T]=new WeakMap,this[b]=0}set(e,i){return this[T].has(e)||this[b]++,this[T].set(e,i),{}}reset(){if(!(this[b]<=0)){for(let e of document.body.querySelectorAll("*")){if(this[b]<=0)break;let i=this[T].get(e);i!=null&&this[b]--;for(let o of i||[])e.removeEventListener(o,Ke)}this[T]=new WeakMap,this[b]=0}}},Ge=Ne()?new se:new ae;function Ii(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=Ge.set(n,o);for(let a of o)n.addEventListener(a,Ke,r)}function le(){Ve(Ye)}function Ye(){Ge.reset(),document.body.querySelectorAll("[wml-event], [wml-window], [wml-openurl], [data-wml-event], [data-wml-window], [data-wml-openurl]").forEach(Ii)}window.wails=de;le();var we={};w(we,{Capabilities:()=>Hi,Environment:()=>Ni,IsAMD64:()=>Ki,IsARM:()=>Gi,IsARM64:()=>Yi,IsDarkMode:()=>Bi,IsDebug:()=>ue,IsLinux:()=>Zi,IsMac:()=>Vi,IsWindows:()=>K,invoke:()=>v});var Xe=m(d.System),zi=0,ji=1,me=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 v(n){me==null||me(n)}function Bi(){return Xe(zi)}function Hi(){return P(this,null,function*(){let n=yield fetch("/wails/capabilities");if(n.ok)return n.json();throw new Error("could not fetch capabilities: "+n.statusText)})}function Ni(){return Xe(ji)}function K(){return window._wails.environment.OS==="windows"}function Zi(){return window._wails.environment.OS==="linux"}function Vi(){return window._wails.environment.OS==="darwin"}function Ki(){return window._wails.environment.Arch==="amd64"}function Gi(){return window._wails.environment.Arch==="arm"}function Yi(){return window._wails.environment.Arch==="arm64"}function ue(){return!!window._wails.environment.Debug}window.addEventListener("contextmenu",qi);var Xi=m(d.ContextMenu),Ji=0;function Qi(n,e,i,o){Xi(Ji,{id:n,x:e,y:i,data:o})}function qi(n){let e=N(n),i=window.getComputedStyle(e).getPropertyValue("--custom-contextmenu").trim();if(i){n.preventDefault();let o=window.getComputedStyle(e).getPropertyValue("--custom-contextmenu-data");Qi(i,n.clientX,n.clientY,o)}else _i(n,e)}function _i(n,e){if(ue())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 c=0;c<a.length;c++){let l=a[c];if(document.elementFromPoint(l.left,l.top)===e)return}}(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(o||!e.readOnly&&!e.disabled)||n.preventDefault()}var pe={};w(pe,{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 z=!1,j=!1,We=!1,A=!1,R=!1,y="",Je="auto",x=0,fe=He();window._wails=window._wails||{};window._wails.setResizable=n=>{We=n,We||(A=R=!1,p())};window.addEventListener("mousedown",be,{capture:!0});window.addEventListener("mousemove",be,{capture:!0});window.addEventListener("mouseup",be,{capture:!0});for(let n of["click","contextmenu","dblclick"])window.addEventListener(n,$i,{capture:!0});function $i(n){(j||R)&&(n.stopImmediatePropagation(),n.stopPropagation(),n.preventDefault())}var ge=0,eo=1,he=2;function be(n){let e,i=n.buttons;switch(n.type){case"mousedown":e=ge,fe||(i=x|1<<n.button);break;case"mouseup":e=eo,fe||(i=x&~(1<<n.button));break;default:e=he,fe||(i=x);break}let o=x&~i,t=i&~x;x=i,e===ge&&!(t&n.button)&&(o|=1<<n.button,t|=1<<n.button),(e!==he&&R||j&&(e===ge||n.button!==0))&&(n.stopImmediatePropagation(),n.stopPropagation(),n.preventDefault()),o&1&&io(n),t&1&&no(n),e===he&&to(n)}function no(n){if(z=!1,A=!1,!K()&&n.type==="mousedown"&&n.button===0&&n.detail!==1)return;if(y){A=!0;return}let e=N(n),i=window.getComputedStyle(e);z=i.getPropertyValue("--wails-draggable").trim()==="drag"&&n.offsetX-parseFloat(i.paddingLeft)<e.clientWidth&&n.offsetY-parseFloat(i.paddingTop)<e.clientHeight}function io(n){z=!1,j=!1,A=!1,R=!1}var oo=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 p(n){n?(y||(Je=document.body.style.cursor),document.body.style.cursor=oo[n]):!n&&y&&(document.body.style.cursor=Je),y=n||""}function to(n){if(A&&y?(R=!0,v("wails:resize:"+y)):z&&(j=!0,v("wails:drag")),j||R){z=A=!1;return}if(!We||!K()){y&&p();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,c=window.outerHeight-n.clientY<e,l=window.outerWidth-n.clientX<i+o,u=n.clientX<i+o,Q=n.clientY<e+o,q=window.outerHeight-n.clientY<e+o;!u&&!Q&&!q&&!l?p():l&&q?p("se-resize"):u&&q?p("sw-resize"):u&&Q?p("nw-resize"):Q&&l?p("ne-resize"):r?p("w-resize"):a?p("n-resize"):c?p("s-resize"):t?p("e-resize"):p()}var ye={};w(ye,{Hide:()=>lo,Quit:()=>mo,Show:()=>co});var ve=m(d.Application),ro=0,so=1,ao=2;function lo(){return ve(ro)}function co(){return ve(so)}function mo(){return ve(ao)}var xe={};w(xe,{ByID:()=>Oo,ByName:()=>ko,Call:()=>Te,RuntimeError:()=>J});var qe=Function.prototype.toString,E=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Ce,G;if(typeof E=="function"&&typeof Object.defineProperty=="function")try{Ce=Object.defineProperty({},"length",{get:function(){throw G}}),G={},E(function(){throw 42},null,Ce)}catch(n){n!==G&&(E=null)}else E=null;var uo=/^\s*class\b/,De=function(e){try{var i=qe.call(e);return uo.test(i)}catch(o){return!1}},Pe=function(e){try{return De(e)?!1:(qe.call(e),!0)}catch(i){return!1}},Y=Object.prototype.toString,wo="[object Object]",po="[object Function]",fo="[object GeneratorFunction]",go="[object HTMLAllCollection]",ho="[object HTML document.all class]",Wo="[object HTMLCollection]",bo=typeof Symbol=="function"&&!!Symbol.toStringTag,vo=!(0 in[,]),Me=function(){return!1};typeof document=="object"&&(Qe=document.all,Y.call(Qe)===Y.call(document.all)&&(Me=function(e){if((vo||!e)&&(typeof e=="undefined"||typeof e=="object"))try{var i=Y.call(e);return(i===go||i===ho||i===Wo||i===wo)&&e("")==null}catch(o){}return!1}));var Qe;function yo(n){if(Me(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;try{E(n,null,Ce)}catch(e){if(e!==G)return!1}return!De(n)&&Pe(n)}function Co(n){if(Me(n))return!0;if(!n||typeof n!="function"&&typeof n!="object")return!1;if(bo)return Pe(n);if(De(n))return!1;var e=Y.call(n);return e!==po&&e!==fo&&!/^\[object HTML/.test(e)?!1:Pe(n)}var h=E?yo:Co;var O=class extends Error{constructor(e,i){super(e,i),this.name="CancelError"}},W=class extends Error{constructor(e,i,o){super((o!=null?o:"Unhandled rejection in cancelled promise.")+" Reason: "+Po(i),{cause:i}),this.promise=e,this.name="CancelledRejectionError"}},g=Symbol("barrier"),Se=Symbol("cancelImpl"),nn,_e=(nn=Symbol.species)!=null?nn:Symbol("speciesPolyfill"),B=class n extends Promise{constructor(e,i){let o,t;if(super((l,u)=>{o=l,t=u}),this.constructor[_e]!==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(l){i=l!=null?l:void 0}},a={get root(){return a},resolving:!1,settled:!1};Object.defineProperties(this,{[g]:{configurable:!1,enumerable:!1,writable:!0,value:null},[Se]:{configurable:!1,enumerable:!1,writable:!1,value:on(r,a)}});let c=rn(r,a);try{e(tn(r,a),c)}catch(l){a.resolving||c(l)}}cancel(e){return new n(i=>{Promise.all([this[Se](new O("Promise cancelled.",{cause:e})),Do(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(h(e)||(e=$e),h(i)||(i=en),e===$e&&i==en)return new n(r=>r(this));let t={};return this[g]=t,new n((r,a)=>{super.then(c=>{var l;this[g]===t&&(this[g]=null),(l=t.resolve)==null||l.call(t);try{r(e(c))}catch(u){a(u)}},c=>{var l;this[g]===t&&(this[g]=null),(l=t.resolve)==null||l.call(t);try{r(i(c))}catch(u){a(u)}})},r=>P(this,null,function*(){try{return o==null?void 0:o(r)}finally{yield 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 h(e)?this.then(o=>n.resolve(e()).then(()=>o),o=>n.resolve(e()).then(()=>{throw o}),i):this.then(e,e,i)}static get[(g,Se,_e)](){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=>X(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=>X(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=>X(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=>X(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 on(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 W(n.promise,r,"Unhandled exception in oncancelled callback."))}}).catch(t=>{Promise.reject(new W(n.promise,t,"Unhandled rejection in oncancelled callback."))}),n.oncancelled=null,i}}function tn(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(h(o)){try{let a=i.cancel;if(h(a)){let c=l=>{Reflect.apply(a,i,[l])};e.reason?on(Ie(Ue({},n),{oncancelled:c}),e)(e.reason):n.oncancelled=c}}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=rn(n,t);try{Reflect.apply(o,i,[tn(n,t),r])}catch(a){r(a)}return}}e.settled||(e.settled=!0,n.resolve(i))}}}function rn(n,e){return i=>{if(!e.resolving)if(e.resolving=!0,e.settled){try{if(i instanceof O&&e.reason instanceof O&&Object.is(i.cause,e.reason.cause))return}catch(o){}Promise.reject(new W(n.promise,i))}else e.settled=!0,n.reject(i)}}function X(n,e,i){let o=[];for(let t of e){let r;try{if(!h(t.then)||(r=t.cancel,!h(r)))continue}catch(c){continue}let a;try{a=Reflect.apply(r,t,[i])}catch(c){Promise.reject(new W(n,c,"Unhandled exception in cancel method."));continue}a&&o.push((a instanceof Promise?a:Promise.resolve(a)).catch(c=>{Promise.reject(new W(n,c,"Unhandled rejection in cancel method."))}))}return Promise.all(o)}function $e(n){return n}function en(n){throw n}function Po(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 Do(n){var i;let e=(i=n[g])!=null?i:{};return"promise"in e||Object.assign(e,k()),n[g]==null&&(e.resolve(),n[g]=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=Ao;window._wails.callErrorHandler=Ro;var Mo=m(d.Call),So=m(d.CancelCall),F=new Map,To=0,xo=0,J=class extends Error{constructor(e,i){super(e,i),this.name="RuntimeError"}};function Ao(n,e,i){let o=sn(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 Ro(n,e,i){let o=sn(n);if(o)if(!i)o.reject(new Error(e));else{let t;try{t=JSON.parse(e)}catch(c){o.reject(new TypeError("could not parse error: "+c.message,{cause:c}));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 J(t.message,r);break;default:a=new Error(t.message,r);break}o.reject(a)}}function sn(n){let e=F.get(n);return F.delete(n),e}function Eo(){let n;do n=D();while(F.has(n));return n}function Te(n){let e=Eo(),i=B.withResolvers();F.set(e,{resolve:i.resolve,reject:i.reject});let o=Mo(To,Object.assign({"call-id":e},n)),t=!1;o.then(()=>{t=!0},a=>{F.delete(e),i.reject(a)});let r=()=>(F.delete(e),So(xo,{"call-id":e}).catch(a=>{}));return i.oncancelled=()=>t?r():o.then(r),i.promise}function ko(n,...e){return Te({methodName:n,args:e})}function Oo(n,...e){return Te({methodID:n,args:e})}var Ae={};w(Ae,{SetText:()=>Uo,Text:()=>Io});var an=m(d.Clipboard),Fo=0,Lo=1;function Uo(n){return an(Fo,{text:n})}function Io(){return an(Lo)}var Re={};w(Re,{Any:()=>C,Array:()=>jo,ByteSlice:()=>zo,Map:()=>Bo,Nullable:()=>Ho,Struct:()=>No});function C(n){return n}function zo(n){return n==null?"":n}function jo(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 Bo(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 Ho(n){return n===C?C:e=>e===null?null:n(e)}function No(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 ke={};w(ke,{GetAll:()=>Go,GetCurrent:()=>Xo,GetPrimary:()=>Yo});var Ee=m(d.Screens),Zo=0,Vo=1,Ko=2;function Go(){return Ee(Zo)}function Yo(){return Ee(Vo)}function Xo(){return Ee(Ko)}window._wails=window._wails||{};window._wails.invoke=v;v("wails:runtime:ready");export{ye as Application,$ as Browser,xe as Call,O as CancelError,B as CancellablePromise,W as CancelledRejectionError,Ae as Clipboard,Re as Create,ne as Dialogs,te as Events,pe as Flags,ke as Screens,we as System,ce as WML,V as Window};